qui-tabs 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/Rakefile +17 -0
- data/public/javascripts/qui/tabs.js +46 -0
- data/public/stylesheets/qui/tabs.css +37 -0
- data/rails/init.rb +17 -0
- metadata +11 -7
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
All portions Copyright (c) 2007 Tim Harper
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rake'
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'jeweler'
|
5
|
+
Jeweler::Tasks.new do |gemspec|
|
6
|
+
gemspec.name = "qui-tabs"
|
7
|
+
gemspec.summary = "qUI: rails helpers for generating tabs"
|
8
|
+
gemspec.description = "qUI: rails helpers for generating tabs"
|
9
|
+
gemspec.email = "marcin@saepia.net"
|
10
|
+
gemspec.homepage = "http://q.saepia.net"
|
11
|
+
gemspec.authors = ["Marcin Lewandowski"]
|
12
|
+
gemspec.version = "0.0.2"
|
13
|
+
gemspec.files = Rake::FileList.new [ "MIT-LICENSE", "Rakefile", "public/stylesheets/qui/*", "public/javascripts/qui/*", "lib/*", "rails/*", "README.rdoc" ]
|
14
|
+
end
|
15
|
+
rescue LoadError
|
16
|
+
puts "Jeweler not available. Install it with: sudo gem install jeweler"
|
17
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
/*
|
2
|
+
(c) 2010 Marcin Lewandowski
|
3
|
+
http://q.saepia.net
|
4
|
+
*/
|
5
|
+
var Tab = {
|
6
|
+
_all : {},
|
7
|
+
|
8
|
+
create : function(options) {
|
9
|
+
this._all[options["id"]] = options;
|
10
|
+
if(options["custom_html_id"])
|
11
|
+
this._all[options["id"]]["html_id"] = options["custom_html_id"]
|
12
|
+
else
|
13
|
+
this._all[options["id"]]["html_id"] = "tabs_" + options["id"];
|
14
|
+
|
15
|
+
},
|
16
|
+
|
17
|
+
find : function(id) {
|
18
|
+
var obj = {
|
19
|
+
id : id,
|
20
|
+
setCurrent : function(index) {
|
21
|
+
for(var i = 0; i < Tab._all[id]["count"]; i++) {
|
22
|
+
var e = document.getElementById(Tab._all[id]["html_id"] + "_tab_" + i + "_header");
|
23
|
+
if(e.className == "current") {
|
24
|
+
e.className = "";
|
25
|
+
break;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
var e = document.getElementById(Tab._all[id]["html_id"] + "_tab_" + index + "_header");
|
29
|
+
e.className = "current";
|
30
|
+
|
31
|
+
for(var i = 0; i < Tab._all[id]["count"]; i++) {
|
32
|
+
var e = document.getElementById(Tab._all[id]["html_id"] + "_tab_" + i + "_body");
|
33
|
+
if(e.className == "current") {
|
34
|
+
e.className = "";
|
35
|
+
break;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
var e = document.getElementById(Tab._all[id]["html_id"] + "_tab_" + index + "_body");
|
39
|
+
e.className = "current";
|
40
|
+
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
return obj;
|
45
|
+
}
|
46
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
div.tabs>div.header {
|
2
|
+
height: 30px;
|
3
|
+
border-bottom: 1px solid #e0e0e0;
|
4
|
+
}
|
5
|
+
|
6
|
+
div.tabs>div.header>a {
|
7
|
+
float: left;
|
8
|
+
padding: 8px 12px;
|
9
|
+
border-top: 1px solid #e0e0e0;
|
10
|
+
border-right: 1px solid #e0e0e0;
|
11
|
+
border-left: 1px solid #e0e0e0;
|
12
|
+
margin-right: 4px;
|
13
|
+
background: #fff;
|
14
|
+
text-decoration: none;
|
15
|
+
color: #000;
|
16
|
+
}
|
17
|
+
|
18
|
+
div.tabs>div.header>a:hover {
|
19
|
+
color: #0000aa;
|
20
|
+
cursor: pointer;
|
21
|
+
}
|
22
|
+
|
23
|
+
div.tabs>div.header>a.current {
|
24
|
+
font-weight: bold;
|
25
|
+
}
|
26
|
+
|
27
|
+
div.tabs>div.body>div {
|
28
|
+
padding: 8px;
|
29
|
+
display: none;
|
30
|
+
border-right: 1px solid #e0e0e0;
|
31
|
+
border-left: 1px solid #e0e0e0;
|
32
|
+
border-bottom: 1px solid #e0e0e0;
|
33
|
+
}
|
34
|
+
|
35
|
+
div.tabs>div.body>div.current {
|
36
|
+
display: block;
|
37
|
+
}
|
data/rails/init.rb
CHANGED
@@ -1 +1,18 @@
|
|
1
1
|
ActionView::Base.send :include, QUI::Tabs::MainHelper
|
2
|
+
|
3
|
+
unless File.exists?(File.join(Rails.root, 'public/stylesheets/qui/tabs.css'))
|
4
|
+
$stderr.puts "Copying CSS for qui-tabs..."
|
5
|
+
$stderr.puts "- public/stylesheets/qui/tabs.css"
|
6
|
+
|
7
|
+
FileUtils.mkdir_p File.join(Rails.root, 'public/stylesheets/qui')
|
8
|
+
FileUtils.cp File.dirname(__FILE__) + "/../public/stylesheets/qui/tabs.css", File.join(Rails.root, 'public/stylesheets/qui')
|
9
|
+
end
|
10
|
+
|
11
|
+
|
12
|
+
unless File.exists?(File.join(Rails.root, 'public/javascripts/qui/tabs.js'))
|
13
|
+
$stderr.puts "Copying JavaScript for qui-tabs..."
|
14
|
+
$stderr.puts "- public/javascripts/qui/tabs.js"
|
15
|
+
|
16
|
+
FileUtils.mkdir_p File.join(Rails.root, 'public/javascripts/qui')
|
17
|
+
FileUtils.cp File.dirname(__FILE__) + "/../public/javascripts/qui/tabs.js", File.join(Rails.root, 'public/javascripts/qui')
|
18
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qui-tabs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Marcin Lewandowski
|
@@ -15,12 +15,12 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-08-10 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
22
22
|
description: "qUI: rails helpers for generating tabs"
|
23
|
-
email:
|
23
|
+
email: marcin@saepia.net
|
24
24
|
executables: []
|
25
25
|
|
26
26
|
extensions: []
|
@@ -28,12 +28,16 @@ extensions: []
|
|
28
28
|
extra_rdoc_files:
|
29
29
|
- README.rdoc
|
30
30
|
files:
|
31
|
+
- MIT-LICENSE
|
32
|
+
- README.rdoc
|
33
|
+
- Rakefile
|
31
34
|
- lib/qui-tabs-main-helper.rb
|
32
35
|
- lib/qui-tabs.rb
|
36
|
+
- public/javascripts/qui/tabs.js
|
37
|
+
- public/stylesheets/qui/tabs.css
|
33
38
|
- rails/init.rb
|
34
|
-
- README.rdoc
|
35
39
|
has_rdoc: true
|
36
|
-
homepage: http://
|
40
|
+
homepage: http://q.saepia.net
|
37
41
|
licenses: []
|
38
42
|
|
39
43
|
post_install_message:
|