shining 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.txt ADDED
@@ -0,0 +1,13 @@
1
+ = 1.3.1 (18/05/2010)
2
+
3
+ * Fixed stage resizing issues.
4
+ * Fixed horizontal centralization by relying on auto margin + position relative. Can't remember why I had that
5
+ and then went for absolute positioning + JS...
6
+
7
+ = 1.3.0 (10/05/2010)
8
+
9
+ * Rudimentary plugins system
10
+ - check lib/plugins for 2 examples
11
+ * Vendoring by default to address security restrictions with Google Chrome
12
+ - smarter vendoring though, so now only files that are strictly necessary to play a preso are copied.
13
+ * Instead of blindly trusting FileUtils, I'm now speccing Shining::FileMethods
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.0
1
+ 1.3.1
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: absolute; display: inline-block; padding: 40px 20px; max-width: 90%; text-align: left }
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 {}
@@ -41,4 +41,5 @@ div.slice { position: absolute; display: block; width: 0; top: -10px; bottom: -1
41
41
  background-color: rgba(0, 0, 0, 0.2);
42
42
  color: #fff;
43
43
  padding: 10px;
44
- }
44
+ }
45
+
@@ -1,5 +1,4 @@
1
- // resize.js: Shining plugin for resizing the font sizes depending
2
- // on the available screen dimensions
1
+ // resize.js: Shining plugin for resizing the stage's base font size depending on available screen dimensions
3
2
 
4
3
  $(window).resize(function() {
5
4
  $.throttle(function() {
@@ -18,6 +17,6 @@ $(window).resize(function() {
18
17
  $('#stage').css({fontSize: '180%'});
19
18
  } else if (width > 1280) {
20
19
  $('#stage').css({fontSize: '180%'});
21
- }
20
+ }
22
21
  }, 500);
23
22
  })
@@ -1,3 +1,6 @@
1
+ // syntaxhighliter.js: adds syntaxhighlighter support.
2
+ // See http://alexgorbatchev.com/wiki/SyntaxHighlighter
3
+
1
4
  Shining.when('slideplay', function() {
2
5
  if (SyntaxHighlighter) SyntaxHighlighter.highlight();
3
6
  })
data/lib/shining.js CHANGED
@@ -5,7 +5,6 @@
5
5
  var KEY = { SPACE: 32, RIGHT: 39, LEFT: 37 };
6
6
 
7
7
  // jQuery extensions
8
- $.fn.effect = function(name) { return this.each(function() { applyEffect(this, name) }); };
9
8
  $.fn.hasClasses = function(classes) {
10
9
  var classes = classes.split(/\s+/), yes = true, element = this.get(0);
11
10
  for (var i = 0; i < classes.length && yes; i++) { yes = $(element).hasClass(classes[i]) }
@@ -75,10 +74,10 @@
75
74
  init: init,
76
75
  when: when,
77
76
  trigger: trigger,
77
+
78
78
  // slide scripts
79
79
  scripts: {
80
- LINE: /^(\d[.\d]*),[\s]*(.*)/,
81
- parsed: [], processes: [],
80
+ LINE: /^(\d[.\d]*),[\s]*(.*)/, parsed: [], processes: [],
82
81
  nextSlide: function() { Shining.nextSlide() },
83
82
  previousSlide: function() { Shining.previousSlide() },
84
83
  at: function(seconds, method) {
@@ -191,24 +190,15 @@
191
190
  $('#help').remove();
192
191
  $('<div id="help"></div>')
193
192
  .html(message)
194
- .css({display: 'inline-block'})
195
193
  .appendTo('body')
196
194
  .animate({opacity: 1})
197
195
  .delay(duration)
198
196
  .fadeOut(200, function() { $('#help').remove() })
199
197
  }
200
198
 
201
- function local() { document.location.protocol == 'file:' }
202
-
203
199
  function init() {
200
+ $(window).resize(function() { centerStage() });
204
201
  $(document).ready(function() {
205
- $(window).resize(function(){
206
- $('#stage').css({
207
- position: 'absolute',
208
- left: ($(window).width() - $('#stage').outerWidth()) / 2,
209
- top: ($(window).height() - $('#stage').outerHeight()) / 2
210
- });
211
- });
212
202
  bindKeys();
213
203
  when('previous', function() { help('←') });
214
204
  when('next', function() { help('→') });
@@ -217,10 +207,10 @@
217
207
  var startAt = document.location.hash.replace('#', ''),
218
208
  first = startAt ? startAt : Shining.slides.current();
219
209
  loadSlide(first, function() { playSlide(first) });
220
- if (!local() && !(Shining.config.help == false)) preloadSlides();
210
+ preloadSlides();
221
211
  setTitle(Shining.config.title);
222
212
  setTheme(Shining.config.theme);
223
- trigger('init.shining');
213
+ trigger('init');
224
214
  help('← (previous slide), → or SPACE BAR (next slide)', 3000);
225
215
  });
226
216
  });
@@ -229,10 +219,6 @@
229
219
  function trigger(event, data) { $(document).trigger(event + '.shining', data) }
230
220
  function when(event, method) { $(document).bind(event + '.shining', method) }
231
221
 
232
- function applyEffect(element, name) {
233
- $(element).addClass(name);
234
- }
235
-
236
222
  function getSlide(name) {
237
223
  if (!name) return false;
238
224
  applyTransition(
@@ -285,6 +271,7 @@
285
271
  $('#stage .contents').html(slide.markup);
286
272
  trigger('slideplay');
287
273
  $(window).trigger('resize');
274
+
288
275
  Shining.scripts.run(slide.script);
289
276
  }
290
277
 
@@ -334,6 +321,10 @@
334
321
  }
335
322
  })
336
323
  }
324
+
325
+ function centerStage() {
326
+ $('#stage').css({ top: ($(window).height() - $('#stage').outerHeight()) / 2 });
327
+ }
337
328
 
338
329
  Shining.init();
339
330
  })(jQuery);
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.0"
8
+ s.version = "1.3.1"
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-10}
12
+ s.date = %q{2010-05-18}
13
13
  s.description = %q{Webkit + CSS + Javascript = awesome presos}
14
14
  s.email = %q{julio.ody@gmail.com}
15
15
  s.executables = ["console", "shine"]
@@ -17,7 +17,8 @@ Gem::Specification.new do |s|
17
17
  "README.markdown"
18
18
  ]
19
19
  s.files = [
20
- "README.markdown",
20
+ "CHANGELOG.txt",
21
+ "README.markdown",
21
22
  "Rakefile",
22
23
  "VERSION",
23
24
  "bin/console",
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 3
8
- - 0
9
- version: 1.3.0
8
+ - 1
9
+ version: 1.3.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Julio Cesar Ody
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-10 00:00:00 +10:00
17
+ date: 2010-05-18 00:00:00 +10:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -138,6 +138,7 @@ extensions: []
138
138
  extra_rdoc_files:
139
139
  - README.markdown
140
140
  files:
141
+ - CHANGELOG.txt
141
142
  - README.markdown
142
143
  - Rakefile
143
144
  - VERSION