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 ) 8 provide a buffer on the bottom where more than 1 line messages can be shown, preferrable - with color support (for things like :ls) + with color support (for things like :echo line1\nline2) 8 middleclick in content == p, and if command line is open, paste there the clipboard buffer 8 [ctrl-o/i] to Go back to a Previous Position (done partly, however currenty does not use a per tab jumplist) 8 Use our own find-as-you-type mechanism (like conkeror does) diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js index 0f672e9c..e50f2802 100644 --- a/chrome/content/vimperator/commands.js +++ b/chrome/content/vimperator/commands.js @@ -189,7 +189,7 @@ var g_commands = [/*{{{*/ ], [ ["history", "hs"], - ["hs {filter}"], + ["history {filter}"], "Show recently visited URLs", "Open the preview window at the bottom of the screen for all history items which match the filter string either in the title or URL.", "Close this window with :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:
"+ - "
  1. Opened with the specified search engine if the token looks like a search string and the first word of the token is the name of a search engine (:open wiki linus torvalds will open the wikipedia entry for linux torvalds).
  2. "+ + "Each |-separated token is analayzed and in this order:
    "+ + "
    1. Opened with the specified search engine if the token looks like a search string and the first word of the token is the name of a search engine (:open wiki linus torvalds will open the wikipedia entry for linux torvalds).
    2. "+ "
    3. Transformed to a relative URL of the current location if it starts with . or .. or ...;
      ... 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
    4. "+ + " :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"+ "
    5. Opened with the default search engine if the first word is no search engine (:open linus torvalds will open a google search for linux torvalds).
    6. "+ - "
    7. Passed directly to Firefox in all other cases (:open www.osnews.com | www.slashdot.org will open OSNews in the current, and Slashdot in a new background tab).
    "+ - "You WILL be able to use :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.
    "+ + "
  3. Passed directly to Firefox in all other cases (:open www.osnews.com | www.slashdot.org will open OSNews in the current, and Slashdot in a new background tab).
"+ + "You WILL be able to use :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:
"+ "