xooie 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/vendor/assets/javascripts/xooie/addons/dropdown_accordion.js +38 -0
- data/vendor/assets/javascripts/xooie/addons/tab_automation.js +150 -0
- data/vendor/assets/javascripts/xooie/base.js +217 -0
- data/vendor/assets/javascripts/xooie/carousel.js +400 -0
- data/vendor/assets/javascripts/xooie/dialog.js +161 -0
- data/vendor/assets/javascripts/xooie/dropdown.js +285 -0
- data/vendor/assets/javascripts/xooie/event_handler.js +7 -4
- data/vendor/assets/javascripts/xooie/helpers.js +6 -50
- data/vendor/assets/javascripts/xooie/polyfill.js +49 -0
- data/vendor/assets/javascripts/xooie/shared.js +1 -1
- data/vendor/assets/javascripts/xooie/stylesheet.js +9 -32
- data/vendor/assets/javascripts/xooie/tab.js +125 -0
- data/vendor/assets/javascripts/xooie/widgets/carousel.js +1 -1
- data/vendor/assets/javascripts/xooie/xooie.js +1 -1
- data/vendor/assets/javascripts/xooie.js +169 -0
- metadata +11 -2
@@ -0,0 +1,169 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2012 Comcast
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
var $X, Xooie;
|
18
|
+
|
19
|
+
$X = Xooie = (function(static_config) {
|
20
|
+
var config = {
|
21
|
+
modules: {},
|
22
|
+
addons: {}
|
23
|
+
},
|
24
|
+
obj = function() {
|
25
|
+
return false;
|
26
|
+
},
|
27
|
+
gcTimer = null;
|
28
|
+
|
29
|
+
function copyObj(dst, src) {
|
30
|
+
var name;
|
31
|
+
|
32
|
+
for (name in src) {
|
33
|
+
if (src.hasOwnProperty(name)) {
|
34
|
+
dst[name] = src[name];
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
function gcCallback() {
|
40
|
+
if (typeof Xooie.garbageCollect !== 'undefined') {
|
41
|
+
Xooie.garbageCollect();
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
obj.config = function(cfg) {
|
46
|
+
var name;
|
47
|
+
|
48
|
+
for (name in cfg) {
|
49
|
+
if (cfg.hasOwnProperty(name)) {
|
50
|
+
if (name === 'modules' || name == 'addons') {
|
51
|
+
copyObj(config[name], cfg[name]);
|
52
|
+
} else {
|
53
|
+
config[name] = cfg[name];
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
if (typeof cfg.gcInterval !== 'undefined') {
|
59
|
+
if (config.gcInterval) {
|
60
|
+
gcTimer = setInterval(gcCallback, config.gcInterval);
|
61
|
+
} else {
|
62
|
+
if (gcTimer) {
|
63
|
+
clearInterval(gcTimer);
|
64
|
+
}
|
65
|
+
gcTimer = null;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
};
|
69
|
+
|
70
|
+
obj.mapName = function(name, type, root) {
|
71
|
+
if (typeof config[type][name] === 'undefined') {
|
72
|
+
return root + name;
|
73
|
+
} else {
|
74
|
+
return config[type][name];
|
75
|
+
}
|
76
|
+
};
|
77
|
+
|
78
|
+
obj.config({
|
79
|
+
gcInterval: 0
|
80
|
+
});
|
81
|
+
|
82
|
+
if (static_config) {
|
83
|
+
obj.config(static_config);
|
84
|
+
}
|
85
|
+
|
86
|
+
return obj;
|
87
|
+
}(Xooie));
|
88
|
+
|
89
|
+
define('xooie', ['jquery'], function($){
|
90
|
+
var config = Xooie.config,
|
91
|
+
mapName = Xooie.mapName,
|
92
|
+
loadedModules = {};
|
93
|
+
|
94
|
+
$X = Xooie = function(element){
|
95
|
+
element = $(element);
|
96
|
+
|
97
|
+
var widgetElements = element.find('[data-widget-type]');
|
98
|
+
|
99
|
+
if (element.is('[data-widget-type]')){
|
100
|
+
widgetElements = widgetElements.add(element);
|
101
|
+
}
|
102
|
+
|
103
|
+
widgetElements.each(function(){
|
104
|
+
var node = $(this),
|
105
|
+
module_name,
|
106
|
+
types = node.data('widgetType').split(/\s+/),
|
107
|
+
require_handler = function(Widget) {
|
108
|
+
new Widget(node);
|
109
|
+
};
|
110
|
+
|
111
|
+
for (var i = 0; i < types.length; i++) {
|
112
|
+
module_name = $X.mapName(types[i], 'modules', 'xooie/');
|
113
|
+
|
114
|
+
$X._requireShim(module_name, require_handler);
|
115
|
+
}
|
116
|
+
});
|
117
|
+
};
|
118
|
+
|
119
|
+
Xooie.config = config;
|
120
|
+
Xooie.mapName = mapName;
|
121
|
+
|
122
|
+
Xooie._requireShim = function(module, callback) {
|
123
|
+
var moduleSpec;
|
124
|
+
|
125
|
+
if (typeof loadedModules[module] === 'undefined') {
|
126
|
+
moduleSpec = loadedModules[module] = {
|
127
|
+
content: null,
|
128
|
+
loaded: false,
|
129
|
+
callbacks: []
|
130
|
+
};
|
131
|
+
|
132
|
+
require([module], function(Module) {
|
133
|
+
var i;
|
134
|
+
|
135
|
+
moduleSpec.content = Module;
|
136
|
+
moduleSpec.loaded = true;
|
137
|
+
|
138
|
+
for (i = 0; i < moduleSpec.callbacks.length; i++) {
|
139
|
+
moduleSpec.callbacks[i](Module);
|
140
|
+
}
|
141
|
+
|
142
|
+
moduleSpec.callbacks = [];
|
143
|
+
});
|
144
|
+
} else {
|
145
|
+
moduleSpec = loadedModules[module];
|
146
|
+
}
|
147
|
+
|
148
|
+
if (moduleSpec.loaded) {
|
149
|
+
callback(moduleSpec.content);
|
150
|
+
} else {
|
151
|
+
moduleSpec.callbacks.push(callback);
|
152
|
+
}
|
153
|
+
};
|
154
|
+
|
155
|
+
Xooie.registeredClasses = [];
|
156
|
+
Xooie.garbageCollect = function() {
|
157
|
+
for (var i = 0; i < this.registeredClasses.length; i++) {
|
158
|
+
this.registeredClasses[i].garbageCollect();
|
159
|
+
}
|
160
|
+
};
|
161
|
+
|
162
|
+
return Xooie;
|
163
|
+
});
|
164
|
+
|
165
|
+
require(['jquery', 'xooie'], function($, $X){
|
166
|
+
$(document).ready(function() {
|
167
|
+
$X($(this));
|
168
|
+
});
|
169
|
+
});
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: xooie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.0.
|
5
|
+
version: 1.0.7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Andrew Larkin
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2013-12-
|
13
|
+
date: 2013-12-19 00:00:00 Z
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description: A highly modular, extensible JavaScript UI framework.
|
@@ -22,16 +22,25 @@ extensions: []
|
|
22
22
|
extra_rdoc_files: []
|
23
23
|
|
24
24
|
files:
|
25
|
+
- vendor/assets/javascripts/xooie.js
|
26
|
+
- vendor/assets/javascripts/xooie/base.js
|
27
|
+
- vendor/assets/javascripts/xooie/carousel.js
|
28
|
+
- vendor/assets/javascripts/xooie/dialog.js
|
29
|
+
- vendor/assets/javascripts/xooie/dropdown.js
|
25
30
|
- vendor/assets/javascripts/xooie/event_handler.js
|
26
31
|
- vendor/assets/javascripts/xooie/helpers.js
|
27
32
|
- vendor/assets/javascripts/xooie/keyboard_navigation.js
|
33
|
+
- vendor/assets/javascripts/xooie/polyfill.js
|
28
34
|
- vendor/assets/javascripts/xooie/shared.js
|
29
35
|
- vendor/assets/javascripts/xooie/stylesheet.js
|
36
|
+
- vendor/assets/javascripts/xooie/tab.js
|
30
37
|
- vendor/assets/javascripts/xooie/xooie.js
|
31
38
|
- vendor/assets/javascripts/xooie/addons/base.js
|
32
39
|
- vendor/assets/javascripts/xooie/addons/carousel_lentils.js
|
33
40
|
- vendor/assets/javascripts/xooie/addons/carousel_pagination.js
|
41
|
+
- vendor/assets/javascripts/xooie/addons/dropdown_accordion.js
|
34
42
|
- vendor/assets/javascripts/xooie/addons/tab_animation.js
|
43
|
+
- vendor/assets/javascripts/xooie/addons/tab_automation.js
|
35
44
|
- vendor/assets/javascripts/xooie/widgets/accordion.js
|
36
45
|
- vendor/assets/javascripts/xooie/widgets/base.js
|
37
46
|
- vendor/assets/javascripts/xooie/widgets/carousel.js
|