spurs 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/spurs/beyond_bootstrap/all.js +1 -0
- data/app/assets/javascripts/spurs/beyond_bootstrap/responsive-tables.js +42 -0
- data/app/assets/javascripts/spurs/beyond_bootstrap.js +17 -0
- data/app/assets/stylesheets/spurs/beyond_bootsrap/all.css +6 -0
- data/app/assets/stylesheets/spurs/beyond_bootsrap/forms.css.sass +24 -0
- data/app/assets/stylesheets/spurs/beyond_bootsrap/mobile_modal.css.sass +9 -0
- data/app/assets/stylesheets/spurs/beyond_bootsrap/responsive-tables.css.sass +66 -0
- data/app/assets/stylesheets/spurs/beyond_bootstrap.css +4 -0
- data/app/assets/stylesheets/spurs/jquery_ui_theme/jquery-ui-1.8.16.custom.css +0 -41
- data/app/assets/stylesheets/spurs/vcenter.css.sass +1 -1
- data/app/views/spurs/modals/spawn.js.erb +8 -4
- data/config/routes.rb +6 -2
- data/lib/spurs/flash/helper.rb +6 -4
- data/lib/spurs/modal/helper.rb +1 -1
- data/lib/spurs/section/helper.rb +1 -1
- data/lib/spurs/version.rb +1 -1
- metadata +12 -4
@@ -0,0 +1 @@
|
|
1
|
+
//= require ./responsive-tables
|
@@ -0,0 +1,42 @@
|
|
1
|
+
$(document).ready(function() {
|
2
|
+
var switched = false;
|
3
|
+
var updateTables = function() {
|
4
|
+
if (($(window).width() < 767) && !switched ){
|
5
|
+
switched = true;
|
6
|
+
$("table.responsive").each(function(i, element) {
|
7
|
+
splitTable($(element));
|
8
|
+
});
|
9
|
+
return true;
|
10
|
+
}
|
11
|
+
else if (switched && ($(window).width() > 767)) {
|
12
|
+
switched = false;
|
13
|
+
$("table.responsive").each(function(i, element) {
|
14
|
+
unsplitTable($(element));
|
15
|
+
});
|
16
|
+
}
|
17
|
+
};
|
18
|
+
|
19
|
+
$(window).load(updateTables);
|
20
|
+
$(window).bind("resize", updateTables);
|
21
|
+
|
22
|
+
|
23
|
+
function splitTable(original)
|
24
|
+
{
|
25
|
+
original.wrap("<div class='table-wrapper' />");
|
26
|
+
|
27
|
+
var copy = original.clone();
|
28
|
+
copy.find("td:not(.pin_for_mobile), th:not(.pin_for_mobile)").css("display", "none");
|
29
|
+
copy.removeClass("responsive");
|
30
|
+
|
31
|
+
original.closest(".table-wrapper").append(copy);
|
32
|
+
copy.wrap("<div class='pinned' />");
|
33
|
+
original.wrap("<div class='scrollable' />");
|
34
|
+
}
|
35
|
+
|
36
|
+
function unsplitTable(original) {
|
37
|
+
original.closest(".table-wrapper").find(".pinned").remove();
|
38
|
+
original.unwrap();
|
39
|
+
original.unwrap();
|
40
|
+
}
|
41
|
+
|
42
|
+
});
|
@@ -0,0 +1,17 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// the compiled file.
|
9
|
+
//
|
10
|
+
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
11
|
+
// GO AFTER THE REQUIRES BELOW.
|
12
|
+
//
|
13
|
+
//= require ./beyond_bootstrap/all
|
14
|
+
|
15
|
+
$().ready(function(){
|
16
|
+
$('table.table').addClass('responsive');
|
17
|
+
});
|
@@ -0,0 +1,24 @@
|
|
1
|
+
$form-innerbox-side-width: 50px
|
2
|
+
$form-innerbox-color: #eee
|
3
|
+
|
4
|
+
.form-horizontal
|
5
|
+
.innerbox
|
6
|
+
margin:
|
7
|
+
top: -10px
|
8
|
+
bottom: -10px
|
9
|
+
left: $form-innerbox-side-width
|
10
|
+
right: $form-innerbox-side-width
|
11
|
+
padding:
|
12
|
+
top: 10px
|
13
|
+
bottom: 10px
|
14
|
+
|
15
|
+
background: $form-innerbox-color
|
16
|
+
border: 1px solid darken($form-innerbox-color,15)
|
17
|
+
|
18
|
+
border-radius: 3px
|
19
|
+
-webkit-border-radius: 3px
|
20
|
+
|
21
|
+
.control-label
|
22
|
+
width: (140px-$form-innerbox-side-width)
|
23
|
+
.controls
|
24
|
+
margin-left: (160px-$form-innerbox-side-width)
|
@@ -0,0 +1,66 @@
|
|
1
|
+
table
|
2
|
+
.show_for_pinned
|
3
|
+
display: none
|
4
|
+
|
5
|
+
// Mobile
|
6
|
+
@media only screen and (max-width: 767px)
|
7
|
+
table.responsive
|
8
|
+
margin-bottom: 0
|
9
|
+
.scrollable, .pinned
|
10
|
+
table
|
11
|
+
td, th
|
12
|
+
line-height: 21px
|
13
|
+
.pinned
|
14
|
+
position: absolute
|
15
|
+
left: 0
|
16
|
+
top: 0
|
17
|
+
background: #fff
|
18
|
+
width: 200px
|
19
|
+
|
20
|
+
overflow: hidden
|
21
|
+
overflow-x: scroll
|
22
|
+
//border-right: 1px solid #ccc
|
23
|
+
//border-left: 1px solid #ccc
|
24
|
+
table
|
25
|
+
border-right: none
|
26
|
+
border-left: none
|
27
|
+
width: 100%
|
28
|
+
.show_for_pinned
|
29
|
+
display: table-cell
|
30
|
+
.hide_for_pinned
|
31
|
+
display: none
|
32
|
+
th, td
|
33
|
+
white-space: nowrap
|
34
|
+
|
35
|
+
div.table-wrapper
|
36
|
+
position: relative
|
37
|
+
margin-bottom: 20px
|
38
|
+
overflow: hidden
|
39
|
+
|
40
|
+
|
41
|
+
border-radius: 5px
|
42
|
+
div.scrollable
|
43
|
+
table
|
44
|
+
margin-left: 200px
|
45
|
+
width: auto
|
46
|
+
width: 200px
|
47
|
+
min-width: 60%
|
48
|
+
overflow: scroll
|
49
|
+
overflow-y: hidden
|
50
|
+
table.responsive
|
51
|
+
td
|
52
|
+
position: relative
|
53
|
+
white-space: nowrap
|
54
|
+
overflow: hidden
|
55
|
+
th
|
56
|
+
position: relative
|
57
|
+
white-space: nowrap
|
58
|
+
overflow: hidden
|
59
|
+
&.pin_for_mobile
|
60
|
+
display: none
|
61
|
+
td.pin_for_mobile, &.pinned td
|
62
|
+
display: none
|
63
|
+
|
64
|
+
@media only screen and (max-width: 567px)
|
65
|
+
div.table-wrapper
|
66
|
+
border-right: 1px solid #ccc
|
@@ -1047,47 +1047,6 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
|
1047
1047
|
|
1048
1048
|
|
1049
1049
|
|
1050
|
-
/*** Input field styling from Bootstrap **/
|
1051
|
-
input, textarea {
|
1052
|
-
-webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
|
1053
|
-
-moz-transition: border linear 0.2s, box-shadow linear 0.2s;
|
1054
|
-
-ms-transition: border linear 0.2s, box-shadow linear 0.2s;
|
1055
|
-
-o-transition: border linear 0.2s, box-shadow linear 0.2s;
|
1056
|
-
transition: border linear 0.2s, box-shadow linear 0.2s;
|
1057
|
-
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
|
1058
|
-
-moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
|
1059
|
-
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
|
1060
|
-
}
|
1061
|
-
input:focus, textarea:focus {
|
1062
|
-
outline: 0;
|
1063
|
-
border-color: rgba(82, 168, 236, 0.8);
|
1064
|
-
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
|
1065
|
-
-moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
|
1066
|
-
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
|
1067
|
-
}
|
1068
|
-
input[type=file]:focus, input[type=checkbox]:focus, select:focus {
|
1069
|
-
-webkit-box-shadow: none;
|
1070
|
-
-moz-box-shadow: none;
|
1071
|
-
box-shadow: none;
|
1072
|
-
outline: 1px dotted #666;
|
1073
|
-
}
|
1074
|
-
|
1075
|
-
input[type="text"],
|
1076
|
-
input[type="password"],
|
1077
|
-
.ui-autocomplete-input,
|
1078
|
-
textarea,
|
1079
|
-
.uneditable-input {
|
1080
|
-
display: inline-block;
|
1081
|
-
padding: 4px;
|
1082
|
-
font-size: 13px;
|
1083
|
-
line-height: 18px;
|
1084
|
-
color: #808080;
|
1085
|
-
border: 1px solid #ccc;
|
1086
|
-
-webkit-border-radius: 3px;
|
1087
|
-
-moz-border-radius: 3px;
|
1088
|
-
border-radius: 3px;
|
1089
|
-
}
|
1090
|
-
|
1091
1050
|
|
1092
1051
|
|
1093
1052
|
/**Toolbar**/
|
@@ -1,9 +1,13 @@
|
|
1
|
-
|
1
|
+
//create the modal container
|
2
2
|
var modal_container = tn.createEl('div');
|
3
3
|
$('body')[0].appendChild(modal_container);
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
//put the partial in the modal
|
6
|
+
|
7
|
+
|
8
|
+
<%-
|
9
|
+
#Rails.logger.debug("Options: #{modal_options.to_json}")
|
10
|
+
modal_container_content =
|
7
11
|
escape_javascript(
|
8
12
|
spurs_modal modal_file_or_partial,
|
9
13
|
modal_object,
|
@@ -13,6 +17,6 @@ $('body')[0].appendChild(modal_container);
|
|
13
17
|
%>
|
14
18
|
modal_container.innerHTML = "<%= modal_container_content %>";
|
15
19
|
|
16
|
-
|
20
|
+
//activate the modal
|
17
21
|
$(modal_container.children[0]).modal();
|
18
22
|
window._asd();
|
data/config/routes.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
Rails.application.routes.draw do
|
2
|
-
|
3
|
-
resources :flashes, :only => [:create], :format => :js
|
2
|
+
locales = /en|es/
|
4
3
|
|
4
|
+
scope "(:locale)", :locale => locales do
|
5
|
+
namespace "spurs" do
|
6
|
+
resources :flashes, :only => [:create], :format => :js
|
7
|
+
|
8
|
+
end
|
5
9
|
end
|
6
10
|
end
|
data/lib/spurs/flash/helper.rb
CHANGED
@@ -42,7 +42,9 @@ module Spurs
|
|
42
42
|
content_tag(:div, alert_content.html_safe, :class => "alert alert-block #{extra_class}")
|
43
43
|
end
|
44
44
|
|
45
|
-
|
45
|
+
def logger
|
46
|
+
Rails.logger
|
47
|
+
end
|
46
48
|
##
|
47
49
|
# Generate HTML for flash messages
|
48
50
|
# = Examples
|
@@ -66,7 +68,7 @@ module Spurs
|
|
66
68
|
end
|
67
69
|
flash.clear
|
68
70
|
|
69
|
-
|
71
|
+
logger.debug("MESSAGE HASH >>#{message_hash.to_json}")
|
70
72
|
|
71
73
|
|
72
74
|
#process the message hash now
|
@@ -74,7 +76,7 @@ module Spurs
|
|
74
76
|
message_hash.each do |k, v_arr|
|
75
77
|
v_arr.each do |v|
|
76
78
|
if v == nil
|
77
|
-
|
79
|
+
logger.warn("Flash key with no value: #{k.to_s} in flash hash #{v_arr.to_json}")
|
78
80
|
else
|
79
81
|
content << spurs_alert(v, :flavor => k, :builder => my_options[:builder], :title => k.to_s.singularize.tableize.to_sym.to_s.titlecase)
|
80
82
|
end
|
@@ -103,7 +105,7 @@ module Spurs
|
|
103
105
|
# attempt to find the flavor in the list of known stuff
|
104
106
|
if Spurs::Flash::flavors.find_index(my_options[:flavor]) == nil
|
105
107
|
# didn't find it.
|
106
|
-
|
108
|
+
logger.warn("Unknown flash flavor \"#{my_options[:flavor]}\". Using a default instead")
|
107
109
|
my_options[:flavor] = Spurs::Flash::default_args[:default][:flavor]
|
108
110
|
end
|
109
111
|
|
data/lib/spurs/modal/helper.rb
CHANGED
@@ -10,7 +10,7 @@ module Spurs
|
|
10
10
|
modal_id = "modal_#{SecureRandom::hex(5)}"
|
11
11
|
|
12
12
|
options_for_content = options[:content_options] ? options.delete(:content_options) : { }
|
13
|
-
logger.debug "ContentOptions: #{options_for_content}"
|
13
|
+
#logger.debug "ContentOptions: #{options_for_content}"
|
14
14
|
if object == nil
|
15
15
|
content = render :file => file_or_partial, :locals => options_for_content
|
16
16
|
else
|
data/lib/spurs/section/helper.rb
CHANGED
data/lib/spurs/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spurs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05
|
12
|
+
date: 2012-06-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -85,6 +85,9 @@ files:
|
|
85
85
|
- app/assets/images/spurs/jquery_ui_theme/images/ui-icons_cd0a0a_256x240.png
|
86
86
|
- app/assets/images/spurs/jquery_ui_theme/images/ui-icons_f6cf3b_256x240.png
|
87
87
|
- app/assets/javascripts/spurs/application.js
|
88
|
+
- app/assets/javascripts/spurs/beyond_bootstrap/all.js
|
89
|
+
- app/assets/javascripts/spurs/beyond_bootstrap/responsive-tables.js
|
90
|
+
- app/assets/javascripts/spurs/beyond_bootstrap.js
|
88
91
|
- app/assets/javascripts/spurs/flashes.js.coffee
|
89
92
|
- app/assets/javascripts/spurs/flashes.js.erb
|
90
93
|
- app/assets/javascripts/spurs/sections.js.coffee
|
@@ -92,6 +95,11 @@ files:
|
|
92
95
|
- app/assets/javascripts/spurs/vars.js.erb
|
93
96
|
- app/assets/javascripts/spurs.js
|
94
97
|
- app/assets/stylesheets/spurs/application.css
|
98
|
+
- app/assets/stylesheets/spurs/beyond_bootsrap/all.css
|
99
|
+
- app/assets/stylesheets/spurs/beyond_bootsrap/forms.css.sass
|
100
|
+
- app/assets/stylesheets/spurs/beyond_bootsrap/mobile_modal.css.sass
|
101
|
+
- app/assets/stylesheets/spurs/beyond_bootsrap/responsive-tables.css.sass
|
102
|
+
- app/assets/stylesheets/spurs/beyond_bootstrap.css
|
95
103
|
- app/assets/stylesheets/spurs/jquery-ui-theme.css
|
96
104
|
- app/assets/stylesheets/spurs/jquery_ui_theme/jquery-ui-1.8.16.custom.css
|
97
105
|
- app/assets/stylesheets/spurs/jquery_ui_theme/jquery.ui.1.8.16.ie.css
|
@@ -181,7 +189,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
181
189
|
version: '0'
|
182
190
|
segments:
|
183
191
|
- 0
|
184
|
-
hash:
|
192
|
+
hash: -591700135069857918
|
185
193
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
194
|
none: false
|
187
195
|
requirements:
|
@@ -190,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
198
|
version: '0'
|
191
199
|
segments:
|
192
200
|
- 0
|
193
|
-
hash:
|
201
|
+
hash: -591700135069857918
|
194
202
|
requirements: []
|
195
203
|
rubyforge_project:
|
196
204
|
rubygems_version: 1.8.24
|