r114282 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114281‎ | r114282 | r114283 >
Date:17:13, 20 March 2012
Author:jdlrobson
Status:ok
Tags:
Comment:
update latest minified js versions
Modified paths:
  • /trunk/extensions/MobileFrontend/javascripts/beta_opensearch.min.js (modified) (history)
  • /trunk/extensions/MobileFrontend/javascripts/toggle.min.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/javascripts/beta_opensearch.min.js
@@ -1 +1 @@
2 -MobileFrontend.opensearch=(function(){var c="/api.php",m=-1,d=500,A=15,q,k=document.getElementById("search"),a=document.getElementById("searchbox"),r=document.getElementById("content"),o=document.getElementById("footer"),y=document.getElementById("clearsearch"),j=false,x,w,n=MobileFrontend.utils;c=MobileFrontend.setting("scriptPath")+c;function s(){results.style.display="none"}x=n('meta[name="viewport"]');if(x){x=x[0];w=x.getAttribute("content")}function h(){if(x){x.setAttribute("content","minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0");n(document.body).bind("gesturestart",function(){x.setAttribute("content",w)})}}h();k.onfocus=function(){var u,B;a=document.getElementById("searchbox");header=document.getElementById("header");r=document.getElementById("content");o=document.getElementById("footer");h();if(!j){MobileFrontend.utils(document.body).addClass("full-screen-search");u=document.getElementById("remove-results");if(!u){u=document.createElement("a");u.setAttribute("href","#");u.setAttribute("id","remove-results");n(u).bind("click",z);B=document.createElement("div");B.setAttribute("id","left-arrow");u.appendChild(B);header.insertBefore(u,header.firstChild)}j=true}};function z(){MobileFrontend.utils(document.body).removeClass("full-screen-search");if(j){j=false}if(y){y.style.display="none"}}function b(B){var u;if(!B){B=window.event}if(B.target){u=B.target}else{if(B.srcElement){u=B.srcElement}}if(u.nodeType===3){u=u.parentNode}B.cancelBubble=true;B.stopPropagation();if(u.className==="suggestion-result"||u.className==="search-result-item"||u.className==="suggestions-result"||u.className==="sq-val-update"||u.id==="results"||u.id==="search"||u.id==="searchbox"||u.id==="sq"||u.id==="placeholder"||u.id==="clearsearch"||u.tagName==="BODY"){if(u.id==="clearsearch"&&results){results.innerHTML=""}}else{s()}}var l=function(u){u.preventDefault();clearTimeout(m);q=k.value;if(q.length<1){results.innerHTML=""}else{q=encodeURIComponent(q);m=setTimeout(function(){i(q)},d)}};n(k).bind("keyup",l);n(document.getElementById("searchForm")).bind("submit",l);n(k).bind("blur",l);function i(u){url=c+"?action=opensearch&limit="+A+"&namespace=0&format=xml&search="+u;n.ajax({url:url,success:function(B){if(n(document.body).hasClass("full-screen-search")){p(g(B))}}})}function g(E){var F=[],B,C,D,u=E.getElementsByTagName("Item");for(B=0;B<u.length;B++){C=u[B];D={label:C.getElementsByTagName("Text")[0].textContent,value:C.getElementsByTagName("Url")[0].textContent};F.push(D)}return F}function e(C){var B=document.createTextNode(C),u=document.createElement("div");u.appendChild(B);return u.innerHTML}function v(u){return u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function p(J){var D=document.getElementById("results"),F,E,C=e(document.getElementById("search").value),I,B,u,G,H;D.style.display="block";if(k){k.focus()}if(!J||J.length<1){D.innerHTML='<ul class="suggestions-results" title="No Results"><li class="suggestions-result">No Results</li></div>'}else{if(D.firstChild){D.removeChild(D.firstChild)}F=document.createElement("ul");F.className="suggestions-results";D.appendChild(F);for(E=0;E<J.length;E++){I=J[E];u=document.createElement("li");u.setAttribute("title",I.label);u.className="suggestions-result";G=document.createElement("a");G.setAttribute("href",I.value.replace(/^(?:\/\/|[^\/]+)*\//,"/"));G.className="search-result-item";H=document.createTextNode(I.label);G.appendChild(H);u.appendChild(G);F.appendChild(u);B=v(C);G.innerHTML=G.innerHTML.replace(new RegExp("("+B+")","ig"),"<strong>$1</strong>")}}}function f(){var E=document.getElementById("clearsearch"),u=document.getElementById("search");function C(){if(E){if(u.value.length>0){E.style.display="block"}else{E.style.display="none"}}}function B(F){u.value="";E.style.display="none";F.preventDefault()}function D(){u.select()}n(E).bind("mousedown",B);n(u).bind("keyup",C);n(u).bind("click",D)}function t(){var u=document.getElementById("results");u.onmousedown=b;document.body.onmousedown=b;document.body.ontouchstart=b;u.ontouchstart=b}t();f();return{init:t,initClearSearch:f,writeResults:p,createObjectArray:g,removeResults:z}}());
\ No newline at end of file
 2+MobileFrontend.opensearch=(function(){var c="/api.php",m=-1,d=500,A=15,q,k=document.getElementById("search"),a=document.getElementById("searchbox"),r=document.getElementById("content"),o=document.getElementById("footer"),y=document.getElementById("clearsearch"),j=false,x,w,n=MobileFrontend.utils;c=MobileFrontend.setting("scriptPath")+c;function s(){results.style.display="none"}x=n('meta[name="viewport"]');if(x){x=x[0];w=x.getAttribute("content")}function h(){if(x){x.setAttribute("content","minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0");n(document.body).bind("gesturestart",function(){x.setAttribute("content",w)})}}h();k.onfocus=function(){var u,B;a=document.getElementById("searchbox");header=document.getElementById("header");r=document.getElementById("content");o=document.getElementById("footer");h();if(!j){MobileFrontend.utils(document.body).addClass("full-screen-search");u=document.getElementById("remove-results");if(!u){u=document.createElement("a");u.setAttribute("href","#");u.setAttribute("id","remove-results");n(u).bind("click",z);B=document.createElement("div");B.setAttribute("id","left-arrow");u.appendChild(B);header.insertBefore(u,header.firstChild)}j=true}};function z(){MobileFrontend.utils(document.body).removeClass("full-screen-search");if(j){j=false}}function b(B){var u;if(!B){B=window.event}if(B.target){u=B.target}else{if(B.srcElement){u=B.srcElement}}if(u.nodeType===3){u=u.parentNode}B.cancelBubble=true;B.stopPropagation();if(u.className==="suggestion-result"||u.className==="search-result-item"||u.className==="suggestions-result"||u.className==="sq-val-update"||u.id==="results"||u.id==="search"||u.id==="searchbox"||u.id==="sq"||u.id==="placeholder"||u.id==="clearsearch"||u.tagName==="BODY"){if(u.id==="clearsearch"&&results){results.innerHTML=""}}else{s()}}var l=function(u){u.preventDefault();clearTimeout(m);q=k.value;if(q.length<1){results.innerHTML=""}else{q=encodeURIComponent(q);m=setTimeout(function(){i(q)},d)}};n(k).bind("keyup",l);n(document.getElementById("searchForm")).bind("submit",l);n(k).bind("blur",l);function i(u){url=c+"?action=opensearch&limit="+A+"&namespace=0&format=xml&search="+u;n.ajax({url:url,success:function(B){if(n(document.body).hasClass("full-screen-search")){p(g(B))}}})}function g(E){var F=[],B,C,D,u=E.getElementsByTagName("Item");for(B=0;B<u.length;B++){C=u[B];D={label:C.getElementsByTagName("Text")[0].textContent,value:C.getElementsByTagName("Url")[0].textContent};F.push(D)}return F}function e(C){var B=document.createTextNode(C),u=document.createElement("div");u.appendChild(B);return u.innerHTML}function v(u){return u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function p(J){var D=document.getElementById("results"),F,E,C=e(document.getElementById("search").value),I,B,u,G,H;D.style.display="block";if(k){k.focus()}if(!J||J.length<1){D.innerHTML='<ul class="suggestions-results" title="No Results"><li class="suggestions-result">No Results</li></div>'}else{if(D.firstChild){D.removeChild(D.firstChild)}F=document.createElement("ul");F.className="suggestions-results";D.appendChild(F);for(E=0;E<J.length;E++){I=J[E];u=document.createElement("li");u.setAttribute("title",I.label);u.className="suggestions-result";G=document.createElement("a");G.setAttribute("href",I.value.replace(/^(?:\/\/|[^\/]+)*\//,"/"));G.className="search-result-item";H=document.createTextNode(I.label);G.appendChild(H);u.appendChild(G);F.appendChild(u);B=v(C);G.innerHTML=G.innerHTML.replace(new RegExp("("+B+")","ig"),"<strong>$1</strong>")}}}function f(){var D=document.getElementById("clearsearch"),u=document.getElementById("search");function B(E){u.value="";E.preventDefault()}function C(){u.select()}n(D).bind("mousedown",B);n(u).bind("click",C)}function t(){var u=document.getElementById("results");u.onmousedown=b;document.body.onmousedown=b;document.body.ontouchstart=b;u.ontouchstart=b}t();f();return{init:t,initClearSearch:f,writeResults:p,createObjectArray:g,removeResults:z}}());
\ No newline at end of file
Index: trunk/extensions/MobileFrontend/javascripts/toggle.min.js
@@ -1 +1 @@
2 -MobileFrontend.toggle=(function(){var a=MobileFrontend.utils;function c(){var l,f,n,m,h=a(".section_heading");window.wm_toggle_section=b;m=a(".section_heading button");for(l=0;l<m.length;l++){a(m[l]).remove()}function k(){var i=this.id?this.id.split("_")[1]:-1;if(i!==-1){b(i)}}function g(p){var o,i;o=document.createElement("button");i=document.createTextNode(MobileFrontend.message(p?"expand-section":"collapse-section"));o.className=p?"show":"hide";o.appendChild(i);return o}if(!h){h=[]}else{a(document.body).addClass("togglingEnabled")}for(l=0;l<h.length;l++){n=h[l];n.removeAttribute("onclick");n.insertBefore(g(true),n.firstChild);n.insertBefore(g(false),n.firstChild);a(n).bind("click",k)}function j(){var i=this.hash||document.location.hash;if(i.indexOf("#")===0){e(i)}}j();for(f=document.getElementsByTagName("a"),l=0;l<f.length;l++){a(f[l]).bind("click",j)}}function e(i){var g=document.getElementById(i.substr(1)),h,f;if(g){h=g;while(h&&!a(h).hasClass("content_block")&&!a(h).hasClass("section_heading")){h=h.parentNode}if(h&&!a(h).hasClass("openSection")){f=parseInt(h.id.split("_")[1],10);b(f)}}}function b(g){var f=document.getElementById("section_"+g),l=f.getElementsByTagName("button"),h,j,k;if(a(f).hasClass("openSection")){a(f).removeClass("openSection")}else{a(f).addClass("openSection")}for(h=0,d=["content_","anchor_"];h<=1;h++){k=document.getElementById(d[h]+g);if(k&&a(k).hasClass("openSection")){a(k).removeClass("openSection")}else{a(k).addClass("openSection")}}}c();return{wm_reveal_for_hash:e,wm_toggle_section:b,init:c}})();
\ No newline at end of file
 2+MobileFrontend.toggle=(function(){var a=MobileFrontend.utils;function c(){var l,f,n,m,h=a(".section_heading");window.wm_toggle_section=b;m=a(".section_heading button");for(l=0;l<m.length;l++){a(m[l]).remove()}function k(){var i=this.id?this.id.split("_")[1]:-1;if(i!==-1){b(i)}}function g(p){var o,i;o=document.createElement("button");i=document.createTextNode(MobileFrontend.message(p?"expand-section":"collapse-section"));o.className=p?"show":"hide";o.appendChild(i);return o}if(!h){h=[]}else{a(document.body).addClass("togglingEnabled")}for(l=0;l<h.length;l++){n=h[l];n.removeAttribute("onclick");n.insertBefore(g(true),n.firstChild);n.insertBefore(g(false),n.firstChild);a(n).bind("click",k)}function j(){var i=this.hash||document.location.hash;if(i.indexOf("#")===0){e(i)}}j();for(f=a(".content_block a")||[],l=0;l<f.length;l++){a(f[l]).bind("click",j)}}function e(i){var g=document.getElementById(i.substr(1)),h,f;if(g){h=g;while(h&&!a(h).hasClass("content_block")&&!a(h).hasClass("section_heading")){h=h.parentNode}if(h&&!a(h).hasClass("openSection")){f=h.id.split("_")[1];b(f)}}}function b(g){var f=document.getElementById("section_"+g),l=f.getElementsByTagName("button"),h,j,k;if(a(f).hasClass("openSection")){a(f).removeClass("openSection")}else{a(f).addClass("openSection")}for(h=0,d=["content_","anchor_"];h<=1;h++){k=document.getElementById(d[h]+g);if(k&&a(k).hasClass("openSection")){a(k).removeClass("openSection")}else{a(k).addClass("openSection")}}}c();return{wm_reveal_for_hash:e,wm_toggle_section:b,init:c}})();
\ No newline at end of file

Status & tagging log