Permalink
Browse files

Merge branch 'next/3' into 'feature/node'

Massive merge I'm sure nearly everything is broken :)

Conflicts:
	config.default.php
	index.php
	js/chrome/download.js
	public/app.php
	public/font/fontawesome-webfont.eot
	public/font/fontawesome-webfont.svg
	public/font/fontawesome-webfont.svgz
	public/font/fontawesome-webfont.ttf
	public/font/fontawesome-webfont.woff
	public/font/pictos-web.eot
	public/font/pictos-web.svg
	public/font/pictos-web.ttf
	public/font/pictos-web.woff
	public/js/chrome/login.js
	public/js/chrome/navigation.js
	public/js/jsbin.js
  • Loading branch information...
aron committed May 25, 2012
2 parents 20d6eeb + a00ec0c commit 54bdaa6280e5aab07076c7dee1dfcdd7f0d14476
Showing with 2,932 additions and 1,659 deletions.
  1. +3 −1 .htaccess
  2. +1 −1 TODO.md
  3. +17 −0 custom/sebly/config.json
  4. +154 −0 custom/sebly/creativejs.js
  5. +10 −0 custom/sebly/custom.css
  6. +14 −0 custom/sebly/default.html
  7. +273 −0 index.php
  8. +97 −24 public/app.php
  9. +1 −1 public/css/style
  10. +178 −444 public/css/style.css
  11. BIN public/favicon.ico
  12. BIN public/font/fontawesome-webfont.eot
  13. +0 −175 public/font/fontawesome-webfont.svg
  14. BIN public/font/fontawesome-webfont.svgz
  15. BIN public/font/fontawesome-webfont.ttf
  16. BIN public/font/fontawesome-webfont.woff
  17. BIN public/font/mensch-webfont.eot
  18. +0 −257 public/font/mensch-webfont.svg
  19. BIN public/font/mensch-webfont.ttf
  20. BIN public/font/mensch-webfont.woff
  21. BIN public/font/meslolgm-dz-regular-webfont.eot
  22. +241 −0 public/font/meslolgm-dz-regular-webfont.svg
  23. BIN public/font/meslolgm-dz-regular-webfont.ttf
  24. BIN public/font/meslolgm-dz-regular-webfont.woff
  25. BIN public/font/pictos-web.eot
  26. +0 −114 public/font/pictos-web.svg
  27. BIN public/font/pictos-web.ttf
  28. BIN public/font/pictos-web.woff
  29. BIN public/images/jsbin_header.png
  30. BIN public/images/logo.png
  31. BIN public/images/logo2.png
  32. BIN public/images/popout.png
  33. +2 −1 public/index.php
  34. +66 −0 public/js/chrome/analytics.js
  35. +1 −3 public/js/chrome/esc.js
  36. +1 −1 public/js/chrome/file-drop.js
  37. +2 −0 public/js/chrome/gist.js
  38. +1 −0 public/js/chrome/login.js
  39. +116 −28 public/js/chrome/navigation.js
  40. +31 −5 public/js/chrome/save.js
  41. +18 −3 public/js/chrome/splitter.js
  42. +1 −0 public/js/editors/codemirror.js
  43. +79 −24 public/js/editors/editors.js
  44. +5 −2 public/js/editors/keycontrol.js
  45. +16 −5 public/js/editors/library.js
  46. +36 −18 public/js/editors/panel.js
  47. +14 −3 public/js/jsbin.js
  48. +90 −44 public/js/render/live.js
  49. +3 −1 public/js/render/render.js
  50. +244 −119 public/js/vendor/codemirror2/codemirror.js
  51. +1 −1 public/js/vendor/codemirror2/css.js
  52. +4 −2 public/js/vendor/codemirror2/htmlmixed.js
  53. +7 −6 public/js/vendor/codemirror2/javascript.js
  54. +1 −1 public/js/vendor/codemirror2/overlay.js
  55. +117 −0 public/js/vendor/codemirror2/searchcursor.js
  56. +120 −28 public/js/vendor/codemirror2/xml.js
  57. +939 −344 public/js/vendor/jshint/jshint.js
  58. +28 −3 views/index.html
