shining 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.txt CHANGED
@@ -1,3 +1,8 @@
1
+ = 1.3.2 (19/05/2010)
2
+
3
+ * Always including config.ru.
4
+ * Added the iphone plugin. It's iPhone friendly for now. TODO: get it to behave crazy awesome in it.
5
+
1
6
  = 1.3.1 (18/05/2010)
2
7
 
3
8
  * Fixed stage resizing issues.
data/Rakefile CHANGED
@@ -18,16 +18,16 @@ begin
18
18
  require 'jeweler'
19
19
  Jeweler::Tasks.new do |gem|
20
20
  gem.name = "shining"
21
- gem.summary = "Webkit + CSS + Javascript = awesome presos"
22
- gem.description = "Webkit + CSS + Javascript = awesome presos"
21
+ gem.summary = "HTML + CSS + Javascript = awesome presos"
22
+ gem.description = "HTML + CSS + Javascript = awesome presos"
23
23
  gem.email = "julio.ody@gmail.com"
24
- gem.homepage = "http://github.com/juliocesar/shining"
24
+ gem.homepage = "http://shining.heroku.com"
25
25
  gem.authors = "Julio Cesar Ody"
26
26
  gem.add_dependency 'haml', '>= 2.2.17'
27
27
  gem.add_dependency 'json_pure', '>= 1.1.9'
28
28
  gem.add_dependency 'tilt', '>= 0.6'
29
29
  gem.add_dependency 'rdiscount', '>= 1.6.3'
30
- gem.add_dependency 'term-ansicolor', '>= 1.0.4'
30
+ gem.add_dependency 'heroku', '>= 1.9.9'
31
31
  gem.add_development_dependency 'rspec', '1.3.0'
32
32
  gem.add_development_dependency 'jspec', '4.2.0'
33
33
  gem.add_development_dependency 'rake', '0.8.7'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.1
1
+ 1.3.2
data/css/base.css CHANGED
@@ -9,7 +9,7 @@ ins { text-decoration : none; }
9
9
  del { text-decoration : line-through }
10
10
 
11
11
  body { font: 12px/1.5 "Lucida Grande", Tahoma, serif; overflow: hidden; text-align: center }
12
- #stage { position: relative; display: inline-block; padding: 40px 20px; max-width: 90%; text-align: left; margin: 0 auto; }
12
+ #stage { position: relative; display: inline-block; padding: 40px 20px; max-width: 90%; text-align: left; margin: 0 auto }
13
13
 
14
14
  .no-text-shadow { text-shadow: none }
15
15
  .no-drop-shadow {}
@@ -38,7 +38,7 @@ div.slice { position: absolute; display: block; width: 0; top: -10px; bottom: -1
38
38
  right: 10px;
39
39
  top: 10px;
40
40
  background-color: #000;
41
- background-color: rgba(0, 0, 0, 0.2);
41
+ background-color: rgba(0, 0, 0, 0.6);
42
42
  color: #fff;
43
43
  padding: 10px;
44
44
  }
