[Pkg-mozext-commits] [itsalltext] 199/459: Added the welcome message screen.

David Prévot taffit at moszumanska.debian.org
Tue Feb 24 23:26:21 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 743696ba54eaf6d86d2c8e73cb8c2a5f44d08d5d
Author: Christian Höltje <docwhat at gerf.org>
Date:   Thu Apr 5 22:17:02 2007 -0400

    Added the welcome message screen.
---
 src/chrome/content/itsalltext.js       | 31 +++++++++++++++++++++++++++++--
 src/chrome/content/readme.xhtml        |  9 +++++++++
 src/defaults/preferences/itsalltext.js |  1 +
 3 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/src/chrome/content/itsalltext.js b/src/chrome/content/itsalltext.js
index acdaca1..333432b 100644
--- a/src/chrome/content/itsalltext.js
+++ b/src/chrome/content/itsalltext.js
@@ -49,6 +49,18 @@ var ItsAllText = function() {
      */
     that.MYSTRING = 'itsalltext';
 
+    /**
+     * A constant, the version number.  Set by the Makefile.
+     * @type String
+     */
+    that.VERSION = '@@VERSION@@';
+
+    /**
+     * A constant, the url to the readme.
+     * @type String
+     */
+    that.README = 'chrome://itsalltext/content/readme.xhtml';
+
     /* The XHTML Namespace */
     that.XHTMLNS = "http://www.w3.org/1999/xhtml";
 
@@ -245,6 +257,7 @@ var ItsAllText = function() {
          * @type Hash
          */
         types: {
+            'lastversion':        'Char',
             'charset':            'Char',
             'editor':             'Char',
             'refresh':            'Int',
@@ -496,7 +509,8 @@ var ItsAllText = function() {
     that.refreshDocument = function(doc) {
         // @todo [1] Confirm that we find textareas inside iframes and frames.
         if(!doc.location) { return; } // it's being cached, but not shown.
-        var is_chrome = (doc.location.protocol == 'chrome:');
+        var is_chrome = (doc.location.protocol == 'chrome:' &&
+                         doc.location.href != that.README);
         var nodes = doc.getElementsByTagName('textarea');
         var i;
         for(i=0; i < nodes.length; i++) {
@@ -561,7 +575,8 @@ var ItsAllText = function() {
                 var is_usable = (is_html) && 
                     location.protocol != 'about:' &&
                     location.protocol != 'chrome:';
-                if (!is_usable) { 
+                var is_my_readme = location.href == that.README;
+                if (!(is_usable || is_my_readme)) { 
                     that.debuglog('watch(): ignoring -- ',
                                   location, contentType);
                     return;
@@ -677,6 +692,16 @@ var ItsAllText = function() {
         return true;
     };
 
+    that.checkVersion = function() {
+        if( that.preferences._get('lastversion') != that.VERSION) {
+            that.preferences._set('lastversion', that.VERSION);
+            window.setTimeout(function() {
+                var browser = getBrowser();
+                browser.selectedTab = browser.addTab(that.README, null);
+            }, 100);
+        }
+    };
+
     /**
      * Initialize the module.  Should be called once, when a window is loaded.
      * @private
@@ -690,6 +715,8 @@ var ItsAllText = function() {
         // Start the monitor
         that.monitor.restart();
 
+        that.checkVersion();
+
         var appcontent = document.getElementById("appcontent"); // The Browser
         if (appcontent) {
             // Normal web-page.
diff --git a/src/chrome/content/readme.xhtml b/src/chrome/content/readme.xhtml
index eb02546..9749fa1 100644
--- a/src/chrome/content/readme.xhtml
+++ b/src/chrome/content/readme.xhtml
@@ -10,6 +10,7 @@ g/TR/xhtml1/DTD/xhtml1-transitional.dtd">
              font: 1.2em sans-serif;}
       h1 { background: #00d; color: #fff; -moz-border-radius: 1ex; padding: 0.5em 1em; margin: 0;}
       #ver { margin: 0; text-align: right; }
+      #test { width: 100%; height: 10em; background: #cdf; }
     </style>
   </head>
   <body>
@@ -36,6 +37,14 @@ g/TR/xhtml1/DTD/xhtml1-transitional.dtd">
       $*".
     </p>
 
+    <p>
+      A test TextArea for you to play with...
+    </p>
+    <form>
+      <textarea id="test">Click the edit button and have fun editing!</textarea>
+    </form>
+
+
     <pre>
 ****** 0.6.2 *****
 * Default Mac OS X to '/usr/bin/open'
diff --git a/src/defaults/preferences/itsalltext.js b/src/defaults/preferences/itsalltext.js
index 0a77d26..01e6638 100644
--- a/src/defaults/preferences/itsalltext.js
+++ b/src/defaults/preferences/itsalltext.js
@@ -1,3 +1,4 @@
+pref("extensions.itsalltext.lastversion",  "");
 pref("extensions.itsalltext.charset",  "UTF-8");
 pref("extensions.itsalltext.editor",   "");
 pref("extensions.itsalltext.refresh",  7);

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