Skip to content

Commit

Permalink
unzip tagsieve-4.3.0.xpi from www.grue.in/tagsieve
Browse files Browse the repository at this point in the history
  • Loading branch information
wagle committed May 16, 2011
1 parent 1ffe2d7 commit 30e526b
Show file tree
Hide file tree
Showing 26 changed files with 884 additions and 109 deletions.
4 changes: 3 additions & 1 deletion chrome.manifest
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
content bookmarktags content/ contentaccessible=yes
locale bookmarktags en-US locale/en-US/
locale bookmarktags de-DE locale/de-DE/

skin bookmarktags classic/1.0 skin/classic/

skin bookmarktags-platform winstripe/1.0 skin/winstripe/ os=WINNT
Expand All @@ -10,4 +12,4 @@ overlay chrome://browser/content/browser.xul chrome://bookmarktags/content/brows

style chrome://global/content/customizeToolbar.xul chrome://bookmarktags/skin/toolbarButton.css

resource bookmarktags content/
resource bookmarktags content/
38 changes: 0 additions & 38 deletions content/browserOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ var BookmarkTags= function ()
{
if (loaded) return;
loaded= true;
handleFirstTime();
sbKeyElt= document.getElementById(sbKeyEltId);
sbBroadcaster= document.getElementById(sbBroadcasterId);
toolbox= document.getElementById("navigator-toolbox");
Expand All @@ -253,43 +252,6 @@ var BookmarkTags= function ()
window.controllers.appendController(tagController);
}

function handleFirstTime()
{
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
prefs = prefs.getBranch("bookmarktags.");

var ver = -1, firstrun = true;
var extensionManager = Components.classes["@mozilla.org/extensions/manager;1"]
.getService(Components.interfaces.nsIExtensionManager);
var current = extensionManager.getItemForID("[email protected]").version;
try
{
ver = prefs.getCharPref("currentVersion");
firstrun = prefs.getBoolPref("firstrun");
}
catch(e){}
finally
{
if (firstrun)
{
prefs.setBoolPref("firstrun", false);
prefs.setCharPref("currentVersion", current);
window.setTimeout(function()
{
gBrowser.selectedTab = gBrowser.addTab("chrome://bookmarktags/locale/hello.html");
}, 1500);
}
// !firstrun ensures that this section does not get loaded if its a first run
if (ver != current && !firstrun)
{
prefs.setCharPref("currentVersion", current);
// for upgrade add code here
}
}

}

// The CSS rules of Cute Menus and other extensions and themes that add
// icons to Firefox's menus are inserted after our tag menu binding rule
// (menu[type="bookmarktags:tagmenu"]). Their binding, which is something
Expand Down
10 changes: 10 additions & 0 deletions content/browserOverlay.xul
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@
<toolbarbutton id="BookmarkTags-bmMenuToolbarbutton"
type="menu"
label="&bmt.bmMenuToolbarbutton.label;"
accesskey="&bmt.bmMenuToolbarbutton.accesskey;"
oncommand="document.getElementById('BookmarkTags-bmMenuToolbarbutton').open = true;"
class="chromeclass-toolbar-additional">
<menupopup type="bookmarktags:tagpopup"
querytype="storage"
Expand All @@ -260,6 +262,14 @@
persist="modifiers key command"
modifiers=""
key="" />
<key id="BookmarkTags-focusTagBrowserSidebarInputKey"
modifiers="control shift"
key="I"
oncommand="document.getElementById('sidebar').contentDocument.getElementById('tagInput').inner.focus();" />
<key id="BookmarkTags-focusTagBrowserSidebarBookmarkKey"
modifiers="control"
key="M"
oncommand="document.getElementById('sidebar').contentDocument.getElementById('bmtree').focus();" />
</keyset>

<!-- bookmarks menu hook for our tag menu -->
Expand Down
38 changes: 17 additions & 21 deletions content/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
var EXPORTED_SYMBOLS= ["BookmarkTags"];
if (typeof(BookmarkTags) === "undefined") var BookmarkTags= {};


// see content/browser/places/controller.js
BookmarkTags.BookmarkCmds= function ()
{
Expand All @@ -50,10 +49,11 @@ BookmarkTags.BookmarkCmds= function ()
"bookmarktags:bmCmds:untagAll",
"bookmarktags:bmCmds:untagTags"
];

const transactServ=
Components.classes["@mozilla.org/browser/placesTransactionsService;1"].
getService(Components.interfaces.nsIPlacesTransactionsService);
Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
Components.utils.import("resource://gre/modules/PlacesUIUtils.jsm");
Components.utils.import('resource://gre/modules/Services.jsm');
var clipid = Components.interfaces.nsIClipboard;  
var clipboard   = Components.classes["@mozilla.org/widget/clipboard;1"].getService(clipid);

