Permalink
Browse files

No commit message

  • Loading branch information...
Default Username root
Default Username authored and root committed Feb 19, 2012
1 parent f5323dc commit 3919bb8de9dd3c9eb7d609d95b6d7195adb3a39b
Showing with 17,146 additions and 424 deletions.
  1. +28 −14 app.js
  2. +26 −0 app_pre.js
  3. +0 −9 less-1.2.1.min.js
  4. +0 −12 lessTEST.html
  5. +1 −0 node_modules/.bin/stylus
  6. +10 −0 node_modules/express/History.md
  7. +4 −4 node_modules/express/bin/express
  8. +1 −1 node_modules/express/lib/express.js
  9. +1 −2 node_modules/express/lib/http.js
  10. BIN node_modules/express/node_modules/connect/node_modules/formidable/.Readme.md.un~
  11. +41 −24 node_modules/express/node_modules/connect/node_modules/formidable/Readme.md
  12. +1 −0 node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js
  13. +1 −1 node_modules/express/node_modules/connect/node_modules/formidable/package.json
  14. BIN ...ress/node_modules/connect/node_modules/formidable/test/fixture/http/no-filename/.generic.http.un~
  15. BIN ..._modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/.no-filename.js.un~
  16. +11 −0 ...les/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js
  17. +35 −2 node_modules/express/node_modules/mkdirp/README.markdown
  18. +1 −1 node_modules/express/node_modules/mkdirp/examples/pow.js
  19. +72 −13 node_modules/express/node_modules/mkdirp/index.js
  20. +2 −2 node_modules/express/node_modules/mkdirp/package.json
  21. +38 −0 node_modules/express/node_modules/mkdirp/test/chmod.js
  22. +37 −0 node_modules/express/node_modules/mkdirp/test/clobber.js
  23. +32 −0 node_modules/express/node_modules/mkdirp/test/perm.js
  24. +39 −0 node_modules/express/node_modules/mkdirp/test/perm_sync.js
  25. +27 −0 node_modules/express/node_modules/mkdirp/test/sync.js
  26. +28 −0 node_modules/express/node_modules/mkdirp/test/umask.js
  27. +27 −0 node_modules/express/node_modules/mkdirp/test/umask_sync.js
  28. +4 −0 node_modules/express/node_modules/qs/.travis.yml
  29. +10 −0 node_modules/express/node_modules/qs/History.md
  30. +9 −2 node_modules/express/node_modules/qs/Readme.md
  31. +3 −0 node_modules/express/node_modules/qs/examples.js
  32. +8 −6 node_modules/express/node_modules/qs/lib/querystring.js
  33. +1 −1 node_modules/express/node_modules/qs/package.json
  34. +13 −1 node_modules/express/node_modules/qs/test/parse.js
  35. +45 −37 node_modules/express/node_modules/qs/test/stringify.js
  36. +4 −4 node_modules/express/package.json
  37. +13 −0 node_modules/gzippo/.npmignore
  38. +3 −0 node_modules/gzippo/.travis.yml
  39. +70 −0 node_modules/gzippo/README.md
  40. +2 −0 node_modules/gzippo/index.js
  41. +139 −0 node_modules/gzippo/lib/compress.js
  42. +198 −0 node_modules/gzippo/lib/staticGzip-old.js
  43. +201 −0 node_modules/gzippo/lib/staticGzip.js
  44. +19 −0 node_modules/gzippo/node_modules/mime/LICENSE
  45. +63 −0 node_modules/gzippo/node_modules/mime/README.md
  46. +93 −0 node_modules/gzippo/node_modules/mime/mime.js
  47. +22 −0 node_modules/gzippo/node_modules/mime/package.json
  48. +53 −0 node_modules/gzippo/node_modules/mime/test.js
  49. +1,510 −0 node_modules/gzippo/node_modules/mime/types/mime.types
  50. +48 −0 node_modules/gzippo/node_modules/mime/types/node.types
  51. +32 −0 node_modules/gzippo/package.json
  52. 0 node_modules/gzippo/test/fixtures/js/nestedTest.js
  53. BIN node_modules/gzippo/test/fixtures/space the final frontier/tomg.co.png
  54. +1 −0 node_modules/gzippo/test/fixtures/test.js
  55. BIN node_modules/gzippo/test/fixtures/test.js.gzip
  56. BIN node_modules/gzippo/test/fixtures/tomg.co.png
  57. BIN node_modules/gzippo/test/fixtures/user.gzip
  58. +4 −0 node_modules/gzippo/test/fixtures/user.json
  59. 0 node_modules/gzippo/test/fixtures/utf8.gz
  60. +32 −0 node_modules/gzippo/test/fixtures/utf8.txt
  61. BIN node_modules/gzippo/test/fixtures/utf8.txt.gz
  62. +88 −0 node_modules/gzippo/test/prefexTest.js
  63. +190 −0 node_modules/gzippo/test/staticGzipTest.js
  64. +22 −0 node_modules/stylus/LICENSE
  65. +605 −0 node_modules/stylus/bin/stylus
  66. +22 −0 node_modules/stylus/bm.js
  67. +2 −0 node_modules/stylus/index.js
  68. +156 −0 node_modules/stylus/lib/colors.js
  69. +130 −0 node_modules/stylus/lib/convert/css.js
  70. +58 −0 node_modules/stylus/lib/errors.js
  71. +121 −0 node_modules/stylus/lib/functions/image.js
  72. +723 −0 node_modules/stylus/lib/functions/index.js
  73. +198 −0 node_modules/stylus/lib/functions/index.styl
  74. +98 −0 node_modules/stylus/lib/functions/url.js
  75. +781 −0 node_modules/stylus/lib/lexer.js
  76. +228 −0 node_modules/stylus/lib/middleware.js
  77. +65 −0 node_modules/stylus/lib/nodes/arguments.js
  78. +54 −0 node_modules/stylus/lib/nodes/binop.js
  79. +99 −0 node_modules/stylus/lib/nodes/block.js
  80. +103 −0 node_modules/stylus/lib/nodes/boolean.js
  81. +57 −0 node_modules/stylus/lib/nodes/call.js
  82. +42 −0 node_modules/stylus/lib/nodes/charset.js
  83. +32 −0 node_modules/stylus/lib/nodes/comment.js
  84. +56 −0 node_modules/stylus/lib/nodes/each.js
  85. +193 −0 node_modules/stylus/lib/nodes/expression.js
  86. +52 −0 node_modules/stylus/lib/nodes/extend.js
  87. +55 −0 node_modules/stylus/lib/nodes/fontface.js
  88. +104 −0 node_modules/stylus/lib/nodes/function.js
  89. +80 −0 node_modules/stylus/lib/nodes/group.js
  90. +256 −0 node_modules/stylus/lib/nodes/hsla.js
  91. +127 −0 node_modules/stylus/lib/nodes/ident.js
  92. +56 −0 node_modules/stylus/lib/nodes/if.js
  93. +30 −0 node_modules/stylus/lib/nodes/import.js
  94. +75 −0 node_modules/stylus/lib/nodes/index.js
  95. +32 −0 node_modules/stylus/lib/nodes/jsliteral.js
  96. +78 −0 node_modules/stylus/lib/nodes/keyframes.js
  97. +92 −0 node_modules/stylus/lib/nodes/literal.js
  98. +42 −0 node_modules/stylus/lib/nodes/media.js
  99. +223 −0 node_modules/stylus/lib/nodes/node.js
  100. +72 −0 node_modules/stylus/lib/nodes/null.js
  101. +43 −0 node_modules/stylus/lib/nodes/page.js
  102. +72 −0 node_modules/stylus/lib/nodes/params.js
  103. +73 −0 node_modules/stylus/lib/nodes/property.js
  104. +44 −0 node_modules/stylus/lib/nodes/return.js
  105. +337 −0 node_modules/stylus/lib/nodes/rgba.js
  106. +50 −0 node_modules/stylus/lib/nodes/root.js
  107. +58 −0 node_modules/stylus/lib/nodes/selector.js
  108. +122 −0 node_modules/stylus/lib/nodes/string.js
  109. +51 −0 node_modules/stylus/lib/nodes/ternary.js
  110. +46 −0 node_modules/stylus/lib/nodes/unaryop.js
  111. +207 −0 node_modules/stylus/lib/nodes/unit.js
  112. +1,581 −0 node_modules/stylus/lib/parser.js
  113. +183 −0 node_modules/stylus/lib/renderer.js
  114. +66 −0 node_modules/stylus/lib/stack/frame.js
  115. +146 −0 node_modules/stylus/lib/stack/index.js
  116. +53 −0 node_modules/stylus/lib/stack/scope.js
  117. +103 −0 node_modules/stylus/lib/stylus.js
  118. +53 −0 node_modules/stylus/lib/token.js
  119. +26 −0 node_modules/stylus/lib/units.js
  120. +303 −0 node_modules/stylus/lib/utils.js
  121. +486 −0 node_modules/stylus/lib/visitor/compiler.js
  122. +1,183 −0 node_modules/stylus/lib/visitor/evaluator.js
  123. +31 −0 node_modules/stylus/lib/visitor/index.js
  124. +225 −0 node_modules/stylus/lib/visitor/normalizer.js
  125. +6 −0 node_modules/stylus/node_modules/cssom/.npmignore
  126. +35 −0 node_modules/stylus/node_modules/cssom/Jakefile.js
  127. +131 −0 node_modules/stylus/node_modules/cssom/lib/CSSImportRule.js
  128. +35 −0 node_modules/stylus/node_modules/cssom/lib/CSSKeyframeRule.js
  129. +37 −0 node_modules/stylus/node_modules/cssom/lib/CSSKeyframesRule.js
  130. +39 −0 node_modules/stylus/node_modules/cssom/lib/CSSMediaRule.js
  131. +39 −0 node_modules/stylus/node_modules/cssom/lib/CSSRule.js
  132. +148 −0 node_modules/stylus/node_modules/cssom/lib/CSSStyleDeclaration.js
  133. +189 −0 node_modules/stylus/node_modules/cssom/lib/CSSStyleRule.js
  134. +85 −0 node_modules/stylus/node_modules/cssom/lib/CSSStyleSheet.js
  135. +61 −0 node_modules/stylus/node_modules/cssom/lib/MediaList.js
  136. +17 −0 node_modules/stylus/node_modules/cssom/lib/StyleSheet.js
  137. +76 −0 node_modules/stylus/node_modules/cssom/lib/clone.js
  138. +14 −0 node_modules/stylus/node_modules/cssom/lib/index.js
  139. +304 −0 node_modules/stylus/node_modules/cssom/lib/parse.js
  140. +31 −0 node_modules/stylus/node_modules/cssom/package.json
  141. +4 −0 node_modules/stylus/node_modules/debug/.npmignore
  142. +35 −0 node_modules/stylus/node_modules/debug/History.md
  143. +5 −0 node_modules/stylus/node_modules/debug/Makefile
  144. +128 −0 node_modules/stylus/node_modules/debug/Readme.md
  145. +111 −0 node_modules/stylus/node_modules/debug/debug.js
  146. +19 −0 node_modules/stylus/node_modules/debug/example/app.js
  147. +24 −0 node_modules/stylus/node_modules/debug/example/browser.html
  148. +10 −0 node_modules/stylus/node_modules/debug/example/wildcards.js
  149. +22 −0 node_modules/stylus/node_modules/debug/example/worker.js
  150. +2 −0 node_modules/stylus/node_modules/debug/index.js
  151. +129 −0 node_modules/stylus/node_modules/debug/lib/debug.js
  152. +11 −0 node_modules/stylus/node_modules/debug/package.json
  153. +37 −0 node_modules/stylus/node_modules/growl/History.md
  154. +83 −0 node_modules/stylus/node_modules/growl/Readme.md
  155. +159 −0 node_modules/stylus/node_modules/growl/lib/growl.js
  156. +6 −0 node_modules/stylus/node_modules/growl/package.json
  157. +16 −0 node_modules/stylus/node_modules/growl/test.js
  158. +2 −0 node_modules/stylus/node_modules/mkdirp/.gitignore.orig
  159. +5 −0 node_modules/stylus/node_modules/mkdirp/.gitignore.rej
  160. +2 −0 node_modules/stylus/node_modules/mkdirp/.npmignore
  161. +21 −0 node_modules/stylus/node_modules/mkdirp/LICENSE
  162. +54 −0 node_modules/stylus/node_modules/mkdirp/README.markdown
  163. +6 −0 node_modules/stylus/node_modules/mkdirp/examples/pow.js
  164. +6 −0 node_modules/stylus/node_modules/mkdirp/examples/pow.js.orig
  165. +19 −0 node_modules/stylus/node_modules/mkdirp/examples/pow.js.rej
  166. +79 −0 node_modules/stylus/node_modules/mkdirp/index.js
  167. +23 −0 node_modules/stylus/node_modules/mkdirp/package.json
  168. +38 −0 node_modules/stylus/node_modules/mkdirp/test/chmod.js
  169. +37 −0 node_modules/stylus/node_modules/mkdirp/test/clobber.js
  170. +28 −0 node_modules/stylus/node_modules/mkdirp/test/mkdirp.js
  171. +32 −0 node_modules/stylus/node_modules/mkdirp/test/perm.js
  172. +39 −0 node_modules/stylus/node_modules/mkdirp/test/perm_sync.js
  173. +41 −0 node_modules/stylus/node_modules/mkdirp/test/race.js
  174. +32 −0 node_modules/stylus/node_modules/mkdirp/test/rel.js
  175. +27 −0 node_modules/stylus/node_modules/mkdirp/test/sync.js
  176. +28 −0 node_modules/stylus/node_modules/mkdirp/test/umask.js
  177. +27 −0 node_modules/stylus/node_modules/mkdirp/test/umask_sync.js
  178. +17 −0 node_modules/stylus/package.json
  179. +39 −0 node_modules/stylus/testing/test.css
  180. +21 −0 node_modules/stylus/testing/test.html
  181. +34 −0 node_modules/stylus/testing/test.js
  182. +115 −0 node_modules/stylus/testing/test.styl
  183. +134 −114 public/index.css
  184. +5 −3 public/index.html
  185. +22 −14 public/index.js
  186. +63 −11 lesstest.less → public/index.styl
  187. +0 −146 public/js/diffmatchpatch/diff_match_patch_test.html
  188. BIN public/png/favicon.png
