From 96e80cfecdea76dda6b473fed96c47cbc61a1921 Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Thu, 5 Jan 2012 01:56:09 -0500 Subject: [PATCH 01/64] Fixed bind issue --- Gitgraph.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gitgraph.js b/Gitgraph.js index 6e3c890..5a9aa47 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -98,6 +98,8 @@ var Gitgraph = function(args){ this.width = 416; this.height = 20; this.node = args.domNode ? args.domNode : document.body; + if (!Function.prototype.bind) + Function.prototype.bind = this.bind; if(!window.dojo) this.loadScript('http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo.js',this.kickStart.bind(this)); From 707e383cbc73e8d7de1113811605cb07c48450bb Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Thu, 5 Jan 2012 09:10:54 -0500 Subject: [PATCH 02/64] Updated readme --- README.markdown | 2 ++ demo/index.html | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README.markdown b/README.markdown index 58e5fbe..353d67a 100644 --- a/README.markdown +++ b/README.markdown @@ -34,6 +34,8 @@ Pure JS github participation graph using canvas element. To see it in action, vi ```console $('#demoHolder').gitgraph({user:'bouchon',repo:'coweb'}); ``` + +FYI, the script uses a little Dojo, and will require it if its not already loaded. Nothing to worry about! ##Issues & Features diff --git a/demo/index.html b/demo/index.html index ba0857d..b81bd3a 100644 --- a/demo/index.html +++ b/demo/index.html @@ -44,6 +44,8 @@ Or use it as a jQuery plugin
 $('#demoHolder').gitgraph({user:'bouchon',repo:'coweb'});
+ + FYI, the script uses a little Dojo, and will require it if its not already loaded. Nothing to worry about!

Issues & Features
Report any issues and features (I'm sure I missed a lot of stuff) on Github. From 2c879b94e9de24f68c67773cef414c2f04b57183 Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Thu, 5 Jan 2012 12:52:16 -0500 Subject: [PATCH 03/64] Added parameter indicating whether or not to stretch width to container node --- Gitgraph.js | 13 ++++++++++--- README.markdown | 9 +++++++-- demo/index.html | 9 +++++++-- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/Gitgraph.js b/Gitgraph.js index 5a9aa47..9447248 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -12,8 +12,10 @@ var Gitgraph = function(args){ var img = dojo.create('img',{ src:'https://a248.e.akamai.net/assets.github.com/images/modules/dashboard/dossier/participation_legend.png?1315937721', - style:'position:relative;top:-4px' + style:'position:relative;top:-4px;' },this.graphContainer); + if(this.stretch) + dojo.style(img,'width',this.width+'px'); var context = this.canvas.getContext("2d"), width = this.width / this.total.length, height = this.height, @@ -89,15 +91,20 @@ var Gitgraph = function(args){ preventCache: true, load: dojo.hitch(this,function(data){ this.data = data; + this.width = this.graphContainer.offsetWidth-14; + if(!this.stretch){ + this.width = 416; + dojo.style(this.graphContainer,'width','430px'); + } this.go(); }) }); }); }; - this.width = 416; this.height = 20; this.node = args.domNode ? args.domNode : document.body; + this.stretch = args.stretch ? args.stretch : false; if (!Function.prototype.bind) Function.prototype.bind = this.bind; @@ -110,7 +117,7 @@ var Gitgraph = function(args){ this.graphContainer = document.createElement('div'); this.graphContainer.innerHTML = ''; this.graphContainer.style.cssText = 'border-radius:3px;border:1px solid #E5E5E5;' - +'background:white;height:55px;width:430px;text-align:center;'; + +'background:white;height:55px;text-align:center;'; this.node.appendChild(this.graphContainer); return this.graphContainer; diff --git a/README.markdown b/README.markdown index 353d67a..21f8774 100644 --- a/README.markdown +++ b/README.markdown @@ -25,14 +25,19 @@ Pure JS github participation graph using canvas element. To see it in action, vi var graph = new Gitgraph({ user : 'bouchon', // any github username repo : 'coweb', // name of repo - domNode : document.body, // domNode to attach to (optional) + domNode : document.body, // (optional) domNode to attach to + stretch : false // (optional) stretch to fit container? }); ``` * Or use it as a jQuery plugin ```console - $('#demoHolder').gitgraph({user:'bouchon',repo:'coweb'}); + $('#demoHolder').gitgraph({ + user:'bouchon', // any github username + repo:'coweb', // name of repo + stretch : false // (optional) stretch to fit container? + }); ``` FYI, the script uses a little Dojo, and will require it if its not already loaded. Nothing to worry about! diff --git a/demo/index.html b/demo/index.html index b81bd3a..063584f 100644 --- a/demo/index.html +++ b/demo/index.html @@ -39,11 +39,16 @@ var graph = new Gitgraph({ user : 'bouchon', // any github username repo : 'coweb', // name of repo - domNode : document.body, // domNode to attach to (optional) + domNode : document.body, // domNode to attach to (optional), + stretch : false // (optional) stretch to fit container? }); Or use it as a jQuery plugin
-$('#demoHolder').gitgraph({user:'bouchon',repo:'coweb'});
+$('#demoHolder').gitgraph({ + user:'bouchon', // any github username + repo:'coweb', // name of repo + stretch : false // (optional) stretch to fit container? +}); FYI, the script uses a little Dojo, and will require it if its not already loaded. Nothing to worry about!

Issues & Features
From d0c994cb61dfba065e7453851b84fc5b3f92dfc6 Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Thu, 5 Jan 2012 13:17:52 -0500 Subject: [PATCH 04/64] Graph container width updates. Minor --- Gitgraph.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gitgraph.js b/Gitgraph.js index 9447248..044d62e 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -92,10 +92,8 @@ var Gitgraph = function(args){ load: dojo.hitch(this,function(data){ this.data = data; this.width = this.graphContainer.offsetWidth-14; - if(!this.stretch){ + if(!this.stretch) this.width = 416; - dojo.style(this.graphContainer,'width','430px'); - } this.go(); }) }); @@ -118,6 +116,8 @@ var Gitgraph = function(args){ this.graphContainer.innerHTML = ''; this.graphContainer.style.cssText = 'border-radius:3px;border:1px solid #E5E5E5;' +'background:white;height:55px;text-align:center;'; + if(!this.stretch) + dojo.style(this.graphContainer,'width','430px'); this.node.appendChild(this.graphContainer); return this.graphContainer; From ece8275d38b2f7a05689e0efa068b98a5f17ee0f Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Thu, 5 Jan 2012 13:20:53 -0500 Subject: [PATCH 05/64] Readme screenshot update --- README.markdown | 2 +- demo/images/screenshot-new.png | Bin 0 -> 9643 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 demo/images/screenshot-new.png diff --git a/README.markdown b/README.markdown index 21f8774..512ac9d 100644 --- a/README.markdown +++ b/README.markdown @@ -2,7 +2,7 @@ Pure JS github participation graph using canvas element. To see it in action, visit [gitgraph.logicalcognition.com](http://gitgraph.logicalcognition.com). -![Alt text](http://logicalcognition.com/Projects/Gitgraph/demo/images/screenshot.png) +![Alt text](http://logicalcognition.com/Projects/Gitgraph/demo/images/screenshot-new.png) ##Supported Browsers diff --git a/demo/images/screenshot-new.png b/demo/images/screenshot-new.png new file mode 100644 index 0000000000000000000000000000000000000000..a0c4bba0a58679e72fb0180e87411dd6d894b54f GIT binary patch literal 9643 zcmX|l1yEc~(={3_xCM8&1b4T^B?Nbe;KAKJi|gVcI0Sch5AG7&9d_}bJbAyrs;^Ad zz0>D(_e`ChNEIa+RAfSAC@3gYfUKk%6clvx+q)#u2XuwDyWrd_*uQS`G+sS~Bej-^5eEY5jRo8_3#8AIBE@C1O0}r7PQKNq@ z5+28Af%J!(0HRQB0f^L4z#{k0A(i#@@Q|EIuoILWk8sNB{H@5+i#KdL&>@KjDvoRV zWEXpvBx;igs%v~5Gsz0-_sRp@c0N_Zr79eUDh4d3k3G@j>p;cI;xP~D@}KI)IT??i zP`Q*IUTRO!WS7 zEDwC`{8d!6Ai^&s^!(c0IT$2MNkRlCEfwNHd-8PodXJ16DYj?3Z!ESR5@98zyE7U# zMx<+0S0WUYj=_wLVOq0~&Mo`?m;36T)Pa(*L2CuZSb!1PIlZqLD|9|W6e=3e#(eF# z%i`cd7e@C`X@FdT$?3~hbR_gc>+1zCyk~~pV@$|JotGNMP3y)>gw?SfQG=^eNa#re zBsle%UV7yLlRxG*mc35mqY3O7u447ZPb%(SHNQaVpNP^Ap|_OcZu6_$Ko*(-H*e-3 z#Jfw>m1|AzmBE=V;yf3M8+Ie;n?PuCs&hw-peK5A3<&u~=eKkJsZ&u(2vko1TZA~Z z8}BOY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}heQHa@;y8hi6I-M)b(Gcc~?`!pz+Ys@xy3o-WO!o=Lxfa zj0xx-eMeLjrA`O$&H_>&1hMXOi?*TD(SrEAiCyXw;6cAwK&A*{V>d;UxgBC8zt@hO zLgJZJQ-`^Dd9~8WyIUOVszvd{Nc9(G7sI-b)JaKE9xTMva=HdWEP4|06%NF7XK)AL zglmIa{)Cc#tpZc30O1xtU=7LgdT_fzXy-p@8k9#DL-nc!fVAAYVhEZteJK&L)GySDS3{rk4UKN|&?A_}HmV#_Y9aF-Ir_vr_Lgqp8j4BSj0aj7Tt6A(S6%`|MwxP%w+equJ*-I(#3a zK5i0`DjGB|>SMHuZ$*qn$DYeuDrxs0DHHEux%o$#cCIU;MO?0qv=&X4D4o^HkDk)v4?HC zNLJR-wmzE5IZd0MWh+!lV%Z6$Gh$%hJ{nkp88q5BfoNg)OdJyC(0g`!U#xb>*1!|o zWPN6vU`>t`ZO4$UrOp3Z?dJA=-gvxPI`}wAFeqIg9{w0%LmfyyysvF6qEqRB`iS*l z3j20&R}uEiz@6uvP`P`A-H}JTzlJiG zJQdgamg=8E=X=w&WASAY|HOAWBK?rLl+N=%#(q&}WM2>``PT?Uh!Vhgn8@idB0J{@`(C}Z4LAo|5hV)$6gfT|q9fo_ z*+C?osi~=ft*z}J>*?lS;&T7IMTo*dw?4|AI2Y!V%M?ycslM*oE&xc(J}tl^4s|0M7aiZ_yB2}l2Co~3ys*+R_C!19lCSQlGu YPpePHrv}%zRu2jwr6gG?ZWQ$Y0F^6r#Q*>R literal 0 HcmV?d00001 From ab889bc8293f9036ddf709edafb835aa6f6563d5 Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Thu, 5 Jan 2012 15:13:21 -0500 Subject: [PATCH 06/64] Removed stretch parameter, using optional width parameter instead --- Gitgraph.js | 9 +++------ README.markdown | 4 ++-- demo/index.html | 4 ++-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Gitgraph.js b/Gitgraph.js index 044d62e..dd45f2a 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -12,7 +12,7 @@ var Gitgraph = function(args){ var img = dojo.create('img',{ src:'https://a248.e.akamai.net/assets.github.com/images/modules/dashboard/dossier/participation_legend.png?1315937721', - style:'position:relative;top:-4px;' + style:'position:relative;top:-4px;width:'+this.width+'px;' },this.graphContainer); if(this.stretch) dojo.style(img,'width',this.width+'px'); @@ -91,9 +91,6 @@ var Gitgraph = function(args){ preventCache: true, load: dojo.hitch(this,function(data){ this.data = data; - this.width = this.graphContainer.offsetWidth-14; - if(!this.stretch) - this.width = 416; this.go(); }) }); @@ -112,12 +109,12 @@ var Gitgraph = function(args){ this.kickStart.bind(this)(); } + this.width = args.width ? parseInt(args.width.substring(0,args.width.length-2)) : 416; this.graphContainer = document.createElement('div'); this.graphContainer.innerHTML = ''; this.graphContainer.style.cssText = 'border-radius:3px;border:1px solid #E5E5E5;' +'background:white;height:55px;text-align:center;'; - if(!this.stretch) - dojo.style(this.graphContainer,'width','430px'); + dojo.style(this.graphContainer,'width',(this.width+14)+'px'); this.node.appendChild(this.graphContainer); return this.graphContainer; diff --git a/README.markdown b/README.markdown index 512ac9d..24d1ec9 100644 --- a/README.markdown +++ b/README.markdown @@ -26,7 +26,7 @@ Pure JS github participation graph using canvas element. To see it in action, vi user : 'bouchon', // any github username repo : 'coweb', // name of repo domNode : document.body, // (optional) domNode to attach to - stretch : false // (optional) stretch to fit container? + width : '416px' // (optional) custom graph width }); ``` @@ -36,7 +36,7 @@ Pure JS github participation graph using canvas element. To see it in action, vi $('#demoHolder').gitgraph({ user:'bouchon', // any github username repo:'coweb', // name of repo - stretch : false // (optional) stretch to fit container? + width: '416px' // (optional) custom graph width }); ``` diff --git a/demo/index.html b/demo/index.html index 063584f..fcc7f4a 100644 --- a/demo/index.html +++ b/demo/index.html @@ -40,14 +40,14 @@ user : 'bouchon', // any github username repo : 'coweb', // name of repo domNode : document.body, // domNode to attach to (optional), - stretch : false // (optional) stretch to fit container? + width : '416px' // (optional) custom graph width }); Or use it as a jQuery plugin
 $('#demoHolder').gitgraph({
 	user:'bouchon',    // any github username
 	repo:'coweb',      // name of repo
-	stretch : false    // (optional) stretch to fit container?
+	width:'416px'      // (optional) custom graph width
 });
FYI, the script uses a little Dojo, and will require it if its not already loaded. Nothing to worry about!

From 17bcc8c385d00534e2c6c23cfac922f0c59053b5 Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Thu, 5 Jan 2012 15:25:48 -0500 Subject: [PATCH 07/64] jQuery plugin compatability update --- Gitgraph.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Gitgraph.js b/Gitgraph.js index dd45f2a..9db16dc 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -131,6 +131,7 @@ if (window.jQuery) { user : args.user, domNode : $(this)[0], repo : args.repo + width: args.width ? args.width || '416px' }); }); } From 525cdc411cc1464561e22596761b9517e2020b26 Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Fri, 6 Jan 2012 10:47:37 -0500 Subject: [PATCH 08/64] Touch up on jQuery plugin integration --- Gitgraph.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Gitgraph.js b/Gitgraph.js index 9db16dc..15fb6ad 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -86,7 +86,7 @@ var Gitgraph = function(args){ dojo.ready(this, function(){ //Get particiption data dojo.xhrGet({ - url: 'http://logicalcognition.com/files/gitgraph.php?user='+args.user+'&repo='+args.repo, + url: 'http://logicalcognition.com/files/gitgraphFiles/gitgraph.php?user='+args.user+'&repo='+args.repo, handleAs: 'json', preventCache: true, load: dojo.hitch(this,function(data){ @@ -99,7 +99,6 @@ var Gitgraph = function(args){ this.height = 20; this.node = args.domNode ? args.domNode : document.body; - this.stretch = args.stretch ? args.stretch : false; if (!Function.prototype.bind) Function.prototype.bind = this.bind; @@ -130,8 +129,8 @@ if (window.jQuery) { var view = new Gitgraph({ user : args.user, domNode : $(this)[0], - repo : args.repo - width: args.width ? args.width || '416px' + repo : args.repo, + width: args.width ? args.width : '416px' }); }); } From d07afb6e3563574ff86335e513b0a45ff91c129c Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Fri, 6 Jan 2012 13:05:28 -0500 Subject: [PATCH 09/64] Code bath for organization --- Gitgraph.js | 85 +++++++++++++++++++++---------------------------- demo/index.html | 1 + package.json | 32 ------------------- 3 files changed, 37 insertions(+), 81 deletions(-) delete mode 100644 package.json diff --git a/Gitgraph.js b/Gitgraph.js index 15fb6ad..db395b2 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -1,21 +1,25 @@ var Gitgraph = function(args){ if(!args || !args.user || !args.repo){ throw new Error('Gitgraph: missing user and/or repo arg '); - }else{ + }else{ + + //Rips through data point arrays and renders canvas this.go = function(){ - this.total = this.data.all; - this.own = this.data.owner; + //1. Vars + this.total = this.data.all; //array of all commit data points + this.own = this.data.owner; //array of just your commit data points - //Populate canvas + //2. Create canvas this.graphContainer.innerHTML = ''; this.canvas = dojo.create('canvas',{width:this.width,height:this.height,style:'position:relative;margin-top:11px;'},this.graphContainer); - + + //3. Create bottom of graph img var img = dojo.create('img',{ src:'https://a248.e.akamai.net/assets.github.com/images/modules/dashboard/dossier/participation_legend.png?1315937721', style:'position:relative;top:-4px;width:'+this.width+'px;' },this.graphContainer); - if(this.stretch) - dojo.style(img,'width',this.width+'px'); + + ///4. Populate canvas with data points var context = this.canvas.getContext("2d"), width = this.width / this.total.length, height = this.height, @@ -31,57 +35,41 @@ var Gitgraph = function(args){ dojo.forEach(this.own, render); }; + //Dynamically load JS this.loadScript = function(sScriptSrc,callbackfunction) { - //gets document head element var oHead = document.getElementsByTagName('head')[0]; - if(oHead){ - //creates a new script tag + if(oHead){ var oScript = document.createElement('script'); - - //adds src and type attribute to script tag oScript.setAttribute('src',sScriptSrc); oScript.setAttribute('type','text/javascript'); - - //calling a function after the js is loaded (IE) - var loadFunction = function() - { - if (this.readyState == 'complete' || this.readyState == 'loaded') - { - callbackfunction(); - } - }; + var loadFunction = function(){ + if (this.readyState == 'complete' || this.readyState == 'loaded') + callbackfunction(); + }; oScript.onreadystatechange = loadFunction; - - //calling a function after the js is loaded (Firefox) - oScript.onload = callbackfunction; - - //append the script tag to document head element + oScript.onload = callbackfunction; oHead.appendChild(oScript); } }; - + + //Bind for browsers that don't have it this.bind = function (oThis) { - if (typeof this !== "function") { - // closest thing possible to the ECMAScript 5 internal IsCallable function + if (typeof this !== "function") throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); - } - var aArgs = Array.prototype.slice.call(arguments, 1), - fToBind = this, - fNOP = function () {}, + fToBind = this, fNOP = function () {}, fBound = function () { return fToBind.apply(this instanceof fNOP - ? this - : oThis || window, - aArgs.concat(Array.prototype.slice.call(arguments))); + ? this + : oThis || window, + aArgs.concat(Array.prototype.slice.call(arguments))); }; - fNOP.prototype = this.prototype; fBound.prototype = new fNOP(); - return fBound; }; + //Kick things off this.kickStart = function(){ dojo.ready(this, function(){ //Get particiption data @@ -97,26 +85,25 @@ var Gitgraph = function(args){ }); }; + //Initialization this.height = 20; + this.width = args.width ? parseInt(args.width.substring(0,args.width.length-2)) : 416; this.node = args.domNode ? args.domNode : document.body; if (!Function.prototype.bind) Function.prototype.bind = this.bind; - if(!window.dojo) this.loadScript('http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo.js',this.kickStart.bind(this)); else this.kickStart.bind(this)(); + + //build container + this.graphContainer = dojo.create('div',{ + innerHTML:'', + style:'border-radius:3px;border:1px solid #E5E5E5;background:white;height:55px;text-align:center;width:'+(this.width+14)+'px'; + }this.node,'last'); + + return this.graphContainer; } - - this.width = args.width ? parseInt(args.width.substring(0,args.width.length-2)) : 416; - this.graphContainer = document.createElement('div'); - this.graphContainer.innerHTML = ''; - this.graphContainer.style.cssText = 'border-radius:3px;border:1px solid #E5E5E5;' - +'background:white;height:55px;text-align:center;'; - dojo.style(this.graphContainer,'width',(this.width+14)+'px'); - this.node.appendChild(this.graphContainer); - - return this.graphContainer; }; //Make Jquery folks happy diff --git a/demo/index.html b/demo/index.html index fcc7f4a..340dadf 100644 --- a/demo/index.html +++ b/demo/index.html @@ -62,5 +62,6 @@ repo : 'coweb', // name of repo domNode : document.getElementById('demoHolder'), // domNode to attach to (optional) }); + console.log(graph); diff --git a/package.json b/package.json deleted file mode 100644 index 4bfc913..0000000 --- a/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "gitgraph", - "version": "1.0", - "title": "Gitgraph", - "author": { - "name": "Paul Bouchon", - "url": "http://logicalcognition.com/" - }, - "licenses": [ - { - "type": "WTFPL", - "url": "http://sam.zoy.org/wtfpl/" - } - ], - "dependencies": { - "jquery": "1" - }, - "description": "Builds a widget of Github repositories mimicking the Github Dashboard look and feel exactly.", - "keywords": [ - "github", - "repository", - "repositories", - "git", - "graph" - ], - "homepage": "http://gitgraph.logicalcognition.com/", - "docs": "http://gitgraph.logicalcognition.com/", - "files": [ - "Gitgraph.js" - ], - "demo": "http://gitgraph.logicalcognition.com/" -} \ No newline at end of file From 6cc0b8d38b03b8fa795834e207b6eced9cf135a1 Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Fri, 6 Jan 2012 13:08:37 -0500 Subject: [PATCH 10/64] Rogue semicolon --- Gitgraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gitgraph.js b/Gitgraph.js index db395b2..6217412 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -99,7 +99,7 @@ var Gitgraph = function(args){ //build container this.graphContainer = dojo.create('div',{ innerHTML:'', - style:'border-radius:3px;border:1px solid #E5E5E5;background:white;height:55px;text-align:center;width:'+(this.width+14)+'px'; + style:'border-radius:3px;border:1px solid #E5E5E5;background:white;height:55px;text-align:center;width:'+(this.width+14)+'px' }this.node,'last'); return this.graphContainer; From a435cfca46db58e1588d80f43b08671756e355b7 Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Fri, 6 Jan 2012 13:09:03 -0500 Subject: [PATCH 11/64] Rogue semicolon --- Gitgraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gitgraph.js b/Gitgraph.js index 6217412..b022930 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -100,7 +100,7 @@ var Gitgraph = function(args){ this.graphContainer = dojo.create('div',{ innerHTML:'', style:'border-radius:3px;border:1px solid #E5E5E5;background:white;height:55px;text-align:center;width:'+(this.width+14)+'px' - }this.node,'last'); + },this.node,'last'); return this.graphContainer; } From 0d56994e5fd5a603f9fa6d911e8c5b331e992f5c Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Fri, 6 Jan 2012 15:41:30 -0500 Subject: [PATCH 12/64] Hosting gitgraph image --- Gitgraph.js | 5 ++++- demo/index.html | 46 ++-------------------------------------------- 2 files changed, 6 insertions(+), 45 deletions(-) diff --git a/Gitgraph.js b/Gitgraph.js index b022930..ccc9494 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -16,8 +16,11 @@ var Gitgraph = function(args){ //3. Create bottom of graph img var img = dojo.create('img',{ src:'https://a248.e.akamai.net/assets.github.com/images/modules/dashboard/dossier/participation_legend.png?1315937721', - style:'position:relative;top:-4px;width:'+this.width+'px;' + style:'position:relative;top:-4px;' },this.graphContainer); + var currHeight = img.offsetHeight; + dojo.style(img,'width',this.width+'px'); + dojo.style(img,'height',currHeight+'px'); ///4. Populate canvas with data points var context = this.canvas.getContext("2d"), diff --git a/demo/index.html b/demo/index.html index 340dadf..8b1b3cb 100644 --- a/demo/index.html +++ b/demo/index.html @@ -11,56 +11,14 @@ -
Gitgraph
-
- pure js github participation graph -
-
-
- Usage
- Paste into your page's HEAD -
-<script src="http://logicalcognition.com/Projects/Gitgraph/Gitgraph.js"></script>
- From within a <script> tag or a JS file -
-var graph = new Gitgraph({ 
-  user    : 'bouchon',      // any github username
-  repo    : 'coweb',        // name of repo
-  domNode : document.body,  // domNode to attach to (optional),
-  width   : '416px'         // (optional) custom graph width
-});
- Or use it as a jQuery plugin -
-$('#demoHolder').gitgraph({
-	user:'bouchon',    // any github username
-	repo:'coweb',      // name of repo
-	width:'416px'      // (optional) custom graph width
-});
- FYI, the script uses a little Dojo, and will require it if its not already loaded. Nothing to worry about!

- Issues & Features
- Report any issues and features (I'm sure I missed a lot of stuff) on Github. -
- Fork me on GitHub From 647f4ce3959b1ac01343b3bf988f7b4aba721984 Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Fri, 6 Jan 2012 15:51:10 -0500 Subject: [PATCH 13/64] Graph width scale issue --- Gitgraph.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gitgraph.js b/Gitgraph.js index ccc9494..f1c005a 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -15,12 +15,12 @@ var Gitgraph = function(args){ //3. Create bottom of graph img var img = dojo.create('img',{ - src:'https://a248.e.akamai.net/assets.github.com/images/modules/dashboard/dossier/participation_legend.png?1315937721', - style:'position:relative;top:-4px;' + src:'http://logicalcognition.com/files/gitgraphFiles/gitgraph.png', + style:'position:relative;top:-12px;' },this.graphContainer); var currHeight = img.offsetHeight; dojo.style(img,'width',this.width+'px'); - dojo.style(img,'height',currHeight+'px'); + dojo.style(img,'height','4px'); ///4. Populate canvas with data points var context = this.canvas.getContext("2d"), From ad8dac203d01c9456d241c514c421964244bc81b Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Fri, 6 Jan 2012 15:54:15 -0500 Subject: [PATCH 14/64] Restored demo page after some testing --- demo/index.html | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/demo/index.html b/demo/index.html index 8b1b3cb..340dadf 100644 --- a/demo/index.html +++ b/demo/index.html @@ -11,14 +11,56 @@ +
Gitgraph
+
+ pure js github participation graph +
+
+ ExampleFeatures
+
+
+
    +
  • Uses canvas element similar to how Github does it
  • +
  • Can be used as a jQuery plugin
  • +
  • All data 100% live
  • +
  • No additional style sheet required
  • +
  • Compatible with all JS frameworks
  • +
  • WTFPL license
  • +
+
+
+
+ Usage
+ Paste into your page's HEAD +
+<script src="http://logicalcognition.com/Projects/Gitgraph/Gitgraph.js"></script>
+ From within a <script> tag or a JS file +
+var graph = new Gitgraph({ 
+  user    : 'bouchon',      // any github username
+  repo    : 'coweb',        // name of repo
+  domNode : document.body,  // domNode to attach to (optional),
+  width   : '416px'         // (optional) custom graph width
+});
+ Or use it as a jQuery plugin +
+$('#demoHolder').gitgraph({
+	user:'bouchon',    // any github username
+	repo:'coweb',      // name of repo
+	width:'416px'      // (optional) custom graph width
+});
+ FYI, the script uses a little Dojo, and will require it if its not already loaded. Nothing to worry about!

+ Issues & Features
+ Report any issues and features (I'm sure I missed a lot of stuff) on Github. +
+ Fork me on GitHub From e58f8eccb9a9637117928c2ae22aa3a6e0dd2c70 Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Fri, 6 Jan 2012 16:03:42 -0500 Subject: [PATCH 15/64] Updating footer dimensions to be closer to Githubs --- Gitgraph.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gitgraph.js b/Gitgraph.js index f1c005a..ef75166 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -16,7 +16,7 @@ var Gitgraph = function(args){ //3. Create bottom of graph img var img = dojo.create('img',{ src:'http://logicalcognition.com/files/gitgraphFiles/gitgraph.png', - style:'position:relative;top:-12px;' + style:'position:relative;top:-11px;' },this.graphContainer); var currHeight = img.offsetHeight; dojo.style(img,'width',this.width+'px'); @@ -102,7 +102,7 @@ var Gitgraph = function(args){ //build container this.graphContainer = dojo.create('div',{ innerHTML:'', - style:'border-radius:3px;border:1px solid #E5E5E5;background:white;height:55px;text-align:center;width:'+(this.width+14)+'px' + style:'line-height:15px;border-radius:3px;border:1px solid #E5E5E5;background:white;height:55px;text-align:center;width:'+(this.width+14)+'px' },this.node,'last'); return this.graphContainer; From d6b604b438a83ffbe7dcedaf10597809f5d83c6b Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Fri, 6 Jan 2012 16:15:59 -0500 Subject: [PATCH 16/64] Any width still looks good --- Gitgraph.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Gitgraph.js b/Gitgraph.js index ef75166..597d12a 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -21,6 +21,25 @@ var Gitgraph = function(args){ var currHeight = img.offsetHeight; dojo.style(img,'width',this.width+'px'); dojo.style(img,'height','4px'); + dojo.create('br',{},img,'after'); + dojo.create('span',{ + innerHTML:'52 week participation', + style:'position:absolute;right:7px;font:10px arial;' + },img,'after'); + dojo.create('span',{ + innerHTML:'commits by owner', + style:'position:absolute;left:82px;font:10px arial;' + },img,'after'); + dojo.create('span',{ + innerHTML:'all commits', + style:'position:absolute;left:16px;float:left;font:10px arial;' + },img,'after'); + dojo.create('div',{ + style:'display:inline-block;position:absolute;left:7px;background:lightgrey;width:7px;height:7px;top:35px' + },img,'after'); + dojo.create('div',{ + style:'display:inline-block;position:absolute;left:73px;background:#3377CC;width:7px;height:7px;top:35px' + },img,'after'); ///4. Populate canvas with data points var context = this.canvas.getContext("2d"), @@ -102,7 +121,7 @@ var Gitgraph = function(args){ //build container this.graphContainer = dojo.create('div',{ innerHTML:'', - style:'line-height:15px;border-radius:3px;border:1px solid #E5E5E5;background:white;height:55px;text-align:center;width:'+(this.width+14)+'px' + style:'color:grey;position:relative;line-height:15px;border-radius:3px;border:1px solid #E5E5E5;background:white;height:55px;text-align:center;width:'+(this.width+14)+'px' },this.node,'last'); return this.graphContainer; From a284353f62acc2b43e9c870d4f1c00abecda2fe1 Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Tue, 10 Jan 2012 14:11:48 -0500 Subject: [PATCH 17/64] Error message for not finding repository --- Gitgraph.js | 7 +++++++ demo/index.html | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Gitgraph.js b/Gitgraph.js index 597d12a..b339bf2 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -102,6 +102,13 @@ var Gitgraph = function(args){ load: dojo.hitch(this,function(data){ this.data = data; this.go(); + }), + error: dojo.hitch(this,function(e){ + this.graphContainer.innerHTML = ''; + dojo.create('div',{ + innerHTML:'Can not find repository.', + style:'margin-top:20px;font:12px arial;' + },this.graphContainer); }) }); }); diff --git a/demo/index.html b/demo/index.html index 340dadf..a1e6b1a 100644 --- a/demo/index.html +++ b/demo/index.html @@ -58,7 +58,7 @@ + ``` * From within a script tag or a JS file From d359ece9e7d7ca3f620379fe868be2a8c5b0d8f4 Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Wed, 9 May 2012 00:00:45 -0400 Subject: [PATCH 20/64] Fix for rendering race --- Gitgraph.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Gitgraph.js b/Gitgraph.js index 09ea439..61a04cd 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -124,6 +124,12 @@ var Gitgraph = function(args){ //Kick things off this.kickStart = function(){ dojo.ready(this, function(){ + //Touch up graph container + dojo.attr(this.graphContainer, 'innerHTML', + ''); + dojo.attr(this.graphContainer, 'style', + 'color:grey;position:relative;line-height:15px;border-radius:3px;border:1px solid #E5E5E5;'+ + 'background:white;height:55px;text-align:center;width:'+(this.width+14)+'px'); //Get particiption data dojo.xhrGet({ url: 'http://bouchon.github.com/Gitgraph/bin/gitgraph.php?user='+args.user+'&repo='+args.repo, @@ -154,10 +160,8 @@ var Gitgraph = function(args){ else this.kickStart.bind(this)(); //build container - this.graphContainer = dojo.create('div',{ - innerHTML:'', - style:'color:grey;position:relative;line-height:15px;border-radius:3px;border:1px solid #E5E5E5;background:white;height:55px;text-align:center;width:'+(this.width+14)+'px' - },this.node,'last'); + this.graphContainer = document.creatElement('div'); + this.node.appendChild(this.graphContainer); return this.graphContainer; } From d1cc19533ec6aec33a572a640c4d7f9a07f8377c Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Wed, 9 May 2012 00:01:04 -0400 Subject: [PATCH 21/64] Fix for rendering race --- Gitgraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gitgraph.js b/Gitgraph.js index 61a04cd..7ddc3a3 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -160,7 +160,7 @@ var Gitgraph = function(args){ else this.kickStart.bind(this)(); //build container - this.graphContainer = document.creatElement('div'); + this.graphContainer = document.createElement('div'); this.node.appendChild(this.graphContainer); return this.graphContainer; From 598b37e495c19b265d740084fbd117a1a2247de3 Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Wed, 9 May 2012 00:12:33 -0400 Subject: [PATCH 22/64] Removing unneeded code --- demo/.DS_Store | Bin 6148 -> 0 bytes demo/demo.css | 91 ----------------------- demo/google-code-prettify/lang-apollo.js | 2 - demo/google-code-prettify/lang-clj.js | 18 ----- demo/google-code-prettify/lang-css.js | 2 - demo/google-code-prettify/lang-go.js | 1 - demo/google-code-prettify/lang-hs.js | 2 - demo/google-code-prettify/lang-lisp.js | 3 - demo/google-code-prettify/lang-lua.js | 2 - demo/google-code-prettify/lang-ml.js | 2 - demo/google-code-prettify/lang-n.js | 4 - demo/google-code-prettify/lang-proto.js | 1 - demo/google-code-prettify/lang-scala.js | 2 - demo/google-code-prettify/lang-sql.js | 2 - demo/google-code-prettify/lang-tex.js | 1 - demo/google-code-prettify/lang-vb.js | 2 - demo/google-code-prettify/lang-vhdl.js | 3 - demo/google-code-prettify/lang-wiki.js | 2 - demo/google-code-prettify/lang-xq.js | 3 - demo/google-code-prettify/lang-yaml.js | 2 - demo/google-code-prettify/prettify.css | 49 ------------ demo/google-code-prettify/prettify.js | 28 ------- demo/images/fork.png | Bin 10570 -> 0 bytes demo/images/screenshot-new.png | Bin 9643 -> 0 bytes demo/images/screenshot.png | Bin 9612 -> 0 bytes demo/index.html | 67 ----------------- 26 files changed, 289 deletions(-) delete mode 100644 demo/.DS_Store delete mode 100644 demo/demo.css delete mode 100755 demo/google-code-prettify/lang-apollo.js delete mode 100755 demo/google-code-prettify/lang-clj.js delete mode 100755 demo/google-code-prettify/lang-css.js delete mode 100755 demo/google-code-prettify/lang-go.js delete mode 100755 demo/google-code-prettify/lang-hs.js delete mode 100755 demo/google-code-prettify/lang-lisp.js delete mode 100755 demo/google-code-prettify/lang-lua.js delete mode 100755 demo/google-code-prettify/lang-ml.js delete mode 100755 demo/google-code-prettify/lang-n.js delete mode 100755 demo/google-code-prettify/lang-proto.js delete mode 100755 demo/google-code-prettify/lang-scala.js delete mode 100755 demo/google-code-prettify/lang-sql.js delete mode 100755 demo/google-code-prettify/lang-tex.js delete mode 100755 demo/google-code-prettify/lang-vb.js delete mode 100755 demo/google-code-prettify/lang-vhdl.js delete mode 100755 demo/google-code-prettify/lang-wiki.js delete mode 100755 demo/google-code-prettify/lang-xq.js delete mode 100755 demo/google-code-prettify/lang-yaml.js delete mode 100755 demo/google-code-prettify/prettify.css delete mode 100755 demo/google-code-prettify/prettify.js delete mode 100644 demo/images/fork.png delete mode 100644 demo/images/screenshot-new.png delete mode 100644 demo/images/screenshot.png delete mode 100644 demo/index.html diff --git a/demo/.DS_Store b/demo/.DS_Store deleted file mode 100644 index 26646e673f28a60b521e08524f5189b8be8704f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKJ5Iw;5S)b+k!Vs-P`(RLa04q!PQV2aF(4#MMtq8Nt~eJ*WA-CNn`c z?d96U zipA4;ev5Kgm#8QOq`;v9r@38u|KHMonEww++DQQ^@UIlG#pZgm<||cioxPm*+D5;j ud(8*kjq9K=L^~!%JLbmQ@kJD6UGp{XcZE}8(3uZ9Q9lE&i%bgqwE~|Ylo=5K diff --git a/demo/demo.css b/demo/demo.css deleted file mode 100644 index 43d43f0..0000000 --- a/demo/demo.css +++ /dev/null @@ -1,91 +0,0 @@ -html{ - color:#333333; - background-color:lightgrey; -} - -body{ - width:1000px; - min-width:1000px; - margin-left:auto; - margin-right:auto; -} - -.title{ - font-size: 150px; - text-shadow: 0px 1px 0px white; - font-family: 'Amaranth', sans-serif; - font-weight:bold; - text-align:center; - width:100%; - margin-left:auto; - margin-right:auto; -} - -.subtitle{ - font:20px 'Lucida Sans', 'Lucida Grande'; - text-align:center; -} - -.examples{ - text-shadow: 0px 1px 0px white; - font: 28px 'Amaranth', sans-serif; - font-weight:bold; - position:relative; -} - -.features{ - text-shadow: 0px 1px 0px white; - font: 28px 'Amaranth', sans-serif; - font-weight:bold; - position:relative; - left:480px; -} - -#demo{ - margin-top:30px; - width:100%; - margin-left:auto; - margin-right:auto; -} - -#usage{ - position:relative; - width:100%; - margin-left:auto; - margin-right:auto; - font-size:18px; - top:30px; - font-family:'Lucida Sans', 'Lucida Grande'; - margin-bottom:80px; -} - -#demoHolder{ - width:460px; - display:inline-block; - position:relative; - overflow-y:auto; - top:-50px; -} - -#featureHolder{ - width:450px; - display:inline-block; - position:relative; - top:0px; - line-height:20px; - font-size:14px; - left:100px; - font-family:'Lucida Sans', 'Lucida Grande'; -} - -.code{ - text-shadow: none; - font-size: 12px; - line-height: 18px; - margin: 5px 0 30px 0; -} - -#githubLink1{ - cursor:hand;cursor:pointer; - text-decoration:underline; -} \ No newline at end of file diff --git a/demo/google-code-prettify/lang-apollo.js b/demo/google-code-prettify/lang-apollo.js deleted file mode 100755 index 7098baf..0000000 --- a/demo/google-code-prettify/lang-apollo.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\n\r]*/,null,"#"],["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, -null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[ES]?BANK=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[!-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["apollo","agc","aea"]); diff --git a/demo/google-code-prettify/lang-clj.js b/demo/google-code-prettify/lang-clj.js deleted file mode 100755 index 542a220..0000000 --- a/demo/google-code-prettify/lang-clj.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - Copyright (C) 2011 Google Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -var a=null; -PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a], -["typ",/^:[\dA-Za-z-]+/]]),["clj"]); diff --git a/demo/google-code-prettify/lang-css.js b/demo/google-code-prettify/lang-css.js deleted file mode 100755 index 041e1f5..0000000 --- a/demo/google-code-prettify/lang-css.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", -/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); diff --git a/demo/google-code-prettify/lang-go.js b/demo/google-code-prettify/lang-go.js deleted file mode 100755 index fc18dc0..0000000 --- a/demo/google-code-prettify/lang-go.js +++ /dev/null @@ -1 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["pln",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])+(?:'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\/\*[\S\s]*?\*\/)/],["pln",/^(?:[^"'/`]|\/(?![*/]))+/]]),["go"]); diff --git a/demo/google-code-prettify/lang-hs.js b/demo/google-code-prettify/lang-hs.js deleted file mode 100755 index 9d77b08..0000000 --- a/demo/google-code-prettify/lang-hs.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n \r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^\n\f\r'\\]|\\[^&])'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/, -null],["pln",/^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],["pun",/^[^\d\t-\r "'A-Za-z]+/]]),["hs"]); diff --git a/demo/google-code-prettify/lang-lisp.js b/demo/google-code-prettify/lang-lisp.js deleted file mode 100755 index 02a30e8..0000000 --- a/demo/google-code-prettify/lang-lisp.js +++ /dev/null @@ -1,3 +0,0 @@ -var a=null; -PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a], -["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","scm"]); diff --git a/demo/google-code-prettify/lang-lua.js b/demo/google-code-prettify/lang-lua.js deleted file mode 100755 index e83a3c4..0000000 --- a/demo/google-code-prettify/lang-lua.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\S\s]*?(?:]\1]|$)|[^\n\r]*)/],["str",/^\[(=*)\[[\S\s]*?(?:]\1]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i], -["pln",/^[_a-z]\w*/i],["pun",/^[^\w\t\n\r \xa0][^\w\t\n\r "'+=\xa0-]*/]]),["lua"]); diff --git a/demo/google-code-prettify/lang-ml.js b/demo/google-code-prettify/lang-ml.js deleted file mode 100755 index 6df02d7..0000000 --- a/demo/google-code-prettify/lang-ml.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["com",/^#(?:if[\t\n\r \xa0]+(?:[$_a-z][\w']*|``[^\t\n\r`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])(?:'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\(\*[\S\s]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], -["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^(?:[_a-z][\w']*[!#?]?|``[^\t\n\r`]*(?:``|$))/i],["pun",/^[^\w\t\n\r "'\xa0]+/]]),["fs","ml"]); diff --git a/demo/google-code-prettify/lang-n.js b/demo/google-code-prettify/lang-n.js deleted file mode 100755 index 6c2e85b..0000000 --- a/demo/google-code-prettify/lang-n.js +++ /dev/null @@ -1,4 +0,0 @@ -var a=null; -PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,a,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,a,"#"],["pln",/^\s+/,a," \r\n\t\xa0"]],[["str",/^@"(?:[^"]|"")*(?:"|$)/,a],["str",/^<#[^#>]*(?:#>|$)/,a],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,a],["com",/^\/\/[^\n\r]*/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/, -a],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, -a],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,a],["lit",/^@[$_a-z][\w$@]*/i,a],["typ",/^@[A-Z]+[a-z][\w$@]*/,a],["pln",/^'?[$_a-z][\w$@]*/i,a],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,a,"0123456789"],["pun",/^.[^\s\w"-$'./@`]*/,a]]),["n","nemerle"]); diff --git a/demo/google-code-prettify/lang-proto.js b/demo/google-code-prettify/lang-proto.js deleted file mode 100755 index f006ad8..0000000 --- a/demo/google-code-prettify/lang-proto.js +++ /dev/null @@ -1 +0,0 @@ -PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]); diff --git a/demo/google-code-prettify/lang-scala.js b/demo/google-code-prettify/lang-scala.js deleted file mode 100755 index 60d034d..0000000 --- a/demo/google-code-prettify/lang-scala.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["str",/^"(?:""(?:""?(?!")|[^"\\]|\\.)*"{0,3}|(?:[^\n\r"\\]|\\.)*"?)/,null,'"'],["lit",/^`(?:[^\n\r\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&(--:-@[-^{-~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\n\r'\\]|\\(?:'|[^\n\r']+))'/],["lit",/^'[$A-Z_a-z][\w$]*(?![\w$'])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], -["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:0(?:[0-7]+|x[\da-f]+)l?|(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:e[+-]?\d+)?f?|l?)|\\.\d+(?:e[+-]?\d+)?f?)/i],["typ",/^[$_]*[A-Z][\d$A-Z_]*[a-z][\w$]*/],["pln",/^[$A-Z_a-z][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]); diff --git a/demo/google-code-prettify/lang-sql.js b/demo/google-code-prettify/lang-sql.js deleted file mode 100755 index da705b0..0000000 --- a/demo/google-code-prettify/lang-sql.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["str",/^(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\n\r]*|\/\*[\S\s]*?(?:\*\/|$))/],["kwd",/^(?:add|all|alter|and|any|as|asc|authorization|backup|begin|between|break|browse|bulk|by|cascade|case|check|checkpoint|close|clustered|coalesce|collate|column|commit|compute|constraint|contains|containstable|continue|convert|create|cross|current|current_date|current_time|current_timestamp|current_user|cursor|database|dbcc|deallocate|declare|default|delete|deny|desc|disk|distinct|distributed|double|drop|dummy|dump|else|end|errlvl|escape|except|exec|execute|exists|exit|fetch|file|fillfactor|for|foreign|freetext|freetexttable|from|full|function|goto|grant|group|having|holdlock|identity|identitycol|identity_insert|if|in|index|inner|insert|intersect|into|is|join|key|kill|left|like|lineno|load|match|merge|national|nocheck|nonclustered|not|null|nullif|of|off|offsets|on|open|opendatasource|openquery|openrowset|openxml|option|or|order|outer|over|percent|plan|precision|primary|print|proc|procedure|public|raiserror|read|readtext|reconfigure|references|replication|restore|restrict|return|revoke|right|rollback|rowcount|rowguidcol|rule|save|schema|select|session_user|set|setuser|shutdown|some|statistics|system_user|table|textsize|then|to|top|tran|transaction|trigger|truncate|tsequal|union|unique|update|updatetext|use|user|using|values|varying|view|waitfor|when|where|while|with|writetext)(?=[^\w-]|$)/i, -null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^[_a-z][\w-]*/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'+\xa0-]*/]]),["sql"]); diff --git a/demo/google-code-prettify/lang-tex.js b/demo/google-code-prettify/lang-tex.js deleted file mode 100755 index ce96fbb..0000000 --- a/demo/google-code-prettify/lang-tex.js +++ /dev/null @@ -1 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["com",/^%[^\n\r]*/,null,"%"]],[["kwd",/^\\[@-Za-z]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[()=[\]{}]+/]]),["latex","tex"]); diff --git a/demo/google-code-prettify/lang-vb.js b/demo/google-code-prettify/lang-vb.js deleted file mode 100755 index 07506b0..0000000 --- a/demo/google-code-prettify/lang-vb.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0\u2028\u2029]+/,null,"\t\n\r Â\xa0

"],["str",/^(?:["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})(?:["\u201c\u201d]c|$)|["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})*(?:["\u201c\u201d]|$))/i,null,'"“â€'],["com",/^['\u2018\u2019].*/,null,"'‘’"]],[["kwd",/^(?:addhandler|addressof|alias|and|andalso|ansi|as|assembly|auto|boolean|byref|byte|byval|call|case|catch|cbool|cbyte|cchar|cdate|cdbl|cdec|char|cint|class|clng|cobj|const|cshort|csng|cstr|ctype|date|decimal|declare|default|delegate|dim|directcast|do|double|each|else|elseif|end|endif|enum|erase|error|event|exit|finally|for|friend|function|get|gettype|gosub|goto|handles|if|implements|imports|in|inherits|integer|interface|is|let|lib|like|long|loop|me|mod|module|mustinherit|mustoverride|mybase|myclass|namespace|new|next|not|notinheritable|notoverridable|object|on|option|optional|or|orelse|overloads|overridable|overrides|paramarray|preserve|private|property|protected|public|raiseevent|readonly|redim|removehandler|resume|return|select|set|shadows|shared|short|single|static|step|stop|string|structure|sub|synclock|then|throw|to|try|typeof|unicode|until|variant|wend|when|while|with|withevents|writeonly|xor|endif|gosub|let|variant|wend)\b/i, -null],["com",/^rem.*/i],["lit",/^(?:true\b|false\b|nothing\b|\d+(?:e[+-]?\d+[dfr]?|[dfilrs])?|(?:&h[\da-f]+|&o[0-7]+)[ils]?|\d*\.\d+(?:e[+-]?\d+)?[dfr]?|#\s+(?:\d+[/-]\d+[/-]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:am|pm))?)?|\d+:\d+(?::\d+)?(\s*(?:am|pm))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*|\[(?:[a-z]|_\w)\w*])/i],["pun",/^[^\w\t\n\r "'[\]\xa0\u2018\u2019\u201c\u201d\u2028\u2029]+/],["pun",/^(?:\[|])/]]),["vb","vbs"]); diff --git a/demo/google-code-prettify/lang-vhdl.js b/demo/google-code-prettify/lang-vhdl.js deleted file mode 100755 index 128b5b6..0000000 --- a/demo/google-code-prettify/lang-vhdl.js +++ /dev/null @@ -1,3 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"]],[["str",/^(?:[box]?"(?:[^"]|"")*"|'.')/i],["com",/^--[^\n\r]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, -null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^'(?:active|ascending|base|delayed|driving|driving_value|event|high|image|instance_name|last_active|last_event|last_value|left|leftof|length|low|path_name|pos|pred|quiet|range|reverse_range|right|rightof|simple_name|stable|succ|transaction|val|value)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w.\\]+#(?:[+-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:e[+-]?\d+(?:_\d+)*)?)/i], -["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'\xa0-]*/]]),["vhdl","vhd"]); diff --git a/demo/google-code-prettify/lang-wiki.js b/demo/google-code-prettify/lang-wiki.js deleted file mode 100755 index 9b0b448..0000000 --- a/demo/google-code-prettify/lang-wiki.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\d\t a-gi-z\xa0]+/,null,"\t Â\xa0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[*=[\]^~]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^[A-Z][a-z][\da-z]+[A-Z][a-z][^\W_]+\b/],["lang-",/^{{{([\S\s]+?)}}}/],["lang-",/^`([^\n\r`]+)`/],["str",/^https?:\/\/[^\s#/?]*(?:\/[^\s#?]*)?(?:\?[^\s#]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\S\s])[^\n\r#*=A-[^`h{~]*/]]),["wiki"]); -PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]); diff --git a/demo/google-code-prettify/lang-xq.js b/demo/google-code-prettify/lang-xq.js deleted file mode 100755 index e323ae3..0000000 --- a/demo/google-code-prettify/lang-xq.js +++ /dev/null @@ -1,3 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["var pln",/^\$[\w-]+/,null,"$"]],[["pln",/^[\s=][<>][\s=]/],["lit",/^@[\w-]+/],["tag",/^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["com",/^\(:[\S\s]*?:\)/],["pln",/^[(),/;[\]{}]$/],["str",/^(?:"(?:[^"\\{]|\\[\S\s])*(?:"|$)|'(?:[^'\\{]|\\[\S\s])*(?:'|$))/,null,"\"'"],["kwd",/^(?:xquery|where|version|variable|union|typeswitch|treat|to|then|text|stable|sortby|some|self|schema|satisfies|returns|return|ref|processing-instruction|preceding-sibling|preceding|precedes|parent|only|of|node|namespace|module|let|item|intersect|instance|in|import|if|function|for|follows|following-sibling|following|external|except|every|else|element|descending|descendant-or-self|descendant|define|default|declare|comment|child|cast|case|before|attribute|assert|ascending|as|ancestor-or-self|ancestor|after|eq|order|by|or|and|schema-element|document-node|node|at)\b/], -["typ",/^(?:xs:yearMonthDuration|xs:unsignedLong|xs:time|xs:string|xs:short|xs:QName|xs:Name|xs:long|xs:integer|xs:int|xs:gYearMonth|xs:gYear|xs:gMonthDay|xs:gDay|xs:float|xs:duration|xs:double|xs:decimal|xs:dayTimeDuration|xs:dateTime|xs:date|xs:byte|xs:boolean|xs:anyURI|xf:yearMonthDuration)\b/,null],["fun pln",/^(?:xp:dereference|xinc:node-expand|xinc:link-references|xinc:link-expand|xhtml:restructure|xhtml:clean|xhtml:add-lists|xdmp:zip-manifest|xdmp:zip-get|xdmp:zip-create|xdmp:xquery-version|xdmp:word-convert|xdmp:with-namespaces|xdmp:version|xdmp:value|xdmp:user-roles|xdmp:user-last-login|xdmp:user|xdmp:url-encode|xdmp:url-decode|xdmp:uri-is-file|xdmp:uri-format|xdmp:uri-content-type|xdmp:unquote|xdmp:unpath|xdmp:triggers-database|xdmp:trace|xdmp:to-json|xdmp:tidy|xdmp:subbinary|xdmp:strftime|xdmp:spawn-in|xdmp:spawn|xdmp:sleep|xdmp:shutdown|xdmp:set-session-field|xdmp:set-response-encoding|xdmp:set-response-content-type|xdmp:set-response-code|xdmp:set-request-time-limit|xdmp:set|xdmp:servers|xdmp:server-status|xdmp:server-name|xdmp:server|xdmp:security-database|xdmp:security-assert|xdmp:schema-database|xdmp:save|xdmp:role-roles|xdmp:role|xdmp:rethrow|xdmp:restart|xdmp:request-timestamp|xdmp:request-status|xdmp:request-cancel|xdmp:request|xdmp:redirect-response|xdmp:random|xdmp:quote|xdmp:query-trace|xdmp:query-meters|xdmp:product-edition|xdmp:privilege-roles|xdmp:privilege|xdmp:pretty-print|xdmp:powerpoint-convert|xdmp:platform|xdmp:permission|xdmp:pdf-convert|xdmp:path|xdmp:octal-to-integer|xdmp:node-uri|xdmp:node-replace|xdmp:node-kind|xdmp:node-insert-child|xdmp:node-insert-before|xdmp:node-insert-after|xdmp:node-delete|xdmp:node-database|xdmp:mul64|xdmp:modules-root|xdmp:modules-database|xdmp:merging|xdmp:merge-cancel|xdmp:merge|xdmp:md5|xdmp:logout|xdmp:login|xdmp:log-level|xdmp:log|xdmp:lock-release|xdmp:lock-acquire|xdmp:load|xdmp:invoke-in|xdmp:invoke|xdmp:integer-to-octal|xdmp:integer-to-hex|xdmp:http-put|xdmp:http-post|xdmp:http-options|xdmp:http-head|xdmp:http-get|xdmp:http-delete|xdmp:hosts|xdmp:host-status|xdmp:host-name|xdmp:host|xdmp:hex-to-integer|xdmp:hash64|xdmp:hash32|xdmp:has-privilege|xdmp:groups|xdmp:group-serves|xdmp:group-servers|xdmp:group-name|xdmp:group-hosts|xdmp:group|xdmp:get-session-field-names|xdmp:get-session-field|xdmp:get-response-encoding|xdmp:get-response-code|xdmp:get-request-username|xdmp:get-request-user|xdmp:get-request-url|xdmp:get-request-protocol|xdmp:get-request-path|xdmp:get-request-method|xdmp:get-request-header-names|xdmp:get-request-header|xdmp:get-request-field-names|xdmp:get-request-field-filename|xdmp:get-request-field-content-type|xdmp:get-request-field|xdmp:get-request-client-certificate|xdmp:get-request-client-address|xdmp:get-request-body|xdmp:get-current-user|xdmp:get-current-roles|xdmp:get|xdmp:function-name|xdmp:function-module|xdmp:function|xdmp:from-json|xdmp:forests|xdmp:forest-status|xdmp:forest-restore|xdmp:forest-restart|xdmp:forest-name|xdmp:forest-delete|xdmp:forest-databases|xdmp:forest-counts|xdmp:forest-clear|xdmp:forest-backup|xdmp:forest|xdmp:filesystem-file|xdmp:filesystem-directory|xdmp:exists|xdmp:excel-convert|xdmp:eval-in|xdmp:eval|xdmp:estimate|xdmp:email|xdmp:element-content-type|xdmp:elapsed-time|xdmp:document-set-quality|xdmp:document-set-property|xdmp:document-set-properties|xdmp:document-set-permissions|xdmp:document-set-collections|xdmp:document-remove-properties|xdmp:document-remove-permissions|xdmp:document-remove-collections|xdmp:document-properties|xdmp:document-locks|xdmp:document-load|xdmp:document-insert|xdmp:document-get-quality|xdmp:document-get-properties|xdmp:document-get-permissions|xdmp:document-get-collections|xdmp:document-get|xdmp:document-forest|xdmp:document-delete|xdmp:document-add-properties|xdmp:document-add-permissions|xdmp:document-add-collections|xdmp:directory-properties|xdmp:directory-locks|xdmp:directory-delete|xdmp:directory-create|xdmp:directory|xdmp:diacritic-less|xdmp:describe|xdmp:default-permissions|xdmp:default-collections|xdmp:databases|xdmp:database-restore-validate|xdmp:database-restore-status|xdmp:database-restore-cancel|xdmp:database-restore|xdmp:database-name|xdmp:database-forests|xdmp:database-backup-validate|xdmp:database-backup-status|xdmp:database-backup-purge|xdmp:database-backup-cancel|xdmp:database-backup|xdmp:database|xdmp:collection-properties|xdmp:collection-locks|xdmp:collection-delete|xdmp:collation-canonical-uri|xdmp:castable-as|xdmp:can-grant-roles|xdmp:base64-encode|xdmp:base64-decode|xdmp:architecture|xdmp:apply|xdmp:amp-roles|xdmp:amp|xdmp:add64|xdmp:add-response-header|xdmp:access|trgr:trigger-set-recursive|trgr:trigger-set-permissions|trgr:trigger-set-name|trgr:trigger-set-module|trgr:trigger-set-event|trgr:trigger-set-description|trgr:trigger-remove-permissions|trgr:trigger-module|trgr:trigger-get-permissions|trgr:trigger-enable|trgr:trigger-disable|trgr:trigger-database-online-event|trgr:trigger-data-event|trgr:trigger-add-permissions|trgr:remove-trigger|trgr:property-content|trgr:pre-commit|trgr:post-commit|trgr:get-trigger-by-id|trgr:get-trigger|trgr:document-scope|trgr:document-content|trgr:directory-scope|trgr:create-trigger|trgr:collection-scope|trgr:any-property-content|thsr:set-entry|thsr:remove-term|thsr:remove-synonym|thsr:remove-entry|thsr:query-lookup|thsr:lookup|thsr:load|thsr:insert|thsr:expand|thsr:add-synonym|spell:suggest-detailed|spell:suggest|spell:remove-word|spell:make-dictionary|spell:load|spell:levenshtein-distance|spell:is-correct|spell:insert|spell:double-metaphone|spell:add-word|sec:users-collection|sec:user-set-roles|sec:user-set-password|sec:user-set-name|sec:user-set-description|sec:user-set-default-permissions|sec:user-set-default-collections|sec:user-remove-roles|sec:user-privileges|sec:user-get-roles|sec:user-get-description|sec:user-get-default-permissions|sec:user-get-default-collections|sec:user-doc-permissions|sec:user-doc-collections|sec:user-add-roles|sec:unprotect-collection|sec:uid-for-name|sec:set-realm|sec:security-version|sec:security-namespace|sec:security-installed|sec:security-collection|sec:roles-collection|sec:role-set-roles|sec:role-set-name|sec:role-set-description|sec:role-set-default-permissions|sec:role-set-default-collections|sec:role-remove-roles|sec:role-privileges|sec:role-get-roles|sec:role-get-description|sec:role-get-default-permissions|sec:role-get-default-collections|sec:role-doc-permissions|sec:role-doc-collections|sec:role-add-roles|sec:remove-user|sec:remove-role-from-users|sec:remove-role-from-role|sec:remove-role-from-privileges|sec:remove-role-from-amps|sec:remove-role|sec:remove-privilege|sec:remove-amp|sec:protect-collection|sec:privileges-collection|sec:privilege-set-roles|sec:privilege-set-name|sec:privilege-remove-roles|sec:privilege-get-roles|sec:privilege-add-roles|sec:priv-doc-permissions|sec:priv-doc-collections|sec:get-user-names|sec:get-unique-elem-id|sec:get-role-names|sec:get-role-ids|sec:get-privilege|sec:get-distinct-permissions|sec:get-collection|sec:get-amp|sec:create-user-with-role|sec:create-user|sec:create-role|sec:create-privilege|sec:create-amp|sec:collections-collection|sec:collection-set-permissions|sec:collection-remove-permissions|sec:collection-get-permissions|sec:collection-add-permissions|sec:check-admin|sec:amps-collection|sec:amp-set-roles|sec:amp-remove-roles|sec:amp-get-roles|sec:amp-doc-permissions|sec:amp-doc-collections|sec:amp-add-roles|search:unparse|search:suggest|search:snippet|search:search|search:resolve-nodes|search:resolve|search:remove-constraint|search:parse|search:get-default-options|search:estimate|search:check-options|prof:value|prof:reset|prof:report|prof:invoke|prof:eval|prof:enable|prof:disable|prof:allowed|ppt:clean|pki:template-set-request|pki:template-set-name|pki:template-set-key-type|pki:template-set-key-options|pki:template-set-description|pki:template-in-use|pki:template-get-version|pki:template-get-request|pki:template-get-name|pki:template-get-key-type|pki:template-get-key-options|pki:template-get-id|pki:template-get-description|pki:need-certificate|pki:is-temporary|pki:insert-trusted-certificates|pki:insert-template|pki:insert-signed-certificates|pki:insert-certificate-revocation-list|pki:get-trusted-certificate-ids|pki:get-template-ids|pki:get-template-certificate-authority|pki:get-template-by-name|pki:get-template|pki:get-pending-certificate-requests-xml|pki:get-pending-certificate-requests-pem|pki:get-pending-certificate-request|pki:get-certificates-for-template-xml|pki:get-certificates-for-template|pki:get-certificates|pki:get-certificate-xml|pki:get-certificate-pem|pki:get-certificate|pki:generate-temporary-certificate-if-necessary|pki:generate-temporary-certificate|pki:generate-template-certificate-authority|pki:generate-certificate-request|pki:delete-template|pki:delete-certificate|pki:create-template|pdf:make-toc|pdf:insert-toc-headers|pdf:get-toc|pdf:clean|p:status-transition|p:state-transition|p:remove|p:pipelines|p:insert|p:get-by-id|p:get|p:execute|p:create|p:condition|p:collection|p:action|ooxml:runs-merge|ooxml:package-uris|ooxml:package-parts-insert|ooxml:package-parts|msword:clean|mcgm:polygon|mcgm:point|mcgm:geospatial-query-from-elements|mcgm:geospatial-query|mcgm:circle|math:tanh|math:tan|math:sqrt|math:sinh|math:sin|math:pow|math:modf|math:log10|math:log|math:ldexp|math:frexp|math:fmod|math:floor|math:fabs|math:exp|math:cosh|math:cos|math:ceil|math:atan2|math:atan|math:asin|math:acos|map:put|map:map|map:keys|map:get|map:delete|map:count|map:clear|lnk:to|lnk:remove|lnk:insert|lnk:get|lnk:from|lnk:create|kml:polygon|kml:point|kml:interior-polygon|kml:geospatial-query-from-elements|kml:geospatial-query|kml:circle|kml:box|gml:polygon|gml:point|gml:interior-polygon|gml:geospatial-query-from-elements|gml:geospatial-query|gml:circle|gml:box|georss:point|georss:geospatial-query|georss:circle|geo:polygon|geo:point|geo:interior-polygon|geo:geospatial-query-from-elements|geo:geospatial-query|geo:circle|geo:box|fn:zero-or-one|fn:years-from-duration|fn:year-from-dateTime|fn:year-from-date|fn:upper-case|fn:unordered|fn:true|fn:translate|fn:trace|fn:tokenize|fn:timezone-from-time|fn:timezone-from-dateTime|fn:timezone-from-date|fn:sum|fn:subtract-dateTimes-yielding-yearMonthDuration|fn:subtract-dateTimes-yielding-dayTimeDuration|fn:substring-before|fn:substring-after|fn:substring|fn:subsequence|fn:string-to-codepoints|fn:string-pad|fn:string-length|fn:string-join|fn:string|fn:static-base-uri|fn:starts-with|fn:seconds-from-time|fn:seconds-from-duration|fn:seconds-from-dateTime|fn:round-half-to-even|fn:round|fn:root|fn:reverse|fn:resolve-uri|fn:resolve-QName|fn:replace|fn:remove|fn:QName|fn:prefix-from-QName|fn:position|fn:one-or-more|fn:number|fn:not|fn:normalize-unicode|fn:normalize-space|fn:node-name|fn:node-kind|fn:nilled|fn:namespace-uri-from-QName|fn:namespace-uri-for-prefix|fn:namespace-uri|fn:name|fn:months-from-duration|fn:month-from-dateTime|fn:month-from-date|fn:minutes-from-time|fn:minutes-from-duration|fn:minutes-from-dateTime|fn:min|fn:max|fn:matches|fn:lower-case|fn:local-name-from-QName|fn:local-name|fn:last|fn:lang|fn:iri-to-uri|fn:insert-before|fn:index-of|fn:in-scope-prefixes|fn:implicit-timezone|fn:idref|fn:id|fn:hours-from-time|fn:hours-from-duration|fn:hours-from-dateTime|fn:floor|fn:false|fn:expanded-QName|fn:exists|fn:exactly-one|fn:escape-uri|fn:escape-html-uri|fn:error|fn:ends-with|fn:encode-for-uri|fn:empty|fn:document-uri|fn:doc-available|fn:doc|fn:distinct-values|fn:distinct-nodes|fn:default-collation|fn:deep-equal|fn:days-from-duration|fn:day-from-dateTime|fn:day-from-date|fn:data|fn:current-time|fn:current-dateTime|fn:current-date|fn:count|fn:contains|fn:concat|fn:compare|fn:collection|fn:codepoints-to-string|fn:codepoint-equal|fn:ceiling|fn:boolean|fn:base-uri|fn:avg|fn:adjust-time-to-timezone|fn:adjust-dateTime-to-timezone|fn:adjust-date-to-timezone|fn:abs|feed:unsubscribe|feed:subscription|feed:subscribe|feed:request|feed:item|feed:description|excel:clean|entity:enrich|dom:set-pipelines|dom:set-permissions|dom:set-name|dom:set-evaluation-context|dom:set-domain-scope|dom:set-description|dom:remove-pipeline|dom:remove-permissions|dom:remove|dom:get|dom:evaluation-context|dom:domains|dom:domain-scope|dom:create|dom:configuration-set-restart-user|dom:configuration-set-permissions|dom:configuration-set-evaluation-context|dom:configuration-set-default-domain|dom:configuration-get|dom:configuration-create|dom:collection|dom:add-pipeline|dom:add-permissions|dls:retention-rules|dls:retention-rule-remove|dls:retention-rule-insert|dls:retention-rule|dls:purge|dls:node-expand|dls:link-references|dls:link-expand|dls:documents-query|dls:document-versions-query|dls:document-version-uri|dls:document-version-query|dls:document-version-delete|dls:document-version-as-of|dls:document-version|dls:document-update|dls:document-unmanage|dls:document-set-quality|dls:document-set-property|dls:document-set-properties|dls:document-set-permissions|dls:document-set-collections|dls:document-retention-rules|dls:document-remove-properties|dls:document-remove-permissions|dls:document-remove-collections|dls:document-purge|dls:document-manage|dls:document-is-managed|dls:document-insert-and-manage|dls:document-include-query|dls:document-history|dls:document-get-permissions|dls:document-extract-part|dls:document-delete|dls:document-checkout-status|dls:document-checkout|dls:document-checkin|dls:document-add-properties|dls:document-add-permissions|dls:document-add-collections|dls:break-checkout|dls:author-query|dls:as-of-query|dbk:convert|dbg:wait|dbg:value|dbg:stopped|dbg:stop|dbg:step|dbg:status|dbg:stack|dbg:out|dbg:next|dbg:line|dbg:invoke|dbg:function|dbg:finish|dbg:expr|dbg:eval|dbg:disconnect|dbg:detach|dbg:continue|dbg:connect|dbg:clear|dbg:breakpoints|dbg:break|dbg:attached|dbg:attach|cvt:save-converted-documents|cvt:part-uri|cvt:destination-uri|cvt:basepath|cvt:basename|cts:words|cts:word-query-weight|cts:word-query-text|cts:word-query-options|cts:word-query|cts:word-match|cts:walk|cts:uris|cts:uri-match|cts:train|cts:tokenize|cts:thresholds|cts:stem|cts:similar-query-weight|cts:similar-query-nodes|cts:similar-query|cts:shortest-distance|cts:search|cts:score|cts:reverse-query-weight|cts:reverse-query-nodes|cts:reverse-query|cts:remainder|cts:registered-query-weight|cts:registered-query-options|cts:registered-query-ids|cts:registered-query|cts:register|cts:query|cts:quality|cts:properties-query-query|cts:properties-query|cts:polygon-vertices|cts:polygon|cts:point-longitude|cts:point-latitude|cts:point|cts:or-query-queries|cts:or-query|cts:not-query-weight|cts:not-query-query|cts:not-query|cts:near-query-weight|cts:near-query-queries|cts:near-query-options|cts:near-query-distance|cts:near-query|cts:highlight|cts:geospatial-co-occurrences|cts:frequency|cts:fitness|cts:field-words|cts:field-word-query-weight|cts:field-word-query-text|cts:field-word-query-options|cts:field-word-query-field-name|cts:field-word-query|cts:field-word-match|cts:entity-highlight|cts:element-words|cts:element-word-query-weight|cts:element-word-query-text|cts:element-word-query-options|cts:element-word-query-element-name|cts:element-word-query|cts:element-word-match|cts:element-values|cts:element-value-ranges|cts:element-value-query-weight|cts:element-value-query-text|cts:element-value-query-options|cts:element-value-query-element-name|cts:element-value-query|cts:element-value-match|cts:element-value-geospatial-co-occurrences|cts:element-value-co-occurrences|cts:element-range-query-weight|cts:element-range-query-value|cts:element-range-query-options|cts:element-range-query-operator|cts:element-range-query-element-name|cts:element-range-query|cts:element-query-query|cts:element-query-element-name|cts:element-query|cts:element-pair-geospatial-values|cts:element-pair-geospatial-value-match|cts:element-pair-geospatial-query-weight|cts:element-pair-geospatial-query-region|cts:element-pair-geospatial-query-options|cts:element-pair-geospatial-query-longitude-name|cts:element-pair-geospatial-query-latitude-name|cts:element-pair-geospatial-query-element-name|cts:element-pair-geospatial-query|cts:element-pair-geospatial-boxes|cts:element-geospatial-values|cts:element-geospatial-value-match|cts:element-geospatial-query-weight|cts:element-geospatial-query-region|cts:element-geospatial-query-options|cts:element-geospatial-query-element-name|cts:element-geospatial-query|cts:element-geospatial-boxes|cts:element-child-geospatial-values|cts:element-child-geospatial-value-match|cts:element-child-geospatial-query-weight|cts:element-child-geospatial-query-region|cts:element-child-geospatial-query-options|cts:element-child-geospatial-query-element-name|cts:element-child-geospatial-query-child-name|cts:element-child-geospatial-query|cts:element-child-geospatial-boxes|cts:element-attribute-words|cts:element-attribute-word-query-weight|cts:element-attribute-word-query-text|cts:element-attribute-word-query-options|cts:element-attribute-word-query-element-name|cts:element-attribute-word-query-attribute-name|cts:element-attribute-word-query|cts:element-attribute-word-match|cts:element-attribute-values|cts:element-attribute-value-ranges|cts:element-attribute-value-query-weight|cts:element-attribute-value-query-text|cts:element-attribute-value-query-options|cts:element-attribute-value-query-element-name|cts:element-attribute-value-query-attribute-name|cts:element-attribute-value-query|cts:element-attribute-value-match|cts:element-attribute-value-geospatial-co-occurrences|cts:element-attribute-value-co-occurrences|cts:element-attribute-range-query-weight|cts:element-attribute-range-query-value|cts:element-attribute-range-query-options|cts:element-attribute-range-query-operator|cts:element-attribute-range-query-element-name|cts:element-attribute-range-query-attribute-name|cts:element-attribute-range-query|cts:element-attribute-pair-geospatial-values|cts:element-attribute-pair-geospatial-value-match|cts:element-attribute-pair-geospatial-query-weight|cts:element-attribute-pair-geospatial-query-region|cts:element-attribute-pair-geospatial-query-options|cts:element-attribute-pair-geospatial-query-longitude-name|cts:element-attribute-pair-geospatial-query-latitude-name|cts:element-attribute-pair-geospatial-query-element-name|cts:element-attribute-pair-geospatial-query|cts:element-attribute-pair-geospatial-boxes|cts:document-query-uris|cts:document-query|cts:distance|cts:directory-query-uris|cts:directory-query-depth|cts:directory-query|cts:destination|cts:deregister|cts:contains|cts:confidence|cts:collections|cts:collection-query-uris|cts:collection-query|cts:collection-match|cts:classify|cts:circle-radius|cts:circle-center|cts:circle|cts:box-west|cts:box-south|cts:box-north|cts:box-east|cts:box|cts:bearing|cts:arc-intersection|cts:and-query-queries|cts:and-query-options|cts:and-query|cts:and-not-query-positive-query|cts:and-not-query-negative-query|cts:and-not-query|css:get|css:convert|cpf:success|cpf:failure|cpf:document-set-state|cpf:document-set-processing-status|cpf:document-set-last-updated|cpf:document-set-error|cpf:document-get-state|cpf:document-get-processing-status|cpf:document-get-last-updated|cpf:document-get-error|cpf:check-transition|alert:spawn-matching-actions|alert:rule-user-id-query|alert:rule-set-user-id|alert:rule-set-query|alert:rule-set-options|alert:rule-set-name|alert:rule-set-description|alert:rule-set-action|alert:rule-remove|alert:rule-name-query|alert:rule-insert|alert:rule-id-query|alert:rule-get-user-id|alert:rule-get-query|alert:rule-get-options|alert:rule-get-name|alert:rule-get-id|alert:rule-get-description|alert:rule-get-action|alert:rule-action-query|alert:remove-triggers|alert:make-rule|alert:make-log-action|alert:make-config|alert:make-action|alert:invoke-matching-actions|alert:get-my-rules|alert:get-all-rules|alert:get-actions|alert:find-matching-rules|alert:create-triggers|alert:config-set-uri|alert:config-set-trigger-ids|alert:config-set-options|alert:config-set-name|alert:config-set-description|alert:config-set-cpf-domain-names|alert:config-set-cpf-domain-ids|alert:config-insert|alert:config-get-uri|alert:config-get-trigger-ids|alert:config-get-options|alert:config-get-name|alert:config-get-id|alert:config-get-description|alert:config-get-cpf-domain-names|alert:config-get-cpf-domain-ids|alert:config-get|alert:config-delete|alert:action-set-options|alert:action-set-name|alert:action-set-module-root|alert:action-set-module-db|alert:action-set-module|alert:action-set-description|alert:action-remove|alert:action-insert|alert:action-get-options|alert:action-get-name|alert:action-get-module-root|alert:action-get-module-db|alert:action-get-module|alert:action-get-description|zero-or-one|years-from-duration|year-from-dateTime|year-from-date|upper-case|unordered|true|translate|trace|tokenize|timezone-from-time|timezone-from-dateTime|timezone-from-date|sum|subtract-dateTimes-yielding-yearMonthDuration|subtract-dateTimes-yielding-dayTimeDuration|substring-before|substring-after|substring|subsequence|string-to-codepoints|string-pad|string-length|string-join|string|static-base-uri|starts-with|seconds-from-time|seconds-from-duration|seconds-from-dateTime|round-half-to-even|round|root|reverse|resolve-uri|resolve-QName|replace|remove|QName|prefix-from-QName|position|one-or-more|number|not|normalize-unicode|normalize-space|node-name|node-kind|nilled|namespace-uri-from-QName|namespace-uri-for-prefix|namespace-uri|name|months-from-duration|month-from-dateTime|month-from-date|minutes-from-time|minutes-from-duration|minutes-from-dateTime|min|max|matches|lower-case|local-name-from-QName|local-name|last|lang|iri-to-uri|insert-before|index-of|in-scope-prefixes|implicit-timezone|idref|id|hours-from-time|hours-from-duration|hours-from-dateTime|floor|false|expanded-QName|exists|exactly-one|escape-uri|escape-html-uri|error|ends-with|encode-for-uri|empty|document-uri|doc-available|doc|distinct-values|distinct-nodes|default-collation|deep-equal|days-from-duration|day-from-dateTime|day-from-date|data|current-time|current-dateTime|current-date|count|contains|concat|compare|collection|codepoints-to-string|codepoint-equal|ceiling|boolean|base-uri|avg|adjust-time-to-timezone|adjust-dateTime-to-timezone|adjust-date-to-timezone|abs)\b/], -["pln",/^[\w:-]+/],["pln",/^[\t\n\r \xa0]+/]]),["xq","xquery"]); diff --git a/demo/google-code-prettify/lang-yaml.js b/demo/google-code-prettify/lang-yaml.js deleted file mode 100755 index c38729b..0000000 --- a/demo/google-code-prettify/lang-yaml.js +++ /dev/null @@ -1,2 +0,0 @@ -var a=null; -PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]); diff --git a/demo/google-code-prettify/prettify.css b/demo/google-code-prettify/prettify.css deleted file mode 100755 index bb02bf6..0000000 --- a/demo/google-code-prettify/prettify.css +++ /dev/null @@ -1,49 +0,0 @@ -/* Pretty printing styles. Used with prettify.js. */ -/* Vim sunburst theme by David Leibovic */ - -pre .str, code .str { color: #65B042; } /* string - green */ -pre .kwd, code .kwd { color: #E28964; } /* keyword - dark pink */ -pre .com, code .com { color: #AEAEAE; font-style: italic; } /* comment - gray */ -pre .typ, code .typ { color: #89bdff; } /* type - light blue */ -pre .lit, code .lit { color: #3387CC; } /* literal - blue */ -pre .pun, code .pun { color: #fff; } /* punctuation - white */ -pre .pln, code .pln { color: #fff; } /* plaintext - white */ -pre .tag, code .tag { color: #89bdff; } /* html/xml tag - light blue */ -pre .atn, code .atn { color: #bdb76b; } /* html/xml attribute name - khaki */ -pre .atv, code .atv { color: #65B042; } /* html/xml attribute value - green */ -pre .dec, code .dec { color: #3387CC; } /* decimal - blue */ - -pre.prettyprint, code.prettyprint { - background-color: #333; - -moz-border-radius: 8px; - -webkit-border-radius: 8px; - -o-border-radius: 8px; - -ms-border-radius: 8px; - -khtml-border-radius: 8px; - border-radius: 8px; -} - -pre.prettyprint { - padding: 1em; - white-space: pre-wrap; -} - - -/* Specify class=linenums on a pre to get line numbering */ -ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE; } /* IE indents via margin-left */ -li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none } -/* Alternate shading for lines */ -li.L1,li.L3,li.L5,li.L7,li.L9 { } - -@media print { - pre .str, code .str { color: #060; } - pre .kwd, code .kwd { color: #006; font-weight: bold; } - pre .com, code .com { color: #600; font-style: italic; } - pre .typ, code .typ { color: #404; font-weight: bold; } - pre .lit, code .lit { color: #044; } - pre .pun, code .pun { color: #440; } - pre .pln, code .pln { color: #000; } - pre .tag, code .tag { color: #006; font-weight: bold; } - pre .atn, code .atn { color: #404; } - pre .atv, code .atv { color: #060; } -} \ No newline at end of file diff --git a/demo/google-code-prettify/prettify.js b/demo/google-code-prettify/prettify.js deleted file mode 100755 index eef5ad7..0000000 --- a/demo/google-code-prettify/prettify.js +++ /dev/null @@ -1,28 +0,0 @@ -var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; -(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= -[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), -l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, -q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, -q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, -"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), -a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} -for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], -"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], -H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], -J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ -I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), -["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", -/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), -["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", -hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= -!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1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8Wl7I!O9Er)gC^r)L Ye;ACEy6?+`iU0rr07*qoM6N<$f=&}M1^@s6 diff --git a/demo/images/screenshot-new.png b/demo/images/screenshot-new.png deleted file mode 100644 index a0c4bba0a58679e72fb0180e87411dd6d894b54f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9643 zcmX|l1yEc~(={3_xCM8&1b4T^B?Nbe;KAKJi|gVcI0Sch5AG7&9d_}bJbAyrs;^Ad zz0>D(_e`ChNEIa+RAfSAC@3gYfUKk%6clvx+q)#u2XuwDyWrd_*uQS`G+sS~Bej-^5eEY5jRo8_3#8AIBE@C1O0}r7PQKNq@ z5+28Af%J!(0HRQB0f^L4z#{k0A(i#@@Q|EIuoILWk8sNB{H@5+i#KdL&>@KjDvoRV zWEXpvBx;igs%v~5Gsz0-_sRp@c0N_Zr79eUDh4d3k3G@j>p;cI;xP~D@}KI)IT??i zP`Q*IUTRO!WS7 zEDwC`{8d!6Ai^&s^!(c0IT$2MNkRlCEfwNHd-8PodXJ16DYj?3Z!ESR5@98zyE7U# zMx<+0S0WUYj=_wLVOq0~&Mo`?m;36T)Pa(*L2CuZSb!1PIlZqLD|9|W6e=3e#(eF# z%i`cd7e@C`X@FdT$?3~hbR_gc>+1zCyk~~pV@$|JotGNMP3y)>gw?SfQG=^eNa#re zBsle%UV7yLlRxG*mc35mqY3O7u447ZPb%(SHNQaVpNP^Ap|_OcZu6_$Ko*(-H*e-3 z#Jfw>m1|AzmBE=V;yf3M8+Ie;n?PuCs&hw-peK5A3<&u~=eKkJsZ&u(2vko1TZA~Z z8}BOY41@otk1*L0Z6edG_c8_!;aeysm?h(#KE3iR^8S}(1XcdjFtR3v%}0o zU!QhqXI|=2Y$Le3GK^w>nfNovDtF3=Emcnv6U4Gbh<&@K^nI=0-zbQ>58vLH-Ec8# zrNWJIgnKz9;yuyAg8*5t{Vnz;^>Ra}oUNqlNOiC)LchS9aiV0v%I4$#X0+0;Ea)Rm1A6139D24D*yf zr5qg|8VN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_fzXy-p@8k9#DL-nc!fVAAYVhEZteJK&L)GySDS3{rk4UKN|&?A_}HmV#_Y9aF-Ir_vr_Lgqp8j4BSj0aj7Tt6A(S6%`|MwxP%w+equJ*-I(#3a zK5i0`DjGB|>SMHuZ$*qn$DYeuDrxs0DHHEux%o$#cCIU;MO?0qv=&X4D4o^HkDk)v4?HC zNLJR-wmzE5IZd0MWh+!lV%Z6$Gh$%hJ{nkp88q5BfoNg)OdJyC(0g`!U#xb>*1!|o zWPN6vU`>t`ZO4$UrOp3Z?dJA=-gvxPI`}wAFeqIg9{w0%LmfyyysvF6qEqRB`iS*l z3j20&R}uEiz@6uvP`P`A-H}JTzlJiG zJQdgamg=8E=X=w&WASAY|HOAWBK?rLl+N=%#(q&}WM2>``PT?Uh!Vhgn8@idB0J{@`(C}Z4LAo|5hV)$6gfT|q9fo_ z*+C?osi~=ft*z}J>*?lS;&T7IMTo*dw?4|AI2Y!V%M?ycslM*oE&xc(J}tl^4s|0M7aiZ_yB2}l2Co~3ys*+R_C!19lCSQlGu YPpePHrv}%zRu2jwr6gG?ZWQ$Y0F^6r#Q*>R diff --git a/demo/images/screenshot.png b/demo/images/screenshot.png deleted file mode 100644 index 58df3dfd5132ea0adc486aec2dcee835fa8f2916..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9612 zcmcI|1yfv2*DV$_xFoo{CAd2b5*&iN`vAe+Ed&Yf8U}ZF%OJts-Q9h-B+pylKe$zW zPIcGWXZM!w-D`D(k^%q~nE)9I3JO(5T0#X13cBg7FMuO@9wk5?i``)xP_9IXK#cTAYQQTF%Ajb zP_dko$2-_N#F6WSP+cRdmf_K@DTeLd%S=aFXj^gZ~z&Qk^Bx^)c_Zh2%!*x;fN z9CF-nAC&w;C$;p5$@l#xnypU!lQHZcT>0v?UzA+ED!u_yzYwJ!LvARw4;gl(c2V-}BediTmP%lTc9;#c}neeX&qCideP zm>y&ruzlX4nS#`#*o1R-r5Q$78T-*oD|P}z7pljI@S|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`Ek`3f$ghK;zho-*&hW7V}sA+|6xr{0t=)K z^qqmS^2Dr4se3y{SmwpZMBLmzX)V0;wNKBR77DTz$I3?{r!3oHx(B-HGO-+^!IRpI zjSl{X(E;^_$qYArid&GEx(RuINDu015Vxd?=+PUQjBaQExe|GapALO7$=wjwLbs^oWRSic5>TUm3*8GxWodOL{S9=N zBVqu1Vz6rW(*Z@dnL2ovjB%+8ltZ!!DmwoI+H@gMF*3a|bfplDghIN4mcI<)FG=`| zxXT7)EB*uTdPsC#Gq|06|2xAY{b6*!no?{0qX{_`ZxHA((jfCc^l179zgQS+;u-(x zQPO~sgg$)(vXCX(!;-}RDZmIwfOE%|ReR$CXKS5zQUCz%cAh1@;(z*b5iyo^KbP*y z(`;>R>Fem|Y?P0qnnfgF{sRyg0Z`ChhtkK$MR`zwkm~Bsuh-L z>-iu52^S%H^Mi+v;eR}W`E9g}mWlJ9AK{eeDCE%Hwi#cP6W_QTl#HZ;M1`1P;Qs@D C(tGv* diff --git a/demo/index.html b/demo/index.html deleted file mode 100644 index a1e6b1a..0000000 --- a/demo/index.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - Gitgraph - - - - - - - - - -
Gitgraph
-
- pure js github participation graph -
-
-
- Usage
- Paste into your page's HEAD -
-<script src="http://logicalcognition.com/Projects/Gitgraph/Gitgraph.js"></script>
- From within a <script> tag or a JS file -
-var graph = new Gitgraph({ 
-  user    : 'bouchon',      // any github username
-  repo    : 'coweb',        // name of repo
-  domNode : document.body,  // domNode to attach to (optional),
-  width   : '416px'         // (optional) custom graph width
-});
- Or use it as a jQuery plugin -
-$('#demoHolder').gitgraph({
-	user:'bouchon',    // any github username
-	repo:'coweb',      // name of repo
-	width:'416px'      // (optional) custom graph width
-});
- - FYI, the script uses a little Dojo, and will require it if its not already loaded. Nothing to worry about!

- Issues & Features
- Report any issues and features (I'm sure I missed a lot of stuff) on Github. -
- Fork me on GitHub - - - From bfdda4348f5898b9ead82ed85c4bb0cddb5d3ac5 Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Wed, 9 May 2012 00:28:43 -0400 Subject: [PATCH 23/64] Everything working again: --- Gitgraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gitgraph.js b/Gitgraph.js index 7ddc3a3..6fd197d 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -132,7 +132,7 @@ var Gitgraph = function(args){ 'background:white;height:55px;text-align:center;width:'+(this.width+14)+'px'); //Get particiption data dojo.xhrGet({ - url: 'http://bouchon.github.com/Gitgraph/bin/gitgraph.php?user='+args.user+'&repo='+args.repo, + url: 'http://logicalcognition.com/files/gitgraphFiles/gitgraph.php?user='+args.user+'&repo='+args.repo, handleAs: 'json', preventCache: true, load: dojo.hitch(this,function(data){ From deeed0b36d376efe4e68841ead3e471eca70b55c Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Wed, 9 May 2012 00:35:55 -0400 Subject: [PATCH 24/64] Fix bug --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 2c37424..1e3a11b 100644 --- a/README.markdown +++ b/README.markdown @@ -26,7 +26,7 @@ Pure JS github participation graph using canvas element. [Demo](http://bouchon.g ```javascript $('#demoHolder').gitgraph({ user:'bouchon', // any github username - repo:'coweb', // name of repo + repo:'Gitgraph', // name of repo width: '416px' // (optional) custom graph width }); ``` From 7cee15e53c9e53d128bb1d5f0e9bd171c658f4e1 Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Wed, 9 May 2012 01:23:45 -0400 Subject: [PATCH 25/64] Make sure the graph node is initialized always before returning --- Gitgraph.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Gitgraph.js b/Gitgraph.js index 6fd197d..bcb2fcc 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -155,13 +155,12 @@ var Gitgraph = function(args){ this.width = args.width ? parseInt(args.width.substring(0,args.width.length-2)) : 416; this.node = args.domNode ? args.domNode : document.body; if (!Function.prototype.bind) Function.prototype.bind = this.bind; - if(!window.dojo) - this.loadScript('http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo.js',this.kickStart.bind(this)); - else this.kickStart.bind(this)(); - //build container this.graphContainer = document.createElement('div'); this.node.appendChild(this.graphContainer); + if(!window.dojo) + this.loadScript('http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo.js',this.kickStart.bind(this)); + else this.kickStart.bind(this)(); return this.graphContainer; } From cada336fa7b0e631957ff3fd2fabab0f7c1c3ef8 Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Mon, 9 Jul 2012 19:29:40 -0400 Subject: [PATCH 26/64] Fix for proxy issue --- Gitgraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gitgraph.js b/Gitgraph.js index bcb2fcc..77fec1b 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -132,7 +132,7 @@ var Gitgraph = function(args){ 'background:white;height:55px;text-align:center;width:'+(this.width+14)+'px'); //Get particiption data dojo.xhrGet({ - url: 'http://logicalcognition.com/files/gitgraphFiles/gitgraph.php?user='+args.user+'&repo='+args.repo, + url: 'http://simplistic.me/files/gitgraphFiles/gitgraph.php?user='+args.user+'&repo='+args.repo, handleAs: 'json', preventCache: true, load: dojo.hitch(this,function(data){ From 0466b1c061f5ae1d18f7db12ac2e2bdcf6196fc3 Mon Sep 17 00:00:00 2001 From: bitpshr Date: Mon, 22 Oct 2012 22:02:51 -0400 Subject: [PATCH 27/64] Brushing off the dust to clean things up --- Gitgraph.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gitgraph.js b/Gitgraph.js index 77fec1b..f55aba2 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -3,7 +3,7 @@ // http://bouchon.github.com/Gitgraph // -var Gitgraph = function(args){ +window.Gitgraph = function(args){ if(!args || !args.user || !args.repo){ throw new Error('Gitgraph: missing user and/or repo arg '); }else{ @@ -60,7 +60,7 @@ var Gitgraph = function(args){ //Builds graph key this.createKey = function(){ var img = dojo.create('img',{ - src:'http://bouchon.github.com/Gitgraph/bin/gitgraph.png', + src:'http://bitpshr.github.com/Gitgraph/bin/gitgraph.png', style:'position:relative;top:-11px;' },this.graphContainer); var currHeight = img.offsetHeight; @@ -132,7 +132,7 @@ var Gitgraph = function(args){ 'background:white;height:55px;text-align:center;width:'+(this.width+14)+'px'); //Get particiption data dojo.xhrGet({ - url: 'http://simplistic.me/files/gitgraphFiles/gitgraph.php?user='+args.user+'&repo='+args.repo, + url: 'http://bitpshr.info/files/gitgraphFiles/gitgraph.php?user='+args.user+'&repo='+args.repo, handleAs: 'json', preventCache: true, load: dojo.hitch(this,function(data){ From 355ee7ea47dcb904d6c1d08d23f979c92456ac4e Mon Sep 17 00:00:00 2001 From: bitpshr Date: Thu, 29 Nov 2012 21:24:05 -0500 Subject: [PATCH 28/64] Cleaning up, converting to AMD --- Gitgraph.js | 323 ++++++++++++++++++++++------------------------------ 1 file changed, 138 insertions(+), 185 deletions(-) diff --git a/Gitgraph.js b/Gitgraph.js index f55aba2..0ccfb29 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -1,185 +1,138 @@ -// -// Pure JS GitHub participation graph -// http://bouchon.github.com/Gitgraph -// - -window.Gitgraph = function(args){ - if(!args || !args.user || !args.repo){ - throw new Error('Gitgraph: missing user and/or repo arg '); - }else{ - //Rips through data point arrays and renders canvas - this.go = function(){ - //1. Vars - this.total = this.data.all; //array of all commit data points - this.own = this.data.owner; //array of just your commit data points - //2. Create canvas - this.createCanvas(); - //3. Create bottom of graph img - this.createLower(); - //4. Populate canvas with data points - this.populate(); - }; - - //Render canvas element - this.createCanvas = function(){ - this.graphContainer.innerHTML = ''; - this.canvas = dojo.create('canvas',{ - width:this.width,height:this.height,style:'position:relative;margin-top:11px;' - },this.graphContainer); - }; - - //Render bottom part of graph - this.createLower = function(){ - var img = this.createKey(); - //Participation key - dojo.create('span',{ - innerHTML:'52 week participation', - style:'position:absolute;right:7px;font:10px arial;' - },img,'after'); - //Commits by owner key - dojo.create('span',{ - innerHTML:'commits by owner', - style:'position:absolute;left:82px;font:10px arial;' - },img,'after'); - //All commits key - dojo.create('span',{ - innerHTML:'all commits', - style:'position:absolute;left:16px;float:left;font:10px arial;' - },img,'after'); - //Color legends - dojo.create('div',{ - style:'display:inline-block;position:absolute;left:7px;'+ - 'background:lightgrey;width:7px;height:7px;top:35px' - },img,'after'); - dojo.create('div',{ - style:'display:inline-block;position:absolute;left:73px;'+ - 'background:#3377CC;width:7px;height:7px;top:35px' - },img,'after'); - }; - - //Builds graph key - this.createKey = function(){ - var img = dojo.create('img',{ - src:'http://bitpshr.github.com/Gitgraph/bin/gitgraph.png', - style:'position:relative;top:-11px;' - },this.graphContainer); - var currHeight = img.offsetHeight; - dojo.style(img,'width',this.width+'px'); - dojo.style(img,'height','4px'); - dojo.create('br',{},img,'after'); - return img; - }; - - //Populates graph with data points - this.populate = function(){ - var context = this.canvas.getContext("2d"), - width = this.width / this.total.length, - height = this.height, - max = Math.max.apply(Math, this.total), - scale = max >= height ? parseFloat(height - 1) / max : 1; - function render(value, index){ - value *= scale; - context.fillRect(index * width, height - value, width - 1, value); - } - context.fillStyle = 'rgb(202, 202, 202)'; - dojo.forEach(this.total, render); - context.fillStyle = 'rgb(51, 102, 153)'; - dojo.forEach(this.own, render); - }; - - //Dynamically load JS - this.loadScript = function(sScriptSrc,callbackfunction) { - var oHead = document.getElementsByTagName('head')[0]; - if(oHead){ - var oScript = document.createElement('script'); - oScript.setAttribute('src',sScriptSrc); - oScript.setAttribute('type','text/javascript'); - var loadFunction = function(){ - if (this.readyState == 'complete' || this.readyState == 'loaded') - callbackfunction(); - }; - oScript.onreadystatechange = loadFunction; - oScript.onload = callbackfunction; - oHead.appendChild(oScript); - } - }; - - //Bind for browsers that don't have it - this.bind = function (oThis) { - if (typeof this !== "function") - throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); - var aArgs = Array.prototype.slice.call(arguments, 1), - fToBind = this, fNOP = function () {}, - fBound = function () { - return fToBind.apply(this instanceof fNOP - ? this - : oThis || window, - aArgs.concat(Array.prototype.slice.call(arguments))); - }; - fNOP.prototype = this.prototype; - fBound.prototype = new fNOP(); - return fBound; - }; - - //Kick things off - this.kickStart = function(){ - dojo.ready(this, function(){ - //Touch up graph container - dojo.attr(this.graphContainer, 'innerHTML', - ''); - dojo.attr(this.graphContainer, 'style', - 'color:grey;position:relative;line-height:15px;border-radius:3px;border:1px solid #E5E5E5;'+ - 'background:white;height:55px;text-align:center;width:'+(this.width+14)+'px'); - //Get particiption data - dojo.xhrGet({ - url: 'http://bitpshr.info/files/gitgraphFiles/gitgraph.php?user='+args.user+'&repo='+args.repo, - handleAs: 'json', - preventCache: true, - load: dojo.hitch(this,function(data){ - this.data = data; - this.go(); - }), - error: dojo.hitch(this,function(e){ - this.graphContainer.innerHTML = ''; - dojo.create('div',{ - innerHTML:'Can not find repository.', - style:'margin-top:20px;font:12px arial;' - },this.graphContainer); - }) - }); - }); - }; - - //Initialization - this.height = 20; - this.width = args.width ? parseInt(args.width.substring(0,args.width.length-2)) : 416; - this.node = args.domNode ? args.domNode : document.body; - if (!Function.prototype.bind) Function.prototype.bind = this.bind; - //build container - this.graphContainer = document.createElement('div'); - this.node.appendChild(this.graphContainer); - if(!window.dojo) - this.loadScript('http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojo/dojo.js',this.kickStart.bind(this)); - else this.kickStart.bind(this)(); - - return this.graphContainer; - } -}; - -//Make Jquery folks happy -if (window.jQuery) { - jQuery.fn.gitgraph = function (args) { - if(!args || !args.user || !args.repo){ - throw new Error('Gitgraph: missing user and/or repo arg '); - }else{ - this.each(function () { - var view = new Gitgraph({ - user : args.user, - domNode : $(this)[0], - repo : args.repo, - width: args.width ? args.width : '416px' - }); - }); - } - }; -} \ No newline at end of file +// +// Pure JS GitHub participation graph +// http://bouchon.github.com/Gitgraph +// + +window.Gitgraph = function(args){ + require([ + "dojo/dom-construct", + "dojo/dom-attr", + "dojo/_base/lang", + "dojo/request/xhr", + "dojo/domReady!" + ], function(domConstruct, domAttr, lang, xhr){ + var app = { + height : 20, + width : args.width ? parseInt(args.width.substring(0,args.width.length-2)) : 416, + node : args.domNode ? args.domNode : document.body, + + init : function(){ + //build container + this.graphContainer = this._createContainer(); + //get particiption data + this.getParticipationData().then( + lang.hitch(this, "_showGraph"), + lang.hitch(this, "_showError") + ); + }, + + _showGraph: function(data){ + this.data = data.contents; + this.total = this.data.all; //array of all commit data points + this.own = this.data.owner; //array of just your commit data points + // create canvas + this.createCanvas(); + // create bottom of graph img + this.createLower(); + // populate canvas with data points + this.populate(); + }, + + _createContainer: function(){ + return domConstruct.create("div", { + innerHTML : '', + style : 'color:grey; position:relative; line-height:15px; '+ + 'border-radius:3px; border:1px solid #E5E5E5;background:white;'+ + 'height:55px;text-align:center;width:'+(this.width+14)+'px' + }, this.node); + }, + + + + _showError: function(err){ + this.graphContainer.innerHTML = ''; + dojo.create('div',{ + innerHTML:'Can not find repository.', + style:'margin-top:20px;font:12px arial;' + },this.graphContainer); + }, + + getParticipationData: function(){ + var self = this; + return xhr('http://bitpshr.info/cdn/ba-simple-proxy.php?url=https://github.com/'+args.user+'/'+args.repo+"/graphs/owner_participation", { + handleAs: 'json' + }); + }, + + //Render canvas element + createCanvas : function(){ + this.graphContainer.innerHTML = ''; + this.canvas = dojo.create('canvas',{ + width:this.width,height:this.height,style:'position:relative;margin-top:11px;' + },this.graphContainer); + }, + + //Render bottom part of graph + createLower : function(){ + var img = this.createKey(); + //Participation key + dojo.create('span',{ + innerHTML:'52 week participation', + style:'position:absolute;right:7px;font:10px arial;' + },img,'after'); + //Commits by owner key + dojo.create('span',{ + innerHTML:'commits by owner', + style:'position:absolute;left:82px;font:10px arial;' + },img,'after'); + //All commits key + dojo.create('span',{ + innerHTML:'all commits', + style:'position:absolute;left:16px;float:left;font:10px arial;' + },img,'after'); + //Color legends + dojo.create('div',{ + style:'display:inline-block;position:absolute;left:7px;'+ + 'background:lightgrey;width:7px;height:7px;top:35px' + },img,'after'); + dojo.create('div',{ + style:'display:inline-block;position:absolute;left:73px;'+ + 'background:#3377CC;width:7px;height:7px;top:35px' + },img,'after'); + }, + + //Builds graph key + createKey : function(){ + var img = dojo.create('img',{ + src:'http://bitpshr.github.com/Gitgraph/bin/gitgraph.png', + style:'position:relative;top:-11px;' + },this.graphContainer); + var currHeight = img.offsetHeight; + dojo.style(img,'width',this.width+'px'); + dojo.style(img,'height','4px'); + dojo.create('br',{},img,'after'); + return img; + }, + + //Populates graph with data points + populate : function(){ + var context = this.canvas.getContext("2d"), + width = this.width / this.total.length, + height = this.height, + max = Math.max.apply(Math, this.total), + scale = max >= height ? parseFloat(height - 1) / max : 1; + function render(value, index){ + value *= scale; + context.fillRect(index * width, height - value, width - 1, value); + } + context.fillStyle = 'rgb(202, 202, 202)'; + dojo.forEach(this.total, render); + context.fillStyle = 'rgb(51, 102, 153)'; + dojo.forEach(this.own, render); + } + }; + + lang.hitch(app, "init")(); + }); +}; From cb47f8dee4a001e3a195ec7997556cd2277f306f Mon Sep 17 00:00:00 2001 From: bitpshr Date: Fri, 30 Nov 2012 09:13:47 -0500 Subject: [PATCH 29/64] Finalizing ish --- Gitgraph.js | 170 +++++++++++++++------------------------------------- 1 file changed, 49 insertions(+), 121 deletions(-) diff --git a/Gitgraph.js b/Gitgraph.js index 0ccfb29..30cf694 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -4,135 +4,63 @@ // window.Gitgraph = function(args){ + var graphContainer = document.createElement("div"); require([ "dojo/dom-construct", "dojo/dom-attr", "dojo/_base/lang", + "dojo/_base/array", "dojo/request/xhr", "dojo/domReady!" - ], function(domConstruct, domAttr, lang, xhr){ - var app = { - height : 20, - width : args.width ? parseInt(args.width.substring(0,args.width.length-2)) : 416, - node : args.domNode ? args.domNode : document.body, + ], function(domConstruct, domAttr, lang, array, xhr){ + // 1. Grab args + var h = args.height ? parseInt(args.height.substr(0,args.height.length-2)) : 40; + var w = args.width ? parseInt(args.width.substr(0,args.width.length-2)) : 416; + var node = args.domNode || document.body; - init : function(){ - //build container - this.graphContainer = this._createContainer(); - //get particiption data - this.getParticipationData().then( - lang.hitch(this, "_showGraph"), - lang.hitch(this, "_showError") - ); - }, + // 2. Build container (the inline styles are ugly but k.i.s.s.) + domAttr.set(graphContainer, "innerHTML", + ''); + domAttr.set(graphContainer, "style", + 'padding:5px; border-radius:4px; background:white;position:relative;'+ + 'height:'+h+'px;text-align:center;width:'+w+'px'); + domConstruct.place(graphContainer, node, "first"); - _showGraph: function(data){ - this.data = data.contents; - this.total = this.data.all; //array of all commit data points - this.own = this.data.owner; //array of just your commit data points - // create canvas - this.createCanvas(); - // create bottom of graph img - this.createLower(); - // populate canvas with data points - this.populate(); - }, + // 3. Build our request url (need to proxy bc GitHub + // hasn't exposed this data via the API yet...they plan to) + var proxy = "http://bitpshr.info/cdn/ba-simple-proxy.php"; + var params = "?url=https://github.com/"+args.user+"/"+args.repo+"/graphs/owner_participation"; - _createContainer: function(){ - return domConstruct.create("div", { - innerHTML : '', - style : 'color:grey; position:relative; line-height:15px; '+ - 'border-radius:3px; border:1px solid #E5E5E5;background:white;'+ - 'height:55px;text-align:center;width:'+(this.width+14)+'px' - }, this.node); - }, - - - - _showError: function(err){ - this.graphContainer.innerHTML = ''; - dojo.create('div',{ - innerHTML:'Can not find repository.', - style:'margin-top:20px;font:12px arial;' - },this.graphContainer); - }, - - getParticipationData: function(){ - var self = this; - return xhr('http://bitpshr.info/cdn/ba-simple-proxy.php?url=https://github.com/'+args.user+'/'+args.repo+"/graphs/owner_participation", { - handleAs: 'json' - }); - }, - - //Render canvas element - createCanvas : function(){ - this.graphContainer.innerHTML = ''; - this.canvas = dojo.create('canvas',{ - width:this.width,height:this.height,style:'position:relative;margin-top:11px;' - },this.graphContainer); - }, - - //Render bottom part of graph - createLower : function(){ - var img = this.createKey(); - //Participation key - dojo.create('span',{ - innerHTML:'52 week participation', - style:'position:absolute;right:7px;font:10px arial;' - },img,'after'); - //Commits by owner key - dojo.create('span',{ - innerHTML:'commits by owner', - style:'position:absolute;left:82px;font:10px arial;' - },img,'after'); - //All commits key - dojo.create('span',{ - innerHTML:'all commits', - style:'position:absolute;left:16px;float:left;font:10px arial;' - },img,'after'); - //Color legends - dojo.create('div',{ - style:'display:inline-block;position:absolute;left:7px;'+ - 'background:lightgrey;width:7px;height:7px;top:35px' - },img,'after'); - dojo.create('div',{ - style:'display:inline-block;position:absolute;left:73px;'+ - 'background:#3377CC;width:7px;height:7px;top:35px' - },img,'after'); - }, - - //Builds graph key - createKey : function(){ - var img = dojo.create('img',{ - src:'http://bitpshr.github.com/Gitgraph/bin/gitgraph.png', - style:'position:relative;top:-11px;' - },this.graphContainer); - var currHeight = img.offsetHeight; - dojo.style(img,'width',this.width+'px'); - dojo.style(img,'height','4px'); - dojo.create('br',{},img,'after'); - return img; - }, - - //Populates graph with data points - populate : function(){ - var context = this.canvas.getContext("2d"), - width = this.width / this.total.length, - height = this.height, - max = Math.max.apply(Math, this.total), - scale = max >= height ? parseFloat(height - 1) / max : 1; - function render(value, index){ - value *= scale; - context.fillRect(index * width, height - value, width - 1, value); - } - context.fillStyle = 'rgb(202, 202, 202)'; - dojo.forEach(this.total, render); - context.fillStyle = 'rgb(51, 102, 153)'; - dojo.forEach(this.own, render); - } - }; - - lang.hitch(app, "init")(); + // 4. Fetch participation data + xhr(proxy+params, { + handleAs: 'json' + }).then(function(data){ + var total = data.contents.all; + var own = data.contents.owner; + // 5. build canvas + var canvas = domConstruct.create('canvas',{ + width: w, + height: h, + style : 'position:relative;' + },graphContainer,"only"); + // 7. Do some gd math + var c = canvas.getContext("2d"); + var width = w / total.length; + var height = h; + var max = Math.max.apply(Math, total); + var scale = max >= height ? parseFloat(height - 1) / max : 1; + // 6. Function to render each rectangle + var render = function (value, index){ + value *= scale; + c.fillRect(index * width, height - value, width - 1, value); + }; + // 8. Set some styles n' stuff + c.fillStyle = 'rgb(202, 202, 202)'; + array.forEach(total, render); + c.fillStyle = 'rgb(51, 102, 153)'; + array.forEach(own, render); + }); }); + return graphContainer; }; From 4ccb210c30fb6765dd5be48c5efb9b819ad780e0 Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Fri, 30 Nov 2012 10:58:41 -0500 Subject: [PATCH 30/64] Update README.markdown --- README.markdown | 57 +++++++++++++++++-------------------------------- 1 file changed, 20 insertions(+), 37 deletions(-) diff --git a/README.markdown b/README.markdown index 1e3a11b..50ed1a0 100644 --- a/README.markdown +++ b/README.markdown @@ -1,42 +1,25 @@ -##Gitgraph - -Pure JS github participation graph using canvas element. [Demo](http://bouchon.github.com/Gitgraph). +##About +Dirt simple GitHub participation graphs built with a Canvas element and sorcery. ##Usage - -* Paste into your page's HEAD - - ```console - - ``` - -* From within a script tag or a JS file - - ```javascript - var graph = new Gitgraph({ - user : 'bouchon', // any github username - repo : 'coweb', // name of repo - domNode : document.body, // (optional) domNode to attach to - width : '416px' // (optional) custom graph width - }); - ``` - -* Or use it as a jQuery plugin - - ```javascript - $('#demoHolder').gitgraph({ - user:'bouchon', // any github username - repo:'Gitgraph', // name of repo - width: '416px' // (optional) custom graph width - }); - ``` - -FYI, the script uses a little Dojo, and will require it if its not already loaded. Nothing to worry about! - -##Issues & Features - -File under the Issues section and feel free to fork and pull-request +1. Paste into your page's HEAD +```console + +``` + +2. From within a script tag or a JS file +```javascript + var graph = new Gitgraph({ + user : 'nex3', // any github username + repo : 'sass', // name of repo + domNode : document.body, // (optional) DOM node to attach to + width : 800, // (optional) graph width + height : 300, // (optional) graph height + allColor: "rgb(202, 202, 202)", // (optional) color of user's participation + userColor: "rgb(51, 102, 153)", // (optional) color of total participation + background: "white" // (optional) background styles + }); +``` ##License - WTFPL \ No newline at end of file From bee7292bfada6b4bc7a3eae229b00a44942038dd Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Fri, 30 Nov 2012 11:02:34 -0500 Subject: [PATCH 31/64] Update README.markdown --- README.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 50ed1a0..2109240 100644 --- a/README.markdown +++ b/README.markdown @@ -1,9 +1,10 @@ ##About -Dirt simple GitHub participation graphs built with a Canvas element and sorcery. +Dirt simple [Dojo](http://dojotoolkit.org)-powered GitHub participation graphs built with a `` element and sorcery. ##Usage 1. Paste into your page's HEAD ```console + ``` From 2160d63c747ac662650f4854b4f53d6342a3b130 Mon Sep 17 00:00:00 2001 From: bitpshr Date: Fri, 30 Nov 2012 10:59:58 -0500 Subject: [PATCH 32/64] Allow for more custom styling --- Gitgraph.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Gitgraph.js b/Gitgraph.js index 30cf694..cea30b5 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -14,8 +14,11 @@ window.Gitgraph = function(args){ "dojo/domReady!" ], function(domConstruct, domAttr, lang, array, xhr){ // 1. Grab args - var h = args.height ? parseInt(args.height.substr(0,args.height.length-2)) : 40; - var w = args.width ? parseInt(args.width.substr(0,args.width.length-2)) : 416; + var h = args.height || 40; + var w = args.width || 416; + var bg = args.background || "white"; + var userColor = args.userColor || 'rgb(51, 102, 153)'; + var allColor = args.allColor || 'rgb(202, 202, 202)'; var node = args.domNode || document.body; // 2. Build container (the inline styles are ugly but k.i.s.s.) @@ -23,7 +26,7 @@ window.Gitgraph = function(args){ ''); domAttr.set(graphContainer, "style", - 'padding:5px; border-radius:4px; background:white;position:relative;'+ + 'padding:5px; border-radius:4px; background:'+bg+';position:relative;'+ 'height:'+h+'px;text-align:center;width:'+w+'px'); domConstruct.place(graphContainer, node, "first"); @@ -49,16 +52,16 @@ window.Gitgraph = function(args){ var width = w / total.length; var height = h; var max = Math.max.apply(Math, total); - var scale = max >= height ? parseFloat(height - 1) / max : 1; + var scale = parseFloat(height - 1) / max; // 6. Function to render each rectangle var render = function (value, index){ value *= scale; c.fillRect(index * width, height - value, width - 1, value); }; // 8. Set some styles n' stuff - c.fillStyle = 'rgb(202, 202, 202)'; + c.fillStyle = allColor; array.forEach(total, render); - c.fillStyle = 'rgb(51, 102, 153)'; + c.fillStyle = userColor; array.forEach(own, render); }); }); From 3230c3efb300634536bd9dc3b4d8eedfe93f4010 Mon Sep 17 00:00:00 2001 From: bitpshr Date: Fri, 30 Nov 2012 15:37:36 -0500 Subject: [PATCH 33/64] Added demo page for now --- Gitgraph.js | 4 ++- demo.html | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 demo.html diff --git a/Gitgraph.js b/Gitgraph.js index cea30b5..a778299 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -5,6 +5,9 @@ window.Gitgraph = function(args){ var graphContainer = document.createElement("div"); + var node = args.domNode || document.body; + node.appendChild(graphContainer); + require([ "dojo/dom-construct", "dojo/dom-attr", @@ -19,7 +22,6 @@ window.Gitgraph = function(args){ var bg = args.background || "white"; var userColor = args.userColor || 'rgb(51, 102, 153)'; var allColor = args.allColor || 'rgb(202, 202, 202)'; - var node = args.domNode || document.body; // 2. Build container (the inline styles are ugly but k.i.s.s.) domAttr.set(graphContainer, "innerHTML", diff --git a/demo.html b/demo.html new file mode 100644 index 0000000..3051420 --- /dev/null +++ b/demo.html @@ -0,0 +1,102 @@ + + + + + + + + + + + + +
+
Gitgraph
+
+
+
+
+
+ + + + + \ No newline at end of file From 779f80e837263cb70a753cd59695bea242686e75 Mon Sep 17 00:00:00 2001 From: bitpshr Date: Fri, 30 Nov 2012 17:29:44 -0500 Subject: [PATCH 34/64] Updated demo to look mo' sheckshy --- demo.html | 150 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 121 insertions(+), 29 deletions(-) diff --git a/demo.html b/demo.html index 3051420..f701d82 100644 --- a/demo.html +++ b/demo.html @@ -1,27 +1,29 @@ - - - - - - - - - + + + + + + + + + Gitgraph
Gitgraph
+
+ Dirt simple Dojo-powered GitHub + participation graphs built with a canvas element and sorcery. +
+
+
@@ -59,29 +138,29 @@ repo : 'sass', // name of repo domNode : document.getElementById("graphDiv"), // (optional) domNode to attach to width : 800, // (optional) custom graph width - height : 80, + height : 170, allColor: "rgb(202, 202, 202)", userColor: "rgb(51, 102, 153)", background: "white" }); graph.className += "graph"; var graph2 = new Gitgraph({ - user : 'nex3', // any github username - repo : 'sass', // name of repo - domNode : document.getElementById("graphDiv"), // (optional) domNode to attach to + user : 'josephg', // any github username + repo : 'sharejs', // name of repo + domNode : document.getElementById("graphDiv2"), // (optional) domNode to attach to width : 800, // (optional) custom graph width - height : 30, + height : 50, allColor: "rgb(202, 202, 202)", userColor: "rgb(51, 102, 153)", background: "white" }); graph2.className += "graph"; var graph3 = new Gitgraph({ - user : 'nex3', // any github username - repo : 'sass', // name of repo - domNode : document.getElementById("graphDiv"), // (optional) domNode to attach to + user : 'imathis', // any github username + repo : 'octopress', // name of repo + domNode : document.getElementById("graphDiv3"), // (optional) domNode to attach to width : 800, // (optional) custom graph width - height : 120, + height : 100, allColor: "rgb(202, 202, 202)", userColor: "rgb(51, 102, 153)", background: "white" @@ -90,13 +169,26 @@ var graph4 = new Gitgraph({ user : 'nex3', // any github username repo : 'sass', // name of repo - domNode : document.getElementById("graphDiv"), // (optional) domNode to attach to + domNode : document.getElementById("graphDiv4"), // (optional) domNode to attach to width : 800, // (optional) custom graph width - height : 200, + height : 70, allColor: "rgb(202, 202, 202)", userColor: "rgb(51, 102, 153)", background: "white" }); graph4.className += "graph"; + \ No newline at end of file From d3ea4ead509df4d1146cdbd05de3f084d55b920f Mon Sep 17 00:00:00 2001 From: bitpshr Date: Fri, 30 Nov 2012 18:29:44 -0500 Subject: [PATCH 35/64] No more Dojo dependency --- Gitgraph.js | 128 +++++++++++++++++++++++++++--------------------- README.markdown | 19 ++++--- demo.html | 26 +++++----- 3 files changed, 93 insertions(+), 80 deletions(-) diff --git a/Gitgraph.js b/Gitgraph.js index a778299..0def874 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -8,64 +8,80 @@ window.Gitgraph = function(args){ var node = args.domNode || document.body; node.appendChild(graphContainer); - require([ - "dojo/dom-construct", - "dojo/dom-attr", - "dojo/_base/lang", - "dojo/_base/array", - "dojo/request/xhr", - "dojo/domReady!" - ], function(domConstruct, domAttr, lang, array, xhr){ - // 1. Grab args - var h = args.height || 40; - var w = args.width || 416; - var bg = args.background || "white"; - var userColor = args.userColor || 'rgb(51, 102, 153)'; - var allColor = args.allColor || 'rgb(202, 202, 202)'; + // 1. Grab args + var h = args.height || 40; + var w = args.width || 416; + var bg = args.background || "white"; + var userColor = args.userColor || 'rgb(51, 102, 153)'; + var allColor = args.allColor || 'rgb(202, 202, 202)'; - // 2. Build container (the inline styles are ugly but k.i.s.s.) - domAttr.set(graphContainer, "innerHTML", - ''); - domAttr.set(graphContainer, "style", - 'padding:5px; border-radius:4px; background:'+bg+';position:relative;'+ - 'height:'+h+'px;text-align:center;width:'+w+'px'); - domConstruct.place(graphContainer, node, "first"); + // 2. Build container (the inline styles are ugly but k.i.s.s.) + graphContainer.innerHTML = ''; + graphContainer.style.cssText = 'padding:5px; border-radius:4px; background:'+bg+';position:relative;'+ + 'height:'+h+'px;text-align:center;width:'+w+'px'; + node.appendChild(graphContainer); - // 3. Build our request url (need to proxy bc GitHub - // hasn't exposed this data via the API yet...they plan to) - var proxy = "http://bitpshr.info/cdn/ba-simple-proxy.php"; - var params = "?url=https://github.com/"+args.user+"/"+args.repo+"/graphs/owner_participation"; + // 3. Build our request url (need to proxy bc GitHub + // hasn't exposed this data via the API yet...they plan to) + var proxy = "http://bitpshr.info/cdn/ba-simple-proxy.php"; + var params = "?url=https://github.com/"+args.user+"/"+args.repo+"/graphs/owner_participation"; + + // 4. Fetch participation data + var xhr = new XMLHttpRequest(); + xhr.open("GET", proxy+params, true); + xhr.onreadystatechange = function () { + if(xhr.readyState==4 && xhr.status==200 ) { + var data = JSON.parse( xhr.responseText ); + if(data.contents && data.contents.all){ + var total = data.contents.all; + var own = data.contents.owner; + var repo = "https://github.com/"+args.user+"/"+args.repo+"/"; + + // 5. build canvas + graphContainer.innerHTML = ""; + var canvas = document.createElement("canvas"); + canvas.width = w; + canvas.height = h; + canvas.style.cssText = "position:relative;"; + var href = document.createElement("a"); + href.href = repo; + graphContainer.appendChild(href); + href.appendChild(canvas); + + // 6. build repo indicator + var indicator = document.createElement("div"); + indicator.style.cssText = "font-size:12px;border-radius:3px;color:#EEE;background-color:rgba(0,0,0,0.5);display:inline-block;padding:5px;position:absolute;top:5px;right:5px;"; + indicator.innerHTML = args.user+"/"+args.repo; + href.appendChild(indicator); + + // 7. Do some gd math + var c = canvas.getContext("2d"); + var width = w / total.length; + var height = h; + var max = Math.max.apply(Math, total); + var scale = parseFloat(height - 1) / max; + + // 6. Function to render each rectangle + var render = function (value, index){ + value *= scale; + c.fillRect(index * width, height - value, width - 1, value); + }; + + // 8. Set some styles n' stuff + c.fillStyle = allColor; + var i; + for(i=0; i` element and sorcery. +Dirt simple [GitHub participation graphs built with a `` element and sorcery. ##Usage 1. Paste into your page's HEAD ```console - ``` 2. From within a script tag or a JS file ```javascript var graph = new Gitgraph({ - user : 'nex3', // any github username - repo : 'sass', // name of repo - domNode : document.body, // (optional) DOM node to attach to - width : 800, // (optional) graph width - height : 300, // (optional) graph height - allColor: "rgb(202, 202, 202)", // (optional) color of user's participation - userColor: "rgb(51, 102, 153)", // (optional) color of total participation - background: "white" // (optional) background styles + user : 'nex3', // any github username + repo : 'sass', // name of repo + domNode : document.body, // (optional) DOM node to attach to + width : 800, // (optional) graph width + height : 300, // (optional) graph height + allColor : "rgb(202, 202, 202)", // (optional) color of user's participation + userColor : "rgb(51, 102, 153)", // (optional) color of total participation + background : "white" // (optional) background styles }); ``` diff --git a/demo.html b/demo.html index f701d82..91153bf 100644 --- a/demo.html +++ b/demo.html @@ -13,7 +13,7 @@ body{ background:url(http://subtlepatterns.com/patterns/always_grey.png); text-align: center; - color:#AAA; + color:#BBB; font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; } @@ -110,10 +110,9 @@
-
Gitgraph
+
- Dirt simple Dojo-powered GitHub - participation graphs built with a canvas element and sorcery. + Dirt simple GitHub participation graphs built with a canvas element and sorcery.
@@ -130,7 +129,6 @@
- From f8508d9777aca495a48c50c2dd1e784f656e1d3f Mon Sep 17 00:00:00 2001 From: bitpshr Date: Fri, 30 Nov 2012 18:31:04 -0500 Subject: [PATCH 36/64] No more Dojo dependency --- demo.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo.html b/demo.html index 91153bf..729fa97 100644 --- a/demo.html +++ b/demo.html @@ -46,7 +46,7 @@ } .subtitle{ - font-size: 24px; + font-size: 22px; width:800px; margin-right: auto; margin-left: auto; From 47d7791a61b7a8f38293fc178b407a1e1344a66b Mon Sep 17 00:00:00 2001 From: bitpshr Date: Fri, 30 Nov 2012 18:35:02 -0500 Subject: [PATCH 37/64] Finalizing README --- README.markdown | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index c01c0cf..398e211 100644 --- a/README.markdown +++ b/README.markdown @@ -1,5 +1,5 @@ ##About -Dirt simple [GitHub participation graphs built with a `` element and sorcery. +Dirt simple GitHub participation graphs built with a `` element and sorcery. ##Usage 1. Paste into your page's HEAD @@ -21,5 +21,8 @@ Dirt simple [GitHub participation graphs built with a `` element and sor }); ``` +##Limitations +GitHub hasn't exposed participation data via the [api](http://developer.github.com/v3/) yet, but plans to. Until then, I a [simple proxy](http://benalman.com/code/projects/php-simple-proxy/docs/files/ba-simple-proxy-php.html) is required via my domain. + ##License WTFPL \ No newline at end of file From 24ef70ea41a298b31f120fdea937245c39c54b46 Mon Sep 17 00:00:00 2001 From: bitpshr Date: Fri, 30 Nov 2012 18:36:14 -0500 Subject: [PATCH 38/64] Finalizing README --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 398e211..26ac09b 100644 --- a/README.markdown +++ b/README.markdown @@ -22,7 +22,7 @@ Dirt simple GitHub participation graphs built with a `` element and sorc ``` ##Limitations -GitHub hasn't exposed participation data via the [api](http://developer.github.com/v3/) yet, but plans to. Until then, I a [simple proxy](http://benalman.com/code/projects/php-simple-proxy/docs/files/ba-simple-proxy-php.html) is required via my domain. +GitHub hasn't exposed participation data via the [api](http://developer.github.com/v3/) yet, but plans to. Until then, requests funnel through a [simple proxy](http://benalman.com/code/projects/php-simple-proxy/docs/files/ba-simple-proxy-php.html) via [my vps](http://bitpshr.info). ##License WTFPL \ No newline at end of file From 1c8b69ffee4b2bdcd496ca53b8fd6686de66b72e Mon Sep 17 00:00:00 2001 From: bitpshr Date: Fri, 30 Nov 2012 18:43:47 -0500 Subject: [PATCH 39/64] Added minified file --- Gitgraph.min.js | 1 + README.markdown | 2 +- demo.html | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 Gitgraph.min.js diff --git a/Gitgraph.min.js b/Gitgraph.min.js new file mode 100644 index 0000000..af39313 --- /dev/null +++ b/Gitgraph.min.js @@ -0,0 +1 @@ +window.Gitgraph=function(_1){var _2=document.createElement("div");var _3=_1.domNode||document.body;_3.appendChild(_2);var h=_1.height||40;var w=_1.width||416;var bg=_1.background||"white";var _4=_1.userColor||"rgb(51, 102, 153)";var _5=_1.allColor||"rgb(202, 202, 202)";_2.innerHTML="";_2.style.cssText="padding:5px; border-radius:4px; background:"+bg+";position:relative;"+"height:"+h+"px;text-align:center;width:"+w+"px";_3.appendChild(_2);var _6="http://bitpshr.info/cdn/ba-simple-proxy.php";var _7="?url=https://github.com/"+_1.user+"/"+_1.repo+"/graphs/owner_participation";var _8=new XMLHttpRequest();_8.open("GET",_6+_7,true);_8.onreadystatechange=function(){if(_8.readyState==4&&_8.status==200){var _9=JSON.parse(_8.responseText);if(_9.contents&&_9.contents.all){var _a=_9.contents.all;var _b=_9.contents.owner;var _c="https://github.com/"+_1.user+"/"+_1.repo+"/";_2.innerHTML="";var _d=document.createElement("canvas");_d.width=w;_d.height=h;_d.style.cssText="position:relative;";var _e=document.createElement("a");_e.href=_c;_2.appendChild(_e);_e.appendChild(_d);var _f=document.createElement("div");_f.style.cssText="font-size:12px;border-radius:3px;color:#EEE;background-color:rgba(0,0,0,0.5);display:inline-block;padding:5px;position:absolute;top:5px;right:5px;";_f.innerHTML=_1.user+"/"+_1.repo;_e.appendChild(_f);var c=_d.getContext("2d");var _10=w/_a.length;var _11=h;var max=Math.max.apply(Math,_a);var _12=parseFloat(_11-1)/max;var _13=function(_14,_15){_14*=_12;c.fillRect(_15*_10,_11-_14,_10-1,_14);};c.fillStyle=_5;var i;for(i=0;i<_a.length;i++){_13(_a[i],i);}c.fillStyle=_4;for(i=0;i<_b.length;i++){_13(_b[i],i);}}}};_8.send(null);return _2;}; \ No newline at end of file diff --git a/README.markdown b/README.markdown index 26ac09b..72018be 100644 --- a/README.markdown +++ b/README.markdown @@ -4,7 +4,7 @@ Dirt simple GitHub participation graphs built with a `` element and sorc ##Usage 1. Paste into your page's HEAD ```console - + ``` 2. From within a script tag or a JS file diff --git a/demo.html b/demo.html index 729fa97..722161f 100644 --- a/demo.html +++ b/demo.html @@ -129,7 +129,7 @@ - + + allowtransparency="true" frameborder="0" scrolling="0" width="85px" height="30px"> + allowtransparency="true" frameborder="0" scrolling="0" width="85px" height="30px">
Built by @bitpshr under the WTFPL license. From ec92c79d4b519506b89392cdce7be061bf479cb1 Mon Sep 17 00:00:00 2001 From: Paul Bouchon Date: Fri, 30 Nov 2012 23:35:29 -0500 Subject: [PATCH 44/64] Update README.markdown --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 8a5ad9a..5bb89e3 100644 --- a/README.markdown +++ b/README.markdown @@ -4,7 +4,7 @@ Dirt simple GitHub participation graphs built with a `` element and sorcery. ##Usage -1. Paste into your page's HEAD +1. Paste right before your page's closing `` tag ```console ``` From 3319aaebcd0064e66f3b2669ecfaf31d08bb5074 Mon Sep 17 00:00:00 2001 From: bitpshr Date: Mon, 3 Dec 2012 09:08:04 -0500 Subject: [PATCH 45/64] Added some padding on the dem opage --- demo.html | 1 + 1 file changed, 1 insertion(+) diff --git a/demo.html b/demo.html index 17acd43..6328de2 100644 --- a/demo.html +++ b/demo.html @@ -104,6 +104,7 @@ .copyright{ font-size: 14px; text-align: center; + margin-bottom:75px; } .twitter-share-button{ From e9068e2c8393b5b3847df8ac8c0ceffe2d3cec6d Mon Sep 17 00:00:00 2001 From: bitpshr Date: Mon, 3 Dec 2012 14:41:54 -0500 Subject: [PATCH 46/64] Add ability to turn off labels --- Gitgraph.js | 11 +++++---- Gitgraph.min.js | 2 +- README.markdown | 59 +++++++++++++++++++++++++------------------------ 3 files changed, 38 insertions(+), 34 deletions(-) diff --git a/Gitgraph.js b/Gitgraph.js index 0def874..0c3a447 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -14,6 +14,7 @@ window.Gitgraph = function(args){ var bg = args.background || "white"; var userColor = args.userColor || 'rgb(51, 102, 153)'; var allColor = args.allColor || 'rgb(202, 202, 202)'; + var showName = args.showName!=null ? args.showName : true; // 2. Build container (the inline styles are ugly but k.i.s.s.) graphContainer.innerHTML = '` tag -```console - -``` - -2. From within a script tag or a JS file -```javascript - var graph = new Gitgraph({ - user : 'nex3', // any github username - repo : 'sass', // name of repo - domNode : document.body, // (optional) DOM node to attach to - width : 800, // (optional) graph width - height : 300, // (optional) graph height - allColor : "rgb(202, 202, 202)", // (optional) color of user's participation - userColor : "rgb(51, 102, 153)", // (optional) color of total participation - background : "white" // (optional) background styles - }); -``` - -##Limitations -GitHub hasn't exposed participation data via the [api](http://developer.github.com/v3/) yet, but plans to. Until then, requests funnel through a [simple proxy](http://benalman.com/code/projects/php-simple-proxy/docs/files/ba-simple-proxy-php.html) via [my vps](http://bitpshr.info). - -##License +[Gitgraph](http://bitpshr.info/gitgraph) +================= + +Dirt simple GitHub participation graphs built with a `` element and sorcery. + +##Usage +1. Paste right before your page's closing `` tag +```console + +``` + +2. From within a script tag or a JS file +```javascript + var graph = new Gitgraph({ + user : 'nex3', // any github username + repo : 'sass', // name of repo + domNode : document.body, // (optional) DOM node to attach to + width : 800, // (optional) graph width + height : 300, // (optional) graph height + allColor : "rgb(202, 202, 202)", // (optional) color of user's participation + userColor : "rgb(51, 102, 153)", // (optional) color of total participation + background : "white", // (optional) background styles + showName : true // (optional) show or hide name of user / repo + }); +``` + +##Limitations +GitHub hasn't exposed participation data via the [api](http://developer.github.com/v3/) yet, but plans to. Until then, requests funnel through a [simple proxy](http://benalman.com/code/projects/php-simple-proxy/docs/files/ba-simple-proxy-php.html) via [my vps](http://bitpshr.info). + +##License [WTFPL](http://sam.zoy.org/wtfpl/) \ No newline at end of file From cbf5fd8930f3bcbe279bfb3c5ff8375c2a295324 Mon Sep 17 00:00:00 2001 From: bitpshr Date: Mon, 3 Dec 2012 18:51:29 -0500 Subject: [PATCH 47/64] A few style updates --- Gitgraph.js | 4 ++-- Gitgraph.min.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gitgraph.js b/Gitgraph.js index 0c3a447..052d75c 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -17,7 +17,7 @@ window.Gitgraph = function(args){ var showName = args.showName!=null ? args.showName : true; // 2. Build container (the inline styles are ugly but k.i.s.s.) - graphContainer.innerHTML = ''; graphContainer.style.cssText = 'padding:5px; border-radius:4px; background:'+bg+';position:relative;'+ 'height:'+h+'px;text-align:center;width:'+w+'px'; @@ -40,7 +40,7 @@ window.Gitgraph = function(args){ var repo = "https://github.com/"+args.user+"/"+args.repo+"/"; // 5. build canvas - graphContainer.innerHTML = ""; + //graphContainer.innerHTML = ""; var canvas = document.createElement("canvas"); canvas.width = w; canvas.height = h; diff --git a/Gitgraph.min.js b/Gitgraph.min.js index 582c000..3a1da84 100644 --- a/Gitgraph.min.js +++ b/Gitgraph.min.js @@ -1 +1 @@ -window.Gitgraph=function(_1){var _2=document.createElement("div");var _3=_1.domNode||document.body;_3.appendChild(_2);var h=_1.height||40;var w=_1.width||416;var bg=_1.background||"white";var _4=_1.userColor||"rgb(51, 102, 153)";var _5=_1.allColor||"rgb(202, 202, 202)";var _6=_1.showName!=null?_1.showName:true;_2.innerHTML="";_2.style.cssText="padding:5px; border-radius:4px; background:"+bg+";position:relative;"+"height:"+h+"px;text-align:center;width:"+w+"px";_3.appendChild(_2);var _7="http://bitpshr.info/cdn/ba-simple-proxy.php";var _8="?url=https://github.com/"+_1.user+"/"+_1.repo+"/graphs/owner_participation";var _9=new XMLHttpRequest();_9.open("GET",_7+_8,true);_9.onreadystatechange=function(){if(_9.readyState==4&&_9.status==200){var _a=JSON.parse(_9.responseText);if(_a.contents&&_a.contents.all){var _b=_a.contents.all;var _c=_a.contents.owner;var _d="https://github.com/"+_1.user+"/"+_1.repo+"/";_2.innerHTML="";var _e=document.createElement("canvas");_e.width=w;_e.height=h;_e.style.cssText="position:relative;";var _f=document.createElement("a");_f.href=_d;_2.appendChild(_f);_f.appendChild(_e);if(_6){var _10=document.createElement("div");_10.style.cssText="font-size:12px;border-radius:3px;color:#EEE;background-color:rgba(0,0,0,0.5);display:inline-block;padding:5px;position:absolute;top:5px;right:5px;";_10.innerHTML=_1.user+"/"+_1.repo;_f.appendChild(_10);}var c=_e.getContext("2d");var _11=w/_b.length;var _12=h;var max=Math.max.apply(Math,_b);var _13=parseFloat(_12-1)/max;var _14=function(_15,_16){_15*=_13;c.fillRect(_16*_11,_12-_15,_11-1,_15);};c.fillStyle=_5;var i;for(i=0;i<_b.length;i++){_14(_b[i],i);}c.fillStyle=_4;for(i=0;i<_c.length;i++){_14(_c[i],i);}}}};_9.send(null);return _2;}; \ No newline at end of file +window.Gitgraph=function(_1){var _2=document.createElement("div");var _3=_1.domNode||document.body;_3.appendChild(_2);var h=_1.height||40;var w=_1.width||416;var bg=_1.background||"white";var _4=_1.userColor||"rgb(51, 102, 153)";var _5=_1.allColor||"rgb(202, 202, 202)";var _6=_1.showName!=null?_1.showName:true;_2.innerHTML="";_2.style.cssText="padding:5px; border-radius:4px; background:"+bg+";position:relative;"+"height:"+h+"px;text-align:center;width:"+w+"px";_3.appendChild(_2);var _7="http://bitpshr.info/cdn/ba-simple-proxy.php";var _8="?url=https://github.com/"+_1.user+"/"+_1.repo+"/graphs/owner_participation";var _9=new XMLHttpRequest();_9.open("GET",_7+_8,true);_9.onreadystatechange=function(){if(_9.readyState==4&&_9.status==200){var _a=JSON.parse(_9.responseText);if(_a.contents&&_a.contents.all){var _b=_a.contents.all;var _c=_a.contents.owner;var _d="https://github.com/"+_1.user+"/"+_1.repo+"/";var _e=document.createElement("canvas");_e.width=w;_e.height=h;_e.style.cssText="position:relative;";var _f=document.createElement("a");_f.href=_d;_2.appendChild(_f);_f.appendChild(_e);if(_6){var _10=document.createElement("div");_10.style.cssText="font-size:12px;border-radius:3px;color:#EEE;background-color:rgba(0,0,0,0.5);display:inline-block;padding:5px;position:absolute;top:5px;right:5px;";_10.innerHTML=_1.user+"/"+_1.repo;_f.appendChild(_10);}var c=_e.getContext("2d");var _11=w/_b.length;var _12=h;var max=Math.max.apply(Math,_b);var _13=parseFloat(_12-1)/max;var _14=function(_15,_16){_15*=_13;c.fillRect(_16*_11,_12-_15,_11-1,_15);};c.fillStyle=_5;var i;for(i=0;i<_b.length;i++){_14(_b[i],i);}c.fillStyle=_4;for(i=0;i<_c.length;i++){_14(_c[i],i);}}}};_9.send(null);return _2;}; \ No newline at end of file From f55edc17c891438b0dc56fc6b748e2d8d3df9c72 Mon Sep 17 00:00:00 2001 From: bitpshr Date: Mon, 3 Dec 2012 19:09:23 -0500 Subject: [PATCH 48/64] fixing typo --- Gitgraph.js | 2 +- Gitgraph.min.js | 64 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/Gitgraph.js b/Gitgraph.js index 052d75c..6a0061d 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -40,7 +40,7 @@ window.Gitgraph = function(args){ var repo = "https://github.com/"+args.user+"/"+args.repo+"/"; // 5. build canvas - //graphContainer.innerHTML = ""; + graphContainer.innerHTML = ""; var canvas = document.createElement("canvas"); canvas.width = w; canvas.height = h; diff --git a/Gitgraph.min.js b/Gitgraph.min.js index 3a1da84..842a21b 100644 --- a/Gitgraph.min.js +++ b/Gitgraph.min.js @@ -1 +1,63 @@ -window.Gitgraph=function(_1){var _2=document.createElement("div");var _3=_1.domNode||document.body;_3.appendChild(_2);var h=_1.height||40;var w=_1.width||416;var bg=_1.background||"white";var _4=_1.userColor||"rgb(51, 102, 153)";var _5=_1.allColor||"rgb(202, 202, 202)";var _6=_1.showName!=null?_1.showName:true;_2.innerHTML="";_2.style.cssText="padding:5px; border-radius:4px; background:"+bg+";position:relative;"+"height:"+h+"px;text-align:center;width:"+w+"px";_3.appendChild(_2);var _7="http://bitpshr.info/cdn/ba-simple-proxy.php";var _8="?url=https://github.com/"+_1.user+"/"+_1.repo+"/graphs/owner_participation";var _9=new XMLHttpRequest();_9.open("GET",_7+_8,true);_9.onreadystatechange=function(){if(_9.readyState==4&&_9.status==200){var _a=JSON.parse(_9.responseText);if(_a.contents&&_a.contents.all){var _b=_a.contents.all;var _c=_a.contents.owner;var _d="https://github.com/"+_1.user+"/"+_1.repo+"/";var _e=document.createElement("canvas");_e.width=w;_e.height=h;_e.style.cssText="position:relative;";var _f=document.createElement("a");_f.href=_d;_2.appendChild(_f);_f.appendChild(_e);if(_6){var _10=document.createElement("div");_10.style.cssText="font-size:12px;border-radius:3px;color:#EEE;background-color:rgba(0,0,0,0.5);display:inline-block;padding:5px;position:absolute;top:5px;right:5px;";_10.innerHTML=_1.user+"/"+_1.repo;_f.appendChild(_10);}var c=_e.getContext("2d");var _11=w/_b.length;var _12=h;var max=Math.max.apply(Math,_b);var _13=parseFloat(_12-1)/max;var _14=function(_15,_16){_15*=_13;c.fillRect(_16*_11,_12-_15,_11-1,_15);};c.fillStyle=_5;var i;for(i=0;i<_b.length;i++){_14(_b[i],i);}c.fillStyle=_4;for(i=0;i<_c.length;i++){_14(_c[i],i);}}}};_9.send(null);return _2;}; \ No newline at end of file +window.Gitgraph=function(_1){ +var _2=document.createElement("div"); +var _3=_1.domNode||document.body; +_3.appendChild(_2); +var h=_1.height||40; +var w=_1.width||416; +var bg=_1.background||"white"; +var _4=_1.userColor||"rgb(51, 102, 153)"; +var _5=_1.allColor||"rgb(202, 202, 202)"; +var _6=_1.showName!=null?_1.showName:true; +_2.innerHTML=""; +_2.style.cssText="padding:5px; border-radius:4px; background:"+bg+";position:relative;"+"height:"+h+"px;text-align:center;width:"+w+"px"; +_3.appendChild(_2); +var _7="http://bitpshr.info/cdn/ba-simple-proxy.php"; +var _8="?url=https://github.com/"+_1.user+"/"+_1.repo+"/graphs/owner_participation"; +var _9=new XMLHttpRequest(); +_9.open("GET",_7+_8,true); +_9.onreadystatechange=function(){ +if(_9.readyState==4&&_9.status==200){ +var _a=JSON.parse(_9.responseText); +if(_a.contents&&_a.contents.all){ +var _b=_a.contents.all; +var _c=_a.contents.owner; +var _d="https://github.com/"+_1.user+"/"+_1.repo+"/"; +_2.innerHTML=""; +var _e=document.createElement("canvas"); +_e.width=w; +_e.height=h; +_e.style.cssText="position:relative;"; +var _f=document.createElement("a"); +_f.href=_d; +_2.appendChild(_f); +_f.appendChild(_e); +if(_6){ +var _10=document.createElement("div"); +_10.style.cssText="font-size:12px;border-radius:3px;color:#EEE;background-color:rgba(0,0,0,0.5);display:inline-block;padding:5px;position:absolute;top:5px;right:5px;"; +_10.innerHTML=_1.user+"/"+_1.repo; +_f.appendChild(_10); +} +var c=_e.getContext("2d"); +var _11=w/_b.length; +var _12=h; +var max=Math.max.apply(Math,_b); +var _13=parseFloat(_12-1)/max; +var _14=function(_15,_16){ +_15*=_13; +c.fillRect(_16*_11,_12-_15,_11-1,_15); +}; +c.fillStyle=_5; +var i; +for(i=0;i<_b.length;i++){ +_14(_b[i],i); +} +c.fillStyle=_4; +for(i=0;i<_c.length;i++){ +_14(_c[i],i); +} +} +} +}; +_9.send(null); +return _2; +}; From 407c56fe07853e81acaea87b3249b92dffa4d0b7 Mon Sep 17 00:00:00 2001 From: bitpshr Date: Wed, 5 Dec 2012 18:36:27 -0500 Subject: [PATCH 49/64] Do things properly with a module pattern --- Gitgraph.js | 154 +++++++++++++++++++++++++----------------------- Gitgraph.min.js | 2 +- demo.html | 8 +-- 3 files changed, 86 insertions(+), 78 deletions(-) diff --git a/Gitgraph.js b/Gitgraph.js index 0def874..cb07283 100644 --- a/Gitgraph.js +++ b/Gitgraph.js @@ -3,85 +3,93 @@ // http://bouchon.github.com/Gitgraph // -window.Gitgraph = function(args){ - var graphContainer = document.createElement("div"); - var node = args.domNode || document.body; - node.appendChild(graphContainer); - - // 1. Grab args - var h = args.height || 40; - var w = args.width || 416; - var bg = args.background || "white"; - var userColor = args.userColor || 'rgb(51, 102, 153)'; - var allColor = args.allColor || 'rgb(202, 202, 202)'; +var Gitgraph = (function (args) { + // constructor + var module = function (args) { + var graphContainer = document.createElement("div"); + var node = args.domNode || document.body; + node.appendChild(graphContainer); + + // 1. Grab args + var h = args.height || 40; + var w = args.width || 416; + var bg = args.background || "white"; + var userColor = args.userColor || 'rgb(51, 102, 153)'; + var allColor = args.allColor || 'rgb(202, 202, 202)'; - // 2. Build container (the inline styles are ugly but k.i.s.s.) - graphContainer.innerHTML = ''; - graphContainer.style.cssText = 'padding:5px; border-radius:4px; background:'+bg+';position:relative;'+ - 'height:'+h+'px;text-align:center;width:'+w+'px'; - node.appendChild(graphContainer); + // 2. Build container (the inline styles are ugly but k.i.s.s.) + graphContainer.innerHTML = ''; + graphContainer.style.cssText = 'padding:5px; border-radius:4px; background:'+bg+';position:relative;'+ + 'height:'+h+'px;text-align:center;width:'+w+'px'; + node.appendChild(graphContainer); - // 3. Build our request url (need to proxy bc GitHub - // hasn't exposed this data via the API yet...they plan to) - var proxy = "http://bitpshr.info/cdn/ba-simple-proxy.php"; - var params = "?url=https://github.com/"+args.user+"/"+args.repo+"/graphs/owner_participation"; + // 3. Build our request url (need to proxy bc GitHub + // hasn't exposed this data via the API yet...they plan to) + var proxy = "http://bitpshr.info/cdn/ba-simple-proxy.php"; + var params = "?url=https://github.com/"+args.user+"/"+args.repo+"/graphs/owner_participation"; - // 4. Fetch participation data - var xhr = new XMLHttpRequest(); - xhr.open("GET", proxy+params, true); - xhr.onreadystatechange = function () { - if(xhr.readyState==4 && xhr.status==200 ) { - var data = JSON.parse( xhr.responseText ); - if(data.contents && data.contents.all){ - var total = data.contents.all; - var own = data.contents.owner; - var repo = "https://github.com/"+args.user+"/"+args.repo+"/"; + // 4. Fetch participation data + var xhr = new XMLHttpRequest(); + xhr.open("GET", proxy+params, true); + xhr.onreadystatechange = function () { + if(xhr.readyState==4 && xhr.status==200 ) { + var data = JSON.parse( xhr.responseText ); + if(data.contents && data.contents.all){ + var total = data.contents.all; + var own = data.contents.owner; + var repo = "https://github.com/"+args.user+"/"+args.repo+"/"; - // 5. build canvas - graphContainer.innerHTML = ""; - var canvas = document.createElement("canvas"); - canvas.width = w; - canvas.height = h; - canvas.style.cssText = "position:relative;"; - var href = document.createElement("a"); - href.href = repo; - graphContainer.appendChild(href); - href.appendChild(canvas); + // 5. build canvas + graphContainer.innerHTML = ""; + var canvas = document.createElement("canvas"); + canvas.width = w; + canvas.height = h; + canvas.style.cssText = "position:relative;"; + var href = document.createElement("a"); + href.href = repo; + graphContainer.appendChild(href); + href.appendChild(canvas); - // 6. build repo indicator - var indicator = document.createElement("div"); - indicator.style.cssText = "font-size:12px;border-radius:3px;color:#EEE;background-color:rgba(0,0,0,0.5);display:inline-block;padding:5px;position:absolute;top:5px;right:5px;"; - indicator.innerHTML = args.user+"/"+args.repo; - href.appendChild(indicator); + // 6. build repo indicator + var indicator = document.createElement("div"); + indicator.style.cssText = "font-size:12px;border-radius:3px;color:#EEE;background-color:rgba(0,0,0,0.5);display:inline-block;padding:5px;position:absolute;top:5px;right:5px;"; + indicator.innerHTML = args.user+"/"+args.repo; + href.appendChild(indicator); - // 7. Do some gd math - var c = canvas.getContext("2d"); - var width = w / total.length; - var height = h; - var max = Math.max.apply(Math, total); - var scale = parseFloat(height - 1) / max; + // 7. Do some gd math + var c = canvas.getContext("2d"); + var width = w / total.length; + var height = h; + var max = Math.max.apply(Math, total); + var scale = parseFloat(height - 1) / max; - // 6. Function to render each rectangle - var render = function (value, index){ - value *= scale; - c.fillRect(index * width, height - value, width - 1, value); - }; + // 6. Function to render each rectangle + var render = function (value, index){ + value *= scale; + c.fillRect(index * width, height - value, width - 1, value); + }; - // 8. Set some styles n' stuff - c.fillStyle = allColor; - var i; - for(i=0; i";_2.style.cssText="padding:5px; border-radius:4px; background:"+bg+";position:relative;"+"height:"+h+"px;text-align:center;width:"+w+"px";_3.appendChild(_2);var _6="http://bitpshr.info/cdn/ba-simple-proxy.php";var _7="?url=https://github.com/"+_1.user+"/"+_1.repo+"/graphs/owner_participation";var _8=new XMLHttpRequest();_8.open("GET",_6+_7,true);_8.onreadystatechange=function(){if(_8.readyState==4&&_8.status==200){var _9=JSON.parse(_8.responseText);if(_9.contents&&_9.contents.all){var _a=_9.contents.all;var _b=_9.contents.owner;var _c="https://github.com/"+_1.user+"/"+_1.repo+"/";_2.innerHTML="";var _d=document.createElement("canvas");_d.width=w;_d.height=h;_d.style.cssText="position:relative;";var _e=document.createElement("a");_e.href=_c;_2.appendChild(_e);_e.appendChild(_d);var _f=document.createElement("div");_f.style.cssText="font-size:12px;border-radius:3px;color:#EEE;background-color:rgba(0,0,0,0.5);display:inline-block;padding:5px;position:absolute;top:5px;right:5px;";_f.innerHTML=_1.user+"/"+_1.repo;_e.appendChild(_f);var c=_d.getContext("2d");var _10=w/_a.length;var _11=h;var max=Math.max.apply(Math,_a);var _12=parseFloat(_11-1)/max;var _13=function(_14,_15){_14*=_12;c.fillRect(_15*_10,_11-_14,_10-1,_14);};c.fillStyle=_5;var i;for(i=0;i<_a.length;i++){_13(_a[i],i);}c.fillStyle=_4;for(i=0;i<_b.length;i++){_13(_b[i],i);}}}};_8.send(null);return _2;}; \ No newline at end of file +var Gitgraph=(function(_1){var _2=function(_3){var _4=document.createElement("div");var _5=_3.domNode||document.body;_5.appendChild(_4);var h=_3.height||40;var w=_3.width||416;var bg=_3.background||"white";var _6=_3.userColor||"rgb(51, 102, 153)";var _7=_3.allColor||"rgb(202, 202, 202)";_4.innerHTML="";_4.style.cssText="padding:5px; border-radius:4px; background:"+bg+";position:relative;"+"height:"+h+"px;text-align:center;width:"+w+"px";_5.appendChild(_4);var _8="http://bitpshr.info/cdn/ba-simple-proxy.php";var _9="?url=https://github.com/"+_3.user+"/"+_3.repo+"/graphs/owner_participation";var _a=new XMLHttpRequest();_a.open("GET",_8+_9,true);_a.onreadystatechange=function(){if(_a.readyState==4&&_a.status==200){var _b=JSON.parse(_a.responseText);if(_b.contents&&_b.contents.all){var _c=_b.contents.all;var _d=_b.contents.owner;var _e="https://github.com/"+_3.user+"/"+_3.repo+"/";_4.innerHTML="";var _f=document.createElement("canvas");_f.width=w;_f.height=h;_f.style.cssText="position:relative;";var _10=document.createElement("a");_10.href=_e;_4.appendChild(_10);_10.appendChild(_f);var _11=document.createElement("div");_11.style.cssText="font-size:12px;border-radius:3px;color:#EEE;background-color:rgba(0,0,0,0.5);display:inline-block;padding:5px;position:absolute;top:5px;right:5px;";_11.innerHTML=_3.user+"/"+_3.repo;_10.appendChild(_11);var c=_f.getContext("2d");var _12=w/_c.length;var _13=h;var max=Math.max.apply(Math,_c);var _14=parseFloat(_13-1)/max;var _15=function(_16,_17){_16*=_14;c.fillRect(_17*_12,_13-_16,_12-1,_16);};c.fillStyle=_7;var i;for(i=0;i<_c.length;i++){_15(_c[i],i);}c.fillStyle=_6;for(i=0;i<_d.length;i++){_15(_d[i],i);}}}};_a.send(null);};_2.prototype={constructor:_2};return _2;}()); \ No newline at end of file diff --git a/demo.html b/demo.html index 17acd43..3cf3587 100644 --- a/demo.html +++ b/demo.html @@ -119,10 +119,10 @@
Dirt simple GitHub participation graphs built with a canvas element and sorcery.
-
-
-
-
+
+
+
+