// Adapted from PlacesController.prototype._isClipboardDataPasteable in
// firefox/source/browser/components/places/content/controller.js
Expand All @@ -66,7 +66,7 @@ BookmarkTags.BookmarkCmds= function ()
// also be immediately acceptable except we don't allow pasting of
// livemarks, since the tree view doesn't handle them yet.
flavors= [PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER];
if (PlacesUIUtils.clipboard.hasDataMatchingFlavors(
if (clipboard.hasDataMatchingFlavors(
flavors,
flavors.length,
Components.interfaces.nsIClipboard.kGlobalClipboard))
Expand All @@ -82,7 +82,7 @@ BookmarkTags.BookmarkCmds= function ()
transferable.addDataFlavor(PlacesUtils.TYPE_X_MOZ_PLACE);
transferable.addDataFlavor(PlacesUtils.TYPE_X_MOZ_URL);
transferable.addDataFlavor(PlacesUtils.TYPE_UNICODE);
PlacesUIUtils.clipboard.getData(
clipboard.getData(
transferable, Components.interfaces.nsIClipboard.kGlobalClipboard);

return canPasteHelper(transferable);
Expand Down Expand Up @@ -203,7 +203,7 @@ BookmarkTags.BookmarkCmds= function ()

if (mozPlace || unicode || html || mozURL)
{
PlacesUIUtils.clipboard.setData(transferable, null,
clipboard.setData(transferable, null,
Components.interfaces.nsIClipboard.kGlobalClipboard);
}
}
Expand Down Expand Up @@ -233,7 +233,7 @@ BookmarkTags.BookmarkCmds= function ()
transactions= [];
bmObjs.forEach(function (bmObj)
{
transactions.push(transactServ.removeItem(bmObj.id));
transactions.push(new PlacesRemoveItemTransaction(bmObj.id));
});
doTransactions(transactions, "bookmarktags:bmCmds:delete");
}
Expand All @@ -244,10 +244,10 @@ BookmarkTags.BookmarkCmds= function ()
{
if (transactions.length > 0)
{
transactions= transactServ.aggregateTransactions(cmd, transactions);
transactions= new PlacesAggregatedTransaction(cmd, transactions);
BookmarkTags.Util.runBMBatch(function ()
{
transactServ.doTransaction(transactions);
PlacesUtils.transactionManager.doTransaction(transactions);
});
}
}
Expand Down Expand Up @@ -458,7 +458,7 @@ BookmarkTags.BookmarkCmds= function ()
{
return { uri: bmObj.url, isBookmark: true };
});
PlacesUIUtils._openTabset(bmObjs, event);
PlacesUIUtils._openTabset(bmObjs, event, Services.wm.getMostRecentWindow("navigator:browser"));
}
}

Expand All @@ -477,7 +477,7 @@ BookmarkTags.BookmarkCmds= function ()
var tagNames;

