Skip to content

Commit

Permalink
Update code mirror and jquery
Browse files Browse the repository at this point in the history
Tune the web page scrolling a bit as well.

Closes #143
  • Loading branch information
bitwiseman committed Apr 17, 2013
1 parent 536b3fd commit d02d83d
Show file tree
Hide file tree
Showing 182 changed files with 5,469 additions and 24,981 deletions.
31 changes: 14 additions & 17 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@
<meta charset="utf-8">
<title>Online JavaScript beautifier</title>
<link rel="icon" href="web/favicon.png" type="image/png">
<link rel="stylesheet" href="web/third-party/codemirror/lib/codemirror.css">

<script src="web/third-party/codemirror/lib/codemirror.js"></script>
<script src="web/third-party/codemirror/mode/javascript/javascript.js"></script>
<link rel="stylesheet" href="web/third-party/codemirror/lib/codemirror.css">

<style>

Expand Down Expand Up @@ -67,10 +68,6 @@
}


#source {
width: 100%;
}

button.submit em {
font-size: 11px;
font-style: normal;
Expand Down Expand Up @@ -112,17 +109,11 @@

.CodeMirror {
border: 1px solid #ccc;
height: 450px;
font-size: 90%;
margin-bottom: 6px;
background: white;
}
.CodeMirror-scroll {
min-height: 400px;
max-height: 100%;
height: auto;
overflow-y: hidden;
overflow-x: auto;
width: 100%
}
p {
margin-left: 40px;
margin-right: 40px;
Expand Down Expand Up @@ -348,9 +339,9 @@


<div style="line-height: 0">
<button class="submit"><strong>Beautify JavaScript or HTML</strong> <em>(ctrl-enter)</em></button>
<textarea id="source" rows="30" cols="160"></textarea>
<button class="submit"><strong>Beautify JavaScript or HTML</strong> <em>(ctrl-enter)</em></button>
<button class="submit"><strong>Beautify JavaScript or HTML</strong> <em>(ctrl-enter)</em></button>
<textarea id="source" rows="30" cols="160"></textarea>
<button class="submit"><strong>Beautify JavaScript or HTML</strong> <em>(ctrl-enter)</em></button>
</div>

<div class="blurb">
Expand Down Expand Up @@ -426,9 +417,15 @@
read_settings_from_cookie();

var default_text = "// This is just a sample script. Paste your real code (javascript or HTML) here.\n\nif ('this_is'==/an_example/){of_beautifer();}else{var a=b?(c%d):e[f];}";
var textArea = $('#source')[0];

if (the.use_codemirror && typeof CodeMirror !== 'undefined') {
the.editor = CodeMirror.fromTextArea($('#source').get(0))
the.editor = CodeMirror.fromTextArea(textArea, {
theme: 'default',
lineNumbers: true
});
the.editor.focus();

the.editor.setValue(default_text);
$('.CodeMirror').click(function () {
if (the.editor.getValue() == default_text) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"scripts": {
"test": "./js/test/shell-smoke-test.sh && node ./js/test/node-beautify-tests.js",
"update-codemirror": "npm install codemirror && rm -rf ./web/third-party/codemirror && cp -r ./node_modules/codemirror ./web/third-party && git add -Av ./web/third-party/codemirror"
"update-codemirror": "npm install codemirror && rm -rf ./web/third-party/codemirror/* && cp ./node_modules/codemirror/LICENSE ./web/third-party/codemirror/ && cp ./node_modules/codemirror/README.md ./web/third-party/codemirror/ && cp -r ./node_modules/codemirror/lib ./web/third-party/codemirror/ && mkdir -p ./web/third-party/codemirror/mode && cp -r ./node_modules/codemirror/mode/javascript ./web/third-party/codemirror/mode/ && git add -Av ./web/third-party/codemirror"
},
"bugs": "https://github.com/einars/js-beautify/issues",
"homepage": "http://jsbeautifier.org/",
Expand Down
2 changes: 1 addition & 1 deletion web/third-party/codemirror/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 2012 by Marijn Haverbeke <marijnh@gmail.com>
Copyright (C) 2013 by Marijn Haverbeke <marijnh@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
13 changes: 8 additions & 5 deletions web/third-party/codemirror/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# CodeMirror 2
# CodeMirror [![Build Status](https://secure.travis-ci.org/marijnh/CodeMirror.png?branch=master)](http://travis-ci.org/marijnh/CodeMirror)

CodeMirror 2 is a rewrite of [CodeMirror
1](http://github.com/marijnh/CodeMirror). The docs live
[here](http://codemirror.net/doc/manual.html), and the project page is
[http://codemirror.net/](http://codemirror.net/).
CodeMirror is a JavaScript component that provides a code editor in
the browser. When a mode is available for the language you are coding
in, it will color your code, and optionally help with indentation.

The project page is http://codemirror.net
The manual is at http://codemirror.net/doc/manual.html
The contributing guidelines are in [CONTRIBUTING.md](https://github.com/marijnh/CodeMirror/blob/master/CONTRIBUTING.md)
72 changes: 0 additions & 72 deletions web/third-party/codemirror/demo/activeline.html

This file was deleted.

50 changes: 0 additions & 50 deletions web/third-party/codemirror/demo/changemode.html

This file was deleted.

65 changes: 0 additions & 65 deletions web/third-party/codemirror/demo/closetag.html

This file was deleted.

70 changes: 0 additions & 70 deletions web/third-party/codemirror/demo/complete.html

This file was deleted.

Loading

0 comments on commit d02d83d

Please sign in to comment.