phrasing 3.2.1 → 3.2.2

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.
@@ -42,6 +42,12 @@ feature "use #phrase" do
42
42
  page.should_not have_content '<strong>Strong header</strong>'
43
43
  page.should have_content 'Strong header'
44
44
  end
45
+
46
+ it 'allows to use scope like I18n' do
47
+ visit root_path
48
+ page.should have_content 'models.errors.test'
49
+ page.should have_content 'site.test'
50
+ end
45
51
  end
46
52
 
47
53
  feature "locales" do
@@ -77,14 +83,12 @@ feature "yaml" do
77
83
  it "same as keys" do
78
84
  visit root_path
79
85
  PhrasingPhrase.find_by_key('site.index.intro').value.should == 'site.index.intro'
80
- PhrasingPhrase.count.should == 3
81
86
  end
82
87
 
83
88
  it "same as translations in the yaml file" do
84
89
  visit root_path
85
90
  PhrasingPhrase.find_by_key('site.index.header').value.should == 'The Header'
86
91
  PhrasingPhrase.find_by_key('site.index.footer').value.should == 'The Footer'
87
- PhrasingPhrase.count.should == 3
88
92
  end
89
93
 
90
94
  end
@@ -1,7 +1,45 @@
1
1
  #encoding: utf-8
2
-
3
2
  require 'spec_helper'
3
+ require 'pry-debugger'
4
+
5
+ feature 'edit mode bubble' do
6
+
7
+ before do
8
+ visit root_path
9
+ end
10
+
11
+ it '(un)check edit mode checkbox' do
12
+ edit_mode_checkbox = find(:css, ".onoffswitch-checkbox")
13
+ edit_mode_checkbox.should be_checked
14
+ edit_mode_checkbox.set(false)
15
+ edit_mode_checkbox.should_not be_checked
16
+ end
17
+
18
+ it "phrases should have class 'phrasable_on' and contenteditable=true" do
19
+ page.find('.header').first('.phrasable').text.should == 'The Header'
20
+ page.find('.header').first('.phrasable')['class'].should == 'phrasable phrasable_on'
21
+ page.find('.header').first('.phrasable')['contenteditable'].should == 'true'
22
+ end
4
23
 
24
+ it 'should be able to visit phrasing index via edit_all icon' do
25
+ find(:css, ".phrasing-edit-all-phrases-link").click
26
+ current_path.should == phrasing_phrases_path
27
+ end
28
+
29
+ xit "phrases should have class shouldn't have class phrasable on when edit mode is off", js: true do
30
+ edit_mode_checkbox = find(:css, ".onoffswitch-checkbox")
31
+ edit_mode_checkbox.click
32
+ page.find('.header').first('.phrasable')['class'].should == 'phrasable'
33
+ end
34
+
35
+ xit 'edit phrases', js: true do
36
+ header_phrase = page.find('.header').first('.phrasable')
37
+ header_phrase['class'].should == 'phrasable phrasable_on'
38
+ header_phrase.text.should == 'The Header'
39
+ header_phrase.set "content"
40
+ header_phrase.text.should == 'content'
41
+ end
42
+ end
5
43
 
6
44
  feature "phrasing index" do
7
45
 
@@ -63,6 +101,14 @@ feature "phrasing index" do
63
101
  page.should have_content 'foe'
64
102
  end
65
103
 
104
+ it 'not null values first, global order by key' do
105
+ FactoryGirl.create(:phrasing_phrase, key: "foo1", value: nil)
106
+ FactoryGirl.create(:phrasing_phrase, key: "foo2", value: "beer")
107
+ FactoryGirl.create(:phrasing_phrase, key: "foo3", value: nil)
108
+ visit phrasing_phrases_path
109
+ page.body.should =~ /foo[\s\S]*foo2[\s\S]*foo1[\s\S]*foo3/
110
+ end
111
+
66
112
  context "more than one locale" do
67
113
 
68
114
  before do
@@ -174,6 +220,9 @@ feature "phrasing edit" do
174
220
  FactoryGirl.create(:phrasing_phrase, :key => "foo", :value => "bar")
