r1332 - in trunk/firefox_extension: . content

[email protected]
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Tue Jun  7 14:31:19 2005
New Revision: 1332

Added:
   trunk/firefox_extension/
   trunk/firefox_extension/build.sh   (contents, props changed)
   trunk/firefox_extension/bxehelper.xpi   (contents, props changed)
   trunk/firefox_extension/config_build.sh   (contents, props changed)
   trunk/firefox_extension/content/
   trunk/firefox_extension/content/bxehelper.xul
   trunk/firefox_extension/content/caret.js   (contents, props changed)
   trunk/firefox_extension/content/contents.rdf
   trunk/firefox_extension/install.rdf
Log:
automatically sets caret browsing, far from perfect ;)


Added: trunk/firefox_extension/build.sh
==============================================================================
--- (empty file)
+++ trunk/firefox_extension/build.sh	Tue Jun  7 14:31:19 2005
@@ -0,0 +1,130 @@
+#!/bin/bash
+# build.sh -- builds JAR and XPI files for mozilla extensions
+#   by Nickolay Ponomarev <asqueella-gmail.com>
+#   (original version based on Nathan Yergler's build script)
+# Most recent version is at <http://kb.mozillazine.org/Bash_build_script>
+
+# This script assumes the following directory structure:
+# ./
+#   chrome.manifest (optional - for newer extensions)
+#   install.rdf
+#   (other files listed in $ROOT_FILES)
+#
+#   content/    |
+#   locale/     |} these can be named arbitrary and listed in $CHROME_PROVIDERS
+#   skin/       |
+#
+#   defaults/   |
+#   components/ |} these must be listed in $ROOT_DIRS in order to be packaged
+#   ...         |
+#
+# It uses a temporary directory ./build when building; don't use that!
+# Script's output is:
+# ./$APP_NAME.xpi
+# ./$APP_NAME.jar  (only if $KEEP_JAR=1)
+# ./files -- the list of packaged files
+#
+# Note: It modifies chrome.manifest when packaging so that it points to 
+#       chrome/$APP_NAME.jar!/*
+
+#
+# default configuration file is ./config_build.sh, unless another file is 
+# specified in command-line. Available config variables:
+APP_NAME=          # short-name, jar and xpi files name. Must be lowercase with no spaces
+CHROME_PROVIDERS=  # which chrome providers we have (space-separated list)
+CLEAN_UP=          # delete the jar / "files" when done?       (1/0)
+ROOT_FILES=        # put these files in root of xpi (space separated list of leaf filenames)
+ROOT_DIRS=         # ...and these directories       (space separated list)
+BEFORE_BUILD=      # run this before building       (bash command)
+AFTER_BUILD=       # ...and this after the build    (bash command)
+
+if [ -z $1 ]; then
+  . ./config_build.sh
+else
+  . $1
+fi
+
+if [ -z $APP_NAME ]; then
+  echo "You need to create build config file first!"
+  echo "Read comments at the beginning of this script for more info."
+  exit;
+fi
+
+ROOT_DIR=`pwd`
+TMP_DIR=build
+
+#uncomment to debug
+#set -x
+
+# remove any left-over files from previous build
+rm $APP_NAME.jar
+rm $APP_NAME.xpi
+rm files
+rm -rf $TMP_DIR
+
+$BEFORE_BUILD
+
+mkdir --parents --verbose $TMP_DIR/chrome
+
+# generate the JAR file, excluding CVS and temporary files
+JAR_FILE=$TMP_DIR/chrome/$APP_NAME.jar
+echo "Generating $JAR_FILE..."
+for CHROME_SUBDIR in $CHROME_PROVIDERS; do
+  find $CHROME_SUBDIR -path '*CVS*' -prune -o -type f -print | grep -v \~ >> files
+done
+
+zip -0 -r $JAR_FILE `cat files`
+# The following statement should be used instead if you don't wish to use the JAR file
+#cp --verbose --parents `cat files` $TMP_DIR/chrome
+
+# prepare components and defaults
+echo "Copying various files to $TMP_DIR folder..."
+for DIR in $ROOT_DIRS; do
+  mkdir $TMP_DIR/$DIR
+  FILES="`find $DIR -path '*CVS*' -prune -o -type f -print | grep -v \~`"
+  echo $FILES >> files
+  cp --verbose --parents $FILES $TMP_DIR
+done
+
+# Copy other files to the root of future XPI.
+for ROOT_FILE in $ROOT_FILES install.rdf chrome.manifest; do
+  cp --verbose $ROOT_FILE $TMP_DIR
+  if [ -f $ROOT_FILE ]; then
+    echo $ROOT_FILE >> files
+  fi
+done
+
+cd $TMP_DIR
+
+if [ -f "chrome.manifest" ]; then
+  echo "Preprocessing chrome.manifest..."
+  # You think this is scary?
+  #s/^(content\s+\S*\s+)(\S*\/)$/\1jar:chrome\/$APP_NAME\.jar!\/\2/
+  #s/^(skin|locale)(\s+\S*\s+\S*\s+)(.*\/)$/\1\2jar:chrome\/$APP_NAME\.jar!\/\3/
+  #
+  # Then try this! (Same, but with characters escaped for bash :)
+  sed -i -r s/^\(content\\s+\\S*\\s+\)\(\\S*\\/\)$/\\1jar:chrome\\/$APP_NAME\\.jar!\\/\\2/ chrome.manifest
+  sed -i -r s/^\(skin\|locale\)\(\\s+\\S*\\s+\\S*\\s+\)\(.*\\/\)$/\\1\\2jar:chrome\\/$APP_NAME\\.jar!\\/\\3/ chrome.manifest
+
+  # (it simply adds jar:chrome/whatever.jar!/ at appropriate positions of chrome.manifest)
+fi
+
+# generate the XPI file
+echo "Generating $APP_NAME.xpi..."
+zip -r ../$APP_NAME.xpi *
+
+cd $ROOT_DIR
+
+echo "Cleanup..."
+if [ $CLEAN_UP = 0 ]; then
+  # save the jar file
+  mv $TMP_DIR/chrome/$APP_NAME.jar .
+else
+  rm ./files
+fi
+
+# remove the working files
+rm -rf $TMP_DIR
+echo "Done!"
+
+$AFTER_BUILD