transferable= makePasteTransferable();
PlacesUIUtils.clipboard.getData(
clipboard.getData(
transferable, Components.interfaces.nsIClipboard.kGlobalClipboard);

transactions= [];
Expand Down Expand Up @@ -520,7 +520,7 @@ BookmarkTags.BookmarkCmds= function ()
BookmarkTags.Util.tagServ.getTagsForURI(uri, {}, {});
let newTags=
tagNames.filter(function (t) existingTags.indexOf(t) < 0);
transactions.push(transactServ.tagURI(uri, newTags));
transactions.push(new PlacesTagURITransaction(uri, newTags));
// item.id will be defined for regular Places nodes, item.itemId
// for nsINavHistoryResultNodes, which are returned from
// processNavQueryNodeHelper
Expand Down Expand Up @@ -729,7 +729,7 @@ BookmarkTags.BookmarkCmds= function ()
bmObjs.forEach(function (bmObj)
{
let uri= BookmarkTags.Util.bmServ.getBookmarkURI(bmObj.id);
if (uri) transactions.push(transactServ.untagURI(uri, null));
if (uri) transactions.push(new PlacesUntagURITransaction(uri, null));
});
doTransactions(transactions, "bookmarktags:bmCmds:untagAll");
}
Expand All @@ -754,7 +754,7 @@ BookmarkTags.BookmarkCmds= function ()
let uri= BookmarkTags.Util.bmServ.getBookmarkURI(bmObj.id);
if (uri)
{
transactions.push(transactServ.untagURI(uri, tagNames));
transactions.push(new PlacesUntagURITransaction(uri, tagNames));
}
});
doTransactions(transactions, "bookmarktags:bmCmds:untagTags");
Expand Down Expand Up @@ -912,16 +912,12 @@ BookmarkTags.TagCmds= function ()
{
var transactions;

const transactServ=
CC["@mozilla.org/browser/placesTransactionsService;1"].
getService(CI.nsIPlacesTransactionsService);

if (okToDelete(tagIds))
{
transactions= [];
tagIds.forEach(function (tid)
{
transactions.push(transactServ.removeItem(tid));
transactions.push(new PlacesRemoveItemTransaction(tid));
});
BookmarkTags.BookmarkCmds.doTransactions(
transactions, "bookmarktags:tagCmds:delete");
Expand Down
3 changes: 2 additions & 1 deletion content/migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ const BookmarkTags= function ()
opts.excludeReadOnlyFolders= true;
result= histServ.executeQuery(query, opts);
treeViewer= new PlacesTreeView(false);
result.viewer= treeViewer;
Ci = Components.interfaces; //possible bug in treeView.js (to investigate)
result.addObserver(treeViewer.QueryInterface(CI.nsINavHistoryResultObserver), true);
tree.view= treeViewer.QueryInterface(CI.nsITreeView);
if (rootFolderId) tree.selectItems([rootFolderId]);
document.documentElement.canAdvance= !!tree.selectedNode;
Expand Down
11 changes: 4 additions & 7 deletions content/tagBrowserSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ var BookmarkTags= function ()
var macCSSLoaded;

// for edit commands
const transactServ=
Components.classes["@mozilla.org/browser/placesTransactionsService;1"].
getService(Components.interfaces.nsIPlacesTransactionsService);

const bmController=
{
Expand Down Expand Up @@ -379,13 +376,13 @@ var BookmarkTags= function ()
case "cmd_redo":
BookmarkTags.Util.runBMBatch(function ()
{
transactServ.redoTransaction();
PlacesUtils.transactionManager.redoTransaction();
});
break;
case "cmd_undo":
BookmarkTags.Util.runBMBatch(function ()
{
transactServ.undoTransaction();
PlacesUtils.transactionManager.undoTransaction();
});
break;
}
Expand All @@ -407,10 +404,10 @@ var BookmarkTags= function ()
tagController.isCommandEnabled(this.tagTable_[cmd]));
break;
case "cmd_redo":
return transactServ.numberOfRedoItems > 0;
return PlacesUtils.transactionManager.numberOfRedoItems > 0;
break;
case "cmd_undo":
return transactServ.numberOfUndoItems > 0;
return PlacesUtils.transactionManager.numberOfUndoItems > 0;
break;
}
return false;
Expand Down
2 changes: 2 additions & 0 deletions content/treeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,8 @@ BookmarkTags.TreeView= function ()
case "lastModified":
case "dateAdded":
case "visit_date":
Ci= Components.interfaces;
Cc= Components.classes;
return PlacesTreeView.prototype._convertPRTimeToString(val);
break;
}
Expand Down
17 changes: 14 additions & 3 deletions install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>[email protected]</em:id>
<em:name>TagSieve</em:name>
<em:version>4.2.8</em:version>
<em:version>4.3.0</em:version>
<em:description>Browse your bookmarks with sets of tags</em:description>
<em:creator>hark</em:creator>
<em:homepageURL>http://www.grue.in/tagsieve</em:homepageURL>
Expand All @@ -14,9 +14,20 @@
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>3.5</em:minVersion>
<em:maxVersion>3.7.*</em:maxVersion>
<em:minVersion>3.7</em:minVersion>
<em:maxVersion>4.0.*</em:maxVersion>
</Description>
</em:targetApplication>

<em:localized>
<Description>
<em:locale>de-DE</em:locale>
<em:name>TagSieve</em:name>
<em:description>Durchsuchen Sie Ihre Lesezeichen mit Hilfe von Schlagwörtern</em:description>
<em:creator>hark</em:creator>
<em:translator>Martin Kasperek</em:translator>
<em:homepageURL>http://www.grue.in/tagsieve</em:homepageURL>
</Description>
</em:localized>
</Description>
</RDF>
10 changes: 10 additions & 0 deletions locale/de-DE/browserOverlay.dtd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!ENTITY bmt.sidebarBroadcaster.label "TagSieve">
<!ENTITY bmt.sidebarBroadcaster.accesskey "A">
<!ENTITY bmt.sidebarBroadcaster.tooltiptext "TagSieve in der Sidebar öffnen">
<!ENTITY bmt.sidebarTitle "TagSieve">

<!ENTITY bmt.bmMenuToolbarbutton.label "TagSieve-Menü">
<!ENTITY bmt.bmMenuBookmarksPopup.label "TagSieve">
<!ENTITY bmt.bmMenuToolbarbutton.accesskey "M">

<!ENTITY bmt.migrateMenuitem.label "TagSieve-Migrationsassistent">
Loading

0 comments on commit 30e526b

Please sign in to comment.