|
|
|
@ -11,21 +11,16 @@ |
|
|
|
|
|
|
|
|
|
// Returns true if the passed value is found in the
|
|
|
|
|
// array. Returns false if it is not.
|
|
|
|
|
Array.prototype.inArray = function (value,caseSensitive) |
|
|
|
|
{ |
|
|
|
|
Array.prototype.inArray = function (value,caseSensitive) { |
|
|
|
|
var i; |
|
|
|
|
for (i=0; i < this.length; i++)
|
|
|
|
|
{ |
|
|
|
|
for (i=0; i < this.length; i++) { |
|
|
|
|
// use === to check for Matches. ie., identical (===),
|
|
|
|
|
if(caseSensitive){ //performs match even the string is case sensitive
|
|
|
|
|
if (this[i].toLowerCase() == value.toLowerCase())
|
|
|
|
|
{ |
|
|
|
|
if (this[i].toLowerCase() == value.toLowerCase()) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
}else |
|
|
|
|
{ |
|
|
|
|
if (this[i] == value)
|
|
|
|
|
{ |
|
|
|
|
} else { |
|
|
|
|
if (this[i] == value) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -41,16 +36,14 @@ Array.prototype.inArray = function (value,caseSensitive) |
|
|
|
|
var linkElem = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function hadDoubleClick()
|
|
|
|
|
{ |
|
|
|
|
function hadDoubleClick() { |
|
|
|
|
var d = new Date(); |
|
|
|
|
var now = d.getTime(); |
|
|
|
|
if ((now - dcAt) < dcDelay)
|
|
|
|
|
{ |
|
|
|
|
if ((now - dcAt) < dcDelay) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -79,8 +72,7 @@ function enablePreview(elem, num) { |
|
|
|
|
var isSupportedExt = false; |
|
|
|
|
for (i in supportedExts) { |
|
|
|
|
var typeOf = typeof(supportedExts[i]);
|
|
|
|
|
if(typeOf.toLowerCase() == 'string' && supportedExts[i].toLowerCase() == ext.toLowerCase()) |
|
|
|
|
{ |
|
|
|
|
if(typeOf.toLowerCase() == 'string' && supportedExts[i].toLowerCase() == ext.toLowerCase()) { |
|
|
|
|
isSupportedExt = true; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
@ -531,21 +523,27 @@ function parseCurrentFolder() |
|
|
|
|
var url = getUrl('view', true, true); |
|
|
|
|
|
|
|
|
|
var parentPath = ''; |
|
|
|
|
for(var i = 0; i < folders.length; i++) |
|
|
|
|
{ |
|
|
|
|
if(i == 0) |
|
|
|
|
{ |
|
|
|
|
for(var i = 0; i < folders.length; i++) { |
|
|
|
|
if (i == 0) { |
|
|
|
|
parentPath += paths.root; |
|
|
|
|
str += '/<a href="' + appendQueryString(url, 'path='+ parentPath, ['path']) + '"><span class="folderRoot">' + paths.root_title + '</span></a>'
|
|
|
|
|
} else { |
|
|
|
|
//hack for Chamilo: rename breadcrumbs into shared folders
|
|
|
|
|
if(folders[i]=='shared_folder') { |
|
|
|
|
parentPath+=folders[i]+'/';str+='/<a href="'+appendQueryString(url,'path='+parentPath,['path'])+'"><span class="folderSub">'+shared_folder+'</span></a>'; |
|
|
|
|
} else if (folders[i].indexOf('shared_folder_session_')!=-1) { |
|
|
|
|
parentPath+=folders[i]+'/';str+='/<a href="'+appendQueryString(url,'path='+parentPath,['path'])+'"><span class="folderSub">'+shared_folder_session+'</span></a>'; |
|
|
|
|
} else if (folders[i].indexOf('sf_user_')!=-1) { |
|
|
|
|
parentPath+=folders[i]+'/';str+='/<a href="'+appendQueryString(url,'path='+parentPath,['path'])+'"><span class="folderSub">'+shared_user_folder+'</span></a>'; |
|
|
|
|
} else { |
|
|
|
|
parentPath+=folders[i]+'/';str+='/<a href="'+appendQueryString(url,'path='+parentPath,['path'])+'"><span class="folderSub">'+folders[i]+'</span></a>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}else |
|
|
|
|
{ |
|
|
|
|
if(folders[i] != '') |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
/*if(folders[i] != '') { |
|
|
|
|
parentPath += folders[i] + '/'; |
|
|
|
|
str += '/<a href="' + appendQueryString(url, 'path='+ parentPath , ['path']) + '"><span class="folderSub">' + folders[i] + '</span></a>'; |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
//end hack
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$('#currentFolderPath').empty().append(str); |
|
|
|
@ -933,13 +931,10 @@ function addMoreFile() |
|
|
|
|
* remove hidden upload frame |
|
|
|
|
* remove hidden upload form |
|
|
|
|
*/ |
|
|
|
|
function cancelFileUpload(elementId) |
|
|
|
|
{ |
|
|
|
|
function cancelFileUpload(elementId) { |
|
|
|
|
$('div#TB_window #' + elementId).parent().parent().remove(); |
|
|
|
|
|
|
|
|
|
//ensure there is at least one visible upload element
|
|
|
|
|
while($('div#TB_window #fileUploadBody tr').length < 2) |
|
|
|
|
{ |
|
|
|
|
while($('div#TB_window #fileUploadBody tr').length < 2) { |
|
|
|
|
addMoreFile(); |
|
|
|
|
} |
|
|
|
|
return false;
|
|
|
|
@ -949,11 +944,16 @@ function cancelFileUpload(elementId) |
|
|
|
|
*/ |
|
|
|
|
function uploadFile(elementId) { |
|
|
|
|
var ext = getFileExtension($('#' + elementId).val()); |
|
|
|
|
if(ext == '') |
|
|
|
|
{ |
|
|
|
|
var only_name_file=$('#'+elementId).val();// hack for Chamilo
|
|
|
|
|
|
|
|
|
|
/*if(ext == '') { |
|
|
|
|
alert(noFileSelected ); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
// hack for Chamilo
|
|
|
|
|
if(ext=='' && only_name_file!=''){alert(noFileSelected+'\n\n'+ only_name_file);return false;}// Chamilo replace the above line
|
|
|
|
|
|
|
|
|
|
var supportedExts = supportedUploadExts.split(","); |
|
|
|
|
var isSupportedExt = false; |
|
|
|
|
|
|
|
|
@ -1673,15 +1673,31 @@ function setDocInfo(type, num) { |
|
|
|
|
} else { |
|
|
|
|
$('#fileWritable').html("<span class=\"flagNo\"> </span>"); |
|
|
|
|
}
|
|
|
|
|
/* |
|
|
|
|
$('#folderFieldSet').css('display', 'none'); |
|
|
|
|
$('#fileFieldSet').css('display', ''); |
|
|
|
|
|
|
|
|
|
if (typeof(selectFile) != 'undefined' && $('#fileList input[@type=checkbox][@checked]').length==1 || $('#rightCol dl.thumbnailListing input[@type=checkbox][@checked]').length==1 ) { |
|
|
|
|
$('#selectCurrentUrl').unbind('click').click(function() { |
|
|
|
|
selectFile(info.url);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
$('#returnCurrentUrl').show();
|
|
|
|
|
} else { |
|
|
|
|
$('#returnCurrentUrl').hide(); |
|
|
|
|
} |
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}; |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
//hack for Chamilo replace this line below for insert/select in browse mode
|
|
|
|
|
|
|
|
|
|
$('#folderFieldSet').css('display','none'); |
|
|
|
|
$('#fileFieldSet').css('display',''); |
|
|
|
|
|
|
|
|
|
if(typeof(selectFile)!='undefined' && $('#fileList input[@type=checkbox][@checked]').length==1 || $('#rightCol dl.thumbnailListing input[@type=checkbox][@checked]').length==1){ |
|
|
|
|
$('#selectCurrentUrl').unbind('click').click(function(){ |
|
|
|
|
selectFile(info.url); |
|
|
|
|
}); |
|
|
|
|
$('#returnCurrentUrl').show(); |
|
|
|
|
} else {
|
|
|
|
|
$('#returnCurrentUrl').hide(); |
|
|
|
@ -1689,15 +1705,14 @@ function setDocInfo(type, num) { |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
function search() |
|
|
|
|
{ |
|
|
|
|
function search() { |
|
|
|
|
searchRequired = true;
|
|
|
|
|
var url = getUrl('view', true, true, true);
|
|
|
|
|
|
|
|
|
|
$('#rightCol').empty(); |
|
|
|
|
ajaxStart('#rightCol');
|
|
|
|
|
$('#rightCol').empty(); |
|
|
|
|
ajaxStart('#rightCol');
|
|
|
|
|
|
|
|
|
|
$('#rightCol').load(url,
|
|
|
|
|
$('#rightCol').load(url,
|
|
|
|
|
{}, |
|
|
|
|
function(){ |
|
|
|
|
ajaxStop('#rightCol img.ajaxLoadingImg'); |
|
|
|
|