Permalink
Please sign in to comment.
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...
Showing
with
2,932 additions
and 1,659 deletions.
- +3 −1 .htaccess
- +1 −1 TODO.md
- +17 −0 custom/sebly/config.json
- +154 −0 custom/sebly/creativejs.js
- +10 −0 custom/sebly/custom.css
- +14 −0 custom/sebly/default.html
- +273 −0 index.php
- +97 −24 public/app.php
- +1 −1 public/css/style
- +178 −444 public/css/style.css
- BIN public/favicon.ico
- BIN public/font/fontawesome-webfont.eot
- +0 −175 public/font/fontawesome-webfont.svg
- BIN public/font/fontawesome-webfont.svgz
- BIN public/font/fontawesome-webfont.ttf
- BIN public/font/fontawesome-webfont.woff
- BIN public/font/mensch-webfont.eot
- +0 −257 public/font/mensch-webfont.svg
- BIN public/font/mensch-webfont.ttf
- BIN public/font/mensch-webfont.woff
- BIN public/font/meslolgm-dz-regular-webfont.eot
- +241 −0 public/font/meslolgm-dz-regular-webfont.svg
- BIN public/font/meslolgm-dz-regular-webfont.ttf
- BIN public/font/meslolgm-dz-regular-webfont.woff
- BIN public/font/pictos-web.eot
- +0 −114 public/font/pictos-web.svg
- BIN public/font/pictos-web.ttf
- BIN public/font/pictos-web.woff
- BIN public/images/jsbin_header.png
- BIN public/images/logo.png
- BIN public/images/logo2.png
- BIN public/images/popout.png
- +2 −1 public/index.php
- +66 −0 public/js/chrome/analytics.js
- +1 −3 public/js/chrome/esc.js
- +1 −1 public/js/chrome/file-drop.js
- +2 −0 public/js/chrome/gist.js
- +1 −0 public/js/chrome/login.js
- +116 −28 public/js/chrome/navigation.js
- +31 −5 public/js/chrome/save.js
- +18 −3 public/js/chrome/splitter.js
- +1 −0 public/js/editors/codemirror.js
- +79 −24 public/js/editors/editors.js
- +5 −2 public/js/editors/keycontrol.js
- +16 −5 public/js/editors/library.js
- +36 −18 public/js/editors/panel.js
- +14 −3 public/js/jsbin.js
- +90 −44 public/js/render/live.js
- +3 −1 public/js/render/render.js
- +244 −119 public/js/vendor/codemirror2/codemirror.js
- +1 −1 public/js/vendor/codemirror2/css.js
- +4 −2 public/js/vendor/codemirror2/htmlmixed.js
- +7 −6 public/js/vendor/codemirror2/javascript.js
- +1 −1 public/js/vendor/codemirror2/overlay.js
- +117 −0 public/js/vendor/codemirror2/searchcursor.js
- +120 −28 public/js/vendor/codemirror2/xml.js
- +939 −344 public/js/vendor/jshint/jshint.js
- +28 −3 views/index.html
@@ -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"] | ||
+ } | ||
+} |
@@ -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); |
@@ -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; | ||
+} |
@@ -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