[Pkg-mozext-commits] [itsalltext] 168/459: yay! context menu works!

David Prévot taffit at moszumanska.debian.org
Tue Feb 24 23:26:18 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 bcda3eecc18d73f3c65b5dd266bf6b1e580310cf
Author: Christian Höltje <docwhat at gerf.org>
Date:   Mon Mar 19 18:58:36 2007 -0400

    yay! context menu works!
---
 chrome/content/cacheobj.js | 26 ++++++++++++++------------
 install.rdf                |  2 +-
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/chrome/content/cacheobj.js b/chrome/content/cacheobj.js
index 0ea943f..65e6ddf 100644
--- a/chrome/content/cacheobj.js
+++ b/chrome/content/cacheobj.js
@@ -159,6 +159,7 @@ CacheObj.prototype.getNodeIdentifier = function(node) {
         doc.setAttribute(attr,serial);
         node.setAttribute('id',id);
     }
+    //ItsAllText.debug('narf',node.nodeName,id);
     return id;
 };
 
@@ -414,6 +415,8 @@ CacheObj.prototype.addGumDrop = function() {
     
     var gumdrop = doc.createElementNS(ItsAllText.XHTMLNS, "img");
     gumdrop.setAttribute('src', this.gumdrop_url);
+    var gid = cache_object.getNodeIdentifier(gumdrop);
+    
     if (ItsAllText.getDebug()) {
         gumdrop.setAttribute('title', cache_object.node_id);
     } else {
@@ -435,24 +438,23 @@ CacheObj.prototype.addGumDrop = function() {
     gumdrop.setAttribute(ItsAllText.MYSTRING+'_UID', cache_object.uid);
 
     var clickfun = function(event) {
-        var use_context  = event.ctrlKey || event.altKey;
-        var use_cutpaste = event.shiftKey;
-        if (use_context) {
-            var target = ItsAllText.rebuildMenu(cache_object.uid);
-            target.showPopup(document.documentElement,
-                             event.screenX, event.screenY,
-                             "bottomleft", "topleft");
-        } else if(use_cutpaste) {
-            ItsAllText.debug('mouse: use_cutpaste');
-        } else {
-            cache_object.edit();
-        }
+        cache_object.edit();
+        event.stopPropagation();
+        return false;
+    };
+    var contextfun = function(event) {
+        var popup = ItsAllText.rebuildMenu(cache_object.uid);
+        popup.showPopup(
+                        document.documentElement,
+                        event.screenX, event.screenY,
+                        'context' );
         event.stopPropagation();
         return false;
     };
     
     // Click event handler
     gumdrop.addEventListener("click", clickfun, false);
+    gumdrop.addEventListener("contextmenu", contextfun, false);
     
     // Insert it into the document
     var parent = node.parentNode;
diff --git a/install.rdf b/install.rdf
index d8f76a7..a7ad403 100644
--- a/install.rdf
+++ b/install.rdf
@@ -12,7 +12,7 @@
                    em:maxVersion="0.8" />
   <RDF:Description RDF:about="urn:mozilla:install-manifest"
                    em:id="itsalltext at docwhat.gerf.org"
-                   em:version="0.4.5"
+                   em:version="0.6.0"
                    em:type="2"
                    em:name="It's All Text!"
                    em:description="Edit text using your favorite editor!"

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