data/css/iphone.css ADDED
@@ -0,0 +1,14 @@
1
+ #stage { -webkit-box-shadow: none }
2
+ #help { font-size: 200% }
3
+
4
+ @media all and (max-width: 320px) {
5
+ h1 { font-size: 3em }
6
+ h2 { font-size: 2.8em }
7
+ h3 { font-size: 2.5em }
8
+ p, li { font-size: 1.6em }
9
+ p { margin: 0.5em 0 }
10
+ }
11
+
12
+ @media all and (min-width: 321px) {
13
+ #stage { font-size: 90% };
14
+ }
@@ -0,0 +1,17 @@
1
+ // iphone.js: iPhone friendliness. Free of charge.
2
+
3
+ if (navigator.userAgent.match(/iPhone/i)) {
4
+ Shining.when('init', function() {
5
+ Shining.config.help = false;
6
+ $('head').append('<link rel="stylesheet" type="text/css" href="vendor/css/iphone.css" media="all" class="iphone"/>')
7
+ $('#stage').click(function(event) {
8
+ if ($(event.target).is('a')) return false;
9
+ if (event.pageX < ($(window).width() / 2)) {
10
+ Shining.previousSlide();
11
+ } else {
12
+ Shining.nextSlide();
13
+ }
14
+ })
15
+ Shining.help('Tap on the left or right hand side to navigate', 3000, true);
16
+ });
17
+ }
@@ -3,20 +3,16 @@
3
3
  $(window).resize(function() {
4
4
  $.throttle(function() {
5
5
  var width = $(window).width();
6
- if (width < 480) {
7
- $('#stage').css({fontSize: '80%'});
8
- } else if (width >= 480 && width < 640) {
9
- $('#stage').css({fontSize: '80%'});
10
- } else if (width >= 640 && width < 800) {
6
+ if (width >= 640 && width < 800) {
11
7
  $('#stage').css({fontSize: '100%'});
12
- } else if (width >= 800 && width < 640) {
8
+ } else if (width >= 800 && width < 1024) {
13
9
  $('#stage').css({fontSize: '130%'});
14
10
  } else if (width >= 1024 && width < 800) {
15
11
  $('#stage').css({fontSize: '160%'});
16
12
  } else if (width >= 1280 & width < 1024) {
17
13
  $('#stage').css({fontSize: '180%'});
18
14
  } else if (width > 1280) {
19
- $('#stage').css({fontSize: '180%'});
15
+ $('#stage').css({fontSize: '200%'});
20
16
  }
21
17
  }, 500);
22
18
  })
@@ -8,7 +8,6 @@ class Heroku
8
8
  class << self
9
9
  def deploy preso, name
10
10
  check_for_git_and_heroku
11
- preso.vendorize! unless preso.vendorized?
12
11
  copy Shining.root/'lib'/'config.ru', preso.path
13
12
  change_dir preso.path
14
13
  `git init && git add . && git commit -m 'heroku deploy'`
data/lib/shining/preso.rb CHANGED
@@ -82,6 +82,7 @@ class Preso
82
82
  def vendorize!
83
83
  new_dir @path/'vendor'
84
84
  new_dir @path/'vendor'/'lib'
85
+ copy Shining.root/'lib'/'config.ru', @path + '/'
85
86
  copy Shining.root/'lib'/'*.js', @path/'vendor'/'lib'
86
87
  copy Shining.root/'lib'/'plugins', @path/'vendor'/'lib/'
87
88
  %w(css images themes).each do |required|
data/lib/shining.js CHANGED
@@ -184,8 +184,8 @@
184
184
  }
185
185
  }
186
186
 
187
- function help(message, duration) {
188
- if (Shining.config.help == false) return false;
187
+ function help(message, duration, force) {
188
+ if (Shining.config.help == false && force != true) return false;
189
189
  var duration = duration || 500;
190
190
  $('#help').remove();
191
191
  $('<div id="help"></div>')
@@ -204,13 +204,13 @@
204
204
  when('next', function() { help('→') });
205
205
  loadConfig(function() {
206
206
  loadPlugins();
207
+ trigger('init');
207
208
  var startAt = document.location.hash.replace('#', ''),
208
209
  first = startAt ? startAt : Shining.slides.current();
209
210
  loadSlide(first, function() { playSlide(first) });
210
211
  preloadSlides();
211
212
  setTitle(Shining.config.title);
212
213
  setTheme(Shining.config.theme);
213
- trigger('init');
214
214
  help('← (previous slide), → or SPACE BAR (next slide)', 3000);
215
215
  });
216
216
  });
@@ -271,7 +271,6 @@
271
271
  $('#stage .contents').html(slide.markup);
272
272
  trigger('slideplay');
273
273
  $(window).trigger('resize');
274
-
275
274
  Shining.scripts.run(slide.script);
276
275
  }
277
276
 
@@ -346,4 +345,4 @@ $(window).bind('hashchange', function(event) {
346
345
  });
347
346
 
348
347
  // IE Array.prototype.indexOf fix
