shining 1.3.4 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.txt CHANGED
@@ -1,4 +1,12 @@
1
- = 1.3.4
1
+ = 1.3.5
2
+
3
+ * image loading now won't screw with the stage positioning.
4
+ * slide styles loading now works again. Fuck my specless life.
5
+ * shine version outputs the current version of Shining you have installed.
6
+ * more helpful console help, few more switches.
7
+ * using my own version of haml-js so it works with IE8.
8
+
9
+ = 1.3.4 (30/05/2010)
2
10
 
3
11
  * native Haml rendering through haml-js (http://github.com/creationix/haml-js) and
4
12
  Markdown via Showdown (http://attacklab.net/showdown/).
data/Rakefile CHANGED
@@ -26,6 +26,7 @@ begin
26
26
  gem.add_dependency 'json_pure', '>= 1.1.9'
27
27
  gem.add_dependency 'heroku', '>= 1.9.9'
28
28
  gem.add_dependency 'rack', '>= 0.9'
29
+ gem.add_dependency 'jeweler', '>= 1.4.0'
29
30
  gem.add_development_dependency 'rspec', '1.3.0'
30
31
  gem.add_development_dependency 'jspec', '4.2.0'
31
32
  gem.add_development_dependency 'rake', '0.8.7'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.4
1
+ 1.3.5
data/bin/shine CHANGED
@@ -8,10 +8,11 @@ include Shining::FileMethods
8
8
  ACTIONS = {
9
9
  :new_on! => ['build'],
10
10
  :new_slide! => ['slide'],
11
- :compile_templates! => ['compile'],
11
+ :help_and_exit! => ['help', '-h', '--help'],
12
12
  :play => ['play', 'go'],
13
13
  :deploy => ['deploy'],
14
- :remove => ['remove', 'delete', 'rm']
14
+ :remove => ['remove', 'delete', 'rm'],
15
+ :version => ['version', '-v']
15
16
  }
16
17
 
17
18
  def bail! reason
@@ -31,11 +32,22 @@ end
31
32
 
32
33
  def help_and_exit!
33
34
  STDERR.puts <<-HELP
34
- Shine - Generates a new Shining presentation
35
+ Shine - Generates a new Shining presentation.
35
36
  Usage:
36
37
  shine <directory>
37
38
  Example:
38
39
  shine mycoolpreso
40
+ Other commands you can run:
41
+ help shows this menu
42
+ version shows the current version of Shining you have installed
43
+ Commands you can run from inside a presentation directory:
44
+ slide takes 1 argument with the slide name and optionally the format,
45
+ as in:
46
+ $ shine slide pretty
47
+ The above will create a HTML slide called "pretty".
48
+ deploy deploys the presentation to Heroku
49
+ remove takes a slide name as argument. Removes the slide. Example:
50
+ $ shine remove pretty
39
51
  HELP
40
52
  exit -1
41
53
  end
@@ -51,11 +63,6 @@ def new_slide! name, format = 'html'
51
63
  preso.new_slide "#{name}.#{extension}", :with => ['styles', 'script']
52
64
  end
53
65
 
54
- def compile_templates!
55
- preso = Shining::Preso.open Dir.pwd
56
- preso.compile_templates!
57
- end
58
-
59
66
  def play
60
67
  preso = Shining::Preso.open Dir.pwd
61
68
  player = Shining::Player.new preso
@@ -72,4 +79,8 @@ def remove slide
72
79
  preso.remove_slide slide
73
80
  end
74
81
 
82
+ def version
83
+ Shining.say Shining::VERSION
84
+ end
85
+
75
86
  figure_what_to_do!
data/lib/deps.js CHANGED
@@ -11,10 +11,10 @@
11
11
  (function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);
12
12
 
13
13
  // IE Array.prototype.indexOf fix
14
- if(!Array.prototype.indexOf){Array.prototype.indexOf=function(elt,from){var len=this.length;var from=Number(arguments[1])||0;from=(from<0)?Math.ceil(from):Math.floor(from);if(from<0)from+=len;for(;from<len;from++){if(from in this&&this[from]===elt)return from;} return-1;};}
14
+ if(!Array.prototype.indexOf){Array.prototype.indexOf=function(elt,from){var len=this.length;var from=Number(arguments[1])||0;from=(from<0)?Math.ceil(from):Math.floor(from);if(from<0)from+=len;for(;from<len;from++){if(from in this&&this[from]===elt)return from;} return-1;};};
15
15
 
16
- // http://github.com/creationix/haml-js
17
- var Haml;(function(){var matchers,self_close_tags,embedder,forceXML;function html_escape(text){return(text+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;");}function render_attribs(attribs){var key,value,result=[];for(key in attribs){if(key!=="_content"&&attribs.hasOwnProperty(key)){switch(attribs[key]){case"undefined":case"false":case"null":case'""':break;default:try{value=JSON.parse("["+attribs[key]+"]")[0];if(value===true){value=key;}else{if(typeof value==="string"&&embedder.test(value)){value='" +\n'+parse_interpol(html_escape(value))+' +\n"';}else{value=html_escape(value);}}result.push(" "+key+'=\\"'+value+'\\"');}catch(e){result.push(" "+key+'=\\"" + html_escape('+attribs[key]+') + "\\"');}}}}return result.join("");}function parse_attribs(line){var attributes={},l=line.length,i,c,count=1,quote=false,skip=false,open,close,joiner,seperator,pair={start:1,middle:null,end:null};if(!(l>0&&(line.charAt(0)==="{"||line.charAt(0)==="("))){return{_content:line[0]===" "?line.substr(1,l):line};}open=line.charAt(0);close=(open==="{")?"}":")";joiner=(open==="{")?":":"=";seperator=(open==="{")?",":" ";function process_pair(){if(typeof pair.start==="number"&&typeof pair.middle==="number"&&typeof pair.end==="number"){var key=line.substr(pair.start,pair.middle-pair.start).trim(),value=line.substr(pair.middle+1,pair.end-pair.middle-1).trim();attributes[key]=value;}pair={start:null,middle:null,end:null};}for(i=1;count>0;i+=1){if(i>l){throw"Malformed attribute block";}c=line.charAt(i);if(skip){skip=false;}else{if(quote){if(c==="\\"){skip=true;}if(c===quote){quote=false;}}else{if(c==='"'||c==="'"){quote=c;}if(count===1){if(c===joiner){pair.middle=i;}if(c===seperator||c===close){pair.end=i;process_pair();if(c===seperator){pair.start=i+1;}}}if(c===open||c==="("){count+=1;}if(c===close||(count>1&&c===")")){count-=1;}}}}attributes._content=line.substr(i,line.length);return attributes;}function parse_interpol(value){var items=[],pos=0,next=0,match;while(true){next=value.substr(pos).search(embedder);if(next<0){if(pos<value.length){items.push(JSON.stringify(value.substr(pos)));}break;}items.push(JSON.stringify(value.substr(pos,next)));pos+=next;match=value.substr(pos).match(embedder);next=match[0].length;if(next<0){break;}items.push(match[1]||match[2]);pos+=next;}return items.filter(function(part){return part&&part.length>0;}).join(" +\n");}embedder=/\#\{([^}]*)\}/;self_close_tags=["meta","img","link","br","hr","input","area","base"];matchers=[{regexp:/^(\s*)((?:[.#%][a-z_\-][a-z0-9_:\-]*)+)(.*)$/i,process:function(){var tag,classes,ids,attribs,content;tag=this.matches[2];classes=tag.match(/\.([a-z_\-][a-z0-9_\-]*)/gi);ids=tag.match(/\#([a-z_\-][a-z0-9_\-]*)/gi);tag=tag.match(/\%([a-z_\-][a-z0-9_:\-]*)/gi);tag=tag?tag[0].substr(1,tag[0].length):"div";attribs=this.matches[3];if(attribs){attribs=parse_attribs(attribs);if(attribs._content){this.contents.unshift(attribs._content.trim());delete (attribs._content);}}else{attribs={};}if(classes){classes=classes.map(function(klass){return klass.substr(1,klass.length);}).join(" ");if(attribs["class"]){try{attribs["class"]=JSON.stringify(classes+" "+JSON.parse(attribs["class"]));}catch(e){attribs["class"]=JSON.stringify(classes+" ")+" + "+attribs["class"];}}else{attribs["class"]=JSON.stringify(classes);}}if(ids){ids=ids.map(function(id){return id.substr(1,id.length);}).join(" ");if(attribs.id){attribs.id=JSON.stringify(ids+" ")+attribs.id;}else{attribs.id=JSON.stringify(ids);}}attribs=render_attribs(attribs);content=this.render_contents();if(content==='""'){content="";}if(forceXML?content.length>0:self_close_tags.indexOf(tag)==-1){return'"<'+tag+attribs+'>"'+(content.length>0?" + \n"+content:"")+' + \n"</'+tag+'>"';}else{return'"<'+tag+attribs+' />"';}}},{regexp:/^(\s*)(?::for|:each)\s+(?:([a-z_][a-z_\-]*),\s*)?([a-z_][a-z_\-]*)\s+in\s+(.*)(\s*)$/i,process:function(){var ivar=this.matches[2]||"__key__",vvar=this.matches[3],avar=this.matches[4],rvar="__result__";if(this.matches[5]){this.contents.unshift(this.matches[5]);}return"(function () { var "+rvar+" = [], "+ivar+", "+vvar+"; for ("+ivar+" in "+avar+") { if ("+avar+".hasOwnProperty("+ivar+")) { "+vvar+" = "+avar+"["+ivar+"]; "+rvar+".push(\n"+(this.render_contents()||"''")+"\n); } } return "+rvar+'.join(""); }).call(this)';}},{regexp:/^(\s*):if\s+(.*)\s*$/i,process:function(){var condition=this.matches[2];return"(function () { if ("+condition+") { return (\n"+(this.render_contents()||"")+'\n);} else { return ""; } }).call(this)';}},{regexp:/^()!!!(?:\s*(.*))\s*$/,process:function(){var line="";switch((this.matches[2]||"").toLowerCase()){case"":line='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';break;case"strict":case"1.0":line='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';break;case"frameset":line='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">';break;case"5":line="<!DOCTYPE html>";break;case"1.1":line='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">';break;case"basic":line='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">';break;case"mobile":line='<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">';break;case"xml":line="<?xml version='1.0' encoding='utf-8' ?>";break;case"xml iso-8859-1":line="<?xml version='1.0' encoding='iso-8859-1' ?>";break;}return JSON.stringify(line+"\n");}},{regexp:/^(\s*):markdown\s*$/i,process:function(){return parse_interpol(exports.Markdown.encode(this.contents.join("\n")));}},{regexp:/^(\s*):(?:java)?script\s*$/,process:function(){return parse_interpol('\n<script type="text/javascript">\n//<![CDATA[\n'+this.contents.join("\n")+"\n//]]>\n<\/script>\n");}},{regexp:/^(\s*):css\s*$/,process:function(){return JSON.stringify('\n<style type="text/css">\n'+this.contents.join("\n")+"\n</style>\n");}},];function compile(lines){var block=false,output=[];if(typeof lines==="string"){lines=lines.trim().split("\n");}lines.forEach(function(line){var match,found=false;if(block){match=block.check_indent(line);if(match){block.contents.push(match[1]||"");return;}else{output.push(block.process());block=false;}}matchers.forEach(function(matcher){if(!found){match=matcher.regexp(line);if(match){block={contents:[],matches:match,check_indent:new RegExp("^(?:\\s*|"+match[1]+" (.*))$"),process:matcher.process,render_contents:function(){return compile(this.contents);}};found=true;}}});if(!found){output.push(function(){if(line[0]==="\\"){return parse_interpol(line.substr(1,line.length));}if(line[0]==="="){line=line.substr(1,line.length).trim();try{return parse_interpol(JSON.parse(line));}catch(e){return line;}}if(line.substr(0,2)==="&="){line=line.substr(2,line.length).trim();try{return JSON.stringify(html_escape(JSON.parse(line)));}catch(e2){return"html_escape("+line+")";}}return parse_interpol(line);}());}});if(block){output.push(block.process());}return output.filter(function(part){return part&&part.length>0;}).join(" +\n");}function optimize(js){var new_js=[],buffer=[],part,end;function flush(){if(buffer.length>0){new_js.push(JSON.stringify(buffer.join(""))+end);buffer=[];}}js.split("\n").forEach(function(line){part=line.match(/^(\".*\")(\s*\+\s*)?$/);if(!part){flush();new_js.push(line);return;}end=part[2]||"";part=part[1];try{buffer.push(JSON.parse(part));}catch(e){flush();new_js.push(line);}});flush();return new_js.join("\n");}function render(text,options){options=options||{};text=text||"";var js=compile(text);if(options.optimize){js=Haml.optimize(js);}return execute(js,options.context||Haml,options.locals);}function execute(js,self,locals){return(function(){with(locals||{}){try{return eval("("+js+")");}catch(e){return"\n<pre class='error'>"+html_escape(e.stack)+"</pre>\n";}}}).call(self);}Haml=function Haml(haml,xml){forceXML=xml;var js=optimize(compile(haml));return new Function("locals",html_escape+"\nwith(locals || {}) {\n try {\n return ("+js+');\n } catch (e) {\n return "\\n<pre class=\'error\'>" + html_escape(e.stack) + "</pre>\\n";\n }\n}');};Haml.compile=compile;Haml.optimize=optimize;Haml.render=render;Haml.execute=execute;}());if(typeof module!=="undefined"){module.exports=Haml;};
16
+ // http://github.com/juliocesar/haml-js
17
+ (function(){if(!String.prototype.trim){String.prototype.trim=function(){return this.replace(/^\s+|\s+$/,"");};}if(!Array.prototype.forEach){Array.prototype.forEach=function(fun){var len=this.length>>>0;if(typeof fun!="function"){throw new TypeError();}var thisp=arguments[1];for(var i=0;i<len;i++){if(i in this){fun.call(thisp,this[i],i,this);}}};}if(!Array.prototype.map){Array.prototype.map=function(fun){var len=this.length;if(typeof fun!="function"){throw new TypeError();}var res=new Array(len);var thisp=arguments[1];for(var i=0;i<len;i++){if(i in this){res[i]=fun.call(thisp,this[i],i,this);}}return res;};}if(!Array.prototype.filter){Array.prototype.filter=function(fun){var len=this.length;if(typeof fun!="function"){throw new TypeError();}var res=new Array();var thisp=arguments[1];for(var i=0;i<len;i++){if(i in this){var val=this[i];if(fun.call(thisp,val,i,this)){res.push(val);}}}return res;};}var matchers,self_close_tags,embedder,forceXML;function html_escape(text){return(text+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;");}function render_attribs(attribs){var key,value,result=[];for(key in attribs){if(key!=="_content"&&attribs.hasOwnProperty(key)){switch(attribs[key]){case"undefined":case"false":case"null":case'""':break;default:try{value=JSON.parse("["+attribs[key]+"]")[0];if(value===true){value=key;}else{if(typeof value==="string"&&embedder.test(value)){value='" +\n'+parse_interpol(html_escape(value))+' +\n"';}else{value=html_escape(value);}}result.push(" "+key+'=\\"'+value+'\\"');}catch(e){result.push(" "+key+'=\\"" + html_escape('+attribs[key]+') + "\\"');}}}}return result.join("");}function parse_attribs(line){var attributes={},l=line.length,i,c,count=1,quote=false,skip=false,open,close,joiner,seperator,pair={start:1,middle:null,end:null};if(!(l>0&&(line.charAt(0)==="{"||line.charAt(0)==="("))){return{_content:line[0]===" "?line.substr(1,l):line};}open=line.charAt(0);close=(open==="{")?"}":")";joiner=(open==="{")?":":"=";seperator=(open==="{")?",":" ";function process_pair(){if(typeof pair.start==="number"&&typeof pair.middle==="number"&&typeof pair.end==="number"){var key=line.substr(pair.start,pair.middle-pair.start).trim(),value=line.substr(pair.middle+1,pair.end-pair.middle-1).trim();attributes[key]=value;}pair={start:null,middle:null,end:null};}for(i=1;count>0;i+=1){if(i>l){throw"Malformed attribute block";}c=line.charAt(i);if(skip){skip=false;}else{if(quote){if(c==="\\"){skip=true;}if(c===quote){quote=false;}}else{if(c==='"'||c==="'"){quote=c;}if(count===1){if(c===joiner){pair.middle=i;}if(c===seperator||c===close){pair.end=i;process_pair();if(c===seperator){pair.start=i+1;}}}if(c===open||c==="("){count+=1;}if(c===close||(count>1&&c===")")){count-=1;}}}}attributes._content=line.substr(i,line.length);return attributes;}function parse_interpol(value){var items=[],pos=0,next=0,match;while(true){next=value.substr(pos).search(embedder);if(next<0){if(pos<value.length){items.push(JSON.stringify(value.substr(pos)));}break;}items.push(JSON.stringify(value.substr(pos,next)));pos+=next;match=value.substr(pos).match(embedder);next=match[0].length;if(next<0){break;}items.push(match[1]||match[2]);pos+=next;}return items.filter(function(part){return part&&part.length>0;}).join(" +\n");}embedder=/\#\{([^}]*)\}/;self_close_tags=["meta","img","link","br","hr","input","area","base"];matchers=[{regexp:/^(\s*)((?:[.#%][a-z_\-][a-z0-9_:\-]*)+)(.*)$/i,process:function(){var tag,classes,ids,attribs,content;tag=this.matches[2];classes=tag.match(/\.([a-z_\-][a-z0-9_\-]*)/gi);ids=tag.match(/\#([a-z_\-][a-z0-9_\-]*)/gi);tag=tag.match(/\%([a-z_\-][a-z0-9_:\-]*)/gi);tag=tag?tag[0].substr(1,tag[0].length):"div";attribs=this.matches[3];if(attribs){attribs=parse_attribs(attribs);if(attribs._content){this.contents.unshift(attribs._content.trim());delete (attribs._content);}}else{attribs={};}if(classes){classes=classes.map(function(klass){return klass.substr(1,klass.length);}).join(" ");if(attribs["class"]){try{attribs["class"]=JSON.stringify(classes+" "+JSON.parse(attribs["class"]));}catch(e){attribs["class"]=JSON.stringify(classes+" ")+" + "+attribs["class"];}}else{attribs["class"]=JSON.stringify(classes);}}if(ids){ids=ids.map(function(id){return id.substr(1,id.length);}).join(" ");if(attribs.id){attribs.id=JSON.stringify(ids+" ")+attribs.id;}else{attribs.id=JSON.stringify(ids);}}attribs=render_attribs(attribs);content=this.render_contents();if(content==='""'){content="";}if(forceXML?content.length>0:self_close_tags.indexOf(tag)==-1){return'"<'+tag+attribs+'>"'+(content.length>0?" + \n"+content:"")+' + \n"</'+tag+'>"';}else{return'"<'+tag+attribs+' />"';}}},{regexp:/^(\s*)(?::for|:each)\s+(?:([a-z_][a-z_\-]*),\s*)?([a-z_][a-z_\-]*)\s+in\s+(.*)(\s*)$/i,process:function(){var ivar=this.matches[2]||"__key__",vvar=this.matches[3],avar=this.matches[4],rvar="__result__";if(this.matches[5]){this.contents.unshift(this.matches[5]);}return"(function () { var "+rvar+" = [], "+ivar+", "+vvar+"; for ("+ivar+" in "+avar+") { if ("+avar+".hasOwnProperty("+ivar+")) { "+vvar+" = "+avar+"["+ivar+"]; "+rvar+".push(\n"+(this.render_contents()||"''")+"\n); } } return "+rvar+'.join(""); }).call(this)';}},{regexp:/^(\s*):if\s+(.*)\s*$/i,process:function(){var condition=this.matches[2];return"(function () { if ("+condition+") { return (\n"+(this.render_contents()||"")+'\n);} else { return ""; } }).call(this)';}},{regexp:/^()!!!(?:\s*(.*))\s*$/,process:function(){var line="";switch((this.matches[2]||"").toLowerCase()){case"":line='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';break;case"strict":case"1.0":line='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';break;case"frameset":line='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">';break;case"5":line="<!DOCTYPE html>";break;case"1.1":line='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">';break;case"basic":line='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">';break;case"mobile":line='<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">';break;case"xml":line="<?xml version='1.0' encoding='utf-8' ?>";break;case"xml iso-8859-1":line="<?xml version='1.0' encoding='iso-8859-1' ?>";break;}return JSON.stringify(line+"\n");}},{regexp:/^(\s*):markdown\s*$/i,process:function(){return parse_interpol(exports.Markdown.encode(this.contents.join("\n")));}},{regexp:/^(\s*):(?:java)?script\s*$/,process:function(){return parse_interpol('\n<script type="text/javascript">\n//<![CDATA[\n'+this.contents.join("\n")+"\n//]]>\n<\/script>\n");}},{regexp:/^(\s*):css\s*$/,process:function(){return JSON.stringify('\n<style type="text/css">\n'+this.contents.join("\n")+"\n</style>\n");}},];function compile(lines){var block=false,output=[];if(typeof lines==="string"){lines=lines.trim().split("\n");}lines.forEach(function(line){var match,found=false;if(block){match=line.match(block.check_indent);if(match){block.contents.push(match[1]||"");return;}else{output.push(block.process());block=false;}}matchers.forEach(function(matcher){if(!found){match=line.match(matcher.regexp);if(match){block={contents:[],matches:match,check_indent:new RegExp("^(?:\\s*|"+match[1]+" (.*))$"),process:matcher.process,render_contents:function(){return compile(this.contents);}};found=true;}}});if(!found){output.push(function(){if(line[0]==="\\"){return parse_interpol(line.substr(1,line.length));}if(line[0]==="="){line=line.substr(1,line.length).trim();try{return parse_interpol(JSON.parse(line));}catch(e){return line;}}if(line.substr(0,2)==="&="){line=line.substr(2,line.length).trim();try{return JSON.stringify(html_escape(JSON.parse(line)));}catch(e2){return"html_escape("+line+")";}}return parse_interpol(line);}());}});if(block){output.push(block.process());}return output.filter(function(part){return part&&part.length>0;}).join(" +\n");}function optimize(js){var new_js=[],buffer=[],part,end;function flush(){if(buffer.length>0){new_js.push(JSON.stringify(buffer.join(""))+end);buffer=[];}}js.split("\n").forEach(function(line){part=line.match(/^(\".*\")(\s*\+\s*)?$/);if(!part){flush();new_js.push(line);return;}end=part[2]||"";part=part[1];try{buffer.push(JSON.parse(part));}catch(e){flush();new_js.push(line);}});flush();return new_js.join("\n");}function render(text,options){options=options||{};text=text||"";var js=compile(text);if(options.optimize){js=Haml.optimize(js);}return execute(js,options.context||Haml,options.locals);}function execute(js,self,locals){return(function(){with(locals||{}){try{return eval("("+js+")");}catch(e){return"\n<pre class='error'>"+html_escape(e.stack)+"</pre>\n";}}}).call(self);}Haml=function(haml,xml){forceXML=xml;var js=optimize(compile(haml));return new Function("locals",html_escape+"\nwith(locals || {}) {\n try {\n return ("+js+');\n } catch (e) {\n return "\\n<pre class=\'error\'>" + html_escape(e.stack) + "</pre>\\n";\n }\n}');};Haml.compile=compile;Haml.optimize=optimize;Haml.render=render;Haml.execute=execute;})();
18
18
 
19
19
  /**
20
20
  * SyntaxHighlighter
data/lib/shining.js CHANGED
@@ -199,6 +199,7 @@
199
199
  bindKeys();
200
200
  when('previous', function() { help('←') });
201
201
  when('next', function() { help('→') });
202
+ when('slideplay', function() { loadSlideStyle(arguments[1]) });
202
203
  $(window).bind('hashchange', function(event) {
203
204
  var slide = document.location.hash.replace('#', '');
204
205
  if (slide) { Shining.getSlide(slide) };
@@ -208,7 +209,7 @@
208
209
  trigger('init');
209
210
  var startAt = document.location.hash.replace('#', ''),
210
211
  first = startAt ? startAt : Shining.slides.current();
211
- loadSlide(first, function() { playSlide(first) });
212
+ loadSlide(first, function() { playSlide(first); centerStage() });
212
213
  preloadSlides();
213
214
  setTitle(Shining.config.title);
214
215
  setTheme(Shining.config.theme);
@@ -273,16 +274,14 @@
273
274
  function(data) {
274
275
  Shining.slides._loaded[name] = {};
275
276
  Shining.slides._loaded[name].markup = compileSlide(name, data);
276
- trigger('loaded', [name]);
277
+ trigger('slideloaded', [name]);
277
278
  if (data) {
278
279
  loadSlideScript(name, afterLoad);
279
- loadSlideStyle(name);
280
280
  }
281
281
  }
282
282
  );
283
283
  } else {
284
284
  if ($.isFunction(afterLoad)) afterLoad.call();
285
- loadSlideStyle(name);
286
285
  }
287
286
  }
288
287
 
@@ -294,6 +293,7 @@
294
293
  var slide = Shining.slides._loaded[name];
295
294
  Shining.slides.current(name);
296
295
  $('#stage .contents').html(slide.markup);
296
+ $('#stage img').each(function() { $(this).load(function() { centerStage() }) });
297
297
  trigger('slideplay', [name]);
298
298
  $(window).trigger('resize');
299
299
  Shining.scripts.run(slide.script);
@@ -307,8 +307,7 @@
307
307
  }
308
308
  }
309
309
 
310
- function installPath() { return $('script[src$=shining.js]').attr('src').replace('/shining.js', '') }
311
- function pluginPath(name) { return installPath() + '/plugins/' + name + '.js' }
310
+ function pluginPath(name) { return 'vendor/lib/plugins/' + name + '.js' }
312
311
 
313
312
  function loadSlideScript(name, afterLoad) {
314
313
  $.ajax({
@@ -321,7 +320,7 @@
321
320
 
322
321
  function loadSlideStyle(name) {
323
322
  $('link.slide').remove();
324
- $('head').append('<link rel="stylesheet" type="text/css" href="' + slidePlusExtension(name, 'css') + '" media="all" class="slide"/>')
323
+ $('head').append('<link rel="stylesheet" type="text/css" href="' + slidePath(slidePlusExtension(name, 'css')) + '" media="all" class="slide"/>')
325
324
  }
326
325
 
327
326
  function loadConfig(callback) {
@@ -353,4 +352,4 @@
353
352
  }
354
353
 
355
354
  Shining.init();
356
- })(jQuery);
355
+ })(jQuery);
data/lib/shining.rb CHANGED
@@ -59,4 +59,5 @@ This is a new slide. It needs some lovin'!
59
59
  end
60
60
  end
61
61
  end
62
+ VERSION = File.read Shining.root/'VERSION'
62
63
  end
data/shining.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{shining}
8
- s.version = "1.3.4"
8
+ s.version = "1.3.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Julio Cesar Ody"]
12
- s.date = %q{2010-06-01}
12
+ s.date = %q{2010-06-21}
13
13
  s.default_executable = %q{shine}
14
14
  s.description = %q{HTML + CSS + Javascript = awesome presos}
15
15
  s.email = %q{julio.ody@gmail.com}
@@ -87,7 +87,7 @@ Gem::Specification.new do |s|
87
87
  s.homepage = %q{http://shining.heroku.com}
88
88
  s.rdoc_options = ["--charset=UTF-8"]
89
89
  s.require_paths = ["lib"]
90
- s.rubygems_version = %q{1.3.6}
90
+ s.rubygems_version = %q{1.3.7}
91
91
  s.summary = %q{HTML + CSS + Javascript = awesome presos}
92
92
  s.test_files = [
93
93
  "spec/cli_spec.rb",
@@ -102,10 +102,11 @@ Gem::Specification.new do |s|
102
102
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
103
103
  s.specification_version = 3
104
104
 
105
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
105
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
106
106
  s.add_runtime_dependency(%q<json_pure>, [">= 1.1.9"])
107
107
  s.add_runtime_dependency(%q<heroku>, [">= 1.9.9"])
108
108
  s.add_runtime_dependency(%q<rack>, [">= 0.9"])
109
+ s.add_runtime_dependency(%q<jeweler>, [">= 1.4.0"])
109
110
  s.add_development_dependency(%q<rspec>, ["= 1.3.0"])
110
111
  s.add_development_dependency(%q<jspec>, ["= 4.2.0"])
111
112
  s.add_development_dependency(%q<rake>, ["= 0.8.7"])
@@ -113,6 +114,7 @@ Gem::Specification.new do |s|
113
114
  s.add_dependency(%q<json_pure>, [">= 1.1.9"])
114
115
  s.add_dependency(%q<heroku>, [">= 1.9.9"])
115
116
  s.add_dependency(%q<rack>, [">= 0.9"])
117
+ s.add_dependency(%q<jeweler>, [">= 1.4.0"])
116
118
  s.add_dependency(%q<rspec>, ["= 1.3.0"])
117
119
  s.add_dependency(%q<jspec>, ["= 4.2.0"])
118
120
  s.add_dependency(%q<rake>, ["= 0.8.7"])
@@ -121,6 +123,7 @@ Gem::Specification.new do |s|
121
123
  s.add_dependency(%q<json_pure>, [">= 1.1.9"])
122
124
  s.add_dependency(%q<heroku>, [">= 1.9.9"])
123
125
  s.add_dependency(%q<rack>, [">= 0.9"])
126
+ s.add_dependency(%q<jeweler>, [">= 1.4.0"])
124
127
  s.add_dependency(%q<rspec>, ["= 1.3.0"])
125
128
  s.add_dependency(%q<jspec>, ["= 4.2.0"])
126
129
  s.add_dependency(%q<rake>, ["= 0.8.7"])
data/spec/shining_spec.rb CHANGED
@@ -2,6 +2,11 @@ require File.join(File.dirname(__FILE__), 'spec_helper')
2
2
 
3
3
  describe Shining do
4
4
  after do Shining.quiet! end
5
+
6
+ it 'fetches the version on Shining::VERSION' do
7
+ Shining::VERSION.should == File.read(Shining.root + '/VERSION')
8
+ end
9
+
5
10
  context 'quiet and verbose' do
6
11
  it '#verbose! means it will output to the console' do
7
12
  STDOUT.should_receive :puts
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shining
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 17
4
5
  prerelease: false
5
6
  segments:
6
7
  - 1
7
8
  - 3
8
- - 4
9
- version: 1.3.4
9
+ - 5
10
+ version: 1.3.5
10
11
  platform: ruby
11
12
  authors:
12
13
  - Julio Cesar Ody
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-06-01 00:00:00 +10:00
18
+ date: 2010-06-21 00:00:00 +10:00
18
19
  default_executable: shine
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: json_pure
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 1
27
30
  segments:
28
31
  - 1
29
32
  - 1
@@ -35,9 +38,11 @@ dependencies:
35
38
  name: heroku
36
39
  prerelease: false
37
40
  requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
38
42
  requirements:
39
43
  - - ">="
40
44
  - !ruby/object:Gem::Version
45
+ hash: 33
41
46
  segments:
42
47
  - 1
43
48
  - 9
@@ -49,9 +54,11 @@ dependencies:
49
54
  name: rack
50
55
  prerelease: false
51
56
  requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
52
58
  requirements:
53
59
  - - ">="
54
60
  - !ruby/object:Gem::Version
61
+ hash: 25
55
62
  segments:
56
63
  - 0
57
64
  - 9
@@ -59,47 +66,69 @@ dependencies:
59
66
  type: :runtime
60
67
  version_requirements: *id003
61
68
  - !ruby/object:Gem::Dependency
62
- name: rspec
69
+ name: jeweler
63
70
  prerelease: false
64
71
  requirement: &id004 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ hash: 7
77
+ segments:
78
+ - 1
79
+ - 4
80
+ - 0
81
+ version: 1.4.0
82
+ type: :runtime
83
+ version_requirements: *id004
84
+ - !ruby/object:Gem::Dependency
85
+ name: rspec
86
+ prerelease: false
87
+ requirement: &id005 !ruby/object:Gem::Requirement
88
+ none: false
65
89
  requirements:
66
90
  - - "="
67
91
  - !ruby/object:Gem::Version
92
+ hash: 27
68
93
  segments:
69
94
  - 1
70
95
  - 3
71
96
  - 0
72
97
  version: 1.3.0
73
98
  type: :development
74
- version_requirements: *id004
99
+ version_requirements: *id005
75
100
  - !ruby/object:Gem::Dependency
76
101
  name: jspec
77
102
  prerelease: false
78
- requirement: &id005 !ruby/object:Gem::Requirement
103
+ requirement: &id006 !ruby/object:Gem::Requirement
104
+ none: false
79
105
  requirements:
80
106
  - - "="
81
107
  - !ruby/object:Gem::Version
108
+ hash: 55
82
109
  segments:
83
110
  - 4
84
111
  - 2
85
112
  - 0
86
113
  version: 4.2.0
87
114
  type: :development
88
- version_requirements: *id005
115
+ version_requirements: *id006
89
116
  - !ruby/object:Gem::Dependency
90
117
  name: rake
91
118
  prerelease: false
92
- requirement: &id006 !ruby/object:Gem::Requirement
119
+ requirement: &id007 !ruby/object:Gem::Requirement
120
+ none: false
93
121
  requirements:
94
122
  - - "="
95
123
  - !ruby/object:Gem::Version
124
+ hash: 49
96
125
  segments:
97
126
  - 0
98
127
  - 8
99
128
  - 7
100
129
  version: 0.8.7
101
130
  type: :development
102
- version_requirements: *id006
131
+ version_requirements: *id007
103
132
  description: HTML + CSS + Javascript = awesome presos
104
133
  email: julio.ody@gmail.com
105
134
  executables:
@@ -184,23 +213,27 @@ rdoc_options:
184
213
  require_paths:
185
214
  - lib
186
215
  required_ruby_version: !ruby/object:Gem::Requirement
216
+ none: false
187
217
  requirements:
188
218
  - - ">="
189
219
  - !ruby/object:Gem::Version
220
+ hash: 3
190
221
  segments:
191
222
  - 0
192
223
  version: "0"
193
224
  required_rubygems_version: !ruby/object:Gem::Requirement
225
+ none: false
194
226
  requirements:
195
227
  - - ">="
196
228
  - !ruby/object:Gem::Version
229
+ hash: 3
197
230
  segments:
198
231
  - 0
199
232
  version: "0"
200
233
  requirements: []
201
234
 
202
235
  rubyforge_project:
203
- rubygems_version: 1.3.6
236
+ rubygems_version: 1.3.7
204
237
  signing_key:
205
238
  specification_version: 3
206
239
  summary: HTML + CSS + Javascript = awesome presos