changeset 1838:581f3c92618e

move obsolete browser message to modify page
author Roger Haase <crosseyedpenguin@yahoo.com>
date Thu, 11 Oct 2012 12:53:17 -0700
parents 7bfcad341121
children 1ffcbf6ace7e
files MoinMoin/templates/common.js
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/templates/common.js	Tue Oct 09 13:50:06 2012 -0700
+++ b/MoinMoin/templates/common.js	Thu Oct 11 12:53:17 2012 -0700
@@ -511,6 +511,7 @@
         MESSAGEOLD = ' {{ _("Your browser is old. Upgrade to gain auto-scroll page after edit feature.") }} ',
         OPERA = 'Opera', // special handling required because textareas have \r\n line endings
         modifyButton,
+        modifyForm,
         lineno,
         message,
         caretLineno;
@@ -564,7 +565,7 @@
                 textArea.setSelectionRange(scrolledText.length, scrolledText.length + 8);
                 setTimeout(function () {textArea.setSelectionRange(scrolledText.length, scrolledText.length + 4); }, 1000);
                 setTimeout(function () {textArea.setSelectionRange(scrolledText.length, scrolledText.length); }, 1500);
-            } else{
+            } else {
                 // IE8 workaround to position the caret and scroll textarea
                 setSelection(textArea, scrolledText.length);
             }
@@ -696,14 +697,19 @@
     } else {
         // provide reduced functionality for obsolete browsers that do not support local storage: IE6, IE7, etc.
         if (document.getElementById('moin-edit-on-doubleclick')) {
-            moinFlashMessage(MOINFLASHWARNING, MESSAGEOBSOLETE);
             modifyButton = $('.moin-modify-button')[0];
             if (modifyButton) {
-                // add doubleclick event handler when user doubleclicks within the content area
+                // this is a "show" page, add doubleclick event handler to content node
                 $('#moin-content').dblclick(function (e) {
                     document.location = modifyButton.href;
                 });
             }
+        } else {
+            modifyForm = $('#moin-modify')[0];
+            if (modifyForm) {
+                // user is editing with obsolete browser, give warning about missing features
+                moinFlashMessage(MOINFLASHWARNING, MESSAGEOBSOLETE);
+            }
         }
     }
 });