flexa_lib 0.1.17 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
data/README.txt CHANGED
@@ -5,14 +5,14 @@ Deixar dessa forma:
5
5
 
6
6
  //= require jquery
7
7
  //= require jquery_ujs
8
- //= require flexa
8
+ //= require flexa-themejs
9
9
 
10
10
  ===== No arquivo application.css
11
11
  Deixar dessa forma:
12
12
 
13
13
  /*
14
14
  *= require_self
15
- *= require flexa
15
+ *= require flexa-theme
16
16
  */
17
17
 
18
18
  ##
data/flexa_lib.gemspec CHANGED
@@ -7,7 +7,7 @@ require 'flexa_lib/version'
7
7
  Gem::Specification.new do |s|
8
8
  s.name = 'flexa_lib'
9
9
  # s.version = FlexaLib::VERSION
10
- s.version = '0.1.17'
10
+ s.version = '0.1.18'
11
11
  s.platform = Gem::Platform::RUBY
12
12
 
13
13
  s.authors = ['Allan Freitas','Marcio Sfalsin']
@@ -8,7 +8,6 @@
8
8
  // = require jquery_ujs
9
9
  //= require bootstrap
10
10
  //= require populate
11
- //= require 'jquery.pjax'
12
11
  //= require 'jquery.cookie'
13
12
 
