[Pkg-mozext-commits] [itsalltext] 116/459: Really fixed the problem with API -- it was double loading. Changed display in API to -moz-box as the restore value.

David Prévot taffit at moszumanska.debian.org
Tue Feb 24 23:26:12 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository itsalltext.

commit 2cca4feadd4d6cf85affe33b04805783102ce068
Author: docwhat at gerf.org <docwhat at gerf.org>
Date:   Thu Feb 8 17:01:17 2007 -0500

    Really fixed the problem with API -- it was double loading.
    Changed display in API to -moz-box as the restore value.
---
 chrome/content/API.js        | 24 +++++++++++++++++++++---
 chrome/content/itsalltext.js | 21 +--------------------
 2 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/chrome/content/API.js b/chrome/content/API.js
index e797aa6..6832507 100644
--- a/chrome/content/API.js
+++ b/chrome/content/API.js
@@ -20,8 +20,7 @@
 
   If you don't want your button or menu item to show up when It's All Text!
   isn't installed, then give it the class "ShowForItsAllText" and set
-  the style (on the element, not in a stylesheet) to none.  This only works
-  for nodes in the main document.
+  the style to 'none'.
 
   Example:
       <hbox>
@@ -53,7 +52,7 @@
             var classes = node.className.split(/ +/);
             for(i in classes) {
                 if(classes[i] == "ShowForItsAllText") {
-                    node.style.display = '';
+                    node.style.display = '-moz-box';
                     break;
                 }
             }
@@ -63,3 +62,22 @@
     window.addEventListener("load", onload, true);
 })();
 
+/**
+ * This is part of the public XUL API.
+ * Use this to open an editor for a specific textarea or textbox with
+ * the id 'id'.  The file will have the extension 'extension'.  Include 
+ * the leading dot in the extension.
+ * @param {String} id The id of textarea or textbody that should be opened in the editor.
+ * @param {String} extension The extension of the file used as a temporary file. Example: '.css' (optional) 
+ */
+ItsAllText.openEditor = function(id, extension) {
+    var node = document.getElementById(id);
+    /* The only way I can adjust the background of the textbox is
+     * to turn off the -moz-appearance attribute.
+     */
+    node.style.MozAppearance = 'none';
+    var cache_object = node && ItsAllText.getCacheObj(node);
+    if(!cache_object) { return; }
+    cache_object.edit(extension);
+};
+
diff --git a/chrome/content/itsalltext.js b/chrome/content/itsalltext.js
index ebf7745..11f8d17 100644
--- a/chrome/content/itsalltext.js
+++ b/chrome/content/itsalltext.js
@@ -284,25 +284,6 @@ var ItsAllText = function() {
     };
 
     /**
-     * This is part of the public XUL API.
-     * Use this to open an editor for a specific textarea or textbox with
-     * the id 'id'.  The file will have the extension 'extension'.  Include 
-     * the leading dot in the extension.
-     * @param {String} id The id of textarea or textbody that should be opened in the editor.
-     * @param {String} extension The extension of the file used as a temporary file. Example: '.css' (optional) 
-     */
-    that.openEditor = function(id, extension) {
-        var node = document.getElementById(id);
-        /* The only way I can adjust the background of the textbox is
-         * to turn off the -moz-appearance attribute.
-         */
-        node.style.MozAppearance = 'none';
-        var cache_object = node && ItsAllText.getCacheObj(node);
-        if(!cache_object) { return; }
-        cache_object.edit(extension);
-    };
-
-    /**
      * Refresh Textarea.
      * @param {Object} node A specific textarea dom object to update.
      */
@@ -504,7 +485,7 @@ var ItsAllText = function() {
   
     // Start watching the preferences.
     that.preference_observer.register();
-  
+
     // Do the startup when things are loaded.
     window.addEventListener("load", startup, true);
     // Do the startup when things are unloaded.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/itsalltext.git



More information about the Pkg-mozext-commits mailing list