jquery-livetype-rails 0.1.0 → 0.2.0.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f5b0345b9418bc2b7df68d6f91f41164cacaa56
4
- data.tar.gz: 7af91c6bd2e8546a5d8d9d85d7c00da116cb6d52
3
+ metadata.gz: 40ea1f409c11d7c57dab9671245ed9e1280c447a
4
+ data.tar.gz: bf1de2fddc9d95fbd28b94d0cd210989b15d2727
5
5
  SHA512:
6
- metadata.gz: c9a628ee0dde23f47c655e6114c5f4b003c6e0284933e5e5f2fd951dd989fea5aabfbd15ad862fc9c6daf520adf98717a28200a996bee5726df0ade21f5fb71d
7
- data.tar.gz: ff7e21b0e5874e42081a1d6d8e6ced9084f3a80a43e524537f92d6e6843d427e8b06b861351fc150dbc50954d968f850452b5fdf1c8c6a49e8df88444a7880d5
6
+ metadata.gz: 413577222c3a1e6f01d85193ed9b44d0d13be1112735131d6da6491dd4a0df0478546b27aa0e33ba2624837ad01749ab30a8fabded337b9680e8df0b6e4d436c
7
+ data.tar.gz: 76295e2dd4e7dee816eb36c1efc1e454b0a0843a12091d32037e5e24df5ccc080c2ae8cf70c73f93fac1da6c366399b06af118cf2f200dc9baa34e9a8384bdd6
@@ -1,5 +1,5 @@
1
1
  module JqueryLivetypeRails
2
2
  module Rails
3
- VERSION = '0.1.0'
3
+ VERSION = '0.2.0.pre'
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * jQuery LiveType 0.1
2
+ * jQuery LiveType 0.2.pre
3
3
  *
4
4
  * Copyright 2013, Tobal San (http://www.smartrock.fr)
5
5
  * Licensed under the MIT license.
@@ -16,35 +16,35 @@ $.fn.liveType = function(opts){
16
16
  punctuationChars : ['.', '.', '?', '!', ':', ';'], // An array of characters to pause on
17
17
  cursorEffect : true, // "True" for smooth blinking, "false" for plain blinking
18
18
  cursorSpeed : 500, // Cursor blinking speed
19
- cursor : '|' // Cursor type
19
+ cursor : '|', // Cursor type
20
+ cursorClass : 'cursor' // The classname for the cursor element
20
21
  },
21
- settings = $.extend(defaults, opts);
22
+ settings = $.extend(defaults, opts),
22
23
 
23
- text = $this.html();
24
- $this.empty().append('<span class="cursor">' + settings.cursor + '</span>');
24
+ text = $this.html(),
25
+ cursor = 0,
26
+ t = setTimeout(type, settings.typeSpeed);
25
27
 
26
- cursor = 0
28
+ $this.empty().append('<span class="' + settings.cursorClass + '">' + settings.cursor + '</span>');
27
29
 
28
30
  setInterval(cursorAnimation, settings.cursorSpeed);
29
- t = setTimeout(type, settings.typeSpeed);
30
31
 
31
32
  function cursorAnimation() {
32
33
  if (settings.cursorEffect) {
33
- $("span.cursor", $this).animate({
34
+ $(settings.cursorClass, $this).animate({
34
35
  opacity: 0
35
36
  }, "fast", 'swing').animate({
36
37
  opacity: 1
37
38
  }, "fast", 'swing');
38
39
  } else {
39
- if ($('span.cursor', $this).is(':visible')) {
40
- $('span.cursor', $this).hide();
40
+ if ($(settings.cursorClass, $this).is(':visible')) {
41
+ $(settings.cursorClass, $this).hide();
41
42
  } else {
42
- $('span.cursor', $this).show();
43
+ $(settings.cursorClass, $this).show();
43
44
  }
44
45
  }
45
46
  }
46
47
 
47
-
48
48
  function type() {
49
49
  cursor++;
50
50
  if(cursor <= text.length) {
@@ -52,21 +52,21 @@ $.fn.liveType = function(opts){
52
52
  if(settings.punctuationChars.indexOf(text.substr(cursor-2, 1)) > -1) {
53
53
  clearTimeout(t);
54
54
  cursor++;
55
- setTimeout(type, settings.pauseTime);
55
+ t = setTimeout(type, settings.pauseTime);
56
56
  } else {
57
- $this.html(text.substr(0, cursor) + '<span class="cursor">' + settings.cursor + '</span>');
58
- setTimeout(type, settings.typeSpeed)
57
+ $this.html(text.substr(0, cursor) + '<span class="' + settings.cursorClass + '">' + settings.cursor + '</span>');
58
+ t = setTimeout(type, settings.typeSpeed);
59
59
  }
60
60
  } else {
61
61
  if(cursor % settings.pauseEvery) {
62
- $this.html(text.substr(0, cursor) + '<span class="cursor">' + settings.cursor + '</span>');
63
- setTimeout(type, settings.typeSpeed)
62
+ $this.html(text.substr(0, cursor) + '<span class="' + settings.cursorClass + '">' + settings.cursor + '</span>');
63
+ t = setTimeout(type, settings.typeSpeed);
64
64
  } else {
65
65
  clearTimeout(t);
66
66
  cursor++;
67
- setTimeout(type, settings.pauseTime);
67
+ t = setTimeout(type, settings.pauseTime);
68
68
  }
69
69
  }
70
70
  }
71
71
  }
72
- }
72
+ };
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-livetype-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Curt Howard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-23 00:00:00.000000000 Z
11
+ date: 2016-02-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A build of the jQuery LiveType Plugin, written by written by Tobal San,
14
14
  packaged for the Rails asset pipeline.
@@ -38,9 +38,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
38
38
  version: '0'
39
39
  required_rubygems_version: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - ">="
41
+ - - ">"
42
42
  - !ruby/object:Gem::Version
43
- version: '0'
43
+ version: 1.3.1
44
44
  requirements: []
45
45
  rubyforge_project:
46
46
  rubygems_version: 2.4.5