14
13
  $(document).ready(function(){
@@ -24,31 +23,6 @@ $(document).ready(function(){
24
23
  $(this).attr("id","short");
25
24
  });
26
25
 
27
- //window.parent.frames[0].setAttribute('rows',80+',*,10');
28
- //alert($(window.parent.frames[1].frames[0]).setAttribute('rows',80+',*'));
29
- //alert(window.parent.$("frameset").child);
30
- $('a').pjax('#caixa');
31
-
32
-
33
- //.live('click', function(event){
34
-
35
- //var urltmp = $(this).attr('href')+'?search='+$("#search").val();
36
- //alert(urltmp);
37
- //$(this).attr('href',urltmp);
38
-
39
- //event.returnValue=false;
40
- //return false;
41
- //$(this).pjax({
42
- // url: urltmp,
43
- // container: '#caixa'}).click();
44
- //});
45
-
46
-
47
- //$('.modal').on('show', function () {
48
- //$(this).find('#caixa').load('/perfis/search');
49
- // do something…
50
- //});
51
- //$('#caixa').scrollspy();
52
26
 
53
27
  $('input.ui-datepicker').datepicker();
54
28
  $('.datePicker').datepicker();
@@ -12,7 +12,7 @@ body {
12
12
  position: relative;
13
13
  padding-top: 90px;
14
14
  background-color: #fff;
15
- background-image: url(../img/grid-18px-masked.png);
15
+ /*background-image: url(../img/grid-18px-masked.png);*/
16
16
  background-repeat: repeat-x;
17
17
  background-position: 0 40px;
18
18
  }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flexa_lib
3
3
  version: !ruby/object:Gem::Version
4
- hash: 57
4
+ hash: 63
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 17
10
- version: 0.1.17
9
+ - 18
10
+ version: 0.1.18
11
11
  platform: ruby
12
12
  authors:
13
13
  - Allan Freitas
@@ -181,7 +181,6 @@ files:
181
181
  - vendor/assets/javascripts/bootstrap-collapse.js
182
182
  - vendor/assets/javascripts/flexa-themejs.js
183
183
  - vendor/assets/javascripts/bootstrap-tab.js
184
- - vendor/assets/javascripts/jquery.pjax.js
185
184
  - vendor/assets/javascripts/bootstrap-carousel.js
186
185
  - vendor/assets/javascripts/bootstrap-dropdown.js
187
186
  - vendor/assets/javascripts/bootstrap-button.js
@@ -1,460 +0,0 @@
1
- // jquery.pjax.js
2
- // copyright chris wanstrath
3
- // https://github.com/defunkt/jquery-pjax
4
-
5
- (function($){
6
-
7
- // When called on a link, fetches the href with ajax into the
8
- // container specified as the first parameter or with the data-pjax
9
- // attribute on the link itself.
10
- //
11
- // Tries to make sure the back button and ctrl+click work the way
12
- // you'd expect.
13
- //
14
- // Accepts a jQuery ajax options object that may include these
15
- // pjax specific options:
16
- //
17
- // container - Where to stick the response body. Usually a String selector.
18
- // $(container).html(xhr.responseBody)
19
- // push - Whether to pushState the URL. Defaults to true (of course).
20
- // replace - Want to use replaceState instead? That's cool.
21
- //
22
- // For convenience the first parameter can be either the container or
23
- // the options object.
24
- //
25
- // Returns the jQuery object
26
- $.fn.pjax = function( container, options ) {
27
- options = optionsFor(container, options)
28
- return this.live('click', function(event){
29
- return handleClick(event, options)
30
- })
31
- }
32
-
33
- // Public: pjax on click handler
34
- //
35
- // Exported as $.pjax.click.
36
- //
37
- // event - "click" jQuery.Event
38
- // options - pjax options
39
- //
40
- // Examples
41
- //
42
- // $('a').live('click', $.pjax.click)
43
- // // is the same as
44
- // $('a').pjax()
45
- //
46
- // $(document).on('click', 'a', function(event) {
47
- // var container = $(this).closest('[data-pjax-container]')
48
- // return $.pjax.click(event, container)
49
- // })
50
- //
51
- // Returns false if pjax runs, otherwise nothing.
52
- function handleClick(event, container, options) {
53
- options = optionsFor(container, options)
54
-
55
- var link = event.currentTarget
56
-
57
- // Middle click, cmd click, and ctrl click should open
58
- // links in a new tab as normal.
59
- if ( event.which > 1 || event.metaKey )
60
- return
61
-
62
- // Ignore cross origin links
63
- if ( location.protocol !== link.protocol || location.host !== link.host )
64
- return
65
-
66
- // Ignore anchors on the same page
67
- if ( link.hash && link.href.replace(link.hash, '') ===
68
- location.href.replace(location.hash, '') )
69
- return
70
-
71
- var defaults = {
72
- url: link.href,
73
- container: $(link).attr('data-pjax'),
74
- clickedElement: $(link),
75
- fragment: null
76
- }
77
-
78
- $.pjax($.extend({}, defaults, options))
79
-
80
- event.preventDefault()
81
- return false
82
- }
83
-
84
- // Internal: Strips _pjax=true param from url
85
- //
86
- // url - String
87
- //
88
- // Returns String.
89
- function stripPjaxParam(url) {
90
- return url
91
- .replace(/\?_pjax=true&?/, '?')
92
- .replace(/_pjax=true&?/, '')
93
- .replace(/\?$/, '')
94
- }
95
-
96
- // Internal: Parse URL components and returns a Locationish object.
97
- //
98
- // url - String URL
99
- //
100
- // Returns HTMLAnchorElement that acts like Location.
101
- function parseURL(url) {
102
- var a = document.createElement('a')
103
- a.href = url
104
- return a
105
- }
106
-
107
-
108
- // Loads a URL with ajax, puts the response body inside a container,
109
- // then pushState()'s the loaded URL.
110
- //
111
- // Works just like $.ajax in that it accepts a jQuery ajax
112
- // settings object (with keys like url, type, data, etc).
113
- //
114
- // Accepts these extra keys:
115
- //
116
- // container - Where to stick the response body.
117
- // $(container).html(xhr.responseBody)
118
- // push - Whether to pushState the URL. Defaults to true (of course).
119
- // replace - Want to use replaceState instead? That's cool.
120
- //
121
- // Use it just like $.ajax:
122
- //
123
- // var xhr = $.pjax({ url: this.href, container: '#main' })
124
- // console.log( xhr.readyState )
125
- //
126
- // Returns whatever $.ajax returns.
127
- var pjax = $.pjax = function( options ) {
128
- options = $.extend(true, {}, $.ajaxSettings, pjax.defaults, options)
129
-
130
- if ($.isFunction(options.url)) {
131
- options.url = options.url()
132
- }
133
-
134
- var url = options.url
135
- var hash = parseURL(url).hash
136
-
137
- // DEPRECATED: Save references to original event callbacks. However,
138
- // listening for custom pjax:* events is prefered.
139
- var oldBeforeSend = options.beforeSend,
140
- oldComplete = options.complete,
141
- oldSuccess = options.success,
142
- oldError = options.error
143
-
144
- options.context = findContainerFor(options.container)
145
-
146
- var timeoutTimer
147
-
148
- options.beforeSend = function(xhr, settings) {
149
- var context = this
150
-
151
- url = stripPjaxParam(settings.url)
152
-
153
- if (settings.timeout > 0) {
154
- timeoutTimer = setTimeout(function() {
155
- var event = $.Event('pjax:timeout')
156
- context.trigger(event, [xhr, options])
157
- if (event.result !== false)
158
- xhr.abort('timeout')
159
- }, settings.timeout)
160
-
161
- // Clear timeout setting so jquerys internal timeout isn't invoked
162
- settings.timeout = 0
163
- }
164
-
165
- xhr.setRequestHeader('X-PJAX', 'true')
166
-
167
- var result
168
-
169
- // DEPRECATED: Invoke original `beforeSend` handler
170
- if (oldBeforeSend) {
171
- result = oldBeforeSend.apply(this, arguments)
172
- if (result === false) return false
173
- }
174
-
175
- var event = $.Event('pjax:beforeSend')
176
- this.trigger(event, [xhr, settings])
177
- result = event.result
178
- if (result === false) return false
179
-
180
- this.trigger('pjax:start', [xhr, options])
181
- // start.pjax is deprecated
182
- this.trigger('start.pjax', [xhr, options])
183
- }
184
-
185
- options.complete = function(xhr, textStatus) {
186
- if (timeoutTimer)
187
- clearTimeout(timeoutTimer)
188
-
189
- // DEPRECATED: Invoke original `complete` handler
190
- if (oldComplete) oldComplete.apply(this, arguments)
191
-
192
- this.trigger('pjax:complete', [xhr, textStatus, options])
193
-
194
- this.trigger('pjax:end', [xhr, options])
195
- // end.pjax is deprecated
196
- this.trigger('end.pjax', [xhr, options])
197
- }
198
-
199
- options.error = function(xhr, textStatus, errorThrown) {
200
- var respUrl = xhr.getResponseHeader('X-PJAX-URL')
201
- if (respUrl) url = stripPjaxParam(respUrl)
202
-
203
- // DEPRECATED: Invoke original `error` handler
204
- if (oldError) oldError.apply(this, arguments)
205
-
206
- var event = $.Event('pjax:error')
207
- this.trigger(event, [xhr, textStatus, errorThrown, options])
208
- if (textStatus !== 'abort' && event.result !== false)
209
- window.location = url
210
- }
211
-
212
- options.success = function(data, status, xhr) {
213
- var respUrl = xhr.getResponseHeader('X-PJAX-URL')
214
- if (respUrl) url = stripPjaxParam(respUrl)
215
-
216
- var title, oldTitle = document.title
217
-
218
- if ( options.fragment ) {
219
- // If they specified a fragment, look for it in the response
220
- // and pull it out.
221
- var html = $('<html>').html(data)
222
- var $fragment = html.find(options.fragment)
223
- if ( $fragment.length ) {
224
- this.html($fragment.contents())
225
-
226
- // If there's a <title> tag in the response, use it as
227
- // the page's title. Otherwise, look for data-title and title attributes.
228
- title = html.find('title').text() || $fragment.attr('title') || $fragment.data('title')
229
- } else {
230
- return window.location = url
231
- }
232
- } else {
233
- // If we got no data or an entire web page, go directly
234
- // to the page and let normal error handling happen.
235
- if ( !$.trim(data) || /<html/i.test(data) )
236
- return window.location = url
237
-
238
- this.html(data)
239
-
240
- // If there's a <title> tag in the response, use it as
241
- // the page's title.
242
- title = this.find('title').remove().text()
243
- }
244
-
245
- if ( title ) document.title = $.trim(title)
246
-
247
- var state = {
248
- url: url,
249
- pjax: this.selector,
250
- fragment: options.fragment,
251
- timeout: options.timeout
252
- }
253
-
254
- if ( options.replace ) {
255
- pjax.active = true
256
- window.history.replaceState(state, document.title, url)
257
- } else if ( options.push ) {
258
- // this extra replaceState before first push ensures good back
259
- // button behavior
260
- if ( !pjax.active ) {
261
- window.history.replaceState($.extend({}, state, {url:null}), oldTitle)
262
- pjax.active = true
263
- }
264
-
265
- window.history.pushState(state, document.title, url)
266
- }
267
-
268
- // Google Analytics support
269
- if ( (options.replace || options.push) && window._gaq )
270
- _gaq.push(['_trackPageview'])
271
-
272
- // If the URL has a hash in it, make sure the browser
273
- // knows to navigate to the hash.
274
- if ( hash !== '' ) {
275
- window.location.href = hash
276
- }
277
-
278
- // DEPRECATED: Invoke original `success` handler
279
- if (oldSuccess) oldSuccess.apply(this, arguments)
280
-
281
- this.trigger('pjax:success', [data, status, xhr, options])
282
- }
283
-
284
-
285
- // Cancel the current request if we're already pjaxing
286
- var xhr = pjax.xhr
287
- if ( xhr && xhr.readyState < 4) {
288
- xhr.onreadystatechange = $.noop
289
- xhr.abort()
290
- }
291
-
292
- pjax.options = options
293
- pjax.xhr = $.ajax(options)
294
- $(document).trigger('pjax', [pjax.xhr, options])
295
-
296
- return pjax.xhr
297
- }
298
-
299
-
300
- // Internal: Build options Object for arguments.
301
- //
302
- // For convenience the first parameter can be either the container or
303
- // the options object.
304
- //
305
- // Examples
306
- //
307
- // optionsFor('#container')
308
- // // => {container: '#container'}
309
- //
310
- // optionsFor('#container', {push: true})
311
- // // => {container: '#container', push: true}
312
- //
313
- // optionsFor({container: '#container', push: true})
314
- // // => {container: '#container', push: true}
315
- //
316
- // Returns options Object.
317
- function optionsFor(container, options) {
318
- // Both container and options
319
- if ( container && options )
320
- options.container = container
321
-
322
- // First argument is options Object
323
- else if ( $.isPlainObject(container) )
324
- options = container
325
-
326
- // Only container
327
- else
328
- options = {container: container}
329
-
330
- // Find and validate container
331
- if (options.container)
332
- options.container = findContainerFor(options.container)
333
-
334
- return options
335
- }
336
-
337
- // Internal: Find container element for a variety of inputs.
338
- //
339
- // Because we can't persist elements using the history API, we must be
340
- // able to find a String selector that will consistently find the Element.
341
- //
342
- // container - A selector String, jQuery object, or DOM Element.
343
- //
344
- // Returns a jQuery object whose context is `document` and has a selector.
345
- function findContainerFor(container) {
346
- container = $(container)
347
-
348
- if ( !container.length ) {
349
- throw "no pjax container for " + container.selector
350
- } else if ( container.selector !== '' && container.context === document ) {
351
- return container
352
- } else if ( container.attr('id') ) {
353
- return $('#' + container.attr('id'))
354
- } else {
355
- throw "cant get selector for pjax container!"
356
- }
357
- }
358
-
359
-
360
- pjax.defaults = {
361
- timeout: 650,
362
- push: true,
363
- replace: false,
364
- // We want the browser to maintain two separate internal caches: one for
365
- // pjax'd partial page loads and one for normal page loads. Without
366
- // adding this secret parameter, some browsers will often confuse the two.
367
- data: { _pjax: true },
368
- type: 'GET',
369
- dataType: 'html'
370
- }
371
-
372
- // Export $.pjax.click
373
- pjax.click = handleClick
374
-
375
-
376
- // Used to detect initial (useless) popstate.
377
- // If history.state exists, assume browser isn't going to fire initial popstate.
378
- var popped = ('state' in window.history), initialURL = location.href
379
-
380
-
381
- // popstate handler takes care of the back and forward buttons
382
- //
383
- // You probably shouldn't use pjax on pages with other pushState
384
- // stuff yet.
385
- $(window).bind('popstate', function(event){
386
- // Ignore inital popstate that some browsers fire on page load
387
- var initialPop = !popped && location.href == initialURL
388
- popped = true
389
- if ( initialPop ) return
390
-
391
- var state = event.state
392
-
393
- if ( state && state.pjax ) {
394
- var container = state.pjax
395
- if ( $(container+'').length )
396
- $.pjax({
397
- url: state.url || location.href,
398
- fragment: state.fragment,
399
- container: container,
400
- push: false,
401
- timeout: state.timeout
402
- })
403
- else
404
- window.location = location.href
405
- }
406
- })
407
-
408
-
409
- // Add the state property to jQuery's event object so we can use it in
410
- // $(window).bind('popstate')
411
- if ( $.inArray('state', $.event.props) < 0 )
412
- $.event.props.push('state')
413
-
414
-
415
- // Is pjax supported by this browser?
416
- $.support.pjax =
417
- window.history && window.history.pushState && window.history.replaceState
418
- // pushState isn't reliable on iOS until 5.
419
- && !navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]|WebApps\/.+CFNetwork)/)
420
-
421
-
422
- // Fall back to normalcy for older browsers.
423
- if ( !$.support.pjax ) {
424
- $.pjax = function( options ) {
425
- var url = $.isFunction(options.url) ? options.url() : options.url,
426
- method = options.type ? options.type.toUpperCase() : 'GET'
427
-
428
- var form = $('<form>', {
429
- method: method === 'GET' ? 'GET' : 'POST',
430
- action: url,
431
- style: 'display:none'
432
- })
433
-
434
- if (method !== 'GET' && method !== 'POST') {
435
- form.append($('<input>', {
436
- type: 'hidden',
437
- name: '_method',
438
- value: method.toLowerCase()
439
- }))
440
- }
441
-
442
- var data = options.data
443
- if (typeof data === 'string') {
444
- $.each(data.split('&'), function(index, value) {
445
- var pair = value.split('=')
446
- form.append($('<input>', {type: 'hidden', name: pair[0], value: pair[1]}))
447
- })
448
- } else if (typeof data === 'object') {
449
- for (key in data)
450
- form.append($('<input>', {type: 'hidden', name: key, value: data[key]}))
451
- }
452
-
453
- $(document.body).append(form)
454
- form.submit()
455
- }
456
- $.pjax.click = $.noop
457
- $.fn.pjax = function() { return this }
458
- }
459
-
460
- })(jQuery);