can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r20391: LJSUP-10187: Add a button to toggle all ...

Committer: dpetrov
LJSUP-10187: Add a button to toggle all new functionality in the s2 layers editor
U   trunk/htdocs/js/s2edit/s2edit.js
U   trunk/templates/Widgets/layereditor.tmpl
Modified: trunk/htdocs/js/s2edit/s2edit.js
===================================================================
--- trunk/htdocs/js/s2edit/s2edit.js	2011-10-20 08:25:34 UTC (rev 20390)
+++ trunk/htdocs/js/s2edit/s2edit.js	2011-10-20 08:31:32 UTC (rev 20391)
@@ -33,7 +33,7 @@
 			// Disable selection in the document (IE only - prevents wacky dragging bugs)
 			document.onselectstart = function () { return false; };
 
-			if (jQuery.browser.opera || (jQuery.browser.msie && jQuery.browser.version)) { return; }
+			if (!this.isAceSupported()) { return; }
 
 			this.aceInit();
 		},
@@ -79,6 +79,10 @@
 			});
 		},
 
+		isAceSupported: function() {
+			return !(jQuery.browser.opera || (jQuery.browser.msie && jQuery.browser.version));
+		},
+
 		aceInit: function() {
 			var textarea = jQuery('#main'),
 				pre = jQuery('<pre id="editor"/>')
@@ -92,6 +96,7 @@
 		},
 
 		toggleEditor: function() {
+			if (!this.isAceSupported()) { return; }
 			var textarea = jQuery('#main'),
 				editorEl = jQuery('#editor');
 

Modified: trunk/templates/Widgets/layereditor.tmpl
===================================================================
--- trunk/templates/Widgets/layereditor.tmpl	2011-10-20 08:25:34 UTC (rev 20390)
+++ trunk/templates/Widgets/layereditor.tmpl	2011-10-20 08:31:32 UTC (rev 20391)
@@ -8,7 +8,7 @@
             <a href="<TMPL_VAR s2doc>" target="_blank">Documentation</a>
         </div>
         <input type="submit" value="Save & Compile" class="compilelink" />
-        <input type="button" value="Enable new editor" class="compilelink turbo-mode" />
+        <input type="button" value="Show new editor" class="compilelink turbo-mode" />
     </div>
     <div class="main" id="maindiv">
         <div class="maincontainer">

Tags: can3p, dpetrov, js, livejournal, tmpl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments