iasd-bootstrap-sass 1.3.0 → 1.3.1
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.
- checksums.yaml +4 -4
- data/lib/iasd-bootstrap-sass/version.rb +1 -1
- data/templates/project/lib/classie.js +80 -0
- data/templates/project/lib/iasd-bootstrap.js +1 -1
- data/templates/project/lib/iasd-bootstrap.min.js +1 -1
- data/templates/project/lib/ltie9.js +1 -1
- data/templates/project/lib/selectFx.js +355 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1369afb7cbf104d2828c958641e12ae274a9a7d
|
4
|
+
data.tar.gz: 9b0c09508567e2423ac3a78da368ab2886fb63dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 705e0e4df83292cf1affb139cb304ed8237b028a962cb1d00a61413dc1396b64d347aed4f96b639c33f5fc76fc380298240ca5828c3b39d32623b2060b65881a
|
7
|
+
data.tar.gz: 1719b916c3eb9bd5693a18b583d6ef790fc4c03549f0556590ccecf13e40dc0826ca1bc5f5ca016c4fb8aed78e8e8ffc931a74c3bea3166236735a5196044635
|
@@ -0,0 +1,80 @@
|
|
1
|
+
/*!
|
2
|
+
* classie - class helper functions
|
3
|
+
* from bonzo https://github.com/ded/bonzo
|
4
|
+
*
|
5
|
+
* classie.has( elem, 'my-class' ) -> true/false
|
6
|
+
* classie.add( elem, 'my-new-class' )
|
7
|
+
* classie.remove( elem, 'my-unwanted-class' )
|
8
|
+
* classie.toggle( elem, 'my-class' )
|
9
|
+
*/
|
10
|
+
|
11
|
+
/*jshint browser: true, strict: true, undef: true */
|
12
|
+
/*global define: false */
|
13
|
+
|
14
|
+
( function( window ) {
|
15
|
+
|
16
|
+
'use strict';
|
17
|
+
|
18
|
+
// class helper functions from bonzo https://github.com/ded/bonzo
|
19
|
+
|
20
|
+
function classReg( className ) {
|
21
|
+
return new RegExp("(^|\\s+)" + className + "(\\s+|$)");
|
22
|
+
}
|
23
|
+
|
24
|
+
// classList support for class management
|
25
|
+
// altho to be fair, the api sucks because it won't accept multiple classes at once
|
26
|
+
var hasClass, addClass, removeClass;
|
27
|
+
|
28
|
+
if ( 'classList' in document.documentElement ) {
|
29
|
+
hasClass = function( elem, c ) {
|
30
|
+
return elem.classList.contains( c );
|
31
|
+
};
|
32
|
+
addClass = function( elem, c ) {
|
33
|
+
elem.classList.add( c );
|
34
|
+
};
|
35
|
+
removeClass = function( elem, c ) {
|
36
|
+
elem.classList.remove( c );
|
37
|
+
};
|
38
|
+
}
|
39
|
+
else {
|
40
|
+
hasClass = function( elem, c ) {
|
41
|
+
return classReg( c ).test( elem.className );
|
42
|
+
};
|
43
|
+
addClass = function( elem, c ) {
|
44
|
+
if ( !hasClass( elem, c ) ) {
|
45
|
+
elem.className = elem.className + ' ' + c;
|
46
|
+
}
|
47
|
+
};
|
48
|
+
removeClass = function( elem, c ) {
|
49
|
+
elem.className = elem.className.replace( classReg( c ), ' ' );
|
50
|
+
};
|
51
|
+
}
|
52
|
+
|
53
|
+
function toggleClass( elem, c ) {
|
54
|
+
var fn = hasClass( elem, c ) ? removeClass : addClass;
|
55
|
+
fn( elem, c );
|
56
|
+
}
|
57
|
+
|
58
|
+
var classie = {
|
59
|
+
// full names
|
60
|
+
hasClass: hasClass,
|
61
|
+
addClass: addClass,
|
62
|
+
removeClass: removeClass,
|
63
|
+
toggleClass: toggleClass,
|
64
|
+
// short names
|
65
|
+
has: hasClass,
|
66
|
+
add: addClass,
|
67
|
+
remove: removeClass,
|
68
|
+
toggle: toggleClass
|
69
|
+
};
|
70
|
+
|
71
|
+
// transport
|
72
|
+
if ( typeof define === 'function' && define.amd ) {
|
73
|
+
// AMD
|
74
|
+
define( classie );
|
75
|
+
} else {
|
76
|
+
// browser global
|
77
|
+
window.classie = classie;
|
78
|
+
}
|
79
|
+
|
80
|
+
})( window );
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* IASD Bootstrap v1.3.
|
2
|
+
* IASD Bootstrap v1.3.1 (http://styleguide.adventistas.org)
|
3
3
|
* Copyright 2014-2015 Igreja Adventista do Sétimo Dia
|
4
4
|
* Licensed under MIT (https://github.com/igrejaadventista/styleguide/blob/master/LICENSE)
|
5
5
|
*/
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* IASD Bootstrap v1.3.
|
2
|
+
* IASD Bootstrap v1.3.1 (http://styleguide.adventistas.org)
|
3
3
|
* Copyright 2014-2015 Igreja Adventista do Sétimo Dia
|
4
4
|
* Licensed under MIT (https://github.com/igrejaadventista/styleguide/blob/master/LICENSE)
|
5
5
|
*/
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* IASD Bootstrap v1.3.
|
2
|
+
* IASD Bootstrap v1.3.1 (http://styleguide.adventistas.org)
|
3
3
|
* Copyright 2014-2015 Igreja Adventista do Sétimo Dia
|
4
4
|
* Licensed under MIT (https://github.com/igrejaadventista/styleguide/blob/master/LICENSE)
|
5
5
|
*/
|
@@ -0,0 +1,355 @@
|
|
1
|
+
/**
|
2
|
+
* selectFx.js v1.0.0
|
3
|
+
* http://www.codrops.com
|
4
|
+
*
|
5
|
+
* Licensed under the MIT license.
|
6
|
+
* http://www.opensource.org/licenses/mit-license.php
|
7
|
+
*
|
8
|
+
* Copyright 2014, Codrops
|
9
|
+
* http://www.codrops.com
|
10
|
+
*/
|
11
|
+
;( function( window ) {
|
12
|
+
|
13
|
+
'use strict';
|
14
|
+
var first = false;
|
15
|
+
/**
|
16
|
+
* based on from https://github.com/inuyaksa/jquery.nicescroll/blob/master/jquery.nicescroll.js
|
17
|
+
*/
|
18
|
+
function hasParent( e, p ) {
|
19
|
+
if (!e) return false;
|
20
|
+
var el = e.target||e.srcElement||e||false;
|
21
|
+
while (el && el != p) {
|
22
|
+
el = el.parentNode||false;
|
23
|
+
}
|
24
|
+
return (el!==false);
|
25
|
+
};
|
26
|
+
|
27
|
+
/**
|
28
|
+
* extend obj function
|
29
|
+
*/
|
30
|
+
function extend( a, b ) {
|
31
|
+
for( var key in b ) {
|
32
|
+
if( b.hasOwnProperty( key ) ) {
|
33
|
+
a[key] = b[key];
|
34
|
+
}
|
35
|
+
}
|
36
|
+
return a;
|
37
|
+
}
|
38
|
+
|
39
|
+
/**
|
40
|
+
* SelectFx function
|
41
|
+
*/
|
42
|
+
function SelectFx( el, options ) {
|
43
|
+
this.el = el;
|
44
|
+
this.options = extend( {}, this.options );
|
45
|
+
extend( this.options, options );
|
46
|
+
this._init();
|
47
|
+
}
|
48
|
+
|
49
|
+
/**
|
50
|
+
* SelectFx options
|
51
|
+
*/
|
52
|
+
SelectFx.prototype.options = {
|
53
|
+
// if true all the links will open in a new tab.
|
54
|
+
// if we want to be redirected when we click an option, we need to define a data-link attr on the option of the native select element
|
55
|
+
newTab : true,
|
56
|
+
// when opening the select element, the default placeholder (if any) is shown
|
57
|
+
stickyPlaceholder : true,
|
58
|
+
// callback when changing the value
|
59
|
+
onChange : function( val ) { return false; }
|
60
|
+
}
|
61
|
+
|
62
|
+
/**
|
63
|
+
* init function
|
64
|
+
* initialize and cache some vars
|
65
|
+
*/
|
66
|
+
SelectFx.prototype._init = function() {
|
67
|
+
// check if we are using a placeholder for the native select box
|
68
|
+
// we assume the placeholder is disabled and selected by default
|
69
|
+
var selectedOpt = this.el.querySelector( 'option[selected]' );
|
70
|
+
this.hasDefaultPlaceholder = selectedOpt && selectedOpt.disabled;
|
71
|
+
|
72
|
+
// get selected option (either the first option with attr selected or just the first option)
|
73
|
+
this.selectedOpt = selectedOpt || this.el.querySelector( 'option' );
|
74
|
+
|
75
|
+
// create structure
|
76
|
+
this._createSelectEl();
|
77
|
+
|
78
|
+
// all options
|
79
|
+
this.selOpts = [].slice.call( this.selEl.querySelectorAll( 'li[data-option]' ) );
|
80
|
+
|
81
|
+
// total options
|
82
|
+
this.selOptsCount = this.selOpts.length;
|
83
|
+
|
84
|
+
// current index
|
85
|
+
this.current = this.selEl.querySelector('select').selectedIndex; //this.selOpts.indexOf( this.selEl.querySelector( 'li.cs-selected' ) ) || 0;
|
86
|
+
|
87
|
+
// placeholder elem
|
88
|
+
this.selPlaceholder = this.selEl.querySelector( 'span.cs-placeholder' );
|
89
|
+
|
90
|
+
// init events
|
91
|
+
this._initEvents();
|
92
|
+
}
|
93
|
+
|
94
|
+
/**
|
95
|
+
* creates the structure for the select element
|
96
|
+
*/
|
97
|
+
SelectFx.prototype._createSelectEl = function() {
|
98
|
+
var self = this, options = '', createOptionHTML = function(el) {
|
99
|
+
var optclass = '', classes = '', link = '';
|
100
|
+
|
101
|
+
if( el.selectedOpt && !this.foundSelected && !this.hasDefaultPlaceholder ) {
|
102
|
+
classes += 'cs-selected ';
|
103
|
+
this.foundSelected = true;
|
104
|
+
}
|
105
|
+
// extra classes
|
106
|
+
if( el.getAttribute( 'data-class' ) ) {
|
107
|
+
classes += el.getAttribute( 'data-class' );
|
108
|
+
}
|
109
|
+
// link options
|
110
|
+
if( el.getAttribute( 'data-link' ) ) {
|
111
|
+
link = 'data-link=' + el.getAttribute( 'data-link' );
|
112
|
+
}
|
113
|
+
|
114
|
+
if( classes !== '' ) {
|
115
|
+
optclass = 'class="' + classes + '" ';
|
116
|
+
}
|
117
|
+
|
118
|
+
return '<li ' + optclass + link + ' data-option data-value="' + el.value + '"><span>' + el.textContent + '</span></li>';
|
119
|
+
};
|
120
|
+
|
121
|
+
[].slice.call( this.el.children ).forEach( function(el) {
|
122
|
+
if( el.disabled ) { return; }
|
123
|
+
|
124
|
+
var tag = el.tagName.toLowerCase();
|
125
|
+
|
126
|
+
if( tag === 'option' ) {
|
127
|
+
options += createOptionHTML(el);
|
128
|
+
}
|
129
|
+
else if( tag === 'optgroup' ) {
|
130
|
+
options += '<li class="cs-optgroup"><span>' + el.label + '</span><ul>';
|
131
|
+
[].slice.call( el.children ).forEach( function(opt) {
|
132
|
+
options += createOptionHTML(opt);
|
133
|
+
} );
|
134
|
+
options += '</ul></li>';
|
135
|
+
}
|
136
|
+
} );
|
137
|
+
|
138
|
+
var opts_el = '<div class="cs-options"><ul>' + options + '</ul></div>';
|
139
|
+
this.selEl = document.createElement( 'div' );
|
140
|
+
this.selEl.className = this.el.className;
|
141
|
+
this.selEl.tabIndex = this.el.tabIndex;
|
142
|
+
this.selEl.innerHTML = '<span class="cs-placeholder">' + this.selectedOpt.textContent + '</span>' + opts_el;
|
143
|
+
this.el.parentNode.appendChild( this.selEl );
|
144
|
+
this.selEl.appendChild( this.el );
|
145
|
+
}
|
146
|
+
|
147
|
+
/**
|
148
|
+
* initialize the events
|
149
|
+
*/
|
150
|
+
SelectFx.prototype._initEvents = function() {
|
151
|
+
var self = this;
|
152
|
+
|
153
|
+
// open/close select
|
154
|
+
this.selPlaceholder.addEventListener( 'click', function() {
|
155
|
+
self._toggleSelect();
|
156
|
+
} );
|
157
|
+
|
158
|
+
// clicking the options
|
159
|
+
this.selOpts.forEach( function(opt, idx) {
|
160
|
+
opt.addEventListener( 'click', function() {
|
161
|
+
self.current = idx;
|
162
|
+
self._changeOption();
|
163
|
+
// close select elem
|
164
|
+
self._toggleSelect();
|
165
|
+
} );
|
166
|
+
} );
|
167
|
+
|
168
|
+
// close the select element if the target it´s not the select element or one of its descendants..
|
169
|
+
document.addEventListener( 'click', function(ev) {
|
170
|
+
var target = ev.target;
|
171
|
+
if( self._isOpen() && target !== self.selEl && !hasParent( target, self.selEl ) ) {
|
172
|
+
self._toggleSelect();
|
173
|
+
}
|
174
|
+
} );
|
175
|
+
|
176
|
+
// keyboard navigation events
|
177
|
+
this.selEl.addEventListener( 'keydown', function( ev ) {
|
178
|
+
var keyCode = ev.keyCode || ev.which;
|
179
|
+
|
180
|
+
switch (keyCode) {
|
181
|
+
// up key
|
182
|
+
case 38:
|
183
|
+
ev.preventDefault();
|
184
|
+
self._navigateOpts('prev');
|
185
|
+
break;
|
186
|
+
// down key
|
187
|
+
case 40:
|
188
|
+
ev.preventDefault();
|
189
|
+
self._navigateOpts('next');
|
190
|
+
break;
|
191
|
+
// space key
|
192
|
+
case 32:
|
193
|
+
ev.preventDefault();
|
194
|
+
if( self._isOpen() && typeof self.preSelCurrent != 'undefined' && self.preSelCurrent !== -1 ) {
|
195
|
+
self._changeOption();
|
196
|
+
}
|
197
|
+
self._toggleSelect();
|
198
|
+
break;
|
199
|
+
// enter key
|
200
|
+
case 13:
|
201
|
+
ev.preventDefault();
|
202
|
+
if( self._isOpen() && typeof self.preSelCurrent != 'undefined' && self.preSelCurrent !== -1 ) {
|
203
|
+
self._changeOption();
|
204
|
+
self._toggleSelect();
|
205
|
+
}
|
206
|
+
break;
|
207
|
+
// esc key
|
208
|
+
case 27:
|
209
|
+
ev.preventDefault();
|
210
|
+
if( self._isOpen() ) {
|
211
|
+
self._toggleSelect();
|
212
|
+
}
|
213
|
+
break;
|
214
|
+
}
|
215
|
+
} );
|
216
|
+
}
|
217
|
+
|
218
|
+
/**
|
219
|
+
* navigate with up/dpwn keys
|
220
|
+
*/
|
221
|
+
SelectFx.prototype._navigateOpts = function(dir) {
|
222
|
+
if( !this._isOpen() ) {
|
223
|
+
this._toggleSelect();
|
224
|
+
}
|
225
|
+
|
226
|
+
var tmpcurrent = typeof this.preSelCurrent != 'undefined' && this.preSelCurrent !== -1 ? this.preSelCurrent : this.current;
|
227
|
+
|
228
|
+
if( dir === 'prev' && tmpcurrent > 0 || dir === 'next' && tmpcurrent < this.selOptsCount - 1 ) {
|
229
|
+
// save pre selected current - if we click on option, or press enter, or press space this is going to be the index of the current option
|
230
|
+
this.preSelCurrent = dir === 'next' ? tmpcurrent + 1 : tmpcurrent - 1;
|
231
|
+
// remove focus class if any..
|
232
|
+
this._removeFocus();
|
233
|
+
// add class focus - track which option we are navigating
|
234
|
+
classie.add( this.selOpts[this.preSelCurrent], 'cs-focus' );
|
235
|
+
}
|
236
|
+
}
|
237
|
+
|
238
|
+
/**
|
239
|
+
* open/close select
|
240
|
+
* when opened show the default placeholder if any
|
241
|
+
*/
|
242
|
+
SelectFx.prototype._toggleSelect = function() {
|
243
|
+
// remove focus class if any..
|
244
|
+
this._removeFocus();
|
245
|
+
|
246
|
+
if( this._isOpen() ) {
|
247
|
+
if( this.current !== -1 ) {
|
248
|
+
// update placeholder text
|
249
|
+
this.selPlaceholder.textContent = this.selOpts[ this.current ].textContent;
|
250
|
+
}
|
251
|
+
classie.remove( this.selEl, 'cs-active' );
|
252
|
+
document.getElementById('btn_veja_mais').style.zIndex='999';
|
253
|
+
|
254
|
+
} else {
|
255
|
+
|
256
|
+
if( this.hasDefaultPlaceholder && this.options.stickyPlaceholder ) {
|
257
|
+
// everytime we open we wanna see the default placeholder text
|
258
|
+
this.selPlaceholder.textContent = this.selectedOpt.textContent;
|
259
|
+
}
|
260
|
+
classie.add( this.selEl, 'cs-active' );
|
261
|
+
document.getElementById('btn_veja_mais').style.zIndex='10';
|
262
|
+
}
|
263
|
+
}
|
264
|
+
|
265
|
+
/**
|
266
|
+
* change option - the new value is set
|
267
|
+
*/
|
268
|
+
SelectFx.prototype._changeOption = function() {
|
269
|
+
// if pre selected current (if we navigate with the keyboard)...
|
270
|
+
if( typeof this.preSelCurrent != 'undefined' && this.preSelCurrent !== -1 ) {
|
271
|
+
this.current = this.preSelCurrent;
|
272
|
+
this.preSelCurrent = -1;
|
273
|
+
}
|
274
|
+
|
275
|
+
// current option
|
276
|
+
var opt = this.selOpts[ this.current ];
|
277
|
+
|
278
|
+
// update current selected value
|
279
|
+
this.selPlaceholder.textContent = opt.textContent;
|
280
|
+
|
281
|
+
// change native select element´s value
|
282
|
+
this.el.value = opt.getAttribute( 'data-value' );
|
283
|
+
|
284
|
+
// remove class cs-selected from old selected option and add it to current selected option
|
285
|
+
var oldOpt = this.selEl.querySelector( 'li.cs-selected' );
|
286
|
+
if( oldOpt ) {
|
287
|
+
classie.remove( oldOpt, 'cs-selected' );
|
288
|
+
}
|
289
|
+
classie.add( opt, 'cs-selected' );
|
290
|
+
|
291
|
+
// if there´s a link defined
|
292
|
+
if( opt.getAttribute( 'data-link' ) && first ) {
|
293
|
+
// open in new tab?
|
294
|
+
// if( this.options.newTab ) {
|
295
|
+
// window.open( opt.getAttribute( 'data-link' ), '_blank' );
|
296
|
+
// }
|
297
|
+
// else {
|
298
|
+
// window.location = opt.getAttribute( 'data-link' );
|
299
|
+
// }
|
300
|
+
changeSource( opt.getAttribute( 'data-link' ));
|
301
|
+
|
302
|
+
}
|
303
|
+
|
304
|
+
first = true;
|
305
|
+
|
306
|
+
// callback
|
307
|
+
this.options.onChange( this.el.value );
|
308
|
+
}
|
309
|
+
|
310
|
+
/**
|
311
|
+
* returns true if select element is opened
|
312
|
+
*/
|
313
|
+
SelectFx.prototype._isOpen = function(opt) {
|
314
|
+
return classie.has( this.selEl, 'cs-active' );
|
315
|
+
}
|
316
|
+
|
317
|
+
/**
|
318
|
+
* removes the focus class from the option
|
319
|
+
*/
|
320
|
+
SelectFx.prototype._removeFocus = function(opt) {
|
321
|
+
var focusEl = this.selEl.querySelector( 'li.cs-focus' )
|
322
|
+
if( focusEl ) {
|
323
|
+
classie.remove( focusEl, 'cs-focus' );
|
324
|
+
}
|
325
|
+
}
|
326
|
+
|
327
|
+
/**
|
328
|
+
* add to global namespace
|
329
|
+
*/
|
330
|
+
window.SelectFx = SelectFx;
|
331
|
+
|
332
|
+
|
333
|
+
function changeSource(source) {
|
334
|
+
|
335
|
+
if (window.location.href.indexOf("radio") !=-1) {
|
336
|
+
window.location.href = replaceUrlParam(window.location.href, 'radio', source);
|
337
|
+
|
338
|
+
} else {
|
339
|
+
window.location.href = replaceUrlParam(window.location.href, 'tv', source);
|
340
|
+
|
341
|
+
}
|
342
|
+
}
|
343
|
+
|
344
|
+
function replaceUrlParam(url, paramName, paramValue){
|
345
|
+
var pattern = new RegExp('('+paramName+'=).*?(&|$)')
|
346
|
+
var newUrl=url
|
347
|
+
if(url.search(pattern)>=0){
|
348
|
+
newUrl = url.replace(pattern,'$1' + paramValue + '$2');
|
349
|
+
}
|
350
|
+
else{
|
351
|
+
newUrl = newUrl + (newUrl.indexOf('?')>0 ? '&' : '?') + paramName + '=' + paramValue;
|
352
|
+
}
|
353
|
+
return newUrl;
|
354
|
+
}
|
355
|
+
} )( window );
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iasd-bootstrap-sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Filipi Zimermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: compass
|
@@ -281,6 +281,7 @@ files:
|
|
281
281
|
- templates/project/img/widgets/slider_full.png
|
282
282
|
- templates/project/img/widgets/title_novo_tempo.png
|
283
283
|
- templates/project/lib/bootstrap.min.js
|
284
|
+
- templates/project/lib/classie.js
|
284
285
|
- templates/project/lib/html5shiv.js
|
285
286
|
- templates/project/lib/iasd-bootstrap.js
|
286
287
|
- templates/project/lib/iasd-bootstrap.min.js
|
@@ -298,6 +299,7 @@ files:
|
|
298
299
|
- templates/project/lib/modernizr.js
|
299
300
|
- templates/project/lib/owl.carousel.js
|
300
301
|
- templates/project/lib/respond.min.js
|
302
|
+
- templates/project/lib/selectFx.js
|
301
303
|
- templates/project/manifest.rb
|
302
304
|
- templates/project/print.scss
|
303
305
|
homepage: http://nextt.com.br/
|