175
221
  visit phrasing_phrases_path
176
222
  end
223
+ after do
224
+ PhrasingPhrase.delete_all
225
+ end
177
226
 
178
227
  scenario "visit edit form" do
179
228
  fill_in 'search', :with => 'foo'
@@ -204,6 +253,9 @@ end
204
253
  feature "downloading and uploading yaml files" do
205
254
  before do
206
255
  end
256
+ after do
257
+ PhrasingPhrase.delete_all
258
+ end
207
259
 
208
260
  it "round-trips the YAML" do
209
261
  FactoryGirl.create(:phrasing_phrase, :key => "a.foo1", :value => "bar1")
@@ -276,7 +328,9 @@ end
276
328
  feature "locales" do
277
329
  before do
278
330
  end
279
-
331
+ after do
332
+ PhrasingPhrase.delete_all
333
+ end
280
334
  it "imports yaml containing multiple locales" do
281
335
  file = Tempfile.new 'phrasing'
282
336
  file.write <<-YAML
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phrasing
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.2.2
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Tomislav Car
@@ -9,104 +10,134 @@ authors:
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2014-01-29 00:00:00.000000000 Z
13
+ date: 2014-02-20 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: rails
16
17
  requirement: !ruby/object:Gem::Requirement
18
+ none: false
17
19
  requirements:
18
- - - '>='
20
+ - - ! '>='
19
21
  - !ruby/object:Gem::Version
20
22
  version: 3.1.0
21
23
  type: :runtime
22
24
  prerelease: false
23
25
  version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
24
27
  requirements:
25
- - - '>='
28
+ - - ! '>='
26
29
  - !ruby/object:Gem::Version
27
30
  version: 3.1.0
28
31
  - !ruby/object:Gem::Dependency
29
32
  name: railties
30
33
  requirement: !ruby/object:Gem::Requirement
34
+ none: false
31
35
  requirements:
32
- - - '>='
36
+ - - ! '>='
33
37
  - !ruby/object:Gem::Version
34
38
  version: '3.1'
35
39
  type: :runtime
36
40
  prerelease: false
37
41
  version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
38
43
  requirements:
39
- - - '>='
44
+ - - ! '>='
40
45
  - !ruby/object:Gem::Version
41
46
  version: '3.1'
42
47
  - !ruby/object:Gem::Dependency
43
48
  name: haml-rails
44
49
  requirement: !ruby/object:Gem::Requirement
50
+ none: false
45
51
  requirements:
46
- - - '>='
52
+ - - ! '>='
47
53
  - !ruby/object:Gem::Version
48
54
  version: '0'
49
55
  type: :runtime
50
56
  prerelease: false
51
57
  version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
52
59
  requirements:
53
- - - '>='
60
+ - - ! '>='
54
61
  - !ruby/object:Gem::Version
55
62
  version: '0'
56
63
  - !ruby/object:Gem::Dependency
57
64
  name: jquery-rails
58
65
  requirement: !ruby/object:Gem::Requirement
66
+ none: false
59
67
  requirements:
60
- - - '>='
68
+ - - ! '>='
61
69
  - !ruby/object:Gem::Version
62
70
  version: '0'
63
71
  type: :runtime
64
72
  prerelease: false
65
73
  version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
66
75
  requirements:
67
- - - '>='
76
+ - - ! '>='
68
77
  - !ruby/object:Gem::Version
69
78
  version: '0'
70
79
  - !ruby/object:Gem::Dependency
71
80
  name: jquery-cookie-rails
72
81
  requirement: !ruby/object:Gem::Requirement
82
+ none: false
73
83
  requirements:
74
- - - '>='
84
+ - - ! '>='
75
85
  - !ruby/object:Gem::Version
76
86
  version: '0'
77
87
  type: :runtime
78
88
  prerelease: false
79
89
  version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
80
91
  requirements:
81
- - - '>='
92
+ - - ! '>='
82
93
  - !ruby/object:Gem::Version
