mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 17:35:34 +00:00
added show function
This commit is contained in:
parent
1c31d38000
commit
ecb92640a2
1 changed files with 36 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
var CloudCommander, FuncyBox;
|
||||
var CloudCommander, CloudFunc;
|
||||
/* object contains viewer FuncyBox
|
||||
* https://github.com/fancyapps/fancyBox
|
||||
*/
|
||||
|
|
@ -10,6 +10,40 @@ CloudCommander.Viewer.FuncyBox = {
|
|||
src : 'http://fancyapps.com/fancybox/source/jquery.fancybox.css'
|
||||
});
|
||||
|
||||
CloudCommander.jsload('http://fancyapps.com/fancybox/source/jquery.fancybox.pack.js');
|
||||
CloudCommander.jsload(
|
||||
'http://fancyapps.com/fancybox/source/jquery.fancybox.pack.js',
|
||||
function(){
|
||||
$(".fancybox").fancybox({
|
||||
openEffect : 'none',
|
||||
closeEffect : 'none'
|
||||
});
|
||||
});
|
||||
|
||||
},
|
||||
show: function(){
|
||||
try{
|
||||
/* get current panel (left or right) */
|
||||
var lPanel = this.getByClass('current-file');
|
||||
|
||||
lPanel.length &&
|
||||
(lPanel = lPanel[0].parentElement);
|
||||
|
||||
/* get all file links */
|
||||
var lA = lPanel.getElementsByTagName('a');
|
||||
|
||||
var lName;
|
||||
for (var i; i < lA.length; i++) {
|
||||
lName = lA[i].title || lA[i].textContent;
|
||||
|
||||
CloudFunc.checkExtension(lName,'png') &&
|
||||
(lA[i].className = 'fancybox');
|
||||
}
|
||||
}catch(pError){
|
||||
console.log(pError);
|
||||
}
|
||||
},
|
||||
getById : function(pId){return document.getElementById(pId);},
|
||||
getByClass : function(pClass){
|
||||
return document.getElemenstByClassName(pClass);
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue