From 392b53dbf9151f4918383e88b6f7b88b62c791e4 Mon Sep 17 00:00:00 2001 From: hauke Date: Sat, 6 Sep 2014 17:46:31 +0200 Subject: [PATCH] minified js files where out of date and inconsistently used. Removed until decision on minifying strategy --- js/acl.min.js | 1 - js/ajaxupload.min.js | 41 ------------------- js/country.min.js | 2 - js/fk.autocomplete.min.js | 1 - js/jquery.htmlstream.min.js | 1 - js/main.min.js | 1 - js/webtoolkit.base64.min.js | 1 - view/theme/decaf-mobile/templates/jot-end.tpl | 2 +- view/theme/decaf-mobile/templates/msg-end.tpl | 2 +- .../decaf-mobile/templates/profed_end.tpl | 2 +- .../decaf-mobile/templates/wallmsg-end.tpl | 2 +- view/theme/frost-mobile/templates/end.tpl | 10 ++--- view/theme/frost-mobile/templates/jot-end.tpl | 2 +- view/theme/frost-mobile/templates/msg-end.tpl | 2 +- .../frost-mobile/templates/profed_end.tpl | 2 +- .../frost-mobile/templates/wallmsg-end.tpl | 2 +- view/theme/frost/js/acl.js | 4 +- view/theme/frost/js/acl.min.js | 1 - view/theme/frost/js/main.min.js | 1 - view/theme/frost/js/theme.min.js | 1 - view/theme/frost/templates/end.tpl | 10 ++--- view/theme/frost/templates/jot-end.tpl | 2 +- view/theme/frost/templates/msg-end.tpl | 2 +- view/theme/frost/templates/profed_end.tpl | 2 +- view/theme/frost/templates/wallmsg-end.tpl | 2 +- 25 files changed, 24 insertions(+), 75 deletions(-) delete mode 100644 js/acl.min.js delete mode 100644 js/ajaxupload.min.js delete mode 100644 js/country.min.js delete mode 100644 js/fk.autocomplete.min.js delete mode 100644 js/jquery.htmlstream.min.js delete mode 100644 js/main.min.js delete mode 100644 js/webtoolkit.base64.min.js delete mode 100644 view/theme/frost/js/acl.min.js delete mode 100644 view/theme/frost/js/main.min.js delete mode 100644 view/theme/frost/js/theme.min.js diff --git a/js/acl.min.js b/js/acl.min.js deleted file mode 100644 index b3ad459e96..0000000000 --- a/js/acl.min.js +++ /dev/null @@ -1 +0,0 @@ -function ACL(backend_url,preset){that=this;that.url=backend_url;that.kp_timer=null;if(preset==undefined)preset=[];that.allow_cid=preset[0]||[];that.allow_gid=preset[1]||[];that.deny_cid=preset[2]||[];that.deny_gid=preset[3]||[];that.group_uids=[];that.nw=4;that.list_content=$("#acl-list-content");that.item_tpl=unescape($(".acl-list-item[rel=acl-template]").html());that.showall=$("#acl-showall");if(preset.length==0)that.showall.addClass("selected");that.showall.click(that.on_showall);$(".acl-button-show").live("click",that.on_button_show);$(".acl-button-hide").live("click",that.on_button_hide);$("#acl-search").keypress(that.on_search);$("#acl-wrapper").parents("form").submit(that.on_submit);that.get(0,100)}ACL.prototype.on_submit=function(){aclfileds=$("#acl-fields").html("");$(that.allow_gid).each(function(i,v){aclfileds.append("")});$(that.allow_cid).each(function(i,v){aclfileds.append("")});$(that.deny_gid).each(function(i,v){aclfileds.append("")});$(that.deny_cid).each(function(i,v){aclfileds.append("")})};ACL.prototype.search=function(){var srcstr=$("#acl-search").val();that.list_content.html("");that.get(0,100,srcstr)};ACL.prototype.on_search=function(event){if(that.kp_timer)clearTimeout(that.kp_timer);that.kp_timer=setTimeout(that.search,1e3)};ACL.prototype.on_showall=function(event){event.preventDefault();event.stopPropagation();if(that.showall.hasClass("selected")){return false}that.showall.addClass("selected");that.allow_cid=[];that.allow_gid=[];that.deny_cid=[];that.deny_gid=[];that.update_view();return false};ACL.prototype.on_button_show=function(event){event.preventDefault();event.stopImmediatePropagation();event.stopPropagation();that.set_allow($(this).parent().attr("id"));return false};ACL.prototype.on_button_hide=function(event){event.preventDefault();event.stopImmediatePropagation();event.stopPropagation();that.set_deny($(this).parent().attr("id"));return false};ACL.prototype.set_allow=function(itemid){type=itemid[0];id=parseInt(itemid.substr(1));switch(type){case"g":if(that.allow_gid.indexOf(id)<0){that.allow_gid.push(id)}else{that.allow_gid.remove(id)}if(that.deny_gid.indexOf(id)>=0)that.deny_gid.remove(id);break;case"c":if(that.allow_cid.indexOf(id)<0){that.allow_cid.push(id)}else{that.allow_cid.remove(id)}if(that.deny_cid.indexOf(id)>=0)that.deny_cid.remove(id);break}that.update_view()};ACL.prototype.set_deny=function(itemid){type=itemid[0];id=parseInt(itemid.substr(1));switch(type){case"g":if(that.deny_gid.indexOf(id)<0){that.deny_gid.push(id)}else{that.deny_gid.remove(id)}if(that.allow_gid.indexOf(id)>=0)that.allow_gid.remove(id);break;case"c":if(that.deny_cid.indexOf(id)<0){that.deny_cid.push(id)}else{that.deny_cid.remove(id)}if(that.allow_cid.indexOf(id)>=0)that.allow_cid.remove(id);break}that.update_view()};ACL.prototype.update_view=function(){if(that.allow_gid.length==0&&that.allow_cid.length==0&&that.deny_gid.length==0&&that.deny_cid.length==0){that.showall.addClass("selected");$("#jot-perms-icon").removeClass("lock").addClass("unlock");$("#jot-public").show();$(".profile-jot-net input").attr("disabled",false);if(typeof editor!="undefined"&&editor!=false){$("#profile-jot-desc").html(ispublic)}}else{that.showall.removeClass("selected");$("#jot-perms-icon").removeClass("unlock").addClass("lock");$("#jot-public").hide();$(".profile-jot-net input").attr("disabled","disabled");$("#profile-jot-desc").html(" ")}$("#acl-list-content .acl-list-item").each(function(){$(this).removeClass("groupshow grouphide")});$("#acl-list-content .acl-list-item").each(function(){itemid=$(this).attr("id");type=itemid[0];id=parseInt(itemid.substr(1));btshow=$(this).children(".acl-button-show").removeClass("selected");bthide=$(this).children(".acl-button-hide").removeClass("selected");switch(type){case"g":var uclass="";if(that.allow_gid.indexOf(id)>=0){btshow.addClass("selected");bthide.removeClass("selected");uclass="groupshow"}if(that.deny_gid.indexOf(id)>=0){btshow.removeClass("selected");bthide.addClass("selected");uclass="grouphide"}$(that.group_uids[id]).each(function(i,v){if(uclass=="grouphide")$("#c"+v).removeClass("groupshow");if(uclass!=""){var cls=$("#c"+v).attr("class");if(cls==undefined)return true;var hiding=cls.indexOf("grouphide");if(hiding==-1)$("#c"+v).addClass(uclass)}});break;case"c":if(that.allow_cid.indexOf(id)>=0){btshow.addClass("selected");bthide.removeClass("selected")}if(that.deny_cid.indexOf(id)>=0){btshow.removeClass("selected");bthide.addClass("selected")}}})};ACL.prototype.get=function(start,count,search){var postdata={start:start,count:count,search:search};$.ajax({type:"POST",url:that.url,data:postdata,dataType:"json",success:that.populate})};ACL.prototype.populate=function(data){var height=Math.ceil(data.tot/that.nw)*42;that.list_content.height(height);$(data.items).each(function(){html="
"+that.item_tpl+"
";html=html.format(this.photo,this.name,this.type,this.id,"",this.network,this.link);if(this.uids!=undefined)that.group_uids[this.id]=this.uids;that.list_content.append(html)});$(".acl-list-item img[data-src]",that.list_content).each(function(i,el){$(el).attr("src",$(el).data("src"))});that.update_view()}; \ No newline at end of file diff --git a/js/ajaxupload.min.js b/js/ajaxupload.min.js deleted file mode 100644 index 960bf3b87a..0000000000 --- a/js/ajaxupload.min.js +++ /dev/null @@ -1,41 +0,0 @@ - -(function(){function log(){if(typeof(console)!='undefined'&&typeof(console.log)=='function'){Array.prototype.unshift.call(arguments,'[Ajax Upload]');console.log(Array.prototype.join.call(arguments,' '));}} -function addEvent(el,type,fn){if(el.addEventListener){el.addEventListener(type,fn,false);}else if(el.attachEvent){el.attachEvent('on'+type,function(){fn.call(el);});}else{throw new Error('not supported or DOM not loaded');}} -function addResizeEvent(fn){var timeout;addEvent(window,'resize',function(){if(timeout){clearTimeout(timeout);} -timeout=setTimeout(fn,100);});} -var getOffsetSlow=function(el){var top=0,left=0;do{top+=el.offsetTop||0;left+=el.offsetLeft||0;el=el.offsetParent;}while(el);return{left:left,top:top};};if(document.documentElement.getBoundingClientRect){var getOffset=function(el){var box=el.getBoundingClientRect();var doc=el.ownerDocument;var body=doc.body;var docElem=doc.documentElement;var clientTop=docElem.clientTop||body.clientTop||0;var clientLeft=docElem.clientLeft||body.clientLeft||0;var zoom=1;if(body.getBoundingClientRect){var bound=body.getBoundingClientRect();zoom=(bound.right-bound.left)/body.clientWidth;} -if(zoom==0||body.clientWidth==0) -return getOffsetSlow(el);if(zoom>1){clientTop=0;clientLeft=0;} -var top=box.top/zoom+(window.pageYOffset||docElem&&docElem.scrollTop/zoom||body.scrollTop/zoom)-clientTop,left=box.left/zoom+(window.pageXOffset||docElem&&docElem.scrollLeft/zoom||body.scrollLeft/zoom)-clientLeft;return{top:top,left:left};};}else{var getOffset=getOffsetSlow;} -function getBox(el){var left,right,top,bottom;var offset=getOffset(el);left=offset.left;top=offset.top;right=left+el.offsetWidth;bottom=top+el.offsetHeight;return{left:left,right:right,top:top,bottom:bottom};} -function addStyles(el,styles){for(var name in styles){if(styles.hasOwnProperty(name)){el.style[name]=styles[name];}}} -function copyLayout(from,to){var box=getBox(from);addStyles(to,{position:'absolute',left:box.left+'px',top:box.top+'px',width:from.offsetWidth+'px',height:from.offsetHeight+'px'});to.title=from.title;} -var toElement=(function(){var div=document.createElement('div');return function(html){div.innerHTML=html;var el=div.firstChild;return div.removeChild(el);};})();var getUID=(function(){var id=0;return function(){return'ValumsAjaxUpload'+id++;};})();function fileFromPath(file){return file.replace(/.*(\/|\\)/,"");} -function getExt(file){return(-1!==file.indexOf('.'))?file.replace(/.*[.]/,''):'';} -function hasClass(el,name){var re=new RegExp('\\b'+name+'\\b');return re.test(el.className);} -function addClass(el,name){if(!hasClass(el,name)){el.className+=' '+name;}} -function removeClass(el,name){var re=new RegExp('\\b'+name+'\\b');el.className=el.className.replace(re,'');} -function removeNode(el){el.parentNode.removeChild(el);} -window.AjaxUpload=function(button,options){this._settings={action:'upload.php',name:'userfile',data:{},autoSubmit:true,responseType:false,hoverClass:'hover',focusClass:'focus',disabledClass:'disabled',onChange:function(file,extension){},onSubmit:function(file,extension){},onComplete:function(file,response){}};for(var i in options){if(options.hasOwnProperty(i)){this._settings[i]=options[i];}} -if(button.jquery){button=button[0];}else if(typeof button=="string"){if(/^#.*/.test(button)){button=button.slice(1);} -button=document.getElementById(button);} -if(!button||button.nodeType!==1){throw new Error("Please make sure that you're passing a valid element");} -if(button.nodeName.toUpperCase()=='A'){addEvent(button,'click',function(e){if(e&&e.preventDefault){e.preventDefault();}else if(window.event){window.event.returnValue=false;}});} -this._button=button;this._input=null;this._disabled=false;this.enable();this._rerouteClicks();};AjaxUpload.prototype={setData:function(data){this._settings.data=data;},disable:function(){addClass(this._button,this._settings.disabledClass);this._disabled=true;var nodeName=this._button.nodeName.toUpperCase();if(nodeName=='INPUT'||nodeName=='BUTTON'){this._button.setAttribute('disabled','disabled');} -if(this._input){this._input.parentNode.style.visibility='hidden';}},enable:function(){removeClass(this._button,this._settings.disabledClass);this._button.removeAttribute('disabled');this._disabled=false;},_createInput:function(){var self=this;var input=document.createElement("input");input.setAttribute('type','file');input.setAttribute('name',this._settings.name);addStyles(input,{'position':'absolute','right':0,'margin':0,'padding':0,'fontSize':'480px','fontFamily':'sans-serif','cursor':'pointer'});var div=document.createElement("div");addStyles(div,{'display':'block','position':'absolute','overflow':'hidden','margin':0,'padding':0,'opacity':0,'direction':'ltr','zIndex':2147483583,'cursor':'pointer'});if(div.style.opacity!=="0"){if(typeof(div.filters)=='undefined'){throw new Error('Opacity not supported by the browser');} -div.style.filter="alpha(opacity=0)";} -addEvent(input,'change',function(){if(!input||input.value===''){return;} -var file=fileFromPath(input.value);if(false===self._settings.onChange.call(self,file,getExt(file))){self._clearInput();return;} -if(self._settings.autoSubmit){self.submit();}});addEvent(input,'mouseover',function(){addClass(self._button,self._settings.hoverClass);});addEvent(input,'mouseout',function(){removeClass(self._button,self._settings.hoverClass);removeClass(self._button,self._settings.focusClass);input.parentNode.style.visibility='hidden';});addEvent(input,'focus',function(){addClass(self._button,self._settings.focusClass);});addEvent(input,'blur',function(){removeClass(self._button,self._settings.focusClass);});div.appendChild(input);document.body.appendChild(div);this._input=input;},_clearInput:function(){if(!this._input){return;} -removeNode(this._input.parentNode);this._input=null;this._createInput();removeClass(this._button,this._settings.hoverClass);removeClass(this._button,this._settings.focusClass);},_rerouteClicks:function(){var self=this;addEvent(self._button,'mouseover',function(){if(self._disabled){return;} -if(!self._input){self._createInput();} -var div=self._input.parentNode;copyLayout(self._button,div);div.style.visibility='visible';});},_createIframe:function(){var id=getUID();var iframe=toElement('