[Pkg-mozext-commits] [itsalltext] 136/459: * The default extension can be set by the web-page designer via: itsalltext-extension=".extension" * The chosen extension is remembered for the life of the page.

David Prévot taffit at moszumanska.debian.org
Tue Feb 24 23:26:14 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 03aea49727cd9e3a7e6e8d514919031123bcbff2
Author: docwhat at gerf.org <docwhat at gerf.org>
Date:   Wed Feb 14 08:53:16 2007 -0500

    * The default extension can be set by the web-page designer via:
      itsalltext-extension=".extension"
    * The chosen extension is remembered for the life of the page.
---
 changelog.txt              | 3 +++
 chrome/content/cacheobj.js | 9 ++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/changelog.txt b/changelog.txt
index 92e5ad4..55d7710 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -13,6 +13,9 @@ $*".
 ****** 0.4.2 ******
 * Stupid bugs fixed.
 * The popup positions right in XP.
+* The default extension can be set by the web-page designer via:
+  itsalltext-extension=".extension"
+* The chosen extension is remembered for the life of the page.
 
 ****** 0.4.0 ******
 * Added API so that other extensions can have edit buttons!
diff --git a/chrome/content/cacheobj.js b/chrome/content/cacheobj.js
index 125f789..54fa2f0 100644
--- a/chrome/content/cacheobj.js
+++ b/chrome/content/cacheobj.js
@@ -57,7 +57,11 @@ function CacheObj(node) {
     that.file = null;
 
     /* Set the default extension and create the nsIFile object. */
-    that.setExtension('.txt');
+    var extension = node.getAttribute('itsalltext-extension');
+    if (typeof(extension) != 'string' || !extension.match(/^[.a-z0-9]+$/i)) {
+        extension = '.txt';
+    }
+    that.setExtension(extension);
 
     /**
      * A callback for when the textarea/textbox or button has 
@@ -375,8 +379,7 @@ CacheObj.prototype.addGumDrop = function() {
         } else if(use_cutpaste) {
             ItsAllText.debug('mouse: use_cutpaste');
         } else {
-            // @todo [7] Store the last used extension and reuse it.
-            cache_object.edit('.txt');
+            cache_object.edit();
         }
         event.stopPropagation();
         return false;

-- 
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