349
- 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;};}
348
+ 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;};}
data/lib/shining.rb CHANGED
@@ -9,8 +9,20 @@ require 'shining/heroku'
9
9
 
10
10
  module Shining
11
11
  class << self
12
+ def quiet!
13
+ @quiet = true
14
+ end
15
+
16
+ def quiet?
17
+ !!@quiet
18
+ end
19
+
20
+ def verbose!
21
+ @quiet = false
22
+ end
23
+
12
24
  def say something
13
- STDOUT.puts(something) unless defined?(Spec) # shush when running tests
25
+ STDOUT.puts(something) unless quiet?
14
26
  yield if block_given?
15
27
  end
16
28
 
data/shining.gemspec CHANGED
@@ -5,14 +5,15 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{shining}
8
- s.version = "1.3.1"
8
+ s.version = "1.3.2"
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-05-18}
13
- s.description = %q{Webkit + CSS + Javascript = awesome presos}
12
+ s.date = %q{2010-05-19}
13
+ s.default_executable = %q{shine}
14
+ s.description = %q{HTML + CSS + Javascript = awesome presos}
14
15
  s.email = %q{julio.ody@gmail.com}
15
- s.executables = ["console", "shine"]
16
+ s.executables = ["shine"]
16
17
  s.extra_rdoc_files = [
17
18
  "README.markdown"
18
19
  ]
@@ -21,10 +22,10 @@ Gem::Specification.new do |s|
21
22
  "README.markdown",
22
23
  "Rakefile",
23
24
  "VERSION",
24
- "bin/console",
25
25
  "bin/shine",
26
26
  "css/base.css",
27
27
  "css/effects.css",
28
+ "css/iphone.css",
28
29
  "css/shCore.css",
29
30
  "css/shThemeFadeToGrey.css",
30
31
  "images/help.png",
@@ -36,6 +37,7 @@ Gem::Specification.new do |s|
36
37
  "lib/ext/filemethods.rb",
37
38
  "lib/ext/string.rb",
38
39
  "lib/jquery-1.4.1.min.js",
40
+ "lib/plugins/iphone.js",
39
41
  "lib/plugins/resize.js",
40
42
  "lib/plugins/syntaxhighlighter.js",
41
43
  "lib/shBrushAll.js",
@@ -73,6 +75,7 @@ Gem::Specification.new do |s|
73
75
  "spec/sample/slides/second.js",
74
76
  "spec/sample/slides/third.html",
75
77
  "spec/sample/slides/third.js",
78
+ "spec/shining_spec.rb",
76
79
  "spec/spec_helper.rb",
77
80
  "templates/config.json",
78
81
  "templates/index.html",
@@ -80,16 +83,17 @@ Gem::Specification.new do |s|
80
83
  "themes/default.css",
81
84
  "themes/slidedown.css"
82
85
  ]
