https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112886
Revision: 112886 Author: jdlrobson Date: 2012-03-02 13:16:18 +0000 (Fri, 02 Mar 2012) Log Message: ----------- make sure toggling is enabled some older browsers e.g. nokia e63 do not support various operations for getting elements see http://www.quirksmode.org/m/w3c_core.html currently using document.querySelectorAll which means for these browsers sections will be hidden but no buttons added this change checks for this situation making sure the information is still accessible going forward to support toggling on these browses we could add the Sizzle library but it would increase the size of the page Modified Paths: -------------- trunk/extensions/MobileFrontend/javascripts/application.js trunk/extensions/MobileFrontend/stylesheets/beta_common.css trunk/extensions/MobileFrontend/stylesheets/common.css Modified: trunk/extensions/MobileFrontend/javascripts/application.js =================================================================== --- trunk/extensions/MobileFrontend/javascripts/application.js 2012-03-02 13:15:41 UTC (rev 112885) +++ trunk/extensions/MobileFrontend/javascripts/application.js 2012-03-02 13:16:18 UTC (rev 112886) @@ -22,6 +22,10 @@ btn.style.display = visible ? 'inline-block' : 'none'; return btn; } + if(!sectionHeadings) { + sectionHeadings = []; + utilities( document.body ).addClass( 'togglingEnabled' ); + } for( i = 0; i < sectionHeadings.length; i++ ) { heading = sectionHeadings[i]; heading.insertBefore( createButton( true ), heading.firstChild ); Modified: trunk/extensions/MobileFrontend/stylesheets/beta_common.css =================================================================== --- trunk/extensions/MobileFrontend/stylesheets/beta_common.css 2012-03-02 13:15:41 UTC (rev 112885) +++ trunk/extensions/MobileFrontend/stylesheets/beta_common.css 2012-03-02 13:16:18 UTC (rev 112886) @@ -342,12 +342,12 @@ display: none; } -.jsEnabled button.show { +.togglingEnabled button.show { display: inline-block; } -.jsEnabled .content_block, -.jsEnabled .section_anchors, +.togglingEnabled .content_block, +.togglingEnabled .section_anchors, button.section_heading.hide { display: none; } Modified: trunk/extensions/MobileFrontend/stylesheets/common.css =================================================================== --- trunk/extensions/MobileFrontend/stylesheets/common.css 2012-03-02 13:15:41 UTC (rev 112885) +++ trunk/extensions/MobileFrontend/stylesheets/common.css 2012-03-02 13:16:18 UTC (rev 112886) @@ -334,12 +334,12 @@ display: none; } -.jsEnabled button.show { +.togglingEnabled button.show { display: inline-block; } -.jsEnabled .content_block, -.jsEnabled .section_anchors, +.togglingEnabled .content_block, +.togglingEnabled .section_anchors, button.section_heading.hide { display: none; } _______________________________________________ MediaWiki-CVS mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
