Master Slider – Responsive Touch Slider - Version 1.0.0

Version Description

Download this release

Release Info

Developer averta
Plugin Icon 128x128 Master Slider – Responsive Touch Slider
Version 1.0.0
Comparing to
See all releases

Version 1.0.0

Files changed (69) hide show
  1. ChangeLog.txt +4 -0
  2. LICENSE.txt +621 -0
  3. README.txt +167 -0
  4. admin/assets/css/global.css +15 -0
  5. admin/assets/css/msp-general.css +476 -0
  6. admin/assets/images/help.png +0 -0
  7. admin/assets/images/master-admin-menu.svg +16 -0
  8. admin/assets/images/misc/shortcode-in-editor.png +0 -0
  9. admin/assets/images/misc/where-is-ms-shortcode.png +0 -0
  10. admin/assets/images/slider-types/pt_custom.png +0 -0
  11. admin/assets/images/starters/autoplay-slider.jpg +0 -0
  12. admin/assets/images/starters/fullwidth-slider-with-thumbs.jpg +0 -0
  13. admin/assets/images/starters/fullwidth-slider.jpg +0 -0
  14. admin/assets/images/starters/simple-slider.jpg +0 -0
  15. admin/assets/images/starters/slider-with-horizontal-thumbs.jpg +0 -0
  16. admin/assets/images/starters/slider-with-slide-info-v2.jpg +0 -0
  17. admin/assets/images/starters/slider-with-slide-info.jpg +0 -0
  18. admin/assets/images/starters/slider-with-vertical-thumbs.jpg +0 -0
  19. admin/assets/images/thirdparty/master-slider-32x32.png +0 -0
  20. admin/assets/js/admin.js +285 -0
  21. admin/assets/js/index.php +1 -0
  22. admin/class-master-slider-admin.php +276 -0
  23. admin/includes/classes/class-axiom-list-table.php +966 -0
  24. admin/includes/classes/class-axiom-screen-help.php +102 -0
  25. admin/includes/classes/class-msp-admin-ajax.php +155 -0
  26. admin/includes/classes/class-msp-admin-assets.php +360 -0
  27. admin/includes/classes/class-msp-importer.php +786 -0
  28. admin/includes/classes/class-msp-list-table.php +200 -0
  29. admin/includes/classes/class-msp-parser.php +907 -0
  30. admin/includes/classes/class-msp-pointers.php +182 -0
  31. admin/includes/classes/class-msp-screen-help.php +160 -0
  32. admin/includes/classes/class-msp-shortcode-factory.php +142 -0
  33. admin/includes/classes/msp-admin-templates.php +13 -0
  34. admin/includes/index.php +27 -0
  35. admin/includes/msp-admin-functions.php +134 -0
  36. admin/includes/msp-admin-templates.php +13 -0
  37. admin/includes/msp-compatibility.php +31 -0
  38. admin/includes/msp-hooks.php +1 -0
  39. admin/includes/msp-sample-sliders.php +134 -0
  40. admin/views/index.php +56 -0
  41. admin/views/setting/class-msp-settings.php +174 -0
  42. admin/views/setting/class-settings-api.php +522 -0
  43. admin/views/slider-dashboard/get-preview.html +34 -0
  44. admin/views/slider-dashboard/list-sliders.php +164 -0
  45. admin/views/slider-dashboard/preview.php +71 -0
  46. admin/views/slider-panel/css/codemirror.css +264 -0
  47. admin/views/slider-panel/css/jquery-ui-1.10.4.min.css +6 -0
  48. admin/views/slider-panel/css/jquery.jscrollpane.css +115 -0
  49. admin/views/slider-panel/css/msp-components.css +200 -0
  50. admin/views/slider-panel/css/msp-style.css +1132 -0
  51. admin/views/slider-panel/css/reset.css +57 -0
  52. admin/views/slider-panel/css/spectrum.css +496 -0
  53. admin/views/slider-panel/images/center.png +0 -0
  54. admin/views/slider-panel/images/fill.png +0 -0
  55. admin/views/slider-panel/images/fit.png +0 -0
  56. admin/views/slider-panel/images/help.png +0 -0
  57. admin/views/slider-panel/images/loading.gif +0 -0
  58. admin/views/slider-panel/images/masterslider.gif +0 -0
  59. admin/views/slider-panel/images/no-color.gif +0 -0
  60. admin/views/slider-panel/images/patt.png +0 -0
  61. admin/views/slider-panel/images/stretch.png +0 -0
  62. admin/views/slider-panel/images/tile.png +0 -0
  63. admin/views/slider-panel/images/ui-spritesheet.png +0 -0
  64. admin/views/slider-panel/index.php +654 -0
  65. admin/views/slider-panel/js/ember-model.min.js +5 -0
  66. admin/views/slider-panel/js/ember.min.js +19 -0
  67. admin/views/slider-panel/js/handlebars.min.js +21 -0
  68. admin/views/slider-panel/js/masterslider.wp.js +3108 -0
  69. admin/views/slider-panel/js/msp.required.js +5467 -0
ChangeLog.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
README.txt ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Master Slider - Responsive Touch Slider for WordPress ===
2
+ Contributors: averta
3
+ Donate link: http://averta.net/
4
+ License: GPLv3
5
+ License URI: http://www.gnu.org/licenses/gpl.html
6
+ Tags: banner rotator, carousel, content slider, gallery, image slider, responsive slider, showcase, slideshow, swipe, touch slider, video gallery, seo, vertical slide, HTML5 slider, hardware accelerate, css3, animation, mobile slider, iOS, video slider, yotube slider, horizontal slider, vertical slider, fullwidth slider, fullscreen slider, post slider, photo slider, online album, mobile slider, WordPress slider
7
+ Requires at least: 3.8
8
+ Tested up to: 3.9.1
9
+ Stable tag: 1.0.0
10
+
11
+ Master Slider is the most advanced responsive HTML5 WordPress slider plugin with touch swipe navigation that works smoothly on devices too.
12
+
13
+ == Description ==
14
+
15
+ - Master Slider is a free responsive image and content slider with super smooth hardware accelerated transitions. It supports touch navigation with pure swipe gesture that you have never experienced before. It's a truly responsive and device friendly slider which works perfect in all major devices.
16
+
17
+ = Strength & flexibility =
18
+ Master Slider is built using WordPress best practices both on the front and the back end. This results in an efficient, robust and intuitive plugin.
19
+
20
+ = Smart dashboard widgets & reports =
21
+ Keep a birds-eye view of incoming sales and reviews, stock levels and general store performance and statistics all from the WordPress dashboard or go to the reports section to view stats in more detail.
22
+
23
+ Master Slider works with any theme, including the default WordPress themes.
24
+
25
+
26
+ = Features =
27
+
28
+ * Responsive
29
+ * Touch Swipe Navigation
30
+ * Extremely user friendly admin panel
31
+ * Drag and drop slider creation
32
+ * Live preview in admin panel
33
+ * Smart auto crop
34
+ * Thumbnails and Tabs
35
+ * Smart Preloading
36
+ * X Starter Samples
37
+ * Cross Browser
38
+ * Light weight
39
+ * Fully Customizable
40
+ * SEO Friendly
41
+ * Hardware Accelerated Transitions
42
+ * Auto height Slider
43
+ * Loop Sliding
44
+ * Smart Memory Management
45
+ * Autoplay
46
+ * Exclusive Widget and shortcodes
47
+ * 6 modern and unique skins
48
+ * Flexible
49
+ * Advanced import/export tool
50
+ * Custom user roles
51
+ * Extremely lightweight
52
+ * Built-in cache boosting
53
+ * Translate ready
54
+ * Multisite compatible
55
+ * Extensive Developer API
56
+
57
+
58
+ = Compatible Browsers =
59
+
60
+ * IE8+
61
+ * Firefox
62
+ * Safari
63
+ * Opera
64
+ * Chrome
65
+ * iOS browser
66
+ * Android browser
67
+
68
+ = Translation =
69
+
70
+ You can start translating Master Slider by our [online translation service](http://translate.averta.net/projects/masterslider/free-version).
71
+
72
+
73
+ == Installation ==
74
+
75
+ = Minimum Requirements =
76
+
77
+ * WordPress 3.8 or greater
78
+ * PHP version 5.2.4 or greater
79
+ * MySQL version 5.0 or greater
80
+
81
+
82
+ **This section describes how to install the plugin and get it working**
83
+
84
+ This section describes how to install the plugin and get it working.
85
+
86
+
87
+ = Automatic installation (easiest way) =
88
+
89
+ To do an automatic install of Master Slider, log in to your WordPress dashboard, navigate to the Plugins menu and click Add New.
90
+
91
+ In the search field type "Master Slider" and click Search Plugins. Once you have found it you can install it by simply clicking "Install Now".
92
+
93
+
94
+ = Manual installation =
95
+
96
+ **Uploading in WordPress Dashboard**
97
+
98
+ 1. Download `ms-slider.zip`
99
+ 2. Navigate to the 'Add New' in the plugins dashboard
100
+ 3. Navigate to the 'Upload' area
101
+ 4. Select `ms-slider.zip` from your computer
102
+ 5. Click 'Install Now'
103
+ 6. Activate the plugin in the Plugin dashboard
104
+
105
+ **Using FTP**
106
+
107
+ 1. Download `ms-slider.zip`
108
+ 2. Extract the `ms-slider` directory to your computer
109
+ 3. Upload the `ms-slider` directory to the `/wp-content/plugins/` directory
110
+ 4. Activate the plugin in the Plugin dashboard
111
+
112
+ The WordPress codex contains [instructions on how to install a WordPress plugin](http://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation).
113
+
114
+
115
+
116
+ = Updating =
117
+
118
+ Automatic updates should work like a charm; as always though, ensure you backup your site just in case.
119
+
120
+
121
+ == Frequently Asked Questions ==
122
+
123
+ = Where can I find Master Slider documentation and user guides =
124
+
125
+ For help setting up and configuring Master Slider please refer to our [user guide](http://averta.net/)
126
+
127
+ For extending Master Slider, see our [codex](http://averta.net/).
128
+
129
+ If you get stuck and you're not a averta customer, you can ask for help on the [Community Forums](http://averta.net).
130
+
131
+ = Will Master Slider work with my theme? =
132
+
133
+
134
+ = Where can I request new features? =
135
+
136
+
137
+ = Where can I report bugs or contribute to the project? =
138
+
139
+ Bugs can be reported either in our support forum or preferably on
140
+
141
+ = Master Slider is awesome! Can I contribute? =
142
+
143
+
144
+
145
+ == Screenshots ==
146
+
147
+ 1. Sliders listing table
148
+ 2. Slider setting
149
+ 3. Drag and Drop slide creation
150
+ 4. 6 Highly customizable slider controls
151
+ 5. Flexible slider controls
152
+
153
+
154
+
155
+ == Changelog ==
156
+
157
+ = Version 1.8.5 / (11.06.2014) =
158
+ * [New Feature]: New option added to layer options to fix layer position
159
+ * [New Feature]: Compability with prettyPhoto lightbox added
160
+ * [Fix]: An issue with aligning slide info fixed
161
+
162
+
163
+
164
+ == Upgrade Notice ==
165
+
166
+ = 1.0.0 =
167
+ This is a major update. Test extensions and your theme prior to updating and ensure that you keep backups.
admin/assets/css/global.css ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /** masterslider admin menu icon **/
3
+ #toplevel_page_master-slider .menu-icon-generic div.wp-menu-image:before { content: ' ';}
4
+ #toplevel_page_master-slider .menu-icon-generic div.wp-menu-image {
5
+ background: url( ../images/master-admin-menu.svg ) no-repeat 7px 7px !important;
6
+ background-size: 23px auto !important;
7
+ opacity:0.6;
8
+ }
9
+ #toplevel_page_masterslider .menu-icon-generic.wp-menu-open div.wp-menu-image,
10
+ #toplevel_page_masterslider .menu-icon-generic.current div.wp-menu-image {
11
+ opacity:1;
12
+ }
13
+ /** visual composer element **/
14
+ .icon-vc-msslider-el ,
15
+ .wpb_masterslider_pb .wpb_element_wrapper { background-image: url( ../images/thirdparty/master-slider-32x32.png ) !important; }
admin/assets/css/msp-general.css ADDED
@@ -0,0 +1,476 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* This stylesheet is used to style the admin page for masterslider plugin.*/
2
+
3
+ .manage-column.column-ID {
4
+ width:50px;
5
+ }
6
+ .manage-column.column-shortcode {
7
+ width: 150px;
8
+ }
9
+ .manage-column.column-slides_num {
10
+ width:40px;
11
+ }
12
+ .manage-column.column-type {
13
+ width:100px;
14
+ }
15
+ .manage-column.column-date_modified{
16
+ width:115px;
17
+ }
18
+ .manage-column.column-date_created{
19
+ width:130px;
20
+ }
21
+ #msp-main-wrapper .wp-list-table td { vertical-align: middle; }
22
+
23
+ #msp-main-wrapper .wp-list-table .preview { float:none; }
24
+
25
+ #msp-main-wrapper .wp-list-table thead tr,
26
+ #msp-main-wrapper .wp-list-table tfoot tr { height:45px; }
27
+
28
+ #msp-main-wrapper .wp-list-table thead tr th,
29
+ #msp-main-wrapper .wp-list-table tfoot tr th,
30
+ #msp-main-wrapper .wp-list-table thead th.manage-column a,
31
+ #msp-main-wrapper .wp-list-table tfoot th.manage-column a { color:#777; }
32
+ #msp-main-wrapper .wp-list-table tbody tr { height:40px; }
33
+
34
+
35
+ .tablenav.top {
36
+ display:none;
37
+ }
38
+ .tablenav.bottom {
39
+ margin-top:12px;
40
+ position: relative;
41
+ float:right;
42
+ }
43
+
44
+ .action-btns-list {
45
+ position:relative;
46
+ margin-top: 20px;
47
+ margin-bottom: 30px;
48
+ display: inline-block;
49
+ }
50
+
51
+ .toplevel_page_masterslider .ui-widget-overlay {
52
+ z-index:39999;
53
+ }
54
+
55
+ /** add new slider button **/
56
+
57
+ .msp-ac-btn {
58
+ padding: 0px 16px;
59
+ height: 28px;
60
+ line-height: 28px;
61
+ font-size: 13px;
62
+ display: inline-block;
63
+ color: #fff;
64
+ background:#777;
65
+ border-bottom: 3px solid #656565;
66
+ margin-right: 10px;
67
+ position: relative;
68
+ font-weight: 300;
69
+ text-decoration: none;
70
+ }
71
+
72
+ .msp-ac-btn:hover {
73
+ top:1px;
74
+ color: #eee;
75
+ border-bottom-width: 2px;
76
+ }
77
+ msp-ac-btn:active {
78
+ top:2px;
79
+ color: #ddd;
80
+ border-bottom-width: 1px;
81
+ }
82
+
83
+ .action-add-new {
84
+ padding-left:0;
85
+ }
86
+
87
+ .msp-btn-blue { background-color:#2ea2cc; border-bottom-color: #278aae; }
88
+ .msp-btn-red { background-color:#cc2e2e; border-bottom-color: #ad2626; }
89
+ .msp-btn-gray { background-color:#777777; border-bottom-color: #656565; }
90
+
91
+
92
+
93
+ .msp-iconic span,
94
+ .msp-iconic-big span {
95
+ float: left;
96
+ display:block;
97
+ margin: 0;
98
+ text-align: center;
99
+ }
100
+
101
+ .msp-iconic span:before,
102
+ .msp-iconic-big span:before {
103
+ font: 400 20px/1 dashicons !important;
104
+ speak: none;
105
+ display: inline-block;
106
+ -webkit-font-smoothing: antialiased;
107
+ -moz-osx-font-smoothing: grayscale;
108
+ -moz-transition: all .1s ease-in-out;
109
+ -o-transition: all .1s ease-in-out;
110
+ -webkit-transition: all .1s ease-in-out;
111
+ transition: all .1s ease-in-out;
112
+ }
113
+
114
+ .msp-iconic {
115
+ padding-left:0;
116
+ }
117
+
118
+ .msp-iconic span {
119
+ width: 25px;
120
+ height: 27px;
121
+ margin-right: 3px;
122
+ margin-left: 4px;
123
+ }
124
+
125
+ .msp-iconic span:before {
126
+ padding: 5px 0 0 0;
127
+ height: 28px;
128
+ width: 20px;
129
+ }
130
+
131
+
132
+ .msp-iconic-big {
133
+ padding-left:0;
134
+ }
135
+
136
+ .msp-iconic-big span {
137
+ width: 30px;
138
+ height: 27px;
139
+ border-right: 1px solid white;
140
+ margin-right: 15px;
141
+ }
142
+
143
+ .msp-iconic-big span:before {
144
+ padding: 6px 0 0 0;
145
+ height: 28px;
146
+ width: 20px;
147
+ }
148
+
149
+ .action-add-new span:before {
150
+ content: '\f132';
151
+ }
152
+
153
+ .column-action .msp-ac-btn {
154
+ margin-right:1px;
155
+ }
156
+
157
+ .column-action .action-preview span:before{
158
+ content: '\f179';
159
+ }
160
+
161
+ .column-action .action-delete span:before{
162
+ content: '\f182';
163
+ }
164
+
165
+ .column-action .action-duplicate span:before{
166
+ content: '\f105';
167
+ padding-top: 6px;
168
+ }
169
+
170
+ @media only screen and (max-width: 1500px) {
171
+ .column-date_created { display:none; }
172
+
173
+ }
174
+
175
+ @media only screen and (max-width: 1350px) {
176
+ .column-date_modified { display:none; }
177
+ }
178
+
179
+ @media only screen and (max-width: 1250px) {
180
+ .column-slides_num { display:none; }
181
+ .column-ID { display:none; }
182
+ }
183
+
184
+ @media only screen and (max-width: 1150px) {
185
+ .column-type { display:none; }
186
+ }
187
+
188
+ @media only screen and (max-width: 782px) {
189
+
190
+ .tablenav.bottom {
191
+ float:none;
192
+ }
193
+
194
+ .action-btns-list {
195
+ top:-10px;
196
+ text-align:center;
197
+ display: block;
198
+ }
199
+
200
+ .action-btns-list .msp-ac-btn {
201
+ padding-top:4px;
202
+ padding-bottom:4px;
203
+ }
204
+ }
205
+
206
+ .master-updates tbody th { height:300px; }
207
+
208
+ .master-updates tbody { vertical-align: top; }
209
+
210
+ .master-updates .latest-updates { border-left:1px solid #e1e1e1; }
211
+
212
+ tbody .latest-updates {
213
+ padding: 0 0 0 5px;
214
+ }
215
+
216
+
217
+ #msp-header {
218
+ background: white;
219
+ padding:13px 15px;
220
+ margin-top: 20px;
221
+ }
222
+ .msp-logo {
223
+ line-height:100%;
224
+ }
225
+
226
+ /** slider type selector **/
227
+
228
+ #msp-slider-type-select {
229
+ display:none;
230
+ }
231
+ #msp-slider-type-select .msp-templates-list {
232
+ top:47px;
233
+ }
234
+ #msp-slider-type-select .msp-template-figure {
235
+ opacity: 1;
236
+ }
237
+ #msp-slider-type-select .msp-template-figure.is-unavailable {
238
+ opacity: 0.8;
239
+ }
240
+ #msp-slider-type-select .msp-template-figure .msp-templte-selected {
241
+ display:none;
242
+ }
243
+ #msp-slider-type-select .msp-template-figure.selected .msp-templte-selected {
244
+ display:inline-block;
245
+ }
246
+
247
+ .msp-metabox-hr { clear:both; }
248
+
249
+ #msp-slider-type-select .msp-template-figure {
250
+ width: 18%;
251
+ }
252
+ #msp-slider-type-select .msp-templates-list .msp-metabox-hr {
253
+ padding-bottom: 40px;
254
+ }
255
+
256
+ #msp-slider-type-select .msp-dialog-inner-title {
257
+ border-bottom: 1px solid #e5e5e5;
258
+ padding: 5px 0 0;
259
+ margin: 10px 20px 10px;
260
+ }
261
+
262
+ #msp-slider-type-select .msp-dialog-inner-title span {
263
+ font-size: 18px;
264
+ color: #666;
265
+ position: relative;
266
+ bottom: -9px;
267
+ background: #fff;
268
+ padding: 0 10px 0 0;
269
+ }
270
+
271
+ #msp-slider-type-select .section-divider {
272
+ padding-top: 30px;
273
+ clear:both;
274
+ }
275
+
276
+ #msp-slider-type-select .msp-templates-bottom {
277
+ padding: 15px 20px 0;
278
+ -webkit-box-sizing: border-box;
279
+ -moz-box-sizing: border-box;
280
+ box-sizing: border-box;
281
+ }
282
+
283
+ #msp-slider-type-select .msp-templates-bottom button {
284
+ width: 100%;
285
+ margin: 0;
286
+ }
287
+
288
+ .msp-starter-selector {
289
+ max-width:1240px;
290
+ }
291
+
292
+ @media only screen and (max-width: 1500px) {
293
+ #msp-slider-type-select .msp-template-figure {
294
+ width: 17.5%;
295
+ }
296
+ }
297
+ @media only screen and (max-width: 1200px) {
298
+ #msp-slider-type-select .msp-template-figure {
299
+ width: 22%;
300
+ }
301
+ }
302
+
303
+ /** slider import export **/
304
+
305
+ .msp-import-export-wrapper {
306
+ display:none;
307
+ }
308
+
309
+ .msp-dialog-inner-split-header {
310
+ background: white;
311
+ padding-left: 20px;
312
+ height: 45px;
313
+ line-height: 45px;
314
+ border-bottom: solid 1px #dedede;
315
+ margin: 0;
316
+ border-top: solid 1px #dedede;
317
+ font-weight: 400;
318
+ color: #2EA2CC;
319
+ margin: 0;
320
+ font-size: 1.2em;
321
+ position: relative;
322
+ }
323
+
324
+ .msp-import-export-dialog {
325
+ top: 50px !important;
326
+ margin:0 auto;
327
+ min-width:400px !important;
328
+ z-index:110000;
329
+ }
330
+
331
+ .msp-select-file {
332
+ overflow: hidden;
333
+ background: #FAFAFA;
334
+ outline: none;
335
+ border: 1px solid #E4E4E4;
336
+ height: 30px;
337
+ padding: 5px !important;
338
+ }
339
+
340
+ .msp-import-form {
341
+
342
+ }
343
+
344
+ .msp-import-export-wrapper .msp-ac-btn.button {
345
+ border: none;
346
+ outline: none;
347
+ color:#fff;
348
+ border-bottom: 3px solid #278aae;
349
+ border-radius: 0;
350
+ height: 31px;
351
+ line-height: 31px;
352
+ padding-left: 28px;
353
+ padding-right: 28px;
354
+ background-color:#2ea2cc;
355
+ font-weight: 300;
356
+ }
357
+
358
+ .msp-import-export-wrapper .msp-ac-btn.button:hover {
359
+ color:#fff;
360
+ background-color:#2ea2cc;
361
+ }
362
+
363
+ .msp-import-wrapper .msp-ac-btn.button {
364
+ top:-1px;
365
+ }
366
+
367
+ .msp-dialog-section-desc {
368
+ margin-top: 10px;
369
+ display: block;
370
+ }
371
+
372
+ .msp-dialog-inner-section {
373
+ padding: 27px 35px;
374
+ }
375
+
376
+ .msp-import-export-wrapper .msp-ac-btn.button:hover {
377
+ color:#fff;
378
+ background-color:#2ea2cc;
379
+ }
380
+
381
+
382
+ .msp-export-table.widefat {
383
+ border:none;
384
+ box-shadow: none;
385
+ }
386
+
387
+ .msp-export-table th {
388
+ padding:10px 10px 10px 0;
389
+ }
390
+
391
+ .msp-export-table thead th {
392
+ font-weight:normal;
393
+ }
394
+
395
+ .msp-export-table tbody th {
396
+ font-weight:normal;
397
+ }
398
+
399
+ .export-field-cb {
400
+ width:30px;
401
+ }
402
+
403
+ .export-field-ID {
404
+ width:50px;
405
+ }
406
+
407
+ .export-field-lastmodify {
408
+ width:140px;
409
+ }
410
+
411
+ .export-field-type {
412
+ width:140px;
413
+ }
414
+
415
+ .msp-export-table-container {
416
+ max-height:270px;
417
+ overflow-y:auto;
418
+ margin-bottom: 20px;
419
+ margin-right: -35px;
420
+ padding-right: 35px;
421
+ }
422
+
423
+ .msp-export-options-table {
424
+ margin-bottom:25px;
425
+ }
426
+
427
+ .msp-dialog-inner-section-title {
428
+ font-size: 15px;
429
+ padding-left: 9px;
430
+ font-weight: 600;
431
+ }
432
+
433
+
434
+ /* preview dialog window */
435
+
436
+ .msp-container.msp-preview-dialog {
437
+ top: 45px !important;
438
+ margin:0 auto;
439
+ width:90% !important;
440
+ min-width:400px !important;
441
+ z-index:110000;
442
+ }
443
+
444
+ #ms-preview-wrapper > div{
445
+ margin-left:auto;
446
+ margin-right:auto;
447
+ }
448
+ #msp-slider-preview {
449
+ display:none;
450
+ width:100% !important;
451
+ max-height:90%;
452
+ margin-bottom:-4px;
453
+ }
454
+ #msp-slider-preview #wpbody-content {
455
+ padding-bottom: 65px;
456
+ }
457
+
458
+ /** other **/
459
+ .update-nag { display:none; }
460
+
461
+ #contextual-help-link-wrap {
462
+ right: 20px;
463
+ border: none;
464
+ box-shadow: none;
465
+ background: url(../images/help.png) no-repeat 2px 2px;
466
+ }
467
+
468
+ #screen-meta-links .screen-meta-toggle {
469
+ top: 44px;
470
+ }
471
+
472
+ #contextual-help-link-wrap>a{
473
+ padding-left: 35px;
474
+ }
475
+
476
+ #wpcontent, .auto-fold #wpcontent { padding-left: 0; }
admin/assets/images/help.png ADDED
Binary file
admin/assets/images/master-admin-menu.svg ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="20px" height="20px" viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">
6
+ <g>
7
+ <g>
8
+ <path style="fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;" d="M3.184,11.345l-1.127,2.864L0.01,8.987l1.127-2.864
9
+ L3.184,11.345z M12.251,11.345l-1.127,2.864L9.087,8.987l1.117-2.864L12.251,11.345z"/>
10
+ <path style="fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;" d="M3.184,11.345L1.137,6.124L2.254,3.25l2.047,5.231
11
+ L3.184,11.345z M12.251,11.345l-2.047-5.221l1.127-2.874l2.037,5.231L12.251,11.345z"/>
12
+ <path style="fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;" d="M2.502,3.25h4.094l4.28,10.959H6.792L2.502,3.25z
13
+ M11.579,3.25h4.084l4.28,10.959h-4.084L11.579,3.25z"/>
14
+ </g>
15
+ </g>
16
+ </svg>
admin/assets/images/misc/shortcode-in-editor.png ADDED
Binary file
admin/assets/images/misc/where-is-ms-shortcode.png ADDED
Binary file
admin/assets/images/slider-types/pt_custom.png ADDED
Binary file
admin/assets/images/starters/autoplay-slider.jpg ADDED
Binary file
admin/assets/images/starters/fullwidth-slider-with-thumbs.jpg ADDED
Binary file
admin/assets/images/starters/fullwidth-slider.jpg ADDED
Binary file
admin/assets/images/starters/simple-slider.jpg ADDED
Binary file
admin/assets/images/starters/slider-with-horizontal-thumbs.jpg ADDED
Binary file
admin/assets/images/starters/slider-with-slide-info-v2.jpg ADDED
Binary file
admin/assets/images/starters/slider-with-slide-info.jpg ADDED
Binary file
admin/assets/images/starters/slider-with-vertical-thumbs.jpg ADDED
Binary file
admin/assets/images/thirdparty/master-slider-32x32.png ADDED
Binary file
admin/assets/js/admin.js ADDED
@@ -0,0 +1,285 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Administration-specific JavaScript
2
+ (function ( $ ) {
3
+ "use strict";
4
+
5
+ // Slider type selector dialog
6
+ $(function () {
7
+
8
+ var $add_new_slider = $('#msp-add-slider');
9
+ if( ! $add_new_slider.length ) return;
10
+
11
+
12
+ // get markup for slider types
13
+ var $slider_types_markup = $('#msp-slider-type-select');
14
+
15
+ $slider_types_markup.dialog({
16
+ resizable: false,
17
+ autoOpen: false,
18
+ modal: true,
19
+ width: 1000,
20
+ height: 550,
21
+ title: __MSP_GEN_LAN.genl_005,
22
+ draggable: false,
23
+ show: 'fade',
24
+ dialogClass: 'msp-container msp-dialog msp-starter-selector',
25
+ open: function(){
26
+ $('.ui-widget-overlay').bind('click',function(){
27
+ $slider_types_markup.dialog('close');
28
+ });
29
+ }
30
+ });
31
+
32
+ window.onSelectorDialogResize = function(event){
33
+ var frame = event.data.the_frame;
34
+ frame.dialog("option", "position", "center");
35
+ frame.dialog("option", "width" , "80%" );
36
+ frame.dialog("option", "height" , $(window).height()-90 );
37
+ };
38
+
39
+ $(window).bind('resize', { the_frame:$slider_types_markup } , onSelectorDialogResize );
40
+ $(window).trigger('resize');
41
+
42
+
43
+ // open select type window on add slider btn clicked
44
+ $add_new_slider.on('click', function(event){
45
+ event.preventDefault();
46
+ $slider_types_markup.dialog( 'open' );
47
+ });
48
+
49
+
50
+ // highlight selected template - ignore coming soon items
51
+ var $slider_types = $('#msp-slider-type-select .msp-template-figure:not(.is-unavailable)');
52
+
53
+ $slider_types.on('click', function(event){
54
+ $slider_types.removeClass('selected');
55
+ $(this).addClass('selected');
56
+ });
57
+
58
+ // if the template is disabled and disabled_msg is set, display the text on click
59
+ var $slider_types_disabled = $('#msp-slider-type-select .msp-template-figure.is-unavailable');
60
+
61
+ $slider_types_disabled.on('click', function(event){
62
+ var disabled_alert_text = $(this).data('disabled-msg');
63
+ if( disabled_alert_text )
64
+ alert( disabled_alert_text );
65
+ });
66
+
67
+ // get "create" slider
68
+ var $create_slider_btn = $('#msp-slider-type-create');
69
+
70
+ $create_slider_btn.on('click', function(event){
71
+ event.preventDefault();
72
+ var $create_btn = $(this);
73
+
74
+
75
+ var $selected_item = $('#msp-slider-type-select .msp-template-figure.selected').eq(0);
76
+
77
+ var starter_section = $selected_item.data('starter-section');
78
+ var slider_type = $selected_item.data('slider-type');
79
+ var starter_id = $selected_item.data('starter-uid');
80
+
81
+ if( 'main_types' == starter_section ) {
82
+
83
+ $create_btn.text( __MSP_GEN_LAN.genl_004 );
84
+ $create_btn.prop("disabled",true);
85
+
86
+ jQuery.post(
87
+ ajaxurl,
88
+ {
89
+ action : 'msp_create_new_handler', // the handler
90
+ nonce : jQuery('#msp-main-wrapper').data('nonce'), // the generated nonce value
91
+ slider_type : slider_type
92
+ },
93
+ function(res){
94
+
95
+ if( res.success === true ){
96
+ $create_btn.text( __MSP_GEN_LAN.genl_003 );
97
+ window.location.href = res.redirect;
98
+ }else{
99
+ $create_btn.prop( "disabled", false );
100
+ $create_btn.text( res.message );
101
+ }
102
+ }
103
+ );
104
+
105
+ } else {
106
+ $create_btn.text( 'Preparing to import content ..' );
107
+ window.location.href = __MS.importer + "&starter_id=" + starter_id + "&step=2";
108
+ }
109
+
110
+ });
111
+
112
+ });
113
+
114
+
115
+
116
+ // Live preview
117
+ $(function (){
118
+
119
+ window.lunchMastersliderPreview = function( event ){
120
+ if( event ) event.preventDefault();
121
+
122
+ var $preview_wrapper = $('#msp-slider-preview');
123
+
124
+ if( ! $preview_wrapper.length ) {
125
+ $preview_wrapper = $('<iframe id="msp-slider-preview" width="100%" height="90%" ></iframe>');
126
+ $preview_wrapper = $preview_wrapper.appendTo( $('body') );
127
+ $preview_wrapper = $('#msp-slider-preview');
128
+ }
129
+
130
+ $preview_wrapper.dialog({
131
+ resizable: false,
132
+ autoOpen: false,
133
+ modal: true,
134
+ width: $(window).width(),
135
+ height: $(window).height()-45,
136
+ title: __MSP_GEN_LAN.genl_002,
137
+ draggable: false,
138
+ show: 'fade',
139
+ dialogClass: 'msp-container msp-dialog msp-preview-dialog',
140
+ close: function( event, ui ) {
141
+ $preview_wrapper.prop( 'src', 'about:blank');
142
+ },
143
+ open: function(){
144
+ $('.ui-widget-overlay').bind('click',function(){
145
+ $preview_wrapper.dialog('close');
146
+ });
147
+ }
148
+ });
149
+
150
+ $preview_wrapper.prop( 'src', __MS.msp_plugin_url + '/admin/views/slider-dashboard/get-preview.html?cn=' + Math.random() ).dialog('open');
151
+
152
+ window.onbeforeunload = function(){
153
+ if( $preview_wrapper.dialog( 'isOpen' ) )
154
+ return __MSP_GEN_LAN.genl_001;
155
+ };
156
+
157
+ window.onPreviewDialogResize = function(event){
158
+ var frame = event.data.the_frame;
159
+ frame.dialog("option", "position", "center");
160
+ frame.dialog("option", "height" , $(window).height()-45 );
161
+ };
162
+
163
+ $(window).bind('resize', { the_frame:$preview_wrapper } , onPreviewDialogResize );
164
+ };
165
+
166
+
167
+
168
+ window.lunchMastersliderPreviewBySliderID = function( slider_id ){
169
+
170
+ var $preview_wrapper = $('#msp-slider-preview');
171
+
172
+ if( ! $preview_wrapper.length ) {
173
+ $preview_wrapper = $('<iframe id="msp-slider-preview" width="100%" height="90%" ></iframe>');
174
+ $preview_wrapper = $preview_wrapper.appendTo( $('body') );
175
+ $preview_wrapper = $('#msp-slider-preview');
176
+ }
177
+
178
+ $preview_wrapper.dialog({
179
+ resizable: false,
180
+ autoOpen: false,
181
+ modal: true,
182
+ width: $(window).width(),
183
+ height: $(window).height()-45,
184
+ title: __MSP_GEN_LAN.genl_002,
185
+ draggable: false,
186
+ show: 'fade',
187
+ dialogClass: 'msp-container msp-dialog msp-preview-dialog',
188
+ close: function( event, ui ) {
189
+ $preview_wrapper.prop( 'src', 'about:blank');
190
+ },
191
+ open: function(){
192
+ $('.ui-widget-overlay').bind('click',function(){
193
+ $preview_wrapper.dialog('close');
194
+ });
195
+ }
196
+ });
197
+
198
+ $preview_wrapper.load(function(){
199
+ console.log('preview loaded compeletely.');
200
+ });
201
+
202
+ $preview_wrapper.prop( 'src', __MS.msp_menu_page + '&action=preview&strip_wp&slider_id=' + slider_id ).dialog('open');
203
+
204
+ window.onbeforeunload = function(){
205
+ if( $preview_wrapper.dialog( 'isOpen' ) )
206
+ return __MSP_GEN_LAN.genl_001;
207
+ };
208
+
209
+ window.onPreviewDialogResize = function(event){
210
+ var frame = event.data.the_frame;
211
+ frame.dialog("option", "position", "center");
212
+ frame.dialog("option", "height" , $(window).height()-45 );
213
+ };
214
+
215
+ $(window).bind('resize', { the_frame:$preview_wrapper } , onPreviewDialogResize );
216
+ $(window).trigger('resize');
217
+ };
218
+
219
+
220
+ window.lunchMastersliderImportExport = function(){
221
+
222
+ var $import_export_wrapper = $('.msp-import-export-wrapper');
223
+
224
+ if( ! $import_export_wrapper.length )
225
+ return;
226
+
227
+ $import_export_wrapper.dialog({
228
+ resizable: false,
229
+ autoOpen: true,
230
+ modal: true,
231
+ width: 800,
232
+ height: $(window).height()-85,
233
+ title: __MSP_GEN_LAN.genl_007,
234
+ draggable: false,
235
+ show: 'fade',
236
+ dialogClass: 'msp-container msp-dialog msp-import-export-dialog',
237
+ close: function( event, ui ) {
238
+
239
+ },
240
+ open: function(){
241
+ $('.ui-widget-overlay').bind('click',function(){
242
+ $import_export_wrapper.dialog('close');
243
+ });
244
+ }
245
+ });
246
+
247
+ window.onPreviewDialogResize = function(event){
248
+ var frame = event.data.the_frame;
249
+ var dialogHeight = $(window).height()-85;
250
+ frame.dialog("option", "position", "center");
251
+ frame.dialog("option", "height" , dialogHeight );
252
+ $('.msp-export-table-container').css('min-height', dialogHeight - 350 );
253
+ };
254
+
255
+ $(window).bind('resize', { the_frame:$import_export_wrapper } , onPreviewDialogResize );
256
+ $(window).trigger('resize');
257
+ };
258
+
259
+ // check all btn in export dialog
260
+ $('.export-check-all').bind( 'click', function(){
261
+
262
+ var $this = $(this);
263
+ var isChecked = $this.prop('checked');
264
+ $('.msp-export-sliders-table .export-slider-cb').prop( 'checked', isChecked );
265
+ });
266
+
267
+ // export button clicked
268
+ $('#msp-export-btn').bind( 'click', function(){
269
+ if( ! $('.msp-export-sliders-table .export-slider-cb:checked').length ) {
270
+ alert( __MSP_GEN_LAN.genl_006 );
271
+ return false;
272
+ }
273
+ });
274
+
275
+ // help button position
276
+ if( $('#msp-header').length ){
277
+ var help_btn_top_offset = $('#msp-header')[0].getBoundingClientRect().top - 6;
278
+ $('#contextual-help-link-wrap').css( 'top', help_btn_top_offset );
279
+ }
280
+
281
+ });
282
+
283
+
284
+
285
+ }(jQuery));
admin/assets/js/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
admin/class-master-slider-admin.php ADDED
@@ -0,0 +1,276 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Master Slider Admin
4
+ *
5
+ * @package MasterSlider
6
+ * @author averta [averta.net]
7
+ * @license LICENSE.txt
8
+ * @link http://masterslider.com
9
+ * @copyright Copyright © 2014 averta
10
+ */
11
+
12
+ // no direct access allowed
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ die();
15
+ }
16
+
17
+
18
+ /**
19
+ * This class is used to work with the
20
+ * administrative side of Masterslider
21
+ */
22
+ class Master_Slider_Admin {
23
+
24
+ /**
25
+ * Instance of this class.
26
+ *
27
+ * @since 1.0.0
28
+ *
29
+ * @var object
30
+ */
31
+ protected static $instance = null;
32
+
33
+ /**
34
+ * Slug of the plugin screen.
35
+ *
36
+ * @since 1.0.0
37
+ *
38
+ * @var string
39
+ */
40
+ protected $sliders_screen_hook_suffix = null;
41
+
42
+
43
+
44
+ /**
45
+ * Initialize the plugin by loading admin classes and functions
46
+ *
47
+ * @since 1.0.0
48
+ */
49
+ private function __construct() {
50
+
51
+ // include admin files
52
+ $this->includes();
53
+
54
+ add_action( 'init', array( $this, 'init' ) );
55
+ }
56
+
57
+
58
+ /**
59
+ * Include admin essential classes and functions
60
+ *
61
+ * @return void
62
+ */
63
+ private function includes(){
64
+ include_once( MSWP_AVERTA_ADMIN_DIR . '/includes/index.php' );
65
+ include_once( MSWP_AVERTA_ADMIN_DIR . '/views/setting/class-msp-settings.php' );
66
+ }
67
+
68
+
69
+ public function init() {
70
+
71
+ // Before init action
72
+ do_action( 'before_masterslider_admin_init' );
73
+
74
+ // A filter hook to restrict access to plugin panel only for super admin on multiste
75
+ if( apply_filters( 'masterslider_access_only_for_super_admins' , 0 ) && ! is_super_admin() ) {
76
+ return;
77
+ }
78
+
79
+ // Assign masterslider custom capabilities
80
+ Master_Slider::assign_custom_caps();
81
+ // Inject default styles and effects
82
+ Master_Slider::set_default_options();
83
+
84
+
85
+ // Initial tasks on admin init
86
+ add_action( 'admin_init', array( $this, 'admin_init') );
87
+
88
+ // Load admin Stylesheet and JavaScript.
89
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts') );
90
+
91
+ // Add some essential content in admin page header
92
+ add_action( 'admin_head', array( $this, 'admin_header' ), 9 );
93
+
94
+ // Add the options page and menu item.
95
+ add_action( 'admin_menu', array( $this, 'add_plugin_admin_menu' ) );
96
+
97
+ // Add an action link pointing to the setting page.
98
+ add_filter( 'plugin_action_links_'. MSWP_AVERTA_BASE_NAME, array( $this, 'add_action_links' ) );
99
+
100
+ // Add an action link on plugin row meta in plugins page
101
+ add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 );
102
+
103
+ // Admin init action
104
+ do_action( 'masterslider_admin_init' );
105
+ }
106
+
107
+
108
+ /**
109
+ * Triggers on admin init
110
+ *
111
+ * @return void
112
+ */
113
+ public function admin_init(){
114
+
115
+ $this->after_plugin_update();
116
+ }
117
+
118
+
119
+ /**
120
+ * Regenerate and cache custom css codes for all slider after plugin update
121
+ *
122
+ * @return bool TRUE on success, FALSE otherwise
123
+ */
124
+ public function after_plugin_update (){
125
+
126
+ if( get_option( 'masterslider_lite_plugin_version', '0' ) == MSWP_AVERTA_VERSION )
127
+ return false;
128
+
129
+ msp_save_custom_styles();
130
+ update_option( 'masterslider_lite_plugin_version', MSWP_AVERTA_VERSION );
131
+ do_action( 'masterslider_after_plugin_updated' );
132
+
133
+ return true;
134
+ }
135
+
136
+
137
+ /**
138
+ * Return an instance of this class.
139
+ *
140
+ * @since 1.0.0
141
+ *
142
+ * @return object A single instance of this class.
143
+ */
144
+ public static function get_instance() {
145
+
146
+ if( apply_filters( 'masterslider_access_only_for_super_admins' , 0 ) && ! is_super_admin() ) {
147
+ return;
148
+ }
149
+
150
+ // If the single instance hasn't been set, set it now.
151
+ if ( null == self::$instance ) {
152
+ self::$instance = new self;
153
+ }
154
+
155
+ return self::$instance;
156
+ }
157
+
158
+
159
+ /**
160
+ * Register and enqueue admin-specific JavaScript & Stylesheet.
161
+ *
162
+ * @since 1.0.0
163
+ *
164
+ * @return null Return early if no settings page is registered.
165
+ */
166
+ public function enqueue_admin_scripts() {
167
+
168
+ // load global style - loads on all admin area
169
+ wp_enqueue_style( MSWP_SLUG .'-global-styles', MSWP_AVERTA_ADMIN_URL . '/assets/css/global.css', array(), MSWP_AVERTA_VERSION );
170
+
171
+ if ( ! isset( $this->sliders_screen_hook_suffix ) )
172
+ return;
173
+
174
+ // load masterslider spesific assets only on it's admin page
175
+ $screen = get_current_screen();
176
+ if ( $this->sliders_screen_hook_suffix == $screen->id ) {
177
+
178
+ $admin_assets = new MSP_Admin_Assets();
179
+ $admin_assets->enqueue();
180
+ }
181
+
182
+ }
183
+
184
+
185
+ /**
186
+ * Print essential content in admin page header
187
+ *
188
+ * @since 1.0.0
189
+ *
190
+ * @return void
191
+ */
192
+ public function admin_header() {
193
+
194
+ if ( ! isset( $this->sliders_screen_hook_suffix ) ) {
195
+ return;
196
+ }
197
+
198
+ $screen = get_current_screen();
199
+ if ( $this->sliders_screen_hook_suffix == $screen->id ) {
200
+
201
+ if ( isset( $_REQUEST['slider_id'] ) ) {
202
+
203
+ $slider_id = $_REQUEST['slider_id'];
204
+ global $mspdb;
205
+ $custom_fonts = $mspdb->get_slider_field_val( $slider_id, 'custom_fonts' );
206
+
207
+ if ( ! empty( $custom_fonts ) )
208
+ printf( "<link rel='stylesheet' id='masterslider-admin-fonts' href='http://fonts.googleapis.com/css?family=%s' type='text/css' />\n", $custom_fonts );
209
+ }
210
+ }
211
+ }
212
+
213
+
214
+ /**
215
+ * Register the administration menu for this plugin into the WordPress Dashboard menu.
216
+ *
217
+ * @since 1.0.0
218
+ */
219
+ public function add_plugin_admin_menu() {
220
+
221
+ $ms_page_title = apply_filters( 'masterslider_admin_page_title', __( 'Master Sliders', MSWP_TEXT_DOMAIN ) );
222
+ $ms_menu_title = apply_filters( 'masterslider_admin_menu_title', __( 'Master Slider' , MSWP_TEXT_DOMAIN ) );
223
+
224
+ // Add a top-level menu for master slider
225
+ $this->sliders_screen_hook_suffix = add_menu_page(
226
+ $ms_page_title,
227
+ $ms_menu_title,
228
+ apply_filters( 'masterslider_access_capability', 'access_masterslider' ),
229
+ MSWP_SLUG,
230
+ array( $this, 'display_master_slider_panel_page' )
231
+ );
232
+
233
+ }
234
+
235
+
236
+ /**
237
+ * Render the panel page for this plugin.
238
+ *
239
+ * @since 1.0.0
240
+ */
241
+ public function display_master_slider_panel_page() {
242
+ include_once( 'views/index.php' );
243
+ }
244
+
245
+
246
+ /**
247
+ * Add settings action link to the plugins page.
248
+ *
249
+ * @since 1.0.0
250
+ */
251
+ public function add_action_links( $links ) {
252
+
253
+ return array_merge(
254
+ array(
255
+ 'settings' => '<a href="' . admin_url( 'admin.php?page=' . MSWP_SLUG . '-setting' ) . '">' . __( 'Settings', MSWP_TEXT_DOMAIN ) . '</a>'
256
+ ),
257
+ $links
258
+ );
259
+
260
+ }
261
+
262
+
263
+ /**
264
+ * Add extra action link to the plugin meta on plugins page.
265
+ *
266
+ * @since 1.8.0
267
+ */
268
+ public function plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ){
269
+ if( $plugin_file == MSWP_AVERTA_BASE_NAME ) { }
270
+ return $plugin_meta;
271
+ }
272
+
273
+
274
+ }
275
+
276
+ return Master_Slider_Admin::get_instance();
admin/includes/classes/class-axiom-list-table.php ADDED
@@ -0,0 +1,966 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Base class for displaying a list of items in an ajaxified HTML table.
4
+ *
5
+ */
6
+ if ( ! class_exists( 'Axiom_List_Table' ) ) :
7
+
8
+ class Axiom_List_Table {
9
+
10
+ /**
11
+ * The current list of items
12
+ *
13
+ * @since 3.1.0
14
+ * @var array
15
+ * @access protected
16
+ */
17
+ var $items;
18
+
19
+ /**
20
+ * Various information about the current table
21
+ *
22
+ * @since 3.1.0
23
+ * @var array
24
+ * @access private
25
+ */
26
+ var $_args;
27
+
28
+ /**
29
+ * Various information needed for displaying the pagination
30
+ *
31
+ * @since 3.1.0
32
+ * @var array
33
+ * @access private
34
+ */
35
+ var $_pagination_args = array();
36
+
37
+ /**
38
+ * The current screen
39
+ *
40
+ * @since 3.1.0
41
+ * @var object
42
+ * @access protected
43
+ */
44
+ var $screen;
45
+
46
+ /**
47
+ * Cached bulk actions
48
+ *
49
+ * @since 3.1.0
50
+ * @var array
51
+ * @access private
52
+ */
53
+ var $_actions;
54
+
55
+ /**
56
+ * Cached pagination output
57
+ *
58
+ * @since 3.1.0
59
+ * @var string
60
+ * @access private
61
+ */
62
+ var $_pagination;
63
+
64
+ /**
65
+ * Constructor. The child class should call this constructor from its own constructor
66
+ *
67
+ * @param array $args An associative array with information about the current table
68
+ * @access protected
69
+ */
70
+ function __construct( $args = array() ) {
71
+ $args = wp_parse_args( $args, array(
72
+ 'plural' => '',
73
+ 'singular' => '',
74
+ 'ajax' => false,
75
+ 'screen' => null,
76
+ ) );
77
+
78
+ $this->screen = convert_to_screen( $args['screen'] );
79
+
80
+ add_filter( "manage_{$this->screen->id}_columns", array( $this, 'get_columns' ), 0 );
81
+
82
+ if ( !$args['plural'] )
83
+ $args['plural'] = $this->screen->base;
84
+
85
+ $args['plural'] = sanitize_key( $args['plural'] );
86
+ $args['singular'] = sanitize_key( $args['singular'] );
87
+
88
+ $this->_args = $args;
89
+
90
+ if ( $args['ajax'] ) {
91
+ // wp_enqueue_script( 'list-table' );
92
+ add_action( 'admin_footer', array( $this, '_js_vars' ) );
93
+ }
94
+ }
95
+
96
+ /**
97
+ * Checks the current user's permissions
98
+ * @uses wp_die()
99
+ *
100
+ * @since 3.1.0
101
+ * @access public
102
+ * @abstract
103
+ */
104
+ function ajax_user_can() {
105
+ die( 'function Axiom_List_Table::ajax_user_can() must be over-ridden in a sub-class.' );
106
+ }
107
+
108
+ /**
109
+ * Prepares the list of items for displaying.
110
+ * @uses Axiom_List_Table::set_pagination_args()
111
+ *
112
+ * @since 3.1.0
113
+ * @access public
114
+ * @abstract
115
+ */
116
+ function prepare_items() {
117
+ die( 'function Axiom_List_Table::prepare_items() must be over-ridden in a sub-class.' );
118
+ }
119
+
120
+ /**
121
+ * An internal method that sets all the necessary pagination arguments
122
+ *
123
+ * @param array $args An associative array with information about the pagination
124
+ * @access protected
125
+ */
126
+ function set_pagination_args( $args ) {
127
+ $args = wp_parse_args( $args, array(
128
+ 'total_items' => 0,
129
+ 'total_pages' => 0,
130
+ 'per_page' => 0,
131
+ ) );
132
+
133
+ if ( !$args['total_pages'] && $args['per_page'] > 0 )
134
+ $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
135
+
136
+ // redirect if page number is invalid and headers are not already sent
137
+ if ( ! headers_sent() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) {
138
+ wp_redirect( add_query_arg( 'paged', $args['total_pages'] ) );
139
+ exit;
140
+ }
141
+
142
+ $this->_pagination_args = $args;
143
+ }
144
+
145
+ /**
146
+ * Access the pagination args
147
+ *
148
+ * @since 3.1.0
149
+ * @access public
150
+ *
151
+ * @param string $key
152
+ * @return array
153
+ */
154
+ function get_pagination_arg( $key ) {
155
+ if ( 'page' == $key )
156
+ return $this->get_pagenum();
157
+
158
+ if ( isset( $this->_pagination_args[$key] ) )
159
+ return $this->_pagination_args[$key];
160
+ }
161
+
162
+ /**
163
+ * Whether the table has items to display or not
164
+ *
165
+ * @since 3.1.0
166
+ * @access public
167
+ *
168
+ * @return bool
169
+ */
170
+ function has_items() {
171
+ return !empty( $this->items );
172
+ }
173
+
174
+ /**
175
+ * Message to be displayed when there are no items
176
+ *
177
+ * @since 3.1.0
178
+ * @access public
179
+ */
180
+ function no_items() {
181
+ _e( 'No items found.' );
182
+ }
183
+
184
+ /**
185
+ * Display the search box.
186
+ *
187
+ * @since 3.1.0
188
+ * @access public
189
+ *
190
+ * @param string $text The search button text
191
+ * @param string $input_id The search input id
192
+ */
193
+ function search_box( $text, $input_id ) {
194
+ if ( empty( $_REQUEST['s'] ) && !$this->has_items() )
195
+ return;
196
+
197
+ $input_id = $input_id . '-search-input';
198
+
199
+ if ( ! empty( $_REQUEST['orderby'] ) )
200
+ echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
201
+ if ( ! empty( $_REQUEST['order'] ) )
202
+ echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
203
+ if ( ! empty( $_REQUEST['post_mime_type'] ) )
204
+ echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( $_REQUEST['post_mime_type'] ) . '" />';
205
+ if ( ! empty( $_REQUEST['detached'] ) )
206
+ echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '" />';
207
+ ?>
208
+ <p class="search-box">
209
+ <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
210
+ <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
211
+ <?php submit_button( $text, 'button', false, false, array('id' => 'search-submit') ); ?>
212
+ </p>
213
+ <?php
214
+ }
215
+
216
+ /**
217
+ * Get an associative array ( id => link ) with the list
218
+ * of views available on this table.
219
+ *
220
+ * @since 3.1.0
221
+ * @access protected
222
+ *
223
+ * @return array
224
+ */
225
+ function get_views() {
226
+ return array();
227
+ }
228
+
229
+ /**
230
+ * Display the list of views available on this table.
231
+ *
232
+ * @since 3.1.0
233
+ * @access public
234
+ */
235
+ function views() {
236
+ $views = $this->get_views();
237
+ /**
238
+ * Filter the list of available list table views.
239
+ *
240
+ * The dynamic portion of the hook name, $this->screen->id, refers
241
+ * to the ID of the current screen, usually a string.
242
+ *
243
+ * @since 3.5.0
244
+ *
245
+ * @param array $views An array of available list table views.
246
+ */
247
+ $views = apply_filters( "views_{$this->screen->id}", $views );
248
+
249
+ if ( empty( $views ) )
250
+ return;
251
+
252
+ echo "<ul class='subsubsub'>\n";
253
+ foreach ( $views as $class => $view ) {
254
+ $views[ $class ] = "\t<li class='$class'>$view";
255
+ }
256
+ echo implode( " |</li>\n", $views ) . "</li>\n";
257
+ echo "</ul>";
258
+ }
259
+
260
+ /**
261
+ * Get an associative array ( option_name => option_title ) with the list
262
+ * of bulk actions available on this table.
263
+ *
264
+ * @since 3.1.0
265
+ * @access protected
266
+ *
267
+ * @return array
268
+ */
269
+ function get_bulk_actions() {
270
+ return array();
271
+ }
272
+
273
+ /**
274
+ * Display the bulk actions dropdown.
275
+ *
276
+ * @since 3.1.0
277
+ * @access public
278
+ */
279
+ function bulk_actions() {
280
+ if ( is_null( $this->_actions ) ) {
281
+ $no_new_actions = $this->_actions = $this->get_bulk_actions();
282
+ /**
283
+ * Filter the list table Bulk Actions drop-down.
284
+ *
285
+ * The dynamic portion of the hook name, $this->screen->id, refers
286
+ * to the ID of the current screen, usually a string.
287
+ *
288
+ * This filter can currently only be used to remove bulk actions.
289
+ *
290
+ * @since 3.5.0
291
+ *
292
+ * @param array $actions An array of the available bulk actions.
293
+ */
294
+ $this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions );
295
+ $this->_actions = array_intersect_assoc( $this->_actions, $no_new_actions );
296
+ $two = '';
297
+ } else {
298
+ $two = '2';
299
+ }
300
+
301
+ if ( empty( $this->_actions ) )
302
+ return;
303
+
304
+ echo "<select name='action$two'>\n";
305
+ echo "<option value='-1' selected='selected'>" . __( 'Bulk Actions' ) . "</option>\n";
306
+
307
+ foreach ( $this->_actions as $name => $title ) {
308
+ $class = 'edit' == $name ? ' class="hide-if-no-js"' : '';
309
+
310
+ echo "\t<option value='$name'$class>$title</option>\n";
311
+ }
312
+
313
+ echo "</select>\n";
314
+
315
+ submit_button( __( 'Apply' ), 'action', false, false, array( 'id' => "doaction$two" ) );
316
+ echo "\n";
317
+ }
318
+
319
+ /**
320
+ * Get the current action selected from the bulk actions dropdown.
321
+ *
322
+ * @since 3.1.0
323
+ * @access public
324
+ *
325
+ * @return string|bool The action name or False if no action was selected
326
+ */
327
+ function current_action() {
328
+ if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] )
329
+ return $_REQUEST['action'];
330
+
331
+ if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] )
332
+ return $_REQUEST['action2'];
333
+
334
+ return false;
335
+ }
336
+
337
+ /**
338
+ * Generate row actions div
339
+ *
340
+ * @since 3.1.0
341
+ * @access protected
342
+ *
343
+ * @param array $actions The list of actions
344
+ * @param bool $always_visible Whether the actions should be always visible
345
+ * @return string
346
+ */
347
+ function row_actions( $actions, $always_visible = false ) {
348
+ $action_count = count( $actions );
349
+ $i = 0;
350
+
351
+ if ( !$action_count )
352
+ return '';
353
+
354
+ $out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
355
+ foreach ( $actions as $action => $link ) {
356
+ ++$i;
357
+ ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
358
+ $out .= "<span class='$action'>$link$sep</span>";
359
+ }
360
+ $out .= '</div>';
361
+
362
+ return $out;
363
+ }
364
+
365
+ /**
366
+ * Display a monthly dropdown for filtering items
367
+ *
368
+ * @since 3.1.0
369
+ * @access protected
370
+ */
371
+ function months_dropdown( $post_type ) {
372
+ global $wpdb, $wp_locale;
373
+
374
+ $months = $wpdb->get_results( $wpdb->prepare( "
375
+ SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
376
+ FROM $wpdb->posts
377
+ WHERE post_type = %s
378
+ ORDER BY post_date DESC
379
+ ", $post_type ) );
380
+
381
+ /**
382
+ * Filter the 'Months' drop-down results.
383
+ *
384
+ * @since 3.7.0
385
+ *
386
+ * @param object $months The months drop-down query results.
387
+ * @param string $post_type The post type.
388
+ */
389
+ $months = apply_filters( 'months_dropdown_results', $months, $post_type );
390
+
391
+ $month_count = count( $months );
392
+
393
+ if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )
394
+ return;
395
+
396
+ $m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
397
+ ?>
398
+ <select name='m'>
399
+ <option<?php selected( $m, 0 ); ?> value='0'><?php _e( 'Show all dates' ); ?></option>
400
+ <?php
401
+ foreach ( $months as $arc_row ) {
402
+ if ( 0 == $arc_row->year )
403
+ continue;
404
+
405
+ $month = zeroise( $arc_row->month, 2 );
406
+ $year = $arc_row->year;
407
+
408
+ printf( "<option %s value='%s'>%s</option>\n",
409
+ selected( $m, $year . $month, false ),
410
+ esc_attr( $arc_row->year . $month ),
411
+ /* translators: 1: month name, 2: 4-digit year */
412
+ sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
413
+ );
414
+ }
415
+ ?>
416
+ </select>
417
+ <?php
418
+ }
419
+
420
+ /**
421
+ * Display a view switcher
422
+ *
423
+ * @since 3.1.0
424
+ * @access protected
425
+ */
426
+ function view_switcher( $current_mode ) {
427
+ $modes = array(
428
+ 'list' => __( 'List View' ),
429
+ 'excerpt' => __( 'Excerpt View' )
430
+ );
431
+
432
+ ?>
433
+ <input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>" />
434
+ <div class="view-switch">
435
+ <?php
436
+ foreach ( $modes as $mode => $title ) {
437
+ $class = ( $current_mode == $mode ) ? 'class="current"' : '';
438
+ echo "<a href='" . esc_url( add_query_arg( 'mode', $mode, $_SERVER['REQUEST_URI'] ) ) . "' $class><img id='view-switch-$mode' src='" . esc_url( includes_url( 'images/blank.gif' ) ) . "' width='20' height='20' title='$title' alt='$title' /></a>\n";
439
+ }
440
+ ?>
441
+ </div>
442
+ <?php
443
+ }
444
+
445
+ /**
446
+ * Display a comment count bubble
447
+ *
448
+ * @since 3.1.0
449
+ * @access protected
450
+ *
451
+ * @param int $post_id
452
+ * @param int $pending_comments
453
+ */
454
+ function comments_bubble( $post_id, $pending_comments ) {
455
+ $pending_phrase = sprintf( __( '%s pending' ), number_format( $pending_comments ) );
456
+
457
+ if ( $pending_comments )
458
+ echo '<strong>';
459
+
460
+ echo "<a href='" . esc_url( add_query_arg( 'p', $post_id, admin_url( 'edit-comments.php' ) ) ) . "' title='" . esc_attr( $pending_phrase ) . "' class='post-com-count'><span class='comment-count'>" . number_format_i18n( get_comments_number() ) . "</span></a>";
461
+
462
+ if ( $pending_comments )
463
+ echo '</strong>';
464
+ }
465
+
466
+ /**
467
+ * Get the current page number
468
+ *
469
+ * @since 3.1.0
470
+ * @access protected
471
+ *
472
+ * @return int
473
+ */
474
+ function get_pagenum() {
475
+ $pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;
476
+
477
+ if( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] )
478
+ $pagenum = $this->_pagination_args['total_pages'];
479
+
480
+ return max( 1, $pagenum );
481
+ }
482
+
483
+ /**
484
+ * Get number of items to display on a single page
485
+ *
486
+ * @since 3.1.0
487
+ * @access protected
488
+ *
489
+ * @return int
490
+ */
491
+ function get_items_per_page( $option, $default = 20 ) {
492
+ $per_page = (int) get_user_option( $option );
493
+ if ( empty( $per_page ) || $per_page < 1 )
494
+ $per_page = $default;
495
+
496
+ /**
497
+ * Filter the number of items to be displayed on each page of the list table.
498
+ *
499
+ * The dynamic hook name, $option, refers to the per page option depending
500
+ * on the type of list table in use. Possible values may include:
501
+ * 'edit_comments_per_page', 'sites_network_per_page', 'site_themes_network_per_page',
502
+ * 'themes_netework_per_page', 'users_network_per_page', 'edit_{$post_type}', etc.
503
+ *
504
+ * @since 2.9.0
505
+ *
506
+ * @param int $per_page Number of items to be displayed. Default 20.
507
+ */
508
+ return (int) apply_filters( $option, $per_page );
509
+ }
510
+
511
+ /**
512
+ * Display the pagination.
513
+ *
514
+ * @since 3.1.0
515
+ * @access protected
516
+ */
517
+ function pagination( $which ) {
518
+ if ( empty( $this->_pagination_args ) )
519
+ return;
520
+
521
+ extract( $this->_pagination_args, EXTR_SKIP );
522
+
523
+ $output = '<span class="displaying-num">' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
524
+
525
+ $current = $this->get_pagenum();
526
+
527
+ $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
528
+
529
+ $current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first', 'action' ), $current_url );
530
+
531
+ $page_links = array();
532
+
533
+ $disable_first = $disable_last = '';
534
+ if ( $current == 1 )
535
+ $disable_first = ' disabled';
536
+ if ( $current == $total_pages )
537
+ $disable_last = ' disabled';
538
+
539
+ $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
540
+ 'first-page' . $disable_first,
541
+ esc_attr__( 'Go to the first page' ),
542
+ esc_url( remove_query_arg( 'paged', $current_url ) ),
543
+ '&laquo;'
544
+ );
545
+
546
+ $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
547
+ 'prev-page' . $disable_first,
548
+ esc_attr__( 'Go to the previous page' ),
549
+ esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
550
+ '&lsaquo;'
551
+ );
552
+
553
+ if ( 'bottom' == $which )
554
+ $html_current_page = $current;
555
+ else
556
+ $html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name='paged' value='%s' size='%d' />",
557
+ esc_attr__( 'Current page' ),
558
+ $current,
559
+ strlen( $total_pages )
560
+ );
561
+
562
+ $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
563
+ $page_links[] = '<span class="paging-input">' . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . '</span>';
564
+
565
+ $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
566
+ 'next-page' . $disable_last,
567
+ esc_attr__( 'Go to the next page' ),
568
+ esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ),
569
+ '&rsaquo;'
570
+ );
571
+
572
+ $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
573
+ 'last-page' . $disable_last,
574
+ esc_attr__( 'Go to the last page' ),
575
+ esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
576
+ '&raquo;'
577
+ );
578
+
579
+ $pagination_links_class = 'pagination-links';
580
+ if ( ! empty( $infinite_scroll ) )
581
+ $pagination_links_class = ' hide-if-js';
582
+ $output .= "\n<span class='$pagination_links_class'>" . join( "\n", $page_links ) . '</span>';
583
+
584
+ if ( $total_pages )
585
+ $page_class = $total_pages < 2 ? ' one-page' : '';
586
+ else
587
+ $page_class = ' no-pages';
588
+
589
+ $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
590
+
591
+ echo $this->_pagination;
592
+ }
593
+
594
+ /**
595
+ * Get a list of columns. The format is:
596
+ * 'internal-name' => 'Title'
597
+ *
598
+ * @since 3.1.0
599
+ * @access protected
600
+ * @abstract
601
+ *
602
+ * @return array
603
+ */
604
+ function get_columns() {
605
+ die( 'function Axiom_List_Table::get_columns() must be over-ridden in a sub-class.' );
606
+ }
607
+
608
+ /**
609
+ * Get a list of sortable columns. The format is:
610
+ * 'internal-name' => 'orderby'
611
+ * or
612
+ * 'internal-name' => array( 'orderby', true )
613
+ *
614
+ * The second format will make the initial sorting order be descending
615
+ *
616
+ * @since 3.1.0
617
+ * @access protected
618
+ *
619
+ * @return array
620
+ */
621
+ function get_sortable_columns() {
622
+ return array();
623
+ }
624
+
625
+ /**
626
+ * Get a list of all, hidden and sortable columns, with filter applied
627
+ *
628
+ * @since 3.1.0
629
+ * @access protected
630
+ *
631
+ * @return array
632
+ */
633
+ function get_column_info() {
634
+ if ( isset( $this->_column_headers ) )
635
+ return $this->_column_headers;
636
+
637
+ $columns = get_column_headers( $this->screen );
638
+ $hidden = get_hidden_columns( $this->screen );
639
+
640
+ $sortable_columns = $this->get_sortable_columns();
641
+ /**
642
+ * Filter the list table sortable columns for a specific screen.
643
+ *
644
+ * The dynamic portion of the hook name, $this->screen->id, refers
645
+ * to the ID of the current screen, usually a string.
646
+ *
647
+ * @since 3.5.0
648
+ *
649
+ * @param array $sortable_columns An array of sortable columns.
650
+ */
651
+ $_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $sortable_columns );
652
+
653
+ $sortable = array();
654
+ foreach ( $_sortable as $id => $data ) {
655
+ if ( empty( $data ) )
656
+ continue;
657
+
658
+ $data = (array) $data;
659
+ if ( !isset( $data[1] ) )
660
+ $data[1] = false;
661
+
662
+ $sortable[$id] = $data;
663
+ }
664
+
665
+ $this->_column_headers = array( $columns, $hidden, $sortable );
666
+
667
+ return $this->_column_headers;
668
+ }
669
+
670
+ /**
671
+ * Return number of visible columns
672
+ *
673
+ * @since 3.1.0
674
+ * @access public
675
+ *
676
+ * @return int
677
+ */
678
+ function get_column_count() {
679
+ list ( $columns, $hidden ) = $this->get_column_info();
680
+ $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
681
+ return count( $columns ) - count( $hidden );
682
+ }
683
+
684
+ /**
685
+ * Print column headers, accounting for hidden and sortable columns.
686
+ *
687
+ * @since 3.1.0
688
+ * @access protected
689
+ *
690
+ * @param bool $with_id Whether to set the id attribute or not
691
+ */
692
+ function print_column_headers( $with_id = true ) {
693
+ list( $columns, $hidden, $sortable ) = $this->get_column_info();
694
+
695
+ $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
696
+ $current_url = remove_query_arg( 'paged', $current_url );
697
+
698
+ if ( isset( $_GET['orderby'] ) )
699
+ $current_orderby = $_GET['orderby'];
700
+ else
701
+ $current_orderby = '';
702
+
703
+ if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] )
704
+ $current_order = 'desc';
705
+ else
706
+ $current_order = 'asc';
707
+
708
+ if ( ! empty( $columns['cb'] ) ) {
709
+ static $cb_counter = 1;
710
+ $columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All' ) . '</label>'
711
+ . '<input id="cb-select-all-' . $cb_counter . '" type="checkbox" />';
712
+ $cb_counter++;
713
+ }
714
+
715
+ foreach ( $columns as $column_key => $column_display_name ) {
716
+ $class = array( 'manage-column', "column-$column_key" );
717
+
718
+ $style = '';
719
+ if ( in_array( $column_key, $hidden ) )
720
+ $style = 'display:none;';
721
+
722
+ $style = ' style="' . $style . '"';
723
+
724
+ if ( 'cb' == $column_key )
725
+ $class[] = 'check-column';
726
+ elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
727
+ $class[] = 'num';
728
+
729
+ if ( isset( $sortable[$column_key] ) ) {
730
+ list( $orderby, $desc_first ) = $sortable[$column_key];
731
+
732
+ if ( $current_orderby == $orderby ) {
733
+ $order = 'asc' == $current_order ? 'desc' : 'asc';
734
+ $class[] = 'sorted';
735
+ $class[] = $current_order;
736
+ } else {
737
+ $order = $desc_first ? 'desc' : 'asc';
738
+ $class[] = 'sortable';
739
+ $class[] = $desc_first ? 'asc' : 'desc';
740
+ }
741
+
742
+ $column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicator"></span></a>';
743
+ }
744
+
745
+ $id = $with_id ? "id='$column_key'" : '';
746
+
747
+ if ( !empty( $class ) )
748
+ $class = "class='" . join( ' ', $class ) . "'";
749
+
750
+ echo "<th scope='col' $id $class $style>$column_display_name</th>";
751
+ }
752
+ }
753
+
754
+ /**
755
+ * Display the table
756
+ *
757
+ * @since 3.1.0
758
+ * @access public
759
+ */
760
+ function display() {
761
+ extract( $this->_args );
762
+
763
+ $this->display_tablenav( 'top' );
764
+
765
+ ?>
766
+ <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
767
+ <thead>
768
+ <tr>
769
+ <?php $this->print_column_headers(); ?>
770
+ </tr>
771
+ </thead>
772
+
773
+ <tfoot>
774
+ <tr>
775
+ <?php $this->print_column_headers( false ); ?>
776
+ </tr>
777
+ </tfoot>
778
+
779
+ <tbody id="the-list"<?php if ( $singular ) echo " data-wp-lists='list:$singular'"; ?>>
780
+ <?php $this->display_rows_or_placeholder(); ?>
781
+ </tbody>
782
+ </table>
783
+ <?php
784
+ $this->display_tablenav( 'bottom' );
785
+ }
786
+
787
+ /**
788
+ * Get a list of CSS classes for the <table> tag
789
+ *
790
+ * @since 3.1.0
791
+ * @access protected
792
+ *
793
+ * @return array
794
+ */
795
+ function get_table_classes() {
796
+ return array( 'widefat', 'fixed', $this->_args['plural'] );
797
+ }
798
+
799
+ /**
800
+ * Generate the table navigation above or below the table
801
+ *
802
+ * @since 3.1.0
803
+ * @access protected
804
+ */
805
+ function display_tablenav( $which ) {
806
+ if ( 'top' == $which )
807
+ wp_nonce_field( 'bulk-' . $this->_args['plural'] );
808
+ ?>
809
+ <div class="tablenav <?php echo esc_attr( $which ); ?>">
810
+
811
+ <div class="alignleft actions bulkactions">
812
+ <?php $this->bulk_actions(); ?>
813
+ </div>
814
+ <?php
815
+ $this->extra_tablenav( $which );
816
+ $this->pagination( $which );
817
+ ?>
818
+
819
+ <br class="clear" />
820
+ </div>
821
+ <?php
822
+ }
823
+
824
+ /**
825
+ * Extra controls to be displayed between bulk actions and pagination
826
+ *
827
+ * @since 3.1.0
828
+ * @access protected
829
+ */
830
+ function extra_tablenav( $which ) {}
831
+
832
+ /**
833
+ * Generate the <tbody> part of the table
834
+ *
835
+ * @since 3.1.0
836
+ * @access protected
837
+ */
838
+ function display_rows_or_placeholder() {
839
+ if ( $this->has_items() ) {
840
+ $this->display_rows();
841
+ } else {
842
+ list( $columns, $hidden ) = $this->get_column_info();
843
+ echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
844
+ $this->no_items();
845
+ echo '</td></tr>';
846
+ }
847
+ }
848
+
849
+ /**
850
+ * Generate the table rows
851
+ *
852
+ * @since 3.1.0
853
+ * @access protected
854
+ */
855
+ function display_rows() {
856
+ foreach ( $this->items as $item )
857
+ $this->single_row( $item );
858
+ }
859
+
860
+ /**
861
+ * Generates content for a single row of the table
862
+ *
863
+ * @since 3.1.0
864
+ * @access protected
865
+ *
866
+ * @param object $item The current item
867
+ */
868
+ function single_row( $item ) {
869
+ static $row_class = '';
870
+ $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
871
+
872
+ echo '<tr' . $row_class . '>';
873
+ $this->single_row_columns( $item );
874
+ echo '</tr>';
875
+ }
876
+
877
+ /**
878
+ * Generates the columns for a single row of the table
879
+ *
880
+ * @since 3.1.0
881
+ * @access protected
882
+ *
883
+ * @param object $item The current item
884
+ */
885
+ function single_row_columns( $item ) {
886
+ list( $columns, $hidden ) = $this->get_column_info();
887
+
888
+ foreach ( $columns as $column_name => $column_display_name ) {
889
+ $class = "class='$column_name column-$column_name'";
890
+
891
+ $style = '';
892
+ if ( in_array( $column_name, $hidden ) )
893
+ $style = ' style="display:none;"';
894
+
895
+ $attributes = "$class$style";
896
+
897
+ if ( 'cb' == $column_name ) {
898
+ echo '<th scope="row" class="check-column">';
899
+ echo $this->column_cb( $item );
900
+ echo '</th>';
901
+ }
902
+ elseif ( method_exists( $this, 'column_' . $column_name ) ) {
903
+ echo "<td $attributes>";
904
+ echo call_user_func( array( $this, 'column_' . $column_name ), $item );
905
+ echo "</td>";
906
+ }
907
+ else {
908
+ echo "<td $attributes>";
909
+ echo $this->column_default( $item, $column_name );
910
+ echo "</td>";
911
+ }
912
+ }
913
+ }
914
+
915
+ /**
916
+ * Handle an incoming ajax request (called from admin-ajax.php)
917
+ *
918
+ * @since 3.1.0
919
+ * @access public
920
+ */
921
+ function ajax_response() {
922
+ $this->prepare_items();
923
+
924
+ extract( $this->_args );
925
+ extract( $this->_pagination_args, EXTR_SKIP );
926
+
927
+ ob_start();
928
+ if ( ! empty( $_REQUEST['no_placeholder'] ) )
929
+ $this->display_rows();
930
+ else
931
+ $this->display_rows_or_placeholder();
932
+
933
+ $rows = ob_get_clean();
934
+
935
+ $response = array( 'rows' => $rows );
936
+
937
+ if ( isset( $total_items ) )
938
+ $response['total_items_i18n'] = sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) );
939
+
940
+ if ( isset( $total_pages ) ) {
941
+ $response['total_pages'] = $total_pages;
942
+ $response['total_pages_i18n'] = number_format_i18n( $total_pages );
943
+ }
944
+
945
+ die( json_encode( $response ) );
946
+ }
947
+
948
+ /**
949
+ * Send required variables to JavaScript land
950
+ *
951
+ * @access private
952
+ */
953
+ function _js_vars() {
954
+ $args = array(
955
+ 'class' => get_class( $this ),
956
+ 'screen' => array(
957
+ 'id' => $this->screen->id,
958
+ 'base' => $this->screen->base,
959
+ )
960
+ );
961
+
962
+ printf( "<script type='text/javascript'>list_args = %s;</script>\n", json_encode( $args ) );
963
+ }
964
+ }
965
+
966
+ endif;
admin/includes/classes/class-axiom-screen-help.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Simple class to add help tabs on top of admin pages
4
+ *
5
+ * @package Axiom
6
+ * @author averta [averta.net]
7
+ * @license LICENSE.txt
8
+ * @link http://averta.net
9
+ * @copyright Copyright © 2014 averta
10
+ */
11
+
12
+
13
+ if( ! class_exists( 'Axiom_Screen_Help' ) ) :
14
+
15
+ /**
16
+ * Simple class to add help tabs on top of admin pages
17
+ */
18
+ class Axiom_Screen_Help {
19
+
20
+ /**
21
+ * variable that holds tabs list
22
+ * @var array
23
+ */
24
+ public $tabs = array();
25
+
26
+ /**
27
+ * A perfix to make tabs data filterable and extendable
28
+ * @var string
29
+ */
30
+ public $filter_prefix = '';
31
+
32
+ /**
33
+ * __construct, assign screen hooks to display help tabs on target screens
34
+ *
35
+ * @param array $tabs an array containing help tabs list
36
+ * @param string|array $allowed_screen_ids the screens id(s) that help tabs should be displayed on.
37
+ * Default value is 'all' that means help tabs will be displayed across all admin page
38
+ */
39
+ public function __construct( $tabs = '', $allowed_screen_ids = 'all', $prefix = 'axiom_help_tab_' ) {
40
+
41
+ // store passed tabs and prefix
42
+ $this->tabs = (array)$tabs;
43
+ $this->filter_prefix = $prefix;
44
+
45
+
46
+ if( 'all' == $allowed_screen_ids ) {
47
+ add_action( 'in_admin_header' , array( $this, 'display_help_panel' ), 10, 3 );
48
+ return;
49
+ }
50
+
51
+ foreach ( (array)$allowed_screen_ids as $screen_id ) {
52
+ add_action( 'load-' . $screen_id , array( $this, 'display_help_panel' ), 10, 3 );
53
+ }
54
+
55
+ }
56
+
57
+ /**
58
+ * Display output in panel
59
+ * @return [type] [description]
60
+ */
61
+ public function display_help_panel() {
62
+
63
+ $screen = get_current_screen();
64
+
65
+ foreach ($this->tabs as $tab ) {
66
+
67
+ if( empty( $tab ) )
68
+ continue;
69
+
70
+ if( !isset( $tab['id'] ) ) {
71
+ _e( 'The help tab id is not valid.' );
72
+ continue;
73
+ }
74
+
75
+ // Add help panel
76
+ $screen->add_help_tab( apply_filters( $this->filter_prefix . $tab['id'] , $tab ) );
77
+ }
78
+ }
79
+
80
+ /**
81
+ * Store all tabs in $this->tabs
82
+ * @param array an array containing list of all tabs
83
+ */
84
+ public function set_tabs( $tabs ){
85
+ $this->tabs = $tabs;
86
+ }
87
+
88
+ /**
89
+ * Add a tab to help tabs list
90
+ * @example array('id' => 'the-tab-name-id',
91
+ * 'title' => __( 'Tab Title' ),
92
+ * 'content' => 'Tab contant'
93
+ * )
94
+ * @param array array containing tab data according to example
95
+ */
96
+ public function add_tab( $tab ){
97
+ $this->tabs[] = $tab;
98
+ }
99
+
100
+ }
101
+
102
+ endif;
admin/includes/classes/class-msp-admin-ajax.php ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php //
2
+
3
+ /**
4
+ *
5
+ */
6
+ class MSP_Admin_Ajax {
7
+
8
+
9
+
10
+ function __construct () {
11
+
12
+ // get and save data on ajax data post
13
+ add_action( 'wp_ajax_msp_panel_handler' , array( $this, 'save_panel_ajax' ) );
14
+ add_action( 'wp_ajax_msp_create_new_handler', array( $this, 'create_new_slider' ) );
15
+ }
16
+
17
+
18
+
19
+ /**
20
+ * Save ajax handler for main panel data
21
+ *
22
+ * @since 1.0.0
23
+ */
24
+ public function save_panel_ajax() {
25
+
26
+ header( "Content-Type: application/json" );
27
+
28
+ // verify nonce
29
+ if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], "msp_panel") ) {
30
+ echo json_encode( array( 'success' => false, 'message' => __("Authorization failed!", MSWP_TEXT_DOMAIN ) ) );
31
+ exit();
32
+ }
33
+
34
+ // ignore the request if the current user doesn't have sufficient permissions
35
+ if ( ! current_user_can( 'publish_masterslider' ) ) {
36
+ echo json_encode( array( 'success' => false,
37
+ 'message' => apply_filters( 'masterslider_insufficient_permissions_to_publish_message', __( "Sorry, You don't have enough permission to publish slider!", MSWP_TEXT_DOMAIN ) )
38
+ )
39
+ );
40
+ exit();
41
+ }
42
+
43
+ /////////////////////////////////////////////////////////////////////////////////////////
44
+
45
+ // Get the slider id
46
+ $slider_id = isset( $_REQUEST['slider_id'] ) ? $_REQUEST['slider_id'] : '';
47
+
48
+ if ( empty( $slider_id ) ) {
49
+ echo json_encode( array( 'success' => false, 'type' => 'save' , 'message' => __( "Slider id is not defined.", MSWP_TEXT_DOMAIN ) ) );
50
+ exit;
51
+ }
52
+
53
+ // get the slider type
54
+ $slider_type = isset( $_REQUEST['slider_type'] ) ? $_REQUEST['slider_type'] : 'custom';
55
+
56
+ // get panel data
57
+ $msp_data = isset( $_REQUEST['msp_data'] ) ? $_REQUEST['msp_data'] : NULL;
58
+
59
+
60
+ // get parse and database tools
61
+ global $mspdb;
62
+
63
+ // load and get parser and start parsing data
64
+ $parser = msp_get_parser();
65
+ $parser->set_data( $msp_data, $slider_id );
66
+
67
+ // get required parsed data
68
+ $slider_setting = $parser->get_slider_setting();
69
+ $slides = $parser->get_slides();
70
+ $slider_custom_styles = $parser->get_styles();
71
+
72
+ $fields = array(
73
+ 'title' => $slider_setting[ 'title' ],
74
+ 'type' => $slider_setting[ 'slider_type' ],
75
+ 'slides_num' => count( $slides ),
76
+ 'params' => $msp_data,
77
+ 'custom_styles' => $slider_custom_styles,
78
+ 'custom_fonts' => $slider_setting[ 'gfonts' ],
79
+ 'status' => 'published'
80
+ );
81
+
82
+ // store slider data in database
83
+ $is_saved = $mspdb->update_slider( $slider_id, $fields );
84
+
85
+ msp_save_custom_styles();
86
+
87
+
88
+ // flush slider cache if slider cache is enabled
89
+ msp_flush_slider_cache( $slider_id );
90
+
91
+
92
+ // create and output the response
93
+ if( isset( $is_saved ) )
94
+ $response = json_encode( array( 'success' => true, 'type' => 'save' , 'message' => __( "Saved Successfully.", MSWP_TEXT_DOMAIN ) ) );
95
+ else
96
+ $response = json_encode( array( 'success' => true, 'type' => 'save' , 'message' => __( "No Data Recieved." , MSWP_TEXT_DOMAIN ) ) );
97
+
98
+ echo $response;
99
+
100
+ exit;// IMPORTANT
101
+ }
102
+
103
+
104
+
105
+ /**
106
+ * Create new slider by type
107
+ *
108
+ * @since 1.0.0
109
+ */
110
+ public function create_new_slider() {
111
+
112
+ header( "Content-Type: application/json" );
113
+
114
+ // verify nonce
115
+ if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], "msp_panel") ) {
116
+ echo json_encode( array( 'success' => false, 'message' => __("Authorization failed!", MSWP_TEXT_DOMAIN ) ) );
117
+ exit();
118
+ }
119
+
120
+ // ignore the request if the current user doesn't have sufficient permissions
121
+ if ( ! current_user_can( 'create_masterslider' ) && ! current_user_can( 'publish_masterslider' ) ) {
122
+ echo json_encode( array( 'success' => false,
123
+ 'message' => apply_filters( 'masterslider_create_slider_permissions_message', __( "Sorry, You don't have enough permission to create slider!", MSWP_TEXT_DOMAIN ) )
124
+ )
125
+ );
126
+ exit();
127
+ }
128
+
129
+
130
+ /////////////////////////////////////////////////////////////////////////////////////////
131
+
132
+ // Get the slider id
133
+ $slider_type = isset( $_REQUEST['slider_type'] ) ? $_REQUEST['slider_type'] : '';
134
+
135
+
136
+ // Get new slider id
137
+ global $mspdb;
138
+ $slider_id = $mspdb->add_slider( array( 'status' => 'draft', 'type' => $slider_type ) );
139
+
140
+
141
+ // create and output the response
142
+ if( false !== $slider_id )
143
+ $response = json_encode( array( 'success' => true, 'slider_id' => $slider_id , 'redirect' => admin_url( 'admin.php?page='.MSWP_SLUG.'&action=edit&slider_id='.$slider_id.'&slider_type='.$slider_type ), 'message' => __( "Slider Created Successfully.", MSWP_TEXT_DOMAIN ) ) );
144
+ else
145
+ $response = json_encode( array( 'success' => true, 'slider_id' => '' , 'redirect' => '', message => __( "Slider can not be created." , MSWP_TEXT_DOMAIN ) ) );
146
+
147
+ echo $response;
148
+
149
+ exit;// IMPORTANT
150
+ }
151
+
152
+
153
+ }
154
+
155
+ new MSP_Admin_Ajax();
admin/includes/classes/class-msp-admin-assets.php ADDED
@@ -0,0 +1,360 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Master Slider Admin Scripts Class.
4
+ *
5
+ * @package MasterSlider
6
+ * @author averta [averta.net]
7
+ * @license LICENSE.txt
8
+ * @link http://masterslider.com
9
+ * @copyright Copyright © 2014 averta
10
+ */
11
+
12
+ /**
13
+ * Class to load and print master slider panel scripts
14
+ */
15
+ class MSP_Admin_Assets {
16
+
17
+
18
+ /**
19
+ * __construct
20
+ */
21
+ function __construct() {
22
+
23
+ }
24
+
25
+
26
+ public function enqueue (){
27
+
28
+ // general assets
29
+ $this->load_general_styles();
30
+ $this->load_panel_styles();
31
+
32
+ $this->add_general_variables();
33
+ $this->add_general_script_localizations();
34
+ $this->load_general_scripts();
35
+
36
+ // panel spesific assets
37
+ if( isset( $_REQUEST['action'] ) && in_array( $_REQUEST['action'], array( 'edit', 'add' ) ) ) {
38
+
39
+ $this->load_panel_scripts();
40
+ $this->add_panel_variables();
41
+ $this->add_panel_script_localizations();
42
+ }
43
+
44
+ }
45
+
46
+
47
+ /**
48
+ * Load scripts for master slider admin panel
49
+ * @return void
50
+ */
51
+ public function load_panel_scripts() {
52
+
53
+ // Load wp media uploader
54
+ wp_enqueue_media();
55
+
56
+ // Master Slider Panel Scripts
57
+ wp_enqueue_script( MSWP_SLUG . '-handlebars' , MSWP_AVERTA_ADMIN_URL . '/views/slider-panel/js/handlebars.min.js', array( 'jquery' ), MSWP_AVERTA_VERSION, true );
58
+ wp_enqueue_script( MSWP_SLUG . '-ember-js' , MSWP_AVERTA_ADMIN_URL . '/views/slider-panel/js/ember.min.js', array( 'jquery' ), MSWP_AVERTA_VERSION, true );
59
+ wp_enqueue_script( MSWP_SLUG . '-ember-model' , MSWP_AVERTA_ADMIN_URL . '/views/slider-panel/js/ember-model.min.js', array( 'jquery' ), MSWP_AVERTA_VERSION, true );
60
+ wp_enqueue_script( MSWP_SLUG . '-msp-required' , MSWP_AVERTA_ADMIN_URL . '/views/slider-panel/js/msp.required.js',
61
+ array(
62
+ 'jquery', 'jquery-ui-core', 'jquery-ui-dialog', 'jquery-ui-draggable',
63
+ 'jquery-ui-sortable', 'jquery-ui-slider', 'jquery-ui-spinner'
64
+ ),
65
+ MSWP_AVERTA_VERSION, true
66
+ );
67
+
68
+ wp_enqueue_script( MSWP_SLUG . '-masterslider-wp', MSWP_AVERTA_ADMIN_URL . '/views/slider-panel/js/masterslider.wp.js', array( MSWP_SLUG . '-msp-required' ), MSWP_AVERTA_VERSION, true );
69
+ }
70
+
71
+
72
+ /**
73
+ * Print required variable for master slider panel
74
+ */
75
+ public function add_panel_variables() {
76
+
77
+ $slider_skins = array(
78
+ array( 'class' => 'ms-skin-default', 'label' => 'Default' ),
79
+ array( 'class' => 'ms-skin-light-2', 'label' => 'Light 2' ),
80
+ array( 'class' => 'ms-skin-light-3', 'label' => 'Light 3' ),
81
+ array( 'class' => 'ms-skin-light-4', 'label' => 'Light 4' ),
82
+ array( 'class' => 'ms-skin-light-5', 'label' => 'Light 5' ),
83
+ array( 'class' => 'ms-skin-light-6', 'label' => 'Light 6' ),
84
+ array( 'class' => 'ms-skin-light-6 round-skin', 'label' => 'Light 6 Round' ),
85
+
86
+ array( 'class' => 'ms-skin-contrast', 'label' => 'Contrast' ),
87
+ array( 'class' => 'ms-skin-black-1' , 'label' => 'Black 1' ),
88
+ array( 'class' => 'ms-skin-black-2' , 'label' => 'Black 2' ),
89
+ array( 'class' => 'ms-skin-black-2 round-skin', 'label' => 'Black 2 Round' ),
90
+ array( 'class' => 'ms-skin-metro' , 'label' => 'Metro' )
91
+ );
92
+
93
+ wp_localize_script( 'jquery', '__MSP_SKINS', apply_filters( 'masterslider_skins', $slider_skins ) );
94
+
95
+ // get and print slider id
96
+ if ( isset( $_REQUEST['slider_id'] ) ) {
97
+
98
+ $slider_id = $_REQUEST['slider_id'];
99
+
100
+ } else {
101
+ global $mspdb;
102
+ $slider_id = 0;
103
+
104
+ if ( isset( $_REQUEST['action'] ) && 'add' == $_REQUEST['action'] ) {
105
+ $slider_id = $mspdb->add_slider( array( 'status' => 'draft' ) );
106
+ wp_localize_script( 'jquery', '__MSP_SLIDER_ID', (string) $slider_id );
107
+ }
108
+ }
109
+
110
+ // Get and print panel data
111
+ if ( $slider_id ) {
112
+
113
+ global $mspdb;
114
+ $slider_data = $mspdb->get_slider( $slider_id );
115
+
116
+ $slider_type = isset( $slider_data[ 'type' ] ) ? $slider_data[ 'type' ] : 'custom';
117
+ $slider_type = empty( $slider_type ) ? 'custom' : $slider_type;
118
+
119
+ $msp_data = isset( $slider_data[ 'params' ] ) ? $slider_data[ 'params' ] : NULL;
120
+ $msp_data = empty( $slider_data[ 'params' ] ) ? NULL : $slider_data[ 'params' ];
121
+
122
+ $msp_preset_style = msp_get_option( 'preset_style' , NULL );
123
+ $msp_preset_effect = msp_get_option( 'preset_effect', NULL );
124
+ $msp_buttons_style = msp_get_option( 'buttons_style', NULL );
125
+
126
+ $msp_preset_style = empty( $msp_preset_style ) ? NULL : $msp_preset_style;
127
+ $msp_preset_effect = empty( $msp_preset_effect ) ? NULL : $msp_preset_effect;
128
+ $msp_buttons_style = empty( $msp_buttons_style ) ? NULL : $msp_buttons_style;
129
+
130
+ wp_localize_script( 'jquery', '__MSP_DATA' , $msp_data );
131
+ wp_localize_script( 'jquery', '__MSP_PRESET_STYLE' , $msp_preset_style );
132
+ wp_localize_script( 'jquery', '__MSP_PRESET_EFFECT' , $msp_preset_effect );
133
+ wp_localize_script( 'jquery', '__MSP_TYPE' , $slider_type );
134
+ wp_localize_script( 'jquery', '__MSP_PRESET_BUTTON' , $msp_buttons_style );
135
+ }
136
+
137
+
138
+ // define panel directory path
139
+ wp_localize_script( 'jquery', '__MSP_PATH', MSWP_AVERTA_ADMIN_URL . '/views/slider-panel/' );
140
+
141
+ do_action( 'masterslider_admin_add_panel_variables', $slider_type );
142
+ }
143
+
144
+
145
+
146
+
147
+ /**
148
+ * Print required variable for master slider admin page
149
+ */
150
+ public function add_general_variables() {
151
+
152
+ $uploads = wp_upload_dir();
153
+
154
+ // define admin ajax address and master slider page
155
+ wp_localize_script( 'jquery', '__MS', array(
156
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
157
+ 'msp_menu_page' => menu_page_url( MSWP_SLUG, false ),
158
+ 'msp_plugin_url' => MSWP_AVERTA_URL,
159
+ 'upload_dir' => $uploads['baseurl'],
160
+ 'importer' => admin_url( 'admin.php?import=masterslider-importer' )
161
+ ));
162
+ }
163
+
164
+
165
+ /**
166
+ * Add script localizations
167
+ */
168
+ public function add_panel_script_localizations() {
169
+
170
+ wp_localize_script( 'jquery', '__MSP_LAN', apply_filters( 'masterslider_admin_localize', array(
171
+
172
+ // CallbacksController.js
173
+ 'cb_001' => __( 'On slide change start', MSWP_TEXT_DOMAIN ),
174
+ 'cb_002' => __( 'On slide change end', MSWP_TEXT_DOMAIN ),
175
+ 'cb_003' => __( 'On slide timer change', MSWP_TEXT_DOMAIN ),
176
+ 'cb_004' => __( 'On slider resize', MSWP_TEXT_DOMAIN ),
177
+ 'cb_005' => __( 'On Youtube/Vimeo video play', MSWP_TEXT_DOMAIN ),
178
+ 'cb_006' => __( 'On Youtube/Vimeo video close', MSWP_TEXT_DOMAIN ),
179
+ 'cb_007' => __( 'On swipe start', MSWP_TEXT_DOMAIN ),
180
+ 'cb_008' => __( 'On swipe move', MSWP_TEXT_DOMAIN ),
181
+ 'cb_009' => __( 'On swipe end', MSWP_TEXT_DOMAIN ),
182
+ 'cb_010' => __( 'Are you sure you want to remove "%s" callback?', MSWP_TEXT_DOMAIN ),
183
+ 'cb_011' => __( 'On slider Init', MSWP_TEXT_DOMAIN ),
184
+
185
+ // ControlsController.js
186
+ 'cc_001' => __( 'Arrows', MSWP_TEXT_DOMAIN ),
187
+ 'cc_002' => __( 'Line Timer', MSWP_TEXT_DOMAIN ),
188
+ 'cc_003' => __( 'Bullets', MSWP_TEXT_DOMAIN ),
189
+ 'cc_004' => __( 'Circle Timer', MSWP_TEXT_DOMAIN ),
190
+ 'cc_005' => __( 'Scrollbar', MSWP_TEXT_DOMAIN ),
191
+ 'cc_006' => __( 'Slide Info', MSWP_TEXT_DOMAIN ),
192
+ 'cc_007' => __( 'Thumblist/Tabs', MSWP_TEXT_DOMAIN ),
193
+
194
+ // EffectsController
195
+ 'ec_001' => __( 'Please enter name for new preset effect', MSWP_TEXT_DOMAIN ),
196
+ 'ec_002' => __( 'Custom effect', MSWP_TEXT_DOMAIN ),
197
+
198
+ // LayersController.js
199
+ 'lc_001' => __( 'Text Layer', MSWP_TEXT_DOMAIN ),
200
+ 'lc_002' => __( 'Image Layer', MSWP_TEXT_DOMAIN ),
201
+ 'lc_003' => __( 'Video Layer', MSWP_TEXT_DOMAIN ),
202
+ 'lc_004' => __( 'Hotspot', MSWP_TEXT_DOMAIN ),
203
+ 'lc_006' => __( 'Button Layer', MSWP_TEXT_DOMAIN ),
204
+
205
+ // StylesController.js
206
+ 'sc_001' => __( 'Please enter name for new preset style', MSWP_TEXT_DOMAIN ),
207
+ 'sc_002' => __( 'Custom style', MSWP_TEXT_DOMAIN ),
208
+
209
+ //SliderModel.js
210
+ 'sm_001' => __( 'Untitled Slider', MSWP_TEXT_DOMAIN ),
211
+
212
+ // EffectEditorView.js
213
+ 'ee_001' => __( 'Preset Transitions', MSWP_TEXT_DOMAIN ),
214
+ 'ee_002' => __( 'Apply transition', MSWP_TEXT_DOMAIN ),
215
+ 'ee_003' => __( 'Save as preset', MSWP_TEXT_DOMAIN ),
216
+ 'ee_006' => __( 'Transition Editor', MSWP_TEXT_DOMAIN ),
217
+
218
+ // StageView.js
219
+ 'sv_001' => __( 'Align to stage :', MSWP_TEXT_DOMAIN ),
220
+ 'sv_002' => __( 'Snapping :', MSWP_TEXT_DOMAIN ),
221
+ 'sv_003' => __( 'Zoom :', MSWP_TEXT_DOMAIN ),
222
+ 'sv_010' => __( 'Layer position origin : ', MSWP_TEXT_DOMAIN ),
223
+
224
+ //StyleEditorView.js
225
+ 'se_001' => __( 'Apply style', MSWP_TEXT_DOMAIN ),
226
+ 'se_002' => __( 'Save as preset', MSWP_TEXT_DOMAIN ),
227
+ 'se_003' => __( 'Preset Styles', MSWP_TEXT_DOMAIN ),
228
+ 'se_004' => __( 'By deleting preset style it also will be removed from other sliders in your website. Are you sure you want to delete "%s"?', MSWP_TEXT_DOMAIN ),
229
+ 'se_006' => __( 'Style Editor', MSWP_TEXT_DOMAIN ),
230
+
231
+ //TemplatesView.js
232
+ 'tv_001' => __( 'Master Slider Templates', MSWP_TEXT_DOMAIN ),
233
+ 'tv_002' => __( 'Changing template will reset all slider controls and will change some slider settings. Continue?', MSWP_TEXT_DOMAIN),
234
+ //TimelineView.js
235
+ 'tl_001' => __( 'Show/Hide all', MSWP_TEXT_DOMAIN ),
236
+ 'tl_002' => __( 'Solo All', MSWP_TEXT_DOMAIN ),
237
+ 'tl_003' => __( 'Lock/Unlock all', MSWP_TEXT_DOMAIN ),
238
+ 'tl_004' => __( 'Exit preview', MSWP_TEXT_DOMAIN ),
239
+ 'tl_005' => __( 'Preview slide', MSWP_TEXT_DOMAIN ),
240
+ 'tl_006' => __( 'Show/Hide', MSWP_TEXT_DOMAIN ),
241
+ 'tl_007' => __( 'Solo', MSWP_TEXT_DOMAIN ),
242
+ 'tl_008' => __( 'Lock/Unlock', MSWP_TEXT_DOMAIN ),
243
+ 'tl_009' => __( 'Are you sure you want to remove this layer?', MSWP_TEXT_DOMAIN ),
244
+ 'tl_010' => __( 'Start delay :', MSWP_TEXT_DOMAIN ),
245
+ 'tl_011' => __( 'Show duration :', MSWP_TEXT_DOMAIN ),
246
+ 'tl_012' => __( 'Waiting duration :', MSWP_TEXT_DOMAIN ),
247
+ 'tl_013' => __( 'Hide duration :', MSWP_TEXT_DOMAIN ),
248
+
249
+ //UIViews.js
250
+ 'ui_001' => __( 'Show/Hide slide', MSWP_TEXT_DOMAIN ),
251
+ 'ui_002' => __( 'Duplicate slide', MSWP_TEXT_DOMAIN ),
252
+ 'ui_003' => __( 'Remove slide', MSWP_TEXT_DOMAIN ),
253
+ 'ui_004' => __( 'Are you sure you want to delete this slide?', MSWP_TEXT_DOMAIN ),
254
+ 'ui_005' => __( 'Open on the same page', MSWP_TEXT_DOMAIN ),
255
+ 'ui_006' => __( 'Open on new page', MSWP_TEXT_DOMAIN ),
256
+ 'ui_007' => __( 'Open in parent frame', MSWP_TEXT_DOMAIN ),
257
+ 'ui_008' => __( 'Open in main frame', MSWP_TEXT_DOMAIN ),
258
+ 'ui_009' => __( 'Fill', MSWP_TEXT_DOMAIN ),
259
+ 'ui_010' => __( 'Fit', MSWP_TEXT_DOMAIN ),
260
+ 'ui_011' => __( 'Center', MSWP_TEXT_DOMAIN ),
261
+ 'ui_012' => __( 'Stretch', MSWP_TEXT_DOMAIN ),
262
+ 'ui_013' => __( 'Tile', MSWP_TEXT_DOMAIN ),
263
+ 'ui_014' => __( 'None', MSWP_TEXT_DOMAIN ),
264
+ 'ui_015' => __( 'Align top', MSWP_TEXT_DOMAIN ),
265
+ 'ui_016' => __( 'Align vertical center', MSWP_TEXT_DOMAIN ),
266
+ 'ui_017' => __( 'Align bottom', MSWP_TEXT_DOMAIN ),
267
+ 'ui_018' => __( 'Align left', MSWP_TEXT_DOMAIN ),
268
+ 'ui_019' => __( 'Align horizontal center', MSWP_TEXT_DOMAIN ),
269
+ 'ui_020' => __( 'Align right', MSWP_TEXT_DOMAIN ),
270
+
271
+ // ApplicationController.js
272
+ 'ap_001' => __( 'Sending data...', MSWP_TEXT_DOMAIN ),
273
+ 'ap_002' => __( 'An Error accorded, please try again.', MSWP_TEXT_DOMAIN ),
274
+ 'ap_003' => __( 'Data saved successfully.', MSWP_TEXT_DOMAIN ),
275
+
276
+ 'flk_001' => __( 'Photo title', MSWP_TEXT_DOMAIN ),
277
+ 'flk_002' => __( 'Photo owner name', MSWP_TEXT_DOMAIN ),
278
+ 'flk_003' => __( 'Date taken', MSWP_TEXT_DOMAIN ),
279
+ 'flk_004' => __( 'Photo description', MSWP_TEXT_DOMAIN ),
280
+
281
+ 'fb_001' => __( 'Photo name', MSWP_TEXT_DOMAIN ),
282
+ 'fb_002' => __( 'Photo owner name', MSWP_TEXT_DOMAIN ),
283
+ 'fb_003' => __( 'Photo link', MSWP_TEXT_DOMAIN ),
284
+
285
+ 'ui_021' => __( 'Goto next slide', MSWP_TEXT_DOMAIN ),
286
+ 'ui_022' => __( 'Goto previous slide', MSWP_TEXT_DOMAIN ),
287
+ 'ui_022' => __( 'Goto slide', MSWP_TEXT_DOMAIN ),
288
+ 'ui_023' => __( 'Pause timer', MSWP_TEXT_DOMAIN ),
289
+ 'ui_024' => __( 'Resume timer', MSWP_TEXT_DOMAIN ),
290
+
291
+ 'be_001' => __( 'Update Button Style', MSWP_TEXT_DOMAIN ),
292
+ 'be_002' => __( 'Save As New Button', MSWP_TEXT_DOMAIN ),
293
+ 'be_003' => __( 'Are you sure you want to delete this button?', MSWP_TEXT_DOMAIN ),
294
+ 'be_004' => __( 'Buttons', MSWP_TEXT_DOMAIN ),
295
+ 'be_005' => __( 'Button Editor', MSWP_TEXT_DOMAIN ),
296
+ 'be_006' => __( 'By updating a button it will be changed in all of your sliders. Are you sure you want to update this button?', MSWP_TEXT_DOMAIN )
297
+
298
+ ) ) );
299
+
300
+ }
301
+
302
+
303
+
304
+ /**
305
+ * Add general script localizations
306
+ */
307
+ public function add_general_script_localizations() {
308
+
309
+ wp_localize_script( 'jquery', '__MSP_GEN_LAN', apply_filters( 'masterslider_admin_general_localize', array(
310
+
311
+ 'genl_001' => __( 'The changes you made will be lost if you navigate away from this page. To exit preview mode click on close (X) button.', MSWP_TEXT_DOMAIN ),
312
+ 'genl_002' => __( 'Master Slider Preview', MSWP_TEXT_DOMAIN ),
313
+ 'genl_003' => __( 'Loading Slider ..', MSWP_TEXT_DOMAIN ),
314
+ 'genl_004' => __( 'Creating The Slider ..', MSWP_TEXT_DOMAIN ),
315
+ 'genl_005' => __( 'Select a Starter', MSWP_TEXT_DOMAIN ),
316
+ 'genl_006' => __( 'No slider is selected to export.', MSWP_TEXT_DOMAIN ),
317
+ 'genl_007' => __( 'Import', MSWP_TEXT_DOMAIN )
318
+
319
+ ) ) );
320
+
321
+ }
322
+
323
+
324
+
325
+ /**
326
+ * Panel spesific styles
327
+ *
328
+ * @return void
329
+ */
330
+ public function load_panel_styles() {
331
+
332
+ // Master Slider Panel styles
333
+ wp_enqueue_style( MSWP_SLUG .'-reset', MSWP_AVERTA_ADMIN_URL . '/views/slider-panel/css/reset.css', array(), MSWP_AVERTA_VERSION );
334
+ wp_enqueue_style( MSWP_SLUG .'-jq-ui', MSWP_AVERTA_ADMIN_URL . '/views/slider-panel/css/jquery-ui-1.10.4.min.css', array(), MSWP_AVERTA_VERSION );
335
+ wp_enqueue_style( MSWP_SLUG .'-spectrum', MSWP_AVERTA_ADMIN_URL . '/views/slider-panel/css/spectrum.css', array(), MSWP_AVERTA_VERSION );
336
+ wp_enqueue_style( MSWP_SLUG .'-codemirror', MSWP_AVERTA_ADMIN_URL . '/views/slider-panel/css/codemirror.css', array(), MSWP_AVERTA_VERSION );
337
+ wp_enqueue_style( MSWP_SLUG .'-jscrollpane', MSWP_AVERTA_ADMIN_URL . '/views/slider-panel/css/jquery.jscrollpane.css', array(), MSWP_AVERTA_VERSION );
338
+ wp_enqueue_style( MSWP_SLUG .'-main-style', MSWP_AVERTA_ADMIN_URL . '/views/slider-panel/css/msp-style.css', array(), MSWP_AVERTA_VERSION );
339
+ wp_enqueue_style( MSWP_SLUG .'-components', MSWP_AVERTA_ADMIN_URL . '/views/slider-panel/css/msp-components.css', array(), MSWP_AVERTA_VERSION );
340
+
341
+ }
342
+
343
+ /**
344
+ * Master slider general/common styles
345
+ *
346
+ * @return void
347
+ */
348
+ public function load_general_styles() {
349
+ // gnereal styles for masterslider admin page
350
+ wp_enqueue_style( MSWP_SLUG .'-admin-styles', MSWP_AVERTA_ADMIN_URL . '/assets/css/msp-general.css', array(), MSWP_AVERTA_VERSION );
351
+ }
352
+
353
+
354
+ public function load_general_scripts() {
355
+ // disable wp autosave on master slider panel
356
+ wp_dequeue_script( 'autosave' );
357
+ wp_enqueue_script( MSWP_SLUG .'-admin-scripts', MSWP_AVERTA_ADMIN_URL . '/assets/js/admin.js', array('jquery', 'jquery-ui-core', 'jquery-ui-dialog'), MSWP_AVERTA_VERSION, true );
358
+ }
359
+
360
+ }
admin/includes/classes/class-msp-importer.php ADDED
@@ -0,0 +1,786 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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@link http://masterslider.com
9
+ * @copyright Copyright © 2014 averta
10
+ */
11
+
12
+ // no direct access allowed
13
+ if (!defined('ABSPATH')) {
14
+ die();
15
+ }
16
+
17
+ /**
18
+ * Master Slider Import/Export Class.
19
+ *
20
+ * @since 1.2.0
21
+ */
22
+ class MSP_Importer {
23
+
24
+
25
+ var $origin_upload_baseurl = '';
26
+
27
+ var $upload_baseurl = '';
28
+
29
+ var $upload_basedir = '';
30
+
31
+ var $image_import_queue = array();
32
+
33
+ var $import_medias = true;
34
+
35
+ var $last_new_slider_id = null;
36
+
37
+
38
+
39
+ function __construct() {
40
+
41
+ add_action( 'admin_menu', array( $this, 'admin_init' ) );
42
+ }
43
+
44
+
45
+ public function admin_init() {
46
+
47
+ $upload = wp_upload_dir();
48
+ $this->upload_baseurl = $upload['baseurl'];
49
+ $this->upload_basedir = $upload['basedir'];
50
+
51
+ $this->process_export_request();
52
+
53
+ register_importer( 'masterslider-importer', __( 'Master Slider', MSWP_TEXT_DOMAIN ), __( 'Import sliders and images from a Master Slider export file.', MSWP_TEXT_DOMAIN ), array( $this, 'render_importer_page' ) );
54
+ }
55
+
56
+
57
+ public function render_importer_page() {
58
+
59
+ $this->header();
60
+
61
+ $this->process_import_request();
62
+
63
+ $this->footer();
64
+ }
65
+
66
+
67
+ /**
68
+ * Display import page title
69
+ */
70
+ function header() {
71
+ echo '<div class="wrap">';
72
+ screen_icon();
73
+ echo '<h2>' . __( 'Importing Master Slider', 'wordpress-importer' ) . '</h2><br />';
74
+ }
75
+
76
+ /**
77
+ * Close div.wrap
78
+ */
79
+ function footer() {
80
+ echo '</div>';
81
+ ?>
82
+ <script>
83
+ function mspGetParameterByName(name) {
84
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
85
+ var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
86
+ results = regex.exec(location.search);
87
+ return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
88
+ }
89
+ jQuery(window).load(function(){
90
+ if (typeof redirect_link !== 'undefined' && redirect_link !== '' ) {
91
+ window.location.replace( redirect_link );
92
+ } else {
93
+ console.log('redirect link not found');
94
+ }
95
+ });
96
+ </script>
97
+ <?php
98
+ }
99
+
100
+
101
+ /**
102
+ * Decide what the maximum file size for downloaded attachments is.
103
+ * Default is 0 (unlimited), can be filtered via masterslider_import_attachment_size_limit
104
+ *
105
+ * @return int Maximum attachment file size to import
106
+ */
107
+ function max_attachment_size() {
108
+ return apply_filters( 'masterslider_import_attachment_size_limit', 0 );
109
+ }
110
+
111
+
112
+ // if it's relative url, get absolute origin url
113
+ function get_absolute_media_url( $url ){
114
+
115
+ if( $this->is_absolute_url( $url ) || $this->contains_origin_upload_dir( $url ) )
116
+ return $url;
117
+
118
+ return $this->origin_upload_baseurl . $url;
119
+ }
120
+
121
+
122
+ /**
123
+ * Is absolute url?
124
+ * @param string $url the url
125
+ * @return boolean true if the url is absolue and false otherwise
126
+ */
127
+ public function is_absolute_url( $url ){
128
+ return preg_match( "~^(?:f|ht)tps?://~i", $url );
129
+ }
130
+
131
+
132
+ /**
133
+ * Wheather url contains origin_upload_baseurl or not
134
+ * @param string $url the url
135
+ * @return bool TRUE, if url contains origin_upload_baseurl
136
+ */
137
+ public function contains_origin_upload_dir( $url ){
138
+ return strpos( $url, $this->origin_upload_baseurl ) !== false;
139
+ }
140
+
141
+
142
+ /**
143
+ * Process incoming requests for importing sliders
144
+ * @return void
145
+ */
146
+ public function process_import_request(){
147
+
148
+ $step = isset( $_REQUEST['step'] ) && ! empty( $_REQUEST['step'] ) ? (int)$_REQUEST['step'] : 0;
149
+
150
+ if( 2 > $step ) {
151
+
152
+ $bytes = apply_filters( 'masterslider_import_upload_size_limit', wp_max_upload_size() );
153
+ $size = size_format( $bytes );
154
+ ?>
155
+
156
+ <div class="msp-import-wrapper">
157
+
158
+ <form action="<?php echo admin_url( 'admin.php?import=masterslider-importer&step=2' ); ?>" method="post" enctype="multipart/form-data" class="msp-import-form msp-dialog-inner-section">
159
+
160
+ <span class="msp-dialog-section-desc"><?php _e( 'To import sliders select Masterslider Export file that you downloaded before then click import button.', MSWP_TEXT_DOMAIN ) ?></span>
161
+ <br />
162
+ <hr />
163
+ <br />
164
+ <fieldset>
165
+ <?php wp_nonce_field('import-msp-sliders'); ?>
166
+
167
+ <input type="hidden" name="msp-import" value="1">
168
+
169
+ <input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" />
170
+
171
+ <input type="file" name="msp-import-file" class="msp-select-file">
172
+
173
+ <small><?php printf( __( 'Maximum size: %s', MSWP_TEXT_DOMAIN ), $size ); ?></small><br /><br /><br />
174
+
175
+ <input type="submit" class="button" value="<?php esc_attr_e( 'Upload file and import', MSWP_TEXT_DOMAIN ); ?>" />
176
+ </fieldset>
177
+
178
+
179
+
180
+ </form>
181
+
182
+ </div>
183
+
184
+ <?php
185
+ }
186
+
187
+ // Import sliders from export file
188
+ if( isset( $_POST['msp-import'] ) ) {
189
+
190
+ if( current_user_can('export_masterslider') ) {
191
+
192
+ if( check_admin_referer('import-msp-sliders') ) {
193
+
194
+ $step = isset( $_REQUEST['step'] ) && ! empty( $_REQUEST['step'] ) ? (int)$_REQUEST['step'] : 0;
195
+
196
+ if( 2 == $step ){
197
+
198
+ if ( $_FILES['msp-import-file']['error'] == UPLOAD_ERR_OK && is_uploaded_file( $_FILES['msp-import-file']['tmp_name'] ) ) {
199
+ // get import file content
200
+ $import_data = file_get_contents( $_FILES['msp-import-file']['tmp_name'] );
201
+ $this->import_data( $import_data );
202
+ }
203
+
204
+ }
205
+ }
206
+
207
+ } else {
208
+ add_action( 'admin_notices', array( $this, 'import_export_notice' ) );
209
+ }
210
+ }
211
+
212
+ // Import slider by starter id
213
+ if( isset( $_REQUEST['starter_id'] ) && ! empty( $_REQUEST['starter_id'] ) ) {
214
+
215
+ if( current_user_can('export_masterslider') || apply_filters( 'masterslider_user_can_import_starter_content', 0 ) ) {
216
+
217
+ if ( $starter_field = msp_get_slider_starter_field( $_REQUEST['starter_id'] ) ) {
218
+
219
+ if ( isset( $starter_field['importdata'] ) && ! empty( $starter_field['importdata'] ) ) {
220
+
221
+ $this->import_data( $starter_field['importdata'] );
222
+ printf( "<script> var redirect_link = '%s';</script>", admin_url( 'admin.php?page='.MSWP_SLUG.'&action=edit&slider_id='.$this->last_new_slider_id. '&fr' ) );
223
+
224
+ } else {
225
+ _e( 'Import data not found ..', MSWP_TEXT_DOMAIN );
226
+ }
227
+
228
+ } else {
229
+ _e( 'Starter ID is not valid.', MSWP_TEXT_DOMAIN );
230
+ }
231
+
232
+ } else {
233
+ add_action( 'admin_notices', array( $this, 'import_export_notice' ) );
234
+ }
235
+
236
+ }
237
+
238
+ }
239
+
240
+
241
+
242
+ public function process_export_request(){
243
+
244
+ // Export sliders
245
+ if( isset( $_POST['msp-export'] ) ) {
246
+
247
+ if( current_user_can('export_masterslider') ) {
248
+
249
+ if( check_admin_referer('export-msp-sliders') ) {
250
+
251
+ $sliders = isset( $_POST['msp-export-sliders'] ) ? $_POST['msp-export-sliders'] : '';
252
+
253
+ if( ! empty( $sliders ) || ! empty( $args ) ) {
254
+ $this->export_slider_data_in_file( $sliders, $args );
255
+ }
256
+ }
257
+
258
+ }else {
259
+ add_action( 'admin_notices', array( $this, 'import_export_notice' ) );
260
+ }
261
+ }
262
+
263
+ }
264
+
265
+
266
+ /**
267
+ * Add admin notice if access to import/export is denied
268
+ * @return void
269
+ */
270
+ public function import_export_notice(){
271
+ printf( '<div class="error" style="display:block;" ><p>%s</p></div>',
272
+ apply_filters( 'masterslider_import_export_access_denied_message', __( "Sorry, You don't have enough permission to import/export sliders.", MSWP_TEXT_DOMAIN ) )
273
+ );
274
+ }
275
+
276
+
277
+
278
+
279
+
280
+
281
+ /**
282
+ * Get slider export data
283
+ *
284
+ * @param int|array $slider_id the slider id(s)
285
+ * @param array The other options that should be included in export data ( preset_styles, preset_effects )
286
+ * @param bool $base64 encode output data to base64 or not
287
+ * @return string the slider export data
288
+ */
289
+ function get_slider_export_data( $slider_ids = array() , $args = null, $base64 = true ){
290
+
291
+ $slider_ids = (array) $slider_ids;
292
+ $args = (array) $args;
293
+
294
+ // stores export data
295
+ $export_data = array();
296
+
297
+ $export_data['sliders_data'] = array();
298
+
299
+ // loop through selected sliders and store in sliders_data
300
+ foreach ( $slider_ids as $slider_id ) {
301
+
302
+ if( is_numeric( $slider_id ) ) {
303
+ global $mspdb;
304
+
305
+ $slider_title = $mspdb->get_slider_field_val( $slider_id, 'title' );
306
+ $slider_params = $mspdb->get_slider_field_val( $slider_id, 'params' );
307
+ $slider_type = $mspdb->get_slider_field_val( $slider_id, 'type' );
308
+ $slides_num = $mspdb->get_slider_field_val( $slider_id, 'slides_num');
309
+
310
+ $export_data['sliders_data'][ $slider_id ] = array(
311
+ 'title' => $slider_title,
312
+ 'params' => $slider_params,
313
+ 'type' => $slider_type,
314
+ 'slides_num' => $slides_num
315
+ );
316
+ }
317
+
318
+ }
319
+
320
+ // add origin_uploads_url to export data - this helps us to fetch images from origin domian
321
+
322
+ // if you need to bundle sample sliders in your theme you can change the origin_uploads_url
323
+ // by default origin_uploads_url is the uploads baseurl on domain you exported the sliders from (e.g www.domain.com/wp-content/uploads)
324
+ // when you decide to import data to new domain, importer will use the origin_uploads_url to fetch images from.
325
+ // you can change origin_uploads_url by using 'masterslider_export_origin_uploads_url' filter
326
+ // if you change origin_uploads_url to something else, importer will import slider images
327
+ // from your custom origin_uploads_url instead of default origin_uploads_url
328
+ $custom_export_origin_uploads_url = apply_filters( 'masterslider_export_origin_uploads_url', null );
329
+
330
+ // if filter passed empty string, origin_uploads_url will be plugins/masterslider/samples folder
331
+ if( '' === $custom_export_origin_uploads_url ) {
332
+ $export_data['origin_uploads_url'] = '{{masterslider}}/samples';
333
+
334
+ // if filter passed a string with our special tags :
335
+ } elseif( false !== strpos( $custom_export_origin_uploads_url, '{{masterslider}}' ) ||
336
+ false !== strpos( $custom_export_origin_uploads_url, '{{theme_dir}}' ) ||
337
+ false !== strpos( $custom_export_origin_uploads_url, '{{child_theme_dir}}' ) ) {
338
+
339
+ $export_data['origin_uploads_url'] = $custom_export_origin_uploads_url;
340
+
341
+ // if filter value not changed use upload baseurl for current domain
342
+ } else {
343
+ $uploads = wp_upload_dir();
344
+ $export_data['origin_uploads_url'] = $uploads['baseurl'];
345
+ }
346
+
347
+
348
+ $export_json_data = json_encode( $export_data );
349
+ $export_b64_data = base64_encode( $export_json_data );
350
+
351
+ if ( $base64 )
352
+ return base64_encode( json_encode( $export_data ) );
353
+
354
+ return $export_data;
355
+ }
356
+
357
+
358
+ /**
359
+ * Print slider export data
360
+ *
361
+ * @param int|array $slider_id the slider id(s)
362
+ * @param array The other options that should be included in export data ( preset_styles, preset_effects )
363
+ * @param bool $base64 encode output data to base64 or not
364
+ * @return void
365
+ */
366
+ function the_slider_export_data ( $slider_id, $args = null, $base64 = true ){
367
+ $export = $this->get_slider_export_data( $slider_id, $args, $base64 );
368
+ axpp( $export );
369
+ }
370
+
371
+
372
+ /**
373
+ * Export slider(s) data to file
374
+ *
375
+ * @param int|array $slider_id slider(s) ID to export
376
+ * @param array The other options that should be included in export data ( preset_style, preset_effect )
377
+ * @return void
378
+ */
379
+ function export_slider_data_in_file( $slider_id, $args = null ){
380
+
381
+ $blogname = str_replace( " ", "", get_option('blogname') );
382
+ $date = date("m-d-Y");
383
+ $export_file_name = $blogname."-".MSWP_SLUG."-".$date;
384
+
385
+ $export_b64_data = $this->get_slider_export_data( $slider_id, $args );
386
+
387
+ header( "Content-Type: application/force-download; charset=" . get_option( 'blog_charset') );
388
+ header( "Content-Disposition: attachment; filename=$export_file_name.json" );
389
+ exit( $export_b64_data );
390
+ }
391
+
392
+
393
+
394
+
395
+
396
+
397
+ /**
398
+ * Import sliders and options by previousely exported data
399
+ *
400
+ * @param string $exported_data the exported string
401
+ * @return bool true on success and false on failure
402
+ */
403
+ function import_data( $exported_data ){
404
+
405
+ if( empty( $exported_data ) )
406
+ return false;
407
+
408
+ $exported_b64_decoded = msp_maybe_base64_decode( $exported_data );
409
+ $export_array = json_decode( $exported_b64_decoded, true );
410
+
411
+ // validate export data
412
+ if ( ! is_array( $export_array ) ){
413
+ echo __( 'Import data is not valid.', MSWP_TEXT_DOMAIN ) . "<br />";
414
+ return false;
415
+ }
416
+
417
+
418
+ // set origin_upload_baseurl
419
+ if( isset( $export_array['origin_uploads_url'] ) && ! empty( $export_array['origin_uploads_url'] ) ) {
420
+
421
+ $this->origin_upload_baseurl = $export_array['origin_uploads_url'];
422
+
423
+ $this->origin_upload_baseurl = str_replace( '{{masterslider}}' , MSWP_AVERTA_URL, $this->origin_upload_baseurl );
424
+ $this->origin_upload_baseurl = str_replace( '{{theme_dir}}' , get_template_directory_uri() , $this->origin_upload_baseurl );
425
+ $this->origin_upload_baseurl = str_replace( '{{child_theme_dir}}', get_stylesheet_directory_uri() , $this->origin_upload_baseurl );
426
+
427
+ // if you need to change "origin_upload_baseurl" while importing content, just define MSWP_IMPORT_FETCH_DIR const
428
+ } elseif( defined( 'MSWP_IMPORT_FETCH_DIR' ) ){
429
+ $this->origin_upload_baseurl = MSWP_IMPORT_FETCH_DIR;
430
+
431
+ } else {
432
+ $this->origin_upload_baseurl = MSWP_AVERTA_URL . '/samples';
433
+ }
434
+
435
+
436
+
437
+ // import preset styles if it's included in export data
438
+ if( isset( $export_array['preset_styles'] ) && ! empty( $export_array['preset_styles'] ) ) {
439
+ msp_update_option( 'preset_style' , $export_array['preset_styles'] );
440
+ echo __( 'Preset styles imported successfully.', MSWP_TEXT_DOMAIN ) . "<br />";
441
+ }
442
+
443
+ // import preset effects if it's included in export data
444
+ if( isset( $export_array['preset_effects'] ) && ! empty( $export_array['preset_effects'] ) ) {
445
+ msp_update_option( 'preset_effect' , $export_array['preset_effects'] );
446
+ echo __( 'Preset transitions imported successfully.', MSWP_TEXT_DOMAIN ) . "<br />";
447
+ }
448
+
449
+ echo __( 'Importing slides ..', MSWP_TEXT_DOMAIN ) . "<br /><br />";
450
+
451
+ // import sliders
452
+ if( isset( $export_array['sliders_data'] ) ) {
453
+ // reset image import queue
454
+ $this->image_import_queue = array();
455
+ $this->last_new_slider_id = null;
456
+ $this->import_add_sliders( $export_array['sliders_data'] );
457
+ }
458
+
459
+ echo "<br />" . __( 'All data imported successfully, have fun :)' ) . "<br />";
460
+
461
+ printf( '<a href="%s">%s</a>', admin_url( 'admin.php?page=' . MSWP_SLUG ), __( 'Back to panel ..', MSWP_TEXT_DOMAIN ) );
462
+
463
+ return true;
464
+ }
465
+
466
+
467
+ /**
468
+ * Import slider(s) by exported data
469
+ *
470
+ * @param string $sliders_data the exported string
471
+ * @return bool true on success and false on failure
472
+ */
473
+ function import_add_sliders( $sliders_data ){
474
+
475
+ if( empty( $sliders_data ) )
476
+ return false;
477
+
478
+ if ( ! is_array( $sliders_data ) ){
479
+ return false;
480
+ }
481
+
482
+ foreach ( $sliders_data as $slider_fields ) {
483
+
484
+ global $mspdb;
485
+
486
+ // do not publish slider if user has not enough permission to publish sliders
487
+ $slider_fields['status'] = current_user_can( 'publish_masterslider' ) ? 'published' : 'draft';
488
+
489
+ // import slider
490
+ $new_slider_id = $mspdb->import_slider( $slider_fields );
491
+ $this->last_new_slider_id = $new_slider_id;
492
+ msp_update_slider_custom_css_and_fonts( $new_slider_id );
493
+
494
+ echo sprintf( 'Slider "%s" created successfully.', $new_slider_id ) . "<br />";
495
+
496
+ // extact and collect images from each slider
497
+ if( $this->import_medias && isset( $slider_fields['params'] ) )
498
+ $this->extract_slider_images( $slider_fields['params'] );
499
+ }
500
+
501
+ if( $this->import_medias )
502
+ $this->fetch_all_medias();
503
+
504
+ return true;
505
+ }
506
+
507
+
508
+
509
+ /**
510
+ * Extract images from slider data and add them to image_import_queue list
511
+ * @param string $slider_params the slider params
512
+ * @return void
513
+ */
514
+ public function extract_slider_images( $slider_params ) {
515
+
516
+ $parser = msp_get_parser();
517
+ $parser->set_data( $slider_params );
518
+ $results = $parser->get_results();
519
+
520
+ // collect slider background image
521
+ $this->image_import_queue[] = $results['setting']['bg_image'];
522
+
523
+ if( isset( $results['setting']['ps_slide_bg'] ) )
524
+ $this->image_import_queue[] = $results['setting']['ps_slide_bg'];
525
+
526
+ // collect slide's images
527
+ if( isset( $results['slides'] ) ) {
528
+
529
+ foreach ( $results['slides'] as $slide ) {
530
+ $this->image_import_queue[] = $slide['src'];
531
+ $this->image_import_queue[] = $slide['thumb'];
532
+ }
533
+ }
534
+
535
+ $this->image_import_queue = apply_filters( 'masterslider_extract_slider_images_to_import', $this->image_import_queue, $results );
536
+ }
537
+
538
+
539
+
540
+ /**
541
+ * Download and save slider images in upload directory
542
+ * @return void
543
+ */
544
+ public function fetch_all_medias(){
545
+
546
+ echo "<br />";
547
+ $this->image_import_queue = array_filter( $this->image_import_queue );
548
+
549
+ foreach ( $this->image_import_queue as $url ) {
550
+ $this->download_media( $url );
551
+ }
552
+ }
553
+
554
+
555
+ public function download_media( $url ){
556
+
557
+ if( ! isset( $url ) || empty( $url ) ) return '';
558
+
559
+ // remove upload directory and get relative url
560
+ if( $this->contains_origin_upload_dir( $url ) ) {
561
+ $url = str_replace( $this->origin_upload_baseurl, '', $url );
562
+ }
563
+
564
+ // skip if url was not internal media url
565
+ if( $this->is_absolute_url( $url ) ) {
566
+ echo "Media already exists.<br />";
567
+ return '';
568
+ }
569
+
570
+
571
+ $relative_url = $url;
572
+
573
+ // extract the file name and extension from the url
574
+ $file_name = basename( $relative_url );
575
+
576
+ // extract upload date
577
+ $upload_date = untrailingslashit( str_replace( $file_name, '', $relative_url ) );
578
+
579
+ // get absolute media url
580
+ $absolute_url = $this->get_absolute_media_url( $relative_url );
581
+
582
+ // printf( "Importing ( %s ) file from ( %s ) .. <br />", $relative_url, $absolute_url );
583
+
584
+ // check if import media already exist
585
+ if( is_file( $this->upload_basedir . $relative_url ) ) {
586
+ echo sprintf( 'Media “%s” already exists.', $file_name ) . "<br />";
587
+ return;
588
+ }
589
+
590
+ printf( "Importing ( %s ) file .. <br />", $relative_url );
591
+
592
+ // printf( "upload date ( %s ) .. <br />", $upload_date ); printf( "absolute url ( %s ) .. <br /><br />", $absolute_url ); return;
593
+
594
+ $upload = $this->fetch_remote_file( $absolute_url, $upload_date );
595
+
596
+
597
+ if( is_wp_error( $upload ) || $upload['error'] ) {
598
+ echo "Failed to import media." . "<br />";
599
+ return $upload;
600
+ }
601
+
602
+
603
+ // Prepare an array of post data for the attachment.
604
+ $attachment = array(
605
+ 'guid' => '',
606
+ 'post_mime_type' => '',
607
+ 'post_title' => preg_replace( '/\.[^.]+$/', '', basename( $upload['file'] ) ),
608
+ 'post_content' => '',
609
+ 'post_status' => 'inherit'
610
+ );
611
+
612
+ if ( $info = wp_check_filetype( $upload['file'] ) )
613
+ $attachment['post_mime_type'] = $info['type'];
614
+ else
615
+ return new WP_Error( 'attachment_processing_error', __('Invalid file type', 'wordpress-importer') );
616
+
617
+ $attachment['guid'] = $upload['url'];
618
+
619
+ // as per wp-admin/includes/upload.php
620
+ $attachment_id = wp_insert_attachment( $attachment, $upload['file'] );
621
+
622
+ // Make sure that this file is included, as wp_generate_attachment_metadata() depends on it.
623
+ require_once( ABSPATH . 'wp-admin/includes/image.php' );
624
+
625
+ wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $upload['file'] ) );
626
+
627
+
628
+
629
+ echo sprintf( '<a href="%s" target="_blank" >%s</a> Imported successfully.', $upload['url'], $file_name ) . "<br />";
630
+ }
631
+
632
+
633
+ /**
634
+ * Attempt to download a remote file attachment
635
+ *
636
+ * @param string $url URL of item to fetch
637
+ * @param array $post Attachment details
638
+ * @return array|WP_Error Local file location details on success, WP_Error otherwise
639
+ */
640
+ function fetch_remote_file( $url, $subdir = null ) {
641
+
642
+ add_filter( 'http_request_timeout', array( $this, 'bump_request_timeout' ) );
643
+
644
+ // extract the file name and extension from the url
645
+ $file_name = basename( $url );
646
+
647
+ // get placeholder file in the upload dir with a unique, sanitized filename
648
+ $upload = $this->wp_upload_bits( $file_name, '', $subdir );
649
+
650
+ // var_dump( $upload );
651
+ //echo "<br />" . $url . "<br />"; return new WP_Error( 'import_file_error', '' );
652
+
653
+ if ( $upload['error'] )
654
+ return new WP_Error( 'upload_dir_error', $upload['error'] );
655
+
656
+ // fetch the remote url and write it to the placeholder file
657
+ $headers = wp_get_http( $url, $upload['file'] );
658
+
659
+ // request failed
660
+ if ( ! $headers ) {
661
+ @unlink( $upload['file'] );
662
+ return new WP_Error( 'import_file_error', __('Remote server did not respond', 'wordpress-importer') );
663
+ }
664
+
665
+ // make sure the fetch was successful
666
+ if ( $headers['response'] != '200' ) {
667
+ @unlink( $upload['file'] );
668
+ return new WP_Error( 'import_file_error', sprintf( __('Remote server returned error response %1$d %2$s', 'wordpress-importer'), esc_html( $headers['response'] ), get_status_header_desc( $headers['response'] ) ) );
669
+ }
670
+
671
+ $filesize = filesize( $upload['file'] );
672
+
673
+ if ( isset( $headers['content-length'] ) && $filesize != $headers['content-length'] ) {
674
+ @unlink( $upload['file'] );
675
+ return new WP_Error( 'import_file_error', __('Remote file is incorrect size', 'wordpress-importer') );
676
+ }
677
+
678
+ if ( 0 == $filesize ) {
679
+ @unlink( $upload['file'] );
680
+ return new WP_Error( 'import_file_error', __('Zero size file downloaded', 'wordpress-importer') );
681
+ }
682
+
683
+ $max_size = (int) $this->max_attachment_size();
684
+ if ( ! empty( $max_size ) && $filesize > $max_size ) {
685
+ @unlink( $upload['file'] );
686
+ return new WP_Error( 'import_file_error', sprintf(__('Remote file is too large, limit is %s', 'wordpress-importer'), size_format( $max_size ) ) );
687
+ }
688
+
689
+ return $upload;
690
+ }
691
+
692
+
693
+
694
+
695
+
696
+ /**
697
+ * Create a file in the upload folder with given content.
698
+ *
699
+ * If there is an error, then the key 'error' will exist with the error message.
700
+ * If success, then the key 'file' will have the unique file path, the 'url' key
701
+ * will have the link to the new file. and the 'error' key will be set to false.
702
+ *
703
+ * This function will not move an uploaded file to the upload folder. It will
704
+ * create a new file with the content in $bits parameter. If you move the upload
705
+ * file, read the content of the uploaded file, and then you can give the
706
+ * filename and content to this function, which will add it to the upload
707
+ * folder.
708
+ *
709
+ * The permissions will be set on the new file automatically by this function.
710
+ *
711
+ * @param string $name
712
+ * @param mixed $bits File content
713
+ * @param string $subdir Optional. Time formatted in 'yyyy/mm'.
714
+ * @return array
715
+ */
716
+ function wp_upload_bits( $name, $bits, $subdir = '' ) {
717
+
718
+ if ( empty( $name ) )
719
+ return array( 'error' => __( 'Empty filename' ) );
720
+
721
+ $wp_filetype = wp_check_filetype( $name );
722
+
723
+ if ( ! $wp_filetype['ext'] && ! current_user_can( 'unfiltered_upload' ) )
724
+ return array( 'error' => __( 'Invalid file type' ) );
725
+
726
+ $upload = wp_upload_dir();
727
+
728
+ if ( $upload['error'] !== false )
729
+ return $upload;
730
+
731
+
732
+ $upload_path = $upload['basedir'] . $subdir;
733
+
734
+ $filename = wp_unique_filename( $upload_path, $name );
735
+
736
+ $new_file = $upload_path . "/$filename";
737
+
738
+ // echo "file path : {$new_file} <br />";
739
+
740
+
741
+ if ( ! wp_mkdir_p( dirname( $new_file ) ) ) {
742
+ if ( 0 === strpos( $upload['basedir'], ABSPATH ) )
743
+ $error_path = str_replace( ABSPATH, '', $upload['basedir'] ) . $upload['subdir'];
744
+ else
745
+ $error_path = basename( $upload['basedir'] ) . $upload['subdir'];
746
+
747
+ $message = sprintf( __( 'Unable to create directory %s. Is its parent directory writable by the server?' ), $error_path );
748
+ return array( 'error' => $message );
749
+ }
750
+
751
+ $ifp = @ fopen( $new_file, 'wb' );
752
+ if ( ! $ifp )
753
+ return array( 'error' => sprintf( __( 'Could not write file %s' ), $new_file ) );
754
+
755
+ @fwrite( $ifp, $bits );
756
+ fclose( $ifp );
757
+ clearstatcache();
758
+
759
+ // Set correct file permissions
760
+ $stat = @ stat( dirname( $new_file ) );
761
+ $perms = $stat['mode'] & 0007777;
762
+ $perms = $perms & 0000666;
763
+ @ chmod( $new_file, $perms );
764
+ clearstatcache();
765
+
766
+ // Compute the URL
767
+ $url = $upload['baseurl'] . "$subdir/$filename";
768
+
769
+ return array( 'file' => $new_file, 'url' => $url, 'error' => false );
770
+ }
771
+
772
+
773
+ /**
774
+ * Added to http_request_timeout filter to force timeout at 60 seconds during import
775
+ * @return int 60
776
+ */
777
+ function bump_request_timeout() {
778
+ return 60;
779
+ }
780
+
781
+
782
+
783
+ }
784
+
785
+
786
+ new MSP_Importer();
admin/includes/classes/class-msp-list-table.php ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php //
2
+
3
+ class MSP_List_Table extends Axiom_List_Table {
4
+
5
+
6
+ function __construct(){
7
+
8
+ //Set parent defaults
9
+ parent::__construct( array(
10
+ 'singular' => 'slider', // singular name of the listed records
11
+ 'plural' => 'sliders', // plural name of the listed records
12
+ 'ajax' => false // does this table support ajax?
13
+ ) );
14
+
15
+ }
16
+
17
+
18
+ function get_columns(){
19
+ $columns = array(
20
+ 'ID' => 'ID',
21
+ 'title' => 'Name',
22
+ 'shortcode' => 'Shortcode',
23
+ 'slides_num' => 'Slides',
24
+ 'date_modified' => 'Last Modify',
25
+ 'date_created' => 'Date Created',
26
+ 'action' => 'Action'
27
+ );
28
+ return $columns;
29
+ }
30
+
31
+
32
+
33
+ function get_sortable_columns() {
34
+ $sortable_columns = array(
35
+ 'ID' => array('ID',false),
36
+ 'date_created' => array('date_created',false),
37
+ 'date_modified' => array('date_created',false)
38
+ );
39
+ return $sortable_columns;
40
+ }
41
+
42
+
43
+
44
+ function column_title($item) {
45
+ return sprintf('<a href="?page=%s&action=%s&slider_id=%s">%s</a>',$_REQUEST['page'],'edit', $item['ID'], $item['title'] );
46
+ }
47
+
48
+ function column_action( $item ) {
49
+ $paged = $this->get_pagenum();
50
+ $paged_arg = (int)$paged > 1 ? '&paged=' . $paged : '';
51
+
52
+ $buttons = '';
53
+
54
+ if( current_user_can( 'duplicate_masterslider' ) || apply_filters( 'masterslider_admin_display_duplicate_btn', 0 ) )
55
+ $buttons .= sprintf( '<a class="action-duplicate msp-ac-btn msp-btn-gray msp-iconic" href="?page=%s&action=%s&slider_id=%s%s"><span></span>%s</a>',$_REQUEST['page'],'duplicate' ,$item['ID'], $paged_arg, __('duplicate') );
56
+
57
+ if( current_user_can( 'delete_masterslider' ) || apply_filters( 'masterslider_admin_display_delete_btn', 0 ) ) {
58
+ $buttons .= sprintf( '<a class="action-delete msp-ac-btn msp-btn-red msp-iconic" href="?page=%s&action=%s&slider_id=%s%s" onClick="return confirm(\'%s\');" ><span></span>%s</a>', $_REQUEST['page'],'delete' ,$item['ID'],
59
+ $paged_arg, wp_slash( apply_filters( 'masterslider_admin_delete_btn_alert_message', __( 'Are you sure you want to delete this slider?' , MSWP_TEXT_DOMAIN ) ) ),
60
+ __('delete')
61
+ );
62
+ }
63
+
64
+ $buttons .= sprintf( '<a class="action-preview msp-ac-btn msp-btn-blue msp-iconic" href="?page=%s&action=%s&slider_id=%s" onClick="lunchMastersliderPreviewBySliderID(%s);return false;" ><span></span>%s</a>',$_REQUEST['page'],'preview' ,$item['ID'], $item['ID'], __('preview') );
65
+
66
+ return $buttons;
67
+ }
68
+
69
+
70
+
71
+ function process_bulk_action() {
72
+
73
+ $slider_id = isset( $_REQUEST['slider_id'] ) ? $_REQUEST['slider_id'] : '';
74
+
75
+ // check if a delete request recieved
76
+ if( current_user_can( 'delete_masterslider' ) && 'delete' === $this->current_action() ) {
77
+
78
+ global $mspdb;
79
+ $mspdb->delete_slider($slider_id);
80
+ // echo "Slider id ($slider_id) Removed";
81
+
82
+ } else {
83
+ add_action( 'admin_notices', array( $this, 'delete_error_notice' ) );
84
+ }
85
+
86
+ // check if a duplicate request recieved
87
+ if( current_user_can( 'duplicate_masterslider' ) && 'duplicate' === $this->current_action() ) {
88
+
89
+ global $mspdb;
90
+ $mspdb->duplicate_slider($slider_id);
91
+ // echo "Slider id ($slider_id) duplicated";
92
+
93
+ } else {
94
+ add_action( 'admin_notices', array( $this, 'duplicate_error_notice' ) );
95
+ }
96
+
97
+ }
98
+
99
+
100
+ function delete_error_notice () {
101
+ printf( '<div class="error" style="display:block;" ><p>%s</p></div>',
102
+ apply_filters( 'masterslider_delete_insufficient_permissions_notice', __( "Sorry, You don't have enough permission to delete slider.", MSWP_TEXT_DOMAIN ) )
103
+ );
104
+ }
105
+
106
+
107
+ function duplicate_error_notice () {
108
+ printf( '<div class="error" style="display:block;" ><p>%s</p></div>',
109
+ apply_filters( 'masterslider_duplicate_insufficient_permissions_notice', __( "Sorry, You don't have enough permission to duplicate slider.", MSWP_TEXT_DOMAIN ) )
110
+ );
111
+ }
112
+
113
+
114
+ function no_items() {
115
+ _e( 'No slider found.', MSWP_TEXT_DOMAIN );
116
+ }
117
+
118
+
119
+ function column_default( $item, $column_name ) {
120
+ global $mspdb;
121
+
122
+ switch( $column_name ) {
123
+ case 'shortcode':
124
+ return sprintf('[masterslider id="%s"]', $item['ID']);
125
+ case 'date_modified':
126
+
127
+ $orig_time = isset( $item['date_modified'] ) ? strtotime($item['date_modified']) : '';
128
+ $time = date_i18n( 'Y/m/d @ g:i:s A', $orig_time );
129
+ $human = human_time_diff( $orig_time );
130
+ return sprintf( '<abbr title="%s">%s</abbr>', $time, $human . __(' ago', MSWP_TEXT_DOMAIN) ) ;
131
+ case 'date_created':
132
+ $orig_time = isset( $item['date_created'] ) ? strtotime($item['date_created']) : '';
133
+ $date = date_i18n( 'Y/m/d', $orig_time );
134
+ $time = date_i18n( 'Y/m/d @ g:i:s A', $orig_time );
135
+ return sprintf( '<abbr title="%s">%s</abbr>', $time, $date );
136
+ case 'slides_num':
137
+ global $mspdb;
138
+ return $mspdb->get_slider_field_val( $item['ID'], 'slides_num' );
139
+ case 'ID':
140
+ case 'title':
141
+ return $item[ $column_name ];
142
+ default:
143
+ return;
144
+ //return print_r( $item, true ) ; //Show the whole array for troubleshooting purposes
145
+ }
146
+ }
147
+
148
+
149
+ function get_records( $perpage = 20, $paged = 1, $orderby = 'ID', $sort = 'DESC' ){
150
+ global $mspdb;
151
+
152
+ $offset = ( (int)$paged - 1 ) * $perpage;
153
+ $orderby = isset( $_REQUEST['orderby'] ) ? $_REQUEST['orderby'] : 'ID';
154
+ $sort = isset( $_REQUEST['order'] ) ? $_REQUEST['order'] : 'ASC';
155
+
156
+ return $mspdb->get_sliders( $perpage, $offset, $orderby, $sort );
157
+ }
158
+
159
+
160
+ function get_total_count(){
161
+ global $mspdb;
162
+ return $mspdb->get_total_sliders_count();
163
+ }
164
+
165
+
166
+
167
+ function prepare_items() {
168
+
169
+ $columns = $this->get_columns();
170
+ $hidden = array();
171
+ $sortable = $this->get_sortable_columns();
172
+
173
+ $this->_column_headers = array( $columns, $hidden, $sortable );
174
+
175
+ $this->process_bulk_action();
176
+
177
+ $perpage = (int) apply_filters( 'masterslider_admin_sliders_per_page', 10 );
178
+ $current_page = $this->get_pagenum();
179
+ $orderby = 'ID';
180
+ $sort = 'DESC';
181
+ $total_items = $this->get_total_count();
182
+
183
+
184
+ $this->items = $this->get_records( $perpage, $current_page, $orderby, $sort );
185
+ // echo '<pre>'; print_r( $this->items ); echo '</pre>';
186
+
187
+ // tell the class the total number of items and how many items to show on a page
188
+ $this->set_pagination_args( array(
189
+ 'total_items' => $total_items,
190
+ 'per_page' => $perpage
191
+ ));
192
+ }
193
+
194
+ }
195
+
196
+
197
+ // global $master_list_table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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Master Slider Data Parser Class.
5
+ *
6
+ * @package MasterSlider
7
+ * @author averta [averta.net]
8
+ * @license LICENSE.txt
9
+ * @link http://masterslider.com
10
+ * @copyright Copyright © 2014 averta
11
+ */
12
+
13
+
14
+ class MSP_Parser {
15
+
16
+
17
+ public $maybe_encoded_data;
18
+
19
+ // ready to parse data
20
+ public $parsable_data ;
21
+
22
+ // recent parsed slider setting
23
+ public $recent_setting;
24
+
25
+ // recent parsed slides
26
+ public $recent_slides ;
27
+
28
+ // recent parsed styles
29
+ public $recent_styles ;
30
+
31
+
32
+ public $current_slider_id;
33
+
34
+ public $join_char = "\n";
35
+ public $tab_char = "\t";
36
+
37
+
38
+
39
+ public function __construct() {
40
+
41
+
42
+ if ( apply_filters( 'masterslider_compress_custom_css' , 1 ) ) {
43
+ $this->join_char = "";
44
+ $this->tab_char = "";
45
+ }
46
+ }
47
+
48
+ public function get_setting() {
49
+
50
+ }
51
+
52
+ public function is_key_true( $array, $key, $default = 'true' ) {
53
+ if( isset( $array[ $key ] ) ) {
54
+ return $array[ $key ] ? 'true' : 'false';
55
+ } else {
56
+ return $default;
57
+ }
58
+ }
59
+
60
+ public function parse_setting( $setting = array() ) {
61
+
62
+ // make sure $setting is not serialized
63
+ $setting = maybe_unserialize( $setting );
64
+
65
+ $setid = isset( $setting['setId'] ) ? (string) $setting['setId'] : '';
66
+
67
+ $post_cats = isset( $setting['postCats'] ) ? (array) $setting['postCats'] : array();
68
+ $post_tags = isset( $setting['postTags'] ) ? (array) $setting['postTags'] : array();
69
+ $tax_term_ids = implode( ',', array_merge( $post_cats, $post_tags ) );
70
+
71
+ // slider options
72
+ return array(
73
+
74
+ 'id' => is_numeric( $this->current_slider_id ) ? $this->current_slider_id : ( isset( $setting['sliderId'] ) ? (string) $setting['sliderId'] : '' ),
75
+ 'uid' => '', // an unique and temporary id
76
+ 'class' => isset( $setting['className'] ) ? (string) $setting['className'] : '', // a class that adds to slider wrapper
77
+ 'margin' => 0,
78
+
79
+ 'inline_style' => isset( $setting['inlineStyle'] ) ? esc_attr( $setting['inlineStyle'] ) : '',
80
+ 'bg_color' => isset( $setting['bgColor'] ) ? (string) $setting['bgColor'] : '',
81
+ 'bg_image' => isset( $setting['bgImage'] ) ? msp_get_the_relative_media_url( $setting['bgImage'] ) : '',
82
+
83
+ 'title' => isset( $setting['name'] ) ? (string) $setting['name'] : __( 'Untitled Slider', MSWP_TEXT_DOMAIN ), // slider name
84
+
85
+ 'slider_type' => isset( $setting['type'] ) ? (string) $setting['type'] : 'custom', // values: custom, express, flickr, post_view
86
+
87
+
88
+ 'width' => isset( $setting['width'] ) ? (int) rtrim($setting['width'] , 'px' ) : 300, // base width of slides. It helps the slider to resize in correct ratio.
89
+ 'height' => isset( $setting['height'] ) ? (int) rtrim($setting['height'], 'px' ) : 150, // base height of slides, It helps the slider to resize in correct ratio.
90
+
91
+ 'start' => isset( $setting['start'] ) ? (int) $setting['start'] : 1,
92
+ 'space' => isset( $setting['space'] ) ? (int) $setting['space'] : 0,
93
+
94
+ 'grab_cursor' => $this->is_key_true( $setting, 'grabCursor', 'true' ), // Whether the slider uses grab mouse cursor
95
+ 'swipe' => $this->is_key_true( $setting, 'swipe', 'true' ), // Whether the drag/swipe navigation is enabled
96
+
97
+ 'wheel' => $this->is_key_true( $setting, 'wheel', 'true' ), // Enables mouse scroll wheel navigation
98
+ 'mouse' => $this->is_key_true( $setting, 'mouse', 'true' ), // Whether the user can use mouse drag navigation
99
+
100
+ 'crop' => $this->is_key_true( $setting, 'autoCrop', 'false' ), // Automatically crop slide images?
101
+
102
+ 'autoplay' => $this->is_key_true( $setting, 'autoplay', 'false' ), // Enables the autoplay slideshow
103
+ 'loop' => $this->is_key_true( $setting, 'loop', 'false' ), //
104
+ 'shuffle' => $this->is_key_true( $setting, 'shuffle', 'false' ), // Enables the shuffle slide order
105
+ 'preload' => isset( $setting['preload'] ) ? $setting['preload'] : 0,
106
+
107
+ 'wrapper_width' => isset( $setting['wrapperWidth'] ) ? (int) $setting['wrapperWidth'] : '',
108
+ 'wrapper_width_unit' => isset( $setting['wrapperWidthUnit'] ) ? $setting['wrapperWidthUnit'] : 'px',
109
+
110
+ 'layout' => isset( $setting['layout'] ) ? (string) $setting['layout'] : 'boxed',
111
+
112
+ 'fullscreen_margin' => isset( $setting['fullscreenMargin'] ) ? (int) $setting['fullscreenMargin'] : 0,
113
+
114
+
115
+ 'height_limit' => 'true', // It force the slide to use max height value as its base specified height value.
116
+ 'auto_height' => $this->is_key_true( $setting, 'autoHeight', 'false' ),
117
+ 'smooth_height' => 'true',
118
+
119
+ 'end_pause' => $this->is_key_true( $setting, 'endPause' , 'false' ),
120
+ 'over_pause' => $this->is_key_true( $setting, 'overPause', 'false' ),
121
+
122
+ 'fill_mode' => apply_filters( 'masterslider_params_default_fill_mode', 'fill' ),
123
+ 'center_controls'=> $this->is_key_true( $setting, 'centerControls', 'true' ),
124
+
125
+ 'speed' => isset( $setting['speed'] ) ? (int) $setting['speed'] : 17,
126
+
127
+ 'skin' => isset( $setting['skin'] ) ? $setting['skin'] : 'ms-skin-default', // slider skin. should be seperated by space
128
+ 'template' => isset( $setting['msTemplate'] ) ? (string) $setting['msTemplate'] : 'custom',
129
+ 'template_class'=> isset( $setting['msTemplateClass'] ) ? (string) $setting['msTemplateClass'] : '',
130
+ 'direction' => isset( $setting['dir'] ) ? (string) $setting['dir'] : 'h',
131
+ 'view' => isset( $setting['trView'] ) ? (string) $setting['trView'] : 'basic',
132
+
133
+ 'gfonts' => isset( $setting['usedFonts'] ) ? (string) $setting['usedFonts'] : '',
134
+
135
+ 'parallax_mode' => isset( $setting['parallaxMode'] ) ? (string) $setting['parallaxMode'] : 'swipe',
136
+
137
+
138
+ 'flickr_key' => isset( $setting['apiKey'] ) ? (string) $setting['apiKey'] : '',
139
+ 'flickr_id' => $setid,
140
+ 'flickr_count' => isset( $setting['imgCount'] ) ? (int) $setting['imgCount'] : 10,
141
+ 'flickr_type' => isset( $setting['setType'] ) ? (string) $setting['setType'] : 'photos',
142
+ 'flickr_size' => isset( $setting['imgSize'] ) ? (string) $setting['imgSize'] : 'c',
143
+ 'flickr_thumb_size' => isset( $setting['thumbSize'] ) ? (string) $setting['thumbSize'] : 'q',
144
+
145
+
146
+ 'ps_post_type' => isset( $setting['postType'] ) ? (string) $setting['postType'] : '',
147
+ 'ps_tax_term_ids' => $tax_term_ids,
148
+ 'ps_post_count' => isset( $setting['postCount'] ) ? (int) $setting['postCount'] : 10,
149
+ 'ps_image_from' => isset( $setting['postImageType'] ) ? (string) $setting['postImageType'] : 'auto',
150
+ 'ps_order' => isset( $setting['postOrder'] ) ? (string) $setting['postOrder'] : 'DESC',
151
+ 'ps_orderby' => isset( $setting['postOrderDir'] ) ? (string) $setting['postOrderDir'] : 'menu_order date',
152
+ 'ps_posts_not_in' => isset( $setting['postExcludeIds'] ) ? (string) $setting['postExcludeIds'] : '',
153
+ 'ps_excerpt_len' => isset( $setting['postExcerptLen'] ) ? (int) $setting['postExcerptLen'] : 100,
154
+ 'ps_offset' => isset( $setting['postOffset'] ) ? (int) $setting['postOffset'] : 0,
155
+ 'ps_link_slide' => isset( $setting['postLinkSlide'] ) ? (boolean) $setting['postLinkSlide'] : false,
156
+ 'ps_link_target' => isset( $setting['postLinkTarget'] ) ? (string) $setting['postLinkTarget'] : '_self',
157
+ 'ps_slide_bg' => isset( $setting['postSlideBg'] ) ? msp_get_the_relative_media_url( $setting['postSlideBg'] ) : '',
158
+
159
+ 'wc_only_featured' => $this->is_key_true( $setting, 'wcOnlyFeatured', 'false' ),
160
+ 'wc_only_instock' => $this->is_key_true( $setting, 'wcOnlyInstock' , 'false' ),
161
+ 'wc_only_onsale' => $this->is_key_true( $setting, 'wcOnlyOnsale' , 'false' ),
162
+
163
+
164
+ 'facebook_username' => isset( $setting['setType'] ) && ( 'photostream' == $setting['setType'] ) ? $setid : '',
165
+ 'facebook_albumid' => isset( $setting['setType'] ) && ( 'album' == $setting['setType'] ) ? $setid : '',
166
+ 'facebook_count' => isset( $setting['imgCount'] ) ? (int) $setting['imgCount'] : 10,
167
+ 'facebook_type' => isset( $setting['setType'] ) ? (string) $setting['setType'] : 'album',
168
+ 'facebook_size' => isset( $setting['imgSize'] ) ? (string) $setting['imgSize'] : 'orginal',
169
+ 'facebook_thumb_size' => isset( $setting['thumbSize'] ) ? (string) $setting['thumbSize'] : '320',
170
+
171
+ 'arrows' => 'false', // display arrows?
172
+ 'arrows_autohide' => 'true', // auto hide arrows?
173
+ 'arrows_overvideo' => 'true', // visible over slide video while playing?
174
+ 'arrows_hideunder' => '',
175
+
176
+ 'bullets' => 'false', // display bullets?
177
+ 'bullets_autohide' => 'true', // auto hide bullets?
178
+ 'bullets_overvideo'=> 'true', // visible over slide video while playing?
179
+ 'bullets_align' => 'bottom',
180
+ 'bullets_margin' => '',
181
+ 'bullets_hideunder'=> '',
182
+
183
+ 'thumbs' => 'false', // display thumbnails?
184
+ 'thumbs_autohide' => 'true', // auto hide thumbs?
185
+ 'thumbs_overvideo' => 'true', // visible over slide video while playing?
186
+ 'thumbs_type' => 'thumbs', // thumb or tabs
187
+ 'thumbs_speed' => 17, // scrolling speed. It accepts float values between 0 and 100
188
+ 'thumbs_inset' => 'true', // insert thumbs inside slider
189
+ 'thumbs_align' => 'bottom',
190
+ 'thumbs_margin' => 0,
191
+ 'thumbs_width' => 100,
192
+ 'thumbs_height' => 80,
193
+ 'thumbs_space' => 5,
194
+ 'thumbs_hideunder' => '',
195
+
196
+ 'scroll' => 'false', // display scrollbar?
197
+ 'scroll_autohide' => 'true', // auto hide scroll?
198
+ 'scroll_overvideo' => 'true', // visible over slide video while playing?
199
+ 'scroll_align' => 'top',
200
+ 'scroll_inset' => 'true',
201
+ 'scroll_margin' => '',
202
+ 'scroll_hideunder' => '',
203
+ 'scroll_color' => '#3D3D3D',
204
+ 'scroll_width' => '',
205
+
206
+
207
+ 'circletimer' => 'false', // display circletimer?
208
+ 'circletimer_autohide' => 'true', // auto hide circletimer?
209
+ 'circletimer_overvideo'=> 'true', // visible over slide video while playing?
210
+ 'circletimer_color' => '#A2A2A2',// color of circle timer
211
+ 'circletimer_radius' => 4, // radius of circle timer in pixels
212
+ 'circletimer_stroke' => 10, // the stroke of circle timer in pixels
213
+ 'circletimer_margin' => '',
214
+ 'circletimer_hideunder'=> '',
215
+
216
+ 'timebar' => 'false', // display timebar?
217
+ 'timebar_autohide' => 'true', // auto hide timebar?
218
+ 'timebar_overvideo'=> 'true', // visible over slide video while playing?
219
+ 'timebar_align' => 'bottom',
220
+ 'timebar_hideunder'=> '',
221
+ 'timebar_color' => '#FFFFFF',
222
+ 'timebar_width' => '',
223
+
224
+
225
+ 'slideinfo' => 'false', // display timebar?
226
+ 'slideinfo_autohide' => 'true', // auto hide timebar?
227
+ 'slideinfo_overvideo'=> 'true', // visible over slide video while playing?
228
+ 'slideinfo_align' => 'bottom',
229
+ 'slideinfo_inset' => 'false',
230
+ 'slideinfo_margin' => '',
231
+ 'slideinfo_hideunder'=> '',
232
+ 'slideinfo_width' => '',
233
+ 'slideinfo_height' => '',
234
+
235
+ 'on_change_start' => '',
236
+ 'on_change_end' => '',
237
+ 'on_waiting' => '',
238
+ 'on_resize' => '',
239
+ 'on_video_play' => '',
240
+ 'on_video_close' => '',
241
+ 'on_swipe_start' => '',
242
+ 'on_swipe_move' => '',
243
+ 'on_swipe_end' => ''
244
+
245
+ );
246
+
247
+
248
+ }
249
+
250
+
251
+ public function parse_slide( $slide = array() ) {
252
+
253
+ // make sure $slide is not serialized
254
+ $slide = maybe_unserialize( $slide );
255
+
256
+ if( empty( $slide ) )
257
+ return $slide;
258
+
259
+ // get slider setting and controls
260
+ $slider_setting = $this->get_slider_setting();
261
+
262
+ // get slide onfo if is set (usage: for tab content if is set)
263
+ $info = isset( $slide['info'] ) ? $slide['info'] : '';
264
+
265
+ if( isset( $slide['bg'] ) ) {
266
+ $slide_src = msp_get_the_absolute_media_url( $slide['bg'] );
267
+
268
+ // generate thumb for master slider panel
269
+ msp_get_the_resized_image_src( $slide_src, 150, 150, true );
270
+ }
271
+
272
+ $thumb = '';
273
+
274
+ // add thumb just if thumblist is added to controls list
275
+ // also always add thumbnail if slider template is gallery
276
+ if( ( 'true' == $slider_setting['thumbs'] && 'thumbs' == $slider_setting['thumbs_type'] ) ||
277
+ 'image-gallery' == $slider_setting['template']
278
+ ){
279
+
280
+ if( isset( $slide['thumb'] ) && ! empty( $slide['thumb'] ) ) {
281
+ $thumb = $slide['thumb'];
282
+ $thumb = msp_get_the_relative_media_url( $thumb );
283
+
284
+ } elseif( isset( $slide['bg'] ) ) {
285
+
286
+ // set custom thumb size if slider template is gallery
287
+ if( 'image-gallery' == $slider_setting['template'] )
288
+ $thumb = msp_get_the_resized_image_src( $slide_src, 175, 140, true );
289
+ else
290
+ $thumb = msp_get_the_resized_image_src( $slide_src, $slider_setting['thumbs_width'], $slider_setting['thumbs_height'], true );
291
+
292
+ $thumb = msp_get_the_relative_media_url( $thumb );
293
+
294
+ } else {
295
+ $thumb = '';
296
+ }
297
+
298
+ }
299
+
300
+
301
+ $slides = array(
302
+
303
+ 'slide_order'=> isset( $slide['order'] ) ? (int) $slide['order'] : 0,
304
+
305
+ 'css_class' => isset( $slide['cssClass'] ) ? (string) $slide['cssClass'] : '',
306
+ 'css_id' => isset( $slide['cssId'] ) ? (string) $slide['cssId'] : '',
307
+
308
+ 'ishide' => $this->is_key_true( $slide, 'ishide', 'false' ),
309
+
310
+ 'src' => isset( $slide['bg'] ) ? esc_attr( msp_get_the_relative_media_url( $slide['bg'] ) ) : '',
311
+ 'src_full' => isset( $slide['bg'] ) ? esc_attr( msp_get_the_relative_media_url( $slide['bg'] ) ) : '',
312
+
313
+ 'title' => '', // image title
314
+ 'alt' => isset( $slide['bgAlt'] ) ? esc_attr($slide['bgAlt']) : '', // image alternative text
315
+ 'link' => isset( $slide['link'] ) ? esc_url( $slide['link'] ) : '',
316
+ 'target' => isset( $slide['linkTarget'] ) ? (string) $slide['linkTarget'] : '',
317
+ 'video' => isset( $slide['video'] ) ? esc_attr( $slide['video'] ) : '', // youtube or vimeo video link
318
+
319
+ 'info' => wp_slash( $info ), // image alternative text
320
+
321
+ 'mp4' => isset( $slide['bgv_mp4'] ) ? esc_attr( $slide['bgv_mp4'] ) : '', // self host video bg
322
+ 'webm' => isset( $slide['bgv_webm'] ) ? esc_attr( $slide['bgv_webm'] ) : '', // self host video bg
323
+ 'ogg' => isset( $slide['bgv_ogg'] ) ? esc_attr( $slide['bgv_ogg'] ) : '', // self host video bg
324
+ 'autopause' => $this->is_key_true( $slide, 'bgv_autopause', 'false' ),
325
+ 'mute' => $this->is_key_true( $slide, 'bgv_mute', 'true' ),
326
+ 'loop' => $this->is_key_true( $slide, 'bgv_loop', 'true' ),
327
+ 'vbgalign' => isset( $slide['bgv_fillmode'] ) ? (string) $slide['bgv_fillmode'] : 'fill',
328
+
329
+ 'thumb' => $thumb,
330
+ 'tab' => 'true' == $slider_setting['thumbs'] && 'tabs' == $slider_setting['thumbs_type'] ? str_replace( '"', '&quote;', $info ) : '',
331
+ 'delay' => isset( $slide['duration'] ) ? (string) $slide['duration'] : '', // data-delay
332
+ 'bgalign' => isset( $slide['fillMode'] ) ? (string) $slide['fillMode'] : 'fill', // data-fill-mode
333
+ 'bgcolor' => isset( $slide['bgColor'] ) ? (string) $slide['bgColor'] : ''
334
+ );
335
+
336
+ return $slides;
337
+ }
338
+
339
+
340
+ public function parse_each_style( $style_obj, $allowed_style_type = array( 'custom' ) ) {
341
+
342
+ // make sure $style_obj is not serialized
343
+ $style_obj = maybe_unserialize( $style_obj );
344
+
345
+ if( empty( $style_obj ) )
346
+ return $style_obj;
347
+
348
+ $allowed_style_type = (array) $allowed_style_type;
349
+
350
+ if( ! isset( $style_obj['type'] ) || ( ! in_array( $style_obj['type'], $allowed_style_type ) ) )
351
+ return '';
352
+
353
+ // the css block selector
354
+ $class_name = isset( $style_obj['className'] ) ? ".". $style_obj['className'] : '';
355
+ // store css styles
356
+ $css = '';
357
+
358
+ $supported_css_props = array(
359
+
360
+ 'backgroundColor' => array('background-color' , '' ),
361
+
362
+ 'paddingTop' => array('padding-top' , 'px'),
363
+ 'paddingRight' => array('padding-right' , 'px'),
364
+ 'paddingBottom' => array('padding-bottom' , 'px'),
365
+ 'paddingLeft' => array('padding-left' , 'px'),
366
+
367
+ 'borderTop' => array('border-top' , 'px'),
368
+ 'borderRight' => array('border-right' , 'px'),
369
+ 'borderBottom' => array('border-bottom' , 'px'),
370
+ 'borderLeft' => array('border-left' , 'px'),
371
+
372
+ 'borderColor' => array('border-color' , '' ),
373
+ 'borderRadius' => array('border-radius' , 'px'),
374
+ 'borderStyle' => array('border-style' , '' ),
375
+
376
+ 'fontFamily' => array('font-family' , '' ),
377
+ 'fontWeight' => array('font-weight' , '' ),
378
+ 'fontSize' => array('font-size' , 'px'),
379
+
380
+ 'textAlign' => array('text-align' , '' ),
381
+ 'letterSpacing' => array('letter-spacing' , 'px'),
382
+ 'lineHeight' => array('line-height' , 'px'),
383
+ 'whiteSpace' => array('white-space' , '' ),
384
+ 'color' => array('color' , '' )
385
+ );
386
+
387
+ foreach ( $supported_css_props as $js_prop => $parse_option ) {
388
+
389
+ if( isset( $style_obj[$js_prop] ) && ! empty( $style_obj[$js_prop] ) ) {
390
+ // if prop is font-family add quote around font name
391
+ if ( 'fontFamily' == $js_prop )
392
+ $css .= sprintf( "%s%s:\"%s\";", $this->tab_char, $parse_option['0'], rtrim( $style_obj[$js_prop] ) ) . $this->join_char;
393
+
394
+ elseif ( 'lineHeight' == $js_prop && 'normal' == $style_obj[$js_prop] )
395
+ $css .= sprintf( "%s%s:%s;", $this->tab_char, $parse_option['0'], rtrim( $style_obj[$js_prop] ) ) . $this->join_char;
396
+
397
+ else
398
+ $css .= sprintf( "%s%s:%s%s;" , $this->tab_char, $parse_option['0'], rtrim( $style_obj[$js_prop], $parse_option['1'] ), $parse_option['1'] ) . $this->join_char;
399
+
400
+ }
401
+ }
402
+
403
+ // add custom styles at the end
404
+ $css .= isset( $style_obj['custom'] ) ? $this->tab_char . $style_obj['custom'] .$this->join_char : '';
405
+ // create css block
406
+ $css_block = $this->join_char.$class_name." { ".$this->join_char.$css." } \n";
407
+ //$css_block = sprintf( "\n%s {\n%s\n} \n", $class_name, $css );
408
+
409
+ return apply_filters( 'msp_parse_each_style', $css_block, $class_name, $css, $supported_css_props );
410
+ }
411
+
412
+
413
+
414
+
415
+
416
+
417
+ // set/store panel raw and parsed data for further use
418
+ public function set_data( $data, $slider_id = null ) {
419
+ $this->reset();
420
+
421
+ $this->maybe_encoded_data = $data;
422
+ $this->current_slider_id = $slider_id;
423
+
424
+ $decoded = msp_maybe_base64_decode( $data );
425
+ $this->parsable_data = json_decode($decoded);
426
+ }
427
+
428
+
429
+ // reset cache data
430
+ public function reset() {
431
+ $this->recent_setting = null;
432
+ $this->recent_slides = null;
433
+ $this->recent_styles = null;
434
+ $this->maybe_encoded_data = null;
435
+ }
436
+
437
+
438
+
439
+ // get decoded and parsable panel data
440
+ public function get_parsable_data() {
441
+ return $this->parsable_data;
442
+ }
443
+
444
+
445
+
446
+
447
+
448
+
449
+ public function get_raw_callbacks(){
450
+ if ( isset( $this->parsable_data->{'MSPanel.Callback'} ) )
451
+ return $this->parsable_data->{'MSPanel.Callback'};
452
+ return array();
453
+ }
454
+
455
+
456
+ public function get_callbacks_params(){
457
+ $callbacks_list = $this->get_raw_callbacks();
458
+
459
+ $callbacks_params = array();
460
+
461
+ foreach ($callbacks_list as $id => $callback_json) {
462
+ $raw_json_decoded_callback = json_decode( $callback_json, true );
463
+ $callback_params = $this->get_callback_params( $raw_json_decoded_callback );
464
+ $callbacks_params = wp_parse_args( $callback_params, $callbacks_params );
465
+ }
466
+
467
+ return $callbacks_params;
468
+ }
469
+
470
+
471
+ public function get_callback_params( $callback ) {
472
+
473
+ $name = isset( $callback['name'] ) ? (string) $callback['name'] : '';
474
+
475
+ switch ( $name ) {
476
+ case 'CHANGE_START':
477
+ return array( 'on_change_start' => isset( $callback['content'] ) ? base64_encode( $callback['content'] ) : '' );
478
+ case 'CHANGE_END':
479
+ return array( 'on_change_end' => isset( $callback['content'] ) ? base64_encode( $callback['content'] ) : '' );
480
+ case 'WAITING':
481
+ return array( 'on_waiting' => isset( $callback['content'] ) ? base64_encode( $callback['content'] ) : '' );
482
+ case 'RESIZE':
483
+ return array( 'on_resize' => isset( $callback['content'] ) ? base64_encode( $callback['content'] ) : '' );
484
+ case 'VIDEO_PLAY':
485
+ return array( 'on_video_play' => isset( $callback['content'] ) ? base64_encode( $callback['content'] ) : '' );
486
+ case 'VIDEO_CLOSE':
487
+ return array( 'on_video_close' => isset( $callback['content'] ) ? base64_encode( $callback['content'] ) : '' );
488
+ case 'SWIPE_START':
489
+ return array( 'on_swipe_start' => isset( $callback['content'] ) ? base64_encode( $callback['content'] ) : '' );
490
+ case 'SWIPE_MOVE':
491
+ return array( 'on_swipe_move' => isset( $callback['content'] ) ? base64_encode( $callback['content'] ) : '' );
492
+ case 'SWIPE_END':
493
+ return array( 'on_swipe_end' => isset( $callback['content'] ) ? base64_encode( $callback['content'] ) : '' );
494
+ default:
495
+ return array();
496
+ }
497
+
498
+ }
499
+
500
+
501
+
502
+
503
+
504
+
505
+
506
+
507
+ public function get_raw_controls(){
508
+ if ( isset( $this->parsable_data->{'MSPanel.Control'} ) )
509
+ return $this->parsable_data->{'MSPanel.Control'};
510
+ return array();
511
+ }
512
+
513
+
514
+ public function get_controls_params(){
515
+ $controls_list = $this->get_raw_controls();
516
+
517
+ $controls_params = array();
518
+
519
+ foreach ($controls_list as $id => $control_json) {
520
+ $raw_json_decoded_control = json_decode( $control_json, true );
521
+ $control_params = $this->get_control_params( $raw_json_decoded_control );
522
+ $controls_params = wp_parse_args( $control_params, $controls_params );
523
+ }
524
+
525
+ return $controls_params;
526
+ }
527
+
528
+
529
+ public function get_control_params( $control ) {
530
+
531
+ $name = isset( $control['name'] ) ? (string) $control['name'] : '';
532
+
533
+ switch ( $name ) {
534
+ case 'thumblist':
535
+ return array(
536
+ 'thumbs' => 'true',
537
+ 'thumbs_autohide' => $this->is_key_true( $control, 'autoHide' , 'true' ),
538
+ 'thumbs_overvideo' => $this->is_key_true( $control, 'overVideo', 'true' ),
539
+ 'thumbs_speed' => isset( $control['speed'] ) ? (int) $control['speed'] : 17,
540
+ 'thumbs_type' => isset( $control['type'] ) ? (string) $control['type'] : 'thumbs',
541
+ 'thumbs_inset' => $this->is_key_true( $control, 'inset', 'false' ),
542
+ 'thumbs_align' => isset( $control['align'] ) ? (string) $control['align'] : 'bottom',
543
+ 'thumbs_margin' => isset( $control['margin'] ) ? (int) $control['margin'] : '',
544
+ 'thumbs_width' => isset( $control['width'] ) ? (int) $control['width'] : 100,
545
+ 'thumbs_height' => isset( $control['height'] ) ? (int) $control['height'] : 80,
546
+ 'thumbs_space' => isset( $control['space'] ) ? (int) $control['space'] : 5,
547
+ 'thumbs_hideunder' => isset( $control['hideUnder'] ) ? (int) $control['hideUnder'] : '',
548
+ 'thumbs_fillmode' => isset( $control['fillMode'] ) ? (string) $control['fillMode'] : 'fill'
549
+ );
550
+ case 'bullets':
551
+ return array(
552
+ 'bullets' => 'true',
553
+ 'bullets_autohide' => $this->is_key_true( $control, 'autoHide' , 'true' ),
554
+ 'bullets_overvideo'=> $this->is_key_true( $control, 'overVideo', 'true' ),
555
+ 'bullets_align' => isset( $control['align'] ) ? (string) $control['align'] : 'bottom',
556
+ 'bullets_margin' => isset( $control['margin'] ) ? (int) $control['margin'] : '',
557
+ 'bullets_hideunder' => isset( $control['hideUnder'] ) ? (int) $control['hideUnder'] : ''
558
+ );
559
+ case 'scrollbar':
560
+ return array(
561
+ 'scroll' => 'true',
562
+ 'scroll_autohide' => $this->is_key_true( $control, 'autoHide' , 'true' ),
563
+ 'scroll_overvideo' => $this->is_key_true( $control, 'overVideo', 'true' ),
564
+ //'scroll_width' => isset( $control['width'] ) ? (int) $control['width'] : '',
565
+ 'scroll_align' => isset( $control['align'] ) ? (string) $control['align'] : 'top',
566
+ 'scroll_color' => isset( $control['color'] ) ? (string) $control['color'] : '#3D3D3D',
567
+ 'scroll_margin' => isset( $control['margin'] ) ? (int) $control['margin'] : '',
568
+ 'scroll_inset' => $this->is_key_true( $control, 'inset', 'true' ),
569
+ 'scroll_hideunder' => isset( $control['hideUnder'] ) ? (int) $control['hideUnder'] : '',
570
+ 'scroll_width' => isset( $control['width'] ) ? (int) $control['width'] : ''
571
+ );
572
+ case 'arrows':
573
+ return array(
574
+ 'arrows' => 'true',
575
+ 'arrows_autohide' => $this->is_key_true( $control, 'autoHide' , 'true' ),
576
+ 'arrows_overvideo' => $this->is_key_true( $control, 'overVideo', 'true' ),
577
+ 'arrows_hideunder' => isset( $control['hideUnder'] ) ? (int) $control['hideUnder'] : ''
578
+ );
579
+ case 'timebar':
580
+ return array(
581
+ 'timebar' => 'true',
582
+ 'timebar_autohide' => $this->is_key_true( $control, 'autoHide' , 'true' ),
583
+ 'timebar_overvideo'=> $this->is_key_true( $control, 'overVideo', 'true' ),
584
+ 'timebar_align' => isset( $control['align'] ) ? (string) $control['align'] : 'bottom',
585
+ 'timebar_color' => isset( $control['color'] ) ? (string) $control['color'] : '#FFFFFF',
586
+ 'timebar_hideunder'=> isset( $control['hideUnder'] ) ? (int) $control['hideUnder'] : '',
587
+ 'timebar_width' => isset( $control['width'] ) ? (int) $control['width'] : ''
588
+ );
589
+ case 'circletimer':
590
+ return array(
591
+ 'circletimer' => 'true',
592
+ 'circletimer_autohide' => $this->is_key_true( $control, 'autoHide' , 'true' ),
593
+ 'circletimer_overvideo'=> $this->is_key_true( $control, 'overVideo', 'true' ),
594
+ 'circletimer_color' => isset( $control['color'] ) ? (string) $control['color'] : '#A2A2A2',
595
+ 'circletimer_radius' => isset( $control['radius'] ) ? (int) $control['radius'] : 4,
596
+ 'circletimer_stroke' => isset( $control['stroke'] ) ? (int) $control['stroke'] : 10,
597
+ 'circletimer_margin' => isset( $control['margin'] ) ? (int) $control['margin'] : '',
598
+ 'circletimer_hideunder'=> isset( $control['hideUnder'] ) ? (int) $control['hideUnder'] : ''
599
+ );
600
+ case 'slideinfo':
601
+ return array(
602
+ 'slideinfo' => 'true',
603
+ 'slideinfo_autohide' => $this->is_key_true( $control, 'autoHide' , 'true' ),
604
+ 'slideinfo_overvideo'=> $this->is_key_true( $control, 'overVideo', 'true' ),
605
+ 'slideinfo_align' => isset( $control['align'] ) ? (string) $control['align'] : 'bottom',
606
+ 'slideinfo_inset' => $this->is_key_true( $control, 'inset', 'false' ),
607
+ 'slideinfo_margin' => isset( $control['margin'] ) ? (int) $control['margin'] : '',
608
+ 'slideinfo_hideunder'=> isset( $control['hideUnder'] ) ? (int) $control['hideUnder'] : '',
609
+ 'slideinfo_width' => isset( $control['width'] ) ? (int) $control['width'] : '',
610
+ 'slideinfo_height' => isset( $control['height'] ) ? (int) $control['height'] : ''
611
+ );
612
+ default:
613
+ return array();
614
+ }
615
+
616
+ }
617
+
618
+
619
+
620
+
621
+
622
+ public function has_raw_setting(){
623
+ if ( isset( $this->parsable_data->{'MSPanel.Settings'} ) && isset( $this->parsable_data->{'MSPanel.Settings'}->{'1'} ) )
624
+ return true;
625
+ return false;
626
+ }
627
+
628
+
629
+ public function get_raw_setting(){
630
+ if ( $this->has_raw_setting() )
631
+ return $this->parsable_data->{'MSPanel.Settings'}->{'1'};
632
+ return null;
633
+ }
634
+
635
+
636
+ public function get_slider_setting( $force_new_parse = false ){
637
+ $raw_setting = $this->get_raw_setting();
638
+
639
+ if( is_null( $raw_setting ) ){
640
+ return $this->parse_setting();
641
+ }
642
+
643
+ if( is_null( $this->recent_setting ) || $force_new_parse ) {
644
+ $raw_json_decoded_setting = json_decode( $raw_setting, true );
645
+ $this->recent_setting = $this->parse_setting( $raw_json_decoded_setting );
646
+ $this->recent_setting = wp_parse_args( $this->get_controls_params() , $this->recent_setting );
647
+ $this->recent_setting = wp_parse_args( $this->get_callbacks_params(), $this->recent_setting );
648
+ }
649
+ return $this->recent_setting;
650
+ }
651
+
652
+
653
+
654
+
655
+
656
+
657
+
658
+ // is slides data passed in raw panel data?
659
+ public function has_raw_slide() {
660
+ if ( isset( $this->parsable_data->{'MSPanel.Slide'} ) )
661
+ return true;
662
+ return false;
663
+ }
664
+
665
+
666
+ public function get_raw_slides() {
667
+ if ( $this->has_raw_slide() ) {
668
+ return $this->parsable_data->{'MSPanel.Slide'};
669
+ }
670
+ return null;
671
+ }
672
+
673
+
674
+ public function get_parsable_slides() {
675
+
676
+ if( ! $raw_slides = $this->get_raw_slides() ){
677
+ return array();
678
+ }
679
+
680
+ $valid_slides = array();
681
+
682
+ foreach ( $raw_slides as $id => $raw_slide ) {
683
+ $raw_json_decoded_slide = json_decode( $raw_slide, true );
684
+ $valid_slides[ $raw_json_decoded_slide['order'] ] = $raw_json_decoded_slide;
685
+ }
686
+
687
+ ksort( $valid_slides );
688
+ return $valid_slides;
689
+ }
690
+
691
+
692
+ public function get_slides( $force_new_parse = false ) {
693
+
694
+ if( is_null( $this->recent_slides ) || $force_new_parse ) {
695
+
696
+ $parsable_slides = $this->get_parsable_slides();
697
+
698
+ if ( empty( $parsable_slides ) )
699
+ return $parsable_slides;
700
+
701
+ $slides = array();
702
+
703
+ foreach ( $parsable_slides as $slide ) {
704
+ $slides[] = $this->parse_slide( $slide );
705
+ }
706
+
707
+ $this->recent_slides = $slides;
708
+ }
709
+ return $this->recent_slides;
710
+ }
711
+
712
+
713
+
714
+
715
+
716
+
717
+
718
+ public function has_raw_style() {
719
+ if ( isset( $this->parsable_data->{'MSPanel.Style'} ) )
720
+ return true;
721
+ return false;
722
+ }
723
+
724
+
725
+ public function get_raw_styles() {
726
+ if ( $this->has_raw_style() ) {
727
+ return $this->parsable_data->{'MSPanel.Style'};
728
+ }
729
+ return null;
730
+ }
731
+
732
+
733
+ public function get_parsable_styles() {
734
+
735
+ if( ! $raw_styles = $this->get_raw_styles() ){
736
+ return array();
737
+ }
738
+
739
+ $valid_styles = array();
740
+
741
+ foreach ( $raw_styles as $id => $raw_style ) {
742
+ $raw_json_decoded_style = json_decode( $raw_style, true );
743
+ $valid_styles[] = $raw_json_decoded_style;
744
+ }
745
+
746
+ return $valid_styles;
747
+ }
748
+
749
+
750
+ public function get_styles_list( $force_new_parse = false ) {
751
+
752
+ if( is_null( $this->recent_styles ) || $force_new_parse ) {
753
+
754
+ $parsable_styles = $this->get_parsable_styles();
755
+
756
+ if ( empty( $parsable_styles ) )
757
+ return $parsable_styles;
758
+
759
+ $styles = array();
760
+
761
+ foreach ( $parsable_styles as $id => $style ) {
762
+ $styles[$id] = $this->parse_each_style( $style );
763
+ }
764
+
765
+ $this->recent_styles = $styles;
766
+ }
767
+
768
+ return $this->recent_styles;
769
+ }
770
+
771
+
772
+ public function get_styles( $force_new_parse = false ) {
773
+ $styles_list = $this->get_styles_list();
774
+ return implode( $this->join_char, $styles_list );
775
+ }
776
+
777
+
778
+
779
+
780
+
781
+
782
+
783
+
784
+
785
+
786
+
787
+
788
+ private function get_preset_styles_list( $parsable_preset_styles ) {
789
+
790
+ if ( empty( $parsable_preset_styles ) )
791
+ return $parsable_preset_styles;
792
+
793
+ $preset_styles = array();
794
+
795
+ foreach ( $parsable_preset_styles as $id => $preset_style ) {
796
+ $preset_styles[$id] = $this->parse_each_style( $preset_style, 'preset' );
797
+ }
798
+
799
+ return $preset_styles;
800
+ }
801
+
802
+ public function preset_data_to_styles( $raw_preset_styles ){
803
+ $valid_preset_styles = array();
804
+
805
+ foreach ( $raw_preset_styles as $id => $raw_preset_style ) {
806
+ $raw_json_decoded_preset_style = json_decode( $raw_preset_style, true );
807
+ $valid_preset_styles[] = $raw_json_decoded_preset_style;
808
+ }
809
+
810
+ $preset_styles_list = $this->get_preset_styles_list( $valid_preset_styles );
811
+ return implode( $this->join_char, $preset_styles_list );
812
+ }
813
+
814
+ public function get_preset_styles( $raw_preset ) {
815
+
816
+ $b64_decoded = msp_maybe_base64_decode( $raw_preset );
817
+ $preset_data = json_decode( $b64_decoded );
818
+
819
+ if ( ! isset( $preset_data->{'MSPanel.PresetStyle'} ) )
820
+ return '';
821
+
822
+ $raw_preset_styles = $preset_data->{'MSPanel.PresetStyle'};
823
+
824
+ return $this->preset_data_to_styles( $raw_preset_styles );
825
+ }
826
+
827
+
828
+
829
+
830
+
831
+
832
+ private function get_buttons_styles_list( $parsable_buttons_styles ) {
833
+
834
+ if ( empty( $parsable_buttons_styles ) )
835
+ return $parsable_buttons_styles;
836
+
837
+ $buttons_styles = array();
838
+
839
+ foreach ( $parsable_buttons_styles as $id => $button_style ) {
840
+ if( ! isset( $button_style['className'] ) ) continue;
841
+
842
+ if( isset( $button_style['normal'] ) )
843
+ $button_styles[] = sprintf( ".%s{ %s }", $button_style['className'], str_replace("\n", "", $button_style['normal'] ) );
844
+ if( isset( $button_style['hover'] ) )
845
+ $button_styles[] = sprintf( ".%s:hover{ %s }", $button_style['className'], str_replace("\n", "", $button_style['hover'] ) );
846
+ if( isset( $button_style['active'] ) )
847
+ $button_styles[] = sprintf( ".%s:active{ %s }", $button_style['className'], str_replace("\n", "", $button_style['active'] ) );
848
+ }
849
+
850
+ return $button_styles;
851
+ }
852
+
853
+ public function buttons_data_to_styles( $raw_buttons_styles ){
854
+ $valid_buttons_styles = array();
855
+
856
+ foreach ( $raw_buttons_styles as $id => $raw_buttons_style ) {
857
+ $raw_json_decoded_buttons_style = json_decode( $raw_buttons_style, true );
858
+ $valid_buttons_styles[] = $raw_json_decoded_buttons_style;
859
+ }
860
+
861
+ $buttons_styles_list = $this->get_buttons_styles_list( $valid_buttons_styles );
862
+ return implode( $this->join_char. " ", $buttons_styles_list );
863
+ }
864
+
865
+ public function get_buttons_styles( $raw_buttons ) {
866
+
867
+ $b64_decoded = msp_maybe_base64_decode( $raw_buttons );
868
+ $buttons_data = json_decode( $b64_decoded );
869
+
870
+ if ( ! isset( $buttons_data->{'MSPanel.ButtonStyle'} ) )
871
+ return '';
872
+
873
+ $raw_buttons_styles = $buttons_data->{'MSPanel.ButtonStyle'};
874
+ return $this->buttons_data_to_styles( $raw_buttons_styles );
875
+ }
876
+
877
+
878
+
879
+
880
+
881
+
882
+
883
+ public function parser_slider( $force_new_parse = false ) {
884
+ $this->get_slider_setting( $force_new_parse );
885
+ $this->get_slides( $force_new_parse );
886
+ $this->get_styles( $force_new_parse );
887
+ }
888
+
889
+
890
+ public function get_results( $force_new_parse = false ) {
891
+ $result = array();
892
+
893
+ $result['setting'] = $this->get_slider_setting( $force_new_parse );
894
+ $result['slides'] = $this->get_slides( $force_new_parse );
895
+ $result['styles'] = $this->get_styles( $force_new_parse );
896
+
897
+ return $result;
898
+ }
899
+
900
+
901
+ // pretty human readable print for parsed data
902
+ public function pretty_print() {
903
+ axpp( $this->parsable_data );
904
+ }
905
+
906
+
907
+ }
admin/includes/classes/class-msp-pointers.php ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Master Slider Pointers Class.
4
+ *
5
+ * @package MasterSlider
6
+ * @author averta [averta.net]
7
+ * @license LICENSE.txt
8
+ * @link http://masterslider.com
9
+ * @copyright Copyright © 2014 averta
10
+ */
11
+
12
+ /**
13
+ *
14
+ */
15
+ class MSP_Pointers {
16
+
17
+ /* */
18
+ public $pointers = array();
19
+ public $seen_ids = array();
20
+ public $not_seen_pointers = array();
21
+ public $version_file = '';
22
+
23
+ /**
24
+ * Set theme or plugine file path to get version from
25
+ * @param string $version_file a path to plugin or theme file to get and compare version with it
26
+ */
27
+ function __construct( $version_file = '' ) {
28
+ $this->version_file = $version_file;
29
+ }
30
+
31
+
32
+
33
+ public function add( $options = array() ){
34
+ // return if no data passed
35
+ if( empty( $options ) || ! is_array( $options ) ) return false;
36
+
37
+ $options = array_merge( $this->default_point(), $options );
38
+ // add pointer to pointers list
39
+ $this->pointers[] = $options;
40
+
41
+ return true;
42
+ }
43
+
44
+
45
+
46
+
47
+ public function init(){
48
+ global $wp_version;
49
+
50
+ if ( version_compare( $wp_version, '3.4', '<' ) )
51
+ return false;
52
+
53
+ if( ! count( $this->pointers) ) return "No Point Available.";
54
+
55
+ add_action( 'admin_enqueue_scripts' , array( $this, 'add_hooks' ) );
56
+ add_action( 'admin_print_footer_scripts', array( $this, 'print_pointer_scripts' ) );
57
+ return true;
58
+ }
59
+
60
+
61
+
62
+
63
+
64
+ public function add_hooks(){
65
+ if ( ! current_user_can( 'manage_options' ) ) return;
66
+
67
+ if( ! count( $this->pointers ) ) return false;
68
+
69
+ $this->seen_ids = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
70
+
71
+ foreach ( $this->pointers as $key => $pointer_data ) {
72
+ if( ! in_array( $pointer_data["id"], $this->seen_ids ) )
73
+ $this->not_seen_pointers[] = $pointer_data;
74
+ }
75
+
76
+ if( count( $this->not_seen_pointers ) ) {
77
+ /* Load wp-pointer scripts and styles */
78
+ wp_enqueue_style ( 'wp-pointer' );
79
+ wp_enqueue_script( 'wp-pointer' );
80
+
81
+ add_action( 'admin_print_footer_scripts', array( $this, 'print_pointer_scripts' ) );
82
+ }
83
+
84
+ return true;
85
+ }
86
+
87
+
88
+
89
+
90
+
91
+
92
+ public function print_pointer_scripts() {
93
+ if ( ! current_user_can( 'manage_options' ) ) return;
94
+
95
+ global $hook_suffix;
96
+
97
+ $info = empty( $this->version_file ) ? wp_get_theme() : get_plugin_data( $this->version_file );
98
+
99
+ foreach ( $this->not_seen_pointers as $key => $pointer_data ) {
100
+ // check if we are on correct page to display pointer
101
+ if( ! empty( $pointer_data["hook_suffix"] ) && $pointer_data["hook_suffix"] != $hook_suffix ) continue;
102
+ // display pointer for specified theme version and above
103
+ if( version_compare( $info["Version"], $pointer_data["version"], '<' ) ) continue;
104
+ ?>
105
+ <script type="text/javascript">
106
+ jQuery(document).ready(function($) {
107
+ if( typeof(jQuery().pointer) != 'undefined' ) {
108
+ $('<?php echo $pointer_data["target"]; ?>').pointer({
109
+ content: '<?php printf('<h3>%s</h3><p>%s</p>', $pointer_data["title"],$pointer_data["content"]); ?>',
110
+ pointerClass: '<?php echo $pointer_data["id"]; ?>',
111
+ pointerWidth: <?php echo isset( $pointer_data["width"] ) ? (int) $pointer_data["width"] : 320; ?>,
112
+ position: {
113
+ edge: '<?php echo $pointer_data["position"]["edge"]; ?>',
114
+ align: '<?php echo $pointer_data["position"]["align"]; ?>'
115
+ },
116
+ close: function() {
117
+ $.post( ajaxurl, {
118
+ pointer: '<?php echo $pointer_data["id"]; ?>',
119
+ action: 'dismiss-wp-pointer'
120
+ });
121
+ }
122
+ }).pointer('open');
123
+ }
124
+ });
125
+ </script>
126
+ <?php
127
+ if( isset( $pointer_data["css"] ) )
128
+ printf( '<style>%s</style>', $pointer_data["css"] );
129
+ }
130
+ }
131
+
132
+
133
+
134
+
135
+ public function default_point(){
136
+ return array(
137
+ 'id' => 'mspo', // Unique id for pointer
138
+ 'hook_suffix'=> '', // Screen hook suffix to show pointer on [empty means display every where on admin] (dashboard : index.php)
139
+ 'target' => '#menu-settings',// CSS selector to hang the pointer to that element
140
+ 'version' => '1', // The theme or plugin version to display tooltip on
141
+ 'title' => '', // Tooltip title
142
+ 'content' => '', // Tooltip description
143
+ 'position' => array(
144
+ 'edge' => 'left', //top, bottom, left, right
145
+ 'align' => 'middle' //top, bottom, left, right, middle
146
+ )
147
+ );
148
+ }
149
+ }
150
+
151
+
152
+ /*-----------------------------------------------------------------------------------*/
153
+ /* Display Admin Pointers
154
+ /*-----------------------------------------------------------------------------------*/
155
+
156
+ function msp_add_custom_pointers(){
157
+
158
+ // admin pointers /////////////////////////////////////////////////////////
159
+ $msp_pointers = new MSP_Pointers( MSWP_AVERTA_DIR . '/' . MSWP_SLUG . '.php' );
160
+ $msp_pointers->add( array(
161
+ 'id' => 'master_1_0_view_help', // Unique id for pointer
162
+ 'hook_suffix'=> 'toplevel_page_masterslider', // Screen hook suffix to show pointer on [empty means display every where on admin] (dashboard : index.php)
163
+ 'target' => '#contextual-help-link', // CSS selector to hang the pointer to that element
164
+ 'version' => '1.0.0', // The theme or plugin version to display tooltip on
165
+ 'title' => __( 'Do you need any help on Master Slider?', MSWP_TEXT_DOMAIN ), // Tooltip title
166
+ 'content' => sprintf( __( 'Please open contextual help panel (click the %s button at top right side of this page)', MSWP_TEXT_DOMAIN ), '<strong style="color:#1D86AC;">'.__( 'Help', MSWP_TEXT_DOMAIN ).'</strong>' ), // Tooltip description
167
+ 'width' => 370,
168
+ 'css' => '.master_1_0_view_help { left:auto !important; right:20px !important; } .master_1_0_view_help .wp-pointer-arrow { left:auto !important; right:25px; }',
169
+ 'position' => array(
170
+ 'edge' => 'top', //top, bottom, left, right
171
+ 'align' => 'middle' //top, bottom, left, right, middle
172
+ )
173
+ )
174
+ );
175
+
176
+ $msp_pointers->init();
177
+
178
+ }
179
+
180
+ // msp_add_custom_pointers();
181
+
182
+ ?>
admin/includes/classes/class-msp-screen-help.php ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if( ! class_exists( 'MSP_Screen_Help' ) ) :
4
+
5
+ /**
6
+ * Class to add help tabs on master slider admin pages
7
+ */
8
+ class MSP_Screen_Help extends Axiom_Screen_Help {
9
+
10
+ /**
11
+ * __construct
12
+ */
13
+ function __construct() {
14
+
15
+ // define tabs data
16
+ $tabs = array (
17
+
18
+ array('id' => 'msp-how-use-tab',
19
+ 'title' => __( 'Display Sliders on pages', MSWP_TEXT_DOMAIN ),
20
+ 'callback' => array( $this, 'display_masterslider' ) // callback to display tab content @km!
21
+ ),
22
+ array('id' => 'msp-supp-tab',
23
+ 'title' => __( 'Master Slider Support', MSWP_TEXT_DOMAIN ),
24
+ 'callback' => array( $this, 'display_support' ) // callback to display tab content @km!
25
+ )
26
+ );
27
+
28
+ parent::__construct( $tabs, msp_get_screen_ids(), 'masterslider_help_tab_' );
29
+ }
30
+
31
+
32
+ public function display_masterslider(){
33
+ ?>
34
+ <h2>How to Display Sliders on Pages</h2>
35
+ <p>You can display Master Slider on your website with using one of the three ways that are explained below.</p>
36
+ <hr />
37
+
38
+ <div class="row-fluid">
39
+
40
+ <div>
41
+ <h3>1 - Inserting the slider with shortcode (Easiest way)</h3>
42
+ <p>You can place your sliders into pages and posts with their shortcodes.</p>
43
+ <p>You can find the shortcode for each slider in Master Slider admin page next to their names in the list view.</p>
44
+
45
+ <img src="<?php echo MSWP_AVERTA_ADMIN_URL. '/assets/images/misc/where-is-ms-shortcode.png'; ?>" />
46
+ <p>To insert the slider, edit a page or post and insert its shortcode into the WordPress text editor like following screenshot. </p>
47
+ <p>In this example the shortcode is <code>[masterslider id="1"]</code></p>
48
+ <img src="<?php echo MSWP_AVERTA_ADMIN_URL. '/assets/images/misc/shortcode-in-editor.png'; ?>" />
49
+ </div>
50
+ </div>
51
+
52
+ <hr>
53
+
54
+ <div class="row-fluid">
55
+ <div >
56
+ <h3>2 - Inserting the slider with the Master Slider WP widget</h3>
57
+ <p>
58
+ MasterSlider WP supports widgets, so you can place your slider in your front-end page just by a drag n' drop. To do that, navigate to the Appearance menu on your left sidebar and select "Widgets". Grab the MasterSlider WP Widget and drop it into one of your widget area.
59
+
60
+ Please note that some themes may not support a widget area what you need. In this case, you can create a new widget area by editing your theme files.
61
+ </p>
62
+ </div>
63
+ </div>
64
+
65
+ <hr>
66
+
67
+ <div class="row-fluid">
68
+ <div>
69
+ <h3>3 - Calling the slider from your theme files (For Advanced users)</h3>
70
+ <p>
71
+ Because a slider can be an integral part of your site, you may want to place it into your theme files. There are some PHP function which you can call for example from the header.php file of your theme and it inserts your slider into your home page or certail other pages. Here they are :
72
+ </p>
73
+ <br />
74
+
75
+ <h5>Description</h5>
76
+ <p>Displays Master Slider markup for specific slider ID</p>
77
+
78
+ <h5>Usage :</h5>
79
+ <p><code>&lt;?php masterslider( $id ); ?&gt;</code></p>It's equal to :
80
+ <p><code>&lt;?php echo get_masterslider( $id ); ?&gt;</code></p>
81
+
82
+ <h5>Parameters :</h5>
83
+ <dl>
84
+ <dt><tt>$id</tt></dt>
85
+ <dd> (int) The slider ID that can be found on the plugin page in the slider list view at the first table column. Default: <i>Null</i></dd>
86
+ </dl><br />
87
+
88
+ <h5>Example :</h5>
89
+ <p>If you've created a slider and the slider ID is equal to <code>1</code> you can use the following code to display the slider on your website.</p>
90
+ <p><code>&lt;?php masterslider ( 1 ); ?&gt;</code></p>OR
91
+ <p><code>&lt;?php echo get_masterslider ( 1 ); ?&gt;</code></p><br />
92
+
93
+ <p><strong>Note</strong>: If you are developer, take a look at our <a href="http://masterslider.com/doc/wp/developer/" target="_blank">developer documentation</a> too.</p>
94
+ <hr>
95
+
96
+ <p>
97
+ It is important when you want to insert a slider to check its ID on the MasterSlider WP slider list page. When you remove some sliders, their IDs won't be re-indexed and the sequence may broke up. This is important to keep persistent your sliders preventing unwanted changes on the already inserted ones.
98
+ </p>
99
+ </div>
100
+ </div>
101
+
102
+ <?php
103
+ }
104
+
105
+ public function display_support(){
106
+ ?>
107
+ <h3><strong>Support</strong></h3>
108
+ <hr>
109
+
110
+ <h4>If you have any questions please follow these steps:</h4>
111
+ <ul>
112
+ <li>1 - Please read item's <a href="http://masterslider.com/doc/wp" target="_blank">Documentation </a> </li>
113
+ <li>2 - Take a look in our <a href="http://support.averta.net/envato/faq/" target="_blank">FAQ</a> page</li>
114
+ <li>3 - Take a look in our <a href="http://support.averta.net/envato/knowledgebase/" target="_blank">Knowledge base</a></li>
115
+ <li>4 - Take a look in <a href="http://support.averta.net/envato/videos/" target="_blank">Video Tutorials</a> page</li>
116
+ <li>5 - Still have questions(s)? <a href="http://support.averta.net/envato/wp-login.php?action=register" target="_blank" rel="nofollow">Create an Account</a> in <a href="http://support.averta.net/envato/support/" rel="nofollow">Support Forums</a> (<a href="http://i44.tinypic.com/311rr4h.jpg" rel="nofollow">Find your “Item Purchase Code”</a>)</li>
117
+ <li>6 - Use search field at the top of support forum for similar topics</li>
118
+ <li>7 - If you still didn't find your answers please post your question(s) in the item’s <a href="http://support.averta.net/envato/support/" target="_blank">support forum</a>
119
+ Our support staff are there to help you as soon as possible.</li>
120
+ </ul>
121
+ <br>
122
+
123
+
124
+ <strong>Why support forum?</strong>
125
+ <ul>
126
+ <li>You can upload images and insert code with code-highlighting.</li>
127
+ <li>It is organized and searchable (that makes support easier and faster)</li>
128
+ </ul>
129
+ <br>
130
+
131
+ <strong>Supporting our Items INCLUDES</strong>:
132
+ <ul>
133
+ <li>Responding to questions or problems regarding our item and its features</li>
134
+ <li>Fixing bugs and reported issues</li>
135
+ <li>Providing updates to ensure compatibility with new software versions</li>
136
+ </ul>
137
+ <br>
138
+
139
+ <strong>Item support does NOT include</strong>:
140
+ <ul>
141
+ <li>Customization and installation services</li>
142
+ <li>Support for third party software and plug-ins</li>
143
+ </ul>
144
+ <br>
145
+
146
+ <p><span class="label label-info">Important Note</span> We <strong>CAN NOT</strong> provide support via email.
147
+ Please ask your support related questions only in our <a href="http://support.averta.net/envato/support/" target="_blank">support forum</a>.
148
+ </p>
149
+
150
+ <br>
151
+ <p><span class="label label-info">Important Note</span> For the fast troubleshooting, please send us detailed informations about the issue and make sure that you don't forget to send us your site url where you are using or want to use the item. Please note, that we cannot troubleshoot from screencast videos or screenshots.</p>
152
+ <?php
153
+ }
154
+
155
+
156
+ }
157
+
158
+ endif;
159
+
160
+ new MSP_Screen_Help();
admin/includes/classes/class-msp-shortcode-factory.php ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ */
6
+ class MSP_Shortcode_Factory {
7
+
8
+ public $parsed_slider_data = array();
9
+ private $post_id;
10
+ private $post_slider_args = array();
11
+
12
+ function __construct() {
13
+
14
+ }
15
+
16
+ public function set_data( $parsed_data ) {
17
+
18
+ $this->parsed_slider_data = $parsed_data;
19
+ }
20
+
21
+ /**
22
+ * Get generated ms_slider shortcode
23
+ *
24
+ * @return string [ms_slider] shortcode or empty string on error
25
+ */
26
+ public function get_ms_slider_shortcode( $the_content = '' ){
27
+
28
+ if( ! isset( $this->parsed_slider_data['setting'] ) )
29
+ return '';
30
+
31
+ $shortcode_name = 'ms_slider';
32
+
33
+ // get the parsed slider setting
34
+ $setting = $this->parsed_slider_data['setting'];
35
+
36
+ // create ms_slider shortcode
37
+ $attrs = '';
38
+ foreach ( $setting as $attr => $attr_value ) {
39
+ $attrs .= sprintf( '%s="%s" ', $attr, esc_attr( $attr_value ) );
40
+ }
41
+
42
+ // get ms_slides shortcodes(s)
43
+ $the_content = $this->get_ms_slides_shortcode();
44
+
45
+ return sprintf( '[%1$s %2$s]%3$s%4$s[/%1$s]', $shortcode_name, $attrs, "\n", $the_content );
46
+ }
47
+
48
+
49
+
50
+ public function get_ms_slide_shortcode( $slide ){
51
+
52
+ if( ! isset( $slide ) || empty( $slide ) )
53
+ return '';
54
+
55
+ $shortcode_name = 'ms_slide';
56
+
57
+ // stores shortcode attributes
58
+ $attrs = '';
59
+
60
+ foreach ( $slide as $attr => $attr_value ) {
61
+ if( 'layers' == $attr || 'layer_ids' == $attr || 'ishide' == $attr )
62
+ continue;
63
+
64
+ if( 'src' == $attr && in_array( $this->parsed_slider_data['setting']['slider_type'], array( "flickr", "facebook", "instagram" ) ) ) {
65
+ $attrs .= sprintf( '%s="%s" ', $attr, '{{image}}' );
66
+
67
+ } elseif( 'alt' == $attr && in_array( $this->parsed_slider_data['setting']['slider_type'], array( "flickr", "facebook", "instagram" ) ) ) {
68
+ $attrs .= sprintf( '%s="%s" ', $attr, '{{title}}' );
69
+
70
+ } elseif( 'title' == $attr && in_array( $this->parsed_slider_data['setting']['slider_type'], array( "flickr", "facebook", "instagram" ) ) ) {
71
+ $attrs .= sprintf( '%s="%s" ', $attr, '{{title}}' );
72
+
73
+ } elseif( 'thumb' == $attr && ! empty( $attr_value ) && in_array( $this->parsed_slider_data['setting']['slider_type'], array( "flickr", "facebook", "instagram" ) ) ) {
74
+ $attrs .= sprintf( '%s="%s" ', $attr, '{{thumb}}' );
75
+
76
+ } else {
77
+ $attrs .= sprintf( '%s="%s" ', $attr, esc_attr( $attr_value ) );
78
+ }
79
+ }
80
+
81
+ if( 'true' == $this->parsed_slider_data['setting']['crop'] ){
82
+ $attrs .= sprintf( '%s="%s" ', 'crop_width' , esc_attr( $this->parsed_slider_data['setting']['width'] ) );
83
+ $attrs .= sprintf( '%s="%s" ', 'crop_height', esc_attr( $this->parsed_slider_data['setting']['height'] ) );
84
+ }
85
+
86
+ // collect all shortcode output
87
+ $the_content = '';
88
+
89
+ // generate slide_info shortcode if slideinfo control is added
90
+ if( 'image-gallery' == $this->parsed_slider_data['setting']['template'] ||
91
+ ( isset( $this->parsed_slider_data['setting']['slideinfo'] ) && 'true' == $this->parsed_slider_data['setting']['slideinfo'] )
92
+ ){
93
+ if( ! empty( $slide['info'] ) )
94
+ $the_content .= $this->get_ms_slide_info_shortcode( $slide['info'] );
95
+ else
96
+ $the_content .= $this->get_ms_slide_info_shortcode( "&nbsp;" );
97
+ }
98
+
99
+ return sprintf( '[%1$s %2$s]%4$s%3$s[/%1$s]%4$s', $shortcode_name, $attrs, $the_content, "\n" );
100
+ }
101
+
102
+
103
+
104
+ public function get_ms_slides_shortcode() {
105
+
106
+ if( ! isset( $this->parsed_slider_data['slides'] ) )
107
+ return '';
108
+
109
+ $slides = $this->parsed_slider_data['slides'];
110
+
111
+ $shortcodes = '';
112
+
113
+ foreach ( $slides as $slide ) {
114
+ if( 'true' != $slide['ishide'] )
115
+ $shortcodes .= $this->get_ms_slide_shortcode( $slide );
116
+ }
117
+
118
+ return $shortcodes;
119
+ }
120
+
121
+
122
+
123
+ public function get_ms_slide_info_shortcode( $the_content = '' ){
124
+
125
+ if( empty( $the_content ) )
126
+ return '';
127
+
128
+ return sprintf( '[%1$s]%2$s[/%1$s]', 'ms_slide_info', $the_content )."\n";
129
+ }
130
+
131
+
132
+ public function do_template_tag( $matches ){
133
+ if( ! isset( $matches['0'] ) )
134
+ return $matches;
135
+
136
+ $tag_name = preg_replace('/[{}]/', '', $matches['0'] );
137
+ $tag_name = msp_get_template_tag_value( $tag_name, $this->post_id, $this->post_slider_args );
138
+
139
+ return is_array( $tag_name ) ? implode( ',', $tag_name ) : $tag_name;
140
+ }
141
+
142
+ }
admin/includes/classes/msp-admin-templates.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function msp_get_panel_header(){
4
+ ?>
5
+ <div id="msp-header">
6
+ <div class="msp-logo">
7
+ <a href="<?php echo admin_url( 'admin.php?page='.MSWP_SLUG ); ?>">
8
+ <img src="<?php echo MSWP_AVERTA_ADMIN_URL; ?>/views/slider-panel/images/masterslider.gif">
9
+ </a>
10
+ </div>
11
+ </div>
12
+ <?php
13
+ }
admin/includes/index.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php // load admin related classes & functions
2
+
3
+ // load admin related functions
4
+ include_once( 'msp-admin-functions.php' );
5
+ include_once( 'msp-admin-templates.php' );
6
+ include_once( 'msp-sample-sliders.php' );
7
+
8
+ // load admin related classes
9
+ include_once( 'classes/class-axiom-list-table.php' );
10
+ include_once( 'classes/class-msp-list-table.php' );
11
+ include_once( 'classes/class-axiom-screen-help.php' );
12
+ include_once( 'classes/class-msp-screen-help.php' );
13
+ include_once( 'classes/class-msp-admin-assets.php' );
14
+ // include_once( 'classes/class-msp-pointers.php' );
15
+ include_once( 'classes/class-msp-importer.php' );
16
+
17
+
18
+ if( isset( $_REQUEST['action'] ) && 'preview' == $_REQUEST['action'] ) {
19
+ $frontend_assets = include_once( MSWP_AVERTA_PUB_DIR.'/includes/class-msp-frontend-assets.php' );
20
+ $frontend_assets->admin_hooks();
21
+ }
22
+
23
+ do_action( 'masterslider_admin_classes_loaded' );
24
+
25
+ // load admin related functions
26
+ include_once( 'msp-compatibility.php' );
27
+ include_once( 'msp-hooks.php' );
admin/includes/msp-admin-functions.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php // admin related functions
2
+
3
+
4
+ /**
5
+ * Get all master slider admin screen ids
6
+ *
7
+ * @return array
8
+ */
9
+ function msp_get_screen_ids() {
10
+ $the_screen_id = sanitize_title( MSWP_SLUG );
11
+
12
+ return apply_filters( 'masterslider_admin_screen_ids', array(
13
+ 'toplevel_page_' . $the_screen_id
14
+ ) );
15
+ }
16
+
17
+
18
+
19
+
20
+ function msp_get_sliders_custom_css( $slider_status = 'published' ) {
21
+ global $mspdb;
22
+ $slider_status = sprintf( "status='%s'", $slider_status );
23
+ $sliders_result = $mspdb->get_sliders( 0, 0, 'ID', 'DESC', $slider_status );
24
+
25
+ $sliders_custom_css = array();
26
+
27
+ if( $sliders_result ) {
28
+ foreach ( $sliders_result as $slider ) {
29
+ $sliders_custom_css[] = $slider['custom_styles'];
30
+ $sliders_custom_css[] = msp_get_slider_background_css( $slider['ID'] );
31
+ }
32
+ // remove empty records from array
33
+ $sliders_custom_css = array_filter( $sliders_custom_css );
34
+ }
35
+
36
+ return apply_filters( 'masterslider_get_sliders_custom_css', implode( "\n", $sliders_custom_css ), $sliders_custom_css, $sliders_result );
37
+ }
38
+
39
+
40
+ // get stored slider's custom css code from database
41
+ function msp_get_slider_custom_css( $slider_id ) {
42
+ global $mspdb;
43
+ $slider_custom_css = $mspdb->get_slider_field_val( $slider_id, 'custom_styles' );
44
+ return $slider_custom_css ? $slider_custom_css : '';
45
+ }
46
+
47
+
48
+ function msp_get_slider_background_css( $slider_id ) {
49
+ $slider_data = get_masterslider_parsed_data( $slider_id );
50
+
51
+ $the_slider_bg = empty( $slider_data['setting']['bg_color'] ) ? '' : $slider_data['setting']['bg_color'];
52
+ $the_slider_bg .= empty( $slider_data['setting']['bg_image'] ) ? '' : sprintf( ' url( %s ) repeat top left', msp_get_the_absolute_media_url( $slider_data['setting']['bg_image'] ) );
53
+ $the_slider_bg = empty( $the_slider_bg ) ? '' : 'background:' . $the_slider_bg . ";";
54
+
55
+ return empty( $the_slider_bg ) ? '' : sprintf( ".ms-parent-id-%d > .master-slider{ %s }", $slider_id, $the_slider_bg );
56
+ }
57
+
58
+
59
+ function msp_get_all_custom_css () {
60
+ return apply_filters( 'masterslider_get_all_custom_css', msp_get_sliders_custom_css() );
61
+ }
62
+
63
+
64
+ /*-----------------------------------------------------------------------------------*/
65
+
66
+ /**
67
+ * Get custom styles and store them in custom.css file or use inline css fallback
68
+ * This function will be called by masterslider save handler
69
+ *
70
+ * @return void
71
+ */
72
+ function msp_save_custom_styles() {
73
+
74
+ $css_file = MSWP_AVERTA_DIR . '/assets/custom.css';
75
+
76
+ $css_terms = "/*
77
+ ===============================================================
78
+ #CUSTOM CSS
79
+ - Please do not edit this file. this file is generated from admin area.
80
+ - Every changes here will be overwritten
81
+ ===============================================================*/\n
82
+ ";
83
+ // Get all custom css styles
84
+ $css = msp_get_all_custom_css();
85
+
86
+ // write to custom.css file
87
+ require_once( ABSPATH . 'wp-admin/includes/file.php' );
88
+ WP_Filesystem();
89
+ global $wp_filesystem;
90
+
91
+ if ( ! $wp_filesystem->put_contents( $css_file, $css_terms.$css, 0644 ) ) {
92
+ // if the directory is not writable, try inline css fallback
93
+ msp_update_option( 'custom_inline_style' , $css ); // save css rules as option to print as inline css
94
+ }else {
95
+ $custom_css_ver = get_option( 'masterslider_custom_css_ver', '1.0' );
96
+ $custom_css_ver = (float)$custom_css_ver + 0.1;
97
+ msp_update_option( 'masterslider_custom_css_ver' , $custom_css_ver ); // disable inline css output
98
+ msp_update_option( 'custom_inline_style' , '' );
99
+ }
100
+
101
+ }
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+ /**
115
+ * Prints Pretty human-readable information about a variable (developer debug tool)
116
+ * @param mixed The expression to be printed.
117
+ * @param boolean $dump Whether to dump information about a variable or not
118
+ * @param boolean $return When this parameter is set to TRUE, it will return the information rather than print it.
119
+ * @return bool When the return parameter is TRUE, this function will return a string. Otherwise, the return value is TRUE.
120
+ */
121
+ if ( ! function_exists( 'axpp' ) ) {
122
+
123
+ function axpp ( $expression, $dump = false, $return = false ) {
124
+ if ( $return ) {
125
+ return '<pre>' . print_r( $expression , true ) . '</pre>';
126
+ } elseif ( $dump ) {
127
+ echo '<pre>'; var_dump( $expression ); echo '</pre>';
128
+ } else {
129
+ echo '<pre>'; print_r ( $expression ); echo '</pre>';
130
+ }
131
+ return true;
132
+ }
133
+
134
+ }
admin/includes/msp-admin-templates.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function msp_get_panel_header(){
4
+ ?>
5
+ <div id="msp-header">
6
+ <div class="msp-logo">
7
+ <a href="<?php echo admin_url( 'admin.php?page='.MSWP_SLUG ); ?>">
8
+ <img src="<?php echo MSWP_AVERTA_ADMIN_URL; ?>/views/slider-panel/images/masterslider.gif">
9
+ </a>
10
+ </div>
11
+ </div>
12
+ <?php
13
+ }
admin/includes/msp-compatibility.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*----------------------------------------------------------------------------*
4
+ * Members Plugin
5
+ *----------------------------------------------------------------------------*/
6
+
7
+ add_action( 'plugins_loaded', 'msp_on_all_plugins_loaded' );
8
+
9
+ function msp_on_all_plugins_loaded() {
10
+ // Add master slider custom capabilities to members plugin if it's installed
11
+ if ( function_exists( 'members_get_capabilities' ) )
12
+ add_filter( 'members_get_capabilities', 'msp_add_custom_cap_to_members_plugin' );
13
+ }
14
+
15
+
16
+ /**
17
+ * Add master slider custom capabilities to Members plugin if it's installed
18
+ *
19
+ * @since 1.0.0
20
+ */
21
+ function msp_add_custom_cap_to_members_plugin( $caps ) {
22
+ $caps[] = 'access_masterslider' ;
23
+ $caps[] = 'publish_masterslider';
24
+ $caps[] = 'delete_masterslider' ;
25
+ $caps[] = 'create_masterslider' ;
26
+ $caps[] = 'export_masterslider' ;
27
+ $caps[] = 'duplicate_masterslider' ;
28
+ return $caps;
29
+ }
30
+
31
+ /*----------------------------------------------------------------------------*/
admin/includes/msp-hooks.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php
admin/includes/msp-sample-sliders.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function msp_get_slider_starter_sections () {
4
+
5
+ $sections = array(
6
+ array(
7
+ 'id' => 'main_types',
8
+ 'title' => __( 'Slider Types', MSWP_TEXT_DOMAIN ),
9
+ 'desc' => ''
10
+ ),
11
+ array(
12
+ 'id' => 'masterslider_samples_group1',
13
+ 'title' => __( 'Sample Sliders', MSWP_TEXT_DOMAIN ),
14
+ 'desc' => ''
15
+ )
16
+ );
17
+
18
+ return apply_filters( 'masterslider_starter_sections', $sections );
19
+ }
20
+
21
+
22
+ function msp_get_slider_starter_fields () {
23
+
24
+ $starters = array();
25
+
26
+ $starters['main_types'] = array(
27
+
28
+ array(
29
+ 'label' => __( 'Custom Slider', MSWP_TEXT_DOMAIN ),
30
+ 'id' => 'custom-slider',
31
+ 'slidertype'=> 'custom',
32
+ 'importdata'=> '',
33
+ 'image_dir' => '',
34
+ 'selected' => 'true',
35
+ 'screenshot'=> MSWP_AVERTA_ADMIN_URL . '/assets/images/slider-types/pt_custom.png'
36
+ )
37
+
38
+ );
39
+
40
+ $starters['masterslider_samples_group1'] = array(
41
+
42
+ array(
43
+ 'label' => __( 'Slider with Horizontal Thumbnails', MSWP_TEXT_DOMAIN ),
44
+ 'id' => 'slider-with-thumbs-1',
45
+ 'slidertype'=> 'custom',
46
+ 'importdata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3RoZW1lc1wvbG90dXNcL2R1bW15LWFnZW5jeVwvd3AtY29udGVudFwvdXBsb2FkcyJ9',
47
+ 'image_dir' => '',
48
+ 'selected' => '',
49
+ 'screenshot'=> MSWP_AVERTA_ADMIN_URL . '/assets/images/starters/slider-with-horizontal-thumbs.jpg'
50
+ ),
51
+ array(
52
+ 'label' => __( 'Slider Without Thumbnails', MSWP_TEXT_DOMAIN ),
53
+ 'id' => 'slider-without-thumbs-1',
54
+ 'slidertype'=> 'custom',
55
+ 'importdata'=> 'eyJzbGlkZXJzX2RhdGEiOnsiNTMiOnsidGl0bGUiOiJTbGlkZXIgV2l0aG91dCBUaHVtYm5haWxzIiwicGFyYW1zIjoiZXlKdFpYUmhJanA3SWxObGRIUnBibWR6SVdsa2N5STZJakVpTENKVFpYUjBhVzVuY3lGdVpYaDBTV1FpT2pJc0lsTnNhV1JsSVdsa2N5STZJakVzTWl3ekxEUXNOU3cyTERjc09Td3hNaXd4TkNJc0lsTnNhV1JsSVc1bGVIUkpaQ0k2TVRVc0lrTnZiblJ5YjJ3aGFXUnpJam9pTVNJc0lrTnZiblJ5YjJ3aGJtVjRkRWxrSWpvMGZTd2lUVk5RWVc1bGJDNVRaWFIwYVc1bmN5STZleUl4SWpvaWUxd2lhV1JjSWpwY0lqRmNJaXhjSW5OdVlYQndhVzVuWENJNmRISjFaU3hjSW01aGJXVmNJanBjSWxOc2FXUmxjaUJYYVhSb2IzVjBJRlJvZFcxaWJtRnBiSE5jSWl4Y0luZHBaSFJvWENJNk9EQXdMRndpYUdWcFoyaDBYQ0k2TkRnd0xGd2lkM0poY0hCbGNsZHBaSFJvWENJNk9EQXdMRndpZDNKaGNIQmxjbGRwWkhSb1ZXNXBkRndpT2x3aWNIaGNJaXhjSW1GMWRHOURjbTl3WENJNlptRnNjMlVzWENKMGVYQmxYQ0k2WENKamRYTjBiMjFjSWl4Y0luTnNhV1JsY2tsa1hDSTZYQ0kxTTF3aUxGd2liR0Y1YjNWMFhDSTZYQ0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mtkWEpoZEdsdmJsd2lPak1zWENKbWFXeHNUVzlrWlZ3aU9sd2labWxzYkZ3aUxGd2lZbWQyWDJacGJHeHRiMlJsWENJNlhDSm1hV3hzWENJc1hDSmlaM1pmYkc5dmNGd2lPblJ5ZFdVc1hDSmlaM1pmYlhWMFpWd2lPblJ5ZFdVc1hDSmlaM1pmWVhWMGIzQmhkWE5sWENJNlptRnNjMlVzWENKc1lYbGxjbDlwWkhOY0lqcGJYWDBpZlN3aVRWTlFZVzVsYkM1RGIyNTBjbTlzSWpwN0lqRWlPaUo3WENKcFpGd2lPbHdpTVZ3aUxGd2liR0ZpWld4Y0lqcGNJa0Z5Y205M2Mxd2lMRndpYm1GdFpWd2lPbHdpWVhKeWIzZHpYQ0lzWENKaGRYUnZTR2xrWlZ3aU9tWmhiSE5sTEZ3aWIzWmxjbFpwWkdWdlhDSTZkSEoxWlN4Y0ltbHVjMlYwWENJNmRISjFaWDBpZlgwPSIsInR5cGUiOiJjdXN0b20iLCJzbGlkZXNfbnVtIjoiMTAifX0sIm9yaWdpbl91cGxvYWRzX3VybCI6Imh0dHA6XC9cL2RlbW8uYXZlcnRhLm5ldFwvdGhlbWVzXC9sb3R1c1wvZHVtbXktYWdlbmN5XC93cC1jb250ZW50XC91cGxvYWRzIn0=',
56
+ 'image_dir' => '',
57
+ 'selected' => '',
58
+ 'screenshot'=> MSWP_AVERTA_ADMIN_URL . '/assets/images/starters/simple-slider.jpg'
59
+ ),
60
+ array(
61
+ 'label' => __( 'Slider with Vertical Thumbnails', MSWP_TEXT_DOMAIN ),
62
+ 'id' => 'slider-with-thumbs-2',
63
+ 'slidertype'=> 'custom',
64
+ 'importdata'=> 'eyJzbGlkZXJzX2RhdGEiOnsiNTQiOnsidGl0bGUiOiJTbGlkZXIgd2l0aCBWZXJ0aWNhbCBUaHVtYm5haWxzIiwicGFyYW1zIjoiZXlKdFpYUmhJanA3SWxObGRIUnBibWR6SVdsa2N5STZJakVpTENKVFpYUjBhVzVuY3lGdV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9yaWdpbl91cGxvYWRzX3VybCI6Imh0dHA6XC9cL2RlbW8uYXZlcnRhLm5ldFwvdGhlbWVzXC9sb3R1c1wvZHVtbXktYWdlbmN5XC93cC1jb250ZW50XC91cGxvYWRzIn0=',
74
+ 'image_dir' => '',
75
+ 'selected' => '',
76
+ 'screenshot'=> MSWP_AVERTA_ADMIN_URL . '/assets/images/starters/fullwidth-slider.jpg'
77
+ ),
78
+ array(
79
+ 'label' => __( 'Simple Autoplay Slider', MSWP_TEXT_DOMAIN ),
80
+ 'id' => 'slider-autoplay-1',
81
+ 'slidertype'=> 'custom',
82
+ 'importdata'=> 'eyJzbGlkZXJzX2RhdGEiOnsiNTYiOnsidGl0bGUiOiJTaW1wbGUgQXV0b3BsYXkgU2xpZGVyIiwicGFyYW1zIjoiZXlKdFpYUmhJanA3SWxObGRIUnBibWR6SVdsa2N5STZJakVpTENKVFpYUjBhVzVuY3lGdVpYaDBTV1FpT2pJc0lsTnNhV1JsSVdsa2N5STZJakVzTWl3ekxEUXNOU3cyTERjc09Td3hNaXd4TkNJc0lsTnNhV1JsSVc1bGVIUkpaQ0k2TVRVc0lrTnZiblJ5YjJ3aGFXUnpJam9pTVN3MExEVXNOaUlzSWtOdmJuUnliMndoYm1WNGRFbGtJam8zZlN3aVRWTlFZVzVsYkM1VFpYUjBhVzVuY3lJNmV5SXhJam9pZTF3aWFXUmNJanBjSWpGY0lpeGNJbk51WVhCd2FXNW5YQ0k2ZEhKMVpTeGNJbTVoYldWY0lqcGNJbE5wYlhCc1pTQkJkWFJ2Y0d4aGVTQlRiR2xrWlhKY0lpeGNJbmRwWkhSb1hDSTZPREF3TEZ3aWFHVnBaMmgwWENJNk5EZ3dMRndpZDNKaGNIQmxjbGRwWkhSb1hDSTZPREF3TEZ3aWQzSmhjSEJsY2xkcFpIUm9WVzVwZEZ3aU9sd2ljSGhjSWl4Y0ltRjFkRzlEY205d1hDSTZabUZzYzJVc1hDSjBlWEJsWENJNlhDSmpkWE4wYjIxY0l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bG5ibHdpT2x3aVltOTBkRzl0WENJc1hDSnBibk5sZEZ3aU9uUnlkV1Y5SWl3aU5pSTZJbnRjSW1sa1hDSTZOaXhjSW14aFltVnNYQ0k2WENKQ2RXeHNaWFJ6WENJc1hDSnVZVzFsWENJNlhDSmlkV3hzWlhSelhDSXNYQ0poZFhSdlNHbGtaVndpT25SeWRXVXNYQ0p2ZG1WeVZtbGtaVzljSWpwMGNuVmxMRndpYldGeVoybHVYQ0k2TVRBc1hDSmthWEpjSWpwY0ltaGNJaXhjSW1Gc2FXZHVYQ0k2WENKaWIzUjBiMjFjSWl4Y0ltbHVjMlYwWENJNmRISjFaWDBpZlgwPSIsInR5cGUiOiJjdXN0b20iLCJzbGlkZXNfbnVtIjoiMTAifX0sIm9yaWdpbl91cGxvYWRzX3VybCI6Imh0dHA6XC9cL2RlbW8uYXZlcnRhLm5ldFwvdGhlbWVzXC9sb3R1c1wvZHVtbXktYWdlbmN5XC93cC1jb250ZW50XC91cGxvYWRzIn0=',
83
+ 'image_dir' => '',
84
+ 'selected' => '',
85
+ 'screenshot'=> MSWP_AVERTA_ADMIN_URL . '/assets/images/starters/autoplay-slider.jpg'
86
+ ),
87
+ array(
88
+ 'label' => __( 'Fullwidth Slider with Thumbnails', MSWP_TEXT_DOMAIN ),
89
+ 'id' => 'fullwith-with-thumbs-1',
90
+ 'slidertype'=> 'custom',
91
+ 'importdata'=> 'eyJzbGlkZXJzX2RhdGEiOnsiNTciOnsidGl0bGUiOiJGdWxsd2lkdGggU2xpZGVyIHdpdGggVGh1bWJuYWlscyIsInBhcmFtcyI6ImV5SnRaWFJoSWpwN0lsTmxkSFJwYm1keklXbGtjeUk2SWpFaUxDSlRaWFIwYVc1bmN5RnVaWGgwU1dRaU9qSXNJbE5zYVdSbElXbGtjeUk2SWpFc01pd3pMRFFzTlN3MkxEY3NPU3d4TWl3eE5DSXNJbE5zYVdSbElXNWxlSFJKWkNJNk1UVXNJa052Ym5SeWIyd2hhV1J6SWpvaU1Td3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1wvZGVtby5hdmVydGEubmV0XC90aGVtZXNcL2xvdHVzXC9kdW1teS1hZ2VuY3lcL3dwLWNvbnRlbnRcL3VwbG9hZHMifQ==',
92
+ 'image_dir' => '',
93
+ 'selected' => '',
94
+ 'screenshot'=> MSWP_AVERTA_ADMIN_URL . '/assets/images/starters/fullwidth-slider-with-thumbs.jpg'
95
+ ),
96
+ array(
97
+ 'label' => __( 'Slider with Slide Info', MSWP_TEXT_DOMAIN ),
98
+ 'id' => 'slider-with-slideinfo-1',
99
+ 'slidertype'=> 'custom',
100
+ 'importdata'=> 'eyJzbGlkZXJzX2RhdGEiOnsiNTgiOnsidGl0bGUiOiJTaW1wbGUgU2xpZGVyIHdpdGggU2xpZGUgSW5mbyIsInBhcmFtcyI6ImV5SnRaWFJoSWpwN0lsTmxkSFJwYm1keklXbGtjeUk2SWpFaUxDSlRaWFIwYVc1bmN5RnVaWGgwU1dRaU9qSXNJbE5zYVdSbElXbGtjeUk2SWpFc01pd3pMRFFzTlN3MkxEY3NPU3d4TWl3eE5DSXNJbE5zYVdSbElXNWxlSFJKWkNJNk1UVXNJa052Ym5SeWIyd2hhV1J6SWpvaU1TdzBJaXdpUTI5dWRISnZiQ0Z1WlhoMFNXUWlPalY5TENKTlUxQmhibVZzTGxObGRIUnBibWR6SWpwN0lqRWlPaUo3WENKcFpGd2lPbHdpTVZ3aUxGd2ljMjVoY0hCcGJtZGNJanAwY25WbExGd2libUZ0WlZ3aU9sd2lVMmx0Y0d4bElGTnNhV1JsY2lCM2FYUm9JRk5zYVdSbElFbHVabTljSWl4Y0luZHBaSFJvWENJNk9EQXdMRndpYUdWcFoyaDBYQ0k2TkRnd0xGd2lkM0poY0hCbGNsZHBaSFJvWENJNk9EQXdMRndpZDNKaGNIQmxjbGRwWkhSb1ZXNXBkRndpT2x3aWNIaGNJaXhjSW1GMWRHOURjbTl3WENJNlptRnNjMlVzWENKMGVYQmxYQ0k2WENKamRYTjBiMjFjSWl4Y0luTnNhV1JsY2tsa1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WJtRnRaVndpT2x3aVlYSnliM2R6WENJc1hDSmhkWFJ2U0dsa1pWd2lPbVpoYkhObExGd2liM1psY2xacFpHVnZYQ0k2ZEhKMVpTeGNJbWx1YzJWMFhDSTZkSEoxWlgwaUxDSTBJam9pZTF3aWFXUmNJam8wTEZ3aWJHRmlaV3hjSWpwY0lsTnNhV1JsSUVsdVptOWNJaXhjSW01aGJXVmNJanBjSW5Oc2FXUmxhVzVtYjF3aUxGd2lZWFYwYjBocFpHVmNJanBtWVd4elpTeGNJbTkyWlhKV2FXUmxiMXdpT25SeWRXVXNYQ0p0WVhKbmFXNWNJam94TUN4Y0ltRnNhV2R1WENJNlhDSmliM1IwYjIxY0lpeGNJbWx1YzJWMFhDSTZabUZzYzJWOUluMTkiLCJ0eXBlIjoiY3VzdG9tIiwic2xpZGVzX251bSI6IjEwIn19LCJvcmlnaW5fdXBsb2Fkc191cmwiOiJodHRwOlwvXC9kZW1vLmF2ZXJ0YS5uZXRcL3RoZW1lc1wvbG90dXNcL2R1bW15LWFnZW5jeVwvd3AtY29udGVudFwvdXBsb2FkcyJ9',
101
+ 'image_dir' => '',
102
+ 'selected' => '',
103
+ 'screenshot'=> MSWP_AVERTA_ADMIN_URL . '/assets/images/starters/slider-with-slide-info.jpg'
104
+ ),
105
+ array(
106
+ 'label' => __( 'Slider with Slide Info V2', MSWP_TEXT_DOMAIN ),
107
+ 'id' => 'slider-with-slideinfo-2',
108
+ 'slidertype'=> 'custom',
109
+ 'importdata'=> 'eyJzbGlkZXJzX2RhdGEiOnsiNTkiOnsidGl0bGUiOiJTaW1wbGUgU2xpZGVyIHdpdGggU2xpZGUgSW5mbyBWMiIsInBhcmFtcyI6ImV5SnRaWFJoSWpwN0lsTmxkSFJwYm1keklXbGtjeUk2SWpFaUxDSlRaWFIwYVc1bmN5RnVaWGgwU1dRaU9qSXNJbE5zYVdSbElXbGtjeUk2SWpFc01pd3pMRFFzTlN3MkxEY3NPU3d4TWl3eE5DSXNJbE5zYVdSbElX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0lqcGNJaU16UkRORU0wUmNJaXhjSW5kcFpIUm9YQ0k2TkN4Y0ltRnNhV2R1WENJNlhDSjBiM0JjSWl4Y0ltbHVjMlYwWENJNmRISjFaWDBpTENJMklqb2llMXdpYVdSY0lqbzJMRndpYkdGaVpXeGNJanBjSWtKMWJHeGxkSE5jSWl4Y0ltNWhiV1ZjSWpwY0ltSjFiR3hsZEhOY0lpeGNJbUYxZEc5SWFXUmxYQ0k2ZEhKMVpTeGNJbTkyWlhKV2FXUmxiMXdpT25SeWRXVXNYQ0p0WVhKbmFXNWNJam94TUN4Y0ltUnBjbHdpT2x3aWFGd2lMRndpWVd4cFoyNWNJanBjSW1KdmRIUnZiVndpTEZ3aWFXNXpaWFJjSWpwMGNuVmxmU0o5ZlE9PSIsInR5cGUiOiJjdXN0b20iLCJzbGlkZXNfbnVtIjoiMTAifX0sIm9yaWdpbl91cGxvYWRzX3VybCI6Imh0dHA6XC9cL2RlbW8uYXZlcnRhLm5ldFwvdGhlbWVzXC9sb3R1c1wvZHVtbXktYWdlbmN5XC93cC1jb250ZW50XC91cGxvYWRzIn0=',
110
+ 'image_dir' => '',
111
+ 'selected' => '',
112
+ 'screenshot'=> MSWP_AVERTA_ADMIN_URL . '/assets/images/starters/slider-with-slide-info-v2.jpg'
113
+ )
114
+ );
115
+
116
+
117
+ return apply_filters( 'masterslider_starter_fields', $starters );
118
+ }
119
+
120
+
121
+
122
+ function msp_get_slider_starter_field( $field_id ){
123
+ $fields_in_sections = msp_get_slider_starter_fields();
124
+
125
+ foreach ( $fields_in_sections as $fields_in_section ) {
126
+ foreach ($fields_in_section as $the_field ) {
127
+ if ( isset( $the_field['id'] ) && $the_field['id'] == $field_id ){
128
+ return $the_field;
129
+ }
130
+ }
131
+ }
132
+
133
+ return null;
134
+ }
admin/views/index.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Represents the main wrapper for master slider admin page.
4
+ *
5
+ * @package MasterSlider
6
+ * @author averta [averta.net]
7
+ * @license LICENSE.txt
8
+ * @link http://masterslider.com
9
+ * @copyright Copyright © 2014 averta
10
+ */
11
+
12
+ $msp_nonce = wp_create_nonce( 'msp_panel' );
13
+ $action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
14
+ $slider_id = isset( $_REQUEST['slider_id'] ) ? $_REQUEST['slider_id'] : '';
15
+ $do = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
16
+
17
+
18
+ function msp_thankyou_footer() {
19
+ $text = sprintf( __( 'Thank you for creating with <a href="%s">WordPress</a>.' ), __( 'https://wordpress.org/' ) );
20
+ $text .= sprintf( __(' and using <a href="%s">Master Slider</a> %s', MSWP_TEXT_DOMAIN ), 'https://wordpress.org/plugins/master-slider/', MSWP_AVERTA_VERSION );
21
+
22
+ return '<span id="footer-thankyou">' . $text . '</span>';
23
+ }
24
+ add_filter( 'admin_footer_text', 'msp_thankyou_footer' );
25
+
26
+
27
+ ?>
28
+
29
+ <div id="msp-main-wrapper" class="wrap" data-nonce="<?php echo $msp_nonce; ?>" >
30
+
31
+ <?php
32
+
33
+ // process slider data and generate required thumbnails for slider panel
34
+ // if( ! empty( $slider_id ) && isset( $_REQUEST['fr'] ) )
35
+ // msp_get_ms_slider_shortcode_by_slider_id( $slider_id );
36
+
37
+ // If the requested page is edit page
38
+ if( in_array( $action, array( 'add', 'edit' ) ) ){
39
+
40
+ include( 'slider-panel/index.php' );
41
+
42
+ // If the requested page is preview page
43
+ } elseif( 'preview' == $action ) {
44
+
45
+ include( 'slider-dashboard/preview.php' );
46
+
47
+ // Otherwise display sliders list
48
+ } else {
49
+
50
+ include( 'slider-dashboard/list-sliders.php' );
51
+
52
+ }
53
+
54
+ ?>
55
+
56
+ </div>
admin/views/setting/class-msp-settings.php ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! class_exists('WeDevs_Settings_API' ) )
4
+ require_once ( 'class-settings-api.php' );
5
+
6
+ /**
7
+ * MasterSlider Setting page
8
+ *
9
+ * @author Tareq Hasan
10
+ */
11
+ if ( !class_exists('MSP_Settings' ) ):
12
+
13
+ class MSP_Settings {
14
+
15
+ private $settings_api;
16
+
17
+ function __construct() {
18
+
19
+ $this->settings_api = new WeDevs_Settings_API;
20
+
21
+ add_action( 'admin_init', array( $this, 'admin_init' ) );
22
+ add_action( 'admin_menu', array( $this, 'admin_menu' ), 11 );
23
+ add_action( 'admin_action_msp_envato_license', array( $this, 'envato_license_updated' ) );
24
+
25
+ add_action( 'admin_footer-master-slider_page_masterslider-setting', array( $this, 'print_setting_script' ) );
26
+ add_filter( 'axiom_wedev_setting_section_submit_button', array( $this, 'section_submit_button' ), 10, 2 );
27
+ }
28
+
29
+
30
+ function admin_init() {
31
+
32
+ //set the settings
33
+ $this->settings_api->set_sections( $this->get_settings_sections() );
34
+ $this->settings_api->set_fields ( $this->get_settings_fields() );
35
+
36
+ //initialize settings
37
+ $this->settings_api->admin_init();
38
+ }
39
+
40
+
41
+ function section_submit_button( $button_markup, $section ){
42
+ if( isset( $section['id'] ) && 'msp_envato_license' == $section['id'] ){
43
+ $is_license_actived = get_option( MSWP_SLUG . '_is_license_actived', 0 );
44
+ return sprintf( '<a id="validate_envato_license" class="button button-primary button-large" data-activate="%1$s" data-isactive="%3$d" data-deactivate="%2$s" data-validation="%4$s" >%1$s</a>%5$s',
45
+ __( 'Activate License', MSWP_TEXT_DOMAIN ), __( 'Deactivate License', MSWP_TEXT_DOMAIN ), (int)$is_license_actived,
46
+ __( 'Validating ..', MSWP_TEXT_DOMAIN ), '<div class="msp-msg-nag">is not actived</div>' );
47
+ }
48
+ return $button_markup;
49
+ }
50
+
51
+
52
+ function admin_menu() {
53
+
54
+ add_submenu_page(
55
+ MSWP_SLUG,
56
+ __( 'Settings' , MSWP_TEXT_DOMAIN ),
57
+ __( 'Settings' , MSWP_TEXT_DOMAIN ),
58
+ apply_filters( 'masterslider_setting_capability', 'manage_options' ),
59
+ MSWP_SLUG . '-setting',
60
+ array( $this, 'render_setting_page' )
61
+ );
62
+ }
63
+
64
+ function get_settings_sections() {
65
+ $sections = array(
66
+
67
+ array(
68
+ 'id' => 'msp_general_setting',
69
+ 'title' => __( 'General Settings', MSWP_TEXT_DOMAIN )
70
+ )
71
+ );
72
+
73
+ return $sections;
74
+ }
75
+
76
+ /**
77
+ * Returns all the settings fields
78
+ *
79
+ * @return array settings fields
80
+ */
81
+ function get_settings_fields() {
82
+
83
+ $settings_fields = array();
84
+
85
+ $settings_fields['msp_general_setting'] = array(
86
+ array(
87
+ 'name' => 'hide_info_table',
88
+ 'label' => __( 'Hide info table', MSWP_TEXT_DOMAIN ),
89
+ 'desc' => __( 'If you want to hide "Latest video tutorials" table on master slider admin panel check this field.', MSWP_TEXT_DOMAIN ),
90
+ 'type' => 'checkbox'
91
+ ),
92
+ array(
93
+ 'name' => '_enable_cache',
94
+ 'label' => __( 'Enable cache?', MSWP_TEXT_DOMAIN ),
95
+ 'desc' => __( 'Enable cache to make Masterslider even more faster!', MSWP_TEXT_DOMAIN ),
96
+ 'type' => 'checkbox'
97
+ ),
98
+ array(
99
+ 'name' => '_cache_period',
100
+ 'label' => __( 'Cache period time', MSWP_TEXT_DOMAIN ),
101
+ 'desc' => __( 'The cache refresh time in hours. Cache is also cleared when you click on "Save Changes" in slider panel.', MSWP_TEXT_DOMAIN ),
102
+ 'type' => 'text',
103
+ 'default' => '12',
104
+ 'sanitize_callback' => 'floatval'
105
+ )
106
+ );
107
+
108
+ return $settings_fields;
109
+ }
110
+
111
+ function render_setting_page() {
112
+ echo '<div class="wrap">';
113
+
114
+ $this->settings_api->show_navigation();
115
+ $this->settings_api->show_forms();
116
+
117
+ echo '</div>';
118
+ }
119
+
120
+ /**
121
+ * Get all the pages
122
+ *
123
+ * @return array page names with key value pairs
124
+ */
125
+ function get_pages() {
126
+ $pages = get_pages();
127
+ $pages_options = array();
128
+ if ( $pages ) {
129
+ foreach ($pages as $page) {
130
+ $pages_options[$page->ID] = $page->post_title;
131
+ }
132
+ }
133
+
134
+ return $pages_options;
135
+ }
136
+
137
+
138
+ /**
139
+ * This code uses localstorage for displaying active tabs
140
+ *
141
+ */
142
+ function print_setting_script() {
143
+ ?>
144
+ <script>
145
+ (function($) {
146
+ $(function() {
147
+
148
+ });
149
+ })(jQuery);
150
+ </script>
151
+
152
+ <style>
153
+ .master-slider_page_masterslider-setting .wrap input[disabled] { background-color:#e0e0e0; }
154
+ .msp-msg-nag {
155
+ display: inline-block;
156
+ line-height: 14px;
157
+ padding: 8px 15px;
158
+ font-size: 14px;
159
+ text-align: left;
160
+ margin: 0 20px;
161
+ background-color: #fff;
162
+ border-left: 4px solid #ffba00;
163
+ -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
164
+ box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
165
+ }
166
+ </style>
167
+ <?php
168
+ }
169
+
170
+ }
171
+
172
+ endif;
173
+
174
+ $settings = new MSP_Settings();
admin/views/setting/class-settings-api.php ADDED
@@ -0,0 +1,522 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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API wrapper class
5
+ *
6
+ * @author Tareq Hasan <tareq@weDevs.com>
7
+ * @link http://tareq.weDevs.com Tareq's Planet
8
+ * @example settings-api.php How to use the class
9
+ */
10
+ if ( !class_exists( 'WeDevs_Settings_API' ) ):
11
+
12
+ class WeDevs_Settings_API {
13
+
14
+ /**
15
+ * settings sections array
16
+ *
17
+ * @var array
18
+ */
19
+ private $settings_sections = array();
20
+
21
+ /**
22
+ * Settings fields array
23
+ *
24
+ * @var array
25
+ */
26
+ private $settings_fields = array();
27
+
28
+ /**
29
+ * Singleton instance
30
+ *
31
+ * @var object
32
+ */
33
+ private static $_instance;
34
+
35
+ public function __construct() {
36
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
37
+ }
38
+
39
+ /**
40
+ * Enqueue scripts and styles
41
+ */
42
+ function admin_enqueue_scripts() {
43
+ wp_enqueue_style( 'wp-color-picker' );
44
+ wp_enqueue_style( 'thickbox' );
45
+
46
+ wp_enqueue_script( 'wp-color-picker' );
47
+ wp_enqueue_script( 'jquery' );
48
+ wp_enqueue_script( 'media-upload' );
49
+ wp_enqueue_script( 'thickbox' );
50
+ }
51
+
52
+ /**
53
+ * Set settings sections
54
+ *
55
+ * @param array $sections setting sections array
56
+ */
57
+ function set_sections( $sections ) {
58
+ $this->settings_sections = $sections;
59
+
60
+ return $this;
61
+ }
62
+
63
+ /**
64
+ * Add a single section
65
+ *
66
+ * @param array $section
67
+ */
68
+ function add_section( $section ) {
69
+ $this->settings_sections[] = $section;
70
+
71
+ return $this;
72
+ }
73
+
74
+ /**
75
+ * Set settings fields
76
+ *
77
+ * @param array $fields settings fields array
78
+ */
79
+ function set_fields( $fields ) {
80
+ $this->settings_fields = $fields;
81
+
82
+ return $this;
83
+ }
84
+
85
+ function add_field( $section, $field ) {
86
+ $defaults = array(
87
+ 'name' => '',
88
+ 'label' => '',
89
+ 'desc' => '',
90
+ 'type' => 'text'
91
+ );
92
+
93
+ $arg = wp_parse_args( $field, $defaults );
94
+ $this->settings_fields[$section][] = $arg;
95
+
96
+ return $this;
97
+ }
98
+
99
+ /**
100
+ * Initialize and registers the settings sections and fileds to WordPress
101
+ *
102
+ * Usually this should be called at `admin_init` hook.
103
+ *
104
+ * This function gets the initiated settings sections and fields. Then
105
+ * registers them to WordPress and ready for use.
106
+ */
107
+ function admin_init() {
108
+ //register settings sections
109
+ foreach ( $this->settings_sections as $section ) {
110
+ if ( false == get_option( $section['id'] ) ) {
111
+ add_option( $section['id'] );
112
+ }
113
+
114
+ if ( isset($section['desc']) && !empty($section['desc']) ) {
115
+ $section['desc'] = '<div class="inside">'.$section['desc'].'</div>';
116
+ $callback = create_function('', 'echo "'.str_replace('"', '\"', $section['desc']).'<br />";');
117
+ } else {
118
+ $callback = '__return_false';
119
+ }
120
+
121
+ add_settings_section( $section['id'], $section['title'], $callback, $section['id'] );
122
+ }
123
+
124
+ //register settings fields
125
+ foreach ( $this->settings_fields as $section => $field ) {
126
+ foreach ( $field as $option ) {
127
+
128
+ $type = isset( $option['type'] ) ? $option['type'] : 'text';
129
+
130
+ $args = array(
131
+ 'id' => $option['name'],
132
+ 'desc' => isset( $option['desc'] ) ? $option['desc'] : '',
133
+ 'name' => $option['label'],
134
+ 'section' => $section,
135
+ 'size' => isset( $option['size'] ) ? $option['size'] : null,
136
+ 'options' => isset( $option['options'] ) ? $option['options'] : '',
137
+ 'std' => isset( $option['default'] ) ? $option['default'] : '',
138
+ 'sanitize_callback' => isset( $option['sanitize_callback'] ) ? $option['sanitize_callback'] : '',
139
+ );
140
+ add_settings_field( $section . '[' . $option['name'] . ']', $option['label'], array( $this, 'callback_' . $type ), $section, $section, $args );
141
+ }
142
+ }
143
+
144
+ // creates our settings in the options table
145
+ foreach ( $this->settings_sections as $section ) {
146
+ register_setting( $section['id'], $section['id'], array( $this, 'sanitize_options' ) );
147
+ }
148
+ }
149
+
150
+ /**
151
+ * Displays a text field for a settings field
152
+ *
153
+ * @param array $args settings field args
154
+ */
155
+ function callback_text( $args ) {
156
+
157
+ $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
158
+ $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
159
+
160
+ $html = sprintf( '<input type="text" class="%1$s-text" id="%2$s[%3$s]" name="%2$s[%3$s]" value="%4$s"/>', $size, $args['section'], $args['id'], $value );
161
+ $html .= sprintf( '<span class="description"> %s</span>', $args['desc'] );
162
+
163
+ echo $html;
164
+ }
165
+
166
+ /**
167
+ * Displays a checkbox for a settings field
168
+ *
169
+ * @param array $args settings field args
170
+ */
171
+ function callback_checkbox( $args ) {
172
+
173
+ $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
174
+
175
+ $html = sprintf( '<input type="hidden" name="%1$s[%2$s]" value="off" />', $args['section'], $args['id'] );
176
+ $html .= sprintf( '<input type="checkbox" class="checkbox" id="%1$s[%2$s]" name="%1$s[%2$s]" value="on"%4$s />', $args['section'], $args['id'], $value, checked( $value, 'on', false ) );
177
+ $html .= sprintf( '<label for="%1$s[%2$s]"> %3$s</label>', $args['section'], $args['id'], $args['desc'] );
178
+
179
+ echo $html;
180
+ }
181
+
182
+ /**
183
+ * Displays a multicheckbox a settings field
184
+ *
185
+ * @param array $args settings field args
186
+ */
187
+ function callback_multicheck( $args ) {
188
+
189
+ $value = $this->get_option( $args['id'], $args['section'], $args['std'] );
190
+
191
+ $html = '';
192
+ foreach ( $args['options'] as $key => $label ) {
193
+ $checked = isset( $value[$key] ) ? $value[$key] : '0';
194
+ $html .= sprintf( '<input type="checkbox" class="checkbox" id="%1$s[%2$s][%3$s]" name="%1$s[%2$s][%3$s]" value="%3$s"%4$s />', $args['section'], $args['id'], $key, checked( $checked, $key, false ) );
195
+ $html .= sprintf( '<label for="%1$s[%2$s][%4$s]"> %3$s</label><br>', $args['section'], $args['id'], $label, $key );
196
+ }
197
+ $html .= sprintf( '<span class="description"> %s</label>', $args['desc'] );
198
+
199
+ echo $html;
200
+ }
201
+
202
+ /**
203
+ * Displays a multicheckbox a settings field
204
+ *
205
+ * @param array $args settings field args
206
+ */
207
+ function callback_radio( $args ) {
208
+
209
+ $value = $this->get_option( $args['id'], $args['section'], $args['std'] );
210
+
211
+ $html = '';
212
+ foreach ( $args['options'] as $key => $label ) {
213
+ $html .= sprintf( '<input type="radio" class="radio" id="%1$s[%2$s][%3$s]" name="%1$s[%2$s]" value="%3$s"%4$s />', $args['section'], $args['id'], $key, checked( $value, $key, false ) );
214
+ $html .= sprintf( '<label for="%1$s[%2$s][%4$s]"> %3$s</label><br>', $args['section'], $args['id'], $label, $key );
215
+ }
216
+ $html .= sprintf( '<span class="description"> %s</label>', $args['desc'] );
217
+
218
+ echo $html;
219
+ }
220
+
221
+ /**
222
+ * Displays a selectbox for a settings field
223
+ *
224
+ * @param array $args settings field args
225
+ */
226
+ function callback_select( $args ) {
227
+
228
+ $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
229
+ $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
230
+
231
+ $html = sprintf( '<select class="%1$s" name="%2$s[%3$s]" id="%2$s[%3$s]">', $size, $args['section'], $args['id'] );
232
+ foreach ( $args['options'] as $key => $label ) {
233
+ $html .= sprintf( '<option value="%s"%s>%s</option>', $key, selected( $value, $key, false ), $label );
234
+ }
235
+ $html .= sprintf( '</select>' );
236
+ $html .= sprintf( '<span class="description"> %s</span>', $args['desc'] );
237
+
238
+ echo $html;
239
+ }
240
+
241
+ /**
242
+ * Displays a textarea for a settings field
243
+ *
244
+ * @param array $args settings field args
245
+ */
246
+ function callback_textarea( $args ) {
247
+
248
+ $value = esc_textarea( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
249
+ $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
250
+
251
+ $html = sprintf( '<textarea rows="5" cols="55" class="%1$s-text" id="%2$s[%3$s]" name="%2$s[%3$s]">%4$s</textarea>', $size, $args['section'], $args['id'], $value );
252
+ $html .= sprintf( '<br><span class="description"> %s</span>', $args['desc'] );
253
+
254
+ echo $html;
255
+ }
256
+
257
+ /**
258
+ * Displays a textarea for a settings field
259
+ *
260
+ * @param array $args settings field args
261
+ */
262
+ function callback_html( $args ) {
263
+ echo $args['desc'];
264
+ }
265
+
266
+ /**
267
+ * Displays a rich text textarea for a settings field
268
+ *
269
+ * @param array $args settings field args
270
+ */
271
+ function callback_wysiwyg( $args ) {
272
+
273
+ $value = wpautop( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
274
+ $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : '500px';
275
+
276
+ echo '<div style="width: ' . $size . ';">';
277
+
278
+ wp_editor( $value, $args['section'] . '[' . $args['id'] . ']', array( 'teeny' => true, 'textarea_rows' => 10 ) );
279
+
280
+ echo '</div>';
281
+
282
+ echo sprintf( '<br><span class="description"> %s</span>', $args['desc'] );
283
+ }
284
+
285
+ /**
286
+ * Displays a file upload field for a settings field
287
+ *
288
+ * @param array $args settings field args
289
+ */
290
+ function callback_file( $args ) {
291
+
292
+ $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
293
+ $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
294
+ $id = $args['section'] . '[' . $args['id'] . ']';
295
+ $js_id = $args['section'] . '\\\\[' . $args['id'] . '\\\\]';
296
+ $html = sprintf( '<input type="text" class="%1$s-text" id="%2$s[%3$s]" name="%2$s[%3$s]" value="%4$s"/>', $size, $args['section'], $args['id'], $value );
297
+ $html .= '<input type="button" class="button wpsf-browse" id="'. $id .'_button" value="Browse" />
298
+ <script type="text/javascript">
299
+ jQuery(document).ready(function($){
300
+ $("#'. $js_id .'_button").click(function() {
301
+ tb_show("", "media-upload.php?post_id=0&amp;type=image&amp;TB_iframe=true");
302
+ window.original_send_to_editor = window.send_to_editor;
303
+ window.send_to_editor = function(html) {
304
+ var url = $(html).attr(\'href\');
305
+ if ( !url ) {
306
+ url = $(html).attr(\'src\');
307
+ };
308
+ $("#'. $js_id .'").val(url);
309
+ tb_remove();
310
+ window.send_to_editor = window.original_send_to_editor;
311
+ };
312
+ return false;
313
+ });
314
+ });
315
+ </script>';
316
+ $html .= sprintf( '<span class="description"> %s</span>', $args['desc'] );
317
+
318
+ echo $html;
319
+ }
320
+
321
+ /**
322
+ * Displays a password field for a settings field
323
+ *
324
+ * @param array $args settings field args
325
+ */
326
+ function callback_password( $args ) {
327
+
328
+ $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
329
+ $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
330
+
331
+ $html = sprintf( '<input type="password" class="%1$s-text" id="%2$s[%3$s]" name="%2$s[%3$s]" value="%4$s"/>', $size, $args['section'], $args['id'], $value );
332
+ $html .= sprintf( '<span class="description"> %s</span>', $args['desc'] );
333
+
334
+ echo $html;
335
+ }
336
+
337
+ /**
338
+ * Displays a color picker field for a settings field
339
+ *
340
+ * @param array $args settings field args
341
+ */
342
+ function callback_color( $args ) {
343
+
344
+ $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
345
+ $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
346
+
347
+ $html = sprintf( '<input type="text" class="%1$s-text wp-color-picker-field" id="%2$s[%3$s]" name="%2$s[%3$s]" value="%4$s" data-default-color="%5$s" />', $size, $args['section'], $args['id'], $value, $args['std'] );
348
+ $html .= sprintf( '<span class="description" style="display:block;"> %s</span>', $args['desc'] );
349
+
350
+ echo $html;
351
+ }
352
+
353
+ /**
354
+ * Sanitize callback for Settings API
355
+ */
356
+ function sanitize_options( $options ) {
357
+ foreach( $options as $option_slug => $option_value ) {
358
+ $sanitize_callback = $this->get_sanitize_callback( $option_slug );
359
+
360
+ // If callback is set, call it
361
+ if ( $sanitize_callback ) {
362
+ $options[ $option_slug ] = call_user_func( $sanitize_callback, $option_value );
363
+ continue;
364
+ }
365
+
366
+ // Treat everything that's not an array as a string
367
+ if ( !is_array( $option_value ) ) {
368
+ $options[ $option_slug ] = sanitize_text_field( $option_value );
369
+ continue;
370
+ }
371
+ }
372
+ return $options;
373
+ }
374
+
375
+ /**
376
+ * Get sanitization callback for given option slug
377
+ *
378
+ * @param string $slug option slug
379
+ *
380
+ * @return mixed string or bool false
381
+ */
382
+ function get_sanitize_callback( $slug = '' ) {
383
+ if ( empty( $slug ) )
384
+ return false;
385
+ // Iterate over registered fields and see if we can find proper callback
386
+ foreach( $this->settings_fields as $section => $options ) {
387
+ foreach ( $options as $option ) {
388
+ if ( $option['name'] != $slug )
389
+ continue;
390
+ // Return the callback name
391
+ return isset( $option['sanitize_callback'] ) && is_callable( $option['sanitize_callback'] ) ? $option['sanitize_callback'] : false;
392
+ }
393
+ }
394
+ return false;
395
+ }
396
+
397
+ /**
398
+ * Get the value of a settings field
399
+ *
400
+ * @param string $option settings field name
401
+ * @param string $section the section name this field belongs to
402
+ * @param string $default default text if it's not found
403
+ * @return string
404
+ */
405
+ function get_option( $option, $section, $default = '' ) {
406
+
407
+ $options = get_option( $section );
408
+
409
+ if ( isset( $options[$option] ) ) {
410
+ return $options[$option];
411
+ }
412
+
413
+ return $default;
414
+ }
415
+
416
+ /**
417
+ * Show navigations as tab
418
+ *
419
+ * Shows all the settings section labels as tab
420
+ */
421
+ function show_navigation() {
422
+ $html = '<h2 class="nav-tab-wrapper">';
423
+
424
+ foreach ( $this->settings_sections as $tab ) {
425
+ $html .= sprintf( '<a href="#%1$s" class="nav-tab" id="%1$s-tab">%2$s</a>', $tab['id'], $tab['title'] );
426
+ }
427
+
428
+ $html .= '</h2>';
429
+
430
+ echo $html;
431
+ }
432
+
433
+ /**
434
+ * Show the section settings forms
435
+ *
436
+ * This function displays every sections in a different form
437
+ */
438
+ function show_forms() {
439
+
440
+ foreach ( $this->settings_sections as $form ) { ?>
441
+ <div id="<?php echo $form['id']; ?>" class="group">
442
+ <form method="post" action="options.php">
443
+
444
+ <?php do_action( 'wsa_form_top_' . $form['id'], $form ); ?>
445
+ <?php settings_fields( $form['id'] ); ?>
446
+ <?php do_settings_sections( $form['id'] ); ?>
447
+ <?php do_action( 'wsa_form_bottom_' . $form['id'], $form ); ?>
448
+
449
+ <div style="padding-left: 10px; padding-top:15px;">
450
+ <?php // get_submit_button returns a submit button, with provided text and appropriate class
451
+ $button_markup = get_submit_button();
452
+ $button_markup = apply_filters( 'axiom_wedev_setting_section_submit_button', $button_markup, $form );
453
+ echo $button_markup;
454
+ ?>
455
+ </div>
456
+ </form>
457
+ </div>
458
+ <?php }
459
+
460
+ $this->script();
461
+ }
462
+
463
+ /**
464
+ * Tabbable JavaScript codes & Initiate Color Picker
465
+ *
466
+ * This code uses localstorage for displaying active tabs
467
+ */
468
+ function script() {
469
+ ?>
470
+ <script>
471
+ jQuery(document).ready(function($) {
472
+ //Initiate Color Picker
473
+ $('.wp-color-picker-field').wpColorPicker();
474
+ // Switches option sections
475
+ $('.group').hide();
476
+ var activetab = '';
477
+ if (typeof(localStorage) != 'undefined' ) {
478
+ activetab = localStorage.getItem("activetab");
479
+ }
480
+ if (activetab !== '' && $(activetab).length ) {
481
+ $(activetab).fadeIn();
482
+ } else {
483
+ $('.group:first').fadeIn();
484
+ }
485
+ $('.group .collapsed').each(function(){
486
+ $(this).find('input:checked').parent().parent().parent().nextAll().each(
487
+ function(){
488
+ if ($(this).hasClass('last')) {
489
+ $(this).removeClass('hidden');
490
+ return false;
491
+ }
492
+ $(this).filter('.hidden').removeClass('hidden');
493
+ });
494
+ });
495
+
496
+ if (activetab !== '' && $(activetab + '-tab').length ) {
497
+ $(activetab + '-tab').addClass('nav-tab-active');
498
+ }
499
+ else {
500
+ $('.nav-tab-wrapper a:first').addClass('nav-tab-active');
501
+ }
502
+ $('.nav-tab-wrapper a').click(function(evt) {
503
+ $('.nav-tab-wrapper a').removeClass('nav-tab-active');
504
+ $(this).addClass('nav-tab-active').blur();
505
+ var clicked_group = $(this).attr('href');
506
+ if (typeof(localStorage) != 'undefined' ) {
507
+ localStorage.setItem("activetab", $(this).attr('href'));
508
+ }
509
+ $('.group').hide();
510
+ $(clicked_group).fadeIn();
511
+ evt.preventDefault();
512
+ });
513
+ });
514
+ </script>
515
+ <style type="text/css">
516
+ .nav-tab-wrapper { margin-bottom:30px; }
517
+ </style>
518
+ <?php
519
+ }
520
+
521
+ }
522
+ endif;
admin/views/slider-dashboard/get-preview.html ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title></title>
5
+
6
+ <script>
7
+ // load live preview
8
+ parent.jQuery(function (){
9
+
10
+ parent.MSPanel.pushData();
11
+ var panel_data = parent.B64.encode( JSON.stringify( parent.MSPanel.data ) );
12
+ var preset_styles_data = parent.B64.encode( JSON.stringify( parent.MSPanel.PSData ) );
13
+ var preset_buttons_data = parent.B64.encode( JSON.stringify( parent.MSPanel.PBData ) );
14
+
15
+
16
+ parent.jQuery.post(
17
+ parent.__MS.msp_menu_page + '&action=preview&strip_wp',
18
+ {
19
+ slider_params : panel_data,
20
+ preset_style : preset_styles_data,
21
+ preset_buttons : preset_buttons_data
22
+ },
23
+ function(result){
24
+ document.open().write(result);
25
+ document.close();
26
+ }
27
+ );
28
+ });
29
+ </script>
30
+ </head>
31
+ <body>
32
+
33
+ </body>
34
+ </html>
admin/views/slider-dashboard/list-sliders.php ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ msp_get_panel_header();
3
+
4
+ // Display sliders list
5
+ $slider_table_list = new MSP_List_Table();
6
+ $slider_table_list->prepare_items();
7
+ $slider_table_list->display();
8
+
9
+
10
+ // Display action buttons
11
+ echo '<div class="action-btns-list">';
12
+
13
+ if( current_user_can( 'create_masterslider' ) )
14
+ printf( '<a id="msp-add-slider" class="action-add-new msp-ac-btn msp-btn-blue msp-iconic-big" href="%s"><span></span>%s</a>', admin_url( 'admin.php?page='.MSWP_SLUG.'&action=add' ), __( 'Create New Slider', MSWP_TEXT_DOMAIN ) );
15
+
16
+ if( current_user_can( 'export_masterslider' ) || apply_filters( 'masterslider_admin_display_export_import', 0 ) )
17
+ printf( '<a class="action-import-export msp-ac-btn" href="%s" onClick="lunchMastersliderImportExport(); return false;">%s</a>', admin_url( 'admin.php?page='.MSWP_SLUG ), __( 'Import & Export', MSWP_TEXT_DOMAIN ) );
18
+
19
+ echo '</div>';
20
+
21
+
22
+
23
+ if( current_user_can( 'create_masterslider' ) ) { ?>
24
+
25
+ <div id="msp-slider-type-select" >
26
+
27
+ <div class="msp-templates-list">
28
+
29
+ <?php
30
+ sanitize_title( '' );
31
+ $starter_sections = msp_get_slider_starter_sections();
32
+ $starter_fields = msp_get_slider_starter_fields();
33
+
34
+ foreach ( $starter_sections as $starter_section ) {
35
+ ?>
36
+ <div class="msp-dialog-inner-title ui-helper-clearfix">
37
+ <span><?php echo $starter_section['title']; ?></span>
38
+ </div>
39
+ <?php
40
+
41
+ $section_id = $starter_section['id'];
42
+ $section_fields = isset( $starter_fields[ $section_id ] ) ? $starter_fields[ $starter_section['id'] ] : array();
43
+
44
+ foreach ( $section_fields as $starter_data ) {
45
+
46
+ $selected_attr = ( 'true' == $starter_data['selected'] ) ? 'selected' : '';
47
+ $is_unavailable = isset( $starter_data['disable'] ) && 'true' == $starter_data['disable'] ? ' is-unavailable' : '';
48
+ $disabled_msg = isset( $starter_data['disabled_msg'] ) && ! empty( $starter_data['disabled_msg'] ) ? $starter_data['disabled_msg'] : '';
49
+
50
+ ?>
51
+ <div class="msp-template-figure <?php echo $selected_attr . $is_unavailable; ?>" data-slider-type="<?php echo $starter_data['slidertype']; ?>"
52
+ data-starter-uid="<?php echo $starter_data['id']; ?>" data-starter-section="<?php echo $section_id; ?>" data-disabled-msg="<?php echo $disabled_msg; ?>" >
53
+ <div class="msp-templte-selected"></div>
54
+ <img src="<?php echo $starter_data['screenshot']; ?>" />
55
+ <div class="msp-template-caption"><?php echo $starter_data['label']; ?><span></span></div>
56
+ </div>
57
+ <?php
58
+
59
+ }
60
+
61
+ ?>
62
+ <div class="section-divider"></div>
63
+ <?php
64
+ }
65
+
66
+ ?>
67
+ </div>
68
+
69
+ <div class="msp-templates-bottom">
70
+ <button id="msp-slider-type-create" class="msp-blue-btn msp-applyeffect"><?php _e( 'Create', MSWP_TEXT_DOMAIN ); ?></button>
71
+ </div>
72
+ </div>
73
+
74
+ <?php } ?>
75
+
76
+
77
+
78
+ <?php if( current_user_can( 'export_masterslider' ) || apply_filters( 'masterslider_admin_display_export_import', 0 ) ) { ?>
79
+
80
+ <div class="msp-import-export-wrapper" >
81
+
82
+ <?php do_action( 'masterslider_before_import_dialog_content' ); ?>
83
+
84
+ <div class="msp-import-wrapper">
85
+
86
+ <form action="<?php echo admin_url( 'admin.php?import=masterslider-importer&step=2' ); ?>" method="post" enctype="multipart/form-data" class="msp-import-form msp-dialog-inner-section">
87
+
88
+ <fieldset>
89
+ <?php wp_nonce_field('import-msp-sliders'); ?>
90
+
91
+ <input type="hidden" name="msp-import" value="1">
92
+
93
+ <input type="file" name="msp-import-file" class="msp-select-file">
94
+
95
+ <button class="button msp-ac-btn msp-btn-blue"><?php _e('Import', MSWP_TEXT_DOMAIN ) ?></button>
96
+ </fieldset>
97
+
98
+ <span class="msp-dialog-section-desc"><?php _e( 'To import sliders select Masterslider Export file that you downloaded before then click import button.', MSWP_TEXT_DOMAIN ) ?></span>
99
+
100
+ </form>
101
+
102
+ </div>
103
+
104
+ <div class="msp-export-wrapper">
105
+ <h4 class="msp-dialog-inner-split-header"><?php _e('Export', MSWP_TEXT_DOMAIN ) ?></h4>
106
+
107
+ <form action="<?php echo $_SERVER['REQUEST_URI'] ?>" method="post" class="msp-export-form msp-dialog-inner-section">
108
+
109
+ <div class="msp-export-table-container">
110
+
111
+ <table class="msp-export-table widefat fixed msp-export-sliders-table">
112
+
113
+ <thead>
114
+ <tr>
115
+ <th class="export-column export-field-cb" >
116
+ <input type="checkbox" name="export-check-all" class="export-check-all" />
117
+ </th>
118
+ <th class="export-column export-field-ID" >ID</th>
119
+ <th class="export-column export-field-title" >Name</th>
120
+ <th class="export-column export-field-type" >Type</th>
121
+ <th class="export-column export-field-lastmodify" >Last Modify</th>
122
+ </tr>
123
+ </thead>
124
+
125
+ <tbody>
126
+ <?php
127
+ global $mspdb;
128
+ $sliders = $mspdb->get_sliders_list();
129
+ foreach ( $sliders as $slider ) {
130
+ $orig_time = isset( $slider['date_modified'] ) ? strtotime($slider['date_modified']) : '';
131
+ $time = date_i18n( 'Y/m/d @ g:i:s A', $orig_time );
132
+ $human_time = human_time_diff( $orig_time );
133
+ ?>
134
+ <tr>
135
+ <th class="export-column export-field-cb" ><input type="checkbox" name="msp-export-sliders[]" class="export-slider-cb" value="<?php echo $slider['ID']; ?>" /></th>
136
+ <th class="export-column export-field-ID" ><?php echo $slider['ID']; ?></th>
137
+ <th class="export-column export-field-title" ><?php echo $slider['title']; ?></th>
138
+ <th class="export-column export-field-type" ><?php echo $slider['type']; ?></th>
139
+ <th class="export-column export-field-lastmodify" ><abbr title="<?php echo $time; ?>"><?php echo $human_time; ?></abbr></th>
140
+ </tr>
141
+ <?php } ?>
142
+ </tbody>
143
+
144
+ </table>
145
+
146
+ </div>
147
+
148
+ <fieldset>
149
+ <?php wp_nonce_field('export-msp-sliders'); ?>
150
+
151
+ <input type="hidden" name="msp-export" value="1">
152
+
153
+ <button id="msp-export-btn" class="button msp-ac-btn msp-btn-blue"><?php _e('Export', MSWP_TEXT_DOMAIN ) ?></button>
154
+ </fieldset>
155
+
156
+ <span class="msp-dialog-section-desc"><?php _e( 'Downloads an export file that contains your selected sliders to import on your new site.', MSWP_TEXT_DOMAIN ); ?></span>
157
+
158
+ </form>
159
+
160
+ </div>
161
+ </div>
162
+
163
+ <?php } ?>
164
+
admin/views/slider-dashboard/preview.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // define( 'IFRAME_REQUEST', true );
4
+
5
+
6
+ echo '<div id="ms-preview-wrapper">';
7
+
8
+ if( isset( $_REQUEST['slider_params'] ) && ! empty( $_REQUEST['slider_params'] ) ) {
9
+
10
+ $slider_params = $_REQUEST['slider_params'];
11
+ $slider_shortcodes = msp_panel_data_2_ms_slider_shortcode( $slider_params );
12
+ echo do_shortcode( $slider_shortcodes );
13
+
14
+ // print slider custom css inline in live preview
15
+ $parser = msp_get_parser();
16
+ $parser->set_data( $slider_params );
17
+ $slider_custom_css = $parser->get_styles();
18
+ printf( "<!-- Custom slider styles -->\n<style>%s</style>", $slider_custom_css );
19
+
20
+ } elseif ( isset( $_REQUEST['slider_id'] ) && ! empty( $_REQUEST['slider_id'] ) ) {
21
+ $slider_id = $_REQUEST['slider_id'];
22
+ $slider_shortcodes = msp_get_ms_slider_shortcode_by_slider_id( $slider_id );
23
+ echo do_shortcode( $slider_shortcodes );
24
+ // print slider custom css inline in live preview
25
+ printf( "<!-- Custom slider styles -->\n<style>%s</style>", msp_get_slider_custom_css( $slider_id ) );
26
+
27
+ } else {
28
+ _e( 'Not found.', MSWP_TEXT_DOMAIN );
29
+ }
30
+
31
+
32
+ echo "</div>\n";
33
+
34
+
35
+
36
+
37
+
38
+
39
+ if ( isset( $_REQUEST['strip_wp'] ) ) {
40
+ ?>
41
+ <style>
42
+ #adminmenuwrap,
43
+ #wpadminbar,
44
+ #adminmenuback,
45
+ #screen-meta,
46
+ #screen-meta-links,
47
+ #wpadminbar,
48
+ #querylist,
49
+ #wpfooter,
50
+ #wpbody-content > * {
51
+ display:none;
52
+ }
53
+ #wpbody-content {
54
+ padding-bottom: 0;
55
+ }
56
+
57
+ #wpcontent {
58
+ margin-left:0;
59
+ }
60
+ html.wp-toolbar {
61
+ padding-top:0;
62
+ }
63
+ #msp-main-wrapper {
64
+ margin:0;
65
+ display:block;
66
+ }
67
+
68
+ </style>
69
+ <?php
70
+ }
71
+
admin/views/slider-panel/css/codemirror.css ADDED
@@ -0,0 +1,264 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* BASICS */
2
+
3
+ .CodeMirror {
4
+ /* Set height, width, borders, and global font properties here */
5
+ font-family: monospace;
6
+ height: 300px;
7
+ }
8
+ .CodeMirror-scroll {
9
+ /* Set scrolling behaviour here */
10
+ overflow: auto;
11
+ }
12
+
13
+ /* PADDING */
14
+
15
+ .CodeMirror-lines {
16
+ padding: 4px 0; /* Vertical padding around content */
17
+ }
18
+ .CodeMirror pre {
19
+ padding: 0 4px; /* Horizontal padding of content */
20
+ }
21
+
22
+ .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
23
+ background-color: white; /* The little square between H and V scrollbars */
24
+ }
25
+
26
+ /* GUTTER */
27
+
28
+ .CodeMirror-gutters {
29
+ border-right: 1px solid #ddd;
30
+ background-color: #f7f7f7;
31
+ white-space: nowrap;
32
+ }
33
+ .CodeMirror-linenumbers {}
34
+ .CodeMirror-linenumber {
35
+ padding: 0 3px 0 5px;
36
+ min-width: 20px;
37
+ text-align: right;
38
+ color: #999;
39
+ -moz-box-sizing: content-box;
40
+ box-sizing: content-box;
41
+ }
42
+
43
+ /* CURSOR */
44
+
45
+ .CodeMirror div.CodeMirror-cursor {
46
+ border-left: 1px solid black;
47
+ z-index: 3;
48
+ }
49
+ /* Shown when moving in bi-directional text */
50
+ .CodeMirror div.CodeMirror-secondarycursor {
51
+ border-left: 1px solid silver;
52
+ }
53
+ .CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
54
+ width: auto;
55
+ border: 0;
56
+ background: #7e7;
57
+ z-index: 1;
58
+ }
59
+ /* Can style cursor different in overwrite (non-insert) mode */
60
+ .CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
61
+
62
+ .cm-tab { display: inline-block; }
63
+
64
+ .CodeMirror-ruler {
65
+ border-left: 1px solid #ccc;
66
+ position: absolute;
67
+ }
68
+
69
+ /* DEFAULT THEME */
70
+
71
+ .cm-s-default .cm-keyword {color: #708;}
72
+ .cm-s-default .cm-atom {color: #219;}
73
+ .cm-s-default .cm-number {color: #164;}
74
+ .cm-s-default .cm-def {color: #00f;}
75
+ .cm-s-default .cm-variable {color: black;}
76
+ .cm-s-default .cm-variable-2 {color: #05a;}
77
+ .cm-s-default .cm-variable-3 {color: #085;}
78
+ .cm-s-default .cm-property {color: black;}
79
+ .cm-s-default .cm-operator {color: black;}
80
+ .cm-s-default .cm-comment {color: #a50;}
81
+ .cm-s-default .cm-string {color: #a11;}
82
+ .cm-s-default .cm-string-2 {color: #f50;}
83
+ .cm-s-default .cm-meta {color: #555;}
84
+ .cm-s-default .cm-qualifier {color: #555;}
85
+ .cm-s-default .cm-builtin {color: #30a;}
86
+ .cm-s-default .cm-bracket {color: #997;}
87
+ .cm-s-default .cm-tag {color: #170;}
88
+ .cm-s-default .cm-attribute {color: #00c;}
89
+ .cm-s-default .cm-header {color: blue;}
90
+ .cm-s-default .cm-quote {color: #090;}
91
+ .cm-s-default .cm-hr {color: #999;}
92
+ .cm-s-default .cm-link {color: #00c;}
93
+
94
+ .cm-negative {color: #d44;}
95
+ .cm-positive {color: #292;}
96
+ .cm-header, .cm-strong {font-weight: bold;}
97
+ .cm-em {font-style: italic;}
98
+ .cm-link {text-decoration: underline;}
99
+
100
+ .cm-s-default .cm-error {color: #f00;}
101
+ .cm-invalidchar {color: #f00;}
102
+
103
+ div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
104
+ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
105
+ .CodeMirror-activeline-background {background: #e8f2ff;}
106
+
107
+ /* STOP */
108
+
109
+ /* The rest of this file contains styles related to the mechanics of
110
+ the editor. You probably shouldn't touch them. */
111
+
112
+ .CodeMirror {
113
+ line-height: 1;
114
+ position: relative;
115
+ overflow: hidden;
116
+ background: white;
117
+ color: black;
118
+ }
119
+
120
+ .CodeMirror-scroll {
121
+ /* 30px is the magic margin used to hide the element's real scrollbars */
122
+ /* See overflow: hidden in .CodeMirror */
123
+ margin-bottom: -30px; margin-right: -30px;
124
+ padding-bottom: 30px;
125
+ height: 100%;
126
+ outline: none; /* Prevent dragging from highlighting the element */
127
+ position: relative;
128
+ -moz-box-sizing: content-box;
129
+ box-sizing: content-box;
130
+ }
131
+ .CodeMirror-sizer {
132
+ position: relative;
133
+ border-right: 30px solid transparent;
134
+ -moz-box-sizing: content-box;
135
+ box-sizing: content-box;
136
+ }
137
+
138
+ /* The fake, visible scrollbars. Used to force redraw during scrolling
139
+ before actuall scrolling happens, thus preventing shaking and
140
+ flickering artifacts. */
141
+ .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
142
+ position: absolute;
143
+ z-index: 6;
144
+ display: none;
145
+ }
146
+ .CodeMirror-vscrollbar {
147
+ right: 0; top: 0;
148
+ overflow-x: hidden;
149
+ overflow-y: scroll;
150
+ }
151
+ .CodeMirror-hscrollbar {
152
+ bottom: 0; left: 0;
153
+ overflow-y: hidden;
154
+ overflow-x: scroll;
155
+ }
156
+ .CodeMirror-scrollbar-filler {
157
+ right: 0; bottom: 0;
158
+ }
159
+ .CodeMirror-gutter-filler {
160
+ left: 0; bottom: 0;
161
+ }
162
+
163
+ .CodeMirror-gutters {
164
+ position: absolute; left: 0; top: 0;
165
+ padding-bottom: 30px;
166
+ z-index: 3;
167
+ }
168
+ .CodeMirror-gutter {
169
+ white-space: normal;
170
+ height: 100%;
171
+ -moz-box-sizing: content-box;
172
+ box-sizing: content-box;
173
+ padding-bottom: 30px;
174
+ margin-bottom: -32px;
175
+ display: inline-block;
176
+ /* Hack to make IE7 behave */
177
+ *zoom:1;
178
+ *display:inline;
179
+ }
180
+ .CodeMirror-gutter-elt {
181
+ position: absolute;
182
+ cursor: default;
183
+ z-index: 4;
184
+ }
185
+
186
+ .CodeMirror-lines {
187
+ cursor: text;
188
+ }
189
+ .CodeMirror pre {
190
+ /* Reset some styles that the rest of the page might have set */
191
+ -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
192
+ border-width: 0;
193
+ background: transparent;
194
+ font-family: inherit;
195
+ font-size: inherit;
196
+ margin: 0;
197
+ white-space: pre;
198
+ word-wrap: normal;
199
+ line-height: inherit;
200
+ color: inherit;
201
+ z-index: 2;
202
+ position: relative;
203
+ overflow: visible;
204
+ }
205
+ .CodeMirror-wrap pre {
206
+ word-wrap: break-word;
207
+ white-space: pre-wrap;
208
+ word-break: normal;
209
+ }
210
+
211
+ .CodeMirror-linebackground {
212
+ position: absolute;
213
+ left: 0; right: 0; top: 0; bottom: 0;
214
+ z-index: 0;
215
+ }
216
+
217
+ .CodeMirror-linewidget {
218
+ position: relative;
219
+ z-index: 2;
220
+ overflow: auto;
221
+ }
222
+
223
+ .CodeMirror-widget {}
224
+
225
+ .CodeMirror-wrap .CodeMirror-scroll {
226
+ overflow-x: hidden;
227
+ }
228
+
229
+ .CodeMirror-measure {
230
+ position: absolute;
231
+ width: 100%;
232
+ height: 0;
233
+ overflow: hidden;
234
+ visibility: hidden;
235
+ }
236
+ .CodeMirror-measure pre { position: static; }
237
+
238
+ .CodeMirror div.CodeMirror-cursor {
239
+ position: absolute;
240
+ visibility: hidden;
241
+ border-right: none;
242
+ width: 0;
243
+ }
244
+ .CodeMirror-focused div.CodeMirror-cursor {
245
+ visibility: visible;
246
+ }
247
+
248
+ .CodeMirror-selected { background: #d9d9d9; }
249
+ .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
250
+
251
+ .cm-searching {
252
+ background: #ffa;
253
+ background: rgba(255, 255, 0, .4);
254
+ }
255
+
256
+ /* IE7 hack to prevent it from returning funny offsetTops on the spans */
257
+ .CodeMirror span { *vertical-align: text-bottom; }
258
+
259
+ @media print {
260
+ /* Hide the cursor when printing */
261
+ .CodeMirror div.CodeMirror-cursor {
262
+ visibility: hidden;
263
+ }
264
+ }
admin/views/slider-panel/css/jquery-ui-1.10.4.min.css ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.10.4 - 2014-02-10
2
+ * http://jqueryui.com
3
+ * Includes: jquery.ui.core.css
4
+ * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
5
+
6
+ .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}
admin/views/slider-panel/css/jquery.jscrollpane.css ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * CSS Styles that are needed by jScrollPane for it to operate correctly.
3
+ *
4
+ * Include this stylesheet in your site or copy and paste the styles below into your stylesheet - jScrollPane
5
+ * may not operate correctly without them.
6
+ */
7
+
8
+ .jspContainer
9
+ {
10
+ overflow: hidden;
11
+ position: relative;
12
+ }
13
+
14
+ .jspPane
15
+ {
16
+ position: absolute;
17
+ }
18
+
19
+ .jspVerticalBar
20
+ {
21
+ position: absolute;
22
+ top: 0;
23
+ right: 0;
24
+ width: 10px;
25
+ height: 100%;
26
+ background: red;
27
+ }
28
+
29
+ .jspHorizontalBar
30
+ {
31
+ position: absolute;
32
+ bottom: 0;
33
+ left: 0;
34
+ width: 100%;
35
+ height: 10px;
36
+ background: red;
37
+ }
38
+
39
+ .jspCap
40
+ {
41
+ display: none;
42
+ }
43
+
44
+ .jspHorizontalBar .jspCap
45
+ {
46
+ float: left;
47
+ }
48
+
49
+ .jspTrack
50
+ {
51
+ background: #dedede;
52
+ position: relative;
53
+ }
54
+
55
+ .jspDrag
56
+ {
57
+ background: #888;
58
+ position: relative;
59
+ top: 0;
60
+ left: 0;
61
+ cursor: pointer;
62
+ }
63
+
64
+ .jspHorizontalBar .jspTrack,
65
+ .jspHorizontalBar .jspDrag
66
+ {
67
+ float: left;
68
+ height: 100%;
69
+ }
70
+
71
+ .jspArrow
72
+ {
73
+ background: #50506d;
74
+ text-indent: -20000px;
75
+ display: block;
76
+ cursor: pointer;
77
+ padding: 0;
78
+ margin: 0;
79
+ }
80
+
81
+ .jspArrow.jspDisabled
82
+ {
83
+ cursor: default;
84
+ background: #80808d;
85
+ }
86
+
87
+ .jspVerticalBar .jspArrow
88
+ {
89
+ height: 16px;
90
+ }
91
+
92
+ .jspHorizontalBar .jspArrow
93
+ {
94
+ width: 16px;
95
+ float: left;
96
+ height: 100%;
97
+ }
98
+
99
+ .jspVerticalBar .jspArrow:focus
100
+ {
101
+ outline: none;
102
+ }
103
+
104
+ .jspCorner
105
+ {
106
+ background: #eeeef4;
107
+ float: left;
108
+ height: 100%;
109
+ }
110
+
111
+ /* Yuk! CSS Hack for IE6 3 pixel bug :( */
112
+ * html .jspCorner
113
+ {
114
+ margin: 0 -3px 0 0;
115
+ }
admin/views/slider-panel/css/msp-components.css ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /* ----------------------------------
3
+ Master Slider Panel
4
+ Switchbox component
5
+ -------------------------------------*/
6
+
7
+ .msp-switchbox{
8
+ width: 73px;
9
+ height: 33px;
10
+ border: solid 1px #DEDEDE;
11
+ border-radius: 100px;
12
+ color: #777;
13
+ background-color: #F5F5F5;
14
+ cursor: pointer;
15
+ overflow: hidden;
16
+
17
+ margin-right: 10px;
18
+ line-height: 26px;
19
+ font-size: 0.88em;
20
+
21
+ -webkit-user-select: none;
22
+ -moz-user-select: none;
23
+ -ms-user-select: none;
24
+ user-select: none;
25
+
26
+ display: inline-block;
27
+ vertical-align: middle;
28
+ -webkit-box-shadow: 7px 7px 0px rgba(0, 0, 0, 0.01) inset;
29
+ -moz-webkit-box-shadow: 7px 7px 0px rgba(0, 0, 0, 0.01) inset;
30
+ -ms-webkit-box-shadow: 7px 7px 0px rgba(0, 0, 0, 0.01) inset;
31
+ -o-webkit-box-shadow: 7px 7px 0px rgba(0, 0, 0, 0.01) inset;
32
+ }
33
+
34
+ .msp-switchbox .msp-switch-cont{
35
+ position: relative;
36
+ left:0;
37
+ -webkit-transition: all 0.25s;
38
+ -moz-transition: all 0.25s;
39
+ -ms-transition: all 0.25s;
40
+ -o-transition: all 0.25s;
41
+ transition: all 0.25s;
42
+ }
43
+ .msp-switchbox.switched .msp-switch-cont{left:40px;}
44
+
45
+
46
+ .msp-switchbox .msp-switch-handle{
47
+ display: block;
48
+ width: 23px;
49
+ height: 23px;
50
+ margin: 4px;
51
+ text-indent: 30px;
52
+ background-color: white;
53
+ border-radius: 44px;
54
+ border:solid 1px #dedede;
55
+ -webkit-transition: all 0.25s;
56
+ -moz-transition: all 0.25s;
57
+ -ms-transition: all 0.25s;
58
+ -o-transition: all 0.25s;
59
+ transition: all 0.25s;
60
+ }
61
+
62
+ .msp-switchbox.switched .msp-switch-handle{
63
+ background-color: #2ea2cc;
64
+ border-color: #2ea2cc;
65
+ }
66
+
67
+ .msp-switchbox .msp-switch-on{
68
+ position: absolute;
69
+ display: block;
70
+ left: -26px;
71
+ top: 0;
72
+ }
73
+
74
+ .msp-switchbox .msp-switch-off{
75
+ position: absolute;
76
+ display: block;
77
+ left:35px;
78
+ }
79
+
80
+ /**
81
+ * Native dropdown list
82
+ */
83
+ .msp-ddlist {
84
+ display: inline-block;
85
+ position: relative;
86
+ border: solid 1px #dedede;
87
+ }
88
+
89
+ .msp-ddlist>select {
90
+ border: none;
91
+ -webkit-appearance: none;
92
+ -moz-appearance: none;
93
+ appearance: none;
94
+ height: auto;
95
+ box-shadow: none;
96
+ padding: 8px;
97
+ outline: none;
98
+ }
99
+
100
+
101
+ .msp-ddlist:after {
102
+ content: "";
103
+ display: block;
104
+ background: url(../images/ui-spritesheet.png) no-repeat -200px -72px;
105
+ width: 10px;
106
+ height: 10px;
107
+ position: absolute;
108
+ top: 11px;
109
+ right: 10px;
110
+ }
111
+
112
+ .msp-ddlist-multiselect {
113
+ vertical-align: top;
114
+ }
115
+ .msp-ddlist-multiselect>select {
116
+ padding: 5px;
117
+ }
118
+ .msp-ddlist-multiselect:after {
119
+ display: none;
120
+ }
121
+
122
+ /*Color Picker*/
123
+ .sp-replacer {
124
+ border-color: #dedede;
125
+ background: white;
126
+ padding: 6px 7px;
127
+ vertical-align: top;
128
+ }
129
+
130
+ .sp-clear-display {
131
+ background-image: url(../images/no-color.gif);
132
+ }
133
+
134
+ .sp-replacer:hover, .sp-replacer.sp-active {
135
+ border-color: #B3B3B3;
136
+ }
137
+
138
+ .sp-preview {
139
+ border-radius: 3px;
140
+ width: 20px;
141
+ margin: 0 9px 0 1px;
142
+ overflow: hidden;
143
+ border-color: #dedede;
144
+ }
145
+ .sp-dd {
146
+ text-indent: -99999px;
147
+ background: url(../images/ui-spritesheet.png) #FFF no-repeat -200px -72px;
148
+ width: 10px;
149
+ height: 8px;
150
+ margin-top: 5px;
151
+ }
152
+
153
+ .sp-container {
154
+ border-color: #dedede;
155
+ background: white;
156
+ box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.07);
157
+ }
158
+ .sp-input {
159
+ border-radius: 0;
160
+ border-color: #dedede;
161
+ box-shadow: 5px 5px #F0F0F0 inset;
162
+ border-style: solid;
163
+ background: #f5f5f5;
164
+ outline: none;
165
+ }
166
+ .sp-color, .sp-hue, .sp-clear {
167
+ border-color: #dedede;
168
+ }
169
+ .sp-alpha-inner {
170
+ border-color: #dedede;
171
+ }
172
+ .sp-alpha-handle {
173
+ border-color: #AAAAAA;
174
+ }
175
+ .sp-container button {
176
+ border-radius: 0;
177
+ background: #FFF;
178
+ border: none;
179
+ border-bottom: solid 2px #F3F3F3;
180
+ color: #444;
181
+ outline: solid 1px #DEDEDE;
182
+ font-size: 13px;
183
+ text-shadow: none;
184
+ padding: 7px 13px;
185
+ }
186
+ .sp-container button:hover {
187
+ background: #F7F7F7;
188
+ text-shadow: none;
189
+ border: none;
190
+ border-bottom: solid 2px #F3F3F3;
191
+ }
192
+
193
+ /**
194
+ * code mirror
195
+ */
196
+
197
+ .CodeMirror{
198
+ height: 100%;
199
+ border: solid 1px #dedede;
200
+ }
admin/views/slider-panel/css/msp-style.css ADDED
@@ -0,0 +1,1132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
1
+ /**
2
+ * Master Slider Panel
3
+ * Core style sheet file
4
+ * @version 1.0
5
+ * @autor averta
6
+ */
7
+ .msp-container{
8
+ min-width: 920px;
9
+ }
10
+
11
+ .msp-clearboth{clear: both;}
12
+
13
+ #msp-header{
14
+ background: white;
15
+ height: 80px;
16
+ margin-bottom: 20px;
17
+ margin-top: 20px;
18
+ padding: 0;
19
+ }
20
+
21
+ .msp-logo img{
22
+ margin: 14px 0 0 14px;
23
+ }
24
+
25
+ .msp-loading {
26
+ padding: 20px;
27
+ background: white;
28
+ margin-bottom: 20px;
29
+ color:gray;
30
+ }
31
+
32
+ .msp-loading>img{
33
+ vertical-align: middle;
34
+ }
35
+
36
+ .msp-shortcode-cont {
37
+ padding: 20px;
38
+ background: white;
39
+ margin-bottom: 20px;
40
+ }
41
+
42
+ .msp-shortcode-box{
43
+ display: inline-block;
44
+ }
45
+
46
+ .msp-shortcode-box >input {
47
+ padding: 0px 10px !important;
48
+ margin-right: 20px;
49
+ background: #F8F8F8;
50
+ color: #858585;
51
+ cursor: text;
52
+ font-size: 0.9em;
53
+ height: 27px !important;
54
+ }
55
+
56
+ .msp-error-cont {
57
+ padding: 20px;
58
+ background: white;
59
+ }
60
+
61
+ /* Icons */
62
+ .msp-ico { background: url(../images/ui-spritesheet.png) no-repeat; display: inline-block;}
63
+ .msp-ico-settings {
64
+ background-position: -1px -1px;
65
+ width: 16px;
66
+ height: 16px;
67
+ }
68
+
69
+ .msp-ico-slides {
70
+ width: 24px;
71
+ height: 17px;
72
+ background-position: -1px -25px;
73
+ }
74
+
75
+ .msp-ico-api {
76
+ background-position: -1px -51px;
77
+ width: 28px;
78
+ height: 17px;
79
+ }
80
+
81
+ .msp-ico-controls {
82
+ background-position: -1px -76px;
83
+ height: 17px;
84
+ width: 26px;
85
+ }
86
+
87
+ .msp-ico-grayadd {
88
+ width: 13px;
89
+ height: 13px;
90
+ background-position: -126px -51px;
91
+ }
92
+
93
+ .msp-ico-grayremove {
94
+ width: 15px;
95
+ height: 15px;
96
+ background-position: -199px -24px;
97
+ }
98
+
99
+ .msp-ico-whitehide {
100
+ width: 18px;
101
+ height: 18px;
102
+ background-position: -98px -21px;
103
+ }
104
+
105
+ .msp-ico-whiteduplicate {
106
+ width: 18px; height: 18px;
107
+ background-position: -122px -23px;
108
+ }
109
+
110
+ .msp-ico-whiteremove {
111
+ width: 18px; height: 18px;
112
+ background-position: -147px -23px;
113
+ }
114
+
115
+ .msp-ico-grayaddlarge {
116
+ width: 21px;
117
+ height: 21px;
118
+ background-position: -101px -51px;
119
+ }
120
+
121
+ .msp-ico-altop {
122
+ background-position: -76px -1px;
123
+ width: 15px;
124
+ height: 14px;
125
+ }
126
+ .msp-ico-almid {
127
+ background-position: -100px -1px;
128
+ width: 19px;
129
+ height: 13px;
130
+ }
131
+ .msp-ico-albot {
132
+ background-position: -124px -1px; width: 19px;
133
+ height: 14px;
134
+ }
135
+ .msp-ico-alleft {
136
+ background-position: -148px -1px; width: 19px;
137
+ height: 15px;
138
+ }
139
+ .msp-ico-alcenter {
140
+ background-position: -197px -1px;
141
+ width: 19px;
142
+ height: 17px;
143
+ }
144
+ .msp-ico-alright {
145
+ background-position: -174px -1px; width: 19px; height: 15px;
146
+ }
147
+ .msp-ico.msp-ico-blackhide {
148
+ width: 16px;
149
+ height: 16px;
150
+ background-position: -174px -72px;
151
+ }
152
+ .msp-ico.msp-ico-blackiso {
153
+ width: 16px; height: 16px;
154
+ background-position: -123px -73px;
155
+ }
156
+ .msp-ico.msp-ico-blacklock {
157
+ width: 16px; height: 16px;
158
+ background-position: -148px -74px;
159
+ }
160
+ .msp-ico.msp-ico-graypoint {
161
+ width: 16px;
162
+ height: 16px;
163
+ background-position: -221px -21px;
164
+ }
165
+ .msp-ico.msp-ico-grayduplicate {
166
+ width: 15px;
167
+ height: 15px;
168
+ background-position: -224px -49px;
169
+ }
170
+
171
+ .msp-ico-whiteplay {
172
+ width: 8px;
173
+ height: 12px;
174
+ background-position: -176px -26px;
175
+ }
176
+
177
+ .msp-ico-whitepause {
178
+ width: 9px;
179
+ height: 13px;
180
+ background-position: -151px -151px;
181
+ }
182
+
183
+ .msp-ico-flickr {
184
+ background-position: -226px -152px;
185
+ width: 19px;
186
+ height: 19px;
187
+ }
188
+
189
+ .msp-ico-notice {
190
+ width: 17px;
191
+ height: 18px;
192
+ vertical-align: bottom;
193
+ padding-right: 10px;
194
+ background-position: -200px -176px;
195
+ }
196
+
197
+ .msp-ico.msp-ico-facebook {
198
+ width: 19px;
199
+ height: 19px;
200
+ background-position: -226px -200px;
201
+ }
202
+
203
+ .msp-ico-posts {
204
+ width: 17px;
205
+ vertical-align: top !important;
206
+ height: 20px;
207
+ top: -2px;
208
+ background-position: -226px -225px;
209
+ }
210
+
211
+ .msp-ico-wooc {
212
+ background-position: -176px -200px;
213
+ width: 19px;
214
+ height: 19px;
215
+ }
216
+
217
+ .msp-ico.msp-ico-whiteadd {
218
+ width: 12px;
219
+ height: 13px;
220
+ background-position: -101px -76px;
221
+ }
222
+
223
+ /*templates*/
224
+ .msp-templates-list {
225
+ overflow: auto;
226
+ position: absolute;
227
+ top: 124px;
228
+ bottom: 80px;
229
+ width: 100%;
230
+ padding-bottom: 20px;
231
+ }
232
+
233
+ .msp-template-figure {
234
+ float: left;
235
+ margin: 20px 0 0 20px;
236
+ width: 276px;
237
+ position: relative;
238
+ cursor: pointer;
239
+ }
240
+
241
+ .msp-template-figure>img {
242
+ border: solid 1px #dedede;
243
+ float: left;
244
+ width: 100%;
245
+ }
246
+
247
+ .msp-template-caption {
248
+ border: solid 1px #dedede;
249
+ text-align: center;
250
+ vertical-align: middle;
251
+ width: 100%;
252
+ float: left;
253
+ box-shadow: 0 -3px #F3F3F3 inset;
254
+ margin-top: -1px;
255
+ padding: 14px 0;
256
+ }
257
+
258
+ .msp-template-figure.selected>img {
259
+ border-color: #278AAE;
260
+ }
261
+
262
+ .selected .msp-template-caption {
263
+ background: #2ea2cc;
264
+ border-color: #278AAE;
265
+ color: white;
266
+ box-shadow: 0 -3px #278AAE inset;
267
+ }
268
+
269
+ .msp-templte-selected {
270
+ position: absolute;
271
+ top: 0;
272
+ right: -1px;
273
+ width: 22px;
274
+ height: 22px;
275
+ background: url(../images/ui-spritesheet.png) -194px -146px no-repeat #2EA2CC;
276
+ }
277
+
278
+ .msp-templates-bottom {
279
+ position: absolute;
280
+ border-top: solid 1px #dedede;
281
+ bottom: 15px;
282
+ width: 100%;
283
+ padding-top: 16px;
284
+ }
285
+
286
+ button.msp-tempalte-save {
287
+ width: 885px;
288
+ }
289
+
290
+ button.msp-applyeffect {
291
+ margin-right: 10px !important;
292
+ text-transform: uppercase;
293
+ font-weight: 900 !important;
294
+ border-bottom-width: 5px !important;
295
+ margin-left: 20px;
296
+ padding: 13px 0 10px;
297
+ width: 475px;
298
+ font-size: 15px;
299
+ }
300
+
301
+
302
+ /*Choose Template in slider Settings*/
303
+ .msp-choose-template>.msp-img-box {
304
+ float: left;
305
+ border: solid 1px #dedede;
306
+ width: 217px;
307
+ margin-right: 20px;
308
+ }
309
+ .msp-choose-template {
310
+ display: inline-block;
311
+ vertical-align: top;
312
+ }
313
+ .msp-choose-template>.msp-img-box>img {
314
+ display: block;
315
+ width: 100%;
316
+ cursor: pointer;
317
+ }
318
+ .float-left {
319
+ float: left;
320
+ }
321
+
322
+ .msp-template-name {
323
+ display: block;
324
+ font-weight: 600;
325
+ margin: 14px 0;
326
+ }
327
+
328
+
329
+
330
+ /*------------------------------*/
331
+ /* Main Navigation */
332
+ .msp-main-nav ul {list-style: none; margin:0;padding: 0;}
333
+ .msp-main-nav ul li a{
334
+ float: left;
335
+ padding: 14px 19px 0px;
336
+ height: 26px;
337
+ color:white;
338
+ font-weight: bolder;
339
+ text-transform: uppercase;
340
+ background-color: #2ea2cc;
341
+ margin-right: 1px;
342
+ border-bottom: solid 7px #2A95BC;
343
+ text-decoration: none;
344
+ display: block;
345
+ position: relative;
346
+ }
347
+
348
+ .msp-main-nav ul li a>.msp-ico{
349
+ display: inline-block;
350
+ margin-left: 10px;
351
+ vertical-align: bottom;
352
+ position: relative;
353
+ }
354
+
355
+ .msp-main-nav ul li a.active {
356
+ background: white;
357
+ border-bottom-color: white;
358
+ color: #222;
359
+ }
360
+
361
+ .msp-main-nav ul li a.active .msp-ico-settings { background-position: -51px -1px; }
362
+ .msp-main-nav ul li a.active .msp-ico-slides { background-position: -51px -25px; }
363
+ .msp-main-nav ul li a.active .msp-ico-api { background-position: -51px -51px; }
364
+ .msp-main-nav ul li a.active .msp-ico-controls { background-position: -51px -76px; }
365
+ .msp-main-nav ul li a.active .msp-ico-flickr { background-position: -251px -152px; }
366
+ .msp-main-nav ul li a.active .msp-ico-facebook { background-position: -250px -200px; }
367
+ .msp-main-nav ul li a.active .msp-ico-posts { background-position: -250px -225px; }
368
+ .msp-main-nav ul li a.active .msp-ico-wooc { background-position: -200px -200px; }
369
+
370
+ /* MSP Meta Box */
371
+
372
+ .msp-metabox {
373
+ background: white;
374
+ padding-bottom: 20px;
375
+ margin-bottom: 20px;
376
+ }
377
+
378
+ .msp-metabox-handle{
379
+ height: 50px;
380
+ border-bottom: solid 1px #f1f1f1;
381
+ padding: 0px 20px;
382
+ }
383
+
384
+ .msp-metabox-title{
385
+ font-weight: 400;
386
+ color: #2ea2cc;
387
+ margin: 0;
388
+ font-size: 1.2em;
389
+ /* text-transform: uppercase; */
390
+ position: relative;
391
+ top: 17px;
392
+ }
393
+
394
+ .msp-metabox-toggle{
395
+
396
+ }
397
+ .msp-metabox-toggle:before{
398
+
399
+ }
400
+
401
+ .msp-metabox-row{
402
+ margin: 0px 20px 0;
403
+ }
404
+
405
+ .msp-metabox-row h4{
406
+ margin: 20px 0 ;
407
+ font-size: 1em;
408
+ color: #777;
409
+ font-weight: 400;
410
+ }
411
+
412
+ .msp-metabox-regular{
413
+ margin-top:20px;
414
+ }
415
+
416
+ .msp-metabox-indented{
417
+ margin: 20px 0 0 30px;
418
+ }
419
+
420
+ .msp-metabox-hr {
421
+ margin: 20px 0;
422
+ border: none;
423
+ border-bottom: solid 1px #F1F1F1;
424
+ height: 0px;
425
+
426
+ background: none;
427
+ }
428
+
429
+ /* Metabox tabs*/
430
+
431
+ .msp-metabox-tabs .tabs,
432
+ .msp-metabox-tabs .tabs-content{
433
+ list-style: none;
434
+ padding:0;
435
+ }
436
+
437
+ .msp-metabox-tabs .msp-metabox-handle {
438
+ background: #777;
439
+ border-bottom: solid 5px #6e6e6e;
440
+ height: 45px;
441
+ padding-left: 0;
442
+ }
443
+ .msp-metabox-tabs .tabs li {
444
+ float: left;
445
+ }
446
+ .msp-metabox-tabs .tabs li a {
447
+ color: white;
448
+ padding: 0 20px;
449
+ border-right: solid 1px #FFF;
450
+ height: 50px; line-height: 50px;
451
+ display: block;
452
+ /* text-transform: uppercase; */
453
+ }
454
+ .msp-metabox-tabs .tabs li:last-child a {
455
+ border-right: none;
456
+ }
457
+ .msp-metabox-tabs .tabs li.active a {
458
+ background: white;
459
+ color: #2ea2cc;
460
+ border-bottom: solid 1px #f1f1f1;
461
+ height: 49px;
462
+ line-height: 49px;
463
+ }
464
+
465
+ /* Form Elements */
466
+
467
+ .msp-form-space{
468
+ display: inline-block;
469
+ width: 30px;
470
+ }
471
+
472
+ .msp-form-space-med{
473
+ display: inline-block;
474
+ width: 40px;
475
+ }
476
+
477
+ .msp-form-space-small{
478
+ display: inline-block;
479
+ width: 30px;
480
+ }
481
+
482
+ .msp-col-medium {
483
+ width: 80px;
484
+ text-align: right;
485
+ display: inline-block;
486
+ }
487
+
488
+ .msp-container input[type="text"]{
489
+ height: 34px;
490
+ background-color: #F5F5F5;
491
+ border: solid 1px #DEDEDE;
492
+ outline: 0;
493
+ padding: 0 7px;
494
+ box-shadow: 5px 5px #F0F0F0 inset;
495
+ -webkit-box-sizing: content-box;
496
+ -moz-box-sizing: content-box;
497
+ box-sizing: content-box;
498
+ display: inline-block;
499
+ vertical-align: middle;
500
+ }
501
+
502
+ .msp-path-input{
503
+ width:280px;
504
+ }
505
+
506
+ .msp-number-input{
507
+ width: 80px;
508
+ }
509
+
510
+ .msp-container label{
511
+ color:#444;
512
+ padding-right: 4px;
513
+ cursor: default;
514
+ }
515
+
516
+ .msp-container button {
517
+ background: white;
518
+ border: none;
519
+ border-bottom: solid 2px #f3f3f3;
520
+ color: #444;
521
+ outline: solid 1px #DEDEDE;
522
+ }
523
+
524
+ .msp-container button:hover {
525
+ background: #f3f3f3;
526
+ }
527
+
528
+ .msp-container button:active {
529
+ background: white;
530
+ }
531
+
532
+ .msp-container button.msp-regular {
533
+ height: 30px;
534
+ padding: 0px 25px;
535
+ }
536
+
537
+ .msp-container button.msp-blue-btn,
538
+ .msp-container .msp-blue-btn {
539
+ background: #2ea2cc;
540
+ border-bottom-color: #2a95bc;
541
+ color:white;
542
+ }
543
+
544
+ .msp-container .msp-blue-btn:hover {
545
+ background: #33AFDB;
546
+ }
547
+
548
+ .msp-container button.msp-gray-btn{
549
+ background: #777777;
550
+ border-bottom-color: #6e6e6e;
551
+ color: white;
552
+ }
553
+
554
+ .msp-container button.msp-med-btn{
555
+
556
+ }
557
+
558
+ button.msp-add-btn {
559
+ width: 36px;
560
+ height: 36px;
561
+ outline: 0;
562
+ background: #2EA2CC;
563
+ border-bottom: solid 3px #278AAE;
564
+ margin-right: 1px;
565
+ display: inline-block;
566
+ line-height: 38px;
567
+ vertical-align: bottom;
568
+ }
569
+
570
+ button.msp-add-btn:hover {
571
+ background: #2EA2CC;
572
+ border-bottom-color: #278AAE;
573
+ }
574
+
575
+ button.msp-add-btn.disabled {
576
+ background: #BDBDBD;
577
+ border-bottom-color: #A8A8A8;
578
+ cursor: default;
579
+ }
580
+ button.msp-add-btn.disabled:hover {
581
+ background: #BDBDBD; border-bottom-color: #A8A8A8;
582
+ }
583
+
584
+ button.msp-blue-medium-btn {
585
+ padding: 6px 17px;
586
+ outline: none;
587
+ background: #2EA2CC;
588
+ color: white;
589
+ border-bottom: solid 3px #278AAE;
590
+ }
591
+
592
+ button.msp-blue-medium-btn:hover {
593
+ background: #2EA2CC;
594
+ }
595
+
596
+
597
+ button.msp-save-changes {
598
+ font-weight: bolder;
599
+ padding: 8px 30px 6px;
600
+ border-bottom-width: 5px;
601
+ }
602
+
603
+ button.msp-remove-btn-med {
604
+ padding: 5px 20px 4px;
605
+ border-bottom-width: 4px;
606
+ }
607
+
608
+ .msp-add-dynamic-tags {
609
+ display: inline-block;
610
+ }
611
+
612
+ /* Position origin */
613
+ .msp-origin-control {
614
+ display: inline-block;
615
+ vertical-align: middle;
616
+ }
617
+
618
+ .msp-origin-control-disabled {
619
+ opacity: 0.3;
620
+ }
621
+
622
+ .msp-origin-control table td {
623
+ border: solid 1px #dedede;
624
+ padding: 0;
625
+ width: 9px;
626
+ height: 9px;
627
+ }
628
+
629
+ .msp-origin-btn:hover {
630
+ background: #F1F1F1;
631
+ }
632
+
633
+ .msp-origin-control-disabled .msp-origin-btn:hover {
634
+ background: #FFF;
635
+ }
636
+
637
+ .msp-origin-btn-selected,
638
+ .msp-origin-btn-selected:hover {
639
+ background: #2EA2CC;
640
+ border-color: #2EA2CC !important;
641
+ }
642
+
643
+ /* jQuery UI spinner custom style */
644
+ .ui-spinner {
645
+ position: relative;
646
+ display: inline-block;
647
+ vertical-align: middle;
648
+ }
649
+
650
+ .ui-spinner-button {
651
+ position: absolute;
652
+ display: block;
653
+ top: 1px;
654
+ right: 0;
655
+ color: #666;
656
+ background: url(../images/ui-spritesheet.png) #FFF no-repeat -221px -71px;
657
+ font-size: 10px;
658
+ border: solid 1px #dedede;
659
+ overflow: hidden;
660
+ border-top: none;
661
+ text-indent: 100%;
662
+ white-space: nowrap;
663
+ width: 17px;
664
+ height: 16px;
665
+ cursor: pointer;
666
+ }
667
+
668
+ .ui-spinner-input{
669
+ width: 55px;
670
+ }
671
+
672
+ .ui-spinner-button.ui-spinner-down {
673
+ top: auto;
674
+ bottom: 0px;
675
+ background-position: -196px -70px;
676
+ height: 16px;
677
+ }
678
+
679
+ .ui-spinner-button:hover {
680
+ background-color: #F5F5F5;
681
+ }
682
+
683
+ /*jQuery UI Dialog*/
684
+ .ui-dialog.msp-dialog {
685
+ position: fixed;
686
+ background: white;
687
+ border: solid 1px #dedede;
688
+ outline: none;
689
+ z-index: 410000;
690
+ padding: 0;
691
+ }
692
+
693
+ .ui-dialog.msp-dialog .ui-dialog-content{
694
+ padding: 0;
695
+ overflow: visible;
696
+ }
697
+
698
+ .ui-front {
699
+ z-index: 400000;
700
+ }
701
+
702
+ .ui-widget-overlay {
703
+ background: url(../images/patt.png) rgba(24, 24, 24, 0.89) !important;
704
+ opacity: 1 !important;
705
+ }
706
+
707
+ .msp-dialog.ui-dialog .ui-dialog-titlebar {
708
+ background: white;
709
+ padding: 0;
710
+ padding-left: 20px;
711
+ height: 45px;
712
+ border-bottom: solid 1px #dedede;
713
+ }
714
+
715
+ .msp-dialog button.ui-dialog-titlebar-close {
716
+ float: right;
717
+ background: url(../images/ui-spritesheet.png) -172px -147px !important;
718
+ border: none;
719
+ margin: 0;
720
+ padding: 0;
721
+ width: 20px;
722
+ height: 20px;
723
+ outline: none;
724
+ position: absolute;
725
+ top: 13px;
726
+ right: 13px;
727
+ cursor: pointer;
728
+ z-index: 200;
729
+ }
730
+
731
+ .msp-dialog button.ui-dialog-titlebar-close:hover {
732
+ outline: solid 1px #dedede;
733
+ }
734
+
735
+ .msp-dialog .ui-button-text {
736
+ display: block;
737
+ text-indent: 100%;
738
+ white-space: nowrap;
739
+ overflow: hidden;
740
+ }
741
+
742
+ .msp-dialog .ui-dialog-title {
743
+ font-weight: 400;
744
+ color: #2EA2CC;
745
+ margin: 0;
746
+ font-size: 1.2em;
747
+ position: relative;
748
+ top: 14px;
749
+ }
750
+
751
+
752
+ /* DDSlick Combobox styles*/
753
+ .msp-selectbox {
754
+ display: inline-block;
755
+ }
756
+
757
+ .dd-select {
758
+ border: solid 1px #dedede;
759
+ position:relative;
760
+ background: white !important;
761
+ cursor:pointer;
762
+ }
763
+
764
+ .dd-desc {
765
+ color:#aaa;
766
+ display:block;
767
+ overflow:hidden;
768
+ font-weight:400;
769
+ line-height:1.4em;
770
+ }
771
+
772
+ .dd-selected {
773
+ overflow:hidden;
774
+ display:block;
775
+ padding: 8px 10px 8px;
776
+ }
777
+ .dd-selected label{
778
+ vertical-align: top;
779
+ }
780
+ .dd-pointer {
781
+ width:0;
782
+ height:0;
783
+ position:absolute;
784
+ right:10px;
785
+ top: 53%;
786
+ margin-top:-3px;
787
+ }
788
+
789
+ .dd-pointer-down {
790
+ border:solid 5px transparent;
791
+ border-top: solid 5px #888;
792
+ }
793
+
794
+ .dd-pointer-up {
795
+ border:solid 5px transparent!important;
796
+ border-bottom: solid 5px #888!important;
797
+ margin-top:-8px;
798
+ }
799
+
800
+ .dd-options {
801
+ border:solid 1px #ccc;
802
+ border-top:none;
803
+ list-style:none;
804
+ display:none;
805
+ position:absolute;
806
+ z-index:2000;
807
+ background:#fff;
808
+ overflow:auto;
809
+ margin:0;
810
+ padding:0;
811
+
812
+ box-shadow: 4px 4px 4px -3px rgba(0, 0, 0, 0.17);
813
+ }
814
+
815
+ .dd-option {
816
+ display:block;
817
+ border-bottom:solid 1px #ddd;
818
+ overflow:hidden;
819
+ text-decoration:none;
820
+ color:#333;
821
+ cursor:pointer;
822
+ -webkit-transition:all .25s ease-in-out;
823
+ -moz-transition:all .25s ease-in-out;
824
+ -o-transition:all .25s ease-in-out;
825
+ -ms-transition:all .25s ease-in-out;
826
+ padding:10px;
827
+ }
828
+
829
+ .dd-options > li:last-child > .dd-option {
830
+ border-bottom:none;
831
+ }
832
+
833
+ .dd-option:hover {
834
+ background:#f3f3f3;
835
+ color:#000;
836
+ }
837
+
838
+ .dd-selected-description-truncated {
839
+ text-overflow:ellipsis;
840
+ white-space:nowrap;
841
+ }
842
+
843
+ .dd-option-selected {background:#f6f6f6;}
844
+
845
+ .dd-option-image,.dd-selected-image {
846
+ vertical-align:middle;
847
+ float:left;
848
+ margin-right:5px;
849
+ max-width:64px;
850
+ }
851
+
852
+ .dd-image-right {
853
+ float:right;
854
+ margin-right:15px;
855
+ margin-left:5px;
856
+ }
857
+
858
+ .dd-container { display: inline-block; vertical-align: middle;}
859
+
860
+ .dd-selected-text {font-weight: 400;}
861
+
862
+ /*TinyMCE Reset Buttons*/
863
+ .msp-wp-editor button{
864
+ border:none;
865
+ background-color:transparent;
866
+ outline: 0;
867
+ }
868
+
869
+
870
+
871
+ /* MSP Image Select */
872
+ .msp-imgselect {
873
+ display: inline-block;
874
+ vertical-align: top;
875
+ width: 146px;
876
+ position: relative;
877
+ height: 67px;
878
+ border: solid 1px #dedede;
879
+ }
880
+
881
+ .msp-imgselect-preview {
882
+ width: 100%;
883
+ height: 100%;
884
+ background: center no-repeat white;
885
+ }
886
+
887
+ .msp-img-cont {
888
+ height: 100%;
889
+ float: left;
890
+ width: 106px;
891
+ border-right: solid 1px #dedede;
892
+ overflow: hidden;
893
+ background: url(../images/ui-spritesheet.png) -1px -151px;
894
+ }
895
+
896
+ button.msp-img-btn {
897
+ position: absolute;
898
+ height: 67px;
899
+ border-bottom: solid 2px #F3F3F3;
900
+ width: 39px;
901
+ right: 0;
902
+ outline: 0;
903
+ cursor: pointer;
904
+ }
905
+
906
+ .msp-img-btn .msp-ico-grayadd,
907
+ .msp-img-btn .msp-ico-grayremove {
908
+ display: inline-block;
909
+ vertical-align: bottom;
910
+ }
911
+
912
+ /* Fill Mode Dropdown */
913
+ .msp-fill-dd {
914
+ display: inline-block;
915
+ vertical-align: top;
916
+ }
917
+ .msp-fill-dd .dd-select {
918
+ padding: 8px 0px;
919
+ }
920
+
921
+ .msp-fill-dd .dd-selected>label {
922
+ padding-top: 12px;
923
+ display: inline-block;
924
+ line-height: 100% !important;
925
+ }
926
+ .msp-fill-dd label {
927
+ margin-left: 4px;
928
+ }
929
+
930
+ /* Manage Slides */
931
+
932
+ .msp-slides {
933
+ list-style: none;
934
+ padding: 0;
935
+ }
936
+ .msp-slides>li {
937
+ float: left;
938
+ }
939
+ .msp-slideframe ul {
940
+ list-style: none;
941
+ }
942
+ .msp-slideframe ul li {
943
+ float: left;
944
+ }
945
+
946
+ .msp-frame-slideorder {
947
+ color: white;
948
+ display: block;
949
+ position: absolute;
950
+ bottom: 5px;
951
+ font-size: 12px;
952
+ font-weight: 600;
953
+ left: 7px;
954
+ cursor: move;
955
+ }
956
+ .msp-ico-whiteshow { opacity: 0.5; }
957
+
958
+ .msp-container .msp-frames-srtplaceholder {
959
+ width: 106px;
960
+ height: 99px;
961
+ border: solid 1px #dedede;
962
+ margin: 20px 20px 0 0;
963
+ background: #f1f1f1;
964
+
965
+ }
966
+
967
+ .msp-slideframe {
968
+ position: relative;
969
+ width: 106px;
970
+ height: 98px;
971
+ border: solid 1px #777;
972
+ border-bottom: solid 2px #656565;
973
+ margin: 20px 20px 0 0;
974
+ background: #777;
975
+ }
976
+
977
+ .msp-slideframe.active {
978
+ border-color: #2ea2cc;
979
+ border-bottom-color: #278aae;
980
+ background: #2ea2cc;
981
+ }
982
+
983
+
984
+ .msp-slideframe .msp-img-cont {
985
+ background-color: white;
986
+ height: 67px;
987
+ border: none;
988
+ }
989
+
990
+ .msp-framehandle {
991
+ position: absolute;
992
+ bottom: 5px;
993
+ right: 5px;
994
+ }
995
+
996
+ .msp-framehandle .msp-ico {
997
+ display: block;
998
+ }
999
+
1000
+ /* Add Slide Btn*/
1001
+
1002
+ .msp-addslide {
1003
+ width: 106px;
1004
+ height: 98px;
1005
+ border: dashed 1px #777;
1006
+ cursor: pointer;
1007
+ margin: 20px 20px 0 0;
1008
+ }
1009
+
1010
+ .msp-addslide .msp-ico-grayaddlarge {
1011
+ display: block;
1012
+ margin: 40px auto 5px;
1013
+ }
1014
+
1015
+ .msp-addslide-label {
1016
+ width: 100%;
1017
+ text-align: center;
1018
+ display: inline-block;
1019
+ color: #444;
1020
+ }
1021
+
1022
+ /* Align Btns */
1023
+
1024
+ .msp-align-btns {
1025
+ display: inline-block;
1026
+ vertical-align: middle;
1027
+ width: 220px;
1028
+ }
1029
+ .msp-btn-space {
1030
+ width: 20px;
1031
+ height: 1px;
1032
+ float: left;
1033
+ }
1034
+
1035
+ .msp-align-btn {
1036
+ width: 32px !important;
1037
+ height: 32px;
1038
+ float: left;
1039
+ }
1040
+
1041
+ .msp-align-btn .msp-ico {
1042
+ display: inline-block;
1043
+ vertical-align: bottom;
1044
+ }
1045
+
1046
+ /*Stage*/
1047
+ .msp-stage-top-toolbar{
1048
+ margin-top: 10px;
1049
+ }
1050
+
1051
+ .msp-slide-stage {
1052
+ position: relative;
1053
+ border: solid 1px #DEDEDE;
1054
+ margin: 0px auto;
1055
+ overflow: hidden;
1056
+ color: black;
1057
+ }
1058
+
1059
+ .msp-stage-msg {
1060
+ padding: 10px 20px;
1061
+ background: rgb(255, 255, 255);
1062
+ margin-bottom: -20px;
1063
+ margin-top: 20px;
1064
+ border-top: solid 1px #f1f1f1;
1065
+ }
1066
+
1067
+ /*disable native selection*/
1068
+ .msp-slide-stage, .msp-slide-stage *{
1069
+ -webkit-user-select: none;
1070
+ -moz-user-select: none;
1071
+ -ms-user-select: none;
1072
+ user-select: none;
1073
+ }
1074
+
1075
+ .msp-stage-snapbox{
1076
+ position: absolute;
1077
+ z-index: 0;
1078
+ width: 100%;
1079
+ height: 100%;
1080
+ top: 0;
1081
+ }
1082
+
1083
+ /* reset default styles in stage */
1084
+ .msp-slide-stage p , .msp-slide-stage h1 , .msp-slide-stage h2 ,
1085
+ .msp-slide-stage h3 , .msp-slide-stage h4 , .msp-slide-stage h5
1086
+ {margin: 0; padding:0; font:inherit; color:inherit;}
1087
+
1088
+ .msp-stage-bg{
1089
+ overflow: hidden;
1090
+ width: 100%;
1091
+ height: 100%;
1092
+ }
1093
+
1094
+ .msp-stage-bg>img{
1095
+ position: relative;
1096
+ }
1097
+
1098
+ @-webkit-keyframes pulse {
1099
+ 0% { outline-color: rgba(0, 0, 204,0.2); }
1100
+ 50% { outline-color: rgba(0, 0, 204,1); }
1101
+ 100% { outline-color: rgba(0, 0, 204,0.2); }
1102
+ }
1103
+
1104
+ /*Slider controls*/
1105
+ .msp-control-btn {
1106
+ float: left;
1107
+ background: #777777;
1108
+ margin-right: 10px;
1109
+ color: white;
1110
+ padding: 0px 30px 0px 0px;
1111
+ border-bottom: solid 3px #656565;
1112
+ position: relative;
1113
+ cursor: default;
1114
+ margin-top: 10px;
1115
+ }
1116
+
1117
+ .msp-control-btn:hover {
1118
+ background: #818181;
1119
+ }
1120
+
1121
+ .msp-control-removes {
1122
+ position: absolute;
1123
+ right: 7px;
1124
+ top: 5px;
1125
+ }
1126
+
1127
+ .msp-control-label {
1128
+ display: block;
1129
+ float: left;
1130
+ border-right: solid 1px #FFF;
1131
+ padding: 5px 16px;
1132
+ }
admin/views/slider-panel/css/reset.css ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*==============================================================
2
+ $CSS Reset & Clearfix
3
+ *==============================================================*/
4
+ html,body { height:100%;}
5
+ .msp-container select,.msp-container input,.msp-container textarea,.msp-container button { font:99% sans-serif; }
6
+ .msp-container pre,.msp-container code,.msp-container kbd,.msp-container samp { font-family: monospace, sans-serif; }
7
+ .msp-container code, .msp-container kbd, .msp-container samp { word-wrap: break-word;line-height: 1.6; }
8
+ .msp-container html { overflow-y: scroll; height: 100%;}
9
+ .msp-container a { text-decoration: none; }
10
+ .msp-container a:hover, .msp-container a:active, .msp-container a:focus { outline: none; }
11
+ .msp-container ul,.msp-container ol { margin: 0;} .msp-container ol { list-style-type: decimal; }
12
+ .msp-container nav ul,.msp-container nav li { margin: 0; list-style:none; list-style-image: none; }
13
+ .msp-container small { font-size: 85%; } .msp-container strong,.msp-container th { font-weight: bold; } .msp-container td { vertical-align: top; }
14
+ .msp-container sub, .msp-container sup { font-size: 75%; line-height: 0; position: relative; } .msp-container sup { top: -0.5em; } .msp-container sub { bottom: -0.25em; }
15
+ .msp-container pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; padding: 15px; }
16
+ .msp-container textarea { overflow: auto; }
17
+ .msp-container .ie6 legend,.msp-container .ie7 legend { margin-left: -7px; }
18
+ .msp-container input[type="radio"] { vertical-align: text-bottom; }
19
+ .msp-container input[type="checkbox"] { vertical-align: bottom; }
20
+ .msp-container input[type=search] { -webkit-appearance: none; }
21
+ .msp-container input[type="search"]::-webkit-search-decoration,.msp-container input[type="search"]::-webkit-search-cancel-button {display: none;}
22
+ .msp-container .ie7 input[type="checkbox"] { vertical-align: baseline; }
23
+ .msp-container .ie6 input { vertical-align: text-bottom; }
24
+ .msp-container label,.msp-container input[type="button"],.msp-container input[type="submit"],.msp-container input[type="image"],.msp-container button { cursor: pointer; }
25
+ .msp-container button, .msp-container input,.msp-container select,.msp-container textarea { margin: 0; }
26
+ .msp-container input:valid, .msp-container textarea:valid { }
27
+ .msp-container input:invalid,.msp-container textarea:invalid {
28
+ border-radius: 1px; -moz-box-shadow: 0px 0px 5px red; -webkit-box-shadow: 0px 0px 5px red; box-shadow: 0px 0px 5px red;}
29
+ .msp-container .no-boxshadow input:invalid, .msp-container .no-boxshadow textarea:invalid { background-color: #f0dddd; }
30
+ .msp-container ::-moz-selection{ background: #FF5E99; color:#fff; text-shadow: none; }
31
+ .msp-container a:link { -webkit-tap-highlight-color: #FF5E99; }
32
+ .msp-container button { width: auto; overflow: visible; }
33
+ /**
34
+ ======================================
35
+ $Domument
36
+ ======================================*/
37
+ /*-----------------
38
+ $Body
39
+ -----------------*/
40
+ .msp-container {}
41
+ .msp-container,
42
+ .msp-container select,
43
+ .msp-container input,
44
+ .msp-container textarea {
45
+ color: #666;
46
+ -webkit-font-smoothing: antialiased; /* Fix for webkit rendering */
47
+ -webkit-text-size-adjust: 100%;
48
+ }
49
+ .msp-container li { margin:0; }
50
+
51
+ .msp-container .ie7 img { -ms-interpolation-mode: bicubic; }
52
+ .msp-container .hidden { display: none !important; }
53
+ .msp-container .left { float: left; }
54
+ .msp-container .right { float: right; }
55
+ .msp-container .center { margin-left: auto; margin-right: auto; display: block; clear: both; }
56
+ .clear { clear: both; display: block; font-size: 0; height: 0; line-height: 0; width:100%;}
57
+ /*-----------------
admin/views/slider-panel/css/spectrum.css ADDED
@@ -0,0 +1,496 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /***
2
+ Spectrum Colorpicker v1.3.2
3
+ https://github.com/bgrins/spectrum
4
+ Author: Brian Grinstead
5
+ License: MIT
6
+ ***/
7
+
8
+ .sp-container {
9
+ position:absolute;
10
+ top:0;
11
+ left:0;
12
+ display:inline-block;
13
+ *display: inline;
14
+ *zoom: 1;
15
+ /* https://github.com/bgrins/spectrum/issues/40 */
16
+ z-index: 9999994;
17
+ overflow: hidden;
18
+ }
19
+ .sp-container.sp-flat {
20
+ position: relative;
21
+ }
22
+
23
+ /* Fix for * { box-sizing: border-box; } */
24
+ .sp-container,
25
+ .sp-container * {
26
+ -webkit-box-sizing: content-box;
27
+ -moz-box-sizing: content-box;
28
+ box-sizing: content-box;
29
+ }
30
+
31
+ /* http://ansciath.tumblr.com/post/7347495869/css-aspect-ratio */
32
+ .sp-top {
33
+ position:relative;
34
+ width: 100%;
35
+ display:inline-block;
36
+ }
37
+ .sp-top-inner {
38
+ position:absolute;
39
+ top:0;
40
+ left:0;
41
+ bottom:0;
42
+ right:0;
43
+ }
44
+ .sp-color {
45
+ position: absolute;
46
+ top:0;
47
+ left:0;
48
+ bottom:0;
49
+ right:20%;
50
+ }
51
+ .sp-hue {
52
+ position: absolute;
53
+ top:0;
54
+ right:0;
55
+ bottom:0;
56
+ left:84%;
57
+ height: 100%;
58
+ }
59
+
60
+ .sp-clear-enabled .sp-hue {
61
+ top:33px;
62
+ height: 77.5%;
63
+ }
64
+
65
+ .sp-fill {
66
+ padding-top: 80%;
67
+ }
68
+ .sp-sat, .sp-val {
69
+ position: absolute;
70
+ top:0;
71
+ left:0;
72
+ right:0;
73
+ bottom:0;
74
+ }
75
+
76
+ .sp-alpha-enabled .sp-top {
77
+ margin-bottom: 18px;
78
+ }
79
+ .sp-alpha-enabled .sp-alpha {
80
+ display: block;
81
+ }
82
+ .sp-alpha-handle {
83
+ position:absolute;
84
+ top:-4px;
85
+ bottom: -4px;
86
+ width: 6px;
87
+ left: 50%;
88
+ cursor: pointer;
89
+ border: 1px solid black;
90
+ background: white;
91
+ opacity: .8;
92
+ }
93
+ .sp-alpha {
94
+ display: none;
95
+ position: absolute;
96
+ bottom: -14px;
97
+ right: 0;
98
+ left: 0;
99
+ height: 8px;
100
+ }
101
+ .sp-alpha-inner {
102
+ border: solid 1px #333;
103
+ }
104
+
105
+ .sp-clear {
106
+ display: none;
107
+ }
108
+
109
+ .sp-clear.sp-clear-display {
110
+ background-position: center;
111
+ }
112
+
113
+ .sp-clear-enabled .sp-clear {
114
+ display: block;
115
+ position:absolute;
116
+ top:0px;
117
+ right:0;
118
+ bottom:0;
119
+ left:84%;
120
+ height: 28px;
121
+ }
122
+
123
+ /* Don't allow text selection */
124
+ .sp-container, .sp-replacer, .sp-preview, .sp-dragger, .sp-slider, .sp-alpha, .sp-clear, .sp-alpha-handle, .sp-container.sp-dragging .sp-input, .sp-container button {
125
+ -webkit-user-select:none;
126
+ -moz-user-select: -moz-none;
127
+ -o-user-select:none;
128
+ user-select: none;
129
+ }
130
+
131
+ .sp-container.sp-input-disabled .sp-input-container {
132
+ display: none;
133
+ }
134
+ .sp-container.sp-buttons-disabled .sp-button-container {
135
+ display: none;
136
+ }
137
+ .sp-palette-only .sp-picker-container {
138
+ display: none;
139
+ }
140
+ .sp-palette-disabled .sp-palette-container {
141
+ display: none;
142
+ }
143
+
144
+ .sp-initial-disabled .sp-initial {
145
+ display: none;
146
+ }
147
+
148
+
149
+ /* Gradients for hue, saturation and value instead of images. Not pretty... but it works */
150
+ .sp-sat {
151
+ background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));
152
+ background-image: -webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));
153
+ background-image: -moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
154
+ background-image: -o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
155
+ background-image: -ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
156
+ background-image: linear-gradient(to right, #fff, rgba(204, 154, 129, 0));
157
+ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";
158
+ filter : progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr='#FFFFFFFF', endColorstr='#00CC9A81');
159
+ }
160
+ .sp-val {
161
+ background-image: -webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));
162
+ background-image: -webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));
163
+ background-image: -moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
164
+ background-image: -o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
165
+ background-image: -ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
166
+ background-image: linear-gradient(to top, #000, rgba(204, 154, 129, 0));
167
+ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";
168
+ filter : progid:DXImageTransform.Microsoft.gradient(startColorstr='#00CC9A81', endColorstr='#FF000000');
169
+ }
170
+
171
+ .sp-hue {
172
+ background: -moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
173
+ background: -ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
174
+ background: -o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
175
+ background: -webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));
176
+ background: -webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
177
+ }
178
+
179
+ /* IE filters do not support multiple color stops.
180
+ Generate 6 divs, line them up, and do two color gradients for each.
181
+ Yes, really.
182
+ */
183
+ .sp-1 {
184
+ height:17%;
185
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000', endColorstr='#ffff00');
186
+ }
187
+ .sp-2 {
188
+ height:16%;
189
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff00', endColorstr='#00ff00');
190
+ }
191
+ .sp-3 {
192
+ height:17%;
193
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ffff');
194
+ }
195
+ .sp-4 {
196
+ height:17%;
197
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffff', endColorstr='#0000ff');
198
+ }
199
+ .sp-5 {
200
+ height:16%;
201
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0000ff', endColorstr='#ff00ff');
202
+ }
203
+ .sp-6 {
204
+ height:17%;
205
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ff', endColorstr='#ff0000');
206
+ }
207
+
208
+ .sp-hidden {
209
+ display: none !important;
210
+ }
211
+
212
+ /* Clearfix hack */
213
+ .sp-cf:before, .sp-cf:after { content: ""; display: table; }
214
+ .sp-cf:after { clear: both; }
215
+ .sp-cf { *zoom: 1; }
216
+
217
+ /* Mobile devices, make hue slider bigger so it is easier to slide */
218
+ @media (max-device-width: 480px) {
219
+ .sp-color { right: 40%; }
220
+ .sp-hue { left: 63%; }
221
+ .sp-fill { padding-top: 60%; }
222
+ }
223
+ .sp-dragger {
224
+ border-radius: 5px;
225
+ height: 5px;
226
+ width: 5px;
227
+ border: 1px solid #fff;
228
+ background: #000;
229
+ cursor: pointer;
230
+ position:absolute;
231
+ top:0;
232
+ left: 0;
233
+ }
234
+ .sp-slider {
235
+ position: absolute;
236
+ top:0;
237
+ cursor:pointer;
238
+ height: 3px;
239
+ left: -1px;
240
+ right: -1px;
241
+ border: 1px solid #000;
242
+ background: white;
243
+ opacity: .8;
244
+ }
245
+
246
+ /*
247
+ Theme authors:
248
+ Here are the basic themeable display options (colors, fonts, global widths).
249
+ See http://bgrins.github.io/spectrum/themes/ for instructions.
250
+ */
251
+
252
+ .sp-container {
253
+ border-radius: 0;
254
+ background-color: #ECECEC;
255
+ border: solid 1px #f0c49B;
256
+ padding: 0;
257
+ }
258
+ .sp-container, .sp-container button, .sp-container input, .sp-color, .sp-hue, .sp-clear
259
+ {
260
+ font: normal 12px "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
261
+ -webkit-box-sizing: border-box;
262
+ -moz-box-sizing: border-box;
263
+ -ms-box-sizing: border-box;
264
+ box-sizing: border-box;
265
+ }
266
+ .sp-top
267
+ {
268
+ margin-bottom: 3px;
269
+ }
270
+ .sp-color, .sp-hue, .sp-clear
271
+ {
272
+ border: solid 1px #666;
273
+ }
274
+
275
+ /* Input */
276
+ .sp-input-container {
277
+ float:right;
278
+ width: 100px;
279
+ margin-bottom: 4px;
280
+ }
281
+ .sp-initial-disabled .sp-input-container {
282
+ width: 100%;
283
+ }
284
+ .sp-input {
285
+ font-size: 12px !important;
286
+ border: 1px inset;
287
+ padding: 4px 5px;
288
+ margin: 0;
289
+ width: 100%;
290
+ background:transparent;
291
+ border-radius: 3px;
292
+ color: #222;
293
+ }
294
+ .sp-input:focus {
295
+ border: 1px solid orange;
296
+ }
297
+ .sp-input.sp-validation-error
298
+ {
299
+ border: 1px solid red;
300
+ background: #fdd;
301
+ }
302
+ .sp-picker-container , .sp-palette-container
303
+ {
304
+ float:left;
305
+ position: relative;
306
+ padding: 10px;
307
+ padding-bottom: 300px;
308
+ margin-bottom: -290px;
309
+ }
310
+ .sp-picker-container
311
+ {
312
+ width: 172px;
313
+ border-left: solid 1px #fff;
314
+ }
315
+
316
+ /* Palettes */
317
+ .sp-palette-container
318
+ {
319
+ border-right: solid 1px #ccc;
320
+ }
321
+
322
+ .sp-palette .sp-thumb-el {
323
+ display: block;
324
+ position:relative;
325
+ float:left;
326
+ width: 24px;
327
+ height: 15px;
328
+ margin: 3px;
329
+ cursor: pointer;
330
+ border:solid 2px transparent;
331
+ }
332
+ .sp-palette .sp-thumb-el:hover, .sp-palette .sp-thumb-el.sp-thumb-active {
333
+ border-color: orange;
334
+ }
335
+ .sp-thumb-el
336
+ {
337
+ position:relative;
338
+ }
339
+
340
+ /* Initial */
341
+ .sp-initial
342
+ {
343
+ float: left;
344
+ border: solid 1px #333;
345
+ }
346
+ .sp-initial span {
347
+ width: 30px;
348
+ height: 25px;
349
+ border:none;
350
+ display:block;
351
+ float:left;
352
+ margin:0;
353
+ }
354
+
355
+ .sp-initial .sp-clear-display {
356
+ background-position: center;
357
+ }
358
+
359
+ /* Buttons */
360
+ .sp-button-container {
361
+ float: right;
362
+ }
363
+
364
+ /* Replacer (the little preview div that shows up instead of the <input>) */
365
+ .sp-replacer {
366
+ margin:0;
367
+ overflow:hidden;
368
+ cursor:pointer;
369
+ padding: 4px;
370
+ display:inline-block;
371
+ *zoom: 1;
372
+ *display: inline;
373
+ border: solid 1px #91765d;
374
+ background: #eee;
375
+ color: #333;
376
+ vertical-align: middle;
377
+ }
378
+ .sp-replacer:hover, .sp-replacer.sp-active {
379
+ border-color: #F0C49B;
380
+ color: #111;
381
+ }
382
+ .sp-replacer.sp-disabled {
383
+ cursor:default;
384
+ border-color: silver;
385
+ color: silver;
386
+ }
387
+ .sp-dd {
388
+ padding: 2px 0;
389
+ height: 16px;
390
+ line-height: 16px;
391
+ float:left;
392
+ font-size:10px;
393
+ }
394
+ .sp-preview
395
+ {
396
+ position:relative;
397
+ width:25px;
398
+ height: 20px;
399
+ border: solid 1px #222;
400
+ margin-right: 5px;
401
+ float:left;
402
+ z-index: 0;
403
+ }
404
+
405
+ .sp-palette
406
+ {
407
+ *width: 220px;
408
+ max-width: 220px;
409
+ }
410
+ .sp-palette .sp-thumb-el
411
+ {
412
+ width:16px;
413
+ height: 16px;
414
+ margin:2px 1px;
415
+ border: solid 1px #d0d0d0;
416
+ }
417
+
418
+ .sp-container
419
+ {
420
+ padding-bottom:0;
421
+ }
422
+
423
+
424
+ /* Buttons: http://hellohappy.org/css3-buttons/ */
425
+ .sp-container button {
426
+ border: 1px solid #ccc;
427
+ border-bottom: 1px solid #bbb;
428
+ border-radius: 3px;
429
+ color: #333;
430
+ font-size: 14px;
431
+ line-height: 1;
432
+ padding: 5px 4px;
433
+ text-align: center;
434
+ text-shadow: 0 1px 0 #eee;
435
+ vertical-align: middle;
436
+ }
437
+ .sp-container button:hover {
438
+ cursor: pointer;
439
+ }
440
+
441
+ .sp-cancel
442
+ {
443
+ font-size: 11px;
444
+ color: #d93f3f !important;
445
+ margin:0;
446
+ padding:2px;
447
+ margin-right: 5px;
448
+ vertical-align: middle;
449
+ text-decoration:none;
450
+
451
+ }
452
+ .sp-cancel:hover
453
+ {
454
+ color: #d93f3f !important;
455
+ text-decoration: underline;
456
+ }
457
+
458
+
459
+ .sp-palette span:hover, .sp-palette span.sp-thumb-active
460
+ {
461
+ border-color: #000;
462
+ }
463
+
464
+ .sp-preview, .sp-alpha, .sp-thumb-el
465
+ {
466
+ position:relative;
467
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);
468
+ }
469
+ .sp-preview-inner, .sp-alpha-inner, .sp-thumb-inner
470
+ {
471
+ display:block;
472
+ position:absolute;
473
+ top:0;left:0;bottom:0;right:0;
474
+ }
475
+
476
+ .sp-palette .sp-thumb-inner
477
+ {
478
+ background-position: 50% 50%;
479
+ background-repeat: no-repeat;
480
+ }
481
+
482
+ .sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner
483
+ {
484
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=);
485
+ }
486
+
487
+ .sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner
488
+ {
489
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=);
490
+ }
491
+
492
+ .sp-clear-display {
493
+ background-repeat:no-repeat;
494
+ background-position: center;
495
+ background-image: url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+P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EYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==);
496
+ }
admin/views/slider-panel/images/center.png ADDED
Binary file
admin/views/slider-panel/images/fill.png ADDED
Binary file
admin/views/slider-panel/images/fit.png ADDED
Binary file
admin/views/slider-panel/images/help.png ADDED
Binary file
admin/views/slider-panel/images/loading.gif ADDED
Binary file
admin/views/slider-panel/images/masterslider.gif ADDED
Binary file
admin/views/slider-panel/images/no-color.gif ADDED
Binary file
admin/views/slider-panel/images/patt.png ADDED
Binary file
admin/views/slider-panel/images/stretch.png ADDED
Binary file
admin/views/slider-panel/images/tile.png ADDED
Binary file
admin/views/slider-panel/images/ui-spritesheet.png ADDED
Binary file
admin/views/slider-panel/index.php ADDED
@@ -0,0 +1,654 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Represents the view for slider panel.
4
+ *
5
+ * @package MasterSlider Lite
6
+ * @author averta [averta.net]
7
+ * @license LICENSE.txt
8
+ * @link http://masterslider.com
9
+ * @copyright Copyright © 2014 averta
10
+ */
11
+
12
+ ?>
13
+
14
+ <!-- markup for slider panel page here. -->
15
+ <div id="msp-header">
16
+ <div class="msp-logo"><a href="?page=masterslider"><img src="<?php echo MSWP_AVERTA_ADMIN_URL . '/views/slider-panel'; ?>/images/masterslider.gif" ></a></div>
17
+ </div>
18
+ <div id="panelLoading" class="msp-loading">
19
+ <img src="<?php echo MSWP_AVERTA_ADMIN_URL . '/views/slider-panel'; ?>/images/loading.gif">
20
+ <?php _e('Loading data...', MSWP_TEXT_DOMAIN); ?>
21
+ </div>
22
+ <div id="msp-root" class="msp-container"> </div>
23
+ <div id="mspHiddenEditor" style="display:none">
24
+ <?php wp_editor( '', 'msp-hidden' , array( 'textarea_rows' => 8 ) ); ?>
25
+ </div>
26
+
27
+ <!-- Application Template -->
28
+ <script type="text/x-handlebars">
29
+ {{#if hasError}}
30
+ <div class="msp-error-cont">
31
+ {{partial errorTemplate}}
32
+ </div>
33
+ {{else}}
34
+ <nav class="msp-main-nav">
35
+ <ul>
36
+ <li>{{#link-to 'settings'}} <?php _e('Slider Settings', MSWP_TEXT_DOMAIN); ?> <span class="msp-ico msp-ico-settings"></span>{{/link-to}}</li>
37
+ <li>{{#link-to 'slides'}} <?php _e('Slides', MSWP_TEXT_DOMAIN); ?> <span class="msp-ico msp-ico-slides"></span>{{/link-to}}</li>
38
+ <li>{{#link-to 'controls'}} <?php _e('Slider Controls', MSWP_TEXT_DOMAIN); ?> <span class="msp-ico msp-ico-controls"></span>{{/link-to}}</li>
39
+ <li>{{#link-to 'callbacks'}} <?php _e('Slider Callbacks', MSWP_TEXT_DOMAIN); ?> <span class="msp-ico msp-ico-api"></span>{{/link-to}}</li>
40
+ </ul>
41
+ </nav>
42
+ <div class="clear"></div>
43
+ {{outlet}}
44
+ <div class="msp-shortcode-cont">
45
+ <span><?php _e('Shortcode :', MSWP_TEXT_DOMAIN); ?> </span> {{view MSPanel.SimpleCodeBlock value=shortCode width=120}}
46
+ <span><?php _e('PHP function :', MSWP_TEXT_DOMAIN); ?> </span> {{view MSPanel.SimpleCodeBlock value=phpFunction width=160}}
47
+ </div>
48
+ <button id="msp-preview-btn" {{action showPreview}} class="msp-blue-btn msp-save-changes"> <?php _e('Preview', MSWP_TEXT_DOMAIN); ?></button>
49
+ {{#if isSending}}
50
+ <button class="msp-blue-btn msp-save-changes disabled"> <?php _e('Saving...', MSWP_TEXT_DOMAIN); ?></button>
51
+ {{else}}
52
+ <button class="msp-blue-btn msp-save-changes" {{action "saveAll"}}> <?php _e('Save Changes', MSWP_TEXT_DOMAIN); ?></button>
53
+ {{/if}}
54
+ <span class="msp-save-status">{{statusMsg}}</span>
55
+ {{/if}}
56
+ </script>
57
+
58
+ <!-- Slider Settings Page -->
59
+ <script type="text/x-handlebars" id="settings">
60
+
61
+ {{#meta-box title="<?php _e('General Settings', MSWP_TEXT_DOMAIN); ?>"}}
62
+
63
+ <div class="msp-metabox-row">
64
+
65
+ <h4><?php _e('Slider name and dimentions', MSWP_TEXT_DOMAIN); ?></h4>
66
+
67
+ <div class="msp-metabox-indented">
68
+ <label><?php _e('Slider name :', MSWP_TEXT_DOMAIN); ?> </label> {{input value=name size="40"}}
69
+ </div>
70
+ <div class="msp-metabox-indented">
71
+ <label><?php _e('Slider width :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=width}} px
72
+ <span class="msp-form-space"></span>
73
+ <label><?php _e('Slider height :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=height}} px
74
+ </div>
75
+
76
+ <div class="msp-metabox-indented">
77
+ {{switch-box value=autoCrop}}<label><?php _e('Automatically crop and resize slider images based on above size.', MSWP_TEXT_DOMAIN); ?></label>
78
+ </div>
79
+
80
+ <h4><?php _e('Slider sizing method', MSWP_TEXT_DOMAIN); ?></h4>
81
+
82
+ <div class="msp-metabox-indented">
83
+ {{#view MSPanel.Select value=layout width="400" }}
84
+ <option value="boxed"><?php _e('Boxed layout', MSWP_TEXT_DOMAIN); ?></option>
85
+ <option value="fullwidth"><?php _e('Full-width', MSWP_TEXT_DOMAIN); ?></option>
86
+ {{/view}}
87
+ {{#if showAutoHeight}}
88
+ <span class="msp-form-space"></span>
89
+ {{switch-box value=autoHeight}}<label><?php _e('Auto-height slider', MSWP_TEXT_DOMAIN); ?></label>
90
+ {{/if}}
91
+ </div>
92
+ {{#if showWrapperWidth}}
93
+ <div class="msp-metabox-indented">
94
+ <label><?php _e('Slider wrapper width :', MSWP_TEXT_DOMAIN); ?> </label>{{number-input value=wrapperWidth}}
95
+ {{#view MSPanel.Select value=wrapperWidthUnit width="40" }}
96
+ <option value="px">px</option>
97
+ <option value="%">%</option>
98
+ {{/view}}
99
+ </div>
100
+ {{/if}}
101
+
102
+ </div>
103
+
104
+ {{/meta-box}}
105
+
106
+ {{#meta-box title="<?php _e('Slider transition', MSWP_TEXT_DOMAIN); ?>"}}
107
+
108
+ <div class="msp-metabox-row">
109
+ <h4><?php _e('Change slider transition, transition speed and space between slides', MSWP_TEXT_DOMAIN); ?></h4>
110
+
111
+ <div class="msp-metabox-indented">
112
+ <label><?php _e('Transition :', MSWP_TEXT_DOMAIN); ?> </label>
113
+ {{#view MSPanel.Select value=trView width=150}}
114
+ <option value="basic">Normal</option>
115
+ <option value="fade">Fade</option>
116
+ {{/view}}
117
+ <span class="msp-form-space"></span>
118
+ <label><?php _e('Transition speed :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=speed}}
119
+ </div>
120
+ <div class="msp-metabox-indented">
121
+ <label><?php _e('Direction :', MSWP_TEXT_DOMAIN); ?> </label>
122
+ {{#view MSPanel.Select value=dir width="120"}}
123
+ <option value="h"><?php _e('Horizontal', MSWP_TEXT_DOMAIN); ?></option>
124
+ <option value="v"><?php _e('Vertical', MSWP_TEXT_DOMAIN); ?></option>
125
+ {{/view}}
126
+ <span class="msp-form-space"></span>
127
+ <label><?php _e('Slide space :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=space}} px
128
+ </div>
129
+ </div>
130
+ {{/meta-box}}
131
+
132
+ {{#meta-box title="<?php _e('Navigation', MSWP_TEXT_DOMAIN); ?>"}}
133
+
134
+ <div class="msp-metabox-row">
135
+ <h4><?php _e('Slideshow behavior and sorting slides', MSWP_TEXT_DOMAIN); ?></h4>
136
+ <div class="msp-metabox-indented">
137
+ {{switch-box value=autoplay}}<label><?php _e('Slideshow', MSWP_TEXT_DOMAIN); ?></label>
138
+ <span class="msp-form-space"></span>
139
+ {{switch-box value=loop}}<label><?php _e('Loop navigation', MSWP_TEXT_DOMAIN); ?> </label>
140
+ <span class="msp-form-space"></span>
141
+ {{switch-box value=endPause}}<label><?php _e('Pause at end slide', MSWP_TEXT_DOMAIN); ?></label>
142
+ </div>
143
+ <div class="msp-metabox-indented">
144
+ {{switch-box value=overPause}}<label><?php _e('Pause on hover', MSWP_TEXT_DOMAIN); ?></label>
145
+ <span class="msp-form-space"></span>
146
+ {{switch-box value=shuffle}}<label><?php _e('Random order', MSWP_TEXT_DOMAIN); ?></label>
147
+ </div>
148
+ <div class="msp-metabox-indented">
149
+ <label><?php _e('Start with slide', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=start min=1}}
150
+ </div>
151
+ <h4><?php _e('Slider navigation methods', MSWP_TEXT_DOMAIN); ?></h4>
152
+ <div class="msp-metabox-indented">
153
+ {{switch-box value=swipe}}<label><?php _e('Touch swipe navigation', MSWP_TEXT_DOMAIN); ?></label>
154
+ <span class="msp-form-space"></span>
155
+ {{switch-box value=mouse}}<label><?php _e('Mouse swipe navigation', MSWP_TEXT_DOMAIN); ?></label>
156
+ <span class="msp-form-space"></span>
157
+ {{switch-box value=grabCursor}}<label><?php _e('Use grab mouse cursor', MSWP_TEXT_DOMAIN); ?></label>
158
+ </div>
159
+ <div class="msp-metabox-indented">
160
+ {{switch-box value=wheel}}<label><?php _e('Mouse wheel navigation', MSWP_TEXT_DOMAIN); ?></label>
161
+ </div>
162
+ <h4><?php _e('Slide preloading', MSWP_TEXT_DOMAIN); ?></h4>
163
+ <div class="msp-metabox-indented">
164
+ {{#view MSPanel.Select value=preloadMethod width="200" }}
165
+ <option value="nearby"><?php _e('Load nearby slides', MSWP_TEXT_DOMAIN); ?></option>
166
+ <option value="-1"><?php _e('Load slides in sequence', MSWP_TEXT_DOMAIN); ?></option>
167
+ <option value="all"><?php _e('Load all slides before init', MSWP_TEXT_DOMAIN); ?></option>
168
+ {{/view}}
169
+ {{#if showNearbyNum}}
170
+ <span class="msp-form-space"></span>
171
+ <?php _e('Number of slides :', MSWP_TEXT_DOMAIN); ?> {{number-input value=preload }}
172
+ {{/if}}
173
+ </div>
174
+ </div>
175
+
176
+ {{/meta-box}}
177
+
178
+ {{#meta-box title="<?php _e('Appearance', MSWP_TEXT_DOMAIN); ?>"}}
179
+
180
+ <div class="msp-metabox-row">
181
+ <h4><?php _e('Slider Skin', MSWP_TEXT_DOMAIN); ?></h4>
182
+ <div class="msp-metabox-indented">
183
+ <label><?php _e('Skin :', MSWP_TEXT_DOMAIN); ?> </label>
184
+ {{#dropdwon-List value=skin width=180}}
185
+ {{#each skin in sliderSkins}}
186
+ <option {{bind-attr value=skin.class}}>{{skin.label}}</option>
187
+ {{/each}}
188
+ {{/dropdwon-List}}
189
+ </div>
190
+ <div class="msp-metabox-indented">
191
+ <label><?php _e('Align center slider controls :', MSWP_TEXT_DOMAIN); ?> </label> {{switch-box value=centerControls}}
192
+ </div>
193
+ <h4><?php _e('Slider background settings', MSWP_TEXT_DOMAIN); ?></h4>
194
+ <div class="msp-metabox-indented">
195
+ <label><?php _e('Background image :', MSWP_TEXT_DOMAIN); ?> </label> {{view MSPanel.ImgSelect value=bgImage thumb=bgImageThumb}}
196
+ <span class="msp-form-space"></span>
197
+ <label><?php _e('Background color :', MSWP_TEXT_DOMAIN); ?> </label> {{color-picker value=bgColor}}
198
+ </div>
199
+ <h4><?php _e('Slider custom class name and inline style', MSWP_TEXT_DOMAIN); ?></h4>
200
+ <div class="msp-metabox-indented">
201
+ <label><?php _e('Class name :', MSWP_TEXT_DOMAIN); ?> </label> {{input value=className}}
202
+ </div>
203
+ <div class="msp-metabox-indented">
204
+ <label><?php _e('Inline style :', MSWP_TEXT_DOMAIN); ?> </label> {{input value=inlineStyle size="50"}}
205
+ </div>
206
+ </div>
207
+
208
+ {{/meta-box}}
209
+ </script>
210
+
211
+ <!-- Slides Page -->
212
+ <script type="text/x-handlebars" id="slides">
213
+ <!-- Slides List -->
214
+ {{#meta-box title="<?php _e('Slides', MSWP_TEXT_DOMAIN); ?>"}}
215
+ <div class="msp-metabox-row">
216
+ {{view MSPanel.SlideList}}
217
+ </div>
218
+ {{/meta-box}}
219
+
220
+ {{partial "slide-settings"}}
221
+ </script>
222
+
223
+ <!-- Slide Settings Partial -->
224
+ <script type="text/x-handlebars" id="slide-settings">
225
+
226
+ {{#tabs-panel id="slide-settings"}}
227
+ <div class="msp-metabox-handle">
228
+
229
+ <ul class="tabs">
230
+ <li class="active"><a href="#sl-bg"><?php _e('Background', MSWP_TEXT_DOMAIN); ?></a></li>
231
+ <li><a href="#sl-val"><?php _e('Video and Link', MSWP_TEXT_DOMAIN); ?></a></li>
232
+ <li><a href="#sl-inf"><?php _e('Slide Info', MSWP_TEXT_DOMAIN); ?></a></li>
233
+ <li><a href="#sl-misc"><?php _e('Misc', MSWP_TEXT_DOMAIN); ?></a></li>
234
+ </ul>
235
+
236
+ <div class="msp-metabox-toggle"></div>
237
+ </div>
238
+
239
+ <ul class="tabs-content">
240
+ <li id="sl-bg">{{partial 'slide-background'}}</li>
241
+ <li id="sl-val">{{partial 'slide-video-and-link'}}</li>
242
+ <li id="sl-inf">{{partial 'slide-info'}}</li>
243
+ <li id="sl-misc">{{partial 'slide-misc'}}</li>
244
+ </ul>
245
+ {{/tabs-panel}}
246
+
247
+ {{#meta-box title="Slide"}}
248
+ <div class="msp-metabox-row">
249
+ <div class="msp-metabox-indented">
250
+ <label><?php _e('Slide duration :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input class="msp-number-input" min=0 max=300 step="0.1" value=currentSlide.duration}} s
251
+ </div>
252
+ </div>
253
+ <hr class="msp-metabox-hr">
254
+ {{view MSPanel.StageArea}}
255
+ {{/meta-box}}
256
+
257
+ </script>
258
+
259
+ <!-- Slide Background Settings Partial -->
260
+ <script type="text/x-handlebars" id="slide-background">
261
+ <div class="msp-metabox-row">
262
+ <h4><?php _e('Choose slide background and thumbnail', MSWP_TEXT_DOMAIN); ?></h4>
263
+ <div class="msp-metabox-indented">
264
+ <label><?php _e('Background :', MSWP_TEXT_DOMAIN); ?> </label> {{view MSPanel.ImgSelect value=currentSlide.bg thumb=currentSlide.bgThumb}}
265
+ <span class="msp-form-space"></span>
266
+ <label><?php _e('Fillmode :', MSWP_TEXT_DOMAIN); ?> </label> {{view MSPanel.Fillmode value=currentSlide.fillMode}}
267
+ <span class="msp-form-space"></span>
268
+ <label><?php _e('Thumbnail :', MSWP_TEXT_DOMAIN); ?> </label> {{view MSPanel.ImgSelect value=currentSlide.thumbOrginal thumb=currentSlide.thumb}}
269
+ </div>
270
+ </div>
271
+ </script>
272
+
273
+ <!-- Slide Embeded Video and Link -->
274
+ <script type="text/x-handlebars" id="slide-video-and-link">
275
+ <div class="msp-metabox-row">
276
+ <h4><?php _e('Link this slide', MSWP_TEXT_DOMAIN); ?> </h4>
277
+ <div class="msp-metabox-indented">
278
+ <label><?php _e('URL :', MSWP_TEXT_DOMAIN); ?> </label> {{input class="msp-path-input" value=currentSlide.link}}
279
+ {{view MSPanel.URLTarget value=currentSlide.linkTarget }}
280
+ </div>
281
+ <h4><?php _e('Youtube or Vimeo video as slide', MSWP_TEXT_DOMAIN); ?></h4>
282
+ <div class="msp-metabox-indented">
283
+ <label><?php _e('Video embed src :', MSWP_TEXT_DOMAIN); ?> </label> {{input size=60 value=currentSlide.video}}
284
+ </div>
285
+ </div>
286
+ </script>
287
+
288
+ <!-- Slide Info -->
289
+ <script type="text/x-handlebars" id="slide-info">
290
+ <div class="msp-metabox-row">
291
+ <div class="msp-metabox-indented">
292
+ <label><?php _e('This info will show beside of slider when slider reaches the slide or it can represent as tab in a tabs control. It is relative to selected slider template.', MSWP_TEXT_DOMAIN); ?></label>
293
+ </div>
294
+
295
+ {{#if MSPanel.dynamicTags}}
296
+ <div class="msp-metabox-indented">
297
+ <label><?php _e('Insert dynamic content : ', MSWP_TEXT_DOMAIN); ?></label>
298
+ {{view MSPanel.AddDynamicTag editorId=infoEditor}}
299
+ </div>
300
+ {{/if}}
301
+ <div class="msp-metabox-indented">
302
+ {{view MSPanel.WPEditor tabs="slide-settings" tab="sl-inf" _id=infoEditor value=currentSlide.info}}
303
+ {{!-- {{view MSPanel.HTMLTextArea value=currentSlide.info}} --}}
304
+ </div>
305
+ </div>
306
+ </script>
307
+
308
+ <!-- Slide Misc -->
309
+ <script type="text/x-handlebars" id="slide-misc">
310
+ <div class="msp-metabox-row">
311
+ <h4><?php _e('Custom class name and id for slide element', MSWP_TEXT_DOMAIN); ?> </h4>
312
+ <div class="msp-metabox-indented">
313
+ <label><?php _e('Class name :', MSWP_TEXT_DOMAIN); ?> </label> {{input size=30 value=currentSlide.cssClass}}
314
+ <span class="msp-form-space"></span>
315
+ <label><?php _e('CSS id :', MSWP_TEXT_DOMAIN); ?> </label> {{input size=30 value=currentSlide.cssId}}
316
+ </div>
317
+ <h4><?php _e('Background color and slide background alt text ', MSWP_TEXT_DOMAIN); ?></h4>
318
+ <div class="msp-metabox-indented">
319
+ <label><?php _e('Background color :', MSWP_TEXT_DOMAIN); ?> </label> {{color-picker value=currentSlide.bgColor}}
320
+ <span class="msp-form-space"></span>
321
+ <label><?php _e('Alt text :', MSWP_TEXT_DOMAIN); ?> </label> {{input size=30 value=currentSlide.bgAlt}}
322
+ </div>
323
+ </div>
324
+ </script>
325
+
326
+ <!-- Slider Controls -->
327
+ <script type="text/x-handlebars" id="controls">
328
+ {{#if controllers.application.disableControls}}
329
+ {{#meta-box title="Slider Controls"}}
330
+ <div class="msp-metabox-row">
331
+ <div class="msp-metabox-indented">
332
+ <?php _e('The selected tempalte for slider does not support custom controls.', MSWP_TEXT_DOMAIN); ?>
333
+ </div>
334
+ </div>
335
+ {{/meta-box}}
336
+ {{else}}
337
+ {{#meta-box title="Slider Controls"}}
338
+ <div class="msp-metabox-row">
339
+
340
+ <h4><?php _e('Here you can add or remove controls to slider', MSWP_TEXT_DOMAIN); ?></h4>
341
+
342
+ <div class="msp-metabox-indented">
343
+ <label><?php _e('Add new control', MSWP_TEXT_DOMAIN); ?></label>
344
+ {{#if noMore}}
345
+ <button class="msp-add-btn disabled"><span class="msp-ico msp-ico-whiteadd"></span></button>
346
+ {{else}}
347
+ <button {{action addControl}} class="msp-add-btn"><span class="msp-ico msp-ico-whiteadd"></span></button>
348
+ {{/if}}
349
+
350
+ {{#dropdwon-List value=selectedControl width=200}}
351
+ {{#each control in availableControls}}
352
+ <option {{bind-attr value=control.value}}>{{control.label}}</option>
353
+ {{else}}
354
+ <option><?php _e('-- All controls are used --', MSWP_TEXT_DOMAIN); ?></option>
355
+ {{/each}}
356
+ {{/dropdwon-List}}
357
+ </div>
358
+ </div>
359
+ <hr class="msp-metabox-hr">
360
+ <div class="msp-metabox-row">
361
+ <h4><?php _e('Used controls:', MSWP_TEXT_DOMAIN); ?></h4>
362
+ <div class="msp-metabox-indented">
363
+ {{#each control in controller}}
364
+ {{view MSPanel.ControlBtn control=control}}
365
+ {{/each}}
366
+ </div>
367
+ </div>
368
+ {{/meta-box}}
369
+
370
+ {{partial controlOptions}}
371
+ {{/if}}
372
+ </script>
373
+
374
+ <script type="text/x-handlebars" id="arrows-options">
375
+ {{#meta-box title="Arrows Control Options"}}
376
+ <div class="msp-metabox-row">
377
+ <div class="msp-metabox-indented">
378
+ {{switch-box value=currentControl.autoHide}} <label><?php _e('Hide arrows when mouse leaves slider', MSWP_TEXT_DOMAIN); ?></label>
379
+ <div class="msp-form-space-med"></div>
380
+ {{switch-box value=currentControl.overVideo}} <label><?php _e('Show arrows over Youtube/Vimeo video player', MSWP_TEXT_DOMAIN); ?></label>
381
+ </div>
382
+ <div class="msp-metabox-indented">
383
+ <label><?php _e('Hide arrows under this window width :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.hideUnder}} px
384
+ </div>
385
+
386
+ {{!--<div class="msp-metabox-indented">
387
+ {{switch-box value=currentControl.inset}} <label><?php _e('Insert arrows inside slider', MSWP_TEXT_DOMAIN); ?></label>
388
+ </div>
389
+ <div class="msp-metabox-indented">
390
+ <label><?php _e('Arrows margin :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.margin min=null}} px
391
+ </div>--}}
392
+ </div>
393
+ {{/meta-box}}
394
+ </script>
395
+
396
+ <script type="text/x-handlebars" id="timebar-options">
397
+ {{#meta-box title="Line Timer Control Options"}}
398
+ <div class="msp-metabox-row">
399
+ <div class="msp-metabox-indented">
400
+ {{switch-box value=currentControl.autoHide}} <label><?php _e('Hide line timer when mouse leaves slider', MSWP_TEXT_DOMAIN); ?></label>
401
+ <div class="msp-form-space-med"></div>
402
+ {{switch-box value=currentControl.overVideo}} <label><?php _e('Show line timer over Youtube/Vimeo video player', MSWP_TEXT_DOMAIN); ?></label>
403
+ </div>
404
+ <div class="msp-metabox-indented">
405
+ <?php _e('Align control :', MSWP_TEXT_DOMAIN); ?>
406
+ {{#dropdwon-List value=currentControl.align width=100}}
407
+ <option value="top"><?php _e('Top', MSWP_TEXT_DOMAIN); ?></option>
408
+ <option value="bottom"><?php _e('Bottom', MSWP_TEXT_DOMAIN); ?></option>
409
+ {{/dropdwon-List}}
410
+ <div class="msp-form-space-med"></div>
411
+ <label><?php _e('Hide line timer under this window width :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.hideUnder}} px
412
+ </div>
413
+ <div class="msp-metabox-indented">
414
+ <label><?php _e('Line timer color :', MSWP_TEXT_DOMAIN); ?> </label> {{color-picker value=currentControl.color}}
415
+ <div class="msp-form-space-med"></div>
416
+ <label><?php _e('Line timer width :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.width}} px
417
+ </div>
418
+ </div>
419
+ {{/meta-box}}
420
+ </script>
421
+
422
+ <script type="text/x-handlebars" id="bullets-options">
423
+ {{#meta-box title="Bullets Control Options"}}
424
+ <div class="msp-metabox-row">
425
+ <div class="msp-metabox-indented">
426
+ {{switch-box value=currentControl.autoHide}} <label><?php _e('Hide bullets when mouse leaves slider', MSWP_TEXT_DOMAIN); ?></label>
427
+ <div class="msp-form-space-med"></div>
428
+ {{switch-box value=currentControl.overVideo}} <label><?php _e('Show bullets over Youtube/Vimeo video player', MSWP_TEXT_DOMAIN); ?></label>
429
+ </div>
430
+ {{!-- <div class="msp-metabox-indented">
431
+ {{switch-box value=currentControl.inset}} <label><?php _e('Insert bullets inside slider', MSWP_TEXT_DOMAIN); ?></label>
432
+ </div> --}}
433
+ <div class="msp-metabox-indented">
434
+ <?php _e('Align control :', MSWP_TEXT_DOMAIN); ?>
435
+ {{#dropdwon-List value=currentControl.align width=100}}
436
+ <option value="top"><?php _e('Top', MSWP_TEXT_DOMAIN); ?></option>
437
+ <option value="bottom"><?php _e('Bottom', MSWP_TEXT_DOMAIN); ?></option>
438
+ {{/dropdwon-List}}
439
+ <div class="msp-form-space-med"></div>
440
+ <label><?php _e('Bullets margin :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.margin min=null}} px
441
+ </div>
442
+ <div class="msp-metabox-indented">
443
+ <label><?php _e('Hide bullets under this window width :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.hideUnder}} px
444
+ </div>
445
+ </div>
446
+ {{/meta-box}}
447
+ </script>
448
+
449
+ <script type="text/x-handlebars" id="scrollbar-options">
450
+ {{#meta-box title="Scrollbar Control Options"}}
451
+ <div class="msp-metabox-row">
452
+ <div class="msp-metabox-indented">
453
+ {{switch-box value=currentControl.autoHide}} <label><?php _e('Hide scrollbar when mouse leaves slider', MSWP_TEXT_DOMAIN); ?></label>
454
+ <div class="msp-form-space-med"></div>
455
+ {{switch-box value=currentControl.overVideo}} <label><?php _e('Show scrollbar over Youtube/Vimeo video player', MSWP_TEXT_DOMAIN); ?></label>
456
+ </div>
457
+ <div class="msp-metabox-indented">
458
+ {{switch-box value=currentControl.inset}} <label><?php _e('Insert scrollbar inside slider', MSWP_TEXT_DOMAIN); ?></label>
459
+ </div>
460
+
461
+ {{!--<div class="msp-metabox-indented">
462
+ <label><?php _e('Scrollbar direction :', MSWP_TEXT_DOMAIN); ?> </label>
463
+ {{#dropdwon-List value=currentControl.dir width=100}}
464
+ <option value="h"><?php _e('Horizontal', MSWP_TEXT_DOMAIN); ?></option>
465
+ <option value="v"><?php _e('Vertical', MSWP_TEXT_DOMAIN); ?></option>
466
+ {{/dropdwon-List}}
467
+ <div class="msp-form-space-med"></div>
468
+ </div>--}}
469
+
470
+ <div class="msp-metabox-indented">
471
+ <label><?php _e('Scrollbar handle color :', MSWP_TEXT_DOMAIN); ?> </label> {{color-picker value=currentControl.color}}
472
+ <div class="msp-form-space-med"></div>
473
+ <label><?php _e('Hide scrollbar under this window width :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.hideUnder}} px
474
+ </div>
475
+ <div class="msp-metabox-indented">
476
+ <?php _e('Align control :', MSWP_TEXT_DOMAIN); ?>
477
+ {{#dropdwon-List value=currentControl.align width=100}}
478
+ <option value="top"><?php _e('Top', MSWP_TEXT_DOMAIN); ?></option>
479
+ <option value="right"><?php _e('Right', MSWP_TEXT_DOMAIN); ?></option>
480
+ <option value="left"><?php _e('Left', MSWP_TEXT_DOMAIN); ?></option>
481
+ <option value="bottom"><?php _e('Bottom', MSWP_TEXT_DOMAIN); ?></option>
482
+ {{/dropdwon-List}}
483
+ <div class="msp-form-space-med"></div>
484
+ <label><?php _e('Scrollbar width :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.width}} px
485
+ <div class="msp-form-space-med"></div>
486
+ <label><?php _e('Scrollbar margin :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.margin min=null}} px
487
+ </div>
488
+ </div>
489
+ {{/meta-box}}
490
+ </script>
491
+
492
+ <script type="text/x-handlebars" id="circletimer-options">
493
+ {{#meta-box title="Circle Timer Control Options"}}
494
+ <div class="msp-metabox-row">
495
+ <div class="msp-metabox-indented">
496
+ {{switch-box value=currentControl.autoHide}} <label><?php _e('Hide cricle timer when mouse leaves slider', MSWP_TEXT_DOMAIN); ?></label>
497
+ <div class="msp-form-space-med"></div>
498
+ {{switch-box value=currentControl.overVideo}} <label><?php _e('Show circle timer over Youtube/Vimeo video player', MSWP_TEXT_DOMAIN); ?></label>
499
+ </div>
500
+ {{!--<div class="msp-metabox-indented">
501
+ <?php _e('Align control :', MSWP_TEXT_DOMAIN); ?>
502
+ {{#dropdwon-List value=currentControl.align width=100}}
503
+ <option value="tl"><?php _e('Top Left', MSWP_TEXT_DOMAIN); ?></option>
504
+ <option value="tr"><?php _e('Top Right', MSWP_TEXT_DOMAIN); ?></option>
505
+ <option value="bl"><?php _e('Bottom Left', MSWP_TEXT_DOMAIN); ?></option>
506
+ <option value="br"><?php _e('Bottom Right', MSWP_TEXT_DOMAIN); ?></option>
507
+ {{/dropdwon-List}}
508
+ </div>--}}
509
+ <div class="msp-metabox-indented">
510
+ <label><?php _e('Hide circle timer under this window width :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.hideUnder}} px
511
+ </div>
512
+ <div class="msp-metabox-indented">
513
+ {{!--<label><?php _e('Circle timer margin :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.margin min=null}} px
514
+ <div class="msp-form-space-med"></div>--}}
515
+ <label><?php _e('Circle stroke :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.stroke}} px
516
+ <div class="msp-form-space-med"></div>
517
+ <label><?php _e('Circle radius :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.radius}} px
518
+ <div class="msp-form-space-med"></div>
519
+ <label><?php _e('Circle color :', MSWP_TEXT_DOMAIN); ?> </label> {{color-picker value=currentControl.color}}
520
+ </div>
521
+ </div>
522
+ {{/meta-box}}
523
+ </script>
524
+
525
+ <script type="text/x-handlebars" id="slideinfo-options">
526
+ {{#meta-box title="Slide Info Control Options"}}
527
+ <div class="msp-metabox-row">
528
+ <div class="msp-metabox-indented">
529
+ {{switch-box value=currentControl.autoHide}} <label><?php _e('Hide slide info when mouse leaves slider', MSWP_TEXT_DOMAIN); ?></label>
530
+ <div class="msp-form-space-med"></div>
531
+ {{switch-box value=currentControl.overVideo}} <label><?php _e('Show slide info over Youtube/Vimeo video player', MSWP_TEXT_DOMAIN); ?></label>
532
+ </div>
533
+ <div class="msp-metabox-indented">
534
+ {{switch-box value=currentControl.inset}} <label><?php _e('Insert slide info inside slider', MSWP_TEXT_DOMAIN); ?></label>
535
+ </div>
536
+ <div class="msp-metabox-indented">
537
+ <?php _e('Align control :', MSWP_TEXT_DOMAIN); ?>
538
+ {{#dropdwon-List value=currentControl.align width=100}}
539
+ <option value="top"><?php _e('Top', MSWP_TEXT_DOMAIN); ?></option>
540
+ <option value="right"><?php _e('Right', MSWP_TEXT_DOMAIN); ?></option>
541
+ <option value="left"><?php _e('Left', MSWP_TEXT_DOMAIN); ?></option>
542
+ <option value="bottom"><?php _e('Bottom', MSWP_TEXT_DOMAIN); ?></option>
543
+ {{/dropdwon-List}}
544
+ <div class="msp-form-space-med"></div>
545
+ <label><?php _e('Slide info margin :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.margin min=null}} px
546
+ </div>
547
+ <div class="msp-metabox-indented">
548
+ <label><?php _e('Slide info width :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.width}} px
549
+ <div class="msp-form-space-med"></div>
550
+ <label><?php _e('Slide info height :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.height}} px
551
+ </div>
552
+ </div>
553
+ <div class="msp-metabox-indented">
554
+ <label><?php _e('Hide slide info under this window width :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.hideUnder}} px
555
+ </div>
556
+ </div>
557
+ {{/meta-box}}
558
+ </script>
559
+
560
+ <script type="text/x-handlebars" id="thumblist-options">
561
+ {{#meta-box title="Thumblist/Tabs Control Options"}}
562
+ <div class="msp-metabox-row">
563
+ <div class="msp-metabox-indented">
564
+ {{switch-box value=currentControl.autoHide}} <label><?php _e('Hide thumblist/tabs when mouse leaves slider', MSWP_TEXT_DOMAIN); ?></label>
565
+ <div class="msp-form-space-med"></div>
566
+ {{switch-box value=currentControl.overVideo}} <label><?php _e('Show thumblist/tabs over Youtube/Vimeo video player', MSWP_TEXT_DOMAIN); ?></label>
567
+ </div>
568
+ <div class="msp-metabox-indented">
569
+ {{switch-box value=currentControl.inset}} <label><?php _e('Insert thumblist/tabs inside slider', MSWP_TEXT_DOMAIN); ?></label>
570
+ <div class="msp-form-space-med"></div>
571
+ <?php _e('Thumb background fill mode :', MSWP_TEXT_DOMAIN); ?>
572
+ {{view MSPanel.Fillmode value=currentControl.fillMode}}
573
+ </div>
574
+ <div class="msp-metabox-indented">
575
+ <?php _e('Align control :', MSWP_TEXT_DOMAIN); ?>
576
+ {{#dropdwon-List value=currentControl.align width=100}}
577
+ <option value="top"><?php _e('Top', MSWP_TEXT_DOMAIN); ?></option>
578
+ <option value="right"><?php _e('Right', MSWP_TEXT_DOMAIN); ?></option>
579
+ <option value="left"><?php _e('Left', MSWP_TEXT_DOMAIN); ?></option>
580
+ <option value="bottom"><?php _e('Bottom', MSWP_TEXT_DOMAIN); ?></option>
581
+ {{/dropdwon-List}}
582
+ <div class="msp-form-space-med"></div>
583
+ <label><?php _e('Thumblist/Tabs margin :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.margin min=null}} px
584
+ </div>
585
+ <div class="msp-metabox-indented">
586
+ <?php _e('Appearance :', MSWP_TEXT_DOMAIN); ?>
587
+ {{#dropdwon-List value=currentControl.type width=100}}
588
+ <option value="thumbs"><?php _e('Thumblist', MSWP_TEXT_DOMAIN); ?></option>
589
+ <option value="tabs"><?php _e('Tabs', MSWP_TEXT_DOMAIN); ?></option>
590
+ {{/dropdwon-List}}
591
+ <div class="msp-form-space-med"></div>
592
+ <label><?php _e('Hide thumblist/tabs under this window width :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.hideUnder}} px
593
+ </div>
594
+
595
+ {{!--<div class="msp-metabox-indented">
596
+ <label><?php _e('Thumblist/Tabs direction :', MSWP_TEXT_DOMAIN); ?> </label>
597
+ {{#dropdwon-List value=currentControl.dir width=100}}
598
+ <option value="h"><?php _e('Horizontal', MSWP_TEXT_DOMAIN); ?></option>
599
+ <option value="v"><?php _e('Vertical', MSWP_TEXT_DOMAIN); ?></option>
600
+ {{/dropdwon-List}}
601
+ </div>--}}
602
+ <div class="msp-metabox-indented">
603
+ <label><?php _e('Thumb/Tab width :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.width}} px
604
+ <div class="msp-form-space-med"></div>
605
+ <label><?php _e('Thumb/Tab height :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.height}} px
606
+ <div class="msp-form-space-med"></div>
607
+ <label><?php _e('Space between thumbs/tabs :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=currentControl.space}} px
608
+ </div>
609
+
610
+ </div>
611
+ {{/meta-box}}
612
+ </script>
613
+
614
+ <!-- Slider Apis -->
615
+ <script type="text/x-handlebars" id="callbacks">
616
+ {{#meta-box title="Slider Callbacks"}}
617
+ <div class="msp-metabox-row">
618
+
619
+ <h4><?php _e('Here you can add or remove callbacks to slider', MSWP_TEXT_DOMAIN); ?></h4>
620
+
621
+ <div class="msp-metabox-indented">
622
+ <label><?php _e('Add new callback', MSWP_TEXT_DOMAIN); ?></label>
623
+ {{#if noMore}}
624
+ <button class="msp-add-btn disabled"><span class="msp-ico msp-ico-whiteadd"></span></button>
625
+ {{else}}
626
+ <button {{action addCallback}} class="msp-add-btn"><span class="msp-ico msp-ico-whiteadd"></span></button>
627
+ {{/if}}
628
+
629
+ {{#dropdwon-List value=selectedCallback width=250}}
630
+ {{#each callback in availableCallbacks}}
631
+ <option {{bind-attr value=callback.value}}>{{callback.label}}</option>
632
+ {{else}}
633
+ <option><?php _e('-- All callbacks are added --', MSWP_TEXT_DOMAIN); ?></option>
634
+ {{/each}}
635
+ {{/dropdwon-List}}
636
+ </div>
637
+ </div>
638
+ {{#each callback in controller}}
639
+ <hr class="msp-metabox-hr">
640
+ <div class="msp-metabox-row">
641
+ <h4>{{callback.label}} : </h4>
642
+ <div class="msp-metabox-indented">
643
+ {{#code-mirror width="100%" height="auto" mode="javascript" value=callback.content}}{{/code-mirror}}
644
+ </div>
645
+ <div class="msp-metabox-indented">
646
+ <button {{action "removeCallback" callback}} class="msp-blue-btn msp-remove-btn-med"><?php _e('Remove', MSWP_TEXT_DOMAIN); ?></button>
647
+ </div>
648
+ </div>
649
+ {{/each}}
650
+ {{/meta-box}}
651
+ </script>
652
+
653
+ <!-- empty template -->
654
+ <script type="text/x-handlebars" id="empty-template"></script>
admin/views/slider-panel/js/ember-model.min.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*!
2
+ * @overview Ember-Model
3
+ * https://github.com/ebryn/ember-model
4
+ */
5
+ (function(){Ember.libraries&&Ember.libraries.register("Ember Model","0.0.11")})(),function(){function n(n){var t=function(){var t=this.constructor.toString();throw new Error(n.replace("{{className}}",t));};return t.isUnimplemented=!0,t}Ember.Adapter=Ember.Object.extend({find:n("{{className}} must implement find"),findQuery:n("{{className}} must implement findQuery"),findMany:n("{{className}} must implement findMany"),findAll:n("{{className}} must implement findAll"),createRecord:n("{{className}} must implement createRecord"),saveRecord:n("{{className}} must implement saveRecord"),deleteRecord:n("{{className}} must implement deleteRecord"),load:function(n,t,i){n.load(t,i)}})}(),function(){var n=Ember.get;Ember.FixtureAdapter=Ember.Adapter.extend({_findData:function(t,i){var r=t.FIXTURES,u=i.toString(),f=n(t,"primaryKey");return Ember.A(r).find(function(n){return n[f].toString()===u})},find:function(n,t){var i=this._findData(n.constructor,t);return new Ember.RSVP.Promise(function(r){Ember.run.later(this,function(){Ember.run(n,n.load,t,i),r(n)},0)})},findMany:function(n,t,i){for(var e=n.FIXTURES,u=[],r=0,f=i.length;r<f;r++)u.push(this._findData(n,i[r]));return new Ember.RSVP.Promise(function(i){Ember.run.later(this,function(){Ember.run(t,t.load,n,u),i(t)},0)})},findAll:function(n,t){var i=n.FIXTURES;return new Ember.RSVP.Promise(function(r){Ember.run.later(this,function(){Ember.run(t,t.load,n,i),r(t)},0)})},createRecord:function(n){var t=n.constructor,i=t.FIXTURES;return new Ember.RSVP.Promise(function(r){Ember.run.later(this,function(){i.push(t.findFromCacheOrLoad(n.toJSON())),n.didCreateRecord(),r(n)},0)})},saveRecord:function(n){return new Ember.RSVP.Promise(function(t){Ember.run.later(this,function(){n.didSaveRecord(),t(n)},0)})},deleteRecord:function(n){return new Ember.RSVP.Promise(function(t){Ember.run.later(this,function(){n.didDeleteRecord(),t(n)},0)})}})}(),function(){var t=Ember.get,n=Ember.set;Ember.RecordArray=Ember.ArrayProxy.extend(Ember.Evented,{isLoaded:!1,isLoading:Ember.computed.not("isLoaded"),load:function(t,i){n(this,"content",this.materializeData(t,i)),this.notifyLoaded()},loadForFindMany:function(i){var r=t(this,"_ids").map(function(n){return i.cachedRecordForId(n)});n(this,"content",Ember.A(r)),this.notifyLoaded()},notifyLoaded:function(){n(this,"isLoaded",!0),this.trigger("didLoad")},materializeData:function(n,t){return Ember.A(t.map(function(t){return n.findFromCacheOrLoad(t)}))},reload:function(){var t=this.get("modelClass"),r=this,i;return n(this,"isLoaded",!1),t._findAllRecordArray===this?t.adapter.findAll(t,this):this._query?t.adapter.findQuery(t,this,this._query):(i=this.map(function(n){return n.reload()}),Ember.RSVP.all(i).then(function(){r.notifyLoaded()}))}})}(),function(){var n=Ember.get;Ember.FilteredRecordArray=Ember.RecordArray.extend({init:function(){if(!n(this,"modelClass"))throw new Error("FilteredRecordArrays must be created with a modelClass");if(!n(this,"filterFunction"))throw new Error("FilteredRecordArrays must be created with a filterFunction");if(!n(this,"filterProperties"))throw new Error("FilteredRecordArrays must be created with filterProperties");var t=n(this,"modelClass");t.registerRecordArray(this),this.registerObservers(),this.updateFilter(),this._super()},updateFilter:function(){var i=this,t=[];n(this,"modelClass").forEachCachedRecord(function(n){i.filterFunction(n)&&t.push(n)}),this.set("content",Ember.A(t))},updateFilterForRecord:function(t){var i=n(this,"content");this.filterFunction(t)&&!i.contains(t)&&i.pushObject(t)},registerObservers:function(){var t=this;n(this,"modelClass").forEachCachedRecord(function(n){t.registerObserversOnRecord(n)})},registerObserversOnRecord:function(t){for(var f=this,r=n(this,"filterProperties"),i=0,u=n(r,"length");i<u;i++)t.addObserver(r[i],f,"updateFilterForRecord")}})}(),function(){var n=Ember.get,t=Ember.set;Ember.ManyArray=Ember.RecordArray.extend({_records:null,originalContent:[],isDirty:function(){var r=n(this,"originalContent"),o=n(r,"length"),u=n(this,"content"),f=n(u,"length"),i,t,e;if(o!==f)return!0;for(i=!1,t=0,e=f;t<e;t++)if(!r.contains(u[t])){i=!0;break}return i}.property("content.[]","originalContent"),objectAtContent:function(t){var i=n(this,"content");if(i.length)return this.materializeRecord(t)},save:function(){return Ember.RSVP.all(this.map(function(n){return n.save()}))},replaceContent:function(n,t,i){i=Ember.EnumerableUtils.map(i,function(n){return n._reference},this),this._super(n,t,i)},_contentWillChange:function(){var t=n(this,"content");t&&(t.removeArrayObserver(this),this._setupOriginalContent(t))}.observesBefore("content"),_contentDidChange:function(){var t=n(this,"content");t&&(t.addArrayObserver(this),this.arrayDidChange(t,0,0,n(t,"length")))}.observes("content"),arrayWillChange:function(){},arrayDidChange:function(){var t=n(this,"parent"),i=n(this,"relationshipKey"),r=n(this,"isDirty");r?t._relationshipBecameDirty(i):t._relationshipBecameClean(i)},_setupOriginalContent:function(i){i=i||n(this,"content"),i&&t(this,"originalContent",i.slice())},init:function(){this._super(),this._setupOriginalContent(),this._contentDidChange()}}),Ember.HasManyArray=Ember.ManyArray.extend({materializeRecord:function(t){var r=n(this,"modelClass"),u=n(this,"content"),i=u.objectAt(t);return i.record?i.record:r.find(i.id)},toJSON:function(){var n=[],t=this.get("content");return t.forEach(function(t){t.id!==undefined&&n.push(t.id)}),n}}),Ember.EmbeddedHasManyArray=Ember.ManyArray.extend({create:function(t){var r=n(this,"modelClass"),i=r.create(t);return this.pushObject(i),i},materializeRecord:function(t){var f=n(this,"modelClass"),e=n(f,"primaryKey"),o=n(this,"content"),i=o.objectAt(t),u=i.data,r;return i.record?i.record:(r=f.create({_reference:i}),i.record=r,u&&r.load(u[e],u),r)},toJSON:function(){return this.map(function(n){return n.toJSON()})}})}(),function(){function r(n,t){for(var i=0,r=n.length;i<r;i++)if(n[i]===t)return!0;return!1}function u(n,t){for(var u,i=0,f=t.length;i<f;i++)u=t[i],r(n,u)||n.push(u);return n}var n=Ember.get,t=Ember.set,e=Ember.setProperties,f=Ember.meta,i=Ember.String.underscore;Ember.run.queues.push("data"),Ember.Model=Ember.Object.extend(Ember.Evented,{isLoaded:!0,isLoading:Ember.computed.not("isLoaded"),isNew:!0,isDeleted:!1,_dirtyAttributes:null,getAttr:function(n,t){return t},isDirty:function(){var t=n(this,"_dirtyAttributes");return t&&t.length!==0||!1}.property("_dirtyAttributes.length"),_relationshipBecameDirty:function(t){var i=n(this,"_dirtyAttributes");i.contains(t)||i.pushObject(t)},_relationshipBecameClean:function(t){var i=n(this,"_dirtyAttributes");i.removeObject(t)},dataKey:function(t){var u=n(this.constructor,"camelizeKeys"),r=this.constructor.metaForProperty(t);return r.options&&r.options.key?u?i(r.options.key):r.options.key:u?i(t):t},init:function(){this._createReference(),this._dirtyAttributes||t(this,"_dirtyAttributes",[]),this._super()},_createReference:function(){var n=this._reference,t=this.getPrimaryKey();return n?n.id!==t&&(n.id=t,this.constructor._cacheReference(n)):(n=this.constructor._getOrCreateReferenceForId(t),n.record=this,this._reference=n),n.id||(n.id=t),n},getPrimaryKey:function(){return n(this,n(this.constructor,"primaryKey"))},load:function(i,r){var e={},o,l,s,a,h,c,u,f,v;for(e[n(this.constructor,"primaryKey")]=i,t(this,"_data",Ember.merge(e,r)),o=this.constructor._relationships||[],l=Ember.meta(this),f=0,v=o.length;f<v;f++)s=o[f],a=l.descs[s],h=a.meta(),h.options.embedded&&(u=h.type,typeof u=="string"&&(u=Ember.get(Ember.lookup,u)),c=e[s],c&&u.load(c));t(this,"isLoaded",!0),t(this,"isNew",!1),this._createReference(),this.trigger("didLoad")},didDefineProperty:function(n,t,i){if(i instanceof Ember.Descriptor){var u=i.meta(),r=n.constructor;u.isAttribute?(r._attributes||(r._attributes=[]),r._attributes.push(t)):u.isRelationship&&(r._relationships||(r._relationships=[]),r._relationships.push(t),u.relationshipKey=t)}},serializeHasMany:function(n){var t=this.get(n);return this.get(n).toJSON()},serializeBelongsTo:function(t,i){var r,u;return i.options.embedded?(r=this.get(t),r?r.toJSON():null):(u=n(i.getType(),"primaryKey"),this.get(t+"."+u))},toJSON:function(){var i,t,r={},s=this.constructor.getAttributes(),e=this.constructor.getRelationships(),u=s?this.getProperties(s):{},h=n(this.constructor,"rootKey"),c,l,f,o;for(i in u)t=this.constructor.metaForProperty(i),r[this.dataKey(i)]=t.type&&t.type.serialize?t.type.serialize(u[i]):t.type&&Ember.Model.dataTypes[t.type]?Ember.Model.dataTypes[t.type].serialize(u[i]):u[i];if(e)for(f=0;f<e.length;f++)i=e[f],t=this.constructor.metaForProperty(i),l=t.options.key||i,c=t.kind==="belongsTo"?this.serializeBelongsTo(i,t):this.serializeHasMany(i,t),r[l]=c;return h?(o={},o[h]=r,o):r},save:function(){var i=this.constructor.adapter,r,u;return t(this,"isSaving",!0),n(this,"isNew")?i.createRecord(this):n(this,"isDirty")?i.saveRecord(this):(r=this,u=new Ember.RSVP.Promise(function(n){n(r)}),t(this,"isSaving",!1),u)},reload:function(){return this.getWithDefault("_dirtyAttributes",[]).clear(),this.constructor.reload(this.get(n(this.constructor,"primaryKey")))},revert:function(){this.getWithDefault("_dirtyAttributes",[]).clear(),this.notifyPropertyChange("_data")},didCreateRecord:function(){var i=n(this.constructor,"primaryKey"),r=n(this,i);t(this,"isNew",!1),t(this,"_dirtyAttributes",[]),this.constructor.addToRecordArrays(this),this.trigger("didCreateRecord"),this.didSaveRecord()},didSaveRecord:function(){t(this,"isSaving",!1),this.trigger("didSaveRecord"),this.get("isDirty")&&this._copyDirtyAttributesToData()},deleteRecord:function(){return this.constructor.adapter.deleteRecord(this)},didDeleteRecord:function(){this.constructor.removeFromRecordArrays(this),t(this,"isDeleted",!0),this.trigger("didDeleteRecord")},_copyDirtyAttributesToData:function(){var u,i,f,r,e;if(this._dirtyAttributes){for(u=this._dirtyAttributes,i=n(this,"_data"),i||(i={},t(this,"_data",i)),r=0,e=u.length;r<e;r++)f=u[r],i[this.dataKey(f)]=this.cacheFor(f);t(this,"_dirtyAttributes",[])}},dataDidChange:Ember.observer(function(){this._reloadHasManys()},"_data"),_registerHasManyArray:function(n){this._hasManyArrays||(this._hasManyArrays=Ember.A([])),this._hasManyArrays.pushObject(n)},_reloadHasManys:function(){var u,r,i,f;if(this._hasManyArrays)for(u=0;u<this._hasManyArrays.length;u++){for(i=this._hasManyArrays[u],f=this._getHasManyContent(n(i,"key"),n(i,"modelClass"),n(i,"embedded")),r=0;r<i.get("length");r++)i.objectAt(r).get("isNew")&&f.addObject(i.objectAt(r)._reference);t(i,"content",f)}},_getHasManyContent:function(t,i,r){var u=n(this,"_data."+t),f,o,e;return u&&(r?(o=n(i,"primaryKey"),f=function(n){return e=i._getOrCreateReferenceForId(n[o]),e.data=n,e}):f=function(n){return i._getOrCreateReferenceForId(n)},u=Ember.EnumerableUtils.map(u,f)),Ember.A(u||[])}}),Ember.Model.reopenClass({primaryKey:"id",adapter:Ember.Adapter.create(),_clientIdCounter:1,getAttributes:function(){this.proto();var n=this._attributes||[];return typeof this.superclass.getAttributes=="function"&&(n=this.superclass.getAttributes().concat(n)),n},getRelationships:function(){this.proto();var n=this._relationships||[];return typeof this.superclass.getRelationships=="function"&&(n=this.superclass.getRelationships().concat(n)),n},fetch:function(n){return arguments.length?Ember.isArray(n)?this._findFetchMany(n,!0):typeof n=="object"?this._findFetchQuery(n,!0):this._findFetchById(n,!0):this._findFetchAll(!0)},find:function(n){return arguments.length?Ember.isArray(n)?this._findFetchMany(n,!1):typeof n=="object"?this._findFetchQuery(n,!1):this._findFetchById(n,!1):this._findFetchAll(!1)},findQuery:function(n){return this._findFetchQuery(n,!1)},fetchQuery:function(n){return this._findFetchQuery(n,!0)},_findFetchQuery:function(n,t){var i=Ember.RecordArray.create({modelClass:this,_query:n}),r=this.adapter.findQuery(this,i,n);return t?r:i},findMany:function(n){return this._findFetchMany(n,!1)},fetchMany:function(n){return this._findFetchMany(n,!0)},_findFetchMany:function(n,t){Ember.assert("findFetchMany requires an array",Ember.isArray(n));var i=Ember.RecordArray.create({_ids:n,modelClass:this}),r;return this.recordArrays||(this.recordArrays=[]),this.recordArrays.push(i),this._currentBatchIds?(u(this._currentBatchIds,n),this._currentBatchRecordArrays.push(i)):(this._currentBatchIds=u([],n),this._currentBatchRecordArrays=[i]),t&&(r=Ember.Deferred.create(),Ember.set(r,"resolveWith",i),this._currentBatchDeferreds||(this._currentBatchDeferreds=[]),this._currentBatchDeferreds.push(r)),Ember.run.scheduleOnce("data",this,this._executeBatch),t?r:i},findAll:function(){return this._findFetchAll(!1)},fetchAll:function(){return this._findFetchAll(!0)},_findFetchAll:function(n){var r=this,i,t;return this._findAllRecordArray?n?new Ember.RSVP.Promise(function(n){n(r._findAllRecordArray)}):this._findAllRecordArray:(i=this._findAllRecordArray=Ember.RecordArray.create({modelClass:this}),t=this.adapter.findAll(this,i),t.then&&t.then(null,function(){return r._findAllRecordArray=null,Ember.RSVP.reject.apply(null,arguments)}),n?t:i)},findById:function(n){return this._findFetchById(n,!1)},fetchById:function(n){return this._findFetchById(n,!0)},_findFetchById:function(t,i){var r=this.cachedRecordForId(t),f=n(r,"isLoaded"),e=n(this,"adapter"),u;return f?i?new Ember.RSVP.Promise(function(n){n(r)}):r:(u=this._fetchById(r,t),i?u:r)},_currentBatchIds:null,_currentBatchRecordArrays:null,_currentBatchDeferreds:null,reload:function(n){var t=this.cachedRecordForId(n);return t.set("isLoaded",!1),this._fetchById(t,n)},_fetchById:function(t,i){var f=n(this,"adapter"),u;return f.findMany&&!f.findMany.isUnimplemented?(this._currentBatchIds?r(this._currentBatchIds,i)||this._currentBatchIds.push(i):(this._currentBatchIds=[i],this._currentBatchRecordArrays=[]),u=Ember.Deferred.create(),Ember.set(u,"resolveWith",t),this._currentBatchDeferreds||(this._currentBatchDeferreds=[]),this._currentBatchDeferreds.push(u),Ember.run.scheduleOnce("data",this,this._executeBatch),u):f.find(t,i)},_executeBatch:function(){var u=this._currentBatchIds,o=this._currentBatchRecordArrays,t=this._currentBatchDeferreds,s=this,i=[],f,r,e;for(this._currentBatchIds=null,this._currentBatchRecordArrays=null,this._currentBatchDeferreds=null,r=0;r<u.length;r++)this.cachedRecordForId(u[r]).get("isLoaded")||i.push(u[r]);i.length===1?f=n(this,"adapter").find(this.cachedRecordForId(i[0]),i[0]):(e=Ember.RecordArray.create({_ids:u}),i.length===0?(f=new Ember.RSVP.Promise(function(n){n(e)}),e.notifyLoaded()):f=n(this,"adapter").findMany(this,e,i)),f.then(function(){for(var r,n=0,i=o.length;n<i;n++)o[n].loadForFindMany(s);if(t)for(n=0,i=t.length;n<i;n++)r=Ember.get(t[n],"resolveWith"),t[n].resolve(r)}).then(null,function(n){if(t)for(var i=0,r=t.length;i<r;i++)t[i].reject(n)})},getCachedReferenceRecord:function(n){var t=this._getReferenceById(n);return t?t.record:undefined},cachedRecordForId:function(t){var i=this.getCachedReferenceRecord(t),f,r,u;return i||(f=n(this,"primaryKey"),r={isLoaded:!1},r[f]=t,i=this.create(r),u=this.sideloadedData&&this.sideloadedData[t],u&&i.load(t,u)),i},addToRecordArrays:function(n){this._findAllRecordArray&&this._findAllRecordArray.pushObject(n),this.recordArrays&&this.recordArrays.forEach(function(t){t instanceof Ember.FilteredRecordArray?(t.registerObserversOnRecord(n),t.updateFilter()):t.pushObject(n)})},unload:function(t){this.removeFromRecordArrays(t);var i=t.get(n(this,"primaryKey"));this.removeFromCache(i)},clearCache:function(){this.sideloadedData=undefined,this._referenceCache=undefined},removeFromCache:function(n){this.sideloadedData&&this.sideloadedData[n]&&delete this.sideloadedData[n],this._referenceCache&&this._referenceCache[n]&&delete this._referenceCache[n]},removeFromRecordArrays:function(n){this._findAllRecordArray&&this._findAllRecordArray.removeObject(n),this.recordArrays&&this.recordArrays.forEach(function(t){t.removeObject(n)})},findFromCacheOrLoad:function(t){var i;return i=t[n(this,"primaryKey")]?this.cachedRecordForId(t[n(this,"primaryKey")]):this.create({isLoaded:!1}),i.load(t[n(this,"primaryKey")],t),i},registerRecordArray:function(n){this.recordArrays||(this.recordArrays=[]),this.recordArrays.push(n)},unregisterRecordArray:function(n){this.recordArrays&&Ember.A(this.recordArrays).removeObject(n)},forEachCachedRecord:function(n){if(this._referenceCache){var t=Object.keys(this._referenceCache);t.map(function(n){return this._getReferenceById(n).record},this).forEach(n)}},load:function(t){var i,f;for(Ember.typeOf(t)!=="array"&&(t=[t]),this.sideloadedData||(this.sideloadedData={}),i=0,f=t.length;i<f;i++){var r=t[i],u=r[n(this,"primaryKey")],e=this.getCachedReferenceRecord(u);e?e.load(u,r):this.sideloadedData[u]=r}},_getReferenceById:function(n){return this._referenceCache||(this._referenceCache={}),this._referenceCache[n]},_getOrCreateReferenceForId:function(n){var t=this._getReferenceById(n);return t||(t=this._createReference(n)),t},_createReference:function(n){this._referenceCache||(this._referenceCache={}),Ember.assert("The id "+n+" has alread been used with another record of type "+this.toString()+".",!n||!this._referenceCache[n]);var t={id:n,clientId:this._clientIdCounter++};return this._cacheReference(t),t},_cacheReference:function(n){this._referenceCache||(this._referenceCache={}),n.id&&(this._referenceCache[n.id]=n)}})}(),function(){var n=Ember.get;Ember.hasMany=function(n,t){t=t||{};var i={type:n,isRelationship:!0,options:t,kind:"hasMany"},r=t.key;return Ember.computed(function(){return typeof n=="string"&&(n=Ember.get(Ember.lookup,n)),this.getHasMany(r,n,i)}).property().meta(i)},Ember.Model.reopen({getHasMany:function(n,t,i){var r=i.options.embedded,f=r?Ember.EmbeddedHasManyArray:Ember.HasManyArray,u=f.create({parent:this,modelClass:t,content:this._getHasManyContent(n,t,r),embedded:r,key:n,relationshipKey:i.relationshipKey});return this._registerHasManyArray(u),u}})}(),function(){function i(){return typeof this.type=="string"&&(this.type=Ember.get(Ember.lookup,this.type)),this.type}var n=Ember.get,t=Ember.set;Ember.belongsTo=function(r,u){u=u||{};var f={type:r,isRelationship:!0,options:u,kind:"belongsTo",getType:i},e=u.key;return Ember.computed(function(i,u,o){r=f.getType();var s=n(this,"_dirtyAttributes"),h=!1;return s||(s=[],h=!0),arguments.length>1?(u&&(Ember.assert(Ember.String.fmt("Attempted to set property of type: %@ with a value of type: %@",[u.constructor,r]),u instanceof r),o!==u?s.pushObject(i):s.removeObject(i),h&&t(this,"_dirtyAttributes",s)),u===undefined?null:u):this.getBelongsTo(e,r,f)}).property("_data").meta(f)},Ember.Model.reopen({getBelongsTo:function(t,i,r){var u=n(this,"_data."+t),f,o,e;return Ember.isNone(u)?null:(r.options.embedded?(o=n(i,"primaryKey"),e=u[o],f=i.create({isLoaded:!1,id:e}),f.load(e,u)):f=i.find(u),f)}})}(),function(){function r(n,t){return t&&t.deserialize?t.deserialize(n):t&&Ember.Model.dataTypes[t]?Ember.Model.dataTypes[t].deserialize(n):n}function u(n,t){return t&&t.serialize?t.serialize(n):t&&Ember.Model.dataTypes[t]?Ember.Model.dataTypes[t].serialize(n):n}var n=Ember.get,t=Ember.set,i=Ember.meta;Ember.Model.dataTypes={},Ember.Model.dataTypes[Date]={deserialize:function(n){return n?new Date(n):null},serialize:function(n){return n?n.toISOString():null},isEqual:function(n,t){return n instanceof Date&&(n=this.serialize(n)),t instanceof Date&&(t=this.serialize(t)),n===t}},Ember.Model.dataTypes[Number]={deserialize:function(n){return!n&&n!==0?null:Number(n)},serialize:function(n){return!n&&n!==0?null:Number(n)}},Ember.attr=function(f,e){return Ember.computed(function(o,s){var h=n(this,"_data"),a=this.dataKey(o),l=h&&n(h,a),y=i(this).proto===this,c=n(this,"_dirtyAttributes"),v=!1;return(c||(c=[],v=!0),arguments.length===2)?(y&&(h||(h={},t(this,"_data",h)),l=h[a]=s),l!==u(s,f)?c.pushObject(o):c.removeObject(o),v&&t(this,"_dirtyAttributes",c),s):l==null&&e&&e.defaultValue!=null?Ember.copy(e.defaultValue):this.getAttr(o,r(l,f))}).property("_data").meta({isAttribute:!0,type:f,options:e})}}(),function(){var n=Ember.get;Ember.RESTAdapter=Ember.Adapter.extend({find:function(n,t){var i=this.buildURL(n.constructor,t),r=this;return this.ajax(i).then(function(i){return r.didFind(n,t,i),n})},didFind:function(t,i,r){var u=n(t.constructor,"rootKey"),f=u?r[u]:r;t.load(i,f)},findAll:function(n,t){var i=this.buildURL(n),r=this;return this.ajax(i).then(function(i){return r.didFindAll(n,t,i),t})},didFindAll:function(t,i,r){var u=n(t,"collectionKey"),f=u?r[u]:r;i.load(t,f)},findQuery:function(n,t,i){var r=this.buildURL(n),u=this;return this.ajax(r,i).then(function(r){return u.didFindQuery(n,t,i,r),t})},didFindQuery:function(t,i,r,u){var f=n(t,"collectionKey"),e=f?u[f]:u;i.load(t,e)},createRecord:function(n){var t=this.buildURL(n.constructor),i=this;return this.ajax(t,n.toJSON(),"POST").then(function(t){return i.didCreateRecord(n,t),n})},didCreateRecord:function(t,i){var r=n(t.constructor,"rootKey"),f=n(t.constructor,"primaryKey"),u=r?i[r]:i;t.load(u[f],u),t.didCreateRecord()},saveRecord:function(t){var i=n(t.constructor,"primaryKey"),r=this.buildURL(t.constructor,n(t,i)),u=this;return this.ajax(r,t.toJSON(),"PUT").then(function(n){return u.didSaveRecord(t,n),t})},didSaveRecord:function(n){n.didSaveRecord()},deleteRecord:function(t){var i=n(t.constructor,"primaryKey"),r=this.buildURL(t.constructor,n(t,i)),u=this;return this.ajax(r,t.toJSON(),"DELETE").then(function(n){u.didDeleteRecord(t,n)})},didDeleteRecord:function(n){n.didDeleteRecord()},ajax:function(n,t,i,r){return this._ajax(n,t,i||"GET",r)},buildURL:function(t,i){var r=n(t,"url");if(!r)throw new Error("Ember.RESTAdapter requires a `url` property to be specified");return Ember.isEmpty(i)?r+".json":r+"/"+i+".json"},ajaxSettings:function(n,t){return{url:n,type:t,dataType:"json"}},_ajax:function(n,t,i,r){return r||(r=this.ajaxSettings(n,i)),new Ember.RSVP.Promise(function(n,u){t&&(i==="GET"?r.data=t:(r.contentType="application/json; charset=utf-8",r.data=JSON.stringify(t))),r.success=function(t){Ember.run(null,n,t)},r.error=function(n){n&&(n.then=null),Ember.run(null,u,n)},Ember.$.ajax(r)})}})}(),function(){var n=Ember.get;Ember.LoadPromise=Ember.Object.extend(Ember.DeferredMixin,{init:function(){this._super.apply(this,arguments);var t=n(this,"target");if(n(t,"isLoaded")&&!n(t,"isNew"))this.resolve(t);else t.one("didLoad",this,function(){this.resolve(t)})}}),Ember.loadPromise=function(n){return Ember.isNone(n)?null:n.then?n:Ember.LoadPromise.create({target:n})}}(),function(){if(Ember.DataAdapter){var n=Ember.get,t=Ember.String.capitalize,i=Ember.String.underscore,r=Ember.DataAdapter.extend({getFilters:function(){return[{name:"isNew",desc:"New"},{name:"isModified",desc:"Modified"},{name:"isClean",desc:"Clean"}]},detect:function(n){return n!==Ember.Model&&Ember.Model.detect(n)},columnsForType:function(n){var r=[],u=0,f=this;return n.getAttributes().forEach(function(n){if(u++>f.attributeLimit)return!1;var e=t(i(n).replace("_"," "));r.push({name:n,desc:e})}),r},getRecords:function(n){var t=[];return n.forEachCachedRecord(function(n){t.push(n)}),t},getRecordColumnValues:function(t){var r=this,u=0,i={id:n(t,"id")};return t.constructor.getAttributes().forEach(function(f){if(u++>r.attributeLimit)return!1;var e=n(t,f);i[f]=e}),i},getRecordKeywords:function(t){var i=[],r=Ember.A(["id"]);return t.constructor.getAttributes().forEach(function(n){r.push(n)}),r.forEach(function(r){i.push(n(t,r))}),i},getRecordFilterValues:function(n){return{isNew:n.get("isNew"),isModified:n.get("isDirty")&&!n.get("isNew"),isClean:!n.get("isDirty")}},getRecordColor:function(n){var t="black";return n.get("isNew")?t="green":n.get("isDirty")&&(t="blue"),t},observeRecord:function(n,t){var i=Ember.A(),u=this,r=Ember.A(["id","isNew","isDirty"]);return n.constructor.getAttributes().forEach(function(n){r.push(n)}),r.forEach(function(r){var f=function(){t(u.wrapRecord(n))};Ember.addObserver(n,r,f),i.push(function(){Ember.removeObserver(n,r,f)})}),function(){i.forEach(function(n){n()})}}});Ember.onLoad("Ember.Application",function(n){n.initializer({name:"dataAdapter",initialize:function(n,t){t.register("dataAdapter:main",r)}})})}}()
admin/views/slider-panel/js/ember.min.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * @overview Ember - JavaScript Application Framework
3
+ * @copyright Copyright 2011-2014 Tilde Inc. and contributors
4
+ * Portions Copyright 2006-2011 Strobe Inc.
5
+ * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
6
+ * @license Licensed under MIT license
7
+ * See https://raw.github.com/emberjs/ember.js/master/LICENSE
8
+ * @version 1.5.1
9
+ */
10
+ !function(){var e,t,r,n;!function(){var i={},o={};e=function(e,t,r){i[e]={deps:t,callback:r}},n=r=t=function(e){function r(t){if("."!==t.charAt(0))return t;for(var r=t.split("/"),n=e.split("/").slice(0,-1),i=0,o=r.length;o>i;i++){var a=r[i];if(".."===a)n.pop();else{if("."===a)continue;n.push(a)}}return n.join("/")}if(n._eak_seen=i,o[e])return o[e];if(o[e]={},!i[e])throw new Error("Could not find module "+e);for(var a,s=i[e],u=s.deps,l=s.callback,c=[],h=0,m=u.length;m>h;h++)"exports"===u[h]?c.push(a={}):c.push(t(r(u[h])));var p=l.apply(this,c);return o[e]=a||p}}(),function(){"undefined"==typeof Ember&&(Ember={});{var e=(Ember.imports=Ember.imports||this,Ember.exports=Ember.exports||this);Ember.lookup=Ember.lookup||this}e.Em=e.Ember=Em=Ember,Ember.isNamespace=!0,Ember.toString=function(){return"Ember"},Ember.VERSION="1.5.1",Ember.ENV||(Ember.ENV="undefined"!=typeof EmberENV?EmberENV:"undefined"!=typeof ENV?ENV:{}),Ember.config=Ember.config||{},"undefined"==typeof Ember.ENV.DISABLE_RANGE_API&&(Ember.ENV.DISABLE_RANGE_API=!0),"undefined"==typeof MetamorphENV&&(e.MetamorphENV={}),MetamorphENV.DISABLE_RANGE_API=Ember.ENV.DISABLE_RANGE_API,Ember.FEATURES=Ember.ENV.FEATURES||{},Ember.FEATURES.isEnabled=function(e){var t=Ember.FEATURES[e];return Ember.ENV.ENABLE_ALL_FEATURES?!0:t===!0||t===!1||void 0===t?t:Ember.ENV.ENABLE_OPTIONAL_FEATURES?!0:!1},Ember.EXTEND_PROTOTYPES=Ember.ENV.EXTEND_PROTOTYPES,"undefined"==typeof Ember.EXTEND_PROTOTYPES&&(Ember.EXTEND_PROTOTYPES=!0),Ember.LOG_STACKTRACE_ON_DEPRECATION=Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION!==!1,Ember.SHIM_ES5=Ember.ENV.SHIM_ES5===!1?!1:Ember.EXTEND_PROTOTYPES,Ember.LOG_VERSION=Ember.ENV.LOG_VERSION===!1?!1:!0,Ember.K=function(){return this},"undefined"==typeof Ember.assert&&(Ember.assert=Ember.K),"undefined"==typeof Ember.warn&&(Ember.warn=Ember.K),"undefined"==typeof Ember.debug&&(Ember.debug=Ember.K),"undefined"==typeof Ember.runInDebug&&(Ember.runInDebug=Ember.K),"undefined"==typeof Ember.deprecate&&(Ember.deprecate=Ember.K),"undefined"==typeof Ember.deprecateFunc&&(Ember.deprecateFunc=function(e,t){return t}),Ember.uuid=0,Ember.merge=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e},Ember.isNone=function(e){return null===e||void 0===e},Ember.none=Ember.deprecateFunc("Ember.none is deprecated. Please use Ember.isNone instead.",Ember.isNone),Ember.isEmpty=function(e){return Ember.isNone(e)||0===e.length&&"function"!=typeof e||"object"==typeof e&&0===Ember.get(e,"length")},Ember.empty=Ember.deprecateFunc("Ember.empty is deprecated. Please use Ember.isEmpty instead.",Ember.isEmpty),Ember.isBlank=function(e){return Ember.isEmpty(e)||"string"==typeof e&&null===e.match(/\S/)}}(),function(){var e=Ember.platform={};if(Ember.create=Object.create,Ember.create&&2!==Ember.create({a:1},{a:{value:2}}).a&&(Ember.create=null),!Ember.create||Ember.ENV.STUB_OBJECT_CREATE){var t=function(){};Ember.create=function(e,r){if(t.prototype=e,e=new t,r){t.prototype=e;for(var n in r)t.prototype[n]=r[n].value;e=new t}return t.prototype=null,e},Ember.create.isSimulated=!0}var r,n,i=Object.defineProperty;if(i)try{i({},"a",{get:function(){}})}catch(o){i=null}i&&(r=function(){var e={};return i(e,"a",{configurable:!0,enumerable:!0,get:function(){},set:function(){}}),i(e,"a",{configurable:!0,enumerable:!0,writable:!0,value:!0}),e.a===!0}(),n=function(){try{return i(document.createElement("div"),"definePropertyOnDOM",{}),!0}catch(e){}return!1}(),r?n||(i=function(e,t,r){var n;return n="object"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName,n?e[t]=r.value:Object.defineProperty(e,t,r)}):i=null),e.defineProperty=i,e.hasPropertyAccessors=!0,e.defineProperty||(e.hasPropertyAccessors=!1,e.defineProperty=function(e,t,r){r.get||(e[t]=r.value)},e.defineProperty.isSimulated=!0),Ember.ENV.MANDATORY_SETTER&&!e.hasPropertyAccessors&&(Ember.ENV.MANDATORY_SETTER=!1)}(),function(){var e=function(e){return e&&Function.prototype.toString.call(e).indexOf("[native code]")>-1},t=e(Array.prototype.map)?Array.prototype.map:function(e){if(void 0===this||null===this)throw new TypeError;var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=new Array(r),i=arguments[1],o=0;r>o;o++)o in t&&(n[o]=e.call(i,t[o],o,t));return n},r=e(Array.prototype.forEach)?Array.prototype.forEach:function(e){if(void 0===this||null===this)throw new TypeError;var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=arguments[1],i=0;r>i;i++)i in t&&e.call(n,t[i],i,t)},n=e(Array.prototype.indexOf)?Array.prototype.indexOf:function(e,t){null===t||void 0===t?t=0:0>t&&(t=Math.max(0,this.length+t));for(var r=t,n=this.length;n>r;r++)if(this[r]===e)return r;return-1},i=e(Array.prototype.filter)?Array.prototype.filter:function(e,t){var r,n,i=[],o=this.length;for(r=0;o>r;r++)this.hasOwnProperty(r)&&(n=this[r],e.call(t,n,r,this)&&i.push(n));return i};Ember.ArrayPolyfills={map:t,forEach:r,filter:i,indexOf:n},Ember.SHIM_ES5&&(Array.prototype.map||(Array.prototype.map=t),Array.prototype.forEach||(Array.prototype.forEach=r),Array.prototype.filter||(Array.prototype.filter=i),Array.prototype.indexOf||(Array.prototype.indexOf=n))}(),function(){var e=["description","fileName","lineNumber","message","name","number","stack"];Ember.Error=function(){var t=Error.apply(this,arguments);Error.captureStackTrace&&Error.captureStackTrace(this,Ember.Error);for(var r=0;r<e.length;r++)this[e[r]]=t[e[r]]},Ember.Error.prototype=Ember.create(Error.prototype),Ember.onerror=null}(),function(){function e(e){this.descs={},this.watching={},this.cache={},this.cacheMeta={},this.source=e}function t(e,t){return!(!e||"function"!=typeof e[t])}Ember.GUID_PREFIX="ember";var r=Ember.platform.defineProperty,n=Ember.create,i="__ember"+ +new Date,o=[],a={},s=0,u=Ember.ENV.MANDATORY_SETTER;Ember.GUID_KEY=i;var l={writable:!1,configurable:!1,enumerable:!1,value:null};Ember.generateGuid=function(e,t){t||(t=Ember.GUID_PREFIX);var n=t+s++;return e&&(null===e[i]?e[i]=n:(l.value=n,r(e,i,l))),n},Ember.guidFor=function(e){if(void 0===e)return"(undefined)";if(null===e)return"(null)";var t,n=typeof e;switch(n){case"number":return t=o[e],t||(t=o[e]="nu"+e),t;case"string":return t=a[e],t||(t=a[e]="st"+s++),t;case"boolean":return e?"(true)":"(false)";default:return e[i]?e[i]:e===Object?"(Object)":e===Array?"(Array)":(t="ember"+s++,null===e[i]?e[i]=t:(l.value=t,r(e,i,l)),t)}};var c=Ember.META_DESC={writable:!0,configurable:!1,enumerable:!1,value:null},h=Ember.GUID_KEY+"_meta";Ember.META_KEY=h;var m=Ember.platform.defineProperty.isSimulated;e.prototype={descs:null,deps:null,watching:null,listeners:null,cache:null,cacheMeta:null,source:null,mixins:null,bindings:null,chains:null,chainWatchers:null,values:null,proto:null},m&&(e.prototype.__preventPlainObject__=!0,e.prototype.toJSON=function(){});var p=new e(null);u&&(p.values={}),Ember.EMPTY_META=p,Ember.meta=function(t,i){var o=t[h];return i===!1?o||p:(o?o.source!==t&&(m||r(t,h,c),o=n(o),o.descs=n(o.descs),o.watching=n(o.watching),o.cache={},o.cacheMeta={},o.source=t,u&&(o.values=n(o.values)),t[h]=o):(m||r(t,h,c),o=new e(t),u&&(o.values={}),t[h]=o,o.descs.constructor=null),o)},Ember.getMeta=function(e,t){var r=Ember.meta(e,!1);return r[t]},Ember.setMeta=function(e,t,r){var n=Ember.meta(e,!0);return n[t]=r,r},Ember.metaPath=function(e,t,r){for(var i,o,a=Ember.meta(e,r),s=0,u=t.length;u>s;s++){if(i=t[s],o=a[i]){if(o.__ember_source__!==e){if(!r)return void 0;o=a[i]=n(o),o.__ember_source__=e}}else{if(!r)return void 0;o=a[i]={__ember_source__:e}}a=o}return o},Ember.wrap=function(e,t){function r(){var r,n=this.__nextSuper;return this.__nextSuper=t,r=e.apply(this,arguments),this.__nextSuper=n,r}return r.wrappedFunction=e,r.__ember_observes__=e.__ember_observes__,r.__ember_observesBefore__=e.__ember_observesBefore__,r.__ember_listens__=e.__ember_listens__,r},Ember.isArray=function(e){return!e||e.setInterval?!1:Array.isArray&&Array.isArray(e)?!0:Ember.Array&&Ember.Array.detect(e)?!0:void 0!==e.length&&"object"==typeof e?!0:!1},Ember.makeArray=function(e){return null===e||void 0===e?[]:Ember.isArray(e)?e:[e]},Ember.canInvoke=t,Ember.tryInvoke=function(e,r,n){return t(e,r)?e[r].apply(e,n||[]):void 0};var f=function(){var e=0;try{try{}finally{throw e++,new Error("needsFinallyFixTest")}}catch(t){}return 1!==e}();Ember.tryFinally=f?function(e,t,r){var n,i,o;r=r||this;try{n=e.call(r)}finally{try{i=t.call(r)}catch(a){o=a}}if(o)throw o;return void 0===i?n:i}:function(e,t,r){var n,i;r=r||this;try{n=e.call(r)}finally{i=t.call(r)}return void 0===i?n:i},Ember.tryCatchFinally=f?function(e,t,r,n){var i,o,a;n=n||this;try{i=e.call(n)}catch(s){i=t.call(n,s)}finally{try{o=r.call(n)}catch(u){a=u}}if(a)throw a;return void 0===o?i:o}:function(e,t,r,n){var i,o;n=n||this;try{i=e.call(n)}catch(a){i=t.call(n,a)}finally{o=r.call(n)}return void 0===o?i:o};var d={},b="Boolean Number String Function Array Date RegExp Object".split(" ");Ember.ArrayPolyfills.forEach.call(b,function(e){d["[object "+e+"]"]=e.toLowerCase()});var v=Object.prototype.toString;Ember.typeOf=function(e){var t;return t=null===e||void 0===e?String(e):d[v.call(e)]||"object","function"===t?Ember.Object&&Ember.Object.detect(e)&&(t="class"):"object"===t&&(e instanceof Error?t="error":Ember.Object&&e instanceof Ember.Object?t="instance":e instanceof Date&&(t="date")),t},Ember.inspect=function(e){var t=Ember.typeOf(e);if("array"===t)return"["+e+"]";if("object"!==t)return e+"";var r,n=[];for(var i in e)if(e.hasOwnProperty(i)){if(r=e[i],"toString"===r)continue;"function"===Ember.typeOf(r)&&(r="function() { ... }"),n.push(i+": "+r)}return"{"+n.join(", ")+"}"}}(),function(){Ember.Instrumentation={};var e=[],t={},r=function(r){for(var n,i=[],o=0,a=e.length;a>o;o++)n=e[o],n.regex.test(r)&&i.push(n.object);return t[r]=i,i},n=function(){var e="undefined"!=typeof window?window.performance||{}:{},t=e.now||e.mozNow||e.webkitNow||e.msNow||e.oNow;return t?t.bind(e):function(){return+new Date}}();Ember.Instrumentation.instrument=function(e,i,o,a){function s(){for(f=0,d=m.length;d>f;f++)p=m[f],b[f]=p.before(e,n(),i);return o.call(a)}function u(e){i=i||{},i.exception=e}function l(){for(f=0,d=m.length;d>f;f++)p=m[f],p.after(e,n(),i,b[f]);Ember.STRUCTURED_PROFILE&&console.timeEnd(c)}var c,h,m=t[e];if(Ember.STRUCTURED_PROFILE&&(c=e+": "+i.object,console.time(c)),m||(m=r(e)),0===m.length)return h=o.call(a),Ember.STRUCTURED_PROFILE&&console.timeEnd(c),h;var p,f,d,b=[];return Ember.tryCatchFinally(s,u,l)},Ember.Instrumentation.subscribe=function(r,n){for(var i,o=r.split("."),a=[],s=0,u=o.length;u>s;s++)i=o[s],"*"===i?a.push("[^\\.]*"):a.push(i);a=a.join("\\."),a+="(\\..*)?";var l={pattern:r,regex:new RegExp("^"+a+"$"),object:n};return e.push(l),t={},l},Ember.Instrumentation.unsubscribe=function(r){for(var n,i=0,o=e.length;o>i;i++)e[i]===r&&(n=i);e.splice(n,1),t={}},Ember.Instrumentation.reset=function(){e=[],t={}},Ember.instrument=Ember.Instrumentation.instrument,Ember.subscribe=Ember.Instrumentation.subscribe}(),function(){var e,t,r,n,i;e=Array.prototype.map||Ember.ArrayPolyfills.map,t=Array.prototype.forEach||Ember.ArrayPolyfills.forEach,r=Array.prototype.indexOf||Ember.ArrayPolyfills.indexOf,i=Array.prototype.filter||Ember.ArrayPolyfills.filter,n=Array.prototype.splice;var o=Ember.EnumerableUtils={map:function(t,r,n){return t.map?t.map.call(t,r,n):e.call(t,r,n)},forEach:function(e,r,n){return e.forEach?e.forEach.call(e,r,n):t.call(e,r,n)},filter:function(e,t,r){return e.filter?e.filter.call(e,t,r):i.call(e,t,r)},indexOf:function(e,t,n){return e.indexOf?e.indexOf.call(e,t,n):r.call(e,t,n)},indexesOf:function(e,t){return void 0===t?[]:o.map(t,function(t){return o.indexOf(e,t)})},addObject:function(e,t){var r=o.indexOf(e,t);-1===r&&e.push(t)},removeObject:function(e,t){var r=o.indexOf(e,t);-1!==r&&e.splice(r,1)},_replace:function(e,t,r,i){for(var o,a,s=[].concat(i),u=[],l=6e4,c=t,h=r;s.length;)a=h>l?l:h,0>=a&&(a=0),o=s.splice(0,l),o=[c,a].concat(o),c+=l,h-=a,u=u.concat(n.apply(e,o));return u},replace:function(e,t,r,n){return e.replace?e.replace(t,r,n):o._replace(e,t,r,n)},intersection:function(e,t){var r=[];return o.forEach(e,function(e){o.indexOf(t,e)>=0&&r.push(e)}),r}}}(),function(){var e,t=Ember.META_KEY,r=Ember.ENV.MANDATORY_SETTER,n=/^([A-Z$]|([0-9][A-Z$])).*[\.\*]/,i=/^this[\.\*]/,o=/^([^\.\*]+)/;e=function(e,n){if(""===n)return e;if(n||"string"!=typeof e||(n=e,e=null),null===e||-1!==n.indexOf("."))return s(e,n);var i,o=e[t],a=o&&o.descs[n];return a?a.get(e,n):(i=r&&o&&o.watching[n]>0?o.values[n]:e[n],void 0!==i||"object"!=typeof e||n in e||"function"!=typeof e.unknownProperty?i:e.unknownProperty(n))},Ember.config.overrideAccessors&&(Ember.get=e,Ember.config.overrideAccessors(),e=Ember.get);var a=Ember.normalizeTuple=function(t,r){var a,s=i.test(r),u=!s&&n.test(r);if((!t||u)&&(t=Ember.lookup),s&&(r=r.slice(5)),t===Ember.lookup&&(a=r.match(o)[0],t=e(t,a),r=r.slice(a.length+1)),!r||0===r.length)throw new Ember.Error("Path cannot be empty");return[t,r]},s=Ember._getPath=function(t,r){var n,o,s,u,l;if(null===t&&-1===r.indexOf("."))return e(Ember.lookup,r);for(n=i.test(r),(!t||n)&&(s=a(t,r),t=s[0],r=s[1],s.length=0),o=r.split("."),l=o.length,u=0;null!=t&&l>u;u++)if(t=e(t,o[u],!0),t&&t.isDestroyed)return void 0;return t};Ember.getWithDefault=function(t,r,n){var i=e(t,r);return void 0===i?n:i},Ember.get=e}(),function(){function e(e,t,r){for(var n=-1,i=e.length-3;i>=0;i-=3)if(t===e[i]&&r===e[i+1]){n=i;break}return n}function t(e,t){var r,n=p(e,!0);return n.listeners||(n.listeners={}),n.hasOwnProperty("listeners")||(n.listeners=m(n.listeners)),r=n.listeners[t],r&&!n.listeners.hasOwnProperty(t)?r=n.listeners[t]=n.listeners[t].slice():r||(r=n.listeners[t]=[]),r}function r(t,r,n){var i=t[f],o=i&&i.listeners&&i.listeners[r];if(o)for(var a=o.length-3;a>=0;a-=3){var s=o[a],u=o[a+1],l=o[a+2],c=e(n,s,u);-1===c&&n.push(s,u,l)}}function n(t,r,n){var i=t[f],o=i&&i.listeners&&i.listeners[r],a=[];if(o){for(var s=o.length-3;s>=0;s-=3){var u=o[s],l=o[s+1],c=o[s+2],h=e(n,u,l);-1===h&&(n.push(u,l,c),a.push(u,l,c))}return a}}function i(r,n,i,o,a){o||"function"!=typeof i||(o=i,i=null);var s=t(r,n),u=e(s,i,o),l=0;a&&(l|=b),-1===u&&(s.push(i,o,l),"function"==typeof r.didAddListener&&r.didAddListener(n,i,o))}function o(r,n,i,o){function a(i,o){var a=t(r,n),s=e(a,i,o);-1!==s&&(a.splice(s,3),"function"==typeof r.didRemoveListener&&r.didRemoveListener(n,i,o))}if(o||"function"!=typeof i||(o=i,i=null),o)a(i,o);else{var s=r[f],u=s&&s.listeners&&s.listeners[n];if(!u)return;for(var l=u.length-3;l>=0;l-=3)a(u[l],u[l+1])}}function a(r,n,i,o,a){function s(){return a.call(i)}function u(){-1!==c&&(l[c+2]&=~v)}o||"function"!=typeof i||(o=i,i=null);var l=t(r,n),c=e(l,i,o);return-1!==c&&(l[c+2]|=v),Ember.tryFinally(s,u)}function s(r,n,i,o,a){function s(){return a.call(i)}function u(){for(var e=0,t=p.length;t>e;e++){var r=p[e];f[e][r+2]&=~v}}o||"function"!=typeof i||(o=i,i=null);var l,c,h,m,p=[],f=[];for(h=0,m=n.length;m>h;h++){l=n[h],c=t(r,l);var d=e(c,i,o);-1!==d&&(c[d+2]|=v,p.push(d),f.push(c))}return Ember.tryFinally(s,u)}function u(e){var t=e[f].listeners,r=[];if(t)for(var n in t)t[n]&&r.push(n);return r}function l(e,t,r,n){if(e!==Ember&&"function"==typeof e.sendEvent&&e.sendEvent(t,r),!n){var i=e[f];n=i&&i.listeners&&i.listeners[t]}if(n){for(var a=n.length-3;a>=0;a-=3){var s=n[a],u=n[a+1],l=n[a+2];u&&(l&v||(l&b&&o(e,t,s,u),s||(s=e),"string"==typeof u&&(u=s[u]),r?u.apply(s,r):u.call(s)))}return!0}}function c(e,t){var r=e[f],n=r&&r.listeners&&r.listeners[t];return!(!n||!n.length)}function h(e,t){var r=[],n=e[f],i=n&&n.listeners&&n.listeners[t];if(!i)return r;for(var o=0,a=i.length;a>o;o+=3){var s=i[o],u=i[o+1];r.push([s,u])}return r}var m=Ember.create,p=Ember.meta,f=Ember.META_KEY,d=[].slice,b=1,v=2;Ember.on=function(){var e=d.call(arguments,-1)[0],t=d.call(arguments,0,-1);return e.__ember_listens__=t,e},Ember.addListener=i,Ember.removeListener=o,Ember._suspendListener=a,Ember._suspendListeners=s,Ember.sendEvent=l,Ember.hasListeners=c,Ember.watchedEvents=u,Ember.listenersFor=h,Ember.listenersDiff=n,Ember.listenersUnion=r}(),function(){var e=Ember.guidFor,t=Ember.sendEvent,r=Ember._ObserverSet=function(){this.clear()};r.prototype.add=function(t,r,n){var i,o=this.observerSet,a=this.observers,s=e(t),u=o[s];return u||(o[s]=u={}),i=u[r],void 0===i&&(i=a.push({sender:t,keyName:r,eventName:n,listeners:[]})-1,u[r]=i),a[i].listeners},r.prototype.flush=function(){var e,r,n,i,o=this.observers;for(this.clear(),e=0,r=o.length;r>e;++e)n=o[e],i=n.sender,i.isDestroying||i.isDestroyed||t(i,n.eventName,[i,n.keyName],n.listeners)},r.prototype.clear=function(){this.observerSet={},this.observers=[]}}(),function(){function e(e,t){var n=e[h],i=n&&n.watching[t]>0||"length"===t,a=n&&n.proto,s=n&&n.descs[t];i&&a!==e&&(s&&s.willChange&&s.willChange(e,t),r(e,t,n),o(e,t,n),l(e,t))}function t(e,t){var r=e[h],i=r&&r.watching[t]>0||"length"===t,o=r&&r.proto,s=r&&r.descs[t];o!==e&&(s&&s.didChange&&s.didChange(e,t),(i||"length"===t)&&(n(e,t,r),a(e,t,r,!1),c(e,t)))}function r(t,r,n){if(!t.isDestroying){var o=_,a=!o;a&&(o=_={}),i(e,t,r,o,n),a&&(_=null)}}function n(e,r,n){if(!e.isDestroying){var o=w,a=!o;a&&(o=w={}),i(t,e,r,o,n),a&&(w=null)}}function i(e,t,r,n,i){var o=m(t);if(n[o]||(n[o]={}),!n[o][r]){n[o][r]=!0;var a=i.deps;if(a=a&&a[r])for(var s in a){var u=i.descs[s];u&&u._suspended===t||e(t,s)}}}function o(t,r,n){if(n.hasOwnProperty("chainWatchers")&&n.chainWatchers[r]){var i,o,a=n.chainWatchers[r],s=[];for(i=0,o=a.length;o>i;i++)a[i].willChange(s);for(i=0,o=s.length;o>i;i+=2)e(s[i],s[i+1])}}function a(e,r,n,i){if(n&&n.hasOwnProperty("chainWatchers")&&n.chainWatchers[r]){var o,a,s=n.chainWatchers[r],u=i?null:[];for(o=0,a=s.length;a>o;o++)s[o].didChange(u);if(!i)for(o=0,a=u.length;a>o;o+=2)t(u[o],u[o+1])}}function s(){y++}function u(){y--,0>=y&&(E.clear(),g.flush())}function l(e,t){if(!e.isDestroying){var r,n,i=t+":before";y?(r=E.add(e,t,i),n=b(e,i,r),f(e,i,[e,t],n)):f(e,i,[e,t])}}function c(e,t){if(!e.isDestroying){var r,n=t+":change";y?(r=g.add(e,t,n),d(e,n,r)):f(e,n,[e,t])}}var h=Ember.META_KEY,m=Ember.guidFor,p=Ember.tryFinally,f=Ember.sendEvent,d=Ember.listenersUnion,b=Ember.listenersDiff,v=Ember._ObserverSet,E=new v,g=new v,y=0;Ember.propertyWillChange=e,Ember.propertyDidChange=t;var _,w;Ember.overrideChains=function(e,t,r){a(e,t,r,!0)},Ember.beginPropertyChanges=s,Ember.endPropertyChanges=u,Ember.changeProperties=function(e,t){s(),p(e,u,t)}}(),function(){function e(e,t,r,o){var a;if(a=t.slice(t.lastIndexOf(".")+1),t=t===a?a:t.slice(0,t.length-(a.length+1)),"this"!==t&&(e=n(e,t)),!a||0===a.length)throw new Ember.Error("Property set failed: You passed an empty path");if(!e){if(o)return;throw new Ember.Error('Property set failed: object in path "'+t+'" could not be found or was destroyed.')}return i(e,a,r)}var t=Ember.META_KEY,r=Ember.ENV.MANDATORY_SETTER,n=Ember._getPath,i=function(n,i,o,a){if("string"==typeof n&&(o=i,i=n,n=null),!n||-1!==i.indexOf("."))return e(n,i,o,a);var s,u,l=n[t],c=l&&l.descs[i];return c?c.set(n,i,o):(s="object"==typeof n&&!(i in n),s&&"function"==typeof n.setUnknownProperty?n.setUnknownProperty(i,o):l&&l.watching[i]>0?(u=r?l.values[i]:n[i],o!==u&&(Ember.propertyWillChange(n,i),r?(void 0!==u||i in n)&&n.propertyIsEnumerable(i)?l.values[i]=o:Ember.defineProperty(n,i,null,o):n[i]=o,Ember.propertyDidChange(n,i))):n[i]=o),o};Ember.config.overrideAccessors&&(Ember.set=i,Ember.config.overrideAccessors(),i=Ember.set),Ember.set=i,Ember.trySet=function(e,t,r){return i(e,t,r,!0)}}(),function(){var e=Ember.set,t=Ember.guidFor,r=Ember.ArrayPolyfills.indexOf,n=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t},i=function(e,t){var r=e.keys.copy(),i=n(e.values);return t.keys=r,t.values=i,t.length=e.length,t},o=Ember.OrderedSet=function(){this.clear()};o.create=function(){return new o},o.prototype={clear:function(){this.presenceSet={},this.list=[]},add:function(e){var r=t(e),n=this.presenceSet,i=this.list;r in n||(n[r]=!0,i.push(e))},remove:function(e){var n=t(e),i=this.presenceSet,o=this.list;delete i[n];var a=r.call(o,e);a>-1&&o.splice(a,1)},isEmpty:function(){return 0===this.list.length},has:function(e){var r=t(e),n=this.presenceSet;return r in n},forEach:function(e,t){for(var r=this.toArray(),n=0,i=r.length;i>n;n++)e.call(t,r[n])},toArray:function(){return this.list.slice()},copy:function(){var e=new o;return e.presenceSet=n(this.presenceSet),e.list=this.toArray(),e}};var a=Ember.Map=function(){this.keys=Ember.OrderedSet.create(),this.values={}};a.create=function(){return new a},a.prototype={length:0,get:function(e){var r=this.values,n=t(e);return r[n]},set:function(r,n){var i=this.keys,o=this.values,a=t(r);i.add(r),o[a]=n,e(this,"length",i.list.length)},remove:function(r){var n=this.keys,i=this.values,o=t(r);return i.hasOwnProperty(o)?(n.remove(r),delete i[o],e(this,"length",n.list.length),!0):!1},has:function(e){var r=this.values,n=t(e);return r.hasOwnProperty(n)},forEach:function(e,r){var n=this.keys,i=this.values;n.forEach(function(n){var o=t(n);e.call(r,n,i[o])})},copy:function(){return i(this,new a)}};var s=Ember.MapWithDefault=function(e){a.call(this),this.defaultValue=e.defaultValue};s.create=function(e){return e?new s(e):new a},s.prototype=Ember.create(a.prototype),s.prototype.get=function(e){var t=this.has(e);if(t)return a.prototype.get.call(this,e);var r=this.defaultValue(e);return this.set(e,r),r},s.prototype.copy=function(){return i(this,new s({defaultValue:this.defaultValue}))}}(),function(){function e(e){var t,r;Ember.imports.console?t=Ember.imports.console:"undefined"!=typeof console&&(t=console);var n="object"==typeof t?t[e]:null;return n?"function"==typeof n.apply?(r=function(){n.apply(t,arguments)},r.displayName="console."+e,r):function(){var e=Array.prototype.join.call(arguments,", ");n(e)}:void 0}function t(e,t){if(!e)try{throw new Ember.Error("assertion failed: "+t)}catch(r){setTimeout(function(){throw r},0)}}Ember.Logger={log:e("log")||Ember.K,warn:e("warn")||Ember.K,error:e("error")||Ember.K,info:e("info")||Ember.K,debug:e("debug")||e("info")||Ember.K,assert:e("assert")||t}}(),function(){var e=Ember.META_KEY,t=Ember.meta,r=Ember.platform.defineProperty,n=Ember.ENV.MANDATORY_SETTER;Ember.Descriptor=function(){};var i=Ember.MANDATORY_SETTER_FUNCTION=function(){},o=Ember.DEFAULT_GETTER_FUNCTION=function(t){return function(){var r=this[e];return r&&r.values[t]}};if(Ember.defineProperty=function(e,s,u,l,c){var h,m,p,f;return c||(c=t(e)),h=c.descs,m=c.descs[s],p=c.watching[s]>0,m instanceof Ember.Descriptor&&m.teardown(e,s),u instanceof Ember.Descriptor?(f=u,h[s]=u,n&&p?r(e,s,{configurable:!0,enumerable:!0,writable:!0,value:void 0}):e[s]=void 0,Ember.FEATURES.isEnabled("composable-computed-properties")&&u.func&&u._dependentCPs&&a(e,u._dependentCPs,c)):(h[s]=void 0,null==u?(f=l,n&&p?(c.values[s]=l,r(e,s,{configurable:!0,enumerable:!0,set:i,get:o(s)})):e[s]=l):(f=u,r(e,s,u))),p&&Ember.overrideChains(e,s,c),e.didDefineProperty&&e.didDefineProperty(e,s,f),this},Ember.FEATURES.isEnabled("composable-computed-properties"))var a=function(e,t,r){for(var n,i,o=t.length,s=0;o>s;++s)n=t[s],i=n.implicitCPKey,Ember.defineProperty(e,i,n,void 0,r),n._dependentCPs&&a(e,n._dependentCPs,r)}}(),function(){var e=Ember.get;Ember.getProperties=function(t){var r={},n=arguments,i=1;2===arguments.length&&"array"===Ember.typeOf(arguments[1])&&(i=0,n=arguments[1]);for(var o=n.length;o>i;i++)r[n[i]]=e(t,n[i]);return r}}(),function(){var e=Ember.changeProperties,t=Ember.set;Ember.setProperties=function(r,n){return e(function(){for(var e in n)n.hasOwnProperty(e)&&t(r,e,n[e])}),r}}(),function(){var e=Ember.meta,t=Ember.typeOf,r=Ember.ENV.MANDATORY_SETTER,n=Ember.platform.defineProperty;Ember.watchKey=function(i,o,a){if("length"!==o||"array"!==t(i)){var s=a||e(i),u=s.watching;u[o]?u[o]=(u[o]||0)+1:(u[o]=1,"function"==typeof i.willWatchProperty&&i.willWatchProperty(o),r&&o in i&&(s.values[o]=i[o],n(i,o,{configurable:!0,enumerable:i.propertyIsEnumerable(o),set:Ember.MANDATORY_SETTER_FUNCTION,get:Ember.DEFAULT_GETTER_FUNCTION(o)})))}},Ember.unwatchKey=function(t,i,o){var a=o||e(t),s=a.watching;1===s[i]?(s[i]=0,"function"==typeof t.didUnwatchProperty&&t.didUnwatchProperty(i),r&&i in t&&n(t,i,{configurable:!0,enumerable:t.propertyIsEnumerable(i),set:function(e){n(t,i,{configurable:!0,writable:!0,enumerable:!0,value:e}),delete a.values[i]},get:Ember.DEFAULT_GETTER_FUNCTION(i)})):s[i]>1&&s[i]--}}(),function(){function e(e){return e.match(c)[0]}function t(e,t,r){if(e&&"object"==typeof e){var i=n(e),o=i.chainWatchers;i.hasOwnProperty("chainWatchers")||(o=i.chainWatchers={}),o[t]||(o[t]=[]),o[t].push(r),u(e,t,i)}}function r(e,t){if(!e)return void 0;var r=e[h];if(r&&r.proto===e)return void 0;if("@each"===t)return i(e,t);var n=r&&r.descs[t];return n&&n._cacheable?t in r.cache?r.cache[t]:void 0:i(e,t)}var n=Ember.meta,i=Ember.get,o=Ember.normalizeTuple,a=Ember.ArrayPolyfills.forEach,s=Ember.warn,u=Ember.watchKey,l=Ember.unwatchKey,c=/^([^\.\*]+)/,h=Ember.META_KEY,m=[];Ember.flushPendingChains=function(){if(0!==m.length){var e=m;m=[],a.call(e,function(e){e[0].add(e[1])}),s("Watching an undefined global, Ember expects watched globals to be setup by the time the run loop is flushed, check for typos",0===m.length)}};var p=Ember.removeChainWatcher=function(e,t,r){if(e&&"object"==typeof e){var n=e[h];if(!n||n.hasOwnProperty("chainWatchers")){var i=n&&n.chainWatchers;if(i&&i[t]){i=i[t];for(var o=0,a=i.length;a>o;o++)i[o]===r&&i.splice(o,1)}l(e,t,n)}}},f=Ember._ChainNode=function(e,r,n){this._parent=e,this._key=r,this._watching=void 0===n,this._value=n,this._paths={},this._watching&&(this._object=e.value(),this._object&&t(this._object,this._key,this)),this._parent&&"@each"===this._parent._key&&this.value()},d=f.prototype;d.value=function(){if(void 0===this._value&&this._watching){var e=this._parent.value();this._value=r(e,this._key)}return this._value},d.destroy=function(){if(this._watching){var e=this._object;e&&p(e,this._key,this),this._watching=!1}},d.copy=function(e){var t,r=new f(null,null,e),n=this._paths;for(t in n)n[t]<=0||r.add(t);return r},d.add=function(t){var r,n,i,a,s;if(s=this._paths,s[t]=(s[t]||0)+1,r=this.value(),n=o(r,t),n[0]&&n[0]===r)t=n[1],i=e(t),t=t.slice(i.length+1);else{if(!n[0])return m.push([this,t]),n.length=0,void 0;a=n[0],i=t.slice(0,0-(n[1].length+1)),t=n[1]}n.length=0,this.chain(i,t,a)},d.remove=function(t){var r,n,i,a,s;s=this._paths,s[t]>0&&s[t]--,r=this.value(),n=o(r,t),n[0]===r?(t=n[1],i=e(t),t=t.slice(i.length+1)):(a=n[0],i=t.slice(0,0-(n[1].length+1)),t=n[1]),n.length=0,this.unchain(i,t)},d.count=0,d.chain=function(t,r,n){var i,o=this._chains;o||(o=this._chains={}),i=o[t],i||(i=o[t]=new f(this,t,n)),i.count++,r&&r.length>0&&(t=e(r),r=r.slice(t.length+1),i.chain(t,r))},d.unchain=function(t,r){var n=this._chains,i=n[t];r&&r.length>1&&(t=e(r),r=r.slice(t.length+1),i.unchain(t,r)),i.count--,i.count<=0&&(delete n[i._key],i.destroy())},d.willChange=function(e){var t=this._chains;if(t)for(var r in t)t.hasOwnProperty(r)&&t[r].willChange(e);this._parent&&this._parent.chainWillChange(this,this._key,1,e)},d.chainWillChange=function(e,t,r,n){this._key&&(t=this._key+"."+t),this._parent?this._parent.chainWillChange(this,t,r+1,n):(r>1&&n.push(this.value(),t),t="this."+t,this._paths[t]>0&&n.push(this.value(),t))},d.chainDidChange=function(e,t,r,n){this._key&&(t=this._key+"."+t),this._parent?this._parent.chainDidChange(this,t,r+1,n):(r>1&&n.push(this.value(),t),t="this."+t,this._paths[t]>0&&n.push(this.value(),t))},d.didChange=function(e){if(this._watching){var r=this._parent.value();r!==this._object&&(p(this._object,this._key,this),this._object=r,t(r,this._key,this)),this._value=void 0,this._parent&&"@each"===this._parent._key&&this.value()}var n=this._chains;if(n)for(var i in n)n.hasOwnProperty(i)&&n[i].didChange(e);null!==e&&this._parent&&this._parent.chainDidChange(this,this._key,1,e)},Ember.finishChains=function(e){var t=e[h],r=t&&t.chains;r&&(r.value()!==e?n(e).chains=r=r.copy(e):r.didChange(null))}}(),function(){var e=Ember.EnumerableUtils.forEach,t=/^((?:[^\.]*\.)*)\{(.*)\}$/;Ember.expandProperties=function(r,n){var i,o,a;(i=t.exec(r))?(o=i[1],a=i[2],e(a.split(","),function(e){n(o+e)})):n(r)}}(),function(){function e(e,r){var i=r||t(e),o=i.chains;return o?o.value()!==e&&(o=i.chains=o.copy(e)):o=i.chains=new n(null,null,e),o}var t=Ember.meta,r=Ember.typeOf,n=Ember._ChainNode;Ember.watchPath=function(n,i,o){if("length"!==i||"array"!==r(n)){var a=o||t(n),s=a.watching;s[i]?s[i]=(s[i]||0)+1:(s[i]=1,e(n,a).add(i))}},Ember.unwatchPath=function(r,n,i){var o=i||t(r),a=o.watching;1===a[n]?(a[n]=0,e(r,o).remove(n)):a[n]>1&&a[n]--}}(),function(){function e(e){return"*"===e||!c.test(e)}var t=(Ember.meta,Ember.GUID_KEY),r=Ember.META_KEY,n=Ember.removeChainWatcher,i=Ember.watchKey,o=Ember.unwatchKey,a=Ember.watchPath,s=Ember.unwatchPath,u=Ember.typeOf,l=Ember.generateGuid,c=/[\.\*]/;Ember.watch=function(t,r,n){("length"!==r||"array"!==u(t))&&(e(r)?i(t,r,n):a(t,r,n))},Ember.isWatching=function(e,t){var n=e[r];return(n&&n.watching[t])>0},Ember.watch.flushPending=Ember.flushPendingChains,Ember.unwatch=function(t,r,n){("length"!==r||"array"!==u(t))&&(e(r)?o(t,r,n):s(t,r,n))},Ember.rewatch=function(e){var n=e[r],i=n&&n.chains;t in e&&!e.hasOwnProperty(t)&&l(e),i&&i.value()!==e&&(n.chains=i.copy(e))};var h=[];Ember.destroy=function(e){var t,i,o,a,s=e[r];if(s&&(e[r]=null,t=s.chains))for(h.push(t);h.length>0;){if(t=h.pop(),i=t._chains)for(o in i)i.hasOwnProperty(o)&&h.push(i[o]);t._watching&&(a=t._object,a&&n(a,t._key,t))}}}(),function(){function e(e,t){var r=e[t];return r?e.hasOwnProperty(t)||(r=e[t]=h(r)):r=e[t]={},r}function t(t){return e(t,"deps")}function r(r,n,i,o){var a,s,u,l,c,h=r._dependentKeys;if(h)for(a=t(o),s=0,u=h.length;u>s;s++)l=h[s],c=e(a,l),c[i]=(c[i]||0)+1,p(n,l,o)}function n(r,n,i,o){var a,s,u,l,c,h=r._dependentKeys;if(h)for(a=t(o),s=0,u=h.length;u>s;s++)l=h[s],c=e(a,l),c[i]=(c[i]||0)-1,f(n,l,o)}function i(e,t){this.func=e,Ember.FEATURES.isEnabled("composable-computed-properties")?P(this,t&&t.dependentKeys):this._dependentKeys=t&&t.dependentKeys,this._cacheable=t&&void 0!==t.cacheable?t.cacheable:!0,this._readOnly=t&&(void 0!==t.readOnly||!!t.readOnly)}function o(e){for(var t=0,r=e.length;r>t;t++)e[t].didChange(null)}function a(e,t){for(var r={},n=0;n<t.length;n++)r[t[n]]=s(e,t[n]);return r}var s=Ember.get,u=Ember.set,l=Ember.meta,c=[].slice,h=Ember.create,m=Ember.META_KEY,p=Ember.watch,f=Ember.unwatch,d=Ember.expandProperties;Ember.ComputedProperty=i,i.prototype=new Ember.Descriptor;var b=i.prototype;b._dependentKeys=void 0,b._suspended=void 0,b._meta=void 0,Ember.FEATURES.isEnabled("composable-computed-properties")&&(b._dependentCPs=void 0,b.implicitCPKey=void 0,b.toString=function(){return this.implicitCPKey?this.implicitCPKey:Ember.Descriptor.prototype.toString.apply(this,arguments)}),b.cacheable=function(e){return this._cacheable=e!==!1,this},b.volatile=function(){return this.cacheable(!1)},b.readOnly=function(e){return this._readOnly=void 0===e||!!e,this},b.property=function(){var e,t=function(t){e.push(t)};e=[];for(var r=0,n=arguments.length;n>r;r++)d(arguments[r],t);return Ember.FEATURES.isEnabled("composable-computed-properties")?P(this,e):this._dependentKeys=e,this},b.meta=function(e){return 0===arguments.length?this._meta||{}:(this._meta=e,this)},b.didChange=function(e,t){if(this._cacheable&&this._suspended!==e){var r=l(e);t in r.cache&&(delete r.cache[t],n(this,e,t,r))}},b.get=function(e,t){var n,i,a,s;if(this._cacheable){if(a=l(e),i=a.cache,t in i)return i[t];n=i[t]=this.func.call(e,t),s=a.chainWatchers&&a.chainWatchers[t],s&&o(s),r(this,e,t,a)}else n=this.func.call(e,t);return n},b.set=function(e,t,n){var i,o,a,s=this._cacheable,u=this.func,c=l(e,s),h=c.watching[t],m=this._suspended,p=!1,f=c.cache;if(this._readOnly)throw new Ember.Error('Cannot set read-only property "'+t+'" on object: '+Ember.inspect(e));this._suspended=e;try{if(s&&f.hasOwnProperty(t)&&(o=f[t],p=!0),i=u.wrappedFunction?u.wrappedFunction.length:u.length,3===i)a=u.call(e,t,n,o);else{if(2!==i)return Ember.defineProperty(e,t,null,o),Ember.set(e,t,n),void 0;a=u.call(e,t,n)}if(p&&o===a)return;h&&Ember.propertyWillChange(e,t),p&&delete f[t],s&&(p||r(this,e,t,c),f[t]=a),h&&Ember.propertyDidChange(e,t)}finally{this._suspended=m}return a},b.teardown=function(e,t){var r=l(e);return t in r.cache&&n(this,e,t,r),this._cacheable&&delete r.cache[t],null},Ember.computed=function(e){var t;if(arguments.length>1&&(t=c.call(arguments,0,-1),e=c.call(arguments,-1)[0]),"function"!=typeof e)throw new Ember.Error("Computed Property declared without a property function");var r=new i(e);return t&&r.property.apply(r,t),r},Ember.cacheFor=function(e,t){var r=e[m],n=r&&r.cache;return n&&t in n?n[t]:void 0};var v,E;if(Ember.FEATURES.isEnabled("composable-computed-properties")){var g=Ember.guidFor,y=Ember.EnumerableUtils.map,_=Ember.EnumerableUtils.filter,w=(Ember.typeOf,function(e){return[g(e)].concat(e._dependentKeys).join("_").replace(/\./g,"_DOT_")
11
+ }),C=function(e){return e instanceof Ember.ComputedProperty?w(e):e},O=function(e){return y(e,function(e){return C(e)})},A=function(e){return _(e,function(e){return e instanceof Ember.ComputedProperty})},P=function(e,t){t?(e._dependentKeys=O(t),e._dependentCPs=A(t)):e._dependentKeys=e._dependentCPs=[],e.implicitCPKey=w(e)};Ember.computed.normalizeDependentKey=C,Ember.computed.normalizeDependentKeys=O,v=function(e,t){Ember.computed[e]=function(e){var r=O(c.call(arguments));return Ember.computed(e,function(){return t.apply(this,r)})}}}Ember.FEATURES.isEnabled("composable-computed-properties")?E=function(e,t){Ember.computed[e]=function(){var e=c.call(arguments),r=O(e),n=Ember.computed(function(){return t.apply(this,[a(this,r)])});return n.property.apply(n,e)}}:(v=function(e,t){Ember.computed[e]=function(e){var r=c.call(arguments);return Ember.computed(e,function(){return t.apply(this,r)})}},E=function(e,t){Ember.computed[e]=function(){var e=c.call(arguments),r=Ember.computed(function(){return t.apply(this,[a(this,e)])});return r.property.apply(r,e)}}),Ember.FEATURES.isEnabled("composable-computed-properties")&&(Ember.computed.literal=function(e){return Ember.computed(function(){return e})}),v("empty",function(e){return Ember.isEmpty(s(this,e))}),v("notEmpty",function(e){return!Ember.isEmpty(s(this,e))}),v("none",function(e){return Ember.isNone(s(this,e))}),v("not",function(e){return!s(this,e)}),v("bool",function(e){return!!s(this,e)}),v("match",function(e,t){var r=s(this,e);return"string"==typeof r?t.test(r):!1}),v("equal",function(e,t){return s(this,e)===t}),v("gt",function(e,t){return s(this,e)>t}),v("gte",function(e,t){return s(this,e)>=t}),v("lt",function(e,t){return s(this,e)<t}),v("lte",function(e,t){return s(this,e)<=t}),E("and",function(e){for(var t in e)if(e.hasOwnProperty(t)&&!e[t])return!1;return!0}),E("or",function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!0;return!1}),E("any",function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return e[t];return null}),E("collect",function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&(Ember.isNone(e[r])?t.push(null):t.push(e[r]));return t}),Ember.computed.alias=function(e){return Ember.computed(e,function(t,r){return arguments.length>1?(u(this,e,r),r):s(this,e)})},Ember.computed.oneWay=function(e){return Ember.computed(e,function(){return s(this,e)})},Ember.computed.readOnly=function(e){return Ember.computed(e,function(){return s(this,e)}).readOnly()},Ember.computed.defaultTo=function(e){return Ember.computed(function(t,r,n){return 1===arguments.length?null!=n?n:s(this,e):null!=r?r:s(this,e)})}}(),function(){function e(e){return e+r}function t(e){return e+n}var r=":change",n=":before";Ember.addObserver=function(t,r,n,i){return Ember.addListener(t,e(r),n,i),Ember.watch(t,r),this},Ember.observersFor=function(t,r){return Ember.listenersFor(t,e(r))},Ember.removeObserver=function(t,r,n,i){return Ember.unwatch(t,r),Ember.removeListener(t,e(r),n,i),this},Ember.addBeforeObserver=function(e,r,n,i){return Ember.addListener(e,t(r),n,i),Ember.watch(e,r),this},Ember._suspendBeforeObserver=function(e,r,n,i,o){return Ember._suspendListener(e,t(r),n,i,o)},Ember._suspendObserver=function(t,r,n,i,o){return Ember._suspendListener(t,e(r),n,i,o)};var i=Ember.ArrayPolyfills.map;Ember._suspendBeforeObservers=function(e,r,n,o,a){var s=i.call(r,t);return Ember._suspendListeners(e,s,n,o,a)},Ember._suspendObservers=function(t,r,n,o,a){var s=i.call(r,e);return Ember._suspendListeners(t,s,n,o,a)},Ember.beforeObserversFor=function(e,r){return Ember.listenersFor(e,t(r))},Ember.removeBeforeObserver=function(e,r,n,i){return Ember.unwatch(e,r),Ember.removeListener(e,t(r),n,i),this}}(),function(){e("backburner/queue",["exports"],function(e){"use strict";function t(e,t,r){this.daq=e,this.name=t,this.options=r,this._queue=[]}t.prototype={daq:null,name:null,options:null,_queue:null,push:function(e,t,r,n){var i=this._queue;return i.push(e,t,r,n),{queue:this,target:e,method:t}},pushUnique:function(e,t,r,n){var i,o,a,s,u=this._queue;for(a=0,s=u.length;s>a;a+=4)if(i=u[a],o=u[a+1],i===e&&o===t)return u[a+2]=r,u[a+3]=n,{queue:this,target:e,method:t};return this._queue.push(e,t,r,n),{queue:this,target:e,method:t}},flush:function(){var e,t,r,n,i,o=this._queue,a=this.options,s=a&&a.before,u=a&&a.after,l=o.length;for(l&&s&&s(),i=0;l>i;i+=4)e=o[i],t=o[i+1],r=o[i+2],n=o[i+3],r&&r.length>0?t.apply(e,r):t.call(e);l&&u&&u(),o.length>l?(this._queue=o.slice(l),this.flush()):this._queue.length=0},cancel:function(e){var t,r,n,i,o=this._queue;for(n=0,i=o.length;i>n;n+=4)if(t=o[n],r=o[n+1],t===e.target&&r===e.method)return o.splice(n,4),!0;if(o=this._queueBeingFlushed)for(n=0,i=o.length;i>n;n+=4)if(t=o[n],r=o[n+1],t===e.target&&r===e.method)return o[n+1]=null,!0}},e.Queue=t}),e("backburner/deferred_action_queues",["backburner/queue","exports"],function(e,t){"use strict";function r(e,t){var r=this.queues={};this.queueNames=e=e||[];for(var n,o=0,a=e.length;a>o;o++)n=e[o],r[n]=new i(this,n,t[n])}function n(e,t){for(var r,n,i=0,o=t;o>=i;i++)if(r=e.queueNames[i],n=e.queues[r],n._queue.length)return i;return-1}var i=e.Queue;r.prototype={queueNames:null,queues:null,schedule:function(e,t,r,n,i,o){var a=this.queues,s=a[e];if(!s)throw new Error("You attempted to schedule an action in a queue ("+e+") that doesn't exist");return i?s.pushUnique(t,r,n,o):s.push(t,r,n,o)},flush:function(){for(var e,t,r,i,o=this.queues,a=this.queueNames,s=0,u=a.length;u>s;){e=a[s],t=o[e],r=t._queueBeingFlushed=t._queue.slice(),t._queue=[];var l,c,h,m,p=t.options,f=p&&p.before,d=p&&p.after,b=0,v=r.length;for(v&&f&&f();v>b;)l=r[b],c=r[b+1],h=r[b+2],m=r[b+3],"string"==typeof c&&(c=l[c]),c&&(h&&h.length>0?c.apply(l,h):c.call(l)),b+=4;t._queueBeingFlushed=null,v&&d&&d(),-1===(i=n(this,s))?s++:s=i}}},t.DeferredActionQueues=r}),e("backburner",["backburner/deferred_action_queues","exports"],function(e,t){"use strict";function r(e){return"number"==typeof e||g.test(e)}function n(e,t){this.queueNames=e,this.options=t||{},this.options.defaultQueue||(this.options.defaultQueue=e[0]),this.instanceStack=[]}function i(e){e.begin(),l=E.setTimeout(function(){l=null,e.end()})}function o(e,t,r){(!c||h>t)&&(c&&clearTimeout(c),c=E.setTimeout(function(){c=null,h=null,a(e)},r),h=t)}function a(e){var t,r,n,i,a=+new Date;e.run(function(){for(n=0,i=v.length;i>n&&(t=v[n],!(t>a));n+=2);for(r=v.splice(0,n),n=1,i=r.length;i>n;n+=2)e.schedule(e.options.defaultQueue,null,r[n])}),v.length&&o(e,v[0],v[0]-a)}function s(e,t){for(var r,n=-1,i=0,o=b.length;o>i;i++)if(r=b[i],r[0]===e&&r[1]===t){n=i;break}return n}function u(e,t){for(var r,n=-1,i=0,o=d.length;o>i;i++)if(r=d[i],r[0]===e&&r[1]===t){n=i;break}return n}var l,c,h,m=e.DeferredActionQueues,p=[].slice,f=[].pop,d=[],b=[],v=[],E=this,g=/\d+/;n.prototype={queueNames:null,options:null,currentInstance:null,instanceStack:null,begin:function(){var e=this.options&&this.options.onBegin,t=this.currentInstance;t&&this.instanceStack.push(t),this.currentInstance=new m(this.queueNames,this.options),e&&e(this.currentInstance,t)},end:function(){var e=this.options&&this.options.onEnd,t=this.currentInstance,r=null;try{t.flush()}finally{this.currentInstance=null,this.instanceStack.length&&(r=this.instanceStack.pop(),this.currentInstance=r),e&&e(t,r)}},run:function(e,t){var r;this.begin(),t||(t=e,e=null),"string"==typeof t&&(t=e[t]);var n=!1;try{r=arguments.length>2?t.apply(e,p.call(arguments,2)):t.call(e)}finally{n||(n=!0,this.end())}return r},defer:function(e,t,r){r||(r=t,t=null),"string"==typeof r&&(r=t[r]);var n=this.DEBUG?new Error:void 0,o=arguments.length>3?p.call(arguments,3):void 0;return this.currentInstance||i(this),this.currentInstance.schedule(e,t,r,o,!1,n)},deferOnce:function(e,t,r){r||(r=t,t=null),"string"==typeof r&&(r=t[r]);var n=this.DEBUG?new Error:void 0,o=arguments.length>3?p.call(arguments,3):void 0;return this.currentInstance||i(this),this.currentInstance.schedule(e,t,r,o,!0,n)},setTimeout:function(){function e(){t.apply(i,l)}var t,n,i,a,s,u,l=p.call(arguments),c=l.length,h=this;if(0!==c){if(1===c)t=l.shift(),n=0;else if(2===c)a=l[0],s=l[1],"function"==typeof s||"function"==typeof a[s]?(i=l.shift(),t=l.shift(),n=0):r(s)?(t=l.shift(),n=l.shift()):(t=l.shift(),n=0);else{var m=l[l.length-1];r(m)&&(n=l.pop()),a=l[0],u=l[1],"function"==typeof u||"string"==typeof u&&null!==a&&u in a?(i=l.shift(),t=l.shift()):t=l.shift()}var f=+new Date+parseInt(n,10);"string"==typeof t&&(t=i[t]);var d,b;for(d=0,b=v.length;b>d&&!(f<v[d]);d+=2);return v.splice(d,0,f,e),o(h,f,n),e}},throttle:function(e,t){var r,n,i,o,a=this,s=arguments,l=f.call(s);return"number"==typeof l||"string"==typeof l?(r=l,l=!0):r=f.call(s),r=parseInt(r,10),i=u(e,t),i>-1?d[i]:(o=E.setTimeout(function(){l||a.run.apply(a,s);var r=u(e,t);r>-1&&d.splice(r,1)},r),l&&a.run.apply(a,s),n=[e,t,o],d.push(n),n)},debounce:function(e,t){var r,n,i,o,a=this,u=arguments,l=f.call(u);return"number"==typeof l||"string"==typeof l?(r=l,l=!1):r=f.call(u),r=parseInt(r,10),n=s(e,t),n>-1&&(i=b[n],b.splice(n,1),clearTimeout(i[2])),o=E.setTimeout(function(){l||a.run.apply(a,u);var r=s(e,t);r>-1&&b.splice(r,1)},r),l&&-1===n&&a.run.apply(a,u),i=[e,t,o],b.push(i),i},cancelTimers:function(){var e,t;for(e=0,t=d.length;t>e;e++)clearTimeout(d[e][2]);for(d=[],e=0,t=b.length;t>e;e++)clearTimeout(b[e][2]);b=[],c&&(clearTimeout(c),c=null),v=[],l&&(clearTimeout(l),l=null)},hasTimers:function(){return!!v.length||l},cancel:function(e){var t=typeof e;if(e&&"object"===t&&e.queue&&e.method)return e.queue.cancel(e);if("function"!==t)return"[object Array]"===Object.prototype.toString.call(e)?this._cancelItem(u,d,e)||this._cancelItem(s,b,e):void 0;for(var r=0,n=v.length;n>r;r+=2)if(v[r+1]===e)return v.splice(r,2),!0},_cancelItem:function(e,t,r){var n,i;return r.length<3?!1:(i=e(r[0],r[1]),i>-1&&(n=t[i],n[2]===r[2])?(t.splice(i,1),clearTimeout(r[2]),!0):!1)}},n.prototype.schedule=n.prototype.defer,n.prototype.scheduleOnce=n.prototype.deferOnce,n.prototype.later=n.prototype.setTimeout,t.Backburner=n})}(),function(){function e(e){try{return a.run.apply(a,e)}catch(t){Ember.onerror(t)}}function r(){!Ember.run.currentRunLoop}{var n=function(e){Ember.run.currentRunLoop=e},i=function(e,t){Ember.run.currentRunLoop=t},o=t("backburner").Backburner,a=new o(["sync","actions","destroy"],{sync:{before:Ember.beginPropertyChanges,after:Ember.endPropertyChanges},defaultQueue:"actions",onBegin:n,onEnd:i}),s=[].slice;[].concat}Ember.run=function(){return Ember.onerror?e(arguments):a.run.apply(a,arguments)},Ember.run.join=function(){if(!Ember.run.currentRunLoop)return Ember.run.apply(Ember.run,arguments);var e=s.call(arguments);e.unshift("actions"),Ember.run.schedule.apply(Ember.run,e)},Ember.run.bind=function(){var e=s.call(arguments);return function(){return Ember.run.join.apply(Ember.run,e.concat(s.call(arguments)))}},Ember.run.backburner=a;Ember.run;Ember.run.currentRunLoop=null,Ember.run.queues=a.queueNames,Ember.run.begin=function(){a.begin()},Ember.run.end=function(){a.end()},Ember.run.schedule=function(){r(),a.schedule.apply(a,arguments)},Ember.run.hasScheduledTimers=function(){return a.hasTimers()},Ember.run.cancelTimers=function(){a.cancelTimers()},Ember.run.sync=function(){a.currentInstance&&a.currentInstance.queues.sync.flush()},Ember.run.later=function(){return a.later.apply(a,arguments)},Ember.run.once=function(){r();var e=s.call(arguments);return e.unshift("actions"),a.scheduleOnce.apply(a,e)},Ember.run.scheduleOnce=function(){return r(),a.scheduleOnce.apply(a,arguments)},Ember.run.next=function(){var e=s.call(arguments);return e.push(1),a.later.apply(a,e)},Ember.run.cancel=function(e){return a.cancel(e)},Ember.run.debounce=function(){return a.debounce.apply(a,arguments)},Ember.run.throttle=function(){return a.throttle.apply(a,arguments)}}(),function(){function e(e,t){return r(o(t)?Ember.lookup:e,t)}function t(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}Ember.LOG_BINDINGS=!1||!!Ember.ENV.LOG_BINDINGS;var r=Ember.get,n=(Ember.set,Ember.guidFor),i=/^([A-Z$]|([0-9][A-Z$]))/,o=Ember.isGlobalPath=function(e){return i.test(e)},a=function(e,t){this._direction="fwd",this._from=t,this._to=e,this._directionMap=Ember.Map.create()};a.prototype={copy:function(){var e=new a(this._to,this._from);return this._oneWay&&(e._oneWay=!0),e},from:function(e){return this._from=e,this},to:function(e){return this._to=e,this},oneWay:function(){return this._oneWay=!0,this},toString:function(){var e=this._oneWay?"[oneWay]":"";return"Ember.Binding<"+n(this)+">("+this._from+" -> "+this._to+")"+e},connect:function(t){var r=this._from,n=this._to;return Ember.trySet(t,n,e(t,r)),Ember.addObserver(t,r,this,this.fromDidChange),this._oneWay||Ember.addObserver(t,n,this,this.toDidChange),this._readyToSync=!0,this},disconnect:function(e){var t=!this._oneWay;return Ember.removeObserver(e,this._from,this,this.fromDidChange),t&&Ember.removeObserver(e,this._to,this,this.toDidChange),this._readyToSync=!1,this},fromDidChange:function(e){this._scheduleSync(e,"fwd")},toDidChange:function(e){this._scheduleSync(e,"back")},_scheduleSync:function(e,t){var r=this._directionMap,n=r.get(e);n||(Ember.run.schedule("sync",this,this._sync,e),r.set(e,t)),"back"===n&&"fwd"===t&&r.set(e,"fwd")},_sync:function(t){var n=Ember.LOG_BINDINGS;if(!t.isDestroyed&&this._readyToSync){var i=this._directionMap,o=i.get(t),a=this._from,s=this._to;if(i.remove(t),"fwd"===o){var u=e(t,this._from);n&&Ember.Logger.log(" ",this.toString(),"->",u,t),this._oneWay?Ember.trySet(t,s,u):Ember._suspendObserver(t,s,this,this.toDidChange,function(){Ember.trySet(t,s,u)})}else if("back"===o){var l=r(t,this._to);n&&Ember.Logger.log(" ",this.toString(),"<-",l,t),Ember._suspendObserver(t,a,this,this.fromDidChange,function(){Ember.trySet(Ember.isGlobalPath(a)?Ember.lookup:t,a,l)})}}}},t(a,{from:function(){var e=this,t=new e;return t.from.apply(t,arguments)},to:function(){var e=this,t=new e;return t.to.apply(t,arguments)},oneWay:function(e,t){var r=this,n=new r(null,e);return n.oneWay(t)}}),Ember.Binding=a,Ember.bind=function(e,t,r){return new Ember.Binding(t,r).connect(e)},Ember.oneWay=function(e,t,r){return new Ember.Binding(t,r).oneWay().connect(e)}}(),function(){function e(){var e,t=this.__nextSuper;return t&&(this.__nextSuper=null,e=t.apply(this,arguments),this.__nextSuper=t),e}function t(e){var t=N(e,!0),r=t.mixins;return r?t.hasOwnProperty("mixins")||(r=t.mixins=x(r)):r=t.mixins={},r}function r(e,t){return t&&t.length>0&&(e.mixins=O.call(t,function(e){if(e instanceof _)return e;var t=new _;return t.properties=e,t})),e}function n(e){return"function"==typeof e&&e.isMethod!==!1&&e!==Boolean&&e!==Object&&e!==Number&&e!==Array&&e!==Date&&e!==String}function i(e,t){var r;return t instanceof _?(r=V(t),e[r]?D:(e[r]=t,t.properties)):t}function o(e,t,r,n){var i;return i=r[e]||n[e],t[e]&&(i=i?i.concat(t[e]):t[e]),i}function a(e,t,r,n,i){var o;return void 0===n[t]&&(o=i[t]),o=o||e.descs[t],o&&o instanceof Ember.ComputedProperty?(r=x(r),r.func=Ember.wrap(r.func,o.func),r):r}function s(e,t,r,n,i){var o;return void 0===i[t]&&(o=n[t]),o=o||e[t],"function"!=typeof o?r:Ember.wrap(r,o)}function u(e,t,r,n){var i=n[t]||e[t];return i?"function"==typeof i.concat?i.concat(r):Ember.makeArray(i).concat(r):Ember.makeArray(r)}function l(t,r,i,o){var a=o[r]||t[r];if(!a)return i;var u=Ember.merge({},a),l=!1;for(var c in i)if(i.hasOwnProperty(c)){var h=i[c];n(h)?(l=!0,u[c]=s(t,c,h,a,{})):u[c]=h}return l&&(u._super=e),u}function c(e,t,r,i,o,c,h,m){if(r instanceof Ember.Descriptor){if(r===w&&o[t])return D;r.func&&(r=a(i,t,r,c,o)),o[t]=r,c[t]=void 0}else h&&A.call(h,t)>=0||"concatenatedProperties"===t||"mergedProperties"===t?r=u(e,t,r,c):m&&A.call(m,t)>=0?r=l(e,t,r,c):n(r)&&(r=s(e,t,r,c,o)),o[t]=void 0,c[t]=r}function h(e,t,r,n,a,s){function u(e){delete r[e],delete n[e]}for(var l,m,p,f,d,b,v=0,E=e.length;E>v;v++)if(l=e[v],m=i(t,l),m!==D)if(m){b=N(a),a.willMergeMixin&&a.willMergeMixin(m),f=o("concatenatedProperties",m,n,a),d=o("mergedProperties",m,n,a);for(p in m)m.hasOwnProperty(p)&&(s.push(p),c(a,p,m[p],b,r,n,f,d));m.hasOwnProperty("toString")&&(a.toString=m.toString)}else l.mixins&&(h(l.mixins,t,r,n,a,s),l._without&&P.call(l._without,u))}function m(e,t,r,n){if(M.test(t)){var i=n.bindings;i?n.hasOwnProperty("bindings")||(i=n.bindings=x(n.bindings)):i=n.bindings={},i[t]=r}}function p(e,t){var r,n,i,o=t.bindings;if(o){for(r in o)n=o[r],n&&(i=r.slice(0,-7),n instanceof Ember.Binding?(n=n.copy(),n.to(i)):n=new Ember.Binding(i,n),n.connect(e),e[r]=n);t.bindings={}}}function f(e,t){return p(e,t||N(e)),e}function d(e,t,r,n,i){var o,a=t.methodName;return n[a]||i[a]?(o=i[a],t=n[a]):r.descs[a]?(t=r.descs[a],o=void 0):(t=void 0,o=e[a]),{desc:t,value:o}}function b(e,t,r,n,i){var o=r[n];if(o)for(var a=0,s=o.length;s>a;a++)Ember[i](e,o[a],null,t)}function v(e,t,r){var n=e[t];"function"==typeof n&&(b(e,t,n,"__ember_observesBefore__","removeBeforeObserver"),b(e,t,n,"__ember_observes__","removeObserver"),b(e,t,n,"__ember_listens__","removeListener")),"function"==typeof r&&(b(e,t,r,"__ember_observesBefore__","addBeforeObserver"),b(e,t,r,"__ember_observes__","addObserver"),b(e,t,r,"__ember_listens__","addListener"))}function E(r,n,i){var o,a,s,u={},l={},c=N(r),p=[];r._super=e,h(n,t(r),u,l,r,p);for(var b=0,E=p.length;E>b;b++)if(o=p[b],"constructor"!==o&&l.hasOwnProperty(o)&&(s=u[o],a=l[o],s!==w)){for(;s&&s instanceof C;){var g=d(r,s,c,u,l);s=g.desc,a=g.value}(void 0!==s||void 0!==a)&&(v(r,o,a),m(r,o,a,c),S(r,o,s,a,c))}return i||f(r,c),r}function g(e,t,r){var n=V(e);if(r[n])return!1;if(r[n]=!0,e===t)return!0;for(var i=e.mixins,o=i?i.length:0;--o>=0;)if(g(i[o],t,r))return!0;return!1}function y(e,t,r){if(!r[V(t)])if(r[V(t)]=!0,t.properties){var n=t.properties;for(var i in n)n.hasOwnProperty(i)&&(e[i]=!0)}else t.mixins&&P.call(t.mixins,function(t){y(e,t,r)})}var _,w,C,O=Ember.ArrayPolyfills.map,A=Ember.ArrayPolyfills.indexOf,P=Ember.ArrayPolyfills.forEach,T=[].slice,x=Ember.create,S=Ember.defineProperty,V=Ember.guidFor,N=Ember.meta,I=Ember.META_KEY,R=Ember.expandProperties,D={},M=Ember.IS_BINDING=/^.+Binding$/;Ember.mixin=function(e){var t=T.call(arguments,1);return E(e,t,!1),e},Ember.Mixin=function(){return r(this,arguments)},_=Ember.Mixin,_.prototype={properties:null,mixins:null,ownerConstructor:null},_._apply=E,_.applyPartial=function(e){var t=T.call(arguments,1);return E(e,t,!0)},_.finishPartial=f,Ember.anyUnprocessedMixins=!1,_.create=function(){Ember.anyUnprocessedMixins=!0;var e=this;return r(new e,arguments)};var k=_.prototype;k.reopen=function(){var e,t;this.properties?(e=_.create(),e.properties=this.properties,delete this.properties,this.mixins=[e]):this.mixins||(this.mixins=[]);var r,n=arguments.length,i=this.mixins;for(r=0;n>r;r++)e=arguments[r],e instanceof _?i.push(e):(t=_.create(),t.properties=e,i.push(t));return this},k.apply=function(e){return E(e,[this],!1)},k.applyPartial=function(e){return E(e,[this],!0)},k.detect=function(e){if(!e)return!1;if(e instanceof _)return g(e,this,{});var t=e[I],r=t&&t.mixins;return r?!!r[V(this)]:!1},k.without=function(){var e=new _(this);return e._without=T.call(arguments),e},k.keys=function(){var e={},t={},r=[];y(e,this,t);for(var n in e)e.hasOwnProperty(n)&&r.push(n);return r},_.mixins=function(e){var t=e[I],r=t&&t.mixins,n=[];if(!r)return n;for(var i in r){var o=r[i];o.properties||n.push(o)}return n},w=new Ember.Descriptor,w.toString=function(){return"(Required Property)"},Ember.required=function(){return w},C=function(e){this.methodName=e},C.prototype=new Ember.Descriptor,Ember.aliasMethod=function(e){return new C(e)},Ember.observer=function(){var e,t=T.call(arguments,-1)[0],r=function(t){e.push(t)},n=T.call(arguments,0,-1);"function"!=typeof t&&(t=arguments[0],n=T.call(arguments,1)),e=[];for(var i=0;i<n.length;++i)R(n[i],r);if("function"!=typeof t)throw new Ember.Error("Ember.observer called without a function");return t.__ember_observes__=e,t},Ember.immediateObserver=function(){for(var e=0,t=arguments.length;t>e;e++){arguments[e]}return Ember.observer.apply(this,arguments)},Ember.beforeObserver=function(){var e,t=T.call(arguments,-1)[0],r=function(t){e.push(t)},n=T.call(arguments,0,-1);"function"!=typeof t&&(t=arguments[0],n=T.call(arguments,1)),e=[];for(var i=0;i<n.length;++i)R(n[i],r);if("function"!=typeof t)throw new Ember.Error("Ember.beforeObserver called without a function");return t.__ember_observesBefore__=e,t}}(),function(){var e=Ember.EnumerableUtils.forEach,t=Ember.EnumerableUtils.indexOf;Ember.libraries=function(){var r=[],n=0,i=function(e){for(var t=0;t<r.length;t++)if(r[t].name===e)return r[t]};return r.register=function(e,t){i(e)||r.push({name:e,version:t})},r.registerCoreLibrary=function(e,t){i(e)||r.splice(n++,0,{name:e,version:t})},r.deRegister=function(e){var n=i(e);n&&r.splice(t(r,n),1)},r.each=function(t){e(r,function(e){t(e.name,e.version)})},r}(),Ember.libraries.registerCoreLibrary("Ember",Ember.VERSION)}(),function(){e("rsvp/all",["./promise","exports"],function(e,t){"use strict";var r=e["default"];t["default"]=function(e,t){return r.all(e,t)}}),e("rsvp/all_settled",["./promise","./utils","exports"],function(e,t,r){"use strict";function n(e){return{state:"fulfilled",value:e}}function i(e){return{state:"rejected",reason:e}}var o=e["default"],a=t.isArray,s=t.isNonThenable;r["default"]=function(e,t){return new o(function(t){function r(e){return function(t){l(e,n(t))}}function u(e){return function(t){l(e,i(t))}}function l(e,r){m[e]=r,0===--h&&t(m)}if(!a(e))throw new TypeError("You must pass an array to allSettled.");var c,h=e.length;if(0===h)return t([]),void 0;for(var m=new Array(h),p=0;p<e.length;p++)c=e[p],s(c)?l(p,n(c)):o.cast(c).then(r(p),u(p))},t)}}),e("rsvp/config",["./events","exports"],function(e,t){"use strict";function r(e,t){return"onerror"===e?(i.on("error",t),void 0):2!==arguments.length?i[e]:(i[e]=t,void 0)}var n=e["default"],i={instrument:!1};n.mixin(i),t.config=i,t.configure=r}),e("rsvp/defer",["./promise","exports"],function(e,t){"use strict";var r=e["default"];t["default"]=function(e){var t={};return t.promise=new r(function(e,r){t.resolve=e,t.reject=r},e),t}}),e("rsvp/events",["exports"],function(e){"use strict";var t=function(e,t){for(var r=0,n=e.length;n>r;r++)if(e[r]===t)return r;return-1},r=function(e){var t=e._promiseCallbacks;return t||(t=e._promiseCallbacks={}),t};e["default"]={mixin:function(e){return e.on=this.on,e.off=this.off,e.trigger=this.trigger,e._promiseCallbacks=void 0,e},on:function(e,n){var i,o=r(this);i=o[e],i||(i=o[e]=[]),-1===t(i,n)&&i.push(n)},off:function(e,n){var i,o,a=r(this);return n?(i=a[e],o=t(i,n),-1!==o&&i.splice(o,1),void 0):(a[e]=[],void 0)},trigger:function(e,t){var n,i,o=r(this);if(n=o[e])for(var a=0;a<n.length;a++)(i=n[a])(t)}}}),e("rsvp/filter",["./all","./map","./utils","exports"],function(e,t,r,n){"use strict";function i(e,t,r){return o(e,r).then(function(n){if(!u(e))throw new TypeError("You must pass an array to filter.");if(!s(t))throw new TypeError("You must pass a function to filter's second argument.");return a(e,t,r).then(function(e){var t,r=n.length,i=[];for(t=0;r>t;t++)e[t]&&i.push(n[t]);return i})})}var o=e["default"],a=t["default"],s=r.isFunction,u=r.isArray;n["default"]=i}),e("rsvp/hash",["./promise","./utils","exports"],function(e,t,r){"use strict";var n=e["default"],i=t.isNonThenable,o=t.keysOf;r["default"]=function(e){return new n(function(t,r){function a(e){return function(r){c[e]=r,0===--m&&t(c)}}function s(e){m=0,r(e)}var u,l,c={},h=o(e),m=h.length;if(0===m)return t(c),void 0;for(var p=0;p<h.length;p++)l=h[p],u=e[l],i(u)?(c[l]=u,0===--m&&t(c)):n.cast(u).then(a(l),s)})}}),e("rsvp/instrument",["./config","./utils","exports"],function(e,t,r){"use strict";var n=e.config,i=t.now;r["default"]=function(e,t,r){try{n.trigger(e,{guid:t._guidKey+t._id,eventName:e,detail:t._detail,childGuid:r&&t._guidKey+r._id,label:t._label,timeStamp:i(),stack:new Error(t._label).stack})}catch(o){setTimeout(function(){throw o},0)}}}),e("rsvp/map",["./promise","./all","./utils","exports"],function(e,t,r,n){"use strict";var i=(e["default"],t["default"]),o=r.isArray,a=r.isFunction;n["default"]=function(e,t,r){return i(e,r).then(function(n){if(!o(e))throw new TypeError("You must pass an array to map.");if(!a(t))throw new TypeError("You must pass a function to map's second argument.");var s,u=n.length,l=[];for(s=0;u>s;s++)l.push(t(n[s]));return i(l,r)})}}),e("rsvp/node",["./promise","exports"],function(e,t){"use strict";function r(e,t){return function(r,n){r?t(r):arguments.length>2?e(i.call(arguments,1)):e(n)}}var n=e["default"],i=Array.prototype.slice;t["default"]=function(e,t){return function(){var o=i.call(arguments),a=this||t;return new n(function(t,i){n.all(o).then(function(n){try{n.push(r(t,i)),e.apply(a,n)}catch(o){i(o)}})})}}}),e("rsvp/promise",["./config","./events","./instrument","./utils","./promise/cast","./promise/all","./promise/race","./promise/resolve","./promise/reject","exports"],function(e,t,r,n,i,o,a,s,u,l){"use strict";function c(){}function h(e,t){if(!A(e))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof h))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._id=R++,this._label=t,this._subscribers=[],w.instrument&&C("created",this),c!==e&&m(e,this)}function m(e,t){function r(e){v(t,e)}function n(e){g(t,e)}try{e(r,n)}catch(i){n(i)}}function p(e,t,r,n){var i=e._subscribers,o=i.length;i[o]=t,i[o+k]=r,i[o+j]=n}function f(e,t){var r,n,i=e._subscribers,o=e._detail;w.instrument&&C(t===k?"fulfilled":"rejected",e);for(var a=0;a<i.length;a+=3)r=i[a],n=i[a+t],d(t,r,n,o);e._subscribers=null}function d(e,t,r,n){var i,o,a,s,u=A(r);if(u)try{i=r(n),a=!0}catch(l){s=!0,o=l}else i=n,a=!0;b(t,i)||(u&&a?v(t,i):s?g(t,o):e===k?v(t,i):e===j&&g(t,i))}function b(e,t){var r,n=null;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(O(t)&&(n=t.then,A(n)))return n.call(t,function(n){return r?!0:(r=!0,t!==n?v(e,n):E(e,n),void 0)},function(t){return r?!0:(r=!0,g(e,t),void 0)},"derived from: "+(e._label||" unknown promise")),!0}catch(i){return r?!0:(g(e,i),!0)}return!1}function v(e,t){e===t?E(e,t):b(e,t)||E(e,t)}function E(e,t){e._state===D&&(e._state=M,e._detail=t,w.async(y,e))}function g(e,t){e._state===D&&(e._state=M,e._detail=t,w.async(_,e))}function y(e){f(e,e._state=k)}function _(e){e._onerror&&e._onerror(e._detail),f(e,e._state=j)}var w=e.config,C=(t["default"],r["default"]),O=n.objectOrFunction,A=n.isFunction,P=n.now,T=i["default"],x=o["default"],S=a["default"],V=s["default"],N=u["default"],I="rsvp_"+P()+"-",R=0;l["default"]=h,h.cast=T,h.all=x,h.race=S,h.resolve=V,h.reject=N;var D=void 0,M=0,k=1,j=2;h.prototype={constructor:h,_id:void 0,_guidKey:I,_label:void 0,_state:void 0,_detail:void 0,_subscribers:void 0,_onerror:function(e){w.trigger("error",e)},then:function(e,t,r){var n=this;this._onerror=null;var i=new this.constructor(c,r);if(this._state){var o=arguments;w.async(function(){d(n._state,i,o[n._state-1],n._detail)})}else p(this,i,e,t);return w.instrument&&C("chained",n,i),i},"catch":function(e,t){return this.then(null,e,t)},"finally":function(e,t){var r=this.constructor;return this.then(function(t){return r.cast(e()).then(function(){return t})},function(t){return r.cast(e()).then(function(){throw t})},t)}}}),e("rsvp/promise/all",["../utils","exports"],function(e,t){"use strict";var r=e.isArray,n=e.isNonThenable;t["default"]=function(e,t){var i=this;return new i(function(t,o){function a(e){return function(r){c[e]=r,0===--l&&t(c)}}function s(e){l=0,o(e)}if(!r(e))throw new TypeError("You must pass an array to all.");var u,l=e.length,c=new Array(l);if(0===l)return t(c),void 0;for(var h=0;h<e.length;h++)u=e[h],n(u)?(c[h]=u,0===--l&&t(c)):i.cast(u).then(a(h),s)},t)}}),e("rsvp/promise/cast",["exports"],function(e){"use strict";e["default"]=function(e,t){var r=this;return e&&"object"==typeof e&&e.constructor===r?e:new r(function(t){t(e)},t)}}),e("rsvp/promise/race",["../utils","exports"],function(e,t){"use strict";var r=e.isArray,n=(e.isFunction,e.isNonThenable);t["default"]=function(e,t){var i,o=this;return new o(function(t,a){function s(e){l&&(l=!1,t(e))}function u(e){l&&(l=!1,a(e))}if(!r(e))throw new TypeError("You must pass an array to race.");for(var l=!0,c=0;c<e.length;c++){if(i=e[c],n(i))return l=!1,t(i),void 0;o.cast(i).then(s,u)}},t)}}),e("rsvp/promise/reject",["exports"],function(e){"use strict";e["default"]=function(e,t){var r=this;return new r(function(t,r){r(e)},t)}}),e("rsvp/promise/resolve",["exports"],function(e){"use strict";e["default"]=function(e,t){var r=this;return new r(function(t){t(e)},t)}}),e("rsvp/race",["./promise","exports"],function(e,t){"use strict";var r=e["default"];t["default"]=function(e,t){return r.race(e,t)}}),e("rsvp/reject",["./promise","exports"],function(e,t){"use strict";var r=e["default"];t["default"]=function(e,t){return r.reject(e,t)}}),e("rsvp/resolve",["./promise","exports"],function(e,t){"use strict";var r=e["default"];t["default"]=function(e,t){return r.resolve(e,t)}}),e("rsvp/rethrow",["exports"],function(e){"use strict";e["default"]=function(e){throw setTimeout(function(){throw e}),e}}),e("rsvp/utils",["exports"],function(e){"use strict";function t(e){return"function"==typeof e||"object"==typeof e&&null!==e}function r(e){return"function"==typeof e}function n(e){return!t(e)}function i(e){return"[object Array]"===Object.prototype.toString.call(e)}e.objectOrFunction=t,e.isFunction=r,e.isNonThenable=n,e.isArray=i;var o=Date.now||function(){return(new Date).getTime()};e.now=o;var a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.keysOf=a}),e("rsvp",["./rsvp/promise","./rsvp/events","./rsvp/node","./rsvp/all","./rsvp/all_settled","./rsvp/race","./rsvp/hash","./rsvp/rethrow","./rsvp/defer","./rsvp/config","./rsvp/map","./rsvp/resolve","./rsvp/reject","./rsvp/filter","exports"],function(e,t,r,n,i,o,a,s,u,l,c,h,m,p,f){"use strict";function d(e,t){T.async(e,t)}function b(){T.on.apply(T,arguments)}function v(){T.off.apply(T,arguments)}var E=e["default"],g=t["default"],y=r["default"],_=n["default"],w=i["default"],C=o["default"],O=a["default"],A=s["default"],P=u["default"],T=l.config,x=l.configure,S=c["default"],V=h["default"],N=m["default"],I=p["default"];if("undefined"!=typeof window&&"object"==typeof window.__PROMISE_INSTRUMENTATION__){var R=window.__PROMISE_INSTRUMENTATION__;x("instrument",!0);for(var D in R)R.hasOwnProperty(D)&&b(D,R[D])}f.Promise=E,f.EventTarget=g,f.all=_,f.allSettled=w,f.race=C,f.hash=O,f.rethrow=A,f.defer=P,f.denodeify=y,f.configure=x,f.on=b,f.off=v,f.resolve=V,f.reject=N,f.async=d,f.map=S,f.filter=I})}(),function(){e("container/container",["container/inheriting_dict","exports"],function(e,t){"use strict";function r(e){this.parent=e,this.children=[],this.resolver=e&&e.resolver||function(){},this.registry=new E(e&&e.registry),this.cache=new E(e&&e.cache),this.factoryCache=new E(e&&e.factoryCache),this.resolveCache=new E(e&&e.resolveCache),this.typeInjections=new E(e&&e.typeInjections),this.injections={},this.factoryTypeInjections=new E(e&&e.factoryTypeInjections),this.factoryInjections={},this._options=new E(e&&e._options),this._typeOptions=new E(e&&e._typeOptions)}function n(e,t){return e.cache.has(t)?!0:!!e.resolve(t)}function i(e,t,r){if(r=r||{},e.cache.has(t)&&r.singleton!==!1)return e.cache.get(t);var n=m(e,t);return void 0!==n?(a(e,t)&&r.singleton!==!1&&e.cache.set(t,n),n):void 0}function o(e){throw new Error(e+" is not currently supported on child containers")}function a(e,t){var r=u(e,t,"singleton");return r!==!1}function s(e,t){var r={};if(!t)return r;for(var n,o,a=0,s=t.length;s>a;a++){if(n=t[a],o=i(e,n.fullName),void 0===o)throw new Error("Attempting to inject an unknown injection: `"+n.fullName+"`");r[n.property]=o}return r}function u(e,t,r){var n=e._options.get(t);if(n&&void 0!==n[r])return n[r];var i=t.split(":")[0];return n=e._typeOptions.get(i),n?n[r]:void 0}function l(e,t){var r,n=t,i=e.resolve(n),o=e.factoryCache,a=t.split(":")[0];if(void 0!==i){if(o.has(t))return o.get(t);if(!i||"function"!=typeof i.extend||!Ember.MODEL_FACTORY_INJECTIONS&&"model"===a)return i;var s=c(e,t),u=h(e,t);return u._toString=e.makeToString(i,t),r=i.extend(s),r.reopenClass(u),o.set(t,r),r}}function c(e,t){var r=t.split(":"),n=r[0],i=[];return i=i.concat(e.typeInjections.get(n)||[]),i=i.concat(e.injections[t]||[]),i=s(e,i),i._debugContainerKey=t,i.container=e,i}function h(e,t){var r=t.split(":"),n=r[0],i=[];return i=i.concat(e.factoryTypeInjections.get(n)||[]),i=i.concat(e.factoryInjections[t]||[]),i=s(e,i),i._debugContainerKey=t,i}function m(e,t){var r=l(e,t);return u(e,t,"instantiate")===!1?r:r?"function"==typeof r.extend?r.create():r.create(c(e,t)):void 0}function p(e,t){e.cache.eachLocal(function(r,n){u(e,r,"instantiate")!==!1&&t(n)
12
+ })}function f(e){e.cache.eachLocal(function(t,r){u(e,t,"instantiate")!==!1&&r.destroy()}),e.cache.dict={}}function d(e,t,r,n){var i=e.get(t);i||(i=[],e.set(t,i)),i.push({property:r,fullName:n})}function b(e){if(!g.test(e))throw new TypeError("Invalid Fullname, expected: `type:name` got: "+e)}function v(e,t,r,n){var i=e[t]=e[t]||[];i.push({property:r,fullName:n})}var E=e["default"];r.prototype={parent:null,children:null,resolver:null,registry:null,cache:null,typeInjections:null,injections:null,_options:null,_typeOptions:null,child:function(){var e=new r(this);return this.children.push(e),e},set:function(e,t,r){e[t]=r},register:function(e,t,r){if(b(e),void 0===t)throw new TypeError("Attempting to register an unknown factory: `"+e+"`");var n=this.normalize(e);if(this.cache.has(n))throw new Error("Cannot re-register: `"+e+"`, as it has already been looked up.");this.registry.set(n,t),this._options.set(n,r||{})},unregister:function(e){b(e);var t=this.normalize(e);this.registry.remove(t),this.cache.remove(t),this.factoryCache.remove(t),this.resolveCache.remove(t),this._options.remove(t)},resolve:function(e){b(e);var t=this.normalize(e),r=this.resolveCache.get(t);if(r)return r;var n=this.resolver(t)||this.registry.get(t);return this.resolveCache.set(t,n),n},describe:function(e){return e},normalize:function(e){return e},makeToString:function(e){return e.toString()},lookup:function(e,t){return b(e),i(this,this.normalize(e),t)},lookupFactory:function(e){return b(e),l(this,this.normalize(e))},has:function(e){return b(e),n(this,this.normalize(e))},optionsForType:function(e,t){this.parent&&o("optionsForType"),this._typeOptions.set(e,t)},options:function(e,t){this.optionsForType(e,t)},typeInjection:function(e,t,r){b(r),this.parent&&o("typeInjection"),d(this.typeInjections,e,t,r)},injection:function(e,t,r){this.parent&&o("injection"),b(r);var n=this.normalize(r);if(-1===e.indexOf(":"))return this.typeInjection(e,t,n);b(e);var i=this.normalize(e);v(this.injections,i,t,n)},factoryTypeInjection:function(e,t,r){this.parent&&o("factoryTypeInjection"),d(this.factoryTypeInjections,e,t,this.normalize(r))},factoryInjection:function(e,t,r){this.parent&&o("injection");var n=this.normalize(e),i=this.normalize(r);return b(r),-1===e.indexOf(":")?this.factoryTypeInjection(n,t,i):(b(e),v(this.factoryInjections,n,t,i),void 0)},destroy:function(){for(var e=0,t=this.children.length;t>e;e++)this.children[e].destroy();this.children=[],p(this,function(e){e.destroy()}),this.parent=void 0,this.isDestroyed=!0},reset:function(){for(var e=0,t=this.children.length;t>e;e++)f(this.children[e]);f(this)}};var g=/^[^:]+.+:[^:]+$/;t["default"]=r}),e("container/inheriting_dict",["exports"],function(e){"use strict";function t(e){this.parent=e,this.dict={}}t.prototype={parent:null,dict:null,get:function(e){var t=this.dict;return t.hasOwnProperty(e)?t[e]:this.parent?this.parent.get(e):void 0},set:function(e,t){this.dict[e]=t},remove:function(e){delete this.dict[e]},has:function(e){var t=this.dict;return t.hasOwnProperty(e)?!0:this.parent?this.parent.has(e):!1},eachLocal:function(e,t){var r=this.dict;for(var n in r)r.hasOwnProperty(n)&&e.call(t,n,r[n])}},e["default"]=t}),e("container",["container/container","exports"],function(e,t){"use strict";Ember.MODEL_FACTORY_INJECTIONS=!1||!!Ember.ENV.MODEL_FACTORY_INJECTIONS;var r=e["default"];t["default"]=r})}(),function(){function e(r,n,i,o){var a,s,u;if("object"!=typeof r||null===r)return r;if(n&&(s=t(i,r))>=0)return o[s];if("array"===Ember.typeOf(r)){if(a=r.slice(),n)for(s=a.length;--s>=0;)a[s]=e(a[s],n,i,o)}else if(Ember.Copyable&&Ember.Copyable.detect(r))a=r.copy(n,i,o);else if(r instanceof Date)a=new Date(r.getTime());else{a={};for(u in r)r.hasOwnProperty(u)&&"__"!==u.substring(0,2)&&(a[u]=n?e(r[u],n,i,o):r[u])}return n&&(i.push(r),o.push(a)),a}var t=Ember.EnumerableUtils.indexOf;if(Ember.compare=function i(e,t){if(e===t)return 0;var r=Ember.typeOf(e),n=Ember.typeOf(t),o=Ember.Comparable;if(o){if("instance"===r&&o.detect(e.constructor))return e.constructor.compare(e,t);if("instance"===n&&o.detect(t.constructor))return 1-t.constructor.compare(t,e)}var a=Ember.ORDER_DEFINITION_MAPPING;if(!a){var s=Ember.ORDER_DEFINITION;a=Ember.ORDER_DEFINITION_MAPPING={};var u,l;for(u=0,l=s.length;l>u;++u)a[s[u]]=u;delete Ember.ORDER_DEFINITION}var c=a[r],h=a[n];if(h>c)return-1;if(c>h)return 1;switch(r){case"boolean":case"number":return t>e?-1:e>t?1:0;case"string":var m=e.localeCompare(t);return 0>m?-1:m>0?1:0;case"array":for(var p=e.length,f=t.length,d=Math.min(p,f),b=0,v=0;0===b&&d>v;)b=i(e[v],t[v]),v++;return 0!==b?b:f>p?-1:p>f?1:0;case"instance":return Ember.Comparable&&Ember.Comparable.detect(e)?e.compare(e,t):0;case"date":var E=e.getTime(),g=t.getTime();return g>E?-1:E>g?1:0;default:return 0}},Ember.copy=function(t,r){return"object"!=typeof t||null===t?t:Ember.Copyable&&Ember.Copyable.detect(t)?t.copy(r):e(t,r,r?[]:null,r?[]:null)},Ember.isEqual=function(e,t){return e&&"function"==typeof e.isEqual?e.isEqual(t):e===t},Ember.ORDER_DEFINITION=Ember.ENV.ORDER_DEFINITION||["undefined","null","boolean","number","string","array","object","instance","function","class","date"],Ember.keys=Object.keys,!Ember.keys||Ember.create.isSimulated){var r=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","valueOf","toLocaleString","toString"],n=function(e,r,n){"__"!==n.substring(0,2)&&"_super"!==n&&(t(r,n)>=0||e.hasOwnProperty(n)&&r.push(n))};Ember.keys=function(e){var t,i=[];for(t in e)n(e,i,t);for(var o=0,a=r.length;a>o;o++)t=r[o],n(e,i,t);return i}}}(),function(){var e=/[ _]/g,t={},r=/([a-z\d])([A-Z])/g,n=/(\-|_|\.|\s)+(.)?/g,i=/([a-z\d])([A-Z]+)/g,o=/\-|\s+/g;Ember.STRINGS={},Ember.String={fmt:function(e,t){var r=0;return e.replace(/%@([0-9]+)?/g,function(e,n){return n=n?parseInt(n,10)-1:r++,e=t[n],null===e?"(null)":void 0===e?"":Ember.inspect(e)})},loc:function(e,t){return e=Ember.STRINGS[e]||e,Ember.String.fmt(e,t)},w:function(e){return e.split(/\s+/)},decamelize:function(e){return e.replace(r,"$1_$2").toLowerCase()},dasherize:function(r){var n,i=t,o=i.hasOwnProperty(r);return o?i[r]:(n=Ember.String.decamelize(r).replace(e,"-"),i[r]=n,n)},camelize:function(e){return e.replace(n,function(e,t,r){return r?r.toUpperCase():""}).replace(/^([A-Z])/,function(e){return e.toLowerCase()})},classify:function(e){for(var t=e.split("."),r=[],n=0,i=t.length;i>n;n++){var o=Ember.String.camelize(t[n]);r.push(o.charAt(0).toUpperCase()+o.substr(1))}return r.join(".")},underscore:function(e){return e.replace(i,"$1_$2").replace(o,"_").toLowerCase()},capitalize:function(e){return e.charAt(0).toUpperCase()+e.substr(1)}}}(),function(){var e=Ember.String.fmt,t=Ember.String.w,r=Ember.String.loc,n=Ember.String.camelize,i=Ember.String.decamelize,o=Ember.String.dasherize,a=Ember.String.underscore,s=Ember.String.capitalize,u=Ember.String.classify;(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.String)&&(String.prototype.fmt=function(){return e(this,arguments)},String.prototype.w=function(){return t(this)},String.prototype.loc=function(){return r(this,arguments)},String.prototype.camelize=function(){return n(this)},String.prototype.decamelize=function(){return i(this)},String.prototype.dasherize=function(){return o(this)},String.prototype.underscore=function(){return a(this)},String.prototype.classify=function(){return u(this)},String.prototype.capitalize=function(){return s(this)})}(),function(){var e=Ember.get,t=Ember.set,r=Array.prototype.slice,n=Ember.getProperties;Ember.Observable=Ember.Mixin.create({get:function(t){return e(this,t)},getProperties:function(){return n.apply(null,[this].concat(r.call(arguments)))},set:function(e,r){return t(this,e,r),this},setProperties:function(e){return Ember.setProperties(this,e)},beginPropertyChanges:function(){return Ember.beginPropertyChanges(),this},endPropertyChanges:function(){return Ember.endPropertyChanges(),this},propertyWillChange:function(e){return Ember.propertyWillChange(this,e),this},propertyDidChange:function(e){return Ember.propertyDidChange(this,e),this},notifyPropertyChange:function(e){return this.propertyWillChange(e),this.propertyDidChange(e),this},addBeforeObserver:function(e,t,r){Ember.addBeforeObserver(this,e,t,r)},addObserver:function(e,t,r){Ember.addObserver(this,e,t,r)},removeObserver:function(e,t,r){Ember.removeObserver(this,e,t,r)},hasObserverFor:function(e){return Ember.hasListeners(this,e+":change")},getWithDefault:function(e,t){return Ember.getWithDefault(this,e,t)},incrementProperty:function(r,n){return Ember.isNone(n)&&(n=1),t(this,r,(e(this,r)||0)+n),e(this,r)},decrementProperty:function(r,n){return Ember.isNone(n)&&(n=1),t(this,r,(e(this,r)||0)-n),e(this,r)},toggleProperty:function(r){return t(this,r,!e(this,r)),e(this,r)},cacheFor:function(e){return Ember.cacheFor(this,e)},observersForKey:function(e){return Ember.observersFor(this,e)}})}(),function(){function e(){var e,t,o=!1,a=function(){o||a.proto(),n(this,i,_),n(this,"__nextSuper",y);var u=s(this),l=u.proto;if(u.proto=this,e){var m=e;e=null,this.reopen.apply(this,m)}if(t){var p=t;t=null;for(var f=this.concatenatedProperties,d=0,v=p.length;v>d;d++){var w=p[d];if("object"!=typeof w&&void 0!==w)throw new Ember.Error("Ember.Object.create only accepts objects.");if(w)for(var C=Ember.keys(w),O=0,A=C.length;A>O;O++){var P=C[O];if(w.hasOwnProperty(P)){var T=w[P],x=Ember.IS_BINDING;if(x.test(P)){var S=u.bindings;S?u.hasOwnProperty("bindings")||(S=u.bindings=r(u.bindings)):S=u.bindings={},S[P]=T}var V=u.descs[P];if(f&&g(f,P)>=0){var N=this[P];T=N?"function"==typeof N.concat?N.concat(T):Ember.makeArray(N).concat(T):Ember.makeArray(T)}V?V.set(this,P,T):"function"!=typeof this.setUnknownProperty||P in this?E?Ember.defineProperty(this,P,null,T):this[P]=T:this.setUnknownProperty(P,T)}}}}b(this,u),this.init.apply(this,arguments),u.proto=l,c(this),h(this,"init")};return a.toString=f.prototype.toString,a.willReopen=function(){o&&(a.PrototypeMixin=f.create(a.PrototypeMixin)),o=!1},a._initMixins=function(t){e=t},a._initProperties=function(e){t=e},a.proto=function(){var e=a.superclass;return e&&e.proto(),o||(o=!0,a.PrototypeMixin.applyPartial(a.prototype),l(a.prototype)),this.prototype},a}function t(e){return function(){return e}}var r=(Ember.set,Ember.get,Ember.create),n=Ember.platform.defineProperty,i=Ember.GUID_KEY,o=Ember.guidFor,a=Ember.generateGuid,s=Ember.meta,u=Ember.META_KEY,l=Ember.rewatch,c=Ember.finishChains,h=Ember.sendEvent,m=Ember.destroy,p=Ember.run.schedule,f=Ember.Mixin,d=f._apply,b=f.finishPartial,v=f.prototype.reopen,E=Ember.ENV.MANDATORY_SETTER,g=Ember.EnumerableUtils.indexOf,y={configurable:!0,writable:!0,enumerable:!1,value:void 0},_={configurable:!0,writable:!0,enumerable:!1,value:null},w=e();w.toString=function(){return"Ember.CoreObject"},w.PrototypeMixin=f.create({reopen:function(){return d(this,arguments,!0),this},init:function(){},concatenatedProperties:null,isDestroyed:!1,isDestroying:!1,destroy:function(){return this.isDestroying?void 0:(this.isDestroying=!0,p("actions",this,this.willDestroy),p("destroy",this,this._scheduledDestroy),this)},willDestroy:Ember.K,_scheduledDestroy:function(){this.isDestroyed||(m(this),this.isDestroyed=!0)},bind:function(e,t){return t instanceof Ember.Binding||(t=Ember.Binding.from(t)),t.to(e).connect(this),t},toString:function(){var e="function"==typeof this.toStringExtension,r=e?":"+this.toStringExtension():"",n="<"+this.constructor.toString()+":"+o(this)+r+">";return this.toString=t(n),n}}),w.PrototypeMixin.ownerConstructor=w,Ember.config.overridePrototypeMixin&&Ember.config.overridePrototypeMixin(w.PrototypeMixin),w.__super__=null;var C=f.create({ClassMixin:Ember.required(),PrototypeMixin:Ember.required(),isClass:!0,isMethod:!1,extend:function(){var t,n=e();return n.ClassMixin=f.create(this.ClassMixin),n.PrototypeMixin=f.create(this.PrototypeMixin),n.ClassMixin.ownerConstructor=n,n.PrototypeMixin.ownerConstructor=n,v.apply(n.PrototypeMixin,arguments),n.superclass=this,n.__super__=this.prototype,t=n.prototype=r(this.prototype),t.constructor=n,a(t),s(t).proto=t,n.ClassMixin.apply(n),n},createWithMixins:function(){var e=this;return arguments.length>0&&this._initMixins(arguments),new e},create:function(){var e=this;return arguments.length>0&&this._initProperties(arguments),new e},reopen:function(){return this.willReopen(),v.apply(this.PrototypeMixin,arguments),this},reopenClass:function(){return v.apply(this.ClassMixin,arguments),d(this,arguments,!1),this},detect:function(e){if("function"!=typeof e)return!1;for(;e;){if(e===this)return!0;e=e.superclass}return!1},detectInstance:function(e){return e instanceof this},metaForProperty:function(e){var t=this.proto()[u],r=t&&t.descs[e];return r._meta||{}},eachComputedProperty:function(e,t){var r,n=this.proto(),i=s(n).descs,o={};for(var a in i)r=i[a],r instanceof Ember.ComputedProperty&&e.call(t||this,a,r._meta||o)}});C.ownerConstructor=w,Ember.config.overrideClassMixin&&Ember.config.overrideClassMixin(C),w.ClassMixin=C,C.apply(w),Ember.CoreObject=w}(),function(){Ember.Object=Ember.CoreObject.extend(Ember.Observable),Ember.Object.toString=function(){return"Ember.Object"}}(),function(){function e(t,r,i){var a=t.length;l[t.join(".")]=r;for(var s in r)if(c.call(r,s)){var u=r[s];if(t[a]=s,u&&u.toString===n)u.toString=o(t.join(".")),u[m]=t.join(".");else if(u&&u.isNamespace){if(i[h(u)])continue;i[h(u)]=!0,e(t,u,i)}}t.length=a}function t(){var e,t,r=Ember.Namespace,n=Ember.lookup;if(!r.PROCESSED)for(var i in n)if("parent"!==i&&"top"!==i&&"frameElement"!==i&&"webkitStorageInfo"!==i&&!("globalStorage"===i&&n.StorageList&&n.globalStorage instanceof n.StorageList||n.hasOwnProperty&&!n.hasOwnProperty(i))){try{e=Ember.lookup[i],t=e&&e.isNamespace}catch(o){continue}t&&(e[m]=i)}}function r(e){var t=e.superclass;return t?t[m]?t[m]:r(t):void 0}function n(){Ember.BOOTED||this[m]||i();var e;if(this[m])e=this[m];else if(this._toString)e=this._toString;else{var t=r(this);e=t?"(subclass of "+t+")":"(unknown mixin)",this.toString=o(e)}return e}function i(){var r=!u.PROCESSED,n=Ember.anyUnprocessedMixins;if(r&&(t(),u.PROCESSED=!0),r||n){for(var i,o=u.NAMESPACES,a=0,s=o.length;s>a;a++)i=o[a],e([i.toString()],i,{});Ember.anyUnprocessedMixins=!1}}function o(e){return function(){return e}}var a=Ember.get,s=Ember.ArrayPolyfills.indexOf,u=Ember.Namespace=Ember.Object.extend({isNamespace:!0,init:function(){Ember.Namespace.NAMESPACES.push(this),Ember.Namespace.PROCESSED=!1},toString:function(){var e=a(this,"name");return e?e:(t(),this[Ember.GUID_KEY+"_name"])},nameClasses:function(){e([this.toString()],this,{})},destroy:function(){var e=Ember.Namespace.NAMESPACES;Ember.lookup[this.toString()]=void 0,delete Ember.Namespace.NAMESPACES_BY_ID[this.toString()],e.splice(s.call(e,this),1),this._super()}});u.reopenClass({NAMESPACES:[Ember],NAMESPACES_BY_ID:{},PROCESSED:!1,processAll:i,byName:function(e){return Ember.BOOTED||i(),l[e]}});var l=u.NAMESPACES_BY_ID,c={}.hasOwnProperty,h=Ember.guidFor,m=Ember.NAME_KEY=Ember.GUID_KEY+"_name";Ember.Mixin.prototype.toString=n}(),function(){function e(e,t){var r=t.slice(8);r in this||u(this,r)}function t(e,t){var r=t.slice(8);r in this||l(this,r)}var r=Ember.get,n=Ember.set,i=(Ember.String.fmt,Ember.addBeforeObserver),o=Ember.addObserver,a=Ember.removeBeforeObserver,s=Ember.removeObserver,u=Ember.propertyWillChange,l=Ember.propertyDidChange,c=Ember.meta,h=Ember.defineProperty;Ember.ObjectProxy=Ember.Object.extend({content:null,_contentDidChange:Ember.observer("content",function(){}),isTruthy:Ember.computed.bool("content"),_debugContainerKey:null,willWatchProperty:function(r){var n="content."+r;i(this,n,null,e),o(this,n,null,t)},didUnwatchProperty:function(r){var n="content."+r;a(this,n,null,e),s(this,n,null,t)},unknownProperty:function(e){var t=r(this,"content");return t?r(t,e):void 0},setUnknownProperty:function(e,t){var i=c(this);if(i.proto===this)return h(this,e,null,t),t;var o=r(this,"content");return n(o,e,t)}})}(),function(){function e(){return 0===s.length?{}:s.pop()}function t(e){return s.push(e),null}function r(e,t){function r(r){var o=n(r,e);return i?t===o:!!o}var i=2===arguments.length;return r}var n=Ember.get,i=Ember.set,o=Array.prototype.slice,a=Ember.EnumerableUtils.indexOf,s=[];Ember.Enumerable=Ember.Mixin.create({nextObject:Ember.required(Function),firstObject:Ember.computed(function(){if(0===n(this,"length"))return void 0;var r,i=e();return r=this.nextObject(0,null,i),t(i),r}).property("[]"),lastObject:Ember.computed(function(){var r=n(this,"length");if(0===r)return void 0;var i,o=e(),a=0,s=null;do s=i,i=this.nextObject(a++,s,o);while(void 0!==i);return t(o),s}).property("[]"),contains:function(e){return void 0!==this.find(function(t){return t===e})},forEach:function(r,i){if("function"!=typeof r)throw new TypeError;var o=n(this,"length"),a=null,s=e();void 0===i&&(i=null);for(var u=0;o>u;u++){var l=this.nextObject(u,a,s);r.call(i,l,u,this),a=l}return a=null,s=t(s),this},getEach:function(e){return this.mapBy(e)},setEach:function(e,t){return this.forEach(function(r){i(r,e,t)})},map:function(e,t){var r=Ember.A();return this.forEach(function(n,i,o){r[i]=e.call(t,n,i,o)}),r},mapBy:function(e){return this.map(function(t){return n(t,e)})},mapProperty:Ember.aliasMethod("mapBy"),filter:function(e,t){var r=Ember.A();return this.forEach(function(n,i,o){e.call(t,n,i,o)&&r.push(n)}),r},reject:function(e,t){return this.filter(function(){return!e.apply(t,arguments)})},filterBy:function(){return this.filter(r.apply(this,arguments))},filterProperty:Ember.aliasMethod("filterBy"),rejectBy:function(e,t){var r=function(r){return n(r,e)===t},i=function(t){return!!n(t,e)},o=2===arguments.length?r:i;return this.reject(o)},rejectProperty:Ember.aliasMethod("rejectBy"),find:function(r,i){var o=n(this,"length");void 0===i&&(i=null);for(var a,s,u=null,l=!1,c=e(),h=0;o>h&&!l;h++)a=this.nextObject(h,u,c),(l=r.call(i,a,h,this))&&(s=a),u=a;return a=u=null,c=t(c),s},findBy:function(){return this.find(r.apply(this,arguments))},findProperty:Ember.aliasMethod("findBy"),every:function(e,t){return!this.find(function(r,n,i){return!e.call(t,r,n,i)})},everyBy:Ember.aliasMethod("isEvery"),everyProperty:Ember.aliasMethod("isEvery"),isEvery:function(){return this.every(r.apply(this,arguments))},any:function(r,i){var o,a,s=n(this,"length"),u=e(),l=!1,c=null;for(void 0===i&&(i=null),a=0;s>a&&!l;a++)o=this.nextObject(a,c,u),l=r.call(i,o,a,this),c=o;return o=c=null,u=t(u),l},some:Ember.aliasMethod("any"),isAny:function(){return this.any(r.apply(this,arguments))},anyBy:Ember.aliasMethod("isAny"),someProperty:Ember.aliasMethod("isAny"),reduce:function(e,t,r){if("function"!=typeof e)throw new TypeError;var n=t;return this.forEach(function(t,i){n=e(n,t,i,this,r)},this),n},invoke:function(e){var t,r=Ember.A();return arguments.length>1&&(t=o.call(arguments,1)),this.forEach(function(n,i){var o=n&&n[e];"function"==typeof o&&(r[i]=t?o.apply(n,t):n[e]())},this),r},toArray:function(){var e=Ember.A();return this.forEach(function(t,r){e[r]=t}),e},compact:function(){return this.filter(function(e){return null!=e})},without:function(e){if(!this.contains(e))return this;var t=Ember.A();return this.forEach(function(r){r!==e&&(t[t.length]=r)}),t},uniq:function(){var e=Ember.A();return this.forEach(function(t){a(e,t)<0&&e.push(t)}),e},"[]":Ember.computed(function(){return this}),addEnumerableObserver:function(e,t){var r=t&&t.willChange||"enumerableWillChange",i=t&&t.didChange||"enumerableDidChange",o=n(this,"hasEnumerableObservers");return o||Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.addListener(this,"@enumerable:before",e,r),Ember.addListener(this,"@enumerable:change",e,i),o||Ember.propertyDidChange(this,"hasEnumerableObservers"),this},removeEnumerableObserver:function(e,t){var r=t&&t.willChange||"enumerableWillChange",i=t&&t.didChange||"enumerableDidChange",o=n(this,"hasEnumerableObservers");return o&&Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.removeListener(this,"@enumerable:before",e,r),Ember.removeListener(this,"@enumerable:change",e,i),o&&Ember.propertyDidChange(this,"hasEnumerableObservers"),this},hasEnumerableObservers:Ember.computed(function(){return Ember.hasListeners(this,"@enumerable:change")||Ember.hasListeners(this,"@enumerable:before")}),enumerableContentWillChange:function(e,t){var r,i,o;return r="number"==typeof e?e:e?n(e,"length"):e=-1,i="number"==typeof t?t:t?n(t,"length"):t=-1,o=0>i||0>r||i-r!==0,-1===e&&(e=null),-1===t&&(t=null),Ember.propertyWillChange(this,"[]"),o&&Ember.propertyWillChange(this,"length"),Ember.sendEvent(this,"@enumerable:before",[this,e,t]),this},enumerableContentDidChange:function(e,t){var r,i,o;return r="number"==typeof e?e:e?n(e,"length"):e=-1,i="number"==typeof t?t:t?n(t,"length"):t=-1,o=0>i||0>r||i-r!==0,-1===e&&(e=null),-1===t&&(t=null),Ember.sendEvent(this,"@enumerable:change",[this,e,t]),o&&Ember.propertyDidChange(this,"length"),Ember.propertyDidChange(this,"[]"),this},sortBy:function(){var e=arguments;return this.toArray().sort(function(t,r){for(var i=0;i<e.length;i++){var o=e[i],a=n(t,o),s=n(r,o),u=Ember.compare(a,s);if(u)return u}return 0})}})}(),function(){var e=Ember.get,t=(Ember.set,Ember.isNone),r=Ember.EnumerableUtils.map,n=Ember.cacheFor;Ember.Array=Ember.Mixin.create(Ember.Enumerable,{length:Ember.required(),objectAt:function(t){return 0>t||t>=e(this,"length")?void 0:e(this,t)},objectsAt:function(e){var t=this;return r(e,function(e){return t.objectAt(e)})},nextObject:function(e){return this.objectAt(e)},"[]":Ember.computed(function(t,r){return void 0!==r&&this.replace(0,e(this,"length"),r),this}),firstObject:Ember.computed(function(){return this.objectAt(0)}),lastObject:Ember.computed(function(){return this.objectAt(e(this,"length")-1)}),contains:function(e){return this.indexOf(e)>=0},slice:function(r,n){var i=Ember.A(),o=e(this,"length");for(t(r)&&(r=0),(t(n)||n>o)&&(n=o),0>r&&(r=o+r),0>n&&(n=o+n);n>r;)i[i.length]=this.objectAt(r++);return i},indexOf:function(t,r){var n,i=e(this,"length");for(void 0===r&&(r=0),0>r&&(r+=i),n=r;i>n;n++)if(this.objectAt(n)===t)return n;return-1},lastIndexOf:function(t,r){var n,i=e(this,"length");for((void 0===r||r>=i)&&(r=i-1),0>r&&(r+=i),n=r;n>=0;n--)if(this.objectAt(n)===t)return n;return-1},addArrayObserver:function(t,r){var n=r&&r.willChange||"arrayWillChange",i=r&&r.didChange||"arrayDidChange",o=e(this,"hasArrayObservers");return o||Ember.propertyWillChange(this,"hasArrayObservers"),Ember.addListener(this,"@array:before",t,n),Ember.addListener(this,"@array:change",t,i),o||Ember.propertyDidChange(this,"hasArrayObservers"),this},removeArrayObserver:function(t,r){var n=r&&r.willChange||"arrayWillChange",i=r&&r.didChange||"arrayDidChange",o=e(this,"hasArrayObservers");return o&&Ember.propertyWillChange(this,"hasArrayObservers"),Ember.removeListener(this,"@array:before",t,n),Ember.removeListener(this,"@array:change",t,i),o&&Ember.propertyDidChange(this,"hasArrayObservers"),this},hasArrayObservers:Ember.computed(function(){return Ember.hasListeners(this,"@array:change")||Ember.hasListeners(this,"@array:before")}),arrayContentWillChange:function(t,r,n){void 0===t?(t=0,r=n=-1):(void 0===r&&(r=-1),void 0===n&&(n=-1)),Ember.isWatching(this,"@each")&&e(this,"@each"),Ember.sendEvent(this,"@array:before",[this,t,r,n]);var i,o;if(t>=0&&r>=0&&e(this,"hasEnumerableObservers")){i=[],o=t+r;for(var a=t;o>a;a++)i.push(this.objectAt(a))}else i=r;return this.enumerableContentWillChange(i,n),this},arrayContentDidChange:function(t,r,i){void 0===t?(t=0,r=i=-1):(void 0===r&&(r=-1),void 0===i&&(i=-1));var o,a;if(t>=0&&i>=0&&e(this,"hasEnumerableObservers")){o=[],a=t+i;for(var s=t;a>s;s++)o.push(this.objectAt(s))}else o=i;this.enumerableContentDidChange(r,o),Ember.sendEvent(this,"@array:change",[this,t,r,i]);var u=e(this,"length"),l=n(this,"firstObject"),c=n(this,"lastObject");return this.objectAt(0)!==l&&(Ember.propertyWillChange(this,"firstObject"),Ember.propertyDidChange(this,"firstObject")),this.objectAt(u-1)!==c&&(Ember.propertyWillChange(this,"lastObject"),Ember.propertyDidChange(this,"lastObject")),this},"@each":Ember.computed(function(){return this.__each||(this.__each=new Ember.EachProxy(this)),this.__each})})}(),function(){function e(e,t){return"@this"===t?e:m(e,t)}function t(e,t,r){this.callbacks=e,this.cp=t,this.instanceMeta=r,this.dependentKeysByGuid={},this.trackedArraysByGuid={},this.suspended=!1,this.changedItems={}}function r(e,t,r){this.dependentArray=e,this.index=t,this.item=e.objectAt(t),this.trackedArray=r,this.beforeObserver=null,this.observer=null,this.destroyed=!1}function n(e,t,r){return 0>e?Math.max(0,t+e):t>e?e:Math.min(t-r,e)}function i(e,t,r){return Math.min(r,t-e)}function o(e,t,r,n,i,o){var a={arrayChanged:e,index:r,item:t,propertyName:n,property:i};return o&&(a.previousValues=o),a}function a(e,t,r,n,i){O(e,function(a,s){i.setValue(t.addedItem.call(this,i.getValue(),a,o(e,a,s,n,r),i.sugarMeta))},this)}function s(e,t){{var r;e._callbacks()}e._hasInstanceMeta(this,t)?(r=e._instanceMeta(this,t),r.setValue(e.resetValue(r.getValue()))):r=e._instanceMeta(this,t),e.options.initialize&&e.options.initialize.call(this,r.getValue(),{property:e,propertyName:t},r.sugarMeta)}function u(t,r){if(T.test(r))return!1;var n=e(t,r);return Ember.Array.detect(n)}function l(e,t,r){this.context=e,this.propertyName=t,this.cache=f(e).cache,this.dependentArrays={},this.sugarMeta={},this.initialValue=r}function c(t){var r=this;this.options=t,this._dependentKeys=null,this._itemPropertyKeys={},this._previousItemPropertyKeys={},this.readOnly(),this.cacheable(),this.recomputeOnce=function(e){Ember.run.once(this,n,e)};var n=function(t){var n=(r._dependentKeys,r._instanceMeta(this,t)),i=r._callbacks();s.call(this,r,t),n.dependentArraysObserver.suspendArrayObservers(function(){O(r._dependentKeys,function(t){if(u(this,t)){var i=e(this,t),o=n.dependentArrays[t];i===o?r._previousItemPropertyKeys[t]&&(delete r._previousItemPropertyKeys[t],n.dependentArraysObserver.setupPropertyObservers(t,r._itemPropertyKeys[t])):(n.dependentArrays[t]=i,o&&n.dependentArraysObserver.teardownObservers(o,t),i&&n.dependentArraysObserver.setupObservers(i,t))}},this)},this),O(r._dependentKeys,function(o){if(u(this,o)){var s=e(this,o);s&&a.call(this,s,i,r,t,n)}},this)};this.func=function(e){return n.call(this,e),r._instanceMeta(this,e).getValue()}}function h(e){return e}var m=Ember.get,p=(Ember.set,Ember.guidFor),f=Ember.meta,d=Ember.propertyWillChange,b=Ember.propertyDidChange,v=Ember.addBeforeObserver,E=Ember.removeBeforeObserver,g=Ember.addObserver,y=Ember.removeObserver,_=Ember.ComputedProperty,w=[].slice,C=Ember.create,O=Ember.EnumerableUtils.forEach,A=(Ember.cacheFor.set,Ember.cacheFor.get,Ember.cacheFor.remove,/^(.*)\.@each\.(.*)/),P=/(.*\.@each){2,}/,T=/\.\[\]$/,x=Ember.expandProperties;t.prototype={setValue:function(e){this.instanceMeta.setValue(e,!0)},getValue:function(){return this.instanceMeta.getValue()},setupObservers:function(e,t){this.dependentKeysByGuid[p(e)]=t,e.addArrayObserver(this,{willChange:"dependentArrayWillChange",didChange:"dependentArrayDidChange"}),this.cp._itemPropertyKeys[t]&&this.setupPropertyObservers(t,this.cp._itemPropertyKeys[t])},teardownObservers:function(e,t){var r=this.cp._itemPropertyKeys[t]||[];delete this.dependentKeysByGuid[p(e)],this.teardownPropertyObservers(t,r),e.removeArrayObserver(this,{willChange:"dependentArrayWillChange",didChange:"dependentArrayDidChange"})},suspendArrayObservers:function(e,t){var r=this.suspended;this.suspended=!0,e.call(t),this.suspended=r},setupPropertyObservers:function(t,r){var n=e(this.instanceMeta.context,t),i=e(n,"length"),o=new Array(i);this.resetTransformations(t,o),O(n,function(e,i){var a=this.createPropertyObserverContext(n,i,this.trackedArraysByGuid[t]);o[i]=a,O(r,function(t){v(e,t,this,a.beforeObserver),g(e,t,this,a.observer)},this)},this)},teardownPropertyObservers:function(e,t){var r,n,i,o=this,a=this.trackedArraysByGuid[e];a&&a.apply(function(e,a,s){s!==Ember.TrackedArray.DELETE&&O(e,function(e){e.destroyed=!0,r=e.beforeObserver,n=e.observer,i=e.item,O(t,function(e){E(i,e,o,r),y(i,e,o,n)})})})},createPropertyObserverContext:function(e,t,n){var i=new r(e,t,n);return this.createPropertyObserver(i),i},createPropertyObserver:function(e){var t=this;e.beforeObserver=function(r,n){return t.itemPropertyWillChange(r,n,e.dependentArray,e)},e.observer=function(r,n){return t.itemPropertyDidChange(r,n,e.dependentArray,e)}},resetTransformations:function(e,t){this.trackedArraysByGuid[e]=new Ember.TrackedArray(t)},trackAdd:function(e,t,r){var n=this.trackedArraysByGuid[e];n&&n.addItems(t,r)},trackRemove:function(e,t,r){var n=this.trackedArraysByGuid[e];return n?n.removeItems(t,r):[]},updateIndexes:function(t,r){var n=e(r,"length");t.apply(function(e,t,r){r!==Ember.TrackedArray.DELETE&&(r!==Ember.TrackedArray.RETAIN||e.length!==n||0!==t)&&O(e,function(e,r){e.index=r+t})})},dependentArrayWillChange:function(t,r,a){function s(e){m[h].destroyed=!0,E(l,e,this,m[h].beforeObserver),y(l,e,this,m[h].observer)}if(!this.suspended){var u,l,c,h,m,f=this.callbacks.removedItem,d=p(t),b=this.dependentKeysByGuid[d],v=this.cp._itemPropertyKeys[b]||[],g=e(t,"length"),_=n(r,g,0),w=i(_,g,a);for(m=this.trackRemove(b,_,w),h=w-1;h>=0&&(c=_+h,!(c>=g));--h)l=t.objectAt(c),O(v,s,this),u=o(t,l,c,this.instanceMeta.propertyName,this.cp),this.setValue(f.call(this.instanceMeta.context,this.getValue(),l,u,this.instanceMeta.sugarMeta))}},dependentArrayDidChange:function(t,r,i,a){if(!this.suspended){var s,u,l=this.callbacks.addedItem,c=p(t),h=this.dependentKeysByGuid[c],m=new Array(a),f=this.cp._itemPropertyKeys[h],d=e(t,"length"),b=n(r,d,a);O(t.slice(b,b+a),function(e,r){f&&(u=m[r]=this.createPropertyObserverContext(t,b+r,this.trackedArraysByGuid[h]),O(f,function(t){v(e,t,this,u.beforeObserver),g(e,t,this,u.observer)},this)),s=o(t,e,b+r,this.instanceMeta.propertyName,this.cp),this.setValue(l.call(this.instanceMeta.context,this.getValue(),e,s,this.instanceMeta.sugarMeta))},this),this.trackAdd(h,b,m)}},itemPropertyWillChange:function(t,r,n,i){var o=p(t);this.changedItems[o]||(this.changedItems[o]={array:n,observerContext:i,obj:t,previousValues:{}}),this.changedItems[o].previousValues[r]=e(t,r)},itemPropertyDidChange:function(){this.flushChanges()},flushChanges:function(){var e,t,r,n=this.changedItems;for(e in n)t=n[e],t.observerContext.destroyed||(this.updateIndexes(t.observerContext.trackedArray,t.observerContext.dependentArray),r=o(t.array,t.obj,t.observerContext.index,this.instanceMeta.propertyName,this.cp,t.previousValues),this.setValue(this.callbacks.removedItem.call(this.instanceMeta.context,this.getValue(),t.obj,r,this.instanceMeta.sugarMeta)),this.setValue(this.callbacks.addedItem.call(this.instanceMeta.context,this.getValue(),t.obj,r,this.instanceMeta.sugarMeta)));this.changedItems={}}},l.prototype={getValue:function(){return this.propertyName in this.cache?this.cache[this.propertyName]:this.initialValue},setValue:function(e,t){e!==this.cache[this.propertyName]&&(t&&d(this.context,this.propertyName),void 0===e?delete this.cache[this.propertyName]:this.cache[this.propertyName]=e,t&&b(this.context,this.propertyName))}},Ember.ReduceComputedProperty=c,c.prototype=C(_.prototype),c.prototype._callbacks=function(){if(!this.callbacks){var e=this.options;this.callbacks={removedItem:e.removedItem||h,addedItem:e.addedItem||h}}return this.callbacks},c.prototype._hasInstanceMeta=function(e,t){return!!f(e).cacheMeta[t]},c.prototype._instanceMeta=function(e,r){var n=f(e).cacheMeta,i=n[r];return i||(i=n[r]=new l(e,r,this.initialValue()),i.dependentArraysObserver=new t(this._callbacks(),this,i,e,r,i.sugarMeta)),i},c.prototype.initialValue=function(){return"function"==typeof this.options.initialValue?this.options.initialValue():this.options.initialValue},c.prototype.resetValue=function(){return this.initialValue()},c.prototype.itemPropertyKey=function(e,t){this._itemPropertyKeys[e]=this._itemPropertyKeys[e]||[],this._itemPropertyKeys[e].push(t)},c.prototype.clearItemPropertyKeys=function(e){this._itemPropertyKeys[e]&&(this._previousItemPropertyKeys[e]=this._itemPropertyKeys[e],this._itemPropertyKeys[e]=[])},c.prototype.property=function(){var e,t,r=this,n=w.call(arguments),i=new Ember.Set;return O(n,function(n){if(P.test(n))throw new Ember.Error("Nested @each properties not supported: "+n);if(e=A.exec(n)){t=e[1];var o=e[2],a=function(e){r.itemPropertyKey(t,e)};x(o,a),i.add(t)}else i.add(n)}),_.prototype.property.apply(this,i.toArray())},Ember.reduceComputed=function(e){var t;if(arguments.length>1&&(t=w.call(arguments,0,-1),e=w.call(arguments,-1)[0]),"object"!=typeof e)throw new Ember.Error("Reduce Computed Property declared without an options hash");if(!("initialValue"in e))throw new Ember.Error("Reduce Computed Property declared without an initial value");var r=new c(e);return t&&r.property.apply(r,t),r}}(),function(){function e(){var e=this;
13
+ return t.apply(this,arguments),this.func=function(t){return function(r){return e._hasInstanceMeta(this,r)||i(e._dependentKeys,function(t){Ember.addObserver(this,t,function(){e.recomputeOnce.call(this,r)})},this),t.apply(this,arguments)}}(this.func),this}var t=Ember.ReduceComputedProperty,r=[].slice,n=Ember.create,i=Ember.EnumerableUtils.forEach;Ember.ArrayComputedProperty=e,e.prototype=n(t.prototype),e.prototype.initialValue=function(){return Ember.A()},e.prototype.resetValue=function(e){return e.clear(),e},e.prototype.didChange=function(){},Ember.arrayComputed=function(t){var n;if(arguments.length>1&&(n=r.call(arguments,0,-1),t=r.call(arguments,-1)[0]),"object"!=typeof t)throw new Ember.Error("Array Computed Property declared without an options hash");var i=new e(t);return n&&i.property.apply(i,n),i}}(),function(){function e(e,i,o,a){function s(e){return t.detectInstance(e)?n(r(e,"content")):n(e)}var u,l,c,h,m;return arguments.length<4&&(a=r(e,"length")),arguments.length<3&&(o=0),o===a?o:(u=o+Math.floor((a-o)/2),l=e.objectAt(u),h=s(l),m=s(i),h===m?u:(c=this.order(l,i),0===c&&(c=m>h?-1:1),0>c?this.binarySearch(e,i,u+1,a):c>0?this.binarySearch(e,i,o,u):u))}var t,r=Ember.get,n=(Ember.set,Ember.guidFor),i=Ember.merge,o=[].slice,a=Ember.EnumerableUtils.forEach,s=Ember.EnumerableUtils.map;Ember.computed.sum=function(e){return Ember.reduceComputed(e,{initialValue:0,addedItem:function(e,t){return e+t},removedItem:function(e,t){return e-t}})},Ember.computed.max=function(e){return Ember.reduceComputed(e,{initialValue:-1/0,addedItem:function(e,t){return Math.max(e,t)},removedItem:function(e,t){return e>t?e:void 0}})},Ember.computed.min=function(e){return Ember.reduceComputed(e,{initialValue:1/0,addedItem:function(e,t){return Math.min(e,t)},removedItem:function(e,t){return t>e?e:void 0}})},Ember.computed.map=function(e,t){var r={addedItem:function(e,r,n){var i=t.call(this,r);return e.insertAt(n.index,i),e},removedItem:function(e,t,r){return e.removeAt(r.index,1),e}};return Ember.arrayComputed(e,r)},Ember.computed.mapBy=function(e,t){var n=function(e){return r(e,t)};return Ember.computed.map(e+".@each."+t,n)},Ember.computed.mapProperty=Ember.computed.mapBy,Ember.computed.filter=function(e,t){var r={initialize:function(e,t,r){r.filteredArrayIndexes=new Ember.SubArray},addedItem:function(e,r,n,i){var o=!!t.call(this,r),a=i.filteredArrayIndexes.addItem(n.index,o);return o&&e.insertAt(a,r),e},removedItem:function(e,t,r,n){var i=n.filteredArrayIndexes.removeItem(r.index);return i>-1&&e.removeAt(i),e}};return Ember.arrayComputed(e,r)},Ember.computed.filterBy=function(e,t,n){var i;return i=2===arguments.length?function(e){return r(e,t)}:function(e){return r(e,t)===n},Ember.computed.filter(e+".@each."+t,i)},Ember.computed.filterProperty=Ember.computed.filterBy,Ember.computed.uniq=function(){var e=o.call(arguments);return e.push({initialize:function(e,t,r){r.itemCounts={}},addedItem:function(e,t,r,i){var o=n(t);return i.itemCounts[o]?++i.itemCounts[o]:i.itemCounts[o]=1,e.addObject(t),e},removedItem:function(e,t,r,i){var o=n(t),a=i.itemCounts;return 0===--a[o]&&e.removeObject(t),e}}),Ember.arrayComputed.apply(null,e)},Ember.computed.union=Ember.computed.uniq,Ember.computed.intersect=function(){var e=function(e){return s(e.property._dependentKeys,function(e){return n(e)})},t=o.call(arguments);return t.push({initialize:function(e,t,r){r.itemCounts={}},addedItem:function(t,r,i,o){var a=n(r),s=(e(i),n(i.arrayChanged)),u=i.property._dependentKeys.length,l=o.itemCounts;return l[a]||(l[a]={}),void 0===l[a][s]&&(l[a][s]=0),1===++l[a][s]&&u===Ember.keys(l[a]).length&&t.addObject(r),t},removedItem:function(t,r,i,o){var a,s=n(r),u=(e(i),n(i.arrayChanged)),l=(i.property._dependentKeys.length,o.itemCounts);return void 0===l[s][u]&&(l[s][u]=0),0===--l[s][u]&&(delete l[s][u],a=Ember.keys(l[s]).length,0===a&&delete l[s],t.removeObject(r)),t}}),Ember.arrayComputed.apply(null,t)},Ember.computed.setDiff=function(e,t){if(2!==arguments.length)throw new Ember.Error("setDiff requires exactly two dependent arrays.");return Ember.arrayComputed(e,t,{addedItem:function(n,i,o){var a=r(this,e),s=r(this,t);return o.arrayChanged===a?s.contains(i)||n.addObject(i):n.removeObject(i),n},removedItem:function(n,i,o){var a=r(this,e),s=r(this,t);return o.arrayChanged===s?a.contains(i)&&n.addObject(i):n.removeObject(i),n}})},t=Ember.ObjectProxy.extend(),Ember.computed.sort=function(n,o){var s,u;return"function"==typeof o?s=function(t,r,n){n.order=o,n.binarySearch=e}:(u=o,s=function(i,o,s){function l(){var e,t,i,l=r(this,u),h=s.sortProperties=[],m=s.sortPropertyAscending={};o.property.clearItemPropertyKeys(n),a(l,function(r){-1!==(t=r.indexOf(":"))?(e=r.substring(0,t),i="desc"!==r.substring(t+1).toLowerCase()):(e=r,i=!0),h.push(e),m[e]=i,o.property.itemPropertyKey(n,e)}),l.addObserver("@each",this,c)}function c(){Ember.run.once(this,h,o.propertyName)}function h(e){l.call(this),o.property.recomputeOnce.call(this,e)}Ember.addObserver(this,u,c),l.call(this),s.order=function(e,n){for(var i,o,a,s=n instanceof t,u=0;u<this.sortProperties.length;++u)if(i=this.sortProperties[u],o=Ember.compare(r(e,i),s?n[i]:r(n,i)),0!==o)return a=this.sortPropertyAscending[i],a?o:-1*o;return 0},s.binarySearch=e}),Ember.arrayComputed(n,{initialize:s,addedItem:function(e,t,r,n){var i=n.binarySearch(e,t);return e.insertAt(i,t),e},removedItem:function(e,r,n,o){var a,s,u;return n.previousValues?(a=i({content:r},n.previousValues),u=t.create(a)):u=r,s=o.binarySearch(e,u),e.removeAt(s),e}})}}(),function(){Ember.RSVP=t("rsvp"),Ember.RSVP.onerrorDefault=function(e){if(e instanceof Error)if(Ember.testing){if(!Ember.Test||!Ember.Test.adapter)throw e;Ember.Test.adapter.exception(e)}else Ember.Logger.error(e.stack)},Ember.RSVP.on("error",Ember.RSVP.onerrorDefault)}(),function(){var e=Array.prototype.slice,t=Ember.expandProperties;(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.Function)&&(Function.prototype.property=function(){var e=Ember.computed(this);return e.property.apply(e,arguments)},Function.prototype.observes=function(){for(var e=function(e){r.push(e)},r=[],n=0;n<arguments.length;++n)t(arguments[n],e);return this.__ember_observes__=r,this},Function.prototype.observesImmediately=function(){for(var e=0,t=arguments.length;t>e;e++){arguments[e]}return this.observes.apply(this,arguments)},Function.prototype.observesBefore=function(){for(var e=function(e){r.push(e)},r=[],n=0;n<arguments.length;++n)t(arguments[n],e);return this.__ember_observesBefore__=r,this},Function.prototype.on=function(){var t=e.call(arguments);return this.__ember_listens__=t,this})}(),function(){Ember.Comparable=Ember.Mixin.create({compare:Ember.required(Function)})}(),function(){{var e=Ember.get;Ember.set}Ember.Copyable=Ember.Mixin.create({copy:Ember.required(Function),frozenCopy:function(){if(Ember.Freezable&&Ember.Freezable.detect(this))return e(this,"isFrozen")?this:this.copy().freeze();throw new Ember.Error(Ember.String.fmt("%@ does not support freezing",[this]))}})}(),function(){var e=Ember.get,t=Ember.set;Ember.Freezable=Ember.Mixin.create({isFrozen:!1,freeze:function(){return e(this,"isFrozen")?this:(t(this,"isFrozen",!0),this)}}),Ember.FROZEN_ERROR="Frozen object cannot be modified."}(),function(){var e=Ember.EnumerableUtils.forEach;Ember.MutableEnumerable=Ember.Mixin.create(Ember.Enumerable,{addObject:Ember.required(Function),addObjects:function(t){return Ember.beginPropertyChanges(this),e(t,function(e){this.addObject(e)},this),Ember.endPropertyChanges(this),this},removeObject:Ember.required(Function),removeObjects:function(t){return Ember.beginPropertyChanges(this),e(t,function(e){this.removeObject(e)},this),Ember.endPropertyChanges(this),this}})}(),function(){{var e="Index out of range",t=[],r=Ember.get;Ember.set}Ember.MutableArray=Ember.Mixin.create(Ember.Array,Ember.MutableEnumerable,{replace:Ember.required(),clear:function(){var e=r(this,"length");return 0===e?this:(this.replace(0,e,t),this)},insertAt:function(t,n){if(t>r(this,"length"))throw new Ember.Error(e);return this.replace(t,0,[n]),this},removeAt:function(n,i){if("number"==typeof n){if(0>n||n>=r(this,"length"))throw new Ember.Error(e);void 0===i&&(i=1),this.replace(n,i,t)}return this},pushObject:function(e){return this.insertAt(r(this,"length"),e),e},pushObjects:function(e){if(!Ember.Enumerable.detect(e)&&!Ember.isArray(e))throw new TypeError("Must pass Ember.Enumerable to Ember.MutableArray#pushObjects");return this.replace(r(this,"length"),0,e),this},popObject:function(){var e=r(this,"length");if(0===e)return null;var t=this.objectAt(e-1);return this.removeAt(e-1,1),t},shiftObject:function(){if(0===r(this,"length"))return null;var e=this.objectAt(0);return this.removeAt(0),e},unshiftObject:function(e){return this.insertAt(0,e),e},unshiftObjects:function(e){return this.replace(0,0,e),this},reverseObjects:function(){var e=r(this,"length");if(0===e)return this;var t=this.toArray().reverse();return this.replace(0,e,t),this},setObjects:function(e){if(0===e.length)return this.clear();var t=r(this,"length");return this.replace(0,t,e),this},removeObject:function(e){for(var t=r(this,"length")||0;--t>=0;){var n=this.objectAt(t);n===e&&this.removeAt(t)}return this},addObject:function(e){return this.contains(e)||this.pushObject(e),this}})}(),function(){{var e=Ember.get;Ember.set}Ember.TargetActionSupport=Ember.Mixin.create({target:null,action:null,actionContext:null,targetObject:Ember.computed(function(){var t=e(this,"target");if("string"===Ember.typeOf(t)){var r=e(this,t);return void 0===r&&(r=e(Ember.lookup,t)),r}return t}).property("target"),actionContextObject:Ember.computed(function(){var t=e(this,"actionContext");if("string"===Ember.typeOf(t)){var r=e(this,t);return void 0===r&&(r=e(Ember.lookup,t)),r}return t}).property("actionContext"),triggerAction:function(t){function r(e,t){var r=[];return t&&r.push(t),r.concat(e)}t=t||{};var n=t.action||e(this,"action"),i=t.target||e(this,"targetObject"),o=t.actionContext;if("undefined"==typeof o&&(o=e(this,"actionContextObject")||this),i&&n){var a;return a=i.send?i.send.apply(i,r(o,n)):i[n].apply(i,r(o)),a!==!1&&(a=!0),a}return!1}})}(),function(){Ember.Evented=Ember.Mixin.create({on:function(e,t,r){return Ember.addListener(this,e,t,r),this},one:function(e,t,r){return r||(r=t,t=null),Ember.addListener(this,e,t,r,!0),this},trigger:function(e){var t,r,n=[];for(t=1,r=arguments.length;r>t;t++)n.push(arguments[t]);Ember.sendEvent(this,e,n)},off:function(e,t,r){return Ember.removeListener(this,e,t,r),this},has:function(e){return Ember.hasListeners(this,e)}})}(),function(){var e=t("rsvp");if(Ember.FEATURES["ember-runtime-test-friendly-promises"]){var r=function(){Ember.Test&&Ember.Test.adapter&&Ember.Test.adapter.asyncStart()},n=function(){Ember.Test&&Ember.Test.adapter&&Ember.Test.adapter.asyncEnd()};e.configure("async",function(e,t){var i=!Ember.run.currentRunLoop;Ember.testing&&i&&r(),Ember.run.backburner.schedule("actions",function(){Ember.testing&&i&&n(),e(t)})})}else e.configure("async",function(e,t){Ember.run.backburner.schedule("actions",function(){e(t)})});e.Promise.prototype.fail=function(e,t){return this["catch"](e,t)};var i=Ember.get;Ember.DeferredMixin=Ember.Mixin.create({then:function(e,t,r){function n(t){return t===a?e(s):e(t)}var o,a,s;return s=this,o=i(this,"_deferred"),a=o.promise,a.then(e&&n,t,r)},resolve:function(e){var t,r;t=i(this,"_deferred"),r=t.promise,e===this?t.resolve(r):t.resolve(e)},reject:function(e){i(this,"_deferred").reject(e)},_deferred:Ember.computed(function(){return e.defer("Ember: DeferredMixin - "+this)})})}(),function(){var e=Ember.get,t=Ember.typeOf;Ember.ActionHandler=Ember.Mixin.create({mergedProperties:["_actions"],willMergeMixin:function(e){var r;e._actions||("object"===t(e.actions)?r="actions":"object"===t(e.events)&&(r="events"),r&&(e._actions=Ember.merge(e._actions||{},e[r])),delete e[r])},send:function(t){var r,n=[].slice.call(arguments,1);if(this._actions&&this._actions[t]){if(this._actions[t].apply(this,n)!==!0)return}else if(!Ember.FEATURES.isEnabled("ember-routing-drop-deprecated-action-style")&&this.deprecatedSend&&this.deprecatedSendHandles&&this.deprecatedSendHandles(t)&&this.deprecatedSend.apply(this,[].slice.call(arguments))!==!0)return;(r=e(this,"target"))&&r.send.apply(r,arguments)}})}(),function(){function e(e,t){return r(e,"isFulfilled",!1),r(e,"isRejected",!1),t.then(function(t){return r(e,"isFulfilled",!0),r(e,"content",t),t},function(t){throw r(e,"isRejected",!0),r(e,"reason",t),t},"Ember: PromiseProxy")}function t(e){return function(){var t=n(this,"promise");return t[e].apply(t,arguments)}}var r=Ember.set,n=Ember.get,i=Ember.computed.not,o=Ember.computed.or;Ember.PromiseProxyMixin=Ember.Mixin.create({reason:null,isPending:i("isSettled").readOnly(),isSettled:o("isRejected","isFulfilled").readOnly(),isRejected:!1,isFulfilled:!1,promise:Ember.computed(function(t,r){if(2===arguments.length)return e(this,r);throw new Ember.Error("PromiseProxy's promise must be set")}),then:t("then"),"catch":t("catch"),"finally":t("finally")})}(),function(){function e(e,t,r){this.type=e,this.count=t,this.items=r}function t(e,t,r,n){this.operation=e,this.index=t,this.split=r,this.rangeStart=n}var r=Ember.get,n=Ember.EnumerableUtils.forEach,i="r",o="i",a="d";Ember.TrackedArray=function(t){arguments.length<1&&(t=[]);var n=r(t,"length");this._operations=n?[new e(i,n,t)]:[]},Ember.TrackedArray.RETAIN=i,Ember.TrackedArray.INSERT=o,Ember.TrackedArray.DELETE=a,Ember.TrackedArray.prototype={addItems:function(t,n){var i=r(n,"length");if(!(1>i)){var a,s,u=this._findArrayOperation(t),l=u.operation,c=u.index,h=u.rangeStart;s=new e(o,i,n),l?u.split?(this._split(c,t-h,s),a=c+1):(this._operations.splice(c,0,s),a=c):(this._operations.push(s),a=c),this._composeInsert(a)}},removeItems:function(t,r){if(!(1>r)){var n,i,o=this._findArrayOperation(t),s=(o.operation,o.index),u=o.rangeStart;return n=new e(a,r),o.split?(this._split(s,t-u,n),i=s+1):(this._operations.splice(s,0,n),i=s),this._composeDelete(i)}},apply:function(t){var r=[],o=0;n(this._operations,function(e){t(e.items,o,e.type),e.type!==a&&(o+=e.count,r=r.concat(e.items))}),this._operations=[new e(i,r.length,r)]},_findArrayOperation:function(e){var r,n,i,o,s,u=!1;for(r=o=0,n=this._operations.length;n>r;++r)if(i=this._operations[r],i.type!==a){if(s=o+i.count-1,e===o)break;if(e>o&&s>=e){u=!0;break}o=s+1}return new t(i,r,u,o)},_split:function(t,r,n){var i=this._operations[t],o=i.items.slice(r),a=new e(i.type,o.length,o);i.count=r,i.items=i.items.slice(0,r),this._operations.splice(t+1,0,n,a)},_composeInsert:function(e){var t=this._operations[e],r=this._operations[e-1],n=this._operations[e+1],i=r&&r.type,a=n&&n.type;i===o?(r.count+=t.count,r.items=r.items.concat(t.items),a===o?(r.count+=n.count,r.items=r.items.concat(n.items),this._operations.splice(e,2)):this._operations.splice(e,1)):a===o&&(t.count+=n.count,t.items=t.items.concat(n.items),this._operations.splice(e+1,1))},_composeDelete:function(e){var t,r,n,i=this._operations[e],s=i.count,u=this._operations[e-1],l=u&&u.type,c=!1,h=[];l===a&&(i=u,e-=1);for(var m=e+1;s>0;++m)t=this._operations[m],r=t.type,n=t.count,r!==a?(n>s?(h=h.concat(t.items.splice(0,s)),t.count-=s,m-=1,n=s,s=0):(n===s&&(c=!0),h=h.concat(t.items),s-=n),r===o&&(i.count-=n)):i.count+=n;return i.count>0?this._operations.splice(e+1,m-1-e):this._operations.splice(e,c?2:1),h},toString:function(){var e="";return n(this._operations,function(t){e+=" "+t.type+":"+t.count}),e.substring(1)}}}(),function(){function e(e,t){this.type=e,this.count=t}var t=(Ember.get,Ember.EnumerableUtils.forEach),r="r",n="f";Ember.SubArray=function(t){arguments.length<1&&(t=0),this._operations=t>0?[new e(r,t)]:[]},Ember.SubArray.prototype={addItem:function(t,i){var o=-1,a=i?r:n,s=this;return this._findOperation(t,function(n,u,l,c,h){var m,p;a===n.type?++n.count:t===l?s._operations.splice(u,0,new e(a,1)):(m=new e(a,1),p=new e(n.type,c-t+1),n.count=t-l,s._operations.splice(u+1,0,m,p)),i&&(o=n.type===r?h+(t-l):h),s._composeAt(u)},function(t){s._operations.push(new e(a,1)),i&&(o=t),s._composeAt(s._operations.length-1)}),o},removeItem:function(e){var t=-1,n=this;return this._findOperation(e,function(i,o,a,s,u){i.type===r&&(t=u+(e-a)),i.count>1?--i.count:(n._operations.splice(o,1),n._composeAt(o))},function(){throw new Ember.Error("Can't remove an item that has never been added.")}),t},_findOperation:function(e,t,n){var i,o,a,s,u,l=0;for(i=s=0,o=this._operations.length;o>i;s=u+1,++i){if(a=this._operations[i],u=s+a.count-1,e>=s&&u>=e)return t(a,i,s,u,l),void 0;a.type===r&&(l+=a.count)}n(l)},_composeAt:function(e){var t,r=this._operations[e];r&&(e>0&&(t=this._operations[e-1],t.type===r.type&&(r.count+=t.count,this._operations.splice(e-1,1),--e)),e<this._operations.length-1&&(t=this._operations[e+1],t.type===r.type&&(r.count+=t.count,this._operations.splice(e+1,1))))},toString:function(){var e="";return t(this._operations,function(t){e+=" "+t.type+":"+t.count}),e.substring(1)}}}(),function(){Ember.Container=t("container")["default"],Ember.Container.set=Ember.set}(),function(){Ember.Application=Ember.Namespace.extend()}(),function(){{var e="Index out of range",t=[],r=Ember.get;Ember.set}Ember.ArrayProxy=Ember.Object.extend(Ember.MutableArray,{content:null,arrangedContent:Ember.computed.alias("content"),objectAtContent:function(e){return r(this,"arrangedContent").objectAt(e)},replaceContent:function(e,t,n){r(this,"content").replace(e,t,n)},_contentWillChange:Ember.beforeObserver("content",function(){this._teardownContent()}),_teardownContent:function(){var e=r(this,"content");e&&e.removeArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},contentArrayWillChange:Ember.K,contentArrayDidChange:Ember.K,_contentDidChange:Ember.observer("content",function(){r(this,"content");this._setupContent()}),_setupContent:function(){var e=r(this,"content");e&&e.addArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},_arrangedContentWillChange:Ember.beforeObserver("arrangedContent",function(){var e=r(this,"arrangedContent"),t=e?r(e,"length"):0;this.arrangedContentArrayWillChange(this,0,t,void 0),this.arrangedContentWillChange(this),this._teardownArrangedContent(e)}),_arrangedContentDidChange:Ember.observer("arrangedContent",function(){var e=r(this,"arrangedContent"),t=e?r(e,"length"):0;this._setupArrangedContent(),this.arrangedContentDidChange(this),this.arrangedContentArrayDidChange(this,0,void 0,t)}),_setupArrangedContent:function(){var e=r(this,"arrangedContent");e&&e.addArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},_teardownArrangedContent:function(){var e=r(this,"arrangedContent");e&&e.removeArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},arrangedContentWillChange:Ember.K,arrangedContentDidChange:Ember.K,objectAt:function(e){return r(this,"content")&&this.objectAtContent(e)},length:Ember.computed(function(){var e=r(this,"arrangedContent");return e?r(e,"length"):0}),_replace:function(e,t,n){var i=r(this,"content");return i&&this.replaceContent(e,t,n),this},replace:function(){if(r(this,"arrangedContent")!==r(this,"content"))throw new Ember.Error("Using replace on an arranged ArrayProxy is not allowed.");this._replace.apply(this,arguments)},_insertAt:function(t,n){if(t>r(this,"content.length"))throw new Ember.Error(e);return this._replace(t,0,[n]),this},insertAt:function(e,t){if(r(this,"arrangedContent")===r(this,"content"))return this._insertAt(e,t);throw new Ember.Error("Using insertAt on an arranged ArrayProxy is not allowed.")},removeAt:function(n,i){if("number"==typeof n){var o,a=r(this,"content"),s=r(this,"arrangedContent"),u=[];if(0>n||n>=r(this,"length"))throw new Ember.Error(e);for(void 0===i&&(i=1),o=n;n+i>o;o++)u.push(a.indexOf(s.objectAt(o)));for(u.sort(function(e,t){return t-e}),Ember.beginPropertyChanges(),o=0;o<u.length;o++)this._replace(u[o],1,t);Ember.endPropertyChanges()}return this},pushObject:function(e){return this._insertAt(r(this,"content.length"),e),e},pushObjects:function(e){if(!Ember.Enumerable.detect(e)&&!Ember.isArray(e))throw new TypeError("Must pass Ember.Enumerable to Ember.MutableArray#pushObjects");return this._replace(r(this,"length"),0,e),this},setObjects:function(e){if(0===e.length)return this.clear();var t=r(this,"length");return this._replace(0,t,e),this},unshiftObject:function(e){return this._insertAt(0,e),e},unshiftObjects:function(e){return this._replace(0,0,e),this},slice:function(){var e=this.toArray();return e.slice.apply(e,arguments)},arrangedContentArrayWillChange:function(e,t,r,n){this.arrayContentWillChange(t,r,n)},arrangedContentArrayDidChange:function(e,t,r,n){this.arrayContentDidChange(t,r,n)},init:function(){this._super(),this._setupContent(),this._setupArrangedContent()},willDestroy:function(){this._teardownArrangedContent(),this._teardownContent()}})}(),function(){function e(e,t,r,i,o){var a,s=r._objects;for(s||(s=r._objects={});--o>=i;){var u=e.objectAt(o);u&&(Ember.addBeforeObserver(u,t,r,"contentKeyWillChange"),Ember.addObserver(u,t,r,"contentKeyDidChange"),a=n(u),s[a]||(s[a]=[]),s[a].push(o))}}function t(e,t,r,i,a){var s=r._objects;s||(s=r._objects={});for(var u,l;--a>=i;){var c=e.objectAt(a);c&&(Ember.removeBeforeObserver(c,t,r,"contentKeyWillChange"),Ember.removeObserver(c,t,r,"contentKeyDidChange"),l=n(c),u=s[l],u[o.call(u,a)]=null)}}var r=(Ember.set,Ember.get),n=Ember.guidFor,i=Ember.EnumerableUtils.forEach,o=Ember.ArrayPolyfills.indexOf,a=Ember.Object.extend(Ember.Array,{init:function(e,t,r){this._super(),this._keyName=t,this._owner=r,this._content=e},objectAt:function(e){var t=this._content.objectAt(e);return t&&r(t,this._keyName)},length:Ember.computed(function(){var e=this._content;return e?r(e,"length"):0})}),s=/^.+:(before|change)$/;Ember.EachProxy=Ember.Object.extend({init:function(e){this._super(),this._content=e,e.addArrayObserver(this),i(Ember.watchedEvents(this),function(e){this.didAddListener(e)},this)},unknownProperty:function(e){var t;return t=new a(this._content,e,this),Ember.defineProperty(this,e,null,t),this.beginObservingContentKey(e),t},arrayWillChange:function(e,r,n){var i,o,a=this._keys;o=n>0?r+n:-1,Ember.beginPropertyChanges(this);for(i in a)a.hasOwnProperty(i)&&(o>0&&t(e,i,this,r,o),Ember.propertyWillChange(this,i));Ember.propertyWillChange(this._content,"@each"),Ember.endPropertyChanges(this)},arrayDidChange:function(t,r,n,i){var o,a=this._keys;o=i>0?r+i:-1,Ember.changeProperties(function(){for(var n in a)a.hasOwnProperty(n)&&(o>0&&e(t,n,this,r,o),Ember.propertyDidChange(this,n));Ember.propertyDidChange(this._content,"@each")},this)},didAddListener:function(e){s.test(e)&&this.beginObservingContentKey(e.slice(0,-7))},didRemoveListener:function(e){s.test(e)&&this.stopObservingContentKey(e.slice(0,-7))},beginObservingContentKey:function(t){var n=this._keys;if(n||(n=this._keys={}),n[t])n[t]++;else{n[t]=1;var i=this._content,o=r(i,"length");e(i,t,this,0,o)}},stopObservingContentKey:function(e){var n=this._keys;if(n&&n[e]>0&&--n[e]<=0){var i=this._content,o=r(i,"length");t(i,e,this,0,o)}},contentKeyWillChange:function(e,t){Ember.propertyWillChange(this,t)},contentKeyDidChange:function(e,t){Ember.propertyDidChange(this,t)}})}(),function(){var e=Ember.get,t=(Ember.set,Ember.EnumerableUtils._replace),r=Ember.Mixin.create(Ember.MutableArray,Ember.Observable,Ember.Copyable,{get:function(e){return"length"===e?this.length:"number"==typeof e?this[e]:this._super(e)},objectAt:function(e){return this[e]},replace:function(r,n,i){if(this.isFrozen)throw Ember.FROZEN_ERROR;var o=i?e(i,"length"):0;return this.arrayContentWillChange(r,n,o),0===o?this.splice(r,n):t(this,r,n,i),this.arrayContentDidChange(r,n,o),this},unknownProperty:function(e,t){var r;return void 0!==t&&void 0===r&&(r=this[e]=t),r},indexOf:function(e,t){var r,n=this.length;for(t=void 0===t?0:0>t?Math.ceil(t):Math.floor(t),0>t&&(t+=n),r=t;n>r;r++)if(this[r]===e)return r;return-1},lastIndexOf:function(e,t){var r,n=this.length;for(t=void 0===t?n-1:0>t?Math.ceil(t):Math.floor(t),0>t&&(t+=n),r=t;r>=0;r--)if(this[r]===e)return r;return-1},copy:function(e){return e?this.map(function(e){return Ember.copy(e,!0)}):this.slice()}}),n=["length"];Ember.EnumerableUtils.forEach(r.keys(),function(e){Array.prototype[e]&&n.push(e)}),n.length>0&&(r=r.without.apply(r,n)),Ember.NativeArray=r,Ember.A=function(e){return void 0===e&&(e=[]),Ember.Array.detect(e)?e:Ember.NativeArray.apply(e)},Ember.NativeArray.activate=function(){r.apply(Array.prototype),Ember.A=function(e){return e||[]}},(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.Array)&&Ember.NativeArray.activate()}(),function(){var e=Ember.get,t=Ember.set,r=Ember.guidFor,n=Ember.isNone,i=Ember.String.fmt;Ember.Set=Ember.CoreObject.extend(Ember.MutableEnumerable,Ember.Copyable,Ember.Freezable,{length:0,clear:function(){if(this.isFrozen)throw new Ember.Error(Ember.FROZEN_ERROR);var n=e(this,"length");if(0===n)return this;var i;this.enumerableContentWillChange(n,0),Ember.propertyWillChange(this,"firstObject"),Ember.propertyWillChange(this,"lastObject");for(var o=0;n>o;o++)i=r(this[o]),delete this[i],delete this[o];return t(this,"length",0),Ember.propertyDidChange(this,"firstObject"),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(n,0),this},isEqual:function(t){if(!Ember.Enumerable.detect(t))return!1;var r=e(this,"length");if(e(t,"length")!==r)return!1;for(;--r>=0;)if(!t.contains(this[r]))return!1;return!0},add:Ember.aliasMethod("addObject"),remove:Ember.aliasMethod("removeObject"),pop:function(){if(e(this,"isFrozen"))throw new Ember.Error(Ember.FROZEN_ERROR);var t=this.length>0?this[this.length-1]:null;return this.remove(t),t},push:Ember.aliasMethod("addObject"),shift:Ember.aliasMethod("pop"),unshift:Ember.aliasMethod("push"),addEach:Ember.aliasMethod("addObjects"),removeEach:Ember.aliasMethod("removeObjects"),init:function(e){this._super(),e&&this.addObjects(e)},nextObject:function(e){return this[e]},firstObject:Ember.computed(function(){return this.length>0?this[0]:void 0}),lastObject:Ember.computed(function(){return this.length>0?this[this.length-1]:void 0}),addObject:function(i){if(e(this,"isFrozen"))throw new Ember.Error(Ember.FROZEN_ERROR);if(n(i))return this;var o,a=r(i),s=this[a],u=e(this,"length");return s>=0&&u>s&&this[s]===i?this:(o=[i],this.enumerableContentWillChange(null,o),Ember.propertyWillChange(this,"lastObject"),u=e(this,"length"),this[a]=u,this[u]=i,t(this,"length",u+1),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(null,o),this)},removeObject:function(i){if(e(this,"isFrozen"))throw new Ember.Error(Ember.FROZEN_ERROR);if(n(i))return this;var o,a,s=r(i),u=this[s],l=e(this,"length"),c=0===u,h=u===l-1;return u>=0&&l>u&&this[u]===i&&(a=[i],this.enumerableContentWillChange(a,null),c&&Ember.propertyWillChange(this,"firstObject"),h&&Ember.propertyWillChange(this,"lastObject"),l-1>u&&(o=this[l-1],this[u]=o,this[r(o)]=u),delete this[s],delete this[l-1],t(this,"length",l-1),c&&Ember.propertyDidChange(this,"firstObject"),h&&Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(a,null)),this},contains:function(e){return this[r(e)]>=0},copy:function(){var n=this.constructor,i=new n,o=e(this,"length");for(t(i,"length",o);--o>=0;)i[o]=this[o],i[r(this[o])]=o;return i},toString:function(){var e,t=this.length,r=[];for(e=0;t>e;e++)r[e]=this[e];return i("Ember.Set<%@>",[r.join(",")])}})}(),function(){var e=Ember.DeferredMixin,t=(Ember.get,Ember.Object.extend(e));t.reopenClass({promise:function(e,r){var n=t.create();return e.call(r,n),n}}),Ember.Deferred=t}(),function(){var e=Ember.ArrayPolyfills.forEach,t=Ember.ENV.EMBER_LOAD_HOOKS||{},r={};Ember.onLoad=function(e,n){var i;t[e]=t[e]||Ember.A(),t[e].pushObject(n),(i=r[e])&&n(i)},Ember.runLoadHooks=function(n,i){if(r[n]=i,"object"==typeof window&&"function"==typeof window.dispatchEvent&&"function"==typeof CustomEvent){var o=new CustomEvent(n,{detail:i,name:n});window.dispatchEvent(o)}t[n]&&e.call(t[n],function(e){e(i)})}}(),function(){Ember.get;Ember.ControllerMixin=Ember.Mixin.create(Ember.ActionHandler,{isController:!0,target:null,container:null,parentController:null,store:null,model:Ember.computed.alias("content"),deprecatedSendHandles:function(e){return!!this[e]},deprecatedSend:function(e){var t=[].slice.call(arguments,1);this[e].apply(this,t)}}),Ember.Controller=Ember.Object.extend(Ember.ControllerMixin)}(),function(){var e=Ember.get,t=(Ember.set,Ember.EnumerableUtils.forEach);Ember.SortableMixin=Ember.Mixin.create(Ember.MutableEnumerable,{sortProperties:null,sortAscending:!0,sortFunction:Ember.compare,orderBy:function(r,n){var i=0,o=e(this,"sortProperties"),a=e(this,"sortAscending"),s=e(this,"sortFunction");return t(o,function(t){0===i&&(i=s(e(r,t),e(n,t)),0===i||a||(i=-1*i))}),i},destroy:function(){var r=e(this,"content"),n=e(this,"sortProperties");return r&&n&&t(r,function(e){t(n,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),this._super()},isSorted:Ember.computed.bool("sortProperties"),arrangedContent:Ember.computed("content","sortProperties.@each",function(){var r=e(this,"content"),n=e(this,"isSorted"),i=e(this,"sortProperties"),o=this;return r&&n?(r=r.slice(),r.sort(function(e,t){return o.orderBy(e,t)}),t(r,function(e){t(i,function(t){Ember.addObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),Ember.A(r)):r}),_contentWillChange:Ember.beforeObserver("content",function(){var r=e(this,"content"),n=e(this,"sortProperties");r&&n&&t(r,function(e){t(n,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),this._super()}),sortAscendingWillChange:Ember.beforeObserver("sortAscending",function(){this._lastSortAscending=e(this,"sortAscending")}),sortAscendingDidChange:Ember.observer("sortAscending",function(){if(e(this,"sortAscending")!==this._lastSortAscending){var t=e(this,"arrangedContent");t.reverseObjects()}}),contentArrayWillChange:function(r,n,i,o){var a=e(this,"isSorted");if(a){var s=e(this,"arrangedContent"),u=r.slice(n,n+i),l=e(this,"sortProperties");t(u,function(e){s.removeObject(e),t(l,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(r,n,i,o)},contentArrayDidChange:function(r,n,i,o){var a=e(this,"isSorted"),s=e(this,"sortProperties");if(a){var u=r.slice(n,n+o);t(u,function(e){this.insertItemSorted(e),t(s,function(t){Ember.addObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(r,n,i,o)},insertItemSorted:function(t){var r=e(this,"arrangedContent"),n=e(r,"length"),i=this._binarySearch(t,0,n);r.insertAt(i,t)},contentItemSortPropertyDidChange:function(t){var r=e(this,"arrangedContent"),n=r.indexOf(t),i=r.objectAt(n-1),o=r.objectAt(n+1),a=i&&this.orderBy(t,i),s=o&&this.orderBy(t,o);(0>a||s>0)&&(r.removeObject(t),this.insertItemSorted(t))},_binarySearch:function(t,r,n){var i,o,a,s;return r===n?r:(s=e(this,"arrangedContent"),i=r+Math.floor((n-r)/2),o=s.objectAt(i),a=this.orderBy(o,t),0>a?this._binarySearch(t,i+1,n):a>0?this._binarySearch(t,r,i):i)}})}(),function(){var e=Ember.get,t=(Ember.set,Ember.EnumerableUtils.forEach),r=Ember.EnumerableUtils.replace;Ember.ArrayController=Ember.ArrayProxy.extend(Ember.ControllerMixin,Ember.SortableMixin,{itemController:null,lookupItemController:function(){return e(this,"itemController")},objectAtContent:function(t){var r=e(this,"length"),n=e(this,"arrangedContent"),i=n&&n.objectAt(t);if(t>=0&&r>t){var o=this.lookupItemController(i);if(o)return this.controllerAt(t,i,o)}return i},arrangedContentDidChange:function(){this._super(),this._resetSubControllers()},arrayContentDidChange:function(n,i,o){var a=e(this,"_subControllers"),s=a.slice(n,n+i);t(s,function(e){e&&e.destroy()}),r(a,n,i,new Array(o)),this._super(n,i,o)},init:function(){this._super(),this.set("_subControllers",Ember.A())},content:Ember.computed(function(){return Ember.A()}),_isVirtual:!1,controllerAt:function(t,r,n){var i,o=e(this,"container"),a=e(this,"_subControllers"),s=a[t];if(s)return s;if(i="controller:"+n,!o.has(i))throw new Ember.Error('Could not resolve itemController: "'+n+'"');var u;return this._isVirtual&&(u=e(this,"parentController")),u=u||this,s=o.lookupFactory(i).create({target:this,parentController:u,content:r}),a[t]=s,s},_subControllers:null,_resetSubControllers:function(){var r=e(this,"_subControllers");r&&t(r,function(e){e&&e.destroy()}),this.set("_subControllers",Ember.A())}})}(),function(){Ember.ObjectController=Ember.ObjectProxy.extend(Ember.ControllerMixin)}(),function(){var e=Ember.imports&&Ember.imports.jQuery||this&&this.jQuery;e||"function"!=typeof r||(e=r("jquery")),Ember.$=e}(),function(){if(Ember.$){var e=Ember.String.w("dragstart drag dragenter dragleave dragover drop dragend");
14
+ Ember.EnumerableUtils.forEach(e,function(e){Ember.$.event.fixHooks[e]={props:["dataTransfer"]}})}}(),function(){function e(e){var t=e.shiftKey||e.metaKey||e.altKey||e.ctrlKey,r=e.which>1;return!t&&!r}var t="undefined"!=typeof document&&function(){var e=document.createElement("div");return e.innerHTML="<div></div>",e.firstChild.innerHTML="<script></script>",""===e.firstChild.innerHTML}(),r="undefined"!=typeof document&&function(){var e=document.createElement("div");return e.innerHTML="Test: <script type='text/x-placeholder'></script>Value","Test:"===e.childNodes[0].nodeValue&&" Value"===e.childNodes[2].nodeValue}(),n=function(e,t){if(e.getAttribute("id")===t)return e;var r,i,o,a=e.childNodes.length;for(r=0;a>r;r++)if(i=e.childNodes[r],o=1===i.nodeType&&n(i,t))return o},i=function(e,i){t&&(i="&shy;"+i);var o=[];if(r&&(i=i.replace(/(\s+)(<script id='([^']+)')/g,function(e,t,r,n){return o.push([n,t]),r})),e.innerHTML=i,o.length>0){var a,s=o.length;for(a=0;s>a;a++){var u=n(e,o[a][0]),l=document.createTextNode(o[a][1]);u.parentNode.insertBefore(l,u)}}if(t){for(var c=e.firstChild;1===c.nodeType&&!c.nodeName;)c=c.firstChild;3===c.nodeType&&"­"===c.nodeValue.charAt(0)&&(c.nodeValue=c.nodeValue.slice(1))}},o={},a=function(e){if(void 0!==o[e])return o[e];var t=!0;if("select"===e.toLowerCase()){var r=document.createElement("select");i(r,'<option value="test">Test</option>'),t=1===r.options.length}return o[e]=t,t},s=function(e,t){var r=e.tagName;if(a(r))i(e,t);else{var n=e.outerHTML||(new XMLSerializer).serializeToString(e),o=n.match(new RegExp("<"+r+"([^>]*)>","i"))[0],s="</"+r+">",u=document.createElement("div");for(i(u,o+t+s),e=u.firstChild;e.tagName!==r;)e=e.nextSibling}return e};Ember.ViewUtils={setInnerHTML:s,isSimpleClick:e}}(),function(){function e(e){return e?n.test(e)?e.replace(i,""):e:e}function t(e){var t={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},r=function(e){return t[e]||"&amp;"},n=e.toString();return a.test(n)?n.replace(o,r):n}var r=(Ember.get,Ember.set,function(){this.seen={},this.list=[]});r.prototype={add:function(e){e in this.seen||(this.seen[e]=!0,this.list.push(e))},toDOM:function(){return this.list.join(" ")}};var n=/[^a-zA-Z0-9\-]/,i=/[^a-zA-Z0-9\-]/g,o=/&(?!\w+;)|[<>"'`]/g,a=/[&<>"'`]/,s=function(){var e=document.createElement("div"),t=document.createElement("input");return t.setAttribute("name","foo"),e.appendChild(t),!!e.innerHTML.match("foo")}();Ember.RenderBuffer=function(e){return new Ember._RenderBuffer(e)},Ember._RenderBuffer=function(e){this.tagNames=[e||null],this.buffer=""},Ember._RenderBuffer.prototype={_element:null,_hasElement:!0,elementClasses:null,classes:null,elementId:null,elementAttributes:null,elementProperties:null,elementTag:null,elementStyle:null,parentBuffer:null,push:function(e){return this.buffer+=e,this},addClass:function(e){return this.elementClasses=this.elementClasses||new r,this.elementClasses.add(e),this.classes=this.elementClasses.list,this},setClasses:function(e){this.elementClasses=null;var t,r=e.length;for(t=0;r>t;t++)this.addClass(e[t])},id:function(e){return this.elementId=e,this},attr:function(e,t){var r=this.elementAttributes=this.elementAttributes||{};return 1===arguments.length?r[e]:(r[e]=t,this)},removeAttr:function(e){var t=this.elementAttributes;return t&&delete t[e],this},prop:function(e,t){var r=this.elementProperties=this.elementProperties||{};return 1===arguments.length?r[e]:(r[e]=t,this)},removeProp:function(e){var t=this.elementProperties;return t&&delete t[e],this},style:function(e,t){return this.elementStyle=this.elementStyle||{},this.elementStyle[e]=t,this},begin:function(e){return this.tagNames.push(e||null),this},pushOpeningTag:function(){var r=this.currentTagName();if(r){if(this._hasElement&&!this._element&&0===this.buffer.length)return this._element=this.generateElement(),void 0;var n,i,o=this.buffer,a=this.elementId,s=this.classes,u=this.elementAttributes,l=this.elementProperties,c=this.elementStyle;if(o+="<"+e(r),a&&(o+=' id="'+t(a)+'"',this.elementId=null),s&&(o+=' class="'+t(s.join(" "))+'"',this.classes=null,this.elementClasses=null),c){o+=' style="';for(i in c)c.hasOwnProperty(i)&&(o+=i+":"+t(c[i])+";");o+='"',this.elementStyle=null}if(u){for(n in u)u.hasOwnProperty(n)&&(o+=" "+n+'="'+t(u[n])+'"');this.elementAttributes=null}if(l){for(i in l)if(l.hasOwnProperty(i)){var h=l[i];(h||"number"==typeof h)&&(o+=h===!0?" "+i+'="'+i+'"':" "+i+'="'+t(l[i])+'"')}this.elementProperties=null}o+=">",this.buffer=o}},pushClosingTag:function(){var t=this.tagNames.pop();t&&(this.buffer+="</"+e(t)+">")},currentTagName:function(){return this.tagNames[this.tagNames.length-1]},generateElement:function(){var r,n,i,o=this.tagNames.pop(),a=this.elementId,u=this.classes,l=this.elementAttributes,c=this.elementProperties,h=this.elementStyle,m="";i=l&&l.name&&!s?"<"+e(o)+' name="'+t(l.name)+'">':o;var p=document.createElement(i),f=Ember.$(p);if(a&&(f.attr("id",a),this.elementId=null),u&&(f.attr("class",u.join(" ")),this.classes=null,this.elementClasses=null),h){for(n in h)h.hasOwnProperty(n)&&(m+=n+":"+h[n]+";");f.attr("style",m),this.elementStyle=null}if(l){for(r in l)l.hasOwnProperty(r)&&f.attr(r,l[r]);this.elementAttributes=null}if(c){for(n in c)c.hasOwnProperty(n)&&f.prop(n,c[n]);this.elementProperties=null}return p},element:function(){var e=this.innerString();return e&&(this._element=Ember.ViewUtils.setInnerHTML(this._element,e)),this._element},string:function(){if(this._hasElement&&this._element){var e=this.element(),t=e.outerHTML;return"undefined"==typeof t?Ember.$("<div/>").append(e).html():t}return this.innerString()},innerString:function(){return this.buffer}}}(),function(){{var e=Ember.get,t=Ember.set;Ember.String.fmt}Ember.EventDispatcher=Ember.Object.extend({events:{touchstart:"touchStart",touchmove:"touchMove",touchend:"touchEnd",touchcancel:"touchCancel",keydown:"keyDown",keyup:"keyUp",keypress:"keyPress",mousedown:"mouseDown",mouseup:"mouseUp",contextmenu:"contextMenu",click:"click",dblclick:"doubleClick",mousemove:"mouseMove",focusin:"focusIn",focusout:"focusOut",mouseenter:"mouseEnter",mouseleave:"mouseLeave",submit:"submit",input:"input",change:"change",dragstart:"dragStart",drag:"drag",dragenter:"dragEnter",dragleave:"dragLeave",dragover:"dragOver",drop:"drop",dragend:"dragEnd"},rootElement:"body",setup:function(r,n){var i,o=e(this,"events");Ember.$.extend(o,r||{}),Ember.isNone(n)||t(this,"rootElement",n),n=Ember.$(e(this,"rootElement")),n.addClass("ember-application");for(i in o)o.hasOwnProperty(i)&&this.setupHandler(n,i,o[i])},setupHandler:function(e,t,r){var n=this;e.on(t+".ember",".ember-view",function(e,t){var i=Ember.View.views[this.id],o=!0,a=null;return a=n._findNearestEventManager(i,r),a&&a!==t?o=n._dispatchEvent(a,e,r,i):i?o=n._bubbleEvent(i,e,r):e.stopPropagation(),o}),e.on(t+".ember","[data-ember-action]",function(e){var t=Ember.$(e.currentTarget).attr("data-ember-action"),n=Ember.Handlebars.ActionHelper.registeredActions[t];return n&&n.eventName===r?n.handler(e):void 0})},_findNearestEventManager:function(t,r){for(var n=null;t&&(n=e(t,"eventManager"),!n||!n[r]);)t=e(t,"parentView");return n},_dispatchEvent:function(e,t,r,n){var i=!0,o=e[r];return"function"===Ember.typeOf(o)?(i=Ember.run(e,o,t,n),t.stopPropagation()):i=this._bubbleEvent(n,t,r),i},_bubbleEvent:function(e,t,r){return Ember.run(e,e.handleEvent,r,t)},destroy:function(){var t=e(this,"rootElement");return Ember.$(t).off(".ember","**").removeClass("ember-application"),this._super()}})}(),function(){var e=Ember.run.queues,t=Ember.ArrayPolyfills.indexOf;e.splice(t.call(e,"actions")+1,0,"render","afterRender")}(),function(){function e(e){e.buffer=null}function t(){Ember.run.once(Ember.View,"notifyMutationListeners")}var r={},n=Ember.get,i=Ember.set,o=Ember.guidFor,a=Ember.EnumerableUtils.forEach,s=Ember.EnumerableUtils.addObject,u=Ember.meta,l=Ember.defineProperty,c=Ember.computed(function(){var e=this._childViews,t=Ember.A(),r=this;return a(e,function(e){var r;e.isVirtual?(r=n(e,"childViews"))&&t.pushObjects(r):t.push(e)}),t.replace=function(e,t,n){if(r instanceof Ember.ContainerView)return r.replace(e,t,n);throw new Ember.Error("childViews is immutable")},t});Ember.TEMPLATES={},Ember.CoreView=Ember.Object.extend(Ember.Evented,Ember.ActionHandler,{isView:!0,states:r,init:function(){this._super(),this.transitionTo("preRender"),this._isVisible=n(this,"isVisible")},parentView:Ember.computed("_parentView",function(){var e=this._parentView;return e&&e.isVirtual?n(e,"parentView"):e}),state:null,_parentView:null,concreteView:Ember.computed("parentView",function(){return this.isVirtual?n(this,"parentView"):this}),instrumentName:"core_view",instrumentDetails:function(e){e.object=this.toString()},renderToBuffer:function(e,t){var r="render."+this.instrumentName,n={};return this.instrumentDetails(n),Ember.instrument(r,n,function(){return this._renderToBuffer(e,t)},this)},_renderToBuffer:function(e){var t=this.tagName;(null===t||void 0===t)&&(t="div");var r=this.buffer=e&&e.begin(t)||Ember.RenderBuffer(t);return this.transitionTo("inBuffer",!1),this.beforeRender(r),this.render(r),this.afterRender(r),r},trigger:function(e){this._super.apply(this,arguments);var t=this[e];if(t){var r,n,i=[];for(r=1,n=arguments.length;n>r;r++)i.push(arguments[r]);return t.apply(this,i)}},deprecatedSendHandles:function(e){return!!this[e]},deprecatedSend:function(e){var t=[].slice.call(arguments,1);this[e].apply(this,t)},has:function(e){return"function"===Ember.typeOf(this[e])||this._super(e)},destroy:function(){var e=this._parentView;if(this._super())return this.removedFromDOM||this.destroyElement(),e&&e.removeChild(this),this.transitionTo("destroying",!1),this},clearRenderedChildren:Ember.K,triggerRecursively:Ember.K,invokeRecursively:Ember.K,transitionTo:Ember.K,destroyElement:Ember.K});var h=Ember._ViewCollection=function(e){var t=this.views=e||[];this.length=t.length};h.prototype={length:0,trigger:function(e){for(var t,r=this.views,n=0,i=r.length;i>n;n++)t=r[n],t.trigger&&t.trigger(e)},triggerRecursively:function(e){for(var t=this.views,r=0,n=t.length;n>r;r++)t[r].triggerRecursively(e)},invokeRecursively:function(e){for(var t,r=this.views,n=0,i=r.length;i>n;n++)t=r[n],e(t)},transitionTo:function(e,t){for(var r=this.views,n=0,i=r.length;i>n;n++)r[n].transitionTo(e,t)},push:function(){this.length+=arguments.length;var e=this.views;return e.push.apply(e,arguments)},objectAt:function(e){return this.views[e]},forEach:function(e){var t=this.views;return a(t,e)},clear:function(){this.length=0,this.views.length=0}};var m=[];Ember.View=Ember.CoreView.extend({concatenatedProperties:["classNames","classNameBindings","attributeBindings"],isView:!0,templateName:null,layoutName:null,template:Ember.computed("templateName",function(e,t){if(void 0!==t)return t;var r=n(this,"templateName"),i=this.templateForName(r,"template");return i||n(this,"defaultTemplate")}),controller:Ember.computed("_parentView",function(){var e=n(this,"_parentView");return e?n(e,"controller"):null}),layout:Ember.computed(function(){var e=n(this,"layoutName"),t=this.templateForName(e,"layout");return t||n(this,"defaultLayout")}).property("layoutName"),_yield:function(e,t){var r=n(this,"template");r&&r(e,t)},templateForName:function(e){if(e){var t=this.container||Ember.Container&&Ember.Container.defaultContainer;return t&&t.lookup("template:"+e)}},context:Ember.computed(function(e,t){return 2===arguments.length?(i(this,"_context",t),t):n(this,"_context")}).volatile(),_context:Ember.computed(function(){var e,t;return(t=n(this,"controller"))?t:(e=this._parentView,e?n(e,"_context"):null)}),_contextDidChange:Ember.observer("context",function(){this.rerender()}),isVisible:!0,childViews:c,_childViews:m,_childViewsWillChange:Ember.beforeObserver("childViews",function(){if(this.isVirtual){var e=n(this,"parentView");e&&Ember.propertyWillChange(e,"childViews")}}),_childViewsDidChange:Ember.observer("childViews",function(){if(this.isVirtual){var e=n(this,"parentView");e&&Ember.propertyDidChange(e,"childViews")}}),nearestInstanceOf:function(e){for(var t=n(this,"parentView");t;){if(t instanceof e)return t;t=n(t,"parentView")}},nearestOfType:function(e){for(var t=n(this,"parentView"),r=e instanceof Ember.Mixin?function(t){return e.detect(t)}:function(t){return e.detect(t.constructor)};t;){if(r(t))return t;t=n(t,"parentView")}},nearestWithProperty:function(e){for(var t=n(this,"parentView");t;){if(e in t)return t;t=n(t,"parentView")}},nearestChildOf:function(e){for(var t=n(this,"parentView");t;){if(n(t,"parentView")instanceof e)return t;t=n(t,"parentView")}},_parentViewDidChange:Ember.observer("_parentView",function(){this.isDestroying||(this.trigger("parentViewDidChange"),n(this,"parentView.controller")&&!n(this,"controller")&&this.notifyPropertyChange("controller"))}),_controllerDidChange:Ember.observer("controller",function(){this.isDestroying||(this.rerender(),this.forEachChildView(function(e){e.propertyDidChange("controller")}))}),cloneKeywords:function(){var e=n(this,"templateData"),t=e?Ember.copy(e.keywords):{};return i(t,"view",n(this,"concreteView")),i(t,"_view",this),i(t,"controller",n(this,"controller")),t},render:function(e){var t=n(this,"layout")||n(this,"template");if(t){var r,i=n(this,"context"),o=this.cloneKeywords(),a={view:this,buffer:e,isRenderData:!0,keywords:o,insideGroup:n(this,"templateData.insideGroup")};r=t(i,{data:a}),void 0!==r&&e.push(r)}},rerender:function(){return this.currentState.rerender(this)},clearRenderedChildren:function(){for(var e=this.lengthBeforeRender,t=this.lengthAfterRender,r=this._childViews,n=t-1;n>=e;n--)r[n]&&r[n].destroy()},_applyClassNameBindings:function(e){var t,r,n,i=this.classNames;a(e,function(e){var o,a=Ember.View._parsePropertyPath(e),u=function(){r=this._classStringForProperty(e),t=this.$(),o&&(t.removeClass(o),i.removeObject(o)),r?(t.addClass(r),o=r):o=null};n=this._classStringForProperty(e),n&&(s(i,n),o=n),this.registerObserver(this,a.path,u),this.one("willClearRender",function(){o&&(i.removeObject(o),o=null)})},this)},_unspecifiedAttributeBindings:null,_applyAttributeBindings:function(e,t){var r,i=this._unspecifiedAttributeBindings=this._unspecifiedAttributeBindings||{};a(t,function(t){var o=t.split(":"),a=o[0],s=o[1]||a;a in this?(this._setupAttributeBindingObservation(a,s),r=n(this,a),Ember.View.applyAttributeBindings(e,s,r)):i[a]=s},this),this.setUnknownProperty=this._setUnknownProperty},_setupAttributeBindingObservation:function(e,t){var r,i,o=function(){i=this.$(),r=n(this,e),Ember.View.applyAttributeBindings(i,t,r)};this.registerObserver(this,e,o)},setUnknownProperty:null,_setUnknownProperty:function(e,t){var r=this._unspecifiedAttributeBindings&&this._unspecifiedAttributeBindings[e];return r&&this._setupAttributeBindingObservation(e,r),l(this,e),i(this,e,t)},_classStringForProperty:function(e){var t=Ember.View._parsePropertyPath(e),r=t.path,i=n(this,r);return void 0===i&&Ember.isGlobalPath(r)&&(i=n(Ember.lookup,r)),Ember.View._classStringForValue(r,i,t.className,t.falsyClassName)},element:Ember.computed("_parentView",function(e,t){return void 0!==t?this.currentState.setElement(this,t):this.currentState.getElement(this)}),$:function(e){return this.currentState.$(this,e)},mutateChildViews:function(e){for(var t,r=this._childViews,n=r.length;--n>=0;)t=r[n],e(this,t,n);return this},forEachChildView:function(e){var t=this._childViews;if(!t)return this;var r,n,i=t.length;for(n=0;i>n;n++)r=t[n],e(r);return this},appendTo:function(e){return this._insertElementLater(function(){this.$().appendTo(e)}),this},replaceIn:function(e){return this._insertElementLater(function(){Ember.$(e).empty(),this.$().appendTo(e)}),this},_insertElementLater:function(e){this._scheduledInsert=Ember.run.scheduleOnce("render",this,"_insertElement",e)},_insertElement:function(e){this._scheduledInsert=null,this.currentState.insertElement(this,e)},append:function(){return this.appendTo(document.body)},remove:function(){this.removedFromDOM||this.destroyElement(),this.invokeRecursively(function(e){e.clearRenderedChildren&&e.clearRenderedChildren()})},elementId:null,findElementInParentElement:function(e){var t="#"+this.elementId;return Ember.$(t)[0]||Ember.$(t,e)[0]},createElement:function(){if(n(this,"element"))return this;var e=this.renderToBuffer();return i(this,"element",e.element()),this},willInsertElement:Ember.K,didInsertElement:Ember.K,willClearRender:Ember.K,invokeRecursively:function(e,t){for(var r,n,i,o=t===!1?this._childViews:[this];o.length;){r=o.slice(),o=[];for(var a=0,s=r.length;s>a;a++)n=r[a],i=n._childViews?n._childViews.slice(0):null,e(n),i&&o.push.apply(o,i)}},triggerRecursively:function(e){for(var t,r,n,i=[this];i.length;){t=i.slice(),i=[];for(var o=0,a=t.length;a>o;o++)r=t[o],n=r._childViews?r._childViews.slice(0):null,r.trigger&&r.trigger(e),n&&i.push.apply(i,n)}},viewHierarchyCollection:function(){for(var e,t=new h([this]),r=0;r<t.length;r++)e=t.objectAt(r),e._childViews&&t.push.apply(t,e._childViews);return t},destroyElement:function(){return this.currentState.destroyElement(this)},willDestroyElement:Ember.K,_notifyWillDestroyElement:function(){var e=this.viewHierarchyCollection();return e.trigger("willClearRender"),e.trigger("willDestroyElement"),e},_elementDidChange:Ember.observer("element",function(){this.forEachChildView(function(e){delete u(e).cache.element})}),parentViewDidChange:Ember.K,instrumentName:"view",instrumentDetails:function(e){e.template=n(this,"templateName"),this._super(e)},_renderToBuffer:function(e,t){this.lengthBeforeRender=this._childViews.length;var r=this._super(e,t);return this.lengthAfterRender=this._childViews.length,r},renderToBufferIfNeeded:function(e){return this.currentState.renderToBufferIfNeeded(this,e)},beforeRender:function(e){this.applyAttributesToBuffer(e),e.pushOpeningTag()},afterRender:function(e){e.pushClosingTag()},applyAttributesToBuffer:function(e){var t=n(this,"classNameBindings");t.length&&this._applyClassNameBindings(t);var r=n(this,"attributeBindings");r.length&&this._applyAttributeBindings(e,r),e.setClasses(this.classNames),e.id(this.elementId);var i=n(this,"ariaRole");i&&e.attr("role",i),n(this,"isVisible")===!1&&e.style("display","none")},tagName:null,ariaRole:null,classNames:["ember-view"],classNameBindings:m,attributeBindings:m,init:function(){this.elementId=this.elementId||o(this),this._super(),this._childViews=this._childViews.slice(),this.classNameBindings=Ember.A(this.classNameBindings.slice()),this.classNames=Ember.A(this.classNames.slice())},appendChild:function(e,t){return this.currentState.appendChild(this,e,t)},removeChild:function(e){if(!this.isDestroying){i(e,"_parentView",null);var t=this._childViews;return Ember.EnumerableUtils.removeObject(t,e),this.propertyDidChange("childViews"),this}},removeAllChildren:function(){return this.mutateChildViews(function(e,t){e.removeChild(t)})},destroyAllChildren:function(){return this.mutateChildViews(function(e,t){t.destroy()})},removeFromParent:function(){var e=this._parentView;return this.remove(),e&&e.removeChild(this),this},destroy:function(){var e,t,r=this._childViews,i=n(this,"parentView"),o=this.viewName;if(this._super()){for(e=r.length,t=e-1;t>=0;t--)r[t].removedFromDOM=!0;for(o&&i&&i.set(o,null),e=r.length,t=e-1;t>=0;t--)r[t].destroy();return this}},createChildView:function(e,t){if(!e)throw new TypeError("createChildViews first argument must exist");if(e.isView&&e._parentView===this&&e.container===this.container)return e;if(t=t||{},t._parentView=this,Ember.CoreView.detect(e))t.templateData=t.templateData||n(this,"templateData"),t.container=this.container,e=e.create(t),e.viewName&&i(n(this,"concreteView"),e.viewName,e);else if("string"==typeof e){var r="view:"+e,o=this.container.lookupFactory(r);t.templateData=n(this,"templateData"),e=o.create(t)}else t.container=this.container,n(e,"templateData")||(t.templateData=n(this,"templateData")),Ember.setProperties(e,t);return e},becameVisible:Ember.K,becameHidden:Ember.K,_isVisibleDidChange:Ember.observer("isVisible",function(){this._isVisible!==n(this,"isVisible")&&Ember.run.scheduleOnce("render",this,this._toggleVisibility)}),_toggleVisibility:function(){var e=this.$();if(e){var t=n(this,"isVisible");this._isVisible!==t&&(e.toggle(t),this._isVisible=t,this._isAncestorHidden()||(t?this._notifyBecameVisible():this._notifyBecameHidden()))}},_notifyBecameVisible:function(){this.trigger("becameVisible"),this.forEachChildView(function(e){var t=n(e,"isVisible");(t||null===t)&&e._notifyBecameVisible()})},_notifyBecameHidden:function(){this.trigger("becameHidden"),this.forEachChildView(function(e){var t=n(e,"isVisible");(t||null===t)&&e._notifyBecameHidden()})},_isAncestorHidden:function(){for(var e=n(this,"parentView");e;){if(n(e,"isVisible")===!1)return!0;e=n(e,"parentView")}return!1},clearBuffer:function(){this.invokeRecursively(e)},transitionTo:function(e,t){var r=this.currentState,n=this.currentState=this.states[e];this.state=e,r&&r.exit&&r.exit(this),n.enter&&n.enter(this),"inDOM"===e&&delete Ember.meta(this).cache.element,t!==!1&&this.forEachChildView(function(t){t.transitionTo(e)})},handleEvent:function(e,t){return this.currentState.handleEvent(this,e,t)},registerObserver:function(e,t,r,n){if(n||"function"!=typeof r||(n=r,r=null),e&&"object"==typeof e){var i=this,o=function(){i.currentState.invokeObserver(this,n)},a=function(){Ember.run.scheduleOnce("render",this,o)};Ember.addObserver(e,t,r,a),this.one("willClearRender",function(){Ember.removeObserver(e,t,r,a)})}}});var p={prepend:function(e,r){e.$().prepend(r),t()},after:function(e,r){e.$().after(r),t()},html:function(e,r){e.$().html(r),t()},replace:function(e){var r=n(e,"element");i(e,"element",null),e._insertElementLater(function(){Ember.$(r).replaceWith(n(e,"element")),t()})},remove:function(e){e.$().remove(),t()},empty:function(e){e.$().empty(),t()}};Ember.View.reopen({domManager:p}),Ember.View.reopenClass({_parsePropertyPath:function(e){var t,r,n=e.split(":"),i=n[0],o="";return n.length>1&&(t=n[1],3===n.length&&(r=n[2]),o=":"+t,r&&(o+=":"+r)),{path:i,classNames:o,className:""===t?void 0:t,falsyClassName:r}},_classStringForValue:function(e,t,r,n){if(r||n)return r&&t?r:n&&!t?n:null;if(t===!0){var i=e.split(".");return Ember.String.dasherize(i[i.length-1])}return t!==!1&&null!=t?t:null}});var f=Ember.Object.extend(Ember.Evented).create();Ember.View.addMutationListener=function(e){f.on("change",e)},Ember.View.removeMutationListener=function(e){f.off("change",e)},Ember.View.notifyMutationListeners=function(){f.trigger("change")},Ember.View.views={},Ember.View.childViewsProperty=c,Ember.View.applyAttributeBindings=function(e,t,r){var n=Ember.typeOf(r);"value"===t||"string"!==n&&("number"!==n||isNaN(r))?"value"===t||"boolean"===n?Ember.isNone(r)||r===!1?(e.removeAttr(t),e.prop(t,"")):r!==e.prop(t)&&e.prop(t,r):r||e.removeAttr(t):r!==e.attr(t)&&e.attr(t,r)},Ember.View.states=r}(),function(){var e=(Ember.get,Ember.set);Ember.View.states._default={appendChild:function(){throw"You can't use appendChild outside of the rendering process"},$:function(){return void 0},getElement:function(){return null},handleEvent:function(){return!0},destroyElement:function(t){return e(t,"element",null),t._scheduledInsert&&(Ember.run.cancel(t._scheduledInsert),t._scheduledInsert=null),t},renderToBufferIfNeeded:function(){return!1},rerender:Ember.K,invokeObserver:Ember.K}}(),function(){var e=Ember.View.states.preRender=Ember.create(Ember.View.states._default);Ember.merge(e,{insertElement:function(e,t){e.createElement();var r=e.viewHierarchyCollection();r.trigger("willInsertElement"),t.call(e);var n=e.get("element");document.body.contains(n)&&(r.transitionTo("inDOM",!1),r.trigger("didInsertElement"))},renderToBufferIfNeeded:function(e,t){return e.renderToBuffer(t),!0},empty:Ember.K,setElement:function(e,t){return null!==t&&e.transitionTo("hasElement"),t}})}(),function(){var e=(Ember.get,Ember.set,Ember.View.states.inBuffer=Ember.create(Ember.View.states._default));Ember.merge(e,{$:function(e){return e.rerender(),Ember.$()},rerender:function(){throw new Ember.Error("Something you did caused a view to re-render after it rendered but before it was inserted into the DOM.")},appendChild:function(e,t,r){var n=e.buffer,i=e._childViews;return t=e.createChildView(t,r),i.length||(i=e._childViews=i.slice()),i.push(t),t.renderToBuffer(n),e.propertyDidChange("childViews"),t},destroyElement:function(e){e.clearBuffer();var t=e._notifyWillDestroyElement();return t.transitionTo("preRender",!1),e},empty:function(){},renderToBufferIfNeeded:function(){return!1},insertElement:function(){throw"You can't insert an element that has already been rendered"},setElement:function(e,t){return null===t?e.transitionTo("preRender"):(e.clearBuffer(),e.transitionTo("hasElement")),t},invokeObserver:function(e,t){t.call(e)}})}(),function(){var e=Ember.get,t=Ember.set,r=Ember.View.states.hasElement=Ember.create(Ember.View.states._default);Ember.merge(r,{$:function(t,r){var n=e(t,"element");return r?Ember.$(r,n):Ember.$(n)},getElement:function(t){var r=e(t,"parentView");return r&&(r=e(r,"element")),r?t.findElementInParentElement(r):Ember.$("#"+e(t,"elementId"))[0]},setElement:function(e,t){if(null!==t)throw"You cannot set an element to a non-null value when the element is already in the DOM.";return e.transitionTo("preRender"),t},rerender:function(e){return e.triggerRecursively("willClearRender"),e.clearRenderedChildren(),e.domManager.replace(e),e},destroyElement:function(e){return e._notifyWillDestroyElement(),e.domManager.remove(e),t(e,"element",null),e._scheduledInsert&&(Ember.run.cancel(e._scheduledInsert),e._scheduledInsert=null),e},empty:function(e){var t,r,n=e._childViews;if(n)for(t=n.length,r=0;t>r;r++)n[r]._notifyWillDestroyElement();e.domManager.empty(e)},handleEvent:function(e,t,r){return e.has(t)?e.trigger(t,r):!0},invokeObserver:function(e,t){t.call(e)}})}(),function(){var e=Ember.View.states.hasElement,t=Ember.View.states.inDOM=Ember.create(e);Ember.merge(t,{enter:function(e){e.isVirtual||(Ember.View.views[e.elementId]=e),e.addBeforeObserver("elementId",function(){throw new Ember.Error("Changing a view's elementId after creation is not allowed")})},exit:function(e){this.isVirtual||delete Ember.View.views[e.elementId]},insertElement:function(){throw"You can't insert an element into the DOM that has already been inserted"}})}(),function(){var e="You can't call %@ on a view being destroyed",t=Ember.String.fmt,r=Ember.View.states.destroying=Ember.create(Ember.View.states._default);Ember.merge(r,{appendChild:function(){throw t(e,["appendChild"])},rerender:function(){throw t(e,["rerender"])},destroyElement:function(){throw t(e,["destroyElement"])},empty:function(){throw t(e,["empty"])},setElement:function(){throw t(e,["set('element', ...)"])},renderToBufferIfNeeded:function(){return!1},insertElement:Ember.K})}(),function(){Ember.View.cloneStates=function(e){var t={};t._default={},t.preRender=Ember.create(t._default),t.destroying=Ember.create(t._default),t.inBuffer=Ember.create(t._default),t.hasElement=Ember.create(t._default),t.inDOM=Ember.create(t.hasElement);for(var r in e)e.hasOwnProperty(r)&&Ember.merge(t[r],e[r]);return t}}(),function(){function e(e,t,r,n){t.triggerRecursively("willInsertElement"),r?r.domManager.after(r,n.string()):e.domManager.prepend(e,n.string()),t.forEach(function(e){e.transitionTo("inDOM"),e.propertyDidChange("element"),e.triggerRecursively("didInsertElement")})}var t=Ember.View.cloneStates(Ember.View.states),r=Ember.get,n=Ember.set,i=Ember.EnumerableUtils.forEach,o=Ember._ViewCollection;Ember.ContainerView=Ember.View.extend(Ember.MutableArray,{states:t,init:function(){this._super();var e=r(this,"childViews");Ember.defineProperty(this,"childViews",Ember.View.childViewsProperty);var t=this._childViews;i(e,function(e,i){var o;"string"==typeof e?(o=r(this,e),o=this.createChildView(o),n(this,e,o)):o=this.createChildView(e),t[i]=o},this);var o=r(this,"currentView");o&&(t.length||(t=this._childViews=this._childViews.slice()),t.push(this.createChildView(o)))},replace:function(e,t,n){var i=n?r(n,"length"):0;if(this.arrayContentWillChange(e,t,i),this.childViewsWillChange(this._childViews,e,t),0===i)this._childViews.splice(e,t);else{var o=[e,t].concat(n);n.length&&!this._childViews.length&&(this._childViews=this._childViews.slice()),this._childViews.splice.apply(this._childViews,o)}return this.arrayContentDidChange(e,t,i),this.childViewsDidChange(this._childViews,e,t,i),this},objectAt:function(e){return this._childViews[e]},length:Ember.computed(function(){return this._childViews.length}).volatile(),render:function(e){this.forEachChildView(function(t){t.renderToBuffer(e)})},instrumentName:"container",childViewsWillChange:function(e,t,r){if(this.propertyWillChange("childViews"),r>0){var n=e.slice(t,t+r);this.currentState.childViewsWillChange(this,e,t,r),this.initializeViews(n,null,null)}},removeChild:function(e){return this.removeObject(e),this},childViewsDidChange:function(e,t,n,i){if(i>0){var o=e.slice(t,t+i);this.initializeViews(o,this,r(this,"templateData")),this.currentState.childViewsDidChange(this,e,t,i)}this.propertyDidChange("childViews")},initializeViews:function(e,t,o){i(e,function(e){n(e,"_parentView",t),!e.container&&t&&n(e,"container",t.container),r(e,"templateData")||n(e,"templateData",o)})},currentView:null,_currentViewWillChange:Ember.beforeObserver("currentView",function(){var e=r(this,"currentView");e&&e.destroy()}),_currentViewDidChange:Ember.observer("currentView",function(){var e=r(this,"currentView");e&&this.pushObject(e)}),_ensureChildrenAreInDOM:function(){this.currentState.ensureChildrenAreInDOM(this)}}),Ember.merge(t._default,{childViewsWillChange:Ember.K,childViewsDidChange:Ember.K,ensureChildrenAreInDOM:Ember.K}),Ember.merge(t.inBuffer,{childViewsDidChange:function(){throw new Ember.Error("You cannot modify child views while in the inBuffer state")}}),Ember.merge(t.hasElement,{childViewsWillChange:function(e,t,r,n){for(var i=r;r+n>i;i++)t[i].remove()},childViewsDidChange:function(e){Ember.run.scheduleOnce("render",e,"_ensureChildrenAreInDOM")},ensureChildrenAreInDOM:function(t){var r,n,i,a,s,u=t._childViews,l=new o;for(r=0,n=u.length;n>r;r++)i=u[r],s||(s=Ember.RenderBuffer(),s._hasElement=!1),i.renderToBufferIfNeeded(s)?l.push(i):l.length?(e(t,l,a,s),s=null,a=i,l.clear()):a=i;l.length&&e(t,l,a,s)}})}(),function(){{var e=Ember.get,t=Ember.set;Ember.String.fmt}Ember.CollectionView=Ember.ContainerView.extend({content:null,emptyViewClass:Ember.View,emptyView:null,itemViewClass:Ember.View,init:function(){var e=this._super();return this._contentDidChange(),e},_contentWillChange:Ember.beforeObserver("content",function(){var t=this.get("content");t&&t.removeArrayObserver(this);var r=t?e(t,"length"):0;this.arrayWillChange(t,0,r)}),_contentDidChange:Ember.observer("content",function(){var t=e(this,"content");t&&(this._assertArrayLike(t),t.addArrayObserver(this));var r=t?e(t,"length"):0;this.arrayDidChange(t,0,null,r)}),_assertArrayLike:function(){},destroy:function(){if(this._super()){var t=e(this,"content");return t&&t.removeArrayObserver(this),this._createdEmptyView&&this._createdEmptyView.destroy(),this}},arrayWillChange:function(t,r,n){var i=e(this,"emptyView");i&&i instanceof Ember.View&&i.removeFromParent();var o,a,s,u=this._childViews;s=this._childViews.length;var l=n===s;for(l&&(this.currentState.empty(this),this.invokeRecursively(function(e){e.removedFromDOM=!0},!1)),a=r+n-1;a>=r;a--)o=u[a],o.destroy()},arrayDidChange:function(r,n,i,o){var a,s,u,l,c,h,m=[];if(l=r?e(r,"length"):0)for(c=e(this,"itemViewClass"),"string"==typeof c&&(c=e(c)||c),u=n;n+o>u;u++)s=r.objectAt(u),a=this.createChildView(c,{content:s,contentIndex:u}),m.push(a);else{if(h=e(this,"emptyView"),!h)return;"string"==typeof h&&(h=e(h)||h),h=this.createChildView(h),m.push(h),t(this,"emptyView",h),Ember.CoreView.detect(h)&&(this._createdEmptyView=h)}this.replace(n,0,m)},createChildView:function(r,n){r=this._super(r,n);var i=e(r,"tagName");return(null===i||void 0===i)&&(i=Ember.CollectionView.CONTAINER_MAP[e(this,"tagName")],t(r,"tagName",i)),r}}),Ember.CollectionView.CONTAINER_MAP={ul:"li",ol:"li",table:"tr",thead:"tr",tbody:"tr",tfoot:"tr",tr:"td",select:"option"}}(),function(){var e=Ember.get;Ember.ComponentTemplateDeprecation=Ember.Mixin.create({willMergeMixin:function(t){this._super.apply(this,arguments);var r,n,i=t.layoutName||t.layout||e(this,"layoutName");t.templateName&&!i&&(r="templateName",n="layoutName",t.layoutName=t.templateName,delete t.templateName),t.template&&!i&&(r="template",n="layout",t.layout=t.template,delete t.template)}})}(),function(){var e=Ember.get,t=Ember.set,r=(Ember.isNone,Array.prototype.slice);Ember.Component=Ember.View.extend(Ember.TargetActionSupport,Ember.ComponentTemplateDeprecation,{init:function(){this._super(),t(this,"context",this),t(this,"controller",this)
15
+ },defaultLayout:function(e,t){Ember.Handlebars.helpers.yield.call(e,t)},template:Ember.computed(function(t,r){if(void 0!==r)return r;var n=e(this,"templateName"),i=this.templateForName(n,"template");return i||e(this,"defaultTemplate")}).property("templateName"),templateName:null,cloneKeywords:function(){return{view:this,controller:this}},_yield:function(t,r){var n=r.data.view,i=this._parentView,o=e(this,"template");o&&n.appendChild(Ember.View,{isVirtual:!0,tagName:"",_contextView:i,template:o,context:e(i,"context"),controller:e(i,"controller"),templateData:{keywords:i.cloneKeywords()}})},targetObject:Ember.computed(function(){var t=e(this,"_parentView");return t?e(t,"controller"):null}).property("_parentView"),sendAction:function(t){var n,i=r.call(arguments,1);n=void 0===t?e(this,"action"):e(this,t),void 0!==n&&this.triggerAction({action:n,actionContext:i})}})}(),function(){Ember.ViewTargetActionSupport=Ember.Mixin.create(Ember.TargetActionSupport,{target:Ember.computed.alias("controller"),actionContext:Ember.computed.alias("context")})}(),function(){e("metamorph",[],function(){"use strict";// Copyright: ©2014 Tilde, Inc. All rights reserved.
16
+ var e=function(){},t=0,r=function(){return"undefined"!=typeof MetamorphENV?MetamorphENV.DISABLE_RANGE_API:"undefined"!==ENV?ENV.DISABLE_RANGE_API:!1}(),n=!r&&"undefined"!=typeof document&&"createRange"in document&&"undefined"!=typeof Range&&Range.prototype.createContextualFragment,i="undefined"!=typeof document&&function(){var e=document.createElement("div");return e.innerHTML="<div></div>",e.firstChild.innerHTML="<script></script>",""===e.firstChild.innerHTML}(),o=document&&function(){var e=document.createElement("div");return e.innerHTML="Test: <script type='text/x-placeholder'></script>Value","Test:"===e.childNodes[0].nodeValue&&" Value"===e.childNodes[2].nodeValue}(),a=function(r){var n;n=this instanceof a?this:new e,n.innerHTML=r;var i="metamorph-"+t++;return n.start=i+"-start",n.end=i+"-end",n};e.prototype=a.prototype;var s,u,l,c,h,m,p,f,d;if(c=function(){return this.startTag()+this.innerHTML+this.endTag()},f=function(){return"<script id='"+this.start+"' type='text/x-placeholder'></script>"},d=function(){return"<script id='"+this.end+"' type='text/x-placeholder'></script>"},n)s=function(e,t){var r=document.createRange(),n=document.getElementById(e.start),i=document.getElementById(e.end);return t?(r.setStartBefore(n),r.setEndAfter(i)):(r.setStartAfter(n),r.setEndBefore(i)),r},u=function(e,t){var r=s(this,t);r.deleteContents();var n=r.createContextualFragment(e);r.insertNode(n)},l=function(){var e=s(this,!0);e.deleteContents()},h=function(e){var t=document.createRange();t.setStart(e),t.collapse(!1);var r=t.createContextualFragment(this.outerHTML());e.appendChild(r)},m=function(e){var t=document.createRange(),r=document.getElementById(this.end);t.setStartAfter(r),t.setEndAfter(r);var n=t.createContextualFragment(e);t.insertNode(n)},p=function(e){var t=document.createRange(),r=document.getElementById(this.start);t.setStartAfter(r),t.setEndAfter(r);var n=t.createContextualFragment(e);t.insertNode(n)};else{var b={select:[1,"<select multiple='multiple'>","</select>"],fieldset:[1,"<fieldset>","</fieldset>"],table:[1,"<table>","</table>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"],colgroup:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],map:[1,"<map>","</map>"],_default:[0,"",""]},v=function(e,t){if(e.getAttribute("id")===t)return e;var r,n,i,o=e.childNodes.length;for(r=0;o>r;r++)if(n=e.childNodes[r],i=1===n.nodeType&&v(n,t))return i},E=function(e,t){var r=[];if(o&&(t=t.replace(/(\s+)(<script id='([^']+)')/g,function(e,t,n,i){return r.push([i,t]),n})),e.innerHTML=t,r.length>0){var n,i=r.length;for(n=0;i>n;n++){var a=v(e,r[n][0]),s=document.createTextNode(r[n][1]);a.parentNode.insertBefore(s,a)}}},g=function(e,t){var r=b[e.tagName.toLowerCase()]||b._default,n=r[0],o=r[1],a=r[2];i&&(t="&shy;"+t);var s=document.createElement("div");E(s,o+t+a);for(var u=0;n>=u;u++)s=s.firstChild;if(i){for(var l=s;1===l.nodeType&&!l.nodeName;)l=l.firstChild;3===l.nodeType&&"­"===l.nodeValue.charAt(0)&&(l.nodeValue=l.nodeValue.slice(1))}return s},y=function(e){for(;""===e.parentNode.tagName;)e=e.parentNode;return e},_=function(e,t){e.parentNode!==t.parentNode&&t.parentNode.insertBefore(e,t.parentNode.firstChild)};u=function(e,t){var r,n,i,o=y(document.getElementById(this.start)),a=document.getElementById(this.end),s=a.parentNode;for(_(o,a),r=o.nextSibling;r;){if(n=r.nextSibling,i=r===a){if(!t)break;a=r.nextSibling}if(r.parentNode.removeChild(r),i)break;r=n}for(r=g(o.parentNode,e),t&&o.parentNode.removeChild(o);r;)n=r.nextSibling,s.insertBefore(r,a),r=n},l=function(){var e=y(document.getElementById(this.start)),t=document.getElementById(this.end);this.html(""),e.parentNode.removeChild(e),t.parentNode.removeChild(t)},h=function(e){for(var t,r=g(e,this.outerHTML());r;)t=r.nextSibling,e.appendChild(r),r=t},m=function(e){var t,r,n=document.getElementById(this.end),i=n.nextSibling,o=n.parentNode;for(r=g(o,e);r;)t=r.nextSibling,o.insertBefore(r,i),r=t},p=function(e){var t,r,n=document.getElementById(this.start),i=n.parentNode;r=g(i,e);for(var o=n.nextSibling;r;)t=r.nextSibling,i.insertBefore(r,o),r=t}}return a.prototype.html=function(e){return this.checkRemoved(),void 0===e?this.innerHTML:(u.call(this,e),this.innerHTML=e,void 0)},a.prototype.replaceWith=function(e){this.checkRemoved(),u.call(this,e,!0)},a.prototype.remove=l,a.prototype.outerHTML=c,a.prototype.appendTo=h,a.prototype.after=m,a.prototype.prepend=p,a.prototype.startTag=f,a.prototype.endTag=d,a.prototype.isRemoved=function(){var e=document.getElementById(this.start),t=document.getElementById(this.end);return!e||!t},a.prototype.checkRemoved=function(){if(this.isRemoved())throw new Error("Cannot perform operations on a Metamorph that is not in the DOM.")},a})}(),function(){var e=Object.create||function(e){function t(){}return t.prototype=e,new t},t=Ember.imports&&Ember.imports.Handlebars||this&&this.Handlebars;t||"function"!=typeof r||(t=r("handlebars")),Ember.Handlebars=e(t),Ember.Handlebars.helper=function(e,t){Ember.View.detect(t)?Ember.Handlebars.registerHelper(e,Ember.Handlebars.makeViewHelper(t)):Ember.Handlebars.registerBoundHelper.apply(null,arguments)},Ember.Handlebars.makeViewHelper=function(e){return function(t){return Ember.Handlebars.helpers.view.call(this,e,t)}},Ember.Handlebars.helpers=e(t.helpers),Ember.Handlebars.Compiler=function(){},t.Compiler&&(Ember.Handlebars.Compiler.prototype=e(t.Compiler.prototype)),Ember.Handlebars.Compiler.prototype.compiler=Ember.Handlebars.Compiler,Ember.Handlebars.JavaScriptCompiler=function(){},t.JavaScriptCompiler&&(Ember.Handlebars.JavaScriptCompiler.prototype=e(t.JavaScriptCompiler.prototype),Ember.Handlebars.JavaScriptCompiler.prototype.compiler=Ember.Handlebars.JavaScriptCompiler),Ember.Handlebars.JavaScriptCompiler.prototype.namespace="Ember.Handlebars",Ember.Handlebars.JavaScriptCompiler.prototype.initializeBuffer=function(){return"''"},Ember.Handlebars.JavaScriptCompiler.prototype.appendToBuffer=function(e){return"data.buffer.push("+e+");"};var n=/helpers\.(.*?)\)/,i=/helpers\['(.*?)'/,o=/(.*blockHelperMissing\.call\(.*)(stack[0-9]+)(,.*)/;Ember.Handlebars.JavaScriptCompiler.stringifyLastBlockHelperMissingInvocation=function(e){var t=e[e.length-1],r=(n.exec(t)||i.exec(t))[1],a=o.exec(t);e[e.length-1]=a[1]+"'"+r+"'"+a[3]};var a=Ember.Handlebars.JavaScriptCompiler.stringifyLastBlockHelperMissingInvocation,s=Ember.Handlebars.JavaScriptCompiler.prototype.blockValue;Ember.Handlebars.JavaScriptCompiler.prototype.blockValue=function(){s.apply(this,arguments),a(this.source)};var u=Ember.Handlebars.JavaScriptCompiler.prototype.ambiguousBlockValue;Ember.Handlebars.JavaScriptCompiler.prototype.ambiguousBlockValue=function(){u.apply(this,arguments),a(this.source)},Ember.Handlebars.Compiler.prototype.mustache=function(e){if(!e.params.length&&!e.hash){var r=new t.AST.IdNode([{part:"_triageMustache"}]);e.escaped||(e.hash=e.hash||new t.AST.HashNode([]),e.hash.pairs.push(["unescaped",new t.AST.StringNode("true")])),e=new t.AST.MustacheNode([r].concat([e.id]),e.hash,!e.escaped)}return t.Compiler.prototype.mustache.call(this,e)},Ember.Handlebars.precompile=function(e){var r=t.parse(e),n={knownHelpers:{action:!0,unbound:!0,"bind-attr":!0,template:!0,view:!0,_triageMustache:!0},data:!0,stringParams:!0},i=(new Ember.Handlebars.Compiler).compile(r,n);return(new Ember.Handlebars.JavaScriptCompiler).compile(i,n,void 0,!0)},t.compile&&(Ember.Handlebars.compile=function(e){var r=t.parse(e),n={data:!0,stringParams:!0},i=(new Ember.Handlebars.Compiler).compile(r,n),o=(new Ember.Handlebars.JavaScriptCompiler).compile(i,n,void 0,!0),a=Ember.Handlebars.template(o);return a.isMethod=!1,a})}(),function(){function e(e,r,n,i){var o,a,s,u,l,c=[],h=i.hash,m=h.boundOptions,p=t.call(i.types,1);for(l in m)m.hasOwnProperty(l)&&(h[l]=Ember.Handlebars.get(e,m[l],i));for(o=0,a=n.length;a>o;++o)s=n[o],u=p[o],"ID"===u?c.push(Ember.Handlebars.get(s.root,s.path,i)):c.push(s.path);return c.push(i),r.apply(e,c)}var t=Array.prototype.slice,r=Ember.Handlebars.template,n=Ember.Handlebars.normalizePath=function(e,t,r){var n,i,o=r&&r.keywords||{};return n=t.split(".",1)[0],o.hasOwnProperty(n)&&(e=o[n],i=!0,t=t===n?"":t.substr(n.length+1)),{root:e,path:t,isKeyword:i}},i=Ember.Handlebars.get=function(e,t,r){var i,o=r&&r.data,a=n(e,t,o);return e=a.root,t=a.path,i=Ember.get(e,t),void 0===i&&e!==Ember.lookup&&Ember.isGlobalPath(t)&&(i=Ember.get(Ember.lookup,t)),i};Ember.Handlebars.getEscaped=function(e,t,r){var n=i(e,t,r);return null===n||void 0===n?n="":n instanceof Handlebars.SafeString||(n=String(n)),r.hash.unescaped||(n=Handlebars.Utils.escapeExpression(n)),n},Ember.Handlebars.resolveParams=function(e,t,r){for(var n,o,a=[],s=r.types,u=0,l=t.length;l>u;u++)n=t[u],o=s[u],"ID"===o?a.push(i(e,n,r)):a.push(n);return a},Ember.Handlebars.resolveHash=function(e,t,r){var n,o={},a=r.hashTypes;for(var s in t)t.hasOwnProperty(s)&&(n=a[s],o[s]="ID"===n?i(e,t[s],r):t[s]);return o},Ember.Handlebars.registerHelper("helperMissing",function(e){var r,n="",i=arguments[arguments.length-1],o=Ember.Handlebars.resolveHelper(i.data.view.container,e);if(o)return o.apply(this,t.call(arguments,1));throw r="%@ Handlebars error: Could not find property '%@' on object %@.",i.data&&(n=i.data.view),new Ember.Error(Ember.String.fmt(r,[n,e,this]))}),Ember.Handlebars.registerHelper("blockHelperMissing",function(e){var r=arguments[arguments.length-1],n=Ember.Handlebars.resolveHelper(r.data.view.container,e);return n?n.apply(this,t.call(arguments,1)):Handlebars.helpers.helperMissing.call(this,e)}),Ember.Handlebars.registerBoundHelper=function(e){var r=t.call(arguments,1),n=Ember.Handlebars.makeBoundHelper.apply(this,r);Ember.Handlebars.registerHelper(e,n)},Ember.Handlebars.makeBoundHelper=function(r){function i(){var i,a,s,u,l,c=t.call(arguments,0,-1),h=c.length,m=arguments[arguments.length-1],p=[],f=m.data,d=f.isUnbound?t.call(m.types,1):m.types,b=m.hash,v=f.view,E=m.contexts,g=E&&E.length?E[0]:this,y="",_=Ember._SimpleHandlebarsView.prototype.normalizedValue,w=b.boundOptions={};for(s in b)Ember.IS_BINDING.test(s)&&(w[s.slice(0,-7)]=b[s]);var C=[];for(f.properties=[],i=0;h>i;++i)if(f.properties.push(c[i]),"ID"===d[i]){var O=n(g,c[i],f);p.push(O),C.push(O)}else f.isUnbound?p.push({path:c[i]}):p.push(null);if(f.isUnbound)return e(this,r,p,m);var A=new Ember._SimpleHandlebarsView(null,null,!m.hash.unescaped,m.data);A.normalizedValue=function(){var e,t=[];for(e in w)w.hasOwnProperty(e)&&(l=n(g,w[e],f),A.path=l.path,A.pathRoot=l.root,b[e]=_.call(A));for(i=0;h>i;++i)l=p[i],l?(A.path=l.path,A.pathRoot=l.root,t.push(_.call(A))):t.push(c[i]);return t.push(m),r.apply(g,t)},v.appendChild(A);for(u in w)w.hasOwnProperty(u)&&C.push(n(g,w[u],f));for(i=0,a=C.length;a>i;++i)l=C[i],v.registerObserver(l.root,l.path,A,A.rerender);if("ID"===d[0]&&0!==p.length){var P=p[0],T=P.root,x=P.path;Ember.isEmpty(x)||(y=x+".");for(var S=0,V=o.length;V>S;S++)v.registerObserver(T,y+o[S],A,A.rerender)}}var o=t.call(arguments,1);return i._rawFunction=r,i},Ember.Handlebars.template=function(e){var t=r(e);return t.isTop=!0,t}}(),function(){Ember.String.htmlSafe=function(e){return new Handlebars.SafeString(e)};var e=Ember.String.htmlSafe;(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.String)&&(String.prototype.htmlSafe=function(){return e(this)})}(),function(){Ember.Handlebars.resolvePaths=function(e){for(var t=[],r=e.contexts,n=e.roots,i=e.data,o=0,a=r.length;a>o;o++)t.push(Ember.Handlebars.get(n[o],r[o],{data:i}));return t}}(),function(){function e(){Ember.run.once(Ember.View,"notifyMutationListeners")}var r=(Ember.set,Ember.get,t("metamorph")),n={remove:function(t){t.morph.remove(),e()},prepend:function(t,r){t.morph.prepend(r),e()},after:function(t,r){t.morph.after(r),e()},html:function(t,r){t.morph.html(r),e()},replace:function(t){var r=t.morph;t.transitionTo("preRender"),Ember.run.schedule("render",this,function(){if(!t.isDestroying){t.clearRenderedChildren();var n=t.renderToBuffer();t.invokeRecursively(function(e){e.propertyWillChange("element")}),t.triggerRecursively("willInsertElement"),r.replaceWith(n.string()),t.transitionTo("inDOM"),t.invokeRecursively(function(e){e.propertyDidChange("element")}),t.triggerRecursively("didInsertElement"),e()}})},empty:function(t){t.morph.html(""),e()}};Ember._Metamorph=Ember.Mixin.create({isVirtual:!0,tagName:"",instrumentName:"metamorph",init:function(){this._super(),this.morph=r()},beforeRender:function(e){e.push(this.morph.startTag()),e.pushOpeningTag()},afterRender:function(e){e.pushClosingTag(),e.push(this.morph.endTag())},createElement:function(){var e=this.renderToBuffer();this.outerHTML=e.string(),this.clearBuffer()},domManager:n}),Ember._MetamorphView=Ember.View.extend(Ember._Metamorph),Ember._SimpleMetamorphView=Ember.CoreView.extend(Ember._Metamorph)}(),function(){function e(e,t,r,n){this.path=e,this.pathRoot=t,this.isEscaped=r,this.templateData=n,this.morph=o(),this.state="preRender",this.updateId=null,this._parentView=null,this.buffer=null}var r=Ember.get,n=Ember.set,i=Ember.Handlebars.get,o=t("metamorph");Ember._SimpleHandlebarsView=e,e.prototype={isVirtual:!0,isView:!0,destroy:function(){this.updateId&&(Ember.run.cancel(this.updateId),this.updateId=null),this._parentView&&this._parentView.removeChild(this),this.morph=null,this.state="destroyed"},propertyWillChange:Ember.K,propertyDidChange:Ember.K,normalizedValue:function(){var e,t,r=this.path,n=this.pathRoot;return""===r?e=n:(t=this.templateData,e=i(n,r,{data:t})),e},renderToBuffer:function(e){var t="";t+=this.morph.startTag(),t+=this.render(),t+=this.morph.endTag(),e.push(t)},render:function(){var e=this.isEscaped,t=this.normalizedValue();return null===t||void 0===t?t="":t instanceof Handlebars.SafeString||(t=String(t)),e&&(t=Handlebars.Utils.escapeExpression(t)),t},rerender:function(){switch(this.state){case"preRender":case"destroyed":break;case"inBuffer":throw new Ember.Error("Something you did tried to replace an {{expression}} before it was inserted into the DOM.");case"hasElement":case"inDOM":this.updateId=Ember.run.scheduleOnce("render",this,"update")}return this},update:function(){this.updateId=null,this.morph.html(this.render())},transitionTo:function(e){this.state=e}};var a=Ember.View.cloneStates(Ember.View.states),s=Ember.merge;s(a._default,{rerenderIfNeeded:Ember.K}),s(a.inDOM,{rerenderIfNeeded:function(e){e.normalizedValue()!==e._lastNormalizedValue&&e.rerender()}}),Ember._HandlebarsBoundView=Ember._MetamorphView.extend({instrumentName:"boundHandlebars",states:a,shouldDisplayFunc:null,preserveContext:!1,previousContext:null,displayTemplate:null,inverseTemplate:null,path:null,pathRoot:null,normalizedValue:function(){var e,t,n=r(this,"path"),o=r(this,"pathRoot"),a=r(this,"valueNormalizerFunc");return""===n?e=o:(t=r(this,"templateData"),e=i(o,n,{data:t})),a?a(e):e},rerenderIfNeeded:function(){this.currentState.rerenderIfNeeded(this)},render:function(e){var t=r(this,"isEscaped"),i=r(this,"shouldDisplayFunc"),o=r(this,"preserveContext"),a=r(this,"previousContext"),s=r(this,"_contextController"),u=r(this,"inverseTemplate"),l=r(this,"displayTemplate"),c=this.normalizedValue();if(this._lastNormalizedValue=c,i(c))if(n(this,"template",l),o)n(this,"_context",a);else{if(!l)return null===c||void 0===c?c="":c instanceof Handlebars.SafeString||(c=String(c)),t&&(c=Handlebars.Utils.escapeExpression(c)),e.push(c),void 0;s&&(n(s,"content",c),c=s),n(this,"_context",c)}else u?(n(this,"template",u),o?n(this,"_context",a):n(this,"_context",c)):n(this,"template",function(){return""});return this._super(e)}})}(),function(){function e(e){return!Ember.isNone(e)}function t(e,t,r,n,i,u){var l,c,h,m=t.data,p=t.fn,f=t.inverse,d=m.view,b=this;if(l=a(b,e,m),"object"==typeof this){if(m.insideGroup){c=function(){Ember.run.once(d,"rerender")};var v,E,g=o(b,e,t);g=i?i(g):g,E=r?b:g,n(g)?v=p:f&&(v=f),v(E,{data:t.data})}else{var y=d.createChildView(Ember._HandlebarsBoundView,{preserveContext:r,shouldDisplayFunc:n,valueNormalizerFunc:i,displayTemplate:p,inverseTemplate:f,path:e,pathRoot:b,previousContext:b,isEscaped:!t.hash.unescaped,templateData:t.data});t.hash.controller&&y.set("_contextController",this.container.lookupFactory("controller:"+t.hash.controller).create({container:b.container,parentController:b,target:b})),d.appendChild(y),c=function(){Ember.run.scheduleOnce("render",y,"rerenderIfNeeded")}}if(""!==l.path&&(d.registerObserver(l.root,l.path,c),u))for(h=0;h<u.length;h++)d.registerObserver(l.root,l.path+"."+u[h],c)}else m.buffer.push(s(b,e,t))}function r(e,t,r){var n,i,o,u,l=r.data,c=l.view;if(n=a(e,t,l),o=n.root,o&&"object"==typeof o){if(l.insideGroup)i=function(){Ember.run.once(c,"rerender")},u=s(e,t,r),l.buffer.push(u);else{var h=new Ember._SimpleHandlebarsView(t,e,!r.hash.unescaped,r.data);h._parentView=c,c.appendChild(h),i=function(){Ember.run.scheduleOnce("render",h,"rerender")}}""!==n.path&&c.registerObserver(n.root,n.path,i)}else u=s(e,t,r),l.buffer.push(u)}function n(e){var t=e&&i(e,"isTruthy");return"boolean"==typeof t?t:Ember.isArray(e)?0!==i(e,"length"):!!e}var i=Ember.get,o=(Ember.set,Ember.String.fmt,Ember.Handlebars.get),a=Ember.Handlebars.normalizePath,s=Ember.Handlebars.getEscaped,u=Ember.ArrayPolyfills.forEach,l=Ember.create,c=Ember.Handlebars,h=c.helpers;c.bind=t,c.registerHelper("_triageMustache",function(e,t){if(h[e])return h[e].call(this,t);var r=Ember.Handlebars.resolveHelper(t.data.view.container,e);return r?r.call(this,t):h.bind.call(this,e,t)}),Ember.Handlebars.resolveHelper=function(e,t){if(e&&-1!==t.indexOf("-")){var r=e.lookup("helper:"+t);if(!r){var n=e.lookup("component-lookup:main"),i=n.lookupFactory(t,e);i&&(r=c.makeViewHelper(i),e.register("helper:"+t,r))}return r}},c.registerHelper("bind",function(n,i){var o=i.contexts&&i.contexts.length?i.contexts[0]:this;return i.fn?t.call(o,n,i,!1,e):r(o,n,i)}),c.registerHelper("boundIf",function(e,r){var i=r.contexts&&r.contexts.length?r.contexts[0]:this;return t.call(i,e,r,!0,n,n,["isTruthy","length"])}),c.registerHelper("unboundIf",function(e,t){var r,i,s=t.contexts&&t.contexts.length?t.contexts[0]:this,u=t.data,l=t.fn,c=t.inverse;r=a(s,e,u),i=o(s,e,t),n(i)||(l=c),l(s,{data:u})}),c.registerHelper("with",function(r,n){if(4===arguments.length){var i,o,s,u,c;n=arguments[3],i=arguments[2],o=arguments[0];var m=l(n);if(m.data=l(n.data),m.data.keywords=l(n.data.keywords||{}),Ember.isGlobalPath(o))c=o;else{u=a(this,o,n.data),o=u.path,s=u.root;var p=Ember.$.expando+Ember.guidFor(s);m.data.keywords[p]=s,c=o?p+"."+o:p}return Ember.bind(m.data.keywords,i,c),t.call(this,o,m,!0,e)}return h.bind.call(n.contexts[0],r,n)}),c.registerHelper("if",function(e,t){return t.data.isUnbound?h.unboundIf.call(t.contexts[0],e,t):h.boundIf.call(t.contexts[0],e,t)}),c.registerHelper("unless",function(e,t){var r=t.fn,n=t.inverse;return t.fn=n,t.inverse=r,t.data.isUnbound?h.unboundIf.call(t.contexts[0],e,t):h.boundIf.call(t.contexts[0],e,t)}),c.registerHelper("bind-attr",function(e){var t=e.hash,r=e.data.view,n=[],i=this,s=++Ember.uuid,l=t["class"];if(null!=l){var h=c.bindClasses(this,l,r,s,e);n.push('class="'+Handlebars.Utils.escapeExpression(h.join(" "))+'"'),delete t["class"]}var m=Ember.keys(t);return u.call(m,function(u){var l,c=t[u];l=a(i,c,e.data);var h,m,p="this"===c?l.root:o(i,c,e),f=Ember.typeOf(p);h=function(){var t=o(i,c,e),n=r.$("[data-bindattr-"+s+"='"+s+"']");return n&&0!==n.length?(Ember.View.applyAttributeBindings(n,u,t),void 0):(Ember.removeObserver(l.root,l.path,m),void 0)},"this"===c||l.isKeyword&&""===l.path||r.registerObserver(l.root,l.path,h),"string"===f||"number"===f&&!isNaN(p)?n.push(u+'="'+Handlebars.Utils.escapeExpression(p)+'"'):p&&"boolean"===f&&n.push(u+'="'+u+'"')},this),n.push("data-bindattr-"+s+'="'+s+'"'),new c.SafeString(n.join(" "))}),c.registerHelper("bindAttr",function(){return c.helpers["bind-attr"].apply(this,arguments)}),c.bindClasses=function(e,t,r,n,i){var s,l,c,h=[],m=function(e,t,r){var n,i=t.path;return n="this"===i?e:""===i?!0:o(e,i,r),Ember.View._classStringForValue(i,n,t.className,t.falsyClassName)};return u.call(t.split(" "),function(t){var o,u,p,f,d=Ember.View._parsePropertyPath(t),b=d.path,v=e;""!==b&&"this"!==b&&(f=a(e,b,i.data),v=f.root,b=f.path),u=function(){s=m(e,d,i),c=n?r.$("[data-bindattr-"+n+"='"+n+"']"):r.$(),c&&0!==c.length?(o&&c.removeClass(o),s?(c.addClass(s),o=s):o=null):Ember.removeObserver(v,b,p)},""!==b&&"this"!==b&&r.registerObserver(v,b,u),l=m(e,d,i),l&&(h.push(l),o=l)}),h}}(),function(){function e(e,r){var n=r.hash,i=r.hashTypes;for(var o in n)if("ID"===i[o]){var a=n[o];Ember.IS_BINDING.test(o)||(n[o+"Binding"]=a,i[o+"Binding"]="STRING",delete n[o],delete i[o])}n.hasOwnProperty("idBinding")&&(n.id=t.get(e,n.idBinding,r),i.id="STRING",delete n.idBinding,delete i.idBinding)}var t=(Ember.get,Ember.set,Ember.Handlebars),r=/^[a-z]/,n=/^view\./;t.ViewHelper=Ember.Object.create({propertiesFromHTMLOptions:function(e){var t=e.hash,r=e.data,n={},i=t["class"],o=!1;t.id&&(n.elementId=t.id,o=!0),t.tag&&(n.tagName=t.tag,o=!0),i&&(i=i.split(" "),n.classNames=i,o=!0),t.classBinding&&(n.classNameBindings=t.classBinding.split(" "),o=!0),t.classNameBindings&&(void 0===n.classNameBindings&&(n.classNameBindings=[]),n.classNameBindings=n.classNameBindings.concat(t.classNameBindings.split(" ")),o=!0),t.attributeBindings&&(n.attributeBindings=null,o=!0),o&&(t=Ember.$.extend({},t),delete t.id,delete t.tag,delete t["class"],delete t.classBinding);var a;for(var s in t)t.hasOwnProperty(s)&&Ember.IS_BINDING.test(s)&&"string"==typeof t[s]&&(a=this.contextualizeBindingPath(t[s],r),a&&(t[s]=a));if(n.classNameBindings)for(var u in n.classNameBindings){var l=n.classNameBindings[u];if("string"==typeof l){var c=Ember.View._parsePropertyPath(l);a=this.contextualizeBindingPath(c.path,r),a&&(n.classNameBindings[u]=a+c.classNames)}}return Ember.$.extend(t,n)},contextualizeBindingPath:function(e,t){var r=Ember.Handlebars.normalizePath(null,e,t);return r.isKeyword?"templateData.keywords."+e:Ember.isGlobalPath(e)?null:"this"===e||""===e?"_parentView.context":"_parentView.context."+e},helper:function(i,o,a){var s,u=a.data,l=a.fn;e(i,a),s="string"==typeof o?"STRING"===a.types[0]&&r.test(o)&&!n.test(o)?u.view.container.lookupFactory("view:"+o):t.get(i,o,a):o;var c=this.propertiesFromHTMLOptions(a,i),h=u.view;c.templateData=u;var m=s.proto?s.proto():s;l&&(c.template=l),m.controller||m.controllerBinding||c.controller||c.controllerBinding||(c._context=i),h.appendChild(s,c)}}),t.registerHelper("view",function(e,r){return e&&e.data&&e.data.isRenderData&&(r=e,e="Ember.View"),t.ViewHelper.helper(this,e,r)})}(),function(){{var e=Ember.get,t=Ember.Handlebars.get;Ember.String.fmt}Ember.Handlebars.registerHelper("collection",function(r,n){r&&r.data&&r.data.isRenderData&&(n=r,r=void 0);{var i,o,a,s=n.fn,u=n.data,l=n.inverse;n.data.view}r?(i=u.keywords.controller,o=i&&i.container,a=t(this,r,n)||o.lookupFactory("view:"+r)):a=Ember.CollectionView;var c,h,m=n.hash,p={},f=a.proto();m.itemView?(i=u.keywords.controller,o=i.container,h=o.lookupFactory("view:"+m.itemView)):h=m.itemViewClass?t(f,m.itemViewClass,n):f.itemViewClass,delete m.itemViewClass,delete m.itemView;for(var d in m)m.hasOwnProperty(d)&&(c=d.match(/^item(.)(.*)$/),c&&"itemController"!==d&&(p[c[1].toLowerCase()+c[2]]=m[d],delete m[d]));s&&(p.template=s,delete n.fn);var b;l&&l!==Ember.Handlebars.VM.noop?(b=e(f,"emptyViewClass"),b=b.extend({template:l,tagName:p.tagName})):m.emptyViewClass&&(b=t(this,m.emptyViewClass,n)),b&&(m.emptyView=b),m.keyword||(p._context=Ember.computed.alias("content"));var v=Ember.Handlebars.ViewHelper.propertiesFromHTMLOptions({data:u,hash:p},this);return m.itemViewClass=h.extend(v),Ember.Handlebars.helpers.view.call(this,a,n)})}(),function(){var e=Ember.Handlebars.get;Ember.Handlebars.registerHelper("unbound",function(t,r){var n,i,o,a=arguments[arguments.length-1];return arguments.length>2?(a.data.isUnbound=!0,n=Ember.Handlebars.helpers[arguments[0]]||Ember.Handlebars.helpers.helperMissing,o=n.apply(this,Array.prototype.slice.call(arguments,1)),delete a.data.isUnbound,o):(i=r.contexts&&r.contexts.length?r.contexts[0]:this,e(i,t,r))})}(),function(){var e=(Ember.get,Ember.Handlebars.get),t=Ember.Handlebars.normalizePath,r=[].slice;Ember.Handlebars.registerHelper("log",function(){var n=r.call(arguments,0,-1),i=arguments[arguments.length-1],o=Ember.Logger.log,a=[],s=!1;s=!0;for(var u=0;u<n.length;u++){var l=i.types[u];if("ID"!==l&&s)a.push(n[u]);else{var c=i.contexts&&i.contexts[u]||this,h=t(c,n[u],i.data);"this"===h.path?a.push(h.root):a.push(e(h.root,h.path,i))}}o.apply(o,a)}),Ember.Handlebars.registerHelper("debugger",function(){{var e=this;Ember.inspect(e)}})}(),function(){{var e=Ember.get,t=Ember.set;Ember.String.fmt}Ember.Handlebars.EachView=Ember.CollectionView.extend(Ember._Metamorph,{init:function(){var r,n=e(this,"itemController");if(n){var i=e(this,"controller.container").lookupFactory("controller:array").create({_isVirtual:!0,parentController:e(this,"controller"),itemController:n,target:e(this,"controller"),_eachView:this});this.disableContentObservers(function(){t(this,"content",i),r=new Ember.Binding("content","_eachView.dataSource").oneWay(),r.connect(i)}),t(this,"_arrayController",i)}else this.disableContentObservers(function(){r=new Ember.Binding("content","dataSource").oneWay(),r.connect(this)});return this._super()},_assertArrayLike:function(){},disableContentObservers:function(e){Ember.removeBeforeObserver(this,"content",null,"_contentWillChange"),Ember.removeObserver(this,"content",null,"_contentDidChange"),e.call(this),Ember.addBeforeObserver(this,"content",null,"_contentWillChange"),Ember.addObserver(this,"content",null,"_contentDidChange")},itemViewClass:Ember._MetamorphView,emptyViewClass:Ember._MetamorphView,createChildView:function(r,n){r=this._super(r,n);var i=e(this,"keyword"),o=e(r,"content");if(i){var a=e(r,"templateData");a=Ember.copy(a),a.keywords=r.cloneKeywords(),t(r,"templateData",a),a.keywords[i]=o}return o&&o.isController&&t(r,"controller",o),r},destroy:function(){if(this._super()){var t=e(this,"_arrayController");return t&&t.destroy(),this}}});var r=Ember.Handlebars.GroupedEach=function(e,t,r){var n=this,i=Ember.Handlebars.normalizePath(e,t,r.data);this.context=e,this.path=t,this.options=r,this.template=r.fn,this.containingView=r.data.view,this.normalizedRoot=i.root,this.normalizedPath=i.path,this.content=this.lookupContent(),this.addContentObservers(),this.addArrayObservers(),this.containingView.on("willClearRender",function(){n.destroy()})};r.prototype={contentWillChange:function(){this.removeArrayObservers()},contentDidChange:function(){this.content=this.lookupContent(),this.addArrayObservers(),this.rerenderContainingView()},contentArrayWillChange:Ember.K,contentArrayDidChange:function(){this.rerenderContainingView()},lookupContent:function(){return Ember.Handlebars.get(this.normalizedRoot,this.normalizedPath,this.options)},addArrayObservers:function(){this.content&&this.content.addArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},removeArrayObservers:function(){this.content&&this.content.removeArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},addContentObservers:function(){Ember.addBeforeObserver(this.normalizedRoot,this.normalizedPath,this,this.contentWillChange),Ember.addObserver(this.normalizedRoot,this.normalizedPath,this,this.contentDidChange)},removeContentObservers:function(){Ember.removeBeforeObserver(this.normalizedRoot,this.normalizedPath,this.contentWillChange),Ember.removeObserver(this.normalizedRoot,this.normalizedPath,this.contentDidChange)},render:function(){if(this.content){var t=this.content,r=e(t,"length"),n=this.options.data,i=this.template;n.insideEach=!0;for(var o=0;r>o;o++)i(t.objectAt(o),{data:n})}},rerenderContainingView:function(){var e=this;Ember.run.scheduleOnce("render",this,function(){e.destroyed||e.containingView.rerender()})},destroy:function(){this.removeContentObservers(),this.content&&this.removeArrayObservers(),this.destroyed=!0}},Ember.Handlebars.registerHelper("each",function(e,t){if(4===arguments.length){var r=arguments[0];t=arguments[3],e=arguments[2],""===e&&(e="this"),t.hash.keyword=r}return 1===arguments.length&&(t=e,e="this"),t.hash.dataSourceBinding=e,!t.data.insideGroup||t.hash.groupedRows||t.hash.itemViewClass?Ember.Handlebars.helpers.collection.call(this,"Ember.Handlebars.EachView",t):(new Ember.Handlebars.GroupedEach(this,e,t).render(),void 0)})}(),function(){Ember.Handlebars.registerHelper("template",function(){return Ember.Handlebars.helpers.partial.apply(this,arguments)})}(),function(){function e(e){return!Ember.isNone(e)}function t(e,t,r){var n=t.split("/"),i=n[n.length-1];n[n.length-1]="_"+i;var o=r.data.view,a=n.join("/"),s=o.templateForName(a),u=!s&&o.templateForName(t);(s=s||u)(e,{data:r.data})}Ember.Handlebars.registerHelper("partial",function(r,n){var i=n.contexts&&n.contexts.length?n.contexts[0]:this;return"ID"===n.types[0]?(n.fn=function(e,n){var i=Ember.Handlebars.get(e,r,n);t(e,i,n)},Ember.Handlebars.bind.call(i,r,n,!0,e)):(t(i,r,n),void 0)})}(),function(){{var e=Ember.get;Ember.set}Ember.Handlebars.registerHelper("yield",function(t){for(var r=t.data.view;r&&!e(r,"layout");)r=r._contextView?r._contextView:e(r,"parentView");r._yield(this,t)})}(),function(){Ember.Handlebars.registerHelper("loc",function(e){return Ember.String.loc(e)})}(),function(){{var e=Ember.set;Ember.get}Ember.Checkbox=Ember.View.extend({classNames:["ember-checkbox"],tagName:"input",attributeBindings:["type","checked","indeterminate","disabled","tabindex","name","autofocus","form"],type:"checkbox",checked:!1,disabled:!1,indeterminate:!1,init:function(){this._super(),this.on("change",this,this._updateElementValue)},didInsertElement:function(){this._super(),this.get("element").indeterminate=!!this.get("indeterminate")},_updateElementValue:function(){e(this,"checked",this.$().prop("checked"))}})}(),function(){function e(e,r,n){var i=t(r,e),o=t(r,"onEvent"),a=t(r,"value");(o===e||"keyPress"===o&&"key-press"===e)&&r.sendAction("action",a),r.sendAction(e,a),(i||o===e)&&(t(r,"bubbles")||n.stopPropagation())}var t=Ember.get,r=Ember.set;Ember.TextSupport=Ember.Mixin.create(Ember.TargetActionSupport,{value:"",attributeBindings:["placeholder","disabled","maxlength","tabindex","readonly","autofocus","form","selectionDirection","spellcheck","required"],placeholder:null,disabled:!1,maxlength:null,init:function(){this._super(),this.on("focusOut",this,this._elementValueDidChange),this.on("change",this,this._elementValueDidChange),this.on("paste",this,this._elementValueDidChange),this.on("cut",this,this._elementValueDidChange),this.on("input",this,this._elementValueDidChange),this.on("keyUp",this,this.interpretKeyEvents)},action:null,onEvent:"enter",bubbles:!1,interpretKeyEvents:function(e){var t=Ember.TextSupport.KEY_EVENTS,r=t[e.keyCode];return this._elementValueDidChange(),r?this[r](e):void 0},_elementValueDidChange:function(){r(this,"value",this.$().val())},insertNewline:function(t){e("enter",this,t),e("insert-newline",this,t)},cancel:function(t){e("escape-press",this,t)},focusIn:function(t){e("focus-in",this,t)},focusOut:function(t){e("focus-out",this,t)},keyPress:function(t){e("key-press",this,t)}}),Ember.TextSupport.KEY_EVENTS={13:"insertNewline",27:"cancel"}}(),function(){Ember.get,Ember.set;Ember.TextField=Ember.Component.extend(Ember.TextSupport,{classNames:["ember-text-field"],tagName:"input",attributeBindings:["type","value","size","pattern","name","min","max","accept","autocomplete","autosave","formaction","formenctype","formmethod","formnovalidate","formtarget","height","inputmode","list","multiple","pattern","step","width"],value:"",type:"text",size:null,pattern:null,min:null,max:null})}(),function(){{var e=Ember.get;Ember.set}Ember.TextArea=Ember.Component.extend(Ember.TextSupport,{classNames:["ember-text-area"],tagName:"textarea",attributeBindings:["rows","cols","name","selectionEnd","selectionStart","wrap"],rows:null,cols:null,_updateElementValue:Ember.observer("value",function(){var t=e(this,"value"),r=this.$();r&&t!==r.val()&&r.val(t)}),init:function(){this._super(),this.on("didInsertElement",this,this._updateElementValue)}})}(),function(){{var e=Ember.set,t=Ember.get,r=Ember.EnumerableUtils.indexOf,n=Ember.EnumerableUtils.indexesOf,i=Ember.EnumerableUtils.forEach,o=Ember.EnumerableUtils.replace,a=Ember.isArray;Ember.Handlebars.compile}Ember.SelectOption=Ember.View.extend({tagName:"option",attributeBindings:["value","selected"],defaultTemplate:function(e,t){t={data:t.data,hash:{}},Ember.Handlebars.helpers.bind.call(e,"view.label",t)},init:function(){this.labelPathDidChange(),this.valuePathDidChange(),this._super()},selected:Ember.computed(function(){var e=t(this,"content"),n=t(this,"parentView.selection");return t(this,"parentView.multiple")?n&&r(n,e.valueOf())>-1:e==n
17
+ }).property("content","parentView.selection"),labelPathDidChange:Ember.observer("parentView.optionLabelPath",function(){var e=t(this,"parentView.optionLabelPath");e&&Ember.defineProperty(this,"label",Ember.computed(function(){return t(this,e)}).property(e))}),valuePathDidChange:Ember.observer("parentView.optionValuePath",function(){var e=t(this,"parentView.optionValuePath");e&&Ember.defineProperty(this,"value",Ember.computed(function(){return t(this,e)}).property(e))})}),Ember.SelectOptgroup=Ember.CollectionView.extend({tagName:"optgroup",attributeBindings:["label"],selectionBinding:"parentView.selection",multipleBinding:"parentView.multiple",optionLabelPathBinding:"parentView.optionLabelPath",optionValuePathBinding:"parentView.optionValuePath",itemViewClassBinding:"parentView.optionView"}),Ember.Select=Ember.View.extend({tagName:"select",classNames:["ember-select"],defaultTemplate:Ember.Handlebars.template(function(e,t,r,n,i){function o(e,t){var n,i="";return t.buffer.push('<option value="">'),n=r._triageMustache.call(e,"view.prompt",{hash:{},hashTypes:{},hashContexts:{},contexts:[e],types:["ID"],data:t}),(n||0===n)&&t.buffer.push(n),t.buffer.push("</option>"),i}function a(e,t){var n;n=r.each.call(e,"view.groupedContent",{hash:{},hashTypes:{},hashContexts:{},inverse:p.noop,fn:p.program(4,s,t),contexts:[e],types:["ID"],data:t}),n||0===n?t.buffer.push(n):t.buffer.push("")}function s(e,t){t.buffer.push(m(r.view.call(e,"view.groupView",{hash:{content:"content",label:"label"},hashTypes:{content:"ID",label:"ID"},hashContexts:{content:e,label:e},contexts:[e],types:["ID"],data:t})))}function u(e,t){var n;n=r.each.call(e,"view.content",{hash:{},hashTypes:{},hashContexts:{},inverse:p.noop,fn:p.program(7,l,t),contexts:[e],types:["ID"],data:t}),n||0===n?t.buffer.push(n):t.buffer.push("")}function l(e,t){t.buffer.push(m(r.view.call(e,"view.optionView",{hash:{content:""},hashTypes:{content:"ID"},hashContexts:{content:e},contexts:[e],types:["ID"],data:t})))}this.compilerInfo=[4,">= 1.0.0"],r=this.merge(r,Ember.Handlebars.helpers),i=i||{};var c,h="",m=this.escapeExpression,p=this;return c=r["if"].call(t,"view.prompt",{hash:{},hashTypes:{},hashContexts:{},inverse:p.noop,fn:p.program(1,o,i),contexts:[t],types:["ID"],data:i}),(c||0===c)&&i.buffer.push(c),c=r["if"].call(t,"view.optionGroupPath",{hash:{},hashTypes:{},hashContexts:{},inverse:p.program(6,u,i),fn:p.program(3,a,i),contexts:[t],types:["ID"],data:i}),(c||0===c)&&i.buffer.push(c),h}),attributeBindings:["multiple","disabled","tabindex","name","required","autofocus","form","size"],multiple:!1,disabled:!1,required:!1,content:null,selection:null,value:Ember.computed(function(e,r){if(2===arguments.length)return r;var n=t(this,"optionValuePath").replace(/^content\.?/,"");return n?t(this,"selection."+n):t(this,"selection")}).property("selection"),prompt:null,optionLabelPath:"content",optionValuePath:"content",optionGroupPath:null,groupView:Ember.SelectOptgroup,groupedContent:Ember.computed(function(){var e=t(this,"optionGroupPath"),r=Ember.A(),n=t(this,"content")||[];return i(n,function(n){var i=t(n,e);t(r,"lastObject.label")!==i&&r.pushObject({label:i,content:Ember.A()}),t(r,"lastObject.content").push(n)}),r}).property("optionGroupPath","content.@each"),optionView:Ember.SelectOption,_change:function(){t(this,"multiple")?this._changeMultiple():this._changeSingle()},selectionDidChange:Ember.observer("selection.@each",function(){var r=t(this,"selection");if(t(this,"multiple")){if(!a(r))return e(this,"selection",Ember.A([r])),void 0;this._selectionDidChangeMultiple()}else this._selectionDidChangeSingle()}),valueDidChange:Ember.observer("value",function(){var e,r=t(this,"content"),n=t(this,"value"),i=t(this,"optionValuePath").replace(/^content\.?/,""),o=i?t(this,"selection."+i):t(this,"selection");n!==o&&(e=r?r.find(function(e){return n===(i?t(e,i):e)}):null,this.set("selection",e))}),_triggerChange:function(){var e=t(this,"selection"),r=t(this,"value");Ember.isNone(e)||this.selectionDidChange(),Ember.isNone(r)||this.valueDidChange(),this._change()},_changeSingle:function(){var r=this.$()[0].selectedIndex,n=t(this,"content"),i=t(this,"prompt");if(n&&t(n,"length")){if(i&&0===r)return e(this,"selection",null),void 0;i&&(r-=1),e(this,"selection",n.objectAt(r))}},_changeMultiple:function(){var r=this.$("option:selected"),n=t(this,"prompt"),i=n?1:0,s=t(this,"content"),u=t(this,"selection");if(s&&r){var l=r.map(function(){return this.index-i}).toArray(),c=s.objectsAt(l);a(u)?o(u,0,t(u,"length"),c):e(this,"selection",c)}},_selectionDidChangeSingle:function(){var e=this.get("element");if(e){var n=t(this,"content"),i=t(this,"selection"),o=n?r(n,i):-1,a=t(this,"prompt");a&&(o+=1),e&&(e.selectedIndex=o)}},_selectionDidChangeMultiple:function(){var e,i=t(this,"content"),o=t(this,"selection"),a=i?n(i,o):[-1],s=t(this,"prompt"),u=s?1:0,l=this.$("option");l&&l.each(function(){e=this.index>-1?this.index-u:-1,this.selected=r(a,e)>-1})},init:function(){this._super(),this.on("didInsertElement",this,this._triggerChange),this.on("change",this,this._change)}})}(),function(){Ember.Handlebars.registerHelper("input",function(e){var t=e.hash,r=(e.hashTypes,t.type),n=t.on;return delete t.type,delete t.on,"checkbox"===r?Ember.Handlebars.helpers.view.call(this,Ember.Checkbox,e):(r&&(t.type=r),t.onEvent=n||"enter",Ember.Handlebars.helpers.view.call(this,Ember.TextField,e))}),Ember.Handlebars.registerHelper("textarea",function(e){e.hash,e.hashTypes;return Ember.Handlebars.helpers.view.call(this,Ember.TextArea,e)})}(),function(){Ember.ComponentLookup=Ember.Object.extend({lookupFactory:function(e,t){t=t||this.container;var r="component:"+e,n="template:components/"+e,i=t&&t.has(n);i&&t.injection(r,"layout",n);var o=t.lookupFactory(r);return i||o?(o||(t.register(r,Ember.Component),o=t.lookupFactory(r)),o):void 0}})}(),function(){function e(){Ember.Handlebars.bootstrap(Ember.$(document))}function t(e){e.register("component-lookup:main",Ember.ComponentLookup)}Ember.Handlebars.bootstrap=function(e){var t='script[type="text/x-handlebars"], script[type="text/x-raw-handlebars"]';Ember.$(t,e).each(function(){var e=Ember.$(this),t="text/x-raw-handlebars"===e.attr("type")?Ember.$.proxy(Handlebars.compile,Handlebars):Ember.$.proxy(Ember.Handlebars.compile,Ember.Handlebars),r=e.attr("data-template-name")||e.attr("id")||"application",n=t(e.html());if(void 0!==Ember.TEMPLATES[r])throw new Ember.Error('Template named "'+r+'" already exists.');Ember.TEMPLATES[r]=n,e.remove()})},Ember.onLoad("Ember.Application",function(r){r.initializer({name:"domTemplates",initialize:e}),r.initializer({name:"registerComponentLookup",after:"domTemplates",initialize:t})})}(),function(){Ember.runLoadHooks("Ember.Handlebars",Ember.Handlebars)}(),function(){e("route-recognizer",["exports"],function(e){"use strict";function t(e){return"[object Array]"===Object.prototype.toString.call(e)}function r(e){this.string=e}function n(e){this.name=e}function i(e){this.name=e}function o(){}function a(e,t,a){"/"===e.charAt(0)&&(e=e.substr(1));for(var s=e.split("/"),u=[],l=0,c=s.length;c>l;l++){var h,m=s[l];(h=m.match(/^:([^\/]+)$/))?(u.push(new n(h[1])),t.push(h[1]),a.dynamics++):(h=m.match(/^\*([^\/]+)$/))?(u.push(new i(h[1])),t.push(h[1]),a.stars++):""===m?u.push(new o):(u.push(new r(m)),a.statics++)}return u}function s(e){this.charSpec=e,this.nextStates=[]}function u(e){return e.sort(function(e,t){if(e.types.stars!==t.types.stars)return e.types.stars-t.types.stars;if(e.types.stars){if(e.types.statics!==t.types.statics)return t.types.statics-e.types.statics;if(e.types.dynamics!==t.types.dynamics)return t.types.dynamics-e.types.dynamics}return e.types.dynamics!==t.types.dynamics?e.types.dynamics-t.types.dynamics:e.types.statics!==t.types.statics?t.types.statics-e.types.statics:0})}function l(e,t){for(var r=[],n=0,i=e.length;i>n;n++){var o=e[n];r=r.concat(o.match(t))}return r}function c(e){this.queryParams=e||{}}function h(e,t,r){for(var n=e.handlers,i=e.regex,o=t.match(i),a=1,s=new c(r),u=0,l=n.length;l>u;u++){for(var h=n[u],m=h.names,p={},f=0,d=m.length;d>f;f++)p[m[f]]=o[a++];s.push({handler:h.handler,params:p,isDynamic:!!m.length})}return s}function m(e,t){return t.eachChar(function(t){e=e.put(t)}),e}function p(e,t,r){this.path=e,this.matcher=t,this.delegate=r}function f(e){this.routes={},this.children={},this.target=e}function d(e,t,r){return function(n,i){var o=e+n;return i?(i(d(o,t,r)),void 0):new p(e+n,t,r)}}function b(e,t,r){for(var n=0,i=0,o=e.length;o>i;i++)n+=e[i].path.length;t=t.substr(n);var a={path:t,handler:r};e.push(a)}function v(e,t,r,n){var i=t.routes;for(var o in i)if(i.hasOwnProperty(o)){var a=e.slice();b(a,o,i[o]),t.children[o]?v(a,t.children[o],r,n):r.call(n,a)}}var E=["/",".","*","+","?","|","(",")","[","]","{","}","\\"],g=new RegExp("(\\"+E.join("|\\")+")","g");r.prototype={eachChar:function(e){for(var t,r=this.string,n=0,i=r.length;i>n;n++)t=r.charAt(n),e({validChars:t})},regex:function(){return this.string.replace(g,"\\$1")},generate:function(){return this.string}},n.prototype={eachChar:function(e){e({invalidChars:"/",repeat:!0})},regex:function(){return"([^/]+)"},generate:function(e){return e[this.name]}},i.prototype={eachChar:function(e){e({invalidChars:"",repeat:!0})},regex:function(){return"(.+)"},generate:function(e){return e[this.name]}},o.prototype={eachChar:function(){},regex:function(){return""},generate:function(){return""}},s.prototype={get:function(e){for(var t=this.nextStates,r=0,n=t.length;n>r;r++){var i=t[r],o=i.charSpec.validChars===e.validChars;if(o=o&&i.charSpec.invalidChars===e.invalidChars)return i}},put:function(e){var t;return(t=this.get(e))?t:(t=new s(e),this.nextStates.push(t),e.repeat&&t.nextStates.push(t),t)},match:function(e){for(var t,r,n,i=this.nextStates,o=[],a=0,s=i.length;s>a;a++)t=i[a],r=t.charSpec,"undefined"!=typeof(n=r.validChars)?-1!==n.indexOf(e)&&o.push(t):"undefined"!=typeof(n=r.invalidChars)&&-1===n.indexOf(e)&&o.push(t);return o}};var y=Object.create||function(e){function t(){}return t.prototype=e,new t};c.prototype=y({splice:Array.prototype.splice,slice:Array.prototype.slice,push:Array.prototype.push,length:0,queryParams:null});var _=function(){this.rootState=new s,this.names={}};_.prototype={add:function(e,t){for(var r,n=this.rootState,i="^",s={statics:0,dynamics:0,stars:0},u=[],l=[],c=!0,h=0,p=e.length;p>h;h++){var f=e[h],d=[],b=a(f.path,d,s);l=l.concat(b);for(var v=0,E=b.length;E>v;v++){var g=b[v];g instanceof o||(c=!1,n=n.put({validChars:"/"}),i+="/",n=m(n,g),i+=g.regex())}var y={handler:f.handler,names:d};u.push(y)}c&&(n=n.put({validChars:"/"}),i+="/"),n.handlers=u,n.regex=new RegExp(i+"$"),n.types=s,(r=t&&t.as)&&(this.names[r]={segments:l,handlers:u})},handlersFor:function(e){var t=this.names[e],r=[];if(!t)throw new Error("There is no route named "+e);for(var n=0,i=t.handlers.length;i>n;n++)r.push(t.handlers[n]);return r},hasRoute:function(e){return!!this.names[e]},generate:function(e,t){var r=this.names[e],n="";if(!r)throw new Error("There is no route named "+e);for(var i=r.segments,a=0,s=i.length;s>a;a++){var u=i[a];u instanceof o||(n+="/",n+=u.generate(t))}return"/"!==n.charAt(0)&&(n="/"+n),t&&t.queryParams&&(n+=this.generateQueryString(t.queryParams,r.handlers)),n},generateQueryString:function(e){var r=[],n=[];for(var i in e)e.hasOwnProperty(i)&&n.push(i);n.sort();for(var o=0,a=n.length;a>o;o++){i=n[o];var s=e[i];if(s!==!1&&null!=s){var u=i;if(t(s))for(var l=0,c=s.length;c>l;l++){var h=i+"[]="+encodeURIComponent(s[l]);r.push(h)}else s!==!0?(u+="="+encodeURIComponent(s),r.push(u)):r.push(u)}}return 0===r.length?"":"?"+r.join("&")},parseQueryString:function(e){for(var t=e.split("&"),r={},n=0;n<t.length;n++){var i,o=t[n].split("="),a=decodeURIComponent(o[0]),s=a.length,u=!1;1===o.length?i=!0:(s>2&&"[]"===a.slice(s-2)&&(u=!0,a=a.slice(0,s-2),r[a]||(r[a]=[])),i=o[1]?decodeURIComponent(o[1]):""),u?r[a].push(i):r[a]=i}return r},recognize:function(e){var t,r,n,i,o=[this.rootState],a={},s=!1;if(e=decodeURI(e),i=e.indexOf("?"),-1!==i){var c=e.substr(i+1,e.length);e=e.substr(0,i),a=this.parseQueryString(c)}for("/"!==e.charAt(0)&&(e="/"+e),t=e.length,t>1&&"/"===e.charAt(t-1)&&(e=e.substr(0,t-1),s=!0),r=0,n=e.length;n>r&&(o=l(o,e.charAt(r)),o.length);r++);var m=[];for(r=0,n=o.length;n>r;r++)o[r].handlers&&m.push(o[r]);o=u(m);var p=m[0];return p&&p.handlers?(s&&"(.+)$"===p.regex.source.slice(-5)&&(e+="/"),h(p,e,a)):void 0}},e["default"]=_,p.prototype={to:function(e,t){var r=this.delegate;if(r&&r.willAddRoute&&(e=r.willAddRoute(this.matcher.target,e)),this.matcher.add(this.path,e),t){if(0===t.length)throw new Error("You must have an argument in the function passed to `to`");this.matcher.addChild(this.path,e,t,this.delegate)}return this}},f.prototype={add:function(e,t){this.routes[e]=t},addChild:function(e,t,r,n){var i=new f(t);this.children[e]=i;var o=d(e,i,n);n&&n.contextEntered&&n.contextEntered(t,o),r(o)}},_.prototype.map=function(e,t){var r=new f;e(d("",r,this.delegate)),v([],r,function(e){t?t(this,e):this.add(e)},this)}})}(),function(){e("router/handler-info",["./utils","rsvp","exports"],function(e,t,r){"use strict";function n(e){e&&l(this,e)}function i(e){n.call(this,e)}function o(e){n.call(this,e),this.params=this.params||{}}function a(e){n.call(this,e)}function s(e,t){if(!e^!t)return!1;if(!e)return!0;for(var r in e)if(e.hasOwnProperty(r)&&e[r]!==t[r])return!1;return!0}var u=e.bind,l=e.merge,c=e.oCreate,h=e.serialize,m=e.promiseLabel,p=t.resolve;n.prototype={name:null,handler:null,params:null,context:null,log:function(e,t){e.log&&e.log(this.name+": "+t)},promiseLabel:function(e){return m("'"+this.name+"' "+e)},resolve:function(e,t,r){var n=u(this.checkForAbort,this,t),i=u(this.runBeforeModelHook,this,e,r),o=u(this.getModel,this,e,r),a=u(this.runAfterModelHook,this,e,r),s=u(this.becomeResolved,this,r);return p(void 0,this.promiseLabel("Start handler")).then(n,null,this.promiseLabel("Check for abort")).then(i,null,this.promiseLabel("Before model")).then(n,null,this.promiseLabel("Check if aborted during 'beforeModel' hook")).then(o,null,this.promiseLabel("Model")).then(n,null,this.promiseLabel("Check if aborted in 'model' hook")).then(a,null,this.promiseLabel("After model")).then(n,null,this.promiseLabel("Check if aborted in 'afterModel' hook")).then(s,null,this.promiseLabel("Become resolved"))},runBeforeModelHook:function(e,t){return t.trigger&&t.trigger(!0,"willResolveModel",t,this.handler),this.runSharedModelHook(e,t,"beforeModel",[])},runAfterModelHook:function(e,t,r){var n=this.name;return this.stashResolvedModel(t,r),this.runSharedModelHook(e,t,"afterModel",[r]).then(function(){return t.resolvedModels[n]},null,this.promiseLabel("Ignore fulfillment value and return model value"))},runSharedModelHook:function(e,t,r,n){this.log(t,"calling "+r+" hook"),this.queryParams&&n.push(this.queryParams),n.push(t);var i=this.handler;return e(function(){return i[r]&&i[r].apply(i,n)},this.promiseLabel("Handle "+r))},getModel:function(){throw new Error("This should be overridden by a subclass of HandlerInfo")},checkForAbort:function(e,t){return p(e(),this.promiseLabel("Check for abort")).then(function(){return t},null,this.promiseLabel("Ignore fulfillment value and continue"))},stashResolvedModel:function(e,t){e.resolvedModels=e.resolvedModels||{},e.resolvedModels[this.name]=t},becomeResolved:function(e,t){var r=this.params||h(this.handler,t,this.names);return e&&(this.stashResolvedModel(e,t),e.params=e.params||{},e.params[this.name]=r),new i({context:t,name:this.name,handler:this.handler,params:r})},shouldSupercede:function(e){if(!e)return!0;var t=e.context===this.context;return e.name!==this.name||this.hasOwnProperty("context")&&!t||this.hasOwnProperty("params")&&!s(this.params,e.params)}},i.prototype=c(n.prototype),i.prototype.resolve=function(e,t,r){return r&&r.resolvedModels&&(r.resolvedModels[this.name]=this.context),p(this,this.promiseLabel("Resolve"))},o.prototype=c(n.prototype),o.prototype.getModel=function(e,t){var r=this.params;t&&t.queryParams&&(r={},l(r,this.params),r.queryParams=t.queryParams);var n="function"==typeof this.handler.deserialize?"deserialize":"model";return this.runSharedModelHook(e,t,n,[r])},a.prototype=c(n.prototype),a.prototype.getModel=function(e,t){return this.log(t,this.name+": resolving provided model"),p(this.context)},r.HandlerInfo=n,r.ResolvedHandlerInfo=i,r.UnresolvedHandlerInfoByParam=o,r.UnresolvedHandlerInfoByObject=a}),e("router/router",["route-recognizer","rsvp","./utils","./transition-state","./transition","./transition-intent/named-transition-intent","./transition-intent/url-transition-intent","exports"],function(e,t,r,n,i,o,a,s){"use strict";function u(){this.recognizer=new v,this.reset()}function l(e,t,r){var n=h(e.state,t);C(n.exited,function(e){var t=e.handler;delete t.context,t.exit&&t.exit()});var i=e.oldState=e.state;e.state=t;var o=e.currentHandlerInfos=n.unchanged.slice();try{C(n.updatedContext,function(e){return c(o,e,!1,r)}),C(n.entered,function(e){return c(o,e,!0,r)})}catch(a){throw e.state=i,e.currentHandlerInfos=i.handlerInfos,a}e.state.queryParams=b(e,o,t.queryParams)}function c(e,t,r,n){var i=t.handler,o=t.context;if(r&&i.enter&&i.enter(n),n&&n.isAborted)throw new I;if(i.context=o,i.contextDidChange&&i.contextDidChange(),i.setup&&i.setup(o,n),n&&n.isAborted)throw new I;return e.push(t),!0}function h(e,t){var r,n,i,o,a,s=e.handlerInfos,u=t.handlerInfos,l={updatedContext:[],exited:[],entered:[],unchanged:[]};for(o=0,a=u.length;a>o;o++){var c=s[o],h=u[o];c&&c.handler===h.handler||(r=!0),r?(l.entered.push(h),c&&l.exited.unshift(c)):n||c.context!==h.context||i?(n=!0,l.updatedContext.push(h)):l.unchanged.push(c)}for(o=u.length,a=s.length;a>o;o++)l.exited.unshift(s[o]);return l}function m(e,t,r){var n=e.urlMethod;if(n){for(var i=e.router,o=t.handlerInfos,a=o[o.length-1].name,s={},u=o.length-1;u>=0;--u){var l=o[u];O(s,l.params),l.handler.inaccessibleByURL&&(n=null)}if(n){s.queryParams=t.queryParams;var c=i.recognizer.generate(a,s);"replaceQuery"===n?c!==r&&i.replaceURL(c):"replace"===n?i.replaceURL(c):i.updateURL(c)}}}function p(e,t){try{_(e.router,e.sequence,"Resolved all models on destination route; finalizing transition.");{var r=e.router,n=t.handlerInfos;e.sequence}return l(r,t,e),e.isAborted?(r.state.handlerInfos=r.currentHandlerInfos,E(V(e))):(m(e,t,e.intent.url),e.isActive=!1,r.activeTransition=null,y(r,r.currentHandlerInfos,!0,["didTransition"]),r.didTransition&&r.didTransition(r.currentHandlerInfos),_(r,e.sequence,"TRANSITION COMPLETE."),n[n.length-1].handler)}catch(i){if(!(i instanceof I)){var o=e.state.handlerInfos;e.trigger(!0,"error",i,e,o[o.length-1].handler),e.abort()}throw i}}function f(e,t,r){var n=t[0]||"/",i=t[t.length-1],o={};i&&i.hasOwnProperty("queryParams")&&(o=M.call(t).queryParams);var a;if(0===t.length){_(e,"Updating query params");var s=e.state.handlerInfos;a=new R({name:s[s.length-1].name,contexts:[],queryParams:o})}else"/"===n.charAt(0)?(_(e,"Attempting URL transition to "+n),a=new D({url:n})):(_(e,"Attempting transition to "+n),a=new R({name:t[0],contexts:w.call(t,1),queryParams:o}));return e.transitionByIntent(a,r)}function d(e,t){if(e.length!==t.length)return!1;for(var r=0,n=e.length;n>r;++r)if(e[r]!==t[r])return!1;return!0}function b(e,t,r){var n=[];y(e,t,!0,["finalizeQueryParamChange",r,n]);for(var i={},o=0,a=n.length;a>o;++o){var s=n[o];i[s.key]=s.value}return i}var v=e["default"],E=(t.resolve,t.reject),g=(t.async,t.Promise),y=r.trigger,_=r.log,w=r.slice,C=r.forEach,O=r.merge,A=r.serialize,P=r.extractQueryParams,T=r.getChangelist,x=r.promiseLabel,S=n.TransitionState,V=i.logAbort,N=i.Transition,I=i.TransitionAborted,R=o.NamedTransitionIntent,D=a.URLTransitionIntent,M=Array.prototype.pop;u.prototype={map:function(e){this.recognizer.delegate=this.delegate,this.recognizer.map(e,function(e,t){for(var r=t.length-1,n=!0;r>=0&&n;--r){var i=t[r];e.add(t,{as:i.handler}),n="/"===i.path||""===i.path||".index"===i.handler.slice(-6)}})},hasRoute:function(e){return this.recognizer.hasRoute(e)},transitionByIntent:function(e,t){var r,n=!!this.activeTransition,i=n?this.activeTransition.state:this.state,o=this;try{var a=e.applyToState(i,this.recognizer,this.getHandler,t);if(d(a.handlerInfos,i.handlerInfos)){var s=T(i.queryParams,a.queryParams);return s?(this._changedQueryParams=s.changed,y(this,a.handlerInfos,!0,["queryParamsDidChange",s.changed,s.all,s.removed]),this._changedQueryParams=null,!n&&this.activeTransition?this.activeTransition:(i.queryParams=b(this,a.handlerInfos,a.queryParams),r=new N(this),r.urlMethod="replace",r.promise=r.promise.then(function(e){return m(r,i,!0),o.didTransition&&o.didTransition(o.currentHandlerInfos),e},null,x("Transition complete")),r)):new N(this)}return t?(l(this,a),void 0):(r=new N(this,e,a),this.activeTransition&&this.activeTransition.abort(),this.activeTransition=r,r.promise=r.promise.then(function(e){return o.async(function(){return p(r,e.state)},"Finalize transition")},null,x("Settle transition promise when transition is finalized")),n||y(this,this.state.handlerInfos,!0,["willTransition",r]),r)}catch(u){return new N(this,e,null,u)}},reset:function(){this.state&&C(this.state.handlerInfos,function(e){var t=e.handler;t.exit&&t.exit()}),this.state=new S,this.currentHandlerInfos=null},activeTransition:null,handleURL:function(e){var t=w.call(arguments);return"/"!==e.charAt(0)&&(t[0]="/"+e),f(this,t).method("replaceQuery")},updateURL:function(){throw new Error("updateURL is not implemented")},replaceURL:function(e){this.updateURL(e)},transitionTo:function(){return f(this,arguments)},intermediateTransitionTo:function(){f(this,arguments,!0)},refresh:function(e){for(var t=this.activeTransition?this.activeTransition.state:this.state,r=t.handlerInfos,n={},i=0,o=r.length;o>i;++i){var a=r[i];n[a.name]=a.params||{}}_(this,"Starting a refresh transition");var s=new R({name:r[r.length-1].name,pivotHandler:e||r[0].handler,contexts:[],queryParams:this._changedQueryParams||t.queryParams||{}});return this.transitionByIntent(s,!1)},replaceWith:function(){return f(this,arguments).method("replace")},generate:function(e){for(var t=P(w.call(arguments,1)),r=t[0],n=t[1],i=new R({name:e,contexts:r}),o=i.applyToState(this.state,this.recognizer,this.getHandler),a={},s=0,u=o.handlerInfos.length;u>s;++s){var l=o.handlerInfos[s],c=l.params||A(l.handler,l.context,l.names);O(a,c)}return a.queryParams=n,this.recognizer.generate(e,a)},isActive:function(e){var t,r,n=P(w.call(arguments,1)),i=n[0],o=n[1],a=this.state.queryParams,s=this.state.handlerInfos;if(!s.length)return!1;var u=s[s.length-1].name,l=this.recognizer.handlersFor(u),c=0;for(r=l.length;r>c&&(t=s[c],t.name!==e);++c);if(c===l.length)return!1;var h=new S;h.handlerInfos=s.slice(0,c+1),l=l.slice(0,c+1);var m=new R({name:u,contexts:i}),p=m.applyToHandlers(h,l,this.getHandler,u,!0,!0),f={};O(f,o);for(var b in a)a.hasOwnProperty(b)&&f.hasOwnProperty(b)&&(f[b]=a[b]);return d(p.handlerInfos,h.handlerInfos)&&!T(f,o)},trigger:function(){var e=w.call(arguments);y(this,this.currentHandlerInfos,!1,e)},async:function(e,t){return new g(function(t){t(e())},t)},log:null},s.Router=u}),e("router/transition-intent",["./utils","exports"],function(e,t){"use strict";function r(e){e&&n(this,e),this.data=this.data||{}}var n=e.merge;r.prototype.applyToState=function(e){return e},t.TransitionIntent=r}),e("router/transition-intent/named-transition-intent",["../transition-intent","../transition-state","../handler-info","../utils","exports"],function(e,t,r,n,i){"use strict";function o(e){a.call(this,e)}var a=e.TransitionIntent,s=t.TransitionState,u=r.UnresolvedHandlerInfoByParam,l=r.UnresolvedHandlerInfoByObject,c=n.isParam,h=n.forEach,m=n.extractQueryParams,p=n.oCreate,f=n.merge;o.prototype=p(a.prototype),o.prototype.applyToState=function(e,t,r,n){var i=m([this.name].concat(this.contexts)),o=i[0],a=(i[1],t.handlersFor(o[0])),s=a[a.length-1].handler;return this.applyToHandlers(e,a,r,s,n)},o.prototype.applyToHandlers=function(e,t,r,n,i,o){var a,u=new s,l=this.contexts.slice(0),c=t.length,h=[];if(this.pivotHandler)for(a=0;a<t.length;++a)if(r(t[a].handler)===this.pivotHandler){c=a;break}!this.pivotHandler;for(a=t.length-1;a>=0;--a){var m=t[a],p=m.handler,d=r(p),b=e.handlerInfos[a],v=null;if(m.names.length>0?v=a>=c?this.createParamHandlerInfo(p,d,m.names,l,b):this.getHandlerInfoForDynamicSegment(p,d,m.names,l,b,n):(v=this.createParamHandlerInfo(p,d,m.names,l,b),h.unshift(a)),o){v=v.becomeResolved(null,v.context);var E=b&&b.context;m.names.length>0&&v.context===E&&(v.params=b&&b.params),v.context=E}var g=b;(a>=c||v.shouldSupercede(b))&&(c=Math.min(a,c),g=v),i&&!o&&(g=g.becomeResolved(null,g.context)),u.handlerInfos.unshift(g)}if(l.length>0)throw new Error("More context objects were passed than there are dynamic segments for the route: "+n);return i||this.invalidateNonDynamicHandlers(u.handlerInfos,h,c),f(u.queryParams,e.queryParams),f(u.queryParams,this.queryParams||{}),u},o.prototype.invalidateNonDynamicHandlers=function(e,t,r){h(t,function(t){if(t>=r){var n=e[t];e[t]=new u({name:n.name,handler:n.handler,params:{}})}})},o.prototype.getHandlerInfoForDynamicSegment=function(e,t,r,n,i){{var o;r.length}return n.length>0?(o=n[n.length-1],c(o)?this.createParamHandlerInfo(e,t,r,n,i):(n.pop(),new l({name:e,handler:t,context:o,names:r}))):i&&i.name===e?i:i},o.prototype.createParamHandlerInfo=function(e,t,r,n,i){for(var o={},a=r.length;a--;){var s=i&&e===i.name&&i.params||{},l=n[n.length-1],h=r[a];if(c(l))o[h]=""+n.pop();else{if(!s.hasOwnProperty(h))throw new Error("You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route "+e);o[h]=s[h]}}return new u({name:e,handler:t,params:o})},i.NamedTransitionIntent=o}),e("router/transition-intent/url-transition-intent",["../transition-intent","../transition-state","../handler-info","../utils","exports"],function(e,t,r,n,i){"use strict";function o(e){s.call(this,e)}function a(e){this.message=e||"UnrecognizedURLError",this.name="UnrecognizedURLError"}var s=e.TransitionIntent,u=t.TransitionState,l=r.UnresolvedHandlerInfoByParam,c=n.oCreate,h=n.merge;o.prototype=c(s.prototype),o.prototype.applyToState=function(e,t,r){var n,i,o=new u,s=t.recognize(this.url);if(!s)throw new a(this.url);var c=!1;for(n=0,i=s.length;i>n;++n){var m=s[n],p=m.handler,f=r(p);if(f.inaccessibleByURL)throw new a(this.url);var d=new l({name:p,handler:f,params:m.params}),b=e.handlerInfos[n];c||d.shouldSupercede(b)?(c=!0,o.handlerInfos[n]=d):o.handlerInfos[n]=b}return h(o.queryParams,s.queryParams),o},i.URLTransitionIntent=o}),e("router/transition-state",["./handler-info","./utils","rsvp","exports"],function(e,t,r,n){"use strict";function i(){this.handlerInfos=[],this.queryParams={},this.params={}}var o=(e.ResolvedHandlerInfo,t.forEach),a=t.promiseLabel,s=r.resolve,u=r.reject;i.prototype={handlerInfos:null,queryParams:null,params:null,promiseLabel:function(e){var t="";return o(this.handlerInfos,function(e){""!==t&&(t+="."),t+=e.name}),a("'"+t+"': "+e)},resolve:function(e,t,r){function n(){return s(t(),a("Check if should continue"))["catch"](function(e){return p=!0,u(e)},a("Handle abort"))}function i(e){var t=m.handlerInfos,n=r.resolveIndex>=t.length?t.length-1:r.resolveIndex;return u({error:e,handlerWithError:m.handlerInfos[n].handler,wasAborted:p,state:m})}function l(e){m.handlerInfos[r.resolveIndex++]=e;var t=e.handler;return t&&t.redirect&&t.redirect(e.context,r),n().then(c,null,a("Resolve handler"))}function c(){if(r.resolveIndex===m.handlerInfos.length)return{error:null,state:m};var t=m.handlerInfos[r.resolveIndex];return t.resolve(e,n,r).then(l,null,a("Proceed"))}var h=this.params;o(this.handlerInfos,function(e){h[e.name]=e.params||{}}),r=r||{},r.resolveIndex=0;var m=this,p=!1;return s(null,this.promiseLabel("Start transition")).then(c,null,this.promiseLabel("Resolve handler"))["catch"](i,this.promiseLabel("Handle error"))}},n.TransitionState=i}),e("router/transition",["rsvp","./handler-info","./utils","exports"],function(e,t,r,n){"use strict";function i(e,t,r,n){function a(){return c.isAborted?s(void 0,p("Transition aborted - reject")):void 0}var c=this;if(this.state=r||e.state,this.intent=t,this.router=e,this.data=this.intent&&this.intent.data||{},this.resolvedModels={},this.queryParams={},n)return this.promise=s(n),void 0;if(r){this.params=r.params,this.queryParams=r.queryParams;var h=r.handlerInfos.length;h&&(this.targetName=r.handlerInfos[r.handlerInfos.length-1].name);for(var m=0;h>m;++m){var f=r.handlerInfos[m];if(!(f instanceof l))break;this.pivotHandler=f.handler}this.sequence=i.currentSequence++,this.promise=r.resolve(e.async,a,this)["catch"](function(e){return e.wasAborted?s(o(c)):(c.trigger("error",e.error,c,e.handlerWithError),c.abort(),s(e.error))},p("Handle Abort"))}else this.promise=u(this.state),this.params={}}function o(e){return m(e.router,e.sequence,"detected abort."),new a}function a(e){this.message=e||"TransitionAborted",this.name="TransitionAborted"}var s=e.reject,u=e.resolve,l=t.ResolvedHandlerInfo,c=r.trigger,h=r.slice,m=r.log,p=r.promiseLabel;i.currentSequence=0,i.prototype={targetName:null,urlMethod:"update",intent:null,params:null,pivotHandler:null,resolveIndex:0,handlerInfos:null,resolvedModels:null,isActive:!0,state:null,promise:null,data:null,then:function(e,t){return this.promise.then(e,t)},abort:function(){return this.isAborted?this:(m(this.router,this.sequence,this.targetName+": transition was aborted"),this.isAborted=!0,this.isActive=!1,this.router.activeTransition=null,this)},retry:function(){return this.abort(),this.router.transitionByIntent(this.intent,!1)},method:function(e){return this.urlMethod=e,this},trigger:function(e){var t=h.call(arguments);"boolean"==typeof e?t.shift():e=!1,c(this.router,this.state.handlerInfos.slice(0,this.resolveIndex+1),e,t)},followRedirects:function(){var e=this.router;return this.promise["catch"](function(t){return e.activeTransition?e.activeTransition.followRedirects():s(t)})},toString:function(){return"Transition (sequence "+this.sequence+")"},log:function(e){m(this.router,this.sequence,e)}},i.prototype.send=i.prototype.trigger,n.Transition=i,n.logAbort=o,n.TransitionAborted=a}),e("router/utils",["exports"],function(e){"use strict";function t(e){return"[object Array]"===Object.prototype.toString.call(e)}function r(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}function n(e){var t,r,n=e&&e.length;return n&&n>0&&e[n-1]&&e[n-1].hasOwnProperty("queryParams")?(r=e[n-1].queryParams,t=p.call(e,0,n-1),[t,r]):[e,null]}function i(e){for(var r in e)if("number"==typeof e[r])e[r]=""+e[r];else if(t(e[r]))for(var n=0,i=e[r].length;i>n;n++)e[r][n]=""+e[r][n]}function o(e,t,r){e.log&&(3===arguments.length?e.log("Transition #"+t+": "+r):(r=t,e.log(r)))}function a(e,t){var r=arguments;return function(n){var i=p.call(r,2);return i.push(n),e.apply(t,i)}}function s(e){return"string"==typeof e||e instanceof String||"number"==typeof e||e instanceof Number}function u(e,t){for(var r=0,n=e.length;n>r&&!1!==t(e[r]);r++);}function l(e,t,r){var n={};if(s(t))return n[r[0]]=t,n;if(e.serialize)return e.serialize(t,r);if(1===r.length){var i=r[0];return n[i]=/_id$/.test(i)?t.id:t,n}}function c(e,t,r,n){if(e.triggerEvent)return e.triggerEvent(t,r,n),void 0;var i=n.shift();if(!t){if(r)return;throw new Error("Could not trigger event '"+i+"'. There are no active handlers")}for(var o=!1,a=t.length-1;a>=0;a--){var s=t[a],u=s.handler;if(u.events&&u.events[i]){if(u.events[i].apply(u,n)!==!0)return;o=!0}}if(!o&&!r)throw new Error("Nothing handled the event '"+i+"'.")}function h(e,n){var o,a={all:{},changed:{},removed:{}};r(a.all,n);var s=!1;i(e),i(n);for(o in e)e.hasOwnProperty(o)&&(n.hasOwnProperty(o)||(s=!0,a.removed[o]=e[o]));for(o in n)if(n.hasOwnProperty(o))if(t(e[o])&&t(n[o]))if(e[o].length!==n[o].length)a.changed[o]=n[o],s=!0;else for(var u=0,l=e[o].length;l>u;u++)e[o][u]!==n[o][u]&&(a.changed[o]=n[o],s=!0);else e[o]!==n[o]&&(a.changed[o]=n[o],s=!0);return s&&a}function m(e){return"Router: "+e}var p=Array.prototype.slice,f=Object.create||function(e){function t(){}return t.prototype=e,new t};e.trigger=c,e.log=o,e.oCreate=f,e.merge=r,e.extractQueryParams=n,e.bind=a,e.isParam=s,e.forEach=u,e.slice=p,e.serialize=l,e.getChangelist=h,e.coerceQueryParamsToString=i,e.promiseLabel=m}),e("router",["./router/router","exports"],function(e,t){"use strict";var r=e.Router;t.Router=r})}(),function(){function e(e){this.parent=e,this.matches=[]}function t(e,t,r){r=r||{},"string"!=typeof r.path&&(r.path="/"+t),e.parent&&"application"!==e.parent&&(t=e.parent+"."+t),e.push(r.path,t,null)}e.prototype={resource:function(r,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n={}),1===arguments.length&&(n={}),"string"!=typeof n.path&&(n.path="/"+r),i){var o=new e(r);t(o,"loading"),t(o,"error",{path:"/_unused_dummy_error_path_route_"+r+"/:error"}),i.call(o),this.push(n.path,r,o.generate())
18
+ }else this.push(n.path,r,null)},push:function(e,t,r){var n=t.split(".");(""===e||"/"===e||"index"===n[n.length-1])&&(this.explicitIndex=!0),this.matches.push([e,t,r])},route:function(e,r){t(this,e,r)},generate:function(){var e=this.matches;return this.explicitIndex||this.route("index",{path:"/"}),function(t){for(var r=0,n=e.length;n>r;r++){var i=e[r];t(i[0]).to(i[1],i[2])}}}},e.map=function(t){var r=new e;return t.call(r),r},Ember.RouterDSL=e}(),function(){var e=Ember.get;Ember.controllerFor=function(e,t,r){return e.lookup("controller:"+t,r)},Ember.generateControllerFactory=function(e,t,r){var n,i,o,a;return a=r&&Ember.isArray(r)?"array":r?"object":"basic",o="controller:"+a,n=e.lookupFactory(o).extend({isGenerated:!0,toString:function(){return"(generated "+t+" controller)"}}),i="controller:"+t,e.register(i,n),n},Ember.generateController=function(t,r,n){Ember.generateControllerFactory(t,r,n);var i="controller:"+r,o=t.lookup(i);return e(o,"namespace.LOG_ACTIVE_GENERATION"),o}}(),function(){function e(e,t){var n=e.controllerName||e.routeName,i=r(n,e.container),o=h(i,"queryParams");o&&d(o,function(e){var r,i=e.split(":");r=i.length>1?i[1]:"application"!==n?n+"["+e+"]":e;var o=n+":"+e;t.queryParams[o]=r,t.translations[i[0]]=o})}function r(e,t){var r="controller:"+e;if(t.cache.has(r))return t.lookup(r);var n=t.lookupFactory(r);return n&&"function"==typeof n.proto?n.proto():{}}function n(e){var t,r,n={};for(r in e)t=Ember.Router._descopeQueryParam(e[r]),n[t]=n[t]?n[t]+1:1;for(r in e)t=Ember.Router._descopeQueryParam(e[r]),1===n[t]&&(e[r]=t)}function i(e,t,r){for(var n=t.state.handlerInfos,i=!1,o=n.length-1;o>=0;--o){var a=n[o],s=a.handler;if(i){if(r(s,n[o+1].handler)!==!0)return!1}else e===s&&(i=!0)}return!0}function o(e,t,r){var n,i=e.router,o=(t.routeName.split(".").pop(),"application"===e.routeName?"":e.routeName+".");return n=o+r,a(i,n)?n:void 0}function a(e,t){var r=e.container;return e.hasRoute(t)&&(r.has("template:"+t)||r.has("route:"+t))}function s(e,t,r){var n=r.shift();if(!e){if(t)return;throw new Ember.Error("Can't trigger action '"+n+"' because your app hasn't finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call `.send()` on the `Transition` object passed to the `model/beforeModel/afterModel` hooks.")}for(var i=!1,o=e.length-1;o>=0;o--){var a=e[o],s=a.handler;if(s._actions&&s._actions[n]){if(s._actions[n].apply(s,r)!==!0)return;i=!0}}if(v[n])return v[n].apply(null,r),void 0;if(!i&&!t)throw new Ember.Error("Nothing handled the action '"+n+"'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.")}function u(e){var t=e.container.lookup("controller:application");if(t){var r=e.router.currentHandlerInfos,n=Ember.Router._routePath(r);"currentPath"in t||p(t,"currentPath"),m(t,"currentPath",n),"currentRouteName"in t||p(t,"currentRouteName"),m(t,"currentRouteName",r[r.length-1].name)}}var l=t("router"),c=l.Router,h=(l.Transition,Ember.get),m=Ember.set,p=(Ember.String.fmt,Ember.defineProperty),f=Array.prototype.slice,d=Ember.EnumerableUtils.forEach,b=Ember._MetamorphView;Ember.Router=Ember.Object.extend(Ember.Evented,{location:"hash",rootURL:"/",init:function(){this.router=this.constructor.router||this.constructor.map(Ember.K),this._activeViews={},this._setupLocation(),h(this,"namespace.LOG_TRANSITIONS_INTERNAL")&&(this.router.log=Ember.Logger.debug)},url:Ember.computed(function(){return h(this,"location").getURL()}),startRouting:function(){this.router=this.router||this.constructor.map(Ember.K);var e=this.router,t=h(this,"location"),r=this.container,n=this,i=h(this,"initialURL");h(t,"cancelRouterSetup")||(this._setupRouter(e,t),r.register("view:default",b),r.register("view:toplevel",Ember.View.extend()),t.onUpdateURL(function(e){n.handleURL(e)}),"undefined"==typeof i&&(i=t.getURL()),this.handleURL(i))},didTransition:function(e){u(this),this._cancelLoadingEvent(),this.notifyPropertyChange("url"),Ember.run.once(this,this.trigger,"didTransition"),h(this,"namespace").LOG_TRANSITIONS&&Ember.Logger.log("Transitioned into '"+Ember.Router._routePath(e)+"'")},handleURL:function(e){return this._doTransition("handleURL",[e])},transitionTo:function(){return this._doTransition("transitionTo",arguments)},intermediateTransitionTo:function(){this.router.intermediateTransitionTo.apply(this.router,arguments),u(this);var e=this.router.currentHandlerInfos;h(this,"namespace").LOG_TRANSITIONS&&Ember.Logger.log("Intermediate-transitioned into '"+Ember.Router._routePath(e)+"'")},replaceWith:function(){return this._doTransition("replaceWith",arguments)},generate:function(){var e=this.router.generate.apply(this.router,arguments);return this.location.formatURL(e)},isActive:function(){var e=this.router;return e.isActive.apply(e,arguments)},send:function(){this.router.trigger.apply(this.router,arguments)},hasRoute:function(e){return this.router.hasRoute(e)},reset:function(){this.router.reset()},_lookupActiveView:function(e){var t=this._activeViews[e];return t&&t[0]},_connectActiveView:function(e,t){var r=this._activeViews[e];r&&r[0].off("willDestroyElement",this,r[1]);var n=function(){delete this._activeViews[e]};this._activeViews[e]=[t,n],t.one("willDestroyElement",this,n)},_setupLocation:function(){var e=h(this,"location"),t=h(this,"rootURL");if(t&&!this.container.has("-location-setting:root-url")&&this.container.register("-location-setting:root-url",t,{instantiate:!1}),"string"==typeof e&&this.container){var r=this.container.lookup("location:"+e);if("undefined"!=typeof r)e=m(this,"location",r);else{var n={implementation:e};e=m(this,"location",Ember.Location.create(n))}}t&&"string"==typeof t&&(e.rootURL=t),"function"==typeof e.initState&&e.initState()},_getHandlerFunction:function(){var e={},t=this.container,r=t.lookupFactory("route:basic"),n=this;return function(i){var o="route:"+i,a=t.lookup(o);return e[i]?a:(e[i]=!0,a||(t.register(o,r.extend()),a=t.lookup(o),h(n,"namespace.LOG_ACTIVE_GENERATION")),a.routeName=i,a)}},_setupRouter:function(e,t){var r,n=this;e.getHandler=this._getHandlerFunction();var i=function(){t.setURL(r)};if(e.updateURL=function(e){r=e,Ember.run.once(i)},t.replaceURL){var o=function(){t.replaceURL(r)};e.replaceURL=function(e){r=e,Ember.run.once(o)}}e.didTransition=function(e){n.didTransition(e)}},_doTransition:function(e,t){t=f.call(t),t[0]=t[0]||"/";var r,n=t[0],i=!1;if(!i&&"/"!==n.charAt(0),r){if(!n){var o=this.router.activeTransition?this.router.activeTransition.state.handlerInfos:this.router.state.handlerInfos;n=o[o.length-1].name,t.unshift(n)}var a=this._queryParamNamesFor(n);Ember.Router._translateQueryParams(r,a.translations,n);var s;for(var u in r){var l=Ember.Router._descopeQueryParam(u);u in a.queryParams?(s=r[u],delete r[u],r[a.queryParams[u]]=s):l in a.validQueryParams&&(s=r[u],delete r[u],r[l]=s)}}var c=this.router[e].apply(this.router,t);return c.then(null,function(e){e&&"UnrecognizedURLError"===e.name},"Ember: Check for Router unrecognized URL error"),c},_scheduleLoadingEvent:function(e,t){this._cancelLoadingEvent(),this._loadingStateTimer=Ember.run.scheduleOnce("routerTransitions",this,"_fireLoadingEvent",e,t)},_fireLoadingEvent:function(e,t){this.router.activeTransition&&e.trigger(!0,"loading",e,t)},_cancelLoadingEvent:function(){this._loadingStateTimer&&Ember.run.cancel(this._loadingStateTimer),this._loadingStateTimer=null},_queryParamNamesFor:function(t){var r=this.router.recognizer.handlersFor(t),i={queryParams:Ember.create(null),translations:Ember.create(null),validQueryParams:Ember.create(null)},o=this.router;d(r,function(t){var r=o.getHandler(t.handler);e(r,i)}),n(i.queryParams);for(var a in i.queryParams)i.validQueryParams[i.queryParams[a]]=!0;return i},_queryParamNamesForSingle:function(t){var r={queryParams:Ember.create(null),translations:Ember.create(null)},n=this.router.getHandler(t);if(e(n,r),"application"!==t){var i=this._queryParamNamesFor(t);for(var o in r.queryParams)r.queryParams[o]=i.queryParams[o]}return r},_queryParamOverrides:function(e,t,n){for(var i in t){var o=i.split(":"),a=r(o[0],this.container);e[t[i]]=h(a,o[1]),n&&n(i,t[i],i)}}});var v={willResolveModel:function(e,t){t.router._scheduleLoadingEvent(e,t)},error:function(e,t,r){var n=r.router,s=i(r,t,function(t,r){var i=o(t,r,"error");return i?(n.intermediateTransitionTo(i,e),void 0):!0});return s?a(r.router,"application_error")?(n.intermediateTransitionTo("application_error",e),void 0):(Ember.Logger.error("Error while loading route: "+(e&&e.stack)),void 0):void 0},loading:function(e,t){var r=t.router,n=i(t,e,function(t,n){var i=o(t,n,"loading");return i?(r.intermediateTransitionTo(i),void 0):e.pivotHandler!==t?!0:void 0});return n&&a(t.router,"application_loading")?(r.intermediateTransitionTo("application_loading"),void 0):void 0}};Ember.Router.reopenClass({router:null,map:function(e){var t=this.router;t||(t=new c,t.callbacks=[],t.triggerEvent=s,this.reopenClass({router:t}));var r=Ember.RouterDSL.map(function(){this.resource("application",{path:"/"},function(){for(var r=0;r<t.callbacks.length;r++)t.callbacks[r].call(this);e.call(this)})});return t.callbacks.push(e),t.map(r.generate()),t},_routePath:function(e){function t(e,t){for(var r=0,n=e.length;n>r;++r)if(e[r]!==t[r])return!1;return!0}for(var r=[],n=1,i=e.length;i>n;n++){for(var o=e[n].name,a=o.split("."),s=f.call(r);s.length&&!t(s,a);)s.shift();r.push.apply(r,a.slice(s.length))}return r.join(".")},_translateQueryParams:function(e,t){for(var r in e)e.hasOwnProperty(r)&&r in t&&(e[t[r]]=e[r],delete e[r])},_descopeQueryParam:function(e){var t=/\[(.+)\]/,r=e.match(t);return r=r?r[1]:e}})}(),function(){function e(e){var t=e.router.router.state.handlerInfos;if(t)for(var r,n,i=0,o=t.length;o>i;i++){if(n=t[i].handler,n===e)return r;r=n}}function t(r){var n,i=e(r);if(i)return(n=i.lastRenderedTemplate)?n:t(i)}function r(e,r,n,i){i=i||{},i.into=i.into?i.into.replace(/\//g,"."):t(e),i.outlet=i.outlet||"main",i.name=r,i.template=n,i.LOG_VIEW_LOOKUPS=s(e.router,"namespace.LOG_VIEW_LOOKUPS");var o,a=i.controller;if(a=i.controller?i.controller:(o=e.container.lookup("controller:"+r))?o:e.controllerName||e.routeName,"string"==typeof a){var u=a;if(a=e.container.lookup("controller:"+u),!a)throw new Ember.Error("You passed `controller: '"+u+"'` into the `render` method, but no such controller could be found.")}return i.controller=a,i}function n(e,t,r){if(e)r.LOG_VIEW_LOOKUPS;else{var n=r.into?"view:default":"view:toplevel";e=t.lookup(n),r.LOG_VIEW_LOOKUPS}return s(e,"templateName")||(u(e,"template",r.template),u(e,"_debugTemplateName",r.name)),u(e,"renderedName",r.name),u(e,"controller",r.controller),e}function i(e,t,r){if(r.into){var n=e.router._lookupActiveView(r.into),i=a(n,r.outlet);e.teardownOutletViews||(e.teardownOutletViews=[]),h(e.teardownOutletViews,0,0,[i]),n.connectOutlet(r.outlet,t)}else{var u=s(e,"router.namespace.rootElement");e.teardownTopLevelView&&e.teardownTopLevelView(),e.router._connectActiveView(r.name,t),e.teardownTopLevelView=o(t),t.appendTo(u)}}function o(e){return function(){e.destroy()}}function a(e,t){return function(){e.disconnectOutlet(t)}}var s=Ember.get,u=Ember.set,l=Ember.getProperties,c=(Ember.String.classify,Ember.String.fmt,Ember.EnumerableUtils.forEach),h=Ember.EnumerableUtils.replace;Ember.Route=Ember.Object.extend(Ember.ActionHandler,{exit:function(){this.deactivate(),this.teardownViews()},enter:function(){this.activate()},viewName:null,templateName:null,controllerName:null,_actions:{finalizeQueryParamChange:function(){}},events:null,mergedProperties:["events"],deactivate:Ember.K,activate:Ember.K,transitionTo:function(){var e=this.router;return e.transitionTo.apply(e,arguments)},intermediateTransitionTo:function(){var e=this.router;e.intermediateTransitionTo.apply(e,arguments)},refresh:function(){return this.router.router.refresh(this).method("replace")},replaceWith:function(){var e=this.router;return e.replaceWith.apply(e,arguments)},send:function(){return this.router.send.apply(this.router,arguments)},setup:function(e){var t=this.controllerName||this.routeName,r=this.controllerFor(t,!0);r||(r=this.generateController(t,e)),this.controller=r,this.setupControllers?this.setupControllers(r,e):this.setupController(r,e),this.renderTemplates?this.renderTemplates(e):this.renderTemplate(r,e)},beforeModel:Ember.K,afterModel:Ember.K,redirect:Ember.K,contextDidChange:function(){this.currentModel=this.context},model:function(e,t){var r,n,i,o;for(var a in e)"queryParams"!==a&&((r=a.match(/^(.*)_id$/))&&(n=r[1],o=e[a]),i=!0);if(!n&&i)return Ember.copy(e);if(!n){if(t.resolveIndex!==t.state.handlerInfos.length-1)return;var s=t.state.handlerInfos[t.resolveIndex-1].context;return s}return this.findModel(n,o)},deserialize:function(e,t){return this.model(e,t)},findModel:function(){var e=s(this,"store");return e.find.apply(e,arguments)},store:Ember.computed(function(){{var e=this.container;this.routeName,s(this,"router.namespace")}return{find:function(t,r){var n=e.lookupFactory("model:"+t);if(n)return n.find(r)}}}),serialize:function(e,t){if(!(t.length<1)&&e){var r=t[0],n={};return/_id$/.test(r)&&1===t.length?n[r]=s(e,"id"):n=l(e,t),n}},setupController:function(e,t){e&&void 0!==t&&u(e,"model",t)},controllerFor:function(e){var t,r=this.container,n=r.lookup("route:"+e);return n&&n.controllerName&&(e=n.controllerName),t=r.lookup("controller:"+e)},generateController:function(e,t){var r=this.container;return t=t||this.modelFor(e),Ember.generateController(r,e,t)},modelFor:function(e){var t=this.container.lookup("route:"+e),r=this.router.router.activeTransition;if(r){var n=t&&t.routeName||e;if(r.resolvedModels.hasOwnProperty(n))return r.resolvedModels[n]}return t&&t.currentModel},renderTemplate:function(){this.render()},render:function(e,t){"object"!=typeof e||t||(t=e,e=this.routeName),t=t||{};var o;e?(e=e.replace(/\//g,"."),o=e):(e=this.routeName,o=this.templateName||e);var a=t.view||this.viewName||e,u=this.container,l=u.lookup("view:"+a),c=l?l.get("template"):null;return c||(c=u.lookup("template:"+o)),l||c?(t=r(this,e,c,t),l=n(l,u,t),"main"===t.outlet&&(this.lastRenderedTemplate=e),i(this,l,t),void 0):(s(this.router,"namespace.LOG_VIEW_LOOKUPS"),void 0)},disconnectOutlet:function(e){if(!e||"string"==typeof e){var r=e;e={},e.outlet=r}e.parentView=e.parentView?e.parentView.replace(/\//g,"."):t(this),e.outlet=e.outlet||"main";var n=this.router._lookupActiveView(e.parentView);n&&n.disconnectOutlet(e.outlet)},willDestroy:function(){this.teardownViews()},teardownViews:function(){this.teardownTopLevelView&&this.teardownTopLevelView();var e=this.teardownOutletViews||[];c(e,function(e){e()}),delete this.teardownTopLevelView,delete this.teardownOutletViews,delete this.lastRenderedTemplate}})}(),function(){Ember.onLoad("Ember.Handlebars",function(){function e(e,r,i){return n.call(t(e,r,i),function(t,n){return null===t?r[n]:o(e,t,i)})}function t(e,t,o){function a(e,t){return"controller"===t?t:Ember.ControllerMixin.detect(e)?a(i(e,"model"),t?t+".model":"model"):t}var s=r(e,t,o),u=o.types;return n.call(s,function(e,r){return"ID"===u[r]?a(e,t[r]):null})}var r=Ember.Handlebars.resolveParams,n=Ember.ArrayPolyfills.map,i=Ember.get,o=Ember.Handlebars.get;Ember.Router.resolveParams=e,Ember.Router.resolvePaths=t})}(),function(){var e=Ember.get,t=(Ember.set,Ember.String.fmt,Array.prototype.slice),r=function(e,t){for(var r=0,n=0,i=t.length;i>n&&(r+=t[n].names.length,t[n].handler!==e);n++);return r};Ember.onLoad("Ember.Handlebars",function(){function n(e){var t=e.options.types,r=e.options.data;return s(e.context,e.params,{types:t,data:r})}var i=Ember.Object.extend({values:null}),o=Ember.Router.resolveParams,a=Ember.Router._translateQueryParams,s=Ember.Router.resolvePaths,u=Ember.ViewUtils.isSimpleClick,l=Ember.LinkView=Ember.View.extend({tagName:"a",currentWhen:null,title:null,rel:null,activeClass:"active",loadingClass:"loading",disabledClass:"disabled",_isDisabled:!1,replace:!1,attributeBindings:["href","title","rel"],classNameBindings:["active","loading","disabled"],eventName:"click",init:function(){this._super.apply(this,arguments);var t=e(this,"eventName");this.on(t,this,this._invoke)},_paramsChanged:function(){this.notifyPropertyChange("resolvedParams")},_setupPathObservers:function(){var e,t,r,i=this.parameters,o=i.options.linkTextPath,a=n(i),s=a.length;for(o&&(r=Ember.Handlebars.normalizePath(i.context,o,i.options.data),this.registerObserver(r.root,r.path,this,this.rerender)),t=0;s>t;t++)e=a[t],null!==e&&(r=Ember.Handlebars.normalizePath(i.context,e,i.options.data),this.registerObserver(r.root,r.path,this,this._paramsChanged));var u=this.queryParamsObject;if(u){var l=u.values;for(var c in l)l.hasOwnProperty(c)&&"ID"===u.types[c]&&(r=Ember.Handlebars.normalizePath(i.context,l[c],i.options.data),this.registerObserver(r.root,r.path,this,this._paramsChanged))}},afterRender:function(){this._super.apply(this,arguments),this._setupPathObservers()},concreteView:Ember.computed(function(){return e(this,"parentView")}).property("parentView"),disabled:Ember.computed(function(t,r){return void 0!==r&&this.set("_isDisabled",r),r?e(this,"disabledClass"):!1}),active:Ember.computed(function(){if(e(this,"loading"))return!1;var t=e(this,"router"),n=e(this,"routeArgs"),i=n.slice(1),o=(e(this,"resolvedParams"),this.currentWhen||n[0]),a=r(o,t.router.recognizer.handlersFor(o));i.length>a&&(o=n[0]);var s=t.isActive.apply(t,[o].concat(i));return s?e(this,"activeClass"):void 0}).property("resolvedParams","routeArgs"),loading:Ember.computed(function(){return e(this,"routeArgs")?void 0:e(this,"loadingClass")}).property("routeArgs"),router:Ember.computed(function(){return e(this,"controller").container.lookup("router:main")}),_invoke:function(t){if(!u(t))return!0;if(this.preventDefault!==!1&&t.preventDefault(),this.bubbles===!1&&t.stopPropagation(),e(this,"_isDisabled"))return!1;if(e(this,"loading"))return Ember.Logger.warn("This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid."),!1;var r,n=e(this,"router"),i=e(this,"routeArgs");r=e(this,"replace")?n.replaceWith.apply(n,i):n.transitionTo.apply(n,i);var o=n.router.generate.apply(n.router,e(this,"routeArgs"));Ember.run.scheduleOnce("routerTransitions",this,this._eagerUpdateUrl,r,o)},_eagerUpdateUrl:function(t,r){if(t.isActive&&t.urlMethod){0===r.indexOf("#")&&(r=r.slice(1));var n=e(this,"router.router");"update"===t.urlMethod?n.updateURL(r):"replace"===t.urlMethod&&n.replaceURL(r),t.method(null)}},resolvedParams:Ember.computed(function(){var t=this.parameters,r=t.options,n=r.types,i=r.data;if(0===t.params.length){var a=this.container.lookup("controller:application");return[e(a,"currentRouteName")]}return o(t.context,t.params,{types:n,data:i})}).property("router.url"),routeArgs:Ember.computed(function(){var t=e(this,"resolvedParams").slice(0),r=e(this,"router"),n=t[0];if(n){var i=r.router.recognizer.handlersFor(n),o=i[i.length-1].handler;n!==o&&(this.set("currentWhen",n),n=i[i.length-1].handler,t[0]=n);for(var a=1,s=t.length;s>a;++a){var u=t[a];if(null===u||"undefined"==typeof u)return}return t}}).property("resolvedParams","queryParams"),queryParamsObject:null,queryParams:Ember.computed(function(){var t=e(this,"queryParamsObject"),r={};t&&Ember.merge(r,t.values);var n=e(this,"resolvedParams"),i=e(this,"router"),o=n[0],s=i._queryParamNamesFor(o),u=s.queryParams,l=s.translations,c={};a(r,l,o);var h=this.parameters;return i._queryParamOverrides(c,u,function(e,n){if(e in r){var i,o=e.split(":"),a=t.types[o[1]];if("ID"===a){var s=Ember.Handlebars.normalizePath(h.context,r[e],h.options.data);i=Ember.Handlebars.get(s.root,s.path,h.options)}else i=r[e];delete r[e],c[n]=i}}),c}).property("resolvedParams.[]"),href:Ember.computed(function(){if("a"===e(this,"tagName")){var t=e(this,"router"),r=e(this,"routeArgs");return r?t.generate.apply(t,r):e(this,"loadingHref")}}).property("routeArgs"),loadingHref:"#"});l.toString=function(){return"LinkView"},Ember.Handlebars.registerHelper("link-to",function(){var e=t.call(arguments,-1)[0],r=t.call(arguments,0,-1),n=e.hash;if(r[r.length-1]instanceof i&&(n.queryParamsObject=r.pop()),n.disabledBinding=n.disabledWhen,!e.fn){var o=r.shift(),a=e.types.shift(),s=this;"ID"===a?(e.linkTextPath=o,e.fn=function(){return Ember.Handlebars.getEscaped(s,o,e)}):e.fn=function(){return o}}return n.parameters={context:this,options:e,params:r},Ember.Handlebars.helpers.view.call(this,l,e)}),Ember.Handlebars.registerHelper("linkTo",function(){return Ember.Handlebars.helpers["link-to"].apply(this,arguments)})})}(),function(){Ember.get,Ember.set;Ember.onLoad("Ember.Handlebars",function(e){e.OutletView=Ember.ContainerView.extend(Ember._Metamorph),e.registerHelper("outlet",function(t,r){var n,i,o,a,s;for(t&&t.data&&t.data.isRenderData&&(r=t,t="main"),i=r.data.view.container,n=r.data.view;!n.get("template.isTop");)n=n.get("_parentView");return o=r.hash.view,o&&(s="view:"+o),a=o?i.lookupFactory(s):r.hash.viewClass||e.OutletView,r.data.view.set("outletSource",n),r.hash.currentViewBinding="_view.outletSource._outlets."+t,e.helpers.view.call(this,a,r)})})}(),function(){Ember.get,Ember.set;Ember.onLoad("Ember.Handlebars",function(){Ember.Handlebars.registerHelper("render",function(e,t,r){var n,i,o,a,s,u=arguments.length;if(n=(r||t).data.keywords.controller.container,i=n.lookup("router:main"),2===u)r=t,t=void 0;else{if(3!==u)throw Ember.Error("You must pass a templateName to render");s=Ember.Handlebars.get(r.contexts[1],t,r)}e=e.replace(/\//g,"."),a=n.lookup("view:"+e)||n.lookup("view:default");var l=r.hash.controller||e,c="controller:"+l;r.hash.controller;var h=r.data.keywords.controller;if(u>2){var m=n.lookupFactory(c)||Ember.generateControllerFactory(n,l,s);o=m.create({model:s,parentController:h,target:h})}else o=n.lookup(c)||Ember.generateController(n,l),o.setProperties({target:h,parentController:h});var p=r.contexts[1];p&&a.registerObserver(p,t,function(){o.set("model",Ember.Handlebars.get(p,t,r))}),r.hash.viewName=Ember.String.camelize(e);var f="template:"+e;r.hash.template=n.lookup(f),r.hash.controller=o,i&&!s&&i._connectActiveView(e,a),Ember.Handlebars.helpers.view.call(this,a,r)})})}(),function(){Ember.onLoad("Ember.Handlebars",function(){function e(e,r){var n=[];r&&n.push(r);var i=e.options.types.slice(1),o=e.options.data;return n.concat(t(e.context,e.params,{types:i,data:o}))}var t=Ember.Router.resolveParams,r=Ember.ViewUtils.isSimpleClick,n=Ember.Handlebars,i=n.get,o=n.SafeString,a=Ember.ArrayPolyfills.forEach,s=(Ember.get,Array.prototype.slice),u=n.ActionHelper={registeredActions:{}},l=["alt","shift","meta","ctrl"],c=/^click|mouse|touch/,h=function(e,t){if("undefined"==typeof t){if(c.test(e.type))return r(e);t=""}if(t.indexOf("any")>=0)return!0;var n=!0;return a.call(l,function(r){e[r+"Key"]&&-1===t.indexOf(r)&&(n=!1)}),n};u.registerAction=function(t,r,n){var o=++Ember.uuid;return u.registeredActions[o]={eventName:r.eventName,handler:function(o){if(!h(o,n))return!0;r.preventDefault!==!1&&o.preventDefault(),r.bubbles===!1&&o.stopPropagation();var a,s=r.target;s=s.target?i(s.root,s.target,s.options):s.root,r.boundProperty&&(a=i(s,t,r.options),("undefined"==typeof a||"function"==typeof a)&&(a=t)),a||(a=t),Ember.run(function(){s.send?s.send.apply(s,e(r.parameters,a)):s[a].apply(s,e(r.parameters))})}},r.view.on("willClearRender",function(){delete u.registeredActions[o]}),o},n.registerHelper("action",function(e){var t=arguments[arguments.length-1],r=s.call(arguments,1,-1),n=t.hash,i=t.data.keywords.controller,a={eventName:n.on||"click",parameters:{context:this,options:t,params:r},view:t.data.view,bubbles:n.bubbles,preventDefault:n.preventDefault,target:{options:t},boundProperty:"ID"===t.types[0]};n.target?(a.target.root=this,a.target.target=n.target):i&&(a.target.root=i);var l=u.registerAction(e,a,n.allowedKeys);return new o('data-ember-action="'+l+'"')})})}(),function(){{var e=Ember.get;Ember.set,Ember.EnumerableUtils.map}Ember.ControllerMixin.reopen({transitionToRoute:function(){var t=e(this,"target"),r=t.transitionToRoute||t.transitionTo;return r.apply(t,arguments)},transitionTo:function(){return this.transitionToRoute.apply(this,arguments)},replaceRoute:function(){var t=e(this,"target"),r=t.replaceRoute||t.replaceWith;return r.apply(t,arguments)},replaceWith:function(){return this.replaceRoute.apply(this,arguments)}})}(),function(){var e=Ember.get,t=Ember.set;Ember.View.reopen({init:function(){t(this,"_outlets",{}),this._super()},connectOutlet:function(r,n){if(this._pendingDisconnections&&delete this._pendingDisconnections[r],this._hasEquivalentView(r,n))return n.destroy(),void 0;var i=e(this,"_outlets"),o=e(this,"container"),a=o&&o.lookup("router:main"),s=e(n,"renderedName");t(i,r,n),a&&s&&a._connectActiveView(s,n)},_hasEquivalentView:function(t,r){var n=e(this,"_outlets."+t);return n&&n.constructor===r.constructor&&n.get("template")===r.get("template")&&n.get("context")===r.get("context")},disconnectOutlet:function(e){this._pendingDisconnections||(this._pendingDisconnections={}),this._pendingDisconnections[e]=!0,Ember.run.once(this,"_finishDisconnections")},_finishDisconnections:function(){if(!this.isDestroyed){var r=e(this,"_outlets"),n=this._pendingDisconnections;this._pendingDisconnections=null;for(var i in n)t(r,i,null)}}})}(),function(){var e=Ember.run.queues,t=Ember.ArrayPolyfills.indexOf;e.splice(t.call(e,"actions")+1,0,"routerTransitions")}(),function(){Ember.get,Ember.set;Ember.Location={create:function(e){var t=e&&e.implementation,r=this.implementations[t];return r.create.apply(r,arguments)},registerImplementation:function(e,t){this.implementations[e]=t},implementations:{},_location:window.location,_getHash:function(){var e=(this._location||this.location).href,t=e.indexOf("#");return-1===t?"":e.substr(t)}}}(),function(){var e=Ember.get,t=Ember.set;Ember.NoneLocation=Ember.Object.extend({implementation:"none",path:"",getURL:function(){return e(this,"path")},setURL:function(e){t(this,"path",e)},onUpdateURL:function(e){this.updateCallback=e},handleURL:function(e){t(this,"path",e),this.updateCallback(e)},formatURL:function(e){return e}})}(),function(){var e=Ember.get,t=Ember.set;Ember.HashLocation=Ember.Object.extend({implementation:"hash",init:function(){t(this,"location",e(this,"_location")||window.location)},getHash:Ember.Location._getHash,getURL:function(){return this.getHash().substr(1)},setURL:function(r){e(this,"location").hash=r,t(this,"lastSetURL",r)},replaceURL:function(r){e(this,"location").replace("#"+r),t(this,"lastSetURL",r)},onUpdateURL:function(r){var n=this,i=Ember.guidFor(this);Ember.$(window).on("hashchange.ember-location-"+i,function(){Ember.run(function(){var i=n.getURL();e(n,"lastSetURL")!==i&&(t(n,"lastSetURL",null),r(i))})})},formatURL:function(e){return"#"+e},willDestroy:function(){var e=Ember.guidFor(this);Ember.$(window).off("hashchange.ember-location-"+e)}})}(),function(){var e=Ember.get,t=Ember.set,r=!1,n=window.history&&"state"in window.history;Ember.HistoryLocation=Ember.Object.extend({implementation:"history",init:function(){t(this,"location",e(this,"location")||window.location),t(this,"baseURL",Ember.$("base").attr("href")||"")},initState:function(){t(this,"history",e(this,"history")||window.history),this.replaceState(this.formatURL(this.getURL()))},rootURL:"/",getURL:function(){var t=e(this,"rootURL"),r=e(this,"location"),n=r.pathname,i=e(this,"baseURL");t=t.replace(/\/$/,""),i=i.replace(/\/$/,"");var o=n.replace(i,"").replace(t,"");return o},setURL:function(e){var t=this.getState();e=this.formatURL(e),t&&t.path===e||this.pushState(e)},replaceURL:function(e){var t=this.getState();e=this.formatURL(e),t&&t.path===e||this.replaceState(e)},getState:function(){return n?e(this,"history").state:this._historyState},pushState:function(t){var r={path:t};e(this,"history").pushState(r,null,t),n||(this._historyState=r),this._previousURL=this.getURL()},replaceState:function(t){var r={path:t};e(this,"history").replaceState(r,null,t),n||(this._historyState=r),this._previousURL=this.getURL()},onUpdateURL:function(e){var t=Ember.guidFor(this),n=this;Ember.$(window).on("popstate.ember-location-"+t,function(){(r||(r=!0,n.getURL()!==n._previousURL))&&e(n.getURL())})},formatURL:function(t){var r=e(this,"rootURL"),n=e(this,"baseURL");return""!==t?(r=r.replace(/\/$/,""),n=n.replace(/\/$/,"")):n.match(/^\//)&&r.match(/^\//)&&(n=n.replace(/\/$/,"")),n+r+t},willDestroy:function(){var e=Ember.guidFor(this);Ember.$(window).off("popstate.ember-location-"+e)}})}(),function(){{var e=(Ember.get,Ember.set),t=Ember.HistoryLocation,r=Ember.HashLocation,n=Ember.NoneLocation,i=Ember.Location;Ember.AutoLocation={cancelRouterSetup:!1,rootURL:"/",_window:window,_location:window.location,_history:window.history,_HistoryLocation:t,_HashLocation:r,_NoneLocation:n,_getOrigin:function(){var e=this._location,t=e.origin;return t||(t=e.protocol+"//"+e.hostname,e.port&&(t+=":"+e.port)),t},_getSupportsHistory:function(){var e=this._window.navigator.userAgent;return-1!==e.indexOf("Android 2")&&-1!==e.indexOf("Mobile Safari")&&-1===e.indexOf("Chrome")?!1:!!(this._history&&"pushState"in this._history)},_getSupportsHashChange:function(){var e=this._window,t=e.document.documentMode;return"onhashchange"in e&&(void 0===t||t>7)},_replacePath:function(e){this._location.replace(this._getOrigin()+e)},_getRootURL:function(){return this.rootURL},_getPath:function(){var e=this._location.pathname;return"/"!==e.charAt(0)&&(e="/"+e),e},_getHash:i._getHash,_getQuery:function(){return this._location.search},_getFullPath:function(){return this._getPath()+this._getQuery()+this._getHash()},_getHistoryPath:function(){{var e,t,r=this._getRootURL(),n=this._getPath(),i=this._getHash(),o=this._getQuery();n.indexOf(r)}return"#/"===i.substr(0,2)?(t=i.substr(1).split("#"),e=t.shift(),"/"===n.slice(-1)&&(e=e.substr(1)),n+=e,n+=o,t.length&&(n+="#"+t.join("#"))):(n+=o,n+=i),n},_getHashPath:function(){var e=this._getRootURL(),t=e,r=this._getHistoryPath(),n=r.substr(e.length);return""!==n&&("/"!==n.charAt(0)&&(n="/"+n),t+="#"+n),t},create:function(t){t&&t.rootURL&&(this.rootURL=t.rootURL);var r,n,i=!1,o=this._NoneLocation,a=this._getFullPath();this._getSupportsHistory()?(r=this._getHistoryPath(),a===r?o=this._HistoryLocation:(i=!0,this._replacePath(r))):this._getSupportsHashChange()&&(n=this._getHashPath(),a===n||"/"===a&&"/#/"===n?o=this._HashLocation:(i=!0,this._replacePath(n)));var s=o.create.apply(o,arguments);return i&&e(s,"cancelRouterSetup",!0),s}}}}(),function(){function e(t,r,n,i){var o,a=t.name,s=t.incoming,u=t.incomingNames,l=u.length;if(n||(n={}),i||(i=[]),!n.hasOwnProperty(a)){for(i.push(a),n[a]=!0,o=0;l>o;o++)e(s[u[o]],r,n,i);r(t,i),i.pop()}}function t(){this.names=[],this.vertices={}}t.prototype.add=function(e){if(e){if(this.vertices.hasOwnProperty(e))return this.vertices[e];var t={name:e,incoming:{},incomingNames:[],hasOutgoing:!1,value:null};return this.vertices[e]=t,this.names.push(e),t}},t.prototype.map=function(e,t){this.add(e).value=t},t.prototype.addEdge=function(t,r){function n(e,t){if(e.name===r)throw new Ember.Error("cycle detected: "+r+" <- "+t.join(" <- "))}if(t&&r&&t!==r){var i=this.add(t),o=this.add(r);o.incoming.hasOwnProperty(t)||(e(i,n),i.hasOutgoing=!0,o.incoming[t]=i,o.incomingNames.push(t))}},t.prototype.topsort=function(t){var r,n,i={},o=this.vertices,a=this.names,s=a.length;for(r=0;s>r;r++)n=o[a[r]],n.hasOutgoing||e(n,t,i)},t.prototype.addEdges=function(e,t,r,n){var i;if(this.map(e,t),r)if("string"==typeof r)this.addEdge(e,r);else for(i=0;i<r.length;i++)this.addEdge(e,r[i]);if(n)if("string"==typeof n)this.addEdge(n,e);else for(i=0;i<n.length;i++)this.addEdge(n[i],e)},Ember.DAG=t}(),function(){var e=Ember.get,t=Ember.String.classify,r=Ember.String.capitalize,n=Ember.String.decamelize;Ember.Resolver=Ember.Object.extend({namespace:null,normalize:function(){throw new Error("Invalid call to `resolver.normalize(fullName)`. Please override the 'normalize' method in subclass of `Ember.AbstractResolver` to prevent falling through to this error.")},resolve:function(){throw new Error("Invalid call to `resolver.resolve(parsedName)`. Please override the 'resolve' method in subclass of `Ember.AbstractResolver` to prevent falling through to this error.")},parseName:function(){throw new Error("Invalid call to `resolver.resolveByType(parsedName)`. Please override the 'resolveByType' method in subclass of `Ember.AbstractResolver` to prevent falling through to this error.")},lookupDescription:function(){throw new Error("Invalid call to `resolver.lookupDescription(fullName)`. Please override the 'lookupDescription' method in subclass of `Ember.AbstractResolver` to prevent falling through to this error.")},makeToString:function(){throw new Error("Invalid call to `resolver.makeToString(factory, fullName)`. Please override the 'makeToString' method in subclass of `Ember.AbstractResolver` to prevent falling through to this error.")
19
+ },resolveOther:function(){throw new Error("Invalid call to `resolver.resolveDefault(parsedName)`. Please override the 'resolveDefault' method in subclass of `Ember.AbstractResolver` to prevent falling through to this error.")}}),Ember.DefaultResolver=Ember.Object.extend({namespace:null,normalize:function(e){var t=e.split(":",2),r=t[0],n=t[1];if("template"!==r){var i=n;return i.indexOf(".")>-1&&(i=i.replace(/\.(.)/g,function(e){return e.charAt(1).toUpperCase()})),n.indexOf("_")>-1&&(i=i.replace(/_(.)/g,function(e){return e.charAt(1).toUpperCase()})),r+":"+i}return e},resolve:function(e){var t=this.parseName(e),r=t.resolveMethodName;if(!t.name||!t.type)throw new TypeError("Invalid fullName: `"+e+"`, must be of the form `type:name` ");if(this[r]){var n=this[r](t);if(n)return n}return this.resolveOther(t)},parseName:function(n){var i=n.split(":"),o=i[0],a=i[1],s=a,u=e(this,"namespace"),l=u;if("template"!==o&&-1!==s.indexOf("/")){var c=s.split("/");s=c[c.length-1];var h=r(c.slice(0,-1).join("."));l=Ember.Namespace.byName(h)}return{fullName:n,type:o,fullNameWithoutType:a,name:s,root:l,resolveMethodName:"resolve"+t(o)}},lookupDescription:function(e){var r=this.parseName(e);if("template"===r.type)return"template at "+r.fullNameWithoutType.replace(/\./g,"/");var n=r.root+"."+t(r.name);return"model"!==r.type&&(n+=t(r.type)),n},makeToString:function(e){return e.toString()},useRouterNaming:function(e){e.name=e.name.replace(/\./g,"_"),"basic"===e.name&&(e.name="")},resolveTemplate:function(e){var t=e.fullNameWithoutType.replace(/\./g,"/");return Ember.TEMPLATES[t]?Ember.TEMPLATES[t]:(t=n(t),Ember.TEMPLATES[t]?Ember.TEMPLATES[t]:void 0)},resolveView:function(e){return this.useRouterNaming(e),this.resolveOther(e)},resolveController:function(e){return this.useRouterNaming(e),this.resolveOther(e)},resolveRoute:function(e){return this.useRouterNaming(e),this.resolveOther(e)},resolveModel:function(r){var n=t(r.name),i=e(r.root,n);return i?i:void 0},resolveHelper:function(e){return this.resolveOther(e)||Ember.Handlebars.helpers[e.fullNameWithoutType]},resolveOther:function(r){var n=t(r.name)+t(r.type),i=e(r.root,n);return i?i:void 0}})}(),function(){function e(e){this._container=e}function t(e){function t(e){return n.resolve(e)}e.get("resolver");var r=e.get("resolver")||e.get("Resolver")||Ember.DefaultResolver,n=r.create({namespace:e});return t.describe=function(e){return n.lookupDescription(e)},t.makeToString=function(e,t){return n.makeToString(e,t)},t.normalize=function(e){return n.normalize?n.normalize(e):e},t.__resolver__=n,t}var r=Ember.get,n=Ember.set;e.deprecate=function(e){return function(){var t=this._container;return t[e].apply(t,arguments)}},e.prototype={_container:null,lookup:e.deprecate("lookup"),resolve:e.deprecate("resolve"),register:e.deprecate("register")};var i=Ember.Application=Ember.Namespace.extend(Ember.DeferredMixin,{rootElement:"body",eventDispatcher:null,customEvents:null,_readinessDeferrals:1,init:function(){if(this.$||(this.$=Ember.$),this.__container__=this.buildContainer(),this.Router=this.defaultRouter(),this._super(),this.scheduleInitialize(),Ember.libraries.registerCoreLibrary("Handlebars",Ember.Handlebars.VERSION),Ember.libraries.registerCoreLibrary("jQuery",Ember.$().jquery),Ember.LOG_VERSION){Ember.LOG_VERSION=!1;var e=Math.max.apply(this,Ember.A(Ember.libraries).mapBy("name.length"));Ember.libraries.each(function(t){new Array(e-t.length+1).join(" ")})}},buildContainer:function(){var e=this.__container__=i.buildContainer(this);return e},defaultRouter:function(){if(this.Router!==!1){var e=this.__container__;return this.Router&&(e.unregister("router:main"),e.register("router:main",this.Router)),e.lookupFactory("router:main")}},scheduleInitialize:function(){var e=this;!this.$||this.$.isReady?Ember.run.schedule("actions",e,"_initialize"):this.$().ready(function(){Ember.run(e,"_initialize")})},deferReadiness:function(){this._readinessDeferrals++},advanceReadiness:function(){this._readinessDeferrals--,0===this._readinessDeferrals&&Ember.run.once(this,this.didBecomeReady)},register:function(){var e=this.__container__;e.register.apply(e,arguments)},inject:function(){var e=this.__container__;e.injection.apply(e,arguments)},initialize:function(){},_initialize:function(){if(!this.isDestroyed){if(this.Router){var e=this.__container__;e.unregister("router:main"),e.register("router:main",this.Router)}return this.runInitializers(),Ember.runLoadHooks("application",this),this.advanceReadiness(),this}},reset:function(){function e(){var e=this.__container__.lookup("router:main");e.reset(),Ember.run(this.__container__,"destroy"),this.buildContainer(),Ember.run.schedule("actions",this,function(){this._initialize()})}this._readinessDeferrals=1,Ember.run.join(this,e)},runInitializers:function(){var e,t,n=r(this.constructor,"initializers"),i=this.__container__,o=new Ember.DAG,a=this;for(e in n)t=n[e],o.addEdges(t.name,t.initialize,t.before,t.after);o.topsort(function(e){var t=e.value;t(i,a)})},didBecomeReady:function(){this.setupEventDispatcher(),this.ready(),this.startRouting(),Ember.testing||(Ember.Namespace.processAll(),Ember.BOOTED=!0),this.resolve(this)},setupEventDispatcher:function(){var e=r(this,"customEvents"),t=r(this,"rootElement"),i=this.__container__.lookup("event_dispatcher:main");n(this,"eventDispatcher",i),i.setup(e,t)},startRouting:function(){var e=this.__container__.lookup("router:main");e&&e.startRouting()},handleURL:function(e){var t=this.__container__.lookup("router:main");t.handleURL(e)},ready:Ember.K,resolver:null,Resolver:null,willDestroy:function(){Ember.BOOTED=!1,this.__container__.lookup("router:main").reset(),this.__container__.destroy()},initializer:function(e){this.constructor.initializer(e)}});Ember.Application.reopenClass({initializers:{},initializer:function(e){void 0!==this.superclass.initializers&&this.superclass.initializers===this.initializers&&this.reopenClass({initializers:Ember.create(this.initializers)}),this.initializers[e.name]=e},buildContainer:function(r){var n=new Ember.Container;return Ember.Container.defaultContainer=new e(n),n.set=Ember.set,n.resolver=t(r),n.normalize=n.resolver.normalize,n.describe=n.resolver.describe,n.makeToString=n.resolver.makeToString,n.optionsForType("component",{singleton:!1}),n.optionsForType("view",{singleton:!1}),n.optionsForType("template",{instantiate:!1}),n.optionsForType("helper",{instantiate:!1}),n.register("application:main",r,{instantiate:!1}),n.register("controller:basic",Ember.Controller,{instantiate:!1}),n.register("controller:object",Ember.ObjectController,{instantiate:!1}),n.register("controller:array",Ember.ArrayController,{instantiate:!1}),n.register("route:basic",Ember.Route,{instantiate:!1}),n.register("event_dispatcher:main",Ember.EventDispatcher),n.register("router:main",Ember.Router),n.injection("router:main","namespace","application:main"),n.register("location:auto",Ember.AutoLocation),n.register("location:hash",Ember.HashLocation),n.register("location:history",Ember.HistoryLocation),n.register("location:none",Ember.NoneLocation),n.injection("controller","target","router:main"),n.injection("controller","namespace","application:main"),n.injection("route","router","router:main"),n.injection("location","rootURL","-location-setting:root-url"),n.register("resolver-for-debugging:main",n.resolver.__resolver__,{instantiate:!1}),n.injection("container-debug-adapter:main","resolver","resolver-for-debugging:main"),n.injection("data-adapter:main","containerDebugAdapter","container-debug-adapter:main"),n.register("container-debug-adapter:main",Ember.ContainerDebugAdapter),n}}),Ember.runLoadHooks("Ember.Application",Ember.Application)}(),function(){function e(e,t,r){var n,i,o,a=[];for(i=0,o=r.length;o>i;i++)n=r[i],-1===n.indexOf(":")&&(n="controller:"+n),t.has(n)||a.push(n);if(a.length)throw new Ember.Error(Ember.inspect(e)+" needs [ "+a.join(", ")+" ] but "+(a.length>1?"they":"it")+" could not be found")}var t=Ember.get,r=(Ember.set,Ember.computed(function(){var e=this;return{needs:t(e,"needs"),container:t(e,"container"),unknownProperty:function(t){var r,n,i,o=this.needs;for(n=0,i=o.length;i>n;n++)if(r=o[n],r===t)return this.container.lookup("controller:"+t);var a=Ember.inspect(e)+"#needs does not include `"+t+"`. To access the "+t+" controller from "+Ember.inspect(e)+", "+Ember.inspect(e)+" should have a `needs` property that is an array of the controllers it has access to.";throw new ReferenceError(a)},setUnknownProperty:function(t){throw new Error("You cannot overwrite the value of `controllers."+t+"` of "+Ember.inspect(e))}}}));Ember.ControllerMixin.reopen({concatenatedProperties:["needs"],needs:[],init:function(){var r=t(this,"needs"),n=t(r,"length");n>0&&(this.container&&e(this,this.container,r),t(this,"controllers")),this._super.apply(this,arguments)},controllerFor:function(e){return Ember.controllerFor(t(this,"container"),e)},controllers:r})}(),function(){Ember.ContainerDebugAdapter=Ember.Object.extend({container:null,resolver:null,canCatalogEntriesByType:function(e){return"model"===e||"template"===e?!1:!0},catalogEntriesByType:function(e){var t=Ember.A(Ember.Namespace.NAMESPACES),r=Ember.A(),n=new RegExp(Ember.String.classify(e)+"$");return t.forEach(function(e){if(e!==Ember)for(var t in e)if(e.hasOwnProperty(t)&&n.test(t)){var i=e[t];"class"===Ember.typeOf(i)&&r.push(Ember.String.dasherize(t.replace(n,"")))}}),r}})}(),function(){Ember.DataAdapter=Ember.Object.extend({init:function(){this._super(),this.releaseMethods=Ember.A()},container:null,containerDebugAdapter:void 0,attributeLimit:3,releaseMethods:Ember.A(),getFilters:function(){return Ember.A()},watchModelTypes:function(e,t){var r,n=this.getModelTypes(),i=this,o=Ember.A();r=n.map(function(e){var r=e.klass,n=i.wrapModelType(r,e.name);return o.push(i.observeModelType(r,t)),n}),e(r);var a=function(){o.forEach(function(e){e()}),i.releaseMethods.removeObject(a)};return this.releaseMethods.pushObject(a),a},_nameToClass:function(e){return"string"==typeof e&&(e=this.container.lookupFactory("model:"+e)),e},watchRecords:function(e,t,r,n){var i,o=this,a=Ember.A(),s=this.getRecords(e),u=function(e){r([e])},l=s.map(function(e){return a.push(o.observeRecord(e,u)),o.wrapRecord(e)}),c=function(e,r,i,s){for(var l=r;r+s>l;l++){var c=e.objectAt(l),h=o.wrapRecord(c);a.push(o.observeRecord(c,u)),t([h])}i&&n(r,i)},h={didChange:c,willChange:Ember.K};return s.addArrayObserver(o,h),i=function(){a.forEach(function(e){e()}),s.removeArrayObserver(o,h),o.releaseMethods.removeObject(i)},t(l),this.releaseMethods.pushObject(i),i},willDestroy:function(){this._super(),this.releaseMethods.forEach(function(e){e()})},detect:function(){return!1},columnsForType:function(){return Ember.A()},observeModelType:function(e,t){var r=this,n=this.getRecords(e),i=function(){t([r.wrapModelType(e)])},o={didChange:function(){Ember.run.scheduleOnce("actions",this,i)},willChange:Ember.K};n.addArrayObserver(this,o);var a=function(){n.removeArrayObserver(r,o)};return a},wrapModelType:function(e,t){var r,n=this.getRecords(e);return r={name:t||e.toString(),count:Ember.get(n,"length"),columns:this.columnsForType(e),object:e}},getModelTypes:function(){var e,t=this,r=this.get("containerDebugAdapter");return e=r.canCatalogEntriesByType("model")?r.catalogEntriesByType("model"):this._getObjectsOnNamespaces(),e.map(function(e){return{klass:t._nameToClass(e),name:e}}).filter(function(e){return t.detect(e.klass)})},_getObjectsOnNamespaces:function(){var e=Ember.A(Ember.Namespace.NAMESPACES),t=Ember.A();return e.forEach(function(e){for(var r in e)if(e.hasOwnProperty(r)){var n=Ember.String.dasherize(r);e instanceof Ember.Application||!e.toString()||(n=e+"/"+n),t.push(n)}}),t},getRecords:function(){return Ember.A()},wrapRecord:function(e){var t={object:e};return t.columnValues=this.getRecordColumnValues(e),t.searchKeywords=this.getRecordKeywords(e),t.filterValues=this.getRecordFilterValues(e),t.color=this.getRecordColor(e),t},getRecordColumnValues:function(){return{}},getRecordKeywords:function(){return Ember.A()},getRecordFilterValues:function(){return{}},getRecordColor:function(){return null},observeRecord:function(){return function(){}}})}()}(),"undefined"==typeof location||"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname||Ember.Logger.warn("You are running a production build of Ember on localhost and won't receive detailed error messages. If you want full error messages please use the non-minified build provided on the Ember website.");
admin/views/slider-panel/js/handlebars.min.js ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ handlebars v1.3.0
3
+ Copyright (C) 2011 by Yehuda Katz
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
18
+ THE SOFTWARE.
19
+ @license
20
+ */
21
+ var Handlebars=function(){var r=function(){"use strict";function n(n){this.string=n}return n.prototype.toString=function(){return""+this.string},n}(),t=function(n){"use strict";function h(n){return e[n]||"&amp;"}function c(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}function l(n){return n instanceof f?n.toString():!n&&n!==0?"":(n=""+n,!s.test(n))?n:n.replace(o,h)}function a(n){return n||n===0?u(n)&&n.length===0?!0:!1:!0}var t={},f=n,e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},o=/[&<>"'`]/g,s=/[&<>"'`]/,i,r,u;return t.extend=c,i=Object.prototype.toString,t.toString=i,r=function(n){return typeof n=="function"},r(/x/)&&(r=function(n){return typeof n=="function"&&i.call(n)==="[object Function]"}),t.isFunction=r,u=Array.isArray||function(n){return n&&typeof n=="object"?i.call(n)==="[object Array]":!1},t.isArray=u,t.escapeExpression=l,t.isEmpty=a,t}(r),n=function(){"use strict";function t(t,i){var u,f,r;for(i&&i.firstLine&&(u=i.firstLine,t+=" - "+u+":"+i.firstColumn),f=Error.prototype.constructor.call(this,t),r=0;r<n.length;r++)this[n[r]]=f[n[r]];u&&(this.lineNumber=u,this.column=i.firstColumn)}var n=["description","fileName","lineNumber","message","name","number","stack"];return t.prototype=new Error,t}(),i=function(n,t){"use strict";function e(n,t){this.helpers=n||{},this.partials=t||{},p(this)}function p(n){n.registerHelper("helperMissing",function(n){if(arguments.length===2)return undefined;throw new s("Missing helper: '"+n+"'");}),n.registerHelper("blockHelperMissing",function(t,i){var r=i.inverse||function(){},u=i.fn;return f(t)&&(t=t.call(this)),t===!0?u(this):t===!1||t==null?r(this):l(t)?t.length>0?n.helpers.each(t,i):r(this):u(t)}),n.registerHelper("each",function(n,t){var s=t.fn,c=t.inverse,r=0,u="",i,h,e;if(f(n)&&(n=n.call(this)),t.data&&(i=o(t.data)),n&&typeof n=="object")if(l(n))for(h=n.length;r<h;r++)i&&(i.index=r,i.first=r===0,i.last=r===n.length-1),u=u+s(n[r],{data:i});else for(e in n)n.hasOwnProperty(e)&&(i&&(i.key=e,i.index=r,i.first=r===0),u=u+s(n[e],{data:i}),r++);return r===0&&(u=c(this)),u}),n.registerHelper("if",function(n,t){return f(n)&&(n=n.call(this)),(t.hash.includeZero||n)&&!r.isEmpty(n)?t.fn(this):t.inverse(this)}),n.registerHelper("unless",function(t,i){return n.helpers["if"].call(this,t,{fn:i.inverse,inverse:i.fn,hash:i.hash})}),n.registerHelper("with",function(n,t){return f(n)&&(n=n.call(this)),r.isEmpty(n)?void 0:t.fn(n)}),n.registerHelper("log",function(t,i){var r=i.data&&i.data.level!=null?parseInt(i.data.level,10):1;n.log(r,t)})}function y(n,t){u.log(n,t)}var i={},r=n,s=t,h,c,u,o;i.VERSION="1.3.0",h=4,i.COMPILER_REVISION=h,c={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:">= 1.0.0"},i.REVISION_CHANGES=c;var l=r.isArray,f=r.isFunction,a=r.toString,v="[object Object]";return i.HandlebarsEnvironment=e,e.prototype={constructor:e,logger:u,log:y,registerHelper:function(n,t,i){if(a.call(n)===v){if(i||t)throw new s("Arg not supported with multiple helpers");r.extend(this.helpers,n)}else i&&(t.not=i),this.helpers[n]=t},registerPartial:function(n,t){a.call(n)===v?r.extend(this.partials,n):this.partials[n]=t}},u={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(n,t){if(u.level<=n){var i=u.methodMap[n];typeof console!="undefined"&&console[i]&&console[i].call(console,t)}}},i.logger=u,i.log=y,o=function(n){var t={};return r.extend(t,n),t},i.createFrame=o,i}(t,n),f=function(n,t,i){"use strict";function h(n){var t=n&&n[0]||1,i=s,r,f;if(t!==i)if(t<i){r=o[i],f=o[t];throw new u("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+r+") or downgrade your runtime to an older version ("+f+").");}else throw new u("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+n[1]+").");}function c(n,t){if(!t)throw new u("No environment passed to template");var r=function(n,i,r,f,e,o){var s=t.VM.invokePartial.apply(this,arguments),h;if(s!=null)return s;if(t.compile)return h={helpers:f,partials:e,data:o},e[i]=t.compile(n,{data:o!==undefined},t),e[i](r,h);throw new u("The partial "+i+" could not be compiled when running in runtime-only mode");},i={escapeExpression:f.escapeExpression,invokePartial:r,programs:[],program:function(n,t,i){var r=this.programs[n];return i?r=e(n,t,i):r||(r=this.programs[n]=e(n,t)),r},merge:function(n,t){var i=n||t;return n&&t&&n!==t&&(i={},f.extend(i,t),f.extend(i,n)),i},programWithDepth:t.VM.programWithDepth,noop:t.VM.noop,compilerInfo:null};return function(r,u){var f,e,o,s;return u=u||{},f=u.partial?u:t,u.partial||(e=u.helpers,o=u.partials),s=n.call(i,f,r,e,o,u.data),u.partial||t.VM.checkRevision(i.compilerInfo),s}}function l(n,t,i){var u=Array.prototype.slice.call(arguments,3),r=function(n,r){return r=r||{},t.apply(this,[n,r.data||i].concat(u))};return r.program=n,r.depth=u.length,r}function e(n,t,i){var r=function(n,r){return r=r||{},t(n,r.data||i)};return r.program=n,r.depth=0,r}function a(n,t,i,r,f,e){var o={partial:!0,helpers:r,partials:f,data:e};if(n===undefined)throw new u("The partial "+t+" could not be found");else if(n instanceof Function)return n(i,o)}function v(){return""}var r={},f=n,u=t,s=i.COMPILER_REVISION,o=i.REVISION_CHANGES;return r.checkRevision=h,r.template=c,r.programWithDepth=l,r.program=e,r.invokePartial=a,r.noop=v,r}(t,n,i),e=function(n,t,i,r,u){"use strict";var f=n,c=t,l=i,e=r,o=u,s=function(){var n=new f.HandlebarsEnvironment;return e.extend(n,f),n.SafeString=c,n.Exception=l,n.Utils=e,n.VM=o,n.template=function(t){return o.template(t,n)},n},h=s();return h.create=s,h}(i,r,n,t,f),u=function(n){"use strict";function t(n){n=n||{},this.firstLine=n.first_line,this.firstColumn=n.first_column,this.lastColumn=n.last_column,this.lastLine=n.last_line}var r=n,i={ProgramNode:function(n,r,u,f){var o,e;arguments.length===3?(f=u,u=null):arguments.length===2&&(f=r,r=null),t.call(this,f),this.type="program",this.statements=n,this.strip={},u?(e=u[0],e?(o={first_line:e.firstLine,last_line:e.lastLine,last_column:e.lastColumn,first_column:e.firstColumn},this.inverse=new i.ProgramNode(u,r,o)):this.inverse=new i.ProgramNode(u,r),this.strip.right=r.left):r&&(this.strip.left=r.right)},MustacheNode:function(n,r,u,f,e){if(t.call(this,e),this.type="mustache",this.strip=f,u!=null&&u.charAt){var o=u.charAt(3)||u.charAt(2);this.escaped=o!=="{"&&o!=="&"}else this.escaped=!!u;this.sexpr=n instanceof i.SexprNode?n:new i.SexprNode(n,r),this.sexpr.isRoot=!0,this.id=this.sexpr.id,this.params=this.sexpr.params,this.hash=this.sexpr.hash,this.eligibleHelper=this.sexpr.eligibleHelper,this.isHelper=this.sexpr.isHelper},SexprNode:function(n,i,r){t.call(this,r),this.type="sexpr",this.hash=i;var u=this.id=n[0],f=this.params=n.slice(1),e=this.eligibleHelper=u.isSimple;this.isHelper=e&&(f.length||i)},PartialNode:function(n,i,r,u){t.call(this,u),this.type="partial",this.partialName=n,this.context=i,this.strip=r},BlockNode:function(n,i,u,f,e){if(t.call(this,e),n.sexpr.id.original!==f.path.original)throw new r(n.sexpr.id.original+" doesn't match "+f.path.original,this);this.type="block",this.mustache=n,this.program=i,this.inverse=u,this.strip={left:n.strip.left,right:f.strip.right},(i||u).strip.left=n.strip.right,(u||i).strip.right=f.strip.left,u&&!i&&(this.isInverse=!0)},ContentNode:function(n,i){t.call(this,i),this.type="content",this.string=n},HashNode:function(n,i){t.call(this,i),this.type="hash",this.pairs=n},IdNode:function(n,i){var f,h,u;t.call(this,i),this.type="ID";var o="",e=[],s=0;for(f=0,h=n.length;f<h;f++)if(u=n[f].part,o+=(n[f].separator||"")+u,u===".."||u==="."||u==="this")if(e.length>0)throw new r("Invalid path: "+o,this);else u===".."?s++:this.isScoped=!0;else e.push(u);this.original=o,this.parts=e,this.string=e.join("."),this.depth=s,this.isSimple=n.length===1&&!this.isScoped&&s===0,this.stringModeValue=this.string},PartialNameNode:function(n,i){t.call(this,i),this.type="PARTIAL_NAME",this.name=n.original},DataNode:function(n,i){t.call(this,i),this.type="DATA",this.id=n},StringNode:function(n,i){t.call(this,i),this.type="STRING",this.original=this.string=this.stringModeValue=n},IntegerNode:function(n,i){t.call(this,i),this.type="INTEGER",this.original=this.integer=n,this.stringModeValue=Number(n)},BooleanNode:function(n,i){t.call(this,i),this.type="BOOLEAN",this.bool=n,this.stringModeValue=n==="true"},CommentNode:function(n,i){t.call(this,i),this.type="comment",this.comment=n}};return i}(n),o=function(){"use strict";return function(){function n(n,t){return{left:n.charAt(2)==="~",right:t.charAt(0)==="~"||t.charAt(1)==="~"}}function i(){this.yy={}}var t={trace:function(){},yy:{},symbols_:{error:2,root:3,statements:4,EOF:5,program:6,simpleInverse:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,sexpr:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,CLOSE_UNESCAPED:24,OPEN_PARTIAL:25,partialName:26,partial_option0:27,sexpr_repetition0:28,sexpr_option0:29,dataName:30,param:31,STRING:32,INTEGER:33,BOOLEAN:34,OPEN_SEXPR:35,CLOSE_SEXPR:36,hash:37,hash_repetition_plus0:38,hashSegment:39,ID:40,EQUALS:41,DATA:42,pathSegments:43,SEP:44,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"CLOSE_UNESCAPED",25:"OPEN_PARTIAL",32:"STRING",33:"INTEGER",34:"BOOLEAN",35:"OPEN_SEXPR",36:"CLOSE_SEXPR",40:"ID",41:"EQUALS",42:"DATA",44:"SEP"},productions_:[0,[3,2],[3,1],[6,2],[6,3],[6,2],[6,1],[6,1],[6,0],[4,1],[4,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,4],[7,2],[17,3],[17,1],[31,1],[31,1],[31,1],[31,1],[31,1],[31,3],[37,1],[39,3],[26,1],[26,1],[26,1],[30,2],[21,1],[43,3],[43,1],[27,0],[27,1],[28,0],[28,2],[29,0],[29,1],[38,1],[38,2]],performAction:function(t,i,r,u,f,e){var o=e.length-1;switch(f){case 1:return new u.ProgramNode(e[o-1],this._$);case 2:return new u.ProgramNode([],this._$);case 3:this.$=new u.ProgramNode([],e[o-1],e[o],this._$);break;case 4:this.$=new u.ProgramNode(e[o-2],e[o-1],e[o],this._$);break;case 5:this.$=new u.ProgramNode(e[o-1],e[o],[],this._$);break;case 6:this.$=new u.ProgramNode(e[o],this._$);break;case 7:this.$=new u.ProgramNode([],this._$);break;case 8:this.$=new u.ProgramNode([],this._$);break;case 9:this.$=[e[o]];break;case 10:e[o-1].push(e[o]),this.$=e[o-1];break;case 11:this.$=new u.BlockNode(e[o-2],e[o-1].inverse,e[o-1],e[o],this._$);break;case 12:this.$=new u.BlockNode(e[o-2],e[o-1],e[o-1].inverse,e[o],this._$);break;case 13:this.$=e[o];break;case 14:this.$=e[o];break;case 15:this.$=new u.ContentNode(e[o],this._$);break;case 16:this.$=new u.CommentNode(e[o],this._$);break;case 17:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 18:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 19:this.$={path:e[o-1],strip:n(e[o-2],e[o])};break;case 20:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 21:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 22:this.$=new u.PartialNode(e[o-2],e[o-1],n(e[o-3],e[o]),this._$);break;case 23:this.$=n(e[o-1],e[o]);break;case 24:this.$=new u.SexprNode([e[o-2]].concat(e[o-1]),e[o],this._$);break;case 25:this.$=new u.SexprNode([e[o]],null,this._$);break;case 26:this.$=e[o];break;case 27:this.$=new u.StringNode(e[o],this._$);break;case 28:this.$=new u.IntegerNode(e[o],this._$);break;case 29:this.$=new u.BooleanNode(e[o],this._$);break;case 30:this.$=e[o];break;case 31:e[o-1].isHelper=!0,this.$=e[o-1];break;case 32:this.$=new u.HashNode(e[o],this._$);break;case 33:this.$=[e[o-2],e[o]];break;case 34:this.$=new u.PartialNameNode(e[o],this._$);break;case 35:this.$=new u.PartialNameNode(new u.StringNode(e[o],this._$),this._$);break;case 36:this.$=new u.PartialNameNode(new u.IntegerNode(e[o],this._$));break;case 37:this.$=new u.DataNode(e[o],this._$);break;case 38:this.$=new u.IdNode(e[o],this._$);break;case 39:e[o-2].push({part:e[o],separator:e[o-1]}),this.$=e[o-2];break;case 40:this.$=[{part:e[o]}];break;case 43:this.$=[];break;case 44:e[o-1].push(e[o]);break;case 47:this.$=[e[o]];break;case 48:e[o-1].push(e[o])}},table:[{3:1,4:2,5:[1,3],8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[3]},{5:[1,16],8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[2,2]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],25:[2,9]},{4:20,6:18,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{4:20,6:22,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],25:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],25:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],25:[2,15]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],25:[2,16]},{17:23,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:29,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:30,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:31,21:24,30:25,40:[1,28],42:[1,27],43:26},{21:33,26:32,32:[1,34],33:[1,35],40:[1,28],43:26},{1:[2,1]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],25:[2,10]},{10:36,20:[1,37]},{4:38,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,7],22:[1,13],23:[1,14],25:[1,15]},{7:39,8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,6],22:[1,13],23:[1,14],25:[1,15]},{17:23,18:[1,40],21:24,30:25,40:[1,28],42:[1,27],43:26},{10:41,20:[1,37]},{18:[1,42]},{18:[2,43],24:[2,43],28:43,32:[2,43],33:[2,43],34:[2,43],35:[2,43],36:[2,43],40:[2,43],42:[2,43]},{18:[2,25],24:[2,25],36:[2,25]},{18:[2,38],24:[2,38],32:[2,38],33:[2,38],34:[2,38],35:[2,38],36:[2,38],40:[2,38],42:[2,38],44:[1,44]},{21:45,40:[1,28],43:26},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],42:[2,40],44:[2,40]},{18:[1,46]},{18:[1,47]},{24:[1,48]},{18:[2,41],21:50,27:49,40:[1,28],43:26},{18:[2,34],40:[2,34]},{18:[2,35],40:[2,35]},{18:[2,36],40:[2,36]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],25:[2,11]},{21:51,40:[1,28],43:26},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,3],22:[1,13],23:[1,14],25:[1,15]},{4:52,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,5],22:[1,13],23:[1,14],25:[1,15]},{14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],25:[2,23]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],25:[2,12]},{14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],25:[2,18]},{18:[2,45],21:56,24:[2,45],29:53,30:60,31:54,32:[1,57],33:[1,58],34:[1,59],35:[1,61],36:[2,45],37:55,38:62,39:63,40:[1,64],42:[1,27],43:26},{40:[1,65]},{18:[2,37],24:[2,37],32:[2,37],33:[2,37],34:[2,37],35:[2,37],36:[2,37],40:[2,37],42:[2,37]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],25:[2,17]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],25:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],25:[2,21]},{18:[1,66]},{18:[2,42]},{18:[1,67]},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],25:[1,15]},{18:[2,24],24:[2,24],36:[2,24]},{18:[2,44],24:[2,44],32:[2,44],33:[2,44],34:[2,44],35:[2,44],36:[2,44],40:[2,44],42:[2,44]},{18:[2,46],24:[2,46],36:[2,46]},{18:[2,26],24:[2,26],32:[2,26],33:[2,26],34:[2,26],35:[2,26],36:[2,26],40:[2,26],42:[2,26]},{18:[2,27],24:[2,27],32:[2,27],33:[2,27],34:[2,27],35:[2,27],36:[2,27],40:[2,27],42:[2,27]},{18:[2,28],24:[2,28],32:[2,28],33:[2,28],34:[2,28],35:[2,28],36:[2,28],40:[2,28],42:[2,28]},{18:[2,29],24:[2,29],32:[2,29],33:[2,29],34:[2,29],35:[2,29],36:[2,29],40:[2,29],42:[2,29]},{18:[2,30],24:[2,30],32:[2,30],33:[2,30],34:[2,30],35:[2,30],36:[2,30],40:[2,30],42:[2,30]},{17:68,21:24,30:25,40:[1,28],42:[1,27],43:26},{18:[2,32],24:[2,32],36:[2,32],39:69,40:[1,70]},{18:[2,47],24:[2,47],36:[2,47],40:[2,47]},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],41:[1,71],42:[2,40],44:[2,40]},{18:[2,39],24:[2,39],32:[2,39],33:[2,39],34:[2,39],35:[2,39],36:[2,39],40:[2,39],42:[2,39],44:[2,39]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],25:[2,22]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],25:[2,19]},{36:[1,72]},{18:[2,48],24:[2,48],36:[2,48],40:[2,48]},{41:[1,71]},{21:56,30:60,31:73,32:[1,57],33:[1,58],34:[1,59],35:[1,61],40:[1,28],42:[1,27],43:26},{18:[2,31],24:[2,31],32:[2,31],33:[2,31],34:[2,31],35:[2,31],36:[2,31],40:[2,31],42:[2,31]},{18:[2,33],24:[2,33],36:[2,33],40:[2,33]}],defaultActions:{3:[2,2],16:[2,1],50:[2,42]},parseError:function(n){throw new Error(n);},parse:function(n){function it(){var n;return n=k.lexer.lex()||1,typeof n!="number"&&(n=k.symbols_[n]||n),n}var k=this,r=[0],f=[null],t=[],h=this.table,d="",c=0,g=0,y=0,l,nt,i,p,o,u,w,s,a,e,tt,v,b;for(this.lexer.setInput(n),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc=="undefined"&&(this.lexer.yylloc={}),l=this.lexer.yylloc,t.push(l),nt=this.lexer.options&&this.lexer.options.ranges,typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError),s={};;){if(o=r[r.length-1],this.defaultActions[o]?u=this.defaultActions[o]:((i===null||typeof i=="undefined")&&(i=it()),u=h[o]&&h[o][i]),(typeof u=="undefined"||!u.length||!u[0])&&(b="",!y)){v=[];for(a in h[o])this.terminals_[a]&&a>2&&v.push("'"+this.terminals_[a]+"'");b=this.lexer.showPosition?"Parse error on line "+(c+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[i]||i)+"'":"Parse error on line "+(c+1)+": Unexpected "+(i==1?"end of input":"'"+(this.terminals_[i]||i)+"'"),this.parseError(b,{text:this.lexer.match,token:this.terminals_[i]||i,line:this.lexer.yylineno,loc:l,expected:v})}if(u[0]instanceof Array&&u.length>1)throw new Error("Parse Error: multiple actions possible at state: "+o+", token: "+i);switch(u[0]){case 1:r.push(i),f.push(this.lexer.yytext),t.push(this.lexer.yylloc),r.push(u[1]),i=null,p?(i=p,p=null):(g=this.lexer.yyleng,d=this.lexer.yytext,c=this.lexer.yylineno,l=this.lexer.yylloc,y>0&&y--);break;case 2:if(e=this.productions_[u[1]][1],s.$=f[f.length-e],s._$={first_line:t[t.length-(e||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(e||1)].first_column,last_column:t[t.length-1].last_column},nt&&(s._$.range=[t[t.length-(e||1)].range[0],t[t.length-1].range[1]]),w=this.performAction.call(s,d,g,c,this.yy,u[1],f,t),typeof w!="undefined")return w;e&&(r=r.slice(0,-2*e),f=f.slice(0,-1*e),t=t.slice(0,-1*e)),r.push(this.productions_[u[1]][0]),f.push(s.$),t.push(s._$),tt=h[r[r.length-2]][r[r.length-1]],r.push(tt);break;case 3:return!0}}return!0}},r=function(){var n={EOF:1,parseError:function(n,t){if(this.yy.parser)this.yy.parser.parseError(n,t);else throw new Error(n);},setInput:function(n){return this._input=n,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var n=this._input[0],t;return this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n,t=n.match(/(?:\r\n?|\n).*/g),t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},unput:function(n){var i=n.length,t=n.split(/(?:\r\n?|\n)/g),r,u;return this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i-1),this.offset-=i,r=this.match.split(/(?:\r\n?|\n)/g),this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),t.length-1&&(this.yylineno-=t.length-1),u=this.yylloc.range,this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:t?(t.length===r.length?this.yylloc.first_column:0)+r[r.length-t.length].length-t[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-i]),this},more:function(){return this._more=!0,this},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var n=this.pastInput(),t=new Array(n.length+1).join("-");return n+this.upcomingInput()+"\n"+t+"^"},next:function(){var f,n,r,e,t,u,i;if(this.done)return this.EOF;for(this._input||(this.done=!0),this._more||(this.yytext="",this.match=""),u=this._currentRules(),i=0;i<u.length;i++)if(r=this._input.match(this.rules[u[i]]),r&&(!n||r[0].length>n[0].length)&&(n=r,e=i,!this.options.flex))break;return n?(t=n[0].match(/(?:\r\n?|\n).*/g),t&&(this.yylineno+=t.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:t?t[t.length-1].length-t[t.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],f=this.performAction.call(this,this.yy,this,u[e],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)?f:void 0:this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var n=this.next();return typeof n!="undefined"?n:this.lex()},begin:function(n){this.conditionStack.push(n)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(n){this.begin(n)}};return n.options={},n.performAction=function(n,t,i,r){function u(n,i){return t.yytext=t.yytext.substr(n,t.yyleng-i)}var f=r;switch(i){case 0:if(t.yytext.slice(-2)==="\\\\"?(u(0,1),this.begin("mu")):t.yytext.slice(-1)==="\\"?(u(0,1),this.begin("emu")):this.begin("mu"),t.yytext)return 14;break;case 1:return 14;case 2:return this.popState(),14;case 3:return u(0,4),this.popState(),15;case 4:return 35;case 5:return 36;case 6:return 25;case 7:return 16;case 8:return 20;case 9:return 19;case 10:return 19;case 11:return 23;case 12:return 22;case 13:this.popState(),this.begin("com");break;case 14:return u(3,5),this.popState(),15;case 15:return 22;case 16:return 41;case 17:return 40;case 18:return 40;case 19:return 44;case 21:return this.popState(),24;case 22:return this.popState(),18;case 23:return t.yytext=u(1,2).replace(/\\"/g,'"'),32;case 24:return t.yytext=u(1,2).replace(/\\'/g,"'"),32;case 25:return 42;case 26:return 34;case 27:return 34;case 28:return 33;case 29:return 40;case 30:return t.yytext=u(1,2),40;case 31:return"INVALID";case 32:return 5}},n.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[3],inclusive:!1},INITIAL:{rules:[0,1,32],inclusive:!0}},n}();return t.lexer=r,i.prototype=t,t.Parser=i,new i}()}(),s=function(n,t){"use strict";function f(n){return n.constructor===u.ProgramNode?n:(r.yy=u,r.parse(n))}var i={},r=n,u=t;return i.parser=r,i.parse=f,i}(o,u),h=function(n){"use strict";function r(){}function u(n,t,r){if(n==null||typeof n!="string"&&n.constructor!==r.AST.ProgramNode)throw new i("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+n);t=t||{},"data"in t||(t.data=!0);var u=r.parse(n),f=(new r.Compiler).compile(u,t);return(new r.JavaScriptCompiler).compile(f,t)}function f(n,t,r){function f(){var i=r.parse(n),u=(new r.Compiler).compile(i,t),f=(new r.JavaScriptCompiler).compile(u,t,undefined,!0);return r.template(f)}if(n==null||typeof n!="string"&&n.constructor!==r.AST.ProgramNode)throw new i("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+n);t=t||{},"data"in t||(t.data=!0);var u;return function(n,t){return u||(u=f()),u.call(this,n,t)}}var t={},i=n;return t.Compiler=r,r.prototype={compiler:r,disassemble:function(){for(var e=this.opcodes,n,u=[],f,t,r,i=0,o=e.length;i<o;i++)if(n=e[i],n.opcode==="DECLARE")u.push("DECLARE "+n.name+"="+n.value);else{for(f=[],r=0;r<n.args.length;r++)t=n.args[r],typeof t=="string"&&(t='"'+t.replace("\n","\\n")+'"'),f.push(t);u.push(n.opcode+" "+f.join(" "))}return u.join("\n")},equals:function(n){var i=this.opcodes.length,t,r,f,u;if(n.opcodes.length!==i)return!1;for(t=0;t<i;t++){if(r=this.opcodes[t],f=n.opcodes[t],r.opcode!==f.opcode||r.args.length!==f.args.length)return!1;for(u=0;u<r.args.length;u++)if(r.args[u]!==f.args[u])return!1}if(i=this.children.length,n.children.length!==i)return!1;for(t=0;t<i;t++)if(!this.children[t].equals(n.children[t]))return!1;return!0},guid:0,compile:function(n,t){var i,r;if(this.opcodes=[],this.children=[],this.depths={list:[]},this.options=t,i=this.options.knownHelpers,this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0},i)for(r in i)this.options.knownHelpers[r]=i[r];return this.accept(n)},accept:function(n){var t=n.strip||{},i;return t.left&&this.opcode("strip"),i=this[n.type](n),t.right&&this.opcode("strip"),i},program:function(n){for(var r=n.statements,t=0,i=r.length;t<i;t++)this.accept(r[t]);return this.isSimple=i===1,this.depths.list=this.depths.list.sort(function(n,t){return n-t}),this},compileProgram:function(n){var t=(new this.compiler).compile(n,this.options),u=this.guid++,r,i,f;for(this.usePartial=this.usePartial||t.usePartial,this.children[u]=t,i=0,f=t.depths.list.length;i<f;i++)if(r=t.depths.list[i],r<2)continue;else this.addDepth(r-1);return u},block:function(n){var f=n.mustache,t=n.program,i=n.inverse,r,u;t&&(t=this.compileProgram(t)),i&&(i=this.compileProgram(i)),r=f.sexpr,u=this.classifySexpr(r),u==="helper"?this.helperSexpr(r,t,i):u==="simple"?(this.simpleSexpr(r),this.opcode("pushProgram",t),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("blockValue")):(this.ambiguousSexpr(r,t,i),this.opcode("pushProgram",t),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},hash:function(n){var u=n.pairs,r,t,i,f;for(this.opcode("pushHash"),i=0,f=u.length;i<f;i++)r=u[i],t=r[1],this.options.stringParams?(t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",t.stringModeValue,t.type),t.type==="sexpr"&&this.sexpr(t)):this.accept(t),this.opcode("assignToHash",r[0]);this.opcode("popHash")},partial:function(n){var t=n.partialName;this.usePartial=!0,n.context?this.ID(n.context):this.opcode("push","depth0"),this.opcode("invokePartial",t.name),this.opcode("append")},content:function(n){this.opcode("appendContent",n.string)},mustache:function(n){this.sexpr(n.sexpr),n.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousSexpr:function(n,t,i){var r=n.id,u=r.parts[0],f=t!=null||i!=null;this.opcode("getContext",r.depth),this.opcode("pushProgram",t),this.opcode("pushProgram",i),this.opcode("invokeAmbiguous",u,f)},simpleSexpr:function(n){var t=n.id;t.type==="DATA"?this.DATA(t):t.parts.length?this.ID(t):(this.addDepth(t.depth),this.opcode("getContext",t.depth),this.opcode("pushContext")),this.opcode("resolvePossibleLambda")},helperSexpr:function(n,t,r){var f=this.setupFullMustacheParams(n,t,r),u=n.id.parts[0];if(this.options.knownHelpers[u])this.opcode("invokeKnownHelper",f.length,u);else if(this.options.knownHelpersOnly)throw new i("You specified knownHelpersOnly, but used the unknown helper "+u,n);else this.opcode("invokeHelper",f.length,u,n.isRoot)},sexpr:function(n){var t=this.classifySexpr(n);t==="simple"?this.simpleSexpr(n):t==="helper"?this.helperSexpr(n):this.ambiguousSexpr(n)},ID:function(n){var i,t,r;for(this.addDepth(n.depth),this.opcode("getContext",n.depth),i=n.parts[0],i?this.opcode("lookupOnContext",n.parts[0]):this.opcode("pushContext"),t=1,r=n.parts.length;t<r;t++)this.opcode("lookup",n.parts[t])},DATA:function(n){var r,t,u;if(this.options.data=!0,n.id.isScoped||n.id.depth)throw new i("Scoped data references are not supported: "+n.original,n);for(this.opcode("lookupData"),r=n.id.parts,t=0,u=r.length;t<u;t++)this.opcode("lookup",r[t])},STRING:function(n){this.opcode("pushString",n.string)},INTEGER:function(n){this.opcode("pushLiteral",n.integer)},BOOLEAN:function(n){this.opcode("pushLiteral",n.bool)},comment:function(){},opcode:function(n){this.opcodes.push({opcode:n,args:[].slice.call(arguments,1)})},declare:function(n,t){this.opcodes.push({opcode:"DECLARE",name:n,value:t})},addDepth:function(n){n!==0&&(this.depths[n]||(this.depths[n]=!0,this.depths.list.push(n)))},classifySexpr:function(n){var t=n.isHelper,i=n.eligibleHelper,r=this.options,u;return i&&!t&&(u=n.id.parts[0],r.knownHelpers[u]?t=!0:r.knownHelpersOnly&&(i=!1)),t?"helper":i?"ambiguous":"simple"},pushParams:function(n){for(var i=n.length,t;i--;)t=n[i],this.options.stringParams?(t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",t.stringModeValue,t.type),t.type==="sexpr"&&this.sexpr(t)):this[t.type](t)},setupFullMustacheParams:function(n,t,i){var r=n.params;return this.pushParams(r),this.opcode("pushProgram",t),this.opcode("pushProgram",i),n.hash?this.hash(n.hash):this.opcode("emptyHash"),r}},t.precompile=u,t.compile=f,t}(n),c=function(n,t){"use strict";function r(n){this.value=n}function i(){}var c=n.COMPILER_REVISION,l=n.REVISION_CHANGES,e=n.log,o=t,f,s,u,h;for(i.prototype={nameLookup:function(n,t){var u,r;return n.indexOf("depth")===0&&(u=!0),r=/^[0-9]+$/.test(t)?n+"["+t+"]":i.isValidJavaScriptVariableName(t)?n+"."+t:n+"['"+t+"']",u?"("+n+" && "+r+")":r},compilerInfo:function(){var n=c,t=l[n];return"this.compilerInfo = ["+n+",'"+t+"'];\n"},appendToBuffer:function(n){return this.environment.isSimple?"return "+n+";":{appendToBuffer:!0,content:n,toString:function(){return"buffer += "+n+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(n,t,i,r){var f,u,s;for(this.environment=n,this.options=t||{},e("debug",this.environment.disassemble()+"\n\n"),this.name=this.environment.name,this.isChild=!!i,this.context=i||{programs:[],environments:[],aliases:{}},this.preamble(),this.stackSlot=0,this.stackVars=[],this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.compileChildren(n,t),f=n.opcodes,this.i=0,s=f.length;this.i<s;this.i++)u=f[this.i],u.opcode==="DECLARE"?this[u.name]=u.value:this[u.opcode].apply(this,u.args),u.opcode!==this.stripNext&&(this.stripNext=!1);if(this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new o("Compile completed with content left on stack");return this.createFunctionContext(r)},preamble:function(){var t=[],i,n;this.isChild?t.push(""):(i=this.namespace,n="helpers = this.merge(helpers, "+i+".helpers);",this.environment.usePartial&&(n=n+" partials = this.merge(partials, "+i+".partials);"),this.options.data&&(n=n+" data = data || {};"),t.push(n)),this.environment.isSimple?t.push(""):t.push(", buffer = "+this.initializeBuffer()),this.lastContext=0,this.source=t},createFunctionContext:function(n){var o=this.stackVars.concat(this.registers.list),r,t,u,s,i,f;if(o.length>0&&(this.source[1]=this.source[1]+", "+o.join(", ")),!this.isChild)for(r in this.context.aliases)this.context.aliases.hasOwnProperty(r)&&(this.source[1]=this.source[1]+", "+r+"="+this.context.aliases[r]);for(this.source[1]&&(this.source[1]="var "+this.source[1].substring(2)+";"),this.isChild||(this.source[1]+="\n"+this.context.programs.join("\n")+"\n"),this.environment.isSimple||this.pushSource("return buffer;"),t=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"],u=0,s=this.environment.depths.list.length;u<s;u++)t.push("depth"+this.environment.depths.list[u]);return i=this.mergeSource(),this.isChild||(i=this.compilerInfo()+i),n?(t.push(i),Function.apply(this,t)):(f="function "+(this.name||"")+"("+t.join(",")+") {\n "+i+"}",e("debug",f+"\n\n"),f)},mergeSource:function(){for(var r="",n,t,i=0,u=this.source.length;i<u;i++)t=this.source[i],t.appendToBuffer?n=n?n+"\n + "+t.content:t.content:(n&&(r+="buffer += "+n+";\n ",n=undefined),r+=t+"\n ");return r},blockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var n=["depth0"];this.setupParams(0,n),this.replaceStack(function(t){return n.splice(1,0,t),"blockHelperMissing.call("+n.join(", ")+")"})},ambiguousBlockValue:function(){var n,t;this.context.aliases.blockHelperMissing="helpers.blockHelperMissing",n=["depth0"],this.setupParams(0,n),t=this.topStack(),n.splice(1,0,t),this.pushSource("if (!"+this.lastHelper+") { "+t+" = blockHelperMissing.call("+n.join(", ")+"); }")},appendContent:function(n){this.pendingContent&&(n=this.pendingContent+n),this.stripNext&&(n=n.replace(/^\s+/,"")),this.pendingContent=n},strip:function(){this.pendingContent&&(this.pendingContent=this.pendingContent.replace(/\s+$/,"")),this.stripNext="strip"},append:function(){this.flushInline();var n=this.popStack();this.pushSource("if("+n+" || "+n+" === 0) { "+this.appendToBuffer(n)+" }"),this.environment.isSimple&&this.pushSource("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.context.aliases.escapeExpression="this.escapeExpression",this.pushSource(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(n){this.lastContext!==n&&(this.lastContext=n)},lookupOnContext:function(n){this.push(this.nameLookup("depth"+this.lastContext,n,"context"))},pushContext:function(){this.pushStackLiteral("depth"+this.lastContext)},resolvePossibleLambda:function(){this.context.aliases.functionType='"function"',this.replaceStack(function(n){return"typeof "+n+" === functionType ? "+n+".apply(depth0) : "+n})},lookup:function(n){this.replaceStack(function(t){return t+" == null || "+t+" === false ? "+t+" : "+this.nameLookup(t,n,"context")})},lookupData:function(){this.pushStackLiteral("data")},pushStringParam:function(n,t){this.pushStackLiteral("depth"+this.lastContext),this.pushString(t),t!=="sexpr"&&(typeof n=="string"?this.pushString(n):this.pushStackLiteral(n))},emptyHash:function(){this.pushStackLiteral("{}"),this.options.stringParams&&(this.push("{}"),this.push("{}"))},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[]}},popHash:function(){var n=this.hash;this.hash=this.hashes.pop(),this.options.stringParams&&(this.push("{"+n.contexts.join(",")+"}"),this.push("{"+n.types.join(",")+"}")),this.push("{\n "+n.values.join(",\n ")+"\n }")},pushString:function(n){this.pushStackLiteral(this.quotedString(n))},push:function(n){return this.inlineStack.push(n),n},pushLiteral:function(n){this.pushStackLiteral(n)},pushProgram:function(n){n!=null?this.pushStackLiteral(this.programExpression(n)):this.pushStackLiteral(null)},invokeHelper:function(n,t,i){this.context.aliases.helperMissing="helpers.helperMissing",this.useRegister("helper");var r=this.lastHelper=this.setupHelper(n,t,!0),f=this.nameLookup("depth"+this.lastContext,t,"context"),u="helper = "+r.name+" || "+f;r.paramsInit&&(u+=","+r.paramsInit),this.push("("+u+",helper ? helper.call("+r.callParams+") : helperMissing.call("+r.helperMissingParams+"))"),i||this.flushInline()},invokeKnownHelper:function(n,t){var i=this.setupHelper(n,t);this.push(i.name+".call("+i.callParams+")")},invokeAmbiguous:function(n,t){this.context.aliases.functionType='"function"',this.useRegister("helper"),this.emptyHash();var i=this.setupHelper(0,n,t),u=this.lastHelper=this.nameLookup("helpers",n,"helper"),f=this.nameLookup("depth"+this.lastContext,n,"context"),r=this.nextStack();i.paramsInit&&this.pushSource(i.paramsInit),this.pushSource("if (helper = "+u+") { "+r+" = helper.call("+i.callParams+"); }"),this.pushSource("else { helper = "+f+"; "+r+" = typeof helper === functionType ? helper.call("+i.callParams+") : helper; }")},invokePartial:function(n){var t=[this.nameLookup("partials",n,"partial"),"'"+n+"'",this.popStack(),"helpers","partials"];this.options.data&&t.push("data"),this.context.aliases.self="this",this.push("self.invokePartial("+t.join(", ")+")")},assignToHash:function(n){var u=this.popStack(),i,r,t;this.options.stringParams&&(r=this.popStack(),i=this.popStack()),t=this.hash,i&&t.contexts.push("'"+n+"': "+i),r&&t.types.push("'"+n+"': "+r),t.values.push("'"+n+"': ("+u+")")},compiler:i,compileChildren:function(n,t){for(var f=n.children,r,e,i,u=0,o=f.length;u<o;u++)r=f[u],e=new this.compiler,i=this.matchExistingProgram(r),i==null?(this.context.programs.push(""),i=this.context.programs.length,r.index=i,r.name="program"+i,this.context.programs[i]=e.compile(r,t,this.context),this.context.environments[i]=r):(r.index=i,r.name="program"+i)},matchExistingProgram:function(n){for(var i,t=0,r=this.context.environments.length;t<r;t++)if(i=this.context.environments[t],i&&i.equals(n))return t},programExpression:function(n){var t,e;if(this.context.aliases.self="this",n==null)return"self.noop";var i=this.environment.children[n],r=i.depths.list,u,f=[i.index,i.name,"data"];for(t=0,e=r.length;t<e;t++)u=r[t],u===1?f.push("depth0"):f.push("depth"+(u-1));return(r.length===0?"self.program(":"self.programWithDepth(")+f.join(", ")+")"},register:function(n,t){this.useRegister(n),this.pushSource(n+" = "+t+";")},useRegister:function(n){this.registers[n]||(this.registers[n]=!0,this.registers.list.push(n))},pushStackLiteral:function(n){return this.push(new r(n))},pushSource:function(n){this.pendingContent&&(this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent))),this.pendingContent=undefined),n&&this.source.push(n)},pushStack:function(n){this.flushInline();var t=this.incrStack();return n&&this.pushSource(t+" = "+n+";"),this.compileStack.push(t),t},replaceStack:function(n){var u="",o=this.isInline(),t,f,s,i,h,e;return o?(i=this.popStack(!0),i instanceof r?(t=i.value,s=!0):(f=!this.stackSlot,h=f?this.incrStack():this.topStackName(),u="("+this.push(h)+" = "+i+"),",t=this.topStack())):t=this.topStack(),e=n.call(this,t),o?(s||this.popStack(),f&&this.stackSlot--,this.push("("+u+e+")")):(/^stack/.test(t)||(t=this.nextStack()),this.pushSource(t+" = ("+u+e+");")),t},nextStack:function(){return this.pushStack()},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var i=this.inlineStack,n,u,t;if(i.length)for(this.inlineStack=[],n=0,u=i.length;n<u;n++)t=i[n],t instanceof r?this.compileStack.push(t):this.pushStack(t)},isInline:function(){return this.inlineStack.length},popStack:function(n){var i=this.isInline(),t=(i?this.inlineStack:this.compileStack).pop();if(!n&&t instanceof r)return t.value;if(!i){if(!this.stackSlot)throw new o("Invalid stack pop");this.stackSlot--}return t},topStack:function(n){var i=this.isInline()?this.inlineStack:this.compileStack,t=i[i.length-1];return!n&&t instanceof r?t.value:t},quotedString:function(n){return'"'+n.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},setupHelper:function(n,t,i){var r=[],u=this.setupParams(n,r,i),f=this.nameLookup("helpers",t,"helper");return{params:r,paramsInit:u,name:f,callParams:["depth0"].concat(r).join(", "),helperMissingParams:i&&["depth0",this.quotedString(t)].concat(r).join(", ")}},setupOptions:function(n,t){var i=[],e=[],o=[],s,r,u,f;for(i.push("hash:"+this.popStack()),this.options.stringParams&&(i.push("hashTypes:"+this.popStack()),i.push("hashContexts:"+this.popStack())),r=this.popStack(),u=this.popStack(),(u||r)&&(u||(this.context.aliases.self="this",u="self.noop"),r||(this.context.aliases.self="this",r="self.noop"),i.push("inverse:"+r),i.push("fn:"+u)),f=0;f<n;f++)s=this.popStack(),t.push(s),this.options.stringParams&&(o.push(this.popStack()),e.push(this.popStack()));return this.options.stringParams&&(i.push("contexts:["+e.join(",")+"]"),i.push("types:["+o.join(",")+"]")),this.options.data&&i.push("data:data"),i},setupParams:function(n,t,i){var r="{"+this.setupOptions(n,t).join(",")+"}";return i?(this.useRegister("options"),t.push("options"),"options="+r):(t.push(r),"")}},f="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),s=i.RESERVED_WORDS={},u=0,h=f.length;u<h;u++)s[f[u]]=!0;return i.isValidJavaScriptVariableName=function(n){return!i.RESERVED_WORDS[n]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(n)?!0:!1},i}(i,n);return function(n,t,i,r,u){"use strict";var f=n,o=t,s=i.parser,h=i.parse,c=r.Compiler,l=r.compile,a=r.precompile,v=u,y=f.create,e=function(){var n=y();return n.compile=function(t,i){return l(t,i,n)},n.precompile=function(t,i){return a(t,i,n)},n.AST=o,n.Compiler=c,n.JavaScriptCompiler=v,n.Parser=s,n.parse=h,n};return f=e(),f.create=e,f}(e,u,s,h,c)}()
admin/views/slider-panel/js/masterslider.wp.js ADDED
@@ -0,0 +1,3108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //js\mspanel\MSpanel.js
2
+
3
+ /*!
4
+ * @overview Master Slider Lite Wordpress Panel
5
+ * @copyright Copyright 2014 Averta Ltd.
6
+ * @version 1.0
7
+ * http://www.averta.net
8
+ */
9
+
10
+ window.MSPanel = Ember.Application.create({ rootElement : "#msp-root" });
11
+ MSPanel.version = '1.0';
12
+ MSPanel.SliderID = parseQueryString(window.location.search).slider_id || __MSP_SLIDER_ID || '100';
13
+
14
+ /**
15
+ * Adds new function to String object 'jfmt' it's like Ember.fmt but first replaces '%s' or '%d' to '%@'
16
+ * @example 'Hi, %s'.jfmt('John');
17
+ */
18
+ String.prototype.jfmt = function(){ return ''.fmt.apply(this.replace(/%s|%d/, '%@') ,arguments); };
19
+
20
+ $ = jQuery.noConflict();
21
+ jQuery.ui.dialog.prototype._focusTabbable = function(){};
22
+
23
+ // Setup Application Router
24
+ MSPanel.Router.map(function() {
25
+ this.resource('settings' );
26
+ this.resource('slides', {path: '/'});
27
+ this.resource('controls');
28
+ this.resource('callbacks');
29
+ this.resource('error');
30
+ });
31
+ MSPanel.Router.reopen({ location: 'none' });
32
+
33
+ // Application route
34
+ MSPanel.ApplicationRoute = Ember.Route.extend({
35
+ model: function() {
36
+ var setting = MSPanel.Settings.find();
37
+ if( setting.get('length') === 0){
38
+ MSPanel.Settings.create().save();
39
+ }
40
+ }
41
+ });
42
+
43
+ MSPanel.SettingsRoute = Ember.Route.extend({
44
+ model: function() {
45
+ return MSPanel.Settings.find(1);
46
+ },
47
+ setupController: function(controller, model) {
48
+ controller.set('model', model);
49
+ controller.setup();
50
+ }
51
+ });
52
+
53
+ MSPanel.SlidesRoute = Ember.Route.extend({
54
+ model: function(){
55
+ return MSPanel.Slide.find();
56
+ },
57
+
58
+ setupController: function(controller, model) {
59
+ controller.set('model', model);
60
+ controller.set('sliderSettings' , MSPanel.Settings.find(1)/*this.store.find('settings' , 1)*/);
61
+ controller.setup();
62
+ }
63
+
64
+ });
65
+
66
+ MSPanel.ControlsRoute = Ember.Route.extend({
67
+ model: function() {
68
+ return MSPanel.Control.find();
69
+ },
70
+
71
+ setupController: function(controller, model) {
72
+ controller.set('model', model);
73
+ controller.setup();
74
+ this.activate();
75
+ },
76
+
77
+ activate: function() {
78
+ var controller = this.get('controller');
79
+ if(controller){
80
+ controller.set('controlOptions', 'empty-template')
81
+ }
82
+ }
83
+
84
+ });
85
+
86
+ MSPanel.CallbacksRoute = Ember.Route.extend({
87
+ model: function() {
88
+ return MSPanel.Callback.find();
89
+ },
90
+
91
+ setupController: function(controller, model) {
92
+ controller.set('model', model);
93
+ controller.setup();
94
+ }
95
+ });//js\mspanel\models\SliderModel.js
96
+
97
+ /**
98
+ * Master Slider Panel Model
99
+ * @package MSPanel
100
+ * @author averta
101
+ */
102
+
103
+ ;(function(){
104
+
105
+ var attr = Ember.attr,
106
+ hasMany = Ember.hasMany,
107
+ belongsTo = Ember.belongsTo;
108
+
109
+ // custom data type, converts absolute paths to relative
110
+ var regp = /https\:|http\:/;
111
+ var WPPath = {
112
+
113
+ // convert to relative
114
+ serialize: function(path){
115
+ if ( path == undefined ){
116
+ return path;
117
+ }
118
+
119
+ if( regp.test(path) ) { // is it absolute?
120
+ return path.replace(__MS.upload_dir, '');
121
+ } else {
122
+ return path;
123
+ }
124
+ },
125
+
126
+ // covert to absolute
127
+ deserialize: function(path){
128
+ if ( path == undefined ) {
129
+ return path;
130
+ }
131
+
132
+ if( regp.test(path) ) { // is it absolute?
133
+ return path;
134
+ } else {
135
+ return __MS.upload_dir + path;
136
+ }
137
+ }
138
+
139
+ };
140
+
141
+ /**
142
+ * Slider Settings Model
143
+ */
144
+ MSPanel.Settings = Ember.Model.extend({
145
+
146
+ /* Internal Options */
147
+ // -------------------------------------------------------------------
148
+ id : attr('number'), // settings record id (not slider id)
149
+ snapping : attr('boolean', {defaultValue : true}),
150
+ bgImageThumb : attr(WPPath),
151
+ disableControls : attr('boolean', {defaultValue: false}),
152
+ // -------------------------------------------------------------------
153
+
154
+ // General
155
+ name : attr('string' , {defaultValue: __MSP_LAN.sm_001}),
156
+ width : attr('number' , {defaultValue: 1000}),
157
+ height : attr('number' , {defaultValue: 500}),
158
+ wrapperWidth : attr('number'),
159
+ wrapperWidthUnit : attr('string' , {defaultValue: 'px'}),
160
+ autoCrop : attr('boolean', {defaultValue: false}),
161
+ type : attr('string'),
162
+ sliderId : attr('string'),
163
+
164
+ /**
165
+ * Slider sizing methods
166
+ * Values:
167
+ * boxed,
168
+ * fullwidth,
169
+ * fullscreen,
170
+ * fillwidth,
171
+ * autofill,
172
+ * partialview
173
+ */
174
+ layout : attr('string' , {defaultValue: 'boxed'}),
175
+ autoHeight : attr('boolean', {defaultValue: false}),
176
+
177
+ // navigation and appearance
178
+ trView : attr('string' , {defaultValue: 'basic'}),
179
+ speed : attr('number' , {defaultValue: 20}),
180
+ space : attr('number' , {defaultValue: 0}),
181
+ start : attr('number' , {defaultValue: 1}),
182
+ grabCursor : attr('boolean', {defaultValue: true}),
183
+ swipe : attr('boolean', {defaultValue: true}),
184
+ mouse : attr('boolean', {defaultValue: true}),
185
+ wheel : attr('boolean', {defaultValue: false}),
186
+ autoplay : attr('boolean', {defaultValue: false}),
187
+ loop : attr('boolean', {defaultValue: false}),
188
+ shuffle : attr('boolean', {defaultValue: false}),
189
+ preload : attr('string' , {defaultValue: '-1'}),
190
+ overPause : attr('boolean', {defaultValue: true}),
191
+ endPause : attr('boolean', {defaultValue: false}),
192
+ hideLayers : attr('boolean', {defaultValue: false}),
193
+ dir : attr('string' , {defaultValue: 'h'}),
194
+ parallaxMode: attr('srting' , {defaultValue: 'swipe'}),
195
+ centerControls : attr('boolean', {defaultValue: true}),
196
+ instantShowLayers : attr('boolean', {defaultValue: false}),
197
+ fullscreenMargin : attr('number'),
198
+
199
+ // misc
200
+ inlineStyle : attr('string'),
201
+ className : attr('string'),
202
+ bgColor : attr('string'),
203
+ bgImage : attr(WPPath),
204
+
205
+ skin : attr('string' , {defaultValue: 'ms-skin-default'}),
206
+ msTemplate : attr('string' , {defaultValue: 'custom'}),
207
+ msTemplateClass : attr('string' , {defaultValue: ''}),
208
+ usedFonts : attr('string'),
209
+
210
+ // Flickr/Facebook Settings
211
+ apiKey : attr('string'),
212
+ setId : attr('string'),
213
+ setType : attr('string'),
214
+ imgCount : attr('number'),
215
+ thumbSize : attr('srting'),
216
+ imgSize : attr('string'),
217
+
218
+ // Posts Settings
219
+ postType : attr('string'),
220
+ postCats : attr(Array),
221
+ postTags : attr(Array),
222
+ postCount : attr('number'),
223
+ postImageType : attr('string'),
224
+ postOrder : attr('string'),
225
+ postOrderDir : attr('string'),
226
+ postExcerptLen : attr('number'),
227
+ postExcludeIds : attr('string'),
228
+ postOffset : attr('number'),
229
+ postLinkSlide : attr('boolean'),
230
+ postLinkTarget : attr('string'),
231
+ postSlideBg : attr('string'),
232
+ postSlideBgthumb: attr('string'), // internal
233
+
234
+ // woocommmerce settings
235
+ wcOnlyInstock : attr('boolean'),
236
+ wcOnlyFeatured : attr('boolean'),
237
+ wcOnlyOnsale : attr('boolean')
238
+ })
239
+
240
+ /**
241
+ * Slider Slide Model
242
+ */
243
+ MSPanel.Slide = Ember.Model.extend({
244
+
245
+ /* Internal Options */
246
+ // -------------------------------------------------------------------
247
+ id : attr('number'),
248
+ timeline_h : attr('number' , {defaultValue: 200}),
249
+ bgThumb : attr(WPPath),
250
+ thumbOrginal : attr(WPPath),
251
+ // -------------------------------------------------------------------
252
+
253
+ // General
254
+ order : attr('number'),
255
+ ishide : attr('boolean'),
256
+ bg : attr(WPPath),
257
+ duration : attr('number', {defaultValue : 3}),
258
+
259
+ fillMode : attr('string', {defaultValue : 'fill'}),
260
+ thumb : attr(WPPath),
261
+ info : attr('string'),
262
+ link : attr('string'),
263
+ linkTarget : attr('string'),
264
+ video : attr('string'),
265
+ bgColor : attr('string'),
266
+
267
+ bgv_mp4 : attr('string'),
268
+ bgv_ogg : attr('string'),
269
+ bgv_webm : attr('string'),
270
+ bgv_fillmode : attr('string' , {defaultValue: 'fill'}),
271
+
272
+ bgv_loop : attr('boolean', {defaultValue: true}),
273
+ bgv_mute : attr('boolean', {defaultValue: true}),
274
+ bgv_autopause : attr('boolean', {defaultValue: false}),
275
+
276
+ cssId : attr('string'),
277
+ cssClass : attr('string'),
278
+ bgAlt : attr('string'),
279
+
280
+ /**
281
+ * Slide Layers
282
+ * Object format: layer_ids:[1,2,3,...]
283
+ */
284
+ layers : hasMany('MSPanel.Layer', {key: 'layer_ids'})
285
+
286
+ });
287
+
288
+ /**
289
+ * Slide Layer Model
290
+ */
291
+ MSPanel.Layer = Ember.Model.extend({
292
+
293
+ /* Internal Options */
294
+ // -------------------------------------------------------------------
295
+ id : attr('number'),
296
+ name : attr('string'),
297
+ isLocked : attr('boolean' , {defaultValue: false}),
298
+ isHided : attr('boolean' , {defaultValue: false}),
299
+ isSoloed : attr('boolean' , {defaultValue: false}),
300
+ slide : belongsTo('MSPanel.Slide', {key: 'slide'}),
301
+ styleModel : belongsTo('MSPanel.Style', {key: 'styleModel', embedded:false}),
302
+
303
+ showEffect : belongsTo('MSPanel.Effect', {key: 'showEffect', embedded:false} ),
304
+ showTransform : attr('string' , {defaultValue: ''}), // tranform style
305
+ showOrigin : attr('string' , {defaultValue: ''}), // transform origin
306
+ showFade : attr('boolean', {defaultValue: true}),
307
+
308
+ hideEffect : belongsTo('MSPanel.Effect', {key: 'hideEffect', embedded:false}),
309
+ hideTransform : attr('string' , {defaultValue: ''}), // transform style
310
+ hideOrigin : attr('string' , {defaultValue: ''}),
311
+ hideFade : attr('boolean', {defaultValue: true}),
312
+ imgThumb : attr(WPPath),
313
+
314
+ stageOffsetX : attr('number', {defaultValue: 0}),
315
+ stageOffsetY : attr('number', {defaultValue: 0}),
316
+
317
+
318
+ // -------------------------------------------------------------------
319
+
320
+ // General
321
+ order : attr('number'),
322
+ type : attr('string'), // values: text, video, image, hotspot
323
+
324
+ // misc
325
+ cssClass : attr('string'), // custom css class name
326
+ cssId : attr('string'), // custom css id
327
+ title : attr('string'), // title attribute
328
+ rel : attr('string'), // rel attribute
329
+
330
+ // layer content
331
+ content : attr('string' , {defaultValue : 'Lorem Ipsum'}), // for text, hotspot
332
+ img : attr(WPPath), // for image and video
333
+ imgAlt : attr('string'),
334
+ video : attr('string', {defaultValue: 'http://player.vimeo.com/video/11721242'}), // video iframe path
335
+
336
+ align : attr('string', {defaultValue: 'top'}),
337
+
338
+ useAction : attr('boolean', {defaultValue: false}),
339
+ action : attr('string'),
340
+ toSlide : attr('number'), // gotoSlide action parameter
341
+ link : attr('string'),
342
+ linkTarget : attr('string'),
343
+
344
+ // Position
345
+ offsetX : attr('number' , {defaultValue : 0}),
346
+ offsetY : attr('number' , {defaultValue : 0}),
347
+ width : attr('number'),
348
+ height : attr('number'),
349
+ resize : attr('boolean', {defaultValue : true}),
350
+ fixed : attr('boolean', {defaultValue : false}),
351
+ widthlimit : attr('number' , {defaultValue : '0'}),
352
+ origin : attr('string' , {defaultValue : 'tl'}),
353
+
354
+ stayHover : attr('boolean', {defaultValue: true}), // hotspot only
355
+
356
+ // layer style class name
357
+ className : attr('string'),
358
+
359
+ // layer parallax effect
360
+ parallax : attr('string'),
361
+
362
+ // Show Effect
363
+ showDuration : attr('number' , {defaultValue : 1}),
364
+ showDelay : attr('number' , {defaultValue : 0}),
365
+ showEase : attr('string' , {defaultValue : 'easeOutQuint'}),
366
+ showEffFunc : attr('string'), // used by master slider
367
+
368
+ // Hide Effect
369
+ useHide : attr('boolean', {defaultValue : false}),
370
+ hideDuration : attr('number' , {defaultValue : 1}),
371
+ hideDelay : attr('number' , {defaultValue : 1}),
372
+ hideEase : attr('string' , {defaultValue : 'easeOutQuint'}),
373
+ hideEffFunc : attr('string'), // used by master slider
374
+
375
+ // btn layer only
376
+ btnClass : attr('string', {defaultValue : 'ms-default-btn'})
377
+
378
+ //style : attr('string' , {defaultValue: ''}),
379
+ });
380
+
381
+ /**
382
+ * Layer Styles Model
383
+ */
384
+ MSPanel.Style = Ember.Model.extend({
385
+
386
+ /* Internal Options */
387
+ // -------------------------------------------------------------------
388
+ id : attr('number'),
389
+ name : attr('string'),
390
+ // -------------------------------------------------------------------
391
+
392
+ /**
393
+ * style type
394
+ * values:
395
+ * preset, preset style
396
+ * copy, on copy of preset style used in mspanel
397
+ * custom, layer custom style
398
+ */
399
+ type : attr('string'),
400
+
401
+ /**
402
+ * style class name
403
+ * format:
404
+ * preset-> msp-preset-{{presetID}}
405
+ * custom-> msp-cn-{{sliderID}}-{{layer-ID}}
406
+ */
407
+ className : attr('string'),
408
+ //css : attr('string'),
409
+
410
+ backgroundColor : attr('string'),
411
+
412
+ // padding
413
+ paddingTop : attr('number'),
414
+ paddingRight : attr('number'),
415
+ paddingBottom : attr('number'),
416
+ paddingLeft : attr('number'),
417
+
418
+ // border
419
+ borderTop : attr('number'),
420
+ borderRight : attr('number'),
421
+ borderBottom : attr('number'),
422
+ borderLeft : attr('number'),
423
+
424
+ borderColor : attr('string'),
425
+ borderRadius : attr('number'),
426
+ borderStyle : attr('string'),
427
+
428
+ //Typography
429
+ fontFamily : attr('string'),
430
+ fontWeight : attr('string' , {defaultValue: 'normal'}),
431
+ fontSize : attr('number'),
432
+
433
+ textAlign : attr('string'),
434
+ letterSpacing : attr('number'),
435
+ lineHeight : attr('string' , {defaultValue: 'normal'}),
436
+ whiteSpace : attr('string'),
437
+ color : attr('string'),
438
+
439
+ // custom style
440
+ custom : attr('string')
441
+ });
442
+
443
+ MSPanel.PresetStyle = MSPanel.Style.extend({});
444
+
445
+ /**
446
+ * Layer Effect Model
447
+ */
448
+ MSPanel.Effect = Ember.Model.extend({
449
+
450
+ /* Internal Options */
451
+ // -------------------------------------------------------------------
452
+ id : attr('number'),
453
+ name : attr('string'),
454
+ // -------------------------------------------------------------------
455
+
456
+ type : attr('string'), // preset or null
457
+
458
+ fade : attr('boolean', {defaultValue: true}),
459
+
460
+ translateX : attr('number'),
461
+ translateY : attr('number'),
462
+ translateZ : attr('number'),
463
+
464
+ scaleX : attr('number'),
465
+ scaleY : attr('number'),
466
+
467
+ rotate : attr('number'),
468
+ rotateX : attr('number'),
469
+ rotateY : attr('number'),
470
+ rotateZ : attr('number'),
471
+
472
+ skewX : attr('number'),
473
+ skewY : attr('number'),
474
+
475
+ originX : attr('number'),
476
+ originY : attr('number'),
477
+ originZ : attr('number')
478
+
479
+ // effect function for master slider
480
+ //msEffect : attr('string'),
481
+
482
+ });
483
+
484
+ MSPanel.PresetEffect = MSPanel.Effect.extend({});
485
+
486
+ /**
487
+ * Slider control model
488
+ */
489
+ MSPanel.Control = Ember.Model.extend({
490
+
491
+ /* Internal Options */
492
+ // -------------------------------------------------------------------
493
+ id : attr('number'),
494
+ label : attr('string'),
495
+ // -------------------------------------------------------------------
496
+
497
+ // general
498
+ name : attr('string'),
499
+
500
+ autoHide : attr('boolean', {defaultValue: true}), // in JS autohide
501
+ overVideo : attr('boolean', {defaultValue: true}),
502
+
503
+ // misc
504
+ cssClass : attr('string'),
505
+ cssId : attr('string'),
506
+
507
+ // align and margin
508
+ //align : attr('string'), // values : t, r, b, l \ tl,tr,bl,br (for circle timer)
509
+ //inset : attr('boolean'), // in slider or out of slider
510
+ margin : attr('number'), // element margin from top ,...
511
+
512
+ // used for bullets, scrollbar and thumbs/tabs
513
+ dir : attr('string'), // h or v
514
+
515
+ // circle timer options
516
+ color : attr('string'), // also scrollbar | timebar
517
+ radius : attr('number'),
518
+ stroke : attr('number'),
519
+
520
+ // thumbs/tabs
521
+ speed : attr('number'),
522
+ space : attr('number'),
523
+ type : attr('string'), // tab or thumb
524
+
525
+ width : attr('number'), /// thumblist | scrollbar | timebar
526
+ height : attr('number'), // thumbelist
527
+
528
+ align : attr('string'), // thumblist | scrollbar | bullets | timebar | slideinfo
529
+ inset : attr('boolean'), // thumblist | scrollbar | timebar | slideinfo
530
+
531
+ size : attr('number'), // slide info
532
+
533
+ hideUnder : attr('number'),
534
+
535
+ fillMode : attr('string')
536
+
537
+ });
538
+
539
+ /**
540
+ * Slider Callback functions
541
+ */
542
+ MSPanel.Callback = Ember.Model.extend({
543
+
544
+ /* Internal Options */
545
+ // -------------------------------------------------------------------
546
+ id : attr('number'),
547
+ label : attr('string'),
548
+ // -------------------------------------------------------------------
549
+
550
+ name : attr('string'),
551
+ content : attr('string', {defaultValue: 'function(event){\n var api = event.target;\n}'})
552
+
553
+ });
554
+
555
+ /**
556
+ * Button Class Names
557
+ * @since 1.9.0
558
+ */
559
+
560
+ MSPanel.ButtonStyle = Ember.Model.extend({
561
+
562
+ /* Internal Options */
563
+ // -------------------------------------------------------------
564
+ id : attr('number'),
565
+ // -------------------------------------------------------------
566
+
567
+ className : attr('string'),
568
+ normal : attr('string'),
569
+ hover : attr('string'),
570
+ active : attr('string')
571
+
572
+ });
573
+
574
+
575
+ var decodeFix = function(str){
576
+ var decoded = B64.decode(str);
577
+ return decoded.slice(0, decoded.lastIndexOf('}')+1);
578
+ }
579
+
580
+ window.__MSP_PRESET_BUTTON = null;
581
+
582
+ MSPanel.data = __MSP_DATA ? JSON.parse(decodeFix(__MSP_DATA)) : {meta:{}};
583
+ MSPanel.PSData = __MSP_PRESET_STYLE ? JSON.parse(decodeFix(__MSP_PRESET_STYLE)) : {meta:{}};
584
+ MSPanel.PEData = __MSP_PRESET_EFFECT ? JSON.parse(decodeFix(__MSP_PRESET_EFFECT)) : {meta:{}};
585
+ MSPanel.PBData = __MSP_PRESET_BUTTON ? JSON.parse(decodeFix(__MSP_PRESET_BUTTON)) : {meta:{}};
586
+
587
+ MSPanel.Settings.adapter = Ember.OfflineAdapter.create({applicationData:MSPanel.data});
588
+ MSPanel.Slide.adapter = Ember.OfflineAdapter.create({applicationData:MSPanel.data});
589
+ MSPanel.Layer.adapter = Ember.OfflineAdapter.create({applicationData:MSPanel.data});
590
+ MSPanel.Style.adapter = Ember.OfflineAdapter.create({applicationData:MSPanel.data});
591
+ MSPanel.Effect.adapter = Ember.OfflineAdapter.create({applicationData:MSPanel.data});
592
+ MSPanel.Control.adapter = Ember.OfflineAdapter.create({applicationData:MSPanel.data});
593
+ MSPanel.Callback.adapter = Ember.OfflineAdapter.create({applicationData:MSPanel.data});
594
+ MSPanel.PresetStyle.adapter = Ember.OfflineAdapter.create({applicationData:MSPanel.PSData});
595
+ MSPanel.PresetEffect.adapter = Ember.OfflineAdapter.create({applicationData:MSPanel.PEData});
596
+ MSPanel.ButtonStyle.adapter = Ember.OfflineAdapter.create({applicationData:MSPanel.PBData});
597
+
598
+ })();//js\mspanel\models\SliderTemplates.js
599
+
600
+ MSPanel.SliderTemplates = [
601
+
602
+ {
603
+ name:'Custom Template',
604
+ value:'custom',
605
+ className: '',
606
+ img: __MSP_PATH + 'images/templates/custom.gif',
607
+ controls: null
608
+ },
609
+
610
+ {
611
+ name:'3D Flow Carousel',
612
+ value:'3d-flow-carousel',
613
+ className:'ms-caro3d-template',
614
+ img: __MSP_PATH + 'images/templates/3d-flow-carousel.png',
615
+ settings: {
616
+ space:0,
617
+ loop:true,
618
+ trView:'flow',
619
+ layout:'partialview',
620
+ dir:'h',
621
+ wheel:false
622
+ },
623
+ controls: null
624
+ },
625
+
626
+ {
627
+ name:'3D Wave Carousel',
628
+ value:'3d-wave-carousel',
629
+ className:'ms-caro3d-template',
630
+ img: __MSP_PATH + 'images/templates/3d-wave-carousel.png',
631
+ settings: {
632
+ space:0,
633
+ loop:true,
634
+ trView:'flow',
635
+ layout:'partialview',
636
+ dir:'h',
637
+ wheel:false
638
+ },
639
+ controls: null
640
+ },
641
+
642
+ {
643
+ name:'Image Gallery with Thumbs',
644
+ value:'image-gallery',
645
+ className:'ms-gallery-template',
646
+ img: __MSP_PATH + 'images/templates/image-gallery.png',
647
+ settings: {
648
+ space:0,
649
+ trView:'basic',
650
+ skin:'ms-skin-black-2 round-skin'
651
+ },
652
+ controls: null,
653
+ disableControls: true
654
+ },
655
+
656
+ {
657
+ name:'Slider with Bottom Aligned Thumbs',
658
+ value:'slider-horizontal-thumbs',
659
+ className:'ms-thumbs-template',
660
+ img: __MSP_PATH + 'images/templates/slider-bottom-thumbs.png',
661
+ settings: {
662
+ trView:'scale',
663
+ space:0
664
+ },
665
+ controls: {
666
+ arrows: {},
667
+ scrollbar: {dir:'h'},
668
+ thumblist: {autohide:false ,dir:'h',arrows:false, align:'bottom', width:127, height:137, margin:5, space:5}
669
+ }
670
+ },
671
+
672
+ {
673
+ name:'Slider with Top Aligned Thumbs',
674
+ value:'slider-top-thumbs',
675
+ className:'ms-thumbs-template',
676
+ img: __MSP_PATH + 'images/templates/slider-top-thumbs.png',
677
+ settings: {
678
+ trView:'scale',
679
+ space:0
680
+ },
681
+ controls: {
682
+ arrows: {},
683
+ scrollbar: {dir:'h'},
684
+ thumblist: {autohide:false ,dir:'h',arrows:false, align:'top', width:127, height:137, margin:5, space:5}
685
+ }
686
+ },
687
+
688
+ {
689
+ name:'Slider with Right Aligned Thumbs',
690
+ value:'slider-vertical-thumbs',
691
+ className:'ms-thumbs-template',
692
+ img: __MSP_PATH + 'images/templates/slider-right-thumbs.png',
693
+ settings: null,
694
+ controls: {
695
+ arrows: {},
696
+ scrollbar: {dir:'v'},
697
+ thumblist: {autohide:false ,dir:'v',arrows:false, align:'right', width:127, height:137, margin:5, space:5}
698
+ }
699
+ },
700
+
701
+ {
702
+ name:'Slider with Left Aligned Thumbs',
703
+ value:'slider-left-thumbs',
704
+ className:'ms-thumbs-template',
705
+ img: __MSP_PATH + 'images/templates/slider-left-thumbs.png',
706
+ settings: null,
707
+ controls: {
708
+ arrows: {},
709
+ scrollbar: {dir:'v'},
710
+ thumblist: {autohide:false ,dir:'v',arrows:false, align:'left', width:127, height:137, margin:5, space:5}
711
+ }
712
+ },
713
+
714
+ {
715
+ name:'Slider with Horizontal Tabs',
716
+ value:'slider-horizontal-tabs',
717
+ className:'ms-tabs-template',
718
+ img: __MSP_PATH + 'images/templates/slider-horizontal-tabs.png',
719
+ settings: null,
720
+ controls: {
721
+ arrows: {},
722
+ circletimer: {color:"#FFFFFF" , stroke:9},
723
+ thumblist: {autohide:false ,dir:'h', type:'tabs',width:240,height:120, align:'bottom', space:0 , margin:-12, hideUnder:400}
724
+ }
725
+ },
726
+
727
+ {
728
+ name:'Slider with Vertical Tabs',
729
+ value:'slider-vertical-tabs',
730
+ className:'ms-tabs-template',
731
+ img: __MSP_PATH + 'images/templates/slider-vertical-tabs.png',
732
+ settings: null,
733
+ controls: {
734
+ arrows: {},
735
+ circletimer: {color:"#FFFFFF" , stroke:9},
736
+ thumblist: {autohide:false ,dir:'v', type:'tabs', align:'right', margin:-12, space:0, width:229, height:100, hideUnder:550}
737
+ }
738
+ },
739
+
740
+ {
741
+ name:'Partial View Slider V1',
742
+ value:'partial-1',
743
+ className:'ms-partialview-template',
744
+ img: __MSP_PATH + 'images/templates/partial-1.png',
745
+ settings: {
746
+ space:10,
747
+ loop:true,
748
+ trView:'partialWave',
749
+ layout:'partialview',
750
+ dir:'h'
751
+ },
752
+ controls: {
753
+ arrows: {},
754
+ circletimer: {color:"#FFFFFF" , stroke:9},
755
+ slideinfo: {autohide:false, align:'bottom', size:160}
756
+ }
757
+ },
758
+
759
+ {
760
+ name:'Partial View Slider V2',
761
+ value:'partial-2',
762
+ className:'ms-partialview-template',
763
+ img: __MSP_PATH + 'images/templates/partial-2.png',
764
+ settings: {
765
+ space:10,
766
+ loop:true,
767
+ trView:'fadeWave',
768
+ layout:'partialview',
769
+ dir:'h'
770
+ },
771
+ controls: {
772
+ arrows: {},
773
+ circletimer: {color:"#FFFFFF" , stroke:9},
774
+ slideinfo: {autohide:false, align:'bottom', size:160}
775
+ }
776
+ },
777
+
778
+ {
779
+ name:'Partial View Slider V3',
780
+ value:'partial-3',
781
+ className:'ms-partialview-template',
782
+ img: __MSP_PATH + 'images/templates/partial-3.png',
783
+ settings: {
784
+ space:10,
785
+ loop:true,
786
+ trView:'fadeFlow',
787
+ layout:'partialview',
788
+ dir:'h'
789
+ },
790
+ controls: {
791
+ arrows: {},
792
+ circletimer: {color:"#FFFFFF" , stroke:9},
793
+ slideinfo: {autohide:false, align:'bottom', size:160}
794
+ }
795
+ },
796
+
797
+ {
798
+ name:'Slider in Display',
799
+ value:'display',
800
+ className:'ms-display-template',
801
+ img: __MSP_PATH + 'images/templates/display.png',
802
+ settings: {
803
+ width:507,
804
+ height:286,
805
+ speed:20,
806
+ space:2,
807
+ trView:'flow',
808
+ dir:'h',
809
+ layout:'boxed'
810
+ },
811
+ controls: {
812
+ arrows: {},
813
+ circletimer: {color:"#FFFFFF" , stroke:9},
814
+ bullets: {autohide:false}
815
+ },
816
+ disableControls: true
817
+ },
818
+
819
+ {
820
+ name:'Slider in Flat Display',
821
+ value:'flat-display',
822
+ className:'ms-display-template',
823
+ img: __MSP_PATH + 'images/templates/flat-display.png',
824
+ settings: {
825
+ width:507,
826
+ height:286,
827
+ speed:20,
828
+ space:2,
829
+ trView:'flow',
830
+ dir:'h',
831
+ layout:'boxed'
832
+ },
833
+ controls: {
834
+ arrows: {},
835
+ circletimer: {color:"#FFFFFF" , stroke:9},
836
+ bullets: {autohide:false}
837
+ },
838
+ disableControls: true
839
+ },
840
+
841
+ {
842
+ name:'Slider in Laptop',
843
+ value:'laptop',
844
+ className:'ms-laptop-template',
845
+ img: __MSP_PATH + 'images/templates/laptop.png',
846
+ settings: {
847
+ width:492,
848
+ height:309,
849
+ speed:20,
850
+ space:2,
851
+ trView:'mask',
852
+ dir:'h',
853
+ layout:'boxed'
854
+ },
855
+ controls: {
856
+ arrows: {},
857
+ circletimer: {color:"#FFFFFF" , stroke:9},
858
+ bullets: {autohide:false}
859
+ },
860
+ disableControls: true
861
+ },
862
+
863
+ {
864
+ name:'Slider in Flat Laptop',
865
+ value:'flat-laptop',
866
+ className:'ms-laptop-template',
867
+ img: __MSP_PATH + 'images/templates/flat-laptop.png',
868
+ settings: {
869
+ width:492,
870
+ height:309,
871
+ speed:20,
872
+ space:2,
873
+ trView:'mask',
874
+ dir:'h',
875
+ layout:'boxed'
876
+ },
877
+ controls: {
878
+ arrows: {},
879
+ circletimer: {color:"#FFFFFF" , stroke:9},
880
+ bullets: {autohide:false}
881
+ },
882
+ disableControls: true
883
+ },
884
+
885
+ {
886
+ name:'Slider in Tablet',
887
+ value:'tablet',
888
+ className:'ms-tablet-template',
889
+ img: __MSP_PATH + 'images/templates/tablet.png',
890
+ settings: {
891
+ width:400,
892
+ height:534,
893
+ speed:20,
894
+ space:2,
895
+ trView:'wave',
896
+ dir:'h',
897
+ layout:'boxed'
898
+ },
899
+ controls: {
900
+ arrows: {},
901
+ circletimer: {color:"#FFFFFF" , stroke:9},
902
+ bullets: {autohide:false}
903
+ },
904
+ disableControls: true
905
+ },
906
+
907
+ {
908
+ name:'Slider in Flat Tablet',
909
+ value:'flat-tablet',
910
+ className:'ms-tablet-template',
911
+ img: __MSP_PATH + 'images/templates/flat-tablet.png',
912
+ settings: {
913
+ width:400,
914
+ height:534,
915
+ speed:20,
916
+ space:2,
917
+ trView:'basic',
918
+ dir:'h',
919
+ layout:'boxed'
920
+ },
921
+ controls: {
922
+ arrows: {},
923
+ circletimer: {color:"#FFFFFF" , stroke:9},
924
+ bullets: {autohide:false}
925
+ },
926
+ disableControls: true
927
+ },
928
+
929
+ {
930
+ name:'Slider in Landscape Tablet',
931
+ value:'tablet-land',
932
+ className:'ms-tablet-template ms-tablet-land',
933
+ img: __MSP_PATH + 'images/templates/tablet-land.png',
934
+ settings: {
935
+ width:632,
936
+ height:476,
937
+ speed:20,
938
+ space:2,
939
+ trView:'mask',
940
+ dir:'h',
941
+ layout:'boxed'
942
+ },
943
+ controls: {
944
+ arrows: {},
945
+ circletimer: {color:"#FFFFFF" , stroke:9},
946
+ bullets: {autohide:false}
947
+ },
948
+ disableControls: true
949
+ },
950
+
951
+ {
952
+ name:'Slider in Flat Landscape Tablet',
953
+ value:'flat-tablet-land',
954
+ className:'ms-tablet-template ms-tablet-land',
955
+ img: __MSP_PATH + 'images/templates/flat-tablet-land.png',
956
+ settings: {
957
+ width:632,
958
+ height:476,
959
+ speed:20,
960
+ space:2,
961
+ trView:'mask',
962
+ dir:'h',
963
+ layout:'boxed'
964
+ },
965
+ controls: {
966
+ arrows: {},
967
+ circletimer: {color:"#FFFFFF" , stroke:9},
968
+ bullets: {autohide:false}
969
+ },
970
+ disableControls: true
971
+ },
972
+
973
+ {
974
+ name:'Slider in Smart Phone',
975
+ value:'phone',
976
+ className:'ms-phone-template',
977
+ img: __MSP_PATH + 'images/templates/phone.png',
978
+ settings: {
979
+ width:258,
980
+ height:456,
981
+ speed:20,
982
+ space:2,
983
+ trView:'wave',
984
+ dir:'h',
985
+ layout:'boxed'
986
+ },
987
+ controls: {
988
+ arrows: {},
989
+ circletimer: {color:"#FFFFFF" , stroke:9},
990
+ bullets: {autohide:false}
991
+ },
992
+ disableControls: true
993
+ },
994
+
995
+ {
996
+ name:'Slider in Flat Smart Phone',
997
+ value:'flat-phone',
998
+ className:'ms-phone-template',
999
+ img: __MSP_PATH + 'images/templates/flat-phone.png',
1000
+ settings: {
1001
+ width:258,
1002
+ height:456,
1003
+ speed:20,
1004
+ space:2,
1005
+ trView:'basic',
1006
+ dir:'h',
1007
+ layout:'boxed'
1008
+ },
1009
+ controls: {
1010
+ arrows: {},
1011
+ circletimer: {color:"#FFFFFF" , stroke:9},
1012
+ bullets: {autohide:false}
1013
+ },
1014
+ disableControls: true
1015
+ },
1016
+
1017
+ {
1018
+ name:'Slider in Landscape Smart Phone',
1019
+ value:'phone-land',
1020
+ className:'ms-phone-template ms-phone-land',
1021
+ img: __MSP_PATH + 'images/templates/phone-land.png',
1022
+ settings: {
1023
+ width:456,
1024
+ height:258,
1025
+ speed:20,
1026
+ space:2,
1027
+ trView:'mask',
1028
+ dir:'h',
1029
+ layout:'boxed'
1030
+ },
1031
+ controls: {
1032
+ arrows: {},
1033
+ circletimer: {color:"#FFFFFF" , stroke:9},
1034
+ bullets: {autohide:false}
1035
+ },
1036
+ disableControls: true
1037
+ },
1038
+
1039
+ {
1040
+ name:'Slider in Flat Landscape Smart Phone',
1041
+ value:'flat-phone-land',
1042
+ className:'ms-phone-template ms-phone-land',
1043
+ img: __MSP_PATH + 'images/templates/flat-phone-land.png',
1044
+ settings: {
1045
+ width:456,
1046
+ height:258,
1047
+ speed:20,
1048
+ space:2,
1049
+ trView:'mask',
1050
+ dir:'h',
1051
+ layout:'boxed'
1052
+ },
1053
+ controls: {
1054
+ arrows: {},
1055
+ bullets: {autohide:false}
1056
+ },
1057
+ disableControls: true
1058
+ },
1059
+
1060
+ {
1061
+ name:'Vertical Slider',
1062
+ value:'vertical-slider',
1063
+ className:'ms-vertical-template',
1064
+ img: __MSP_PATH + 'images/templates/vertical-slider.png',
1065
+ settings: {
1066
+ space:5,
1067
+ dir:'v'
1068
+ },
1069
+ controls: {
1070
+ arrows: {},
1071
+ scrollbar: {dir:'v'},
1072
+ circletimer: {color:"#FFFFFF" , stroke:9},
1073
+ thumblist : {autohide:false ,dir:'v',space:5,margin:5,align:'right'}
1074
+ }
1075
+ },
1076
+
1077
+ {
1078
+ name:'Staff Carousel V1',
1079
+ value:'staff-1',
1080
+ className:'ms-staff-carousel',
1081
+ img: __MSP_PATH + 'images/templates/staff-1.png',
1082
+ settings: {
1083
+ loop:true,
1084
+ width:240,
1085
+ height:240,
1086
+ speed:20,
1087
+ trView:'focus',
1088
+ layout:'partialview',
1089
+ space:0,
1090
+ wheel:true,
1091
+ dir:'h'
1092
+ },
1093
+ controls: {
1094
+ arrows: {},
1095
+ slideinfo: {autohide:false, align:'bottom', size:160}
1096
+ }
1097
+ },
1098
+
1099
+ {
1100
+ name:'Staff Carousel V2',
1101
+ value:'staff-2',
1102
+ className:'ms-staff-carousel',
1103
+ img: __MSP_PATH + 'images/templates/staff-2.png',
1104
+ settings: {
1105
+ loop:true,
1106
+ width:240,
1107
+ height:240,
1108
+ speed:20,
1109
+ trView:'fadeBasic',
1110
+ layout:'partialview',
1111
+ space:0,
1112
+ dir:'h'
1113
+ },
1114
+ controls: {
1115
+ arrows: {},
1116
+ slideinfo: {autohide:false, align:'bottom', size:160}
1117
+ }
1118
+ },
1119
+
1120
+ {
1121
+ name:'Staff Carousel V3',
1122
+ value:'staff-3',
1123
+ className:'ms-staff-carousel ms-round',
1124
+ img: __MSP_PATH + 'images/templates/staff-3.png',
1125
+ settings: {
1126
+ loop:true,
1127
+ width:240,
1128
+ height:240,
1129
+ speed:20,
1130
+ trView:'focus',
1131
+ layout:'partialview',
1132
+ space:0,
1133
+ space:35,
1134
+ dir:'h'
1135
+ },
1136
+ controls: {
1137
+ arrows: {},
1138
+ slideinfo: {autohide:false, align:'bottom', size:160}
1139
+ }
1140
+ },
1141
+
1142
+ {
1143
+ name:'Staff Carousel V4',
1144
+ value:'staff-4',
1145
+ className:'ms-staff-carousel ms-round',
1146
+ img: __MSP_PATH + 'images/templates/staff-4.png',
1147
+ settings: {
1148
+ loop:true,
1149
+ width:240,
1150
+ height:240,
1151
+ speed:20,
1152
+ trView:'fadeBasic',
1153
+ layout:'partialview',
1154
+ space:0,
1155
+ space:45,
1156
+ dir:'h'
1157
+ },
1158
+ controls: {
1159
+ arrows: {},
1160
+ slideinfo: {autohide:false, align:'bottom', size:160}
1161
+ }
1162
+ },
1163
+
1164
+ {
1165
+ name:'Staff Carousel V5',
1166
+ value:'staff-5',
1167
+ className:'ms-staff-carousel',
1168
+ img: __MSP_PATH + 'images/templates/staff-5.png',
1169
+ settings: {
1170
+ loop:true,
1171
+ width:240,
1172
+ height:240,
1173
+ speed:20,
1174
+ trView:'wave',
1175
+ layout:'partialview',
1176
+ space:0,
1177
+ wheel:true,
1178
+ dir:'h'
1179
+ },
1180
+ controls: {
1181
+ arrows: {},
1182
+ slideinfo: {autohide:false, align:'bottom', size:160}
1183
+ }
1184
+ },
1185
+
1186
+ {
1187
+ name:'Staff Carousel V6',
1188
+ value:'staff-6',
1189
+ className:'ms-staff-carousel',
1190
+ img: __MSP_PATH + 'images/templates/staff-6.png',
1191
+ settings: {
1192
+ loop:true,
1193
+ width:240,
1194
+ height:240,
1195
+ speed:20,
1196
+ trView:'flow',
1197
+ layout:'partialview',
1198
+ space:0,
1199
+ wheel:true,
1200
+ dir:'h'
1201
+ },
1202
+ controls: {
1203
+ arrows: {},
1204
+ slideinfo: {autohide:false, align:'bottom', size:160}
1205
+ }
1206
+ },
1207
+ ];
1208
+ //js\mspanel\views\UIViews.js
1209
+
1210
+ /* ---------------------------------------------------------
1211
+ Slideframe
1212
+ ------------------------------------------------------------*/
1213
+ MSPanel.SlideFrame = Ember.View.extend({
1214
+ classNames : ['msp-slideframe'],
1215
+ classNameBindings: ['selected:active'],
1216
+ selected : false,
1217
+ thumb_src : '',
1218
+ showbtnclass : 'msp-ico msp-ico-whitehide',
1219
+
1220
+ template : Ember.Handlebars.compile('<div class="msp-img-cont">'+
1221
+ '{{#if view.hasImg}}'+
1222
+ '<div class="msp-imgselect-preview" {{bind-attr style=view.preview}})"></div>'+
1223
+ '{{/if}}'+
1224
+ '</div>'+
1225
+ '<span class="msp-frame-slideorder">#{{view.order}}</span>'+
1226
+ '<div class="msp-framehandle">'+
1227
+ '<ul>'+
1228
+ '<li><a title="'+__MSP_LAN.ui_001+'" href="#" {{action "hideswitch" target=view}}><span {{bind-attr class=view.showbtnclass}}></span></a></li>'+
1229
+ '<li><a title="'+__MSP_LAN.ui_002+'" href="#" {{action "duplicate" target=view}}><span class="msp-ico msp-ico-whiteduplicate"></span></a></li>'+
1230
+ '<li><a title="'+__MSP_LAN.ui_003+'" href="#" {{action "remove" target=view}}><span class="msp-ico msp-ico-whiteremove"></span></a></li>'+
1231
+ '</ul>'+
1232
+ '</div>'),
1233
+
1234
+ click : function(event){
1235
+ this.get('controller').send('select' , this.get('slide'));
1236
+ },
1237
+
1238
+ onValueChanged: function(){
1239
+ var hasImg = !Ember.isEmpty(this.get('slide.bg'));
1240
+ this.beginPropertyChanges();
1241
+ this.set('hasImg' ,hasImg);
1242
+ if(hasImg){
1243
+ this.set('preview', 'background-image:url(' + this.get('slide.bgThumb') + ');');
1244
+ }
1245
+ this.endPropertyChanges();
1246
+ }.observes('slide.bg').on('didInsertElement'),
1247
+
1248
+ onSelect : function(){
1249
+ var slide = this.get('slide');
1250
+
1251
+ this.set('selected' , slide === this.get('controller.currentSlide'));
1252
+
1253
+ }.observes('controller.currentSlide').on('init'),
1254
+
1255
+ hideChange : function(){
1256
+ if(this.get('slide.ishide'))
1257
+ this.set('showbtnclass' , 'msp-ico msp-ico-whitehide msp-ico-whiteshow');
1258
+ else
1259
+ this.set('showbtnclass' , 'msp-ico msp-ico-whitehide');
1260
+
1261
+ }.observes('slide.ishide').on('init'),
1262
+
1263
+ order: function(){
1264
+ return this.get('slide.order') + 1;
1265
+ }.property('slide.order'),
1266
+
1267
+ actions : {
1268
+ duplicate : function(){
1269
+ this.get('controller').duplicateSlide(this.get('slide'));
1270
+ },
1271
+
1272
+ hideswitch : function(){
1273
+ this.set('slide.ishide' , !this.get('slide.ishide'));
1274
+ },
1275
+
1276
+ remove : function(){
1277
+ if(confirm(__MSP_LAN.ui_004))
1278
+ this.get('controller').removeSlide(this.get('slide'));
1279
+ }
1280
+ }
1281
+ });
1282
+
1283
+ /* ---------------------------------------------------------
1284
+ SlideList
1285
+ ------------------------------------------------------------*/
1286
+ MSPanel.SlideList = Ember.View.extend({
1287
+ tagName : 'ul',
1288
+ classNames : ['msp-slides'],
1289
+
1290
+ template : Ember.Handlebars.compile(
1291
+ '{{#each item in controller}}'+
1292
+ '<li class="msp-slideframe-item" {{bind-attr data-id=item.id}}>{{view MSPanel.SlideFrame slide=item}}</li>'+
1293
+ '{{/each}}'+
1294
+ '<li class="msp-addslide-cont">'+
1295
+ '<div class="msp-addslide" {{action "newSlide"}}>'+
1296
+ '<span class="msp-ico msp-ico-grayaddlarge"></span>'+
1297
+ '<span class="msp-addslide-label">Add Slide</span>'+
1298
+ '</div>'+
1299
+ '</li>'),
1300
+
1301
+ didInsertElement : function(){
1302
+
1303
+ var that = this;
1304
+
1305
+ this.$().sortable({
1306
+ placeholder: "msp-frames-srtplaceholder",
1307
+ items: ">li:not(.msp-addslide-cont)",
1308
+ delay: 100,
1309
+ update : function(event , ui){that.updateSort();},
1310
+ create: function(event, ui){that.updateSort();}
1311
+ });
1312
+
1313
+ },
1314
+
1315
+ updateSort: function(){
1316
+ var indexes = {};
1317
+ $('.msp-slideframe-item').each(function(index) {
1318
+ indexes[$(this).data('id')] = index;
1319
+ });
1320
+ this.$().sortable('cancel');
1321
+ this.get('controller').updateSlidesSort(indexes);
1322
+ }
1323
+ });
1324
+
1325
+
1326
+ /* ---------------------------------------------------------
1327
+ ImgSelect
1328
+ ------------------------------------------------------------*/
1329
+
1330
+
1331
+ /*
1332
+ var frame; // to store already used upload frame
1333
+
1334
+ $upload_btn.on( 'click', function() {
1335
+ var $this = $(this);
1336
+ // get input field (the image src field)
1337
+ var $input = $this.siblings('input[type="text"]');
1338
+
1339
+ // If the frame already exists, re-open it.
1340
+ if ( frame ) {
1341
+ frame.open();
1342
+ return;
1343
+ }
1344
+
1345
+ var frame = wp.media.frames.frame = wp.media({
1346
+ title: "Select Image", // the select button label in media uploader
1347
+ multiple: false, // use single image upload or multiple?
1348
+ frame: 'select',
1349
+ library: { type: 'image' },
1350
+ button : { text : 'Add Image' }
1351
+ });
1352
+
1353
+ // on "Add Image" button clicked in media uploader
1354
+ frame.on( 'select', function() {
1355
+ var attachment = frame.state().get('selection').first().toJSON();
1356
+ $input.val(attachment.url).trigger('change'); // insert attachment url in our input field
1357
+ });
1358
+
1359
+ // open media uploader
1360
+ frame.open();
1361
+ });
1362
+ */
1363
+
1364
+
1365
+ MSPanel.ImgSelect = Ember.View.extend({
1366
+ classNames : ['msp-imgselect'],
1367
+ value : '',
1368
+ hasImg : false,
1369
+ frame: null,
1370
+ template : Ember.Handlebars.compile('<div class="msp-img-cont">'+
1371
+ '{{#if view.hasImg}}'+
1372
+ '<div class="msp-imgselect-preview" {{bind-attr style=view.preview}})"></div>'+
1373
+ '{{/if}}'+
1374
+ '</div>'+
1375
+ '{{#if view.hasImg}}'+
1376
+ '<button {{action removeImg target="view"}} class="msp-img-btn"><span class="msp-ico msp-ico-grayremove"></span></button>'+
1377
+ '{{else}}'+
1378
+ '<button {{action addImg target="view"}} class="msp-img-btn"><span class="msp-ico msp-ico-grayadd"></span></button>'+
1379
+ '{{/if}}'),
1380
+
1381
+ willDestroyElement: function(){
1382
+ var frame = this.get('frame');
1383
+
1384
+ if(frame){
1385
+ frame.detach();
1386
+ frame.remove();
1387
+ frame = null;
1388
+ this.set('frame', null);
1389
+ }
1390
+ },
1391
+
1392
+ onValueChanged: function(){
1393
+ this.beginPropertyChanges();
1394
+ this.set('hasImg' , !Ember.isEmpty(this.get('value')));
1395
+ this.set('preview', 'background-image:url(' + this.get('thumb') + ');') ;
1396
+ this.endPropertyChanges();
1397
+ }.observes('value').on('didInsertElement'),
1398
+
1399
+ actions : {
1400
+ removeImg : function(){
1401
+ this.beginPropertyChanges();
1402
+ this.set('value' , undefined);
1403
+ this.set('thumb' , undefined);
1404
+ this.endPropertyChanges();
1405
+ },
1406
+
1407
+ addImg : function(){
1408
+ if( typeof wp === 'undefined'){
1409
+ return;
1410
+ }
1411
+
1412
+ var that = this,
1413
+ frame = this.get('frame');
1414
+
1415
+ if ( frame ) {
1416
+ frame.open();
1417
+
1418
+ return;
1419
+ }
1420
+
1421
+ var frame = wp.media.frames.frame = wp.media({
1422
+ title: "Select Image", // the select button label in media uploader
1423
+ multiple: false, // use single image upload or multiple?
1424
+ frame: 'select',
1425
+ library: { type: 'image' },
1426
+ button : { text : 'Add Image' }
1427
+ });
1428
+
1429
+ // on "Add Image" button clicked in media uploader
1430
+ frame.on( 'select', function() {
1431
+ var attachment = frame.state().get('selection').first().toJSON();
1432
+ //console.log(attachment)
1433
+ that.set('thumb', (attachment.sizes.thumbnail || attachment.sizes.full).url);
1434
+ that.set('value', attachment.url);
1435
+ });
1436
+
1437
+ // open media uploader
1438
+ frame.open();
1439
+ this.set('frame', frame);
1440
+ }
1441
+ }
1442
+ });
1443
+
1444
+ /* ---------------------------------------------------------
1445
+ Selectbox
1446
+ ------------------------------------------------------------*/
1447
+
1448
+ MSPanel.Select = Ember.Select.extend({
1449
+ tagName: 'div',
1450
+ classNames: ['msp-ddlist'],
1451
+ layout: Ember.Handlebars.compile('<select>{{yield}}</select>'),
1452
+ value: null,
1453
+ width: 100,
1454
+
1455
+ didInsertElement: function(){
1456
+ var that = this;
1457
+ this.$('select').on('change', function(){
1458
+ var option = that.$('select option:selected');
1459
+ that.set('value', option.attr('value'));
1460
+ }).width(this.get('width'));
1461
+
1462
+ this.onValueChanged();
1463
+ },
1464
+
1465
+ onValueChanged: function(){
1466
+ if( !Ember.isEmpty(this.get('value')) ){
1467
+ this.$('select').val(this.get('value'));
1468
+ }
1469
+ }.observes('value')
1470
+
1471
+ /*classNames:['msp-selectbox'],
1472
+ tagName:'div',
1473
+ layout: Ember.Handlebars.compile('<select>{{yield}}</select>'),
1474
+ width:100,
1475
+ didInsertElement: function() {
1476
+ var that = this,
1477
+ isFirst = true;
1478
+ var ddslick = this.$('select').ddslick({width:this.get('width') , onSelected: function(selectedData){
1479
+ !isFirst && that.set('value' , selectedData.selectedData.value);
1480
+ isFirst = false;
1481
+ } });
1482
+ this.onValueChanged();
1483
+ },
1484
+
1485
+ onValueChanged: function(){
1486
+ var that = this,
1487
+ cindex = 0;
1488
+ this.$('.dd-option-value').each(function(){
1489
+ var $this = $(this);
1490
+
1491
+ if( $this.attr('value') === that.get('value') ){
1492
+ that.$('.dd-container').ddslick('select' , {index:cindex});
1493
+ return false;
1494
+ }
1495
+ cindex ++;
1496
+ });
1497
+
1498
+ }.observes('value')*/
1499
+ });
1500
+
1501
+
1502
+ /* ---------------------------------------------------------
1503
+ URLTarget
1504
+ ------------------------------------------------------------*/
1505
+ MSPanel.URLTarget = MSPanel.Select.extend({
1506
+
1507
+ onInit : function(){
1508
+ var contents = [{lable:__MSP_LAN.ui_005 , value:"_self"},
1509
+ {lable:__MSP_LAN.ui_006 , value:"_blank"},
1510
+ {lable:__MSP_LAN.ui_007 , value:"_parent"},
1511
+ {lable:__MSP_LAN.ui_008 , value:"_top"}];
1512
+
1513
+ this.set('content' , contents);
1514
+ this.set('optionValuePath' , "content.value");
1515
+ this.set('optionLabelPath' , "content.lable");
1516
+
1517
+ this.set('width' , 200);
1518
+
1519
+ }.on('init')
1520
+ /*
1521
+ didInsertElement: function(){
1522
+ //this.$().css('vertical-align', 'top');
1523
+ this._super();
1524
+ }*/
1525
+ });
1526
+
1527
+
1528
+ /* ---------------------------------------------------------
1529
+ Fillmode
1530
+ ------------------------------------------------------------*/
1531
+ MSPanel.Fillmode = Ember.View.extend({
1532
+ classNames : ['msp-fill-dd'],
1533
+ type : 'slide', // video
1534
+ value: 'fill',
1535
+ index: 1,
1536
+ template : Ember.Handlebars.compile('<select>{{#each item in view.contents}}'+
1537
+ '<option {{bind-attr value=item.value data-imagesrc=item.img}}>{{item.text}}</option>'+
1538
+ '{{/each}}</select>'),
1539
+ didInsertElement : function(){
1540
+ var that = this,
1541
+ isFirst = true;
1542
+ this.$('select').ddslick({width:154 , onSelected: function(selected){
1543
+ !isFirst && that.set('value' , selected.selectedData.value);
1544
+ isFirst = false;
1545
+ } });
1546
+
1547
+ this.onValueChanged();
1548
+ },
1549
+
1550
+ onValueChanged : function(){
1551
+ if( Ember.isEmpty(this.get('value')) ){
1552
+ return;
1553
+ }
1554
+ this.$('.dd-container').ddslick('select', {index:this.get('valuedic')[this.get('value')]});
1555
+ }.observes('value'),
1556
+
1557
+ onInit : function(){
1558
+ var contents , valuedic;
1559
+ if(this.get('type') === 'slide'){
1560
+
1561
+ contents = [{value:'fill' , text:__MSP_LAN.ui_009 , img: __MSP_PATH + 'images/fill.png' },
1562
+ {value:'fit' , text:__MSP_LAN.ui_010 , img: __MSP_PATH + 'images/fit.png' },
1563
+ {value:'center' , text:__MSP_LAN.ui_011 , img: __MSP_PATH + 'images/center.png' },
1564
+ {value:'stretch' , text:__MSP_LAN.ui_012 , img: __MSP_PATH + 'images/stretch.png' },
1565
+ {value:'tile' , text:__MSP_LAN.ui_013 , img: __MSP_PATH + 'images/tile.png' }];
1566
+
1567
+ valuedic = {fill:0 , fit:1 , center:2 , stretch:3 , tile:4};
1568
+
1569
+ }else if(this.get('type') === 'video'){
1570
+
1571
+ contents = [{value:'fill' , text:__MSP_LAN.ui_009 , img: __MSP_PATH + 'images/fill.png' },
1572
+ {value:'fit' , text:__MSP_LAN.ui_010 , img: __MSP_PATH + 'images/fit.png' }
1573
+ //{value:'none' , text:__MSP_LAN.ui_013 , img:'images/none.png' }
1574
+ ];
1575
+
1576
+ valuedic = {fill:0 , fit:1 , none:2};
1577
+ }
1578
+
1579
+ this.set('contents' , contents);
1580
+ this.set('valuedic' , valuedic);
1581
+ }.on('init')
1582
+
1583
+ });
1584
+
1585
+ /* ------------------------------------------------------- *\
1586
+ SimpleCodeBlock
1587
+ \* --------------------------------------------------------*/
1588
+ MSPanel.SimpleCodeBlock = Ember.View.extend({
1589
+ classNames: ['msp-shortcode-box'],
1590
+ template: Ember.Handlebars.compile('<input type="text" readonly {{bind-attr value=view.value}}>' ),
1591
+ width:150,
1592
+ didInsertElement: function(){
1593
+ this.$('input').on('click',function(){
1594
+ $(this).select();
1595
+ }).width(this.get('width'));
1596
+ }
1597
+ });//js\mspanel\views\SettingsView.js
1598
+
1599
+ /**
1600
+ * Settings Page View
1601
+ * @package MSPanel
1602
+ * @extends {Ember.View}
1603
+ */
1604
+
1605
+ MSPanel.SettingsView = Ember.View.extend({
1606
+ didInsertElement: function(){
1607
+ this.set('controller.mainView' , this);
1608
+ }
1609
+ });//js\mspanel\views\SlidesView.js
1610
+
1611
+ /**
1612
+ * Slides Page View
1613
+ * @package MSPanel
1614
+ * @extends {Ember.View}
1615
+ */
1616
+
1617
+ MSPanel.SlidesView = Ember.View.extend({
1618
+ didInsertElement: function(){
1619
+ this.set('controller.mainView' , this);
1620
+ }
1621
+ });//js\mspanel\views\StageView.js
1622
+
1623
+ /* ---------------------------------------------------------
1624
+ Stage View
1625
+ ------------------------------------------------------------*/
1626
+ MSPanel.StageArea = Ember.View.extend({
1627
+ classNames : ['msp-stage-area'],
1628
+ template : Ember.Handlebars.compile('{{view MSPanel.Stage}}'+
1629
+ '{{#if noticeMsg}}<div class="msp-stage-msg"><span class="msp-ico msp-ico-notice"></span>{{{noticeMsg}}}</div>{{/if}}'),
1630
+ });
1631
+
1632
+
1633
+ MSPanel.Stage = Ember.View.extend({
1634
+
1635
+ classNames : ['msp-slide-stage'],
1636
+ attributeBindings : ['style'],
1637
+ template : Ember.Handlebars.compile('<div id="stage-bg" class="msp-stage-bg"></div>'),
1638
+
1639
+ resize : function(){
1640
+
1641
+ var w = this.get('controller.sliderSettings.width'),
1642
+ h = this.get('controller.sliderSettings.height');
1643
+
1644
+ this.set('width' , w);
1645
+ this.set('height' , h);
1646
+
1647
+ this.$().css({
1648
+ width : w,
1649
+ height : h
1650
+ });
1651
+
1652
+ }.observes('controller.sliderSettings.width' , 'controller.sliderSettings.height').on('didInsertElement'),
1653
+
1654
+ didInsertElement : function(){
1655
+ var BG = this.$('#stage-bg'),
1656
+ BGImage = $('<img/>');
1657
+
1658
+ BGImage.css('visibelity' , 'hidden').each($.jqLoadFix);
1659
+
1660
+ var aligner = new MSAligner(this.get('controller.currentSlide.fillMode') , BG , BGImage);
1661
+
1662
+ this.set('bgAligner' , aligner);
1663
+ this.set('bgImg', BGImage);
1664
+ this.onBGChange();
1665
+ },
1666
+
1667
+ onBGColorChange: function(){
1668
+
1669
+ var color = this.get('controller.currentSlide.bgColor');
1670
+
1671
+ if( !Ember.isEmpty(color) ){
1672
+ this.$('#stage-bg').css('background-color', color);
1673
+ } else {
1674
+ this.$('#stage-bg').css('background-color', '');
1675
+ }
1676
+
1677
+ }.observes('controller.currentSlide.bgColor'),
1678
+
1679
+ onBGChange: function(){
1680
+ var alinger = this.get('bgAligner');
1681
+ if(alinger){
1682
+ alinger.reset();
1683
+ }
1684
+
1685
+ var bg = this.get('controller.currentSlide.bg'),
1686
+ bgImg = this.get('bgImg');
1687
+
1688
+ if( !Ember.isEmpty(bg) ){
1689
+ var that = this;
1690
+ bgImg.appendTo(this.$('#stage-bg'));
1691
+ bgImg.preloadImg(bg , function(event) {that._onBGLoad(event);});
1692
+ bgImg.attr('src', bg);
1693
+ //alinger.align();
1694
+ } else {
1695
+ bgImg.detach();
1696
+ }
1697
+ }.observes('controller.currentSlide.bg'),
1698
+
1699
+ _onBGLoad: function(event){
1700
+ var aligner = this.get('bgAligner');
1701
+
1702
+ if( !aligner ) {
1703
+ return;
1704
+ }
1705
+
1706
+ aligner.init(event.width , event.height);
1707
+ aligner.align();
1708
+ this.get('bgImg').css('visibelity' , '');
1709
+ },
1710
+
1711
+ onFillModeChanged : function(){
1712
+ var aligner = this.get('bgAligner');
1713
+ aligner.changeType(this.get('controller.currentSlide.fillMode'));
1714
+ }.observes('controller.currentSlide.fillMode'),
1715
+
1716
+ willDestroyElement: function(){
1717
+ this.set('bgAligner' , null);
1718
+ }
1719
+ });//js\mspanel\views\ControlsView.js
1720
+
1721
+ /*MSPanel.ControlsView = Ember.View.extend({
1722
+ didInsertElement: function(){
1723
+ this.get('controller').send('showControlOptions');
1724
+ }
1725
+ });
1726
+ */
1727
+ MSPanel.ControlBtn = Ember.View.extend({
1728
+ control: null,
1729
+ tagName: 'div',
1730
+ active:false,
1731
+ classNames: ['msp-control-btn'],
1732
+ classNameBindings: ['active:msp-blue-btn'],
1733
+
1734
+ template : Ember.Handlebars.compile('<span class="msp-control-label">{{view.control.label}}</span>'+
1735
+ '<a href="#" {{action "removeControl" target=view bubbles=false}}><span class="msp-control-removes msp-ico msp-ico-whiteremove"></span></a>'),
1736
+
1737
+
1738
+ didInsertElement: function() {
1739
+
1740
+ },
1741
+
1742
+ onActiveChange: function(){
1743
+ this.set('active', this.get('controller.currentControl') === this.get('control'));
1744
+
1745
+ if( this.get('active') ){
1746
+ this.get('controller').send('showControlOptions');
1747
+ }
1748
+
1749
+ }.observes('controller.currentControl').on('init'),
1750
+
1751
+ click: function(){
1752
+ if( this.get('active') ) {
1753
+ return;
1754
+ }
1755
+ this.set('controller.currentControl', this.get('control'));
1756
+ //this.get('controller').send('showControlOptions');
1757
+ },
1758
+
1759
+ actions: {
1760
+ removeControl: function(){
1761
+ if( confirm('Are you sure want to remvoe "' + this.get('control.label') + '" control?')){
1762
+ this.get('controller').send('removeControl', this.get('control'));
1763
+ }
1764
+ }
1765
+ }
1766
+
1767
+ });
1768
+ //js\mspanel\components\UIComponents.js
1769
+
1770
+ /**
1771
+ MSPanel UI Components
1772
+ Version 1.0b
1773
+ */
1774
+
1775
+ /* ---------------------------------------------------------
1776
+ Metabox
1777
+ ------------------------------------------------------------*/
1778
+
1779
+ MSPanel.MetaBoxComponent = Ember.Component.extend({
1780
+ tagName: 'div',
1781
+ classNames: ['msp-metabox'],
1782
+ layout: Ember.Handlebars.compile('<div class="msp-metabox-handle">'+
1783
+ '<h3 class="msp-metabox-title">{{title}}</h3>'+
1784
+ '<div class="msp-metabox-toggle"></div>'+
1785
+ '</div>'+
1786
+ '{{yield}}'+
1787
+ '<div class="clear"> </div>')
1788
+ });
1789
+
1790
+
1791
+ /* ---------------------------------------------------------
1792
+ Tabs
1793
+ ------------------------------------------------------------*/
1794
+
1795
+ Ember.TEMPLATES['components/tabs-panel'] = Ember.Handlebars.compile('{{yield}}');
1796
+ MSPanel.TabsPanelComponent = Ember.Component.extend({
1797
+ tagName: 'div',
1798
+ attributeBindings: ['id'],
1799
+ classNames: ['msp-metabox msp-metabox-tabs'],
1800
+ didInsertElement: function() {
1801
+ this.$().avertaLiveTabs();
1802
+ }
1803
+ });
1804
+
1805
+
1806
+ /* ---------------------------------------------------------
1807
+ Switchbox
1808
+ ------------------------------------------------------------*/
1809
+
1810
+ MSPanel.SwitchBoxComponent = Ember.Component.extend({
1811
+ classNames : ['msp-switchbox'],
1812
+ offlable : 'OFF',
1813
+ onlable : 'ON',
1814
+ value : false,
1815
+
1816
+ layout : Ember.Handlebars.compile('<div class="msp-switch-cont">'+
1817
+ '<span class="msp-switch-off">{{view.offlable}}</span>'+
1818
+ '<div class="msp-switch-handle"></div>'+
1819
+ '<span class="msp-switch-on">{{view.onlable}}</span>'+
1820
+ '</div>'),
1821
+
1822
+ click:function(){
1823
+ var that = this;
1824
+ that.set('value' , !that.get('value'));
1825
+ },
1826
+
1827
+ update: function(){
1828
+
1829
+ if(this.get('value')) this.$().addClass('switched');
1830
+ else this.$().removeClass('switched');
1831
+
1832
+ }.observes('value').on('didInsertElement')
1833
+
1834
+ });
1835
+
1836
+
1837
+ /* ---------------------------------------------------------
1838
+ WP TinyMCE Editor
1839
+ ------------------------------------------------------------*/
1840
+ var hiddenEditor = jQuery('#mspHiddenEditor')[0].outerHTML;
1841
+ function WPEditorTemplate(id){
1842
+ var newEditor = $(hiddenEditor);
1843
+ newEditor.find('link').remove(); // remove all css files init
1844
+ return newEditor.html().replace(/msp-hidden/g, id);
1845
+ }
1846
+ var __tmc_msp_id = 0;
1847
+
1848
+ MSPanel.WPEditor = Ember.View.extend({
1849
+ classNames : ['msp-wp-editor'],
1850
+ _id : null,
1851
+ template : null,
1852
+ tab: null,
1853
+ tabs: null,
1854
+
1855
+ onInit: function(){
1856
+ var id = 'msp-wpeditor-' + __tmc_msp_id;
1857
+ this.set('_id', id );
1858
+ this.set('template', Ember.Handlebars.compile( WPEditorTemplate(id)));
1859
+
1860
+ __tmc_msp_id++;
1861
+
1862
+ }.on('init'),
1863
+
1864
+ didInsertElement: function(){
1865
+ var tabs = this.get('tabs');
1866
+ if( Ember.isEmpty(tabs) ) {
1867
+ this.createEditor();
1868
+ return;
1869
+ }
1870
+
1871
+ // is in tabs
1872
+ $('#'+tabs).bind('avtTabChange', {that:this}, this.refreshEditor);
1873
+ },
1874
+
1875
+ refreshEditor: function(event , tab){
1876
+ var that = event.data.that;
1877
+
1878
+ if( that.get('tab') === tab ){
1879
+ that.createEditor();
1880
+ }
1881
+ },
1882
+
1883
+ createEditor: function(){
1884
+ if( this.get('inited') === true ){
1885
+ return;
1886
+ }
1887
+
1888
+ this.set('inited', true);
1889
+ var id = this.get('_id'),
1890
+ that = this;
1891
+
1892
+ // tinymce
1893
+ if( window.tinymce ){
1894
+ var settings = $.extend({}, window.tinyMCEPreInit.mceInit['msp-hidden'] || {});
1895
+ settings.forced_root_block = "";
1896
+ settings.force_br_newlines = true;
1897
+ settings.force_p_newlines = false;
1898
+ settings.wpautop = false;
1899
+
1900
+ if( tinyMCE.majorVersion == '3' ){
1901
+ settings.body_class = settings.elements = id;
1902
+ tinymce.init(settings);
1903
+ setTimeout(function(){
1904
+ that.initEditor(tinyMCE.getInstanceById(id));
1905
+ }, 50);
1906
+ } else if ( tinyMCE.majorVersion == '4' ){
1907
+ settings.body_class = "content post-type-post post-status-auto-draft post-format-standard";
1908
+ settings.selector = '#'+id;
1909
+ tinymce.init(settings);
1910
+ setTimeout(function(){
1911
+ that.initEditor(tinyMCE.get(id));
1912
+ }, 50);
1913
+ }
1914
+ settings.setup = function(ed) {
1915
+ //that.initEditor(ed);
1916
+ }
1917
+
1918
+ }
1919
+
1920
+ var qtagSettings = $.extend({}, window.tinyMCEPreInit.qtInit['msp-hidden'] || {}),
1921
+ qtags;
1922
+
1923
+ qtagSettings.id = id;
1924
+
1925
+ if ( typeof(QTags) === 'function' ) {
1926
+ qtags = quicktags(qtagSettings);
1927
+ QTags.buttonsInitDone = false;
1928
+ QTags._buttonsInit();
1929
+ that.set('qtags', qtags );
1930
+ switchEditors.go(id, 'html');
1931
+
1932
+ this.$('textarea#'+this.get('_id')).on('change keyup paste', function(e){
1933
+ that.set('internalChange', true);
1934
+ that.set('value', $(this).val());
1935
+ });
1936
+ }
1937
+ },
1938
+
1939
+ initEditor: function(mce){
1940
+ var id = this.get('_id'),
1941
+ value = this.get('value'),
1942
+ that = this;
1943
+
1944
+ this.$('.wp-editor-wrap').on('mousedown', function(){
1945
+ wpActiveEditor = id;
1946
+ });
1947
+
1948
+ function updateValue(ed,e){
1949
+ that.set('value', mce.getContent());
1950
+ }
1951
+
1952
+ function internalUpdate(ed,e){
1953
+ that.set('internalChange', true);
1954
+ that.set('value', mce.getContent());
1955
+ that.set('internalChange', false);
1956
+ }
1957
+
1958
+ // register events
1959
+ if( tinyMCE.majorVersion == '3' ){
1960
+ mce.onChange.add(internalUpdate);
1961
+ mce.onKeyUp.add(internalUpdate);
1962
+ } else if ( tinyMCE.majorVersion == '4' ){
1963
+ mce.on('change', internalUpdate);
1964
+ mce.on('keyup', internalUpdate);
1965
+ }
1966
+
1967
+ this.$().click(internalUpdate);
1968
+
1969
+ setTimeout(function(){
1970
+ switchEditors.go(id, 'html');
1971
+ switchEditors.go(id, 'tmce');
1972
+ }, 100);
1973
+
1974
+ this.set('mce', mce);
1975
+
1976
+ this.onValueChanged();
1977
+ },
1978
+
1979
+ onValueChanged: function(){
1980
+
1981
+ if( !this.get('inited') ){
1982
+ return;
1983
+ }
1984
+
1985
+ var value = this.get('value');
1986
+
1987
+ this.$('textarea#'+this.get('_id')).val(value);
1988
+
1989
+ if( this.get('internalChange') ){
1990
+ this.set('internalChange', false);
1991
+ return;
1992
+ }
1993
+
1994
+ var mce = this.get('mce');
1995
+ if( !Ember.isEmpty(mce) && value != null){
1996
+ mce.setContent(value);
1997
+ } else if( value == null ){
1998
+ mce.setContent(' ');
1999
+ }
2000
+
2001
+ }.observes('value'),
2002
+
2003
+ willDestroyElement: function(){
2004
+ if( !this.get('inited') ){
2005
+ return;
2006
+ }
2007
+
2008
+ if( window.tinymce ){
2009
+ tinymce.remove(this.get('_id'));
2010
+ }
2011
+
2012
+ var qtags = this.get('qtags');
2013
+ if( qtags ){
2014
+ $(qtags.toolbar).remove();
2015
+ qtags.toolbar = null;
2016
+ qtags = null;
2017
+
2018
+ if( QTags.instances[this.get('_id')] ) {
2019
+ delete QTags.instances[this.get('_id')];
2020
+ }
2021
+
2022
+ this.$('textarea#'+this.get('_id')).remove();
2023
+ }
2024
+
2025
+ var tabs = this.get('tabs');
2026
+ if( !Ember.isEmpty(tabs) ){
2027
+ $('#' + tabs).unbind('avtTabChange', this.refreshEditor);
2028
+ }
2029
+ }
2030
+ });
2031
+
2032
+
2033
+ /* ---------------------------------------------------------
2034
+ CKEditor
2035
+ ------------------------------------------------------------*/
2036
+ /*MSPanel.HTMLTextArea = Ember.TextArea.extend({
2037
+ didInsertElement: function() {
2038
+ this._super();
2039
+ var that = this;
2040
+
2041
+ var cke = CKEDITOR.replace( that.get('elementId'), {
2042
+ uiColor: '#f1f1f1',
2043
+ removeButtons: 'Underline,Subscript,Superscript',
2044
+ entities : false,
2045
+ htmlEncodeOutput: true,
2046
+ forcePasteAsPlainText: true,
2047
+ enterMode : CKEDITOR.ENTER_BR,
2048
+ shiftEnterMode: CKEDITOR.ENTER_P ,
2049
+ toolbarGroups : [
2050
+ { name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
2051
+ { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
2052
+ { name: 'links' },
2053
+ { name: 'insert' },
2054
+ { name: 'tools' },
2055
+
2056
+ { name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
2057
+ '/',
2058
+ { name: 'styles' },
2059
+ { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
2060
+ { name: 'paragraph', groups: [ 'blocks', 'align','list', 'indent' ] },
2061
+ { name: 'others' }
2062
+
2063
+ ]
2064
+
2065
+ });
2066
+
2067
+ var update = function(e){
2068
+ //if (e.editor.checkDirty()) {
2069
+ that.set('internalChange' , true);
2070
+ that.set('value', cke.getData());
2071
+ //console.log('changes', that.get('value'));
2072
+
2073
+ //}
2074
+ }
2075
+
2076
+ //cke.on( 'contentDom', function() {
2077
+ // var editable = cke.editable();
2078
+
2079
+ // editable.attachListener( editable, 'keyup', function() {
2080
+ // console.log( 'Editable has been clicked' );
2081
+ // update();
2082
+ // });
2083
+ //});
2084
+
2085
+ cke.on('key', update);
2086
+ cke.on('blur', update);
2087
+ cke.on('paste', update);
2088
+
2089
+ this.set('cke' , cke);
2090
+ },
2091
+
2092
+ willDestroyElement: function(){
2093
+ this.get('cke').destroy();
2094
+ //CKEDITOR.remove(this.get('cke'));
2095
+ this.set('cke', null);
2096
+ },
2097
+
2098
+ onValueChanged : function(){
2099
+ if(this.get('internalChange')){
2100
+ this.set('internalChange' , false);
2101
+ return;
2102
+ }
2103
+
2104
+ var cke = this.get('cke');
2105
+ cke.setData(this.get('value'));
2106
+ }.observes('value')
2107
+ });*/
2108
+
2109
+ /* ---------------------------------------------------------
2110
+ Number Input
2111
+ ------------------------------------------------------------*/
2112
+
2113
+ /* Fixed jQuery UI Spinner changing value without focus bug. */
2114
+ if( jQuery.ui && jQuery.ui.spinner ){
2115
+ jQuery.ui.spinner.prototype._events.mousewheel = function ( event, delta ) {
2116
+
2117
+ if ( !delta || !this.element.is(':focus') ) {
2118
+ return;
2119
+ }
2120
+ if ( !this.spinning && !this._start( event ) ) {
2121
+ return false;
2122
+ }
2123
+
2124
+ this._spin( (delta > 0 ? 1 : -1) * this.options.step, event );
2125
+ clearTimeout( this.mousewheelTimer );
2126
+ this.mousewheelTimer = this._delay(function() {
2127
+ if ( this.spinning ) {
2128
+ this._stop( event );
2129
+ }
2130
+ }, 100 );
2131
+ event.preventDefault();
2132
+ }
2133
+ }
2134
+
2135
+ MSPanel.NumberInputView = Ember.View.extend({
2136
+ step : 1,
2137
+ min: 0,
2138
+ tagName: 'input',
2139
+ attributeBindings:['type'],
2140
+ lastValue: null,
2141
+ type: 'text',
2142
+
2143
+ didInsertElement : function(){
2144
+
2145
+ var that = this,
2146
+ input = this.$();
2147
+ var updateValue = function(event, ui){
2148
+ var value = input.spinner('value');
2149
+ that.set('internalChange', true);
2150
+
2151
+ if( isNaN(value) || value == null ){
2152
+ that.set('value', undefined);
2153
+ }else{
2154
+ that.set('value', parseFloat(value));
2155
+ }
2156
+ }
2157
+
2158
+ input.on('change',updateValue).spinner({
2159
+ step: this.get('step'),
2160
+ numberFormat: "n",
2161
+ min:this.get('min'),
2162
+ max:this.get('max'),
2163
+ spin: updateValue,
2164
+ stop: updateValue
2165
+ }).spinner('value', this.get('value'));
2166
+
2167
+ },
2168
+
2169
+ onValueChanged : function(){
2170
+
2171
+ if(this.get('internalChange')){
2172
+ this.set('internalChange', false);
2173
+ return;
2174
+ }
2175
+
2176
+ //this.$().val(this.get('value'));
2177
+
2178
+ this.$().spinner('value', this.get('value'));
2179
+
2180
+
2181
+ /*if(this.get('internalChange')){
2182
+ this.set('internalChange', false);
2183
+ return;
2184
+ }*/
2185
+ //var value = Number(this.get('value'));
2186
+
2187
+ //this.$().val(value);
2188
+
2189
+ /*
2190
+ if(value == this.get('lastValue')){
2191
+ return;
2192
+ }
2193
+ // convert to number always
2194
+ if(value === '' || isNaN(value)){
2195
+ this.set('value', undefined);
2196
+ return;
2197
+ }
2198
+
2199
+ if( typeof value !== 'number') {
2200
+ this.set('value', Number(this.get('value')));
2201
+ }
2202
+
2203
+ if(!Ember.isEmpty(value) && value < this.get('min')){
2204
+ value = this.get('min');
2205
+ this.set('value' , value);
2206
+ }
2207
+
2208
+
2209
+
2210
+ */
2211
+ }.observes('value')
2212
+
2213
+ });
2214
+
2215
+ Ember.Handlebars.helper('number-input' , MSPanel.NumberInputView);
2216
+
2217
+ /**
2218
+ * Color Picker
2219
+ * @package MSPanel
2220
+ * @requires spectrum color picker
2221
+ */
2222
+ MSPanel.ColorPickerComponent = Ember.Component.extend({
2223
+ tagName: 'input',
2224
+ classNames: 'msp-color-picker',
2225
+ value: null,
2226
+
2227
+ didInsertElement: function(){
2228
+ var that = this;
2229
+ this.$().spectrum({
2230
+ color: this.get('value'),
2231
+ allowEmpty:true,
2232
+ showInput: true,
2233
+ showAlpha: true,
2234
+ clickoutFiresChange:true,
2235
+ preferredFormat: "hex6",
2236
+ change: function(color) {
2237
+ if( color === null) {
2238
+ that.set('value' , null);
2239
+ } else {
2240
+ that.set('value', color.toString());
2241
+ }
2242
+ }
2243
+ })
2244
+ },
2245
+
2246
+ willDestroyElement: function(){
2247
+ this.$().spectrum("destroy");
2248
+ },
2249
+ onValueChanged: function(){
2250
+ this.$().spectrum("set", this.get('value'));
2251
+ }.observes('value')
2252
+
2253
+ });
2254
+
2255
+ /**
2256
+ * Dropdwon list
2257
+ * @package MSPanel
2258
+ */
2259
+ MSPanel.DropdwonListComponent = Ember.Component.extend({
2260
+ tagName: 'div',
2261
+ classNames: ['msp-ddlist'],
2262
+ layout: Ember.Handlebars.compile('<select>{{yield}}</select>'),
2263
+ value: null,
2264
+ width: 100,
2265
+
2266
+ didInsertElement: function(){
2267
+ var that = this;
2268
+ this.$('select').on('change', function(){
2269
+ var option = that.$('select option:selected');
2270
+ that.set('value', option.attr('value'));
2271
+ }).width(this.get('width'));
2272
+
2273
+ this.onValueChanged();
2274
+ },
2275
+
2276
+ onValueChanged: function(){
2277
+ if( !Ember.isEmpty(this.get('value')) ){
2278
+ this.$('select').val(this.get('value'));
2279
+ }
2280
+ }.observes('value')
2281
+ });
2282
+
2283
+
2284
+ /**
2285
+ * CodeMirror Component
2286
+ * @package MSPanel
2287
+ * @requires Codemirror
2288
+ */
2289
+ MSPanel.CodeMirrorComponent = Ember.Component.extend({
2290
+ classNames: ['msp-codemirror'],
2291
+ width: 250,
2292
+ height: 200,
2293
+ mode: 'css',
2294
+ tab: null,
2295
+ tabs: null,
2296
+ layout: Ember.Handlebars.compile('<textarea>{{yield}}</textarea>'),
2297
+
2298
+ didInsertElement: function(){
2299
+
2300
+ this.$().width(this.get('width'))
2301
+ .height(this.get('height'));
2302
+
2303
+ var that = this,
2304
+ editor = CodeMirror.fromTextArea(this.$('>textarea')[0], {
2305
+ lineNumbers:true,
2306
+ mode:this.get('mode')
2307
+ });
2308
+
2309
+ editor.on('change', function(){
2310
+ that.set('internalChange', true);
2311
+ that.set('value', editor.getValue());
2312
+ })
2313
+
2314
+ this.set('editor', editor);
2315
+
2316
+ var value = this.get('value');
2317
+ if( !Ember.isEmpty(value) ) {
2318
+ editor.setValue(value);
2319
+ }
2320
+
2321
+ // is in tabs
2322
+ var tabs = this.get('tabs');
2323
+ if( !Ember.isEmpty(tabs) ){
2324
+ $('#'+tabs).bind('avtTabChange', {that:this}, this.refreshEditor);
2325
+ }
2326
+ },
2327
+
2328
+ onValueChanged: function(){
2329
+ if( this.get('internalChange') === true) {
2330
+ this.set('internalChange', false);
2331
+ return;
2332
+ }
2333
+
2334
+ this.get('editor').setValue(this.get('value'));
2335
+ this.set('internalChange', false);
2336
+
2337
+ }.observes('value'),
2338
+
2339
+ refreshEditor: function(event , tab){
2340
+ var that = event.data.that;
2341
+
2342
+ if( that.get('tab') === tab ) {
2343
+ that.get('editor').refresh();
2344
+ }
2345
+ },
2346
+
2347
+ willDestroyElement: function(){
2348
+ var tabs = this.get('tabs');
2349
+ if( !Ember.isEmpty(tabs) ){
2350
+ $('#' + tabs).unbind('avtTabChange', this.refreshEditor);
2351
+ }
2352
+
2353
+ var editor = this.get('editor');
2354
+ editor.toTextArea();
2355
+ editor = null;
2356
+ this.set('editor', null);
2357
+ }
2358
+
2359
+ });//js\mspanel\controllers\ApplicationController.js
2360
+
2361
+ /*
2362
+ * Application controller
2363
+ * @package MSPanel
2364
+ */
2365
+
2366
+ MSPanel.pushData = null;
2367
+ MSPanel.ApplicationController = Ember.Controller.extend({
2368
+
2369
+ sliderId : MSPanel.SliderID,
2370
+
2371
+ // if true save button will be disabled
2372
+ isSending: false,
2373
+
2374
+ // the status message that appears after save button
2375
+ statusMsg: '',
2376
+
2377
+ hasError: false,
2378
+
2379
+
2380
+ onInit: function(){
2381
+ // fetch all data
2382
+
2383
+ //setting
2384
+ MSPanel.Settings.find();
2385
+ // slides
2386
+ MSPanel.Slide.find();
2387
+ // layer
2388
+ //MSPanel.Layer.find();
2389
+ // style
2390
+ //MSPanel.Style.find();
2391
+ // effect
2392
+ //MSPanel.Effect.find();
2393
+ // style
2394
+ //MSPanel.PresetStyle.find();
2395
+ // effect
2396
+ //MSPanel.PresetEffect.find();
2397
+ //control
2398
+ MSPanel.Control.find();
2399
+ //callback
2400
+ MSPanel.Callback.find();
2401
+ //buttonClass
2402
+ //MSPanel.ButtonStyle.find();
2403
+
2404
+ //this.set('useCustomTemplate', MSPanel.Settings.find(0).get('msTemplate') === 'custom');
2405
+ this.set('disableControls', MSPanel.Settings.find(0).get('disableControls'));
2406
+
2407
+ var that = this;
2408
+ MSPanel.pushData = function(){
2409
+ that.prepareData();
2410
+ };
2411
+
2412
+ // redirect if woocommerce not installed
2413
+ if ( __MSP_TYPE === 'wc-product' && __MSP_POST == null && __WC_INSTALL_URL != null ){
2414
+ this.set('hasError', true);
2415
+ this.set('errorTemplate', 'wooc-error');
2416
+ this.set('wooLink', __WC_INSTALL_URL);
2417
+ }
2418
+
2419
+ // generate buttons style element
2420
+ this.generateButtonStyles();
2421
+
2422
+ this.set('shortCode', '[masterslider id='+this.get('sliderId')+']');
2423
+ this.set('phpFunction', '<?php masterslider('+this.get('sliderId')+'); ?>');
2424
+
2425
+ jQuery('#panelLoading').remove();
2426
+
2427
+ }.on('init'),
2428
+
2429
+ prepareData: function(){
2430
+ // Generate used fonts
2431
+ var fonts = {},
2432
+ font_str = '';
2433
+ MSPanel.Style.find().forEach(function(record){
2434
+ var font = record.get('fontFamily'),
2435
+ weight = record.get('fontWeight');
2436
+
2437
+ if( !Ember.isEmpty(font) ){
2438
+
2439
+ if( !fonts[font] ){
2440
+ fonts[font] = [];
2441
+ }
2442
+
2443
+ if( weight === 'normal' ){
2444
+ weight = 'regular';
2445
+ }
2446
+
2447
+ if( !Ember.isEmpty(weight) && fonts[font].indexOf(weight) === -1 ) {
2448
+ fonts[font].push(weight);
2449
+ }
2450
+ }
2451
+ });
2452
+
2453
+ for(var font in fonts){
2454
+ font_str += font.replace(/\s/, '+') + ':' + fonts[font].join(',') + '|';
2455
+ }
2456
+
2457
+ MSPanel.Settings.find(1).set('usedFonts', font_str.slice(0,-1));
2458
+
2459
+ // save all models
2460
+
2461
+ // settings
2462
+ this.saveRecords(MSPanel.Settings.find());
2463
+ // slides
2464
+ this.saveRecords(MSPanel.Slide.find());
2465
+ /*// layer
2466
+ this.saveRecords(MSPanel.Layer.find());
2467
+ // style
2468
+ this.saveRecords(MSPanel.Style.find());
2469
+ // effect
2470
+ this.saveRecords(MSPanel.Effect.find());
2471
+ // preset style
2472
+ this.saveRecords(MSPanel.PresetStyle.find());
2473
+ // preset effect
2474
+ this.saveRecords(MSPanel.PresetEffect.find());*/
2475
+ // control
2476
+ this.saveRecords(MSPanel.Control.find());
2477
+ // callback functions
2478
+ this.saveRecords(MSPanel.Callback.find());
2479
+ // button classes
2480
+ //this.saveRecords(MSPanel.ButtonStyle.find());
2481
+
2482
+ //console.log('saving data');
2483
+ },
2484
+
2485
+ generateButtonStyles: function(){
2486
+ var styles = MSPanel.ButtonStyle.find(),
2487
+ css = '',
2488
+ $styleElement = $('#msp-buttons');
2489
+
2490
+ styles.forEach(function(style){
2491
+ css += '.' + style.get('className') + ' {'+
2492
+ style.get('normal')+
2493
+ '}\n'+
2494
+
2495
+ '.' + style.get('className') + ':hover {'+
2496
+ style.get('hover')+
2497
+ '}\n'+
2498
+ '.' + style.get('className') + ':active {'+
2499
+ style.get('active')+
2500
+ '}\n';
2501
+ });
2502
+
2503
+ if( $styleElement.length === 0 ) {
2504
+ $styleElement = $('<style id="msp-buttons"></style>').text(css).appendTo($('head'));
2505
+ } else {
2506
+ $styleElement.text(css);
2507
+ }
2508
+ },
2509
+
2510
+ actions: {
2511
+ saveAll: function(){
2512
+ this.prepareData();
2513
+ this.sendData();
2514
+ },
2515
+
2516
+ showPreview: function(event){
2517
+ if(window.lunchMastersliderPreview){
2518
+ lunchMastersliderPreview(event);
2519
+ }
2520
+ }
2521
+ },
2522
+
2523
+ saveRecords: function(records){
2524
+ records.forEach(function(record){ record.save(); });
2525
+ },
2526
+
2527
+ /**
2528
+ * Send Data to WP Admin
2529
+ * @since 1.0.0
2530
+ * @return {null}
2531
+ */
2532
+ sendData: function(){
2533
+
2534
+ this.set('statusMsg', __MSP_LAN.ap_001);
2535
+ this.set('isSending', true);
2536
+ var that = this;
2537
+
2538
+
2539
+ jQuery.post(
2540
+ __MS.ajax_url,
2541
+ {
2542
+ action : 'msp_panel_handler', // the handler
2543
+ nonce : jQuery('#msp-main-wrapper').data('nonce'), // the generated nonce value
2544
+ msp_data : B64.encode(JSON.stringify(MSPanel.data)),
2545
+ preset_style : B64.encode(JSON.stringify(MSPanel.PSData)),
2546
+ preset_effect : B64.encode(JSON.stringify(MSPanel.PEData)),
2547
+ buttons : B64.encode(JSON.stringify(MSPanel.PBData)),
2548
+ slider_id : MSPanel.SliderID,
2549
+ },
2550
+ function(res){
2551
+ that.set('statusMsg', res.message);
2552
+ that.set('isSending', false);
2553
+ /*if( res.success === true ){
2554
+ that.set('statusMsg', __MSP_LAN.ap_003);
2555
+ that.set('isSending', false);
2556
+ }else{
2557
+ that.set('isSending', false);
2558
+ that.set('statusMsg', __MSP_LAN.ap_002);
2559
+ }*/
2560
+ }
2561
+ );
2562
+ }
2563
+
2564
+ });
2565
+
2566
+
2567
+ //js\mspanel\controllers\SettingsController.js
2568
+
2569
+
2570
+ /**
2571
+ * Master Slider Settings Controller
2572
+ * @package MSPanel
2573
+ * @extends {Ember.Controller}
2574
+ */
2575
+ MSPanel.SettingsController = Ember.ObjectController.extend({
2576
+
2577
+ customSlider : window.__MSP_TYPE && window.__MSP_TYPE === 'custom',
2578
+ templateSlider : window.__MSP_TYPE && ( window.__MSP_TYPE === 'flickr' || window.__MSP_TYPE === 'post' || window.__MSP_TYPE === 'wc-product' || window.__MSP_TYPE === 'facebook'),
2579
+
2580
+ sliderSkins : __MSP_SKINS,
2581
+
2582
+
2583
+ needs: ['application', 'controls'],
2584
+ msTemplateName: null,
2585
+ msTemplateImg: null,
2586
+ draftMSTemplate:null,
2587
+ templates: MSPanel.SliderTemplates,
2588
+
2589
+ showAutoHeight: false,
2590
+ showNearbyNum: false,
2591
+ showWrapperWidth: false,
2592
+ preloadMethod: null,
2593
+
2594
+ /**
2595
+ * Setup controller init values
2596
+ * It called from ember router in MSPanel.js
2597
+ */
2598
+ setup: function(){
2599
+ // read preload valu from model and setup preload select list
2600
+ var preload = this.get('preload');
2601
+ if( preload === 'all' || preload === '-1' ){
2602
+ this.set('preloadMethod' , preload);
2603
+ } else {
2604
+ this.set('preloadMethod' , 'nearby');
2605
+ }
2606
+
2607
+ this.set('draftMSTemplate', this.get('msTemplate'));
2608
+ this.updateTemplate(true);
2609
+ },
2610
+
2611
+ /**
2612
+ * Remove autoheight option if layout style is fullscreen or autofill
2613
+ */
2614
+ sliderLayoutChanged: function(){
2615
+ var layout = this.get('layout');
2616
+ if( layout === 'fullscreen' || layout === 'autofill' ) {
2617
+ this.set('showAutoHeight' , false);
2618
+ this.set('autoHeight' , false);
2619
+ } else {
2620
+ this.set('showAutoHeight' , true);
2621
+ }
2622
+
2623
+ this.set('showWrapperWidth', layout === 'boxed' || layout === 'partialview');
2624
+
2625
+ /* if( layout === 'boxed' && Ember.isEmpty(this.get('wrapperWidth')) ){
2626
+ this.set('wrapperWidth', this.get('width'));
2627
+ this.set('wrapperWidthUnit', 'px');
2628
+ }
2629
+
2630
+ if( layout === 'partialview' && Ember.isEmpty(this.get('wrapperWidth')) ){
2631
+ this.set('wrapperWidth', '100');
2632
+ this.set('wrapperWidthUnit', '%');
2633
+ }*/
2634
+
2635
+ this.set('showFSMargin', layout === 'fullscreen');
2636
+
2637
+ }.observes('layout').on('setup'),
2638
+
2639
+ /**
2640
+ * controll preloading method
2641
+ */
2642
+ preloadSetup: function(){
2643
+ var preloadMethod = this.get('preloadMethod');
2644
+
2645
+ if( preloadMethod === 'nearby' ) {
2646
+ this.set('showNearbyNum' , true);
2647
+ var preload = this.get('preload');
2648
+ if(preload === 'all' || preload === '-1'){
2649
+ this.set('preload' , '0');
2650
+ }
2651
+ } else {
2652
+ this.set('showNearbyNum' , false);
2653
+ this.set('preload' , preloadMethod);
2654
+ }
2655
+
2656
+ }.observes('preloadMethod').on('setup'),
2657
+
2658
+ updateTemplate: function(init){
2659
+ var templateObject,
2660
+ msTemplate = this.get('msTemplate');
2661
+
2662
+ this.get('templates').forEach(function(template){
2663
+ if( template.value === msTemplate ) {
2664
+ templateObject = template;
2665
+ return;
2666
+ }
2667
+ });
2668
+
2669
+ if( templateObject ){
2670
+ this.set('msTemplateName', templateObject.name);
2671
+ this.set('msTemplateImg', templateObject.img);
2672
+ this.set('msTemplateClass', templateObject.className);
2673
+ this.set('controllers.application.disableControls', templateObject.disableControls );
2674
+ this.set('disableControls', templateObject.disableControls );
2675
+
2676
+ if(!init){
2677
+ var controllController = this.get('controllers.controls'),
2678
+ controlObj,
2679
+ control;
2680
+ // remove added controls
2681
+ var controls = MSPanel.Control.find();
2682
+
2683
+ while(controls.get('firstObject')){
2684
+ var control = controls.get('firstObject');
2685
+
2686
+ controllController.findControlObj(control.get('name')).used = false;
2687
+ control.deleteRecord();
2688
+ }
2689
+
2690
+ // create template controls
2691
+ for (var controlName in templateObject.controls){
2692
+ controlObj = controllController.findControlObj(controlName);
2693
+ control = MSPanel.Control.create($.extend(true, controllController.getDefaultValues(controlName), templateObject.controls[controlName]));
2694
+ control.set('label', controlObj.label);
2695
+ controlObj.used = true;
2696
+ control.save();
2697
+ }
2698
+
2699
+ // update slider settings
2700
+ for(var option in templateObject.settings){
2701
+ this.set(option, templateObject.settings[option]);
2702
+ }
2703
+ }
2704
+
2705
+ } else { // template not found! so lets select custom template
2706
+ this.set('draftMSTemplate', 'custom');
2707
+ this.updateTemplate();
2708
+ }
2709
+
2710
+
2711
+ },
2712
+
2713
+ actions: {
2714
+
2715
+ openTemplates: function(){
2716
+ var templatesView = MSPanel.TemplatesView.create({
2717
+ controller: this
2718
+ });
2719
+
2720
+ this.get('mainView').createChildView(templatesView);
2721
+ this.set('templatesView', templatesView);
2722
+
2723
+ templatesView.appendTo(MSPanel.rootElement);
2724
+ },
2725
+
2726
+ closeTemplates: function(){
2727
+ this.get('templatesView').destroy();
2728
+
2729
+ // rollback to current template
2730
+ this.set('draftMSTemplate', this.get('msTemplate'));
2731
+ },
2732
+
2733
+ saveTemplate: function(){
2734
+ if( this.get('draftMSTemplate') === this.get('msTemplate') ){
2735
+ this.send('closeTemplates');
2736
+ return;
2737
+ }
2738
+
2739
+ if( confirm(__MSP_LAN.tv_002) ){
2740
+ // update msTemplate
2741
+ this.set('msTemplate', this.get('draftMSTemplate'));
2742
+ this.send('closeTemplates');
2743
+ this.updateTemplate();
2744
+ }
2745
+ }
2746
+ }
2747
+ });
2748
+ //js\mspanel\controllers\SlidesController.js
2749
+
2750
+ MSPanel.SlidesController = Ember.ArrayController.extend({
2751
+
2752
+ customSlider : window.__MSP_TYPE && window.__MSP_TYPE === 'custom',
2753
+
2754
+ _order : -1,
2755
+
2756
+ sortProperties: ['order'],
2757
+ mainView: null, // main view object which will be setted by MSPanel.SlidesView
2758
+
2759
+ currentSlide: null,
2760
+
2761
+ setup: function(){
2762
+ if( this.get('length') === 0 ){
2763
+ this.send('newSlide');
2764
+ } else {
2765
+ var slide = this.get('firstObject');
2766
+ this.set('currentSlide' , slide);
2767
+ }
2768
+
2769
+ // slider type
2770
+ if( Ember.isEmpty(this.get('sliderSettings.type')) ){
2771
+ this.set('sliderSettings.type', __MSP_TYPE);
2772
+ }
2773
+
2774
+ this.set('sliderSettings.sliderId', MSPanel.SliderID);
2775
+
2776
+ this.updateOrder();
2777
+ //this.set('_order', this.get('lastObject.order'));
2778
+ },
2779
+
2780
+ duplicateSlide : function(slide){
2781
+ var slideProp = slide.toJSON();
2782
+ delete slideProp.id;
2783
+ delete slideProp.layers;
2784
+
2785
+ var newSlide = MSPanel.Slide.create(slideProp);
2786
+
2787
+ // insert after
2788
+ newSlide.set('order' , slide.get('order') + 1);
2789
+
2790
+ // update order
2791
+ this.forEach(function(_slide){
2792
+ var slide_order = _slide.get('order'),
2793
+ nslide_order = newSlide.get('order');
2794
+
2795
+ if(slide_order >= nslide_order && _slide !== newSlide)
2796
+ _slide.set('order' , slide_order + 1);
2797
+ });
2798
+
2799
+ newSlide.save();
2800
+ this.updateOrder();
2801
+ },
2802
+
2803
+ updateSlidesSort : function(indexes) {
2804
+ this.beginPropertyChanges();
2805
+
2806
+ this.forEach(function(slide) {
2807
+ slide.set('order', indexes[slide.get('id')]);
2808
+ }, this);
2809
+ this.endPropertyChanges();
2810
+ this.set('_order', this.get('lastObject.order'));
2811
+ },
2812
+
2813
+ updateOrder: function(){
2814
+ var i = 0;
2815
+ this.forEach(function(slide){
2816
+ slide.set('order', i++);
2817
+ });
2818
+
2819
+ this.set('_order', i - 1);
2820
+ },
2821
+
2822
+ removeSlide : function(slide){
2823
+
2824
+ slide.deleteRecord();
2825
+
2826
+ if(this.get('length') === 0){
2827
+ this.send('newSlide');
2828
+ }else{
2829
+ this.send('select' , this.get('firstObject'));
2830
+ }
2831
+
2832
+ this.updateOrder();
2833
+ },
2834
+
2835
+ actions: {
2836
+
2837
+ newSlide : function(){
2838
+ var slide = MSPanel.Slide.create({order: this.get('_order') + 1});
2839
+ this.set('currentSlide' , slide);
2840
+ this.set('_order' , this.get('_order') + 1);
2841
+ slide.save();
2842
+ },
2843
+
2844
+ select : function(slide){
2845
+ if(slide === this.get('currentSlide')) return;
2846
+ this.set('currentSlide' , slide);
2847
+ }
2848
+ }
2849
+ });
2850
+ //js\mspanel\controllers\ControlsController.js
2851
+
2852
+ /**
2853
+ * Master Slider Panel, Slider Controls controller
2854
+ * @package MSPanel
2855
+ * @author Averta
2856
+ * @version 1.0b
2857
+ */
2858
+ MSPanel.ControlsController = Ember.ArrayController.extend({
2859
+
2860
+ needs: 'application',
2861
+
2862
+ controls: [
2863
+ {used:false, label:__MSP_LAN.cc_001, value:'arrows'},
2864
+ {used:false, label:__MSP_LAN.cc_002, value:'timebar'},
2865
+ {used:false, label:__MSP_LAN.cc_003, value:'bullets'},
2866
+ {used:false, label:__MSP_LAN.cc_004, value:'circletimer'},
2867
+ {used:false, label:__MSP_LAN.cc_005, value:'scrollbar'},
2868
+ {used:false, label:__MSP_LAN.cc_006, value:'slideinfo'},
2869
+ {used:false, label:__MSP_LAN.cc_007, value:'thumblist'}
2870
+ ],
2871
+
2872
+ selectedControl: null, // selected control in combo box
2873
+
2874
+ availableControls: [], // already added to slider
2875
+
2876
+ noMore: false,
2877
+
2878
+ currentControl: null, // current active control
2879
+
2880
+ setup: function(){
2881
+ var that = this;
2882
+ this.forEach(function(control){
2883
+ that.findControlObj(control.get('name')).used = true;
2884
+ });
2885
+ this.set('availableControls', this.findAvailableControls());
2886
+ },
2887
+
2888
+ actions: {
2889
+
2890
+ addControl: function(){
2891
+
2892
+ var controlName = this.get('selectedControl'),
2893
+ controlObj = this.findControlObj(controlName),
2894
+ control;
2895
+
2896
+ // create control object
2897
+ control = MSPanel.Control.create(this.getDefaultValues(controlName));
2898
+ control.set('label', controlObj.label);
2899
+
2900
+ controlObj.used = true;
2901
+ this.set('availableControls', this.findAvailableControls());
2902
+ control.save();
2903
+
2904
+ this.set('currentControl', control);
2905
+ },
2906
+
2907
+ removeControl: function(control){
2908
+ this.findControlObj(control.get('name')).used = false;
2909
+ this.set('availableControls', this.findAvailableControls());
2910
+ control.deleteRecord();
2911
+
2912
+ this.set('currentControl', this.get('firstObject'));
2913
+ this.send('showControlOptions');
2914
+ },
2915
+
2916
+ showControlOptions: function(){
2917
+ var currentControl = this.get('currentControl');
2918
+
2919
+ if( Ember.isEmpty(currentControl) ){
2920
+ this.set('controlOptions', 'empty-template');
2921
+ } else {
2922
+ this.set('controlOptions', currentControl.get('name') + '-options');
2923
+ }
2924
+ }
2925
+
2926
+ },
2927
+
2928
+ /**
2929
+ * Find selected control from controls
2930
+ * @param {string} control
2931
+ * @return {object}
2932
+ */
2933
+ findControlObj: function(control){
2934
+ var controls = this.get('controls');
2935
+ for(var i=0,l=controls.length; i!==l; i++){
2936
+ if( controls[i].value === control ){
2937
+ return controls[i];
2938
+ }
2939
+ }
2940
+
2941
+ return null;
2942
+ },
2943
+
2944
+ findAvailableControls: function(){
2945
+ var avc = [],
2946
+ controls = this.get('controls');
2947
+ for(var i=0,l=controls.length; i!==l; i++){
2948
+ if( !controls[i].used ){
2949
+ avc.push(controls[i]);
2950
+ }
2951
+ }
2952
+
2953
+ this.set('noMore', avc.length === 0);
2954
+ this.set('selectedControl', avc[0]?avc[0].value:null);
2955
+
2956
+ return avc;
2957
+ },
2958
+
2959
+ /**
2960
+ * creates an object of default values for new control
2961
+ * @param {Control} control
2962
+ * @return {Object}
2963
+ */
2964
+ getDefaultValues: function(control){
2965
+ var values = {name:control};
2966
+
2967
+ values.inset = !(control === 'slideinfo' || control === 'thumblist');
2968
+
2969
+ switch(control){
2970
+ case 'timebar':
2971
+ values.align = 'bottom';
2972
+ values.color = '#FFFFFF';
2973
+ values.autoHide = false;
2974
+ values.width = 4;
2975
+ break;
2976
+ case 'bullets':
2977
+ values.align = 'bottom';
2978
+ values.dir = 'h';
2979
+ values.margin = 10;
2980
+ break;
2981
+ case 'circletimer':
2982
+ //values.align = 'tl';
2983
+ values.color = '#A2A2A2';
2984
+ values.stroke = 10;
2985
+ values.radius = 4;
2986
+ values.autoHide = false;
2987
+ break;
2988
+ case 'scrollbar':
2989
+ values.align = 'top';
2990
+ values.dir = 'h';
2991
+ values.color = '#3D3D3D';
2992
+ values.margin = 10;
2993
+ values.autoHide = false;
2994
+ values.width = 4;
2995
+ break;
2996
+ case 'slideinfo':
2997
+ values.align = 'bottom';
2998
+ values.margin = 10;
2999
+ values.autoHide = false;
3000
+ break;
3001
+ case 'thumblist':
3002
+ values.align = 'bottom';
3003
+ values.space = 5;
3004
+ values.width = 100;
3005
+ values.height = 80;
3006
+ values.margin = 10;
3007
+ values.fillMode = 'fill';
3008
+ values.autoHide = false;
3009
+ break;
3010
+ }
3011
+
3012
+ return values;
3013
+ }
3014
+
3015
+ });
3016
+ //js\mspanel\controllers\CallbacksController.js
3017
+
3018
+ /**
3019
+ * Master Slider Panel Callbacks controller
3020
+ * @package MSPanel
3021
+ * @version 1.0
3022
+ * @author Averta
3023
+ */
3024
+
3025
+ MSPanel.CallbacksController = Ember.ArrayController.extend({
3026
+
3027
+ callbacks: [
3028
+ {used: false, label:__MSP_LAN.cb_011, value:'INIT'},
3029
+ {used: false, label:__MSP_LAN.cb_001, value:'CHANGE_START'},
3030
+ {used: false, label:__MSP_LAN.cb_002, value:'CHANGE_END'},
3031
+ {used: false, label:__MSP_LAN.cb_003, value:'WAITING'},
3032
+ {used: false, label:__MSP_LAN.cb_004, value:'RESIZE'},
3033
+ {used: false, label:__MSP_LAN.cb_005, value:'VIDEO_PLAY'},
3034
+ {used: false, label:__MSP_LAN.cb_006, value:'VIDEO_CLOSE'},
3035
+ {used: false, label:__MSP_LAN.cb_007, value:'SWIPE_START'},
3036
+ {used: false, label:__MSP_LAN.cb_008, value:'SWIPE_MOVE'},
3037
+ {used: false, label:__MSP_LAN.cb_009, value:'SWIPE_END'}
3038
+ ],
3039
+
3040
+ availableCallbacks: [],
3041
+ noMore: false,
3042
+ selectedCallback: null, // selected callback in combo box
3043
+
3044
+ setup: function(){
3045
+ var that = this;
3046
+ this.forEach(function(callback){
3047
+ that.findCallbackObj(callback.get('name')).used = true;
3048
+ });
3049
+ this.set('availableCallbacks', this.findAvailableCallbacks());
3050
+ },
3051
+
3052
+ actions: {
3053
+ addCallback: function(){
3054
+ var callbackName = this.get('selectedCallback'),
3055
+ callbackObj = this.findCallbackObj(callbackName),
3056
+ callback;
3057
+
3058
+ // create callback object
3059
+ callback = MSPanel.Callback.create({
3060
+ name:callbackObj.value,
3061
+ label:callbackObj.label
3062
+ });
3063
+
3064
+ callbackObj.used = true;
3065
+ this.set('availableCallbacks', this.findAvailableCallbacks());
3066
+ callback.save();
3067
+ },
3068
+
3069
+ removeCallback: function(callback){
3070
+ if( confirm(__MSP_LAN.cb_010.jfmt(callback.get('label'))) ){
3071
+ this.findCallbackObj(callback.get('name')).used = false;
3072
+ this.set('availableCallbacks', this.findAvailableCallbacks());
3073
+ callback.deleteRecord();
3074
+ }
3075
+ }
3076
+
3077
+ },
3078
+
3079
+ /**
3080
+ * Find selected callback from callbacks
3081
+ * @param {string} callback
3082
+ * @return {object}
3083
+ */
3084
+ findCallbackObj: function(callback){
3085
+ var callbacks = this.get('callbacks');
3086
+ for(var i=0,l=callbacks.length; i!==l; i++){
3087
+ if( callbacks[i].value === callback ){
3088
+ return callbacks[i];
3089
+ }
3090
+ }
3091
+ return null;
3092
+ },
3093
+
3094
+ findAvailableCallbacks: function(){
3095
+ var avc = [],
3096
+ callbacks = this.get('callbacks');
3097
+ for(var i=0,l=callbacks.length; i!==l; i++){
3098
+ if( !callbacks[i].used ){
3099
+ avc.push(callbacks[i]);
3100
+ }
3101
+ }
3102
+
3103
+ this.set('noMore', avc.length === 0);
3104
+ this.set('selectedCallback', avc[0]?avc[0].value:null);
3105
+ return avc;
3106
+ },
3107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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //js\libs\averta.base.js
2
+
3
+ /*!
4
+ * @overview Averta JavaScript Libraries
5
+ * @copyright Copyright 2014 Averta Ltd.
6
+ * http://www.averta.net
7
+ */
8
+ window.averta = {};
9
+
10
+ ;(function($){
11
+
12
+ //"use strict";
13
+
14
+ window.package = function(name){
15
+ if(!window[name]) window[name] = {};
16
+ };
17
+
18
+ // conflict with Emberjs
19
+ /*var extend = function(target , object){
20
+ for(var key in object) target[key] = object[key];
21
+ };
22
+
23
+ Function.prototype.extend = function(superclass){
24
+ if(typeof superclass.prototype.constructor === "function"){
25
+ extend(this.prototype , superclass.prototype);
26
+ this.prototype.constructor = this;
27
+ }else{
28
+ this.prototype.extend(superclass);
29
+ this.prototype.constructor = this;
30
+ }
31
+ };*/
32
+
33
+ // Converts JS prefix to CSS prefix
34
+ var trans = {
35
+ 'Moz' : '-moz-',
36
+ 'Webkit' : '-webkit-',
37
+ 'Khtml' : '-khtml-' ,
38
+ 'O' : '-o-',
39
+ 'ms' : '-ms-',
40
+ 'Icab' : '-icab-'
41
+ };
42
+
43
+ $(document).ready(function(){
44
+ window._jcsspfx = getVendorPrefix(); // JS CSS VendorPrefix
45
+ window._csspfx = trans[window._jcsspfx]; // CSS VendorPrefix
46
+ window._cssanim = supportsTransitions();
47
+ window._css3d = supports3DTransforms();
48
+ window._css2d = supportsTransforms();
49
+ window._mobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
50
+ window._touch = 'ontouchstart' in document;
51
+ });
52
+
53
+
54
+ // Thanks to LEA VEROU
55
+ // http://lea.verou.me/2009/02/find-the-vendor-prefix-of-the-current-browser/
56
+ function getVendorPrefix() {
57
+
58
+ if('result' in arguments.callee) return arguments.callee.result;
59
+
60
+ var regex = /^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/;
61
+
62
+ var someScript = document.getElementsByTagName('script')[0];
63
+
64
+ for(var prop in someScript.style)
65
+ if(regex.test(prop))
66
+ return arguments.callee.result = prop.match(regex)[0];
67
+
68
+ if('WebkitOpacity' in someScript.style) return arguments.callee.result = 'Webkit';
69
+ if('KhtmlOpacity' in someScript.style) return arguments.callee.result = 'Khtml';
70
+
71
+ return arguments.callee.result = '';
72
+ }
73
+
74
+
75
+ // Thanks to Steven Benner.
76
+ // http://stevenbenner.com/2010/03/javascript-regex-trick-parse-a-query-string-into-an-object/
77
+ window.parseQueryString = function(url){
78
+ var queryString = {};
79
+ url.replace(
80
+ new RegExp("([^?=&]+)(=([^&]*))?", "g"),
81
+ function($0, $1, $2, $3) { queryString[$1] = $3; }
82
+ );
83
+
84
+ return queryString;
85
+ };
86
+
87
+ function checkStyleValue(prop){
88
+ var b = document.body || document.documentElement;
89
+ var s = b.style;
90
+ var p = prop;
91
+ if(typeof s[p] == 'string') {return true; }
92
+
93
+ // Tests for vendor specific prop
94
+ v = ['Moz', 'Webkit', 'Khtml', 'O', 'ms'],
95
+ p = p.charAt(0).toUpperCase() + p.substr(1);
96
+ for(var i=0; i<v.length; i++) {
97
+ if(typeof s[v[i] + p] == 'string') { return true; }
98
+ }
99
+ return false;
100
+ }
101
+
102
+ function supportsTransitions() {
103
+ return checkStyleValue('transition');
104
+ }
105
+
106
+ function supportsTransforms(){
107
+ return checkStyleValue('transform');
108
+ }
109
+
110
+ function supports3DTransforms(){
111
+ if(!supportsTransforms()) return false;
112
+ var el = document.createElement('p'),
113
+ has3d,
114
+ transforms = {
115
+ 'WebkitTransform':'-webkit-transform',
116
+ 'OTransform':'-o-transform',
117
+ 'MSTransform':'-ms-transform',
118
+ 'MozTransform':'-moz-transform',
119
+ 'Transform':'transform'
120
+ };
121
+
122
+ // Add it to the body to get the computed style
123
+ document.body.insertBefore(el, null);
124
+
125
+ for(var t in transforms){
126
+ if( el.style[t] !== undefined ){
127
+ el.style[t] = 'translate3d(1px,1px,1px)';
128
+ has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);
129
+ }
130
+ }
131
+
132
+ document.body.removeChild(el);
133
+
134
+ return (has3d != null && has3d.length > 0 && has3d !== "none");
135
+ }
136
+
137
+ /**
138
+ * Provides requestAnimationFrame in a cross browser way.
139
+ * @author paulirish / http://paulirish.com/
140
+ */
141
+ var fps60 = 50/3;
142
+
143
+ if ( !window.requestAnimationFrame ) {
144
+
145
+ window.requestAnimationFrame = ( function() {
146
+
147
+ return window.webkitRequestAnimationFrame ||
148
+ window.mozRequestAnimationFrame ||
149
+ window.oRequestAnimationFrame ||
150
+ window.msRequestAnimationFrame ||
151
+ function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) {
152
+
153
+ window.setTimeout( callback, fps60 );
154
+
155
+ };
156
+
157
+ } )();
158
+
159
+ }
160
+
161
+ if (!window.getComputedStyle) {
162
+ window.getComputedStyle = function(el, pseudo) {
163
+ this.el = el;
164
+ this.getPropertyValue = function(prop) {
165
+ var re = /(\-([a-z]){1})/g;
166
+ if (prop == 'float') prop = 'styleFloat';
167
+ if (re.test(prop)) {
168
+ prop = prop.replace(re, function () {
169
+ return arguments[2].toUpperCase();
170
+ });
171
+ }
172
+ return el.currentStyle[prop] ? el.currentStyle[prop] : null;
173
+ };
174
+ return el.currentStyle;
175
+ };
176
+ }
177
+
178
+ if(jQuery){
179
+ $.jqLoadFix = function(){
180
+ if(this.complete){
181
+ var that = this;
182
+ setTimeout(function(){$(that).load();} , 1);
183
+ }
184
+ };
185
+
186
+ jQuery.uaMatch = jQuery.uaMatch || function( ua ) {
187
+ ua = ua.toLowerCase();
188
+
189
+ var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
190
+ /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
191
+ /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
192
+ /(msie) ([\w.]+)/.exec( ua ) ||
193
+ ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
194
+ [];
195
+
196
+ return {
197
+ browser: match[ 1 ] || "",
198
+ version: match[ 2 ] || "0"
199
+ };
200
+ };
201
+
202
+ // Don't clobber any existing jQuery.browser in case it's different
203
+ if ( !jQuery.browser ) {
204
+ matched = jQuery.uaMatch( navigator.userAgent );
205
+ browser = {};
206
+
207
+ if ( matched.browser ) {
208
+ browser[ matched.browser ] = true;
209
+ browser.version = matched.version;
210
+ }
211
+
212
+ // Chrome is Webkit, but Webkit is also Safari.
213
+ if ( browser.chrome ) {
214
+ browser.webkit = true;
215
+ } else if ( browser.webkit ) {
216
+ browser.safari = true;
217
+ }
218
+
219
+ jQuery.browser = browser;
220
+
221
+ }
222
+
223
+ $.fn.preloadImg = function(src , _event){
224
+ this.each(function(){
225
+ var $this = $(this);
226
+ var self = this;
227
+ var img = new Image();
228
+ img.onload = function(event){
229
+ $this.attr('src' , src);
230
+ event.width = img.width;
231
+ event.height = img.height;
232
+ setTimeout(function(){_event.call(self , event);},50);
233
+ img = null;
234
+ };
235
+ img.src = src;
236
+ });
237
+ return this;
238
+ };
239
+ }
240
+
241
+
242
+ window.parseTransform = function(transformCSS_str) {
243
+ if(transformCSS_str === null) return {};
244
+
245
+ transformCSS_str = transformCSS_str.replace(/\s+/g, '');
246
+
247
+ var fullFun_array = transformCSS_str.split(")");
248
+ fullFun_array.pop();
249
+
250
+ var parsed_obj = {};
251
+
252
+ for( var i = 0 , l = fullFun_array.length ; i < l ; ++i){
253
+ var fun = fullFun_array[i];
254
+ parsed_obj[fun.slice(0, fun.indexOf("("))] = fun.slice(fun.indexOf("(")+1).split(",");
255
+ }
256
+
257
+ return parsed_obj;
258
+ };
259
+
260
+
261
+ /**
262
+ * Converts CSS3 ease names to JTween ease functions
263
+ * @param {string} easeName
264
+ * @return {function}
265
+ */
266
+ window.convertEaseName = function(easeName){
267
+ if(easeName === 'linear') return Linear.easeNone;
268
+ var isInOut = easeName.indexOf('InOut') !== -1,
269
+ isIn = easeName.indexOf('In') !== -1;
270
+
271
+ if(isInOut) return window[easeName.slice(9)].easeInOut;
272
+ if(isIn) return window[easeName.slice(6)].easeIn;
273
+
274
+ return window[easeName.slice(7)].easeOut;
275
+ };
276
+
277
+ jQuery.fn.extend({
278
+ insertAtCaret: function(myValue){
279
+ return this.each(function(i) {
280
+ if (document.selection) {
281
+ //For browsers like Internet Explorer
282
+ this.focus();
283
+ var sel = document.selection.createRange();
284
+ sel.text = myValue;
285
+ this.focus();
286
+ }
287
+ else if (this.selectionStart || this.selectionStart == '0') {
288
+ //For browsers like Firefox and Webkit based
289
+ var startPos = this.selectionStart;
290
+ var endPos = this.selectionEnd;
291
+ var scrollTop = this.scrollTop;
292
+ this.value = this.value.substring(0, startPos)+myValue+this.value.substring(endPos,this.value.length);
293
+ this.focus();
294
+ this.selectionStart = startPos + myValue.length;
295
+ this.selectionEnd = startPos + myValue.length;
296
+ this.scrollTop = scrollTop;
297
+ } else {
298
+ this.value += myValue;
299
+ this.focus();
300
+ }
301
+ });
302
+ }
303
+ });
304
+ })(jQuery);
305
+ //js\libs\averta.livetabs.js
306
+
307
+ /**
308
+ * AvertaLiveTabs v1.4
309
+ * Plugin for enabling tabs
310
+ * Copyright (c) averta | http://averta.net | 2011-2014
311
+ * licensed under the MIT license
312
+ **/
313
+
314
+ /**
315
+ * USAGE :
316
+ * -----------------------------------------------------------------------------------------------------
317
+ * HTML:
318
+ <div id="container">
319
+ <ul class="tabs">
320
+ <li class="active"><a href="#s1">Tab1</a></li>
321
+ <li><a href="#s2">Tab2</a></li>
322
+ <li><a href="#s3">Tab3</a></li>
323
+ </ul>
324
+
325
+ <ul class="tabs-content">
326
+ <li id="s1">Contnt1</li>
327
+ <li id="s2">Contnt2</li>
328
+ <li id="s3">Contnt3</li>
329
+ </ul>
330
+ </div>
331
+ *
332
+ * JS:
333
+ $('#container').avertaLiveTabs({
334
+ tabs: 'ul.tabs > li', // Tabs selector
335
+ tabsActiveClass: 'active', // A Class that indicates active tab
336
+ contents: 'ul.tabs-content > li', // Tabs content selector
337
+ contentsActiveClass: 'active', // A Class that indicates active tab-content
338
+ transition: 'fade', // Animation type white swiching tabs
339
+ duration : '500', // Animation duration in mili seconds
340
+ connectType: 'index', // connect tabs and contents by 'index' or 'id'
341
+ enableHash: false , // check to select initial tab based on hash address
342
+ updateHash: false , // update hash in browser while switching between tabs
343
+ hashSuffix: '-tab' // suffix to add at the end of hash url to prevent page scroll
344
+ });
345
+
346
+ * ---------------------------------------------------------------------------------------------------------
347
+ **/
348
+
349
+ if(typeof Object.create !== 'function' ){ Object.create = function (obj){ function F(){} F.prototype = obj;return new F();};}
350
+
351
+ ;(function($){
352
+
353
+ var Container = {
354
+
355
+ init : function(el, options){
356
+ //cache this
357
+ var self = this;
358
+ self.options = $.extend({} ,$.fn.avertaLiveTabs.defaultOptions, options || {} );
359
+
360
+ // Access to jQuery and DOM versions of element
361
+ self.$el = $(el);
362
+ self.el = el;
363
+
364
+ self.$tabs = self.$el.find(self.options.tabs);
365
+ self.$contents = self.$el.find(self.options.contents);
366
+
367
+ self.setup();
368
+ },
369
+
370
+ setup: function(){
371
+ var self = this,
372
+ $active_tab,
373
+ $active_content;
374
+ // click event when new tab selected
375
+ self.$tabs.on('click', {self:self}, self.onTabClicked);
376
+
377
+ // if hash is enabled in options get current hash and select related tab
378
+ if(self.options.enableHash && window.location.hash !== '') {
379
+ var id = window.location.hash.substring(1);
380
+ $active_tab = self.getTabById(id);
381
+ } else {
382
+ // find the tab with tabsActiveClass
383
+ $active_tab = self.$tabs.filter('.'+self.options.tabsActiveClass);
384
+ }
385
+ // validate to select the active tab for start
386
+ $active_tab = ($active_tab.length)?$active_tab:self.$tabs.first();
387
+ $active_tab.trigger('click', true);
388
+
389
+ },
390
+
391
+ onTabClicked:function(event, fromSetup){
392
+ event.preventDefault();
393
+ var self = event.data.self,
394
+ $this = $(this),
395
+ $tab_content,
396
+ active_id;
397
+
398
+ if( !fromSetup && $this.hasClass('active') ){
399
+ return;
400
+ }
401
+
402
+ self.$tabs.removeClass(self.options.tabsActiveClass);
403
+ $this.addClass(self.options.tabsActiveClass);
404
+
405
+ self.$contents.hide();
406
+ if(self.options.connectType == 'id'){
407
+ active_id = self.getIdByTab($this);
408
+ $tab_content = self.getContentById(active_id);
409
+ } else{
410
+ $tab_content = self.$contents.eq($this.index());
411
+ }
412
+ $tab_content.fadeIn(self.options.duration);
413
+
414
+ // update hash in page address if updateHash is enabled
415
+ if(self.options.updateHash){
416
+ active_id = self.getIdByTab($this);
417
+ active_id = active_id?active_id+self.options.hashSuffix:'';
418
+
419
+ if(window.history && window.history.pushState )
420
+ window.history.pushState(null, null, window.location.href.split('#')[0]+'#'+active_id);
421
+ else
422
+ window.location.hash = active_id;
423
+ }
424
+
425
+ // trigger custom event
426
+ self.$el.trigger('avtTabChange', $tab_content.attr('id'));
427
+
428
+ },
429
+
430
+ getTabById:function(id){
431
+ // remove hashSuffix (if exist) from id hash to get real element id
432
+ id = id.split(this.options.hashSuffix)[0];
433
+ // search for hash in tabs markup - generaly should be direct children of tab
434
+ // check for href="#id" format
435
+ var $active_tab = this.$tabs.find('[href="#'+ id +'"]').eq(0);
436
+ // if no match found, check for href="id" format too
437
+ if(!$active_tab.length)
438
+ $active_tab = this.$tabs.find('[href="'+ id +'"]').eq(0);
439
+ // get the tab if hash found in it
440
+ return $active_tab.length?$active_tab.parent():$active_tab;
441
+ },
442
+
443
+ getContentById:function(id){
444
+ return this.$contents.filter('#'+id);
445
+ },
446
+
447
+ getIdByTab:function($tab){
448
+ var $anchor = $tab.find('[href]').eq(0);
449
+ return $anchor.length?$anchor.attr('href'):false;
450
+ }
451
+ };
452
+
453
+
454
+ $.fn.avertaLiveTabs = function(options){
455
+ return this.each(function(){
456
+ var container = Object.create(Container);
457
+ container.init(this, options);
458
+ });
459
+ };
460
+
461
+ $.fn.avertaLiveTabs.defaultOptions = {
462
+ tabs: 'ul.tabs > li', // Tabs selector
463
+ tabsActiveClass: 'active', // A Class that indicates active tab
464
+ contents: 'ul.tabs-content > li', // Tabs content selector
465
+ contentsActiveClass: 'active', // A Class that indicates active tab-content
466
+ transition: 'fade', // Animation type white swiching tabs
467
+ duration : '500', // Animation duration in mili seconds
468
+ connectType: 'index', // connect tabs and contents by 'index' or 'id'
469
+ enableHash: false , // check to select initial tab based on hash address
470
+ updateHash: false , // update hash in browser while switching between tabs
471
+ hashSuffix: '-tab' // suffix to add at the end of hash url to prevent page scroll
472
+ };
473
+
474
+ })(jQuery);
475
+ //js\libs\averta.aligner.js
476
+
477
+ ;(function(){
478
+
479
+ "use strict";
480
+
481
+ window.MSAligner = function(type , $container , $img ){
482
+
483
+ this.$container = $container;
484
+ this.$img = $img;
485
+
486
+ this.type = type || 'stretch'; // fill , fit , stretch , tile , center
487
+
488
+ this.widthOnly = false;
489
+ this.heightOnly = false;
490
+ };
491
+
492
+ var p = MSAligner.prototype;
493
+
494
+ /*-------------- METHODS --------------*/
495
+
496
+ p.init = function(w , h){
497
+
498
+ this.baseWidth = w;
499
+ this.baseHeight = h;
500
+ this.imgRatio = w / h;
501
+ this.imgRatio2 = h / w;
502
+
503
+ switch(this.type){
504
+ case 'tile':
505
+ this.$container.css('background-image' , 'url('+ this.$img.attr('src') +')');
506
+ this.$img.detach();
507
+ break;
508
+ case 'center':
509
+ this.$container.css('background-image' , 'url('+ this.$img.attr('src') +')');
510
+ this.$container.css({
511
+ backgroundPosition : 'center center',
512
+ backgroundRepeat : 'no-repeat'
513
+ });
514
+ this.$img.detach();
515
+ break;
516
+ case 'stretch':
517
+ this.$img.css({
518
+ width : '100%',
519
+ height : '100%'
520
+ });
521
+ break;
522
+ case 'fill':
523
+ case 'fit' :
524
+ this.needAlign = true;
525
+ this.align();
526
+ break;
527
+ }
528
+
529
+ };
530
+
531
+ p.align = function(){
532
+ if(!this.needAlign) return;
533
+
534
+ var cont_w = this.$container.width();
535
+ var cont_h = this.$container.height();
536
+
537
+ var contRatio = cont_w / cont_h;
538
+
539
+ if(this.type == 'fill'){
540
+ if(this.imgRatio < contRatio ){
541
+ this.$img.width(cont_w);
542
+ this.$img.height(cont_w * this.imgRatio2);
543
+ }else{
544
+ this.$img.height(cont_h);
545
+ this.$img.width(cont_h * this.imgRatio);
546
+ }
547
+
548
+ }else if(this.type == 'fit'){
549
+
550
+ if(this.imgRatio < contRatio){
551
+ this.$img.height(cont_h);
552
+ this.$img.width(cont_h * this.imgRatio);
553
+ }else{
554
+ this.$img.width(cont_w);
555
+ this.$img.height(cont_w * this.imgRatio2);
556
+ }
557
+ }
558
+
559
+ this.setMargin();
560
+
561
+ };
562
+
563
+ p.changeType = function(type){
564
+ this.reset();
565
+ this.type = type;
566
+ this.reinit();
567
+ }
568
+
569
+ p.reinit = function(){
570
+ this.init(this.baseWidth , this.baseHeight);
571
+ };
572
+
573
+ p.reset = function(){
574
+ if(this.type === 'center' || this.type === 'tile'){
575
+ this.$container.css({
576
+ 'background-image' : '',
577
+ backgroundPosition : '',
578
+ backgroundRepeat : ''
579
+ });
580
+ this.$img.appendTo(this.$container);
581
+ }else{
582
+ this.$img.css({
583
+ width : '',
584
+ height : '',
585
+ 'margin-top' : '',
586
+ 'margin-left': ''
587
+ });
588
+ }
589
+ };
590
+
591
+ p.setMargin = function(){
592
+
593
+ var cont_w = this.$container.width();
594
+ var cont_h = this.$container.height();
595
+
596
+ this.$img.css('margin-top' , (cont_h - this.$img[0].offsetHeight) / 2 + 'px');
597
+ this.$img.css('margin-left', (cont_w - this.$img[0].offsetWidth ) / 2 + 'px');
598
+ };
599
+
600
+ })();
601
+ //js\libs\jquery.ddslick.js
602
+
603
+ /*!
604
+ * Custom DropDown plugin by PC
605
+ * http://designwithpc.com/Plugins/ddslick
606
+ * Author: PC
607
+ */
608
+
609
+ //Title: Custom DropDown plugin by PC
610
+ //Documentation: http://designwithpc.com/Plugins/ddslick
611
+ //Author: PC
612
+ //Website: http://designwithpc.com
613
+ //Twitter: http://twitter.com/chaudharyp
614
+
615
+ (function ($) {
616
+
617
+ $.fn.ddslick = function (method) {
618
+ if (methods[method]) {
619
+ return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
620
+ } else if (typeof method === 'object' || !method) {
621
+ return methods.init.apply(this, arguments);
622
+ } else {
623
+ $.error('Method ' + method + ' does not exists.');
624
+ }
625
+ };
626
+
627
+ var methods = {},
628
+
629
+ //Set defauls for the control
630
+ defaults = {
631
+ data: [],
632
+ keepJSONItemsOnTop: false,
633
+ width: 260,
634
+ height: null,
635
+ background: "#eee",
636
+ selectText: "",
637
+ defaultSelectedIndex: null,
638
+ truncateDescription: true,
639
+ imagePosition: "left",
640
+ showSelectedHTML: true,
641
+ clickOffToClose: true,
642
+ onSelected: function () { }
643
+ },
644
+
645
+ ddSelectHtml = '<div class="dd-select"><input class="dd-selected-value" type="hidden" /><a class="dd-selected"></a><span class="dd-pointer dd-pointer-down"></span></div>',
646
+ ddOptionsHtml = '<ul class="dd-options"></ul>';
647
+
648
+ //CSS for ddSlick
649
+ /* ddslickCSS = '<style id="css-ddslick" type="text/css">' +
650
+ '.dd-select{ border-radius:2px; border:solid 1px #ccc; position:relative; cursor:pointer;}' +
651
+ '.dd-desc { color:#aaa; display:block; overflow: hidden; font-weight:normal; line-height: 1.4em; }' +
652
+ '.dd-selected{ overflow:hidden; display:block; padding:10px; font-weight:bold;}' +
653
+ '.dd-pointer{ width:0; height:0; position:absolute; right:10px; top:50%; margin-top:-3px;}' +
654
+ '.dd-pointer-down{ border:solid 5px transparent; border-top:solid 5px #000; }' +
655
+ '.dd-pointer-up{border:solid 5px transparent !important; border-bottom:solid 5px #000 !important; margin-top:-8px;}' +
656
+ '.dd-options{ border:solid 1px #ccc; border-top:none; list-style:none; box-shadow:0px 1px 5px #ddd; display:none; position:absolute; z-index:2000; margin:0; padding:0;background:#fff; overflow:auto;}' +
657
+ '.dd-option{ padding:10px; display:block; border-bottom:solid 1px #ddd; overflow:hidden; text-decoration:none; color:#333; cursor:pointer;-webkit-transition: all 0.25s ease-in-out; -moz-transition: all 0.25s ease-in-out;-o-transition: all 0.25s ease-in-out;-ms-transition: all 0.25s ease-in-out; }' +
658
+ '.dd-options > li:last-child > .dd-option{ border-bottom:none;}' +
659
+ '.dd-option:hover{ background:#f3f3f3; color:#000;}' +
660
+ '.dd-selected-description-truncated { text-overflow: ellipsis; white-space:nowrap; }' +
661
+ '.dd-option-selected { background:#f6f6f6; }' +
662
+ '.dd-option-image, .dd-selected-image { vertical-align:middle; float:left; margin-right:5px; max-width:64px;}' +
663
+ '.dd-image-right { float:right; margin-right:15px; margin-left:5px;}' +
664
+ '.dd-container{ position:relative;}​ .dd-selected-text { font-weight:bold}​</style>';
665
+
666
+ //CSS styles are only added once.
667
+ if ($('#css-ddslick').length <= 0) {
668
+ $(ddslickCSS).appendTo('head');
669
+ }*/
670
+
671
+ //Public methods
672
+ methods.init = function (options) {
673
+ //Preserve the original defaults by passing an empty object as the target
674
+ var options = $.extend({}, defaults, options);
675
+
676
+ //Apply on all selected elements
677
+ return this.each(function () {
678
+ var obj = $(this),
679
+ data = obj.data('ddslick');
680
+ //If the plugin has not been initialized yet
681
+ if (!data) {
682
+
683
+ var ddSelect = [], ddJson = options.data;
684
+
685
+ //Get data from HTML select options
686
+ obj.find('option').each(function () {
687
+ var $this = $(this), thisData = $this.data();
688
+ ddSelect.push({
689
+ text: $.trim($this.text()),
690
+ value: $this.val(),
691
+ selected: $this.is(':selected'),
692
+ description: thisData.description,
693
+ imageSrc: thisData.imagesrc //keep it lowercase for HTML5 data-attributes
694
+ });
695
+ });
696
+
697
+ //Update Plugin data merging both HTML select data and JSON data for the dropdown
698
+ if (options.keepJSONItemsOnTop)
699
+ $.merge(options.data, ddSelect);
700
+ else options.data = $.merge(ddSelect, options.data);
701
+
702
+ //Replace HTML select with empty placeholder, keep the original
703
+ var original = obj, placeholder = $('<div id="' + obj.attr('id') + '"></div>');
704
+ obj.replaceWith(placeholder);
705
+ obj = placeholder;
706
+
707
+ //Add classes and append ddSelectHtml & ddOptionsHtml to the container
708
+ obj.addClass('dd-container').append(ddSelectHtml).append(ddOptionsHtml);
709
+
710
+ //Get newly created ddOptions and ddSelect to manipulate
711
+ var ddSelect = obj.find('.dd-select'),
712
+ ddOptions = obj.find('.dd-options');
713
+
714
+ //Set widths
715
+ ddOptions.css({ width: options.width });
716
+ ddSelect.css({ width: options.width, background: options.background });
717
+ obj.css({ width: options.width });
718
+
719
+ //Set height
720
+ if (options.height != null)
721
+ ddOptions.css({ height: options.height, overflow: 'auto' });
722
+
723
+ //Add ddOptions to the container. Replace with template engine later.
724
+ $.each(options.data, function (index, item) {
725
+ if (item.selected) options.defaultSelectedIndex = index;
726
+ ddOptions.append('<li>' +
727
+ '<a class="dd-option">' +
728
+ (item.value ? ' <input class="dd-option-value" type="hidden" value="' + item.value + '" />' : '') +
729
+ (item.imageSrc ? ' <img class="dd-option-image' + (options.imagePosition == "right" ? ' dd-image-right' : '') + '" src="' + item.imageSrc + '" />' : '') +
730
+ (item.text ? ' <label class="dd-option-text">' + item.text + '</label>' : '') +
731
+ (item.description ? ' <small class="dd-option-description dd-desc">' + item.description + '</small>' : '') +
732
+ '</a>' +
733
+ '</li>');
734
+ });
735
+
736
+ //Save plugin data.
737
+ var pluginData = {
738
+ settings: options,
739
+ original: original,
740
+ selectedIndex: -1,
741
+ selectedItem: null,
742
+ selectedData: null
743
+ }
744
+ obj.data('ddslick', pluginData);
745
+
746
+ //Check if needs to show the select text, otherwise show selected or default selection
747
+ if (options.selectText.length > 0 && options.defaultSelectedIndex == null) {
748
+ obj.find('.dd-selected').html(options.selectText);
749
+ }
750
+ else {
751
+ var index = (options.defaultSelectedIndex != null && options.defaultSelectedIndex >= 0 && options.defaultSelectedIndex < options.data.length)
752
+ ? options.defaultSelectedIndex
753
+ : 0;
754
+ selectIndex(obj, index);
755
+ }
756
+
757
+ //EVENTS
758
+ //Displaying options
759
+ obj.find('.dd-select').on('click.ddslick', function () {
760
+ open(obj);
761
+ });
762
+
763
+ //Selecting an option
764
+ obj.find('.dd-option').on('click.ddslick', function () {
765
+ selectIndex(obj, $(this).closest('li').index());
766
+ });
767
+
768
+ //Click anywhere to close
769
+ if (options.clickOffToClose) {
770
+ ddOptions.addClass('dd-click-off-close');
771
+ obj.on('click.ddslick', function (e) { e.stopPropagation(); });
772
+ $('body').on('click', function () {
773
+ $('.dd-click-off-close').slideUp(50).siblings('.dd-select').find('.dd-pointer').removeClass('dd-pointer-up');
774
+ });
775
+ }
776
+ }
777
+ });
778
+ };
779
+
780
+ //Public method to select an option by its index
781
+ methods.select = function (options) {
782
+ return this.each(function () {
783
+ if (options.index !== null)
784
+ selectIndex($(this), options.index);
785
+ });
786
+ }
787
+
788
+ //Public method to open drop down
789
+ methods.open = function () {
790
+ return this.each(function () {
791
+ var $this = $(this),
792
+ pluginData = $this.data('ddslick');
793
+
794
+ //Check if plugin is initialized
795
+ if (pluginData)
796
+ open($this);
797
+ });
798
+ };
799
+
800
+ //Public method to close drop down
801
+ methods.close = function () {
802
+ return this.each(function () {
803
+ var $this = $(this),
804
+ pluginData = $this.data('ddslick');
805
+
806
+ //Check if plugin is initialized
807
+ if (pluginData)
808
+ close($this);
809
+ });
810
+ };
811
+
812
+ //Public method to destroy. Unbind all events and restore the original Html select/options
813
+ methods.destroy = function () {
814
+ return this.each(function () {
815
+ var $this = $(this),
816
+ pluginData = $this.data('ddslick');
817
+
818
+ //Check if already destroyed
819
+ if (pluginData) {
820
+ var originalElement = pluginData.original;
821
+ $this.removeData('ddslick').unbind('.ddslick').replaceWith(originalElement);
822
+ }
823
+ });
824
+ }
825
+
826
+ //Private: Select index
827
+ function selectIndex(obj, index) {
828
+
829
+ //Get plugin data
830
+ var pluginData = obj.data('ddslick');
831
+
832
+ //Get required elements
833
+ var ddSelected = obj.find('.dd-selected'),
834
+ ddSelectedValue = ddSelected.siblings('.dd-selected-value'),
835
+ ddOptions = obj.find('.dd-options'),
836
+ ddPointer = ddSelected.siblings('.dd-pointer'),
837
+ selectedOption = obj.find('.dd-option').eq(index),
838
+ selectedLiItem = selectedOption.closest('li'),
839
+ settings = pluginData.settings,
840
+ selectedData = pluginData.settings.data[index];
841
+
842
+ //Highlight selected option
843
+ obj.find('.dd-option').removeClass('dd-option-selected');
844
+ selectedOption.addClass('dd-option-selected');
845
+
846
+ //Update or Set plugin data with new selection
847
+ pluginData.selectedIndex = index;
848
+ pluginData.selectedItem = selectedLiItem;
849
+ pluginData.selectedData = selectedData;
850
+
851
+ //If set to display to full html, add html
852
+ if (settings.showSelectedHTML) {
853
+ ddSelected.html(
854
+ (selectedData.imageSrc ? '<img class="dd-selected-image' + (settings.imagePosition == "right" ? ' dd-image-right' : '') + '" src="' + selectedData.imageSrc + '" />' : '') +
855
+ (selectedData.text ? '<label class="dd-selected-text">' + selectedData.text + '</label>' : '') +
856
+ (selectedData.description ? '<small class="dd-selected-description dd-desc' + (settings.truncateDescription ? ' dd-selected-description-truncated' : '') + '" >' + selectedData.description + '</small>' : '')
857
+ );
858
+
859
+ }
860
+ //Else only display text as selection
861
+ else ddSelected.html(selectedData.text);
862
+
863
+ //Updating selected option value
864
+ ddSelectedValue.val(selectedData.value);
865
+
866
+ //BONUS! Update the original element attribute with the new selection
867
+ pluginData.original.val(selectedData.value);
868
+ obj.data('ddslick', pluginData);
869
+
870
+ //Close options on selection
871
+ close(obj);
872
+
873
+ //Adjust appearence for selected option
874
+ adjustSelectedHeight(obj);
875
+
876
+ //Callback function on selection
877
+ if (typeof settings.onSelected == 'function') {
878
+ settings.onSelected.call(this, pluginData);
879
+ }
880
+ }
881
+
882
+ //Private: Close the drop down options
883
+ function open(obj) {
884
+
885
+ var $this = obj.find('.dd-select'),
886
+ ddOptions = $this.siblings('.dd-options'),
887
+ ddPointer = $this.find('.dd-pointer'),
888
+ wasOpen = ddOptions.is(':visible');
889
+
890
+ //Close all open options (multiple plugins) on the page
891
+ $('.dd-click-off-close').not(ddOptions).slideUp(50);
892
+ $('.dd-pointer').removeClass('dd-pointer-up');
893
+
894
+ if (wasOpen) {
895
+ ddOptions.slideUp('fast');
896
+ ddPointer.removeClass('dd-pointer-up');
897
+ }
898
+ else {
899
+ ddOptions.slideDown('fast');
900
+ ddPointer.addClass('dd-pointer-up');
901
+ }
902
+
903
+ //Fix text height (i.e. display title in center), if there is no description
904
+ adjustOptionsHeight(obj);
905
+ }
906
+
907
+ //Private: Close the drop down options
908
+ function close(obj) {
909
+ //Close drop down and adjust pointer direction
910
+ obj.find('.dd-options').slideUp(50);
911
+ obj.find('.dd-pointer').removeClass('dd-pointer-up').removeClass('dd-pointer-up');
912
+ }
913
+
914
+ //Private: Adjust appearence for selected option (move title to middle), when no desripction
915
+ function adjustSelectedHeight(obj) {
916
+
917
+ //Get height of dd-selected
918
+ var lSHeight = obj.find('.dd-select').css('height');
919
+
920
+ //Check if there is selected description
921
+ var descriptionSelected = obj.find('.dd-selected-description');
922
+ var imgSelected = obj.find('.dd-selected-image');
923
+ if (descriptionSelected.length <= 0 && imgSelected.length > 0) {
924
+ obj.find('.dd-selected-text').css('lineHeight', lSHeight);
925
+ }
926
+ }
927
+
928
+ //Private: Adjust appearence for drop down options (move title to middle), when no desripction
929
+ function adjustOptionsHeight(obj) {
930
+ obj.find('.dd-option').each(function () {
931
+ var $this = $(this);
932
+ var lOHeight = $this.css('height');
933
+ var descriptionOption = $this.find('.dd-option-description');
934
+ var imgOption = obj.find('.dd-option-image');
935
+ if (descriptionOption.length <= 0 && imgOption.length > 0) {
936
+ $this.find('.dd-option-text').css('lineHeight', lOHeight);
937
+ }
938
+ });
939
+ }
940
+
941
+ })(jQuery);//js\libs\jquery.mousewheel.js
942
+
943
+ /*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
944
+ * Licensed under the MIT License (LICENSE.txt).
945
+ *
946
+ * Version: 3.1.9
947
+ *
948
+ * Requires: jQuery 1.2.2+
949
+ */
950
+
951
+ (function (factory) {
952
+ if ( typeof define === 'function' && define.amd ) {
953
+ // AMD. Register as an anonymous module.
954
+ define(['jquery'], factory);
955
+ } else if (typeof exports === 'object') {
956
+ // Node/CommonJS style for Browserify
957
+ module.exports = factory;
958
+ } else {
959
+ // Browser globals
960
+ factory(jQuery);
961
+ }
962
+ }(function ($) {
963
+
964
+ var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
965
+ toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
966
+ ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
967
+ slice = Array.prototype.slice,
968
+ nullLowestDeltaTimeout, lowestDelta;
969
+
970
+ if ( $.event.fixHooks ) {
971
+ for ( var i = toFix.length; i; ) {
972
+ $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
973
+ }
974
+ }
975
+
976
+ var special = $.event.special.mousewheel = {
977
+ version: '3.1.9',
978
+
979
+ setup: function() {
980
+ if ( this.addEventListener ) {
981
+ for ( var i = toBind.length; i; ) {
982
+ this.addEventListener( toBind[--i], handler, false );
983
+ }
984
+ } else {
985
+ this.onmousewheel = handler;
986
+ }
987
+ // Store the line height and page height for this particular element
988
+ $.data(this, 'mousewheel-line-height', special.getLineHeight(this));
989
+ $.data(this, 'mousewheel-page-height', special.getPageHeight(this));
990
+ },
991
+
992
+ teardown: function() {
993
+ if ( this.removeEventListener ) {
994
+ for ( var i = toBind.length; i; ) {
995
+ this.removeEventListener( toBind[--i], handler, false );
996
+ }
997
+ } else {
998
+ this.onmousewheel = null;
999
+ }
1000
+ },
1001
+
1002
+ getLineHeight: function(elem) {
1003
+ return parseInt($(elem)['offsetParent' in $.fn ? 'offsetParent' : 'parent']().css('fontSize'), 10);
1004
+ },
1005
+
1006
+ getPageHeight: function(elem) {
1007
+ return $(elem).height();
1008
+ },
1009
+
1010
+ settings: {
1011
+ adjustOldDeltas: true
1012
+ }
1013
+ };
1014
+
1015
+ $.fn.extend({
1016
+ mousewheel: function(fn) {
1017
+ return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
1018
+ },
1019
+
1020
+ unmousewheel: function(fn) {
1021
+ return this.unbind('mousewheel', fn);
1022
+ }
1023
+ });
1024
+
1025
+
1026
+ function handler(event) {
1027
+ var orgEvent = event || window.event,
1028
+ args = slice.call(arguments, 1),
1029
+ delta = 0,
1030
+ deltaX = 0,
1031
+ deltaY = 0,
1032
+ absDelta = 0;
1033
+ event = $.event.fix(orgEvent);
1034
+ event.type = 'mousewheel';
1035
+
1036
+ // Old school scrollwheel delta
1037
+ if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; }
1038
+ if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; }
1039
+ if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; }
1040
+ if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
1041
+
1042
+ // Firefox < 17 horizontal scrolling related to DOMMouseScroll event
1043
+ if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
1044
+ deltaX = deltaY * -1;
1045
+ deltaY = 0;
1046
+ }
1047
+
1048
+ // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
1049
+ delta = deltaY === 0 ? deltaX : deltaY;
1050
+
1051
+ // New school wheel delta (wheel event)
1052
+ if ( 'deltaY' in orgEvent ) {
1053
+ deltaY = orgEvent.deltaY * -1;
1054
+ delta = deltaY;
1055
+ }
1056
+ if ( 'deltaX' in orgEvent ) {
1057
+ deltaX = orgEvent.deltaX;
1058
+ if ( deltaY === 0 ) { delta = deltaX * -1; }
1059
+ }
1060
+
1061
+ // No change actually happened, no reason to go any further
1062
+ if ( deltaY === 0 && deltaX === 0 ) { return; }
1063
+
1064
+ // Need to convert lines and pages to pixels if we aren't already in pixels
1065
+ // There are three delta modes:
1066
+ // * deltaMode 0 is by pixels, nothing to do
1067
+ // * deltaMode 1 is by lines
1068
+ // * deltaMode 2 is by pages
1069
+ if ( orgEvent.deltaMode === 1 ) {
1070
+ var lineHeight = $.data(this, 'mousewheel-line-height');
1071
+ delta *= lineHeight;
1072
+ deltaY *= lineHeight;
1073
+ deltaX *= lineHeight;
1074
+ } else if ( orgEvent.deltaMode === 2 ) {
1075
+ var pageHeight = $.data(this, 'mousewheel-page-height');
1076
+ delta *= pageHeight;
1077
+ deltaY *= pageHeight;
1078
+ deltaX *= pageHeight;
1079
+ }
1080
+
1081
+ // Store lowest absolute delta to normalize the delta values
1082
+ absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
1083
+
1084
+ if ( !lowestDelta || absDelta < lowestDelta ) {
1085
+ lowestDelta = absDelta;
1086
+
1087
+ // Adjust older deltas if necessary
1088
+ if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
1089
+ lowestDelta /= 40;
1090
+ }
1091
+ }
1092
+
1093
+ // Adjust older deltas if necessary
1094
+ if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
1095
+ // Divide all the things by 40!
1096
+ delta /= 40;
1097
+ deltaX /= 40;
1098
+ deltaY /= 40;
1099
+ }
1100
+
1101
+ // Get a whole, normalized value for the deltas
1102
+ delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta);
1103
+ deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
1104
+ deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
1105
+
1106
+ // Add information to the event object
1107
+ event.deltaX = deltaX;
1108
+ event.deltaY = deltaY;
1109
+ event.deltaFactor = lowestDelta;
1110
+ // Go ahead and set deltaMode to 0 since we converted to pixels
1111
+ // Although this is a little odd since we overwrite the deltaX/Y
1112
+ // properties with normalized deltas.
1113
+ event.deltaMode = 0;
1114
+
1115
+ // Add event and delta to the front of the arguments
1116
+ args.unshift(event, delta, deltaX, deltaY);
1117
+
1118
+ // Clearout lowestDelta after sometime to better
1119
+ // handle multiple device types that give different
1120
+ // a different lowestDelta
1121
+ // Ex: trackpad = 3 and mouse wheel = 120
1122
+ if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
1123
+ nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
1124
+
1125
+ return ($.event.dispatch || $.event.handle).apply(this, args);
1126
+ }
1127
+
1128
+ function nullLowestDelta() {
1129
+ lowestDelta = null;
1130
+ }
1131
+
1132
+ function shouldAdjustOldDeltas(orgEvent, absDelta) {
1133
+ // If this is an older event and the delta is divisable by 120,
1134
+ // then we are assuming that the browser is treating this as an
1135
+ // older mouse wheel event and that we should divide the deltas
1136
+ // by 40 to try and get a more usable deltaFactor.
1137
+ // Side note, this actually impacts the reported scroll distance
1138
+ // in older browsers and can cause scrolling to be slower than native.
1139
+ // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
1140
+ return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
1141
+ }
1142
+
1143
+ }));
1144
+
1145
+ //js\libs\spectrum.js
1146
+
1147
+ /*! Spectrum Colorpicker v1.3.2
1148
+ * License: MIT
1149
+ * Author: Brian Grinstead
1150
+ * https://github.com/bgrins/spectrum
1151
+ * Requires: jQuery
1152
+ */
1153
+
1154
+ // Spectrum Colorpicker v1.3.2
1155
+ // https://github.com/bgrins/spectrum
1156
+ // Author: Brian Grinstead
1157
+ // License: MIT
1158
+
1159
+ (function (window, $, undefined) {
1160
+ var defaultOpts = {
1161
+
1162
+ // Callbacks
1163
+ beforeShow: noop,
1164
+ move: noop,
1165
+ change: noop,
1166
+ show: noop,
1167
+ hide: noop,
1168
+
1169
+ // Options
1170
+ color: false,
1171
+ flat: false,
1172
+ showInput: false,
1173
+ allowEmpty: false,
1174
+ showButtons: true,
1175
+ clickoutFiresChange: false,
1176
+ showInitial: false,
1177
+ showPalette: false,
1178
+ showPaletteOnly: false,
1179
+ showSelectionPalette: true,
1180
+ localStorageKey: false,
1181
+ appendTo: "body",
1182
+ maxSelectionSize: 7,
1183
+ cancelText: "cancel",
1184
+ chooseText: "choose",
1185
+ clearText: "Clear Color Selection",
1186
+ preferredFormat: false,
1187
+ className: "",
1188
+ showAlpha: false,
1189
+ theme: "sp-light",
1190
+ palette: [["#ffffff", "#000000", "#ff0000", "#ff8000", "#ffff00", "#008000", "#0000ff", "#4b0082", "#9400d3"]],
1191
+ selectionPalette: [],
1192
+ disabled: false
1193
+ },
1194
+ spectrums = [],
1195
+ IE = !!/msie/i.exec( window.navigator.userAgent ),
1196
+ rgbaSupport = (function() {
1197
+ function contains( str, substr ) {
1198
+ return !!~('' + str).indexOf(substr);
1199
+ }
1200
+
1201
+ var elem = document.createElement('div');
1202
+ var style = elem.style;
1203
+ style.cssText = 'background-color:rgba(0,0,0,.5)';
1204
+ return contains(style.backgroundColor, 'rgba') || contains(style.backgroundColor, 'hsla');
1205
+ })(),
1206
+ inputTypeColorSupport = (function() {
1207
+ var colorInput = $("<input type='color' value='!' />")[0];
1208
+ return colorInput.type === "color" && colorInput.value !== "!";
1209
+ })(),
1210
+ replaceInput = [
1211
+ "<div class='sp-replacer'>",
1212
+ "<div class='sp-preview'><div class='sp-preview-inner'></div></div>",
1213
+ "<div class='sp-dd'>&#9660;</div>",
1214
+ "</div>"
1215
+ ].join(''),
1216
+ markup = (function () {
1217
+
1218
+ // IE does not support gradients with multiple stops, so we need to simulate
1219
+ // that for the rainbow slider with 8 divs that each have a single gradient
1220
+ var gradientFix = "";
1221
+ if (IE) {
1222
+ for (var i = 1; i <= 6; i++) {
1223
+ gradientFix += "<div class='sp-" + i + "'></div>";
1224
+ }
1225
+ }
1226
+
1227
+ return [
1228
+ "<div class='sp-container sp-hidden'>",
1229
+ "<div class='sp-palette-container'>",
1230
+ "<div class='sp-palette sp-thumb sp-cf'></div>",
1231
+ "</div>",
1232
+ "<div class='sp-picker-container'>",
1233
+ "<div class='sp-top sp-cf'>",
1234
+ "<div class='sp-fill'></div>",
1235
+ "<div class='sp-top-inner'>",
1236
+ "<div class='sp-color'>",
1237
+ "<div class='sp-sat'>",
1238
+ "<div class='sp-val'>",
1239
+ "<div class='sp-dragger'></div>",
1240
+ "</div>",
1241
+ "</div>",
1242
+ "</div>",
1243
+ "<div class='sp-clear sp-clear-display'>",
1244
+ "</div>",
1245
+ "<div class='sp-hue'>",
1246
+ "<div class='sp-slider'></div>",
1247
+ gradientFix,
1248
+ "</div>",
1249
+ "</div>",
1250
+ "<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div>",
1251
+ "</div>",
1252
+ "<div class='sp-input-container sp-cf'>",
1253
+ "<input class='sp-input' type='text' spellcheck='false' />",
1254
+ "</div>",
1255
+ "<div class='sp-initial sp-thumb sp-cf'></div>",
1256
+ "<div class='sp-button-container sp-cf'>",
1257
+ "<a class='sp-cancel' href='#'></a>",
1258
+ "<button class='sp-choose'></button>",
1259
+ "</div>",
1260
+ "</div>",
1261
+ "</div>"
1262
+ ].join("");
1263
+ })();
1264
+
1265
+ function paletteTemplate (p, color, className) {
1266
+ var html = [];
1267
+ for (var i = 0; i < p.length; i++) {
1268
+ var current = p[i];
1269
+ if(current) {
1270
+ var tiny = tinycolor(current);
1271
+ var c = tiny.toHsl().l < 0.5 ? "sp-thumb-el sp-thumb-dark" : "sp-thumb-el sp-thumb-light";
1272
+ c += (tinycolor.equals(color, current)) ? " sp-thumb-active" : "";
1273
+
1274
+ var swatchStyle = rgbaSupport ? ("background-color:" + tiny.toRgbString()) : "filter:" + tiny.toFilter();
1275
+ html.push('<span title="' + tiny.toRgbString() + '" data-color="' + tiny.toRgbString() + '" class="' + c + '"><span class="sp-thumb-inner" style="' + swatchStyle + ';" /></span>');
1276
+ } else {
1277
+ var cls = 'sp-clear-display';
1278
+ html.push('<span title="No Color Selected" data-color="" style="background-color:transparent;" class="' + cls + '"></span>');
1279
+ }
1280
+ }
1281
+ return "<div class='sp-cf " + className + "'>" + html.join('') + "</div>";
1282
+ }
1283
+
1284
+ function hideAll() {
1285
+ for (var i = 0; i < spectrums.length; i++) {
1286
+ if (spectrums[i]) {
1287
+ spectrums[i].hide();
1288
+ }
1289
+ }
1290
+ }
1291
+
1292
+ function instanceOptions(o, callbackContext) {
1293
+ var opts = $.extend({}, defaultOpts, o);
1294
+ opts.callbacks = {
1295
+ 'move': bind(opts.move, callbackContext),
1296
+ 'change': bind(opts.change, callbackContext),
1297
+ 'show': bind(opts.show, callbackContext),
1298
+ 'hide': bind(opts.hide, callbackContext),
1299
+ 'beforeShow': bind(opts.beforeShow, callbackContext)
1300
+ };
1301
+
1302
+ return opts;
1303
+ }
1304
+
1305
+ function spectrum(element, o) {
1306
+
1307
+ var opts = instanceOptions(o, element),
1308
+ flat = opts.flat,
1309
+ showSelectionPalette = opts.showSelectionPalette,
1310
+ localStorageKey = opts.localStorageKey,
1311
+ theme = opts.theme,
1312
+ callbacks = opts.callbacks,
1313
+ resize = throttle(reflow, 10),
1314
+ visible = false,
1315
+ dragWidth = 0,
1316
+ dragHeight = 0,
1317
+ dragHelperHeight = 0,
1318
+ slideHeight = 0,
1319
+ slideWidth = 0,
1320
+ alphaWidth = 0,
1321
+ alphaSlideHelperWidth = 0,
1322
+ slideHelperHeight = 0,
1323
+ currentHue = 0,
1324
+ currentSaturation = 0,
1325
+ currentValue = 0,
1326
+ currentAlpha = 1,
1327
+ palette = [],
1328
+ paletteArray = [],
1329
+ paletteLookup = {},
1330
+ selectionPalette = opts.selectionPalette.slice(0),
1331
+ maxSelectionSize = opts.maxSelectionSize,
1332
+ draggingClass = "sp-dragging",
1333
+ shiftMovementDirection = null;
1334
+
1335
+ var doc = element.ownerDocument,
1336
+ body = doc.body,
1337
+ boundElement = $(element),
1338
+ disabled = false,
1339
+ container = $(markup, doc).addClass(theme),
1340
+ dragger = container.find(".sp-color"),
1341
+ dragHelper = container.find(".sp-dragger"),
1342
+ slider = container.find(".sp-hue"),
1343
+ slideHelper = container.find(".sp-slider"),
1344
+ alphaSliderInner = container.find(".sp-alpha-inner"),
1345
+ alphaSlider = container.find(".sp-alpha"),
1346
+ alphaSlideHelper = container.find(".sp-alpha-handle"),
1347
+ textInput = container.find(".sp-input"),
1348
+ paletteContainer = container.find(".sp-palette"),
1349
+ initialColorContainer = container.find(".sp-initial"),
1350
+ cancelButton = container.find(".sp-cancel"),
1351
+ clearButton = container.find(".sp-clear"),
1352
+ chooseButton = container.find(".sp-choose"),
1353
+ isInput = boundElement.is("input"),
1354
+ isInputTypeColor = isInput && inputTypeColorSupport && boundElement.attr("type") === "color",
1355
+ shouldReplace = isInput && !flat,
1356
+ replacer = (shouldReplace) ? $(replaceInput).addClass(theme).addClass(opts.className) : $([]),
1357
+ offsetElement = (shouldReplace) ? replacer : boundElement,
1358
+ previewElement = replacer.find(".sp-preview-inner"),
1359
+ initialColor = opts.color || (isInput && boundElement.val()),
1360
+ colorOnShow = false,
1361
+ preferredFormat = opts.preferredFormat,
1362
+ currentPreferredFormat = preferredFormat,
1363
+ clickoutFiresChange = !opts.showButtons || opts.clickoutFiresChange,
1364
+ isEmpty = !initialColor,
1365
+ allowEmpty = opts.allowEmpty && !isInputTypeColor;
1366
+
1367
+ function applyOptions() {
1368
+
1369
+ if (opts.showPaletteOnly) {
1370
+ opts.showPalette = true;
1371
+ }
1372
+
1373
+ if (opts.palette) {
1374
+ palette = opts.palette.slice(0);
1375
+ paletteArray = $.isArray(palette[0]) ? palette : [palette];
1376
+ paletteLookup = {};
1377
+ for (var i = 0; i < paletteArray.length; i++) {
1378
+ for (var j = 0; j < paletteArray[i].length; j++) {
1379
+ var rgb = tinycolor(paletteArray[i][j]).toRgbString();
1380
+ paletteLookup[rgb] = true;
1381
+ }
1382
+ }
1383
+ }
1384
+
1385
+ container.toggleClass("sp-flat", flat);
1386
+ container.toggleClass("sp-input-disabled", !opts.showInput);
1387
+ container.toggleClass("sp-alpha-enabled", opts.showAlpha);
1388
+ container.toggleClass("sp-clear-enabled", allowEmpty);
1389
+ container.toggleClass("sp-buttons-disabled", !opts.showButtons);
1390
+ container.toggleClass("sp-palette-disabled", !opts.showPalette);
1391
+ container.toggleClass("sp-palette-only", opts.showPaletteOnly);
1392
+ container.toggleClass("sp-initial-disabled", !opts.showInitial);
1393
+ container.addClass(opts.className);
1394
+
1395
+ reflow();
1396
+ }
1397
+
1398
+ function initialize() {
1399
+
1400
+ if (IE) {
1401
+ container.find("*:not(input)").attr("unselectable", "on");
1402
+ }
1403
+
1404
+ applyOptions();
1405
+
1406
+ if (shouldReplace) {
1407
+ boundElement.after(replacer).hide();
1408
+ }
1409
+
1410
+ if (!allowEmpty) {
1411
+ clearButton.hide();
1412
+ }
1413
+
1414
+ if (flat) {
1415
+ boundElement.after(container).hide();
1416
+ }
1417
+ else {
1418
+
1419
+ var appendTo = opts.appendTo === "parent" ? boundElement.parent() : $(opts.appendTo);
1420
+ if (appendTo.length !== 1) {
1421
+ appendTo = $("body");
1422
+ }
1423
+
1424
+ appendTo.append(container);
1425
+ }
1426
+
1427
+ updateSelectionPaletteFromStorage();
1428
+
1429
+ offsetElement.bind("click.spectrum touchstart.spectrum", function (e) {
1430
+ if (!disabled) {
1431
+ toggle();
1432
+ }
1433
+
1434
+ e.stopPropagation();
1435
+
1436
+ if (!$(e.target).is("input")) {
1437
+ e.preventDefault();
1438
+ }
1439
+ });
1440
+
1441
+ if(boundElement.is(":disabled") || (opts.disabled === true)) {
1442
+ disable();
1443
+ }
1444
+
1445
+ // Prevent clicks from bubbling up to document. This would cause it to be hidden.
1446
+ container.click(stopPropagation);
1447
+
1448
+ // Handle user typed input
1449
+ textInput.change(setFromTextInput);
1450
+ textInput.bind("paste", function () {
1451
+ setTimeout(setFromTextInput, 1);
1452
+ });
1453
+ textInput.keydown(function (e) { if (e.keyCode == 13) { setFromTextInput(); } });
1454
+
1455
+ cancelButton.text(opts.cancelText);
1456
+ cancelButton.bind("click.spectrum", function (e) {
1457
+ e.stopPropagation();
1458
+ e.preventDefault();
1459
+ hide("cancel");
1460
+ });
1461
+
1462
+ clearButton.attr("title", opts.clearText);
1463
+ clearButton.bind("click.spectrum", function (e) {
1464
+ e.stopPropagation();
1465
+ e.preventDefault();
1466
+ isEmpty = true;
1467
+ move();
1468
+
1469
+ if(flat) {
1470
+ //for the flat style, this is a change event
1471
+ updateOriginalInput(true);
1472
+ }
1473
+ });
1474
+
1475
+ chooseButton.text(opts.chooseText);
1476
+ chooseButton.bind("click.spectrum", function (e) {
1477
+ e.stopPropagation();
1478
+ e.preventDefault();
1479
+
1480
+ if (isValid()) {
1481
+ updateOriginalInput(true);
1482
+ hide();
1483
+ }
1484
+ });
1485
+
1486
+ draggable(alphaSlider, function (dragX, dragY, e) {
1487
+ currentAlpha = (dragX / alphaWidth);
1488
+ isEmpty = false;
1489
+ if (e.shiftKey) {
1490
+ currentAlpha = Math.round(currentAlpha * 10) / 10;
1491
+ }
1492
+
1493
+ move();
1494
+ }, dragStart, dragStop);
1495
+
1496
+ draggable(slider, function (dragX, dragY) {
1497
+ currentHue = parseFloat(dragY / slideHeight);
1498
+ isEmpty = false;
1499
+ if (!opts.showAlpha) {
1500
+ currentAlpha = 1;
1501
+ }
1502
+ move();
1503
+ }, dragStart, dragStop);
1504
+
1505
+ draggable(dragger, function (dragX, dragY, e) {
1506
+
1507
+ // shift+drag should snap the movement to either the x or y axis.
1508
+ if (!e.shiftKey) {
1509
+ shiftMovementDirection = null;
1510
+ }
1511
+ else if (!shiftMovementDirection) {
1512
+ var oldDragX = currentSaturation * dragWidth;
1513
+ var oldDragY = dragHeight - (currentValue * dragHeight);
1514
+ var furtherFromX = Math.abs(dragX - oldDragX) > Math.abs(dragY - oldDragY);
1515
+
1516
+ shiftMovementDirection = furtherFromX ? "x" : "y";
1517
+ }
1518
+
1519
+ var setSaturation = !shiftMovementDirection || shiftMovementDirection === "x";
1520
+ var setValue = !shiftMovementDirection || shiftMovementDirection === "y";
1521
+
1522
+ if (setSaturation) {
1523
+ currentSaturation = parseFloat(dragX / dragWidth);
1524
+ }
1525
+ if (setValue) {
1526
+ currentValue = parseFloat((dragHeight - dragY) / dragHeight);
1527
+ }
1528
+
1529
+ isEmpty = false;
1530
+ if (!opts.showAlpha) {
1531
+ currentAlpha = 1;
1532
+ }
1533
+
1534
+ move();
1535
+
1536
+ }, dragStart, dragStop);
1537
+
1538
+ if (!!initialColor) {
1539
+ set(initialColor);
1540
+
1541
+ // In case color was black - update the preview UI and set the format
1542
+ // since the set function will not run (default color is black).
1543
+ updateUI();
1544
+ currentPreferredFormat = preferredFormat || tinycolor(initialColor).format;
1545
+
1546
+ addColorToSelectionPalette(initialColor);
1547
+ }
1548
+ else {
1549
+ updateUI();
1550
+ }
1551
+
1552
+ if (flat) {
1553
+ show();
1554
+ }
1555
+
1556
+ function palletElementClick(e) {
1557
+ if (e.data && e.data.ignore) {
1558
+ set($(this).data("color"));
1559
+ move();
1560
+ }
1561
+ else {
1562
+ set($(this).data("color"));
1563
+ move();
1564
+ updateOriginalInput(true);
1565
+ hide();
1566
+ }
1567
+
1568
+ return false;
1569
+ }
1570
+
1571
+ var paletteEvent = IE ? "mousedown.spectrum" : "click.spectrum touchstart.spectrum";
1572
+ paletteContainer.delegate(".sp-thumb-el", paletteEvent, palletElementClick);
1573
+ initialColorContainer.delegate(".sp-thumb-el:nth-child(1)", paletteEvent, { ignore: true }, palletElementClick);
1574
+ }
1575
+
1576
+ function updateSelectionPaletteFromStorage() {
1577
+
1578
+ if (localStorageKey && window.localStorage) {
1579
+
1580
+ // Migrate old palettes over to new format. May want to remove this eventually.
1581
+ try {
1582
+ var oldPalette = window.localStorage[localStorageKey].split(",#");
1583
+ if (oldPalette.length > 1) {
1584
+ delete window.localStorage[localStorageKey];
1585
+ $.each(oldPalette, function(i, c) {
1586
+ addColorToSelectionPalette(c);
1587
+ });
1588
+ }
1589
+ }
1590
+ catch(e) { }
1591
+
1592
+ try {
1593
+ selectionPalette = window.localStorage[localStorageKey].split(";");
1594
+ }
1595
+ catch (e) { }
1596
+ }
1597
+ }
1598
+
1599
+ function addColorToSelectionPalette(color) {
1600
+ if (showSelectionPalette) {
1601
+ var rgb = tinycolor(color).toRgbString();
1602
+ if (!paletteLookup[rgb] && selectionPalette.indexOf(rgb) === -1) {
1603
+ selectionPalette.push(rgb);
1604
+ while(selectionPalette.length > maxSelectionSize) {
1605
+ selectionPalette.shift();
1606
+ }
1607
+ }
1608
+
1609
+ if (localStorageKey && window.localStorage) {
1610
+ try {
1611
+ window.localStorage[localStorageKey] = selectionPalette.join(";");
1612
+ }
1613
+ catch(e) { }
1614
+ }
1615
+ }
1616
+ }
1617
+
1618
+ function getUniqueSelectionPalette() {
1619
+ var unique = [];
1620
+ if (opts.showPalette) {
1621
+ for (i = 0; i < selectionPalette.length; i++) {
1622
+ var rgb = tinycolor(selectionPalette[i]).toRgbString();
1623
+
1624
+ if (!paletteLookup[rgb]) {
1625
+ unique.push(selectionPalette[i]);
1626
+ }
1627
+ }
1628
+ }
1629
+
1630
+ return unique.reverse().slice(0, opts.maxSelectionSize);
1631
+ }
1632
+
1633
+ function drawPalette() {
1634
+
1635
+ var currentColor = get();
1636
+
1637
+ var html = $.map(paletteArray, function (palette, i) {
1638
+ return paletteTemplate(palette, currentColor, "sp-palette-row sp-palette-row-" + i);
1639
+ });
1640
+
1641
+ updateSelectionPaletteFromStorage();
1642
+
1643
+ if (selectionPalette) {
1644
+ html.push(paletteTemplate(getUniqueSelectionPalette(), currentColor, "sp-palette-row sp-palette-row-selection"));
1645
+ }
1646
+
1647
+ paletteContainer.html(html.join(""));
1648
+ }
1649
+
1650
+ function drawInitial() {
1651
+ if (opts.showInitial) {
1652
+ var initial = colorOnShow;
1653
+ var current = get();
1654
+ initialColorContainer.html(paletteTemplate([initial, current], current, "sp-palette-row-initial"));
1655
+ }
1656
+ }
1657
+
1658
+ function dragStart() {
1659
+ if (dragHeight <= 0 || dragWidth <= 0 || slideHeight <= 0) {
1660
+ reflow();
1661
+ }
1662
+ container.addClass(draggingClass);
1663
+ shiftMovementDirection = null;
1664
+ boundElement.trigger('dragstart.spectrum', [ get() ]);
1665
+ }
1666
+
1667
+ function dragStop() {
1668
+ container.removeClass(draggingClass);
1669
+ boundElement.trigger('dragstop.spectrum', [ get() ]);
1670
+ }
1671
+
1672
+ function setFromTextInput() {
1673
+
1674
+ var value = textInput.val();
1675
+
1676
+ if ((value === null || value === "") && allowEmpty) {
1677
+ set(null);
1678
+ updateOriginalInput(true);
1679
+ }
1680
+ else {
1681
+ var tiny = tinycolor(value);
1682
+ if (tiny.ok) {
1683
+ set(tiny);
1684
+ updateOriginalInput(true);
1685
+ }
1686
+ else {
1687
+ textInput.addClass("sp-validation-error");
1688
+ }
1689
+ }
1690
+ }
1691
+
1692
+ function toggle() {
1693
+ if (visible) {
1694
+ hide();
1695
+ }
1696
+ else {
1697
+ show();
1698
+ }
1699
+ }
1700
+
1701
+ function show() {
1702
+ var event = $.Event('beforeShow.spectrum');
1703
+
1704
+ if (visible) {
1705
+ reflow();
1706
+ return;
1707
+ }
1708
+
1709
+ boundElement.trigger(event, [ get() ]);
1710
+
1711
+ if (callbacks.beforeShow(get()) === false || event.isDefaultPrevented()) {
1712
+ return;
1713
+ }
1714
+
1715
+ hideAll();
1716
+ visible = true;
1717
+
1718
+ $(doc).bind("click.spectrum", hide);
1719
+ $(window).bind("resize.spectrum", resize);
1720
+ replacer.addClass("sp-active");
1721
+ container.removeClass("sp-hidden");
1722
+
1723
+ reflow();
1724
+ updateUI();
1725
+
1726
+ colorOnShow = get();
1727
+
1728
+ drawInitial();
1729
+ callbacks.show(colorOnShow);
1730
+ boundElement.trigger('show.spectrum', [ colorOnShow ]);
1731
+ }
1732
+
1733
+ function hide(e) {
1734
+
1735
+ // Return on right click
1736
+ if (e && e.type == "click" && e.button == 2) { return; }
1737
+
1738
+ // Return if hiding is unnecessary
1739
+ if (!visible || flat) { return; }
1740
+ visible = false;
1741
+
1742
+ $(doc).unbind("click.spectrum", hide);
1743
+ $(window).unbind("resize.spectrum", resize);
1744
+
1745
+ replacer.removeClass("sp-active");
1746
+ container.addClass("sp-hidden");
1747
+
1748
+ var colorHasChanged = !tinycolor.equals(get(), colorOnShow);
1749
+
1750
+ if (colorHasChanged) {
1751
+ if (clickoutFiresChange && e !== "cancel") {
1752
+ updateOriginalInput(true);
1753
+ }
1754
+ else {
1755
+ revert();
1756
+ }
1757
+ }
1758
+
1759
+ callbacks.hide(get());
1760
+ boundElement.trigger('hide.spectrum', [ get() ]);
1761
+ }
1762
+
1763
+ function revert() {
1764
+ set(colorOnShow, true);
1765
+ }
1766
+
1767
+ function set(color, ignoreFormatChange) {
1768
+ if (tinycolor.equals(color, get())) {
1769
+ // Update UI just in case a validation error needs
1770
+ // to be cleared.
1771
+ updateUI();
1772
+ return;
1773
+ }
1774
+
1775
+ var newColor, newHsv;
1776
+ if (!color && allowEmpty) {
1777
+ isEmpty = true;
1778
+ } else {
1779
+ isEmpty = false;
1780
+ newColor = tinycolor(color);
1781
+ newHsv = newColor.toHsv();
1782
+
1783
+ currentHue = (newHsv.h % 360) / 360;
1784
+ currentSaturation = newHsv.s;
1785
+ currentValue = newHsv.v;
1786
+ currentAlpha = newHsv.a;
1787
+ }
1788
+ updateUI();
1789
+
1790
+ if (newColor && newColor.ok && !ignoreFormatChange) {
1791
+ currentPreferredFormat = preferredFormat || newColor.format;
1792
+ }
1793
+ }
1794
+
1795
+ function get(opts) {
1796
+ opts = opts || { };
1797
+
1798
+ if (allowEmpty && isEmpty) {
1799
+ return null;
1800
+ }
1801
+
1802
+ return tinycolor.fromRatio({
1803
+ h: currentHue,
1804
+ s: currentSaturation,
1805
+ v: currentValue,
1806
+ a: Math.round(currentAlpha * 100) / 100
1807
+ }, { format: opts.format || currentPreferredFormat });
1808
+ }
1809
+
1810
+ function isValid() {
1811
+ return !textInput.hasClass("sp-validation-error");
1812
+ }
1813
+
1814
+ function move() {
1815
+ updateUI();
1816
+
1817
+ callbacks.move(get());
1818
+ boundElement.trigger('move.spectrum', [ get() ]);
1819
+ }
1820
+
1821
+ function updateUI() {
1822
+
1823
+ textInput.removeClass("sp-validation-error");
1824
+
1825
+ updateHelperLocations();
1826
+
1827
+ // Update dragger background color (gradients take care of saturation and value).
1828
+ var flatColor = tinycolor.fromRatio({ h: currentHue, s: 1, v: 1 });
1829
+ dragger.css("background-color", flatColor.toHexString());
1830
+
1831
+ // Get a format that alpha will be included in (hex and names ignore alpha)
1832
+ var format = currentPreferredFormat;
1833
+ if (currentAlpha < 1 && !(currentAlpha === 0 && format === "name")) {
1834
+ if (format === "hex" || format === "hex3" || format === "hex6" || format === "name") {
1835
+ format = "rgb";
1836
+ }
1837
+ }
1838
+
1839
+ var realColor = get({ format: format }),
1840
+ displayColor = '';
1841
+
1842
+ //reset background info for preview element
1843
+ previewElement.removeClass("sp-clear-display");
1844
+ previewElement.css('background-color', 'transparent');
1845
+
1846
+ if (!realColor && allowEmpty) {
1847
+ // Update the replaced elements background with icon indicating no color selection
1848
+ previewElement.addClass("sp-clear-display");
1849
+ }
1850
+ else {
1851
+ var realHex = realColor.toHexString(),
1852
+ realRgb = realColor.toRgbString();
1853
+
1854
+ // Update the replaced elements background color (with actual selected color)
1855
+ if (rgbaSupport || realColor.alpha === 1) {
1856
+ previewElement.css("background-color", realRgb);
1857
+ }
1858
+ else {
1859
+ previewElement.css("background-color", "transparent");
1860
+ previewElement.css("filter", realColor.toFilter());
1861
+ }
1862
+
1863
+ if (opts.showAlpha) {
1864
+ var rgb = realColor.toRgb();
1865
+ rgb.a = 0;
1866
+ var realAlpha = tinycolor(rgb).toRgbString();
1867
+ var gradient = "linear-gradient(left, " + realAlpha + ", " + realHex + ")";
1868
+
1869
+ if (IE) {
1870
+ alphaSliderInner.css("filter", tinycolor(realAlpha).toFilter({ gradientType: 1 }, realHex));
1871
+ }
1872
+ else {
1873
+ alphaSliderInner.css("background", "-webkit-" + gradient);
1874
+ alphaSliderInner.css("background", "-moz-" + gradient);
1875
+ alphaSliderInner.css("background", "-ms-" + gradient);
1876
+ // Use current syntax gradient on unprefixed property.
1877
+ alphaSliderInner.css("background",
1878
+ "linear-gradient(to right, " + realAlpha + ", " + realHex + ")");
1879
+ }
1880
+ }
1881
+
1882
+ displayColor = realColor.toString(format);
1883
+ }
1884
+
1885
+ // Update the text entry input as it changes happen
1886
+ if (opts.showInput) {
1887
+ textInput.val(displayColor);
1888
+ }
1889
+
1890
+ if (opts.showPalette) {
1891
+ drawPalette();
1892
+ }
1893
+
1894
+ drawInitial();
1895
+ }
1896
+
1897
+ function updateHelperLocations() {
1898
+ var s = currentSaturation;
1899
+ var v = currentValue;
1900
+
1901
+ if(allowEmpty && isEmpty) {
1902
+ //if selected color is empty, hide the helpers
1903
+ alphaSlideHelper.hide();
1904
+ slideHelper.hide();
1905
+ dragHelper.hide();
1906
+ }
1907
+ else {
1908
+ //make sure helpers are visible
1909
+ alphaSlideHelper.show();
1910
+ slideHelper.show();
1911
+ dragHelper.show();
1912
+
1913
+ // Where to show the little circle in that displays your current selected color
1914
+ var dragX = s * dragWidth;
1915
+ var dragY = dragHeight - (v * dragHeight);
1916
+ dragX = Math.max(
1917
+ -dragHelperHeight,
1918
+ Math.min(dragWidth - dragHelperHeight, dragX - dragHelperHeight)
1919
+ );
1920
+ dragY = Math.max(
1921
+ -dragHelperHeight,
1922
+ Math.min(dragHeight - dragHelperHeight, dragY - dragHelperHeight)
1923
+ );
1924
+ dragHelper.css({
1925
+ "top": dragY + "px",
1926
+ "left": dragX + "px"
1927
+ });
1928
+
1929
+ var alphaX = currentAlpha * alphaWidth;
1930
+ alphaSlideHelper.css({
1931
+ "left": (alphaX - (alphaSlideHelperWidth / 2)) + "px"
1932
+ });
1933
+
1934
+ // Where to show the bar that displays your current selected hue
1935
+ var slideY = (currentHue) * slideHeight;
1936
+ slideHelper.css({
1937
+ "top": (slideY - slideHelperHeight) + "px"
1938
+ });
1939
+ }
1940
+ }
1941
+
1942
+ function updateOriginalInput(fireCallback) {
1943
+ var color = get(),
1944
+ displayColor = '',
1945
+ hasChanged = !tinycolor.equals(color, colorOnShow);
1946
+
1947
+ if (color) {
1948
+ displayColor = color.toString(currentPreferredFormat);
1949
+ // Update the selection palette with the current color
1950
+ addColorToSelectionPalette(color);
1951
+ }
1952
+
1953
+ if (isInput) {
1954
+ boundElement.val(displayColor);
1955
+ }
1956
+
1957
+ colorOnShow = color;
1958
+
1959
+ if (fireCallback && hasChanged) {
1960
+ callbacks.change(color);
1961
+ boundElement.trigger('change', [ color ]);
1962
+ }
1963
+ }
1964
+
1965
+ function reflow() {
1966
+ dragWidth = dragger.width();
1967
+ dragHeight = dragger.height();
1968
+ dragHelperHeight = dragHelper.height();
1969
+ slideWidth = slider.width();
1970
+ slideHeight = slider.height();
1971
+ slideHelperHeight = slideHelper.height();
1972
+ alphaWidth = alphaSlider.width();
1973
+ alphaSlideHelperWidth = alphaSlideHelper.width();
1974
+
1975
+ if (!flat) {
1976
+ container.css("position", "absolute");
1977
+ container.offset(getOffset(container, offsetElement));
1978
+ }
1979
+
1980
+ updateHelperLocations();
1981
+
1982
+ if (opts.showPalette) {
1983
+ drawPalette();
1984
+ }
1985
+
1986
+ boundElement.trigger('reflow.spectrum');
1987
+ }
1988
+
1989
+ function destroy() {
1990
+ boundElement.show();
1991
+ offsetElement.unbind("click.spectrum touchstart.spectrum");
1992
+ container.remove();
1993
+ replacer.remove();
1994
+ spectrums[spect.id] = null;
1995
+ }
1996
+
1997
+ function option(optionName, optionValue) {
1998
+ if (optionName === undefined) {
1999
+ return $.extend({}, opts);
2000
+ }
2001
+ if (optionValue === undefined) {
2002
+ return opts[optionName];
2003
+ }
2004
+
2005
+ opts[optionName] = optionValue;
2006
+ applyOptions();
2007
+ }
2008
+
2009
+ function enable() {
2010
+ disabled = false;
2011
+ boundElement.attr("disabled", false);
2012
+ offsetElement.removeClass("sp-disabled");
2013
+ }
2014
+
2015
+ function disable() {
2016
+ hide();
2017
+ disabled = true;
2018
+ boundElement.attr("disabled", true);
2019
+ offsetElement.addClass("sp-disabled");
2020
+ }
2021
+
2022
+ initialize();
2023
+
2024
+ var spect = {
2025
+ show: show,
2026
+ hide: hide,
2027
+ toggle: toggle,
2028
+ reflow: reflow,
2029
+ option: option,
2030
+ enable: enable,
2031
+ disable: disable,
2032
+ set: function (c) {
2033
+ set(c);
2034
+ updateOriginalInput();
2035
+ },
2036
+ get: get,
2037
+ destroy: destroy,
2038
+ container: container
2039
+ };
2040
+
2041
+ spect.id = spectrums.push(spect) - 1;
2042
+
2043
+ return spect;
2044
+ }
2045
+
2046
+ /**
2047
+ * checkOffset - get the offset below/above and left/right element depending on screen position
2048
+ * Thanks https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.datepicker.js
2049
+ */
2050
+ function getOffset(picker, input) {
2051
+ var extraY = 0;
2052
+ var dpWidth = picker.outerWidth();
2053
+ var dpHeight = picker.outerHeight();
2054
+ var inputHeight = input.outerHeight();
2055
+ var doc = picker[0].ownerDocument;
2056
+ var docElem = doc.documentElement;
2057
+ var viewWidth = docElem.clientWidth + $(doc).scrollLeft();
2058
+ var viewHeight = docElem.clientHeight + $(doc).scrollTop();
2059
+ var offset = input.offset();
2060
+ offset.top += inputHeight;
2061
+
2062
+ offset.left -=
2063
+ Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
2064
+ Math.abs(offset.left + dpWidth - viewWidth) : 0);
2065
+
2066
+ offset.top -=
2067
+ Math.min(offset.top, ((offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
2068
+ Math.abs(dpHeight + inputHeight - extraY) : extraY));
2069
+
2070
+ return offset;
2071
+ }
2072
+
2073
+ /**
2074
+ * noop - do nothing
2075
+ */
2076
+ function noop() {
2077
+
2078
+ }
2079
+
2080
+ /**
2081
+ * stopPropagation - makes the code only doing this a little easier to read in line
2082
+ */
2083
+ function stopPropagation(e) {
2084
+ e.stopPropagation();
2085
+ }
2086
+
2087
+ /**
2088
+ * Create a function bound to a given object
2089
+ * Thanks to underscore.js
2090
+ */
2091
+ function bind(func, obj) {
2092
+ var slice = Array.prototype.slice;
2093
+ var args = slice.call(arguments, 2);
2094
+ return function () {
2095
+ return func.apply(obj, args.concat(slice.call(arguments)));
2096
+ };
2097
+ }
2098
+
2099
+ /**
2100
+ * Lightweight drag helper. Handles containment within the element, so that
2101
+ * when dragging, the x is within [0,element.width] and y is within [0,element.height]
2102
+ */
2103
+ function draggable(element, onmove, onstart, onstop) {
2104
+ onmove = onmove || function () { };
2105
+ onstart = onstart || function () { };
2106
+ onstop = onstop || function () { };
2107
+ var doc = element.ownerDocument || document;
2108
+ var dragging = false;
2109
+ var offset = {};
2110
+ var maxHeight = 0;
2111
+ var maxWidth = 0;
2112
+ var hasTouch = ('ontouchstart' in window);
2113
+
2114
+ var duringDragEvents = {};
2115
+ duringDragEvents["selectstart"] = prevent;
2116
+ duringDragEvents["dragstart"] = prevent;
2117
+ duringDragEvents["touchmove mousemove"] = move;
2118
+ duringDragEvents["touchend mouseup"] = stop;
2119
+
2120
+ function prevent(e) {
2121
+ if (e.stopPropagation) {
2122
+ e.stopPropagation();
2123
+ }
2124
+ if (e.preventDefault) {
2125
+ e.preventDefault();
2126
+ }
2127
+ e.returnValue = false;
2128
+ }
2129
+
2130
+ function move(e) {
2131
+ if (dragging) {
2132
+ // Mouseup happened outside of window
2133
+ if (IE && document.documentMode < 9 && !e.button) {
2134
+ return stop();
2135
+ }
2136
+
2137
+ var touches = e.originalEvent.touches;
2138
+ var pageX = touches ? touches[0].pageX : e.pageX;
2139
+ var pageY = touches ? touches[0].pageY : e.pageY;
2140
+
2141
+ var dragX = Math.max(0, Math.min(pageX - offset.left, maxWidth));
2142
+ var dragY = Math.max(0, Math.min(pageY - offset.top, maxHeight));
2143
+
2144
+ if (hasTouch) {
2145
+ // Stop scrolling in iOS
2146
+ prevent(e);
2147
+ }
2148
+
2149
+ onmove.apply(element, [dragX, dragY, e]);
2150
+ }
2151
+ }
2152
+
2153
+ function start(e) {
2154
+ var rightclick = (e.which) ? (e.which == 3) : (e.button == 2);
2155
+ var touches = e.originalEvent.touches;
2156
+
2157
+ if (!rightclick && !dragging) {
2158
+ if (onstart.apply(element, arguments) !== false) {
2159
+ dragging = true;
2160
+ maxHeight = $(element).height();
2161
+ maxWidth = $(element).width();
2162
+ offset = $(element).offset();
2163
+
2164
+ $(doc).bind(duringDragEvents);
2165
+ $(doc.body).addClass("sp-dragging");
2166
+
2167
+ if (!hasTouch) {
2168
+ move(e);
2169
+ }
2170
+
2171
+ prevent(e);
2172
+ }
2173
+ }
2174
+ }
2175
+
2176
+ function stop() {
2177
+ if (dragging) {
2178
+ $(doc).unbind(duringDragEvents);
2179
+ $(doc.body).removeClass("sp-dragging");
2180
+ onstop.apply(element, arguments);
2181
+ }
2182
+ dragging = false;
2183
+ }
2184
+
2185
+ $(element).bind("touchstart mousedown", start);
2186
+ }
2187
+
2188
+ function throttle(func, wait, debounce) {
2189
+ var timeout;
2190
+ return function () {
2191
+ var context = this, args = arguments;
2192
+ var throttler = function () {
2193
+ timeout = null;
2194
+ func.apply(context, args);
2195
+ };
2196
+ if (debounce) clearTimeout(timeout);
2197
+ if (debounce || !timeout) timeout = setTimeout(throttler, wait);
2198
+ };
2199
+ }
2200
+
2201
+ function log(){/* jshint -W021 */if(window.console){if(Function.prototype.bind)log=Function.prototype.bind.call(console.log,console);else log=function(){Function.prototype.apply.call(console.log,console,arguments);};log.apply(this,arguments);}}
2202
+
2203
+ /**
2204
+ * Define a jQuery plugin
2205
+ */
2206
+ var dataID = "spectrum.id";
2207
+ $.fn.spectrum = function (opts, extra) {
2208
+
2209
+ if (typeof opts == "string") {
2210
+
2211
+ var returnValue = this;
2212
+ var args = Array.prototype.slice.call( arguments, 1 );
2213
+
2214
+ this.each(function () {
2215
+ var spect = spectrums[$(this).data(dataID)];
2216
+ if (spect) {
2217
+ var method = spect[opts];
2218
+ if (!method) {
2219
+ throw new Error( "Spectrum: no such method: '" + opts + "'" );
2220
+ }
2221
+
2222
+ if (opts == "get") {
2223
+ returnValue = spect.get();
2224
+ }
2225
+ else if (opts == "container") {
2226
+ returnValue = spect.container;
2227
+ }
2228
+ else if (opts == "option") {
2229
+ returnValue = spect.option.apply(spect, args);
2230
+ }
2231
+ else if (opts == "destroy") {
2232
+ spect.destroy();
2233
+ $(this).removeData(dataID);
2234
+ }
2235
+ else {
2236
+ method.apply(spect, args);
2237
+ }
2238
+ }
2239
+ });
2240
+
2241
+ return returnValue;
2242
+ }
2243
+
2244
+ // Initializing a new instance of spectrum
2245
+ return this.spectrum("destroy").each(function () {
2246
+ var options = $.extend({}, opts, $(this).data());
2247
+ var spect = spectrum(this, options);
2248
+ $(this).data(dataID, spect.id);
2249
+ });
2250
+ };
2251
+
2252
+ $.fn.spectrum.load = true;
2253
+ $.fn.spectrum.loadOpts = {};
2254
+ $.fn.spectrum.draggable = draggable;
2255
+ $.fn.spectrum.defaults = defaultOpts;
2256
+
2257
+ $.spectrum = { };
2258
+ $.spectrum.localization = { };
2259
+ $.spectrum.palettes = { };
2260
+
2261
+ $.fn.spectrum.processNativeColorInputs = function () {
2262
+ if (!inputTypeColorSupport) {
2263
+ $("input[type=color]").spectrum({
2264
+ preferredFormat: "hex6"
2265
+ });
2266
+ }
2267
+ };
2268
+
2269
+ // TinyColor v0.9.17
2270
+ // https://github.com/bgrins/TinyColor
2271
+ // 2013-08-10, Brian Grinstead, MIT License
2272
+
2273
+ (function() {
2274
+
2275
+ var trimLeft = /^[\s,#]+/,
2276
+ trimRight = /\s+$/,
2277
+ tinyCounter = 0,
2278
+ math = Math,
2279
+ mathRound = math.round,
2280
+ mathMin = math.min,
2281
+ mathMax = math.max,
2282
+ mathRandom = math.random;
2283
+
2284
+ function tinycolor (color, opts) {
2285
+
2286
+ color = (color) ? color : '';
2287
+ opts = opts || { };
2288
+
2289
+ // If input is already a tinycolor, return itself
2290
+ if (typeof color == "object" && color.hasOwnProperty("_tc_id")) {
2291
+ return color;
2292
+ }
2293
+
2294
+ var rgb = inputToRGB(color);
2295
+ var r = rgb.r,
2296
+ g = rgb.g,
2297
+ b = rgb.b,
2298
+ a = rgb.a,
2299
+ roundA = mathRound(100*a) / 100,
2300
+ format = opts.format || rgb.format;
2301
+
2302
+ // Don't let the range of [0,255] come back in [0,1].
2303
+ // Potentially lose a little bit of precision here, but will fix issues where
2304
+ // .5 gets interpreted as half of the total, instead of half of 1
2305
+ // If it was supposed to be 128, this was already taken care of by `inputToRgb`
2306
+ if (r < 1) { r = mathRound(r); }
2307
+ if (g < 1) { g = mathRound(g); }
2308
+ if (b < 1) { b = mathRound(b); }
2309
+
2310
+ return {
2311
+ ok: rgb.ok,
2312
+ format: format,
2313
+ _tc_id: tinyCounter++,
2314
+ alpha: a,
2315
+ getAlpha: function() {
2316
+ return a;
2317
+ },
2318
+ setAlpha: function(value) {
2319
+ a = boundAlpha(value);
2320
+ roundA = mathRound(100*a) / 100;
2321
+ },
2322
+ toHsv: function() {
2323
+ var hsv = rgbToHsv(r, g, b);
2324
+ return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: a };
2325
+ },
2326
+ toHsvString: function() {
2327
+ var hsv = rgbToHsv(r, g, b);
2328
+ var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);
2329
+ return (a == 1) ?
2330
+ "hsv(" + h + ", " + s + "%, " + v + "%)" :
2331
+ "hsva(" + h + ", " + s + "%, " + v + "%, "+ roundA + ")";
2332
+ },
2333
+ toHsl: function() {
2334
+ var hsl = rgbToHsl(r, g, b);
2335
+ return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: a };
2336
+ },
2337
+ toHslString: function() {
2338
+ var hsl = rgbToHsl(r, g, b);
2339
+ var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);
2340
+ return (a == 1) ?
2341
+ "hsl(" + h + ", " + s + "%, " + l + "%)" :
2342
+ "hsla(" + h + ", " + s + "%, " + l + "%, "+ roundA + ")";
2343
+ },
2344
+ toHex: function(allow3Char) {
2345
+ return rgbToHex(r, g, b, allow3Char);
2346
+ },
2347
+ toHexString: function(allow3Char) {
2348
+ return '#' + this.toHex(allow3Char);
2349
+ },
2350
+ toHex8: function() {
2351
+ return rgbaToHex(r, g, b, a);
2352
+ },
2353
+ toHex8String: function() {
2354
+ return '#' + this.toHex8();
2355
+ },
2356
+ toRgb: function() {
2357
+ return { r: mathRound(r), g: mathRound(g), b: mathRound(b), a: a };
2358
+ },
2359
+ toRgbString: function() {
2360
+ return (a == 1) ?
2361
+ "rgb(" + mathRound(r) + ", " + mathRound(g) + ", " + mathRound(b) + ")" :
2362
+ "rgba(" + mathRound(r) + ", " + mathRound(g) + ", " + mathRound(b) + ", " + roundA + ")";
2363
+ },
2364
+ toPercentageRgb: function() {
2365
+ return { r: mathRound(bound01(r, 255) * 100) + "%", g: mathRound(bound01(g, 255) * 100) + "%", b: mathRound(bound01(b, 255) * 100) + "%", a: a };
2366
+ },
2367
+ toPercentageRgbString: function() {
2368
+ return (a == 1) ?
2369
+ "rgb(" + mathRound(bound01(r, 255) * 100) + "%, " + mathRound(bound01(g, 255) * 100) + "%, " + mathRound(bound01(b, 255) * 100) + "%)" :
2370
+ "rgba(" + mathRound(bound01(r, 255) * 100) + "%, " + mathRound(bound01(g, 255) * 100) + "%, " + mathRound(bound01(b, 255) * 100) + "%, " + roundA + ")";
2371
+ },
2372
+ toName: function() {
2373
+ if (a === 0) {
2374
+ return "transparent";
2375
+ }
2376
+
2377
+ return hexNames[rgbToHex(r, g, b, true)] || false;
2378
+ },
2379
+ toFilter: function(secondColor) {
2380
+ var hex8String = '#' + rgbaToHex(r, g, b, a);
2381
+ var secondHex8String = hex8String;
2382
+ var gradientType = opts && opts.gradientType ? "GradientType = 1, " : "";
2383
+
2384
+ if (secondColor) {
2385
+ var s = tinycolor(secondColor);
2386
+ secondHex8String = s.toHex8String();
2387
+ }
2388
+
2389
+ return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")";
2390
+ },
2391
+ toString: function(format) {
2392
+ var formatSet = !!format;
2393
+ format = format || this.format;
2394
+
2395
+ var formattedString = false;
2396
+ var hasAlphaAndFormatNotSet = !formatSet && a < 1 && a > 0;
2397
+ var formatWithAlpha = hasAlphaAndFormatNotSet && (format === "hex" || format === "hex6" || format === "hex3" || format === "name");
2398
+
2399
+ if (format === "rgb") {
2400
+ formattedString = this.toRgbString();
2401
+ }
2402
+ if (format === "prgb") {
2403
+ formattedString = this.toPercentageRgbString();
2404
+ }
2405
+ if (format === "hex" || format === "hex6") {
2406
+ formattedString = this.toHexString();
2407
+ }
2408
+ if (format === "hex3") {
2409
+ formattedString = this.toHexString(true);
2410
+ }
2411
+ if (format === "hex8") {
2412
+ formattedString = this.toHex8String();
2413
+ }
2414
+ if (format === "name") {
2415
+ formattedString = this.toName();
2416
+ }
2417
+ if (format === "hsl") {
2418
+ formattedString = this.toHslString();
2419
+ }
2420
+ if (format === "hsv") {
2421
+ formattedString = this.toHsvString();
2422
+ }
2423
+
2424
+ if (formatWithAlpha) {
2425
+ return this.toRgbString();
2426
+ }
2427
+
2428
+ return formattedString || this.toHexString();
2429
+ }
2430
+ };
2431
+ }
2432
+
2433
+ // If input is an object, force 1 into "1.0" to handle ratios properly
2434
+ // String input requires "1.0" as input, so 1 will be treated as 1
2435
+ tinycolor.fromRatio = function(color, opts) {
2436
+ if (typeof color == "object") {
2437
+ var newColor = {};
2438
+ for (var i in color) {
2439
+ if (color.hasOwnProperty(i)) {
2440
+ if (i === "a") {
2441
+ newColor[i] = color[i];
2442
+ }
2443
+ else {
2444
+ newColor[i] = convertToPercentage(color[i]);
2445
+ }
2446
+ }
2447
+ }
2448
+ color = newColor;
2449
+ }
2450
+
2451
+ return tinycolor(color, opts);
2452
+ };
2453
+
2454
+ // Given a string or object, convert that input to RGB
2455
+ // Possible string inputs:
2456
+ //
2457
+ // "red"
2458
+ // "#f00" or "f00"
2459
+ // "#ff0000" or "ff0000"
2460
+ // "#ff000000" or "ff000000"
2461
+ // "rgb 255 0 0" or "rgb (255, 0, 0)"
2462
+ // "rgb 1.0 0 0" or "rgb (1, 0, 0)"
2463
+ // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
2464
+ // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
2465
+ // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
2466
+ // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
2467
+ // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
2468
+ //
2469
+ function inputToRGB(color) {
2470
+
2471
+ var rgb = { r: 0, g: 0, b: 0 };
2472
+ var a = 1;
2473
+ var ok = false;
2474
+ var format = false;
2475
+
2476
+ if (typeof color == "string") {
2477
+ color = stringInputToObject(color);
2478
+ }
2479
+
2480
+ if (typeof color == "object") {
2481
+ if (color.hasOwnProperty("r") && color.hasOwnProperty("g") && color.hasOwnProperty("b")) {
2482
+ rgb = rgbToRgb(color.r, color.g, color.b);
2483
+ ok = true;
2484
+ format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
2485
+ }
2486
+ else if (color.hasOwnProperty("h") && color.hasOwnProperty("s") && color.hasOwnProperty("v")) {
2487
+ color.s = convertToPercentage(color.s);
2488
+ color.v = convertToPercentage(color.v);
2489
+ rgb = hsvToRgb(color.h, color.s, color.v);
2490
+ ok = true;
2491
+ format = "hsv";
2492
+ }
2493
+ else if (color.hasOwnProperty("h") && color.hasOwnProperty("s") && color.hasOwnProperty("l")) {
2494
+ color.s = convertToPercentage(color.s);
2495
+ color.l = convertToPercentage(color.l);
2496
+ rgb = hslToRgb(color.h, color.s, color.l);
2497
+ ok = true;
2498
+ format = "hsl";
2499
+ }
2500
+
2501
+ if (color.hasOwnProperty("a")) {
2502
+ a = color.a;
2503
+ }
2504
+ }
2505
+
2506
+ a = boundAlpha(a);
2507
+
2508
+ return {
2509
+ ok: ok,
2510
+ format: color.format || format,
2511
+ r: mathMin(255, mathMax(rgb.r, 0)),
2512
+ g: mathMin(255, mathMax(rgb.g, 0)),
2513
+ b: mathMin(255, mathMax(rgb.b, 0)),
2514
+ a: a
2515
+ };
2516
+ }
2517
+
2518
+
2519
+ // Conversion Functions
2520
+ // --------------------
2521
+
2522
+ // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
2523
+ // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
2524
+
2525
+ // `rgbToRgb`
2526
+ // Handle bounds / percentage checking to conform to CSS color spec
2527
+ // <http://www.w3.org/TR/css3-color/>
2528
+ // *Assumes:* r, g, b in [0, 255] or [0, 1]
2529
+ // *Returns:* { r, g, b } in [0, 255]
2530
+ function rgbToRgb(r, g, b){
2531
+ return {
2532
+ r: bound01(r, 255) * 255,
2533
+ g: bound01(g, 255) * 255,
2534
+ b: bound01(b, 255) * 255
2535
+ };
2536
+ }
2537
+
2538
+ // `rgbToHsl`
2539
+ // Converts an RGB color value to HSL.
2540
+ // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
2541
+ // *Returns:* { h, s, l } in [0,1]
2542
+ function rgbToHsl(r, g, b) {
2543
+
2544
+ r = bound01(r, 255);
2545
+ g = bound01(g, 255);
2546
+ b = bound01(b, 255);
2547
+
2548
+ var max = mathMax(r, g, b), min = mathMin(r, g, b);
2549
+ var h, s, l = (max + min) / 2;
2550
+
2551
+ if(max == min) {
2552
+ h = s = 0; // achromatic
2553
+ }
2554
+ else {
2555
+ var d = max - min;
2556
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
2557
+ switch(max) {
2558
+ case r: h = (g - b) / d + (g < b ? 6 : 0); break;
2559
+ case g: h = (b - r) / d + 2; break;
2560
+ case b: h = (r - g) / d + 4; break;
2561
+ }
2562
+
2563
+ h /= 6;
2564
+ }
2565
+
2566
+ return { h: h, s: s, l: l };
2567
+ }
2568
+
2569
+ // `hslToRgb`
2570
+ // Converts an HSL color value to RGB.
2571
+ // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
2572
+ // *Returns:* { r, g, b } in the set [0, 255]
2573
+ function hslToRgb(h, s, l) {
2574
+ var r, g, b;
2575
+
2576
+ h = bound01(h, 360);
2577
+ s = bound01(s, 100);
2578
+ l = bound01(l, 100);
2579
+
2580
+ function hue2rgb(p, q, t) {
2581
+ if(t < 0) t += 1;
2582
+ if(t > 1) t -= 1;
2583
+ if(t < 1/6) return p + (q - p) * 6 * t;
2584
+ if(t < 1/2) return q;
2585
+ if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
2586
+ return p;
2587
+ }
2588
+
2589
+ if(s === 0) {
2590
+ r = g = b = l; // achromatic
2591
+ }
2592
+ else {
2593
+ var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
2594
+ var p = 2 * l - q;
2595
+ r = hue2rgb(p, q, h + 1/3);
2596
+ g = hue2rgb(p, q, h);
2597
+ b = hue2rgb(p, q, h - 1/3);
2598
+ }
2599
+
2600
+ return { r: r * 255, g: g * 255, b: b * 255 };
2601
+ }
2602
+
2603
+ // `rgbToHsv`
2604
+ // Converts an RGB color value to HSV
2605
+ // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
2606
+ // *Returns:* { h, s, v } in [0,1]
2607
+ function rgbToHsv(r, g, b) {
2608
+
2609
+ r = bound01(r, 255);
2610
+ g = bound01(g, 255);
2611
+ b = bound01(b, 255);
2612
+
2613
+ var max = mathMax(r, g, b), min = mathMin(r, g, b);
2614
+ var h, s, v = max;
2615
+
2616
+ var d = max - min;
2617
+ s = max === 0 ? 0 : d / max;
2618
+
2619
+ if(max == min) {
2620
+ h = 0; // achromatic
2621
+ }
2622
+ else {
2623
+ switch(max) {
2624
+ case r: h = (g - b) / d + (g < b ? 6 : 0); break;
2625
+ case g: h = (b - r) / d + 2; break;
2626
+ case b: h = (r - g) / d + 4; break;
2627
+ }
2628
+ h /= 6;
2629
+ }
2630
+ return { h: h, s: s, v: v };
2631
+ }
2632
+
2633
+ // `hsvToRgb`
2634
+ // Converts an HSV color value to RGB.
2635
+ // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
2636
+ // *Returns:* { r, g, b } in the set [0, 255]
2637
+ function hsvToRgb(h, s, v) {
2638
+
2639
+ h = bound01(h, 360) * 6;
2640
+ s = bound01(s, 100);
2641
+ v = bound01(v, 100);
2642
+
2643
+ var i = math.floor(h),
2644
+ f = h - i,
2645
+ p = v * (1 - s),
2646
+ q = v * (1 - f * s),
2647
+ t = v * (1 - (1 - f) * s),
2648
+ mod = i % 6,
2649
+ r = [v, q, p, p, t, v][mod],
2650
+ g = [t, v, v, q, p, p][mod],
2651
+ b = [p, p, t, v, v, q][mod];
2652
+
2653
+ return { r: r * 255, g: g * 255, b: b * 255 };
2654
+ }
2655
+
2656
+ // `rgbToHex`
2657
+ // Converts an RGB color to hex
2658
+ // Assumes r, g, and b are contained in the set [0, 255]
2659
+ // Returns a 3 or 6 character hex
2660
+ function rgbToHex(r, g, b, allow3Char) {
2661
+
2662
+ var hex = [
2663
+ pad2(mathRound(r).toString(16)),
2664
+ pad2(mathRound(g).toString(16)),
2665
+ pad2(mathRound(b).toString(16))
2666
+ ];
2667
+
2668
+ // Return a 3 character hex if possible
2669
+ if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
2670
+ return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
2671
+ }
2672
+
2673
+ return hex.join("");
2674
+ }
2675
+ // `rgbaToHex`
2676
+ // Converts an RGBA color plus alpha transparency to hex
2677
+ // Assumes r, g, b and a are contained in the set [0, 255]
2678
+ // Returns an 8 character hex
2679
+ function rgbaToHex(r, g, b, a) {
2680
+
2681
+ var hex = [
2682
+ pad2(convertDecimalToHex(a)),
2683
+ pad2(mathRound(r).toString(16)),
2684
+ pad2(mathRound(g).toString(16)),
2685
+ pad2(mathRound(b).toString(16))
2686
+ ];
2687
+
2688
+ return hex.join("");
2689
+ }
2690
+
2691
+ // `equals`
2692
+ // Can be called with any tinycolor input
2693
+ tinycolor.equals = function (color1, color2) {
2694
+ if (!color1 || !color2) { return false; }
2695
+ return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
2696
+ };
2697
+ tinycolor.random = function() {
2698
+ return tinycolor.fromRatio({
2699
+ r: mathRandom(),
2700
+ g: mathRandom(),
2701
+ b: mathRandom()
2702
+ });
2703
+ };
2704
+
2705
+
2706
+ // Modification Functions
2707
+ // ----------------------
2708
+ // Thanks to less.js for some of the basics here
2709
+ // <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
2710
+
2711
+ tinycolor.desaturate = function (color, amount) {
2712
+ amount = (amount === 0) ? 0 : (amount || 10);
2713
+ var hsl = tinycolor(color).toHsl();
2714
+ hsl.s -= amount / 100;
2715
+ hsl.s = clamp01(hsl.s);
2716
+ return tinycolor(hsl);
2717
+ };
2718
+ tinycolor.saturate = function (color, amount) {
2719
+ amount = (amount === 0) ? 0 : (amount || 10);
2720
+ var hsl = tinycolor(color).toHsl();
2721
+ hsl.s += amount / 100;
2722
+ hsl.s = clamp01(hsl.s);
2723
+ return tinycolor(hsl);
2724
+ };
2725
+ tinycolor.greyscale = function(color) {
2726
+ return tinycolor.desaturate(color, 100);
2727
+ };
2728
+ tinycolor.lighten = function(color, amount) {
2729
+ amount = (amount === 0) ? 0 : (amount || 10);
2730
+ var hsl = tinycolor(color).toHsl();
2731
+ hsl.l += amount / 100;
2732
+ hsl.l = clamp01(hsl.l);
2733
+ return tinycolor(hsl);
2734
+ };
2735
+ tinycolor.darken = function (color, amount) {
2736
+ amount = (amount === 0) ? 0 : (amount || 10);
2737
+ var hsl = tinycolor(color).toHsl();
2738
+ hsl.l -= amount / 100;
2739
+ hsl.l = clamp01(hsl.l);
2740
+ return tinycolor(hsl);
2741
+ };
2742
+ tinycolor.complement = function(color) {
2743
+ var hsl = tinycolor(color).toHsl();
2744
+ hsl.h = (hsl.h + 180) % 360;
2745
+ return tinycolor(hsl);
2746
+ };
2747
+
2748
+
2749
+ // Combination Functions
2750
+ // ---------------------
2751
+ // Thanks to jQuery xColor for some of the ideas behind these
2752
+ // <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
2753
+
2754
+ tinycolor.triad = function(color) {
2755
+ var hsl = tinycolor(color).toHsl();
2756
+ var h = hsl.h;
2757
+ return [
2758
+ tinycolor(color),
2759
+ tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),
2760
+ tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })
2761
+ ];
2762
+ };
2763
+ tinycolor.tetrad = function(color) {
2764
+ var hsl = tinycolor(color).toHsl();
2765
+ var h = hsl.h;
2766
+ return [
2767
+ tinycolor(color),
2768
+ tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),
2769
+ tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),
2770
+ tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })
2771
+ ];
2772
+ };
2773
+ tinycolor.splitcomplement = function(color) {
2774
+ var hsl = tinycolor(color).toHsl();
2775
+ var h = hsl.h;
2776
+ return [
2777
+ tinycolor(color),
2778
+ tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),
2779
+ tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})
2780
+ ];
2781
+ };
2782
+ tinycolor.analogous = function(color, results, slices) {
2783
+ results = results || 6;
2784
+ slices = slices || 30;
2785
+
2786
+ var hsl = tinycolor(color).toHsl();
2787
+ var part = 360 / slices;
2788
+ var ret = [tinycolor(color)];
2789
+
2790
+ for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {
2791
+ hsl.h = (hsl.h + part) % 360;
2792
+ ret.push(tinycolor(hsl));
2793
+ }
2794
+ return ret;
2795
+ };
2796
+ tinycolor.monochromatic = function(color, results) {
2797
+ results = results || 6;
2798
+ var hsv = tinycolor(color).toHsv();
2799
+ var h = hsv.h, s = hsv.s, v = hsv.v;
2800
+ var ret = [];
2801
+ var modification = 1 / results;
2802
+
2803
+ while (results--) {
2804
+ ret.push(tinycolor({ h: h, s: s, v: v}));
2805
+ v = (v + modification) % 1;
2806
+ }
2807
+
2808
+ return ret;
2809
+ };
2810
+
2811
+
2812
+ // Readability Functions
2813
+ // ---------------------
2814
+ // <http://www.w3.org/TR/AERT#color-contrast>
2815
+
2816
+ // `readability`
2817
+ // Analyze the 2 colors and returns an object with the following properties:
2818
+ // `brightness`: difference in brightness between the two colors
2819
+ // `color`: difference in color/hue between the two colors
2820
+ tinycolor.readability = function(color1, color2) {
2821
+ var a = tinycolor(color1).toRgb();
2822
+ var b = tinycolor(color2).toRgb();
2823
+ var brightnessA = (a.r * 299 + a.g * 587 + a.b * 114) / 1000;
2824
+ var brightnessB = (b.r * 299 + b.g * 587 + b.b * 114) / 1000;
2825
+ var colorDiff = (
2826
+ Math.max(a.r, b.r) - Math.min(a.r, b.r) +
2827
+ Math.max(a.g, b.g) - Math.min(a.g, b.g) +
2828
+ Math.max(a.b, b.b) - Math.min(a.b, b.b)
2829
+ );
2830
+
2831
+ return {
2832
+ brightness: Math.abs(brightnessA - brightnessB),
2833
+ color: colorDiff
2834
+ };
2835
+ };
2836
+
2837
+ // `readable`
2838
+ // http://www.w3.org/TR/AERT#color-contrast
2839
+ // Ensure that foreground and background color combinations provide sufficient contrast.
2840
+ // *Example*
2841
+ // tinycolor.readable("#000", "#111") => false
2842
+ tinycolor.readable = function(color1, color2) {
2843
+ var readability = tinycolor.readability(color1, color2);
2844
+ return readability.brightness > 125 && readability.color > 500;
2845
+ };
2846
+
2847
+ // `mostReadable`
2848
+ // Given a base color and a list of possible foreground or background
2849
+ // colors for that base, returns the most readable color.
2850
+ // *Example*
2851
+ // tinycolor.mostReadable("#123", ["#fff", "#000"]) => "#000"
2852
+ tinycolor.mostReadable = function(baseColor, colorList) {
2853
+ var bestColor = null;
2854
+ var bestScore = 0;
2855
+ var bestIsReadable = false;
2856
+ for (var i=0; i < colorList.length; i++) {
2857
+
2858
+ // We normalize both around the "acceptable" breaking point,
2859
+ // but rank brightness constrast higher than hue.
2860
+
2861
+ var readability = tinycolor.readability(baseColor, colorList[i]);
2862
+ var readable = readability.brightness > 125 && readability.color > 500;
2863
+ var score = 3 * (readability.brightness / 125) + (readability.color / 500);
2864
+
2865
+ if ((readable && ! bestIsReadable) ||
2866
+ (readable && bestIsReadable && score > bestScore) ||
2867
+ ((! readable) && (! bestIsReadable) && score > bestScore)) {
2868
+ bestIsReadable = readable;
2869
+ bestScore = score;
2870
+ bestColor = tinycolor(colorList[i]);
2871
+ }
2872
+ }
2873
+ return bestColor;
2874
+ };
2875
+
2876
+
2877
+ // Big List of Colors
2878
+ // ------------------
2879
+ // <http://www.w3.org/TR/css3-color/#svg-color>
2880
+ var names = tinycolor.names = {
2881
+ aliceblue: "f0f8ff",
2882
+ antiquewhite: "faebd7",
2883
+ aqua: "0ff",
2884
+ aquamarine: "7fffd4",
2885
+ azure: "f0ffff",
2886
+ beige: "f5f5dc",
2887
+ bisque: "ffe4c4",
2888
+ black: "000",
2889
+ blanchedalmond: "ffebcd",
2890
+ blue: "00f",
2891
+ blueviolet: "8a2be2",
2892
+ brown: "a52a2a",
2893
+ burlywood: "deb887",
2894
+ burntsienna: "ea7e5d",
2895
+ cadetblue: "5f9ea0",
2896
+ chartreuse: "7fff00",
2897
+ chocolate: "d2691e",
2898
+ coral: "ff7f50",
2899
+ cornflowerblue: "6495ed",
2900
+ cornsilk: "fff8dc",
2901
+ crimson: "dc143c",
2902
+ cyan: "0ff",
2903
+ darkblue: "00008b",
2904
+ darkcyan: "008b8b",
2905
+ darkgoldenrod: "b8860b",
2906
+ darkgray: "a9a9a9",
2907
+ darkgreen: "006400",
2908
+ darkgrey: "a9a9a9",
2909
+ darkkhaki: "bdb76b",
2910
+ darkmagenta: "8b008b",
2911
+ darkolivegreen: "556b2f",
2912
+ darkorange: "ff8c00",
2913
+ darkorchid: "9932cc",
2914
+ darkred: "8b0000",
2915
+ darksalmon: "e9967a",
2916
+ darkseagreen: "8fbc8f",
2917
+ darkslateblue: "483d8b",
2918
+ darkslategray: "2f4f4f",
2919
+ darkslategrey: "2f4f4f",
2920
+ darkturquoise: "00ced1",
2921
+ darkviolet: "9400d3",
2922
+ deeppink: "ff1493",
2923
+ deepskyblue: "00bfff",
2924
+ dimgray: "696969",
2925
+ dimgrey: "696969",
2926
+ dodgerblue: "1e90ff",
2927
+ firebrick: "b22222",
2928
+ floralwhite: "fffaf0",
2929
+ forestgreen: "228b22",
2930
+ fuchsia: "f0f",
2931
+ gainsboro: "dcdcdc",
2932
+ ghostwhite: "f8f8ff",
2933
+ gold: "ffd700",
2934
+ goldenrod: "daa520",
2935
+ gray: "808080",
2936
+ green: "008000",
2937
+ greenyellow: "adff2f",
2938
+ grey: "808080",
2939
+ honeydew: "f0fff0",
2940
+ hotpink: "ff69b4",
2941
+ indianred: "cd5c5c",
2942
+ indigo: "4b0082",
2943
+ ivory: "fffff0",
2944
+ khaki: "f0e68c",
2945
+ lavender: "e6e6fa",
2946
+ lavenderblush: "fff0f5",
2947
+ lawngreen: "7cfc00",
2948
+ lemonchiffon: "fffacd",
2949
+ lightblue: "add8e6",
2950
+ lightcoral: "f08080",
2951
+ lightcyan: "e0ffff",
2952
+ lightgoldenrodyellow: "fafad2",
2953
+ lightgray: "d3d3d3",
2954
+ lightgreen: "90ee90",
2955
+ lightgrey: "d3d3d3",
2956
+ lightpink: "ffb6c1",
2957
+ lightsalmon: "ffa07a",
2958
+ lightseagreen: "20b2aa",
2959
+ lightskyblue: "87cefa",
2960
+ lightslategray: "789",
2961
+ lightslategrey: "789",
2962
+ lightsteelblue: "b0c4de",
2963
+ lightyellow: "ffffe0",
2964
+ lime: "0f0",
2965
+ limegreen: "32cd32",
2966
+ linen: "faf0e6",
2967
+ magenta: "f0f",
2968
+ maroon: "800000",
2969
+ mediumaquamarine: "66cdaa",
2970
+ mediumblue: "0000cd",
2971
+ mediumorchid: "ba55d3",
2972
+ mediumpurple: "9370db",
2973
+ mediumseagreen: "3cb371",
2974
+ mediumslateblue: "7b68ee",
2975
+ mediumspringgreen: "00fa9a",
2976
+ mediumturquoise: "48d1cc",
2977
+ mediumvioletred: "c71585",
2978
+ midnightblue: "191970",
2979
+ mintcream: "f5fffa",
2980
+ mistyrose: "ffe4e1",
2981
+ moccasin: "ffe4b5",
2982
+ navajowhite: "ffdead",
2983
+ navy: "000080",
2984
+ oldlace: "fdf5e6",
2985
+ olive: "808000",
2986
+ olivedrab: "6b8e23",
2987
+ orange: "ffa500",
2988
+ orangered: "ff4500",
2989
+ orchid: "da70d6",
2990
+ palegoldenrod: "eee8aa",
2991
+ palegreen: "98fb98",
2992
+ paleturquoise: "afeeee",
2993
+ palevioletred: "db7093",
2994
+ papayawhip: "ffefd5",
2995
+ peachpuff: "ffdab9",
2996
+ peru: "cd853f",
2997
+ pink: "ffc0cb",
2998
+ plum: "dda0dd",
2999
+ powderblue: "b0e0e6",
3000
+ purple: "800080",
3001
+ red: "f00",
3002
+ rosybrown: "bc8f8f",
3003
+ royalblue: "4169e1",
3004
+ saddlebrown: "8b4513",
3005
+ salmon: "fa8072",
3006
+ sandybrown: "f4a460",
3007
+ seagreen: "2e8b57",
3008
+ seashell: "fff5ee",
3009
+ sienna: "a0522d",
3010
+ silver: "c0c0c0",
3011
+ skyblue: "87ceeb",
3012
+ slateblue: "6a5acd",
3013
+ slategray: "708090",
3014
+ slategrey: "708090",
3015
+ snow: "fffafa",
3016
+ springgreen: "00ff7f",
3017
+ steelblue: "4682b4",
3018
+ tan: "d2b48c",
3019
+ teal: "008080",
3020
+ thistle: "d8bfd8",
3021
+ tomato: "ff6347",
3022
+ turquoise: "40e0d0",
3023
+ violet: "ee82ee",
3024
+ wheat: "f5deb3",
3025
+ white: "fff",
3026
+ whitesmoke: "f5f5f5",
3027
+ yellow: "ff0",
3028
+ yellowgreen: "9acd32"
3029
+ };
3030
+
3031
+ // Make it easy to access colors via `hexNames[hex]`
3032
+ var hexNames = tinycolor.hexNames = flip(names);
3033
+
3034
+
3035
+ // Utilities
3036
+ // ---------
3037
+
3038
+ // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
3039
+ function flip(o) {
3040
+ var flipped = { };
3041
+ for (var i in o) {
3042
+ if (o.hasOwnProperty(i)) {
3043
+ flipped[o[i]] = i;
3044
+ }
3045
+ }
3046
+ return flipped;
3047
+ }
3048
+
3049
+ // Return a valid alpha value [0,1] with all invalid values being set to 1
3050
+ function boundAlpha(a) {
3051
+ a = parseFloat(a);
3052
+
3053
+ if (isNaN(a) || a < 0 || a > 1) {
3054
+ a = 1;
3055
+ }
3056
+
3057
+ return a;
3058
+ }
3059
+
3060
+ // Take input from [0, n] and return it as [0, 1]
3061
+ function bound01(n, max) {
3062
+ if (isOnePointZero(n)) { n = "100%"; }
3063
+
3064
+ var processPercent = isPercentage(n);
3065
+ n = mathMin(max, mathMax(0, parseFloat(n)));
3066
+
3067
+ // Automatically convert percentage into number
3068
+ if (processPercent) {
3069
+ n = parseInt(n * max, 10) / 100;
3070
+ }
3071
+
3072
+ // Handle floating point rounding errors
3073
+ if ((math.abs(n - max) < 0.000001)) {
3074
+ return 1;
3075
+ }
3076
+
3077
+ // Convert into [0, 1] range if it isn't already
3078
+ return (n % max) / parseFloat(max);
3079
+ }
3080
+
3081
+ // Force a number between 0 and 1
3082
+ function clamp01(val) {
3083
+ return mathMin(1, mathMax(0, val));
3084
+ }
3085
+
3086
+ // Parse a base-16 hex value into a base-10 integer
3087
+ function parseIntFromHex(val) {
3088
+ return parseInt(val, 16);
3089
+ }
3090
+
3091
+ // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
3092
+ // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
3093
+ function isOnePointZero(n) {
3094
+ return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1;
3095
+ }
3096
+
3097
+ // Check to see if string passed in is a percentage
3098
+ function isPercentage(n) {
3099
+ return typeof n === "string" && n.indexOf('%') != -1;
3100
+ }
3101
+
3102
+ // Force a hex value to have 2 characters
3103
+ function pad2(c) {
3104
+ return c.length == 1 ? '0' + c : '' + c;
3105
+ }
3106
+
3107
+ // Replace a decimal with it's percentage value
3108
+ function convertToPercentage(n) {
3109
+ if (n <= 1) {
3110
+ n = (n * 100) + "%";
3111
+ }
3112
+
3113
+ return n;
3114
+ }
3115
+
3116
+ // Converts a decimal to a hex value
3117
+ function convertDecimalToHex(d) {
3118
+ return Math.round(parseFloat(d) * 255).toString(16);
3119
+ }
3120
+ // Converts a hex value to a decimal
3121
+ function convertHexToDecimal(h) {
3122
+ return (parseIntFromHex(h) / 255);
3123
+ }
3124
+
3125
+ var matchers = (function() {
3126
+
3127
+ // <http://www.w3.org/TR/css3-values/#integers>
3128
+ var CSS_INTEGER = "[-\\+]?\\d+%?";
3129
+
3130
+ // <http://www.w3.org/TR/css3-values/#number-value>
3131
+ var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
3132
+
3133
+ // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
3134
+ var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
3135
+
3136
+ // Actual matching.
3137
+ // Parentheses and commas are optional, but not required.
3138
+ // Whitespace can take the place of commas or opening paren
3139
+ var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
3140
+ var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
3141
+
3142
+ return {
3143
+ rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
3144
+ rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
3145
+ hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
3146
+ hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
3147
+ hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
3148
+ hex3: /^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
3149
+ hex6: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
3150
+ hex8: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
3151
+ };
3152
+ })();
3153
+
3154
+ // `stringInputToObject`
3155
+ // Permissive string parsing. Take in a number of formats, and output an object
3156
+ // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
3157
+ function stringInputToObject(color) {
3158
+
3159
+ color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();
3160
+ var named = false;
3161
+ if (names[color]) {
3162
+ color = names[color];
3163
+ named = true;
3164
+ }
3165
+ else if (color == 'transparent') {
3166
+ return { r: 0, g: 0, b: 0, a: 0, format: "name" };
3167
+ }
3168
+
3169
+ // Try to match string input using regular expressions.
3170
+ // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
3171
+ // Just return an object and let the conversion functions handle that.
3172
+ // This way the result will be the same whether the tinycolor is initialized with string or object.
3173
+ var match;
3174
+ if ((match = matchers.rgb.exec(color))) {
3175
+ return { r: match[1], g: match[2], b: match[3] };
3176
+ }
3177
+ if ((match = matchers.rgba.exec(color))) {
3178
+ return { r: match[1], g: match[2], b: match[3], a: match[4] };
3179
+ }
3180
+ if ((match = matchers.hsl.exec(color))) {
3181
+ return { h: match[1], s: match[2], l: match[3] };
3182
+ }
3183
+ if ((match = matchers.hsla.exec(color))) {
3184
+ return { h: match[1], s: match[2], l: match[3], a: match[4] };
3185
+ }
3186
+ if ((match = matchers.hsv.exec(color))) {
3187
+ return { h: match[1], s: match[2], v: match[3] };
3188
+ }
3189
+ if ((match = matchers.hex8.exec(color))) {
3190
+ return {
3191
+ a: convertHexToDecimal(match[1]),
3192
+ r: parseIntFromHex(match[2]),
3193
+ g: parseIntFromHex(match[3]),
3194
+ b: parseIntFromHex(match[4]),
3195
+ format: named ? "name" : "hex8"
3196
+ };
3197
+ }
3198
+ if ((match = matchers.hex6.exec(color))) {
3199
+ return {
3200
+ r: parseIntFromHex(match[1]),
3201
+ g: parseIntFromHex(match[2]),
3202
+ b: parseIntFromHex(match[3]),
3203
+ format: named ? "name" : "hex"
3204
+ };
3205
+ }
3206
+ if ((match = matchers.hex3.exec(color))) {
3207
+ return {
3208
+ r: parseIntFromHex(match[1] + '' + match[1]),
3209
+ g: parseIntFromHex(match[2] + '' + match[2]),
3210
+ b: parseIntFromHex(match[3] + '' + match[3]),
3211
+ format: named ? "name" : "hex"
3212
+ };
3213
+ }
3214
+
3215
+ return false;
3216
+ }
3217
+
3218
+ // Expose tinycolor to window, does not need to run in non-browser context.
3219
+ window.tinycolor = tinycolor;
3220
+
3221
+ })();
3222
+
3223
+
3224
+ $(function () {
3225
+ if ($.fn.spectrum.load) {
3226
+ $.fn.spectrum.processNativeColorInputs();
3227
+ }
3228
+ });
3229
+
3230
+ })(window, jQuery);
3231
+ //js\libs\codemirror\codemirror.js
3232
+
3233
+ /*!
3234
+ * @overview CodeMirror version 3.22
3235
+ * http://codemirror.net/
3236
+ */
3237
+
3238
+ // CodeMirror version 3.22
3239
+ //
3240
+ // CodeMirror is the only global var we claim
3241
+ window.CodeMirror = (function() {
3242
+ "use strict";
3243
+
3244
+ // BROWSER SNIFFING
3245
+
3246
+ // Crude, but necessary to handle a number of hard-to-feature-detect
3247
+ // bugs and behavior differences.
3248
+ var gecko = /gecko\/\d/i.test(navigator.userAgent);
3249
+ // IE11 currently doesn't count as 'ie', since it has almost none of
3250
+ // the same bugs as earlier versions. Use ie_gt10 to handle
3251
+ // incompatibilities in that version.
3252
+ var old_ie = /MSIE \d/.test(navigator.userAgent);
3253
+ var ie_lt8 = old_ie && (document.documentMode == null || document.documentMode < 8);
3254
+ var ie_lt9 = old_ie && (document.documentMode == null || document.documentMode < 9);
3255
+ var ie_lt10 = old_ie && (document.documentMode == null || document.documentMode < 10);
3256
+ var ie_gt10 = /Trident\/([7-9]|\d{2,})\./.test(navigator.userAgent);
3257
+ var ie = old_ie || ie_gt10;
3258
+ var webkit = /WebKit\//.test(navigator.userAgent);
3259
+ var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent);
3260
+ var chrome = /Chrome\//.test(navigator.userAgent);
3261
+ var opera = /Opera\//.test(navigator.userAgent);
3262
+ var safari = /Apple Computer/.test(navigator.vendor);
3263
+ var khtml = /KHTML\//.test(navigator.userAgent);
3264
+ var mac_geLion = /Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent);
3265
+ var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent);
3266
+ var phantom = /PhantomJS/.test(navigator.userAgent);
3267
+
3268
+ var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent);
3269
+ // This is woefully incomplete. Suggestions for alternative methods welcome.
3270
+ var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent);
3271
+ var mac = ios || /Mac/.test(navigator.platform);
3272
+ var windows = /win/i.test(navigator.platform);
3273
+
3274
+ var opera_version = opera && navigator.userAgent.match(/Version\/(\d*\.\d*)/);
3275
+ if (opera_version) opera_version = Number(opera_version[1]);
3276
+ if (opera_version && opera_version >= 15) { opera = false; webkit = true; }
3277
+ // Some browsers use the wrong event properties to signal cmd/ctrl on OS X
3278
+ var flipCtrlCmd = mac && (qtwebkit || opera && (opera_version == null || opera_version < 12.11));
3279
+ var captureMiddleClick = gecko || (ie && !ie_lt9);
3280
+
3281
+ // Optimize some code when these features are not used
3282
+ var sawReadOnlySpans = false, sawCollapsedSpans = false;
3283
+
3284
+ // CONSTRUCTOR
3285
+
3286
+ function CodeMirror(place, options) {
3287
+ if (!(this instanceof CodeMirror)) return new CodeMirror(place, options);
3288
+
3289
+ this.options = options = options || {};
3290
+ // Determine effective options based on given values and defaults.
3291
+ for (var opt in defaults) if (!options.hasOwnProperty(opt) && defaults.hasOwnProperty(opt))
3292
+ options[opt] = defaults[opt];
3293
+ setGuttersForLineNumbers(options);
3294
+
3295
+ var docStart = typeof options.value == "string" ? 0 : options.value.first;
3296
+ var display = this.display = makeDisplay(place, docStart);
3297
+ display.wrapper.CodeMirror = this;
3298
+ updateGutters(this);
3299
+ if (options.autofocus && !mobile) focusInput(this);
3300
+
3301
+ this.state = {keyMaps: [],
3302
+ overlays: [],
3303
+ modeGen: 0,
3304
+ overwrite: false, focused: false,
3305
+ suppressEdits: false,
3306
+ pasteIncoming: false, cutIncoming: false,
3307
+ draggingText: false,
3308
+ highlight: new Delayed()};
3309
+
3310
+ themeChanged(this);
3311
+ if (options.lineWrapping)
3312
+ this.display.wrapper.className += " CodeMirror-wrap";
3313
+
3314
+ var doc = options.value;
3315
+ if (typeof doc == "string") doc = new Doc(options.value, options.mode);
3316
+ operation(this, attachDoc)(this, doc);
3317
+
3318
+ // Override magic textarea content restore that IE sometimes does
3319
+ // on our hidden textarea on reload
3320
+ if (old_ie) setTimeout(bind(resetInput, this, true), 20);
3321
+
3322
+ registerEventHandlers(this);
3323
+ // IE throws unspecified error in certain cases, when
3324
+ // trying to access activeElement before onload
3325
+ var hasFocus; try { hasFocus = (document.activeElement == display.input); } catch(e) { }
3326
+ if (hasFocus || (options.autofocus && !mobile)) setTimeout(bind(onFocus, this), 20);
3327
+ else onBlur(this);
3328
+
3329
+ operation(this, function() {
3330
+ for (var opt in optionHandlers)
3331
+ if (optionHandlers.propertyIsEnumerable(opt))
3332
+ optionHandlers[opt](this, options[opt], Init);
3333
+ for (var i = 0; i < initHooks.length; ++i) initHooks[i](this);
3334
+ })();
3335
+ }
3336
+
3337
+ // DISPLAY CONSTRUCTOR
3338
+
3339
+ function makeDisplay(place, docStart) {
3340
+ var d = {};
3341
+
3342
+ var input = d.input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none");
3343
+ if (webkit) input.style.width = "1000px";
3344
+ else input.setAttribute("wrap", "off");
3345
+ // if border: 0; -- iOS fails to open keyboard (issue #1287)
3346
+ if (ios) input.style.border = "1px solid black";
3347
+ input.setAttribute("autocorrect", "off"); input.setAttribute("autocapitalize", "off"); input.setAttribute("spellcheck", "false");
3348
+
3349
+ // Wraps and hides input textarea
3350
+ d.inputDiv = elt("div", [input], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");
3351
+ // The actual fake scrollbars.
3352
+ d.scrollbarH = elt("div", [elt("div", null, null, "height: 1px")], "CodeMirror-hscrollbar");
3353
+ d.scrollbarV = elt("div", [elt("div", null, null, "width: 1px")], "CodeMirror-vscrollbar");
3354
+ d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler");
3355
+ d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler");
3356
+ // DIVs containing the selection and the actual code
3357
+ d.lineDiv = elt("div", null, "CodeMirror-code");
3358
+ d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1");
3359
+ // Blinky cursor, and element used to ensure cursor fits at the end of a line
3360
+ d.cursor = elt("div", "\u00a0", "CodeMirror-cursor");
3361
+ // Secondary cursor, shown when on a 'jump' in bi-directional text
3362
+ d.otherCursor = elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor");
3363
+ // Used to measure text size
3364
+ d.measure = elt("div", null, "CodeMirror-measure");
3365
+ // Wraps everything that needs to exist inside the vertically-padded coordinate system
3366
+ d.lineSpace = elt("div", [d.measure, d.selectionDiv, d.lineDiv, d.cursor, d.otherCursor],
3367
+ null, "position: relative; outline: none");
3368
+ // Moved around its parent to cover visible view
3369
+ d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative");
3370
+ // Set to the height of the text, causes scrolling
3371
+ d.sizer = elt("div", [d.mover], "CodeMirror-sizer");
3372
+ // D is needed because behavior of elts with overflow: auto and padding is inconsistent across browsers
3373
+ d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerCutOff + "px; width: 1px;");
3374
+ // Will contain the gutters, if any
3375
+ d.gutters = elt("div", null, "CodeMirror-gutters");
3376
+ d.lineGutter = null;
3377
+ // Provides scrolling
3378
+ d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll");
3379
+ d.scroller.setAttribute("tabIndex", "-1");
3380
+ // The element in which the editor lives.
3381
+ d.wrapper = elt("div", [d.inputDiv, d.scrollbarH, d.scrollbarV,
3382
+ d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror");
3383
+ // Work around IE7 z-index bug
3384
+ if (ie_lt8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }
3385
+ if (place.appendChild) place.appendChild(d.wrapper); else place(d.wrapper);
3386
+
3387
+ // Needed to hide big blue blinking cursor on Mobile Safari
3388
+ if (ios) input.style.width = "0px";
3389
+ if (!webkit) d.scroller.draggable = true;
3390
+ // Needed to handle Tab key in KHTML
3391
+ if (khtml) { d.inputDiv.style.height = "1px"; d.inputDiv.style.position = "absolute"; }
3392
+ // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).
3393
+ else if (ie_lt8) d.scrollbarH.style.minWidth = d.scrollbarV.style.minWidth = "18px";
3394
+
3395
+ // Current visible range (may be bigger than the view window).
3396
+ d.viewOffset = d.lastSizeC = 0;
3397
+ d.showingFrom = d.showingTo = docStart;
3398
+
3399
+ // Used to only resize the line number gutter when necessary (when
3400
+ // the amount of lines crosses a boundary that makes its width change)
3401
+ d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;
3402
+ // See readInput and resetInput
3403
+ d.prevInput = "";
3404
+ // Set to true when a non-horizontal-scrolling widget is added. As
3405
+ // an optimization, widget aligning is skipped when d is false.
3406
+ d.alignWidgets = false;
3407
+ // Flag that indicates whether we currently expect input to appear
3408
+ // (after some event like 'keypress' or 'input') and are polling
3409
+ // intensively.
3410
+ d.pollingFast = false;
3411
+ // Self-resetting timeout for the poller
3412
+ d.poll = new Delayed();
3413
+
3414
+ d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;
3415
+ d.measureLineCache = [];
3416
+ d.measureLineCachePos = 0;
3417
+
3418
+ // Tracks when resetInput has punted to just putting a short
3419
+ // string instead of the (large) selection.
3420
+ d.inaccurateSelection = false;
3421
+
3422
+ // Tracks the maximum line length so that the horizontal scrollbar
3423
+ // can be kept static when scrolling.
3424
+ d.maxLine = null;
3425
+ d.maxLineLength = 0;
3426
+ d.maxLineChanged = false;
3427
+
3428
+ // Used for measuring wheel scrolling granularity
3429
+ d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;
3430
+
3431
+ return d;
3432
+ }
3433
+
3434
+ // STATE UPDATES
3435
+
3436
+ // Used to get the editor into a consistent state again when options change.
3437
+
3438
+ function loadMode(cm) {
3439
+ cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);
3440
+ resetModeState(cm);
3441
+ }
3442
+
3443
+ function resetModeState(cm) {
3444
+ cm.doc.iter(function(line) {
3445
+ if (line.stateAfter) line.stateAfter = null;
3446
+ if (line.styles) line.styles = null;
3447
+ });
3448
+ cm.doc.frontier = cm.doc.first;
3449
+ startWorker(cm, 100);
3450
+ cm.state.modeGen++;
3451
+ if (cm.curOp) regChange(cm);
3452
+ }
3453
+
3454
+ function wrappingChanged(cm) {
3455
+ if (cm.options.lineWrapping) {
3456
+ cm.display.wrapper.className += " CodeMirror-wrap";
3457
+ cm.display.sizer.style.minWidth = "";
3458
+ } else {
3459
+ cm.display.wrapper.className = cm.display.wrapper.className.replace(" CodeMirror-wrap", "");
3460
+ computeMaxLength(cm);
3461
+ }
3462
+ estimateLineHeights(cm);
3463
+ regChange(cm);
3464
+ clearCaches(cm);
3465
+ setTimeout(function(){updateScrollbars(cm);}, 100);
3466
+ }
3467
+
3468
+ function estimateHeight(cm) {
3469
+ var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;
3470
+ var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);
3471
+ return function(line) {
3472
+ if (lineIsHidden(cm.doc, line))
3473
+ return 0;
3474
+ else if (wrapping)
3475
+ return (Math.ceil(line.text.length / perLine) || 1) * th;
3476
+ else
3477
+ return th;
3478
+ };
3479
+ }
3480
+
3481
+ function estimateLineHeights(cm) {
3482
+ var doc = cm.doc, est = estimateHeight(cm);
3483
+ doc.iter(function(line) {
3484
+ var estHeight = est(line);
3485
+ if (estHeight != line.height) updateLineHeight(line, estHeight);
3486
+ });
3487
+ }
3488
+
3489
+ function keyMapChanged(cm) {
3490
+ var map = keyMap[cm.options.keyMap], style = map.style;
3491
+ cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-keymap-\S+/g, "") +
3492
+ (style ? " cm-keymap-" + style : "");
3493
+ }
3494
+
3495
+ function themeChanged(cm) {
3496
+ cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") +
3497
+ cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-");
3498
+ clearCaches(cm);
3499
+ }
3500
+
3501
+ function guttersChanged(cm) {
3502
+ updateGutters(cm);
3503
+ regChange(cm);
3504
+ setTimeout(function(){alignHorizontally(cm);}, 20);
3505
+ }
3506
+
3507
+ function updateGutters(cm) {
3508
+ var gutters = cm.display.gutters, specs = cm.options.gutters;
3509
+ removeChildren(gutters);
3510
+ for (var i = 0; i < specs.length; ++i) {
3511
+ var gutterClass = specs[i];
3512
+ var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass));
3513
+ if (gutterClass == "CodeMirror-linenumbers") {
3514
+ cm.display.lineGutter = gElt;
3515
+ gElt.style.width = (cm.display.lineNumWidth || 1) + "px";
3516
+ }
3517
+ }
3518
+ gutters.style.display = i ? "" : "none";
3519
+ }
3520
+
3521
+ function lineLength(doc, line) {
3522
+ if (line.height == 0) return 0;
3523
+ var len = line.text.length, merged, cur = line;
3524
+ while (merged = collapsedSpanAtStart(cur)) {
3525
+ var found = merged.find();
3526
+ cur = getLine(doc, found.from.line);
3527
+ len += found.from.ch - found.to.ch;
3528
+ }
3529
+ cur = line;
3530
+ while (merged = collapsedSpanAtEnd(cur)) {
3531
+ var found = merged.find();
3532
+ len -= cur.text.length - found.from.ch;
3533
+ cur = getLine(doc, found.to.line);
3534
+ len += cur.text.length - found.to.ch;
3535
+ }
3536
+ return len;
3537
+ }
3538
+
3539
+ function computeMaxLength(cm) {
3540
+ var d = cm.display, doc = cm.doc;
3541
+ d.maxLine = getLine(doc, doc.first);
3542
+ d.maxLineLength = lineLength(doc, d.maxLine);
3543
+ d.maxLineChanged = true;
3544
+ doc.iter(function(line) {
3545
+ var len = lineLength(doc, line);
3546
+ if (len > d.maxLineLength) {
3547
+ d.maxLineLength = len;
3548
+ d.maxLine = line;
3549
+ }
3550
+ });
3551
+ }
3552
+
3553
+ // Make sure the gutters options contains the element
3554
+ // "CodeMirror-linenumbers" when the lineNumbers option is true.
3555
+ function setGuttersForLineNumbers(options) {
3556
+ var found = indexOf(options.gutters, "CodeMirror-linenumbers");
3557
+ if (found == -1 && options.lineNumbers) {
3558
+ options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]);
3559
+ } else if (found > -1 && !options.lineNumbers) {
3560
+ options.gutters = options.gutters.slice(0);
3561
+ options.gutters.splice(found, 1);
3562
+ }
3563
+ }
3564
+
3565
+ // SCROLLBARS
3566
+
3567
+ // Re-synchronize the fake scrollbars with the actual size of the
3568
+ // content. Optionally force a scrollTop.
3569
+ function updateScrollbars(cm) {
3570
+ var d = cm.display, docHeight = cm.doc.height;
3571
+ var totalHeight = docHeight + paddingVert(d);
3572
+ d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + "px";
3573
+ d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + "px";
3574
+ var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);
3575
+ var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);
3576
+ var needsV = scrollHeight > (d.scroller.clientHeight + 1);
3577
+ if (needsV) {
3578
+ d.scrollbarV.style.display = "block";
3579
+ d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + "px" : "0";
3580
+ // A bug in IE8 can cause this value to be negative, so guard it.
3581
+ d.scrollbarV.firstChild.style.height =
3582
+ Math.max(0, scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + "px";
3583
+ } else {
3584
+ d.scrollbarV.style.display = "";
3585
+ d.scrollbarV.firstChild.style.height = "0";
3586
+ }
3587
+ if (needsH) {
3588
+ d.scrollbarH.style.display = "block";
3589
+ d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + "px" : "0";
3590
+ d.scrollbarH.firstChild.style.width =
3591
+ (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + "px";
3592
+ } else {
3593
+ d.scrollbarH.style.display = "";
3594
+ d.scrollbarH.firstChild.style.width = "0";
3595
+ }
3596
+ if (needsH && needsV) {
3597
+ d.scrollbarFiller.style.display = "block";
3598
+ d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + "px";
3599
+ } else d.scrollbarFiller.style.display = "";
3600
+ if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {
3601
+ d.gutterFiller.style.display = "block";
3602
+ d.gutterFiller.style.height = scrollbarWidth(d.measure) + "px";
3603
+ d.gutterFiller.style.width = d.gutters.offsetWidth + "px";
3604
+ } else d.gutterFiller.style.display = "";
3605
+
3606
+ if (mac_geLion && scrollbarWidth(d.measure) === 0) {
3607
+ d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? "18px" : "12px";
3608
+ d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = "none";
3609
+ }
3610
+ }
3611
+
3612
+ function visibleLines(display, doc, viewPort) {
3613
+ var top = display.scroller.scrollTop, height = display.wrapper.clientHeight;
3614
+ if (typeof viewPort == "number") top = viewPort;
3615
+ else if (viewPort) {top = viewPort.top; height = viewPort.bottom - viewPort.top;}
3616
+ top = Math.floor(top - paddingTop(display));
3617
+ var bottom = Math.ceil(top + height);
3618
+ return {from: lineAtHeight(doc, top), to: lineAtHeight(doc, bottom)};
3619
+ }
3620
+
3621
+ // LINE NUMBERS
3622
+
3623
+ function alignHorizontally(cm) {
3624
+ var display = cm.display;
3625
+ if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;
3626
+ var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;
3627
+ var gutterW = display.gutters.offsetWidth, l = comp + "px";
3628
+ for (var n = display.lineDiv.firstChild; n; n = n.nextSibling) if (n.alignable) {
3629
+ for (var i = 0, a = n.alignable; i < a.length; ++i) a[i].style.left = l;
3630
+ }
3631
+ if (cm.options.fixedGutter)
3632
+ display.gutters.style.left = (comp + gutterW) + "px";
3633
+ }
3634
+
3635
+ function maybeUpdateLineNumberWidth(cm) {
3636
+ if (!cm.options.lineNumbers) return false;
3637
+ var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;
3638
+ if (last.length != display.lineNumChars) {
3639
+ var test = display.measure.appendChild(elt("div", [elt("div", last)],
3640
+ "CodeMirror-linenumber CodeMirror-gutter-elt"));
3641
+ var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;
3642
+ display.lineGutter.style.width = "";
3643
+ display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);
3644
+ display.lineNumWidth = display.lineNumInnerWidth + padding;
3645
+ display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;
3646
+ display.lineGutter.style.width = display.lineNumWidth + "px";
3647
+ return true;
3648
+ }
3649
+ return false;
3650
+ }
3651
+
3652
+ function lineNumberFor(options, i) {
3653
+ return String(options.lineNumberFormatter(i + options.firstLineNumber));
3654
+ }
3655
+ function compensateForHScroll(display) {
3656
+ return getRect(display.scroller).left - getRect(display.sizer).left;
3657
+ }
3658
+
3659
+ // DISPLAY DRAWING
3660
+
3661
+ function updateDisplay(cm, changes, viewPort, forced) {
3662
+ var oldFrom = cm.display.showingFrom, oldTo = cm.display.showingTo, updated;
3663
+ var visible = visibleLines(cm.display, cm.doc, viewPort);
3664
+ for (var first = true;; first = false) {
3665
+ var oldWidth = cm.display.scroller.clientWidth;
3666
+ if (!updateDisplayInner(cm, changes, visible, forced)) break;
3667
+ updated = true;
3668
+ changes = [];
3669
+ updateSelection(cm);
3670
+ updateScrollbars(cm);
3671
+ if (first && cm.options.lineWrapping && oldWidth != cm.display.scroller.clientWidth) {
3672
+ forced = true;
3673
+ continue;
3674
+ }
3675
+ forced = false;
3676
+
3677
+ // Clip forced viewport to actual scrollable area
3678
+ if (viewPort)
3679
+ viewPort = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight,
3680
+ typeof viewPort == "number" ? viewPort : viewPort.top);
3681
+ visible = visibleLines(cm.display, cm.doc, viewPort);
3682
+ if (visible.from >= cm.display.showingFrom && visible.to <= cm.display.showingTo)
3683
+ break;
3684
+ }
3685
+
3686
+ if (updated) {
3687
+ signalLater(cm, "update", cm);
3688
+ if (cm.display.showingFrom != oldFrom || cm.display.showingTo != oldTo)
3689
+ signalLater(cm, "viewportChange", cm, cm.display.showingFrom, cm.display.showingTo);
3690
+ }
3691
+ return updated;
3692
+ }
3693
+
3694
+ // Uses a set of changes plus the current scroll position to
3695
+ // determine which DOM updates have to be made, and makes the
3696
+ // updates.
3697
+ function updateDisplayInner(cm, changes, visible, forced) {
3698
+ var display = cm.display, doc = cm.doc;
3699
+ if (!display.wrapper.offsetWidth) {
3700
+ display.showingFrom = display.showingTo = doc.first;
3701
+ display.viewOffset = 0;
3702
+ return;
3703
+ }
3704
+
3705
+ // Bail out if the visible area is already rendered and nothing changed.
3706
+ if (!forced && changes.length == 0 &&
3707
+ visible.from > display.showingFrom && visible.to < display.showingTo)
3708
+ return;
3709
+
3710
+ if (maybeUpdateLineNumberWidth(cm))
3711
+ changes = [{from: doc.first, to: doc.first + doc.size}];
3712
+ var gutterW = display.sizer.style.marginLeft = display.gutters.offsetWidth + "px";
3713
+ display.scrollbarH.style.left = cm.options.fixedGutter ? gutterW : "0";
3714
+
3715
+ // Used to determine which lines need their line numbers updated
3716
+ var positionsChangedFrom = Infinity;
3717
+ if (cm.options.lineNumbers)
3718
+ for (var i = 0; i < changes.length; ++i)
3719
+ if (changes[i].diff && changes[i].from < positionsChangedFrom) { positionsChangedFrom = changes[i].from; }
3720
+
3721
+ var end = doc.first + doc.size;
3722
+ var from = Math.max(visible.from - cm.options.viewportMargin, doc.first);
3723
+ var to = Math.min(end, visible.to + cm.options.viewportMargin);
3724
+ if (display.showingFrom < from && from - display.showingFrom < 20) from = Math.max(doc.first, display.showingFrom);
3725
+ if (display.showingTo > to && display.showingTo - to < 20) to = Math.min(end, display.showingTo);
3726
+ if (sawCollapsedSpans) {
3727
+ from = lineNo(visualLine(doc, getLine(doc, from)));
3728
+ while (to < end && lineIsHidden(doc, getLine(doc, to))) ++to;
3729
+ }
3730
+
3731
+ // Create a range of theoretically intact lines, and punch holes
3732
+ // in that using the change info.
3733
+ var intact = [{from: Math.max(display.showingFrom, doc.first),
3734
+ to: Math.min(display.showingTo, end)}];
3735
+ if (intact[0].from >= intact[0].to) intact = [];
3736
+ else intact = computeIntact(intact, changes);
3737
+ // When merged lines are present, we might have to reduce the
3738
+ // intact ranges because changes in continued fragments of the
3739
+ // intact lines do require the lines to be redrawn.
3740
+ if (sawCollapsedSpans)
3741
+ for (var i = 0; i < intact.length; ++i) {
3742
+ var range = intact[i], merged;
3743
+ while (merged = collapsedSpanAtEnd(getLine(doc, range.to - 1))) {
3744
+ var newTo = merged.find().from.line;
3745
+ if (newTo > range.from) range.to = newTo;
3746
+ else { intact.splice(i--, 1); break; }
3747
+ }
3748
+ }
3749
+
3750
+ // Clip off the parts that won't be visible
3751
+ var intactLines = 0;
3752
+ for (var i = 0; i < intact.length; ++i) {
3753
+ var range = intact[i];
3754
+ if (range.from < from) range.from = from;
3755
+ if (range.to > to) range.to = to;
3756
+ if (range.from >= range.to) intact.splice(i--, 1);
3757
+ else intactLines += range.to - range.from;
3758
+ }
3759
+ if (!forced && intactLines == to - from && from == display.showingFrom && to == display.showingTo) {
3760
+ updateViewOffset(cm);
3761
+ return;
3762
+ }
3763
+ intact.sort(function(a, b) {return a.from - b.from;});
3764
+
3765
+ // Avoid crashing on IE's "unspecified error" when in iframes
3766
+ try {
3767
+ var focused = document.activeElement;
3768
+ } catch(e) {}
3769
+ if (intactLines < (to - from) * .7) display.lineDiv.style.display = "none";
3770
+ patchDisplay(cm, from, to, intact, positionsChangedFrom);
3771
+ display.lineDiv.style.display = "";
3772
+ if (focused && document.activeElement != focused && focused.offsetHeight) focused.focus();
3773
+
3774
+ var different = from != display.showingFrom || to != display.showingTo ||
3775
+ display.lastSizeC != display.wrapper.clientHeight;
3776
+ // This is just a bogus formula that detects when the editor is
3777
+ // resized or the font size changes.
3778
+ if (different) {
3779
+ display.lastSizeC = display.wrapper.clientHeight;
3780
+ startWorker(cm, 400);
3781
+ }
3782
+ display.showingFrom = from; display.showingTo = to;
3783
+
3784
+ display.gutters.style.height = "";
3785
+ updateHeightsInViewport(cm);
3786
+ updateViewOffset(cm);
3787
+
3788
+ return true;
3789
+ }
3790
+
3791
+ function updateHeightsInViewport(cm) {
3792
+ var display = cm.display;
3793
+ var prevBottom = display.lineDiv.offsetTop;
3794
+ for (var node = display.lineDiv.firstChild, height; node; node = node.nextSibling) if (node.lineObj) {
3795
+ if (ie_lt8) {
3796
+ var bot = node.offsetTop + node.offsetHeight;
3797
+ height = bot - prevBottom;
3798
+ prevBottom = bot;
3799
+ } else {
3800
+ var box = getRect(node);
3801
+ height = box.bottom - box.top;
3802
+ }
3803
+ var diff = node.lineObj.height - height;
3804
+ if (height < 2) height = textHeight(display);
3805
+ if (diff > .001 || diff < -.001) {
3806
+ updateLineHeight(node.lineObj, height);
3807
+ var widgets = node.lineObj.widgets;
3808
+ if (widgets) for (var i = 0; i < widgets.length; ++i)
3809
+ widgets[i].height = widgets[i].node.offsetHeight;
3810
+ }
3811
+ }
3812
+ }
3813
+
3814
+ function updateViewOffset(cm) {
3815
+ var off = cm.display.viewOffset = heightAtLine(cm, getLine(cm.doc, cm.display.showingFrom));
3816
+ // Position the mover div to align with the current virtual scroll position
3817
+ cm.display.mover.style.top = off + "px";
3818
+ }
3819
+
3820
+ function computeIntact(intact, changes) {
3821
+ for (var i = 0, l = changes.length || 0; i < l; ++i) {
3822
+ var change = changes[i], intact2 = [], diff = change.diff || 0;
3823
+ for (var j = 0, l2 = intact.length; j < l2; ++j) {
3824
+ var range = intact[j];
3825
+ if (change.to <= range.from && change.diff) {
3826
+ intact2.push({from: range.from + diff, to: range.to + diff});
3827
+ } else if (change.to <= range.from || change.from >= range.to) {
3828
+ intact2.push(range);
3829
+ } else {
3830
+ if (change.from > range.from)
3831
+ intact2.push({from: range.from, to: change.from});
3832
+ if (change.to < range.to)
3833
+ intact2.push({from: change.to + diff, to: range.to + diff});
3834
+ }
3835
+ }
3836
+ intact = intact2;
3837
+ }
3838
+ return intact;
3839
+ }
3840
+
3841
+ function getDimensions(cm) {
3842
+ var d = cm.display, left = {}, width = {};
3843
+ for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {
3844
+ left[cm.options.gutters[i]] = n.offsetLeft;
3845
+ width[cm.options.gutters[i]] = n.offsetWidth;
3846
+ }
3847
+ return {fixedPos: compensateForHScroll(d),
3848
+ gutterTotalWidth: d.gutters.offsetWidth,
3849
+ gutterLeft: left,
3850
+ gutterWidth: width,
3851
+ wrapperWidth: d.wrapper.clientWidth};
3852
+ }
3853
+
3854
+ function patchDisplay(cm, from, to, intact, updateNumbersFrom) {
3855
+ var dims = getDimensions(cm);
3856
+ var display = cm.display, lineNumbers = cm.options.lineNumbers;
3857
+ if (!intact.length && (!webkit || !cm.display.currentWheelTarget))
3858
+ removeChildren(display.lineDiv);
3859
+ var container = display.lineDiv, cur = container.firstChild;
3860
+
3861
+ function rm(node) {
3862
+ var next = node.nextSibling;
3863
+ if (webkit && mac && cm.display.currentWheelTarget == node) {
3864
+ node.style.display = "none";
3865
+ node.lineObj = null;
3866
+ } else {
3867
+ node.parentNode.removeChild(node);
3868
+ }
3869
+ return next;
3870
+ }
3871
+
3872
+ var nextIntact = intact.shift(), lineN = from;
3873
+ cm.doc.iter(from, to, function(line) {
3874
+ if (nextIntact && nextIntact.to == lineN) nextIntact = intact.shift();
3875
+ if (lineIsHidden(cm.doc, line)) {
3876
+ if (line.height != 0) updateLineHeight(line, 0);
3877
+ if (line.widgets && cur && cur.previousSibling) for (var i = 0; i < line.widgets.length; ++i) {
3878
+ var w = line.widgets[i];
3879
+ if (w.showIfHidden) {
3880
+ var prev = cur.previousSibling;
3881
+ if (/pre/i.test(prev.nodeName)) {
3882
+ var wrap = elt("div", null, null, "position: relative");
3883
+ prev.parentNode.replaceChild(wrap, prev);
3884
+ wrap.appendChild(prev);
3885
+ prev = wrap;
3886
+ }
3887
+ var wnode = prev.appendChild(elt("div", [w.node], "CodeMirror-linewidget"));
3888
+ if (!w.handleMouseEvents) wnode.ignoreEvents = true;
3889
+ positionLineWidget(w, wnode, prev, dims);
3890
+ }
3891
+ }
3892
+ } else if (nextIntact && nextIntact.from <= lineN && nextIntact.to > lineN) {
3893
+ // This line is intact. Skip to the actual node. Update its
3894
+ // line number if needed.
3895
+ while (cur.lineObj != line) cur = rm(cur);
3896
+ if (lineNumbers && updateNumbersFrom <= lineN && cur.lineNumber)
3897
+ setTextContent(cur.lineNumber, lineNumberFor(cm.options, lineN));
3898
+ cur = cur.nextSibling;
3899
+ } else {
3900
+ // For lines with widgets, make an attempt to find and reuse
3901
+ // the existing element, so that widgets aren't needlessly
3902
+ // removed and re-inserted into the dom
3903
+ if (line.widgets) for (var j = 0, search = cur, reuse; search && j < 20; ++j, search = search.nextSibling)
3904
+ if (search.lineObj == line && /div/i.test(search.nodeName)) { reuse = search; break; }
3905
+ // This line needs to be generated.
3906
+ var lineNode = buildLineElement(cm, line, lineN, dims, reuse);
3907
+ if (lineNode != reuse) {
3908
+ container.insertBefore(lineNode, cur);
3909
+ } else {
3910
+ while (cur != reuse) cur = rm(cur);
3911
+ cur = cur.nextSibling;
3912
+ }
3913
+
3914
+ lineNode.lineObj = line;
3915
+ }
3916
+ ++lineN;
3917
+ });
3918
+ while (cur) cur = rm(cur);
3919
+ }
3920
+
3921
+ function buildLineElement(cm, line, lineNo, dims, reuse) {
3922
+ var built = buildLineContent(cm, line), lineElement = built.pre;
3923
+ var markers = line.gutterMarkers, display = cm.display, wrap;
3924
+
3925
+ var bgClass = built.bgClass ? built.bgClass + " " + (line.bgClass || "") : line.bgClass;
3926
+ if (!cm.options.lineNumbers && !markers && !bgClass && !line.wrapClass && !line.widgets)
3927
+ return lineElement;
3928
+
3929
+ // Lines with gutter elements, widgets or a background class need
3930
+ // to be wrapped again, and have the extra elements added to the
3931
+ // wrapper div
3932
+
3933
+ if (reuse) {
3934
+ reuse.alignable = null;
3935
+ var isOk = true, widgetsSeen = 0, insertBefore = null;
3936
+ for (var n = reuse.firstChild, next; n; n = next) {
3937
+ next = n.nextSibling;
3938
+ if (!/\bCodeMirror-linewidget\b/.test(n.className)) {
3939
+ reuse.removeChild(n);
3940
+ } else {
3941
+ for (var i = 0; i < line.widgets.length; ++i) {
3942
+ var widget = line.widgets[i];
3943
+ if (widget.node == n.firstChild) {
3944
+ if (!widget.above && !insertBefore) insertBefore = n;
3945
+ positionLineWidget(widget, n, reuse, dims);
3946
+ ++widgetsSeen;
3947
+ break;
3948
+ }
3949
+ }
3950
+ if (i == line.widgets.length) { isOk = false; break; }
3951
+ }
3952
+ }
3953
+ reuse.insertBefore(lineElement, insertBefore);
3954
+ if (isOk && widgetsSeen == line.widgets.length) {
3955
+ wrap = reuse;
3956
+ reuse.className = line.wrapClass || "";
3957
+ }
3958
+ }
3959
+ if (!wrap) {
3960
+ wrap = elt("div", null, line.wrapClass, "position: relative");
3961
+ wrap.appendChild(lineElement);
3962
+ }
3963
+ // Kludge to make sure the styled element lies behind the selection (by z-index)
3964
+ if (bgClass)
3965
+ wrap.insertBefore(elt("div", null, bgClass + " CodeMirror-linebackground"), wrap.firstChild);
3966
+ if (cm.options.lineNumbers || markers) {
3967
+ var gutterWrap = wrap.insertBefore(elt("div", null, "CodeMirror-gutter-wrapper", "position: absolute; left: " +
3968
+ (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"),
3969
+ lineElement);
3970
+ if (cm.options.fixedGutter) (wrap.alignable || (wrap.alignable = [])).push(gutterWrap);
3971
+ if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"]))
3972
+ wrap.lineNumber = gutterWrap.appendChild(
3973
+ elt("div", lineNumberFor(cm.options, lineNo),
3974
+ "CodeMirror-linenumber CodeMirror-gutter-elt",
3975
+ "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: "
3976
+ + display.lineNumInnerWidth + "px"));
3977
+ if (markers)
3978
+ for (var k = 0; k < cm.options.gutters.length; ++k) {
3979
+ var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];
3980
+ if (found)
3981
+ gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " +
3982
+ dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px"));
3983
+ }
3984
+ }
3985
+ if (ie_lt8) wrap.style.zIndex = 2;
3986
+ if (line.widgets && wrap != reuse) for (var i = 0, ws = line.widgets; i < ws.length; ++i) {
3987
+ var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget");
3988
+ if (!widget.handleMouseEvents) node.ignoreEvents = true;
3989
+ positionLineWidget(widget, node, wrap, dims);
3990
+ if (widget.above)
3991
+ wrap.insertBefore(node, cm.options.lineNumbers && line.height != 0 ? gutterWrap : lineElement);
3992
+ else
3993
+ wrap.appendChild(node);
3994
+ signalLater(widget, "redraw");
3995
+ }
3996
+ return wrap;
3997
+ }
3998
+
3999
+ function positionLineWidget(widget, node, wrap, dims) {
4000
+ if (widget.noHScroll) {
4001
+ (wrap.alignable || (wrap.alignable = [])).push(node);
4002
+ var width = dims.wrapperWidth;
4003
+ node.style.left = dims.fixedPos + "px";
4004
+ if (!widget.coverGutter) {
4005
+ width -= dims.gutterTotalWidth;
4006
+ node.style.paddingLeft = dims.gutterTotalWidth + "px";
4007
+ }
4008
+ node.style.width = width + "px";
4009
+ }
4010
+ if (widget.coverGutter) {
4011
+ node.style.zIndex = 5;
4012
+ node.style.position = "relative";
4013
+ if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + "px";
4014
+ }
4015
+ }
4016
+
4017
+ // SELECTION / CURSOR
4018
+
4019
+ function updateSelection(cm) {
4020
+ var display = cm.display;
4021
+ var collapsed = posEq(cm.doc.sel.from, cm.doc.sel.to);
4022
+ if (collapsed || cm.options.showCursorWhenSelecting)
4023
+ updateSelectionCursor(cm);
4024
+ else
4025
+ display.cursor.style.display = display.otherCursor.style.display = "none";
4026
+ if (!collapsed)
4027
+ updateSelectionRange(cm);
4028
+ else
4029
+ display.selectionDiv.style.display = "none";
4030
+
4031
+ // Move the hidden textarea near the cursor to prevent scrolling artifacts
4032
+ if (cm.options.moveInputWithCursor) {
4033
+ var headPos = cursorCoords(cm, cm.doc.sel.head, "div");
4034
+ var wrapOff = getRect(display.wrapper), lineOff = getRect(display.lineDiv);
4035
+ display.inputDiv.style.top = Math.max(0, Math.min(display.wrapper.clientHeight - 10,
4036
+ headPos.top + lineOff.top - wrapOff.top)) + "px";
4037
+ display.inputDiv.style.left = Math.max(0, Math.min(display.wrapper.clientWidth - 10,
4038
+ headPos.left + lineOff.left - wrapOff.left)) + "px";
4039
+ }
4040
+ }
4041
+
4042
+ // No selection, plain cursor
4043
+ function updateSelectionCursor(cm) {
4044
+ var display = cm.display, pos = cursorCoords(cm, cm.doc.sel.head, "div");
4045
+ display.cursor.style.left = pos.left + "px";
4046
+ display.cursor.style.top = pos.top + "px";
4047
+ display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px";
4048
+ display.cursor.style.display = "";
4049
+
4050
+ if (pos.other) {
4051
+ display.otherCursor.style.display = "";
4052
+ display.otherCursor.style.left = pos.other.left + "px";
4053
+ display.otherCursor.style.top = pos.other.top + "px";
4054
+ display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px";
4055
+ } else { display.otherCursor.style.display = "none"; }
4056
+ }
4057
+
4058
+ // Highlight selection
4059
+ function updateSelectionRange(cm) {
4060
+ var display = cm.display, doc = cm.doc, sel = cm.doc.sel;
4061
+ var fragment = document.createDocumentFragment();
4062
+ var padding = paddingH(cm.display), leftSide = padding.left, rightSide = display.lineSpace.offsetWidth - padding.right;
4063
+
4064
+ function add(left, top, width, bottom) {
4065
+ if (top < 0) top = 0;
4066
+ fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left +
4067
+ "px; top: " + top + "px; width: " + (width == null ? rightSide - left : width) +
4068
+ "px; height: " + (bottom - top) + "px"));
4069
+ }
4070
+
4071
+ function drawForLine(line, fromArg, toArg) {
4072
+ var lineObj = getLine(doc, line);
4073
+ var lineLen = lineObj.text.length;
4074
+ var start, end;
4075
+ function coords(ch, bias) {
4076
+ return charCoords(cm, Pos(line, ch), "div", lineObj, bias);
4077
+ }
4078
+
4079
+ iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {
4080
+ var leftPos = coords(from, "left"), rightPos, left, right;
4081
+ if (from == to) {
4082
+ rightPos = leftPos;
4083
+ left = right = leftPos.left;
4084
+ } else {
4085
+ rightPos = coords(to - 1, "right");
4086
+ if (dir == "rtl") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }
4087
+ left = leftPos.left;
4088
+ right = rightPos.right;
4089
+ }
4090
+ if (fromArg == null && from == 0) left = leftSide;
4091
+ if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part
4092
+ add(left, leftPos.top, null, leftPos.bottom);
4093
+ left = leftSide;
4094
+ if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);
4095
+ }
4096
+ if (toArg == null && to == lineLen) right = rightSide;
4097
+ if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)
4098
+ start = leftPos;
4099
+ if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)
4100
+ end = rightPos;
4101
+ if (left < leftSide + 1) left = leftSide;
4102
+ add(left, rightPos.top, right - left, rightPos.bottom);
4103
+ });
4104
+ return {start: start, end: end};
4105
+ }
4106
+
4107
+ if (sel.from.line == sel.to.line) {
4108
+ drawForLine(sel.from.line, sel.from.ch, sel.to.ch);
4109
+ } else {
4110
+ var fromLine = getLine(doc, sel.from.line), toLine = getLine(doc, sel.to.line);
4111
+ var singleVLine = visualLine(doc, fromLine) == visualLine(doc, toLine);
4112
+ var leftEnd = drawForLine(sel.from.line, sel.from.ch, singleVLine ? fromLine.text.length : null).end;
4113
+ var rightStart = drawForLine(sel.to.line, singleVLine ? 0 : null, sel.to.ch).start;
4114
+ if (singleVLine) {
4115
+ if (leftEnd.top < rightStart.top - 2) {
4116
+ add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);
4117
+ add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);
4118
+ } else {
4119
+ add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);
4120
+ }
4121
+ }
4122
+ if (leftEnd.bottom < rightStart.top)
4123
+ add(leftSide, leftEnd.bottom, null, rightStart.top);
4124
+ }
4125
+
4126
+ removeChildrenAndAdd(display.selectionDiv, fragment);
4127
+ display.selectionDiv.style.display = "";
4128
+ }
4129
+
4130
+ // Cursor-blinking
4131
+ function restartBlink(cm) {
4132
+ if (!cm.state.focused) return;
4133
+ var display = cm.display;
4134
+ clearInterval(display.blinker);
4135
+ var on = true;
4136
+ display.cursor.style.visibility = display.otherCursor.style.visibility = "";
4137
+ if (cm.options.cursorBlinkRate > 0)
4138
+ display.blinker = setInterval(function() {
4139
+ display.cursor.style.visibility = display.otherCursor.style.visibility = (on = !on) ? "" : "hidden";
4140
+ }, cm.options.cursorBlinkRate);
4141
+ }
4142
+
4143
+ // HIGHLIGHT WORKER
4144
+
4145
+ function startWorker(cm, time) {
4146
+ if (cm.doc.mode.startState && cm.doc.frontier < cm.display.showingTo)
4147
+ cm.state.highlight.set(time, bind(highlightWorker, cm));
4148
+ }
4149
+
4150
+ function highlightWorker(cm) {
4151
+ var doc = cm.doc;
4152
+ if (doc.frontier < doc.first) doc.frontier = doc.first;
4153
+ if (doc.frontier >= cm.display.showingTo) return;
4154
+ var end = +new Date + cm.options.workTime;
4155
+ var state = copyState(doc.mode, getStateBefore(cm, doc.frontier));
4156
+ var changed = [], prevChange;
4157
+ doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.showingTo + 500), function(line) {
4158
+ if (doc.frontier >= cm.display.showingFrom) { // Visible
4159
+ var oldStyles = line.styles;
4160
+ line.styles = highlightLine(cm, line, state, true);
4161
+ var ischange = !oldStyles || oldStyles.length != line.styles.length;
4162
+ for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i];
4163
+ if (ischange) {
4164
+ if (prevChange && prevChange.end == doc.frontier) prevChange.end++;
4165
+ else changed.push(prevChange = {start: doc.frontier, end: doc.frontier + 1});
4166
+ }
4167
+ line.stateAfter = copyState(doc.mode, state);
4168
+ } else {
4169
+ processLine(cm, line.text, state);
4170
+ line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null;
4171
+ }
4172
+ ++doc.frontier;
4173
+ if (+new Date > end) {
4174
+ startWorker(cm, cm.options.workDelay);
4175
+ return true;
4176
+ }
4177
+ });
4178
+ if (changed.length)
4179
+ operation(cm, function() {
4180
+ for (var i = 0; i < changed.length; ++i)
4181
+ regChange(this, changed[i].start, changed[i].end);
4182
+ })();
4183
+ }
4184
+
4185
+ // Finds the line to start with when starting a parse. Tries to
4186
+ // find a line with a stateAfter, so that it can start with a
4187
+ // valid state. If that fails, it returns the line with the
4188
+ // smallest indentation, which tends to need the least context to
4189
+ // parse correctly.
4190
+ function findStartLine(cm, n, precise) {
4191
+ var minindent, minline, doc = cm.doc;
4192
+ var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);
4193
+ for (var search = n; search > lim; --search) {
4194
+ if (search <= doc.first) return doc.first;
4195
+ var line = getLine(doc, search - 1);
4196
+ if (line.stateAfter && (!precise || search <= doc.frontier)) return search;
4197
+ var indented = countColumn(line.text, null, cm.options.tabSize);
4198
+ if (minline == null || minindent > indented) {
4199
+ minline = search - 1;
4200
+ minindent = indented;
4201
+ }
4202
+ }
4203
+ return minline;
4204
+ }
4205
+
4206
+ function getStateBefore(cm, n, precise) {
4207
+ var doc = cm.doc, display = cm.display;
4208
+ if (!doc.mode.startState) return true;
4209
+ var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter;
4210
+ if (!state) state = startState(doc.mode);
4211
+ else state = copyState(doc.mode, state);
4212
+ doc.iter(pos, n, function(line) {
4213
+ processLine(cm, line.text, state);
4214
+ var save = pos == n - 1 || pos % 5 == 0 || pos >= display.showingFrom && pos < display.showingTo;
4215
+ line.stateAfter = save ? copyState(doc.mode, state) : null;
4216
+ ++pos;
4217
+ });
4218
+ if (precise) doc.frontier = pos;
4219
+ return state;
4220
+ }
4221
+
4222
+ // POSITION MEASUREMENT
4223
+
4224
+ function paddingTop(display) {return display.lineSpace.offsetTop;}
4225
+ function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;}
4226
+ function paddingH(display) {
4227
+ if (display.cachedPaddingH) return display.cachedPaddingH;
4228
+ var e = removeChildrenAndAdd(display.measure, elt("pre", "x"));
4229
+ var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;
4230
+ return display.cachedPaddingH = {left: parseInt(style.paddingLeft),
4231
+ right: parseInt(style.paddingRight)};
4232
+ }
4233
+
4234
+ function measureChar(cm, line, ch, data, bias) {
4235
+ var dir = -1;
4236
+ data = data || measureLine(cm, line);
4237
+ if (data.crude) {
4238
+ var left = data.left + ch * data.width;
4239
+ return {left: left, right: left + data.width, top: data.top, bottom: data.bottom};
4240
+ }
4241
+
4242
+ for (var pos = ch;; pos += dir) {
4243
+ var r = data[pos];
4244
+ if (r) break;
4245
+ if (dir < 0 && pos == 0) dir = 1;
4246
+ }
4247
+ bias = pos > ch ? "left" : pos < ch ? "right" : bias;
4248
+ if (bias == "left" && r.leftSide) r = r.leftSide;
4249
+ else if (bias == "right" && r.rightSide) r = r.rightSide;
4250
+ return {left: pos < ch ? r.right : r.left,
4251
+ right: pos > ch ? r.left : r.right,
4252
+ top: r.top,
4253
+ bottom: r.bottom};
4254
+ }
4255
+
4256
+ function findCachedMeasurement(cm, line) {
4257
+ var cache = cm.display.measureLineCache;
4258
+ for (var i = 0; i < cache.length; ++i) {
4259
+ var memo = cache[i];
4260
+ if (memo.text == line.text && memo.markedSpans == line.markedSpans &&
4261
+ cm.display.scroller.clientWidth == memo.width &&
4262
+ memo.classes == line.textClass + "|" + line.wrapClass)
4263
+ return memo;
4264
+ }
4265
+ }
4266
+
4267
+ function clearCachedMeasurement(cm, line) {
4268
+ var exists = findCachedMeasurement(cm, line);
4269
+ if (exists) exists.text = exists.measure = exists.markedSpans = null;
4270
+ }
4271
+
4272
+ function measureLine(cm, line) {
4273
+ // First look in the cache
4274
+ var cached = findCachedMeasurement(cm, line);
4275
+ if (cached) return cached.measure;
4276
+
4277
+ // Failing that, recompute and store result in cache
4278
+ var measure = measureLineInner(cm, line);
4279
+ var cache = cm.display.measureLineCache;
4280
+ var memo = {text: line.text, width: cm.display.scroller.clientWidth,
4281
+ markedSpans: line.markedSpans, measure: measure,
4282
+ classes: line.textClass + "|" + line.wrapClass};
4283
+ if (cache.length == 16) cache[++cm.display.measureLineCachePos % 16] = memo;
4284
+ else cache.push(memo);
4285
+ return measure;
4286
+ }
4287
+
4288
+ function measureLineInner(cm, line) {
4289
+ if (!cm.options.lineWrapping && line.text.length >= cm.options.crudeMeasuringFrom)
4290
+ return crudelyMeasureLine(cm, line);
4291
+
4292
+ var display = cm.display, measure = emptyArray(line.text.length);
4293
+ var pre = buildLineContent(cm, line, measure, true).pre;
4294
+
4295
+ // IE does not cache element positions of inline elements between
4296
+ // calls to getBoundingClientRect. This makes the loop below,
4297
+ // which gathers the positions of all the characters on the line,
4298
+ // do an amount of layout work quadratic to the number of
4299
+ // characters. When line wrapping is off, we try to improve things
4300
+ // by first subdividing the line into a bunch of inline blocks, so
4301
+ // that IE can reuse most of the layout information from caches
4302
+ // for those blocks. This does interfere with line wrapping, so it
4303
+ // doesn't work when wrapping is on, but in that case the
4304
+ // situation is slightly better, since IE does cache line-wrapping
4305
+ // information and only recomputes per-line.
4306
+ if (old_ie && !ie_lt8 && !cm.options.lineWrapping && pre.childNodes.length > 100) {
4307
+ var fragment = document.createDocumentFragment();
4308
+ var chunk = 10, n = pre.childNodes.length;
4309
+ for (var i = 0, chunks = Math.ceil(n / chunk); i < chunks; ++i) {
4310
+ var wrap = elt("div", null, null, "display: inline-block");
4311
+ for (var j = 0; j < chunk && n; ++j) {
4312
+ wrap.appendChild(pre.firstChild);
4313
+ --n;
4314
+ }
4315
+ fragment.appendChild(wrap);
4316
+ }
4317
+ pre.appendChild(fragment);
4318
+ }
4319
+
4320
+ removeChildrenAndAdd(display.measure, pre);
4321
+
4322
+ var outer = getRect(display.lineDiv);
4323
+ var vranges = [], data = emptyArray(line.text.length), maxBot = pre.offsetHeight;
4324
+ // Work around an IE7/8 bug where it will sometimes have randomly
4325
+ // replaced our pre with a clone at this point.
4326
+ if (ie_lt9 && display.measure.first != pre)
4327
+ removeChildrenAndAdd(display.measure, pre);
4328
+
4329
+ function measureRect(rect) {
4330
+ var top = rect.top - outer.top, bot = rect.bottom - outer.top;
4331
+ if (bot > maxBot) bot = maxBot;
4332
+ if (top < 0) top = 0;
4333
+ for (var i = vranges.length - 2; i >= 0; i -= 2) {
4334
+ var rtop = vranges[i], rbot = vranges[i+1];
4335
+ if (rtop > bot || rbot < top) continue;
4336
+ if (rtop <= top && rbot >= bot ||
4337
+ top <= rtop && bot >= rbot ||
4338
+ Math.min(bot, rbot) - Math.max(top, rtop) >= (bot - top) >> 1) {
4339
+ vranges[i] = Math.min(top, rtop);
4340
+ vranges[i+1] = Math.max(bot, rbot);
4341
+ break;
4342
+ }
4343
+ }
4344
+ if (i < 0) { i = vranges.length; vranges.push(top, bot); }
4345
+ return {left: rect.left - outer.left,
4346
+ right: rect.right - outer.left,
4347
+ top: i, bottom: null};
4348
+ }
4349
+ function finishRect(rect) {
4350
+ rect.bottom = vranges[rect.top+1];
4351
+ rect.top = vranges[rect.top];
4352
+ }
4353
+
4354
+ for (var i = 0, cur; i < measure.length; ++i) if (cur = measure[i]) {
4355
+ var node = cur, rect = null;
4356
+ // A widget might wrap, needs special care
4357
+ if (/\bCodeMirror-widget\b/.test(cur.className) && cur.getClientRects) {
4358
+ if (cur.firstChild.nodeType == 1) node = cur.firstChild;
4359
+ var rects = node.getClientRects();
4360
+ if (rects.length > 1) {
4361
+ rect = data[i] = measureRect(rects[0]);
4362
+ rect.rightSide = measureRect(rects[rects.length - 1]);
4363
+ }
4364
+ }
4365
+ if (!rect) rect = data[i] = measureRect(getRect(node));
4366
+ if (cur.measureRight) rect.right = getRect(cur.measureRight).left - outer.left;
4367
+ if (cur.leftSide) rect.leftSide = measureRect(getRect(cur.leftSide));
4368
+ }
4369
+ removeChildren(cm.display.measure);
4370
+ for (var i = 0, cur; i < data.length; ++i) if (cur = data[i]) {
4371
+ finishRect(cur);
4372
+ if (cur.leftSide) finishRect(cur.leftSide);
4373
+ if (cur.rightSide) finishRect(cur.rightSide);
4374
+ }
4375
+ return data;
4376
+ }
4377
+
4378
+ function crudelyMeasureLine(cm, line) {
4379
+ var copy = new Line(line.text.slice(0, 100), null);
4380
+ if (line.textClass) copy.textClass = line.textClass;
4381
+ var measure = measureLineInner(cm, copy);
4382
+ var left = measureChar(cm, copy, 0, measure, "left");
4383
+ var right = measureChar(cm, copy, 99, measure, "right");
4384
+ return {crude: true, top: left.top, left: left.left, bottom: left.bottom, width: (right.right - left.left) / 100};
4385
+ }
4386
+
4387
+ function measureLineWidth(cm, line) {
4388
+ var hasBadSpan = false;
4389
+ if (line.markedSpans) for (var i = 0; i < line.markedSpans; ++i) {
4390
+ var sp = line.markedSpans[i];
4391
+ if (sp.collapsed && (sp.to == null || sp.to == line.text.length)) hasBadSpan = true;
4392
+ }
4393
+ var cached = !hasBadSpan && findCachedMeasurement(cm, line);
4394
+ if (cached || line.text.length >= cm.options.crudeMeasuringFrom)
4395
+ return measureChar(cm, line, line.text.length, cached && cached.measure, "right").right;
4396
+
4397
+ var pre = buildLineContent(cm, line, null, true).pre;
4398
+ var end = pre.appendChild(zeroWidthElement(cm.display.measure));
4399
+ removeChildrenAndAdd(cm.display.measure, pre);
4400
+ return getRect(end).right - getRect(cm.display.lineDiv).left;
4401
+ }
4402
+
4403
+ function clearCaches(cm) {
4404
+ cm.display.measureLineCache.length = cm.display.measureLineCachePos = 0;
4405
+ cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;
4406
+ if (!cm.options.lineWrapping) cm.display.maxLineChanged = true;
4407
+ cm.display.lineNumChars = null;
4408
+ }
4409
+
4410
+ function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft; }
4411
+ function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop; }
4412
+
4413
+ // Context is one of "line", "div" (display.lineDiv), "local"/null (editor), or "page"
4414
+ function intoCoordSystem(cm, lineObj, rect, context) {
4415
+ if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {
4416
+ var size = widgetHeight(lineObj.widgets[i]);
4417
+ rect.top += size; rect.bottom += size;
4418
+ }
4419
+ if (context == "line") return rect;
4420
+ if (!context) context = "local";
4421
+ var yOff = heightAtLine(cm, lineObj);
4422
+ if (context == "local") yOff += paddingTop(cm.display);
4423
+ else yOff -= cm.display.viewOffset;
4424
+ if (context == "page" || context == "window") {
4425
+ var lOff = getRect(cm.display.lineSpace);
4426
+ yOff += lOff.top + (context == "window" ? 0 : pageScrollY());
4427
+ var xOff = lOff.left + (context == "window" ? 0 : pageScrollX());
4428
+ rect.left += xOff; rect.right += xOff;
4429
+ }
4430
+ rect.top += yOff; rect.bottom += yOff;
4431
+ return rect;
4432
+ }
4433
+
4434
+ // Context may be "window", "page", "div", or "local"/null
4435
+ // Result is in "div" coords
4436
+ function fromCoordSystem(cm, coords, context) {
4437
+ if (context == "div") return coords;
4438
+ var left = coords.left, top = coords.top;
4439
+ // First move into "page" coordinate system
4440
+ if (context == "page") {
4441
+ left -= pageScrollX();
4442
+ top -= pageScrollY();
4443
+ } else if (context == "local" || !context) {
4444
+ var localBox = getRect(cm.display.sizer);
4445
+ left += localBox.left;
4446
+ top += localBox.top;
4447
+ }
4448
+
4449
+ var lineSpaceBox = getRect(cm.display.lineSpace);
4450
+ return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};
4451
+ }
4452
+
4453
+ function charCoords(cm, pos, context, lineObj, bias) {
4454
+ if (!lineObj) lineObj = getLine(cm.doc, pos.line);
4455
+ return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, null, bias), context);
4456
+ }
4457
+
4458
+ function cursorCoords(cm, pos, context, lineObj, measurement) {
4459
+ lineObj = lineObj || getLine(cm.doc, pos.line);
4460
+ if (!measurement) measurement = measureLine(cm, lineObj);
4461
+ function get(ch, right) {
4462
+ var m = measureChar(cm, lineObj, ch, measurement, right ? "right" : "left");
4463
+ if (right) m.left = m.right; else m.right = m.left;
4464
+ return intoCoordSystem(cm, lineObj, m, context);
4465
+ }
4466
+ function getBidi(ch, partPos) {
4467
+ var part = order[partPos], right = part.level % 2;
4468
+ if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {
4469
+ part = order[--partPos];
4470
+ ch = bidiRight(part) - (part.level % 2 ? 0 : 1);
4471
+ right = true;
4472
+ } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {
4473
+ part = order[++partPos];
4474
+ ch = bidiLeft(part) - part.level % 2;
4475
+ right = false;
4476
+ }
4477
+ if (right && ch == part.to && ch > part.from) return get(ch - 1);
4478
+ return get(ch, right);
4479
+ }
4480
+ var order = getOrder(lineObj), ch = pos.ch;
4481
+ if (!order) return get(ch);
4482
+ var partPos = getBidiPartAt(order, ch);
4483
+ var val = getBidi(ch, partPos);
4484
+ if (bidiOther != null) val.other = getBidi(ch, bidiOther);
4485
+ return val;
4486
+ }
4487
+
4488
+ function PosWithInfo(line, ch, outside, xRel) {
4489
+ var pos = new Pos(line, ch);
4490
+ pos.xRel = xRel;
4491
+ if (outside) pos.outside = true;
4492
+ return pos;
4493
+ }
4494
+
4495
+ // Coords must be lineSpace-local
4496
+ function coordsChar(cm, x, y) {
4497
+ var doc = cm.doc;
4498
+ y += cm.display.viewOffset;
4499
+ if (y < 0) return PosWithInfo(doc.first, 0, true, -1);
4500
+ var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;
4501
+ if (lineNo > last)
4502
+ return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);
4503
+ if (x < 0) x = 0;
4504
+
4505
+ for (;;) {
4506
+ var lineObj = getLine(doc, lineNo);
4507
+ var found = coordsCharInner(cm, lineObj, lineNo, x, y);
4508
+ var merged = collapsedSpanAtEnd(lineObj);
4509
+ var mergedPos = merged && merged.find();
4510
+ if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))
4511
+ lineNo = mergedPos.to.line;
4512
+ else
4513
+ return found;
4514
+ }
4515
+ }
4516
+
4517
+ function coordsCharInner(cm, lineObj, lineNo, x, y) {
4518
+ var innerOff = y - heightAtLine(cm, lineObj);
4519
+ var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth;
4520
+ var measurement = measureLine(cm, lineObj);
4521
+
4522
+ function getX(ch) {
4523
+ var sp = cursorCoords(cm, Pos(lineNo, ch), "line",
4524
+ lineObj, measurement);
4525
+ wrongLine = true;
4526
+ if (innerOff > sp.bottom) return sp.left - adjust;
4527
+ else if (innerOff < sp.top) return sp.left + adjust;
4528
+ else wrongLine = false;
4529
+ return sp.left;
4530
+ }
4531
+
4532
+ var bidi = getOrder(lineObj), dist = lineObj.text.length;
4533
+ var from = lineLeft(lineObj), to = lineRight(lineObj);
4534
+ var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine;
4535
+
4536
+ if (x > toX) return PosWithInfo(lineNo, to, toOutside, 1);
4537
+ // Do a binary search between these bounds.
4538
+ for (;;) {
4539
+ if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) {
4540
+ var ch = x < fromX || x - fromX <= toX - x ? from : to;
4541
+ var xDiff = x - (ch == from ? fromX : toX);
4542
+ while (isExtendingChar(lineObj.text.charAt(ch))) ++ch;
4543
+ var pos = PosWithInfo(lineNo, ch, ch == from ? fromOutside : toOutside,
4544
+ xDiff < 0 ? -1 : xDiff ? 1 : 0);
4545
+ return pos;
4546
+ }
4547
+ var step = Math.ceil(dist / 2), middle = from + step;
4548
+ if (bidi) {
4549
+ middle = from;
4550
+ for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1);
4551
+ }
4552
+ var middleX = getX(middle);
4553
+ if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) toX += 1000; dist = step;}
4554
+ else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step;}
4555
+ }
4556
+ }
4557
+
4558
+ var measureText;
4559
+ function textHeight(display) {
4560
+ if (display.cachedTextHeight != null) return display.cachedTextHeight;
4561
+ if (measureText == null) {
4562
+ measureText = elt("pre");
4563
+ // Measure a bunch of lines, for browsers that compute
4564
+ // fractional heights.
4565
+ for (var i = 0; i < 49; ++i) {
4566
+ measureText.appendChild(document.createTextNode("x"));
4567
+ measureText.appendChild(elt("br"));
4568
+ }
4569
+ measureText.appendChild(document.createTextNode("x"));
4570
+ }
4571
+ removeChildrenAndAdd(display.measure, measureText);
4572
+ var height = measureText.offsetHeight / 50;
4573
+ if (height > 3) display.cachedTextHeight = height;
4574
+ removeChildren(display.measure);
4575
+ return height || 1;
4576
+ }
4577
+
4578
+ function charWidth(display) {
4579
+ if (display.cachedCharWidth != null) return display.cachedCharWidth;
4580
+ var anchor = elt("span", "x");
4581
+ var pre = elt("pre", [anchor]);
4582
+ removeChildrenAndAdd(display.measure, pre);
4583
+ var width = anchor.offsetWidth;
4584
+ if (width > 2) display.cachedCharWidth = width;
4585
+ return width || 10;
4586
+ }
4587
+
4588
+ // OPERATIONS
4589
+
4590
+ // Operations are used to wrap changes in such a way that each
4591
+ // change won't have to update the cursor and display (which would
4592
+ // be awkward, slow, and error-prone), but instead updates are
4593
+ // batched and then all combined and executed at once.
4594
+
4595
+ var nextOpId = 0;
4596
+ function startOperation(cm) {
4597
+ cm.curOp = {
4598
+ // An array of ranges of lines that have to be updated. See
4599
+ // updateDisplay.
4600
+ changes: [],
4601
+ forceUpdate: false,
4602
+ updateInput: null,
4603
+ userSelChange: null,
4604
+ textChanged: null,
4605
+ selectionChanged: false,
4606
+ cursorActivity: false,
4607
+ updateMaxLine: false,
4608
+ updateScrollPos: false,
4609
+ id: ++nextOpId
4610
+ };
4611
+ if (!delayedCallbackDepth++) delayedCallbacks = [];
4612
+ }
4613
+
4614
+ function endOperation(cm) {
4615
+ var op = cm.curOp, doc = cm.doc, display = cm.display;
4616
+ cm.curOp = null;
4617
+
4618
+ if (op.updateMaxLine) computeMaxLength(cm);
4619
+ if (display.maxLineChanged && !cm.options.lineWrapping && display.maxLine) {
4620
+ var width = measureLineWidth(cm, display.maxLine);
4621
+ display.sizer.style.minWidth = Math.max(0, width + 3) + "px";
4622
+ display.maxLineChanged = false;
4623
+ var maxScrollLeft = Math.max(0, display.sizer.offsetLeft + display.sizer.offsetWidth - display.scroller.clientWidth);
4624
+ if (maxScrollLeft < doc.scrollLeft && !op.updateScrollPos)
4625
+ setScrollLeft(cm, Math.min(display.scroller.scrollLeft, maxScrollLeft), true);
4626
+ }
4627
+ var newScrollPos, updated;
4628
+ if (op.updateScrollPos) {
4629
+ newScrollPos = op.updateScrollPos;
4630
+ } else if (op.selectionChanged && display.scroller.clientHeight) { // don't rescroll if not visible
4631
+ var coords = cursorCoords(cm, doc.sel.head);
4632
+ newScrollPos = calculateScrollPos(cm, coords.left, coords.top, coords.left, coords.bottom);
4633
+ }
4634
+ if (op.changes.length || op.forceUpdate || newScrollPos && newScrollPos.scrollTop != null) {
4635
+ updated = updateDisplay(cm, op.changes, newScrollPos && newScrollPos.scrollTop, op.forceUpdate);
4636
+ if (cm.display.scroller.offsetHeight) cm.doc.scrollTop = cm.display.scroller.scrollTop;
4637
+ }
4638
+ if (!updated && op.selectionChanged) updateSelection(cm);
4639
+ if (op.updateScrollPos) {
4640
+ var top = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, newScrollPos.scrollTop));
4641
+ var left = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, newScrollPos.scrollLeft));
4642
+ display.scroller.scrollTop = display.scrollbarV.scrollTop = doc.scrollTop = top;
4643
+ display.scroller.scrollLeft = display.scrollbarH.scrollLeft = doc.scrollLeft = left;
4644
+ alignHorizontally(cm);
4645
+ if (op.scrollToPos)
4646
+ scrollPosIntoView(cm, clipPos(cm.doc, op.scrollToPos.from),
4647
+ clipPos(cm.doc, op.scrollToPos.to), op.scrollToPos.margin);
4648
+ } else if (newScrollPos) {
4649
+ scrollCursorIntoView(cm);
4650
+ }
4651
+ if (op.selectionChanged) restartBlink(cm);
4652
+
4653
+ if (cm.state.focused && op.updateInput)
4654
+ resetInput(cm, op.userSelChange);
4655
+
4656
+ var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;
4657
+ if (hidden) for (var i = 0; i < hidden.length; ++i)
4658
+ if (!hidden[i].lines.length) signal(hidden[i], "hide");
4659
+ if (unhidden) for (var i = 0; i < unhidden.length; ++i)
4660
+ if (unhidden[i].lines.length) signal(unhidden[i], "unhide");
4661
+
4662
+ var delayed;
4663
+ if (!--delayedCallbackDepth) {
4664
+ delayed = delayedCallbacks;
4665
+ delayedCallbacks = null;
4666
+ }
4667
+ if (op.textChanged)
4668
+ signal(cm, "change", cm, op.textChanged);
4669
+ if (op.cursorActivity) signal(cm, "cursorActivity", cm);
4670
+ if (delayed) for (var i = 0; i < delayed.length; ++i) delayed[i]();
4671
+ }
4672
+
4673
+ // Wraps a function in an operation. Returns the wrapped function.
4674
+ function operation(cm1, f) {
4675
+ return function() {
4676
+ var cm = cm1 || this, withOp = !cm.curOp;
4677
+ if (withOp) startOperation(cm);
4678
+ try { var result = f.apply(cm, arguments); }
4679
+ finally { if (withOp) endOperation(cm); }
4680
+ return result;
4681
+ };
4682
+ }
4683
+ function docOperation(f) {
4684
+ return function() {
4685
+ var withOp = this.cm && !this.cm.curOp, result;
4686
+ if (withOp) startOperation(this.cm);
4687
+ try { result = f.apply(this, arguments); }
4688
+ finally { if (withOp) endOperation(this.cm); }
4689
+ return result;
4690
+ };
4691
+ }
4692
+ function runInOp(cm, f) {
4693
+ var withOp = !cm.curOp, result;
4694
+ if (withOp) startOperation(cm);
4695
+ try { result = f(); }
4696
+ finally { if (withOp) endOperation(cm); }
4697
+ return result;
4698
+ }
4699
+
4700
+ function regChange(cm, from, to, lendiff) {
4701
+ if (from == null) from = cm.doc.first;
4702
+ if (to == null) to = cm.doc.first + cm.doc.size;
4703
+ cm.curOp.changes.push({from: from, to: to, diff: lendiff});
4704
+ }
4705
+
4706
+ // INPUT HANDLING
4707
+
4708
+ function slowPoll(cm) {
4709
+ if (cm.display.pollingFast) return;
4710
+ cm.display.poll.set(cm.options.pollInterval, function() {
4711
+ readInput(cm);
4712
+ if (cm.state.focused) slowPoll(cm);
4713
+ });
4714
+ }
4715
+
4716
+ function fastPoll(cm) {
4717
+ var missed = false;
4718
+ cm.display.pollingFast = true;
4719
+ function p() {
4720
+ var changed = readInput(cm);
4721
+ if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}
4722
+ else {cm.display.pollingFast = false; slowPoll(cm);}
4723
+ }
4724
+ cm.display.poll.set(20, p);
4725
+ }
4726
+
4727
+ // prevInput is a hack to work with IME. If we reset the textarea
4728
+ // on every change, that breaks IME. So we look for changes
4729
+ // compared to the previous content instead. (Modern browsers have
4730
+ // events that indicate IME taking place, but these are not widely
4731
+ // supported or compatible enough yet to rely on.)
4732
+ function readInput(cm) {
4733
+ var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc, sel = doc.sel;
4734
+ if (!cm.state.focused || hasSelection(input) || isReadOnly(cm) || cm.options.disableInput) return false;
4735
+ if (cm.state.pasteIncoming && cm.state.fakedLastChar) {
4736
+ input.value = input.value.substring(0, input.value.length - 1);
4737
+ cm.state.fakedLastChar = false;
4738
+ }
4739
+ var text = input.value;
4740
+ if (text == prevInput && posEq(sel.from, sel.to)) return false;
4741
+ if (ie && !ie_lt9 && cm.display.inputHasSelection === text) {
4742
+ resetInput(cm, true);
4743
+ return false;
4744
+ }
4745
+
4746
+ var withOp = !cm.curOp;
4747
+ if (withOp) startOperation(cm);
4748
+ sel.shift = false;
4749
+ var same = 0, l = Math.min(prevInput.length, text.length);
4750
+ while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same;
4751
+ var from = sel.from, to = sel.to;
4752
+ var inserted = text.slice(same);
4753
+ if (same < prevInput.length)
4754
+ from = Pos(from.line, from.ch - (prevInput.length - same));
4755
+ else if (cm.state.overwrite && posEq(from, to) && !cm.state.pasteIncoming)
4756
+ to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + inserted.length));
4757
+
4758
+ var updateInput = cm.curOp.updateInput;
4759
+ var changeEvent = {from: from, to: to, text: splitLines(inserted),
4760
+ origin: cm.state.pasteIncoming ? "paste" : cm.state.cutIncoming ? "cut" : "+input"};
4761
+ makeChange(cm.doc, changeEvent, "end");
4762
+ cm.curOp.updateInput = updateInput;
4763
+ signalLater(cm, "inputRead", cm, changeEvent);
4764
+ if (inserted && !cm.state.pasteIncoming && cm.options.electricChars &&
4765
+ cm.options.smartIndent && sel.head.ch < 100) {
4766
+ var electric = cm.getModeAt(sel.head).electricChars;
4767
+ if (electric) for (var i = 0; i < electric.length; i++)
4768
+ if (inserted.indexOf(electric.charAt(i)) > -1) {
4769
+ indentLine(cm, sel.head.line, "smart");
4770
+ break;
4771
+ }
4772
+ }
4773
+
4774
+ if (text.length > 1000 || text.indexOf("\n") > -1) input.value = cm.display.prevInput = "";
4775
+ else cm.display.prevInput = text;
4776
+ if (withOp) endOperation(cm);
4777
+ cm.state.pasteIncoming = cm.state.cutIncoming = false;
4778
+ return true;
4779
+ }
4780
+
4781
+ function resetInput(cm, user) {
4782
+ var minimal, selected, doc = cm.doc;
4783
+ if (!posEq(doc.sel.from, doc.sel.to)) {
4784
+ cm.display.prevInput = "";
4785
+ minimal = hasCopyEvent &&
4786
+ (doc.sel.to.line - doc.sel.from.line > 100 || (selected = cm.getSelection()).length > 1000);
4787
+ var content = minimal ? "-" : selected || cm.getSelection();
4788
+ cm.display.input.value = content;
4789
+ if (cm.state.focused) selectInput(cm.display.input);
4790
+ if (ie && !ie_lt9) cm.display.inputHasSelection = content;
4791
+ } else if (user) {
4792
+ cm.display.prevInput = cm.display.input.value = "";
4793
+ if (ie && !ie_lt9) cm.display.inputHasSelection = null;
4794
+ }
4795
+ cm.display.inaccurateSelection = minimal;
4796
+ }
4797
+
4798
+ function focusInput(cm) {
4799
+ if (cm.options.readOnly != "nocursor" && (!mobile || document.activeElement != cm.display.input))
4800
+ cm.display.input.focus();
4801
+ }
4802
+
4803
+ function ensureFocus(cm) {
4804
+ if (!cm.state.focused) { focusInput(cm); onFocus(cm); }
4805
+ }
4806
+
4807
+ function isReadOnly(cm) {
4808
+ return cm.options.readOnly || cm.doc.cantEdit;
4809
+ }
4810
+
4811
+ // EVENT HANDLERS
4812
+
4813
+ function registerEventHandlers(cm) {
4814
+ var d = cm.display;
4815
+ on(d.scroller, "mousedown", operation(cm, onMouseDown));
4816
+ if (old_ie)
4817
+ on(d.scroller, "dblclick", operation(cm, function(e) {
4818
+ if (signalDOMEvent(cm, e)) return;
4819
+ var pos = posFromMouse(cm, e);
4820
+ if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;
4821
+ e_preventDefault(e);
4822
+ var word = findWordAt(getLine(cm.doc, pos.line).text, pos);
4823
+ extendSelection(cm.doc, word.from, word.to);
4824
+ }));
4825
+ else
4826
+ on(d.scroller, "dblclick", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });
4827
+ on(d.lineSpace, "selectstart", function(e) {
4828
+ if (!eventInWidget(d, e)) e_preventDefault(e);
4829
+ });
4830
+ // Gecko browsers fire contextmenu *after* opening the menu, at
4831
+ // which point we can't mess with it anymore. Context menu is
4832
+ // handled in onMouseDown for Gecko.
4833
+ if (!captureMiddleClick) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);});
4834
+
4835
+ on(d.scroller, "scroll", function() {
4836
+ if (d.scroller.clientHeight) {
4837
+ setScrollTop(cm, d.scroller.scrollTop);
4838
+ setScrollLeft(cm, d.scroller.scrollLeft, true);
4839
+ signal(cm, "scroll", cm);
4840
+ }
4841
+ });
4842
+ on(d.scrollbarV, "scroll", function() {
4843
+ if (d.scroller.clientHeight) setScrollTop(cm, d.scrollbarV.scrollTop);
4844
+ });
4845
+ on(d.scrollbarH, "scroll", function() {
4846
+ if (d.scroller.clientHeight) setScrollLeft(cm, d.scrollbarH.scrollLeft);
4847
+ });
4848
+
4849
+ on(d.scroller, "mousewheel", function(e){onScrollWheel(cm, e);});
4850
+ on(d.scroller, "DOMMouseScroll", function(e){onScrollWheel(cm, e);});
4851
+
4852
+ function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); }
4853
+ on(d.scrollbarH, "mousedown", reFocus);
4854
+ on(d.scrollbarV, "mousedown", reFocus);
4855
+ // Prevent wrapper from ever scrolling
4856
+ on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });
4857
+
4858
+ var resizeTimer;
4859
+ function onResize() {
4860
+ if (resizeTimer == null) resizeTimer = setTimeout(function() {
4861
+ resizeTimer = null;
4862
+ // Might be a text scaling operation, clear size caches.
4863
+ d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = knownScrollbarWidth = null;
4864
+ clearCaches(cm);
4865
+ runInOp(cm, bind(regChange, cm));
4866
+ }, 100);
4867
+ }
4868
+ on(window, "resize", onResize);
4869
+ // Above handler holds on to the editor and its data structures.
4870
+ // Here we poll to unregister it when the editor is no longer in
4871
+ // the document, so that it can be garbage-collected.
4872
+ function unregister() {
4873
+ for (var p = d.wrapper.parentNode; p && p != document.body; p = p.parentNode) {}
4874
+ if (p) setTimeout(unregister, 5000);
4875
+ else off(window, "resize", onResize);
4876
+ }
4877
+ setTimeout(unregister, 5000);
4878
+
4879
+ on(d.input, "keyup", operation(cm, onKeyUp));
4880
+ on(d.input, "input", function() {
4881
+ if (ie && !ie_lt9 && cm.display.inputHasSelection) cm.display.inputHasSelection = null;
4882
+ fastPoll(cm);
4883
+ });
4884
+ on(d.input, "keydown", operation(cm, onKeyDown));
4885
+ on(d.input, "keypress", operation(cm, onKeyPress));
4886
+ on(d.input, "focus", bind(onFocus, cm));
4887
+ on(d.input, "blur", bind(onBlur, cm));
4888
+
4889
+ function drag_(e) {
4890
+ if (signalDOMEvent(cm, e) || cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))) return;
4891
+ e_stop(e);
4892
+ }
4893
+ if (cm.options.dragDrop) {
4894
+ on(d.scroller, "dragstart", function(e){onDragStart(cm, e);});
4895
+ on(d.scroller, "dragenter", drag_);
4896
+ on(d.scroller, "dragover", drag_);
4897
+ on(d.scroller, "drop", operation(cm, onDrop));
4898
+ }
4899
+ on(d.scroller, "paste", function(e) {
4900
+ if (eventInWidget(d, e)) return;
4901
+ focusInput(cm);
4902
+ fastPoll(cm);
4903
+ });
4904
+ on(d.input, "paste", function() {
4905
+ // Workaround for webkit bug https://bugs.webkit.org/show_bug.cgi?id=90206
4906
+ // Add a char to the end of textarea before paste occur so that
4907
+ // selection doesn't span to the end of textarea.
4908
+ if (webkit && !cm.state.fakedLastChar && !(new Date - cm.state.lastMiddleDown < 200)) {
4909
+ var start = d.input.selectionStart, end = d.input.selectionEnd;
4910
+ d.input.value += "$";
4911
+ d.input.selectionStart = start;
4912
+ d.input.selectionEnd = end;
4913
+ cm.state.fakedLastChar = true;
4914
+ }
4915
+ cm.state.pasteIncoming = true;
4916
+ fastPoll(cm);
4917
+ });
4918
+
4919
+ function prepareCopy(e) {
4920
+ if (d.inaccurateSelection) {
4921
+ d.prevInput = "";
4922
+ d.inaccurateSelection = false;
4923
+ d.input.value = cm.getSelection();
4924
+ selectInput(d.input);
4925
+ }
4926
+ if (e.type == "cut") cm.state.cutIncoming = true;
4927
+ }
4928
+ on(d.input, "cut", prepareCopy);
4929
+ on(d.input, "copy", prepareCopy);
4930
+
4931
+ // Needed to handle Tab key in KHTML
4932
+ if (khtml) on(d.sizer, "mouseup", function() {
4933
+ if (document.activeElement == d.input) d.input.blur();
4934
+ focusInput(cm);
4935
+ });
4936
+ }
4937
+
4938
+ function eventInWidget(display, e) {
4939
+ for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {
4940
+ if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;
4941
+ }
4942
+ }
4943
+
4944
+ function posFromMouse(cm, e, liberal) {
4945
+ var display = cm.display;
4946
+ if (!liberal) {
4947
+ var target = e_target(e);
4948
+ if (target == display.scrollbarH || target == display.scrollbarH.firstChild ||
4949
+ target == display.scrollbarV || target == display.scrollbarV.firstChild ||
4950
+ target == display.scrollbarFiller || target == display.gutterFiller) return null;
4951
+ }
4952
+ var x, y, space = getRect(display.lineSpace);
4953
+ // Fails unpredictably on IE[67] when mouse is dragged around quickly.
4954
+ try { x = e.clientX; y = e.clientY; } catch (e) { return null; }
4955
+ return coordsChar(cm, x - space.left, y - space.top);
4956
+ }
4957
+
4958
+ var lastClick, lastDoubleClick;
4959
+ function onMouseDown(e) {
4960
+ if (signalDOMEvent(this, e)) return;
4961
+ var cm = this, display = cm.display, doc = cm.doc, sel = doc.sel;
4962
+ sel.shift = e.shiftKey;
4963
+
4964
+ if (eventInWidget(display, e)) {
4965
+ if (!webkit) {
4966
+ display.scroller.draggable = false;
4967
+ setTimeout(function(){display.scroller.draggable = true;}, 100);
4968
+ }
4969
+ return;
4970
+ }
4971
+ if (clickInGutter(cm, e)) return;
4972
+ var start = posFromMouse(cm, e);
4973
+ window.focus();
4974
+
4975
+ switch (e_button(e)) {
4976
+ case 3:
4977
+ if (captureMiddleClick) onContextMenu.call(cm, cm, e);
4978
+ return;
4979
+ case 2:
4980
+ if (webkit) cm.state.lastMiddleDown = +new Date;
4981
+ if (start) extendSelection(cm.doc, start);
4982
+ setTimeout(bind(focusInput, cm), 20);
4983
+ e_preventDefault(e);
4984
+ return;
4985
+ }
4986
+ // For button 1, if it was clicked inside the editor
4987
+ // (posFromMouse returning non-null), we have to adjust the
4988
+ // selection.
4989
+ if (!start) {if (e_target(e) == display.scroller) e_preventDefault(e); return;}
4990
+
4991
+ setTimeout(bind(ensureFocus, cm), 0);
4992
+
4993
+ var now = +new Date, type = "single";
4994
+ if (lastDoubleClick && lastDoubleClick.time > now - 400 && posEq(lastDoubleClick.pos, start)) {
4995
+ type = "triple";
4996
+ e_preventDefault(e);
4997
+ setTimeout(bind(focusInput, cm), 20);
4998
+ selectLine(cm, start.line);
4999
+ } else if (lastClick && lastClick.time > now - 400 && posEq(lastClick.pos, start)) {
5000
+ type = "double";
5001
+ lastDoubleClick = {time: now, pos: start};
5002
+ e_preventDefault(e);
5003
+ var word = findWordAt(getLine(doc, start.line).text, start);
5004
+ extendSelection(cm.doc, word.from, word.to);
5005
+ } else { lastClick = {time: now, pos: start}; }
5006
+
5007
+ var last = start;
5008
+ if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && !posEq(sel.from, sel.to) &&
5009
+ !posLess(start, sel.from) && !posLess(sel.to, start) && type == "single") {
5010
+ var dragEnd = operation(cm, function(e2) {
5011
+ if (webkit) display.scroller.draggable = false;
5012
+ cm.state.draggingText = false;
5013
+ off(document, "mouseup", dragEnd);
5014
+ off(display.scroller, "drop", dragEnd);
5015
+ if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) {
5016
+ e_preventDefault(e2);
5017
+ extendSelection(cm.doc, start);
5018
+ focusInput(cm);
5019
+ // Work around unexplainable focus problem in IE9 (#2127)
5020
+ if (old_ie && !ie_lt9)
5021
+ setTimeout(function() {document.body.focus(); focusInput(cm);}, 20);
5022
+ }
5023
+ });
5024
+ // Let the drag handler handle this.
5025
+ if (webkit) display.scroller.draggable = true;
5026
+ cm.state.draggingText = dragEnd;
5027
+ // IE's approach to draggable
5028
+ if (display.scroller.dragDrop) display.scroller.dragDrop();
5029
+ on(document, "mouseup", dragEnd);
5030
+ on(display.scroller, "drop", dragEnd);
5031
+ return;
5032
+ }
5033
+ e_preventDefault(e);
5034
+ if (type == "single") extendSelection(cm.doc, clipPos(doc, start));
5035
+
5036
+ var startstart = sel.from, startend = sel.to, lastPos = start;
5037
+
5038
+ function doSelect(cur) {
5039
+ if (posEq(lastPos, cur)) return;
5040
+ lastPos = cur;
5041
+
5042
+ if (type == "single") {
5043
+ extendSelection(cm.doc, clipPos(doc, start), cur);
5044
+ return;
5045
+ }
5046
+
5047
+ startstart = clipPos(doc, startstart);
5048
+ startend = clipPos(doc, startend);
5049
+ if (type == "double") {
5050
+ var word = findWordAt(getLine(doc, cur.line).text, cur);
5051
+ if (posLess(cur, startstart)) extendSelection(cm.doc, word.from, startend);
5052
+ else extendSelection(cm.doc, startstart, word.to);
5053
+ } else if (type == "triple") {
5054
+ if (posLess(cur, startstart)) extendSelection(cm.doc, startend, clipPos(doc, Pos(cur.line, 0)));
5055
+ else extendSelection(cm.doc, startstart, clipPos(doc, Pos(cur.line + 1, 0)));
5056
+ }
5057
+ }
5058
+
5059
+ var editorSize = getRect(display.wrapper);
5060
+ // Used to ensure timeout re-tries don't fire when another extend
5061
+ // happened in the meantime (clearTimeout isn't reliable -- at
5062
+ // least on Chrome, the timeouts still happen even when cleared,
5063
+ // if the clear happens after their scheduled firing time).
5064
+ var counter = 0;
5065
+
5066
+ function extend(e) {
5067
+ var curCount = ++counter;
5068
+ var cur = posFromMouse(cm, e, true);
5069
+ if (!cur) return;
5070
+ if (!posEq(cur, last)) {
5071
+ ensureFocus(cm);
5072
+ last = cur;
5073
+ doSelect(cur);
5074
+ var visible = visibleLines(display, doc);
5075
+ if (cur.line >= visible.to || cur.line < visible.from)
5076
+ setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);
5077
+ } else {
5078
+ var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;
5079
+ if (outside) setTimeout(operation(cm, function() {
5080
+ if (counter != curCount) return;
5081
+ display.scroller.scrollTop += outside;
5082
+ extend(e);
5083
+ }), 50);
5084
+ }
5085
+ }
5086
+
5087
+ function done(e) {
5088
+ counter = Infinity;
5089
+ e_preventDefault(e);
5090
+ focusInput(cm);
5091
+ off(document, "mousemove", move);
5092
+ off(document, "mouseup", up);
5093
+ }
5094
+
5095
+ var move = operation(cm, function(e) {
5096
+ if ((ie && !ie_lt10) ? !e.buttons : !e_button(e)) done(e);
5097
+ else extend(e);
5098
+ });
5099
+ var up = operation(cm, done);
5100
+ on(document, "mousemove", move);
5101
+ on(document, "mouseup", up);
5102
+ }
5103
+
5104
+ function gutterEvent(cm, e, type, prevent, signalfn) {
5105
+ try { var mX = e.clientX, mY = e.clientY; }
5106
+ catch(e) { return false; }
5107
+ if (mX >= Math.floor(getRect(cm.display.gutters).right)) return false;
5108
+ if (prevent) e_preventDefault(e);
5109
+
5110
+ var display = cm.display;
5111
+ var lineBox = getRect(display.lineDiv);
5112
+
5113
+ if (mY > lineBox.bottom || !hasHandler(cm, type)) return e_defaultPrevented(e);
5114
+ mY -= lineBox.top - display.viewOffset;
5115
+
5116
+ for (var i = 0; i < cm.options.gutters.length; ++i) {
5117
+ var g = display.gutters.childNodes[i];
5118
+ if (g && getRect(g).right >= mX) {
5119
+ var line = lineAtHeight(cm.doc, mY);
5120
+ var gutter = cm.options.gutters[i];
5121
+ signalfn(cm, type, cm, line, gutter, e);
5122
+ return e_defaultPrevented(e);
5123
+ }
5124
+ }
5125
+ }
5126
+
5127
+ function contextMenuInGutter(cm, e) {
5128
+ if (!hasHandler(cm, "gutterContextMenu")) return false;
5129
+ return gutterEvent(cm, e, "gutterContextMenu", false, signal);
5130
+ }
5131
+
5132
+ function clickInGutter(cm, e) {
5133
+ return gutterEvent(cm, e, "gutterClick", true, signalLater);
5134
+ }
5135
+
5136
+ // Kludge to work around strange IE behavior where it'll sometimes
5137
+ // re-fire a series of drag-related events right after the drop (#1551)
5138
+ var lastDrop = 0;
5139
+
5140
+ function onDrop(e) {
5141
+ var cm = this;
5142
+ if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e) || (cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))))
5143
+ return;
5144
+ e_preventDefault(e);
5145
+ if (ie) lastDrop = +new Date;
5146
+ var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;
5147
+ if (!pos || isReadOnly(cm)) return;
5148
+ if (files && files.length && window.FileReader && window.File) {
5149
+ var n = files.length, text = Array(n), read = 0;
5150
+ var loadFile = function(file, i) {
5151
+ var reader = new FileReader;
5152
+ reader.onload = function() {
5153
+ text[i] = reader.result;
5154
+ if (++read == n) {
5155
+ pos = clipPos(cm.doc, pos);
5156
+ makeChange(cm.doc, {from: pos, to: pos, text: splitLines(text.join("\n")), origin: "paste"}, "around");
5157
+ }
5158
+ };
5159
+ reader.readAsText(file);
5160
+ };
5161
+ for (var i = 0; i < n; ++i) loadFile(files[i], i);
5162
+ } else {
5163
+ // Don't do a replace if the drop happened inside of the selected text.
5164
+ if (cm.state.draggingText && !(posLess(pos, cm.doc.sel.from) || posLess(cm.doc.sel.to, pos))) {
5165
+ cm.state.draggingText(e);
5166
+ // Ensure the editor is re-focused
5167
+ setTimeout(bind(focusInput, cm), 20);
5168
+ return;
5169
+ }
5170
+ try {
5171
+ var text = e.dataTransfer.getData("Text");
5172
+ if (text) {
5173
+ var curFrom = cm.doc.sel.from, curTo = cm.doc.sel.to;
5174
+ setSelection(cm.doc, pos, pos);
5175
+ if (cm.state.draggingText) replaceRange(cm.doc, "", curFrom, curTo, "paste");
5176
+ cm.replaceSelection(text, null, "paste");
5177
+ focusInput(cm);
5178
+ }
5179
+ }
5180
+ catch(e){}
5181
+ }
5182
+ }
5183
+
5184
+ function onDragStart(cm, e) {
5185
+ if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; }
5186
+ if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return;
5187
+
5188
+ var txt = cm.getSelection();
5189
+ e.dataTransfer.setData("Text", txt);
5190
+
5191
+ // Use dummy image instead of default browsers image.
5192
+ // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.
5193
+ if (e.dataTransfer.setDragImage && !safari) {
5194
+ var img = elt("img", null, null, "position: fixed; left: 0; top: 0;");
5195
+ img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
5196
+ if (opera) {
5197
+ img.width = img.height = 1;
5198
+ cm.display.wrapper.appendChild(img);
5199
+ // Force a relayout, or Opera won't use our image for some obscure reason
5200
+ img._top = img.offsetTop;
5201
+ }
5202
+ e.dataTransfer.setDragImage(img, 0, 0);
5203
+ if (opera) img.parentNode.removeChild(img);
5204
+ }
5205
+ }
5206
+
5207
+ function setScrollTop(cm, val) {
5208
+ if (Math.abs(cm.doc.scrollTop - val) < 2) return;
5209
+ cm.doc.scrollTop = val;
5210
+ if (!gecko) updateDisplay(cm, [], val);
5211
+ if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val;
5212
+ if (cm.display.scrollbarV.scrollTop != val) cm.display.scrollbarV.scrollTop = val;
5213
+ if (gecko) updateDisplay(cm, []);
5214
+ startWorker(cm, 100);
5215
+ }
5216
+ function setScrollLeft(cm, val, isScroller) {
5217
+ if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) return;
5218
+ val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);
5219
+ cm.doc.scrollLeft = val;
5220
+ alignHorizontally(cm);
5221
+ if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val;
5222
+ if (cm.display.scrollbarH.scrollLeft != val) cm.display.scrollbarH.scrollLeft = val;
5223
+ }
5224
+
5225
+ // Since the delta values reported on mouse wheel events are
5226
+ // unstandardized between browsers and even browser versions, and
5227
+ // generally horribly unpredictable, this code starts by measuring
5228
+ // the scroll effect that the first few mouse wheel events have,
5229
+ // and, from that, detects the way it can convert deltas to pixel
5230
+ // offsets afterwards.
5231
+ //
5232
+ // The reason we want to know the amount a wheel event will scroll
5233
+ // is that it gives us a chance to update the display before the
5234
+ // actual scrolling happens, reducing flickering.
5235
+
5236
+ var wheelSamples = 0, wheelPixelsPerUnit = null;
5237
+ // Fill in a browser-detected starting value on browsers where we
5238
+ // know one. These don't have to be accurate -- the result of them
5239
+ // being wrong would just be a slight flicker on the first wheel
5240
+ // scroll (if it is large enough).
5241
+ if (ie) wheelPixelsPerUnit = -.53;
5242
+ else if (gecko) wheelPixelsPerUnit = 15;
5243
+ else if (chrome) wheelPixelsPerUnit = -.7;
5244
+ else if (safari) wheelPixelsPerUnit = -1/3;
5245
+
5246
+ function onScrollWheel(cm, e) {
5247
+ var dx = e.wheelDeltaX, dy = e.wheelDeltaY;
5248
+ if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail;
5249
+ if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail;
5250
+ else if (dy == null) dy = e.wheelDelta;
5251
+
5252
+ var display = cm.display, scroll = display.scroller;
5253
+ // Quit if there's nothing to scroll here
5254
+ if (!(dx && scroll.scrollWidth > scroll.clientWidth ||
5255
+ dy && scroll.scrollHeight > scroll.clientHeight)) return;
5256
+
5257
+ // Webkit browsers on OS X abort momentum scrolls when the target
5258
+ // of the scroll event is removed from the scrollable element.
5259
+ // This hack (see related code in patchDisplay) makes sure the
5260
+ // element is kept around.
5261
+ if (dy && mac && webkit) {
5262
+ for (var cur = e.target; cur != scroll; cur = cur.parentNode) {
5263
+ if (cur.lineObj) {
5264
+ cm.display.currentWheelTarget = cur;
5265
+ break;
5266
+ }
5267
+ }
5268
+ }
5269
+
5270
+ // On some browsers, horizontal scrolling will cause redraws to
5271
+ // happen before the gutter has been realigned, causing it to
5272
+ // wriggle around in a most unseemly way. When we have an
5273
+ // estimated pixels/delta value, we just handle horizontal
5274
+ // scrolling entirely here. It'll be slightly off from native, but
5275
+ // better than glitching out.
5276
+ if (dx && !gecko && !opera && wheelPixelsPerUnit != null) {
5277
+ if (dy)
5278
+ setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight)));
5279
+ setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth)));
5280
+ e_preventDefault(e);
5281
+ display.wheelStartX = null; // Abort measurement, if in progress
5282
+ return;
5283
+ }
5284
+
5285
+ if (dy && wheelPixelsPerUnit != null) {
5286
+ var pixels = dy * wheelPixelsPerUnit;
5287
+ var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;
5288
+ if (pixels < 0) top = Math.max(0, top + pixels - 50);
5289
+ else bot = Math.min(cm.doc.height, bot + pixels + 50);
5290
+ updateDisplay(cm, [], {top: top, bottom: bot});
5291
+ }
5292
+
5293
+ if (wheelSamples < 20) {
5294
+ if (display.wheelStartX == null) {
5295
+ display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;
5296
+ display.wheelDX = dx; display.wheelDY = dy;
5297
+ setTimeout(function() {
5298
+ if (display.wheelStartX == null) return;
5299
+ var movedX = scroll.scrollLeft - display.wheelStartX;
5300
+ var movedY = scroll.scrollTop - display.wheelStartY;
5301
+ var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||
5302
+ (movedX && display.wheelDX && movedX / display.wheelDX);
5303
+ display.wheelStartX = display.wheelStartY = null;
5304
+ if (!sample) return;
5305
+ wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);
5306
+ ++wheelSamples;
5307
+ }, 200);
5308
+ } else {
5309
+ display.wheelDX += dx; display.wheelDY += dy;
5310
+ }
5311
+ }
5312
+ }
5313
+
5314
+ function doHandleBinding(cm, bound, dropShift) {
5315
+ if (typeof bound == "string") {
5316
+ bound = commands[bound];
5317
+ if (!bound) return false;
5318
+ }
5319
+ // Ensure previous input has been read, so that the handler sees a
5320
+ // consistent view of the document
5321
+ if (cm.display.pollingFast && readInput(cm)) cm.display.pollingFast = false;
5322
+ var doc = cm.doc, prevShift = doc.sel.shift, done = false;
5323
+ try {
5324
+ if (isReadOnly(cm)) cm.state.suppressEdits = true;
5325
+ if (dropShift) doc.sel.shift = false;
5326
+ done = bound(cm) != Pass;
5327
+ } finally {
5328
+ doc.sel.shift = prevShift;
5329
+ cm.state.suppressEdits = false;
5330
+ }
5331
+ return done;
5332
+ }
5333
+
5334
+ function allKeyMaps(cm) {
5335
+ var maps = cm.state.keyMaps.slice(0);
5336
+ if (cm.options.extraKeys) maps.push(cm.options.extraKeys);
5337
+ maps.push(cm.options.keyMap);
5338
+ return maps;
5339
+ }
5340
+
5341
+ var maybeTransition;
5342
+ function handleKeyBinding(cm, e) {
5343
+ // Handle auto keymap transitions
5344
+ var startMap = getKeyMap(cm.options.keyMap), next = startMap.auto;
5345
+ clearTimeout(maybeTransition);
5346
+ if (next && !isModifierKey(e)) maybeTransition = setTimeout(function() {
5347
+ if (getKeyMap(cm.options.keyMap) == startMap) {
5348
+ cm.options.keyMap = (next.call ? next.call(null, cm) : next);
5349
+ keyMapChanged(cm);
5350
+ }
5351
+ }, 50);
5352
+
5353
+ var name = keyName(e, true), handled = false;
5354
+ if (!name) return false;
5355
+ var keymaps = allKeyMaps(cm);
5356
+
5357
+ if (e.shiftKey) {
5358
+ // First try to resolve full name (including 'Shift-'). Failing
5359
+ // that, see if there is a cursor-motion command (starting with
5360
+ // 'go') bound to the keyname without 'Shift-'.
5361
+ handled = lookupKey("Shift-" + name, keymaps, function(b) {return doHandleBinding(cm, b, true);})
5362
+ || lookupKey(name, keymaps, function(b) {
5363
+ if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion)
5364
+ return doHandleBinding(cm, b);
5365
+ });
5366
+ } else {
5367
+ handled = lookupKey(name, keymaps, function(b) { return doHandleBinding(cm, b); });
5368
+ }
5369
+
5370
+ if (handled) {
5371
+ e_preventDefault(e);
5372
+ restartBlink(cm);
5373
+ if (ie_lt9) { e.oldKeyCode = e.keyCode; e.keyCode = 0; }
5374
+ signalLater(cm, "keyHandled", cm, name, e);
5375
+ }
5376
+ return handled;
5377
+ }
5378
+
5379
+ function handleCharBinding(cm, e, ch) {
5380
+ var handled = lookupKey("'" + ch + "'", allKeyMaps(cm),
5381
+ function(b) { return doHandleBinding(cm, b, true); });
5382
+ if (handled) {
5383
+ e_preventDefault(e);
5384
+ restartBlink(cm);
5385
+ signalLater(cm, "keyHandled", cm, "'" + ch + "'", e);
5386
+ }
5387
+ return handled;
5388
+ }
5389
+
5390
+ function onKeyUp(e) {
5391
+ var cm = this;
5392
+ if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;
5393
+ if (e.keyCode == 16) cm.doc.sel.shift = false;
5394
+ }
5395
+
5396
+ var lastStoppedKey = null;
5397
+ function onKeyDown(e) {
5398
+ var cm = this;
5399
+ ensureFocus(cm);
5400
+ if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;
5401
+ if (old_ie && e.keyCode == 27) e.returnValue = false;
5402
+ var code = e.keyCode;
5403
+ // IE does strange things with escape.
5404
+ cm.doc.sel.shift = code == 16 || e.shiftKey;
5405
+ // First give onKeyEvent option a chance to handle this.
5406
+ var handled = handleKeyBinding(cm, e);
5407
+ if (opera) {
5408
+ lastStoppedKey = handled ? code : null;
5409
+ // Opera has no cut event... we try to at least catch the key combo
5410
+ if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))
5411
+ cm.replaceSelection("");
5412
+ }
5413
+ }
5414
+
5415
+ function onKeyPress(e) {
5416
+ var cm = this;
5417
+ if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;
5418
+ var keyCode = e.keyCode, charCode = e.charCode;
5419
+ if (opera && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;}
5420
+ if (((opera && (!e.which || e.which < 10)) || khtml) && handleKeyBinding(cm, e)) return;
5421
+ var ch = String.fromCharCode(charCode == null ? keyCode : charCode);
5422
+ if (handleCharBinding(cm, e, ch)) return;
5423
+ if (ie && !ie_lt9) cm.display.inputHasSelection = null;
5424
+ fastPoll(cm);
5425
+ }
5426
+
5427
+ function onFocus(cm) {
5428
+ if (cm.options.readOnly == "nocursor") return;
5429
+ if (!cm.state.focused) {
5430
+ signal(cm, "focus", cm);
5431
+ cm.state.focused = true;
5432
+ if (cm.display.wrapper.className.search(/\bCodeMirror-focused\b/) == -1)
5433
+ cm.display.wrapper.className += " CodeMirror-focused";
5434
+ if (!cm.curOp) {
5435
+ resetInput(cm, true);
5436
+ if (webkit) setTimeout(bind(resetInput, cm, true), 0); // Issue #1730
5437
+ }
5438
+ }
5439
+ slowPoll(cm);
5440
+ restartBlink(cm);
5441
+ }
5442
+ function onBlur(cm) {
5443
+ if (cm.state.focused) {
5444
+ signal(cm, "blur", cm);
5445
+ cm.state.focused = false;
5446
+ cm.display.wrapper.className = cm.display.wrapper.className.replace(" CodeMirror-focused", "");
5447
+ }
5448
+ clearInterval(cm.display.blinker);
5449
+ setTimeout(function() {if (!cm.state.focused) cm.doc.sel.shift = false;}, 150);
5450
+ }
5451
+
5452
+ var detectingSelectAll;
5453
+ function onContextMenu(cm, e) {
5454
+ if (signalDOMEvent(cm, e, "contextmenu")) return;
5455
+ var display = cm.display, sel = cm.doc.sel;
5456
+ if (eventInWidget(display, e) || contextMenuInGutter(cm, e)) return;
5457
+
5458
+ var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;
5459
+ if (!pos || opera) return; // Opera is difficult.
5460
+
5461
+ // Reset the current text selection only if the click is done outside of the selection
5462
+ // and 'resetSelectionOnContextMenu' option is true.
5463
+ var reset = cm.options.resetSelectionOnContextMenu;
5464
+ if (reset && (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to)))
5465
+ operation(cm, setSelection)(cm.doc, pos, pos);
5466
+
5467
+ var oldCSS = display.input.style.cssTex