aboutsummaryrefslogtreecommitdiffstats
path: root/webclient/js
diff options
context:
space:
mode:
authorZaran <zaran.krleza@gmail.com>2012-01-30 15:05:38 -0800
committerZaran <zaran.krleza@gmail.com>2012-01-30 15:38:31 -0800
commit49581200ca11dbca47c57675f0a036edaa8c185c (patch)
treeb8e07f81552029863315abdfb01721c0ee596741 /webclient/js
parent3131e0333db40b7e9b029abe42dd7a539f299723 (diff)
downloadalias-49581200ca11dbca47c57675f0a036edaa8c185c.tar.gz
Create javascriptmvc application. Remove files which are now tracked in the submodules.
Diffstat (limited to 'webclient/js')
-rwxr-xr-xwebclient/js57
1 files changed, 57 insertions, 0 deletions
diff --git a/webclient/js b/webclient/js
new file mode 100755
index 0000000..0d5b9d9
--- /dev/null
+++ b/webclient/js
@@ -0,0 +1,57 @@
+#!/bin/sh
+# This script checks for arguments, if they don't exist it opens the Rhino dialog
+# if arguments do exist, it loads the script in the first argument and passes the other arguments to the script
+# ie: ./js steal/script/controller Todo
+
+if [ $# -eq 0 ]
+then
+ java -cp steal/rhino/js.jar:funcunit/java/selenium-java-client-driver.jar org.mozilla.javascript.tools.shell.Main
+ exit 127
+fi
+CP=funcunit/java/selenium-java-client-driver.jar:steal/rhino/js.jar
+
+ERRORLEV=0
+if [ $1 = "-e" ]
+then
+ ERRORLEV=1
+ shift
+fi
+
+if [ $1 = "-h" -o $1 = "-?" -o $1 = "--help" ]
+then
+echo Load a command line Rhino JavaScript environment or run JavaScript script files in Rhino.
+echo Available commands:
+echo -e "./js\t\t\t\tOpens a command line JavaScript environment"
+echo -e "./js -d\t\t\t\tOpens the Rhino debugger"
+echo -e "./js [FILE]\t\t\tRuns FILE in the Rhino environment"
+echo -e ""
+echo -e "JavaScriptMVC script usage:"
+echo -e "./js steal/generate/app [NAME]\t\tCreates a new JavaScriptMVC application"
+echo -e "./js steal/generate/page [APP] [PAGE]\tGenerates a page for the application"
+echo -e "./js steal/generate/controller [NAME]\tGenerates a Controller file"
+echo -e "./js steal/generate/model [TYPE] [NAME]\tGenerates a Model file"
+echo -e "./js apps/[NAME]/compress.js\t\tCompress your application and generate documentation"
+ exit 127
+fi
+
+if [ $1 = "-d" ]
+then
+ java -classpath steal/rhino/js.jar:steal/rhino/selenium-java-client-driver.jar org.mozilla.javascript.tools.debugger.Main
+ exit 127
+fi
+
+ARGS=[
+for arg
+do
+ if [ $arg != $1 ]
+ then
+ ARGS=$ARGS"'$arg'",
+ fi
+done
+ARGS=$ARGS]
+java -Xmx512m -Xss1024k -cp $CP org.mozilla.javascript.tools.shell.Main -e _args=$ARGS -opt -1 -e 'load('"'"$1"'"')'
+
+if [ $ERRORLEV = "1" -a $? = "1" ]
+then
+ exit $?
+fi