View
@@ -1,3 +1,5 @@
+php_flag magic_quotes_gpc Off
+
<IfModule mod_rewrite.c>
# $Id: .htaccess,v 1.3 2006/11/09 09:08:14 remy Exp $
@@ -12,4 +14,4 @@ RewriteRule ^(.*)$ http://jsbin.com/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !public
RewriteRule (.*) /public/$1 [L]
-</IfModule>
+</IfModule>
View
@@ -8,7 +8,7 @@
# Logo
-- Hire and pay (unless they donate) to get a flipping logo. The crappy orange/black thing is lame Mr Sharp.
+- Get logo in
# URLs
View
@@ -0,0 +1,17 @@
+{
+ "css": "custom/sebly/custom.css",
+ "default": {
+ "html": "default.html",
+ "javascript": "var canvas = document.getElementById('creativejs'), \n c = canvas.getContext('2d');"
+ },
+ "settings": {
+ "codemirror": {
+ "indentWithTabs": true,
+ "indentUnit": 4,
+ "smartIndent": false,
+ "electricChars": false,
+ "tabSize": 4
+ },
+ "panels": ["javascript", "live"]
+ }
+}
View
@@ -0,0 +1,154 @@
+// canvas augmentation!
+
+var p = CanvasRenderingContext2D.prototype;
+p.circle = function(x, y, radius) {
+ this.beginPath();
+ this.arc(x, y, radius, 0, Math.PI*2, true);
+};
+p.fillCircle = function(x, y, radius) {
+ this.circle(x, y, radius);
+ this.fill();
+};
+p.strokeCircle = function(x, y, radius) {
+ this.circle(x, y, radius);
+ this.stroke();
+};
+p.ellipse = function(x, y, width, height) {
+ this.beginPath();
+ for(var i=0;i<Math.PI*2;i+=Math.PI/16) {
+ this.lineTo(x+(Math.cos(i)*width/2), y+(Math.sin(i)*height/2));
+
+ }
+ this.closePath();
+};
+p.fillEllipse = function(x, y, width, height) {
+ this.ellipse(x,y,width, height);
+ this.fill();
+};
+p.strokeEllipse = function(x, y, width, height) {
+ this.ellipse(x,y,width, height);
+ this.stroke();
+};
+
+p.line = function (x1, y1, x2, y2){
+ this.beginPath();
+ this.moveTo(x1,y1);
+ this.lineTo(x2,y2);
+ this.stroke();
+};
+
+function radians(deg) {return deg*Math.PI/180;};
+function degrees(rad) {return rad*180/Math.PI;};
+
+function randomInteger(min, max) {
+ if(max===undefined) {
+ max = min;
+ min = 0;
+ }
+ return Math.floor(Math.random() * (max+1-min)) +min;
+}
+function random(min, max) {
+ if(min===undefined) {
+ min = 0;
+ max = 1;
+ } else if(max=== undefined) {
+ max = min;
+ min = 0;
+ }
+ return (Math.random() * (max-min)) + min;
+};
+
+function map(value, min1, max1, min2, max2, clampResult) {
+ var returnvalue = ((value-min1) / (max1 - min1) * (max2-min2)) + min2;
+ if(clampResult) return clamp(returnvalue, min2, max2);
+ else return returnvalue;
+};
+
+function clamp(value, min, max) {
+ if(max<min) {
+ var temp = min;
+ min = max;
+ max = temp;
+
+ }
+ return Math.max(min, Math.min(value, max));
+};
+
+function dist(x1, y1, x2, y2) {
+ x2-=x1; y2-=y1;
+ return Math.sqrt((x2*x2) + (y2*y2));
+}
+
+
+
+var mouseX = 0,
+ mouseY = 0,
+ lastMouseX = 0,
+ lastMouseY = 0,
+ frameRate = 60,
+ lastUpdate = Date.now(),
+ mouseDown = false;
+
+function cjsloop() {
+ //console.log("cjsloop",this);
+ var now = Date.now();
+ var elapsedMils = now - lastUpdate;
+
+ requestAnimationFrame(cjsloop);
+
+ if((typeof window.draw == 'function') && (elapsedMils>=(1000/this.frameRate))) {
+ window.draw();
+
+ lastUpdate = now;
+ lastMouseX = mouseX;
+ lastMouseY = mouseY;
+ }
+
+
+};
+
+document.body.addEventListener('mousemove', function(e) {
+ mouseX = e.clientX;
+ mouseY = e.clientY;
+});
+
+document.body.addEventListener('mousedown', function(e){mouseDown =true; if(typeof onMouseDown == 'function') onMouseDown() ;});
+document.body.addEventListener('mouseup', function(e){mouseDown = false;if(typeof onMouseUp == 'function') onMouseDown() ;});
+document.body.addEventListener('keydown', function(e){if(typeof onKeyDown == 'function') onKeyDown(e) ;});
+
+
+
+// requestAnimationFrame
+// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
+// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
+
+// requestAnimationFrame polyfill by Erik Möller
+// fixes from Paul Irish and Tino Zijdel
+
+(function() {
+ var lastTime = 0;
+ var vendors = ['ms', 'moz', 'webkit', 'o'];
+ for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
+ window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
+ window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame']
+ || window[vendors[x]+'CancelRequestAnimationFrame'];
+ }
+
+ if (!window.requestAnimationFrame)
+ window.requestAnimationFrame = function(callback, element) {
+ var currTime = new Date().getTime();
+ var timeToCall = Math.max(0, 16 - (currTime - lastTime));
+ var id = window.setTimeout(function() { callback(currTime + timeToCall); },
+ timeToCall);
+ lastTime = currTime + timeToCall;
+ return id;
+ };
+
+ if (!window.cancelAnimationFrame)
+ window.cancelAnimationFrame = function(id) {
+ clearTimeout(id);
+ };
+}());
+
+
+window.addEventListener('load',cjsloop);
View
@@ -0,0 +1,10 @@
+.editbox .CodeMirror {
+ line-height: 1.2em;
+ font-family: Menlo, MenschRegular, Monaco, consolas, monospace;
+ font-size: 16px;
+}
+
+.html > .label label,
+.html > .label select {
+ display: none;
+}
View
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>CreativeJS graphics playground</title>
+ <style>
+ canvas { border : 1px lightgray solid; }
+ body { margin :0; }
+ </style>
+ </head>
+ <body>
+ <script src="/custom/sebly/creativejs.js"></script>
+ <canvas id="creativejs" width='200' height='200'></canvas>
+ </body>
+</html>
Oops, something went wrong.

0 comments on commit 54bdaa6

Please sign in to comment.