mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 19:17:59 +01:00
now we have a new build Makefile
also added file.js which is responsible for file writing/loading in future
This commit is contained in:
@@ -3,6 +3,7 @@ date:
|
|||||||
* version 0.4
|
* version 0.4
|
||||||
* fixed saving of session
|
* fixed saving of session
|
||||||
* fixed hints display when zooming in/out of a web page
|
* fixed hints display when zooming in/out of a web page
|
||||||
|
* added 'B' command for continous buffer display
|
||||||
* changed hintsize to 12px by default
|
* changed hintsize to 12px by default
|
||||||
* 'previewheight' setting to set the maximum size for the preview window
|
* 'previewheight' setting to set the maximum size for the preview window
|
||||||
* showmode setting which shows the current mode in the command line (patch from Виктор Кожухаров)
|
* showmode setting which shows the current mode in the command line (patch from Виктор Кожухаров)
|
||||||
|
|||||||
73
Makefile
Normal file
73
Makefile
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
#### configuration
|
||||||
|
|
||||||
|
VERSION = 0.4
|
||||||
|
|
||||||
|
JAR_FILES = ${shell find chrome/content/ -type f -a ! -path '*CVS*'} chrome.manifest
|
||||||
|
JAR = chrome/vimperator.jar
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
FIREFOX_DEFAULT = $(wildcard ${HOME}/.mozilla/firefox/*.default)
|
||||||
|
VIMPERATOR_CHROME = $(wildcard ${FIREFOX_DEFAULT}/extensions/{f9570b26-e246-4753-9b68-61aa95994237}/chrome/)
|
||||||
|
|
||||||
|
# specify V=1 on make line to see more verbose output
|
||||||
|
Q=$(if ${V},,@)
|
||||||
|
|
||||||
|
#### rules
|
||||||
|
|
||||||
|
.PHONY: all help info needs_chrome_dir jar xpi install clean
|
||||||
|
all: help
|
||||||
|
|
||||||
|
help:
|
||||||
|
@echo "vimperator ${VERSION} build"
|
||||||
|
@echo
|
||||||
|
@echo " make help - display this 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 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 -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}"
|
||||||
|
|
||||||
|
needs_chrome_dir:
|
||||||
|
test -d "${VIMPERATOR_CHROME}"
|
||||||
|
|
||||||
|
xpi: ${RELEASE}
|
||||||
|
jar: ${JAR}
|
||||||
|
|
||||||
|
install: needs_chrome_dir ${JAR}
|
||||||
|
@echo "Installing JAR..."
|
||||||
|
${Q}cp -v ${JAR} ${VIMPERATOR_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}"
|
||||||
|
|
||||||
|
${JAR}: ${JAR_FILES}
|
||||||
|
@echo "Building JAR..."
|
||||||
|
${Q}${ZIP} -r ${JAR} ${JAR_FILES}
|
||||||
|
@echo "SUCCESS: ${JAR}"
|
||||||
23
build.sh
23
build.sh
@@ -1,23 +0,0 @@
|
|||||||
VERSION=0.3
|
|
||||||
FILES="chrome/content/ chrome.manifest"
|
|
||||||
|
|
||||||
# echo Building XPI...
|
|
||||||
# zip conkeror-$VERSION.xpi $FILES install.js
|
|
||||||
# mv conkeror-$VERSION.xpi ../downloads
|
|
||||||
|
|
||||||
zip -r chrome/vimperator.jar $FILES
|
|
||||||
#cp vimperator.jar chrome
|
|
||||||
# also put it in our firefox install
|
|
||||||
cp -v chrome/vimperator.jar '/home/maxauthority/.mozilla/firefox/kc3gnd7k.default/extensions/{f9570b26-e246-4753-9b68-61aa95994237}/chrome'
|
|
||||||
|
|
||||||
# Build an xpi
|
|
||||||
if [ x$1 = xxpi ]; then
|
|
||||||
echo Building XPI...
|
|
||||||
zip -r vimperator_$VERSION.xpi chrome/vimperator.jar install.rdf chrome.manifest TODO
|
|
||||||
mv vimperator-firefox-$VERSION.xpi ../downloads
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ x$1 = xtest ]; then
|
|
||||||
cp -v chrome/vimperator.jar '/home/test/.mozilla/firefox/7ij36ukn.default/extensions/{f9570b26-e246-4753-9b68-61aa95994237}/chrome'
|
|
||||||
fi
|
|
||||||
@@ -391,7 +391,7 @@ var g_mappings = [/*{{{*/
|
|||||||
[
|
[
|
||||||
["B"],
|
["B"],
|
||||||
"Toggle buffer list",
|
"Toggle buffer list",
|
||||||
"Open the preview window with all currently opened tabs",
|
"Toggle the preview window with all currently opened tabs.",
|
||||||
buffer_preview_toggle,
|
buffer_preview_toggle,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -1601,7 +1601,22 @@ function set(args, special)
|
|||||||
|
|
||||||
function source(filename)
|
function source(filename)
|
||||||
{
|
{
|
||||||
echoerr("Soucing not yet implemented");
|
|
||||||
|
|
||||||
|
|
||||||
|
//echoerr("Soucing not yet implemented");
|
||||||
|
var fd = fopen(filename, "<");
|
||||||
|
var s = fd.read();
|
||||||
|
fd.close();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
eval(s);
|
||||||
|
}
|
||||||
|
catch(e)
|
||||||
|
{
|
||||||
|
alert(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1806,7 +1821,6 @@ table.settings th {\
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// list all installed themes and extensions
|
// list all installed themes and extensions
|
||||||
|
|||||||
161
chrome/content/vimperator/file.js
Normal file
161
chrome/content/vimperator/file.js
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
/***** BEGIN LICENSE BLOCK ***** {{{
|
||||||
|
Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
|
|
||||||
|
The contents of this file are subject to the Mozilla Public License Version
|
||||||
|
1.1 (the "License"); you may not use this file except in compliance with
|
||||||
|
the License. You may obtain a copy of the License at
|
||||||
|
http://www.mozilla.org/MPL/
|
||||||
|
|
||||||
|
Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
|
for the specific language governing rights and limitations under the
|
||||||
|
License.
|
||||||
|
|
||||||
|
(c) 2006-2007: Martin Stubenschrott <stubenschrott@gmx.net>
|
||||||
|
Code based on venkman
|
||||||
|
|
||||||
|
Alternatively, the contents of this file may be used under the terms of
|
||||||
|
either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
|
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||||
|
in which case the provisions of the GPL or the LGPL are applicable instead
|
||||||
|
of those above. If you wish to allow use of your version of this file only
|
||||||
|
under the terms of either the GPL or the LGPL, and not to allow others to
|
||||||
|
use your version of this file under the terms of the MPL, indicate your
|
||||||
|
decision by deleting the provisions above and replace them with the notice
|
||||||
|
and other provisions required by the GPL or the LGPL. If you do not delete
|
||||||
|
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 *****/
|
||||||
|
|
||||||
|
|
||||||
|
const PERM_IWOTH = 00002; /* write permission, others */
|
||||||
|
const PERM_IWGRP = 00020; /* write permission, group */
|
||||||
|
|
||||||
|
const MODE_RDONLY = 0x01;
|
||||||
|
const MODE_WRONLY = 0x02;
|
||||||
|
const MODE_RDWR = 0x04;
|
||||||
|
const MODE_CREATE = 0x08;
|
||||||
|
const MODE_APPEND = 0x10;
|
||||||
|
const MODE_TRUNCATE = 0x20;
|
||||||
|
const MODE_SYNC = 0x40;
|
||||||
|
const MODE_EXCL = 0x80;
|
||||||
|
|
||||||
|
|
||||||
|
function fopen (path, mode, perms, tmp)
|
||||||
|
{
|
||||||
|
return new LocalFile(path, mode, perms, tmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
function LocalFile(file, mode, perms, tmp)
|
||||||
|
{
|
||||||
|
const classes = Components.classes;
|
||||||
|
const interfaces = Components.interfaces;
|
||||||
|
|
||||||
|
const LOCALFILE_CTRID = "@mozilla.org/file/local;1";
|
||||||
|
const FILEIN_CTRID = "@mozilla.org/network/file-input-stream;1";
|
||||||
|
const FILEOUT_CTRID = "@mozilla.org/network/file-output-stream;1";
|
||||||
|
const SCRIPTSTREAM_CTRID = "@mozilla.org/scriptableinputstream;1";
|
||||||
|
|
||||||
|
const nsIFile = interfaces.nsIFile;
|
||||||
|
const nsILocalFile = interfaces.nsILocalFile;
|
||||||
|
const nsIFileOutputStream = interfaces.nsIFileOutputStream;
|
||||||
|
const nsIFileInputStream = interfaces.nsIFileInputStream;
|
||||||
|
const nsIScriptableInputStream = interfaces.nsIScriptableInputStream;
|
||||||
|
|
||||||
|
if (typeof perms == "undefined")
|
||||||
|
perms = 0666 & ~(PERM_IWOTH | PERM_IWGRP);
|
||||||
|
|
||||||
|
if (typeof mode == "string")
|
||||||
|
{
|
||||||
|
switch (mode)
|
||||||
|
{
|
||||||
|
case ">":
|
||||||
|
mode = MODE_WRONLY | MODE_CREATE | MODE_TRUNCATE;
|
||||||
|
break;
|
||||||
|
case ">>":
|
||||||
|
mode = MODE_WRONLY | MODE_CREATE | MODE_APPEND;
|
||||||
|
break;
|
||||||
|
case "<":
|
||||||
|
mode = MODE_RDONLY;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw "Invalid mode ``" + mode + "''";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof file == "string")
|
||||||
|
{
|
||||||
|
this.localFile = classes[LOCALFILE_CTRID].createInstance(nsILocalFile);
|
||||||
|
this.localFile.initWithPath(file);
|
||||||
|
}
|
||||||
|
else if (file instanceof nsILocalFile)
|
||||||
|
{
|
||||||
|
this.localFile = file;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw "bad type for argument |file|.";
|
||||||
|
}
|
||||||
|
|
||||||
|
this.path = this.localFile.path;
|
||||||
|
|
||||||
|
if (mode & (MODE_WRONLY | MODE_RDWR))
|
||||||
|
{
|
||||||
|
this.outputStream =
|
||||||
|
classes[FILEOUT_CTRID].createInstance(nsIFileOutputStream);
|
||||||
|
this.outputStream.init(this.localFile, mode, perms, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mode & (MODE_RDONLY | MODE_RDWR))
|
||||||
|
{
|
||||||
|
var is = classes[FILEIN_CTRID].createInstance(nsIFileInputStream);
|
||||||
|
is.init(this.localFile, mode, perms, tmp);
|
||||||
|
this.inputStream =
|
||||||
|
classes[SCRIPTSTREAM_CTRID].createInstance(nsIScriptableInputStream);
|
||||||
|
this.inputStream.init(is);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
LocalFile.prototype.write =
|
||||||
|
function fo_write(buf)
|
||||||
|
{
|
||||||
|
if (!("outputStream" in this))
|
||||||
|
throw "file not open for writing.";
|
||||||
|
|
||||||
|
return this.outputStream.write(buf, buf.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
LocalFile.prototype.read =
|
||||||
|
function fo_read(max)
|
||||||
|
{
|
||||||
|
if (!("inputStream" in this))
|
||||||
|
throw "file not open for reading.";
|
||||||
|
|
||||||
|
var av = this.inputStream.available();
|
||||||
|
if (typeof max == "undefined")
|
||||||
|
max = av;
|
||||||
|
|
||||||
|
if (!av)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var rv = this.inputStream.read(max);
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
LocalFile.prototype.close =
|
||||||
|
function fo_close()
|
||||||
|
{
|
||||||
|
if ("outputStream" in this)
|
||||||
|
this.outputStream.close();
|
||||||
|
if ("inputStream" in this)
|
||||||
|
this.inputStream.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
LocalFile.prototype.flush =
|
||||||
|
function fo_close()
|
||||||
|
{
|
||||||
|
return this.outputStream.flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
// vim: set fdm=marker sw=4 ts=4 et:
|
||||||
@@ -123,9 +123,13 @@ nsBrowserStatusHandler.prototype =
|
|||||||
},
|
},
|
||||||
onLocationChange:function (aWebProgress, aRequest, aLocation)
|
onLocationChange:function (aWebProgress, aRequest, aLocation)
|
||||||
{
|
{
|
||||||
UpdateBackForwardButtons();
|
// firefox 3.0 doesn't seem to have them anymore
|
||||||
|
if (UpdateBackForwardButtons)
|
||||||
|
UpdateBackForwardButtons();
|
||||||
|
|
||||||
var url = aLocation.spec;
|
var url = aLocation.spec;
|
||||||
gURLBar.value = url; // also update the original firefox location bar
|
if (gURLBar)
|
||||||
|
gURLBar.value = url; // also update the original firefox location bar
|
||||||
|
|
||||||
// onLocationChange is also called when switching/deleting tabs
|
// onLocationChange is also called when switching/deleting tabs
|
||||||
if (hah.currentMode() != HINT_MODE_ALWAYS)
|
if (hah.currentMode() != HINT_MODE_ALWAYS)
|
||||||
@@ -256,6 +260,10 @@ function init()
|
|||||||
}
|
}
|
||||||
g_history.unshift([url, title]);
|
g_history.unshift([url, title]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// also reset the buffer list, since the url titles are valid here
|
||||||
|
if (g_bufshow)
|
||||||
|
bufshow("", false);
|
||||||
}
|
}
|
||||||
, null);
|
, null);
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ the terms of any one of the MPL, the GPL or the LGPL.
|
|||||||
<script type="application/x-javascript" src="completion.js"/>
|
<script type="application/x-javascript" src="completion.js"/>
|
||||||
<script type="application/x-javascript" src="bookmarks.js"/>
|
<script type="application/x-javascript" src="bookmarks.js"/>
|
||||||
<script type="application/x-javascript" src="hints.js"/>
|
<script type="application/x-javascript" src="hints.js"/>
|
||||||
|
<script type="application/x-javascript" src="file.js"/>
|
||||||
|
|
||||||
<window id="main-window">
|
<window id="main-window">
|
||||||
<toolbar id="vimperator-toolbar" hidden="false" align="center" fullscreentoolbar="true">
|
<toolbar id="vimperator-toolbar" hidden="false" align="center" fullscreentoolbar="true">
|
||||||
|
|||||||
Reference in New Issue
Block a user