bootstro-rails 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/README.md +37 -0
- data/app/assets/javascripts/bootstro.js +1 -0
- data/app/assets/stylesheets/bootstro.css +1 -0
- data/bootstro-rails-0.0.1.gem +0 -0
- data/bootstro-rails.gemspec +18 -0
- data/lib/bootstro-rails.rb +2 -0
- data/lib/bootstro-rails/engine.rb +6 -0
- data/lib/bootstro-rails/version.rb +5 -0
- metadata +12 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4db493463917e4d52f707acf73f9a2caa603f5d
|
4
|
+
data.tar.gz: d59b7fe01c52bc83da7348a97714961f9c1bd1af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9766ea78094d441554d43689c54b53a3eb3705e646b3fa1362b3231cfd11b26d7bfdd51b8c4da4ece6c0a5f54453c84e7e08d7865886923b705af1098a5c01e1
|
7
|
+
data.tar.gz: f60821bb3b0e21ca608d3597187754fb08cc6d55de9faad3da83c181134a82f27f8a2e6187846824f38718b9f4bbb421dc2f2e9ef8a96a489cf7e28ec5517b0a
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# bootstro-rails
|
2
|
+
**Bootstro.js for rails asset pipeline**
|
3
|
+
|
4
|
+
[Bootstro.js][0] provides a simple overlay instructions for your apps.
|
5
|
+
|
6
|
+
## Usage
|
7
|
+
|
8
|
+
### Install bootstro-rails gem
|
9
|
+
|
10
|
+
Add `bootstro-rails` to your Gemfile and run `bundle install`:
|
11
|
+
|
12
|
+
```Ruby
|
13
|
+
gem 'bootstro-rails'
|
14
|
+
```
|
15
|
+
|
16
|
+
### Include bootstro-rails javascript assets
|
17
|
+
|
18
|
+
Add the following to your `app/assets/javascripts/application.js`:
|
19
|
+
|
20
|
+
//= require bootstro
|
21
|
+
|
22
|
+
### Include bootstro-rails stylesheet assets
|
23
|
+
|
24
|
+
Add to your `app/assets/stylesheets/application.css`:
|
25
|
+
|
26
|
+
*= require bootstro
|
27
|
+
|
28
|
+
## Contributions
|
29
|
+
|
30
|
+
If you want to contribute, please:
|
31
|
+
|
32
|
+
* Fork the project.
|
33
|
+
* Make your feature addition or bug fix.
|
34
|
+
* Send me a pull request on Github.
|
35
|
+
|
36
|
+
Copyright (c) 2014 Ben Koonse
|
37
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
$(document).ready(function(){(function(e,t,n){function f(e){var n=t(window).scrollTop();var r=n+t(window).height();var i=e.offset().top;var s=i+e.height();return s>=n&&i<=r&&s<=r&&i>=n}function l(e,t){var n=get_element(t);var r,s,o;e=e+"<div class='bootstro-nav-wrapper'>";if(n.attr("data-bootstro-nextButton")){r=n.attr("data-bootstro-nextButton")}else if(n.attr("data-bootstro-nextButtonText")){r='<button class="btn btn-primary btn-mini bootstro-next-btn">'+n.attr("data-bootstro-nextButtonText")+"</button>"}else{if(typeof a.nextButton!="undefined")r=a.nextButton;else r='<button class="btn btn-primary btn-mini bootstro-next-btn">'+a.nextButtonText+"</button>"}if(n.attr("data-bootstro-prevButton")){s=n.attr("data-bootstro-prevButton")}else if(n.attr("data-bootstro-prevButtonText")){s='<button class="btn btn-primary btn-mini bootstro-prev-btn">'+n.attr("data-bootstro-prevButtonText")+"</button>"}else{if(typeof a.prevButton!="undefined")s=a.prevButton;else s='<button class="btn btn-primary btn-mini bootstro-prev-btn">'+a.prevButtonText+"</button>"}if(n.attr("data-bootstro-finishButton")){o=n.attr("data-bootstro-finishButton")}else if(n.attr("data-bootstro-finishButtonText")){o='<button class="btn btn-primary btn-mini bootstro-finish-btn">'+n.attr("data-bootstro-finishButtonText")+"</button>"}else{if(typeof a.finishButton!="undefined")o=a.finishButton;else o='<button class="btn btn-primary btn-mini bootstro-finish-btn">'+a.finishButtonText+"</button>"}if(i!=1){if(t==0)e=e+r;else if(t==i-1)e=e+s;else e=e+r+s}e=e+"</div>";e=e+'<div class="bootstro-finish-btn-wrapper">'+o+"</div>";return e}var r;var i;var s=[];var o=null;var u={nextButtonText:"Next »",prevButtonText:"« Prev",finishButtonText:'<i class="icon-ok"></i> Ok I got it, get back to the site',stopOnBackdropClick:true,stopOnEsc:true,margin:100};var a;get_element=function(e){if(r.filter("[data-bootstro-step="+e+"]").size()>0)return r.filter("[data-bootstro-step="+e+"]");else{return r.eq(e)}};get_popup=function(e){var t={};var n=get_element(e);var r="";if(i>1){r="<span class='label label-success'>"+(e+1)+"/"+i+"</span>"}t.title=n.attr("data-bootstro-title")||"";if(t.title!=""&&r!="")t.title=r+" - "+t.title;else if(t.title=="")t.title=r;t.content=n.attr("data-bootstro-content")||"";t.content=l(t.content,e);t.placement=n.attr("data-bootstro-placement")||"top";var s="";if(n.attr("data-bootstro-width")){t.width=n.attr("data-bootstro-width");s=s+"width:"+n.attr("data-bootstro-width")+";"}if(n.attr("data-bootstro-height")){t.height=n.attr("data-bootstro-height");s=s+"height:"+n.attr("data-bootstro-height")+";"}t.trigger="manual";t.html=n.attr("data-bootstro-html")||"top";t.template='<div class="popover" style="'+s+'"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div>'+"</div>";return t};e.destroy_popover=function(e){var e=e||0;if(e!="all"){var t=get_element(e);t.popover("destroy").removeClass("bootstro-highlight")}};e.stop=function(){e.destroy_popover(o);e.unbind();t("div.bootstro-backdrop").remove();if(typeof a.onExit=="function")a.onExit.call(this,{idx:o})};e.go_to=function(n){e.destroy_popover(o);if(i!=0){var r=get_popup(n);var s=get_element(n);s.popover(r).popover("show");var u=t(window).scrollTop();var l=Math.min(t(".popover.in").offset().top,s.offset().top);var c=l-u;if(c<a.margin)t("html,body").animate({scrollTop:l-a.margin},"slow");else if(!f(t(".popover.in"))||!f(s))t("html,body").animate({scrollTop:l-a.margin},"slow");s.addClass("bootstro-highlight");o=n}};e.next=function(){if(o+1==i){if(typeof a.onComplete=="function")a.onComplete.call(this,{idx:o})}else{e.go_to(o+1);if(typeof a.onStep=="function")a.onStep.call(this,{idx:o,direction:"next"})}};e.prev=function(){if(o==0){}else{e.go_to(o-1);if(typeof a.onStep=="function")a.onStep.call(this,{idx:o,direction:"prev"})}};e._start=function(n){n=n||".bootstro";r=t(n);i=r.size();if(i>0&&t("div.bootstro-backdrop").length===0){t('<div class="bootstro-backdrop"></div>').appendTo("body");e.bind();e.go_to(0)}};e.start=function(n,r){a=t.extend(true,{},u);t.extend(a,r||{});if(typeof a.url!="undefined"){t.ajax({url:a.url,success:function(r){if(r.success){var i=r.result;var s=[];t.each(i,function(e,n){t.each(n,function(e,r){t(n.selector).attr("data-bootstro-"+e,r)});if(t(n.selector).is(":visible"))s.push(n.selector)});n=s.join(",");e._start(n)}}})}else{e._start(n)}};e.bind=function(){e.unbind();t("html").on("click.bootstro",".bootstro-next-btn",function(t){e.next();t.preventDefault();return false});t("html").on("click.bootstro",".bootstro-prev-btn",function(t){e.prev();t.preventDefault();return false});t("html").on("click.bootstro",".bootstro-finish-btn",function(t){e.stop()});if(a.stopOnBackdropClick){t("html").on("click.bootstro","div.bootstro-backdrop",function(n){if(t(n.target).hasClass("bootstro-backdrop"))e.stop()})}t(document).on("keydown.bootstro",function(t){var n=t.keyCode?t.keyCode:t.which;if(n==39||n==40)e.next();else if(n==37||n==38)e.prev();else if(n==27&&a.stopOnEsc)e.stop()})};e.unbind=function(){t("html").unbind("click.bootstro");t(document).unbind("keydown.bootstro")}})(window.bootstro=window.bootstro||{},jQuery)})
|
@@ -0,0 +1 @@
|
|
1
|
+
.bootstro-next-btn{float:right}.bootstro-prev-btn{float:left}.bootstro-backdrop{opacity:.5;background-color:#000;bottom:0;left:0;position:fixed;right:0;top:0;z-index:1;filter:alpha(opacity=50)}.bootstro-highlight{z-index:9999;position:relative;border:1px solid white;background-color:white}.bootstro-finish-btn-wrapper{padding-top:10px;text-align:center;clear:both}.bootstro-nav-wrapper{margin-top:10px}.bootstro-nav-wrapper button,.bootstro-finish-btn-wrapper button{font-size:12px!important;padding:3px 5px 3px 5px!important;font-weight:bold}
|
Binary file
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require File.expand_path('../lib/bootstro-rails/version', __FILE__)
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = 'bootstro-rails'
|
5
|
+
s.version = Bootstro::Rails::VERSION
|
6
|
+
s.authors = ['Ben Koonse']
|
7
|
+
s.email = ['bkoonse@gmail.com']
|
8
|
+
s.homepage = 'https://github.com/bennyfreshness/bootstro-rails'
|
9
|
+
s.summary = %q{Integrate the excellent Boostro.js javascript library with Rails asset pipeline}
|
10
|
+
s.description = %q{Simple overlay instructions for your apps.}
|
11
|
+
|
12
|
+
s.files = `git ls-files`.split("\n")
|
13
|
+
s.require_paths = ['lib']
|
14
|
+
|
15
|
+
s.add_runtime_dependency 'sass-rails', '>= 3.2'
|
16
|
+
s.add_development_dependency 'bundler', '~> 1.0'
|
17
|
+
s.add_development_dependency 'rails', '~> 3.0'
|
18
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstro-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Koonse
|
@@ -58,7 +58,16 @@ email:
|
|
58
58
|
executables: []
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
|
-
files:
|
61
|
+
files:
|
62
|
+
- Gemfile
|
63
|
+
- README.md
|
64
|
+
- app/assets/javascripts/bootstro.js
|
65
|
+
- app/assets/stylesheets/bootstro.css
|
66
|
+
- bootstro-rails-0.0.1.gem
|
67
|
+
- bootstro-rails.gemspec
|
68
|
+
- lib/bootstro-rails.rb
|
69
|
+
- lib/bootstro-rails/engine.rb
|
70
|
+
- lib/bootstro-rails/version.rb
|
62
71
|
homepage: https://github.com/bennyfreshness/bootstro-rails
|
63
72
|
licenses: []
|
64
73
|
metadata: {}
|
@@ -78,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
87
|
version: '0'
|
79
88
|
requirements: []
|
80
89
|
rubyforge_project:
|
81
|
-
rubygems_version: 2.
|
90
|
+
rubygems_version: 2.0.14
|
82
91
|
signing_key:
|
83
92
|
specification_version: 4
|
84
93
|
summary: Integrate the excellent Boostro.js javascript library with Rails asset pipeline
|