Your IP : 216.73.216.170


Current Path : /var/www/iplanru/data/www/i-plan.ru/media/zoo/assets/js/
Upload File :
Current File : /var/www/iplanru/data/www/i-plan.ru/media/zoo/assets/js/finder.js

/* Copyright (C) YOOtheme GmbH, http://www.gnu.org/licenses/gpl.html GNU/GPL */

(function(e){var t=function(){};e.extend(t.prototype,{name:"finder",initialize:function(t,i){var n=this;this.options=e.extend({url:"",path:"",open:"open",loading:"loading"},i);t.data("path",this.options.path).bind("retrieve:finder",o).trigger("retrieve:finder");function o(i){i.preventDefault();var a=e(this).closest("li",t);if(!a.length){a=t}if(a.hasClass(n.options.open)){a.removeClass(n.options.open).children("ul").slideUp()}else{a.addClass(n.options.loading);e.post(n.options.url,{path:a.data("path")},function(t){a.removeClass(n.options.loading).addClass(n.options.open);if(!t.length)return;a.children().remove("ul");a.append("<ul>").children("ul").hide();e.each(t,function(t,i){a.children("ul").append(e('<li><a href="#">'+i.name+"</a></li>").addClass(i.type).data("path",i.path))});a.find("ul a").bind("click",o);a.children("ul").slideDown()},"json")}}}});e.fn[t.prototype.name]=function(){var i=arguments;var n=i[0]?i[0]:null;return this.each(function(){var o=e(this);if(t.prototype[n]&&o.data(t.prototype.name)&&n!="initialize"){o.data(t.prototype.name)[n].apply(o.data(t.prototype.name),Array.prototype.slice.call(i,1))}else if(!n||e.isPlainObject(n)){var a=new t;if(t.prototype["initialize"]){a.initialize.apply(a,e.merge([o],i))}o.data(t.prototype.name,a)}else{e.error("Method "+n+" does not exist on jQuery."+t.name)}})}})(jQuery);(function(e){var t=function(){};e.extend(t.prototype,{name:"Directories",initialize:function(t,i){this.options=e.extend({url:"",title:"Folders",mode:"folder",msgDelete:"Delete"},i);var n=this;var o=e('<div class="finder" />').insertAfter(t).finder(this.options).delegate("a","click",function(i){o.find("li").removeClass("selected");var a=e(this).parent().addClass("selected");if(n.options.mode!="file"||a.hasClass("file")){t.focus().val(a.data("path")).blur()}});var a=o.dialog(e.extend({autoOpen:false,resizable:false,open:function(){a.position({of:l,my:"center top",at:"center bottom"})}},this.options)).dialog("widget");var l=e('<span title="'+this.options.title+'" class="'+this.options.mode+'s" />').insertAfter(t).bind("click",function(){o.dialog(o.dialog("isOpen")?"close":"open")});e('<span title="'+this.options.msgDelete+'" class="delete-file" />').insertAfter(l).bind("click",function(){t.val("")});e("body").bind("click",function(e){if(o.dialog("isOpen")&&!l.is(e.target)&&!a.find(e.target).length){o.dialog("close")}})}});e.fn[t.prototype.name]=function(){var i=arguments;var n=i[0]?i[0]:null;return this.each(function(){var o=e(this);if(t.prototype[n]&&o.data(t.prototype.name)&&n!="initialize"){o.data(t.prototype.name)[n].apply(o.data(t.prototype.name),Array.prototype.slice.call(i,1))}else if(!n||e.isPlainObject(n)){var a=new t;if(t.prototype["initialize"]){a.initialize.apply(a,e.merge([o],i))}o.data(t.prototype.name,a)}else{e.error("Method "+n+" does not exist on jQuery."+t.name)}})}})(jQuery);