Permalink
Browse files

Initial commit.

  • Loading branch information...
0 parents commit ab0b72c8f1fac50b4eeb1fda61529f7dba10d443 @modeswitch modeswitch committed Nov 10, 2012
Showing with 35,786 additions and 0 deletions.
  1. +363 −0 LICENSE.html
  2. +6 −0 LICENSE_files/css.css
  3. +6 −0 LICENSE_files/css_002.css
  4. +6 −0 LICENSE_files/css_003.css
  5. +29 −0 README.md
  6. +71 −0 build-require.js
  7. +126 −0 codemirror2/lib/codemirror.css
  8. +3,088 −0 codemirror2/lib/codemirror.js
  9. +124 −0 codemirror2/mode/css/css.js
  10. +85 −0 codemirror2/mode/htmlmixed/htmlmixed.js
  11. +361 −0 codemirror2/mode/javascript/javascript.js
  12. +325 −0 codemirror2/mode/xml/xml.js
  13. +514 −0 css/editor.css
  14. +227 −0 css/errorhelp.css
  15. +18 −0 css/friendlycode.css
  16. +126 −0 css/jsbin-codemirror-theme.css
  17. +321 −0 css/modals.css
  18. +121 −0 css/modals_full_screen.css
  19. BIN css/opensymbolcropped/opensymbolcropped.eot
  20. BIN css/opensymbolcropped/opensymbolcropped.ttf
  21. BIN css/opensymbolcropped/opensymbolcropped.woff
  22. +18 −0 css/opensymbolcropped/stylesheet.css
  23. +25 −0 css/tipsy.css
  24. +23 −0 css/ubuntumono/stylesheet.css
  25. BIN css/ubuntumono/ubuntumono-b.eot
  26. BIN css/ubuntumono/ubuntumono-b.ttf
  27. BIN css/ubuntumono/ubuntumono-b.woff
  28. BIN css/ubuntumono/ubuntumono-r.eot
  29. BIN css/ubuntumono/ubuntumono-r.ttf
  30. BIN css/ubuntumono/ubuntumono-r.woff
  31. +407 −0 examples/arkanoid.html
  32. +25 −0 examples/bare-optimized.html
  33. +24 −0 examples/bare.html
  34. +109 −0 examples/editor-only.html
  35. +121 −0 examples/physics-bounce-API.txt
  36. +72 −0 examples/physics-data-attributes.txt
  37. +277 −0 examples/pong.html
  38. +7 −0 examples/publish/.htaccess
  39. +57 −0 examples/publish/get.php
  40. +74 −0 examples/publish/post.php
  41. +6 −0 examples/publish/pseudonite.php
  42. BIN img/button-arrow.png
  43. BIN img/checkbox-gradient.png
  44. BIN img/editor-icon.png
  45. BIN img/error.png
  46. BIN img/explanationpt.png
  47. BIN img/help.png
  48. BIN img/hint-down-arrow.png
  49. BIN img/hint-up-arrow.png
  50. BIN img/indicator-arrow.png
  51. BIN img/landing/arkanoid_cover.png
  52. BIN img/landing/button.png
  53. BIN img/landing/pong_cover.png
  54. BIN img/landing/stripes win-01.png
  55. BIN img/landing/top_logo.png
  56. BIN img/make_logo.png
  57. BIN img/modal-close-button.png
  58. BIN img/no.png
  59. BIN img/preview-icon.png
  60. BIN img/publish-button-left.png
  61. BIN img/publish-button-right.png
  62. BIN img/questionmark.png
  63. BIN img/redo-blue.png
  64. BIN img/redo-grey.png
  65. BIN img/temp-logo.png
  66. BIN img/text-size-blue.png
  67. BIN img/text-size-large.png
  68. BIN img/text-size-normal.png
  69. BIN img/text-size-small.png
  70. BIN img/text-size.png
  71. BIN img/throbber.gif
  72. BIN img/undo-blue.png
  73. BIN img/undo-grey.png
  74. BIN img/yes.png
  75. +86 −0 index.html
  76. +10,866 −0 js/Box2dWeb-2.1.a.3.js
  77. +29 −0 js/backbone-events.js
  78. +38 −0 js/backbone.min.js
  79. +56 −0 js/fc/current-page-manager.js
  80. +371 −0 js/fc/hacktionary-data.js
  81. +132 −0 js/fc/help.js
  82. +57 −0 js/fc/parachute.js
  83. +29 −0 js/fc/prefs.js
  84. +73 −0 js/fc/publisher.js
  85. +118 −0 js/fc/ui/context-sensitive-help.js
  86. +462 −0 js/fc/ui/diff/DOM-diff.js
  87. +139 −0 js/fc/ui/diff/Frame.js
  88. +253 −0 js/fc/ui/diff/diffApply.js
  89. +64 −0 js/fc/ui/editor-panes.js
  90. +98 −0 js/fc/ui/editor-toolbar.js
  91. +31 −0 js/fc/ui/editor.js
  92. +83 −0 js/fc/ui/error-help.js
  93. +76 −0 js/fc/ui/gutter-pointer.js
  94. +30 −0 js/fc/ui/history.js
  95. +16 −0 js/fc/ui/indexable-codemirror.js
  96. +61 −0 js/fc/ui/live-preview.js
  97. +48 −0 js/fc/ui/mark-tracker.js
  98. +47 −0 js/fc/ui/modals.js
  99. +50 −0 js/fc/ui/parsing-codemirror.js
  100. +92 −0 js/fc/ui/preview-to-editor-mapping.js
  101. +137 −0 js/fc/ui/publish.js
  102. +85 −0 js/fc/ui/relocator.js
  103. +75 −0 js/fc/ui/social-media.js
  104. +56 −0 js/fc/ui/text.js
  105. +112 −0 js/friendlycode.js
  106. +4 −0 js/jquery.min.js
  107. +10 −0 js/jquery.no-conflict.js
  108. +241 −0 js/jquery.tipsy.js
  109. +266 −0 js/lscache.js
  110. +845 −0 js/physics.js
  111. +93 −0 js/require-config.js
  112. +31 −0 js/require-plugins/template.js
  113. +11 −0 js/require-plugins/text.js
  114. +35 −0 js/require.min.js
  115. +12 −0 js/slowparse-errors.js
  116. +32 −0 js/underscore.min.js
  117. +13 −0 package.json
  118. +1 −0 slowparse/.gitignore
  119. +363 −0 slowparse/LICENSE.html
  120. +6 −0 slowparse/LICENSE_files/css.css
  121. +6 −0 slowparse/LICENSE_files/css_002.css
  122. +6 −0 slowparse/LICENSE_files/css_003.css
  123. +33 −0 slowparse/README.md
  124. +77 −0 slowparse/demo/codemirror2/lib/codemirror.css
  125. +2,785 −0 slowparse/demo/codemirror2/lib/codemirror.js
  126. +124 −0 slowparse/demo/codemirror2/mode/css/css.js
  127. +83 −0 slowparse/demo/codemirror2/mode/htmlmixed/htmlmixed.js
  128. +358 −0 slowparse/demo/codemirror2/mode/javascript/javascript.js
  129. +233 −0 slowparse/demo/codemirror2/mode/xml/xml.js
  130. +4 −0 slowparse/demo/editor/index.html
  131. +110 −0 slowparse/demo/hierarchic-source-code.css
  132. +181 −0 slowparse/demo/index.html
  133. +25 −0 slowparse/demo/jsbin-codemirror-theme.css
  134. +74 −0 slowparse/demo/render-dom.js
  135. +84 −0 slowparse/demo/tag-colors.js
  136. +252 −0 slowparse/demo/utils.js
  137. +1,443 −0 slowparse/slowparse.js
  138. +132 −0 slowparse/spec/errors.base.html
  139. +24 −0 slowparse/spec/errors.forbidjs.html
  140. +181 −0 slowparse/spec/errors.jquery.js
  141. +618 −0 slowparse/spec/index.html
  142. +4 −0 slowparse/spec/jquery.min.js
  143. +158 −0 slowparse/spec/spec.js
  144. +33 −0 slowparse/test/index.html
  145. +235 −0 slowparse/test/qunit.css
  146. +1,669 −0 slowparse/test/qunit.js
  147. +56 −0 slowparse/test/test-errors.jquery.js
  148. +428 −0 slowparse/test/test-slowparse.js
  149. +12 −0 slowparse/test/test-spec.js
  150. +53 −0 slowparse/test/test-tree-inspectors.js
  151. +75 −0 slowparse/test/testing-utils.js
  152. +92 −0 slowparse/tree-inspectors.js
  153. +29 −0 templates/confirm-dialog.html
  154. +9 −0 templates/default-content.html
  155. +8 −0 templates/error-dialog.html
  156. +6 −0 templates/error-msg.html
  157. +10 −0 templates/help-msg.html
  158. +35 −0 templates/nav-options.html
  159. +49 −0 templates/publish-dialog.html
  160. +17 −0 test/all-tests.js
  161. +8 −0 test/codemirror-577/original.html
  162. +6 −0 test/codemirror-577/replacer.html
  163. +29 −0 test/codemirror-577/test-codemirror-577.js
  164. +50 −0 test/define-tests.js
  165. +30 −0 test/index-optimized.html
  166. +28 −0 test/index.html
  167. +37 −0 test/lptest.js
  168. +40 −0 test/preview-to-editor-mapping/path-to.html
  169. +104 −0 test/preview-to-editor-mapping/test-preview-to-editor-mapping.js
  170. +12 −0 test/publisher/post-publish.html
  171. +14 −0 test/publisher/pre-publish.html
  172. +18 −0 test/publisher/test-publisher.js
  173. +235 −0 test/qunit.css
  174. +1,669 −0 test/qunit.js
  175. +20 −0 test/test-app-optimized.html
  176. +20 −0 test/test-app.html
  177. +77 −0 test/test-app.js
  178. +85 −0 test/test-current-page-manager.js
  179. +40 −0 test/test-editor-toolbar.js
  180. +26 −0 test/test-gutter-pointer.js
  181. +87 −0 test/test-help.js
  182. +34 −0 test/test-indexable-codemirror.js
  183. +73 −0 test/test-live-preview.js
  184. +39 −0 test/test-mark-tracker.js
  185. +101 −0 test/test-parsing-codemirror.js
  186. +52 −0 test/test-prefs.js
  187. +13 −0 test/test-slowparse-errors.js
  188. +33 −0 test/test-templates.js

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,6 @@
+@font-face {
+ font-family: 'Droid Sans Mono';
+ font-style: normal;
+ font-weight: normal;
+ src: local('Droid Sans Mono'), local('DroidSansMono'), url('http://themes.googleusercontent.com/static/fonts/droidsansmono/v4/ns-m2xQYezAtqh7ai59hJaH0X__W3S3MJL29bc5CWfs.woff') format('woff');
+}
@@ -0,0 +1,6 @@
+@font-face {
+ font-family: 'Crimson Text';
+ font-style: normal;
+ font-weight: normal;
+ src: local('Crimson Text'), local('CrimsonText-Roman'), url('http://themes.googleusercontent.com/static/fonts/crimsontext/v3/3IFMwfRa07i-auYR-B-zNaRDOzjiPcYnFooOUGCOsRk.woff') format('woff');
+}
@@ -0,0 +1,6 @@
+@font-face {
+ font-family: 'Lora';
+ font-style: normal;
+ font-weight: normal;
+ src: local('Lora'), url('http://themes.googleusercontent.com/static/fonts/lora/v5/nAKwuw6_dIh5kwvpj3ShNfesZW2xOQ-xsNqO47m55DA.woff') format('woff');
+}
@@ -0,0 +1,29 @@
+This is a friendly HTML editor that uses [slowparse][] and [hacktionary][]
+to provide ultra-friendly real-time help to novice webmakers.
+
+## Updating CodeMirror
+
+In the `codemirror2` directory is a mini-distribution of [CodeMirror][]
+which contains only the files necessary for HTML editing. It can be updated
+with the following Python script, if it is run from the root directory
+of the repository and the value of `NEW_CODEMIRROR_PATH` is changed:
+
+```python
+import os
+
+NEW_CODEMIRROR_PATH = "/path/to/new/codemirror/version"
+OUR_CODEMIRROR_PATH = os.path.abspath("codemirror2")
+
+for dirpath, dirnames, filenames in os.walk(OUR_CODEMIRROR_PATH):
+ for filename in filenames:
+ ourpath = os.path.join(dirpath, filename)
+ relpath = os.path.relpath(ourpath, OUR_CODEMIRROR_PATH)
+ newpath = os.path.join(NEW_CODEMIRROR_PATH, relpath)
+ if os.path.exists(newpath):
+ print "copying %s" % newpath
+ open(ourpath, "wb").write(open(newpath, "rb").read())
+```
+
+ [slowparse]: https://github.com/toolness/slowparse
+ [hacktionary]: https://github.com/toolness/hacktionary
+ [CodeMirror]: http://codemirror.net/
@@ -0,0 +1,71 @@
+/**
+ * to run this script,
+ * 1. install npm, `curl http://npmjs.org/install.sh | sh`
+ * https://github.com/isaacs/npm
+ * 2. command `npm install` at this directory.
+ * 3. command `node build-require.js` or `npm start`
+ */
+var requirejs = require('requirejs'),
+ resolve = require('path').resolve,
+ requireConfig = require('./js/require-config'),
+ baseUrl = resolve(__dirname, 'js'),
+ name = 'friendlycode',
+ out = resolve(baseUrl, 'friendlycode-built.js');
+
+function optimize(done) {
+ requirejs.optimize(generateConfig(), done);
+}
+
+function generateConfig() {
+ var config = {
+ name: name,
+ out: out,
+ // use none optimize for debugging
+ optimize: "none",
+ // optimize: 'uglify',
+ uglify: {
+ // beautify for debugging
+ // beautify: true,
+ mangle: true
+ },
+ // TODO above config setting is temporary, it shuould use mainConfigFile
+ // https://github.com/toolness/friendlycode/pull/112#issuecomment-6625412
+ // mainConfigFile: "./js/main.js",
+ };
+ Object.keys(requireConfig).forEach(function(name) {
+ config[name] = requireConfig[name];
+ });
+ return config;
+}
+
+function selfTest() {
+ var assert = require('assert'),
+ config = generateConfig();
+
+ assert('paths' in config);
+ assert('jquery' in config.shim);
+}
+
+if (!module.parent) {
+ if (process.argv[2] == 'test') {
+ selfTest();
+ console.log("Tests pass!");
+ process.exit(0);
+ } else {
+ console.log("Generating", out);
+
+ optimize(function (buildResponse) {
+ // buildResponse is just a text output of the modules
+ // included.
+ console.log("Done. About " + buildResponse.split('\n').length +
+ " modules are inside the generated JS file.");
+ requirejs.optimize({
+ cssIn: "css/friendlycode.css",
+ out: "css/friendlycode-built.css"
+ }, function() {
+ console.log("Optimized CSS.");
+ process.exit();
+ });
+ });
+ }
+}
@@ -0,0 +1,126 @@
+.CodeMirror {
+ line-height: 1em;
+ font-family: monospace;
+}
+
+.CodeMirror-scroll {
+ overflow: auto;
+ height: 300px;
+ /* This is needed to prevent an IE[67] bug where the scrolled content
+ is visible outside of the scrolling box. */
+ position: relative;
+ outline: none;
+}
+
+.CodeMirror-gutter {
+ position: absolute; left: 0; top: 0;
+ z-index: 10;
+ background-color: #f7f7f7;
+ border-right: 1px solid #eee;
+ min-width: 2em;
+ height: 100%;
+}
+.CodeMirror-gutter-text {
+ color: #aaa;
+ text-align: right;
+ padding: .4em .2em .4em .4em;
+ white-space: pre !important;
+}
+.CodeMirror-lines {
+ padding: .4em;
+ white-space: pre;
+}
+
+.CodeMirror pre {
+ -moz-border-radius: 0;
+ -webkit-border-radius: 0;
+ -o-border-radius: 0;
+ border-radius: 0;
+ border-width: 0; margin: 0; padding: 0; background: transparent;
+ font-family: inherit;
+ font-size: inherit;
+ padding: 0; margin: 0;
+ white-space: pre;
+ word-wrap: normal;
+ line-height: inherit;
+ color: inherit;
+}
+
+.CodeMirror-wrap pre {
+ word-wrap: break-word;
+ white-space: pre-wrap;
+ word-break: normal;
+}
+.CodeMirror-wrap .CodeMirror-scroll {
+ overflow-x: hidden;
+}
+
+.CodeMirror textarea {
+ outline: none !important;
+}
+
+.CodeMirror pre.CodeMirror-cursor {
+ z-index: 10;
+ position: absolute;
+ visibility: hidden;
+ border-left: 1px solid black;
+ border-right: none;
+ width: 0;
+}
+.cm-keymap-fat-cursor pre.CodeMirror-cursor {
+ width: auto;
+ border: 0;
+ background: transparent;
+ background: rgba(0, 200, 0, .4);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
+}
+/* Kludge to turn off filter in ie9+, which also accepts rgba */
+.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) {
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
+}
+.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}
+.CodeMirror-focused pre.CodeMirror-cursor {
+ visibility: visible;
+}
+
+div.CodeMirror-selected { background: #d9d9d9; }
+.CodeMirror-focused div.CodeMirror-selected { background: #d7d4f0; }
+
+.CodeMirror-searching {
+ background: #ffa;
+ background: rgba(255, 255, 0, .4);
+}
+
+/* Default theme */
+
+.cm-s-default span.cm-keyword {color: #708;}
+.cm-s-default span.cm-atom {color: #219;}
+.cm-s-default span.cm-number {color: #164;}
+.cm-s-default span.cm-def {color: #00f;}
+.cm-s-default span.cm-variable {color: black;}
+.cm-s-default span.cm-variable-2 {color: #05a;}
+.cm-s-default span.cm-variable-3 {color: #085;}
+.cm-s-default span.cm-property {color: black;}
+.cm-s-default span.cm-operator {color: black;}
+.cm-s-default span.cm-comment {color: #a50;}
+.cm-s-default span.cm-string {color: #a11;}
+.cm-s-default span.cm-string-2 {color: #f50;}
+.cm-s-default span.cm-meta {color: #555;}
+.cm-s-default span.cm-error {color: #f00;}
+.cm-s-default span.cm-qualifier {color: #555;}
+.cm-s-default span.cm-builtin {color: #30a;}
+.cm-s-default span.cm-bracket {color: #cc7;}
+.cm-s-default span.cm-tag {color: #170;}
+.cm-s-default span.cm-attribute {color: #00c;}
+.cm-s-default span.cm-header {color: blue;}
+.cm-s-default span.cm-quote {color: #090;}
+.cm-s-default span.cm-hr {color: #999;}
+.cm-s-default span.cm-link {color: #00c;}
+
+span.cm-header, span.cm-strong {font-weight: bold;}
+span.cm-em {font-style: italic;}
+span.cm-emstrong {font-style: italic; font-weight: bold;}
+span.cm-link {text-decoration: underline;}
+
+div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
+div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
Oops, something went wrong.

0 comments on commit ab0b72c

Please sign in to comment.