treestyletab/content/treestyletab/res/bookmarkMultipleTabs_bookmarkPropertiesOverlay.xul
YUKI "Piro" Hiroshi 0ed972459b Update library
2015-11-12 13:11:57 +09:00

60 lines
2.3 KiB
XML

<?xml version="1.0"?>
<!--
Bookmark Multiple Tabs library for Firefox 2 or later
Usage:
in chrome.manifest:
overlay chrome://browser/content/browser.xul
chrome://***/content/bookmarkMultipleTabs.xul
overlay chrome://browser/content/places/bookmarkProperties.xul
chrome://***/content/bookmarkMultipleTabs_bookmarkPropertiesOverlay.xul
overlay chrome://browser/content/places/bookmarkProperties2.xul
chrome://***/content/bookmarkMultipleTabs_bookmarkPropertiesOverlay.xul
in JS files:
window['piro.sakura.ne.jp'].bookmarkMultipleTabs.addBookmarkFor(tabsArray, folderName);
license: The MIT License, Copyright (c) 2009-2015 YUKI "Piro" Hiroshi
http://github.com/piroor/fxaddonlibs/blob/master/license.txt
original:
http://github.com/piroor/fxaddonlibs/blob/master/bookmarkMultipleTabs.xul
http://github.com/piroor/fxaddonlibs/blob/master/bookmarkMultipleTabs_bookmarkPropertiesOverlay.xul
-->
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript"><![CDATA[
(function() {
if (!('BookmarkPropertiesPanel' in window) ||
!BookmarkPropertiesPanel._determineItemInfo ||
BookmarkPropertiesPanel.__bookmarkMultipleTabs__determineItemInfo)
return;
// Defined at http://mxr.mozilla.org/mozilla-central/source/browser/components/places/content/bookmarkProperties.js#73
const ACTION_ADD = 1;
BookmarkPropertiesPanel.__bookmarkMultipleTabs__determineItemInfo = BookmarkPropertiesPanel._determineItemInfo;
BookmarkPropertiesPanel._determineItemInfo = function(...aArgs) {
var folderNameOverride = null;
try {
folderNameOverride = Components.classes['@mozilla.org/preferences;1']
.getService(Components.interfaces.nsIPrefBranch)
.getCharPref('temp.showMinimalAddMultiBookmarkUI.folderName');
folderNameOverride = decodeURIComponent(escape(folderNameOverride));
}
catch(e) {
}
var retVal = this.__bookmarkMultipleTabs__determineItemInfo.apply(this, aArgs);
if (folderNameOverride &&
this._action == ACTION_ADD) {
let dialogInfo = window.arguments[0];
if (dialogInfo.type === 'folder' &&
!('title' in dialogInfo) &&
'URIList' in dialogInfo) {
this._title = folderNameOverride;
}
}
return retVal;
};
})();
]]></script>
</overlay>