Permalink
Browse files

updated to latest version of ace!

  • Loading branch information...
1 parent d0fa8ec commit 6178b182a1b9548b9bc42b44edf345bf00cb88d9 @akumpf akumpf committed with root May 29, 2012
Showing with 96,632 additions and 106,820 deletions.
  1. +69 −40 app.js
  2. +4 −4 public/index.css
  3. +3 −1 public/index.html
  4. +19 −153 public/index.js
  5. +0 −1 public/js/ace/ace-compat-noconflict.js
  6. +0 −490 public/js/ace/ace-compat-uncompressed-noconflict.js
  7. +0 −490 public/js/ace/ace-compat-uncompressed.js
  8. +0 −1 public/js/ace/ace-compat.js
  9. +0 −1 public/js/ace/ace-noconflict.js
  10. +0 −14,194 public/js/ace/ace-uncompressed-noconflict.js
  11. +0 −14,194 public/js/ace/ace-uncompressed.js
  12. +15,037 −1 public/js/ace/ace.js
  13. +0 −1 public/js/ace/keybinding-emacs-noconflict.js
  14. +0 −415 public/js/ace/keybinding-emacs-uncompressed-noconflict.js
  15. +0 −415 public/js/ace/keybinding-emacs-uncompressed.js
  16. +1 −1 public/js/ace/keybinding-emacs.js
  17. +0 −1 public/js/ace/keybinding-vim-noconflict.js
  18. +0 −403 public/js/ace/keybinding-vim-uncompressed-noconflict.js
  19. +0 −403 public/js/ace/keybinding-vim-uncompressed.js
  20. +1 −1 public/js/ace/keybinding-vim.js
  21. +1 −0 public/js/ace/mode-c9search.js
  22. +0 −1 public/js/ace/mode-c_cpp-noconflict.js
  23. +0 −928 public/js/ace/mode-c_cpp-uncompressed-noconflict.js
  24. +0 −928 public/js/ace/mode-c_cpp-uncompressed.js
  25. +1 −1 public/js/ace/mode-c_cpp.js
  26. +0 −1 public/js/ace/mode-clojure-noconflict.js
  27. +0 −432 public/js/ace/mode-clojure-uncompressed-noconflict.js
  28. +0 −432 public/js/ace/mode-clojure-uncompressed.js
  29. +1 −1 public/js/ace/mode-clojure.js
  30. +0 −1 public/js/ace/mode-coffee-noconflict.js
  31. +0 −804 public/js/ace/mode-coffee-uncompressed-noconflict.js
  32. +0 −804 public/js/ace/mode-coffee-uncompressed.js
  33. +1 −1 public/js/ace/mode-coffee.js
  34. +0 −1 public/js/ace/mode-coldfusion-noconflict.js
  35. +0 −2,543 public/js/ace/mode-coldfusion-uncompressed-noconflict.js
  36. +0 −2,543 public/js/ace/mode-coldfusion-uncompressed.js
  37. +1 −1 public/js/ace/mode-coldfusion.js
  38. +0 −1 public/js/ace/mode-csharp-noconflict.js
  39. +0 −778 public/js/ace/mode-csharp-uncompressed-noconflict.js
  40. +0 −778 public/js/ace/mode-csharp-uncompressed.js
  41. +1 −1 public/js/ace/mode-csharp.js
  42. +0 −1 public/js/ace/mode-css-noconflict.js
  43. +0 −863 public/js/ace/mode-css-uncompressed-noconflict.js
  44. +0 −863 public/js/ace/mode-css-uncompressed.js
  45. +1 −1 public/js/ace/mode-css.js
  46. +1 −0 public/js/ace/mode-golang.js
  47. +0 −1 public/js/ace/mode-groovy-noconflict.js
  48. +0 −1,462 public/js/ace/mode-groovy-uncompressed-noconflict.js
  49. +0 −1,462 public/js/ace/mode-groovy-uncompressed.js
  50. +1 −1 public/js/ace/mode-groovy.js
  51. +0 −1 public/js/ace/mode-haxe-noconflict.js
  52. +0 −778 public/js/ace/mode-haxe-uncompressed-noconflict.js
  53. +0 −778 public/js/ace/mode-haxe-uncompressed.js
  54. +1 −1 public/js/ace/mode-haxe.js
  55. +0 −1 public/js/ace/mode-html-noconflict.js
  56. +0 −2,558 public/js/ace/mode-html-uncompressed-noconflict.js
  57. +0 −2,558 public/js/ace/mode-html-uncompressed.js
  58. +1 −1 public/js/ace/mode-html.js
  59. +0 −1 public/js/ace/mode-java-noconflict.js
  60. +0 −1,464 public/js/ace/mode-java-uncompressed-noconflict.js
  61. +0 −1,464 public/js/ace/mode-java-uncompressed.js
  62. +1 −1 public/js/ace/mode-java.js
  63. +0 −1 public/js/ace/mode-javascript-noconflict.js
  64. +0 −1,295 public/js/ace/mode-javascript-uncompressed-noconflict.js
  65. +0 −1,295 public/js/ace/mode-javascript-uncompressed.js
  66. +1 −1 public/js/ace/mode-javascript.js
  67. +0 −1 public/js/ace/mode-json-noconflict.js
  68. +0 −689 public/js/ace/mode-json-uncompressed-noconflict.js
  69. +0 −689 public/js/ace/mode-json-uncompressed.js
  70. +1 −1 public/js/ace/mode-json.js
  71. +0 −1 public/js/ace/mode-latex-noconflict.js
  72. +0 −105 public/js/ace/mode-latex-uncompressed-noconflict.js
  73. +0 −105 public/js/ace/mode-latex-uncompressed.js
  74. +1 −1 public/js/ace/mode-latex.js
  75. +1 −0 public/js/ace/mode-less.js
  76. +1 −0 public/js/ace/mode-liquid.js
  77. +0 −1 public/js/ace/mode-lua-noconflict.js
  78. +0 −533 public/js/ace/mode-lua-uncompressed-noconflict.js
  79. +0 −533 public/js/ace/mode-lua-uncompressed.js
  80. +1 −1 public/js/ace/mode-lua.js
  81. +0 −1 public/js/ace/mode-markdown-noconflict.js
  82. +0 −3,000 public/js/ace/mode-markdown-uncompressed-noconflict.js
  83. +0 −3,000 public/js/ace/mode-markdown-uncompressed.js
  84. +1 −1 public/js/ace/mode-markdown.js
  85. +0 −1 public/js/ace/mode-ocaml-noconflict.js
  86. +0 −549 public/js/ace/mode-ocaml-uncompressed-noconflict.js
  87. +0 −549 public/js/ace/mode-ocaml-uncompressed.js
  88. +1 −1 public/js/ace/mode-ocaml.js
  89. +0 −1 public/js/ace/mode-perl-noconflict.js
  90. +0 −583 public/js/ace/mode-perl-uncompressed-noconflict.js
  91. +0 −583 public/js/ace/mode-perl-uncompressed.js
  92. +1 −1 public/js/ace/mode-perl.js
  93. +0 −1 public/js/ace/mode-pgsql-noconflict.js
  94. +0 −1,117 public/js/ace/mode-pgsql-uncompressed-noconflict.js
  95. +0 −1,117 public/js/ace/mode-pgsql-uncompressed.js
  96. +1 −1 public/js/ace/mode-pgsql.js
  97. +0 −1 public/js/ace/mode-php-noconflict.js
  98. +0 −1,894 public/js/ace/mode-php-uncompressed-noconflict.js
  99. +0 −1,894 public/js/ace/mode-php-uncompressed.js
  100. +1 −1 public/js/ace/mode-php.js
  101. +0 −1 public/js/ace/mode-powershell-noconflict.js
  102. +0 −716 public/js/ace/mode-powershell-uncompressed-noconflict.js
  103. +0 −716 public/js/ace/mode-powershell-uncompressed.js
  104. +1 −1 public/js/ace/mode-powershell.js
  105. +0 −1 public/js/ace/mode-python-noconflict.js
  106. +0 −516 public/js/ace/mode-python-uncompressed-noconflict.js
  107. +0 −516 public/js/ace/mode-python-uncompressed.js
  108. +1 −1 public/js/ace/mode-python.js
  109. +0 −1 public/js/ace/mode-ruby-noconflict.js
  110. +0 −401 public/js/ace/mode-ruby-uncompressed-noconflict.js
  111. +0 −401 public/js/ace/mode-ruby-uncompressed.js
  112. +1 −1 public/js/ace/mode-ruby.js
  113. +0 −1 public/js/ace/mode-scad-noconflict.js
  114. +0 −916 public/js/ace/mode-scad-uncompressed-noconflict.js
  115. +0 −916 public/js/ace/mode-scad-uncompressed.js
  116. +1 −1 public/js/ace/mode-scad.js
  117. +0 −1 public/js/ace/mode-scala-noconflict.js
  118. +0 −1,464 public/js/ace/mode-scala-uncompressed-noconflict.js
  119. +0 −1,464 public/js/ace/mode-scala-uncompressed.js
  120. +1 −1 public/js/ace/mode-scala.js
  121. +0 −1 public/js/ace/mode-scss-noconflict.js
  122. +0 −688 public/js/ace/mode-scss-uncompressed-noconflict.js
  123. +0 −688 public/js/ace/mode-scss-uncompressed.js
  124. +1 −1 public/js/ace/mode-scss.js
  125. +1 −0 public/js/ace/mode-sh.js
  126. +0 −1 public/js/ace/mode-sql-noconflict.js
  127. +0 −169 public/js/ace/mode-sql-uncompressed-noconflict.js
  128. +0 −169 public/js/ace/mode-sql-uncompressed.js
  129. +1 −1 public/js/ace/mode-sql.js
  130. +0 −1 public/js/ace/mode-svg-noconflict.js
  131. +0 −2,197 public/js/ace/mode-svg-uncompressed-noconflict.js
  132. +0 −2,197 public/js/ace/mode-svg-uncompressed.js
  133. +1 −1 public/js/ace/mode-svg.js
  134. 0 public/js/ace/mode-text.js
  135. +0 −1 public/js/ace/mode-textile-noconflict.js
  136. +0 −264 public/js/ace/mode-textile-uncompressed-noconflict.js
  137. +0 −264 public/js/ace/mode-textile-uncompressed.js
  138. +1 −1 public/js/ace/mode-textile.js
  139. +0 −1 public/js/ace/mode-xml-noconflict.js
  140. +0 −1,011 public/js/ace/mode-xml-uncompressed-noconflict.js
  141. +0 −1,011 public/js/ace/mode-xml-uncompressed.js
  142. +1 −1 public/js/ace/mode-xml.js
  143. +1 −0 public/js/ace/mode-xquery.js
  144. +1 −0 public/js/ace/mode-yaml.js
  145. +0 −1 public/js/ace/theme-chrome-noconflict.js
  146. +0 −223 public/js/ace/theme-chrome-uncompressed-noconflict.js
  147. +0 −223 public/js/ace/theme-chrome-uncompressed.js
  148. +1 −1 public/js/ace/theme-chrome.js
  149. +0 −1 public/js/ace/theme-clouds-noconflict.js
  150. +0 −162 public/js/ace/theme-clouds-uncompressed-noconflict.js
  151. +0 −162 public/js/ace/theme-clouds-uncompressed.js
  152. +1 −1 public/js/ace/theme-clouds.js
  153. +0 −1 public/js/ace/theme-clouds_midnight-noconflict.js
  154. +0 −163 public/js/ace/theme-clouds_midnight-uncompressed-noconflict.js
  155. +0 −163 public/js/ace/theme-clouds_midnight-uncompressed.js
  156. +1 −1 public/js/ace/theme-clouds_midnight.js
  157. +0 −1 public/js/ace/theme-cobalt-noconflict.js
  158. +0 −176 public/js/ace/theme-cobalt-uncompressed-noconflict.js
  159. +0 −176 public/js/ace/theme-cobalt-uncompressed.js
  160. +1 −1 public/js/ace/theme-cobalt.js
  161. +0 −1 public/js/ace/theme-crimson_editor-noconflict.js
  162. +0 −208 public/js/ace/theme-crimson_editor-uncompressed-noconflict.js
  163. +0 −208 public/js/ace/theme-crimson_editor-uncompressed.js
  164. +1 −1 public/js/ace/theme-crimson_editor.js
  165. +0 −1 public/js/ace/theme-dawn-noconflict.js
  166. +0 −179 public/js/ace/theme-dawn-uncompressed-noconflict.js
  167. +0 −179 public/js/ace/theme-dawn-uncompressed.js
  168. +1 −1 public/js/ace/theme-dawn.js
  169. +0 −1 public/js/ace/theme-dreamweaver-noconflict.js
  170. +0 −236 public/js/ace/theme-dreamweaver-uncompressed-noconflict.js
  171. +0 −236 public/js/ace/theme-dreamweaver-uncompressed.js
  172. +1 −1 public/js/ace/theme-dreamweaver.js
  173. +0 −1 public/js/ace/theme-eclipse-noconflict.js
  174. +0 −155 public/js/ace/theme-eclipse-uncompressed-noconflict.js
  175. +0 −155 public/js/ace/theme-eclipse-uncompressed.js
  176. +1 −1 public/js/ace/theme-eclipse.js
  177. +0 −1 public/js/ace/theme-idle_fingers-noconflict.js
  178. +0 −168 public/js/ace/theme-idle_fingers-uncompressed-noconflict.js
  179. +0 −168 public/js/ace/theme-idle_fingers-uncompressed.js
  180. +1 −1 public/js/ace/theme-idle_fingers.js
  181. +0 −1 public/js/ace/theme-kr_theme-noconflict.js
  182. +0 −171 public/js/ace/theme-kr_theme-uncompressed-noconflict.js
  183. +0 −171 public/js/ace/theme-kr_theme-uncompressed.js
  184. +1 −1 public/js/ace/theme-kr_theme.js
  185. +0 −1 public/js/ace/theme-merbivore-noconflict.js
  186. +0 −171 public/js/ace/theme-merbivore-uncompressed-noconflict.js
  187. +0 −171 public/js/ace/theme-merbivore-uncompressed.js
  188. +1 −1 public/js/ace/theme-merbivore.js
  189. +0 −1 public/js/ace/theme-merbivore_soft-noconflict.js
  190. +0 −177 public/js/ace/theme-merbivore_soft-uncompressed-noconflict.js
  191. +0 −177 public/js/ace/theme-merbivore_soft-uncompressed.js
  192. +1 −1 public/js/ace/theme-merbivore_soft.js
  193. +0 −1 public/js/ace/theme-mono_industrial-noconflict.js
  194. +0 −171 public/js/ace/theme-mono_industrial-uncompressed-noconflict.js
  195. +0 −171 public/js/ace/theme-mono_industrial-uncompressed.js
  196. +1 −1 public/js/ace/theme-mono_industrial.js
  197. +0 −1 public/js/ace/theme-monokai-noconflict.js
  198. +0 −167 public/js/ace/theme-monokai-uncompressed-noconflict.js
  199. +0 −167 public/js/ace/theme-monokai-uncompressed.js
  200. +1 −1 public/js/ace/theme-monokai.js
  201. +0 −1 public/js/ace/theme-pastel_on_dark-noconflict.js
  202. +0 −189 public/js/ace/theme-pastel_on_dark-uncompressed-noconflict.js
  203. +0 −189 public/js/ace/theme-pastel_on_dark-uncompressed.js
  204. +1 −1 public/js/ace/theme-pastel_on_dark.js
  205. +0 −1 public/js/ace/theme-solarized_dark-noconflict.js
  206. +0 −166 public/js/ace/theme-solarized_dark-uncompressed-noconflict.js
  207. +0 −166 public/js/ace/theme-solarized_dark-uncompressed.js
  208. +1 −1 public/js/ace/theme-solarized_dark.js
  209. +0 −1 public/js/ace/theme-solarized_light-noconflict.js
  210. +0 −165 public/js/ace/theme-solarized_light-uncompressed-noconflict.js
  211. +0 −165 public/js/ace/theme-solarized_light-uncompressed.js
  212. +1 −1 public/js/ace/theme-solarized_light.js
  213. +0 −1 public/js/ace/theme-textmate-noconflict.js
  214. +0 −210 public/js/ace/theme-textmate-uncompressed-noconflict.js
  215. +0 −210 public/js/ace/theme-textmate-uncompressed.js
  216. +1 −1 public/js/ace/theme-textmate.js
  217. +0 −1 public/js/ace/theme-tomorrow-noconflict.js
  218. +0 −187 public/js/ace/theme-tomorrow-uncompressed-noconflict.js
  219. +0 −187 public/js/ace/theme-tomorrow-uncompressed.js
  220. +1 −1 public/js/ace/theme-tomorrow.js
  221. +0 −1 public/js/ace/theme-tomorrow_night-noconflict.js
  222. +0 −187 public/js/ace/theme-tomorrow_night-uncompressed-noconflict.js
  223. +0 −187 public/js/ace/theme-tomorrow_night-uncompressed.js
  224. +1 −1 public/js/ace/theme-tomorrow_night.js
  225. +0 −1 public/js/ace/theme-tomorrow_night_blue-noconflict.js
  226. +0 −187 public/js/ace/theme-tomorrow_night_blue-uncompressed-noconflict.js
  227. +0 −187 public/js/ace/theme-tomorrow_night_blue-uncompressed.js
  228. +1 −1 public/js/ace/theme-tomorrow_night_blue.js
  229. +0 −1 public/js/ace/theme-tomorrow_night_bright-noconflict.js
  230. +0 −187 public/js/ace/theme-tomorrow_night_bright-uncompressed-noconflict.js
  231. +0 −187 public/js/ace/theme-tomorrow_night_bright-uncompressed.js
  232. +1 −1 public/js/ace/theme-tomorrow_night_bright.js
  233. +0 −1 public/js/ace/theme-tomorrow_night_eighties-noconflict.js
  234. +0 −183 public/js/ace/theme-tomorrow_night_eighties-uncompressed-noconflict.js
  235. +0 −183 public/js/ace/theme-tomorrow_night_eighties-uncompressed.js
  236. +1 −1 public/js/ace/theme-tomorrow_night_eighties.js
  237. +0 −1 public/js/ace/theme-twilight-noconflict.js
  238. +0 −189 public/js/ace/theme-twilight-uncompressed-noconflict.js
  239. +0 −189 public/js/ace/theme-twilight-uncompressed.js
  240. +1 −1 public/js/ace/theme-twilight.js
  241. +0 −1 public/js/ace/theme-vibrant_ink-noconflict.js
  242. +0 −172 public/js/ace/theme-vibrant_ink-uncompressed-noconflict.js
  243. +0 −172 public/js/ace/theme-vibrant_ink-uncompressed.js
  244. +1 −1 public/js/ace/theme-vibrant_ink.js
  245. +2,387 −1,442 public/js/ace/worker-coffee.js
  246. +3,279 −587 public/js/ace/worker-css.js
  247. +4,322 −2,940 public/js/ace/worker-javascript.js
  248. +3,599 −0 public/js/ace/worker-json.js
  249. +67,849 −0 public/js/ace/worker-xquery.js
  250. +1 −1 public/js/theme-chaos.js
