Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js |
— | — | @@ -1 +1 @@ |
2 | | -MobileFrontend.opensearch=(function(){var c="/api.php",m=-1,d=500,z=15,q,l=document.getElementById("search"),t=document.getElementById("sq"),a=document.getElementById("searchbox"),r=document.getElementById("content"),o=document.getElementById("footer"),x=document.getElementById("clearsearch"),k=false,n=MobileFrontend.utils;c=MobileFrontend.setting("scriptPath")+c;function s(){results.style.display="none"}function h(){if(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)){var u=n('meta[name="viewport"]');if(u){u=u[0];u.content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0";n(document.body).bind("gesturestart",function(){u.content="width=device-width, initial-scale=1.0"})}}}h();l.onfocus=function(){var u,A;a=document.getElementById("searchbox");t=document.getElementById("sq");r=document.getElementById("content");o=document.getElementById("footer");h();if(!k){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",y);A=document.createElement("div");A.setAttribute("id","left-arrow");u.appendChild(A);t.insertBefore(u,t.firstChild)}k=true}};function y(){MobileFrontend.utils(document.body).removeClass("full-screen-search");if(k){k=false}if(x){x.style.display="none"}}function b(A){var u;if(!A){A=window.event}if(A.target){u=A.target}else{if(A.srcElement){u=A.srcElement}}if(u.nodeType===3){u=u.parentNode}A.cancelBubble=true;A.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()}}window.onload=function(){n(l).bind("keyup",function(){clearTimeout(m);q=this.value;if(q.length<1){results.innerHTML=""}else{q=encodeURIComponent(q);m=setTimeout(function(){j(q)},d)}})};function j(u){url=c+"?action=opensearch&limit="+z+"&namespace=0&format=xml&search="+u;n.ajax({url:url,success:function(A){p(g(A))}})}function g(D){var E=[],A,B,C,u=D.getElementsByTagName("Item");for(A=0;A<u.length;A++){B=u[A];C={label:B.getElementsByTagName("Text")[0].textContent,value:B.getElementsByTagName("Url")[0].textContent};E.push(C)}return E}function i(A){var u=document.getElementById("search");if(u){u.value=A+" ";u.focus();j(u.value)}}function e(B){var A=document.createTextNode(B),u=document.createElement("div");u.appendChild(A);return u.innerHTML}function w(u){return u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function p(J){var D=document.getElementById("results"),F,E,C=e(document.getElementById("search").value),B,I,A,u,G,H;D.style.display="block";if(l){l.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);B=function(){var K=this.parentNode.getAttribute("title");i(K)};for(E=0;E<J.length;E++){I=J[E];u=document.createElement("li");G=document.createElement("a");u.setAttribute("title",I.label);u.className="suggestions-result";H=document.createTextNode("+");G.appendChild(H);G.className="sq-val-update";n(G).bind("click",B);u.appendChild(G);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);A=w(C);G.innerHTML=G.innerHTML.replace(new RegExp("("+A+")","ig"),"<strong>$1</strong>")}}}function f(){var D=document.getElementById("clearsearch"),u=document.getElementById("search");function B(){if(D){if(u.value.length>0){D.style.display="block"}else{D.style.display="none"}}}function A(E){u.value="";D.style.display="none";if(E){E.preventDefault()}}function C(){u.select()}n(D).bind("mousedown",A);n(u).bind("keyup",B);n(u).bind("click",C)}function v(){var u=document.getElementById("results");u.onmousedown=b;document.body.onmousedown=b;document.body.ontouchstart=b;u.ontouchstart=b}v();f();return{init:v,initClearSearch:f,writeResults:p,createObjectArray:g,removeResults:y}}()); |
\ 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}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 |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.js |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | $( '.mw-cite-backlink a' ).click( close ); |
51 | 51 | |
52 | 52 | var data, html, href, references = collect(); |
53 | | - $( 'sup a' ).click( function(ev) { |
| 53 | + $( 'sup a' ).unbind('click').click( function(ev) { |
54 | 54 | var top, oh; |
55 | 55 | href = $(this).attr( 'href' ); |
56 | 56 | data = href && href.charAt(0) === '#' ? |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.min.js |
— | — | @@ -0,0 +1 @@ |
| 2 | +if(typeof jQuery!=="undefined"){MobileFrontend.references=(function(d){var b,f,a={};f=window.location.hash.substr(1).match(/refspeed:([0-9]*)/);a.animationSpeed=f?parseInt(f[1],10):500;f=window.location.hash.substr(1).match(/refanimation:([a-z]*)/);a.animation=f?f[1]:null;function c(){var g={};d("ol.references li").each(function(h,j){g[d(j).attr("id")]={html:d(j).html(),label:h+1}});return g}b=function(){var g=d("#mf-references").outerHeight();d("#mf-references").css({top:(window.innerHeight+window.pageYOffset)-g,bottom:"auto",position:"absolute"})};d(document).scroll(b);function e(){d('<div id="mf-references"><div></div></div>').hide().appendTo(document.body);var l=function(){var m;j=null;if(a.animation==="none"){d("#mf-references").hide()}else{if(a.animation==="slide"){m=window.innerHeight+window.pageYOffset;d("#mf-references").show().animate({top:m},a.animationSpeed)}else{d("#mf-references").fadeOut(a.animationSpeed)}}},j;d("<button>close</button>").click(l).appendTo("#mf-references");d(".mw-cite-backlink a").click(l);var k,i,g,h=c();d("sup a").unbind("click").click(function(m){var o,n;g=d(this).attr("href");k=g&&g.charAt(0)==="#"?h[g.substr(1,g.length)]:null;if(!d("#mf-references").is(":visible")||j!==g){j=g;if(k){i="<h3>["+k.label+"]</h3>"+k.html}else{i=d("<a />").text(d(this).text()).attr("href",g).appendTo("<div />").parent().html()}d("#mf-references div").html(i);b();if(a.animation==="none"){d("#mf-references").show()}else{if(a.animation==="slide"){o=window.innerHeight+window.pageYOffset;n=d("#mf-references").outerHeight();d("#mf-references").show().css({top:o}).animate({top:o-n},a.animationSpeed)}else{d("#mf-references").fadeIn(a.animationSpeed)}}}else{l()}m.preventDefault()})}e()})(jQuery)}; |
\ No newline at end of file |
Index: branches/wmf/1.19wmf1/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&&h.style.display!=="block"){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){k.style.display=k.style.display==="block"?"none":"block"}}}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=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 |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/common.css |
— | — | @@ -182,6 +182,7 @@ |
183 | 183 | |
184 | 184 | html[dir="rtl"] #results { |
185 | 185 | left: 41px; |
| 186 | + right: 53px; |
186 | 187 | } |
187 | 188 | |
188 | 189 | .search_bar .search { |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | |
38 | 38 | $jQuerySupport = $this->data['device']['supports_jquery']; |
39 | 39 | $jQueryScript = $jQuerySupport ? $startScriptTag . $javaScriptPath . 'jquery-1.7.1.min.js' . $endScriptTag : ''; |
40 | | - $filePageScript = ( $this->data['isFilePage'] ) ? $startScriptTag . $javaScriptPath . 'filepage.js?version=122920111241' . $endScriptTag : ''; |
| 40 | + $filePageScript = ( $this->data['isFilePage'] ) ? $startScriptTag . $javaScriptPath . 'filepage.js?version=1332193250' . $endScriptTag : ''; |
41 | 41 | |
42 | 42 | $startLinkTag = "<link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/"; |
43 | 43 | $endLinkTag = "' media='all' rel='Stylesheet' type='text/css' />"; |
— | — | @@ -59,7 +59,7 @@ |
60 | 60 | |
61 | 61 | if( $this->data['isBetaGroupMember'] && $jQuerySupport ) { |
62 | 62 | $betajs = <<<HTML |
63 | | - {$startScriptTag}{$javaScriptPath}references.{$resourceSuffix}js?version=1331257310{$endScriptTag} |
| 63 | + {$startScriptTag}{$javaScriptPath}references.{$resourceSuffix}js?version=1332193250{$endScriptTag} |
64 | 64 | HTML; |
65 | 65 | } else { |
66 | 66 | $betajs = ""; |
— | — | @@ -71,8 +71,8 @@ |
72 | 72 | <head> |
73 | 73 | <title>{$this->data['htmlTitle']}</title> |
74 | 74 | <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" /> |
75 | | - <link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1331678715' media='all' rel='Stylesheet' type='text/css' /> |
76 | | - <link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1331678715' media='all' rel='Stylesheet' type='text/css' /> |
| 75 | + <link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1332193250' media='all' rel='Stylesheet' type='text/css' /> |
| 76 | + <link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1332193250' media='all' rel='Stylesheet' type='text/css' /> |
77 | 77 | {$filePageStyle} |
78 | 78 | <meta name="viewport" content="initial-scale=1.0"> |
79 | 79 | {$appleTouchIconTag} |
— | — | @@ -90,10 +90,10 @@ |
91 | 91 | </div> |
92 | 92 | {$this->data['footerHtml']} |
93 | 93 | <!--[if gt IE 9]><!--> |
94 | | - {$startScriptTag}{$javaScriptPath}application.{$resourceSuffix}js?version=1331257310{$endScriptTag} |
95 | | - {$startScriptTag}{$javaScriptPath}toggle.{$resourceSuffix}js?version=1331257310{$endScriptTag} |
96 | | - {$startScriptTag}{$javaScriptPath}banner.{$resourceSuffix}js?version=1331257310{$endScriptTag} |
97 | | - {$startScriptTag}{$javaScriptPath}{$betaPrefix}opensearch.{$resourceSuffix}js?version=1331250599{$endScriptTag} |
| 94 | + {$startScriptTag}{$javaScriptPath}application.{$resourceSuffix}js?version=1332193250{$endScriptTag} |
| 95 | + {$startScriptTag}{$javaScriptPath}toggle.{$resourceSuffix}js?version=1332193250{$endScriptTag} |
| 96 | + {$startScriptTag}{$javaScriptPath}banner.{$resourceSuffix}js?version=1332193250{$endScriptTag} |
| 97 | + {$startScriptTag}{$javaScriptPath}{$betaPrefix}opensearch.{$resourceSuffix}js?version=1332193250{$endScriptTag} |
98 | 98 | {$betajs} |
99 | 99 | {$filePageScript} |
100 | 100 | <!--[endif]--> |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/SearchTemplate.php |
— | — | @@ -8,14 +8,14 @@ |
9 | 9 | |
10 | 10 | public function getHTML() { |
11 | 11 | |
12 | | - $searchField = htmlspecialchars( $this->data['searchField'] ); |
| 12 | + $searchField = Xml::escapeJsString( $this->data['searchField'] ); |
13 | 13 | $mainPageUrl = $this->data['mainPageUrl']; |
14 | 14 | $randomPageUrl = $this->data['randomPageUrl']; |
15 | 15 | $homeButton = $this->data['messages']['mobile-frontend-home-button']; |
16 | 16 | $randomButton = $this->data['messages']['mobile-frontend-random-button']; |
17 | | - $clearText = htmlentities( $this->data['messages']['mobile-frontend-clear-search'], ENT_QUOTES ); |
| 17 | + $clearText = Xml::escapeJsString( $this->data['messages']['mobile-frontend-clear-search'] ); |
18 | 18 | $searchValue = $this->data['messages']['mobile-frontend-search-submit']; |
19 | | - $placeholder = htmlentities( $this->data['messages']['mobile-frontend-placeholder'], ENT_QUOTES ); |
| 19 | + $placeholder = Xml::escapeJsString( $this->data['messages']['mobile-frontend-placeholder'] ); |
20 | 20 | |
21 | 21 | $scriptUrl = wfScript(); |
22 | 22 | $searchBoxDisplayNone = ( $this->data['hideSearchBox'] ) ? ' style="display: none;" ' : ''; |
Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend |
___________________________________________________________________ |
Modified: svn:mergeinfo |
23 | 23 | Merged /trunk/extensions/MobileFrontend:r114177,114184,114190-114191,114193 |