83
- s.homepage = %q{http://github.com/juliocesar/shining}
86
+ s.homepage = %q{http://shining.heroku.com}
84
87
  s.rdoc_options = ["--charset=UTF-8"]
85
88
  s.require_paths = ["lib"]
86
89
  s.rubygems_version = %q{1.3.6}
87
- s.summary = %q{Webkit + CSS + Javascript = awesome presos}
90
+ s.summary = %q{HTML + CSS + Javascript = awesome presos}
88
91
  s.test_files = [
89
92
  "spec/cli_spec.rb",
90
93
  "spec/filemethods_spec.rb",
91
94
  "spec/generators_spec.rb",
92
95
  "spec/preso_spec.rb",
96
+ "spec/shining_spec.rb",
93
97
  "spec/spec_helper.rb"
94
98
  ]
95
99
 
@@ -102,7 +106,7 @@ Gem::Specification.new do |s|
102
106
  s.add_runtime_dependency(%q<json_pure>, [">= 1.1.9"])
103
107
  s.add_runtime_dependency(%q<tilt>, [">= 0.6"])
104
108
  s.add_runtime_dependency(%q<rdiscount>, [">= 1.6.3"])
105
- s.add_runtime_dependency(%q<term-ansicolor>, [">= 1.0.4"])
109
+ s.add_runtime_dependency(%q<heroku>, [">= 1.9.9"])
106
110
  s.add_development_dependency(%q<rspec>, ["= 1.3.0"])
107
111
  s.add_development_dependency(%q<jspec>, ["= 4.2.0"])
108
112
  s.add_development_dependency(%q<rake>, ["= 0.8.7"])
@@ -111,7 +115,7 @@ Gem::Specification.new do |s|
111
115
  s.add_dependency(%q<json_pure>, [">= 1.1.9"])
112
116
  s.add_dependency(%q<tilt>, [">= 0.6"])
113
117
  s.add_dependency(%q<rdiscount>, [">= 1.6.3"])
114
- s.add_dependency(%q<term-ansicolor>, [">= 1.0.4"])
118
+ s.add_dependency(%q<heroku>, [">= 1.9.9"])
115
119
  s.add_dependency(%q<rspec>, ["= 1.3.0"])
116
120
  s.add_dependency(%q<jspec>, ["= 4.2.0"])
117
121
  s.add_dependency(%q<rake>, ["= 0.8.7"])
@@ -121,7 +125,7 @@ Gem::Specification.new do |s|
121
125
  s.add_dependency(%q<json_pure>, [">= 1.1.9"])
122
126
  s.add_dependency(%q<tilt>, [">= 0.6"])
123
127
  s.add_dependency(%q<rdiscount>, [">= 1.6.3"])
124
- s.add_dependency(%q<term-ansicolor>, [">= 1.0.4"])
128
+ s.add_dependency(%q<heroku>, [">= 1.9.9"])
125
129
  s.add_dependency(%q<rspec>, ["= 1.3.0"])
126
130
  s.add_dependency(%q<jspec>, ["= 4.2.0"])
127
131
  s.add_dependency(%q<rake>, ["= 0.8.7"])
data/spec/preso_spec.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require File.join(File.dirname(__FILE__), 'spec_helper')
2
2
 
3
- describe 'Shining::Preso' do
4
-
3
+ describe Shining::Preso do
5
4
  before :all do
6
5
  TMP = Dir.tmpdir/'shining-tmp' unless defined?(TMP)
7
6
  FileUtils.rm_rf TMP
@@ -0,0 +1,18 @@
1
+ require File.join(File.dirname(__FILE__), 'spec_helper')
2
+
3
+ describe Shining do
4
+ after do Shining.quiet! end
5
+ context 'quiet and verbose' do
6
+ it '#verbose! means it will output to the console' do
7
+ STDOUT.should_receive :puts
8
+ Shining.verbose!
9
+ Shining.say 'whelps, handle it!'
10
+ end
11
+
12
+ it '#quiet! means nothing will be outputted to the console' do
13
+ STDOUT.should_not_receive :puts
14
+ Shining.quiet!
15
+ Shining.say "whelps, handle it!"
16
+ end
17
+ end
18
+ end
data/spec/spec_helper.rb CHANGED
@@ -5,4 +5,6 @@ require File.join(File.dirname(__FILE__), *%w(.. lib shining))
5
5
  gem 'rspec', '>= 1.3.0'; require 'spec'
6
6
  gem 'rake', '>= 0.8.7'; require 'rake'
7
7
  gem 'json_pure', '>= 1.1.9'; require 'json/pure'
8
- gem 'haml', '>= 2.2.17'; require 'haml'
8
+ gem 'haml', '>= 2.2.17'; require 'haml'
9
+
10
+ Shining.quiet!
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "slides": ["welcome"],
3
3
  "title": "Your presentation",
4
- "plugins": ["resize", "syntaxhighlighter"],
4
+ "plugins": ["resize", "syntaxhighlighter", "iphone"],
5
5
  "transitions": "fade"
6
6
  }
data/templates/index.html CHANGED
@@ -2,6 +2,8 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta http-equiv="Content-type" content="text/html; charset=utf-8">
5
+ <meta name="apple-mobile-web-app-capable" content="yes" />
6
+ <meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=no" />
5
7
  <title>Your presentation</title>
6
8
  <link rel="stylesheet" type="text/css" href="vendor/css/base.css" media="all"/>
7
9
  <link rel="stylesheet" type="text/css" href="vendor/css/effects.css" media="all"/>
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 3
8
- - 1
9
- version: 1.3.1
8
+ - 2
9
+ version: 1.3.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Julio Cesar Ody
@@ -14,8 +14,8 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-18 00:00:00 +10:00
18
- default_executable:
17
+ date: 2010-05-19 00:00:00 +10:00
18
+ default_executable: shine
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: haml
@@ -73,7 +73,7 @@ dependencies:
73
73
  type: :runtime
74
74
  version_requirements: *id004
75
75
  - !ruby/object:Gem::Dependency
76
- name: term-ansicolor
76
+ name: heroku
77
77
  prerelease: false
78
78
  requirement: &id005 !ruby/object:Gem::Requirement
79
79
  requirements:
@@ -81,9 +81,9 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  segments:
83
83
  - 1
84
- - 0
85
- - 4
86
- version: 1.0.4
84
+ - 9
85
+ - 9
86
+ version: 1.9.9
87
87
  type: :runtime
88
88
  version_requirements: *id005
89
89
  - !ruby/object:Gem::Dependency
@@ -128,10 +128,9 @@ dependencies:
128
128
  version: 0.8.7
129
129
  type: :development
130
130
  version_requirements: *id008
131
- description: Webkit + CSS + Javascript = awesome presos
131
+ description: HTML + CSS + Javascript = awesome presos
132
132
  email: julio.ody@gmail.com
133
133
  executables:
134
- - console
135
134
  - shine
136
135
  extensions: []
137
136
 
@@ -142,10 +141,10 @@ files:
142
141
  - README.markdown
143
142
  - Rakefile
144
143
  - VERSION
145
- - bin/console
146
144
  - bin/shine
147
145
  - css/base.css
148
146
  - css/effects.css
147
+ - css/iphone.css
149
148
  - css/shCore.css
150
149
  - css/shThemeFadeToGrey.css
151
150
  - images/help.png
@@ -157,6 +156,7 @@ files:
157
156
  - lib/ext/filemethods.rb
158
157
  - lib/ext/string.rb
159
158
  - lib/jquery-1.4.1.min.js
159
+ - lib/plugins/iphone.js
160
160
  - lib/plugins/resize.js
161
161
  - lib/plugins/syntaxhighlighter.js
162
162
  - lib/shBrushAll.js
@@ -194,6 +194,7 @@ files:
194
194
  - spec/sample/slides/second.js
195
195
  - spec/sample/slides/third.html
196
196
  - spec/sample/slides/third.js
197
+ - spec/shining_spec.rb
197
198
  - spec/spec_helper.rb
198
199
  - templates/config.json
199
200
  - templates/index.html
@@ -201,7 +202,7 @@ files:
201
202
  - themes/default.css
202
203
  - themes/slidedown.css
203
204
  has_rdoc: true
204
- homepage: http://github.com/juliocesar/shining
205
+ homepage: http://shining.heroku.com
205
206
  licenses: []
206
207
 
207
208
  post_install_message:
@@ -229,10 +230,11 @@ rubyforge_project:
229
230
  rubygems_version: 1.3.6
230
231
  signing_key:
231
232
  specification_version: 3
232
- summary: Webkit + CSS + Javascript = awesome presos
233
+ summary: HTML + CSS + Javascript = awesome presos
233
234
  test_files:
234
235
  - spec/cli_spec.rb
235
236
  - spec/filemethods_spec.rb
236
237
  - spec/generators_spec.rb
237
238
  - spec/preso_spec.rb
239
+ - spec/shining_spec.rb
238
240
  - spec/spec_helper.rb
data/bin/console DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
-
5
- require 'shining'
6
- require 'irb'
7
-
8
- IRB.start