Added: trunk/firefox_extension/bxehelper.xpi
==============================================================================
Binary file. No diff available.

Added: trunk/firefox_extension/config_build.sh
==============================================================================
--- (empty file)
+++ trunk/firefox_extension/config_build.sh	Tue Jun  7 14:31:19 2005
@@ -0,0 +1,8 @@
+APP_NAME=bxehelper
+CHROME_PROVIDERS="content skin"
+CLEAN_UP=1
+ROOT_FILES="readme.txt"
+ROOT_DIRS=
+BEFORE_BUILD=
+AFTER_BUILD=
+

Added: trunk/firefox_extension/content/bxehelper.xul
==============================================================================
--- (empty file)
+++ trunk/firefox_extension/content/bxehelper.xul	Tue Jun  7 14:31:19 2005
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+
+<!-- mozileFirefox.xul
+
+/* ***** BEGIN LICENSE BLOCK *****
+ * Licensed under Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ * Full Terms at http://mozile.mozdev.org/license.html
+ *
+ * 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.
+ *
+ * The Original Code is Playsophy code.
+ *
+ * The Initial Developer of the Original Code is Playsophy
+ * Portions created by the Initial Developer are Copyright (C) 2002-2003
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *		James A. Overton <james-Z+vnxwcqLK6w5LPnMra/[email protected]>
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+Mozile Toolbar Overlay - Mozilla Firefox
+(Note that there is a different version of this overlay for Mozilla's main branch.)
+
+mozile version 0.60
+
+Created by James A. Overton
+Created on 2003-11-19
+
+
+ACKNOWLEDGEMENTS:
+I have adapted this file from Chris Pederick's Web Devloper 0.3 extension for Firebird, and I am very grateful to him.
+See http://chrispederick.myacen.com/work/firebird/webdeveloper/
+
+
+DESCRIPTION:
+This file overlays the normal Mozilla Firefox files (see contents.rdf for the relationship). That means
+that it is added to the DOM of the main browser window when Mozilla Firefox starts up. This file
+describes a general purpose toolbar for the Mozile editor, much like the one you'd expect in a
+wordprocessor or HTML editor. It is supposed to replace the "mozilehtmltb.js" in cases where the
+user has installed Mozile as chrome for their browser.
+
+This file loads a number of important javascript files, which do the actual work
+when a button is pressed or a menu item is selected.
+
+
+-->
+
+
+
+<!DOCTYPE overlay SYSTEM "chrome://mozile/locale/mozile.dtd" >
+<overlay id="bxehelper" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+			<!-- Main Mozile Scripts -->
+		<script src="chrome://bxehelper/content/caret.js" type="text/javascript"/>
+		
+		
+
+</overlay>
\ No newline at end of file

Added: trunk/firefox_extension/content/caret.js
==============================================================================
--- (empty file)
+++ trunk/firefox_extension/content/caret.js	Tue Jun  7 14:31:19 2005
@@ -0,0 +1,33 @@
+document.addEventListener("click", bxehelper_mouse, false);
+
+function bxehelper_mouse(e) {
+	var target = e.target.parentElement;
+	if(target && target.userModifiable ) {
+		if(e.target.tagName=="tabbrowser") {
+			return;
+		}
+		// if the target of the click is one of these, then don't change the status of the toolbar
+		var protect = new Array( 'toolbar', 'toolbarbutton', 'menuitem', 'menu', 'colorpicker');
+		for(var i=0; i<protect.length; i++) {
+			if(e.target.tagName==protect[i]) {
+				return;
+			}
+		}
+		
+		
+		bxehelper_setCaret();
+	} else {
+		bxehelper_removeCaret();
+	}
+
+}
+
+function bxehelper_removeCaret() {
+	prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch(null);
+	prefs.setBoolPref('accessibility.browsewithcaret', false);
+}
+
+function bxehelper_setCaret() {
+	prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefService).getBranch(null);
+	prefs.setBoolPref('accessibility.browsewithcaret', true);
+}

Added: trunk/firefox_extension/content/contents.rdf
==============================================================================
--- (empty file)
+++ trunk/firefox_extension/content/contents.rdf	Tue Jun  7 14:31:19 2005
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+
+<RDF:RDF xmlns:chrome="http://www.mozilla.org/rdf/chrome#"
+			xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+
+  <!-- list all the packages being supplied -->
+  <RDF:Seq about="urn:mozilla:package:root">
+    <RDF:li resource="urn:mozilla:package:bxehelper"/>
+  </RDF:Seq>
+
+	<!-- package description -->
+	<RDF:Description about="urn:mozilla:package:bxehelper"
+		             chrome:author="Christian Stocker"
+		             chrome:authorURL="http://bxe.oscom.org"
+		             chrome:description="BXE Helper"
+		             chrome:displayName="BXE Helper 0.1"
+		             chrome:extension="true"
+		             chrome:name="bxehelper"
+		           />
+
+	<!-- overlay information -->
+<RDF:Seq about="urn:mozilla:overlays">
+		<RDF:li resource="chrome://browser/content/browser.xul"/>	<!-- for Firefox -->
+       <RDF:li resource="chrome://navigator/content/navigator.xul"/> <!-- for Mozilla -->
+	</RDF:Seq>
+	<RDF:Seq about="chrome://browser/content/browser.xul">
+		<RDF:li>chrome://bxehelper/content/bxehelper.xul</RDF:li>
+	</RDF:Seq>
+    
+    <RDF:Seq about="chrome://navigator/content/navigator.xul">
+  	<RDF:li>chrome://mozile/content/content/bxehelper.xul</RDF:li>
+  </RDF:Seq>
+
+</RDF:RDF>

Added: trunk/firefox_extension/install.rdf
==============================================================================
--- (empty file)
+++ trunk/firefox_extension/install.rdf	Tue Jun  7 14:31:19 2005
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+
+	<Description about="urn:mozilla:install-manifest">
+
+		<em:id>{9AD764CC-9B1E-451F-AE9D-173F40ADD96F}</em:id>
+		<em:name>BXE Helper</em:name>
+		<em:version>0.1</em:version>
+		<em:description>Implements some BXE Helpers, like automatic caret browsing</em:description>
+		<em:creator>Christian Stocker</em:creator>
+		<em:homepageURL>http://bxe.oscom.org/</em:homepageURL>
+		<!--<em:iconURL>chrome://helloworld/skin/helloworld.png</em:iconURL>
+		<em:aboutURL>chrome://helloworld/content/about.xul</em:aboutURL>-->
+		<em:updateURL>http://bxe.oscom.org/update.rdf</em:updateURL>
+		<em:file>
+			<Description about="urn:mozilla:extension:file:bxehelper.jar">
+				<em:package>content/</em:package>
+              
+			</Description>
+		</em:file>
+
+		<em:targetApplication>
+			<Description>
+				<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
+				<em:minVersion>0.7</em:minVersion>
+				<em:maxVersion>1.5</em:maxVersion>
+			</Description>
+		</em:targetApplication>
+
+	</Description>
+
+</RDF>
\ No newline at end of file
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.