Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #11 from GunioRobot/clean

Hi! I cleaned up your code for you!
  • Loading branch information...
commit c139fbb5823526af22c5700672a51e9bd3a9c4cb 2 parents 157e7d2 + 562cec6
@chrisdone authored
Showing with 53 additions and 33 deletions.
  1. +20 −0 .gitignore
  2. +9 −9 README
  3. +8 −8 demo.html
  4. +16 −16 jquery.console.js
View
20 .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
View
18 README
@@ -34,7 +34,7 @@ Options available:
top. Currently disabled.
charInsertTrigger function Predicate for whether to allow
- character insertion.
+ character insertion.
charInsertTrigger(char,line) is called.
cancelHandle function Handle a user-signaled interrupt.
@@ -59,14 +59,14 @@ are met:
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
+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.
View
16 demo.html
@@ -107,12 +107,12 @@
<style type="text/css" media="screen">
/* First console */
div.console1 { font-size: 14px }
- div.console1 div.jquery-console-inner
+ div.console1 div.jquery-console-inner
{ width:900px; height:200px; background:#333; padding:0.5em;
overflow:auto }
div.console1 div.jquery-console-prompt-box
{ color:#fff; font-family:monospace; }
- div.console1 div.jquery-console-focus span.jquery-console-cursor
+ div.console1 div.jquery-console-focus span.jquery-console-cursor
{ background:#fefefe; color:#333; font-weight:bold }
div.console1 div.jquery-console-message-error
{ color:#ef0505; font-family:sans-serif; font-weight:bold;
@@ -126,12 +126,12 @@
div.console1 span.jquery-console-prompt-label { font-weight:bold }
/* Second console */
div.console2 { font-size: 14px; margin-top:1em }
- div.console2 div.jquery-console-inner
+ div.console2 div.jquery-console-inner
{ width:900px; height:200px; background:#efefef; padding:0.5em;
overflow:auto }
div.console2 div.jquery-console-prompt-box
{ color:#444; font-family:monospace; }
- div.console2 div.jquery-console-focus span.jquery-console-cursor
+ div.console2 div.jquery-console-focus span.jquery-console-cursor
{ background:#333; color:#eee; font-weight:bold }
div.console2 div.jquery-console-message-error
{ color:#ef0505; font-family:sans-serif; font-weight:bold;
@@ -142,12 +142,12 @@
div.console2 span.jquery-console-prompt-label { font-weight:bold }
/* Third console */
div.console3 { font-size: 14px; margin-top:1em }
- div.console3 div.jquery-console-inner
+ div.console3 div.jquery-console-inner
{ width:900px; height:200px; background:#efefef; padding:0.5em;
overflow:auto }
div.console3 div.jquery-console-prompt-box
{ color:#444; font-family:monospace; }
- div.console3 div.jquery-console-focus span.jquery-console-cursor
+ div.console3 div.jquery-console-focus span.jquery-console-cursor
{ background:#333; color:#eee; font-weight:bold }
div.console3 div.jquery-console-message-error
{ color:#ef0505; font-family:sans-serif; font-weight:bold;
@@ -159,12 +159,12 @@
font-weight:bold }
/* Fourth console */
div.console4 { font-size: 14px; margin-top:1em }
- div.console4 div.jquery-console-inner
+ div.console4 div.jquery-console-inner
{ width:900px; height:200px; background:#efefef; padding:0.5em;
overflow:auto }
div.console4 div.jquery-console-prompt-box
{ color:#444; font-family:monospace; }
- div.console4 div.jquery-console-focus span.jquery-console-cursor
+ div.console4 div.jquery-console-focus span.jquery-console-cursor
{ background:#444; color:#eee; font-weight:bold }
div.console4 div.jquery-console-message-error
{ color:#ef0505; font-family:sans-serif; font-weight:bold;
View
32 jquery.console.js
@@ -19,14 +19,14 @@
// 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
+// 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.
// TESTED ON
@@ -187,7 +187,7 @@
n.remove();
});
},4000);
- else if (style=='prompt') {
+ else if (style=='prompt') {
var a = $('<br/><div class="action"><a href="javascript:">OK</a><div class="clear"></div></div>');
n.append(a);
focused = false;
@@ -236,7 +236,7 @@
inner.removeClass('jquery-console-focus');
inner.addClass('jquery-console-nofocus');
});
-
+
////////////////////////////////////////////////////////////////////////
// Bind to the paste event of the input box so we know when we
// get pasted data
@@ -250,7 +250,7 @@
typer.val("");
}, 0);
});
-
+
////////////////////////////////////////////////////////////////////////
// Handle key hit before translation
// For picking up control characters like up/left/down/right
@@ -280,7 +280,7 @@
}
}
});
-
+
////////////////////////////////////////////////////////////////////////
// Handle key press
typer.keypress(function(e){
@@ -364,7 +364,7 @@
updatePromptDisplay();
}
};
-
+
function forwardDelete() {
if (deleteCharAtPos())
updatePromptDisplay();
@@ -509,7 +509,7 @@
restoreText = promptText;
updatePromptDisplay();
};
-
+
////////////////////////////////////////////////////////////////////////
// Move to another column relative to this one
// Negative means go back, positive means go forward.
@@ -609,7 +609,7 @@
var before = line.substring(0, column);
var current = line.substring(column,column+1);
if (current){
- current =
+ current =
'<span class="jquery-console-cursor">' +
htmlEncode(current) +
'</span>';
@@ -620,7 +620,7 @@
prompt.html(html);
scrollToBottom();
};
-
+
// Simple HTML encoding
// Simply replace '<', '>' and '&'
// TODO: Use jQuery's .html() trick, or grab a proper, fast
Please sign in to comment.
Something went wrong with that request. Please try again.