Skip to content
Browse files

Merge master

  • Loading branch information...
2 parents adc8580 + 20df71b commit 17bd2ce7eb3752a26b02e8fd0140f9fcb6e72d6a @gjtorikian gjtorikian committed
Showing with 11,939 additions and 6,743 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 Makefile
  3. +1 −0 Makefile.dryice.js
  4. +6 −6 README.md
  5. +1 −0 bin/run.js
  6. +46 −0 bin/runjs.sh
  7. +4 −7 build/core.build.js
  8. +13 −0 build/json_minifier.js
  9. +8,587 −2,823 build/r.js
  10. +308 −11 build/text.js
  11. +2 −2 configs/default.js
  12. +8 −7 package.json
  13. +42 −11 plugins-client/cloud9.core/www/core/ext.js
  14. +3 −0 plugins-client/cloud9.core/www/core/ide.js
  15. +1 −1 plugins-client/cloud9.core/www/core/settings.js
  16. +0 −13 plugins-client/ext.anims/anims.js
  17. +3 −10 plugins-client/ext.autosave/autosave.js
  18. +0 −12 plugins-client/ext.autotest/autotest.js
  19. +1 −23 plugins-client/ext.beautify/beautify.js
  20. +1 −20 plugins-client/ext.clipboard/clipboard.js
  21. +1 −17 plugins-client/ext.closeconfirmation/closeconfirmation.js
  22. +92 −66 plugins-client/ext.code/code.js
  23. +1 −0 plugins-client/ext.code/code.xml
  24. +2 −1 plugins-client/ext.code/settings.xml
  25. +0 −18 plugins-client/ext.codecomplete/codecomplete.js
  26. +7 −2 plugins-client/ext.codecomplete/complete_util.js
  27. +2 −2 plugins-client/ext.codecomplete/local_completer.js
  28. +9 −9 plugins-client/ext.codecomplete/mode_completer.js
  29. +1 −1 plugins-client/ext.codecomplete/open_files_local_completer.js
  30. +1 −1 plugins-client/ext.codecomplete/snippet_completer.js
  31. +8 −8 plugins-client/ext.codecomplete/snippets/javascript.json
  32. +0 −19 plugins-client/ext.codetools/codetools.js
  33. +1 −1 plugins-client/ext.colorpicker/colorpicker.css
  34. +6 −21 plugins-client/ext.colorpicker/colorpicker.js
  35. +0 −12 plugins-client/ext.commands/commands.js
  36. +0 −10 plugins-client/ext.connect/connect.js
  37. +3 −11 plugins-client/ext.console/console.js
  38. +1 −1 plugins-client/ext.console/logger.js
  39. +3 −4 plugins-client/ext.csslanguage/css_handler.js
  40. +0 −10 plugins-client/ext.csslanguage/csslanguage.js
  41. +1 −1 plugins-client/ext.csslanguage/csslint_test.js
  42. +7 −5 plugins-client/ext.debugger/breakpoints.js
  43. +1 −2 plugins-client/ext.debugger/debugger.js
  44. +153 −114 plugins-client/ext.dockpanel/dockpanel.js
  45. +393 −385 plugins-client/ext.dockpanel/libdock.js
  46. +15 −13 plugins-client/ext.editors/editors.js
  47. +1 −23 plugins-client/ext.extmgr/extmgr.js
  48. +2 −1 plugins-client/ext.extmgr/extmgr.xml
  49. +0 −11 plugins-client/ext.filelist/filelist.js
  50. +0 −5 plugins-client/ext.filesystem/filesystem.js
  51. +2 −19 plugins-client/ext.formatjson/formatjson.js
  52. +1 −22 plugins-client/ext.ftp/ftp.js
  53. +1 −19 plugins-client/ext.gitblame/gitblame.js
  54. +3 −20 plugins-client/ext.githistory/githistory.js
  55. +0 −19 plugins-client/ext.gittools/gittools.js
  56. +4 −22 plugins-client/ext.gotofile/gotofile.js
  57. +1 −1 plugins-client/ext.gotofile/search.js
  58. +1 −17 plugins-client/ext.gotoline/gotoline.js
  59. +0 −19 plugins-client/ext.guidedtour/guidedtour.js
  60. +22 −43 plugins-client/ext.help/help.js
  61. +9 −9 plugins-client/ext.htmllanguage/html_completer.js
  62. +0 −10 plugins-client/ext.htmllanguage/htmllanguage.js
  63. +8 −8 plugins-client/ext.htmllanguage/snippets.js
  64. +0 −20 plugins-client/ext.imgview/imgview.js
  65. +7 −5 plugins-client/ext.jslanguage/jshint.js
  66. +5 −5 plugins-client/ext.jslanguage/jshint_test.js
  67. +0 −10 plugins-client/ext.jslanguage/jslanguage.js
  68. +1 −2 plugins-client/ext.jslanguage/jumptodef.js
  69. +117 −0 plugins-client/ext.jslanguage/jumptodef_test.js
  70. +15 −14 plugins-client/ext.jslanguage/outline.js
  71. +2 −2 plugins-client/ext.jslanguage/parse.js
  72. +6 −6 plugins-client/ext.jslanguage/parse_test.js
  73. +16 −9 plugins-client/ext.jslanguage/scope_analyzer.js
  74. +18 −113 plugins-client/ext.jslanguage/scope_analyzer_test.js
  75. +0 −19 plugins-client/ext.keybindings_default/keybindings_default.js
  76. +19 −19 plugins-client/ext.language/base_handler.js
  77. +40 −39 plugins-client/ext.language/complete.js
  78. BIN plugins-client/ext.language/img/event.png
  79. BIN plugins-client/ext.language/img/event.pxm
  80. BIN plugins-client/ext.language/img/method.png
  81. BIN plugins-client/ext.language/img/method.pxm
  82. BIN plugins-client/ext.language/img/method2.png
  83. BIN plugins-client/ext.language/img/package.png
  84. BIN plugins-client/ext.language/img/package.pxm
  85. BIN plugins-client/ext.language/img/property.png
  86. BIN plugins-client/ext.language/img/property.pxm
  87. BIN plugins-client/ext.language/img/property2.png
  88. BIN plugins-client/ext.language/img/unknown.png
  89. BIN plugins-client/ext.language/img/unknown.pxm
  90. +95 −24 plugins-client/ext.language/jumptodef.js
  91. +14 −8 plugins-client/ext.language/keyhandler.js
  92. +52 −51 plugins-client/ext.language/language.js
  93. +1 −1 plugins-client/ext.language/outline.js
  94. +176 −0 plugins-client/ext.language/syntax_detector.js
  95. +244 −222 plugins-client/ext.language/worker.js
  96. +38 −27 plugins-client/ext.linereport/linereport.js
  97. +17 −14 plugins-client/ext.linereport/linereport_base.js
  98. +1 −14 plugins-client/ext.linereport_php/linereport_php.js
  99. +5 −2 plugins-client/ext.linereport_php/linereport_php_worker.js
  100. +36 −0 plugins-client/ext.linereport_python/linereport_python.js
  101. +47 −0 plugins-client/ext.linereport_python/linereport_python_worker.js
  102. +3 −3 plugins-client/{ext.quicksearch → ext.linereport_python}/package.json
  103. +0 −27 plugins-client/ext.log/log.js
  104. +1 −24 plugins-client/ext.main/main.js
  105. +3 −2 plugins-client/ext.main/main.xml
  106. BIN plugins-client/ext.main/style/images/close-search-icon.png
  107. BIN plugins-client/ext.main/style/images/footer-line.png
  108. BIN plugins-client/ext.main/style/images/ide_loading_bg_pattern.png
  109. BIN plugins-client/ext.main/style/images/loader_logo.png
  110. BIN plugins-client/ext.main/style/images/loader_progressbar_bg.png
  111. BIN plugins-client/ext.main/style/images/loaderide.gif
  112. BIN plugins-client/ext.main/style/images/loading-ind.png
  113. BIN plugins-client/ext.main/style/images/loading-your-editor.png
  114. BIN plugins-client/ext.main/style/images/search-icon.png
  115. BIN plugins-client/ext.main/style/images/sidebar_preview_icon.png
  116. +77 −0 plugins-client/ext.main/style/loading.css
  117. +355 −286 plugins-client/ext.main/style/skins.xml
  118. +31 −34 plugins-client/ext.main/style/style.css
  119. +2 −1 plugins-client/ext.menus/menus.js
  120. +1 −4 plugins-client/ext.minimap/minimap.js
  121. +1 −24 plugins-client/ext.newresource/newresource.js
  122. +0 −9 plugins-client/ext.noderunner/noderunner.js
  123. +1 −34 plugins-client/ext.nodeunit/nodeunit.js
  124. +18 −14 plugins-client/ext.offline/offline.js
  125. +6 −1 plugins-client/ext.offline/{skin.xml → offline.xml}
  126. +38 −0 plugins-client/ext.offline/style.css
  127. +1 −18 plugins-client/ext.openfiles/openfiles.js
  128. +1 −17 plugins-client/ext.panels/panels.js
  129. +125 −54 plugins-client/ext.preview/preview.js
  130. +22 −0 plugins-client/ext.preview/preview.xml
  131. +80 −0 plugins-client/ext.preview/skin.xml
  132. BIN plugins-client/ext.preview/style/images/c9-preview-repeat.png
  133. +10 −0 plugins-client/ext.preview/style/style.css
  134. +0 −407 plugins-client/ext.quicksearch/quicksearch.js
  135. +0 −21 plugins-client/ext.quicksearch/quicksearch.xml
  136. +0 −227 plugins-client/ext.quicksearch/skin.xml
  137. +0 −21 plugins-client/ext.quickwatch/quickwatch.js
  138. +1 −19 plugins-client/ext.recentfiles/recentfiles.js
  139. +0 −10 plugins-client/ext.remotecontrol/remotecontrol.js
  140. +11 −105 plugins-client/ext.revisions/revisions.js
  141. +82 −0 plugins-client/ext.revisions/revisions_util.js
  142. +1 −6 plugins-client/ext.richtext/richtext.js
  143. +2 −16 plugins-client/ext.runpanel/runpanel.js
  144. +1 −17 plugins-client/ext.save/save.js
  145. +1 −17 plugins-client/ext.searchinfiles/searchinfiles.js
  146. +5 −21 plugins-client/ext.searchreplace/searchreplace.js
  147. +1 −18 plugins-client/ext.settings/settings.js
  148. +0 −19 plugins-client/ext.sidebar/sidebar.js
  149. +4 −21 plugins-client/ext.splitview/splitview.js
  150. +1 −17 plugins-client/ext.statusbar/statusbar.js
  151. +2 −1 plugins-client/ext.statusbar/statusbar.xml
  152. +3 −13 plugins-client/ext.stripws/stripws.js
  153. +83 −121 plugins-client/ext.tabbehaviors/tabbehaviors.js
  154. +4 −14 plugins-client/ext.tabsessions/tabsessions.js
  155. +1 −18 plugins-client/ext.testpanel/testpanel.js
  156. +11 −2 plugins-client/ext.themes/themes.js
  157. +0 −10 plugins-client/ext.themes_default/themes_default.js
  158. +2 −19 plugins-client/ext.tooltip/tooltip.js
  159. +1 −18 plugins-client/ext.tree/tree.js
  160. +1 −41 plugins-client/ext.undo/undo.js
  161. +9 −23 plugins-client/ext.uploadfiles/uploadfiles.js
  162. +31 −24 plugins-client/ext.uploadfiles/uploadworker.js
  163. +1 −3 plugins-client/ext.vim/vim.js
  164. +1 −7 plugins-client/ext.watcher/watcher.js
  165. +3 −12 plugins-client/ext.zen/zen.js
  166. +0 −81 plugins-client/lib.ace/www/mode/mode-c9search.js
  167. +133 −145 plugins-client/lib.ace/www/mode/mode-c_cpp.js
  168. +2 −7 plugins-client/lib.ace/www/mode/mode-clojure.js
  169. +1 −96 plugins-client/lib.ace/www/mode/mode-coffee.js
