mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-13 16:25:45 +01:00
Merge branch 'xulmus' of kmaglione@git.vimperator.org:/git/vimperator/liberator
This commit is contained in:
@@ -9,7 +9,7 @@ LOCALEDIR = locale
|
||||
DOC_SRC_FILES = $(wildcard $(LOCALEDIR)/*/*.txt)
|
||||
LOCALES = $(foreach locale,$(wildcard $(LOCALEDIR)/*),$(word 2,$(subst /, ,$(locale))))
|
||||
|
||||
MAKE_JAR = VERSION="$(VERSION)" DATE="$(BUILD_DATE)" sh $(BASE)/make_jar.sh
|
||||
MAKE_JAR = VERSION="$(VERSION)" DATE="$(BUILD_DATE)" bash $(BASE)/make_jar.sh
|
||||
|
||||
# TODO: specify source files manually?
|
||||
JAR_BASES = $(TOP) $(BASE)
|
||||
@@ -45,7 +45,7 @@ TARGETS = all help info doc jar xpi install clean distclean $(JAR)
|
||||
$(TARGETS:%=\%.%):
|
||||
echo MAKE $* $(@:$*.%=%)
|
||||
$(MAKE) -C $* $(@:$*.%=%)
|
||||
|
||||
echo $$SHELL
|
||||
.PHONY: $(TARGETS)
|
||||
all: help
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ function Buffer() //{{{
|
||||
|
||||
// FIXME: This doesn't belong here.
|
||||
let mainWindowID = config.mainWindowID || "main-window";
|
||||
|
||||
let fontSize = util.computedStyle(document.getElementById(mainWindowID)).fontSize;
|
||||
|
||||
styles.registerSheet("chrome://liberator/skin/liberator.css");
|
||||
@@ -214,7 +215,13 @@ function Buffer() //{{{
|
||||
|
||||
mappings.add(myModes, ["<C-c>"],
|
||||
"Stop loading",
|
||||
function () { window.BrowserStop(); });
|
||||
function ()
|
||||
{
|
||||
if(config.name == "Xulmus")
|
||||
getBrowser().mCurrentBrowser.stop();
|
||||
else
|
||||
window.BrowserStop();
|
||||
});
|
||||
|
||||
// scrolling
|
||||
mappings.add(myModes, ["j", "<Down>", "<C-e>"],
|
||||
@@ -596,7 +603,13 @@ function Buffer() //{{{
|
||||
|
||||
commands.add(["st[op]"],
|
||||
"Stop loading",
|
||||
function () { window.BrowserStop(); },
|
||||
function ()
|
||||
{
|
||||
if (config.name == "Xulmus")
|
||||
getBrowser().mCurrentBrowser.stop();
|
||||
else
|
||||
window.BrowserStop();
|
||||
},
|
||||
{ argCount: "0" });
|
||||
|
||||
commands.add(["vie[wsource]"],
|
||||
|
||||
@@ -1390,6 +1390,16 @@ function Completion() //{{{
|
||||
completion.urls(context, tags);
|
||||
},
|
||||
|
||||
song: function song(context, args)
|
||||
{
|
||||
if (args.completeArg == 0)
|
||||
context.completions = getArtists();
|
||||
else if (args.completeArg == 1)
|
||||
context.completions = getAlbums(args[0]);
|
||||
else if (args.completeArg == 2)
|
||||
context.completions = getTracks(args[0],args[1]);
|
||||
},
|
||||
|
||||
buffer: function buffer(context)
|
||||
{
|
||||
filter = context.filter.toLowerCase();
|
||||
|
||||
@@ -628,7 +628,7 @@ function Events() //{{{
|
||||
// return true when load successful, or false otherwise
|
||||
function waitForPageLoaded() events.waitForPageLoad();
|
||||
|
||||
// load all macros inside ~/.vimperator/macros/
|
||||
// load all macros
|
||||
// setTimeout needed since io. is loaded after events.
|
||||
setTimeout(function () {
|
||||
try
|
||||
@@ -678,16 +678,16 @@ function Events() //{{{
|
||||
function () { events.onEscape(); });
|
||||
|
||||
// add the ":" mapping in all but insert mode mappings
|
||||
mappings.add([modes.NORMAL, modes.VISUAL, modes.HINTS, modes.MESSAGE, modes.COMPOSE, modes.CARET, modes.TEXTAREA],
|
||||
mappings.add([modes.NORMAL, modes.PLAYER, modes.VISUAL, modes.HINTS, modes.MESSAGE, modes.COMPOSE, modes.CARET, modes.TEXTAREA],
|
||||
[":"], "Enter command line mode",
|
||||
function () { commandline.open(":", "", modes.EX); });
|
||||
|
||||
// focus events
|
||||
mappings.add([modes.NORMAL, modes.VISUAL, modes.CARET],
|
||||
mappings.add([modes.NORMAL, modes.PLAYER, modes.VISUAL, modes.CARET],
|
||||
["<Tab>"], "Advance keyboard focus",
|
||||
function () { document.commandDispatcher.advanceFocus(); });
|
||||
|
||||
mappings.add([modes.NORMAL, modes.VISUAL, modes.CARET, modes.INSERT, modes.TEXTAREA],
|
||||
mappings.add([modes.NORMAL, modes.PLAYER,modes.VISUAL, modes.CARET, modes.INSERT, modes.TEXTAREA],
|
||||
["<S-Tab>"], "Rewind keyboard focus",
|
||||
function () { document.commandDispatcher.rewindFocus(); });
|
||||
|
||||
@@ -704,12 +704,12 @@ function Events() //{{{
|
||||
function () { return; });
|
||||
|
||||
// macros
|
||||
mappings.add([modes.NORMAL, modes.MESSAGE],
|
||||
mappings.add([modes.NORMAL, modes.PLAYER, modes.MESSAGE],
|
||||
["q"], "Record a key sequence into a macro",
|
||||
function (arg) { events.startRecording(arg); },
|
||||
{ flags: Mappings.flags.ARGUMENT });
|
||||
|
||||
mappings.add([modes.NORMAL, modes.MESSAGE],
|
||||
mappings.add([modes.NORMAL, modes.PLAYER, modes.MESSAGE],
|
||||
["@"], "Play a macro",
|
||||
function (count, arg)
|
||||
{
|
||||
@@ -1228,6 +1228,21 @@ function Events() //{{{
|
||||
}
|
||||
}
|
||||
|
||||
if (config.name == "Xulmus")
|
||||
{
|
||||
// Switch to -- PLAYER -- mode for Songbird Media Player.
|
||||
if (config.isPlayerWindow)
|
||||
{
|
||||
liberator.mode = modes.PLAYER;
|
||||
}
|
||||
else
|
||||
{
|
||||
liberator.mode = modes.NORMAL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
urlbar = document.getElementById("urlbar");
|
||||
if (elem == null && urlbar && urlbar.inputField == lastFocus)
|
||||
liberator.threadYield(true);
|
||||
@@ -1426,8 +1441,7 @@ function Events() //{{{
|
||||
// XXX: ugly hack for now pass certain keys to Firefox as they are without beeping
|
||||
// also fixes key navigation in combo boxes, submitting forms, etc.
|
||||
// FIXME: breaks iabbr for now --mst
|
||||
if ((config.name == "Vimperator" && liberator.mode == modes.NORMAL)
|
||||
|| liberator.mode == modes.INSERT)
|
||||
if (((config.name == "Xulmus" || config.name == "Vimperator") && liberator.mode == modes.NORMAL || liberator.mode == modes.INSERT))
|
||||
{
|
||||
if (key == "<Return>")
|
||||
return false;
|
||||
|
||||
@@ -26,6 +26,7 @@ the provisions above, a recipient may use your version of this file under
|
||||
the terms of any one of the MPL, the GPL or the LGPL.
|
||||
}}} ***** END LICENSE BLOCK *****/
|
||||
|
||||
|
||||
/** @scope modules */
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm", modules);
|
||||
@@ -82,6 +83,9 @@ const liberator = (function () //{{{
|
||||
{
|
||||
if (nError++ == 0)
|
||||
window.toJavaScriptConsole();
|
||||
liberator.dump("Error loading module - "+ name + "..");
|
||||
liberator.dump(e);
|
||||
liberator.dump(e.stack);
|
||||
liberator.reportError(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,6 +269,7 @@ const modes = (function () //{{{
|
||||
self.addMode("MESSAGE"); // for now only used in Muttator when the message has focus
|
||||
self.addMode("COMPOSE");
|
||||
self.addMode("CUSTOM", false, function () plugins.mode);
|
||||
self.addMode("PLAYER"); // Player mode for songbird
|
||||
// extended modes, can include multiple modes, and even main modes
|
||||
self.addMode("EX", true);
|
||||
self.addMode("HINTS", true);
|
||||
|
||||
@@ -48,6 +48,7 @@ function Services()
|
||||
|
||||
self.add("appStartup", "@mozilla.org/toolkit/app-startup;1", Ci.nsIAppStartup);
|
||||
self.add("autoCompleteSearch", "@mozilla.org/browser/global-history;2", Ci.nsIAutoCompleteSearch);
|
||||
//self.add("autoCompleteSearch", "@mozilla.org/autocomplete/search;1?name=songbird-autocomplete", Ci.nsIAutoCompleteSearch);
|
||||
self.add("browserSearch", "@mozilla.org/browser/search-service;1", Ci.nsIBrowserSearchService);
|
||||
self.add("cache", "@mozilla.org/network/cache-service;1", Ci.nsICacheService);
|
||||
self.add("console", "@mozilla.org/consoleservice;1", Ci.nsIConsoleService);
|
||||
@@ -64,6 +65,7 @@ function Services()
|
||||
self.add("threadManager", "@mozilla.org/thread-manager;1", Ci.nsIThreadManager);
|
||||
self.add("windowMediator", "@mozilla.org/appshell/window-mediator;1", Ci.nsIWindowMediator);
|
||||
self.add("windowWatcher", "@mozilla.org/embedcomp/window-watcher;1", Ci.nsIWindowWatcher);
|
||||
self.add("bookmarks", "@mozilla.org/browser/nav-bookmarks-service;1", Ci.nsINavBookmarksService);
|
||||
|
||||
self.addClass("file", "@mozilla.org/file/local;1", Ci.nsILocalFile);
|
||||
self.addClass("find", "@mozilla.org/embedcomp/rangefind;1", Ci.nsIFind);
|
||||
|
||||
@@ -109,7 +109,10 @@ function Tabs() //{{{
|
||||
// hide tabs initially
|
||||
if (config.name == "Vimperator")
|
||||
getBrowser().mStrip.getElementsByClassName("tabbrowser-tabs")[0].collapsed = true;
|
||||
|
||||
/*
|
||||
if (config.name == "Xulmus")
|
||||
getBrowser()._strip.getElementsByClassName(
|
||||
*/
|
||||
/////////////////////////////////////////////////////////////////////////////}}}
|
||||
////////////////////// OPTIONS /////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////{{{
|
||||
@@ -148,7 +151,7 @@ function Tabs() //{{{
|
||||
validator: Option.validateCompleter
|
||||
});
|
||||
|
||||
if (config.name == "Vimperator")
|
||||
if (config.name == "Vimperator" || config.name == "Xulmus" )
|
||||
{
|
||||
options.add(["activate", "act"],
|
||||
"Define when tabs are automatically activated",
|
||||
@@ -238,7 +241,7 @@ function Tabs() //{{{
|
||||
function (count) { tabs.select("-" + (count < 1 ? 1 : count), true); },
|
||||
{ flags: Mappings.flags.COUNT });
|
||||
|
||||
if (config.name == "Vimperator")
|
||||
if (config.name == "Vimperator" || config.name == "Xulmus")
|
||||
{
|
||||
mappings.add([modes.NORMAL], ["b"],
|
||||
"Open a prompt to switch buffers",
|
||||
@@ -449,7 +452,7 @@ function Tabs() //{{{
|
||||
function () { tabs.select(0, false); },
|
||||
{ argCount: "0" });
|
||||
|
||||
if (config.name == "Vimperator")
|
||||
if (config.name == "Vimperator" || config.name == "Xulmus")
|
||||
{
|
||||
// TODO: "Zero count" if 0 specified as arg, multiple args and count ranges?
|
||||
commands.add(["b[uffer]"],
|
||||
@@ -584,7 +587,7 @@ function Tabs() //{{{
|
||||
});
|
||||
}
|
||||
|
||||
if (liberator.has("session"))
|
||||
if (liberator.has("session") && config.name != "Xulmus")
|
||||
{
|
||||
// TODO: extract common functionality of "undoall"
|
||||
commands.add(["u[ndo]"],
|
||||
@@ -781,6 +784,22 @@ function Tabs() //{{{
|
||||
getBrowser().removeTab(tab);
|
||||
else
|
||||
liberator.beep();
|
||||
},
|
||||
Songbird: function (tab)
|
||||
{
|
||||
if (getBrowser().mTabs.length > 1)
|
||||
getBrowser().removeTab(tab);
|
||||
else
|
||||
{
|
||||
if (buffer.URL != "about:blank" ||
|
||||
window.getWebNavigation().sessionHistory.count > 0)
|
||||
{
|
||||
liberator.open("about:blank", liberator.NEW_BACKGROUND_TAB);
|
||||
getBrowser().removeTab(tab);
|
||||
}
|
||||
else
|
||||
liberator.beep();
|
||||
}
|
||||
}
|
||||
}[config.hostApplication] || function () {};
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ do
|
||||
(
|
||||
set -e
|
||||
cd $base
|
||||
[ ${jar##*.} = jar ] && stage="$stage/${base##*/}"
|
||||
[ ${jar##*.} = jar ] && stage="$stage/${base##*/}"
|
||||
for dir in $dirs
|
||||
do
|
||||
for f in $(getfiles "$bin" "$dir")
|
||||
@@ -51,6 +51,8 @@ do
|
||||
)
|
||||
done
|
||||
|
||||
(cd $stage; zip -r "$top/$jar" *)
|
||||
cd $stage
|
||||
zip -r "$top/$jar" *
|
||||
cd -
|
||||
rm -rf "$stage"
|
||||
|
||||
|
||||
@@ -174,7 +174,9 @@ statusbarpanel {
|
||||
}
|
||||
|
||||
#liberator-completions-content *,
|
||||
#liberator-multiline-output-content * {
|
||||
#liberator-multiline-output-content *,
|
||||
#liberator-commandline-prompt *,
|
||||
#liberator-commandline-command {
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user