[Pkg-mozext-commits] [sage-extension] 36/54: Livemarks integration, bug 7302
David Prévot
taffit at moszumanska.debian.org
Fri May 1 03:10:39 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to tag sage_1_3
in repository sage-extension.
commit 1e3c9de9276ab1dd8571c48ef5733f799a286a63
Author: Peter Andrews <petea at jhu.edu>
Date: Thu Oct 7 14:05:41 2004 +0000
Livemarks integration, bug 7302
---
src/sage/content/feedlib.js | 2 +-
src/sage/content/sage.js | 45 +++++++++++++++++++++++++--------------------
src/sage/content/sage.xul | 2 +-
3 files changed, 27 insertions(+), 22 deletions(-)
diff --git a/src/sage/content/feedlib.js b/src/sage/content/feedlib.js
index a0b4d96..ec32ba6 100644
--- a/src/sage/content/feedlib.js
+++ b/src/sage/content/feedlib.js
@@ -211,7 +211,7 @@ Feed.prototype.parseAtom = function() {
var contentNodes = aEntryNode.getElementsByTagName("content");
var contentArray = new Array();
- for(j = 0; j < contentNodes.length; j++){
+ for(j = 0; j < contentNodes.length; j++) {
var contType = contentNodes[j].getAttribute("type");
contentArray[contType] = CommonFunc.getInnerText(contentNodes[j]);
}
diff --git a/src/sage/content/sage.js b/src/sage/content/sage.js
index 54d720d..1b810d2 100755
--- a/src/sage/content/sage.js
+++ b/src/sage/content/sage.js
@@ -210,35 +210,40 @@ function createTreeContextMenu2(aEvent) {
}
function bookmarksTreeClick(aEvent) {
- if(aEvent.type == "click") {
- if(aEvent.button == 2 || aEvent.originalTarget.localName != "treechildren") {
- return;
- }
- var obj = {};
- var row = {};
- bookmarksTree.treeBoxObject.getCellAt(aEvent.clientX, aEvent.clientY, row, {}, obj);
- row = row.value;
+ var selectedItemType = BookmarksUtils.getProperty(bookmarksTree.currentResource, RDF_NS + "type", bookmarksTree.db);
+ logMessage(aEvent.type);
+ switch(aEvent.type) {
+ case "click":
+ if(aEvent.button == 2 || aEvent.originalTarget.localName != "treechildren") {
+ return;
+ }
+ var obj = {};
+ var row = {};
+ bookmarksTree.treeBoxObject.getCellAt(aEvent.clientX, aEvent.clientY, row, {}, obj);
+ row = row.value;
+ if(obj.value == "twisty") return;
+ if(selectedItemType == NC_NS + "Folder") {
+ bookmarksTree.treeBoxObject.view.toggleOpenState(row);
+ }
+ break;
- if(obj.value == "twisty") return;
+ case "keypress":
+ if(aEvent.originalTarget.localName != "tree") {
+ return;
+ }
+ break;
- if (bookmarksTree.getTreeSelection().isContainer[0]) {
- bookmarksTree.treeBoxObject.view.toggleOpenState(row);
- }
- } else if(aEvent.type == "keypress") {
- if(aEvent.originalTarget.localName != "tree") {
- return;
- }
+ case "dblclick":
+ break;
}
CreateHTML.tabbed = false;
if(aEvent.button == 1) { CreateHTML.tabbed = true; } // click middle button
if(aEvent.ctrlKey) { CreateHTML.tabbed = true; } // press Ctrl Key
- const BOOKMARK_TYPE = RDF_NS + "type";
const BOOKMARK_SEPARATOR = NC_NS + "BookmarkSeparator";
- const BOOKMARK_FOLDER = NC_NS + "Folder"
- var bookmarkType = BookmarksUtils.getProperty(bookmarksTree.currentResource, BOOKMARK_TYPE , bookmarksTree.db)
- if(bookmarkType == BOOKMARK_SEPARATOR || bookmarkType == BOOKMARK_FOLDER) {
+ const BOOKMARK_FOLDER = NC_NS + "Folder";
+ if(selectedItemType == BOOKMARK_SEPARATOR || selectedItemType == BOOKMARK_FOLDER) {
return;
}
diff --git a/src/sage/content/sage.xul b/src/sage/content/sage.xul
index 44968a5..255af50 100755
--- a/src/sage/content/sage.xul
+++ b/src/sage/content/sage.xul
@@ -118,7 +118,7 @@
<bookmarks-tree id="bookmarksTree" type="single-column" flex="1"
onkeypress="if(event.keyCode == 13) bookmarksTreeClick(event)"
ondraggesture="if(event.originalTarget.localName == 'treechildren') nsDragAndDrop.startDrag(event, this.DNDObserver);"
- onclick="bookmarksTreeClick(event)"/>
+ onclick="bookmarksTreeClick(event)" ondblclick="bookmarksTreeClick(event)"/>
</vbox>
<splitter id="sage-splitter"/>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/sage-extension.git
More information about the Pkg-mozext-commits
mailing list