spurs 0.0.6.rc1 → 0.0.6.rc2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +27 -0
- data/app/assets/javascripts/spurs/beyond_bootstrap/all.js +1 -1
- data/app/assets/javascripts/spurs/beyond_bootstrap/bootstrap-collapsible-section.js +72 -0
- data/app/assets/javascripts/spurs/beyond_bootstrap/responsive-tables.js +6 -6
- data/app/assets/javascripts/spurs/beyond_bootstrap.js +4 -2
- data/app/assets/stylesheets/spurs/beyond_bootsrap/all.css +1 -1
- data/app/assets/stylesheets/spurs/beyond_bootsrap/bootstrap-collapsible-section.css.scss +71 -0
- data/app/assets/stylesheets/spurs/beyond_bootsrap/mobile_modal.css.sass +3 -17
- data/app/assets/stylesheets/spurs/beyond_bootsrap/responsive-tables.css.sass +24 -25
- data/app/assets/stylesheets/spurs/beyond_bootstrap.css +1 -10
- data/app/assets/stylesheets/spurs/sections.css.sass +0 -33
- data/app/views/spurs/modals/spawn.js.erb +1 -42
- data/lib/spurs/flash/helper.rb +2 -6
- data/lib/spurs/nav/builder.rb +0 -3
- data/lib/spurs/section/collapsible_section_builder.rb +6 -2
- data/lib/spurs/section/helper.rb +0 -12
- data/lib/spurs/section.rb +0 -8
- data/lib/spurs/version.rb +1 -1
- data/lib/spurs.rb +0 -2
- data/test/spurs_test.rb +7 -0
- metadata +12 -80
- data/README.markdown +0 -87
- data/app/assets/javascripts/spurs/beyond_bootstrap/sticky-subnav.js.coffee +0 -24
- data/app/assets/stylesheets/spurs/beyond_bootsrap/button_column.css.sass +0 -20
- data/lib/spurs/section/builder_base.rb +0 -9
- data/lib/spurs/section/section_builder.rb +0 -22
- data/test/dummy/log/test.log +0 -0
data/README.rdoc
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
== Spurs
|
2
|
+
|
3
|
+
|
4
|
+
Rails is a web-application framework that includes everything needed to create
|
5
|
+
database-backed web applications according to the Model-View-Control pattern.
|
6
|
+
|
7
|
+
This pattern splits the view (also called the presentation) into "dumb"
|
8
|
+
templates that are primarily responsible for inserting pre-built data in between
|
9
|
+
HTML tags. The model contains the "smart" domain objects (such as Account,
|
10
|
+
Product, Person, Post) that holds all the business logic and knows how to
|
11
|
+
persist themselves to a database. The controller handles the incoming requests
|
12
|
+
(such as Save New Account, Update Product, Show Post) by manipulating the model
|
13
|
+
and directing data to the view.
|
14
|
+
|
15
|
+
In Rails, the model is handled by what's called an object-relational mapping
|
16
|
+
layer entitled Active Record. This layer allows you to present the data from
|
17
|
+
database rows as objects and embellish these data objects with business logic
|
18
|
+
methods. You can read more about Active Record in
|
19
|
+
link:files/vendor/rails/activerecord/README.html.
|
20
|
+
|
21
|
+
The controller and view are handled by the Action Pack, which handles both
|
22
|
+
layers by its two parts: Action View and Action Controller. These two layers
|
23
|
+
are bundled in a single package due to their heavy interdependence. This is
|
24
|
+
unlike the relationship between the Active Record and Action Pack that is much
|
25
|
+
more separate. Each of these packages can be used independently outside of
|
26
|
+
Rails. You can read more about Action Pack in
|
27
|
+
link:files/vendor/rails/actionpack/README.html.
|
@@ -1,2 +1,2 @@
|
|
1
1
|
//= require ./responsive-tables
|
2
|
-
//= require ./
|
2
|
+
//= require ./bootstrap-collapsible-section
|
@@ -0,0 +1,72 @@
|
|
1
|
+
/**
|
2
|
+
* jQuery Collapsible Section
|
3
|
+
* (c) 2012 Michael North
|
4
|
+
*/
|
5
|
+
(function( $ ){
|
6
|
+
|
7
|
+
$.fn.collapsibleSection = function( options ) {
|
8
|
+
|
9
|
+
// Create some defaults, extending them with any options that were provided
|
10
|
+
var settings = $.extend({
|
11
|
+
collapseText :'collapse',
|
12
|
+
expandText :'click to expand',
|
13
|
+
headerClass :'section-header',
|
14
|
+
bodyClass :'section-body',
|
15
|
+
footerClass :'section-footer',
|
16
|
+
endClass :'collapsible-section-end',
|
17
|
+
sectionComponentClass:'collapsible-section-component'
|
18
|
+
|
19
|
+
}, options);
|
20
|
+
|
21
|
+
var private_methods = {
|
22
|
+
expandSection: function() {
|
23
|
+
$(this).removeClass('collapsed');
|
24
|
+
$(this).addClass('expanded');
|
25
|
+
},
|
26
|
+
collapseSection: function() {
|
27
|
+
$(this).addClass('collapsed');
|
28
|
+
$(this).removeClass('expanded');
|
29
|
+
}
|
30
|
+
};
|
31
|
+
|
32
|
+
return this.each(function(idx,item) {
|
33
|
+
//if no collapsed or expanded class is present, collapse it
|
34
|
+
if(!$(item).hasClass('collapsed') && !$(item).hasClass('expanded')) {
|
35
|
+
$(item).addClass('collapsed');
|
36
|
+
}
|
37
|
+
|
38
|
+
//create end
|
39
|
+
var end_element = document.createElement("div");
|
40
|
+
$(end_element).addClass(settings.endClass);
|
41
|
+
|
42
|
+
var end_element_message = document.createElement('div');
|
43
|
+
$(end_element_message).addClass("message").append(settings.expandText);
|
44
|
+
var fadestripe = document.createElement("div");
|
45
|
+
$(fadestripe).addClass('fadestripe');
|
46
|
+
$(fadestripe).append(" ");
|
47
|
+
end_element.appendChild(end_element_message);
|
48
|
+
end_element.appendChild(fadestripe);
|
49
|
+
|
50
|
+
$(item).append(end_element);
|
51
|
+
|
52
|
+
//add section-component class to header, body and end
|
53
|
+
$(item).find('.' + settings.bodyClass).addClass(settings.sectionComponentClass);
|
54
|
+
$(item).find('.' + settings.footerClass).addClass(settings.sectionComponentClass);
|
55
|
+
$(item).find('.' + settings.endClass).addClass(settings.sectionComponentClass);
|
56
|
+
|
57
|
+
//add collapse button
|
58
|
+
var collapse_button = document.createElement('a');
|
59
|
+
$(collapse_button).addClass('collapse-trigger');
|
60
|
+
$(collapse_button).click(function(){
|
61
|
+
private_methods.collapseSection.apply(item);
|
62
|
+
});
|
63
|
+
$(collapse_button).append(settings.collapseText);
|
64
|
+
$(item).find('.' + settings.headerClass)[0].appendChild(collapse_button);
|
65
|
+
|
66
|
+
$(item).find('.'+settings.sectionComponentClass).click(function(){
|
67
|
+
private_methods.expandSection.apply(item);
|
68
|
+
});
|
69
|
+
});
|
70
|
+
|
71
|
+
};
|
72
|
+
})( jQuery );
|
@@ -15,24 +15,24 @@ $(document).ready(function() {
|
|
15
15
|
});
|
16
16
|
}
|
17
17
|
};
|
18
|
-
|
18
|
+
|
19
19
|
$(window).load(updateTables);
|
20
20
|
$(window).bind("resize", updateTables);
|
21
|
-
|
22
|
-
|
21
|
+
|
22
|
+
|
23
23
|
function splitTable(original)
|
24
24
|
{
|
25
25
|
original.wrap("<div class='table-wrapper' />");
|
26
|
-
|
26
|
+
|
27
27
|
var copy = original.clone();
|
28
28
|
copy.find("td:not(.pin_for_mobile), th:not(.pin_for_mobile)").css("display", "none");
|
29
29
|
copy.removeClass("responsive");
|
30
|
-
|
30
|
+
|
31
31
|
original.closest(".table-wrapper").append(copy);
|
32
32
|
copy.wrap("<div class='pinned' />");
|
33
33
|
original.wrap("<div class='scrollable' />");
|
34
34
|
}
|
35
|
-
|
35
|
+
|
36
36
|
function unsplitTable(original) {
|
37
37
|
original.closest(".table-wrapper").find(".pinned").remove();
|
38
38
|
original.unwrap();
|
@@ -0,0 +1,71 @@
|
|
1
|
+
.mn-section {
|
2
|
+
margin: 10px 0px;
|
3
|
+
display: block;
|
4
|
+
.section-header {
|
5
|
+
font-size: 24px;
|
6
|
+
line-height: 30px;
|
7
|
+
padding-left: 10px;
|
8
|
+
border-bottom: 1px solid #ddd;
|
9
|
+
|
10
|
+
a.collapse-trigger {
|
11
|
+
display: none;
|
12
|
+
float: right;
|
13
|
+
font-size: 12px;
|
14
|
+
font-weight: 300;
|
15
|
+
margin-right: 10px;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
|
20
|
+
.section-body {
|
21
|
+
font-size: 16px;
|
22
|
+
padding-left: 10px;
|
23
|
+
font-weight: 300;
|
24
|
+
line-height: 20px;
|
25
|
+
color: #666;
|
26
|
+
overflow: hidden;
|
27
|
+
}
|
28
|
+
|
29
|
+
.collapsible-section-end {
|
30
|
+
height: 0px;
|
31
|
+
.message {
|
32
|
+
height: 0px;
|
33
|
+
padding-top: 8px;
|
34
|
+
float: right;
|
35
|
+
z-index: 1001;
|
36
|
+
color: #999;
|
37
|
+
position: relative;
|
38
|
+
}
|
39
|
+
.fadestripe {
|
40
|
+
z-index: 1000;
|
41
|
+
height: 30px;
|
42
|
+
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
|
43
|
+
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIwLjIiLz4KICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWQtdWNnZy1nZW5lcmF0ZWQpIiAvPgo8L3N2Zz4=);
|
44
|
+
background: -moz-linear-gradient(top, rgba(255,255,255,0.2) 0%, rgba(255,255,255,1) 100%); /* FF3.6+ */
|
45
|
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.2)), color-stop(100%,rgba(255,255,255,1))); /* Chrome,Safari4+ */
|
46
|
+
background: -webkit-linear-gradient(top, rgba(255,255,255,0.2) 0%,rgba(255,255,255,1) 100%); /* Chrome10+,Safari5.1+ */
|
47
|
+
background: -o-linear-gradient(top, rgba(255,255,255,0.2) 0%,rgba(255,255,255,1) 100%); /* Opera 11.10+ */
|
48
|
+
background: -ms-linear-gradient(top, rgba(255,255,255,0.2) 0%,rgba(255,255,255,1) 100%); /* IE10+ */
|
49
|
+
background: linear-gradient(to bottom, rgba(255,255,255,0.2) 0%,rgba(255,255,255,1) 100%); /* W3C */
|
50
|
+
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#33ffffff', endColorstr='#ffffff',GradientType=0 ); /* IE6-8 */
|
51
|
+
|
52
|
+
position:relative;
|
53
|
+
top: -30px;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
&.collapsed {
|
57
|
+
.section-body {
|
58
|
+
height: 60px;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
&.expanded {
|
62
|
+
a.collapse-trigger {
|
63
|
+
display: inline;
|
64
|
+
}
|
65
|
+
.collapsible-section-end {
|
66
|
+
.fadestripe, .message {
|
67
|
+
display:none;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
}
|
71
|
+
}
|
@@ -1,23 +1,9 @@
|
|
1
1
|
@media (max-width: 560px)
|
2
2
|
.modal
|
3
|
+
position: fixed
|
3
4
|
width: 100%
|
4
|
-
top: 50px
|
5
5
|
margin-left: 0px
|
6
6
|
margin-right: 0px
|
7
|
-
box-shadow: none
|
8
|
-
right: 0px
|
9
|
-
border: none
|
10
7
|
left: 0px
|
11
|
-
|
12
|
-
|
13
|
-
width: auto
|
14
|
-
padding-top: 5px
|
15
|
-
padding-bottom: 5px
|
16
|
-
h1
|
17
|
-
font-size: 30px
|
18
|
-
line-height: 30px
|
19
|
-
padding-top: 0px
|
20
|
-
padding-bottom: 0px
|
21
|
-
.modal-body
|
22
|
-
|
23
|
-
padding-top: 50px
|
8
|
+
right: 0px
|
9
|
+
top: 50px
|
@@ -6,32 +6,31 @@ table
|
|
6
6
|
@media only screen and (max-width: 767px)
|
7
7
|
table.responsive
|
8
8
|
margin-bottom: 0
|
9
|
-
.
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
width: 200px
|
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
|
20
19
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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
|
35
34
|
|
36
35
|
div.table-wrapper
|
37
36
|
position: relative
|
@@ -15,36 +15,3 @@
|
|
15
15
|
.section_body
|
16
16
|
display: block
|
17
17
|
|
18
|
-
|
19
|
-
$section_bg_color: rgb(250,250,250)
|
20
|
-
|
21
|
-
.spurs_section
|
22
|
-
margin-bottom: 10px
|
23
|
-
.section_header
|
24
|
-
font-size: 20px
|
25
|
-
color: #333
|
26
|
-
border-bottom: 1px solid #E5E5E5
|
27
|
-
margin-bottom: 2px
|
28
|
-
line-height: 36px
|
29
|
-
.section_body
|
30
|
-
background: $section_bg_color
|
31
|
-
border: 1px solid #eee
|
32
|
-
padding: 10px
|
33
|
-
border-bottom-right-radius: 5px
|
34
|
-
border-bottom-left-radius: 5px
|
35
|
-
ul.nav.nav-tabs
|
36
|
-
li
|
37
|
-
a
|
38
|
-
background-color: #fff
|
39
|
-
border: 1px solid #ddd
|
40
|
-
&:hover
|
41
|
-
background-color: #666
|
42
|
-
color: $section_bg_color
|
43
|
-
&.active
|
44
|
-
a
|
45
|
-
background-color: $section_bg_color
|
46
|
-
border-bottom-color: transparent
|
47
|
-
&:hover
|
48
|
-
background-color: $section_bg_color
|
49
|
-
border-bottom-color: transparent
|
50
|
-
color: #333
|
@@ -17,47 +17,6 @@ $('body')[0].appendChild(modal_container);
|
|
17
17
|
%>
|
18
18
|
modal_container.innerHTML = "<%= modal_container_content %>";
|
19
19
|
|
20
|
-
if ($(modal_container.children[0]).find('.javascript-hooks').size() > 0) {
|
21
|
-
var js_hooks = $(modal_container.children[0]).find('.javascript-hooks');
|
22
|
-
var modal = $(modal_container.children[0]);
|
23
|
-
|
24
|
-
modal.on('hidden', function () {
|
25
|
-
js_hooks.each(function (idx, item) {
|
26
|
-
if ($(item).attr('onhidden')) {
|
27
|
-
eval($(item).attr('onhidden'));
|
28
|
-
}
|
29
|
-
});
|
30
|
-
});
|
31
|
-
|
32
|
-
modal.on('hide', function () {
|
33
|
-
js_hooks.each(function (idx, item) {
|
34
|
-
if ($(item).attr('onhide')) {
|
35
|
-
eval($(item).attr('onhide'));
|
36
|
-
}
|
37
|
-
});
|
38
|
-
});
|
39
|
-
|
40
|
-
modal.on('show', function () {
|
41
|
-
js_hooks.each(function (idx, item) {
|
42
|
-
if ($(item).attr('onShow')) {
|
43
|
-
eval($(item).attr('onShow'));
|
44
|
-
}
|
45
|
-
});
|
46
|
-
});
|
47
|
-
|
48
|
-
modal.on('shown', function () {
|
49
|
-
js_hooks.each(function (idx, item) {
|
50
|
-
if ($(item).attr('onshown')) {
|
51
|
-
console.log($(item));
|
52
|
-
eval($(item).attr('onshown'));
|
53
|
-
}
|
54
|
-
});
|
55
|
-
});
|
56
|
-
}
|
57
|
-
|
58
20
|
//activate the modal
|
59
21
|
$(modal_container.children[0]).modal();
|
60
|
-
|
61
|
-
if(window._asd != undefined) {
|
62
|
-
window._asd();
|
63
|
-
}
|
22
|
+
window._asd();
|
data/lib/spurs/flash/helper.rb
CHANGED
@@ -33,11 +33,7 @@ module Spurs
|
|
33
33
|
extra_class = options[:type] ? "alert-#{options[:type]}" : ""
|
34
34
|
alert_content = String.new
|
35
35
|
if options[:title]
|
36
|
-
|
37
|
-
if options[:title_icon]
|
38
|
-
titl = "<i class='icon-#{options[:title_icon]}' style='margin-right: 6px'></i>".concat(titl)
|
39
|
-
end
|
40
|
-
alert_content.concat(content_tag(:h4, titl.html_safe, :class => 'alert-heading'))
|
36
|
+
alert_content.concat(content_tag(:h4, options[:title], :class => 'alert-heading'))
|
41
37
|
end
|
42
38
|
if block
|
43
39
|
block_content = capture(nil, &block)
|
@@ -72,7 +68,7 @@ module Spurs
|
|
72
68
|
end
|
73
69
|
flash.clear
|
74
70
|
|
75
|
-
|
71
|
+
logger.debug("MESSAGE HASH >>#{message_hash.to_json}")
|
76
72
|
|
77
73
|
|
78
74
|
#process the message hash now
|
data/lib/spurs/nav/builder.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
-
|
1
|
+
class Spurs::Section::CollapsibleSectionBuilder
|
2
|
+
include ActionView::Helpers::TagHelper
|
2
3
|
|
3
|
-
|
4
|
+
@options_from_helper
|
5
|
+
def initialize(args={})
|
6
|
+
@options_from_helper = args.clone
|
7
|
+
end
|
4
8
|
|
5
9
|
def build_collapsible_section(title,content)
|
6
10
|
r = SecureRandom::hex(5)
|
data/lib/spurs/section/helper.rb
CHANGED
@@ -15,18 +15,6 @@ module Spurs
|
|
15
15
|
builder.build_collapsible_section(title.html_safe,section_content.html_safe)
|
16
16
|
end
|
17
17
|
|
18
|
-
def spurs_section(title,options={},&block)
|
19
|
-
opts = Spurs::Section::section_default_options.merge(options)
|
20
|
-
if !opts[:builder]
|
21
|
-
raise "Null builder"
|
22
|
-
end
|
23
|
-
|
24
|
-
options_to_pass_to_builder = {}
|
25
|
-
builder = opts[:builder].new(options_to_pass_to_builder)
|
26
|
-
section_content = capture(nil,&block)
|
27
|
-
builder.build_section(title.html_safe,section_content.html_safe)
|
28
|
-
end
|
29
|
-
|
30
18
|
def spurs_vcenter(options={}, &block)
|
31
19
|
opts = options.clone
|
32
20
|
if !opts[:class]
|
data/lib/spurs/section.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require "spurs/section/helper"
|
2
2
|
require "spurs/section/collapsible_section_builder"
|
3
|
-
require "spurs/section/section_builder"
|
4
3
|
module Spurs
|
5
4
|
module Section
|
6
5
|
@@collapsible_section_default_options = {
|
@@ -11,13 +10,6 @@ module Spurs
|
|
11
10
|
def self.collapsible_section_default_options
|
12
11
|
@@collapsible_section_default_options
|
13
12
|
end
|
14
|
-
|
15
|
-
@@section_default_options = {
|
16
|
-
:builder => Spurs::Section::SectionBuilder
|
17
|
-
}
|
18
|
-
def self.section_default_options
|
19
|
-
@@section_default_options
|
20
|
-
end
|
21
13
|
end
|
22
14
|
end
|
23
15
|
|
data/lib/spurs/version.rb
CHANGED
data/lib/spurs.rb
CHANGED
@@ -18,8 +18,6 @@ require "spurs/section"
|
|
18
18
|
require "spurs/engine"
|
19
19
|
require "spurs/badge"
|
20
20
|
|
21
|
-
require "bootstrap-wysihtml5-rails/engine"
|
22
|
-
|
23
21
|
ActionView::Base.send :include, Spurs::Flash::Helper
|
24
22
|
ActionView::Base.send :include, Spurs::Nav::Helper
|
25
23
|
ActionView::Base.send :include, Spurs::Section::Helper
|
data/test/spurs_test.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.6.
|
4
|
+
version: 0.0.6.rc2
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,40 +9,24 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '3.1'
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '3.1'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: actionpack
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
19
|
+
- - ~>
|
36
20
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
21
|
+
version: 3.2.1
|
38
22
|
type: :runtime
|
39
23
|
prerelease: false
|
40
24
|
version_requirements: !ruby/object:Gem::Requirement
|
41
25
|
none: false
|
42
26
|
requirements:
|
43
|
-
- -
|
27
|
+
- - ~>
|
44
28
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
29
|
+
version: 3.2.1
|
46
30
|
- !ruby/object:Gem::Dependency
|
47
31
|
name: twitter-bootstrap-rails
|
48
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,7 +50,7 @@ dependencies:
|
|
66
50
|
requirements:
|
67
51
|
- - ! '>='
|
68
52
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
53
|
+
version: 3.1.4
|
70
54
|
type: :runtime
|
71
55
|
prerelease: false
|
72
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -74,55 +58,7 @@ dependencies:
|
|
74
58
|
requirements:
|
75
59
|
- - ! '>='
|
76
60
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
name: bootstrap-wysihtml5-rails
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
|
-
requirements:
|
83
|
-
- - ~>
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: 0.2.12
|
86
|
-
type: :runtime
|
87
|
-
prerelease: false
|
88
|
-
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- - ~>
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: 0.2.12
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: therubyracer
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
|
-
requirements:
|
99
|
-
- - ! '>='
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: 0.10.1
|
102
|
-
type: :runtime
|
103
|
-
prerelease: false
|
104
|
-
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
|
-
requirements:
|
107
|
-
- - ! '>='
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: 0.10.1
|
110
|
-
- !ruby/object:Gem::Dependency
|
111
|
-
name: rails
|
112
|
-
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
|
-
requirements:
|
115
|
-
- - ~>
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '3.1'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
|
-
requirements:
|
123
|
-
- - ~>
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: '3.1'
|
61
|
+
version: 3.1.4
|
126
62
|
description: Helpers and extensions for the Twitter Bootstrap user interface
|
127
63
|
email:
|
128
64
|
- michael.north@truenorthapps.com
|
@@ -149,8 +85,8 @@ files:
|
|
149
85
|
- app/assets/images/spurs/jquery_ui_theme/images/ui-icons_cd0a0a_256x240.png
|
150
86
|
- app/assets/images/spurs/jquery_ui_theme/images/ui-icons_f6cf3b_256x240.png
|
151
87
|
- app/assets/javascripts/spurs/beyond_bootstrap/all.js
|
88
|
+
- app/assets/javascripts/spurs/beyond_bootstrap/bootstrap-collapsible-section.js
|
152
89
|
- app/assets/javascripts/spurs/beyond_bootstrap/responsive-tables.js
|
153
|
-
- app/assets/javascripts/spurs/beyond_bootstrap/sticky-subnav.js.coffee
|
154
90
|
- app/assets/javascripts/spurs/beyond_bootstrap.js
|
155
91
|
- app/assets/javascripts/spurs/flashes.js.coffee
|
156
92
|
- app/assets/javascripts/spurs/flashes.js.erb
|
@@ -159,7 +95,7 @@ files:
|
|
159
95
|
- app/assets/javascripts/spurs/vars.js.erb
|
160
96
|
- app/assets/javascripts/spurs.js
|
161
97
|
- app/assets/stylesheets/spurs/beyond_bootsrap/all.css
|
162
|
-
- app/assets/stylesheets/spurs/beyond_bootsrap/
|
98
|
+
- app/assets/stylesheets/spurs/beyond_bootsrap/bootstrap-collapsible-section.css.scss
|
163
99
|
- app/assets/stylesheets/spurs/beyond_bootsrap/forms.css.sass
|
164
100
|
- app/assets/stylesheets/spurs/beyond_bootsrap/mobile_modal.css.sass
|
165
101
|
- app/assets/stylesheets/spurs/beyond_bootsrap/responsive-tables.css.sass
|
@@ -196,17 +132,15 @@ files:
|
|
196
132
|
- lib/spurs/popover/builder.rb
|
197
133
|
- lib/spurs/popover/helper.rb
|
198
134
|
- lib/spurs/popover.rb
|
199
|
-
- lib/spurs/section/builder_base.rb
|
200
135
|
- lib/spurs/section/collapsible_section_builder.rb
|
201
136
|
- lib/spurs/section/helper.rb
|
202
|
-
- lib/spurs/section/section_builder.rb
|
203
137
|
- lib/spurs/section.rb
|
204
138
|
- lib/spurs/version.rb
|
205
139
|
- lib/spurs.rb
|
206
140
|
- lib/tasks/spurs_tasks.rake
|
207
141
|
- MIT-LICENSE
|
208
142
|
- Rakefile
|
209
|
-
- README.
|
143
|
+
- README.rdoc
|
210
144
|
- test/dummy/app/assets/javascripts/application.js
|
211
145
|
- test/dummy/app/assets/stylesheets/application.css
|
212
146
|
- test/dummy/app/controllers/application_controller.rb
|
@@ -228,7 +162,6 @@ files:
|
|
228
162
|
- test/dummy/config/locales/en.yml
|
229
163
|
- test/dummy/config/routes.rb
|
230
164
|
- test/dummy/config.ru
|
231
|
-
- test/dummy/log/test.log
|
232
165
|
- test/dummy/public/404.html
|
233
166
|
- test/dummy/public/422.html
|
234
167
|
- test/dummy/public/500.html
|
@@ -255,7 +188,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
255
188
|
version: '0'
|
256
189
|
segments:
|
257
190
|
- 0
|
258
|
-
hash:
|
191
|
+
hash: 3755465715902946807
|
259
192
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
260
193
|
none: false
|
261
194
|
requirements:
|
@@ -290,7 +223,6 @@ test_files:
|
|
290
223
|
- test/dummy/config/locales/en.yml
|
291
224
|
- test/dummy/config/routes.rb
|
292
225
|
- test/dummy/config.ru
|
293
|
-
- test/dummy/log/test.log
|
294
226
|
- test/dummy/public/404.html
|
295
227
|
- test/dummy/public/422.html
|
296
228
|
- test/dummy/public/500.html
|
data/README.markdown
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
# Spurs
|
2
|
-
|
3
|
-
Spurs is a library that adds some bells and whistles to the Twitter Bootstrap GUI framework.
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
There are many independent components of spurs, and some require more set up than others.
|
7
|
-
|
8
|
-
To get started, in your gemfile, add
|
9
|
-
|
10
|
-
```ruby
|
11
|
-
gem 'spurs'
|
12
|
-
```
|
13
|
-
|
14
|
-
and then run
|
15
|
-
|
16
|
-
```ruby
|
17
|
-
bundle install
|
18
|
-
```
|
19
|
-
|
20
|
-
## Flash Messages
|
21
|
-
|
22
|
-
From the rails side, you can create four types of messages: `:notice`, `:warning`, `:info` and `:error`
|
23
|
-
|
24
|
-
```ruby
|
25
|
-
flash_addItem(:notices,"A message about something successfully happening!")
|
26
|
-
```
|
27
|
-
It's especially easy to add model errors as flash messages. Here's a typical use
|
28
|
-
```ruby
|
29
|
-
m = Message.new(:title => "hello", :body => "world!")
|
30
|
-
if !m.save
|
31
|
-
flash_addModelErrors(m)
|
32
|
-
end
|
33
|
-
```
|
34
|
-
|
35
|
-
|
36
|
-
You can also use JavaScript to generate matching messages
|
37
|
-
```javascript
|
38
|
-
spurs.flash.alert("Something has gone wrong!","error");
|
39
|
-
```
|
40
|
-
[More...](https://github.com/TrueNorth/spurs/wiki/Flash-Messages)
|
41
|
-
|
42
|
-
## Navigation
|
43
|
-
|
44
|
-
Spurs makes creation of bootstrap navigation easy!.
|
45
|
-
```haml
|
46
|
-
= spurs_nav :type => :pills do |nav|
|
47
|
-
= nav.tab :user, :icon => :user, :href => "#user"
|
48
|
-
= nav.tab :settings, :icon => :cog, :onclick => "alert('hello');"
|
49
|
-
```
|
50
|
-
[More...](https://github.com/TrueNorth/spurs/wiki/Navigation)
|
51
|
-
|
52
|
-
## Alerts
|
53
|
-
Alerts are styled to match flash messages. Creating an in-place alert is done as follows
|
54
|
-
```haml
|
55
|
-
= spurs_alert_box do
|
56
|
-
This is a basic alert
|
57
|
-
```
|
58
|
-
[More...](https://github.com/TrueNorth/spurs/wiki/Alerts)
|
59
|
-
|
60
|
-
## Asynchronous Modals
|
61
|
-
Spurs can present a modal as a response to an asynchronous request.
|
62
|
-
|
63
|
-
For example, if your request is
|
64
|
-
```javascript
|
65
|
-
$.get({url: '/blogs/MY_BLOG/posts/new.js'});
|
66
|
-
```
|
67
|
-
Your controller response might look like
|
68
|
-
```ruby
|
69
|
-
@blog = Blog.find(params[:blog_id])
|
70
|
-
respond_to do |format|
|
71
|
-
format.js {
|
72
|
-
spawn_modal("Create a new blog post", #Title of the modal
|
73
|
-
"blogs/posts/new", # Path to a partial to render in the modal body.
|
74
|
-
@blog, # Object that the partial is rendering. Can be nil if the previous argument is not a partial
|
75
|
-
:title_icon => '/assets/new_blog_post_icon.png' # Path to an icon shown in the title bar of the modal
|
76
|
-
:modal_options => {} # A hash passed to the partial as local variables
|
77
|
-
)
|
78
|
-
}
|
79
|
-
end
|
80
|
-
```
|
81
|
-
You can also use a method
|
82
|
-
```ruby
|
83
|
-
spawn_form_modal(...) #same arguments as spawn_modal
|
84
|
-
```
|
85
|
-
which will show a modal with an "OK" button in the footer. Pressing this button will submit any form in the .modal-body div.
|
86
|
-
|
87
|
-
|
@@ -1,24 +0,0 @@
|
|
1
|
-
not ($) ->
|
2
|
-
$ ->
|
3
|
-
processScroll = ->
|
4
|
-
i = undefined
|
5
|
-
scrollTop = $win.scrollTop()
|
6
|
-
if scrollTop >= navTop and not isFixed
|
7
|
-
isFixed = 1
|
8
|
-
$nav.addClass "subnav-fixed"
|
9
|
-
else if scrollTop <= navTop and isFixed
|
10
|
-
isFixed = 0
|
11
|
-
$nav.removeClass "subnav-fixed"
|
12
|
-
$win = $(window)
|
13
|
-
$nav = $(".subnav")
|
14
|
-
navTop = $(".subnav").length and $(".subnav").offset().top - 40
|
15
|
-
isFixed = 0
|
16
|
-
processScroll()
|
17
|
-
$nav.on "click", ->
|
18
|
-
unless isFixed
|
19
|
-
setTimeout (->
|
20
|
-
$win.scrollTop $win.scrollTop() - 47
|
21
|
-
), 10
|
22
|
-
|
23
|
-
$win.on "scroll", processScroll
|
24
|
-
(window.jQuery)
|
@@ -1,20 +0,0 @@
|
|
1
|
-
.button-column
|
2
|
-
width: 100%
|
3
|
-
button.btn, a.btn
|
4
|
-
width: 100%
|
5
|
-
border-radius: 0px
|
6
|
-
border-top-width: 0px
|
7
|
-
&:first-child
|
8
|
-
border-top-width: 0px
|
9
|
-
border-top-left-radius: 4px
|
10
|
-
border-top-right-radius: 4px
|
11
|
-
&:last-child
|
12
|
-
border-bottom-left-radius: 4px
|
13
|
-
border-bottom-right-radius: 4px
|
14
|
-
&.btn-large
|
15
|
-
&:first-child
|
16
|
-
border-top-left-radius: 6px
|
17
|
-
border-top-right-radius: 6px
|
18
|
-
&:last-child
|
19
|
-
border-bottom-left-radius: 6px
|
20
|
-
border-bottom-right-radius: 6px
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require "spurs/section/builder_base"
|
2
|
-
class Spurs::Section::SectionBuilder < Spurs::Section::BuilderBase
|
3
|
-
|
4
|
-
def build_section(title,content)
|
5
|
-
r = SecureRandom::hex(5)
|
6
|
-
section_id = "section_#{r}"
|
7
|
-
|
8
|
-
|
9
|
-
header_output = build_header(title)
|
10
|
-
body_output = build_body(content)
|
11
|
-
content_tag(:div,header_output.concat(body_output), :class => "spurs_section #{section_id}")
|
12
|
-
end
|
13
|
-
|
14
|
-
private
|
15
|
-
def build_header(title)
|
16
|
-
content_tag(:div,title, :class => "section_header")
|
17
|
-
end
|
18
|
-
|
19
|
-
def build_body(content)
|
20
|
-
content_tag(:div, content.html_safe, :class => "section_body")
|
21
|
-
end
|
22
|
-
end
|
data/test/dummy/log/test.log
DELETED
File without changes
|