cmstyle 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/app/assets/images/novartis-micro.png +0 -0
- data/lib/app/assets/images/novartis-small.png +0 -0
- data/lib/app/assets/javascripts/application.js +16 -0
- data/lib/app/assets/stylesheets/application.css +96 -0
- data/lib/app/views/{cmstyle → layouts}/_footer.slim +0 -0
- data/lib/app/views/layouts/_header.slim +34 -0
- data/lib/app/views/layouts/_modals.slim +66 -0
- data/lib/app/views/layouts/application.slim +35 -0
- data/lib/assets/images/8020select.png +0 -0
- data/lib/assets/images/adoptahydrant.png +0 -0
- data/lib/assets/images/apple-touch-icon-114-precomposed.png +0 -0
- data/lib/assets/images/apple-touch-icon-144-precomposed.png +0 -0
- data/lib/assets/images/apple-touch-icon-57-precomposed.png +0 -0
- data/lib/assets/images/apple-touch-icon-72-precomposed.png +0 -0
- data/lib/assets/images/bootstrap-example-carousel.png +0 -0
- data/lib/assets/images/bootstrap-example-fluid.jpg +0 -0
- data/lib/assets/images/bootstrap-example-hero.jpg +0 -0
- data/lib/assets/images/bootstrap-example-marketing-narrow.png +0 -0
- data/lib/assets/images/bootstrap-example-signin.png +0 -0
- data/lib/assets/images/bootstrap-example-starter.jpg +0 -0
- data/lib/assets/images/bootstrap-example-sticky-footer.png +0 -0
- data/lib/assets/images/bootstrap-mdo-sfmoma-01.jpg +0 -0
- data/lib/assets/images/bootstrap-mdo-sfmoma-02.jpg +0 -0
- data/lib/assets/images/bootstrap-mdo-sfmoma-03.jpg +0 -0
- data/lib/assets/images/breakingnews.png +0 -0
- data/lib/assets/images/browser-icon-chrome.png +0 -0
- data/lib/assets/images/browser-icon-firefox.png +0 -0
- data/lib/assets/images/browser-icon-safari.png +0 -0
- data/lib/assets/images/bs-docs-bootstrap-features.png +0 -0
- data/lib/assets/images/bs-docs-masthead-pattern.png +0 -0
- data/lib/assets/images/bs-docs-responsive-illustrations.png +0 -0
- data/lib/assets/images/bs-docs-twitter-github.png +0 -0
- data/lib/assets/images/fleetio.png +0 -0
- data/lib/assets/images/gathercontent.png +0 -0
- data/lib/assets/images/glyphicons-halflings-white.png +0 -0
- data/lib/assets/images/glyphicons-halflings.png +0 -0
- data/lib/assets/images/grid-baseline-20px.png +0 -0
- data/lib/assets/images/jshint.png +0 -0
- data/lib/assets/images/kippt.png +0 -0
- data/lib/assets/images/less-logo-large.png +0 -0
- data/lib/assets/images/logo.png +0 -0
- data/lib/assets/images/noise.png +0 -0
- data/lib/assets/images/responsive-illustrations.png +0 -0
- data/lib/assets/images/slide-01.jpg +0 -0
- data/lib/assets/images/slide-02.jpg +0 -0
- data/lib/assets/images/slide-03.jpg +0 -0
- data/lib/assets/images/small-hogan-icon.png +0 -0
- data/lib/assets/images/soundready.png +0 -0
- data/lib/assets/images/stripes.png +0 -0
- data/lib/assets/javascripts/application.js +154 -0
- data/lib/assets/javascripts/bootstrap-affix.js +19 -0
- data/lib/assets/javascripts/bootstrap-alert.js +56 -0
- data/lib/assets/javascripts/bootstrap-button.js +96 -0
- data/lib/assets/javascripts/bootstrap-carousel.js +63 -0
- data/lib/assets/javascripts/bootstrap-collapse.js +88 -0
- data/lib/assets/javascripts/bootstrap-dropdown.js +145 -0
- data/lib/assets/javascripts/bootstrap-modal.js +114 -0
- data/lib/assets/javascripts/bootstrap-phantom.js +21 -0
- data/lib/assets/javascripts/bootstrap-popover.js +107 -0
- data/lib/assets/javascripts/bootstrap-scrollspy.js +31 -0
- data/lib/assets/javascripts/bootstrap-tab.js +80 -0
- data/lib/assets/javascripts/bootstrap-tooltip.js +153 -0
- data/lib/assets/javascripts/bootstrap-transition.js +13 -0
- data/lib/assets/javascripts/bootstrap-typeahead.js +199 -0
- data/lib/assets/javascripts/compiler.js +348 -0
- data/lib/assets/javascripts/hogan-1.0.5.amd.js +576 -0
- data/lib/assets/javascripts/hogan-1.0.5.common.js +576 -0
- data/lib/assets/javascripts/hogan-1.0.5.js +572 -0
- data/lib/assets/javascripts/hogan-1.0.5.mustache.js +619 -0
- data/lib/assets/javascripts/hogan.js +545 -0
- data/lib/assets/javascripts/index.js +848 -0
- data/lib/assets/javascripts/jquery.js +2 -0
- data/lib/assets/javascripts/mustache.js +90 -0
- data/lib/assets/javascripts/phantom.js +63 -0
- data/lib/assets/javascripts/prettify.js +0 -0
- data/lib/assets/javascripts/qunit.js +1510 -0
- data/lib/assets/javascripts/release.js +74 -0
- data/lib/assets/javascripts/server.js +14 -0
- data/lib/assets/javascripts/spec.js +77 -0
- data/lib/assets/javascripts/template-1.0.5.js +233 -0
- data/lib/assets/javascripts/template.js +233 -0
- data/lib/assets/javascripts/web_templates.js +32 -0
- data/lib/assets/stylesheets/bootstrap.css +2 -2
- data/lib/assets/stylesheets/css-tests.css +139 -0
- data/lib/assets/stylesheets/docs.css +1015 -0
- data/lib/assets/stylesheets/layout.css +206 -0
- data/lib/assets/stylesheets/prettify.css +0 -0
- data/lib/assets/stylesheets/qunit.css +232 -0
- data/lib/assets/stylesheets/skeleton.css +236 -0
- data/lib/cmstyle/railtie.rb +7 -0
- data/lib/cmstyle/version.rb +1 -1
- data/lib/cmstyle.rb +2 -1
- data/lib/tasks/cleanup.rake +52 -0
- data/lib/tasks/setup.rake +32 -0
- metadata +90 -6
- data/lib/app/views/cmstyle/_header.slim +0 -40
- data/lib/app/views/cmstyle/_modals.slim +0 -62
Binary file
|
Binary file
|
@@ -0,0 +1,16 @@
|
|
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 jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//= require bootstrap
|
16
|
+
//= require_tree .
|
@@ -0,0 +1,96 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
|
+
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
+
*
|
11
|
+
*= require_self
|
12
|
+
*= require application
|
13
|
+
*= require bootstrap
|
14
|
+
*= require bootstrap-responsive
|
15
|
+
*= require_tree .
|
16
|
+
*/
|
17
|
+
|
18
|
+
/* bootstrap override */
|
19
|
+
.modal-backdrop, .modal-backdrop.fade.in {
|
20
|
+
filter: alpha(opacity=50);
|
21
|
+
opacity:0.5;
|
22
|
+
-moz-opacity: 0.50;
|
23
|
+
}
|
24
|
+
|
25
|
+
/* custom CSS Classes */
|
26
|
+
|
27
|
+
.module {
|
28
|
+
/*background: url("/assets/dummy_module.jpg") no-repeat;*/
|
29
|
+
color: #111;
|
30
|
+
width:250px;
|
31
|
+
height:250px;
|
32
|
+
min-width:250px;
|
33
|
+
max-width:250px;
|
34
|
+
min-height:250px;
|
35
|
+
max-height:250px;
|
36
|
+
margin: 15px;
|
37
|
+
border-radius:5px;
|
38
|
+
-moz-border-radius: 5px;
|
39
|
+
-webkit-border-radius: 5px;
|
40
|
+
-moz-box-shadow: 0 1px 1px #999;
|
41
|
+
-webkit-box-shadow: 0 1px 1px #999;
|
42
|
+
box-shadow: 0 1px 1px #999;
|
43
|
+
border: 1px solid #999;
|
44
|
+
display: inline-block;
|
45
|
+
}
|
46
|
+
|
47
|
+
.portal-content {
|
48
|
+
width: 100%;
|
49
|
+
text-align: center;
|
50
|
+
}
|
51
|
+
|
52
|
+
.one-module {
|
53
|
+
margin: 0px auto;
|
54
|
+
margin-left:35px;
|
55
|
+
display: inline-block;
|
56
|
+
width:250px;
|
57
|
+
}
|
58
|
+
.module-title {
|
59
|
+
background-color: #999;
|
60
|
+
opacity:0.5;
|
61
|
+
-moz-opacity: 0.50;
|
62
|
+
color: #111;
|
63
|
+
|
64
|
+
}
|
65
|
+
.module-body {
|
66
|
+
min-height:200px;
|
67
|
+
max-height:200px;
|
68
|
+
height: 200px;
|
69
|
+
}
|
70
|
+
|
71
|
+
.content {
|
72
|
+
background-color: #fff;
|
73
|
+
color: #111;
|
74
|
+
padding:8px;
|
75
|
+
margin-top:50px;
|
76
|
+
margin-bottom:20px;
|
77
|
+
margin-left: 8px;
|
78
|
+
margin-right: 8px;
|
79
|
+
border-radius:5px;
|
80
|
+
-moz-border-radius: 5px;
|
81
|
+
-webkit-border-radius: 5px;
|
82
|
+
-moz-box-shadow: 0 1px 1px #999;
|
83
|
+
-webkit-box-shadow: 0 1px 1px #999;
|
84
|
+
box-shadow: 0 1px 1px #999;
|
85
|
+
border: 0.1em solid #ccc;
|
86
|
+
}
|
87
|
+
|
88
|
+
|
89
|
+
.footer {
|
90
|
+
background-color: #fff;
|
91
|
+
color: #888;
|
92
|
+
margin:8px;
|
93
|
+
padding: 5px;
|
94
|
+
padding-bottom: 0px;
|
95
|
+
border-top: 0.1em solid #ccc;
|
96
|
+
}
|
File without changes
|
@@ -0,0 +1,34 @@
|
|
1
|
+
div class="navbar navbar-fixed-top"
|
2
|
+
div class="navbar-inner"
|
3
|
+
div class="container-fluid"
|
4
|
+
a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"
|
5
|
+
span class="icon-bar"
|
6
|
+
span class="icon-bar"
|
7
|
+
span class="icon-bar"
|
8
|
+
a id="brand" class="brand" href="/#"
|
9
|
+
img src="#{asset_path 'novartis-micro.png'}" height="25px"style="margin-top:-4px;" #{APPLICATION_NAME}
|
10
|
+
div class="nav-collapse"
|
11
|
+
ul class="nav pull-right"
|
12
|
+
= form_tag("/search", :method => "get", :class => 'navbar-search pull-left') do
|
13
|
+
div class="input-append"
|
14
|
+
= text_field_tag 'search-query', '', :class => "span2", :placeholder => 'Search...'
|
15
|
+
button type="submit" class="btn"
|
16
|
+
i class="icon-search icon-black"
|
17
|
+
|
18
|
+
- APPLICATION_NAVIGATION.each do |menu|
|
19
|
+
li id="fat-menu" class="dropdown"
|
20
|
+
a href="#{menu[:href]}" class="#{menu[:class]}" data-toggle="#{menu[:data][:toggle]}"
|
21
|
+
i class="#{menu[:icon]}"
|
22
|
+
| #{menu[:title]}
|
23
|
+
b class="caret"
|
24
|
+
ul class="dropdown-menu"
|
25
|
+
- menu[:sub].each do |submenu|
|
26
|
+
li
|
27
|
+
- if submenu[:data][:toggle] == 'modal'
|
28
|
+
a href="#{submenu[:href]}" data-toggle="#{submenu[:data][:toggle]}"
|
29
|
+
i class="#{submenu[:icon]}"
|
30
|
+
| #{submenu[:title]}
|
31
|
+
- else
|
32
|
+
a href="#{submenu[:href]}"
|
33
|
+
i class="#{submenu[:icon]}"
|
34
|
+
| #{submenu[:title]}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
div class="modal hide fade" id="Contact"
|
2
|
+
div class="modal-header"
|
3
|
+
<button class="close" data-dismiss="modal">×</button>
|
4
|
+
h3
|
5
|
+
== "Contact"
|
6
|
+
div style="" id="notice"
|
7
|
+
|
8
|
+
div class="modal-body"
|
9
|
+
- if @message.nil?
|
10
|
+
p
|
11
|
+
| "Please add a message model first to use the contact form and add @message= Message.new to application.slim"
|
12
|
+
- else
|
13
|
+
= form_for @message, :remote => true, :url => contact_path, :html => { :class => 'form-horizontal', :id => 'contactform' } do |form|
|
14
|
+
- if @message.errors.any?
|
15
|
+
div id="errorExplanation"
|
16
|
+
h2 #{pluralize(@message.errors.count, "error")} prohibited this post from being saved:
|
17
|
+
ul
|
18
|
+
= @message.errors.full_messages.each do |msg|
|
19
|
+
li
|
20
|
+
= msg
|
21
|
+
fieldset
|
22
|
+
div class="control-group"
|
23
|
+
= form.label :name, :class => 'control-label', :for => :name
|
24
|
+
div class="controls"
|
25
|
+
= form.text_field :name, :class => 'required input-xlarge', :minlength => 2
|
26
|
+
div class="control-group"
|
27
|
+
= form.label :email, :class => 'control-label', :for => :email
|
28
|
+
div class="controls"
|
29
|
+
= form.email_field :email, :class => 'required email input-xlarge'
|
30
|
+
div class="control-group"
|
31
|
+
= form.label 'Subject', :class => 'control-label', :for => :subject
|
32
|
+
div class="controls"
|
33
|
+
= form.text_field :subject, :class => 'required input-xlarge', :minlength => 2
|
34
|
+
div class="control-group"
|
35
|
+
= form.label 'Message', :class => 'control-label', :for => :body
|
36
|
+
div class="controls"
|
37
|
+
= form.text_area :body, :class => 'required input-xlarge', :size => '10x5', :minlength => 10
|
38
|
+
|
39
|
+
div class="modal-footer"
|
40
|
+
<a href="#home" class="btn" data-dismiss="modal">Close</a>
|
41
|
+
|
42
|
+
|
43
|
+
div class="modal hide fade" id="Revision"
|
44
|
+
div class="modal-header"
|
45
|
+
<button class="close" data-dismiss="modal">×</button>
|
46
|
+
h3
|
47
|
+
== "Changelog"
|
48
|
+
div class="modal-body"
|
49
|
+
|
50
|
+
div class="modal-footer"
|
51
|
+
<a href="#home" class="btn" data-dismiss="modal">Close</a>
|
52
|
+
|
53
|
+
|
54
|
+
div id="About" class="modal hide fade" tabindex="-1" role="dialog"
|
55
|
+
div class="modal-header"
|
56
|
+
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
57
|
+
h3 id="myModalLabel"
|
58
|
+
== "Compound Management"
|
59
|
+
div class="modal-body"
|
60
|
+
p
|
61
|
+
== "Compound Management Web Applications & Tools"
|
62
|
+
br
|
63
|
+
p
|
64
|
+
== "Developed by Thomas Steiner & Patrick Kaddu"
|
65
|
+
div class="modal-footer"
|
66
|
+
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
doctype html
|
2
|
+
html lang="en"
|
3
|
+
head
|
4
|
+
meta charset="utf-8"
|
5
|
+
title #{APPLICATION_NAME}
|
6
|
+
meta name="viewport" content="width=device-width initial-scale=1.0"
|
7
|
+
meta name="description" content="Compound Management Web Application"
|
8
|
+
meta name="author" content="Compound Management"
|
9
|
+
|
10
|
+
= stylesheet_link_tag "application", :media => "all"
|
11
|
+
|
12
|
+
/!-- HTML5 shim, for IE6-8 support of HTML5 elements
|
13
|
+
/[if lt IE 9]
|
14
|
+
= javascript_include_tag "html5.js"
|
15
|
+
|
16
|
+
= csrf_meta_tags
|
17
|
+
body
|
18
|
+
= render :partial => 'layouts/header'
|
19
|
+
|
20
|
+
div class="container-fluid"
|
21
|
+
div class="row-fluid"
|
22
|
+
div class="span12"
|
23
|
+
/! main content
|
24
|
+
== yield
|
25
|
+
br
|
26
|
+
|
27
|
+
= render :partial => 'layouts/footer'
|
28
|
+
|
29
|
+
= render :partial => 'layouts/modals'
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
/! For fast page loads
|
35
|
+
= javascript_include_tag "application"
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
File without changes
|
File without changes
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,154 @@
|
|
1
|
+
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
|
2
|
+
// IT'S ALL JUST JUNK FOR OUR DOCS!
|
3
|
+
// ++++++++++++++++++++++++++++++++++++++++++
|
4
|
+
|
5
|
+
!function ($) {
|
6
|
+
|
7
|
+
$(function(){
|
8
|
+
|
9
|
+
var $window = $(window)
|
10
|
+
|
11
|
+
// Disable certain links in docs
|
12
|
+
$('section [href^=#]').click(function (e) {
|
13
|
+
e.preventDefault()
|
14
|
+
})
|
15
|
+
|
16
|
+
// side bar
|
17
|
+
$('.bs-docs-sidenav').affix({
|
18
|
+
offset: {
|
19
|
+
top: function () { return $window.width() <= 980 ? 290 : 210 }
|
20
|
+
, bottom: 270
|
21
|
+
}
|
22
|
+
})
|
23
|
+
|
24
|
+
// make code pretty
|
25
|
+
window.prettyPrint && prettyPrint()
|
26
|
+
|
27
|
+
// add-ons
|
28
|
+
$('.add-on :checkbox').on('click', function () {
|
29
|
+
var $this = $(this)
|
30
|
+
, method = $this.attr('checked') ? 'addClass' : 'removeClass'
|
31
|
+
$(this).parents('.add-on')[method]('active')
|
32
|
+
})
|
33
|
+
|
34
|
+
// add tipsies to grid for scaffolding
|
35
|
+
if ($('#gridSystem').length) {
|
36
|
+
$('#gridSystem').tooltip({
|
37
|
+
selector: '.show-grid > div'
|
38
|
+
, title: function () { return $(this).width() + 'px' }
|
39
|
+
})
|
40
|
+
}
|
41
|
+
|
42
|
+
// tooltip demo
|
43
|
+
$('.tooltip-demo').tooltip({
|
44
|
+
selector: "a[rel=tooltip]"
|
45
|
+
})
|
46
|
+
|
47
|
+
$('.tooltip-test').tooltip()
|
48
|
+
$('.popover-test').popover()
|
49
|
+
|
50
|
+
// popover demo
|
51
|
+
$("a[rel=popover]")
|
52
|
+
.popover()
|
53
|
+
.click(function(e) {
|
54
|
+
e.preventDefault()
|
55
|
+
})
|
56
|
+
|
57
|
+
// button state demo
|
58
|
+
$('#fat-btn')
|
59
|
+
.click(function () {
|
60
|
+
var btn = $(this)
|
61
|
+
btn.button('loading')
|
62
|
+
setTimeout(function () {
|
63
|
+
btn.button('reset')
|
64
|
+
}, 3000)
|
65
|
+
})
|
66
|
+
|
67
|
+
// carousel demo
|
68
|
+
$('#myCarousel').carousel()
|
69
|
+
|
70
|
+
// javascript build logic
|
71
|
+
var inputsComponent = $("#components.download input")
|
72
|
+
, inputsPlugin = $("#plugins.download input")
|
73
|
+
, inputsVariables = $("#variables.download input")
|
74
|
+
|
75
|
+
// toggle all plugin checkboxes
|
76
|
+
$('#components.download .toggle-all').on('click', function (e) {
|
77
|
+
e.preventDefault()
|
78
|
+
inputsComponent.attr('checked', !inputsComponent.is(':checked'))
|
79
|
+
})
|
80
|
+
|
81
|
+
$('#plugins.download .toggle-all').on('click', function (e) {
|
82
|
+
e.preventDefault()
|
83
|
+
inputsPlugin.attr('checked', !inputsPlugin.is(':checked'))
|
84
|
+
})
|
85
|
+
|
86
|
+
$('#variables.download .toggle-all').on('click', function (e) {
|
87
|
+
e.preventDefault()
|
88
|
+
inputsVariables.val('')
|
89
|
+
})
|
90
|
+
|
91
|
+
// request built javascript
|
92
|
+
$('.download-btn').on('click', function () {
|
93
|
+
|
94
|
+
var css = $("#components.download input:checked")
|
95
|
+
.map(function () { return this.value })
|
96
|
+
.toArray()
|
97
|
+
, js = $("#plugins.download input:checked")
|
98
|
+
.map(function () { return this.value })
|
99
|
+
.toArray()
|
100
|
+
, vars = {}
|
101
|
+
, img = ['glyphicons-halflings.png', 'glyphicons-halflings-white.png']
|
102
|
+
|
103
|
+
$("#variables.download input")
|
104
|
+
.each(function () {
|
105
|
+
$(this).val() && (vars[ $(this).prev().text() ] = $(this).val())
|
106
|
+
})
|
107
|
+
|
108
|
+
$.ajax({
|
109
|
+
type: 'POST'
|
110
|
+
, url: /\?dev/.test(window.location) ? 'http://localhost:3000' : 'http://bootstrap.herokuapp.com'
|
111
|
+
, dataType: 'jsonpi'
|
112
|
+
, params: {
|
113
|
+
js: js
|
114
|
+
, css: css
|
115
|
+
, vars: vars
|
116
|
+
, img: img
|
117
|
+
}
|
118
|
+
})
|
119
|
+
})
|
120
|
+
})
|
121
|
+
|
122
|
+
// Modified from the original jsonpi https://github.com/benvinegar/jquery-jsonpi
|
123
|
+
$.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) {
|
124
|
+
var url = opts.url;
|
125
|
+
|
126
|
+
return {
|
127
|
+
send: function(_, completeCallback) {
|
128
|
+
var name = 'jQuery_iframe_' + jQuery.now()
|
129
|
+
, iframe, form
|
130
|
+
|
131
|
+
iframe = $('<iframe>')
|
132
|
+
.attr('name', name)
|
133
|
+
.appendTo('head')
|
134
|
+
|
135
|
+
form = $('<form>')
|
136
|
+
.attr('method', opts.type) // GET or POST
|
137
|
+
.attr('action', url)
|
138
|
+
.attr('target', name)
|
139
|
+
|
140
|
+
$.each(opts.params, function(k, v) {
|
141
|
+
|
142
|
+
$('<input>')
|
143
|
+
.attr('type', 'hidden')
|
144
|
+
.attr('name', k)
|
145
|
+
.attr('value', typeof v == 'string' ? v : JSON.stringify(v))
|
146
|
+
.appendTo(form)
|
147
|
+
})
|
148
|
+
|
149
|
+
form.appendTo('body').submit()
|
150
|
+
}
|
151
|
+
}
|
152
|
+
})
|
153
|
+
|
154
|
+
}(window.jQuery)
|
@@ -0,0 +1,19 @@
|
|
1
|
+
$(function () {
|
2
|
+
|
3
|
+
module("bootstrap-affix")
|
4
|
+
|
5
|
+
test("should be defined on jquery object", function () {
|
6
|
+
ok($(document.body).affix, 'affix method is defined')
|
7
|
+
})
|
8
|
+
|
9
|
+
test("should return element", function () {
|
10
|
+
ok($(document.body).affix()[0] == document.body, 'document.body returned')
|
11
|
+
})
|
12
|
+
|
13
|
+
test("should exit early if element is not visible", function () {
|
14
|
+
var $affix = $('<div style="display: none"></div>').affix()
|
15
|
+
$affix.data('affix').checkPosition()
|
16
|
+
ok(!$affix.hasClass('affix'), 'affix class was not added')
|
17
|
+
})
|
18
|
+
|
19
|
+
})
|
@@ -0,0 +1,56 @@
|
|
1
|
+
$(function () {
|
2
|
+
|
3
|
+
module("bootstrap-alerts")
|
4
|
+
|
5
|
+
test("should be defined on jquery object", function () {
|
6
|
+
ok($(document.body).alert, 'alert method is defined')
|
7
|
+
})
|
8
|
+
|
9
|
+
test("should return element", function () {
|
10
|
+
ok($(document.body).alert()[0] == document.body, 'document.body returned')
|
11
|
+
})
|
12
|
+
|
13
|
+
test("should fade element out on clicking .close", function () {
|
14
|
+
var alertHTML = '<div class="alert-message warning fade in">'
|
15
|
+
+ '<a class="close" href="#" data-dismiss="alert">×</a>'
|
16
|
+
+ '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>'
|
17
|
+
+ '</div>'
|
18
|
+
, alert = $(alertHTML).alert()
|
19
|
+
|
20
|
+
alert.find('.close').click()
|
21
|
+
|
22
|
+
ok(!alert.hasClass('in'), 'remove .in class on .close click')
|
23
|
+
})
|
24
|
+
|
25
|
+
test("should remove element when clicking .close", function () {
|
26
|
+
$.support.transition = false
|
27
|
+
|
28
|
+
var alertHTML = '<div class="alert-message warning fade in">'
|
29
|
+
+ '<a class="close" href="#" data-dismiss="alert">×</a>'
|
30
|
+
+ '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>'
|
31
|
+
+ '</div>'
|
32
|
+
, alert = $(alertHTML).appendTo('#qunit-fixture').alert()
|
33
|
+
|
34
|
+
ok($('#qunit-fixture').find('.alert-message').length, 'element added to dom')
|
35
|
+
|
36
|
+
alert.find('.close').click()
|
37
|
+
|
38
|
+
ok(!$('#qunit-fixture').find('.alert-message').length, 'element removed from dom')
|
39
|
+
})
|
40
|
+
|
41
|
+
test("should not fire closed when close is prevented", function () {
|
42
|
+
$.support.transition = false
|
43
|
+
stop();
|
44
|
+
$('<div class="alert"/>')
|
45
|
+
.bind('close', function (e) {
|
46
|
+
e.preventDefault();
|
47
|
+
ok(true);
|
48
|
+
start();
|
49
|
+
})
|
50
|
+
.bind('closed', function () {
|
51
|
+
ok(false);
|
52
|
+
})
|
53
|
+
.alert('close')
|
54
|
+
})
|
55
|
+
|
56
|
+
})
|