From b2ebc38fc96d4a51c86398db9a1b3c25b44a454d Mon Sep 17 00:00:00 2001
From: Anthony Grimes
Date: Sat, 5 May 2012 16:10:52 -0500
Subject: [PATCH] Update to 1.4, get rid of leiningen tasks for fetching stuff.
Updated all the dependencies and got rid of the Leiningen task for fetching
javascript files. Instead, we're going to use a git submodule to fetch
jquery-console and use a CDN for jquery itself.
---
.gitignore | 1 -
.gitmodules | 3 +
project.clj | 7 +-
.../javascript/jquery-console/.gitignore | 20 +
.../public/javascript/jquery-console/README | 72 ++
.../javascript/jquery-console/demo.html | 194 ++++++
.../jquery-console/jquery-1.4.2.min.js | 154 +++++
.../jquery-console/jquery.console.js | 649 ++++++++++++++++++
src/leiningen/fetch_js.clj | 18 -
src/tryclojure/models/eval.clj | 10 +-
src/tryclojure/server.clj | 4 +-
src/tryclojure/views/eval.clj | 6 +-
src/tryclojure/views/home.clj | 13 +-
src/tryclojure/views/tutorial.clj | 2 +-
14 files changed, 1112 insertions(+), 41 deletions(-)
create mode 100644 .gitmodules
create mode 100644 resources/public/javascript/jquery-console/.gitignore
create mode 100644 resources/public/javascript/jquery-console/README
create mode 100644 resources/public/javascript/jquery-console/demo.html
create mode 100644 resources/public/javascript/jquery-console/jquery-1.4.2.min.js
create mode 100644 resources/public/javascript/jquery-console/jquery.console.js
delete mode 100644 src/leiningen/fetch_js.clj
diff --git a/.gitignore b/.gitignore
index 4f14c94..5fcc507 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,4 +3,3 @@ pom.xml
lib
classes
*~
-resources/public/javascript/jquery*
\ No newline at end of file
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..9cf7391
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "resources/public/javascript/jquery-console"]
+ path = resources/public/javascript/jquery-console
+ url = https://github.com/chrisdone/jquery-console.git
diff --git a/project.clj b/project.clj
index c7974b4..cce6b10 100644
--- a/project.clj
+++ b/project.clj
@@ -1,13 +1,10 @@
(defproject tryclojure "0.1.0-SNAPSHOT"
:description "A simple web-based Clojure REPL for trying out Clojure without having to install it."
- :dependencies [[org.clojure/clojure "1.3.0"]
- [noir "1.2.1"]
+ :dependencies [[org.clojure/clojure "1.4.0"]
+ [noir "1.3.0-beta3"]
[commons-lang/commons-lang "2.5"]
[clojail "0.5.1"]]
- ;; For lein and Heroku compatibility. If you're using cake, add
- ;; this line to .cake/config: jvm.opts = -Djava.security.policy=example.policy
:jvm-opts ["-Djava.security.policy=example.policy""-Xmx80M"]
- :hooks [leiningen.fetch-js]
:main tryclojure.server)
diff --git a/resources/public/javascript/jquery-console/.gitignore b/resources/public/javascript/jquery-console/.gitignore
new file mode 100644
index 0000000..ac8f968
--- /dev/null
+++ b/resources/public/javascript/jquery-console/.gitignore
@@ -0,0 +1,20 @@
+# Compiled source #
+###################
+*.com
+*.class
+*.dll
+*.exe
+*.o
+*.so
+*.pyc
+
+# Logs and databases #
+######################
+*.log
+
+# OS generated files #
+######################
+.DS_Store*
+ehthumbs.db
+Icon?
+Thumbs.db
diff --git a/resources/public/javascript/jquery-console/README b/resources/public/javascript/jquery-console/README
new file mode 100644
index 0000000..245420f
--- /dev/null
+++ b/resources/public/javascript/jquery-console/README
@@ -0,0 +1,72 @@
+INTRODUCTION
+
+See demo.html. Or here: http://chrisdone.com/jquery-console/demo.html
+
+Options available:
+
+ autofocus bool Autofocus the terminal, rather than
+ having to click on it.
+
+ promptHistory bool Provide history support (kind of crappy,
+ needs doing properly.)
+
+ historyPreserveColumn bool Preserve the column you were one when
+ switching between history.
+
+ welcomeMessage string Just a first message to display on the
+ terminal.
+
+ promptLabel string Prompt string like 'JavaScript> '.
+
+ commandValidate function When user hits return, validate
+ whether to trigger commandHandle and
+ re-prompt.
+
+ commandHandle function Handle the command line, return a
+ string, boolean, or list
+ of {msg:"foo",className:"my-css-class"}.
+ commandHandle(line,report) is
+ called. Report function is for you
+ to report a result of the command
+ asynchronously.
+
+ animateScroll bool Whether to animate the scroll to
+ top. Currently disabled.
+
+ charInsertTrigger function Predicate for whether to allow
+ character insertion.
+ charInsertTrigger(char,line) is called.
+
+ cancelHandle function Handle a user-signaled interrupt.
+
+LICENSE
+
+Copyright 2010 Chris Done, Simon David Pratt. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+ 1. Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the following
+ disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+
diff --git a/resources/public/javascript/jquery-console/demo.html b/resources/public/javascript/jquery-console/demo.html
new file mode 100644
index 0000000..370ca73
--- /dev/null
+++ b/resources/public/javascript/jquery-console/demo.html
@@ -0,0 +1,194 @@
+
+
+
+ JQuery Console Demo
+
+
+
+
+
+
+
+
+
+
Simple console demo
+
Tested on:
+
+
Internet Explorer 6
+
Opera 10.01
+
Chromium 4.0.237.0 (Ubuntu build 31094)
+
Firefox 3.5.8
+
+
+
diff --git a/resources/public/javascript/jquery-console/jquery-1.4.2.min.js b/resources/public/javascript/jquery-console/jquery-1.4.2.min.js
new file mode 100644
index 0000000..7c24308
--- /dev/null
+++ b/resources/public/javascript/jquery-console/jquery-1.4.2.min.js
@@ -0,0 +1,154 @@
+/*!
+ * jQuery JavaScript Library v1.4.2
+ * http://jquery.com/
+ *
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Sat Feb 13 22:33:48 2010 -0500
+ */
+(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
+Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
+(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
+a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
+"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
+function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b