View
42 app.js
@@ -1,4 +1,8 @@
+//
+// SERVER-SIDE
+//
// Node.JS! :)
+//
//var profiler = require("v8-profiler");
console.log("\n** Starting Node service **");
var express = require("express"); //"-unstable");
@@ -8,14 +12,24 @@ var crypto = require('crypto');
var walk = require('walk');
var spawn = require('child_process').spawn;
var exec = require('child_process').exec;
+var gzippo = require('gzippo');
+//var stylus = require('stylus');
var app = express.createServer();
-app.use(express.static(__dirname + '/public'));
+//app.use(express.static(__dirname + '/public'));
+var staticProvider = gzippo.staticGzip(__dirname + '/public'); // use GZIP compression for static files (cache ~1 day)!
+app.use(staticProvider);
+app.get('/',function(req,res,next){
+ console.log(staticProvider);
+ 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);
var thisAppDirName = __dirname.substring(__dirname.lastIndexOf("/")+1);
-//console.log("MY DIR NAME IS: " + thisAppDirName);
var teamID = "EditorDev";
if(teamID == thisAppDirName) {
@@ -88,19 +102,19 @@ everyone.now.s_requestFullFileFromUserID = function(fname, id, fileRequesterCall
}
});
};
-everyone.now.s_teamMessageBroadcast = function(type, message){
+everyone.now.s_teamMessageBroadcast = function(type, message){
var teamgroup = nowjs.getGroup(this.user.teamID);
var scope = "team";
var fromUserId = this.user.clientId;
var fromUserName = this.now.name;
teamgroup.now.c_processMessage(scope, type, message, fromUserId, fromUserName);
};
-everyone.now.s_leaveFile = function(fname){
+everyone.now.s_leaveFile = function(fname){
var teamgroup = nowjs.getGroup(this.user.teamID);
var fromUserId = this.user.clientId;
removeUserFromFileGroup(this.user, fname);
};
-everyone.now.s_sendUserEvent = function(event){
+everyone.now.s_sendUserEvent = function(event){
var teamgroup = nowjs.getGroup(this.user.teamID);
var fromUserId = this.user.clientId;
var fromUserName = this.now.name;
@@ -197,7 +211,7 @@ everyone.now.s_getAllProjectsFiles = function(callback){
everyone.now.s_createNewFile = function(newFilename, fileCreatorCallback){
localFileCreate(this.user, newFilename, fileCreatorCallback);
};
-everyone.now.s_deleteFile = function(fname, fileDeleterCallback){
+everyone.now.s_deleteFile = function(fname, fileDeleterCallback){
var usersInFile = usersInGroup[this.user.teamID+fname];
if(usersInFile === undefined || usersInFile === 0){
localFileDelete(this.user, fname, fileDeleterCallback);
@@ -206,7 +220,7 @@ everyone.now.s_deleteFile = function(fname, fileDeleterCallback){
fileCallback(fname, ["Cannot delete file. There are users in it!"]);
}
};
-everyone.now.s_renameFile = function(fname, newFName, fileRenamerCallback){
+everyone.now.s_renameFile = function(fname, newFName, fileRenamerCallback){
var usersInFile = usersInGroup[this.user.teamID+fname];
if(usersInFile === undefined || usersInFile === 0){
localFileRename(this.user, fname, newFName, fileRenamerCallback);
@@ -415,7 +429,7 @@ function localFileCreate(userObj, fname, fileCreatorCallback){
if(!fname){
return;
}
- var safeFName = fname.split("..").join("").replace(/[^a-zA-Z_\.\-0-9]+/g, '');
+ var safeFName = fname.split("..").join("").replace(/[^a-zA-Z_\.\-0-9\/\(\)]+/g, '');
var path = '/NETFS/'+team+"/"+safeFName;
try{
fs.realpathSync(path);
@@ -444,7 +458,7 @@ function localFileDelete(userObj, fname, fileDeleterCallback){
if(!fname){
return;
}
- var safeFName = fname.split("..").join("").replace(/[^a-zA-Z_\.\-0-9]+/g, '');
+ var safeFName = fname.split("..").join("").replace(/[^a-zA-Z_\.\-0-9\/\(\)]+/g, '');
var path = '/NETFS/'+team+"/"+safeFName;
try{
fs.realpathSync(path);
@@ -467,8 +481,8 @@ function localFileRename(userObj, fname, newFName, fileRenamerCallback){
if(!fname || !newFName){
return;
}
- var safeFName = fname.split("..").join("").replace(/[^a-zA-Z_\.\-0-9]+/g, '');
- var safeNewFName = newFName.split("..").join("").replace(/[^a-zA-Z_\.\-0-9]+/g, '');
+ var safeFName = fname.split("..").join("").replace(/[^a-zA-Z_\.\-0-9\/\(\)]+/g, '');
+ var safeNewFName = newFName.split("..").join("").replace(/[^a-zA-Z_\.\-0-9\/\(\)]+/g, '');
var pathA = '/NETFS/'+team+"/"+safeFName;
var pathB = '/NETFS/'+team+"/"+safeNewFName;
try{
@@ -500,8 +514,8 @@ function localFileDuplicate(userObj, fname, newFName, fileDuplicatorCallback){
if(!fname || !newFName){
return;
}
- var safeFName = fname.split("..").join("").replace(/[^a-zA-Z_\.\-0-9]+/g, '');
- var safeNewFName = newFName.split("..").join("").replace(/[^a-zA-Z_\.\-0-9]+/g, '');
+ var safeFName = fname.split("..").join("").replace(/[^a-zA-Z_\.\-0-9\/\(\)]+/g, '');
+ var safeNewFName = newFName.split("..").join("").replace(/[^a-zA-Z_\.\-0-9\/\(\)]+/g, '');
var pathA = '/NETFS/'+team+"/"+safeFName;
var pathB = '/NETFS/'+team+"/"+safeNewFName;
try{
@@ -568,7 +582,7 @@ function localProjectDeploy(userObj, deployerCallback){
console.log("DEPLOY SUCCESSFUL: " + launchURL);
setTimeout(function(){
deployerCallback(null, launchURL);
- }, 500);
+ }, 1500);
}
); // exec 2
}
View
@@ -0,0 +1,26 @@
+//
+// SERVER-SIDE
+//
+// things to do before launch.. like compiling things!
+//
+
+console.log("PreLaunch..........");
+var util = require("util");
+var fs = require('fs');
+var stylus = require('stylus');
+function renderStylusToCSSFile(fnameRoot){
+ var fileBase = __dirname+"/public/"+fnameRoot;
+ stylus(fs.readFileSync(fileBase+".styl", "utf8")).set('filename', fileBase+'.css').render(function(err, css){
+ if (err) {
+ console.log("ERR: Stylus parse error >> " + fileBase+ " >> " + err);
+ }else{
+ fs.writeFileSync(fileBase+".css", "/*\n// NOTE: Do not edit this CSS file directly. It is generated automatically on LAUNCH.\n// Edit the Stylus file ("+fnameRoot+".styl) instead... :) \n*/\n\n"+css, "utf8");
+ console.log("Stylus Rendered >> " + fileBase+".styl to .css");
+ }
+ });
+}
+
+// call out each stylus file to render pre-launch here...
+renderStylusToCSSFile("index");
+
+console.log("PreLaunch complete.");
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,12 +0,0 @@
-<html>
- <head>
-
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
- <title>Less Test</title>
- <link rel="stylesheet/less" type="text/css" href="styles.less">
- <script src="less-1.2.1.min.js" type="text/javascript"></script>
-
- </head>
-
-</html>
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 3919bb8

Please sign in to comment.