View
109 app.js
@@ -5,29 +5,38 @@
//
//var profiler = require("v8-profiler");
console.log("\n** Starting Node service **");
-var livelog = require("../CHAOS/livelog");
var express = require("express"); //"-unstable");
var util = require("util");
var fs = require('fs');
var crypto = require('crypto');
var walk = require('walk');
var spawn = require('child_process').spawn;
var exec = require('child_process').exec;
-var gzippo = require('gzippo');
-function authorizeSimple(username, password) {
- return username === 'chaos' & password === 'bettert0gether';
-}
-var app = express.createServer(express.basicAuth(authorizeSimple));
-
-// setup livelog
-app.get("/livelog", livelog.livelog);
-app.get("/livelogdata", express.basicAuth(livelog.basicauth), livelog.livelogdata);
-
-//app.use(express.static(__dirname + '/public'));
-//var staticProvider = gzippo.staticGzip(__dirname + '/public'); // use GZIP compression for static files (cache ~1 day)!
+// ------------------------------------------------
+// AUTH w/ EXPRESS
+// ------------------------------------------------
+var Auth = require("../CHAOS/auth");
+var app = express.createServer();
+app.use(express.bodyParser());
+app.use(express.cookieParser());
+app.use(express.session({
+ secret: "f0p8heW2n7j2ji",
+ store: new express.session.MemoryStore,
+ cookie: {
+ path : '/',
+ httpOnly : true,
+ maxAge : 1000*60*60*24*30*2 //60 days
+ }
+}));
+app.use(Auth.checkLoggedIn);
+app.use(Auth.ensureAuthenticated);
+app.get("/whoami", Auth.whoami); // handy to query basic user info.
var staticProvider = express.static(__dirname + '/public');
-app.use(staticProvider);
+app.use(staticProvider); // this is where static files will be served (html, css, js, media, etc.)
+// ------------------------------------------------
+// ------------------------------------------------
+
app.get('/',function(req,res,next){
// res.send("unauthenticated");
//});
@@ -36,8 +45,6 @@ app.get('/',function(req,res,next){
req.url = "index.html";
staticProvider(req, res, next);
});
-//app.use(stylus.middleware({src: __dirname + '/public', dest: __dirname + '/public', debug: true}));
-//app.use(express.methodOverride());
var port = process.env.PORT || 3141;
app.listen(port);
@@ -53,18 +60,22 @@ var nowjs = require("now");
var everyone = nowjs.initialize(app);
nowjs.on('connect', function () {
console.log("CONNECT > " + this.user.clientId);
- //console.log(this.user); // just clientId and cookies.
- //console.log(this.socket);
- //console.log(this.now.name);
this.user.teamID = teamID;
if(this.now.teamID != ''){
this.user.teamID = this.now.teamID;
}
console.log(" >> PROJECT="+this.user.teamID);
- this.user.grouplist = []; // file groups starts out empty.
+ // hack to get out best guess at the user (since now.js doesn't give us the request object or session!);
+ var u = Auth.getUserFromCache(decodeURIComponent(this.user.cookie['_chaos.auth'])) || {};
+ // now populate it..
this.user.about = {};
- this.user.about.name = "Default Username";
- this.user.about.email = "default@chaos.org";
+ this.user.about._id = u._id || 0;
+ this.user.about.name = u.nameGiven || u.displayName || "???";
+ this.user.about.email = u.emailPrimary || "anon@chaoscollective.org";
+ // -----
+ this.now.name = this.user.about.name;
+ // -----
+ this.user.grouplist = []; // file groups starts out empty.
addUserToFileGroup(this.user, ""); // the blank file group is the the team group.
this.now.c_confirmProject(this.user.teamID);
});
@@ -89,19 +100,20 @@ nowjs.on('disconnect', function () {
//
everyone.now.s_sendCursorUpdate = function(fname, range, changedByUser){
var userObj = this.user;
- var filegroup = nowjs.getGroup(userObj.teamID+fname);
+ var filegroup = nowjs.getGroup(userObj.teamID+"/"+fname);
filegroup.now.c_updateCollabCursor(this.user.clientId, this.now.name, range, changedByUser);
};
everyone.now.s_sendDiffPatchesToCollaborators = function(fname, patches, crc32){
var userObj = this.user;
- localFileIsMostRecent[userObj.teamID+fname] = false; // mark file as changed.
- var filegroup = nowjs.getGroup(userObj.teamID+fname);
+ localFileIsMostRecent[userObj.teamID+"/"+fname] = false; // mark file as changed.
+ var filegroup = nowjs.getGroup(userObj.teamID+"/"+fname);
filegroup.now.c_updateWithDiffPatches(this.user.clientId, patches, crc32);
};
+
everyone.now.s_requestFullFileFromUserID = function(fname, id, fileRequesterCallback){
var callerID = this.user.clientId;
var userObj = this.user;
- var filegroup = nowjs.getGroup(userObj.teamID+fname);
+ var filegroup = nowjs.getGroup(userObj.teamID+"/"+fname);
filegroup.hasClient(id, function (bool) {
if (bool) {
console.log("requesting full file. valid filegroup. :)");
@@ -115,6 +127,7 @@ everyone.now.s_requestFullFileFromUserID = function(fname, id, fileRequesterCall
}
});
};
+
everyone.now.s_teamMessageBroadcast = function(type, message){
var teamgroup = nowjs.getGroup(this.user.teamID);
var scope = "team";
@@ -141,12 +154,12 @@ everyone.now.s_getLatestFileContentsAndJoinFileGroup = function(fname, fileReque
var userObj = this.user;
addUserToFileGroup(userObj, fname);
//removeUserFromAllFileGroupsAndAddToThis(origUser, fname);
- if(localFileIsMostRecent[userObj.teamID+fname] === true || localFileIsMostRecent[userObj.teamID+fname] === undefined){
+ if(localFileIsMostRecent[userObj.teamID+"/"+fname] === true || localFileIsMostRecent[userObj.teamID+"/"+fname] === undefined){
localFileFetch(userObj, fname, fileRequesterCallback);
console.log("FILE FETCH: " + userObj.teamID + " >> " + fname + ", by user: " + callerID);
}else{
console.log("FILE FETCH (passed to user): " + userObj.teamID + " >> " + fname + ", by user: " + callerID);
- var filegroup = nowjs.getGroup(userObj.teamID+fname);
+ var filegroup = nowjs.getGroup(userObj.teamID+"/"+fname);
var users = filegroup.getUsers(function (users) {
var foundUser = false;
for (var i = 0; i < users.length; i++){
@@ -262,11 +275,20 @@ everyone.now.s_fetchProjectCommits = function(fetcherCallback){
var team = this.user.teamID;
console.log("fetching project commits... >> " + team);
var teamProjGitPath = '/NETFS/'+team;
- localRepoFetchGitLog(this.user, teamProjGitPath, "", function(err){
+ localRepoFetchGitLog(this.user, teamProjGitPath, "", function(err, gitlog){
if(err) {
console.log(err);
+ if(err && err[0] && err[0].indexOf("Not a git repository") > 0){
+ localRepoInitBare(teamProjGitPath, function(err){
+ if(err){
+ console.log("ERROR INITITIALIZING GIT REPO.");
+ }else{
+ console.log("Returned from git repo init.");
+ }
+ });
+ }
}
- fetcherCallback(err);
+ fetcherCallback(gitlog);
});
};
everyone.now.s_deployProject = function(txt, deployerCallback){
@@ -287,8 +309,8 @@ function localRepoInitBare(gitRepoPath, callback){
env: null
}, function (error, stdout, stderr) {
if (error !== null) {
- console.log('exec error: ' + error);
- }
+ console.log('git init exec error: ' + error);
+ }
console.log("GIT: Init >> " + gitRepoPath);
callback(error);
});
@@ -326,9 +348,9 @@ function localRepoFetchGitLog(userObj, gitRepoPath, fname, fetcherCallback) {
var maxResults = 5;
var saveThisEntry = false;
var filter = null;
- console.log("GIT: Commit to >> "+gitRepoPath+" by: "+safeAuthString);
+ console.log("GIT: Fetch commit logs from >> "+gitRepoPath+" by: "+safeAuthString);
var cmd = "git log -n"+maxInitialFetch+" --numstat --pretty=format:\"commit %H%naname %an%namail %ae%nrdate %ar%nutime %at%ncnote %s\" -- "+fname;
- console.log(cmd);
+ //console.log(cmd);
var child = exec(cmd, {
encoding: 'utf8',
timeout: 30000,
@@ -340,7 +362,9 @@ function localRepoFetchGitLog(userObj, gitRepoPath, fname, fetcherCallback) {
function (error, stdout, stderr) {
if (error !== null) {
console.log('exec error: ' + error);
- callback(error, null);
+ if(fetcherCallback){
+ fetcherCallback(error, null);
+ }
}else{
// success! notify team members.
var teamgroup = nowjs.getGroup(userObj.teamID);
@@ -395,7 +419,7 @@ function localRepoFetchGitLog(userObj, gitRepoPath, fname, fetcherCallback) {
}
}
//console.log(out);
- fetcherCallback(out);
+ fetcherCallback(null, out);
}
});
}
@@ -404,7 +428,10 @@ function localRepoFetchGitLog(userObj, gitRepoPath, fname, fetcherCallback) {
//
var usersInGroup = [];
function addUserToFileGroup(userObj, fname){
- var groupname = userObj.teamID + fname;
+ var groupname = userObj.teamID;
+ if(fname && fname !== ""){
+ groupname += "/" + fname;
+ }
//console.log("ADD TO GROUP: " + groupname);
//console.log(" team: " + userObj.teamID);
//console.log(" fname: " + fname);
@@ -428,7 +455,10 @@ function addUserToFileGroup(userObj, fname){
}
}
function removeUserFromFileGroup(userObj, fname){
- var groupname = userObj.teamID + fname;
+ var groupname = userObj.teamID;
+ if(fname && fname !== ""){
+ groupname += "/" + fname;
+ }
var g = nowjs.getGroup(groupname);
if(g.users[userObj.clientId]){
// user was in group.
@@ -486,7 +516,7 @@ function localFileSave(userObj, fname, fcontents, fileSaverCallback){
console.log(err);
} else {
localFileIsMostRecent[team+fname] = true; // mark file as saved with no pending changes.
- console.log("FILE SAVED: " + fname);
+ console.log("FILE SAVED: " + team+"/"+fname);
var filegroup = nowjs.getGroup(team+fname);
filegroup.now.c_fileStatusChanged(fname, "saved");
fileSizeCache[team+fname] = fcontents.length;
@@ -751,7 +781,6 @@ var Utf8 = {
}
}
-
//
//
//
View
@@ -45,11 +45,11 @@ body {
right: 0px;
top: 0px;
height: 14px;
- background: #222;
- border-bottom: 1px solid #282a2e;
+ background: #080808;
+ border-bottom: 1px solid #000;
}
#notifications {
- display: none;
+ /*display: none;*/
position: absolute;
right: 15px;
top: 45px;
@@ -108,7 +108,7 @@ body {
text-align: left;
line-height: 16px;
vertical-align: top;
- padding-left: 60px;
+ padding-left: 46px;
color: #888;
}
#topFileName{
View
@@ -48,7 +48,7 @@
<div id='shiftshiftInputDiv'><input type='text' onkeydown='return shiftshiftKeydown(event);'/></div>
</div>
<div id='logWindow'><div id='logWindowCaret'></div><div id='logWindowContent'></div></div>
-<div id='hud'><div id='hudTitle'>HUD</div><div id='hudClose' onclick='toggleHUD();'>&times;</div><div id='hudData'></div></div>
+<!--<div id='hud'><div id='hudTitle'>HUD</div><div id='hudClose' onclick='toggleHUD();'>&times;</div><div id='hudData'></div></div>-->
<pre id="editor"></pre>
@@ -71,7 +71,9 @@
<script src="js/theme-chaos.js" type="text/javascript" charset="utf-8"></script>
<script src="js/ace/mode-javascript.js" type="text/javascript" charset="utf-8"></script>
<script src="js/ace/mode-css.js" type="text/javascript" charset="utf-8"></script>
+<script src="js/ace/mode-less.js" type="text/javascript" charset="utf-8"></script>
<script src="js/ace/mode-html.js" type="text/javascript" charset="utf-8"></script>
+
<script type="text/javascript" src="./nowjs/now.js"></script>
<script src="js/diffmatchpatch/diff_match_patch.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="./js/jquery.min.js"></script>
Oops, something went wrong.

0 comments on commit 6178b18

Please sign in to comment.