Sorry, we could not display the entire diff because it was too big.
View
1 .gitignore
@@ -36,6 +36,7 @@ plugins-client/lib.packed/www/
plugins-client/lib.ace/www/worker/
plugins-client/cloud9.core/www/js/
plugins-client/ext.jsinfer
+plugins-client/ext.jsonalyzer
node_modules/
deps/ace/
plugins-server/fixtures/
View
1 Makefile
@@ -77,6 +77,7 @@ plugins-client/lib.ace/www/worker/worker-language.js plugins-client/lib.ace/www/
ln -s `pwd`/plugins-client/ext.htmllanguage /tmp/c9_worker_build/ext/htmllanguage
ln -s `pwd`/plugins-client/ext.linereport /tmp/c9_worker_build/ext/linereport
ln -s `pwd`/plugins-client/ext.linereport_php /tmp/c9_worker_build/ext/linereport_php
+ ln -s `pwd`/plugins-client/ext.linereport_python /tmp/c9_worker_build/ext/linereport_python
node Makefile.dryice.js worker
cp node_modules/ace/build/src/worker* plugins-client/lib.ace/www/worker
View
1 Makefile.dryice.js
@@ -74,6 +74,7 @@ function worker(project) {
'ext/codecomplete/mode_completer',
'ext/linereport/linereport_base',
'ext/linereport_php/linereport_php_worker',
+ 'ext/linereport_python/linereport_python_worker',
]
})
],
View
12 README.md
@@ -1,12 +1,12 @@
-**UPDATE for May 2012**: If you cloned Cloud9 prior to May 2012, we have upgraded the
-architecture of the codebase. This makes it simpler to maintain Cloud9, but
-it affects the way you pull updates and hack on subcomponents. See the _Installation and Usage_
-section below to grok the changes.
+**Issues on c9.io** If you have questions regarding the hosted service at [c9.io](http://c9.io)
+including issues with accounts or payments,
+please file them at [support.c9.io](http://support.cloud9ide.com/home) rather than as a
+GitHub issue in this repository.
# Cloud9 IDE
Cloud9 is an open source IDE built with [Node.JS] on the back-end and JavaScript/HTML5 on the client.
-It is very actively maintained by about 15 developers in both Amsterdam and San Francisco and is one
+It is very actively maintained by about 20 developers in both Amsterdam and San Francisco and is one
component of the hosted service at [c9.io](http://c9.io). The version available here runs on your local system.
Cloud9 balances the power of traditional desktop IDEs with the simplicity and elegance of editors
@@ -165,7 +165,7 @@ Cloud9 wouldn't be where it is now without contributions. Feel free to fork and
If you want to contribute to an ajax.org project please print the CLA and fill it out and sign it. Then either send it by snail mail or fax us or send it back scanned (or as a photo) by email. Please indicate a contact person or pull request your CLA relates to so we can quickly process and handle your agreement. Once you've submitted it, you no longer need to send one for subsequent submissions.
-Email: cla@c9.io
+Email: CLA@c9.io
Fax: +31 (0) 206388953
View
1 bin/run.js
View
46 bin/runjs.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+CMD="$0"
+CMD_DIR=`dirname "$CMD"`
+cd "$CMD_DIR/.."
+
+sudo bin/run.js panic
+make update
+
+case `uname -a` in
+Linux*x86_64*) echo "Linux 64 bit"
+ bin/run.js start -t:c9 server.js "$@" -a x-www-browser
+ ;;
+
+Linux*i686*) echo "Linux 32 bit"
+ bin/run.js start -t:c9 server.js "$@" -a x-www-browser
+ ;;
+
+Linux*arm*) echo "Linux ARM"
+ bin/run.js start -t:c9 server.js "$@" -a x-www-browser
+ ;;
+
+Darwin*) echo "OSX"
+ bin/run.js start -t:c9 server.js "$@" -a open
+ ;;
+
+FreeBSD*64*) echo "FreeBSD 64 bit"
+ bin/run.js start -t:c9 server.js "$@" -a open
+ ;;
+
+CYGWIN*) echo "Cygwin"
+ bin/run.js start -t:c9 server.js "$@" -a "cmd /c start"
+ ;;
+
+MING*) echo "MingW"
+ bin/run.js start -t:c9 server.js "$@" -a "cmd /c start"
+ ;;
+
+SunOS*) echo "Solaris"
+ bin/run.js start -t:c9 server.js "$@"
+ ;;
+
+
+*) echo "Unknown OS"
+ ;;
+esac
View
11 build/core.build.js
@@ -71,15 +71,12 @@
"ext/main/main",
"treehugger/traverse",
"treehugger/js/parse",
- "v8debug/Breakpoint",
- "v8debug/ChromeDebugMessageStream",
- "v8debug/WSChromeDebugMessageStream",
- "v8debug/WSV8DebuggerService",
- "v8debug/DevToolsService",
- "v8debug/StandaloneV8DebuggerService",
- "v8debug/V8DebuggerService",
+ "v8debug/util",
"v8debug/V8Debugger"
],
+ exclude: [
+ "text"
+ ],
out: "./src/core.packed.js",
inlineText: true,
findNestedDependencies: true,
View
13 build/json_minifier.js
@@ -0,0 +1,13 @@
+var args = process.argv.slice(2),
+ fileIn = args[0],
+ fileOut = args[1],
+ fs = require("fs");
+
+ fs.readFile(fileIn, "utf8", function(err, json) {
+ if (err) {
+ console.error(err);
+ process.exit(1);
+ }
+
+ fs.writeFileSync(fileOut, JSON.stringify(JSON.parse(json), null));
+ });
View
11,410 build/r.js
8,587 additions, 2,823 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
319 build/text.js
@@ -1,11 +1,308 @@
-/*
- RequireJS text 1.0.7 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
- Available via the MIT or new BSD license.
- see: http://github.com/jrburke/requirejs for details
-*/
-(function(){var k=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],n=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,o=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,i=typeof location!=="undefined"&&location.href,p=i&&location.protocol&&location.protocol.replace(/\:/,""),q=i&&location.hostname,r=i&&(location.port||void 0),j=[];define(function(){var g,h,l;typeof window!=="undefined"&&window.navigator&&window.document?h=function(a,c){var b=g.createXhr();b.open("GET",a,!0);b.onreadystatechange=
-function(){b.readyState===4&&c(b.responseText)};b.send(null)}:typeof process!=="undefined"&&process.versions&&process.versions.node?(l=require.nodeRequire("fs"),h=function(a,c){var b=l.readFileSync(a,"utf8");b.indexOf("\ufeff")===0&&(b=b.substring(1));c(b)}):typeof Packages!=="undefined"&&(h=function(a,c){var b=new java.io.File(a),e=java.lang.System.getProperty("line.separator"),b=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(b),"utf-8")),d,f,g="";try{d=new java.lang.StringBuffer;
-(f=b.readLine())&&f.length()&&f.charAt(0)===65279&&(f=f.substring(1));for(d.append(f);(f=b.readLine())!==null;)d.append(e),d.append(f);g=String(d.toString())}finally{b.close()}c(g)});return g={version:"1.0.7",strip:function(a){if(a){var a=a.replace(n,""),c=a.match(o);c&&(a=c[1])}else a="";return a},jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")},createXhr:function(){var a,c,
-b;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else for(c=0;c<3;c++){b=k[c];try{a=new ActiveXObject(b)}catch(e){}if(a){k=[b];break}}if(!a)throw Error("createXhr(): XMLHttpRequest not available");return a},get:h,parseName:function(a){var c=!1,b=a.indexOf("."),e=a.substring(0,b),a=a.substring(b+1,a.length),b=a.indexOf("!");b!==-1&&(c=a.substring(b+1,a.length),c=c==="strip",a=a.substring(0,b));return{moduleName:e,ext:a,strip:c}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,
-c,b,e){var d=g.xdRegExp.exec(a),f;if(!d)return!0;a=d[2];d=d[3];d=d.split(":");f=d[1];d=d[0];return(!a||a===c)&&(!d||d===b)&&(!f&&!d||f===e)},finishLoad:function(a,c,b,e,d){b=c?g.strip(b):b;d.isBuild&&(j[a]=b);e(b)},load:function(a,c,b,e){if(e.isBuild&&!e.inlineText)b();else{var d=g.parseName(a),f=d.moduleName+"."+d.ext,m=c.toUrl(f),h=e&&e.text&&e.text.useXhr||g.useXhr;!i||h(m,p,q,r)?g.get(m,function(c){g.finishLoad(a,d.strip,c,b,e)}):c([f],function(a){g.finishLoad(d.moduleName+"."+d.ext,d.strip,a,
-b,e)})}},write:function(a,c,b){if(c in j){var e=g.jsEscape(j[c]);b.asModule(a+"!"+c,"define(function () { return '"+e+"';});\n")}},writeFile:function(a,c,b,e,d){var c=g.parseName(c),f=c.moduleName+"."+c.ext,h=b.toUrl(c.moduleName+"."+c.ext)+".js";g.load(f,b,function(){var b=function(a){return e(h,a)};b.asModule=function(a,b){return e.asModule(a,h,b)};g.write(a,f,b,d)},d)}}})})();
+/**
+ * @license RequireJS text 2.0.3 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/requirejs/text for details
+ */
+/*jslint regexp: true */
+/*global require: false, XMLHttpRequest: false, ActiveXObject: false,
+ define: false, window: false, process: false, Packages: false,
+ java: false, location: false */
+
+define(['module'], function (module) {
+ 'use strict';
+
+ var text, fs,
+ progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'],
+ xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,
+ bodyRegExp = /<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,
+ hasLocation = typeof location !== 'undefined' && location.href,
+ defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''),
+ defaultHostName = hasLocation && location.hostname,
+ defaultPort = hasLocation && (location.port || undefined),
+ buildMap = [],
+ masterConfig = (module.config && module.config()) || {};
+
+ text = {
+ version: '2.0.3',
+
+ strip: function (content) {
+ //Strips <?xml ...?> declarations so that external SVG and XML
+ //documents can be added to a document without worry. Also, if the string
+ //is an HTML document, only the part inside the body tag is returned.
+ if (content) {
+ content = content.replace(xmlRegExp, "");
+ var matches = content.match(bodyRegExp);
+ if (matches) {
+ content = matches[1];
+ }
+ } else {
+ content = "";
+ }
+ return content;
+ },
+
+ jsEscape: function (content) {
+ return content.replace(/(['\\])/g, '\\$1')
+ .replace(/[\f]/g, "\\f")
+ .replace(/[\b]/g, "\\b")
+ .replace(/[\n]/g, "\\n")
+ .replace(/[\t]/g, "\\t")
+ .replace(/[\r]/g, "\\r")
+ .replace(/[\u2028]/g, "\\u2028")
+ .replace(/[\u2029]/g, "\\u2029");
+ },
+
+ createXhr: masterConfig.createXhr || function () {
+ //Would love to dump the ActiveX crap in here. Need IE 6 to die first.
+ var xhr, i, progId;
+ if (typeof XMLHttpRequest !== "undefined") {
+ return new XMLHttpRequest();
+ } else if (typeof ActiveXObject !== "undefined") {
+ for (i = 0; i < 3; i += 1) {
+ progId = progIds[i];
+ try {
+ xhr = new ActiveXObject(progId);
+ } catch (e) {}
+
+ if (xhr) {
+ progIds = [progId]; // so faster next time
+ break;
+ }
+ }
+ }
+
+ return xhr;
+ },
+
+ /**
+ * Parses a resource name into its component parts. Resource names
+ * look like: module/name.ext!strip, where the !strip part is
+ * optional.
+ * @param {String} name the resource name
+ * @returns {Object} with properties "moduleName", "ext" and "strip"
+ * where strip is a boolean.
+ */
+ parseName: function (name) {
+ var strip = false, index = name.indexOf("."),
+ modName = name.substring(0, index),
+ ext = name.substring(index + 1, name.length);
+
+ index = ext.indexOf("!");
+ if (index !== -1) {
+ //Pull off the strip arg.
+ strip = ext.substring(index + 1, ext.length);
+ strip = strip === "strip";
+ ext = ext.substring(0, index);
+ }
+
+ return {
+ moduleName: modName,
+ ext: ext,
+ strip: strip
+ };
+ },
+
+ xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/,
+
+ /**
+ * Is an URL on another domain. Only works for browser use, returns
+ * false in non-browser environments. Only used to know if an
+ * optimized .js version of a text resource should be loaded
+ * instead.
+ * @param {String} url
+ * @returns Boolean
+ */
+ useXhr: function (url, protocol, hostname, port) {
+ var uProtocol, uHostName, uPort,
+ match = text.xdRegExp.exec(url);
+ if (!match) {
+ return true;
+ }
+ uProtocol = match[2];
+ uHostName = match[3];
+
+ uHostName = uHostName.split(':');
+ uPort = uHostName[1];
+ uHostName = uHostName[0];
+
+ return (!uProtocol || uProtocol === protocol) &&
+ (!uHostName || uHostName.toLowerCase() === hostname.toLowerCase()) &&
+ ((!uPort && !uHostName) || uPort === port);
+ },
+
+ finishLoad: function (name, strip, content, onLoad) {
+ content = strip ? text.strip(content) : content;
+ if (masterConfig.isBuild) {
+ buildMap[name] = content;
+ }
+ onLoad(content);
+ },
+
+ load: function (name, req, onLoad, config) {
+ //Name has format: some.module.filext!strip
+ //The strip part is optional.
+ //if strip is present, then that means only get the string contents
+ //inside a body tag in an HTML string. For XML/SVG content it means
+ //removing the <?xml ...?> declarations so the content can be inserted
+ //into the current doc without problems.
+
+ // Do not bother with the work if a build and text will
+ // not be inlined.
+ if (config.isBuild && !config.inlineText) {
+ onLoad();
+ return;
+ }
+
+ masterConfig.isBuild = config.isBuild;
+
+ var parsed = text.parseName(name),
+ nonStripName = parsed.moduleName + '.' + parsed.ext,
+ url = req.toUrl(nonStripName),
+ useXhr = (masterConfig.useXhr) ||
+ text.useXhr;
+
+ //Load the text. Use XHR if possible and in a browser.
+ if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) {
+ text.get(url, function (content) {
+ text.finishLoad(name, parsed.strip, content, onLoad);
+ }, function (err) {
+ if (onLoad.error) {
+ onLoad.error(err);
+ }
+ });
+ } else {
+ //Need to fetch the resource across domains. Assume
+ //the resource has been optimized into a JS module. Fetch
+ //by the module name + extension, but do not include the
+ //!strip part to avoid file system issues.
+ req([nonStripName], function (content) {
+ text.finishLoad(parsed.moduleName + '.' + parsed.ext,
+ parsed.strip, content, onLoad);
+ });
+ }
+ },
+
+ write: function (pluginName, moduleName, write, config) {
+ if (buildMap.hasOwnProperty(moduleName)) {
+ var content = text.jsEscape(buildMap[moduleName]);
+ write.asModule(pluginName + "!" + moduleName,
+ "define(function () { return '" +
+ content +
+ "';});\n");
+ }
+ },
+
+ writeFile: function (pluginName, moduleName, req, write, config) {
+ var parsed = text.parseName(moduleName),
+ nonStripName = parsed.moduleName + '.' + parsed.ext,
+ //Use a '.js' file name so that it indicates it is a
+ //script that can be loaded across domains.
+ fileName = req.toUrl(parsed.moduleName + '.' +
+ parsed.ext) + '.js';
+
+ //Leverage own load() method to load plugin value, but only
+ //write out values that do not have the strip argument,
+ //to avoid any potential issues with ! in file names.
+ text.load(nonStripName, req, function (value) {
+ //Use own write() method to construct full module value.
+ //But need to create shell that translates writeFile's
+ //write() to the right interface.
+ var textWrite = function (contents) {
+ return write(fileName, contents);
+ };
+ textWrite.asModule = function (moduleName, contents) {
+ return write.asModule(moduleName, fileName, contents);
+ };
+
+ text.write(pluginName, nonStripName, textWrite, config);
+ }, config);
+ }
+ };
+
+ if (masterConfig.env === 'node' || (!masterConfig.env &&
+ typeof process !== "undefined" &&
+ process.versions &&
+ !!process.versions.node)) {
+ //Using special require.nodeRequire, something added by r.js.
+ fs = require.nodeRequire('fs');
+
+ text.get = function (url, callback) {
+ var file = fs.readFileSync(url, 'utf8');
+ //Remove BOM (Byte Mark Order) from utf8 files if it is there.
+ if (file.indexOf('\uFEFF') === 0) {
+ file = file.substring(1);
+ }
+ callback(file);
+ };
+ } else if (masterConfig.env === 'xhr' || (!masterConfig.env &&
+ text.createXhr())) {
+ text.get = function (url, callback, errback) {
+ var xhr = text.createXhr();
+ xhr.open('GET', url, true);
+
+ //Allow overrides specified in config
+ if (masterConfig.onXhr) {
+ masterConfig.onXhr(xhr, url);
+ }
+
+ xhr.onreadystatechange = function (evt) {
+ var status, err;
+ //Do not explicitly handle errors, those should be
+ //visible via console output in the browser.
+ if (xhr.readyState === 4) {
+ status = xhr.status;
+ if (status > 399 && status < 600) {
+ //An http 4xx or 5xx error. Signal an error.
+ err = new Error(url + ' HTTP status: ' + status);
+ err.xhr = xhr;
+ errback(err);
+ } else {
+ callback(xhr.responseText);
+ }
+ }
+ };
+ xhr.send(null);
+ };
+ } else if (masterConfig.env === 'rhino' || (!masterConfig.env &&
+ typeof Packages !== 'undefined' && typeof java !== 'undefined')) {
+ //Why Java, why is this so awkward?
+ text.get = function (url, callback) {
+ var stringBuffer, line,
+ encoding = "utf-8",
+ file = new java.io.File(url),
+ lineSeparator = java.lang.System.getProperty("line.separator"),
+ input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)),
+ content = '';
+ try {
+ stringBuffer = new java.lang.StringBuffer();
+ line = input.readLine();
+
+ // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324
+ // http://www.unicode.org/faq/utf_bom.html
+
+ // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK:
+ // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058
+ if (line && line.length() && line.charAt(0) === 0xfeff) {
+ // Eat the BOM, since we've already found the encoding on this file,
+ // and we plan to concatenating this buffer with others; the BOM should
+ // only appear at the top of a file.
+ line = line.substring(1);
+ }
+
+ stringBuffer.append(line);
+
+ while ((line = input.readLine()) !== null) {
+ stringBuffer.append(lineSeparator);
+ stringBuffer.append(line);
+ }
+ //Make sure we return a JavaScript string and not a Java string.
+ content = String(stringBuffer.toString()); //String
+ } finally {
+ input.close();
+ }
+ callback(content);
+ };
+ }
+
+ return text;
+});
View
4 configs/default.js
@@ -117,6 +117,7 @@ var config = [
"ext/help/help",
"ext/linereport/linereport",
"ext/linereport_php/linereport_php",
+ "ext/linereport_python/linereport_python",
//"ext/ftp/ftp",
"ext/code/code",
"ext/statusbar/statusbar",
@@ -144,7 +145,7 @@ var config = [
"ext/offline/offline",
"ext/stripws/stripws",
//"ext/testpanel/testpanel",
- "ext/nodeunit/nodeunit",
+ //"ext/nodeunit/nodeunit",
"ext/zen/zen",
"ext/codecomplete/codecomplete",
"ext/vim/vim",
@@ -162,7 +163,6 @@ var config = [
//"ext/githistory/githistory",
"ext/autosave/autosave",
"ext/revisions/revisions",
- "ext/quicksearch/quicksearch",
"ext/language/liveinspect"
//"ext/splitview/splitview"
//"ext/minimap/minimap"
View
15 package.json
@@ -20,7 +20,7 @@
"simple-template": "0.0.1",
"optimist": "0.3.4",
- "dryice": "0.4.2",
+ "dryice": "0.4.10",
"mappings": "0.1.x",
"amd-loader": "0.0.4",
@@ -32,8 +32,8 @@
"smith": "0.1.9",
"smith.io": "0.0.36",
"vfs-architect": "0.0.2",
- "jsDAV": "0.1.8",
- "nak": "0.1.6"
+ "jsDAV": "0.2.3",
+ "nak": "0.1.7"
},
"devDependencies": {
@@ -45,12 +45,13 @@
},
"mappings": {
- "ace": ["npm", "https://github.com/ajaxorg/ace/tarball/1bd26e19aa13bf8bc9c6647f967c46ad5fdde8c9"],
- "apf": ["npm", "https://github.com/ajaxorg/apf/tarball/67b0929e1011dc876d4412a654b6d939335876e0"],
+ "ace": ["npm", "https://github.com/ajaxorg/ace/tarball/cc2a2c9e056c6d4049f8849ec3ad72974de37177"],
+ "apf": ["npm", "https://github.com/ajaxorg/apf/tarball/145f65bd24ae83f041418dd01a9c51d278045f3f"],
"asyncjs": ["npm", "https://github.com/ajaxorg/async.js/tarball/0b4ed5608a32c280a7690b5f52883d8d1fc0de08"],
"v8debug": ["npm", "https://github.com/ajaxorg/lib-v8debug/tarball/d2fac9b09724cb2e75e2807191eace9bc27d3b52"],
"packager": ["npm", "https://github.com/ajaxorg/packager/tarball/bee2a82c6d5e2875024bfdc83937e98092ccf04f"],
- "treehugger": ["npm", "https://github.com/ajaxorg/treehugger/tarball/b22d7ad712f76a7e7b1070ab339d567dfbf059b1"]
+ "treehugger": ["npm", "https://github.com/ajaxorg/treehugger/tarball/b22d7ad712f76a7e7b1070ab339d567dfbf059b1"],
+ "runjs": ["npm", "https://github.com/c9/runjs/tarball/347ad9627fb4a1d63458bc66ea40f0bf1efbf05c"]
},
"repository" : {
@@ -67,4 +68,4 @@
"build-debug": "node ./scripts/build-debug",
"build-packed": "node ./scripts/build-packed"
}
-}
+}
View
53 plugins-client/cloud9.core/www/core/ext.js
@@ -100,6 +100,15 @@ module.exports = ext = {
oExtension.registered = true;
oExtension.path = path;
+ var defaultEnable = this.defaultEnable;
+ var defaultDisable = this.defaultDisable;
+ var defaultDestroy = this.defaultDestroy;
+ oExtension.enable = oExtension.enable || defaultEnable;
+ oExtension.disable = oExtension.disable || defaultDisable;
+ oExtension.destroy = oExtension.destroy || defaultDestroy;
+ oExtension.$enable = defaultEnable;
+ oExtension.$disable = defaultDisable;
+ oExtension.$destroy = defaultDestroy;
this.extHandlers[oExtension.type].register(oExtension);
@@ -174,10 +183,8 @@ module.exports = ext = {
this.model.setQueryValue("plugin[@path=" + util.escapeXpathString(oExtension.path) + "]/@enabled", 0);
- if (oExtension.inited) {
- oExtension.destroy();
- delete oExtension.inited;
- }
+ if (oExtension.inited)
+ this.destroyExt(oExtension);
return true;
},
@@ -225,7 +232,7 @@ module.exports = ext = {
oExtension.currentKeybindings = keyBindings;
}
- oExtension.init(amlParent);
+ oExtension.init && oExtension.init(amlParent);
ide.addEventListener("$event.init." + oExtension.path, function(callback){
callback.call(this, {ext : oExtension});
@@ -237,24 +244,48 @@ module.exports = ext = {
this.model.queryNode("plugin[@path=" + util.escapeXpathString(oExtension.path) + "]").setAttribute("init", Number(new Date() - dt));
},
+ defaultEnable: function () {
+ (this.nodes || []).each(function(item){
+ item.enable && item.enable();
+ });
+ this.disabled = false;
+ this.enabled = true;
+ },
+
+ defaultDisable: function () {
+ (this.nodes || []).each(function(item) {
+ item.disable && item.disable();
+ });
+ this.disabled = true;
+ this.enabled = false;
+ },
+
+ defaultDestroy: function () {
+ (this.nodes || []).each(function(item) {
+ item.destroy && item.destroy(true, true);
+ });
+ this.nodes = [];
+ this.disabled = true;
+ this.enabled = false;
+ delete this.inited;
+ },
+
enableExt : function(path) {
var ext = require(path);
- if(!ext.enable)
- return;
-
ext.enable();
this.model.setQueryValue("plugin[@path=" + util.escapeXpathString(path) + "]/@enabled", 1);
},
disableExt : function(path) {
var ext = require(path);
- if(!ext.disable)
- return;
-
ext.disable();
this.model.setQueryValue("plugin[@path=" + util.escapeXpathString(path) + "]/@enabled", 0);
},
+ destroyExt : function(ext) {
+ ext.destroy();
+ },
+
execCommand: function(cmd, data) {
if (cmd)
cmd = cmd.trim();
View
3 plugins-client/cloud9.core/www/core/ide.js
@@ -45,6 +45,7 @@ define(function(require, exports, module) {
&& loc.indexOf("dev") === -1
&& (loc.indexOf("c9.io") > -1))
{
+ var oldOnError = window.onerror;
window.onerror = function(m, u, l) {
apf.ajax("/api/debug", {
method : "POST",
@@ -56,6 +57,8 @@ define(function(require, exports, module) {
workspaceId : ide.workspaceId
})
});
+ if (oldOnError)
+ oldOnError.apply(this, arguments);
};
//Catch all APF Routed errors
View
2 plugins-client/cloud9.core/www/core/settings.js
@@ -111,7 +111,7 @@ module.exports = {
cb({model : _self.model, ext : _self});
}
catch(e){
- console.error(e.message);
+ console.log(e.message, e.stack);
}
}
},
View
13 plugins-client/ext.anims/anims.js
@@ -123,19 +123,6 @@ module.exports = ext.register("ext/anims/anims", {
finish && finish();
}
- },
-
- init : function(){
-
- },
-
- enable : function(){
- },
-
- disable : function(){
- },
-
- destroy : function(){
}
});
View
13 plugins-client/ext.autosave/autosave.js
@@ -199,9 +199,7 @@ module.exports = ext.register("ext/autosave/autosave", {
},
enable: function() {
- this.nodes.each(function(item) {
- item.enable();
- });
+ this.$enable();
tabEditors.getPages().forEach(function(page) {
var listener = this.docChangeListeners[page.name];
@@ -219,9 +217,7 @@ module.exports = ext.register("ext/autosave/autosave", {
},
disable: function() {
- this.nodes.each(function(item){
- item.disable();
- });
+ this.$disable();
tabEditors.getPages().forEach(function(page) {
var listener = this.docChangeListeners[page.name];
@@ -259,10 +255,7 @@ module.exports = ext.register("ext/autosave/autosave", {
}
}, this);
- this.nodes.each(function(item){
- item.destroy(true, true);
- });
- this.nodes = [];
+ this.$destroy();
}
});
});
View
12 plugins-client/ext.autotest/autotest.js
@@ -57,18 +57,6 @@ module.exports = ext.register("ext/autotest/autotest", {
noderunner.run(path, [], false);
}
});
- },
-
- init : function(amlNode) {
- },
-
- enable : function() {
- },
-
- disable : function() {
- },
-
- destroy : function() {
}
});
View
24 plugins-client/ext.beautify/beautify.js
@@ -110,8 +110,6 @@ module.exports = ext.register("ext/beautify/beautify", {
sel.setSelectionRange(Range.fromPoints(range.start, end));
},
- init: function () {},
-
hook: function () {
var _self = this;
@@ -157,30 +155,10 @@ module.exports = ext.register("ext/beautify/beautify", {
ext.initExtension(this);
},
- enable: function () {
- this.nodes.each(function (item) {
- item.enable();
- });
-
- this.disabled = false;
- },
-
- disable: function () {
- this.nodes.each(function (item) {
- item.disable();
- });
-
- this.disabled = true;
- },
-
destroy: function () {
menus.remove("Tools/Beautify Selection");
commands.removeCommand("beautify");
-
- this.nodes.each(function (item) {
- item.destroy(true, true);
- });
- this.nodes = [];
+ this.$destroy();
}
});
View
21 plugins-client/ext.clipboard/clipboard.js
@@ -90,10 +90,6 @@ module.exports = ext.register("ext/clipboard/clipboard", {
);
},
- init : function (amlNode) {
- // do nothing
- },
-
cut: function() {
if (self.trFiles && apf.document.activeElement == trFiles) {
apf.clipboard.cutSelection(trFiles);
@@ -154,18 +150,6 @@ module.exports = ext.register("ext/clipboard/clipboard", {
var amlEditor = editor.amlEditor;
return amlEditor.$editor;
},
-
- enable : function(){
- this.nodes.each(function(item){
- item.enable();
- });
- },
-
- disable : function(){
- this.nodes.each(function(item){
- item.disable();
- });
- },
destroy : function(){
menus.remove("Edit/~", 300);
@@ -173,10 +157,7 @@ module.exports = ext.register("ext/clipboard/clipboard", {
menus.remove("Edit/Copy");
menus.remove("Edit/Paste");
- this.nodes.each(function(item){
- item.destroy(true, true);
- });
- this.nodes = [];
+ this.$destroy();
}
});
View
18 plugins-client/ext.closeconfirmation/closeconfirmation.js
@@ -57,24 +57,8 @@ module.exports = ext.register("ext/closeconfirmation/closeconfirmation", {
}
},
- enable : function() {
- this.nodes.each(function(item){
- item.enable();
- });
- },
-
- disable : function() {
- this.nodes.each(function(item){
- item.disable();
- });
- },
-
destroy : function() {
- this.nodes.each(function(item){
- item.destroy(true, true);
- });
- this.nodes = [];
-
+ this.$destroy();
// clean out the event handler
if (window.onbeforeunload === this.onBeforeUnloadHandler) {
window.onbeforeunload = null;
View
158 plugins-client/ext.code/code.js
@@ -23,6 +23,7 @@ var ProxyDocument = require("ext/code/proxydocument");
var defaultCommands = require("ace/commands/default_commands").commands;
var markup = require("text!ext/code/code.xml");
var settings = require("ext/settings/settings");
+var themes = require("ext/themes/themes");
var markupSettings = require("text!ext/code/settings.xml");
var editors = require("ext/editors/editors");
@@ -42,46 +43,56 @@ apf.actiontracker.actions.aceupdate = function(undoObj, undo){
// name: ["Menu caption", "extensions", "content-type", "hidden|other"]
var SupportedModes = {
+ abap: ["ABAP", "abap", "text/x-abap", "other"],
asciidoc: ["AsciiDoc", "asciidoc", "text/x-asciidoc", "other"],
c9search: ["C9Search", "c9search", "text/x-c9search", "hidden"],
c_cpp: ["C, C++", "c|cc|cpp|cxx|h|hh|hpp", "text/x-c"],
clojure: ["Clojure", "clj", "text/x-script.clojure"],
- coffee: ["CoffeeScript", "coffee|*Cakefile", "text/x-script.coffeescript"],
+ coffee: ["CoffeeScript", "*Cakefile|coffee|cf", "text/x-script.coffeescript"],
coldfusion: ["ColdFusion", "cfm", "text/x-coldfusion", "other"],
csharp: ["C#", "cs", "text/x-csharp"],
css: ["CSS", "css", "text/css"],
- diff: ["Diff", "diff|patch", "text/x-diff", "other"],
- glsl: ["Glsl", "glsl|frag|vert", "text/x-glsl", "other"],
+ dart: ["Dart", "dart", "text/x-dart"],
+ diff: ["Diff", "diff|patch", "text/x-diff", "other"],
+ glsl: ["Glsl", "glsl|frag|vert", "text/x-glsl", "other"],
golang: ["Go", "go", "text/x-go"],
groovy: ["Groovy", "groovy", "text/x-groovy", "other"],
+ haml: ["Haml", "haml", "text/haml", "other"],
haxe: ["haXe", "hx", "text/haxe", "other"],
html: ["HTML", "htm|html|xhtml", "text/html"],
- jade: ["Jade", "jade", "text/x-jade"],
+ jade: ["Jade", "jade", "text/x-jade"],
java: ["Java", "java", "text/x-java-source"],
- jsp: ["JSP", "jsp", "text/x-jsp", "other"],
+ jsp: ["JSP", "jsp", "text/x-jsp", "other"],
javascript: ["JavaScript", "js", "application/javascript"],
json: ["JSON", "json", "application/json"],
- jsx: ["JSX", "jsx", "text/x-jsx", "other"],
+ jsx: ["JSX", "jsx", "text/x-jsx", "other"],
latex: ["LaTeX", "latex|tex|ltx|bib", "application/x-latex", "other"],
less: ["LESS", "less", "text/x-less"],
+ lisp: ["Lisp", "lisp|scm|rkt", "text/x-lisp", "other"],
liquid: ["Liquid", "liquid", "text/x-liquid", "other"],
lua: ["Lua", "lua", "text/x-lua"],
- luapage: ["LuaPage" , "lp", "text/x-luapage", "other"],
+ luapage: ["LuaPage", "lp", "text/x-luapage", "other"],
+ makefile: ["Makefile", "*GNUmakefile|*makefile|*Makefile|*OCamlMakefile|make", "text/x-makefile", "other"],
markdown: ["Markdown", "md|markdown", "text/x-markdown", "other"],
+ objectivec: ["Objective-C", "m", "text/objective-c", "other"],
ocaml: ["OCaml", "ml|mli", "text/x-script.ocaml", "other"],
perl: ["Perl", "pl|pm", "text/x-script.perl"],
pgsql: ["pgSQL", "pgsql", "text/x-pgsql", "other"],
php: ["PHP", "php|phtml", "application/x-httpd-php"],
powershell: ["Powershell", "ps1", "text/x-script.powershell", "other"],
python: ["Python", "py", "text/x-script.python"],
+ r: ["R" , "r", "text/x-r", "other"],
+ rdoc: ["RDoc" , "Rd", "text/x-rdoc", "other"],
+ rhtml:["RHTML", "Rhtml", "text/x-rhtml", "other"],
ruby: ["Ruby", "ru|gemspec|rake|rb", "text/x-script.ruby"],
scad: ["OpenSCAD", "scad", "text/x-scad", "other"],
scala: ["Scala", "scala", "text/x-scala"],
scss: ["SCSS", "scss|sass", "text/x-scss"],
sh: ["SH", "sh|bash|bat", "application/x-sh"],
+ stylus: ["Stylus", "styl|stylus", "text/x-stylus"],
sql: ["SQL", "sql", "text/x-sql"],
svg: ["SVG", "svg", "image/svg+xml", "other"],
- tcl: ["Tcl" , "tcl", "text/x-tcl", "other"],
+ tcl: ["Tcl", "tcl", "text/x-tcl", "other"],
text: ["Text", "txt", "text/plain", "hidden"],
textile: ["Textile", "textile", "text/x-web-textile", "other"],
typescript: ["Typescript", "ts|str", "text/x-typescript"],
@@ -394,7 +405,8 @@ module.exports = ext.register("ext/code/code", {
["showprintmargin", "true"],
["showindentguides", "true"],
["printmargincolumn", "80"],
- ["behaviors", ""],
+ ["behaviors", "true"],
+ ["wrapbehaviors", "false"],
["softtabs", "true"],
["tabsize", "4"],
["scrollspeed", "2"],
@@ -412,10 +424,14 @@ module.exports = ext.register("ext/code/code", {
["animatedscroll", "true"]
]);
- // pre load theme
- var theme = e.model.queryValue("editors/code/@theme");
- if (theme)
- require([theme], function() {});
+ // Enable bracket insertion by default, even if it was disabled before,
+ // migrating old users that had it disabled by default
+ var defaulted = e.model.queryValue("editors/code/@behaviorsdefaulted");
+ if (defaulted !== "true") {
+ e.model.setQueryValue("editors/code/@behaviorsdefaulted", "true");
+ e.model.setQueryValue("editors/code/@behaviors", "true");
+ e.model.setQueryValue("editors/code/@wrapbehaviors", "false");
+ }
// pre load custom mime types
_self.getCustomTypes(e.model);
@@ -765,25 +781,6 @@ module.exports = ext.register("ext/code/code", {
init: function(amlPage) {
var _self = this;
- if (window.__defineGetter__ && !window.cloud9config.packed) {
- function getCeEditor() {
- var d = document.createElement("div");
- d.style.position = "absolute";
- d.style.zIndex = 100001;
- d.style.left = ((apf.getWindowWidth() / 2) - 200) + "px";
- d.style.top = ((apf.getWindowHeight() / 2) - 200) + "px";
- d.addEventListener("click", function () {
- document.body.removeChild(d);
- });
- var i = document.createElement("img");
- i.src = "http://100procentjan.nl/c9/3rlzgl.jpeg";
- d.appendChild(i);
- document.body.appendChild(d);
- }
- window.__defineGetter__("ceEditor", getCeEditor);
- this.__defineGetter__("ceEditor", getCeEditor);
- }
-
_self.amlEditor = codeEditor_dontEverUseThisVariable;
_self.amlEditor.show();
@@ -870,36 +867,84 @@ module.exports = ext.register("ext/code/code", {
});
// display feedback while loading files
- var isOpen, bgMessage, animationEndTimeout;
+ var isOpen, bgMessage, loaderProgress, updateProgressInterval, animationEndTimeout;
var checkLoading = function(e) {
if (!_self.amlEditor.xmlRoot)
return;
- var loading = _self.amlEditor.xmlRoot.hasAttribute("loading");
+ var xmlRoot = _self.amlEditor.xmlRoot;
+ var loading = xmlRoot.hasAttribute("loading");
var container = _self.amlEditor.$editor.container;
+ // loading calcs
+ var padding = container.offsetWidth / 5;
+ var loadingWidth = container.offsetWidth - 2*padding;
+
+ function updateProgress (progress) {
+ xmlRoot.setAttribute("loading_progress", progress);
+ loaderProgress.style.width = (progress * loadingWidth / 100) + "px";
+ }
+
+ function clearProgress() {
+ xmlRoot.setAttribute("loading_progress", 0);
+ loaderProgress.style.width = 0 + "px";
+ }
+
if (loading) {
+ var theme = themes.getActiveTheme();
if (!bgMessage || !bgMessage.parentNode) {
- bgMessage = bgMessage|| document.createElement("div");
+ bgMessage = bgMessage || document.createElement("div");
+ bgMessage.className = "ace_smooth_loading";
+ bgMessage.style.backgroundColor = theme ? theme.bg : "gray";
container.parentNode.appendChild(bgMessage);
- }
- var isDark = container.className.indexOf("ace_dark") != -1;
- bgMessage.className = "ace_smooth_loading" + (isDark ? " ace_dark" : "");
- bgMessage.textContent = "Loading " + _self.amlEditor.xmlRoot.getAttribute("name");
+ var loaderBg = document.createElement("div");
+ loaderBg.className = "loading_bg";
+ loaderBg.style.width = loadingWidth + "px";
+ loaderBg.style.left = padding + "px";
+ loaderBg.style.top = 0.4 * container.offsetHeight + "px";
+ bgMessage.appendChild(loaderBg);
+
+ loaderProgress = document.createElement("div");
+ loaderProgress.className = "loading_progress";
+ loaderProgress.style.left = padding + "px";
+ loaderProgress.style.top = 0.4 * container.offsetHeight + "px";
+ bgMessage.appendChild(loaderProgress);
+ updateProgress(10);
+ }
container.style.transitionProperty = "opacity";
- container.style.transitionDuration = "300ms";
+ container.style.transitionDuration = "100ms";
container.style.pointerEvents = "none";
container.style.opacity = 0;
isOpen = true;
+
+ clearInterval(updateProgressInterval);
+ updateProgressInterval = setInterval(function () {
+ var progress = parseFloat(xmlRoot.getAttribute("loading_progress"), 10);
+ var step;
+ if (progress < 35)
+ step = 3;
+ else if (progress < 70)
+ step = 1;
+ else if (progress < 90)
+ step = 0.25;
+ if (step)
+ updateProgress(progress + step);
+ }, 30);
clearTimeout(animationEndTimeout);
} else if (isOpen) {
- isOpen = false;
- container.style.opacity = 1;
- container.style.pointerEvents = "";
+ clearInterval(updateProgressInterval);
+ updateProgress(100);
+ setTimeout(function () {
+ isOpen = false;
+ clearProgress();
+ container.style.opacity = 1;
+ container.style.pointerEvents = "";
+ }, 40);
+
animationEndTimeout = setTimeout(function() {
if (bgMessage.parentNode)
bgMessage.parentNode.removeChild(bgMessage);
- }, 350);
+ }, 100);
}
};
@@ -963,14 +1008,7 @@ module.exports = ext.register("ext/code/code", {
},
enable : function() {
- if (this.disabled === false)
- return;
-
- this.disabled = false;
-
- this.menus.each(function(item){
- item.enable();
- });
+ this.$enable();
this.nodes.each(function(item){
item.show();
@@ -978,14 +1016,7 @@ module.exports = ext.register("ext/code/code", {
},
disable : function() {
- if (this.disabled)
- return;
-
- this.disabled = true;
-
- this.menus.each(function(item){
- item.disable();
- });
+ this.$disable();
this.nodes.each(function(item){
item.hide();
@@ -1000,16 +1031,11 @@ module.exports = ext.register("ext/code/code", {
commands.removeCommands(defaultCommands);
commands.removeCommands(MultiSelectCommands);
- this.nodes.each(function(item){
- item.destroy(true, true);
- });
-
if (this.amlEditor) {
this.amlEditor.destroy(true, true);
mnuSyntax.destroy(true, true);
}
-
- this.nodes = [];
+ this.$destroy();
}
});
View
1 plugins-client/ext.code/code.xml
@@ -6,6 +6,7 @@
overwrite = "[{require('core/settings').model}::editors/code/@overwrite]"
folding = "[{require('core/settings').model}::editors/code/@folding]"
behaviors = "[{require('core/settings').model}::editors/code/@behaviors]"
+ wrapbehaviors = "[{require('core/settings').model}::editors/code/@wrapbehaviors]"
selectstyle = "[{require('core/settings').model}::editors/code/@selectstyle]"
activeline = "[{require('core/settings').model}::editors/code/@activeline]"
gutterline = "[{require('core/settings').model}::editors/code/@gutterline]"
View
3 plugins-client/ext.code/settings.xml
@@ -1,5 +1,6 @@
<a:application xmlns:a="http://ajax.org/2005/aml">
- <a:checkbox position="1000" class="underlined" label="Auto-pair Quotes, Brackets, etc." value="[editors/code/@behaviors]" skin="checkbox_grey" />
+ <a:checkbox position="1000" class="underlined" label="Auto-pair Brackets, Quotes, etc." value="[editors/code/@behaviors]" skin="checkbox_grey" />
+ <a:checkbox position="1001" class="underlined" label="Wrap Selection with Brackets, Quotes, etc." value="[editors/code/@wrapbehaviors]" skin="checkbox_grey" />
<a:checkbox position="2000" class="underlined" label="Code Folding" value="[editors/code/@folding]" skin="checkbox_grey" />
<a:checkbox position="3000" class="underlined" label="Full Line Selection" value="[editors/code/@selectstyle]" values="line|text" skin="checkbox_grey" />
<a:checkbox position="4000" class="underlined" label="Highlight Active Line" value="[editors/code/@activeline]" skin="checkbox_grey" />
View
18 plugins-client/ext.codecomplete/codecomplete.js
@@ -24,24 +24,6 @@ module.exports = ext.register("ext/codecomplete/codecomplete", {
language.registerLanguageHandler('ext/codecomplete/snippet_completer');
language.registerLanguageHandler("ext/codecomplete/mode_completer");
language.registerLanguageHandler('ext/codecomplete/open_files_local_completer');
- },
-
- enable : function() {
- this.nodes.each(function(item){
- item.enable();
- });
- },
-
- disable : function() {
- this.nodes.each(function(item){
- item.disable();
- });
- },
-
- destroy : function() {
- this.nodes.each(function(item){
- item.destroy(true, true);
- });
}
});
View
9 plugins-client/ext.codecomplete/complete_util.js
@@ -2,7 +2,7 @@ define(function(require, exports, module) {
var ID_REGEX = /[a-zA-Z_0-9\$]/;
-function retrievePreceedingIdentifier(text, pos, regex) {
+function retrievePrecedingIdentifier(text, pos, regex) {
regex = regex || ID_REGEX;
var buf = [];
for (var i = pos-1; i >= 0; i--) {
@@ -72,7 +72,12 @@ function fetchText(staticPrefix, path) {
return false;
}
-exports.retrievePreceedingIdentifier = retrievePreceedingIdentifier;
+/** @deprecated Use retrievePrecedingIdentifier */
+exports.retrievePreceedingIdentifier = function() {
+ console.error("Deprecated: 'retrievePreceedingIdentifier' - use 'retrievePrecedingIdentifier' instead");
+ return retrievePrecedingIdentifier.apply(null, arguments);
+};
+exports.retrievePrecedingIdentifier = retrievePrecedingIdentifier;
exports.retrieveFollowingIdentifier = retrieveFollowingIdentifier;
exports.findCompletions = findCompletions;
exports.fetchText = fetchText;
View
4 plugins-client/ext.codecomplete/local_completer.js
@@ -45,7 +45,7 @@ function wordDistanceAnalyzer(doc, pos, prefix) {
function analyze(doc, pos) {
var line = doc.getLine(pos.row);
- var identifier = completeUtil.retrievePreceedingIdentifier(line, pos.column);
+ var identifier = completeUtil.retrievePrecedingIdentifier(line, pos.column);
var analysisCache = wordDistanceAnalyzer(doc, pos, identifier);
return analysisCache;
@@ -54,7 +54,7 @@ function analyze(doc, pos) {
completer.complete = function(doc, fullAst, pos, currentNode, callback) {
var identDict = analyze(doc, pos);
var line = doc.getLine(pos.row);
- var identifier = completeUtil.retrievePreceedingIdentifier(line, pos.column);
+ var identifier = completeUtil.retrievePrecedingIdentifier(line, pos.column);
var allIdentifiers = [];
for (var ident in identDict) {
View
18 plugins-client/ext.codecomplete/mode_completer.js
@@ -26,7 +26,7 @@ completer.complete = function(doc, fullAst, pos, currentNode, callback) {
var language = this.language;
var line = doc.getLine(pos.row);
var idRegex = ID_REGEXES[language];
- var identifier = completeUtil.retrievePreceedingIdentifier(line, pos.column, idRegex);
+ var identifier = completeUtil.retrievePrecedingIdentifier(line, pos.column, idRegex);
if(!identifier.length) // No completion after "."
return callback([]);
@@ -70,13 +70,13 @@ completer.complete = function(doc, fullAst, pos, currentNode, callback) {
var compls = completeUtil.findCompletions(identifier, mode[type]);
matches.push.apply(matches, compls.map(function(m) {
return {
- name : m + nameAppend,
- replaceText : m + replaceAppend,
- doc : deprecated ? ("Deprecated: <del>" + m + nameAppend + "</del>") : null,
- icon : icon,
- meta : type,
- idRegex : idRegex,
- priority : 2 - deprecated
+ name : m + nameAppend,
+ replaceText : m + replaceAppend,
+ doc : deprecated ? ("Deprecated: <del>" + m + nameAppend + "</del>") : null,
+ icon : icon,
+ meta : type,
+ identifierRegex : idRegex,
+ priority : 2 - deprecated
};
}));
});
@@ -85,4 +85,4 @@ completer.complete = function(doc, fullAst, pos, currentNode, callback) {
};
-});
+});
View
2 plugins-client/ext.codecomplete/open_files_local_completer.js
@@ -78,7 +78,7 @@ completer.onUpdate = function(doc, callback) {
completer.complete = function(doc, fullAst, pos, currentNode, callback) {
var line = doc.getLine(pos.row);
- var identifier = completeUtil.retrievePreceedingIdentifier(line, pos.column);
+ var identifier = completeUtil.retrievePrecedingIdentifier(line, pos.column);
var identDict = globalWordIndex;
var allIdentifiers = [];
View
2 plugins-client/ext.codecomplete/snippet_completer.js
@@ -19,7 +19,7 @@ completer.handlesLanguage = function(language) {
completer.complete = function(doc, fullAst, pos, currentNode, callback) {
var line = doc.getLine(pos.row);
- var identifier = completeUtil.retrievePreceedingIdentifier(line, pos.column);
+ var identifier = completeUtil.retrievePrecedingIdentifier(line, pos.column);
if(line[pos.column - identifier.length - 1] === '.') // No snippet completion after "."
return callback([]);
View
16 plugins-client/ext.codecomplete/snippets/javascript.json
@@ -1,11 +1,11 @@
{
- "fun": "function ^^() {\n \n}",
- "fn": "function() {\n ^^\n}",
- "sc": "(function() {\n ^^\n})();",
- "if ": "if (^^) {\n \n}",
- "while ": "while (^^) {\n \n}",
- "switch ": "switch (^^) {\n default:\n}",
- "for ": "for (var i = 0; i < ^^.length; i++) {\n \n}",
+ "fun": "function ^^() {\n\t\n}",
+ "fn": "function() {\n\t^^\n}",
+ "sc": "(function() {\n\t^^\n})();",
+ "if ": "if (^^) {\n\t\n}",
+ "while ": "while (^^) {\n\t\n}",
+ "switch ": "switch (^^) {\n\tdefault:\n}",
+ "for ": "for (var i = 0; i < ^^.length; i++) {\n\t\n}",
"log": "console.log(^^);",
- "setTimeout ": "setTimeout(function() {\n ^^\n}, 0);"
+ "setTimeout ": "setTimeout(function() {\n\t^^\n}, 0);"
}
View
19 plugins-client/ext.codetools/codetools.js
@@ -130,25 +130,6 @@ module.exports = ext.register("ext/codetools/codetools", {
sessionChange({
session: editor.session
});
- },
-
- enable : function(){
- this.nodes.each(function(item){
- item.enable();
- });
- },
-
- disable : function(){
- this.nodes.each(function(item){
- item.disable();
- });
- },
-
- destroy : function(){
- this.nodes.each(function(item){
- item.destroy(true, true);
- });
- this.nodes = [];
}
});
View
2 plugins-client/ext.colorpicker/colorpicker.css
@@ -1,6 +1,6 @@
.codetools_colorpicker {
position: absolute;
- opacity: 0.9;
+ opacity: 0.5;
border: 1px solid #d9cb89;
background-color: #fff8c8;
-webkit-border-radius: 6px;
View
27 plugins-client/ext.colorpicker/colorpicker.js
@@ -12,6 +12,7 @@ var ext = require("core/ext");
var settings = require("ext/settings/settings");
var Editors = require("ext/editors/editors");
var codetools = require("ext/codetools/codetools");
+var SyntaxDetector = require("ext/language/syntax_detector");
var Range = require("ace/range").Range;
@@ -223,8 +224,8 @@ module.exports = ext.register("ext/colorpicker/colorpicker", {
var editor = e.editor;
var line = doc.getLine(1);
- if (!(e.amlEditor.syntax == "css" || e.amlEditor.syntax == "svg" ||
- (line && line.indexOf("<a:skin") > -1)))
+ if (!(e.amlEditor.syntax === "css" || e.amlEditor.syntax === "svg" ||
+ SyntaxDetector.getContextSyntax(doc, pos, e.amlEditor.syntax) === "css" || (line && line.indexOf("<a:skin") > -1)))
return;
line = doc.getLine(pos.row);
@@ -248,8 +249,8 @@ module.exports = ext.register("ext/colorpicker/colorpicker", {
var editor = e.editor;
var line = doc.getLine(1);
- if (!(e.amlEditor.syntax == "css" || e.amlEditor.syntax == "svg"
- || e.amlEditor.syntax == "html" || (line && line.indexOf("<a:skin") > -1)))
+ if (!(e.amlEditor.syntax === "css" || e.amlEditor.syntax === "svg" ||
+ SyntaxDetector.getContextSyntax(doc, pos, e.amlEditor.syntax) === "css" || (line && line.indexOf("<a:skin") > -1)))
return;
//do not show anything when a selection is made...
var range = editor.selection.getRange();
@@ -698,27 +699,11 @@ module.exports = ext.register("ext/colorpicker/colorpicker", {
menu.$ext.style.left = x + "px";
},
- enable : function(){
- this.nodes.each(function(item){
- item.enable();
- });
- },
-
- disable : function(){
- this.nodes.each(function(item){
- item.disable();
- });
- },
-
destroy : function(){
// hiding the menu also detaches all event listeners.
if (this.menu.visible)
this.menu.hide();
-
- this.nodes.each(function(item){
- item.destroy(true, true);
- });
- this.nodes = [];
+ this.$destroy();
}
});
View
12 plugins-client/ext.commands/commands.js
@@ -217,18 +217,6 @@ module.exports = ext.register("ext/commands/commands", apf.extend(
if (cmd)
_self.removeCommand(cmd);
});
- },
-
- enable : function(){
-
- },
-
- disable : function(){
-
- },
-
- destroy : function(){
-
}
})
);
View
10 plugins-client/ext.connect/connect.js
@@ -37,16 +37,6 @@ module.exports = ext.register("ext/connect/connect", {
stServerConnected.deactivate();
winReconnect.show();
});
- },
-
- enable : function(){
- },
-
- disable : function(){
- },
-
- destroy : function(){
- //Remove all events
}
});
View
14 plugins-client/ext.console/console.js
@@ -445,6 +445,8 @@ module.exports = ext.register("ext/console/console", {
this.createProcessLog(message.pid, lang[1]);
return;
+ } else if ((lang = /^([\w-]+)-web-start$/.exec(message.type)) && runners.indexOf(lang[1]) >= 0) {
+ require("ext/preview/preview").preview(message.url);
} else if ((lang = /^(\w+)-data$/.exec(message.type)) && runners.indexOf(lang[1]) >= 0) {
if (message.extra && message.extra.tip) {
message.data = "\u001b[1;32;40m" + message.data;
@@ -1287,21 +1289,11 @@ module.exports = ext.register("ext/console/console", {
}
},
- enable: function(){
- this.nodes.each(function(item) { item.enable(); });
- },
-
- disable: function(){
- this.nodes.each(function(item) { item.disable(); });
- },
-
destroy: function(){
commands.removeCommandsByName(
["help", "clear", "switchconsole", "toggleconsole",
"escapeconsole", "toggleinputbar"]);
-
- this.nodes.each(function(item) { item.destroy(true, true); });
- this.nodes = [];
+ this.$destroy();
}
});
});
View
2 plugins-client/ext.console/logger.js
@@ -45,7 +45,7 @@ var createItem = module.exports.test.createItem = function(line, ide) {
.replace(wsRe, html.replace("___", workspaceDir + "/"));
}
else if (line.search(RE_URL) !== -1) {
- line = line.replace(RE_URL, "<a href='$1' target='_blank'>$1</a>");
+ line = line.replace(RE_URL, "<a onclick='require(\"ext/preview/preview\").preview(\"$1\"); return false;' href='$1' target='_blank'>$1</a>");
}
// escape HTML/ XML, but preserve the links
View
7 plugins-client/ext.csslanguage/css_handler.js
@@ -14,8 +14,8 @@ handler.handlesLanguage = function(language) {
return language === "css";
};
-handler.analyze = function(doc, ast, callback) {
- callback(handler.analyzeSync(doc, ast));
+handler.analyze = function(value, ast, callback) {
+ callback(handler.analyzeSync(value, ast));
};
var CSSLint_RULESET = {