83
94
  version: '0'
84
95
  - !ruby/object:Gem::Dependency
85
96
  name: sass
86
97
  requirement: !ruby/object:Gem::Requirement
98
+ none: false
87
99
  requirements:
88
- - - '>='
100
+ - - ! '>='
89
101
  - !ruby/object:Gem::Version
90
102
  version: '0'
91
103
  type: :runtime
92
104
  prerelease: false
93
105
  version_requirements: !ruby/object:Gem::Requirement
106
+ none: false
94
107
  requirements:
95
- - - '>='
108
+ - - ! '>='
96
109
  - !ruby/object:Gem::Version
97
110
  version: '0'
98
111
  - !ruby/object:Gem::Dependency
99
112
  name: pry-debugger
100
113
  requirement: !ruby/object:Gem::Requirement
114
+ none: false
101
115
  requirements:
102
- - - '>='
116
+ - - ! '>='
103
117
  - !ruby/object:Gem::Version
104
118
  version: '0'
105
119
  type: :development
106
120
  prerelease: false
107
121
  version_requirements: !ruby/object:Gem::Requirement
122
+ none: false
108
123
  requirements:
109
- - - '>='
124
+ - - ! '>='
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
127
+ - !ruby/object:Gem::Dependency
128
+ name: jasmine-rails
129
+ requirement: !ruby/object:Gem::Requirement
130
+ none: false
131
+ requirements:
132
+ - - ! '>='
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
135
+ type: :development
136
+ prerelease: false
137
+ version_requirements: !ruby/object:Gem::Requirement
138
+ none: false
139
+ requirements:
140
+ - - ! '>='
110
141
  - !ruby/object:Gem::Version
111
142
  version: '0'
112
143
  description: Phrasing!
@@ -128,7 +159,6 @@ files:
128
159
  - app/assets/fonts/icomoon.woff
129
160
  - app/assets/images/phrasing_icon_edit_all.png
130
161
  - app/assets/javascripts/editor.js
131
- - app/assets/javascripts/head.js
132
162
  - app/assets/javascripts/phrasing.js.erb
133
163
  - app/assets/javascripts/phrasing_engine.js
134
164
  - app/assets/stylesheets/phrasing.css.scss
@@ -210,25 +240,27 @@ files:
210
240
  homepage: http://github.com/infinum/phrasing
211
241
  licenses:
212
242
  - MIT
213
- metadata: {}
214
243
  post_install_message:
215
244
  rdoc_options: []
216
245
  require_paths:
217
246
  - lib
218
247
  required_ruby_version: !ruby/object:Gem::Requirement
248
+ none: false
219
249
  requirements:
220
- - - '>='
250
+ - - ! '>='
221
251
  - !ruby/object:Gem::Version
222
252
  version: '0'
223
253
  required_rubygems_version: !ruby/object:Gem::Requirement
254
+ none: false
224
255
  requirements:
225
- - - '>='
256
+ - - ! '>='
226
257
  - !ruby/object:Gem::Version
227
258
  version: '0'
228
259
  requirements: []
229
260
  rubyforge_project:
230
- rubygems_version: 2.1.5
261
+ rubygems_version: 1.8.23
231
262
  signing_key:
232
- specification_version: 4
263
+ specification_version: 3
233
264
  summary: Edit phrases inline for Rails applications!
234
265
  test_files: []
