autopage 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,10 +1,13 @@
1
+ == 0.0.5 2009-04-15
2
+
3
+ * 1 add 'rake mani' task to replace 'rake manifest' does not work on windows
4
+ 2 add 'install.rb' to auto copy jquery.idTabs.min.js file into rails plugin if install gems as a plugin
5
+
1
6
  == 0.0.4 2009-04-15
2
7
 
3
8
  * 1 fix manifest bug which cause gem without content
4
9
  replace 'rake gem' with [ find . -type f | egrep -v "(.git\/|nbproject\/|pkg\/|script\/|\.gitignore$|\.gem$)" | sed 's/\.\///g' > Manifest.txt ]
5
10
 
6
-
7
-
8
11
  == 0.0.2 2009-04-14
9
12
 
10
13
  * 1 fix spec bug
data/Manifest.txt CHANGED
@@ -1,12 +1,15 @@
1
- Manifest.txt
2
- Rakefile
3
- README.rdoc
4
- tasks/rspec.rake
5
- spec/autopage_spec.rb
6
- spec/spec.opts
7
- spec/spec_helper.rb
8
- lib/init.rb
9
- lib/autopage.rb
10
- config/website.yml
11
- History.txt
12
- TODO
1
+ Rakefile
2
+ README.rdoc
3
+ tasks/rspec.rake
4
+ tasks/manifest.rake
5
+ spec/autopage_spec.rb
6
+ spec/spec.opts
7
+ spec/spec_helper.rb
8
+ lib/init.rb
9
+ lib/install.rb
10
+ lib/templates/jquery.idTabs.min.js
11
+ lib/autopage.rb
12
+ config/website.yml
13
+ History.txt
14
+ TODO
15
+ Manifest.txt
data/lib/autopage.rb CHANGED
@@ -5,7 +5,7 @@ $:.unshift(File.dirname(__FILE__)) unless
5
5
  # A Rails Plugin to autogenerate long text content to multipage.
6
6
  #
7
7
  module Autopage
8
- VERSION = '0.0.4'
8
+ VERSION = '0.0.5'
9
9
 
10
10
  def self.included(base)
11
11
  base.extend ClassMethods
data/lib/install.rb ADDED
@@ -0,0 +1,5 @@
1
+ plugins_dir = File.expand_path(".")
2
+ autopage_dir = File.join(plugins_dir, 'autopage')
3
+ root_dir = File.join(autopage_dir, '..', '..', '..')
4
+
5
+ File.copy File.join(autopage_dir, 'templates', 'jquery.idTabs.min.js'), File.join(root_dir, 'public', 'javascripts', 'jquery.idTabs.min.js')
@@ -0,0 +1,12 @@
1
+ /* idTabs ~ Sean Catchpole - Version 2.2 - MIT/GPL */
2
+ (function(){var dep={"jQuery":"http://code.jquery.com/jquery-latest.min.js"};var init=function(){(function($){$.fn.idTabs=function(){var s={};for(var i=0;i<arguments.length;++i){var a=arguments[i];switch(a.constructor){case Object:$.extend(s,a);break;case Boolean:s.change=a;break;case Number:s.start=a;break;case Function:s.click=a;break;case String:if(a.charAt(0)=='.')s.selected=a;else if(a.charAt(0)=='!')s.event=a;else s.start=a;break;}}
3
+ if(typeof s['return']=="function")
4
+ s.change=s['return'];return this.each(function(){$.idTabs(this,s);});}
5
+ $.idTabs=function(tabs,options){var meta=($.metadata)?$(tabs).metadata():{};var s=$.extend({},$.idTabs.settings,meta,options);if(s.selected.charAt(0)=='.')s.selected=s.selected.substr(1);if(s.event.charAt(0)=='!')s.event=s.event.substr(1);if(s.start==null)s.start=-1;var showId=function(){if($(this).is('.'+s.selected))
6
+ return s.change;var id="#"+this.href.split('#')[1];var aList=[];var idList=[];$("a",tabs).each(function(){if(this.href.match(/#/)){aList.push(this);idList.push("#"+this.href.split('#')[1]);}});if(s.click&&!s.click.apply(this,[id,idList,tabs,s]))return s.change;for(i in aList)$(aList[i]).removeClass(s.selected);for(i in idList)$(idList[i]).hide();$(this).addClass(s.selected);$(id).show();return s.change;}
7
+ var list=$("a[href*='#']",tabs).unbind(s.event,showId).bind(s.event,showId);list.each(function(){$("#"+this.href.split('#')[1]).hide();});var test=false;if((test=list.filter('.'+s.selected)).length);else if(typeof s.start=="number"&&(test=list.eq(s.start)).length);else if(typeof s.start=="string"&&(test=list.filter("[href*='#"+s.start+"']")).length);if(test){test.removeClass(s.selected);test.trigger(s.event);}
8
+ return s;}
9
+ $.idTabs.settings={start:0,change:false,click:null,selected:".selected",event:"!click"};$.idTabs.version="2.2";$(function(){$(".idTabs").idTabs();});})(jQuery);}
10
+ var check=function(o,s){s=s.split('.');while(o&&s.length)o=o[s.shift()];return o;}
11
+ var head=document.getElementsByTagName("head")[0];var add=function(url){var s=document.createElement("script");s.type="text/javascript";s.src=url;head.appendChild(s);}
12
+ var s=document.getElementsByTagName('script');var src=s[s.length-1].src;var ok=true;for(d in dep){if(check(this,d))continue;ok=false;add(dep[d]);}if(ok)return init();add(src);})();
@@ -0,0 +1,16 @@
1
+
2
+
3
+ # rake manifest does not work on windows,
4
+ # this task do the same task.
5
+ desc "rake manifest's replacement rake task"
6
+ task :mani do
7
+ system %[find . -type f | egrep -v "(.git\/|nbproject\/|pkg\/|script\/|\.gitignore$|\.gem$)" > Manifest.txt]
8
+ strio = File.read('Manifest.txt').gsub!(/\.\//,''); puts strio
9
+ File.open('Manifest.txt','w') {|f| f.puts strio }
10
+ end
11
+
12
+
13
+ namespace :autopage do
14
+
15
+
16
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autopage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - eiffel qiu
@@ -40,22 +40,25 @@ executables: []
40
40
  extensions: []
41
41
 
42
42
  extra_rdoc_files:
43
- - Manifest.txt
44
43
  - README.rdoc
45
44
  - History.txt
46
- files:
47
45
  - Manifest.txt
46
+ files:
48
47
  - Rakefile
49
48
  - README.rdoc
50
49
  - tasks/rspec.rake
50
+ - tasks/manifest.rake
51
51
  - spec/autopage_spec.rb
52
52
  - spec/spec.opts
53
53
  - spec/spec_helper.rb
54
54
  - lib/init.rb
55
+ - lib/install.rb
56
+ - lib/templates/jquery.idTabs.min.js
55
57
  - lib/autopage.rb
56
58
  - config/website.yml
57
59
  - History.txt
58
60
  - TODO
61
+ - Manifest.txt
59
62
  has_rdoc: true
60
63
  homepage: http://autopage.rubyforge.org
61
64
  post_install_message: