Version Description
- Added: New Shortcodes! Fancy List and Column shortcodes
- Added: Added email confirmation support to Inbound Forms tool
- Added: Added New Welcome Page with Tutorial Video on Getting Started
- Added: New Debug Tab for faster support requests/debugging
- Fixed: CSS conflicts with button classes
Download this release
Release Info
Developer | DavidWells |
Plugin | WordPress Landing Pages |
Version | 1.3.5 |
Comparing to | |
See all releases |
Code changes from version 1.3.1 to 1.3.5
- README.md +169 -169
- css/admin-global-settings.css +204 -159
- css/admin-install-plugins.css +13 -0
- css/admin-landing-page-list.css +359 -359
- css/admin-lp-cpt-only-style.css +28 -0
- css/admin-post-edit.css +127 -127
- css/admin-post-new.css +84 -84
- css/admin-style.css +463 -433
- css/admin-tour.css +216 -216
- css/customizer.media-uploader.css +33 -33
- images/cta-install.png +0 -0
- images/github-help.jpg +0 -0
- images/image.php +56 -56
- images/leads-install.png +0 -0
- index.php +1 -1
- js/admin/admin.install-plugins.js +30 -0
- js/admin/admin.landing-page-list.js +159 -159
- js/admin/admin.metaboxes.js +1 -1
- js/admin/admin.post-edit-ab-testing.js +71 -71
- js/admin/admin.post-edit.js +568 -567
- js/admin/admin.post-new.js +138 -137
- js/admin/admin.store.js +4 -4
- js/admin/intro.js +758 -758
- js/jquery.bindfirst.js +14 -14
- js/jquery.easing.min.js +44 -44
- js/jquery.total-storage.min.js +21 -21
- js/libraries/isotope/css/style.css +752 -752
- js/libraries/isotope/jquery.isotope.js +1405 -1405
- js/libraries/isotope/jquery.isotope.min.js +10 -10
- js/libraries/isotope/js/fake-element.js +37 -37
- js/libraries/isotope/js/jquery-1.7.1.min.js +3 -3
- js/libraries/isotope/js/jquery.ba-bbq.min.js +17 -17
- js/libraries/isotope/js/jquery.infinitescroll.min.js +46 -46
- js/libraries/isotope/js/make-big-graph-projects.js +42 -42
- js/libraries/jquery-datepicker/jquery.timepicker.js +691 -691
- js/libraries/jquery-datepicker/lib/base.css +389 -389
- js/libraries/jquery-qtip/jquery.qtip.min.js +1 -1
- js/libraries/jquery-qtip/load.qtip.js +50 -50
- js/libraries/tiny_mce/plugins/autolink/editor_plugin_src.js +184 -184
- js/libraries/tiny_mce/plugins/autoresize/editor_plugin_src.js +119 -119
- js/libraries/tiny_mce/plugins/emotions/langs/en_dlg.js +1 -1
- js/libraries/tiny_mce/plugins/example_dependency/editor_plugin_src.js +50 -50
- js/libraries/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +90 -90
- js/libraries/tiny_mce/plugins/lists/editor_plugin_src.js +955 -955
- js/libraries/tiny_mce/plugins/media/langs/en_dlg.js +1 -1
- js/libraries/tiny_mce/plugins/preview/editor_plugin_src.js +52 -52
- js/libraries/tiny_mce/plugins/style/langs/en_dlg.js +1 -1
- js/libraries/tiny_mce/plugins/style/props.htm +845 -845
- js/libraries/tiny_mce/plugins/style/readme.txt +19 -19
- js/libraries/tiny_mce/plugins/tabfocus/editor_plugin_src.js +122 -122
- js/libraries/tiny_mce/plugins/table/editor_plugin_src.js +1452 -1452
- js/libraries/tiny_mce/themes/advanced/js/color_picker.js +345 -345
- js/libraries/tiny_mce/themes/advanced/langs/en_dlg.js +1 -1
- js/libraries/tiny_mce/tiny_mce_popup.js +4 -4
- landing-pages.php +87 -292
- libraries/class-tgm-plugin-activation.php +0 -511
README.md
CHANGED
@@ -1,169 +1,169 @@
|
|
1 |
-
landing-pages
|
2 |
-
=============
|
3 |
-
|
4 |
-
WordPress Landing Pages - Plugin
|
5 |
-
|
6 |
-
=== WordPress Landing Pages ===
|
7 |
-
|
8 |
-
Contributors: David Wells, adbox
|
9 |
-
Donate link: mailto:Hudson.Atwell@gmail.com
|
10 |
-
License: GPLv2 or later
|
11 |
-
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
-
Tags: landing pages, inbound marketing, conversion pages, split testing, a b test, a b testing, a/b test, a/b testing, coming soon page, email list, landing page, list building, maintenance page, squeeze page, inbound now, landing-pages, splash pages, cpa, click tracking, goal tracking, analytics
|
13 |
-
Requires at least: 3.3
|
14 |
-
Tested up to: 3.5
|
15 |
-
Stable Tag: 1.1.0.1
|
16 |
-
|
17 |
-
Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
|
18 |
-
|
19 |
-
== Description ==
|
20 |
-
|
21 |
-
This plugin creates landing pages (a.k.a. conversion or splash pages) for your WordPress site. It gives site owners the ability to monitor and track conversion rates, run a/b or multivariate split tests on landing pages, and most importantly increase lead flow!
|
22 |
-
|
23 |
-
The landing page plugin was specifically designed with inbound marketing best practices in mind and will help you drive & convert more leads on your site.
|
24 |
-
|
25 |
-
Landing pages are an ideal way to convert more of your passive website visitors into active leads or email list subscribers.
|
26 |
-
|
27 |
-
= Highlights =
|
28 |
-
|
29 |
-
* Create beautiful Landing Pages on your WordPress site.
|
30 |
-
* Visual Editor to view changes being made on the fly!
|
31 |
-
* Track conversion rates on your landing pages for continual optimization.
|
32 |
-
* Easily clone existing landing pages and run A/B Split tests on variations.
|
33 |
-
* Use your current WordPress theme or choose from our library of custom landing page designs.
|
34 |
-
* Pre-populate Forms with visitor information to increase conversion rates
|
35 |
-
* Gather lead intelligence and track lead activity with <a href="http://wordpress.org/plugins/leads/screenshots/">WordPress Leads</a>
|
36 |
-
* Extend functionality with our growing repository of <a href="http://www.inboundnow.com/market/category/landing-pages/extensions/">third party add ons</a>.
|
37 |
-
* Easily implement your own custom landing page design.
|
38 |
-
|
39 |
-
This plugin is form agnostic meaning it will work with any form system you use.
|
40 |
-
|
41 |
-
Recommended form plugins (Gravity forms, Ninja Forms or Contact form 7)
|
42 |
-
|
43 |
-
= About the Plugin =
|
44 |
-
|
45 |
-
http://www.youtube.com/watch?v=BzcD6PgvLP4
|
46 |
-
|
47 |
-
= Developers & Designers =
|
48 |
-
|
49 |
-
We built the landing page plugin as a framework! Need A/B testing out of the box implemented for your existing designs? Use WordPress Landing Pages to quickly spin up new landing pages that have all the functionality your clients will need.
|
50 |
-
|
51 |
-
You can quickly take your existing designs and implement them using our <a href="http://docs.inboundnow.com/landing-pages/dev">templating framework</a>.
|
52 |
-
|
53 |
-
The plugin is also fully extendable and has a number of actions, filters, and hooks available for use. If a hook doesn't exist, simply ask and we can implement custom changes.
|
54 |
-
|
55 |
-
== Installation ==
|
56 |
-
|
57 |
-
1. Upload `landing-pages` folder to the `/wp-content/plugins/` directory
|
58 |
-
1. Activate the plugin through the 'Plugins' menu in WordPress
|
59 |
-
|
60 |
-
== Frequently Asked Questions ==
|
61 |
-
*Can I create my own landing page designs?,
|
62 |
-
*Yes! You can learn how to <a href="http://docs.inboundnow.com/landing-pages/dev/creating-templates">create your own landing page template here</a>.
|
63 |
-
|
64 |
-
== Screenshots ==
|
65 |
-
|
66 |
-
1. Landing Page Custom Post Type
|
67 |
-
2. Track conversion rates and continuously improve your landing pages
|
68 |
-
3. Manage Split Testing Page
|
69 |
-
4. Choose from a ton of pre-made templates, use your existing design, or design your own theme!
|
70 |
-
|
71 |
-
== Changelog ==
|
72 |
-
|
73 |
-
= 1.1.0.1 =
|
74 |
-
|
75 |
-
* Fixed: Variation saves for custom css and custom js.
|
76 |
-
* Fixed: jQuery error related to wysiwyg content formatting.
|
77 |
-
|
78 |
-
= 1.0.9.9 =
|
79 |
-
* Improved extension metabox loading for quicker load times and optimized meta data storage.
|
80 |
-
* Phased out more 'old method' split testing components.
|
81 |
-
* Improved .htaccess parsing.
|
82 |
-
* Addressed issue with line breaks being removed from WYSIWYG editors.
|
83 |
-
|
84 |
-
= 1.0.9.4 =
|
85 |
-
* Added in tours for the edit screen and the list of landing page screen for new users to learn how to use the tool quickly and easily
|
86 |
-
* Updated conversion tracking for wp-leads addon plugin
|
87 |
-
* Added in option for default templates to toggle on/off navigation
|
88 |
-
|
89 |
-
= 1.0.9.3 =
|
90 |
-
|
91 |
-
* Removed old A/B split testing and the new system is fully in place!
|
92 |
-
|
93 |
-
= 1.0.9.0 =
|
94 |
-
|
95 |
-
* Added in A/B stats to the main landing page list view
|
96 |
-
|
97 |
-
= 1.0.8.6 =
|
98 |
-
|
99 |
-
* Release new and improved version of A/B testing!
|
100 |
-
* Ajax saving on landing page options for faster page edits
|
101 |
-
* Frontend Visual Editor to see what you are editing/changing
|
102 |
-
* Enabled frontend editor for use on normal pages and posts
|
103 |
-
|
104 |
-
= 1.0.8.5 =
|
105 |
-
|
106 |
-
Providing better conversion and impression tracking for landing pages that are set as homepage.
|
107 |
-
|
108 |
-
= 1.0.8.4 =
|
109 |
-
|
110 |
-
Fixing activation bug
|
111 |
-
|
112 |
-
= 1.0.8.1 =
|
113 |
-
|
114 |
-
Fixing issue with jquery submission errors.
|
115 |
-
|
116 |
-
= 1.0.7.9 =
|
117 |
-
|
118 |
-
Added capability to activate and update license keys for premium extensions. Added ability to define white listed HTML elements for Form Standardization process.
|
119 |
-
|
120 |
-
= 1.0.7.3 =
|
121 |
-
|
122 |
-
Fixed issue with WP_List_table causing posts to to save or edit propperly Attempt 001
|
123 |
-
|
124 |
-
= 1.0.7.1 =
|
125 |
-
|
126 |
-
Added cookie based auto-field population & lead data collection to core.
|
127 |
-
|
128 |
-
= 1.0.5.6 =
|
129 |
-
|
130 |
-
Fixed issue with global setting's radio buttons not holding new set values.
|
131 |
-
|
132 |
-
= 1.0.5.3 =
|
133 |
-
|
134 |
-
Solutions for custom post type wp rewrite issue on activation.
|
135 |
-
|
136 |
-
= 1.0.5.1 =
|
137 |
-
|
138 |
-
Introducing version control system for extensions.
|
139 |
-
|
140 |
-
= 1.0.4.4 =
|
141 |
-
|
142 |
-
Migrating store to new location. Updating version control systems
|
143 |
-
|
144 |
-
= 1.0.4.2 =
|
145 |
-
|
146 |
-
Added new defitions to form standardization parser. Limited .htaccess rewrites to plugin activation to try and mitigate .htaccess corruptions.
|
147 |
-
|
148 |
-
= 1.0.4.1 =
|
149 |
-
|
150 |
-
Fixed issue with conversions not recording on some servers by forcing form submittal to wait until ajax has completely finnished loading before continuing to process form.
|
151 |
-
|
152 |
-
= 1.0.3.9 =
|
153 |
-
|
154 |
-
Fixed issue with plugins and wp core refusing to update on some installations when landing page plugin is activated.
|
155 |
-
|
156 |
-
= 1.0.3.8 =
|
157 |
-
|
158 |
-
Debugging cross browser impressions and conversion tracking. Implemented soltion for url-to-postid conversions that's compatible with the /slug/ removal extension for landing pages plugin.
|
159 |
-
Added email validation check to prevent false positives when form standardization is turned on.
|
160 |
-
|
161 |
-
= 1.0.3.7 =
|
162 |
-
|
163 |
-
Bug Fix: 'Clear Stats' button.
|
164 |
-
|
165 |
-
= 1.1 =
|
166 |
-
|
167 |
-
Released
|
168 |
-
|
169 |
-
|
1 |
+
landing-pages
|
2 |
+
=============
|
3 |
+
|
4 |
+
WordPress Landing Pages - Plugin
|
5 |
+
|
6 |
+
=== WordPress Landing Pages ===
|
7 |
+
|
8 |
+
Contributors: David Wells, adbox
|
9 |
+
Donate link: mailto:Hudson.Atwell@gmail.com
|
10 |
+
License: GPLv2 or later
|
11 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
Tags: landing pages, inbound marketing, conversion pages, split testing, a b test, a b testing, a/b test, a/b testing, coming soon page, email list, landing page, list building, maintenance page, squeeze page, inbound now, landing-pages, splash pages, cpa, click tracking, goal tracking, analytics
|
13 |
+
Requires at least: 3.3
|
14 |
+
Tested up to: 3.5
|
15 |
+
Stable Tag: 1.1.0.1
|
16 |
+
|
17 |
+
Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
|
18 |
+
|
19 |
+
== Description ==
|
20 |
+
|
21 |
+
This plugin creates landing pages (a.k.a. conversion or splash pages) for your WordPress site. It gives site owners the ability to monitor and track conversion rates, run a/b or multivariate split tests on landing pages, and most importantly increase lead flow!
|
22 |
+
|
23 |
+
The landing page plugin was specifically designed with inbound marketing best practices in mind and will help you drive & convert more leads on your site.
|
24 |
+
|
25 |
+
Landing pages are an ideal way to convert more of your passive website visitors into active leads or email list subscribers.
|
26 |
+
|
27 |
+
= Highlights =
|
28 |
+
|
29 |
+
* Create beautiful Landing Pages on your WordPress site.
|
30 |
+
* Visual Editor to view changes being made on the fly!
|
31 |
+
* Track conversion rates on your landing pages for continual optimization.
|
32 |
+
* Easily clone existing landing pages and run A/B Split tests on variations.
|
33 |
+
* Use your current WordPress theme or choose from our library of custom landing page designs.
|
34 |
+
* Pre-populate Forms with visitor information to increase conversion rates
|
35 |
+
* Gather lead intelligence and track lead activity with <a href="http://wordpress.org/plugins/leads/screenshots/">WordPress Leads</a>
|
36 |
+
* Extend functionality with our growing repository of <a href="http://www.inboundnow.com/market/category/landing-pages/extensions/">third party add ons</a>.
|
37 |
+
* Easily implement your own custom landing page design.
|
38 |
+
|
39 |
+
This plugin is form agnostic meaning it will work with any form system you use.
|
40 |
+
|
41 |
+
Recommended form plugins (Gravity forms, Ninja Forms or Contact form 7)
|
42 |
+
|
43 |
+
= About the Plugin =
|
44 |
+
|
45 |
+
http://www.youtube.com/watch?v=BzcD6PgvLP4
|
46 |
+
|
47 |
+
= Developers & Designers =
|
48 |
+
|
49 |
+
We built the landing page plugin as a framework! Need A/B testing out of the box implemented for your existing designs? Use WordPress Landing Pages to quickly spin up new landing pages that have all the functionality your clients will need.
|
50 |
+
|
51 |
+
You can quickly take your existing designs and implement them using our <a href="http://docs.inboundnow.com/landing-pages/dev">templating framework</a>.
|
52 |
+
|
53 |
+
The plugin is also fully extendable and has a number of actions, filters, and hooks available for use. If a hook doesn't exist, simply ask and we can implement custom changes.
|
54 |
+
|
55 |
+
== Installation ==
|
56 |
+
|
57 |
+
1. Upload `landing-pages` folder to the `/wp-content/plugins/` directory
|
58 |
+
1. Activate the plugin through the 'Plugins' menu in WordPress
|
59 |
+
|
60 |
+
== Frequently Asked Questions ==
|
61 |
+
*Can I create my own landing page designs?,
|
62 |
+
*Yes! You can learn how to <a href="http://docs.inboundnow.com/landing-pages/dev/creating-templates">create your own landing page template here</a>.
|
63 |
+
|
64 |
+
== Screenshots ==
|
65 |
+
|
66 |
+
1. Landing Page Custom Post Type
|
67 |
+
2. Track conversion rates and continuously improve your landing pages
|
68 |
+
3. Manage Split Testing Page
|
69 |
+
4. Choose from a ton of pre-made templates, use your existing design, or design your own theme!
|
70 |
+
|
71 |
+
== Changelog ==
|
72 |
+
|
73 |
+
= 1.1.0.1 =
|
74 |
+
|
75 |
+
* Fixed: Variation saves for custom css and custom js.
|
76 |
+
* Fixed: jQuery error related to wysiwyg content formatting.
|
77 |
+
|
78 |
+
= 1.0.9.9 =
|
79 |
+
* Improved extension metabox loading for quicker load times and optimized meta data storage.
|
80 |
+
* Phased out more 'old method' split testing components.
|
81 |
+
* Improved .htaccess parsing.
|
82 |
+
* Addressed issue with line breaks being removed from WYSIWYG editors.
|
83 |
+
|
84 |
+
= 1.0.9.4 =
|
85 |
+
* Added in tours for the edit screen and the list of landing page screen for new users to learn how to use the tool quickly and easily
|
86 |
+
* Updated conversion tracking for wp-leads addon plugin
|
87 |
+
* Added in option for default templates to toggle on/off navigation
|
88 |
+
|
89 |
+
= 1.0.9.3 =
|
90 |
+
|
91 |
+
* Removed old A/B split testing and the new system is fully in place!
|
92 |
+
|
93 |
+
= 1.0.9.0 =
|
94 |
+
|
95 |
+
* Added in A/B stats to the main landing page list view
|
96 |
+
|
97 |
+
= 1.0.8.6 =
|
98 |
+
|
99 |
+
* Release new and improved version of A/B testing!
|
100 |
+
* Ajax saving on landing page options for faster page edits
|
101 |
+
* Frontend Visual Editor to see what you are editing/changing
|
102 |
+
* Enabled frontend editor for use on normal pages and posts
|
103 |
+
|
104 |
+
= 1.0.8.5 =
|
105 |
+
|
106 |
+
Providing better conversion and impression tracking for landing pages that are set as homepage.
|
107 |
+
|
108 |
+
= 1.0.8.4 =
|
109 |
+
|
110 |
+
Fixing activation bug
|
111 |
+
|
112 |
+
= 1.0.8.1 =
|
113 |
+
|
114 |
+
Fixing issue with jquery submission errors.
|
115 |
+
|
116 |
+
= 1.0.7.9 =
|
117 |
+
|
118 |
+
Added capability to activate and update license keys for premium extensions. Added ability to define white listed HTML elements for Form Standardization process.
|
119 |
+
|
120 |
+
= 1.0.7.3 =
|
121 |
+
|
122 |
+
Fixed issue with WP_List_table causing posts to to save or edit propperly Attempt 001
|
123 |
+
|
124 |
+
= 1.0.7.1 =
|
125 |
+
|
126 |
+
Added cookie based auto-field population & lead data collection to core.
|
127 |
+
|
128 |
+
= 1.0.5.6 =
|
129 |
+
|
130 |
+
Fixed issue with global setting's radio buttons not holding new set values.
|
131 |
+
|
132 |
+
= 1.0.5.3 =
|
133 |
+
|
134 |
+
Solutions for custom post type wp rewrite issue on activation.
|
135 |
+
|
136 |
+
= 1.0.5.1 =
|
137 |
+
|
138 |
+
Introducing version control system for extensions.
|
139 |
+
|
140 |
+
= 1.0.4.4 =
|
141 |
+
|
142 |
+
Migrating store to new location. Updating version control systems
|
143 |
+
|
144 |
+
= 1.0.4.2 =
|
145 |
+
|
146 |
+
Added new defitions to form standardization parser. Limited .htaccess rewrites to plugin activation to try and mitigate .htaccess corruptions.
|
147 |
+
|
148 |
+
= 1.0.4.1 =
|
149 |
+
|
150 |
+
Fixed issue with conversions not recording on some servers by forcing form submittal to wait until ajax has completely finnished loading before continuing to process form.
|
151 |
+
|
152 |
+
= 1.0.3.9 =
|
153 |
+
|
154 |
+
Fixed issue with plugins and wp core refusing to update on some installations when landing page plugin is activated.
|
155 |
+
|
156 |
+
= 1.0.3.8 =
|
157 |
+
|
158 |
+
Debugging cross browser impressions and conversion tracking. Implemented soltion for url-to-postid conversions that's compatible with the /slug/ removal extension for landing pages plugin.
|
159 |
+
Added email validation check to prevent false positives when form standardization is turned on.
|
160 |
+
|
161 |
+
= 1.0.3.7 =
|
162 |
+
|
163 |
+
Bug Fix: 'Clear Stats' button.
|
164 |
+
|
165 |
+
= 1.1 =
|
166 |
+
|
167 |
+
Released
|
168 |
+
|
169 |
+
|
css/admin-global-settings.css
CHANGED
@@ -1,160 +1,205 @@
|
|
1 |
-
|
2 |
-
.nav-tab-special-inactive{
|
3 |
-
border-color: #DFDFDF #DFDFDF #FFFFFF;
|
4 |
-
border-top-left-radius: 3px;
|
5 |
-
border-top-right-radius: 3px;
|
6 |
-
border-width: 1px 1px 0;
|
7 |
-
color: #AAAAAA;
|
8 |
-
display: inline-block;
|
9 |
-
font-size: 12px;
|
10 |
-
line-height: 16px;
|
11 |
-
margin: 0 6px -1px 0;
|
12 |
-
padding: 4px 14px 6px;
|
13 |
-
text-decoration: none;
|
14 |
-
text-shadow: 0 1px 0 #FFFFFF;
|
15 |
-
cursor:pointer;
|
16 |
-
}
|
17 |
-
|
18 |
-
.nav-tab-special-active{
|
19 |
-
border-color: #DFDFDF #DFDFDF #FFFFFF !important;
|
20 |
-
border-top-left-radius: 3px;
|
21 |
-
border-top-right-radius: 3px;
|
22 |
-
border-width: 1px 1px 1px;
|
23 |
-
color: #000;
|
24 |
-
display: inline-block;
|
25 |
-
font-size: 12px;
|
26 |
-
line-height: 16px;
|
27 |
-
margin: 0 6px -1px 0;
|
28 |
-
padding: 4px 14px 6px;
|
29 |
-
text-decoration: none;
|
30 |
-
text-shadow: 0 1px 0 #FFFFFF;
|
31 |
-
cursor:pointer;
|
32 |
-
background: white;
|
33 |
-
|
34 |
-
}
|
35 |
-
|
36 |
-
.lp-tab-display textarea {
|
37 |
-
width:
|
38 |
-
}
|
39 |
-
.lp-tab-display {
|
40 |
-
width: 70%;
|
41 |
-
}
|
42 |
-
|
43 |
-
.lp-settings-tab-sidebar {
|
44 |
-
float: right;
|
45 |
-
width: 26%; }
|
46 |
-
|
47 |
-
.lp-sidebar-settings {
|
48 |
-
background: #f2f2f2 url('/wp-content/plugins/landing-pages/images/gradient.png') repeat-x top left;
|
49 |
-
border: 1px solid #EBEBEA;
|
50 |
-
-webkit-box-shadow: inset 1px 1px 1px #f9f9f9;
|
51 |
-
-moz-box-shadow: inset 1px 1px 1px #f9f9f9;
|
52 |
-
box-shadow: inset 1px 1px 1px #f9f9f9;
|
53 |
-
padding: 15px 15px 15px;
|
54 |
-
margin-bottom: 20px;
|
55 |
-
margin-right: 20px;
|
56 |
-
}
|
57 |
-
.lp-sidebar-settings .review-button {
|
58 |
-
background: #94BA65 url('/wp-content/plugins/landing-pages/images/gradient.png') repeat-x top left;
|
59 |
-
border: 1px solid rgba(0,0,0,0.15);
|
60 |
-
-webkit-border-radius: 2px;
|
61 |
-
-moz-border-radius: 2px;
|
62 |
-
border-radius: 2px;
|
63 |
-
-webkit-box-shadow: 0px 2px 3px rgba(0,0,0,0.15), inset 1px 1px 1px rgba(255,255,255,0.2);
|
64 |
-
-moz-box-shadow: 0px 2px 3px rgba(0,0,0,0.15), inset 1px 1px 1px rgba(255,255,255,0.2);
|
65 |
-
box-shadow: 0px 2px 3px rgba(0,0,0,0.15), inset 1px 1px 1px rgba(255,255,255,0.2);
|
66 |
-
color: #fff;
|
67 |
-
cursor: pointer;
|
68 |
-
display: inline-block;
|
69 |
-
font-family: inherit;
|
70 |
-
font-size: 22px;
|
71 |
-
font-weight: bold;
|
72 |
-
text-decoration: none;
|
73 |
-
padding: 8px 15px;
|
74 |
-
margin-top: 5px;
|
75 |
-
margin-bottom: 5px;
|
76 |
-
text-shadow: -1px -1px 1px rgba(0,0,0,0.15);
|
77 |
-
}
|
78 |
-
.lp-sidebar-settings h2 {
|
79 |
-
font-size: 21px;
|
80 |
-
line-height: 24px;
|
81 |
-
margin: 0px 0px 5px;
|
82 |
-
text-shadow: 1px 1px 1px #fff; }
|
83 |
-
.lp-sidebar-settings small {
|
84 |
-
display: block;
|
85 |
-
margin-top: 5px;
|
86 |
-
}
|
87 |
-
.lp-sidebar-settings input[type="image"] {
|
88 |
-
margin: auto;
|
89 |
-
margin-left: 90px;
|
90 |
-
}
|
91 |
-
#lp-additional-resources {
|
92 |
-
padding-top: 15px;
|
93 |
-
margin-left: 10px;
|
94 |
-
}
|
95 |
-
#lp-additional-resources hr {
|
96 |
-
margin-bottom: 15px;
|
97 |
-
margin-left: -29px;
|
98 |
-
color: rgb(233, 233, 233);
|
99 |
-
opacity: .7;
|
100 |
-
border: 1px solid;
|
101 |
-
}
|
102 |
-
#lp-wordpress-site-status {
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
{
|
130 |
-
|
131 |
-
}
|
132 |
-
.
|
133 |
-
|
134 |
-
|
135 |
-
}
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
}
|
1 |
+
|
2 |
+
.nav-tab-special-inactive{
|
3 |
+
border-color: #DFDFDF #DFDFDF #FFFFFF;
|
4 |
+
border-top-left-radius: 3px;
|
5 |
+
border-top-right-radius: 3px;
|
6 |
+
border-width: 1px 1px 0;
|
7 |
+
color: #AAAAAA;
|
8 |
+
display: inline-block;
|
9 |
+
font-size: 12px;
|
10 |
+
line-height: 16px;
|
11 |
+
margin: 0 6px -1px 0;
|
12 |
+
padding: 4px 14px 6px;
|
13 |
+
text-decoration: none;
|
14 |
+
text-shadow: 0 1px 0 #FFFFFF;
|
15 |
+
cursor:pointer;
|
16 |
+
}
|
17 |
+
|
18 |
+
.nav-tab-special-active{
|
19 |
+
border-color: #DFDFDF #DFDFDF #FFFFFF !important;
|
20 |
+
border-top-left-radius: 3px;
|
21 |
+
border-top-right-radius: 3px;
|
22 |
+
border-width: 1px 1px 1px;
|
23 |
+
color: #000;
|
24 |
+
display: inline-block;
|
25 |
+
font-size: 12px;
|
26 |
+
line-height: 16px;
|
27 |
+
margin: 0 6px -1px 0;
|
28 |
+
padding: 4px 14px 6px;
|
29 |
+
text-decoration: none;
|
30 |
+
text-shadow: 0 1px 0 #FFFFFF;
|
31 |
+
cursor:pointer;
|
32 |
+
background: white;
|
33 |
+
|
34 |
+
}
|
35 |
+
|
36 |
+
.lp-tab-display textarea {
|
37 |
+
width:90%;
|
38 |
+
}
|
39 |
+
.lp-tab-display {
|
40 |
+
width: 70%;
|
41 |
+
}
|
42 |
+
|
43 |
+
.lp-settings-tab-sidebar {
|
44 |
+
float: right;
|
45 |
+
width: 26%; }
|
46 |
+
|
47 |
+
.lp-sidebar-settings {
|
48 |
+
background: #f2f2f2 url('/wp-content/plugins/landing-pages/images/gradient.png') repeat-x top left;
|
49 |
+
border: 1px solid #EBEBEA;
|
50 |
+
-webkit-box-shadow: inset 1px 1px 1px #f9f9f9;
|
51 |
+
-moz-box-shadow: inset 1px 1px 1px #f9f9f9;
|
52 |
+
box-shadow: inset 1px 1px 1px #f9f9f9;
|
53 |
+
padding: 15px 15px 15px;
|
54 |
+
margin-bottom: 20px;
|
55 |
+
margin-right: 20px;
|
56 |
+
}
|
57 |
+
.lp-sidebar-settings .review-button {
|
58 |
+
background: #94BA65 url('/wp-content/plugins/landing-pages/images/gradient.png') repeat-x top left;
|
59 |
+
border: 1px solid rgba(0,0,0,0.15);
|
60 |
+
-webkit-border-radius: 2px;
|
61 |
+
-moz-border-radius: 2px;
|
62 |
+
border-radius: 2px;
|
63 |
+
-webkit-box-shadow: 0px 2px 3px rgba(0,0,0,0.15), inset 1px 1px 1px rgba(255,255,255,0.2);
|
64 |
+
-moz-box-shadow: 0px 2px 3px rgba(0,0,0,0.15), inset 1px 1px 1px rgba(255,255,255,0.2);
|
65 |
+
box-shadow: 0px 2px 3px rgba(0,0,0,0.15), inset 1px 1px 1px rgba(255,255,255,0.2);
|
66 |
+
color: #fff;
|
67 |
+
cursor: pointer;
|
68 |
+
display: inline-block;
|
69 |
+
font-family: inherit;
|
70 |
+
font-size: 22px;
|
71 |
+
font-weight: bold;
|
72 |
+
text-decoration: none;
|
73 |
+
padding: 8px 15px;
|
74 |
+
margin-top: 5px;
|
75 |
+
margin-bottom: 5px;
|
76 |
+
text-shadow: -1px -1px 1px rgba(0,0,0,0.15);
|
77 |
+
}
|
78 |
+
.lp-sidebar-settings h2 {
|
79 |
+
font-size: 21px;
|
80 |
+
line-height: 24px;
|
81 |
+
margin: 0px 0px 5px;
|
82 |
+
text-shadow: 1px 1px 1px #fff; }
|
83 |
+
.lp-sidebar-settings small {
|
84 |
+
display: block;
|
85 |
+
margin-top: 5px;
|
86 |
+
}
|
87 |
+
.lp-sidebar-settings input[type="image"] {
|
88 |
+
margin: auto;
|
89 |
+
margin-left: 90px;
|
90 |
+
}
|
91 |
+
#lp-additional-resources {
|
92 |
+
padding-top: 15px;
|
93 |
+
margin-left: 10px;
|
94 |
+
}
|
95 |
+
#lp-additional-resources hr {
|
96 |
+
margin-bottom: 15px;
|
97 |
+
margin-left: -29px;
|
98 |
+
color: rgb(233, 233, 233);
|
99 |
+
opacity: .7;
|
100 |
+
border: 1px solid;
|
101 |
+
}
|
102 |
+
#lp-wordpress-site-status {
|
103 |
+
|
104 |
+
color: #000;
|
105 |
+
}
|
106 |
+
#php-sql-lp-version h3{
|
107 |
+
color: #000;
|
108 |
+
margin-bottom: 0px;
|
109 |
+
margin-top: 0px;
|
110 |
+
padding-top: 0px;
|
111 |
+
font-size: 1.5em;
|
112 |
+
}
|
113 |
+
#sys-inbound-form {
|
114 |
+
display: none;
|
115 |
+
}
|
116 |
+
#sys-inbound-form h2 {
|
117 |
+
display: inline-block;
|
118 |
+
}
|
119 |
+
#inbound-download-sysinfo {
|
120 |
+
margin-left: 12px;
|
121 |
+
}
|
122 |
+
.lp-tab-display #php-sql-lp-version th {
|
123 |
+
padding: 10px;
|
124 |
+
padding-left: 0px;
|
125 |
+
}
|
126 |
+
#lp-main {
|
127 |
+
padding-top: 0px;
|
128 |
+
}
|
129 |
+
#copy-inbound-info {
|
130 |
+
min-height: 400px;
|
131 |
+
}
|
132 |
+
.nav-tab-wrapper {
|
133 |
+
margin-left: -19px;
|
134 |
+
padding-left: 40px;
|
135 |
+
}
|
136 |
+
#lp-main h4, h3.lp_global_settings_header {
|
137 |
+
margin-top: 0px;
|
138 |
+
padding-top: 0px;
|
139 |
+
padding-top: 0px;
|
140 |
+
font-family: "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;
|
141 |
+
font-weight: 400;
|
142 |
+
line-height: 1.6em;
|
143 |
+
font-size: 20px;
|
144 |
+
padding-bottom: 0px;
|
145 |
+
margin-bottom: 5px;
|
146 |
+
}
|
147 |
+
#htaccess-contents {
|
148 |
+
margin-top: 20px;
|
149 |
+
}
|
150 |
+
#more-templates , #more-addons, #custom-templates {
|
151 |
+
width: 29%;
|
152 |
+
display: inline-block;
|
153 |
+
background: #FCFDFE;
|
154 |
+
padding: 5px;
|
155 |
+
margin-right: 10px;
|
156 |
+
border: 1px solid #E0E0E0;
|
157 |
+
-moz-border-radius: 7px;
|
158 |
+
border-radius: 7px;
|
159 |
+
overflow: hidden;
|
160 |
+
position: relative;
|
161 |
+
}
|
162 |
+
#more-templates img, #more-addons img, #custom-templates img {
|
163 |
+
margin: auto;
|
164 |
+
}
|
165 |
+
#php-sql-lp-version {
|
166 |
+
display:block;
|
167 |
+
}
|
168 |
+
.lp-tab-display
|
169 |
+
{
|
170 |
+
padding:13px;
|
171 |
+
}
|
172 |
+
|
173 |
+
.lp-tab-display td
|
174 |
+
{
|
175 |
+
padding:10px;
|
176 |
+
}
|
177 |
+
.lp-tab-display th
|
178 |
+
{
|
179 |
+
padding:10px;
|
180 |
+
}
|
181 |
+
|
182 |
+
.lp-tab-display th,.lp-tab-display .lp-gs-th
|
183 |
+
{
|
184 |
+
width:300px;
|
185 |
+
font-size: 14px;
|
186 |
+
font-weight:300px;
|
187 |
+
text-align:left;
|
188 |
+
}
|
189 |
+
|
190 |
+
.lp_license_status_invalid{
|
191 |
+
display:inline;
|
192 |
+
padding-left:10px;
|
193 |
+
color:red;
|
194 |
+
font-style:italic;
|
195 |
+
}
|
196 |
+
|
197 |
+
.lp_license_status_valid{
|
198 |
+
display:inline;
|
199 |
+
padding-left:10px;
|
200 |
+
color:green;
|
201 |
+
font-style:italic;
|
202 |
+
}
|
203 |
+
#php-sql-lp-version {
|
204 |
+
display: none;
|
205 |
}
|
css/admin-install-plugins.css
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#the-list .inbound-install-notice, #the-list .inbound-install-notice-links, .click-to-activate, .click-to-activate-bulk {
|
2 |
+
display: none;
|
3 |
+
}
|
4 |
+
.click-to-activate, .click-to-activate-bulk {
|
5 |
+
vertical-align: top !important;
|
6 |
+
padding-top: 0px !important;
|
7 |
+
}
|
8 |
+
.click-to-activate span, .click-to-activate-bulk span {
|
9 |
+
color: #04A204;
|
10 |
+
padding-right: 10px;
|
11 |
+
font-size: 40px;
|
12 |
+
text-shadow: none;
|
13 |
+
}
|
css/admin-landing-page-list.css
CHANGED
@@ -1,360 +1,360 @@
|
|
1 |
-
/* CSS for Landing Page List */
|
2 |
-
#stats {
|
3 |
-
width: 270px;
|
4 |
-
}
|
5 |
-
|
6 |
-
#thumbnail-lander {
|
7 |
-
width: 132px;
|
8 |
-
}
|
9 |
-
|
10 |
-
#title {
|
11 |
-
width: 255px;
|
12 |
-
}
|
13 |
-
|
14 |
-
#impressions, #cr, #actions {
|
15 |
-
width: 99px;
|
16 |
-
text-align: center;
|
17 |
-
}
|
18 |
-
|
19 |
-
#cr {
|
20 |
-
width: 120px;
|
21 |
-
}
|
22 |
-
#cb {
|
23 |
-
width: 20px;
|
24 |
-
}
|
25 |
-
.clear_stats {
|
26 |
-
color: red;
|
27 |
-
}
|
28 |
-
.hover-description {
|
29 |
-
display: block;
|
30 |
-
color: grey;
|
31 |
-
font-size: 10px;
|
32 |
-
font-style: italic;
|
33 |
-
}
|
34 |
-
.lp-pop-description {
|
35 |
-
padding: 10px;
|
36 |
-
padding-left: 4px;
|
37 |
-
padding-top: 6px;
|
38 |
-
}
|
39 |
-
.lp-bottom-controls {
|
40 |
-
margin-left: 12px;
|
41 |
-
color: red;
|
42 |
-
font-size: 12px;
|
43 |
-
margin-right: 8px;
|
44 |
-
}
|
45 |
-
.lp-delete-var-stats {
|
46 |
-
display: inline-block;
|
47 |
-
}
|
48 |
-
.lp-pop-description {
|
49 |
-
display: block;
|
50 |
-
max-width: 325px;
|
51 |
-
}
|
52 |
-
|
53 |
-
.lp-pop-close {
|
54 |
-
font-size: 11px;
|
55 |
-
position: absolute;
|
56 |
-
font-weight: 100;
|
57 |
-
right: 10px;
|
58 |
-
top: 3px;
|
59 |
-
}
|
60 |
-
|
61 |
-
.winner-lp {
|
62 |
-
background-color: #E2FFC9;
|
63 |
-
}
|
64 |
-
|
65 |
-
.lp-pop-edit a{
|
66 |
-
color:#fff;
|
67 |
-
}
|
68 |
-
|
69 |
-
.lp-extra {
|
70 |
-
margin-left: 10px;
|
71 |
-
}
|
72 |
-
|
73 |
-
.lp-win {
|
74 |
-
color: green;
|
75 |
-
font-size: 14px;
|
76 |
-
font-weight: bold;
|
77 |
-
text-shadow: 1px 1px 1px rgba(255,255,255,0.5);
|
78 |
-
}
|
79 |
-
|
80 |
-
.lp-paused {
|
81 |
-
color: red;
|
82 |
-
font-size: 12px;
|
83 |
-
}
|
84 |
-
|
85 |
-
.lp-pop-controls {
|
86 |
-
display: inline-block;
|
87 |
-
margin-top: 8px;
|
88 |
-
}
|
89 |
-
|
90 |
-
.lp-pop-edit {
|
91 |
-
display: inline-block !important;
|
92 |
-
margin-right: 11px !important;
|
93 |
-
margin-left: 5px !important;
|
94 |
-
}
|
95 |
-
|
96 |
-
.qtip {
|
97 |
-
background: #fff;
|
98 |
-
}
|
99 |
-
|
100 |
-
.qtip-tip {
|
101 |
-
height: 10px !important;
|
102 |
-
}
|
103 |
-
|
104 |
-
.qtip-content, .lp-pop-description, .lp-pop-preview a {
|
105 |
-
color:#333;
|
106 |
-
|
107 |
-
}
|
108 |
-
|
109 |
-
.lp-pop-preview a, .lp-pop-edit a {
|
110 |
-
text-decoration: none;
|
111 |
-
}
|
112 |
-
|
113 |
-
.qtip-titlebar
|
114 |
-
{
|
115 |
-
position: relative;
|
116 |
-
padding: 0px;
|
117 |
-
}
|
118 |
-
|
119 |
-
.qtip-jtools
|
120 |
-
{
|
121 |
-
border: 2px solid rgba(172, 172, 172, 1);
|
122 |
-
}
|
123 |
-
|
124 |
-
.qtip-title {
|
125 |
-
position: relative;
|
126 |
-
margin: 0 0 5px;
|
127 |
-
padding: 12px 17px 14px 14px;
|
128 |
-
line-height: 19px;
|
129 |
-
font-size: 19px;
|
130 |
-
color: #fff;
|
131 |
-
text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
|
132 |
-
background: #8cc1e9;
|
133 |
-
background-image: -webkit-gradient(linear,left bottom,left top,from(#72a7cf),to(#8cc1e9));
|
134 |
-
background-image: -webkit-linear-gradient(bottom,#72a7cf,#8cc1e9);
|
135 |
-
background-image: -moz-linear-gradient(bottom,#72a7cf,#8cc1e9);
|
136 |
-
background-image: -o-linear-gradient(bottom,#72a7cf,#8cc1e9);
|
137 |
-
background-image: linear-gradient(to top,#72a7cf,#8cc1e9);
|
138 |
-
}
|
139 |
-
.stats li {
|
140 |
-
border-bottom: 1px solid #EBEBEA;
|
141 |
-
padding: 6px 20px;
|
142 |
-
margin: 0;
|
143 |
-
font-size: 13px;
|
144 |
-
vertical-align: top;
|
145 |
-
padding-left: 5px;
|
146 |
-
padding-right: 5px;
|
147 |
-
}
|
148 |
-
|
149 |
-
.stats li:hover
|
150 |
-
{
|
151 |
-
background:#e0e0e0;
|
152 |
-
}
|
153 |
-
|
154 |
-
.wp-list-table td.stats .show-stats, .show-stats, .variation-winner-is {
|
155 |
-
display: none;
|
156 |
-
}
|
157 |
-
|
158 |
-
.wp-list-table td.stats .show-stats {
|
159 |
-
margin-top: 10px;
|
160 |
-
padding-top: 0px;
|
161 |
-
margin-left: 4px;
|
162 |
-
position: absolute;
|
163 |
-
}
|
164 |
-
|
165 |
-
td.stats.column-stats {
|
166 |
-
border: 1px solid #EBEBEA;
|
167 |
-
|
168 |
-
}
|
169 |
-
|
170 |
-
.wp-list-table td.stats {
|
171 |
-
padding-left: 0px;
|
172 |
-
padding-right: 0px;
|
173 |
-
}
|
174 |
-
|
175 |
-
.lp-current-winner{
|
176 |
-
background-color: rgb(226, 255, 201);
|
177 |
-
}
|
178 |
-
|
179 |
-
#impressions span, #cr span, #actions span {
|
180 |
-
text-align: center;
|
181 |
-
float: none;
|
182 |
-
}
|
183 |
-
|
184 |
-
.lp-varation-stat-ul {
|
185 |
-
min-width: 270px;
|
186 |
-
}
|
187 |
-
|
188 |
-
.status-0 {
|
189 |
-
background-color: #F9DBDB !important;
|
190 |
-
font-weight: normal;
|
191 |
-
color: rgb(117, 117, 117) !important;
|
192 |
-
}
|
193 |
-
|
194 |
-
.wp-list-table td.impressions, .wp-list-table td.actions, .wp-list-table td.cr{
|
195 |
-
font-size: 18px;
|
196 |
-
color: #000;
|
197 |
-
margin: 0;
|
198 |
-
text-align: center;
|
199 |
-
padding-top: 15px;
|
200 |
-
border-right: 1px solid #EBEBEA;
|
201 |
-
}
|
202 |
-
|
203 |
-
.wp-list-table td.cr {
|
204 |
-
}
|
205 |
-
|
206 |
-
.row-title {
|
207 |
-
font-size: 15px!important;
|
208 |
-
margin-top: 2px !important;
|
209 |
-
display: inline-block;
|
210 |
-
}
|
211 |
-
|
212 |
-
.wp-list-table td.actions {
|
213 |
-
}
|
214 |
-
.post-state .states{
|
215 |
-
font-size:10px;
|
216 |
-
padding:3px 8px 3px 8px;
|
217 |
-
-moz-border-radius:2px;
|
218 |
-
-webkit-border-radius:2px;
|
219 |
-
border-radius:2px;
|
220 |
-
}
|
221 |
-
.post-state .password{background:#000;color:#fff;}
|
222 |
-
.post-state .pending{background:#83CF21 !important;color:#fff;}
|
223 |
-
.post-state .private{background:#E0A21B;color:#fff;}
|
224 |
-
.post-state .draft{background:#006699;color:#fff;}
|
225 |
-
#hide-stats, .show-stats-top {
|
226 |
-
color: #21759b;
|
227 |
-
font-size: 9px;
|
228 |
-
padding-left: 10px;
|
229 |
-
}
|
230 |
-
|
231 |
-
.stats li:last-child{
|
232 |
-
border-bottom: none;
|
233 |
-
}
|
234 |
-
|
235 |
-
.no-stats-yet {
|
236 |
-
padding-left: 7px;
|
237 |
-
padding-top: 6px;
|
238 |
-
color: #777;
|
239 |
-
font-size: 11px;
|
240 |
-
display: none;
|
241 |
-
}
|
242 |
-
|
243 |
-
.widefat td.stats {
|
244 |
-
border-top: none;
|
245 |
-
padding-top: 0px;
|
246 |
-
}
|
247 |
-
|
248 |
-
.widefat td.stats ul {
|
249 |
-
font-size: 12px;
|
250 |
-
border-top: none;
|
251 |
-
width: 100%;
|
252 |
-
border-bottom: none;
|
253 |
-
margin-bottom: -2px;
|
254 |
-
padding-bottom: 0px;
|
255 |
-
display: inline-block;
|
256 |
-
}
|
257 |
-
.lp-numbers {
|
258 |
-
font-size: 13px;
|
259 |
-
min-width: 199px;
|
260 |
-
display: inline-block;
|
261 |
-
}
|
262 |
-
.introjs-showElement .row-actions {
|
263 |
-
visibility: visible;}
|
264 |
-
.lp-impress-num {
|
265 |
-
display: inline-block;
|
266 |
-
text-align: center;
|
267 |
-
min-width: 30px;
|
268 |
-
padding-right: 5px;
|
269 |
-
padding-left: 5px;
|
270 |
-
}
|
271 |
-
|
272 |
-
.lp-no-stats {
|
273 |
-
display: inline-block;
|
274 |
-
padding-left: 10px;
|
275 |
-
color: #ccc;
|
276 |
-
}
|
277 |
-
|
278 |
-
.lp-impress-num, .lp-con-num, .cr-number {
|
279 |
-
font-weight: bold;
|
280 |
-
font-size: 19px;
|
281 |
-
}
|
282 |
-
|
283 |
-
.visit-text {
|
284 |
-
display: inline-block;
|
285 |
-
min-width: 60px;
|
286 |
-
}
|
287 |
-
|
288 |
-
.lp-con-num {
|
289 |
-
display: inline-block;
|
290 |
-
padding-left: 4px;
|
291 |
-
padding-right: 4px;
|
292 |
-
}
|
293 |
-
|
294 |
-
.lp-letter, .cr-number, .cr-number.cr-empty-0 {
|
295 |
-
display: inline-block;
|
296 |
-
|
297 |
-
font-size: 20px;
|
298 |
-
min-width: 16px;
|
299 |
-
min-height: 20px;
|
300 |
-
border-radius: 3px;
|
301 |
-
background: #f3f3f3;
|
302 |
-
background-image: -webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#f4f4f4));
|
303 |
-
background-image: -webkit-linear-gradient(top,#fefefe,#f4f4f4);
|
304 |
-
background-image: -moz-linear-gradient(top,#fefefe,#f4f4f4);
|
305 |
-
background-image: -o-linear-gradient(top,#fefefe,#f4f4f4);
|
306 |
-
background-image: linear-gradient(to bottom,#fefefe,#f4f4f4);
|
307 |
-
border-color: #bbb;
|
308 |
-
color: #333;
|
309 |
-
text-shadow: 0 1px 0 #fff;
|
310 |
-
font-family: sans-serif;
|
311 |
-
cursor: pointer;
|
312 |
-
border-width: 1px;
|
313 |
-
border-style: solid;
|
314 |
-
padding: 1px;
|
315 |
-
padding-left: 4px;
|
316 |
-
text-align: center;
|
317 |
-
padding-right: 5px;
|
318 |
-
padding-top: 6px;
|
319 |
-
margin-right: 5px;
|
320 |
-
}
|
321 |
-
|
322 |
-
.cr-number {
|
323 |
-
margin-left: 5px;
|
324 |
-
padding-left: 5px;
|
325 |
-
background-color: #21759b;
|
326 |
-
background-image: -webkit-gradient(linear,left top,left bottom,from(#2a95c5),to(#21759b));
|
327 |
-
background-image: -webkit-linear-gradient(top,#2a95c5,#21759b);
|
328 |
-
background-image: -moz-linear-gradient(top,#2a95c5,#21759b);
|
329 |
-
background-image: -ms-linear-gradient(top,#2a95c5,#21759b);
|
330 |
-
background-image: -o-linear-gradient(top,#2a95c5,#21759b);
|
331 |
-
background-image: linear-gradient(to bottom,#2a95c5,#21759b);
|
332 |
-
border-color: #21759b;
|
333 |
-
border-bottom-color: #1e6a8d;
|
334 |
-
-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
|
335 |
-
box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
|
336 |
-
color: #fff;
|
337 |
-
text-shadow: 0 1px 0 rgba(0,0,0,0.1);
|
338 |
-
font-weight: normal;
|
339 |
-
margin-right: 0px !important;
|
340 |
-
}
|
341 |
-
.cr-number.cr-empty-0 {
|
342 |
-
font-weight: normal !important;
|
343 |
-
color: #ccc;
|
344 |
-
box-shadow: none;
|
345 |
-
-webkit-box-shadow: none;
|
346 |
-
}
|
347 |
-
a.cr-number:hover {
|
348 |
-
background-color: #278ab7;
|
349 |
-
background-image: -webkit-gradient(linear,left top,left bottom,from(#2e9fd2),to(#21759b));
|
350 |
-
background-image: -webkit-linear-gradient(top,#2e9fd2,#21759b);
|
351 |
-
background-image: -moz-linear-gradient(top,#2e9fd2,#21759b);
|
352 |
-
background-image: -ms-linear-gradient(top,#2e9fd2,#21759b);
|
353 |
-
background-image: -o-linear-gradient(top,#2e9fd2,#21759b);
|
354 |
-
background-image: linear-gradient(to bottom,#2e9fd2,#21759b);
|
355 |
-
border-color: #1b607f;
|
356 |
-
-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
|
357 |
-
box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
|
358 |
-
color: #fff;
|
359 |
-
text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
|
360 |
}
|
1 |
+
/* CSS for Landing Page List */
|
2 |
+
#stats {
|
3 |
+
width: 270px;
|
4 |
+
}
|
5 |
+
|
6 |
+
#thumbnail-lander {
|
7 |
+
width: 132px;
|
8 |
+
}
|
9 |
+
|
10 |
+
#title {
|
11 |
+
width: 255px;
|
12 |
+
}
|
13 |
+
|
14 |
+
#impressions, #cr, #actions {
|
15 |
+
width: 99px;
|
16 |
+
text-align: center;
|
17 |
+
}
|
18 |
+
|
19 |
+
#cr {
|
20 |
+
width: 120px;
|
21 |
+
}
|
22 |
+
#cb {
|
23 |
+
width: 20px;
|
24 |
+
}
|
25 |
+
.clear_stats {
|
26 |
+
color: red;
|
27 |
+
}
|
28 |
+
.hover-description {
|
29 |
+
display: block;
|
30 |
+
color: grey;
|
31 |
+
font-size: 10px;
|
32 |
+
font-style: italic;
|
33 |
+
}
|
34 |
+
.lp-pop-description {
|
35 |
+
padding: 10px;
|
36 |
+
padding-left: 4px;
|
37 |
+
padding-top: 6px;
|
38 |
+
}
|
39 |
+
.lp-bottom-controls {
|
40 |
+
margin-left: 12px;
|
41 |
+
color: red;
|
42 |
+
font-size: 12px;
|
43 |
+
margin-right: 8px;
|
44 |
+
}
|
45 |
+
.lp-delete-var-stats {
|
46 |
+
display: inline-block;
|
47 |
+
}
|
48 |
+
.lp-pop-description {
|
49 |
+
display: block;
|
50 |
+
max-width: 325px;
|
51 |
+
}
|
52 |
+
|
53 |
+
.lp-pop-close {
|
54 |
+
font-size: 11px;
|
55 |
+
position: absolute;
|
56 |
+
font-weight: 100;
|
57 |
+
right: 10px;
|
58 |
+
top: 3px;
|
59 |
+
}
|
60 |
+
|
61 |
+
.winner-lp {
|
62 |
+
background-color: #E2FFC9;
|
63 |
+
}
|
64 |
+
|
65 |
+
.lp-pop-edit a{
|
66 |
+
color:#fff;
|
67 |
+
}
|
68 |
+
|
69 |
+
.lp-extra {
|
70 |
+
margin-left: 10px;
|
71 |
+
}
|
72 |
+
|
73 |
+
.lp-win {
|
74 |
+
color: green;
|
75 |
+
font-size: 14px;
|
76 |
+
font-weight: bold;
|
77 |
+
text-shadow: 1px 1px 1px rgba(255,255,255,0.5);
|
78 |
+
}
|
79 |
+
|
80 |
+
.lp-paused {
|
81 |
+
color: red;
|
82 |
+
font-size: 12px;
|
83 |
+
}
|
84 |
+
|
85 |
+
.lp-pop-controls {
|
86 |
+
display: inline-block;
|
87 |
+
margin-top: 8px;
|
88 |
+
}
|
89 |
+
|
90 |
+
.lp-pop-edit {
|
91 |
+
display: inline-block !important;
|
92 |
+
margin-right: 11px !important;
|
93 |
+
margin-left: 5px !important;
|
94 |
+
}
|
95 |
+
|
96 |
+
.qtip {
|
97 |
+
background: #fff;
|
98 |
+
}
|
99 |
+
|
100 |
+
.qtip-tip {
|
101 |
+
height: 10px !important;
|
102 |
+
}
|
103 |
+
|
104 |
+
.qtip-content, .lp-pop-description, .lp-pop-preview a {
|
105 |
+
color:#333;
|
106 |
+
|
107 |
+
}
|
108 |
+
|
109 |
+
.lp-pop-preview a, .lp-pop-edit a {
|
110 |
+
text-decoration: none;
|
111 |
+
}
|
112 |
+
|
113 |
+
.qtip-titlebar
|
114 |
+
{
|
115 |
+
position: relative;
|
116 |
+
padding: 0px;
|
117 |
+
}
|
118 |
+
|
119 |
+
.qtip-jtools
|
120 |
+
{
|
121 |
+
border: 2px solid rgba(172, 172, 172, 1);
|
122 |
+
}
|
123 |
+
|
124 |
+
.qtip-title {
|
125 |
+
position: relative;
|
126 |
+
margin: 0 0 5px;
|
127 |
+
padding: 12px 17px 14px 14px;
|
128 |
+
line-height: 19px;
|
129 |
+
font-size: 19px;
|
130 |
+
color: #fff;
|
131 |
+
text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
|
132 |
+
background: #8cc1e9;
|
133 |
+
background-image: -webkit-gradient(linear,left bottom,left top,from(#72a7cf),to(#8cc1e9));
|
134 |
+
background-image: -webkit-linear-gradient(bottom,#72a7cf,#8cc1e9);
|
135 |
+
background-image: -moz-linear-gradient(bottom,#72a7cf,#8cc1e9);
|
136 |
+
background-image: -o-linear-gradient(bottom,#72a7cf,#8cc1e9);
|
137 |
+
background-image: linear-gradient(to top,#72a7cf,#8cc1e9);
|
138 |
+
}
|
139 |
+
.stats li {
|
140 |
+
border-bottom: 1px solid #EBEBEA;
|
141 |
+
padding: 6px 20px;
|
142 |
+
margin: 0;
|
143 |
+
font-size: 13px;
|
144 |
+
vertical-align: top;
|
145 |
+
padding-left: 5px;
|
146 |
+
padding-right: 5px;
|
147 |
+
}
|
148 |
+
|
149 |
+
.stats li:hover
|
150 |
+
{
|
151 |
+
background:#e0e0e0;
|
152 |
+
}
|
153 |
+
|
154 |
+
.wp-list-table td.stats .show-stats, .show-stats, .variation-winner-is {
|
155 |
+
display: none;
|
156 |
+
}
|
157 |
+
|
158 |
+
.wp-list-table td.stats .show-stats {
|
159 |
+
margin-top: 10px;
|
160 |
+
padding-top: 0px;
|
161 |
+
margin-left: 4px;
|
162 |
+
position: absolute;
|
163 |
+
}
|
164 |
+
|
165 |
+
td.stats.column-stats {
|
166 |
+
border: 1px solid #EBEBEA;
|
167 |
+
|
168 |
+
}
|
169 |
+
|
170 |
+
.wp-list-table td.stats {
|
171 |
+
padding-left: 0px;
|
172 |
+
padding-right: 0px;
|
173 |
+
}
|
174 |
+
|
175 |
+
.lp-current-winner{
|
176 |
+
background-color: rgb(226, 255, 201);
|
177 |
+
}
|
178 |
+
|
179 |
+
#impressions span, #cr span, #actions span {
|
180 |
+
text-align: center;
|
181 |
+
float: none;
|
182 |
+
}
|
183 |
+
|
184 |
+
.lp-varation-stat-ul {
|
185 |
+
min-width: 270px;
|
186 |
+
}
|
187 |
+
|
188 |
+
.status-0 {
|
189 |
+
background-color: #F9DBDB !important;
|
190 |
+
font-weight: normal;
|
191 |
+
color: rgb(117, 117, 117) !important;
|
192 |
+
}
|
193 |
+
|
194 |
+
.wp-list-table td.impressions, .wp-list-table td.actions, .wp-list-table td.cr{
|
195 |
+
font-size: 18px;
|
196 |
+
color: #000;
|
197 |
+
margin: 0;
|
198 |
+
text-align: center;
|
199 |
+
padding-top: 15px;
|
200 |
+
border-right: 1px solid #EBEBEA;
|
201 |
+
}
|
202 |
+
|
203 |
+
.wp-list-table td.cr {
|
204 |
+
}
|
205 |
+
|
206 |
+
.row-title {
|
207 |
+
font-size: 15px!important;
|
208 |
+
margin-top: 2px !important;
|
209 |
+
display: inline-block;
|
210 |
+
}
|
211 |
+
|
212 |
+
.wp-list-table td.actions {
|
213 |
+
}
|
214 |
+
.post-state .states{
|
215 |
+
font-size:10px;
|
216 |
+
padding:3px 8px 3px 8px;
|
217 |
+
-moz-border-radius:2px;
|
218 |
+
-webkit-border-radius:2px;
|
219 |
+
border-radius:2px;
|
220 |
+
}
|
221 |
+
.post-state .password{background:#000;color:#fff;}
|
222 |
+
.post-state .pending{background:#83CF21 !important;color:#fff;}
|
223 |
+
.post-state .private{background:#E0A21B;color:#fff;}
|
224 |
+
.post-state .draft{background:#006699;color:#fff;}
|
225 |
+
#hide-stats, .show-stats-top {
|
226 |
+
color: #21759b;
|
227 |
+
font-size: 9px;
|
228 |
+
padding-left: 10px;
|
229 |
+
}
|
230 |
+
|
231 |
+
.stats li:last-child{
|
232 |
+
border-bottom: none;
|
233 |
+
}
|
234 |
+
|
235 |
+
.no-stats-yet {
|
236 |
+
padding-left: 7px;
|
237 |
+
padding-top: 6px;
|
238 |
+
color: #777;
|
239 |
+
font-size: 11px;
|
240 |
+
display: none;
|
241 |
+
}
|
242 |
+
|
243 |
+
.widefat td.stats {
|
244 |
+
border-top: none;
|
245 |
+
padding-top: 0px;
|
246 |
+
}
|
247 |
+
|
248 |
+
.widefat td.stats ul {
|
249 |
+
font-size: 12px;
|
250 |
+
border-top: none;
|
251 |
+
width: 100%;
|
252 |
+
border-bottom: none;
|
253 |
+
margin-bottom: -2px;
|
254 |
+
padding-bottom: 0px;
|
255 |
+
display: inline-block;
|
256 |
+
}
|
257 |
+
.lp-numbers {
|
258 |
+
font-size: 13px;
|
259 |
+
min-width: 199px;
|
260 |
+
display: inline-block;
|
261 |
+
}
|
262 |
+
.introjs-showElement .row-actions {
|
263 |
+
visibility: visible;}
|
264 |
+
.lp-impress-num {
|
265 |
+
display: inline-block;
|
266 |
+
text-align: center;
|
267 |
+
min-width: 30px;
|
268 |
+
padding-right: 5px;
|
269 |
+
padding-left: 5px;
|
270 |
+
}
|
271 |
+
|
272 |
+
.lp-no-stats {
|
273 |
+
display: inline-block;
|
274 |
+
padding-left: 10px;
|
275 |
+
color: #ccc;
|
276 |
+
}
|
277 |
+
|
278 |
+
.lp-impress-num, .lp-con-num, .cr-number {
|
279 |
+
font-weight: bold;
|
280 |
+
font-size: 19px;
|
281 |
+
}
|
282 |
+
|
283 |
+
.visit-text {
|
284 |
+
display: inline-block;
|
285 |
+
min-width: 60px;
|
286 |
+
}
|
287 |
+
|
288 |
+
.lp-con-num {
|
289 |
+
display: inline-block;
|
290 |
+
padding-left: 4px;
|
291 |
+
padding-right: 4px;
|
292 |
+
}
|
293 |
+
|
294 |
+
.lp-letter, .cr-number, .cr-number.cr-empty-0 {
|
295 |
+
display: inline-block;
|
296 |
+
|
297 |
+
font-size: 20px;
|
298 |
+
min-width: 16px;
|
299 |
+
min-height: 20px;
|
300 |
+
border-radius: 3px;
|
301 |
+
background: #f3f3f3;
|
302 |
+
background-image: -webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#f4f4f4));
|
303 |
+
background-image: -webkit-linear-gradient(top,#fefefe,#f4f4f4);
|
304 |
+
background-image: -moz-linear-gradient(top,#fefefe,#f4f4f4);
|
305 |
+
background-image: -o-linear-gradient(top,#fefefe,#f4f4f4);
|
306 |
+
background-image: linear-gradient(to bottom,#fefefe,#f4f4f4);
|
307 |
+
border-color: #bbb;
|
308 |
+
color: #333;
|
309 |
+
text-shadow: 0 1px 0 #fff;
|
310 |
+
font-family: sans-serif;
|
311 |
+
cursor: pointer;
|
312 |
+
border-width: 1px;
|
313 |
+
border-style: solid;
|
314 |
+
padding: 1px;
|
315 |
+
padding-left: 4px;
|
316 |
+
text-align: center;
|
317 |
+
padding-right: 5px;
|
318 |
+
padding-top: 6px;
|
319 |
+
margin-right: 5px;
|
320 |
+
}
|
321 |
+
|
322 |
+
.cr-number {
|
323 |
+
margin-left: 5px;
|
324 |
+
padding-left: 5px;
|
325 |
+
background-color: #21759b;
|
326 |
+
background-image: -webkit-gradient(linear,left top,left bottom,from(#2a95c5),to(#21759b));
|
327 |
+
background-image: -webkit-linear-gradient(top,#2a95c5,#21759b);
|
328 |
+
background-image: -moz-linear-gradient(top,#2a95c5,#21759b);
|
329 |
+
background-image: -ms-linear-gradient(top,#2a95c5,#21759b);
|
330 |
+
background-image: -o-linear-gradient(top,#2a95c5,#21759b);
|
331 |
+
background-image: linear-gradient(to bottom,#2a95c5,#21759b);
|
332 |
+
border-color: #21759b;
|
333 |
+
border-bottom-color: #1e6a8d;
|
334 |
+
-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
|
335 |
+
box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
|
336 |
+
color: #fff;
|
337 |
+
text-shadow: 0 1px 0 rgba(0,0,0,0.1);
|
338 |
+
font-weight: normal;
|
339 |
+
margin-right: 0px !important;
|
340 |
+
}
|
341 |
+
.cr-number.cr-empty-0 {
|
342 |
+
font-weight: normal !important;
|
343 |
+
color: #ccc;
|
344 |
+
box-shadow: none;
|
345 |
+
-webkit-box-shadow: none;
|
346 |
+
}
|
347 |
+
a.cr-number:hover {
|
348 |
+
background-color: #278ab7;
|
349 |
+
background-image: -webkit-gradient(linear,left top,left bottom,from(#2e9fd2),to(#21759b));
|
350 |
+
background-image: -webkit-linear-gradient(top,#2e9fd2,#21759b);
|
351 |
+
background-image: -moz-linear-gradient(top,#2e9fd2,#21759b);
|
352 |
+
background-image: -ms-linear-gradient(top,#2e9fd2,#21759b);
|
353 |
+
background-image: -o-linear-gradient(top,#2e9fd2,#21759b);
|
354 |
+
background-image: linear-gradient(to bottom,#2e9fd2,#21759b);
|
355 |
+
border-color: #1b607f;
|
356 |
+
-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
|
357 |
+
box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
|
358 |
+
color: #fff;
|
359 |
+
text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
|
360 |
}
|
css/admin-lp-cpt-only-style.css
CHANGED
@@ -15,4 +15,32 @@ padding: 3px 7px;
|
|
15 |
}
|
16 |
#edit-slug-box {
|
17 |
margin-top: 0px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
}
|
15 |
}
|
16 |
#edit-slug-box {
|
17 |
margin-top: 0px;
|
18 |
+
}
|
19 |
+
.lp-template-selector-container ul#template-filter li {
|
20 |
+
display: inline-block;
|
21 |
+
padding: 5px;
|
22 |
+
padding-top: 0px;
|
23 |
+
margin-right: 5px;
|
24 |
+
text-align: center;
|
25 |
+
}
|
26 |
+
.lp-template-selector-container ul#template-filter {
|
27 |
+
line-height: 30px;
|
28 |
+
margin-top: 10px;
|
29 |
+
margin-bottom: 15px;
|
30 |
+
}
|
31 |
+
.lp-template-selector-container ul#template-filter a {
|
32 |
+
margin-right: 0px;
|
33 |
+
padding: 0px;
|
34 |
+
font-weight: bold;
|
35 |
+
text-decoration: none;
|
36 |
+
}
|
37 |
+
ul#template-filter .button-primary a {
|
38 |
+
color:#fff;
|
39 |
+
}
|
40 |
+
#more-templates-button {
|
41 |
+
display: inline-block;
|
42 |
+
margin-left: 20px;
|
43 |
+
vertical-align: middle;
|
44 |
+
float: none !important;
|
45 |
+
font-weight: normal;
|
46 |
}
|
css/admin-post-edit.css
CHANGED
@@ -1,128 +1,128 @@
|
|
1 |
-
#titlediv #title, #lp-notes-area input {
|
2 |
-
background-color: #fff;
|
3 |
-
border: none;
|
4 |
-
}
|
5 |
-
|
6 |
-
#wpbody-content {
|
7 |
-
overflow: visible !important;
|
8 |
-
}
|
9 |
-
|
10 |
-
#lp-notes-area input {
|
11 |
-
width: 95%;
|
12 |
-
color: #AAAAAA;
|
13 |
-
}
|
14 |
-
#local-storage-notice {
|
15 |
-
display: none !important;
|
16 |
-
}
|
17 |
-
#lp-notes-area input:focus{
|
18 |
-
color: #000;
|
19 |
-
}
|
20 |
-
|
21 |
-
#titlediv #title:focus, #lp-notes-area input:focus{
|
22 |
-
border: solid 1px #dfdfdf;
|
23 |
-
}
|
24 |
-
.select2-container {
|
25 |
-
min-width: 320px;
|
26 |
-
}
|
27 |
-
.lp-delete-var-stats, .lp-clear-success {
|
28 |
-
color: red;
|
29 |
-
opacity: .7;
|
30 |
-
font-size: 9px;
|
31 |
-
float: right;
|
32 |
-
font-weight: normal;
|
33 |
-
}
|
34 |
-
|
35 |
-
.lp-clear-success{
|
36 |
-
color: green;
|
37 |
-
}
|
38 |
-
|
39 |
-
#post-body-content .a_b_tabs {
|
40 |
-
padding: 0px;
|
41 |
-
margin-bottom: 9px;
|
42 |
-
margin-left: -18px;
|
43 |
-
padding-left: 22px;
|
44 |
-
margin-top: 5px;
|
45 |
-
margin-right: -20px;
|
46 |
-
position: relative;
|
47 |
-
}
|
48 |
-
|
49 |
-
#wp-landing-page-myeditor-wrap #landing-page-myeditor_path_row {
|
50 |
-
display: none;
|
51 |
-
}
|
52 |
-
|
53 |
-
#wp-landing-page-myeditor-wrap #wp-landing-page-myeditor-editor-container {
|
54 |
-
min-height: 200px;
|
55 |
-
}
|
56 |
-
|
57 |
-
#adminmenu .wp-menu-arrow div {
|
58 |
-
left: -2px;
|
59 |
-
}
|
60 |
-
|
61 |
-
#add-lp-notes {
|
62 |
-
display: none;
|
63 |
-
vertical-align: middle;
|
64 |
-
font-weight: 600;
|
65 |
-
padding-right: 2px;
|
66 |
-
}
|
67 |
-
|
68 |
-
.add-new-h2, #lp-current-view, #switch-lp, #preview-action {
|
69 |
-
display: none;
|
70 |
-
}
|
71 |
-
|
72 |
-
#lp-notes-area {
|
73 |
-
position: relative;
|
74 |
-
}
|
75 |
-
|
76 |
-
#post-body-content #main-title-area {
|
77 |
-
margin-top: 5px;
|
78 |
-
margin-bottom: 15px;
|
79 |
-
position: relative;
|
80 |
-
}
|
81 |
-
|
82 |
-
#main-title-area .button-primary.new-save-lp {
|
83 |
-
position: absolute !important;
|
84 |
-
top: 1px !important;
|
85 |
-
font-size: 17px !important;
|
86 |
-
padding-top: 3px !important;
|
87 |
-
right: 0px !important;
|
88 |
-
height: 31px !important;
|
89 |
-
width: 70px !important;
|
90 |
-
}
|
91 |
-
#lp-notes-area .button-primary.new-save-lp {
|
92 |
-
position: absolute !important;
|
93 |
-
top: 0px !important;
|
94 |
-
font-size: 14px !important;
|
95 |
-
padding-top: 0px !important;
|
96 |
-
right: 0px !important;
|
97 |
-
height: 24px !important;
|
98 |
-
width: 66px !important;
|
99 |
-
}
|
100 |
-
#main-title-area .lp-success-message, #lp-notes-area .lp-success-message {
|
101 |
-
position: absolute !important;
|
102 |
-
top: 1px !important;
|
103 |
-
font-size: 11px !important;
|
104 |
-
padding-top: 3px !important;
|
105 |
-
right: 0px !important;
|
106 |
-
height: 17px !important;
|
107 |
-
vertical-align: middle;
|
108 |
-
margin-top: 0px;
|
109 |
-
padding-bottom: 0px;
|
110 |
-
}
|
111 |
-
|
112 |
-
#main-title-area .button-primary.new-save-lp {
|
113 |
-
padding-top: 6px !important;
|
114 |
-
}
|
115 |
-
|
116 |
-
#main-title-area .lp-success-message {
|
117 |
-
margin-top: 4px;
|
118 |
-
}
|
119 |
-
#post-body .new-save-lp-frontend {
|
120 |
-
font-weight: 200;
|
121 |
-
top: 2px;
|
122 |
-
font-size: 14px;
|
123 |
-
margin-left: 21px;
|
124 |
-
line-height: 28px;
|
125 |
-
height: 30px;
|
126 |
-
float:right;
|
127 |
-
margin-right:19px;
|
128 |
}
|
1 |
+
#titlediv #title, #lp-notes-area input {
|
2 |
+
background-color: #fff;
|
3 |
+
border: none;
|
4 |
+
}
|
5 |
+
|
6 |
+
#wpbody-content {
|
7 |
+
overflow: visible !important;
|
8 |
+
}
|
9 |
+
|
10 |
+
#lp-notes-area input {
|
11 |
+
width: 95%;
|
12 |
+
color: #AAAAAA;
|
13 |
+
}
|
14 |
+
#local-storage-notice {
|
15 |
+
display: none !important;
|
16 |
+
}
|
17 |
+
#lp-notes-area input:focus{
|
18 |
+
color: #000;
|
19 |
+
}
|
20 |
+
|
21 |
+
#titlediv #title:focus, #lp-notes-area input:focus{
|
22 |
+
border: solid 1px #dfdfdf;
|
23 |
+
}
|
24 |
+
.select2-container {
|
25 |
+
min-width: 320px;
|
26 |
+
}
|
27 |
+
.lp-delete-var-stats, .lp-clear-success {
|
28 |
+
color: red;
|
29 |
+
opacity: .7;
|
30 |
+
font-size: 9px;
|
31 |
+
float: right;
|
32 |
+
font-weight: normal;
|
33 |
+
}
|
34 |
+
|
35 |
+
.lp-clear-success{
|
36 |
+
color: green;
|
37 |
+
}
|
38 |
+
|
39 |
+
#post-body-content .a_b_tabs {
|
40 |
+
padding: 0px;
|
41 |
+
margin-bottom: 9px;
|
42 |
+
margin-left: -18px;
|
43 |
+
padding-left: 22px;
|
44 |
+
margin-top: 5px;
|
45 |
+
margin-right: -20px;
|
46 |
+
position: relative;
|
47 |
+
}
|
48 |
+
|
49 |
+
#wp-landing-page-myeditor-wrap #landing-page-myeditor_path_row {
|
50 |
+
display: none;
|
51 |
+
}
|
52 |
+
|
53 |
+
#wp-landing-page-myeditor-wrap #wp-landing-page-myeditor-editor-container {
|
54 |
+
min-height: 200px;
|
55 |
+
}
|
56 |
+
|
57 |
+
#adminmenu .wp-menu-arrow div {
|
58 |
+
left: -2px;
|
59 |
+
}
|
60 |
+
|
61 |
+
#add-lp-notes {
|
62 |
+
display: none;
|
63 |
+
vertical-align: middle;
|
64 |
+
font-weight: 600;
|
65 |
+
padding-right: 2px;
|
66 |
+
}
|
67 |
+
|
68 |
+
.add-new-h2, #lp-current-view, #switch-lp, #preview-action {
|
69 |
+
display: none;
|
70 |
+
}
|
71 |
+
|
72 |
+
#lp-notes-area {
|
73 |
+
position: relative;
|
74 |
+
}
|
75 |
+
|
76 |
+
#post-body-content #main-title-area {
|
77 |
+
margin-top: 5px;
|
78 |
+
margin-bottom: 15px;
|
79 |
+
position: relative;
|
80 |
+
}
|
81 |
+
|
82 |
+
#main-title-area .button-primary.new-save-lp {
|
83 |
+
position: absolute !important;
|
84 |
+
top: 1px !important;
|
85 |
+
font-size: 17px !important;
|
86 |
+
padding-top: 3px !important;
|
87 |
+
right: 0px !important;
|
88 |
+
height: 31px !important;
|
89 |
+
width: 70px !important;
|
90 |
+
}
|
91 |
+
#lp-notes-area .button-primary.new-save-lp {
|
92 |
+
position: absolute !important;
|
93 |
+
top: 0px !important;
|
94 |
+
font-size: 14px !important;
|
95 |
+
padding-top: 0px !important;
|
96 |
+
right: 0px !important;
|
97 |
+
height: 24px !important;
|
98 |
+
width: 66px !important;
|
99 |
+
}
|
100 |
+
#main-title-area .lp-success-message, #lp-notes-area .lp-success-message {
|
101 |
+
position: absolute !important;
|
102 |
+
top: 1px !important;
|
103 |
+
font-size: 11px !important;
|
104 |
+
padding-top: 3px !important;
|
105 |
+
right: 0px !important;
|
106 |
+
height: 17px !important;
|
107 |
+
vertical-align: middle;
|
108 |
+
margin-top: 0px;
|
109 |
+
padding-bottom: 0px;
|
110 |
+
}
|
111 |
+
|
112 |
+
#main-title-area .button-primary.new-save-lp {
|
113 |
+
padding-top: 6px !important;
|
114 |
+
}
|
115 |
+
|
116 |
+
#main-title-area .lp-success-message {
|
117 |
+
margin-top: 4px;
|
118 |
+
}
|
119 |
+
#post-body .new-save-lp-frontend {
|
120 |
+
font-weight: 200;
|
121 |
+
top: 2px;
|
122 |
+
font-size: 14px;
|
123 |
+
margin-left: 21px;
|
124 |
+
line-height: 28px;
|
125 |
+
height: 30px;
|
126 |
+
float:right;
|
127 |
+
margin-right:19px;
|
128 |
}
|
css/admin-post-new.css
CHANGED
@@ -1,85 +1,85 @@
|
|
1 |
-
#wpbody-content .wrap
|
2 |
-
{
|
3 |
-
display:none;
|
4 |
-
}
|
5 |
-
|
6 |
-
#wpbody-content #screen-options-link-wrap, #post-body-content .a_b_tabs, #switch-lp, #lp-current-view
|
7 |
-
{
|
8 |
-
display:none;
|
9 |
-
}
|
10 |
-
|
11 |
-
#lp-thumbnail-sidebar-preview, #main-title-area, #lp-notes-area
|
12 |
-
{
|
13 |
-
display:none;
|
14 |
-
}
|
15 |
-
#wp-content-wrap, #postdivrich, #postbox-container-2, #misc-publishing-actions, #preview-action, #major-publishing-actions, #edit-slug-box, #submitdiv .handlediv {
|
16 |
-
display: none;
|
17 |
-
}
|
18 |
-
#titlediv #title {
|
19 |
-
-webkit-border-radius: 3px;
|
20 |
-
border-radius: 3px;
|
21 |
-
border-color: #dfdfdf !important;
|
22 |
-
border-width: 1px !important;
|
23 |
-
border-style: solid !important;}
|
24 |
-
|
25 |
-
#descriptor {
|
26 |
-
padding-left: 5px;
|
27 |
-
display: block;
|
28 |
-
padding-top: 5px;
|
29 |
-
margin-bottom: 10px;
|
30 |
-
}
|
31 |
-
#lp-main-headline-wrap {display: none !important;}
|
32 |
-
#timage .template-thumbnail {
|
33 |
-
width: 242px;
|
34 |
-
border-radius: 0px !important;
|
35 |
-
}
|
36 |
-
#templates {
|
37 |
-
position: relative;
|
38 |
-
|
39 |
-
}
|
40 |
-
.new-lp-button {
|
41 |
-
margin-bottom: 10px !important;
|
42 |
-
margin-top: 3px !important;
|
43 |
-
}
|
44 |
-
#templates #lp_template_change {
|
45 |
-
|
46 |
-
position: absolute;
|
47 |
-
top: 55px;
|
48 |
-
left: 290px;
|
49 |
-
}
|
50 |
-
#template_current {
|
51 |
-
width: 340px;
|
52 |
-
padding-right: 10px;
|
53 |
-
display: inline-block;
|
54 |
-
vertical-align: top;
|
55 |
-
}
|
56 |
-
#template_current h3 {
|
57 |
-
font-weight: bold;
|
58 |
-
padding: 7px 0px;
|
59 |
-
}
|
60 |
-
#lp_the_image {
|
61 |
-
display: inline-block;
|
62 |
-
width: 410px;
|
63 |
-
margin-top: 10px;
|
64 |
-
margin-left:10px;
|
65 |
-
}
|
66 |
-
#lp_the_image img {
|
67 |
-
padding: 8px;
|
68 |
-
margin-bottom: 15px;
|
69 |
-
box-shadow: 0 1px 5px rgba(0, 0, 0, .3);
|
70 |
-
-webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, .3);
|
71 |
-
-moz-box-shadow: 0 1px 5px rgba(0, 0, 0, .3);
|
72 |
-
-o-box-shadow: 0 1px 5px rgba(0, 0, 0, .3);
|
73 |
-
border-radius: 5px;
|
74 |
-
-moz-border-radius: 5px;
|
75 |
-
-webkit-border-radius: 5px;
|
76 |
-
-html-border-radius: 5px;
|
77 |
-
border: 0px;
|
78 |
-
display: block;
|
79 |
-
max-width: 240px;
|
80 |
-
margin-left: 15px;
|
81 |
-
border-top-left-radius: 3px;
|
82 |
-
border-top-right-radius: 3px;
|
83 |
-
border-bottom-right-radius: 3px;
|
84 |
-
border-bottom-left-radius: 3px;
|
85 |
}
|
1 |
+
#wpbody-content .wrap
|
2 |
+
{
|
3 |
+
display:none;
|
4 |
+
}
|
5 |
+
|
6 |
+
#wpbody-content #screen-options-link-wrap, #post-body-content .a_b_tabs, #switch-lp, #lp-current-view
|
7 |
+
{
|
8 |
+
display:none;
|
9 |
+
}
|
10 |
+
|
11 |
+
#lp-thumbnail-sidebar-preview, #main-title-area, #lp-notes-area
|
12 |
+
{
|
13 |
+
display:none;
|
14 |
+
}
|
15 |
+
#wp-content-wrap, #postdivrich, #postbox-container-2, #misc-publishing-actions, #preview-action, #major-publishing-actions, #edit-slug-box, #submitdiv .handlediv {
|
16 |
+
display: none;
|
17 |
+
}
|
18 |
+
#titlediv #title {
|
19 |
+
-webkit-border-radius: 3px;
|
20 |
+
border-radius: 3px;
|
21 |
+
border-color: #dfdfdf !important;
|
22 |
+
border-width: 1px !important;
|
23 |
+
border-style: solid !important;}
|
24 |
+
|
25 |
+
#descriptor {
|
26 |
+
padding-left: 5px;
|
27 |
+
display: block;
|
28 |
+
padding-top: 5px;
|
29 |
+
margin-bottom: 10px;
|
30 |
+
}
|
31 |
+
#lp-main-headline-wrap {display: none !important;}
|
32 |
+
#timage .template-thumbnail {
|
33 |
+
width: 242px;
|
34 |
+
border-radius: 0px !important;
|
35 |
+
}
|
36 |
+
#templates {
|
37 |
+
position: relative;
|
38 |
+
|
39 |
+
}
|
40 |
+
.new-lp-button {
|
41 |
+
margin-bottom: 10px !important;
|
42 |
+
margin-top: 3px !important;
|
43 |
+
}
|
44 |
+
#templates #lp_template_change {
|
45 |
+
|
46 |
+
position: absolute;
|
47 |
+
top: 55px;
|
48 |
+
left: 290px;
|
49 |
+
}
|
50 |
+
#template_current {
|
51 |
+
width: 340px;
|
52 |
+
padding-right: 10px;
|
53 |
+
display: inline-block;
|
54 |
+
vertical-align: top;
|
55 |
+
}
|
56 |
+
#template_current h3 {
|
57 |
+
font-weight: bold;
|
58 |
+
padding: 7px 0px;
|
59 |
+
}
|
60 |
+
#lp_the_image {
|
61 |
+
display: inline-block;
|
62 |
+
width: 410px;
|
63 |
+
margin-top: 10px;
|
64 |
+
margin-left:10px;
|
65 |
+
}
|
66 |
+
#lp_the_image img {
|
67 |
+
padding: 8px;
|
68 |
+
margin-bottom: 15px;
|
69 |
+
box-shadow: 0 1px 5px rgba(0, 0, 0, .3);
|
70 |
+
-webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, .3);
|
71 |
+
-moz-box-shadow: 0 1px 5px rgba(0, 0, 0, .3);
|
72 |
+
-o-box-shadow: 0 1px 5px rgba(0, 0, 0, .3);
|
73 |
+
border-radius: 5px;
|
74 |
+
-moz-border-radius: 5px;
|
75 |
+
-webkit-border-radius: 5px;
|
76 |
+
-html-border-radius: 5px;
|
77 |
+
border: 0px;
|
78 |
+
display: block;
|
79 |
+
max-width: 240px;
|
80 |
+
margin-left: 15px;
|
81 |
+
border-top-left-radius: 3px;
|
82 |
+
border-top-right-radius: 3px;
|
83 |
+
border-bottom-right-radius: 3px;
|
84 |
+
border-bottom-left-radius: 3px;
|
85 |
}
|
css/admin-style.css
CHANGED
@@ -1,434 +1,464 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
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 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
font-size:
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
border:
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
{
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
padding:2px;
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
.lp_template_wrapper ul li .
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
-webkit-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
.
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
.
|
270 |
-
.
|
271 |
-
|
272 |
-
|
273 |
-
/*
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
}
|
294 |
-
|
295 |
-
.
|
296 |
-
{
|
297 |
-
|
298 |
-
}
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
}
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
color:#388DBC;
|
314 |
-
}
|
315 |
-
|
316 |
-
|
317 |
-
{
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
}
|
331 |
-
|
332 |
-
#
|
333 |
-
{
|
334 |
-
border
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
}
|
349 |
-
|
350 |
-
|
351 |
-
{
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
.
|
376 |
-
{
|
377 |
-
|
378 |
-
}
|
379 |
-
|
380 |
-
.wp-lead-label
|
381 |
-
{
|
382 |
-
|
383 |
-
}
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
}
|
389 |
-
|
390 |
-
#leads-table-container-inside .wp-list-table .
|
391 |
-
{
|
392 |
-
|
393 |
-
}
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
border
|
413 |
-
|
414 |
-
margin-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
text-
|
433 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
434 |
}
|
1 |
+
|
2 |
+
.cat-block
|
3 |
+
{
|
4 |
+
display:inline-table;
|
5 |
+
padding-right:60px;
|
6 |
+
}
|
7 |
+
|
8 |
+
#main-title-area
|
9 |
+
{
|
10 |
+
margin-top: 5px;
|
11 |
+
}
|
12 |
+
|
13 |
+
.menu-icon-landing-page .wp-submenu li:last-child
|
14 |
+
{
|
15 |
+
display: none;
|
16 |
+
}
|
17 |
+
#setting-error-tgmpa p:nth-child(2) strong em {
|
18 |
+
margin-top: 5px;
|
19 |
+
}
|
20 |
+
#setting-error-tgmpa em {
|
21 |
+
display: block;
|
22 |
+
}
|
23 |
+
#add-landing-page.hide-if-js {
|
24 |
+
display: block !important;
|
25 |
+
}
|
26 |
+
#setting-error-tgmpa {
|
27 |
+
padding-bottom: 5px;
|
28 |
+
padding-top: 5px;
|
29 |
+
padding-left: 10px;
|
30 |
+
|
31 |
+
}
|
32 |
+
#setting-error-tgmpa p {
|
33 |
+
text-decoration: bold;
|
34 |
+
}
|
35 |
+
#setting-error-tgmpa p:nth-last-child(2), #setting-error-tgmpa a, #setting-error-tgmpa strong {
|
36 |
+
text-decoration: normal;
|
37 |
+
}
|
38 |
+
#setting-error-tgmpa p:nth-last-child(2) a:first-child{
|
39 |
+
padding-left: 0px;
|
40 |
+
}
|
41 |
+
#setting-error-tgmpa p:nth-last-child(2) a {
|
42 |
+
padding-right: 10px;
|
43 |
+
padding-left: 10px;
|
44 |
+
font-size: 13px;
|
45 |
+
margin-top: 10px;
|
46 |
+
display: inline-block;
|
47 |
+
}
|
48 |
+
#setting-error-tgmpa a.thickbox {
|
49 |
+
font-size: 16px;
|
50 |
+
padding-top: 5px;
|
51 |
+
display: inline-block;
|
52 |
+
padding-bottom: 5px;
|
53 |
+
}
|
54 |
+
#setting-error-tgmpa.updated p {
|
55 |
+
width: 99%;
|
56 |
+
margin: 0px;
|
57 |
+
}
|
58 |
+
#setting-error-tgmpa a span {
|
59 |
+
color: #000 !important;
|
60 |
+
text-decoration: none;
|
61 |
+
font-size: 14px !important;
|
62 |
+
font-style: normal !important;
|
63 |
+
font-weight: normal !important;
|
64 |
+
}
|
65 |
+
#template-box, .thumbnail-lander img {
|
66 |
+
background: #FCFDFE;
|
67 |
+
padding: 3%;
|
68 |
+
margin-right: 10px;
|
69 |
+
border: 1px solid #E0E0E0;
|
70 |
+
-moz-border-radius: 7px;
|
71 |
+
border-radius: 7px;
|
72 |
+
position: relative;
|
73 |
+
overflow: hidden;
|
74 |
+
display: block;
|
75 |
+
}
|
76 |
+
#postexcerpt p {
|
77 |
+
display: none;
|
78 |
+
}
|
79 |
+
.metabox-holder .postbox-container .empty-container
|
80 |
+
{
|
81 |
+
border: none;
|
82 |
+
}
|
83 |
+
|
84 |
+
|
85 |
+
|
86 |
+
#lp_templates_wrapper_inside { padding-left: 15px; width: 945px; margin: 0; }
|
87 |
+
|
88 |
+
.lp_template_wrapper ul li { float: left; position: relative; list-style: none; }
|
89 |
+
|
90 |
+
/*hudson*/
|
91 |
+
.lp_template_wrapper ul li label{
|
92 |
+
font-size: 14px;
|
93 |
+
font-weight: 300;
|
94 |
+
color: greytext; text-decoration: none;
|
95 |
+
|
96 |
+
}
|
97 |
+
|
98 |
+
/*hudson*/
|
99 |
+
.lp_template_wrapper ul li .template {
|
100 |
+
font-size: 14px;
|
101 |
+
//font-weight: bold;
|
102 |
+
color: #222222; text-decoration: none;
|
103 |
+
//text-shadow: 0 1px 2px black;
|
104 |
+
}
|
105 |
+
|
106 |
+
#lp-main-headline-wrap {margin-top: 5px;}
|
107 |
+
|
108 |
+
.lp_template_wrapper ul li:hover {
|
109 |
+
//height: 43px;
|
110 |
+
-webkit-box-shadow: 0 0px 2px black inset;
|
111 |
+
|
112 |
+
}
|
113 |
+
|
114 |
+
.lp_template_wrapper ul li ul li:hover { background: none; -webkit-box-shadow: none; -moz-box-shadow: none; height: auto; border: none; }
|
115 |
+
|
116 |
+
.lp_template_wrapper ul li .horizontal li { padding: 14px 10px 0px 0px; }
|
117 |
+
|
118 |
+
.lp_template_wrapper ul li .horizontal li:first-child { margin-left: -10px; }
|
119 |
+
|
120 |
+
.lp_template_wrapper ul li .horizontal li a { font-size: 12px; font-weight: normal; color: #c7c7c7; }
|
121 |
+
|
122 |
+
.arrow-up { width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 15px solid #6a6a63; position: absolute; left: 20px; top: -15px; }
|
123 |
+
|
124 |
+
.lp_template_wrapper ul li ul li .extended { position: absolute; top: 45px; left: 0; width: 330px; background: url(images/dropdownback.png); z-index: 1000; -moz-box-shadow: 0 0px 8px rgba(0,0,0,0.8); -webkit-box-shadow: 0 0px 8px rgba(0,0,0,0.8); box-shadow: 0 0 8px black; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; border: 1px solid white; display: none; color: white; }
|
125 |
+
|
126 |
+
.lp_template_wrapper ul li ul li .extended .screenshot { display: block; margin: 5px auto -26px auto; -webkit-box-reflect:below 0px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(0.8, transparent), to(rgba(255,255,255,0.5))); }
|
127 |
+
|
128 |
+
.lp_template_wrapper ul li ul li .extended p { padding: 10px; font-size: 11px; line-height: 17px; text-shadow: 0 1px 1px black; }
|
129 |
+
|
130 |
+
.lp_template_wrapper ul li ul li .extended h2, .lp_template_wrapper ul li .ultraNav h2 { padding-top: 10px; padding-left: 10px; font-size: 16px; text-shadow: 0 1px 2px black; color: white; background: url(images/headerback.png) repeat-x; height: 20px; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; }
|
131 |
+
|
132 |
+
.lp_template_wrapper ul li ul li .extended span { padding-left: 10px; font-size: 11px; }
|
133 |
+
|
134 |
+
.lp_template_wrapper ul li ul li .extended ul.smallNav { border-top: 1px solid rgba(141,141,141,0.50); padding: 10px; height: 100px; }
|
135 |
+
|
136 |
+
.lp_template_wrapper ul li ul li .extended ul.smallNav li { padding: 0; line-height: 22px; font-weight: bold; background: url(images/linkback.png) no-repeat; }
|
137 |
+
|
138 |
+
.lp_template_wrapper ul li ul li .extended ul.smallNav li a {
|
139 |
+
color: #fff;
|
140 |
+
text-shadow: none;
|
141 |
+
font-size:12px;
|
142 |
+
}
|
143 |
+
|
144 |
+
.lp_template_wrapper ul li ul li .extended ul.smallNav li label{
|
145 |
+
color: #c7c7c7;
|
146 |
+
text-shadow: none;
|
147 |
+
font-size:12px;
|
148 |
+
text-decoration:none;
|
149 |
+
}
|
150 |
+
|
151 |
+
.lp-feature-link
|
152 |
+
{
|
153 |
+
float:none;
|
154 |
+
margin:0px;
|
155 |
+
display:block;
|
156 |
+
padding:2px;
|
157 |
+
}
|
158 |
+
|
159 |
+
.lp-feature-link .lp-feature-link-img
|
160 |
+
{
|
161 |
+
padding:2px;
|
162 |
+
display:inline-block;
|
163 |
+
}
|
164 |
+
|
165 |
+
/*david*/
|
166 |
+
th.landing-page-table-header {width:230px; line-height: 22px;}
|
167 |
+
|
168 |
+
.default_template_highlight
|
169 |
+
{
|
170 |
+
-webkit-box-shadow: inset 0px 0px 12px 1px rgba(82, 168, 238, 1);
|
171 |
+
box-shadow: inset 0px 0px 12px 1px rgba(82, 168, 238, 1);
|
172 |
+
}
|
173 |
+
|
174 |
+
.currently_selected
|
175 |
+
{
|
176 |
+
position: absolute;
|
177 |
+
top: 72px;
|
178 |
+
left: 16px;
|
179 |
+
font-size: 22px;
|
180 |
+
line-height: 26px;
|
181 |
+
text-align: center;
|
182 |
+
background: black;
|
183 |
+
width: 180px;
|
184 |
+
height: 56px;
|
185 |
+
color: white;
|
186 |
+
opacity: 0.5;
|
187 |
+
border-radius: 7px;
|
188 |
+
}
|
189 |
+
|
190 |
+
.lp-selection-heading{width: 89%; margin-top: 20px;}
|
191 |
+
.lp-selection-heading h1 {display: inline;}
|
192 |
+
|
193 |
+
#lp-cancel-selection
|
194 |
+
{
|
195 |
+
display: inline;
|
196 |
+
float: right;
|
197 |
+
}
|
198 |
+
|
199 |
+
|
200 |
+
|
201 |
+
.lp_template_wrapper ul li ul li .extended ul.smallNav li:first-child { margin: 0; }
|
202 |
+
|
203 |
+
.lp_template_wrapper ul li ul li .extended ul.smallNav li:last-child { margin-bottom: 10px; }
|
204 |
+
|
205 |
+
.lp_template_wrapper ul li ul li:hover .extended { display: block; }
|
206 |
+
|
207 |
+
|
208 |
+
.lp_template_wrapper ul li .ultraNav
|
209 |
+
{
|
210 |
+
position: absolute;
|
211 |
+
top: 55px;
|
212 |
+
left: -100px;
|
213 |
+
width: 294px;
|
214 |
+
background: url(images/dropdownback.png);
|
215 |
+
border: 1px solid white;
|
216 |
+
-webkit-border-radius: 5px;
|
217 |
+
-moz-border-radius: 5px;
|
218 |
+
border-radius: 5px;
|
219 |
+
z-index: 500;
|
220 |
+
-moz-box-shadow: 0 3px 8px rgba(0,0,0,0.6);
|
221 |
+
-webkit-box-shadow: 0 3px 8px rgba(0,0,0,0.6) box-shadow: 0 3px 8px black;
|
222 |
+
display: none;
|
223 |
+
}
|
224 |
+
|
225 |
+
.ultraNav h2 { text-align: center; padding-left:10px;padding-top:10px;}
|
226 |
+
|
227 |
+
.lp_template_wrapper ul li .ultra { width: 130px; float: left; margin: 10px 0 10px 10px; -moz-box-shadow: 0 -1px 3px rgba(0,0,0,0.6); -webkit-box-shadow: 0 -1px 3px rgba(0,0,0,0.6); -moz-border-radius: 5px; -webkit-border-radius: 5px; border-bottom: none; }
|
228 |
+
|
229 |
+
.lp_template_wrapper ul li .ultra:first-child { margin: 0; }
|
230 |
+
|
231 |
+
.lp_template_wrapper ul li .ultraNav .arrow-up { left: 130px; }
|
232 |
+
|
233 |
+
.lp_template_wrapper ul li .ultra a { font-weight: normal; font-size: 12px; color: #c7c7c7; text-shadow: 0 1px 2px black; }
|
234 |
+
|
235 |
+
.lp_template_wrapper ul li .ultra li { width: 120px; line-height: 20px; padding: 3px 5px; background: url(images/linkback.png) no-repeat; }
|
236 |
+
|
237 |
+
.lp_template_wrapper ul li:hover .ultraNav { display: block; }
|
238 |
+
|
239 |
+
#lp_template_change h2 {display: inline-block;}
|
240 |
+
|
241 |
+
#lp_template_change {
|
242 |
+
margin-left: 17px;
|
243 |
+
margin-top: -25px;
|
244 |
+
float: right;
|
245 |
+
}
|
246 |
+
|
247 |
+
/* Split Testing Splash */
|
248 |
+
.lp_tooltip, .lp_tooltip_templates {background: url('/wp-content/plugins/landing-pages/css/images/question-light.png');
|
249 |
+
width: 15px;
|
250 |
+
height: 15px;
|
251 |
+
display: inline-block;
|
252 |
+
margin-left: 5px;
|
253 |
+
vertical-align: middle;
|
254 |
+
cursor: help;
|
255 |
+
background-repeat: no-repeat;
|
256 |
+
}
|
257 |
+
.qtip-content {
|
258 |
+
position: relative;
|
259 |
+
padding: 5px 9px;
|
260 |
+
overflow: hidden;
|
261 |
+
text-align: left;
|
262 |
+
word-wrap: break-word;
|
263 |
+
line-height: 19px;
|
264 |
+
}
|
265 |
+
.tool_date{margin-left: 25px;
|
266 |
+
vertical-align: top;}
|
267 |
+
.tool_textarea {vertical-align: top;}
|
268 |
+
.tool_color {margin-top:1px;}
|
269 |
+
.tool_checkbox {vertical-align: top; margin-top: 4px;}
|
270 |
+
.lp_check_box_table td {padding: 0px;}
|
271 |
+
.lp_check_box_table {display: inline; float: left;}
|
272 |
+
|
273 |
+
/* Split Testing */
|
274 |
+
.lp_toggle_pause {color:red;}
|
275 |
+
.lp_toggle_play {color:green;}
|
276 |
+
/*store*/
|
277 |
+
|
278 |
+
/* iframe's parent node */
|
279 |
+
div#lp-store-iframe-container {
|
280 |
+
// position: fixed;
|
281 |
+
width: 100%;
|
282 |
+
height: 100%;
|
283 |
+
overflow:hidden;
|
284 |
+
}
|
285 |
+
|
286 |
+
/* iframe itself */
|
287 |
+
div#lp-store-iframe-container > iframe {
|
288 |
+
display: block;
|
289 |
+
width: 100%;
|
290 |
+
height: 100%;
|
291 |
+
border: none;
|
292 |
+
margin-left:0px;
|
293 |
+
}
|
294 |
+
|
295 |
+
.column-thumbnail
|
296 |
+
{
|
297 |
+
height:110px;
|
298 |
+
}
|
299 |
+
|
300 |
+
.wp-list-table .column-date
|
301 |
+
{
|
302 |
+
width:128px;
|
303 |
+
}
|
304 |
+
.wp-list-table .details
|
305 |
+
{
|
306 |
+
text-align:left;
|
307 |
+
padding-left:20px;
|
308 |
+
}
|
309 |
+
|
310 |
+
#leads-table-container-inside
|
311 |
+
{
|
312 |
+
margin-top:-36px;
|
313 |
+
color:#388DBC;
|
314 |
+
}
|
315 |
+
|
316 |
+
.wp-list-table td
|
317 |
+
{
|
318 |
+
color:#388DBC;
|
319 |
+
}
|
320 |
+
|
321 |
+
#wp-leads-splash-header
|
322 |
+
{
|
323 |
+
background: #f2f2f2 url('/wp-content/plugins/landing-pages/images/gradient.png') repeat-x top left;
|
324 |
+
border-bottom: 1px solid #EBEBEA;
|
325 |
+
-webkit-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.3);
|
326 |
+
-moz-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.3);
|
327 |
+
box-shadow: inset 1px 1px 1px rgba(255,255,255,0.3);
|
328 |
+
padding: 20px;
|
329 |
+
text-shadow: 1px 1px 1px #fff;
|
330 |
+
}
|
331 |
+
|
332 |
+
#lead-details-container
|
333 |
+
{
|
334 |
+
border: 1px solid #EBEBEA;
|
335 |
+
}
|
336 |
+
|
337 |
+
#wp-leads-splash-email, #wp-leads-splash-ip, #wp-leads-splash-city, #wp-leads-splash-state, #wp-leads-splash-name
|
338 |
+
{
|
339 |
+
border-bottom: 1px solid #EBEBEA;
|
340 |
+
padding: 10px 20px;
|
341 |
+
}
|
342 |
+
|
343 |
+
|
344 |
+
#wp-leads-extra-data
|
345 |
+
{
|
346 |
+
margin-left: 20px;
|
347 |
+
margin-top: 5px;
|
348 |
+
}
|
349 |
+
|
350 |
+
#wp-leads-extra-data td
|
351 |
+
{
|
352 |
+
padding-right: 15px;
|
353 |
+
}
|
354 |
+
|
355 |
+
.wplp-green-button
|
356 |
+
{
|
357 |
+
background: #94BA65 url('/wp-content/plugins/landing-pages/images/gradient.png') repeat-x top left;
|
358 |
+
border: 1px solid rgba(0,0,0,0.15);
|
359 |
+
-webkit-border-radius: 2px;
|
360 |
+
-moz-border-radius: 2px;
|
361 |
+
border-radius: 2px;
|
362 |
+
-webkit-box-shadow: 0px 2px 3px rgba(0,0,0,0.15), inset 1px 1px 1px rgba(255,255,255,0.2);
|
363 |
+
-moz-box-shadow: 0px 2px 3px rgba(0,0,0,0.15), inset 1px 1px 1px rgba(255,255,255,0.2);
|
364 |
+
box-shadow: 0px 2px 3px rgba(0,0,0,0.15), inset 1px 1px 1px rgba(255,255,255,0.2);
|
365 |
+
color: #fff;
|
366 |
+
cursor: pointer;
|
367 |
+
display: inline-block;
|
368 |
+
font-family: inherit;
|
369 |
+
font-size: 14px;
|
370 |
+
font-weight: bold;
|
371 |
+
padding: 4px 5px;
|
372 |
+
text-shadow: -1px -1px 1px rgba(0,0,0,0.15);
|
373 |
+
text-decoration: none;
|
374 |
+
}
|
375 |
+
.wplp-right
|
376 |
+
{
|
377 |
+
float: right;
|
378 |
+
}
|
379 |
+
|
380 |
+
.lp-lead-splash-h3, .wp-lead-label
|
381 |
+
{
|
382 |
+
display: inline;
|
383 |
+
}
|
384 |
+
|
385 |
+
.wp-lead-label
|
386 |
+
{
|
387 |
+
font-weight: bold;
|
388 |
+
}
|
389 |
+
|
390 |
+
#leads-table-container-inside .wp-list-table .details
|
391 |
+
{
|
392 |
+
padding-left: 0px;
|
393 |
+
}
|
394 |
+
|
395 |
+
#leads-table-container-inside .wp-list-table .column-date
|
396 |
+
{
|
397 |
+
width: 150px;
|
398 |
+
}
|
399 |
+
.date-picker .new-save-lp
|
400 |
+
{
|
401 |
+
display: none;
|
402 |
+
}
|
403 |
+
#lp-tour {
|
404 |
+
position: absolute;
|
405 |
+
font-size: 13px;
|
406 |
+
top: -3px;
|
407 |
+
right: 148px;
|
408 |
+
}
|
409 |
+
.lp-success-message
|
410 |
+
{
|
411 |
+
background: #e2ffc9;
|
412 |
+
border: 1px solid #c5eda3;
|
413 |
+
padding: 4px 10px 4px 10px;
|
414 |
+
margin-left: 10px;
|
415 |
+
-webkit-border-radius: 3px;
|
416 |
+
-moz-border-radius: 3px;
|
417 |
+
border-radius: 3px;
|
418 |
+
position: relative;
|
419 |
+
margin-top: 10px;
|
420 |
+
text-shadow: 1px 1px 1px rgba(255,255,255,0.5);
|
421 |
+
}
|
422 |
+
|
423 |
+
tr.media-id p.description {
|
424 |
+
display: inline-block;
|
425 |
+
}
|
426 |
+
div.capty-caption {
|
427 |
+
background-color: #000000;
|
428 |
+
color: #FFFFFF;
|
429 |
+
font: bold 11px verdana;
|
430 |
+
padding-left: 10px;
|
431 |
+
padding-top: 7px;
|
432 |
+
text-shadow: 1px 1px 0 #222222;
|
433 |
+
}
|
434 |
+
div.capty-caption a {
|
435 |
+
color: #318DAD;
|
436 |
+
font: bold 11px verdana;
|
437 |
+
text-decoration: none;
|
438 |
+
text-shadow: none;
|
439 |
+
}
|
440 |
+
#setting-error-tgmpa a {
|
441 |
+
font-style: normal;
|
442 |
+
}
|
443 |
+
#setting-error-tgmpa .inbound-install-notice {
|
444 |
+
|
445 |
+
}
|
446 |
+
#TB_ajaxWindowTitle .inbound-install-notice {
|
447 |
+
display: none;
|
448 |
+
}
|
449 |
+
#setting-error-tgmpa .inbound-install-notice-links {
|
450 |
+
display: block;
|
451 |
+
margin-bottom: 5px;
|
452 |
+
}
|
453 |
+
#setting-error-tgmpa a.dismiss-notice{
|
454 |
+
color: grey;
|
455 |
+
}
|
456 |
+
#setting-error-tgmpa .thickbox {
|
457 |
+
display: inline-block;
|
458 |
+
margin-top: 5px;
|
459 |
+
font-weight: bold;
|
460 |
+
}
|
461 |
+
|
462 |
+
#setting-error-tgmpa em {
|
463 |
+
font-weight: normal;
|
464 |
}
|
css/admin-tour.css
CHANGED
@@ -1,216 +1,216 @@
|
|
1 |
-
.introjs-overlay {
|
2 |
-
position: absolute;
|
3 |
-
z-index: 999999;
|
4 |
-
background-color: #000;
|
5 |
-
opacity: 0;
|
6 |
-
background: -moz-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
7 |
-
background: -webkit-gradient(radial,center center,0px,center center,100%,color-stop(0%,rgba(0,0,0,0.4)),color-stop(100%,rgba(0,0,0,0.9)));
|
8 |
-
background: -webkit-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
9 |
-
background: -o-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
10 |
-
background: -ms-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
11 |
-
background: radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
12 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#66000000',endColorstr='#e6000000',GradientType=1);
|
13 |
-
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
|
14 |
-
filter: alpha(opacity=50);
|
15 |
-
-webkit-transition: all 0.3s ease-out;
|
16 |
-
-moz-transition: all 0.3s ease-out;
|
17 |
-
-ms-transition: all 0.3s ease-out;
|
18 |
-
-o-transition: all 0.3s ease-out;
|
19 |
-
transition: all 0.3s ease-out;
|
20 |
-
}
|
21 |
-
|
22 |
-
.introjs-fixParent {
|
23 |
-
z-index: auto !important;
|
24 |
-
}
|
25 |
-
|
26 |
-
.introjs-showElement {
|
27 |
-
z-index: 9999999 !important;
|
28 |
-
}
|
29 |
-
|
30 |
-
.introjs-relativePosition {
|
31 |
-
position: relative;
|
32 |
-
}
|
33 |
-
|
34 |
-
.introjs-helperLayer {
|
35 |
-
position: absolute;
|
36 |
-
z-index: 9999998;
|
37 |
-
background-color: #FFF;
|
38 |
-
background-color: rgba(255,255,255,.9);
|
39 |
-
border: 1px solid #777;
|
40 |
-
border: 1px solid rgba(0,0,0,.5);
|
41 |
-
border-radius: 4px;
|
42 |
-
box-shadow: 0 2px 15px rgba(0,0,0,.4);
|
43 |
-
-webkit-transition: all 0.3s ease-out;
|
44 |
-
-moz-transition: all 0.3s ease-out;
|
45 |
-
-ms-transition: all 0.3s ease-out;
|
46 |
-
-o-transition: all 0.3s ease-out;
|
47 |
-
transition: all 0.3s ease-out;
|
48 |
-
}
|
49 |
-
|
50 |
-
.introjs-helperNumberLayer {
|
51 |
-
position: absolute;
|
52 |
-
top: -18px;
|
53 |
-
left: -25px;
|
54 |
-
z-index: 9999999999 !important;
|
55 |
-
padding: 2px;
|
56 |
-
font-family: Arial, verdana, tahoma;
|
57 |
-
font-size: 13px;
|
58 |
-
font-weight: bold;
|
59 |
-
color: white;
|
60 |
-
text-align: center;
|
61 |
-
text-shadow: 1px 1px 1px rgba(0,0,0,.3);
|
62 |
-
background: #ff3019; /* Old browsers */
|
63 |
-
background: -webkit-linear-gradient(top, #ff3019 0%, #cf0404 100%); /* Chrome10+,Safari5.1+ */
|
64 |
-
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ff3019), color-stop(100%, #cf0404)); /* Chrome,Safari4+ */
|
65 |
-
background: -moz-linear-gradient(top, #ff3019 0%, #cf0404 100%); /* FF3.6+ */
|
66 |
-
background: -ms-linear-gradient(top, #ff3019 0%, #cf0404 100%); /* IE10+ */
|
67 |
-
background: -o-linear-gradient(top, #ff3019 0%, #cf0404 100%); /* Opera 11.10+ */
|
68 |
-
background: linear-gradient(to bottom, #ff3019 0%, #cf0404 100%); /* W3C */
|
69 |
-
width: 20px;
|
70 |
-
height:20px;
|
71 |
-
line-height: 20px;
|
72 |
-
border: 3px solid white;
|
73 |
-
border-radius: 50%;
|
74 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3019', endColorstr='#cf0404', GradientType=0); /* IE6-9 */
|
75 |
-
filter: progid:DXImageTransform.Microsoft.Shadow(direction=135, strength=2, color=ff0000); /* IE10 text shadows */
|
76 |
-
box-shadow: 0 2px 5px rgba(0,0,0,.4);
|
77 |
-
}
|
78 |
-
|
79 |
-
.introjs-arrow {
|
80 |
-
border: 5px solid white;
|
81 |
-
content:'';
|
82 |
-
position: absolute;
|
83 |
-
}
|
84 |
-
.introjs-arrow.top {
|
85 |
-
top: -10px;
|
86 |
-
border-top-color:transparent;
|
87 |
-
border-right-color:transparent;
|
88 |
-
border-bottom-color:white;
|
89 |
-
border-left-color:transparent;
|
90 |
-
}
|
91 |
-
.introjs-arrow.right {
|
92 |
-
right: -10px;
|
93 |
-
top: 10px;
|
94 |
-
border-top-color:transparent;
|
95 |
-
border-right-color:transparent;
|
96 |
-
border-bottom-color:transparent;
|
97 |
-
border-left-color:white;
|
98 |
-
}
|
99 |
-
.introjs-arrow.bottom {
|
100 |
-
bottom: -10px;
|
101 |
-
border-top-color:white;
|
102 |
-
border-right-color:transparent;
|
103 |
-
border-bottom-color:transparent;
|
104 |
-
border-left-color:transparent;
|
105 |
-
}
|
106 |
-
.introjs-arrow.left {
|
107 |
-
left: -10px;
|
108 |
-
top: 10px;
|
109 |
-
border-top-color:transparent;
|
110 |
-
border-right-color:white;
|
111 |
-
border-bottom-color:transparent;
|
112 |
-
border-left-color:transparent;
|
113 |
-
}
|
114 |
-
|
115 |
-
.introjs-tooltip {
|
116 |
-
position: absolute;
|
117 |
-
padding: 10px;
|
118 |
-
background-color: white;
|
119 |
-
min-width: 200px;
|
120 |
-
max-width: 300px;
|
121 |
-
border-radius: 3px;
|
122 |
-
box-shadow: 0 1px 10px rgba(0,0,0,.4);
|
123 |
-
-webkit-transition: opacity 0.1s ease-out;
|
124 |
-
-moz-transition: opacity 0.1s ease-out;
|
125 |
-
-ms-transition: opacity 0.1s ease-out;
|
126 |
-
-o-transition: opacity 0.1s ease-out;
|
127 |
-
transition: opacity 0.1s ease-out;
|
128 |
-
}
|
129 |
-
|
130 |
-
.introjs-tooltipbuttons {
|
131 |
-
text-align: right;
|
132 |
-
}
|
133 |
-
|
134 |
-
/*
|
135 |
-
Buttons style by http://nicolasgallagher.com/lab/css3-github-buttons/
|
136 |
-
Changed by Afshin Mehrabani
|
137 |
-
*/
|
138 |
-
.introjs-button {
|
139 |
-
position: relative;
|
140 |
-
overflow: visible;
|
141 |
-
display: inline-block;
|
142 |
-
padding: 0.3em 0.8em;
|
143 |
-
border: 1px solid #d4d4d4;
|
144 |
-
margin: 0;
|
145 |
-
text-decoration: none;
|
146 |
-
text-shadow: 1px 1px 0 #fff;
|
147 |
-
font: 11px/normal sans-serif;
|
148 |
-
color: #333;
|
149 |
-
white-space: nowrap;
|
150 |
-
cursor: pointer;
|
151 |
-
outline: none;
|
152 |
-
background-color: #ececec;
|
153 |
-
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f4f4f4), to(#ececec));
|
154 |
-
background-image: -moz-linear-gradient(#f4f4f4, #ececec);
|
155 |
-
background-image: -o-linear-gradient(#f4f4f4, #ececec);
|
156 |
-
background-image: linear-gradient(#f4f4f4, #ececec);
|
157 |
-
-webkit-background-clip: padding;
|
158 |
-
-moz-background-clip: padding;
|
159 |
-
-o-background-clip: padding-box;
|
160 |
-
/*background-clip: padding-box;*/ /* commented out due to Opera 11.10 bug */
|
161 |
-
-webkit-border-radius: 0.2em;
|
162 |
-
-moz-border-radius: 0.2em;
|
163 |
-
border-radius: 0.2em;
|
164 |
-
/* IE hacks */
|
165 |
-
zoom: 1;
|
166 |
-
*display: inline;
|
167 |
-
margin-top: 10px;
|
168 |
-
}
|
169 |
-
|
170 |
-
.introjs-button:hover {
|
171 |
-
border-color: #bcbcbc;
|
172 |
-
text-decoration: none;
|
173 |
-
box-shadow: 0px 1px 1px #e3e3e3;
|
174 |
-
}
|
175 |
-
|
176 |
-
.introjs-button:focus,
|
177 |
-
.introjs-button:active {
|
178 |
-
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ececec), to(#f4f4f4));
|
179 |
-
background-image: -moz-linear-gradient(#ececec, #f4f4f4);
|
180 |
-
background-image: -o-linear-gradient(#ececec, #f4f4f4);
|
181 |
-
background-image: linear-gradient(#ececec, #f4f4f4);
|
182 |
-
}
|
183 |
-
|
184 |
-
/* overrides extra padding on button elements in Firefox */
|
185 |
-
.introjs-button::-moz-focus-inner {
|
186 |
-
padding: 0;
|
187 |
-
border: 0;
|
188 |
-
}
|
189 |
-
|
190 |
-
.introjs-skipbutton {
|
191 |
-
margin-right: 5px;
|
192 |
-
color: #7a7a7a;
|
193 |
-
}
|
194 |
-
|
195 |
-
.introjs-prevbutton {
|
196 |
-
-webkit-border-radius: 0.2em 0 0 0.2em;
|
197 |
-
-moz-border-radius: 0.2em 0 0 0.2em;
|
198 |
-
border-radius: 0.2em 0 0 0.2em;
|
199 |
-
border-right: none;
|
200 |
-
}
|
201 |
-
|
202 |
-
.introjs-nextbutton {
|
203 |
-
-webkit-border-radius: 0 0.2em 0.2em 0;
|
204 |
-
-moz-border-radius: 0 0.2em 0.2em 0;
|
205 |
-
border-radius: 0 0.2em 0.2em 0;
|
206 |
-
}
|
207 |
-
|
208 |
-
.introjs-disabled, .introjs-disabled:hover, .introjs-disabled:focus {
|
209 |
-
color: #9a9a9a;
|
210 |
-
border-color: #d4d4d4;
|
211 |
-
box-shadow: none;
|
212 |
-
cursor: default;
|
213 |
-
background-color: #f4f4f4;
|
214 |
-
background-image: none;
|
215 |
-
text-decoration: none;
|
216 |
-
}
|
1 |
+
.introjs-overlay {
|
2 |
+
position: absolute;
|
3 |
+
z-index: 999999;
|
4 |
+
background-color: #000;
|
5 |
+
opacity: 0;
|
6 |
+
background: -moz-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
7 |
+
background: -webkit-gradient(radial,center center,0px,center center,100%,color-stop(0%,rgba(0,0,0,0.4)),color-stop(100%,rgba(0,0,0,0.9)));
|
8 |
+
background: -webkit-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
9 |
+
background: -o-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
10 |
+
background: -ms-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
11 |
+
background: radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
12 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#66000000',endColorstr='#e6000000',GradientType=1);
|
13 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
|
14 |
+
filter: alpha(opacity=50);
|
15 |
+
-webkit-transition: all 0.3s ease-out;
|
16 |
+
-moz-transition: all 0.3s ease-out;
|
17 |
+
-ms-transition: all 0.3s ease-out;
|
18 |
+
-o-transition: all 0.3s ease-out;
|
19 |
+
transition: all 0.3s ease-out;
|
20 |
+
}
|
21 |
+
|
22 |
+
.introjs-fixParent {
|
23 |
+
z-index: auto !important;
|
24 |
+
}
|
25 |
+
|
26 |
+
.introjs-showElement {
|
27 |
+
z-index: 9999999 !important;
|
28 |
+
}
|
29 |
+
|
30 |
+
.introjs-relativePosition {
|
31 |
+
position: relative;
|
32 |
+
}
|
33 |
+
|
34 |
+
.introjs-helperLayer {
|
35 |
+
position: absolute;
|
36 |
+
z-index: 9999998;
|
37 |
+
background-color: #FFF;
|
38 |
+
background-color: rgba(255,255,255,.9);
|
39 |
+
border: 1px solid #777;
|
40 |
+
border: 1px solid rgba(0,0,0,.5);
|
41 |
+
border-radius: 4px;
|
42 |
+
box-shadow: 0 2px 15px rgba(0,0,0,.4);
|
43 |
+
-webkit-transition: all 0.3s ease-out;
|
44 |
+
-moz-transition: all 0.3s ease-out;
|
45 |
+
-ms-transition: all 0.3s ease-out;
|
46 |
+
-o-transition: all 0.3s ease-out;
|
47 |
+
transition: all 0.3s ease-out;
|
48 |
+
}
|
49 |
+
|
50 |
+
.introjs-helperNumberLayer {
|
51 |
+
position: absolute;
|
52 |
+
top: -18px;
|
53 |
+
left: -25px;
|
54 |
+
z-index: 9999999999 !important;
|
55 |
+
padding: 2px;
|
56 |
+
font-family: Arial, verdana, tahoma;
|
57 |
+
font-size: 13px;
|
58 |
+
font-weight: bold;
|
59 |
+
color: white;
|
60 |
+
text-align: center;
|
61 |
+
text-shadow: 1px 1px 1px rgba(0,0,0,.3);
|
62 |
+
background: #ff3019; /* Old browsers */
|
63 |
+
background: -webkit-linear-gradient(top, #ff3019 0%, #cf0404 100%); /* Chrome10+,Safari5.1+ */
|
64 |
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ff3019), color-stop(100%, #cf0404)); /* Chrome,Safari4+ */
|
65 |
+
background: -moz-linear-gradient(top, #ff3019 0%, #cf0404 100%); /* FF3.6+ */
|
66 |
+
background: -ms-linear-gradient(top, #ff3019 0%, #cf0404 100%); /* IE10+ */
|
67 |
+
background: -o-linear-gradient(top, #ff3019 0%, #cf0404 100%); /* Opera 11.10+ */
|
68 |
+
background: linear-gradient(to bottom, #ff3019 0%, #cf0404 100%); /* W3C */
|
69 |
+
width: 20px;
|
70 |
+
height:20px;
|
71 |
+
line-height: 20px;
|
72 |
+
border: 3px solid white;
|
73 |
+
border-radius: 50%;
|
74 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3019', endColorstr='#cf0404', GradientType=0); /* IE6-9 */
|
75 |
+
filter: progid:DXImageTransform.Microsoft.Shadow(direction=135, strength=2, color=ff0000); /* IE10 text shadows */
|
76 |
+
box-shadow: 0 2px 5px rgba(0,0,0,.4);
|
77 |
+
}
|
78 |
+
|
79 |
+
.introjs-arrow {
|
80 |
+
border: 5px solid white;
|
81 |
+
content:'';
|
82 |
+
position: absolute;
|
83 |
+
}
|
84 |
+
.introjs-arrow.top {
|
85 |
+
top: -10px;
|
86 |
+
border-top-color:transparent;
|
87 |
+
border-right-color:transparent;
|
88 |
+
border-bottom-color:white;
|
89 |
+
border-left-color:transparent;
|
90 |
+
}
|
91 |
+
.introjs-arrow.right {
|
92 |
+
right: -10px;
|
93 |
+
top: 10px;
|
94 |
+
border-top-color:transparent;
|
95 |
+
border-right-color:transparent;
|
96 |
+
border-bottom-color:transparent;
|
97 |
+
border-left-color:white;
|
98 |
+
}
|
99 |
+
.introjs-arrow.bottom {
|
100 |
+
bottom: -10px;
|
101 |
+
border-top-color:white;
|
102 |
+
border-right-color:transparent;
|
103 |
+
border-bottom-color:transparent;
|
104 |
+
border-left-color:transparent;
|
105 |
+
}
|
106 |
+
.introjs-arrow.left {
|
107 |
+
left: -10px;
|
108 |
+
top: 10px;
|
109 |
+
border-top-color:transparent;
|
110 |
+
border-right-color:white;
|
111 |
+
border-bottom-color:transparent;
|
112 |
+
border-left-color:transparent;
|
113 |
+
}
|
114 |
+
|
115 |
+
.introjs-tooltip {
|
116 |
+
position: absolute;
|
117 |
+
padding: 10px;
|
118 |
+
background-color: white;
|
119 |
+
min-width: 200px;
|
120 |
+
max-width: 300px;
|
121 |
+
border-radius: 3px;
|
122 |
+
box-shadow: 0 1px 10px rgba(0,0,0,.4);
|
123 |
+
-webkit-transition: opacity 0.1s ease-out;
|
124 |
+
-moz-transition: opacity 0.1s ease-out;
|
125 |
+
-ms-transition: opacity 0.1s ease-out;
|
126 |
+
-o-transition: opacity 0.1s ease-out;
|
127 |
+
transition: opacity 0.1s ease-out;
|
128 |
+
}
|
129 |
+
|
130 |
+
.introjs-tooltipbuttons {
|
131 |
+
text-align: right;
|
132 |
+
}
|
133 |
+
|
134 |
+
/*
|
135 |
+
Buttons style by http://nicolasgallagher.com/lab/css3-github-buttons/
|
136 |
+
Changed by Afshin Mehrabani
|
137 |
+
*/
|
138 |
+
.introjs-button {
|
139 |
+
position: relative;
|
140 |
+
overflow: visible;
|
141 |
+
display: inline-block;
|
142 |
+
padding: 0.3em 0.8em;
|
143 |
+
border: 1px solid #d4d4d4;
|
144 |
+
margin: 0;
|
145 |
+
text-decoration: none;
|
146 |
+
text-shadow: 1px 1px 0 #fff;
|
147 |
+
font: 11px/normal sans-serif;
|
148 |
+
color: #333;
|
149 |
+
white-space: nowrap;
|
150 |
+
cursor: pointer;
|
151 |
+
outline: none;
|
152 |
+
background-color: #ececec;
|
153 |
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f4f4f4), to(#ececec));
|
154 |
+
background-image: -moz-linear-gradient(#f4f4f4, #ececec);
|
155 |
+
background-image: -o-linear-gradient(#f4f4f4, #ececec);
|
156 |
+
background-image: linear-gradient(#f4f4f4, #ececec);
|
157 |
+
-webkit-background-clip: padding;
|
158 |
+
-moz-background-clip: padding;
|
159 |
+
-o-background-clip: padding-box;
|
160 |
+
/*background-clip: padding-box;*/ /* commented out due to Opera 11.10 bug */
|
161 |
+
-webkit-border-radius: 0.2em;
|
162 |
+
-moz-border-radius: 0.2em;
|
163 |
+
border-radius: 0.2em;
|
164 |
+
/* IE hacks */
|
165 |
+
zoom: 1;
|
166 |
+
*display: inline;
|
167 |
+
margin-top: 10px;
|
168 |
+
}
|
169 |
+
|
170 |
+
.introjs-button:hover {
|
171 |
+
border-color: #bcbcbc;
|
172 |
+
text-decoration: none;
|
173 |
+
box-shadow: 0px 1px 1px #e3e3e3;
|
174 |
+
}
|
175 |
+
|
176 |
+
.introjs-button:focus,
|
177 |
+
.introjs-button:active {
|
178 |
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ececec), to(#f4f4f4));
|
179 |
+
background-image: -moz-linear-gradient(#ececec, #f4f4f4);
|
180 |
+
background-image: -o-linear-gradient(#ececec, #f4f4f4);
|
181 |
+
background-image: linear-gradient(#ececec, #f4f4f4);
|
182 |
+
}
|
183 |
+
|
184 |
+
/* overrides extra padding on button elements in Firefox */
|
185 |
+
.introjs-button::-moz-focus-inner {
|
186 |
+
padding: 0;
|
187 |
+
border: 0;
|
188 |
+
}
|
189 |
+
|
190 |
+
.introjs-skipbutton {
|
191 |
+
margin-right: 5px;
|
192 |
+
color: #7a7a7a;
|
193 |
+
}
|
194 |
+
|
195 |
+
.introjs-prevbutton {
|
196 |
+
-webkit-border-radius: 0.2em 0 0 0.2em;
|
197 |
+
-moz-border-radius: 0.2em 0 0 0.2em;
|
198 |
+
border-radius: 0.2em 0 0 0.2em;
|
199 |
+
border-right: none;
|
200 |
+
}
|
201 |
+
|
202 |
+
.introjs-nextbutton {
|
203 |
+
-webkit-border-radius: 0 0.2em 0.2em 0;
|
204 |
+
-moz-border-radius: 0 0.2em 0.2em 0;
|
205 |
+
border-radius: 0 0.2em 0.2em 0;
|
206 |
+
}
|
207 |
+
|
208 |
+
.introjs-disabled, .introjs-disabled:hover, .introjs-disabled:focus {
|
209 |
+
color: #9a9a9a;
|
210 |
+
border-color: #d4d4d4;
|
211 |
+
box-shadow: none;
|
212 |
+
cursor: default;
|
213 |
+
background-color: #f4f4f4;
|
214 |
+
background-image: none;
|
215 |
+
text-decoration: none;
|
216 |
+
}
|
css/customizer.media-uploader.css
CHANGED
@@ -1,34 +1,34 @@
|
|
1 |
-
.media-upload-form {
|
2 |
-
margin-top: 20px;
|
3 |
-
width: 376px;
|
4 |
-
}
|
5 |
-
#media-upload #filter {
|
6 |
-
width: 376px;
|
7 |
-
}
|
8 |
-
.post_title, .image_alt, .post_excerpt, .post_content, .url, .align, .upload-flash-bypass, .max-upload-size {
|
9 |
-
display: none;
|
10 |
-
}
|
11 |
-
.media-upload-form {
|
12 |
-
width: 60% !important;
|
13 |
-
}
|
14 |
-
.savesend input.button {
|
15 |
-
background-color: #21759b;
|
16 |
-
background-image: -webkit-gradient(linear,left top,left bottom,from(#2a95c5),to(#21759b));
|
17 |
-
background-image: -webkit-linear-gradient(top,#2a95c5,#21759b);
|
18 |
-
background-image: -moz-linear-gradient(top,#2a95c5,#21759b);
|
19 |
-
background-image: -ms-linear-gradient(top,#2a95c5,#21759b);
|
20 |
-
background-image: -o-linear-gradient(top,#2a95c5,#21759b);
|
21 |
-
background-image: linear-gradient(to bottom,#2a95c5,#21759b);
|
22 |
-
border-color: #21759b;
|
23 |
-
border-bottom-color: #1e6a8d;
|
24 |
-
-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
|
25 |
-
box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
|
26 |
-
color: #fff;
|
27 |
-
text-decoration: none;
|
28 |
-
text-shadow: 0 1px 0 rgba(0,0,0,0.1);
|
29 |
-
height: 35px;
|
30 |
-
font-size: 20px;
|
31 |
-
}
|
32 |
-
.media-upload-form.type-form.validate, #image-form {
|
33 |
-
width: 60% !important;
|
34 |
}
|
1 |
+
.media-upload-form {
|
2 |
+
margin-top: 20px;
|
3 |
+
width: 376px;
|
4 |
+
}
|
5 |
+
#media-upload #filter {
|
6 |
+
width: 376px;
|
7 |
+
}
|
8 |
+
.post_title, .image_alt, .post_excerpt, .post_content, .url, .align, .upload-flash-bypass, .max-upload-size {
|
9 |
+
display: none;
|
10 |
+
}
|
11 |
+
.media-upload-form {
|
12 |
+
width: 60% !important;
|
13 |
+
}
|
14 |
+
.savesend input.button {
|
15 |
+
background-color: #21759b;
|
16 |
+
background-image: -webkit-gradient(linear,left top,left bottom,from(#2a95c5),to(#21759b));
|
17 |
+
background-image: -webkit-linear-gradient(top,#2a95c5,#21759b);
|
18 |
+
background-image: -moz-linear-gradient(top,#2a95c5,#21759b);
|
19 |
+
background-image: -ms-linear-gradient(top,#2a95c5,#21759b);
|
20 |
+
background-image: -o-linear-gradient(top,#2a95c5,#21759b);
|
21 |
+
background-image: linear-gradient(to bottom,#2a95c5,#21759b);
|
22 |
+
border-color: #21759b;
|
23 |
+
border-bottom-color: #1e6a8d;
|
24 |
+
-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
|
25 |
+
box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
|
26 |
+
color: #fff;
|
27 |
+
text-decoration: none;
|
28 |
+
text-shadow: 0 1px 0 rgba(0,0,0,0.1);
|
29 |
+
height: 35px;
|
30 |
+
font-size: 20px;
|
31 |
+
}
|
32 |
+
.media-upload-form.type-form.validate, #image-form {
|
33 |
+
width: 60% !important;
|
34 |
}
|
images/cta-install.png
ADDED
Binary file
|
images/github-help.jpg
ADDED
Binary file
|
images/image.php
CHANGED
@@ -1,57 +1,57 @@
|
|
1 |
-
<?php
|
2 |
-
// file: image.php
|
3 |
-
// Dynamically Create a clear png for css background opacities
|
4 |
-
header("Content-type: image/png");
|
5 |
-
|
6 |
-
$hex_value = $_GET['hex'];
|
7 |
-
|
8 |
-
if (isset($_GET['trans'])) {
|
9 |
-
$trans_value = $_GET['trans'];
|
10 |
-
}
|
11 |
-
else {
|
12 |
-
$trans_value = 50;
|
13 |
-
}
|
14 |
-
|
15 |
-
// Convert Hex to RGB Value
|
16 |
-
function HexToRGB($hex) {
|
17 |
-
$hex = preg_replace("/#/", "", $hex);
|
18 |
-
$color = array();
|
19 |
-
|
20 |
-
if(strlen($hex) == 3) {
|
21 |
-
$color['r'] = hexdec(substr($hex, 0, 1) . $r);
|
22 |
-
$color['g'] = hexdec(substr($hex, 1, 1) . $g);
|
23 |
-
$color['b'] = hexdec(substr($hex, 2, 1) . $b);
|
24 |
-
}
|
25 |
-
else if(strlen($hex) == 6) {
|
26 |
-
$color['r'] = hexdec(substr($hex, 0, 2));
|
27 |
-
$color['g'] = hexdec(substr($hex, 2, 2));
|
28 |
-
$color['b'] = hexdec(substr($hex, 4, 2));
|
29 |
-
}
|
30 |
-
|
31 |
-
return $color;
|
32 |
-
|
33 |
-
}
|
34 |
-
|
35 |
-
$RBG_array = HexToRGB($hex_value);
|
36 |
-
$red = $RBG_array [r];
|
37 |
-
$green = $RBG_array [g];
|
38 |
-
$blue = $RBG_array [b];
|
39 |
-
|
40 |
-
// Set the image
|
41 |
-
$img = imagecreatetruecolor(10,10); // 10 x 10 px
|
42 |
-
imagesavealpha($img, true);
|
43 |
-
|
44 |
-
// Fill the image with transparent color
|
45 |
-
$color = imagecolorallocatealpha($img,$red,$green,$blue,$trans_value);
|
46 |
-
imagefill($img, 0, 0, $color);
|
47 |
-
|
48 |
-
// Return the image
|
49 |
-
imagepng($img);
|
50 |
-
|
51 |
-
// Destroy image
|
52 |
-
imagedestroy($img);
|
53 |
-
|
54 |
-
// usage in html: <image src="path-to-file/image.php?hex=HEXCOLOR">
|
55 |
-
// Make sure to add in the HEX GET Parameters with ?hex= and ?trans= for transparency
|
56 |
-
// example: <image src="path-to-file/image.php?hex=ffffff"> will call white transparent png
|
57 |
?>
|
1 |
+
<?php
|
2 |
+
// file: image.php
|
3 |
+
// Dynamically Create a clear png for css background opacities
|
4 |
+
header("Content-type: image/png");
|
5 |
+
|
6 |
+
$hex_value = $_GET['hex'];
|
7 |
+
|
8 |
+
if (isset($_GET['trans'])) {
|
9 |
+
$trans_value = $_GET['trans'];
|
10 |
+
}
|
11 |
+
else {
|
12 |
+
$trans_value = 50;
|
13 |
+
}
|
14 |
+
|
15 |
+
// Convert Hex to RGB Value
|
16 |
+
function HexToRGB($hex) {
|
17 |
+
$hex = preg_replace("/#/", "", $hex);
|
18 |
+
$color = array();
|
19 |
+
|
20 |
+
if(strlen($hex) == 3) {
|
21 |
+
$color['r'] = hexdec(substr($hex, 0, 1) . $r);
|
22 |
+
$color['g'] = hexdec(substr($hex, 1, 1) . $g);
|
23 |
+
$color['b'] = hexdec(substr($hex, 2, 1) . $b);
|
24 |
+
}
|
25 |
+
else if(strlen($hex) == 6) {
|
26 |
+
$color['r'] = hexdec(substr($hex, 0, 2));
|
27 |
+
$color['g'] = hexdec(substr($hex, 2, 2));
|
28 |
+
$color['b'] = hexdec(substr($hex, 4, 2));
|
29 |
+
}
|
30 |
+
|
31 |
+
return $color;
|
32 |
+
|
33 |
+
}
|
34 |
+
|
35 |
+
$RBG_array = HexToRGB($hex_value);
|
36 |
+
$red = $RBG_array [r];
|
37 |
+
$green = $RBG_array [g];
|
38 |
+
$blue = $RBG_array [b];
|
39 |
+
|
40 |
+
// Set the image
|
41 |
+
$img = imagecreatetruecolor(10,10); // 10 x 10 px
|
42 |
+
imagesavealpha($img, true);
|
43 |
+
|
44 |
+
// Fill the image with transparent color
|
45 |
+
$color = imagecolorallocatealpha($img,$red,$green,$blue,$trans_value);
|
46 |
+
imagefill($img, 0, 0, $color);
|
47 |
+
|
48 |
+
// Return the image
|
49 |
+
imagepng($img);
|
50 |
+
|
51 |
+
// Destroy image
|
52 |
+
imagedestroy($img);
|
53 |
+
|
54 |
+
// usage in html: <image src="path-to-file/image.php?hex=HEXCOLOR">
|
55 |
+
// Make sure to add in the HEX GET Parameters with ?hex= and ?trans= for transparency
|
56 |
+
// example: <image src="path-to-file/image.php?hex=ffffff"> will call white transparent png
|
57 |
?>
|
images/leads-install.png
ADDED
Binary file
|
index.php
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
<?php
|
2 |
# Silence is golden.
|
1 |
+
<?php
|
2 |
# Silence is golden.
|
js/admin/admin.install-plugins.js
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
+
/* Loads on /themes.php?page=install-inbound-plugins */
|
3 |
+
var install_status = jQuery("#the-list td.status.column-status").text();
|
4 |
+
var click_apply = "<h2 class='click-to-activate'><span>←</span>Click Apply to Install</h2>";
|
5 |
+
var activate_apply = "<h2 class='click-to-activate-bulk'><span>←</span>Click Apply to Bulk Activate Plugins</h2>";
|
6 |
+
jQuery(".alignleft.actions.bulkactions").after(click_apply);
|
7 |
+
jQuery(".alignleft.actions.bulkactions").after(activate_apply);
|
8 |
+
console.log(install_status);
|
9 |
+
jQuery('#the-list td.status.column-status').each(function(){
|
10 |
+
var installed_on = $(this).text();
|
11 |
+
if (installed_on === "Not Installed") {
|
12 |
+
$(this).parent().find("input[type=checkbox]").attr("checked", "on");
|
13 |
+
if ( $(".click-to-activate-bulk").is(":hidden") ) {
|
14 |
+
jQuery('.click-to-activate').show();
|
15 |
+
jQuery(".alignleft.actions.bulkactions select").val('tgmpa-bulk-install');
|
16 |
+
}
|
17 |
+
|
18 |
+
}
|
19 |
+
if (installed_on === "Installed But Not Activated") {
|
20 |
+
$(this).parent().find("input[type=checkbox]").attr("checked", "on");
|
21 |
+
if ( $(".click-to-activate").is(":hidden") ) {
|
22 |
+
jQuery('.click-to-activate-bulk').show();
|
23 |
+
jQuery(".alignleft.actions.bulkactions select").val('tgmpa-bulk-activate');
|
24 |
+
}
|
25 |
+
|
26 |
+
}
|
27 |
+
});
|
28 |
+
jQuery("#cb-select-all-1, #cb-select-all-2").attr("checked", "on");
|
29 |
+
|
30 |
+
});
|
js/admin/admin.landing-page-list.js
CHANGED
@@ -1,160 +1,160 @@
|
|
1 |
-
jQuery(document).ready(function($) {
|
2 |
-
// Code for landing page list view
|
3 |
-
var cats = jQuery("#landing_page_category option").length;
|
4 |
-
if ( cats === 0 ){
|
5 |
-
jQuery("#landing_page_category").hide();
|
6 |
-
}
|
7 |
-
|
8 |
-
jQuery('.lp-letter').each(function(){
|
9 |
-
var draft = jQuery(this).text();
|
10 |
-
if ( draft === "" ){
|
11 |
-
jQuery(this).parent().parent().hide();
|
12 |
-
}
|
13 |
-
});
|
14 |
-
|
15 |
-
jQuery(".lp-impress-num").each(function(){
|
16 |
-
var empty = jQuery(this).text();
|
17 |
-
if ( empty === "" || empty === "0" ){
|
18 |
-
jQuery(this).parent().parent().find(".lp-letter").css("color", "#ccc");
|
19 |
-
jQuery(this).parent().html("<span class='lp-no-stats'>no stats yet</span>");
|
20 |
-
}
|
21 |
-
});
|
22 |
-
/* List tour */
|
23 |
-
var tourbutton = '<a class="" id="lp-tour" style="font-size:13px;">Need help? Take the tour</a>';
|
24 |
-
jQuery(tourbutton).appendTo("h2:eq(0)");
|
25 |
-
jQuery("body").on('click', '#lp-tour', function () {
|
26 |
-
var tour = jQuery("#lp-tour-style").length;
|
27 |
-
if ( tour === 0 ) {
|
28 |
-
jQuery('head').append("<link rel='stylesheet' id='lp-tour-style' href='/wp-content/plugins/landing-pages/css/admin-tour.css' type='text/css' /><script type='text/javascript' src='/wp-content/plugins/landing-pages/js/admin/tour/tour.post-list.js'></script><script type='text/javascript' src='/wp-content/plugins/landing-pages/js/admin/intro.js'></script>");
|
29 |
-
}
|
30 |
-
setTimeout(function() {
|
31 |
-
introJs().start(); // start tour
|
32 |
-
}, 300);
|
33 |
-
|
34 |
-
});
|
35 |
-
/*jQuery(".lp-varation-stat-ul").each(function(){
|
36 |
-
var length = jQuery(this).find("li").length;
|
37 |
-
if ( length < 3 ){
|
38 |
-
jQuery(this).find("li").first().css("padding-top", "18px");
|
39 |
-
}
|
40 |
-
});
|
41 |
-
*/
|
42 |
-
jQuery("body").on('mouseenter', 'tr.type-landing-page', function () {
|
43 |
-
jQuery(this).find(".no-stats-yet").show();
|
44 |
-
});
|
45 |
-
jQuery("body").on('mouseleave', 'tr.type-landing-page', function () {
|
46 |
-
jQuery(this).find(".no-stats-yet").hide();
|
47 |
-
});
|
48 |
-
jQuery(".variation-winner-is").each(function(){
|
49 |
-
var target = jQuery(this).text();
|
50 |
-
jQuery("." + target).addClass("winner-lp").attr("data-lp", "Current Winner");
|
51 |
-
});
|
52 |
-
|
53 |
-
var hidestats = "<span id='hide-stats'>(Hide Stats)</span><span class='show-stats show-stats-top'>Show Stats</span>";
|
54 |
-
jQuery("#stats").append(hidestats);
|
55 |
-
|
56 |
-
jQuery("body").on('click', '#hide-stats', function () {
|
57 |
-
jQuery(".lp-varation-stat-ul").each(function(){
|
58 |
-
jQuery(this).hide();
|
59 |
-
});
|
60 |
-
jQuery(".show-stats").show();
|
61 |
-
jQuery("#hide-stats").hide();
|
62 |
-
});
|
63 |
-
|
64 |
-
jQuery("body").on('click', '.show-stats-top', function () {
|
65 |
-
jQuery(".lp-varation-stat-ul").each(function(){
|
66 |
-
jQuery(this).show();
|
67 |
-
});
|
68 |
-
jQuery(".show-stats").hide();
|
69 |
-
jQuery("#hide-stats").show();
|
70 |
-
});
|
71 |
-
|
72 |
-
jQuery("body").on('click', '.show-stats', function () {
|
73 |
-
jQuery(this).hide();
|
74 |
-
jQuery(this).parent().find(".lp-varation-stat-ul").show();
|
75 |
-
});
|
76 |
-
|
77 |
-
jQuery('.lp-letter, .cr-number, .qtip').on('mouseenter', function(event) {
|
78 |
-
// Bind the qTip within the event handler
|
79 |
-
var text_in_tip = jQuery(this).attr("data-notes");
|
80 |
-
var letter = jQuery(this).attr("data-letter");
|
81 |
-
var status = "<span class='lp-paused'>" + jQuery(this).parent().attr("rel") + "</span>";
|
82 |
-
var winner = "<span class='lp-win'>" + jQuery(this).parent().attr("data-lp") + "</span>";
|
83 |
-
jQuery(this).qtip({
|
84 |
-
overwrite: false, // Make sure the tooltip won't be overridden once created
|
85 |
-
content: {
|
86 |
-
text: text_in_tip,
|
87 |
-
title: {
|
88 |
-
text: 'Variation ' + letter + "<span class='lp-extra'>" + status + winner + "</span>" + "<span class='lp-pop-close'>close</span>"
|
89 |
-
}
|
90 |
-
},
|
91 |
-
position: {
|
92 |
-
my: 'bottom center', // Use the corner...
|
93 |
-
at: 'top center', // ...and opposite corner
|
94 |
-
viewport: jQuery(window)
|
95 |
-
},
|
96 |
-
style: {
|
97 |
-
classes: 'qtip-shadow qtip-jtools',
|
98 |
-
},
|
99 |
-
show: {
|
100 |
-
event: event.type, // Use the same show event as the one that triggered the event handler
|
101 |
-
ready: true, // Show the tooltip as soon as it's bound, vital so it shows up the first time you hover!
|
102 |
-
solo: true
|
103 |
-
},
|
104 |
-
//hide: 'unfocus'
|
105 |
-
hide: { when: { event: 'inactive' }, delay: 1200 }
|
106 |
-
}, event); // Pass through our original event to qTip
|
107 |
-
})
|
108 |
-
|
109 |
-
jQuery('.lp-letter').on('mouseleave', function(event) {
|
110 |
-
|
111 |
-
|
112 |
-
});
|
113 |
-
|
114 |
-
jQuery("body").on("click", ".lp-pop-close", function(event) {
|
115 |
-
jQuery(this).parent().parent().parent().hide();
|
116 |
-
});
|
117 |
-
|
118 |
-
jQuery("body").on("click", ".lp-pop-preview a", function(event) {
|
119 |
-
jQuery(this).parent().parent().parent().parent().hide();
|
120 |
-
});
|
121 |
-
|
122 |
-
// Fix Thickbox width/hieght
|
123 |
-
jQuery(function($) {
|
124 |
-
tb_position = function() {
|
125 |
-
var tbWindow = $('#TB_window');
|
126 |
-
var width = $(window).width();
|
127 |
-
var H = $(window).height();
|
128 |
-
var W = ( 1720 < width ) ? 1720 : width;
|
129 |
-
|
130 |
-
if ( tbWindow.size() ) {
|
131 |
-
tbWindow.width( W - 50 ).height( H - 45 );
|
132 |
-
$('#TB_iframeContent').width( W - 50 ).height( H - 75 );
|
133 |
-
tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
|
134 |
-
if ( typeof document.body.style.maxWidth != 'undefined' )
|
135 |
-
tbWindow.css({'top':'40px','margin-top':'0'});
|
136 |
-
//$('#TB_title').css({'background-color':'#fff','color':'#cfcfcf'});
|
137 |
-
};
|
138 |
-
|
139 |
-
return $('a.thickbox').each( function() {
|
140 |
-
var href = $(this).attr('href');
|
141 |
-
if ( ! href ) return;
|
142 |
-
href = href.replace(/&width=[0-9]+/g, '');
|
143 |
-
href = href.replace(/&height=[0-9]+/g, '');
|
144 |
-
$(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
|
145 |
-
});
|
146 |
-
|
147 |
-
};
|
148 |
-
|
149 |
-
jQuery('a.thickbox').click(function(){
|
150 |
-
if ( typeof tinyMCE != 'undefined' && tinyMCE.activeEditor ) {
|
151 |
-
tinyMCE.get('content').focus();
|
152 |
-
tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark('simple');
|
153 |
-
}
|
154 |
-
|
155 |
-
});
|
156 |
-
|
157 |
-
$(window).resize( function() { tb_position() } );
|
158 |
-
});
|
159 |
-
|
160 |
});
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
+
// Code for landing page list view
|
3 |
+
var cats = jQuery("#landing_page_category option").length;
|
4 |
+
if ( cats === 0 ){
|
5 |
+
jQuery("#landing_page_category").hide();
|
6 |
+
}
|
7 |
+
|
8 |
+
jQuery('.lp-letter').each(function(){
|
9 |
+
var draft = jQuery(this).text();
|
10 |
+
if ( draft === "" ){
|
11 |
+
jQuery(this).parent().parent().hide();
|
12 |
+
}
|
13 |
+
});
|
14 |
+
|
15 |
+
jQuery(".lp-impress-num").each(function(){
|
16 |
+
var empty = jQuery(this).text();
|
17 |
+
if ( empty === "" || empty === "0" ){
|
18 |
+
jQuery(this).parent().parent().find(".lp-letter").css("color", "#ccc");
|
19 |
+
jQuery(this).parent().html("<span class='lp-no-stats'>no stats yet</span>");
|
20 |
+
}
|
21 |
+
});
|
22 |
+
/* List tour */
|
23 |
+
var tourbutton = '<a class="" id="lp-tour" style="font-size:13px;">Need help? Take the tour</a>';
|
24 |
+
jQuery(tourbutton).appendTo("h2:eq(0)");
|
25 |
+
jQuery("body").on('click', '#lp-tour', function () {
|
26 |
+
var tour = jQuery("#lp-tour-style").length;
|
27 |
+
if ( tour === 0 ) {
|
28 |
+
jQuery('head').append("<link rel='stylesheet' id='lp-tour-style' href='/wp-content/plugins/landing-pages/css/admin-tour.css' type='text/css' /><script type='text/javascript' src='/wp-content/plugins/landing-pages/js/admin/tour/tour.post-list.js'></script><script type='text/javascript' src='/wp-content/plugins/landing-pages/js/admin/intro.js'></script>");
|
29 |
+
}
|
30 |
+
setTimeout(function() {
|
31 |
+
introJs().start(); // start tour
|
32 |
+
}, 300);
|
33 |
+
|
34 |
+
});
|
35 |
+
/*jQuery(".lp-varation-stat-ul").each(function(){
|
36 |
+
var length = jQuery(this).find("li").length;
|
37 |
+
if ( length < 3 ){
|
38 |
+
jQuery(this).find("li").first().css("padding-top", "18px");
|
39 |
+
}
|
40 |
+
});
|
41 |
+
*/
|
42 |
+
jQuery("body").on('mouseenter', 'tr.type-landing-page', function () {
|
43 |
+
jQuery(this).find(".no-stats-yet").show();
|
44 |
+
});
|
45 |
+
jQuery("body").on('mouseleave', 'tr.type-landing-page', function () {
|
46 |
+
jQuery(this).find(".no-stats-yet").hide();
|
47 |
+
});
|
48 |
+
jQuery(".variation-winner-is").each(function(){
|
49 |
+
var target = jQuery(this).text();
|
50 |
+
jQuery("." + target).addClass("winner-lp").attr("data-lp", "Current Winner");
|
51 |
+
});
|
52 |
+
|
53 |
+
var hidestats = "<span id='hide-stats'>(Hide Stats)</span><span class='show-stats show-stats-top'>Show Stats</span>";
|
54 |
+
jQuery("#stats").append(hidestats);
|
55 |
+
|
56 |
+
jQuery("body").on('click', '#hide-stats', function () {
|
57 |
+
jQuery(".lp-varation-stat-ul").each(function(){
|
58 |
+
jQuery(this).hide();
|
59 |
+
});
|
60 |
+
jQuery(".show-stats").show();
|
61 |
+
jQuery("#hide-stats").hide();
|
62 |
+
});
|
63 |
+
|
64 |
+
jQuery("body").on('click', '.show-stats-top', function () {
|
65 |
+
jQuery(".lp-varation-stat-ul").each(function(){
|
66 |
+
jQuery(this).show();
|
67 |
+
});
|
68 |
+
jQuery(".show-stats").hide();
|
69 |
+
jQuery("#hide-stats").show();
|
70 |
+
});
|
71 |
+
|
72 |
+
jQuery("body").on('click', '.show-stats', function () {
|
73 |
+
jQuery(this).hide();
|
74 |
+
jQuery(this).parent().find(".lp-varation-stat-ul").show();
|
75 |
+
});
|
76 |
+
|
77 |
+
jQuery('.lp-letter, .cr-number, .qtip').on('mouseenter', function(event) {
|
78 |
+
// Bind the qTip within the event handler
|
79 |
+
var text_in_tip = jQuery(this).attr("data-notes");
|
80 |
+
var letter = jQuery(this).attr("data-letter");
|
81 |
+
var status = "<span class='lp-paused'>" + jQuery(this).parent().attr("rel") + "</span>";
|
82 |
+
var winner = "<span class='lp-win'>" + jQuery(this).parent().attr("data-lp") + "</span>";
|
83 |
+
jQuery(this).qtip({
|
84 |
+
overwrite: false, // Make sure the tooltip won't be overridden once created
|
85 |
+
content: {
|
86 |
+
text: text_in_tip,
|
87 |
+
title: {
|
88 |
+
text: 'Variation ' + letter + "<span class='lp-extra'>" + status + winner + "</span>" + "<span class='lp-pop-close'>close</span>"
|
89 |
+
}
|
90 |
+
},
|
91 |
+
position: {
|
92 |
+
my: 'bottom center', // Use the corner...
|
93 |
+
at: 'top center', // ...and opposite corner
|
94 |
+
viewport: jQuery(window)
|
95 |
+
},
|
96 |
+
style: {
|
97 |
+
classes: 'qtip-shadow qtip-jtools',
|
98 |
+
},
|
99 |
+
show: {
|
100 |
+
event: event.type, // Use the same show event as the one that triggered the event handler
|
101 |
+
ready: true, // Show the tooltip as soon as it's bound, vital so it shows up the first time you hover!
|
102 |
+
solo: true
|
103 |
+
},
|
104 |
+
//hide: 'unfocus'
|
105 |
+
hide: { when: { event: 'inactive' }, delay: 1200 }
|
106 |
+
}, event); // Pass through our original event to qTip
|
107 |
+
})
|
108 |
+
|
109 |
+
jQuery('.lp-letter').on('mouseleave', function(event) {
|
110 |
+
|
111 |
+
|
112 |
+
});
|
113 |
+
|
114 |
+
jQuery("body").on("click", ".lp-pop-close", function(event) {
|
115 |
+
jQuery(this).parent().parent().parent().hide();
|
116 |
+
});
|
117 |
+
|
118 |
+
jQuery("body").on("click", ".lp-pop-preview a", function(event) {
|
119 |
+
jQuery(this).parent().parent().parent().parent().hide();
|
120 |
+
});
|
121 |
+
|
122 |
+
// Fix Thickbox width/hieght
|
123 |
+
jQuery(function($) {
|
124 |
+
tb_position = function() {
|
125 |
+
var tbWindow = $('#TB_window');
|
126 |
+
var width = $(window).width();
|
127 |
+
var H = $(window).height();
|
128 |
+
var W = ( 1720 < width ) ? 1720 : width;
|
129 |
+
|
130 |
+
if ( tbWindow.size() ) {
|
131 |
+
tbWindow.width( W - 50 ).height( H - 45 );
|
132 |
+
$('#TB_iframeContent').width( W - 50 ).height( H - 75 );
|
133 |
+
tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
|
134 |
+
if ( typeof document.body.style.maxWidth != 'undefined' )
|
135 |
+
tbWindow.css({'top':'40px','margin-top':'0'});
|
136 |
+
//$('#TB_title').css({'background-color':'#fff','color':'#cfcfcf'});
|
137 |
+
};
|
138 |
+
|
139 |
+
return $('a.thickbox').each( function() {
|
140 |
+
var href = $(this).attr('href');
|
141 |
+
if ( ! href ) return;
|
142 |
+
href = href.replace(/&width=[0-9]+/g, '');
|
143 |
+
href = href.replace(/&height=[0-9]+/g, '');
|
144 |
+
$(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
|
145 |
+
});
|
146 |
+
|
147 |
+
};
|
148 |
+
|
149 |
+
jQuery('a.thickbox').click(function(){
|
150 |
+
if ( typeof tinyMCE != 'undefined' && tinyMCE.activeEditor ) {
|
151 |
+
tinyMCE.get('content').focus();
|
152 |
+
tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark('simple');
|
153 |
+
}
|
154 |
+
|
155 |
+
});
|
156 |
+
|
157 |
+
$(window).resize( function() { tb_position() } );
|
158 |
+
});
|
159 |
+
|
160 |
});
|
js/admin/admin.metaboxes.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function($) {
|
1 |
+
jQuery(document).ready(function($) {
|
js/admin/admin.post-edit-ab-testing.js
CHANGED
@@ -1,72 +1,72 @@
|
|
1 |
-
jQuery(document).ready(function ($) {
|
2 |
-
var variations = new Array();
|
3 |
-
var has_variations = 0;
|
4 |
-
if (variation.variations)
|
5 |
-
{
|
6 |
-
variations = variation.variations.split(",");
|
7 |
-
}
|
8 |
-
|
9 |
-
|
10 |
-
var hidden_html = '<input type="hidden" id="better-ab-testing-variation" name="lp-variation-id" value="'+ variation.vid +'">';
|
11 |
-
jQuery('.wrap form').prepend(hidden_html);
|
12 |
-
|
13 |
-
var replace_slash = '\\';
|
14 |
-
|
15 |
-
//variation.content_area = variation.content_area.replace(/\n/g, replace_slash);
|
16 |
-
//variation.content_area = variation.content_area.replace(/\r\n/g, "<br/>").replace(/\r/g, "<br/>").replace(/\n/g, "<br/>");
|
17 |
-
|
18 |
-
jQuery("#wp-content-editor-container textarea").val(variation.content_area);
|
19 |
-
jQuery("#content_ifr").contents().find("body").html(variation.content_area);
|
20 |
-
|
21 |
-
|
22 |
-
var html;
|
23 |
-
if (variation.vid>0&&variation.new_variation!=1)
|
24 |
-
{
|
25 |
-
html = '<a class="add-new-h2" href="?post='+variation.pid+'&action=edit&lp-variation-id='+variation.vid+'&ab-action=delete-variation">Delete This Variation</a>';
|
26 |
-
jQuery('.wrap h2:first').append(html);
|
27 |
-
}
|
28 |
-
|
29 |
-
if (variation.vid>0)
|
30 |
-
{
|
31 |
-
jQuery('#delete-action').remove();
|
32 |
-
}
|
33 |
-
|
34 |
-
//alter preview and customizer buttons based on open variation
|
35 |
-
var preview_href = jQuery('#post-preview').attr('href');
|
36 |
-
jQuery('#post-preview').attr('href',preview_href+'?lp-variation-id='+variation.vid);
|
37 |
-
//jQuery('#view-post-btn a:first').attr('href',preview_href+'?lp-variation-id='+variation.vid);
|
38 |
-
//jQuery('.new-save-lp-frontend').attr('href',preview_href+'?template-customize=on&lp-variation-id='+variation.vid);
|
39 |
-
|
40 |
-
//setup timer and and navigation change events
|
41 |
-
var input_change = jQuery("#switch-lp").text();
|
42 |
-
jQuery('.wrap').on('keyup change', jQuery('form').find('input[type=text],textarea,select'), function() {
|
43 |
-
jQuery("#switch-lp").text("1");
|
44 |
-
console.log("change");
|
45 |
-
});
|
46 |
-
|
47 |
-
/*setTimeout(function () {
|
48 |
-
input_change = 1;
|
49 |
-
}, 15000);
|
50 |
-
*/
|
51 |
-
jQuery('.wrap').on('click', '.nav-tab-wrapper a', function(e) {
|
52 |
-
var this_id = this.id.replace('tabs-','');
|
53 |
-
if (input_change==1)
|
54 |
-
{
|
55 |
-
var answer = confirm('Do you want to change variations without saving the changes made here?');
|
56 |
-
if (answer){
|
57 |
-
// do the default action
|
58 |
-
} else {
|
59 |
-
e.preventDefault();
|
60 |
-
}
|
61 |
-
}
|
62 |
-
|
63 |
-
jQuery('.lp-tab-display').css('display','none');
|
64 |
-
jQuery('#'+this_id).css('display','block');
|
65 |
-
jQuery('.lp-nav-tab').removeClass('nav-tab-special-active');
|
66 |
-
jQuery('.lp-nav-tab').addClass('nav-tab-special-inactive');
|
67 |
-
jQuery('#tabs-'+this_id).addClass('nav-tab-special-active');
|
68 |
-
jQuery('#id-open-tab').val(this_id);
|
69 |
-
|
70 |
-
});
|
71 |
-
|
72 |
});
|
1 |
+
jQuery(document).ready(function ($) {
|
2 |
+
var variations = new Array();
|
3 |
+
var has_variations = 0;
|
4 |
+
if (variation.variations)
|
5 |
+
{
|
6 |
+
variations = variation.variations.split(",");
|
7 |
+
}
|
8 |
+
|
9 |
+
|
10 |
+
var hidden_html = '<input type="hidden" id="better-ab-testing-variation" name="lp-variation-id" value="'+ variation.vid +'">';
|
11 |
+
jQuery('.wrap form').prepend(hidden_html);
|
12 |
+
|
13 |
+
var replace_slash = '\\';
|
14 |
+
|
15 |
+
//variation.content_area = variation.content_area.replace(/\n/g, replace_slash);
|
16 |
+
//variation.content_area = variation.content_area.replace(/\r\n/g, "<br/>").replace(/\r/g, "<br/>").replace(/\n/g, "<br/>");
|
17 |
+
|
18 |
+
jQuery("#wp-content-editor-container textarea").val(variation.content_area);
|
19 |
+
jQuery("#content_ifr").contents().find("body").html(variation.content_area);
|
20 |
+
|
21 |
+
|
22 |
+
var html;
|
23 |
+
if (variation.vid>0&&variation.new_variation!=1)
|
24 |
+
{
|
25 |
+
html = '<a class="add-new-h2" href="?post='+variation.pid+'&action=edit&lp-variation-id='+variation.vid+'&ab-action=delete-variation">Delete This Variation</a>';
|
26 |
+
jQuery('.wrap h2:first').append(html);
|
27 |
+
}
|
28 |
+
|
29 |
+
if (variation.vid>0)
|
30 |
+
{
|
31 |
+
jQuery('#delete-action').remove();
|
32 |
+
}
|
33 |
+
|
34 |
+
//alter preview and customizer buttons based on open variation
|
35 |
+
var preview_href = jQuery('#post-preview').attr('href');
|
36 |
+
jQuery('#post-preview').attr('href',preview_href+'?lp-variation-id='+variation.vid);
|
37 |
+
//jQuery('#view-post-btn a:first').attr('href',preview_href+'?lp-variation-id='+variation.vid);
|
38 |
+
//jQuery('.new-save-lp-frontend').attr('href',preview_href+'?template-customize=on&lp-variation-id='+variation.vid);
|
39 |
+
|
40 |
+
//setup timer and and navigation change events
|
41 |
+
var input_change = jQuery("#switch-lp").text();
|
42 |
+
jQuery('.wrap').on('keyup change', jQuery('form').find('input[type=text],textarea,select'), function() {
|
43 |
+
jQuery("#switch-lp").text("1");
|
44 |
+
console.log("change");
|
45 |
+
});
|
46 |
+
|
47 |
+
/*setTimeout(function () {
|
48 |
+
input_change = 1;
|
49 |
+
}, 15000);
|
50 |
+
*/
|
51 |
+
jQuery('.wrap').on('click', '.nav-tab-wrapper a', function(e) {
|
52 |
+
var this_id = this.id.replace('tabs-','');
|
53 |
+
if (input_change==1)
|
54 |
+
{
|
55 |
+
var answer = confirm('Do you want to change variations without saving the changes made here?');
|
56 |
+
if (answer){
|
57 |
+
// do the default action
|
58 |
+
} else {
|
59 |
+
e.preventDefault();
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
jQuery('.lp-tab-display').css('display','none');
|
64 |
+
jQuery('#'+this_id).css('display','block');
|
65 |
+
jQuery('.lp-nav-tab').removeClass('nav-tab-special-active');
|
66 |
+
jQuery('.lp-nav-tab').addClass('nav-tab-special-inactive');
|
67 |
+
jQuery('#tabs-'+this_id).addClass('nav-tab-special-active');
|
68 |
+
jQuery('#id-open-tab').val(this_id);
|
69 |
+
|
70 |
+
});
|
71 |
+
|
72 |
});
|
js/admin/admin.post-edit.js
CHANGED
@@ -1,567 +1,568 @@
|
|
1 |
-
jQuery(document).ready(function ($) {
|
2 |
-
|
3 |
-
jQuery('#templates-container').isotope();
|
4 |
-
|
5 |
-
// filter items when filter link is clicked
|
6 |
-
jQuery('#template-filter a').click(function(){
|
7 |
-
var selector = jQuery(this).attr('data-filter');
|
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 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
jQuery(
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
var
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
jQuery('#TB_iframeContent, #TB_window').
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
var
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
jQuery(
|
93 |
-
jQuery(current_template_meta +' .
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
var
|
101 |
-
var
|
102 |
-
var
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
href = href.replace(/&
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
tinyMCE.
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
jQuery('#template-filter a').
|
153 |
-
|
154 |
-
jQuery(
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
var
|
160 |
-
|
161 |
-
var
|
162 |
-
var
|
163 |
-
|
164 |
-
var
|
165 |
-
var
|
166 |
-
var
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
jQuery('#lp_metabox_select_template
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
+ '<
|
202 |
-
+ '<
|
203 |
-
+ '<
|
204 |
-
+
|
205 |
-
+ '</
|
206 |
-
+
|
207 |
-
|
208 |
-
|
209 |
-
jQuery('
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
jQuery(
|
222 |
-
jQuery('#
|
223 |
-
jQuery(
|
224 |
-
|
225 |
-
|
226 |
-
jQuery(
|
227 |
-
jQuery(
|
228 |
-
|
229 |
-
//alert(
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
//
|
263 |
-
|
264 |
-
//
|
265 |
-
|
266 |
-
|
267 |
-
//
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
jQuery(this).
|
277 |
-
jQuery(this).parent().find(".
|
278 |
-
jQuery(this).parent().find(".new-save-lp
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
var
|
295 |
-
var
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
jQuery(
|
302 |
-
jQuery(
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
jQuery(
|
308 |
-
|
309 |
-
jQuery(
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
jQuery(
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
jQuery('.current_lander tr.background-
|
325 |
-
jQuery('.
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
jQuery('.current_lander tr.background-
|
330 |
-
jQuery('.
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
obj
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
jQuery('.current_lander tr.background-
|
340 |
-
jQuery('.
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
jQuery('.current_lander tr.background-
|
351 |
-
|
352 |
-
|
353 |
-
obj
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
jQuery('.current_lander tr.background-
|
358 |
-
|
359 |
-
|
360 |
-
jQuery('.current_lander tr.background-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
$("#
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
jQuery(".
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
jQuery("#
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
//
|
391 |
-
|
392 |
-
var
|
393 |
-
jQuery(
|
394 |
-
jQuery(parent_el).find(".
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
jQuery(
|
404 |
-
jQuery(parent_el).find(".
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
//
|
413 |
-
|
414 |
-
var
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
jQuery(
|
420 |
-
jQuery(parent_el).find(".
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
var
|
432 |
-
var
|
433 |
-
var
|
434 |
-
var
|
435 |
-
var
|
436 |
-
var
|
437 |
-
var
|
438 |
-
|
439 |
-
|
440 |
-
jQuery(
|
441 |
-
jQuery(parent_el).find(".
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
}
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
var
|
455 |
-
|
456 |
-
jQuery(this).parent().find(
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
var
|
476 |
-
|
477 |
-
|
478 |
-
var
|
479 |
-
var
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
//
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
console.log(
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
var
|
511 |
-
reload_url =
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
var
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
//
|
539 |
-
//
|
540 |
-
var worked = '<span class="
|
541 |
-
var
|
542 |
-
jQuery(
|
543 |
-
jQuery(
|
544 |
-
jQuery(self).
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
|
1 |
+
jQuery(document).ready(function ($) {
|
2 |
+
|
3 |
+
jQuery('#templates-container').isotope();
|
4 |
+
|
5 |
+
// filter items when filter link is clicked
|
6 |
+
jQuery('#template-filter a').click(function(){
|
7 |
+
var selector = jQuery(this).attr('data-filter');
|
8 |
+
jQuery("ul#template-filter li").removeClass('button-primary');
|
9 |
+
jQuery(this).parent().addClass('button-primary');
|
10 |
+
jQuery('#templates-container').isotope({ filter: selector });
|
11 |
+
return false;
|
12 |
+
});
|
13 |
+
|
14 |
+
/* Ajax loading tabs
|
15 |
+
jQuery.koolSwap({
|
16 |
+
swapBox : '#poststuff',
|
17 |
+
outDuration : 550,
|
18 |
+
inDuration : 600,
|
19 |
+
});
|
20 |
+
*/
|
21 |
+
|
22 |
+
jQuery("body").on('click', '#content-tmce, .wp-switch-editor.switch-tmce', function () {
|
23 |
+
$.cookie("lp-edit-view-choice", "editor", { path: '/', expires: 7 });
|
24 |
+
});
|
25 |
+
|
26 |
+
jQuery("body").on('click', '#content-html, .wp-switch-editor.switch-html', function () {
|
27 |
+
$.cookie("lp-edit-view-choice", "html", { path: '/', expires: 7 });
|
28 |
+
});
|
29 |
+
|
30 |
+
var which_editor = $.cookie("lp-edit-view-choice");
|
31 |
+
if(which_editor === null){
|
32 |
+
setTimeout(function() {
|
33 |
+
jQuery("#content-tmce").click();
|
34 |
+
//jQuery(".wp-switch-editor.switch-tmce").click();
|
35 |
+
}, 1000);
|
36 |
+
|
37 |
+
}
|
38 |
+
|
39 |
+
if(which_editor === 'editor'){
|
40 |
+
setTimeout(function() {
|
41 |
+
jQuery("#content-tmce").click();
|
42 |
+
//jQuery(".wp-switch-editor.switch-tmce").click();
|
43 |
+
}, 1000);
|
44 |
+
}
|
45 |
+
|
46 |
+
/* Tour Start JS */
|
47 |
+
var tourbutton = '<a class="" id="lp-tour" style="font-size:13px;">Need help? Take the tour</a>';
|
48 |
+
jQuery(tourbutton).appendTo("h2:eq(0)");
|
49 |
+
jQuery("body").on('click', '#lp-tour', function () {
|
50 |
+
var tour = jQuery("#lp-tour-style").length;
|
51 |
+
if ( tour === 0 ) {
|
52 |
+
jQuery('head').append("<link rel='stylesheet' id='lp-tour-style' href='/wp-content/plugins/landing-pages/css/admin-tour.css' type='text/css' /><script type='text/javascript' src='/wp-content/plugins/landing-pages/js/admin/tour/tour.post-edit.js'></script><script type='text/javascript' src='/wp-content/plugins/landing-pages/js/admin/intro.js'></script>");
|
53 |
+
}
|
54 |
+
setTimeout(function() {
|
55 |
+
introJs().start(); // start tour
|
56 |
+
}, 300);
|
57 |
+
|
58 |
+
});
|
59 |
+
|
60 |
+
var current_a_tab = jQuery("#tabs-0").hasClass('nav-tab-special-active');
|
61 |
+
if (current_a_tab === true){
|
62 |
+
var url_norm = jQuery("#view-post-btn a").attr('href');
|
63 |
+
var new_url = url_norm + "?lp-variation-id=0";
|
64 |
+
jQuery("#view-post-btn a").attr('href', new_url);
|
65 |
+
}
|
66 |
+
|
67 |
+
// Fix inactivate theme display
|
68 |
+
jQuery("#template-box a").live('click', function () {
|
69 |
+
|
70 |
+
setTimeout(function() {
|
71 |
+
jQuery('#TB_window iframe').contents().find("#customize-controls").hide();
|
72 |
+
jQuery('#TB_window iframe').contents().find(".wp-full-overlay.expanded").css("margin-left", "0px");
|
73 |
+
}, 600);
|
74 |
+
|
75 |
+
});
|
76 |
+
|
77 |
+
// Fix Split testing iframe size
|
78 |
+
jQuery("#lp-metabox-splittesting a.thickbox, #leads-table-container-inside .column-details a").live('click', function () {
|
79 |
+
jQuery('#TB_iframeContent, #TB_window').hide();
|
80 |
+
setTimeout(function() {
|
81 |
+
|
82 |
+
jQuery('#TB_iframeContent, #TB_window').width( 640 ).height( 800 ).css("margin-left", "0px").css("left", "35%");
|
83 |
+
jQuery('#TB_iframeContent, #TB_window').show();
|
84 |
+
}, 600);
|
85 |
+
});
|
86 |
+
|
87 |
+
// Load meta box in correct position on page load
|
88 |
+
var current_template = jQuery("input#lp_select_template ").val();
|
89 |
+
var current_template_meta = "#lp_" + current_template + "_custom_meta_box";
|
90 |
+
jQuery(current_template_meta).removeClass("postbox").appendTo("#template-display-options").addClass("Old-Template");
|
91 |
+
var current_template_h3 = "#lp_" + current_template + "_custom_meta_box h3";
|
92 |
+
jQuery(current_template_h3).css("background","#f8f8f8");
|
93 |
+
jQuery(current_template_meta +' .handlediv').hide();
|
94 |
+
jQuery(current_template_meta +' .hndle').css('cursor','default');
|
95 |
+
|
96 |
+
|
97 |
+
// Fix Thickbox width/hieght
|
98 |
+
jQuery(function($) {
|
99 |
+
tb_position = function() {
|
100 |
+
var tbWindow = $('#TB_window');
|
101 |
+
var width = $(window).width();
|
102 |
+
var H = $(window).height();
|
103 |
+
var W = ( 1720 < width ) ? 1720 : width;
|
104 |
+
|
105 |
+
if ( tbWindow.size() ) {
|
106 |
+
tbWindow.width( W - 50 ).height( H - 45 );
|
107 |
+
$('#TB_iframeContent').width( W - 50 ).height( H - 75 );
|
108 |
+
tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
|
109 |
+
if ( typeof document.body.style.maxWidth != 'undefined' )
|
110 |
+
tbWindow.css({'top':'40px','margin-top':'0'});
|
111 |
+
//$('#TB_title').css({'background-color':'#fff','color':'#cfcfcf'});
|
112 |
+
};
|
113 |
+
|
114 |
+
return $('a.thickbox').each( function() {
|
115 |
+
var href = $(this).attr('href');
|
116 |
+
if ( ! href ) return;
|
117 |
+
href = href.replace(/&width=[0-9]+/g, '');
|
118 |
+
href = href.replace(/&height=[0-9]+/g, '');
|
119 |
+
$(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
|
120 |
+
/*
|
121 |
+
var frontend_status = jQuery("#frontend-on").val();
|
122 |
+
if (typeof (frontend_status) != "undefined" && frontend_status !== null) {
|
123 |
+
console.log('clixk');
|
124 |
+
var custom_css = jQuery("#TB_iframeContent").contents().find('#custom-media-css').length;
|
125 |
+
// Not complete need to troubleshoot
|
126 |
+
if( custom_css < 1) {
|
127 |
+
console.log('yes');
|
128 |
+
setTimeout(function() {
|
129 |
+
jQuery("#TB_iframeContent").contents().find('head').append('<link rel="stylesheet" id="custom-media-css" href="/wp-content/plugins/landing-pages/css/customizer.media-uploader.css" type="text/css" />');
|
130 |
+
}, 500);
|
131 |
+
setTimeout(function() {
|
132 |
+
jQuery("#TB_iframeContent").contents().find('head').append('<link rel="stylesheet" id="custom-media-css" href="/wp-content/plugins/landing-pages/css/customizer.media-uploader.css" type="text/css" />');
|
133 |
+
}, 2000);
|
134 |
+
}
|
135 |
+
} */
|
136 |
+
});
|
137 |
+
|
138 |
+
};
|
139 |
+
|
140 |
+
jQuery('a.thickbox').click(function(){
|
141 |
+
if ( typeof tinyMCE != 'undefined' && tinyMCE.activeEditor ) {
|
142 |
+
tinyMCE.get('content').focus();
|
143 |
+
tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark('simple');
|
144 |
+
}
|
145 |
+
|
146 |
+
});
|
147 |
+
|
148 |
+
$(window).resize( function() { tb_position() } );
|
149 |
+
});
|
150 |
+
|
151 |
+
// Isotope Styling
|
152 |
+
jQuery('#template-filter a').first().addClass('button-primary');
|
153 |
+
jQuery('#template-filter a').click(function(){
|
154 |
+
jQuery("#template-filter a.button-primary").removeClass("button-primary");
|
155 |
+
jQuery(this).addClass('button-primary');
|
156 |
+
});
|
157 |
+
|
158 |
+
jQuery('.lp_select_template').click(function(){
|
159 |
+
var template = jQuery(this).attr('id');
|
160 |
+
var label = jQuery(this).attr('label');
|
161 |
+
var selected_template_id = "#" + template;
|
162 |
+
var currentlabel = jQuery(".currently_selected").show();
|
163 |
+
var current_template = jQuery("input#lp_select_template ").val();
|
164 |
+
var current_template_meta = "#lp_" + current_template + "_custom_meta_box";
|
165 |
+
var current_template_h3 = "#lp_" + current_template + "_custom_meta_box h3";
|
166 |
+
var current_template_div = "#lp_" + current_template + "_custom_meta_box .handlediv";
|
167 |
+
var open_variation = jQuery("#open_variation").val();
|
168 |
+
|
169 |
+
if (open_variation>0)
|
170 |
+
{
|
171 |
+
var variation_tag = "-"+open_variation;
|
172 |
+
}
|
173 |
+
else
|
174 |
+
{
|
175 |
+
var variation_tag = "";
|
176 |
+
}
|
177 |
+
|
178 |
+
jQuery("#template-box.default_template_highlight").removeClass("default_template_highlight");
|
179 |
+
|
180 |
+
jQuery(selected_template_id).parent().addClass("default_template_highlight").prepend(currentlabel);
|
181 |
+
|
182 |
+
jQuery(".lp-template-selector-container").fadeOut(500,function(){
|
183 |
+
jQuery('#lp_metabox_select_template input').remove();
|
184 |
+
jQuery('#lp_metabox_select_template .form-table').remove();
|
185 |
+
|
186 |
+
var ajax_data = {
|
187 |
+
action: 'lp_get_template_meta',
|
188 |
+
selected_template: template,
|
189 |
+
post_id: lp_post_edit_ui.post_id,
|
190 |
+
};
|
191 |
+
|
192 |
+
jQuery.ajax({
|
193 |
+
type: "POST",
|
194 |
+
url: lp_post_edit_ui.ajaxurl,
|
195 |
+
data: ajax_data,
|
196 |
+
dataType: 'html',
|
197 |
+
timeout: 7000,
|
198 |
+
success: function (response) {
|
199 |
+
//alert(response);
|
200 |
+
var html = '<input id="lp_select_template" type="hidden" value="'+template+'" name="lp-selected-template'+variation_tag+'">'
|
201 |
+
+ '<input type="hidden" value="'+lp_post_edit_ui.lp_template_nonce+'" name="lp_lp_custom_fields_nonce">'
|
202 |
+
+ '<h3 class="hndle" style="background: none repeat scroll 0% 0% rgb(248, 248, 248); cursor: default;">'
|
203 |
+
+ '<span>'
|
204 |
+
+ '<small>'+ template +' Options:</small>'
|
205 |
+
+ '</span>'
|
206 |
+
+ '</h3>'
|
207 |
+
+ response;
|
208 |
+
|
209 |
+
jQuery('#lp_metabox_select_template #template-display-options').html(html);
|
210 |
+
jQuery('.time-picker').timepicker({ 'timeFormat': 'H:i' });
|
211 |
+
|
212 |
+
},
|
213 |
+
error: function(request, status, err) {
|
214 |
+
alert(status);
|
215 |
+
}
|
216 |
+
});
|
217 |
+
jQuery(".wrap").fadeIn(500, function(){
|
218 |
+
});
|
219 |
+
});
|
220 |
+
|
221 |
+
jQuery(current_template_meta).appendTo("#template-display-options");
|
222 |
+
jQuery('#lp_metabox_select_template h3').first().html('Current Active Template: '+label);
|
223 |
+
jQuery('#lp_select_template').val(template);
|
224 |
+
jQuery(".Old-Template").hide();
|
225 |
+
|
226 |
+
jQuery(current_template_div).css("display","none");
|
227 |
+
jQuery(current_template_h3).css("background","#f8f8f8");
|
228 |
+
jQuery(current_template_meta).show().appendTo("#template-display-options").removeClass("postbox").addClass("Old-Template");
|
229 |
+
//alert(template);
|
230 |
+
//alert(label);
|
231 |
+
});
|
232 |
+
|
233 |
+
jQuery('#lp-cancel-selection').click(function(){
|
234 |
+
jQuery(".lp-template-selector-container").fadeOut(500,function(){
|
235 |
+
jQuery(".wrap").fadeIn(500, function(){
|
236 |
+
});
|
237 |
+
});
|
238 |
+
|
239 |
+
});
|
240 |
+
|
241 |
+
// the_content default overwrite
|
242 |
+
jQuery('#overwrite-content').click(function(){
|
243 |
+
if (confirm('Are you sure you want to overwrite what is currently in the main edit box above?')) {
|
244 |
+
var default_content = jQuery(".default-content").text();
|
245 |
+
jQuery("#content_ifr").contents().find("body").html(default_content);
|
246 |
+
}
|
247 |
+
});
|
248 |
+
|
249 |
+
// Colorpicker fix
|
250 |
+
jQuery(document).on('mouseenter', '.jpicker', function (e) {
|
251 |
+
if(jQuery(e.target).data('mouseovered')!='yes')
|
252 |
+
{
|
253 |
+
|
254 |
+
jQuery(this).jPicker({
|
255 |
+
window: // used to define the position of the popup window only useful in binded mode
|
256 |
+
{
|
257 |
+
title: null, // any title for the jPicker window itself - displays "Drag Markers To Pick A Color" if left null
|
258 |
+
position: {
|
259 |
+
x: 'screenCenter', // acceptable values "left", "center", "right", "screenCenter", or relative px value
|
260 |
+
y: 'center', // acceptable values "top", "bottom", "center", or relative px value
|
261 |
+
},
|
262 |
+
expandable: false, // default to large static picker - set to true to make an expandable picker (small icon with popup) - set
|
263 |
+
// automatically when binded to input element
|
264 |
+
liveUpdate: true, // set false if you want the user to click "OK" before the binded input box updates values (always "true"
|
265 |
+
// for expandable picker)
|
266 |
+
alphaSupport: false, // set to true to enable alpha picking
|
267 |
+
alphaPrecision: 0, // set decimal precision for alpha percentage display - hex codes do not map directly to percentage
|
268 |
+
// integers - range 0-2
|
269 |
+
updateInputColor: true // set to false to prevent binded input colors from changing
|
270 |
+
}
|
271 |
+
},
|
272 |
+
function(color, context)
|
273 |
+
{
|
274 |
+
var all = color.val('all');
|
275 |
+
// alert('Color chosen - hex: ' + (all && '#' + all.hex || 'none') + ' - alpha: ' + (all && all.a + '%' || 'none'));
|
276 |
+
//jQuery(this).attr('rel', all.hex);
|
277 |
+
jQuery(this).parent().find(".lp-success-message").remove();
|
278 |
+
jQuery(this).parent().find(".new-save-lp").show();
|
279 |
+
jQuery(this).parent().find(".new-save-lp-frontend").show();
|
280 |
+
|
281 |
+
//jQuery(this).attr('value', all.hex);
|
282 |
+
});
|
283 |
+
jQuery(e.target).data('mouseovered','yes');
|
284 |
+
}
|
285 |
+
});
|
286 |
+
|
287 |
+
if (jQuery(".lp-template-selector-container").css("display") == "none"){
|
288 |
+
jQuery(".currently_selected").hide(); }
|
289 |
+
else {
|
290 |
+
jQuery(".currently_selected").show();
|
291 |
+
}
|
292 |
+
|
293 |
+
// Add current title of template to selector
|
294 |
+
var selected_template = jQuery('#lp_select_template').val();
|
295 |
+
var selected_template_id = "#" + selected_template;
|
296 |
+
var clean_template_name = selected_template.replace(/-/g, ' ');
|
297 |
+
function capitaliseFirstLetter(string)
|
298 |
+
{
|
299 |
+
return string.charAt(0).toUpperCase() + string.slice(1);
|
300 |
+
}
|
301 |
+
var currentlabel = jQuery(".currently_selected");
|
302 |
+
jQuery(selected_template_id).parent().addClass("default_template_highlight").prepend(currentlabel);
|
303 |
+
jQuery("#lp_metabox_select_template h3").first().prepend('<strong>' + capitaliseFirstLetter(clean_template_name) + '</strong> - ');
|
304 |
+
|
305 |
+
jQuery('#lp-change-template-button').live('click', function () {
|
306 |
+
jQuery(".wrap").fadeOut(500,function(){
|
307 |
+
jQuery('#templates-container').isotope();
|
308 |
+
jQuery(".lp-template-selector-container").fadeIn(500, function(){
|
309 |
+
jQuery(".currently_selected").show();
|
310 |
+
jQuery('#lp-cancel-selection').show();
|
311 |
+
});
|
312 |
+
jQuery("#template-filter li a").first().click();
|
313 |
+
});
|
314 |
+
});
|
315 |
+
|
316 |
+
/* Move Slug Box
|
317 |
+
var slugs = jQuery("#edit-slug-box");
|
318 |
+
jQuery('#main-title-area').after(slugs.show());
|
319 |
+
*/
|
320 |
+
// Background Options
|
321 |
+
jQuery('.current_lander .background-style').live('change', function () {
|
322 |
+
var input = jQuery(".current_lander .background-style option:selected").val();
|
323 |
+
if (input == 'color') {
|
324 |
+
jQuery('.current_lander tr.background-color').show();
|
325 |
+
jQuery('.current_lander tr.background-image').hide();
|
326 |
+
jQuery('.background_tip').hide();
|
327 |
+
}
|
328 |
+
else if (input == 'default') {
|
329 |
+
jQuery('.current_lander tr.background-color').hide();
|
330 |
+
jQuery('.current_lander tr.background-image').hide();
|
331 |
+
jQuery('.background_tip').hide();
|
332 |
+
}
|
333 |
+
else if (input == 'custom') {
|
334 |
+
var obj = jQuery(".current_lander tr.background-style td .lp_tooltip");
|
335 |
+
obj.removeClass("lp_tooltip").addClass("background_tip").html("Use the custom css block at the bottom of this page to set up custom CSS rules");
|
336 |
+
jQuery('.background_tip').show();
|
337 |
+
}
|
338 |
+
else {
|
339 |
+
jQuery('.current_lander tr.background-color').hide();
|
340 |
+
jQuery('.current_lander tr.background-image').show();
|
341 |
+
jQuery('.background_tip').hide();
|
342 |
+
}
|
343 |
+
|
344 |
+
});
|
345 |
+
|
346 |
+
// Check BG options on page load
|
347 |
+
jQuery(document).ready(function () {
|
348 |
+
var input2 = jQuery(".current_lander .background-style option:selected").val();
|
349 |
+
if (input2 == 'color') {
|
350 |
+
jQuery('.current_lander tr.background-color').show();
|
351 |
+
jQuery('.current_lander tr.background-image').hide();
|
352 |
+
} else if (input2 == 'custom') {
|
353 |
+
var obj = jQuery(".current_lander tr.background-style td .lp_tooltip");
|
354 |
+
obj.removeClass("lp_tooltip").addClass("background_tip").html("Use the custom css block at the bottom of this page to set up custom CSS rules");
|
355 |
+
jQuery('.background_tip').show();
|
356 |
+
} else if (input2 == 'default') {
|
357 |
+
jQuery('.current_lander tr.background-color').hide();
|
358 |
+
jQuery('.current_lander tr.background-image').hide();
|
359 |
+
} else {
|
360 |
+
jQuery('.current_lander tr.background-color').hide();
|
361 |
+
jQuery('.current_lander tr.background-image').show();
|
362 |
+
}
|
363 |
+
});
|
364 |
+
|
365 |
+
//Stylize lead's wp-list-table
|
366 |
+
var cnt = $("#leads-table-container").contents();
|
367 |
+
$("#lp_conversion_log_metabox").replaceWith(cnt);
|
368 |
+
|
369 |
+
//remove inputs from wp-list-table
|
370 |
+
jQuery('#leads-table-container-inside input').each(function(){
|
371 |
+
jQuery(this).remove();
|
372 |
+
});
|
373 |
+
|
374 |
+
var post_status = jQuery("#original_post_status").val();
|
375 |
+
|
376 |
+
if (post_status === "draft") {
|
377 |
+
// jQuery( ".nav-tab-wrapper.a_b_tabs .lp-ab-tab, #tabs-add-variation").hide();
|
378 |
+
jQuery(".new-save-lp-frontend").on("click", function(event) {
|
379 |
+
event.preventDefault();
|
380 |
+
alert("Must publish this page before you can use the visual editor!");
|
381 |
+
});
|
382 |
+
var subbox = jQuery("#submitdiv");
|
383 |
+
jQuery("#lp_ab_display_stats_metabox").before(subbox)
|
384 |
+
} else {
|
385 |
+
jQuery("#publish").val("Update All");
|
386 |
+
}
|
387 |
+
|
388 |
+
// Ajax Saving for metadata
|
389 |
+
jQuery('#lp_metabox_select_template input, #lp_metabox_select_template select, #lp_metabox_select_template textarea').on("change keyup", function (e) {
|
390 |
+
// iframe content change needs its own change function $("#iFrame").contents().find("#someDiv")
|
391 |
+
// media uploader needs its own change function
|
392 |
+
var this_id = jQuery(this).attr("id");
|
393 |
+
var parent_el = jQuery(this).parent();
|
394 |
+
jQuery(parent_el).find(".lp-success-message").remove();
|
395 |
+
jQuery(parent_el).find(".new-save-lp").remove();
|
396 |
+
var ajax_save_button = jQuery('<span class="button-primary new-save-lp" id="' + this_id + '" style="margin-left:10px">Update</span>');
|
397 |
+
//console.log(parent_el);
|
398 |
+
jQuery(ajax_save_button).appendTo(parent_el);
|
399 |
+
});
|
400 |
+
|
401 |
+
jQuery('#lp-notes-area input').on("change keyup", function (e) {
|
402 |
+
var this_id = jQuery(this).attr("id");
|
403 |
+
var parent_el = jQuery(this).parent();
|
404 |
+
jQuery(parent_el).find(".lp-success-message").remove();
|
405 |
+
jQuery(parent_el).find(".new-save-lp").remove();
|
406 |
+
var ajax_save_button = jQuery('<span class="button-primary new-save-lp" id="' + this_id + '" style="margin-left:10px">Update</span>');
|
407 |
+
//console.log(parent_el);
|
408 |
+
jQuery(ajax_save_button).appendTo(parent_el);
|
409 |
+
});
|
410 |
+
|
411 |
+
jQuery('#main-title-area input').on("change keyup", function (e) {
|
412 |
+
// iframe content change needs its own change function $("#iFrame").contents().find("#someDiv")
|
413 |
+
// media uploader needs its own change function
|
414 |
+
var this_id = jQuery(this).attr("id");
|
415 |
+
var current_view = jQuery("#lp-current-view").text();
|
416 |
+
if (current_view !== "0") {
|
417 |
+
this_id = this_id + '-' + current_view;
|
418 |
+
}
|
419 |
+
var parent_el = jQuery(this).parent();
|
420 |
+
jQuery(parent_el).find(".lp-success-message").remove();
|
421 |
+
jQuery(parent_el).find(".new-save-lp").remove();
|
422 |
+
var ajax_save_button = jQuery('<span class="button-primary new-save-lp" id="' + this_id + '" style="margin-left:10px">Update</span>');
|
423 |
+
//console.log(parent_el);
|
424 |
+
jQuery(ajax_save_button).appendTo(parent_el);
|
425 |
+
});
|
426 |
+
|
427 |
+
// wysiwyg on keyup save action
|
428 |
+
/*
|
429 |
+
setTimeout(function() {
|
430 |
+
jQuery('.mceIframeContainer iframe, .landing-page-option-row iframe').contents().find('body').on("keyup", function (e) {
|
431 |
+
var thisclass = jQuery(this).attr("class");
|
432 |
+
var this_class_dirty = thisclass.replace("mceContentBody ", "");
|
433 |
+
var this_class_cleaner = this_class_dirty.replace("wp-editor", "");
|
434 |
+
var clean_1 = this_class_cleaner.replace("post-type-landing-page", "");
|
435 |
+
var clean_2 = clean_1.replace("post-status-publish", "");
|
436 |
+
var clean_3 = clean_2.replace(/[.\s]+$/g, ""); // remove trailing whitespace
|
437 |
+
var clean_spaces = clean_3.replace(/\s{2,}/g, ' '); // remove more than one space
|
438 |
+
var this_id = clean_spaces.replace(/[.\s]+$/g, ""); // remove trailing whitespace
|
439 |
+
console.log(this_id);
|
440 |
+
var parent_el = jQuery( "." + this_id + " .landing-page-table-header");
|
441 |
+
jQuery(parent_el).find(".lp-success-message").remove();
|
442 |
+
jQuery(parent_el).find(".new-save-lp").remove();
|
443 |
+
var ajax_save_button = jQuery('<span class="button-primary new-save-lp" id="' + this_id + '" style="margin-left:10px;">Update</span>');
|
444 |
+
//console.log(parent_el);
|
445 |
+
jQuery(ajax_save_button).appendTo(parent_el);
|
446 |
+
});
|
447 |
+
}, 4000);
|
448 |
+
*/
|
449 |
+
|
450 |
+
|
451 |
+
// SAVE META
|
452 |
+
var nonce_val = lp_post_edit_ui.wp_landing_page_meta_nonce; // NEED CORRECT NONCE
|
453 |
+
jQuery(document).on('mousedown', '.new-save-lp', function () {
|
454 |
+
var type_input = jQuery(this).parent().find("input").attr("type");
|
455 |
+
var type_select = jQuery(this).parent().find("select");
|
456 |
+
// var the_conversion_area_editor = jQuery(this).parent().parent().find('#lp-conversion-area_ifr').length;
|
457 |
+
jQuery(this).parent().find(".lp-success-message").hide();
|
458 |
+
// var the_content_editor = jQuery(this).parent().parent().find('#wp_content_ifr').length;
|
459 |
+
var type_wysiwyg = jQuery(this).parent().parent().find('iframe').length;
|
460 |
+
|
461 |
+
var type_textarea = jQuery(this).parent().find("textarea");
|
462 |
+
if (typeof (type_input) != "undefined" && type_input !== null) {
|
463 |
+
var type_of_field = type_input;
|
464 |
+
} else if (typeof (type_wysiwyg) != "undefined" && type_wysiwyg !== null && type_wysiwyg === 1) {
|
465 |
+
var type_of_field = 'wysiwyg';
|
466 |
+
} else if (typeof (type_textarea) != "undefined" && type_textarea !== null) {
|
467 |
+
var type_of_field = 'textarea';
|
468 |
+
} else {
|
469 |
+
(typeof (type_select) != "undefined" && type_select)
|
470 |
+
var type_of_field = 'select';
|
471 |
+
}
|
472 |
+
// console.log(type_of_field); // type of input
|
473 |
+
var new_value_meta_input = jQuery(this).parent().find("input").val();
|
474 |
+
//console.log(new_value_meta_input);
|
475 |
+
var new_value_meta_select = jQuery(this).parent().find("select").val();
|
476 |
+
var new_value_meta_textarea = jQuery(this).parent().find("textarea").val();
|
477 |
+
// console.log(new_value_meta_select);
|
478 |
+
var new_value_meta_radio = jQuery(this).parent().find("input:checked").val();
|
479 |
+
var new_value_meta_checkbox = jQuery(this).parent().find('input[type="checkbox"]:checked').val();
|
480 |
+
var new_wysiwyg_meta = jQuery(this).parent().parent().find("iframe").contents().find("body").html();
|
481 |
+
// prep data
|
482 |
+
if (typeof (new_value_meta_input) != "undefined" && new_value_meta_input !== null && type_of_field == "text") {
|
483 |
+
var meta_to_save = new_value_meta_input;
|
484 |
+
} else if (typeof (new_value_meta_textarea) != "undefined" && new_value_meta_textarea !== null && type_of_field == "textarea") {
|
485 |
+
var meta_to_save = new_value_meta_textarea;
|
486 |
+
} else if (typeof (new_value_meta_select) != "undefined" && new_value_meta_select !== null) {
|
487 |
+
var meta_to_save = new_value_meta_select;
|
488 |
+
} else if (typeof (new_value_meta_radio) != "undefined" && new_value_meta_radio !== null && type_of_field == "radio") {
|
489 |
+
var meta_to_save = new_value_meta_radio;
|
490 |
+
} else if (typeof (new_value_meta_checkbox) != "undefined" && new_value_meta_checkbox !== null && type_of_field == "checkbox") {
|
491 |
+
var meta_to_save = new_value_meta_checkbox;
|
492 |
+
} else if (typeof (new_wysiwyg_meta) != "undefined" && new_wysiwyg_meta !== null && type_of_field == "wysiwyg") {
|
493 |
+
var meta_to_save = new_wysiwyg_meta;
|
494 |
+
//alert('here');
|
495 |
+
} else {
|
496 |
+
var meta_to_save = "";
|
497 |
+
}
|
498 |
+
|
499 |
+
// if data exists save it
|
500 |
+
// console.log(meta_to_save);
|
501 |
+
|
502 |
+
var this_meta_id = jQuery(this).attr("id"); // From save button
|
503 |
+
console.log(this_meta_id);
|
504 |
+
var post_id = jQuery("#post_ID").val();
|
505 |
+
console.log(post_id);
|
506 |
+
console.log(meta_to_save);
|
507 |
+
var frontend_status = jQuery("#frontend-on").val();
|
508 |
+
|
509 |
+
function do_reload_preview() {
|
510 |
+
var cache_bust = generate_random_cache_bust(35);
|
511 |
+
var reload_url = parent.window.location.href;
|
512 |
+
reload_url = reload_url.replace('template-customize=on','');
|
513 |
+
//alert(reload_url);
|
514 |
+
var current_variation_id = jQuery("#lp-current-view").text();
|
515 |
+
|
516 |
+
// var reload = jQuery(parent.document).find("#lp-live-preview").attr("src");
|
517 |
+
var new_reload = reload_url + "&live-preview-area=" + cache_bust + "&lp-variation-id=" + current_variation_id;
|
518 |
+
//alert(new_reload);
|
519 |
+
jQuery(parent.document).find("#lp-live-preview").attr("src", new_reload);
|
520 |
+
// console.log(new_reload);
|
521 |
+
}
|
522 |
+
// Run Ajax
|
523 |
+
jQuery.ajax({
|
524 |
+
type: 'POST',
|
525 |
+
url: lp_post_edit_ui.ajaxurl,
|
526 |
+
context: this,
|
527 |
+
data: {
|
528 |
+
action: 'wp_landing_page_meta_save',
|
529 |
+
meta_id: this_meta_id,
|
530 |
+
new_meta_val: meta_to_save,
|
531 |
+
page_id: post_id,
|
532 |
+
nonce: nonce_val
|
533 |
+
},
|
534 |
+
|
535 |
+
success: function (data) {
|
536 |
+
var self = this;
|
537 |
+
|
538 |
+
//alert(data);
|
539 |
+
// jQuery('.lp-form').unbind('submit').submit();
|
540 |
+
//var worked = '<span class="success-message-map">Success! ' + this_meta_id + ' set to ' + meta_to_save + '</span>';
|
541 |
+
var worked = '<span class="lp-success-message">Updated!</span>';
|
542 |
+
var s_message = jQuery(self).parent();
|
543 |
+
jQuery(worked).appendTo(s_message);
|
544 |
+
jQuery(self).parent().find("lp-success-message").remove();
|
545 |
+
jQuery(self).hide();
|
546 |
+
// RUN RELOAD
|
547 |
+
if (typeof (frontend_status) != "undefined" && frontend_status !== null) {
|
548 |
+
|
549 |
+
console.log('reload frame');
|
550 |
+
do_reload_preview();
|
551 |
+
} else {
|
552 |
+
console.log('No reload frame');
|
553 |
+
}
|
554 |
+
//alert("Changes Saved!");
|
555 |
+
},
|
556 |
+
|
557 |
+
error: function (MLHttpRequest, textStatus, errorThrown) {
|
558 |
+
alert("Ajax not enabled");
|
559 |
+
}
|
560 |
+
});
|
561 |
+
|
562 |
+
//reload_preview();
|
563 |
+
return false;
|
564 |
+
|
565 |
+
});
|
566 |
+
|
567 |
+
|
568 |
+
});
|
js/admin/admin.post-new.js
CHANGED
@@ -1,138 +1,139 @@
|
|
1 |
-
jQuery(document).ready(function ($) {
|
2 |
-
|
3 |
-
jQuery('#lp-template-selector-container').css('display','block');
|
4 |
-
|
5 |
-
//remove inputs from wp-list-table
|
6 |
-
jQuery('#leads-table-container-inside input').each(function(){
|
7 |
-
jQuery(this).remove();
|
8 |
-
});
|
9 |
-
|
10 |
-
jQuery("#submitdiv").siblings().hide();
|
11 |
-
jQuery('#templates-container').isotope();
|
12 |
-
jQuery("#title-prompt-text").text("Name Your New Landing Page");
|
13 |
-
|
14 |
-
var titledescription = jQuery("<span id='descriptor'>This will be the administrative title your landing page, the main headline is created in the next step</span>");
|
15 |
-
jQuery(titledescription).appendTo("#titlewrap");
|
16 |
-
|
17 |
-
jQuery("#save-action input").addClass("button-primary button-large").css("margin-bottom", "10px").attr("value", "Create Landing Page");
|
18 |
-
|
19 |
-
var sidebar = jQuery("#side-sortables");
|
20 |
-
jQuery(sidebar).appendTo("#titlediv");
|
21 |
-
|
22 |
-
var tempdiv = jQuery("<div id='templates' class='postbox'><h3 class='hndle'>Current Template: <span id='ctemp'></span></h3><div id='lp_the_image'><span id='timage'><img src='' id='c_temp'></span></div><div id='template_current'></div></div>");
|
23 |
-
|
24 |
-
jQuery(tempdiv).appendTo("#titlewrap");
|
25 |
-
var changebutton = jQuery("#lp_template_change");
|
26 |
-
|
27 |
-
jQuery(changebutton).appendTo("#templates");
|
28 |
-
jQuery("#lp_template_change a").removeClass("button-primary").addClass("button");
|
29 |
-
|
30 |
-
// New Sidebar
|
31 |
-
jQuery("#postbox-container-1").html("<div class='postbox'><center><h3>Download Additional Templates</h3><a target='_blank' href='/wp-admin/edit.php?post_type=landing-page&page=lp_store'><img src='"+lp_post_new_ui.LANDINGPAGES_URLPATH+"images/get-wordpress-templates.png'></a><a target='_blank' href='/wp-admin/edit.php?post_type=landing-page&page=lp_store' class='button new-lp-button button-primary button-large'>Download Landing Page Templates</a></center></div><div class='postbox'><center><h3>Need Custom Template Design?</h3><a target='_blank' href='/wp-admin/edit.php?post_type=landing-page&page=lp_store'><img src='"+lp_post_new_ui.LANDINGPAGES_URLPATH+"/images/get-custom-setup.png'></a><a target='_blank' href='http://www.inboundnow.com/landing-pages/custom-wordpress-landing-page-setup/' class='button new-lp-button button-primary button-large'>Get Custom Template Setup</a></center></div>");
|
32 |
-
|
33 |
-
jQuery('.lp_select_template').click(function(){
|
34 |
-
jQuery(".mceIframeContainer iframe#content_ifr").css("height", "100%");
|
35 |
-
jQuery("#wp-content-editor-container .mceStatusbar").css("display", "none");
|
36 |
-
});
|
37 |
-
|
38 |
-
jQuery('.lp_select_template').click(function(){
|
39 |
-
|
40 |
-
var template = jQuery(this).attr('id');
|
41 |
-
var selected_template_id = "#" + template;
|
42 |
-
var label = jQuery(this).attr('label');
|
43 |
-
var template_image = "#" + template + " .template-thumbnail";
|
44 |
-
var template_img_obj = jQuery(template_image).attr("src");
|
45 |
-
|
46 |
-
jQuery("#ctemp").text(label);
|
47 |
-
jQuery("#template_current").html('<input type="hidden" name="lp-selected-template" value="'+template+'"><input type="hidden" value="1" name="lp_post_new">');
|
48 |
-
jQuery("#timage #c_temp").attr("src", template_img_obj);
|
49 |
-
jQuery("#submitdiv .hndle span").text("Create Landing Page");
|
50 |
-
|
51 |
-
});
|
52 |
-
|
53 |
-
jQuery('#lp-change-template-button').live('click', function () {
|
54 |
-
jQuery(".wrap").fadeOut(500,function(){
|
55 |
-
jQuery('#templates-container').isotope();
|
56 |
-
jQuery(".lp-template-selector-container").fadeIn(500, function(){
|
57 |
-
jQuery('#lp-cancel-selection').show();
|
58 |
-
});
|
59 |
-
jQuery("#template-filter li a").first().click();
|
60 |
-
});
|
61 |
-
});
|
62 |
-
|
63 |
-
// filter items when filter link is clicked
|
64 |
-
jQuery('#template-filter a').click(function(){
|
65 |
-
var selector = jQuery(this).attr('data-filter');
|
66 |
-
|
67 |
-
jQuery('
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
var
|
74 |
-
jQuery(
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
jQuery('#
|
81 |
-
|
82 |
-
//alert(
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
var
|
100 |
-
var
|
101 |
-
var
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
href = href.replace(/&
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
tinyMCE.
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
|
|
138 |
});
|
1 |
+
jQuery(document).ready(function ($) {
|
2 |
+
|
3 |
+
jQuery('#lp-template-selector-container').css('display','block');
|
4 |
+
|
5 |
+
//remove inputs from wp-list-table
|
6 |
+
jQuery('#leads-table-container-inside input').each(function(){
|
7 |
+
jQuery(this).remove();
|
8 |
+
});
|
9 |
+
|
10 |
+
jQuery("#submitdiv").siblings().hide();
|
11 |
+
jQuery('#templates-container').isotope();
|
12 |
+
jQuery("#title-prompt-text").text("Name Your New Landing Page");
|
13 |
+
|
14 |
+
var titledescription = jQuery("<span id='descriptor'>This will be the administrative title your landing page, the main headline is created in the next step</span>");
|
15 |
+
jQuery(titledescription).appendTo("#titlewrap");
|
16 |
+
|
17 |
+
jQuery("#save-action input").addClass("button-primary button-large").css("margin-bottom", "10px").attr("value", "Create Landing Page");
|
18 |
+
|
19 |
+
var sidebar = jQuery("#side-sortables");
|
20 |
+
jQuery(sidebar).appendTo("#titlediv");
|
21 |
+
|
22 |
+
var tempdiv = jQuery("<div id='templates' class='postbox'><h3 class='hndle'>Current Template: <span id='ctemp'></span></h3><div id='lp_the_image'><span id='timage'><img src='' id='c_temp'></span></div><div id='template_current'></div></div>");
|
23 |
+
|
24 |
+
jQuery(tempdiv).appendTo("#titlewrap");
|
25 |
+
var changebutton = jQuery("#lp_template_change");
|
26 |
+
|
27 |
+
jQuery(changebutton).appendTo("#templates");
|
28 |
+
jQuery("#lp_template_change a").removeClass("button-primary").addClass("button");
|
29 |
+
|
30 |
+
// New Sidebar
|
31 |
+
jQuery("#postbox-container-1").html("<div class='postbox'><center><h3>Download Additional Templates</h3><a target='_blank' href='/wp-admin/edit.php?post_type=landing-page&page=lp_store'><img src='"+lp_post_new_ui.LANDINGPAGES_URLPATH+"images/get-wordpress-templates.png'></a><a target='_blank' href='/wp-admin/edit.php?post_type=landing-page&page=lp_store' class='button new-lp-button button-primary button-large'>Download Landing Page Templates</a></center></div><div class='postbox'><center><h3>Need Custom Template Design?</h3><a target='_blank' href='/wp-admin/edit.php?post_type=landing-page&page=lp_store'><img src='"+lp_post_new_ui.LANDINGPAGES_URLPATH+"/images/get-custom-setup.png'></a><a target='_blank' href='http://www.inboundnow.com/landing-pages/custom-wordpress-landing-page-setup/' class='button new-lp-button button-primary button-large'>Get Custom Template Setup</a></center></div>");
|
32 |
+
|
33 |
+
jQuery('.lp_select_template').click(function(){
|
34 |
+
jQuery(".mceIframeContainer iframe#content_ifr").css("height", "100%");
|
35 |
+
jQuery("#wp-content-editor-container .mceStatusbar").css("display", "none");
|
36 |
+
});
|
37 |
+
|
38 |
+
jQuery('.lp_select_template').click(function(){
|
39 |
+
|
40 |
+
var template = jQuery(this).attr('id');
|
41 |
+
var selected_template_id = "#" + template;
|
42 |
+
var label = jQuery(this).attr('label');
|
43 |
+
var template_image = "#" + template + " .template-thumbnail";
|
44 |
+
var template_img_obj = jQuery(template_image).attr("src");
|
45 |
+
|
46 |
+
jQuery("#ctemp").text(label);
|
47 |
+
jQuery("#template_current").html('<input type="hidden" name="lp-selected-template" value="'+template+'"><input type="hidden" value="1" name="lp_post_new">');
|
48 |
+
jQuery("#timage #c_temp").attr("src", template_img_obj);
|
49 |
+
jQuery("#submitdiv .hndle span").text("Create Landing Page");
|
50 |
+
|
51 |
+
});
|
52 |
+
|
53 |
+
jQuery('#lp-change-template-button').live('click', function () {
|
54 |
+
jQuery(".wrap").fadeOut(500,function(){
|
55 |
+
jQuery('#templates-container').isotope();
|
56 |
+
jQuery(".lp-template-selector-container").fadeIn(500, function(){
|
57 |
+
jQuery('#lp-cancel-selection').show();
|
58 |
+
});
|
59 |
+
jQuery("#template-filter li a").first().click();
|
60 |
+
});
|
61 |
+
});
|
62 |
+
|
63 |
+
// filter items when filter link is clicked
|
64 |
+
jQuery('#template-filter a').click(function(){
|
65 |
+
var selector = jQuery(this).attr('data-filter');
|
66 |
+
jQuery("ul#template-filter li").removeClass('button-primary');
|
67 |
+
jQuery(this).parent().addClass('button-primary');
|
68 |
+
jQuery('#templates-container').isotope({ filter: selector });
|
69 |
+
return false;
|
70 |
+
});
|
71 |
+
|
72 |
+
jQuery('.lp_select_template').click(function(){
|
73 |
+
var template = jQuery(this).attr('id');
|
74 |
+
var label = jQuery(this).attr('label');
|
75 |
+
jQuery(".lp-template-selector-container").fadeOut(500,function(){
|
76 |
+
jQuery(".wrap").fadeIn(500, function(){
|
77 |
+
});
|
78 |
+
});
|
79 |
+
|
80 |
+
jQuery('#lp_metabox_select_template h3').html('Current Active Template: '+label);
|
81 |
+
jQuery('#lp_select_template').val(template);
|
82 |
+
//alert(template);
|
83 |
+
//alert(label);
|
84 |
+
});
|
85 |
+
|
86 |
+
|
87 |
+
jQuery("#template-box a").live('click', function () {
|
88 |
+
|
89 |
+
setTimeout(function() {
|
90 |
+
jQuery('#TB_window iframe').contents().find("#customize-controls").hide();
|
91 |
+
jQuery('#TB_window iframe').contents().find(".wp-full-overlay.expanded").css("margin-left", "0px");
|
92 |
+
}, 1200);
|
93 |
+
|
94 |
+
});
|
95 |
+
|
96 |
+
// Fix Thickbox width
|
97 |
+
jQuery(function($) {
|
98 |
+
tb_position = function() {
|
99 |
+
var tbWindow = $('#TB_window');
|
100 |
+
var width = $(window).width();
|
101 |
+
var H = $(window).height();
|
102 |
+
var W = ( 1720 < width ) ? 1720 : width;
|
103 |
+
|
104 |
+
if ( tbWindow.size() ) {
|
105 |
+
tbWindow.width( W - 50 ).height( H - 45 );
|
106 |
+
$('#TB_iframeContent').width( W - 50 ).height( H - 75 );
|
107 |
+
tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
|
108 |
+
if ( typeof document.body.style.maxWidth != 'undefined' )
|
109 |
+
tbWindow.css({'top':'40px','margin-top':'0'});
|
110 |
+
//$('#TB_title').css({'background-color':'#fff','color':'#cfcfcf'});
|
111 |
+
};
|
112 |
+
|
113 |
+
return $('a.thickbox').each( function() {
|
114 |
+
var href = $(this).attr('href');
|
115 |
+
if ( ! href ) return;
|
116 |
+
href = href.replace(/&width=[0-9]+/g, '');
|
117 |
+
href = href.replace(/&height=[0-9]+/g, '');
|
118 |
+
$(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
|
119 |
+
});
|
120 |
+
};
|
121 |
+
|
122 |
+
jQuery('a.thickbox').click(function(){
|
123 |
+
if ( typeof tinyMCE != 'undefined' && tinyMCE.activeEditor ) {
|
124 |
+
tinyMCE.get('content').focus();
|
125 |
+
tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark('simple');
|
126 |
+
}
|
127 |
+
|
128 |
+
});
|
129 |
+
|
130 |
+
$(window).resize( function() { tb_position() } );
|
131 |
+
});
|
132 |
+
|
133 |
+
var nonce_val = lp_post_new_ui.wp_landing_page_meta_nonce; // NEED CORRECT NONCE
|
134 |
+
|
135 |
+
var nonce_html = '<input type="hidden" value="74910e3045" name="wp-landing-page-meta-nonce">';
|
136 |
+
|
137 |
+
jQuery('form').prepend(nonce_html);
|
138 |
+
|
139 |
});
|
js/admin/admin.store.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
jQuery(document).ready(function()
|
2 |
-
{
|
3 |
-
// Store page jquery not in use
|
4 |
-
});
|
5 |
|
1 |
+
jQuery(document).ready(function()
|
2 |
+
{
|
3 |
+
// Store page jquery not in use
|
4 |
+
});
|
5 |
|
js/admin/intro.js
CHANGED
@@ -1,758 +1,758 @@
|
|
1 |
-
/**
|
2 |
-
* Intro.js v0.4.0
|
3 |
-
* https://github.com/usablica/intro.js
|
4 |
-
* MIT licensed
|
5 |
-
*
|
6 |
-
* Copyright (C) 2013 usabli.ca - A weekend project by Afshin Mehrabani (@afshinmeh)
|
7 |
-
*/
|
8 |
-
|
9 |
-
(function (root, factory) {
|
10 |
-
if (typeof exports === 'object') {
|
11 |
-
// CommonJS
|
12 |
-
factory(exports);
|
13 |
-
} else if (typeof define === 'function' && define.amd) {
|
14 |
-
// AMD. Register as an anonymous module.
|
15 |
-
define(['exports'], factory);
|
16 |
-
} else {
|
17 |
-
// Browser globals
|
18 |
-
factory(root);
|
19 |
-
}
|
20 |
-
} (this, function (exports) {
|
21 |
-
//Default config/variables
|
22 |
-
var VERSION = '0.4.0';
|
23 |
-
|
24 |
-
/**
|
25 |
-
* IntroJs main class
|
26 |
-
*
|
27 |
-
* @class IntroJs
|
28 |
-
*/
|
29 |
-
function IntroJs(obj) {
|
30 |
-
this._targetElement = obj;
|
31 |
-
|
32 |
-
this._options = {
|
33 |
-
nextLabel: 'Next →',
|
34 |
-
prevLabel: '← Back',
|
35 |
-
skipLabel: 'Skip',
|
36 |
-
doneLabel: 'Done',
|
37 |
-
tooltipPosition: 'bottom',
|
38 |
-
exitOnEsc: true,
|
39 |
-
exitOnOverlayClick: true,
|
40 |
-
showStepNumbers: true
|
41 |
-
};
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Initiate a new introduction/guide from an element in the page
|
46 |
-
*
|
47 |
-
* @api private
|
48 |
-
* @method _introForElement
|
49 |
-
* @param {Object} targetElm
|
50 |
-
* @returns {Boolean} Success or not?
|
51 |
-
*/
|
52 |
-
function _introForElement(targetElm) {
|
53 |
-
var introItems = [],
|
54 |
-
self = this;
|
55 |
-
|
56 |
-
if (this._options.steps) {
|
57 |
-
//use steps passed programmatically
|
58 |
-
var allIntroSteps = [];
|
59 |
-
|
60 |
-
for (var i = 0, stepsLength = this._options.steps.length; i < stepsLength; i++) {
|
61 |
-
var currentItem = this._options.steps[i];
|
62 |
-
//set the step
|
63 |
-
currentItem.step = i + 1;
|
64 |
-
//grab the element with given selector from the page
|
65 |
-
currentItem.element = document.querySelector(currentItem.element);
|
66 |
-
introItems.push(currentItem);
|
67 |
-
}
|
68 |
-
|
69 |
-
} else {
|
70 |
-
//use steps from data-* annotations
|
71 |
-
|
72 |
-
var allIntroSteps = targetElm.querySelectorAll('*[data-intro]');
|
73 |
-
//if there's no element to intro
|
74 |
-
if (allIntroSteps.length < 1) {
|
75 |
-
return false;
|
76 |
-
}
|
77 |
-
|
78 |
-
for (var i = 0, elmsLength = allIntroSteps.length; i < elmsLength; i++) {
|
79 |
-
var currentElement = allIntroSteps[i];
|
80 |
-
introItems.push({
|
81 |
-
element: currentElement,
|
82 |
-
intro: currentElement.getAttribute('data-intro'),
|
83 |
-
step: parseInt(currentElement.getAttribute('data-step'), 10),
|
84 |
-
position: currentElement.getAttribute('data-position') || this._options.tooltipPosition
|
85 |
-
});
|
86 |
-
}
|
87 |
-
}
|
88 |
-
|
89 |
-
//Ok, sort all items with given steps
|
90 |
-
introItems.sort(function (a, b) {
|
91 |
-
return a.step - b.step;
|
92 |
-
});
|
93 |
-
|
94 |
-
//set it to the introJs object
|
95 |
-
self._introItems = introItems;
|
96 |
-
|
97 |
-
//add overlay layer to the page
|
98 |
-
if(_addOverlayLayer.call(self, targetElm)) {
|
99 |
-
//then, start the show
|
100 |
-
_nextStep.call(self);
|
101 |
-
|
102 |
-
var skipButton = targetElm.querySelector('.introjs-skipbutton'),
|
103 |
-
nextStepButton = targetElm.querySelector('.introjs-nextbutton');
|
104 |
-
|
105 |
-
self._onKeyDown = function(e) {
|
106 |
-
if (e.keyCode === 27 && self._options.exitOnEsc == true) {
|
107 |
-
//escape key pressed, exit the intro
|
108 |
-
_exitIntro.call(self, targetElm);
|
109 |
-
//check if any callback is defined
|
110 |
-
if (self._introExitCallback != undefined) {
|
111 |
-
self._introExitCallback.call(self);
|
112 |
-
}
|
113 |
-
} else if(e.keyCode === 37) {
|
114 |
-
//left arrow
|
115 |
-
_previousStep.call(self);
|
116 |
-
} else if (e.keyCode === 39 || e.keyCode === 13) {
|
117 |
-
//right arrow or enter
|
118 |
-
_nextStep.call(self);
|
119 |
-
//prevent default behaviour on hitting Enter, to prevent steps being skipped in some browsers
|
120 |
-
if(e.preventDefault) {
|
121 |
-
e.preventDefault();
|
122 |
-
} else {
|
123 |
-
e.returnValue = false;
|
124 |
-
}
|
125 |
-
}
|
126 |
-
};
|
127 |
-
|
128 |
-
self._onResize = function(e) {
|
129 |
-
_setHelperLayerPosition.call(self, document.querySelector('.introjs-helperLayer'));
|
130 |
-
};
|
131 |
-
|
132 |
-
if (window.addEventListener) {
|
133 |
-
window.addEventListener('keydown', self._onKeyDown, true);
|
134 |
-
//for window resize
|
135 |
-
window.addEventListener("resize", self._onResize, true);
|
136 |
-
} else if (document.attachEvent) { //IE
|
137 |
-
document.attachEvent('onkeydown', self._onKeyDown);
|
138 |
-
//for window resize
|
139 |
-
document.attachEvent("onresize", self._onResize);
|
140 |
-
}
|
141 |
-
}
|
142 |
-
return false;
|
143 |
-
}
|
144 |
-
|
145 |
-
/**
|
146 |
-
* Go to specific step of introduction
|
147 |
-
*
|
148 |
-
* @api private
|
149 |
-
* @method _goToStep
|
150 |
-
*/
|
151 |
-
function _goToStep(step) {
|
152 |
-
//because steps starts with zero
|
153 |
-
this._currentStep = step - 2;
|
154 |
-
if(typeof (this._introItems) !== 'undefined') {
|
155 |
-
_nextStep.call(this);
|
156 |
-
}
|
157 |
-
}
|
158 |
-
|
159 |
-
/**
|
160 |
-
* Go to next step on intro
|
161 |
-
*
|
162 |
-
* @api private
|
163 |
-
* @method _nextStep
|
164 |
-
*/
|
165 |
-
function _nextStep() {
|
166 |
-
if (typeof (this._introBeforeChangeCallback) !== 'undefined') {
|
167 |
-
this._introBeforeChangeCallback.call(this, this._targetElement);
|
168 |
-
}
|
169 |
-
|
170 |
-
if (typeof (this._currentStep) === 'undefined') {
|
171 |
-
this._currentStep = 0;
|
172 |
-
} else {
|
173 |
-
++this._currentStep;
|
174 |
-
}
|
175 |
-
|
176 |
-
if((this._introItems.length) <= this._currentStep) {
|
177 |
-
//end of the intro
|
178 |
-
//check if any callback is defined
|
179 |
-
if (typeof (this._introCompleteCallback) === 'function') {
|
180 |
-
this._introCompleteCallback.call(this);
|
181 |
-
}
|
182 |
-
_exitIntro.call(this, this._targetElement);
|
183 |
-
return;
|
184 |
-
}
|
185 |
-
|
186 |
-
_showElement.call(this, this._introItems[this._currentStep]);
|
187 |
-
}
|
188 |
-
|
189 |
-
/**
|
190 |
-
* Go to previous step on intro
|
191 |
-
*
|
192 |
-
* @api private
|
193 |
-
* @method _nextStep
|
194 |
-
*/
|
195 |
-
function _previousStep() {
|
196 |
-
if (this._currentStep === 0) {
|
197 |
-
return false;
|
198 |
-
}
|
199 |
-
|
200 |
-
if (typeof (this._introBeforeChangeCallback) !== 'undefined') {
|
201 |
-
this._introBeforeChangeCallback.call(this, this._targetElement);
|
202 |
-
}
|
203 |
-
|
204 |
-
_showElement.call(this, this._introItems[--this._currentStep]);
|
205 |
-
}
|
206 |
-
|
207 |
-
/**
|
208 |
-
* Exit from intro
|
209 |
-
*
|
210 |
-
* @api private
|
211 |
-
* @method _exitIntro
|
212 |
-
* @param {Object} targetElement
|
213 |
-
*/
|
214 |
-
function _exitIntro(targetElement) {
|
215 |
-
//remove overlay layer from the page
|
216 |
-
var overlayLayer = targetElement.querySelector('.introjs-overlay');
|
217 |
-
//for fade-out animation
|
218 |
-
overlayLayer.style.opacity = 0;
|
219 |
-
setTimeout(function () {
|
220 |
-
if (overlayLayer.parentNode) {
|
221 |
-
overlayLayer.parentNode.removeChild(overlayLayer);
|
222 |
-
}
|
223 |
-
}, 500);
|
224 |
-
//remove all helper layers
|
225 |
-
var helperLayer = targetElement.querySelector('.introjs-helperLayer');
|
226 |
-
if (helperLayer) {
|
227 |
-
helperLayer.parentNode.removeChild(helperLayer);
|
228 |
-
}
|
229 |
-
//remove `introjs-showElement` class from the element
|
230 |
-
var showElement = document.querySelector('.introjs-showElement');
|
231 |
-
if (showElement) {
|
232 |
-
showElement.className = showElement.className.replace(/introjs-[a-zA-Z]+/g, '').replace(/^\s+|\s+$/g, ''); // This is a manual trim.
|
233 |
-
}
|
234 |
-
|
235 |
-
//remove `introjs-fixParent` class from the elements
|
236 |
-
var fixParents = document.querySelectorAll('.introjs-fixParent');
|
237 |
-
if (fixParents && fixParents.length > 0) {
|
238 |
-
for (var i = fixParents.length - 1; i >= 0; i--) {
|
239 |
-
fixParents[i].className = fixParents[i].className.replace(/introjs-fixParent/g, '').replace(/^\s+|\s+$/g, '');
|
240 |
-
};
|
241 |
-
}
|
242 |
-
//clean listeners
|
243 |
-
if (window.removeEventListener) {
|
244 |
-
window.removeEventListener('keydown', this._onKeyDown, true);
|
245 |
-
} else if (document.detachEvent) { //IE
|
246 |
-
document.detachEvent('onkeydown', this._onKeyDown);
|
247 |
-
}
|
248 |
-
//set the step to zero
|
249 |
-
this._currentStep = undefined;
|
250 |
-
}
|
251 |
-
|
252 |
-
/**
|
253 |
-
* Render tooltip box in the page
|
254 |
-
*
|
255 |
-
* @api private
|
256 |
-
* @method _placeTooltip
|
257 |
-
* @param {Object} targetElement
|
258 |
-
* @param {Object} tooltipLayer
|
259 |
-
* @param {Object} arrowLayer
|
260 |
-
*/
|
261 |
-
function _placeTooltip(targetElement, tooltipLayer, arrowLayer) {
|
262 |
-
//reset the old style
|
263 |
-
tooltipLayer.style.top = null;
|
264 |
-
tooltipLayer.style.right = null;
|
265 |
-
tooltipLayer.style.bottom = null;
|
266 |
-
tooltipLayer.style.left = null;
|
267 |
-
|
268 |
-
//prevent error when `this._currentStep` is undefined
|
269 |
-
if(!this._introItems[this._currentStep]) return;
|
270 |
-
|
271 |
-
var currentTooltipPosition = this._introItems[this._currentStep].position;
|
272 |
-
switch (currentTooltipPosition) {
|
273 |
-
case 'top':
|
274 |
-
tooltipLayer.style.left = '15px';
|
275 |
-
tooltipLayer.style.top = '-' + (_getOffset(tooltipLayer).height + 10) + 'px';
|
276 |
-
arrowLayer.className = 'introjs-arrow bottom';
|
277 |
-
break;
|
278 |
-
case 'right':
|
279 |
-
tooltipLayer.style.left = (_getOffset(targetElement).width + 20) + 'px';
|
280 |
-
arrowLayer.className = 'introjs-arrow left';
|
281 |
-
break;
|
282 |
-
case 'left':
|
283 |
-
tooltipLayer.style.top = '15px';
|
284 |
-
tooltipLayer.style.right = (_getOffset(targetElement).width + 20) + 'px';
|
285 |
-
arrowLayer.className = 'introjs-arrow right';
|
286 |
-
break;
|
287 |
-
case 'bottom':
|
288 |
-
// Bottom going to follow the default behavior
|
289 |
-
default:
|
290 |
-
tooltipLayer.style.bottom = '-' + (_getOffset(tooltipLayer).height + 10) + 'px';
|
291 |
-
arrowLayer.className = 'introjs-arrow top';
|
292 |
-
break;
|
293 |
-
}
|
294 |
-
}
|
295 |
-
|
296 |
-
/**
|
297 |
-
* Update the position of the helper layer on the screen
|
298 |
-
*
|
299 |
-
* @api private
|
300 |
-
* @method _setHelperLayerPosition
|
301 |
-
* @param {Object} helperLayer
|
302 |
-
*/
|
303 |
-
function _setHelperLayerPosition(helperLayer) {
|
304 |
-
if(helperLayer) {
|
305 |
-
//prevent error when `this._currentStep` in undefined
|
306 |
-
if(!this._introItems[this._currentStep]) return;
|
307 |
-
|
308 |
-
var elementPosition = _getOffset(this._introItems[this._currentStep].element);
|
309 |
-
//set new position to helper layer
|
310 |
-
helperLayer.setAttribute('style', 'width: ' + (elementPosition.width + 10) + 'px; ' +
|
311 |
-
'height:' + (elementPosition.height + 10) + 'px; ' +
|
312 |
-
'top:' + (elementPosition.top - 5) + 'px;' +
|
313 |
-
'left: ' + (elementPosition.left - 5) + 'px;');
|
314 |
-
}
|
315 |
-
}
|
316 |
-
|
317 |
-
/**
|
318 |
-
* Show an element on the page
|
319 |
-
*
|
320 |
-
* @api private
|
321 |
-
* @method _showElement
|
322 |
-
* @param {Object} targetElement
|
323 |
-
*/
|
324 |
-
function _showElement(targetElement) {
|
325 |
-
|
326 |
-
if (typeof (this._introChangeCallback) !== 'undefined') {
|
327 |
-
this._introChangeCallback.call(this, targetElement.element);
|
328 |
-
}
|
329 |
-
|
330 |
-
var self = this,
|
331 |
-
oldHelperLayer = document.querySelector('.introjs-helperLayer'),
|
332 |
-
elementPosition = _getOffset(targetElement.element);
|
333 |
-
|
334 |
-
if(oldHelperLayer != null) {
|
335 |
-
var oldHelperNumberLayer = oldHelperLayer.querySelector('.introjs-helperNumberLayer'),
|
336 |
-
oldtooltipLayer = oldHelperLayer.querySelector('.introjs-tooltiptext'),
|
337 |
-
oldArrowLayer = oldHelperLayer.querySelector('.introjs-arrow'),
|
338 |
-
oldtooltipContainer = oldHelperLayer.querySelector('.introjs-tooltip'),
|
339 |
-
skipTooltipButton = oldHelperLayer.querySelector('.introjs-skipbutton'),
|
340 |
-
prevTooltipButton = oldHelperLayer.querySelector('.introjs-prevbutton'),
|
341 |
-
nextTooltipButton = oldHelperLayer.querySelector('.introjs-nextbutton');
|
342 |
-
|
343 |
-
//hide the tooltip
|
344 |
-
oldtooltipContainer.style.opacity = 0;
|
345 |
-
|
346 |
-
//set new position to helper layer
|
347 |
-
_setHelperLayerPosition.call(self, oldHelperLayer);
|
348 |
-
|
349 |
-
//remove `introjs-fixParent` class from the elements
|
350 |
-
var fixParents = document.querySelectorAll('.introjs-fixParent');
|
351 |
-
if (fixParents && fixParents.length > 0) {
|
352 |
-
for (var i = fixParents.length - 1; i >= 0; i--) {
|
353 |
-
fixParents[i].className = fixParents[i].className.replace(/introjs-fixParent/g, '').replace(/^\s+|\s+$/g, '');
|
354 |
-
};
|
355 |
-
}
|
356 |
-
|
357 |
-
//remove old classes
|
358 |
-
var oldShowElement = document.querySelector('.introjs-showElement');
|
359 |
-
oldShowElement.className = oldShowElement.className.replace(/introjs-[a-zA-Z]+/g, '').replace(/^\s+|\s+$/g, '');
|
360 |
-
//we should wait until the CSS3 transition is competed (it's 0.3 sec) to prevent incorrect `height` and `width` calculation
|
361 |
-
if (self._lastShowElementTimer) {
|
362 |
-
clearTimeout(self._lastShowElementTimer);
|
363 |
-
}
|
364 |
-
self._lastShowElementTimer = setTimeout(function() {
|
365 |
-
//set current step to the label
|
366 |
-
if(oldHelperNumberLayer != null) {
|
367 |
-
oldHelperNumberLayer.innerHTML = targetElement.step;
|
368 |
-
}
|
369 |
-
//set current tooltip text
|
370 |
-
oldtooltipLayer.innerHTML = targetElement.intro;
|
371 |
-
//set the tooltip position
|
372 |
-
_placeTooltip.call(self, targetElement.element, oldtooltipContainer, oldArrowLayer);
|
373 |
-
//show the tooltip
|
374 |
-
oldtooltipContainer.style.opacity = 1;
|
375 |
-
}, 350);
|
376 |
-
|
377 |
-
} else {
|
378 |
-
var helperLayer = document.createElement('div'),
|
379 |
-
arrowLayer = document.createElement('div'),
|
380 |
-
tooltipLayer = document.createElement('div');
|
381 |
-
|
382 |
-
helperLayer.className = 'introjs-helperLayer';
|
383 |
-
|
384 |
-
//set new position to helper layer
|
385 |
-
_setHelperLayerPosition.call(self, helperLayer);
|
386 |
-
|
387 |
-
//add helper layer to target element
|
388 |
-
this._targetElement.appendChild(helperLayer);
|
389 |
-
|
390 |
-
arrowLayer.className = 'introjs-arrow';
|
391 |
-
tooltipLayer.className = 'introjs-tooltip';
|
392 |
-
|
393 |
-
|
394 |
-
tooltipLayer.innerHTML = '<div class="introjs-tooltiptext">' +
|
395 |
-
targetElement.intro +
|
396 |
-
'</div><div class="introjs-tooltipbuttons"></div>';
|
397 |
-
|
398 |
-
//add helper layer number
|
399 |
-
if (this._options.showStepNumbers) {
|
400 |
-
var helperNumberLayer = document.createElement('span');
|
401 |
-
helperNumberLayer.className = 'introjs-helperNumberLayer';
|
402 |
-
helperNumberLayer.innerHTML = targetElement.step;
|
403 |
-
helperLayer.appendChild(helperNumberLayer);
|
404 |
-
}
|
405 |
-
tooltipLayer.appendChild(arrowLayer);
|
406 |
-
helperLayer.appendChild(tooltipLayer);
|
407 |
-
|
408 |
-
//next button
|
409 |
-
var nextTooltipButton = document.createElement('a');
|
410 |
-
|
411 |
-
nextTooltipButton.onclick = function() {
|
412 |
-
if(self._introItems.length - 1 != self._currentStep) {
|
413 |
-
_nextStep.call(self);
|
414 |
-
}
|
415 |
-
};
|
416 |
-
|
417 |
-
nextTooltipButton.href = 'javascript:void(0);';
|
418 |
-
nextTooltipButton.innerHTML = this._options.nextLabel;
|
419 |
-
|
420 |
-
//previous button
|
421 |
-
var prevTooltipButton = document.createElement('a');
|
422 |
-
|
423 |
-
prevTooltipButton.onclick = function() {
|
424 |
-
if(self._currentStep != 0) {
|
425 |
-
_previousStep.call(self);
|
426 |
-
}
|
427 |
-
};
|
428 |
-
|
429 |
-
prevTooltipButton.href = 'javascript:void(0);';
|
430 |
-
prevTooltipButton.innerHTML = this._options.prevLabel;
|
431 |
-
|
432 |
-
//skip button
|
433 |
-
var skipTooltipButton = document.createElement('a');
|
434 |
-
skipTooltipButton.className = 'introjs-button introjs-skipbutton';
|
435 |
-
skipTooltipButton.href = 'javascript:void(0);';
|
436 |
-
skipTooltipButton.innerHTML = this._options.skipLabel;
|
437 |
-
|
438 |
-
skipTooltipButton.onclick = function() {
|
439 |
-
if (self._introItems.length - 1 == self._currentStep && typeof (self._introCompleteCallback) === 'function') {
|
440 |
-
self._introCompleteCallback.call(self);
|
441 |
-
}
|
442 |
-
|
443 |
-
if (self._introItems.length - 1 != self._currentStep && typeof (self._introExitCallback) === 'function') {
|
444 |
-
self._introExitCallback.call(self);
|
445 |
-
}
|
446 |
-
|
447 |
-
_exitIntro.call(self, self._targetElement);
|
448 |
-
};
|
449 |
-
|
450 |
-
var tooltipButtonsLayer = tooltipLayer.querySelector('.introjs-tooltipbuttons');
|
451 |
-
tooltipButtonsLayer.appendChild(skipTooltipButton);
|
452 |
-
tooltipButtonsLayer.appendChild(prevTooltipButton);
|
453 |
-
tooltipButtonsLayer.appendChild(nextTooltipButton);
|
454 |
-
|
455 |
-
//set proper position
|
456 |
-
_placeTooltip.call(self, targetElement.element, tooltipLayer, arrowLayer);
|
457 |
-
}
|
458 |
-
|
459 |
-
if (this._currentStep == 0) {
|
460 |
-
prevTooltipButton.className = 'introjs-button introjs-prevbutton introjs-disabled';
|
461 |
-
nextTooltipButton.className = 'introjs-button introjs-nextbutton';
|
462 |
-
skipTooltipButton.innerHTML = this._options.skipLabel;
|
463 |
-
} else if (this._introItems.length - 1 == this._currentStep) {
|
464 |
-
skipTooltipButton.innerHTML = this._options.doneLabel;
|
465 |
-
prevTooltipButton.className = 'introjs-button introjs-prevbutton';
|
466 |
-
nextTooltipButton.className = 'introjs-button introjs-nextbutton introjs-disabled';
|
467 |
-
} else {
|
468 |
-
prevTooltipButton.className = 'introjs-button introjs-prevbutton';
|
469 |
-
nextTooltipButton.className = 'introjs-button introjs-nextbutton';
|
470 |
-
skipTooltipButton.innerHTML = this._options.skipLabel;
|
471 |
-
}
|
472 |
-
|
473 |
-
//Set focus on "next" button, so that hitting Enter always moves you onto the next step
|
474 |
-
nextTooltipButton.focus();
|
475 |
-
|
476 |
-
//add target element position style
|
477 |
-
targetElement.element.className += ' introjs-showElement';
|
478 |
-
|
479 |
-
var currentElementPosition = _getPropValue(targetElement.element, 'position');
|
480 |
-
if (currentElementPosition !== 'absolute' &&
|
481 |
-
currentElementPosition !== 'relative') {
|
482 |
-
//change to new intro item
|
483 |
-
targetElement.element.className += ' introjs-relativePosition';
|
484 |
-
}
|
485 |
-
|
486 |
-
var parentElm = targetElement.element.parentNode;
|
487 |
-
while(parentElm != null) {
|
488 |
-
if(parentElm.tagName.toLowerCase() === 'body') break;
|
489 |
-
|
490 |
-
var zIndex = _getPropValue(parentElm, 'z-index');
|
491 |
-
if(/[0-9]+/.test(zIndex)) {
|
492 |
-
parentElm.className += ' introjs-fixParent';
|
493 |
-
}
|
494 |
-
parentElm = parentElm.parentNode;
|
495 |
-
}
|
496 |
-
|
497 |
-
if (!_elementInViewport(targetElement.element)) {
|
498 |
-
var rect = targetElement.element.getBoundingClientRect(),
|
499 |
-
top = rect.bottom - (rect.bottom - rect.top),
|
500 |
-
bottom = rect.bottom - _getWinSize().height;
|
501 |
-
|
502 |
-
// Scroll up
|
503 |
-
if (top < 0) {
|
504 |
-
window.scrollBy(0, top - 30); // 30px padding from edge to look nice
|
505 |
-
|
506 |
-
// Scroll down
|
507 |
-
} else {
|
508 |
-
window.scrollBy(0, bottom + 100); // 70px + 30px padding from edge to look nice
|
509 |
-
}
|
510 |
-
}
|
511 |
-
}
|
512 |
-
|
513 |
-
/**
|
514 |
-
* Get an element CSS property on the page
|
515 |
-
* Thanks to JavaScript Kit: http://www.javascriptkit.com/dhtmltutors/dhtmlcascade4.shtml
|
516 |
-
*
|
517 |
-
* @api private
|
518 |
-
* @method _getPropValue
|
519 |
-
* @param {Object} element
|
520 |
-
* @param {String} propName
|
521 |
-
* @returns Element's property value
|
522 |
-
*/
|
523 |
-
function _getPropValue (element, propName) {
|
524 |
-
var propValue = '';
|
525 |
-
if (element.currentStyle) { //IE
|
526 |
-
propValue = element.currentStyle[propName];
|
527 |
-
} else if (document.defaultView && document.defaultView.getComputedStyle) { //Others
|
528 |
-
propValue = document.defaultView.getComputedStyle(element, null).getPropertyValue(propName);
|
529 |
-
}
|
530 |
-
|
531 |
-
//Prevent exception in IE
|
532 |
-
if(propValue.toLowerCase) {
|
533 |
-
return propValue.toLowerCase();
|
534 |
-
} else {
|
535 |
-
return propValue;
|
536 |
-
}
|
537 |
-
}
|
538 |
-
|
539 |
-
/**
|
540 |
-
* Provides a cross-browser way to get the screen dimensions
|
541 |
-
* via: http://stackoverflow.com/questions/5864467/internet-explorer-innerheight
|
542 |
-
*
|
543 |
-
* @api private
|
544 |
-
* @method _getWinSize
|
545 |
-
* @returns {Object} width and height attributes
|
546 |
-
*/
|
547 |
-
function _getWinSize() {
|
548 |
-
if (window.innerWidth != undefined) {
|
549 |
-
return { width: window.innerWidth, height: window.innerHeight };
|
550 |
-
} else {
|
551 |
-
var D = document.documentElement;
|
552 |
-
return { width: D.clientWidth, height: D.clientHeight };
|
553 |
-
}
|
554 |
-
}
|
555 |
-
|
556 |
-
/**
|
557 |
-
* Add overlay layer to the page
|
558 |
-
* http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport
|
559 |
-
*
|
560 |
-
* @api private
|
561 |
-
* @method _elementInViewport
|
562 |
-
* @param {Object} el
|
563 |
-
*/
|
564 |
-
function _elementInViewport(el) {
|
565 |
-
var rect = el.getBoundingClientRect();
|
566 |
-
|
567 |
-
return (
|
568 |
-
rect.top >= 0 &&
|
569 |
-
rect.left >= 0 &&
|
570 |
-
(rect.bottom+80) <= window.innerHeight && // add 80 to get the text right
|
571 |
-
rect.right <= window.innerWidth
|
572 |
-
);
|
573 |
-
}
|
574 |
-
|
575 |
-
/**
|
576 |
-
* Add overlay layer to the page
|
577 |
-
*
|
578 |
-
* @api private
|
579 |
-
* @method _addOverlayLayer
|
580 |
-
* @param {Object} targetElm
|
581 |
-
*/
|
582 |
-
function _addOverlayLayer(targetElm) {
|
583 |
-
var overlayLayer = document.createElement('div'),
|
584 |
-
styleText = '',
|
585 |
-
self = this;
|
586 |
-
|
587 |
-
//set css class name
|
588 |
-
overlayLayer.className = 'introjs-overlay';
|
589 |
-
|
590 |
-
//check if the target element is body, we should calculate the size of overlay layer in a better way
|
591 |
-
if (targetElm.tagName.toLowerCase() === 'body') {
|
592 |
-
styleText += 'top: 0;bottom: 0; left: 0;right: 0;position: fixed;';
|
593 |
-
overlayLayer.setAttribute('style', styleText);
|
594 |
-
} else {
|
595 |
-
//set overlay layer position
|
596 |
-
var elementPosition = _getOffset(targetElm);
|
597 |
-
if(elementPosition) {
|
598 |
-
styleText += 'width: ' + elementPosition.width + 'px; height:' + elementPosition.height + 'px; top:' + elementPosition.top + 'px;left: ' + elementPosition.left + 'px;';
|
599 |
-
overlayLayer.setAttribute('style', styleText);
|
600 |
-
}
|
601 |
-
}
|
602 |
-
|
603 |
-
targetElm.appendChild(overlayLayer);
|
604 |
-
|
605 |
-
overlayLayer.onclick = function() {
|
606 |
-
if(self._options.exitOnOverlayClick == true) {
|
607 |
-
_exitIntro.call(self, targetElm);
|
608 |
-
}
|
609 |
-
//check if any callback is defined
|
610 |
-
if (self._introExitCallback != undefined) {
|
611 |
-
self._introExitCallback.call(self);
|
612 |
-
}
|
613 |
-
};
|
614 |
-
|
615 |
-
setTimeout(function() {
|
616 |
-
styleText += 'opacity: .8;';
|
617 |
-
overlayLayer.setAttribute('style', styleText);
|
618 |
-
}, 10);
|
619 |
-
return true;
|
620 |
-
}
|
621 |
-
|
622 |
-
/**
|
623 |
-
* Get an element position on the page
|
624 |
-
* Thanks to `meouw`: http://stackoverflow.com/a/442474/375966
|
625 |
-
*
|
626 |
-
* @api private
|
627 |
-
* @method _getOffset
|
628 |
-
* @param {Object} element
|
629 |
-
* @returns Element's position info
|
630 |
-
*/
|
631 |
-
function _getOffset(element) {
|
632 |
-
var elementPosition = {};
|
633 |
-
|
634 |
-
//set width
|
635 |
-
elementPosition.width = element.offsetWidth;
|
636 |
-
|
637 |
-
//set height
|
638 |
-
elementPosition.height = element.offsetHeight;
|
639 |
-
|
640 |
-
//calculate element top and left
|
641 |
-
var _x = 0;
|
642 |
-
var _y = 0;
|
643 |
-
while(element && !isNaN(element.offsetLeft) && !isNaN(element.offsetTop)) {
|
644 |
-
_x += element.offsetLeft;
|
645 |
-
_y += element.offsetTop;
|
646 |
-
element = element.offsetParent;
|
647 |
-
}
|
648 |
-
//set top
|
649 |
-
elementPosition.top = _y;
|
650 |
-
//set left
|
651 |
-
elementPosition.left = _x;
|
652 |
-
|
653 |
-
return elementPosition;
|
654 |
-
}
|
655 |
-
|
656 |
-
/**
|
657 |
-
* Overwrites obj1's values with obj2's and adds obj2's if non existent in obj1
|
658 |
-
* via: http://stackoverflow.com/questions/171251/how-can-i-merge-properties-of-two-javascript-objects-dynamically
|
659 |
-
*
|
660 |
-
* @param obj1
|
661 |
-
* @param obj2
|
662 |
-
* @returns obj3 a new object based on obj1 and obj2
|
663 |
-
*/
|
664 |
-
function _mergeOptions(obj1,obj2) {
|
665 |
-
var obj3 = {};
|
666 |
-
for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }
|
667 |
-
for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }
|
668 |
-
return obj3;
|
669 |
-
}
|
670 |
-
|
671 |
-
var introJs = function (targetElm) {
|
672 |
-
if (typeof (targetElm) === 'object') {
|
673 |
-
//Ok, create a new instance
|
674 |
-
return new IntroJs(targetElm);
|
675 |
-
|
676 |
-
} else if (typeof (targetElm) === 'string') {
|
677 |
-
//select the target element with query selector
|
678 |
-
var targetElement = document.querySelector(targetElm);
|
679 |
-
|
680 |
-
if (targetElement) {
|
681 |
-
return new IntroJs(targetElement);
|
682 |
-
} else {
|
683 |
-
throw new Error('There is no element with given selector.');
|
684 |
-
}
|
685 |
-
} else {
|
686 |
-
return new IntroJs(document.body);
|
687 |
-
}
|
688 |
-
};
|
689 |
-
|
690 |
-
/**
|
691 |
-
* Current IntroJs version
|
692 |
-
*
|
693 |
-
* @property version
|
694 |
-
* @type String
|
695 |
-
*/
|
696 |
-
introJs.version = VERSION;
|
697 |
-
|
698 |
-
//Prototype
|
699 |
-
introJs.fn = IntroJs.prototype = {
|
700 |
-
clone: function () {
|
701 |
-
return new IntroJs(this);
|
702 |
-
},
|
703 |
-
setOption: function(option, value) {
|
704 |
-
this._options[option] = value;
|
705 |
-
return this;
|
706 |
-
},
|
707 |
-
setOptions: function(options) {
|
708 |
-
this._options = _mergeOptions(this._options, options);
|
709 |
-
return this;
|
710 |
-
},
|
711 |
-
start: function () {
|
712 |
-
_introForElement.call(this, this._targetElement);
|
713 |
-
return this;
|
714 |
-
},
|
715 |
-
goToStep: function(step) {
|
716 |
-
_goToStep.call(this, step);
|
717 |
-
return this;
|
718 |
-
},
|
719 |
-
exit: function() {
|
720 |
-
_exitIntro.call(this, this._targetElement);
|
721 |
-
},
|
722 |
-
onbeforechange: function(providedCallback) {
|
723 |
-
if (typeof (providedCallback) === 'function') {
|
724 |
-
this._introBeforeChangeCallback = providedCallback;
|
725 |
-
} else {
|
726 |
-
throw new Error('Provided callback for onbeforechange was not a function');
|
727 |
-
}
|
728 |
-
return this;
|
729 |
-
},
|
730 |
-
onchange: function(providedCallback) {
|
731 |
-
if (typeof (providedCallback) === 'function') {
|
732 |
-
this._introChangeCallback = providedCallback;
|
733 |
-
} else {
|
734 |
-
throw new Error('Provided callback for onchange was not a function.');
|
735 |
-
}
|
736 |
-
return this;
|
737 |
-
},
|
738 |
-
oncomplete: function(providedCallback) {
|
739 |
-
if (typeof (providedCallback) === 'function') {
|
740 |
-
this._introCompleteCallback = providedCallback;
|
741 |
-
} else {
|
742 |
-
throw new Error('Provided callback for oncomplete was not a function.');
|
743 |
-
}
|
744 |
-
return this;
|
745 |
-
},
|
746 |
-
onexit: function(providedCallback) {
|
747 |
-
if (typeof (providedCallback) === 'function') {
|
748 |
-
this._introExitCallback = providedCallback;
|
749 |
-
} else {
|
750 |
-
throw new Error('Provided callback for onexit was not a function.');
|
751 |
-
}
|
752 |
-
return this;
|
753 |
-
}
|
754 |
-
};
|
755 |
-
|
756 |
-
exports.introJs = introJs;
|
757 |
-
return introJs;
|
758 |
-
}));
|
1 |
+
/**
|
2 |
+
* Intro.js v0.4.0
|
3 |
+
* https://github.com/usablica/intro.js
|
4 |
+
* MIT licensed
|
5 |
+
*
|
6 |
+
* Copyright (C) 2013 usabli.ca - A weekend project by Afshin Mehrabani (@afshinmeh)
|
7 |
+
*/
|
8 |
+
|
9 |
+
(function (root, factory) {
|
10 |
+
if (typeof exports === 'object') {
|
11 |
+
// CommonJS
|
12 |
+
factory(exports);
|
13 |
+
} else if (typeof define === 'function' && define.amd) {
|
14 |
+
// AMD. Register as an anonymous module.
|
15 |
+
define(['exports'], factory);
|
16 |
+
} else {
|
17 |
+
// Browser globals
|
18 |
+
factory(root);
|
19 |
+
}
|
20 |
+
} (this, function (exports) {
|
21 |
+
//Default config/variables
|
22 |
+
var VERSION = '0.4.0';
|
23 |
+
|
24 |
+
/**
|
25 |
+
* IntroJs main class
|
26 |
+
*
|
27 |
+
* @class IntroJs
|
28 |
+
*/
|
29 |
+
function IntroJs(obj) {
|
30 |
+
this._targetElement = obj;
|
31 |
+
|
32 |
+
this._options = {
|
33 |
+
nextLabel: 'Next →',
|
34 |
+
prevLabel: '← Back',
|
35 |
+
skipLabel: 'Skip',
|
36 |
+
doneLabel: 'Done',
|
37 |
+
tooltipPosition: 'bottom',
|
38 |
+
exitOnEsc: true,
|
39 |
+
exitOnOverlayClick: true,
|
40 |
+
showStepNumbers: true
|
41 |
+
};
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Initiate a new introduction/guide from an element in the page
|
46 |
+
*
|
47 |
+
* @api private
|
48 |
+
* @method _introForElement
|
49 |
+
* @param {Object} targetElm
|
50 |
+
* @returns {Boolean} Success or not?
|
51 |
+
*/
|
52 |
+
function _introForElement(targetElm) {
|
53 |
+
var introItems = [],
|
54 |
+
self = this;
|
55 |
+
|
56 |
+
if (this._options.steps) {
|
57 |
+
//use steps passed programmatically
|
58 |
+
var allIntroSteps = [];
|
59 |
+
|
60 |
+
for (var i = 0, stepsLength = this._options.steps.length; i < stepsLength; i++) {
|
61 |
+
var currentItem = this._options.steps[i];
|
62 |
+
//set the step
|
63 |
+
currentItem.step = i + 1;
|
64 |
+
//grab the element with given selector from the page
|
65 |
+
currentItem.element = document.querySelector(currentItem.element);
|
66 |
+
introItems.push(currentItem);
|
67 |
+
}
|
68 |
+
|
69 |
+
} else {
|
70 |
+
//use steps from data-* annotations
|
71 |
+
|
72 |
+
var allIntroSteps = targetElm.querySelectorAll('*[data-intro]');
|
73 |
+
//if there's no element to intro
|
74 |
+
if (allIntroSteps.length < 1) {
|
75 |
+
return false;
|
76 |
+
}
|
77 |
+
|
78 |
+
for (var i = 0, elmsLength = allIntroSteps.length; i < elmsLength; i++) {
|
79 |
+
var currentElement = allIntroSteps[i];
|
80 |
+
introItems.push({
|
81 |
+
element: currentElement,
|
82 |
+
intro: currentElement.getAttribute('data-intro'),
|
83 |
+
step: parseInt(currentElement.getAttribute('data-step'), 10),
|
84 |
+
position: currentElement.getAttribute('data-position') || this._options.tooltipPosition
|
85 |
+
});
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
//Ok, sort all items with given steps
|
90 |
+
introItems.sort(function (a, b) {
|
91 |
+
return a.step - b.step;
|
92 |
+
});
|
93 |
+
|
94 |
+
//set it to the introJs object
|
95 |
+
self._introItems = introItems;
|
96 |
+
|
97 |
+
//add overlay layer to the page
|
98 |
+
if(_addOverlayLayer.call(self, targetElm)) {
|
99 |
+
//then, start the show
|
100 |
+
_nextStep.call(self);
|
101 |
+
|
102 |
+
var skipButton = targetElm.querySelector('.introjs-skipbutton'),
|
103 |
+
nextStepButton = targetElm.querySelector('.introjs-nextbutton');
|
104 |
+
|
105 |
+
self._onKeyDown = function(e) {
|
106 |
+
if (e.keyCode === 27 && self._options.exitOnEsc == true) {
|
107 |
+
//escape key pressed, exit the intro
|
108 |
+
_exitIntro.call(self, targetElm);
|
109 |
+
//check if any callback is defined
|
110 |
+
if (self._introExitCallback != undefined) {
|
111 |
+
self._introExitCallback.call(self);
|
112 |
+
}
|
113 |
+
} else if(e.keyCode === 37) {
|
114 |
+
//left arrow
|
115 |
+
_previousStep.call(self);
|
116 |
+
} else if (e.keyCode === 39 || e.keyCode === 13) {
|
117 |
+
//right arrow or enter
|
118 |
+
_nextStep.call(self);
|
119 |
+
//prevent default behaviour on hitting Enter, to prevent steps being skipped in some browsers
|
120 |
+
if(e.preventDefault) {
|
121 |
+
e.preventDefault();
|
122 |
+
} else {
|
123 |
+
e.returnValue = false;
|
124 |
+
}
|
125 |
+
}
|
126 |
+
};
|
127 |
+
|
128 |
+
self._onResize = function(e) {
|
129 |
+
_setHelperLayerPosition.call(self, document.querySelector('.introjs-helperLayer'));
|
130 |
+
};
|
131 |
+
|
132 |
+
if (window.addEventListener) {
|
133 |
+
window.addEventListener('keydown', self._onKeyDown, true);
|
134 |
+
//for window resize
|
135 |
+
window.addEventListener("resize", self._onResize, true);
|
136 |
+
} else if (document.attachEvent) { //IE
|
137 |
+
document.attachEvent('onkeydown', self._onKeyDown);
|
138 |
+
//for window resize
|
139 |
+
document.attachEvent("onresize", self._onResize);
|
140 |
+
}
|
141 |
+
}
|
142 |
+
return false;
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Go to specific step of introduction
|
147 |
+
*
|
148 |
+
* @api private
|
149 |
+
* @method _goToStep
|
150 |
+
*/
|
151 |
+
function _goToStep(step) {
|
152 |
+
//because steps starts with zero
|
153 |
+
this._currentStep = step - 2;
|
154 |
+
if(typeof (this._introItems) !== 'undefined') {
|
155 |
+
_nextStep.call(this);
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Go to next step on intro
|
161 |
+
*
|
162 |
+
* @api private
|
163 |
+
* @method _nextStep
|
164 |
+
*/
|
165 |
+
function _nextStep() {
|
166 |
+
if (typeof (this._introBeforeChangeCallback) !== 'undefined') {
|
167 |
+
this._introBeforeChangeCallback.call(this, this._targetElement);
|
168 |
+
}
|
169 |
+
|
170 |
+
if (typeof (this._currentStep) === 'undefined') {
|
171 |
+
this._currentStep = 0;
|
172 |
+
} else {
|
173 |
+
++this._currentStep;
|
174 |
+
}
|
175 |
+
|
176 |
+
if((this._introItems.length) <= this._currentStep) {
|
177 |
+
//end of the intro
|
178 |
+
//check if any callback is defined
|
179 |
+
if (typeof (this._introCompleteCallback) === 'function') {
|
180 |
+
this._introCompleteCallback.call(this);
|
181 |
+
}
|
182 |
+
_exitIntro.call(this, this._targetElement);
|
183 |
+
return;
|
184 |
+
}
|
185 |
+
|
186 |
+
_showElement.call(this, this._introItems[this._currentStep]);
|
187 |
+
}
|
188 |
+
|
189 |
+
/**
|
190 |
+
* Go to previous step on intro
|
191 |
+
*
|
192 |
+
* @api private
|
193 |
+
* @method _nextStep
|
194 |
+
*/
|
195 |
+
function _previousStep() {
|
196 |
+
if (this._currentStep === 0) {
|
197 |
+
return false;
|
198 |
+
}
|
199 |
+
|
200 |
+
if (typeof (this._introBeforeChangeCallback) !== 'undefined') {
|
201 |
+
this._introBeforeChangeCallback.call(this, this._targetElement);
|
202 |
+
}
|
203 |
+
|
204 |
+
_showElement.call(this, this._introItems[--this._currentStep]);
|
205 |
+
}
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Exit from intro
|
209 |
+
*
|
210 |
+
* @api private
|
211 |
+
* @method _exitIntro
|
212 |
+
* @param {Object} targetElement
|
213 |
+
*/
|
214 |
+
function _exitIntro(targetElement) {
|
215 |
+
//remove overlay layer from the page
|
216 |
+
var overlayLayer = targetElement.querySelector('.introjs-overlay');
|
217 |
+
//for fade-out animation
|
218 |
+
overlayLayer.style.opacity = 0;
|
219 |
+
setTimeout(function () {
|
220 |
+
if (overlayLayer.parentNode) {
|
221 |
+
overlayLayer.parentNode.removeChild(overlayLayer);
|
222 |
+
}
|
223 |
+
}, 500);
|
224 |
+
//remove all helper layers
|
225 |
+
var helperLayer = targetElement.querySelector('.introjs-helperLayer');
|
226 |
+
if (helperLayer) {
|
227 |
+
helperLayer.parentNode.removeChild(helperLayer);
|
228 |
+
}
|
229 |
+
//remove `introjs-showElement` class from the element
|
230 |
+
var showElement = document.querySelector('.introjs-showElement');
|
231 |
+
if (showElement) {
|
232 |
+
showElement.className = showElement.className.replace(/introjs-[a-zA-Z]+/g, '').replace(/^\s+|\s+$/g, ''); // This is a manual trim.
|
233 |
+
}
|
234 |
+
|
235 |
+
//remove `introjs-fixParent` class from the elements
|
236 |
+
var fixParents = document.querySelectorAll('.introjs-fixParent');
|
237 |
+
if (fixParents && fixParents.length > 0) {
|
238 |
+
for (var i = fixParents.length - 1; i >= 0; i--) {
|
239 |
+
fixParents[i].className = fixParents[i].className.replace(/introjs-fixParent/g, '').replace(/^\s+|\s+$/g, '');
|
240 |
+
};
|
241 |
+
}
|
242 |
+
//clean listeners
|
243 |
+
if (window.removeEventListener) {
|
244 |
+
window.removeEventListener('keydown', this._onKeyDown, true);
|
245 |
+
} else if (document.detachEvent) { //IE
|
246 |
+
document.detachEvent('onkeydown', this._onKeyDown);
|
247 |
+
}
|
248 |
+
//set the step to zero
|
249 |
+
this._currentStep = undefined;
|
250 |
+
}
|
251 |
+
|
252 |
+
/**
|
253 |
+
* Render tooltip box in the page
|
254 |
+
*
|
255 |
+
* @api private
|
256 |
+
* @method _placeTooltip
|
257 |
+
* @param {Object} targetElement
|
258 |
+
* @param {Object} tooltipLayer
|
259 |
+
* @param {Object} arrowLayer
|
260 |
+
*/
|
261 |
+
function _placeTooltip(targetElement, tooltipLayer, arrowLayer) {
|
262 |
+
//reset the old style
|
263 |
+
tooltipLayer.style.top = null;
|
264 |
+
tooltipLayer.style.right = null;
|
265 |
+
tooltipLayer.style.bottom = null;
|
266 |
+
tooltipLayer.style.left = null;
|
267 |
+
|
268 |
+
//prevent error when `this._currentStep` is undefined
|
269 |
+
if(!this._introItems[this._currentStep]) return;
|
270 |
+
|
271 |
+
var currentTooltipPosition = this._introItems[this._currentStep].position;
|
272 |
+
switch (currentTooltipPosition) {
|
273 |
+
case 'top':
|
274 |
+
tooltipLayer.style.left = '15px';
|
275 |
+
tooltipLayer.style.top = '-' + (_getOffset(tooltipLayer).height + 10) + 'px';
|
276 |
+
arrowLayer.className = 'introjs-arrow bottom';
|
277 |
+
break;
|
278 |
+
case 'right':
|
279 |
+
tooltipLayer.style.left = (_getOffset(targetElement).width + 20) + 'px';
|
280 |
+
arrowLayer.className = 'introjs-arrow left';
|
281 |
+
break;
|
282 |
+
case 'left':
|
283 |
+
tooltipLayer.style.top = '15px';
|
284 |
+
tooltipLayer.style.right = (_getOffset(targetElement).width + 20) + 'px';
|
285 |
+
arrowLayer.className = 'introjs-arrow right';
|
286 |
+
break;
|
287 |
+
case 'bottom':
|
288 |
+
// Bottom going to follow the default behavior
|
289 |
+
default:
|
290 |
+
tooltipLayer.style.bottom = '-' + (_getOffset(tooltipLayer).height + 10) + 'px';
|
291 |
+
arrowLayer.className = 'introjs-arrow top';
|
292 |
+
break;
|
293 |
+
}
|
294 |
+
}
|
295 |
+
|
296 |
+
/**
|
297 |
+
* Update the position of the helper layer on the screen
|
298 |
+
*
|
299 |
+
* @api private
|
300 |
+
* @method _setHelperLayerPosition
|
301 |
+
* @param {Object} helperLayer
|
302 |
+
*/
|
303 |
+
function _setHelperLayerPosition(helperLayer) {
|
304 |
+
if(helperLayer) {
|
305 |
+
//prevent error when `this._currentStep` in undefined
|
306 |
+
if(!this._introItems[this._currentStep]) return;
|
307 |
+
|
308 |
+
var elementPosition = _getOffset(this._introItems[this._currentStep].element);
|
309 |
+
//set new position to helper layer
|
310 |
+
helperLayer.setAttribute('style', 'width: ' + (elementPosition.width + 10) + 'px; ' +
|
311 |
+
'height:' + (elementPosition.height + 10) + 'px; ' +
|
312 |
+
'top:' + (elementPosition.top - 5) + 'px;' +
|
313 |
+
'left: ' + (elementPosition.left - 5) + 'px;');
|
314 |
+
}
|
315 |
+
}
|
316 |
+
|
317 |
+
/**
|
318 |
+
* Show an element on the page
|
319 |
+
*
|
320 |
+
* @api private
|
321 |
+
* @method _showElement
|
322 |
+
* @param {Object} targetElement
|
323 |
+
*/
|
324 |
+
function _showElement(targetElement) {
|
325 |
+
|
326 |
+
if (typeof (this._introChangeCallback) !== 'undefined') {
|
327 |
+
this._introChangeCallback.call(this, targetElement.element);
|
328 |
+
}
|
329 |
+
|
330 |
+
var self = this,
|
331 |
+
oldHelperLayer = document.querySelector('.introjs-helperLayer'),
|
332 |
+
elementPosition = _getOffset(targetElement.element);
|
333 |
+
|
334 |
+
if(oldHelperLayer != null) {
|
335 |
+
var oldHelperNumberLayer = oldHelperLayer.querySelector('.introjs-helperNumberLayer'),
|
336 |
+
oldtooltipLayer = oldHelperLayer.querySelector('.introjs-tooltiptext'),
|
337 |
+
oldArrowLayer = oldHelperLayer.querySelector('.introjs-arrow'),
|
338 |
+
oldtooltipContainer = oldHelperLayer.querySelector('.introjs-tooltip'),
|
339 |
+
skipTooltipButton = oldHelperLayer.querySelector('.introjs-skipbutton'),
|
340 |
+
prevTooltipButton = oldHelperLayer.querySelector('.introjs-prevbutton'),
|
341 |
+
nextTooltipButton = oldHelperLayer.querySelector('.introjs-nextbutton');
|
342 |
+
|
343 |
+
//hide the tooltip
|
344 |
+
oldtooltipContainer.style.opacity = 0;
|
345 |
+
|
346 |
+
//set new position to helper layer
|
347 |
+
_setHelperLayerPosition.call(self, oldHelperLayer);
|
348 |
+
|
349 |
+
//remove `introjs-fixParent` class from the elements
|
350 |
+
var fixParents = document.querySelectorAll('.introjs-fixParent');
|
351 |
+
if (fixParents && fixParents.length > 0) {
|
352 |
+
for (var i = fixParents.length - 1; i >= 0; i--) {
|
353 |
+
fixParents[i].className = fixParents[i].className.replace(/introjs-fixParent/g, '').replace(/^\s+|\s+$/g, '');
|
354 |
+
};
|
355 |
+
}
|
356 |
+
|
357 |
+
//remove old classes
|
358 |
+
var oldShowElement = document.querySelector('.introjs-showElement');
|
359 |
+
oldShowElement.className = oldShowElement.className.replace(/introjs-[a-zA-Z]+/g, '').replace(/^\s+|\s+$/g, '');
|
360 |
+
//we should wait until the CSS3 transition is competed (it's 0.3 sec) to prevent incorrect `height` and `width` calculation
|
361 |
+
if (self._lastShowElementTimer) {
|
362 |
+
clearTimeout(self._lastShowElementTimer);
|
363 |
+
}
|
364 |
+
self._lastShowElementTimer = setTimeout(function() {
|
365 |
+
//set current step to the label
|
366 |
+
if(oldHelperNumberLayer != null) {
|
367 |
+
oldHelperNumberLayer.innerHTML = targetElement.step;
|
368 |
+
}
|
369 |
+
//set current tooltip text
|
370 |
+
oldtooltipLayer.innerHTML = targetElement.intro;
|
371 |
+
//set the tooltip position
|
372 |
+
_placeTooltip.call(self, targetElement.element, oldtooltipContainer, oldArrowLayer);
|
373 |
+
//show the tooltip
|
374 |
+
oldtooltipContainer.style.opacity = 1;
|
375 |
+
}, 350);
|
376 |
+
|
377 |
+
} else {
|
378 |
+
var helperLayer = document.createElement('div'),
|
379 |
+
arrowLayer = document.createElement('div'),
|
380 |
+
tooltipLayer = document.createElement('div');
|
381 |
+
|
382 |
+
helperLayer.className = 'introjs-helperLayer';
|
383 |
+
|
384 |
+
//set new position to helper layer
|
385 |
+
_setHelperLayerPosition.call(self, helperLayer);
|
386 |
+
|
387 |
+
//add helper layer to target element
|
388 |
+
this._targetElement.appendChild(helperLayer);
|
389 |
+
|
390 |
+
arrowLayer.className = 'introjs-arrow';
|
391 |
+
tooltipLayer.className = 'introjs-tooltip';
|
392 |
+
|
393 |
+
|
394 |
+
tooltipLayer.innerHTML = '<div class="introjs-tooltiptext">' +
|
395 |
+
targetElement.intro +
|
396 |
+
'</div><div class="introjs-tooltipbuttons"></div>';
|
397 |
+
|
398 |
+
//add helper layer number
|
399 |
+
if (this._options.showStepNumbers) {
|
400 |
+
var helperNumberLayer = document.createElement('span');
|
401 |
+
helperNumberLayer.className = 'introjs-helperNumberLayer';
|
402 |
+
helperNumberLayer.innerHTML = targetElement.step;
|
403 |
+
helperLayer.appendChild(helperNumberLayer);
|
404 |
+
}
|
405 |
+
tooltipLayer.appendChild(arrowLayer);
|
406 |
+
helperLayer.appendChild(tooltipLayer);
|
407 |
+
|
408 |
+
//next button
|
409 |
+
var nextTooltipButton = document.createElement('a');
|
410 |
+
|
411 |
+
nextTooltipButton.onclick = function() {
|
412 |
+
if(self._introItems.length - 1 != self._currentStep) {
|
413 |
+
_nextStep.call(self);
|
414 |
+
}
|
415 |
+
};
|
416 |
+
|
417 |
+
nextTooltipButton.href = 'javascript:void(0);';
|
418 |
+
nextTooltipButton.innerHTML = this._options.nextLabel;
|
419 |
+
|
420 |
+
//previous button
|
421 |
+
var prevTooltipButton = document.createElement('a');
|
422 |
+
|
423 |
+
prevTooltipButton.onclick = function() {
|
424 |
+
if(self._currentStep != 0) {
|
425 |
+
_previousStep.call(self);
|
426 |
+
}
|
427 |
+
};
|
428 |
+
|
429 |
+
prevTooltipButton.href = 'javascript:void(0);';
|
430 |
+
prevTooltipButton.innerHTML = this._options.prevLabel;
|
431 |
+
|
432 |
+
//skip button
|
433 |
+
var skipTooltipButton = document.createElement('a');
|
434 |
+
skipTooltipButton.className = 'introjs-button introjs-skipbutton';
|
435 |
+
skipTooltipButton.href = 'javascript:void(0);';
|
436 |
+
skipTooltipButton.innerHTML = this._options.skipLabel;
|
437 |
+
|
438 |
+
skipTooltipButton.onclick = function() {
|
439 |
+
if (self._introItems.length - 1 == self._currentStep && typeof (self._introCompleteCallback) === 'function') {
|
440 |
+
self._introCompleteCallback.call(self);
|
441 |
+
}
|
442 |
+
|
443 |
+
if (self._introItems.length - 1 != self._currentStep && typeof (self._introExitCallback) === 'function') {
|
444 |
+
self._introExitCallback.call(self);
|
445 |
+
}
|
446 |
+
|
447 |
+
_exitIntro.call(self, self._targetElement);
|
448 |
+
};
|
449 |
+
|
450 |
+
var tooltipButtonsLayer = tooltipLayer.querySelector('.introjs-tooltipbuttons');
|
451 |
+
tooltipButtonsLayer.appendChild(skipTooltipButton);
|
452 |
+
tooltipButtonsLayer.appendChild(prevTooltipButton);
|
453 |
+
tooltipButtonsLayer.appendChild(nextTooltipButton);
|
454 |
+
|
455 |
+
//set proper position
|
456 |
+
_placeTooltip.call(self, targetElement.element, tooltipLayer, arrowLayer);
|
457 |
+
}
|
458 |
+
|
459 |
+
if (this._currentStep == 0) {
|
460 |
+
prevTooltipButton.className = 'introjs-button introjs-prevbutton introjs-disabled';
|
461 |
+
nextTooltipButton.className = 'introjs-button introjs-nextbutton';
|
462 |
+
skipTooltipButton.innerHTML = this._options.skipLabel;
|
463 |
+
} else if (this._introItems.length - 1 == this._currentStep) {
|
464 |
+
skipTooltipButton.innerHTML = this._options.doneLabel;
|
465 |
+
prevTooltipButton.className = 'introjs-button introjs-prevbutton';
|
466 |
+
nextTooltipButton.className = 'introjs-button introjs-nextbutton introjs-disabled';
|
467 |
+
} else {
|
468 |
+
prevTooltipButton.className = 'introjs-button introjs-prevbutton';
|
469 |
+
nextTooltipButton.className = 'introjs-button introjs-nextbutton';
|
470 |
+
skipTooltipButton.innerHTML = this._options.skipLabel;
|
471 |
+
}
|
472 |
+
|
473 |
+
//Set focus on "next" button, so that hitting Enter always moves you onto the next step
|
474 |
+
nextTooltipButton.focus();
|
475 |
+
|
476 |
+
//add target element position style
|
477 |
+
targetElement.element.className += ' introjs-showElement';
|
478 |
+
|
479 |
+
var currentElementPosition = _getPropValue(targetElement.element, 'position');
|
480 |
+
if (currentElementPosition !== 'absolute' &&
|
481 |
+
currentElementPosition !== 'relative') {
|
482 |
+
//change to new intro item
|
483 |
+
targetElement.element.className += ' introjs-relativePosition';
|
484 |
+
}
|
485 |
+
|
486 |
+
var parentElm = targetElement.element.parentNode;
|
487 |
+
while(parentElm != null) {
|
488 |
+
if(parentElm.tagName.toLowerCase() === 'body') break;
|
489 |
+
|
490 |
+
var zIndex = _getPropValue(parentElm, 'z-index');
|
491 |
+
if(/[0-9]+/.test(zIndex)) {
|
492 |
+
parentElm.className += ' introjs-fixParent';
|
493 |
+
}
|
494 |
+
parentElm = parentElm.parentNode;
|
495 |
+
}
|
496 |
+
|
497 |
+
if (!_elementInViewport(targetElement.element)) {
|
498 |
+
var rect = targetElement.element.getBoundingClientRect(),
|
499 |
+
top = rect.bottom - (rect.bottom - rect.top),
|
500 |
+
bottom = rect.bottom - _getWinSize().height;
|
501 |
+
|
502 |
+
// Scroll up
|
503 |
+
if (top < 0) {
|
504 |
+
window.scrollBy(0, top - 30); // 30px padding from edge to look nice
|
505 |
+
|
506 |
+
// Scroll down
|
507 |
+
} else {
|
508 |
+
window.scrollBy(0, bottom + 100); // 70px + 30px padding from edge to look nice
|
509 |
+
}
|
510 |
+
}
|
511 |
+
}
|
512 |
+
|
513 |
+
/**
|
514 |
+
* Get an element CSS property on the page
|
515 |
+
* Thanks to JavaScript Kit: http://www.javascriptkit.com/dhtmltutors/dhtmlcascade4.shtml
|
516 |
+
*
|
517 |
+
* @api private
|
518 |
+
* @method _getPropValue
|
519 |
+
* @param {Object} element
|
520 |
+
* @param {String} propName
|
521 |
+
* @returns Element's property value
|
522 |
+
*/
|
523 |
+
function _getPropValue (element, propName) {
|
524 |
+
var propValue = '';
|
525 |
+
if (element.currentStyle) { //IE
|
526 |
+
propValue = element.currentStyle[propName];
|
527 |
+
} else if (document.defaultView && document.defaultView.getComputedStyle) { //Others
|
528 |
+
propValue = document.defaultView.getComputedStyle(element, null).getPropertyValue(propName);
|
529 |
+
}
|
530 |
+
|
531 |
+
//Prevent exception in IE
|
532 |
+
if(propValue.toLowerCase) {
|
533 |
+
return propValue.toLowerCase();
|
534 |
+
} else {
|
535 |
+
return propValue;
|
536 |
+
}
|
537 |
+
}
|
538 |
+
|
539 |
+
/**
|
540 |
+
* Provides a cross-browser way to get the screen dimensions
|
541 |
+
* via: http://stackoverflow.com/questions/5864467/internet-explorer-innerheight
|
542 |
+
*
|
543 |
+
* @api private
|
544 |
+
* @method _getWinSize
|
545 |
+
* @returns {Object} width and height attributes
|
546 |
+
*/
|
547 |
+
function _getWinSize() {
|
548 |
+
if (window.innerWidth != undefined) {
|
549 |
+
return { width: window.innerWidth, height: window.innerHeight };
|
550 |
+
} else {
|
551 |
+
var D = document.documentElement;
|
552 |
+
return { width: D.clientWidth, height: D.clientHeight };
|
553 |
+
}
|
554 |
+
}
|
555 |
+
|
556 |
+
/**
|
557 |
+
* Add overlay layer to the page
|
558 |
+
* http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport
|
559 |
+
*
|
560 |
+
* @api private
|
561 |
+
* @method _elementInViewport
|
562 |
+
* @param {Object} el
|
563 |
+
*/
|
564 |
+
function _elementInViewport(el) {
|
565 |
+
var rect = el.getBoundingClientRect();
|
566 |
+
|
567 |
+
return (
|
568 |
+
rect.top >= 0 &&
|
569 |
+
rect.left >= 0 &&
|
570 |
+
(rect.bottom+80) <= window.innerHeight && // add 80 to get the text right
|
571 |
+
rect.right <= window.innerWidth
|
572 |
+
);
|
573 |
+
}
|
574 |
+
|
575 |
+
/**
|
576 |
+
* Add overlay layer to the page
|
577 |
+
*
|
578 |
+
* @api private
|
579 |
+
* @method _addOverlayLayer
|
580 |
+
* @param {Object} targetElm
|
581 |
+
*/
|
582 |
+
function _addOverlayLayer(targetElm) {
|
583 |
+
var overlayLayer = document.createElement('div'),
|
584 |
+
styleText = '',
|
585 |
+
self = this;
|
586 |
+
|
587 |
+
//set css class name
|
588 |
+
overlayLayer.className = 'introjs-overlay';
|
589 |
+
|
590 |
+
//check if the target element is body, we should calculate the size of overlay layer in a better way
|
591 |
+
if (targetElm.tagName.toLowerCase() === 'body') {
|
592 |
+
styleText += 'top: 0;bottom: 0; left: 0;right: 0;position: fixed;';
|
593 |
+
overlayLayer.setAttribute('style', styleText);
|
594 |
+
} else {
|
595 |
+
//set overlay layer position
|
596 |
+
var elementPosition = _getOffset(targetElm);
|
597 |
+
if(elementPosition) {
|
598 |
+
styleText += 'width: ' + elementPosition.width + 'px; height:' + elementPosition.height + 'px; top:' + elementPosition.top + 'px;left: ' + elementPosition.left + 'px;';
|
599 |
+
overlayLayer.setAttribute('style', styleText);
|
600 |
+
}
|
601 |
+
}
|
602 |
+
|
603 |
+
targetElm.appendChild(overlayLayer);
|
604 |
+
|
605 |
+
overlayLayer.onclick = function() {
|
606 |
+
if(self._options.exitOnOverlayClick == true) {
|
607 |
+
_exitIntro.call(self, targetElm);
|
608 |
+
}
|
609 |
+
//check if any callback is defined
|
610 |
+
if (self._introExitCallback != undefined) {
|
611 |
+
self._introExitCallback.call(self);
|
612 |
+
}
|
613 |
+
};
|
614 |
+
|
615 |
+
setTimeout(function() {
|
616 |
+
styleText += 'opacity: .8;';
|
617 |
+
overlayLayer.setAttribute('style', styleText);
|
618 |
+
}, 10);
|
619 |
+
return true;
|
620 |
+
}
|
621 |
+
|
622 |
+
/**
|
623 |
+
* Get an element position on the page
|
624 |
+
* Thanks to `meouw`: http://stackoverflow.com/a/442474/375966
|
625 |
+
*
|
626 |
+
* @api private
|
627 |
+
* @method _getOffset
|
628 |
+
* @param {Object} element
|
629 |
+
* @returns Element's position info
|
630 |
+
*/
|
631 |
+
function _getOffset(element) {
|
632 |
+
var elementPosition = {};
|
633 |
+
|
634 |
+
//set width
|
635 |
+
elementPosition.width = element.offsetWidth;
|
636 |
+
|
637 |
+
//set height
|
638 |
+
elementPosition.height = element.offsetHeight;
|
639 |
+
|
640 |
+
//calculate element top and left
|
641 |
+
var _x = 0;
|
642 |
+
var _y = 0;
|
643 |
+
while(element && !isNaN(element.offsetLeft) && !isNaN(element.offsetTop)) {
|
644 |
+
_x += element.offsetLeft;
|
645 |
+
_y += element.offsetTop;
|
646 |
+
element = element.offsetParent;
|
647 |
+
}
|
648 |
+
//set top
|
649 |
+
elementPosition.top = _y;
|
650 |
+
//set left
|
651 |
+
elementPosition.left = _x;
|
652 |
+
|
653 |
+
return elementPosition;
|
654 |
+
}
|
655 |
+
|
656 |
+
/**
|
657 |
+
* Overwrites obj1's values with obj2's and adds obj2's if non existent in obj1
|
658 |
+
* via: http://stackoverflow.com/questions/171251/how-can-i-merge-properties-of-two-javascript-objects-dynamically
|
659 |
+
*
|
660 |
+
* @param obj1
|
661 |
+
* @param obj2
|
662 |
+
* @returns obj3 a new object based on obj1 and obj2
|
663 |
+
*/
|
664 |
+
function _mergeOptions(obj1,obj2) {
|
665 |
+
var obj3 = {};
|
666 |
+
for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }
|
667 |
+
for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }
|
668 |
+
return obj3;
|
669 |
+
}
|
670 |
+
|
671 |
+
var introJs = function (targetElm) {
|
672 |
+
if (typeof (targetElm) === 'object') {
|
673 |
+
//Ok, create a new instance
|
674 |
+
return new IntroJs(targetElm);
|
675 |
+
|
676 |
+
} else if (typeof (targetElm) === 'string') {
|
677 |
+
//select the target element with query selector
|
678 |
+
var targetElement = document.querySelector(targetElm);
|
679 |
+
|
680 |
+
if (targetElement) {
|
681 |
+
return new IntroJs(targetElement);
|
682 |
+
} else {
|
683 |
+
throw new Error('There is no element with given selector.');
|
684 |
+
}
|
685 |
+
} else {
|
686 |
+
return new IntroJs(document.body);
|
687 |
+
}
|
688 |
+
};
|
689 |
+
|
690 |
+
/**
|
691 |
+
* Current IntroJs version
|
692 |
+
*
|
693 |
+
* @property version
|
694 |
+
* @type String
|
695 |
+
*/
|
696 |
+
introJs.version = VERSION;
|
697 |
+
|
698 |
+
//Prototype
|
699 |
+
introJs.fn = IntroJs.prototype = {
|
700 |
+
clone: function () {
|
701 |
+
return new IntroJs(this);
|
702 |
+
},
|
703 |
+
setOption: function(option, value) {
|
704 |
+
this._options[option] = value;
|
705 |
+
return this;
|
706 |
+
},
|
707 |
+
setOptions: function(options) {
|
708 |
+
this._options = _mergeOptions(this._options, options);
|
709 |
+
return this;
|
710 |
+
},
|
711 |
+
start: function () {
|
712 |
+
_introForElement.call(this, this._targetElement);
|
713 |
+
return this;
|
714 |
+
},
|
715 |
+
goToStep: function(step) {
|
716 |
+
_goToStep.call(this, step);
|
717 |
+
return this;
|
718 |
+
},
|
719 |
+
exit: function() {
|
720 |
+
_exitIntro.call(this, this._targetElement);
|
721 |
+
},
|
722 |
+
onbeforechange: function(providedCallback) {
|
723 |
+
if (typeof (providedCallback) === 'function') {
|
724 |
+
this._introBeforeChangeCallback = providedCallback;
|
725 |
+
} else {
|
726 |
+
throw new Error('Provided callback for onbeforechange was not a function');
|
727 |
+
}
|
728 |
+
return this;
|
729 |
+
},
|
730 |
+
onchange: function(providedCallback) {
|
731 |
+
if (typeof (providedCallback) === 'function') {
|
732 |
+
this._introChangeCallback = providedCallback;
|
733 |
+
} else {
|
734 |
+
throw new Error('Provided callback for onchange was not a function.');
|
735 |
+
}
|
736 |
+
return this;
|
737 |
+
},
|
738 |
+
oncomplete: function(providedCallback) {
|
739 |
+
if (typeof (providedCallback) === 'function') {
|
740 |
+
this._introCompleteCallback = providedCallback;
|
741 |
+
} else {
|
742 |
+
throw new Error('Provided callback for oncomplete was not a function.');
|
743 |
+
}
|
744 |
+
return this;
|
745 |
+
},
|
746 |
+
onexit: function(providedCallback) {
|
747 |
+
if (typeof (providedCallback) === 'function') {
|
748 |
+
this._introExitCallback = providedCallback;
|
749 |
+
} else {
|
750 |
+
throw new Error('Provided callback for onexit was not a function.');
|
751 |
+
}
|
752 |
+
return this;
|
753 |
+
}
|
754 |
+
};
|
755 |
+
|
756 |
+
exports.introJs = introJs;
|
757 |
+
return introJs;
|
758 |
+
}));
|
js/jquery.bindfirst.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
-
jQuery.fn.bindFirst = function(name, fn) {
|
2 |
-
// bind as you normally would
|
3 |
-
// don't want to miss out on any jQuery magic
|
4 |
-
this.on(name, fn);
|
5 |
-
|
6 |
-
// Thanks to a comment by @Martin, adding support for
|
7 |
-
// namespaced events too.
|
8 |
-
this.each(function() {
|
9 |
-
var handlers = jQuery._data(this, 'events')[name.split('.')[0]];
|
10 |
-
// take out the handler we just inserted from the end
|
11 |
-
var handler = handlers.pop();
|
12 |
-
// move it at the beginning
|
13 |
-
handlers.splice(0, 0, handler);
|
14 |
-
});
|
15 |
};
|
1 |
+
jQuery.fn.bindFirst = function(name, fn) {
|
2 |
+
// bind as you normally would
|
3 |
+
// don't want to miss out on any jQuery magic
|
4 |
+
this.on(name, fn);
|
5 |
+
|
6 |
+
// Thanks to a comment by @Martin, adding support for
|
7 |
+
// namespaced events too.
|
8 |
+
this.each(function() {
|
9 |
+
var handlers = jQuery._data(this, 'events')[name.split('.')[0]];
|
10 |
+
// take out the handler we just inserted from the end
|
11 |
+
var handler = handlers.pop();
|
12 |
+
// move it at the beginning
|
13 |
+
handlers.splice(0, 0, handler);
|
14 |
+
});
|
15 |
};
|
js/jquery.easing.min.js
CHANGED
@@ -1,44 +1,44 @@
|
|
1 |
-
/*
|
2 |
-
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
3 |
-
*
|
4 |
-
* Uses the built in easing capabilities added In jQuery 1.1
|
5 |
-
* to offer multiple easing options
|
6 |
-
*
|
7 |
-
* TERMS OF USE - EASING EQUATIONS
|
8 |
-
*
|
9 |
-
* Open source under the BSD License.
|
10 |
-
*
|
11 |
-
* Copyright © 2001 Robert Penner
|
12 |
-
* All rights reserved.
|
13 |
-
*
|
14 |
-
* TERMS OF USE - jQuery Easing
|
15 |
-
*
|
16 |
-
* Open source under the BSD License.
|
17 |
-
*
|
18 |
-
* Copyright © 2008 George McGinley Smith
|
19 |
-
* All rights reserved.
|
20 |
-
*
|
21 |
-
* Redistribution and use in source and binary forms, with or without modification,
|
22 |
-
* are permitted provided that the following conditions are met:
|
23 |
-
*
|
24 |
-
* Redistributions of source code must retain the above copyright notice, this list of
|
25 |
-
* conditions and the following disclaimer.
|
26 |
-
* Redistributions in binary form must reproduce the above copyright notice, this list
|
27 |
-
* of conditions and the following disclaimer in the documentation and/or other materials
|
28 |
-
* provided with the distribution.
|
29 |
-
*
|
30 |
-
* Neither the name of the author nor the names of contributors may be used to endorse
|
31 |
-
* or promote products derived from this software without specific prior written permission.
|
32 |
-
*
|
33 |
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
34 |
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
35 |
-
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
36 |
-
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
37 |
-
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
38 |
-
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
39 |
-
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
40 |
-
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
41 |
-
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
42 |
-
*
|
43 |
-
*/
|
44 |
-
jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});
|
1 |
+
/*
|
2 |
+
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
3 |
+
*
|
4 |
+
* Uses the built in easing capabilities added In jQuery 1.1
|
5 |
+
* to offer multiple easing options
|
6 |
+
*
|
7 |
+
* TERMS OF USE - EASING EQUATIONS
|
8 |
+
*
|
9 |
+
* Open source under the BSD License.
|
10 |
+
*
|
11 |
+
* Copyright © 2001 Robert Penner
|
12 |
+
* All rights reserved.
|
13 |
+
*
|
14 |
+
* TERMS OF USE - jQuery Easing
|
15 |
+
*
|
16 |
+
* Open source under the BSD License.
|
17 |
+
*
|
18 |
+
* Copyright © 2008 George McGinley Smith
|
19 |
+
* All rights reserved.
|
20 |
+
*
|
21 |
+
* Redistribution and use in source and binary forms, with or without modification,
|
22 |
+
* are permitted provided that the following conditions are met:
|
23 |
+
*
|
24 |
+
* Redistributions of source code must retain the above copyright notice, this list of
|
25 |
+
* conditions and the following disclaimer.
|
26 |
+
* Redistributions in binary form must reproduce the above copyright notice, this list
|
27 |
+
* of conditions and the following disclaimer in the documentation and/or other materials
|
28 |
+
* provided with the distribution.
|
29 |
+
*
|
30 |
+
* Neither the name of the author nor the names of contributors may be used to endorse
|
31 |
+
* or promote products derived from this software without specific prior written permission.
|
32 |
+
*
|
33 |
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
34 |
+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
35 |
+
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
36 |
+
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
37 |
+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
38 |
+
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
39 |
+
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
40 |
+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
41 |
+
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
42 |
+
*
|
43 |
+
*/
|
44 |
+
jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});
|
js/jquery.total-storage.min.js
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
-
/*
|
2 |
-
* TotalStorage
|
3 |
-
*
|
4 |
-
* Copyright (c) 2012 Jared Novack & Upstatement (upstatement.com)
|
5 |
-
* Dual licensed under the MIT and GPL licenses:
|
6 |
-
* http://www.opensource.org/licenses/mit-license.php
|
7 |
-
* http://www.gnu.org/licenses/gpl.html
|
8 |
-
*
|
9 |
-
* Total Storage is the conceptual the love child of jStorage by Andris Reinman,
|
10 |
-
* and Cookie by Klaus Hartl -- though this is not connected to either project.
|
11 |
-
*
|
12 |
-
* @name $.totalStorage
|
13 |
-
* @cat Plugins/Cookie
|
14 |
-
* @author Jared Novack/jared@upstatement.com
|
15 |
-
* @version 1.1.2
|
16 |
-
* @url http://upstatement.com/blog/2012/01/jquery-local-storage-done-right-and-easy/
|
17 |
-
*/
|
18 |
-
|
19 |
-
(function(c,h){var e,d;if("localStorage"in window)try{d="undefined"===typeof window.localStorage?h:window.localStorage,e="undefined"==typeof d||"undefined"==typeof window.JSON?!1:!0}catch(j){e=!1}c.totalStorage=function(b,a){return c.totalStorage.impl.init(b,a)};c.totalStorage.setItem=function(b,a){return c.totalStorage.impl.setItem(b,a)};c.totalStorage.getItem=function(b){return c.totalStorage.impl.getItem(b)};c.totalStorage.getAll=function(){return c.totalStorage.impl.getAll()};c.totalStorage.deleteItem=
|
20 |
-
function(b){return c.totalStorage.impl.deleteItem(b)};c.totalStorage.impl={init:function(b,a){return"undefined"!=typeof a?this.setItem(b,a):this.getItem(b)},setItem:function(b,a){if(!e)try{return c.cookie(b,a),a}catch(g){console.log("Local Storage not supported by this browser. Install the cookie plugin on your site to take advantage of the same functionality. You can get it at https://github.com/carhartl/jquery-cookie")}var f=JSON.stringify(a);d.setItem(b,f);return this.parseResult(f)},getItem:function(b){if(!e)try{return this.parseResult(c.cookie(b))}catch(a){return null}b=
|
21 |
-
d.getItem(b);return this.parseResult(b)},deleteItem:function(b){if(!e)try{return c.cookie(b,null),!0}catch(a){return!1}d.removeItem(b);return!0},getAll:function(){var b=[];if(e)for(var a in d)a.length&&b.push({key:a,value:this.parseResult(d.getItem(a))});else try{var g=document.cookie.split(";");for(a=0;a<g.length;a++){var f=g[a].split("=")[0];b.push({key:f,value:this.parseResult(c.cookie(f))})}}catch(h){return null}return b},parseResult:function(b){var a;try{a=JSON.parse(b),"undefined"==typeof a&&
|
22 |
(a=b),"true"==a&&(a=!0),"false"==a&&(a=!1),parseFloat(a)==a&&"object"!=typeof a&&(a=parseFloat(a))}catch(c){a=b}return a}}})(jQuery);
|
1 |
+
/*
|
2 |
+
* TotalStorage
|
3 |
+
*
|
4 |
+
* Copyright (c) 2012 Jared Novack & Upstatement (upstatement.com)
|
5 |
+
* Dual licensed under the MIT and GPL licenses:
|
6 |
+
* http://www.opensource.org/licenses/mit-license.php
|
7 |
+
* http://www.gnu.org/licenses/gpl.html
|
8 |
+
*
|
9 |
+
* Total Storage is the conceptual the love child of jStorage by Andris Reinman,
|
10 |
+
* and Cookie by Klaus Hartl -- though this is not connected to either project.
|
11 |
+
*
|
12 |
+
* @name $.totalStorage
|
13 |
+
* @cat Plugins/Cookie
|
14 |
+
* @author Jared Novack/jared@upstatement.com
|
15 |
+
* @version 1.1.2
|
16 |
+
* @url http://upstatement.com/blog/2012/01/jquery-local-storage-done-right-and-easy/
|
17 |
+
*/
|
18 |
+
|
19 |
+
(function(c,h){var e,d;if("localStorage"in window)try{d="undefined"===typeof window.localStorage?h:window.localStorage,e="undefined"==typeof d||"undefined"==typeof window.JSON?!1:!0}catch(j){e=!1}c.totalStorage=function(b,a){return c.totalStorage.impl.init(b,a)};c.totalStorage.setItem=function(b,a){return c.totalStorage.impl.setItem(b,a)};c.totalStorage.getItem=function(b){return c.totalStorage.impl.getItem(b)};c.totalStorage.getAll=function(){return c.totalStorage.impl.getAll()};c.totalStorage.deleteItem=
|
20 |
+
function(b){return c.totalStorage.impl.deleteItem(b)};c.totalStorage.impl={init:function(b,a){return"undefined"!=typeof a?this.setItem(b,a):this.getItem(b)},setItem:function(b,a){if(!e)try{return c.cookie(b,a),a}catch(g){console.log("Local Storage not supported by this browser. Install the cookie plugin on your site to take advantage of the same functionality. You can get it at https://github.com/carhartl/jquery-cookie")}var f=JSON.stringify(a);d.setItem(b,f);return this.parseResult(f)},getItem:function(b){if(!e)try{return this.parseResult(c.cookie(b))}catch(a){return null}b=
|
21 |
+
d.getItem(b);return this.parseResult(b)},deleteItem:function(b){if(!e)try{return c.cookie(b,null),!0}catch(a){return!1}d.removeItem(b);return!0},getAll:function(){var b=[];if(e)for(var a in d)a.length&&b.push({key:a,value:this.parseResult(d.getItem(a))});else try{var g=document.cookie.split(";");for(a=0;a<g.length;a++){var f=g[a].split("=")[0];b.push({key:f,value:this.parseResult(c.cookie(f))})}}catch(h){return null}return b},parseResult:function(b){var a;try{a=JSON.parse(b),"undefined"==typeof a&&
|
22 |
(a=b),"true"==a&&(a=!0),"false"==a&&(a=!1),parseFloat(a)==a&&"object"!=typeof a&&(a=parseFloat(a))}catch(c){a=b}return a}}})(jQuery);
|
js/libraries/isotope/css/style.css
CHANGED
@@ -1,752 +1,752 @@
|
|
1 |
-
|
2 |
-
/**** Isotope Filtering ****/
|
3 |
-
|
4 |
-
.isotope-item {
|
5 |
-
z-index: 2;
|
6 |
-
}
|
7 |
-
|
8 |
-
.isotope-hidden.isotope-item {
|
9 |
-
pointer-events: none;
|
10 |
-
z-index: 1;
|
11 |
-
}
|
12 |
-
|
13 |
-
/**** Isotope CSS3 transitions ****/
|
14 |
-
|
15 |
-
.isotope,
|
16 |
-
.isotope .isotope-item {
|
17 |
-
-webkit-transition-duration: 0.8s;
|
18 |
-
-moz-transition-duration: 0.8s;
|
19 |
-
-ms-transition-duration: 0.8s;
|
20 |
-
-o-transition-duration: 0.8s;
|
21 |
-
transition-duration: 0.8s;
|
22 |
-
}
|
23 |
-
|
24 |
-
.isotope {
|
25 |
-
-webkit-transition-property: height, width;
|
26 |
-
-moz-transition-property: height, width;
|
27 |
-
-ms-transition-property: height, width;
|
28 |
-
-o-transition-property: height, width;
|
29 |
-
transition-property: height, width;
|
30 |
-
}
|
31 |
-
|
32 |
-
.isotope .isotope-item {
|
33 |
-
-webkit-transition-property: -webkit-transform, opacity;
|
34 |
-
-moz-transition-property: -moz-transform, opacity;
|
35 |
-
-ms-transition-property: -ms-transform, opacity;
|
36 |
-
-o-transition-property: -o-transform, opacity;
|
37 |
-
transition-property: transform, opacity;
|
38 |
-
}
|
39 |
-
|
40 |
-
/**** disabling Isotope CSS3 transitions ****/
|
41 |
-
|
42 |
-
.isotope.no-transition,
|
43 |
-
.isotope.no-transition .isotope-item,
|
44 |
-
.isotope .isotope-item.no-transition {
|
45 |
-
-webkit-transition-duration: 0s;
|
46 |
-
-moz-transition-duration: 0s;
|
47 |
-
-ms-transition-duration: 0s;
|
48 |
-
-o-transition-duration: 0s;
|
49 |
-
transition-duration: 0s;
|
50 |
-
}
|
51 |
-
|
52 |
-
/* End: Recommended Isotope styles */
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
/* disable CSS transitions for containers with infinite scrolling*/
|
57 |
-
.isotope.infinite-scrolling {
|
58 |
-
-webkit-transition: none;
|
59 |
-
-moz-transition: none;
|
60 |
-
-ms-transition: none;
|
61 |
-
-o-transition: none;
|
62 |
-
transition: none;
|
63 |
-
}
|
64 |
-
|
65 |
-
|
66 |
-
/**** Base styles ****/
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
#container {
|
71 |
-
border: 1px solid #666;
|
72 |
-
padding: 5px;
|
73 |
-
margin-bottom: 20px;
|
74 |
-
}
|
75 |
-
|
76 |
-
.element {
|
77 |
-
width: 110px;
|
78 |
-
height: 110px;
|
79 |
-
margin: 5px;
|
80 |
-
float: left;
|
81 |
-
overflow: hidden;
|
82 |
-
position: relative;
|
83 |
-
background: #888;
|
84 |
-
color: #222;
|
85 |
-
-webkit-border-top-right-radius: 1.2em;
|
86 |
-
-moz-border-radius-topright: 1.2em;
|
87 |
-
border-top-right-radius: 1.2em;
|
88 |
-
}
|
89 |
-
|
90 |
-
.element.alkali { background: #F00; background: hsl( 0, 100%, 50%); }
|
91 |
-
.element.alkaline-earth { background: #F80; background: hsl( 36, 100%, 50%); }
|
92 |
-
.element.lanthanoid { background: #FF0; background: hsl( 72, 100%, 50%); }
|
93 |
-
.element.actinoid { background: #0F0; background: hsl( 108, 100%, 50%); }
|
94 |
-
.element.transition { background: #0F8; background: hsl( 144, 100%, 50%); }
|
95 |
-
.element.post-transition { background: #0FF; background: hsl( 180, 100%, 50%); }
|
96 |
-
.element.metalloid { background: #08F; background: hsl( 216, 100%, 50%); }
|
97 |
-
.element.other.nonmetal { background: #00F; background: hsl( 252, 100%, 50%); }
|
98 |
-
.element.halogen { background: #F0F; background: hsl( 288, 100%, 50%); }
|
99 |
-
.element.noble-gas { background: #F08; background: hsl( 324, 100%, 50%); }
|
100 |
-
|
101 |
-
|
102 |
-
.element * {
|
103 |
-
position: absolute;
|
104 |
-
margin: 0;
|
105 |
-
}
|
106 |
-
|
107 |
-
.element .symbol {
|
108 |
-
left: 0.2em;
|
109 |
-
top: 0.4em;
|
110 |
-
font-size: 3.8em;
|
111 |
-
line-height: 1.0em;
|
112 |
-
color: #FFF;
|
113 |
-
}
|
114 |
-
.element.large .symbol {
|
115 |
-
font-size: 4.5em;
|
116 |
-
}
|
117 |
-
|
118 |
-
.element.fake .symbol {
|
119 |
-
color: #000;
|
120 |
-
}
|
121 |
-
|
122 |
-
.element .name {
|
123 |
-
left: 0.5em;
|
124 |
-
bottom: 1.6em;
|
125 |
-
font-size: 1.05em;
|
126 |
-
}
|
127 |
-
|
128 |
-
.element .weight {
|
129 |
-
font-size: 0.9em;
|
130 |
-
left: 0.5em;
|
131 |
-
bottom: 0.5em;
|
132 |
-
}
|
133 |
-
|
134 |
-
.element .number {
|
135 |
-
font-size: 1.25em;
|
136 |
-
font-weight: bold;
|
137 |
-
color: hsla(0,0%,0%,.5);
|
138 |
-
right: 0.5em;
|
139 |
-
top: 0.5em;
|
140 |
-
}
|
141 |
-
|
142 |
-
.variable-sizes .element.width2 { width: 230px; }
|
143 |
-
|
144 |
-
.variable-sizes .element.height2 { height: 230px; }
|
145 |
-
|
146 |
-
.variable-sizes .element.width2.height2 {
|
147 |
-
font-size: 2.0em;
|
148 |
-
}
|
149 |
-
|
150 |
-
.element.large,
|
151 |
-
.variable-sizes .element.large,
|
152 |
-
.variable-sizes .element.large.width2.height2 {
|
153 |
-
font-size: 3.0em;
|
154 |
-
width: 350px;
|
155 |
-
height: 350px;
|
156 |
-
z-index: 100;
|
157 |
-
}
|
158 |
-
|
159 |
-
.clickable .element:hover {
|
160 |
-
cursor: pointer;
|
161 |
-
}
|
162 |
-
|
163 |
-
.clickable .element:hover h3 {
|
164 |
-
text-shadow:
|
165 |
-
0 0 10px white,
|
166 |
-
0 0 10px white
|
167 |
-
;
|
168 |
-
}
|
169 |
-
|
170 |
-
.clickable .element:hover h2 {
|
171 |
-
color: white;
|
172 |
-
}
|
173 |
-
|
174 |
-
/**** Example Options ****/
|
175 |
-
|
176 |
-
#options {
|
177 |
-
padding-bottom: 1.0em;
|
178 |
-
}
|
179 |
-
|
180 |
-
#options h3 {
|
181 |
-
margin-bottom: 0.2em;
|
182 |
-
font-size: 15px;
|
183 |
-
}
|
184 |
-
|
185 |
-
#options h4 {
|
186 |
-
font-weight: bold;
|
187 |
-
}
|
188 |
-
|
189 |
-
#options ul {
|
190 |
-
margin: 0;
|
191 |
-
list-style: none;
|
192 |
-
}
|
193 |
-
|
194 |
-
#options ul ul {
|
195 |
-
margin-left: 1.5em;
|
196 |
-
}
|
197 |
-
|
198 |
-
#options li {
|
199 |
-
float: left;
|
200 |
-
margin-bottom: 0.2em;
|
201 |
-
}
|
202 |
-
|
203 |
-
#options li a {
|
204 |
-
display: block;
|
205 |
-
padding: 0.4em 0.5em;
|
206 |
-
background-color: #DDD;
|
207 |
-
color: #222;
|
208 |
-
font-weight: bold;
|
209 |
-
text-shadow: 0 1px hsla( 0, 0%, 100%, 0.5 );
|
210 |
-
background-image: -webkit-linear-gradient( top, hsla( 0, 0%, 100%, 0.5 ), hsla( 0, 0%, 100%, 0.0 ) );
|
211 |
-
background-image: -moz-linear-gradient( top, hsla( 0, 0%, 100%, 0.5 ), hsla( 0, 0%, 100%, 0.0 ) );
|
212 |
-
background-image: -ms-linear-gradient( top, hsla( 0, 0%, 100%, 0.5 ), hsla( 0, 0%, 100%, 0.0 ) );
|
213 |
-
background-image: -o-linear-gradient( top, hsla( 0, 0%, 100%, 0.5 ), hsla( 0, 0%, 100%, 0.0 ) );
|
214 |
-
background-image: linear-gradient( top, hsla( 0, 0%, 100%, 0.5 ), hsla( 0, 0%, 100%, 0.0 ) );
|
215 |
-
}
|
216 |
-
|
217 |
-
#options li a:hover {
|
218 |
-
background-color: #5BF;
|
219 |
-
}
|
220 |
-
|
221 |
-
#options li a:active {
|
222 |
-
background-color: #39D;
|
223 |
-
-webkit-box-shadow: inset 0 2px 8px hsla( 0, 0%, 0%, 0.6 );
|
224 |
-
-moz-box-shadow: inset 0 2px 8px hsla( 0, 0%, 0%, 0.6 );
|
225 |
-
-o-box-shadow: inset 0 2px 8px hsla( 0, 0%, 0%, 0.6 );
|
226 |
-
box-shadow: inset 0 2px 8px hsla( 0, 0%, 0%, 0.6 );
|
227 |
-
}
|
228 |
-
|
229 |
-
#options li a {
|
230 |
-
border-left: 1px solid hsla( 0, 0%, 100%, 0.3 );
|
231 |
-
border-right: 1px solid hsla( 0, 0%, 0%, 0.2 );
|
232 |
-
}
|
233 |
-
|
234 |
-
#options li:first-child a {
|
235 |
-
border-radius: 7px 0 0 7px;
|
236 |
-
border-left: none;
|
237 |
-
}
|
238 |
-
|
239 |
-
#options li:last-child a {
|
240 |
-
border-radius: 0 7px 7px 0;
|
241 |
-
}
|
242 |
-
|
243 |
-
#options li a.selected {
|
244 |
-
background-color: #13F;
|
245 |
-
text-shadow: none;
|
246 |
-
color: white;
|
247 |
-
}
|
248 |
-
|
249 |
-
/* Combination filter options*/
|
250 |
-
|
251 |
-
#options .option-combo {
|
252 |
-
display: inline-block;
|
253 |
-
float: left;
|
254 |
-
margin-right: 10px;
|
255 |
-
}
|
256 |
-
|
257 |
-
#options .option-combo ul {
|
258 |
-
margin-right: 20px;
|
259 |
-
display: inline-block;
|
260 |
-
}
|
261 |
-
|
262 |
-
#options .option-combo h2,
|
263 |
-
#options .option-combo h4 {
|
264 |
-
line-height: 34px;
|
265 |
-
margin-bottom: 0;
|
266 |
-
margin-right: 5px;
|
267 |
-
display: inline-block;
|
268 |
-
vertical-align: top;
|
269 |
-
}
|
270 |
-
|
271 |
-
/* Color shapes */
|
272 |
-
|
273 |
-
.color-shape {
|
274 |
-
width: 70px;
|
275 |
-
height: 70px;
|
276 |
-
margin: 5px;
|
277 |
-
float: left;
|
278 |
-
}
|
279 |
-
|
280 |
-
.color-shape.round {
|
281 |
-
-webkit-border-radius: 35px;
|
282 |
-
-moz-border-radius: 35px;
|
283 |
-
border-radius: 35px;
|
284 |
-
}
|
285 |
-
|
286 |
-
.color-shape.big.round {
|
287 |
-
-webkit-border-radius: 75px;
|
288 |
-
-moz-border-radius: 75px;
|
289 |
-
border-radius: 75px;
|
290 |
-
}
|
291 |
-
|
292 |
-
.color-shape.red { background: red; }
|
293 |
-
.color-shape.blue { background: blue; }
|
294 |
-
.color-shape.yellow { background: yellow; }
|
295 |
-
|
296 |
-
.color-shape.wide, .color-shape.big { width: 150px; }
|
297 |
-
.color-shape.tall, .color-shape.big { height: 150px; }
|
298 |
-
|
299 |
-
.color-shape a {
|
300 |
-
display: block;
|
301 |
-
height: 100%;
|
302 |
-
}
|
303 |
-
|
304 |
-
.color-shape a:hover {
|
305 |
-
background: white;
|
306 |
-
background: hsla( 0, 0%, 100%, 0.5 );
|
307 |
-
}
|
308 |
-
|
309 |
-
/**** Horizontal ****/
|
310 |
-
|
311 |
-
.horizontal #container {
|
312 |
-
height: 80%;
|
313 |
-
}
|
314 |
-
|
315 |
-
#copy {
|
316 |
-
max-width: 640px;
|
317 |
-
}
|
318 |
-
|
319 |
-
/**** Photo demo ****/
|
320 |
-
|
321 |
-
.photos .photo {
|
322 |
-
width: 320px;
|
323 |
-
margin: 5px;
|
324 |
-
float: left;
|
325 |
-
}
|
326 |
-
|
327 |
-
.photos .photo img {
|
328 |
-
display: block;
|
329 |
-
width: 100%;
|
330 |
-
}
|
331 |
-
|
332 |
-
|
333 |
-
.demos #content {
|
334 |
-
height: 100%;
|
335 |
-
}
|
336 |
-
|
337 |
-
/**** Docs ****/
|
338 |
-
|
339 |
-
.docs #content {
|
340 |
-
max-width: 640px;
|
341 |
-
}
|
342 |
-
|
343 |
-
.docs #content a:hover {
|
344 |
-
border-bottom: 1px dotted;
|
345 |
-
}
|
346 |
-
|
347 |
-
/**** Doc page nav ****/
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
#site-nav {
|
352 |
-
width: 200px;
|
353 |
-
position: absolute;
|
354 |
-
left: 10px;
|
355 |
-
top: 0px;
|
356 |
-
padding-top: 20px;
|
357 |
-
font-size: 12px;
|
358 |
-
}
|
359 |
-
|
360 |
-
#site-nav h1 {
|
361 |
-
font-size: 24px;
|
362 |
-
margin-bottom: 0.5em;
|
363 |
-
margin-top: 0;
|
364 |
-
font-weight: bold;
|
365 |
-
font-family: 'Helvetica Neue', Arial, sans-serif;
|
366 |
-
}
|
367 |
-
|
368 |
-
#site-nav h2 {
|
369 |
-
font-size: 17px;
|
370 |
-
font-weight: normal;
|
371 |
-
margin: 0 0 0.3em;
|
372 |
-
border-top: none;
|
373 |
-
}
|
374 |
-
|
375 |
-
#site-nav h1 a { color: #4FB; }
|
376 |
-
#site-nav h1 a:hover { color: #4BF; }
|
377 |
-
|
378 |
-
#site-nav ul {
|
379 |
-
list-style: none;
|
380 |
-
margin: 0 0 1.0em;
|
381 |
-
font-weight: bold;
|
382 |
-
}
|
383 |
-
|
384 |
-
#site-nav ul ul { margin-bottom: 0; }
|
385 |
-
|
386 |
-
#site-nav ul a {
|
387 |
-
display: block;
|
388 |
-
border: none;
|
389 |
-
padding: 1px 5px;
|
390 |
-
}
|
391 |
-
|
392 |
-
#site-nav ul .current a {
|
393 |
-
background: hsla( 0, 0%, 0%, 0.3 );
|
394 |
-
color: #1BF;
|
395 |
-
}
|
396 |
-
#site-nav ul a:hover,
|
397 |
-
#site-nav ul .current a:hover { color: white; }
|
398 |
-
|
399 |
-
#site-nav ul .current .toc a {
|
400 |
-
font-size: 12px;
|
401 |
-
padding-left: 1.2em;
|
402 |
-
font-weight: normal;
|
403 |
-
}
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
footer {
|
409 |
-
font-size: 12px;
|
410 |
-
font-style: italic;
|
411 |
-
border-top: 1px solid #333;
|
412 |
-
padding: 0.8em 0;
|
413 |
-
}
|
414 |
-
|
415 |
-
pre {
|
416 |
-
padding: 10px;
|
417 |
-
}
|
418 |
-
|
419 |
-
pre, code {
|
420 |
-
background: black;
|
421 |
-
color: white;
|
422 |
-
font-family: 'Monaco', monospace, sans-serif;
|
423 |
-
}
|
424 |
-
|
425 |
-
#content code {
|
426 |
-
font-size: 12px;
|
427 |
-
}
|
428 |
-
|
429 |
-
#content pre {
|
430 |
-
line-height: 1.6em;
|
431 |
-
}
|
432 |
-
|
433 |
-
h3#options {
|
434 |
-
padding-bottom: 0;
|
435 |
-
}
|
436 |
-
|
437 |
-
.option-def dl dt,
|
438 |
-
.option-def dl dd {
|
439 |
-
float: left;
|
440 |
-
padding: 0 1.2em;;
|
441 |
-
background: #161616;
|
442 |
-
line-height: 36px;
|
443 |
-
height: 36px;
|
444 |
-
}
|
445 |
-
|
446 |
-
.option-def dl.header dt,
|
447 |
-
.option-def dl.header dd {
|
448 |
-
background: #444;
|
449 |
-
}
|
450 |
-
|
451 |
-
.option-def dl .option-type {
|
452 |
-
font-size: 13px;
|
453 |
-
color: #AAA;
|
454 |
-
font-style: italic;
|
455 |
-
}
|
456 |
-
|
457 |
-
.option-def dl dd {
|
458 |
-
border-left: 1px solid #222;
|
459 |
-
}
|
460 |
-
|
461 |
-
/* Tagline */
|
462 |
-
|
463 |
-
.docs .tagline {
|
464 |
-
font-size: 22px;
|
465 |
-
font-weight: 300;
|
466 |
-
}
|
467 |
-
|
468 |
-
/* as-is from MIT */
|
469 |
-
|
470 |
-
.docs .as-is {
|
471 |
-
font-size: 95%;
|
472 |
-
}
|
473 |
-
|
474 |
-
/* Commercial license blurb */
|
475 |
-
|
476 |
-
.docs #commercial {
|
477 |
-
background: white;
|
478 |
-
padding: 10px;
|
479 |
-
font-size: 14px;
|
480 |
-
color: #1F1F1D;
|
481 |
-
}
|
482 |
-
|
483 |
-
.docs #commercial a { font-weight: bold;}
|
484 |
-
|
485 |
-
/**** Pygments ****/
|
486 |
-
|
487 |
-
code .s1,
|
488 |
-
code .s { color: #78BD55; } /* string */
|
489 |
-
code .mi, /* integer */
|
490 |
-
code .cp, /* doctype */
|
491 |
-
code .kc { color: #5298D4; } /*boolean*/
|
492 |
-
code .k { color: #E39B79; } /* keyword */
|
493 |
-
code .kd, /* storage */
|
494 |
-
code .na { color: #A9D866; } /* markup attribute */
|
495 |
-
code .p { color: #EDB; } /* punctuation */
|
496 |
-
code .o { color: #F63; } /* operator */
|
497 |
-
code .nb { color: #AA97AC;} /* support */
|
498 |
-
|
499 |
-
/* comment */
|
500 |
-
code .c,
|
501 |
-
code .c1 { color: #666; font-style: italic; }
|
502 |
-
|
503 |
-
code .nt { color: #A0C8FC; } /* Markup open tag */
|
504 |
-
|
505 |
-
code .nf { color: #9EA8B8; } /* css id */
|
506 |
-
code .nc { color: #A78352; } /* CSS class */
|
507 |
-
code .m { color: #DE8E50; } /* CSS value */
|
508 |
-
code .nd { color: #9FAD7E; } /* CSS pseudo selector */
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
/**** Super list ****/
|
513 |
-
|
514 |
-
|
515 |
-
/**** Sites using Isotope ****/
|
516 |
-
|
517 |
-
#sites h2 {
|
518 |
-
display: none;
|
519 |
-
padding: 0.4em;
|
520 |
-
line-height: 32px;
|
521 |
-
margin-bottom: 0.4em;
|
522 |
-
-webkit-transition: background-color 0.8s;
|
523 |
-
-moz-transition: background-color 0.8s;
|
524 |
-
-o-transition: background-color 0.8s;
|
525 |
-
transition: background-color 0.8s;
|
526 |
-
}
|
527 |
-
|
528 |
-
#sites h2 img {
|
529 |
-
display: inline-block;
|
530 |
-
margin-right: 0.4em;
|
531 |
-
vertical-align: bottom;
|
532 |
-
}
|
533 |
-
|
534 |
-
#sites h2.loading {
|
535 |
-
background: white;
|
536 |
-
color: #222;
|
537 |
-
}
|
538 |
-
#sites h2.error {
|
539 |
-
background: red;
|
540 |
-
color: #222;
|
541 |
-
}
|
542 |
-
|
543 |
-
|
544 |
-
#sites ul {
|
545 |
-
margin: 0;
|
546 |
-
}
|
547 |
-
|
548 |
-
.super-list .example {
|
549 |
-
list-style: none;
|
550 |
-
float: left;
|
551 |
-
width: 230px;
|
552 |
-
margin: 5px;
|
553 |
-
}
|
554 |
-
|
555 |
-
.super-list .example a,
|
556 |
-
.super-list .example b,
|
557 |
-
.super-list .example img {
|
558 |
-
display: block;
|
559 |
-
}
|
560 |
-
|
561 |
-
.super-list .example img { width: 100%; }
|
562 |
-
|
563 |
-
.super-list .example a {
|
564 |
-
background: #1F1E1D;
|
565 |
-
}
|
566 |
-
|
567 |
-
.super-list .example a:hover {
|
568 |
-
background: white;
|
569 |
-
color: #111;
|
570 |
-
}
|
571 |
-
|
572 |
-
.super-list .example b {
|
573 |
-
font-weight: bold;
|
574 |
-
line-height: 1.3em;
|
575 |
-
padding: 3px;
|
576 |
-
padding-top: 8px;
|
577 |
-
}
|
578 |
-
|
579 |
-
.super-list .link {
|
580 |
-
float: left;
|
581 |
-
position: relative;
|
582 |
-
font-size: 24px;
|
583 |
-
line-height: 1.2em;
|
584 |
-
font-weight: 300;
|
585 |
-
margin: 5px;
|
586 |
-
}
|
587 |
-
|
588 |
-
.super-list .link {
|
589 |
-
width: 230px;
|
590 |
-
height: 110px;
|
591 |
-
}
|
592 |
-
|
593 |
-
.super-list .link a {
|
594 |
-
display: block;
|
595 |
-
padding: 10px;
|
596 |
-
padding-left: 65px;
|
597 |
-
height: 90px;
|
598 |
-
background: #1F1E1D;
|
599 |
-
color: #FE5;
|
600 |
-
-webkit-border-radius: 14px;
|
601 |
-
-moz-border-radius: 14px;
|
602 |
-
border-radius: 14px;
|
603 |
-
}
|
604 |
-
|
605 |
-
.super-list .link a:before {
|
606 |
-
content: '➔';
|
607 |
-
font-size: 70px;
|
608 |
-
position: absolute;
|
609 |
-
top: 30px;
|
610 |
-
left: 5px;
|
611 |
-
-webkit-transform: rotate(90deg);
|
612 |
-
-moz-transform: rotate(90deg);
|
613 |
-
-ms-transform: rotate(90deg);
|
614 |
-
-o-transform: rotate(90deg);
|
615 |
-
transform: rotate(90deg);
|
616 |
-
}
|
617 |
-
|
618 |
-
.super-list .link.away a:before {
|
619 |
-
top: 25px;
|
620 |
-
left: 0px;
|
621 |
-
-webkit-transform: rotate(-45deg);
|
622 |
-
-moz-transform: rotate(-45deg);
|
623 |
-
-ms-transform: rotate(-45deg);
|
624 |
-
-o-transform: rotate(-45deg);
|
625 |
-
transform: rotate(-45deg);
|
626 |
-
}
|
627 |
-
|
628 |
-
.super-list .link a:hover {
|
629 |
-
background: #E58;
|
630 |
-
color: white;
|
631 |
-
}
|
632 |
-
|
633 |
-
.super-list .feature .name {
|
634 |
-
bottom: auto;
|
635 |
-
top: 140px;
|
636 |
-
left: 18px;
|
637 |
-
font-size: 20px;
|
638 |
-
}
|
639 |
-
|
640 |
-
/**** BIG Graph ****/
|
641 |
-
|
642 |
-
.big-graph {
|
643 |
-
background: white;
|
644 |
-
height: 600px;
|
645 |
-
margin: 20px auto;
|
646 |
-
}
|
647 |
-
|
648 |
-
.big-graph .project {
|
649 |
-
width: 45px;
|
650 |
-
height: 45px;
|
651 |
-
float: left;
|
652 |
-
}
|
653 |
-
|
654 |
-
.big-graph .project .icon {
|
655 |
-
pointer-events: none;
|
656 |
-
width: 31px;
|
657 |
-
height: 31px;
|
658 |
-
background: white;
|
659 |
-
margin-left: 7px;
|
660 |
-
-webkit-transition: -webkit-transform 0.25s;
|
661 |
-
-moz-transition: -moz-transform 0.25s;
|
662 |
-
-ms-transition: -ms-transform 0.25s;
|
663 |
-
-o-transition: -o-transform 0.25s;
|
664 |
-
transition: transform 0.25s;
|
665 |
-
}
|
666 |
-
|
667 |
-
.big-graph .project:hover {
|
668 |
-
z-index: 5;
|
669 |
-
|
670 |
-
}
|
671 |
-
|
672 |
-
.big-graph .project:hover .icon {
|
673 |
-
-webkit-transform: scale(3);
|
674 |
-
-moz-transform: scale(3);
|
675 |
-
-ms-transform: scale(3);
|
676 |
-
-o-transform: scale(3);
|
677 |
-
transform: scale(3);
|
678 |
-
}
|
679 |
-
|
680 |
-
.big-graph .project.commercial .icon { background: #6B6B6B; }
|
681 |
-
.big-graph .project.urbanism .icon { background: #00CF00; }
|
682 |
-
.big-graph .project.public-space .icon { background: #FF8D00; }
|
683 |
-
.big-graph .project.culture .icon { background: #D61919; }
|
684 |
-
.big-graph .project.body-culture .icon { background: #00ECFF; }
|
685 |
-
.big-graph .project.health .icon { background: #FF2251; }
|
686 |
-
.big-graph .project.education .icon { background: #00A700; }
|
687 |
-
.big-graph .project.housing .icon { background: #FF02FF; }
|
688 |
-
.big-graph .project.hotel .icon { background: #0000C3; }
|
689 |
-
.big-graph .project.media .icon { background: #292929; }
|
690 |
-
|
691 |
-
.big-graph .project p {
|
692 |
-
line-height: 14px;
|
693 |
-
font-size: 10.5px;
|
694 |
-
color: black;
|
695 |
-
margin-left: 7px;
|
696 |
-
}
|
697 |
-
|
698 |
-
/**** Infinite Scroll ****/
|
699 |
-
|
700 |
-
#infscr-loading {
|
701 |
-
position: fixed;
|
702 |
-
text-align: center;
|
703 |
-
bottom: 30px;
|
704 |
-
left: 42%;
|
705 |
-
z-index: 100;
|
706 |
-
background: white;
|
707 |
-
background: hsla( 0, 0%, 100%, 0.9 );
|
708 |
-
padding: 20px;
|
709 |
-
color: #222;
|
710 |
-
font-size: 15px;
|
711 |
-
font-weight: bold;
|
712 |
-
-webkit-border-radius: 10px;
|
713 |
-
-moz-border-radius: 10px;
|
714 |
-
border-radius: 10px;
|
715 |
-
}
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
/* The Magnificent Clearfix: nicolasgallagher.com/micro-clearfix-hack/ */
|
720 |
-
.clearfix:before, .clearfix:after { content: ""; display: table; }
|
721 |
-
.clearfix:after { clear: both; }
|
722 |
-
.clearfix { zoom: 1; }
|
723 |
-
|
724 |
-
.template-thumbnail
|
725 |
-
{
|
726 |
-
width:100%;
|
727 |
-
height:160px;
|
728 |
-
-webkit-border-radius: 4px;
|
729 |
-
-khtml-border-radius: 4px;
|
730 |
-
-moz-border-radius: 4px;
|
731 |
-
border-radius: 4px;
|
732 |
-
background-color: #A9A9A9;
|
733 |
-
-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px,rgba(0, 0, 0, 0.3) 0 2px 5px;
|
734 |
-
-moz-box-shadow: rgba(0,0,0,0.2) 0 0 0 1px,rgba(0,0,0,0.3) 0 2px 5px;
|
735 |
-
box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px,rgba(0, 0, 0, 0.3) 0 2px 5px;
|
736 |
-
}
|
737 |
-
|
738 |
-
ul#template-filter{ margin: 0px 0; padding: 0;
|
739 |
-
ul#template-filter li{ display: inline; }
|
740 |
-
ul#template-filter a{ margin-right: 0.5em; padding: 0em 1em; font-weight: bold; text-decoration: none; }
|
741 |
-
ul#template-filter .button-primary a:hover { color:#fff;}
|
742 |
-
ul#template-filter a.current{ background-color: #DDD; }
|
743 |
-
|
744 |
-
#template-item{ float: left; margin-right: 18px; overflow: hidden; margin: 0px 0 0 0; padding: 0; list-style: none; width: 225px; margin-bottom: 10px; }
|
745 |
-
#template-item div{ display: block; }
|
746 |
-
/* #template-item div a{ display: block; width: 163px; height: 120px; overflow: hidden; border: 1px solid #CDCDCD; background: #eee; }*/
|
747 |
-
#template-item li p{ font-size: 11px; line-height: 15px; color: #AAA; margin: 5px 0; }
|
748 |
-
#template-box .lp_tooltip_templates{
|
749 |
-
bottom: 6px;
|
750 |
-
position: absolute;
|
751 |
-
right: 8px;
|
752 |
-
}
|
1 |
+
|
2 |
+
/**** Isotope Filtering ****/
|
3 |
+
|
4 |
+
.isotope-item {
|
5 |
+
z-index: 2;
|
6 |
+
}
|
7 |
+
|
8 |
+
.isotope-hidden.isotope-item {
|
9 |
+
pointer-events: none;
|
10 |
+
z-index: 1;
|
11 |
+
}
|
12 |
+
|
13 |
+
/**** Isotope CSS3 transitions ****/
|
14 |
+
|
15 |
+
.isotope,
|
16 |
+
.isotope .isotope-item {
|
17 |
+
-webkit-transition-duration: 0.8s;
|
18 |
+
-moz-transition-duration: 0.8s;
|
19 |
+
-ms-transition-duration: 0.8s;
|
20 |
+
-o-transition-duration: 0.8s;
|
21 |
+
transition-duration: 0.8s;
|
22 |
+
}
|
23 |
+
|
24 |
+
.isotope {
|
25 |
+
-webkit-transition-property: height, width;
|
26 |
+
-moz-transition-property: height, width;
|
27 |
+
-ms-transition-property: height, width;
|
28 |
+
-o-transition-property: height, width;
|
29 |
+
transition-property: height, width;
|
30 |
+
}
|
31 |
+
|
32 |
+
.isotope .isotope-item {
|
33 |
+
-webkit-transition-property: -webkit-transform, opacity;
|
34 |
+
-moz-transition-property: -moz-transform, opacity;
|
35 |
+
-ms-transition-property: -ms-transform, opacity;
|
36 |
+
-o-transition-property: -o-transform, opacity;
|
37 |
+
transition-property: transform, opacity;
|
38 |
+
}
|
39 |
+
|
40 |
+
/**** disabling Isotope CSS3 transitions ****/
|
41 |
+
|
42 |
+
.isotope.no-transition,
|
43 |
+
.isotope.no-transition .isotope-item,
|
44 |
+
.isotope .isotope-item.no-transition {
|
45 |
+
-webkit-transition-duration: 0s;
|
46 |
+
-moz-transition-duration: 0s;
|
47 |
+
-ms-transition-duration: 0s;
|
48 |
+
-o-transition-duration: 0s;
|
49 |
+
transition-duration: 0s;
|
50 |
+
}
|
51 |
+
|
52 |
+
/* End: Recommended Isotope styles */
|
53 |
+
|
54 |
+
|
55 |
+
|
56 |
+
/* disable CSS transitions for containers with infinite scrolling*/
|
57 |
+
.isotope.infinite-scrolling {
|
58 |
+
-webkit-transition: none;
|
59 |
+
-moz-transition: none;
|
60 |
+
-ms-transition: none;
|
61 |
+
-o-transition: none;
|
62 |
+
transition: none;
|
63 |
+
}
|
64 |
+
|
65 |
+
|
66 |
+
/**** Base styles ****/
|
67 |
+
|
68 |
+
|
69 |
+
|
70 |
+
#container {
|
71 |
+
border: 1px solid #666;
|
72 |
+
padding: 5px;
|
73 |
+
margin-bottom: 20px;
|
74 |
+
}
|
75 |
+
|
76 |
+
.element {
|
77 |
+
width: 110px;
|
78 |
+
height: 110px;
|
79 |
+
margin: 5px;
|
80 |
+
float: left;
|
81 |
+
overflow: hidden;
|
82 |
+
position: relative;
|
83 |
+
background: #888;
|
84 |
+
color: #222;
|
85 |
+
-webkit-border-top-right-radius: 1.2em;
|
86 |
+
-moz-border-radius-topright: 1.2em;
|
87 |
+
border-top-right-radius: 1.2em;
|
88 |
+
}
|
89 |
+
|
90 |
+
.element.alkali { background: #F00; background: hsl( 0, 100%, 50%); }
|
91 |
+
.element.alkaline-earth { background: #F80; background: hsl( 36, 100%, 50%); }
|
92 |
+
.element.lanthanoid { background: #FF0; background: hsl( 72, 100%, 50%); }
|
93 |
+
.element.actinoid { background: #0F0; background: hsl( 108, 100%, 50%); }
|
94 |
+
.element.transition { background: #0F8; background: hsl( 144, 100%, 50%); }
|
95 |
+
.element.post-transition { background: #0FF; background: hsl( 180, 100%, 50%); }
|
96 |
+
.element.metalloid { background: #08F; background: hsl( 216, 100%, 50%); }
|
97 |
+
.element.other.nonmetal { background: #00F; background: hsl( 252, 100%, 50%); }
|
98 |
+
.element.halogen { background: #F0F; background: hsl( 288, 100%, 50%); }
|
99 |
+
.element.noble-gas { background: #F08; background: hsl( 324, 100%, 50%); }
|
100 |
+
|
101 |
+
|
102 |
+
.element * {
|
103 |
+
position: absolute;
|
104 |
+
margin: 0;
|
105 |
+
}
|
106 |
+
|
107 |
+
.element .symbol {
|
108 |
+
left: 0.2em;
|
109 |
+
top: 0.4em;
|
110 |
+
font-size: 3.8em;
|
111 |
+
line-height: 1.0em;
|
112 |
+
color: #FFF;
|
113 |
+
}
|
114 |
+
.element.large .symbol {
|
115 |
+
font-size: 4.5em;
|
116 |
+
}
|
117 |
+
|
118 |
+
.element.fake .symbol {
|
119 |
+
color: #000;
|
120 |
+
}
|
121 |
+
|
122 |
+
.element .name {
|
123 |
+
left: 0.5em;
|
124 |
+
bottom: 1.6em;
|
125 |
+
font-size: 1.05em;
|
126 |
+
}
|
127 |
+
|
128 |
+
.element .weight {
|
129 |
+
font-size: 0.9em;
|
130 |
+
left: 0.5em;
|
131 |
+
bottom: 0.5em;
|
132 |
+
}
|
133 |
+
|
134 |
+
.element .number {
|
135 |
+
font-size: 1.25em;
|
136 |
+
font-weight: bold;
|
137 |
+
color: hsla(0,0%,0%,.5);
|
138 |
+
right: 0.5em;
|
139 |
+
top: 0.5em;
|
140 |
+
}
|
141 |
+
|
142 |
+
.variable-sizes .element.width2 { width: 230px; }
|
143 |
+
|
144 |
+
.variable-sizes .element.height2 { height: 230px; }
|
145 |
+
|
146 |
+
.variable-sizes .element.width2.height2 {
|
147 |
+
font-size: 2.0em;
|
148 |
+
}
|
149 |
+
|
150 |
+
.element.large,
|
151 |
+
.variable-sizes .element.large,
|
152 |
+
.variable-sizes .element.large.width2.height2 {
|
153 |
+
font-size: 3.0em;
|
154 |
+
width: 350px;
|
155 |
+
height: 350px;
|
156 |
+
z-index: 100;
|
157 |
+
}
|
158 |
+
|
159 |
+
.clickable .element:hover {
|
160 |
+
cursor: pointer;
|
161 |
+
}
|
162 |
+
|
163 |
+
.clickable .element:hover h3 {
|
164 |
+
text-shadow:
|
165 |
+
0 0 10px white,
|
166 |
+
0 0 10px white
|
167 |
+
;
|
168 |
+
}
|
169 |
+
|
170 |
+
.clickable .element:hover h2 {
|
171 |
+
color: white;
|
172 |
+
}
|
173 |
+
|
174 |
+
/**** Example Options ****/
|
175 |
+
|
176 |
+
#options {
|
177 |
+
padding-bottom: 1.0em;
|
178 |
+
}
|
179 |
+
|
180 |
+
#options h3 {
|
181 |
+
margin-bottom: 0.2em;
|
182 |
+
font-size: 15px;
|
183 |
+
}
|
184 |
+
|
185 |
+
#options h4 {
|
186 |
+
font-weight: bold;
|
187 |
+
}
|
188 |
+
|
189 |
+
#options ul {
|
190 |
+
margin: 0;
|
191 |
+
list-style: none;
|
192 |
+
}
|
193 |
+
|
194 |
+
#options ul ul {
|
195 |
+
margin-left: 1.5em;
|
196 |
+
}
|
197 |
+
|
198 |
+
#options li {
|
199 |
+
float: left;
|
200 |
+
margin-bottom: 0.2em;
|
201 |
+
}
|
202 |
+
|
203 |
+
#options li a {
|
204 |
+
display: block;
|
205 |
+
padding: 0.4em 0.5em;
|
206 |
+
background-color: #DDD;
|
207 |
+
color: #222;
|
208 |
+
font-weight: bold;
|
209 |
+
text-shadow: 0 1px hsla( 0, 0%, 100%, 0.5 );
|
210 |
+
background-image: -webkit-linear-gradient( top, hsla( 0, 0%, 100%, 0.5 ), hsla( 0, 0%, 100%, 0.0 ) );
|
211 |
+
background-image: -moz-linear-gradient( top, hsla( 0, 0%, 100%, 0.5 ), hsla( 0, 0%, 100%, 0.0 ) );
|
212 |
+
background-image: -ms-linear-gradient( top, hsla( 0, 0%, 100%, 0.5 ), hsla( 0, 0%, 100%, 0.0 ) );
|
213 |
+
background-image: -o-linear-gradient( top, hsla( 0, 0%, 100%, 0.5 ), hsla( 0, 0%, 100%, 0.0 ) );
|
214 |
+
background-image: linear-gradient( top, hsla( 0, 0%, 100%, 0.5 ), hsla( 0, 0%, 100%, 0.0 ) );
|
215 |
+
}
|
216 |
+
|
217 |
+
#options li a:hover {
|
218 |
+
background-color: #5BF;
|
219 |
+
}
|
220 |
+
|
221 |
+
#options li a:active {
|
222 |
+
background-color: #39D;
|
223 |
+
-webkit-box-shadow: inset 0 2px 8px hsla( 0, 0%, 0%, 0.6 );
|
224 |
+
-moz-box-shadow: inset 0 2px 8px hsla( 0, 0%, 0%, 0.6 );
|
225 |
+
-o-box-shadow: inset 0 2px 8px hsla( 0, 0%, 0%, 0.6 );
|
226 |
+
box-shadow: inset 0 2px 8px hsla( 0, 0%, 0%, 0.6 );
|
227 |
+
}
|
228 |
+
|
229 |
+
#options li a {
|
230 |
+
border-left: 1px solid hsla( 0, 0%, 100%, 0.3 );
|
231 |
+
border-right: 1px solid hsla( 0, 0%, 0%, 0.2 );
|
232 |
+
}
|
233 |
+
|
234 |
+
#options li:first-child a {
|
235 |
+
border-radius: 7px 0 0 7px;
|
236 |
+
border-left: none;
|
237 |
+
}
|
238 |
+
|
239 |
+
#options li:last-child a {
|
240 |
+
border-radius: 0 7px 7px 0;
|
241 |
+
}
|
242 |
+
|
243 |
+
#options li a.selected {
|
244 |
+
background-color: #13F;
|
245 |
+
text-shadow: none;
|
246 |
+
color: white;
|
247 |
+
}
|
248 |
+
|
249 |
+
/* Combination filter options*/
|
250 |
+
|
251 |
+
#options .option-combo {
|
252 |
+
display: inline-block;
|
253 |
+
float: left;
|
254 |
+
margin-right: 10px;
|
255 |
+
}
|
256 |
+
|
257 |
+
#options .option-combo ul {
|
258 |
+
margin-right: 20px;
|
259 |
+
display: inline-block;
|
260 |
+
}
|
261 |
+
|
262 |
+
#options .option-combo h2,
|
263 |
+
#options .option-combo h4 {
|
264 |
+
line-height: 34px;
|
265 |
+
margin-bottom: 0;
|
266 |
+
margin-right: 5px;
|
267 |
+
display: inline-block;
|
268 |
+
vertical-align: top;
|
269 |
+
}
|
270 |
+
|
271 |
+
/* Color shapes */
|
272 |
+
|
273 |
+
.color-shape {
|
274 |
+
width: 70px;
|
275 |
+
height: 70px;
|
276 |
+
margin: 5px;
|
277 |
+
float: left;
|
278 |
+
}
|
279 |
+
|
280 |
+
.color-shape.round {
|
281 |
+
-webkit-border-radius: 35px;
|
282 |
+
-moz-border-radius: 35px;
|
283 |
+
border-radius: 35px;
|
284 |
+
}
|
285 |
+
|
286 |
+
.color-shape.big.round {
|
287 |
+
-webkit-border-radius: 75px;
|
288 |
+
-moz-border-radius: 75px;
|
289 |
+
border-radius: 75px;
|
290 |
+
}
|
291 |
+
|
292 |
+
.color-shape.red { background: red; }
|
293 |
+
.color-shape.blue { background: blue; }
|
294 |
+
.color-shape.yellow { background: yellow; }
|
295 |
+
|
296 |
+
.color-shape.wide, .color-shape.big { width: 150px; }
|
297 |
+
.color-shape.tall, .color-shape.big { height: 150px; }
|
298 |
+
|
299 |
+
.color-shape a {
|
300 |
+
display: block;
|
301 |
+
height: 100%;
|
302 |
+
}
|
303 |
+
|
304 |
+
.color-shape a:hover {
|
305 |
+
background: white;
|
306 |
+
background: hsla( 0, 0%, 100%, 0.5 );
|
307 |
+
}
|
308 |
+
|
309 |
+
/**** Horizontal ****/
|
310 |
+
|
311 |
+
.horizontal #container {
|
312 |
+
height: 80%;
|
313 |
+
}
|
314 |
+
|
315 |
+
#copy {
|
316 |
+
max-width: 640px;
|
317 |
+
}
|
318 |
+
|
319 |
+
/**** Photo demo ****/
|
320 |
+
|
321 |
+
.photos .photo {
|
322 |
+
width: 320px;
|
323 |
+
margin: 5px;
|
324 |
+
float: left;
|
325 |
+
}
|
326 |
+
|
327 |
+
.photos .photo img {
|
328 |
+
display: block;
|
329 |
+
width: 100%;
|
330 |
+
}
|
331 |
+
|
332 |
+
|
333 |
+
.demos #content {
|
334 |
+
height: 100%;
|
335 |
+
}
|
336 |
+
|
337 |
+
/**** Docs ****/
|
338 |
+
|
339 |
+
.docs #content {
|
340 |
+
max-width: 640px;
|
341 |
+
}
|
342 |
+
|
343 |
+
.docs #content a:hover {
|
344 |
+
border-bottom: 1px dotted;
|
345 |
+
}
|
346 |
+
|
347 |
+
/**** Doc page nav ****/
|
348 |
+
|
349 |
+
|
350 |
+
|
351 |
+
#site-nav {
|
352 |
+
width: 200px;
|
353 |
+
position: absolute;
|
354 |
+
left: 10px;
|
355 |
+
top: 0px;
|
356 |
+
padding-top: 20px;
|
357 |
+
font-size: 12px;
|
358 |
+
}
|
359 |
+
|
360 |
+
#site-nav h1 {
|
361 |
+
font-size: 24px;
|
362 |
+
margin-bottom: 0.5em;
|
363 |
+
margin-top: 0;
|
364 |
+
font-weight: bold;
|
365 |
+
font-family: 'Helvetica Neue', Arial, sans-serif;
|
366 |
+
}
|
367 |
+
|
368 |
+
#site-nav h2 {
|
369 |
+
font-size: 17px;
|
370 |
+
font-weight: normal;
|
371 |
+
margin: 0 0 0.3em;
|
372 |
+
border-top: none;
|
373 |
+
}
|
374 |
+
|
375 |
+
#site-nav h1 a { color: #4FB; }
|
376 |
+
#site-nav h1 a:hover { color: #4BF; }
|
377 |
+
|
378 |
+
#site-nav ul {
|
379 |
+
list-style: none;
|
380 |
+
margin: 0 0 1.0em;
|
381 |
+
font-weight: bold;
|
382 |
+
}
|
383 |
+
|
384 |
+
#site-nav ul ul { margin-bottom: 0; }
|
385 |
+
|
386 |
+
#site-nav ul a {
|
387 |
+
display: block;
|
388 |
+
border: none;
|
389 |
+
padding: 1px 5px;
|
390 |
+
}
|
391 |
+
|
392 |
+
#site-nav ul .current a {
|
393 |
+
background: hsla( 0, 0%, 0%, 0.3 );
|
394 |
+
color: #1BF;
|
395 |
+
}
|
396 |
+
#site-nav ul a:hover,
|
397 |
+
#site-nav ul .current a:hover { color: white; }
|
398 |
+
|
399 |
+
#site-nav ul .current .toc a {
|
400 |
+
font-size: 12px;
|
401 |
+
padding-left: 1.2em;
|
402 |
+
font-weight: normal;
|
403 |
+
}
|
404 |
+
|
405 |
+
|
406 |
+
|
407 |
+
|
408 |
+
footer {
|
409 |
+
font-size: 12px;
|
410 |
+
font-style: italic;
|
411 |
+
border-top: 1px solid #333;
|
412 |
+
padding: 0.8em 0;
|
413 |
+
}
|
414 |
+
|
415 |
+
pre {
|
416 |
+
padding: 10px;
|
417 |
+
}
|
418 |
+
|
419 |
+
pre, code {
|
420 |
+
background: black;
|
421 |
+
color: white;
|
422 |
+
font-family: 'Monaco', monospace, sans-serif;
|
423 |
+
}
|
424 |
+
|
425 |
+
#content code {
|
426 |
+
font-size: 12px;
|
427 |
+
}
|
428 |
+
|
429 |
+
#content pre {
|
430 |
+
line-height: 1.6em;
|
431 |
+
}
|
432 |
+
|
433 |
+
h3#options {
|
434 |
+
padding-bottom: 0;
|
435 |
+
}
|
436 |
+
|
437 |
+
.option-def dl dt,
|
438 |
+
.option-def dl dd {
|
439 |
+
float: left;
|
440 |
+
padding: 0 1.2em;;
|
441 |
+
background: #161616;
|
442 |
+
line-height: 36px;
|
443 |
+
height: 36px;
|
444 |
+
}
|
445 |
+
|
446 |
+
.option-def dl.header dt,
|
447 |
+
.option-def dl.header dd {
|
448 |
+
background: #444;
|
449 |
+
}
|
450 |
+
|
451 |
+
.option-def dl .option-type {
|
452 |
+
font-size: 13px;
|
453 |
+
color: #AAA;
|
454 |
+
font-style: italic;
|
455 |
+
}
|
456 |
+
|
457 |
+
.option-def dl dd {
|
458 |
+
border-left: 1px solid #222;
|
459 |
+
}
|
460 |
+
|
461 |
+
/* Tagline */
|
462 |
+
|
463 |
+
.docs .tagline {
|
464 |
+
font-size: 22px;
|
465 |
+
font-weight: 300;
|
466 |
+
}
|
467 |
+
|
468 |
+
/* as-is from MIT */
|
469 |
+
|
470 |
+
.docs .as-is {
|
471 |
+
font-size: 95%;
|
472 |
+
}
|
473 |
+
|
474 |
+
/* Commercial license blurb */
|
475 |
+
|
476 |
+
.docs #commercial {
|
477 |
+
background: white;
|
478 |
+
padding: 10px;
|
479 |
+
font-size: 14px;
|
480 |
+
color: #1F1F1D;
|
481 |
+
}
|
482 |
+
|
483 |
+
.docs #commercial a { font-weight: bold;}
|
484 |
+
|
485 |
+
/**** Pygments ****/
|
486 |
+
|
487 |
+
code .s1,
|
488 |
+
code .s { color: #78BD55; } /* string */
|
489 |
+
code .mi, /* integer */
|
490 |
+
code .cp, /* doctype */
|
491 |
+
code .kc { color: #5298D4; } /*boolean*/
|
492 |
+
code .k { color: #E39B79; } /* keyword */
|
493 |
+
code .kd, /* storage */
|
494 |
+
code .na { color: #A9D866; } /* markup attribute */
|
495 |
+
code .p { color: #EDB; } /* punctuation */
|
496 |
+
code .o { color: #F63; } /* operator */
|
497 |
+
code .nb { color: #AA97AC;} /* support */
|
498 |
+
|
499 |
+
/* comment */
|
500 |
+
code .c,
|
501 |
+
code .c1 { color: #666; font-style: italic; }
|
502 |
+
|
503 |
+
code .nt { color: #A0C8FC; } /* Markup open tag */
|
504 |
+
|
505 |
+
code .nf { color: #9EA8B8; } /* css id */
|
506 |
+
code .nc { color: #A78352; } /* CSS class */
|
507 |
+
code .m { color: #DE8E50; } /* CSS value */
|
508 |
+
code .nd { color: #9FAD7E; } /* CSS pseudo selector */
|
509 |
+
|
510 |
+
|
511 |
+
|
512 |
+
/**** Super list ****/
|
513 |
+
|
514 |
+
|
515 |
+
/**** Sites using Isotope ****/
|
516 |
+
|
517 |
+
#sites h2 {
|
518 |
+
display: none;
|
519 |
+
padding: 0.4em;
|
520 |
+
line-height: 32px;
|
521 |
+
margin-bottom: 0.4em;
|
522 |
+
-webkit-transition: background-color 0.8s;
|
523 |
+
-moz-transition: background-color 0.8s;
|
524 |
+
-o-transition: background-color 0.8s;
|
525 |
+
transition: background-color 0.8s;
|
526 |
+
}
|
527 |
+
|
528 |
+
#sites h2 img {
|
529 |
+
display: inline-block;
|
530 |
+
margin-right: 0.4em;
|
531 |
+
vertical-align: bottom;
|
532 |
+
}
|
533 |
+
|
534 |
+
#sites h2.loading {
|
535 |
+
background: white;
|
536 |
+
color: #222;
|
537 |
+
}
|
538 |
+
#sites h2.error {
|
539 |
+
background: red;
|
540 |
+
color: #222;
|
541 |
+
}
|
542 |
+
|
543 |
+
|
544 |
+
#sites ul {
|
545 |
+
margin: 0;
|
546 |
+
}
|
547 |
+
|
548 |
+
.super-list .example {
|
549 |
+
list-style: none;
|
550 |
+
float: left;
|
551 |
+
width: 230px;
|
552 |
+
margin: 5px;
|
553 |
+
}
|
554 |
+
|
555 |
+
.super-list .example a,
|
556 |
+
.super-list .example b,
|
557 |
+
.super-list .example img {
|
558 |
+
display: block;
|
559 |
+
}
|
560 |
+
|
561 |
+
.super-list .example img { width: 100%; }
|
562 |
+
|
563 |
+
.super-list .example a {
|
564 |
+
background: #1F1E1D;
|
565 |
+
}
|
566 |
+
|
567 |
+
.super-list .example a:hover {
|
568 |
+
background: white;
|
569 |
+
color: #111;
|
570 |
+
}
|
571 |
+
|
572 |
+
.super-list .example b {
|
573 |
+
font-weight: bold;
|
574 |
+
line-height: 1.3em;
|
575 |
+
padding: 3px;
|
576 |
+
padding-top: 8px;
|
577 |
+
}
|
578 |
+
|
579 |
+
.super-list .link {
|
580 |
+
float: left;
|
581 |
+
position: relative;
|
582 |
+
font-size: 24px;
|
583 |
+
line-height: 1.2em;
|
584 |
+
font-weight: 300;
|
585 |
+
margin: 5px;
|
586 |
+
}
|
587 |
+
|
588 |
+
.super-list .link {
|
589 |
+
width: 230px;
|
590 |
+
height: 110px;
|
591 |
+
}
|
592 |
+
|
593 |
+
.super-list .link a {
|
594 |
+
display: block;
|
595 |
+
padding: 10px;
|
596 |
+
padding-left: 65px;
|
597 |
+
height: 90px;
|
598 |
+
background: #1F1E1D;
|
599 |
+
color: #FE5;
|
600 |
+
-webkit-border-radius: 14px;
|
601 |
+
-moz-border-radius: 14px;
|
602 |
+
border-radius: 14px;
|
603 |
+
}
|
604 |
+
|
605 |
+
.super-list .link a:before {
|
606 |
+
content: '➔';
|
607 |
+
font-size: 70px;
|
608 |
+
position: absolute;
|
609 |
+
top: 30px;
|
610 |
+
left: 5px;
|
611 |
+
-webkit-transform: rotate(90deg);
|
612 |
+
-moz-transform: rotate(90deg);
|
613 |
+
-ms-transform: rotate(90deg);
|
614 |
+
-o-transform: rotate(90deg);
|
615 |
+
transform: rotate(90deg);
|
616 |
+
}
|
617 |
+
|
618 |
+
.super-list .link.away a:before {
|
619 |
+
top: 25px;
|
620 |
+
left: 0px;
|
621 |
+
-webkit-transform: rotate(-45deg);
|
622 |
+
-moz-transform: rotate(-45deg);
|
623 |
+
-ms-transform: rotate(-45deg);
|
624 |
+
-o-transform: rotate(-45deg);
|
625 |
+
transform: rotate(-45deg);
|
626 |
+
}
|
627 |
+
|
628 |
+
.super-list .link a:hover {
|
629 |
+
background: #E58;
|
630 |
+
color: white;
|
631 |
+
}
|
632 |
+
|
633 |
+
.super-list .feature .name {
|
634 |
+
bottom: auto;
|
635 |
+
top: 140px;
|
636 |
+
left: 18px;
|
637 |
+
font-size: 20px;
|
638 |
+
}
|
639 |
+
|
640 |
+
/**** BIG Graph ****/
|
641 |
+
|
642 |
+
.big-graph {
|
643 |
+
background: white;
|
644 |
+
height: 600px;
|
645 |
+
margin: 20px auto;
|
646 |
+
}
|
647 |
+
|
648 |
+
.big-graph .project {
|
649 |
+
width: 45px;
|
650 |
+
height: 45px;
|
651 |
+
float: left;
|
652 |
+
}
|
653 |
+
|
654 |
+
.big-graph .project .icon {
|
655 |
+
pointer-events: none;
|
656 |
+
width: 31px;
|
657 |
+
height: 31px;
|
658 |
+
background: white;
|
659 |
+
margin-left: 7px;
|
660 |
+
-webkit-transition: -webkit-transform 0.25s;
|
661 |
+
-moz-transition: -moz-transform 0.25s;
|
662 |
+
-ms-transition: -ms-transform 0.25s;
|
663 |
+
-o-transition: -o-transform 0.25s;
|
664 |
+
transition: transform 0.25s;
|
665 |
+
}
|
666 |
+
|
667 |
+
.big-graph .project:hover {
|
668 |
+
z-index: 5;
|
669 |
+
|
670 |
+
}
|
671 |
+
|
672 |
+
.big-graph .project:hover .icon {
|
673 |
+
-webkit-transform: scale(3);
|
674 |
+
-moz-transform: scale(3);
|
675 |
+
-ms-transform: scale(3);
|
676 |
+
-o-transform: scale(3);
|
677 |
+
transform: scale(3);
|
678 |
+
}
|
679 |
+
|
680 |
+
.big-graph .project.commercial .icon { background: #6B6B6B; }
|
681 |
+
.big-graph .project.urbanism .icon { background: #00CF00; }
|
682 |
+
.big-graph .project.public-space .icon { background: #FF8D00; }
|
683 |
+
.big-graph .project.culture .icon { background: #D61919; }
|
684 |
+
.big-graph .project.body-culture .icon { background: #00ECFF; }
|
685 |
+
.big-graph .project.health .icon { background: #FF2251; }
|
686 |
+
.big-graph .project.education .icon { background: #00A700; }
|
687 |
+
.big-graph .project.housing .icon { background: #FF02FF; }
|
688 |
+
.big-graph .project.hotel .icon { background: #0000C3; }
|
689 |
+
.big-graph .project.media .icon { background: #292929; }
|
690 |
+
|
691 |
+
.big-graph .project p {
|
692 |
+
line-height: 14px;
|
693 |
+
font-size: 10.5px;
|
694 |
+
color: black;
|
695 |
+
margin-left: 7px;
|
696 |
+
}
|
697 |
+
|
698 |
+
/**** Infinite Scroll ****/
|
699 |
+
|
700 |
+
#infscr-loading {
|
701 |
+
position: fixed;
|
702 |
+
text-align: center;
|
703 |
+
bottom: 30px;
|
704 |
+
left: 42%;
|
705 |
+
z-index: 100;
|
706 |
+
background: white;
|
707 |
+
background: hsla( 0, 0%, 100%, 0.9 );
|
708 |
+
padding: 20px;
|
709 |
+
color: #222;
|
710 |
+
font-size: 15px;
|
711 |
+
font-weight: bold;
|
712 |
+
-webkit-border-radius: 10px;
|
713 |
+
-moz-border-radius: 10px;
|
714 |
+
border-radius: 10px;
|
715 |
+
}
|
716 |
+
|
717 |
+
|
718 |
+
|
719 |
+
/* The Magnificent Clearfix: nicolasgallagher.com/micro-clearfix-hack/ */
|
720 |
+
.clearfix:before, .clearfix:after { content: ""; display: table; }
|
721 |
+
.clearfix:after { clear: both; }
|
722 |
+
.clearfix { zoom: 1; }
|
723 |
+
|
724 |
+
.template-thumbnail
|
725 |
+
{
|
726 |
+
width:100%;
|
727 |
+
height:160px;
|
728 |
+
-webkit-border-radius: 4px;
|
729 |
+
-khtml-border-radius: 4px;
|
730 |
+
-moz-border-radius: 4px;
|
731 |
+
border-radius: 4px;
|
732 |
+
background-color: #A9A9A9;
|
733 |
+
-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px,rgba(0, 0, 0, 0.3) 0 2px 5px;
|
734 |
+
-moz-box-shadow: rgba(0,0,0,0.2) 0 0 0 1px,rgba(0,0,0,0.3) 0 2px 5px;
|
735 |
+
box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px,rgba(0, 0, 0, 0.3) 0 2px 5px;
|
736 |
+
}
|
737 |
+
|
738 |
+
ul#template-filter{ margin: 0px 0; padding: 0; padding-left: 0px; line-height: 64px; }
|
739 |
+
ul#template-filter li{ display: inline; }
|
740 |
+
ul#template-filter a{ margin-right: 0.5em; padding: 0em 1em; font-weight: bold; text-decoration: none; }
|
741 |
+
ul#template-filter .button-primary a:hover { color:#fff;}
|
742 |
+
ul#template-filter a.current{ background-color: #DDD; }
|
743 |
+
|
744 |
+
#template-item{ float: left; margin-right: 18px; overflow: hidden; margin: 0px 0 0 0; padding: 0; list-style: none; width: 225px; margin-bottom: 10px; }
|
745 |
+
#template-item div{ display: block; }
|
746 |
+
/* #template-item div a{ display: block; width: 163px; height: 120px; overflow: hidden; border: 1px solid #CDCDCD; background: #eee; }*/
|
747 |
+
#template-item li p{ font-size: 11px; line-height: 15px; color: #AAA; margin: 5px 0; }
|
748 |
+
#template-box .lp_tooltip_templates{
|
749 |
+
bottom: 6px;
|
750 |
+
position: absolute;
|
751 |
+
right: 8px;
|
752 |
+
}
|
js/libraries/isotope/jquery.isotope.js
CHANGED
@@ -1,1406 +1,1406 @@
|
|
1 |
-
/**
|
2 |
-
* Isotope v1.5.23
|
3 |
-
* An exquisite jQuery plugin for magical layouts
|
4 |
-
* http://isotope.metafizzy.co
|
5 |
-
*
|
6 |
-
* Commercial use requires one-time license fee
|
7 |
-
* http://metafizzy.co/#licenses
|
8 |
-
*
|
9 |
-
* Copyright 2012 David DeSandro / Metafizzy
|
10 |
-
*/
|
11 |
-
|
12 |
-
/*jshint asi: true, browser: true, curly: true, eqeqeq: true, forin: false, immed: false, newcap: true, noempty: true, strict: true, undef: true */
|
13 |
-
/*global jQuery: false */
|
14 |
-
|
15 |
-
(function( window, $, undefined ){
|
16 |
-
|
17 |
-
'use strict';
|
18 |
-
|
19 |
-
// get global vars
|
20 |
-
var document = window.document;
|
21 |
-
var Modernizr = window.Modernizr;
|
22 |
-
|
23 |
-
// helper function
|
24 |
-
var capitalize = function( str ) {
|
25 |
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
26 |
-
};
|
27 |
-
|
28 |
-
// ========================= getStyleProperty by kangax ===============================
|
29 |
-
// http://perfectionkills.com/feature-testing-css-properties/
|
30 |
-
|
31 |
-
var prefixes = 'Moz Webkit O Ms'.split(' ');
|
32 |
-
|
33 |
-
var getStyleProperty = function( propName ) {
|
34 |
-
var style = document.documentElement.style,
|
35 |
-
prefixed;
|
36 |
-
|
37 |
-
// test standard property first
|
38 |
-
if ( typeof style[propName] === 'string' ) {
|
39 |
-
return propName;
|
40 |
-
}
|
41 |
-
|
42 |
-
// capitalize
|
43 |
-
propName = capitalize( propName );
|
44 |
-
|
45 |
-
// test vendor specific properties
|
46 |
-
for ( var i=0, len = prefixes.length; i < len; i++ ) {
|
47 |
-
prefixed = prefixes[i] + propName;
|
48 |
-
if ( typeof style[ prefixed ] === 'string' ) {
|
49 |
-
return prefixed;
|
50 |
-
}
|
51 |
-
}
|
52 |
-
};
|
53 |
-
|
54 |
-
var transformProp = getStyleProperty('transform'),
|
55 |
-
transitionProp = getStyleProperty('transitionProperty');
|
56 |
-
|
57 |
-
|
58 |
-
// ========================= miniModernizr ===============================
|
59 |
-
// <3<3<3 and thanks to Faruk and Paul for doing the heavy lifting
|
60 |
-
|
61 |
-
/*!
|
62 |
-
* Modernizr v1.6ish: miniModernizr for Isotope
|
63 |
-
* http://www.modernizr.com
|
64 |
-
*
|
65 |
-
* Developed by:
|
66 |
-
* - Faruk Ates http://farukat.es/
|
67 |
-
* - Paul Irish http://paulirish.com/
|
68 |
-
*
|
69 |
-
* Copyright (c) 2009-2010
|
70 |
-
* Dual-licensed under the BSD or MIT licenses.
|
71 |
-
* http://www.modernizr.com/license/
|
72 |
-
*/
|
73 |
-
|
74 |
-
/*
|
75 |
-
* This version whittles down the script just to check support for
|
76 |
-
* CSS transitions, transforms, and 3D transforms.
|
77 |
-
*/
|
78 |
-
|
79 |
-
var tests = {
|
80 |
-
csstransforms: function() {
|
81 |
-
return !!transformProp;
|
82 |
-
},
|
83 |
-
|
84 |
-
csstransforms3d: function() {
|
85 |
-
var test = !!getStyleProperty('perspective');
|
86 |
-
// double check for Chrome's false positive
|
87 |
-
if ( test ) {
|
88 |
-
var vendorCSSPrefixes = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '),
|
89 |
-
mediaQuery = '@media (' + vendorCSSPrefixes.join('transform-3d),(') + 'modernizr)',
|
90 |
-
$style = $('<style>' + mediaQuery + '{#modernizr{height:3px}}' + '</style>')
|
91 |
-
.appendTo('head'),
|
92 |
-
$div = $('<div id="modernizr" />').appendTo('html');
|
93 |
-
|
94 |
-
test = $div.height() === 3;
|
95 |
-
|
96 |
-
$div.remove();
|
97 |
-
$style.remove();
|
98 |
-
}
|
99 |
-
return test;
|
100 |
-
},
|
101 |
-
|
102 |
-
csstransitions: function() {
|
103 |
-
return !!transitionProp;
|
104 |
-
}
|
105 |
-
};
|
106 |
-
|
107 |
-
var testName;
|
108 |
-
|
109 |
-
if ( Modernizr ) {
|
110 |
-
// if there's a previous Modernzir, check if there are necessary tests
|
111 |
-
for ( testName in tests) {
|
112 |
-
if ( !Modernizr.hasOwnProperty( testName ) ) {
|
113 |
-
// if test hasn't been run, use addTest to run it
|
114 |
-
Modernizr.addTest( testName, tests[ testName ] );
|
115 |
-
}
|
116 |
-
}
|
117 |
-
} else {
|
118 |
-
// or create new mini Modernizr that just has the 3 tests
|
119 |
-
Modernizr = window.Modernizr = {
|
120 |
-
_version : '1.6ish: miniModernizr for Isotope'
|
121 |
-
};
|
122 |
-
|
123 |
-
var classes = ' ';
|
124 |
-
var result;
|
125 |
-
|
126 |
-
// Run through tests
|
127 |
-
for ( testName in tests) {
|
128 |
-
result = tests[ testName ]();
|
129 |
-
Modernizr[ testName ] = result;
|
130 |
-
classes += ' ' + ( result ? '' : 'no-' ) + testName;
|
131 |
-
}
|
132 |
-
|
133 |
-
// Add the new classes to the <html> element.
|
134 |
-
$('html').addClass( classes );
|
135 |
-
}
|
136 |
-
|
137 |
-
|
138 |
-
// ========================= isoTransform ===============================
|
139 |
-
|
140 |
-
/**
|
141 |
-
* provides hooks for .css({ scale: value, translate: [x, y] })
|
142 |
-
* Progressively enhanced CSS transforms
|
143 |
-
* Uses hardware accelerated 3D transforms for Safari
|
144 |
-
* or falls back to 2D transforms.
|
145 |
-
*/
|
146 |
-
|
147 |
-
if ( Modernizr.csstransforms ) {
|
148 |
-
|
149 |
-
// i.e. transformFnNotations.scale(0.5) >> 'scale3d( 0.5, 0.5, 1)'
|
150 |
-
var transformFnNotations = Modernizr.csstransforms3d ?
|
151 |
-
{ // 3D transform functions
|
152 |
-
translate : function ( position ) {
|
153 |
-
return 'translate3d(' + position[0] + 'px, ' + position[1] + 'px, 0) ';
|
154 |
-
},
|
155 |
-
scale : function ( scale ) {
|
156 |
-
return 'scale3d(' + scale + ', ' + scale + ', 1) ';
|
157 |
-
}
|
158 |
-
} :
|
159 |
-
{ // 2D transform functions
|
160 |
-
translate : function ( position ) {
|
161 |
-
return 'translate(' + position[0] + 'px, ' + position[1] + 'px) ';
|
162 |
-
},
|
163 |
-
scale : function ( scale ) {
|
164 |
-
return 'scale(' + scale + ') ';
|
165 |
-
}
|
166 |
-
}
|
167 |
-
;
|
168 |
-
|
169 |
-
var setIsoTransform = function ( elem, name, value ) {
|
170 |
-
// unpack current transform data
|
171 |
-
var data = jQuery.data( elem, 'isoTransform' ) || {},
|
172 |
-
newData = {},
|
173 |
-
fnName,
|
174 |
-
transformObj = {},
|
175 |
-
transformValue;
|
176 |
-
|
177 |
-
// i.e. newData.scale = 0.5
|
178 |
-
newData[ name ] = value;
|
179 |
-
// extend new value over current data
|
180 |
-
jQuery.extend( data, newData );
|
181 |
-
|
182 |
-
for ( fnName in data ) {
|
183 |
-
transformValue = data[ fnName ];
|
184 |
-
transformObj[ fnName ] = transformFnNotations[ fnName ]( transformValue );
|
185 |
-
}
|
186 |
-
|
187 |
-
// get proper order
|
188 |
-
// ideally, we could loop through this give an array, but since we only have
|
189 |
-
// a couple transforms we're keeping track of, we'll do it like so
|
190 |
-
var translateFn = transformObj.translate || '',
|
191 |
-
scaleFn = transformObj.scale || '',
|
192 |
-
// sorting so translate always comes first
|
193 |
-
valueFns = translateFn + scaleFn;
|
194 |
-
|
195 |
-
// set data back in elem
|
196 |
-
jQuery.data( elem, 'isoTransform', data );
|
197 |
-
|
198 |
-
// set name to vendor specific property
|
199 |
-
elem.style[ transformProp ] = valueFns;
|
200 |
-
};
|
201 |
-
|
202 |
-
// ==================== scale ===================
|
203 |
-
|
204 |
-
jQuery.cssNumber.scale = true;
|
205 |
-
|
206 |
-
jQuery.cssHooks.scale = {
|
207 |
-
set: function( elem, value ) {
|
208 |
-
// uncomment this bit if you want to properly parse strings
|
209 |
-
// if ( typeof value === 'string' ) {
|
210 |
-
// value = parseFloat( value );
|
211 |
-
// }
|
212 |
-
setIsoTransform( elem, 'scale', value );
|
213 |
-
},
|
214 |
-
get: function( elem, computed ) {
|
215 |
-
var transform = jQuery.data( elem, 'isoTransform' );
|
216 |
-
return transform && transform.scale ? transform.scale : 1;
|
217 |
-
}
|
218 |
-
};
|
219 |
-
|
220 |
-
jQuery.fx.step.scale = function( fx ) {
|
221 |
-
jQuery.cssHooks.scale.set( fx.elem, fx.now+fx.unit );
|
222 |
-
};
|
223 |
-
|
224 |
-
|
225 |
-
// ==================== translate ===================
|
226 |
-
|
227 |
-
jQuery.cssNumber.translate = true;
|
228 |
-
|
229 |
-
jQuery.cssHooks.translate = {
|
230 |
-
set: function( elem, value ) {
|
231 |
-
|
232 |
-
// uncomment this bit if you want to properly parse strings
|
233 |
-
// if ( typeof value === 'string' ) {
|
234 |
-
// value = value.split(' ');
|
235 |
-
// }
|
236 |
-
//
|
237 |
-
// var i, val;
|
238 |
-
// for ( i = 0; i < 2; i++ ) {
|
239 |
-
// val = value[i];
|
240 |
-
// if ( typeof val === 'string' ) {
|
241 |
-
// val = parseInt( val );
|
242 |
-
// }
|
243 |
-
// }
|
244 |
-
|
245 |
-
setIsoTransform( elem, 'translate', value );
|
246 |
-
},
|
247 |
-
|
248 |
-
get: function( elem, computed ) {
|
249 |
-
var transform = jQuery.data( elem, 'isoTransform' );
|
250 |
-
return transform && transform.translate ? transform.translate : [ 0, 0 ];
|
251 |
-
}
|
252 |
-
};
|
253 |
-
|
254 |
-
}
|
255 |
-
|
256 |
-
// ========================= get transition-end event ===============================
|
257 |
-
var transitionEndEvent, transitionDurProp;
|
258 |
-
|
259 |
-
if ( Modernizr.csstransitions ) {
|
260 |
-
transitionEndEvent = {
|
261 |
-
WebkitTransitionProperty: 'webkitTransitionEnd', // webkit
|
262 |
-
MozTransitionProperty: 'transitionend',
|
263 |
-
OTransitionProperty: 'oTransitionEnd otransitionend',
|
264 |
-
transitionProperty: 'transitionend'
|
265 |
-
}[ transitionProp ];
|
266 |
-
|
267 |
-
transitionDurProp = getStyleProperty('transitionDuration');
|
268 |
-
}
|
269 |
-
|
270 |
-
// ========================= smartresize ===============================
|
271 |
-
|
272 |
-
/*
|
273 |
-
* smartresize: debounced resize event for jQuery
|
274 |
-
*
|
275 |
-
* latest version and complete README available on Github:
|
276 |
-
* https://github.com/louisremi/jquery.smartresize.js
|
277 |
-
*
|
278 |
-
* Copyright 2011 @louis_remi
|
279 |
-
* Licensed under the MIT license.
|
280 |
-
*/
|
281 |
-
|
282 |
-
var $event = jQuery.event,
|
283 |
-
resizeTimeout;
|
284 |
-
|
285 |
-
$event.special.smartresize = {
|
286 |
-
setup: function() {
|
287 |
-
$(this).bind( "resize", $event.special.smartresize.handler );
|
288 |
-
},
|
289 |
-
teardown: function() {
|
290 |
-
$(this).unbind( "resize", $event.special.smartresize.handler );
|
291 |
-
},
|
292 |
-
handler: function( event, execAsap ) {
|
293 |
-
// Save the context
|
294 |
-
var context = this,
|
295 |
-
args = arguments;
|
296 |
-
|
297 |
-
// set correct event type
|
298 |
-
event.type = "smartresize";
|
299 |
-
|
300 |
-
if ( resizeTimeout ) { clearTimeout( resizeTimeout ); }
|
301 |
-
resizeTimeout = setTimeout(function() {
|
302 |
-
jQuery.event.handle.apply( context, args );
|
303 |
-
}, execAsap === "execAsap"? 0 : 100 );
|
304 |
-
}
|
305 |
-
};
|
306 |
-
|
307 |
-
jQuery.fn.smartresize = function( fn ) {
|
308 |
-
return fn ? this.bind( "smartresize", fn ) : this.trigger( "smartresize", ["execAsap"] );
|
309 |
-
};
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
// ========================= Isotope ===============================
|
314 |
-
|
315 |
-
|
316 |
-
// our "Widget" object constructor
|
317 |
-
jQuery.Isotope = function( options, element, callback ){
|
318 |
-
this.element = $( element );
|
319 |
-
|
320 |
-
this._create( options );
|
321 |
-
this._init( callback );
|
322 |
-
};
|
323 |
-
|
324 |
-
// styles of container element we want to keep track of
|
325 |
-
var isoContainerStyles = [ 'width', 'height' ];
|
326 |
-
|
327 |
-
var $window = $(window);
|
328 |
-
|
329 |
-
jQuery.Isotope.settings = {
|
330 |
-
resizable: true,
|
331 |
-
layoutMode : 'masonry',
|
332 |
-
containerClass : 'isotope',
|
333 |
-
itemClass : 'isotope-item',
|
334 |
-
hiddenClass : 'isotope-hidden',
|
335 |
-
hiddenStyle: { opacity: 0, scale: 0.001 },
|
336 |
-
visibleStyle: { opacity: 1, scale: 1 },
|
337 |
-
containerStyle: {
|
338 |
-
position: 'relative',
|
339 |
-
overflow: 'hidden'
|
340 |
-
},
|
341 |
-
animationEngine: 'best-available',
|
342 |
-
animationOptions: {
|
343 |
-
queue: false,
|
344 |
-
duration: 800
|
345 |
-
},
|
346 |
-
sortBy : 'original-order',
|
347 |
-
sortAscending : true,
|
348 |
-
resizesContainer : true,
|
349 |
-
transformsEnabled: true,
|
350 |
-
itemPositionDataEnabled: false
|
351 |
-
};
|
352 |
-
|
353 |
-
jQuery.Isotope.prototype = {
|
354 |
-
|
355 |
-
// sets up widget
|
356 |
-
_create : function( options ) {
|
357 |
-
|
358 |
-
this.options = jQuery.extend( {}, jQuery.Isotope.settings, options );
|
359 |
-
|
360 |
-
this.styleQueue = [];
|
361 |
-
this.elemCount = 0;
|
362 |
-
|
363 |
-
// get original styles in case we re-apply them in .destroy()
|
364 |
-
var elemStyle = this.element[0].style;
|
365 |
-
this.originalStyle = {};
|
366 |
-
// keep track of container styles
|
367 |
-
var containerStyles = isoContainerStyles.slice(0);
|
368 |
-
for ( var prop in this.options.containerStyle ) {
|
369 |
-
containerStyles.push( prop );
|
370 |
-
}
|
371 |
-
for ( var i=0, len = containerStyles.length; i < len; i++ ) {
|
372 |
-
prop = containerStyles[i];
|
373 |
-
this.originalStyle[ prop ] = elemStyle[ prop ] || '';
|
374 |
-
}
|
375 |
-
// apply container style from options
|
376 |
-
this.element.css( this.options.containerStyle );
|
377 |
-
|
378 |
-
this._updateAnimationEngine();
|
379 |
-
this._updateUsingTransforms();
|
380 |
-
|
381 |
-
// sorting
|
382 |
-
var originalOrderSorter = {
|
383 |
-
'original-order' : function( $elem, instance ) {
|
384 |
-
instance.elemCount ++;
|
385 |
-
return instance.elemCount;
|
386 |
-
},
|
387 |
-
random : function() {
|
388 |
-
return Math.random();
|
389 |
-
}
|
390 |
-
};
|
391 |
-
|
392 |
-
this.options.getSortData = jQuery.extend( this.options.getSortData, originalOrderSorter );
|
393 |
-
|
394 |
-
// need to get atoms
|
395 |
-
this.reloadItems();
|
396 |
-
|
397 |
-
// get top left position of where the bricks should be
|
398 |
-
this.offset = {
|
399 |
-
left: parseInt( ( this.element.css('padding-left') || 0 ), 10 ),
|
400 |
-
top: parseInt( ( this.element.css('padding-top') || 0 ), 10 )
|
401 |
-
};
|
402 |
-
|
403 |
-
// add isotope class first time around
|
404 |
-
var instance = this;
|
405 |
-
setTimeout( function() {
|
406 |
-
instance.element.addClass( instance.options.containerClass );
|
407 |
-
}, 0 );
|
408 |
-
|
409 |
-
// bind resize method
|
410 |
-
if ( this.options.resizable ) {
|
411 |
-
$window.bind( 'smartresize.isotope', function() {
|
412 |
-
instance.resize();
|
413 |
-
});
|
414 |
-
}
|
415 |
-
|
416 |
-
// dismiss all click events from hidden events
|
417 |
-
this.element.delegate( '.' + this.options.hiddenClass, 'click', function(){
|
418 |
-
return false;
|
419 |
-
});
|
420 |
-
|
421 |
-
},
|
422 |
-
|
423 |
-
_getAtoms : function( $elems ) {
|
424 |
-
var selector = this.options.itemSelector,
|
425 |
-
// filter & find
|
426 |
-
$atoms = selector ? $elems.filter( selector ).add( $elems.find( selector ) ) : $elems,
|
427 |
-
// base style for atoms
|
428 |
-
atomStyle = { position: 'absolute' };
|
429 |
-
|
430 |
-
// filter out text nodes
|
431 |
-
$atoms = $atoms.filter( function( i, atom ) {
|
432 |
-
return atom.nodeType === 1;
|
433 |
-
});
|
434 |
-
|
435 |
-
if ( this.usingTransforms ) {
|
436 |
-
atomStyle.left = 0;
|
437 |
-
atomStyle.top = 0;
|
438 |
-
}
|
439 |
-
|
440 |
-
$atoms.css( atomStyle ).addClass( this.options.itemClass );
|
441 |
-
|
442 |
-
this.updateSortData( $atoms, true );
|
443 |
-
|
444 |
-
return $atoms;
|
445 |
-
},
|
446 |
-
|
447 |
-
// _init fires when your instance is first created
|
448 |
-
// (from the constructor above), and when you
|
449 |
-
// attempt to initialize the widget again (by the bridge)
|
450 |
-
// after it has already been initialized.
|
451 |
-
_init : function( callback ) {
|
452 |
-
|
453 |
-
this.$filteredAtoms = this._filter( this.$allAtoms );
|
454 |
-
this._sort();
|
455 |
-
this.reLayout( callback );
|
456 |
-
|
457 |
-
},
|
458 |
-
|
459 |
-
option : function( opts ){
|
460 |
-
// change options AFTER initialization:
|
461 |
-
// signature: $('#foo').bar({ cool:false });
|
462 |
-
if ( jQuery.isPlainObject( opts ) ){
|
463 |
-
this.options = jQuery.extend( true, this.options, opts );
|
464 |
-
|
465 |
-
// trigger _updateOptionName if it exists
|
466 |
-
var updateOptionFn;
|
467 |
-
for ( var optionName in opts ) {
|
468 |
-
updateOptionFn = '_update' + capitalize( optionName );
|
469 |
-
if ( this[ updateOptionFn ] ) {
|
470 |
-
this[ updateOptionFn ]();
|
471 |
-
}
|
472 |
-
}
|
473 |
-
}
|
474 |
-
},
|
475 |
-
|
476 |
-
// ====================== updaters ====================== //
|
477 |
-
// kind of like setters
|
478 |
-
|
479 |
-
_updateAnimationEngine : function() {
|
480 |
-
var animationEngine = this.options.animationEngine.toLowerCase().replace( /[ _\-]/g, '');
|
481 |
-
var isUsingJQueryAnimation;
|
482 |
-
// set applyStyleFnName
|
483 |
-
switch ( animationEngine ) {
|
484 |
-
case 'css' :
|
485 |
-
case 'none' :
|
486 |
-
isUsingJQueryAnimation = false;
|
487 |
-
break;
|
488 |
-
case 'jquery' :
|
489 |
-
isUsingJQueryAnimation = true;
|
490 |
-
break;
|
491 |
-
default : // best available
|
492 |
-
isUsingJQueryAnimation = !Modernizr.csstransitions;
|
493 |
-
}
|
494 |
-
this.isUsingJQueryAnimation = isUsingJQueryAnimation;
|
495 |
-
this._updateUsingTransforms();
|
496 |
-
},
|
497 |
-
|
498 |
-
_updateTransformsEnabled : function() {
|
499 |
-
this._updateUsingTransforms();
|
500 |
-
},
|
501 |
-
|
502 |
-
_updateUsingTransforms : function() {
|
503 |
-
var usingTransforms = this.usingTransforms = this.options.transformsEnabled &&
|
504 |
-
Modernizr.csstransforms && Modernizr.csstransitions && !this.isUsingJQueryAnimation;
|
505 |
-
|
506 |
-
// prevent scales when transforms are disabled
|
507 |
-
if ( !usingTransforms ) {
|
508 |
-
delete this.options.hiddenStyle.scale;
|
509 |
-
delete this.options.visibleStyle.scale;
|
510 |
-
}
|
511 |
-
|
512 |
-
this.getPositionStyles = usingTransforms ? this._translate : this._positionAbs;
|
513 |
-
},
|
514 |
-
|
515 |
-
|
516 |
-
// ====================== Filtering ======================
|
517 |
-
|
518 |
-
_filter : function( $atoms ) {
|
519 |
-
var filter = this.options.filter === '' ? '*' : this.options.filter;
|
520 |
-
|
521 |
-
if ( !filter ) {
|
522 |
-
return $atoms;
|
523 |
-
}
|
524 |
-
|
525 |
-
var hiddenClass = this.options.hiddenClass,
|
526 |
-
hiddenSelector = '.' + hiddenClass,
|
527 |
-
$hiddenAtoms = $atoms.filter( hiddenSelector ),
|
528 |
-
$atomsToShow = $hiddenAtoms;
|
529 |
-
|
530 |
-
if ( filter !== '*' ) {
|
531 |
-
$atomsToShow = $hiddenAtoms.filter( filter );
|
532 |
-
var $atomsToHide = $atoms.not( hiddenSelector ).not( filter ).addClass( hiddenClass );
|
533 |
-
this.styleQueue.push({ $el: $atomsToHide, style: this.options.hiddenStyle });
|
534 |
-
}
|
535 |
-
|
536 |
-
this.styleQueue.push({ $el: $atomsToShow, style: this.options.visibleStyle });
|
537 |
-
$atomsToShow.removeClass( hiddenClass );
|
538 |
-
|
539 |
-
return $atoms.filter( filter );
|
540 |
-
},
|
541 |
-
|
542 |
-
// ====================== Sorting ======================
|
543 |
-
|
544 |
-
updateSortData : function( $atoms, isIncrementingElemCount ) {
|
545 |
-
var instance = this,
|
546 |
-
getSortData = this.options.getSortData,
|
547 |
-
$this, sortData;
|
548 |
-
$atoms.each(function(){
|
549 |
-
$this = $(this);
|
550 |
-
sortData = {};
|
551 |
-
// get value for sort data based on fn( $elem ) passed in
|
552 |
-
for ( var key in getSortData ) {
|
553 |
-
if ( !isIncrementingElemCount && key === 'original-order' ) {
|
554 |
-
// keep original order original
|
555 |
-
sortData[ key ] = jQuery.data( this, 'isotope-sort-data' )[ key ];
|
556 |
-
} else {
|
557 |
-
sortData[ key ] = getSortData[ key ]( $this, instance );
|
558 |
-
}
|
559 |
-
}
|
560 |
-
// apply sort data to element
|
561 |
-
jQuery.data( this, 'isotope-sort-data', sortData );
|
562 |
-
});
|
563 |
-
},
|
564 |
-
|
565 |
-
// used on all the filtered atoms
|
566 |
-
_sort : function() {
|
567 |
-
|
568 |
-
var sortBy = this.options.sortBy,
|
569 |
-
getSorter = this._getSorter,
|
570 |
-
sortDir = this.options.sortAscending ? 1 : -1,
|
571 |
-
sortFn = function( alpha, beta ) {
|
572 |
-
var a = getSorter( alpha, sortBy ),
|
573 |
-
b = getSorter( beta, sortBy );
|
574 |
-
// fall back to original order if data matches
|
575 |
-
if ( a === b && sortBy !== 'original-order') {
|
576 |
-
a = getSorter( alpha, 'original-order' );
|
577 |
-
b = getSorter( beta, 'original-order' );
|
578 |
-
}
|
579 |
-
return ( ( a > b ) ? 1 : ( a < b ) ? -1 : 0 ) * sortDir;
|
580 |
-
};
|
581 |
-
|
582 |
-
this.$filteredAtoms.sort( sortFn );
|
583 |
-
},
|
584 |
-
|
585 |
-
_getSorter : function( elem, sortBy ) {
|
586 |
-
return jQuery.data( elem, 'isotope-sort-data' )[ sortBy ];
|
587 |
-
},
|
588 |
-
|
589 |
-
// ====================== Layout Helpers ======================
|
590 |
-
|
591 |
-
_translate : function( x, y ) {
|
592 |
-
return { translate : [ x, y ] };
|
593 |
-
},
|
594 |
-
|
595 |
-
_positionAbs : function( x, y ) {
|
596 |
-
return { left: x, top: y };
|
597 |
-
},
|
598 |
-
|
599 |
-
_pushPosition : function( $elem, x, y ) {
|
600 |
-
x = Math.round( x + this.offset.left );
|
601 |
-
y = Math.round( y + this.offset.top );
|
602 |
-
var position = this.getPositionStyles( x, y );
|
603 |
-
this.styleQueue.push({ $el: $elem, style: position });
|
604 |
-
if ( this.options.itemPositionDataEnabled ) {
|
605 |
-
$elem.data('isotope-item-position', {x: x, y: y} );
|
606 |
-
}
|
607 |
-
},
|
608 |
-
|
609 |
-
|
610 |
-
// ====================== General Layout ======================
|
611 |
-
|
612 |
-
// used on collection of atoms (should be filtered, and sorted before )
|
613 |
-
// accepts atoms-to-be-laid-out to start with
|
614 |
-
layout : function( $elems, callback ) {
|
615 |
-
|
616 |
-
var layoutMode = this.options.layoutMode;
|
617 |
-
|
618 |
-
// layout logic
|
619 |
-
this[ '_' + layoutMode + 'Layout' ]( $elems );
|
620 |
-
|
621 |
-
// set the size of the container
|
622 |
-
if ( this.options.resizesContainer ) {
|
623 |
-
var containerStyle = this[ '_' + layoutMode + 'GetContainerSize' ]();
|
624 |
-
this.styleQueue.push({ $el: this.element, style: containerStyle });
|
625 |
-
}
|
626 |
-
|
627 |
-
this._processStyleQueue( $elems, callback );
|
628 |
-
|
629 |
-
this.isLaidOut = true;
|
630 |
-
},
|
631 |
-
|
632 |
-
_processStyleQueue : function( $elems, callback ) {
|
633 |
-
// are we animating the layout arrangement?
|
634 |
-
// use plugin-ish syntax for css or animate
|
635 |
-
var styleFn = !this.isLaidOut ? 'css' : (
|
636 |
-
this.isUsingJQueryAnimation ? 'animate' : 'css'
|
637 |
-
),
|
638 |
-
animOpts = this.options.animationOptions,
|
639 |
-
onLayout = this.options.onLayout,
|
640 |
-
objStyleFn, processor,
|
641 |
-
triggerCallbackNow, callbackFn;
|
642 |
-
|
643 |
-
// default styleQueue processor, may be overwritten down below
|
644 |
-
processor = function( i, obj ) {
|
645 |
-
obj.$el[ styleFn ]( obj.style, animOpts );
|
646 |
-
};
|
647 |
-
|
648 |
-
if ( this._isInserting && this.isUsingJQueryAnimation ) {
|
649 |
-
// if using styleQueue to insert items
|
650 |
-
processor = function( i, obj ) {
|
651 |
-
// only animate if it not being inserted
|
652 |
-
objStyleFn = obj.$el.hasClass('no-transition') ? 'css' : styleFn;
|
653 |
-
obj.$el[ objStyleFn ]( obj.style, animOpts );
|
654 |
-
};
|
655 |
-
|
656 |
-
} else if ( callback || onLayout || animOpts.complete ) {
|
657 |
-
// has callback
|
658 |
-
var isCallbackTriggered = false,
|
659 |
-
// array of possible callbacks to trigger
|
660 |
-
callbacks = [ callback, onLayout, animOpts.complete ],
|
661 |
-
instance = this;
|
662 |
-
triggerCallbackNow = true;
|
663 |
-
// trigger callback only once
|
664 |
-
callbackFn = function() {
|
665 |
-
if ( isCallbackTriggered ) {
|
666 |
-
return;
|
667 |
-
}
|
668 |
-
var hollaback;
|
669 |
-
for (var i=0, len = callbacks.length; i < len; i++) {
|
670 |
-
hollaback = callbacks[i];
|
671 |
-
if ( typeof hollaback === 'function' ) {
|
672 |
-
hollaback.call( instance.element, $elems, instance );
|
673 |
-
}
|
674 |
-
}
|
675 |
-
isCallbackTriggered = true;
|
676 |
-
};
|
677 |
-
|
678 |
-
if ( this.isUsingJQueryAnimation && styleFn === 'animate' ) {
|
679 |
-
// add callback to animation options
|
680 |
-
animOpts.complete = callbackFn;
|
681 |
-
triggerCallbackNow = false;
|
682 |
-
|
683 |
-
} else if ( Modernizr.csstransitions ) {
|
684 |
-
// detect if first item has transition
|
685 |
-
var i = 0,
|
686 |
-
firstItem = this.styleQueue[0],
|
687 |
-
testElem = firstItem && firstItem.$el,
|
688 |
-
styleObj;
|
689 |
-
// get first non-empty jQ object
|
690 |
-
while ( !testElem || !testElem.length ) {
|
691 |
-
styleObj = this.styleQueue[ i++ ];
|
692 |
-
// HACK: sometimes styleQueue[i] is undefined
|
693 |
-
if ( !styleObj ) {
|
694 |
-
return;
|
695 |
-
}
|
696 |
-
testElem = styleObj.$el;
|
697 |
-
}
|
698 |
-
// get transition duration of the first element in that object
|
699 |
-
// yeah, this is inexact
|
700 |
-
var duration = parseFloat( getComputedStyle( testElem[0] )[ transitionDurProp ] );
|
701 |
-
if ( duration > 0 ) {
|
702 |
-
processor = function( i, obj ) {
|
703 |
-
obj.$el[ styleFn ]( obj.style, animOpts )
|
704 |
-
// trigger callback at transition end
|
705 |
-
.one( transitionEndEvent, callbackFn );
|
706 |
-
};
|
707 |
-
triggerCallbackNow = false;
|
708 |
-
}
|
709 |
-
}
|
710 |
-
}
|
711 |
-
|
712 |
-
// process styleQueue
|
713 |
-
jQuery.each( this.styleQueue, processor );
|
714 |
-
|
715 |
-
if ( triggerCallbackNow ) {
|
716 |
-
callbackFn();
|
717 |
-
}
|
718 |
-
|
719 |
-
// clear out queue for next time
|
720 |
-
this.styleQueue = [];
|
721 |
-
},
|
722 |
-
|
723 |
-
|
724 |
-
resize : function() {
|
725 |
-
if ( this[ '_' + this.options.layoutMode + 'ResizeChanged' ]() ) {
|
726 |
-
this.reLayout();
|
727 |
-
}
|
728 |
-
},
|
729 |
-
|
730 |
-
|
731 |
-
reLayout : function( callback ) {
|
732 |
-
|
733 |
-
this[ '_' + this.options.layoutMode + 'Reset' ]();
|
734 |
-
this.layout( this.$filteredAtoms, callback );
|
735 |
-
|
736 |
-
},
|
737 |
-
|
738 |
-
// ====================== Convenience methods ======================
|
739 |
-
|
740 |
-
// ====================== Adding items ======================
|
741 |
-
|
742 |
-
// adds a jQuery object of items to a isotope container
|
743 |
-
addItems : function( $content, callback ) {
|
744 |
-
var $newAtoms = this._getAtoms( $content );
|
745 |
-
// add new atoms to atoms pools
|
746 |
-
this.$allAtoms = this.$allAtoms.add( $newAtoms );
|
747 |
-
|
748 |
-
if ( callback ) {
|
749 |
-
callback( $newAtoms );
|
750 |
-
}
|
751 |
-
},
|
752 |
-
|
753 |
-
// convienence method for adding elements properly to any layout
|
754 |
-
// positions items, hides them, then animates them back in <--- very sezzy
|
755 |
-
insert : function( $content, callback ) {
|
756 |
-
// position items
|
757 |
-
this.element.append( $content );
|
758 |
-
|
759 |
-
var instance = this;
|
760 |
-
this.addItems( $content, function( $newAtoms ) {
|
761 |
-
var $newFilteredAtoms = instance._filter( $newAtoms );
|
762 |
-
instance._addHideAppended( $newFilteredAtoms );
|
763 |
-
instance._sort();
|
764 |
-
instance.reLayout();
|
765 |
-
instance._revealAppended( $newFilteredAtoms, callback );
|
766 |
-
});
|
767 |
-
|
768 |
-
},
|
769 |
-
|
770 |
-
// convienence method for working with Infinite Scroll
|
771 |
-
appended : function( $content, callback ) {
|
772 |
-
var instance = this;
|
773 |
-
this.addItems( $content, function( $newAtoms ) {
|
774 |
-
instance._addHideAppended( $newAtoms );
|
775 |
-
instance.layout( $newAtoms );
|
776 |
-
instance._revealAppended( $newAtoms, callback );
|
777 |
-
});
|
778 |
-
},
|
779 |
-
|
780 |
-
// adds new atoms, then hides them before positioning
|
781 |
-
_addHideAppended : function( $newAtoms ) {
|
782 |
-
this.$filteredAtoms = this.$filteredAtoms.add( $newAtoms );
|
783 |
-
$newAtoms.addClass('no-transition');
|
784 |
-
|
785 |
-
this._isInserting = true;
|
786 |
-
|
787 |
-
// apply hidden styles
|
788 |
-
this.styleQueue.push({ $el: $newAtoms, style: this.options.hiddenStyle });
|
789 |
-
},
|
790 |
-
|
791 |
-
// sets visible style on new atoms
|
792 |
-
_revealAppended : function( $newAtoms, callback ) {
|
793 |
-
var instance = this;
|
794 |
-
// apply visible style after a sec
|
795 |
-
setTimeout( function() {
|
796 |
-
// enable animation
|
797 |
-
$newAtoms.removeClass('no-transition');
|
798 |
-
// reveal newly inserted filtered elements
|
799 |
-
instance.styleQueue.push({ $el: $newAtoms, style: instance.options.visibleStyle });
|
800 |
-
instance._isInserting = false;
|
801 |
-
instance._processStyleQueue( $newAtoms, callback );
|
802 |
-
}, 10 );
|
803 |
-
},
|
804 |
-
|
805 |
-
// gathers all atoms
|
806 |
-
reloadItems : function() {
|
807 |
-
this.$allAtoms = this._getAtoms( this.element.children() );
|
808 |
-
},
|
809 |
-
|
810 |
-
// removes elements from Isotope widget
|
811 |
-
remove: function( $content, callback ) {
|
812 |
-
// remove elements immediately from Isotope instance
|
813 |
-
this.$allAtoms = this.$allAtoms.not( $content );
|
814 |
-
this.$filteredAtoms = this.$filteredAtoms.not( $content );
|
815 |
-
// remove() as a callback, for after transition / animation
|
816 |
-
var instance = this;
|
817 |
-
var removeContent = function() {
|
818 |
-
$content.remove();
|
819 |
-
if ( callback ) {
|
820 |
-
callback.call( instance.element );
|
821 |
-
}
|
822 |
-
};
|
823 |
-
|
824 |
-
if ( $content.filter( ':not(.' + this.options.hiddenClass + ')' ).length ) {
|
825 |
-
// if any non-hidden content needs to be removed
|
826 |
-
this.styleQueue.push({ $el: $content, style: this.options.hiddenStyle });
|
827 |
-
this._sort();
|
828 |
-
this.reLayout( removeContent );
|
829 |
-
} else {
|
830 |
-
// remove it now
|
831 |
-
removeContent();
|
832 |
-
}
|
833 |
-
|
834 |
-
},
|
835 |
-
|
836 |
-
shuffle : function( callback ) {
|
837 |
-
this.updateSortData( this.$allAtoms );
|
838 |
-
this.options.sortBy = 'random';
|
839 |
-
this._sort();
|
840 |
-
this.reLayout( callback );
|
841 |
-
},
|
842 |
-
|
843 |
-
// destroys widget, returns elements and container back (close) to original style
|
844 |
-
destroy : function() {
|
845 |
-
|
846 |
-
var usingTransforms = this.usingTransforms;
|
847 |
-
var options = this.options;
|
848 |
-
|
849 |
-
this.$allAtoms
|
850 |
-
.removeClass( options.hiddenClass + ' ' + options.itemClass )
|
851 |
-
.each(function(){
|
852 |
-
var style = this.style;
|
853 |
-
style.position = '';
|
854 |
-
style.top = '';
|
855 |
-
style.left = '';
|
856 |
-
style.opacity = '';
|
857 |
-
if ( usingTransforms ) {
|
858 |
-
style[ transformProp ] = '';
|
859 |
-
}
|
860 |
-
});
|
861 |
-
|
862 |
-
// re-apply saved container styles
|
863 |
-
var elemStyle = this.element[0].style;
|
864 |
-
for ( var prop in this.originalStyle ) {
|
865 |
-
elemStyle[ prop ] = this.originalStyle[ prop ];
|
866 |
-
}
|
867 |
-
|
868 |
-
this.element
|
869 |
-
.unbind('.isotope')
|
870 |
-
.undelegate( '.' + options.hiddenClass, 'click' )
|
871 |
-
.removeClass( options.containerClass )
|
872 |
-
.removeData('isotope');
|
873 |
-
|
874 |
-
$window.unbind('.isotope');
|
875 |
-
|
876 |
-
},
|
877 |
-
|
878 |
-
|
879 |
-
// ====================== LAYOUTS ======================
|
880 |
-
|
881 |
-
// calculates number of rows or columns
|
882 |
-
// requires columnWidth or rowHeight to be set on namespaced object
|
883 |
-
// i.e. this.masonry.columnWidth = 200
|
884 |
-
_getSegments : function( isRows ) {
|
885 |
-
var namespace = this.options.layoutMode,
|
886 |
-
measure = isRows ? 'rowHeight' : 'columnWidth',
|
887 |
-
size = isRows ? 'height' : 'width',
|
888 |
-
segmentsName = isRows ? 'rows' : 'cols',
|
889 |
-
containerSize = this.element[ size ](),
|
890 |
-
segments,
|
891 |
-
// i.e. options.masonry && options.masonry.columnWidth
|
892 |
-
segmentSize = this.options[ namespace ] && this.options[ namespace ][ measure ] ||
|
893 |
-
// or use the size of the first item, i.e. outerWidth
|
894 |
-
this.$filteredAtoms[ 'outer' + capitalize(size) ](true) ||
|
895 |
-
// if there's no items, use size of container
|
896 |
-
containerSize;
|
897 |
-
|
898 |
-
segments = Math.floor( containerSize / segmentSize );
|
899 |
-
segments = Math.max( segments, 1 );
|
900 |
-
|
901 |
-
// i.e. this.masonry.cols = ....
|
902 |
-
this[ namespace ][ segmentsName ] = segments;
|
903 |
-
// i.e. this.masonry.columnWidth = ...
|
904 |
-
this[ namespace ][ measure ] = segmentSize;
|
905 |
-
|
906 |
-
},
|
907 |
-
|
908 |
-
_checkIfSegmentsChanged : function( isRows ) {
|
909 |
-
var namespace = this.options.layoutMode,
|
910 |
-
segmentsName = isRows ? 'rows' : 'cols',
|
911 |
-
prevSegments = this[ namespace ][ segmentsName ];
|
912 |
-
// update cols/rows
|
913 |
-
this._getSegments( isRows );
|
914 |
-
// return if updated cols/rows is not equal to previous
|
915 |
-
return ( this[ namespace ][ segmentsName ] !== prevSegments );
|
916 |
-
},
|
917 |
-
|
918 |
-
// ====================== Masonry ======================
|
919 |
-
|
920 |
-
_masonryReset : function() {
|
921 |
-
// layout-specific props
|
922 |
-
this.masonry = {};
|
923 |
-
// FIXME shouldn't have to call this again
|
924 |
-
this._getSegments();
|
925 |
-
var i = this.masonry.cols;
|
926 |
-
this.masonry.colYs = [];
|
927 |
-
while (i--) {
|
928 |
-
this.masonry.colYs.push( 0 );
|
929 |
-
}
|
930 |
-
},
|
931 |
-
|
932 |
-
_masonryLayout : function( $elems ) {
|
933 |
-
var instance = this,
|
934 |
-
props = instance.masonry;
|
935 |
-
$elems.each(function(){
|
936 |
-
var $this = $(this),
|
937 |
-
//how many columns does this brick span
|
938 |
-
colSpan = Math.ceil( $this.outerWidth(true) / props.columnWidth );
|
939 |
-
colSpan = Math.min( colSpan, props.cols );
|
940 |
-
|
941 |
-
if ( colSpan === 1 ) {
|
942 |
-
// if brick spans only one column, just like singleMode
|
943 |
-
instance._masonryPlaceBrick( $this, props.colYs );
|
944 |
-
} else {
|
945 |
-
// brick spans more than one column
|
946 |
-
// how many different places could this brick fit horizontally
|
947 |
-
var groupCount = props.cols + 1 - colSpan,
|
948 |
-
groupY = [],
|
949 |
-
groupColY,
|
950 |
-
i;
|
951 |
-
|
952 |
-
// for each group potential horizontal position
|
953 |
-
for ( i=0; i < groupCount; i++ ) {
|
954 |
-
// make an array of colY values for that one group
|
955 |
-
groupColY = props.colYs.slice( i, i+colSpan );
|
956 |
-
// and get the max value of the array
|
957 |
-
groupY[i] = Math.max.apply( Math, groupColY );
|
958 |
-
}
|
959 |
-
|
960 |
-
instance._masonryPlaceBrick( $this, groupY );
|
961 |
-
}
|
962 |
-
});
|
963 |
-
},
|
964 |
-
|
965 |
-
// worker method that places brick in the columnSet
|
966 |
-
// with the the minY
|
967 |
-
_masonryPlaceBrick : function( $brick, setY ) {
|
968 |
-
// get the minimum Y value from the columns
|
969 |
-
var minimumY = Math.min.apply( Math, setY ),
|
970 |
-
shortCol = 0;
|
971 |
-
|
972 |
-
// Find index of short column, the first from the left
|
973 |
-
for (var i=0, len = setY.length; i < len; i++) {
|
974 |
-
if ( setY[i] === minimumY ) {
|
975 |
-
shortCol = i;
|
976 |
-
break;
|
977 |
-
}
|
978 |
-
}
|
979 |
-
|
980 |
-
// position the brick
|
981 |
-
var x = this.masonry.columnWidth * shortCol,
|
982 |
-
y = minimumY;
|
983 |
-
this._pushPosition( $brick, x, y );
|
984 |
-
|
985 |
-
// apply setHeight to necessary columns
|
986 |
-
var setHeight = minimumY + $brick.outerHeight(true),
|
987 |
-
setSpan = this.masonry.cols + 1 - len;
|
988 |
-
for ( i=0; i < setSpan; i++ ) {
|
989 |
-
this.masonry.colYs[ shortCol + i ] = setHeight;
|
990 |
-
}
|
991 |
-
|
992 |
-
},
|
993 |
-
|
994 |
-
_masonryGetContainerSize : function() {
|
995 |
-
var containerHeight = Math.max.apply( Math, this.masonry.colYs );
|
996 |
-
return { height: containerHeight };
|
997 |
-
},
|
998 |
-
|
999 |
-
_masonryResizeChanged : function() {
|
1000 |
-
return this._checkIfSegmentsChanged();
|
1001 |
-
},
|
1002 |
-
|
1003 |
-
// ====================== fitRows ======================
|
1004 |
-
|
1005 |
-
_fitRowsReset : function() {
|
1006 |
-
this.fitRows = {
|
1007 |
-
x : 0,
|
1008 |
-
y : 0,
|
1009 |
-
height : 0
|
1010 |
-
};
|
1011 |
-
},
|
1012 |
-
|
1013 |
-
_fitRowsLayout : function( $elems ) {
|
1014 |
-
var instance = this,
|
1015 |
-
containerWidth = this.element.width(),
|
1016 |
-
props = this.fitRows;
|
1017 |
-
|
1018 |
-
$elems.each( function() {
|
1019 |
-
var $this = $(this),
|
1020 |
-
atomW = $this.outerWidth(true),
|
1021 |
-
atomH = $this.outerHeight(true);
|
1022 |
-
|
1023 |
-
if ( props.x !== 0 && atomW + props.x > containerWidth ) {
|
1024 |
-
// if this element cannot fit in the current row
|
1025 |
-
props.x = 0;
|
1026 |
-
props.y = props.height;
|
1027 |
-
}
|
1028 |
-
|
1029 |
-
// position the atom
|
1030 |
-
instance._pushPosition( $this, props.x, props.y );
|
1031 |
-
|
1032 |
-
props.height = Math.max( props.y + atomH, props.height );
|
1033 |
-
props.x += atomW;
|
1034 |
-
|
1035 |
-
});
|
1036 |
-
},
|
1037 |
-
|
1038 |
-
_fitRowsGetContainerSize : function () {
|
1039 |
-
return { height : this.fitRows.height };
|
1040 |
-
},
|
1041 |
-
|
1042 |
-
_fitRowsResizeChanged : function() {
|
1043 |
-
return true;
|
1044 |
-
},
|
1045 |
-
|
1046 |
-
|
1047 |
-
// ====================== cellsByRow ======================
|
1048 |
-
|
1049 |
-
_cellsByRowReset : function() {
|
1050 |
-
this.cellsByRow = {
|
1051 |
-
index : 0
|
1052 |
-
};
|
1053 |
-
// get this.cellsByRow.columnWidth
|
1054 |
-
this._getSegments();
|
1055 |
-
// get this.cellsByRow.rowHeight
|
1056 |
-
this._getSegments(true);
|
1057 |
-
},
|
1058 |
-
|
1059 |
-
_cellsByRowLayout : function( $elems ) {
|
1060 |
-
var instance = this,
|
1061 |
-
props = this.cellsByRow;
|
1062 |
-
$elems.each( function(){
|
1063 |
-
var $this = $(this),
|
1064 |
-
col = props.index % props.cols,
|
1065 |
-
row = Math.floor( props.index / props.cols ),
|
1066 |
-
x = ( col + 0.5 ) * props.columnWidth - $this.outerWidth(true) / 2,
|
1067 |
-
y = ( row + 0.5 ) * props.rowHeight - $this.outerHeight(true) / 2;
|
1068 |
-
instance._pushPosition( $this, x, y );
|
1069 |
-
props.index ++;
|
1070 |
-
});
|
1071 |
-
},
|
1072 |
-
|
1073 |
-
_cellsByRowGetContainerSize : function() {
|
1074 |
-
return { height : Math.ceil( this.$filteredAtoms.length / this.cellsByRow.cols ) * this.cellsByRow.rowHeight + this.offset.top };
|
1075 |
-
},
|
1076 |
-
|
1077 |
-
_cellsByRowResizeChanged : function() {
|
1078 |
-
return this._checkIfSegmentsChanged();
|
1079 |
-
},
|
1080 |
-
|
1081 |
-
|
1082 |
-
// ====================== straightDown ======================
|
1083 |
-
|
1084 |
-
_straightDownReset : function() {
|
1085 |
-
this.straightDown = {
|
1086 |
-
y : 0
|
1087 |
-
};
|
1088 |
-
},
|
1089 |
-
|
1090 |
-
_straightDownLayout : function( $elems ) {
|
1091 |
-
var instance = this;
|
1092 |
-
$elems.each( function( i ){
|
1093 |
-
var $this = $(this);
|
1094 |
-
instance._pushPosition( $this, 0, instance.straightDown.y );
|
1095 |
-
instance.straightDown.y += $this.outerHeight(true);
|
1096 |
-
});
|
1097 |
-
},
|
1098 |
-
|
1099 |
-
_straightDownGetContainerSize : function() {
|
1100 |
-
return { height : this.straightDown.y };
|
1101 |
-
},
|
1102 |
-
|
1103 |
-
_straightDownResizeChanged : function() {
|
1104 |
-
return true;
|
1105 |
-
},
|
1106 |
-
|
1107 |
-
|
1108 |
-
// ====================== masonryHorizontal ======================
|
1109 |
-
|
1110 |
-
_masonryHorizontalReset : function() {
|
1111 |
-
// layout-specific props
|
1112 |
-
this.masonryHorizontal = {};
|
1113 |
-
// FIXME shouldn't have to call this again
|
1114 |
-
this._getSegments( true );
|
1115 |
-
var i = this.masonryHorizontal.rows;
|
1116 |
-
this.masonryHorizontal.rowXs = [];
|
1117 |
-
while (i--) {
|
1118 |
-
this.masonryHorizontal.rowXs.push( 0 );
|
1119 |
-
}
|
1120 |
-
},
|
1121 |
-
|
1122 |
-
_masonryHorizontalLayout : function( $elems ) {
|
1123 |
-
var instance = this,
|
1124 |
-
props = instance.masonryHorizontal;
|
1125 |
-
$elems.each(function(){
|
1126 |
-
var $this = $(this),
|
1127 |
-
//how many rows does this brick span
|
1128 |
-
rowSpan = Math.ceil( $this.outerHeight(true) / props.rowHeight );
|
1129 |
-
rowSpan = Math.min( rowSpan, props.rows );
|
1130 |
-
|
1131 |
-
if ( rowSpan === 1 ) {
|
1132 |
-
// if brick spans only one column, just like singleMode
|
1133 |
-
instance._masonryHorizontalPlaceBrick( $this, props.rowXs );
|
1134 |
-
} else {
|
1135 |
-
// brick spans more than one row
|
1136 |
-
// how many different places could this brick fit horizontally
|
1137 |
-
var groupCount = props.rows + 1 - rowSpan,
|
1138 |
-
groupX = [],
|
1139 |
-
groupRowX, i;
|
1140 |
-
|
1141 |
-
// for each group potential horizontal position
|
1142 |
-
for ( i=0; i < groupCount; i++ ) {
|
1143 |
-
// make an array of colY values for that one group
|
1144 |
-
groupRowX = props.rowXs.slice( i, i+rowSpan );
|
1145 |
-
// and get the max value of the array
|
1146 |
-
groupX[i] = Math.max.apply( Math, groupRowX );
|
1147 |
-
}
|
1148 |
-
|
1149 |
-
instance._masonryHorizontalPlaceBrick( $this, groupX );
|
1150 |
-
}
|
1151 |
-
});
|
1152 |
-
},
|
1153 |
-
|
1154 |
-
_masonryHorizontalPlaceBrick : function( $brick, setX ) {
|
1155 |
-
// get the minimum Y value from the columns
|
1156 |
-
var minimumX = Math.min.apply( Math, setX ),
|
1157 |
-
smallRow = 0;
|
1158 |
-
// Find index of smallest row, the first from the top
|
1159 |
-
for (var i=0, len = setX.length; i < len; i++) {
|
1160 |
-
if ( setX[i] === minimumX ) {
|
1161 |
-
smallRow = i;
|
1162 |
-
break;
|
1163 |
-
}
|
1164 |
-
}
|
1165 |
-
|
1166 |
-
// position the brick
|
1167 |
-
var x = minimumX,
|
1168 |
-
y = this.masonryHorizontal.rowHeight * smallRow;
|
1169 |
-
this._pushPosition( $brick, x, y );
|
1170 |
-
|
1171 |
-
// apply setHeight to necessary columns
|
1172 |
-
var setWidth = minimumX + $brick.outerWidth(true),
|
1173 |
-
setSpan = this.masonryHorizontal.rows + 1 - len;
|
1174 |
-
for ( i=0; i < setSpan; i++ ) {
|
1175 |
-
this.masonryHorizontal.rowXs[ smallRow + i ] = setWidth;
|
1176 |
-
}
|
1177 |
-
},
|
1178 |
-
|
1179 |
-
_masonryHorizontalGetContainerSize : function() {
|
1180 |
-
var containerWidth = Math.max.apply( Math, this.masonryHorizontal.rowXs );
|
1181 |
-
return { width: containerWidth };
|
1182 |
-
},
|
1183 |
-
|
1184 |
-
_masonryHorizontalResizeChanged : function() {
|
1185 |
-
return this._checkIfSegmentsChanged(true);
|
1186 |
-
},
|
1187 |
-
|
1188 |
-
|
1189 |
-
// ====================== fitColumns ======================
|
1190 |
-
|
1191 |
-
_fitColumnsReset : function() {
|
1192 |
-
this.fitColumns = {
|
1193 |
-
x : 0,
|
1194 |
-
y : 0,
|
1195 |
-
width : 0
|
1196 |
-
};
|
1197 |
-
},
|
1198 |
-
|
1199 |
-
_fitColumnsLayout : function( $elems ) {
|
1200 |
-
var instance = this,
|
1201 |
-
containerHeight = this.element.height(),
|
1202 |
-
props = this.fitColumns;
|
1203 |
-
$elems.each( function() {
|
1204 |
-
var $this = $(this),
|
1205 |
-
atomW = $this.outerWidth(true),
|
1206 |
-
atomH = $this.outerHeight(true);
|
1207 |
-
|
1208 |
-
if ( props.y !== 0 && atomH + props.y > containerHeight ) {
|
1209 |
-
// if this element cannot fit in the current column
|
1210 |
-
props.x = props.width;
|
1211 |
-
props.y = 0;
|
1212 |
-
}
|
1213 |
-
|
1214 |
-
// position the atom
|
1215 |
-
instance._pushPosition( $this, props.x, props.y );
|
1216 |
-
|
1217 |
-
props.width = Math.max( props.x + atomW, props.width );
|
1218 |
-
props.y += atomH;
|
1219 |
-
|
1220 |
-
});
|
1221 |
-
},
|
1222 |
-
|
1223 |
-
_fitColumnsGetContainerSize : function () {
|
1224 |
-
return { width : this.fitColumns.width };
|
1225 |
-
},
|
1226 |
-
|
1227 |
-
_fitColumnsResizeChanged : function() {
|
1228 |
-
return true;
|
1229 |
-
},
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
// ====================== cellsByColumn ======================
|
1234 |
-
|
1235 |
-
_cellsByColumnReset : function() {
|
1236 |
-
this.cellsByColumn = {
|
1237 |
-
index : 0
|
1238 |
-
};
|
1239 |
-
// get this.cellsByColumn.columnWidth
|
1240 |
-
this._getSegments();
|
1241 |
-
// get this.cellsByColumn.rowHeight
|
1242 |
-
this._getSegments(true);
|
1243 |
-
},
|
1244 |
-
|
1245 |
-
_cellsByColumnLayout : function( $elems ) {
|
1246 |
-
var instance = this,
|
1247 |
-
props = this.cellsByColumn;
|
1248 |
-
$elems.each( function(){
|
1249 |
-
var $this = $(this),
|
1250 |
-
col = Math.floor( props.index / props.rows ),
|
1251 |
-
row = props.index % props.rows,
|
1252 |
-
x = ( col + 0.5 ) * props.columnWidth - $this.outerWidth(true) / 2,
|
1253 |
-
y = ( row + 0.5 ) * props.rowHeight - $this.outerHeight(true) / 2;
|
1254 |
-
instance._pushPosition( $this, x, y );
|
1255 |
-
props.index ++;
|
1256 |
-
});
|
1257 |
-
},
|
1258 |
-
|
1259 |
-
_cellsByColumnGetContainerSize : function() {
|
1260 |
-
return { width : Math.ceil( this.$filteredAtoms.length / this.cellsByColumn.rows ) * this.cellsByColumn.columnWidth };
|
1261 |
-
},
|
1262 |
-
|
1263 |
-
_cellsByColumnResizeChanged : function() {
|
1264 |
-
return this._checkIfSegmentsChanged(true);
|
1265 |
-
},
|
1266 |
-
|
1267 |
-
// ====================== straightAcross ======================
|
1268 |
-
|
1269 |
-
_straightAcrossReset : function() {
|
1270 |
-
this.straightAcross = {
|
1271 |
-
x : 0
|
1272 |
-
};
|
1273 |
-
},
|
1274 |
-
|
1275 |
-
_straightAcrossLayout : function( $elems ) {
|
1276 |
-
var instance = this;
|
1277 |
-
$elems.each( function( i ){
|
1278 |
-
var $this = $(this);
|
1279 |
-
instance._pushPosition( $this, instance.straightAcross.x, 0 );
|
1280 |
-
instance.straightAcross.x += $this.outerWidth(true);
|
1281 |
-
});
|
1282 |
-
},
|
1283 |
-
|
1284 |
-
_straightAcrossGetContainerSize : function() {
|
1285 |
-
return { width : this.straightAcross.x };
|
1286 |
-
},
|
1287 |
-
|
1288 |
-
_straightAcrossResizeChanged : function() {
|
1289 |
-
return true;
|
1290 |
-
}
|
1291 |
-
|
1292 |
-
};
|
1293 |
-
|
1294 |
-
|
1295 |
-
// ======================= imagesLoaded Plugin ===============================
|
1296 |
-
/*!
|
1297 |
-
* jQuery imagesLoaded plugin v1.1.0
|
1298 |
-
* http://github.com/desandro/imagesloaded
|
1299 |
-
*
|
1300 |
-
* MIT License. by Paul Irish et al.
|
1301 |
-
*/
|
1302 |
-
|
1303 |
-
|
1304 |
-
// $('#my-container').imagesLoaded(myFunction)
|
1305 |
-
// or
|
1306 |
-
// $('img').imagesLoaded(myFunction)
|
1307 |
-
|
1308 |
-
// execute a callback when all images have loaded.
|
1309 |
-
// needed because .load() doesn't work on cached images
|
1310 |
-
|
1311 |
-
// callback function gets image collection as argument
|
1312 |
-
// `this` is the container
|
1313 |
-
|
1314 |
-
jQuery.fn.imagesLoaded = function( callback ) {
|
1315 |
-
var $this = this,
|
1316 |
-
$images = $this.find('img').add( $this.filter('img') ),
|
1317 |
-
len = $images.length,
|
1318 |
-
blank = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==',
|
1319 |
-
loaded = [];
|
1320 |
-
|
1321 |
-
function triggerCallback() {
|
1322 |
-
callback.call( $this, $images );
|
1323 |
-
}
|
1324 |
-
|
1325 |
-
function imgLoaded( event ) {
|
1326 |
-
var img = event.target;
|
1327 |
-
if ( img.src !== blank && jQuery.inArray( img, loaded ) === -1 ){
|
1328 |
-
loaded.push( img );
|
1329 |
-
if ( --len <= 0 ){
|
1330 |
-
setTimeout( triggerCallback );
|
1331 |
-
$images.unbind( '.imagesLoaded', imgLoaded );
|
1332 |
-
}
|
1333 |
-
}
|
1334 |
-
}
|
1335 |
-
|
1336 |
-
// if no images, trigger immediately
|
1337 |
-
if ( !len ) {
|
1338 |
-
triggerCallback();
|
1339 |
-
}
|
1340 |
-
|
1341 |
-
$images.bind( 'load.imagesLoaded error.imagesLoaded', imgLoaded ).each( function() {
|
1342 |
-
// cached images don't fire load sometimes, so we reset src.
|
1343 |
-
var src = this.src;
|
1344 |
-
// webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
|
1345 |
-
// data uri bypasses webkit log warning (thx doug jones)
|
1346 |
-
this.src = blank;
|
1347 |
-
this.src = src;
|
1348 |
-
});
|
1349 |
-
|
1350 |
-
return $this;
|
1351 |
-
};
|
1352 |
-
|
1353 |
-
|
1354 |
-
// helper function for logging errors
|
1355 |
-
// jQuery.error breaks jQuery chaining
|
1356 |
-
var logError = function( message ) {
|
1357 |
-
if ( window.console ) {
|
1358 |
-
window.console.error( message );
|
1359 |
-
}
|
1360 |
-
};
|
1361 |
-
|
1362 |
-
// ======================= Plugin bridge ===============================
|
1363 |
-
// leverages data method to either create or return jQuery.Isotope constructor
|
1364 |
-
// A bit from jQuery UI
|
1365 |
-
// https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.widget.js
|
1366 |
-
// A bit from jcarousel
|
1367 |
-
// https://github.com/jsor/jcarousel/blob/master/lib/jquery.jcarousel.js
|
1368 |
-
|
1369 |
-
jQuery.fn.isotope = function( options, callback ) {
|
1370 |
-
if ( typeof options === 'string' ) {
|
1371 |
-
// call method
|
1372 |
-
var args = Array.prototype.slice.call( arguments, 1 );
|
1373 |
-
|
1374 |
-
this.each(function(){
|
1375 |
-
var instance = jQuery.data( this, 'isotope' );
|
1376 |
-
if ( !instance ) {
|
1377 |
-
logError( "cannot call methods on isotope prior to initialization; " +
|
1378 |
-
"attempted to call method '" + options + "'" );
|
1379 |
-
return;
|
1380 |
-
}
|
1381 |
-
if ( !jQuery.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
|
1382 |
-
logError( "no such method '" + options + "' for isotope instance" );
|
1383 |
-
return;
|
1384 |
-
}
|
1385 |
-
// apply method
|
1386 |
-
instance[ options ].apply( instance, args );
|
1387 |
-
});
|
1388 |
-
} else {
|
1389 |
-
this.each(function() {
|
1390 |
-
var instance = jQuery.data( this, 'isotope' );
|
1391 |
-
if ( instance ) {
|
1392 |
-
// apply options & init
|
1393 |
-
instance.option( options );
|
1394 |
-
instance._init( callback );
|
1395 |
-
} else {
|
1396 |
-
// initialize new instance
|
1397 |
-
jQuery.data( this, 'isotope', new jQuery.Isotope( options, this, callback ) );
|
1398 |
-
}
|
1399 |
-
});
|
1400 |
-
}
|
1401 |
-
// return jQuery object
|
1402 |
-
// so plugin methods do not have to
|
1403 |
-
return this;
|
1404 |
-
};
|
1405 |
-
|
1406 |
})( window, jQuery );
|
1 |
+
/**
|
2 |
+
* Isotope v1.5.23
|
3 |
+
* An exquisite jQuery plugin for magical layouts
|
4 |
+
* http://isotope.metafizzy.co
|
5 |
+
*
|
6 |
+
* Commercial use requires one-time license fee
|
7 |
+
* http://metafizzy.co/#licenses
|
8 |
+
*
|
9 |
+
* Copyright 2012 David DeSandro / Metafizzy
|
10 |
+
*/
|
11 |
+
|
12 |
+
/*jshint asi: true, browser: true, curly: true, eqeqeq: true, forin: false, immed: false, newcap: true, noempty: true, strict: true, undef: true */
|
13 |
+
/*global jQuery: false */
|
14 |
+
|
15 |
+
(function( window, $, undefined ){
|
16 |
+
|
17 |
+
'use strict';
|
18 |
+
|
19 |
+
// get global vars
|
20 |
+
var document = window.document;
|
21 |
+
var Modernizr = window.Modernizr;
|
22 |
+
|
23 |
+
// helper function
|
24 |
+
var capitalize = function( str ) {
|
25 |
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
26 |
+
};
|
27 |
+
|
28 |
+
// ========================= getStyleProperty by kangax ===============================
|
29 |
+
// http://perfectionkills.com/feature-testing-css-properties/
|
30 |
+
|
31 |
+
var prefixes = 'Moz Webkit O Ms'.split(' ');
|
32 |
+
|
33 |
+
var getStyleProperty = function( propName ) {
|
34 |
+
var style = document.documentElement.style,
|
35 |
+
prefixed;
|
36 |
+
|
37 |
+
// test standard property first
|
38 |
+
if ( typeof style[propName] === 'string' ) {
|
39 |
+
return propName;
|
40 |
+
}
|
41 |
+
|
42 |
+
// capitalize
|
43 |
+
propName = capitalize( propName );
|
44 |
+
|
45 |
+
// test vendor specific properties
|
46 |
+
for ( var i=0, len = prefixes.length; i < len; i++ ) {
|
47 |
+
prefixed = prefixes[i] + propName;
|
48 |
+
if ( typeof style[ prefixed ] === 'string' ) {
|
49 |
+
return prefixed;
|
50 |
+
}
|
51 |
+
}
|
52 |
+
};
|
53 |
+
|
54 |
+
var transformProp = getStyleProperty('transform'),
|
55 |
+
transitionProp = getStyleProperty('transitionProperty');
|
56 |
+
|
57 |
+
|
58 |
+
// ========================= miniModernizr ===============================
|
59 |
+
// <3<3<3 and thanks to Faruk and Paul for doing the heavy lifting
|
60 |
+
|
61 |
+
/*!
|
62 |
+
* Modernizr v1.6ish: miniModernizr for Isotope
|
63 |
+
* http://www.modernizr.com
|
64 |
+
*
|
65 |
+
* Developed by:
|
66 |
+
* - Faruk Ates http://farukat.es/
|
67 |
+
* - Paul Irish http://paulirish.com/
|
68 |
+
*
|
69 |
+
* Copyright (c) 2009-2010
|
70 |
+
* Dual-licensed under the BSD or MIT licenses.
|
71 |
+
* http://www.modernizr.com/license/
|
72 |
+
*/
|
73 |
+
|
74 |
+
/*
|
75 |
+
* This version whittles down the script just to check support for
|
76 |
+
* CSS transitions, transforms, and 3D transforms.
|
77 |
+
*/
|
78 |
+
|
79 |
+
var tests = {
|
80 |
+
csstransforms: function() {
|
81 |
+
return !!transformProp;
|
82 |
+
},
|
83 |
+
|
84 |
+
csstransforms3d: function() {
|
85 |
+
var test = !!getStyleProperty('perspective');
|
86 |
+
// double check for Chrome's false positive
|
87 |
+
if ( test ) {
|
88 |
+
var vendorCSSPrefixes = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '),
|
89 |
+
mediaQuery = '@media (' + vendorCSSPrefixes.join('transform-3d),(') + 'modernizr)',
|
90 |
+
$style = $('<style>' + mediaQuery + '{#modernizr{height:3px}}' + '</style>')
|
91 |
+
.appendTo('head'),
|
92 |
+
$div = $('<div id="modernizr" />').appendTo('html');
|
93 |
+
|
94 |
+
test = $div.height() === 3;
|
95 |
+
|
96 |
+
$div.remove();
|
97 |
+
$style.remove();
|
98 |
+
}
|
99 |
+
return test;
|
100 |
+
},
|
101 |
+
|
102 |
+
csstransitions: function() {
|
103 |
+
return !!transitionProp;
|
104 |
+
}
|
105 |
+
};
|
106 |
+
|
107 |
+
var testName;
|
108 |
+
|
109 |
+
if ( Modernizr ) {
|
110 |
+
// if there's a previous Modernzir, check if there are necessary tests
|
111 |
+
for ( testName in tests) {
|
112 |
+
if ( !Modernizr.hasOwnProperty( testName ) ) {
|
113 |
+
// if test hasn't been run, use addTest to run it
|
114 |
+
Modernizr.addTest( testName, tests[ testName ] );
|
115 |
+
}
|
116 |
+
}
|
117 |
+
} else {
|
118 |
+
// or create new mini Modernizr that just has the 3 tests
|
119 |
+
Modernizr = window.Modernizr = {
|
120 |
+
_version : '1.6ish: miniModernizr for Isotope'
|
121 |
+
};
|
122 |
+
|
123 |
+
var classes = ' ';
|
124 |
+
var result;
|
125 |
+
|
126 |
+
// Run through tests
|
127 |
+
for ( testName in tests) {
|
128 |
+
result = tests[ testName ]();
|
129 |
+
Modernizr[ testName ] = result;
|
130 |
+
classes += ' ' + ( result ? '' : 'no-' ) + testName;
|
131 |
+
}
|
132 |
+
|
133 |
+
// Add the new classes to the <html> element.
|
134 |
+
$('html').addClass( classes );
|
135 |
+
}
|
136 |
+
|
137 |
+
|
138 |
+
// ========================= isoTransform ===============================
|
139 |
+
|
140 |
+
/**
|
141 |
+
* provides hooks for .css({ scale: value, translate: [x, y] })
|
142 |
+
* Progressively enhanced CSS transforms
|
143 |
+
* Uses hardware accelerated 3D transforms for Safari
|
144 |
+
* or falls back to 2D transforms.
|
145 |
+
*/
|
146 |
+
|
147 |
+
if ( Modernizr.csstransforms ) {
|
148 |
+
|
149 |
+
// i.e. transformFnNotations.scale(0.5) >> 'scale3d( 0.5, 0.5, 1)'
|
150 |
+
var transformFnNotations = Modernizr.csstransforms3d ?
|
151 |
+
{ // 3D transform functions
|
152 |
+
translate : function ( position ) {
|
153 |
+
return 'translate3d(' + position[0] + 'px, ' + position[1] + 'px, 0) ';
|
154 |
+
},
|
155 |
+
scale : function ( scale ) {
|
156 |
+
return 'scale3d(' + scale + ', ' + scale + ', 1) ';
|
157 |
+
}
|
158 |
+
} :
|
159 |
+
{ // 2D transform functions
|
160 |
+
translate : function ( position ) {
|
161 |
+
return 'translate(' + position[0] + 'px, ' + position[1] + 'px) ';
|
162 |
+
},
|
163 |
+
scale : function ( scale ) {
|
164 |
+
return 'scale(' + scale + ') ';
|
165 |
+
}
|
166 |
+
}
|
167 |
+
;
|
168 |
+
|
169 |
+
var setIsoTransform = function ( elem, name, value ) {
|
170 |
+
// unpack current transform data
|
171 |
+
var data = jQuery.data( elem, 'isoTransform' ) || {},
|
172 |
+
newData = {},
|
173 |
+
fnName,
|
174 |
+
transformObj = {},
|
175 |
+
transformValue;
|
176 |
+
|
177 |
+
// i.e. newData.scale = 0.5
|
178 |
+
newData[ name ] = value;
|
179 |
+
// extend new value over current data
|
180 |
+
jQuery.extend( data, newData );
|
181 |
+
|
182 |
+
for ( fnName in data ) {
|
183 |
+
transformValue = data[ fnName ];
|
184 |
+
transformObj[ fnName ] = transformFnNotations[ fnName ]( transformValue );
|
185 |
+
}
|
186 |
+
|
187 |
+
// get proper order
|
188 |
+
// ideally, we could loop through this give an array, but since we only have
|
189 |
+
// a couple transforms we're keeping track of, we'll do it like so
|
190 |
+
var translateFn = transformObj.translate || '',
|
191 |
+
scaleFn = transformObj.scale || '',
|
192 |
+
// sorting so translate always comes first
|
193 |
+
valueFns = translateFn + scaleFn;
|
194 |
+
|
195 |
+
// set data back in elem
|
196 |
+
jQuery.data( elem, 'isoTransform', data );
|
197 |
+
|
198 |
+
// set name to vendor specific property
|
199 |
+
elem.style[ transformProp ] = valueFns;
|
200 |
+
};
|
201 |
+
|
202 |
+
// ==================== scale ===================
|
203 |
+
|
204 |
+
jQuery.cssNumber.scale = true;
|
205 |
+
|
206 |
+
jQuery.cssHooks.scale = {
|
207 |
+
set: function( elem, value ) {
|
208 |
+
// uncomment this bit if you want to properly parse strings
|
209 |
+
// if ( typeof value === 'string' ) {
|
210 |
+
// value = parseFloat( value );
|
211 |
+
// }
|
212 |
+
setIsoTransform( elem, 'scale', value );
|
213 |
+
},
|
214 |
+
get: function( elem, computed ) {
|
215 |
+
var transform = jQuery.data( elem, 'isoTransform' );
|
216 |
+
return transform && transform.scale ? transform.scale : 1;
|
217 |
+
}
|
218 |
+
};
|
219 |
+
|
220 |
+
jQuery.fx.step.scale = function( fx ) {
|
221 |
+
jQuery.cssHooks.scale.set( fx.elem, fx.now+fx.unit );
|
222 |
+
};
|
223 |
+
|
224 |
+
|
225 |
+
// ==================== translate ===================
|
226 |
+
|
227 |
+
jQuery.cssNumber.translate = true;
|
228 |
+
|
229 |
+
jQuery.cssHooks.translate = {
|
230 |
+
set: function( elem, value ) {
|
231 |
+
|
232 |
+
// uncomment this bit if you want to properly parse strings
|
233 |
+
// if ( typeof value === 'string' ) {
|
234 |
+
// value = value.split(' ');
|
235 |
+
// }
|
236 |
+
//
|
237 |
+
// var i, val;
|
238 |
+
// for ( i = 0; i < 2; i++ ) {
|
239 |
+
// val = value[i];
|
240 |
+
// if ( typeof val === 'string' ) {
|
241 |
+
// val = parseInt( val );
|
242 |
+
// }
|
243 |
+
// }
|
244 |
+
|
245 |
+
setIsoTransform( elem, 'translate', value );
|
246 |
+
},
|
247 |
+
|
248 |
+
get: function( elem, computed ) {
|
249 |
+
var transform = jQuery.data( elem, 'isoTransform' );
|
250 |
+
return transform && transform.translate ? transform.translate : [ 0, 0 ];
|
251 |
+
}
|
252 |
+
};
|
253 |
+
|
254 |
+
}
|
255 |
+
|
256 |
+
// ========================= get transition-end event ===============================
|
257 |
+
var transitionEndEvent, transitionDurProp;
|
258 |
+
|
259 |
+
if ( Modernizr.csstransitions ) {
|
260 |
+
transitionEndEvent = {
|
261 |
+
WebkitTransitionProperty: 'webkitTransitionEnd', // webkit
|
262 |
+
MozTransitionProperty: 'transitionend',
|
263 |
+
OTransitionProperty: 'oTransitionEnd otransitionend',
|
264 |
+
transitionProperty: 'transitionend'
|
265 |
+
}[ transitionProp ];
|
266 |
+
|
267 |
+
transitionDurProp = getStyleProperty('transitionDuration');
|
268 |
+
}
|
269 |
+
|
270 |
+
// ========================= smartresize ===============================
|
271 |
+
|
272 |
+
/*
|
273 |
+
* smartresize: debounced resize event for jQuery
|
274 |
+
*
|
275 |
+
* latest version and complete README available on Github:
|
276 |
+
* https://github.com/louisremi/jquery.smartresize.js
|
277 |
+
*
|
278 |
+
* Copyright 2011 @louis_remi
|
279 |
+
* Licensed under the MIT license.
|
280 |
+
*/
|
281 |
+
|
282 |
+
var $event = jQuery.event,
|
283 |
+
resizeTimeout;
|
284 |
+
|
285 |
+
$event.special.smartresize = {
|
286 |
+
setup: function() {
|
287 |
+
$(this).bind( "resize", $event.special.smartresize.handler );
|
288 |
+
},
|
289 |
+
teardown: function() {
|
290 |
+
$(this).unbind( "resize", $event.special.smartresize.handler );
|
291 |
+
},
|
292 |
+
handler: function( event, execAsap ) {
|
293 |
+
// Save the context
|
294 |
+
var context = this,
|
295 |
+
args = arguments;
|
296 |
+
|
297 |
+
// set correct event type
|
298 |
+
event.type = "smartresize";
|
299 |
+
|
300 |
+
if ( resizeTimeout ) { clearTimeout( resizeTimeout ); }
|
301 |
+
resizeTimeout = setTimeout(function() {
|
302 |
+
jQuery.event.handle.apply( context, args );
|
303 |
+
}, execAsap === "execAsap"? 0 : 100 );
|
304 |
+
}
|
305 |
+
};
|
306 |
+
|
307 |
+
jQuery.fn.smartresize = function( fn ) {
|
308 |
+
return fn ? this.bind( "smartresize", fn ) : this.trigger( "smartresize", ["execAsap"] );
|
309 |
+
};
|
310 |
+
|
311 |
+
|
312 |
+
|
313 |
+
// ========================= Isotope ===============================
|
314 |
+
|
315 |
+
|
316 |
+
// our "Widget" object constructor
|
317 |
+
jQuery.Isotope = function( options, element, callback ){
|
318 |
+
this.element = $( element );
|
319 |
+
|
320 |
+
this._create( options );
|
321 |
+
this._init( callback );
|
322 |
+
};
|
323 |
+
|
324 |
+
// styles of container element we want to keep track of
|
325 |
+
var isoContainerStyles = [ 'width', 'height' ];
|
326 |
+
|
327 |
+
var $window = $(window);
|
328 |
+
|
329 |
+
jQuery.Isotope.settings = {
|
330 |
+
resizable: true,
|
331 |
+
layoutMode : 'masonry',
|
332 |
+
containerClass : 'isotope',
|
333 |
+
itemClass : 'isotope-item',
|
334 |
+
hiddenClass : 'isotope-hidden',
|
335 |
+
hiddenStyle: { opacity: 0, scale: 0.001 },
|
336 |
+
visibleStyle: { opacity: 1, scale: 1 },
|
337 |
+
containerStyle: {
|
338 |
+
position: 'relative',
|
339 |
+
overflow: 'hidden'
|
340 |
+
},
|
341 |
+
animationEngine: 'best-available',
|
342 |
+
animationOptions: {
|
343 |
+
queue: false,
|
344 |
+
duration: 800
|
345 |
+
},
|
346 |
+
sortBy : 'original-order',
|
347 |
+
sortAscending : true,
|
348 |
+
resizesContainer : true,
|
349 |
+
transformsEnabled: true,
|
350 |
+
itemPositionDataEnabled: false
|
351 |
+
};
|
352 |
+
|
353 |
+
jQuery.Isotope.prototype = {
|
354 |
+
|
355 |
+
// sets up widget
|
356 |
+
_create : function( options ) {
|
357 |
+
|
358 |
+
this.options = jQuery.extend( {}, jQuery.Isotope.settings, options );
|
359 |
+
|
360 |
+
this.styleQueue = [];
|
361 |
+
this.elemCount = 0;
|
362 |
+
|
363 |
+
// get original styles in case we re-apply them in .destroy()
|
364 |
+
var elemStyle = this.element[0].style;
|
365 |
+
this.originalStyle = {};
|
366 |
+
// keep track of container styles
|
367 |
+
var containerStyles = isoContainerStyles.slice(0);
|
368 |
+
for ( var prop in this.options.containerStyle ) {
|
369 |
+
containerStyles.push( prop );
|
370 |
+
}
|
371 |
+
for ( var i=0, len = containerStyles.length; i < len; i++ ) {
|
372 |
+
prop = containerStyles[i];
|
373 |
+
this.originalStyle[ prop ] = elemStyle[ prop ] || '';
|
374 |
+
}
|
375 |
+
// apply container style from options
|
376 |
+
this.element.css( this.options.containerStyle );
|
377 |
+
|
378 |
+
this._updateAnimationEngine();
|
379 |
+
this._updateUsingTransforms();
|
380 |
+
|
381 |
+
// sorting
|
382 |
+
var originalOrderSorter = {
|
383 |
+
'original-order' : function( $elem, instance ) {
|
384 |
+
instance.elemCount ++;
|
385 |
+
return instance.elemCount;
|
386 |
+
},
|
387 |
+
random : function() {
|
388 |
+
return Math.random();
|
389 |
+
}
|
390 |
+
};
|
391 |
+
|
392 |
+
this.options.getSortData = jQuery.extend( this.options.getSortData, originalOrderSorter );
|
393 |
+
|
394 |
+
// need to get atoms
|
395 |
+
this.reloadItems();
|
396 |
+
|
397 |
+
// get top left position of where the bricks should be
|
398 |
+
this.offset = {
|
399 |
+
left: parseInt( ( this.element.css('padding-left') || 0 ), 10 ),
|
400 |
+
top: parseInt( ( this.element.css('padding-top') || 0 ), 10 )
|
401 |
+
};
|
402 |
+
|
403 |
+
// add isotope class first time around
|
404 |
+
var instance = this;
|
405 |
+
setTimeout( function() {
|
406 |
+
instance.element.addClass( instance.options.containerClass );
|
407 |
+
}, 0 );
|
408 |
+
|
409 |
+
// bind resize method
|
410 |
+
if ( this.options.resizable ) {
|
411 |
+
$window.bind( 'smartresize.isotope', function() {
|
412 |
+
instance.resize();
|
413 |
+
});
|
414 |
+
}
|
415 |
+
|
416 |
+
// dismiss all click events from hidden events
|
417 |
+
this.element.delegate( '.' + this.options.hiddenClass, 'click', function(){
|
418 |
+
return false;
|
419 |
+
});
|
420 |
+
|
421 |
+
},
|
422 |
+
|
423 |
+
_getAtoms : function( $elems ) {
|
424 |
+
var selector = this.options.itemSelector,
|
425 |
+
// filter & find
|
426 |
+
$atoms = selector ? $elems.filter( selector ).add( $elems.find( selector ) ) : $elems,
|
427 |
+
// base style for atoms
|
428 |
+
atomStyle = { position: 'absolute' };
|
429 |
+
|
430 |
+
// filter out text nodes
|
431 |
+
$atoms = $atoms.filter( function( i, atom ) {
|
432 |
+
return atom.nodeType === 1;
|
433 |
+
});
|
434 |
+
|
435 |
+
if ( this.usingTransforms ) {
|
436 |
+
atomStyle.left = 0;
|
437 |
+
atomStyle.top = 0;
|
438 |
+
}
|
439 |
+
|
440 |
+
$atoms.css( atomStyle ).addClass( this.options.itemClass );
|
441 |
+
|
442 |
+
this.updateSortData( $atoms, true );
|
443 |
+
|
444 |
+
return $atoms;
|
445 |
+
},
|
446 |
+
|
447 |
+
// _init fires when your instance is first created
|
448 |
+
// (from the constructor above), and when you
|
449 |
+
// attempt to initialize the widget again (by the bridge)
|
450 |
+
// after it has already been initialized.
|
451 |
+
_init : function( callback ) {
|
452 |
+
|
453 |
+
this.$filteredAtoms = this._filter( this.$allAtoms );
|
454 |
+
this._sort();
|
455 |
+
this.reLayout( callback );
|
456 |
+
|
457 |
+
},
|
458 |
+
|
459 |
+
option : function( opts ){
|
460 |
+
// change options AFTER initialization:
|
461 |
+
// signature: $('#foo').bar({ cool:false });
|
462 |
+
if ( jQuery.isPlainObject( opts ) ){
|
463 |
+
this.options = jQuery.extend( true, this.options, opts );
|
464 |
+
|
465 |
+
// trigger _updateOptionName if it exists
|
466 |
+
var updateOptionFn;
|
467 |
+
for ( var optionName in opts ) {
|
468 |
+
updateOptionFn = '_update' + capitalize( optionName );
|
469 |
+
if ( this[ updateOptionFn ] ) {
|
470 |
+
this[ updateOptionFn ]();
|
471 |
+
}
|
472 |
+
}
|
473 |
+
}
|
474 |
+
},
|
475 |
+
|
476 |
+
// ====================== updaters ====================== //
|
477 |
+
// kind of like setters
|
478 |
+
|
479 |
+
_updateAnimationEngine : function() {
|
480 |
+
var animationEngine = this.options.animationEngine.toLowerCase().replace( /[ _\-]/g, '');
|
481 |
+
var isUsingJQueryAnimation;
|
482 |
+
// set applyStyleFnName
|
483 |
+
switch ( animationEngine ) {
|
484 |
+
case 'css' :
|
485 |
+
case 'none' :
|
486 |
+
isUsingJQueryAnimation = false;
|
487 |
+
break;
|
488 |
+
case 'jquery' :
|
489 |
+
isUsingJQueryAnimation = true;
|
490 |
+
break;
|
491 |
+
default : // best available
|
492 |
+
isUsingJQueryAnimation = !Modernizr.csstransitions;
|
493 |
+
}
|
494 |
+
this.isUsingJQueryAnimation = isUsingJQueryAnimation;
|
495 |
+
this._updateUsingTransforms();
|
496 |
+
},
|
497 |
+
|
498 |
+
_updateTransformsEnabled : function() {
|
499 |
+
this._updateUsingTransforms();
|
500 |
+
},
|
501 |
+
|
502 |
+
_updateUsingTransforms : function() {
|
503 |
+
var usingTransforms = this.usingTransforms = this.options.transformsEnabled &&
|
504 |
+
Modernizr.csstransforms && Modernizr.csstransitions && !this.isUsingJQueryAnimation;
|
505 |
+
|
506 |
+
// prevent scales when transforms are disabled
|
507 |
+
if ( !usingTransforms ) {
|
508 |
+
delete this.options.hiddenStyle.scale;
|
509 |
+
delete this.options.visibleStyle.scale;
|
510 |
+
}
|
511 |
+
|
512 |
+
this.getPositionStyles = usingTransforms ? this._translate : this._positionAbs;
|
513 |
+
},
|
514 |
+
|
515 |
+
|
516 |
+
// ====================== Filtering ======================
|
517 |
+
|
518 |
+
_filter : function( $atoms ) {
|
519 |
+
var filter = this.options.filter === '' ? '*' : this.options.filter;
|
520 |
+
|
521 |
+
if ( !filter ) {
|
522 |
+
return $atoms;
|
523 |
+
}
|
524 |
+
|
525 |
+
var hiddenClass = this.options.hiddenClass,
|
526 |
+
hiddenSelector = '.' + hiddenClass,
|
527 |
+
$hiddenAtoms = $atoms.filter( hiddenSelector ),
|
528 |
+
$atomsToShow = $hiddenAtoms;
|
529 |
+
|
530 |
+
if ( filter !== '*' ) {
|
531 |
+
$atomsToShow = $hiddenAtoms.filter( filter );
|
532 |
+
var $atomsToHide = $atoms.not( hiddenSelector ).not( filter ).addClass( hiddenClass );
|
533 |
+
this.styleQueue.push({ $el: $atomsToHide, style: this.options.hiddenStyle });
|
534 |
+
}
|
535 |
+
|
536 |
+
this.styleQueue.push({ $el: $atomsToShow, style: this.options.visibleStyle });
|
537 |
+
$atomsToShow.removeClass( hiddenClass );
|
538 |
+
|
539 |
+
return $atoms.filter( filter );
|
540 |
+
},
|
541 |
+
|
542 |
+
// ====================== Sorting ======================
|
543 |
+
|
544 |
+
updateSortData : function( $atoms, isIncrementingElemCount ) {
|
545 |
+
var instance = this,
|
546 |
+
getSortData = this.options.getSortData,
|
547 |
+
$this, sortData;
|
548 |
+
$atoms.each(function(){
|
549 |
+
$this = $(this);
|
550 |
+
sortData = {};
|
551 |
+
// get value for sort data based on fn( $elem ) passed in
|
552 |
+
for ( var key in getSortData ) {
|
553 |
+
if ( !isIncrementingElemCount && key === 'original-order' ) {
|
554 |
+
// keep original order original
|
555 |
+
sortData[ key ] = jQuery.data( this, 'isotope-sort-data' )[ key ];
|
556 |
+
} else {
|
557 |
+
sortData[ key ] = getSortData[ key ]( $this, instance );
|
558 |
+
}
|
559 |
+
}
|
560 |
+
// apply sort data to element
|
561 |
+
jQuery.data( this, 'isotope-sort-data', sortData );
|
562 |
+
});
|
563 |
+
},
|
564 |
+
|
565 |
+
// used on all the filtered atoms
|
566 |
+
_sort : function() {
|
567 |
+
|
568 |
+
var sortBy = this.options.sortBy,
|
569 |
+
getSorter = this._getSorter,
|
570 |
+
sortDir = this.options.sortAscending ? 1 : -1,
|
571 |
+
sortFn = function( alpha, beta ) {
|
572 |
+
var a = getSorter( alpha, sortBy ),
|
573 |
+
b = getSorter( beta, sortBy );
|
574 |
+
// fall back to original order if data matches
|
575 |
+
if ( a === b && sortBy !== 'original-order') {
|
576 |
+
a = getSorter( alpha, 'original-order' );
|
577 |
+
b = getSorter( beta, 'original-order' );
|
578 |
+
}
|
579 |
+
return ( ( a > b ) ? 1 : ( a < b ) ? -1 : 0 ) * sortDir;
|
580 |
+
};
|
581 |
+
|
582 |
+
this.$filteredAtoms.sort( sortFn );
|
583 |
+
},
|
584 |
+
|
585 |
+
_getSorter : function( elem, sortBy ) {
|
586 |
+
return jQuery.data( elem, 'isotope-sort-data' )[ sortBy ];
|
587 |
+
},
|
588 |
+
|
589 |
+
// ====================== Layout Helpers ======================
|
590 |
+
|
591 |
+
_translate : function( x, y ) {
|
592 |
+
return { translate : [ x, y ] };
|
593 |
+
},
|
594 |
+
|
595 |
+
_positionAbs : function( x, y ) {
|
596 |
+
return { left: x, top: y };
|
597 |
+
},
|
598 |
+
|
599 |
+
_pushPosition : function( $elem, x, y ) {
|
600 |
+
x = Math.round( x + this.offset.left );
|
601 |
+
y = Math.round( y + this.offset.top );
|
602 |
+
var position = this.getPositionStyles( x, y );
|
603 |
+
this.styleQueue.push({ $el: $elem, style: position });
|
604 |
+
if ( this.options.itemPositionDataEnabled ) {
|
605 |
+
$elem.data('isotope-item-position', {x: x, y: y} );
|
606 |
+
}
|
607 |
+
},
|
608 |
+
|
609 |
+
|
610 |
+
// ====================== General Layout ======================
|
611 |
+
|
612 |
+
// used on collection of atoms (should be filtered, and sorted before )
|
613 |
+
// accepts atoms-to-be-laid-out to start with
|
614 |
+
layout : function( $elems, callback ) {
|
615 |
+
|
616 |
+
var layoutMode = this.options.layoutMode;
|
617 |
+
|
618 |
+
// layout logic
|
619 |
+
this[ '_' + layoutMode + 'Layout' ]( $elems );
|
620 |
+
|
621 |
+
// set the size of the container
|
622 |
+
if ( this.options.resizesContainer ) {
|
623 |
+
var containerStyle = this[ '_' + layoutMode + 'GetContainerSize' ]();
|
624 |
+
this.styleQueue.push({ $el: this.element, style: containerStyle });
|
625 |
+
}
|
626 |
+
|
627 |
+
this._processStyleQueue( $elems, callback );
|
628 |
+
|
629 |
+
this.isLaidOut = true;
|
630 |
+
},
|
631 |
+
|
632 |
+
_processStyleQueue : function( $elems, callback ) {
|
633 |
+
// are we animating the layout arrangement?
|
634 |
+
// use plugin-ish syntax for css or animate
|
635 |
+
var styleFn = !this.isLaidOut ? 'css' : (
|
636 |
+
this.isUsingJQueryAnimation ? 'animate' : 'css'
|
637 |
+
),
|
638 |
+
animOpts = this.options.animationOptions,
|
639 |
+
onLayout = this.options.onLayout,
|
640 |
+
objStyleFn, processor,
|
641 |
+
triggerCallbackNow, callbackFn;
|
642 |
+
|
643 |
+
// default styleQueue processor, may be overwritten down below
|
644 |
+
processor = function( i, obj ) {
|
645 |
+
obj.$el[ styleFn ]( obj.style, animOpts );
|
646 |
+
};
|
647 |
+
|
648 |
+
if ( this._isInserting && this.isUsingJQueryAnimation ) {
|
649 |
+
// if using styleQueue to insert items
|
650 |
+
processor = function( i, obj ) {
|
651 |
+
// only animate if it not being inserted
|
652 |
+
objStyleFn = obj.$el.hasClass('no-transition') ? 'css' : styleFn;
|
653 |
+
obj.$el[ objStyleFn ]( obj.style, animOpts );
|
654 |
+
};
|
655 |
+
|
656 |
+
} else if ( callback || onLayout || animOpts.complete ) {
|
657 |
+
// has callback
|
658 |
+
var isCallbackTriggered = false,
|
659 |
+
// array of possible callbacks to trigger
|
660 |
+
callbacks = [ callback, onLayout, animOpts.complete ],
|
661 |
+
instance = this;
|
662 |
+
triggerCallbackNow = true;
|
663 |
+
// trigger callback only once
|
664 |
+
callbackFn = function() {
|
665 |
+
if ( isCallbackTriggered ) {
|
666 |
+
return;
|
667 |
+
}
|
668 |
+
var hollaback;
|
669 |
+
for (var i=0, len = callbacks.length; i < len; i++) {
|
670 |
+
hollaback = callbacks[i];
|
671 |
+
if ( typeof hollaback === 'function' ) {
|
672 |
+
hollaback.call( instance.element, $elems, instance );
|
673 |
+
}
|
674 |
+
}
|
675 |
+
isCallbackTriggered = true;
|
676 |
+
};
|
677 |
+
|
678 |
+
if ( this.isUsingJQueryAnimation && styleFn === 'animate' ) {
|
679 |
+
// add callback to animation options
|
680 |
+
animOpts.complete = callbackFn;
|
681 |
+
triggerCallbackNow = false;
|
682 |
+
|
683 |
+
} else if ( Modernizr.csstransitions ) {
|
684 |
+
// detect if first item has transition
|
685 |
+
var i = 0,
|
686 |
+
firstItem = this.styleQueue[0],
|
687 |
+
testElem = firstItem && firstItem.$el,
|
688 |
+
styleObj;
|
689 |
+
// get first non-empty jQ object
|
690 |
+
while ( !testElem || !testElem.length ) {
|
691 |
+
styleObj = this.styleQueue[ i++ ];
|
692 |
+
// HACK: sometimes styleQueue[i] is undefined
|
693 |
+
if ( !styleObj ) {
|
694 |
+
return;
|
695 |
+
}
|
696 |
+
testElem = styleObj.$el;
|
697 |
+
}
|
698 |
+
// get transition duration of the first element in that object
|
699 |
+
// yeah, this is inexact
|
700 |
+
var duration = parseFloat( getComputedStyle( testElem[0] )[ transitionDurProp ] );
|
701 |
+
if ( duration > 0 ) {
|
702 |
+
processor = function( i, obj ) {
|
703 |
+
obj.$el[ styleFn ]( obj.style, animOpts )
|
704 |
+
// trigger callback at transition end
|
705 |
+
.one( transitionEndEvent, callbackFn );
|
706 |
+
};
|
707 |
+
triggerCallbackNow = false;
|
708 |
+
}
|
709 |
+
}
|
710 |
+
}
|
711 |
+
|
712 |
+
// process styleQueue
|
713 |
+
jQuery.each( this.styleQueue, processor );
|
714 |
+
|
715 |
+
if ( triggerCallbackNow ) {
|
716 |
+
callbackFn();
|
717 |
+
}
|
718 |
+
|
719 |
+
// clear out queue for next time
|
720 |
+
this.styleQueue = [];
|
721 |
+
},
|
722 |
+
|
723 |
+
|
724 |
+
resize : function() {
|
725 |
+
if ( this[ '_' + this.options.layoutMode + 'ResizeChanged' ]() ) {
|
726 |
+
this.reLayout();
|
727 |
+
}
|
728 |
+
},
|
729 |
+
|
730 |
+
|
731 |
+
reLayout : function( callback ) {
|
732 |
+
|
733 |
+
this[ '_' + this.options.layoutMode + 'Reset' ]();
|
734 |
+
this.layout( this.$filteredAtoms, callback );
|
735 |
+
|
736 |
+
},
|
737 |
+
|
738 |
+
// ====================== Convenience methods ======================
|
739 |
+
|
740 |
+
// ====================== Adding items ======================
|
741 |
+
|
742 |
+
// adds a jQuery object of items to a isotope container
|
743 |
+
addItems : function( $content, callback ) {
|
744 |
+
var $newAtoms = this._getAtoms( $content );
|
745 |
+
// add new atoms to atoms pools
|
746 |
+
this.$allAtoms = this.$allAtoms.add( $newAtoms );
|
747 |
+
|
748 |
+
if ( callback ) {
|
749 |
+
callback( $newAtoms );
|
750 |
+
}
|
751 |
+
},
|
752 |
+
|
753 |
+
// convienence method for adding elements properly to any layout
|
754 |
+
// positions items, hides them, then animates them back in <--- very sezzy
|
755 |
+
insert : function( $content, callback ) {
|
756 |
+
// position items
|
757 |
+
this.element.append( $content );
|
758 |
+
|
759 |
+
var instance = this;
|
760 |
+
this.addItems( $content, function( $newAtoms ) {
|
761 |
+
var $newFilteredAtoms = instance._filter( $newAtoms );
|
762 |
+
instance._addHideAppended( $newFilteredAtoms );
|
763 |
+
instance._sort();
|
764 |
+
instance.reLayout();
|
765 |
+
instance._revealAppended( $newFilteredAtoms, callback );
|
766 |
+
});
|
767 |
+
|
768 |
+
},
|
769 |
+
|
770 |
+
// convienence method for working with Infinite Scroll
|
771 |
+
appended : function( $content, callback ) {
|
772 |
+
var instance = this;
|
773 |
+
this.addItems( $content, function( $newAtoms ) {
|
774 |
+
instance._addHideAppended( $newAtoms );
|
775 |
+
instance.layout( $newAtoms );
|
776 |
+
instance._revealAppended( $newAtoms, callback );
|
777 |
+
});
|
778 |
+
},
|
779 |
+
|
780 |
+
// adds new atoms, then hides them before positioning
|
781 |
+
_addHideAppended : function( $newAtoms ) {
|
782 |
+
this.$filteredAtoms = this.$filteredAtoms.add( $newAtoms );
|
783 |
+
$newAtoms.addClass('no-transition');
|
784 |
+
|
785 |
+
this._isInserting = true;
|
786 |
+
|
787 |
+
// apply hidden styles
|
788 |
+
this.styleQueue.push({ $el: $newAtoms, style: this.options.hiddenStyle });
|
789 |
+
},
|
790 |
+
|
791 |
+
// sets visible style on new atoms
|
792 |
+
_revealAppended : function( $newAtoms, callback ) {
|
793 |
+
var instance = this;
|
794 |
+
// apply visible style after a sec
|
795 |
+
setTimeout( function() {
|
796 |
+
// enable animation
|
797 |
+
$newAtoms.removeClass('no-transition');
|
798 |
+
// reveal newly inserted filtered elements
|
799 |
+
instance.styleQueue.push({ $el: $newAtoms, style: instance.options.visibleStyle });
|
800 |
+
instance._isInserting = false;
|
801 |
+
instance._processStyleQueue( $newAtoms, callback );
|
802 |
+
}, 10 );
|
803 |
+
},
|
804 |
+
|
805 |
+
// gathers all atoms
|
806 |
+
reloadItems : function() {
|
807 |
+
this.$allAtoms = this._getAtoms( this.element.children() );
|
808 |
+
},
|
809 |
+
|
810 |
+
// removes elements from Isotope widget
|
811 |
+
remove: function( $content, callback ) {
|
812 |
+
// remove elements immediately from Isotope instance
|
813 |
+
this.$allAtoms = this.$allAtoms.not( $content );
|
814 |
+
this.$filteredAtoms = this.$filteredAtoms.not( $content );
|
815 |
+
// remove() as a callback, for after transition / animation
|
816 |
+
var instance = this;
|
817 |
+
var removeContent = function() {
|
818 |
+
$content.remove();
|
819 |
+
if ( callback ) {
|
820 |
+
callback.call( instance.element );
|
821 |
+
}
|
822 |
+
};
|
823 |
+
|
824 |
+
if ( $content.filter( ':not(.' + this.options.hiddenClass + ')' ).length ) {
|
825 |
+
// if any non-hidden content needs to be removed
|
826 |
+
this.styleQueue.push({ $el: $content, style: this.options.hiddenStyle });
|
827 |
+
this._sort();
|
828 |
+
this.reLayout( removeContent );
|
829 |
+
} else {
|
830 |
+
// remove it now
|
831 |
+
removeContent();
|
832 |
+
}
|
833 |
+
|
834 |
+
},
|
835 |
+
|
836 |
+
shuffle : function( callback ) {
|
837 |
+
this.updateSortData( this.$allAtoms );
|
838 |
+
this.options.sortBy = 'random';
|
839 |
+
this._sort();
|
840 |
+
this.reLayout( callback );
|
841 |
+
},
|
842 |
+
|
843 |
+
// destroys widget, returns elements and container back (close) to original style
|
844 |
+
destroy : function() {
|
845 |
+
|
846 |
+
var usingTransforms = this.usingTransforms;
|
847 |
+
var options = this.options;
|
848 |
+
|
849 |
+
this.$allAtoms
|
850 |
+
.removeClass( options.hiddenClass + ' ' + options.itemClass )
|
851 |
+
.each(function(){
|
852 |
+
var style = this.style;
|
853 |
+
style.position = '';
|
854 |
+
style.top = '';
|
855 |
+
style.left = '';
|
856 |
+
style.opacity = '';
|
857 |
+
if ( usingTransforms ) {
|
858 |
+
style[ transformProp ] = '';
|
859 |
+
}
|
860 |
+
});
|
861 |
+
|
862 |
+
// re-apply saved container styles
|
863 |
+
var elemStyle = this.element[0].style;
|
864 |
+
for ( var prop in this.originalStyle ) {
|
865 |
+
elemStyle[ prop ] = this.originalStyle[ prop ];
|
866 |
+
}
|
867 |
+
|
868 |
+
this.element
|
869 |
+
.unbind('.isotope')
|
870 |
+
.undelegate( '.' + options.hiddenClass, 'click' )
|
871 |
+
.removeClass( options.containerClass )
|
872 |
+
.removeData('isotope');
|
873 |
+
|
874 |
+
$window.unbind('.isotope');
|
875 |
+
|
876 |
+
},
|
877 |
+
|
878 |
+
|
879 |
+
// ====================== LAYOUTS ======================
|
880 |
+
|
881 |
+
// calculates number of rows or columns
|
882 |
+
// requires columnWidth or rowHeight to be set on namespaced object
|
883 |
+
// i.e. this.masonry.columnWidth = 200
|
884 |
+
_getSegments : function( isRows ) {
|
885 |
+
var namespace = this.options.layoutMode,
|
886 |
+
measure = isRows ? 'rowHeight' : 'columnWidth',
|
887 |
+
size = isRows ? 'height' : 'width',
|
888 |
+
segmentsName = isRows ? 'rows' : 'cols',
|
889 |
+
containerSize = this.element[ size ](),
|
890 |
+
segments,
|
891 |
+
// i.e. options.masonry && options.masonry.columnWidth
|
892 |
+
segmentSize = this.options[ namespace ] && this.options[ namespace ][ measure ] ||
|
893 |
+
// or use the size of the first item, i.e. outerWidth
|
894 |
+
this.$filteredAtoms[ 'outer' + capitalize(size) ](true) ||
|
895 |
+
// if there's no items, use size of container
|
896 |
+
containerSize;
|
897 |
+
|
898 |
+
segments = Math.floor( containerSize / segmentSize );
|
899 |
+
segments = Math.max( segments, 1 );
|
900 |
+
|
901 |
+
// i.e. this.masonry.cols = ....
|
902 |
+
this[ namespace ][ segmentsName ] = segments;
|
903 |
+
// i.e. this.masonry.columnWidth = ...
|
904 |
+
this[ namespace ][ measure ] = segmentSize;
|
905 |
+
|
906 |
+
},
|
907 |
+
|
908 |
+
_checkIfSegmentsChanged : function( isRows ) {
|
909 |
+
var namespace = this.options.layoutMode,
|
910 |
+
segmentsName = isRows ? 'rows' : 'cols',
|
911 |
+
prevSegments = this[ namespace ][ segmentsName ];
|
912 |
+
// update cols/rows
|
913 |
+
this._getSegments( isRows );
|
914 |
+
// return if updated cols/rows is not equal to previous
|
915 |
+
return ( this[ namespace ][ segmentsName ] !== prevSegments );
|
916 |
+
},
|
917 |
+
|
918 |
+
// ====================== Masonry ======================
|
919 |
+
|
920 |
+
_masonryReset : function() {
|
921 |
+
// layout-specific props
|
922 |
+
this.masonry = {};
|
923 |
+
// FIXME shouldn't have to call this again
|
924 |
+
this._getSegments();
|
925 |
+
var i = this.masonry.cols;
|
926 |
+
this.masonry.colYs = [];
|
927 |
+
while (i--) {
|
928 |
+
this.masonry.colYs.push( 0 );
|
929 |
+
}
|
930 |
+
},
|
931 |
+
|
932 |
+
_masonryLayout : function( $elems ) {
|
933 |
+
var instance = this,
|
934 |
+
props = instance.masonry;
|
935 |
+
$elems.each(function(){
|
936 |
+
var $this = $(this),
|
937 |
+
//how many columns does this brick span
|
938 |
+
colSpan = Math.ceil( $this.outerWidth(true) / props.columnWidth );
|
939 |
+
colSpan = Math.min( colSpan, props.cols );
|
940 |
+
|
941 |
+
if ( colSpan === 1 ) {
|
942 |
+
// if brick spans only one column, just like singleMode
|
943 |
+
instance._masonryPlaceBrick( $this, props.colYs );
|
944 |
+
} else {
|
945 |
+
// brick spans more than one column
|
946 |
+
// how many different places could this brick fit horizontally
|
947 |
+
var groupCount = props.cols + 1 - colSpan,
|
948 |
+
groupY = [],
|
949 |
+
groupColY,
|
950 |
+
i;
|
951 |
+
|
952 |
+
// for each group potential horizontal position
|
953 |
+
for ( i=0; i < groupCount; i++ ) {
|
954 |
+
// make an array of colY values for that one group
|
955 |
+
groupColY = props.colYs.slice( i, i+colSpan );
|
956 |
+
// and get the max value of the array
|
957 |
+
groupY[i] = Math.max.apply( Math, groupColY );
|
958 |
+
}
|
959 |
+
|
960 |
+
instance._masonryPlaceBrick( $this, groupY );
|
961 |
+
}
|
962 |
+
});
|
963 |
+
},
|
964 |
+
|
965 |
+
// worker method that places brick in the columnSet
|
966 |
+
// with the the minY
|
967 |
+
_masonryPlaceBrick : function( $brick, setY ) {
|
968 |
+
// get the minimum Y value from the columns
|
969 |
+
var minimumY = Math.min.apply( Math, setY ),
|
970 |
+
shortCol = 0;
|
971 |
+
|
972 |
+
// Find index of short column, the first from the left
|
973 |
+
for (var i=0, len = setY.length; i < len; i++) {
|
974 |
+
if ( setY[i] === minimumY ) {
|
975 |
+
shortCol = i;
|
976 |
+
break;
|
977 |
+
}
|
978 |
+
}
|
979 |
+
|
980 |
+
// position the brick
|
981 |
+
var x = this.masonry.columnWidth * shortCol,
|
982 |
+
y = minimumY;
|
983 |
+
this._pushPosition( $brick, x, y );
|
984 |
+
|
985 |
+
// apply setHeight to necessary columns
|
986 |
+
var setHeight = minimumY + $brick.outerHeight(true),
|
987 |
+
setSpan = this.masonry.cols + 1 - len;
|
988 |
+
for ( i=0; i < setSpan; i++ ) {
|
989 |
+
this.masonry.colYs[ shortCol + i ] = setHeight;
|
990 |
+
}
|
991 |
+
|
992 |
+
},
|
993 |
+
|
994 |
+
_masonryGetContainerSize : function() {
|
995 |
+
var containerHeight = Math.max.apply( Math, this.masonry.colYs );
|
996 |
+
return { height: containerHeight };
|
997 |
+
},
|
998 |
+
|
999 |
+
_masonryResizeChanged : function() {
|
1000 |
+
return this._checkIfSegmentsChanged();
|
1001 |
+
},
|
1002 |
+
|
1003 |
+
// ====================== fitRows ======================
|
1004 |
+
|
1005 |
+
_fitRowsReset : function() {
|
1006 |
+
this.fitRows = {
|
1007 |
+
x : 0,
|
1008 |
+
y : 0,
|
1009 |
+
height : 0
|
1010 |
+
};
|
1011 |
+
},
|
1012 |
+
|
1013 |
+
_fitRowsLayout : function( $elems ) {
|
1014 |
+
var instance = this,
|
1015 |
+
containerWidth = this.element.width(),
|
1016 |
+
props = this.fitRows;
|
1017 |
+
|
1018 |
+
$elems.each( function() {
|
1019 |
+
var $this = $(this),
|
1020 |
+
atomW = $this.outerWidth(true),
|
1021 |
+
atomH = $this.outerHeight(true);
|
1022 |
+
|
1023 |
+
if ( props.x !== 0 && atomW + props.x > containerWidth ) {
|
1024 |
+
// if this element cannot fit in the current row
|
1025 |
+
props.x = 0;
|
1026 |
+
props.y = props.height;
|
1027 |
+
}
|
1028 |
+
|
1029 |
+
// position the atom
|
1030 |
+
instance._pushPosition( $this, props.x, props.y );
|
1031 |
+
|
1032 |
+
props.height = Math.max( props.y + atomH, props.height );
|
1033 |
+
props.x += atomW;
|
1034 |
+
|
1035 |
+
});
|
1036 |
+
},
|
1037 |
+
|
1038 |
+
_fitRowsGetContainerSize : function () {
|
1039 |
+
return { height : this.fitRows.height };
|
1040 |
+
},
|
1041 |
+
|
1042 |
+
_fitRowsResizeChanged : function() {
|
1043 |
+
return true;
|
1044 |
+
},
|
1045 |
+
|
1046 |
+
|
1047 |
+
// ====================== cellsByRow ======================
|
1048 |
+
|
1049 |
+
_cellsByRowReset : function() {
|
1050 |
+
this.cellsByRow = {
|
1051 |
+
index : 0
|
1052 |
+
};
|
1053 |
+
// get this.cellsByRow.columnWidth
|
1054 |
+
this._getSegments();
|
1055 |
+
// get this.cellsByRow.rowHeight
|
1056 |
+
this._getSegments(true);
|
1057 |
+
},
|
1058 |
+
|
1059 |
+
_cellsByRowLayout : function( $elems ) {
|
1060 |
+
var instance = this,
|
1061 |
+
props = this.cellsByRow;
|
1062 |
+
$elems.each( function(){
|
1063 |
+
var $this = $(this),
|
1064 |
+
col = props.index % props.cols,
|
1065 |
+
row = Math.floor( props.index / props.cols ),
|
1066 |
+
x = ( col + 0.5 ) * props.columnWidth - $this.outerWidth(true) / 2,
|
1067 |
+
y = ( row + 0.5 ) * props.rowHeight - $this.outerHeight(true) / 2;
|
1068 |
+
instance._pushPosition( $this, x, y );
|
1069 |
+
props.index ++;
|
1070 |
+
});
|
1071 |
+
},
|
1072 |
+
|
1073 |
+
_cellsByRowGetContainerSize : function() {
|
1074 |
+
return { height : Math.ceil( this.$filteredAtoms.length / this.cellsByRow.cols ) * this.cellsByRow.rowHeight + this.offset.top };
|
1075 |
+
},
|
1076 |
+
|
1077 |
+
_cellsByRowResizeChanged : function() {
|
1078 |
+
return this._checkIfSegmentsChanged();
|
1079 |
+
},
|
1080 |
+
|
1081 |
+
|
1082 |
+
// ====================== straightDown ======================
|
1083 |
+
|
1084 |
+
_straightDownReset : function() {
|
1085 |
+
this.straightDown = {
|
1086 |
+
y : 0
|
1087 |
+
};
|
1088 |
+
},
|
1089 |
+
|
1090 |
+
_straightDownLayout : function( $elems ) {
|
1091 |
+
var instance = this;
|
1092 |
+
$elems.each( function( i ){
|
1093 |
+
var $this = $(this);
|
1094 |
+
instance._pushPosition( $this, 0, instance.straightDown.y );
|
1095 |
+
instance.straightDown.y += $this.outerHeight(true);
|
1096 |
+
});
|
1097 |
+
},
|
1098 |
+
|
1099 |
+
_straightDownGetContainerSize : function() {
|
1100 |
+
return { height : this.straightDown.y };
|
1101 |
+
},
|
1102 |
+
|
1103 |
+
_straightDownResizeChanged : function() {
|
1104 |
+
return true;
|
1105 |
+
},
|
1106 |
+
|
1107 |
+
|
1108 |
+
// ====================== masonryHorizontal ======================
|
1109 |
+
|
1110 |
+
_masonryHorizontalReset : function() {
|
1111 |
+
// layout-specific props
|
1112 |
+
this.masonryHorizontal = {};
|
1113 |
+
// FIXME shouldn't have to call this again
|
1114 |
+
this._getSegments( true );
|
1115 |
+
var i = this.masonryHorizontal.rows;
|
1116 |
+
this.masonryHorizontal.rowXs = [];
|
1117 |
+
while (i--) {
|
1118 |
+
this.masonryHorizontal.rowXs.push( 0 );
|
1119 |
+
}
|
1120 |
+
},
|
1121 |
+
|
1122 |
+
_masonryHorizontalLayout : function( $elems ) {
|
1123 |
+
var instance = this,
|
1124 |
+
props = instance.masonryHorizontal;
|
1125 |
+
$elems.each(function(){
|
1126 |
+
var $this = $(this),
|
1127 |
+
//how many rows does this brick span
|
1128 |
+
rowSpan = Math.ceil( $this.outerHeight(true) / props.rowHeight );
|
1129 |
+
rowSpan = Math.min( rowSpan, props.rows );
|
1130 |
+
|
1131 |
+
if ( rowSpan === 1 ) {
|
1132 |
+
// if brick spans only one column, just like singleMode
|
1133 |
+
instance._masonryHorizontalPlaceBrick( $this, props.rowXs );
|
1134 |
+
} else {
|
1135 |
+
// brick spans more than one row
|
1136 |
+
// how many different places could this brick fit horizontally
|
1137 |
+
var groupCount = props.rows + 1 - rowSpan,
|
1138 |
+
groupX = [],
|
1139 |
+
groupRowX, i;
|
1140 |
+
|
1141 |
+
// for each group potential horizontal position
|
1142 |
+
for ( i=0; i < groupCount; i++ ) {
|
1143 |
+
// make an array of colY values for that one group
|
1144 |
+
groupRowX = props.rowXs.slice( i, i+rowSpan );
|
1145 |
+
// and get the max value of the array
|
1146 |
+
groupX[i] = Math.max.apply( Math, groupRowX );
|
1147 |
+
}
|
1148 |
+
|
1149 |
+
instance._masonryHorizontalPlaceBrick( $this, groupX );
|
1150 |
+
}
|
1151 |
+
});
|
1152 |
+
},
|
1153 |
+
|
1154 |
+
_masonryHorizontalPlaceBrick : function( $brick, setX ) {
|
1155 |
+
// get the minimum Y value from the columns
|
1156 |
+
var minimumX = Math.min.apply( Math, setX ),
|
1157 |
+
smallRow = 0;
|
1158 |
+
// Find index of smallest row, the first from the top
|
1159 |
+
for (var i=0, len = setX.length; i < len; i++) {
|
1160 |
+
if ( setX[i] === minimumX ) {
|
1161 |
+
smallRow = i;
|
1162 |
+
break;
|
1163 |
+
}
|
1164 |
+
}
|
1165 |
+
|
1166 |
+
// position the brick
|
1167 |
+
var x = minimumX,
|
1168 |
+
y = this.masonryHorizontal.rowHeight * smallRow;
|
1169 |
+
this._pushPosition( $brick, x, y );
|
1170 |
+
|
1171 |
+
// apply setHeight to necessary columns
|
1172 |
+
var setWidth = minimumX + $brick.outerWidth(true),
|
1173 |
+
setSpan = this.masonryHorizontal.rows + 1 - len;
|
1174 |
+
for ( i=0; i < setSpan; i++ ) {
|
1175 |
+
this.masonryHorizontal.rowXs[ smallRow + i ] = setWidth;
|
1176 |
+
}
|
1177 |
+
},
|
1178 |
+
|
1179 |
+
_masonryHorizontalGetContainerSize : function() {
|
1180 |
+
var containerWidth = Math.max.apply( Math, this.masonryHorizontal.rowXs );
|
1181 |
+
return { width: containerWidth };
|
1182 |
+
},
|
1183 |
+
|
1184 |
+
_masonryHorizontalResizeChanged : function() {
|
1185 |
+
return this._checkIfSegmentsChanged(true);
|
1186 |
+
},
|
1187 |
+
|
1188 |
+
|
1189 |
+
// ====================== fitColumns ======================
|
1190 |
+
|
1191 |
+
_fitColumnsReset : function() {
|
1192 |
+
this.fitColumns = {
|
1193 |
+
x : 0,
|
1194 |
+
y : 0,
|
1195 |
+
width : 0
|
1196 |
+
};
|
1197 |
+
},
|
1198 |
+
|
1199 |
+
_fitColumnsLayout : function( $elems ) {
|
1200 |
+
var instance = this,
|
1201 |
+
containerHeight = this.element.height(),
|
1202 |
+
props = this.fitColumns;
|
1203 |
+
$elems.each( function() {
|
1204 |
+
var $this = $(this),
|
1205 |
+
atomW = $this.outerWidth(true),
|
1206 |
+
atomH = $this.outerHeight(true);
|
1207 |
+
|
1208 |
+
if ( props.y !== 0 && atomH + props.y > containerHeight ) {
|
1209 |
+
// if this element cannot fit in the current column
|
1210 |
+
props.x = props.width;
|
1211 |
+
props.y = 0;
|
1212 |
+
}
|
1213 |
+
|
1214 |
+
// position the atom
|
1215 |
+
instance._pushPosition( $this, props.x, props.y );
|
1216 |
+
|
1217 |
+
props.width = Math.max( props.x + atomW, props.width );
|
1218 |
+
props.y += atomH;
|
1219 |
+
|
1220 |
+
});
|
1221 |
+
},
|
1222 |
+
|
1223 |
+
_fitColumnsGetContainerSize : function () {
|
1224 |
+
return { width : this.fitColumns.width };
|
1225 |
+
},
|
1226 |
+
|
1227 |
+
_fitColumnsResizeChanged : function() {
|
1228 |
+
return true;
|
1229 |
+
},
|
1230 |
+
|
1231 |
+
|
1232 |
+
|
1233 |
+
// ====================== cellsByColumn ======================
|
1234 |
+
|
1235 |
+
_cellsByColumnReset : function() {
|
1236 |
+
this.cellsByColumn = {
|
1237 |
+
index : 0
|
1238 |
+
};
|
1239 |
+
// get this.cellsByColumn.columnWidth
|
1240 |
+
this._getSegments();
|
1241 |
+
// get this.cellsByColumn.rowHeight
|
1242 |
+
this._getSegments(true);
|
1243 |
+
},
|
1244 |
+
|
1245 |
+
_cellsByColumnLayout : function( $elems ) {
|
1246 |
+
var instance = this,
|
1247 |
+
props = this.cellsByColumn;
|
1248 |
+
$elems.each( function(){
|
1249 |
+
var $this = $(this),
|
1250 |
+
col = Math.floor( props.index / props.rows ),
|
1251 |
+
row = props.index % props.rows,
|
1252 |
+
x = ( col + 0.5 ) * props.columnWidth - $this.outerWidth(true) / 2,
|
1253 |
+
y = ( row + 0.5 ) * props.rowHeight - $this.outerHeight(true) / 2;
|
1254 |
+
instance._pushPosition( $this, x, y );
|
1255 |
+
props.index ++;
|
1256 |
+
});
|
1257 |
+
},
|
1258 |
+
|
1259 |
+
_cellsByColumnGetContainerSize : function() {
|
1260 |
+
return { width : Math.ceil( this.$filteredAtoms.length / this.cellsByColumn.rows ) * this.cellsByColumn.columnWidth };
|
1261 |
+
},
|
1262 |
+
|
1263 |
+
_cellsByColumnResizeChanged : function() {
|
1264 |
+
return this._checkIfSegmentsChanged(true);
|
1265 |
+
},
|
1266 |
+
|
1267 |
+
// ====================== straightAcross ======================
|
1268 |
+
|
1269 |
+
_straightAcrossReset : function() {
|
1270 |
+
this.straightAcross = {
|
1271 |
+
x : 0
|
1272 |
+
};
|
1273 |
+
},
|
1274 |
+
|
1275 |
+
_straightAcrossLayout : function( $elems ) {
|
1276 |
+
var instance = this;
|
1277 |
+
$elems.each( function( i ){
|
1278 |
+
var $this = $(this);
|
1279 |
+
instance._pushPosition( $this, instance.straightAcross.x, 0 );
|
1280 |
+
instance.straightAcross.x += $this.outerWidth(true);
|
1281 |
+
});
|
1282 |
+
},
|
1283 |
+
|
1284 |
+
_straightAcrossGetContainerSize : function() {
|
1285 |
+
return { width : this.straightAcross.x };
|
1286 |
+
},
|
1287 |
+
|
1288 |
+
_straightAcrossResizeChanged : function() {
|
1289 |
+
return true;
|
1290 |
+
}
|
1291 |
+
|
1292 |
+
};
|
1293 |
+
|
1294 |
+
|
1295 |
+
// ======================= imagesLoaded Plugin ===============================
|
1296 |
+
/*!
|
1297 |
+
* jQuery imagesLoaded plugin v1.1.0
|
1298 |
+
* http://github.com/desandro/imagesloaded
|
1299 |
+
*
|
1300 |
+
* MIT License. by Paul Irish et al.
|
1301 |
+
*/
|
1302 |
+
|
1303 |
+
|
1304 |
+
// $('#my-container').imagesLoaded(myFunction)
|
1305 |
+
// or
|
1306 |
+
// $('img').imagesLoaded(myFunction)
|
1307 |
+
|
1308 |
+
// execute a callback when all images have loaded.
|
1309 |
+
// needed because .load() doesn't work on cached images
|
1310 |
+
|
1311 |
+
// callback function gets image collection as argument
|
1312 |
+
// `this` is the container
|
1313 |
+
|
1314 |
+
jQuery.fn.imagesLoaded = function( callback ) {
|
1315 |
+
var $this = this,
|
1316 |
+
$images = $this.find('img').add( $this.filter('img') ),
|
1317 |
+
len = $images.length,
|
1318 |
+
blank = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==',
|
1319 |
+
loaded = [];
|
1320 |
+
|
1321 |
+
function triggerCallback() {
|
1322 |
+
callback.call( $this, $images );
|
1323 |
+
}
|
1324 |
+
|
1325 |
+
function imgLoaded( event ) {
|
1326 |
+
var img = event.target;
|
1327 |
+
if ( img.src !== blank && jQuery.inArray( img, loaded ) === -1 ){
|
1328 |
+
loaded.push( img );
|
1329 |
+
if ( --len <= 0 ){
|
1330 |
+
setTimeout( triggerCallback );
|
1331 |
+
$images.unbind( '.imagesLoaded', imgLoaded );
|
1332 |
+
}
|
1333 |
+
}
|
1334 |
+
}
|
1335 |
+
|
1336 |
+
// if no images, trigger immediately
|
1337 |
+
if ( !len ) {
|
1338 |
+
triggerCallback();
|
1339 |
+
}
|
1340 |
+
|
1341 |
+
$images.bind( 'load.imagesLoaded error.imagesLoaded', imgLoaded ).each( function() {
|
1342 |
+
// cached images don't fire load sometimes, so we reset src.
|
1343 |
+
var src = this.src;
|
1344 |
+
// webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
|
1345 |
+
// data uri bypasses webkit log warning (thx doug jones)
|
1346 |
+
this.src = blank;
|
1347 |
+
this.src = src;
|
1348 |
+
});
|
1349 |
+
|
1350 |
+
return $this;
|
1351 |
+
};
|
1352 |
+
|
1353 |
+
|
1354 |
+
// helper function for logging errors
|
1355 |
+
// jQuery.error breaks jQuery chaining
|
1356 |
+
var logError = function( message ) {
|
1357 |
+
if ( window.console ) {
|
1358 |
+
window.console.error( message );
|
1359 |
+
}
|
1360 |
+
};
|
1361 |
+
|
1362 |
+
// ======================= Plugin bridge ===============================
|
1363 |
+
// leverages data method to either create or return jQuery.Isotope constructor
|
1364 |
+
// A bit from jQuery UI
|
1365 |
+
// https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.widget.js
|
1366 |
+
// A bit from jcarousel
|
1367 |
+
// https://github.com/jsor/jcarousel/blob/master/lib/jquery.jcarousel.js
|
1368 |
+
|
1369 |
+
jQuery.fn.isotope = function( options, callback ) {
|
1370 |
+
if ( typeof options === 'string' ) {
|
1371 |
+
// call method
|
1372 |
+
var args = Array.prototype.slice.call( arguments, 1 );
|
1373 |
+
|
1374 |
+
this.each(function(){
|
1375 |
+
var instance = jQuery.data( this, 'isotope' );
|
1376 |
+
if ( !instance ) {
|
1377 |
+
logError( "cannot call methods on isotope prior to initialization; " +
|
1378 |
+
"attempted to call method '" + options + "'" );
|
1379 |
+
return;
|
1380 |
+
}
|
1381 |
+
if ( !jQuery.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
|
1382 |
+
logError( "no such method '" + options + "' for isotope instance" );
|
1383 |
+
return;
|
1384 |
+
}
|
1385 |
+
// apply method
|
1386 |
+
instance[ options ].apply( instance, args );
|
1387 |
+
});
|
1388 |
+
} else {
|
1389 |
+
this.each(function() {
|
1390 |
+
var instance = jQuery.data( this, 'isotope' );
|
1391 |
+
if ( instance ) {
|
1392 |
+
// apply options & init
|
1393 |
+
instance.option( options );
|
1394 |
+
instance._init( callback );
|
1395 |
+
} else {
|
1396 |
+
// initialize new instance
|
1397 |
+
jQuery.data( this, 'isotope', new jQuery.Isotope( options, this, callback ) );
|
1398 |
+
}
|
1399 |
+
});
|
1400 |
+
}
|
1401 |
+
// return jQuery object
|
1402 |
+
// so plugin methods do not have to
|
1403 |
+
return this;
|
1404 |
+
};
|
1405 |
+
|
1406 |
})( window, jQuery );
|
js/libraries/isotope/jquery.isotope.min.js
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
/**
|
2 |
-
* Isotope v1.5.23
|
3 |
-
* An exquisite jQuery plugin for magical layouts
|
4 |
-
* http://isotope.metafizzy.co
|
5 |
-
*
|
6 |
-
* Commercial use requires one-time license fee
|
7 |
-
* http://metafizzy.co/#licenses
|
8 |
-
*
|
9 |
-
* Copyright 2012 David DeSandro / Metafizzy
|
10 |
-
*/
|
11 |
(function(a,b,c){"use strict";var d=a.document,e=a.Modernizr,f=function(a){return a.charAt(0).toUpperCase()+a.slice(1)},g="Moz Webkit O Ms".split(" "),h=function(a){var b=d.documentElement.style,c;if(typeof b[a]=="string")return a;a=f(a);for(var e=0,h=g.length;e<h;e++){c=g[e]+a;if(typeof b[c]=="string")return c}},i=h("transform"),j=h("transitionProperty"),k={csstransforms:function(){return!!i},csstransforms3d:function(){var a=!!h("perspective");if(a){var c=" -o- -moz- -ms- -webkit- -khtml- ".split(" "),d="@media ("+c.join("transform-3d),(")+"modernizr)",e=b("<style>"+d+"{#modernizr{height:3px}}"+"</style>").appendTo("head"),f=b('<div id="modernizr" />').appendTo("html");a=f.height()===3,f.remove(),e.remove()}return a},csstransitions:function(){return!!j}},l;if(e)for(l in k)e.hasOwnProperty(l)||e.addTest(l,k[l]);else{e=a.Modernizr={_version:"1.6ish: miniModernizr for Isotope"};var m=" ",n;for(l in k)n=k[l](),e[l]=n,m+=" "+(n?"":"no-")+l;b("html").addClass(m)}if(e.csstransforms){var o=e.csstransforms3d?{translate:function(a){return"translate3d("+a[0]+"px, "+a[1]+"px, 0) "},scale:function(a){return"scale3d("+a+", "+a+", 1) "}}:{translate:function(a){return"translate("+a[0]+"px, "+a[1]+"px) "},scale:function(a){return"scale("+a+") "}},p=function(a,c,d){var e=b.data(a,"isoTransform")||{},f={},g,h={},j;f[c]=d,b.extend(e,f);for(g in e)j=e[g],h[g]=o[g](j);var k=h.translate||"",l=h.scale||"",m=k+l;b.data(a,"isoTransform",e),a.style[i]=m};b.cssNumber.scale=!0,b.cssHooks.scale={set:function(a,b){p(a,"scale",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.scale?d.scale:1}},b.fx.step.scale=function(a){b.cssHooks.scale.set(a.elem,a.now+a.unit)},b.cssNumber.translate=!0,b.cssHooks.translate={set:function(a,b){p(a,"translate",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.translate?d.translate:[0,0]}}}var q,r;e.csstransitions&&(q={WebkitTransitionProperty:"webkitTransitionEnd",MozTransitionProperty:"transitionend",OTransitionProperty:"oTransitionEnd otransitionend",transitionProperty:"transitionend"}[j],r=h("transitionDuration"));var s=b.event,t;s.special.smartresize={setup:function(){b(this).bind("resize",s.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",s.special.smartresize.handler)},handler:function(a,b){var c=this,d=arguments;a.type="smartresize",t&&clearTimeout(t),t=setTimeout(function(){jQuery.event.handle.apply(c,d)},b==="execAsap"?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execAsap"])},b.Isotope=function(a,c,d){this.element=b(c),this._create(a),this._init(d)};var u=["width","height"],v=b(a);b.Isotope.settings={resizable:!0,layoutMode:"masonry",containerClass:"isotope",itemClass:"isotope-item",hiddenClass:"isotope-hidden",hiddenStyle:{opacity:0,scale:.001},visibleStyle:{opacity:1,scale:1},containerStyle:{position:"relative",overflow:"hidden"},animationEngine:"best-available",animationOptions:{queue:!1,duration:800},sortBy:"original-order",sortAscending:!0,resizesContainer:!0,transformsEnabled:!0,itemPositionDataEnabled:!1},b.Isotope.prototype={_create:function(a){this.options=b.extend({},b.Isotope.settings,a),this.styleQueue=[],this.elemCount=0;var c=this.element[0].style;this.originalStyle={};var d=u.slice(0);for(var e in this.options.containerStyle)d.push(e);for(var f=0,g=d.length;f<g;f++)e=d[f],this.originalStyle[e]=c[e]||"";this.element.css(this.options.containerStyle),this._updateAnimationEngine(),this._updateUsingTransforms();var h={"original-order":function(a,b){return b.elemCount++,b.elemCount},random:function(){return Math.random()}};this.options.getSortData=b.extend(this.options.getSortData,h),this.reloadItems(),this.offset={left:parseInt(this.element.css("padding-left")||0,10),top:parseInt(this.element.css("padding-top")||0,10)};var i=this;setTimeout(function(){i.element.addClass(i.options.containerClass)},0),this.options.resizable&&v.bind("smartresize.isotope",function(){i.resize()}),this.element.delegate("."+this.options.hiddenClass,"click",function(){return!1})},_getAtoms:function(a){var b=this.options.itemSelector,c=b?a.filter(b).add(a.find(b)):a,d={position:"absolute"};return c=c.filter(function(a,b){return b.nodeType===1}),this.usingTransforms&&(d.left=0,d.top=0),c.css(d).addClass(this.options.itemClass),this.updateSortData(c,!0),c},_init:function(a){this.$filteredAtoms=this._filter(this.$allAtoms),this._sort(),this.reLayout(a)},option:function(a){if(b.isPlainObject(a)){this.options=b.extend(!0,this.options,a);var c;for(var d in a)c="_update"+f(d),this[c]&&this[c]()}},_updateAnimationEngine:function(){var a=this.options.animationEngine.toLowerCase().replace(/[ _\-]/g,""),b;switch(a){case"css":case"none":b=!1;break;case"jquery":b=!0;break;default:b=!e.csstransitions}this.isUsingJQueryAnimation=b,this._updateUsingTransforms()},_updateTransformsEnabled:function(){this._updateUsingTransforms()},_updateUsingTransforms:function(){var a=this.usingTransforms=this.options.transformsEnabled&&e.csstransforms&&e.csstransitions&&!this.isUsingJQueryAnimation;a||(delete this.options.hiddenStyle.scale,delete this.options.visibleStyle.scale),this.getPositionStyles=a?this._translate:this._positionAbs},_filter:function(a){var b=this.options.filter===""?"*":this.options.filter;if(!b)return a;var c=this.options.hiddenClass,d="."+c,e=a.filter(d),f=e;if(b!=="*"){f=e.filter(b);var g=a.not(d).not(b).addClass(c);this.styleQueue.push({$el:g,style:this.options.hiddenStyle})}return this.styleQueue.push({$el:f,style:this.options.visibleStyle}),f.removeClass(c),a.filter(b)},updateSortData:function(a,c){var d=this,e=this.options.getSortData,f,g;a.each(function(){f=b(this),g={};for(var a in e)!c&&a==="original-order"?g[a]=b.data(this,"isotope-sort-data")[a]:g[a]=e[a](f,d);b.data(this,"isotope-sort-data",g)})},_sort:function(){var a=this.options.sortBy,b=this._getSorter,c=this.options.sortAscending?1:-1,d=function(d,e){var f=b(d,a),g=b(e,a);return f===g&&a!=="original-order"&&(f=b(d,"original-order"),g=b(e,"original-order")),(f>g?1:f<g?-1:0)*c};this.$filteredAtoms.sort(d)},_getSorter:function(a,c){return b.data(a,"isotope-sort-data")[c]},_translate:function(a,b){return{translate:[a,b]}},_positionAbs:function(a,b){return{left:a,top:b}},_pushPosition:function(a,b,c){b=Math.round(b+this.offset.left),c=Math.round(c+this.offset.top);var d=this.getPositionStyles(b,c);this.styleQueue.push({$el:a,style:d}),this.options.itemPositionDataEnabled&&a.data("isotope-item-position",{x:b,y:c})},layout:function(a,b){var c=this.options.layoutMode;this["_"+c+"Layout"](a);if(this.options.resizesContainer){var d=this["_"+c+"GetContainerSize"]();this.styleQueue.push({$el:this.element,style:d})}this._processStyleQueue(a,b),this.isLaidOut=!0},_processStyleQueue:function(a,c){var d=this.isLaidOut?this.isUsingJQueryAnimation?"animate":"css":"css",f=this.options.animationOptions,g=this.options.onLayout,h,i,j,k;i=function(a,b){b.$el[d](b.style,f)};if(this._isInserting&&this.isUsingJQueryAnimation)i=function(a,b){h=b.$el.hasClass("no-transition")?"css":d,b.$el[h](b.style,f)};else if(c||g||f.complete){var l=!1,m=[c,g,f.complete],n=this;j=!0,k=function(){if(l)return;var b;for(var c=0,d=m.length;c<d;c++)b=m[c],typeof b=="function"&&b.call(n.element,a,n);l=!0};if(this.isUsingJQueryAnimation&&d==="animate")f.complete=k,j=!1;else if(e.csstransitions){var o=0,p=this.styleQueue[0],s=p&&p.$el,t;while(!s||!s.length){t=this.styleQueue[o++];if(!t)return;s=t.$el}var u=parseFloat(getComputedStyle(s[0])[r]);u>0&&(i=function(a,b){b.$el[d](b.style,f).one(q,k)},j=!1)}}b.each(this.styleQueue,i),j&&k(),this.styleQueue=[]},resize:function(){this["_"+this.options.layoutMode+"ResizeChanged"]()&&this.reLayout()},reLayout:function(a){this["_"+this.options.layoutMode+"Reset"](),this.layout(this.$filteredAtoms,a)},addItems:function(a,b){var c=this._getAtoms(a);this.$allAtoms=this.$allAtoms.add(c),b&&b(c)},insert:function(a,b){this.element.append(a);var c=this;this.addItems(a,function(a){var d=c._filter(a);c._addHideAppended(d),c._sort(),c.reLayout(),c._revealAppended(d,b)})},appended:function(a,b){var c=this;this.addItems(a,function(a){c._addHideAppended(a),c.layout(a),c._revealAppended(a,b)})},_addHideAppended:function(a){this.$filteredAtoms=this.$filteredAtoms.add(a),a.addClass("no-transition"),this._isInserting=!0,this.styleQueue.push({$el:a,style:this.options.hiddenStyle})},_revealAppended:function(a,b){var c=this;setTimeout(function(){a.removeClass("no-transition"),c.styleQueue.push({$el:a,style:c.options.visibleStyle}),c._isInserting=!1,c._processStyleQueue(a,b)},10)},reloadItems:function(){this.$allAtoms=this._getAtoms(this.element.children())},remove:function(a,b){this.$allAtoms=this.$allAtoms.not(a),this.$filteredAtoms=this.$filteredAtoms.not(a);var c=this,d=function(){a.remove(),b&&b.call(c.element)};a.filter(":not(."+this.options.hiddenClass+")").length?(this.styleQueue.push({$el:a,style:this.options.hiddenStyle}),this._sort(),this.reLayout(d)):d()},shuffle:function(a){this.updateSortData(this.$allAtoms),this.options.sortBy="random",this._sort(),this.reLayout(a)},destroy:function(){var a=this.usingTransforms,b=this.options;this.$allAtoms.removeClass(b.hiddenClass+" "+b.itemClass).each(function(){var b=this.style;b.position="",b.top="",b.left="",b.opacity="",a&&(b[i]="")});var c=this.element[0].style;for(var d in this.originalStyle)c[d]=this.originalStyle[d];this.element.unbind(".isotope").undelegate("."+b.hiddenClass,"click").removeClass(b.containerClass).removeData("isotope"),v.unbind(".isotope")},_getSegments:function(a){var b=this.options.layoutMode,c=a?"rowHeight":"columnWidth",d=a?"height":"width",e=a?"rows":"cols",g=this.element[d](),h,i=this.options[b]&&this.options[b][c]||this.$filteredAtoms["outer"+f(d)](!0)||g;h=Math.floor(g/i),h=Math.max(h,1),this[b][e]=h,this[b][c]=i},_checkIfSegmentsChanged:function(a){var b=this.options.layoutMode,c=a?"rows":"cols",d=this[b][c];return this._getSegments(a),this[b][c]!==d},_masonryReset:function(){this.masonry={},this._getSegments();var a=this.masonry.cols;this.masonry.colYs=[];while(a--)this.masonry.colYs.push(0)},_masonryLayout:function(a){var c=this,d=c.masonry;a.each(function(){var a=b(this),e=Math.ceil(a.outerWidth(!0)/d.columnWidth);e=Math.min(e,d.cols);if(e===1)c._masonryPlaceBrick(a,d.colYs);else{var f=d.cols+1-e,g=[],h,i;for(i=0;i<f;i++)h=d.colYs.slice(i,i+e),g[i]=Math.max.apply(Math,h);c._masonryPlaceBrick(a,g)}})},_masonryPlaceBrick:function(a,b){var c=Math.min.apply(Math,b),d=0;for(var e=0,f=b.length;e<f;e++)if(b[e]===c){d=e;break}var g=this.masonry.columnWidth*d,h=c;this._pushPosition(a,g,h);var i=c+a.outerHeight(!0),j=this.masonry.cols+1-f;for(e=0;e<j;e++)this.masonry.colYs[d+e]=i},_masonryGetContainerSize:function(){var a=Math.max.apply(Math,this.masonry.colYs);return{height:a}},_masonryResizeChanged:function(){return this._checkIfSegmentsChanged()},_fitRowsReset:function(){this.fitRows={x:0,y:0,height:0}},_fitRowsLayout:function(a){var c=this,d=this.element.width(),e=this.fitRows;a.each(function(){var a=b(this),f=a.outerWidth(!0),g=a.outerHeight(!0);e.x!==0&&f+e.x>d&&(e.x=0,e.y=e.height),c._pushPosition(a,e.x,e.y),e.height=Math.max(e.y+g,e.height),e.x+=f})},_fitRowsGetContainerSize:function(){return{height:this.fitRows.height}},_fitRowsResizeChanged:function(){return!0},_cellsByRowReset:function(){this.cellsByRow={index:0},this._getSegments(),this._getSegments(!0)},_cellsByRowLayout:function(a){var c=this,d=this.cellsByRow;a.each(function(){var a=b(this),e=d.index%d.cols,f=Math.floor(d.index/d.cols),g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByRowGetContainerSize:function(){return{height:Math.ceil(this.$filteredAtoms.length/this.cellsByRow.cols)*this.cellsByRow.rowHeight+this.offset.top}},_cellsByRowResizeChanged:function(){return this._checkIfSegmentsChanged()},_straightDownReset:function(){this.straightDown={y:0}},_straightDownLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,0,c.straightDown.y),c.straightDown.y+=d.outerHeight(!0)})},_straightDownGetContainerSize:function(){return{height:this.straightDown.y}},_straightDownResizeChanged:function(){return!0},_masonryHorizontalReset:function(){this.masonryHorizontal={},this._getSegments(!0);var a=this.masonryHorizontal.rows;this.masonryHorizontal.rowXs=[];while(a--)this.masonryHorizontal.rowXs.push(0)},_masonryHorizontalLayout:function(a){var c=this,d=c.masonryHorizontal;a.each(function(){var a=b(this),e=Math.ceil(a.outerHeight(!0)/d.rowHeight);e=Math.min(e,d.rows);if(e===1)c._masonryHorizontalPlaceBrick(a,d.rowXs);else{var f=d.rows+1-e,g=[],h,i;for(i=0;i<f;i++)h=d.rowXs.slice(i,i+e),g[i]=Math.max.apply(Math,h);c._masonryHorizontalPlaceBrick(a,g)}})},_masonryHorizontalPlaceBrick:function(a,b){var c=Math.min.apply(Math,b),d=0;for(var e=0,f=b.length;e<f;e++)if(b[e]===c){d=e;break}var g=c,h=this.masonryHorizontal.rowHeight*d;this._pushPosition(a,g,h);var i=c+a.outerWidth(!0),j=this.masonryHorizontal.rows+1-f;for(e=0;e<j;e++)this.masonryHorizontal.rowXs[d+e]=i},_masonryHorizontalGetContainerSize:function(){var a=Math.max.apply(Math,this.masonryHorizontal.rowXs);return{width:a}},_masonryHorizontalResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_fitColumnsReset:function(){this.fitColumns={x:0,y:0,width:0}},_fitColumnsLayout:function(a){var c=this,d=this.element.height(),e=this.fitColumns;a.each(function(){var a=b(this),f=a.outerWidth(!0),g=a.outerHeight(!0);e.y!==0&&g+e.y>d&&(e.x=e.width,e.y=0),c._pushPosition(a,e.x,e.y),e.width=Math.max(e.x+f,e.width),e.y+=g})},_fitColumnsGetContainerSize:function(){return{width:this.fitColumns.width}},_fitColumnsResizeChanged:function(){return!0},_cellsByColumnReset:function(){this.cellsByColumn={index:0},this._getSegments(),this._getSegments(!0)},_cellsByColumnLayout:function(a){var c=this,d=this.cellsByColumn;a.each(function(){var a=b(this),e=Math.floor(d.index/d.rows),f=d.index%d.rows,g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByColumnGetContainerSize:function(){return{width:Math.ceil(this.$filteredAtoms.length/this.cellsByColumn.rows)*this.cellsByColumn.columnWidth}},_cellsByColumnResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_straightAcrossReset:function(){this.straightAcross={x:0}},_straightAcrossLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,c.straightAcross.x,0),c.straightAcross.x+=d.outerWidth(!0)})},_straightAcrossGetContainerSize:function(){return{width:this.straightAcross.x}},_straightAcrossResizeChanged:function(){return!0}},b.fn.imagesLoaded=function(a){function h(){a.call(c,d)}function i(a){var c=a.target;c.src!==f&&b.inArray(c,g)===-1&&(g.push(c),--e<=0&&(setTimeout(h),d.unbind(".imagesLoaded",i)))}var c=this,d=c.find("img").add(c.filter("img")),e=d.length,f="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",g=[];return e||h(),d.bind("load.imagesLoaded error.imagesLoaded",i).each(function(){var a=this.src;this.src=f,this.src=a}),c};var w=function(b){a.console&&a.console.error(b)};b.fn.isotope=function(a,c){if(typeof a=="string"){var d=Array.prototype.slice.call(arguments,1);this.each(function(){var c=b.data(this,"isotope");if(!c){w("cannot call methods on isotope prior to initialization; attempted to call method '"+a+"'");return}if(!b.isFunction(c[a])||a.charAt(0)==="_"){w("no such method '"+a+"' for isotope instance");return}c[a].apply(c,d)})}else this.each(function(){var d=b.data(this,"isotope");d?(d.option(a),d._init(c)):b.data(this,"isotope",new b.Isotope(a,this,c))});return this}})(window,jQuery);
|
1 |
+
/**
|
2 |
+
* Isotope v1.5.23
|
3 |
+
* An exquisite jQuery plugin for magical layouts
|
4 |
+
* http://isotope.metafizzy.co
|
5 |
+
*
|
6 |
+
* Commercial use requires one-time license fee
|
7 |
+
* http://metafizzy.co/#licenses
|
8 |
+
*
|
9 |
+
* Copyright 2012 David DeSandro / Metafizzy
|
10 |
+
*/
|
11 |
(function(a,b,c){"use strict";var d=a.document,e=a.Modernizr,f=function(a){return a.charAt(0).toUpperCase()+a.slice(1)},g="Moz Webkit O Ms".split(" "),h=function(a){var b=d.documentElement.style,c;if(typeof b[a]=="string")return a;a=f(a);for(var e=0,h=g.length;e<h;e++){c=g[e]+a;if(typeof b[c]=="string")return c}},i=h("transform"),j=h("transitionProperty"),k={csstransforms:function(){return!!i},csstransforms3d:function(){var a=!!h("perspective");if(a){var c=" -o- -moz- -ms- -webkit- -khtml- ".split(" "),d="@media ("+c.join("transform-3d),(")+"modernizr)",e=b("<style>"+d+"{#modernizr{height:3px}}"+"</style>").appendTo("head"),f=b('<div id="modernizr" />').appendTo("html");a=f.height()===3,f.remove(),e.remove()}return a},csstransitions:function(){return!!j}},l;if(e)for(l in k)e.hasOwnProperty(l)||e.addTest(l,k[l]);else{e=a.Modernizr={_version:"1.6ish: miniModernizr for Isotope"};var m=" ",n;for(l in k)n=k[l](),e[l]=n,m+=" "+(n?"":"no-")+l;b("html").addClass(m)}if(e.csstransforms){var o=e.csstransforms3d?{translate:function(a){return"translate3d("+a[0]+"px, "+a[1]+"px, 0) "},scale:function(a){return"scale3d("+a+", "+a+", 1) "}}:{translate:function(a){return"translate("+a[0]+"px, "+a[1]+"px) "},scale:function(a){return"scale("+a+") "}},p=function(a,c,d){var e=b.data(a,"isoTransform")||{},f={},g,h={},j;f[c]=d,b.extend(e,f);for(g in e)j=e[g],h[g]=o[g](j);var k=h.translate||"",l=h.scale||"",m=k+l;b.data(a,"isoTransform",e),a.style[i]=m};b.cssNumber.scale=!0,b.cssHooks.scale={set:function(a,b){p(a,"scale",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.scale?d.scale:1}},b.fx.step.scale=function(a){b.cssHooks.scale.set(a.elem,a.now+a.unit)},b.cssNumber.translate=!0,b.cssHooks.translate={set:function(a,b){p(a,"translate",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.translate?d.translate:[0,0]}}}var q,r;e.csstransitions&&(q={WebkitTransitionProperty:"webkitTransitionEnd",MozTransitionProperty:"transitionend",OTransitionProperty:"oTransitionEnd otransitionend",transitionProperty:"transitionend"}[j],r=h("transitionDuration"));var s=b.event,t;s.special.smartresize={setup:function(){b(this).bind("resize",s.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",s.special.smartresize.handler)},handler:function(a,b){var c=this,d=arguments;a.type="smartresize",t&&clearTimeout(t),t=setTimeout(function(){jQuery.event.handle.apply(c,d)},b==="execAsap"?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execAsap"])},b.Isotope=function(a,c,d){this.element=b(c),this._create(a),this._init(d)};var u=["width","height"],v=b(a);b.Isotope.settings={resizable:!0,layoutMode:"masonry",containerClass:"isotope",itemClass:"isotope-item",hiddenClass:"isotope-hidden",hiddenStyle:{opacity:0,scale:.001},visibleStyle:{opacity:1,scale:1},containerStyle:{position:"relative",overflow:"hidden"},animationEngine:"best-available",animationOptions:{queue:!1,duration:800},sortBy:"original-order",sortAscending:!0,resizesContainer:!0,transformsEnabled:!0,itemPositionDataEnabled:!1},b.Isotope.prototype={_create:function(a){this.options=b.extend({},b.Isotope.settings,a),this.styleQueue=[],this.elemCount=0;var c=this.element[0].style;this.originalStyle={};var d=u.slice(0);for(var e in this.options.containerStyle)d.push(e);for(var f=0,g=d.length;f<g;f++)e=d[f],this.originalStyle[e]=c[e]||"";this.element.css(this.options.containerStyle),this._updateAnimationEngine(),this._updateUsingTransforms();var h={"original-order":function(a,b){return b.elemCount++,b.elemCount},random:function(){return Math.random()}};this.options.getSortData=b.extend(this.options.getSortData,h),this.reloadItems(),this.offset={left:parseInt(this.element.css("padding-left")||0,10),top:parseInt(this.element.css("padding-top")||0,10)};var i=this;setTimeout(function(){i.element.addClass(i.options.containerClass)},0),this.options.resizable&&v.bind("smartresize.isotope",function(){i.resize()}),this.element.delegate("."+this.options.hiddenClass,"click",function(){return!1})},_getAtoms:function(a){var b=this.options.itemSelector,c=b?a.filter(b).add(a.find(b)):a,d={position:"absolute"};return c=c.filter(function(a,b){return b.nodeType===1}),this.usingTransforms&&(d.left=0,d.top=0),c.css(d).addClass(this.options.itemClass),this.updateSortData(c,!0),c},_init:function(a){this.$filteredAtoms=this._filter(this.$allAtoms),this._sort(),this.reLayout(a)},option:function(a){if(b.isPlainObject(a)){this.options=b.extend(!0,this.options,a);var c;for(var d in a)c="_update"+f(d),this[c]&&this[c]()}},_updateAnimationEngine:function(){var a=this.options.animationEngine.toLowerCase().replace(/[ _\-]/g,""),b;switch(a){case"css":case"none":b=!1;break;case"jquery":b=!0;break;default:b=!e.csstransitions}this.isUsingJQueryAnimation=b,this._updateUsingTransforms()},_updateTransformsEnabled:function(){this._updateUsingTransforms()},_updateUsingTransforms:function(){var a=this.usingTransforms=this.options.transformsEnabled&&e.csstransforms&&e.csstransitions&&!this.isUsingJQueryAnimation;a||(delete this.options.hiddenStyle.scale,delete this.options.visibleStyle.scale),this.getPositionStyles=a?this._translate:this._positionAbs},_filter:function(a){var b=this.options.filter===""?"*":this.options.filter;if(!b)return a;var c=this.options.hiddenClass,d="."+c,e=a.filter(d),f=e;if(b!=="*"){f=e.filter(b);var g=a.not(d).not(b).addClass(c);this.styleQueue.push({$el:g,style:this.options.hiddenStyle})}return this.styleQueue.push({$el:f,style:this.options.visibleStyle}),f.removeClass(c),a.filter(b)},updateSortData:function(a,c){var d=this,e=this.options.getSortData,f,g;a.each(function(){f=b(this),g={};for(var a in e)!c&&a==="original-order"?g[a]=b.data(this,"isotope-sort-data")[a]:g[a]=e[a](f,d);b.data(this,"isotope-sort-data",g)})},_sort:function(){var a=this.options.sortBy,b=this._getSorter,c=this.options.sortAscending?1:-1,d=function(d,e){var f=b(d,a),g=b(e,a);return f===g&&a!=="original-order"&&(f=b(d,"original-order"),g=b(e,"original-order")),(f>g?1:f<g?-1:0)*c};this.$filteredAtoms.sort(d)},_getSorter:function(a,c){return b.data(a,"isotope-sort-data")[c]},_translate:function(a,b){return{translate:[a,b]}},_positionAbs:function(a,b){return{left:a,top:b}},_pushPosition:function(a,b,c){b=Math.round(b+this.offset.left),c=Math.round(c+this.offset.top);var d=this.getPositionStyles(b,c);this.styleQueue.push({$el:a,style:d}),this.options.itemPositionDataEnabled&&a.data("isotope-item-position",{x:b,y:c})},layout:function(a,b){var c=this.options.layoutMode;this["_"+c+"Layout"](a);if(this.options.resizesContainer){var d=this["_"+c+"GetContainerSize"]();this.styleQueue.push({$el:this.element,style:d})}this._processStyleQueue(a,b),this.isLaidOut=!0},_processStyleQueue:function(a,c){var d=this.isLaidOut?this.isUsingJQueryAnimation?"animate":"css":"css",f=this.options.animationOptions,g=this.options.onLayout,h,i,j,k;i=function(a,b){b.$el[d](b.style,f)};if(this._isInserting&&this.isUsingJQueryAnimation)i=function(a,b){h=b.$el.hasClass("no-transition")?"css":d,b.$el[h](b.style,f)};else if(c||g||f.complete){var l=!1,m=[c,g,f.complete],n=this;j=!0,k=function(){if(l)return;var b;for(var c=0,d=m.length;c<d;c++)b=m[c],typeof b=="function"&&b.call(n.element,a,n);l=!0};if(this.isUsingJQueryAnimation&&d==="animate")f.complete=k,j=!1;else if(e.csstransitions){var o=0,p=this.styleQueue[0],s=p&&p.$el,t;while(!s||!s.length){t=this.styleQueue[o++];if(!t)return;s=t.$el}var u=parseFloat(getComputedStyle(s[0])[r]);u>0&&(i=function(a,b){b.$el[d](b.style,f).one(q,k)},j=!1)}}b.each(this.styleQueue,i),j&&k(),this.styleQueue=[]},resize:function(){this["_"+this.options.layoutMode+"ResizeChanged"]()&&this.reLayout()},reLayout:function(a){this["_"+this.options.layoutMode+"Reset"](),this.layout(this.$filteredAtoms,a)},addItems:function(a,b){var c=this._getAtoms(a);this.$allAtoms=this.$allAtoms.add(c),b&&b(c)},insert:function(a,b){this.element.append(a);var c=this;this.addItems(a,function(a){var d=c._filter(a);c._addHideAppended(d),c._sort(),c.reLayout(),c._revealAppended(d,b)})},appended:function(a,b){var c=this;this.addItems(a,function(a){c._addHideAppended(a),c.layout(a),c._revealAppended(a,b)})},_addHideAppended:function(a){this.$filteredAtoms=this.$filteredAtoms.add(a),a.addClass("no-transition"),this._isInserting=!0,this.styleQueue.push({$el:a,style:this.options.hiddenStyle})},_revealAppended:function(a,b){var c=this;setTimeout(function(){a.removeClass("no-transition"),c.styleQueue.push({$el:a,style:c.options.visibleStyle}),c._isInserting=!1,c._processStyleQueue(a,b)},10)},reloadItems:function(){this.$allAtoms=this._getAtoms(this.element.children())},remove:function(a,b){this.$allAtoms=this.$allAtoms.not(a),this.$filteredAtoms=this.$filteredAtoms.not(a);var c=this,d=function(){a.remove(),b&&b.call(c.element)};a.filter(":not(."+this.options.hiddenClass+")").length?(this.styleQueue.push({$el:a,style:this.options.hiddenStyle}),this._sort(),this.reLayout(d)):d()},shuffle:function(a){this.updateSortData(this.$allAtoms),this.options.sortBy="random",this._sort(),this.reLayout(a)},destroy:function(){var a=this.usingTransforms,b=this.options;this.$allAtoms.removeClass(b.hiddenClass+" "+b.itemClass).each(function(){var b=this.style;b.position="",b.top="",b.left="",b.opacity="",a&&(b[i]="")});var c=this.element[0].style;for(var d in this.originalStyle)c[d]=this.originalStyle[d];this.element.unbind(".isotope").undelegate("."+b.hiddenClass,"click").removeClass(b.containerClass).removeData("isotope"),v.unbind(".isotope")},_getSegments:function(a){var b=this.options.layoutMode,c=a?"rowHeight":"columnWidth",d=a?"height":"width",e=a?"rows":"cols",g=this.element[d](),h,i=this.options[b]&&this.options[b][c]||this.$filteredAtoms["outer"+f(d)](!0)||g;h=Math.floor(g/i),h=Math.max(h,1),this[b][e]=h,this[b][c]=i},_checkIfSegmentsChanged:function(a){var b=this.options.layoutMode,c=a?"rows":"cols",d=this[b][c];return this._getSegments(a),this[b][c]!==d},_masonryReset:function(){this.masonry={},this._getSegments();var a=this.masonry.cols;this.masonry.colYs=[];while(a--)this.masonry.colYs.push(0)},_masonryLayout:function(a){var c=this,d=c.masonry;a.each(function(){var a=b(this),e=Math.ceil(a.outerWidth(!0)/d.columnWidth);e=Math.min(e,d.cols);if(e===1)c._masonryPlaceBrick(a,d.colYs);else{var f=d.cols+1-e,g=[],h,i;for(i=0;i<f;i++)h=d.colYs.slice(i,i+e),g[i]=Math.max.apply(Math,h);c._masonryPlaceBrick(a,g)}})},_masonryPlaceBrick:function(a,b){var c=Math.min.apply(Math,b),d=0;for(var e=0,f=b.length;e<f;e++)if(b[e]===c){d=e;break}var g=this.masonry.columnWidth*d,h=c;this._pushPosition(a,g,h);var i=c+a.outerHeight(!0),j=this.masonry.cols+1-f;for(e=0;e<j;e++)this.masonry.colYs[d+e]=i},_masonryGetContainerSize:function(){var a=Math.max.apply(Math,this.masonry.colYs);return{height:a}},_masonryResizeChanged:function(){return this._checkIfSegmentsChanged()},_fitRowsReset:function(){this.fitRows={x:0,y:0,height:0}},_fitRowsLayout:function(a){var c=this,d=this.element.width(),e=this.fitRows;a.each(function(){var a=b(this),f=a.outerWidth(!0),g=a.outerHeight(!0);e.x!==0&&f+e.x>d&&(e.x=0,e.y=e.height),c._pushPosition(a,e.x,e.y),e.height=Math.max(e.y+g,e.height),e.x+=f})},_fitRowsGetContainerSize:function(){return{height:this.fitRows.height}},_fitRowsResizeChanged:function(){return!0},_cellsByRowReset:function(){this.cellsByRow={index:0},this._getSegments(),this._getSegments(!0)},_cellsByRowLayout:function(a){var c=this,d=this.cellsByRow;a.each(function(){var a=b(this),e=d.index%d.cols,f=Math.floor(d.index/d.cols),g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByRowGetContainerSize:function(){return{height:Math.ceil(this.$filteredAtoms.length/this.cellsByRow.cols)*this.cellsByRow.rowHeight+this.offset.top}},_cellsByRowResizeChanged:function(){return this._checkIfSegmentsChanged()},_straightDownReset:function(){this.straightDown={y:0}},_straightDownLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,0,c.straightDown.y),c.straightDown.y+=d.outerHeight(!0)})},_straightDownGetContainerSize:function(){return{height:this.straightDown.y}},_straightDownResizeChanged:function(){return!0},_masonryHorizontalReset:function(){this.masonryHorizontal={},this._getSegments(!0);var a=this.masonryHorizontal.rows;this.masonryHorizontal.rowXs=[];while(a--)this.masonryHorizontal.rowXs.push(0)},_masonryHorizontalLayout:function(a){var c=this,d=c.masonryHorizontal;a.each(function(){var a=b(this),e=Math.ceil(a.outerHeight(!0)/d.rowHeight);e=Math.min(e,d.rows);if(e===1)c._masonryHorizontalPlaceBrick(a,d.rowXs);else{var f=d.rows+1-e,g=[],h,i;for(i=0;i<f;i++)h=d.rowXs.slice(i,i+e),g[i]=Math.max.apply(Math,h);c._masonryHorizontalPlaceBrick(a,g)}})},_masonryHorizontalPlaceBrick:function(a,b){var c=Math.min.apply(Math,b),d=0;for(var e=0,f=b.length;e<f;e++)if(b[e]===c){d=e;break}var g=c,h=this.masonryHorizontal.rowHeight*d;this._pushPosition(a,g,h);var i=c+a.outerWidth(!0),j=this.masonryHorizontal.rows+1-f;for(e=0;e<j;e++)this.masonryHorizontal.rowXs[d+e]=i},_masonryHorizontalGetContainerSize:function(){var a=Math.max.apply(Math,this.masonryHorizontal.rowXs);return{width:a}},_masonryHorizontalResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_fitColumnsReset:function(){this.fitColumns={x:0,y:0,width:0}},_fitColumnsLayout:function(a){var c=this,d=this.element.height(),e=this.fitColumns;a.each(function(){var a=b(this),f=a.outerWidth(!0),g=a.outerHeight(!0);e.y!==0&&g+e.y>d&&(e.x=e.width,e.y=0),c._pushPosition(a,e.x,e.y),e.width=Math.max(e.x+f,e.width),e.y+=g})},_fitColumnsGetContainerSize:function(){return{width:this.fitColumns.width}},_fitColumnsResizeChanged:function(){return!0},_cellsByColumnReset:function(){this.cellsByColumn={index:0},this._getSegments(),this._getSegments(!0)},_cellsByColumnLayout:function(a){var c=this,d=this.cellsByColumn;a.each(function(){var a=b(this),e=Math.floor(d.index/d.rows),f=d.index%d.rows,g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByColumnGetContainerSize:function(){return{width:Math.ceil(this.$filteredAtoms.length/this.cellsByColumn.rows)*this.cellsByColumn.columnWidth}},_cellsByColumnResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_straightAcrossReset:function(){this.straightAcross={x:0}},_straightAcrossLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,c.straightAcross.x,0),c.straightAcross.x+=d.outerWidth(!0)})},_straightAcrossGetContainerSize:function(){return{width:this.straightAcross.x}},_straightAcrossResizeChanged:function(){return!0}},b.fn.imagesLoaded=function(a){function h(){a.call(c,d)}function i(a){var c=a.target;c.src!==f&&b.inArray(c,g)===-1&&(g.push(c),--e<=0&&(setTimeout(h),d.unbind(".imagesLoaded",i)))}var c=this,d=c.find("img").add(c.filter("img")),e=d.length,f="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",g=[];return e||h(),d.bind("load.imagesLoaded error.imagesLoaded",i).each(function(){var a=this.src;this.src=f,this.src=a}),c};var w=function(b){a.console&&a.console.error(b)};b.fn.isotope=function(a,c){if(typeof a=="string"){var d=Array.prototype.slice.call(arguments,1);this.each(function(){var c=b.data(this,"isotope");if(!c){w("cannot call methods on isotope prior to initialization; attempted to call method '"+a+"'");return}if(!b.isFunction(c[a])||a.charAt(0)==="_"){w("no such method '"+a+"' for isotope instance");return}c[a].apply(c,d)})}else this.each(function(){var d=b.data(this,"isotope");d?(d.option(a),d._init(c)):b.data(this,"isotope",new b.Isotope(a,this,c))});return this}})(window,jQuery);
|
js/libraries/isotope/js/fake-element.js
CHANGED
@@ -1,38 +1,38 @@
|
|
1 |
-
var fakeElement = {};
|
2 |
-
|
3 |
-
fakeElement.constanants = 'b c d f g k l m n p q r s t v x z'.split(' ');
|
4 |
-
fakeElement.vowels = 'a e i o u y'.split(' ');
|
5 |
-
fakeElement.categories = 'alkali alkaline-earth lanthanoid actinoid transition post-transition'.split(' ');
|
6 |
-
fakeElement.suffices = 'on ium ogen'.split(' ');
|
7 |
-
|
8 |
-
fakeElement.getRandom = function( property ) {
|
9 |
-
var values = fakeElement[ property ];
|
10 |
-
return values[ Math.floor( Math.random() * values.length ) ];
|
11 |
-
};
|
12 |
-
|
13 |
-
fakeElement.create = function() {
|
14 |
-
var widthClass = Math.random()*10 > 6 ? 'width2' : 'width1';
|
15 |
-
heightClass = Math.random()*10 > 6 ? 'height2' : 'height1';
|
16 |
-
category = fakeElement.getRandom('categories');
|
17 |
-
className = 'element fake metal ' + category + ' ' + widthClass + ' ' + heightClass;
|
18 |
-
letter1 = fakeElement.getRandom('constanants').toUpperCase();
|
19 |
-
letter2 = fakeElement.getRandom('constanants');
|
20 |
-
symbol = letter1 + letter2;
|
21 |
-
name = letter1 + fakeElement.getRandom('vowels') + letter2 + fakeElement.getRandom('vowels') + fakeElement.getRandom('constanants') + fakeElement.getRandom('suffices');
|
22 |
-
number = ~~( 21 + Math.random() * 100 );
|
23 |
-
weight = ~~( number * 2 + Math.random() * 15 );
|
24 |
-
|
25 |
-
return '<div class="' + className + '" data-symbol="' + symbol +
|
26 |
-
'" data-category="' + category + '"><p class="number">' + number +
|
27 |
-
'</p><h3 class="symbol">' + symbol + '</h3><h2 class="name">' + name +
|
28 |
-
'</h2><p class="weight">' + weight + '</p></div>';
|
29 |
-
};
|
30 |
-
|
31 |
-
fakeElement.getGroup = function() {
|
32 |
-
var i = Math.ceil( Math.random()*3 + 1 ),
|
33 |
-
newEls = '';
|
34 |
-
while ( i-- ) {
|
35 |
-
newEls += fakeElement.create();
|
36 |
-
}
|
37 |
-
return newEls;
|
38 |
};
|
1 |
+
var fakeElement = {};
|
2 |
+
|
3 |
+
fakeElement.constanants = 'b c d f g k l m n p q r s t v x z'.split(' ');
|
4 |
+
fakeElement.vowels = 'a e i o u y'.split(' ');
|
5 |
+
fakeElement.categories = 'alkali alkaline-earth lanthanoid actinoid transition post-transition'.split(' ');
|
6 |
+
fakeElement.suffices = 'on ium ogen'.split(' ');
|
7 |
+
|
8 |
+
fakeElement.getRandom = function( property ) {
|
9 |
+
var values = fakeElement[ property ];
|
10 |
+
return values[ Math.floor( Math.random() * values.length ) ];
|
11 |
+
};
|
12 |
+
|
13 |
+
fakeElement.create = function() {
|
14 |
+
var widthClass = Math.random()*10 > 6 ? 'width2' : 'width1';
|
15 |
+
heightClass = Math.random()*10 > 6 ? 'height2' : 'height1';
|
16 |
+
category = fakeElement.getRandom('categories');
|
17 |
+
className = 'element fake metal ' + category + ' ' + widthClass + ' ' + heightClass;
|
18 |
+
letter1 = fakeElement.getRandom('constanants').toUpperCase();
|
19 |
+
letter2 = fakeElement.getRandom('constanants');
|
20 |
+
symbol = letter1 + letter2;
|
21 |
+
name = letter1 + fakeElement.getRandom('vowels') + letter2 + fakeElement.getRandom('vowels') + fakeElement.getRandom('constanants') + fakeElement.getRandom('suffices');
|
22 |
+
number = ~~( 21 + Math.random() * 100 );
|
23 |
+
weight = ~~( number * 2 + Math.random() * 15 );
|
24 |
+
|
25 |
+
return '<div class="' + className + '" data-symbol="' + symbol +
|
26 |
+
'" data-category="' + category + '"><p class="number">' + number +
|
27 |
+
'</p><h3 class="symbol">' + symbol + '</h3><h2 class="name">' + name +
|
28 |
+
'</h2><p class="weight">' + weight + '</p></div>';
|
29 |
+
};
|
30 |
+
|
31 |
+
fakeElement.getGroup = function() {
|
32 |
+
var i = Math.ceil( Math.random()*3 + 1 ),
|
33 |
+
newEls = '';
|
34 |
+
while ( i-- ) {
|
35 |
+
newEls += fakeElement.create();
|
36 |
+
}
|
37 |
+
return newEls;
|
38 |
};
|
js/libraries/isotope/js/jquery-1.7.1.min.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*! jQuery v1.7.1 jquery.com | jquery.org/license */
|
2 |
-
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)ca(a+"["+e+"]",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border")for(;g<h;g++)c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d+"px"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement("div"),r=c.documentElement;q.setAttribute("className","t"),q.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h<g;h++)e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};
|
3 |
-
f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.POS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function()
|
4 |
{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bn(k[i]);else bn(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacity=([^)]*)/,bs=/([A-Z]|^ms)/g,bt=/^-?\d+(?:px)?$/i,bu=/^-?\d/,bv=/^([\-+])=([\-+.\de]+)/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bv.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bC(a,b,d);f.swap(a,bw,function(){e=bC(a,b,d)});return e}},set:function(a,b){if(!bt.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cv(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cn.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=co.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cr||cs(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)},h()&&f.timers.push(h)&&!cp&&(cp=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cr||cs(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cp),cp=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.support.fixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
|
1 |
+
/*! jQuery v1.7.1 jquery.com | jquery.org/license */
|
2 |
+
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)ca(a+"["+e+"]",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border")for(;g<h;g++)c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d+"px"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement("div"),r=c.documentElement;q.setAttribute("className","t"),q.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h<g;h++)e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};
|
3 |
+
f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.POS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function()
|
4 |
{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bn(k[i]);else bn(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacity=([^)]*)/,bs=/([A-Z]|^ms)/g,bt=/^-?\d+(?:px)?$/i,bu=/^-?\d/,bv=/^([\-+])=([\-+.\de]+)/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bv.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bC(a,b,d);f.swap(a,bw,function(){e=bC(a,b,d)});return e}},set:function(a,b){if(!bt.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cv(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cn.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=co.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cr||cs(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)},h()&&f.timers.push(h)&&!cp&&(cp=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cr||cs(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cp),cp=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.support.fixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
|
js/libraries/isotope/js/jquery.ba-bbq.min.js
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
-
/*
|
2 |
-
* jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010
|
3 |
-
* http://benalman.com/projects/jquery-bbq-plugin/
|
4 |
-
*
|
5 |
-
* Copyright (c) 2010 "Cowboy" Ben Alman
|
6 |
-
* Dual licensed under the MIT and GPL licenses.
|
7 |
-
* http://benalman.com/about/license/
|
8 |
-
*/
|
9 |
-
(function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M<N?O[P]||(R[M+1]&&isNaN(R[M+1])?{}:[]):J}}else{if($.isArray(H[P])){H[P].push(J)}else{if(H[P]!==i){H[P]=[H[P],J]}else{H[P]=J}}}}else{if(P){H[P]=F?i:""}}});return H};function z(H,F,G){if(F===i||typeof F==="boolean"){G=F;F=a[H?D:A]()}else{F=E(F)?F.replace(H?w:x,""):F}return l(F,G)}l[A]=B(z,0);l[D]=v=B(z,1);$[y]||($[y]=function(F){return $.extend(C,F)})({a:k,base:k,iframe:t,img:t,input:t,form:"action",link:k,script:t});j=$[y];function s(I,G,H,F){if(!E(H)&&typeof H!=="object"){F=H;H=G;G=i}return this.each(function(){var L=$(this),J=G||j()[(this.nodeName||"").toLowerCase()]||"",K=J&&L.attr(J)||"";L.attr(J,a[I](K,H,F))})}$.fn[A]=B(s,A);$.fn[D]=B(s,D);b.pushState=q=function(I,F){if(E(I)&&/^#/.test(I)&&F===i){F=2}var H=I!==i,G=c(p[g][k],H?I:{},H?F:2);p[g][k]=G+(/#/.test(G)?"":"#")};b.getState=u=function(F,G){return F===i||typeof F==="boolean"?v(F):v(G)[F]};b.removeState=function(F){var G={};if(F!==i){G=u();$.each($.isArray(F)?F:arguments,function(I,H){delete G[H]})}q(G,2)};e[d]=$.extend(e[d],{add:function(F){var H;function G(J){var I=J[D]=c();J.getState=function(K,L){return K===i||typeof K==="boolean"?l(I,K):l(I,L)[K]};H.apply(this,arguments)}if($.isFunction(F)){H=F;return G}else{H=F.handler;F.handler=G}}})})(jQuery,this);
|
10 |
-
/*
|
11 |
-
* jQuery hashchange event - v1.2 - 2/11/2010
|
12 |
-
* http://benalman.com/projects/jquery-hashchange-plugin/
|
13 |
-
*
|
14 |
-
* Copyright (c) 2010 "Cowboy" Ben Alman
|
15 |
-
* Dual licensed under the MIT and GPL licenses.
|
16 |
-
* http://benalman.com/about/license/
|
17 |
-
*/
|
18 |
(function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);
|
1 |
+
/*
|
2 |
+
* jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010
|
3 |
+
* http://benalman.com/projects/jquery-bbq-plugin/
|
4 |
+
*
|
5 |
+
* Copyright (c) 2010 "Cowboy" Ben Alman
|
6 |
+
* Dual licensed under the MIT and GPL licenses.
|
7 |
+
* http://benalman.com/about/license/
|
8 |
+
*/
|
9 |
+
(function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M<N?O[P]||(R[M+1]&&isNaN(R[M+1])?{}:[]):J}}else{if($.isArray(H[P])){H[P].push(J)}else{if(H[P]!==i){H[P]=[H[P],J]}else{H[P]=J}}}}else{if(P){H[P]=F?i:""}}});return H};function z(H,F,G){if(F===i||typeof F==="boolean"){G=F;F=a[H?D:A]()}else{F=E(F)?F.replace(H?w:x,""):F}return l(F,G)}l[A]=B(z,0);l[D]=v=B(z,1);$[y]||($[y]=function(F){return $.extend(C,F)})({a:k,base:k,iframe:t,img:t,input:t,form:"action",link:k,script:t});j=$[y];function s(I,G,H,F){if(!E(H)&&typeof H!=="object"){F=H;H=G;G=i}return this.each(function(){var L=$(this),J=G||j()[(this.nodeName||"").toLowerCase()]||"",K=J&&L.attr(J)||"";L.attr(J,a[I](K,H,F))})}$.fn[A]=B(s,A);$.fn[D]=B(s,D);b.pushState=q=function(I,F){if(E(I)&&/^#/.test(I)&&F===i){F=2}var H=I!==i,G=c(p[g][k],H?I:{},H?F:2);p[g][k]=G+(/#/.test(G)?"":"#")};b.getState=u=function(F,G){return F===i||typeof F==="boolean"?v(F):v(G)[F]};b.removeState=function(F){var G={};if(F!==i){G=u();$.each($.isArray(F)?F:arguments,function(I,H){delete G[H]})}q(G,2)};e[d]=$.extend(e[d],{add:function(F){var H;function G(J){var I=J[D]=c();J.getState=function(K,L){return K===i||typeof K==="boolean"?l(I,K):l(I,L)[K]};H.apply(this,arguments)}if($.isFunction(F)){H=F;return G}else{H=F.handler;F.handler=G}}})})(jQuery,this);
|
10 |
+
/*
|
11 |
+
* jQuery hashchange event - v1.2 - 2/11/2010
|
12 |
+
* http://benalman.com/projects/jquery-hashchange-plugin/
|
13 |
+
*
|
14 |
+
* Copyright (c) 2010 "Cowboy" Ben Alman
|
15 |
+
* Dual licensed under the MIT and GPL licenses.
|
16 |
+
* http://benalman.com/about/license/
|
17 |
+
*/
|
18 |
(function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);
|
js/libraries/isotope/js/jquery.infinitescroll.min.js
CHANGED
@@ -1,47 +1,47 @@
|
|
1 |
-
/*
|
2 |
-
--------------------------------
|
3 |
-
Infinite Scroll
|
4 |
-
--------------------------------
|
5 |
-
+ https://github.com/paulirish/infinitescroll
|
6 |
-
+ version 2.0b2.110713
|
7 |
-
+ Copyright 2011 Paul Irish & Luke Shumard
|
8 |
-
+ Licensed under the MIT license
|
9 |
-
|
10 |
-
+ Documentation: http://infinite-scroll.com/
|
11 |
-
|
12 |
-
*/
|
13 |
-
|
14 |
-
(function(window,$,undefined){$.infinitescroll=function infscr(options,callback,element){this.element=$(element);this._create(options,callback);};$.infinitescroll.defaults={loading:{finished:undefined,finishedMsg:"<em>Congratulations, you've reached the end of the internet.</em>",img:"http://www.infinite-scroll.com/loading.gif",msg:null,msgText:"<em>Loading the next set of posts...</em>",selector:null,speed:'fast',start:undefined},state:{isDuringAjax:false,isInvalidPage:false,isDestroyed:false,isDone:false,isPaused:false,currPage:1},callback:undefined,debug:false,behavior:undefined,binder:$(window),nextSelector:"div.navigation a:first",navSelector:"div.navigation",contentSelector:null,extraScrollPx:150,itemSelector:"div.post",animate:false,pathParse:undefined,dataType:'html',appendCallback:true,bufferPx:40,errorCallback:function(){},infid:0,pixelsFromNavToBottom:undefined,path:undefined};$.infinitescroll.prototype={_binding:function infscr_binding(binding){var instance=this,opts=instance.options;if(!!opts.behavior&&this['_binding_'+opts.behavior]!==undefined){this['_binding_'+opts.behavior].call(this);return;}
|
15 |
-
if(binding!=='bind'&&binding!=='unbind'){this._debug('Binding value '+binding+' not valid')
|
16 |
-
return false;}
|
17 |
-
if(binding=='unbind'){(this.options.binder).unbind('smartscroll.infscr.'+instance.options.infid);}else{(this.options.binder)[binding]('smartscroll.infscr.'+instance.options.infid,function(){instance.scroll();});};this._debug('Binding',binding);},_create:function infscr_create(options,callback){if(!this._validate(options)){return false;}
|
18 |
-
var opts=this.options=$.extend(true,{},$.infinitescroll.defaults,options),relurl=/(.*?\/\/).*?(\/.*)/,path=$(opts.nextSelector).attr('href');opts.contentSelector=opts.contentSelector||this.element;opts.loading.selector=opts.loading.selector||opts.contentSelector;if(!path){this._debug('Navigation selector not found');return;}
|
19 |
-
opts.path=this._determinepath(path);opts.loading.msg=$('<div id="infscr-loading"><img alt="Loading..." src="'+opts.loading.img+'" /><div>'+opts.loading.msgText+'</div></div>');(new Image()).src=opts.loading.img;opts.pixelsFromNavToBottom=$(document).height()-$(opts.navSelector).offset().top;opts.loading.start=opts.loading.start||function(){$(opts.navSelector).hide();opts.loading.msg.appendTo(opts.loading.selector).show(opts.loading.speed,function(){beginAjax(opts);});};opts.loading.finished=opts.loading.finished||function(){opts.loading.msg.fadeOut('normal');};opts.callback=function(instance,data){if(!!opts.behavior&&instance['_callback_'+opts.behavior]!==undefined){instance['_callback_'+opts.behavior].call($(opts.contentSelector)[0],data);}
|
20 |
-
if(callback){callback.call($(opts.contentSelector)[0],data);}};this._setup();},_debug:function infscr_debug(){if(this.options.debug){return window.console&&console.log.call(console,arguments);}},_determinepath:function infscr_determinepath(path){var opts=this.options;if(!!opts.behavior&&this['_determinepath_'+opts.behavior]!==undefined){this['_determinepath_'+opts.behavior].call(this,path);return;}
|
21 |
-
if(!!opts.pathParse){this._debug('pathParse manual');return opts.pathParse;}else if(path.match(/^(.*?)\b2\b(.*?$)/)){path=path.match(/^(.*?)\b2\b(.*?$)/).slice(1);}else if(path.match(/^(.*?)2(.*?$)/)){if(path.match(/^(.*?page=)2(\/.*|$)/)){path=path.match(/^(.*?page=)2(\/.*|$)/).slice(1);return path;}
|
22 |
-
path=path.match(/^(.*?)2(.*?$)/).slice(1);}else{if(path.match(/^(.*?page=)1(\/.*|$)/)){path=path.match(/^(.*?page=)1(\/.*|$)/).slice(1);return path;}else{this._debug('Sorry, we couldn\'t parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com.');opts.state.isInvalidPage=true;}}
|
23 |
-
this._debug('determinePath',path);return path;},_error:function infscr_error(xhr){var opts=this.options;if(!!opts.behavior&&this['_error_'+opts.behavior]!==undefined){this['_error_'+opts.behavior].call(this,xhr);return;}
|
24 |
-
if(xhr!=='destroy'&&xhr!=='end'){xhr='unknown';}
|
25 |
-
this._debug('Error',xhr);if(xhr=='end'){this._showdonemsg();}
|
26 |
-
opts.state.isDone=true;opts.state.currPage=1;opts.state.isPaused=false;this._binding('unbind');},_loadcallback:function infscr_loadcallback(box,data){var opts=this.options,callback=this.options.callback,result=(opts.state.isDone)?'done':(!opts.appendCallback)?'no-append':'append',frag;if(!!opts.behavior&&this['_loadcallback_'+opts.behavior]!==undefined){this['_loadcallback_'+opts.behavior].call(this,box,data);return;}
|
27 |
-
switch(result){case'done':this._showdonemsg();return false;break;case'no-append':if(opts.dataType=='html'){data='<div>'+data+'</div>';data=$(data).find(opts.itemSelector);};break;case'append':var children=box.children();if(children.length==0){return this._error('end');}
|
28 |
-
frag=document.createDocumentFragment();while(box[0].firstChild){frag.appendChild(box[0].firstChild);}
|
29 |
-
this._debug('contentSelector',$(opts.contentSelector)[0])
|
30 |
-
$(opts.contentSelector)[0].appendChild(frag);data=children.get();break;}
|
31 |
-
opts.loading.finished.call($(opts.contentSelector)[0],opts)
|
32 |
-
if(opts.animate){var scrollTo=$(window).scrollTop()+$('#infscr-loading').height()+opts.extraScrollPx+'px';$('html,body').animate({scrollTop:scrollTo},800,function(){opts.state.isDuringAjax=false;});}
|
33 |
-
if(!opts.animate)opts.state.isDuringAjax=false;callback(this,data);},_nearbottom:function infscr_nearbottom(){var opts=this.options,pixelsFromWindowBottomToBottom=0+$(document).height()-(opts.binder.scrollTop())-$(window).height();if(!!opts.behavior&&this['_nearbottom_'+opts.behavior]!==undefined){this['_nearbottom_'+opts.behavior].call(this);return;}
|
34 |
-
this._debug('math:',pixelsFromWindowBottomToBottom,opts.pixelsFromNavToBottom);return(pixelsFromWindowBottomToBottom-opts.bufferPx<opts.pixelsFromNavToBottom);},_pausing:function infscr_pausing(pause){var opts=this.options;if(!!opts.behavior&&this['_pausing_'+opts.behavior]!==undefined){this['_pausing_'+opts.behavior].call(this,pause);return;}
|
35 |
-
if(pause!=='pause'&&pause!=='resume'&&pause!==null){this._debug('Invalid argument. Toggling pause value instead');};pause=(pause&&(pause=='pause'||pause=='resume'))?pause:'toggle';switch(pause){case'pause':opts.state.isPaused=true;break;case'resume':opts.state.isPaused=false;break;case'toggle':opts.state.isPaused=!opts.state.isPaused;break;}
|
36 |
-
this._debug('Paused',opts.state.isPaused);return false;},_setup:function infscr_setup(){var opts=this.options;if(!!opts.behavior&&this['_setup_'+opts.behavior]!==undefined){this['_setup_'+opts.behavior].call(this);return;}
|
37 |
-
this._binding('bind');return false;},_showdonemsg:function infscr_showdonemsg(){var opts=this.options;if(!!opts.behavior&&this['_showdonemsg_'+opts.behavior]!==undefined){this['_showdonemsg_'+opts.behavior].call(this);return;}
|
38 |
-
opts.loading.msg.find('img').hide().parent().find('div').html(opts.loading.finishedMsg).animate({opacity:1},2000,function(){$(this).parent().fadeOut('normal');});opts.errorCallback.call($(opts.contentSelector)[0],'done');},_validate:function infscr_validate(opts){for(var key in opts){if(key.indexOf&&key.indexOf('Selector')>-1&&$(opts[key]).length===0){this._debug('Your '+key+' found no elements.');return false;}
|
39 |
-
return true;}},bind:function infscr_bind(){this._binding('bind');},destroy:function infscr_destroy(){this.options.state.isDestroyed=true;return this._error('destroy');},pause:function infscr_pause(){this._pausing('pause');},resume:function infscr_resume(){this._pausing('resume');},retrieve:function infscr_retrieve(pageNum){var instance=this,opts=instance.options,path=opts.path,box,frag,desturl,method,condition,pageNum=pageNum||null,getPage=(!!pageNum)?pageNum:opts.state.currPage;beginAjax=function infscr_ajax(opts){opts.state.currPage++;instance._debug('heading into ajax',path);box=$(opts.contentSelector).is('table')?$('<tbody/>'):$('<div/>');desturl=path.join(opts.state.currPage);method=(opts.dataType=='html'||opts.dataType=='json')?opts.dataType:'html+callback';if(opts.appendCallback&&opts.dataType=='html')method+='+callback'
|
40 |
-
switch(method){case'html+callback':instance._debug('Using HTML via .load() method');box.load(desturl+' '+opts.itemSelector,null,function infscr_ajax_callback(responseText){instance._loadcallback(box,responseText);});break;case'html':case'json':instance._debug('Using '+(method.toUpperCase())+' via $.ajax() method');$.ajax({url:desturl,dataType:opts.dataType,complete:function infscr_ajax_callback(jqXHR,textStatus){condition=(typeof(jqXHR.isResolved)!=='undefined')?(jqXHR.isResolved()):(textStatus==="success"||textStatus==="notmodified");(condition)?instance._loadcallback(box,jqXHR.responseText):instance._error('end');}});break;}};if(!!opts.behavior&&this['retrieve_'+opts.behavior]!==undefined){this['retrieve_'+opts.behavior].call(this,pageNum);return;}
|
41 |
-
if(opts.state.isDestroyed){this._debug('Instance is destroyed');return false;};opts.state.isDuringAjax=true;opts.loading.start.call($(opts.contentSelector)[0],opts);},scroll:function infscr_scroll(){var opts=this.options,state=opts.state;if(!!opts.behavior&&this['scroll_'+opts.behavior]!==undefined){this['scroll_'+opts.behavior].call(this);return;}
|
42 |
-
if(state.isDuringAjax||state.isInvalidPage||state.isDone||state.isDestroyed||state.isPaused)return;if(!this._nearbottom())return;this.retrieve();},toggle:function infscr_toggle(){this._pausing();},unbind:function infscr_unbind(){this._binding('unbind');},update:function infscr_options(key){if($.isPlainObject(key)){this.options=$.extend(true,this.options,key);}}}
|
43 |
-
$.fn.infinitescroll=function infscr_init(options,callback){var thisCall=typeof options;switch(thisCall){case'string':var args=Array.prototype.slice.call(arguments,1);this.each(function(){var instance=$.data(this,'infinitescroll');if(!instance){return false;}
|
44 |
-
if(!$.isFunction(instance[options])||options.charAt(0)==="_"){return false;}
|
45 |
-
instance[options].apply(instance,args);});break;case'object':this.each(function(){var instance=$.data(this,'infinitescroll');if(instance){instance.update(options);}else{$.data(this,'infinitescroll',new $.infinitescroll(options,callback,this));}});break;}
|
46 |
-
return this;};var event=$.event,scrollTimeout;event.special.smartscroll={setup:function(){$(this).bind("scroll",event.special.smartscroll.handler);},teardown:function(){$(this).unbind("scroll",event.special.smartscroll.handler);},handler:function(event,execAsap){var context=this,args=arguments;event.type="smartscroll";if(scrollTimeout){clearTimeout(scrollTimeout);}
|
47 |
scrollTimeout=setTimeout(function(){$.event.handle.apply(context,args);},execAsap==="execAsap"?0:100);}};$.fn.smartscroll=function(fn){return fn?this.bind("smartscroll",fn):this.trigger("smartscroll",["execAsap"]);};})(window,jQuery);
|
1 |
+
/*
|
2 |
+
--------------------------------
|
3 |
+
Infinite Scroll
|
4 |
+
--------------------------------
|
5 |
+
+ https://github.com/paulirish/infinitescroll
|
6 |
+
+ version 2.0b2.110713
|
7 |
+
+ Copyright 2011 Paul Irish & Luke Shumard
|
8 |
+
+ Licensed under the MIT license
|
9 |
+
|
10 |
+
+ Documentation: http://infinite-scroll.com/
|
11 |
+
|
12 |
+
*/
|
13 |
+
|
14 |
+
(function(window,$,undefined){$.infinitescroll=function infscr(options,callback,element){this.element=$(element);this._create(options,callback);};$.infinitescroll.defaults={loading:{finished:undefined,finishedMsg:"<em>Congratulations, you've reached the end of the internet.</em>",img:"http://www.infinite-scroll.com/loading.gif",msg:null,msgText:"<em>Loading the next set of posts...</em>",selector:null,speed:'fast',start:undefined},state:{isDuringAjax:false,isInvalidPage:false,isDestroyed:false,isDone:false,isPaused:false,currPage:1},callback:undefined,debug:false,behavior:undefined,binder:$(window),nextSelector:"div.navigation a:first",navSelector:"div.navigation",contentSelector:null,extraScrollPx:150,itemSelector:"div.post",animate:false,pathParse:undefined,dataType:'html',appendCallback:true,bufferPx:40,errorCallback:function(){},infid:0,pixelsFromNavToBottom:undefined,path:undefined};$.infinitescroll.prototype={_binding:function infscr_binding(binding){var instance=this,opts=instance.options;if(!!opts.behavior&&this['_binding_'+opts.behavior]!==undefined){this['_binding_'+opts.behavior].call(this);return;}
|
15 |
+
if(binding!=='bind'&&binding!=='unbind'){this._debug('Binding value '+binding+' not valid')
|
16 |
+
return false;}
|
17 |
+
if(binding=='unbind'){(this.options.binder).unbind('smartscroll.infscr.'+instance.options.infid);}else{(this.options.binder)[binding]('smartscroll.infscr.'+instance.options.infid,function(){instance.scroll();});};this._debug('Binding',binding);},_create:function infscr_create(options,callback){if(!this._validate(options)){return false;}
|
18 |
+
var opts=this.options=$.extend(true,{},$.infinitescroll.defaults,options),relurl=/(.*?\/\/).*?(\/.*)/,path=$(opts.nextSelector).attr('href');opts.contentSelector=opts.contentSelector||this.element;opts.loading.selector=opts.loading.selector||opts.contentSelector;if(!path){this._debug('Navigation selector not found');return;}
|
19 |
+
opts.path=this._determinepath(path);opts.loading.msg=$('<div id="infscr-loading"><img alt="Loading..." src="'+opts.loading.img+'" /><div>'+opts.loading.msgText+'</div></div>');(new Image()).src=opts.loading.img;opts.pixelsFromNavToBottom=$(document).height()-$(opts.navSelector).offset().top;opts.loading.start=opts.loading.start||function(){$(opts.navSelector).hide();opts.loading.msg.appendTo(opts.loading.selector).show(opts.loading.speed,function(){beginAjax(opts);});};opts.loading.finished=opts.loading.finished||function(){opts.loading.msg.fadeOut('normal');};opts.callback=function(instance,data){if(!!opts.behavior&&instance['_callback_'+opts.behavior]!==undefined){instance['_callback_'+opts.behavior].call($(opts.contentSelector)[0],data);}
|
20 |
+
if(callback){callback.call($(opts.contentSelector)[0],data);}};this._setup();},_debug:function infscr_debug(){if(this.options.debug){return window.console&&console.log.call(console,arguments);}},_determinepath:function infscr_determinepath(path){var opts=this.options;if(!!opts.behavior&&this['_determinepath_'+opts.behavior]!==undefined){this['_determinepath_'+opts.behavior].call(this,path);return;}
|
21 |
+
if(!!opts.pathParse){this._debug('pathParse manual');return opts.pathParse;}else if(path.match(/^(.*?)\b2\b(.*?$)/)){path=path.match(/^(.*?)\b2\b(.*?$)/).slice(1);}else if(path.match(/^(.*?)2(.*?$)/)){if(path.match(/^(.*?page=)2(\/.*|$)/)){path=path.match(/^(.*?page=)2(\/.*|$)/).slice(1);return path;}
|
22 |
+
path=path.match(/^(.*?)2(.*?$)/).slice(1);}else{if(path.match(/^(.*?page=)1(\/.*|$)/)){path=path.match(/^(.*?page=)1(\/.*|$)/).slice(1);return path;}else{this._debug('Sorry, we couldn\'t parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com.');opts.state.isInvalidPage=true;}}
|
23 |
+
this._debug('determinePath',path);return path;},_error:function infscr_error(xhr){var opts=this.options;if(!!opts.behavior&&this['_error_'+opts.behavior]!==undefined){this['_error_'+opts.behavior].call(this,xhr);return;}
|
24 |
+
if(xhr!=='destroy'&&xhr!=='end'){xhr='unknown';}
|
25 |
+
this._debug('Error',xhr);if(xhr=='end'){this._showdonemsg();}
|
26 |
+
opts.state.isDone=true;opts.state.currPage=1;opts.state.isPaused=false;this._binding('unbind');},_loadcallback:function infscr_loadcallback(box,data){var opts=this.options,callback=this.options.callback,result=(opts.state.isDone)?'done':(!opts.appendCallback)?'no-append':'append',frag;if(!!opts.behavior&&this['_loadcallback_'+opts.behavior]!==undefined){this['_loadcallback_'+opts.behavior].call(this,box,data);return;}
|
27 |
+
switch(result){case'done':this._showdonemsg();return false;break;case'no-append':if(opts.dataType=='html'){data='<div>'+data+'</div>';data=$(data).find(opts.itemSelector);};break;case'append':var children=box.children();if(children.length==0){return this._error('end');}
|
28 |
+
frag=document.createDocumentFragment();while(box[0].firstChild){frag.appendChild(box[0].firstChild);}
|
29 |
+
this._debug('contentSelector',$(opts.contentSelector)[0])
|
30 |
+
$(opts.contentSelector)[0].appendChild(frag);data=children.get();break;}
|
31 |
+
opts.loading.finished.call($(opts.contentSelector)[0],opts)
|
32 |
+
if(opts.animate){var scrollTo=$(window).scrollTop()+$('#infscr-loading').height()+opts.extraScrollPx+'px';$('html,body').animate({scrollTop:scrollTo},800,function(){opts.state.isDuringAjax=false;});}
|
33 |
+
if(!opts.animate)opts.state.isDuringAjax=false;callback(this,data);},_nearbottom:function infscr_nearbottom(){var opts=this.options,pixelsFromWindowBottomToBottom=0+$(document).height()-(opts.binder.scrollTop())-$(window).height();if(!!opts.behavior&&this['_nearbottom_'+opts.behavior]!==undefined){this['_nearbottom_'+opts.behavior].call(this);return;}
|
34 |
+
this._debug('math:',pixelsFromWindowBottomToBottom,opts.pixelsFromNavToBottom);return(pixelsFromWindowBottomToBottom-opts.bufferPx<opts.pixelsFromNavToBottom);},_pausing:function infscr_pausing(pause){var opts=this.options;if(!!opts.behavior&&this['_pausing_'+opts.behavior]!==undefined){this['_pausing_'+opts.behavior].call(this,pause);return;}
|
35 |
+
if(pause!=='pause'&&pause!=='resume'&&pause!==null){this._debug('Invalid argument. Toggling pause value instead');};pause=(pause&&(pause=='pause'||pause=='resume'))?pause:'toggle';switch(pause){case'pause':opts.state.isPaused=true;break;case'resume':opts.state.isPaused=false;break;case'toggle':opts.state.isPaused=!opts.state.isPaused;break;}
|
36 |
+
this._debug('Paused',opts.state.isPaused);return false;},_setup:function infscr_setup(){var opts=this.options;if(!!opts.behavior&&this['_setup_'+opts.behavior]!==undefined){this['_setup_'+opts.behavior].call(this);return;}
|
37 |
+
this._binding('bind');return false;},_showdonemsg:function infscr_showdonemsg(){var opts=this.options;if(!!opts.behavior&&this['_showdonemsg_'+opts.behavior]!==undefined){this['_showdonemsg_'+opts.behavior].call(this);return;}
|
38 |
+
opts.loading.msg.find('img').hide().parent().find('div').html(opts.loading.finishedMsg).animate({opacity:1},2000,function(){$(this).parent().fadeOut('normal');});opts.errorCallback.call($(opts.contentSelector)[0],'done');},_validate:function infscr_validate(opts){for(var key in opts){if(key.indexOf&&key.indexOf('Selector')>-1&&$(opts[key]).length===0){this._debug('Your '+key+' found no elements.');return false;}
|
39 |
+
return true;}},bind:function infscr_bind(){this._binding('bind');},destroy:function infscr_destroy(){this.options.state.isDestroyed=true;return this._error('destroy');},pause:function infscr_pause(){this._pausing('pause');},resume:function infscr_resume(){this._pausing('resume');},retrieve:function infscr_retrieve(pageNum){var instance=this,opts=instance.options,path=opts.path,box,frag,desturl,method,condition,pageNum=pageNum||null,getPage=(!!pageNum)?pageNum:opts.state.currPage;beginAjax=function infscr_ajax(opts){opts.state.currPage++;instance._debug('heading into ajax',path);box=$(opts.contentSelector).is('table')?$('<tbody/>'):$('<div/>');desturl=path.join(opts.state.currPage);method=(opts.dataType=='html'||opts.dataType=='json')?opts.dataType:'html+callback';if(opts.appendCallback&&opts.dataType=='html')method+='+callback'
|
40 |
+
switch(method){case'html+callback':instance._debug('Using HTML via .load() method');box.load(desturl+' '+opts.itemSelector,null,function infscr_ajax_callback(responseText){instance._loadcallback(box,responseText);});break;case'html':case'json':instance._debug('Using '+(method.toUpperCase())+' via $.ajax() method');$.ajax({url:desturl,dataType:opts.dataType,complete:function infscr_ajax_callback(jqXHR,textStatus){condition=(typeof(jqXHR.isResolved)!=='undefined')?(jqXHR.isResolved()):(textStatus==="success"||textStatus==="notmodified");(condition)?instance._loadcallback(box,jqXHR.responseText):instance._error('end');}});break;}};if(!!opts.behavior&&this['retrieve_'+opts.behavior]!==undefined){this['retrieve_'+opts.behavior].call(this,pageNum);return;}
|
41 |
+
if(opts.state.isDestroyed){this._debug('Instance is destroyed');return false;};opts.state.isDuringAjax=true;opts.loading.start.call($(opts.contentSelector)[0],opts);},scroll:function infscr_scroll(){var opts=this.options,state=opts.state;if(!!opts.behavior&&this['scroll_'+opts.behavior]!==undefined){this['scroll_'+opts.behavior].call(this);return;}
|
42 |
+
if(state.isDuringAjax||state.isInvalidPage||state.isDone||state.isDestroyed||state.isPaused)return;if(!this._nearbottom())return;this.retrieve();},toggle:function infscr_toggle(){this._pausing();},unbind:function infscr_unbind(){this._binding('unbind');},update:function infscr_options(key){if($.isPlainObject(key)){this.options=$.extend(true,this.options,key);}}}
|
43 |
+
$.fn.infinitescroll=function infscr_init(options,callback){var thisCall=typeof options;switch(thisCall){case'string':var args=Array.prototype.slice.call(arguments,1);this.each(function(){var instance=$.data(this,'infinitescroll');if(!instance){return false;}
|
44 |
+
if(!$.isFunction(instance[options])||options.charAt(0)==="_"){return false;}
|
45 |
+
instance[options].apply(instance,args);});break;case'object':this.each(function(){var instance=$.data(this,'infinitescroll');if(instance){instance.update(options);}else{$.data(this,'infinitescroll',new $.infinitescroll(options,callback,this));}});break;}
|
46 |
+
return this;};var event=$.event,scrollTimeout;event.special.smartscroll={setup:function(){$(this).bind("scroll",event.special.smartscroll.handler);},teardown:function(){$(this).unbind("scroll",event.special.smartscroll.handler);},handler:function(event,execAsap){var context=this,args=arguments;event.type="smartscroll";if(scrollTimeout){clearTimeout(scrollTimeout);}
|
47 |
scrollTimeout=setTimeout(function(){$.event.handle.apply(context,args);},execAsap==="execAsap"?0:100);}};$.fn.smartscroll=function(fn){return fn?this.bind("smartscroll",fn):this.trigger("smartscroll",["execAsap"]);};})(window,jQuery);
|
js/libraries/isotope/js/make-big-graph-projects.js
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
var programs = 'commercial urbanism public-space culture body-culture health education housing hotel media'.split(' '),
|
2 |
-
programsLen = programs.length,
|
3 |
-
statuses = 'idea in-progress under-construction completed'.split(' '),
|
4 |
-
statusesLen = statuses.length;
|
5 |
-
|
6 |
-
function randInt(num) {
|
7 |
-
return Math.floor( Math.random() * num );
|
8 |
-
}
|
9 |
-
|
10 |
-
function getChar() {
|
11 |
-
var code;
|
12 |
-
if ( Math.random() < 0.05 ) {
|
13 |
-
// number
|
14 |
-
code = randInt(10) + 48;
|
15 |
-
} else {
|
16 |
-
// alpha
|
17 |
-
code = randInt(24) + 65;
|
18 |
-
}
|
19 |
-
return String.fromCharCode(code);
|
20 |
-
}
|
21 |
-
|
22 |
-
function makeBigGraphProject() {
|
23 |
-
var year = 2001 + randInt(11),
|
24 |
-
i = Math.floor( Math.random() * 2 + 3 ),
|
25 |
-
title = '';
|
26 |
-
while (i--) {
|
27 |
-
title += getChar();
|
28 |
-
}
|
29 |
-
var program = programs[ randInt( programsLen ) ];
|
30 |
-
status = statuses[ randInt( statusesLen ) ];
|
31 |
-
scale = randInt(20);
|
32 |
-
|
33 |
-
project = '<div class="project ' + program + '" ' +
|
34 |
-
'data-year="' + year + '" ' +
|
35 |
-
'data-program="' + program + '" ' +
|
36 |
-
'data-scale="' + scale + '" ' +
|
37 |
-
'data-status="' + status + '" ' +
|
38 |
-
'><div class="icon"></div>' +
|
39 |
-
'<p class="title">' + title + '</p>' +
|
40 |
-
'</div>';
|
41 |
-
|
42 |
-
return project;
|
43 |
}
|
1 |
+
var programs = 'commercial urbanism public-space culture body-culture health education housing hotel media'.split(' '),
|
2 |
+
programsLen = programs.length,
|
3 |
+
statuses = 'idea in-progress under-construction completed'.split(' '),
|
4 |
+
statusesLen = statuses.length;
|
5 |
+
|
6 |
+
function randInt(num) {
|
7 |
+
return Math.floor( Math.random() * num );
|
8 |
+
}
|
9 |
+
|
10 |
+
function getChar() {
|
11 |
+
var code;
|
12 |
+
if ( Math.random() < 0.05 ) {
|
13 |
+
// number
|
14 |
+
code = randInt(10) + 48;
|
15 |
+
} else {
|
16 |
+
// alpha
|
17 |
+
code = randInt(24) + 65;
|
18 |
+
}
|
19 |
+
return String.fromCharCode(code);
|
20 |
+
}
|
21 |
+
|
22 |
+
function makeBigGraphProject() {
|
23 |
+
var year = 2001 + randInt(11),
|
24 |
+
i = Math.floor( Math.random() * 2 + 3 ),
|
25 |
+
title = '';
|
26 |
+
while (i--) {
|
27 |
+
title += getChar();
|
28 |
+
}
|
29 |
+
var program = programs[ randInt( programsLen ) ];
|
30 |
+
status = statuses[ randInt( statusesLen ) ];
|
31 |
+
scale = randInt(20);
|
32 |
+
|
33 |
+
project = '<div class="project ' + program + '" ' +
|
34 |
+
'data-year="' + year + '" ' +
|
35 |
+
'data-program="' + program + '" ' +
|
36 |
+
'data-scale="' + scale + '" ' +
|
37 |
+
'data-status="' + status + '" ' +
|
38 |
+
'><div class="icon"></div>' +
|
39 |
+
'<p class="title">' + title + '</p>' +
|
40 |
+
'</div>';
|
41 |
+
|
42 |
+
return project;
|
43 |
}
|
js/libraries/jquery-datepicker/jquery.timepicker.js
CHANGED
@@ -1,691 +1,691 @@
|
|
1 |
-
/************************
|
2 |
-
jquery-timepicker
|
3 |
-
http://jonthornton.github.com/jquery-timepicker/
|
4 |
-
|
5 |
-
requires jQuery 1.7+
|
6 |
-
************************/
|
7 |
-
|
8 |
-
(function (factory) {
|
9 |
-
if (typeof define === 'function' && define.amd) {
|
10 |
-
// AMD. Register as an anonymous module.
|
11 |
-
define(['jquery'], factory);
|
12 |
-
} else {
|
13 |
-
// Browser globals
|
14 |
-
factory(jQuery);
|
15 |
-
}
|
16 |
-
}(function ($) {
|
17 |
-
var _baseDate = _generateBaseDate();
|
18 |
-
var _ONE_DAY = 86400;
|
19 |
-
var _defaults = {
|
20 |
-
className: null,
|
21 |
-
minTime: null,
|
22 |
-
maxTime: null,
|
23 |
-
durationTime: null,
|
24 |
-
step: 30,
|
25 |
-
showDuration: false,
|
26 |
-
timeFormat: 'g:ia',
|
27 |
-
scrollDefaultNow: false,
|
28 |
-
scrollDefaultTime: false,
|
29 |
-
selectOnBlur: false,
|
30 |
-
forceRoundTime: false,
|
31 |
-
appendTo: 'body'
|
32 |
-
};
|
33 |
-
var _lang = {
|
34 |
-
decimal: '.',
|
35 |
-
mins: 'mins',
|
36 |
-
hr: 'hr',
|
37 |
-
hrs: 'hrs'
|
38 |
-
};
|
39 |
-
|
40 |
-
var methods =
|
41 |
-
{
|
42 |
-
init: function(options)
|
43 |
-
{
|
44 |
-
return this.each(function()
|
45 |
-
{
|
46 |
-
var self = $(this);
|
47 |
-
|
48 |
-
alert('hi');
|
49 |
-
// convert dropdowns to text input
|
50 |
-
if (self[0].tagName == 'SELECT') {
|
51 |
-
var attrs = { 'type': 'text', 'value': self.val() };
|
52 |
-
var raw_attrs = self[0].attributes;
|
53 |
-
|
54 |
-
for (var i=0; i < raw_attrs.length; i++) {
|
55 |
-
attrs[raw_attrs[i].nodeName] = raw_attrs[i].nodeValue;
|
56 |
-
}
|
57 |
-
|
58 |
-
var input = $('<input />', attrs);
|
59 |
-
self.replaceWith(input);
|
60 |
-
self = input;
|
61 |
-
}
|
62 |
-
|
63 |
-
var settings = $.extend({}, _defaults);
|
64 |
-
|
65 |
-
if (options) {
|
66 |
-
settings = $.extend(settings, options);
|
67 |
-
}
|
68 |
-
|
69 |
-
if (settings.minTime) {
|
70 |
-
settings.minTime = _time2int(settings.minTime);
|
71 |
-
}
|
72 |
-
|
73 |
-
if (settings.maxTime) {
|
74 |
-
settings.maxTime = _time2int(settings.maxTime);
|
75 |
-
}
|
76 |
-
|
77 |
-
if (settings.durationTime) {
|
78 |
-
settings.durationTime = _time2int(settings.durationTime);
|
79 |
-
}
|
80 |
-
|
81 |
-
if (settings.lang) {
|
82 |
-
_lang = $.extend(_lang, settings.lang);
|
83 |
-
}
|
84 |
-
|
85 |
-
self.data('timepicker-settings', settings);
|
86 |
-
self.prop('autocomplete', 'off');
|
87 |
-
self.on('click.timepicker focus.timepicker', methods.show);
|
88 |
-
self.on('blur.timepicker', _formatValue);
|
89 |
-
self.on('keydown.timepicker', _keyhandler);
|
90 |
-
self.addClass('ui-timepicker-input');
|
91 |
-
|
92 |
-
_formatValue.call(self.get(0));
|
93 |
-
});
|
94 |
-
},
|
95 |
-
|
96 |
-
show: function(e)
|
97 |
-
{
|
98 |
-
var self = $(this);
|
99 |
-
|
100 |
-
if ('ontouchstart' in document) {
|
101 |
-
// block the keyboard on mobile devices
|
102 |
-
self.blur();
|
103 |
-
}
|
104 |
-
|
105 |
-
var list = self.data('timepicker-list');
|
106 |
-
|
107 |
-
// check if input is readonly
|
108 |
-
if (self.prop('readonly')) {
|
109 |
-
return;
|
110 |
-
}
|
111 |
-
|
112 |
-
// check if list needs to be rendered
|
113 |
-
if (!list || list.length === 0) {
|
114 |
-
_render(self);
|
115 |
-
list = self.data('timepicker-list');
|
116 |
-
}
|
117 |
-
|
118 |
-
// check if a flag was set to close this picker
|
119 |
-
if (self.hasClass('ui-timepicker-hideme')) {
|
120 |
-
self.removeClass('ui-timepicker-hideme');
|
121 |
-
list.hide();
|
122 |
-
return;
|
123 |
-
}
|
124 |
-
|
125 |
-
if (list.is(':visible')) {
|
126 |
-
return;
|
127 |
-
}
|
128 |
-
|
129 |
-
// make sure other pickers are hidden
|
130 |
-
methods.hide();
|
131 |
-
|
132 |
-
if ((self.offset().top + self.outerHeight(true) + list.outerHeight()) > $(window).height() + $(window).scrollTop()) {
|
133 |
-
// position the dropdown on top
|
134 |
-
list.css({ 'left':(self.offset().left), 'top': self.offset().top - list.outerHeight() });
|
135 |
-
} else {
|
136 |
-
// put it under the input
|
137 |
-
list.css({ 'left':(self.offset().left), 'top': self.offset().top + self.outerHeight() });
|
138 |
-
}
|
139 |
-
|
140 |
-
list.show();
|
141 |
-
|
142 |
-
var settings = self.data('timepicker-settings');
|
143 |
-
// position scrolling
|
144 |
-
var selected = list.find('.ui-timepicker-selected');
|
145 |
-
|
146 |
-
if (!selected.length) {
|
147 |
-
if (self.val()) {
|
148 |
-
selected = _findRow(self, list, _time2int(self.val()));
|
149 |
-
} else if (settings.scrollDefaultNow) {
|
150 |
-
selected = _findRow(self, list, _time2int(new Date()));
|
151 |
-
} else if (settings.scrollDefaultTime !== false) {
|
152 |
-
selected = _findRow(self, list, _time2int(settings.scrollDefaultTime));
|
153 |
-
}
|
154 |
-
}
|
155 |
-
|
156 |
-
if (selected && selected.length) {
|
157 |
-
var topOffset = list.scrollTop() + selected.position().top - selected.outerHeight();
|
158 |
-
list.scrollTop(topOffset);
|
159 |
-
} else {
|
160 |
-
list.scrollTop(0);
|
161 |
-
}
|
162 |
-
|
163 |
-
_attachCloseHandler();
|
164 |
-
|
165 |
-
self.trigger('showTimepicker');
|
166 |
-
},
|
167 |
-
|
168 |
-
hide: function(e)
|
169 |
-
{
|
170 |
-
$('.ui-timepicker-list:visible').each(function() {
|
171 |
-
var list = $(this);
|
172 |
-
var self = list.data('timepicker-input');
|
173 |
-
var settings = self.data('timepicker-settings');
|
174 |
-
|
175 |
-
if (settings && settings.selectOnBlur) {
|
176 |
-
_selectValue(self);
|
177 |
-
}
|
178 |
-
|
179 |
-
list.hide();
|
180 |
-
self.trigger('hideTimepicker');
|
181 |
-
});
|
182 |
-
},
|
183 |
-
|
184 |
-
option: function(key, value)
|
185 |
-
{
|
186 |
-
var self = $(this);
|
187 |
-
var settings = self.data('timepicker-settings');
|
188 |
-
var list = self.data('timepicker-list');
|
189 |
-
|
190 |
-
if (typeof key == 'object') {
|
191 |
-
settings = $.extend(settings, key);
|
192 |
-
|
193 |
-
} else if (typeof key == 'string' && typeof value != 'undefined') {
|
194 |
-
settings[key] = value;
|
195 |
-
|
196 |
-
} else if (typeof key == 'string') {
|
197 |
-
return settings[key];
|
198 |
-
}
|
199 |
-
|
200 |
-
if (settings.minTime) {
|
201 |
-
settings.minTime = _time2int(settings.minTime);
|
202 |
-
}
|
203 |
-
|
204 |
-
if (settings.maxTime) {
|
205 |
-
settings.maxTime = _time2int(settings.maxTime);
|
206 |
-
}
|
207 |
-
|
208 |
-
if (settings.durationTime) {
|
209 |
-
settings.durationTime = _time2int(settings.durationTime);
|
210 |
-
}
|
211 |
-
|
212 |
-
self.data('timepicker-settings', settings);
|
213 |
-
|
214 |
-
if (list) {
|
215 |
-
list.remove();
|
216 |
-
self.data('timepicker-list', false);
|
217 |
-
}
|
218 |
-
|
219 |
-
},
|
220 |
-
|
221 |
-
getSecondsFromMidnight: function()
|
222 |
-
{
|
223 |
-
return _time2int($(this).val());
|
224 |
-
},
|
225 |
-
|
226 |
-
getTime: function()
|
227 |
-
{
|
228 |
-
return new Date(_baseDate.valueOf() + (_time2int($(this).val())*1000));
|
229 |
-
},
|
230 |
-
|
231 |
-
setTime: function(value)
|
232 |
-
{
|
233 |
-
var self = $(this);
|
234 |
-
var prettyTime = _int2time(_time2int(value), self.data('timepicker-settings').timeFormat);
|
235 |
-
self.val(prettyTime);
|
236 |
-
},
|
237 |
-
|
238 |
-
remove: function()
|
239 |
-
{
|
240 |
-
var self = $(this);
|
241 |
-
|
242 |
-
// check if this element is a timepicker
|
243 |
-
if (!self.hasClass('ui-timepicker-input')) {
|
244 |
-
return;
|
245 |
-
}
|
246 |
-
|
247 |
-
self.removeAttr('autocomplete', 'off');
|
248 |
-
self.removeClass('ui-timepicker-input');
|
249 |
-
self.removeData('timepicker-settings');
|
250 |
-
self.off('.timepicker');
|
251 |
-
|
252 |
-
// timepicker-list won't be present unless the user has interacted with this timepicker
|
253 |
-
if (self.data('timepicker-list')) {
|
254 |
-
self.data('timepicker-list').remove();
|
255 |
-
}
|
256 |
-
|
257 |
-
self.removeData('timepicker-list');
|
258 |
-
}
|
259 |
-
};
|
260 |
-
|
261 |
-
// private methods
|
262 |
-
|
263 |
-
function _render(self)
|
264 |
-
{
|
265 |
-
|
266 |
-
|
267 |
-
var settings = self.data('timepicker-settings');
|
268 |
-
var list = self.data('timepicker-list');
|
269 |
-
|
270 |
-
if (list && list.length) {
|
271 |
-
list.remove();
|
272 |
-
self.data('timepicker-list', false);
|
273 |
-
}
|
274 |
-
|
275 |
-
list = $('<ul />', {
|
276 |
-
'tabindex': -1,
|
277 |
-
'class': 'ui-timepicker-list'
|
278 |
-
});
|
279 |
-
|
280 |
-
if (settings.className) {
|
281 |
-
list.addClass(settings.className);
|
282 |
-
}
|
283 |
-
|
284 |
-
list.css({'display':'none', 'position': 'absolute' });
|
285 |
-
|
286 |
-
if ((settings.minTime !== null || settings.durationTime !== null) && settings.showDuration) {
|
287 |
-
list.addClass('ui-timepicker-with-duration');
|
288 |
-
}
|
289 |
-
|
290 |
-
var durStart = (settings.durationTime !== null) ? settings.durationTime : settings.minTime;
|
291 |
-
var start = (settings.minTime !== null) ? settings.minTime : 0;
|
292 |
-
var end = (settings.maxTime !== null) ? settings.maxTime : (start + _ONE_DAY - 1);
|
293 |
-
|
294 |
-
if (end <= start) {
|
295 |
-
// make sure the end time is greater than start time, otherwise there will be no list to show
|
296 |
-
end += _ONE_DAY;
|
297 |
-
}
|
298 |
-
|
299 |
-
for (var i=start; i <= end; i += settings.step*60) {
|
300 |
-
var timeInt = i%_ONE_DAY;
|
301 |
-
var row = $('<li />');
|
302 |
-
row.data('time', timeInt);
|
303 |
-
row.text(_int2time(timeInt, settings.timeFormat));
|
304 |
-
|
305 |
-
if ((settings.minTime !== null || settings.durationTime !== null) && settings.showDuration) {
|
306 |
-
var duration = $('<span />');
|
307 |
-
duration.addClass('ui-timepicker-duration');
|
308 |
-
duration.text(' ('+_int2duration(i - durStart)+')');
|
309 |
-
row.append(duration);
|
310 |
-
}
|
311 |
-
|
312 |
-
list.append(row);
|
313 |
-
}
|
314 |
-
|
315 |
-
|
316 |
-
list.data('timepicker-input', self);
|
317 |
-
self.data('timepicker-list', list);
|
318 |
-
|
319 |
-
var appendTo = settings.appendTo;
|
320 |
-
if (typeof appendTo === 'string') {
|
321 |
-
appendTo = $(appendTo);
|
322 |
-
} else if (typeof appendTo === 'function') {
|
323 |
-
appendTo = appendTo(self);
|
324 |
-
}
|
325 |
-
appendTo.append(list);
|
326 |
-
_setSelected(self, list);
|
327 |
-
|
328 |
-
list.on('click', 'li', function(e) {
|
329 |
-
self.addClass('ui-timepicker-hideme');
|
330 |
-
self[0].focus();
|
331 |
-
|
332 |
-
// make sure only the clicked row is selected
|
333 |
-
list.find('li').removeClass('ui-timepicker-selected');
|
334 |
-
$(this).addClass('ui-timepicker-selected');
|
335 |
-
|
336 |
-
_selectValue(self);
|
337 |
-
list.hide();
|
338 |
-
});
|
339 |
-
}
|
340 |
-
|
341 |
-
function _generateBaseDate()
|
342 |
-
{
|
343 |
-
var _baseDate = new Date();
|
344 |
-
var _currentTimezoneOffset = _baseDate.getTimezoneOffset()*60000;
|
345 |
-
_baseDate.setHours(0); _baseDate.setMinutes(0); _baseDate.setSeconds(0);
|
346 |
-
var _baseDateTimezoneOffset = _baseDate.getTimezoneOffset()*60000;
|
347 |
-
|
348 |
-
return new Date(_baseDate.valueOf() - _baseDateTimezoneOffset + _currentTimezoneOffset);
|
349 |
-
}
|
350 |
-
|
351 |
-
function _attachCloseHandler()
|
352 |
-
{
|
353 |
-
if ('ontouchstart' in document) {
|
354 |
-
$('body').on('touchstart.ui-timepicker', _closeHandler);
|
355 |
-
} else {
|
356 |
-
$('body').on('mousedown.ui-timepicker', _closeHandler);
|
357 |
-
$(window).on('scroll.ui-timepicker', _closeHandler);
|
358 |
-
}
|
359 |
-
}
|
360 |
-
|
361 |
-
// event handler to decide whether to close timepicker
|
362 |
-
function _closeHandler(e)
|
363 |
-
{
|
364 |
-
var target = $(e.target);
|
365 |
-
var input = target.closest('.ui-timepicker-input');
|
366 |
-
if (input.length === 0 && target.closest('.ui-timepicker-list').length === 0) {
|
367 |
-
methods.hide();
|
368 |
-
}
|
369 |
-
|
370 |
-
$('body').unbind('.ui-timepicker');
|
371 |
-
$(window).unbind('.ui-timepicker');
|
372 |
-
}
|
373 |
-
|
374 |
-
function _findRow(self, list, value)
|
375 |
-
{
|
376 |
-
if (!value && value !== 0) {
|
377 |
-
return false;
|
378 |
-
}
|
379 |
-
|
380 |
-
var settings = self.data('timepicker-settings');
|
381 |
-
var out = false;
|
382 |
-
var halfStep = settings.step*30;
|
383 |
-
|
384 |
-
// loop through the menu items
|
385 |
-
list.find('li').each(function(i, obj) {
|
386 |
-
var jObj = $(obj);
|
387 |
-
|
388 |
-
var offset = jObj.data('time') - value;
|
389 |
-
|
390 |
-
// check if the value is less than half a step from each row
|
391 |
-
if (Math.abs(offset) < halfStep || offset == halfStep) {
|
392 |
-
out = jObj;
|
393 |
-
return false;
|
394 |
-
}
|
395 |
-
});
|
396 |
-
|
397 |
-
return out;
|
398 |
-
}
|
399 |
-
|
400 |
-
function _setSelected(self, list)
|
401 |
-
{
|
402 |
-
var timeValue = _time2int(self.val());
|
403 |
-
|
404 |
-
var selected = _findRow(self, list, timeValue);
|
405 |
-
if (selected) selected.addClass('ui-timepicker-selected');
|
406 |
-
}
|
407 |
-
|
408 |
-
|
409 |
-
function _formatValue()
|
410 |
-
{
|
411 |
-
if (this.value === '') {
|
412 |
-
return;
|
413 |
-
}
|
414 |
-
|
415 |
-
var self = $(this);
|
416 |
-
var seconds = _time2int(this.value);
|
417 |
-
|
418 |
-
if (seconds === null) {
|
419 |
-
self.trigger('timeFormatError');
|
420 |
-
return;
|
421 |
-
}
|
422 |
-
|
423 |
-
var settings = self.data('timepicker-settings');
|
424 |
-
|
425 |
-
if (settings.forceRoundTime) {
|
426 |
-
var offset = seconds % (settings.step*60); // step is in minutes
|
427 |
-
|
428 |
-
if (offset >= settings.step*30) {
|
429 |
-
// if offset is larger than a half step, round up
|
430 |
-
seconds += (settings.step*60) - offset;
|
431 |
-
} else {
|
432 |
-
// round down
|
433 |
-
seconds -= offset;
|
434 |
-
}
|
435 |
-
}
|
436 |
-
|
437 |
-
var prettyTime = _int2time(seconds, settings.timeFormat);
|
438 |
-
self.val(prettyTime);
|
439 |
-
}
|
440 |
-
|
441 |
-
function _keyhandler(e)
|
442 |
-
{
|
443 |
-
var self = $(this);
|
444 |
-
var list = self.data('timepicker-list');
|
445 |
-
|
446 |
-
if (!list.is(':visible')) {
|
447 |
-
if (e.keyCode == 40) {
|
448 |
-
self.focus();
|
449 |
-
} else {
|
450 |
-
return true;
|
451 |
-
}
|
452 |
-
}
|
453 |
-
|
454 |
-
switch (e.keyCode) {
|
455 |
-
|
456 |
-
case 13: // return
|
457 |
-
_selectValue(self);
|
458 |
-
methods.hide.apply(this);
|
459 |
-
e.preventDefault();
|
460 |
-
return false;
|
461 |
-
|
462 |
-
case 38: // up
|
463 |
-
var selected = list.find('.ui-timepicker-selected');
|
464 |
-
|
465 |
-
if (!selected.length) {
|
466 |
-
list.children().each(function(i, obj) {
|
467 |
-
if ($(obj).position().top > 0) {
|
468 |
-
selected = $(obj);
|
469 |
-
return false;
|
470 |
-
}
|
471 |
-
});
|
472 |
-
selected.addClass('ui-timepicker-selected');
|
473 |
-
|
474 |
-
} else if (!selected.is(':first-child')) {
|
475 |
-
selected.removeClass('ui-timepicker-selected');
|
476 |
-
selected.prev().addClass('ui-timepicker-selected');
|
477 |
-
|
478 |
-
if (selected.prev().position().top < selected.outerHeight()) {
|
479 |
-
list.scrollTop(list.scrollTop() - selected.outerHeight());
|
480 |
-
}
|
481 |
-
}
|
482 |
-
|
483 |
-
break;
|
484 |
-
|
485 |
-
case 40: // down
|
486 |
-
selected = list.find('.ui-timepicker-selected');
|
487 |
-
|
488 |
-
if (selected.length === 0) {
|
489 |
-
list.children().each(function(i, obj) {
|
490 |
-
if ($(obj).position().top > 0) {
|
491 |
-
selected = $(obj);
|
492 |
-
return false;
|
493 |
-
}
|
494 |
-
});
|
495 |
-
|
496 |
-
selected.addClass('ui-timepicker-selected');
|
497 |
-
} else if (!selected.is(':last-child')) {
|
498 |
-
selected.removeClass('ui-timepicker-selected');
|
499 |
-
selected.next().addClass('ui-timepicker-selected');
|
500 |
-
|
501 |
-
if (selected.next().position().top + 2*selected.outerHeight() > list.outerHeight()) {
|
502 |
-
list.scrollTop(list.scrollTop() + selected.outerHeight());
|
503 |
-
}
|
504 |
-
}
|
505 |
-
|
506 |
-
break;
|
507 |
-
|
508 |
-
case 27: // escape
|
509 |
-
list.find('li').removeClass('ui-timepicker-selected');
|
510 |
-
list.hide();
|
511 |
-
break;
|
512 |
-
|
513 |
-
case 9: //tab
|
514 |
-
methods.hide();
|
515 |
-
break;
|
516 |
-
|
517 |
-
case 16:
|
518 |
-
case 17:
|
519 |
-
case 18:
|
520 |
-
case 19:
|
521 |
-
case 20:
|
522 |
-
case 33:
|
523 |
-
case 34:
|
524 |
-
case 35:
|
525 |
-
case 36:
|
526 |
-
case 37:
|
527 |
-
case 39:
|
528 |
-
case 45:
|
529 |
-
return;
|
530 |
-
|
531 |
-
default:
|
532 |
-
list.find('li').removeClass('ui-timepicker-selected');
|
533 |
-
return;
|
534 |
-
}
|
535 |
-
}
|
536 |
-
|
537 |
-
function _selectValue(self)
|
538 |
-
{
|
539 |
-
var settings = self.data('timepicker-settings');
|
540 |
-
var list = self.data('timepicker-list');
|
541 |
-
var timeValue = null;
|
542 |
-
|
543 |
-
var cursor = list.find('.ui-timepicker-selected');
|
544 |
-
|
545 |
-
if (cursor.length) {
|
546 |
-
// selected value found
|
547 |
-
timeValue = cursor.data('time');
|
548 |
-
|
549 |
-
} else if (self.val()) {
|
550 |
-
|
551 |
-
// no selected value; fall back on input value
|
552 |
-
timeValue = _time2int(self.val());
|
553 |
-
|
554 |
-
_setSelected(self, list);
|
555 |
-
}
|
556 |
-
|
557 |
-
if (timeValue !== null) {
|
558 |
-
var timeString = _int2time(timeValue, settings.timeFormat);
|
559 |
-
self.val(timeString);
|
560 |
-
}
|
561 |
-
|
562 |
-
self.trigger('change').trigger('changeTime');
|
563 |
-
}
|
564 |
-
|
565 |
-
function _int2duration(seconds)
|
566 |
-
{
|
567 |
-
var minutes = Math.round(seconds/60);
|
568 |
-
var duration;
|
569 |
-
|
570 |
-
if (Math.abs(minutes) < 60) {
|
571 |
-
duration = [minutes, _lang.mins];
|
572 |
-
} else if (minutes == 60) {
|
573 |
-
duration = ['1', _lang.hr];
|
574 |
-
} else {
|
575 |
-
var hours = (minutes/60).toFixed(1);
|
576 |
-
if (_lang.decimal != '.') hours = hours.replace('.', _lang.decimal);
|
577 |
-
duration = [hours, _lang.hrs];
|
578 |
-
}
|
579 |
-
|
580 |
-
return duration.join(' ');
|
581 |
-
}
|
582 |
-
|
583 |
-
function _int2time(seconds, format)
|
584 |
-
{
|
585 |
-
if (seconds === null) {
|
586 |
-
return;
|
587 |
-
}
|
588 |
-
|
589 |
-
var time = new Date(_baseDate.valueOf() + (seconds*1000));
|
590 |
-
var output = '';
|
591 |
-
var hour, code;
|
592 |
-
|
593 |
-
for (var i=0; i<format.length; i++) {
|
594 |
-
|
595 |
-
code = format.charAt(i);
|
596 |
-
switch (code) {
|
597 |
-
|
598 |
-
case 'a':
|
599 |
-
output += (time.getHours() > 11) ? 'pm' : 'am';
|
600 |
-
break;
|
601 |
-
|
602 |
-
case 'A':
|
603 |
-
output += (time.getHours() > 11) ? 'PM' : 'AM';
|
604 |
-
break;
|
605 |
-
|
606 |
-
case 'g':
|
607 |
-
hour = time.getHours() % 12;
|
608 |
-
output += (hour === 0) ? '12' : hour;
|
609 |
-
break;
|
610 |
-
|
611 |
-
case 'G':
|
612 |
-
output += time.getHours();
|
613 |
-
break;
|
614 |
-
|
615 |
-
case 'h':
|
616 |
-
hour = time.getHours() % 12;
|
617 |
-
|
618 |
-
if (hour !== 0 && hour < 10) {
|
619 |
-
hour = '0'+hour;
|
620 |
-
}
|
621 |
-
|
622 |
-
output += (hour === 0) ? '12' : hour;
|
623 |
-
break;
|
624 |
-
|
625 |
-
case 'H':
|
626 |
-
hour = time.getHours();
|
627 |
-
output += (hour > 9) ? hour : '0'+hour;
|
628 |
-
break;
|
629 |
-
|
630 |
-
case 'i':
|
631 |
-
var minutes = time.getMinutes();
|
632 |
-
output += (minutes > 9) ? minutes : '0'+minutes;
|
633 |
-
break;
|
634 |
-
|
635 |
-
case 's':
|
636 |
-
seconds = time.getSeconds();
|
637 |
-
output += (seconds > 9) ? seconds : '0'+seconds;
|
638 |
-
break;
|
639 |
-
|
640 |
-
default:
|
641 |
-
output += code;
|
642 |
-
}
|
643 |
-
}
|
644 |
-
|
645 |
-
return output;
|
646 |
-
}
|
647 |
-
|
648 |
-
function _time2int(timeString)
|
649 |
-
{
|
650 |
-
if (timeString === '') return null;
|
651 |
-
if (timeString+0 == timeString) return timeString;
|
652 |
-
|
653 |
-
if (typeof(timeString) == 'object') {
|
654 |
-
timeString = timeString.getHours()+':'+timeString.getMinutes()+':'+timeString.getSeconds();
|
655 |
-
}
|
656 |
-
|
657 |
-
var d = new Date(0);
|
658 |
-
var time = timeString.toLowerCase().match(/(\d{1,2})(?::(\d{1,2}))?(?::(\d{2}))?\s*([pa]?)/);
|
659 |
-
|
660 |
-
if (!time) {
|
661 |
-
return null;
|
662 |
-
}
|
663 |
-
|
664 |
-
var hour = parseInt(time[1]*1, 10);
|
665 |
-
var hours;
|
666 |
-
|
667 |
-
if (time[4]) {
|
668 |
-
if (hour == 12) {
|
669 |
-
hours = (time[4] == 'p') ? 12 : 0;
|
670 |
-
} else {
|
671 |
-
hours = (hour + (time[4] == 'p' ? 12 : 0));
|
672 |
-
}
|
673 |
-
|
674 |
-
} else {
|
675 |
-
hours = hour;
|
676 |
-
}
|
677 |
-
|
678 |
-
var minutes = ( time[2]*1 || 0 );
|
679 |
-
var seconds = ( time[3]*1 || 0 );
|
680 |
-
return hours*3600 + minutes*60 + seconds;
|
681 |
-
}
|
682 |
-
|
683 |
-
// Plugin entry
|
684 |
-
$.fn.timepicker = function(method)
|
685 |
-
{
|
686 |
-
|
687 |
-
if(methods[method]) { return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); }
|
688 |
-
else if(typeof method === "object" || !method) { return methods.init.apply(this, arguments); }
|
689 |
-
else { $.error("Method "+ method + " does not exist on jQuery.timepicker"); }
|
690 |
-
};
|
691 |
-
}));
|
1 |
+
/************************
|
2 |
+
jquery-timepicker
|
3 |
+
http://jonthornton.github.com/jquery-timepicker/
|
4 |
+
|
5 |
+
requires jQuery 1.7+
|
6 |
+
************************/
|
7 |
+
|
8 |
+
(function (factory) {
|
9 |
+
if (typeof define === 'function' && define.amd) {
|
10 |
+
// AMD. Register as an anonymous module.
|
11 |
+
define(['jquery'], factory);
|
12 |
+
} else {
|
13 |
+
// Browser globals
|
14 |
+
factory(jQuery);
|
15 |
+
}
|
16 |
+
}(function ($) {
|
17 |
+
var _baseDate = _generateBaseDate();
|
18 |
+
var _ONE_DAY = 86400;
|
19 |
+
var _defaults = {
|
20 |
+
className: null,
|
21 |
+
minTime: null,
|
22 |
+
maxTime: null,
|
23 |
+
durationTime: null,
|
24 |
+
step: 30,
|
25 |
+
showDuration: false,
|
26 |
+
timeFormat: 'g:ia',
|
27 |
+
scrollDefaultNow: false,
|
28 |
+
scrollDefaultTime: false,
|
29 |
+
selectOnBlur: false,
|
30 |
+
forceRoundTime: false,
|
31 |
+
appendTo: 'body'
|
32 |
+
};
|
33 |
+
var _lang = {
|
34 |
+
decimal: '.',
|
35 |
+
mins: 'mins',
|
36 |
+
hr: 'hr',
|
37 |
+
hrs: 'hrs'
|
38 |
+
};
|
39 |
+
|
40 |
+
var methods =
|
41 |
+
{
|
42 |
+
init: function(options)
|
43 |
+
{
|
44 |
+
return this.each(function()
|
45 |
+
{
|
46 |
+
var self = $(this);
|
47 |
+
|
48 |
+
alert('hi');
|
49 |
+
// convert dropdowns to text input
|
50 |
+
if (self[0].tagName == 'SELECT') {
|
51 |
+
var attrs = { 'type': 'text', 'value': self.val() };
|
52 |
+
var raw_attrs = self[0].attributes;
|
53 |
+
|
54 |
+
for (var i=0; i < raw_attrs.length; i++) {
|
55 |
+
attrs[raw_attrs[i].nodeName] = raw_attrs[i].nodeValue;
|
56 |
+
}
|
57 |
+
|
58 |
+
var input = $('<input />', attrs);
|
59 |
+
self.replaceWith(input);
|
60 |
+
self = input;
|
61 |
+
}
|
62 |
+
|
63 |
+
var settings = $.extend({}, _defaults);
|
64 |
+
|
65 |
+
if (options) {
|
66 |
+
settings = $.extend(settings, options);
|
67 |
+
}
|
68 |
+
|
69 |
+
if (settings.minTime) {
|
70 |
+
settings.minTime = _time2int(settings.minTime);
|
71 |
+
}
|
72 |
+
|
73 |
+
if (settings.maxTime) {
|
74 |
+
settings.maxTime = _time2int(settings.maxTime);
|
75 |
+
}
|
76 |
+
|
77 |
+
if (settings.durationTime) {
|
78 |
+
settings.durationTime = _time2int(settings.durationTime);
|
79 |
+
}
|
80 |
+
|
81 |
+
if (settings.lang) {
|
82 |
+
_lang = $.extend(_lang, settings.lang);
|
83 |
+
}
|
84 |
+
|
85 |
+
self.data('timepicker-settings', settings);
|
86 |
+
self.prop('autocomplete', 'off');
|
87 |
+
self.on('click.timepicker focus.timepicker', methods.show);
|
88 |
+
self.on('blur.timepicker', _formatValue);
|
89 |
+
self.on('keydown.timepicker', _keyhandler);
|
90 |
+
self.addClass('ui-timepicker-input');
|
91 |
+
|
92 |
+
_formatValue.call(self.get(0));
|
93 |
+
});
|
94 |
+
},
|
95 |
+
|
96 |
+
show: function(e)
|
97 |
+
{
|
98 |
+
var self = $(this);
|
99 |
+
|
100 |
+
if ('ontouchstart' in document) {
|
101 |
+
// block the keyboard on mobile devices
|
102 |
+
self.blur();
|
103 |
+
}
|
104 |
+
|
105 |
+
var list = self.data('timepicker-list');
|
106 |
+
|
107 |
+
// check if input is readonly
|
108 |
+
if (self.prop('readonly')) {
|
109 |
+
return;
|
110 |
+
}
|
111 |
+
|
112 |
+
// check if list needs to be rendered
|
113 |
+
if (!list || list.length === 0) {
|
114 |
+
_render(self);
|
115 |
+
list = self.data('timepicker-list');
|
116 |
+
}
|
117 |
+
|
118 |
+
// check if a flag was set to close this picker
|
119 |
+
if (self.hasClass('ui-timepicker-hideme')) {
|
120 |
+
self.removeClass('ui-timepicker-hideme');
|
121 |
+
list.hide();
|
122 |
+
return;
|
123 |
+
}
|
124 |
+
|
125 |
+
if (list.is(':visible')) {
|
126 |
+
return;
|
127 |
+
}
|
128 |
+
|
129 |
+
// make sure other pickers are hidden
|
130 |
+
methods.hide();
|
131 |
+
|
132 |
+
if ((self.offset().top + self.outerHeight(true) + list.outerHeight()) > $(window).height() + $(window).scrollTop()) {
|
133 |
+
// position the dropdown on top
|
134 |
+
list.css({ 'left':(self.offset().left), 'top': self.offset().top - list.outerHeight() });
|
135 |
+
} else {
|
136 |
+
// put it under the input
|
137 |
+
list.css({ 'left':(self.offset().left), 'top': self.offset().top + self.outerHeight() });
|
138 |
+
}
|
139 |
+
|
140 |
+
list.show();
|
141 |
+
|
142 |
+
var settings = self.data('timepicker-settings');
|
143 |
+
// position scrolling
|
144 |
+
var selected = list.find('.ui-timepicker-selected');
|
145 |
+
|
146 |
+
if (!selected.length) {
|
147 |
+
if (self.val()) {
|
148 |
+
selected = _findRow(self, list, _time2int(self.val()));
|
149 |
+
} else if (settings.scrollDefaultNow) {
|
150 |
+
selected = _findRow(self, list, _time2int(new Date()));
|
151 |
+
} else if (settings.scrollDefaultTime !== false) {
|
152 |
+
selected = _findRow(self, list, _time2int(settings.scrollDefaultTime));
|
153 |
+
}
|
154 |
+
}
|
155 |
+
|
156 |
+
if (selected && selected.length) {
|
157 |
+
var topOffset = list.scrollTop() + selected.position().top - selected.outerHeight();
|
158 |
+
list.scrollTop(topOffset);
|
159 |
+
} else {
|
160 |
+
list.scrollTop(0);
|
161 |
+
}
|
162 |
+
|
163 |
+
_attachCloseHandler();
|
164 |
+
|
165 |
+
self.trigger('showTimepicker');
|
166 |
+
},
|
167 |
+
|
168 |
+
hide: function(e)
|
169 |
+
{
|
170 |
+
$('.ui-timepicker-list:visible').each(function() {
|
171 |
+
var list = $(this);
|
172 |
+
var self = list.data('timepicker-input');
|
173 |
+
var settings = self.data('timepicker-settings');
|
174 |
+
|
175 |
+
if (settings && settings.selectOnBlur) {
|
176 |
+
_selectValue(self);
|
177 |
+
}
|
178 |
+
|
179 |
+
list.hide();
|
180 |
+
self.trigger('hideTimepicker');
|
181 |
+
});
|
182 |
+
},
|
183 |
+
|
184 |
+
option: function(key, value)
|
185 |
+
{
|
186 |
+
var self = $(this);
|
187 |
+
var settings = self.data('timepicker-settings');
|
188 |
+
var list = self.data('timepicker-list');
|
189 |
+
|
190 |
+
if (typeof key == 'object') {
|
191 |
+
settings = $.extend(settings, key);
|
192 |
+
|
193 |
+
} else if (typeof key == 'string' && typeof value != 'undefined') {
|
194 |
+
settings[key] = value;
|
195 |
+
|
196 |
+
} else if (typeof key == 'string') {
|
197 |
+
return settings[key];
|
198 |
+
}
|
199 |
+
|
200 |
+
if (settings.minTime) {
|
201 |
+
settings.minTime = _time2int(settings.minTime);
|
202 |
+
}
|
203 |
+
|
204 |
+
if (settings.maxTime) {
|
205 |
+
settings.maxTime = _time2int(settings.maxTime);
|
206 |
+
}
|
207 |
+
|
208 |
+
if (settings.durationTime) {
|
209 |
+
settings.durationTime = _time2int(settings.durationTime);
|
210 |
+
}
|
211 |
+
|
212 |
+
self.data('timepicker-settings', settings);
|
213 |
+
|
214 |
+
if (list) {
|
215 |
+
list.remove();
|
216 |
+
self.data('timepicker-list', false);
|
217 |
+
}
|
218 |
+
|
219 |
+
},
|
220 |
+
|
221 |
+
getSecondsFromMidnight: function()
|
222 |
+
{
|
223 |
+
return _time2int($(this).val());
|
224 |
+
},
|
225 |
+
|
226 |
+
getTime: function()
|
227 |
+
{
|
228 |
+
return new Date(_baseDate.valueOf() + (_time2int($(this).val())*1000));
|
229 |
+
},
|
230 |
+
|
231 |
+
setTime: function(value)
|
232 |
+
{
|
233 |
+
var self = $(this);
|
234 |
+
var prettyTime = _int2time(_time2int(value), self.data('timepicker-settings').timeFormat);
|
235 |
+
self.val(prettyTime);
|
236 |
+
},
|
237 |
+
|
238 |
+
remove: function()
|
239 |
+
{
|
240 |
+
var self = $(this);
|
241 |
+
|
242 |
+
// check if this element is a timepicker
|
243 |
+
if (!self.hasClass('ui-timepicker-input')) {
|
244 |
+
return;
|
245 |
+
}
|
246 |
+
|
247 |
+
self.removeAttr('autocomplete', 'off');
|
248 |
+
self.removeClass('ui-timepicker-input');
|
249 |
+
self.removeData('timepicker-settings');
|
250 |
+
self.off('.timepicker');
|
251 |
+
|
252 |
+
// timepicker-list won't be present unless the user has interacted with this timepicker
|
253 |
+
if (self.data('timepicker-list')) {
|
254 |
+
self.data('timepicker-list').remove();
|
255 |
+
}
|
256 |
+
|
257 |
+
self.removeData('timepicker-list');
|
258 |
+
}
|
259 |
+
};
|
260 |
+
|
261 |
+
// private methods
|
262 |
+
|
263 |
+
function _render(self)
|
264 |
+
{
|
265 |
+
|
266 |
+
|
267 |
+
var settings = self.data('timepicker-settings');
|
268 |
+
var list = self.data('timepicker-list');
|
269 |
+
|
270 |
+
if (list && list.length) {
|
271 |
+
list.remove();
|
272 |
+
self.data('timepicker-list', false);
|
273 |
+
}
|
274 |
+
|
275 |
+
list = $('<ul />', {
|
276 |
+
'tabindex': -1,
|
277 |
+
'class': 'ui-timepicker-list'
|
278 |
+
});
|
279 |
+
|
280 |
+
if (settings.className) {
|
281 |
+
list.addClass(settings.className);
|
282 |
+
}
|
283 |
+
|
284 |
+
list.css({'display':'none', 'position': 'absolute' });
|
285 |
+
|
286 |
+
if ((settings.minTime !== null || settings.durationTime !== null) && settings.showDuration) {
|
287 |
+
list.addClass('ui-timepicker-with-duration');
|
288 |
+
}
|
289 |
+
|
290 |
+
var durStart = (settings.durationTime !== null) ? settings.durationTime : settings.minTime;
|
291 |
+
var start = (settings.minTime !== null) ? settings.minTime : 0;
|
292 |
+
var end = (settings.maxTime !== null) ? settings.maxTime : (start + _ONE_DAY - 1);
|
293 |
+
|
294 |
+
if (end <= start) {
|
295 |
+
// make sure the end time is greater than start time, otherwise there will be no list to show
|
296 |
+
end += _ONE_DAY;
|
297 |
+
}
|
298 |
+
|
299 |
+
for (var i=start; i <= end; i += settings.step*60) {
|
300 |
+
var timeInt = i%_ONE_DAY;
|
301 |
+
var row = $('<li />');
|
302 |
+
row.data('time', timeInt);
|
303 |
+
row.text(_int2time(timeInt, settings.timeFormat));
|
304 |
+
|
305 |
+
if ((settings.minTime !== null || settings.durationTime !== null) && settings.showDuration) {
|
306 |
+
var duration = $('<span />');
|
307 |
+
duration.addClass('ui-timepicker-duration');
|
308 |
+
duration.text(' ('+_int2duration(i - durStart)+')');
|
309 |
+
row.append(duration);
|
310 |
+
}
|
311 |
+
|
312 |
+
list.append(row);
|
313 |
+
}
|
314 |
+
|
315 |
+
|
316 |
+
list.data('timepicker-input', self);
|
317 |
+
self.data('timepicker-list', list);
|
318 |
+
|
319 |
+
var appendTo = settings.appendTo;
|
320 |
+
if (typeof appendTo === 'string') {
|
321 |
+
appendTo = $(appendTo);
|
322 |
+
} else if (typeof appendTo === 'function') {
|
323 |
+
appendTo = appendTo(self);
|
324 |
+
}
|
325 |
+
appendTo.append(list);
|
326 |
+
_setSelected(self, list);
|
327 |
+
|
328 |
+
list.on('click', 'li', function(e) {
|
329 |
+
self.addClass('ui-timepicker-hideme');
|
330 |
+
self[0].focus();
|
331 |
+
|
332 |
+
// make sure only the clicked row is selected
|
333 |
+
list.find('li').removeClass('ui-timepicker-selected');
|
334 |
+
$(this).addClass('ui-timepicker-selected');
|
335 |
+
|
336 |
+
_selectValue(self);
|
337 |
+
list.hide();
|
338 |
+
});
|
339 |
+
}
|
340 |
+
|
341 |
+
function _generateBaseDate()
|
342 |
+
{
|
343 |
+
var _baseDate = new Date();
|
344 |
+
var _currentTimezoneOffset = _baseDate.getTimezoneOffset()*60000;
|
345 |
+
_baseDate.setHours(0); _baseDate.setMinutes(0); _baseDate.setSeconds(0);
|
346 |
+
var _baseDateTimezoneOffset = _baseDate.getTimezoneOffset()*60000;
|
347 |
+
|
348 |
+
return new Date(_baseDate.valueOf() - _baseDateTimezoneOffset + _currentTimezoneOffset);
|
349 |
+
}
|
350 |
+
|
351 |
+
function _attachCloseHandler()
|
352 |
+
{
|
353 |
+
if ('ontouchstart' in document) {
|
354 |
+
$('body').on('touchstart.ui-timepicker', _closeHandler);
|
355 |
+
} else {
|
356 |
+
$('body').on('mousedown.ui-timepicker', _closeHandler);
|
357 |
+
$(window).on('scroll.ui-timepicker', _closeHandler);
|
358 |
+
}
|
359 |
+
}
|
360 |
+
|
361 |
+
// event handler to decide whether to close timepicker
|
362 |
+
function _closeHandler(e)
|
363 |
+
{
|
364 |
+
var target = $(e.target);
|
365 |
+
var input = target.closest('.ui-timepicker-input');
|
366 |
+
if (input.length === 0 && target.closest('.ui-timepicker-list').length === 0) {
|
367 |
+
methods.hide();
|
368 |
+
}
|
369 |
+
|
370 |
+
$('body').unbind('.ui-timepicker');
|
371 |
+
$(window).unbind('.ui-timepicker');
|
372 |
+
}
|
373 |
+
|
374 |
+
function _findRow(self, list, value)
|
375 |
+
{
|
376 |
+
if (!value && value !== 0) {
|
377 |
+
return false;
|
378 |
+
}
|
379 |
+
|
380 |
+
var settings = self.data('timepicker-settings');
|
381 |
+
var out = false;
|
382 |
+
var halfStep = settings.step*30;
|
383 |
+
|
384 |
+
// loop through the menu items
|
385 |
+
list.find('li').each(function(i, obj) {
|
386 |
+
var jObj = $(obj);
|
387 |
+
|
388 |
+
var offset = jObj.data('time') - value;
|
389 |
+
|
390 |
+
// check if the value is less than half a step from each row
|
391 |
+
if (Math.abs(offset) < halfStep || offset == halfStep) {
|
392 |
+
out = jObj;
|
393 |
+
return false;
|
394 |
+
}
|
395 |
+
});
|
396 |
+
|
397 |
+
return out;
|
398 |
+
}
|
399 |
+
|
400 |
+
function _setSelected(self, list)
|
401 |
+
{
|
402 |
+
var timeValue = _time2int(self.val());
|
403 |
+
|
404 |
+
var selected = _findRow(self, list, timeValue);
|
405 |
+
if (selected) selected.addClass('ui-timepicker-selected');
|
406 |
+
}
|
407 |
+
|
408 |
+
|
409 |
+
function _formatValue()
|
410 |
+
{
|
411 |
+
if (this.value === '') {
|
412 |
+
return;
|
413 |
+
}
|
414 |
+
|
415 |
+
var self = $(this);
|
416 |
+
var seconds = _time2int(this.value);
|
417 |
+
|
418 |
+
if (seconds === null) {
|
419 |
+
self.trigger('timeFormatError');
|
420 |
+
return;
|
421 |
+
}
|
422 |
+
|
423 |
+
var settings = self.data('timepicker-settings');
|
424 |
+
|
425 |
+
if (settings.forceRoundTime) {
|
426 |
+
var offset = seconds % (settings.step*60); // step is in minutes
|
427 |
+
|
428 |
+
if (offset >= settings.step*30) {
|
429 |
+
// if offset is larger than a half step, round up
|
430 |
+
seconds += (settings.step*60) - offset;
|
431 |
+
} else {
|
432 |
+
// round down
|
433 |
+
seconds -= offset;
|
434 |
+
}
|
435 |
+
}
|
436 |
+
|
437 |
+
var prettyTime = _int2time(seconds, settings.timeFormat);
|
438 |
+
self.val(prettyTime);
|
439 |
+
}
|
440 |
+
|
441 |
+
function _keyhandler(e)
|
442 |
+
{
|
443 |
+
var self = $(this);
|
444 |
+
var list = self.data('timepicker-list');
|
445 |
+
|
446 |
+
if (!list.is(':visible')) {
|
447 |
+
if (e.keyCode == 40) {
|
448 |
+
self.focus();
|
449 |
+
} else {
|
450 |
+
return true;
|
451 |
+
}
|
452 |
+
}
|
453 |
+
|
454 |
+
switch (e.keyCode) {
|
455 |
+
|
456 |
+
case 13: // return
|
457 |
+
_selectValue(self);
|
458 |
+
methods.hide.apply(this);
|
459 |
+
e.preventDefault();
|
460 |
+
return false;
|
461 |
+
|
462 |
+
case 38: // up
|
463 |
+
var selected = list.find('.ui-timepicker-selected');
|
464 |
+
|
465 |
+
if (!selected.length) {
|
466 |
+
list.children().each(function(i, obj) {
|
467 |
+
if ($(obj).position().top > 0) {
|
468 |
+
selected = $(obj);
|
469 |
+
return false;
|
470 |
+
}
|
471 |
+
});
|
472 |
+
selected.addClass('ui-timepicker-selected');
|
473 |
+
|
474 |
+
} else if (!selected.is(':first-child')) {
|
475 |
+
selected.removeClass('ui-timepicker-selected');
|
476 |
+
selected.prev().addClass('ui-timepicker-selected');
|
477 |
+
|
478 |
+
if (selected.prev().position().top < selected.outerHeight()) {
|
479 |
+
list.scrollTop(list.scrollTop() - selected.outerHeight());
|
480 |
+
}
|
481 |
+
}
|
482 |
+
|
483 |
+
break;
|
484 |
+
|
485 |
+
case 40: // down
|
486 |
+
selected = list.find('.ui-timepicker-selected');
|
487 |
+
|
488 |
+
if (selected.length === 0) {
|
489 |
+
list.children().each(function(i, obj) {
|
490 |
+
if ($(obj).position().top > 0) {
|
491 |
+
selected = $(obj);
|
492 |
+
return false;
|
493 |
+
}
|
494 |
+
});
|
495 |
+
|
496 |
+
selected.addClass('ui-timepicker-selected');
|
497 |
+
} else if (!selected.is(':last-child')) {
|
498 |
+
selected.removeClass('ui-timepicker-selected');
|
499 |
+
selected.next().addClass('ui-timepicker-selected');
|
500 |
+
|
501 |
+
if (selected.next().position().top + 2*selected.outerHeight() > list.outerHeight()) {
|
502 |
+
list.scrollTop(list.scrollTop() + selected.outerHeight());
|
503 |
+
}
|
504 |
+
}
|
505 |
+
|
506 |
+
break;
|
507 |
+
|
508 |
+
case 27: // escape
|
509 |
+
list.find('li').removeClass('ui-timepicker-selected');
|
510 |
+
list.hide();
|
511 |
+
break;
|
512 |
+
|
513 |
+
case 9: //tab
|
514 |
+
methods.hide();
|
515 |
+
break;
|
516 |
+
|
517 |
+
case 16:
|
518 |
+
case 17:
|
519 |
+
case 18:
|
520 |
+
case 19:
|
521 |
+
case 20:
|
522 |
+
case 33:
|
523 |
+
case 34:
|
524 |
+
case 35:
|
525 |
+
case 36:
|
526 |
+
case 37:
|
527 |
+
case 39:
|
528 |
+
case 45:
|
529 |
+
return;
|
530 |
+
|
531 |
+
default:
|
532 |
+
list.find('li').removeClass('ui-timepicker-selected');
|
533 |
+
return;
|
534 |
+
}
|
535 |
+
}
|
536 |
+
|
537 |
+
function _selectValue(self)
|
538 |
+
{
|
539 |
+
var settings = self.data('timepicker-settings');
|
540 |
+
var list = self.data('timepicker-list');
|
541 |
+
var timeValue = null;
|
542 |
+
|
543 |
+
var cursor = list.find('.ui-timepicker-selected');
|
544 |
+
|
545 |
+
if (cursor.length) {
|
546 |
+
// selected value found
|
547 |
+
timeValue = cursor.data('time');
|
548 |
+
|
549 |
+
} else if (self.val()) {
|
550 |
+
|
551 |
+
// no selected value; fall back on input value
|
552 |
+
timeValue = _time2int(self.val());
|
553 |
+
|
554 |
+
_setSelected(self, list);
|
555 |
+
}
|
556 |
+
|
557 |
+
if (timeValue !== null) {
|
558 |
+
var timeString = _int2time(timeValue, settings.timeFormat);
|
559 |
+
self.val(timeString);
|
560 |
+
}
|
561 |
+
|
562 |
+
self.trigger('change').trigger('changeTime');
|
563 |
+
}
|
564 |
+
|
565 |
+
function _int2duration(seconds)
|
566 |
+
{
|
567 |
+
var minutes = Math.round(seconds/60);
|
568 |
+
var duration;
|
569 |
+
|
570 |
+
if (Math.abs(minutes) < 60) {
|
571 |
+
duration = [minutes, _lang.mins];
|
572 |
+
} else if (minutes == 60) {
|
573 |
+
duration = ['1', _lang.hr];
|
574 |
+
} else {
|
575 |
+
var hours = (minutes/60).toFixed(1);
|
576 |
+
if (_lang.decimal != '.') hours = hours.replace('.', _lang.decimal);
|
577 |
+
duration = [hours, _lang.hrs];
|
578 |
+
}
|
579 |
+
|
580 |
+
return duration.join(' ');
|
581 |
+
}
|
582 |
+
|
583 |
+
function _int2time(seconds, format)
|
584 |
+
{
|
585 |
+
if (seconds === null) {
|
586 |
+
return;
|
587 |
+
}
|
588 |
+
|
589 |
+
var time = new Date(_baseDate.valueOf() + (seconds*1000));
|
590 |
+
var output = '';
|
591 |
+
var hour, code;
|
592 |
+
|
593 |
+
for (var i=0; i<format.length; i++) {
|
594 |
+
|
595 |
+
code = format.charAt(i);
|
596 |
+
switch (code) {
|
597 |
+
|
598 |
+
case 'a':
|
599 |
+
output += (time.getHours() > 11) ? 'pm' : 'am';
|
600 |
+
break;
|
601 |
+
|
602 |
+
case 'A':
|
603 |
+
output += (time.getHours() > 11) ? 'PM' : 'AM';
|
604 |
+
break;
|
605 |
+
|
606 |
+
case 'g':
|
607 |
+
hour = time.getHours() % 12;
|
608 |
+
output += (hour === 0) ? '12' : hour;
|
609 |
+
break;
|
610 |
+
|
611 |
+
case 'G':
|
612 |
+
output += time.getHours();
|
613 |
+
break;
|
614 |
+
|
615 |
+
case 'h':
|
616 |
+
hour = time.getHours() % 12;
|
617 |
+
|
618 |
+
if (hour !== 0 && hour < 10) {
|
619 |
+
hour = '0'+hour;
|
620 |
+
}
|
621 |
+
|
622 |
+
output += (hour === 0) ? '12' : hour;
|
623 |
+
break;
|
624 |
+
|
625 |
+
case 'H':
|
626 |
+
hour = time.getHours();
|
627 |
+
output += (hour > 9) ? hour : '0'+hour;
|
628 |
+
break;
|
629 |
+
|
630 |
+
case 'i':
|
631 |
+
var minutes = time.getMinutes();
|
632 |
+
output += (minutes > 9) ? minutes : '0'+minutes;
|
633 |
+
break;
|
634 |
+
|
635 |
+
case 's':
|
636 |
+
seconds = time.getSeconds();
|
637 |
+
output += (seconds > 9) ? seconds : '0'+seconds;
|
638 |
+
break;
|
639 |
+
|
640 |
+
default:
|
641 |
+
output += code;
|
642 |
+
}
|
643 |
+
}
|
644 |
+
|
645 |
+
return output;
|
646 |
+
}
|
647 |
+
|
648 |
+
function _time2int(timeString)
|
649 |
+
{
|
650 |
+
if (timeString === '') return null;
|
651 |
+
if (timeString+0 == timeString) return timeString;
|
652 |
+
|
653 |
+
if (typeof(timeString) == 'object') {
|
654 |
+
timeString = timeString.getHours()+':'+timeString.getMinutes()+':'+timeString.getSeconds();
|
655 |
+
}
|
656 |
+
|
657 |
+
var d = new Date(0);
|
658 |
+
var time = timeString.toLowerCase().match(/(\d{1,2})(?::(\d{1,2}))?(?::(\d{2}))?\s*([pa]?)/);
|
659 |
+
|
660 |
+
if (!time) {
|
661 |
+
return null;
|
662 |
+
}
|
663 |
+
|
664 |
+
var hour = parseInt(time[1]*1, 10);
|
665 |
+
var hours;
|
666 |
+
|
667 |
+
if (time[4]) {
|
668 |
+
if (hour == 12) {
|
669 |
+
hours = (time[4] == 'p') ? 12 : 0;
|
670 |
+
} else {
|
671 |
+
hours = (hour + (time[4] == 'p' ? 12 : 0));
|
672 |
+
}
|
673 |
+
|
674 |
+
} else {
|
675 |
+
hours = hour;
|
676 |
+
}
|
677 |
+
|
678 |
+
var minutes = ( time[2]*1 || 0 );
|
679 |
+
var seconds = ( time[3]*1 || 0 );
|
680 |
+
return hours*3600 + minutes*60 + seconds;
|
681 |
+
}
|
682 |
+
|
683 |
+
// Plugin entry
|
684 |
+
$.fn.timepicker = function(method)
|
685 |
+
{
|
686 |
+
|
687 |
+
if(methods[method]) { return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); }
|
688 |
+
else if(typeof method === "object" || !method) { return methods.init.apply(this, arguments); }
|
689 |
+
else { $.error("Method "+ method + " does not exist on jQuery.timepicker"); }
|
690 |
+
};
|
691 |
+
}));
|
js/libraries/jquery-datepicker/lib/base.css
CHANGED
@@ -1,390 +1,390 @@
|
|
1 |
-
.jquery-date-picker input {width:80px;}
|
2 |
-
.jquery-date-picker h3 { margin: 0 0 10px 0; }
|
3 |
-
.jquery-date-picker p { margin: 20px 0 0 0; }
|
4 |
-
|
5 |
-
/* Bootstrap datepicker CSS */
|
6 |
-
.dropdown { position:relative; }
|
7 |
-
.dropdown-toggle { *margin-bottom:-3px; }
|
8 |
-
.dropdown-toggle:active, .open .dropdown-toggle { outline:0; }
|
9 |
-
.caret {
|
10 |
-
display:inline-block;
|
11 |
-
width:0;
|
12 |
-
height:0;
|
13 |
-
text-indent:-99999px;
|
14 |
-
*text-indent:0;
|
15 |
-
vertical-align:top;
|
16 |
-
border-left:4px solid transparent;
|
17 |
-
border-right:4px solid transparent;
|
18 |
-
border-top:4px solid #000000;
|
19 |
-
opacity:0.3;
|
20 |
-
filter:alpha(opacity=30);
|
21 |
-
content:"\2193";
|
22 |
-
}
|
23 |
-
.dropdown .caret {
|
24 |
-
margin-top:8px;
|
25 |
-
margin-left:2px;
|
26 |
-
}
|
27 |
-
.dropdown:hover .caret, .open.dropdown .caret {
|
28 |
-
opacity:1;
|
29 |
-
filter:alpha(opacity=100);
|
30 |
-
}
|
31 |
-
.dropdown-menu {
|
32 |
-
position:absolute;
|
33 |
-
top:100%;
|
34 |
-
left:0;
|
35 |
-
z-index:1000;
|
36 |
-
float:left;
|
37 |
-
display:none;
|
38 |
-
min-width:160px;
|
39 |
-
max-width:220px;
|
40 |
-
_width:160px;
|
41 |
-
padding:4px 0;
|
42 |
-
margin:0;
|
43 |
-
list-style:none;
|
44 |
-
background-color:#ffffff;
|
45 |
-
border-color:#cccccc;
|
46 |
-
border-color:rgba(0,0,0,0.2);
|
47 |
-
border-style:solid;
|
48 |
-
border-width:1px;
|
49 |
-
-webkit-border-radius:0 0 5px 5px;
|
50 |
-
-moz-border-radius:0 0 5px 5px;
|
51 |
-
border-radius:0 0 5px 5px;
|
52 |
-
-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);
|
53 |
-
-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);
|
54 |
-
box-shadow:0 5px 10px rgba(0,0,0,0.2);
|
55 |
-
-webkit-background-clip:padding-box;
|
56 |
-
-moz-background-clip:padding;
|
57 |
-
background-clip:padding-box;
|
58 |
-
*border-right-width:2px;
|
59 |
-
*border-bottom-width:2px;
|
60 |
-
}
|
61 |
-
.dropdown-menu.bottom-up {
|
62 |
-
top:auto;
|
63 |
-
bottom:100%;
|
64 |
-
margin-bottom:2px;
|
65 |
-
}
|
66 |
-
.dropdown-menu .divider {
|
67 |
-
height:1px;
|
68 |
-
margin:5px 1px;
|
69 |
-
overflow:hidden;
|
70 |
-
background-color:#e5e5e5;
|
71 |
-
border-bottom:1px solid #ffffff;
|
72 |
-
*width:100%;
|
73 |
-
*margin:-5px 0 5px;
|
74 |
-
}
|
75 |
-
.dropdown-menu a {
|
76 |
-
display:block;
|
77 |
-
padding:3px 15px;
|
78 |
-
clear:both;
|
79 |
-
font-weight:normal;
|
80 |
-
line-height:18px;
|
81 |
-
color:#555555;
|
82 |
-
white-space:nowrap;
|
83 |
-
}
|
84 |
-
.dropdown-menu li > a:hover, .dropdown-menu .active > a, .dropdown-menu .active > a:hover {
|
85 |
-
color:#ffffff;
|
86 |
-
text-decoration:none;
|
87 |
-
background-color:#0060b6;
|
88 |
-
}
|
89 |
-
.dropdown.open { *z-index:1000; }
|
90 |
-
.dropdown.open .dropdown-toggle {
|
91 |
-
color:#ffffff;
|
92 |
-
background:#cccccc;
|
93 |
-
background:rgba(0,0,0,0.3);
|
94 |
-
}
|
95 |
-
.dropdown.open .dropdown-menu { display:block; }
|
96 |
-
.typeahead {
|
97 |
-
margin-top:2px;
|
98 |
-
-webkit-border-radius:4px;
|
99 |
-
-moz-border-radius:4px;
|
100 |
-
border-radius:4px;
|
101 |
-
}
|
102 |
-
/*!
|
103 |
-
* Datepicker for Bootstrap
|
104 |
-
*
|
105 |
-
* Copyright 2012 Stefan Petre
|
106 |
-
* Improvements by Andrew Rowls
|
107 |
-
* Licensed under the Apache License v2.0
|
108 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
109 |
-
*
|
110 |
-
*/
|
111 |
-
.datepicker {
|
112 |
-
top: 0;
|
113 |
-
left: 0;
|
114 |
-
padding: 4px;
|
115 |
-
margin-top: 1px;
|
116 |
-
-webkit-border-radius: 4px;
|
117 |
-
-moz-border-radius: 4px;
|
118 |
-
border-radius: 4px;
|
119 |
-
/*.dow {
|
120 |
-
border-top: 1px solid #ddd !important;
|
121 |
-
}*/
|
122 |
-
|
123 |
-
}
|
124 |
-
.datepicker:before {
|
125 |
-
content: '';
|
126 |
-
display: inline-block;
|
127 |
-
border-left: 7px solid transparent;
|
128 |
-
border-right: 7px solid transparent;
|
129 |
-
border-bottom: 7px solid #ccc;
|
130 |
-
border-bottom-color: rgba(0, 0, 0, 0.2);
|
131 |
-
position: absolute;
|
132 |
-
top: -7px;
|
133 |
-
left: 6px;
|
134 |
-
}
|
135 |
-
.datepicker:after {
|
136 |
-
content: '';
|
137 |
-
display: inline-block;
|
138 |
-
border-left: 6px solid transparent;
|
139 |
-
border-right: 6px solid transparent;
|
140 |
-
border-bottom: 6px solid #ffffff;
|
141 |
-
position: absolute;
|
142 |
-
top: -6px;
|
143 |
-
left: 7px;
|
144 |
-
}
|
145 |
-
.datepicker > div {
|
146 |
-
display: none;
|
147 |
-
}
|
148 |
-
.datepicker.days div.datepicker-days {
|
149 |
-
display: block;
|
150 |
-
}
|
151 |
-
.datepicker.months div.datepicker-months {
|
152 |
-
display: block;
|
153 |
-
}
|
154 |
-
.datepicker.years div.datepicker-years {
|
155 |
-
display: block;
|
156 |
-
}
|
157 |
-
.datepicker table {
|
158 |
-
margin: 0;
|
159 |
-
}
|
160 |
-
.datepicker td,
|
161 |
-
.datepicker th {
|
162 |
-
text-align: center;
|
163 |
-
width: 20px;
|
164 |
-
height: 20px;
|
165 |
-
-webkit-border-radius: 4px;
|
166 |
-
-moz-border-radius: 4px;
|
167 |
-
border-radius: 4px;
|
168 |
-
}
|
169 |
-
.datepicker td.day:hover {
|
170 |
-
background: #eeeeee;
|
171 |
-
cursor: pointer;
|
172 |
-
}
|
173 |
-
.datepicker td.old,
|
174 |
-
.datepicker td.new {
|
175 |
-
color: #999999;
|
176 |
-
}
|
177 |
-
.datepicker td.disabled,
|
178 |
-
.datepicker td.disabled:hover {
|
179 |
-
background: none;
|
180 |
-
color: #999999;
|
181 |
-
cursor: default;
|
182 |
-
}
|
183 |
-
.datepicker td.today,
|
184 |
-
.datepicker td.today:hover,
|
185 |
-
.datepicker td.today.disabled,
|
186 |
-
.datepicker td.today.disabled:hover {
|
187 |
-
background-color: #fde19a;
|
188 |
-
background-image: -moz-linear-gradient(top, #fdd49a, #fdf59a);
|
189 |
-
background-image: -ms-linear-gradient(top, #fdd49a, #fdf59a);
|
190 |
-
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a));
|
191 |
-
background-image: -webkit-linear-gradient(top, #fdd49a, #fdf59a);
|
192 |
-
background-image: -o-linear-gradient(top, #fdd49a, #fdf59a);
|
193 |
-
background-image: linear-gradient(top, #fdd49a, #fdf59a);
|
194 |
-
background-repeat: repeat-x;
|
195 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0);
|
196 |
-
border-color: #fdf59a #fdf59a #fbed50;
|
197 |
-
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
198 |
-
filter: progid:dximagetransform.microsoft.gradient(enabled=false);
|
199 |
-
}
|
200 |
-
.datepicker td.today:hover,
|
201 |
-
.datepicker td.today:hover:hover,
|
202 |
-
.datepicker td.today.disabled:hover,
|
203 |
-
.datepicker td.today.disabled:hover:hover,
|
204 |
-
.datepicker td.today:active,
|
205 |
-
.datepicker td.today:hover:active,
|
206 |
-
.datepicker td.today.disabled:active,
|
207 |
-
.datepicker td.today.disabled:hover:active,
|
208 |
-
.datepicker td.today.active,
|
209 |
-
.datepicker td.today:hover.active,
|
210 |
-
.datepicker td.today.disabled.active,
|
211 |
-
.datepicker td.today.disabled:hover.active,
|
212 |
-
.datepicker td.today.disabled,
|
213 |
-
.datepicker td.today:hover.disabled,
|
214 |
-
.datepicker td.today.disabled.disabled,
|
215 |
-
.datepicker td.today.disabled:hover.disabled,
|
216 |
-
.datepicker td.today[disabled],
|
217 |
-
.datepicker td.today:hover[disabled],
|
218 |
-
.datepicker td.today.disabled[disabled],
|
219 |
-
.datepicker td.today.disabled:hover[disabled] {
|
220 |
-
background-color: #fdf59a;
|
221 |
-
}
|
222 |
-
.datepicker td.today:active,
|
223 |
-
.datepicker td.today:hover:active,
|
224 |
-
.datepicker td.today.disabled:active,
|
225 |
-
.datepicker td.today.disabled:hover:active,
|
226 |
-
.datepicker td.today.active,
|
227 |
-
.datepicker td.today:hover.active,
|
228 |
-
.datepicker td.today.disabled.active,
|
229 |
-
.datepicker td.today.disabled:hover.active {
|
230 |
-
background-color: #fbf069 \9;
|
231 |
-
}
|
232 |
-
.datepicker td.active,
|
233 |
-
.datepicker td.active:hover,
|
234 |
-
.datepicker td.active.disabled,
|
235 |
-
.datepicker td.active.disabled:hover {
|
236 |
-
background-color: #006dcc;
|
237 |
-
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
|
238 |
-
background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
|
239 |
-
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
|
240 |
-
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
|
241 |
-
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
|
242 |
-
background-image: linear-gradient(top, #0088cc, #0044cc);
|
243 |
-
background-repeat: repeat-x;
|
244 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
|
245 |
-
border-color: #0044cc #0044cc #002a80;
|
246 |
-
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
247 |
-
filter: progid:dximagetransform.microsoft.gradient(enabled=false);
|
248 |
-
color: #fff;
|
249 |
-
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
250 |
-
}
|
251 |
-
.datepicker td.active:hover,
|
252 |
-
.datepicker td.active:hover:hover,
|
253 |
-
.datepicker td.active.disabled:hover,
|
254 |
-
.datepicker td.active.disabled:hover:hover,
|
255 |
-
.datepicker td.active:active,
|
256 |
-
.datepicker td.active:hover:active,
|
257 |
-
.datepicker td.active.disabled:active,
|
258 |
-
.datepicker td.active.disabled:hover:active,
|
259 |
-
.datepicker td.active.active,
|
260 |
-
.datepicker td.active:hover.active,
|
261 |
-
.datepicker td.active.disabled.active,
|
262 |
-
.datepicker td.active.disabled:hover.active,
|
263 |
-
.datepicker td.active.disabled,
|
264 |
-
.datepicker td.active:hover.disabled,
|
265 |
-
.datepicker td.active.disabled.disabled,
|
266 |
-
.datepicker td.active.disabled:hover.disabled,
|
267 |
-
.datepicker td.active[disabled],
|
268 |
-
.datepicker td.active:hover[disabled],
|
269 |
-
.datepicker td.active.disabled[disabled],
|
270 |
-
.datepicker td.active.disabled:hover[disabled] {
|
271 |
-
background-color: #0044cc;
|
272 |
-
}
|
273 |
-
.datepicker td.active:active,
|
274 |
-
.datepicker td.active:hover:active,
|
275 |
-
.datepicker td.active.disabled:active,
|
276 |
-
.datepicker td.active.disabled:hover:active,
|
277 |
-
.datepicker td.active.active,
|
278 |
-
.datepicker td.active:hover.active,
|
279 |
-
.datepicker td.active.disabled.active,
|
280 |
-
.datepicker td.active.disabled:hover.active {
|
281 |
-
background-color: #003399 \9;
|
282 |
-
}
|
283 |
-
.datepicker td span {
|
284 |
-
display: block;
|
285 |
-
width: 23%;
|
286 |
-
height: 54px;
|
287 |
-
line-height: 54px;
|
288 |
-
float: left;
|
289 |
-
margin: 1%;
|
290 |
-
cursor: pointer;
|
291 |
-
-webkit-border-radius: 4px;
|
292 |
-
-moz-border-radius: 4px;
|
293 |
-
border-radius: 4px;
|
294 |
-
}
|
295 |
-
.datepicker td span:hover {
|
296 |
-
background: #eeeeee;
|
297 |
-
}
|
298 |
-
.datepicker td span.disabled,
|
299 |
-
.datepicker td span.disabled:hover {
|
300 |
-
background: none;
|
301 |
-
color: #999999;
|
302 |
-
cursor: default;
|
303 |
-
}
|
304 |
-
.datepicker td span.active,
|
305 |
-
.datepicker td span.active:hover,
|
306 |
-
.datepicker td span.active.disabled,
|
307 |
-
.datepicker td span.active.disabled:hover {
|
308 |
-
background-color: #006dcc;
|
309 |
-
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
|
310 |
-
background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
|
311 |
-
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
|
312 |
-
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
|
313 |
-
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
|
314 |
-
background-image: linear-gradient(top, #0088cc, #0044cc);
|
315 |
-
background-repeat: repeat-x;
|
316 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
|
317 |
-
border-color: #0044cc #0044cc #002a80;
|
318 |
-
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
319 |
-
filter: progid:dximagetransform.microsoft.gradient(enabled=false);
|
320 |
-
color: #fff;
|
321 |
-
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
322 |
-
}
|
323 |
-
.datepicker td span.active:hover,
|
324 |
-
.datepicker td span.active:hover:hover,
|
325 |
-
.datepicker td span.active.disabled:hover,
|
326 |
-
.datepicker td span.active.disabled:hover:hover,
|
327 |
-
.datepicker td span.active:active,
|
328 |
-
.datepicker td span.active:hover:active,
|
329 |
-
.datepicker td span.active.disabled:active,
|
330 |
-
.datepicker td span.active.disabled:hover:active,
|
331 |
-
.datepicker td span.active.active,
|
332 |
-
.datepicker td span.active:hover.active,
|
333 |
-
.datepicker td span.active.disabled.active,
|
334 |
-
.datepicker td span.active.disabled:hover.active,
|
335 |
-
.datepicker td span.active.disabled,
|
336 |
-
.datepicker td span.active:hover.disabled,
|
337 |
-
.datepicker td span.active.disabled.disabled,
|
338 |
-
.datepicker td span.active.disabled:hover.disabled,
|
339 |
-
.datepicker td span.active[disabled],
|
340 |
-
.datepicker td span.active:hover[disabled],
|
341 |
-
.datepicker td span.active.disabled[disabled],
|
342 |
-
.datepicker td span.active.disabled:hover[disabled] {
|
343 |
-
background-color: #0044cc;
|
344 |
-
}
|
345 |
-
.datepicker td span.active:active,
|
346 |
-
.datepicker td span.active:hover:active,
|
347 |
-
.datepicker td span.active.disabled:active,
|
348 |
-
.datepicker td span.active.disabled:hover:active,
|
349 |
-
.datepicker td span.active.active,
|
350 |
-
.datepicker td span.active:hover.active,
|
351 |
-
.datepicker td span.active.disabled.active,
|
352 |
-
.datepicker td span.active.disabled:hover.active {
|
353 |
-
background-color: #003399 \9;
|
354 |
-
}
|
355 |
-
.datepicker td span.old {
|
356 |
-
color: #999999;
|
357 |
-
}
|
358 |
-
.datepicker th.switch {
|
359 |
-
width: 145px;
|
360 |
-
}
|
361 |
-
.datepicker thead tr:first-child th,
|
362 |
-
.datepicker tfoot tr:first-child th {
|
363 |
-
cursor: pointer;
|
364 |
-
}
|
365 |
-
.datepicker thead tr:first-child th:hover,
|
366 |
-
.datepicker tfoot tr:first-child th:hover {
|
367 |
-
background: #eeeeee;
|
368 |
-
}
|
369 |
-
.input-append.date .add-on i,
|
370 |
-
.input-prepend.date .add-on i {
|
371 |
-
display: block;
|
372 |
-
cursor: pointer;
|
373 |
-
width: 16px;
|
374 |
-
height: 16px;
|
375 |
-
}
|
376 |
-
|
377 |
-
[class^="icon-"], [class*=" icon-"] {
|
378 |
-
display:inline-block;
|
379 |
-
width:14px;
|
380 |
-
height:14px;
|
381 |
-
*margin-right:.3em;
|
382 |
-
line-height:14px;
|
383 |
-
vertical-align:text-top;
|
384 |
-
background-image:url("glyphicons-halflings.png");
|
385 |
-
background-position:14px 14px;
|
386 |
-
background-repeat:no-repeat;
|
387 |
-
}
|
388 |
-
[class^="icon-"]:last-child, [class*=" icon-"]:last-child { *margin-left:0; }
|
389 |
-
.icon-arrow-left { background-position:-240px -96px; }
|
390 |
.icon-arrow-right { background-position:-264px -96px; }
|
1 |
+
.jquery-date-picker input {width:80px;}
|
2 |
+
.jquery-date-picker h3 { margin: 0 0 10px 0; }
|
3 |
+
.jquery-date-picker p { margin: 20px 0 0 0; }
|
4 |
+
|
5 |
+
/* Bootstrap datepicker CSS */
|
6 |
+
.dropdown { position:relative; }
|
7 |
+
.dropdown-toggle { *margin-bottom:-3px; }
|
8 |
+
.dropdown-toggle:active, .open .dropdown-toggle { outline:0; }
|
9 |
+
.caret {
|
10 |
+
display:inline-block;
|
11 |
+
width:0;
|
12 |
+
height:0;
|
13 |
+
text-indent:-99999px;
|
14 |
+
*text-indent:0;
|
15 |
+
vertical-align:top;
|
16 |
+
border-left:4px solid transparent;
|
17 |
+
border-right:4px solid transparent;
|
18 |
+
border-top:4px solid #000000;
|
19 |
+
opacity:0.3;
|
20 |
+
filter:alpha(opacity=30);
|
21 |
+
content:"\2193";
|
22 |
+
}
|
23 |
+
.dropdown .caret {
|
24 |
+
margin-top:8px;
|
25 |
+
margin-left:2px;
|
26 |
+
}
|
27 |
+
.dropdown:hover .caret, .open.dropdown .caret {
|
28 |
+
opacity:1;
|
29 |
+
filter:alpha(opacity=100);
|
30 |
+
}
|
31 |
+
.dropdown-menu {
|
32 |
+
position:absolute;
|
33 |
+
top:100%;
|
34 |
+
left:0;
|
35 |
+
z-index:1000;
|
36 |
+
float:left;
|
37 |
+
display:none;
|
38 |
+
min-width:160px;
|
39 |
+
max-width:220px;
|
40 |
+
_width:160px;
|
41 |
+
padding:4px 0;
|
42 |
+
margin:0;
|
43 |
+
list-style:none;
|
44 |
+
background-color:#ffffff;
|
45 |
+
border-color:#cccccc;
|
46 |
+
border-color:rgba(0,0,0,0.2);
|
47 |
+
border-style:solid;
|
48 |
+
border-width:1px;
|
49 |
+
-webkit-border-radius:0 0 5px 5px;
|
50 |
+
-moz-border-radius:0 0 5px 5px;
|
51 |
+
border-radius:0 0 5px 5px;
|
52 |
+
-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);
|
53 |
+
-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);
|
54 |
+
box-shadow:0 5px 10px rgba(0,0,0,0.2);
|
55 |
+
-webkit-background-clip:padding-box;
|
56 |
+
-moz-background-clip:padding;
|
57 |
+
background-clip:padding-box;
|
58 |
+
*border-right-width:2px;
|
59 |
+
*border-bottom-width:2px;
|
60 |
+
}
|
61 |
+
.dropdown-menu.bottom-up {
|
62 |
+
top:auto;
|
63 |
+
bottom:100%;
|
64 |
+
margin-bottom:2px;
|
65 |
+
}
|
66 |
+
.dropdown-menu .divider {
|
67 |
+
height:1px;
|
68 |
+
margin:5px 1px;
|
69 |
+
overflow:hidden;
|
70 |
+
background-color:#e5e5e5;
|
71 |
+
border-bottom:1px solid #ffffff;
|
72 |
+
*width:100%;
|
73 |
+
*margin:-5px 0 5px;
|
74 |
+
}
|
75 |
+
.dropdown-menu a {
|
76 |
+
display:block;
|
77 |
+
padding:3px 15px;
|
78 |
+
clear:both;
|
79 |
+
font-weight:normal;
|
80 |
+
line-height:18px;
|
81 |
+
color:#555555;
|
82 |
+
white-space:nowrap;
|
83 |
+
}
|
84 |
+
.dropdown-menu li > a:hover, .dropdown-menu .active > a, .dropdown-menu .active > a:hover {
|
85 |
+
color:#ffffff;
|
86 |
+
text-decoration:none;
|
87 |
+
background-color:#0060b6;
|
88 |
+
}
|
89 |
+
.dropdown.open { *z-index:1000; }
|
90 |
+
.dropdown.open .dropdown-toggle {
|
91 |
+
color:#ffffff;
|
92 |
+
background:#cccccc;
|
93 |
+
background:rgba(0,0,0,0.3);
|
94 |
+
}
|
95 |
+
.dropdown.open .dropdown-menu { display:block; }
|
96 |
+
.typeahead {
|
97 |
+
margin-top:2px;
|
98 |
+
-webkit-border-radius:4px;
|
99 |
+
-moz-border-radius:4px;
|
100 |
+
border-radius:4px;
|
101 |
+
}
|
102 |
+
/*!
|
103 |
+
* Datepicker for Bootstrap
|
104 |
+
*
|
105 |
+
* Copyright 2012 Stefan Petre
|
106 |
+
* Improvements by Andrew Rowls
|
107 |
+
* Licensed under the Apache License v2.0
|
108 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
109 |
+
*
|
110 |
+
*/
|
111 |
+
.datepicker {
|
112 |
+
top: 0;
|
113 |
+
left: 0;
|
114 |
+
padding: 4px;
|
115 |
+
margin-top: 1px;
|
116 |
+
-webkit-border-radius: 4px;
|
117 |
+
-moz-border-radius: 4px;
|
118 |
+
border-radius: 4px;
|
119 |
+
/*.dow {
|
120 |
+
border-top: 1px solid #ddd !important;
|
121 |
+
}*/
|
122 |
+
|
123 |
+
}
|
124 |
+
.datepicker:before {
|
125 |
+
content: '';
|
126 |
+
display: inline-block;
|
127 |
+
border-left: 7px solid transparent;
|
128 |
+
border-right: 7px solid transparent;
|
129 |
+
border-bottom: 7px solid #ccc;
|
130 |
+
border-bottom-color: rgba(0, 0, 0, 0.2);
|
131 |
+
position: absolute;
|
132 |
+
top: -7px;
|
133 |
+
left: 6px;
|
134 |
+
}
|
135 |
+
.datepicker:after {
|
136 |
+
content: '';
|
137 |
+
display: inline-block;
|
138 |
+
border-left: 6px solid transparent;
|
139 |
+
border-right: 6px solid transparent;
|
140 |
+
border-bottom: 6px solid #ffffff;
|
141 |
+
position: absolute;
|
142 |
+
top: -6px;
|
143 |
+
left: 7px;
|
144 |
+
}
|
145 |
+
.datepicker > div {
|
146 |
+
display: none;
|
147 |
+
}
|
148 |
+
.datepicker.days div.datepicker-days {
|
149 |
+
display: block;
|
150 |
+
}
|
151 |
+
.datepicker.months div.datepicker-months {
|
152 |
+
display: block;
|
153 |
+
}
|
154 |
+
.datepicker.years div.datepicker-years {
|
155 |
+
display: block;
|
156 |
+
}
|
157 |
+
.datepicker table {
|
158 |
+
margin: 0;
|
159 |
+
}
|
160 |
+
.datepicker td,
|
161 |
+
.datepicker th {
|
162 |
+
text-align: center;
|
163 |
+
width: 20px;
|
164 |
+
height: 20px;
|
165 |
+
-webkit-border-radius: 4px;
|
166 |
+
-moz-border-radius: 4px;
|
167 |
+
border-radius: 4px;
|
168 |
+
}
|
169 |
+
.datepicker td.day:hover {
|
170 |
+
background: #eeeeee;
|
171 |
+
cursor: pointer;
|
172 |
+
}
|
173 |
+
.datepicker td.old,
|
174 |
+
.datepicker td.new {
|
175 |
+
color: #999999;
|
176 |
+
}
|
177 |
+
.datepicker td.disabled,
|
178 |
+
.datepicker td.disabled:hover {
|
179 |
+
background: none;
|
180 |
+
color: #999999;
|
181 |
+
cursor: default;
|
182 |
+
}
|
183 |
+
.datepicker td.today,
|
184 |
+
.datepicker td.today:hover,
|
185 |
+
.datepicker td.today.disabled,
|
186 |
+
.datepicker td.today.disabled:hover {
|
187 |
+
background-color: #fde19a;
|
188 |
+
background-image: -moz-linear-gradient(top, #fdd49a, #fdf59a);
|
189 |
+
background-image: -ms-linear-gradient(top, #fdd49a, #fdf59a);
|
190 |
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a));
|
191 |
+
background-image: -webkit-linear-gradient(top, #fdd49a, #fdf59a);
|
192 |
+
background-image: -o-linear-gradient(top, #fdd49a, #fdf59a);
|
193 |
+
background-image: linear-gradient(top, #fdd49a, #fdf59a);
|
194 |
+
background-repeat: repeat-x;
|
195 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0);
|
196 |
+
border-color: #fdf59a #fdf59a #fbed50;
|
197 |
+
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
198 |
+
filter: progid:dximagetransform.microsoft.gradient(enabled=false);
|
199 |
+
}
|
200 |
+
.datepicker td.today:hover,
|
201 |
+
.datepicker td.today:hover:hover,
|
202 |
+
.datepicker td.today.disabled:hover,
|
203 |
+
.datepicker td.today.disabled:hover:hover,
|
204 |
+
.datepicker td.today:active,
|
205 |
+
.datepicker td.today:hover:active,
|
206 |
+
.datepicker td.today.disabled:active,
|
207 |
+
.datepicker td.today.disabled:hover:active,
|
208 |
+
.datepicker td.today.active,
|
209 |
+
.datepicker td.today:hover.active,
|
210 |
+
.datepicker td.today.disabled.active,
|
211 |
+
.datepicker td.today.disabled:hover.active,
|
212 |
+
.datepicker td.today.disabled,
|
213 |
+
.datepicker td.today:hover.disabled,
|
214 |
+
.datepicker td.today.disabled.disabled,
|
215 |
+
.datepicker td.today.disabled:hover.disabled,
|
216 |
+
.datepicker td.today[disabled],
|
217 |
+
.datepicker td.today:hover[disabled],
|
218 |
+
.datepicker td.today.disabled[disabled],
|
219 |
+
.datepicker td.today.disabled:hover[disabled] {
|
220 |
+
background-color: #fdf59a;
|
221 |
+
}
|
222 |
+
.datepicker td.today:active,
|
223 |
+
.datepicker td.today:hover:active,
|
224 |
+
.datepicker td.today.disabled:active,
|
225 |
+
.datepicker td.today.disabled:hover:active,
|
226 |
+
.datepicker td.today.active,
|
227 |
+
.datepicker td.today:hover.active,
|
228 |
+
.datepicker td.today.disabled.active,
|
229 |
+
.datepicker td.today.disabled:hover.active {
|
230 |
+
background-color: #fbf069 \9;
|
231 |
+
}
|
232 |
+
.datepicker td.active,
|
233 |
+
.datepicker td.active:hover,
|
234 |
+
.datepicker td.active.disabled,
|
235 |
+
.datepicker td.active.disabled:hover {
|
236 |
+
background-color: #006dcc;
|
237 |
+
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
|
238 |
+
background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
|
239 |
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
|
240 |
+
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
|
241 |
+
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
|
242 |
+
background-image: linear-gradient(top, #0088cc, #0044cc);
|
243 |
+
background-repeat: repeat-x;
|
244 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
|
245 |
+
border-color: #0044cc #0044cc #002a80;
|
246 |
+
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
247 |
+
filter: progid:dximagetransform.microsoft.gradient(enabled=false);
|
248 |
+
color: #fff;
|
249 |
+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
250 |
+
}
|
251 |
+
.datepicker td.active:hover,
|
252 |
+
.datepicker td.active:hover:hover,
|
253 |
+
.datepicker td.active.disabled:hover,
|
254 |
+
.datepicker td.active.disabled:hover:hover,
|
255 |
+
.datepicker td.active:active,
|
256 |
+
.datepicker td.active:hover:active,
|
257 |
+
.datepicker td.active.disabled:active,
|
258 |
+
.datepicker td.active.disabled:hover:active,
|
259 |
+
.datepicker td.active.active,
|
260 |
+
.datepicker td.active:hover.active,
|
261 |
+
.datepicker td.active.disabled.active,
|
262 |
+
.datepicker td.active.disabled:hover.active,
|
263 |
+
.datepicker td.active.disabled,
|
264 |
+
.datepicker td.active:hover.disabled,
|
265 |
+
.datepicker td.active.disabled.disabled,
|
266 |
+
.datepicker td.active.disabled:hover.disabled,
|
267 |
+
.datepicker td.active[disabled],
|
268 |
+
.datepicker td.active:hover[disabled],
|
269 |
+
.datepicker td.active.disabled[disabled],
|
270 |
+
.datepicker td.active.disabled:hover[disabled] {
|
271 |
+
background-color: #0044cc;
|
272 |
+
}
|
273 |
+
.datepicker td.active:active,
|
274 |
+
.datepicker td.active:hover:active,
|
275 |
+
.datepicker td.active.disabled:active,
|
276 |
+
.datepicker td.active.disabled:hover:active,
|
277 |
+
.datepicker td.active.active,
|
278 |
+
.datepicker td.active:hover.active,
|
279 |
+
.datepicker td.active.disabled.active,
|
280 |
+
.datepicker td.active.disabled:hover.active {
|
281 |
+
background-color: #003399 \9;
|
282 |
+
}
|
283 |
+
.datepicker td span {
|
284 |
+
display: block;
|
285 |
+
width: 23%;
|
286 |
+
height: 54px;
|
287 |
+
line-height: 54px;
|
288 |
+
float: left;
|
289 |
+
margin: 1%;
|
290 |
+
cursor: pointer;
|
291 |
+
-webkit-border-radius: 4px;
|
292 |
+
-moz-border-radius: 4px;
|
293 |
+
border-radius: 4px;
|
294 |
+
}
|
295 |
+
.datepicker td span:hover {
|
296 |
+
background: #eeeeee;
|
297 |
+
}
|
298 |
+
.datepicker td span.disabled,
|
299 |
+
.datepicker td span.disabled:hover {
|
300 |
+
background: none;
|
301 |
+
color: #999999;
|
302 |
+
cursor: default;
|
303 |
+
}
|
304 |
+
.datepicker td span.active,
|
305 |
+
.datepicker td span.active:hover,
|
306 |
+
.datepicker td span.active.disabled,
|
307 |
+
.datepicker td span.active.disabled:hover {
|
308 |
+
background-color: #006dcc;
|
309 |
+
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
|
310 |
+
background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
|
311 |
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
|
312 |
+
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
|
313 |
+
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
|
314 |
+
background-image: linear-gradient(top, #0088cc, #0044cc);
|
315 |
+
background-repeat: repeat-x;
|
316 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
|
317 |
+
border-color: #0044cc #0044cc #002a80;
|
318 |
+
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
319 |
+
filter: progid:dximagetransform.microsoft.gradient(enabled=false);
|
320 |
+
color: #fff;
|
321 |
+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
322 |
+
}
|
323 |
+
.datepicker td span.active:hover,
|
324 |
+
.datepicker td span.active:hover:hover,
|
325 |
+
.datepicker td span.active.disabled:hover,
|
326 |
+
.datepicker td span.active.disabled:hover:hover,
|
327 |
+
.datepicker td span.active:active,
|
328 |
+
.datepicker td span.active:hover:active,
|
329 |
+
.datepicker td span.active.disabled:active,
|
330 |
+
.datepicker td span.active.disabled:hover:active,
|
331 |
+
.datepicker td span.active.active,
|
332 |
+
.datepicker td span.active:hover.active,
|
333 |
+
.datepicker td span.active.disabled.active,
|
334 |
+
.datepicker td span.active.disabled:hover.active,
|
335 |
+
.datepicker td span.active.disabled,
|
336 |
+
.datepicker td span.active:hover.disabled,
|
337 |
+
.datepicker td span.active.disabled.disabled,
|
338 |
+
.datepicker td span.active.disabled:hover.disabled,
|
339 |
+
.datepicker td span.active[disabled],
|
340 |
+
.datepicker td span.active:hover[disabled],
|
341 |
+
.datepicker td span.active.disabled[disabled],
|
342 |
+
.datepicker td span.active.disabled:hover[disabled] {
|
343 |
+
background-color: #0044cc;
|
344 |
+
}
|
345 |
+
.datepicker td span.active:active,
|
346 |
+
.datepicker td span.active:hover:active,
|
347 |
+
.datepicker td span.active.disabled:active,
|
348 |
+
.datepicker td span.active.disabled:hover:active,
|
349 |
+
.datepicker td span.active.active,
|
350 |
+
.datepicker td span.active:hover.active,
|
351 |
+
.datepicker td span.active.disabled.active,
|
352 |
+
.datepicker td span.active.disabled:hover.active {
|
353 |
+
background-color: #003399 \9;
|
354 |
+
}
|
355 |
+
.datepicker td span.old {
|
356 |
+
color: #999999;
|
357 |
+
}
|
358 |
+
.datepicker th.switch {
|
359 |
+
width: 145px;
|
360 |
+
}
|
361 |
+
.datepicker thead tr:first-child th,
|
362 |
+
.datepicker tfoot tr:first-child th {
|
363 |
+
cursor: pointer;
|
364 |
+
}
|
365 |
+
.datepicker thead tr:first-child th:hover,
|
366 |
+
.datepicker tfoot tr:first-child th:hover {
|
367 |
+
background: #eeeeee;
|
368 |
+
}
|
369 |
+
.input-append.date .add-on i,
|
370 |
+
.input-prepend.date .add-on i {
|
371 |
+
display: block;
|
372 |
+
cursor: pointer;
|
373 |
+
width: 16px;
|
374 |
+
height: 16px;
|
375 |
+
}
|
376 |
+
|
377 |
+
[class^="icon-"], [class*=" icon-"] {
|
378 |
+
display:inline-block;
|
379 |
+
width:14px;
|
380 |
+
height:14px;
|
381 |
+
*margin-right:.3em;
|
382 |
+
line-height:14px;
|
383 |
+
vertical-align:text-top;
|
384 |
+
background-image:url("glyphicons-halflings.png");
|
385 |
+
background-position:14px 14px;
|
386 |
+
background-repeat:no-repeat;
|
387 |
+
}
|
388 |
+
[class^="icon-"]:last-child, [class*=" icon-"]:last-child { *margin-left:0; }
|
389 |
+
.icon-arrow-left { background-position:-240px -96px; }
|
390 |
.icon-arrow-right { background-position:-264px -96px; }
|
js/libraries/jquery-qtip/jquery.qtip.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
/*! qtip2 v2.0.0 | http://craigsworks.com/projects/qtip2/ | Licensed MIT, GPL */
|
2 |
(function(e,t,n){(function(e){"use strict";typeof define=="function"&&define.amd?define(["jquery"],e):jQuery&&!jQuery.fn.qtip&&e(jQuery)})(function(r){function _(n){E={pageX:n.pageX,pageY:n.pageY,type:"mousemove",scrollX:e.pageXOffset||t.body.scrollLeft||t.documentElement.scrollLeft,scrollY:e.pageYOffset||t.body.scrollTop||t.documentElement.scrollTop}}function D(e){var t=function(e){return e===o||"object"!=typeof e},n=function(e){return!r.isFunction(e)&&(!e&&!e.attr||e.length<1||"object"==typeof e&&!e.jquery&&!e.then)};if(!e||"object"!=typeof e)return s;t(e.metadata)&&(e.metadata={type:e.metadata});if("content"in e){if(t(e.content)||e.content.jquery)e.content={text:e.content};n(e.content.text||s)&&(e.content.text=s),"title"in e.content&&(t(e.content.title)&&(e.content.title={text:e.content.title}),n(e.content.title.text||s)&&(e.content.title.text=s))}return"position"in e&&t(e.position)&&(e.position={my:e.position,at:e.position}),"show"in e&&t(e.show)&&(e.show=e.show.jquery?{target:e.show}:{event:e.show}),"hide"in e&&t(e.hide)&&(e.hide=e.hide.jquery?{target:e.hide}:{event:e.hide}),"style"in e&&t(e.style)&&(e.style={classes:e.style}),r.each(w,function(){this.sanitize&&this.sanitize(e)}),e}function P(u,a,f,l){function q(e){var t=0,n,r=a,i=e.split(".");while(r=r[i[t++]])t<i.length&&(n=r);return[n||a,i.pop()]}function R(e){return T.concat("").join(e?"-"+e+" ":" ")}function U(){var e=a.style.widget,t=H.hasClass(j);H.removeClass(j),j=e?"ui-state-disabled":"qtip-disabled",H.toggleClass(j,t),H.toggleClass("ui-helper-reset "+R(),e).toggleClass(C,a.style.def&&!e),F.content&&F.content.toggleClass(R("content"),e),F.titlebar&&F.titlebar.toggleClass(R("header"),e),F.button&&F.button.toggleClass(S+"-icon",!e)}function z(e){F.title&&(F.titlebar.remove(),F.titlebar=F.title=F.button=o,e!==s&&m.reposition())}function W(){var e=a.content.title.button,t=typeof e=="string",n=t?e:"Close tooltip";F.button&&F.button.remove(),e.jquery?F.button=e:F.button=r("<a />",{"class":"qtip-close "+(a.style.widget?"":S+"-icon"),title:n,"aria-label":n}).prepend(r("<span />",{"class":"ui-icon ui-icon-close",html:"×"})),F.button.appendTo(F.titlebar||H).attr("role","button").click(function(e){return H.hasClass(j)||m.hide(e),s})}function X(){var e=y+"-title";F.titlebar&&z(),F.titlebar=r("<div />",{"class":S+"-titlebar "+(a.style.widget?R("header"):"")}).append(F.title=r("<div />",{id:e,"class":S+"-title","aria-atomic":i})).insertBefore(F.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(e){r(this).toggleClass("ui-state-active ui-state-focus",e.type.substr(-4)==="down")}).delegate(".qtip-close","mouseover mouseout",function(e){r(this).toggleClass("ui-state-hover",e.type==="mouseover")}),a.content.title.button&&W()}function V(e){var t=F.button;if(!m.rendered)return s;e?W():t.remove()}function J(e,t){var n=F.title;if(!m.rendered||!e)return s;r.isFunction(e)&&(e=e.call(u,I.event,m));if(e===s||!e&&e!=="")return z(s);e.jquery&&e.length>0?n.empty().append(e.css({display:"block"})):n.html(e),t!==s&&m.rendered&&H[0].offsetWidth>0&&m.reposition(I.event)}function K(e){e&&r.isFunction(e.done)&&e.done(function(e){Q(e,null,s)})}function Q(e,t,i){function f(e){function a(n){n&&(delete u[n.src],clearTimeout(m.timers.img[n.src]),r(n).unbind(B)),r.isEmptyObject(u)&&(t!==s&&m.reposition(I.event),e())}var i,u={};if((i=o.find("img[src]:not([height]):not([width])")).length===0)return a();i.each(function(e,t){if(u[t.src]!==n)return;var i=0,s=3;(function o(){if(t.height||t.width||i>s)return a(t);i+=1,m.timers.img[t.src]=setTimeout(o,700)})(),r(t).bind("error"+B+" load"+B,function(){a(this)}),u[t.src]=t})}var o=F.content;return!m.rendered||!e?s:(r.isFunction(e)&&(e=e.call(u,I.event,m)||""),i!==s&&K(a.content.deferred),e.jquery&&e.length>0?o.empty().append(e.css({display:"block"})):o.html(e),m.rendered<0?H.queue("fx",f):(P=0,f(r.noop)),m)}function G(){function h(e){if(H.hasClass(j))return s;clearTimeout(m.timers.show),clearTimeout(m.timers.hide);var t=function(){m.toggle(i,e)};a.show.delay>0?m.timers.show=setTimeout(t,a.show.delay):t()}function p(e){if(H.hasClass(j)||A||P)return s;var t=r(e.relatedTarget||e.target),i=t.closest(N)[0]===H[0],u=t[0]===o.show[0];clearTimeout(m.timers.show),clearTimeout(m.timers.hide);if(n.target==="mouse"&&i||a.hide.fixed&&/mouse(out|leave|move)/.test(e.type)&&(i||u)){try{e.preventDefault(),e.stopImmediatePropagation()}catch(f){}return}a.hide.delay>0?m.timers.hide=setTimeout(function(){m.hide(e)},a.hide.delay):m.hide(e)}function d(e){if(H.hasClass(j))return s;clearTimeout(m.timers.inactive),m.timers.inactive=setTimeout(function(){m.hide(e)},a.hide.inactive)}function v(e){m.rendered&&H[0].offsetWidth>0&&m.reposition(e)}var n=a.position,o={show:a.show.target,hide:a.hide.target,viewport:r(n.viewport),document:r(t),body:r(t.body),window:r(e)},l={show:r.trim(""+a.show.event).split(" "),hide:r.trim(""+a.hide.event).split(" ")},c=r.browser.msie&&parseInt(r.browser.version,10)===6;H.bind("mouseenter"+B+" mouseleave"+B,function(e){var t=e.type==="mouseenter";t&&m.focus(e),H.toggleClass(L,t)}),/mouse(out|leave)/i.test(a.hide.event)&&a.hide.leave==="window"&&o.window.bind("mouseout"+B+" blur"+B,function(e){!/select|option/.test(e.target.nodeName)&&!e.relatedTarget&&m.hide(e)}),a.hide.fixed?(o.hide=o.hide.add(H),H.bind("mouseover"+B,function(){H.hasClass(j)||clearTimeout(m.timers.hide)})):/mouse(over|enter)/i.test(a.show.event)&&o.hide.bind("mouseleave"+B,function(e){clearTimeout(m.timers.show)}),(""+a.hide.event).indexOf("unfocus")>-1&&n.container.closest("html").bind("mousedown"+B+" touchstart"+B,function(e){var t=r(e.target),n=m.rendered&&!H.hasClass(j)&&H[0].offsetWidth>0,i=t.parents(N).filter(H[0]).length>0;t[0]!==u[0]&&t[0]!==H[0]&&!i&&!u.has(t[0]).length&&!t.attr("disabled")&&m.hide(e)}),"number"==typeof a.hide.inactive&&(o.show.bind("qtip-"+f+"-inactive",d),r.each(b.inactiveEvents,function(e,t){o.hide.add(F.tooltip).bind(t+B+"-inactive",d)})),r.each(l.hide,function(e,t){var n=r.inArray(t,l.show),i=r(o.hide);n>-1&&i.add(o.show).length===i.length||t==="unfocus"?(o.show.bind(t+B,function(e){H[0].offsetWidth>0?p(e):h(e)}),delete l.show[n]):o.hide.bind(t+B,p)}),r.each(l.show,function(e,t){o.show.bind(t+B,h)}),"number"==typeof a.hide.distance&&o.show.add(H).bind("mousemove"+B,function(e){var t=I.origin||{},n=a.hide.distance,r=Math.abs;(r(e.pageX-t.pageX)>=n||r(e.pageY-t.pageY)>=n)&&m.hide(e)}),n.target==="mouse"&&(o.show.bind("mousemove"+B,_),n.adjust.mouse&&(a.hide.event&&(H.bind("mouseleave"+B,function(e){(e.relatedTarget||e.target)!==o.show[0]&&m.hide(e)}),F.target.bind("mouseenter"+B+" mouseleave"+B,function(e){I.onTarget=e.type==="mouseenter"})),o.document.bind("mousemove"+B,function(e){m.rendered&&I.onTarget&&!H.hasClass(j)&&H[0].offsetWidth>0&&m.reposition(e||E)}))),(n.adjust.resize||o.viewport.length)&&(r.event.special.resize?o.viewport:o.window).bind("resize"+B,v),o.window.bind("scroll"+B,v)}function Y(){var n=[a.show.target[0],a.hide.target[0],m.rendered&&F.tooltip[0],a.position.container[0],a.position.viewport[0],a.position.container.closest("html")[0],e,t];m.rendered?r([]).pushStack(r.grep(n,function(e){return typeof e=="object"})).unbind(B):a.show.target.unbind(B+"-create")}var m=this,g=t.body,y=S+"-"+f,A=0,P=0,H=r(),B=".qtip-"+f,j="qtip-disabled",F,I;m.id=f,m.rendered=s,m.destroyed=s,m.elements=F={target:u},m.timers={img:{}},m.options=a,m.checks={},m.plugins={},m.cache=I={event:{},target:r(),disabled:s,attr:l,onTarget:s,lastClass:""},m.checks.builtin={"^id$":function(e,t,n){var o=n===i?b.nextid:n,u=S+"-"+o;o!==s&&o.length>0&&!r("#"+u).length&&(H[0].id=u,F.content[0].id=u+"-content",F.title[0].id=u+"-title")},"^content.text$":function(e,t,n){Q(a.content.text)},"^content.deferred$":function(e,t,n){K(a.content.deferred)},"^content.title.text$":function(e,t,n){if(!n)return z();!F.title&&n&&X(),J(n)},"^content.title.button$":function(e,t,n){V(n)},"^position.(my|at)$":function(e,t,n){"string"==typeof n&&(e[t]=new w.Corner(n))},"^position.container$":function(e,t,n){m.rendered&&H.appendTo(n)},"^show.ready$":function(){m.rendered?m.toggle(i):m.render(1)},"^style.classes$":function(e,t,n){H.attr("class",S+" qtip "+n)},"^style.width|height":function(e,t,n){H.css(t,n)},"^style.widget|content.title":U,"^events.(render|show|move|hide|focus|blur)$":function(e,t,n){H[(r.isFunction(n)?"":"un")+"bind"]("tooltip"+t,n)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){var e=a.position;H.attr("tracking",e.target==="mouse"&&e.adjust.mouse),Y(),G()}},r.extend(m,{_triggerEvent:function(e,t,n){var i=r.Event("tooltip"+e);return i.originalEvent=(n?r.extend({},n):o)||I.event||o,H.trigger(i,[m].concat(t||[])),!i.isDefaultPrevented()},render:function(e){if(m.rendered)return m;var t=a.content.text,n=a.content.title,o=a.position;return r.attr(u[0],"aria-describedby",y),H=F.tooltip=r("<div/>",{id:y,"class":[S,C,a.style.classes,S+"-pos-"+a.position.my.abbrev()].join(" "),width:a.style.width||"",height:a.style.height||"",tracking:o.target==="mouse"&&o.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":s,"aria-describedby":y+"-content","aria-hidden":i}).toggleClass(j,I.disabled).data("qtip",m).appendTo(a.position.container).append(F.content=r("<div />",{"class":S+"-content",id:y+"-content","aria-atomic":i})),m.rendered=-1,A=1,n.text?(X(),r.isFunction(n.text)||J(n.text,s)):n.button&&W(),(!r.isFunction(t)||t.then)&&Q(t,s),m.rendered=i,U(),r.each(a.events,function(e,t){r.isFunction(t)&&H.bind(e==="toggle"?"tooltipshow tooltiphide":"tooltip"+e,t)}),r.each(w,function(){this.initialize==="render"&&this(m)}),G(),H.queue("fx",function(t){m._triggerEvent("render"),A=0,(a.show.ready||e)&&m.toggle(i,I.event,s),t()}),m},get:function(e){var t,n;switch(e.toLowerCase()){case"dimensions":t={height:H.outerHeight(s),width:H.outerWidth(s)};break;case"offset":t=w.offset(H,a.position.container);break;default:n=q(e.toLowerCase()),t=n[0][n[1]],t=t.precedance?t.string():t}return t},set:function(e,t){function h(e,t){var n,r,i;for(n in l)for(r in l[n])if(i=(new RegExp(r,"i")).exec(e))t.push(i),l[n][r].apply(m,t)}var n=/^position\.(my|at|adjust|target|container)|style|content|show\.ready/i,u=/^content\.(title|attr)|style/i,f=s,l=m.checks,c;return"string"==typeof e?(c=e,e={},e[c]=t):e=r.extend(i,{},e),r.each(e,function(t,i){var s=q(t.toLowerCase()),o;o=s[0][s[1]],s[0][s[1]]="object"==typeof i&&i.nodeType?r(i):i,e[t]=[s[0],s[1],i,o],f=n.test(t)||f}),D(a),A=1,r.each(e,h),A=0,m.rendered&&H[0].offsetWidth>0&&f&&m.reposition(a.position.target==="mouse"?o:I.event),m},toggle:function(e,n){function b(){e?(r.browser.msie&&H[0].style.removeAttribute("filter"),H.css("overflow",""),"string"==typeof u.autofocus&&r(u.autofocus,H).focus(),u.target.trigger("qtip-"+f+"-inactive")):H.css({display:"",visibility:"",opacity:"",left:"",top:""}),m._triggerEvent(e?"visible":"hidden")}if(n){if(/over|enter/.test(n.type)&&/out|leave/.test(I.event.type)&&a.show.target.add(n.target).length===a.show.target.length&&H.has(n.relatedTarget).length)return m;I.event=r.extend({},n)}if(!m.rendered)return e?m.render(1):m;var o=e?"show":"hide",u=a[o],l=a[e?"hide":"show"],c=a.position,h=a.content,p=H[0].offsetWidth>0,d=e||u.target.length===1,v=!n||u.target.length<2||I.target[0]===n.target,g,y;return(typeof e).search("boolean|number")&&(e=!p),!H.is(":animated")&&p===e&&v?m:m._triggerEvent(o,[90])?(r.attr(H[0],"aria-hidden",!e),e?(I.origin=r.extend({},E),m.focus(n),r.isFunction(h.text)&&Q(h.text,s),r.isFunction(h.title.text)&&J(h.title.text,s),!M&&c.target==="mouse"&&c.adjust.mouse&&(r(t).bind("mousemove.qtip",_),M=i),m.reposition(n,arguments[2]),!u.solo||r(N,u.solo).not(H).qtip("hide",r.Event("tooltipsolo"))):(clearTimeout(m.timers.show),delete I.origin,M&&!r(N+'[tracking="true"]:visible',u.solo).not(H).length&&(r(t).unbind("mousemove.qtip"),M=s),m.blur(n)),u.effect===s||d===s?(H[o](),b.call(H)):r.isFunction(u.effect)?(H.stop(1,1),u.effect.call(H,m),H.queue("fx",function(e){b(),e()})):H.fadeTo(90,e?1:0,b),e&&u.target.trigger("qtip-"+f+"-inactive"),m):m},show:function(e){return m.toggle(i,e)},hide:function(e){return m.toggle(s,e)},focus:function(e){if(!m.rendered)return m;var t=r(N),n=parseInt(H[0].style.zIndex,10),i=b.zindex+t.length,s=r.extend({},e),o;return H.hasClass(k)||m._triggerEvent("focus",[i],s)&&(n!==i&&(t.each(function(){this.style.zIndex>n&&(this.style.zIndex=this.style.zIndex-1)}),t.filter("."+k).qtip("blur",s)),H.addClass(k)[0].style.zIndex=i),m},blur:function(e){return H.removeClass(k),m._triggerEvent("blur",[H.css("zIndex")],e),m},reposition:function(n,i){if(!m.rendered||A)return m;A=1;var o=a.position.target,u=a.position,f=u.my,l=u.at,g=u.adjust,y=g.method.split(" "),b=H.outerWidth(s),S=H.outerHeight(s),x=0,T=0,N=H.css("position"),C=u.viewport,k={left:0,top:0},L=u.container,O=H[0].offsetWidth>0,M=n&&n.type==="scroll",_=r(e),D,P;if(r.isArray(o)&&o.length===2)l={x:h,y:c},k={left:o[0],top:o[1]};else if(o==="mouse"&&(n&&n.pageX||I.event.pageX))l={x:h,y:c},n=E&&E.pageX&&(g.mouse||!n||!n.pageX)?{pageX:E.pageX,pageY:E.pageY}:(!n||n.type!=="resize"&&n.type!=="scroll"?n&&n.pageX&&n.type==="mousemove"?n:!g.mouse&&I.origin&&I.origin.pageX&&a.show.distance?I.origin:n:I.event)||n||I.event||E||{},N!=="static"&&(k=L.offset()),k={left:n.pageX-k.left,top:n.pageY-k.top},g.mouse&&M&&(k.left-=E.scrollX-_.scrollLeft(),k.top-=E.scrollY-_.scrollTop());else{o==="event"&&n&&n.target&&n.type!=="scroll"&&n.type!=="resize"?I.target=r(n.target):o!=="event"&&(I.target=r(o.jquery?o:F.target)),o=I.target,o=r(o).eq(0);if(o.length===0)return m;o[0]===t||o[0]===e?(x=w.iOS?e.innerWidth:o.width(),T=w.iOS?e.innerHeight:o.height(),o[0]===e&&(k={top:(C||o).scrollTop(),left:(C||o).scrollLeft()})):w.imagemap&&o.is("area")?D=w.imagemap(m,o,l,w.viewport?y:s):w.svg&&o[0].ownerSVGElement?D=w.svg(m,o,l,w.viewport?y:s):(x=o.outerWidth(s),T=o.outerHeight(s),k=w.offset(o,L)),D&&(x=D.width,T=D.height,P=D.offset,k=D.position);if(w.iOS>3.1&&w.iOS<4.1||w.iOS>=4.3&&w.iOS<4.33||!w.iOS&&N==="fixed")k.left-=_.scrollLeft(),k.top-=_.scrollTop();k.left+=l.x===d?x:l.x===v?x/2:0,k.top+=l.y===p?T:l.y===v?T/2:0}return k.left+=g.x+(f.x===d?-b:f.x===v?-b/2:0),k.top+=g.y+(f.y===p?-S:f.y===v?-S/2:0),w.viewport?(k.adjusted=w.viewport(m,k,u,x,T,b,S),P&&k.adjusted.left&&(k.left+=P.left),P&&k.adjusted.top&&(k.top+=P.top)):k.adjusted={left:0,top:0},m._triggerEvent("move",[k,C.elem||C],n)?(delete k.adjusted,i===s||!O||isNaN(k.left)||isNaN(k.top)||o==="mouse"||!r.isFunction(u.effect)?H.css(k):r.isFunction(u.effect)&&(u.effect.call(H,m,r.extend({},k)),H.queue(function(e){r(this).css({opacity:"",height:""}),r.browser.msie&&this.style.removeAttribute("filter"),e()})),A=0,m):m},disable:function(e){return"boolean"!=typeof e&&(e=!H.hasClass(j)&&!I.disabled),m.rendered?(H.toggleClass(j,e),r.attr(H[0],"aria-disabled",e)):I.disabled=!!e,m},enable:function(){return m.disable(s)},destroy:function(){var e=u[0],t=r.attr(e,O),n=u.data("qtip");m.destroyed=i,m.rendered&&(H.stop(1,0).remove(),r.each(m.plugins,function(){this.destroy&&this.destroy()})),clearTimeout(m.timers.show),clearTimeout(m.timers.hide),Y();if(!n||m===n)r.removeData(e,"qtip"),a.suppress&&t&&(r.attr(e,"title",t),u.removeAttr(O)),u.removeAttr("aria-describedby");return u.unbind(".qtip-"+f),delete x[m.id],u}})}function H(e,n){var u,a,f,l,c,h=r(this),p=r(t.body),d=this===t?p:h,v=h.metadata?h.metadata(n.metadata):o,m=n.metadata.type==="html5"&&v?v[n.metadata.name]:o,g=h.data(n.metadata.name||"qtipopts");try{g=typeof g=="string"?r.parseJSON(g):g}catch(y){}l=r.extend(i,{},b.defaults,n,typeof g=="object"?D(g):o,D(m||v)),a=l.position,l.id=e;if("boolean"==typeof l.content.text){f=h.attr(l.content.attr);if(l.content.attr===s||!f)return s;l.content.text=f}a.container.length||(a.container=p),a.target===s&&(a.target=d),l.show.target===s&&(l.show.target=d),l.show.solo===i&&(l.show.solo=a.container.closest("body")),l.hide.target===s&&(l.hide.target=d),l.position.viewport===i&&(l.position.viewport=a.container),a.container=a.container.eq(0),a.at=new w.Corner(a.at),a.my=new w.Corner(a.my);if(r.data(this,"qtip"))if(l.overwrite)h.qtip("destroy");else if(l.overwrite===s)return s;return l.suppress&&(c=r.attr(this,"title"))&&r(this).removeAttr("title").attr(O,c).attr("title",""),u=new P(h,l,e,!!f),r.data(this,"qtip",u),h.bind("remove.qtip-"+e+" removeqtip.qtip-"+e,function(){u.destroy()}),u}function B(e){var t=this,n=e.elements.tooltip,o=e.options.content.ajax,u=b.defaults.content.ajax,a=".qtip-ajax",f=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,l=i,c=s,h;e.checks.ajax={"^content.ajax":function(e,r,i){r==="ajax"&&(o=i),r==="once"?t.init():o&&o.url?t.load():n.unbind(a)}},r.extend(t,{init:function(){return o&&o.url&&n.unbind(a)[o.once?"one":"bind"]("tooltipshow"+a,t.load),t},load:function(n){function g(){var t;if(e.destroyed)return;l=s,v&&(c=i,e.show(n.originalEvent)),(t=u.complete||o.complete)&&r.isFunction(t)&&t.apply(o.context||e,arguments)}function y(t,n,i){var s;if(e.destroyed)return;d&&"string"==typeof t&&(t=r("<div/>").append(t.replace(f,"")).find(d)),(s=u.success||o.success)&&r.isFunction(s)?s.call(o.context||e,t,n,i):e.set("content.text",t)}function b(t,n,r){if(e.destroyed||t.status===0)return;e.set("content.text",n+": "+r)}if(c){c=s;return}var a=o.url.lastIndexOf(" "),p=o.url,d,v=!o.loading&&l;if(v)try{n.preventDefault()}catch(m){}else if(n&&n.isDefaultPrevented())return t;h&&h.abort&&h.abort(),a>-1&&(d=p.substr(a),p=p.substr(0,a)),h=r.ajax(r.extend({error:u.error||b,context:e},o,{url:p,success:y,complete:g}))},destroy:function(){h&&h.abort&&h.abort(),e.destroyed=i}}),t.init()}function j(e,t,n){var r=Math.ceil(t/2),i=Math.ceil(n/2),s={bottomright:[[0,0],[t,n],[t,0]],bottomleft:[[0,0],[t,0],[0,n]],topright:[[0,n],[t,0],[t,n]],topleft:[[0,0],[0,n],[t,n]],topcenter:[[0,n],[r,0],[t,n]],bottomcenter:[[0,0],[t,0],[r,n]],rightcenter:[[0,0],[t,i],[0,n]],leftcenter:[[t,0],[t,n],[0,i]]};return s.lefttop=s.bottomright,s.righttop=s.bottomleft,s.leftbottom=s.topright,s.rightbottom=s.topleft,s[e.string()]}function F(e,t){function A(e){var t=E.is(":visible");E.show(),e(),E.toggle(t)}function O(){x.width=g.height,x.height=g.width}function M(){x.width=g.width,x.height=g.height}function _(t,r,o,f){if(!b.tip)return;var l=m.corner.clone(),w=o.adjusted,E=e.options.position.adjust.method.split(" "),x=E[0],T=E[1]||E[0],N={left:s,top:s,x:0,y:0},C,k={},L;m.corner.fixed!==i&&(x===y&&l.precedance===u&&w.left&&l.y!==v?l.precedance=l.precedance===u?a:u:x!==y&&w.left&&(l.x=l.x===v?w.left>0?h:d:l.x===h?d:h),T===y&&l.precedance===a&&w.top&&l.x!==v?l.precedance=l.precedance===a?u:a:T!==y&&w.top&&(l.y=l.y===v?w.top>0?c:p:l.y===c?p:c),l.string()!==S.corner.string()&&(S.top!==w.top||S.left!==w.left)&&m.update(l,s)),C=m.position(l,w),C[l.x]+=P(l,l.x),C[l.y]+=P(l,l.y),C.right!==n&&(C.left=-C.right),C.bottom!==n&&(C.top=-C.bottom),C.user=Math.max(0,g.offset);if(N.left=x===y&&!!w.left)l.x===v?k["margin-left"]=N.x=C["margin-left"]:(L=C.right!==n?[w.left,-C.left]:[-w.left,C.left],(N.x=Math.max(L[0],L[1]))>L[0]&&(o.left-=w.left,N.left=s),k[C.right!==n?d:h]=N.x);if(N.top=T===y&&!!w.top)l.y===v?k["margin-top"]=N.y=C["margin-top"]:(L=C.bottom!==n?[w.top,-C.top]:[-w.top,C.top],(N.y=Math.max(L[0],L[1]))>L[0]&&(o.top-=w.top,N.top=s),k[C.bottom!==n?p:c]=N.y);b.tip.css(k).toggle(!(N.x&&N.y||l.x===v&&N.y||l.y===v&&N.x)),o.left-=C.left.charAt?C.user:x!==y||N.top||!N.left&&!N.top?C.left:0,o.top-=C.top.charAt?C.user:T!==y||N.left||!N.left&&!N.top?C.top:0,S.left=w.left,S.top=w.top,S.corner=l.clone()}function D(){var t=g.corner,n=e.options.position,r=n.at,o=n.my.string?n.my.string():n.my;return t===s||o===s&&r===s?s:(t===i?m.corner=new w.Corner(o):t.string||(m.corner=new w.Corner(t),m.corner.fixed=i),S.corner=new w.Corner(m.corner.string()),m.corner.string()!=="centercenter")}function P(e,t,n){t=t?t:e[e.precedance];var r=b.titlebar&&e.y===c,i=r?b.titlebar:E,s="border-"+t+"-width",o=function(e){return parseInt(e.css(s),10)},u;return A(function(){u=(n?o(n):o(b.content)||o(i)||o(E))||0}),u}function H(e){var t=b.titlebar&&e.y===c,n=t?b.titlebar:b.content,i=r.browser.mozilla,s=i?"-moz-":r.browser.webkit?"-webkit-":"",o="border-radius-"+e.y+e.x,u="border-"+e.y+"-"+e.x+"-radius",a=function(e){return parseInt(n.css(e),10)||parseInt(E.css(e),10)},f;return A(function(){f=a(u)||a(s+u)||a(s+o)||a(o)||0}),f}function B(e){function N(e,t,n){var r=e.css(t)||p;return n&&r===e.css(n)?s:f.test(r)?s:r}var t,n,o,u=b.tip.css("cssText",""),a=e||m.corner,f=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,l="border-"+a[a.precedance]+"-color",h="background-color",p="transparent",d=" !important",y=b.titlebar,w=y&&(a.y===c||a.y===v&&u.position().top+x.height/2+g.offset<y.outerHeight(i)),S=w?y:b.content;A(function(){T.fill=N(u,h)||N(S,h)||N(b.content,h)||N(E,h)||u.css(h),T.border=N(u,l,"color")||N(S,l,"color")||N(b.content,l,"color")||N(E,l,"color")||E.css(l),r("*",u).add(u).css("cssText",h+":"+p+d+";border:0"+d+";")})}function F(e){var t=e.precedance===a,n=x[t?f:l],r=x[t?l:f],i=e.string().indexOf(v)>-1,s=n*(i?.5:1),o=Math.pow,u=Math.round,c,h,p,d=Math.sqrt(o(s,2)+o(r,2)),m=[N/s*d,N/r*d];return m[2]=Math.sqrt(o(m[0],2)-o(N,2)),m[3]=Math.sqrt(o(m[1],2)-o(N,2)),c=d+m[2]+m[3]+(i?0:m[0]),h=c/d,p=[u(h*r),u(h*n)],{height:p[t?0:1],width:p[t?1:0]}}function I(e,t,n){return"<qvml:"+e+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(t||"")+' style="behavior: url(#default#VML); '+(n||"")+'" />'}var m=this,g=e.options.style.tip,b=e.elements,E=b.tooltip,S={top:0,left:0},x={width:g.width,height:g.height},T={},N=g.border||0,C=".qtip-tip",k=!!(r("<canvas />")[0]||{}).getContext,L;m.corner=o,m.mimic=o,m.border=N,m.offset=g.offset,m.size=x,e.checks.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){m.init()||m.destroy(),e.reposition()},"^style.tip.(height|width)$":function(){x={width:g.width,height:g.height},m.create(),m.update(),e.reposition()},"^content.title.text|style.(classes|widget)$":function(){b.tip&&b.tip.length&&m.update()}},r.extend(m,{init:function(){var e=D()&&(k||r.browser.msie);return e&&(m.create(),m.update(),E.unbind(C).bind("tooltipmove"+C,_)),e},create:function(){var e=x.width,t=x.height,n;b.tip&&b.tip.remove(),b.tip=r("<div />",{"class":"qtip-tip"}).css({width:e,height:t}).prependTo(E),k?r("<canvas />").appendTo(b.tip)[0].getContext("2d").save():(n=I("shape",'coordorigin="0,0"',"position:absolute;"),b.tip.html(n+n),r("*",b.tip).bind("click mousedown",function(e){e.stopPropagation()}))},update:function(e,t){var n=b.tip,f=n.children(),l=x.width,y=x.height,C=g.mimic,L=Math.round,A,_,D,H,q;e||(e=S.corner||m.corner),C===s?C=e:(C=new w.Corner(C),C.precedance=e.precedance,C.x==="inherit"?C.x=e.x:C.y==="inherit"?C.y=e.y:C.x===C.y&&(C[e.precedance]=e[e.precedance])),A=C.precedance,e.precedance===u?O():M(),b.tip.css({width:l=x.width,height:y=x.height}),B(e),T.border!=="transparent"?(N=P(e,o),g.border===0&&N>0&&(T.fill=T.border),m.border=N=g.border!==i?g.border:N):m.border=N=0,D=j(C,l,y),m.size=q=F(e),n.css(q).css("line-height",q.height+"px"),e.precedance===a?H=[L(C.x===h?N:C.x===d?q.width-l-N:(q.width-l)/2),L(C.y===c?q.height-y:0)]:H=[L(C.x===h?q.width-l:0),L(C.y===c?N:C.y===p?q.height-y-N:(q.height-y)/2)],k?(f.attr(q),_=f[0].getContext("2d"),_.restore(),_.save(),_.clearRect(0,0,3e3,3e3),_.fillStyle=T.fill,_.strokeStyle=T.border,_.lineWidth=N*2,_.lineJoin="miter",_.miterLimit=100,_.translate(H[0],H[1]),_.beginPath(),_.moveTo(D[0][0],D[0][1]),_.lineTo(D[1][0],D[1][1]),_.lineTo(D[2][0],D[2][1]),_.closePath(),N&&(E.css("background-clip")==="border-box"&&(_.strokeStyle=T.fill,_.stroke()),_.strokeStyle=T.border,_.stroke()),_.fill()):(D="m"+D[0][0]+","+D[0][1]+" l"+D[1][0]+","+D[1][1]+" "+D[2][0]+","+D[2][1]+" xe",H[2]=N&&/^(r|b)/i.test(e.string())?parseFloat(r.browser.version,10)===8?2:1:0,f.css({coordsize:l+N+" "+(y+N),antialias:""+(C.string().indexOf(v)>-1),left:H[0],top:H[1],width:l+N,height:y+N}).each(function(e){var t=r(this);t[t.prop?"prop":"attr"]({coordsize:l+N+" "+(y+N),path:D,fillcolor:T.fill,filled:!!e,stroked:!e}).toggle(!!N||!!e),!e&&t.html()===""&&t.html(I("stroke",'weight="'+N*2+'px" color="'+T.border+'" miterlimit="1000" joinstyle="miter"'))})),t!==s&&m.position(e)},position:function(e){var t=b.tip,n={},i=Math.max(0,g.offset),o,p,d;return g.corner===s||!t?s:(e=e||m.corner,o=e.precedance,p=F(e),d=[e.x,e.y],o===u&&d.reverse(),r.each(d,function(t,r){var s,u,d;r===v?(s=o===a?h:c,n[s]="50%",n["margin-"+s]=-Math.round(p[o===a?f:l]/2)+i):(s=P(e,r),u=P(e,r,b.content),d=H(e),n[r]=t?u:i+(d>s?d:-s))}),n[e[o]]-=p[o===u?f:l],t.css({top:"",bottom:"",left:"",right:"",margin:""}).css(n),n)},destroy:function(){b.tip&&b.tip.remove(),b.tip=!1,E.unbind(C)}}),m.init()}function I(n){function y(){m=r(v,f).not("[disabled]").map(function(){return typeof this.focus=="function"?this:null})}function b(e){m.length<1&&e.length?e.not("body").blur():m.first().focus()}function E(e){var t=r(e.target),n=t.closest(".qtip"),i;i=n.length<1?s:parseInt(n[0].style.zIndex,10)>parseInt(f[0].style.zIndex,10),!i&&r(e.target).closest(N)[0]!==f[0]&&b(t)}var o=this,u=n.options.show.modal,a=n.elements,f=a.tooltip,l="#qtip-overlay",c=".qtipmodal",h=c+n.id,p="is-modal-qtip",d=r(t.body),v=w.modal.focusable.join(","),m={},g;n.checks.modal={"^show.modal.(on|blur)$":function(){o.init(),a.overlay.toggle(f.is(":visible"))},"^content.text$":function(){y()}},r.extend(o,{init:function(){return u.on?(g=o.create(),f.attr(p,i).css("z-index",w.modal.zindex+r(N+"["+p+"]").length).unbind(c).unbind(h).bind("tooltipshow"+c+" tooltiphide"+c,function(e,t,n){var i=e.originalEvent;if(e.target===f[0])if(i&&e.type==="tooltiphide"&&/mouse(leave|enter)/.test(i.type)&&r(i.relatedTarget).closest(g[0]).length)try{e.preventDefault()}catch(s){}else(!i||i&&!i.solo)&&o[e.type.replace("tooltip","")](e,n)}).bind("tooltipfocus"+c,function(e){if(e.isDefaultPrevented()||e.target!==f[0])return;var t=r(N).filter("["+p+"]"),n=w.modal.zindex+t.length,i=parseInt(f[0].style.zIndex,10);g[0].style.zIndex=n-2,t.each(function(){this.style.zIndex>i&&(this.style.zIndex-=1)}),t.end().filter("."+k).qtip("blur",e.originalEvent),f.addClass(k)[0].style.zIndex=n;try{e.preventDefault()}catch(s){}}).bind("tooltiphide"+c,function(e){e.target===f[0]&&r("["+p+"]").filter(":visible").not(f).last().qtip("focus",e)}),u.escape&&r(t).unbind(h).bind("keydown"+h,function(e){e.keyCode===27&&f.hasClass(k)&&n.hide(e)}),u.blur&&a.overlay.unbind(h).bind("click"+h,function(e){f.hasClass(k)&&n.hide(e)}),y(),o):o},create:function(){function i(){g.css({height:n.height(),width:n.width()})}var t=r(l),n=r(e);return t.length?a.overlay=t.insertAfter(r(N).last()):(g=a.overlay=r("<div />",{id:l.substr(1),html:"<div></div>",mousedown:function(){return s}}).hide().insertAfter(r(N).last()),n.unbind(c).bind("resize"+c,i),i(),g)},toggle:function(e,t,n){if(e&&e.isDefaultPrevented())return o;var a=u.effect,l=t?"show":"hide",c=g.is(":visible"),v=r("["+p+"]").filter(":visible").not(f),m;return g||(g=o.create()),g.is(":animated")&&c===t&&g.data("toggleState")!==s||!t&&v.length?o:(t?(g.css({left:0,top:0}),g.toggleClass("blurs",u.blur),u.stealfocus!==s&&(d.bind("focusin"+h,E),b(r("body :focus")))):d.unbind("focusin"+h),g.stop(i,s).data("toggleState",t),r.isFunction(a)?a.call(g,t):a===s?g[l]():g.fadeTo(parseInt(n,10)||90,t?1:0,function(){t||r(this).hide()}),t||g.queue(function(e){g.css({left:"",top:""}).removeData("toggleState"),e()}),o)},show:function(e,t){return o.toggle(e,i,t)},hide:function(e,t){return o.toggle(e,s,t)},destroy:function(){var e=g;return e&&(e=r("["+p+"]").not(f).length<1,e?(a.overlay.remove(),r(t).unbind(c)):a.overlay.unbind(c+n.id),d.unbind("focusin"+h)),f.removeAttr(p).unbind(c)}}),o.init()}function q(n){var o=this,u=n.elements,a=n.options,c=u.tooltip,h=".ie6-"+n.id,p=r("select, object").length<1,d=0,v=s,m;n.checks.ie6={"^content|style$":function(e,t,n){redraw()}},r.extend(o,{init:function(){var n=r(e),s;p&&(u.bgiframe=r('<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>'),u.bgiframe.appendTo(c),c.bind("tooltipmove"+h,o.adjustBGIFrame)),m=r("<div/>",{id:"qtip-rcontainer"}).appendTo(t.body),o.redraw(),u.overlay&&!v&&(s=function(){u.overlay[0].style.top=n.scrollTop()+"px"},n.bind("scroll.qtip-ie6, resize.qtip-ie6",s),s(),u.overlay.addClass("qtipmodal-ie6fix"),v=i)},adjustBGIFrame:function(){var e=n.get("dimensions"),t=n.plugins.tip,r=u.tip,i,s;s=parseInt(c.css("border-left-width"),10)||0,s={left:-s,top:-s},t&&r&&(i=t.corner.precedance==="x"?["width","left"]:["height","top"],s[i[1]]-=r[i[0]]()),u.bgiframe.css(s).css(e)},redraw:function(){if(n.rendered<1||d)return o;var e=a.style,t=a.position.container,r,i,s,u;return d=1,e.height&&c.css(l,e.height),e.width?c.css(f,e.width):(c.css(f,"").appendTo(m),i=c.width(),i%2<1&&(i+=1),s=c.css("max-width")||"",u=c.css("min-width")||"",r=(s+u).indexOf("%")>-1?t.width()/100:0,s=(s.indexOf("%")>-1?r:1)*parseInt(s,10)||i,u=(u.indexOf("%")>-1?r:1)*parseInt(u,10)||0,i=s+u?Math.min(Math.max(i,u),s):i,c.css(f,Math.round(i)).appendTo(t)),d=0,o},destroy:function(){p&&u.bgiframe.remove(),c.unbind(h)}}),o.init()}var i=!0,s=!1,o=null,u="x",a="y",f="width",l="height",c="top",h="left",p="bottom",d="right",v="center",m="flip",g="flipinvert",y="shift",b,w,E,S="qtip",x={},T=["ui-widget","ui-tooltip"],N="div.qtip."+S,C=S+"-default",k=S+"-focus",L=S+"-hover",A="_replacedByqTip",O="oldtitle",M;b=r.fn.qtip=function(e,t,u){var a=(""+e).toLowerCase(),f=o,l=r.makeArray(arguments).slice(1),c=l[l.length-1],h=this[0]?r.data(this[0],"qtip"):o;if(!arguments.length&&h||a==="api")return h;if("string"==typeof e)return this.each(function(){var e=r.data(this,"qtip");if(!e)return i;c&&c.timeStamp&&(e.cache.event=c);if(a!=="option"&&a!=="options"||!t)e[a]&&e[a].apply(e[a],l);else{if(!r.isPlainObject(t)&&u===n)return f=e.get(t),s;e.set(t,u)}}),f!==o?f:this;if("object"==typeof e||!arguments.length)return h=D(r.extend(i,{},e)),b.bind.call(this,h,c)},b.bind=function(e,t){return this.each(function(o){function p(e){function t(){c.render(typeof e=="object"||u.show.ready),a.show.add(a.hide).unbind(l)}if(c.cache.disabled)return s;c.cache.event=r.extend({},e),c.cache.target=e?r(e.target):[n],u.show.delay>0?(clearTimeout(c.timers.show),c.timers.show=setTimeout(t,u.show.delay),f.show!==f.hide&&a.hide.bind(f.hide,function(){clearTimeout(c.timers.show)})):t()}var u,a,f,l,c,h;h=r.isArray(e.id)?e.id[o]:e.id,h=!h||h===s||h.length<1||x[h]?b.nextid++:x[h]=h,l=".qtip-"+h+"-create",c=H.call(this,h,e);if(c===s)return i;u=c.options,r.each(w,function(){this.initialize==="initialize"&&this(c)}),a={show:u.show.target,hide:u.hide.target},f={show:r.trim(""+u.show.event).replace(/ /g,l+" ")+l,hide:r.trim(""+u.hide.event).replace(/ /g,l+" ")+l},/mouse(over|enter)/i.test(f.show)&&!/mouse(out|leave)/i.test(f.hide)&&(f.hide+=" mouseleave"+l),a.show.bind("mousemove"+l,function(e){_(e),c.cache.onTarget=i}),a.show.bind(f.show,p),(u.show.ready||u.prerender)&&p(t)}).attr("data-hasqtip",i)},w=b.plugins={Corner:function(e){e=(""+e).replace(/([A-Z])/," $1").replace(/middle/gi,v).toLowerCase(),this.x=(e.match(/left|right/i)||e.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(e.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase();var t=e.charAt(0);this.precedance=t==="t"||t==="b"?a:u,this.string=function(){return this.precedance===a?this.y+this.x:this.x+this.y},this.abbrev=function(){var e=this.x.substr(0,1),t=this.y.substr(0,1);return e===t?e:this.precedance===a?t+e:e+t},this.invertx=function(e){this.x=this.x===h?d:this.x===d?h:e||this.x},this.inverty=function(e){this.y=this.y===c?p:this.y===p?c:e||this.y},this.clone=function(){return{x:this.x,y:this.y,precedance:this.precedance,string:this.string,abbrev:this.abbrev,clone:this.clone,invertx:this.invertx,inverty:this.inverty}}},offset:function(e,n){function c(e,t){i.left+=t*e.scrollLeft(),i.top+=t*e.scrollTop()}var i=e.offset(),s=e.closest("body"),o=r.browser.msie&&t.compatMode!=="CSS1Compat",u=n,a,f,l;if(u){do u.css("position")!=="static"&&(f=u.position(),i.left-=f.left+(parseInt(u.css("borderLeftWidth"),10)||0)+(parseInt(u.css("marginLeft"),10)||0),i.top-=f.top+(parseInt(u.css("borderTopWidth"),10)||0)+(parseInt(u.css("marginTop"),10)||0),!a&&(l=u.css("overflow"))!=="hidden"&&l!=="visible"&&(a=u));while((u=r(u[0].offsetParent)).length);(a&&a[0]!==s[0]||o)&&c(a||s,1)}return i},iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||s,fn:{attr:function(e,t){if(this.length){var n=this[0],i="title",s=r.data(n,"qtip");if(e===i&&s&&"object"==typeof s&&s.options.suppress)return arguments.length<2?r.attr(n,O):(s&&s.options.content.attr===i&&s.cache.attr&&s.set("content.text",t),this.attr(O,t))}return r.fn["attr"+A].apply(this,arguments)},clone:function(e){var t=r([]),n="title",i=r.fn["clone"+A].apply(this,arguments);return e||i.filter("["+O+"]").attr("title",function(){return r.attr(this,O)}).removeAttr(O),i}}},r.each(w.fn,function(e,t){if(!t||r.fn[e+A])return i;var n=r.fn[e+A]=r.fn[e];r.fn[e]=function(){return t.apply(this,arguments)||n.apply(this,arguments)}}),r.ui||(r["cleanData"+A]=r.cleanData,r.cleanData=function(e){for(var t=0,i;(i=e[t])!==n;t++)try{r(i).triggerHandler("removeqtip")}catch(s){}r["cleanData"+A](e)}),b.version="2.0.0-nightly-15f5c6bc20",b.nextid=0,b.inactiveEvents="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),b.zindex=15e3,b.defaults={prerender:s,id:s,overwrite:i,suppress:i,content:{text:i,attr:"title",deferred:s,title:{text:s,button:s}},position:{my:"top left",at:"bottom right",target:s,container:s,viewport:s,adjust:{x:0,y:0,mouse:i,resize:i,method:"flipinvert flipinvert"},effect:function(e,t,n){r(this).animate(t,{duration:200,queue:s})}},show:{target:s,event:"mouseenter",effect:i,delay:90,solo:s,ready:s,autofocus:s},hide:{target:s,event:"mouseleave",effect:i,delay:0,fixed:s,inactive:s,leave:"window",distance:s},style:{classes:"",widget:s,width:s,height:s,def:i},events:{render:o,move:o,show:o,hide:o,toggle:o,visible:o,hidden:o,focus:o,blur:o}},w.svg=function(e,n,i,s){var o=r(t),u=n[0],a={width:0,height:0,position:{top:1e10,left:1e10}},f,l,c,h,p;while(!u.getBBox)u=u.parentNode;if(u.getBBox&&u.parentNode){f=u.getBBox(),l=u.getScreenCTM(),c=u.farthestViewportElement||u;if(!c.createSVGPoint)return a;h=c.createSVGPoint(),h.x=f.x,h.y=f.y,p=h.matrixTransform(l),a.position.left=p.x,a.position.top=p.y,h.x+=f.width,h.y+=f.height,p=h.matrixTransform(l),a.width=p.x-a.position.left,a.height=p.y-a.position.top,a.position.left+=o.scrollLeft(),a.position.top+=o.scrollTop()}return a},w.ajax=function(e){var t=e.plugins.ajax;return"object"==typeof t?t:e.plugins.ajax=new B(e)},w.ajax.initialize="render",w.ajax.sanitize=function(e){var t=e.content,n;t&&"ajax"in t&&(n=t.ajax,typeof n!="object"&&(n=e.content.ajax={url:n}),"boolean"!=typeof n.once&&n.once&&(n.once=!!n.once))},r.extend(i,b.defaults,{content:{ajax:{loading:i,once:i}}}),w.tip=function(e){var t=e.plugins.tip;return"object"==typeof t?t:e.plugins.tip=new F(e)},w.tip.initialize="render",w.tip.sanitize=function(e){var t=e.style,n;t&&"tip"in t&&(n=e.style.tip,typeof n!="object"&&(e.style.tip={corner:n}),/string|boolean/i.test(typeof n.corner)||(n.corner=i),typeof n.width!="number"&&delete n.width,typeof n.height!="number"&&delete n.height,typeof n.border!="number"&&n.border!==i&&delete n.border,typeof n.offset!="number"&&delete n.offset)},r.extend(i,b.defaults,{style:{tip:{corner:i,mimic:s,width:6,height:6,border:i,offset:0}}}),w.modal=function(e){var t=e.plugins.modal;return"object"==typeof t?t:e.plugins.modal=new I(e)},w.modal.initialize="render",w.modal.sanitize=function(e){e.show&&(typeof e.show.modal!="object"?e.show.modal={on:!!e.show.modal}:typeof e.show.modal.on=="undefined"&&(e.show.modal.on=i))},w.modal.zindex=b.zindex-200,w.modal.focusable=["a[href]","area[href]","input","select","textarea","button","iframe","object","embed","[tabindex]","[contenteditable]"],r.extend(i,b.defaults,{show:{modal:{on:s,effect:i,blur:i,stealfocus:i,escape:i}}}),w.viewport=function(n,r,i,s,o,m,b){function j(e,t,n,i,s,o,u,a,f){var l=r[s],c=x[e],h=T[e],p=n===y,d=-O.offset[s]+A.offset[s]+A["scroll"+s],m=c===s?f:c===o?-f:-f/2,b=h===s?a:h===o?-a:-a/2,w=_&&_.size?_.size[u]||0:0,E=_&&_.corner&&_.corner.precedance===e&&!p?w:0,S=d-l+E,N=l+f-A[u]-d+E,C=m-(x.precedance===e||c===x[t]?b:0)-(h===v?a/2:0);return p?(E=_&&_.corner&&_.corner.precedance===t?w:0,C=(c===s?1:-1)*m-E,r[s]+=S>0?S:N>0?-N:0,r[s]=Math.max(-O.offset[s]+A.offset[s]+(E&&_.corner[e]===v?_.offset:0),l-C,Math.min(Math.max(-O.offset[s]+A.offset[s]+A[u],l+C),r[s]))):(i*=n===g?2:0,S>0&&(c!==s||N>0)?(r[s]-=C+i,H["invert"+e](s)):N>0&&(c!==o||S>0)&&(r[s]-=(c===v?-C:C)+i,H["invert"+e](o)),r[s]<d&&-r[s]>N&&(r[s]=l,H=x.clone())),r[s]-l}var w=i.target,E=n.elements.tooltip,x=i.my,T=i.at,N=i.adjust,C=N.method.split(" "),k=C[0],L=C[1]||C[0],A=i.viewport,O=i.container,M=n.cache,_=n.plugins.tip,D={left:0,top:0},P,H,B;if(!A.jquery||w[0]===e||w[0]===t.body||N.method==="none")return D;P=E.css("position")==="fixed",A={elem:A,height:A[(A[0]===e?"h":"outerH")+"eight"](),width:A[(A[0]===e?"w":"outerW")+"idth"](),scrollleft:P?0:A.scrollLeft(),scrolltop:P?0:A.scrollTop(),offset:A.offset()||{left:0,top:0}},O={elem:O,scrollLeft:O.scrollLeft(),scrollTop:O.scrollTop(),offset:O.offset()||{left:0,top:0}};if(k!=="shift"||L!=="shift")H=x.clone();return D={left:k!=="none"?j(u,a,k,N.x,h,d,f,s,m):0,top:L!=="none"?j(a,u,L,N.y,c,p,l,o,b):0},H&&M.lastClass!==(B=S+"-pos-"+H.abbrev())&&E.removeClass(n.cache.lastClass).addClass(n.cache.lastClass=B),D},w.imagemap=function(e,t,n,i){function E(e,t,n){var r=0,i=1,s=1,o=0,u=0,a=e.width,f=e.height;while(a>0&&f>0&&i>0&&s>0){a=Math.floor(a/2),f=Math.floor(f/2),n.x===h?i=a:n.x===d?i=e.width-a:i+=Math.floor(a/2),n.y===c?s=f:n.y===p?s=e.height-f:s+=Math.floor(f/2),r=t.length;while(r--){if(t.length<2)break;o=t[r][0]-e.position.left,u=t[r][1]-e.position.top,(n.x===h&&o>=i||n.x===d&&o<=i||n.x===v&&(o<i||o>e.width-i)||n.y===c&&u>=s||n.y===p&&u<=s||n.y===v&&(u<s||u>e.height-s))&&t.splice(r,1)}}return{left:t[0][0],top:t[0][1]}}t.jquery||(t=r(t));var s=e.cache.areas={},o=(t[0].shape||t.attr("shape")).toLowerCase(),u=t[0].coords||t.attr("coords"),a=u.split(","),f=[],l=r('img[usemap="#'+t.parent("map").attr("name")+'"]'),m=l.offset(),g={width:0,height:0,position:{top:1e10,right:0,bottom:0,left:1e10}},y=0,b=0,w;m.left+=Math.ceil((l.outerWidth()-l.width())/2),m.top+=Math.ceil((l.outerHeight()-l.height())/2);if(o==="poly"){y=a.length;while(y--)b=[parseInt(a[--y],10),parseInt(a[y+1],10)],b[0]>g.position.right&&(g.position.right=b[0]),b[0]<g.position.left&&(g.position.left=b[0]),b[1]>g.position.bottom&&(g.position.bottom=b[1]),b[1]<g.position.top&&(g.position.top=b[1]),f.push(b)}else{y=-1;while(y++<a.length)f.push(parseInt(a[y],10))}switch(o){case"rect":g={width:Math.abs(f[2]-f[0]),height:Math.abs(f[3]-f[1]),position:{left:Math.min(f[0],f[2]),top:Math.min(f[1],f[3])}};break;case"circle":g={width:f[2]+2,height:f[2]+2,position:{left:f[0],top:f[1]}};break;case"poly":g.width=Math.abs(g.position.right-g.position.left),g.height=Math.abs(g.position.bottom-g.position.top),n.abbrev()==="c"?g.position={left:g.position.left+g.width/2,top:g.position.top+g.height/2}:(s[n+u]||(g.position=E(g,f.slice(),n),i&&(i[0]==="flip"||i[1]==="flip")&&(g.offset=E(g,f.slice(),{x:n.x===h?d:n.x===d?h:v,y:n.y===c?p:n.y===p?c:v}),g.offset.left-=g.position.left,g.offset.top-=g.position.top),s[n+u]=g),g=s[n+u]),g.width=g.height=0}return g.position.left+=m.left,g.position.top+=m.top,g},w.ie6=function(e){var t=r.browser,n=e.plugins.ie6;return!t.msie||(""+t.version).charAt(0)!=="6"?s:"object"==typeof n?n:e.plugins.ie6=new q(e)},w.ie6.initialize="render"})})(window,document);
|
1 |
+
/*! qtip2 v2.0.0 | http://craigsworks.com/projects/qtip2/ | Licensed MIT, GPL */
|
2 |
(function(e,t,n){(function(e){"use strict";typeof define=="function"&&define.amd?define(["jquery"],e):jQuery&&!jQuery.fn.qtip&&e(jQuery)})(function(r){function _(n){E={pageX:n.pageX,pageY:n.pageY,type:"mousemove",scrollX:e.pageXOffset||t.body.scrollLeft||t.documentElement.scrollLeft,scrollY:e.pageYOffset||t.body.scrollTop||t.documentElement.scrollTop}}function D(e){var t=function(e){return e===o||"object"!=typeof e},n=function(e){return!r.isFunction(e)&&(!e&&!e.attr||e.length<1||"object"==typeof e&&!e.jquery&&!e.then)};if(!e||"object"!=typeof e)return s;t(e.metadata)&&(e.metadata={type:e.metadata});if("content"in e){if(t(e.content)||e.content.jquery)e.content={text:e.content};n(e.content.text||s)&&(e.content.text=s),"title"in e.content&&(t(e.content.title)&&(e.content.title={text:e.content.title}),n(e.content.title.text||s)&&(e.content.title.text=s))}return"position"in e&&t(e.position)&&(e.position={my:e.position,at:e.position}),"show"in e&&t(e.show)&&(e.show=e.show.jquery?{target:e.show}:{event:e.show}),"hide"in e&&t(e.hide)&&(e.hide=e.hide.jquery?{target:e.hide}:{event:e.hide}),"style"in e&&t(e.style)&&(e.style={classes:e.style}),r.each(w,function(){this.sanitize&&this.sanitize(e)}),e}function P(u,a,f,l){function q(e){var t=0,n,r=a,i=e.split(".");while(r=r[i[t++]])t<i.length&&(n=r);return[n||a,i.pop()]}function R(e){return T.concat("").join(e?"-"+e+" ":" ")}function U(){var e=a.style.widget,t=H.hasClass(j);H.removeClass(j),j=e?"ui-state-disabled":"qtip-disabled",H.toggleClass(j,t),H.toggleClass("ui-helper-reset "+R(),e).toggleClass(C,a.style.def&&!e),F.content&&F.content.toggleClass(R("content"),e),F.titlebar&&F.titlebar.toggleClass(R("header"),e),F.button&&F.button.toggleClass(S+"-icon",!e)}function z(e){F.title&&(F.titlebar.remove(),F.titlebar=F.title=F.button=o,e!==s&&m.reposition())}function W(){var e=a.content.title.button,t=typeof e=="string",n=t?e:"Close tooltip";F.button&&F.button.remove(),e.jquery?F.button=e:F.button=r("<a />",{"class":"qtip-close "+(a.style.widget?"":S+"-icon"),title:n,"aria-label":n}).prepend(r("<span />",{"class":"ui-icon ui-icon-close",html:"×"})),F.button.appendTo(F.titlebar||H).attr("role","button").click(function(e){return H.hasClass(j)||m.hide(e),s})}function X(){var e=y+"-title";F.titlebar&&z(),F.titlebar=r("<div />",{"class":S+"-titlebar "+(a.style.widget?R("header"):"")}).append(F.title=r("<div />",{id:e,"class":S+"-title","aria-atomic":i})).insertBefore(F.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(e){r(this).toggleClass("ui-state-active ui-state-focus",e.type.substr(-4)==="down")}).delegate(".qtip-close","mouseover mouseout",function(e){r(this).toggleClass("ui-state-hover",e.type==="mouseover")}),a.content.title.button&&W()}function V(e){var t=F.button;if(!m.rendered)return s;e?W():t.remove()}function J(e,t){var n=F.title;if(!m.rendered||!e)return s;r.isFunction(e)&&(e=e.call(u,I.event,m));if(e===s||!e&&e!=="")return z(s);e.jquery&&e.length>0?n.empty().append(e.css({display:"block"})):n.html(e),t!==s&&m.rendered&&H[0].offsetWidth>0&&m.reposition(I.event)}function K(e){e&&r.isFunction(e.done)&&e.done(function(e){Q(e,null,s)})}function Q(e,t,i){function f(e){function a(n){n&&(delete u[n.src],clearTimeout(m.timers.img[n.src]),r(n).unbind(B)),r.isEmptyObject(u)&&(t!==s&&m.reposition(I.event),e())}var i,u={};if((i=o.find("img[src]:not([height]):not([width])")).length===0)return a();i.each(function(e,t){if(u[t.src]!==n)return;var i=0,s=3;(function o(){if(t.height||t.width||i>s)return a(t);i+=1,m.timers.img[t.src]=setTimeout(o,700)})(),r(t).bind("error"+B+" load"+B,function(){a(this)}),u[t.src]=t})}var o=F.content;return!m.rendered||!e?s:(r.isFunction(e)&&(e=e.call(u,I.event,m)||""),i!==s&&K(a.content.deferred),e.jquery&&e.length>0?o.empty().append(e.css({display:"block"})):o.html(e),m.rendered<0?H.queue("fx",f):(P=0,f(r.noop)),m)}function G(){function h(e){if(H.hasClass(j))return s;clearTimeout(m.timers.show),clearTimeout(m.timers.hide);var t=function(){m.toggle(i,e)};a.show.delay>0?m.timers.show=setTimeout(t,a.show.delay):t()}function p(e){if(H.hasClass(j)||A||P)return s;var t=r(e.relatedTarget||e.target),i=t.closest(N)[0]===H[0],u=t[0]===o.show[0];clearTimeout(m.timers.show),clearTimeout(m.timers.hide);if(n.target==="mouse"&&i||a.hide.fixed&&/mouse(out|leave|move)/.test(e.type)&&(i||u)){try{e.preventDefault(),e.stopImmediatePropagation()}catch(f){}return}a.hide.delay>0?m.timers.hide=setTimeout(function(){m.hide(e)},a.hide.delay):m.hide(e)}function d(e){if(H.hasClass(j))return s;clearTimeout(m.timers.inactive),m.timers.inactive=setTimeout(function(){m.hide(e)},a.hide.inactive)}function v(e){m.rendered&&H[0].offsetWidth>0&&m.reposition(e)}var n=a.position,o={show:a.show.target,hide:a.hide.target,viewport:r(n.viewport),document:r(t),body:r(t.body),window:r(e)},l={show:r.trim(""+a.show.event).split(" "),hide:r.trim(""+a.hide.event).split(" ")},c=r.browser.msie&&parseInt(r.browser.version,10)===6;H.bind("mouseenter"+B+" mouseleave"+B,function(e){var t=e.type==="mouseenter";t&&m.focus(e),H.toggleClass(L,t)}),/mouse(out|leave)/i.test(a.hide.event)&&a.hide.leave==="window"&&o.window.bind("mouseout"+B+" blur"+B,function(e){!/select|option/.test(e.target.nodeName)&&!e.relatedTarget&&m.hide(e)}),a.hide.fixed?(o.hide=o.hide.add(H),H.bind("mouseover"+B,function(){H.hasClass(j)||clearTimeout(m.timers.hide)})):/mouse(over|enter)/i.test(a.show.event)&&o.hide.bind("mouseleave"+B,function(e){clearTimeout(m.timers.show)}),(""+a.hide.event).indexOf("unfocus")>-1&&n.container.closest("html").bind("mousedown"+B+" touchstart"+B,function(e){var t=r(e.target),n=m.rendered&&!H.hasClass(j)&&H[0].offsetWidth>0,i=t.parents(N).filter(H[0]).length>0;t[0]!==u[0]&&t[0]!==H[0]&&!i&&!u.has(t[0]).length&&!t.attr("disabled")&&m.hide(e)}),"number"==typeof a.hide.inactive&&(o.show.bind("qtip-"+f+"-inactive",d),r.each(b.inactiveEvents,function(e,t){o.hide.add(F.tooltip).bind(t+B+"-inactive",d)})),r.each(l.hide,function(e,t){var n=r.inArray(t,l.show),i=r(o.hide);n>-1&&i.add(o.show).length===i.length||t==="unfocus"?(o.show.bind(t+B,function(e){H[0].offsetWidth>0?p(e):h(e)}),delete l.show[n]):o.hide.bind(t+B,p)}),r.each(l.show,function(e,t){o.show.bind(t+B,h)}),"number"==typeof a.hide.distance&&o.show.add(H).bind("mousemove"+B,function(e){var t=I.origin||{},n=a.hide.distance,r=Math.abs;(r(e.pageX-t.pageX)>=n||r(e.pageY-t.pageY)>=n)&&m.hide(e)}),n.target==="mouse"&&(o.show.bind("mousemove"+B,_),n.adjust.mouse&&(a.hide.event&&(H.bind("mouseleave"+B,function(e){(e.relatedTarget||e.target)!==o.show[0]&&m.hide(e)}),F.target.bind("mouseenter"+B+" mouseleave"+B,function(e){I.onTarget=e.type==="mouseenter"})),o.document.bind("mousemove"+B,function(e){m.rendered&&I.onTarget&&!H.hasClass(j)&&H[0].offsetWidth>0&&m.reposition(e||E)}))),(n.adjust.resize||o.viewport.length)&&(r.event.special.resize?o.viewport:o.window).bind("resize"+B,v),o.window.bind("scroll"+B,v)}function Y(){var n=[a.show.target[0],a.hide.target[0],m.rendered&&F.tooltip[0],a.position.container[0],a.position.viewport[0],a.position.container.closest("html")[0],e,t];m.rendered?r([]).pushStack(r.grep(n,function(e){return typeof e=="object"})).unbind(B):a.show.target.unbind(B+"-create")}var m=this,g=t.body,y=S+"-"+f,A=0,P=0,H=r(),B=".qtip-"+f,j="qtip-disabled",F,I;m.id=f,m.rendered=s,m.destroyed=s,m.elements=F={target:u},m.timers={img:{}},m.options=a,m.checks={},m.plugins={},m.cache=I={event:{},target:r(),disabled:s,attr:l,onTarget:s,lastClass:""},m.checks.builtin={"^id$":function(e,t,n){var o=n===i?b.nextid:n,u=S+"-"+o;o!==s&&o.length>0&&!r("#"+u).length&&(H[0].id=u,F.content[0].id=u+"-content",F.title[0].id=u+"-title")},"^content.text$":function(e,t,n){Q(a.content.text)},"^content.deferred$":function(e,t,n){K(a.content.deferred)},"^content.title.text$":function(e,t,n){if(!n)return z();!F.title&&n&&X(),J(n)},"^content.title.button$":function(e,t,n){V(n)},"^position.(my|at)$":function(e,t,n){"string"==typeof n&&(e[t]=new w.Corner(n))},"^position.container$":function(e,t,n){m.rendered&&H.appendTo(n)},"^show.ready$":function(){m.rendered?m.toggle(i):m.render(1)},"^style.classes$":function(e,t,n){H.attr("class",S+" qtip "+n)},"^style.width|height":function(e,t,n){H.css(t,n)},"^style.widget|content.title":U,"^events.(render|show|move|hide|focus|blur)$":function(e,t,n){H[(r.isFunction(n)?"":"un")+"bind"]("tooltip"+t,n)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){var e=a.position;H.attr("tracking",e.target==="mouse"&&e.adjust.mouse),Y(),G()}},r.extend(m,{_triggerEvent:function(e,t,n){var i=r.Event("tooltip"+e);return i.originalEvent=(n?r.extend({},n):o)||I.event||o,H.trigger(i,[m].concat(t||[])),!i.isDefaultPrevented()},render:function(e){if(m.rendered)return m;var t=a.content.text,n=a.content.title,o=a.position;return r.attr(u[0],"aria-describedby",y),H=F.tooltip=r("<div/>",{id:y,"class":[S,C,a.style.classes,S+"-pos-"+a.position.my.abbrev()].join(" "),width:a.style.width||"",height:a.style.height||"",tracking:o.target==="mouse"&&o.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":s,"aria-describedby":y+"-content","aria-hidden":i}).toggleClass(j,I.disabled).data("qtip",m).appendTo(a.position.container).append(F.content=r("<div />",{"class":S+"-content",id:y+"-content","aria-atomic":i})),m.rendered=-1,A=1,n.text?(X(),r.isFunction(n.text)||J(n.text,s)):n.button&&W(),(!r.isFunction(t)||t.then)&&Q(t,s),m.rendered=i,U(),r.each(a.events,function(e,t){r.isFunction(t)&&H.bind(e==="toggle"?"tooltipshow tooltiphide":"tooltip"+e,t)}),r.each(w,function(){this.initialize==="render"&&this(m)}),G(),H.queue("fx",function(t){m._triggerEvent("render"),A=0,(a.show.ready||e)&&m.toggle(i,I.event,s),t()}),m},get:function(e){var t,n;switch(e.toLowerCase()){case"dimensions":t={height:H.outerHeight(s),width:H.outerWidth(s)};break;case"offset":t=w.offset(H,a.position.container);break;default:n=q(e.toLowerCase()),t=n[0][n[1]],t=t.precedance?t.string():t}return t},set:function(e,t){function h(e,t){var n,r,i;for(n in l)for(r in l[n])if(i=(new RegExp(r,"i")).exec(e))t.push(i),l[n][r].apply(m,t)}var n=/^position\.(my|at|adjust|target|container)|style|content|show\.ready/i,u=/^content\.(title|attr)|style/i,f=s,l=m.checks,c;return"string"==typeof e?(c=e,e={},e[c]=t):e=r.extend(i,{},e),r.each(e,function(t,i){var s=q(t.toLowerCase()),o;o=s[0][s[1]],s[0][s[1]]="object"==typeof i&&i.nodeType?r(i):i,e[t]=[s[0],s[1],i,o],f=n.test(t)||f}),D(a),A=1,r.each(e,h),A=0,m.rendered&&H[0].offsetWidth>0&&f&&m.reposition(a.position.target==="mouse"?o:I.event),m},toggle:function(e,n){function b(){e?(r.browser.msie&&H[0].style.removeAttribute("filter"),H.css("overflow",""),"string"==typeof u.autofocus&&r(u.autofocus,H).focus(),u.target.trigger("qtip-"+f+"-inactive")):H.css({display:"",visibility:"",opacity:"",left:"",top:""}),m._triggerEvent(e?"visible":"hidden")}if(n){if(/over|enter/.test(n.type)&&/out|leave/.test(I.event.type)&&a.show.target.add(n.target).length===a.show.target.length&&H.has(n.relatedTarget).length)return m;I.event=r.extend({},n)}if(!m.rendered)return e?m.render(1):m;var o=e?"show":"hide",u=a[o],l=a[e?"hide":"show"],c=a.position,h=a.content,p=H[0].offsetWidth>0,d=e||u.target.length===1,v=!n||u.target.length<2||I.target[0]===n.target,g,y;return(typeof e).search("boolean|number")&&(e=!p),!H.is(":animated")&&p===e&&v?m:m._triggerEvent(o,[90])?(r.attr(H[0],"aria-hidden",!e),e?(I.origin=r.extend({},E),m.focus(n),r.isFunction(h.text)&&Q(h.text,s),r.isFunction(h.title.text)&&J(h.title.text,s),!M&&c.target==="mouse"&&c.adjust.mouse&&(r(t).bind("mousemove.qtip",_),M=i),m.reposition(n,arguments[2]),!u.solo||r(N,u.solo).not(H).qtip("hide",r.Event("tooltipsolo"))):(clearTimeout(m.timers.show),delete I.origin,M&&!r(N+'[tracking="true"]:visible',u.solo).not(H).length&&(r(t).unbind("mousemove.qtip"),M=s),m.blur(n)),u.effect===s||d===s?(H[o](),b.call(H)):r.isFunction(u.effect)?(H.stop(1,1),u.effect.call(H,m),H.queue("fx",function(e){b(),e()})):H.fadeTo(90,e?1:0,b),e&&u.target.trigger("qtip-"+f+"-inactive"),m):m},show:function(e){return m.toggle(i,e)},hide:function(e){return m.toggle(s,e)},focus:function(e){if(!m.rendered)return m;var t=r(N),n=parseInt(H[0].style.zIndex,10),i=b.zindex+t.length,s=r.extend({},e),o;return H.hasClass(k)||m._triggerEvent("focus",[i],s)&&(n!==i&&(t.each(function(){this.style.zIndex>n&&(this.style.zIndex=this.style.zIndex-1)}),t.filter("."+k).qtip("blur",s)),H.addClass(k)[0].style.zIndex=i),m},blur:function(e){return H.removeClass(k),m._triggerEvent("blur",[H.css("zIndex")],e),m},reposition:function(n,i){if(!m.rendered||A)return m;A=1;var o=a.position.target,u=a.position,f=u.my,l=u.at,g=u.adjust,y=g.method.split(" "),b=H.outerWidth(s),S=H.outerHeight(s),x=0,T=0,N=H.css("position"),C=u.viewport,k={left:0,top:0},L=u.container,O=H[0].offsetWidth>0,M=n&&n.type==="scroll",_=r(e),D,P;if(r.isArray(o)&&o.length===2)l={x:h,y:c},k={left:o[0],top:o[1]};else if(o==="mouse"&&(n&&n.pageX||I.event.pageX))l={x:h,y:c},n=E&&E.pageX&&(g.mouse||!n||!n.pageX)?{pageX:E.pageX,pageY:E.pageY}:(!n||n.type!=="resize"&&n.type!=="scroll"?n&&n.pageX&&n.type==="mousemove"?n:!g.mouse&&I.origin&&I.origin.pageX&&a.show.distance?I.origin:n:I.event)||n||I.event||E||{},N!=="static"&&(k=L.offset()),k={left:n.pageX-k.left,top:n.pageY-k.top},g.mouse&&M&&(k.left-=E.scrollX-_.scrollLeft(),k.top-=E.scrollY-_.scrollTop());else{o==="event"&&n&&n.target&&n.type!=="scroll"&&n.type!=="resize"?I.target=r(n.target):o!=="event"&&(I.target=r(o.jquery?o:F.target)),o=I.target,o=r(o).eq(0);if(o.length===0)return m;o[0]===t||o[0]===e?(x=w.iOS?e.innerWidth:o.width(),T=w.iOS?e.innerHeight:o.height(),o[0]===e&&(k={top:(C||o).scrollTop(),left:(C||o).scrollLeft()})):w.imagemap&&o.is("area")?D=w.imagemap(m,o,l,w.viewport?y:s):w.svg&&o[0].ownerSVGElement?D=w.svg(m,o,l,w.viewport?y:s):(x=o.outerWidth(s),T=o.outerHeight(s),k=w.offset(o,L)),D&&(x=D.width,T=D.height,P=D.offset,k=D.position);if(w.iOS>3.1&&w.iOS<4.1||w.iOS>=4.3&&w.iOS<4.33||!w.iOS&&N==="fixed")k.left-=_.scrollLeft(),k.top-=_.scrollTop();k.left+=l.x===d?x:l.x===v?x/2:0,k.top+=l.y===p?T:l.y===v?T/2:0}return k.left+=g.x+(f.x===d?-b:f.x===v?-b/2:0),k.top+=g.y+(f.y===p?-S:f.y===v?-S/2:0),w.viewport?(k.adjusted=w.viewport(m,k,u,x,T,b,S),P&&k.adjusted.left&&(k.left+=P.left),P&&k.adjusted.top&&(k.top+=P.top)):k.adjusted={left:0,top:0},m._triggerEvent("move",[k,C.elem||C],n)?(delete k.adjusted,i===s||!O||isNaN(k.left)||isNaN(k.top)||o==="mouse"||!r.isFunction(u.effect)?H.css(k):r.isFunction(u.effect)&&(u.effect.call(H,m,r.extend({},k)),H.queue(function(e){r(this).css({opacity:"",height:""}),r.browser.msie&&this.style.removeAttribute("filter"),e()})),A=0,m):m},disable:function(e){return"boolean"!=typeof e&&(e=!H.hasClass(j)&&!I.disabled),m.rendered?(H.toggleClass(j,e),r.attr(H[0],"aria-disabled",e)):I.disabled=!!e,m},enable:function(){return m.disable(s)},destroy:function(){var e=u[0],t=r.attr(e,O),n=u.data("qtip");m.destroyed=i,m.rendered&&(H.stop(1,0).remove(),r.each(m.plugins,function(){this.destroy&&this.destroy()})),clearTimeout(m.timers.show),clearTimeout(m.timers.hide),Y();if(!n||m===n)r.removeData(e,"qtip"),a.suppress&&t&&(r.attr(e,"title",t),u.removeAttr(O)),u.removeAttr("aria-describedby");return u.unbind(".qtip-"+f),delete x[m.id],u}})}function H(e,n){var u,a,f,l,c,h=r(this),p=r(t.body),d=this===t?p:h,v=h.metadata?h.metadata(n.metadata):o,m=n.metadata.type==="html5"&&v?v[n.metadata.name]:o,g=h.data(n.metadata.name||"qtipopts");try{g=typeof g=="string"?r.parseJSON(g):g}catch(y){}l=r.extend(i,{},b.defaults,n,typeof g=="object"?D(g):o,D(m||v)),a=l.position,l.id=e;if("boolean"==typeof l.content.text){f=h.attr(l.content.attr);if(l.content.attr===s||!f)return s;l.content.text=f}a.container.length||(a.container=p),a.target===s&&(a.target=d),l.show.target===s&&(l.show.target=d),l.show.solo===i&&(l.show.solo=a.container.closest("body")),l.hide.target===s&&(l.hide.target=d),l.position.viewport===i&&(l.position.viewport=a.container),a.container=a.container.eq(0),a.at=new w.Corner(a.at),a.my=new w.Corner(a.my);if(r.data(this,"qtip"))if(l.overwrite)h.qtip("destroy");else if(l.overwrite===s)return s;return l.suppress&&(c=r.attr(this,"title"))&&r(this).removeAttr("title").attr(O,c).attr("title",""),u=new P(h,l,e,!!f),r.data(this,"qtip",u),h.bind("remove.qtip-"+e+" removeqtip.qtip-"+e,function(){u.destroy()}),u}function B(e){var t=this,n=e.elements.tooltip,o=e.options.content.ajax,u=b.defaults.content.ajax,a=".qtip-ajax",f=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,l=i,c=s,h;e.checks.ajax={"^content.ajax":function(e,r,i){r==="ajax"&&(o=i),r==="once"?t.init():o&&o.url?t.load():n.unbind(a)}},r.extend(t,{init:function(){return o&&o.url&&n.unbind(a)[o.once?"one":"bind"]("tooltipshow"+a,t.load),t},load:function(n){function g(){var t;if(e.destroyed)return;l=s,v&&(c=i,e.show(n.originalEvent)),(t=u.complete||o.complete)&&r.isFunction(t)&&t.apply(o.context||e,arguments)}function y(t,n,i){var s;if(e.destroyed)return;d&&"string"==typeof t&&(t=r("<div/>").append(t.replace(f,"")).find(d)),(s=u.success||o.success)&&r.isFunction(s)?s.call(o.context||e,t,n,i):e.set("content.text",t)}function b(t,n,r){if(e.destroyed||t.status===0)return;e.set("content.text",n+": "+r)}if(c){c=s;return}var a=o.url.lastIndexOf(" "),p=o.url,d,v=!o.loading&&l;if(v)try{n.preventDefault()}catch(m){}else if(n&&n.isDefaultPrevented())return t;h&&h.abort&&h.abort(),a>-1&&(d=p.substr(a),p=p.substr(0,a)),h=r.ajax(r.extend({error:u.error||b,context:e},o,{url:p,success:y,complete:g}))},destroy:function(){h&&h.abort&&h.abort(),e.destroyed=i}}),t.init()}function j(e,t,n){var r=Math.ceil(t/2),i=Math.ceil(n/2),s={bottomright:[[0,0],[t,n],[t,0]],bottomleft:[[0,0],[t,0],[0,n]],topright:[[0,n],[t,0],[t,n]],topleft:[[0,0],[0,n],[t,n]],topcenter:[[0,n],[r,0],[t,n]],bottomcenter:[[0,0],[t,0],[r,n]],rightcenter:[[0,0],[t,i],[0,n]],leftcenter:[[t,0],[t,n],[0,i]]};return s.lefttop=s.bottomright,s.righttop=s.bottomleft,s.leftbottom=s.topright,s.rightbottom=s.topleft,s[e.string()]}function F(e,t){function A(e){var t=E.is(":visible");E.show(),e(),E.toggle(t)}function O(){x.width=g.height,x.height=g.width}function M(){x.width=g.width,x.height=g.height}function _(t,r,o,f){if(!b.tip)return;var l=m.corner.clone(),w=o.adjusted,E=e.options.position.adjust.method.split(" "),x=E[0],T=E[1]||E[0],N={left:s,top:s,x:0,y:0},C,k={},L;m.corner.fixed!==i&&(x===y&&l.precedance===u&&w.left&&l.y!==v?l.precedance=l.precedance===u?a:u:x!==y&&w.left&&(l.x=l.x===v?w.left>0?h:d:l.x===h?d:h),T===y&&l.precedance===a&&w.top&&l.x!==v?l.precedance=l.precedance===a?u:a:T!==y&&w.top&&(l.y=l.y===v?w.top>0?c:p:l.y===c?p:c),l.string()!==S.corner.string()&&(S.top!==w.top||S.left!==w.left)&&m.update(l,s)),C=m.position(l,w),C[l.x]+=P(l,l.x),C[l.y]+=P(l,l.y),C.right!==n&&(C.left=-C.right),C.bottom!==n&&(C.top=-C.bottom),C.user=Math.max(0,g.offset);if(N.left=x===y&&!!w.left)l.x===v?k["margin-left"]=N.x=C["margin-left"]:(L=C.right!==n?[w.left,-C.left]:[-w.left,C.left],(N.x=Math.max(L[0],L[1]))>L[0]&&(o.left-=w.left,N.left=s),k[C.right!==n?d:h]=N.x);if(N.top=T===y&&!!w.top)l.y===v?k["margin-top"]=N.y=C["margin-top"]:(L=C.bottom!==n?[w.top,-C.top]:[-w.top,C.top],(N.y=Math.max(L[0],L[1]))>L[0]&&(o.top-=w.top,N.top=s),k[C.bottom!==n?p:c]=N.y);b.tip.css(k).toggle(!(N.x&&N.y||l.x===v&&N.y||l.y===v&&N.x)),o.left-=C.left.charAt?C.user:x!==y||N.top||!N.left&&!N.top?C.left:0,o.top-=C.top.charAt?C.user:T!==y||N.left||!N.left&&!N.top?C.top:0,S.left=w.left,S.top=w.top,S.corner=l.clone()}function D(){var t=g.corner,n=e.options.position,r=n.at,o=n.my.string?n.my.string():n.my;return t===s||o===s&&r===s?s:(t===i?m.corner=new w.Corner(o):t.string||(m.corner=new w.Corner(t),m.corner.fixed=i),S.corner=new w.Corner(m.corner.string()),m.corner.string()!=="centercenter")}function P(e,t,n){t=t?t:e[e.precedance];var r=b.titlebar&&e.y===c,i=r?b.titlebar:E,s="border-"+t+"-width",o=function(e){return parseInt(e.css(s),10)},u;return A(function(){u=(n?o(n):o(b.content)||o(i)||o(E))||0}),u}function H(e){var t=b.titlebar&&e.y===c,n=t?b.titlebar:b.content,i=r.browser.mozilla,s=i?"-moz-":r.browser.webkit?"-webkit-":"",o="border-radius-"+e.y+e.x,u="border-"+e.y+"-"+e.x+"-radius",a=function(e){return parseInt(n.css(e),10)||parseInt(E.css(e),10)},f;return A(function(){f=a(u)||a(s+u)||a(s+o)||a(o)||0}),f}function B(e){function N(e,t,n){var r=e.css(t)||p;return n&&r===e.css(n)?s:f.test(r)?s:r}var t,n,o,u=b.tip.css("cssText",""),a=e||m.corner,f=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,l="border-"+a[a.precedance]+"-color",h="background-color",p="transparent",d=" !important",y=b.titlebar,w=y&&(a.y===c||a.y===v&&u.position().top+x.height/2+g.offset<y.outerHeight(i)),S=w?y:b.content;A(function(){T.fill=N(u,h)||N(S,h)||N(b.content,h)||N(E,h)||u.css(h),T.border=N(u,l,"color")||N(S,l,"color")||N(b.content,l,"color")||N(E,l,"color")||E.css(l),r("*",u).add(u).css("cssText",h+":"+p+d+";border:0"+d+";")})}function F(e){var t=e.precedance===a,n=x[t?f:l],r=x[t?l:f],i=e.string().indexOf(v)>-1,s=n*(i?.5:1),o=Math.pow,u=Math.round,c,h,p,d=Math.sqrt(o(s,2)+o(r,2)),m=[N/s*d,N/r*d];return m[2]=Math.sqrt(o(m[0],2)-o(N,2)),m[3]=Math.sqrt(o(m[1],2)-o(N,2)),c=d+m[2]+m[3]+(i?0:m[0]),h=c/d,p=[u(h*r),u(h*n)],{height:p[t?0:1],width:p[t?1:0]}}function I(e,t,n){return"<qvml:"+e+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(t||"")+' style="behavior: url(#default#VML); '+(n||"")+'" />'}var m=this,g=e.options.style.tip,b=e.elements,E=b.tooltip,S={top:0,left:0},x={width:g.width,height:g.height},T={},N=g.border||0,C=".qtip-tip",k=!!(r("<canvas />")[0]||{}).getContext,L;m.corner=o,m.mimic=o,m.border=N,m.offset=g.offset,m.size=x,e.checks.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){m.init()||m.destroy(),e.reposition()},"^style.tip.(height|width)$":function(){x={width:g.width,height:g.height},m.create(),m.update(),e.reposition()},"^content.title.text|style.(classes|widget)$":function(){b.tip&&b.tip.length&&m.update()}},r.extend(m,{init:function(){var e=D()&&(k||r.browser.msie);return e&&(m.create(),m.update(),E.unbind(C).bind("tooltipmove"+C,_)),e},create:function(){var e=x.width,t=x.height,n;b.tip&&b.tip.remove(),b.tip=r("<div />",{"class":"qtip-tip"}).css({width:e,height:t}).prependTo(E),k?r("<canvas />").appendTo(b.tip)[0].getContext("2d").save():(n=I("shape",'coordorigin="0,0"',"position:absolute;"),b.tip.html(n+n),r("*",b.tip).bind("click mousedown",function(e){e.stopPropagation()}))},update:function(e,t){var n=b.tip,f=n.children(),l=x.width,y=x.height,C=g.mimic,L=Math.round,A,_,D,H,q;e||(e=S.corner||m.corner),C===s?C=e:(C=new w.Corner(C),C.precedance=e.precedance,C.x==="inherit"?C.x=e.x:C.y==="inherit"?C.y=e.y:C.x===C.y&&(C[e.precedance]=e[e.precedance])),A=C.precedance,e.precedance===u?O():M(),b.tip.css({width:l=x.width,height:y=x.height}),B(e),T.border!=="transparent"?(N=P(e,o),g.border===0&&N>0&&(T.fill=T.border),m.border=N=g.border!==i?g.border:N):m.border=N=0,D=j(C,l,y),m.size=q=F(e),n.css(q).css("line-height",q.height+"px"),e.precedance===a?H=[L(C.x===h?N:C.x===d?q.width-l-N:(q.width-l)/2),L(C.y===c?q.height-y:0)]:H=[L(C.x===h?q.width-l:0),L(C.y===c?N:C.y===p?q.height-y-N:(q.height-y)/2)],k?(f.attr(q),_=f[0].getContext("2d"),_.restore(),_.save(),_.clearRect(0,0,3e3,3e3),_.fillStyle=T.fill,_.strokeStyle=T.border,_.lineWidth=N*2,_.lineJoin="miter",_.miterLimit=100,_.translate(H[0],H[1]),_.beginPath(),_.moveTo(D[0][0],D[0][1]),_.lineTo(D[1][0],D[1][1]),_.lineTo(D[2][0],D[2][1]),_.closePath(),N&&(E.css("background-clip")==="border-box"&&(_.strokeStyle=T.fill,_.stroke()),_.strokeStyle=T.border,_.stroke()),_.fill()):(D="m"+D[0][0]+","+D[0][1]+" l"+D[1][0]+","+D[1][1]+" "+D[2][0]+","+D[2][1]+" xe",H[2]=N&&/^(r|b)/i.test(e.string())?parseFloat(r.browser.version,10)===8?2:1:0,f.css({coordsize:l+N+" "+(y+N),antialias:""+(C.string().indexOf(v)>-1),left:H[0],top:H[1],width:l+N,height:y+N}).each(function(e){var t=r(this);t[t.prop?"prop":"attr"]({coordsize:l+N+" "+(y+N),path:D,fillcolor:T.fill,filled:!!e,stroked:!e}).toggle(!!N||!!e),!e&&t.html()===""&&t.html(I("stroke",'weight="'+N*2+'px" color="'+T.border+'" miterlimit="1000" joinstyle="miter"'))})),t!==s&&m.position(e)},position:function(e){var t=b.tip,n={},i=Math.max(0,g.offset),o,p,d;return g.corner===s||!t?s:(e=e||m.corner,o=e.precedance,p=F(e),d=[e.x,e.y],o===u&&d.reverse(),r.each(d,function(t,r){var s,u,d;r===v?(s=o===a?h:c,n[s]="50%",n["margin-"+s]=-Math.round(p[o===a?f:l]/2)+i):(s=P(e,r),u=P(e,r,b.content),d=H(e),n[r]=t?u:i+(d>s?d:-s))}),n[e[o]]-=p[o===u?f:l],t.css({top:"",bottom:"",left:"",right:"",margin:""}).css(n),n)},destroy:function(){b.tip&&b.tip.remove(),b.tip=!1,E.unbind(C)}}),m.init()}function I(n){function y(){m=r(v,f).not("[disabled]").map(function(){return typeof this.focus=="function"?this:null})}function b(e){m.length<1&&e.length?e.not("body").blur():m.first().focus()}function E(e){var t=r(e.target),n=t.closest(".qtip"),i;i=n.length<1?s:parseInt(n[0].style.zIndex,10)>parseInt(f[0].style.zIndex,10),!i&&r(e.target).closest(N)[0]!==f[0]&&b(t)}var o=this,u=n.options.show.modal,a=n.elements,f=a.tooltip,l="#qtip-overlay",c=".qtipmodal",h=c+n.id,p="is-modal-qtip",d=r(t.body),v=w.modal.focusable.join(","),m={},g;n.checks.modal={"^show.modal.(on|blur)$":function(){o.init(),a.overlay.toggle(f.is(":visible"))},"^content.text$":function(){y()}},r.extend(o,{init:function(){return u.on?(g=o.create(),f.attr(p,i).css("z-index",w.modal.zindex+r(N+"["+p+"]").length).unbind(c).unbind(h).bind("tooltipshow"+c+" tooltiphide"+c,function(e,t,n){var i=e.originalEvent;if(e.target===f[0])if(i&&e.type==="tooltiphide"&&/mouse(leave|enter)/.test(i.type)&&r(i.relatedTarget).closest(g[0]).length)try{e.preventDefault()}catch(s){}else(!i||i&&!i.solo)&&o[e.type.replace("tooltip","")](e,n)}).bind("tooltipfocus"+c,function(e){if(e.isDefaultPrevented()||e.target!==f[0])return;var t=r(N).filter("["+p+"]"),n=w.modal.zindex+t.length,i=parseInt(f[0].style.zIndex,10);g[0].style.zIndex=n-2,t.each(function(){this.style.zIndex>i&&(this.style.zIndex-=1)}),t.end().filter("."+k).qtip("blur",e.originalEvent),f.addClass(k)[0].style.zIndex=n;try{e.preventDefault()}catch(s){}}).bind("tooltiphide"+c,function(e){e.target===f[0]&&r("["+p+"]").filter(":visible").not(f).last().qtip("focus",e)}),u.escape&&r(t).unbind(h).bind("keydown"+h,function(e){e.keyCode===27&&f.hasClass(k)&&n.hide(e)}),u.blur&&a.overlay.unbind(h).bind("click"+h,function(e){f.hasClass(k)&&n.hide(e)}),y(),o):o},create:function(){function i(){g.css({height:n.height(),width:n.width()})}var t=r(l),n=r(e);return t.length?a.overlay=t.insertAfter(r(N).last()):(g=a.overlay=r("<div />",{id:l.substr(1),html:"<div></div>",mousedown:function(){return s}}).hide().insertAfter(r(N).last()),n.unbind(c).bind("resize"+c,i),i(),g)},toggle:function(e,t,n){if(e&&e.isDefaultPrevented())return o;var a=u.effect,l=t?"show":"hide",c=g.is(":visible"),v=r("["+p+"]").filter(":visible").not(f),m;return g||(g=o.create()),g.is(":animated")&&c===t&&g.data("toggleState")!==s||!t&&v.length?o:(t?(g.css({left:0,top:0}),g.toggleClass("blurs",u.blur),u.stealfocus!==s&&(d.bind("focusin"+h,E),b(r("body :focus")))):d.unbind("focusin"+h),g.stop(i,s).data("toggleState",t),r.isFunction(a)?a.call(g,t):a===s?g[l]():g.fadeTo(parseInt(n,10)||90,t?1:0,function(){t||r(this).hide()}),t||g.queue(function(e){g.css({left:"",top:""}).removeData("toggleState"),e()}),o)},show:function(e,t){return o.toggle(e,i,t)},hide:function(e,t){return o.toggle(e,s,t)},destroy:function(){var e=g;return e&&(e=r("["+p+"]").not(f).length<1,e?(a.overlay.remove(),r(t).unbind(c)):a.overlay.unbind(c+n.id),d.unbind("focusin"+h)),f.removeAttr(p).unbind(c)}}),o.init()}function q(n){var o=this,u=n.elements,a=n.options,c=u.tooltip,h=".ie6-"+n.id,p=r("select, object").length<1,d=0,v=s,m;n.checks.ie6={"^content|style$":function(e,t,n){redraw()}},r.extend(o,{init:function(){var n=r(e),s;p&&(u.bgiframe=r('<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>'),u.bgiframe.appendTo(c),c.bind("tooltipmove"+h,o.adjustBGIFrame)),m=r("<div/>",{id:"qtip-rcontainer"}).appendTo(t.body),o.redraw(),u.overlay&&!v&&(s=function(){u.overlay[0].style.top=n.scrollTop()+"px"},n.bind("scroll.qtip-ie6, resize.qtip-ie6",s),s(),u.overlay.addClass("qtipmodal-ie6fix"),v=i)},adjustBGIFrame:function(){var e=n.get("dimensions"),t=n.plugins.tip,r=u.tip,i,s;s=parseInt(c.css("border-left-width"),10)||0,s={left:-s,top:-s},t&&r&&(i=t.corner.precedance==="x"?["width","left"]:["height","top"],s[i[1]]-=r[i[0]]()),u.bgiframe.css(s).css(e)},redraw:function(){if(n.rendered<1||d)return o;var e=a.style,t=a.position.container,r,i,s,u;return d=1,e.height&&c.css(l,e.height),e.width?c.css(f,e.width):(c.css(f,"").appendTo(m),i=c.width(),i%2<1&&(i+=1),s=c.css("max-width")||"",u=c.css("min-width")||"",r=(s+u).indexOf("%")>-1?t.width()/100:0,s=(s.indexOf("%")>-1?r:1)*parseInt(s,10)||i,u=(u.indexOf("%")>-1?r:1)*parseInt(u,10)||0,i=s+u?Math.min(Math.max(i,u),s):i,c.css(f,Math.round(i)).appendTo(t)),d=0,o},destroy:function(){p&&u.bgiframe.remove(),c.unbind(h)}}),o.init()}var i=!0,s=!1,o=null,u="x",a="y",f="width",l="height",c="top",h="left",p="bottom",d="right",v="center",m="flip",g="flipinvert",y="shift",b,w,E,S="qtip",x={},T=["ui-widget","ui-tooltip"],N="div.qtip."+S,C=S+"-default",k=S+"-focus",L=S+"-hover",A="_replacedByqTip",O="oldtitle",M;b=r.fn.qtip=function(e,t,u){var a=(""+e).toLowerCase(),f=o,l=r.makeArray(arguments).slice(1),c=l[l.length-1],h=this[0]?r.data(this[0],"qtip"):o;if(!arguments.length&&h||a==="api")return h;if("string"==typeof e)return this.each(function(){var e=r.data(this,"qtip");if(!e)return i;c&&c.timeStamp&&(e.cache.event=c);if(a!=="option"&&a!=="options"||!t)e[a]&&e[a].apply(e[a],l);else{if(!r.isPlainObject(t)&&u===n)return f=e.get(t),s;e.set(t,u)}}),f!==o?f:this;if("object"==typeof e||!arguments.length)return h=D(r.extend(i,{},e)),b.bind.call(this,h,c)},b.bind=function(e,t){return this.each(function(o){function p(e){function t(){c.render(typeof e=="object"||u.show.ready),a.show.add(a.hide).unbind(l)}if(c.cache.disabled)return s;c.cache.event=r.extend({},e),c.cache.target=e?r(e.target):[n],u.show.delay>0?(clearTimeout(c.timers.show),c.timers.show=setTimeout(t,u.show.delay),f.show!==f.hide&&a.hide.bind(f.hide,function(){clearTimeout(c.timers.show)})):t()}var u,a,f,l,c,h;h=r.isArray(e.id)?e.id[o]:e.id,h=!h||h===s||h.length<1||x[h]?b.nextid++:x[h]=h,l=".qtip-"+h+"-create",c=H.call(this,h,e);if(c===s)return i;u=c.options,r.each(w,function(){this.initialize==="initialize"&&this(c)}),a={show:u.show.target,hide:u.hide.target},f={show:r.trim(""+u.show.event).replace(/ /g,l+" ")+l,hide:r.trim(""+u.hide.event).replace(/ /g,l+" ")+l},/mouse(over|enter)/i.test(f.show)&&!/mouse(out|leave)/i.test(f.hide)&&(f.hide+=" mouseleave"+l),a.show.bind("mousemove"+l,function(e){_(e),c.cache.onTarget=i}),a.show.bind(f.show,p),(u.show.ready||u.prerender)&&p(t)}).attr("data-hasqtip",i)},w=b.plugins={Corner:function(e){e=(""+e).replace(/([A-Z])/," $1").replace(/middle/gi,v).toLowerCase(),this.x=(e.match(/left|right/i)||e.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(e.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase();var t=e.charAt(0);this.precedance=t==="t"||t==="b"?a:u,this.string=function(){return this.precedance===a?this.y+this.x:this.x+this.y},this.abbrev=function(){var e=this.x.substr(0,1),t=this.y.substr(0,1);return e===t?e:this.precedance===a?t+e:e+t},this.invertx=function(e){this.x=this.x===h?d:this.x===d?h:e||this.x},this.inverty=function(e){this.y=this.y===c?p:this.y===p?c:e||this.y},this.clone=function(){return{x:this.x,y:this.y,precedance:this.precedance,string:this.string,abbrev:this.abbrev,clone:this.clone,invertx:this.invertx,inverty:this.inverty}}},offset:function(e,n){function c(e,t){i.left+=t*e.scrollLeft(),i.top+=t*e.scrollTop()}var i=e.offset(),s=e.closest("body"),o=r.browser.msie&&t.compatMode!=="CSS1Compat",u=n,a,f,l;if(u){do u.css("position")!=="static"&&(f=u.position(),i.left-=f.left+(parseInt(u.css("borderLeftWidth"),10)||0)+(parseInt(u.css("marginLeft"),10)||0),i.top-=f.top+(parseInt(u.css("borderTopWidth"),10)||0)+(parseInt(u.css("marginTop"),10)||0),!a&&(l=u.css("overflow"))!=="hidden"&&l!=="visible"&&(a=u));while((u=r(u[0].offsetParent)).length);(a&&a[0]!==s[0]||o)&&c(a||s,1)}return i},iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||s,fn:{attr:function(e,t){if(this.length){var n=this[0],i="title",s=r.data(n,"qtip");if(e===i&&s&&"object"==typeof s&&s.options.suppress)return arguments.length<2?r.attr(n,O):(s&&s.options.content.attr===i&&s.cache.attr&&s.set("content.text",t),this.attr(O,t))}return r.fn["attr"+A].apply(this,arguments)},clone:function(e){var t=r([]),n="title",i=r.fn["clone"+A].apply(this,arguments);return e||i.filter("["+O+"]").attr("title",function(){return r.attr(this,O)}).removeAttr(O),i}}},r.each(w.fn,function(e,t){if(!t||r.fn[e+A])return i;var n=r.fn[e+A]=r.fn[e];r.fn[e]=function(){return t.apply(this,arguments)||n.apply(this,arguments)}}),r.ui||(r["cleanData"+A]=r.cleanData,r.cleanData=function(e){for(var t=0,i;(i=e[t])!==n;t++)try{r(i).triggerHandler("removeqtip")}catch(s){}r["cleanData"+A](e)}),b.version="2.0.0-nightly-15f5c6bc20",b.nextid=0,b.inactiveEvents="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),b.zindex=15e3,b.defaults={prerender:s,id:s,overwrite:i,suppress:i,content:{text:i,attr:"title",deferred:s,title:{text:s,button:s}},position:{my:"top left",at:"bottom right",target:s,container:s,viewport:s,adjust:{x:0,y:0,mouse:i,resize:i,method:"flipinvert flipinvert"},effect:function(e,t,n){r(this).animate(t,{duration:200,queue:s})}},show:{target:s,event:"mouseenter",effect:i,delay:90,solo:s,ready:s,autofocus:s},hide:{target:s,event:"mouseleave",effect:i,delay:0,fixed:s,inactive:s,leave:"window",distance:s},style:{classes:"",widget:s,width:s,height:s,def:i},events:{render:o,move:o,show:o,hide:o,toggle:o,visible:o,hidden:o,focus:o,blur:o}},w.svg=function(e,n,i,s){var o=r(t),u=n[0],a={width:0,height:0,position:{top:1e10,left:1e10}},f,l,c,h,p;while(!u.getBBox)u=u.parentNode;if(u.getBBox&&u.parentNode){f=u.getBBox(),l=u.getScreenCTM(),c=u.farthestViewportElement||u;if(!c.createSVGPoint)return a;h=c.createSVGPoint(),h.x=f.x,h.y=f.y,p=h.matrixTransform(l),a.position.left=p.x,a.position.top=p.y,h.x+=f.width,h.y+=f.height,p=h.matrixTransform(l),a.width=p.x-a.position.left,a.height=p.y-a.position.top,a.position.left+=o.scrollLeft(),a.position.top+=o.scrollTop()}return a},w.ajax=function(e){var t=e.plugins.ajax;return"object"==typeof t?t:e.plugins.ajax=new B(e)},w.ajax.initialize="render",w.ajax.sanitize=function(e){var t=e.content,n;t&&"ajax"in t&&(n=t.ajax,typeof n!="object"&&(n=e.content.ajax={url:n}),"boolean"!=typeof n.once&&n.once&&(n.once=!!n.once))},r.extend(i,b.defaults,{content:{ajax:{loading:i,once:i}}}),w.tip=function(e){var t=e.plugins.tip;return"object"==typeof t?t:e.plugins.tip=new F(e)},w.tip.initialize="render",w.tip.sanitize=function(e){var t=e.style,n;t&&"tip"in t&&(n=e.style.tip,typeof n!="object"&&(e.style.tip={corner:n}),/string|boolean/i.test(typeof n.corner)||(n.corner=i),typeof n.width!="number"&&delete n.width,typeof n.height!="number"&&delete n.height,typeof n.border!="number"&&n.border!==i&&delete n.border,typeof n.offset!="number"&&delete n.offset)},r.extend(i,b.defaults,{style:{tip:{corner:i,mimic:s,width:6,height:6,border:i,offset:0}}}),w.modal=function(e){var t=e.plugins.modal;return"object"==typeof t?t:e.plugins.modal=new I(e)},w.modal.initialize="render",w.modal.sanitize=function(e){e.show&&(typeof e.show.modal!="object"?e.show.modal={on:!!e.show.modal}:typeof e.show.modal.on=="undefined"&&(e.show.modal.on=i))},w.modal.zindex=b.zindex-200,w.modal.focusable=["a[href]","area[href]","input","select","textarea","button","iframe","object","embed","[tabindex]","[contenteditable]"],r.extend(i,b.defaults,{show:{modal:{on:s,effect:i,blur:i,stealfocus:i,escape:i}}}),w.viewport=function(n,r,i,s,o,m,b){function j(e,t,n,i,s,o,u,a,f){var l=r[s],c=x[e],h=T[e],p=n===y,d=-O.offset[s]+A.offset[s]+A["scroll"+s],m=c===s?f:c===o?-f:-f/2,b=h===s?a:h===o?-a:-a/2,w=_&&_.size?_.size[u]||0:0,E=_&&_.corner&&_.corner.precedance===e&&!p?w:0,S=d-l+E,N=l+f-A[u]-d+E,C=m-(x.precedance===e||c===x[t]?b:0)-(h===v?a/2:0);return p?(E=_&&_.corner&&_.corner.precedance===t?w:0,C=(c===s?1:-1)*m-E,r[s]+=S>0?S:N>0?-N:0,r[s]=Math.max(-O.offset[s]+A.offset[s]+(E&&_.corner[e]===v?_.offset:0),l-C,Math.min(Math.max(-O.offset[s]+A.offset[s]+A[u],l+C),r[s]))):(i*=n===g?2:0,S>0&&(c!==s||N>0)?(r[s]-=C+i,H["invert"+e](s)):N>0&&(c!==o||S>0)&&(r[s]-=(c===v?-C:C)+i,H["invert"+e](o)),r[s]<d&&-r[s]>N&&(r[s]=l,H=x.clone())),r[s]-l}var w=i.target,E=n.elements.tooltip,x=i.my,T=i.at,N=i.adjust,C=N.method.split(" "),k=C[0],L=C[1]||C[0],A=i.viewport,O=i.container,M=n.cache,_=n.plugins.tip,D={left:0,top:0},P,H,B;if(!A.jquery||w[0]===e||w[0]===t.body||N.method==="none")return D;P=E.css("position")==="fixed",A={elem:A,height:A[(A[0]===e?"h":"outerH")+"eight"](),width:A[(A[0]===e?"w":"outerW")+"idth"](),scrollleft:P?0:A.scrollLeft(),scrolltop:P?0:A.scrollTop(),offset:A.offset()||{left:0,top:0}},O={elem:O,scrollLeft:O.scrollLeft(),scrollTop:O.scrollTop(),offset:O.offset()||{left:0,top:0}};if(k!=="shift"||L!=="shift")H=x.clone();return D={left:k!=="none"?j(u,a,k,N.x,h,d,f,s,m):0,top:L!=="none"?j(a,u,L,N.y,c,p,l,o,b):0},H&&M.lastClass!==(B=S+"-pos-"+H.abbrev())&&E.removeClass(n.cache.lastClass).addClass(n.cache.lastClass=B),D},w.imagemap=function(e,t,n,i){function E(e,t,n){var r=0,i=1,s=1,o=0,u=0,a=e.width,f=e.height;while(a>0&&f>0&&i>0&&s>0){a=Math.floor(a/2),f=Math.floor(f/2),n.x===h?i=a:n.x===d?i=e.width-a:i+=Math.floor(a/2),n.y===c?s=f:n.y===p?s=e.height-f:s+=Math.floor(f/2),r=t.length;while(r--){if(t.length<2)break;o=t[r][0]-e.position.left,u=t[r][1]-e.position.top,(n.x===h&&o>=i||n.x===d&&o<=i||n.x===v&&(o<i||o>e.width-i)||n.y===c&&u>=s||n.y===p&&u<=s||n.y===v&&(u<s||u>e.height-s))&&t.splice(r,1)}}return{left:t[0][0],top:t[0][1]}}t.jquery||(t=r(t));var s=e.cache.areas={},o=(t[0].shape||t.attr("shape")).toLowerCase(),u=t[0].coords||t.attr("coords"),a=u.split(","),f=[],l=r('img[usemap="#'+t.parent("map").attr("name")+'"]'),m=l.offset(),g={width:0,height:0,position:{top:1e10,right:0,bottom:0,left:1e10}},y=0,b=0,w;m.left+=Math.ceil((l.outerWidth()-l.width())/2),m.top+=Math.ceil((l.outerHeight()-l.height())/2);if(o==="poly"){y=a.length;while(y--)b=[parseInt(a[--y],10),parseInt(a[y+1],10)],b[0]>g.position.right&&(g.position.right=b[0]),b[0]<g.position.left&&(g.position.left=b[0]),b[1]>g.position.bottom&&(g.position.bottom=b[1]),b[1]<g.position.top&&(g.position.top=b[1]),f.push(b)}else{y=-1;while(y++<a.length)f.push(parseInt(a[y],10))}switch(o){case"rect":g={width:Math.abs(f[2]-f[0]),height:Math.abs(f[3]-f[1]),position:{left:Math.min(f[0],f[2]),top:Math.min(f[1],f[3])}};break;case"circle":g={width:f[2]+2,height:f[2]+2,position:{left:f[0],top:f[1]}};break;case"poly":g.width=Math.abs(g.position.right-g.position.left),g.height=Math.abs(g.position.bottom-g.position.top),n.abbrev()==="c"?g.position={left:g.position.left+g.width/2,top:g.position.top+g.height/2}:(s[n+u]||(g.position=E(g,f.slice(),n),i&&(i[0]==="flip"||i[1]==="flip")&&(g.offset=E(g,f.slice(),{x:n.x===h?d:n.x===d?h:v,y:n.y===c?p:n.y===p?c:v}),g.offset.left-=g.position.left,g.offset.top-=g.position.top),s[n+u]=g),g=s[n+u]),g.width=g.height=0}return g.position.left+=m.left,g.position.top+=m.top,g},w.ie6=function(e){var t=r.browser,n=e.plugins.ie6;return!t.msie||(""+t.version).charAt(0)!=="6"?s:"object"==typeof n?n:e.plugins.ie6=new q(e)},w.ie6.initialize="render"})})(window,document);
|
js/libraries/jquery-qtip/load.qtip.js
CHANGED
@@ -1,51 +1,51 @@
|
|
1 |
-
jQuery('.lp_tooltip').live('mouseover', function(event) {
|
2 |
-
// Bind the qTip within the event handler
|
3 |
-
jQuery(this).qtip({
|
4 |
-
overwrite: false, // Make sure the tooltip won't be overridden once created
|
5 |
-
content: {
|
6 |
-
title: {
|
7 |
-
text: 'What
|
8 |
-
}
|
9 |
-
},
|
10 |
-
position: {
|
11 |
-
my: 'bottom center', // Use the corner...
|
12 |
-
at: 'top center', // ...and opposite corner
|
13 |
-
viewport: jQuery(window)
|
14 |
-
},
|
15 |
-
style: {
|
16 |
-
classes: 'qtip-shadow qtip-jtools',
|
17 |
-
},
|
18 |
-
show: {
|
19 |
-
event: event.type, // Use the same show event as the one that triggered the event handler
|
20 |
-
ready: true, // Show the tooltip as soon as it's bound, vital so it shows up the first time you hover!
|
21 |
-
solo: true
|
22 |
-
},
|
23 |
-
hide: 'unfocus'
|
24 |
-
}, event); // Pass through our original event to qTip
|
25 |
-
})
|
26 |
-
|
27 |
-
jQuery('.lp_tooltip_templates').live('mouseover', function(event) {
|
28 |
-
// Bind the qTip within the event handler
|
29 |
-
jQuery(this).qtip({
|
30 |
-
overwrite: false, // Make sure the tooltip won't be overridden once created
|
31 |
-
content: {
|
32 |
-
title: {
|
33 |
-
text: 'About this Template'
|
34 |
-
}
|
35 |
-
},
|
36 |
-
position: {
|
37 |
-
my: 'bottom center', // Use the corner...
|
38 |
-
at: 'top center', // ...and opposite corner
|
39 |
-
viewport: jQuery(window)
|
40 |
-
},
|
41 |
-
style: {
|
42 |
-
classes: 'qtip-shadow qtip-jtools',
|
43 |
-
},
|
44 |
-
show: {
|
45 |
-
event: event.type, // Use the same show event as the one that triggered the event handler
|
46 |
-
ready: true, // Show the tooltip as soon as it's bound, vital so it shows up the first time you hover!
|
47 |
-
solo: true
|
48 |
-
},
|
49 |
-
hide: 'unfocus'
|
50 |
-
}, event); // Pass through our original event to qTip
|
51 |
})
|
1 |
+
jQuery('.lp_tooltip').live('mouseover', function(event) {
|
2 |
+
// Bind the qTip within the event handler
|
3 |
+
jQuery(this).qtip({
|
4 |
+
overwrite: false, // Make sure the tooltip won't be overridden once created
|
5 |
+
content: {
|
6 |
+
title: {
|
7 |
+
text: '<u>What does this do?</u>'
|
8 |
+
}
|
9 |
+
},
|
10 |
+
position: {
|
11 |
+
my: 'bottom center', // Use the corner...
|
12 |
+
at: 'top center', // ...and opposite corner
|
13 |
+
viewport: jQuery(window)
|
14 |
+
},
|
15 |
+
style: {
|
16 |
+
classes: 'qtip-shadow qtip-jtools',
|
17 |
+
},
|
18 |
+
show: {
|
19 |
+
event: event.type, // Use the same show event as the one that triggered the event handler
|
20 |
+
ready: true, // Show the tooltip as soon as it's bound, vital so it shows up the first time you hover!
|
21 |
+
solo: true
|
22 |
+
},
|
23 |
+
hide: 'unfocus'
|
24 |
+
}, event); // Pass through our original event to qTip
|
25 |
+
})
|
26 |
+
|
27 |
+
jQuery('.lp_tooltip_templates').live('mouseover', function(event) {
|
28 |
+
// Bind the qTip within the event handler
|
29 |
+
jQuery(this).qtip({
|
30 |
+
overwrite: false, // Make sure the tooltip won't be overridden once created
|
31 |
+
content: {
|
32 |
+
title: {
|
33 |
+
text: 'About this Template'
|
34 |
+
}
|
35 |
+
},
|
36 |
+
position: {
|
37 |
+
my: 'bottom center', // Use the corner...
|
38 |
+
at: 'top center', // ...and opposite corner
|
39 |
+
viewport: jQuery(window)
|
40 |
+
},
|
41 |
+
style: {
|
42 |
+
classes: 'qtip-shadow qtip-jtools',
|
43 |
+
},
|
44 |
+
show: {
|
45 |
+
event: event.type, // Use the same show event as the one that triggered the event handler
|
46 |
+
ready: true, // Show the tooltip as soon as it's bound, vital so it shows up the first time you hover!
|
47 |
+
solo: true
|
48 |
+
},
|
49 |
+
hide: 'unfocus'
|
50 |
+
}, event); // Pass through our original event to qTip
|
51 |
})
|
js/libraries/tiny_mce/plugins/autolink/editor_plugin_src.js
CHANGED
@@ -1,184 +1,184 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2011, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
tinymce.create('tinymce.plugins.AutolinkPlugin', {
|
13 |
-
/**
|
14 |
-
* Initializes the plugin, this will be executed after the plugin has been created.
|
15 |
-
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
16 |
-
* of the editor instance to intercept that event.
|
17 |
-
*
|
18 |
-
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
19 |
-
* @param {string} url Absolute URL to where the plugin is located.
|
20 |
-
*/
|
21 |
-
|
22 |
-
init : function(ed, url) {
|
23 |
-
var t = this;
|
24 |
-
|
25 |
-
// Add a key down handler
|
26 |
-
ed.onKeyDown.addToTop(function(ed, e) {
|
27 |
-
if (e.keyCode == 13)
|
28 |
-
return t.handleEnter(ed);
|
29 |
-
});
|
30 |
-
|
31 |
-
// Internet Explorer has built-in automatic linking for most cases
|
32 |
-
if (tinyMCE.isIE)
|
33 |
-
return;
|
34 |
-
|
35 |
-
ed.onKeyPress.add(function(ed, e) {
|
36 |
-
if (e.which == 41)
|
37 |
-
return t.handleEclipse(ed);
|
38 |
-
});
|
39 |
-
|
40 |
-
// Add a key up handler
|
41 |
-
ed.onKeyUp.add(function(ed, e) {
|
42 |
-
if (e.keyCode == 32)
|
43 |
-
return t.handleSpacebar(ed);
|
44 |
-
});
|
45 |
-
},
|
46 |
-
|
47 |
-
handleEclipse : function(ed) {
|
48 |
-
this.parseCurrentLine(ed, -1, '(', true);
|
49 |
-
},
|
50 |
-
|
51 |
-
handleSpacebar : function(ed) {
|
52 |
-
this.parseCurrentLine(ed, 0, '', true);
|
53 |
-
},
|
54 |
-
|
55 |
-
handleEnter : function(ed) {
|
56 |
-
this.parseCurrentLine(ed, -1, '', false);
|
57 |
-
},
|
58 |
-
|
59 |
-
parseCurrentLine : function(ed, end_offset, delimiter, goback) {
|
60 |
-
var r, end, start, endContainer, bookmark, text, matches, prev, len;
|
61 |
-
|
62 |
-
// We need at least five characters to form a URL,
|
63 |
-
// hence, at minimum, five characters from the beginning of the line.
|
64 |
-
r = ed.selection.getRng(true).cloneRange();
|
65 |
-
if (r.startOffset < 5) {
|
66 |
-
// During testing, the caret is placed inbetween two text nodes.
|
67 |
-
// The previous text node contains the URL.
|
68 |
-
prev = r.endContainer.previousSibling;
|
69 |
-
if (prev == null) {
|
70 |
-
if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null)
|
71 |
-
return;
|
72 |
-
|
73 |
-
prev = r.endContainer.firstChild.nextSibling;
|
74 |
-
}
|
75 |
-
len = prev.length;
|
76 |
-
r.setStart(prev, len);
|
77 |
-
r.setEnd(prev, len);
|
78 |
-
|
79 |
-
if (r.endOffset < 5)
|
80 |
-
return;
|
81 |
-
|
82 |
-
end = r.endOffset;
|
83 |
-
endContainer = prev;
|
84 |
-
} else {
|
85 |
-
endContainer = r.endContainer;
|
86 |
-
|
87 |
-
// Get a text node
|
88 |
-
if (endContainer.nodeType != 3 && endContainer.firstChild) {
|
89 |
-
while (endContainer.nodeType != 3 && endContainer.firstChild)
|
90 |
-
endContainer = endContainer.firstChild;
|
91 |
-
|
92 |
-
// Move range to text node
|
93 |
-
if (endContainer.nodeType == 3) {
|
94 |
-
r.setStart(endContainer, 0);
|
95 |
-
r.setEnd(endContainer, endContainer.nodeValue.length);
|
96 |
-
}
|
97 |
-
}
|
98 |
-
|
99 |
-
if (r.endOffset == 1)
|
100 |
-
end = 2;
|
101 |
-
else
|
102 |
-
end = r.endOffset - 1 - end_offset;
|
103 |
-
}
|
104 |
-
|
105 |
-
start = end;
|
106 |
-
|
107 |
-
do
|
108 |
-
{
|
109 |
-
// Move the selection one character backwards.
|
110 |
-
r.setStart(endContainer, end - 2);
|
111 |
-
r.setEnd(endContainer, end - 1);
|
112 |
-
end -= 1;
|
113 |
-
|
114 |
-
// Loop until one of the following is found: a blank space, , delimeter, (end-2) >= 0
|
115 |
-
} while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter);
|
116 |
-
|
117 |
-
if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) {
|
118 |
-
r.setStart(endContainer, end);
|
119 |
-
r.setEnd(endContainer, start);
|
120 |
-
end += 1;
|
121 |
-
} else if (r.startOffset == 0) {
|
122 |
-
r.setStart(endContainer, 0);
|
123 |
-
r.setEnd(endContainer, start);
|
124 |
-
}
|
125 |
-
else {
|
126 |
-
r.setStart(endContainer, end);
|
127 |
-
r.setEnd(endContainer, start);
|
128 |
-
}
|
129 |
-
|
130 |
-
// Exclude last . from word like "www.site.com."
|
131 |
-
var text = r.toString();
|
132 |
-
if (text.charAt(text.length - 1) == '.') {
|
133 |
-
r.setEnd(endContainer, start - 1);
|
134 |
-
}
|
135 |
-
|
136 |
-
text = r.toString();
|
137 |
-
matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);
|
138 |
-
|
139 |
-
if (matches) {
|
140 |
-
if (matches[1] == 'www.') {
|
141 |
-
matches[1] = 'http://www.';
|
142 |
-
} else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) {
|
143 |
-
matches[1] = 'mailto:' + matches[1];
|
144 |
-
}
|
145 |
-
|
146 |
-
bookmark = ed.selection.getBookmark();
|
147 |
-
|
148 |
-
ed.selection.setRng(r);
|
149 |
-
tinyMCE.execCommand('createlink',false, matches[1] + matches[2]);
|
150 |
-
ed.selection.moveToBookmark(bookmark);
|
151 |
-
ed.nodeChanged();
|
152 |
-
|
153 |
-
// TODO: Determine if this is still needed.
|
154 |
-
if (tinyMCE.isWebKit) {
|
155 |
-
// move the caret to its original position
|
156 |
-
ed.selection.collapse(false);
|
157 |
-
var max = Math.min(endContainer.length, start + 1);
|
158 |
-
r.setStart(endContainer, max);
|
159 |
-
r.setEnd(endContainer, max);
|
160 |
-
ed.selection.setRng(r);
|
161 |
-
}
|
162 |
-
}
|
163 |
-
},
|
164 |
-
|
165 |
-
/**
|
166 |
-
* Returns information about the plugin as a name/value array.
|
167 |
-
* The current keys are longname, author, authorurl, infourl and version.
|
168 |
-
*
|
169 |
-
* @return {Object} Name/value array containing information about the plugin.
|
170 |
-
*/
|
171 |
-
getInfo : function() {
|
172 |
-
return {
|
173 |
-
longname : 'Autolink',
|
174 |
-
author : 'Moxiecode Systems AB',
|
175 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
176 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink',
|
177 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
178 |
-
};
|
179 |
-
}
|
180 |
-
});
|
181 |
-
|
182 |
-
// Register plugin
|
183 |
-
tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin);
|
184 |
-
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2011, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.AutolinkPlugin', {
|
13 |
+
/**
|
14 |
+
* Initializes the plugin, this will be executed after the plugin has been created.
|
15 |
+
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
16 |
+
* of the editor instance to intercept that event.
|
17 |
+
*
|
18 |
+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
19 |
+
* @param {string} url Absolute URL to where the plugin is located.
|
20 |
+
*/
|
21 |
+
|
22 |
+
init : function(ed, url) {
|
23 |
+
var t = this;
|
24 |
+
|
25 |
+
// Add a key down handler
|
26 |
+
ed.onKeyDown.addToTop(function(ed, e) {
|
27 |
+
if (e.keyCode == 13)
|
28 |
+
return t.handleEnter(ed);
|
29 |
+
});
|
30 |
+
|
31 |
+
// Internet Explorer has built-in automatic linking for most cases
|
32 |
+
if (tinyMCE.isIE)
|
33 |
+
return;
|
34 |
+
|
35 |
+
ed.onKeyPress.add(function(ed, e) {
|
36 |
+
if (e.which == 41)
|
37 |
+
return t.handleEclipse(ed);
|
38 |
+
});
|
39 |
+
|
40 |
+
// Add a key up handler
|
41 |
+
ed.onKeyUp.add(function(ed, e) {
|
42 |
+
if (e.keyCode == 32)
|
43 |
+
return t.handleSpacebar(ed);
|
44 |
+
});
|
45 |
+
},
|
46 |
+
|
47 |
+
handleEclipse : function(ed) {
|
48 |
+
this.parseCurrentLine(ed, -1, '(', true);
|
49 |
+
},
|
50 |
+
|
51 |
+
handleSpacebar : function(ed) {
|
52 |
+
this.parseCurrentLine(ed, 0, '', true);
|
53 |
+
},
|
54 |
+
|
55 |
+
handleEnter : function(ed) {
|
56 |
+
this.parseCurrentLine(ed, -1, '', false);
|
57 |
+
},
|
58 |
+
|
59 |
+
parseCurrentLine : function(ed, end_offset, delimiter, goback) {
|
60 |
+
var r, end, start, endContainer, bookmark, text, matches, prev, len;
|
61 |
+
|
62 |
+
// We need at least five characters to form a URL,
|
63 |
+
// hence, at minimum, five characters from the beginning of the line.
|
64 |
+
r = ed.selection.getRng(true).cloneRange();
|
65 |
+
if (r.startOffset < 5) {
|
66 |
+
// During testing, the caret is placed inbetween two text nodes.
|
67 |
+
// The previous text node contains the URL.
|
68 |
+
prev = r.endContainer.previousSibling;
|
69 |
+
if (prev == null) {
|
70 |
+
if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null)
|
71 |
+
return;
|
72 |
+
|
73 |
+
prev = r.endContainer.firstChild.nextSibling;
|
74 |
+
}
|
75 |
+
len = prev.length;
|
76 |
+
r.setStart(prev, len);
|
77 |
+
r.setEnd(prev, len);
|
78 |
+
|
79 |
+
if (r.endOffset < 5)
|
80 |
+
return;
|
81 |
+
|
82 |
+
end = r.endOffset;
|
83 |
+
endContainer = prev;
|
84 |
+
} else {
|
85 |
+
endContainer = r.endContainer;
|
86 |
+
|
87 |
+
// Get a text node
|
88 |
+
if (endContainer.nodeType != 3 && endContainer.firstChild) {
|
89 |
+
while (endContainer.nodeType != 3 && endContainer.firstChild)
|
90 |
+
endContainer = endContainer.firstChild;
|
91 |
+
|
92 |
+
// Move range to text node
|
93 |
+
if (endContainer.nodeType == 3) {
|
94 |
+
r.setStart(endContainer, 0);
|
95 |
+
r.setEnd(endContainer, endContainer.nodeValue.length);
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
if (r.endOffset == 1)
|
100 |
+
end = 2;
|
101 |
+
else
|
102 |
+
end = r.endOffset - 1 - end_offset;
|
103 |
+
}
|
104 |
+
|
105 |
+
start = end;
|
106 |
+
|
107 |
+
do
|
108 |
+
{
|
109 |
+
// Move the selection one character backwards.
|
110 |
+
r.setStart(endContainer, end - 2);
|
111 |
+
r.setEnd(endContainer, end - 1);
|
112 |
+
end -= 1;
|
113 |
+
|
114 |
+
// Loop until one of the following is found: a blank space, , delimeter, (end-2) >= 0
|
115 |
+
} while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter);
|
116 |
+
|
117 |
+
if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) {
|
118 |
+
r.setStart(endContainer, end);
|
119 |
+
r.setEnd(endContainer, start);
|
120 |
+
end += 1;
|
121 |
+
} else if (r.startOffset == 0) {
|
122 |
+
r.setStart(endContainer, 0);
|
123 |
+
r.setEnd(endContainer, start);
|
124 |
+
}
|
125 |
+
else {
|
126 |
+
r.setStart(endContainer, end);
|
127 |
+
r.setEnd(endContainer, start);
|
128 |
+
}
|
129 |
+
|
130 |
+
// Exclude last . from word like "www.site.com."
|
131 |
+
var text = r.toString();
|
132 |
+
if (text.charAt(text.length - 1) == '.') {
|
133 |
+
r.setEnd(endContainer, start - 1);
|
134 |
+
}
|
135 |
+
|
136 |
+
text = r.toString();
|
137 |
+
matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);
|
138 |
+
|
139 |
+
if (matches) {
|
140 |
+
if (matches[1] == 'www.') {
|
141 |
+
matches[1] = 'http://www.';
|
142 |
+
} else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) {
|
143 |
+
matches[1] = 'mailto:' + matches[1];
|
144 |
+
}
|
145 |
+
|
146 |
+
bookmark = ed.selection.getBookmark();
|
147 |
+
|
148 |
+
ed.selection.setRng(r);
|
149 |
+
tinyMCE.execCommand('createlink',false, matches[1] + matches[2]);
|
150 |
+
ed.selection.moveToBookmark(bookmark);
|
151 |
+
ed.nodeChanged();
|
152 |
+
|
153 |
+
// TODO: Determine if this is still needed.
|
154 |
+
if (tinyMCE.isWebKit) {
|
155 |
+
// move the caret to its original position
|
156 |
+
ed.selection.collapse(false);
|
157 |
+
var max = Math.min(endContainer.length, start + 1);
|
158 |
+
r.setStart(endContainer, max);
|
159 |
+
r.setEnd(endContainer, max);
|
160 |
+
ed.selection.setRng(r);
|
161 |
+
}
|
162 |
+
}
|
163 |
+
},
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Returns information about the plugin as a name/value array.
|
167 |
+
* The current keys are longname, author, authorurl, infourl and version.
|
168 |
+
*
|
169 |
+
* @return {Object} Name/value array containing information about the plugin.
|
170 |
+
*/
|
171 |
+
getInfo : function() {
|
172 |
+
return {
|
173 |
+
longname : 'Autolink',
|
174 |
+
author : 'Moxiecode Systems AB',
|
175 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
176 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink',
|
177 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
178 |
+
};
|
179 |
+
}
|
180 |
+
});
|
181 |
+
|
182 |
+
// Register plugin
|
183 |
+
tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin);
|
184 |
+
})();
|
js/libraries/tiny_mce/plugins/autoresize/editor_plugin_src.js
CHANGED
@@ -1,119 +1,119 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
/**
|
13 |
-
* Auto Resize
|
14 |
-
*
|
15 |
-
* This plugin automatically resizes the content area to fit its content height.
|
16 |
-
* It will retain a minimum height, which is the height of the content area when
|
17 |
-
* it's initialized.
|
18 |
-
*/
|
19 |
-
tinymce.create('tinymce.plugins.AutoResizePlugin', {
|
20 |
-
/**
|
21 |
-
* Initializes the plugin, this will be executed after the plugin has been created.
|
22 |
-
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
23 |
-
* of the editor instance to intercept that event.
|
24 |
-
*
|
25 |
-
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
26 |
-
* @param {string} url Absolute URL to where the plugin is located.
|
27 |
-
*/
|
28 |
-
init : function(ed, url) {
|
29 |
-
var t = this, oldSize = 0;
|
30 |
-
|
31 |
-
if (ed.getParam('fullscreen_is_enabled'))
|
32 |
-
return;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* This method gets executed each time the editor needs to resize.
|
36 |
-
*/
|
37 |
-
function resize() {
|
38 |
-
var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
|
39 |
-
|
40 |
-
// Get height differently depending on the browser used
|
41 |
-
myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight);
|
42 |
-
|
43 |
-
// Don't make it smaller than the minimum height
|
44 |
-
if (myHeight > t.autoresize_min_height)
|
45 |
-
resizeHeight = myHeight;
|
46 |
-
|
47 |
-
// If a maximum height has been defined don't exceed this height
|
48 |
-
if (t.autoresize_max_height && myHeight > t.autoresize_max_height) {
|
49 |
-
resizeHeight = t.autoresize_max_height;
|
50 |
-
body.style.overflowY = "auto";
|
51 |
-
de.style.overflowY = "auto"; // Old IE
|
52 |
-
} else {
|
53 |
-
body.style.overflowY = "hidden";
|
54 |
-
de.style.overflowY = "hidden"; // Old IE
|
55 |
-
body.scrollTop = 0;
|
56 |
-
}
|
57 |
-
|
58 |
-
// Resize content element
|
59 |
-
if (resizeHeight !== oldSize) {
|
60 |
-
deltaSize = resizeHeight - oldSize;
|
61 |
-
DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
|
62 |
-
oldSize = resizeHeight;
|
63 |
-
|
64 |
-
// WebKit doesn't decrease the size of the body element until the iframe gets resized
|
65 |
-
// So we need to continue to resize the iframe down until the size gets fixed
|
66 |
-
if (tinymce.isWebKit && deltaSize < 0)
|
67 |
-
resize();
|
68 |
-
}
|
69 |
-
};
|
70 |
-
|
71 |
-
t.editor = ed;
|
72 |
-
|
73 |
-
// Define minimum height
|
74 |
-
t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight));
|
75 |
-
|
76 |
-
// Define maximum height
|
77 |
-
t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0));
|
78 |
-
|
79 |
-
// Add padding at the bottom for better UX
|
80 |
-
ed.onInit.add(function(ed){
|
81 |
-
ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px');
|
82 |
-
});
|
83 |
-
|
84 |
-
// Add appropriate listeners for resizing content area
|
85 |
-
ed.onChange.add(resize);
|
86 |
-
ed.onSetContent.add(resize);
|
87 |
-
ed.onPaste.add(resize);
|
88 |
-
ed.onKeyUp.add(resize);
|
89 |
-
ed.onPostRender.add(resize);
|
90 |
-
|
91 |
-
if (ed.getParam('autoresize_on_init', true)) {
|
92 |
-
ed.onLoad.add(resize);
|
93 |
-
ed.onLoadContent.add(resize);
|
94 |
-
}
|
95 |
-
|
96 |
-
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
|
97 |
-
ed.addCommand('mceAutoResize', resize);
|
98 |
-
},
|
99 |
-
|
100 |
-
/**
|
101 |
-
* Returns information about the plugin as a name/value array.
|
102 |
-
* The current keys are longname, author, authorurl, infourl and version.
|
103 |
-
*
|
104 |
-
* @return {Object} Name/value array containing information about the plugin.
|
105 |
-
*/
|
106 |
-
getInfo : function() {
|
107 |
-
return {
|
108 |
-
longname : 'Auto Resize',
|
109 |
-
author : 'Moxiecode Systems AB',
|
110 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
111 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
|
112 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
113 |
-
};
|
114 |
-
}
|
115 |
-
});
|
116 |
-
|
117 |
-
// Register plugin
|
118 |
-
tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
|
119 |
-
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
/**
|
13 |
+
* Auto Resize
|
14 |
+
*
|
15 |
+
* This plugin automatically resizes the content area to fit its content height.
|
16 |
+
* It will retain a minimum height, which is the height of the content area when
|
17 |
+
* it's initialized.
|
18 |
+
*/
|
19 |
+
tinymce.create('tinymce.plugins.AutoResizePlugin', {
|
20 |
+
/**
|
21 |
+
* Initializes the plugin, this will be executed after the plugin has been created.
|
22 |
+
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
23 |
+
* of the editor instance to intercept that event.
|
24 |
+
*
|
25 |
+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
26 |
+
* @param {string} url Absolute URL to where the plugin is located.
|
27 |
+
*/
|
28 |
+
init : function(ed, url) {
|
29 |
+
var t = this, oldSize = 0;
|
30 |
+
|
31 |
+
if (ed.getParam('fullscreen_is_enabled'))
|
32 |
+
return;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* This method gets executed each time the editor needs to resize.
|
36 |
+
*/
|
37 |
+
function resize() {
|
38 |
+
var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
|
39 |
+
|
40 |
+
// Get height differently depending on the browser used
|
41 |
+
myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight);
|
42 |
+
|
43 |
+
// Don't make it smaller than the minimum height
|
44 |
+
if (myHeight > t.autoresize_min_height)
|
45 |
+
resizeHeight = myHeight;
|
46 |
+
|
47 |
+
// If a maximum height has been defined don't exceed this height
|
48 |
+
if (t.autoresize_max_height && myHeight > t.autoresize_max_height) {
|
49 |
+
resizeHeight = t.autoresize_max_height;
|
50 |
+
body.style.overflowY = "auto";
|
51 |
+
de.style.overflowY = "auto"; // Old IE
|
52 |
+
} else {
|
53 |
+
body.style.overflowY = "hidden";
|
54 |
+
de.style.overflowY = "hidden"; // Old IE
|
55 |
+
body.scrollTop = 0;
|
56 |
+
}
|
57 |
+
|
58 |
+
// Resize content element
|
59 |
+
if (resizeHeight !== oldSize) {
|
60 |
+
deltaSize = resizeHeight - oldSize;
|
61 |
+
DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
|
62 |
+
oldSize = resizeHeight;
|
63 |
+
|
64 |
+
// WebKit doesn't decrease the size of the body element until the iframe gets resized
|
65 |
+
// So we need to continue to resize the iframe down until the size gets fixed
|
66 |
+
if (tinymce.isWebKit && deltaSize < 0)
|
67 |
+
resize();
|
68 |
+
}
|
69 |
+
};
|
70 |
+
|
71 |
+
t.editor = ed;
|
72 |
+
|
73 |
+
// Define minimum height
|
74 |
+
t.autoresize_min_height = parseInt(ed.getParam('autoresize_min_height', ed.getElement().offsetHeight));
|
75 |
+
|
76 |
+
// Define maximum height
|
77 |
+
t.autoresize_max_height = parseInt(ed.getParam('autoresize_max_height', 0));
|
78 |
+
|
79 |
+
// Add padding at the bottom for better UX
|
80 |
+
ed.onInit.add(function(ed){
|
81 |
+
ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px');
|
82 |
+
});
|
83 |
+
|
84 |
+
// Add appropriate listeners for resizing content area
|
85 |
+
ed.onChange.add(resize);
|
86 |
+
ed.onSetContent.add(resize);
|
87 |
+
ed.onPaste.add(resize);
|
88 |
+
ed.onKeyUp.add(resize);
|
89 |
+
ed.onPostRender.add(resize);
|
90 |
+
|
91 |
+
if (ed.getParam('autoresize_on_init', true)) {
|
92 |
+
ed.onLoad.add(resize);
|
93 |
+
ed.onLoadContent.add(resize);
|
94 |
+
}
|
95 |
+
|
96 |
+
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
|
97 |
+
ed.addCommand('mceAutoResize', resize);
|
98 |
+
},
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Returns information about the plugin as a name/value array.
|
102 |
+
* The current keys are longname, author, authorurl, infourl and version.
|
103 |
+
*
|
104 |
+
* @return {Object} Name/value array containing information about the plugin.
|
105 |
+
*/
|
106 |
+
getInfo : function() {
|
107 |
+
return {
|
108 |
+
longname : 'Auto Resize',
|
109 |
+
author : 'Moxiecode Systems AB',
|
110 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
111 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
|
112 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
113 |
+
};
|
114 |
+
}
|
115 |
+
});
|
116 |
+
|
117 |
+
// Register plugin
|
118 |
+
tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
|
119 |
+
})();
|
js/libraries/tiny_mce/plugins/emotions/langs/en_dlg.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
tinyMCE.addI18n('en.emotions_dlg',{cry:"Cry",cool:"Cool",desc:"Emotions",title:"Insert Emotion",usage:"Use left and right arrows to navigate.",yell:"Yell",wink:"Wink",undecided:"Undecided","tongue_out":"Tongue Out",surprised:"Surprised",smile:"Smile",sealed:"Sealed","money_mouth":"Money Mouth",laughing:"Laughing",kiss:"Kiss",innocent:"Innocent",frown:"Frown","foot_in_mouth":"Foot in Mouth",embarassed:"Embarassed"});
|
1 |
+
tinyMCE.addI18n('en.emotions_dlg',{cry:"Cry",cool:"Cool",desc:"Emotions",title:"Insert Emotion",usage:"Use left and right arrows to navigate.",yell:"Yell",wink:"Wink",undecided:"Undecided","tongue_out":"Tongue Out",surprised:"Surprised",smile:"Smile",sealed:"Sealed","money_mouth":"Money Mouth",laughing:"Laughing",kiss:"Kiss",innocent:"Innocent",frown:"Frown","foot_in_mouth":"Foot in Mouth",embarassed:"Embarassed"});
|
js/libraries/tiny_mce/plugins/example_dependency/editor_plugin_src.js
CHANGED
@@ -1,50 +1,50 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
|
13 |
-
tinymce.create('tinymce.plugins.ExampleDependencyPlugin', {
|
14 |
-
/**
|
15 |
-
* Initializes the plugin, this will be executed after the plugin has been created.
|
16 |
-
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
17 |
-
* of the editor instance to intercept that event.
|
18 |
-
*
|
19 |
-
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
20 |
-
* @param {string} url Absolute URL to where the plugin is located.
|
21 |
-
*/
|
22 |
-
init : function(ed, url) {
|
23 |
-
},
|
24 |
-
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Returns information about the plugin as a name/value array.
|
28 |
-
* The current keys are longname, author, authorurl, infourl and version.
|
29 |
-
*
|
30 |
-
* @return {Object} Name/value array containing information about the plugin.
|
31 |
-
*/
|
32 |
-
getInfo : function() {
|
33 |
-
return {
|
34 |
-
longname : 'Example Dependency plugin',
|
35 |
-
author : 'Some author',
|
36 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
37 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency',
|
38 |
-
version : "1.0"
|
39 |
-
};
|
40 |
-
}
|
41 |
-
});
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, with the list loaded in order.
|
45 |
-
* plugins in this list will be initialised when this plugin is initialized. (before the init method is called).
|
46 |
-
* plugins in a depends list should typically be specified using the short name). If neccesary this can be done
|
47 |
-
* with an object which has the url to the plugin and the shortname.
|
48 |
-
*/
|
49 |
-
tinymce.PluginManager.add('example_dependency', tinymce.plugins.ExampleDependencyPlugin, ['example']);
|
50 |
-
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
|
13 |
+
tinymce.create('tinymce.plugins.ExampleDependencyPlugin', {
|
14 |
+
/**
|
15 |
+
* Initializes the plugin, this will be executed after the plugin has been created.
|
16 |
+
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
17 |
+
* of the editor instance to intercept that event.
|
18 |
+
*
|
19 |
+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
20 |
+
* @param {string} url Absolute URL to where the plugin is located.
|
21 |
+
*/
|
22 |
+
init : function(ed, url) {
|
23 |
+
},
|
24 |
+
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Returns information about the plugin as a name/value array.
|
28 |
+
* The current keys are longname, author, authorurl, infourl and version.
|
29 |
+
*
|
30 |
+
* @return {Object} Name/value array containing information about the plugin.
|
31 |
+
*/
|
32 |
+
getInfo : function() {
|
33 |
+
return {
|
34 |
+
longname : 'Example Dependency plugin',
|
35 |
+
author : 'Some author',
|
36 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
37 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency',
|
38 |
+
version : "1.0"
|
39 |
+
};
|
40 |
+
}
|
41 |
+
});
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, with the list loaded in order.
|
45 |
+
* plugins in this list will be initialised when this plugin is initialized. (before the init method is called).
|
46 |
+
* plugins in a depends list should typically be specified using the short name). If neccesary this can be done
|
47 |
+
* with an object which has the url to the plugin and the shortname.
|
48 |
+
*/
|
49 |
+
tinymce.PluginManager.add('example_dependency', tinymce.plugins.ExampleDependencyPlugin, ['example']);
|
50 |
+
})();
|
js/libraries/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css
CHANGED
@@ -1,90 +1,90 @@
|
|
1 |
-
/* Clearlooks 2 */
|
2 |
-
|
3 |
-
/* Reset */
|
4 |
-
.clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block}
|
5 |
-
|
6 |
-
/* General */
|
7 |
-
.clearlooks2 {position:absolute; direction:ltr}
|
8 |
-
.clearlooks2 .mceWrapper {position:static}
|
9 |
-
.mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%}
|
10 |
-
.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)}
|
11 |
-
.clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none}
|
12 |
-
|
13 |
-
/* Top */
|
14 |
-
.clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px}
|
15 |
-
.clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)}
|
16 |
-
.clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)}
|
17 |
-
.clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0}
|
18 |
-
.clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold}
|
19 |
-
.clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0}
|
20 |
-
.clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px}
|
21 |
-
.clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0}
|
22 |
-
.clearlooks2 .mceFocus .mceTop span {color:#FFF}
|
23 |
-
|
24 |
-
/* Middle */
|
25 |
-
.clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0}
|
26 |
-
.clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)}
|
27 |
-
.clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0}
|
28 |
-
.clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF}
|
29 |
-
.clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)}
|
30 |
-
|
31 |
-
/* Bottom */
|
32 |
-
.clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px}
|
33 |
-
.clearlooks2 .mceBottom {left:0; bottom:0; width:100%}
|
34 |
-
.clearlooks2 .mceBottom div {top:0}
|
35 |
-
.clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px}
|
36 |
-
.clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px}
|
37 |
-
.clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0}
|
38 |
-
.clearlooks2 .mceBottom span {display:none}
|
39 |
-
.clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px}
|
40 |
-
.clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0}
|
41 |
-
.clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px}
|
42 |
-
.clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0}
|
43 |
-
.clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px}
|
44 |
-
|
45 |
-
/* Actions */
|
46 |
-
.clearlooks2 a {width:29px; height:16px; top:3px;}
|
47 |
-
.clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0}
|
48 |
-
.clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0}
|
49 |
-
.clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0}
|
50 |
-
.clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0}
|
51 |
-
.clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px}
|
52 |
-
.clearlooks2 .mceMovable .mceMove {display:block}
|
53 |
-
.clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px}
|
54 |
-
.clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px}
|
55 |
-
.clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px}
|
56 |
-
.clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px}
|
57 |
-
.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
|
58 |
-
.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
|
59 |
-
.clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px}
|
60 |
-
.clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px}
|
61 |
-
.clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px}
|
62 |
-
|
63 |
-
/* Resize */
|
64 |
-
.clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px}
|
65 |
-
.clearlooks2 .mceResizable .mceResize {display:block}
|
66 |
-
.clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none}
|
67 |
-
.clearlooks2 .mceMinimizable .mceMin {display:block}
|
68 |
-
.clearlooks2 .mceMaximizable .mceMax {display:block}
|
69 |
-
.clearlooks2 .mceMaximized .mceMed {display:block}
|
70 |
-
.clearlooks2 .mceMaximized .mceMax {display:none}
|
71 |
-
.clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize}
|
72 |
-
.clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize}
|
73 |
-
.clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize}
|
74 |
-
.clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;}
|
75 |
-
.clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize}
|
76 |
-
.clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize}
|
77 |
-
.clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize}
|
78 |
-
.clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize}
|
79 |
-
|
80 |
-
/* Alert/Confirm */
|
81 |
-
.clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0}
|
82 |
-
.clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px}
|
83 |
-
.clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal}
|
84 |
-
.clearlooks2 a:hover {font-weight:bold;}
|
85 |
-
.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5}
|
86 |
-
.clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px}
|
87 |
-
.clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)}
|
88 |
-
.clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px}
|
89 |
-
.clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto}
|
90 |
-
.clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)}
|
1 |
+
/* Clearlooks 2 */
|
2 |
+
|
3 |
+
/* Reset */
|
4 |
+
.clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block}
|
5 |
+
|
6 |
+
/* General */
|
7 |
+
.clearlooks2 {position:absolute; direction:ltr}
|
8 |
+
.clearlooks2 .mceWrapper {position:static}
|
9 |
+
.mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%}
|
10 |
+
.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)}
|
11 |
+
.clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none}
|
12 |
+
|
13 |
+
/* Top */
|
14 |
+
.clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px}
|
15 |
+
.clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)}
|
16 |
+
.clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)}
|
17 |
+
.clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0}
|
18 |
+
.clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold}
|
19 |
+
.clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0}
|
20 |
+
.clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px}
|
21 |
+
.clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0}
|
22 |
+
.clearlooks2 .mceFocus .mceTop span {color:#FFF}
|
23 |
+
|
24 |
+
/* Middle */
|
25 |
+
.clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0}
|
26 |
+
.clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)}
|
27 |
+
.clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0}
|
28 |
+
.clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF}
|
29 |
+
.clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)}
|
30 |
+
|
31 |
+
/* Bottom */
|
32 |
+
.clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px}
|
33 |
+
.clearlooks2 .mceBottom {left:0; bottom:0; width:100%}
|
34 |
+
.clearlooks2 .mceBottom div {top:0}
|
35 |
+
.clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px}
|
36 |
+
.clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px}
|
37 |
+
.clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0}
|
38 |
+
.clearlooks2 .mceBottom span {display:none}
|
39 |
+
.clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px}
|
40 |
+
.clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0}
|
41 |
+
.clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px}
|
42 |
+
.clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0}
|
43 |
+
.clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px}
|
44 |
+
|
45 |
+
/* Actions */
|
46 |
+
.clearlooks2 a {width:29px; height:16px; top:3px;}
|
47 |
+
.clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0}
|
48 |
+
.clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0}
|
49 |
+
.clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0}
|
50 |
+
.clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0}
|
51 |
+
.clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px}
|
52 |
+
.clearlooks2 .mceMovable .mceMove {display:block}
|
53 |
+
.clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px}
|
54 |
+
.clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px}
|
55 |
+
.clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px}
|
56 |
+
.clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px}
|
57 |
+
.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
|
58 |
+
.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
|
59 |
+
.clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px}
|
60 |
+
.clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px}
|
61 |
+
.clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px}
|
62 |
+
|
63 |
+
/* Resize */
|
64 |
+
.clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px}
|
65 |
+
.clearlooks2 .mceResizable .mceResize {display:block}
|
66 |
+
.clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none}
|
67 |
+
.clearlooks2 .mceMinimizable .mceMin {display:block}
|
68 |
+
.clearlooks2 .mceMaximizable .mceMax {display:block}
|
69 |
+
.clearlooks2 .mceMaximized .mceMed {display:block}
|
70 |
+
.clearlooks2 .mceMaximized .mceMax {display:none}
|
71 |
+
.clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize}
|
72 |
+
.clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize}
|
73 |
+
.clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize}
|
74 |
+
.clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;}
|
75 |
+
.clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize}
|
76 |
+
.clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize}
|
77 |
+
.clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize}
|
78 |
+
.clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize}
|
79 |
+
|
80 |
+
/* Alert/Confirm */
|
81 |
+
.clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0}
|
82 |
+
.clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px}
|
83 |
+
.clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal}
|
84 |
+
.clearlooks2 a:hover {font-weight:bold;}
|
85 |
+
.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5}
|
86 |
+
.clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px}
|
87 |
+
.clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)}
|
88 |
+
.clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px}
|
89 |
+
.clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto}
|
90 |
+
.clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)}
|
js/libraries/tiny_mce/plugins/lists/editor_plugin_src.js
CHANGED
@@ -1,955 +1,955 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2011, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
var each = tinymce.each, Event = tinymce.dom.Event, bookmark;
|
13 |
-
|
14 |
-
// Skips text nodes that only contain whitespace since they aren't semantically important.
|
15 |
-
function skipWhitespaceNodes(e, next) {
|
16 |
-
while (e && (e.nodeType === 8 || (e.nodeType === 3 && /^[ \t\n\r]*$/.test(e.nodeValue)))) {
|
17 |
-
e = next(e);
|
18 |
-
}
|
19 |
-
return e;
|
20 |
-
}
|
21 |
-
|
22 |
-
function skipWhitespaceNodesBackwards(e) {
|
23 |
-
return skipWhitespaceNodes(e, function(e) {
|
24 |
-
return e.previousSibling;
|
25 |
-
});
|
26 |
-
}
|
27 |
-
|
28 |
-
function skipWhitespaceNodesForwards(e) {
|
29 |
-
return skipWhitespaceNodes(e, function(e) {
|
30 |
-
return e.nextSibling;
|
31 |
-
});
|
32 |
-
}
|
33 |
-
|
34 |
-
function hasParentInList(ed, e, list) {
|
35 |
-
return ed.dom.getParent(e, function(p) {
|
36 |
-
return tinymce.inArray(list, p) !== -1;
|
37 |
-
});
|
38 |
-
}
|
39 |
-
|
40 |
-
function isList(e) {
|
41 |
-
return e && (e.tagName === 'OL' || e.tagName === 'UL');
|
42 |
-
}
|
43 |
-
|
44 |
-
function splitNestedLists(element, dom) {
|
45 |
-
var tmp, nested, wrapItem;
|
46 |
-
tmp = skipWhitespaceNodesBackwards(element.lastChild);
|
47 |
-
while (isList(tmp)) {
|
48 |
-
nested = tmp;
|
49 |
-
tmp = skipWhitespaceNodesBackwards(nested.previousSibling);
|
50 |
-
}
|
51 |
-
if (nested) {
|
52 |
-
wrapItem = dom.create('li', { style: 'list-style-type: none;'});
|
53 |
-
dom.split(element, nested);
|
54 |
-
dom.insertAfter(wrapItem, nested);
|
55 |
-
wrapItem.appendChild(nested);
|
56 |
-
wrapItem.appendChild(nested);
|
57 |
-
element = wrapItem.previousSibling;
|
58 |
-
}
|
59 |
-
return element;
|
60 |
-
}
|
61 |
-
|
62 |
-
function attemptMergeWithAdjacent(e, allowDifferentListStyles, mergeParagraphs) {
|
63 |
-
e = attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs);
|
64 |
-
return attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs);
|
65 |
-
}
|
66 |
-
|
67 |
-
function attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs) {
|
68 |
-
var prev = skipWhitespaceNodesBackwards(e.previousSibling);
|
69 |
-
if (prev) {
|
70 |
-
return attemptMerge(prev, e, allowDifferentListStyles ? prev : false, mergeParagraphs);
|
71 |
-
} else {
|
72 |
-
return e;
|
73 |
-
}
|
74 |
-
}
|
75 |
-
|
76 |
-
function attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs) {
|
77 |
-
var next = skipWhitespaceNodesForwards(e.nextSibling);
|
78 |
-
if (next) {
|
79 |
-
return attemptMerge(e, next, allowDifferentListStyles ? next : false, mergeParagraphs);
|
80 |
-
} else {
|
81 |
-
return e;
|
82 |
-
}
|
83 |
-
}
|
84 |
-
|
85 |
-
function attemptMerge(e1, e2, differentStylesMasterElement, mergeParagraphs) {
|
86 |
-
if (canMerge(e1, e2, !!differentStylesMasterElement, mergeParagraphs)) {
|
87 |
-
return merge(e1, e2, differentStylesMasterElement);
|
88 |
-
} else if (e1 && e1.tagName === 'LI' && isList(e2)) {
|
89 |
-
// Fix invalidly nested lists.
|
90 |
-
e1.appendChild(e2);
|
91 |
-
}
|
92 |
-
return e2;
|
93 |
-
}
|
94 |
-
|
95 |
-
function canMerge(e1, e2, allowDifferentListStyles, mergeParagraphs) {
|
96 |
-
if (!e1 || !e2) {
|
97 |
-
return false;
|
98 |
-
} else if (e1.tagName === 'LI' && e2.tagName === 'LI') {
|
99 |
-
return e2.style.listStyleType === 'none' || containsOnlyAList(e2);
|
100 |
-
} else if (isList(e1)) {
|
101 |
-
return (e1.tagName === e2.tagName && (allowDifferentListStyles || e1.style.listStyleType === e2.style.listStyleType)) || isListForIndent(e2);
|
102 |
-
} else return mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P';
|
103 |
-
}
|
104 |
-
|
105 |
-
function isListForIndent(e) {
|
106 |
-
var firstLI = skipWhitespaceNodesForwards(e.firstChild), lastLI = skipWhitespaceNodesBackwards(e.lastChild);
|
107 |
-
return firstLI && lastLI && isList(e) && firstLI === lastLI && (isList(firstLI) || firstLI.style.listStyleType === 'none' || containsOnlyAList(firstLI));
|
108 |
-
}
|
109 |
-
|
110 |
-
function containsOnlyAList(e) {
|
111 |
-
var firstChild = skipWhitespaceNodesForwards(e.firstChild), lastChild = skipWhitespaceNodesBackwards(e.lastChild);
|
112 |
-
return firstChild && lastChild && firstChild === lastChild && isList(firstChild);
|
113 |
-
}
|
114 |
-
|
115 |
-
function merge(e1, e2, masterElement) {
|
116 |
-
var lastOriginal = skipWhitespaceNodesBackwards(e1.lastChild), firstNew = skipWhitespaceNodesForwards(e2.firstChild);
|
117 |
-
if (e1.tagName === 'P') {
|
118 |
-
e1.appendChild(e1.ownerDocument.createElement('br'));
|
119 |
-
}
|
120 |
-
while (e2.firstChild) {
|
121 |
-
e1.appendChild(e2.firstChild);
|
122 |
-
}
|
123 |
-
if (masterElement) {
|
124 |
-
e1.style.listStyleType = masterElement.style.listStyleType;
|
125 |
-
}
|
126 |
-
e2.parentNode.removeChild(e2);
|
127 |
-
attemptMerge(lastOriginal, firstNew, false);
|
128 |
-
return e1;
|
129 |
-
}
|
130 |
-
|
131 |
-
function findItemToOperateOn(e, dom) {
|
132 |
-
var item;
|
133 |
-
if (!dom.is(e, 'li,ol,ul')) {
|
134 |
-
item = dom.getParent(e, 'li');
|
135 |
-
if (item) {
|
136 |
-
e = item;
|
137 |
-
}
|
138 |
-
}
|
139 |
-
return e;
|
140 |
-
}
|
141 |
-
|
142 |
-
tinymce.create('tinymce.plugins.Lists', {
|
143 |
-
init: function(ed) {
|
144 |
-
var LIST_TABBING = 'TABBING';
|
145 |
-
var LIST_EMPTY_ITEM = 'EMPTY';
|
146 |
-
var LIST_ESCAPE = 'ESCAPE';
|
147 |
-
var LIST_PARAGRAPH = 'PARAGRAPH';
|
148 |
-
var LIST_UNKNOWN = 'UNKNOWN';
|
149 |
-
var state = LIST_UNKNOWN;
|
150 |
-
|
151 |
-
function isTabInList(e) {
|
152 |
-
// Don't indent on Ctrl+Tab or Alt+Tab
|
153 |
-
return e.keyCode === tinymce.VK.TAB && !(e.altKey || e.ctrlKey) &&
|
154 |
-
(ed.queryCommandState('InsertUnorderedList') || ed.queryCommandState('InsertOrderedList'));
|
155 |
-
}
|
156 |
-
|
157 |
-
function isOnLastListItem() {
|
158 |
-
var li = getLi();
|
159 |
-
var grandParent = li.parentNode.parentNode;
|
160 |
-
var isLastItem = li.parentNode.lastChild === li;
|
161 |
-
return isLastItem && !isNestedList(grandParent) && isEmptyListItem(li);
|
162 |
-
}
|
163 |
-
|
164 |
-
function isNestedList(grandParent) {
|
165 |
-
if (isList(grandParent)) {
|
166 |
-
return grandParent.parentNode && grandParent.parentNode.tagName === 'LI';
|
167 |
-
} else {
|
168 |
-
return grandParent.tagName === 'LI';
|
169 |
-
}
|
170 |
-
}
|
171 |
-
|
172 |
-
function isInEmptyListItem() {
|
173 |
-
return ed.selection.isCollapsed() && isEmptyListItem(getLi());
|
174 |
-
}
|
175 |
-
|
176 |
-
function getLi() {
|
177 |
-
var n = ed.selection.getStart();
|
178 |
-
// Get start will return BR if the LI only contains a BR or an empty element as we use these to fix caret position
|
179 |
-
return ((n.tagName == 'BR' || n.tagName == '') && n.parentNode.tagName == 'LI') ? n.parentNode : n;
|
180 |
-
}
|
181 |
-
|
182 |
-
function isEmptyListItem(li) {
|
183 |
-
var numChildren = li.childNodes.length;
|
184 |
-
if (li.tagName === 'LI') {
|
185 |
-
return numChildren == 0 ? true : numChildren == 1 && (li.firstChild.tagName == '' || li.firstChild.tagName == 'BR' || isEmptyIE9Li(li));
|
186 |
-
}
|
187 |
-
return false;
|
188 |
-
}
|
189 |
-
|
190 |
-
function isEmptyIE9Li(li) {
|
191 |
-
// only consider this to be last item if there is no list item content or that content is nbsp or space since IE9 creates these
|
192 |
-
var lis = tinymce.grep(li.parentNode.childNodes, function(n) {return n.tagName == 'LI'});
|
193 |
-
var isLastLi = li == lis[lis.length - 1];
|
194 |
-
var child = li.firstChild;
|
195 |
-
return tinymce.isIE9 && isLastLi && (child.nodeValue == String.fromCharCode(160) || child.nodeValue == String.fromCharCode(32));
|
196 |
-
}
|
197 |
-
|
198 |
-
function isEnter(e) {
|
199 |
-
return e.keyCode === tinymce.VK.ENTER;
|
200 |
-
}
|
201 |
-
|
202 |
-
function isEnterWithoutShift(e) {
|
203 |
-
return isEnter(e) && !e.shiftKey;
|
204 |
-
}
|
205 |
-
|
206 |
-
function getListKeyState(e) {
|
207 |
-
if (isTabInList(e)) {
|
208 |
-
return LIST_TABBING;
|
209 |
-
} else if (isEnterWithoutShift(e) && isOnLastListItem()) {
|
210 |
-
// Returns LIST_UNKNOWN since breaking out of lists is handled by the EnterKey.js logic now
|
211 |
-
//return LIST_ESCAPE;
|
212 |
-
return LIST_UNKNOWN;
|
213 |
-
} else if (isEnterWithoutShift(e) && isInEmptyListItem()) {
|
214 |
-
return LIST_EMPTY_ITEM;
|
215 |
-
} else {
|
216 |
-
return LIST_UNKNOWN;
|
217 |
-
}
|
218 |
-
}
|
219 |
-
|
220 |
-
function cancelDefaultEvents(ed, e) {
|
221 |
-
// list escape is done manually using outdent as it does not create paragraphs correctly in td's
|
222 |
-
if (state == LIST_TABBING || state == LIST_EMPTY_ITEM || tinymce.isGecko && state == LIST_ESCAPE) {
|
223 |
-
Event.cancel(e);
|
224 |
-
}
|
225 |
-
}
|
226 |
-
|
227 |
-
function isCursorAtEndOfContainer() {
|
228 |
-
var range = ed.selection.getRng(true);
|
229 |
-
var startContainer = range.startContainer;
|
230 |
-
if (startContainer.nodeType == 3) {
|
231 |
-
var value = startContainer.nodeValue;
|
232 |
-
if (tinymce.isIE9 && value.length > 1 && value.charCodeAt(value.length-1) == 32) {
|
233 |
-
// IE9 places a space on the end of the text in some cases so ignore last char
|
234 |
-
return (range.endOffset == value.length-1);
|
235 |
-
} else {
|
236 |
-
return (range.endOffset == value.length);
|
237 |
-
}
|
238 |
-
} else if (startContainer.nodeType == 1) {
|
239 |
-
return range.endOffset == startContainer.childNodes.length;
|
240 |
-
}
|
241 |
-
return false;
|
242 |
-
}
|
243 |
-
|
244 |
-
/*
|
245 |
-
If we are at the end of a list item surrounded with an element, pressing enter should create a
|
246 |
-
new list item instead without splitting the element e.g. don't want to create new P or H1 tag
|
247 |
-
*/
|
248 |
-
function isEndOfListItem() {
|
249 |
-
var node = ed.selection.getNode();
|
250 |
-
var validElements = 'h1,h2,h3,h4,h5,h6,p,div';
|
251 |
-
var isLastParagraphOfLi = ed.dom.is(node, validElements) && node.parentNode.tagName === 'LI' && node.parentNode.lastChild === node;
|
252 |
-
return ed.selection.isCollapsed() && isLastParagraphOfLi && isCursorAtEndOfContainer();
|
253 |
-
}
|
254 |
-
|
255 |
-
// Creates a new list item after the current selection's list item parent
|
256 |
-
function createNewLi(ed, e) {
|
257 |
-
if (isEnterWithoutShift(e) && isEndOfListItem()) {
|
258 |
-
var node = ed.selection.getNode();
|
259 |
-
var li = ed.dom.create("li");
|
260 |
-
var parentLi = ed.dom.getParent(node, 'li');
|
261 |
-
ed.dom.insertAfter(li, parentLi);
|
262 |
-
|
263 |
-
// Move caret to new list element.
|
264 |
-
if (tinymce.isIE6 || tinymce.isIE7 || tinyMCE.isIE8) {
|
265 |
-
// Removed this line since it would create an odd < > tag and placing the caret inside an empty LI is handled and should be handled by the selection logic
|
266 |
-
//li.appendChild(ed.dom.create(" ")); // IE needs an element within the bullet point
|
267 |
-
ed.selection.setCursorLocation(li, 1);
|
268 |
-
} else {
|
269 |
-
ed.selection.setCursorLocation(li, 0);
|
270 |
-
}
|
271 |
-
e.preventDefault();
|
272 |
-
}
|
273 |
-
}
|
274 |
-
|
275 |
-
function imageJoiningListItem(ed, e) {
|
276 |
-
var prevSibling;
|
277 |
-
|
278 |
-
if (!tinymce.isGecko)
|
279 |
-
return;
|
280 |
-
|
281 |
-
var n = ed.selection.getStart();
|
282 |
-
if (e.keyCode != tinymce.VK.BACKSPACE || n.tagName !== 'IMG')
|
283 |
-
return;
|
284 |
-
|
285 |
-
function lastLI(node) {
|
286 |
-
var child = node.firstChild;
|
287 |
-
var li = null;
|
288 |
-
do {
|
289 |
-
if (!child)
|
290 |
-
break;
|
291 |
-
|
292 |
-
if (child.tagName === 'LI')
|
293 |
-
li = child;
|
294 |
-
} while (child = child.nextSibling);
|
295 |
-
|
296 |
-
return li;
|
297 |
-
}
|
298 |
-
|
299 |
-
function addChildren(parentNode, destination) {
|
300 |
-
while (parentNode.childNodes.length > 0)
|
301 |
-
destination.appendChild(parentNode.childNodes[0]);
|
302 |
-
}
|
303 |
-
|
304 |
-
// Check if there is a previous sibling
|
305 |
-
prevSibling = n.parentNode.previousSibling;
|
306 |
-
if (!prevSibling)
|
307 |
-
return;
|
308 |
-
|
309 |
-
var ul;
|
310 |
-
if (prevSibling.tagName === 'UL' || prevSibling.tagName === 'OL')
|
311 |
-
ul = prevSibling;
|
312 |
-
else if (prevSibling.previousSibling && (prevSibling.previousSibling.tagName === 'UL' || prevSibling.previousSibling.tagName === 'OL'))
|
313 |
-
ul = prevSibling.previousSibling;
|
314 |
-
else
|
315 |
-
return;
|
316 |
-
|
317 |
-
var li = lastLI(ul);
|
318 |
-
|
319 |
-
// move the caret to the end of the list item
|
320 |
-
var rng = ed.dom.createRng();
|
321 |
-
rng.setStart(li, 1);
|
322 |
-
rng.setEnd(li, 1);
|
323 |
-
ed.selection.setRng(rng);
|
324 |
-
ed.selection.collapse(true);
|
325 |
-
|
326 |
-
// save a bookmark at the end of the list item
|
327 |
-
var bookmark = ed.selection.getBookmark();
|
328 |
-
|
329 |
-
// copy the image an its text to the list item
|
330 |
-
var clone = n.parentNode.cloneNode(true);
|
331 |
-
if (clone.tagName === 'P' || clone.tagName === 'DIV')
|
332 |
-
addChildren(clone, li);
|
333 |
-
else
|
334 |
-
li.appendChild(clone);
|
335 |
-
|
336 |
-
// remove the old copy of the image
|
337 |
-
n.parentNode.parentNode.removeChild(n.parentNode);
|
338 |
-
|
339 |
-
// move the caret where we saved the bookmark
|
340 |
-
ed.selection.moveToBookmark(bookmark);
|
341 |
-
}
|
342 |
-
|
343 |
-
// fix the cursor position to ensure it is correct in IE
|
344 |
-
function setCursorPositionToOriginalLi(li) {
|
345 |
-
var list = ed.dom.getParent(li, 'ol,ul');
|
346 |
-
if (list != null) {
|
347 |
-
var lastLi = list.lastChild;
|
348 |
-
// Removed this line since IE9 would report an DOM character error and placing the caret inside an empty LI is handled and should be handled by the selection logic
|
349 |
-
//lastLi.appendChild(ed.getDoc().createElement(''));
|
350 |
-
ed.selection.setCursorLocation(lastLi, 0);
|
351 |
-
}
|
352 |
-
}
|
353 |
-
|
354 |
-
this.ed = ed;
|
355 |
-
ed.addCommand('Indent', this.indent, this);
|
356 |
-
ed.addCommand('Outdent', this.outdent, this);
|
357 |
-
ed.addCommand('InsertUnorderedList', function() {
|
358 |
-
this.applyList('UL', 'OL');
|
359 |
-
}, this);
|
360 |
-
ed.addCommand('InsertOrderedList', function() {
|
361 |
-
this.applyList('OL', 'UL');
|
362 |
-
}, this);
|
363 |
-
|
364 |
-
ed.onInit.add(function() {
|
365 |
-
ed.editorCommands.addCommands({
|
366 |
-
'outdent': function() {
|
367 |
-
var sel = ed.selection, dom = ed.dom;
|
368 |
-
|
369 |
-
function hasStyleIndent(n) {
|
370 |
-
n = dom.getParent(n, dom.isBlock);
|
371 |
-
return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0;
|
372 |
-
}
|
373 |
-
|
374 |
-
return hasStyleIndent(sel.getStart()) || hasStyleIndent(sel.getEnd()) || ed.queryCommandState('InsertOrderedList') || ed.queryCommandState('InsertUnorderedList');
|
375 |
-
}
|
376 |
-
}, 'state');
|
377 |
-
});
|
378 |
-
|
379 |
-
ed.onKeyUp.add(function(ed, e) {
|
380 |
-
if (state == LIST_TABBING) {
|
381 |
-
ed.execCommand(e.shiftKey ? 'Outdent' : 'Indent', true, null);
|
382 |
-
state = LIST_UNKNOWN;
|
383 |
-
return Event.cancel(e);
|
384 |
-
} else if (state == LIST_EMPTY_ITEM) {
|
385 |
-
var li = getLi();
|
386 |
-
var shouldOutdent = ed.settings.list_outdent_on_enter === true || e.shiftKey;
|
387 |
-
ed.execCommand(shouldOutdent ? 'Outdent' : 'Indent', true, null);
|
388 |
-
if (tinymce.isIE) {
|
389 |
-
setCursorPositionToOriginalLi(li);
|
390 |
-
}
|
391 |
-
|
392 |
-
return Event.cancel(e);
|
393 |
-
} else if (state == LIST_ESCAPE) {
|
394 |
-
if (tinymce.isIE6 || tinymce.isIE7 || tinymce.isIE8) {
|
395 |
-
// append a zero sized nbsp so that caret is positioned correctly in IE after escaping and applying formatting.
|
396 |
-
// if there is no text then applying formatting for e.g a H1 to the P tag immediately following list after
|
397 |
-
// escaping from it will cause the caret to be positioned on the last li instead of staying the in P tag.
|
398 |
-
var n = ed.getDoc().createTextNode('\uFEFF');
|
399 |
-
ed.selection.getNode().appendChild(n);
|
400 |
-
} else if (tinymce.isIE9 || tinymce.isGecko) {
|
401 |
-
// IE9 does not escape the list so we use outdent to do this and cancel the default behaviour
|
402 |
-
// Gecko does not create a paragraph outdenting inside a TD so default behaviour is cancelled and we outdent ourselves
|
403 |
-
ed.execCommand('Outdent');
|
404 |
-
return Event.cancel(e);
|
405 |
-
}
|
406 |
-
}
|
407 |
-
});
|
408 |
-
|
409 |
-
function fixListItem(parent, reference) {
|
410 |
-
// a zero-sized non-breaking space is placed in the empty list item so that the nested list is
|
411 |
-
// displayed on the below line instead of next to it
|
412 |
-
var n = ed.getDoc().createTextNode('\uFEFF');
|
413 |
-
parent.insertBefore(n, reference);
|
414 |
-
ed.selection.setCursorLocation(n, 0);
|
415 |
-
// repaint to remove rendering artifact. only visible when creating new list
|
416 |
-
ed.execCommand('mceRepaint');
|
417 |
-
}
|
418 |
-
|
419 |
-
function fixIndentedListItemForGecko(ed, e) {
|
420 |
-
if (isEnter(e)) {
|
421 |
-
var li = getLi();
|
422 |
-
if (li) {
|
423 |
-
var parent = li.parentNode;
|
424 |
-
var grandParent = parent && parent.parentNode;
|
425 |
-
if (grandParent && grandParent.nodeName == 'LI' && grandParent.firstChild == parent && li == parent.firstChild) {
|
426 |
-
fixListItem(grandParent, parent);
|
427 |
-
}
|
428 |
-
}
|
429 |
-
}
|
430 |
-
}
|
431 |
-
|
432 |
-
function fixIndentedListItemForIE8(ed, e) {
|
433 |
-
if (isEnter(e)) {
|
434 |
-
var li = getLi();
|
435 |
-
if (ed.dom.select('ul li', li).length === 1) {
|
436 |
-
var list = li.firstChild;
|
437 |
-
fixListItem(li, list);
|
438 |
-
}
|
439 |
-
}
|
440 |
-
}
|
441 |
-
|
442 |
-
function fixDeletingFirstCharOfList(ed, e) {
|
443 |
-
function listElements(li) {
|
444 |
-
var elements = [];
|
445 |
-
var walker = new tinymce.dom.TreeWalker(li.firstChild, li);
|
446 |
-
for (var node = walker.current(); node; node = walker.next()) {
|
447 |
-
if (ed.dom.is(node, 'ol,ul,li')) {
|
448 |
-
elements.push(node);
|
449 |
-
}
|
450 |
-
}
|
451 |
-
return elements;
|
452 |
-
}
|
453 |
-
|
454 |
-
if (e.keyCode == tinymce.VK.BACKSPACE) {
|
455 |
-
var li = getLi();
|
456 |
-
if (li) {
|
457 |
-
var list = ed.dom.getParent(li, 'ol,ul'),
|
458 |
-
rng = ed.selection.getRng();
|
459 |
-
if (list && list.firstChild === li && rng.startOffset == 0) {
|
460 |
-
var elements = listElements(li);
|
461 |
-
elements.unshift(li);
|
462 |
-
ed.execCommand("Outdent", false, elements);
|
463 |
-
ed.undoManager.add();
|
464 |
-
return Event.cancel(e);
|
465 |
-
}
|
466 |
-
}
|
467 |
-
}
|
468 |
-
}
|
469 |
-
|
470 |
-
function fixDeletingEmptyLiInWebkit(ed, e) {
|
471 |
-
var li = getLi();
|
472 |
-
if (e.keyCode === tinymce.VK.BACKSPACE && ed.dom.is(li, 'li') && li.parentNode.firstChild!==li) {
|
473 |
-
if (ed.dom.select('ul,ol', li).length === 1) {
|
474 |
-
var prevLi = li.previousSibling;
|
475 |
-
ed.dom.remove(ed.dom.select('br', li));
|
476 |
-
ed.dom.remove(li, true);
|
477 |
-
var textNodes = tinymce.grep(prevLi.childNodes, function(n){ return n.nodeType === 3 });
|
478 |
-
if (textNodes.length === 1) {
|
479 |
-
var textNode = textNodes[0];
|
480 |
-
ed.selection.setCursorLocation(textNode, textNode.length);
|
481 |
-
}
|
482 |
-
ed.undoManager.add();
|
483 |
-
return Event.cancel(e);
|
484 |
-
}
|
485 |
-
}
|
486 |
-
}
|
487 |
-
|
488 |
-
ed.onKeyDown.add(function(_, e) { state = getListKeyState(e); });
|
489 |
-
ed.onKeyDown.add(cancelDefaultEvents);
|
490 |
-
ed.onKeyDown.add(imageJoiningListItem);
|
491 |
-
ed.onKeyDown.add(createNewLi);
|
492 |
-
|
493 |
-
if (tinymce.isGecko) {
|
494 |
-
ed.onKeyUp.add(fixIndentedListItemForGecko);
|
495 |
-
}
|
496 |
-
if (tinymce.isIE8) {
|
497 |
-
ed.onKeyUp.add(fixIndentedListItemForIE8);
|
498 |
-
}
|
499 |
-
if (tinymce.isGecko || tinymce.isWebKit) {
|
500 |
-
ed.onKeyDown.add(fixDeletingFirstCharOfList);
|
501 |
-
}
|
502 |
-
if (tinymce.isWebKit) {
|
503 |
-
ed.onKeyDown.add(fixDeletingEmptyLiInWebkit);
|
504 |
-
}
|
505 |
-
},
|
506 |
-
|
507 |
-
applyList: function(targetListType, oppositeListType) {
|
508 |
-
var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions,
|
509 |
-
selectedBlocks = ed.selection.getSelectedBlocks();
|
510 |
-
|
511 |
-
function cleanupBr(e) {
|
512 |
-
if (e && e.tagName === 'BR') {
|
513 |
-
dom.remove(e);
|
514 |
-
}
|
515 |
-
}
|
516 |
-
|
517 |
-
function makeList(element) {
|
518 |
-
var list = dom.create(targetListType), li;
|
519 |
-
|
520 |
-
function adjustIndentForNewList(element) {
|
521 |
-
// If there's a margin-left, outdent one level to account for the extra list margin.
|
522 |
-
if (element.style.marginLeft || element.style.paddingLeft) {
|
523 |
-
t.adjustPaddingFunction(false)(element);
|
524 |
-
}
|
525 |
-
}
|
526 |
-
|
527 |
-
if (element.tagName === 'LI') {
|
528 |
-
// No change required.
|
529 |
-
} else if (element.tagName === 'P' || element.tagName === 'DIV' || element.tagName === 'BODY') {
|
530 |
-
processBrs(element, function(startSection, br) {
|
531 |
-
doWrapList(startSection, br, element.tagName === 'BODY' ? null : startSection.parentNode);
|
532 |
-
li = startSection.parentNode;
|
533 |
-
adjustIndentForNewList(li);
|
534 |
-
cleanupBr(br);
|
535 |
-
});
|
536 |
-
if (li) {
|
537 |
-
if (li.tagName === 'LI' && (element.tagName === 'P' || selectedBlocks.length > 1)) {
|
538 |
-
dom.split(li.parentNode.parentNode, li.parentNode);
|
539 |
-
}
|
540 |
-
attemptMergeWithAdjacent(li.parentNode, true);
|
541 |
-
}
|
542 |
-
return;
|
543 |
-
} else {
|
544 |
-
// Put the list around the element.
|
545 |
-
li = dom.create('li');
|
546 |
-
dom.insertAfter(li, element);
|
547 |
-
li.appendChild(element);
|
548 |
-
adjustIndentForNewList(element);
|
549 |
-
element = li;
|
550 |
-
}
|
551 |
-
dom.insertAfter(list, element);
|
552 |
-
list.appendChild(element);
|
553 |
-
attemptMergeWithAdjacent(list, true);
|
554 |
-
applied.push(element);
|
555 |
-
}
|
556 |
-
|
557 |
-
function doWrapList(start, end, template) {
|
558 |
-
var li, n = start, tmp;
|
559 |
-
while (!dom.isBlock(start.parentNode) && start.parentNode !== dom.getRoot()) {
|
560 |
-
start = dom.split(start.parentNode, start.previousSibling);
|
561 |
-
start = start.nextSibling;
|
562 |
-
n = start;
|
563 |
-
}
|
564 |
-
if (template) {
|
565 |
-
li = template.cloneNode(true);
|
566 |
-
start.parentNode.insertBefore(li, start);
|
567 |
-
while (li.firstChild) dom.remove(li.firstChild);
|
568 |
-
li = dom.rename(li, 'li');
|
569 |
-
} else {
|
570 |
-
li = dom.create('li');
|
571 |
-
start.parentNode.insertBefore(li, start);
|
572 |
-
}
|
573 |
-
while (n && n != end) {
|
574 |
-
tmp = n.nextSibling;
|
575 |
-
li.appendChild(n);
|
576 |
-
n = tmp;
|
577 |
-
}
|
578 |
-
if (li.childNodes.length === 0) {
|
579 |
-
li.innerHTML = '<br _mce_bogus="1" />';
|
580 |
-
}
|
581 |
-
makeList(li);
|
582 |
-
}
|
583 |
-
|
584 |
-
function processBrs(element, callback) {
|
585 |
-
var startSection, previousBR, END_TO_START = 3, START_TO_END = 1,
|
586 |
-
breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl';
|
587 |
-
|
588 |
-
function isAnyPartSelected(start, end) {
|
589 |
-
var r = dom.createRng(), sel;
|
590 |
-
bookmark.keep = true;
|
591 |
-
ed.selection.moveToBookmark(bookmark);
|
592 |
-
bookmark.keep = false;
|
593 |
-
sel = ed.selection.getRng(true);
|
594 |
-
if (!end) {
|
595 |
-
end = start.parentNode.lastChild;
|
596 |
-
}
|
597 |
-
r.setStartBefore(start);
|
598 |
-
r.setEndAfter(end);
|
599 |
-
return !(r.compareBoundaryPoints(END_TO_START, sel) > 0 || r.compareBoundaryPoints(START_TO_END, sel) <= 0);
|
600 |
-
}
|
601 |
-
|
602 |
-
function nextLeaf(br) {
|
603 |
-
if (br.nextSibling)
|
604 |
-
return br.nextSibling;
|
605 |
-
if (!dom.isBlock(br.parentNode) && br.parentNode !== dom.getRoot())
|
606 |
-
return nextLeaf(br.parentNode);
|
607 |
-
}
|
608 |
-
|
609 |
-
// Split on BRs within the range and process those.
|
610 |
-
startSection = element.firstChild;
|
611 |
-
// First mark the BRs that have any part of the previous section selected.
|
612 |
-
var trailingContentSelected = false;
|
613 |
-
each(dom.select(breakElements, element), function(br) {
|
614 |
-
if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
|
615 |
-
return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
|
616 |
-
}
|
617 |
-
if (isAnyPartSelected(startSection, br)) {
|
618 |
-
dom.addClass(br, '_mce_tagged_br');
|
619 |
-
startSection = nextLeaf(br);
|
620 |
-
}
|
621 |
-
});
|
622 |
-
trailingContentSelected = (startSection && isAnyPartSelected(startSection, undefined));
|
623 |
-
startSection = element.firstChild;
|
624 |
-
each(dom.select(breakElements, element), function(br) {
|
625 |
-
// Got a section from start to br.
|
626 |
-
var tmp = nextLeaf(br);
|
627 |
-
if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
|
628 |
-
return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
|
629 |
-
}
|
630 |
-
if (dom.hasClass(br, '_mce_tagged_br')) {
|
631 |
-
callback(startSection, br, previousBR);
|
632 |
-
previousBR = null;
|
633 |
-
} else {
|
634 |
-
previousBR = br;
|
635 |
-
}
|
636 |
-
startSection = tmp;
|
637 |
-
});
|
638 |
-
if (trailingContentSelected) {
|
639 |
-
callback(startSection, undefined, previousBR);
|
640 |
-
}
|
641 |
-
}
|
642 |
-
|
643 |
-
function wrapList(element) {
|
644 |
-
processBrs(element, function(startSection, br, previousBR) {
|
645 |
-
// Need to indent this part
|
646 |
-
doWrapList(startSection, br);
|
647 |
-
cleanupBr(br);
|
648 |
-
cleanupBr(previousBR);
|
649 |
-
});
|
650 |
-
}
|
651 |
-
|
652 |
-
function changeList(element) {
|
653 |
-
if (tinymce.inArray(applied, element) !== -1) {
|
654 |
-
return;
|
655 |
-
}
|
656 |
-
if (element.parentNode.tagName === oppositeListType) {
|
657 |
-
dom.split(element.parentNode, element);
|
658 |
-
makeList(element);
|
659 |
-
attemptMergeWithNext(element.parentNode, false);
|
660 |
-
}
|
661 |
-
applied.push(element);
|
662 |
-
}
|
663 |
-
|
664 |
-
function convertListItemToParagraph(element) {
|
665 |
-
var child, nextChild, mergedElement, splitLast;
|
666 |
-
if (tinymce.inArray(applied, element) !== -1) {
|
667 |
-
return;
|
668 |
-
}
|
669 |
-
element = splitNestedLists(element, dom);
|
670 |
-
while (dom.is(element.parentNode, 'ol,ul,li')) {
|
671 |
-
dom.split(element.parentNode, element);
|
672 |
-
}
|
673 |
-
// Push the original element we have from the selection, not the renamed one.
|
674 |
-
applied.push(element);
|
675 |
-
element = dom.rename(element, 'p');
|
676 |
-
mergedElement = attemptMergeWithAdjacent(element, false, ed.settings.force_br_newlines);
|
677 |
-
if (mergedElement === element) {
|
678 |
-
// Now split out any block elements that can't be contained within a P.
|
679 |
-
// Manually iterate to ensure we handle modifications correctly (doesn't work with tinymce.each)
|
680 |
-
child = element.firstChild;
|
681 |
-
while (child) {
|
682 |
-
if (dom.isBlock(child)) {
|
683 |
-
child = dom.split(child.parentNode, child);
|
684 |
-
splitLast = true;
|
685 |
-
nextChild = child.nextSibling && child.nextSibling.firstChild;
|
686 |
-
} else {
|
687 |
-
nextChild = child.nextSibling;
|
688 |
-
if (splitLast && child.tagName === 'BR') {
|
689 |
-
dom.remove(child);
|
690 |
-
}
|
691 |
-
splitLast = false;
|
692 |
-
}
|
693 |
-
child = nextChild;
|
694 |
-
}
|
695 |
-
}
|
696 |
-
}
|
697 |
-
|
698 |
-
each(selectedBlocks, function(e) {
|
699 |
-
e = findItemToOperateOn(e, dom);
|
700 |
-
if (e.tagName === oppositeListType || (e.tagName === 'LI' && e.parentNode.tagName === oppositeListType)) {
|
701 |
-
hasOppositeType = true;
|
702 |
-
} else if (e.tagName === targetListType || (e.tagName === 'LI' && e.parentNode.tagName === targetListType)) {
|
703 |
-
hasSameType = true;
|
704 |
-
} else {
|
705 |
-
hasNonList = true;
|
706 |
-
}
|
707 |
-
});
|
708 |
-
|
709 |
-
if (hasNonList &&!hasSameType || hasOppositeType || selectedBlocks.length === 0) {
|
710 |
-
actions = {
|
711 |
-
'LI': changeList,
|
712 |
-
'H1': makeList,
|
713 |
-
'H2': makeList,
|
714 |
-
'H3': makeList,
|
715 |
-
'H4': makeList,
|
716 |
-
'H5': makeList,
|
717 |
-
'H6': makeList,
|
718 |
-
'P': makeList,
|
719 |
-
'BODY': makeList,
|
720 |
-
'DIV': selectedBlocks.length > 1 ? makeList : wrapList,
|
721 |
-
defaultAction: wrapList,
|
722 |
-
elements: this.selectedBlocks()
|
723 |
-
};
|
724 |
-
} else {
|
725 |
-
actions = {
|
726 |
-
defaultAction: convertListItemToParagraph,
|
727 |
-
elements: this.selectedBlocks(),
|
728 |
-
processEvenIfEmpty: true
|
729 |
-
};
|
730 |
-
}
|
731 |
-
this.process(actions);
|
732 |
-
},
|
733 |
-
|
734 |
-
indent: function() {
|
735 |
-
var ed = this.ed, dom = ed.dom, indented = [];
|
736 |
-
|
737 |
-
function createWrapItem(element) {
|
738 |
-
var wrapItem = dom.create('li', { style: 'list-style-type: none;'});
|
739 |
-
dom.insertAfter(wrapItem, element);
|
740 |
-
return wrapItem;
|
741 |
-
}
|
742 |
-
|
743 |
-
function createWrapList(element) {
|
744 |
-
var wrapItem = createWrapItem(element),
|
745 |
-
list = dom.getParent(element, 'ol,ul'),
|
746 |
-
listType = list.tagName,
|
747 |
-
listStyle = dom.getStyle(list, 'list-style-type'),
|
748 |
-
attrs = {},
|
749 |
-
wrapList;
|
750 |
-
if (listStyle !== '') {
|
751 |
-
attrs.style = 'list-style-type: ' + listStyle + ';';
|
752 |
-
}
|
753 |
-
wrapList = dom.create(listType, attrs);
|
754 |
-
wrapItem.appendChild(wrapList);
|
755 |
-
return wrapList;
|
756 |
-
}
|
757 |
-
|
758 |
-
function indentLI(element) {
|
759 |
-
if (!hasParentInList(ed, element, indented)) {
|
760 |
-
element = splitNestedLists(element, dom);
|
761 |
-
var wrapList = createWrapList(element);
|
762 |
-
wrapList.appendChild(element);
|
763 |
-
attemptMergeWithAdjacent(wrapList.parentNode, false);
|
764 |
-
attemptMergeWithAdjacent(wrapList, false);
|
765 |
-
indented.push(element);
|
766 |
-
}
|
767 |
-
}
|
768 |
-
|
769 |
-
this.process({
|
770 |
-
'LI': indentLI,
|
771 |
-
defaultAction: this.adjustPaddingFunction(true),
|
772 |
-
elements: this.selectedBlocks()
|
773 |
-
});
|
774 |
-
|
775 |
-
},
|
776 |
-
|
777 |
-
outdent: function(ui, elements) {
|
778 |
-
var t = this, ed = t.ed, dom = ed.dom, outdented = [];
|
779 |
-
|
780 |
-
function outdentLI(element) {
|
781 |
-
var listElement, targetParent, align;
|
782 |
-
if (!hasParentInList(ed, element, outdented)) {
|
783 |
-
if (dom.getStyle(element, 'margin-left') !== '' || dom.getStyle(element, 'padding-left') !== '') {
|
784 |
-
return t.adjustPaddingFunction(false)(element);
|
785 |
-
}
|
786 |
-
align = dom.getStyle(element, 'text-align', true);
|
787 |
-
if (align === 'center' || align === 'right') {
|
788 |
-
dom.setStyle(element, 'text-align', 'left');
|
789 |
-
return;
|
790 |
-
}
|
791 |
-
element = splitNestedLists(element, dom);
|
792 |
-
listElement = element.parentNode;
|
793 |
-
targetParent = element.parentNode.parentNode;
|
794 |
-
if (targetParent.tagName === 'P') {
|
795 |
-
dom.split(targetParent, element.parentNode);
|
796 |
-
} else {
|
797 |
-
dom.split(listElement, element);
|
798 |
-
if (targetParent.tagName === 'LI') {
|
799 |
-
// Nested list, need to split the LI and go back out to the OL/UL element.
|
800 |
-
dom.split(targetParent, element);
|
801 |
-
} else if (!dom.is(targetParent, 'ol,ul')) {
|
802 |
-
dom.rename(element, 'p');
|
803 |
-
}
|
804 |
-
}
|
805 |
-
outdented.push(element);
|
806 |
-
}
|
807 |
-
}
|
808 |
-
|
809 |
-
var listElements = elements && tinymce.is(elements, 'array') ? elements : this.selectedBlocks();
|
810 |
-
this.process({
|
811 |
-
'LI': outdentLI,
|
812 |
-
defaultAction: this.adjustPaddingFunction(false),
|
813 |
-
elements: listElements
|
814 |
-
});
|
815 |
-
|
816 |
-
each(outdented, attemptMergeWithAdjacent);
|
817 |
-
},
|
818 |
-
|
819 |
-
process: function(actions) {
|
820 |
-
var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r;
|
821 |
-
|
822 |
-
function isEmptyElement(element) {
|
823 |
-
var excludeBrsAndBookmarks = tinymce.grep(element.childNodes, function(n) {
|
824 |
-
return !(n.nodeName === 'BR' || n.nodeName === 'SPAN' && dom.getAttrib(n, 'data-mce-type') == 'bookmark'
|
825 |
-
|| n.nodeType == 3 && (n.nodeValue == String.fromCharCode(160) || n.nodeValue == ''));
|
826 |
-
});
|
827 |
-
return excludeBrsAndBookmarks.length === 0;
|
828 |
-
}
|
829 |
-
|
830 |
-
function processElement(element) {
|
831 |
-
dom.removeClass(element, '_mce_act_on');
|
832 |
-
if (!element || element.nodeType !== 1 || ! actions.processEvenIfEmpty && selectedBlocks.length > 1 && isEmptyElement(element)) {
|
833 |
-
return;
|
834 |
-
}
|
835 |
-
element = findItemToOperateOn(element, dom);
|
836 |
-
var action = actions[element.tagName];
|
837 |
-
if (!action) {
|
838 |
-
action = actions.defaultAction;
|
839 |
-
}
|
840 |
-
action(element);
|
841 |
-
}
|
842 |
-
|
843 |
-
function recurse(element) {
|
844 |
-
t.splitSafeEach(element.childNodes, processElement, true);
|
845 |
-
}
|
846 |
-
|
847 |
-
function brAtEdgeOfSelection(container, offset) {
|
848 |
-
return offset >= 0 && container.hasChildNodes() && offset < container.childNodes.length &&
|
849 |
-
container.childNodes[offset].tagName === 'BR';
|
850 |
-
}
|
851 |
-
|
852 |
-
function isInTable() {
|
853 |
-
var n = sel.getNode();
|
854 |
-
var p = dom.getParent(n, 'td');
|
855 |
-
return p !== null;
|
856 |
-
}
|
857 |
-
|
858 |
-
selectedBlocks = actions.elements;
|
859 |
-
|
860 |
-
r = sel.getRng(true);
|
861 |
-
if (!r.collapsed) {
|
862 |
-
if (brAtEdgeOfSelection(r.endContainer, r.endOffset - 1)) {
|
863 |
-
r.setEnd(r.endContainer, r.endOffset - 1);
|
864 |
-
sel.setRng(r);
|
865 |
-
}
|
866 |
-
if (brAtEdgeOfSelection(r.startContainer, r.startOffset)) {
|
867 |
-
r.setStart(r.startContainer, r.startOffset + 1);
|
868 |
-
sel.setRng(r);
|
869 |
-
}
|
870 |
-
}
|
871 |
-
|
872 |
-
|
873 |
-
if (tinymce.isIE8) {
|
874 |
-
// append a zero sized nbsp so that caret is restored correctly using bookmark
|
875 |
-
var s = t.ed.selection.getNode();
|
876 |
-
if (s.tagName === 'LI' && !(s.parentNode.lastChild === s)) {
|
877 |
-
var i = t.ed.getDoc().createTextNode('\uFEFF');
|
878 |
-
s.appendChild(i);
|
879 |
-
}
|
880 |
-
}
|
881 |
-
|
882 |
-
bookmark = sel.getBookmark();
|
883 |
-
actions.OL = actions.UL = recurse;
|
884 |
-
t.splitSafeEach(selectedBlocks, processElement);
|
885 |
-
sel.moveToBookmark(bookmark);
|
886 |
-
bookmark = null;
|
887 |
-
|
888 |
-
// we avoid doing repaint in a table as this will move the caret out of the table in Firefox 3.6
|
889 |
-
if (!isInTable()) {
|
890 |
-
// Avoids table or image handles being left behind in Firefox.
|
891 |
-
t.ed.execCommand('mceRepaint');
|
892 |
-
}
|
893 |
-
},
|
894 |
-
|
895 |
-
splitSafeEach: function(elements, f, forceClassBase) {
|
896 |
-
if (forceClassBase ||
|
897 |
-
(tinymce.isGecko &&
|
898 |
-
(/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) ||
|
899 |
-
/Firefox\/3\.[0-4]/.test(navigator.userAgent)))) {
|
900 |
-
this.classBasedEach(elements, f);
|
901 |
-
} else {
|
902 |
-
each(elements, f);
|
903 |
-
}
|
904 |
-
},
|
905 |
-
|
906 |
-
classBasedEach: function(elements, f) {
|
907 |
-
var dom = this.ed.dom, nodes, element;
|
908 |
-
// Mark nodes
|
909 |
-
each(elements, function(element) {
|
910 |
-
dom.addClass(element, '_mce_act_on');
|
911 |
-
});
|
912 |
-
nodes = dom.select('._mce_act_on');
|
913 |
-
while (nodes.length > 0) {
|
914 |
-
element = nodes.shift();
|
915 |
-
dom.removeClass(element, '_mce_act_on');
|
916 |
-
f(element);
|
917 |
-
nodes = dom.select('._mce_act_on');
|
918 |
-
}
|
919 |
-
},
|
920 |
-
|
921 |
-
adjustPaddingFunction: function(isIndent) {
|
922 |
-
var indentAmount, indentUnits, ed = this.ed;
|
923 |
-
indentAmount = ed.settings.indentation;
|
924 |
-
indentUnits = /[a-z%]+/i.exec(indentAmount);
|
925 |
-
indentAmount = parseInt(indentAmount, 10);
|
926 |
-
return function(element) {
|
927 |
-
var currentIndent, newIndentAmount;
|
928 |
-
currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10);
|
929 |
-
if (isIndent) {
|
930 |
-
newIndentAmount = currentIndent + indentAmount;
|
931 |
-
} else {
|
932 |
-
newIndentAmount = currentIndent - indentAmount;
|
933 |
-
}
|
934 |
-
ed.dom.setStyle(element, 'padding-left', '');
|
935 |
-
ed.dom.setStyle(element, 'margin-left', newIndentAmount > 0 ? newIndentAmount + indentUnits : '');
|
936 |
-
};
|
937 |
-
},
|
938 |
-
|
939 |
-
selectedBlocks: function() {
|
940 |
-
var ed = this.ed, selectedBlocks = ed.selection.getSelectedBlocks();
|
941 |
-
return selectedBlocks.length == 0 ? [ ed.dom.getRoot() ] : selectedBlocks;
|
942 |
-
},
|
943 |
-
|
944 |
-
getInfo: function() {
|
945 |
-
return {
|
946 |
-
longname : 'Lists',
|
947 |
-
author : 'Moxiecode Systems AB',
|
948 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
949 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists',
|
950 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
951 |
-
};
|
952 |
-
}
|
953 |
-
});
|
954 |
-
tinymce.PluginManager.add("lists", tinymce.plugins.Lists);
|
955 |
-
}());
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2011, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
var each = tinymce.each, Event = tinymce.dom.Event, bookmark;
|
13 |
+
|
14 |
+
// Skips text nodes that only contain whitespace since they aren't semantically important.
|
15 |
+
function skipWhitespaceNodes(e, next) {
|
16 |
+
while (e && (e.nodeType === 8 || (e.nodeType === 3 && /^[ \t\n\r]*$/.test(e.nodeValue)))) {
|
17 |
+
e = next(e);
|
18 |
+
}
|
19 |
+
return e;
|
20 |
+
}
|
21 |
+
|
22 |
+
function skipWhitespaceNodesBackwards(e) {
|
23 |
+
return skipWhitespaceNodes(e, function(e) {
|
24 |
+
return e.previousSibling;
|
25 |
+
});
|
26 |
+
}
|
27 |
+
|
28 |
+
function skipWhitespaceNodesForwards(e) {
|
29 |
+
return skipWhitespaceNodes(e, function(e) {
|
30 |
+
return e.nextSibling;
|
31 |
+
});
|
32 |
+
}
|
33 |
+
|
34 |
+
function hasParentInList(ed, e, list) {
|
35 |
+
return ed.dom.getParent(e, function(p) {
|
36 |
+
return tinymce.inArray(list, p) !== -1;
|
37 |
+
});
|
38 |
+
}
|
39 |
+
|
40 |
+
function isList(e) {
|
41 |
+
return e && (e.tagName === 'OL' || e.tagName === 'UL');
|
42 |
+
}
|
43 |
+
|
44 |
+
function splitNestedLists(element, dom) {
|
45 |
+
var tmp, nested, wrapItem;
|
46 |
+
tmp = skipWhitespaceNodesBackwards(element.lastChild);
|
47 |
+
while (isList(tmp)) {
|
48 |
+
nested = tmp;
|
49 |
+
tmp = skipWhitespaceNodesBackwards(nested.previousSibling);
|
50 |
+
}
|
51 |
+
if (nested) {
|
52 |
+
wrapItem = dom.create('li', { style: 'list-style-type: none;'});
|
53 |
+
dom.split(element, nested);
|
54 |
+
dom.insertAfter(wrapItem, nested);
|
55 |
+
wrapItem.appendChild(nested);
|
56 |
+
wrapItem.appendChild(nested);
|
57 |
+
element = wrapItem.previousSibling;
|
58 |
+
}
|
59 |
+
return element;
|
60 |
+
}
|
61 |
+
|
62 |
+
function attemptMergeWithAdjacent(e, allowDifferentListStyles, mergeParagraphs) {
|
63 |
+
e = attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs);
|
64 |
+
return attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs);
|
65 |
+
}
|
66 |
+
|
67 |
+
function attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs) {
|
68 |
+
var prev = skipWhitespaceNodesBackwards(e.previousSibling);
|
69 |
+
if (prev) {
|
70 |
+
return attemptMerge(prev, e, allowDifferentListStyles ? prev : false, mergeParagraphs);
|
71 |
+
} else {
|
72 |
+
return e;
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
+
function attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs) {
|
77 |
+
var next = skipWhitespaceNodesForwards(e.nextSibling);
|
78 |
+
if (next) {
|
79 |
+
return attemptMerge(e, next, allowDifferentListStyles ? next : false, mergeParagraphs);
|
80 |
+
} else {
|
81 |
+
return e;
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
+
function attemptMerge(e1, e2, differentStylesMasterElement, mergeParagraphs) {
|
86 |
+
if (canMerge(e1, e2, !!differentStylesMasterElement, mergeParagraphs)) {
|
87 |
+
return merge(e1, e2, differentStylesMasterElement);
|
88 |
+
} else if (e1 && e1.tagName === 'LI' && isList(e2)) {
|
89 |
+
// Fix invalidly nested lists.
|
90 |
+
e1.appendChild(e2);
|
91 |
+
}
|
92 |
+
return e2;
|
93 |
+
}
|
94 |
+
|
95 |
+
function canMerge(e1, e2, allowDifferentListStyles, mergeParagraphs) {
|
96 |
+
if (!e1 || !e2) {
|
97 |
+
return false;
|
98 |
+
} else if (e1.tagName === 'LI' && e2.tagName === 'LI') {
|
99 |
+
return e2.style.listStyleType === 'none' || containsOnlyAList(e2);
|
100 |
+
} else if (isList(e1)) {
|
101 |
+
return (e1.tagName === e2.tagName && (allowDifferentListStyles || e1.style.listStyleType === e2.style.listStyleType)) || isListForIndent(e2);
|
102 |
+
} else return mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P';
|
103 |
+
}
|
104 |
+
|
105 |
+
function isListForIndent(e) {
|
106 |
+
var firstLI = skipWhitespaceNodesForwards(e.firstChild), lastLI = skipWhitespaceNodesBackwards(e.lastChild);
|
107 |
+
return firstLI && lastLI && isList(e) && firstLI === lastLI && (isList(firstLI) || firstLI.style.listStyleType === 'none' || containsOnlyAList(firstLI));
|
108 |
+
}
|
109 |
+
|
110 |
+
function containsOnlyAList(e) {
|
111 |
+
var firstChild = skipWhitespaceNodesForwards(e.firstChild), lastChild = skipWhitespaceNodesBackwards(e.lastChild);
|
112 |
+
return firstChild && lastChild && firstChild === lastChild && isList(firstChild);
|
113 |
+
}
|
114 |
+
|
115 |
+
function merge(e1, e2, masterElement) {
|
116 |
+
var lastOriginal = skipWhitespaceNodesBackwards(e1.lastChild), firstNew = skipWhitespaceNodesForwards(e2.firstChild);
|
117 |
+
if (e1.tagName === 'P') {
|
118 |
+
e1.appendChild(e1.ownerDocument.createElement('br'));
|
119 |
+
}
|
120 |
+
while (e2.firstChild) {
|
121 |
+
e1.appendChild(e2.firstChild);
|
122 |
+
}
|
123 |
+
if (masterElement) {
|
124 |
+
e1.style.listStyleType = masterElement.style.listStyleType;
|
125 |
+
}
|
126 |
+
e2.parentNode.removeChild(e2);
|
127 |
+
attemptMerge(lastOriginal, firstNew, false);
|
128 |
+
return e1;
|
129 |
+
}
|
130 |
+
|
131 |
+
function findItemToOperateOn(e, dom) {
|
132 |
+
var item;
|
133 |
+
if (!dom.is(e, 'li,ol,ul')) {
|
134 |
+
item = dom.getParent(e, 'li');
|
135 |
+
if (item) {
|
136 |
+
e = item;
|
137 |
+
}
|
138 |
+
}
|
139 |
+
return e;
|
140 |
+
}
|
141 |
+
|
142 |
+
tinymce.create('tinymce.plugins.Lists', {
|
143 |
+
init: function(ed) {
|
144 |
+
var LIST_TABBING = 'TABBING';
|
145 |
+
var LIST_EMPTY_ITEM = 'EMPTY';
|
146 |
+
var LIST_ESCAPE = 'ESCAPE';
|
147 |
+
var LIST_PARAGRAPH = 'PARAGRAPH';
|
148 |
+
var LIST_UNKNOWN = 'UNKNOWN';
|
149 |
+
var state = LIST_UNKNOWN;
|
150 |
+
|
151 |
+
function isTabInList(e) {
|
152 |
+
// Don't indent on Ctrl+Tab or Alt+Tab
|
153 |
+
return e.keyCode === tinymce.VK.TAB && !(e.altKey || e.ctrlKey) &&
|
154 |
+
(ed.queryCommandState('InsertUnorderedList') || ed.queryCommandState('InsertOrderedList'));
|
155 |
+
}
|
156 |
+
|
157 |
+
function isOnLastListItem() {
|
158 |
+
var li = getLi();
|
159 |
+
var grandParent = li.parentNode.parentNode;
|
160 |
+
var isLastItem = li.parentNode.lastChild === li;
|
161 |
+
return isLastItem && !isNestedList(grandParent) && isEmptyListItem(li);
|
162 |
+
}
|
163 |
+
|
164 |
+
function isNestedList(grandParent) {
|
165 |
+
if (isList(grandParent)) {
|
166 |
+
return grandParent.parentNode && grandParent.parentNode.tagName === 'LI';
|
167 |
+
} else {
|
168 |
+
return grandParent.tagName === 'LI';
|
169 |
+
}
|
170 |
+
}
|
171 |
+
|
172 |
+
function isInEmptyListItem() {
|
173 |
+
return ed.selection.isCollapsed() && isEmptyListItem(getLi());
|
174 |
+
}
|
175 |
+
|
176 |
+
function getLi() {
|
177 |
+
var n = ed.selection.getStart();
|
178 |
+
// Get start will return BR if the LI only contains a BR or an empty element as we use these to fix caret position
|
179 |
+
return ((n.tagName == 'BR' || n.tagName == '') && n.parentNode.tagName == 'LI') ? n.parentNode : n;
|
180 |
+
}
|
181 |
+
|
182 |
+
function isEmptyListItem(li) {
|
183 |
+
var numChildren = li.childNodes.length;
|
184 |
+
if (li.tagName === 'LI') {
|
185 |
+
return numChildren == 0 ? true : numChildren == 1 && (li.firstChild.tagName == '' || li.firstChild.tagName == 'BR' || isEmptyIE9Li(li));
|
186 |
+
}
|
187 |
+
return false;
|
188 |
+
}
|
189 |
+
|
190 |
+
function isEmptyIE9Li(li) {
|
191 |
+
// only consider this to be last item if there is no list item content or that content is nbsp or space since IE9 creates these
|
192 |
+
var lis = tinymce.grep(li.parentNode.childNodes, function(n) {return n.tagName == 'LI'});
|
193 |
+
var isLastLi = li == lis[lis.length - 1];
|
194 |
+
var child = li.firstChild;
|
195 |
+
return tinymce.isIE9 && isLastLi && (child.nodeValue == String.fromCharCode(160) || child.nodeValue == String.fromCharCode(32));
|
196 |
+
}
|
197 |
+
|
198 |
+
function isEnter(e) {
|
199 |
+
return e.keyCode === tinymce.VK.ENTER;
|
200 |
+
}
|
201 |
+
|
202 |
+
function isEnterWithoutShift(e) {
|
203 |
+
return isEnter(e) && !e.shiftKey;
|
204 |
+
}
|
205 |
+
|
206 |
+
function getListKeyState(e) {
|
207 |
+
if (isTabInList(e)) {
|
208 |
+
return LIST_TABBING;
|
209 |
+
} else if (isEnterWithoutShift(e) && isOnLastListItem()) {
|
210 |
+
// Returns LIST_UNKNOWN since breaking out of lists is handled by the EnterKey.js logic now
|
211 |
+
//return LIST_ESCAPE;
|
212 |
+
return LIST_UNKNOWN;
|
213 |
+
} else if (isEnterWithoutShift(e) && isInEmptyListItem()) {
|
214 |
+
return LIST_EMPTY_ITEM;
|
215 |
+
} else {
|
216 |
+
return LIST_UNKNOWN;
|
217 |
+
}
|
218 |
+
}
|
219 |
+
|
220 |
+
function cancelDefaultEvents(ed, e) {
|
221 |
+
// list escape is done manually using outdent as it does not create paragraphs correctly in td's
|
222 |
+
if (state == LIST_TABBING || state == LIST_EMPTY_ITEM || tinymce.isGecko && state == LIST_ESCAPE) {
|
223 |
+
Event.cancel(e);
|
224 |
+
}
|
225 |
+
}
|
226 |
+
|
227 |
+
function isCursorAtEndOfContainer() {
|
228 |
+
var range = ed.selection.getRng(true);
|
229 |
+
var startContainer = range.startContainer;
|
230 |
+
if (startContainer.nodeType == 3) {
|
231 |
+
var value = startContainer.nodeValue;
|
232 |
+
if (tinymce.isIE9 && value.length > 1 && value.charCodeAt(value.length-1) == 32) {
|
233 |
+
// IE9 places a space on the end of the text in some cases so ignore last char
|
234 |
+
return (range.endOffset == value.length-1);
|
235 |
+
} else {
|
236 |
+
return (range.endOffset == value.length);
|
237 |
+
}
|
238 |
+
} else if (startContainer.nodeType == 1) {
|
239 |
+
return range.endOffset == startContainer.childNodes.length;
|
240 |
+
}
|
241 |
+
return false;
|
242 |
+
}
|
243 |
+
|
244 |
+
/*
|
245 |
+
If we are at the end of a list item surrounded with an element, pressing enter should create a
|
246 |
+
new list item instead without splitting the element e.g. don't want to create new P or H1 tag
|
247 |
+
*/
|
248 |
+
function isEndOfListItem() {
|
249 |
+
var node = ed.selection.getNode();
|
250 |
+
var validElements = 'h1,h2,h3,h4,h5,h6,p,div';
|
251 |
+
var isLastParagraphOfLi = ed.dom.is(node, validElements) && node.parentNode.tagName === 'LI' && node.parentNode.lastChild === node;
|
252 |
+
return ed.selection.isCollapsed() && isLastParagraphOfLi && isCursorAtEndOfContainer();
|
253 |
+
}
|
254 |
+
|
255 |
+
// Creates a new list item after the current selection's list item parent
|
256 |
+
function createNewLi(ed, e) {
|
257 |
+
if (isEnterWithoutShift(e) && isEndOfListItem()) {
|
258 |
+
var node = ed.selection.getNode();
|
259 |
+
var li = ed.dom.create("li");
|
260 |
+
var parentLi = ed.dom.getParent(node, 'li');
|
261 |
+
ed.dom.insertAfter(li, parentLi);
|
262 |
+
|
263 |
+
// Move caret to new list element.
|
264 |
+
if (tinymce.isIE6 || tinymce.isIE7 || tinyMCE.isIE8) {
|
265 |
+
// Removed this line since it would create an odd < > tag and placing the caret inside an empty LI is handled and should be handled by the selection logic
|
266 |
+
//li.appendChild(ed.dom.create(" ")); // IE needs an element within the bullet point
|
267 |
+
ed.selection.setCursorLocation(li, 1);
|
268 |
+
} else {
|
269 |
+
ed.selection.setCursorLocation(li, 0);
|
270 |
+
}
|
271 |
+
e.preventDefault();
|
272 |
+
}
|
273 |
+
}
|
274 |
+
|
275 |
+
function imageJoiningListItem(ed, e) {
|
276 |
+
var prevSibling;
|
277 |
+
|
278 |
+
if (!tinymce.isGecko)
|
279 |
+
return;
|
280 |
+
|
281 |
+
var n = ed.selection.getStart();
|
282 |
+
if (e.keyCode != tinymce.VK.BACKSPACE || n.tagName !== 'IMG')
|
283 |
+
return;
|
284 |
+
|
285 |
+
function lastLI(node) {
|
286 |
+
var child = node.firstChild;
|
287 |
+
var li = null;
|
288 |
+
do {
|
289 |
+
if (!child)
|
290 |
+
break;
|
291 |
+
|
292 |
+
if (child.tagName === 'LI')
|
293 |
+
li = child;
|
294 |
+
} while (child = child.nextSibling);
|
295 |
+
|
296 |
+
return li;
|
297 |
+
}
|
298 |
+
|
299 |
+
function addChildren(parentNode, destination) {
|
300 |
+
while (parentNode.childNodes.length > 0)
|
301 |
+
destination.appendChild(parentNode.childNodes[0]);
|
302 |
+
}
|
303 |
+
|
304 |
+
// Check if there is a previous sibling
|
305 |
+
prevSibling = n.parentNode.previousSibling;
|
306 |
+
if (!prevSibling)
|
307 |
+
return;
|
308 |
+
|
309 |
+
var ul;
|
310 |
+
if (prevSibling.tagName === 'UL' || prevSibling.tagName === 'OL')
|
311 |
+
ul = prevSibling;
|
312 |
+
else if (prevSibling.previousSibling && (prevSibling.previousSibling.tagName === 'UL' || prevSibling.previousSibling.tagName === 'OL'))
|
313 |
+
ul = prevSibling.previousSibling;
|
314 |
+
else
|
315 |
+
return;
|
316 |
+
|
317 |
+
var li = lastLI(ul);
|
318 |
+
|
319 |
+
// move the caret to the end of the list item
|
320 |
+
var rng = ed.dom.createRng();
|
321 |
+
rng.setStart(li, 1);
|
322 |
+
rng.setEnd(li, 1);
|
323 |
+
ed.selection.setRng(rng);
|
324 |
+
ed.selection.collapse(true);
|
325 |
+
|
326 |
+
// save a bookmark at the end of the list item
|
327 |
+
var bookmark = ed.selection.getBookmark();
|
328 |
+
|
329 |
+
// copy the image an its text to the list item
|
330 |
+
var clone = n.parentNode.cloneNode(true);
|
331 |
+
if (clone.tagName === 'P' || clone.tagName === 'DIV')
|
332 |
+
addChildren(clone, li);
|
333 |
+
else
|
334 |
+
li.appendChild(clone);
|
335 |
+
|
336 |
+
// remove the old copy of the image
|
337 |
+
n.parentNode.parentNode.removeChild(n.parentNode);
|
338 |
+
|
339 |
+
// move the caret where we saved the bookmark
|
340 |
+
ed.selection.moveToBookmark(bookmark);
|
341 |
+
}
|
342 |
+
|
343 |
+
// fix the cursor position to ensure it is correct in IE
|
344 |
+
function setCursorPositionToOriginalLi(li) {
|
345 |
+
var list = ed.dom.getParent(li, 'ol,ul');
|
346 |
+
if (list != null) {
|
347 |
+
var lastLi = list.lastChild;
|
348 |
+
// Removed this line since IE9 would report an DOM character error and placing the caret inside an empty LI is handled and should be handled by the selection logic
|
349 |
+
//lastLi.appendChild(ed.getDoc().createElement(''));
|
350 |
+
ed.selection.setCursorLocation(lastLi, 0);
|
351 |
+
}
|
352 |
+
}
|
353 |
+
|
354 |
+
this.ed = ed;
|
355 |
+
ed.addCommand('Indent', this.indent, this);
|
356 |
+
ed.addCommand('Outdent', this.outdent, this);
|
357 |
+
ed.addCommand('InsertUnorderedList', function() {
|
358 |
+
this.applyList('UL', 'OL');
|
359 |
+
}, this);
|
360 |
+
ed.addCommand('InsertOrderedList', function() {
|
361 |
+
this.applyList('OL', 'UL');
|
362 |
+
}, this);
|
363 |
+
|
364 |
+
ed.onInit.add(function() {
|
365 |
+
ed.editorCommands.addCommands({
|
366 |
+
'outdent': function() {
|
367 |
+
var sel = ed.selection, dom = ed.dom;
|
368 |
+
|
369 |
+
function hasStyleIndent(n) {
|
370 |
+
n = dom.getParent(n, dom.isBlock);
|
371 |
+
return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0;
|
372 |
+
}
|
373 |
+
|
374 |
+
return hasStyleIndent(sel.getStart()) || hasStyleIndent(sel.getEnd()) || ed.queryCommandState('InsertOrderedList') || ed.queryCommandState('InsertUnorderedList');
|
375 |
+
}
|
376 |
+
}, 'state');
|
377 |
+
});
|
378 |
+
|
379 |
+
ed.onKeyUp.add(function(ed, e) {
|
380 |
+
if (state == LIST_TABBING) {
|
381 |
+
ed.execCommand(e.shiftKey ? 'Outdent' : 'Indent', true, null);
|
382 |
+
state = LIST_UNKNOWN;
|
383 |
+
return Event.cancel(e);
|
384 |
+
} else if (state == LIST_EMPTY_ITEM) {
|
385 |
+
var li = getLi();
|
386 |
+
var shouldOutdent = ed.settings.list_outdent_on_enter === true || e.shiftKey;
|
387 |
+
ed.execCommand(shouldOutdent ? 'Outdent' : 'Indent', true, null);
|
388 |
+
if (tinymce.isIE) {
|
389 |
+
setCursorPositionToOriginalLi(li);
|
390 |
+
}
|
391 |
+
|
392 |
+
return Event.cancel(e);
|
393 |
+
} else if (state == LIST_ESCAPE) {
|
394 |
+
if (tinymce.isIE6 || tinymce.isIE7 || tinymce.isIE8) {
|
395 |
+
// append a zero sized nbsp so that caret is positioned correctly in IE after escaping and applying formatting.
|
396 |
+
// if there is no text then applying formatting for e.g a H1 to the P tag immediately following list after
|
397 |
+
// escaping from it will cause the caret to be positioned on the last li instead of staying the in P tag.
|
398 |
+
var n = ed.getDoc().createTextNode('\uFEFF');
|
399 |
+
ed.selection.getNode().appendChild(n);
|
400 |
+
} else if (tinymce.isIE9 || tinymce.isGecko) {
|
401 |
+
// IE9 does not escape the list so we use outdent to do this and cancel the default behaviour
|
402 |
+
// Gecko does not create a paragraph outdenting inside a TD so default behaviour is cancelled and we outdent ourselves
|
403 |
+
ed.execCommand('Outdent');
|
404 |
+
return Event.cancel(e);
|
405 |
+
}
|
406 |
+
}
|
407 |
+
});
|
408 |
+
|
409 |
+
function fixListItem(parent, reference) {
|
410 |
+
// a zero-sized non-breaking space is placed in the empty list item so that the nested list is
|
411 |
+
// displayed on the below line instead of next to it
|
412 |
+
var n = ed.getDoc().createTextNode('\uFEFF');
|
413 |
+
parent.insertBefore(n, reference);
|
414 |
+
ed.selection.setCursorLocation(n, 0);
|
415 |
+
// repaint to remove rendering artifact. only visible when creating new list
|
416 |
+
ed.execCommand('mceRepaint');
|
417 |
+
}
|
418 |
+
|
419 |
+
function fixIndentedListItemForGecko(ed, e) {
|
420 |
+
if (isEnter(e)) {
|
421 |
+
var li = getLi();
|
422 |
+
if (li) {
|
423 |
+
var parent = li.parentNode;
|
424 |
+
var grandParent = parent && parent.parentNode;
|
425 |
+
if (grandParent && grandParent.nodeName == 'LI' && grandParent.firstChild == parent && li == parent.firstChild) {
|
426 |
+
fixListItem(grandParent, parent);
|
427 |
+
}
|
428 |
+
}
|
429 |
+
}
|
430 |
+
}
|
431 |
+
|
432 |
+
function fixIndentedListItemForIE8(ed, e) {
|
433 |
+
if (isEnter(e)) {
|
434 |
+
var li = getLi();
|
435 |
+
if (ed.dom.select('ul li', li).length === 1) {
|
436 |
+
var list = li.firstChild;
|
437 |
+
fixListItem(li, list);
|
438 |
+
}
|
439 |
+
}
|
440 |
+
}
|
441 |
+
|
442 |
+
function fixDeletingFirstCharOfList(ed, e) {
|
443 |
+
function listElements(li) {
|
444 |
+
var elements = [];
|
445 |
+
var walker = new tinymce.dom.TreeWalker(li.firstChild, li);
|
446 |
+
for (var node = walker.current(); node; node = walker.next()) {
|
447 |
+
if (ed.dom.is(node, 'ol,ul,li')) {
|
448 |
+
elements.push(node);
|
449 |
+
}
|
450 |
+
}
|
451 |
+
return elements;
|
452 |
+
}
|
453 |
+
|
454 |
+
if (e.keyCode == tinymce.VK.BACKSPACE) {
|
455 |
+
var li = getLi();
|
456 |
+
if (li) {
|
457 |
+
var list = ed.dom.getParent(li, 'ol,ul'),
|
458 |
+
rng = ed.selection.getRng();
|
459 |
+
if (list && list.firstChild === li && rng.startOffset == 0) {
|
460 |
+
var elements = listElements(li);
|
461 |
+
elements.unshift(li);
|
462 |
+
ed.execCommand("Outdent", false, elements);
|
463 |
+
ed.undoManager.add();
|
464 |
+
return Event.cancel(e);
|
465 |
+
}
|
466 |
+
}
|
467 |
+
}
|
468 |
+
}
|
469 |
+
|
470 |
+
function fixDeletingEmptyLiInWebkit(ed, e) {
|
471 |
+
var li = getLi();
|
472 |
+
if (e.keyCode === tinymce.VK.BACKSPACE && ed.dom.is(li, 'li') && li.parentNode.firstChild!==li) {
|
473 |
+
if (ed.dom.select('ul,ol', li).length === 1) {
|
474 |
+
var prevLi = li.previousSibling;
|
475 |
+
ed.dom.remove(ed.dom.select('br', li));
|
476 |
+
ed.dom.remove(li, true);
|
477 |
+
var textNodes = tinymce.grep(prevLi.childNodes, function(n){ return n.nodeType === 3 });
|
478 |
+
if (textNodes.length === 1) {
|
479 |
+
var textNode = textNodes[0];
|
480 |
+
ed.selection.setCursorLocation(textNode, textNode.length);
|
481 |
+
}
|
482 |
+
ed.undoManager.add();
|
483 |
+
return Event.cancel(e);
|
484 |
+
}
|
485 |
+
}
|
486 |
+
}
|
487 |
+
|
488 |
+
ed.onKeyDown.add(function(_, e) { state = getListKeyState(e); });
|
489 |
+
ed.onKeyDown.add(cancelDefaultEvents);
|
490 |
+
ed.onKeyDown.add(imageJoiningListItem);
|
491 |
+
ed.onKeyDown.add(createNewLi);
|
492 |
+
|
493 |
+
if (tinymce.isGecko) {
|
494 |
+
ed.onKeyUp.add(fixIndentedListItemForGecko);
|
495 |
+
}
|
496 |
+
if (tinymce.isIE8) {
|
497 |
+
ed.onKeyUp.add(fixIndentedListItemForIE8);
|
498 |
+
}
|
499 |
+
if (tinymce.isGecko || tinymce.isWebKit) {
|
500 |
+
ed.onKeyDown.add(fixDeletingFirstCharOfList);
|
501 |
+
}
|
502 |
+
if (tinymce.isWebKit) {
|
503 |
+
ed.onKeyDown.add(fixDeletingEmptyLiInWebkit);
|
504 |
+
}
|
505 |
+
},
|
506 |
+
|
507 |
+
applyList: function(targetListType, oppositeListType) {
|
508 |
+
var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions,
|
509 |
+
selectedBlocks = ed.selection.getSelectedBlocks();
|
510 |
+
|
511 |
+
function cleanupBr(e) {
|
512 |
+
if (e && e.tagName === 'BR') {
|
513 |
+
dom.remove(e);
|
514 |
+
}
|
515 |
+
}
|
516 |
+
|
517 |
+
function makeList(element) {
|
518 |
+
var list = dom.create(targetListType), li;
|
519 |
+
|
520 |
+
function adjustIndentForNewList(element) {
|
521 |
+
// If there's a margin-left, outdent one level to account for the extra list margin.
|
522 |
+
if (element.style.marginLeft || element.style.paddingLeft) {
|
523 |
+
t.adjustPaddingFunction(false)(element);
|
524 |
+
}
|
525 |
+
}
|
526 |
+
|
527 |
+
if (element.tagName === 'LI') {
|
528 |
+
// No change required.
|
529 |
+
} else if (element.tagName === 'P' || element.tagName === 'DIV' || element.tagName === 'BODY') {
|
530 |
+
processBrs(element, function(startSection, br) {
|
531 |
+
doWrapList(startSection, br, element.tagName === 'BODY' ? null : startSection.parentNode);
|
532 |
+
li = startSection.parentNode;
|
533 |
+
adjustIndentForNewList(li);
|
534 |
+
cleanupBr(br);
|
535 |
+
});
|
536 |
+
if (li) {
|
537 |
+
if (li.tagName === 'LI' && (element.tagName === 'P' || selectedBlocks.length > 1)) {
|
538 |
+
dom.split(li.parentNode.parentNode, li.parentNode);
|
539 |
+
}
|
540 |
+
attemptMergeWithAdjacent(li.parentNode, true);
|
541 |
+
}
|
542 |
+
return;
|
543 |
+
} else {
|
544 |
+
// Put the list around the element.
|
545 |
+
li = dom.create('li');
|
546 |
+
dom.insertAfter(li, element);
|
547 |
+
li.appendChild(element);
|
548 |
+
adjustIndentForNewList(element);
|
549 |
+
element = li;
|
550 |
+
}
|
551 |
+
dom.insertAfter(list, element);
|
552 |
+
list.appendChild(element);
|
553 |
+
attemptMergeWithAdjacent(list, true);
|
554 |
+
applied.push(element);
|
555 |
+
}
|
556 |
+
|
557 |
+
function doWrapList(start, end, template) {
|
558 |
+
var li, n = start, tmp;
|
559 |
+
while (!dom.isBlock(start.parentNode) && start.parentNode !== dom.getRoot()) {
|
560 |
+
start = dom.split(start.parentNode, start.previousSibling);
|
561 |
+
start = start.nextSibling;
|
562 |
+
n = start;
|
563 |
+
}
|
564 |
+
if (template) {
|
565 |
+
li = template.cloneNode(true);
|
566 |
+
start.parentNode.insertBefore(li, start);
|
567 |
+
while (li.firstChild) dom.remove(li.firstChild);
|
568 |
+
li = dom.rename(li, 'li');
|
569 |
+
} else {
|
570 |
+
li = dom.create('li');
|
571 |
+
start.parentNode.insertBefore(li, start);
|
572 |
+
}
|
573 |
+
while (n && n != end) {
|
574 |
+
tmp = n.nextSibling;
|
575 |
+
li.appendChild(n);
|
576 |
+
n = tmp;
|
577 |
+
}
|
578 |
+
if (li.childNodes.length === 0) {
|
579 |
+
li.innerHTML = '<br _mce_bogus="1" />';
|
580 |
+
}
|
581 |
+
makeList(li);
|
582 |
+
}
|
583 |
+
|
584 |
+
function processBrs(element, callback) {
|
585 |
+
var startSection, previousBR, END_TO_START = 3, START_TO_END = 1,
|
586 |
+
breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl';
|
587 |
+
|
588 |
+
function isAnyPartSelected(start, end) {
|
589 |
+
var r = dom.createRng(), sel;
|
590 |
+
bookmark.keep = true;
|
591 |
+
ed.selection.moveToBookmark(bookmark);
|
592 |
+
bookmark.keep = false;
|
593 |
+
sel = ed.selection.getRng(true);
|
594 |
+
if (!end) {
|
595 |
+
end = start.parentNode.lastChild;
|
596 |
+
}
|
597 |
+
r.setStartBefore(start);
|
598 |
+
r.setEndAfter(end);
|
599 |
+
return !(r.compareBoundaryPoints(END_TO_START, sel) > 0 || r.compareBoundaryPoints(START_TO_END, sel) <= 0);
|
600 |
+
}
|
601 |
+
|
602 |
+
function nextLeaf(br) {
|
603 |
+
if (br.nextSibling)
|
604 |
+
return br.nextSibling;
|
605 |
+
if (!dom.isBlock(br.parentNode) && br.parentNode !== dom.getRoot())
|
606 |
+
return nextLeaf(br.parentNode);
|
607 |
+
}
|
608 |
+
|
609 |
+
// Split on BRs within the range and process those.
|
610 |
+
startSection = element.firstChild;
|
611 |
+
// First mark the BRs that have any part of the previous section selected.
|
612 |
+
var trailingContentSelected = false;
|
613 |
+
each(dom.select(breakElements, element), function(br) {
|
614 |
+
if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
|
615 |
+
return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
|
616 |
+
}
|
617 |
+
if (isAnyPartSelected(startSection, br)) {
|
618 |
+
dom.addClass(br, '_mce_tagged_br');
|
619 |
+
startSection = nextLeaf(br);
|
620 |
+
}
|
621 |
+
});
|
622 |
+
trailingContentSelected = (startSection && isAnyPartSelected(startSection, undefined));
|
623 |
+
startSection = element.firstChild;
|
624 |
+
each(dom.select(breakElements, element), function(br) {
|
625 |
+
// Got a section from start to br.
|
626 |
+
var tmp = nextLeaf(br);
|
627 |
+
if (br.hasAttribute && br.hasAttribute('_mce_bogus')) {
|
628 |
+
return true; // Skip the bogus Brs that are put in to appease Firefox and Safari.
|
629 |
+
}
|
630 |
+
if (dom.hasClass(br, '_mce_tagged_br')) {
|
631 |
+
callback(startSection, br, previousBR);
|
632 |
+
previousBR = null;
|
633 |
+
} else {
|
634 |
+
previousBR = br;
|
635 |
+
}
|
636 |
+
startSection = tmp;
|
637 |
+
});
|
638 |
+
if (trailingContentSelected) {
|
639 |
+
callback(startSection, undefined, previousBR);
|
640 |
+
}
|
641 |
+
}
|
642 |
+
|
643 |
+
function wrapList(element) {
|
644 |
+
processBrs(element, function(startSection, br, previousBR) {
|
645 |
+
// Need to indent this part
|
646 |
+
doWrapList(startSection, br);
|
647 |
+
cleanupBr(br);
|
648 |
+
cleanupBr(previousBR);
|
649 |
+
});
|
650 |
+
}
|
651 |
+
|
652 |
+
function changeList(element) {
|
653 |
+
if (tinymce.inArray(applied, element) !== -1) {
|
654 |
+
return;
|
655 |
+
}
|
656 |
+
if (element.parentNode.tagName === oppositeListType) {
|
657 |
+
dom.split(element.parentNode, element);
|
658 |
+
makeList(element);
|
659 |
+
attemptMergeWithNext(element.parentNode, false);
|
660 |
+
}
|
661 |
+
applied.push(element);
|
662 |
+
}
|
663 |
+
|
664 |
+
function convertListItemToParagraph(element) {
|
665 |
+
var child, nextChild, mergedElement, splitLast;
|
666 |
+
if (tinymce.inArray(applied, element) !== -1) {
|
667 |
+
return;
|
668 |
+
}
|
669 |
+
element = splitNestedLists(element, dom);
|
670 |
+
while (dom.is(element.parentNode, 'ol,ul,li')) {
|
671 |
+
dom.split(element.parentNode, element);
|
672 |
+
}
|
673 |
+
// Push the original element we have from the selection, not the renamed one.
|
674 |
+
applied.push(element);
|
675 |
+
element = dom.rename(element, 'p');
|
676 |
+
mergedElement = attemptMergeWithAdjacent(element, false, ed.settings.force_br_newlines);
|
677 |
+
if (mergedElement === element) {
|
678 |
+
// Now split out any block elements that can't be contained within a P.
|
679 |
+
// Manually iterate to ensure we handle modifications correctly (doesn't work with tinymce.each)
|
680 |
+
child = element.firstChild;
|
681 |
+
while (child) {
|
682 |
+
if (dom.isBlock(child)) {
|
683 |
+
child = dom.split(child.parentNode, child);
|
684 |
+
splitLast = true;
|
685 |
+
nextChild = child.nextSibling && child.nextSibling.firstChild;
|
686 |
+
} else {
|
687 |
+
nextChild = child.nextSibling;
|
688 |
+
if (splitLast && child.tagName === 'BR') {
|
689 |
+
dom.remove(child);
|
690 |
+
}
|
691 |
+
splitLast = false;
|
692 |
+
}
|
693 |
+
child = nextChild;
|
694 |
+
}
|
695 |
+
}
|
696 |
+
}
|
697 |
+
|
698 |
+
each(selectedBlocks, function(e) {
|
699 |
+
e = findItemToOperateOn(e, dom);
|
700 |
+
if (e.tagName === oppositeListType || (e.tagName === 'LI' && e.parentNode.tagName === oppositeListType)) {
|
701 |
+
hasOppositeType = true;
|
702 |
+
} else if (e.tagName === targetListType || (e.tagName === 'LI' && e.parentNode.tagName === targetListType)) {
|
703 |
+
hasSameType = true;
|
704 |
+
} else {
|
705 |
+
hasNonList = true;
|
706 |
+
}
|
707 |
+
});
|
708 |
+
|
709 |
+
if (hasNonList &&!hasSameType || hasOppositeType || selectedBlocks.length === 0) {
|
710 |
+
actions = {
|
711 |
+
'LI': changeList,
|
712 |
+
'H1': makeList,
|
713 |
+
'H2': makeList,
|
714 |
+
'H3': makeList,
|
715 |
+
'H4': makeList,
|
716 |
+
'H5': makeList,
|
717 |
+
'H6': makeList,
|
718 |
+
'P': makeList,
|
719 |
+
'BODY': makeList,
|
720 |
+
'DIV': selectedBlocks.length > 1 ? makeList : wrapList,
|
721 |
+
defaultAction: wrapList,
|
722 |
+
elements: this.selectedBlocks()
|
723 |
+
};
|
724 |
+
} else {
|
725 |
+
actions = {
|
726 |
+
defaultAction: convertListItemToParagraph,
|
727 |
+
elements: this.selectedBlocks(),
|
728 |
+
processEvenIfEmpty: true
|
729 |
+
};
|
730 |
+
}
|
731 |
+
this.process(actions);
|
732 |
+
},
|
733 |
+
|
734 |
+
indent: function() {
|
735 |
+
var ed = this.ed, dom = ed.dom, indented = [];
|
736 |
+
|
737 |
+
function createWrapItem(element) {
|
738 |
+
var wrapItem = dom.create('li', { style: 'list-style-type: none;'});
|
739 |
+
dom.insertAfter(wrapItem, element);
|
740 |
+
return wrapItem;
|
741 |
+
}
|
742 |
+
|
743 |
+
function createWrapList(element) {
|
744 |
+
var wrapItem = createWrapItem(element),
|
745 |
+
list = dom.getParent(element, 'ol,ul'),
|
746 |
+
listType = list.tagName,
|
747 |
+
listStyle = dom.getStyle(list, 'list-style-type'),
|
748 |
+
attrs = {},
|
749 |
+
wrapList;
|
750 |
+
if (listStyle !== '') {
|
751 |
+
attrs.style = 'list-style-type: ' + listStyle + ';';
|
752 |
+
}
|
753 |
+
wrapList = dom.create(listType, attrs);
|
754 |
+
wrapItem.appendChild(wrapList);
|
755 |
+
return wrapList;
|
756 |
+
}
|
757 |
+
|
758 |
+
function indentLI(element) {
|
759 |
+
if (!hasParentInList(ed, element, indented)) {
|
760 |
+
element = splitNestedLists(element, dom);
|
761 |
+
var wrapList = createWrapList(element);
|
762 |
+
wrapList.appendChild(element);
|
763 |
+
attemptMergeWithAdjacent(wrapList.parentNode, false);
|
764 |
+
attemptMergeWithAdjacent(wrapList, false);
|
765 |
+
indented.push(element);
|
766 |
+
}
|
767 |
+
}
|
768 |
+
|
769 |
+
this.process({
|
770 |
+
'LI': indentLI,
|
771 |
+
defaultAction: this.adjustPaddingFunction(true),
|
772 |
+
elements: this.selectedBlocks()
|
773 |
+
});
|
774 |
+
|
775 |
+
},
|
776 |
+
|
777 |
+
outdent: function(ui, elements) {
|
778 |
+
var t = this, ed = t.ed, dom = ed.dom, outdented = [];
|
779 |
+
|
780 |
+
function outdentLI(element) {
|
781 |
+
var listElement, targetParent, align;
|
782 |
+
if (!hasParentInList(ed, element, outdented)) {
|
783 |
+
if (dom.getStyle(element, 'margin-left') !== '' || dom.getStyle(element, 'padding-left') !== '') {
|
784 |
+
return t.adjustPaddingFunction(false)(element);
|
785 |
+
}
|
786 |
+
align = dom.getStyle(element, 'text-align', true);
|
787 |
+
if (align === 'center' || align === 'right') {
|
788 |
+
dom.setStyle(element, 'text-align', 'left');
|
789 |
+
return;
|
790 |
+
}
|
791 |
+
element = splitNestedLists(element, dom);
|
792 |
+
listElement = element.parentNode;
|
793 |
+
targetParent = element.parentNode.parentNode;
|
794 |
+
if (targetParent.tagName === 'P') {
|
795 |
+
dom.split(targetParent, element.parentNode);
|
796 |
+
} else {
|
797 |
+
dom.split(listElement, element);
|
798 |
+
if (targetParent.tagName === 'LI') {
|
799 |
+
// Nested list, need to split the LI and go back out to the OL/UL element.
|
800 |
+
dom.split(targetParent, element);
|
801 |
+
} else if (!dom.is(targetParent, 'ol,ul')) {
|
802 |
+
dom.rename(element, 'p');
|
803 |
+
}
|
804 |
+
}
|
805 |
+
outdented.push(element);
|
806 |
+
}
|
807 |
+
}
|
808 |
+
|
809 |
+
var listElements = elements && tinymce.is(elements, 'array') ? elements : this.selectedBlocks();
|
810 |
+
this.process({
|
811 |
+
'LI': outdentLI,
|
812 |
+
defaultAction: this.adjustPaddingFunction(false),
|
813 |
+
elements: listElements
|
814 |
+
});
|
815 |
+
|
816 |
+
each(outdented, attemptMergeWithAdjacent);
|
817 |
+
},
|
818 |
+
|
819 |
+
process: function(actions) {
|
820 |
+
var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r;
|
821 |
+
|
822 |
+
function isEmptyElement(element) {
|
823 |
+
var excludeBrsAndBookmarks = tinymce.grep(element.childNodes, function(n) {
|
824 |
+
return !(n.nodeName === 'BR' || n.nodeName === 'SPAN' && dom.getAttrib(n, 'data-mce-type') == 'bookmark'
|
825 |
+
|| n.nodeType == 3 && (n.nodeValue == String.fromCharCode(160) || n.nodeValue == ''));
|
826 |
+
});
|
827 |
+
return excludeBrsAndBookmarks.length === 0;
|
828 |
+
}
|
829 |
+
|
830 |
+
function processElement(element) {
|
831 |
+
dom.removeClass(element, '_mce_act_on');
|
832 |
+
if (!element || element.nodeType !== 1 || ! actions.processEvenIfEmpty && selectedBlocks.length > 1 && isEmptyElement(element)) {
|
833 |
+
return;
|
834 |
+
}
|
835 |
+
element = findItemToOperateOn(element, dom);
|
836 |
+
var action = actions[element.tagName];
|
837 |
+
if (!action) {
|
838 |
+
action = actions.defaultAction;
|
839 |
+
}
|
840 |
+
action(element);
|
841 |
+
}
|
842 |
+
|
843 |
+
function recurse(element) {
|
844 |
+
t.splitSafeEach(element.childNodes, processElement, true);
|
845 |
+
}
|
846 |
+
|
847 |
+
function brAtEdgeOfSelection(container, offset) {
|
848 |
+
return offset >= 0 && container.hasChildNodes() && offset < container.childNodes.length &&
|
849 |
+
container.childNodes[offset].tagName === 'BR';
|
850 |
+
}
|
851 |
+
|
852 |
+
function isInTable() {
|
853 |
+
var n = sel.getNode();
|
854 |
+
var p = dom.getParent(n, 'td');
|
855 |
+
return p !== null;
|
856 |
+
}
|
857 |
+
|
858 |
+
selectedBlocks = actions.elements;
|
859 |
+
|
860 |
+
r = sel.getRng(true);
|
861 |
+
if (!r.collapsed) {
|
862 |
+
if (brAtEdgeOfSelection(r.endContainer, r.endOffset - 1)) {
|
863 |
+
r.setEnd(r.endContainer, r.endOffset - 1);
|
864 |
+
sel.setRng(r);
|
865 |
+
}
|
866 |
+
if (brAtEdgeOfSelection(r.startContainer, r.startOffset)) {
|
867 |
+
r.setStart(r.startContainer, r.startOffset + 1);
|
868 |
+
sel.setRng(r);
|
869 |
+
}
|
870 |
+
}
|
871 |
+
|
872 |
+
|
873 |
+
if (tinymce.isIE8) {
|
874 |
+
// append a zero sized nbsp so that caret is restored correctly using bookmark
|
875 |
+
var s = t.ed.selection.getNode();
|
876 |
+
if (s.tagName === 'LI' && !(s.parentNode.lastChild === s)) {
|
877 |
+
var i = t.ed.getDoc().createTextNode('\uFEFF');
|
878 |
+
s.appendChild(i);
|
879 |
+
}
|
880 |
+
}
|
881 |
+
|
882 |
+
bookmark = sel.getBookmark();
|
883 |
+
actions.OL = actions.UL = recurse;
|
884 |
+
t.splitSafeEach(selectedBlocks, processElement);
|
885 |
+
sel.moveToBookmark(bookmark);
|
886 |
+
bookmark = null;
|
887 |
+
|
888 |
+
// we avoid doing repaint in a table as this will move the caret out of the table in Firefox 3.6
|
889 |
+
if (!isInTable()) {
|
890 |
+
// Avoids table or image handles being left behind in Firefox.
|
891 |
+
t.ed.execCommand('mceRepaint');
|
892 |
+
}
|
893 |
+
},
|
894 |
+
|
895 |
+
splitSafeEach: function(elements, f, forceClassBase) {
|
896 |
+
if (forceClassBase ||
|
897 |
+
(tinymce.isGecko &&
|
898 |
+
(/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) ||
|
899 |
+
/Firefox\/3\.[0-4]/.test(navigator.userAgent)))) {
|
900 |
+
this.classBasedEach(elements, f);
|
901 |
+
} else {
|
902 |
+
each(elements, f);
|
903 |
+
}
|
904 |
+
},
|
905 |
+
|
906 |
+
classBasedEach: function(elements, f) {
|
907 |
+
var dom = this.ed.dom, nodes, element;
|
908 |
+
// Mark nodes
|
909 |
+
each(elements, function(element) {
|
910 |
+
dom.addClass(element, '_mce_act_on');
|
911 |
+
});
|
912 |
+
nodes = dom.select('._mce_act_on');
|
913 |
+
while (nodes.length > 0) {
|
914 |
+
element = nodes.shift();
|
915 |
+
dom.removeClass(element, '_mce_act_on');
|
916 |
+
f(element);
|
917 |
+
nodes = dom.select('._mce_act_on');
|
918 |
+
}
|
919 |
+
},
|
920 |
+
|
921 |
+
adjustPaddingFunction: function(isIndent) {
|
922 |
+
var indentAmount, indentUnits, ed = this.ed;
|
923 |
+
indentAmount = ed.settings.indentation;
|
924 |
+
indentUnits = /[a-z%]+/i.exec(indentAmount);
|
925 |
+
indentAmount = parseInt(indentAmount, 10);
|
926 |
+
return function(element) {
|
927 |
+
var currentIndent, newIndentAmount;
|
928 |
+
currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10);
|
929 |
+
if (isIndent) {
|
930 |
+
newIndentAmount = currentIndent + indentAmount;
|
931 |
+
} else {
|
932 |
+
newIndentAmount = currentIndent - indentAmount;
|
933 |
+
}
|
934 |
+
ed.dom.setStyle(element, 'padding-left', '');
|
935 |
+
ed.dom.setStyle(element, 'margin-left', newIndentAmount > 0 ? newIndentAmount + indentUnits : '');
|
936 |
+
};
|
937 |
+
},
|
938 |
+
|
939 |
+
selectedBlocks: function() {
|
940 |
+
var ed = this.ed, selectedBlocks = ed.selection.getSelectedBlocks();
|
941 |
+
return selectedBlocks.length == 0 ? [ ed.dom.getRoot() ] : selectedBlocks;
|
942 |
+
},
|
943 |
+
|
944 |
+
getInfo: function() {
|
945 |
+
return {
|
946 |
+
longname : 'Lists',
|
947 |
+
author : 'Moxiecode Systems AB',
|
948 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
949 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists',
|
950 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
951 |
+
};
|
952 |
+
}
|
953 |
+
});
|
954 |
+
tinymce.PluginManager.add("lists", tinymce.plugins.Lists);
|
955 |
+
}());
|
js/libraries/tiny_mce/plugins/media/langs/en_dlg.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert/Edit Embedded Media","align_top_left":"Top Left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed RTSP resources should be added to the QT Source field under the Advanced tab.\nYou should also add a non-streamed version to the Source field.",qtsrc:"QT Source",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch Style",scriptcallbacks:"Script Callbacks","align_top_right":"Top Right",uimode:"UI Mode",rate:"Rate",playcount:"Play Count",defaultframe:"Default Frame",currentposition:"Current Position",currentmarker:"Current Marker",captioningid:"Captioning ID",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless Video",stretchtofit:"Stretch to Fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Full Screen",enabled:"Enabled",autostart:"Auto Start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"End Time",starttime:"Start Time",enablejavascript:"Enable JavaScript",correction:"No Correction",targetcache:"Target Cache",playeveryframe:"Play Every Frame",kioskmode:"Kiosk Mode",controller:"Controller",menu:"Show Menu",loop:"Loop",play:"Auto Play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"ID",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain Proportions",controls:"Controls",numloop:"Num Loops",console:"Console",cache:"Cache",autohref:"Auto HREF",liveconnect:"SWLiveConnect",flashvars:"Flash Vars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain Aspect",imagestatus:"Image Status",center:"Center",autogotourl:"Auto Goto URL","shockwave_options":"Shockwave Options","rmp_options":"Real Media Player Options","wmp_options":"Windows Media Player Options","qt_options":"QuickTime Options","flash_options":"Flash Options",hidden:"Hidden","align_bottom_left":"Bottom Left","align_bottom_right":"Bottom Right","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source","html5_audio_options":"Audio Options","preload_none":"Don\'t Preload","preload_metadata":"Preload video metadata","preload_auto":"Let user\'s browser decide", "embedded_audio_options":"Embedded Audio Options", video:"HTML5 Video", audio:"HTML5 Audio", flash:"Flash", quicktime:"QuickTime", shockwave:"Shockwave", windowsmedia:"Windows Media", realmedia:"Real Media", iframe:"Iframe", embeddedaudio:"Embedded Audio" });
|
1 |
+
tinyMCE.addI18n('en.media_dlg',{list:"List",file:"File/URL",advanced:"Advanced",general:"General",title:"Insert/Edit Embedded Media","align_top_left":"Top Left","align_center":"Center","align_left":"Left","align_bottom":"Bottom","align_right":"Right","align_top":"Top","qt_stream_warn":"Streamed RTSP resources should be added to the QT Source field under the Advanced tab.\nYou should also add a non-streamed version to the Source field.",qtsrc:"QT Source",progress:"Progress",sound:"Sound",swstretchvalign:"Stretch V-Align",swstretchhalign:"Stretch H-Align",swstretchstyle:"Stretch Style",scriptcallbacks:"Script Callbacks","align_top_right":"Top Right",uimode:"UI Mode",rate:"Rate",playcount:"Play Count",defaultframe:"Default Frame",currentposition:"Current Position",currentmarker:"Current Marker",captioningid:"Captioning ID",baseurl:"Base URL",balance:"Balance",windowlessvideo:"Windowless Video",stretchtofit:"Stretch to Fit",mute:"Mute",invokeurls:"Invoke URLs",fullscreen:"Full Screen",enabled:"Enabled",autostart:"Auto Start",volume:"Volume",target:"Target",qtsrcchokespeed:"Choke Speed",href:"HREF",endtime:"End Time",starttime:"Start Time",enablejavascript:"Enable JavaScript",correction:"No Correction",targetcache:"Target Cache",playeveryframe:"Play Every Frame",kioskmode:"Kiosk Mode",controller:"Controller",menu:"Show Menu",loop:"Loop",play:"Auto Play",hspace:"H-Space",vspace:"V-Space","class_name":"Class",name:"Name",id:"ID",type:"Type",size:"Dimensions",preview:"Preview","constrain_proportions":"Constrain Proportions",controls:"Controls",numloop:"Num Loops",console:"Console",cache:"Cache",autohref:"Auto HREF",liveconnect:"SWLiveConnect",flashvars:"Flash Vars",base:"Base",bgcolor:"Background",wmode:"WMode",salign:"SAlign",align:"Align",scale:"Scale",quality:"Quality",shuffle:"Shuffle",prefetch:"Prefetch",nojava:"No Java",maintainaspect:"Maintain Aspect",imagestatus:"Image Status",center:"Center",autogotourl:"Auto Goto URL","shockwave_options":"Shockwave Options","rmp_options":"Real Media Player Options","wmp_options":"Windows Media Player Options","qt_options":"QuickTime Options","flash_options":"Flash Options",hidden:"Hidden","align_bottom_left":"Bottom Left","align_bottom_right":"Bottom Right","html5_video_options":"HTML5 Video Options",altsource1:"Alternative source 1",altsource2:"Alternative source 2",preload:"Preload",poster:"Poster",source:"Source","html5_audio_options":"Audio Options","preload_none":"Don\'t Preload","preload_metadata":"Preload video metadata","preload_auto":"Let user\'s browser decide", "embedded_audio_options":"Embedded Audio Options", video:"HTML5 Video", audio:"HTML5 Audio", flash:"Flash", quicktime:"QuickTime", shockwave:"Shockwave", windowsmedia:"Windows Media", realmedia:"Real Media", iframe:"Iframe", embeddedaudio:"Embedded Audio" });
|
js/libraries/tiny_mce/plugins/preview/editor_plugin_src.js
CHANGED
@@ -1,53 +1,53 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
tinymce.create('tinymce.plugins.Preview', {
|
13 |
-
init : function(ed, url) {
|
14 |
-
var t = this, css = tinymce.explode(ed.settings.content_css);
|
15 |
-
|
16 |
-
t.editor = ed;
|
17 |
-
|
18 |
-
// Force absolute CSS urls
|
19 |
-
tinymce.each(css, function(u, k) {
|
20 |
-
css[k] = ed.documentBaseURI.toAbsolute(u);
|
21 |
-
});
|
22 |
-
|
23 |
-
ed.addCommand('mcePreview', function() {
|
24 |
-
ed.windowManager.open({
|
25 |
-
file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"),
|
26 |
-
width : parseInt(ed.getParam("plugin_preview_width", "550")),
|
27 |
-
height : parseInt(ed.getParam("plugin_preview_height", "600")),
|
28 |
-
resizable : "yes",
|
29 |
-
scrollbars : "yes",
|
30 |
-
popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"),
|
31 |
-
inline : ed.getParam("plugin_preview_inline", 1)
|
32 |
-
}, {
|
33 |
-
base : ed.documentBaseURI.getURI()
|
34 |
-
});
|
35 |
-
});
|
36 |
-
|
37 |
-
ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'});
|
38 |
-
},
|
39 |
-
|
40 |
-
getInfo : function() {
|
41 |
-
return {
|
42 |
-
longname : 'Preview',
|
43 |
-
author : 'Moxiecode Systems AB',
|
44 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
45 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',
|
46 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
47 |
-
};
|
48 |
-
}
|
49 |
-
});
|
50 |
-
|
51 |
-
// Register plugin
|
52 |
-
tinymce.PluginManager.add('preview', tinymce.plugins.Preview);
|
53 |
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
tinymce.create('tinymce.plugins.Preview', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
var t = this, css = tinymce.explode(ed.settings.content_css);
|
15 |
+
|
16 |
+
t.editor = ed;
|
17 |
+
|
18 |
+
// Force absolute CSS urls
|
19 |
+
tinymce.each(css, function(u, k) {
|
20 |
+
css[k] = ed.documentBaseURI.toAbsolute(u);
|
21 |
+
});
|
22 |
+
|
23 |
+
ed.addCommand('mcePreview', function() {
|
24 |
+
ed.windowManager.open({
|
25 |
+
file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"),
|
26 |
+
width : parseInt(ed.getParam("plugin_preview_width", "550")),
|
27 |
+
height : parseInt(ed.getParam("plugin_preview_height", "600")),
|
28 |
+
resizable : "yes",
|
29 |
+
scrollbars : "yes",
|
30 |
+
popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"),
|
31 |
+
inline : ed.getParam("plugin_preview_inline", 1)
|
32 |
+
}, {
|
33 |
+
base : ed.documentBaseURI.getURI()
|
34 |
+
});
|
35 |
+
});
|
36 |
+
|
37 |
+
ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'});
|
38 |
+
},
|
39 |
+
|
40 |
+
getInfo : function() {
|
41 |
+
return {
|
42 |
+
longname : 'Preview',
|
43 |
+
author : 'Moxiecode Systems AB',
|
44 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
45 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',
|
46 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
47 |
+
};
|
48 |
+
}
|
49 |
+
});
|
50 |
+
|
51 |
+
// Register plugin
|
52 |
+
tinymce.PluginManager.add('preview', tinymce.plugins.Preview);
|
53 |
})();
|
js/libraries/tiny_mce/plugins/style/langs/en_dlg.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
tinyMCE.addI18n('en.style_dlg',{"text_lineheight":"Line Height","text_variant":"Variant","text_style":"Style","text_weight":"Weight","text_size":"Size","text_font":"Font","text_props":"Text","positioning_tab":"Positioning","list_tab":"List","border_tab":"Border","box_tab":"Box","block_tab":"Block","background_tab":"Background","text_tab":"Text",apply:"Apply",toggle_insert_span:"Insert span at selection",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility","positioning_type":"Type",position:"Position","bullet_image":"Bullet Image","list_type":"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for All",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Height","box_width":"Width","block_display":"Display","block_whitespace":"Whitespace","block_text_indent":"Text Indent","block_text_align":"Text Align","block_vertical_alignment":"Vertical Alignment","block_letterspacing":"Letter Spacing","block_wordspacing":"Word Spacing","background_vpos":"Vertical Position","background_hpos":"Horizontal Position","background_attachment":"Attachment","background_repeat":"Repeat","background_image":"Background Image","background_color":"Background Color","text_none":"None","text_blink":"Blink","text_case":"Case","text_striketrough":"Strikethrough","text_underline":"Underline","text_overline":"Overline","text_decoration":"Decoration","text_color":"Color",text:"Text",background:"Background",block:"Block",box:"Box",border:"Border",list:"List"});
|
1 |
+
tinyMCE.addI18n('en.style_dlg',{"text_lineheight":"Line Height","text_variant":"Variant","text_style":"Style","text_weight":"Weight","text_size":"Size","text_font":"Font","text_props":"Text","positioning_tab":"Positioning","list_tab":"List","border_tab":"Border","box_tab":"Box","block_tab":"Block","background_tab":"Background","text_tab":"Text",apply:"Apply",toggle_insert_span:"Insert span at selection",title:"Edit CSS Style",clip:"Clip",placement:"Placement",overflow:"Overflow",zindex:"Z-index",visibility:"Visibility","positioning_type":"Type",position:"Position","bullet_image":"Bullet Image","list_type":"Type",color:"Color",height:"Height",width:"Width",style:"Style",margin:"Margin",left:"Left",bottom:"Bottom",right:"Right",top:"Top",same:"Same for All",padding:"Padding","box_clear":"Clear","box_float":"Float","box_height":"Height","box_width":"Width","block_display":"Display","block_whitespace":"Whitespace","block_text_indent":"Text Indent","block_text_align":"Text Align","block_vertical_alignment":"Vertical Alignment","block_letterspacing":"Letter Spacing","block_wordspacing":"Word Spacing","background_vpos":"Vertical Position","background_hpos":"Horizontal Position","background_attachment":"Attachment","background_repeat":"Repeat","background_image":"Background Image","background_color":"Background Color","text_none":"None","text_blink":"Blink","text_case":"Case","text_striketrough":"Strikethrough","text_underline":"Underline","text_overline":"Overline","text_decoration":"Decoration","text_color":"Color",text:"Text",background:"Background",block:"Block",box:"Box",border:"Border",list:"List"});
|
js/libraries/tiny_mce/plugins/style/props.htm
CHANGED
@@ -1,845 +1,845 @@
|
|
1 |
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2 |
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
-
<head>
|
4 |
-
<title>{#style_dlg.title}</title>
|
5 |
-
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
6 |
-
<script type="text/javascript" src="../../utils/mctabs.js"></script>
|
7 |
-
<script type="text/javascript" src="../../utils/editable_selects.js"></script>
|
8 |
-
<script type="text/javascript" src="../../utils/form_utils.js"></script>
|
9 |
-
<script type="text/javascript" src="js/props.js"></script>
|
10 |
-
<link href="css/props.css" rel="stylesheet" type="text/css" />
|
11 |
-
</head>
|
12 |
-
|
13 |
-
<body id="styleprops" style="display: none" role="application" aria-labelledby="app_title">
|
14 |
-
<span id="app_title" style="display:none">{#style_dlg.title}</span>
|
15 |
-
<form onsubmit="updateAction();return false;" action="#">
|
16 |
-
<div class="tabs">
|
17 |
-
<ul>
|
18 |
-
<li id="text_tab" class="current" aria-controls="text_panel"><span><a href="javascript:mcTabs.displayTab('text_tab','text_panel');" onMouseDown="return false;">{#style_dlg.text_tab}</a></span></li>
|
19 |
-
<li id="background_tab" aria-controls="background_panel"><span><a href="javascript:mcTabs.displayTab('background_tab','background_panel');" onMouseDown="return false;">{#style_dlg.background_tab}</a></span></li>
|
20 |
-
<li id="block_tab" aria-controls="block_panel"><span><a href="javascript:mcTabs.displayTab('block_tab','block_panel');" onMouseDown="return false;">{#style_dlg.block_tab}</a></span></li>
|
21 |
-
<li id="box_tab" aria-controls="box_panel"><span><a href="javascript:mcTabs.displayTab('box_tab','box_panel');" onMouseDown="return false;">{#style_dlg.box_tab}</a></span></li>
|
22 |
-
<li id="border_tab" aria-controls="border_panel"><span><a href="javascript:mcTabs.displayTab('border_tab','border_panel');" onMouseDown="return false;">{#style_dlg.border_tab}</a></span></li>
|
23 |
-
<li id="list_tab" aria-controls="list_panel"><span><a href="javascript:mcTabs.displayTab('list_tab','list_panel');" onMouseDown="return false;">{#style_dlg.list_tab}</a></span></li>
|
24 |
-
<li id="positioning_tab" aria-controls="positioning_panel"><span><a href="javascript:mcTabs.displayTab('positioning_tab','positioning_panel');" onMouseDown="return false;">{#style_dlg.positioning_tab}</a></span></li>
|
25 |
-
</ul>
|
26 |
-
</div>
|
27 |
-
|
28 |
-
<div class="panel_wrapper">
|
29 |
-
<div id="text_panel" class="panel current">
|
30 |
-
<fieldset>
|
31 |
-
<legend>{#style_dlg.text}</legend>
|
32 |
-
<table role="presentation" border="0" width="100%">
|
33 |
-
<tr>
|
34 |
-
<td><label for="text_font">{#style_dlg.text_font}</label></td>
|
35 |
-
<td colspan="3">
|
36 |
-
<select id="text_font" name="text_font" class="mceEditableSelect mceFocus"></select>
|
37 |
-
</td>
|
38 |
-
</tr>
|
39 |
-
<tr>
|
40 |
-
<td><label for="text_size">{#style_dlg.text_size}</label></td>
|
41 |
-
<td>
|
42 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
43 |
-
<tr>
|
44 |
-
<td><select id="text_size" name="text_size" class="mceEditableSelect"></select></td>
|
45 |
-
<td> </td>
|
46 |
-
<td>
|
47 |
-
<label id="text_size_measurement_label" for="text_size_measurement" style="display: none; visibility: hidden;">Text Size Measurement Unit</label>
|
48 |
-
<select id="text_size_measurement" name="text_size_measurement" aria-labelledby="text_size_measurement_label"></select>
|
49 |
-
</td>
|
50 |
-
</tr>
|
51 |
-
</table>
|
52 |
-
</td>
|
53 |
-
<td><label for="text_weight">{#style_dlg.text_weight}</label></td>
|
54 |
-
<td>
|
55 |
-
<select id="text_weight" name="text_weight"></select>
|
56 |
-
</td>
|
57 |
-
</tr>
|
58 |
-
<tr>
|
59 |
-
<td><label for="text_style">{#style_dlg.text_style}</label></td>
|
60 |
-
<td>
|
61 |
-
<select id="text_style" name="text_style" class="mceEditableSelect"></select>
|
62 |
-
</td>
|
63 |
-
<td><label for="text_variant">{#style_dlg.text_variant}</label></td>
|
64 |
-
<td>
|
65 |
-
<select id="text_variant" name="text_variant"></select>
|
66 |
-
</td>
|
67 |
-
</tr>
|
68 |
-
<tr>
|
69 |
-
<td><label for="text_lineheight">{#style_dlg.text_lineheight}</label></td>
|
70 |
-
<td>
|
71 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
72 |
-
<tr>
|
73 |
-
<td>
|
74 |
-
<select id="text_lineheight" name="text_lineheight" class="mceEditableSelect"></select>
|
75 |
-
</td>
|
76 |
-
<td> </td>
|
77 |
-
<td>
|
78 |
-
<label id="text_lineheight_measurement_label" for="text_lineheight_measurement" style="display: none; visibility: hidden;">Line Height Measurement Unit</label>
|
79 |
-
<select id="text_lineheight_measurement" name="text_lineheight_measurement" aria-labelledby="text_lineheight_measurement_label"></select>
|
80 |
-
</td>
|
81 |
-
</tr>
|
82 |
-
</table>
|
83 |
-
</td>
|
84 |
-
<td><label for="text_case">{#style_dlg.text_case}</label></td>
|
85 |
-
<td>
|
86 |
-
<select id="text_case" name="text_case"></select>
|
87 |
-
</td>
|
88 |
-
</tr>
|
89 |
-
<tr>
|
90 |
-
<td><label for="text_color">{#style_dlg.text_color}</label></td>
|
91 |
-
<td colspan="2">
|
92 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
93 |
-
<tr>
|
94 |
-
<td><input id="text_color" name="text_color" type="text" value="" size="9" onChange="updateColor('text_color_pick','text_color');" /></td>
|
95 |
-
<td id="text_color_pickcontainer"> </td>
|
96 |
-
</tr>
|
97 |
-
</table>
|
98 |
-
</td>
|
99 |
-
</tr>
|
100 |
-
<tr>
|
101 |
-
<td valign="top" style="vertical-align: top; padding-top: 3px;">{#style_dlg.text_decoration}</td>
|
102 |
-
<td colspan="2">
|
103 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
104 |
-
<tr>
|
105 |
-
<td><input id="text_underline" name="text_underline" class="checkbox" type="checkbox" /></td>
|
106 |
-
<td><label for="text_underline">{#style_dlg.text_underline}</label></td>
|
107 |
-
</tr>
|
108 |
-
<tr>
|
109 |
-
<td><input id="text_overline" name="text_overline" class="checkbox" type="checkbox" /></td>
|
110 |
-
<td><label for="text_overline">{#style_dlg.text_overline}</label></td>
|
111 |
-
</tr>
|
112 |
-
<tr>
|
113 |
-
<td><input id="text_linethrough" name="text_linethrough" class="checkbox" type="checkbox" /></td>
|
114 |
-
<td><label for="text_linethrough">{#style_dlg.text_striketrough}</label></td>
|
115 |
-
</tr>
|
116 |
-
<tr>
|
117 |
-
<td><input id="text_blink" name="text_blink" class="checkbox" type="checkbox" /></td>
|
118 |
-
<td><label for="text_blink">{#style_dlg.text_blink}</label></td>
|
119 |
-
</tr>
|
120 |
-
<tr>
|
121 |
-
<td><input id="text_none" name="text_none" class="checkbox" type="checkbox" onclick="updateTextDecorations();"/></td>
|
122 |
-
<td><label for="text_none">{#style_dlg.text_none}</label></td>
|
123 |
-
</tr>
|
124 |
-
</table>
|
125 |
-
</td>
|
126 |
-
</tr>
|
127 |
-
</table>
|
128 |
-
</fieldset>
|
129 |
-
</div>
|
130 |
-
|
131 |
-
<div id="background_panel" class="panel">
|
132 |
-
<fieldset>
|
133 |
-
<legend>{#style_dlg.background}</legend>
|
134 |
-
<table role="presentation" border="0">
|
135 |
-
<tr>
|
136 |
-
<td><label for="background_color">{#style_dlg.background_color}</label></td>
|
137 |
-
<td>
|
138 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
139 |
-
<tr>
|
140 |
-
<td><input id="background_color" name="background_color" type="text" value="" size="9" onChange="updateColor('background_color_pick','background_color');" /></td>
|
141 |
-
<td id="background_color_pickcontainer"> </td>
|
142 |
-
</tr>
|
143 |
-
</table>
|
144 |
-
</td>
|
145 |
-
</tr>
|
146 |
-
|
147 |
-
<tr>
|
148 |
-
<td><label for="background_image">{#style_dlg.background_image}</label></td>
|
149 |
-
<td><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
150 |
-
<tr>
|
151 |
-
<td><input id="background_image" name="background_image" type="text" /></td>
|
152 |
-
<td id="background_image_browser"> </td>
|
153 |
-
</tr>
|
154 |
-
</table>
|
155 |
-
</td>
|
156 |
-
</tr>
|
157 |
-
|
158 |
-
<tr>
|
159 |
-
<td><label for="background_repeat">{#style_dlg.background_repeat}</label></td>
|
160 |
-
<td><select id="background_repeat" name="background_repeat" class="mceEditableSelect"></select></td>
|
161 |
-
</tr>
|
162 |
-
|
163 |
-
<tr>
|
164 |
-
<td><label for="background_attachment">{#style_dlg.background_attachment}</label></td>
|
165 |
-
<td><select id="background_attachment" name="background_attachment" class="mceEditableSelect"></select></td>
|
166 |
-
</tr>
|
167 |
-
|
168 |
-
<tr>
|
169 |
-
<td><label for="background_hpos">{#style_dlg.background_hpos}</label></td>
|
170 |
-
<td>
|
171 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
172 |
-
<tr>
|
173 |
-
<td><select id="background_hpos" name="background_hpos" class="mceEditableSelect"></select></td>
|
174 |
-
<td> </td>
|
175 |
-
<td>
|
176 |
-
<label id="background_hpos_measurement_label" for="background_hpos_measurement" style="display: none; visibility: hidden;">Horizontal position measurement unit</label>
|
177 |
-
<select id="background_hpos_measurement" name="background_hpos_measurement" aria-labelledby="background_hpos_measurement_label"></select>
|
178 |
-
</td>
|
179 |
-
</tr>
|
180 |
-
</table>
|
181 |
-
</td>
|
182 |
-
</tr>
|
183 |
-
|
184 |
-
<tr>
|
185 |
-
<td><label for="background_vpos">{#style_dlg.background_vpos}</label></td>
|
186 |
-
<td>
|
187 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
188 |
-
<tr>
|
189 |
-
<td><select id="background_vpos" name="background_vpos" class="mceEditableSelect"></select></td>
|
190 |
-
<td> </td>
|
191 |
-
<td>
|
192 |
-
|
193 |
-
<label id="background_vpos_measurement_label" for="background_vpos_measurement" style="display: none; visibility: hidden;">Vertical position measurement unit</label>
|
194 |
-
<select id="background_vpos_measurement" name="background_vpos_measurement" aria-labelledby="background_vpos_measurement_label">></select></td>
|
195 |
-
</tr>
|
196 |
-
</table>
|
197 |
-
</td>
|
198 |
-
</tr>
|
199 |
-
</table>
|
200 |
-
</fieldset>
|
201 |
-
</div>
|
202 |
-
|
203 |
-
<div id="block_panel" class="panel">
|
204 |
-
<fieldset>
|
205 |
-
<legend>{#style_dlg.block}</legend>
|
206 |
-
<table role="presentation" border="0">
|
207 |
-
<tr>
|
208 |
-
<td><label for="block_wordspacing">{#style_dlg.block_wordspacing}</label></td>
|
209 |
-
<td>
|
210 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
211 |
-
<tr>
|
212 |
-
<td><select id="block_wordspacing" name="block_wordspacing" class="mceEditableSelect"></select></td>
|
213 |
-
<td> </td>
|
214 |
-
<td>
|
215 |
-
<label id="block_wordspacing_measurement_label" for="block_wordspacing_measurement" style="display: none; visibility: hidden;">Word spacing measurement unit</label>
|
216 |
-
<select id="block_wordspacing_measurement" name="block_wordspacing_measurement" aria-labelledby="block_wordspacing_measurement_label"></select>
|
217 |
-
</td>
|
218 |
-
</tr>
|
219 |
-
</table>
|
220 |
-
</td>
|
221 |
-
</tr>
|
222 |
-
|
223 |
-
<tr>
|
224 |
-
<td><label for="block_letterspacing">{#style_dlg.block_letterspacing}</label></td>
|
225 |
-
<td>
|
226 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
227 |
-
<tr>
|
228 |
-
<td><select id="block_letterspacing" name="block_letterspacing" class="mceEditableSelect"></select></td>
|
229 |
-
<td> </td>
|
230 |
-
<td>
|
231 |
-
<label id="block_letterspacing_measurement_label" for="block_letterspacing_measurement" style="display: none; visibility: hidden;">Letter spacing measurement unit</label>
|
232 |
-
<select id="block_letterspacing_measurement" name="block_letterspacing_measurement" aria-labelledby="block_letterspacing_measurement_label"></select>
|
233 |
-
</td>
|
234 |
-
</tr>
|
235 |
-
</table>
|
236 |
-
</td>
|
237 |
-
</tr>
|
238 |
-
|
239 |
-
<tr>
|
240 |
-
<td><label for="block_vertical_alignment">{#style_dlg.block_vertical_alignment}</label></td>
|
241 |
-
<td><select id="block_vertical_alignment" name="block_vertical_alignment" class="mceEditableSelect"></select></td>
|
242 |
-
</tr>
|
243 |
-
|
244 |
-
<tr>
|
245 |
-
<td><label for="block_text_align">{#style_dlg.block_text_align}</label></td>
|
246 |
-
<td><select id="block_text_align" name="block_text_align" class="mceEditableSelect"></select></td>
|
247 |
-
</tr>
|
248 |
-
|
249 |
-
<tr>
|
250 |
-
<td><label for="block_text_indent">{#style_dlg.block_text_indent}</label></td>
|
251 |
-
<td>
|
252 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
253 |
-
<tr>
|
254 |
-
<td><input type="text" id="block_text_indent" name="block_text_indent" /></td>
|
255 |
-
<td> </td>
|
256 |
-
<td>
|
257 |
-
<label id="block_text_indent_measurement_label" for="block_text_indent_measurement" style="display: none; visibility: hidden;">Text Indent Measurement Unit</label>
|
258 |
-
|
259 |
-
<select id="block_text_indent_measurement" name="block_text_indent_measurement" aria-labelledby="block_text_indent_measurement_label"></select>
|
260 |
-
</td>
|
261 |
-
</tr>
|
262 |
-
</table>
|
263 |
-
</td>
|
264 |
-
</tr>
|
265 |
-
|
266 |
-
<tr>
|
267 |
-
<td><label for="block_whitespace">{#style_dlg.block_whitespace}</label></td>
|
268 |
-
<td><select id="block_whitespace" name="block_whitespace" class="mceEditableSelect"></select></td>
|
269 |
-
</tr>
|
270 |
-
|
271 |
-
<tr>
|
272 |
-
<td><label for="block_display">{#style_dlg.block_display}</label></td>
|
273 |
-
<td><select id="block_display" name="block_display" class="mceEditableSelect"></select></td>
|
274 |
-
</tr>
|
275 |
-
</table>
|
276 |
-
</fieldset>
|
277 |
-
</div>
|
278 |
-
|
279 |
-
<div id="box_panel" class="panel">
|
280 |
-
<fieldset>
|
281 |
-
<legend>{#style_dlg.box}</legend>
|
282 |
-
<table role="presentation" border="0">
|
283 |
-
<tr>
|
284 |
-
<td><label for="box_width">{#style_dlg.box_width}</label></td>
|
285 |
-
<td>
|
286 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
287 |
-
<tr>
|
288 |
-
<td><input type="text" id="box_width" name="box_width" class="mceEditableSelect" onChange="synch('box_width','positioning_width');" /></td>
|
289 |
-
<td> </td>
|
290 |
-
<td>
|
291 |
-
<label id="box_width_measurement_label" for="box_width_measurement" style="display: none; visibility: hidden;">Box Width Measurement Unit</label>
|
292 |
-
<select id="box_width_measurement" name="box_width_measurement" aria-labelledby="box_width_measurement_label"></select>
|
293 |
-
</td>
|
294 |
-
</tr>
|
295 |
-
</table>
|
296 |
-
</td>
|
297 |
-
<td> <label for="box_float">{#style_dlg.box_float}</label></td>
|
298 |
-
<td><select id="box_float" name="box_float" class="mceEditableSelect"></select></td>
|
299 |
-
</tr>
|
300 |
-
|
301 |
-
<tr>
|
302 |
-
<td><label for="box_height">{#style_dlg.box_height}</label></td>
|
303 |
-
<td>
|
304 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
305 |
-
<tr>
|
306 |
-
<td><input type="text" id="box_height" name="box_height" class="mceEditableSelect" onChange="synch('box_height','positioning_height');" /></td>
|
307 |
-
<td> </td>
|
308 |
-
<td>
|
309 |
-
<label id="box_height_measurement_label" for="box_height_measurement" style="display: none; visibility: hidden;">Box Height Measurement Unit</label>
|
310 |
-
<select id="box_height_measurement" name="box_height_measurement" aria-labelledby="box_height_measurement_label"></select>
|
311 |
-
</td>
|
312 |
-
</tr>
|
313 |
-
</table>
|
314 |
-
</td>
|
315 |
-
<td> <label for="box_clear">{#style_dlg.box_clear}</label></td>
|
316 |
-
<td><select id="box_clear" name="box_clear" class="mceEditableSelect"></select></td>
|
317 |
-
</tr>
|
318 |
-
</table>
|
319 |
-
</fieldset>
|
320 |
-
|
321 |
-
<div style="float: left; width: 49%">
|
322 |
-
<fieldset>
|
323 |
-
<legend>{#style_dlg.padding}</legend>
|
324 |
-
|
325 |
-
<table role="presentation" border="0">
|
326 |
-
<tr>
|
327 |
-
<td> </td>
|
328 |
-
<td><input type="checkbox" id="box_padding_same" name="box_padding_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_padding');" /> <label for="box_padding_same">{#style_dlg.same}</label></td>
|
329 |
-
</tr>
|
330 |
-
<tr>
|
331 |
-
<td><label for="box_padding_top">{#style_dlg.top}</label></td>
|
332 |
-
<td>
|
333 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
334 |
-
<tr>
|
335 |
-
<td><input type="text" id="box_padding_top" name="box_padding_top" class="mceEditableSelect" /></td>
|
336 |
-
<td> </td>
|
337 |
-
<td>
|
338 |
-
<label id="box_padding_top_measurement_label" for="box_padding_top_measurement" style="display: none; visibility: hidden;">Padding Top Measurement Unit</label>
|
339 |
-
<select id="box_padding_top_measurement" name="box_padding_top_measurement" aria-labelledby="box_padding_top_measurement_label"></select>
|
340 |
-
</td>
|
341 |
-
</tr>
|
342 |
-
</table>
|
343 |
-
</td>
|
344 |
-
</tr>
|
345 |
-
<tr>
|
346 |
-
<td><label for="box_padding_right">{#style_dlg.right}</label></td>
|
347 |
-
<td>
|
348 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
349 |
-
<tr>
|
350 |
-
<td><input type="text" id="box_padding_right" name="box_padding_right" class="mceEditableSelect" disabled="disabled" /></td>
|
351 |
-
<td> </td>
|
352 |
-
<td>
|
353 |
-
<label id="box_padding_right_measurement_label" for="box_padding_right_measurement" style="display: none; visibility: hidden;">Padding Right Measurement Unit</label>
|
354 |
-
<select id="box_padding_right_measurement" name="box_padding_right_measurement" disabled="disabled" aria-labelledby="box_padding_right_measurement_label"></select>
|
355 |
-
</td>
|
356 |
-
</tr>
|
357 |
-
</table>
|
358 |
-
</td>
|
359 |
-
</tr>
|
360 |
-
<tr>
|
361 |
-
<td><label for="box_padding_bottom">{#style_dlg.bottom}</label></td>
|
362 |
-
<td>
|
363 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
364 |
-
<tr>
|
365 |
-
<td><input type="text" id="box_padding_bottom" name="box_padding_bottom" class="mceEditableSelect" disabled="disabled" /></td>
|
366 |
-
<td> </td>
|
367 |
-
<td>
|
368 |
-
<label id="box_padding_bottom_measurement_label" for="box_padding_bottom_measurement" style="display: none; visibility: hidden;">Padding Bottom Measurement Unit</label>
|
369 |
-
<select id="box_padding_bottom_measurement" name="box_padding_bottom_measurement" disabled="disabled" aria-labelledby="box_padding_bottom_measurement_label"></select>
|
370 |
-
</td>
|
371 |
-
</tr>
|
372 |
-
</table>
|
373 |
-
</td>
|
374 |
-
</tr>
|
375 |
-
<tr>
|
376 |
-
<td><label for="box_padding_left">{#style_dlg.left}</label></td>
|
377 |
-
<td>
|
378 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
379 |
-
<tr>
|
380 |
-
<td><input type="text" id="box_padding_left" name="box_padding_left" class="mceEditableSelect" disabled="disabled" /></td>
|
381 |
-
<td> </td>
|
382 |
-
<td>
|
383 |
-
<label id="box_padding_left_measurement_label" for="box_padding_left_measurement" style="display: none; visibility: hidden;">Padding Left Measurement Unit</label>
|
384 |
-
<select id="box_padding_left_measurement" name="box_padding_left_measurement" disabled="disabled" aria-labelledby="box_padding_left_measurement_label"></select>
|
385 |
-
</td>
|
386 |
-
</tr>
|
387 |
-
</table>
|
388 |
-
</td>
|
389 |
-
</tr>
|
390 |
-
</table>
|
391 |
-
</fieldset>
|
392 |
-
</div>
|
393 |
-
|
394 |
-
<div style="float: right; width: 49%">
|
395 |
-
<fieldset>
|
396 |
-
<legend>{#style_dlg.margin}</legend>
|
397 |
-
|
398 |
-
<table role="presentation" border="0">
|
399 |
-
<tr>
|
400 |
-
<td> </td>
|
401 |
-
<td><input type="checkbox" id="box_margin_same" name="box_margin_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_margin');" /> <label for="box_margin_same">{#style_dlg.same}</label></td>
|
402 |
-
</tr>
|
403 |
-
<tr>
|
404 |
-
<td><label for="box_margin_top">{#style_dlg.top}</label></td>
|
405 |
-
<td>
|
406 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
407 |
-
<tr>
|
408 |
-
<td><input type="text" id="box_margin_top" name="box_margin_top" class="mceEditableSelect" /></td>
|
409 |
-
<td> </td>
|
410 |
-
<td>
|
411 |
-
<label id="box_margin_top_measurement_label" for="box_margin_top_measurement" style="display: none; visibility: hidden;">Margin Top Measurement Unit</label>
|
412 |
-
<select id="box_margin_top_measurement" name="box_margin_top_measurement" aria-labelledby="box_margin_top_measurement_label"></select>
|
413 |
-
</td>
|
414 |
-
</tr>
|
415 |
-
</table>
|
416 |
-
</td>
|
417 |
-
</tr>
|
418 |
-
<tr>
|
419 |
-
<td><label for="box_margin_right">{#style_dlg.right}</label></td>
|
420 |
-
<td>
|
421 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
422 |
-
<tr>
|
423 |
-
<td><input type="text" id="box_margin_right" name="box_margin_right" class="mceEditableSelect" disabled="disabled" /></td>
|
424 |
-
<td> </td>
|
425 |
-
<td>
|
426 |
-
<label id="box_margin_right_measurement_label" for="box_margin_right_measurement" style="display: none; visibility: hidden;">Margin Right Measurement Unit</label>
|
427 |
-
<select id="box_margin_right_measurement" name="box_margin_right_measurement" disabled="disabled" aria-labelledby="box_margin_right_measurement_label"></select>
|
428 |
-
</td>
|
429 |
-
</tr>
|
430 |
-
</table>
|
431 |
-
</td>
|
432 |
-
</tr>
|
433 |
-
<tr>
|
434 |
-
<td><label for="box_margin_bottom">{#style_dlg.bottom}</label></td>
|
435 |
-
<td>
|
436 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
437 |
-
<tr>
|
438 |
-
<td><input type="text" id="box_margin_bottom" name="box_margin_bottom" class="mceEditableSelect" disabled="disabled" /></td>
|
439 |
-
<td> </td>
|
440 |
-
<td>
|
441 |
-
<label id="box_margin_bottom_measurement_label" for="box_margin_bottom_measurement" style="display: none; visibility: hidden;">Margin Bottom Measurement Unit</label>
|
442 |
-
<select id="box_margin_bottom_measurement" name="box_margin_bottom_measurement" disabled="disabled" aria-labelledby="box_margin_bottom_measurement_label"></select>
|
443 |
-
</td>
|
444 |
-
</tr>
|
445 |
-
</table>
|
446 |
-
</td>
|
447 |
-
</tr>
|
448 |
-
<tr>
|
449 |
-
<td><label for="box_margin_left">{#style_dlg.left}</label></td>
|
450 |
-
<td>
|
451 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
452 |
-
<tr>
|
453 |
-
<td><input type="text" id="box_margin_left" name="box_margin_left" class="mceEditableSelect" disabled="disabled" /></td>
|
454 |
-
<td> </td>
|
455 |
-
<td>
|
456 |
-
<label id="box_margin_left_measurement_label" for="box_margin_left_measurement" style="display: none; visibility: hidden;">Margin Left Measurement Unit</label>
|
457 |
-
<select id="box_margin_left_measurement" name="box_margin_left_measurement" disabled="disabled" aria-labelledby="box_margin_left_measurement_label"></select>
|
458 |
-
</td>
|
459 |
-
</tr>
|
460 |
-
</table>
|
461 |
-
</td>
|
462 |
-
</tr>
|
463 |
-
</table>
|
464 |
-
</fieldset>
|
465 |
-
</div>
|
466 |
-
<br style="clear: both" />
|
467 |
-
</div>
|
468 |
-
|
469 |
-
<div id="border_panel" class="panel">
|
470 |
-
<fieldset>
|
471 |
-
<legend>{#style_dlg.border}</legend>
|
472 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0" width="100%">
|
473 |
-
<tr>
|
474 |
-
<td class="tdelim"> </td>
|
475 |
-
<td class="tdelim delim"> </td>
|
476 |
-
<td class="tdelim">{#style_dlg.style}</td>
|
477 |
-
<td class="tdelim delim"> </td>
|
478 |
-
<td class="tdelim">{#style_dlg.width}</td>
|
479 |
-
<td class="tdelim delim"> </td>
|
480 |
-
<td class="tdelim">{#style_dlg.color}</td>
|
481 |
-
</tr>
|
482 |
-
|
483 |
-
<tr>
|
484 |
-
<td> </td>
|
485 |
-
<td class="delim"> </td>
|
486 |
-
<td><input type="checkbox" id="border_style_same" name="border_style_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_style');" /> <label for="border_style_same">{#style_dlg.same}</label></td>
|
487 |
-
<td class="delim"> </td>
|
488 |
-
<td><input type="checkbox" id="border_width_same" name="border_width_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_width');" /> <label for="border_width_same">{#style_dlg.same}</label></td>
|
489 |
-
<td class="delim"> </td>
|
490 |
-
<td><input type="checkbox" id="border_color_same" name="border_color_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_color');" /> <label for="border_color_same">{#style_dlg.same}</label></td>
|
491 |
-
</tr>
|
492 |
-
|
493 |
-
<tr>
|
494 |
-
<td>{#style_dlg.top}</td>
|
495 |
-
<td class="delim"> </td>
|
496 |
-
<td><select id="border_style_top" name="border_style_top" class="mceEditableSelect"></select></td>
|
497 |
-
<td class="delim"> </td>
|
498 |
-
<td>
|
499 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
500 |
-
<tr>
|
501 |
-
<td><select id="border_width_top" name="border_width_top" class="mceEditableSelect"></select></td>
|
502 |
-
<td> </td>
|
503 |
-
<td>
|
504 |
-
<label id="border_width_top_measurement_label" for="border_width_top_measurement" style="display: none; visibility: hidden;">Width top Measurement Unit</label>
|
505 |
-
<select id="border_width_top_measurement" name="border_width_top_measurement" aria-labelledby="border_width_top_measurement_label"></select>
|
506 |
-
</td>
|
507 |
-
</tr>
|
508 |
-
</table>
|
509 |
-
</td>
|
510 |
-
<td class="delim"> </td>
|
511 |
-
<td>
|
512 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
513 |
-
<tr>
|
514 |
-
<td><input id="border_color_top" name="border_color_top" type="text" value="" size="9" onChange="updateColor('border_color_top_pick','border_color_top');" /></td>
|
515 |
-
<td id="border_color_top_pickcontainer"> </td>
|
516 |
-
</tr>
|
517 |
-
</table>
|
518 |
-
</td>
|
519 |
-
</tr>
|
520 |
-
|
521 |
-
<tr>
|
522 |
-
<td>{#style_dlg.right}</td>
|
523 |
-
<td class="delim"> </td>
|
524 |
-
<td><select id="border_style_right" name="border_style_right" class="mceEditableSelect" disabled="disabled"></select></td>
|
525 |
-
<td class="delim"> </td>
|
526 |
-
<td>
|
527 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
528 |
-
<tr>
|
529 |
-
<td><select id="border_width_right" name="border_width_right" class="mceEditableSelect" disabled="disabled"></select></td>
|
530 |
-
<td> </td>
|
531 |
-
<td>
|
532 |
-
<label id="border_width_right_measurement_label" for="border_width_right_measurement" style="display: none; visibility: hidden;">Width Right Measurement Unit</label>
|
533 |
-
<select id="border_width_right_measurement" name="border_width_right_measurement" disabled="disabled" aria-labelledby="border_width_right_measurement_label"></select>
|
534 |
-
</td>
|
535 |
-
</tr>
|
536 |
-
</table>
|
537 |
-
</td>
|
538 |
-
<td class="delim"> </td>
|
539 |
-
<td>
|
540 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
541 |
-
<tr>
|
542 |
-
<td><input id="border_color_right" name="border_color_right" type="text" value="" size="9" onChange="updateColor('border_color_right_pick','border_color_right');" disabled="disabled" /></td>
|
543 |
-
<td id="border_color_right_pickcontainer"> </td>
|
544 |
-
</tr>
|
545 |
-
</table>
|
546 |
-
</td>
|
547 |
-
</tr>
|
548 |
-
|
549 |
-
<tr>
|
550 |
-
<td>{#style_dlg.bottom}</td>
|
551 |
-
<td class="delim"> </td>
|
552 |
-
<td><select id="border_style_bottom" name="border_style_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
|
553 |
-
<td class="delim"> </td>
|
554 |
-
<td>
|
555 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
556 |
-
<tr>
|
557 |
-
<td><select id="border_width_bottom" name="border_width_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
|
558 |
-
<td> </td>
|
559 |
-
<td>
|
560 |
-
<label id="border_width_bottom_measurement_label" for="border_width_bottom_measurement" style="display: none; visibility: hidden;">Width Bottom Measurement Unit</label>
|
561 |
-
<select id="border_width_bottom_measurement" name="border_width_bottom_measurement" disabled="disabled" aria-labelledby="border_width_bottom_measurement_label"></select>
|
562 |
-
</td>
|
563 |
-
</tr>
|
564 |
-
</table>
|
565 |
-
</td>
|
566 |
-
<td class="delim"> </td>
|
567 |
-
<td>
|
568 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
569 |
-
<tr>
|
570 |
-
<td><input id="border_color_bottom" name="border_color_bottom" type="text" value="" size="9" onChange="updateColor('border_color_bottom_pick','border_color_bottom');" disabled="disabled" /></td>
|
571 |
-
<td id="border_color_bottom_pickcontainer"> </td>
|
572 |
-
</tr>
|
573 |
-
</table>
|
574 |
-
</td>
|
575 |
-
</tr>
|
576 |
-
|
577 |
-
<tr>
|
578 |
-
<td>{#style_dlg.left}</td>
|
579 |
-
<td class="delim"> </td>
|
580 |
-
<td><select id="border_style_left" name="border_style_left" class="mceEditableSelect" disabled="disabled"></select></td>
|
581 |
-
<td class="delim"> </td>
|
582 |
-
<td>
|
583 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
584 |
-
<tr>
|
585 |
-
<td><select id="border_width_left" name="border_width_left" class="mceEditableSelect" disabled="disabled"></select></td>
|
586 |
-
<td> </td>
|
587 |
-
<td>
|
588 |
-
<label id="border_width_left_measurement_label" for="border_width_left_measurement" style="display: none; visibility: hidden;">Width Left Measurement Unit</label>
|
589 |
-
<select id="border_width_left_measurement" name="border_width_left_measurement" disabled="disabled" aria-labelledby="border_width_left_measurement_label"></select>
|
590 |
-
</td>
|
591 |
-
</tr>
|
592 |
-
</table>
|
593 |
-
</td>
|
594 |
-
<td class="delim"> </td>
|
595 |
-
<td>
|
596 |
-
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
597 |
-
<tr>
|
598 |
-
<td><input id="border_color_left" name="border_color_left" type="text" value="" size="9" onChange="updateColor('border_color_left_pick','border_color_left');" disabled="disabled" /></td>
|
599 |
-
<td id="border_color_left_pickcontainer"> </td>
|
600 |
-
</tr>
|
601 |
-
</table>
|
602 |
-
</td>
|
603 |
-
</tr>
|
604 |
-
</table>
|
605 |
-
</fieldset>
|
606 |
-
</div>
|
607 |
-
|
608 |
-
<div id="list_panel" class="panel">
|
609 |
-
<fieldset>
|
610 |
-
<legend>{#style_dlg.list}</legend>
|
611 |
-
<table role="presentation" border="0">
|
612 |
-
<tr>
|
613 |
-
<td><label for="list_type">{#style_dlg.list_type}</label></td>
|
614 |
-
<td><select id="list_type" name="list_type" class="mceEditableSelect"></select></td>
|
615 |
-
</tr>
|
616 |
-
|
617 |
-
<tr>
|
618 |
-
<td><label for="list_bullet_image">{#style_dlg.bullet_image}</label></td>
|
619 |
-
<td><input id="list_bullet_image" name="list_bullet_image" type="text" /></td>
|
620 |
-
</tr>
|
621 |
-
|
622 |
-
<tr>
|
623 |
-
<td><label for="list_position">{#style_dlg.position}</label></td>
|
624 |
-
<td><select id="list_position" name="list_position" class="mceEditableSelect"></select></td>
|
625 |
-
</tr>
|
626 |
-
</table>
|
627 |
-
</fieldset>
|
628 |
-
</div>
|
629 |
-
|
630 |
-
<div id="positioning_panel" class="panel">
|
631 |
-
<fieldset>
|
632 |
-
<legend>{#style_dlg.position}</legend>
|
633 |
-
<table role="presentation" border="0">
|
634 |
-
<tr>
|
635 |
-
<td><label for="positioning_type">{#style_dlg.positioning_type}</label></td>
|
636 |
-
<td><select id="positioning_type" name="positioning_type" class="mceEditableSelect"></select></td>
|
637 |
-
<td> <label for="positioning_visibility">{#style_dlg.visibility}</label></td>
|
638 |
-
<td><select id="positioning_visibility" name="positioning_visibility" class="mceEditableSelect"></select></td>
|
639 |
-
</tr>
|
640 |
-
|
641 |
-
<tr>
|
642 |
-
<td><label for="positioning_width">{#style_dlg.width}</label></td>
|
643 |
-
<td>
|
644 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
645 |
-
<tr>
|
646 |
-
<td><input type="text" id="positioning_width" name="positioning_width" onChange="synch('positioning_width','box_width');" /></td>
|
647 |
-
<td> </td>
|
648 |
-
<td>
|
649 |
-
<label id="positioning_width_measurement_label" for="positioning_width_measurement" style="display: none; visibility: hidden;">Positioning width Measurement Unit</label>
|
650 |
-
<select id="positioning_width_measurement" name="positioning_width_measurement" aria-labelledby="positioning_width_measurement_label"></select>
|
651 |
-
</td>
|
652 |
-
</tr>
|
653 |
-
</table>
|
654 |
-
</td>
|
655 |
-
<td> <label for="positioning_zindex">{#style_dlg.zindex}</label></td>
|
656 |
-
<td><input type="text" id="positioning_zindex" name="positioning_zindex" /></td>
|
657 |
-
</tr>
|
658 |
-
|
659 |
-
<tr>
|
660 |
-
<td><label for="positioning_height">{#style_dlg.height}</label></td>
|
661 |
-
<td>
|
662 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
663 |
-
<tr>
|
664 |
-
<td><input type="text" id="positioning_height" name="positioning_height" onChange="synch('positioning_height','box_height');" /></td>
|
665 |
-
<td> </td>
|
666 |
-
<td>
|
667 |
-
<label id="positioning_height_measurement_label" for="positioning_height_measurement" style="display: none; visibility: hidden;">Positioning Height Measurement Unit</label>
|
668 |
-
<select id="positioning_height_measurement" name="positioning_height_measurement" aria-labelledby="positioning_height_measurement_label"></select>
|
669 |
-
</td>
|
670 |
-
</tr>
|
671 |
-
</table>
|
672 |
-
</td>
|
673 |
-
<td> <label for="positioning_overflow">{#style_dlg.overflow}</label></td>
|
674 |
-
<td><select id="positioning_overflow" name="positioning_overflow" class="mceEditableSelect"></select></td>
|
675 |
-
</tr>
|
676 |
-
</table>
|
677 |
-
</fieldset>
|
678 |
-
|
679 |
-
<div style="float: left; width: 49%">
|
680 |
-
<fieldset>
|
681 |
-
<legend>{#style_dlg.placement}</legend>
|
682 |
-
|
683 |
-
<table role="presentation" border="0">
|
684 |
-
<tr>
|
685 |
-
<td> </td>
|
686 |
-
<td><input type="checkbox" id="positioning_placement_same" name="positioning_placement_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_placement');" /> <label for="positioning_placement_same">{#style_dlg.same}</label></td>
|
687 |
-
</tr>
|
688 |
-
<tr>
|
689 |
-
<td>{#style_dlg.top}</td>
|
690 |
-
<td>
|
691 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
692 |
-
<tr>
|
693 |
-
<td><input type="text" id="positioning_placement_top" name="positioning_placement_top" /></td>
|
694 |
-
<td> </td>
|
695 |
-
<td>
|
696 |
-
<label id="positioning_placement_top_measurement_label" for="positioning_placement_top_measurement" style="display: none; visibility: hidden;">Placement Top Measurement Unit</label>
|
697 |
-
<select id="positioning_placement_top_measurement" name="positioning_placement_top_measurement" aria-labelledby="positioning_placement_top_measurement_label"></select>
|
698 |
-
</td>
|
699 |
-
</tr>
|
700 |
-
</table>
|
701 |
-
</td>
|
702 |
-
</tr>
|
703 |
-
<tr>
|
704 |
-
<td>{#style_dlg.right}</td>
|
705 |
-
<td>
|
706 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
707 |
-
<tr>
|
708 |
-
<td><input type="text" id="positioning_placement_right" name="positioning_placement_right" disabled="disabled" /></td>
|
709 |
-
<td> </td>
|
710 |
-
<td>
|
711 |
-
<label id="positioning_placement_right_measurement_label" for="positioning_placement_right_measurement" style="display: none; visibility: hidden;">Placement Right Measurement Unit</label>
|
712 |
-
<select id="positioning_placement_right_measurement" name="positioning_placement_right_measurement" disabled="disabled" aria-labelledby="positioning_placement_right_measurement_label"></select>
|
713 |
-
</td>
|
714 |
-
</tr>
|
715 |
-
</table>
|
716 |
-
</td>
|
717 |
-
</tr>
|
718 |
-
<tr>
|
719 |
-
<td>{#style_dlg.bottom}</td>
|
720 |
-
<td>
|
721 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
722 |
-
<tr>
|
723 |
-
<td><input type="text" id="positioning_placement_bottom" name="positioning_placement_bottom" disabled="disabled" /></td>
|
724 |
-
<td> </td>
|
725 |
-
<td>
|
726 |
-
<label id="positioning_placement_bottom_measurement_label" for="positioning_placement_bottom_measurement" style="display: none; visibility: hidden;">Placement Bottom Measurement Unit</label>
|
727 |
-
<select id="positioning_placement_bottom_measurement" name="positioning_placement_bottom_measurement" disabled="disabled" aria-labelledby="positioning_placement_bottom_measurement_label"></select>
|
728 |
-
</td>
|
729 |
-
</tr>
|
730 |
-
</table>
|
731 |
-
</td>
|
732 |
-
</tr>
|
733 |
-
<tr>
|
734 |
-
<td>{#style_dlg.left}</td>
|
735 |
-
<td>
|
736 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
737 |
-
<tr>
|
738 |
-
<td><input type="text" id="positioning_placement_left" name="positioning_placement_left" disabled="disabled" /></td>
|
739 |
-
<td> </td>
|
740 |
-
<td>
|
741 |
-
<label id="positioning_placement_left_measurement_label" for="positioning_placement_left_measurement" style="display: none; visibility: hidden;">Placement Left Measurement Unit</label>
|
742 |
-
<select id="positioning_placement_left_measurement" name="positioning_placement_left_measurement" disabled="disabled" aria-labelledby="positioning_placement_left_measurement_label"></select>
|
743 |
-
</td>
|
744 |
-
</tr>
|
745 |
-
</table>
|
746 |
-
</td>
|
747 |
-
</tr>
|
748 |
-
</table>
|
749 |
-
</fieldset>
|
750 |
-
</div>
|
751 |
-
|
752 |
-
<div style="float: right; width: 49%">
|
753 |
-
<fieldset>
|
754 |
-
<legend>{#style_dlg.clip}</legend>
|
755 |
-
|
756 |
-
<table role="presentation" border="0">
|
757 |
-
<tr>
|
758 |
-
<td> </td>
|
759 |
-
<td><input type="checkbox" id="positioning_clip_same" name="positioning_clip_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_clip');" /> <label for="positioning_clip_same">{#style_dlg.same}</label></td>
|
760 |
-
</tr>
|
761 |
-
<tr>
|
762 |
-
<td>{#style_dlg.top}</td>
|
763 |
-
<td>
|
764 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
765 |
-
<tr>
|
766 |
-
<td><input type="text" id="positioning_clip_top" name="positioning_clip_top" /></td>
|
767 |
-
<td> </td>
|
768 |
-
<td>
|
769 |
-
<label id="positioning_clip_top_measurement_label" for="positioning_clip_top_measurement" style="display: none; visibility: hidden;">Clip Top Measurement Unit</label>
|
770 |
-
<select id="positioning_clip_top_measurement" name="positioning_clip_top_measurement" aria-labelledby="positioning_clip_top_measurement_label"></select>
|
771 |
-
</td>
|
772 |
-
</tr>
|
773 |
-
</table>
|
774 |
-
</td>
|
775 |
-
</tr>
|
776 |
-
<tr>
|
777 |
-
<td>{#style_dlg.right}</td>
|
778 |
-
<td>
|
779 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
780 |
-
<tr>
|
781 |
-
<td><input type="text" id="positioning_clip_right" name="positioning_clip_right" disabled="disabled" /></td>
|
782 |
-
<td> </td>
|
783 |
-
<td>
|
784 |
-
<label id="positioning_clip_right_measurement_label" for="positioning_clip_right_measurement" style="display: none; visibility: hidden;">Clip Right Measurement Unit</label>
|
785 |
-
<select id="positioning_clip_right_measurement" name="positioning_clip_right_measurement" disabled="disabled" aria-labelledby="positioning_clip_right_measurement_label"></select>
|
786 |
-
</td>
|
787 |
-
</tr>
|
788 |
-
</table>
|
789 |
-
</td>
|
790 |
-
</tr>
|
791 |
-
<tr>
|
792 |
-
<td>{#style_dlg.bottom}</td>
|
793 |
-
<td>
|
794 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
795 |
-
<tr>
|
796 |
-
<td><input type="text" id="positioning_clip_bottom" name="positioning_clip_bottom" disabled="disabled" /></td>
|
797 |
-
<td> </td>
|
798 |
-
<td>
|
799 |
-
<label id="positioning_clip_bottom_measurement_label" for="positioning_clip_bottom_measurement" style="display: none; visibility: hidden;">Clip Bottom Measurement Unit</label>
|
800 |
-
<select id="positioning_clip_bottom_measurement" name="positioning_clip_bottom_measurement" disabled="disabled" aria-labelledby="positioning_clip_bottom_measurement_label"></select>
|
801 |
-
</td>
|
802 |
-
</tr>
|
803 |
-
</table>
|
804 |
-
</td>
|
805 |
-
</tr>
|
806 |
-
<tr>
|
807 |
-
<td>{#style_dlg.left}</td>
|
808 |
-
<td>
|
809 |
-
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
810 |
-
<tr>
|
811 |
-
<td><input type="text" id="positioning_clip_left" name="positioning_clip_left" disabled="disabled" /></td>
|
812 |
-
<td> </td>
|
813 |
-
<td>
|
814 |
-
<label id="positioning_clip_left_measurement_label" for="positioning_clip_left_measurement" style="display: none; visibility: hidden;">Clip Left Measurement Unit</label>
|
815 |
-
<select id="positioning_clip_left_measurement" name="positioning_clip_left_measurement" disabled="disabled" aria-labelledby="positioning_clip_left_measurement_label"></select>
|
816 |
-
</td>
|
817 |
-
</tr>
|
818 |
-
</table>
|
819 |
-
</td>
|
820 |
-
</tr>
|
821 |
-
</table>
|
822 |
-
</fieldset>
|
823 |
-
</div>
|
824 |
-
<br style="clear: both" />
|
825 |
-
</div>
|
826 |
-
</div>
|
827 |
-
|
828 |
-
<div class="panel_toggle_insert_span">
|
829 |
-
<input type="checkbox" class="checkbox" id="toggle_insert_span" name="toggle_insert_span" onClick="toggleApplyAction();" />
|
830 |
-
<label for="toggle_insert_span">{#style_dlg.toggle_insert_span}</label>
|
831 |
-
</div>
|
832 |
-
|
833 |
-
<div class="mceActionPanel">
|
834 |
-
<input type="submit" id="insert" name="insert" value="{#update}" />
|
835 |
-
<input type="button" class="button" id="apply" name="apply" value="{#style_dlg.apply}" onClick="applyAction();" />
|
836 |
-
<input type="button" id="cancel" name="cancel" value="{#cancel}" onClick="tinyMCEPopup.close();" />
|
837 |
-
</div>
|
838 |
-
</form>
|
839 |
-
|
840 |
-
<div style="display: none">
|
841 |
-
<div id="container"></div>
|
842 |
-
</div>
|
843 |
-
|
844 |
-
</body>
|
845 |
-
</html>
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title>{#style_dlg.title}</title>
|
5 |
+
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
6 |
+
<script type="text/javascript" src="../../utils/mctabs.js"></script>
|
7 |
+
<script type="text/javascript" src="../../utils/editable_selects.js"></script>
|
8 |
+
<script type="text/javascript" src="../../utils/form_utils.js"></script>
|
9 |
+
<script type="text/javascript" src="js/props.js"></script>
|
10 |
+
<link href="css/props.css" rel="stylesheet" type="text/css" />
|
11 |
+
</head>
|
12 |
+
|
13 |
+
<body id="styleprops" style="display: none" role="application" aria-labelledby="app_title">
|
14 |
+
<span id="app_title" style="display:none">{#style_dlg.title}</span>
|
15 |
+
<form onsubmit="updateAction();return false;" action="#">
|
16 |
+
<div class="tabs">
|
17 |
+
<ul>
|
18 |
+
<li id="text_tab" class="current" aria-controls="text_panel"><span><a href="javascript:mcTabs.displayTab('text_tab','text_panel');" onMouseDown="return false;">{#style_dlg.text_tab}</a></span></li>
|
19 |
+
<li id="background_tab" aria-controls="background_panel"><span><a href="javascript:mcTabs.displayTab('background_tab','background_panel');" onMouseDown="return false;">{#style_dlg.background_tab}</a></span></li>
|
20 |
+
<li id="block_tab" aria-controls="block_panel"><span><a href="javascript:mcTabs.displayTab('block_tab','block_panel');" onMouseDown="return false;">{#style_dlg.block_tab}</a></span></li>
|
21 |
+
<li id="box_tab" aria-controls="box_panel"><span><a href="javascript:mcTabs.displayTab('box_tab','box_panel');" onMouseDown="return false;">{#style_dlg.box_tab}</a></span></li>
|
22 |
+
<li id="border_tab" aria-controls="border_panel"><span><a href="javascript:mcTabs.displayTab('border_tab','border_panel');" onMouseDown="return false;">{#style_dlg.border_tab}</a></span></li>
|
23 |
+
<li id="list_tab" aria-controls="list_panel"><span><a href="javascript:mcTabs.displayTab('list_tab','list_panel');" onMouseDown="return false;">{#style_dlg.list_tab}</a></span></li>
|
24 |
+
<li id="positioning_tab" aria-controls="positioning_panel"><span><a href="javascript:mcTabs.displayTab('positioning_tab','positioning_panel');" onMouseDown="return false;">{#style_dlg.positioning_tab}</a></span></li>
|
25 |
+
</ul>
|
26 |
+
</div>
|
27 |
+
|
28 |
+
<div class="panel_wrapper">
|
29 |
+
<div id="text_panel" class="panel current">
|
30 |
+
<fieldset>
|
31 |
+
<legend>{#style_dlg.text}</legend>
|
32 |
+
<table role="presentation" border="0" width="100%">
|
33 |
+
<tr>
|
34 |
+
<td><label for="text_font">{#style_dlg.text_font}</label></td>
|
35 |
+
<td colspan="3">
|
36 |
+
<select id="text_font" name="text_font" class="mceEditableSelect mceFocus"></select>
|
37 |
+
</td>
|
38 |
+
</tr>
|
39 |
+
<tr>
|
40 |
+
<td><label for="text_size">{#style_dlg.text_size}</label></td>
|
41 |
+
<td>
|
42 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
43 |
+
<tr>
|
44 |
+
<td><select id="text_size" name="text_size" class="mceEditableSelect"></select></td>
|
45 |
+
<td> </td>
|
46 |
+
<td>
|
47 |
+
<label id="text_size_measurement_label" for="text_size_measurement" style="display: none; visibility: hidden;">Text Size Measurement Unit</label>
|
48 |
+
<select id="text_size_measurement" name="text_size_measurement" aria-labelledby="text_size_measurement_label"></select>
|
49 |
+
</td>
|
50 |
+
</tr>
|
51 |
+
</table>
|
52 |
+
</td>
|
53 |
+
<td><label for="text_weight">{#style_dlg.text_weight}</label></td>
|
54 |
+
<td>
|
55 |
+
<select id="text_weight" name="text_weight"></select>
|
56 |
+
</td>
|
57 |
+
</tr>
|
58 |
+
<tr>
|
59 |
+
<td><label for="text_style">{#style_dlg.text_style}</label></td>
|
60 |
+
<td>
|
61 |
+
<select id="text_style" name="text_style" class="mceEditableSelect"></select>
|
62 |
+
</td>
|
63 |
+
<td><label for="text_variant">{#style_dlg.text_variant}</label></td>
|
64 |
+
<td>
|
65 |
+
<select id="text_variant" name="text_variant"></select>
|
66 |
+
</td>
|
67 |
+
</tr>
|
68 |
+
<tr>
|
69 |
+
<td><label for="text_lineheight">{#style_dlg.text_lineheight}</label></td>
|
70 |
+
<td>
|
71 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
72 |
+
<tr>
|
73 |
+
<td>
|
74 |
+
<select id="text_lineheight" name="text_lineheight" class="mceEditableSelect"></select>
|
75 |
+
</td>
|
76 |
+
<td> </td>
|
77 |
+
<td>
|
78 |
+
<label id="text_lineheight_measurement_label" for="text_lineheight_measurement" style="display: none; visibility: hidden;">Line Height Measurement Unit</label>
|
79 |
+
<select id="text_lineheight_measurement" name="text_lineheight_measurement" aria-labelledby="text_lineheight_measurement_label"></select>
|
80 |
+
</td>
|
81 |
+
</tr>
|
82 |
+
</table>
|
83 |
+
</td>
|
84 |
+
<td><label for="text_case">{#style_dlg.text_case}</label></td>
|
85 |
+
<td>
|
86 |
+
<select id="text_case" name="text_case"></select>
|
87 |
+
</td>
|
88 |
+
</tr>
|
89 |
+
<tr>
|
90 |
+
<td><label for="text_color">{#style_dlg.text_color}</label></td>
|
91 |
+
<td colspan="2">
|
92 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
93 |
+
<tr>
|
94 |
+
<td><input id="text_color" name="text_color" type="text" value="" size="9" onChange="updateColor('text_color_pick','text_color');" /></td>
|
95 |
+
<td id="text_color_pickcontainer"> </td>
|
96 |
+
</tr>
|
97 |
+
</table>
|
98 |
+
</td>
|
99 |
+
</tr>
|
100 |
+
<tr>
|
101 |
+
<td valign="top" style="vertical-align: top; padding-top: 3px;">{#style_dlg.text_decoration}</td>
|
102 |
+
<td colspan="2">
|
103 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
104 |
+
<tr>
|
105 |
+
<td><input id="text_underline" name="text_underline" class="checkbox" type="checkbox" /></td>
|
106 |
+
<td><label for="text_underline">{#style_dlg.text_underline}</label></td>
|
107 |
+
</tr>
|
108 |
+
<tr>
|
109 |
+
<td><input id="text_overline" name="text_overline" class="checkbox" type="checkbox" /></td>
|
110 |
+
<td><label for="text_overline">{#style_dlg.text_overline}</label></td>
|
111 |
+
</tr>
|
112 |
+
<tr>
|
113 |
+
<td><input id="text_linethrough" name="text_linethrough" class="checkbox" type="checkbox" /></td>
|
114 |
+
<td><label for="text_linethrough">{#style_dlg.text_striketrough}</label></td>
|
115 |
+
</tr>
|
116 |
+
<tr>
|
117 |
+
<td><input id="text_blink" name="text_blink" class="checkbox" type="checkbox" /></td>
|
118 |
+
<td><label for="text_blink">{#style_dlg.text_blink}</label></td>
|
119 |
+
</tr>
|
120 |
+
<tr>
|
121 |
+
<td><input id="text_none" name="text_none" class="checkbox" type="checkbox" onclick="updateTextDecorations();"/></td>
|
122 |
+
<td><label for="text_none">{#style_dlg.text_none}</label></td>
|
123 |
+
</tr>
|
124 |
+
</table>
|
125 |
+
</td>
|
126 |
+
</tr>
|
127 |
+
</table>
|
128 |
+
</fieldset>
|
129 |
+
</div>
|
130 |
+
|
131 |
+
<div id="background_panel" class="panel">
|
132 |
+
<fieldset>
|
133 |
+
<legend>{#style_dlg.background}</legend>
|
134 |
+
<table role="presentation" border="0">
|
135 |
+
<tr>
|
136 |
+
<td><label for="background_color">{#style_dlg.background_color}</label></td>
|
137 |
+
<td>
|
138 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
139 |
+
<tr>
|
140 |
+
<td><input id="background_color" name="background_color" type="text" value="" size="9" onChange="updateColor('background_color_pick','background_color');" /></td>
|
141 |
+
<td id="background_color_pickcontainer"> </td>
|
142 |
+
</tr>
|
143 |
+
</table>
|
144 |
+
</td>
|
145 |
+
</tr>
|
146 |
+
|
147 |
+
<tr>
|
148 |
+
<td><label for="background_image">{#style_dlg.background_image}</label></td>
|
149 |
+
<td><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
150 |
+
<tr>
|
151 |
+
<td><input id="background_image" name="background_image" type="text" /></td>
|
152 |
+
<td id="background_image_browser"> </td>
|
153 |
+
</tr>
|
154 |
+
</table>
|
155 |
+
</td>
|
156 |
+
</tr>
|
157 |
+
|
158 |
+
<tr>
|
159 |
+
<td><label for="background_repeat">{#style_dlg.background_repeat}</label></td>
|
160 |
+
<td><select id="background_repeat" name="background_repeat" class="mceEditableSelect"></select></td>
|
161 |
+
</tr>
|
162 |
+
|
163 |
+
<tr>
|
164 |
+
<td><label for="background_attachment">{#style_dlg.background_attachment}</label></td>
|
165 |
+
<td><select id="background_attachment" name="background_attachment" class="mceEditableSelect"></select></td>
|
166 |
+
</tr>
|
167 |
+
|
168 |
+
<tr>
|
169 |
+
<td><label for="background_hpos">{#style_dlg.background_hpos}</label></td>
|
170 |
+
<td>
|
171 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
172 |
+
<tr>
|
173 |
+
<td><select id="background_hpos" name="background_hpos" class="mceEditableSelect"></select></td>
|
174 |
+
<td> </td>
|
175 |
+
<td>
|
176 |
+
<label id="background_hpos_measurement_label" for="background_hpos_measurement" style="display: none; visibility: hidden;">Horizontal position measurement unit</label>
|
177 |
+
<select id="background_hpos_measurement" name="background_hpos_measurement" aria-labelledby="background_hpos_measurement_label"></select>
|
178 |
+
</td>
|
179 |
+
</tr>
|
180 |
+
</table>
|
181 |
+
</td>
|
182 |
+
</tr>
|
183 |
+
|
184 |
+
<tr>
|
185 |
+
<td><label for="background_vpos">{#style_dlg.background_vpos}</label></td>
|
186 |
+
<td>
|
187 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
188 |
+
<tr>
|
189 |
+
<td><select id="background_vpos" name="background_vpos" class="mceEditableSelect"></select></td>
|
190 |
+
<td> </td>
|
191 |
+
<td>
|
192 |
+
|
193 |
+
<label id="background_vpos_measurement_label" for="background_vpos_measurement" style="display: none; visibility: hidden;">Vertical position measurement unit</label>
|
194 |
+
<select id="background_vpos_measurement" name="background_vpos_measurement" aria-labelledby="background_vpos_measurement_label">></select></td>
|
195 |
+
</tr>
|
196 |
+
</table>
|
197 |
+
</td>
|
198 |
+
</tr>
|
199 |
+
</table>
|
200 |
+
</fieldset>
|
201 |
+
</div>
|
202 |
+
|
203 |
+
<div id="block_panel" class="panel">
|
204 |
+
<fieldset>
|
205 |
+
<legend>{#style_dlg.block}</legend>
|
206 |
+
<table role="presentation" border="0">
|
207 |
+
<tr>
|
208 |
+
<td><label for="block_wordspacing">{#style_dlg.block_wordspacing}</label></td>
|
209 |
+
<td>
|
210 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
211 |
+
<tr>
|
212 |
+
<td><select id="block_wordspacing" name="block_wordspacing" class="mceEditableSelect"></select></td>
|
213 |
+
<td> </td>
|
214 |
+
<td>
|
215 |
+
<label id="block_wordspacing_measurement_label" for="block_wordspacing_measurement" style="display: none; visibility: hidden;">Word spacing measurement unit</label>
|
216 |
+
<select id="block_wordspacing_measurement" name="block_wordspacing_measurement" aria-labelledby="block_wordspacing_measurement_label"></select>
|
217 |
+
</td>
|
218 |
+
</tr>
|
219 |
+
</table>
|
220 |
+
</td>
|
221 |
+
</tr>
|
222 |
+
|
223 |
+
<tr>
|
224 |
+
<td><label for="block_letterspacing">{#style_dlg.block_letterspacing}</label></td>
|
225 |
+
<td>
|
226 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
227 |
+
<tr>
|
228 |
+
<td><select id="block_letterspacing" name="block_letterspacing" class="mceEditableSelect"></select></td>
|
229 |
+
<td> </td>
|
230 |
+
<td>
|
231 |
+
<label id="block_letterspacing_measurement_label" for="block_letterspacing_measurement" style="display: none; visibility: hidden;">Letter spacing measurement unit</label>
|
232 |
+
<select id="block_letterspacing_measurement" name="block_letterspacing_measurement" aria-labelledby="block_letterspacing_measurement_label"></select>
|
233 |
+
</td>
|
234 |
+
</tr>
|
235 |
+
</table>
|
236 |
+
</td>
|
237 |
+
</tr>
|
238 |
+
|
239 |
+
<tr>
|
240 |
+
<td><label for="block_vertical_alignment">{#style_dlg.block_vertical_alignment}</label></td>
|
241 |
+
<td><select id="block_vertical_alignment" name="block_vertical_alignment" class="mceEditableSelect"></select></td>
|
242 |
+
</tr>
|
243 |
+
|
244 |
+
<tr>
|
245 |
+
<td><label for="block_text_align">{#style_dlg.block_text_align}</label></td>
|
246 |
+
<td><select id="block_text_align" name="block_text_align" class="mceEditableSelect"></select></td>
|
247 |
+
</tr>
|
248 |
+
|
249 |
+
<tr>
|
250 |
+
<td><label for="block_text_indent">{#style_dlg.block_text_indent}</label></td>
|
251 |
+
<td>
|
252 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
253 |
+
<tr>
|
254 |
+
<td><input type="text" id="block_text_indent" name="block_text_indent" /></td>
|
255 |
+
<td> </td>
|
256 |
+
<td>
|
257 |
+
<label id="block_text_indent_measurement_label" for="block_text_indent_measurement" style="display: none; visibility: hidden;">Text Indent Measurement Unit</label>
|
258 |
+
|
259 |
+
<select id="block_text_indent_measurement" name="block_text_indent_measurement" aria-labelledby="block_text_indent_measurement_label"></select>
|
260 |
+
</td>
|
261 |
+
</tr>
|
262 |
+
</table>
|
263 |
+
</td>
|
264 |
+
</tr>
|
265 |
+
|
266 |
+
<tr>
|
267 |
+
<td><label for="block_whitespace">{#style_dlg.block_whitespace}</label></td>
|
268 |
+
<td><select id="block_whitespace" name="block_whitespace" class="mceEditableSelect"></select></td>
|
269 |
+
</tr>
|
270 |
+
|
271 |
+
<tr>
|
272 |
+
<td><label for="block_display">{#style_dlg.block_display}</label></td>
|
273 |
+
<td><select id="block_display" name="block_display" class="mceEditableSelect"></select></td>
|
274 |
+
</tr>
|
275 |
+
</table>
|
276 |
+
</fieldset>
|
277 |
+
</div>
|
278 |
+
|
279 |
+
<div id="box_panel" class="panel">
|
280 |
+
<fieldset>
|
281 |
+
<legend>{#style_dlg.box}</legend>
|
282 |
+
<table role="presentation" border="0">
|
283 |
+
<tr>
|
284 |
+
<td><label for="box_width">{#style_dlg.box_width}</label></td>
|
285 |
+
<td>
|
286 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
287 |
+
<tr>
|
288 |
+
<td><input type="text" id="box_width" name="box_width" class="mceEditableSelect" onChange="synch('box_width','positioning_width');" /></td>
|
289 |
+
<td> </td>
|
290 |
+
<td>
|
291 |
+
<label id="box_width_measurement_label" for="box_width_measurement" style="display: none; visibility: hidden;">Box Width Measurement Unit</label>
|
292 |
+
<select id="box_width_measurement" name="box_width_measurement" aria-labelledby="box_width_measurement_label"></select>
|
293 |
+
</td>
|
294 |
+
</tr>
|
295 |
+
</table>
|
296 |
+
</td>
|
297 |
+
<td> <label for="box_float">{#style_dlg.box_float}</label></td>
|
298 |
+
<td><select id="box_float" name="box_float" class="mceEditableSelect"></select></td>
|
299 |
+
</tr>
|
300 |
+
|
301 |
+
<tr>
|
302 |
+
<td><label for="box_height">{#style_dlg.box_height}</label></td>
|
303 |
+
<td>
|
304 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
305 |
+
<tr>
|
306 |
+
<td><input type="text" id="box_height" name="box_height" class="mceEditableSelect" onChange="synch('box_height','positioning_height');" /></td>
|
307 |
+
<td> </td>
|
308 |
+
<td>
|
309 |
+
<label id="box_height_measurement_label" for="box_height_measurement" style="display: none; visibility: hidden;">Box Height Measurement Unit</label>
|
310 |
+
<select id="box_height_measurement" name="box_height_measurement" aria-labelledby="box_height_measurement_label"></select>
|
311 |
+
</td>
|
312 |
+
</tr>
|
313 |
+
</table>
|
314 |
+
</td>
|
315 |
+
<td> <label for="box_clear">{#style_dlg.box_clear}</label></td>
|
316 |
+
<td><select id="box_clear" name="box_clear" class="mceEditableSelect"></select></td>
|
317 |
+
</tr>
|
318 |
+
</table>
|
319 |
+
</fieldset>
|
320 |
+
|
321 |
+
<div style="float: left; width: 49%">
|
322 |
+
<fieldset>
|
323 |
+
<legend>{#style_dlg.padding}</legend>
|
324 |
+
|
325 |
+
<table role="presentation" border="0">
|
326 |
+
<tr>
|
327 |
+
<td> </td>
|
328 |
+
<td><input type="checkbox" id="box_padding_same" name="box_padding_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_padding');" /> <label for="box_padding_same">{#style_dlg.same}</label></td>
|
329 |
+
</tr>
|
330 |
+
<tr>
|
331 |
+
<td><label for="box_padding_top">{#style_dlg.top}</label></td>
|
332 |
+
<td>
|
333 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
334 |
+
<tr>
|
335 |
+
<td><input type="text" id="box_padding_top" name="box_padding_top" class="mceEditableSelect" /></td>
|
336 |
+
<td> </td>
|
337 |
+
<td>
|
338 |
+
<label id="box_padding_top_measurement_label" for="box_padding_top_measurement" style="display: none; visibility: hidden;">Padding Top Measurement Unit</label>
|
339 |
+
<select id="box_padding_top_measurement" name="box_padding_top_measurement" aria-labelledby="box_padding_top_measurement_label"></select>
|
340 |
+
</td>
|
341 |
+
</tr>
|
342 |
+
</table>
|
343 |
+
</td>
|
344 |
+
</tr>
|
345 |
+
<tr>
|
346 |
+
<td><label for="box_padding_right">{#style_dlg.right}</label></td>
|
347 |
+
<td>
|
348 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
349 |
+
<tr>
|
350 |
+
<td><input type="text" id="box_padding_right" name="box_padding_right" class="mceEditableSelect" disabled="disabled" /></td>
|
351 |
+
<td> </td>
|
352 |
+
<td>
|
353 |
+
<label id="box_padding_right_measurement_label" for="box_padding_right_measurement" style="display: none; visibility: hidden;">Padding Right Measurement Unit</label>
|
354 |
+
<select id="box_padding_right_measurement" name="box_padding_right_measurement" disabled="disabled" aria-labelledby="box_padding_right_measurement_label"></select>
|
355 |
+
</td>
|
356 |
+
</tr>
|
357 |
+
</table>
|
358 |
+
</td>
|
359 |
+
</tr>
|
360 |
+
<tr>
|
361 |
+
<td><label for="box_padding_bottom">{#style_dlg.bottom}</label></td>
|
362 |
+
<td>
|
363 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
364 |
+
<tr>
|
365 |
+
<td><input type="text" id="box_padding_bottom" name="box_padding_bottom" class="mceEditableSelect" disabled="disabled" /></td>
|
366 |
+
<td> </td>
|
367 |
+
<td>
|
368 |
+
<label id="box_padding_bottom_measurement_label" for="box_padding_bottom_measurement" style="display: none; visibility: hidden;">Padding Bottom Measurement Unit</label>
|
369 |
+
<select id="box_padding_bottom_measurement" name="box_padding_bottom_measurement" disabled="disabled" aria-labelledby="box_padding_bottom_measurement_label"></select>
|
370 |
+
</td>
|
371 |
+
</tr>
|
372 |
+
</table>
|
373 |
+
</td>
|
374 |
+
</tr>
|
375 |
+
<tr>
|
376 |
+
<td><label for="box_padding_left">{#style_dlg.left}</label></td>
|
377 |
+
<td>
|
378 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
379 |
+
<tr>
|
380 |
+
<td><input type="text" id="box_padding_left" name="box_padding_left" class="mceEditableSelect" disabled="disabled" /></td>
|
381 |
+
<td> </td>
|
382 |
+
<td>
|
383 |
+
<label id="box_padding_left_measurement_label" for="box_padding_left_measurement" style="display: none; visibility: hidden;">Padding Left Measurement Unit</label>
|
384 |
+
<select id="box_padding_left_measurement" name="box_padding_left_measurement" disabled="disabled" aria-labelledby="box_padding_left_measurement_label"></select>
|
385 |
+
</td>
|
386 |
+
</tr>
|
387 |
+
</table>
|
388 |
+
</td>
|
389 |
+
</tr>
|
390 |
+
</table>
|
391 |
+
</fieldset>
|
392 |
+
</div>
|
393 |
+
|
394 |
+
<div style="float: right; width: 49%">
|
395 |
+
<fieldset>
|
396 |
+
<legend>{#style_dlg.margin}</legend>
|
397 |
+
|
398 |
+
<table role="presentation" border="0">
|
399 |
+
<tr>
|
400 |
+
<td> </td>
|
401 |
+
<td><input type="checkbox" id="box_margin_same" name="box_margin_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_margin');" /> <label for="box_margin_same">{#style_dlg.same}</label></td>
|
402 |
+
</tr>
|
403 |
+
<tr>
|
404 |
+
<td><label for="box_margin_top">{#style_dlg.top}</label></td>
|
405 |
+
<td>
|
406 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
407 |
+
<tr>
|
408 |
+
<td><input type="text" id="box_margin_top" name="box_margin_top" class="mceEditableSelect" /></td>
|
409 |
+
<td> </td>
|
410 |
+
<td>
|
411 |
+
<label id="box_margin_top_measurement_label" for="box_margin_top_measurement" style="display: none; visibility: hidden;">Margin Top Measurement Unit</label>
|
412 |
+
<select id="box_margin_top_measurement" name="box_margin_top_measurement" aria-labelledby="box_margin_top_measurement_label"></select>
|
413 |
+
</td>
|
414 |
+
</tr>
|
415 |
+
</table>
|
416 |
+
</td>
|
417 |
+
</tr>
|
418 |
+
<tr>
|
419 |
+
<td><label for="box_margin_right">{#style_dlg.right}</label></td>
|
420 |
+
<td>
|
421 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
422 |
+
<tr>
|
423 |
+
<td><input type="text" id="box_margin_right" name="box_margin_right" class="mceEditableSelect" disabled="disabled" /></td>
|
424 |
+
<td> </td>
|
425 |
+
<td>
|
426 |
+
<label id="box_margin_right_measurement_label" for="box_margin_right_measurement" style="display: none; visibility: hidden;">Margin Right Measurement Unit</label>
|
427 |
+
<select id="box_margin_right_measurement" name="box_margin_right_measurement" disabled="disabled" aria-labelledby="box_margin_right_measurement_label"></select>
|
428 |
+
</td>
|
429 |
+
</tr>
|
430 |
+
</table>
|
431 |
+
</td>
|
432 |
+
</tr>
|
433 |
+
<tr>
|
434 |
+
<td><label for="box_margin_bottom">{#style_dlg.bottom}</label></td>
|
435 |
+
<td>
|
436 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
437 |
+
<tr>
|
438 |
+
<td><input type="text" id="box_margin_bottom" name="box_margin_bottom" class="mceEditableSelect" disabled="disabled" /></td>
|
439 |
+
<td> </td>
|
440 |
+
<td>
|
441 |
+
<label id="box_margin_bottom_measurement_label" for="box_margin_bottom_measurement" style="display: none; visibility: hidden;">Margin Bottom Measurement Unit</label>
|
442 |
+
<select id="box_margin_bottom_measurement" name="box_margin_bottom_measurement" disabled="disabled" aria-labelledby="box_margin_bottom_measurement_label"></select>
|
443 |
+
</td>
|
444 |
+
</tr>
|
445 |
+
</table>
|
446 |
+
</td>
|
447 |
+
</tr>
|
448 |
+
<tr>
|
449 |
+
<td><label for="box_margin_left">{#style_dlg.left}</label></td>
|
450 |
+
<td>
|
451 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
452 |
+
<tr>
|
453 |
+
<td><input type="text" id="box_margin_left" name="box_margin_left" class="mceEditableSelect" disabled="disabled" /></td>
|
454 |
+
<td> </td>
|
455 |
+
<td>
|
456 |
+
<label id="box_margin_left_measurement_label" for="box_margin_left_measurement" style="display: none; visibility: hidden;">Margin Left Measurement Unit</label>
|
457 |
+
<select id="box_margin_left_measurement" name="box_margin_left_measurement" disabled="disabled" aria-labelledby="box_margin_left_measurement_label"></select>
|
458 |
+
</td>
|
459 |
+
</tr>
|
460 |
+
</table>
|
461 |
+
</td>
|
462 |
+
</tr>
|
463 |
+
</table>
|
464 |
+
</fieldset>
|
465 |
+
</div>
|
466 |
+
<br style="clear: both" />
|
467 |
+
</div>
|
468 |
+
|
469 |
+
<div id="border_panel" class="panel">
|
470 |
+
<fieldset>
|
471 |
+
<legend>{#style_dlg.border}</legend>
|
472 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0" width="100%">
|
473 |
+
<tr>
|
474 |
+
<td class="tdelim"> </td>
|
475 |
+
<td class="tdelim delim"> </td>
|
476 |
+
<td class="tdelim">{#style_dlg.style}</td>
|
477 |
+
<td class="tdelim delim"> </td>
|
478 |
+
<td class="tdelim">{#style_dlg.width}</td>
|
479 |
+
<td class="tdelim delim"> </td>
|
480 |
+
<td class="tdelim">{#style_dlg.color}</td>
|
481 |
+
</tr>
|
482 |
+
|
483 |
+
<tr>
|
484 |
+
<td> </td>
|
485 |
+
<td class="delim"> </td>
|
486 |
+
<td><input type="checkbox" id="border_style_same" name="border_style_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_style');" /> <label for="border_style_same">{#style_dlg.same}</label></td>
|
487 |
+
<td class="delim"> </td>
|
488 |
+
<td><input type="checkbox" id="border_width_same" name="border_width_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_width');" /> <label for="border_width_same">{#style_dlg.same}</label></td>
|
489 |
+
<td class="delim"> </td>
|
490 |
+
<td><input type="checkbox" id="border_color_same" name="border_color_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_color');" /> <label for="border_color_same">{#style_dlg.same}</label></td>
|
491 |
+
</tr>
|
492 |
+
|
493 |
+
<tr>
|
494 |
+
<td>{#style_dlg.top}</td>
|
495 |
+
<td class="delim"> </td>
|
496 |
+
<td><select id="border_style_top" name="border_style_top" class="mceEditableSelect"></select></td>
|
497 |
+
<td class="delim"> </td>
|
498 |
+
<td>
|
499 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
500 |
+
<tr>
|
501 |
+
<td><select id="border_width_top" name="border_width_top" class="mceEditableSelect"></select></td>
|
502 |
+
<td> </td>
|
503 |
+
<td>
|
504 |
+
<label id="border_width_top_measurement_label" for="border_width_top_measurement" style="display: none; visibility: hidden;">Width top Measurement Unit</label>
|
505 |
+
<select id="border_width_top_measurement" name="border_width_top_measurement" aria-labelledby="border_width_top_measurement_label"></select>
|
506 |
+
</td>
|
507 |
+
</tr>
|
508 |
+
</table>
|
509 |
+
</td>
|
510 |
+
<td class="delim"> </td>
|
511 |
+
<td>
|
512 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
513 |
+
<tr>
|
514 |
+
<td><input id="border_color_top" name="border_color_top" type="text" value="" size="9" onChange="updateColor('border_color_top_pick','border_color_top');" /></td>
|
515 |
+
<td id="border_color_top_pickcontainer"> </td>
|
516 |
+
</tr>
|
517 |
+
</table>
|
518 |
+
</td>
|
519 |
+
</tr>
|
520 |
+
|
521 |
+
<tr>
|
522 |
+
<td>{#style_dlg.right}</td>
|
523 |
+
<td class="delim"> </td>
|
524 |
+
<td><select id="border_style_right" name="border_style_right" class="mceEditableSelect" disabled="disabled"></select></td>
|
525 |
+
<td class="delim"> </td>
|
526 |
+
<td>
|
527 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
528 |
+
<tr>
|
529 |
+
<td><select id="border_width_right" name="border_width_right" class="mceEditableSelect" disabled="disabled"></select></td>
|
530 |
+
<td> </td>
|
531 |
+
<td>
|
532 |
+
<label id="border_width_right_measurement_label" for="border_width_right_measurement" style="display: none; visibility: hidden;">Width Right Measurement Unit</label>
|
533 |
+
<select id="border_width_right_measurement" name="border_width_right_measurement" disabled="disabled" aria-labelledby="border_width_right_measurement_label"></select>
|
534 |
+
</td>
|
535 |
+
</tr>
|
536 |
+
</table>
|
537 |
+
</td>
|
538 |
+
<td class="delim"> </td>
|
539 |
+
<td>
|
540 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
541 |
+
<tr>
|
542 |
+
<td><input id="border_color_right" name="border_color_right" type="text" value="" size="9" onChange="updateColor('border_color_right_pick','border_color_right');" disabled="disabled" /></td>
|
543 |
+
<td id="border_color_right_pickcontainer"> </td>
|
544 |
+
</tr>
|
545 |
+
</table>
|
546 |
+
</td>
|
547 |
+
</tr>
|
548 |
+
|
549 |
+
<tr>
|
550 |
+
<td>{#style_dlg.bottom}</td>
|
551 |
+
<td class="delim"> </td>
|
552 |
+
<td><select id="border_style_bottom" name="border_style_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
|
553 |
+
<td class="delim"> </td>
|
554 |
+
<td>
|
555 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
556 |
+
<tr>
|
557 |
+
<td><select id="border_width_bottom" name="border_width_bottom" class="mceEditableSelect" disabled="disabled"></select></td>
|
558 |
+
<td> </td>
|
559 |
+
<td>
|
560 |
+
<label id="border_width_bottom_measurement_label" for="border_width_bottom_measurement" style="display: none; visibility: hidden;">Width Bottom Measurement Unit</label>
|
561 |
+
<select id="border_width_bottom_measurement" name="border_width_bottom_measurement" disabled="disabled" aria-labelledby="border_width_bottom_measurement_label"></select>
|
562 |
+
</td>
|
563 |
+
</tr>
|
564 |
+
</table>
|
565 |
+
</td>
|
566 |
+
<td class="delim"> </td>
|
567 |
+
<td>
|
568 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
569 |
+
<tr>
|
570 |
+
<td><input id="border_color_bottom" name="border_color_bottom" type="text" value="" size="9" onChange="updateColor('border_color_bottom_pick','border_color_bottom');" disabled="disabled" /></td>
|
571 |
+
<td id="border_color_bottom_pickcontainer"> </td>
|
572 |
+
</tr>
|
573 |
+
</table>
|
574 |
+
</td>
|
575 |
+
</tr>
|
576 |
+
|
577 |
+
<tr>
|
578 |
+
<td>{#style_dlg.left}</td>
|
579 |
+
<td class="delim"> </td>
|
580 |
+
<td><select id="border_style_left" name="border_style_left" class="mceEditableSelect" disabled="disabled"></select></td>
|
581 |
+
<td class="delim"> </td>
|
582 |
+
<td>
|
583 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
584 |
+
<tr>
|
585 |
+
<td><select id="border_width_left" name="border_width_left" class="mceEditableSelect" disabled="disabled"></select></td>
|
586 |
+
<td> </td>
|
587 |
+
<td>
|
588 |
+
<label id="border_width_left_measurement_label" for="border_width_left_measurement" style="display: none; visibility: hidden;">Width Left Measurement Unit</label>
|
589 |
+
<select id="border_width_left_measurement" name="border_width_left_measurement" disabled="disabled" aria-labelledby="border_width_left_measurement_label"></select>
|
590 |
+
</td>
|
591 |
+
</tr>
|
592 |
+
</table>
|
593 |
+
</td>
|
594 |
+
<td class="delim"> </td>
|
595 |
+
<td>
|
596 |
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
597 |
+
<tr>
|
598 |
+
<td><input id="border_color_left" name="border_color_left" type="text" value="" size="9" onChange="updateColor('border_color_left_pick','border_color_left');" disabled="disabled" /></td>
|
599 |
+
<td id="border_color_left_pickcontainer"> </td>
|
600 |
+
</tr>
|
601 |
+
</table>
|
602 |
+
</td>
|
603 |
+
</tr>
|
604 |
+
</table>
|
605 |
+
</fieldset>
|
606 |
+
</div>
|
607 |
+
|
608 |
+
<div id="list_panel" class="panel">
|
609 |
+
<fieldset>
|
610 |
+
<legend>{#style_dlg.list}</legend>
|
611 |
+
<table role="presentation" border="0">
|
612 |
+
<tr>
|
613 |
+
<td><label for="list_type">{#style_dlg.list_type}</label></td>
|
614 |
+
<td><select id="list_type" name="list_type" class="mceEditableSelect"></select></td>
|
615 |
+
</tr>
|
616 |
+
|
617 |
+
<tr>
|
618 |
+
<td><label for="list_bullet_image">{#style_dlg.bullet_image}</label></td>
|
619 |
+
<td><input id="list_bullet_image" name="list_bullet_image" type="text" /></td>
|
620 |
+
</tr>
|
621 |
+
|
622 |
+
<tr>
|
623 |
+
<td><label for="list_position">{#style_dlg.position}</label></td>
|
624 |
+
<td><select id="list_position" name="list_position" class="mceEditableSelect"></select></td>
|
625 |
+
</tr>
|
626 |
+
</table>
|
627 |
+
</fieldset>
|
628 |
+
</div>
|
629 |
+
|
630 |
+
<div id="positioning_panel" class="panel">
|
631 |
+
<fieldset>
|
632 |
+
<legend>{#style_dlg.position}</legend>
|
633 |
+
<table role="presentation" border="0">
|
634 |
+
<tr>
|
635 |
+
<td><label for="positioning_type">{#style_dlg.positioning_type}</label></td>
|
636 |
+
<td><select id="positioning_type" name="positioning_type" class="mceEditableSelect"></select></td>
|
637 |
+
<td> <label for="positioning_visibility">{#style_dlg.visibility}</label></td>
|
638 |
+
<td><select id="positioning_visibility" name="positioning_visibility" class="mceEditableSelect"></select></td>
|
639 |
+
</tr>
|
640 |
+
|
641 |
+
<tr>
|
642 |
+
<td><label for="positioning_width">{#style_dlg.width}</label></td>
|
643 |
+
<td>
|
644 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
645 |
+
<tr>
|
646 |
+
<td><input type="text" id="positioning_width" name="positioning_width" onChange="synch('positioning_width','box_width');" /></td>
|
647 |
+
<td> </td>
|
648 |
+
<td>
|
649 |
+
<label id="positioning_width_measurement_label" for="positioning_width_measurement" style="display: none; visibility: hidden;">Positioning width Measurement Unit</label>
|
650 |
+
<select id="positioning_width_measurement" name="positioning_width_measurement" aria-labelledby="positioning_width_measurement_label"></select>
|
651 |
+
</td>
|
652 |
+
</tr>
|
653 |
+
</table>
|
654 |
+
</td>
|
655 |
+
<td> <label for="positioning_zindex">{#style_dlg.zindex}</label></td>
|
656 |
+
<td><input type="text" id="positioning_zindex" name="positioning_zindex" /></td>
|
657 |
+
</tr>
|
658 |
+
|
659 |
+
<tr>
|
660 |
+
<td><label for="positioning_height">{#style_dlg.height}</label></td>
|
661 |
+
<td>
|
662 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
663 |
+
<tr>
|
664 |
+
<td><input type="text" id="positioning_height" name="positioning_height" onChange="synch('positioning_height','box_height');" /></td>
|
665 |
+
<td> </td>
|
666 |
+
<td>
|
667 |
+
<label id="positioning_height_measurement_label" for="positioning_height_measurement" style="display: none; visibility: hidden;">Positioning Height Measurement Unit</label>
|
668 |
+
<select id="positioning_height_measurement" name="positioning_height_measurement" aria-labelledby="positioning_height_measurement_label"></select>
|
669 |
+
</td>
|
670 |
+
</tr>
|
671 |
+
</table>
|
672 |
+
</td>
|
673 |
+
<td> <label for="positioning_overflow">{#style_dlg.overflow}</label></td>
|
674 |
+
<td><select id="positioning_overflow" name="positioning_overflow" class="mceEditableSelect"></select></td>
|
675 |
+
</tr>
|
676 |
+
</table>
|
677 |
+
</fieldset>
|
678 |
+
|
679 |
+
<div style="float: left; width: 49%">
|
680 |
+
<fieldset>
|
681 |
+
<legend>{#style_dlg.placement}</legend>
|
682 |
+
|
683 |
+
<table role="presentation" border="0">
|
684 |
+
<tr>
|
685 |
+
<td> </td>
|
686 |
+
<td><input type="checkbox" id="positioning_placement_same" name="positioning_placement_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_placement');" /> <label for="positioning_placement_same">{#style_dlg.same}</label></td>
|
687 |
+
</tr>
|
688 |
+
<tr>
|
689 |
+
<td>{#style_dlg.top}</td>
|
690 |
+
<td>
|
691 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
692 |
+
<tr>
|
693 |
+
<td><input type="text" id="positioning_placement_top" name="positioning_placement_top" /></td>
|
694 |
+
<td> </td>
|
695 |
+
<td>
|
696 |
+
<label id="positioning_placement_top_measurement_label" for="positioning_placement_top_measurement" style="display: none; visibility: hidden;">Placement Top Measurement Unit</label>
|
697 |
+
<select id="positioning_placement_top_measurement" name="positioning_placement_top_measurement" aria-labelledby="positioning_placement_top_measurement_label"></select>
|
698 |
+
</td>
|
699 |
+
</tr>
|
700 |
+
</table>
|
701 |
+
</td>
|
702 |
+
</tr>
|
703 |
+
<tr>
|
704 |
+
<td>{#style_dlg.right}</td>
|
705 |
+
<td>
|
706 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
707 |
+
<tr>
|
708 |
+
<td><input type="text" id="positioning_placement_right" name="positioning_placement_right" disabled="disabled" /></td>
|
709 |
+
<td> </td>
|
710 |
+
<td>
|
711 |
+
<label id="positioning_placement_right_measurement_label" for="positioning_placement_right_measurement" style="display: none; visibility: hidden;">Placement Right Measurement Unit</label>
|
712 |
+
<select id="positioning_placement_right_measurement" name="positioning_placement_right_measurement" disabled="disabled" aria-labelledby="positioning_placement_right_measurement_label"></select>
|
713 |
+
</td>
|
714 |
+
</tr>
|
715 |
+
</table>
|
716 |
+
</td>
|
717 |
+
</tr>
|
718 |
+
<tr>
|
719 |
+
<td>{#style_dlg.bottom}</td>
|
720 |
+
<td>
|
721 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
722 |
+
<tr>
|
723 |
+
<td><input type="text" id="positioning_placement_bottom" name="positioning_placement_bottom" disabled="disabled" /></td>
|
724 |
+
<td> </td>
|
725 |
+
<td>
|
726 |
+
<label id="positioning_placement_bottom_measurement_label" for="positioning_placement_bottom_measurement" style="display: none; visibility: hidden;">Placement Bottom Measurement Unit</label>
|
727 |
+
<select id="positioning_placement_bottom_measurement" name="positioning_placement_bottom_measurement" disabled="disabled" aria-labelledby="positioning_placement_bottom_measurement_label"></select>
|
728 |
+
</td>
|
729 |
+
</tr>
|
730 |
+
</table>
|
731 |
+
</td>
|
732 |
+
</tr>
|
733 |
+
<tr>
|
734 |
+
<td>{#style_dlg.left}</td>
|
735 |
+
<td>
|
736 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
737 |
+
<tr>
|
738 |
+
<td><input type="text" id="positioning_placement_left" name="positioning_placement_left" disabled="disabled" /></td>
|
739 |
+
<td> </td>
|
740 |
+
<td>
|
741 |
+
<label id="positioning_placement_left_measurement_label" for="positioning_placement_left_measurement" style="display: none; visibility: hidden;">Placement Left Measurement Unit</label>
|
742 |
+
<select id="positioning_placement_left_measurement" name="positioning_placement_left_measurement" disabled="disabled" aria-labelledby="positioning_placement_left_measurement_label"></select>
|
743 |
+
</td>
|
744 |
+
</tr>
|
745 |
+
</table>
|
746 |
+
</td>
|
747 |
+
</tr>
|
748 |
+
</table>
|
749 |
+
</fieldset>
|
750 |
+
</div>
|
751 |
+
|
752 |
+
<div style="float: right; width: 49%">
|
753 |
+
<fieldset>
|
754 |
+
<legend>{#style_dlg.clip}</legend>
|
755 |
+
|
756 |
+
<table role="presentation" border="0">
|
757 |
+
<tr>
|
758 |
+
<td> </td>
|
759 |
+
<td><input type="checkbox" id="positioning_clip_same" name="positioning_clip_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_clip');" /> <label for="positioning_clip_same">{#style_dlg.same}</label></td>
|
760 |
+
</tr>
|
761 |
+
<tr>
|
762 |
+
<td>{#style_dlg.top}</td>
|
763 |
+
<td>
|
764 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
765 |
+
<tr>
|
766 |
+
<td><input type="text" id="positioning_clip_top" name="positioning_clip_top" /></td>
|
767 |
+
<td> </td>
|
768 |
+
<td>
|
769 |
+
<label id="positioning_clip_top_measurement_label" for="positioning_clip_top_measurement" style="display: none; visibility: hidden;">Clip Top Measurement Unit</label>
|
770 |
+
<select id="positioning_clip_top_measurement" name="positioning_clip_top_measurement" aria-labelledby="positioning_clip_top_measurement_label"></select>
|
771 |
+
</td>
|
772 |
+
</tr>
|
773 |
+
</table>
|
774 |
+
</td>
|
775 |
+
</tr>
|
776 |
+
<tr>
|
777 |
+
<td>{#style_dlg.right}</td>
|
778 |
+
<td>
|
779 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
780 |
+
<tr>
|
781 |
+
<td><input type="text" id="positioning_clip_right" name="positioning_clip_right" disabled="disabled" /></td>
|
782 |
+
<td> </td>
|
783 |
+
<td>
|
784 |
+
<label id="positioning_clip_right_measurement_label" for="positioning_clip_right_measurement" style="display: none; visibility: hidden;">Clip Right Measurement Unit</label>
|
785 |
+
<select id="positioning_clip_right_measurement" name="positioning_clip_right_measurement" disabled="disabled" aria-labelledby="positioning_clip_right_measurement_label"></select>
|
786 |
+
</td>
|
787 |
+
</tr>
|
788 |
+
</table>
|
789 |
+
</td>
|
790 |
+
</tr>
|
791 |
+
<tr>
|
792 |
+
<td>{#style_dlg.bottom}</td>
|
793 |
+
<td>
|
794 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
795 |
+
<tr>
|
796 |
+
<td><input type="text" id="positioning_clip_bottom" name="positioning_clip_bottom" disabled="disabled" /></td>
|
797 |
+
<td> </td>
|
798 |
+
<td>
|
799 |
+
<label id="positioning_clip_bottom_measurement_label" for="positioning_clip_bottom_measurement" style="display: none; visibility: hidden;">Clip Bottom Measurement Unit</label>
|
800 |
+
<select id="positioning_clip_bottom_measurement" name="positioning_clip_bottom_measurement" disabled="disabled" aria-labelledby="positioning_clip_bottom_measurement_label"></select>
|
801 |
+
</td>
|
802 |
+
</tr>
|
803 |
+
</table>
|
804 |
+
</td>
|
805 |
+
</tr>
|
806 |
+
<tr>
|
807 |
+
<td>{#style_dlg.left}</td>
|
808 |
+
<td>
|
809 |
+
<table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
810 |
+
<tr>
|
811 |
+
<td><input type="text" id="positioning_clip_left" name="positioning_clip_left" disabled="disabled" /></td>
|
812 |
+
<td> </td>
|
813 |
+
<td>
|
814 |
+
<label id="positioning_clip_left_measurement_label" for="positioning_clip_left_measurement" style="display: none; visibility: hidden;">Clip Left Measurement Unit</label>
|
815 |
+
<select id="positioning_clip_left_measurement" name="positioning_clip_left_measurement" disabled="disabled" aria-labelledby="positioning_clip_left_measurement_label"></select>
|
816 |
+
</td>
|
817 |
+
</tr>
|
818 |
+
</table>
|
819 |
+
</td>
|
820 |
+
</tr>
|
821 |
+
</table>
|
822 |
+
</fieldset>
|
823 |
+
</div>
|
824 |
+
<br style="clear: both" />
|
825 |
+
</div>
|
826 |
+
</div>
|
827 |
+
|
828 |
+
<div class="panel_toggle_insert_span">
|
829 |
+
<input type="checkbox" class="checkbox" id="toggle_insert_span" name="toggle_insert_span" onClick="toggleApplyAction();" />
|
830 |
+
<label for="toggle_insert_span">{#style_dlg.toggle_insert_span}</label>
|
831 |
+
</div>
|
832 |
+
|
833 |
+
<div class="mceActionPanel">
|
834 |
+
<input type="submit" id="insert" name="insert" value="{#update}" />
|
835 |
+
<input type="button" class="button" id="apply" name="apply" value="{#style_dlg.apply}" onClick="applyAction();" />
|
836 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onClick="tinyMCEPopup.close();" />
|
837 |
+
</div>
|
838 |
+
</form>
|
839 |
+
|
840 |
+
<div style="display: none">
|
841 |
+
<div id="container"></div>
|
842 |
+
</div>
|
843 |
+
|
844 |
+
</body>
|
845 |
+
</html>
|
js/libraries/tiny_mce/plugins/style/readme.txt
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
-
Edit CSS Style plug-in notes
|
2 |
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
3 |
-
Unlike WYSIWYG editor functionality that operates only on the selected text,
|
4 |
-
typically by inserting new HTML elements with the specified styles.
|
5 |
-
This plug-in operates on the HTML blocks surrounding the selected text.
|
6 |
-
No new HTML elements are created.
|
7 |
-
|
8 |
-
This plug-in only operates on the surrounding blocks and not the nearest
|
9 |
-
parent node. This means that if a block encapsulates a node,
|
10 |
-
e.g <p><span>text</span></p>, then only the styles in the block are
|
11 |
-
recognized, not those in the span.
|
12 |
-
|
13 |
-
When selecting text that includes multiple blocks at the same level (peers),
|
14 |
-
this plug-in accumulates the specified styles in all of the surrounding blocks
|
15 |
-
and populates the dialogue checkboxes accordingly. There is no differentiation
|
16 |
-
between styles set in all the blocks versus styles set in some of the blocks.
|
17 |
-
|
18 |
-
When the [Update] or [Apply] buttons are pressed, the styles selected in the
|
19 |
-
checkboxes are applied to all blocks that surround the selected text.
|
1 |
+
Edit CSS Style plug-in notes
|
2 |
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
3 |
+
Unlike WYSIWYG editor functionality that operates only on the selected text,
|
4 |
+
typically by inserting new HTML elements with the specified styles.
|
5 |
+
This plug-in operates on the HTML blocks surrounding the selected text.
|
6 |
+
No new HTML elements are created.
|
7 |
+
|
8 |
+
This plug-in only operates on the surrounding blocks and not the nearest
|
9 |
+
parent node. This means that if a block encapsulates a node,
|
10 |
+
e.g <p><span>text</span></p>, then only the styles in the block are
|
11 |
+
recognized, not those in the span.
|
12 |
+
|
13 |
+
When selecting text that includes multiple blocks at the same level (peers),
|
14 |
+
this plug-in accumulates the specified styles in all of the surrounding blocks
|
15 |
+
and populates the dialogue checkboxes accordingly. There is no differentiation
|
16 |
+
between styles set in all the blocks versus styles set in some of the blocks.
|
17 |
+
|
18 |
+
When the [Update] or [Apply] buttons are pressed, the styles selected in the
|
19 |
+
checkboxes are applied to all blocks that surround the selected text.
|
js/libraries/tiny_mce/plugins/tabfocus/editor_plugin_src.js
CHANGED
@@ -1,122 +1,122 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function() {
|
12 |
-
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode;
|
13 |
-
|
14 |
-
tinymce.create('tinymce.plugins.TabFocusPlugin', {
|
15 |
-
init : function(ed, url) {
|
16 |
-
function tabCancel(ed, e) {
|
17 |
-
if (e.keyCode === 9)
|
18 |
-
return Event.cancel(e);
|
19 |
-
}
|
20 |
-
|
21 |
-
function tabHandler(ed, e) {
|
22 |
-
var x, i, f, el, v;
|
23 |
-
|
24 |
-
function find(d) {
|
25 |
-
el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
|
26 |
-
|
27 |
-
function canSelectRecursive(e) {
|
28 |
-
return e.nodeName==="BODY" || (e.type != 'hidden' &&
|
29 |
-
!(e.style.display == "none") &&
|
30 |
-
!(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode));
|
31 |
-
}
|
32 |
-
function canSelectInOldIe(el) {
|
33 |
-
return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA";
|
34 |
-
}
|
35 |
-
function isOldIe() {
|
36 |
-
return tinymce.isIE6 || tinymce.isIE7;
|
37 |
-
}
|
38 |
-
function canSelect(el) {
|
39 |
-
return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el);
|
40 |
-
}
|
41 |
-
|
42 |
-
each(el, function(e, i) {
|
43 |
-
if (e.id == ed.id) {
|
44 |
-
x = i;
|
45 |
-
return false;
|
46 |
-
}
|
47 |
-
});
|
48 |
-
if (d > 0) {
|
49 |
-
for (i = x + 1; i < el.length; i++) {
|
50 |
-
if (canSelect(el[i]))
|
51 |
-
return el[i];
|
52 |
-
}
|
53 |
-
} else {
|
54 |
-
for (i = x - 1; i >= 0; i--) {
|
55 |
-
if (canSelect(el[i]))
|
56 |
-
return el[i];
|
57 |
-
}
|
58 |
-
}
|
59 |
-
|
60 |
-
return null;
|
61 |
-
}
|
62 |
-
|
63 |
-
if (e.keyCode === 9) {
|
64 |
-
v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next')));
|
65 |
-
|
66 |
-
if (v.length == 1) {
|
67 |
-
v[1] = v[0];
|
68 |
-
v[0] = ':prev';
|
69 |
-
}
|
70 |
-
|
71 |
-
// Find element to focus
|
72 |
-
if (e.shiftKey) {
|
73 |
-
if (v[0] == ':prev')
|
74 |
-
el = find(-1);
|
75 |
-
else
|
76 |
-
el = DOM.get(v[0]);
|
77 |
-
} else {
|
78 |
-
if (v[1] == ':next')
|
79 |
-
el = find(1);
|
80 |
-
else
|
81 |
-
el = DOM.get(v[1]);
|
82 |
-
}
|
83 |
-
|
84 |
-
if (el) {
|
85 |
-
if (el.id && (ed = tinymce.get(el.id || el.name)))
|
86 |
-
ed.focus();
|
87 |
-
else
|
88 |
-
window.setTimeout(function() {
|
89 |
-
if (!tinymce.isWebKit)
|
90 |
-
window.focus();
|
91 |
-
el.focus();
|
92 |
-
}, 10);
|
93 |
-
|
94 |
-
return Event.cancel(e);
|
95 |
-
}
|
96 |
-
}
|
97 |
-
}
|
98 |
-
|
99 |
-
ed.onKeyUp.add(tabCancel);
|
100 |
-
|
101 |
-
if (tinymce.isGecko) {
|
102 |
-
ed.onKeyPress.add(tabHandler);
|
103 |
-
ed.onKeyDown.add(tabCancel);
|
104 |
-
} else
|
105 |
-
ed.onKeyDown.add(tabHandler);
|
106 |
-
|
107 |
-
},
|
108 |
-
|
109 |
-
getInfo : function() {
|
110 |
-
return {
|
111 |
-
longname : 'Tabfocus',
|
112 |
-
author : 'Moxiecode Systems AB',
|
113 |
-
authorurl : 'http://tinymce.moxiecode.com',
|
114 |
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus',
|
115 |
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
116 |
-
};
|
117 |
-
}
|
118 |
-
});
|
119 |
-
|
120 |
-
// Register plugin
|
121 |
-
tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin);
|
122 |
-
})();
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function() {
|
12 |
+
var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode;
|
13 |
+
|
14 |
+
tinymce.create('tinymce.plugins.TabFocusPlugin', {
|
15 |
+
init : function(ed, url) {
|
16 |
+
function tabCancel(ed, e) {
|
17 |
+
if (e.keyCode === 9)
|
18 |
+
return Event.cancel(e);
|
19 |
+
}
|
20 |
+
|
21 |
+
function tabHandler(ed, e) {
|
22 |
+
var x, i, f, el, v;
|
23 |
+
|
24 |
+
function find(d) {
|
25 |
+
el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
|
26 |
+
|
27 |
+
function canSelectRecursive(e) {
|
28 |
+
return e.nodeName==="BODY" || (e.type != 'hidden' &&
|
29 |
+
!(e.style.display == "none") &&
|
30 |
+
!(e.style.visibility == "hidden") && canSelectRecursive(e.parentNode));
|
31 |
+
}
|
32 |
+
function canSelectInOldIe(el) {
|
33 |
+
return el.attributes["tabIndex"].specified || el.nodeName == "INPUT" || el.nodeName == "TEXTAREA";
|
34 |
+
}
|
35 |
+
function isOldIe() {
|
36 |
+
return tinymce.isIE6 || tinymce.isIE7;
|
37 |
+
}
|
38 |
+
function canSelect(el) {
|
39 |
+
return ((!isOldIe() || canSelectInOldIe(el))) && el.getAttribute("tabindex") != '-1' && canSelectRecursive(el);
|
40 |
+
}
|
41 |
+
|
42 |
+
each(el, function(e, i) {
|
43 |
+
if (e.id == ed.id) {
|
44 |
+
x = i;
|
45 |
+
return false;
|
46 |
+
}
|
47 |
+
});
|
48 |
+
if (d > 0) {
|
49 |
+
for (i = x + 1; i < el.length; i++) {
|
50 |
+
if (canSelect(el[i]))
|
51 |
+
return el[i];
|
52 |
+
}
|
53 |
+
} else {
|
54 |
+
for (i = x - 1; i >= 0; i--) {
|
55 |
+
if (canSelect(el[i]))
|
56 |
+
return el[i];
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
return null;
|
61 |
+
}
|
62 |
+
|
63 |
+
if (e.keyCode === 9) {
|
64 |
+
v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next')));
|
65 |
+
|
66 |
+
if (v.length == 1) {
|
67 |
+
v[1] = v[0];
|
68 |
+
v[0] = ':prev';
|
69 |
+
}
|
70 |
+
|
71 |
+
// Find element to focus
|
72 |
+
if (e.shiftKey) {
|
73 |
+
if (v[0] == ':prev')
|
74 |
+
el = find(-1);
|
75 |
+
else
|
76 |
+
el = DOM.get(v[0]);
|
77 |
+
} else {
|
78 |
+
if (v[1] == ':next')
|
79 |
+
el = find(1);
|
80 |
+
else
|
81 |
+
el = DOM.get(v[1]);
|
82 |
+
}
|
83 |
+
|
84 |
+
if (el) {
|
85 |
+
if (el.id && (ed = tinymce.get(el.id || el.name)))
|
86 |
+
ed.focus();
|
87 |
+
else
|
88 |
+
window.setTimeout(function() {
|
89 |
+
if (!tinymce.isWebKit)
|
90 |
+
window.focus();
|
91 |
+
el.focus();
|
92 |
+
}, 10);
|
93 |
+
|
94 |
+
return Event.cancel(e);
|
95 |
+
}
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
ed.onKeyUp.add(tabCancel);
|
100 |
+
|
101 |
+
if (tinymce.isGecko) {
|
102 |
+
ed.onKeyPress.add(tabHandler);
|
103 |
+
ed.onKeyDown.add(tabCancel);
|
104 |
+
} else
|
105 |
+
ed.onKeyDown.add(tabHandler);
|
106 |
+
|
107 |
+
},
|
108 |
+
|
109 |
+
getInfo : function() {
|
110 |
+
return {
|
111 |
+
longname : 'Tabfocus',
|
112 |
+
author : 'Moxiecode Systems AB',
|
113 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
114 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus',
|
115 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
116 |
+
};
|
117 |
+
}
|
118 |
+
});
|
119 |
+
|
120 |
+
// Register plugin
|
121 |
+
tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin);
|
122 |
+
})();
|
js/libraries/tiny_mce/plugins/table/editor_plugin_src.js
CHANGED
@@ -1,1452 +1,1452 @@
|
|
1 |
-
/**
|
2 |
-
* editor_plugin_src.js
|
3 |
-
*
|
4 |
-
* Copyright 2009, Moxiecode Systems AB
|
5 |
-
* Released under LGPL License.
|
6 |
-
*
|
7 |
-
* License: http://tinymce.moxiecode.com/license
|
8 |
-
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function(tinymce) {
|
12 |
-
var each = tinymce.each;
|
13 |
-
|
14 |
-
// Checks if the selection/caret is at the start of the specified block element
|
15 |
-
function isAtStart(rng, par) {
|
16 |
-
var doc = par.ownerDocument, rng2 = doc.createRange(), elm;
|
17 |
-
|
18 |
-
rng2.setStartBefore(par);
|
19 |
-
rng2.setEnd(rng.endContainer, rng.endOffset);
|
20 |
-
|
21 |
-
elm = doc.createElement('body');
|
22 |
-
elm.appendChild(rng2.cloneContents());
|
23 |
-
|
24 |
-
// Check for text characters of other elements that should be treated as content
|
25 |
-
return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0;
|
26 |
-
};
|
27 |
-
|
28 |
-
function getSpanVal(td, name) {
|
29 |
-
return parseInt(td.getAttribute(name) || 1);
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Table Grid class.
|
34 |
-
*/
|
35 |
-
function TableGrid(table, dom, selection) {
|
36 |
-
var grid, startPos, endPos, selectedCell;
|
37 |
-
|
38 |
-
buildGrid();
|
39 |
-
selectedCell = dom.getParent(selection.getStart(), 'th,td');
|
40 |
-
if (selectedCell) {
|
41 |
-
startPos = getPos(selectedCell);
|
42 |
-
endPos = findEndPos();
|
43 |
-
selectedCell = getCell(startPos.x, startPos.y);
|
44 |
-
}
|
45 |
-
|
46 |
-
function cloneNode(node, children) {
|
47 |
-
node = node.cloneNode(children);
|
48 |
-
node.removeAttribute('id');
|
49 |
-
|
50 |
-
return node;
|
51 |
-
}
|
52 |
-
|
53 |
-
function buildGrid() {
|
54 |
-
var startY = 0;
|
55 |
-
|
56 |
-
grid = [];
|
57 |
-
|
58 |
-
each(['thead', 'tbody', 'tfoot'], function(part) {
|
59 |
-
var rows = dom.select('> ' + part + ' tr', table);
|
60 |
-
|
61 |
-
each(rows, function(tr, y) {
|
62 |
-
y += startY;
|
63 |
-
|
64 |
-
each(dom.select('> td, > th', tr), function(td, x) {
|
65 |
-
var x2, y2, rowspan, colspan;
|
66 |
-
|
67 |
-
// Skip over existing cells produced by rowspan
|
68 |
-
if (grid[y]) {
|
69 |
-
while (grid[y][x])
|
70 |
-
x++;
|
71 |
-
}
|
72 |
-
|
73 |
-
// Get col/rowspan from cell
|
74 |
-
rowspan = getSpanVal(td, 'rowspan');
|
75 |
-
colspan = getSpanVal(td, 'colspan');
|
76 |
-
|
77 |
-
// Fill out rowspan/colspan right and down
|
78 |
-
for (y2 = y; y2 < y + rowspan; y2++) {
|
79 |
-
if (!grid[y2])
|
80 |
-
grid[y2] = [];
|
81 |
-
|
82 |
-
for (x2 = x; x2 < x + colspan; x2++) {
|
83 |
-
grid[y2][x2] = {
|
84 |
-
part : part,
|
85 |
-
real : y2 == y && x2 == x,
|
86 |
-
elm : td,
|
87 |
-
rowspan : rowspan,
|
88 |
-
colspan : colspan
|
89 |
-
};
|
90 |
-
}
|
91 |
-
}
|
92 |
-
});
|
93 |
-
});
|
94 |
-
|
95 |
-
startY += rows.length;
|
96 |
-
});
|
97 |
-
};
|
98 |
-
|
99 |
-
function getCell(x, y) {
|
100 |
-
var row;
|
101 |
-
|
102 |
-
row = grid[y];
|
103 |
-
if (row)
|
104 |
-
return row[x];
|
105 |
-
};
|
106 |
-
|
107 |
-
function setSpanVal(td, name, val) {
|
108 |
-
if (td) {
|
109 |
-
val = parseInt(val);
|
110 |
-
|
111 |
-
if (val === 1)
|
112 |
-
td.removeAttribute(name, 1);
|
113 |
-
else
|
114 |
-
td.setAttribute(name, val, 1);
|
115 |
-
}
|
116 |
-
}
|
117 |
-
|
118 |
-
function isCellSelected(cell) {
|
119 |
-
return cell && (dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell);
|
120 |
-
};
|
121 |
-
|
122 |
-
function getSelectedRows() {
|
123 |
-
var rows = [];
|
124 |
-
|
125 |
-
each(table.rows, function(row) {
|
126 |
-
each(row.cells, function(cell) {
|
127 |
-
if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) {
|
128 |
-
rows.push(row);
|
129 |
-
return false;
|
130 |
-
}
|
131 |
-
});
|
132 |
-
});
|
133 |
-
|
134 |
-
return rows;
|
135 |
-
};
|
136 |
-
|
137 |
-
function deleteTable() {
|
138 |
-
var rng = dom.createRng();
|
139 |
-
|
140 |
-
rng.setStartAfter(table);
|
141 |
-
rng.setEndAfter(table);
|
142 |
-
|
143 |
-
selection.setRng(rng);
|
144 |
-
|
145 |
-
dom.remove(table);
|
146 |
-
};
|
147 |
-
|
148 |
-
function cloneCell(cell) {
|
149 |
-
var formatNode;
|
150 |
-
|
151 |
-
// Clone formats
|
152 |
-
tinymce.walk(cell, function(node) {
|
153 |
-
var curNode;
|
154 |
-
|
155 |
-
if (node.nodeType == 3) {
|
156 |
-
each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) {
|
157 |
-
node = cloneNode(node, false);
|
158 |
-
|
159 |
-
if (!formatNode)
|
160 |
-
formatNode = curNode = node;
|
161 |
-
else if (curNode)
|
162 |
-
curNode.appendChild(node);
|
163 |
-
|
164 |
-
curNode = node;
|
165 |
-
});
|
166 |
-
|
167 |
-
// Add something to the inner node
|
168 |
-
if (curNode)
|
169 |
-
curNode.innerHTML = tinymce.isIE ? ' ' : '<br data-mce-bogus="1" />';
|
170 |
-
|
171 |
-
return false;
|
172 |
-
}
|
173 |
-
}, 'childNodes');
|
174 |
-
|
175 |
-
cell = cloneNode(cell, false);
|
176 |
-
setSpanVal(cell, 'rowSpan', 1);
|
177 |
-
setSpanVal(cell, 'colSpan', 1);
|
178 |
-
|
179 |
-
if (formatNode) {
|
180 |
-
cell.appendChild(formatNode);
|
181 |
-
} else {
|
182 |
-
if (!tinymce.isIE)
|
183 |
-
cell.innerHTML = '<br data-mce-bogus="1" />';
|
184 |
-
}
|
185 |
-
|
186 |
-
return cell;
|
187 |
-
};
|
188 |
-
|
189 |
-
function cleanup() {
|
190 |
-
var rng = dom.createRng();
|
191 |
-
|
192 |
-
// Empty rows
|
193 |
-
each(dom.select('tr', table), function(tr) {
|
194 |
-
if (tr.cells.length == 0)
|
195 |
-
dom.remove(tr);
|
196 |
-
});
|
197 |
-
|
198 |
-
// Empty table
|
199 |
-
if (dom.select('tr', table).length == 0) {
|
200 |
-
rng.setStartAfter(table);
|
201 |
-
rng.setEndAfter(table);
|
202 |
-
selection.setRng(rng);
|
203 |
-
dom.remove(table);
|
204 |
-
return;
|
205 |
-
}
|
206 |
-
|
207 |
-
// Empty header/body/footer
|
208 |
-
each(dom.select('thead,tbody,tfoot', table), function(part) {
|
209 |
-
if (part.rows.length == 0)
|
210 |
-
dom.remove(part);
|
211 |
-
});
|
212 |
-
|
213 |
-
// Restore selection to start position if it still exists
|
214 |
-
buildGrid();
|
215 |
-
|
216 |
-
// Restore the selection to the closest table position
|
217 |
-
row = grid[Math.min(grid.length - 1, startPos.y)];
|
218 |
-
if (row) {
|
219 |
-
selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true);
|
220 |
-
selection.collapse(true);
|
221 |
-
}
|
222 |
-
};
|
223 |
-
|
224 |
-
function fillLeftDown(x, y, rows, cols) {
|
225 |
-
var tr, x2, r, c, cell;
|
226 |
-
|
227 |
-
tr = grid[y][x].elm.parentNode;
|
228 |
-
for (r = 1; r <= rows; r++) {
|
229 |
-
tr = dom.getNext(tr, 'tr');
|
230 |
-
|
231 |
-
if (tr) {
|
232 |
-
// Loop left to find real cell
|
233 |
-
for (x2 = x; x2 >= 0; x2--) {
|
234 |
-
cell = grid[y + r][x2].elm;
|
235 |
-
|
236 |
-
if (cell.parentNode == tr) {
|
237 |
-
// Append clones after
|
238 |
-
for (c = 1; c <= cols; c++)
|
239 |
-
dom.insertAfter(cloneCell(cell), cell);
|
240 |
-
|
241 |
-
break;
|
242 |
-
}
|
243 |
-
}
|
244 |
-
|
245 |
-
if (x2 == -1) {
|
246 |
-
// Insert nodes before first cell
|
247 |
-
for (c = 1; c <= cols; c++)
|
248 |
-
tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]);
|
249 |
-
}
|
250 |
-
}
|
251 |
-
}
|
252 |
-
};
|
253 |
-
|
254 |
-
function split() {
|
255 |
-
each(grid, function(row, y) {
|
256 |
-
each(row, function(cell, x) {
|
257 |
-
var colSpan, rowSpan, newCell, i;
|
258 |
-
|
259 |
-
if (isCellSelected(cell)) {
|
260 |
-
cell = cell.elm;
|
261 |
-
colSpan = getSpanVal(cell, 'colspan');
|
262 |
-
rowSpan = getSpanVal(cell, 'rowspan');
|
263 |
-
|
264 |
-
if (colSpan > 1 || rowSpan > 1) {
|
265 |
-
setSpanVal(cell, 'rowSpan', 1);
|
266 |
-
setSpanVal(cell, 'colSpan', 1);
|
267 |
-
|
268 |
-
// Insert cells right
|
269 |
-
for (i = 0; i < colSpan - 1; i++)
|
270 |
-
dom.insertAfter(cloneCell(cell), cell);
|
271 |
-
|
272 |
-
fillLeftDown(x, y, rowSpan - 1, colSpan);
|
273 |
-
}
|
274 |
-
}
|
275 |
-
});
|
276 |
-
});
|
277 |
-
};
|
278 |
-
|
279 |
-
function merge(cell, cols, rows) {
|
280 |
-
var startX, startY, endX, endY, x, y, startCell, endCell, cell, children, count;
|
281 |
-
|
282 |
-
// Use specified cell and cols/rows
|
283 |
-
if (cell) {
|
284 |
-
pos = getPos(cell);
|
285 |
-
startX = pos.x;
|
286 |
-
startY = pos.y;
|
287 |
-
endX = startX + (cols - 1);
|
288 |
-
endY = startY + (rows - 1);
|
289 |
-
} else {
|
290 |
-
startPos = endPos = null;
|
291 |
-
|
292 |
-
// Calculate start/end pos by checking for selected cells in grid works better with context menu
|
293 |
-
each(grid, function(row, y) {
|
294 |
-
each(row, function(cell, x) {
|
295 |
-
if (isCellSelected(cell)) {
|
296 |
-
if (!startPos) {
|
297 |
-
startPos = {x: x, y: y};
|
298 |
-
}
|
299 |
-
|
300 |
-
endPos = {x: x, y: y};
|
301 |
-
}
|
302 |
-
});
|
303 |
-
});
|
304 |
-
|
305 |
-
// Use selection
|
306 |
-
startX = startPos.x;
|
307 |
-
startY = startPos.y;
|
308 |
-
endX = endPos.x;
|
309 |
-
endY = endPos.y;
|
310 |
-
}
|
311 |
-
|
312 |
-
// Find start/end cells
|
313 |
-
startCell = getCell(startX, startY);
|
314 |
-
endCell = getCell(endX, endY);
|
315 |
-
|
316 |
-
// Check if the cells exists and if they are of the same part for example tbody = tbody
|
317 |
-
if (startCell && endCell && startCell.part == endCell.part) {
|
318 |
-
// Split and rebuild grid
|
319 |
-
split();
|
320 |
-
buildGrid();
|
321 |
-
|
322 |
-
// Set row/col span to start cell
|
323 |
-
startCell = getCell(startX, startY).elm;
|
324 |
-
setSpanVal(startCell, 'colSpan', (endX - startX) + 1);
|
325 |
-
setSpanVal(startCell, 'rowSpan', (endY - startY) + 1);
|
326 |
-
|
327 |
-
// Remove other cells and add it's contents to the start cell
|
328 |
-
for (y = startY; y <= endY; y++) {
|
329 |
-
for (x = startX; x <= endX; x++) {
|
330 |
-
if (!grid[y] || !grid[y][x])
|
331 |
-
continue;
|
332 |
-
|
333 |
-
cell = grid[y][x].elm;
|
334 |
-
|
335 |
-
if (cell != startCell) {
|
336 |
-
// Move children to startCell
|
337 |
-
children = tinymce.grep(cell.childNodes);
|
338 |
-
each(children, function(node) {
|
339 |
-
startCell.appendChild(node);
|
340 |
-
});
|
341 |
-
|
342 |
-
// Remove bogus nodes if there is children in the target cell
|
343 |
-
if (children.length) {
|
344 |
-
children = tinymce.grep(startCell.childNodes);
|
345 |
-
count = 0;
|
346 |
-
each(children, function(node) {
|
347 |
-
if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1)
|
348 |
-
startCell.removeChild(node);
|
349 |
-
});
|
350 |
-
}
|
351 |
-
|
352 |
-
// Remove cell
|
353 |
-
dom.remove(cell);
|
354 |
-
}
|
355 |
-
}
|
356 |
-
}
|
357 |
-
|
358 |
-
// Remove empty rows etc and restore caret location
|
359 |
-
cleanup();
|
360 |
-
}
|
361 |
-
};
|
362 |
-
|
363 |
-
function insertRow(before) {
|
364 |
-
var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan;
|
365 |
-
|
366 |
-
// Find first/last row
|
367 |
-
each(grid, function(row, y) {
|
368 |
-
each(row, function(cell, x) {
|
369 |
-
if (isCellSelected(cell)) {
|
370 |
-
cell = cell.elm;
|
371 |
-
rowElm = cell.parentNode;
|
372 |
-
newRow = cloneNode(rowElm, false);
|
373 |
-
posY = y;
|
374 |
-
|
375 |
-
if (before)
|
376 |
-
return false;
|
377 |
-
}
|
378 |
-
});
|
379 |
-
|
380 |
-
if (before)
|
381 |
-
return !posY;
|
382 |
-
});
|
383 |
-
|
384 |
-
for (x = 0; x < grid[0].length; x++) {
|
385 |
-
// Cell not found could be because of an invalid table structure
|
386 |
-
if (!grid[posY][x])
|
387 |
-
continue;
|
388 |
-
|
389 |
-
cell = grid[posY][x].elm;
|
390 |
-
|
391 |
-
if (cell != lastCell) {
|
392 |
-
if (!before) {
|
393 |
-
rowSpan = getSpanVal(cell, 'rowspan');
|
394 |
-
if (rowSpan > 1) {
|
395 |
-
setSpanVal(cell, 'rowSpan', rowSpan + 1);
|
396 |
-
continue;
|
397 |
-
}
|
398 |
-
} else {
|
399 |
-
// Check if cell above can be expanded
|
400 |
-
if (posY > 0 && grid[posY - 1][x]) {
|
401 |
-
otherCell = grid[posY - 1][x].elm;
|
402 |
-
rowSpan = getSpanVal(otherCell, 'rowSpan');
|
403 |
-
if (rowSpan > 1) {
|
404 |
-
setSpanVal(otherCell, 'rowSpan', rowSpan + 1);
|
405 |
-
continue;
|
406 |
-
}
|
407 |
-
}
|
408 |
-
}
|
409 |
-
|
410 |
-
// Insert new cell into new row
|
411 |
-
newCell = cloneCell(cell);
|
412 |
-
setSpanVal(newCell, 'colSpan', cell.colSpan);
|
413 |
-
|
414 |
-
newRow.appendChild(newCell);
|
415 |
-
|
416 |
-
lastCell = cell;
|
417 |
-
}
|
418 |
-
}
|
419 |
-
|
420 |
-
if (newRow.hasChildNodes()) {
|
421 |
-
if (!before)
|
422 |
-
dom.insertAfter(newRow, rowElm);
|
423 |
-
else
|
424 |
-
rowElm.parentNode.insertBefore(newRow, rowElm);
|
425 |
-
}
|
426 |
-
};
|
427 |
-
|
428 |
-
function insertCol(before) {
|
429 |
-
var posX, lastCell;
|
430 |
-
|
431 |
-
// Find first/last column
|
432 |
-
each(grid, function(row, y) {
|
433 |
-
each(row, function(cell, x) {
|
434 |
-
if (isCellSelected(cell)) {
|
435 |
-
posX = x;
|
436 |
-
|
437 |
-
if (before)
|
438 |
-
return false;
|
439 |
-
}
|
440 |
-
});
|
441 |
-
|
442 |
-
if (before)
|
443 |
-
return !posX;
|
444 |
-
});
|
445 |
-
|
446 |
-
each(grid, function(row, y) {
|
447 |
-
var cell, rowSpan, colSpan;
|
448 |
-
|
449 |
-
if (!row[posX])
|
450 |
-
return;
|
451 |
-
|
452 |
-
cell = row[posX].elm;
|
453 |
-
if (cell != lastCell) {
|
454 |
-
colSpan = getSpanVal(cell, 'colspan');
|
455 |
-
rowSpan = getSpanVal(cell, 'rowspan');
|
456 |
-
|
457 |
-
if (colSpan == 1) {
|
458 |
-
if (!before) {
|
459 |
-
dom.insertAfter(cloneCell(cell), cell);
|
460 |
-
fillLeftDown(posX, y, rowSpan - 1, colSpan);
|
461 |
-
} else {
|
462 |
-
cell.parentNode.insertBefore(cloneCell(cell), cell);
|
463 |
-
fillLeftDown(posX, y, rowSpan - 1, colSpan);
|
464 |
-
}
|
465 |
-
} else
|
466 |
-
setSpanVal(cell, 'colSpan', cell.colSpan + 1);
|
467 |
-
|
468 |
-
lastCell = cell;
|
469 |
-
}
|
470 |
-
});
|
471 |
-
};
|
472 |
-
|
473 |
-
function deleteCols() {
|
474 |
-
var cols = [];
|
475 |
-
|
476 |
-
// Get selected column indexes
|
477 |
-
each(grid, function(row, y) {
|
478 |
-
each(row, function(cell, x) {
|
479 |
-
if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) {
|
480 |
-
each(grid, function(row) {
|
481 |
-
var cell = row[x].elm, colSpan;
|
482 |
-
|
483 |
-
colSpan = getSpanVal(cell, 'colSpan');
|
484 |
-
|
485 |
-
if (colSpan > 1)
|
486 |
-
setSpanVal(cell, 'colSpan', colSpan - 1);
|
487 |
-
else
|
488 |
-
dom.remove(cell);
|
489 |
-
});
|
490 |
-
|
491 |
-
cols.push(x);
|
492 |
-
}
|
493 |
-
});
|
494 |
-
});
|
495 |
-
|
496 |
-
cleanup();
|
497 |
-
};
|
498 |
-
|
499 |
-
function deleteRows() {
|
500 |
-
var rows;
|
501 |
-
|
502 |
-
function deleteRow(tr) {
|
503 |
-
var nextTr, pos, lastCell;
|
504 |
-
|
505 |
-
nextTr = dom.getNext(tr, 'tr');
|
506 |
-
|
507 |
-
// Move down row spanned cells
|
508 |
-
each(tr.cells, function(cell) {
|
509 |
-
var rowSpan = getSpanVal(cell, 'rowSpan');
|
510 |
-
|
511 |
-
if (rowSpan > 1) {
|
512 |
-
setSpanVal(cell, 'rowSpan', rowSpan - 1);
|
513 |
-
pos = getPos(cell);
|
514 |
-
fillLeftDown(pos.x, pos.y, 1, 1);
|
515 |
-
}
|
516 |
-
});
|
517 |
-
|
518 |
-
// Delete cells
|
519 |
-
pos = getPos(tr.cells[0]);
|
520 |
-
each(grid[pos.y], function(cell) {
|
521 |
-
var rowSpan;
|
522 |
-
|
523 |
-
cell = cell.elm;
|
524 |
-
|
525 |
-
if (cell != lastCell) {
|
526 |
-
rowSpan = getSpanVal(cell, 'rowSpan');
|
527 |
-
|
528 |
-
if (rowSpan <= 1)
|
529 |
-
dom.remove(cell);
|
530 |
-
else
|
531 |
-
setSpanVal(cell, 'rowSpan', rowSpan - 1);
|
532 |
-
|
533 |
-
lastCell = cell;
|
534 |
-
}
|
535 |
-
});
|
536 |
-
};
|
537 |
-
|
538 |
-
// Get selected rows and move selection out of scope
|
539 |
-
rows = getSelectedRows();
|
540 |
-
|
541 |
-
// Delete all selected rows
|
542 |
-
each(rows.reverse(), function(tr) {
|
543 |
-
deleteRow(tr);
|
544 |
-
});
|
545 |
-
|
546 |
-
cleanup();
|
547 |
-
};
|
548 |
-
|
549 |
-
function cutRows() {
|
550 |
-
var rows = getSelectedRows();
|
551 |
-
|
552 |
-
dom.remove(rows);
|
553 |
-
cleanup();
|
554 |
-
|
555 |
-
return rows;
|
556 |
-
};
|
557 |
-
|
558 |
-
function copyRows() {
|
559 |
-
var rows = getSelectedRows();
|
560 |
-
|
561 |
-
each(rows, function(row, i) {
|
562 |
-
rows[i] = cloneNode(row, true);
|
563 |
-
});
|
564 |
-
|
565 |
-
return rows;
|
566 |
-
};
|
567 |
-
|
568 |
-
function pasteRows(rows, before) {
|
569 |
-
var selectedRows = getSelectedRows(),
|
570 |
-
targetRow = selectedRows[before ? 0 : selectedRows.length - 1],
|
571 |
-
targetCellCount = targetRow.cells.length;
|
572 |
-
|
573 |
-
// Calc target cell count
|
574 |
-
each(grid, function(row) {
|
575 |
-
var match;
|
576 |
-
|
577 |
-
targetCellCount = 0;
|
578 |
-
each(row, function(cell, x) {
|
579 |
-
if (cell.real)
|
580 |
-
targetCellCount += cell.colspan;
|
581 |
-
|
582 |
-
if (cell.elm.parentNode == targetRow)
|
583 |
-
match = 1;
|
584 |
-
});
|
585 |
-
|
586 |
-
if (match)
|
587 |
-
return false;
|
588 |
-
});
|
589 |
-
|
590 |
-
if (!before)
|
591 |
-
rows.reverse();
|
592 |
-
|
593 |
-
each(rows, function(row) {
|
594 |
-
var cellCount = row.cells.length, cell;
|
595 |
-
|
596 |
-
// Remove col/rowspans
|
597 |
-
for (i = 0; i < cellCount; i++) {
|
598 |
-
cell = row.cells[i];
|
599 |
-
setSpanVal(cell, 'colSpan', 1);
|
600 |
-
setSpanVal(cell, 'rowSpan', 1);
|
601 |
-
}
|
602 |
-
|
603 |
-
// Needs more cells
|
604 |
-
for (i = cellCount; i < targetCellCount; i++)
|
605 |
-
row.appendChild(cloneCell(row.cells[cellCount - 1]));
|
606 |
-
|
607 |
-
// Needs less cells
|
608 |
-
for (i = targetCellCount; i < cellCount; i++)
|
609 |
-
dom.remove(row.cells[i]);
|
610 |
-
|
611 |
-
// Add before/after
|
612 |
-
if (before)
|
613 |
-
targetRow.parentNode.insertBefore(row, targetRow);
|
614 |
-
else
|
615 |
-
dom.insertAfter(row, targetRow);
|
616 |
-
});
|
617 |
-
|
618 |
-
// Remove current selection
|
619 |
-
dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
|
620 |
-
};
|
621 |
-
|
622 |
-
function getPos(target) {
|
623 |
-
var pos;
|
624 |
-
|
625 |
-
each(grid, function(row, y) {
|
626 |
-
each(row, function(cell, x) {
|
627 |
-
if (cell.elm == target) {
|
628 |
-
pos = {x : x, y : y};
|
629 |
-
return false;
|
630 |
-
}
|
631 |
-
});
|
632 |
-
|
633 |
-
return !pos;
|
634 |
-
});
|
635 |
-
|
636 |
-
return pos;
|
637 |
-
};
|
638 |
-
|
639 |
-
function setStartCell(cell) {
|
640 |
-
startPos = getPos(cell);
|
641 |
-
};
|
642 |
-
|
643 |
-
function findEndPos() {
|
644 |
-
var pos, maxX, maxY;
|
645 |
-
|
646 |
-
maxX = maxY = 0;
|
647 |
-
|
648 |
-
each(grid, function(row, y) {
|
649 |
-
each(row, function(cell, x) {
|
650 |
-
var colSpan, rowSpan;
|
651 |
-
|
652 |
-
if (isCellSelected(cell)) {
|
653 |
-
cell = grid[y][x];
|
654 |
-
|
655 |
-
if (x > maxX)
|
656 |
-
maxX = x;
|
657 |
-
|
658 |
-
if (y > maxY)
|
659 |
-
maxY = y;
|
660 |
-
|
661 |
-
if (cell.real) {
|
662 |
-
colSpan = cell.colspan - 1;
|
663 |
-
rowSpan = cell.rowspan - 1;
|
664 |
-
|
665 |
-
if (colSpan) {
|
666 |
-
if (x + colSpan > maxX)
|
667 |
-
maxX = x + colSpan;
|
668 |
-
}
|
669 |
-
|
670 |
-
if (rowSpan) {
|
671 |
-
if (y + rowSpan > maxY)
|
672 |
-
maxY = y + rowSpan;
|
673 |
-
}
|
674 |
-
}
|
675 |
-
}
|
676 |
-
});
|
677 |
-
});
|
678 |
-
|
679 |
-
return {x : maxX, y : maxY};
|
680 |
-
};
|
681 |
-
|
682 |
-
function setEndCell(cell) {
|
683 |
-
var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan;
|
684 |
-
|
685 |
-
endPos = getPos(cell);
|
686 |
-
|
687 |
-
if (startPos && endPos) {
|
688 |
-
// Get start/end positions
|
689 |
-
startX = Math.min(startPos.x, endPos.x);
|
690 |
-
startY = Math.min(startPos.y, endPos.y);
|
691 |
-
endX = Math.max(startPos.x, endPos.x);
|
692 |
-
endY = Math.max(startPos.y, endPos.y);
|
693 |
-
|
694 |
-
// Expand end positon to include spans
|
695 |
-
maxX = endX;
|
696 |
-
maxY = endY;
|
697 |
-
|
698 |
-
// Expand startX
|
699 |
-
for (y = startY; y <= maxY; y++) {
|
700 |
-
cell = grid[y][startX];
|
701 |
-
|
702 |
-
if (!cell.real) {
|
703 |
-
if (startX - (cell.colspan - 1) < startX)
|
704 |
-
startX -= cell.colspan - 1;
|
705 |
-
}
|
706 |
-
}
|
707 |
-
|
708 |
-
// Expand startY
|
709 |
-
for (x = startX; x <= maxX; x++) {
|
710 |
-
cell = grid[startY][x];
|
711 |
-
|
712 |
-
if (!cell.real) {
|
713 |
-
if (startY - (cell.rowspan - 1) < startY)
|
714 |
-
startY -= cell.rowspan - 1;
|
715 |
-
}
|
716 |
-
}
|
717 |
-
|
718 |
-
// Find max X, Y
|
719 |
-
for (y = startY; y <= endY; y++) {
|
720 |
-
for (x = startX; x <= endX; x++) {
|
721 |
-
cell = grid[y][x];
|
722 |
-
|
723 |
-
if (cell.real) {
|
724 |
-
colSpan = cell.colspan - 1;
|
725 |
-
rowSpan = cell.rowspan - 1;
|
726 |
-
|
727 |
-
if (colSpan) {
|
728 |
-
if (x + colSpan > maxX)
|
729 |
-
maxX = x + colSpan;
|
730 |
-
}
|
731 |
-
|
732 |
-
if (rowSpan) {
|
733 |
-
if (y + rowSpan > maxY)
|
734 |
-
maxY = y + rowSpan;
|
735 |
-
}
|
736 |
-
}
|
737 |
-
}
|
738 |
-
}
|
739 |
-
|
740 |
-
// Remove current selection
|
741 |
-
dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
|
742 |
-
|
743 |
-
// Add new selection
|
744 |
-
for (y = startY; y <= maxY; y++) {
|
745 |
-
for (x = startX; x <= maxX; x++) {
|
746 |
-
if (grid[y][x])
|
747 |
-
dom.addClass(grid[y][x].elm, 'mceSelected');
|
748 |
-
}
|
749 |
-
}
|
750 |
-
}
|
751 |
-
};
|
752 |
-
|
753 |
-
// Expose to public
|
754 |
-
tinymce.extend(this, {
|
755 |
-
deleteTable : deleteTable,
|
756 |
-
split : split,
|
757 |
-
merge : merge,
|
758 |
-
insertRow : insertRow,
|
759 |
-
insertCol : insertCol,
|
760 |
-
deleteCols : deleteCols,
|
761 |
-
deleteRows : deleteRows,
|
762 |
-
cutRows : cutRows,
|
763 |
-
copyRows : copyRows,
|
764 |
-
pasteRows : pasteRows,
|
765 |
-
getPos : getPos,
|
766 |
-
setStartCell : setStartCell,
|
767 |
-
setEndCell : setEndCell
|
768 |
-
});
|
769 |
-
};
|
770 |
-
|
771 |
-
tinymce.create('tinymce.plugins.TablePlugin', {
|
772 |
-
init : function(ed, url) {
|
773 |
-
var winMan, clipboardRows, hasCellSelection = true; // Might be selected cells on reload
|
774 |
-
|
775 |
-
function createTableGrid(node) {
|
776 |
-
var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table');
|
777 |
-
|
778 |
-
if (tblElm)
|
779 |
-
return new TableGrid(tblElm, ed.dom, selection);
|
780 |
-
};
|
781 |
-
|
782 |
-
function cleanup() {
|
783 |
-
// Restore selection possibilities
|
784 |
-
ed.getBody().style.webkitUserSelect = '';
|
785 |
-
|
786 |
-
if (hasCellSelection) {
|
787 |
-
ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
|
788 |
-
hasCellSelection = false;
|
789 |
-
}
|
790 |
-
};
|
791 |
-
|
792 |
-
// Register buttons
|
793 |
-
each([
|
794 |
-
['table', 'table.desc', 'mceInsertTable', true],
|
795 |
-
['delete_table', 'table.del', 'mceTableDelete'],
|
796 |
-
['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'],
|
797 |
-
['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'],
|
798 |
-
['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'],
|
799 |
-
['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'],
|
800 |
-
['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'],
|
801 |
-
['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'],
|
802 |
-
['row_props', 'table.row_desc', 'mceTableRowProps', true],
|
803 |
-
['cell_props', 'table.cell_desc', 'mceTableCellProps', true],
|
804 |
-
['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true],
|
805 |
-
['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true]
|
806 |
-
], function(c) {
|
807 |
-
ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]});
|
808 |
-
});
|
809 |
-
|
810 |
-
// Select whole table is a table border is clicked
|
811 |
-
if (!tinymce.isIE) {
|
812 |
-
ed.onClick.add(function(ed, e) {
|
813 |
-
e = e.target;
|
814 |
-
|
815 |
-
if (e.nodeName === 'TABLE') {
|
816 |
-
ed.selection.select(e);
|
817 |
-
ed.nodeChanged();
|
818 |
-
}
|
819 |
-
});
|
820 |
-
}
|
821 |
-
|
822 |
-
ed.onPreProcess.add(function(ed, args) {
|
823 |
-
var nodes, i, node, dom = ed.dom, value;
|
824 |
-
|
825 |
-
nodes = dom.select('table', args.node);
|
826 |
-
i = nodes.length;
|
827 |
-
while (i--) {
|
828 |
-
node = nodes[i];
|
829 |
-
dom.setAttrib(node, 'data-mce-style', '');
|
830 |
-
|
831 |
-
if ((value = dom.getAttrib(node, 'width'))) {
|
832 |
-
dom.setStyle(node, 'width', value);
|
833 |
-
dom.setAttrib(node, 'width', '');
|
834 |
-
}
|
835 |
-
|
836 |
-
if ((value = dom.getAttrib(node, 'height'))) {
|
837 |
-
dom.setStyle(node, 'height', value);
|
838 |
-
dom.setAttrib(node, 'height', '');
|
839 |
-
}
|
840 |
-
}
|
841 |
-
});
|
842 |
-
|
843 |
-
// Handle node change updates
|
844 |
-
ed.onNodeChange.add(function(ed, cm, n) {
|
845 |
-
var p;
|
846 |
-
|
847 |
-
n = ed.selection.getStart();
|
848 |
-
p = ed.dom.getParent(n, 'td,th,caption');
|
849 |
-
cm.setActive('table', n.nodeName === 'TABLE' || !!p);
|
850 |
-
|
851 |
-
// Disable table tools if we are in caption
|
852 |
-
if (p && p.nodeName === 'CAPTION')
|
853 |
-
p = 0;
|
854 |
-
|
855 |
-
cm.setDisabled('delete_table', !p);
|
856 |
-
cm.setDisabled('delete_col', !p);
|
857 |
-
cm.setDisabled('delete_table', !p);
|
858 |
-
cm.setDisabled('delete_row', !p);
|
859 |
-
cm.setDisabled('col_after', !p);
|
860 |
-
cm.setDisabled('col_before', !p);
|
861 |
-
cm.setDisabled('row_after', !p);
|
862 |
-
cm.setDisabled('row_before', !p);
|
863 |
-
cm.setDisabled('row_props', !p);
|
864 |
-
cm.setDisabled('cell_props', !p);
|
865 |
-
cm.setDisabled('split_cells', !p);
|
866 |
-
cm.setDisabled('merge_cells', !p);
|
867 |
-
});
|
868 |
-
|
869 |
-
ed.onInit.add(function(ed) {
|
870 |
-
var startTable, startCell, dom = ed.dom, tableGrid;
|
871 |
-
|
872 |
-
winMan = ed.windowManager;
|
873 |
-
|
874 |
-
// Add cell selection logic
|
875 |
-
ed.onMouseDown.add(function(ed, e) {
|
876 |
-
if (e.button != 2) {
|
877 |
-
cleanup();
|
878 |
-
|
879 |
-
startCell = dom.getParent(e.target, 'td,th');
|
880 |
-
startTable = dom.getParent(startCell, 'table');
|
881 |
-
}
|
882 |
-
});
|
883 |
-
|
884 |
-
dom.bind(ed.getDoc(), 'mouseover', function(e) {
|
885 |
-
var sel, table, target = e.target;
|
886 |
-
|
887 |
-
if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) {
|
888 |
-
table = dom.getParent(target, 'table');
|
889 |
-
if (table == startTable) {
|
890 |
-
if (!tableGrid) {
|
891 |
-
tableGrid = createTableGrid(table);
|
892 |
-
tableGrid.setStartCell(startCell);
|
893 |
-
|
894 |
-
ed.getBody().style.webkitUserSelect = 'none';
|
895 |
-
}
|
896 |
-
|
897 |
-
tableGrid.setEndCell(target);
|
898 |
-
hasCellSelection = true;
|
899 |
-
}
|
900 |
-
|
901 |
-
// Remove current selection
|
902 |
-
sel = ed.selection.getSel();
|
903 |
-
|
904 |
-
try {
|
905 |
-
if (sel.removeAllRanges)
|
906 |
-
sel.removeAllRanges();
|
907 |
-
else
|
908 |
-
sel.empty();
|
909 |
-
} catch (ex) {
|
910 |
-
// IE9 might throw errors here
|
911 |
-
}
|
912 |
-
|
913 |
-
e.preventDefault();
|
914 |
-
}
|
915 |
-
});
|
916 |
-
|
917 |
-
ed.onMouseUp.add(function(ed, e) {
|
918 |
-
var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode;
|
919 |
-
|
920 |
-
// Move selection to startCell
|
921 |
-
if (startCell) {
|
922 |
-
if (tableGrid)
|
923 |
-
ed.getBody().style.webkitUserSelect = '';
|
924 |
-
|
925 |
-
function setPoint(node, start) {
|
926 |
-
var walker = new tinymce.dom.TreeWalker(node, node);
|
927 |
-
|
928 |
-
do {
|
929 |
-
// Text node
|
930 |
-
if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) {
|
931 |
-
if (start)
|
932 |
-
rng.setStart(node, 0);
|
933 |
-
else
|
934 |
-
rng.setEnd(node, node.nodeValue.length);
|
935 |
-
|
936 |
-
return;
|
937 |
-
}
|
938 |
-
|
939 |
-
// BR element
|
940 |
-
if (node.nodeName == 'BR') {
|
941 |
-
if (start)
|
942 |
-
rng.setStartBefore(node);
|
943 |
-
else
|
944 |
-
rng.setEndBefore(node);
|
945 |
-
|
946 |
-
return;
|
947 |
-
}
|
948 |
-
} while (node = (start ? walker.next() : walker.prev()));
|
949 |
-
}
|
950 |
-
|
951 |
-
// Try to expand text selection as much as we can only Gecko supports cell selection
|
952 |
-
selectedCells = dom.select('td.mceSelected,th.mceSelected');
|
953 |
-
if (selectedCells.length > 0) {
|
954 |
-
rng = dom.createRng();
|
955 |
-
node = selectedCells[0];
|
956 |
-
endNode = selectedCells[selectedCells.length - 1];
|
957 |
-
rng.setStartBefore(node);
|
958 |
-
rng.setEndAfter(node);
|
959 |
-
|
960 |
-
setPoint(node, 1);
|
961 |
-
walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table'));
|
962 |
-
|
963 |
-
do {
|
964 |
-
if (node.nodeName == 'TD' || node.nodeName == 'TH') {
|
965 |
-
if (!dom.hasClass(node, 'mceSelected'))
|
966 |
-
break;
|
967 |
-
|
968 |
-
lastNode = node;
|
969 |
-
}
|
970 |
-
} while (node = walker.next());
|
971 |
-
|
972 |
-
setPoint(lastNode);
|
973 |
-
|
974 |
-
sel.setRng(rng);
|
975 |
-
}
|
976 |
-
|
977 |
-
ed.nodeChanged();
|
978 |
-
startCell = tableGrid = startTable = null;
|
979 |
-
}
|
980 |
-
});
|
981 |
-
|
982 |
-
ed.onKeyUp.add(function(ed, e) {
|
983 |
-
cleanup();
|
984 |
-
});
|
985 |
-
|
986 |
-
ed.onKeyDown.add(function (ed, e) {
|
987 |
-
fixTableCellSelection(ed);
|
988 |
-
});
|
989 |
-
|
990 |
-
ed.onMouseDown.add(function (ed, e) {
|
991 |
-
if (e.button != 2) {
|
992 |
-
fixTableCellSelection(ed);
|
993 |
-
}
|
994 |
-
});
|
995 |
-
function tableCellSelected(ed, rng, n, currentCell) {
|
996 |
-
// The decision of when a table cell is selected is somewhat involved. The fact that this code is
|
997 |
-
// required is actually a pointer to the root cause of this bug. A cell is selected when the start
|
998 |
-
// and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases)
|
999 |
-
// or the parent of the table (in the case of the selection containing the last cell of a table).
|
1000 |
-
var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'),
|
1001 |
-
tableParent, allOfCellSelected, tableCellSelection;
|
1002 |
-
if (table)
|
1003 |
-
tableParent = table.parentNode;
|
1004 |
-
allOfCellSelected =rng.startContainer.nodeType == TEXT_NODE &&
|
1005 |
-
rng.startOffset == 0 &&
|
1006 |
-
rng.endOffset == 0 &&
|
1007 |
-
currentCell &&
|
1008 |
-
(n.nodeName=="TR" || n==tableParent);
|
1009 |
-
tableCellSelection = (n.nodeName=="TD"||n.nodeName=="TH")&& !currentCell;
|
1010 |
-
return allOfCellSelected || tableCellSelection;
|
1011 |
-
// return false;
|
1012 |
-
}
|
1013 |
-
|
1014 |
-
// this nasty hack is here to work around some WebKit selection bugs.
|
1015 |
-
function fixTableCellSelection(ed) {
|
1016 |
-
if (!tinymce.isWebKit)
|
1017 |
-
return;
|
1018 |
-
|
1019 |
-
var rng = ed.selection.getRng();
|
1020 |
-
var n = ed.selection.getNode();
|
1021 |
-
var currentCell = ed.dom.getParent(rng.startContainer, 'TD,TH');
|
1022 |
-
|
1023 |
-
if (!tableCellSelected(ed, rng, n, currentCell))
|
1024 |
-
return;
|
1025 |
-
if (!currentCell) {
|
1026 |
-
currentCell=n;
|
1027 |
-
}
|
1028 |
-
|
1029 |
-
// Get the very last node inside the table cell
|
1030 |
-
var end = currentCell.lastChild;
|
1031 |
-
while (end.lastChild)
|
1032 |
-
end = end.lastChild;
|
1033 |
-
|
1034 |
-
// Select the entire table cell. Nothing outside of the table cell should be selected.
|
1035 |
-
rng.setEnd(end, end.nodeValue.length);
|
1036 |
-
ed.selection.setRng(rng);
|
1037 |
-
}
|
1038 |
-
ed.plugins.table.fixTableCellSelection=fixTableCellSelection;
|
1039 |
-
|
1040 |
-
// Add context menu
|
1041 |
-
if (ed && ed.plugins.contextmenu) {
|
1042 |
-
ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
|
1043 |
-
var sm, se = ed.selection, el = se.getNode() || ed.getBody();
|
1044 |
-
|
1045 |
-
if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) {
|
1046 |
-
m.removeAll();
|
1047 |
-
|
1048 |
-
if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) {
|
1049 |
-
m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});
|
1050 |
-
m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});
|
1051 |
-
m.addSeparator();
|
1052 |
-
}
|
1053 |
-
|
1054 |
-
if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) {
|
1055 |
-
m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
|
1056 |
-
m.addSeparator();
|
1057 |
-
}
|
1058 |
-
|
1059 |
-
m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}});
|
1060 |
-
m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'});
|
1061 |
-
m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'});
|
1062 |
-
m.addSeparator();
|
1063 |
-
|
1064 |
-
// Cell menu
|
1065 |
-
sm = m.addMenu({title : 'table.cell'});
|
1066 |
-
sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'});
|
1067 |
-
sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'});
|
1068 |
-
sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'});
|
1069 |
-
|
1070 |
-
// Row menu
|
1071 |
-
sm = m.addMenu({title : 'table.row'});
|
1072 |
-
sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'});
|
1073 |
-
sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'});
|
1074 |
-
sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'});
|
1075 |
-
sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'});
|
1076 |
-
sm.addSeparator();
|
1077 |
-
sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'});
|
1078 |
-
sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'});
|
1079 |
-
sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows);
|
1080 |
-
sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows);
|
1081 |
-
|
1082 |
-
// Column menu
|
1083 |
-
sm = m.addMenu({title : 'table.col'});
|
1084 |
-
sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'});
|
1085 |
-
sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'});
|
1086 |
-
sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'});
|
1087 |
-
} else
|
1088 |
-
m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'});
|
1089 |
-
});
|
1090 |
-
}
|
1091 |
-
|
1092 |
-
// Fix to allow navigating up and down in a table in WebKit browsers.
|
1093 |
-
if (tinymce.isWebKit) {
|
1094 |
-
function moveSelection(ed, e) {
|
1095 |
-
var VK = tinymce.VK;
|
1096 |
-
var key = e.keyCode;
|
1097 |
-
|
1098 |
-
function handle(upBool, sourceNode, event) {
|
1099 |
-
var siblingDirection = upBool ? 'previousSibling' : 'nextSibling';
|
1100 |
-
var currentRow = ed.dom.getParent(sourceNode, 'tr');
|
1101 |
-
var siblingRow = currentRow[siblingDirection];
|
1102 |
-
|
1103 |
-
if (siblingRow) {
|
1104 |
-
moveCursorToRow(ed, sourceNode, siblingRow, upBool);
|
1105 |
-
tinymce.dom.Event.cancel(event);
|
1106 |
-
return true;
|
1107 |
-
} else {
|
1108 |
-
var tableNode = ed.dom.getParent(currentRow, 'table');
|
1109 |
-
var middleNode = currentRow.parentNode;
|
1110 |
-
var parentNodeName = middleNode.nodeName.toLowerCase();
|
1111 |
-
if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) {
|
1112 |
-
var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody');
|
1113 |
-
if (targetParent !== null) {
|
1114 |
-
return moveToRowInTarget(upBool, targetParent, sourceNode, event);
|
1115 |
-
}
|
1116 |
-
}
|
1117 |
-
return escapeTable(upBool, currentRow, siblingDirection, tableNode, event);
|
1118 |
-
}
|
1119 |
-
}
|
1120 |
-
|
1121 |
-
function getTargetParent(upBool, topNode, secondNode, nodeName) {
|
1122 |
-
var tbodies = ed.dom.select('>' + nodeName, topNode);
|
1123 |
-
var position = tbodies.indexOf(secondNode);
|
1124 |
-
if (upBool && position === 0 || !upBool && position === tbodies.length - 1) {
|
1125 |
-
return getFirstHeadOrFoot(upBool, topNode);
|
1126 |
-
} else if (position === -1) {
|
1127 |
-
var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1;
|
1128 |
-
return tbodies[topOrBottom];
|
1129 |
-
} else {
|
1130 |
-
return tbodies[position + (upBool ? -1 : 1)];
|
1131 |
-
}
|
1132 |
-
}
|
1133 |
-
|
1134 |
-
function getFirstHeadOrFoot(upBool, parent) {
|
1135 |
-
var tagName = upBool ? 'thead' : 'tfoot';
|
1136 |
-
var headOrFoot = ed.dom.select('>' + tagName, parent);
|
1137 |
-
return headOrFoot.length !== 0 ? headOrFoot[0] : null;
|
1138 |
-
}
|
1139 |
-
|
1140 |
-
function moveToRowInTarget(upBool, targetParent, sourceNode, event) {
|
1141 |
-
var targetRow = getChildForDirection(targetParent, upBool);
|
1142 |
-
targetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool);
|
1143 |
-
tinymce.dom.Event.cancel(event);
|
1144 |
-
return true;
|
1145 |
-
}
|
1146 |
-
|
1147 |
-
function escapeTable(upBool, currentRow, siblingDirection, table, event) {
|
1148 |
-
var tableSibling = table[siblingDirection];
|
1149 |
-
if (tableSibling) {
|
1150 |
-
moveCursorToStartOfElement(tableSibling);
|
1151 |
-
return true;
|
1152 |
-
} else {
|
1153 |
-
var parentCell = ed.dom.getParent(table, 'td,th');
|
1154 |
-
if (parentCell) {
|
1155 |
-
return handle(upBool, parentCell, event);
|
1156 |
-
} else {
|
1157 |
-
var backUpSibling = getChildForDirection(currentRow, !upBool);
|
1158 |
-
moveCursorToStartOfElement(backUpSibling);
|
1159 |
-
return tinymce.dom.Event.cancel(event);
|
1160 |
-
}
|
1161 |
-
}
|
1162 |
-
}
|
1163 |
-
|
1164 |
-
function getChildForDirection(parent, up) {
|
1165 |
-
var child = parent && parent[up ? 'lastChild' : 'firstChild'];
|
1166 |
-
// BR is not a valid table child to return in this case we return the table cell
|
1167 |
-
return child && child.nodeName === 'BR' ? ed.dom.getParent(child, 'td,th') : child;
|
1168 |
-
}
|
1169 |
-
|
1170 |
-
function moveCursorToStartOfElement(n) {
|
1171 |
-
ed.selection.setCursorLocation(n, 0);
|
1172 |
-
}
|
1173 |
-
|
1174 |
-
function isVerticalMovement() {
|
1175 |
-
return key == VK.UP || key == VK.DOWN;
|
1176 |
-
}
|
1177 |
-
|
1178 |
-
function isInTable(ed) {
|
1179 |
-
var node = ed.selection.getNode();
|
1180 |
-
var currentRow = ed.dom.getParent(node, 'tr');
|
1181 |
-
return currentRow !== null;
|
1182 |
-
}
|
1183 |
-
|
1184 |
-
function columnIndex(column) {
|
1185 |
-
var colIndex = 0;
|
1186 |
-
var c = column;
|
1187 |
-
while (c.previousSibling) {
|
1188 |
-
c = c.previousSibling;
|
1189 |
-
colIndex = colIndex + getSpanVal(c, "colspan");
|
1190 |
-
}
|
1191 |
-
return colIndex;
|
1192 |
-
}
|
1193 |
-
|
1194 |
-
function findColumn(rowElement, columnIndex) {
|
1195 |
-
var c = 0;
|
1196 |
-
var r = 0;
|
1197 |
-
each(rowElement.children, function(cell, i) {
|
1198 |
-
c = c + getSpanVal(cell, "colspan");
|
1199 |
-
r = i;
|
1200 |
-
if (c > columnIndex)
|
1201 |
-
return false;
|
1202 |
-
});
|
1203 |
-
return r;
|
1204 |
-
}
|
1205 |
-
|
1206 |
-
function moveCursorToRow(ed, node, row, upBool) {
|
1207 |
-
var srcColumnIndex = columnIndex(ed.dom.getParent(node, 'td,th'));
|
1208 |
-
var tgtColumnIndex = findColumn(row, srcColumnIndex);
|
1209 |
-
var tgtNode = row.childNodes[tgtColumnIndex];
|
1210 |
-
var rowCellTarget = getChildForDirection(tgtNode, upBool);
|
1211 |
-
moveCursorToStartOfElement(rowCellTarget || tgtNode);
|
1212 |
-
}
|
1213 |
-
|
1214 |
-
function shouldFixCaret(preBrowserNode) {
|
1215 |
-
var newNode = ed.selection.getNode();
|
1216 |
-
var newParent = ed.dom.getParent(newNode, 'td,th');
|
1217 |
-
var oldParent = ed.dom.getParent(preBrowserNode, 'td,th');
|
1218 |
-
return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent)
|
1219 |
-
}
|
1220 |
-
|
1221 |
-
function checkSameParentTable(nodeOne, NodeTwo) {
|
1222 |
-
return ed.dom.getParent(nodeOne, 'TABLE') === ed.dom.getParent(NodeTwo, 'TABLE');
|
1223 |
-
}
|
1224 |
-
|
1225 |
-
if (isVerticalMovement() && isInTable(ed)) {
|
1226 |
-
var preBrowserNode = ed.selection.getNode();
|
1227 |
-
setTimeout(function() {
|
1228 |
-
if (shouldFixCaret(preBrowserNode)) {
|
1229 |
-
handle(!e.shiftKey && key === VK.UP, preBrowserNode, e);
|
1230 |
-
}
|
1231 |
-
}, 0);
|
1232 |
-
}
|
1233 |
-
}
|
1234 |
-
|
1235 |
-
ed.onKeyDown.add(moveSelection);
|
1236 |
-
}
|
1237 |
-
|
1238 |
-
// Fixes an issue on Gecko where it's impossible to place the caret behind a table
|
1239 |
-
// This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled
|
1240 |
-
function fixTableCaretPos() {
|
1241 |
-
var last;
|
1242 |
-
|
1243 |
-
// Skip empty text nodes form the end
|
1244 |
-
for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;
|
1245 |
-
|
1246 |
-
if (last && last.nodeName == 'TABLE') {
|
1247 |
-
if (ed.settings.forced_root_block)
|
1248 |
-
ed.dom.add(ed.getBody(), ed.settings.forced_root_block, null, tinymce.isIE ? ' ' : '<br data-mce-bogus="1" />');
|
1249 |
-
else
|
1250 |
-
ed.dom.add(ed.getBody(), 'br', {'data-mce-bogus': '1'});
|
1251 |
-
}
|
1252 |
-
};
|
1253 |
-
|
1254 |
-
// Fixes an bug where it's impossible to place the caret before a table in Gecko
|
1255 |
-
// this fix solves it by detecting when the caret is at the beginning of such a table
|
1256 |
-
// and then manually moves the caret infront of the table
|
1257 |
-
if (tinymce.isGecko) {
|
1258 |
-
ed.onKeyDown.add(function(ed, e) {
|
1259 |
-
var rng, table, dom = ed.dom;
|
1260 |
-
|
1261 |
-
// On gecko it's not possible to place the caret before a table
|
1262 |
-
if (e.keyCode == 37 || e.keyCode == 38) {
|
1263 |
-
rng = ed.selection.getRng();
|
1264 |
-
table = dom.getParent(rng.startContainer, 'table');
|
1265 |
-
|
1266 |
-
if (table && ed.getBody().firstChild == table) {
|
1267 |
-
if (isAtStart(rng, table)) {
|
1268 |
-
rng = dom.createRng();
|
1269 |
-
|
1270 |
-
rng.setStartBefore(table);
|
1271 |
-
rng.setEndBefore(table);
|
1272 |
-
|
1273 |
-
ed.selection.setRng(rng);
|
1274 |
-
|
1275 |
-
e.preventDefault();
|
1276 |
-
}
|
1277 |
-
}
|
1278 |
-
}
|
1279 |
-
});
|
1280 |
-
}
|
1281 |
-
|
1282 |
-
ed.onKeyUp.add(fixTableCaretPos);
|
1283 |
-
ed.onSetContent.add(fixTableCaretPos);
|
1284 |
-
ed.onVisualAid.add(fixTableCaretPos);
|
1285 |
-
|
1286 |
-
ed.onPreProcess.add(function(ed, o) {
|
1287 |
-
var last = o.node.lastChild;
|
1288 |
-
|
1289 |
-
if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 && (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) && last.previousSibling && last.previousSibling.nodeName == "TABLE") {
|
1290 |
-
ed.dom.remove(last);
|
1291 |
-
}
|
1292 |
-
});
|
1293 |
-
|
1294 |
-
|
1295 |
-
/**
|
1296 |
-
* Fixes bug in Gecko where shift-enter in table cell does not place caret on new line
|
1297 |
-
*
|
1298 |
-
* Removed: Since the new enter logic seems to fix this one.
|
1299 |
-
*/
|
1300 |
-
/*
|
1301 |
-
if (tinymce.isGecko) {
|
1302 |
-
ed.onKeyDown.add(function(ed, e) {
|
1303 |
-
if (e.keyCode === tinymce.VK.ENTER && e.shiftKey) {
|
1304 |
-
var node = ed.selection.getRng().startContainer;
|
1305 |
-
var tableCell = dom.getParent(node, 'td,th');
|
1306 |
-
if (tableCell) {
|
1307 |
-
var zeroSizedNbsp = ed.getDoc().createTextNode("\uFEFF");
|
1308 |
-
dom.insertAfter(zeroSizedNbsp, node);
|
1309 |
-
}
|
1310 |
-
}
|
1311 |
-
});
|
1312 |
-
}
|
1313 |
-
*/
|
1314 |
-
|
1315 |
-
fixTableCaretPos();
|
1316 |
-
ed.startContent = ed.getContent({format : 'raw'});
|
1317 |
-
});
|
1318 |
-
|
1319 |
-
// Register action commands
|
1320 |
-
each({
|
1321 |
-
mceTableSplitCells : function(grid) {
|
1322 |
-
grid.split();
|
1323 |
-
},
|
1324 |
-
|
1325 |
-
mceTableMergeCells : function(grid) {
|
1326 |
-
var rowSpan, colSpan, cell;
|
1327 |
-
|
1328 |
-
cell = ed.dom.getParent(ed.selection.getNode(), 'th,td');
|
1329 |
-
if (cell) {
|
1330 |
-
rowSpan = cell.rowSpan;
|
1331 |
-
colSpan = cell.colSpan;
|
1332 |
-
}
|
1333 |
-
|
1334 |
-
if (!ed.dom.select('td.mceSelected,th.mceSelected').length) {
|
1335 |
-
winMan.open({
|
1336 |
-
url : url + '/merge_cells.htm',
|
1337 |
-
width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)),
|
1338 |
-
height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)),
|
1339 |
-
inline : 1
|
1340 |
-
}, {
|
1341 |
-
rows : rowSpan,
|
1342 |
-
cols : colSpan,
|
1343 |
-
onaction : function(data) {
|
1344 |
-
grid.merge(cell, data.cols, data.rows);
|
1345 |
-
},
|
1346 |
-
plugin_url : url
|
1347 |
-
});
|
1348 |
-
} else
|
1349 |
-
grid.merge();
|
1350 |
-
},
|
1351 |
-
|
1352 |
-
mceTableInsertRowBefore : function(grid) {
|
1353 |
-
grid.insertRow(true);
|
1354 |
-
},
|
1355 |
-
|
1356 |
-
mceTableInsertRowAfter : function(grid) {
|
1357 |
-
grid.insertRow();
|
1358 |
-
},
|
1359 |
-
|
1360 |
-
mceTableInsertColBefore : function(grid) {
|
1361 |
-
grid.insertCol(true);
|
1362 |
-
},
|
1363 |
-
|
1364 |
-
mceTableInsertColAfter : function(grid) {
|
1365 |
-
grid.insertCol();
|
1366 |
-
},
|
1367 |
-
|
1368 |
-
mceTableDeleteCol : function(grid) {
|
1369 |
-
grid.deleteCols();
|
1370 |
-
},
|
1371 |
-
|
1372 |
-
mceTableDeleteRow : function(grid) {
|
1373 |
-
grid.deleteRows();
|
1374 |
-
},
|
1375 |
-
|
1376 |
-
mceTableCutRow : function(grid) {
|
1377 |
-
clipboardRows = grid.cutRows();
|
1378 |
-
},
|
1379 |
-
|
1380 |
-
mceTableCopyRow : function(grid) {
|
1381 |
-
clipboardRows = grid.copyRows();
|
1382 |
-
},
|
1383 |
-
|
1384 |
-
mceTablePasteRowBefore : function(grid) {
|
1385 |
-
grid.pasteRows(clipboardRows, true);
|
1386 |
-
},
|
1387 |
-
|
1388 |
-
mceTablePasteRowAfter : function(grid) {
|
1389 |
-
grid.pasteRows(clipboardRows);
|
1390 |
-
},
|
1391 |
-
|
1392 |
-
mceTableDelete : function(grid) {
|
1393 |
-
grid.deleteTable();
|
1394 |
-
}
|
1395 |
-
}, function(func, name) {
|
1396 |
-
ed.addCommand(name, function() {
|
1397 |
-
var grid = createTableGrid();
|
1398 |
-
|
1399 |
-
if (grid) {
|
1400 |
-
func(grid);
|
1401 |
-
ed.execCommand('mceRepaint');
|
1402 |
-
cleanup();
|
1403 |
-
}
|
1404 |
-
});
|
1405 |
-
});
|
1406 |
-
|
1407 |
-
// Register dialog commands
|
1408 |
-
each({
|
1409 |
-
mceInsertTable : function(val) {
|
1410 |
-
winMan.open({
|
1411 |
-
url : url + '/table.htm',
|
1412 |
-
width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)),
|
1413 |
-
height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)),
|
1414 |
-
inline : 1
|
1415 |
-
}, {
|
1416 |
-
plugin_url : url,
|
1417 |
-
action : val ? val.action : 0
|
1418 |
-
});
|
1419 |
-
},
|
1420 |
-
|
1421 |
-
mceTableRowProps : function() {
|
1422 |
-
winMan.open({
|
1423 |
-
url : url + '/row.htm',
|
1424 |
-
width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)),
|
1425 |
-
height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)),
|
1426 |
-
inline : 1
|
1427 |
-
}, {
|
1428 |
-
plugin_url : url
|
1429 |
-
});
|
1430 |
-
},
|
1431 |
-
|
1432 |
-
mceTableCellProps : function() {
|
1433 |
-
winMan.open({
|
1434 |
-
url : url + '/cell.htm',
|
1435 |
-
width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)),
|
1436 |
-
height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)),
|
1437 |
-
inline : 1
|
1438 |
-
}, {
|
1439 |
-
plugin_url : url
|
1440 |
-
});
|
1441 |
-
}
|
1442 |
-
}, function(func, name) {
|
1443 |
-
ed.addCommand(name, function(ui, val) {
|
1444 |
-
func(val);
|
1445 |
-
});
|
1446 |
-
});
|
1447 |
-
}
|
1448 |
-
});
|
1449 |
-
|
1450 |
-
// Register plugin
|
1451 |
-
tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin);
|
1452 |
-
})(tinymce);
|
1 |
+
/**
|
2 |
+
* editor_plugin_src.js
|
3 |
+
*
|
4 |
+
* Copyright 2009, Moxiecode Systems AB
|
5 |
+
* Released under LGPL License.
|
6 |
+
*
|
7 |
+
* License: http://tinymce.moxiecode.com/license
|
8 |
+
* Contributing: http://tinymce.moxiecode.com/contributing
|
9 |
+
*/
|
10 |
+
|
11 |
+
(function(tinymce) {
|
12 |
+
var each = tinymce.each;
|
13 |
+
|
14 |
+
// Checks if the selection/caret is at the start of the specified block element
|
15 |
+
function isAtStart(rng, par) {
|
16 |
+
var doc = par.ownerDocument, rng2 = doc.createRange(), elm;
|
17 |
+
|
18 |
+
rng2.setStartBefore(par);
|
19 |
+
rng2.setEnd(rng.endContainer, rng.endOffset);
|
20 |
+
|
21 |
+
elm = doc.createElement('body');
|
22 |
+
elm.appendChild(rng2.cloneContents());
|
23 |
+
|
24 |
+
// Check for text characters of other elements that should be treated as content
|
25 |
+
return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0;
|
26 |
+
};
|
27 |
+
|
28 |
+
function getSpanVal(td, name) {
|
29 |
+
return parseInt(td.getAttribute(name) || 1);
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Table Grid class.
|
34 |
+
*/
|
35 |
+
function TableGrid(table, dom, selection) {
|
36 |
+
var grid, startPos, endPos, selectedCell;
|
37 |
+
|
38 |
+
buildGrid();
|
39 |
+
selectedCell = dom.getParent(selection.getStart(), 'th,td');
|
40 |
+
if (selectedCell) {
|
41 |
+
startPos = getPos(selectedCell);
|
42 |
+
endPos = findEndPos();
|
43 |
+
selectedCell = getCell(startPos.x, startPos.y);
|
44 |
+
}
|
45 |
+
|
46 |
+
function cloneNode(node, children) {
|
47 |
+
node = node.cloneNode(children);
|
48 |
+
node.removeAttribute('id');
|
49 |
+
|
50 |
+
return node;
|
51 |
+
}
|
52 |
+
|
53 |
+
function buildGrid() {
|
54 |
+
var startY = 0;
|
55 |
+
|
56 |
+
grid = [];
|
57 |
+
|
58 |
+
each(['thead', 'tbody', 'tfoot'], function(part) {
|
59 |
+
var rows = dom.select('> ' + part + ' tr', table);
|
60 |
+
|
61 |
+
each(rows, function(tr, y) {
|
62 |
+
y += startY;
|
63 |
+
|
64 |
+
each(dom.select('> td, > th', tr), function(td, x) {
|
65 |
+
var x2, y2, rowspan, colspan;
|
66 |
+
|
67 |
+
// Skip over existing cells produced by rowspan
|
68 |
+
if (grid[y]) {
|
69 |
+
while (grid[y][x])
|
70 |
+
x++;
|
71 |
+
}
|
72 |
+
|
73 |
+
// Get col/rowspan from cell
|
74 |
+
rowspan = getSpanVal(td, 'rowspan');
|
75 |
+
colspan = getSpanVal(td, 'colspan');
|
76 |
+
|
77 |
+
// Fill out rowspan/colspan right and down
|
78 |
+
for (y2 = y; y2 < y + rowspan; y2++) {
|
79 |
+
if (!grid[y2])
|
80 |
+
grid[y2] = [];
|
81 |
+
|
82 |
+
for (x2 = x; x2 < x + colspan; x2++) {
|
83 |
+
grid[y2][x2] = {
|
84 |
+
part : part,
|
85 |
+
real : y2 == y && x2 == x,
|
86 |
+
elm : td,
|
87 |
+
rowspan : rowspan,
|
88 |
+
colspan : colspan
|
89 |
+
};
|
90 |
+
}
|
91 |
+
}
|
92 |
+
});
|
93 |
+
});
|
94 |
+
|
95 |
+
startY += rows.length;
|
96 |
+
});
|
97 |
+
};
|
98 |
+
|
99 |
+
function getCell(x, y) {
|
100 |
+
var row;
|
101 |
+
|
102 |
+
row = grid[y];
|
103 |
+
if (row)
|
104 |
+
return row[x];
|
105 |
+
};
|
106 |
+
|
107 |
+
function setSpanVal(td, name, val) {
|
108 |
+
if (td) {
|
109 |
+
val = parseInt(val);
|
110 |
+
|
111 |
+
if (val === 1)
|
112 |
+
td.removeAttribute(name, 1);
|
113 |
+
else
|
114 |
+
td.setAttribute(name, val, 1);
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
function isCellSelected(cell) {
|
119 |
+
return cell && (dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell);
|
120 |
+
};
|
121 |
+
|
122 |
+
function getSelectedRows() {
|
123 |
+
var rows = [];
|
124 |
+
|
125 |
+
each(table.rows, function(row) {
|
126 |
+
each(row.cells, function(cell) {
|
127 |
+
if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) {
|
128 |
+
rows.push(row);
|
129 |
+
return false;
|
130 |
+
}
|
131 |
+
});
|
132 |
+
});
|
133 |
+
|
134 |
+
return rows;
|
135 |
+
};
|
136 |
+
|
137 |
+
function deleteTable() {
|
138 |
+
var rng = dom.createRng();
|
139 |
+
|
140 |
+
rng.setStartAfter(table);
|
141 |
+
rng.setEndAfter(table);
|
142 |
+
|
143 |
+
selection.setRng(rng);
|
144 |
+
|
145 |
+
dom.remove(table);
|
146 |
+
};
|
147 |
+
|
148 |
+
function cloneCell(cell) {
|
149 |
+
var formatNode;
|
150 |
+
|
151 |
+
// Clone formats
|
152 |
+
tinymce.walk(cell, function(node) {
|
153 |
+
var curNode;
|
154 |
+
|
155 |
+
if (node.nodeType == 3) {
|
156 |
+
each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) {
|
157 |
+
node = cloneNode(node, false);
|
158 |
+
|
159 |
+
if (!formatNode)
|
160 |
+
formatNode = curNode = node;
|
161 |
+
else if (curNode)
|
162 |
+
curNode.appendChild(node);
|
163 |
+
|
164 |
+
curNode = node;
|
165 |
+
});
|
166 |
+
|
167 |
+
// Add something to the inner node
|
168 |
+
if (curNode)
|
169 |
+
curNode.innerHTML = tinymce.isIE ? ' ' : '<br data-mce-bogus="1" />';
|
170 |
+
|
171 |
+
return false;
|
172 |
+
}
|
173 |
+
}, 'childNodes');
|
174 |
+
|
175 |
+
cell = cloneNode(cell, false);
|
176 |
+
setSpanVal(cell, 'rowSpan', 1);
|
177 |
+
setSpanVal(cell, 'colSpan', 1);
|
178 |
+
|
179 |
+
if (formatNode) {
|
180 |
+
cell.appendChild(formatNode);
|
181 |
+
} else {
|
182 |
+
if (!tinymce.isIE)
|
183 |
+
cell.innerHTML = '<br data-mce-bogus="1" />';
|
184 |
+
}
|
185 |
+
|
186 |
+
return cell;
|
187 |
+
};
|
188 |
+
|
189 |
+
function cleanup() {
|
190 |
+
var rng = dom.createRng();
|
191 |
+
|
192 |
+
// Empty rows
|
193 |
+
each(dom.select('tr', table), function(tr) {
|
194 |
+
if (tr.cells.length == 0)
|
195 |
+
dom.remove(tr);
|
196 |
+
});
|
197 |
+
|
198 |
+
// Empty table
|
199 |
+
if (dom.select('tr', table).length == 0) {
|
200 |
+
rng.setStartAfter(table);
|
201 |
+
rng.setEndAfter(table);
|
202 |
+
selection.setRng(rng);
|
203 |
+
dom.remove(table);
|
204 |
+
return;
|
205 |
+
}
|
206 |
+
|
207 |
+
// Empty header/body/footer
|
208 |
+
each(dom.select('thead,tbody,tfoot', table), function(part) {
|
209 |
+
if (part.rows.length == 0)
|
210 |
+
dom.remove(part);
|
211 |
+
});
|
212 |
+
|
213 |
+
// Restore selection to start position if it still exists
|
214 |
+
buildGrid();
|
215 |
+
|
216 |
+
// Restore the selection to the closest table position
|
217 |
+
row = grid[Math.min(grid.length - 1, startPos.y)];
|
218 |
+
if (row) {
|
219 |
+
selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true);
|
220 |
+
selection.collapse(true);
|
221 |
+
}
|
222 |
+
};
|
223 |
+
|
224 |
+
function fillLeftDown(x, y, rows, cols) {
|
225 |
+
var tr, x2, r, c, cell;
|
226 |
+
|
227 |
+
tr = grid[y][x].elm.parentNode;
|
228 |
+
for (r = 1; r <= rows; r++) {
|
229 |
+
tr = dom.getNext(tr, 'tr');
|
230 |
+
|
231 |
+
if (tr) {
|
232 |
+
// Loop left to find real cell
|
233 |
+
for (x2 = x; x2 >= 0; x2--) {
|
234 |
+
cell = grid[y + r][x2].elm;
|
235 |
+
|
236 |
+
if (cell.parentNode == tr) {
|
237 |
+
// Append clones after
|
238 |
+
for (c = 1; c <= cols; c++)
|
239 |
+
dom.insertAfter(cloneCell(cell), cell);
|
240 |
+
|
241 |
+
break;
|
242 |
+
}
|
243 |
+
}
|
244 |
+
|
245 |
+
if (x2 == -1) {
|
246 |
+
// Insert nodes before first cell
|
247 |
+
for (c = 1; c <= cols; c++)
|
248 |
+
tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]);
|
249 |
+
}
|
250 |
+
}
|
251 |
+
}
|
252 |
+
};
|
253 |
+
|
254 |
+
function split() {
|
255 |
+
each(grid, function(row, y) {
|
256 |
+
each(row, function(cell, x) {
|
257 |
+
var colSpan, rowSpan, newCell, i;
|
258 |
+
|
259 |
+
if (isCellSelected(cell)) {
|
260 |
+
cell = cell.elm;
|
261 |
+
colSpan = getSpanVal(cell, 'colspan');
|
262 |
+
rowSpan = getSpanVal(cell, 'rowspan');
|
263 |
+
|
264 |
+
if (colSpan > 1 || rowSpan > 1) {
|
265 |
+
setSpanVal(cell, 'rowSpan', 1);
|
266 |
+
setSpanVal(cell, 'colSpan', 1);
|
267 |
+
|
268 |
+
// Insert cells right
|
269 |
+
for (i = 0; i < colSpan - 1; i++)
|
270 |
+
dom.insertAfter(cloneCell(cell), cell);
|
271 |
+
|
272 |
+
fillLeftDown(x, y, rowSpan - 1, colSpan);
|
273 |
+
}
|
274 |
+
}
|
275 |
+
});
|
276 |
+
});
|
277 |
+
};
|
278 |
+
|
279 |
+
function merge(cell, cols, rows) {
|
280 |
+
var startX, startY, endX, endY, x, y, startCell, endCell, cell, children, count;
|
281 |
+
|
282 |
+
// Use specified cell and cols/rows
|
283 |
+
if (cell) {
|
284 |
+
pos = getPos(cell);
|
285 |
+
startX = pos.x;
|
286 |
+
startY = pos.y;
|
287 |
+
endX = startX + (cols - 1);
|
288 |
+
endY = startY + (rows - 1);
|
289 |
+
} else {
|
290 |
+
startPos = endPos = null;
|
291 |
+
|
292 |
+
// Calculate start/end pos by checking for selected cells in grid works better with context menu
|
293 |
+
each(grid, function(row, y) {
|
294 |
+
each(row, function(cell, x) {
|
295 |
+
if (isCellSelected(cell)) {
|
296 |
+
if (!startPos) {
|
297 |
+
startPos = {x: x, y: y};
|
298 |
+
}
|
299 |
+
|
300 |
+
endPos = {x: x, y: y};
|
301 |
+
}
|
302 |
+
});
|
303 |
+
});
|
304 |
+
|
305 |
+
// Use selection
|
306 |
+
startX = startPos.x;
|
307 |
+
startY = startPos.y;
|
308 |
+
endX = endPos.x;
|
309 |
+
endY = endPos.y;
|
310 |
+
}
|
311 |
+
|
312 |
+
// Find start/end cells
|
313 |
+
startCell = getCell(startX, startY);
|
314 |
+
endCell = getCell(endX, endY);
|
315 |
+
|
316 |
+
// Check if the cells exists and if they are of the same part for example tbody = tbody
|
317 |
+
if (startCell && endCell && startCell.part == endCell.part) {
|
318 |
+
// Split and rebuild grid
|
319 |
+
split();
|
320 |
+
buildGrid();
|
321 |
+
|
322 |
+
// Set row/col span to start cell
|
323 |
+
startCell = getCell(startX, startY).elm;
|
324 |
+
setSpanVal(startCell, 'colSpan', (endX - startX) + 1);
|
325 |
+
setSpanVal(startCell, 'rowSpan', (endY - startY) + 1);
|
326 |
+
|
327 |
+
// Remove other cells and add it's contents to the start cell
|
328 |
+
for (y = startY; y <= endY; y++) {
|
329 |
+
for (x = startX; x <= endX; x++) {
|
330 |
+
if (!grid[y] || !grid[y][x])
|
331 |
+
continue;
|
332 |
+
|
333 |
+
cell = grid[y][x].elm;
|
334 |
+
|
335 |
+
if (cell != startCell) {
|
336 |
+
// Move children to startCell
|
337 |
+
children = tinymce.grep(cell.childNodes);
|
338 |
+
each(children, function(node) {
|
339 |
+
startCell.appendChild(node);
|
340 |
+
});
|
341 |
+
|
342 |
+
// Remove bogus nodes if there is children in the target cell
|
343 |
+
if (children.length) {
|
344 |
+
children = tinymce.grep(startCell.childNodes);
|
345 |
+
count = 0;
|
346 |
+
each(children, function(node) {
|
347 |
+
if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1)
|
348 |
+
startCell.removeChild(node);
|
349 |
+
});
|
350 |
+
}
|
351 |
+
|
352 |
+
// Remove cell
|
353 |
+
dom.remove(cell);
|
354 |
+
}
|
355 |
+
}
|
356 |
+
}
|
357 |
+
|
358 |
+
// Remove empty rows etc and restore caret location
|
359 |
+
cleanup();
|
360 |
+
}
|
361 |
+
};
|
362 |
+
|
363 |
+
function insertRow(before) {
|
364 |
+
var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan;
|
365 |
+
|
366 |
+
// Find first/last row
|
367 |
+
each(grid, function(row, y) {
|
368 |
+
each(row, function(cell, x) {
|
369 |
+
if (isCellSelected(cell)) {
|
370 |
+
cell = cell.elm;
|
371 |
+
rowElm = cell.parentNode;
|
372 |
+
newRow = cloneNode(rowElm, false);
|
373 |
+
posY = y;
|
374 |
+
|
375 |
+
if (before)
|
376 |
+
return false;
|
377 |
+
}
|
378 |
+
});
|
379 |
+
|
380 |
+
if (before)
|
381 |
+
return !posY;
|
382 |
+
});
|
383 |
+
|
384 |
+
for (x = 0; x < grid[0].length; x++) {
|
385 |
+
// Cell not found could be because of an invalid table structure
|
386 |
+
if (!grid[posY][x])
|
387 |
+
continue;
|
388 |
+
|
389 |
+
cell = grid[posY][x].elm;
|
390 |
+
|
391 |
+
if (cell != lastCell) {
|
392 |
+
if (!before) {
|
393 |
+
rowSpan = getSpanVal(cell, 'rowspan');
|
394 |
+
if (rowSpan > 1) {
|
395 |
+
setSpanVal(cell, 'rowSpan', rowSpan + 1);
|
396 |
+
continue;
|
397 |
+
}
|
398 |
+
} else {
|
399 |
+
// Check if cell above can be expanded
|
400 |
+
if (posY > 0 && grid[posY - 1][x]) {
|
401 |
+
otherCell = grid[posY - 1][x].elm;
|
402 |
+
rowSpan = getSpanVal(otherCell, 'rowSpan');
|
403 |
+
if (rowSpan > 1) {
|
404 |
+
setSpanVal(otherCell, 'rowSpan', rowSpan + 1);
|
405 |
+
continue;
|
406 |
+
}
|
407 |
+
}
|
408 |
+
}
|
409 |
+
|
410 |
+
// Insert new cell into new row
|
411 |
+
newCell = cloneCell(cell);
|
412 |
+
setSpanVal(newCell, 'colSpan', cell.colSpan);
|
413 |
+
|
414 |
+
newRow.appendChild(newCell);
|
415 |
+
|
416 |
+
lastCell = cell;
|
417 |
+
}
|
418 |
+
}
|
419 |
+
|
420 |
+
if (newRow.hasChildNodes()) {
|
421 |
+
if (!before)
|
422 |
+
dom.insertAfter(newRow, rowElm);
|
423 |
+
else
|
424 |
+
rowElm.parentNode.insertBefore(newRow, rowElm);
|
425 |
+
}
|
426 |
+
};
|
427 |
+
|
428 |
+
function insertCol(before) {
|
429 |
+
var posX, lastCell;
|
430 |
+
|
431 |
+
// Find first/last column
|
432 |
+
each(grid, function(row, y) {
|
433 |
+
each(row, function(cell, x) {
|
434 |
+
if (isCellSelected(cell)) {
|
435 |
+
posX = x;
|
436 |
+
|
437 |
+
if (before)
|
438 |
+
return false;
|
439 |
+
}
|
440 |
+
});
|
441 |
+
|
442 |
+
if (before)
|
443 |
+
return !posX;
|
444 |
+
});
|
445 |
+
|
446 |
+
each(grid, function(row, y) {
|
447 |
+
var cell, rowSpan, colSpan;
|
448 |
+
|
449 |
+
if (!row[posX])
|
450 |
+
return;
|
451 |
+
|
452 |
+
cell = row[posX].elm;
|
453 |
+
if (cell != lastCell) {
|
454 |
+
colSpan = getSpanVal(cell, 'colspan');
|
455 |
+
rowSpan = getSpanVal(cell, 'rowspan');
|
456 |
+
|
457 |
+
if (colSpan == 1) {
|
458 |
+
if (!before) {
|
459 |
+
dom.insertAfter(cloneCell(cell), cell);
|
460 |
+
fillLeftDown(posX, y, rowSpan - 1, colSpan);
|
461 |
+
} else {
|
462 |
+
cell.parentNode.insertBefore(cloneCell(cell), cell);
|
463 |
+
fillLeftDown(posX, y, rowSpan - 1, colSpan);
|
464 |
+
}
|
465 |
+
} else
|
466 |
+
setSpanVal(cell, 'colSpan', cell.colSpan + 1);
|
467 |
+
|
468 |
+
lastCell = cell;
|
469 |
+
}
|
470 |
+
});
|
471 |
+
};
|
472 |
+
|
473 |
+
function deleteCols() {
|
474 |
+
var cols = [];
|
475 |
+
|
476 |
+
// Get selected column indexes
|
477 |
+
each(grid, function(row, y) {
|
478 |
+
each(row, function(cell, x) {
|
479 |
+
if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) {
|
480 |
+
each(grid, function(row) {
|
481 |
+
var cell = row[x].elm, colSpan;
|
482 |
+
|
483 |
+
colSpan = getSpanVal(cell, 'colSpan');
|
484 |
+
|
485 |
+
if (colSpan > 1)
|
486 |
+
setSpanVal(cell, 'colSpan', colSpan - 1);
|
487 |
+
else
|
488 |
+
dom.remove(cell);
|
489 |
+
});
|
490 |
+
|
491 |
+
cols.push(x);
|
492 |
+
}
|
493 |
+
});
|
494 |
+
});
|
495 |
+
|
496 |
+
cleanup();
|
497 |
+
};
|
498 |
+
|
499 |
+
function deleteRows() {
|
500 |
+
var rows;
|
501 |
+
|
502 |
+
function deleteRow(tr) {
|
503 |
+
var nextTr, pos, lastCell;
|
504 |
+
|
505 |
+
nextTr = dom.getNext(tr, 'tr');
|
506 |
+
|
507 |
+
// Move down row spanned cells
|
508 |
+
each(tr.cells, function(cell) {
|
509 |
+
var rowSpan = getSpanVal(cell, 'rowSpan');
|
510 |
+
|
511 |
+
if (rowSpan > 1) {
|
512 |
+
setSpanVal(cell, 'rowSpan', rowSpan - 1);
|
513 |
+
pos = getPos(cell);
|
514 |
+
fillLeftDown(pos.x, pos.y, 1, 1);
|
515 |
+
}
|
516 |
+
});
|
517 |
+
|
518 |
+
// Delete cells
|
519 |
+
pos = getPos(tr.cells[0]);
|
520 |
+
each(grid[pos.y], function(cell) {
|
521 |
+
var rowSpan;
|
522 |
+
|
523 |
+
cell = cell.elm;
|
524 |
+
|
525 |
+
if (cell != lastCell) {
|
526 |
+
rowSpan = getSpanVal(cell, 'rowSpan');
|
527 |
+
|
528 |
+
if (rowSpan <= 1)
|
529 |
+
dom.remove(cell);
|
530 |
+
else
|
531 |
+
setSpanVal(cell, 'rowSpan', rowSpan - 1);
|
532 |
+
|
533 |
+
lastCell = cell;
|
534 |
+
}
|
535 |
+
});
|
536 |
+
};
|
537 |
+
|
538 |
+
// Get selected rows and move selection out of scope
|
539 |
+
rows = getSelectedRows();
|
540 |
+
|
541 |
+
// Delete all selected rows
|
542 |
+
each(rows.reverse(), function(tr) {
|
543 |
+
deleteRow(tr);
|
544 |
+
});
|
545 |
+
|
546 |
+
cleanup();
|
547 |
+
};
|
548 |
+
|
549 |
+
function cutRows() {
|
550 |
+
var rows = getSelectedRows();
|
551 |
+
|
552 |
+
dom.remove(rows);
|
553 |
+
cleanup();
|
554 |
+
|
555 |
+
return rows;
|
556 |
+
};
|
557 |
+
|
558 |
+
function copyRows() {
|
559 |
+
var rows = getSelectedRows();
|
560 |
+
|
561 |
+
each(rows, function(row, i) {
|
562 |
+
rows[i] = cloneNode(row, true);
|
563 |
+
});
|
564 |
+
|
565 |
+
return rows;
|
566 |
+
};
|
567 |
+
|
568 |
+
function pasteRows(rows, before) {
|
569 |
+
var selectedRows = getSelectedRows(),
|
570 |
+
targetRow = selectedRows[before ? 0 : selectedRows.length - 1],
|
571 |
+
targetCellCount = targetRow.cells.length;
|
572 |
+
|
573 |
+
// Calc target cell count
|
574 |
+
each(grid, function(row) {
|
575 |
+
var match;
|
576 |
+
|
577 |
+
targetCellCount = 0;
|
578 |
+
each(row, function(cell, x) {
|
579 |
+
if (cell.real)
|
580 |
+
targetCellCount += cell.colspan;
|
581 |
+
|
582 |
+
if (cell.elm.parentNode == targetRow)
|
583 |
+
match = 1;
|
584 |
+
});
|
585 |
+
|
586 |
+
if (match)
|
587 |
+
return false;
|
588 |
+
});
|
589 |
+
|
590 |
+
if (!before)
|
591 |
+
rows.reverse();
|
592 |
+
|
593 |
+
each(rows, function(row) {
|
594 |
+
var cellCount = row.cells.length, cell;
|
595 |
+
|
596 |
+
// Remove col/rowspans
|
597 |
+
for (i = 0; i < cellCount; i++) {
|
598 |
+
cell = row.cells[i];
|
599 |
+
setSpanVal(cell, 'colSpan', 1);
|
600 |
+
setSpanVal(cell, 'rowSpan', 1);
|
601 |
+
}
|
602 |
+
|
603 |
+
// Needs more cells
|
604 |
+
for (i = cellCount; i < targetCellCount; i++)
|
605 |
+
row.appendChild(cloneCell(row.cells[cellCount - 1]));
|
606 |
+
|
607 |
+
// Needs less cells
|
608 |
+
for (i = targetCellCount; i < cellCount; i++)
|
609 |
+
dom.remove(row.cells[i]);
|
610 |
+
|
611 |
+
// Add before/after
|
612 |
+
if (before)
|
613 |
+
targetRow.parentNode.insertBefore(row, targetRow);
|
614 |
+
else
|
615 |
+
dom.insertAfter(row, targetRow);
|
616 |
+
});
|
617 |
+
|
618 |
+
// Remove current selection
|
619 |
+
dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
|
620 |
+
};
|
621 |
+
|
622 |
+
function getPos(target) {
|
623 |
+
var pos;
|
624 |
+
|
625 |
+
each(grid, function(row, y) {
|
626 |
+
each(row, function(cell, x) {
|
627 |
+
if (cell.elm == target) {
|
628 |
+
pos = {x : x, y : y};
|
629 |
+
return false;
|
630 |
+
}
|
631 |
+
});
|
632 |
+
|
633 |
+
return !pos;
|
634 |
+
});
|
635 |
+
|
636 |
+
return pos;
|
637 |
+
};
|
638 |
+
|
639 |
+
function setStartCell(cell) {
|
640 |
+
startPos = getPos(cell);
|
641 |
+
};
|
642 |
+
|
643 |
+
function findEndPos() {
|
644 |
+
var pos, maxX, maxY;
|
645 |
+
|
646 |
+
maxX = maxY = 0;
|
647 |
+
|
648 |
+
each(grid, function(row, y) {
|
649 |
+
each(row, function(cell, x) {
|
650 |
+
var colSpan, rowSpan;
|
651 |
+
|
652 |
+
if (isCellSelected(cell)) {
|
653 |
+
cell = grid[y][x];
|
654 |
+
|
655 |
+
if (x > maxX)
|
656 |
+
maxX = x;
|
657 |
+
|
658 |
+
if (y > maxY)
|
659 |
+
maxY = y;
|
660 |
+
|
661 |
+
if (cell.real) {
|
662 |
+
colSpan = cell.colspan - 1;
|
663 |
+
rowSpan = cell.rowspan - 1;
|
664 |
+
|
665 |
+
if (colSpan) {
|
666 |
+
if (x + colSpan > maxX)
|
667 |
+
maxX = x + colSpan;
|
668 |
+
}
|
669 |
+
|
670 |
+
if (rowSpan) {
|
671 |
+
if (y + rowSpan > maxY)
|
672 |
+
maxY = y + rowSpan;
|
673 |
+
}
|
674 |
+
}
|
675 |
+
}
|
676 |
+
});
|
677 |
+
});
|
678 |
+
|
679 |
+
return {x : maxX, y : maxY};
|
680 |
+
};
|
681 |
+
|
682 |
+
function setEndCell(cell) {
|
683 |
+
var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan;
|
684 |
+
|
685 |
+
endPos = getPos(cell);
|
686 |
+
|
687 |
+
if (startPos && endPos) {
|
688 |
+
// Get start/end positions
|
689 |
+
startX = Math.min(startPos.x, endPos.x);
|
690 |
+
startY = Math.min(startPos.y, endPos.y);
|
691 |
+
endX = Math.max(startPos.x, endPos.x);
|
692 |
+
endY = Math.max(startPos.y, endPos.y);
|
693 |
+
|
694 |
+
// Expand end positon to include spans
|
695 |
+
maxX = endX;
|
696 |
+
maxY = endY;
|
697 |
+
|
698 |
+
// Expand startX
|
699 |
+
for (y = startY; y <= maxY; y++) {
|
700 |
+
cell = grid[y][startX];
|
701 |
+
|
702 |
+
if (!cell.real) {
|
703 |
+
if (startX - (cell.colspan - 1) < startX)
|
704 |
+
startX -= cell.colspan - 1;
|
705 |
+
}
|
706 |
+
}
|
707 |
+
|
708 |
+
// Expand startY
|
709 |
+
for (x = startX; x <= maxX; x++) {
|
710 |
+
cell = grid[startY][x];
|
711 |
+
|
712 |
+
if (!cell.real) {
|
713 |
+
if (startY - (cell.rowspan - 1) < startY)
|
714 |
+
startY -= cell.rowspan - 1;
|
715 |
+
}
|
716 |
+
}
|
717 |
+
|
718 |
+
// Find max X, Y
|
719 |
+
for (y = startY; y <= endY; y++) {
|
720 |
+
for (x = startX; x <= endX; x++) {
|
721 |
+
cell = grid[y][x];
|
722 |
+
|
723 |
+
if (cell.real) {
|
724 |
+
colSpan = cell.colspan - 1;
|
725 |
+
rowSpan = cell.rowspan - 1;
|
726 |
+
|
727 |
+
if (colSpan) {
|
728 |
+
if (x + colSpan > maxX)
|
729 |
+
maxX = x + colSpan;
|
730 |
+
}
|
731 |
+
|
732 |
+
if (rowSpan) {
|
733 |
+
if (y + rowSpan > maxY)
|
734 |
+
maxY = y + rowSpan;
|
735 |
+
}
|
736 |
+
}
|
737 |
+
}
|
738 |
+
}
|
739 |
+
|
740 |
+
// Remove current selection
|
741 |
+
dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
|
742 |
+
|
743 |
+
// Add new selection
|
744 |
+
for (y = startY; y <= maxY; y++) {
|
745 |
+
for (x = startX; x <= maxX; x++) {
|
746 |
+
if (grid[y][x])
|
747 |
+
dom.addClass(grid[y][x].elm, 'mceSelected');
|
748 |
+
}
|
749 |
+
}
|
750 |
+
}
|
751 |
+
};
|
752 |
+
|
753 |
+
// Expose to public
|
754 |
+
tinymce.extend(this, {
|
755 |
+
deleteTable : deleteTable,
|
756 |
+
split : split,
|
757 |
+
merge : merge,
|
758 |
+
insertRow : insertRow,
|
759 |
+
insertCol : insertCol,
|
760 |
+
deleteCols : deleteCols,
|
761 |
+
deleteRows : deleteRows,
|
762 |
+
cutRows : cutRows,
|
763 |
+
copyRows : copyRows,
|
764 |
+
pasteRows : pasteRows,
|
765 |
+
getPos : getPos,
|
766 |
+
setStartCell : setStartCell,
|
767 |
+
setEndCell : setEndCell
|
768 |
+
});
|
769 |
+
};
|
770 |
+
|
771 |
+
tinymce.create('tinymce.plugins.TablePlugin', {
|
772 |
+
init : function(ed, url) {
|
773 |
+
var winMan, clipboardRows, hasCellSelection = true; // Might be selected cells on reload
|
774 |
+
|
775 |
+
function createTableGrid(node) {
|
776 |
+
var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table');
|
777 |
+
|
778 |
+
if (tblElm)
|
779 |
+
return new TableGrid(tblElm, ed.dom, selection);
|
780 |
+
};
|
781 |
+
|
782 |
+
function cleanup() {
|
783 |
+
// Restore selection possibilities
|
784 |
+
ed.getBody().style.webkitUserSelect = '';
|
785 |
+
|
786 |
+
if (hasCellSelection) {
|
787 |
+
ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
|
788 |
+
hasCellSelection = false;
|
789 |
+
}
|
790 |
+
};
|
791 |
+
|
792 |
+
// Register buttons
|
793 |
+
each([
|
794 |
+
['table', 'table.desc', 'mceInsertTable', true],
|
795 |
+
['delete_table', 'table.del', 'mceTableDelete'],
|
796 |
+
['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'],
|
797 |
+
['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'],
|
798 |
+
['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'],
|
799 |
+
['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'],
|
800 |
+
['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'],
|
801 |
+
['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'],
|
802 |
+
['row_props', 'table.row_desc', 'mceTableRowProps', true],
|
803 |
+
['cell_props', 'table.cell_desc', 'mceTableCellProps', true],
|
804 |
+
['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true],
|
805 |
+
['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true]
|
806 |
+
], function(c) {
|
807 |
+
ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]});
|
808 |
+
});
|
809 |
+
|
810 |
+
// Select whole table is a table border is clicked
|
811 |
+
if (!tinymce.isIE) {
|
812 |
+
ed.onClick.add(function(ed, e) {
|
813 |
+
e = e.target;
|
814 |
+
|
815 |
+
if (e.nodeName === 'TABLE') {
|
816 |
+
ed.selection.select(e);
|
817 |
+
ed.nodeChanged();
|
818 |
+
}
|
819 |
+
});
|
820 |
+
}
|
821 |
+
|
822 |
+
ed.onPreProcess.add(function(ed, args) {
|
823 |
+
var nodes, i, node, dom = ed.dom, value;
|
824 |
+
|
825 |
+
nodes = dom.select('table', args.node);
|
826 |
+
i = nodes.length;
|
827 |
+
while (i--) {
|
828 |
+
node = nodes[i];
|
829 |
+
dom.setAttrib(node, 'data-mce-style', '');
|
830 |
+
|
831 |
+
if ((value = dom.getAttrib(node, 'width'))) {
|
832 |
+
dom.setStyle(node, 'width', value);
|
833 |
+
dom.setAttrib(node, 'width', '');
|
834 |
+
}
|
835 |
+
|
836 |
+
if ((value = dom.getAttrib(node, 'height'))) {
|
837 |
+
dom.setStyle(node, 'height', value);
|
838 |
+
dom.setAttrib(node, 'height', '');
|
839 |
+
}
|
840 |
+
}
|
841 |
+
});
|
842 |
+
|
843 |
+
// Handle node change updates
|
844 |
+
ed.onNodeChange.add(function(ed, cm, n) {
|
845 |
+
var p;
|
846 |
+
|
847 |
+
n = ed.selection.getStart();
|
848 |
+
p = ed.dom.getParent(n, 'td,th,caption');
|
849 |
+
cm.setActive('table', n.nodeName === 'TABLE' || !!p);
|
850 |
+
|
851 |
+
// Disable table tools if we are in caption
|
852 |
+
if (p && p.nodeName === 'CAPTION')
|
853 |
+
p = 0;
|
854 |
+
|
855 |
+
cm.setDisabled('delete_table', !p);
|
856 |
+
cm.setDisabled('delete_col', !p);
|
857 |
+
cm.setDisabled('delete_table', !p);
|
858 |
+
cm.setDisabled('delete_row', !p);
|
859 |
+
cm.setDisabled('col_after', !p);
|
860 |
+
cm.setDisabled('col_before', !p);
|
861 |
+
cm.setDisabled('row_after', !p);
|
862 |
+
cm.setDisabled('row_before', !p);
|
863 |
+
cm.setDisabled('row_props', !p);
|
864 |
+
cm.setDisabled('cell_props', !p);
|
865 |
+
cm.setDisabled('split_cells', !p);
|
866 |
+
cm.setDisabled('merge_cells', !p);
|
867 |
+
});
|
868 |
+
|
869 |
+
ed.onInit.add(function(ed) {
|
870 |
+
var startTable, startCell, dom = ed.dom, tableGrid;
|
871 |
+
|
872 |
+
winMan = ed.windowManager;
|
873 |
+
|
874 |
+
// Add cell selection logic
|
875 |
+
ed.onMouseDown.add(function(ed, e) {
|
876 |
+
if (e.button != 2) {
|
877 |
+
cleanup();
|
878 |
+
|
879 |
+
startCell = dom.getParent(e.target, 'td,th');
|
880 |
+
startTable = dom.getParent(startCell, 'table');
|
881 |
+
}
|
882 |
+
});
|
883 |
+
|
884 |
+
dom.bind(ed.getDoc(), 'mouseover', function(e) {
|
885 |
+
var sel, table, target = e.target;
|
886 |
+
|
887 |
+
if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) {
|
888 |
+
table = dom.getParent(target, 'table');
|
889 |
+
if (table == startTable) {
|
890 |
+
if (!tableGrid) {
|
891 |
+
tableGrid = createTableGrid(table);
|
892 |
+
tableGrid.setStartCell(startCell);
|
893 |
+
|
894 |
+
ed.getBody().style.webkitUserSelect = 'none';
|
895 |
+
}
|
896 |
+
|
897 |
+
tableGrid.setEndCell(target);
|
898 |
+
hasCellSelection = true;
|
899 |
+
}
|
900 |
+
|
901 |
+
// Remove current selection
|
902 |
+
sel = ed.selection.getSel();
|
903 |
+
|
904 |
+
try {
|
905 |
+
if (sel.removeAllRanges)
|
906 |
+
sel.removeAllRanges();
|
907 |
+
else
|
908 |
+
sel.empty();
|
909 |
+
} catch (ex) {
|
910 |
+
// IE9 might throw errors here
|
911 |
+
}
|
912 |
+
|
913 |
+
e.preventDefault();
|
914 |
+
}
|
915 |
+
});
|
916 |
+
|
917 |
+
ed.onMouseUp.add(function(ed, e) {
|
918 |
+
var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode;
|
919 |
+
|
920 |
+
// Move selection to startCell
|
921 |
+
if (startCell) {
|
922 |
+
if (tableGrid)
|
923 |
+
ed.getBody().style.webkitUserSelect = '';
|
924 |
+
|
925 |
+
function setPoint(node, start) {
|
926 |
+
var walker = new tinymce.dom.TreeWalker(node, node);
|
927 |
+
|
928 |
+
do {
|
929 |
+
// Text node
|
930 |
+
if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) {
|
931 |
+
if (start)
|
932 |
+
rng.setStart(node, 0);
|
933 |
+
else
|
934 |
+
rng.setEnd(node, node.nodeValue.length);
|
935 |
+
|
936 |
+
return;
|
937 |
+
}
|
938 |
+
|
939 |
+
// BR element
|
940 |
+
if (node.nodeName == 'BR') {
|
941 |
+
if (start)
|
942 |
+
rng.setStartBefore(node);
|
943 |
+
else
|
944 |
+
rng.setEndBefore(node);
|
945 |
+
|
946 |
+
return;
|
947 |
+
}
|
948 |
+
} while (node = (start ? walker.next() : walker.prev()));
|
949 |
+
}
|
950 |
+
|
951 |
+
// Try to expand text selection as much as we can only Gecko supports cell selection
|
952 |
+
selectedCells = dom.select('td.mceSelected,th.mceSelected');
|
953 |
+
if (selectedCells.length > 0) {
|
954 |
+
rng = dom.createRng();
|
955 |
+
node = selectedCells[0];
|
956 |
+
endNode = selectedCells[selectedCells.length - 1];
|
957 |
+
rng.setStartBefore(node);
|
958 |
+
rng.setEndAfter(node);
|
959 |
+
|
960 |
+
setPoint(node, 1);
|
961 |
+
walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table'));
|
962 |
+
|
963 |
+
do {
|
964 |
+
if (node.nodeName == 'TD' || node.nodeName == 'TH') {
|
965 |
+
if (!dom.hasClass(node, 'mceSelected'))
|
966 |
+
break;
|
967 |
+
|
968 |
+
lastNode = node;
|
969 |
+
}
|
970 |
+
} while (node = walker.next());
|
971 |
+
|
972 |
+
setPoint(lastNode);
|
973 |
+
|
974 |
+
sel.setRng(rng);
|
975 |
+
}
|
976 |
+
|
977 |
+
ed.nodeChanged();
|
978 |
+
startCell = tableGrid = startTable = null;
|
979 |
+
}
|
980 |
+
});
|
981 |
+
|
982 |
+
ed.onKeyUp.add(function(ed, e) {
|
983 |
+
cleanup();
|
984 |
+
});
|
985 |
+
|
986 |
+
ed.onKeyDown.add(function (ed, e) {
|
987 |
+
fixTableCellSelection(ed);
|
988 |
+
});
|
989 |
+
|
990 |
+
ed.onMouseDown.add(function (ed, e) {
|
991 |
+
if (e.button != 2) {
|
992 |
+
fixTableCellSelection(ed);
|
993 |
+
}
|
994 |
+
});
|
995 |
+
function tableCellSelected(ed, rng, n, currentCell) {
|
996 |
+
// The decision of when a table cell is selected is somewhat involved. The fact that this code is
|
997 |
+
// required is actually a pointer to the root cause of this bug. A cell is selected when the start
|
998 |
+
// and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases)
|
999 |
+
// or the parent of the table (in the case of the selection containing the last cell of a table).
|
1000 |
+
var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'),
|
1001 |
+
tableParent, allOfCellSelected, tableCellSelection;
|
1002 |
+
if (table)
|
1003 |
+
tableParent = table.parentNode;
|
1004 |
+
allOfCellSelected =rng.startContainer.nodeType == TEXT_NODE &&
|
1005 |
+
rng.startOffset == 0 &&
|
1006 |
+
rng.endOffset == 0 &&
|
1007 |
+
currentCell &&
|
1008 |
+
(n.nodeName=="TR" || n==tableParent);
|
1009 |
+
tableCellSelection = (n.nodeName=="TD"||n.nodeName=="TH")&& !currentCell;
|
1010 |
+
return allOfCellSelected || tableCellSelection;
|
1011 |
+
// return false;
|
1012 |
+
}
|
1013 |
+
|
1014 |
+
// this nasty hack is here to work around some WebKit selection bugs.
|
1015 |
+
function fixTableCellSelection(ed) {
|
1016 |
+
if (!tinymce.isWebKit)
|
1017 |
+
return;
|
1018 |
+
|
1019 |
+
var rng = ed.selection.getRng();
|
1020 |
+
var n = ed.selection.getNode();
|
1021 |
+
var currentCell = ed.dom.getParent(rng.startContainer, 'TD,TH');
|
1022 |
+
|
1023 |
+
if (!tableCellSelected(ed, rng, n, currentCell))
|
1024 |
+
return;
|
1025 |
+
if (!currentCell) {
|
1026 |
+
currentCell=n;
|
1027 |
+
}
|
1028 |
+
|
1029 |
+
// Get the very last node inside the table cell
|
1030 |
+
var end = currentCell.lastChild;
|
1031 |
+
while (end.lastChild)
|
1032 |
+
end = end.lastChild;
|
1033 |
+
|
1034 |
+
// Select the entire table cell. Nothing outside of the table cell should be selected.
|
1035 |
+
rng.setEnd(end, end.nodeValue.length);
|
1036 |
+
ed.selection.setRng(rng);
|
1037 |
+
}
|
1038 |
+
ed.plugins.table.fixTableCellSelection=fixTableCellSelection;
|
1039 |
+
|
1040 |
+
// Add context menu
|
1041 |
+
if (ed && ed.plugins.contextmenu) {
|
1042 |
+
ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) {
|
1043 |
+
var sm, se = ed.selection, el = se.getNode() || ed.getBody();
|
1044 |
+
|
1045 |
+
if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) {
|
1046 |
+
m.removeAll();
|
1047 |
+
|
1048 |
+
if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) {
|
1049 |
+
m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});
|
1050 |
+
m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});
|
1051 |
+
m.addSeparator();
|
1052 |
+
}
|
1053 |
+
|
1054 |
+
if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) {
|
1055 |
+
m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
|
1056 |
+
m.addSeparator();
|
1057 |
+
}
|
1058 |
+
|
1059 |
+
m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}});
|
1060 |
+
m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'});
|
1061 |
+
m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'});
|
1062 |
+
m.addSeparator();
|
1063 |
+
|
1064 |
+
// Cell menu
|
1065 |
+
sm = m.addMenu({title : 'table.cell'});
|
1066 |
+
sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'});
|
1067 |
+
sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'});
|
1068 |
+
sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'});
|
1069 |
+
|
1070 |
+
// Row menu
|
1071 |
+
sm = m.addMenu({title : 'table.row'});
|
1072 |
+
sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'});
|
1073 |
+
sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'});
|
1074 |
+
sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'});
|
1075 |
+
sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'});
|
1076 |
+
sm.addSeparator();
|
1077 |
+
sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'});
|
1078 |
+
sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'});
|
1079 |
+
sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows);
|
1080 |
+
sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows);
|
1081 |
+
|
1082 |
+
// Column menu
|
1083 |
+
sm = m.addMenu({title : 'table.col'});
|
1084 |
+
sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'});
|
1085 |
+
sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'});
|
1086 |
+
sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'});
|
1087 |
+
} else
|
1088 |
+
m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'});
|
1089 |
+
});
|
1090 |
+
}
|
1091 |
+
|
1092 |
+
// Fix to allow navigating up and down in a table in WebKit browsers.
|
1093 |
+
if (tinymce.isWebKit) {
|
1094 |
+
function moveSelection(ed, e) {
|
1095 |
+
var VK = tinymce.VK;
|
1096 |
+
var key = e.keyCode;
|
1097 |
+
|
1098 |
+
function handle(upBool, sourceNode, event) {
|
1099 |
+
var siblingDirection = upBool ? 'previousSibling' : 'nextSibling';
|
1100 |
+
var currentRow = ed.dom.getParent(sourceNode, 'tr');
|
1101 |
+
var siblingRow = currentRow[siblingDirection];
|
1102 |
+
|
1103 |
+
if (siblingRow) {
|
1104 |
+
moveCursorToRow(ed, sourceNode, siblingRow, upBool);
|
1105 |
+
tinymce.dom.Event.cancel(event);
|
1106 |
+
return true;
|
1107 |
+
} else {
|
1108 |
+
var tableNode = ed.dom.getParent(currentRow, 'table');
|
1109 |
+
var middleNode = currentRow.parentNode;
|
1110 |
+
var parentNodeName = middleNode.nodeName.toLowerCase();
|
1111 |
+
if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) {
|
1112 |
+
var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody');
|
1113 |
+
if (targetParent !== null) {
|
1114 |
+
return moveToRowInTarget(upBool, targetParent, sourceNode, event);
|
1115 |
+
}
|
1116 |
+
}
|
1117 |
+
return escapeTable(upBool, currentRow, siblingDirection, tableNode, event);
|
1118 |
+
}
|
1119 |
+
}
|
1120 |
+
|
1121 |
+
function getTargetParent(upBool, topNode, secondNode, nodeName) {
|
1122 |
+
var tbodies = ed.dom.select('>' + nodeName, topNode);
|
1123 |
+
var position = tbodies.indexOf(secondNode);
|
1124 |
+
if (upBool && position === 0 || !upBool && position === tbodies.length - 1) {
|
1125 |
+
return getFirstHeadOrFoot(upBool, topNode);
|
1126 |
+
} else if (position === -1) {
|
1127 |
+
var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1;
|
1128 |
+
return tbodies[topOrBottom];
|
1129 |
+
} else {
|
1130 |
+
return tbodies[position + (upBool ? -1 : 1)];
|
1131 |
+
}
|
1132 |
+
}
|
1133 |
+
|
1134 |
+
function getFirstHeadOrFoot(upBool, parent) {
|
1135 |
+
var tagName = upBool ? 'thead' : 'tfoot';
|
1136 |
+
var headOrFoot = ed.dom.select('>' + tagName, parent);
|
1137 |
+
return headOrFoot.length !== 0 ? headOrFoot[0] : null;
|
1138 |
+
}
|
1139 |
+
|
1140 |
+
function moveToRowInTarget(upBool, targetParent, sourceNode, event) {
|
1141 |
+
var targetRow = getChildForDirection(targetParent, upBool);
|
1142 |
+
targetRow && moveCursorToRow(ed, sourceNode, targetRow, upBool);
|
1143 |
+
tinymce.dom.Event.cancel(event);
|
1144 |
+
return true;
|
1145 |
+
}
|
1146 |
+
|
1147 |
+
function escapeTable(upBool, currentRow, siblingDirection, table, event) {
|
1148 |
+
var tableSibling = table[siblingDirection];
|
1149 |
+
if (tableSibling) {
|
1150 |
+
moveCursorToStartOfElement(tableSibling);
|
1151 |
+
return true;
|
1152 |
+
} else {
|
1153 |
+
var parentCell = ed.dom.getParent(table, 'td,th');
|
1154 |
+
if (parentCell) {
|
1155 |
+
return handle(upBool, parentCell, event);
|
1156 |
+
} else {
|
1157 |
+
var backUpSibling = getChildForDirection(currentRow, !upBool);
|
1158 |
+
moveCursorToStartOfElement(backUpSibling);
|
1159 |
+
return tinymce.dom.Event.cancel(event);
|
1160 |
+
}
|
1161 |
+
}
|
1162 |
+
}
|
1163 |
+
|
1164 |
+
function getChildForDirection(parent, up) {
|
1165 |
+
var child = parent && parent[up ? 'lastChild' : 'firstChild'];
|
1166 |
+
// BR is not a valid table child to return in this case we return the table cell
|
1167 |
+
return child && child.nodeName === 'BR' ? ed.dom.getParent(child, 'td,th') : child;
|
1168 |
+
}
|
1169 |
+
|
1170 |
+
function moveCursorToStartOfElement(n) {
|
1171 |
+
ed.selection.setCursorLocation(n, 0);
|
1172 |
+
}
|
1173 |
+
|
1174 |
+
function isVerticalMovement() {
|
1175 |
+
return key == VK.UP || key == VK.DOWN;
|
1176 |
+
}
|
1177 |
+
|
1178 |
+
function isInTable(ed) {
|
1179 |
+
var node = ed.selection.getNode();
|
1180 |
+
var currentRow = ed.dom.getParent(node, 'tr');
|
1181 |
+
return currentRow !== null;
|
1182 |
+
}
|
1183 |
+
|
1184 |
+
function columnIndex(column) {
|
1185 |
+
var colIndex = 0;
|
1186 |
+
var c = column;
|
1187 |
+
while (c.previousSibling) {
|
1188 |
+
c = c.previousSibling;
|
1189 |
+
colIndex = colIndex + getSpanVal(c, "colspan");
|
1190 |
+
}
|
1191 |
+
return colIndex;
|
1192 |
+
}
|
1193 |
+
|
1194 |
+
function findColumn(rowElement, columnIndex) {
|
1195 |
+
var c = 0;
|
1196 |
+
var r = 0;
|
1197 |
+
each(rowElement.children, function(cell, i) {
|
1198 |
+
c = c + getSpanVal(cell, "colspan");
|
1199 |
+
r = i;
|
1200 |
+
if (c > columnIndex)
|
1201 |
+
return false;
|
1202 |
+
});
|
1203 |
+
return r;
|
1204 |
+
}
|
1205 |
+
|
1206 |
+
function moveCursorToRow(ed, node, row, upBool) {
|
1207 |
+
var srcColumnIndex = columnIndex(ed.dom.getParent(node, 'td,th'));
|
1208 |
+
var tgtColumnIndex = findColumn(row, srcColumnIndex);
|
1209 |
+
var tgtNode = row.childNodes[tgtColumnIndex];
|
1210 |
+
var rowCellTarget = getChildForDirection(tgtNode, upBool);
|
1211 |
+
moveCursorToStartOfElement(rowCellTarget || tgtNode);
|
1212 |
+
}
|
1213 |
+
|
1214 |
+
function shouldFixCaret(preBrowserNode) {
|
1215 |
+
var newNode = ed.selection.getNode();
|
1216 |
+
var newParent = ed.dom.getParent(newNode, 'td,th');
|
1217 |
+
var oldParent = ed.dom.getParent(preBrowserNode, 'td,th');
|
1218 |
+
return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent)
|
1219 |
+
}
|
1220 |
+
|
1221 |
+
function checkSameParentTable(nodeOne, NodeTwo) {
|
1222 |
+
return ed.dom.getParent(nodeOne, 'TABLE') === ed.dom.getParent(NodeTwo, 'TABLE');
|
1223 |
+
}
|
1224 |
+
|
1225 |
+
if (isVerticalMovement() && isInTable(ed)) {
|
1226 |
+
var preBrowserNode = ed.selection.getNode();
|
1227 |
+
setTimeout(function() {
|
1228 |
+
if (shouldFixCaret(preBrowserNode)) {
|
1229 |
+
handle(!e.shiftKey && key === VK.UP, preBrowserNode, e);
|
1230 |
+
}
|
1231 |
+
}, 0);
|
1232 |
+
}
|
1233 |
+
}
|
1234 |
+
|
1235 |
+
ed.onKeyDown.add(moveSelection);
|
1236 |
+
}
|
1237 |
+
|
1238 |
+
// Fixes an issue on Gecko where it's impossible to place the caret behind a table
|
1239 |
+
// This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled
|
1240 |
+
function fixTableCaretPos() {
|
1241 |
+
var last;
|
1242 |
+
|
1243 |
+
// Skip empty text nodes form the end
|
1244 |
+
for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;
|
1245 |
+
|
1246 |
+
if (last && last.nodeName == 'TABLE') {
|
1247 |
+
if (ed.settings.forced_root_block)
|
1248 |
+
ed.dom.add(ed.getBody(), ed.settings.forced_root_block, null, tinymce.isIE ? ' ' : '<br data-mce-bogus="1" />');
|
1249 |
+
else
|
1250 |
+
ed.dom.add(ed.getBody(), 'br', {'data-mce-bogus': '1'});
|
1251 |
+
}
|
1252 |
+
};
|
1253 |
+
|
1254 |
+
// Fixes an bug where it's impossible to place the caret before a table in Gecko
|
1255 |
+
// this fix solves it by detecting when the caret is at the beginning of such a table
|
1256 |
+
// and then manually moves the caret infront of the table
|
1257 |
+
if (tinymce.isGecko) {
|
1258 |
+
ed.onKeyDown.add(function(ed, e) {
|
1259 |
+
var rng, table, dom = ed.dom;
|
1260 |
+
|
1261 |
+
// On gecko it's not possible to place the caret before a table
|
1262 |
+
if (e.keyCode == 37 || e.keyCode == 38) {
|
1263 |
+
rng = ed.selection.getRng();
|
1264 |
+
table = dom.getParent(rng.startContainer, 'table');
|
1265 |
+
|
1266 |
+
if (table && ed.getBody().firstChild == table) {
|
1267 |
+
if (isAtStart(rng, table)) {
|
1268 |
+
rng = dom.createRng();
|
1269 |
+
|
1270 |
+
rng.setStartBefore(table);
|
1271 |
+
rng.setEndBefore(table);
|
1272 |
+
|
1273 |
+
ed.selection.setRng(rng);
|
1274 |
+
|
1275 |
+
e.preventDefault();
|
1276 |
+
}
|
1277 |
+
}
|
1278 |
+
}
|
1279 |
+
});
|
1280 |
+
}
|
1281 |
+
|
1282 |
+
ed.onKeyUp.add(fixTableCaretPos);
|
1283 |
+
ed.onSetContent.add(fixTableCaretPos);
|
1284 |
+
ed.onVisualAid.add(fixTableCaretPos);
|
1285 |
+
|
1286 |
+
ed.onPreProcess.add(function(ed, o) {
|
1287 |
+
var last = o.node.lastChild;
|
1288 |
+
|
1289 |
+
if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 && (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) && last.previousSibling && last.previousSibling.nodeName == "TABLE") {
|
1290 |
+
ed.dom.remove(last);
|
1291 |
+
}
|
1292 |
+
});
|
1293 |
+
|
1294 |
+
|
1295 |
+
/**
|
1296 |
+
* Fixes bug in Gecko where shift-enter in table cell does not place caret on new line
|
1297 |
+
*
|
1298 |
+
* Removed: Since the new enter logic seems to fix this one.
|
1299 |
+
*/
|
1300 |
+
/*
|
1301 |
+
if (tinymce.isGecko) {
|
1302 |
+
ed.onKeyDown.add(function(ed, e) {
|
1303 |
+
if (e.keyCode === tinymce.VK.ENTER && e.shiftKey) {
|
1304 |
+
var node = ed.selection.getRng().startContainer;
|
1305 |
+
var tableCell = dom.getParent(node, 'td,th');
|
1306 |
+
if (tableCell) {
|
1307 |
+
var zeroSizedNbsp = ed.getDoc().createTextNode("\uFEFF");
|
1308 |
+
dom.insertAfter(zeroSizedNbsp, node);
|
1309 |
+
}
|
1310 |
+
}
|
1311 |
+
});
|
1312 |
+
}
|
1313 |
+
*/
|
1314 |
+
|
1315 |
+
fixTableCaretPos();
|
1316 |
+
ed.startContent = ed.getContent({format : 'raw'});
|
1317 |
+
});
|
1318 |
+
|
1319 |
+
// Register action commands
|
1320 |
+
each({
|
1321 |
+
mceTableSplitCells : function(grid) {
|
1322 |
+
grid.split();
|
1323 |
+
},
|
1324 |
+
|
1325 |
+
mceTableMergeCells : function(grid) {
|
1326 |
+
var rowSpan, colSpan, cell;
|
1327 |
+
|
1328 |
+
cell = ed.dom.getParent(ed.selection.getNode(), 'th,td');
|
1329 |
+
if (cell) {
|
1330 |
+
rowSpan = cell.rowSpan;
|
1331 |
+
colSpan = cell.colSpan;
|
1332 |
+
}
|
1333 |
+
|
1334 |
+
if (!ed.dom.select('td.mceSelected,th.mceSelected').length) {
|
1335 |
+
winMan.open({
|
1336 |
+
url : url + '/merge_cells.htm',
|
1337 |
+
width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)),
|
1338 |
+
height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)),
|
1339 |
+
inline : 1
|
1340 |
+
}, {
|
1341 |
+
rows : rowSpan,
|
1342 |
+
cols : colSpan,
|
1343 |
+
onaction : function(data) {
|
1344 |
+
grid.merge(cell, data.cols, data.rows);
|
1345 |
+
},
|
1346 |
+
plugin_url : url
|
1347 |
+
});
|
1348 |
+
} else
|
1349 |
+
grid.merge();
|
1350 |
+
},
|
1351 |
+
|
1352 |
+
mceTableInsertRowBefore : function(grid) {
|
1353 |
+
grid.insertRow(true);
|
1354 |
+
},
|
1355 |
+
|
1356 |
+
mceTableInsertRowAfter : function(grid) {
|
1357 |
+
grid.insertRow();
|
1358 |
+
},
|
1359 |
+
|
1360 |
+
mceTableInsertColBefore : function(grid) {
|
1361 |
+
grid.insertCol(true);
|
1362 |
+
},
|
1363 |
+
|
1364 |
+
mceTableInsertColAfter : function(grid) {
|
1365 |
+
grid.insertCol();
|
1366 |
+
},
|
1367 |
+
|
1368 |
+
mceTableDeleteCol : function(grid) {
|
1369 |
+
grid.deleteCols();
|
1370 |
+
},
|
1371 |
+
|
1372 |
+
mceTableDeleteRow : function(grid) {
|
1373 |
+
grid.deleteRows();
|
1374 |
+
},
|
1375 |
+
|
1376 |
+
mceTableCutRow : function(grid) {
|
1377 |
+
clipboardRows = grid.cutRows();
|
1378 |
+
},
|
1379 |
+
|
1380 |
+
mceTableCopyRow : function(grid) {
|
1381 |
+
clipboardRows = grid.copyRows();
|
1382 |
+
},
|
1383 |
+
|
1384 |
+
mceTablePasteRowBefore : function(grid) {
|
1385 |
+
grid.pasteRows(clipboardRows, true);
|
1386 |
+
},
|
1387 |
+
|
1388 |
+
mceTablePasteRowAfter : function(grid) {
|
1389 |
+
grid.pasteRows(clipboardRows);
|
1390 |
+
},
|
1391 |
+
|
1392 |
+
mceTableDelete : function(grid) {
|
1393 |
+
grid.deleteTable();
|
1394 |
+
}
|
1395 |
+
}, function(func, name) {
|
1396 |
+
ed.addCommand(name, function() {
|
1397 |
+
var grid = createTableGrid();
|
1398 |
+
|
1399 |
+
if (grid) {
|
1400 |
+
func(grid);
|
1401 |
+
ed.execCommand('mceRepaint');
|
1402 |
+
cleanup();
|
1403 |
+
}
|
1404 |
+
});
|
1405 |
+
});
|
1406 |
+
|
1407 |
+
// Register dialog commands
|
1408 |
+
each({
|
1409 |
+
mceInsertTable : function(val) {
|
1410 |
+
winMan.open({
|
1411 |
+
url : url + '/table.htm',
|
1412 |
+
width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)),
|
1413 |
+
height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)),
|
1414 |
+
inline : 1
|
1415 |
+
}, {
|
1416 |
+
plugin_url : url,
|
1417 |
+
action : val ? val.action : 0
|
1418 |
+
});
|
1419 |
+
},
|
1420 |
+
|
1421 |
+
mceTableRowProps : function() {
|
1422 |
+
winMan.open({
|
1423 |
+
url : url + '/row.htm',
|
1424 |
+
width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)),
|
1425 |
+
height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)),
|
1426 |
+
inline : 1
|
1427 |
+
}, {
|
1428 |
+
plugin_url : url
|
1429 |
+
});
|
1430 |
+
},
|
1431 |
+
|
1432 |
+
mceTableCellProps : function() {
|
1433 |
+
winMan.open({
|
1434 |
+
url : url + '/cell.htm',
|
1435 |
+
width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)),
|
1436 |
+
height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)),
|
1437 |
+
inline : 1
|
1438 |
+
}, {
|
1439 |
+
plugin_url : url
|
1440 |
+
});
|
1441 |
+
}
|
1442 |
+
}, function(func, name) {
|
1443 |
+
ed.addCommand(name, function(ui, val) {
|
1444 |
+
func(val);
|
1445 |
+
});
|
1446 |
+
});
|
1447 |
+
}
|
1448 |
+
});
|
1449 |
+
|
1450 |
+
// Register plugin
|
1451 |
+
tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin);
|
1452 |
+
})(tinymce);
|
js/libraries/tiny_mce/themes/advanced/js/color_picker.js
CHANGED
@@ -1,345 +1,345 @@
|
|
1 |
-
tinyMCEPopup.requireLangPack();
|
2 |
-
|
3 |
-
var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;
|
4 |
-
|
5 |
-
var colors = [
|
6 |
-
"#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
|
7 |
-
"#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
|
8 |
-
"#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
|
9 |
-
"#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
|
10 |
-
"#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
|
11 |
-
"#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
|
12 |
-
"#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
|
13 |
-
"#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
|
14 |
-
"#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
|
15 |
-
"#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
|
16 |
-
"#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
|
17 |
-
"#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
|
18 |
-
"#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
|
19 |
-
"#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
|
20 |
-
"#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
|
21 |
-
"#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
|
22 |
-
"#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
|
23 |
-
"#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
|
24 |
-
"#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
|
25 |
-
"#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
|
26 |
-
"#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
|
27 |
-
"#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
|
28 |
-
"#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
|
29 |
-
"#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
|
30 |
-
"#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
|
31 |
-
"#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
|
32 |
-
"#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
|
33 |
-
];
|
34 |
-
|
35 |
-
var named = {
|
36 |
-
'#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',
|
37 |
-
'#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown',
|
38 |
-
'#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue',
|
39 |
-
'#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod',
|
40 |
-
'#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green',
|
41 |
-
'#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue',
|
42 |
-
'#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue',
|
43 |
-
'#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green',
|
44 |
-
'#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey',
|
45 |
-
'#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory',
|
46 |
-
'#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue',
|
47 |
-
'#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green',
|
48 |
-
'#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey',
|
49 |
-
'#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',
|
50 |
-
'#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue',
|
51 |
-
'#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin',
|
52 |
-
'#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid',
|
53 |
-
'#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff',
|
54 |
-
'#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue',
|
55 |
-
'#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver',
|
56 |
-
'#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green',
|
57 |
-
'#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',
|
58 |
-
'#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green'
|
59 |
-
};
|
60 |
-
|
61 |
-
var namedLookup = {};
|
62 |
-
|
63 |
-
function init() {
|
64 |
-
var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value;
|
65 |
-
|
66 |
-
tinyMCEPopup.resizeToInnerSize();
|
67 |
-
|
68 |
-
generatePicker();
|
69 |
-
generateWebColors();
|
70 |
-
generateNamedColors();
|
71 |
-
|
72 |
-
if (inputColor) {
|
73 |
-
changeFinalColor(inputColor);
|
74 |
-
|
75 |
-
col = convertHexToRGB(inputColor);
|
76 |
-
|
77 |
-
if (col)
|
78 |
-
updateLight(col.r, col.g, col.b);
|
79 |
-
}
|
80 |
-
|
81 |
-
for (key in named) {
|
82 |
-
value = named[key];
|
83 |
-
namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase();
|
84 |
-
}
|
85 |
-
}
|
86 |
-
|
87 |
-
function toHexColor(color) {
|
88 |
-
var matches, red, green, blue, toInt = parseInt;
|
89 |
-
|
90 |
-
function hex(value) {
|
91 |
-
value = parseInt(value).toString(16);
|
92 |
-
|
93 |
-
return value.length > 1 ? value : '0' + value; // Padd with leading zero
|
94 |
-
};
|
95 |
-
|
96 |
-
color = tinymce.trim(color);
|
97 |
-
color = color.replace(/^[#]/, '').toLowerCase(); // remove leading '#'
|
98 |
-
color = namedLookup[color] || color;
|
99 |
-
|
100 |
-
matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/.exec(color);
|
101 |
-
|
102 |
-
if (matches) {
|
103 |
-
red = toInt(matches[1]);
|
104 |
-
green = toInt(matches[2]);
|
105 |
-
blue = toInt(matches[3]);
|
106 |
-
} else {
|
107 |
-
matches = /^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color);
|
108 |
-
|
109 |
-
if (matches) {
|
110 |
-
red = toInt(matches[1], 16);
|
111 |
-
green = toInt(matches[2], 16);
|
112 |
-
blue = toInt(matches[3], 16);
|
113 |
-
} else {
|
114 |
-
matches = /^([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color);
|
115 |
-
|
116 |
-
if (matches) {
|
117 |
-
red = toInt(matches[1] + matches[1], 16);
|
118 |
-
green = toInt(matches[2] + matches[2], 16);
|
119 |
-
blue = toInt(matches[3] + matches[3], 16);
|
120 |
-
} else {
|
121 |
-
return '';
|
122 |
-
}
|
123 |
-
}
|
124 |
-
}
|
125 |
-
|
126 |
-
return '#' + hex(red) + hex(green) + hex(blue);
|
127 |
-
}
|
128 |
-
|
129 |
-
function insertAction() {
|
130 |
-
var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func');
|
131 |
-
|
132 |
-
var hexColor = toHexColor(color);
|
133 |
-
|
134 |
-
if (hexColor === '') {
|
135 |
-
var text = tinyMCEPopup.editor.getLang('advanced_dlg.invalid_color_value');
|
136 |
-
tinyMCEPopup.alert(text + ': ' + color);
|
137 |
-
}
|
138 |
-
else {
|
139 |
-
tinyMCEPopup.restoreSelection();
|
140 |
-
|
141 |
-
if (f)
|
142 |
-
f(hexColor);
|
143 |
-
|
144 |
-
tinyMCEPopup.close();
|
145 |
-
}
|
146 |
-
}
|
147 |
-
|
148 |
-
function showColor(color, name) {
|
149 |
-
if (name)
|
150 |
-
document.getElementById("colorname").innerHTML = name;
|
151 |
-
|
152 |
-
document.getElementById("preview").style.backgroundColor = color;
|
153 |
-
document.getElementById("color").value = color.toUpperCase();
|
154 |
-
}
|
155 |
-
|
156 |
-
function convertRGBToHex(col) {
|
157 |
-
var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
|
158 |
-
|
159 |
-
if (!col)
|
160 |
-
return col;
|
161 |
-
|
162 |
-
var rgb = col.replace(re, "$1,$2,$3").split(',');
|
163 |
-
if (rgb.length == 3) {
|
164 |
-
r = parseInt(rgb[0]).toString(16);
|
165 |
-
g = parseInt(rgb[1]).toString(16);
|
166 |
-
b = parseInt(rgb[2]).toString(16);
|
167 |
-
|
168 |
-
r = r.length == 1 ? '0' + r : r;
|
169 |
-
g = g.length == 1 ? '0' + g : g;
|
170 |
-
b = b.length == 1 ? '0' + b : b;
|
171 |
-
|
172 |
-
return "#" + r + g + b;
|
173 |
-
}
|
174 |
-
|
175 |
-
return col;
|
176 |
-
}
|
177 |
-
|
178 |
-
function convertHexToRGB(col) {
|
179 |
-
if (col.indexOf('#') != -1) {
|
180 |
-
col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
|
181 |
-
|
182 |
-
r = parseInt(col.substring(0, 2), 16);
|
183 |
-
g = parseInt(col.substring(2, 4), 16);
|
184 |
-
b = parseInt(col.substring(4, 6), 16);
|
185 |
-
|
186 |
-
return {r : r, g : g, b : b};
|
187 |
-
}
|
188 |
-
|
189 |
-
return null;
|
190 |
-
}
|
191 |
-
|
192 |
-
function generatePicker() {
|
193 |
-
var el = document.getElementById('light'), h = '', i;
|
194 |
-
|
195 |
-
for (i = 0; i < detail; i++){
|
196 |
-
h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'
|
197 |
-
+ ' onclick="changeFinalColor(this.style.backgroundColor)"'
|
198 |
-
+ ' onmousedown="isMouseDown = true; return false;"'
|
199 |
-
+ ' onmouseup="isMouseDown = false;"'
|
200 |
-
+ ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'
|
201 |
-
+ ' onmouseover="isMouseOver = true;"'
|
202 |
-
+ ' onmouseout="isMouseOver = false;"'
|
203 |
-
+ '></div>';
|
204 |
-
}
|
205 |
-
|
206 |
-
el.innerHTML = h;
|
207 |
-
}
|
208 |
-
|
209 |
-
function generateWebColors() {
|
210 |
-
var el = document.getElementById('webcolors'), h = '', i;
|
211 |
-
|
212 |
-
if (el.className == 'generated')
|
213 |
-
return;
|
214 |
-
|
215 |
-
// TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby.
|
216 |
-
h += '<div role="listbox" aria-labelledby="webcolors_title" tabindex="0"><table role="presentation" border="0" cellspacing="1" cellpadding="0">'
|
217 |
-
+ '<tr>';
|
218 |
-
|
219 |
-
for (i=0; i<colors.length; i++) {
|
220 |
-
h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'
|
221 |
-
+ '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="web_colors_' + i + '" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');" style="display:block;width:10px;height:10px;overflow:hidden;">';
|
222 |
-
if (tinyMCEPopup.editor.forcedHighContrastMode) {
|
223 |
-
h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
|
224 |
-
}
|
225 |
-
h += '<span class="mceVoiceLabel" style="display:none;" id="web_colors_' + i + '">' + colors[i].toUpperCase() + '</span>';
|
226 |
-
h += '</a></td>';
|
227 |
-
if ((i+1) % 18 == 0)
|
228 |
-
h += '</tr><tr>';
|
229 |
-
}
|
230 |
-
|
231 |
-
h += '</table></div>';
|
232 |
-
|
233 |
-
el.innerHTML = h;
|
234 |
-
el.className = 'generated';
|
235 |
-
|
236 |
-
paintCanvas(el);
|
237 |
-
enableKeyboardNavigation(el.firstChild);
|
238 |
-
}
|
239 |
-
|
240 |
-
function paintCanvas(el) {
|
241 |
-
tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) {
|
242 |
-
var context;
|
243 |
-
if (canvas.getContext && (context = canvas.getContext("2d"))) {
|
244 |
-
context.fillStyle = canvas.getAttribute('data-color');
|
245 |
-
context.fillRect(0, 0, 10, 10);
|
246 |
-
}
|
247 |
-
});
|
248 |
-
}
|
249 |
-
function generateNamedColors() {
|
250 |
-
var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
|
251 |
-
|
252 |
-
if (el.className == 'generated')
|
253 |
-
return;
|
254 |
-
|
255 |
-
for (n in named) {
|
256 |
-
v = named[n];
|
257 |
-
h += '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="named_colors_' + i + '" onfocus="showColor(\'' + n + '\',\'' + v + '\');" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '">';
|
258 |
-
if (tinyMCEPopup.editor.forcedHighContrastMode) {
|
259 |
-
h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
|
260 |
-
}
|
261 |
-
h += '<span class="mceVoiceLabel" style="display:none;" id="named_colors_' + i + '">' + v + '</span>';
|
262 |
-
h += '</a>';
|
263 |
-
i++;
|
264 |
-
}
|
265 |
-
|
266 |
-
el.innerHTML = h;
|
267 |
-
el.className = 'generated';
|
268 |
-
|
269 |
-
paintCanvas(el);
|
270 |
-
enableKeyboardNavigation(el);
|
271 |
-
}
|
272 |
-
|
273 |
-
function enableKeyboardNavigation(el) {
|
274 |
-
tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
|
275 |
-
root: el,
|
276 |
-
items: tinyMCEPopup.dom.select('a', el)
|
277 |
-
}, tinyMCEPopup.dom);
|
278 |
-
}
|
279 |
-
|
280 |
-
function dechex(n) {
|
281 |
-
return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);
|
282 |
-
}
|
283 |
-
|
284 |
-
function computeColor(e) {
|
285 |
-
var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target);
|
286 |
-
|
287 |
-
x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0);
|
288 |
-
y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0);
|
289 |
-
|
290 |
-
partWidth = document.getElementById('colors').width / 6;
|
291 |
-
partDetail = detail / 2;
|
292 |
-
imHeight = document.getElementById('colors').height;
|
293 |
-
|
294 |
-
r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;
|
295 |
-
g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);
|
296 |
-
b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);
|
297 |
-
|
298 |
-
coef = (imHeight - y) / imHeight;
|
299 |
-
r = 128 + (r - 128) * coef;
|
300 |
-
g = 128 + (g - 128) * coef;
|
301 |
-
b = 128 + (b - 128) * coef;
|
302 |
-
|
303 |
-
changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));
|
304 |
-
updateLight(r, g, b);
|
305 |
-
}
|
306 |
-
|
307 |
-
function updateLight(r, g, b) {
|
308 |
-
var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;
|
309 |
-
|
310 |
-
for (i=0; i<detail; i++) {
|
311 |
-
if ((i>=0) && (i<partDetail)) {
|
312 |
-
finalCoef = i / partDetail;
|
313 |
-
finalR = dechex(255 - (255 - r) * finalCoef);
|
314 |
-
finalG = dechex(255 - (255 - g) * finalCoef);
|
315 |
-
finalB = dechex(255 - (255 - b) * finalCoef);
|
316 |
-
} else {
|
317 |
-
finalCoef = 2 - i / partDetail;
|
318 |
-
finalR = dechex(r * finalCoef);
|
319 |
-
finalG = dechex(g * finalCoef);
|
320 |
-
finalB = dechex(b * finalCoef);
|
321 |
-
}
|
322 |
-
|
323 |
-
color = finalR + finalG + finalB;
|
324 |
-
|
325 |
-
setCol('gs' + i, '#'+color);
|
326 |
-
}
|
327 |
-
}
|
328 |
-
|
329 |
-
function changeFinalColor(color) {
|
330 |
-
if (color.indexOf('#') == -1)
|
331 |
-
color = convertRGBToHex(color);
|
332 |
-
|
333 |
-
setCol('preview', color);
|
334 |
-
document.getElementById('color').value = color;
|
335 |
-
}
|
336 |
-
|
337 |
-
function setCol(e, c) {
|
338 |
-
try {
|
339 |
-
document.getElementById(e).style.backgroundColor = c;
|
340 |
-
} catch (ex) {
|
341 |
-
// Ignore IE warning
|
342 |
-
}
|
343 |
-
}
|
344 |
-
|
345 |
-
tinyMCEPopup.onInit.add(init);
|
1 |
+
tinyMCEPopup.requireLangPack();
|
2 |
+
|
3 |
+
var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false;
|
4 |
+
|
5 |
+
var colors = [
|
6 |
+
"#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
|
7 |
+
"#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
|
8 |
+
"#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
|
9 |
+
"#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
|
10 |
+
"#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
|
11 |
+
"#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
|
12 |
+
"#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
|
13 |
+
"#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
|
14 |
+
"#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
|
15 |
+
"#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
|
16 |
+
"#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
|
17 |
+
"#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
|
18 |
+
"#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
|
19 |
+
"#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
|
20 |
+
"#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
|
21 |
+
"#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
|
22 |
+
"#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
|
23 |
+
"#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
|
24 |
+
"#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
|
25 |
+
"#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
|
26 |
+
"#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
|
27 |
+
"#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
|
28 |
+
"#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
|
29 |
+
"#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
|
30 |
+
"#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
|
31 |
+
"#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
|
32 |
+
"#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
|
33 |
+
];
|
34 |
+
|
35 |
+
var named = {
|
36 |
+
'#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',
|
37 |
+
'#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown',
|
38 |
+
'#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue',
|
39 |
+
'#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod',
|
40 |
+
'#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green',
|
41 |
+
'#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue',
|
42 |
+
'#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue',
|
43 |
+
'#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green',
|
44 |
+
'#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey',
|
45 |
+
'#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory',
|
46 |
+
'#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue',
|
47 |
+
'#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green',
|
48 |
+
'#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey',
|
49 |
+
'#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',
|
50 |
+
'#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue',
|
51 |
+
'#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin',
|
52 |
+
'#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid',
|
53 |
+
'#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff',
|
54 |
+
'#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue',
|
55 |
+
'#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver',
|
56 |
+
'#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green',
|
57 |
+
'#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',
|
58 |
+
'#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green'
|
59 |
+
};
|
60 |
+
|
61 |
+
var namedLookup = {};
|
62 |
+
|
63 |
+
function init() {
|
64 |
+
var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value;
|
65 |
+
|
66 |
+
tinyMCEPopup.resizeToInnerSize();
|
67 |
+
|
68 |
+
generatePicker();
|
69 |
+
generateWebColors();
|
70 |
+
generateNamedColors();
|
71 |
+
|
72 |
+
if (inputColor) {
|
73 |
+
changeFinalColor(inputColor);
|
74 |
+
|
75 |
+
col = convertHexToRGB(inputColor);
|
76 |
+
|
77 |
+
if (col)
|
78 |
+
updateLight(col.r, col.g, col.b);
|
79 |
+
}
|
80 |
+
|
81 |
+
for (key in named) {
|
82 |
+
value = named[key];
|
83 |
+
namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase();
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
function toHexColor(color) {
|
88 |
+
var matches, red, green, blue, toInt = parseInt;
|
89 |
+
|
90 |
+
function hex(value) {
|
91 |
+
value = parseInt(value).toString(16);
|
92 |
+
|
93 |
+
return value.length > 1 ? value : '0' + value; // Padd with leading zero
|
94 |
+
};
|
95 |
+
|
96 |
+
color = tinymce.trim(color);
|
97 |
+
color = color.replace(/^[#]/, '').toLowerCase(); // remove leading '#'
|
98 |
+
color = namedLookup[color] || color;
|
99 |
+
|
100 |
+
matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/.exec(color);
|
101 |
+
|
102 |
+
if (matches) {
|
103 |
+
red = toInt(matches[1]);
|
104 |
+
green = toInt(matches[2]);
|
105 |
+
blue = toInt(matches[3]);
|
106 |
+
} else {
|
107 |
+
matches = /^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color);
|
108 |
+
|
109 |
+
if (matches) {
|
110 |
+
red = toInt(matches[1], 16);
|
111 |
+
green = toInt(matches[2], 16);
|
112 |
+
blue = toInt(matches[3], 16);
|
113 |
+
} else {
|
114 |
+
matches = /^([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color);
|
115 |
+
|
116 |
+
if (matches) {
|
117 |
+
red = toInt(matches[1] + matches[1], 16);
|
118 |
+
green = toInt(matches[2] + matches[2], 16);
|
119 |
+
blue = toInt(matches[3] + matches[3], 16);
|
120 |
+
} else {
|
121 |
+
return '';
|
122 |
+
}
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
return '#' + hex(red) + hex(green) + hex(blue);
|
127 |
+
}
|
128 |
+
|
129 |
+
function insertAction() {
|
130 |
+
var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func');
|
131 |
+
|
132 |
+
var hexColor = toHexColor(color);
|
133 |
+
|
134 |
+
if (hexColor === '') {
|
135 |
+
var text = tinyMCEPopup.editor.getLang('advanced_dlg.invalid_color_value');
|
136 |
+
tinyMCEPopup.alert(text + ': ' + color);
|
137 |
+
}
|
138 |
+
else {
|
139 |
+
tinyMCEPopup.restoreSelection();
|
140 |
+
|
141 |
+
if (f)
|
142 |
+
f(hexColor);
|
143 |
+
|
144 |
+
tinyMCEPopup.close();
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
function showColor(color, name) {
|
149 |
+
if (name)
|
150 |
+
document.getElementById("colorname").innerHTML = name;
|
151 |
+
|
152 |
+
document.getElementById("preview").style.backgroundColor = color;
|
153 |
+
document.getElementById("color").value = color.toUpperCase();
|
154 |
+
}
|
155 |
+
|
156 |
+
function convertRGBToHex(col) {
|
157 |
+
var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
|
158 |
+
|
159 |
+
if (!col)
|
160 |
+
return col;
|
161 |
+
|
162 |
+
var rgb = col.replace(re, "$1,$2,$3").split(',');
|
163 |
+
if (rgb.length == 3) {
|
164 |
+
r = parseInt(rgb[0]).toString(16);
|
165 |
+
g = parseInt(rgb[1]).toString(16);
|
166 |
+
b = parseInt(rgb[2]).toString(16);
|
167 |
+
|
168 |
+
r = r.length == 1 ? '0' + r : r;
|
169 |
+
g = g.length == 1 ? '0' + g : g;
|
170 |
+
b = b.length == 1 ? '0' + b : b;
|
171 |
+
|
172 |
+
return "#" + r + g + b;
|
173 |
+
}
|
174 |
+
|
175 |
+
return col;
|
176 |
+
}
|
177 |
+
|
178 |
+
function convertHexToRGB(col) {
|
179 |
+
if (col.indexOf('#') != -1) {
|
180 |
+
col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
|
181 |
+
|
182 |
+
r = parseInt(col.substring(0, 2), 16);
|
183 |
+
g = parseInt(col.substring(2, 4), 16);
|
184 |
+
b = parseInt(col.substring(4, 6), 16);
|
185 |
+
|
186 |
+
return {r : r, g : g, b : b};
|
187 |
+
}
|
188 |
+
|
189 |
+
return null;
|
190 |
+
}
|
191 |
+
|
192 |
+
function generatePicker() {
|
193 |
+
var el = document.getElementById('light'), h = '', i;
|
194 |
+
|
195 |
+
for (i = 0; i < detail; i++){
|
196 |
+
h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'
|
197 |
+
+ ' onclick="changeFinalColor(this.style.backgroundColor)"'
|
198 |
+
+ ' onmousedown="isMouseDown = true; return false;"'
|
199 |
+
+ ' onmouseup="isMouseDown = false;"'
|
200 |
+
+ ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'
|
201 |
+
+ ' onmouseover="isMouseOver = true;"'
|
202 |
+
+ ' onmouseout="isMouseOver = false;"'
|
203 |
+
+ '></div>';
|
204 |
+
}
|
205 |
+
|
206 |
+
el.innerHTML = h;
|
207 |
+
}
|
208 |
+
|
209 |
+
function generateWebColors() {
|
210 |
+
var el = document.getElementById('webcolors'), h = '', i;
|
211 |
+
|
212 |
+
if (el.className == 'generated')
|
213 |
+
return;
|
214 |
+
|
215 |
+
// TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby.
|
216 |
+
h += '<div role="listbox" aria-labelledby="webcolors_title" tabindex="0"><table role="presentation" border="0" cellspacing="1" cellpadding="0">'
|
217 |
+
+ '<tr>';
|
218 |
+
|
219 |
+
for (i=0; i<colors.length; i++) {
|
220 |
+
h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'
|
221 |
+
+ '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="web_colors_' + i + '" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');" style="display:block;width:10px;height:10px;overflow:hidden;">';
|
222 |
+
if (tinyMCEPopup.editor.forcedHighContrastMode) {
|
223 |
+
h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
|
224 |
+
}
|
225 |
+
h += '<span class="mceVoiceLabel" style="display:none;" id="web_colors_' + i + '">' + colors[i].toUpperCase() + '</span>';
|
226 |
+
h += '</a></td>';
|
227 |
+
if ((i+1) % 18 == 0)
|
228 |
+
h += '</tr><tr>';
|
229 |
+
}
|
230 |
+
|
231 |
+
h += '</table></div>';
|
232 |
+
|
233 |
+
el.innerHTML = h;
|
234 |
+
el.className = 'generated';
|
235 |
+
|
236 |
+
paintCanvas(el);
|
237 |
+
enableKeyboardNavigation(el.firstChild);
|
238 |
+
}
|
239 |
+
|
240 |
+
function paintCanvas(el) {
|
241 |
+
tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) {
|
242 |
+
var context;
|
243 |
+
if (canvas.getContext && (context = canvas.getContext("2d"))) {
|
244 |
+
context.fillStyle = canvas.getAttribute('data-color');
|
245 |
+
context.fillRect(0, 0, 10, 10);
|
246 |
+
}
|
247 |
+
});
|
248 |
+
}
|
249 |
+
function generateNamedColors() {
|
250 |
+
var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
|
251 |
+
|
252 |
+
if (el.className == 'generated')
|
253 |
+
return;
|
254 |
+
|
255 |
+
for (n in named) {
|
256 |
+
v = named[n];
|
257 |
+
h += '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="named_colors_' + i + '" onfocus="showColor(\'' + n + '\',\'' + v + '\');" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '">';
|
258 |
+
if (tinyMCEPopup.editor.forcedHighContrastMode) {
|
259 |
+
h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
|
260 |
+
}
|
261 |
+
h += '<span class="mceVoiceLabel" style="display:none;" id="named_colors_' + i + '">' + v + '</span>';
|
262 |
+
h += '</a>';
|
263 |
+
i++;
|
264 |
+
}
|
265 |
+
|
266 |
+
el.innerHTML = h;
|
267 |
+
el.className = 'generated';
|
268 |
+
|
269 |
+
paintCanvas(el);
|
270 |
+
enableKeyboardNavigation(el);
|
271 |
+
}
|
272 |
+
|
273 |
+
function enableKeyboardNavigation(el) {
|
274 |
+
tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
|
275 |
+
root: el,
|
276 |
+
items: tinyMCEPopup.dom.select('a', el)
|
277 |
+
}, tinyMCEPopup.dom);
|
278 |
+
}
|
279 |
+
|
280 |
+
function dechex(n) {
|
281 |
+
return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);
|
282 |
+
}
|
283 |
+
|
284 |
+
function computeColor(e) {
|
285 |
+
var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB, pos = tinyMCEPopup.dom.getPos(e.target);
|
286 |
+
|
287 |
+
x = e.offsetX ? e.offsetX : (e.target ? e.clientX - pos.x : 0);
|
288 |
+
y = e.offsetY ? e.offsetY : (e.target ? e.clientY - pos.y : 0);
|
289 |
+
|
290 |
+
partWidth = document.getElementById('colors').width / 6;
|
291 |
+
partDetail = detail / 2;
|
292 |
+
imHeight = document.getElementById('colors').height;
|
293 |
+
|
294 |
+
r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;
|
295 |
+
g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);
|
296 |
+
b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);
|
297 |
+
|
298 |
+
coef = (imHeight - y) / imHeight;
|
299 |
+
r = 128 + (r - 128) * coef;
|
300 |
+
g = 128 + (g - 128) * coef;
|
301 |
+
b = 128 + (b - 128) * coef;
|
302 |
+
|
303 |
+
changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));
|
304 |
+
updateLight(r, g, b);
|
305 |
+
}
|
306 |
+
|
307 |
+
function updateLight(r, g, b) {
|
308 |
+
var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;
|
309 |
+
|
310 |
+
for (i=0; i<detail; i++) {
|
311 |
+
if ((i>=0) && (i<partDetail)) {
|
312 |
+
finalCoef = i / partDetail;
|
313 |
+
finalR = dechex(255 - (255 - r) * finalCoef);
|
314 |
+
finalG = dechex(255 - (255 - g) * finalCoef);
|
315 |
+
finalB = dechex(255 - (255 - b) * finalCoef);
|
316 |
+
} else {
|
317 |
+
finalCoef = 2 - i / partDetail;
|
318 |
+
finalR = dechex(r * finalCoef);
|
319 |
+
finalG = dechex(g * finalCoef);
|
320 |
+
finalB = dechex(b * finalCoef);
|
321 |
+
}
|
322 |
+
|
323 |
+
color = finalR + finalG + finalB;
|
324 |
+
|
325 |
+
setCol('gs' + i, '#'+color);
|
326 |
+
}
|
327 |
+
}
|
328 |
+
|
329 |
+
function changeFinalColor(color) {
|
330 |
+
if (color.indexOf('#') == -1)
|
331 |
+
color = convertRGBToHex(color);
|
332 |
+
|
333 |
+
setCol('preview', color);
|
334 |
+
document.getElementById('color').value = color;
|
335 |
+
}
|
336 |
+
|
337 |
+
function setCol(e, c) {
|
338 |
+
try {
|
339 |
+
document.getElementById(e).style.backgroundColor = c;
|
340 |
+
} catch (ex) {
|
341 |
+
// Ignore IE warning
|
342 |
+
}
|
343 |
+
}
|
344 |
+
|
345 |
+
tinyMCEPopup.onInit.add(init);
|
js/libraries/tiny_mce/themes/advanced/langs/en_dlg.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
tinyMCE.addI18n('en.advanced_dlg', {"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character", "charmap_usage":"Use left and right arrows to navigate.","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","invalid_color_value":"Invalid color value","":""});
|
1 |
+
tinyMCE.addI18n('en.advanced_dlg', {"link_list":"Link List","link_is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","link_is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","link_titlefield":"Title","link_target_blank":"Open Link in a New Window","link_target_same":"Open Link in the Same Window","link_target":"Target","link_url":"Link URL","link_title":"Insert/Edit Link","image_align_right":"Right","image_align_left":"Left","image_align_textbottom":"Text Bottom","image_align_texttop":"Text Top","image_align_bottom":"Bottom","image_align_middle":"Middle","image_align_top":"Top","image_align_baseline":"Baseline","image_align":"Alignment","image_hspace":"Horizontal Space","image_vspace":"Vertical Space","image_dimensions":"Dimensions","image_alt":"Image Description","image_list":"Image List","image_border":"Border","image_src":"Image URL","image_title":"Insert/Edit Image","charmap_title":"Select Special Character", "charmap_usage":"Use left and right arrows to navigate.","colorpicker_name":"Name:","colorpicker_color":"Color:","colorpicker_named_title":"Named Colors","colorpicker_named_tab":"Named","colorpicker_palette_title":"Palette Colors","colorpicker_palette_tab":"Palette","colorpicker_picker_title":"Color Picker","colorpicker_picker_tab":"Picker","colorpicker_title":"Select a Color","code_wordwrap":"Word Wrap","code_title":"HTML Source Editor","anchor_name":"Anchor Name","anchor_title":"Insert/Edit Anchor","about_loaded":"Loaded Plugins","about_version":"Version","about_author":"Author","about_plugin":"Plugin","about_plugins":"Plugins","about_license":"License","about_help":"Help","about_general":"About","about_title":"About TinyMCE","anchor_invalid":"Please specify a valid anchor name.","accessibility_help":"Accessibility Help","accessibility_usage_title":"General Usage","invalid_color_value":"Invalid color value","":""});
|
js/libraries/tiny_mce/tiny_mce_popup.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
|
2 |
-
// Uncomment and change this document.domain value if you are loading the script cross subdomains
|
3 |
-
// document.domain = 'moxiecode.com';
|
4 |
-
|
5 |
var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}if(!b.editor.getParam("browser_preferred_colors",false)||!b.isWindow){b.dom.addClass(document.body,"forceColors")}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){b.dom.bind(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){var b=a.target||a.srcElement;if(b.onchange){b.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_eventProxy:function(a){return function(b){tinyMCEPopup.dom.events.callNativeHandler(a,b)}}};tinyMCEPopup.init();
|
1 |
+
|
2 |
+
// Uncomment and change this document.domain value if you are loading the script cross subdomains
|
3 |
+
// document.domain = 'moxiecode.com';
|
4 |
+
|
5 |
var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document,{ownEvents:true,proxy:tinyMCEPopup._eventProxy});b.dom.bind(window,"ready",b._onDOMLoaded,b);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}if(!b.editor.getParam("browser_preferred_colors",false)||!b.isWindow){b.dom.addClass(document.body,"forceColors")}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){b.dom.bind(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){var b=a.target||a.srcElement;if(b.onchange){b.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_eventProxy:function(a){return function(b){tinyMCEPopup.dom.events.callNativeHandler(a,b)}}};tinyMCEPopup.init();
|
landing-pages.php
CHANGED
@@ -1,292 +1,87 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Plugin Name: Landing Pages
|
4 |
-
Plugin URI: http://www.inboundnow.com/landing-pages/
|
5 |
-
Description: The first true all-in-one Landing Page solution for WordPress, including ongoing conversion metrics, a/b split testing, unlimited design options and so much more!
|
6 |
-
Version: 1.3.
|
7 |
-
Author: David Wells, Hudson Atwell
|
8 |
-
Author URI: http://www.inboundnow.com/
|
9 |
-
*/
|
10 |
-
|
11 |
-
define('LANDINGPAGES_CURRENT_VERSION', '1.3.
|
12 |
-
define('LANDINGPAGES_URLPATH', WP_PLUGIN_URL.'/'.plugin_basename( dirname(__FILE__) ).'/' );
|
13 |
-
define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
|
14 |
-
define('LANDINGPAGES_PLUGIN_SLUG', 'landing-pages' );
|
15 |
-
define('
|
16 |
-
|
17 |
-
|
18 |
-
define('
|
19 |
-
$
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
include_once('modules/module.
|
31 |
-
|
32 |
-
include_once('modules/module.
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
include_once('
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
include_once('
|
50 |
-
include_once('modules/module.
|
51 |
-
include_once('modules/module.
|
52 |
-
include_once('modules/module.
|
53 |
-
include_once('modules/module.
|
54 |
-
include_once('modules/module.
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
//
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
include_once('shared/functions.templates.php');
|
89 |
-
}
|
90 |
-
}
|
91 |
-
|
92 |
-
// PREPARE LANDING PAGE TEMPLATE DATA
|
93 |
-
if (is_admin())
|
94 |
-
{
|
95 |
-
include_once('load.extensions.php');
|
96 |
-
include_once('modules/module.metaboxes.php');
|
97 |
-
}
|
98 |
-
|
99 |
-
|
100 |
-
// Hook function that will apply css, js
|
101 |
-
add_action('wp_head','landing_pages_insert_custom_head');
|
102 |
-
function landing_pages_insert_custom_head() {
|
103 |
-
global $post;
|
104 |
-
|
105 |
-
if (isset($post)&&'landing-page'==$post->post_type)
|
106 |
-
{
|
107 |
-
|
108 |
-
$custom_css_name = apply_filters('lp_custom_css_name','lp-custom-css');
|
109 |
-
$custom_js_name = apply_filters('lp_custom_js_name','lp-custom-js');
|
110 |
-
$custom_css = get_post_meta($post->ID, $custom_css_name, true);
|
111 |
-
$custom_js = get_post_meta($post->ID, $custom_js_name, true);
|
112 |
-
|
113 |
-
//Print Custom CSS
|
114 |
-
if (!stristr($custom_css,'<style'))
|
115 |
-
{
|
116 |
-
echo '<style type="text/css" id="lp_css_custom">'.$custom_css.'</style>';
|
117 |
-
}
|
118 |
-
else
|
119 |
-
{
|
120 |
-
echo $custom_css;
|
121 |
-
}
|
122 |
-
//Print Custom JS
|
123 |
-
if (!stristr($custom_js,'<script'))
|
124 |
-
{
|
125 |
-
echo '<script type="text/javascript" id="lp_js_custom">jQuery(document).ready(function($) {
|
126 |
-
'.$custom_js.' });</script>';
|
127 |
-
}
|
128 |
-
else
|
129 |
-
{
|
130 |
-
echo $custom_js;
|
131 |
-
}
|
132 |
-
}
|
133 |
-
}
|
134 |
-
|
135 |
-
|
136 |
-
add_filter('the_content','landing_pages_add_conversion_area', 20);
|
137 |
-
add_filter('get_the_content','landing_pages_add_conversion_area', 20);
|
138 |
-
function landing_pages_add_conversion_area($content)
|
139 |
-
{
|
140 |
-
|
141 |
-
if ('landing-page'==get_post_type() && !is_admin())
|
142 |
-
{
|
143 |
-
|
144 |
-
global $post;
|
145 |
-
|
146 |
-
remove_action('the_content', 'landing_pages_add_conversion_area');
|
147 |
-
|
148 |
-
$key = get_post_meta($post->ID, 'lp-selected-template', true);
|
149 |
-
$key = apply_filters('lp_selected_template',$key);
|
150 |
-
|
151 |
-
if (strstr($key,'-slash-'))
|
152 |
-
{
|
153 |
-
$key = str_replace('-slash-','/',$key);
|
154 |
-
}
|
155 |
-
|
156 |
-
$my_theme = wp_get_theme($key);
|
157 |
-
//echo $key;
|
158 |
-
if ($my_theme->exists()||$key=='default')
|
159 |
-
{
|
160 |
-
|
161 |
-
global $post;
|
162 |
-
$wrapper_class = "";
|
163 |
-
|
164 |
-
get_post_meta($post->ID, "default-conversion-area-placement", true);
|
165 |
-
|
166 |
-
|
167 |
-
$position = get_post_meta($post->ID, "{$key}-conversion-area-placement", true);
|
168 |
-
|
169 |
-
$position = apply_filters('lp_conversion_area_position', $position, $post, $key);
|
170 |
-
|
171 |
-
$_SESSION['lp_conversion_area_position'] = $position;
|
172 |
-
|
173 |
-
$conversion_area = lp_conversion_area(null,null,true,true);
|
174 |
-
|
175 |
-
|
176 |
-
$standardize_form = get_option( 'lp-main-landing-page-auto-format-forms' , 0); // conditional to check for options
|
177 |
-
if ($standardize_form)
|
178 |
-
{
|
179 |
-
$wrapper_class = lp_discover_important_wrappers($conversion_area);
|
180 |
-
$conversion_area = lp_rebuild_attributes($conversion_area);
|
181 |
-
}
|
182 |
-
|
183 |
-
$conversion_area = "<div id='lp_container' class='$wrapper_class'>".$conversion_area."</div>";
|
184 |
-
|
185 |
-
if ($position=='top')
|
186 |
-
{
|
187 |
-
$content = $conversion_area.$content;
|
188 |
-
}
|
189 |
-
else if ($position=='bottom')
|
190 |
-
{
|
191 |
-
$content = $content.$conversion_area;
|
192 |
-
}
|
193 |
-
else if ($position=='widget')
|
194 |
-
{
|
195 |
-
$content = $content;
|
196 |
-
}
|
197 |
-
else
|
198 |
-
{
|
199 |
-
$conversion_area = str_replace("id='lp_container'","id='lp_container' class='lp_form_$position' style='float:$position'",$conversion_area);
|
200 |
-
$content = $conversion_area.$content;
|
201 |
-
|
202 |
-
}
|
203 |
-
|
204 |
-
}
|
205 |
-
|
206 |
-
}
|
207 |
-
|
208 |
-
|
209 |
-
return $content;
|
210 |
-
}
|
211 |
-
|
212 |
-
|
213 |
-
if (is_admin())
|
214 |
-
{
|
215 |
-
include_once('modules/module.templates.php');
|
216 |
-
include_once('modules/module.store.php');
|
217 |
-
|
218 |
-
// Create Sub-menu
|
219 |
-
|
220 |
-
add_action('admin_menu', 'lp_add_menu');
|
221 |
-
|
222 |
-
function lp_add_menu()
|
223 |
-
{
|
224 |
-
//echo 1; exit;
|
225 |
-
if (current_user_can('manage_options'))
|
226 |
-
{
|
227 |
-
|
228 |
-
add_submenu_page('edit.php?post_type=landing-page', 'Forms', 'Forms', 'manage_options', 'inbound-forms-redirect',100);
|
229 |
-
|
230 |
-
add_submenu_page('edit.php?post_type=landing-page', 'Templates', 'Templates', 'manage_options', 'lp_manage_templates','lp_manage_templates',100);
|
231 |
-
|
232 |
-
add_submenu_page('edit.php?post_type=landing-page', 'Get Addons', 'Get Addons', 'manage_options', 'lp_store','lp_store_display',100);
|
233 |
-
|
234 |
-
add_submenu_page('edit.php?post_type=landing-page', 'Global Settings', 'Global Settings', 'manage_options', 'lp_global_settings','lp_display_global_settings');
|
235 |
-
|
236 |
-
// Add settings page for frontend editor
|
237 |
-
add_submenu_page('edit.php?post_type=landing-page', __('Editor','Editor'), __('Editor','Editor'), 'manage_options', 'lp-frontend-editor', 'lp_frontend_editor_screen');
|
238 |
-
|
239 |
-
}
|
240 |
-
}
|
241 |
-
|
242 |
-
}
|
243 |
-
|
244 |
-
// MAKE SURE WE USE THE RIGHT TEMPLATE
|
245 |
-
add_filter('single_template', 'lp_custom_template');
|
246 |
-
|
247 |
-
function lp_custom_template($single) {
|
248 |
-
global $wp_query, $post, $query_string;
|
249 |
-
//echo 2;exit;
|
250 |
-
if ($post->post_type == "landing-page")
|
251 |
-
{
|
252 |
-
$template = get_post_meta($post->ID, 'lp-selected-template', true);
|
253 |
-
$template = apply_filters('lp_selected_template',$template);
|
254 |
-
|
255 |
-
|
256 |
-
if (isset($template))
|
257 |
-
{
|
258 |
-
|
259 |
-
if (strstr($template,'-slash-'))
|
260 |
-
{
|
261 |
-
$template = str_replace('-slash-','/',$template);
|
262 |
-
}
|
263 |
-
|
264 |
-
$my_theme = wp_get_theme($template);
|
265 |
-
|
266 |
-
if ($my_theme->exists())
|
267 |
-
{
|
268 |
-
return "";
|
269 |
-
}
|
270 |
-
else if ($template!='default')
|
271 |
-
{
|
272 |
-
$template = str_replace('_','-',$template);
|
273 |
-
//echo LANDINGPAGES_URLPATH.'templates/'.$template.'/index.php'; exit;
|
274 |
-
if (file_exists(LANDINGPAGES_PATH.'templates/'.$template.'/index.php'))
|
275 |
-
{
|
276 |
-
//query_posts ($query_string . '&showposts=1');
|
277 |
-
return LANDINGPAGES_PATH.'templates/'.$template.'/index.php';
|
278 |
-
}
|
279 |
-
else
|
280 |
-
{
|
281 |
-
//query_posts ($query_string . '&showposts=1');
|
282 |
-
return LANDINGPAGES_UPLOADS_PATH.$template.'/index.php';
|
283 |
-
}
|
284 |
-
}
|
285 |
-
}
|
286 |
-
}
|
287 |
-
|
288 |
-
return $single;
|
289 |
-
}
|
290 |
-
|
291 |
-
// LOAD THE TEMLATE CUSTOMIZER MODULE
|
292 |
-
include_once('modules/module.customizer.php');
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Landing Pages
|
4 |
+
Plugin URI: http://www.inboundnow.com/landing-pages/
|
5 |
+
Description: The first true all-in-one Landing Page solution for WordPress, including ongoing conversion metrics, a/b split testing, unlimited design options and so much more!
|
6 |
+
Version: 1.3.5
|
7 |
+
Author: David Wells, Hudson Atwell
|
8 |
+
Author URI: http://www.inboundnow.com/
|
9 |
+
*/
|
10 |
+
|
11 |
+
define('LANDINGPAGES_CURRENT_VERSION', '1.3.5' );
|
12 |
+
define('LANDINGPAGES_URLPATH', WP_PLUGIN_URL.'/'.plugin_basename( dirname(__FILE__) ).'/' );
|
13 |
+
define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
|
14 |
+
define('LANDINGPAGES_PLUGIN_SLUG', 'landing-pages' );
|
15 |
+
define('LANDINGPAGES_FILE', __FILE__ );
|
16 |
+
define('LANDINGPAGES_STORE_URL', 'http://www.inboundnow.com/landing-pages/' );
|
17 |
+
$uploads = wp_upload_dir();
|
18 |
+
define('LANDINGPAGES_UPLOADS_PATH', $uploads['basedir'].'/landing-pages/templates/' );
|
19 |
+
define('LANDINGPAGES_UPLOADS_URLPATH', $uploads['baseurl'].'/landing-pages/templates/' );
|
20 |
+
$current_url = "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]."";
|
21 |
+
|
22 |
+
if (is_admin())
|
23 |
+
if(!isset($_SESSION)){@session_start();}
|
24 |
+
|
25 |
+
|
26 |
+
/* load core files */
|
27 |
+
switch (is_admin()) :
|
28 |
+
case true :
|
29 |
+
/* loads admin files */
|
30 |
+
include_once('modules/module.javascript-admin.php');
|
31 |
+
include_once('modules/module.activate.php');
|
32 |
+
include_once('modules/module.global-settings.php');
|
33 |
+
include_once('modules/module.clone.php');
|
34 |
+
include_once('modules/module.extension-updater.php');
|
35 |
+
include_once('modules/module.extension-licensing.php');
|
36 |
+
include_once('modules/module.admin-menus.php');
|
37 |
+
include_once('modules/module.welcome.php');
|
38 |
+
include_once('modules/module.install.php');
|
39 |
+
include_once('modules/module.alert.php');
|
40 |
+
include_once('modules/module.metaboxes.php');
|
41 |
+
include_once('modules/module.landing-page.php');
|
42 |
+
include_once('modules/module.load-extensions.php');
|
43 |
+
include_once('modules/module.post-type.php');
|
44 |
+
include_once('modules/module.track.php');
|
45 |
+
include_once('modules/module.ajax-setup.php');
|
46 |
+
include_once('modules/module.utils.php');
|
47 |
+
include_once('modules/module.sidebar.php');
|
48 |
+
include_once('modules/module.widgets.php');
|
49 |
+
include_once('modules/module.cookies.php');
|
50 |
+
include_once('modules/module.ab-testing.php');
|
51 |
+
include_once('modules/module.click-tracking.php');
|
52 |
+
include_once('modules/module.templates.php');
|
53 |
+
include_once('modules/module.store.php');
|
54 |
+
include_once('modules/module.customizer.php');
|
55 |
+
|
56 |
+
|
57 |
+
BREAK;
|
58 |
+
|
59 |
+
case false :
|
60 |
+
/* load front-end files */
|
61 |
+
include_once('modules/module.javascript-frontend.php');
|
62 |
+
include_once('modules/module.post-type.php');
|
63 |
+
include_once('modules/module.track.php');
|
64 |
+
include_once('modules/module.ajax-setup.php');
|
65 |
+
include_once('modules/module.utils.php');
|
66 |
+
include_once('modules/module.sidebar.php');
|
67 |
+
include_once('modules/module.widgets.php');
|
68 |
+
include_once('modules/module.cookies.php');
|
69 |
+
include_once('modules/module.ab-testing.php');
|
70 |
+
include_once('modules/module.click-tracking.php');
|
71 |
+
include_once('modules/module.landing-page.php');
|
72 |
+
include_once('modules/module.customizer.php');
|
73 |
+
|
74 |
+
BREAK;
|
75 |
+
endswitch;
|
76 |
+
|
77 |
+
/* Singleton Shared Class Loads */
|
78 |
+
include_once('shared/inbound-shortcodes/inbound-shortcodes.php'); // Shared Shortcodes
|
79 |
+
|
80 |
+
/* Inbound Core Shared Files. Lead files take presidence */
|
81 |
+
add_action( 'plugins_loaded', 'inbound_load_shared_landing_pages' );
|
82 |
+
function inbound_load_shared_landing_pages(){
|
83 |
+
include_once('shared/tracking/store.lead.php'); // Lead Storage from landing pages
|
84 |
+
include_once('shared/classes/form.class.php'); // Mirrored forms
|
85 |
+
include_once('shared/inboundnow/inboundnow.extension-licensing.php'); // Inboundnow Package Licensing
|
86 |
+
include_once('shared/inboundnow/inboundnow.extension-updating.php'); // Inboundnow Package Updating
|
87 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
libraries/class-tgm-plugin-activation.php
CHANGED
@@ -1,2086 +1,2092 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Plugin installation and activation for WordPress themes.
|
4 |
-
*
|
5 |
-
* @package TGM-Plugin-Activation
|
6 |
-
* @version 2.3.6
|
7 |
-
* @author Thomas Griffin <thomas@thomasgriffinmedia.com>
|
8 |
-
* @author Gary Jones <gamajo@gamajo.com>
|
9 |
-
* @copyright Copyright (c) 2012, Thomas Griffin
|
10 |
-
* @license http://opensource.org/licenses/gpl-2.0.php GPL v2 or later
|
11 |
-
* @link https://github.com/thomasgriffin/TGM-Plugin-Activation
|
12 |
-
*/
|
13 |
-
|
14 |
-
/*
|
15 |
-
Copyright 2012 Thomas Griffin (email : thomas@thomasgriffinmedia.com)
|
16 |
-
|
17 |
-
This program is free software; you can redistribute it and/or modify
|
18 |
-
it under the terms of the GNU General Public License, version 3, as
|
19 |
-
published by the Free Software Foundation.
|
20 |
-
|
21 |
-
This program is distributed in the hope that it will be useful,
|
22 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
23 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
24 |
-
GNU General Public License for more details.
|
25 |
-
|
26 |
-
You should have received a copy of the GNU General Public License
|
27 |
-
along with this program; if not, write to the Free Software
|
28 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
29 |
-
*/
|
30 |
-
|
31 |
-
if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
|
32 |
-
/**
|
33 |
-
* Automatic plugin installation and activation library.
|
34 |
-
*
|
35 |
-
* Creates a way to automatically install and activate plugins from within themes.
|
36 |
-
* The plugins can be either pre-packaged, downloaded from the WordPress
|
37 |
-
* Plugin Repository or downloaded from a private repository.
|
38 |
-
*
|
39 |
-
* @since 1.0.0
|
40 |
-
*
|
41 |
-
* @package TGM-Plugin-Activation
|
42 |
-
* @author Thomas Griffin <thomas@thomasgriffinmedia.com>
|
43 |
-
* @author Gary Jones <gamajo@gamajo.com>
|
44 |
-
*/
|
45 |
-
class TGM_Plugin_Activation {
|
46 |
-
|
47 |
-
/**
|
48 |
-
* Holds a copy of itself, so it can be referenced by the class name.
|
49 |
-
*
|
50 |
-
* @since 1.0.0
|
51 |
-
*
|
52 |
-
* @var TGM_Plugin_Activation
|
53 |
-
*/
|
54 |
-
static $instance;
|
55 |
-
|
56 |
-
/**
|
57 |
-
* Holds arrays of plugin details.
|
58 |
-
*
|
59 |
-
* @since 1.0.0
|
60 |
-
*
|
61 |
-
* @var array
|
62 |
-
*/
|
63 |
-
public $plugins = array();
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Parent menu slug for plugins page.
|
67 |
-
*
|
68 |
-
* @since 2.2.0
|
69 |
-
*
|
70 |
-
* @var string Parent menu slug. Defaults to 'themes.php'.
|
71 |
-
*/
|
72 |
-
public $parent_menu_slug = 'themes.php';
|
73 |
-
|
74 |
-
/**
|
75 |
-
* Parent URL slug for URL references.
|
76 |
-
*
|
77 |
-
* This is useful if you want to place the custom plugins page as a
|
78 |
-
* submenu item under a custom parent menu.
|
79 |
-
*
|
80 |
-
* @since 2.2.0
|
81 |
-
*
|
82 |
-
* @var string Parent URL slug. Defaults to 'themes.php'.
|
83 |
-
*/
|
84 |
-
public $parent_url_slug = 'themes.php';
|
85 |
-
|
86 |
-
/**
|
87 |
-
* Name of the querystring argument for the admin page.
|
88 |
-
*
|
89 |
-
* @since 1.0.0
|
90 |
-
*
|
91 |
-
* @var string
|
92 |
-
*/
|
93 |
-
public $menu = 'install-required-plugins';
|
94 |
-
|
95 |
-
/**
|
96 |
-
* Default absolute path to folder containing pre-packaged plugin zip files.
|
97 |
-
*
|
98 |
-
* @since 2.0.0
|
99 |
-
*
|
100 |
-
* @var string Absolute path prefix to packaged zip file location. Default is empty string.
|
101 |
-
*/
|
102 |
-
public $default_path = '';
|
103 |
-
|
104 |
-
/**
|
105 |
-
* Flag to show admin notices or not.
|
106 |
-
*
|
107 |
-
* @since 2.1.0
|
108 |
-
*
|
109 |
-
* @var boolean
|
110 |
-
*/
|
111 |
-
public $has_notices = true;
|
112 |
-
|
113 |
-
/**
|
114 |
-
* Flag to set automatic activation of plugins. Off by default.
|
115 |
-
*
|
116 |
-
* @since 2.2.0
|
117 |
-
*
|
118 |
-
* @var boolean
|
119 |
-
*/
|
120 |
-
public $is_automatic = false;
|
121 |
-
|
122 |
-
/**
|
123 |
-
* Optional message to display before the plugins table.
|
124 |
-
*
|
125 |
-
* @since 2.2.0
|
126 |
-
*
|
127 |
-
* @var string Message filtered by wp_kses_post(). Default is empty string.
|
128 |
-
*/
|
129 |
-
public $message = '';
|
130 |
-
|
131 |
-
/**
|
132 |
-
* Holds configurable array of strings.
|
133 |
-
*
|
134 |
-
* Default values are added in the constructor.
|
135 |
-
*
|
136 |
-
* @since 2.0.0
|
137 |
-
*
|
138 |
-
* @var array
|
139 |
-
*/
|
140 |
-
public $strings = array();
|
141 |
-
|
142 |
-
/**
|
143 |
-
* Adds a reference of this object to $instance, populates default strings,
|
144 |
-
* does the tgmpa_init action hook, and hooks in the interactions to init.
|
145 |
-
*
|
146 |
-
* @since 1.0.0
|
147 |
-
*
|
148 |
-
* @see TGM_Plugin_Activation::init()
|
149 |
-
*/
|
150 |
-
public function __construct() {
|
151 |
-
|
152 |
-
self::$instance =& $this;
|
153 |
-
|
154 |
-
$this->strings = array(
|
155 |
-
'page_title' => __( 'Install Required Plugins', 'tgmpa' ),
|
156 |
-
'menu_title' => __( 'Install Plugins', 'tgmpa' ),
|
157 |
-
'installing' => __( 'Installing Plugin: %s', 'tgmpa' ),
|
158 |
-
'oops' => __( 'Something went wrong.', 'tgmpa' ),
|
159 |
-
'notice_can_install_required' => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.' ),
|
160 |
-
'notice_can_install_recommended' => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.' ),
|
161 |
-
'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ),
|
162 |
-
'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ),
|
163 |
-
'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ),
|
164 |
-
'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ),
|
165 |
-
'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.' ),
|
166 |
-
'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ),
|
167 |
-
'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ),
|
168 |
-
'activate_link' => _n_noop( 'Activate installed plugin', 'Activate installed plugins' ),
|
169 |
-
'return' => __( 'Return to Required Plugins Installer', 'tgmpa' ),
|
170 |
-
'dashboard' => __( 'Return to the dashboard', 'tgmpa' ),
|
171 |
-
'plugin_activated' => __( 'Plugin activated successfully.', 'tgmpa' ),
|
172 |
-
'activated_successfully' => __( 'The following plugin was activated successfully:', 'tgmpa' ),
|
173 |
-
'complete' => __( 'All plugins installed and activated successfully. %1$s', 'tgmpa' ),
|
174 |
-
'dismiss' => __( 'Dismiss this notice', 'tgmpa' ),
|
175 |
-
);
|
176 |
-
|
177 |
-
/** Announce that the class is ready, and pass the object (for advanced use) */
|
178 |
-
do_action_ref_array( 'tgmpa_init', array( &$this ) );
|
179 |
-
|
180 |
-
/** When the rest of WP has loaded, kick-start the rest of the class */
|
181 |
-
add_action( 'init', array( &$this, 'init' ) );
|
182 |
-
|
183 |
-
}
|
184 |
-
|
185 |
-
/**
|
186 |
-
* Initialise the interactions between this class and WordPress.
|
187 |
-
*
|
188 |
-
* Hooks in three new methods for the class: admin_menu, notices and styles.
|
189 |
-
*
|
190 |
-
* @since 2.0.0
|
191 |
-
*
|
192 |
-
* @see TGM_Plugin_Activation::admin_menu()
|
193 |
-
* @see TGM_Plugin_Activation::notices()
|
194 |
-
* @see TGM_Plugin_Activation::styles()
|
195 |
-
*/
|
196 |
-
public function init() {
|
197 |
-
|
198 |
-
do_action( 'tgmpa_register' );
|
199 |
-
/** After this point, the plugins should be registered and the configuration set */
|
200 |
-
|
201 |
-
/** Proceed only if we have plugins to handle */
|
202 |
-
if ( $this->plugins ) {
|
203 |
-
$sorted = array(); // Prepare variable for sorting
|
204 |
-
|
205 |
-
foreach ( $this->plugins as $plugin )
|
206 |
-
$sorted[] = $plugin['name'];
|
207 |
-
|
208 |
-
array_multisort( $sorted, SORT_ASC, $this->plugins ); // Sort plugins alphabetically by name
|
209 |
-
|
210 |
-
add_action( 'admin_menu', array( &$this, 'admin_menu' ) );
|
211 |
-
add_action( 'admin_head', array( &$this, 'dismiss' ) );
|
212 |
-
add_filter( 'install_plugin_complete_actions', array( &$this, 'actions' ) );
|
213 |
-
|
214 |
-
/** Load admin bar in the header to remove flash when installing plugins */
|
215 |
-
if ( $this->is_tgmpa_page() ) {
|
216 |
-
remove_action( 'wp_footer', 'wp_admin_bar_render', 1000 );
|
217 |
-
remove_action( 'admin_footer', 'wp_admin_bar_render', 1000 );
|
218 |
-
add_action( 'wp_head', 'wp_admin_bar_render', 1000 );
|
219 |
-
add_action( 'admin_head', 'wp_admin_bar_render', 1000 );
|
220 |
-
}
|
221 |
-
|
222 |
-
if ( $this->has_notices ) {
|
223 |
-
add_action( 'admin_notices', array( &$this, 'notices' ) );
|
224 |
-
add_action( 'admin_init', array( &$this, 'admin_init' ), 1 );
|
225 |
-
add_action( 'admin_enqueue_scripts', array( &$this, 'thickbox' ) );
|
226 |
-
add_action( 'switch_theme', array( &$this, 'update_dismiss' ) );
|
227 |
-
}
|
228 |
-
|
229 |
-
/** Setup the force activation hook */
|
230 |
-
foreach ( $this->plugins as $plugin ) {
|
231 |
-
if ( isset( $plugin['force_activation'] ) && true === $plugin['force_activation'] ) {
|
232 |
-
add_action( 'admin_init', array( &$this, 'force_activation' ) );
|
233 |
-
break;
|
234 |
-
}
|
235 |
-
}
|
236 |
-
|
237 |
-
/** Setup the force deactivation hook */
|
238 |
-
foreach ( $this->plugins as $plugin ) {
|
239 |
-
if ( isset( $plugin['force_deactivation'] ) && true === $plugin['force_deactivation'] ) {
|
240 |
-
add_action( 'switch_theme', array( &$this, 'force_deactivation' ) );
|
241 |
-
break;
|
242 |
-
}
|
243 |
-
}
|
244 |
-
}
|
245 |
-
|
246 |
-
}
|
247 |
-
|
248 |
-
/**
|
249 |
-
* Handles calls to show plugin information via links in the notices.
|
250 |
-
*
|
251 |
-
* We get the links in the admin notices to point to the TGMPA page, rather
|
252 |
-
* than the typical plugin-install.php file, so we can prepare everything
|
253 |
-
* beforehand.
|
254 |
-
*
|
255 |
-
* WP doesn't make it easy to show the plugin information in the thickbox -
|
256 |
-
* here we have to require a file that includes a function that does the
|
257 |
-
* main work of displaying it, enqueue some styles, set up some globals and
|
258 |
-
* finally call that function before exiting.
|
259 |
-
*
|
260 |
-
* Down right easy once you know how...
|
261 |
-
*
|
262 |
-
* @since 2.1.0
|
263 |
-
*
|
264 |
-
* @global string $tab Used as iframe div class names, helps with styling
|
265 |
-
* @global string $body_id Used as the iframe body ID, helps with styling
|
266 |
-
* @return null Returns early if not the TGMPA page.
|
267 |
-
*/
|
268 |
-
public function admin_init() {
|
269 |
-
|
270 |
-
if ( ! $this->is_tgmpa_page() )
|
271 |
-
return;
|
272 |
-
|
273 |
-
if ( isset( $_REQUEST['tab'] ) && 'plugin-information' == $_REQUEST['tab'] ) {
|
274 |
-
require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; // Need for install_plugin_information()
|
275 |
-
|
276 |
-
wp_enqueue_style( 'plugin-install' );
|
277 |
-
|
278 |
-
global $tab, $body_id;
|
279 |
-
$body_id = $tab = 'plugin-information';
|
280 |
-
|
281 |
-
install_plugin_information();
|
282 |
-
|
283 |
-
exit;
|
284 |
-
}
|
285 |
-
|
286 |
-
}
|
287 |
-
|
288 |
-
/**
|
289 |
-
* Enqueues thickbox scripts/styles for plugin info.
|
290 |
-
*
|
291 |
-
* Thickbox is not automatically included on all admin pages, so we must
|
292 |
-
* manually enqueue it for those pages.
|
293 |
-
*
|
294 |
-
* Thickbox is only loaded if the user has not dismissed the admin
|
295 |
-
* notice or if there are any plugins left to install and activate.
|
296 |
-
*
|
297 |
-
* @since 2.1.0
|
298 |
-
*/
|
299 |
-
public function thickbox() {
|
300 |
-
|
301 |
-
if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice', true ) )
|
302 |
-
add_thickbox();
|
303 |
-
|
304 |
-
}
|
305 |
-
|
306 |
-
/**
|
307 |
-
* Adds submenu page under 'Appearance' tab.
|
308 |
-
*
|
309 |
-
* This method adds the submenu page letting users know that a required
|
310 |
-
* plugin needs to be installed.
|
311 |
-
*
|
312 |
-
* This page disappears once the plugin has been installed and activated.
|
313 |
-
*
|
314 |
-
* @since 1.0.0
|
315 |
-
*
|
316 |
-
* @see TGM_Plugin_Activation::init()
|
317 |
-
* @see TGM_Plugin_Activation::install_plugins_page()
|
318 |
-
*/
|
319 |
-
public function admin_menu() {
|
320 |
-
|
321 |
-
// Make sure privileges are correct to see the page
|
322 |
-
if ( ! current_user_can( 'install_plugins' ) )
|
323 |
-
return;
|
324 |
-
|
325 |
-
$this->populate_file_path();
|
326 |
-
|
327 |
-
foreach ( $this->plugins as $plugin ) {
|
328 |
-
if ( ! is_plugin_active( $plugin['file_path'] ) ) {
|
329 |
-
add_submenu_page(
|
330 |
-
$this->parent_menu_slug, // Parent menu slug
|
331 |
-
$this->strings['page_title'], // Page title
|
332 |
-
$this->strings['menu_title'], // Menu title
|
333 |
-
'edit_theme_options', // Capability
|
334 |
-
$this->menu, // Menu slug
|
335 |
-
array( &$this, 'install_plugins_page' ) // Callback
|
336 |
-
);
|
337 |
-
break;
|
338 |
-
}
|
339 |
-
}
|
340 |
-
|
341 |
-
}
|
342 |
-
|
343 |
-
/**
|
344 |
-
* Echoes plugin installation form.
|
345 |
-
*
|
346 |
-
* This method is the callback for the admin_menu method function.
|
347 |
-
* This displays the admin page and form area where the user can select to install and activate the plugin.
|
348 |
-
*
|
349 |
-
* @since 1.0.0
|
350 |
-
*
|
351 |
-
* @return null Aborts early if we're processing a plugin installation action
|
352 |
-
*/
|
353 |
-
public function install_plugins_page() {
|
354 |
-
|
355 |
-
/** Store new instance of plugin table in object */
|
356 |
-
$plugin_table = new TGMPA_List_Table;
|
357 |
-
|
358 |
-
/** Return early if processing a plugin installation action */
|
359 |
-
if ( isset( $_POST[sanitize_key( 'action' )] ) && 'tgmpa-bulk-install' == $_POST[sanitize_key( 'action' )] && $plugin_table->process_bulk_actions() || $this->do_plugin_install() )
|
360 |
-
return;
|
361 |
-
|
362 |
-
?>
|
363 |
-
<div class="tgmpa wrap">
|
364 |
-
|
365 |
-
<?php screen_icon( apply_filters( 'tgmpa_default_screen_icon', 'themes' ) ); ?>
|
366 |
-
<h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
|
367 |
-
<?php $plugin_table->prepare_items(); ?>
|
368 |
-
|
369 |
-
<?php if ( isset( $this->message ) ) _e( wp_kses_post( $this->message ), 'tgmpa' ); ?>
|
370 |
-
|
371 |
-
<form id="tgmpa-plugins" action="" method="post">
|
372 |
-
<input type="hidden" name="tgmpa-page" value="<?php echo $this->menu; ?>" />
|
373 |
-
<?php $plugin_table->display(); ?>
|
374 |
-
</form>
|
375 |
-
|
376 |
-
</div>
|
377 |
-
<?php
|
378 |
-
|
379 |
-
}
|
380 |
-
|
381 |
-
/**
|
382 |
-
* Installs a plugin or activates a plugin depending on the hover
|
383 |
-
* link clicked by the user.
|
384 |
-
*
|
385 |
-
* Checks the $_GET variable to see which actions have been
|
386 |
-
* passed and responds with the appropriate method.
|
387 |
-
*
|
388 |
-
* Uses WP_Filesystem to process and handle the plugin installation
|
389 |
-
* method.
|
390 |
-
*
|
391 |
-
* @since 1.0.0
|
392 |
-
*
|
393 |
-
* @uses WP_Filesystem
|
394 |
-
* @uses WP_Error
|
395 |
-
* @uses WP_Upgrader
|
396 |
-
* @uses Plugin_Upgrader
|
397 |
-
* @uses Plugin_Installer_Skin
|
398 |
-
*
|
399 |
-
* @return boolean True on success, false on failure
|
400 |
-
*/
|
401 |
-
protected function do_plugin_install() {
|
402 |
-
|
403 |
-
/** All plugin information will be stored in an array for processing */
|
404 |
-
$plugin = array();
|
405 |
-
|
406 |
-
/** Checks for actions from hover links to process the installation */
|
407 |
-
if ( isset( $_GET[sanitize_key( 'plugin' )] ) && ( isset( $_GET[sanitize_key( 'tgmpa-install' )] ) && 'install-plugin' == $_GET[sanitize_key( 'tgmpa-install' )] ) ) {
|
408 |
-
check_admin_referer( 'tgmpa-install' );
|
409 |
-
|
410 |
-
$plugin['name'] = $_GET[sanitize_key( 'plugin_name' )]; // Plugin name
|
411 |
-
$plugin['slug'] = $_GET[sanitize_key( 'plugin' )]; // Plugin slug
|
412 |
-
$plugin['source'] = $_GET[sanitize_key( 'plugin_source' )]; // Plugin source
|
413 |
-
|
414 |
-
/** Pass all necessary information via URL if WP_Filesystem is needed */
|
415 |
-
$url = wp_nonce_url(
|
416 |
-
add_query_arg(
|
417 |
-
array(
|
418 |
-
'page' => $this->menu,
|
419 |
-
'plugin' => $plugin['slug'],
|
420 |
-
'plugin_name' => $plugin['name'],
|
421 |
-
'plugin_source' => $plugin['source'],
|
422 |
-
'tgmpa-install' => 'install-plugin',
|
423 |
-
),
|
424 |
-
admin_url( $this->parent_url_slug )
|
425 |
-
),
|
426 |
-
'tgmpa-install'
|
427 |
-
);
|
428 |
-
$method = ''; // Leave blank so WP_Filesystem can populate it as necessary
|
429 |
-
$fields = array( sanitize_key( 'tgmpa-install' ) ); // Extra fields to pass to WP_Filesystem
|
430 |
-
|
431 |
-
if ( false === ( $creds = request_filesystem_credentials( $url, $method, false, false, $fields ) ) )
|
432 |
-
return true;
|
433 |
-
|
434 |
-
if ( ! WP_Filesystem( $creds ) ) {
|
435 |
-
request_filesystem_credentials( $url, $method, true, false, $fields ); // Setup WP_Filesystem
|
436 |
-
return true;
|
437 |
-
}
|
438 |
-
|
439 |
-
require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; // Need for plugins_api
|
440 |
-
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; // Need for upgrade classes
|
441 |
-
|
442 |
-
/** Set plugin source to WordPress API link if available */
|
443 |
-
if ( isset( $plugin['source'] ) && 'repo' == $plugin['source'] ) {
|
444 |
-
$api = plugins_api( 'plugin_information', array( 'slug' => $plugin['slug'], 'fields' => array( 'sections' => false ) ) );
|
445 |
-
|
446 |
-
if ( is_wp_error( $api ) )
|
447 |
-
wp_die( $this->strings['oops'] . var_dump( $api ) );
|
448 |
-
|
449 |
-
if ( isset( $api->download_link ) )
|
450 |
-
$plugin['source'] = $api->download_link;
|
451 |
-
}
|
452 |
-
|
453 |
-
/** Set type, based on whether the source starts with http:// or https:// */
|
454 |
-
$type = preg_match( '|^http(s)?://|', $plugin['source'] ) ? 'web' : 'upload';
|
455 |
-
|
456 |
-
/** Prep variables for Plugin_Installer_Skin class */
|
457 |
-
$title = sprintf( $this->strings['installing'], $plugin['name'] );
|
458 |
-
$url = add_query_arg( array( 'action' => 'install-plugin', 'plugin' => $plugin['slug'] ), 'update.php' );
|
459 |
-
if ( isset( $_GET['from'] ) )
|
460 |
-
$url .= add_query_arg( 'from', urlencode( stripslashes( $_GET['from'] ) ), $url );
|
461 |
-
|
462 |
-
$nonce = 'install-plugin_' . $plugin['slug'];
|
463 |
-
|
464 |
-
/** Prefix a default path to pre-packaged plugins */
|
465 |
-
$source = ( 'upload' == $type ) ? $this->default_path . $plugin['source'] : $plugin['source'];
|
466 |
-
|
467 |
-
/** Create a new instance of Plugin_Upgrader */
|
468 |
-
$upgrader = new Plugin_Upgrader( $skin = new Plugin_Installer_Skin( compact( 'type', 'title', 'url', 'nonce', 'plugin', 'api' ) ) );
|
469 |
-
|
470 |
-
/** Perform the action and install the plugin from the $source urldecode() */
|
471 |
-
$upgrader->install( $source );
|
472 |
-
|
473 |
-
/** Flush plugins cache so we can make sure that the installed plugins list is always up to date */
|
474 |
-
wp_cache_flush();
|
475 |
-
|
476 |
-
/** Only activate plugins if the config option is set to true */
|
477 |
-
if ( $this->is_automatic ) {
|
478 |
-
$plugin_activate = $upgrader->plugin_info(); // Grab the plugin info from the Plugin_Upgrader method
|
479 |
-
$activate = activate_plugin( $plugin_activate ); // Activate the plugin
|
480 |
-
$this->populate_file_path(); // Re-populate the file path now that the plugin has been installed and activated
|
481 |
-
|
482 |
-
if ( is_wp_error( $activate ) ) {
|
483 |
-
echo '<div id="message" class="error"><p>' . $activate->get_error_message() . '</p></div>';
|
484 |
-
echo '<p><a href="' . add_query_arg( 'page', $this->menu, admin_url( $this->parent_url_slug ) ) . '" title="' . esc_attr( $this->strings['return'] ) . '" target="_parent">' . $this->strings['return'] . '</a></p>';
|
485 |
-
return true; // End it here if there is an error with automatic activation
|
486 |
-
}
|
487 |
-
else {
|
488 |
-
echo '<p>' . $this->strings['plugin_activated'] . '</p>';
|
489 |
-
}
|
490 |
-
}
|
491 |
-
|
492 |
-
/** Display message based on if all plugins are now active or not */
|
493 |
-
$complete = array();
|
494 |
-
foreach ( $this->plugins as $plugin ) {
|
495 |
-
if ( ! is_plugin_active( $plugin['file_path'] ) ) {
|
496 |
-
echo '<p><a href="' . add_query_arg( 'page', $this->menu, admin_url( $this->parent_url_slug ) ) . '" title="' . esc_attr( $this->strings['return'] ) . '" target="_parent">' . $this->strings['return'] . '</a></p>';
|
497 |
-
$complete[] = $plugin;
|
498 |
-
break;
|
499 |
-
}
|
500 |
-
/** Nothing to store */
|
501 |
-
else {
|
502 |
-
$complete[] = '';
|
503 |
-
}
|
504 |
-
}
|
505 |
-
|
506 |
-
/** Filter out any empty entries */
|
507 |
-
$complete = array_filter( $complete );
|
508 |
-
|
509 |
-
/** All plugins are active, so we display the complete string and hide the plugin menu */
|
510 |
-
if ( empty( $complete ) ) {
|
511 |
-
echo '<p>' . sprintf( $this->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|