266
+ has_rdoc:
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: c7efc7bcebc790fc33dc2ad4a7364d2bd08b7d35
4
- data.tar.gz: aeba9e1bb51923ad1bc3237378cc5806a15c5ff2
5
- SHA512:
6
- metadata.gz: 25e0c5c1a418044a56c768eb831ac06b18d1293632d1c216734cdde54c0a3ee041ba7492e978ea9086468c7f379721fa8d5833b54b0838210c2519666d8f0c14
7
- data.tar.gz: e8d102720009260e083de23a020f26b315ceb64c486349f03a5b45cf6c43f8d31ff280bfd85db1824fac3016d54428cb3215f901d2ff3dcbbdaee467dde36dca
@@ -1,423 +0,0 @@
1
- (function (a, w) {
2
- function f(a) {
3
- p[p.length] = a
4
- }
5
-
6
- function m(a) {
7
- q.className = q.className.replace(RegExp("\\b" + a + "\\b"), "")
8
- }
9
-
10
- function k(a, d) {
11
- for (var b = 0, c = a.length; b < c; b++) d.call(a, a[b], b)
12
- }
13
-
14
- function s() {
15
- q.className = q.className.replace(/ (w-|eq-|gt-|gte-|lt-|lte-|portrait|no-portrait|landscape|no-landscape)\d+/g, "");
16
- var b = a.innerWidth || q.clientWidth,
17
- d = a.outerWidth || a.screen.width;
18
- h.screen.innerWidth = b;
19
- h.screen.outerWidth = d;
20
- f("w-" + b);
21
- k(c.screens, function (a) {
22
- b > a ? (c.screensCss.gt && f("gt-" + a), c.screensCss.gte && f("gte-" +
23
- a)) : b < a ? (c.screensCss.lt && f("lt-" + a), c.screensCss.lte && f("lte-" + a)) : b === a && (c.screensCss.lte && f("lte-" + a), c.screensCss.eq && f("e-q" + a), c.screensCss.gte && f("gte-" + a))
24
- });
25
- var d = a.innerHeight || q.clientHeight,
26
- g = a.outerHeight || a.screen.height;
27
- h.screen.innerHeight = d;
28
- h.screen.outerHeight = g;
29
- h.feature("portrait", d > b);
30
- h.feature("landscape", d < b)
31
- }
32
-
33
- function r() {
34
- a.clearTimeout(u);
35
- u = a.setTimeout(s, 100)
36
- }
37
- var n = a.document,
38
- g = a.navigator,
39
- t = a.location,
40
- q = n.documentElement,
41
- p = [],
42
- c = {
43
- screens: [240, 320, 480, 640, 768, 800, 1024, 1280,
44
- 1440, 1680, 1920
45
- ],
46
- screensCss: {
47
- gt: !0,
48
- gte: !1,
49
- lt: !0,
50
- lte: !1,
51
- eq: !1
52
- },
53
- browsers: [{
54
- ie: {
55
- min: 6,
56
- max: 10
57
- }
58
- }],
59
- browserCss: {
60
- gt: !0,
61
- gte: !1,
62
- lt: !0,
63
- lte: !1,
64
- eq: !0
65
- },
66
- section: "-section",
67
- page: "-page",
68
- head: "head"
69
- };
70
- if (a.head_conf)
71
- for (var b in a.head_conf) a.head_conf[b] !== w && (c[b] = a.head_conf[b]);
72
- var h = a[c.head] = function () {
73
- h.ready.apply(null, arguments)
74
- };
75
- h.feature = function (a, b, c) {
76
- if (!a) return q.className += " " + p.join(" "), p = [], h;
77
- "[object Function]" === Object.prototype.toString.call(b) && (b = b.call());
78
- f((b ? "" : "no-") + a);
79
- h[a] = !! b;
80
- c || (m("no-" +
81
- a), m(a), h.feature());
82
- return h
83
- };
84
- h.feature("js", !0);
85
- b = g.userAgent.toLowerCase();
86
- g = /mobile|midp/.test(b);
87
- h.feature("mobile", g, !0);
88
- h.feature("desktop", !g, !0);
89
- b = /(chrome|firefox)[ \/]([\w.]+)/.exec(b) || /(iphone|ipad|ipod)(?:.*version)?[ \/]([\w.]+)/.exec(b) || /(android)(?:.*version)?[ \/]([\w.]+)/.exec(b) || /(webkit|opera)(?:.*version)?[ \/]([\w.]+)/.exec(b) || /(msie) ([\w.]+)/.exec(b) || [];
90
- g = b[1];
91
- b = parseFloat(b[2]);
92
- switch (g) {
93
- case "msie":
94
- g = "ie";
95
- b = n.documentMode || b;
96
- break;
97
- case "firefox":
98
- g = "ff";
99
- break;
100
- case "ipod":
101
- case "ipad":
102
- case "iphone":
103
- g =
104
- "ios";
105
- break;
106
- case "webkit":
107
- g = "safari"
108
- }
109
- h.browser = {
110
- name: g,
111
- version: b
112
- };
113
- h.browser[g] = !0;
114
- for (var v = 0, x = c.browsers.length; v < x; v++)
115
- for (var i in c.browsers[v])
116
- if (g === i) {
117
- f(i);
118
- for (var A = c.browsers[v][i].max, l = c.browsers[v][i].min; l <= A; l++) b > l ? (c.browserCss.gt && f("gt-" + i + l), c.browserCss.gte && f("gte-" + i + l)) : b < l ? (c.browserCss.lt && f("lt-" + i + l), c.browserCss.lte && f("lte-" + i + l)) : b === l && (c.browserCss.lte && f("lte-" + i + l), c.browserCss.eq && f("eq-" + i + l), c.browserCss.gte && f("gte-" + i + l))
119
- } else f("no-" + i);
120
- "ie" === g && 9 > b && k("abbr article aside audio canvas details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),
121
- function (a) {
122
- n.createElement(a)
123
- });
124
- k(t.pathname.split("/"), function (a, b) {
125
- if (2 < this.length && this[b + 1] !== w) b && f(this.slice(1, b + 1).join("-").toLowerCase() + c.section);
126
- else {
127
- var g = a || "index",
128
- h = g.indexOf(".");
129
- 0 < h && (g = g.substring(0, h));
130
- q.id = g.toLowerCase() + c.page;
131
- b || f("root" + c.section)
132
- }
133
- });
134
- h.screen = {
135
- height: a.screen.height,
136
- width: a.screen.width
137
- };
138
- s();
139
- var u = 0;
140
- a.addEventListener ? a.addEventListener("resize", r, !1) : a.attachEvent("onresize", r)
141
- })(window);
142
- (function (a, w) {
143
- function f(a) {
144
- var f = a.charAt(0).toUpperCase() + a.substr(1),
145
- a = (a + " " + r.join(f + " ") + f).split(" "),
146
- c;
147
- a: {
148
- for (c in a)
149
- if (k[a[c]] !== w) {
150
- c = !0;
151
- break a
152
- }
153
- c = !1
154
- }
155
- return !!c
156
- }
157
- var m = a.document.createElement("i"),
158
- k = m.style,
159
- s = " -o- -moz- -ms- -webkit- -khtml- ".split(" "),
160
- r = ["Webkit", "Moz", "O", "ms", "Khtml"],
161
- n = a[a.head_conf && a.head_conf.head || "head"],
162
- g = {
163
- gradient: function () {
164
- k.cssText = ("background-image:" + s.join("gradient(linear,left top,right bottom,from(#9f9),to(#fff));background-image:") + s.join("linear-gradient(left top,#eee,#fff);background-image:")).slice(0, -17);
165
- return !!k.backgroundImage
166
- },
167
- rgba: function () {
168
- k.cssText = "background-color:rgba(0,0,0,0.5)";
169
- return !!k.backgroundColor
170
- },
171
- opacity: function () {
172
- return "" === m.style.opacity
173
- },
174
- textshadow: function () {
175
- return "" === k.textShadow
176
- },
177
- multiplebgs: function () {
178
- k.cssText = "background:url(//:),url(//:),red url(//:)";
179
- return /(url\s*\(.*?){3}/.test(k.background)
180
- },
181
- boxshadow: function () {
182
- return f("boxShadow")
183
- },
184
- borderimage: function () {
185
- return f("borderImage")
186
- },
187
- borderradius: function () {
188
- return f("borderRadius")
189
- },
190
- cssreflections: function () {
191
- return f("boxReflect")
192
- },
193
- csstransforms: function () {
194
- return f("transform")
195
- },
196
- csstransitions: function () {
197
- return f("transition")
198
- },
199
- touch: function () {
200
- return "ontouchstart" in a
201
- },
202
- retina: function () {
203
- return 1 < a.devicePixelRatio
204
- },
205
- fontface: function () {
206
- var a = n.browser.version;
207
- switch (n.browser.name) {
208
- case "ie":
209
- return 9 <= a;
210
- case "chrome":
211
- return 13 <= a;
212
- case "ff":
213
- return 6 <= a;
214
- case "ios":
215
- return 5 <= a;
216
- case "android":
217
- return !1;
218
- case "webkit":
219
- return 5.1 <= a;
220
- case "opera":
221
- return 10 <= a;
222
- default:
223
- return !1
224
- }
225
- }
226
- }, t;
227
- for (t in g) g[t] && n.feature(t, g[t].call(), !0);
228
- n.feature()
229
- })(window);
230
- (function (a, w) {
231
- function f() {}
232
-
233
- function m(j, a) {
234
- if (j) {
235
- "object" === typeof j && (j = [].slice.call(j));
236
- for (var b = 0, c = j.length; b < c; b++) a.call(j, j[b], b)
237
- }
238
- }
239
-
240
- function k(a, b) {
241
- var e = Object.prototype.toString.call(b).slice(8, -1);
242
- return b !== w && null !== b && e === a
243
- }
244
-
245
- function s(a) {
246
- return k("Function", a)
247
- }
248
-
249
- function r(a) {
250
- a = a || f;
251
- a._done || (a(), a._done = 1)
252
- }
253
-
254
- function n(a) {
255
- var b = {};
256
- if ("object" === typeof a)
257
- for (var e in a) a[e] && (b = {
258
- name: e,
259
- url: a[e]
260
- });
261
- else b = a.split("/"), b = b[b.length - 1], e = b.indexOf("?"), b = {
262
- name: -1 !== e ? b.substring(0, e) : b,
263
- url: a
264
- };
265
- return (a = i[b.name]) && a.url === b.url ? a : i[b.name] = b
266
- }
267
-
268
- function g(a) {
269
- var a = a || i,
270
- b;
271
- for (b in a)
272
- if (a.hasOwnProperty(b) && a[b].state !== y) return !1;
273
- return !0
274
- }
275
-
276
- function t(a, b) {
277
- b = b || f;
278
- a.state === y ? b() : a.state === D ? d.ready(a.name, b) : a.state === C ? a.onpreload.push(function () {
279
- t(a, b)
280
- }) : (a.state = D, q(a, function () {
281
- a.state = y;
282
- b();
283
- m(x[a.name], function (a) {
284
- r(a)
285
- });
286
- u && g() && m(x.ALL, function (a) {
287
- r(a)
288
- })
289
- }))
290
- }
291
-
292
- function q(j, c) {
293
- var c = c || f,
294
- e;
295
- /\.css[^\.]*$/.test(j.url) ? (e = b.createElement("link"), e.type = "text/" + (j.type || "css"), e.rel = "stylesheet",
296
- e.href = j.url) : (e = b.createElement("script"), e.type = "text/" + (j.type || "javascript"), e.src = j.url);
297
- e.onload = e.onreadystatechange = function (j) {
298
- j = j || a.event;
299
- if ("load" === j.type || /loaded|complete/.test(e.readyState) && (!b.documentMode || 9 > b.documentMode)) e.onload = e.onreadystatechange = e.onerror = null, c()
300
- };
301
- e.onerror = function () {
302
- e.onload = e.onreadystatechange = e.onerror = null;
303
- c()
304
- };
305
- e.async = !1;
306
- e.defer = !1;
307
- var d = b.head || b.getElementsByTagName("head")[0];
308
- d.insertBefore(e, d.lastChild)
309
- }
310
-
311
- function p() {
312
- b.body ? u || (u = !0, m(h, function (a) {
313
- r(a)
314
- })) :
315
- (a.clearTimeout(d.readyTimeout), d.readyTimeout = a.setTimeout(p, 50))
316
- }
317
-
318
- function c() {
319
- b.addEventListener ? (b.removeEventListener("DOMContentLoaded", c, !1), p()) : "complete" === b.readyState && (b.detachEvent("onreadystatechange", c), p())
320
- }
321
- var b = a.document,
322
- h = [],
323
- v = [],
324
- x = {}, i = {}, A = "async" in b.createElement("script") || "MozAppearance" in b.documentElement.style || a.opera,
325
- l, u, B = a.head_conf && a.head_conf.head || "head",
326
- d = a[B] = a[B] || function () {
327
- d.ready.apply(null, arguments)
328
- }, C = 1,
329
- D = 3,
330
- y = 4;
331
- d.load = A ? function () {
332
- var a = arguments,
333
- b = a[a.length -
334
- 1],
335
- e = {};
336
- s(b) || (b = null);
337
- m(a, function (c, d) {
338
- c !== b && (c = n(c), e[c.name] = c, t(c, b && d === a.length - 2 ? function () {
339
- g(e) && r(b)
340
- } : null))
341
- });
342
- return d
343
- } : function () {
344
- var a = arguments,
345
- b = [].slice.call(a, 1),
346
- c = b[0];
347
- if (!l) return v.push(function () {
348
- d.load.apply(null, a)
349
- }), d;
350
- c ? (m(b, function (a) {
351
- if (!s(a)) {
352
- var b = n(a);
353
- b.state === w && (b.state = C, b.onpreload = [], q({
354
- url: b.url,
355
- type: "cache"
356
- }, function () {
357
- b.state = 2;
358
- m(b.onpreload, function (a) {
359
- a.call()
360
- })
361
- }))
362
- }
363
- }), t(n(a[0]), s(c) ? c : function () {
364
- d.load.apply(null, b)
365
- })) : t(n(a[0]));
366
- return d
367
- };
368
- d.js = d.load;
369
- d.test =
370
- function (a, b, c, g) {
371
- a = "object" === typeof a ? a : {
372
- test: a,
373
- success: b ? k("Array", b) ? b : [b] : !1,
374
- failure: c ? k("Array", c) ? c : [c] : !1,
375
- callback: g || f
376
- };
377
- (b = !! a.test) && a.success ? (a.success.push(a.callback), d.load.apply(null, a.success)) : !b && a.failure ? (a.failure.push(a.callback), d.load.apply(null, a.failure)) : g();
378
- return d
379
- };
380
- d.ready = function (a, c) {
381
- if (a === b) return u ? r(c) : h.push(c), d;
382
- s(a) && (c = a, a = "ALL");
383
- if ("string" !== typeof a || !s(c)) return d;
384
- var e = i[a];
385
- if (e && e.state === y || "ALL" === a && g() && u) return r(c), d;
386
- (e = x[a]) ? e.push(c) : x[a] = [c];
387
- return d
388
- };
389
- d.ready(b, function () {
390
- g() && m(x.ALL, function (a) {
391
- r(a)
392
- });
393
- d.feature && d.feature("domloaded", !0)
394
- });
395
- if ("complete" === b.readyState) p();
396
- else if (b.addEventListener) b.addEventListener("DOMContentLoaded", c, !1), a.addEventListener("load", p, !1);
397
- else {
398
- b.attachEvent("onreadystatechange", c);
399
- a.attachEvent("onload", p);
400
- var z = !1;
401
- try {
402
- z = null == a.frameElement && b.documentElement
403
- } catch (F) {}
404
- z && z.doScroll && function E() {
405
- if (!u) {
406
- try {
407
- z.doScroll("left")
408
- } catch (b) {
409
- a.clearTimeout(d.readyTimeout);
410
- d.readyTimeout = a.setTimeout(E, 50);
411
- return
412
- }
413
- p()
414
- }
415
- }()
416
- }
417
- setTimeout(function () {
418
- l = !0;
419
- m(v, function (a) {
420
- a()
421
- })
422
- }, 300)
423
- })(window);