================================================================================ = SITE ================================================================================ index.php is main page for site. You will need to generate this file with the build/build_psbm.sh script discussed below. ================================================================================ = PROTOSCRIPT LIBRARY ================================================================================ protoscript is contained in scripts/proto.js --- YUI BEHAVIORS --- by default, the protoscript library contains a fairly complete behavior library based on a combination of jQuery and the YUI library. jQuery provides CSS-3 and xpath selector features. The YUI library provides events, behaviors (including their configuration attributes). The YUI behavior library is implemented by scripts/yui_proto.js The site by default is configured to run against the jQuery + YUI combination. This is accomplished by the following code (in index.php): You could register the minimal mootools set (someone can please build this out) this way: // registers the MooTools Selector and the MooTools behavior set ProtoScript.Core.registerBehaviorSet($ES, MooBehaviors); ================================================================================ = CODE REPOSITORY ================================================================================ Code repository is at Google Code http://protoscript.googlecode.com/svn/trunk/ # checkout example svn checkout https://protoscript.googlecode.com/svn/trunk/ protoscript --username billwscott # update example svn update # add example svn add demos.html # commit example svn commit -m "initial add" demos.html # delete example svn delete index.html # diff example svn diff scripts/moo_proto.js ================================================================================ = Protoscripter BOOKMARKLET ================================================================================ Protoscripter is a simple bookmarklet that provides a very simple interface for adding protoscript behaviors to any web page (that can support a dynamic bookmarklet -- exceptions will be some pages with frames). index.php contains the php variable $psbm_path that gets generated by the build/build_psbm.sh script. $psbm_path defines where the bookmarklet will pull the startpsbm.js file. When launched on the public site this should point to "http://protoscript.com/scripts/startpsbm.js". For local builds, point it to the your own server path (e.g., http://localhost/~bscott/protoscript/scripts/startpsbm.js) The bookmarlet is provided on the generated index.php page. The JS that kicks the bookmarklet off is scripts/startpsbm.js. This script is actually built from scripts/_startpsbm.js. The build script for this file is also build/build_psbm.js. In the build script there are several variables that may be set that control building the bookmarklet correctly. These include: ## build/build_psbm.js ######################################################################## ### stamp - version of the protoscripter bm ### YYYYMMDDHHMM stamp="200708260000" ######################################################################## ######################################################################## ### minify - whether to minify ### minify=1 : jlecomte minifier ### minify=2 : crockford jsmin ### minify=0 : no minification minify=2 ######################################################################## ######################################################################## ### psbmpath - where the startpsbm.js file lives (the protoscripter ### bootstrapper script -- called by the actual bookmarklet) psbmpath="http:\/\/localhost\/bscott\/protoscript\/scripts\/startpsbm.js" #psbmpath="http:\/\/protoscript.com\/scripts\/startpsbm.js" ######################################################################## ######################################################################## ### scriptpath - where bookmarklet lives scriptpath="http:\/\/localhost\/bscott\/protoscript\/scripts\/psbm_" #scriptpath="http:\/\/protoscript.com\/scripts\/psbm_" ######################################################################## ######################################################################## ### csspath - where bookmarklet css lives csspath="http:\/\/localhost\/bscott\/protoscript\/css\/psbm_" #csspath="http:\/\/protoscript.com\/css\/psbm_" ######################################################################## ######################################################################## ### buildpath - your local protoscript build dir buildpath=/Users/bscott/Sites/protoscript/build ######################################################################## ------------------------------------------------------------------------ - BUILDING BOOKMARKLET LOCALLY ------------------------------------------------------------------------ build/build_psbm.sh builds the bookmarklet and generates index.php from _index.php (for bookmarklet installation) # Building for local build & test of bookmarklet # Edit build/build_psbm.sh 1. Set time stamp stamp=200709010000 2. Set minification (usually 0 for local testing) minify=0 3. Set the psbmpath to point to your local scripts/startpsbm.js (will be built from scripts/_startpsbm.js). Change for your environment. psbmpath="http:\/\/localhost\/~bscott\/protoscript\/scripts\/startpsbm.js" 4. Set scriptpath & csspath to your local test machine (change for your env) scriptpath="http:\/\/localhost\/~bscott\/protoscript\/scripts\/psbm_" csspath="http:\/\/localhost\/~bscott\/protoscript\/css\/psbm_" 5. Set the buildpath for your local environment buildpath=/Users/bscott/Sites/protoscript/build 6. Start the script ./build/build_psbm.js ------------------------------------------------------------------------ - BUILDING BOOKMARKLET FOR PUBLIC SITE ------------------------------------------------------------------------ build/build_psbm.sh builds the bookmarklet and generates index.php from _index.php (for bookmarklet installation) # Building bookmarklet for public site # Edit build/build_psbm.sh 1. Set time stamp stamp=200709010000 2. Set minification (usually 1 for production) minify=1 3. Set the psbmpath to point to your local scripts/startpsbm.js (will be built from scripts/_startpsbm.js). Change for your environment. psbmpath="http:\/\/protoscript.com\/scripts\/startpsbm.js" 4. Set scriptpath & csspath to your local test machine (change for your env) scriptpath="http:\/\/protoscript.com\/scripts\/psbm_" csspath="http:\/\/protoscript.com\/css\/psbm_" 5. Set the buildpath for your local environment buildpath=/Users/bscott/Sites/protoscript/build 6. Start the script ./build/build_psbm.js