table_setter 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. data/.document +5 -0
  2. data/.gitignore +20 -0
  3. data/LICENSE +20 -0
  4. data/README +10 -0
  5. data/Rakefile +66 -0
  6. data/TODO +3 -0
  7. data/VERSION.yml +5 -0
  8. data/bin/table-setter +5 -0
  9. data/doc/TableFu/Formatting.html +178 -0
  10. data/doc/TableSetter/App.html +176 -0
  11. data/doc/TableSetter/Command.html +376 -0
  12. data/doc/TableSetter/Table.html +1813 -0
  13. data/doc/TableSetter.html +292 -0
  14. data/doc/_index.html +146 -0
  15. data/doc/class_list.html +36 -0
  16. data/doc/css/common.css +1 -0
  17. data/doc/css/full_list.css +50 -0
  18. data/doc/css/style.css +268 -0
  19. data/doc/file.README.html +68 -0
  20. data/doc/file_list.html +38 -0
  21. data/doc/frames.html +13 -0
  22. data/doc/index.html +68 -0
  23. data/doc/js/app.js +99 -0
  24. data/doc/js/full_list.js +106 -0
  25. data/doc/js/jquery.js +19 -0
  26. data/doc/method_list.html +291 -0
  27. data/doc/top-level-namespace.html +85 -0
  28. data/documentation/css/dawn.css +121 -0
  29. data/documentation/css/styles.css +63 -0
  30. data/documentation/images/folder.png +0 -0
  31. data/documentation/images/key.png +0 -0
  32. data/documentation/images/proplogo.png +0 -0
  33. data/documentation/images/publish.png +0 -0
  34. data/documentation/images/text-x-generic.png +0 -0
  35. data/documentation/index.html.erb +221 -0
  36. data/documentation/tables/example/index.html +4074 -0
  37. data/documentation/tables/example_faceted/index.html +17239 -0
  38. data/documentation/tables/example_formatted/index.html +861 -0
  39. data/documentation/tables/example_local/1/index.html +6084 -0
  40. data/documentation/tables/example_local/10/index.html +6084 -0
  41. data/documentation/tables/example_local/11/index.html +6084 -0
  42. data/documentation/tables/example_local/12/index.html +6084 -0
  43. data/documentation/tables/example_local/13/index.html +6084 -0
  44. data/documentation/tables/example_local/14/index.html +6084 -0
  45. data/documentation/tables/example_local/15/index.html +6084 -0
  46. data/documentation/tables/example_local/16/index.html +6084 -0
  47. data/documentation/tables/example_local/17/index.html +6084 -0
  48. data/documentation/tables/example_local/18/index.html +6084 -0
  49. data/documentation/tables/example_local/19/index.html +6084 -0
  50. data/documentation/tables/example_local/2/index.html +6084 -0
  51. data/documentation/tables/example_local/20/index.html +6084 -0
  52. data/documentation/tables/example_local/21/index.html +6084 -0
  53. data/documentation/tables/example_local/22/index.html +6084 -0
  54. data/documentation/tables/example_local/23/index.html +6084 -0
  55. data/documentation/tables/example_local/24/index.html +1404 -0
  56. data/documentation/tables/example_local/3/index.html +6084 -0
  57. data/documentation/tables/example_local/4/index.html +6084 -0
  58. data/documentation/tables/example_local/5/index.html +6084 -0
  59. data/documentation/tables/example_local/6/index.html +6084 -0
  60. data/documentation/tables/example_local/7/index.html +6084 -0
  61. data/documentation/tables/example_local/8/index.html +6084 -0
  62. data/documentation/tables/example_local/9/index.html +6084 -0
  63. data/documentation/tables/example_local/index.html +6084 -0
  64. data/documentation/tables/favicon.ico +0 -0
  65. data/documentation/tables/images/th_arrow_asc.gif +0 -0
  66. data/documentation/tables/images/th_arrow_desc.gif +0 -0
  67. data/documentation/tables/index.html +48 -0
  68. data/documentation/tables/javascripts/application.js +32 -0
  69. data/documentation/tables/javascripts/jquery.tablesorter.js +852 -0
  70. data/documentation/tables/javascripts/jquery.tablesorter.multipagefilter.js +111 -0
  71. data/documentation/tables/javascripts/jquery.tablesorter.pager.js +183 -0
  72. data/documentation/tables/stylesheets/stylesheet.css +67 -0
  73. data/index.html +238 -0
  74. data/lib/table_setter/app.rb +54 -0
  75. data/lib/table_setter/command.rb +139 -0
  76. data/lib/table_setter/table.rb +226 -0
  77. data/lib/table_setter.rb +32 -0
  78. data/spec/spec.opts +1 -0
  79. data/spec/spec_helper.rb +11 -0
  80. data/spec/table-setter-app_spec.rb +24 -0
  81. data/spec/table-setter_spec.rb +179 -0
  82. data/table_setter.gemspec +171 -0
  83. data/template/config.ru +33 -0
  84. data/template/public/favicon.ico +0 -0
  85. data/template/public/images/th_arrow_asc.gif +0 -0
  86. data/template/public/images/th_arrow_desc.gif +0 -0
  87. data/template/public/javascripts/application.js +32 -0
  88. data/template/public/javascripts/jquery.tablesorter.js +852 -0
  89. data/template/public/javascripts/jquery.tablesorter.multipagefilter.js +111 -0
  90. data/template/public/javascripts/jquery.tablesorter.pager.js +183 -0
  91. data/template/public/stylesheets/stylesheet.css +74 -0
  92. data/template/tables/example.yml +21 -0
  93. data/template/tables/example_faceted.yml +27 -0
  94. data/template/tables/example_formatted.csv +1 -0
  95. data/template/tables/example_formatted.yml +27 -0
  96. data/template/tables/example_local.csv +5806 -0
  97. data/template/tables/example_local.yml +27 -0
  98. data/template/views/404.erb +4 -0
  99. data/template/views/500.erb +4 -0
  100. data/template/views/index.erb +7 -0
  101. data/template/views/layout.erb +34 -0
  102. data/template/views/table.erb +78 -0
  103. metadata +240 -0
