From 72cb12cf751bcaa2cd6cc6d67a508c1d41b7253a Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Sun, 19 Dec 2010 18:58:12 -0800 Subject: [PATCH] tabs -> spaces and remove trailing whitespace --- GithubFinder/javascripts/f.js | 118 ++-- GithubFinder/javascripts/gh.js | 44 +- GithubFinder/javascripts/keyboard.js | 60 +- GithubFinder/javascripts/p.js | 16 +- .../javascripts/plugins/code_highlighter.js | 42 +- .../javascripts/vendors/code_highlighter.js | 586 +++++++++--------- 6 files changed, 433 insertions(+), 433 deletions(-) diff --git a/GithubFinder/javascripts/f.js b/GithubFinder/javascripts/f.js index 1c37bcf..18f5f7e 100644 --- a/GithubFinder/javascripts/f.js +++ b/GithubFinder/javascripts/f.js @@ -2,67 +2,67 @@ // ;"ALEXLE"; window.F = Class.create({ initialize: function(options){ - options = Object.extend( { + options = Object.extend( { user_id: 'samsonjs' ,repository: SJS.projName ,branch: 'master' }, options || {} ); - + this.ps = []; this.shas = {}; - + this.u = options.user_id; this.r = options.repository; this.b = options.branch; this.id = options.id; this.render(this.id); - + this.repo = null; /* Prototype RC2 */ - // document.on('click','a[data-sha]', function( event, element ){ + // document.on('click','a[data-sha]', function( event, element ){ // this.click( element.readAttribute('data-sha'), element ); // element.blur(); // }.bind(this) ); - - document.observe('click', function(e) { + + document.observe('click', function(e) { e = e.findElement(); if( !e.readAttribute('data-sha') ) return; this.click( e.readAttribute('data-sha'), e ); e.blur(); }.bind(this)); - + var idc = $('in'), s = function() { idc.className = 'on' }, h = function() { if( Ajax.activeRequestCount == 0 ) idc.className = 'off' }; - Ajax.Responders.register( { + Ajax.Responders.register( { onException: function(r,x) { console.log(x);h() } ,onComplete: h ,onCreate: s }); - + /* init plugins */ if( FP ) for( var i = 0; i < FP.length; i++ ) new FP[i](this); - + /* extractURL: if user assigns user_id, repo, branch */ this.xU(); this.oR(); // open repo } - - + + ,xU: function() { } - - ,render: function(selector) { + + ,render: function(selector) { $(selector || document.body).insert(this.h()); this.psW = $('ps_w'); this.bW = $('b_w'); } - + ,h: function() { return [ '
', @@ -79,31 +79,31 @@ window.F = Class.create({ '', '
', // .p '', // #r_w - - '
', // browser wrapper + + '
', // browser wrapper '
', '
', // '
', - '
', // #finder + '', // #finder '', // #f_c_w - + '', '' // # content ].join(' '); @@ -112,7 +112,7 @@ window.F = Class.create({ /* openRepo */ ,oR: function(repo) { this.reset() - + var u,r,b; if( !repo ) { /* check URL params */ @@ -126,7 +126,7 @@ window.F = Class.create({ /* if user just come from a github repo ... */ var m = (new RegExp("^http://github.com/(.+)","i")).exec(document.referrer), path = m ? m[1].split('/') : []; - + if( path[0] && path[1] ) { u = this.u = path[0]; r = this.r = path[1]; @@ -141,53 +141,53 @@ window.F = Class.create({ /* User hits the "Go" button: grabbing the user/repo */ repo = repo.split('/'); if( repo.length < 2 ) { alert('invalid repository!'); return; } - + u = this.u = repo[0]; r = this.r = repo[1]; b = this.b = ($('brs') ? $F('brs') : b) || 'master'; } - - + + $('r').innerHTML = u + '/' + r; - + /* Load the master branch */ - GH.Commits.listBranch( u, r, b, { + GH.Commits.listBranch( u, r, b, { onData: function(cs) { // if(!cs.commits) { alert('repo not found'); return; } var tree_sha = cs.commits[0].tree; this.renderPanel(tree_sha); }.bind(this) }); - + /* Show branches info */ - GH.Repo.listBranches( u, r, { + GH.Repo.listBranches( u, r, { onData: function(bes) { this.bes = $H(bes); this.rBs(); }.bind(this) }); - + } - + ,reset: function() { $('f_c_w').hide(); this.cI = -1; this.pI = 0; - + while(this.ps.length > 0) (this.ps.pop()).dispose(); } - + ,browse: function() { this.oR( $('r').innerHTML ); return false; } - + /* render branches */ ,rBs: function() { var h = '