diff --git a/Makefile b/Makefile
index de747cb9..48ab35be 100644
--- a/Makefile
+++ b/Makefile
@@ -1,21 +1,45 @@
#### configuration
-VERSION = 0.4
+TOP = $(shell pwd)
-JAR_FILES = ${shell find chrome/content/ -type f -a ! -path '*CVS*' ! -name 'tags'} chrome.manifest
-JAR = chrome/vimperator.jar
+VERSION = 0.4
+OS = $(shell uname -s)
+DATE = $(shell date "+%Y/%m/%d")
+
+JAR_FILES = ${shell find chrome/content/ -type f -a ! -path '*CVS*' ! -name 'tags'} chrome.manifest
+JAR_DIRS = $(foreach f,${JAR_FILES},$(dir $f))
+JAR = chrome/vimperator.jar
+
+XPI_TXT_FILES = install.rdf chrome.manifest TODO AUTHORS Donators ChangeLog
+XPI_DIRS = $(foreach f,${XPI_FILES},$(dir $f))
+XPI_BIN_FILES = ${JAR} Makefile
+XPI_FILES = ${XPI_BIN_FILES} ${XPI_TXT_FILES}
+XPI_NAME = vimperator_${VERSION}.xpi
+XPI = ../downloads/${XPI_NAME}
+
+BUILD_DIR=build.${VERSION}.${OS}
+BUILD_JAR_DIR=${BUILD_DIR}/jar
+BUILD_XPI_DIR=${BUILD_DIR}/xpi
+
+BUILD_JAR_SUBDIRS=$(sort ${JAR_DIRS:%=${BUILD_JAR_DIR}/%})
+BUILD_XPI_SUBDIRS=$(sort ${XPI_DIRS:%=${BUILD_XPI_DIR}/%})
-RELEASE_FILES = ${JAR} install.rdf chrome.manifest TODO AUTHORS Donators ChangeLog Makefile
-RELEASE_DIR = ../downloads
-RELEASE_XPI = vimperator_${VERSION}.xpi
-RELEASE = ${RELEASE_DIR}/${RELEASE_XPI}
ZIP = zip
# find the vimperator chrome dir
+ifeq (${OS},Darwin)
+FIREFOX_DEFAULT = $(wildcard ${HOME}/Library/Application\ Support/Firefox/Profiles/*default)
+else
FIREFOX_DEFAULT = $(wildcard ${HOME}/.mozilla/firefox/*.default)
-VIMPERATOR_CHROME = ${FIREFOX_DEFAULT}/extensions/vimperator@mozdev.org/chrome/
+endif
+
+VIMPERATOR_CHROME_EMAIL = ${FIREFOX_DEFAULT}/extensions/vimperator@mozdev.org/chrome/
+FOUND_CHROME_UUID = $(dir $(wildcard ${FIREFOX_DEFAULT}/extensions/{*-*-*-*-*}/chrome/vimperator.jar))
+FOUND_CHROME_EMAIL = $(dir $(wildcard ${VIMPERATOR_CHROME_EMAIL}))
+FOUND_CHROME = $(if ${FOUND_CHROME_UUID},${FOUND_CHROME_UUID},${FOUND_CHROME_EMAIL})
+INSTALL_CHROME = $(if ${FOUND_CHROME},${FOUND_CHROME},${VIMPERATOR_CHROME_EMAIL})
# specify V=1 on make line to see more verbose output
Q=$(if ${V},,@)
@@ -33,44 +57,77 @@ help:
@echo " make info - shome some info about the system"
@echo " make jar - build a JAR (${JAR})"
@echo " make install - install into your firefox dir (run info)"
- @echo " make xpi - build an XPI (${RELEASE_XPI})"
+ @echo " make xpi - build an XPI (${XPI_NAME})"
@echo " make clean - clean up"
@echo
@echo "running some commands with V=1 will show more build details"
info:
@echo "version ${VERSION}"
- @echo "release file ${RELEASE}"
+ @echo "release file ${XPI}"
@echo -e "jar files $(shell echo ${JAR_FILES} | sed 's/ /\\n /g' )"
@test -d "${FIREFOX_DEFAULT}" || ( echo "E: didn't find your .mozilla/firefox/*.default/ dir" ; false )
@echo "firefox default ${FIREFOX_DEFAULT}"
- @test -d "${VIMPERATOR_CHROME}" || ( echo "E: didn't find an existing vimperator chrome dir" ; false )
- @echo "vimperator chrome ${VIMPERATOR_CHROME}"
+ @test -d "${FOUND_CHROME}" || ( echo "E: didn't find an existing vimperator chrome dir" ; false )
+ @[ -n "${FOUND_CHROME_UUID}" ] && \
+ echo "vimperator chrome ${FOUND_CHROME_UUID}" || true
+ @[ -n "${FOUND_CHROME_EMAIL}" ] && \
+ echo "vimperator chrome ${FOUND_CHROME_EMAIL}" || true
+ @[ -z "${FOUND_CHROME_UUID}" -o -z "${FOUND_CHROME_EMAIL}" ] || \
+ (echo "E: you have multiple vimperator's installed, you need to fix that" ; false)
needs_chrome_dir:
@echo "Checking chrome dir..."
- -${Q}mkdir -p "${VIMPERATOR_CHROME}"
- ${Q}test -d "${VIMPERATOR_CHROME}"
+ -${Q}mkdir -p "${INSTALL_CHROME}"
+ ${Q}test -d "${INSTALL_CHROME}"
-xpi: ${RELEASE}
+xpi: ${XPI}
jar: ${JAR}
install: needs_chrome_dir ${JAR}
@echo "Installing JAR..."
- ${Q}cp ${CP_V} ${JAR} ${VIMPERATOR_CHROME}
+ ${Q}cp ${CP_V} ${JAR} ${INSTALL_CHROME}
clean:
@echo "Cleanup..."
${Q}rm -f ${JAR} ${XPI}
${Q}find . -name '*~' -exec rm -f {} \;
-${RELEASE}: ${RELEASE_FILES}
- @echo "Building XPI..."
- @mkdir -p ${RELEASE_DIR}
- ${Q}${ZIP} -r ${RELEASE} ${RELEASE_FILES}
- @echo "SUCCESS: ${RELEASE}"
+#### xpi
-${JAR}: ${JAR_FILES}
+${BUILD_XPI_SUBDIRS}:
+ @mkdir -p $@
+
+${XPI}: ${BUILD_XPI_SUBDIRS} ${XPI_FILES}
+ @echo "Building XPI..."
+ ${Q}for f in ${XPI_BIN_FILES} ; do \
+ cp $$f ${BUILD_XPI_DIR}/$$f ; \
+ done
+ ${Q}for f in ${XPI_TXT_FILES} ; do \
+ sed -e "s,###VERSION###,${VERSION},g" \
+ -e "s,###DATE###,${DATE},g" \
+ < $$f > ${BUILD_XPI_DIR}/$$f ; \
+ ( diff -q $$f ${BUILD_XPI_DIR}/$$f 1>/dev/null ) || \
+ ( echo "modified: $$f" ; \
+ diff -u $$f ${BUILD_XPI_DIR}/$$f | grep '^[-+][^-+]' ) ; \
+ done
+ ${Q}( cd ${BUILD_XPI_DIR} && ${ZIP} -r ${TOP}/${XPI} ${XPI_FILES} )
+ @echo "SUCCESS: ${XPI}"
+
+#### jar
+
+${BUILD_JAR_SUBDIRS}:
+ @mkdir -p $@
+
+${JAR}: ${BUILD_JAR_SUBDIRS} ${JAR_FILES}
@echo "Building JAR..."
- ${Q}${ZIP} -r ${JAR} ${JAR_FILES}
+ ${Q}for f in ${JAR_FILES} ; do \
+ sed -e "s,###VERSION###,${VERSION},g" \
+ -e "s,###DATE###,${DATE},g" \
+ < $$f > ${BUILD_JAR_DIR}/$$f ; \
+ ( diff -q $$f ${BUILD_JAR_DIR}/$$f 1>/dev/null ) || \
+ ( echo "modified: $$f" ; \
+ diff -u $$f ${BUILD_JAR_DIR}/$$f | grep '^[-+][^-+]' ) ; \
+ done
+ ${Q}( cd ${BUILD_JAR_DIR} && ${ZIP} -r ${TOP}/${JAR} ${JAR_FILES} )
@echo "SUCCESS: ${JAR}"
diff --git a/TODO b/TODO
index 6c9f8763..6210eee6 100644
--- a/TODO
+++ b/TODO
@@ -19,7 +19,7 @@ FEATURES:
8 :open .. -> Up one directory, :cd goes to top location, [Backspace] command shortcut, use count (:3cd goes 3 levels up)
8 downloading of links to filesystem (:save First there was a Navigator, then there was an Explorer.:pclose or open entries with double click in the current tab or middle click in a new tab.",
@@ -198,7 +198,7 @@ var g_commands = [/*{{{*/
],
[
["javascript", "js"],
- ["javascript {cmd}", "javascript <<{endpattern}
{script}
{endpattern}"],
+ ["javascript {cmd}", "javascript << {endpattern}
{script}
{endpattern}"],
"Run any javascript command through eval()",
"Acts as a javascript interpreter by passing the argument to eval().
" +
":javascript alert('Hello world') would show a dialog box with the text \"Hello world\".
" +
@@ -234,17 +234,17 @@ var g_commands = [/*{{{*/
],
[
["open", "op", "o", "edit", "e"],
- ["open [url] [| [url]]"],
+ ["open [url] [| url]"],
"Open one ore more URLs in the current tab",
"Multiple URLs can be separated with the | character.
" +
- "Each |-separated token is analazed and in this order:
"+
- "
"+
+ "You WILL be able to use :open wiki linus torvalds will open the wikipedia entry for linux torvalds).
"+
+ "
"+
- "You WILL be able to use :open wiki linus torvalds will open the wikipedia entry for linux torvalds).
... is special and goes to the moves up the directory hierarchy as far as possible.
"+
- " - :open ... with current location http://www.example.com/dir1/dir2/file.html will open http://www.example.com
"+
- " - :open ./foo.html with current location http://www.example.com/dir1/dir2/file.html will open http://www.example.com/dir1/dir2/foo.html:open ... with current location http://www.example.com/dir1/dir2/file.html will open http://www.example.com
"+
+ " :open ./foo.html with current location http://www.example.com/dir1/dir2/file.html will open http://www.example.com/dir1/dir2/foo.html"+
" :open linus torvalds will open a google search for linux torvalds).:open www.osnews.com | www.slashdot.org will open OSNews in the current, and Slashdot in a new background tab).:open [-T \"linux\"] torvalds<Tab> to complete bookmarks with tag \"linux\" and which contain \"torvalds\". Note that -T support is only available for tab completion, not for the actual command.
"+
+ " :open www.osnews.com | www.slashdot.org will open OSNews in the current, and Slashdot in a new background tab).:open [-T \"linux\"] torvalds<Tab> to complete bookmarks with tag \"linux\" and which contain \"torvalds\". Note that -T support is only available for tab completion, not for the actual command.
"+
"The items which are completed on <Tab> are specified in the 'complete' option.
"+
"Without argument, reloads the current page.
"+
"Without argument but with !, reloads the current page skipping the cache.",
@@ -307,8 +307,8 @@ var g_commands = [/*{{{*/
[
["restart"],
["restart"],
- "Forces the browser to restart.",
- null,
+ "Force the browser to restart",
+ "Useful when installing extenstions.",
restart,
null
],
@@ -816,6 +816,7 @@ var g_mappings = [/*{{{*/
"Then press AB to select the hint. Now press y to yank its location.
"+
"Actions for selected hints in ExtendedHint mode are:
"+
"y to yank its locationY to yank its text descriptiono to open its location in the current tabt to open its location in a new tabO to open its location in an :open query (not implemented yet)Vimperator
' +
'
'+
'Later it was time for a Konqueror. Now it\'s time for an Imperator, the VIMperator :)
" +beg+ cmd_name +end+ '';
}
+
+ // the usage information for the command
ret += '" +beg+ usage +end+ '' + // should change that to: white-space: pre-wrap; once CSS3 hits firefox
header +
introduction +
@@ -241,6 +184,8 @@ table.settings th {\
settings +
''
+// fulldoc = 'hallo
'; + doc.open(); doc.write(fulldoc); doc.close(); diff --git a/chrome/content/vimperator/hints.js b/chrome/content/vimperator/hints.js index b0d11984..c9eb7cdf 100644 --- a/chrome/content/vimperator/hints.js +++ b/chrome/content/vimperator/hints.js @@ -212,9 +212,9 @@ function hit_a_hint() if (linkCount == 0 && hintmode != HINT_MODE_ALWAYS) { beep(); - alert('h'); + //alert('h'); this.disableHahMode(win); - alert('g'); + //alert('g'); // setCurrentMode(MODE_NORMAL); // linkNumString = ''; // hintedElems = []; @@ -250,7 +250,7 @@ function hit_a_hint() function removeHints(win) { if (!win) - win = window._content; + win = window.content; var doc = win.document; var res = doc.evaluate("//HINTS/SPAN", doc, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); @@ -419,14 +419,17 @@ function hit_a_hint() * @return -1 if already disabled */ //function disableHahMode(event) - this.disableHahMode = function(win) + this.disableHahMode = function(win, silent) { + if(!isHahModeEnabled) + return; + setCurrentMode(MODE_NORMAL); isHahModeEnabled = false; hintmode = HINT_MODE_QUICK; linkNumString = ''; hintedElems = []; - if (get_pref("showmode")) + if (!silent && get_pref("showmode")) echo(''); removeHints(win); @@ -512,7 +515,7 @@ function hit_a_hint() return 0; }; - this.yankHints = function() + this.yankUrlHints = function() { var loc = ""; var elems = hah.hintedElements(); @@ -524,6 +527,28 @@ function hit_a_hint() loc += tmp + "\n"; } + // disable the hints before we can echo() an information + this.disableHahMode(null, true); + + copyToClipboard(loc); + echo("Yanked " + loc); + }; + + this.yankTextHints = function() + { + var loc = ""; + var elems = hah.hintedElements(); + var tmp = ""; + for(i=0; i