ultimate-base 0.5.0.0 → 0.6.0
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/app/assets/javascripts/ultimate/backbone/app.js.coffee +47 -5
- data/app/assets/javascripts/ultimate/backbone/base.js.coffee +9 -10
- data/app/assets/javascripts/ultimate/backbone/collection.js.coffee +0 -1
- data/app/assets/javascripts/ultimate/backbone/lib/backbone.js +765 -673
- data/app/assets/javascripts/ultimate/backbone/model.js.coffee +0 -1
- data/app/assets/javascripts/ultimate/backbone/router.js.coffee +0 -4
- data/app/assets/javascripts/ultimate/backbone/view-mixins/nodes.js.coffee +51 -0
- data/app/assets/javascripts/ultimate/backbone/view.js.coffee +18 -104
- data/app/assets/javascripts/ultimate/base.js.coffee +1 -11
- data/app/assets/javascripts/ultimate/jquery-plugin-adapter.js.coffee +0 -1
- data/app/assets/javascripts/ultimate/jquery-plugin-class.js.coffee +3 -25
- data/app/assets/javascripts/ultimate/jquery.base.js.coffee +0 -2
- data/app/assets/javascripts/ultimate/underscore/underscore.inflection.js +4 -3
- data/app/assets/javascripts/ultimate/underscore/underscore.js +103 -80
- data/app/assets/javascripts/ultimate/underscore/underscore.string.js +71 -27
- data/lib/ultimate/base.rb +0 -1
- data/lib/ultimate/base/version.rb +1 -1
- metadata +3 -8
- data/app/assets/javascripts/ultimate/backbone/extra/jquery-ext.js.coffee +0 -96
- data/app/assets/javascripts/ultimate/improves/datepicker.js.coffee +0 -34
- data/app/assets/javascripts/ultimate/improves/devise.js.coffee +0 -18
- data/app/assets/javascripts/ultimate/improves/form-errors.js.coffee +0 -146
- data/app/assets/javascripts/ultimate/improves/tablesorter.js +0 -59
- data/lib/ultimate/extensions/directive_processor.rb +0 -64
@@ -1,59 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Декорирование таблиц с данными + добавление сортировки + доп. обработка таблиц с checkable строками
|
3
|
-
*
|
4
|
-
* @param {jQuery} jRoot корневые jQuery объекты, в которых будет осуществляться поиск table.tablesorter:not(.decorated)
|
5
|
-
* @returns {Number} count >= 0 количество продекорированных таблиц
|
6
|
-
*/
|
7
|
-
function decor_tables(jRoot) {
|
8
|
-
var jTables = jRoot.find('table.tablesorter:not(.decorated)'),
|
9
|
-
jTablesHeaders = jTables.find('thead th:not([colspan])'),
|
10
|
-
ts_initData = {};
|
11
|
-
if ( arguments.length > 1 ) ts_initData.sortList = arguments[1];
|
12
|
-
jTablesHeaders.prepend('<div class="bullet-wrapper"><div class="bullet"></div></div>');
|
13
|
-
jTables.find('thead')
|
14
|
-
.find('tr:first th:first').addClass('first-child')
|
15
|
-
.prepend('<div class="corner-wrapper"><div class="corner left"></div></div>')
|
16
|
-
.end().find('tr th:last-child').addClass('last-child').first()
|
17
|
-
.prepend('<div class="corner-wrapper"><div class="corner right"></div></div>');
|
18
|
-
jTables.find('td:last-child').addClass('last-child');
|
19
|
-
jTables.each( function () {
|
20
|
-
var jTable = $(this),
|
21
|
-
jTFoot = jTable.children('tfoot');
|
22
|
-
if ( !jTFoot.length ) jTFoot = $('<tfoot></tfoot>').appendTo(jTable);
|
23
|
-
var jRow = $('<tr></tr>').appendTo(jTFoot);
|
24
|
-
$('<td colspan="' + jTable.find('thead th').length + '" class="border-bottom"></td>').appendTo(jRow)
|
25
|
-
.append('<div class="corner-wrapper"><div class="corner left"></div><div class="corner right"></div></div>');
|
26
|
-
} )
|
27
|
-
.addClass('decorated')
|
28
|
-
.tablesorter(ts_initData);
|
29
|
-
jTables.filter('.checkable').tablesorter({headers: { 0: { sorter: false}}})
|
30
|
-
.find('thead th.first-child').removeClass('header')
|
31
|
-
.find('.bullet-wrapper').remove();
|
32
|
-
return jTables.length;
|
33
|
-
}
|
34
|
-
|
35
|
-
$('table.checkable thead th:first input:checkbox').live('change', function () {
|
36
|
-
var jThis = $(this),
|
37
|
-
jTable = jThis.closest('table.checkable'),
|
38
|
-
jCheckboxes = jTable.find('tbody input:checkbox');
|
39
|
-
jCheckboxes.prop('checked', jThis.prop('checked'));
|
40
|
-
refresh_states(jTable);
|
41
|
-
} );
|
42
|
-
|
43
|
-
$('table.checkable tbody td:first-child input:checkbox').live('change', function () {
|
44
|
-
var jTable = $(this).closest('table.checkable');
|
45
|
-
jTable.find('input:checkbox#select_all').prop('checked', jTable.find('tbody input:checkbox:not(:checked)').length === 0);
|
46
|
-
refresh_states(jTable);
|
47
|
-
} );
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
$( function () {
|
52
|
-
|
53
|
-
if ( $.tablesorter ) {
|
54
|
-
$.tablesorter.defaults.widgets = ['zebra'];
|
55
|
-
}
|
56
|
-
|
57
|
-
//decor_tables($('body'));
|
58
|
-
|
59
|
-
} );
|
@@ -1,64 +0,0 @@
|
|
1
|
-
require 'sprockets'
|
2
|
-
|
3
|
-
module Ultimate
|
4
|
-
module Extensions
|
5
|
-
module DirectiveProcessor
|
6
|
-
extend ActiveSupport::Concern
|
7
|
-
|
8
|
-
|
9
|
-
def process_require_all_directive(path)
|
10
|
-
raise ArgumentError, "require_all argument must be a relative path" unless relative?(path)
|
11
|
-
|
12
|
-
context.environment.paths.each do |root_path|
|
13
|
-
root = Pathname.new(root_path).join(path).expand_path
|
14
|
-
|
15
|
-
if root.exist? && root.directory?
|
16
|
-
context.depend_on(root)
|
17
|
-
|
18
|
-
#Dir["#{root}/*"].sort.each do |filename|
|
19
|
-
entries(root).each do |pathname|
|
20
|
-
filename = root.join(pathname)
|
21
|
-
if filename == self.file
|
22
|
-
next
|
23
|
-
elsif context.asset_requirable?(filename)
|
24
|
-
context.require_asset(filename)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
# `require_first` requires all the files
|
32
|
-
# inside a first counter single directory.
|
33
|
-
#
|
34
|
-
# //= require_first "./ultimate/underscore"
|
35
|
-
#
|
36
|
-
def process_require_first_directive(path)
|
37
|
-
raise ArgumentError, "require_first argument must be a relative path" unless relative?(path)
|
38
|
-
|
39
|
-
context.environment.paths.each do |root_path|
|
40
|
-
root = Pathname.new(root_path).join(path).expand_path
|
41
|
-
|
42
|
-
if root.exist? && root.directory?
|
43
|
-
context.depend_on(root)
|
44
|
-
Rails.logger.info('----------')
|
45
|
-
Rails.logger.info(root)
|
46
|
-
Dir["#{root}/*"].sort.each do |filename|
|
47
|
-
if filename == self.file
|
48
|
-
next
|
49
|
-
elsif context.asset_requirable?(filename)
|
50
|
-
context.require_asset(filename)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
break
|
55
|
-
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
Sprockets::DirectiveProcessor.send :include, Ultimate::Extensions::DirectiveProcessor
|