summaryrefslogtreecommitdiffstats
path: root/media/CodeMirror-0.62/js/mirrorframe.js
diff options
context:
space:
mode:
authorWookey <wookey@wookware.org>2014-09-11 07:40:58 +0100
committerWookey <wookey@wookware.org>2014-09-11 07:40:58 +0100
commitaf07161f05d5ae175ed8b70345df417ce4961344 (patch)
tree6fd38a16c49a3303b09c6d2e7a9e5ef994ecb08e /media/CodeMirror-0.62/js/mirrorframe.js
parent5ff759db93e0aee948fa86716b7d1ca282df8ad7 (diff)
downloadtroggle-af07161f05d5ae175ed8b70345df417ce4961344.tar.gz
troggle-af07161f05d5ae175ed8b70345df417ce4961344.tar.bz2
troggle-af07161f05d5ae175ed8b70345df417ce4961344.zip
remove internal copies of jquery, jquiery-forms, jquery-ui+themes,
django-feincms and codemirror
Diffstat (limited to 'media/CodeMirror-0.62/js/mirrorframe.js')
-rw-r--r--media/CodeMirror-0.62/js/mirrorframe.js81
1 files changed, 0 insertions, 81 deletions
diff --git a/media/CodeMirror-0.62/js/mirrorframe.js b/media/CodeMirror-0.62/js/mirrorframe.js
deleted file mode 100644
index 7f6ad1a..0000000
--- a/media/CodeMirror-0.62/js/mirrorframe.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Demonstration of embedding CodeMirror in a bigger application. The
- * interface defined here is a mess of prompts and confirms, and
- * should probably not be used in a real project.
- */
-
-function MirrorFrame(place, options) {
- this.home = document.createElement("DIV");
- if (place.appendChild)
- place.appendChild(this.home);
- else
- place(this.home);
-
- var self = this;
- function makeButton(name, action) {
- var button = document.createElement("INPUT");
- button.type = "button";
- button.value = name;
- self.home.appendChild(button);
- button.onclick = function(){self[action].call(self);};
- }
-
- makeButton("Search", "search");
- makeButton("Replace", "replace");
- makeButton("Current line", "line");
- makeButton("Jump to line", "jump");
- makeButton("Insert constructor", "macro");
- makeButton("Indent all", "reindent");
-
- this.mirror = new CodeMirror(this.home, options);
-}
-
-MirrorFrame.prototype = {
- search: function() {
- var text = prompt("Enter search term:", "");
- if (!text) return;
-
- var first = true;
- do {
- var cursor = this.mirror.getSearchCursor(text, first);
- first = false;
- while (cursor.findNext()) {
- cursor.select();
- if (!confirm("Search again?"))
- return;
- }
- } while (confirm("End of document reached. Start over?"));
- },
-
- replace: function() {
- // This is a replace-all, but it is possible to implement a
- // prompting replace.
- var from = prompt("Enter search string:", ""), to;
- if (from) to = prompt("What should it be replaced with?", "");
- if (to == null) return;
-
- var cursor = this.mirror.getSearchCursor(from, false);
- while (cursor.findNext())
- cursor.replace(to);
- },
-
- jump: function() {
- var line = prompt("Jump to line:", "");
- if (line && !isNaN(Number(line)))
- this.mirror.jumpToLine(Number(line));
- },
-
- line: function() {
- alert("The cursor is currently at line " + this.mirror.currentLine());
- this.mirror.focus();
- },
-
- macro: function() {
- var name = prompt("Name your constructor:", "");
- if (name)
- this.mirror.replaceSelection("function " + name + "() {\n \n}\n\n" + name + ".prototype = {\n \n};\n");
- },
-
- reindent: function() {
- this.mirror.reindent();
- }
-};