@@ -0,0 +1,171 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{table_setter}
8
+ s.version = "0.1.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Jeff Larson"]
12
+ s.date = %q{2010-03-10}
13
+ s.description = %q{A sinatra based app for rendering CSVs hosted on google docs or locally in custom HTML}
14
+ s.email = %q{thejefflarson@gmail.com}
15
+ s.executables = ["table-setter", "table-setter"]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE",
18
+ "README",
19
+ "TODO"
20
+ ]
21
+ s.files = [
22
+ ".document",
23
+ ".gitignore",
24
+ "LICENSE",
25
+ "README",
26
+ "Rakefile",
27
+ "TODO",
28
+ "VERSION.yml",
29
+ "bin/table-setter",
30
+ "doc/TableFu/Formatting.html",
31
+ "doc/TableSetter.html",
32
+ "doc/TableSetter/App.html",
33
+ "doc/TableSetter/Command.html",
34
+ "doc/TableSetter/Table.html",
35
+ "doc/_index.html",
36
+ "doc/class_list.html",
37
+ "doc/css/common.css",
38
+ "doc/css/full_list.css",
39
+ "doc/css/style.css",
40
+ "doc/file.README.html",
41
+ "doc/file_list.html",
42
+ "doc/frames.html",
43
+ "doc/index.html",
44
+ "doc/js/app.js",
45
+ "doc/js/full_list.js",
46
+ "doc/js/jquery.js",
47
+ "doc/method_list.html",
48
+ "doc/top-level-namespace.html",
49
+ "documentation/css/dawn.css",
50
+ "documentation/css/styles.css",
51
+ "documentation/images/folder.png",
52
+ "documentation/images/key.png",
53
+ "documentation/images/proplogo.png",
54
+ "documentation/images/publish.png",
55
+ "documentation/images/text-x-generic.png",
56
+ "documentation/index.html.erb",
57
+ "documentation/tables/example/index.html",
58
+ "documentation/tables/example_faceted/index.html",
59
+ "documentation/tables/example_formatted/index.html",
60
+ "documentation/tables/example_local/1/index.html",
61
+ "documentation/tables/example_local/10/index.html",
62
+ "documentation/tables/example_local/11/index.html",
63
+ "documentation/tables/example_local/12/index.html",
64
+ "documentation/tables/example_local/13/index.html",
65
+ "documentation/tables/example_local/14/index.html",
66
+ "documentation/tables/example_local/15/index.html",
67
+ "documentation/tables/example_local/16/index.html",
68
+ "documentation/tables/example_local/17/index.html",
69
+ "documentation/tables/example_local/18/index.html",
70
+ "documentation/tables/example_local/19/index.html",
71
+ "documentation/tables/example_local/2/index.html",
72
+ "documentation/tables/example_local/20/index.html",
73
+ "documentation/tables/example_local/21/index.html",
74
+ "documentation/tables/example_local/22/index.html",
75
+ "documentation/tables/example_local/23/index.html",
76
+ "documentation/tables/example_local/24/index.html",
77
+ "documentation/tables/example_local/3/index.html",
78
+ "documentation/tables/example_local/4/index.html",
79
+ "documentation/tables/example_local/5/index.html",
80
+ "documentation/tables/example_local/6/index.html",
81
+ "documentation/tables/example_local/7/index.html",
82
+ "documentation/tables/example_local/8/index.html",
83
+ "documentation/tables/example_local/9/index.html",
84
+ "documentation/tables/example_local/index.html",
85
+ "documentation/tables/favicon.ico",
86
+ "documentation/tables/images/th_arrow_asc.gif",
87
+ "documentation/tables/images/th_arrow_desc.gif",
88
+ "documentation/tables/index.html",
89
+ "documentation/tables/javascripts/application.js",
90
+ "documentation/tables/javascripts/jquery.tablesorter.js",
91
+ "documentation/tables/javascripts/jquery.tablesorter.multipagefilter.js",
92
+ "documentation/tables/javascripts/jquery.tablesorter.pager.js",
93
+ "documentation/tables/stylesheets/stylesheet.css",
94
+ "index.html",
95
+ "lib/table_setter.rb",
96
+ "lib/table_setter/app.rb",
97
+ "lib/table_setter/command.rb",
98
+ "lib/table_setter/table.rb",
99
+ "spec/spec.opts",
100
+ "spec/spec_helper.rb",
101
+ "spec/table-setter-app_spec.rb",
102
+ "spec/table-setter_spec.rb",
103
+ "table_setter.gemspec",
104
+ "template/config.ru",
105
+ "template/public/favicon.ico",
106
+ "template/public/images/th_arrow_asc.gif",
107
+ "template/public/images/th_arrow_desc.gif",
108
+ "template/public/javascripts/application.js",
109
+ "template/public/javascripts/jquery.tablesorter.js",
110
+ "template/public/javascripts/jquery.tablesorter.multipagefilter.js",
111
+ "template/public/javascripts/jquery.tablesorter.pager.js",
112
+ "template/public/stylesheets/stylesheet.css",
113
+ "template/tables/example.yml",
114
+ "template/tables/example_faceted.yml",
115
+ "template/tables/example_formatted.csv",
116
+ "template/tables/example_formatted.yml",
117
+ "template/tables/example_local.csv",
118
+ "template/tables/example_local.yml",
119
+ "template/views/404.erb",
120
+ "template/views/500.erb",
121
+ "template/views/index.erb",
122
+ "template/views/layout.erb",
123
+ "template/views/table.erb"
124
+ ]
125
+ s.homepage = %q{http://github.com/thejefflarson/table-setter}
126
+ s.rdoc_options = ["--charset=UTF-8"]
127
+ s.require_paths = ["lib"]
128
+ s.rubyforge_project = %q{table-setter}
129
+ s.rubygems_version = %q{1.3.5}
130
+ s.summary = %q{A sinatra based app for rendering CSVs in custom HTML}
131
+ s.test_files = [
132
+ "spec/spec_helper.rb",
133
+ "spec/table-setter-app_spec.rb",
134
+ "spec/table-setter_spec.rb"
135
+ ]
136
+
137
+ if s.respond_to? :specification_version then
138
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
139
+ s.specification_version = 3
140
+
141
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
142
+ s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
143
+ s.add_development_dependency(%q<rack>, [">= 1.1.0"])
144
+ s.add_development_dependency(%q<thin>, [">= 1.2.5"])
145
+ s.add_runtime_dependency(%q<table_fu>, [">= 0.1.1"])
146
+ s.add_runtime_dependency(%q<sinatra>, [">= 0.9.4"])
147
+ s.add_runtime_dependency(%q<sinatra-static-assets>, [">= 0.5.0"])
148
+ s.add_runtime_dependency(%q<emk-sinatra-url-for>, [">= 0.2.1"])
149
+ s.add_runtime_dependency(%q<curb>, [">= 0.6.6.0"])
150
+ else
151
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
152
+ s.add_dependency(%q<rack>, [">= 1.1.0"])
153
+ s.add_dependency(%q<thin>, [">= 1.2.5"])
154
+ s.add_dependency(%q<table_fu>, [">= 0.1.1"])
155
+ s.add_dependency(%q<sinatra>, [">= 0.9.4"])
156
+ s.add_dependency(%q<sinatra-static-assets>, [">= 0.5.0"])
157
+ s.add_dependency(%q<emk-sinatra-url-for>, [">= 0.2.1"])
158
+ s.add_dependency(%q<curb>, [">= 0.6.6.0"])
159
+ end
160
+ else
161
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
162
+ s.add_dependency(%q<rack>, [">= 1.1.0"])
163
+ s.add_dependency(%q<thin>, [">= 1.2.5"])
164
+ s.add_dependency(%q<table_fu>, [">= 0.1.1"])
165
+ s.add_dependency(%q<sinatra>, [">= 0.9.4"])
166
+ s.add_dependency(%q<sinatra-static-assets>, [">= 0.5.0"])
167
+ s.add_dependency(%q<emk-sinatra-url-for>, [">= 0.2.1"])
168
+ s.add_dependency(%q<curb>, [">= 0.6.6.0"])
169
+ end
170
+ end
171
+
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This is the rackup file for TableSetter, you can use it to run the application through any rack
4
+ # enabled web server.
5
+ #
6
+ # For example this will spin up a thin instance:
7
+ #
8
+ # thin start -R ./config.ru
9
+ #
10
+ # To run it in apache you should have Passenger enabled, and follow the instructions in the
11
+ # passenger docs:
12
+ #
13
+ # http://www.modrails.com/documentation/Users%20guide.html#_deploying_a_rack_based_ruby_application
14
+
15
+ require 'rubygems'
16
+ require 'table_setter'
17
+ TableSetter.configure(File.dirname(__FILE__))
18
+
19
+
20
+ # You should probably enable Rack::Cache if you're not behind a caching proxy, by uncommenting the
21
+ # lines below:
22
+ #
23
+ #require 'rack/cache'
24
+ #use Rack::Cache,
25
+ # :metastore => "file:#{TableSetter.config_path}/tmp/meta",
26
+ # :entitystore => "file:#{TableSetter.config_path}/tmp/body"
27
+ #
28
+ # You can tweak the cache timeout for TableSetter by setting the timeout variable on
29
+ # TableSetter::App:
30
+ #
31
+ TableSetter::App.cache_timeout = 60 * 15 # 15 minutes
32
+ #
33
+ run TableSetter::App
File without changes
@@ -0,0 +1,32 @@
1
+ $(document).ready(function(){
2
+ if(!sortPlease) return;
3
+ $.tablesorter.addWidget({
4
+ id: "columnHighlight",
5
+ format: function(table) {
6
+ if (!this.tds)
7
+ this.tds = $("td", table.tBodies[0]);
8
+ if (!this.headers)
9
+ this.headers = $("thead th", table);
10
+ this.tds.removeClass("sorted");
11
+ var ascSort = $("th." + table.config.cssAsc);
12
+ var descSort = $("th." + table.config.cssDesc);
13
+ if (ascSort.length)
14
+ index = this.headers.index(ascSort[0]);
15
+ if (descSort.length)
16
+ index = this.headers.index(descSort[0]);
17
+ $("tr td:nth-child(" + (index+1) + ")", table.tBodies[0]).each(function(row){
18
+ $(this).addClass('sorted');
19
+ });
20
+ }
21
+ });
22
+
23
+ //initialize the table
24
+ var table = window.table = $('#data').tablesorter({
25
+ widgets: ['columnHighlight'],
26
+ sortList: sortOrder//,
27
+ //debug: true
28
+ })
29
+ .tablesorterPager({container: $("#pager"), positionFixed: false, size: perPage})
30
+ .tablesorterMultiPageFilter({filterSelector: $("#filter input")});
31
+
32
+ });