Version Description
Download this release
Release Info
Developer | DavidWells |
Plugin | WordPress Landing Pages |
Version | 1.1.0 |
Comparing to | |
See all releases |
Version 1.1.0
- css/admin-ab-testing.css +1 -0
- css/admin-global-settings.css +160 -0
- css/admin-landing-page-list.css +360 -0
- css/admin-lp-cpt-only-style.css +18 -0
- css/admin-post-edit.css +126 -0
- css/admin-post-new.css +85 -0
- css/admin-split-testing-splash.css +1 -6
- css/admin-split-testing.css +1 -0
- css/admin-style.css +434 -0
- css/admin-templates.css +48 -0
- css/admin-tour.css +216 -0
- css/customizer-ab-testing.css +1 -0
- css/customizer-load.css +69 -0
- css/customizer.frontend.css +156 -0
- css/customizer.media-uploader.css +28 -0
- css/images/Navigation.png +0 -0
- css/images/blank-page.png +0 -0
- css/images/clone-create.png +0 -0
- css/images/dropdownback.png +0 -0
- css/images/headerback.png +0 -0
- css/images/hover.png +0 -0
- css/images/landing-page-icon-10.png +0 -0
- css/images/linkback.png +0 -0
- css/images/question-light.png +0 -0
- css/images/select-pages.png +0 -0
- css/images/tooltip.png +0 -0
- css/jquery.qtip.min.css +1 -0
- css/kool-swap.css +118 -0
- functions/functions.admin.php +778 -0
- functions/functions.global.php +1 -0
- images/add-on-image.png +0 -0
- images/cross.png +0 -0
- images/custom-setup-image.png +0 -0
- images/get-custom-setup.png +0 -0
- images/get-wordpress-templates.png +0 -0
- images/gradient.png +0 -0
- images/grey-clear.png +0 -0
- images/image.php +57 -0
- images/label.png +0 -0
- images/link.gif +0 -0
- images/new-lead.png +0 -0
- images/note.png +0 -0
- images/nothumbnail.jpg +0 -0
- images/plus.gif +0 -0
- images/templates-image.png +0 -0
- images/tick.png +0 -0
- index.php +2 -0
- js/admin/admin.ajax.edit.js +94 -0
- js/admin/admin.landing-page-list.js +160 -0
- js/admin/admin.metaboxes.js +1 -0
- js/admin/admin.post-edit-ab-testing.js +72 -0
- js/admin/admin.post-edit.js +384 -0
- js/admin/admin.post-new.js +138 -0
- js/admin/admin.split-testing-splash.js +1 -0
- js/admin/admin.split-testing.js +1 -0
- js/admin/admin.store.js +5 -0
- js/admin/admin.templates-upload.js +25 -0
- js/admin/admin.templates.js +1 -0
- js/admin/intro.js +758 -0
- js/admin/tour/tour.post-edit.js +10 -0
- js/admin/tour/tour.post-list.js +8 -0
- js/ajax.clearstats.js +1 -0
- js/ajax.split-testing.js +1 -0
- js/ajax.tracking.js +1 -0
- js/ajax.tracking.js.php +1 -0
- js/customizer.ab-testing.js +1 -0
- js/customizer.load.js +126 -0
- js/customizer.save.js +472 -0
- js/jquery.bindfirst.js +15 -0
- js/jquery.cookie.js +1 -0
- js/jquery.easing.min.js +44 -0
- js/jquery.form-population.js +1 -0
- js/jquery.funnel-tracking.js +1 -0
- js/jquery.kool-swap.js +577 -0
- js/jquery.lp.cookie.js +1 -0
- js/jquery.tablesorter.js +1031 -0
- js/jquery.total-storage.min.js +22 -0
- js/libraries/easyXDM.debug.js +1 -0
- js/libraries/isotope/css/style.css +752 -0
- js/libraries/isotope/jquery.isotope.js +1406 -0
- js/libraries/isotope/jquery.isotope.min.js +11 -0
- js/libraries/isotope/js/fake-element.js +38 -0
- js/libraries/isotope/js/jquery-1.7.1.min.js +4 -0
- js/libraries/isotope/js/jquery.ba-bbq.min.js +18 -0
- js/libraries/isotope/js/jquery.infinitescroll.min.js +47 -0
- js/libraries/isotope/js/make-big-graph-projects.js +43 -0
- js/libraries/jpicker/css/jPicker-1.1.6.css +232 -0
- js/libraries/jpicker/css/jPicker-1.1.6.min.css +1 -0
- js/libraries/jpicker/css/jPicker.css +17 -0
- js/libraries/jpicker/images/AlphaBar.png +0 -0
- js/libraries/jpicker/images/Bars.png +0 -0
- js/libraries/jpicker/images/Maps.png +0 -0
- js/libraries/jpicker/images/NoColor.png +0 -0
- js/libraries/jpicker/images/Thumbs.db +0 -0
- js/libraries/jpicker/images/bar-opacity.png +0 -0
- js/libraries/jpicker/images/map-opacity.png +0 -0
- js/libraries/jpicker/images/mappoint.gif +0 -0
- js/libraries/jpicker/images/picker.gif +0 -0
- js/libraries/jpicker/images/preview-opacity.png +0 -0
- js/libraries/jpicker/images/rangearrows.gif +0 -0
- js/libraries/jpicker/jpicker-1.1.6.min.js +1 -0
- js/libraries/jquery-datepicker/jquery.timepicker.css +51 -0
- js/libraries/jquery-datepicker/jquery.timepicker.js +691 -0
- js/libraries/jquery-datepicker/jquery.timepicker.min.js +3 -0
- js/libraries/jquery-datepicker/lib/base.css +390 -0
- js/libraries/jquery-datepicker/lib/base.js +14 -0
- js/libraries/jquery-datepicker/lib/datepair.js +204 -0
- js/libraries/jquery-datepicker/lib/glyphicons-halflings.png +0 -0
- js/libraries/jquery-datepicker/lib/screenshot.png +0 -0
- js/libraries/jquery-datepicker/picker_functions.js +36 -0
- js/libraries/jquery-qtip/jquery.qtip.min.js +2 -0
- js/libraries/jquery-qtip/load.qtip.js +51 -0
- js/libraries/tiny_mce/jquery.tinymce.js +1 -0
- js/libraries/tiny_mce/langs/en.js +1 -0
- js/libraries/tiny_mce/license.txt +504 -0
- js/libraries/tiny_mce/plugins/advhr/css/advhr.css +5 -0
- js/libraries/tiny_mce/plugins/advhr/editor_plugin.js +1 -0
- js/libraries/tiny_mce/plugins/advhr/editor_plugin_src.js +57 -0
- js/libraries/tiny_mce/plugins/advhr/js/rule.js +43 -0
- js/libraries/tiny_mce/plugins/advhr/langs/en_dlg.js +1 -0
- js/libraries/tiny_mce/plugins/advhr/rule.htm +58 -0
- js/libraries/tiny_mce/plugins/advimage/css/advimage.css +13 -0
- js/libraries/tiny_mce/plugins/advimage/editor_plugin.js +1 -0
- js/libraries/tiny_mce/plugins/advimage/editor_plugin_src.js +50 -0
- js/libraries/tiny_mce/plugins/advimage/image.htm +235 -0
- js/libraries/tiny_mce/plugins/advimage/img/sample.gif +0 -0
- js/libraries/tiny_mce/plugins/advimage/js/image.js +464 -0
- js/libraries/tiny_mce/plugins/advimage/langs/en_dlg.js +1 -0
- js/libraries/tiny_mce/plugins/advlink/css/advlink.css +8 -0
- js/libraries/tiny_mce/plugins/advlink/editor_plugin.js +1 -0
- js/libraries/tiny_mce/plugins/advlink/editor_plugin_src.js +61 -0
- js/libraries/tiny_mce/plugins/advlink/js/advlink.js +543 -0
- js/libraries/tiny_mce/plugins/advlink/langs/en_dlg.js +1 -0
- js/libraries/tiny_mce/plugins/advlink/link.htm +338 -0
- js/libraries/tiny_mce/plugins/advlist/editor_plugin.js +1 -0
- js/libraries/tiny_mce/plugins/advlist/editor_plugin_src.js +176 -0
- js/libraries/tiny_mce/plugins/autolink/editor_plugin.js +1 -0
- js/libraries/tiny_mce/plugins/autolink/editor_plugin_src.js +184 -0
- js/libraries/tiny_mce/plugins/autoresize/editor_plugin.js +1 -0
- js/libraries/tiny_mce/plugins/autoresize/editor_plugin_src.js +119 -0
- js/libraries/tiny_mce/plugins/autosave/editor_plugin.js +1 -0
- js/libraries/tiny_mce/plugins/autosave/editor_plugin_src.js +433 -0
- js/libraries/tiny_mce/plugins/autosave/langs/en.js +4 -0
- js/libraries/tiny_mce/plugins/bbcode/editor_plugin.js +1 -0
- js/libraries/tiny_mce/plugins/bbcode/editor_plugin_src.js +120 -0
- js/libraries/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -0
- js/libraries/tiny_mce/plugins/contextmenu/editor_plugin_src.js +163 -0
- js/libraries/tiny_mce/plugins/directionality/editor_plugin.js +1 -0
- js/libraries/tiny_mce/plugins/directionality/editor_plugin_src.js +85 -0
- js/libraries/tiny_mce/plugins/emotions/editor_plugin.js +1 -0
- js/libraries/tiny_mce/plugins/emotions/editor_plugin_src.js +43 -0
- js/libraries/tiny_mce/plugins/emotions/emotions.htm +42 -0
- js/libraries/tiny_mce/plugins/emotions/img/smiley-cool.gif +0 -0
- js/libraries/tiny_mce/plugins/emotions/img/smiley-cry.gif +0 -0
- js/libraries/tiny_mce/plugins/emotions/img/smiley-embarassed.gif +0 -0
- js/libraries/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
- js/libraries/tiny_mce/plugins/emotions/img/smiley-frown.gif +0 -0
- js/libraries/tiny_mce/plugins/emotions/img/smiley-innocent.gif +0 -0
- js/libraries/tiny_mce/plugins/emotions/img/smiley-kiss.gif +0 -0
- js/libraries/tiny_mce/plugins/emotions/img/smiley-laughing.gif +0 -0
- js/libraries/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif +0 -0
- js/libraries/tiny_mce/plugins/emotions/img/smiley-sealed.gif +0 -0
- js/libraries/tiny_mce/plugins/emotions/img/smiley-smile.gif +0 -0
- js/libraries/tiny_mce/plugins/emotions/img/smiley-surprised.gif +0 -0
- js/libraries/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif +0 -0
- js/libraries/tiny_mce/plugins/emotions/img/smiley-undecided.gif +0 -0
- js/libraries/tiny_mce/plugins/emotions/img/smiley-wink.gif +0 -0
- js/libraries/tiny_mce/plugins/emotions/img/smiley-yell.gif +0 -0
- js/libraries/tiny_mce/plugins/emotions/js/emotions.js +43 -0
- js/libraries/tiny_mce/plugins/emotions/langs/en_dlg.js +1 -0
- js/libraries/tiny_mce/plugins/example/dialog.htm +22 -0
- js/libraries/tiny_mce/plugins/example/editor_plugin.js +1 -0
- js/libraries/tiny_mce/plugins/example/editor_plugin_src.js +84 -0
- js/libraries/tiny_mce/plugins/example/img/example.gif +0 -0
- js/libraries/tiny_mce/plugins/example/js/dialog.js +19 -0
- js/libraries/tiny_mce/plugins/example/langs/en.js +3 -0
- js/libraries/tiny_mce/plugins/example/langs/en_dlg.js +3 -0
- js/libraries/tiny_mce/plugins/example_dependency/editor_plugin.js +1 -0
- js/libraries/tiny_mce/plugins/example_dependency/editor_plugin_src.js +50 -0
- js/libraries/tiny_mce/plugins/fullpage/css/fullpage.css +143 -0
- js/libraries/tiny_mce/plugins/fullpage/editor_plugin.js +1 -0
- js/libraries/tiny_mce/plugins/fullpage/editor_plugin_src.js +405 -0
- js/libraries/tiny_mce/plugins/fullpage/fullpage.htm +259 -0
- js/libraries/tiny_mce/plugins/fullpage/js/fullpage.js +116 -0
css/admin-ab-testing.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
/******************************************************* ab testing admin css */
|
css/admin-global-settings.css
ADDED
@@ -0,0 +1,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:480px;
|
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 |
+
width: 25%;
|
104 |
+
}
|
105 |
+
#more-templates , #more-addons, #custom-templates {
|
106 |
+
width: 29%;
|
107 |
+
display: inline-block;
|
108 |
+
background: #FCFDFE;
|
109 |
+
padding: 5px;
|
110 |
+
margin-right: 10px;
|
111 |
+
border: 1px solid #E0E0E0;
|
112 |
+
-moz-border-radius: 7px;
|
113 |
+
border-radius: 7px;
|
114 |
+
overflow: hidden;
|
115 |
+
position: relative;
|
116 |
+
}
|
117 |
+
#more-templates img, #more-addons img, #custom-templates img {
|
118 |
+
margin: auto;
|
119 |
+
}
|
120 |
+
#php-sql-lp-version {
|
121 |
+
margin-top:25px; display:block; padding-top: 10px;margin-left:10px;postion:relative;color:#a9a9a9
|
122 |
+
}
|
123 |
+
.lp-tab-display
|
124 |
+
{
|
125 |
+
padding:13px;
|
126 |
+
}
|
127 |
+
|
128 |
+
.lp-tab-display td
|
129 |
+
{
|
130 |
+
padding:10px;
|
131 |
+
}
|
132 |
+
.lp-tab-display th
|
133 |
+
{
|
134 |
+
padding:10px;
|
135 |
+
}
|
136 |
+
|
137 |
+
.lp-tab-display th,.lp-tab-display .lp-gs-th
|
138 |
+
{
|
139 |
+
width:300px;
|
140 |
+
font-size: 14px;
|
141 |
+
font-weight:300px;
|
142 |
+
text-align:left;
|
143 |
+
}
|
144 |
+
|
145 |
+
.lp_license_status_invalid{
|
146 |
+
display:inline;
|
147 |
+
padding-left:10px;
|
148 |
+
color:red;
|
149 |
+
font-style:italic;
|
150 |
+
}
|
151 |
+
|
152 |
+
.lp_license_status_valid{
|
153 |
+
display:inline;
|
154 |
+
padding-left:10px;
|
155 |
+
color:green;
|
156 |
+
font-style:italic;
|
157 |
+
}
|
158 |
+
#php-sql-lp-version {
|
159 |
+
display: none;
|
160 |
+
}
|
css/admin-landing-page-list.css
ADDED
@@ -0,0 +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 |
+
}
|
css/admin-lp-cpt-only-style.css
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#main-title-area #lp-main-headline {
|
2 |
+
width: 100%;
|
3 |
+
height: 31px;
|
4 |
+
font-size: 1.7em;
|
5 |
+
line-height: 100%;
|
6 |
+
outline: 0 none;
|
7 |
+
padding: 3px 7px;
|
8 |
+
}
|
9 |
+
#main-title-header h3 {
|
10 |
+
display: inline-block;
|
11 |
+
padding-left: 0px;
|
12 |
+
}
|
13 |
+
#titlediv {
|
14 |
+
margin-bottom: 0px;
|
15 |
+
}
|
16 |
+
#edit-slug-box {
|
17 |
+
margin-top: 0px;
|
18 |
+
}
|
css/admin-post-edit.css
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
25 |
+
.lp-delete-var-stats, .lp-clear-success {
|
26 |
+
color: red;
|
27 |
+
opacity: .7;
|
28 |
+
font-size: 9px;
|
29 |
+
float: right;
|
30 |
+
font-weight: normal;
|
31 |
+
}
|
32 |
+
|
33 |
+
.lp-clear-success{
|
34 |
+
color: green;
|
35 |
+
}
|
36 |
+
|
37 |
+
#post-body-content .a_b_tabs {
|
38 |
+
padding: 0px;
|
39 |
+
margin-bottom: 9px;
|
40 |
+
margin-left: -18px;
|
41 |
+
padding-left: 22px;
|
42 |
+
margin-top: 5px;
|
43 |
+
margin-right: -20px;
|
44 |
+
position: relative;
|
45 |
+
}
|
46 |
+
|
47 |
+
#wp-landing-page-myeditor-wrap #landing-page-myeditor_path_row {
|
48 |
+
display: none;
|
49 |
+
}
|
50 |
+
|
51 |
+
#wp-landing-page-myeditor-wrap #wp-landing-page-myeditor-editor-container {
|
52 |
+
min-height: 200px;
|
53 |
+
}
|
54 |
+
|
55 |
+
#adminmenu .wp-menu-arrow div {
|
56 |
+
left: -2px;
|
57 |
+
}
|
58 |
+
|
59 |
+
#add-lp-notes {
|
60 |
+
display: none;
|
61 |
+
vertical-align: middle;
|
62 |
+
font-weight: 600;
|
63 |
+
padding-right: 2px;
|
64 |
+
}
|
65 |
+
|
66 |
+
.add-new-h2, #lp-current-view, #switch-lp, #preview-action {
|
67 |
+
display: none;
|
68 |
+
}
|
69 |
+
|
70 |
+
#lp-notes-area {
|
71 |
+
position: relative;
|
72 |
+
}
|
73 |
+
|
74 |
+
#post-body-content #main-title-area {
|
75 |
+
margin-top: 5px;
|
76 |
+
margin-bottom: 15px;
|
77 |
+
position: relative;
|
78 |
+
}
|
79 |
+
|
80 |
+
#main-title-area .button-primary.new-save-lp {
|
81 |
+
position: absolute !important;
|
82 |
+
top: 1px !important;
|
83 |
+
font-size: 17px !important;
|
84 |
+
padding-top: 3px !important;
|
85 |
+
right: 0px !important;
|
86 |
+
height: 31px !important;
|
87 |
+
width: 70px !important;
|
88 |
+
}
|
89 |
+
#lp-notes-area .button-primary.new-save-lp {
|
90 |
+
position: absolute !important;
|
91 |
+
top: 0px !important;
|
92 |
+
font-size: 14px !important;
|
93 |
+
padding-top: 0px !important;
|
94 |
+
right: 0px !important;
|
95 |
+
height: 24px !important;
|
96 |
+
width: 66px !important;
|
97 |
+
}
|
98 |
+
#main-title-area .lp-success-message, #lp-notes-area .lp-success-message {
|
99 |
+
position: absolute !important;
|
100 |
+
top: 1px !important;
|
101 |
+
font-size: 11px !important;
|
102 |
+
padding-top: 3px !important;
|
103 |
+
right: 0px !important;
|
104 |
+
height: 17px !important;
|
105 |
+
vertical-align: middle;
|
106 |
+
margin-top: 0px;
|
107 |
+
padding-bottom: 0px;
|
108 |
+
}
|
109 |
+
|
110 |
+
#main-title-area .button-primary.new-save-lp {
|
111 |
+
padding-top: 6px !important;
|
112 |
+
}
|
113 |
+
|
114 |
+
#main-title-area .lp-success-message {
|
115 |
+
margin-top: 4px;
|
116 |
+
}
|
117 |
+
#post-body .new-save-lp-frontend {
|
118 |
+
font-weight: 200;
|
119 |
+
top: 2px;
|
120 |
+
font-size: 14px;
|
121 |
+
margin-left: 21px;
|
122 |
+
line-height: 28px;
|
123 |
+
height: 30px;
|
124 |
+
float:right;
|
125 |
+
margin-right:19px;
|
126 |
+
}
|
css/admin-post-new.css
ADDED
@@ -0,0 +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 |
+
}
|
css/admin-split-testing-splash.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
color: #999;
|
1 |
color: #999;
|
2 |
color: #999;
|
3 |
-
webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
|
4 |
-
webkit-border-radius: 3px;
|
5 |
-
webkit-appearance: none;
|
6 |
-
webkit-box-sizing: border-box;
|
7 |
-
moz-box-sizing: border-box;
|
8 |
-
webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
|
1 |
+
::-webkit-input-placeholder {
|
2 |
color: #999;
|
3 |
color: #999;
|
4 |
color: #999;
|
|
|
|
|
|
|
|
|
|
|
|
css/admin-split-testing.css
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
text-align:left;
|
1 |
text-align:left;
|
2 |
border-top-left-radius: 3px;
|
3 |
border-top-right-radius: 3px;
|
4 |
border-width: 1px 1px 0;
|
5 |
color: #AAAAAA;
|
6 |
display: inline-block;
|
7 |
font-size: 12px;
|
8 |
line-height: 16px;
|
9 |
margin: 0 6px -1px 0;
|
10 |
padding: 4px 14px 6px;
|
11 |
text-decoration: none;
|
12 |
text-shadow: 0 1px 0 #FFFFFF;
|
13 |
border-top-left-radius: 3px;
|
14 |
border-top-right-radius: 3px;
|
15 |
border-width: 1px 1px 0;
|
16 |
color: #000;
|
17 |
display: inline-block;
|
18 |
font-size: 12px;
|
19 |
line-height: 16px;
|
20 |
margin: 0 6px -1px 0;
|
21 |
padding: 4px 14px 6px;
|
22 |
text-decoration: none;
|
23 |
text-shadow: 0 1px 0 #FFFFFF;
|
1 |
+
.lp-st-container, .lp-st-table
|
2 |
text-align:left;
|
3 |
text-align:left;
|
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 |
border-top-left-radius: 3px;
|
16 |
border-top-right-radius: 3px;
|
17 |
border-width: 1px 1px 0;
|
18 |
color: #000;
|
19 |
display: inline-block;
|
20 |
font-size: 12px;
|
21 |
line-height: 16px;
|
22 |
margin: 0 6px -1px 0;
|
23 |
padding: 4px 14px 6px;
|
24 |
text-decoration: none;
|
25 |
text-shadow: 0 1px 0 #FFFFFF;
|
css/admin-style.css
ADDED
@@ -0,0 +1,434 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
* { margin: 0; padding: 0; }
|
2 |
+
|
3 |
+
.wp-admin #footer { display: none !important }
|
4 |
+
|
5 |
+
#wpfooter {display: none !important;}
|
6 |
+
|
7 |
+
.cat-block
|
8 |
+
{
|
9 |
+
display:inline-table;
|
10 |
+
padding-right:60px;
|
11 |
+
}
|
12 |
+
|
13 |
+
#main-title-area
|
14 |
+
{
|
15 |
+
margin-top: 5px;
|
16 |
+
}
|
17 |
+
|
18 |
+
.menu-icon-landing-page .wp-submenu li:last-child
|
19 |
+
{
|
20 |
+
display: none;
|
21 |
+
}
|
22 |
+
#setting-error-tgmpa p:nth-child(2) strong em {
|
23 |
+
margin-top: 5px;
|
24 |
+
}
|
25 |
+
#setting-error-tgmpa em {
|
26 |
+
display: block;
|
27 |
+
}
|
28 |
+
#add-landing-page.hide-if-js {
|
29 |
+
display: block !important;
|
30 |
+
}
|
31 |
+
#setting-error-tgmpa {
|
32 |
+
padding-bottom: 5px;
|
33 |
+
padding-top: 5px;
|
34 |
+
padding-left: 10px;
|
35 |
+
}
|
36 |
+
#setting-error-tgmpa a.thickbox {
|
37 |
+
font-size: 16px;
|
38 |
+
padding-top: 5px;
|
39 |
+
display: inline-block;
|
40 |
+
padding-bottom: 5px;
|
41 |
+
}
|
42 |
+
#setting-error-tgmpa.updated p {
|
43 |
+
width: 99%;
|
44 |
+
margin: 0px;
|
45 |
+
}
|
46 |
+
#setting-error-tgmpa a span {
|
47 |
+
color: #000 !important;
|
48 |
+
text-decoration: none;
|
49 |
+
font-size: 14px !important;
|
50 |
+
font-style: normal !important;
|
51 |
+
font-weight: normal !important;
|
52 |
+
}
|
53 |
+
#template-box, .thumbnail-lander img {
|
54 |
+
background: #FCFDFE;
|
55 |
+
padding: 3%;
|
56 |
+
margin-right: 10px;
|
57 |
+
border: 1px solid #E0E0E0;
|
58 |
+
-moz-border-radius: 7px;
|
59 |
+
border-radius: 7px;
|
60 |
+
position: relative;
|
61 |
+
overflow: hidden;
|
62 |
+
display: block;
|
63 |
+
}
|
64 |
+
#postexcerpt p {
|
65 |
+
display: none;
|
66 |
+
}
|
67 |
+
.metabox-holder .postbox-container .empty-container
|
68 |
+
{
|
69 |
+
border: none;
|
70 |
+
}
|
71 |
+
.lp_template_wrapper{
|
72 |
+
//background-color:#fff;
|
73 |
+
}
|
74 |
+
|
75 |
+
#lp_metabox_select_template .inside
|
76 |
+
{
|
77 |
+
//background-color:#fff;
|
78 |
+
//background-image:none;
|
79 |
+
}
|
80 |
+
|
81 |
+
#lp_templates_wrapper_inside { padding-left: 15px; width: 945px; margin: 0; }
|
82 |
+
|
83 |
+
.lp_template_wrapper ul li { float: left; position: relative; list-style: none; }
|
84 |
+
|
85 |
+
/*hudson*/
|
86 |
+
.lp_template_wrapper ul li label{
|
87 |
+
font-size: 14px;
|
88 |
+
font-weight: 300;
|
89 |
+
color: greytext; text-decoration: none;
|
90 |
+
//text-shadow: 0 1px 2px black;
|
91 |
+
}
|
92 |
+
|
93 |
+
/*hudson*/
|
94 |
+
.lp_template_wrapper ul li .template {
|
95 |
+
font-size: 14px;
|
96 |
+
//font-weight: bold;
|
97 |
+
color: #222222; text-decoration: none;
|
98 |
+
//text-shadow: 0 1px 2px black;
|
99 |
+
}
|
100 |
+
|
101 |
+
#lp-main-headline-wrap {margin-top: 5px;}
|
102 |
+
|
103 |
+
.lp_template_wrapper ul li:hover {
|
104 |
+
//height: 43px;
|
105 |
+
-webkit-box-shadow: 0 0px 2px black inset;
|
106 |
+
|
107 |
+
}
|
108 |
+
|
109 |
+
.lp_template_wrapper ul li ul li:hover { background: none; -webkit-box-shadow: none; -moz-box-shadow: none; height: auto; border: none; }
|
110 |
+
|
111 |
+
.lp_template_wrapper ul li .horizontal li { padding: 14px 10px 0px 0px; }
|
112 |
+
|
113 |
+
.lp_template_wrapper ul li .horizontal li:first-child { margin-left: -10px; }
|
114 |
+
|
115 |
+
.lp_template_wrapper ul li .horizontal li a { font-size: 12px; font-weight: normal; color: #c7c7c7; }
|
116 |
+
|
117 |
+
.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; }
|
118 |
+
|
119 |
+
.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; }
|
120 |
+
|
121 |
+
.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))); }
|
122 |
+
|
123 |
+
.lp_template_wrapper ul li ul li .extended p { padding: 10px; font-size: 11px; line-height: 17px; text-shadow: 0 1px 1px black; }
|
124 |
+
|
125 |
+
.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; }
|
126 |
+
|
127 |
+
.lp_template_wrapper ul li ul li .extended span { padding-left: 10px; font-size: 11px; }
|
128 |
+
|
129 |
+
.lp_template_wrapper ul li ul li .extended ul.smallNav { border-top: 1px solid rgba(141,141,141,0.50); padding: 10px; height: 100px; }
|
130 |
+
|
131 |
+
.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; }
|
132 |
+
|
133 |
+
.lp_template_wrapper ul li ul li .extended ul.smallNav li a {
|
134 |
+
color: #fff;
|
135 |
+
text-shadow: none;
|
136 |
+
font-size:12px;
|
137 |
+
}
|
138 |
+
|
139 |
+
.lp_template_wrapper ul li ul li .extended ul.smallNav li label{
|
140 |
+
color: #c7c7c7;
|
141 |
+
text-shadow: none;
|
142 |
+
font-size:12px;
|
143 |
+
text-decoration:none;
|
144 |
+
}
|
145 |
+
|
146 |
+
.lp-feature-link
|
147 |
+
{
|
148 |
+
float:none;
|
149 |
+
margin:0px;
|
150 |
+
display:block;
|
151 |
+
padding:2px;
|
152 |
+
}
|
153 |
+
|
154 |
+
.lp-feature-link .lp-feature-link-img
|
155 |
+
{
|
156 |
+
padding:2px;
|
157 |
+
display:inline-block;
|
158 |
+
}
|
159 |
+
|
160 |
+
/*david*/
|
161 |
+
th.landing-page-table-header {width:230px; line-height: 22px;}
|
162 |
+
|
163 |
+
.default_template_highlight
|
164 |
+
{
|
165 |
+
-webkit-box-shadow: inset 0px 0px 12px 1px rgba(82, 168, 238, 1);
|
166 |
+
box-shadow: inset 0px 0px 12px 1px rgba(82, 168, 238, 1);
|
167 |
+
}
|
168 |
+
|
169 |
+
.currently_selected
|
170 |
+
{
|
171 |
+
position: absolute;
|
172 |
+
top: 72px;
|
173 |
+
left: 16px;
|
174 |
+
font-size: 22px;
|
175 |
+
line-height: 26px;
|
176 |
+
text-align: center;
|
177 |
+
background: black;
|
178 |
+
width: 180px;
|
179 |
+
height: 56px;
|
180 |
+
color: white;
|
181 |
+
opacity: 0.5;
|
182 |
+
border-radius: 7px;
|
183 |
+
}
|
184 |
+
|
185 |
+
.lp-selection-heading{width: 89%; margin-top: 20px;}
|
186 |
+
.lp-selection-heading h1 {display: inline;}
|
187 |
+
|
188 |
+
#lp-cancel-selection
|
189 |
+
{
|
190 |
+
display: inline;
|
191 |
+
float: right;
|
192 |
+
}
|
193 |
+
|
194 |
+
|
195 |
+
|
196 |
+
.lp_template_wrapper ul li ul li .extended ul.smallNav li:first-child { margin: 0; }
|
197 |
+
|
198 |
+
.lp_template_wrapper ul li ul li .extended ul.smallNav li:last-child { margin-bottom: 10px; }
|
199 |
+
|
200 |
+
.lp_template_wrapper ul li ul li:hover .extended { display: block; }
|
201 |
+
|
202 |
+
|
203 |
+
.lp_template_wrapper ul li .ultraNav
|
204 |
+
{
|
205 |
+
position: absolute;
|
206 |
+
top: 55px;
|
207 |
+
left: -100px;
|
208 |
+
width: 294px;
|
209 |
+
background: url(images/dropdownback.png);
|
210 |
+
border: 1px solid white;
|
211 |
+
-webkit-border-radius: 5px;
|
212 |
+
-moz-border-radius: 5px;
|
213 |
+
border-radius: 5px;
|
214 |
+
z-index: 500;
|
215 |
+
-moz-box-shadow: 0 3px 8px rgba(0,0,0,0.6);
|
216 |
+
-webkit-box-shadow: 0 3px 8px rgba(0,0,0,0.6) box-shadow: 0 3px 8px black;
|
217 |
+
display: none;
|
218 |
+
}
|
219 |
+
|
220 |
+
.ultraNav h2 { text-align: center; padding-left:10px;padding-top:10px;}
|
221 |
+
|
222 |
+
.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; }
|
223 |
+
|
224 |
+
.lp_template_wrapper ul li .ultra:first-child { margin: 0; }
|
225 |
+
|
226 |
+
.lp_template_wrapper ul li .ultraNav .arrow-up { left: 130px; }
|
227 |
+
|
228 |
+
.lp_template_wrapper ul li .ultra a { font-weight: normal; font-size: 12px; color: #c7c7c7; text-shadow: 0 1px 2px black; }
|
229 |
+
|
230 |
+
.lp_template_wrapper ul li .ultra li { width: 120px; line-height: 20px; padding: 3px 5px; background: url(images/linkback.png) no-repeat; }
|
231 |
+
|
232 |
+
.lp_template_wrapper ul li:hover .ultraNav { display: block; }
|
233 |
+
|
234 |
+
#lp_template_change h2 {display: inline-block;}
|
235 |
+
|
236 |
+
#lp_template_change {
|
237 |
+
margin-left: 17px;
|
238 |
+
margin-top: -25px;
|
239 |
+
float: right;
|
240 |
+
}
|
241 |
+
|
242 |
+
/* Split Testing Splash */
|
243 |
+
.lp_tooltip, .lp_tooltip_templates {background: url('/wp-content/plugins/landing-pages/css/images/question-light.png');
|
244 |
+
width: 15px;
|
245 |
+
height: 15px;
|
246 |
+
display: inline-block;
|
247 |
+
margin-left: 5px;
|
248 |
+
vertical-align: middle;
|
249 |
+
cursor: help;
|
250 |
+
background-repeat: no-repeat;
|
251 |
+
}
|
252 |
+
.qtip-content {
|
253 |
+
position: relative;
|
254 |
+
padding: 5px 9px;
|
255 |
+
overflow: hidden;
|
256 |
+
text-align: left;
|
257 |
+
word-wrap: break-word;
|
258 |
+
line-height: 19px;
|
259 |
+
}
|
260 |
+
.tool_date{margin-left: 25px;
|
261 |
+
vertical-align: top;}
|
262 |
+
.tool_textarea {vertical-align: top;}
|
263 |
+
.tool_color {margin-top:1px;}
|
264 |
+
.tool_checkbox {vertical-align: top; margin-top: 4px;}
|
265 |
+
.lp_check_box_table td {padding: 0px;}
|
266 |
+
.lp_check_box_table {display: inline; float: left;}
|
267 |
+
|
268 |
+
/* Split Testing */
|
269 |
+
.lp_toggle_pause {color:red;}
|
270 |
+
.lp_toggle_play {color:green;}
|
271 |
+
/*store*/
|
272 |
+
|
273 |
+
/* iframe's parent node */
|
274 |
+
div#lp-store-iframe-container {
|
275 |
+
// position: fixed;
|
276 |
+
width: 100%;
|
277 |
+
height: 100%;
|
278 |
+
overflow:hidden;
|
279 |
+
}
|
280 |
+
|
281 |
+
/* iframe itself */
|
282 |
+
div#lp-store-iframe-container > iframe {
|
283 |
+
display: block;
|
284 |
+
width: 100%;
|
285 |
+
height: 100%;
|
286 |
+
border: none;
|
287 |
+
margin-left:0px;
|
288 |
+
}
|
289 |
+
|
290 |
+
.column-thumbnail
|
291 |
+
{
|
292 |
+
height:110px;
|
293 |
+
}
|
294 |
+
|
295 |
+
.wp-list-table .column-date
|
296 |
+
{
|
297 |
+
width:128px;
|
298 |
+
}
|
299 |
+
.wp-list-table .details
|
300 |
+
{
|
301 |
+
text-align:left;
|
302 |
+
padding-left:20px;
|
303 |
+
}
|
304 |
+
|
305 |
+
#leads-table-container-inside
|
306 |
+
{
|
307 |
+
margin-top:-36px;
|
308 |
+
color:#388DBC;
|
309 |
+
}
|
310 |
+
|
311 |
+
.wp-list-table td
|
312 |
+
{
|
313 |
+
color:#388DBC;
|
314 |
+
}
|
315 |
+
|
316 |
+
#wp-leads-splash-header
|
317 |
+
{
|
318 |
+
background: #f2f2f2 url('/wp-content/plugins/landing-pages/images/gradient.png') repeat-x top left;
|
319 |
+
border-bottom: 1px solid #EBEBEA;
|
320 |
+
-webkit-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.3);
|
321 |
+
-moz-box-shadow: inset 1px 1px 1px rgba(255,255,255,0.3);
|
322 |
+
box-shadow: inset 1px 1px 1px rgba(255,255,255,0.3);
|
323 |
+
padding: 20px;
|
324 |
+
text-shadow: 1px 1px 1px #fff;
|
325 |
+
}
|
326 |
+
|
327 |
+
#lead-details-container
|
328 |
+
{
|
329 |
+
border: 1px solid #EBEBEA;
|
330 |
+
}
|
331 |
+
|
332 |
+
#wp-leads-splash-email, #wp-leads-splash-ip, #wp-leads-splash-city, #wp-leads-splash-state, #wp-leads-splash-name
|
333 |
+
{
|
334 |
+
border-bottom: 1px solid #EBEBEA;
|
335 |
+
padding: 10px 20px;
|
336 |
+
}
|
337 |
+
|
338 |
+
|
339 |
+
#wp-leads-extra-data
|
340 |
+
{
|
341 |
+
margin-left: 20px;
|
342 |
+
margin-top: 5px;
|
343 |
+
}
|
344 |
+
|
345 |
+
#wp-leads-extra-data td
|
346 |
+
{
|
347 |
+
padding-right: 15px;
|
348 |
+
}
|
349 |
+
|
350 |
+
.wplp-green-button
|
351 |
+
{
|
352 |
+
background: #94BA65 url('/wp-content/plugins/landing-pages/images/gradient.png') repeat-x top left;
|
353 |
+
border: 1px solid rgba(0,0,0,0.15);
|
354 |
+
-webkit-border-radius: 2px;
|
355 |
+
-moz-border-radius: 2px;
|
356 |
+
border-radius: 2px;
|
357 |
+
-webkit-box-shadow: 0px 2px 3px rgba(0,0,0,0.15), inset 1px 1px 1px rgba(255,255,255,0.2);
|
358 |
+
-moz-box-shadow: 0px 2px 3px rgba(0,0,0,0.15), inset 1px 1px 1px rgba(255,255,255,0.2);
|
359 |
+
box-shadow: 0px 2px 3px rgba(0,0,0,0.15), inset 1px 1px 1px rgba(255,255,255,0.2);
|
360 |
+
color: #fff;
|
361 |
+
cursor: pointer;
|
362 |
+
display: inline-block;
|
363 |
+
font-family: inherit;
|
364 |
+
font-size: 14px;
|
365 |
+
font-weight: bold;
|
366 |
+
padding: 4px 5px;
|
367 |
+
text-shadow: -1px -1px 1px rgba(0,0,0,0.15);
|
368 |
+
text-decoration: none;
|
369 |
+
}
|
370 |
+
.wplp-right
|
371 |
+
{
|
372 |
+
float: right;
|
373 |
+
}
|
374 |
+
|
375 |
+
.lp-lead-splash-h3, .wp-lead-label
|
376 |
+
{
|
377 |
+
display: inline;
|
378 |
+
}
|
379 |
+
|
380 |
+
.wp-lead-label
|
381 |
+
{
|
382 |
+
font-weight: bold;
|
383 |
+
}
|
384 |
+
|
385 |
+
#leads-table-container-inside .wp-list-table .details
|
386 |
+
{
|
387 |
+
padding-left: 0px;
|
388 |
+
}
|
389 |
+
|
390 |
+
#leads-table-container-inside .wp-list-table .column-date
|
391 |
+
{
|
392 |
+
width: 150px;
|
393 |
+
}
|
394 |
+
.date-picker .new-save-lp
|
395 |
+
{
|
396 |
+
display: none;
|
397 |
+
}
|
398 |
+
#lp-tour {
|
399 |
+
position: absolute;
|
400 |
+
font-size: 13px;
|
401 |
+
top: -3px;
|
402 |
+
right: 148px;
|
403 |
+
}
|
404 |
+
.lp-success-message
|
405 |
+
{
|
406 |
+
background: #e2ffc9;
|
407 |
+
border: 1px solid #c5eda3;
|
408 |
+
padding: 4px 10px 4px 10px;
|
409 |
+
margin-left: 10px;
|
410 |
+
-webkit-border-radius: 3px;
|
411 |
+
-moz-border-radius: 3px;
|
412 |
+
border-radius: 3px;
|
413 |
+
position: relative;
|
414 |
+
margin-top: 10px;
|
415 |
+
text-shadow: 1px 1px 1px rgba(255,255,255,0.5);
|
416 |
+
}
|
417 |
+
|
418 |
+
tr.media-id p.description {
|
419 |
+
display: inline-block;
|
420 |
+
}
|
421 |
+
div.capty-caption {
|
422 |
+
background-color: #000000;
|
423 |
+
color: #FFFFFF;
|
424 |
+
font: bold 11px verdana;
|
425 |
+
padding-left: 10px;
|
426 |
+
padding-top: 7px;
|
427 |
+
text-shadow: 1px 1px 0 #222222;
|
428 |
+
}
|
429 |
+
div.capty-caption a {
|
430 |
+
color: #318DAD;
|
431 |
+
font: bold 11px verdana;
|
432 |
+
text-decoration: none;
|
433 |
+
text-shadow: none;
|
434 |
+
}
|
css/admin-templates.css
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.update-message {
|
2 |
+
background-color: #FFFBE4;
|
3 |
+
border-color: #DFDFDF;
|
4 |
+
border-bottom-color: #DFDFDF;
|
5 |
+
border-top-color: #FFFFFF;
|
6 |
+
padding:3px;
|
7 |
+
}
|
8 |
+
|
9 |
+
.update-available
|
10 |
+
{
|
11 |
+
font-weight:600;
|
12 |
+
color:cadetblue;
|
13 |
+
}
|
14 |
+
|
15 |
+
.template-thumbnail {
|
16 |
+
background-color: #A9A9A9;
|
17 |
+
border-radius: 2px;
|
18 |
+
height: 120px;
|
19 |
+
width: 150px;
|
20 |
+
padding:6px;
|
21 |
+
}
|
22 |
+
|
23 |
+
.wp-list-table .column-thumbnail
|
24 |
+
{
|
25 |
+
height:0px;
|
26 |
+
}
|
27 |
+
|
28 |
+
.capty-wrapper
|
29 |
+
{
|
30 |
+
margin-left:20px;
|
31 |
+
height:140px;
|
32 |
+
}
|
33 |
+
|
34 |
+
.column-template
|
35 |
+
{
|
36 |
+
width:200px;
|
37 |
+
}
|
38 |
+
|
39 |
+
.column-description
|
40 |
+
{
|
41 |
+
width:377px;
|
42 |
+
font-style:italic;
|
43 |
+
}
|
44 |
+
|
45 |
+
.column-category
|
46 |
+
{
|
47 |
+
width:160px;
|
48 |
+
}
|
css/admin-tour.css
ADDED
@@ -0,0 +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 |
+
}
|
css/customizer-ab-testing.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
#variation-list {
|
css/customizer-load.css
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.lp-customizer-overlay
|
2 |
+
{
|
3 |
+
position: absolute;
|
4 |
+
z-index: 999999;
|
5 |
+
background-color: #000;
|
6 |
+
opacity: 0;
|
7 |
+
background: -moz-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
8 |
+
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)));
|
9 |
+
background: -webkit-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
10 |
+
background: -o-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
11 |
+
background: -ms-radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
12 |
+
background: radial-gradient(center,ellipse cover,rgba(0,0,0,0.4) 0,rgba(0,0,0,0.9) 100%);
|
13 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#66000000',endColorstr='#e6000000',GradientType=1);
|
14 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
|
15 |
+
filter: alpha(opacity=50);
|
16 |
+
-webkit-transition: all 0.3s ease-out;
|
17 |
+
-moz-transition: all 0.3s ease-out;
|
18 |
+
-ms-transition: all 0.3s ease-out;
|
19 |
+
-o-transition: all 0.3s ease-out;
|
20 |
+
transition: all 0.3s ease-out;
|
21 |
+
}
|
22 |
+
html {
|
23 |
+
margin-top: 0px !important;
|
24 |
+
}
|
25 |
+
.live-preview-active
|
26 |
+
{
|
27 |
+
background-color: gray;
|
28 |
+
background-image: repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.5) 35px, rgba(255,255,255,.5) 70px);
|
29 |
+
}
|
30 |
+
.live-preview-area-box {
|
31 |
+
display:inline-block;
|
32 |
+
}
|
33 |
+
.lp-see-this {
|
34 |
+
color:#000000 !important;
|
35 |
+
}
|
36 |
+
.live-preview-active {
|
37 |
+
background: rgba(253, 253, 252, 1) url('/wp-content/plugins/landing-pages/images/gradient.png') repeat-x top left;
|
38 |
+
border-radius: 0px;
|
39 |
+
padding: 0px;
|
40 |
+
outline: 2px dashed rgb(255, 0, 0);
|
41 |
+
-webkit-box-shadow: 0px 0px 35px rgba(50, 50, 50, 1);
|
42 |
+
-moz-box-shadow: 0px 0px 35px rgba(50, 50, 50, 1);
|
43 |
+
box-shadow: 0px 0px 35px rgba(50, 50, 50, 1);
|
44 |
+
z-index: 99999999;
|
45 |
+
}
|
46 |
+
|
47 |
+
.small-html {
|
48 |
+
height: 200%;
|
49 |
+
border: 0;
|
50 |
+
position: absolute;
|
51 |
+
top: 0;
|
52 |
+
left: 0;
|
53 |
+
background-color: #eee;
|
54 |
+
|
55 |
+
-webkit-transform: scale(.8);
|
56 |
+
-moz-transform: scale(0.8);
|
57 |
+
-ms-transform: scale(0.8);
|
58 |
+
-o-transform: scale(0.8);
|
59 |
+
transform: scale(0.8);
|
60 |
+
-webkit-transform-origin: top left;
|
61 |
+
-moz-transform-origin: top left;
|
62 |
+
-ms-transform-origin: top left;
|
63 |
+
-o-transform-origin: top left;
|
64 |
+
transform-origin: top left;
|
65 |
+
-webkit-transition: opacity 0.4s ease;
|
66 |
+
-moz-transition: opacity 0.4s ease;
|
67 |
+
-o-transition: opacity 0.4s ease;
|
68 |
+
transition: opacity 0.4s ease;
|
69 |
+
}
|
css/customizer.frontend.css
ADDED
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
html.wp-toolbar {
|
2 |
+
padding-top: 0px;
|
3 |
+
}
|
4 |
+
body {
|
5 |
+
min-width: 400px !important;
|
6 |
+
}
|
7 |
+
#wpadminbar, #adminmenuback, #current_variation_id, #post_ID {
|
8 |
+
display: none !important;
|
9 |
+
}
|
10 |
+
#adminmenuwrap {display: none !important;}
|
11 |
+
.auto-fold #wpcontent {
|
12 |
+
margin-left: 0px;
|
13 |
+
}
|
14 |
+
.jPicker .Icon {
|
15 |
+
height: 23px;}
|
16 |
+
|
17 |
+
#lp-options-controls {
|
18 |
+
position: absolute;
|
19 |
+
top: 13px;
|
20 |
+
right: 10px;
|
21 |
+
}
|
22 |
+
#lp-frontend-options-container {
|
23 |
+
padding-left: 8px;
|
24 |
+
padding-right: 8px;
|
25 |
+
z-index: 99999999998 !important;
|
26 |
+
}
|
27 |
+
#lp-top-box {
|
28 |
+
background: #eaeaea;
|
29 |
+
width: 100%;
|
30 |
+
height: 42px;
|
31 |
+
border-bottom: rgba(206, 206, 206, 0.5);
|
32 |
+
border-width: 1px;
|
33 |
+
border-style: solid;
|
34 |
+
|
35 |
+
}
|
36 |
+
.mceToolbar.mceToolbarRow1.Enabled td {
|
37 |
+
display: inline-block !important;
|
38 |
+
}
|
39 |
+
.media-modal {
|
40 |
+
position: fixed;
|
41 |
+
top: 45px !important;}
|
42 |
+
|
43 |
+
.mceStatusbar.mceFirst.mceLast div {
|
44 |
+
display: none !important;
|
45 |
+
}
|
46 |
+
.media-modal {
|
47 |
+
width: 473px !important;
|
48 |
+
left:10px !important;
|
49 |
+
position: absolute;
|
50 |
+
}
|
51 |
+
input[type="radio"] {
|
52 |
+
margin-left: 5px;
|
53 |
+
vertical-align: middle;
|
54 |
+
}
|
55 |
+
/* #wpcontent, body {
|
56 |
+
min-width: 470px !important;
|
57 |
+
} */
|
58 |
+
.click-this {
|
59 |
+
display: none;
|
60 |
+
}
|
61 |
+
.jPicker .Grid {
|
62 |
+
display: none;
|
63 |
+
}
|
64 |
+
.jPicker .Button {
|
65 |
+
text-align: center;
|
66 |
+
padding: 0 4px;
|
67 |
+
width: 264px;
|
68 |
+
position: absolute;
|
69 |
+
border-bottom: none;
|
70 |
+
left: 0px;
|
71 |
+
bottom: 3px;
|
72 |
+
}
|
73 |
+
.jPicker .Button input {
|
74 |
+
font-size: 18px !important;
|
75 |
+
}
|
76 |
+
.jPicker .Icon span.Color, .jPicker .Icon span.Alpha {
|
77 |
+
width: 97% !important;
|
78 |
+
}
|
79 |
+
.jPicker .Title {
|
80 |
+
width: 254px;
|
81 |
+
}
|
82 |
+
.landing-page-option-td {
|
83 |
+
position: relative;
|
84 |
+
}
|
85 |
+
.media-modal-backdrop, .media-modal {
|
86 |
+
position: fixed !important;
|
87 |
+
}
|
88 |
+
.upload_image_button {
|
89 |
+
background: #f3f3f3;
|
90 |
+
background-image: -webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#f4f4f4));
|
91 |
+
background-image: -webkit-linear-gradient(top,#fefefe,#f4f4f4);
|
92 |
+
background-image: -moz-linear-gradient(top,#fefefe,#f4f4f4);
|
93 |
+
background-image: -o-linear-gradient(top,#fefefe,#f4f4f4);
|
94 |
+
background-image: linear-gradient(to bottom,#fefefe,#f4f4f4);
|
95 |
+
border-color: #bbb;
|
96 |
+
color: #333;
|
97 |
+
text-shadow: 0 1px 0 #fff;
|
98 |
+
display: inline-block;
|
99 |
+
text-decoration: none;
|
100 |
+
font-size: 12px;
|
101 |
+
line-height: 23px;
|
102 |
+
height: 24px;
|
103 |
+
margin: 0;
|
104 |
+
padding: 0 10px 1px;
|
105 |
+
cursor: pointer;
|
106 |
+
border-width: 1px;
|
107 |
+
border-style: solid;
|
108 |
+
-webkit-border-radius: 3px;
|
109 |
+
-webkit-appearance: none;
|
110 |
+
border-radius: 3px;
|
111 |
+
white-space: nowrap;
|
112 |
+
-webkit-box-sizing: border-box;
|
113 |
+
-moz-box-sizing: border-box;
|
114 |
+
box-sizing: border-box;
|
115 |
+
}
|
116 |
+
#media-items {
|
117 |
+
width: 311px !important;
|
118 |
+
}
|
119 |
+
.variation-letter-top {
|
120 |
+
border-radius: 3px;
|
121 |
+
border-style: solid;
|
122 |
+
border-width: 1px;
|
123 |
+
padding: 1px;
|
124 |
+
padding-left: 4px;
|
125 |
+
padding-right: 5px;
|
126 |
+
background: #fff;
|
127 |
+
display: inline-block;
|
128 |
+
margin-right: 10px;
|
129 |
+
}
|
130 |
+
.the-title input {
|
131 |
+
width: 78%;
|
132 |
+
}
|
133 |
+
table.jPicker {
|
134 |
+
width: 445px;}
|
135 |
+
|
136 |
+
html {
|
137 |
+
background: #f5f5f5;
|
138 |
+
border-right: 1px solid rgba(0,0,0,0.2);
|
139 |
+
}
|
140 |
+
.landing-page-option-row {
|
141 |
+
padding-top: 10px;
|
142 |
+
padding-left: 3px;
|
143 |
+
padding-bottom:0px;
|
144 |
+
padding-right: 0px;
|
145 |
+
clear: both;
|
146 |
+
}
|
147 |
+
.landing-page-table-header {
|
148 |
+
font-size: 17px;
|
149 |
+
padding-bottom: 5px;
|
150 |
+
padding-left: 2px;
|
151 |
+
}
|
152 |
+
h1 {
|
153 |
+
line-height: 28px;
|
154 |
+
margin-bottom: 0px;
|
155 |
+
margin-top: 10px;
|
156 |
+
}
|
css/customizer.media-uploader.css
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
.savesend input.button {
|
12 |
+
background-color: #21759b;
|
13 |
+
background-image: -webkit-gradient(linear,left top,left bottom,from(#2a95c5),to(#21759b));
|
14 |
+
background-image: -webkit-linear-gradient(top,#2a95c5,#21759b);
|
15 |
+
background-image: -moz-linear-gradient(top,#2a95c5,#21759b);
|
16 |
+
background-image: -ms-linear-gradient(top,#2a95c5,#21759b);
|
17 |
+
background-image: -o-linear-gradient(top,#2a95c5,#21759b);
|
18 |
+
background-image: linear-gradient(to bottom,#2a95c5,#21759b);
|
19 |
+
border-color: #21759b;
|
20 |
+
border-bottom-color: #1e6a8d;
|
21 |
+
-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
|
22 |
+
box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
|
23 |
+
color: #fff;
|
24 |
+
text-decoration: none;
|
25 |
+
text-shadow: 0 1px 0 rgba(0,0,0,0.1);
|
26 |
+
height: 35px;
|
27 |
+
font-size: 20px;
|
28 |
+
}
|
css/images/Navigation.png
ADDED
Binary file
|
css/images/blank-page.png
ADDED
Binary file
|
css/images/clone-create.png
ADDED
Binary file
|
css/images/dropdownback.png
ADDED
Binary file
|
css/images/headerback.png
ADDED
Binary file
|
css/images/hover.png
ADDED
Binary file
|
css/images/landing-page-icon-10.png
ADDED
Binary file
|
css/images/linkback.png
ADDED
Binary file
|
css/images/question-light.png
ADDED
Binary file
|
css/images/select-pages.png
ADDED
Binary file
|
css/images/tooltip.png
ADDED
Binary file
|
css/jquery.qtip.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
/*! qtip2 v2.0.0 | http://craigsworks.com/projects/qtip2/ | Licensed MIT, GPL */.qtip,.qtip{position:absolute;left:-28000px;top:-28000px;display:none;max-width:700px;min-width:50px;font-size:14.5px;line-height:12px;direction:ltr}.qtip-content{position:relative;padding:5px 9px;overflow:hidden;text-align:left;word-wrap:break-word}.qtip-titlebar{position:relative;padding:15px 35px 7px 8px;overflow:hidden;border-width:0 0 1px;font-weight:normal}.qtip-titlebar+.qtip-content{border-top-width:0!important}.qtip-close{position:absolute;right:-9px;top:-9px;cursor:pointer;outline:medium none;border-width:1px;border-style:solid;border-color:transparent}.qtip-titlebar .qtip-close{right:4px;top:50%;margin-top:-9px}* html .qtip-titlebar .qtip-close{top:16px}.qtip-titlebar .ui-icon,.qtip-icon .ui-icon{display:block;text-indent:-1000em;direction:ltr;vertical-align:middle}.qtip-icon,.qtip-icon .ui-icon{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;text-decoration:none}.qtip-icon .ui-icon{width:18px;height:14px;text-align:center;text-indent:0;font:normal bold 10px/13px Tahoma,sans-serif;color:inherit;background:transparent none no-repeat -100em -100em}.qtip-focus{}.qtip-hover{}.qtip-default{border-width:1px;border-style:solid;border-color:#F1D031;background-color:#FFFFA3;color:#555}.qtip-default .qtip-titlebar{background-color:#FFEF93}.qtip-default .qtip-icon{border-color:#CCC;background:#F1F1F1;color:#777}.qtip-default .qtip-titlebar .qtip-close{border-color:#AAA;color:#111}/*! Light tooltip style */.qtip-light{background-color:#fff;border-color:#E2E2E2;color:#454545}.qtip-light .qtip-titlebar{background-color:#f1f1f1}/*! Dark tooltip style */.qtip-dark{background-color:#505050;border-color:#303030;color:#f3f3f3}.qtip-dark .qtip-titlebar{background-color:#404040}.qtip-dark .qtip-icon{border-color:#444}.qtip-dark .qtip-titlebar .ui-state-hover{border-color:#303030}/*! Cream tooltip style */.qtip-cream{background-color:#FBF7AA;border-color:#F9E98E;color:#A27D35}.qtip-cream .qtip-titlebar{background-color:#F0DE7D}.qtip-cream .qtip-close .qtip-icon{background-position:-82px 0}/*! Red tooltip style */.qtip-red{background-color:#F78B83;border-color:#D95252;color:#912323}.qtip-red .qtip-titlebar{background-color:#F06D65}.qtip-red .qtip-close .qtip-icon{background-position:-102px 0}.qtip-red .qtip-icon{border-color:#D95252}.qtip-red .qtip-titlebar .ui-state-hover{border-color:#D95252}/*! Green tooltip style */.qtip-green{background-color:#CAED9E;border-color:#90D93F;color:#3F6219}.qtip-green .qtip-titlebar{background-color:#B0DE78}.qtip-green .qtip-close .qtip-icon{background-position:-42px 0}/*! Blue tooltip style */.qtip-blue{background-color:#E5F6FE;border-color:#ADD9ED;color:#5E99BD}.qtip-blue .qtip-titlebar{background-color:#D0E9F5}.qtip-blue .qtip-close .qtip-icon{background-position:-2px 0}.qtip-shadow{-webkit-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);-moz-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);box-shadow:1px 1px 3px 1px rgba(0,0,0,.15)}.qtip-rounded,.qtip-tipsy,.qtip-bootstrap{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.qtip-youtube{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 3px #333;-moz-box-shadow:0 0 3px #333;box-shadow:0 0 3px #333;color:#fff;border-width:0;background:#4A4A4A;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4A4A4A),color-stop(100%,black));background-image:-webkit-linear-gradient(top,#4A4A4A 0,black 100%);background-image:-moz-linear-gradient(top,#4A4A4A 0,black 100%);background-image:-ms-linear-gradient(top,#4A4A4A 0,black 100%);background-image:-o-linear-gradient(top,#4A4A4A 0,black 100%)}.qtip-youtube .qtip-titlebar{background-color:#4A4A4A;background-color:rgba(0,0,0,0)}.qtip-youtube .qtip-content{padding:.75em;font:12px arial,sans-serif;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);"}.qtip-youtube .qtip-icon{border-color:#222}.qtip-youtube .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-jtools{background:#232323;background:rgba(0,0,0,.7);background-image:-webkit-gradient(linear,left top,left bottom,from(#717171),to(#232323));background-image:-moz-linear-gradient(top,#717171,#232323);background-image:-webkit-linear-gradient(top,#717171,#232323);background-image:-ms-linear-gradient(top,#717171,#232323);background-image:-o-linear-gradient(top,#717171,#232323);border:2px solid #ddd;border:2px solid rgba(241,241,241,1);-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 12px #333;-moz-box-shadow:0 0 12px #333;box-shadow:0 0 12px #333}.qtip-jtools .qtip-titlebar{background-color:transparent;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A)"}.qtip-jtools .qtip-content{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323)"}.qtip-jtools .qtip-titlebar,.qtip-jtools .qtip-content{background:transparent;color:#fff;border:0 dashed transparent}.qtip-jtools .qtip-icon{border-color:#555}.qtip-jtools .qtip-titlebar .ui-state-hover{border-color:#333}.qtip-cluetip{-webkit-box-shadow:4px 4px 5px rgba(0,0,0,.4);-moz-box-shadow:4px 4px 5px rgba(0,0,0,.4);box-shadow:4px 4px 5px rgba(0,0,0,.4);background-color:#D9D9C2;color:#111;border:0 dashed transparent}.qtip-cluetip .qtip-titlebar{background-color:#87876A;color:#fff;border:0 dashed transparent}.qtip-cluetip .qtip-icon{border-color:#808064}.qtip-cluetip .qtip-titlebar .ui-state-hover{border-color:#696952;color:#696952}.qtip-tipsy{background:#000;background:rgba(0,0,0,.87);color:#fff;border:0 solid transparent;font-size:11px;font-family:'Lucida Grande',sans-serif;font-weight:700;line-height:16px;text-shadow:0 1px black}.qtip-tipsy .qtip-titlebar{padding:6px 35px 0 10;background-color:transparent}.qtip-tipsy .qtip-content{padding:6px 10}.qtip-tipsy .qtip-icon{border-color:#222;text-shadow:none}.qtip-tipsy .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-tipped{border:3px solid #959FA9;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-color:#F9F9F9;color:#454545;font-weight:400;font-family:serif}.qtip-tipped .qtip-titlebar{border-bottom-width:0;color:#fff;background:#3A79B8;background-image:-webkit-gradient(linear,left top,left bottom,from(#3A79B8),to(#2E629D));background-image:-webkit-linear-gradient(top,#3A79B8,#2E629D);background-image:-moz-linear-gradient(top,#3A79B8,#2E629D);background-image:-ms-linear-gradient(top,#3A79B8,#2E629D);background-image:-o-linear-gradient(top,#3A79B8,#2E629D);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D)"}.qtip-tipped .qtip-icon{border:2px solid #285589;background:#285589}.qtip-tipped .qtip-icon .ui-icon{background-color:#FBFBFB;color:#555}.qtip-bootstrap{font-size:14px;line-height:20px;color:#333;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.qtip-bootstrap .qtip-titlebar{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.qtip-bootstrap .qtip-titlebar .qtip-close{right:11px;top:45%;border-style:none}.qtip-bootstrap .qtip-content{padding:9px 14px}.qtip-bootstrap .qtip-icon{background:transparent}.qtip-bootstrap .qtip-icon .ui-icon{width:auto;height:auto;float:right;font-size:20px;font-weight:700;line-height:18px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.qtip-bootstrap .qtip-icon .ui-icon:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}.qtip:not(.ie9haxors) div.qtip-content,.qtip:not(.ie9haxors) div.qtip-titlebar{filter:none;-ms-filter:none}.qtip .qtip-tip{margin:0 auto;overflow:hidden;z-index:10}.qtip .qtip-tip,.qtip .qtip-tip .qtip-vml{position:absolute;color:#123456;background:transparent;border:0 dashed transparent}.qtip .qtip-tip canvas{top:0;left:0}.qtip .qtip-tip .qtip-vml{behavior:url(#default#VML);display:inline-block;visibility:visible}#qtip-overlay{position:fixed;left:-10000em;top:-10000em}#qtip-overlay.blurs{cursor:pointer}#qtip-overlay div{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#000;opacity:.7;filter:alpha(opacity=70);-ms-filter:"alpha(Opacity=70)"}.qtipmodal-ie6fix{position:absolute!important}.qtip-jtools{padding-bottom: 5px;}.qtip-title{font-size:20px;}
|
css/kool-swap.css
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@CHARSET "UTF-8";
|
2 |
+
/* This stylesheet only contains the loading box styles */
|
3 |
+
#ks-loading-box {
|
4 |
+
background: rgba(255, 255, 255, .5);
|
5 |
+
border-radius: 4px;
|
6 |
+
box-shadow: 0 0 10px rgba(0, 0, 0, .3);
|
7 |
+
bottom: 50%;
|
8 |
+
display: none;
|
9 |
+
left: 40%;
|
10 |
+
position: fixed;
|
11 |
+
right: 40%;
|
12 |
+
top: 30%;
|
13 |
+
z-index: 9999999;
|
14 |
+
}
|
15 |
+
|
16 |
+
/* Loader animations */
|
17 |
+
@keyframes spinPulse {
|
18 |
+
0% {
|
19 |
+
transform: rotate(0deg);
|
20 |
+
opacity: 0;
|
21 |
+
}
|
22 |
+
|
23 |
+
50% {
|
24 |
+
transform: rotate(180deg);
|
25 |
+
opacity: 1;
|
26 |
+
}
|
27 |
+
|
28 |
+
100% {
|
29 |
+
transform: rotate(-360deg);
|
30 |
+
opacity: 0;
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
@-moz-keyframes spinPulse {
|
35 |
+
0% {
|
36 |
+
-moz-transform: rotate(0deg);
|
37 |
+
opacity: 0;
|
38 |
+
}
|
39 |
+
|
40 |
+
50% {
|
41 |
+
-moz-transform: rotate(180deg);
|
42 |
+
opacity: 1;
|
43 |
+
}
|
44 |
+
|
45 |
+
100% {
|
46 |
+
-moz-transform: rotate(-360deg);
|
47 |
+
opacity: 0;
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
@-webkit-keyframes spinPulse {
|
52 |
+
0% {
|
53 |
+
-webkit-transform: rotate(0deg);
|
54 |
+
opacity: 0;
|
55 |
+
}
|
56 |
+
|
57 |
+
50% {
|
58 |
+
-webkit-transform: rotate(180deg);
|
59 |
+
opacity: 1;
|
60 |
+
}
|
61 |
+
|
62 |
+
100% {
|
63 |
+
-webkit-transform: rotate(-360deg);
|
64 |
+
opacity: 0;
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
@-ms-keyframes spinPulse {
|
69 |
+
0% {
|
70 |
+
-ms-transform: rotate(0deg);
|
71 |
+
opacity: 0;
|
72 |
+
}
|
73 |
+
|
74 |
+
50% {
|
75 |
+
-ms-transform: rotate(180deg);
|
76 |
+
opacity: 1;
|
77 |
+
}
|
78 |
+
|
79 |
+
100% {
|
80 |
+
-ms-transform: rotate(-360deg);
|
81 |
+
opacity: 0;
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
+
@-o-keyframes spinPulse {
|
86 |
+
0% {
|
87 |
+
-o-transform: rotate(0deg);
|
88 |
+
opacity: 0;
|
89 |
+
}
|
90 |
+
|
91 |
+
50% {
|
92 |
+
-o-transform: rotate(180deg);
|
93 |
+
opacity: 1;
|
94 |
+
}
|
95 |
+
|
96 |
+
100% {
|
97 |
+
-o-transform: rotate(-360deg);
|
98 |
+
opacity: 0;
|
99 |
+
}
|
100 |
+
}
|
101 |
+
|
102 |
+
.ks-loading {
|
103 |
+
border: 5px solid #000;
|
104 |
+
border-radius: 50px;
|
105 |
+
border-left: 5px solid rgba(255, 255, 255, 0);
|
106 |
+
border-right: 5px solid rgba(255, 255, 255, 0);
|
107 |
+
height: 26px;
|
108 |
+
left: 50%;
|
109 |
+
margin: -13px 0 0 -13px;
|
110 |
+
position: absolute;
|
111 |
+
top: 50%;
|
112 |
+
width: 26px;
|
113 |
+
animation: spinPulse 1.3s infinite linear;
|
114 |
+
-moz-animation: spinPulse 1.3s infinite linear;
|
115 |
+
-webkit-animation: spinPulse 1.3s infinite linear;
|
116 |
+
-ms-animation: spinPulse 1.3s infinite linear;
|
117 |
+
-o-animation: spinPulse 1.3s infinite linear;
|
118 |
+
}
|
functions/functions.admin.php
ADDED
@@ -0,0 +1,778 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
add_action('admin_enqueue_scripts','lp_admin_enqueue');
|
4 |
+
|
5 |
+
function lp_admin_enqueue($hook)
|
6 |
+
{
|
7 |
+
global $post;
|
8 |
+
$screen = get_current_screen(); //print_r($screen);
|
9 |
+
|
10 |
+
//enqueue styles and scripts
|
11 |
+
wp_enqueue_style('lp-admin-css', LANDINGPAGES_URLPATH . 'css/admin-style.css');
|
12 |
+
|
13 |
+
//jquery cookie
|
14 |
+
wp_dequeue_script('jquery-cookie');
|
15 |
+
wp_enqueue_script('jquery-cookie', LANDINGPAGES_URLPATH . 'js/jquery.lp.cookie.js');
|
16 |
+
|
17 |
+
// Frontend Editor
|
18 |
+
if ((isset($_GET['page']) == 'lp-frontend-editor')) {
|
19 |
+
// scripts soon
|
20 |
+
}
|
21 |
+
|
22 |
+
// Store Options Page
|
23 |
+
if (isset($_GET['page']) && (($_GET['page'] == 'lp_store') || ($_GET['page'] == 'lp_addons')))
|
24 |
+
{
|
25 |
+
wp_dequeue_script('easyXDM');
|
26 |
+
wp_enqueue_script('easyXDM', LANDINGPAGES_URLPATH . 'js/libraries/easyXDM.debug.js');
|
27 |
+
//wp_enqueue_script('lp-js-store', LANDINGPAGES_URLPATH . 'js/admin/admin.store.js');
|
28 |
+
}
|
29 |
+
|
30 |
+
// Admin enqueue - Landing Page CPT only
|
31 |
+
if ( ( isset($post) && 'landing-page' == $post->post_type ) || ( isset($_GET['post_type']) && $_GET['post_type']=='landing-page' ) )
|
32 |
+
{
|
33 |
+
|
34 |
+
wp_enqueue_script('jpicker', LANDINGPAGES_URLPATH . 'js/libraries/jpicker/jpicker-1.1.6.min.js');
|
35 |
+
wp_localize_script( 'jpicker', 'jpicker', array( 'thispath' => LANDINGPAGES_URLPATH.'js/libraries/jpicker/images/' ));
|
36 |
+
wp_enqueue_style('jpicker-css', LANDINGPAGES_URLPATH . 'js/libraries/jpicker/css/jPicker-1.1.6.min.css');
|
37 |
+
wp_dequeue_script('jquery-qtip');
|
38 |
+
wp_enqueue_script('jquery-qtip', LANDINGPAGES_URLPATH . 'js/libraries/jquery-qtip/jquery.qtip.min.js');
|
39 |
+
wp_enqueue_script('load-qtip', LANDINGPAGES_URLPATH . 'js/libraries/jquery-qtip/load.qtip.js', array('jquery-qtip'));
|
40 |
+
wp_enqueue_style('qtip-css', LANDINGPAGES_URLPATH . 'css/jquery.qtip.min.css'); //Tool tip css
|
41 |
+
wp_enqueue_style('lp-only-cpt-admin-css', LANDINGPAGES_URLPATH . 'css/admin-lp-cpt-only-style.css');
|
42 |
+
wp_enqueue_script( 'lp-admin-clear-stats-ajax-request', LANDINGPAGES_URLPATH . 'js/ajax.clearstats.js', array( 'jquery' ) );
|
43 |
+
wp_localize_script( 'lp-admin-clear-stats-ajax-request', 'ajaxadmin', array( 'ajaxurl' => admin_url('admin-ajax.php'), 'lp_clear_nonce' => wp_create_nonce('lp-clear-nonce') ) );
|
44 |
+
|
45 |
+
// Add New and Edit Screens
|
46 |
+
if ( $hook == 'post-new.php' || $hook == 'post.php' )
|
47 |
+
{
|
48 |
+
add_filter( 'wp_default_editor', 'lp_ab_testing_force_default_editor' ); // force html view
|
49 |
+
//admin.metaboxes.js - Template Selector - Media Uploader
|
50 |
+
wp_enqueue_script('lp-js-metaboxes', LANDINGPAGES_URLPATH . 'js/admin/admin.metaboxes.js');
|
51 |
+
|
52 |
+
$template_data = lp_get_extension_data();
|
53 |
+
$template_data = json_encode($template_data);
|
54 |
+
$template = get_post_meta($post->ID, 'lp-selected-template', true);
|
55 |
+
$template = apply_filters('lp_selected_template',$template);
|
56 |
+
$template = strtolower($template);
|
57 |
+
$params = array('selected_template'=>$template, 'templates'=>$template_data);
|
58 |
+
wp_localize_script('lp-js-metaboxes', 'data', $params);
|
59 |
+
|
60 |
+
// Isotope sorting
|
61 |
+
wp_enqueue_script('isotope', LANDINGPAGES_URLPATH . 'js/libraries/isotope/jquery.isotope.js', array('jquery'), '1.0', true );
|
62 |
+
wp_enqueue_style('isotope', LANDINGPAGES_URLPATH . 'js/libraries/isotope/css/style.css');
|
63 |
+
|
64 |
+
// Conditional TINYMCE for landing pages
|
65 |
+
wp_dequeue_script('jquery-tinymce');
|
66 |
+
wp_enqueue_script('jquery-tinymce', LANDINGPAGES_URLPATH . 'js/libraries/tiny_mce/jquery.tinymce.js');
|
67 |
+
|
68 |
+
}
|
69 |
+
// Edit Screen
|
70 |
+
if ( $hook == 'post.php' )
|
71 |
+
{
|
72 |
+
wp_enqueue_script('lp-post-edit-ui', LANDINGPAGES_URLPATH . 'js/admin/admin.post-edit.js');
|
73 |
+
wp_localize_script( 'lp-post-edit-ui', 'lp_post_edit_ui', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'post_id' => $post->ID , 'wp_landing_page_meta_nonce' => wp_create_nonce('wp-landing-page-meta-nonce'), 'lp_template_nonce' => wp_create_nonce('lp-nonce') ) );
|
74 |
+
wp_enqueue_style('admin-post-edit-css', LANDINGPAGES_URLPATH . '/css/admin-post-edit.css');
|
75 |
+
|
76 |
+
wp_enqueue_script('jqueryui');
|
77 |
+
// jquery datepicker
|
78 |
+
wp_enqueue_script('jquery-datepicker', LANDINGPAGES_URLPATH . 'js/libraries/jquery-datepicker/jquery.timepicker.min.js');
|
79 |
+
|
80 |
+
wp_enqueue_script('jquery-datepicker-base', LANDINGPAGES_URLPATH . 'js/libraries/jquery-datepicker/lib/base.js');
|
81 |
+
wp_enqueue_script('jquery-datepicker-datepair', LANDINGPAGES_URLPATH . 'js/libraries/jquery-datepicker/lib/datepair.js');
|
82 |
+
wp_localize_script( 'jquery-datepicker', 'jquery_datepicker', array( 'thispath' => LANDINGPAGES_URLPATH.'js/libraries/jquery-datepicker/' ));
|
83 |
+
wp_enqueue_script('jquery-datepicker-functions', LANDINGPAGES_URLPATH . 'js/libraries/jquery-datepicker/picker_functions.js');
|
84 |
+
wp_enqueue_style('jquery-timepicker-css', LANDINGPAGES_URLPATH . 'js/libraries/jquery-datepicker/jquery.timepicker.css');
|
85 |
+
wp_enqueue_style('jquery-datepicker-base.css', LANDINGPAGES_URLPATH . 'js/libraries/jquery-datepicker/lib/base.css');
|
86 |
+
|
87 |
+
}
|
88 |
+
|
89 |
+
// Add New Screen
|
90 |
+
if ( $hook == 'post-new.php' )
|
91 |
+
{
|
92 |
+
// Create New Landing Jquery UI
|
93 |
+
wp_enqueue_script('lp-js-create-new-lander', LANDINGPAGES_URLPATH . 'js/admin/admin.post-new.js', array('jquery'), '1.0', true );
|
94 |
+
wp_localize_script( 'lp-js-create-new-lander', 'lp_post_new_ui', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'post_id' => $post->ID , 'wp_landing_page_meta_nonce' => wp_create_nonce('lp_nonce') ) );
|
95 |
+
wp_enqueue_style('lp-css-post-new', LANDINGPAGES_URLPATH . 'css/admin-post-new.css');
|
96 |
+
}
|
97 |
+
|
98 |
+
// List Screen
|
99 |
+
if ( $screen->id == 'edit-landing-page' )
|
100 |
+
{
|
101 |
+
wp_enqueue_script(array('jquery', 'editor', 'thickbox', 'media-upload'));
|
102 |
+
wp_enqueue_script('landing-page-list', LANDINGPAGES_URLPATH . 'js/admin/admin.landing-page-list.js');
|
103 |
+
wp_enqueue_style('landing-page-list-css', LANDINGPAGES_URLPATH.'css/admin-landing-page-list.css');
|
104 |
+
wp_enqueue_script('jqueryui');
|
105 |
+
wp_admin_css('thickbox');
|
106 |
+
add_thickbox();
|
107 |
+
}
|
108 |
+
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
function lp_list_feature($label,$url=null)
|
113 |
+
{
|
114 |
+
return array(
|
115 |
+
"label" => $label,
|
116 |
+
"url" => $url
|
117 |
+
);
|
118 |
+
}
|
119 |
+
|
120 |
+
// The Callback
|
121 |
+
function lp_show_metabox($post,$key)
|
122 |
+
{
|
123 |
+
$extension_data = lp_get_extension_data();
|
124 |
+
$key = $key['args']['key'];
|
125 |
+
|
126 |
+
$lp_custom_fields = $extension_data[$key]['options'];
|
127 |
+
$lp_custom_fields = apply_filters('lp_show_metabox',$lp_custom_fields, $key);
|
128 |
+
|
129 |
+
lp_render_metabox($key,$lp_custom_fields,$post);
|
130 |
+
}
|
131 |
+
|
132 |
+
|
133 |
+
add_action('wp_trash_post', 'lp_trash_lander');
|
134 |
+
function lp_trash_lander($post_id) {
|
135 |
+
global $post;
|
136 |
+
|
137 |
+
if (!isset($post)||isset($_POST['split_test']))
|
138 |
+
return;
|
139 |
+
|
140 |
+
if ($post->post_type=='revision')
|
141 |
+
{
|
142 |
+
return;
|
143 |
+
}
|
144 |
+
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ||(isset($_POST['post_type'])&&$_POST['post_type']=='revision'))
|
145 |
+
{
|
146 |
+
return;
|
147 |
+
}
|
148 |
+
|
149 |
+
if ($post->post_type=='landing-page')
|
150 |
+
{
|
151 |
+
|
152 |
+
$lp_id = $post->ID;
|
153 |
+
|
154 |
+
$args=array(
|
155 |
+
'post_type' => 'landing-page-group',
|
156 |
+
'post_satus'=>'publish'
|
157 |
+
);
|
158 |
+
|
159 |
+
$my_query = null;
|
160 |
+
$my_query = new WP_Query($args);
|
161 |
+
|
162 |
+
if( $my_query->have_posts() )
|
163 |
+
{
|
164 |
+
$i=1;
|
165 |
+
while ($my_query->have_posts()) : $my_query->the_post();
|
166 |
+
$group_id = get_the_ID();
|
167 |
+
$group_data = get_the_content();
|
168 |
+
$group_data = json_decode($group_data,true);
|
169 |
+
|
170 |
+
$lp_ids = array();
|
171 |
+
foreach ($group_data as $key=>$value)
|
172 |
+
{
|
173 |
+
$lp_ids[] = $key;
|
174 |
+
}
|
175 |
+
|
176 |
+
if (in_array($lp_id,$lp_ids))
|
177 |
+
{
|
178 |
+
unset($group_data[$lp_id]);
|
179 |
+
//echo 1; exit;
|
180 |
+
$this_data = json_encode($group_data);
|
181 |
+
//print_r($this_data);
|
182 |
+
$new_post = array(
|
183 |
+
'ID' => $group_id,
|
184 |
+
'post_title' => get_the_title(),
|
185 |
+
'post_content' => $this_data,
|
186 |
+
'post_status' => 'publish',
|
187 |
+
'post_date' => date('Y-m-d H:i:s'),
|
188 |
+
'post_author' => 1,
|
189 |
+
'post_type' => 'landing-page-group'
|
190 |
+
);
|
191 |
+
//print_r($new_post);
|
192 |
+
$post_id = wp_update_post($new_post);
|
193 |
+
}
|
194 |
+
endwhile;
|
195 |
+
}
|
196 |
+
}
|
197 |
+
}
|
198 |
+
|
199 |
+
function lp_add_option($key,$type,$id,$default=null,$label=null,$description=null, $options=null)
|
200 |
+
{
|
201 |
+
switch ($type)
|
202 |
+
{
|
203 |
+
case "colorpicker":
|
204 |
+
return array(
|
205 |
+
'label' => $label,
|
206 |
+
'desc' => $description,
|
207 |
+
'id' => $key.'-'.$id,
|
208 |
+
'type' => 'colorpicker',
|
209 |
+
'default' => $default
|
210 |
+
);
|
211 |
+
break;
|
212 |
+
case "text":
|
213 |
+
return array(
|
214 |
+
'label' => $label,
|
215 |
+
'desc' => $description,
|
216 |
+
'id' => $key.'-'.$id,
|
217 |
+
'type' => 'text',
|
218 |
+
'default' => $default
|
219 |
+
);
|
220 |
+
break;
|
221 |
+
case "license-key":
|
222 |
+
return array(
|
223 |
+
'label' => $label,
|
224 |
+
'desc' => $description,
|
225 |
+
'id' => $key.'-'.$id,
|
226 |
+
'type' => 'license-key',
|
227 |
+
'default' => $default,
|
228 |
+
'slug' => $id
|
229 |
+
);
|
230 |
+
break;
|
231 |
+
case "textarea":
|
232 |
+
return array(
|
233 |
+
'label' => $label,
|
234 |
+
'desc' => $description,
|
235 |
+
'id' => $key.'-'.$id,
|
236 |
+
'type' => 'textarea',
|
237 |
+
'default' => $default
|
238 |
+
);
|
239 |
+
break;
|
240 |
+
case "wysiwyg":
|
241 |
+
return array(
|
242 |
+
'label' => $label,
|
243 |
+
'desc' => $description,
|
244 |
+
'id' => $key.'-'.$id,
|
245 |
+
'type' => 'wysiwyg',
|
246 |
+
'default' => $default
|
247 |
+
);
|
248 |
+
break;
|
249 |
+
case "media":
|
250 |
+
return array(
|
251 |
+
'label' => $label,
|
252 |
+
'desc' => $description,
|
253 |
+
'id' => $key.'-'.$id,
|
254 |
+
'type' => 'media',
|
255 |
+
'default' => $default
|
256 |
+
);
|
257 |
+
break;
|
258 |
+
case "checkbox":
|
259 |
+
return array(
|
260 |
+
'label' => $label,
|
261 |
+
'desc' => $description,
|
262 |
+
'id' => $key.'-'.$id,
|
263 |
+
'type' => 'checkbox',
|
264 |
+
'default' => $default,
|
265 |
+
'options' => $options
|
266 |
+
);
|
267 |
+
break;
|
268 |
+
case "radio":
|
269 |
+
return array(
|
270 |
+
'label' => $label,
|
271 |
+
'desc' => $description,
|
272 |
+
'id' => $key.'-'.$id,
|
273 |
+
'type' => 'radio',
|
274 |
+
'default' => $default,
|
275 |
+
'options' => $options
|
276 |
+
);
|
277 |
+
break;
|
278 |
+
case "dropdown":
|
279 |
+
return array(
|
280 |
+
'label' => $label,
|
281 |
+
'desc' => $description,
|
282 |
+
'id' => $key.'-'.$id,
|
283 |
+
'type' => 'dropdown',
|
284 |
+
'default' => $default,
|
285 |
+
'options' => $options
|
286 |
+
);
|
287 |
+
break;
|
288 |
+
case "datepicker":
|
289 |
+
return array(
|
290 |
+
'label' => $label,
|
291 |
+
'desc' => $description,
|
292 |
+
'id' => $key.'-'.$id,
|
293 |
+
'type' => 'datepicker',
|
294 |
+
'default' => $default
|
295 |
+
);
|
296 |
+
break;
|
297 |
+
case "default-content":
|
298 |
+
return array(
|
299 |
+
'label' => $label,
|
300 |
+
'desc' => $description,
|
301 |
+
'id' => $key.'-'.$id,
|
302 |
+
'type' => 'default-content',
|
303 |
+
'default' => $default
|
304 |
+
);
|
305 |
+
break;
|
306 |
+
case "html":
|
307 |
+
return array(
|
308 |
+
'label' => $label,
|
309 |
+
'desc' => $description,
|
310 |
+
'id' => $key.'-'.$id,
|
311 |
+
'type' => 'html',
|
312 |
+
'default' => $default
|
313 |
+
);
|
314 |
+
break;
|
315 |
+
}
|
316 |
+
}
|
317 |
+
|
318 |
+
function lp_render_metabox($key,$custom_fields,$post)
|
319 |
+
{
|
320 |
+
// Use nonce for verification
|
321 |
+
echo "<input type='hidden' name='lp_{$key}_custom_fields_nonce' value='".wp_create_nonce('lp-nonce')."' />";
|
322 |
+
|
323 |
+
// Begin the field table and loop
|
324 |
+
echo '<table class="form-table" >';
|
325 |
+
//print_r($custom_fields);exit;
|
326 |
+
foreach ($custom_fields as $field) {
|
327 |
+
$raw_option_id = str_replace($key . "-", "", $field['id']);
|
328 |
+
$label_class = $raw_option_id . "-label";
|
329 |
+
// get value of this field if it exists for this post
|
330 |
+
$meta = get_post_meta($post->ID, $field['id'], true);
|
331 |
+
|
332 |
+
|
333 |
+
if ((!isset($meta)&&isset($field['default'])&&!is_numeric($meta))||isset($meta)&&empty($meta)&&isset($field['default'])&&!is_numeric($meta))
|
334 |
+
{
|
335 |
+
//echo $field['id'].":".$meta;
|
336 |
+
//echo "<br>";
|
337 |
+
$meta = $field['default'];
|
338 |
+
}
|
339 |
+
|
340 |
+
// begin a table row with
|
341 |
+
echo '<tr class="'.$field['id'].' '.$raw_option_id.' landing-page-option-row">
|
342 |
+
<th class="landing-page-table-header '.$label_class.'"><label for="'.$field['id'].'">'.$field['label'].'</label></th>
|
343 |
+
<td class="landing-page-option-td">';
|
344 |
+
switch($field['type']) {
|
345 |
+
// default content for the_content
|
346 |
+
case 'default-content':
|
347 |
+
echo '<span id="overwrite-content" class="button-secondary">Insert Default Content into main Content area</span><div style="display:none;"><textarea name="'.$field['id'].'" id="'.$field['id'].'" class="default-content" cols="106" rows="6" style="width: 75%; display:hidden;">'.$meta.'</textarea></div>';
|
348 |
+
break;
|
349 |
+
// text
|
350 |
+
case 'colorpicker':
|
351 |
+
if (!$meta)
|
352 |
+
{
|
353 |
+
$meta = $field['default'];
|
354 |
+
}
|
355 |
+
echo '<input type="text" class="jpicker" style="background-color:#'.$meta.'" name="'.$field['id'].'" id="'.$field['id'].'" value="'.$meta.'" size="5" /><span class="button-primary new-save-lp" id="'.$field['id'].'" style="margin-left:10px; display:none;">Update</span>
|
356 |
+
<div class="lp_tooltip tool_color" title="'.$field['desc'].'"></div>';
|
357 |
+
break;
|
358 |
+
case 'datepicker':
|
359 |
+
echo '<div class="jquery-date-picker" id="date-picking">
|
360 |
+
<span class="datepair" data-language="javascript">
|
361 |
+
Date: <input type="text" id="date-picker-'.$key.'" class="date start" /></span>
|
362 |
+
Time: <input id="time-picker-'.$key.'" type="text" class="time time-picker" />
|
363 |
+
<input type="hidden" name="'.$field['id'].'" id="'.$field['id'].'" value="'.$meta.'" class="new-date" value="" >
|
364 |
+
<p class="description">'.$field['desc'].'</p>
|
365 |
+
</div>';
|
366 |
+
break;
|
367 |
+
case 'text':
|
368 |
+
echo '<input type="text" name="'.$field['id'].'" id="'.$field['id'].'" value="'.$meta.'" size="30" />
|
369 |
+
<div class="lp_tooltip" title="'.$field['desc'].'"></div>';
|
370 |
+
break;
|
371 |
+
// textarea
|
372 |
+
case 'textarea':
|
373 |
+
echo '<textarea name="'.$field['id'].'" id="'.$field['id'].'" cols="106" rows="6" style="width: 75%;">'.$meta.'</textarea>
|
374 |
+
<div class="lp_tooltip tool_textarea" title="'.$field['desc'].'"></div>';
|
375 |
+
break;
|
376 |
+
// wysiwyg
|
377 |
+
case 'wysiwyg':
|
378 |
+
wp_editor( $meta, $field['id'], $settings = array() );
|
379 |
+
echo '<p class="description">'.$field['desc'].'</p>';
|
380 |
+
break;
|
381 |
+
// media
|
382 |
+
case 'media':
|
383 |
+
//echo 1; exit;
|
384 |
+
echo '<label for="upload_image">';
|
385 |
+
echo '<input name="'.$field['id'].'" id="'.$field['id'].'" type="text" size="36" name="upload_image" value="'.$meta.'" />';
|
386 |
+
echo '<input class="upload_image_button" id="uploader_'.$field['id'].'" type="button" value="Upload Image" />';
|
387 |
+
echo '<p class="description">'.$field['desc'].'</p>';
|
388 |
+
break;
|
389 |
+
// checkbox
|
390 |
+
case 'checkbox':
|
391 |
+
$i = 1;
|
392 |
+
echo "<table class='lp_check_box_table'>";
|
393 |
+
if (!isset($meta)){$meta=array();}
|
394 |
+
elseif (!is_array($meta)){
|
395 |
+
$meta = array($meta);
|
396 |
+
}
|
397 |
+
foreach ($field['options'] as $value=>$label) {
|
398 |
+
if ($i==5||$i==1)
|
399 |
+
{
|
400 |
+
echo "<tr>";
|
401 |
+
$i=1;
|
402 |
+
}
|
403 |
+
echo '<td><input type="checkbox" name="'.$field['id'].'[]" id="'.$field['id'].'" value="'.$value.'" ',in_array($value,$meta) ? ' checked="checked"' : '','/>';
|
404 |
+
echo '<label for="'.$value.'"> '.$label.'</label></td>';
|
405 |
+
if ($i==4)
|
406 |
+
{
|
407 |
+
echo "</tr>";
|
408 |
+
}
|
409 |
+
$i++;
|
410 |
+
}
|
411 |
+
echo "</table>";
|
412 |
+
echo '<div class="lp_tooltip tool_checkbox" title="'.$field['desc'].'"></div>';
|
413 |
+
break;
|
414 |
+
// radio
|
415 |
+
case 'radio':
|
416 |
+
foreach ($field['options'] as $value=>$label) {
|
417 |
+
//echo $meta.":".$field['id'];
|
418 |
+
//echo "<br>";
|
419 |
+
echo '<input type="radio" name="'.$field['id'].'" id="'.$field['id'].'" value="'.$value.'" ',$meta==$value ? ' checked="checked"' : '','/>';
|
420 |
+
echo '<label for="'.$value.'"> '.$label.'</label> ';
|
421 |
+
}
|
422 |
+
echo '<div class="lp_tooltip" title="'.$field['desc'].'"></div>';
|
423 |
+
break;
|
424 |
+
// select
|
425 |
+
case 'dropdown':
|
426 |
+
echo '<select name="'.$field['id'].'" id="'.$field['id'].'" class="'.$raw_option_id.'">';
|
427 |
+
foreach ($field['options'] as $value=>$label) {
|
428 |
+
echo '<option', $meta == $value ? ' selected="selected"' : '', ' value="'.$value.'">'.$label.'</option>';
|
429 |
+
}
|
430 |
+
echo '</select><div class="lp_tooltip" title="'.$field['desc'].'"></div>';
|
431 |
+
break;
|
432 |
+
|
433 |
+
|
434 |
+
|
435 |
+
} //end switch
|
436 |
+
echo '</td></tr>';
|
437 |
+
} // end foreach
|
438 |
+
echo '</table>'; // end table
|
439 |
+
}
|
440 |
+
|
441 |
+
function lp_render_global_settings($key,$custom_fields,$active_tab)
|
442 |
+
{
|
443 |
+
|
444 |
+
//Check if active tab
|
445 |
+
if ($key==$active_tab)
|
446 |
+
{
|
447 |
+
$display = 'block';
|
448 |
+
}
|
449 |
+
else
|
450 |
+
{
|
451 |
+
$display = 'none';
|
452 |
+
}
|
453 |
+
|
454 |
+
//echo $display;
|
455 |
+
|
456 |
+
// Use nonce for verification
|
457 |
+
echo "<input type='hidden' name='lp_{$key}_custom_fields_nonce' value='".wp_create_nonce('lp-nonce')."' />";
|
458 |
+
|
459 |
+
// Begin the field table and loop
|
460 |
+
echo '<table class="lp-tab-display" id="'.$key.'" style="display:'.$display.'">';
|
461 |
+
//print_r($custom_fields);exit;
|
462 |
+
foreach ($custom_fields as $field) {
|
463 |
+
//echo $field['type'];exit;
|
464 |
+
// get value of this field if it exists for this post
|
465 |
+
if (isset($field['default']))
|
466 |
+
{
|
467 |
+
$default = $field['default'];
|
468 |
+
}
|
469 |
+
else
|
470 |
+
{
|
471 |
+
$default = null;
|
472 |
+
}
|
473 |
+
|
474 |
+
$option = get_option($field['id'], $default);
|
475 |
+
|
476 |
+
// begin a table row with
|
477 |
+
echo '<tr>
|
478 |
+
<th class="lp-gs-th" valign="top" style="font-weight:300px;"><small>'.$field['label'].':</small></th>
|
479 |
+
<td>';
|
480 |
+
switch($field['type']) {
|
481 |
+
// text
|
482 |
+
case 'colorpicker':
|
483 |
+
if (!$option)
|
484 |
+
{
|
485 |
+
$option = $field['default'];
|
486 |
+
}
|
487 |
+
echo '<input type="text" class="jpicker" name="'.$field['id'].'" id="'.$field['id'].'" value="'.$option.'" size="5" />
|
488 |
+
<div class="lp_tooltip tool_color" title="'.$field['desc'].'"></div>';
|
489 |
+
break;
|
490 |
+
case 'datepicker':
|
491 |
+
echo '<input id="datepicker-example2" class="Zebra_DatePicker_Icon" type="text" name="'.$field['id'].'" id="'.$field['id'].'" value="'.$option.'" size="8" />
|
492 |
+
<div class="lp_tooltip tool_date" title="'.$field['desc'].'"></div><p class="description">'.$field['desc'].'</p>';
|
493 |
+
break;
|
494 |
+
case 'license-key':
|
495 |
+
$license_status = lp_check_license_status($field);
|
496 |
+
//echo $license_status;exit;
|
497 |
+
echo '<input type="hidden" name="lp_license_status-'.$field['slug'].'" id="'.$field['id'].'" value="'.$license_status.'" size="30" />
|
498 |
+
<input type="text" name="'.$field['id'].'" id="'.$field['id'].'" value="'.$option.'" size="30" />
|
499 |
+
<div class="lp_tooltip tool_text" title="'.$field['desc'].'"></div>';
|
500 |
+
|
501 |
+
if ($license_status=='valid')
|
502 |
+
{
|
503 |
+
echo '<div class="lp_license_status_valid">Valid</div>';
|
504 |
+
}
|
505 |
+
else
|
506 |
+
{
|
507 |
+
echo '<div class="lp_license_status_invalid">Invalid</div>';
|
508 |
+
}
|
509 |
+
break;
|
510 |
+
case 'text':
|
511 |
+
echo '<input type="text" name="'.$field['id'].'" id="'.$field['id'].'" value="'.$option.'" size="30" />
|
512 |
+
<div class="lp_tooltip tool_text" title="'.$field['desc'].'"></div>';
|
513 |
+
break;
|
514 |
+
// textarea
|
515 |
+
case 'textarea':
|
516 |
+
echo '<textarea name="'.$field['id'].'" id="'.$field['id'].'" cols="106" rows="6">'.$option.'</textarea>
|
517 |
+
<div class="lp_tooltip tool_textarea" title="'.$field['desc'].'"></div>';
|
518 |
+
break;
|
519 |
+
// wysiwyg
|
520 |
+
case 'wysiwyg':
|
521 |
+
wp_editor( $option, $field['id'], $settings = array() );
|
522 |
+
echo '<span class="description">'.$field['desc'].'</span><br><br>';
|
523 |
+
break;
|
524 |
+
// media
|
525 |
+
case 'media':
|
526 |
+
//echo 1; exit;
|
527 |
+
echo '<label for="upload_image">';
|
528 |
+
echo '<input name="'.$field['id'].'" id="'.$field['id'].'" type="text" size="36" name="upload_image" value="'.$option.'" />';
|
529 |
+
echo '<input class="upload_image_button" id="uploader_'.$field['id'].'" type="button" value="Upload Image" />';
|
530 |
+
echo '<br /><div class="lp_tooltip tool_media" title="'.$field['desc'].'"></div>';
|
531 |
+
break;
|
532 |
+
// checkbox
|
533 |
+
case 'checkbox':
|
534 |
+
$i = 1;
|
535 |
+
echo "<table>";
|
536 |
+
if (!isset($option)){$option=array();}
|
537 |
+
elseif (!is_array($option)){
|
538 |
+
$option = array($option);
|
539 |
+
}
|
540 |
+
foreach ($field['options'] as $value=>$label) {
|
541 |
+
if ($i==5||$i==1)
|
542 |
+
{
|
543 |
+
echo "<tr>";
|
544 |
+
$i=1;
|
545 |
+
}
|
546 |
+
echo '<td><input type="checkbox" name="'.$field['id'].'[]" id="'.$field['id'].'" value="'.$value.'" ',in_array($value,$option) ? ' checked="checked"' : '','/>';
|
547 |
+
echo '<label for="'.$value.'"> '.$label.'</label></td>';
|
548 |
+
if ($i==4)
|
549 |
+
{
|
550 |
+
echo "</tr>";
|
551 |
+
}
|
552 |
+
$i++;
|
553 |
+
}
|
554 |
+
echo "</table>";
|
555 |
+
echo '<br><div class="lp_tooltip tool_checkbox" title="'.$field['desc'].'"></div>';
|
556 |
+
break;
|
557 |
+
// radio
|
558 |
+
case 'radio':
|
559 |
+
foreach ($field['options'] as $value=>$label) {
|
560 |
+
//echo $meta.":".$field['id'];
|
561 |
+
//echo "<br>";
|
562 |
+
echo '<input type="radio" name="'.$field['id'].'" id="'.$field['id'].'" value="'.$value.'" ',$option==$value ? ' checked="checked"' : '','/>';
|
563 |
+
echo '<label for="'.$value.'"> '.$label.'</label> ';
|
564 |
+
}
|
565 |
+
echo '<div class="lp_tooltip tool_radio" title="'.$field['desc'].'"></div>';
|
566 |
+
break;
|
567 |
+
// select
|
568 |
+
case 'dropdown':
|
569 |
+
echo '<select name="'.$field['id'].'" id="'.$field['id'].'">';
|
570 |
+
foreach ($field['options'] as $value=>$label) {
|
571 |
+
echo '<option', $option == $value ? ' selected="selected"' : '', ' value="'.$value.'">'.$label.'</option>';
|
572 |
+
}
|
573 |
+
echo '</select><br /><div class="lp_tooltip tool_dropdown" title="'.$field['desc'].'"></div>';
|
574 |
+
break;
|
575 |
+
case 'html':
|
576 |
+
//print_r($field);
|
577 |
+
echo $option;
|
578 |
+
echo '<br /><div class="lp_tooltip tool_dropdown" title="'.$field['desc'].'"></div>';
|
579 |
+
break;
|
580 |
+
|
581 |
+
|
582 |
+
|
583 |
+
} //end switch
|
584 |
+
echo '</td></tr>';
|
585 |
+
} // end foreach
|
586 |
+
echo '</table>'; // end table
|
587 |
+
}
|
588 |
+
|
589 |
+
|
590 |
+
//generates drop down select of landing pages
|
591 |
+
function lp_generate_drowndown($select_id, $post_type, $selected = 0, $width = 400, $height = 230,$font_size = 13,$multiple=true)
|
592 |
+
{
|
593 |
+
$post_type_object = get_post_type_object($post_type);
|
594 |
+
$label = $post_type_object->label;
|
595 |
+
|
596 |
+
if ($multiple==true)
|
597 |
+
{
|
598 |
+
$multiple = "multiple='multiple'";
|
599 |
+
}
|
600 |
+
else
|
601 |
+
{
|
602 |
+
$multiple = "";
|
603 |
+
}
|
604 |
+
|
605 |
+
$posts = get_posts(array('post_type'=> $post_type, 'post_status'=> 'publish', 'suppress_filters' => false, 'posts_per_page'=>-1));
|
606 |
+
echo '<select name="'. $select_id .'" id="'.$select_id.'" class="lp-multiple-select" style="width:'.$width.'px;height:'.$height.'px;font-size:'.$font_size.'px;" '.$multiple.'>';
|
607 |
+
foreach ($posts as $post) {
|
608 |
+
echo '<option value="', $post->ID, '"', $selected == $post->ID ? ' selected="selected"' : '', '>', $post->post_title, '</option>';
|
609 |
+
}
|
610 |
+
echo '</select>';
|
611 |
+
}
|
612 |
+
|
613 |
+
|
614 |
+
function lp_wp_editor( $content, $id, $settings = array() )
|
615 |
+
{
|
616 |
+
//echo $id;
|
617 |
+
$content = apply_filters('lp_wp_editor_content',$content);
|
618 |
+
$id = apply_filters('lp_wp_editor_id',$id);
|
619 |
+
$settings = apply_filters('lp_wp_editor_settings',$settings);
|
620 |
+
//echo "hello";
|
621 |
+
//echo $id;exit;
|
622 |
+
wp_editor( $content, $id, $settings);
|
623 |
+
}
|
624 |
+
|
625 |
+
|
626 |
+
function lp_display_headline_input($id,$main_headline)
|
627 |
+
{
|
628 |
+
//echo $id;
|
629 |
+
$id = apply_filters('lp_display_headline_input_id',$id);
|
630 |
+
|
631 |
+
echo "<input type='text' name='{$id}' id='{$id}' value='{$main_headline}' size='30'>";
|
632 |
+
}
|
633 |
+
function lp_display_notes_input($id,$variation_notes)
|
634 |
+
{
|
635 |
+
//echo $id;
|
636 |
+
$id = apply_filters('lp_display_notes_input_id',$id);
|
637 |
+
|
638 |
+
echo "<span id='add-lp-notes'>Notes:</span><input placeholder='Add Notes to your variation. Example: This version is testing a green submit button' type='text' class='lp-notes' name='{$id}' id='{$id}' value='{$variation_notes}' size='30'>";
|
639 |
+
}
|
640 |
+
|
641 |
+
function lp_ready_screenshot_url($link,$datetime)
|
642 |
+
{
|
643 |
+
return $link.'?dt='.$datetime;
|
644 |
+
}
|
645 |
+
|
646 |
+
|
647 |
+
function lp_display_success($message)
|
648 |
+
{
|
649 |
+
echo "<br><br><center>";
|
650 |
+
echo "<font color='green'><i>".$message."</i></font>";
|
651 |
+
echo "</center>";
|
652 |
+
}
|
653 |
+
|
654 |
+
|
655 |
+
function lp_make_percent($rate, $return = false)
|
656 |
+
{
|
657 |
+
//echo "1{$rate}2";exit;
|
658 |
+
//yes, we know this is not a true filter
|
659 |
+
if (is_numeric($rate))
|
660 |
+
{
|
661 |
+
$percent = $rate * (100);
|
662 |
+
$percent = number_format($percent,1);
|
663 |
+
if($return){ return $percent."%"; } else { echo $percent."%"; }
|
664 |
+
}
|
665 |
+
else
|
666 |
+
{
|
667 |
+
if($return){ return $rate; } else { echo $rate; }
|
668 |
+
}
|
669 |
+
}
|
670 |
+
|
671 |
+
function lp_check_license_status($field)
|
672 |
+
{
|
673 |
+
//print_r($field);exit;
|
674 |
+
$date = date("Y-m-d");
|
675 |
+
$cache_date = get_option($field['id']."-expire");
|
676 |
+
$license_status = get_option('lp_license_status-'.$field['slug']);
|
677 |
+
|
678 |
+
if (isset($cache_date)&&($date<$cache_date)&&$license_status=='valid')
|
679 |
+
{
|
680 |
+
return "valid";
|
681 |
+
}
|
682 |
+
|
683 |
+
$license_key = get_option($field['id']);
|
684 |
+
|
685 |
+
$api_params = array(
|
686 |
+
'edd_action' => 'check_license',
|
687 |
+
'license' => $license_key,
|
688 |
+
'item_name' => urlencode( $field['slug'] )
|
689 |
+
);
|
690 |
+
//print_r($api_params);
|
691 |
+
|
692 |
+
// Call the custom API.
|
693 |
+
$response = wp_remote_get( add_query_arg( $api_params, LANDINGPAGES_STORE_URL ), array( 'timeout' => 15, 'sslverify' => false ) );
|
694 |
+
//print_r($response);
|
695 |
+
|
696 |
+
if ( is_wp_error( $response ) )
|
697 |
+
return false;
|
698 |
+
|
699 |
+
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
|
700 |
+
//echo $license_data;exit;
|
701 |
+
|
702 |
+
if( $license_data->license == 'valid' ) {
|
703 |
+
$newDate = date('Y-m-d', strtotime("+15 days"));
|
704 |
+
update_option($field['id']."-expire", $newDate);
|
705 |
+
return 'valid';
|
706 |
+
// this license is still valid
|
707 |
+
} else {
|
708 |
+
return 'invalid';
|
709 |
+
}
|
710 |
+
}
|
711 |
+
|
712 |
+
|
713 |
+
function landing_page_get_version() {
|
714 |
+
if ( ! function_exists( 'get_plugins' ) )
|
715 |
+
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
716 |
+
$plugin_folder = get_plugins( '/' . plugin_basename( dirname( __FILE__ ) ) );
|
717 |
+
$plugin_file = basename( ( __FILE__ ) );
|
718 |
+
return $plugin_folder[$plugin_file]['Version'];
|
719 |
+
}
|
720 |
+
|
721 |
+
function lp_wpseo_priority(){return 'low';}
|
722 |
+
add_filter( 'wpseo_metabox_prio', 'lp_wpseo_priority');
|
723 |
+
add_action( 'in_admin_header', 'lp_in_admin_header');
|
724 |
+
function lp_in_admin_header()
|
725 |
+
{
|
726 |
+
global $post;
|
727 |
+
global $wp_meta_boxes;
|
728 |
+
|
729 |
+
if (isset($post)&&$post->post_type=='landing-page')
|
730 |
+
{
|
731 |
+
unset( $wp_meta_boxes[get_current_screen()->id]['normal']['core']['postcustom'] );
|
732 |
+
}
|
733 |
+
}
|
734 |
+
|
735 |
+
|
736 |
+
/* AB TESTING FUNCTIONS */
|
737 |
+
|
738 |
+
/**
|
739 |
+
* [lp_ab_unset_variation description]
|
740 |
+
* @param [type] $variations [description]
|
741 |
+
* @param [type] $vid [description]
|
742 |
+
* @return [type] [description]
|
743 |
+
*/
|
744 |
+
function lp_ab_unset_variation($variations,$vid)
|
745 |
+
{
|
746 |
+
if(($key = array_search($vid, $variations)) !== false) {
|
747 |
+
unset($variations[$key]);
|
748 |
+
}
|
749 |
+
|
750 |
+
return $variations;
|
751 |
+
}
|
752 |
+
|
753 |
+
/**
|
754 |
+
* [lp_ab_get_lp_active_status returns if landing page is in rotation or not]
|
755 |
+
* @param [type] $post [description]
|
756 |
+
* @param [type] $vid [description]
|
757 |
+
* @return [type] 1 or 0
|
758 |
+
*/
|
759 |
+
function lp_ab_get_lp_active_status($post,$vid=null)
|
760 |
+
{
|
761 |
+
if ($vid==0)
|
762 |
+
{
|
763 |
+
$variation_status = get_post_meta( $post->ID , 'lp_ab_variation_status' , true);
|
764 |
+
}
|
765 |
+
else
|
766 |
+
{
|
767 |
+
$variation_status = get_post_meta( $post->ID , 'lp_ab_variation_status-'.$vid , true);
|
768 |
+
}
|
769 |
+
|
770 |
+
if (!is_numeric($variation_status))
|
771 |
+
{
|
772 |
+
return 1;
|
773 |
+
}
|
774 |
+
else
|
775 |
+
{
|
776 |
+
return $variation_status;
|
777 |
+
}
|
778 |
+
}
|
functions/functions.global.php
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
} else if(stristr($_SERVER['SERVER_SOFTWARE'], 'IIS')){
|
1 |
$array = explode('\\',$path);
|
2 |
}else {
|
3 |
$alphabet = array( 'A', 'B', 'C', 'D', 'E',
|
4 |
'F', 'G', 'H', 'I', 'J',
|
5 |
'K', 'L', 'M', 'N', 'O',
|
6 |
'P', 'Q', 'R', 'S', 'T',
|
7 |
'U', 'V', 'W', 'X', 'Y',
|
8 |
'Z'
|
9 |
);
|
1 |
+
<?php
|
2 |
} else if(stristr($_SERVER['SERVER_SOFTWARE'], 'IIS')){
|
3 |
$array = explode('\\',$path);
|
4 |
}else {
|
5 |
$alphabet = array( 'A', 'B', 'C', 'D', 'E',
|
6 |
'F', 'G', 'H', 'I', 'J',
|
7 |
'K', 'L', 'M', 'N', 'O',
|
8 |
'P', 'Q', 'R', 'S', 'T',
|
9 |
'U', 'V', 'W', 'X', 'Y',
|
10 |
'Z'
|
11 |
);
|
images/add-on-image.png
ADDED
Binary file
|
images/cross.png
ADDED
Binary file
|
images/custom-setup-image.png
ADDED
Binary file
|
images/get-custom-setup.png
ADDED
Binary file
|
images/get-wordpress-templates.png
ADDED
Binary file
|
images/gradient.png
ADDED
Binary file
|
images/grey-clear.png
ADDED
Binary file
|
images/image.php
ADDED
@@ -0,0 +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 = ereg_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/label.png
ADDED
Binary file
|
images/link.gif
ADDED
Binary file
|
images/new-lead.png
ADDED
Binary file
|
images/note.png
ADDED
Binary file
|
images/nothumbnail.jpg
ADDED
Binary file
|
images/plus.gif
ADDED
Binary file
|
images/templates-image.png
ADDED
Binary file
|
images/tick.png
ADDED
Binary file
|
index.php
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
<?php
|
2 |
+
# Silence is golden.
|
js/admin/admin.ajax.edit.js
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Prep Data and Save
|
2 |
+
var nonce_val = lp_post_edit_ui.wp_landing_page_meta_nonce; // NEED CORRECT NONCE
|
3 |
+
jQuery(document).on('mousedown', '.new-save-lp', function () {
|
4 |
+
var type_input = jQuery(this).parent().find("input").attr("type");
|
5 |
+
var type_select = jQuery(this).parent().find("select");
|
6 |
+
// var the_conversion_area_editor = jQuery(this).parent().parent().find('#lp-conversion-area_ifr').length;
|
7 |
+
jQuery(this).parent().find(".lp-success-message").hide();
|
8 |
+
// var the_content_editor = jQuery(this).parent().parent().find('#wp_content_ifr').length;
|
9 |
+
var type_wysiwyg = jQuery(this).parent().parent().find('iframe').length;
|
10 |
+
|
11 |
+
var type_textarea = jQuery(this).parent().find("textarea");
|
12 |
+
if (typeof (type_input) != "undefined" && type_input !== null) {
|
13 |
+
var type_of_field = type_input;
|
14 |
+
} else if (typeof (type_wysiwyg) != "undefined" && type_wysiwyg !== null && type_wysiwyg === 1) {
|
15 |
+
var type_of_field = 'wysiwyg';
|
16 |
+
} else if (typeof (type_textarea) != "undefined" && type_textarea !== null) {
|
17 |
+
var type_of_field = 'textarea';
|
18 |
+
} else {
|
19 |
+
(typeof (type_select) != "undefined" && type_select)
|
20 |
+
var type_of_field = 'select';
|
21 |
+
}
|
22 |
+
// console.log(type_of_field); // type of input
|
23 |
+
var new_value_meta_input = jQuery(this).parent().find("input").val();
|
24 |
+
//console.log(new_value_meta_input);
|
25 |
+
var new_value_meta_select = jQuery(this).parent().find("select").val();
|
26 |
+
var new_value_meta_textarea = jQuery(this).parent().find("textarea").val();
|
27 |
+
// console.log(new_value_meta_select);
|
28 |
+
var new_value_meta_radio = jQuery(this).parent().find("input:checked").val();
|
29 |
+
var new_value_meta_checkbox = jQuery(this).parent().find('input[type="checkbox"]:checked').val();
|
30 |
+
var new_wysiwyg_meta = jQuery(this).parent().parent().find("iframe").contents().find("body").html();
|
31 |
+
// prep data
|
32 |
+
if (typeof (new_value_meta_input) != "undefined" && new_value_meta_input !== null && type_of_field == "text") {
|
33 |
+
var meta_to_save = new_value_meta_input;
|
34 |
+
} else if (typeof (new_value_meta_textarea) != "undefined" && new_value_meta_textarea !== null && type_of_field == "textarea") {
|
35 |
+
var meta_to_save = new_value_meta_textarea;
|
36 |
+
} else if (typeof (new_value_meta_select) != "undefined" && new_value_meta_select !== null) {
|
37 |
+
var meta_to_save = new_value_meta_select;
|
38 |
+
} else if (typeof (new_value_meta_radio) != "undefined" && new_value_meta_radio !== null && type_of_field == "radio") {
|
39 |
+
var meta_to_save = new_value_meta_radio;
|
40 |
+
} else if (typeof (new_value_meta_checkbox) != "undefined" && new_value_meta_checkbox !== null && type_of_field == "checkbox") {
|
41 |
+
var meta_to_save = new_value_meta_checkbox;
|
42 |
+
} else if (typeof (new_wysiwyg_meta) != "undefined" && new_wysiwyg_meta !== null && type_of_field == "wysiwyg") {
|
43 |
+
var meta_to_save = new_wysiwyg_meta;
|
44 |
+
//alert('here');
|
45 |
+
} else {
|
46 |
+
var meta_to_save = "";
|
47 |
+
}
|
48 |
+
|
49 |
+
// if data exists save it
|
50 |
+
// console.log(meta_to_save);
|
51 |
+
|
52 |
+
var this_meta_id = jQuery(this).attr("id"); // From save button
|
53 |
+
console.log(this_meta_id);
|
54 |
+
var post_id = jQuery("#post_ID").text();
|
55 |
+
console.log(post_id);
|
56 |
+
console.log(meta_to_save);
|
57 |
+
|
58 |
+
// Run Ajax
|
59 |
+
jQuery.ajax({
|
60 |
+
type: 'POST',
|
61 |
+
url: lp_post_edit_ui.ajaxurl,
|
62 |
+
context: this,
|
63 |
+
data: {
|
64 |
+
action: 'wp_landing_page_meta_save',
|
65 |
+
meta_id: this_meta_id,
|
66 |
+
new_meta_val: meta_to_save,
|
67 |
+
page_id: post_id,
|
68 |
+
nonce: nonce_val
|
69 |
+
},
|
70 |
+
|
71 |
+
success: function (data) {
|
72 |
+
var self = this;
|
73 |
+
|
74 |
+
//alert(data);
|
75 |
+
// jQuery('.lp-form').unbind('submit').submit();
|
76 |
+
//var worked = '<span class="success-message-map">Success! ' + this_meta_id + ' set to ' + meta_to_save + '</span>';
|
77 |
+
var worked = '<span class="lp-success-message">Updated!</span>';
|
78 |
+
var s_message = jQuery(self).parent();
|
79 |
+
jQuery(worked).appendTo(s_message);
|
80 |
+
jQuery(self).parent().find("lp-success-message").remove();
|
81 |
+
jQuery(self).hide();
|
82 |
+
jQuery('.reload').click();
|
83 |
+
//alert("Changes Saved!");
|
84 |
+
},
|
85 |
+
|
86 |
+
error: function (MLHttpRequest, textStatus, errorThrown) {
|
87 |
+
alert("Ajax not enabled");
|
88 |
+
}
|
89 |
+
});
|
90 |
+
|
91 |
+
//reload_preview();
|
92 |
+
return false;
|
93 |
+
|
94 |
+
});
|
js/admin/admin.landing-page-list.js
ADDED
@@ -0,0 +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 |
+
});
|
js/admin/admin.metaboxes.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery(document).ready(function($) {
|
js/admin/admin.post-edit-ab-testing.js
ADDED
@@ -0,0 +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 |
+
});
|
js/admin/admin.post-edit.js
ADDED
@@ -0,0 +1,384 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
//alert(selector);
|
9 |
+
jQuery('#templates-container').isotope({ filter: selector });
|
10 |
+
return false;
|
11 |
+
});
|
12 |
+
/* Ajax loading tabs
|
13 |
+
jQuery.koolSwap({
|
14 |
+
swapBox : '#poststuff',
|
15 |
+
outDuration : 550,
|
16 |
+
inDuration : 600,
|
17 |
+
});
|
18 |
+
*/
|
19 |
+
|
20 |
+
/* Tour Start JS */
|
21 |
+
var tourbutton = '<a class="" id="lp-tour" style="font-size:13px;">Need help? Take the tour</a>';
|
22 |
+
jQuery(tourbutton).appendTo("h2:eq(0)");
|
23 |
+
jQuery("body").on('click', '#lp-tour', function () {
|
24 |
+
var tour = jQuery("#lp-tour-style").length;
|
25 |
+
if ( tour === 0 ) {
|
26 |
+
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>");
|
27 |
+
}
|
28 |
+
setTimeout(function() {
|
29 |
+
introJs().start(); // start tour
|
30 |
+
}, 300);
|
31 |
+
|
32 |
+
});
|
33 |
+
|
34 |
+
var current_a_tab = jQuery("#tabs-0").hasClass('nav-tab-special-active');
|
35 |
+
if (current_a_tab === true){
|
36 |
+
var url_norm = jQuery("#view-post-btn a").attr('href');
|
37 |
+
var new_url = url_norm + "?lp-variation-id=0";
|
38 |
+
jQuery("#view-post-btn a").attr('href', new_url);
|
39 |
+
}
|
40 |
+
|
41 |
+
// Fix inactivate theme display
|
42 |
+
jQuery("#template-box a").live('click', function () {
|
43 |
+
|
44 |
+
setTimeout(function() {
|
45 |
+
jQuery('#TB_window iframe').contents().find("#customize-controls").hide();
|
46 |
+
jQuery('#TB_window iframe').contents().find(".wp-full-overlay.expanded").css("margin-left", "0px");
|
47 |
+
}, 600);
|
48 |
+
|
49 |
+
});
|
50 |
+
|
51 |
+
// Fix Split testing iframe size
|
52 |
+
jQuery("#lp-metabox-splittesting a.thickbox, #leads-table-container-inside .column-details a").live('click', function () {
|
53 |
+
jQuery('#TB_iframeContent, #TB_window').hide();
|
54 |
+
setTimeout(function() {
|
55 |
+
|
56 |
+
jQuery('#TB_iframeContent, #TB_window').width( 640 ).height( 800 ).css("margin-left", "0px").css("left", "35%");
|
57 |
+
jQuery('#TB_iframeContent, #TB_window').show();
|
58 |
+
}, 600);
|
59 |
+
});
|
60 |
+
|
61 |
+
// Load meta box in correct position on page load
|
62 |
+
var current_template = jQuery("input#lp_select_template ").val();
|
63 |
+
var current_template_meta = "#lp_" + current_template + "_custom_meta_box";
|
64 |
+
jQuery(current_template_meta).removeClass("postbox").appendTo("#template-display-options").addClass("Old-Template");
|
65 |
+
var current_template_h3 = "#lp_" + current_template + "_custom_meta_box h3";
|
66 |
+
jQuery(current_template_h3).css("background","#f8f8f8");
|
67 |
+
jQuery(current_template_meta +' .handlediv').hide();
|
68 |
+
jQuery(current_template_meta +' .hndle').css('cursor','default');
|
69 |
+
|
70 |
+
|
71 |
+
// Fix Thickbox width/hieght
|
72 |
+
jQuery(function($) {
|
73 |
+
tb_position = function() {
|
74 |
+
var tbWindow = $('#TB_window');
|
75 |
+
var width = $(window).width();
|
76 |
+
var H = $(window).height();
|
77 |
+
var W = ( 1720 < width ) ? 1720 : width;
|
78 |
+
|
79 |
+
if ( tbWindow.size() ) {
|
80 |
+
tbWindow.width( W - 50 ).height( H - 45 );
|
81 |
+
$('#TB_iframeContent').width( W - 50 ).height( H - 75 );
|
82 |
+
tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
|
83 |
+
if ( typeof document.body.style.maxWidth != 'undefined' )
|
84 |
+
tbWindow.css({'top':'40px','margin-top':'0'});
|
85 |
+
//$('#TB_title').css({'background-color':'#fff','color':'#cfcfcf'});
|
86 |
+
};
|
87 |
+
|
88 |
+
return $('a.thickbox').each( function() {
|
89 |
+
var href = $(this).attr('href');
|
90 |
+
if ( ! href ) return;
|
91 |
+
href = href.replace(/&width=[0-9]+/g, '');
|
92 |
+
href = href.replace(/&height=[0-9]+/g, '');
|
93 |
+
$(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
|
94 |
+
});
|
95 |
+
|
96 |
+
};
|
97 |
+
|
98 |
+
jQuery('a.thickbox').click(function(){
|
99 |
+
if ( typeof tinyMCE != 'undefined' && tinyMCE.activeEditor ) {
|
100 |
+
tinyMCE.get('content').focus();
|
101 |
+
tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark('simple');
|
102 |
+
}
|
103 |
+
|
104 |
+
});
|
105 |
+
|
106 |
+
$(window).resize( function() { tb_position() } );
|
107 |
+
});
|
108 |
+
|
109 |
+
// Isotope Styling
|
110 |
+
jQuery('#template-filter a').first().addClass('button-primary');
|
111 |
+
jQuery('#template-filter a').click(function(){
|
112 |
+
jQuery("#template-filter a.button-primary").removeClass("button-primary");
|
113 |
+
jQuery(this).addClass('button-primary');
|
114 |
+
});
|
115 |
+
|
116 |
+
jQuery('.lp_select_template').click(function(){
|
117 |
+
var template = jQuery(this).attr('id');
|
118 |
+
var label = jQuery(this).attr('label');
|
119 |
+
var selected_template_id = "#" + template;
|
120 |
+
var currentlabel = jQuery(".currently_selected").show();
|
121 |
+
var current_template = jQuery("input#lp_select_template ").val();
|
122 |
+
var current_template_meta = "#lp_" + current_template + "_custom_meta_box";
|
123 |
+
var current_template_h3 = "#lp_" + current_template + "_custom_meta_box h3";
|
124 |
+
var current_template_div = "#lp_" + current_template + "_custom_meta_box .handlediv";
|
125 |
+
var open_variation = jQuery("#open_variation").val();
|
126 |
+
|
127 |
+
if (open_variation>0)
|
128 |
+
{
|
129 |
+
var variation_tag = "-"+open_variation;
|
130 |
+
}
|
131 |
+
else
|
132 |
+
{
|
133 |
+
var variation_tag = "";
|
134 |
+
}
|
135 |
+
|
136 |
+
jQuery("#template-box.default_template_highlight").removeClass("default_template_highlight");
|
137 |
+
|
138 |
+
jQuery(selected_template_id).parent().addClass("default_template_highlight").prepend(currentlabel);
|
139 |
+
|
140 |
+
jQuery(".lp-template-selector-container").fadeOut(500,function(){
|
141 |
+
jQuery('#lp_metabox_select_template input').remove();
|
142 |
+
jQuery('#lp_metabox_select_template .form-table').remove();
|
143 |
+
|
144 |
+
var ajax_data = {
|
145 |
+
action: 'lp_get_template_meta',
|
146 |
+
selected_template: template,
|
147 |
+
post_id: lp_post_edit_ui.post_id,
|
148 |
+
};
|
149 |
+
|
150 |
+
jQuery.ajax({
|
151 |
+
type: "POST",
|
152 |
+
url: lp_post_edit_ui.ajaxurl,
|
153 |
+
data: ajax_data,
|
154 |
+
dataType: 'html',
|
155 |
+
timeout: 7000,
|
156 |
+
success: function (response) {
|
157 |
+
//alert(response);
|
158 |
+
var html = '<input id="lp_select_template" type="hidden" value="'+template+'" name="lp-selected-template'+variation_tag+'">'
|
159 |
+
+ '<input type="hidden" value="'+lp_post_edit_ui.lp_template_nonce+'" name="lp_lp_custom_fields_nonce">'
|
160 |
+
+ '<h3 class="hndle" style="background: none repeat scroll 0% 0% rgb(248, 248, 248); cursor: default;">'
|
161 |
+
+ '<span>'
|
162 |
+
+ '<small>'+ template +' Options:</small>'
|
163 |
+
+ '</span>'
|
164 |
+
+ '</h3>'
|
165 |
+
+ response;
|
166 |
+
|
167 |
+
jQuery('#lp_metabox_select_template #template-display-options').html(html);
|
168 |
+
jQuery('.time-picker').timepicker({ 'timeFormat': 'H:i' });
|
169 |
+
|
170 |
+
},
|
171 |
+
error: function(request, status, err) {
|
172 |
+
alert(status);
|
173 |
+
}
|
174 |
+
});
|
175 |
+
jQuery(".wrap").fadeIn(500, function(){
|
176 |
+
});
|
177 |
+
});
|
178 |
+
|
179 |
+
jQuery(current_template_meta).appendTo("#template-display-options");
|
180 |
+
jQuery('#lp_metabox_select_template h3').first().html('Current Active Template: '+label);
|
181 |
+
jQuery('#lp_select_template').val(template);
|
182 |
+
jQuery(".Old-Template").hide();
|
183 |
+
|
184 |
+
jQuery(current_template_div).css("display","none");
|
185 |
+
jQuery(current_template_h3).css("background","#f8f8f8");
|
186 |
+
jQuery(current_template_meta).show().appendTo("#template-display-options").removeClass("postbox").addClass("Old-Template");
|
187 |
+
//alert(template);
|
188 |
+
//alert(label);
|
189 |
+
});
|
190 |
+
|
191 |
+
jQuery('#lp-cancel-selection').click(function(){
|
192 |
+
jQuery(".lp-template-selector-container").fadeOut(500,function(){
|
193 |
+
jQuery(".wrap").fadeIn(500, function(){
|
194 |
+
});
|
195 |
+
});
|
196 |
+
|
197 |
+
});
|
198 |
+
|
199 |
+
// the_content default overwrite
|
200 |
+
jQuery('#overwrite-content').click(function(){
|
201 |
+
if (confirm('Are you sure you want to overwrite what is currently in the main edit box above?')) {
|
202 |
+
var default_content = jQuery(".default-content").text();
|
203 |
+
jQuery("#content_ifr").contents().find("body").html(default_content);
|
204 |
+
} else {
|
205 |
+
// Do nothing!
|
206 |
+
}
|
207 |
+
});
|
208 |
+
|
209 |
+
// Colorpicker fix
|
210 |
+
jQuery(document).on('mouseenter', '.jpicker', function (e) {
|
211 |
+
if(jQuery(e.target).data('mouseovered')!='yes')
|
212 |
+
{
|
213 |
+
|
214 |
+
jQuery(this).jPicker({
|
215 |
+
window: // used to define the position of the popup window only useful in binded mode
|
216 |
+
{
|
217 |
+
title: null, // any title for the jPicker window itself - displays "Drag Markers To Pick A Color" if left null
|
218 |
+
position: {
|
219 |
+
x: 'screenCenter', // acceptable values "left", "center", "right", "screenCenter", or relative px value
|
220 |
+
y: 'center', // acceptable values "top", "bottom", "center", or relative px value
|
221 |
+
},
|
222 |
+
expandable: false, // default to large static picker - set to true to make an expandable picker (small icon with popup) - set
|
223 |
+
// automatically when binded to input element
|
224 |
+
liveUpdate: true, // set false if you want the user to click "OK" before the binded input box updates values (always "true"
|
225 |
+
// for expandable picker)
|
226 |
+
alphaSupport: false, // set to true to enable alpha picking
|
227 |
+
alphaPrecision: 0, // set decimal precision for alpha percentage display - hex codes do not map directly to percentage
|
228 |
+
// integers - range 0-2
|
229 |
+
updateInputColor: true // set to false to prevent binded input colors from changing
|
230 |
+
}
|
231 |
+
},
|
232 |
+
function(color, context)
|
233 |
+
{
|
234 |
+
var all = color.val('all');
|
235 |
+
// alert('Color chosen - hex: ' + (all && '#' + all.hex || 'none') + ' - alpha: ' + (all && all.a + '%' || 'none'));
|
236 |
+
//jQuery(this).attr('rel', all.hex);
|
237 |
+
jQuery(this).parent().find(".lp-success-message").remove();
|
238 |
+
jQuery(this).parent().find(".new-save-lp").show();
|
239 |
+
jQuery(this).parent().find(".new-save-lp-frontend").show();
|
240 |
+
|
241 |
+
//jQuery(this).attr('value', all.hex);
|
242 |
+
});
|
243 |
+
jQuery(e.target).data('mouseovered','yes');
|
244 |
+
}
|
245 |
+
});
|
246 |
+
|
247 |
+
if (jQuery(".lp-template-selector-container").css("display") == "none"){
|
248 |
+
jQuery(".currently_selected").hide(); }
|
249 |
+
else {
|
250 |
+
jQuery(".currently_selected").show();
|
251 |
+
}
|
252 |
+
|
253 |
+
// Add current title of template to selector
|
254 |
+
var selected_template = jQuery('#lp_select_template').val();
|
255 |
+
var selected_template_id = "#" + selected_template;
|
256 |
+
var currentlabel = jQuery(".currently_selected");
|
257 |
+
jQuery(selected_template_id).parent().addClass("default_template_highlight").prepend(currentlabel);
|
258 |
+
jQuery("#lp_metabox_select_template h3").first().append(' - Current Active Template: <strong>' + selected_template + '</strong>')
|
259 |
+
|
260 |
+
jQuery('#lp-change-template-button').live('click', function () {
|
261 |
+
jQuery(".wrap").fadeOut(500,function(){
|
262 |
+
jQuery('#templates-container').isotope();
|
263 |
+
jQuery(".lp-template-selector-container").fadeIn(500, function(){
|
264 |
+
jQuery(".currently_selected").show();
|
265 |
+
jQuery('#lp-cancel-selection').show();
|
266 |
+
});
|
267 |
+
jQuery("#template-filter li a").first().click();
|
268 |
+
});
|
269 |
+
});
|
270 |
+
|
271 |
+
/* Move Slug Box
|
272 |
+
var slugs = jQuery("#edit-slug-box");
|
273 |
+
jQuery('#main-title-area').after(slugs.show());
|
274 |
+
*/
|
275 |
+
// Background Options
|
276 |
+
jQuery('.current_lander .background-style').live('change', function () {
|
277 |
+
var input = jQuery(".current_lander .background-style option:selected").val();
|
278 |
+
if (input == 'color') {
|
279 |
+
jQuery('.current_lander tr.background-color').show();
|
280 |
+
jQuery('.current_lander tr.background-image').hide();
|
281 |
+
jQuery('.background_tip').hide();
|
282 |
+
}
|
283 |
+
else if (input == 'default') {
|
284 |
+
jQuery('.current_lander tr.background-color').hide();
|
285 |
+
jQuery('.current_lander tr.background-image').hide();
|
286 |
+
jQuery('.background_tip').hide();
|
287 |
+
}
|
288 |
+
else if (input == 'custom') {
|
289 |
+
var obj = jQuery(".current_lander tr.background-style td .lp_tooltip");
|
290 |
+
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");
|
291 |
+
jQuery('.background_tip').show();
|
292 |
+
}
|
293 |
+
else {
|
294 |
+
jQuery('.current_lander tr.background-color').hide();
|
295 |
+
jQuery('.current_lander tr.background-image').show();
|
296 |
+
jQuery('.background_tip').hide();
|
297 |
+
}
|
298 |
+
|
299 |
+
});
|
300 |
+
|
301 |
+
// Check BG options on page load
|
302 |
+
jQuery(document).ready(function () {
|
303 |
+
var input2 = jQuery(".current_lander .background-style option:selected").val();
|
304 |
+
if (input2 == 'color') {
|
305 |
+
jQuery('.current_lander tr.background-color').show();
|
306 |
+
jQuery('.current_lander tr.background-image').hide();
|
307 |
+
} else if (input2 == 'custom') {
|
308 |
+
var obj = jQuery(".current_lander tr.background-style td .lp_tooltip");
|
309 |
+
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");
|
310 |
+
jQuery('.background_tip').show();
|
311 |
+
} else if (input2 == 'default') {
|
312 |
+
jQuery('.current_lander tr.background-color').hide();
|
313 |
+
jQuery('.current_lander tr.background-image').hide();
|
314 |
+
} else {
|
315 |
+
jQuery('.current_lander tr.background-color').hide();
|
316 |
+
jQuery('.current_lander tr.background-image').show();
|
317 |
+
}
|
318 |
+
});
|
319 |
+
|
320 |
+
//Stylize lead's wp-list-table
|
321 |
+
var cnt = $("#leads-table-container").contents();
|
322 |
+
$("#lp_conversion_log_metabox").replaceWith(cnt);
|
323 |
+
|
324 |
+
//remove inputs from wp-list-table
|
325 |
+
jQuery('#leads-table-container-inside input').each(function(){
|
326 |
+
jQuery(this).remove();
|
327 |
+
});
|
328 |
+
|
329 |
+
var post_status = jQuery("#original_post_status").val();
|
330 |
+
|
331 |
+
if (post_status === "draft") {
|
332 |
+
// jQuery( ".nav-tab-wrapper.a_b_tabs .lp-ab-tab, #tabs-add-variation").hide();
|
333 |
+
jQuery(".new-save-lp-frontend").on("click", function(event) {
|
334 |
+
event.preventDefault();
|
335 |
+
alert("Must publish this page before you can use the visual editor!");
|
336 |
+
});
|
337 |
+
var subbox = jQuery("#submitdiv");
|
338 |
+
jQuery("#lp_ab_display_stats_metabox").before(subbox)
|
339 |
+
} else {
|
340 |
+
jQuery("#publish").val("Update All");
|
341 |
+
}
|
342 |
+
|
343 |
+
// Ajax Saving for metadata
|
344 |
+
/*
|
345 |
+
jQuery('#lp_metabox_select_template input, #lp_metabox_select_template select, #lp_metabox_select_template textarea').on("change keyup", function (e) {
|
346 |
+
// iframe content change needs its own change function $("#iFrame").contents().find("#someDiv")
|
347 |
+
// media uploader needs its own change function
|
348 |
+
var this_id = jQuery(this).attr("id");
|
349 |
+
var parent_el = jQuery(this).parent();
|
350 |
+
jQuery(parent_el).find(".lp-success-message").remove();
|
351 |
+
jQuery(parent_el).find(".new-save-lp").remove();
|
352 |
+
var ajax_save_button = jQuery('<span class="button-primary new-save-lp" id="' + this_id + '" style="margin-left:10px">Update</span>');
|
353 |
+
//console.log(parent_el);
|
354 |
+
jQuery(ajax_save_button).appendTo(parent_el);
|
355 |
+
});
|
356 |
+
jQuery('#lp-notes-area input').on("change keyup", function (e) {
|
357 |
+
var this_id = jQuery(this).attr("id");
|
358 |
+
var parent_el = jQuery(this).parent();
|
359 |
+
jQuery(parent_el).find(".lp-success-message").remove();
|
360 |
+
jQuery(parent_el).find(".new-save-lp").remove();
|
361 |
+
var ajax_save_button = jQuery('<span class="button-primary new-save-lp" id="' + this_id + '" style="margin-left:10px">Update</span>');
|
362 |
+
//console.log(parent_el);
|
363 |
+
jQuery(ajax_save_button).appendTo(parent_el);
|
364 |
+
});
|
365 |
+
|
366 |
+
jQuery('#main-title-area input').on("change keyup", function (e) {
|
367 |
+
// iframe content change needs its own change function $("#iFrame").contents().find("#someDiv")
|
368 |
+
// media uploader needs its own change function
|
369 |
+
var this_id = jQuery(this).attr("id");
|
370 |
+
var current_view = jQuery("#lp-current-view").text();
|
371 |
+
if (current_view !== "0") {
|
372 |
+
this_id = this_id + '-' + current_view;
|
373 |
+
}
|
374 |
+
var parent_el = jQuery(this).parent();
|
375 |
+
jQuery(parent_el).find(".lp-success-message").remove();
|
376 |
+
jQuery(parent_el).find(".new-save-lp").remove();
|
377 |
+
var ajax_save_button = jQuery('<span class="button-primary new-save-lp" id="' + this_id + '" style="margin-left:10px">Update</span>');
|
378 |
+
//console.log(parent_el);
|
379 |
+
jQuery(ajax_save_button).appendTo(parent_el);
|
380 |
+
});
|
381 |
+
*/
|
382 |
+
|
383 |
+
|
384 |
+
});
|
js/admin/admin.post-new.js
ADDED
@@ -0,0 +1,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='/wp-content/plugins/landing-pages/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='/wp-content/plugins/landing-pages/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 |
+
//alert(selector);
|
67 |
+
jQuery('#templates-container').isotope({ filter: selector });
|
68 |
+
return false;
|
69 |
+
});
|
70 |
+
|
71 |
+
jQuery('.lp_select_template').click(function(){
|
72 |
+
var template = jQuery(this).attr('id');
|
73 |
+
var label = jQuery(this).attr('label');
|
74 |
+
jQuery(".lp-template-selector-container").fadeOut(500,function(){
|
75 |
+
jQuery(".wrap").fadeIn(500, function(){
|
76 |
+
});
|
77 |
+
});
|
78 |
+
|
79 |
+
jQuery('#lp_metabox_select_template h3').html('Current Active Template: '+label);
|
80 |
+
jQuery('#lp_select_template').val(template);
|
81 |
+
//alert(template);
|
82 |
+
//alert(label);
|
83 |
+
});
|
84 |
+
|
85 |
+
|
86 |
+
jQuery("#template-box a").live('click', function () {
|
87 |
+
|
88 |
+
setTimeout(function() {
|
89 |
+
jQuery('#TB_window iframe').contents().find("#customize-controls").hide();
|
90 |
+
jQuery('#TB_window iframe').contents().find(".wp-full-overlay.expanded").css("margin-left", "0px");
|
91 |
+
}, 1200);
|
92 |
+
|
93 |
+
});
|
94 |
+
|
95 |
+
// Fix Thickbox width
|
96 |
+
jQuery(function($) {
|
97 |
+
tb_position = function() {
|
98 |
+
var tbWindow = $('#TB_window');
|
99 |
+
var width = $(window).width();
|
100 |
+
var H = $(window).height();
|
101 |
+
var W = ( 1720 < width ) ? 1720 : width;
|
102 |
+
|
103 |
+
if ( tbWindow.size() ) {
|
104 |
+
tbWindow.width( W - 50 ).height( H - 45 );
|
105 |
+
$('#TB_iframeContent').width( W - 50 ).height( H - 75 );
|
106 |
+
tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
|
107 |
+
if ( typeof document.body.style.maxWidth != 'undefined' )
|
108 |
+
tbWindow.css({'top':'40px','margin-top':'0'});
|
109 |
+
//$('#TB_title').css({'background-color':'#fff','color':'#cfcfcf'});
|
110 |
+
};
|
111 |
+
|
112 |
+
return $('a.thickbox').each( function() {
|
113 |
+
var href = $(this).attr('href');
|
114 |
+
if ( ! href ) return;
|
115 |
+
href = href.replace(/&width=[0-9]+/g, '');
|
116 |
+
href = href.replace(/&height=[0-9]+/g, '');
|
117 |
+
$(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
|
118 |
+
});
|
119 |
+
};
|
120 |
+
|
121 |
+
jQuery('a.thickbox').click(function(){
|
122 |
+
if ( typeof tinyMCE != 'undefined' && tinyMCE.activeEditor ) {
|
123 |
+
tinyMCE.get('content').focus();
|
124 |
+
tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark('simple');
|
125 |
+
}
|
126 |
+
|
127 |
+
});
|
128 |
+
|
129 |
+
$(window).resize( function() { tb_position() } );
|
130 |
+
});
|
131 |
+
|
132 |
+
var nonce_val = lp_post_new_ui.wp_landing_page_meta_nonce; // NEED CORRECT NONCE
|
133 |
+
|
134 |
+
var nonce_html = '<input type="hidden" value="74910e3045" name="wp-landing-page-meta-nonce">';
|
135 |
+
|
136 |
+
jQuery('form').prepend(nonce_html);
|
137 |
+
|
138 |
+
});
|
js/admin/admin.split-testing-splash.js
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
jQuery("#edit-group-div h1").hide();
|
1 |
jQuery("#edit-group-div h1").show();
|
2 |
jQuery(".manage-split").html('Select split test group(s):');
|
3 |
jQuery("input[value='Save Placement']").val('Add to Split Test Group(s)');
|
4 |
jQuery(".clone_description").append("<p>The group(s) highlighted in <span style='background:#DFF2BF'>green</span> are the current group(s) this page is associated with.</p>"); }
|
5 |
jQuery(".clone-post-options input[value='Save Placement']").val('Clone Page and add to Split Test Group(s)');
|
6 |
var input = jQuery(this).attr('checked');
|
7 |
if (input == 'checked') {
|
8 |
jQuery(this).parent().parent().css("background-color", "#dff2bf");
|
9 |
// Check Secondary Radio Input Status for on/off
|
10 |
} else {
|
11 |
jQuery(this).parent().parent().css("background-color", "transparent");
|
12 |
}
|
13 |
});
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
jQuery("#edit-group-div h1").hide();
|
3 |
jQuery("#edit-group-div h1").show();
|
4 |
jQuery(".manage-split").html('Select split test group(s):');
|
5 |
jQuery("input[value='Save Placement']").val('Add to Split Test Group(s)');
|
6 |
jQuery(".clone_description").append("<p>The group(s) highlighted in <span style='background:#DFF2BF'>green</span> are the current group(s) this page is associated with.</p>"); }
|
7 |
jQuery(".clone-post-options input[value='Save Placement']").val('Clone Page and add to Split Test Group(s)');
|
8 |
var input = jQuery(this).attr('checked');
|
9 |
if (input == 'checked') {
|
10 |
jQuery(this).parent().parent().css("background-color", "#dff2bf");
|
11 |
// Check Secondary Radio Input Status for on/off
|
12 |
} else {
|
13 |
jQuery(this).parent().parent().css("background-color", "transparent");
|
14 |
}
|
15 |
});
|
js/admin/admin.split-testing.js
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
|
1 |
+
jQuery(document).ready(function()
|
2 |
|
js/admin/admin.store.js
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function()
|
2 |
+
{
|
3 |
+
//jQuery("label[for=edd-gateway-paypal]").hide();
|
4 |
+
});
|
5 |
+
|
js/admin/admin.templates-upload.js
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
+
|
3 |
+
jQuery('.subsubsub li a').live('click', function () {
|
4 |
+
|
5 |
+
var id = jQuery(this).attr('id');
|
6 |
+
//alert (id);
|
7 |
+
if (id == 'menu_upload') {
|
8 |
+
jQuery('.templates_search').hide();
|
9 |
+
jQuery('.templates_search').removeClass('current');
|
10 |
+
|
11 |
+
jQuery('.templates_upload').show();
|
12 |
+
jQuery('.templates_upload').addClass('current');
|
13 |
+
}
|
14 |
+
else if (id == 'menu_search')
|
15 |
+
{
|
16 |
+
jQuery('.templates_upload').hide();
|
17 |
+
jQuery('.templates_upload').removeClass('current');
|
18 |
+
|
19 |
+
jQuery('.templates_search').show();
|
20 |
+
jQuery('.templates_search').addClass('current');
|
21 |
+
}
|
22 |
+
|
23 |
+
});
|
24 |
+
|
25 |
+
});
|
js/admin/admin.templates.js
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
|
1 |
+
|
2 |
|
js/admin/intro.js
ADDED
@@ -0,0 +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 |
+
}));
|
js/admin/tour/tour.post-edit.js
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Post Edit Screen Tour
|
2 |
+
jQuery("#titlewrap").attr({"data-step": "1", "data-intro": 'This is the adminstrative title of your landing. <br>Visitors will not be able to see this. To edit this, simply click on the text.'});
|
3 |
+
jQuery(".nav-tab-wrapper").attr({"data-step": "2", "data-intro": 'This controls the A/B testing functionality of the page.<br>You can toggle back and forth between varaitions or click the add new variation to start an A/B test.'});
|
4 |
+
jQuery(".new-save-lp-frontend").attr({"data-step": "3", "data-intro": 'This lauches the frontend editor that will allow you to see live previews of your landing page variations and edit the settings on the same screen!'});
|
5 |
+
jQuery(".lp-notes").attr({"data-step": "4", "data-intro": 'Add notes to each of your A/B test variations to keep track of what you are testing.'});
|
6 |
+
jQuery("#main-title-area").attr({"data-step": "5", "data-intro": 'This is the main headline area of your landing page. Make sure your headlines are catchy and have a clear value proposition'});
|
7 |
+
jQuery("#lp_ab_display_stats_metabox").attr({"data-step": "6", "data-intro": '<p>This is the main stats box for your landing page variations. Here you will find all of your page views, conversions, and conversion rate numbers.</p><p>A/B Variation controls are also available here.</p><p><strong>Pause:</strong> Paused the current variation from a/b testing</p><p><strong>Edit:</strong> Jump to edit screen of selected variation</p><p><strong>Preview:</strong> Pop open preview window</p><p><strong>Clone:</strong> Clones exact copy of landing page in a new varaition</p><p><strong>Delete:</strong> Deletes the varaition from landing page</p>'});
|
8 |
+
jQuery("#wp-content-wrap").attr({"data-step": "7", "data-intro": 'This is the main content area of your landing page. Not every landing page template uses this field but most do.'});
|
9 |
+
jQuery("#lp_2_form_content").attr({"data-step": "8", "data-intro": 'The Landing Page Form or Conversion Button area is where you insert your form or link for conversion tracking. This box will accept any shortcodes or html forms inserted.'});
|
10 |
+
jQuery("#lp_metabox_select_template").attr({"data-step": "9", "data-intro": 'These are the main options that control the currently selected template.'});
|
js/admin/tour/tour.post-list.js
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Post Edit Screen Tour
|
2 |
+
jQuery(".thumbnail-lander.column-thumbnail-lander:eq(0)").attr({"data-step": "1", "data-intro": 'This is a quick screenshot of your landing page.<br><br> Click on it to see the live version in a popup window here.<br><br> You can preview your a/b variations directly from this view.'});
|
3 |
+
jQuery(".post-title.page-title.column-title:eq(0)").attr({"data-step": "2", "data-intro": '<p>This is the admin title of the landing page. This isn\'t visible to visitors</p><p>You can delete, clone, or clears all of the page stats from here.</p><p><strong>Trash:</strong> Deletes this landing page and places it in the trash</p><p><strong>Edit:</strong> Jump to edit screen of this landing page</p><p><strong>Preview:</strong> Pop open preview window</p><p><strong>Clone:</strong> Clones exact copy of landing page. This includes all current variations.</p><p><strong>Clear Stats:</strong> This will clear all stats for each variation. This cannot be undone.</p>'});
|
4 |
+
jQuery(".stats.column-stats:eq(0)").attr({"data-step": "3", "data-intro": '<p>These are the current stats of your landing page variations.</p><p>If you <strong>hover over the letter</strong> you will be able to preview or jump directly to the edit screen of that particular variation.</p><p>You can also clear indiviudal variation stats from there.</p>'});
|
5 |
+
jQuery("#impressions").attr({"data-step": "4", "data-intro": '<p>This column shows the total number of page views the landing page has. This include all current A/B testing variations.</p>'});
|
6 |
+
jQuery("#actions").attr({"data-step": "5", "data-intro": '<p>This column shows the total number of conversions the landing page has. This include all current A/B testing variations.</p>'});
|
7 |
+
jQuery("#cr").attr({"data-step": "6", "data-intro": '<p>This column shows the total aggregate conversion rate of the landing page. This include all current A/B testing variations.</p>'});
|
8 |
+
jQuery(".add-new-h2").attr({"data-step": "7", "data-intro": '<p>Thats all folks! Go ahead and create a new landing page and get started!</p>'});
|
js/ajax.clearstats.js
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
$( '.clear_stats' ).on( 'click', function() {
|
1 |
$( 'body' ).on( 'click', '.lp-delete-var-stats', function() {
|
2 |
});
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
$( '.clear_stats' ).on( 'click', function() {
|
3 |
$( 'body' ).on( 'click', '.lp-delete-var-stats', function() {
|
4 |
});
|
js/ajax.split-testing.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery(document).ready(function($) {
|
js/ajax.tracking.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery(document).ready(function($) {
|
js/ajax.tracking.js.php
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
/***record impressions***/
|
1 |
+
<script type='text/javascript'>
|
2 |
/***record impressions***/
|
js/customizer.ab-testing.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery(".variation-lp").on('click', function (event) {
|
js/customizer.load.js
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function ($) {
|
2 |
+
var viewchoice = $.cookie("lp-view-choice");
|
3 |
+
|
4 |
+
var current_page = jQuery("#current_variation_id").text();
|
5 |
+
|
6 |
+
// reload the iframe preview page (for option toggles)
|
7 |
+
jQuery('.variation-lp').on('click', function (event) {
|
8 |
+
varaition_is = jQuery(this).attr("id");
|
9 |
+
var original_url = jQuery(parent.document).find("#TB_iframeContent").attr("src");
|
10 |
+
var current_id = jQuery("#current-post-id").text();
|
11 |
+
someURL = original_url;
|
12 |
+
|
13 |
+
splitURL = someURL.split('?');
|
14 |
+
someURL = splitURL[0];
|
15 |
+
new_url = someURL + "?lp-variation-id=" + varaition_is + "&iframe_window=on&post_id=" + current_id;
|
16 |
+
jQuery(parent.document).find("#TB_iframeContent").attr("src", new_url);
|
17 |
+
|
18 |
+
});
|
19 |
+
|
20 |
+
|
21 |
+
jQuery('html').addClass('small-html').css('overflow', 'auto').css('padding-bottom', '40px');
|
22 |
+
jQuery('html').width('125%');
|
23 |
+
jQuery('body').height('100%');
|
24 |
+
jQuery('head').append('<link rel="stylesheet" href="/wp-content/plugins/landing-pages/css/customizer-load.css" type="text/css" />');
|
25 |
+
if (viewchoice === "full-size") {
|
26 |
+
jQuery('html').removeClass('small-html');
|
27 |
+
jQuery('html').width('100%');
|
28 |
+
jQuery('body').height('100%');
|
29 |
+
setTimeout(function() {
|
30 |
+
jQuery(parent.document).find('#lp_customizer_options').contents().find(".full-size-view").hide();
|
31 |
+
jQuery(parent.document).find('#lp_customizer_options').contents().find(".shrink-view").show();
|
32 |
+
}, 1000);
|
33 |
+
}
|
34 |
+
|
35 |
+
setTimeout(function () {
|
36 |
+
|
37 |
+
var sidebarwidth = jQuery('#lp_customizer_options').width();
|
38 |
+
var widthfix = jQuery(parent.document).width() - sidebarwidth;
|
39 |
+
|
40 |
+
//console.log('ran');
|
41 |
+
}, 2000);
|
42 |
+
/* Almost working
|
43 |
+
jQuery('.live-preview-area-box, #lp_container_form').on('mouseover', function (event)
|
44 |
+
{
|
45 |
+
var $tgt = jQuery(event.target);
|
46 |
+
var domElement = jQuery(event.target);
|
47 |
+
var current_el_id = jQuery(this).attr('id');
|
48 |
+
var match_color = jQuery(this).css("color");
|
49 |
+
|
50 |
+
jQuery(this).addClass("live-preview-active");
|
51 |
+
|
52 |
+
if ( match_color === "rgb(255, 255, 255)") {
|
53 |
+
jQuery(this).addClass('lp-see-this');
|
54 |
+
}
|
55 |
+
|
56 |
+
var current_el_parent_id = jQuery(this).parent().attr('id');
|
57 |
+
|
58 |
+
if (typeof (current_el_id) != "undefined" && current_el_id !== null)
|
59 |
+
{
|
60 |
+
actual_el = "#" + current_el_id;
|
61 |
+
}
|
62 |
+
else if (typeof (current_el_parent_id) != "undefined" && current_el_parent_id !== null && current_el_parent_id !== "")
|
63 |
+
{
|
64 |
+
var actual_el = "#" + current_el_parent_id;
|
65 |
+
}
|
66 |
+
else
|
67 |
+
{
|
68 |
+
console.log("empty");
|
69 |
+
}
|
70 |
+
//console.log(actual_el);
|
71 |
+
var finding_the_match = jQuery(parent.document).find('#lp_customizer_options').contents().find(actual_el);
|
72 |
+
jQuery(finding_the_match).parent().parent().css("background", "#EBEBEB");
|
73 |
+
|
74 |
+
|
75 |
+
});
|
76 |
+
|
77 |
+
jQuery('.live-preview-area-box, #lp_container_form').on('mouseout', function (event) {
|
78 |
+
var $tgt = jQuery(event.target);
|
79 |
+
var domElement = jQuery(event.target);
|
80 |
+
var match_color = jQuery(this).css("color");
|
81 |
+
|
82 |
+
jQuery(this).removeClass("live-preview-active");
|
83 |
+
|
84 |
+
if ( match_color === "rgb(0, 0, 0)") {
|
85 |
+
jQuery(this).removeClass('lp-see-this');
|
86 |
+
}
|
87 |
+
|
88 |
+
var current_el_id = jQuery(this).attr('id');
|
89 |
+
var current_el_parent_id = jQuery(this).parent().attr('id');
|
90 |
+
|
91 |
+
if (typeof (current_el_id) != "undefined" && current_el_id !== null)
|
92 |
+
{
|
93 |
+
actual_el = "#" + current_el_id;
|
94 |
+
}
|
95 |
+
else if (typeof (current_el_parent_id) != "undefined" && current_el_parent_id !== null && current_el_parent_id !== "")
|
96 |
+
{
|
97 |
+
var actual_el = "#" + current_el_parent_id;
|
98 |
+
}
|
99 |
+
else
|
100 |
+
{
|
101 |
+
console.log("empty");
|
102 |
+
}
|
103 |
+
// console.log(actual_el);
|
104 |
+
var finding_the_match = jQuery(parent.document).find('#lp_customizer_options').contents().find(actual_el);
|
105 |
+
jQuery(finding_the_match).parent().parent().css("background", "white");
|
106 |
+
|
107 |
+
});
|
108 |
+
|
109 |
+
|
110 |
+
|
111 |
+
jQuery('.live-preview-area-box').on('click', function (event)
|
112 |
+
{
|
113 |
+
var $tgt = jQuery(event.target);
|
114 |
+
var domElement = jQuery(event.target);
|
115 |
+
var current_el_id = jQuery(this).attr('id');
|
116 |
+
var click_id = "click-" + current_el_id;
|
117 |
+
var frame_body = jQuery(parent.document).find('#lp_customizer_options').contents().find(click_id);
|
118 |
+
|
119 |
+
console.log(frame_body);
|
120 |
+
//jQuery(parent.document).find('#lp_customizer_options').contents().find(click_id).click();
|
121 |
+
//parent.document.getElementById('lp_customizer_options').contentWindow.MyFunction(click_id, event)
|
122 |
+
|
123 |
+
|
124 |
+
});
|
125 |
+
*/
|
126 |
+
});
|
js/customizer.save.js
ADDED
@@ -0,0 +1,472 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
+
|
3 |
+
var window_width = jQuery(window).width();
|
4 |
+
var parent_window = parent.document.width;
|
5 |
+
iframe_size = parent_window * 0.334;
|
6 |
+
new_size = parent_window * 0.70;
|
7 |
+
new_new_size = parent_window - new_size;
|
8 |
+
editor_size = iframe_size * 0.85 + "px";
|
9 |
+
// Resize Functions
|
10 |
+
$("#wp_content_resize, #lp-conversion-area_ifr").height(210);
|
11 |
+
setTimeout(function() {
|
12 |
+
jQuery("#lp-conversion-area_ifr, #lp-conversion-area_tbl, #wp_content_ifr, .mceLayout, .mceIframeContainer iframe").height(150);
|
13 |
+
jQuery(".wp-editor-container table").css("max-width", editor_size);
|
14 |
+
jQuery('iframe').contents().find("body").each(function(){
|
15 |
+
jQuery(this).css("max-width", editor_size);
|
16 |
+
});
|
17 |
+
}, 1000);
|
18 |
+
|
19 |
+
//jQuery("body").width(iframe_size);
|
20 |
+
//jQuery("#wpcontent").width(iframe_size);
|
21 |
+
|
22 |
+
// On keystroke have save button show
|
23 |
+
jQuery('#lp-frontend-options-container input, #lp-frontend-options-container textarea').on("keyup", function (e) {
|
24 |
+
var this_id = jQuery(this).attr("id");
|
25 |
+
var parent_el = jQuery(this).parent();
|
26 |
+
jQuery(parent_el).find(".lp-success-message").remove();
|
27 |
+
jQuery(parent_el).find(".new-save-lp-frontend").remove();
|
28 |
+
var ajax_save_button = jQuery('<span class="button-primary new-save-lp-frontend" id="' + this_id + '" style="margin-left:10px">Update</span>');
|
29 |
+
//console.log(parent_el);
|
30 |
+
jQuery(ajax_save_button).appendTo(parent_el);
|
31 |
+
});
|
32 |
+
|
33 |
+
// On change have save button show
|
34 |
+
jQuery('#lp-frontend-options-container input, #lp-frontend-options-container select, #lp-frontend-options-container textarea').on("change", function (e) {
|
35 |
+
var this_id = jQuery(this).attr("id");
|
36 |
+
var parent_el = jQuery(this).parent();
|
37 |
+
jQuery(parent_el).find(".lp-success-message").remove();
|
38 |
+
jQuery(parent_el).find(".new-save-lp-frontend").remove();
|
39 |
+
var ajax_save_button = jQuery('<span class="button-primary new-save-lp-frontend" id="' + this_id + '" style="margin-left:10px">Update</span>');
|
40 |
+
//console.log(parent_el);
|
41 |
+
jQuery(ajax_save_button).appendTo(parent_el);
|
42 |
+
});
|
43 |
+
|
44 |
+
// wysiwyg on keyup save action
|
45 |
+
setTimeout(function() {
|
46 |
+
jQuery('.landing-page-option-row iframe').contents().find('body').on("keyup", function (e) {
|
47 |
+
var thisclass = jQuery(this).attr("class");
|
48 |
+
var this_class_dirty = thisclass.replace("mceContentBody ", "");
|
49 |
+
var this_class_cleaner = this_class_dirty.replace("wp-editor", "");
|
50 |
+
var clean_1 = this_class_cleaner.replace("post-type-landing-page", "");
|
51 |
+
var clean_2 = clean_1.replace(/[.\s]+$/g, ""); // remove trailing whitespace
|
52 |
+
var clean_spaces = clean_2.replace(/\s{2,}/g, ' '); // remove more than one space
|
53 |
+
var this_id = clean_spaces.replace(/[.\s]+$/g, ""); // remove trailing whitespace
|
54 |
+
console.log(this_id);
|
55 |
+
var parent_el = jQuery( "." + this_id + " .landing-page-table-header");
|
56 |
+
jQuery(parent_el).find(".lp-success-message").remove();
|
57 |
+
jQuery(parent_el).find(".new-save-lp-frontend").remove();
|
58 |
+
var ajax_save_button = jQuery('<span class="button-primary new-save-lp-frontend" id="' + this_id + '" style="margin-left:10px;">Update</span>');
|
59 |
+
//console.log(parent_el);
|
60 |
+
jQuery(ajax_save_button).appendTo(parent_el);
|
61 |
+
});
|
62 |
+
}, 4000);
|
63 |
+
|
64 |
+
// Prep Data and Save
|
65 |
+
var nonce_val = lp_post_edit_ui.wp_landing_page_meta_nonce; // NEED CORRECT NONCE
|
66 |
+
jQuery(document).on('mousedown', '.new-save-lp-frontend', function () {
|
67 |
+
var type_input = jQuery(this).parent().find("input").attr("type");
|
68 |
+
var type_select = jQuery(this).parent().find("select");
|
69 |
+
// var the_conversion_area_editor = jQuery(this).parent().parent().find('#lp-conversion-area_ifr').length;
|
70 |
+
jQuery(this).parent().find(".lp-success-message").hide();
|
71 |
+
// var the_content_editor = jQuery(this).parent().parent().find('#wp_content_ifr').length;
|
72 |
+
var type_wysiwyg = jQuery(this).parent().parent().find('iframe').length;
|
73 |
+
|
74 |
+
var type_textarea = jQuery(this).parent().find("textarea");
|
75 |
+
if (typeof (type_input) != "undefined" && type_input !== null) {
|
76 |
+
var type_of_field = type_input;
|
77 |
+
} else if (typeof (type_wysiwyg) != "undefined" && type_wysiwyg !== null && type_wysiwyg === 1) {
|
78 |
+
var type_of_field = 'wysiwyg';
|
79 |
+
} else if (typeof (type_textarea) != "undefined" && type_textarea !== null) {
|
80 |
+
var type_of_field = 'textarea';
|
81 |
+
} else {
|
82 |
+
(typeof (type_select) != "undefined" && type_select)
|
83 |
+
var type_of_field = 'select';
|
84 |
+
}
|
85 |
+
// console.log(type_of_field); // type of input
|
86 |
+
var new_value_meta_input = jQuery(this).parent().find("input").val();
|
87 |
+
//console.log(new_value_meta_input);
|
88 |
+
var new_value_meta_select = jQuery(this).parent().find("select").val();
|
89 |
+
var new_value_meta_textarea = jQuery(this).parent().find("textarea").val();
|
90 |
+
// console.log(new_value_meta_select);
|
91 |
+
var new_value_meta_radio = jQuery(this).parent().find("input:checked").val();
|
92 |
+
var new_value_meta_checkbox = jQuery(this).parent().find('input[type="checkbox"]:checked').val();
|
93 |
+
var new_wysiwyg_meta = jQuery(this).parent().parent().find("iframe").contents().find("body").html();
|
94 |
+
// prep data
|
95 |
+
if (typeof (new_value_meta_input) != "undefined" && new_value_meta_input !== null && type_of_field == "text") {
|
96 |
+
var meta_to_save = new_value_meta_input;
|
97 |
+
} else if (typeof (new_value_meta_textarea) != "undefined" && new_value_meta_textarea !== null && type_of_field == "textarea") {
|
98 |
+
var meta_to_save = new_value_meta_textarea;
|
99 |
+
} else if (typeof (new_value_meta_select) != "undefined" && new_value_meta_select !== null) {
|
100 |
+
var meta_to_save = new_value_meta_select;
|
101 |
+
} else if (typeof (new_value_meta_radio) != "undefined" && new_value_meta_radio !== null && type_of_field == "radio") {
|
102 |
+
var meta_to_save = new_value_meta_radio;
|
103 |
+
} else if (typeof (new_value_meta_checkbox) != "undefined" && new_value_meta_checkbox !== null && type_of_field == "checkbox") {
|
104 |
+
var meta_to_save = new_value_meta_checkbox;
|
105 |
+
} else if (typeof (new_wysiwyg_meta) != "undefined" && new_wysiwyg_meta !== null && type_of_field == "wysiwyg") {
|
106 |
+
var meta_to_save = new_wysiwyg_meta;
|
107 |
+
//alert('here');
|
108 |
+
} else {
|
109 |
+
var meta_to_save = "";
|
110 |
+
}
|
111 |
+
|
112 |
+
// if data exists save it
|
113 |
+
// console.log(meta_to_save);
|
114 |
+
|
115 |
+
var this_meta_id = jQuery(this).attr("id"); // From save button
|
116 |
+
console.log(this_meta_id);
|
117 |
+
var post_id = jQuery("#post_ID").text();
|
118 |
+
console.log(post_id);
|
119 |
+
console.log(meta_to_save);
|
120 |
+
|
121 |
+
// Run Ajax
|
122 |
+
jQuery.ajax({
|
123 |
+
type: 'POST',
|
124 |
+
url: lp_post_edit_ui.ajaxurl,
|
125 |
+
context: this,
|
126 |
+
data: {
|
127 |
+
action: 'wp_landing_page_meta_save',
|
128 |
+
meta_id: this_meta_id,
|
129 |
+
new_meta_val: meta_to_save,
|
130 |
+
page_id: post_id,
|
131 |
+
nonce: nonce_val
|
132 |
+
},
|
133 |
+
|
134 |
+
success: function (data) {
|
135 |
+
var self = this;
|
136 |
+
|
137 |
+
//alert(data);
|
138 |
+
// jQuery('.lp-form').unbind('submit').submit();
|
139 |
+
//var worked = '<span class="success-message-map">Success! ' + this_meta_id + ' set to ' + meta_to_save + '</span>';
|
140 |
+
var worked = '<span class="lp-success-message">Updated!</span>';
|
141 |
+
var s_message = jQuery(self).parent();
|
142 |
+
jQuery(worked).appendTo(s_message);
|
143 |
+
jQuery(self).parent().find("lp-success-message").remove();
|
144 |
+
jQuery(self).hide();
|
145 |
+
jQuery('.reload').click();
|
146 |
+
//alert("Changes Saved!");
|
147 |
+
},
|
148 |
+
|
149 |
+
error: function (MLHttpRequest, textStatus, errorThrown) {
|
150 |
+
alert("Ajax not enabled");
|
151 |
+
}
|
152 |
+
});
|
153 |
+
|
154 |
+
//reload_preview();
|
155 |
+
return false;
|
156 |
+
|
157 |
+
});
|
158 |
+
|
159 |
+
function MyFunction(id, this_event)
|
160 |
+
{
|
161 |
+
var anchor = id;
|
162 |
+
element = document.getElementsByTagName("a");
|
163 |
+
console.log(anchor);
|
164 |
+
var anchorid = "#" + anchor;
|
165 |
+
testing = jQuery(anchorid);
|
166 |
+
|
167 |
+
var wrapit = jQuery(anchorid).attr('href');
|
168 |
+
jQuery('html, body').stop().animate({
|
169 |
+
scrollTop: jQuery(anchorid).offset().top - 100
|
170 |
+
}, 500,'easeInOutExpo');
|
171 |
+
/*
|
172 |
+
if you don't want to use the easing effects:
|
173 |
+
$('html, body').stop().animate({
|
174 |
+
scrollTop: $($anchor.attr('href')).offset().top
|
175 |
+
}, 1000);
|
176 |
+
*/
|
177 |
+
this_event.preventDefault();
|
178 |
+
}
|
179 |
+
|
180 |
+
|
181 |
+
jQuery('.full-size-view').on('click', function (event) {
|
182 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find('html').removeClass("small-html");
|
183 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find('html').css("width", "100%");
|
184 |
+
jQuery(this).hide();
|
185 |
+
jQuery('.shrink-view').show();
|
186 |
+
$.cookie("lp-view-choice", "full-size", { path: '/', expires: 7 });
|
187 |
+
});
|
188 |
+
|
189 |
+
jQuery('.shrink-view').on('click', function (event) {
|
190 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find('html').css("width", "125%");
|
191 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find('html').addClass("small-html");
|
192 |
+
jQuery(this).hide();
|
193 |
+
|
194 |
+
jQuery('.full-size-view').show();
|
195 |
+
$.cookie("lp-view-choice", "shrink", { path: '/', expires: 7 });
|
196 |
+
});
|
197 |
+
|
198 |
+
function generate_random_cache_bust(length) {
|
199 |
+
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');
|
200 |
+
|
201 |
+
if (! length) {
|
202 |
+
length = Math.floor(Math.random() * chars.length);
|
203 |
+
}
|
204 |
+
|
205 |
+
var str = '';
|
206 |
+
for (var i = 0; i < length; i++) {
|
207 |
+
str += chars[Math.floor(Math.random() * chars.length)];
|
208 |
+
}
|
209 |
+
return str;
|
210 |
+
}
|
211 |
+
|
212 |
+
// reload the iframe preview page (for option toggles)
|
213 |
+
jQuery('.reload').on('click', function (event) {
|
214 |
+
reload_preview();
|
215 |
+
});
|
216 |
+
|
217 |
+
var reload_url = parent.window.location.href;
|
218 |
+
|
219 |
+
//alert(jQuery("#current_variation_id").text());
|
220 |
+
function reload_preview() {
|
221 |
+
var cache_bust = generate_random_cache_bust(35);
|
222 |
+
var reload_url = parent.window.location.href;
|
223 |
+
reload_url = reload_url.replace('template-customize=on','');
|
224 |
+
//alert(reload_url);
|
225 |
+
var current_variation_id = jQuery("#current_variation_id").text();
|
226 |
+
|
227 |
+
// var reload = jQuery(parent.document).find("#lp-live-preview").attr("src");
|
228 |
+
var new_reload = reload_url + "&live-preview-area=" + cache_bust + "&lp-variation-id=" + current_variation_id;
|
229 |
+
jQuery(parent.document).find("#lp-live-preview").attr("src", new_reload);
|
230 |
+
// console.log(new_reload);
|
231 |
+
}
|
232 |
+
|
233 |
+
// need rewrite to include the content and the form area
|
234 |
+
jQuery('.landing-page-option-row').on('mouseover', function (event) {
|
235 |
+
var $tgt = jQuery(event.target);
|
236 |
+
var domElement = jQuery(event.target);
|
237 |
+
var current_el_id = jQuery(this).find('input[type="text"], textarea, select').attr("id");
|
238 |
+
var finding_the_match = jQuery(parent.document).find("#lp-live-preview").contents().find("#" + current_el_id);
|
239 |
+
var match_color = jQuery(finding_the_match).css("color");
|
240 |
+
jQuery(finding_the_match).addClass("live-preview-active");
|
241 |
+
if ( match_color === "rgb(255, 255, 255)") {
|
242 |
+
jQuery(finding_the_match).addClass('lp-see-this');
|
243 |
+
}
|
244 |
+
//jQuery(parent.document).find(".introjs-overlay").show();
|
245 |
+
|
246 |
+
});
|
247 |
+
|
248 |
+
|
249 |
+
jQuery('.landing-page-option-row').on('mouseout', function (event) {
|
250 |
+
var $tgt = jQuery(event.target);
|
251 |
+
var domElement = jQuery(event.target);
|
252 |
+
var current_el_id = jQuery(this).find('input[type="text"], textarea, select').attr("id");
|
253 |
+
var finding_the_match = jQuery(parent.document).find("#lp-live-preview").contents().find("#" + current_el_id);
|
254 |
+
var match_color = jQuery(finding_the_match).css("color");
|
255 |
+
jQuery(finding_the_match).removeClass("live-preview-active");
|
256 |
+
if ( match_color === "rgb(0, 0, 0)") {
|
257 |
+
jQuery(finding_the_match).removeClass('lp-see-this');
|
258 |
+
}
|
259 |
+
//jQuery(parent.document).find("#new").contents().find(".introjs-overlay").hide();
|
260 |
+
|
261 |
+
});
|
262 |
+
|
263 |
+
jQuery('input[type="text"], textarea, select').each(function(){
|
264 |
+
|
265 |
+
//console.log(current_id);
|
266 |
+
jQuery(this).on("keyup", function (e) {
|
267 |
+
var current_id = jQuery(this).attr("id");
|
268 |
+
var actual_id = "#" + current_id;
|
269 |
+
//var current_id = jQuery(this).attr("id");
|
270 |
+
var current_value_from_page = $(this, parent.document.body).text();
|
271 |
+
//console.log(current_value_from_page);
|
272 |
+
var new_value_show = jQuery(this).val();
|
273 |
+
//console.log(new_value_show);
|
274 |
+
//$(this, parent.document.body).html(new_value_show);
|
275 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find("#" + current_id).html(new_value_show);
|
276 |
+
});
|
277 |
+
|
278 |
+
});
|
279 |
+
|
280 |
+
/* On change add revert button
|
281 |
+
jQuery('input[type="text"], textarea, select').each(function(){
|
282 |
+
|
283 |
+
//console.log(current_id);
|
284 |
+
jQuery(this).on("change", function (e) {
|
285 |
+
|
286 |
+
});
|
287 |
+
|
288 |
+
});
|
289 |
+
*/
|
290 |
+
|
291 |
+
|
292 |
+
// Listen to the_content editor
|
293 |
+
setTimeout(function() {
|
294 |
+
jQuery('#wp_content_ifr').contents().find("body").on({
|
295 |
+
keyup: function() {
|
296 |
+
//console.log('new vale');
|
297 |
+
var new_value = jQuery(this).html();
|
298 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find("#the-content").html(new_value);
|
299 |
+
parent_el = jQuery(".the-content-label");
|
300 |
+
jQuery(parent_el).find(".lp-success-message").remove();
|
301 |
+
jQuery(parent_el).find(".new-save-lp-frontend").remove();
|
302 |
+
var ajax_save_button = jQuery('<span class="button-primary new-save-lp-frontend" id="the_content" style="margin-left:10px;">Update</span>');
|
303 |
+
jQuery(ajax_save_button).appendTo(parent_el);
|
304 |
+
},
|
305 |
+
// change not working probably need timeout on clicks
|
306 |
+
change: function() {
|
307 |
+
//console.log('change logged');
|
308 |
+
var new_value = jQuery(this).html();
|
309 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find("#the-content").html(new_value);
|
310 |
+
}
|
311 |
+
//jQuery(parent.document).find("#lp-live-preview").contents().find("#" + current_id).html(new_value_show);
|
312 |
+
});
|
313 |
+
|
314 |
+
}, 4000);
|
315 |
+
|
316 |
+
/* might still need
|
317 |
+
// Listen to form area editor. Note shortcodes won't render correctly
|
318 |
+
setTimeout(function() {
|
319 |
+
jQuery('#lp-conversion-area_ifr').contents().find("body").on({
|
320 |
+
keyup: function() {
|
321 |
+
//console.log('new vale');
|
322 |
+
var new_value = jQuery(this).html();
|
323 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find("#lp-conversion-area").html(new_value);
|
324 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find("#lp_container_form").html(new_value);
|
325 |
+
parent_el = jQuery(".lp-conversion-area-label");
|
326 |
+
jQuery(parent_el).find(".lp-success-message").remove();
|
327 |
+
jQuery(parent_el).find(".new-save-lp-frontend").remove();
|
328 |
+
var ajax_save_button = jQuery('<span class="button-primary new-save-lp-frontend" id="lp-conversion-area" style="margin-left:10px;">Update</span>');
|
329 |
+
//console.log(parent_el);
|
330 |
+
|
331 |
+
jQuery(ajax_save_button).appendTo(parent_el);
|
332 |
+
},
|
333 |
+
// change not working probably need timeout on clicks
|
334 |
+
change: function() {
|
335 |
+
//console.log('change logged');
|
336 |
+
var new_value = jQuery(this).html();
|
337 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find("#lp-conversion-area").html(new_value);
|
338 |
+
|
339 |
+
}
|
340 |
+
//jQuery(parent.document).find("#lp-live-preview").contents().find("#" + current_id).html(new_value_show);
|
341 |
+
});
|
342 |
+
|
343 |
+
}, 3000);
|
344 |
+
*/
|
345 |
+
jQuery('#wp_content').on("keyup", function (e) {
|
346 |
+
//console.log('new vale');
|
347 |
+
var new_value = jQuery(this).text();
|
348 |
+
jQuery(parent.document).find("#lp-live-preview").contents().find("#the-content").html(new_value);
|
349 |
+
//jQuery(parent.document).find("#lp-live-preview").contents().find("#" + current_id).html(new_value_show);
|
350 |
+
});
|
351 |
+
|
352 |
+
//jQuery(parent.document).find('#lp_customizer_options').contents().find('#wp_content_ifr').contents().find("body").html();
|
353 |
+
|
354 |
+
// Need to resize or insert custom css into media-uploader iframe
|
355 |
+
/*
|
356 |
+
tb_position_two = function() {
|
357 |
+
var tbWindow = $('#TB_window');
|
358 |
+
console.log(tbWindow);
|
359 |
+
|
360 |
+
}
|
361 |
+
*/
|
362 |
+
|
363 |
+
jQuery('#lp-frontend-options-container .upload_image_button').on('click', function (event) {
|
364 |
+
|
365 |
+
//console.log(parent_input);
|
366 |
+
var media_name = jQuery(this).attr('id');
|
367 |
+
media_name = media_name.replace('uploader_','');
|
368 |
+
var parent_el = jQuery(this).parent().parent();
|
369 |
+
jQuery(parent_el).find(".lp-success-message").remove();
|
370 |
+
jQuery(parent_el).find(".new-save-lp-frontend").remove();
|
371 |
+
var ajax_save_button = jQuery('<span class="button-primary new-save-lp-frontend" id="' + media_name + '" style="position: absolute; top: 0px; right: 34px;">Update</span>');
|
372 |
+
setTimeout(function() {
|
373 |
+
jQuery("#TB_iframeContent").contents().find('head').append('<link rel="stylesheet" href="/wp-content/plugins/landing-pages/css/customizer.media-uploader.css" type="text/css" />');
|
374 |
+
}, 500);
|
375 |
+
setTimeout(function() {
|
376 |
+
jQuery("#TB_iframeContent").contents().find('head').append('<link rel="stylesheet" href="/wp-content/plugins/landing-pages/css/customizer.media-uploader.css" type="text/css" />');
|
377 |
+
}, 2000);
|
378 |
+
|
379 |
+
//console.log(parent_el);
|
380 |
+
jQuery(ajax_save_button).appendTo(parent_el);
|
381 |
+
//alert(media_name);
|
382 |
+
jQuery.cookie('media_name', media_name);
|
383 |
+
jQuery.cookie('media_init', 1);
|
384 |
+
tb_show('', 'media-upload.php?type=image&type=image&TB_iframe=true');
|
385 |
+
return false;
|
386 |
+
}
|
387 |
+
);
|
388 |
+
|
389 |
+
window.tb_remove = function()
|
390 |
+
{
|
391 |
+
console.log('new-image-chosen');
|
392 |
+
$("#TB_imageOff").unbind("click");
|
393 |
+
$("#TB_closeWindowButton").unbind("click");
|
394 |
+
$("#TB_window").fadeOut("fast",function(){
|
395 |
+
$('#TB_window,#TB_overlay,#TB_HideSelect').remove();
|
396 |
+
});
|
397 |
+
$("#TB_load").remove();
|
398 |
+
if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
|
399 |
+
$("body","html").css({height: "auto", width: "auto"});
|
400 |
+
$("html").css("overflow","");
|
401 |
+
}
|
402 |
+
document.onkeydown = "";
|
403 |
+
document.onkeyup = "";
|
404 |
+
|
405 |
+
jQuery.cookie('media_init', 0);
|
406 |
+
return false;
|
407 |
+
}
|
408 |
+
|
409 |
+
window.send_to_editor = function(h) {
|
410 |
+
if (jQuery.cookie('media_init')==1)
|
411 |
+
{
|
412 |
+
var imgurl = jQuery('img',h).attr('src');
|
413 |
+
if (!imgurl)
|
414 |
+
{
|
415 |
+
var array = html.match("src=\"(.*?)\"");
|
416 |
+
imgurl = array[1];
|
417 |
+
}
|
418 |
+
//alert(jQuery.cookie('media_name'));
|
419 |
+
jQuery('#' + jQuery.cookie('media_name')).val(imgurl);
|
420 |
+
jQuery.cookie('media_init', 0);
|
421 |
+
tb_remove();
|
422 |
+
}
|
423 |
+
else
|
424 |
+
{
|
425 |
+
var ed, mce = typeof(tinymce) != 'undefined', qt = typeof(QTags) != 'undefined';
|
426 |
+
|
427 |
+
if ( !wpActiveEditor ) {
|
428 |
+
if ( mce && tinymce.activeEditor ) {
|
429 |
+
ed = tinymce.activeEditor;
|
430 |
+
wpActiveEditor = ed.id;
|
431 |
+
} else if ( !qt ) {
|
432 |
+
return false;
|
433 |
+
}
|
434 |
+
} else if ( mce ) {
|
435 |
+
if ( tinymce.activeEditor && (tinymce.activeEditor.id == 'mce_fullscreen' || tinymce.activeEditor.id == 'wp_mce_fullscreen') )
|
436 |
+
ed = tinymce.activeEditor;
|
437 |
+
else
|
438 |
+
ed = tinymce.get(wpActiveEditor);
|
439 |
+
}
|
440 |
+
|
441 |
+
if ( ed && !ed.isHidden() ) {
|
442 |
+
// restore caret position on IE
|
443 |
+
if ( tinymce.isIE && ed.windowManager.insertimagebookmark )
|
444 |
+
ed.selection.moveToBookmark(ed.windowManager.insertimagebookmark);
|
445 |
+
|
446 |
+
if ( h.indexOf('[caption') === 0 ) {
|
447 |
+
if ( ed.wpSetImgCaption )
|
448 |
+
h = ed.wpSetImgCaption(h);
|
449 |
+
} else if ( h.indexOf('[gallery') === 0 ) {
|
450 |
+
if ( ed.plugins.wpgallery )
|
451 |
+
h = ed.plugins.wpgallery._do_gallery(h);
|
452 |
+
} else if ( h.indexOf('[embed') === 0 ) {
|
453 |
+
if ( ed.plugins.wordpress )
|
454 |
+
h = ed.plugins.wordpress._setEmbed(h);
|
455 |
+
}
|
456 |
+
|
457 |
+
ed.execCommand('mceInsertContent', false, h);
|
458 |
+
} else if ( qt ) {
|
459 |
+
QTags.insertContent(h);
|
460 |
+
} else {
|
461 |
+
document.getElementById(wpActiveEditor).value += h;
|
462 |
+
}
|
463 |
+
|
464 |
+
jQuery.cookie('media_init', 0);
|
465 |
+
|
466 |
+
try{tb_remove();}catch(e){};
|
467 |
+
}
|
468 |
+
}
|
469 |
+
|
470 |
+
|
471 |
+
|
472 |
+
});
|
js/jquery.bindfirst.js
ADDED
@@ -0,0 +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 |
+
};
|
js/jquery.cookie.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
/*!
|
js/jquery.easing.min.js
ADDED
@@ -0,0 +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}});
|
js/jquery.form-population.js
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
jQuery(selector).each(
|
1 |
function(){
|
2 |
//if this item has been cookied, restore it
|
3 |
var name = jQuery(this).attr('name');
|
4 |
|
5 |
if( jQuery.cookie( name ) && type_input != 'submit' && type_input != 'hidden' ){
|
6 |
jQuery(this).val( jQuery.cookie(name) );
|
7 |
}
|
8 |
//assign a change function to the item to cookie it
|
9 |
jQuery(this).change(
|
10 |
function(){
|
11 |
jQuery.cookie(name, jQuery(this).val(), { path: '/', expires: 365 });
|
12 |
}
|
13 |
);
|
14 |
}
|
15 |
);
|
16 |
jQuery(selector).each(
|
17 |
function(){
|
18 |
var form_name = jQuery(this).attr('name');
|
19 |
var form_id = jQuery(this).attr('id');
|
20 |
var form_class = jQuery(this).attr('class');
|
21 |
if(typeof(form_name) != "undefined" && form_name !== null) {
|
22 |
jQuery.cookie("lp_form_uid", form_name, { path: '/', expires: 365 });
|
23 |
}
|
24 |
else if(typeof(form_id) != "undefined" && form_id !== null) {
|
25 |
jQuery.cookie("lp_form_uid", form_id, { path: '/', expires: 365 });
|
26 |
}
|
27 |
else if (typeof(form_class) != "undefined" && form_class !== null) {
|
28 |
jQuery.cookie("lp_form_uid", form_class, { path: '/', expires: 365 });
|
29 |
} else {
|
30 |
jQuery.cookie("lp_form_uid", 'form_generic', { path: '/', expires: 365 });
|
31 |
}
|
32 |
}
|
33 |
);
|
34 |
// Fill Form Inputs from Cookies
|
35 |
});
|
1 |
+
function wpl_remember_inputs( selector ){
|
2 |
jQuery(selector).each(
|
3 |
function(){
|
4 |
//if this item has been cookied, restore it
|
5 |
var name = jQuery(this).attr('name');
|
6 |
|
7 |
if( jQuery.cookie( name ) && type_input != 'submit' && type_input != 'hidden' ){
|
8 |
jQuery(this).val( jQuery.cookie(name) );
|
9 |
}
|
10 |
//assign a change function to the item to cookie it
|
11 |
jQuery(this).change(
|
12 |
function(){
|
13 |
jQuery.cookie(name, jQuery(this).val(), { path: '/', expires: 365 });
|
14 |
}
|
15 |
);
|
16 |
}
|
17 |
);
|
18 |
jQuery(selector).each(
|
19 |
function(){
|
20 |
var form_name = jQuery(this).attr('name');
|
21 |
var form_id = jQuery(this).attr('id');
|
22 |
var form_class = jQuery(this).attr('class');
|
23 |
if(typeof(form_name) != "undefined" && form_name !== null) {
|
24 |
jQuery.cookie("lp_form_uid", form_name, { path: '/', expires: 365 });
|
25 |
}
|
26 |
else if(typeof(form_id) != "undefined" && form_id !== null) {
|
27 |
jQuery.cookie("lp_form_uid", form_id, { path: '/', expires: 365 });
|
28 |
}
|
29 |
else if (typeof(form_class) != "undefined" && form_class !== null) {
|
30 |
jQuery.cookie("lp_form_uid", form_class, { path: '/', expires: 365 });
|
31 |
} else {
|
32 |
jQuery.cookie("lp_form_uid", 'form_generic', { path: '/', expires: 365 });
|
33 |
}
|
34 |
}
|
35 |
);
|
36 |
// Fill Form Inputs from Cookies
|
37 |
});
|
js/jquery.funnel-tracking.js
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
var count = 0;
|
1 |
for(var key in obj)
|
2 |
{
|
3 |
|
4 |
|
5 |
}
|
6 |
return count;
|
7 |
var count = 0;
|
8 |
for(var prop in obj) {
|
9 |
if(obj.hasOwnProperty(prop))
|
10 |
++count;
|
11 |
}
|
12 |
return count;
|
13 |
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');
|
14 |
if (! length) {
|
15 |
length = Math.floor(Math.random() * chars.length);
|
16 |
}
|
17 |
var str = '';
|
18 |
for (var i = 0; i < length; i++) {
|
19 |
str += chars[Math.floor(Math.random() * chars.length)];
|
20 |
}
|
21 |
return str;
|
22 |
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');
|
23 |
if (! length) {
|
24 |
length = Math.floor(Math.random() * chars.length);
|
25 |
}
|
26 |
var str = '';
|
27 |
for (var i = 0; i < length; i++) {
|
28 |
str += chars[Math.floor(Math.random() * chars.length)];
|
29 |
}
|
30 |
return str;
|
31 |
return new Date(date.getTime() + minutes*60000);
|
32 |
* Date Format 1.2.3
|
33 |
* (c) 2007-2009 Steven Levithan <stevenlevithan.com>
|
34 |
* MIT license
|
35 |
*
|
36 |
* Includes enhancements by Scott Trenda <scott.trenda.net>
|
37 |
* and Kris Kowal <cixar.com/~kris.kowal/>
|
38 |
*
|
39 |
* Accepts a date, a mask, or a date and a mask.
|
40 |
* Returns a formatted version of the given date.
|
41 |
* The date defaults to the current date/time.
|
42 |
* The mask defaults to dateFormat.masks.default.
|
43 |
*/
|
44 |
var p = jQuery("pre"),
|
45 |
result = "",
|
46 |
urlParams = {};
|
47 |
(function () {
|
48 |
var e,
|
49 |
d = function (s) { return decodeURIComponent(s).replace(/\+/g, " "); },
|
50 |
q = window.location.search.substring(1),
|
51 |
r = /([^&=]+)=?([^&]*)/g;
|
52 |
while (e = r.exec(q)) {
|
53 |
if (e[1].indexOf("[") == "-1")
|
54 |
urlParams[d(e[1])] = d(e[2]);
|
55 |
else {
|
56 |
var b1 = e[1].indexOf("["),
|
57 |
aN = e[1].slice(b1+1, e[1].indexOf("]", b1)),
|
58 |
pN = d(e[1].slice(0, b1));
|
59 |
|
60 |
if (typeof urlParams[pN] != "object")
|
61 |
urlParams[d(pN)] = {},
|
62 |
urlParams[d(pN)].length = 0;
|
63 |
|
64 |
if (aN)
|
65 |
urlParams[d(pN)][d(aN)] = d(e[2]);
|
66 |
else
|
67 |
Array.prototype.push.call(urlParams[d(pN)], d(e[2]));
|
68 |
}
|
69 |
}
|
70 |
})();
|
71 |
if (JSON) {
|
72 |
result = JSON.stringify(urlParams, null, 4);
|
73 |
for (var k in urlParams) {
|
74 |
if (typeof urlParams[k] == "object") {
|
75 |
for (var k2 in urlParams[k])
|
76 |
jQuery.cookie(k2, urlParams[k][k2], { expires: 365 });
|
77 |
}
|
78 |
else {
|
79 |
jQuery.cookie(k, urlParams[k], { expires: 365 }); }
|
80 |
}
|
81 |
}
|
82 |
*/
|
83 |
jQuery.cookie("wp_lead_uid", wp_lead_uid_val, { path: '/', expires: 365 });
|
84 |
console.log("Start New Tracking Session");
|
85 |
// Start New Tracking Block
|
86 |
trackObj.push({
|
87 |
} else {
|
1 |
+
|
2 |
var count = 0;
|
3 |
for(var key in obj)
|
4 |
{
|
5 |
|
6 |
|
7 |
}
|
8 |
return count;
|
9 |
var count = 0;
|
10 |
for(var prop in obj) {
|
11 |
if(obj.hasOwnProperty(prop))
|
12 |
++count;
|
13 |
}
|
14 |
return count;
|
15 |
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');
|
16 |
if (! length) {
|
17 |
length = Math.floor(Math.random() * chars.length);
|
18 |
}
|
19 |
var str = '';
|
20 |
for (var i = 0; i < length; i++) {
|
21 |
str += chars[Math.floor(Math.random() * chars.length)];
|
22 |
}
|
23 |
return str;
|
24 |
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');
|
25 |
if (! length) {
|
26 |
length = Math.floor(Math.random() * chars.length);
|
27 |
}
|
28 |
var str = '';
|
29 |
for (var i = 0; i < length; i++) {
|
30 |
str += chars[Math.floor(Math.random() * chars.length)];
|
31 |
}
|
32 |
return str;
|
33 |
return new Date(date.getTime() + minutes*60000);
|
34 |
* Date Format 1.2.3
|
35 |
* (c) 2007-2009 Steven Levithan <stevenlevithan.com>
|
36 |
* MIT license
|
37 |
*
|
38 |
* Includes enhancements by Scott Trenda <scott.trenda.net>
|
39 |
* and Kris Kowal <cixar.com/~kris.kowal/>
|
40 |
*
|
41 |
* Accepts a date, a mask, or a date and a mask.
|
42 |
* Returns a formatted version of the given date.
|
43 |
* The date defaults to the current date/time.
|
44 |
* The mask defaults to dateFormat.masks.default.
|
45 |
*/
|
46 |
var p = jQuery("pre"),
|
47 |
result = "",
|
48 |
urlParams = {};
|
49 |
(function () {
|
50 |
var e,
|
51 |
d = function (s) { return decodeURIComponent(s).replace(/\+/g, " "); },
|
52 |
q = window.location.search.substring(1),
|
53 |
r = /([^&=]+)=?([^&]*)/g;
|
54 |
while (e = r.exec(q)) {
|
55 |
if (e[1].indexOf("[") == "-1")
|
56 |
urlParams[d(e[1])] = d(e[2]);
|
57 |
else {
|
58 |
var b1 = e[1].indexOf("["),
|
59 |
aN = e[1].slice(b1+1, e[1].indexOf("]", b1)),
|
60 |
pN = d(e[1].slice(0, b1));
|
61 |
|
62 |
if (typeof urlParams[pN] != "object")
|
63 |
urlParams[d(pN)] = {},
|
64 |
urlParams[d(pN)].length = 0;
|
65 |
|
66 |
if (aN)
|
67 |
urlParams[d(pN)][d(aN)] = d(e[2]);
|
68 |
else
|
69 |
Array.prototype.push.call(urlParams[d(pN)], d(e[2]));
|
70 |
}
|
71 |
}
|
72 |
})();
|
73 |
if (JSON) {
|
74 |
result = JSON.stringify(urlParams, null, 4);
|
75 |
for (var k in urlParams) {
|
76 |
if (typeof urlParams[k] == "object") {
|
77 |
for (var k2 in urlParams[k])
|
78 |
jQuery.cookie(k2, urlParams[k][k2], { expires: 365 });
|
79 |
}
|
80 |
else {
|
81 |
jQuery.cookie(k, urlParams[k], { expires: 365 }); }
|
82 |
}
|
83 |
}
|
84 |
*/
|
85 |
jQuery.cookie("wp_lead_uid", wp_lead_uid_val, { path: '/', expires: 365 });
|
86 |
console.log("Start New Tracking Session");
|
87 |
// Start New Tracking Block
|
88 |
trackObj.push({
|
89 |
} else {
|
js/jquery.kool-swap.js
ADDED
@@ -0,0 +1,577 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Kool Swap v0.2.2
|
3 |
+
by Joscha Schmidt - http://www.itsjoe.de
|
4 |
+
|
5 |
+
For more information, visit:
|
6 |
+
http://itsjoe.de/kool-swap/
|
7 |
+
|
8 |
+
Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
|
9 |
+
- free for use in both personal and commercial projects
|
10 |
+
- attribution requires leaving author name, author link, and the license info intact
|
11 |
+
|
12 |
+
*/
|
13 |
+
(function( $ ){
|
14 |
+
var ksGlobal = {
|
15 |
+
defaults: {
|
16 |
+
swapBox : '',
|
17 |
+
loadBox : '',
|
18 |
+
swapTriggerBox : '.kool-swap',
|
19 |
+
swapTrigger : 'a',
|
20 |
+
loadErrorMessage : 'The requested page could not be loaded.',
|
21 |
+
loadErrorBacklinkText : 'Go back to the last page',
|
22 |
+
bouncingBoxes : '',
|
23 |
+
topToBottom : false,
|
24 |
+
leftToRight : false,
|
25 |
+
inEasing : 'easeInSine',
|
26 |
+
outEasing : 'easeInBack',
|
27 |
+
inDuration : 700,
|
28 |
+
outDuration : 500,
|
29 |
+
preloadImages : false,
|
30 |
+
direction: '',
|
31 |
+
positionType: 'fixed',
|
32 |
+
},
|
33 |
+
listenToPopState: function(settings, $swapTrigger) {
|
34 |
+
$(window)
|
35 |
+
.off('popstate')
|
36 |
+
.on('popstate', function(e) { // Listen to popstate
|
37 |
+
var $swapBoxIn;
|
38 |
+
switch (settings.direction) {
|
39 |
+
case 'left-to-right':
|
40 |
+
$swapBoxIn = 'ks-swap-box-in-l-pushstate';
|
41 |
+
break;
|
42 |
+
case 'right-to-left':
|
43 |
+
$swapBoxIn = 'ks-swap-box-in-r-pushstate';
|
44 |
+
break;
|
45 |
+
case 'top-to-bottom':
|
46 |
+
$swapBoxIn = 'ks-swap-box-in-t-pushstate';
|
47 |
+
break;
|
48 |
+
case 'bottom-to-top':
|
49 |
+
$swapBoxIn = 'ks-swap-box-in-b-pushstate';
|
50 |
+
break;
|
51 |
+
case '':
|
52 |
+
$swapBoxIn = 'ks-swap-box-in-pushstate';
|
53 |
+
break;
|
54 |
+
default:
|
55 |
+
alert('Kool Swap Error: \n The defined direction ' + settings.direction + ' does not exist.');
|
56 |
+
return false;
|
57 |
+
break;
|
58 |
+
}
|
59 |
+
ksPageSwap.swapHistoryPage(settings, $swapTrigger, $swapBoxIn);
|
60 |
+
e.stopPropagation();
|
61 |
+
});
|
62 |
+
}
|
63 |
+
};
|
64 |
+
|
65 |
+
var ksPageSwap = {
|
66 |
+
defaults: function($this, options) {
|
67 |
+
psSettings = $this.data('kool-swap-window');
|
68 |
+
|
69 |
+
if(typeof(psSettings) == 'undefined') {
|
70 |
+
psSettings = $.extend({}, ksGlobal.defaults, options);
|
71 |
+
$this.data('kool-swap-window', psSettings);
|
72 |
+
} else {
|
73 |
+
psSettings = $.extend(psSettings, options);
|
74 |
+
}
|
75 |
+
|
76 |
+
return psSettings;
|
77 |
+
},
|
78 |
+
init: function(options) {
|
79 |
+
var hasPushstate = (window.history && history.pushState);
|
80 |
+
|
81 |
+
return this.each(function() {
|
82 |
+
ksPageSwap.defaults($(this), options);
|
83 |
+
|
84 |
+
var $swapBox = $(psSettings.swapBox), // Use the swapBox option if it is called without selector
|
85 |
+
swapTriggerBox = psSettings.swapTriggerBox,
|
86 |
+
swapTrigger = psSettings.swapTrigger,
|
87 |
+
pageSwap = true;
|
88 |
+
|
89 |
+
if (hasPushstate && $('html').not('[data-ks-initialised]') ) {
|
90 |
+
$('html').attr('data-ks-initialised', 'true');
|
91 |
+
ksGlobal.listenToPopState(psSettings, $(swapTriggerBox + ' ' + swapTrigger));
|
92 |
+
}
|
93 |
+
|
94 |
+
ksMethods.trigger(psSettings, hasPushstate, swapTriggerBox, swapTrigger, pageSwap);
|
95 |
+
});
|
96 |
+
},
|
97 |
+
swapHistoryPage: function(psSettings, $swapTrigger, swapBoxIn) {
|
98 |
+
if($('html').is('[data-ks-history-pushed]')) {
|
99 |
+
var href = location.pathname;
|
100 |
+
//var currentpage = locationPath.replace(/^.*[\\\/]/, '');
|
101 |
+
ksMethods.ksLoadPage(psSettings, $swapTrigger, href, swapBoxIn);
|
102 |
+
}
|
103 |
+
},
|
104 |
+
destroy : function($this) {
|
105 |
+
$(document).off('click', psSettings.swapTriggerBox + ' ' + psSettings.swapTrigger);
|
106 |
+
return $(this).each(function() {
|
107 |
+
var $this = $(this);
|
108 |
+
$this.removeData('kool-swap-window');
|
109 |
+
});
|
110 |
+
},
|
111 |
+
};
|
112 |
+
|
113 |
+
var ksSelectorSwap = {
|
114 |
+
defaults: function($this, options) {
|
115 |
+
settings = $this.data('kool-swap');
|
116 |
+
|
117 |
+
if(typeof(settings) == 'undefined') {
|
118 |
+
settings = $.extend({}, ksGlobal.defaults, options);
|
119 |
+
$this.data('kool-swap', settings);
|
120 |
+
} else {
|
121 |
+
settings = $.extend(settings, options);
|
122 |
+
}
|
123 |
+
return settings;
|
124 |
+
},
|
125 |
+
init: function(options) {
|
126 |
+
return this.each(function() {
|
127 |
+
ksSelectorSwap.defaults($(this), options);
|
128 |
+
|
129 |
+
settings.swapBox = $(this); // use the given selector
|
130 |
+
|
131 |
+
var swapTriggerBox = settings.swapTriggerBox,
|
132 |
+
swapTrigger = settings.swapTrigger,
|
133 |
+
pageSwap = false;
|
134 |
+
|
135 |
+
ksMethods.trigger(settings, true, swapTriggerBox, swapTrigger, pageSwap);
|
136 |
+
});
|
137 |
+
},
|
138 |
+
destroy : function($this) {
|
139 |
+
$(document).off('click', settings.swapTriggerBox + ' ' + settings.swapTrigger);
|
140 |
+
return $(this).each(function() {
|
141 |
+
var $this = $(this);
|
142 |
+
$this.removeData('kool-swap');
|
143 |
+
});
|
144 |
+
},
|
145 |
+
|
146 |
+
};
|
147 |
+
|
148 |
+
var ksMethods = {
|
149 |
+
trigger: function(settings, hasPushstate, swapTriggerBox, swapTrigger, pageSwap) {
|
150 |
+
if (hasPushstate) {
|
151 |
+
function is_touch_device() { // check if the plugin's running on a touch device
|
152 |
+
var el = document.createElement('div');
|
153 |
+
el.setAttribute('ongesturestart', 'return;');
|
154 |
+
return typeof el.ongesturestart === "function";
|
155 |
+
};
|
156 |
+
|
157 |
+
|
158 |
+
if (is_touch_device()) {
|
159 |
+
$(document)
|
160 |
+
// for the 404 back link
|
161 |
+
.on('touchstart', '.ajaxPageSwitchBacklink', function() {
|
162 |
+
window.history.back();
|
163 |
+
})
|
164 |
+
.off('touchstart', swapTriggerBox + ' ' + swapTrigger)
|
165 |
+
.on('touchstart', swapTriggerBox + ' ' + swapTrigger, function(e) {
|
166 |
+
e.preventDefault();
|
167 |
+
var $swapTrigger = $(this);
|
168 |
+
|
169 |
+
ksMethods.ksDefineSwapBoxIn(settings, $swapTrigger, hasPushstate, pageSwap);
|
170 |
+
});
|
171 |
+
} else {
|
172 |
+
$(document)
|
173 |
+
// for the 404 back link
|
174 |
+
.on('click', '.ajaxPageSwitchBacklink', function() {
|
175 |
+
window.history.back();
|
176 |
+
})
|
177 |
+
.off('click', swapTriggerBox + ' ' + swapTrigger)
|
178 |
+
.on('click', swapTriggerBox + ' ' + swapTrigger, function(e) {
|
179 |
+
e.preventDefault();
|
180 |
+
var $swapTrigger = $(this);
|
181 |
+
|
182 |
+
ksMethods.ksDefineSwapBoxIn(settings, $swapTrigger, hasPushstate, pageSwap);
|
183 |
+
});
|
184 |
+
}
|
185 |
+
}
|
186 |
+
},
|
187 |
+
ksDefineSwapBoxIn: function(settings, $swapTrigger, hasPushstate, pageSwap) {
|
188 |
+
switch (settings.direction) {
|
189 |
+
case 'left-to-right':
|
190 |
+
case 'right-to-left':
|
191 |
+
case 'top-to-bottom':
|
192 |
+
case 'bottom-to-top':
|
193 |
+
case '':
|
194 |
+
$swapBoxIn = 'ks-swap-box-in';
|
195 |
+
if (!$('.ks-swap-box-in').length) {
|
196 |
+
var item = $(this);
|
197 |
+
ksMethods.ksCollectLoadPageInfo(settings, $swapTrigger, hasPushstate, $swapBoxIn, pageSwap);
|
198 |
+
} else {
|
199 |
+
return false;
|
200 |
+
}
|
201 |
+
break;
|
202 |
+
default:
|
203 |
+
alert('Kool Swap Error: \n The defined direction ' + settings.direction + ' does not exist.');
|
204 |
+
return false;
|
205 |
+
break;
|
206 |
+
}
|
207 |
+
},
|
208 |
+
ksCollectLoadPageInfo: function(settings, $swapTrigger, hasPushstate, $swapBoxIn, pageSwap) {
|
209 |
+
var url = $swapTrigger.attr('href');
|
210 |
+
|
211 |
+
var $swapBoxIn;
|
212 |
+
switch (settings.direction) {
|
213 |
+
case 'left-to-right':
|
214 |
+
$swapBoxIn = 'ks-swap-box-in-l';
|
215 |
+
break;
|
216 |
+
case 'right-to-left':
|
217 |
+
$swapBoxIn = 'ks-swap-box-in-r';
|
218 |
+
break;
|
219 |
+
case 'top-to-bottom':
|
220 |
+
$swapBoxIn = 'ks-swap-box-in-t';
|
221 |
+
break;
|
222 |
+
case 'bottom-to-top':
|
223 |
+
$swapBoxIn = 'ks-swap-box-in-b';
|
224 |
+
break;
|
225 |
+
case '':
|
226 |
+
$swapBoxIn = 'ks-swap-box-in';
|
227 |
+
break;
|
228 |
+
default:
|
229 |
+
alert('Kool Swap Error: \n The defined direction ' + settings.direction + ' does not exist.');
|
230 |
+
return false;
|
231 |
+
break;
|
232 |
+
}
|
233 |
+
|
234 |
+
// This generates a canvas from the current page to freeze the contents as they are. It may be used later.
|
235 |
+
// Include http://html2canvas.hertzen.com/build/html2canvas.js to test it.
|
236 |
+
// html2canvas($('#' + swapBoxId), {
|
237 |
+
// onrendered: function(canvas) {
|
238 |
+
// $('#' + swapBoxId).find('*').remove().end().append(canvas);
|
239 |
+
// }
|
240 |
+
// });
|
241 |
+
|
242 |
+
ksMethods.ksLoadPage(settings, $swapTrigger, url, $swapBoxIn, pageSwap);
|
243 |
+
|
244 |
+
if (pageSwap) {
|
245 |
+
history.pushState({'url':url}, null, url); // Update the url
|
246 |
+
$('html').attr('data-ks-history-pushed', 'true');
|
247 |
+
}
|
248 |
+
},
|
249 |
+
ksLoadPage: function(settings, $swapTrigger, href, swapBoxIn, pageSwap) {
|
250 |
+
var $swapBox = $(settings.swapBox); // redefine $swapBox variable
|
251 |
+
if (href != '') {
|
252 |
+
ksMethods.ksAddSwapBoxIn(settings, swapBoxIn);
|
253 |
+
$.ajax({
|
254 |
+
type: 'GET',
|
255 |
+
url: href,
|
256 |
+
data: {},
|
257 |
+
beforeSend: function() {
|
258 |
+
ksMethods.ksCreateLoadBox();
|
259 |
+
},
|
260 |
+
error : function(data, xhrStatusText, xhrStatus) {
|
261 |
+
$swapBox.html(settings.loadErrorMessage + '<p>' + xhrStatusText + ': <strong>' + xhrStatus + '</strong></p><p><a class="ajaxPageSwitchBacklink">' + settings.loadErrorBacklinkText + '</a></p>');
|
262 |
+
},
|
263 |
+
success: function(data) {
|
264 |
+
$(settings.swapTriggerBox).find(settings.swapTrigger).filter('.active').removeClass('active');
|
265 |
+
$swapTrigger.addClass('active');
|
266 |
+
|
267 |
+
if (settings.bouncingBoxes) {
|
268 |
+
ksMethods.ksFadeSiblings(settings, $swapTrigger, data, swapBoxIn, pageSwap);
|
269 |
+
|
270 |
+
} else {
|
271 |
+
ksMethods.ksPositionAndPrepare(settings, $swapTrigger, data, swapBoxIn, pageSwap);
|
272 |
+
}
|
273 |
+
},
|
274 |
+
dataType: 'html',
|
275 |
+
});
|
276 |
+
} else {
|
277 |
+
alert('There is no target defined! Please check the references (i.e. normally href) of the swapTriggers.');
|
278 |
+
}
|
279 |
+
},
|
280 |
+
ksAddSwapBoxIn: function(settings, swapBoxIn) {
|
281 |
+
var $swapBox = $(settings.swapBox), // redefine $swapBox variable
|
282 |
+
swapBoxClass = $swapBox.attr('class'),
|
283 |
+
swapBoxTagName = $swapBox.prop("tagName");
|
284 |
+
|
285 |
+
$(document).find('.ks-swap-box-in').remove();
|
286 |
+
|
287 |
+
if (settings.moveSwapBoxClasses) {
|
288 |
+
$swapBox.after('<' + swapBoxTagName.toLowerCase() + ' class="ks-swap-box-in ' + (typeof swapBoxClass != 'undefined' ? swapBoxClass : '') + '" id="' + swapBoxIn + '"></' + swapBoxTagName.toLowerCase() + '>'); // create the temp container
|
289 |
+
} else {
|
290 |
+
$swapBox.after('<' + swapBoxTagName.toLowerCase() + ' class="ks-swap-box-in" id="' + swapBoxIn + '"></' + swapBoxTagName.toLowerCase() + '>'); // create the temp container
|
291 |
+
}
|
292 |
+
|
293 |
+
$swapBox.siblings('.ks-swap-box-in')
|
294 |
+
.hide();
|
295 |
+
|
296 |
+
},
|
297 |
+
ksFadeSiblings: function(settings, $swapTrigger, data, swapBoxIn, pageSwap) {
|
298 |
+
$(document)
|
299 |
+
.find(settings.bouncingBoxes)
|
300 |
+
.animate({opacity: 0}, 50, function() {
|
301 |
+
ksMethods.ksPositionAndPrepare(settings, $swapTrigger, data, swapBoxIn);
|
302 |
+
});
|
303 |
+
},
|
304 |
+
ksPositionAndPrepare: function(settings, $swapTrigger, data, swapBoxIn, pageSwap) {
|
305 |
+
var $swapBox = $(settings.swapBox), // redefine $swapBox variable
|
306 |
+
swapBoxId = $swapBox.attr('id'),
|
307 |
+
mainOffset = $swapBox.position(),
|
308 |
+
mainWidth = $swapBox.width(),
|
309 |
+
mainMarginLeft = $swapBox.css('margin-left'),
|
310 |
+
mainMarginRight = $swapBox.css('margin-left'),
|
311 |
+
swapBoxLeftAbsolute = mainOffset.left + parseFloat(mainMarginLeft);
|
312 |
+
swapBoxRightAbsolute = mainOffset.left + parseFloat(mainMarginLeft) + mainWidth - parseFloat(mainMarginRight),
|
313 |
+
$swapBoxIn = $('#' + swapBoxIn),
|
314 |
+
loadSelector = $swapTrigger.attr('data-ks-load-selector');
|
315 |
+
|
316 |
+
if (pageSwap) {
|
317 |
+
var htmlId = data.match(/<\/*html\s+.*id="([^"].*)".*>/), // exclude html classes
|
318 |
+
bodyId = data.match(/<\/*body\s+.*id="([^"].*)".*>/), // exclude body classes
|
319 |
+
htmlClass = data.match(/<\/*html\s+.*class="([^"].*)".*>/), // exclude html classes
|
320 |
+
bodyClass = data.match(/<\/*body\s+.*class="([^"].*)".*>/), // exclude body classes
|
321 |
+
pageTitle = data.match(/<\/*title>(.*)<\/title>/); // exclude page title
|
322 |
+
}
|
323 |
+
|
324 |
+
$swapBox
|
325 |
+
.addClass('ks-swap-box-out')
|
326 |
+
.css({
|
327 |
+
position: 'absolute',
|
328 |
+
top: mainOffset.top,
|
329 |
+
left: swapBoxLeftAbsolute,
|
330 |
+
marginLeft: 0,
|
331 |
+
width: mainWidth,
|
332 |
+
});
|
333 |
+
|
334 |
+
if (swapBoxInContents = $(data).filter('#' + swapBoxId).html() != undefined) { // Check if we have to use .filter or .find to get the data
|
335 |
+
if (settings.loadBox) {
|
336 |
+
var swapBoxInContainer = $(data).filter(settings.loadBox);
|
337 |
+
} else if (loadSelector) {
|
338 |
+
var swapBoxInContainer = $(data).filter(loadSelector);
|
339 |
+
} else {
|
340 |
+
var swapBoxInContainer = $(data).filter('#' + swapBoxId);
|
341 |
+
}
|
342 |
+
swapBoxInContents = swapBoxInContainer.html();
|
343 |
+
var swapBoxInClasses = swapBoxInContainer.attr('class');
|
344 |
+
} else {
|
345 |
+
if (settings.loadBox) {
|
346 |
+
var swapBoxInContainer = $(data).find(settings.loadBox);
|
347 |
+
} else if (loadSelector) {
|
348 |
+
var swapBoxInContainer = $(data).find(loadSelector);
|
349 |
+
} else {
|
350 |
+
var swapBoxInContainer = $(data).find('#' + swapBoxId);
|
351 |
+
}
|
352 |
+
swapBoxInContents = swapBoxInContainer.html();
|
353 |
+
var swapBoxInClasses = swapBoxInContainer.attr('class');
|
354 |
+
}
|
355 |
+
|
356 |
+
$swapBoxIn
|
357 |
+
.addClass(swapBoxInClasses) // add the swapBoxIn classes
|
358 |
+
.css({
|
359 |
+
position: settings.positionType,
|
360 |
+
marginLeft: 0, // Set the margin to 0 because the swapBox was positioned in place
|
361 |
+
top: mainOffset.top,
|
362 |
+
left: swapBoxLeftAbsolute,
|
363 |
+
})
|
364 |
+
.html(swapBoxInContents); // Attach the contents to the target temp container
|
365 |
+
|
366 |
+
var swapBoxInImages = $swapBoxIn.find('img'); // Check if there are images in the swapIn box
|
367 |
+
var count = 0;
|
368 |
+
if (swapBoxInImages.length && settings.preloadImages == true) {
|
369 |
+
swapBoxInImages.on('load', function() {
|
370 |
+
count++;
|
371 |
+
if (count == swapBoxInImages.length){
|
372 |
+
$(document).trigger('ksLoadCallback'); // Trigger the ksLoad callback event
|
373 |
+
ksMethods.ksSwapContent(settings, swapBoxIn, $swapTrigger, mainOffset, swapBoxLeftAbsolute, mainWidth, htmlId, bodyId, htmlClass, bodyClass, pageTitle, pageSwap);
|
374 |
+
}
|
375 |
+
});
|
376 |
+
} else {
|
377 |
+
$(document).trigger('ksLoadCallback'); // Trigger the ksLoad callback event
|
378 |
+
ksMethods.ksSwapContent(settings, swapBoxIn, $swapTrigger, mainOffset, swapBoxLeftAbsolute, mainWidth, htmlId, bodyId, htmlClass, bodyClass, pageTitle, pageSwap);
|
379 |
+
}
|
380 |
+
},
|
381 |
+
// Swap the content
|
382 |
+
ksSwapContent: function(settings, swapBoxIn, $swapTrigger, mainOffset, swapBoxLeftAbsolute, mainWidth, htmlId, bodyId, htmlClass, bodyClass, pageTitle, pageSwap) {
|
383 |
+
var $swapBox = $(settings.swapBox), // redefine $swapBox variable
|
384 |
+
swapBoxId = $swapBox.attr('id'),
|
385 |
+
$swapBoxIn = $('#' + swapBoxIn),
|
386 |
+
swapBoxInHeight = $swapBoxIn.outerHeight(),
|
387 |
+
swapBoxInWidth = $swapBoxIn.outerWidth(),
|
388 |
+
swapBoxHeight = $swapBox.outerHeight(),
|
389 |
+
viewportHeight = $(window).outerHeight(),
|
390 |
+
viewportWidth = $(window).outerWidth(),
|
391 |
+
hash = $swapTrigger.prop('hash');
|
392 |
+
|
393 |
+
clearTimeout(loadTimer);
|
394 |
+
ksMethods.ksRemoveLoadBox();
|
395 |
+
|
396 |
+
if (settings.direction) {
|
397 |
+
$swapBoxIn.css({width: mainWidth});
|
398 |
+
|
399 |
+
var swapBoxOutAnimProperties = {}, swapBoxInAnimProperties = {};
|
400 |
+
// Define animation value
|
401 |
+
var swapBoxOutAnimValue;
|
402 |
+
switch (swapBoxIn) {
|
403 |
+
case 'ks-swap-box-in-b-pushstate':
|
404 |
+
case 'ks-swap-box-in-t':
|
405 |
+
$swapBoxIn.css('top', -swapBoxInHeight * 2);
|
406 |
+
swapBoxOutAnimValue = viewportHeight * 3;
|
407 |
+
break;
|
408 |
+
case 'ks-swap-box-in-t-pushstate':
|
409 |
+
case 'ks-swap-box-in-b':
|
410 |
+
$swapBoxIn.css('top', swapBoxHeight * 1.5);
|
411 |
+
swapBoxOutAnimValue = -swapBoxHeight * 1.5;
|
412 |
+
break;
|
413 |
+
case 'ks-swap-box-in-r-pushstate':
|
414 |
+
case 'ks-swap-box-in-l':
|
415 |
+
$swapBoxIn.css('left', -viewportWidth);
|
416 |
+
swapBoxOutAnimValue = viewportWidth;
|
417 |
+
break;
|
418 |
+
case 'ks-swap-box-in-l-pushstate':
|
419 |
+
case 'ks-swap-box-in-r':
|
420 |
+
$swapBoxIn.css('left', viewportWidth);
|
421 |
+
swapBoxOutAnimValue = -viewportWidth;
|
422 |
+
break;
|
423 |
+
default:
|
424 |
+
alert('Kool Swap Error: \n The swapBoxIn class is in an undefined format: ' + swapBoxIn + '.');
|
425 |
+
return false;
|
426 |
+
break;
|
427 |
+
}
|
428 |
+
|
429 |
+
switch (settings.direction) {
|
430 |
+
case 'left-to-right':
|
431 |
+
case 'right-to-left':
|
432 |
+
var finalInDuration = settings.inDuration,
|
433 |
+
finalOutDuration = settings.outDuration;
|
434 |
+
|
435 |
+
swapBoxOutAnimProperties = {left: swapBoxOutAnimValue};
|
436 |
+
swapBoxInAnimProperties = {left: swapBoxLeftAbsolute};
|
437 |
+
|
438 |
+
$swapBoxIn.css('top', mainOffset.top);
|
439 |
+
$('body') // Prevent horizontal scrollbars on animation
|
440 |
+
.css({
|
441 |
+
overflowX: 'hidden',
|
442 |
+
overflowY: 'scroll',
|
443 |
+
});
|
444 |
+
break;
|
445 |
+
case 'top-to-bottom':
|
446 |
+
case 'bottom-to-top':
|
447 |
+
/* Every page wants to reach the end position in the defined space of time (duration).
|
448 |
+
* This causes that high pages (based on the height in pixels after all content were loaded)
|
449 |
+
* seem to animate faster than low pages.
|
450 |
+
* I thought about a work around and came to the formula DURATION + (HEIGHT OF THE SWAP (IN) BOX / DURATION * 100)
|
451 |
+
* This calculates a final in-duration value that seems to work fine.
|
452 |
+
*/
|
453 |
+
|
454 |
+
var additionValue = (swapBoxHeight * settings.inDuration / 1000);
|
455 |
+
var finalVal = additionValue / 100;
|
456 |
+
var finalInDuration = settings.inDuration + finalVal;
|
457 |
+
var finalOutDuration = settings.outDuration;
|
458 |
+
|
459 |
+
swapBoxInAnimProperties = {top: mainOffset.top};
|
460 |
+
swapBoxOutAnimProperties = {top: swapBoxOutAnimValue};
|
461 |
+
|
462 |
+
$('body').css('overflow-y', 'scroll'); // Prevent vertical scrollbars on animation
|
463 |
+
break;
|
464 |
+
}
|
465 |
+
|
466 |
+
$swapBox
|
467 |
+
.stop()
|
468 |
+
.show()
|
469 |
+
.animate(
|
470 |
+
swapBoxOutAnimProperties, finalOutDuration, settings.outEasing, function() {
|
471 |
+
$(this).remove();
|
472 |
+
if (pageSwap) {
|
473 |
+
$(document).scrollTop(0); // Scroll the page to top to avoid flickering
|
474 |
+
ksMethods.ksSwitchClasses(htmlId, bodyId, htmlClass, bodyClass, pageTitle);
|
475 |
+
}
|
476 |
+
});
|
477 |
+
|
478 |
+
$swapBoxIn
|
479 |
+
.stop()
|
480 |
+
.show()
|
481 |
+
.animate(
|
482 |
+
swapBoxInAnimProperties, finalInDuration, settings.inEasing, function() {
|
483 |
+
$(this)
|
484 |
+
.css({display: '', left: '', marginLeft: '', position: '', top: '', width: '',}) // Reset all setted styles
|
485 |
+
.attr('id', swapBoxId) // Give the swapBox id back to the final animated swapBoxIn
|
486 |
+
.removeClass('ks-swap-box-in');
|
487 |
+
|
488 |
+
ksMethods.animationCallback(hash);
|
489 |
+
ksMethods.ksCheckForSiblings(settings);
|
490 |
+
});
|
491 |
+
} else {
|
492 |
+
$swapBox
|
493 |
+
.animate({opacity: 0}, settings.outDuration, function() {
|
494 |
+
$(this).remove(); // remove the $swapBox container
|
495 |
+
if (pageSwap) {
|
496 |
+
ksMethods.ksSwitchClasses(htmlId, bodyId, htmlClass, bodyClass, pageTitle);
|
497 |
+
}
|
498 |
+
$swapBoxIn
|
499 |
+
.css({display: '', left: '', marginLeft: '', opacity: 0, position: '', top: '', width: '',}) // Reset all setted styles
|
500 |
+
.animate({opacity: 1}, settings.inDuration, function() {
|
501 |
+
ksMethods.animationCallback(hash);
|
502 |
+
ksMethods.ksCheckForSiblings(settings);
|
503 |
+
})
|
504 |
+
.attr('id', swapBoxId).removeClass('ks-swap-box-in');
|
505 |
+
});
|
506 |
+
}
|
507 |
+
},
|
508 |
+
animationCallback: function(hash) {
|
509 |
+
if (hash) {
|
510 |
+
$('html:not(:animated),body:not(:animated)').animate({scrollTop: $(hash).position().top },'normal');
|
511 |
+
}
|
512 |
+
},
|
513 |
+
ksCheckForSiblings: function(settings) {
|
514 |
+
if (settings.bouncingBoxes) {
|
515 |
+
$(document)
|
516 |
+
.find(settings.bouncingBoxes)
|
517 |
+
.animate({opacity: 1}, 400, function() {
|
518 |
+
ksMethods.ksSwapCallback();
|
519 |
+
});
|
520 |
+
} else {
|
521 |
+
ksMethods.ksSwapCallback();
|
522 |
+
}
|
523 |
+
},
|
524 |
+
ksSwitchClasses : function(htmlId, bodyId, htmlClass, bodyClass, pageTitle) {
|
525 |
+
$('html, body').attr({ // remove ids and classes from html and body
|
526 |
+
'class': '',
|
527 |
+
'id' : '',
|
528 |
+
});
|
529 |
+
(htmlId ? $('html').attr('id', htmlId[1]) : ''); // Add IDs from the target page
|
530 |
+
(bodyId ? $('body').attr('id', bodyId[1]) : ''); // Add IDs from the target page
|
531 |
+
(htmlClass ? $('html').addClass(htmlClass[1]) : ''); // Add classes from the target page
|
532 |
+
(bodyClass ? $('body').addClass(bodyClass[1]) : ''); // Add classes from the target page
|
533 |
+
(pageTitle ? $('title').text(pageTitle[1]) : '');
|
534 |
+
},
|
535 |
+
ksCreateLoadBox: function() {
|
536 |
+
if (!$('#ks-loading-box').length) {
|
537 |
+
loadTimer = setTimeout(function() { // Show the loading box if the loadings of contents takes longer than 200ms
|
538 |
+
$('html').append('<div id="ks-loading-box"><div class="ks-loading"></div></div>');
|
539 |
+
$('#ks-loading-box').fadeIn('fast');
|
540 |
+
}, 200);
|
541 |
+
} else {
|
542 |
+
ksMethods.ksRemoveLoadBox();
|
543 |
+
ksMethods.ksCreateLoadBox();
|
544 |
+
}
|
545 |
+
},
|
546 |
+
ksRemoveLoadBox: function() {
|
547 |
+
$('#ks-loading-box').fadeOut('fast').remove();
|
548 |
+
},
|
549 |
+
ksSwapCallback: function() {
|
550 |
+
$('body').css({
|
551 |
+
// overflowY: 'auto',
|
552 |
+
overflowX: 'auto',
|
553 |
+
}); // Prevent scrollbars on animation
|
554 |
+
$(document).trigger('ksSwapCallback'); // Trigger the swap callback event
|
555 |
+
},
|
556 |
+
};
|
557 |
+
|
558 |
+
$.koolSwap = function(method) {
|
559 |
+
if (ksPageSwap[method]) {
|
560 |
+
return ksPageSwap[method].apply($(window), Array.prototype.slice.call(arguments, 1));
|
561 |
+
} else if (typeof method === 'object' || ! method) {
|
562 |
+
return ksPageSwap.init.apply($(window), arguments, false);
|
563 |
+
} else {
|
564 |
+
$.error( 'Method ' + method + ' does not exist on jQuery.KoolSwap' );
|
565 |
+
}
|
566 |
+
};
|
567 |
+
|
568 |
+
$.fn.koolSwap = function(method) {
|
569 |
+
if (ksSelectorSwap[method]) {
|
570 |
+
return ksSelectorSwap[method].apply(this, Array.prototype.slice.call(arguments, 1));
|
571 |
+
} else if (typeof method === 'object' || ! method) {
|
572 |
+
return ksSelectorSwap.init.apply(this, arguments);
|
573 |
+
} else {
|
574 |
+
$.error( 'Method ' + method + ' does not exist on jQuery.KoolSwap' );
|
575 |
+
}
|
576 |
+
};
|
577 |
+
})( jQuery );
|
js/jquery.lp.cookie.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
/*!
|
js/jquery.tablesorter.js
ADDED
@@ -0,0 +1,1031 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
*
|
3 |
+
* TableSorter 2.0 - Client-side table sorting with ease!
|
4 |
+
* Version 2.0.5b
|
5 |
+
* @requires jQuery v1.2.3
|
6 |
+
*
|
7 |
+
* Copyright (c) 2007 Christian Bach
|
8 |
+
* Examples and docs at: http://tablesorter.com
|
9 |
+
* Dual licensed under the MIT and GPL licenses:
|
10 |
+
* http://www.opensource.org/licenses/mit-license.php
|
11 |
+
* http://www.gnu.org/licenses/gpl.html
|
12 |
+
*
|
13 |
+
*/
|
14 |
+
/**
|
15 |
+
*
|
16 |
+
* @description Create a sortable table with multi-column sorting capabilitys
|
17 |
+
*
|
18 |
+
* @example $('table').tablesorter();
|
19 |
+
* @desc Create a simple tablesorter interface.
|
20 |
+
*
|
21 |
+
* @example $('table').tablesorter({ sortList:[[0,0],[1,0]] });
|
22 |
+
* @desc Create a tablesorter interface and sort on the first and secound column column headers.
|
23 |
+
*
|
24 |
+
* @example $('table').tablesorter({ headers: { 0: { sorter: false}, 1: {sorter: false} } });
|
25 |
+
*
|
26 |
+
* @desc Create a tablesorter interface and disableing the first and second column headers.
|
27 |
+
*
|
28 |
+
*
|
29 |
+
* @example $('table').tablesorter({ headers: { 0: {sorter:"integer"}, 1: {sorter:"currency"} } });
|
30 |
+
*
|
31 |
+
* @desc Create a tablesorter interface and set a column parser for the first
|
32 |
+
* and second column.
|
33 |
+
*
|
34 |
+
*
|
35 |
+
* @param Object
|
36 |
+
* settings An object literal containing key/value pairs to provide
|
37 |
+
* optional settings.
|
38 |
+
*
|
39 |
+
*
|
40 |
+
* @option String cssHeader (optional) A string of the class name to be appended
|
41 |
+
* to sortable tr elements in the thead of the table. Default value:
|
42 |
+
* "header"
|
43 |
+
*
|
44 |
+
* @option String cssAsc (optional) A string of the class name to be appended to
|
45 |
+
* sortable tr elements in the thead on a ascending sort. Default value:
|
46 |
+
* "headerSortUp"
|
47 |
+
*
|
48 |
+
* @option String cssDesc (optional) A string of the class name to be appended
|
49 |
+
* to sortable tr elements in the thead on a descending sort. Default
|
50 |
+
* value: "headerSortDown"
|
51 |
+
*
|
52 |
+
* @option String sortInitialOrder (optional) A string of the inital sorting
|
53 |
+
* order can be asc or desc. Default value: "asc"
|
54 |
+
*
|
55 |
+
* @option String sortMultisortKey (optional) A string of the multi-column sort
|
56 |
+
* key. Default value: "shiftKey"
|
57 |
+
*
|
58 |
+
* @option String textExtraction (optional) A string of the text-extraction
|
59 |
+
* method to use. For complex html structures inside td cell set this
|
60 |
+
* option to "complex", on large tables the complex option can be slow.
|
61 |
+
* Default value: "simple"
|
62 |
+
*
|
63 |
+
* @option Object headers (optional) An array containing the forces sorting
|
64 |
+
* rules. This option let's you specify a default sorting rule. Default
|
65 |
+
* value: null
|
66 |
+
*
|
67 |
+
* @option Array sortList (optional) An array containing the forces sorting
|
68 |
+
* rules. This option let's you specify a default sorting rule. Default
|
69 |
+
* value: null
|
70 |
+
*
|
71 |
+
* @option Array sortForce (optional) An array containing forced sorting rules.
|
72 |
+
* This option let's you specify a default sorting rule, which is
|
73 |
+
* prepended to user-selected rules. Default value: null
|
74 |
+
*
|
75 |
+
* @option Boolean sortLocaleCompare (optional) Boolean flag indicating whatever
|
76 |
+
* to use String.localeCampare method or not. Default set to true.
|
77 |
+
*
|
78 |
+
*
|
79 |
+
* @option Array sortAppend (optional) An array containing forced sorting rules.
|
80 |
+
* This option let's you specify a default sorting rule, which is
|
81 |
+
* appended to user-selected rules. Default value: null
|
82 |
+
*
|
83 |
+
* @option Boolean widthFixed (optional) Boolean flag indicating if tablesorter
|
84 |
+
* should apply fixed widths to the table columns. This is usefull when
|
85 |
+
* using the pager companion plugin. This options requires the dimension
|
86 |
+
* jquery plugin. Default value: false
|
87 |
+
*
|
88 |
+
* @option Boolean cancelSelection (optional) Boolean flag indicating if
|
89 |
+
* tablesorter should cancel selection of the table headers text.
|
90 |
+
* Default value: true
|
91 |
+
*
|
92 |
+
* @option Boolean debug (optional) Boolean flag indicating if tablesorter
|
93 |
+
* should display debuging information usefull for development.
|
94 |
+
*
|
95 |
+
* @type jQuery
|
96 |
+
*
|
97 |
+
* @name tablesorter
|
98 |
+
*
|
99 |
+
* @cat Plugins/Tablesorter
|
100 |
+
*
|
101 |
+
* @author Christian Bach/christian.bach@polyester.se
|
102 |
+
*/
|
103 |
+
|
104 |
+
(function ($) {
|
105 |
+
$.extend({
|
106 |
+
tablesorter: new
|
107 |
+
function () {
|
108 |
+
|
109 |
+
var parsers = [],
|
110 |
+
widgets = [];
|
111 |
+
|
112 |
+
this.defaults = {
|
113 |
+
cssHeader: "header",
|
114 |
+
cssAsc: "headerSortUp",
|
115 |
+
cssDesc: "headerSortDown",
|
116 |
+
cssChildRow: "expand-child",
|
117 |
+
sortInitialOrder: "asc",
|
118 |
+
sortMultiSortKey: "shiftKey",
|
119 |
+
sortForce: null,
|
120 |
+
sortAppend: null,
|
121 |
+
sortLocaleCompare: true,
|
122 |
+
textExtraction: "simple",
|
123 |
+
parsers: {}, widgets: [],
|
124 |
+
widgetZebra: {
|
125 |
+
css: ["even", "odd"]
|
126 |
+
}, headers: {}, widthFixed: false,
|
127 |
+
cancelSelection: true,
|
128 |
+
sortList: [],
|
129 |
+
headerList: [],
|
130 |
+
dateFormat: "us",
|
131 |
+
decimal: '/\.|\,/g',
|
132 |
+
onRenderHeader: null,
|
133 |
+
selectorHeaders: 'thead th',
|
134 |
+
debug: false
|
135 |
+
};
|
136 |
+
|
137 |
+
/* debuging utils */
|
138 |
+
|
139 |
+
function benchmark(s, d) {
|
140 |
+
log(s + "," + (new Date().getTime() - d.getTime()) + "ms");
|
141 |
+
}
|
142 |
+
|
143 |
+
this.benchmark = benchmark;
|
144 |
+
|
145 |
+
function log(s) {
|
146 |
+
if (typeof console != "undefined" && typeof console.debug != "undefined") {
|
147 |
+
console.log(s);
|
148 |
+
} else {
|
149 |
+
alert(s);
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
/* parsers utils */
|
154 |
+
|
155 |
+
function buildParserCache(table, $headers) {
|
156 |
+
|
157 |
+
if (table.config.debug) {
|
158 |
+
var parsersDebug = "";
|
159 |
+
}
|
160 |
+
|
161 |
+
if (table.tBodies.length == 0) return; // In the case of empty tables
|
162 |
+
var rows = table.tBodies[0].rows;
|
163 |
+
|
164 |
+
if (rows[0]) {
|
165 |
+
|
166 |
+
var list = [],
|
167 |
+
cells = rows[0].cells,
|
168 |
+
l = cells.length;
|
169 |
+
|
170 |
+
for (var i = 0; i < l; i++) {
|
171 |
+
|
172 |
+
var p = false;
|
173 |
+
|
174 |
+
if ($.metadata && ($($headers[i]).metadata() && $($headers[i]).metadata().sorter)) {
|
175 |
+
|
176 |
+
p = getParserById($($headers[i]).metadata().sorter);
|
177 |
+
|
178 |
+
} else if ((table.config.headers[i] && table.config.headers[i].sorter)) {
|
179 |
+
|
180 |
+
p = getParserById(table.config.headers[i].sorter);
|
181 |
+
}
|
182 |
+
if (!p) {
|
183 |
+
|
184 |
+
p = detectParserForColumn(table, rows, -1, i);
|
185 |
+
}
|
186 |
+
|
187 |
+
if (table.config.debug) {
|
188 |
+
parsersDebug += "column:" + i + " parser:" + p.id + "\n";
|
189 |
+
}
|
190 |
+
|
191 |
+
list.push(p);
|
192 |
+
}
|
193 |
+
}
|
194 |
+
|
195 |
+
if (table.config.debug) {
|
196 |
+
log(parsersDebug);
|
197 |
+
}
|
198 |
+
|
199 |
+
return list;
|
200 |
+
};
|
201 |
+
|
202 |
+
function detectParserForColumn(table, rows, rowIndex, cellIndex) {
|
203 |
+
var l = parsers.length,
|
204 |
+
node = false,
|
205 |
+
nodeValue = false,
|
206 |
+
keepLooking = true;
|
207 |
+
while (nodeValue == '' && keepLooking) {
|
208 |
+
rowIndex++;
|
209 |
+
if (rows[rowIndex]) {
|
210 |
+
node = getNodeFromRowAndCellIndex(rows, rowIndex, cellIndex);
|
211 |
+
nodeValue = trimAndGetNodeText(table.config, node);
|
212 |
+
if (table.config.debug) {
|
213 |
+
log('Checking if value was empty on row:' + rowIndex);
|
214 |
+
}
|
215 |
+
} else {
|
216 |
+
keepLooking = false;
|
217 |
+
}
|
218 |
+
}
|
219 |
+
for (var i = 1; i < l; i++) {
|
220 |
+
if (parsers[i].is(nodeValue, table, node)) {
|
221 |
+
return parsers[i];
|
222 |
+
}
|
223 |
+
}
|
224 |
+
// 0 is always the generic parser (text)
|
225 |
+
return parsers[0];
|
226 |
+
}
|
227 |
+
|
228 |
+
function getNodeFromRowAndCellIndex(rows, rowIndex, cellIndex) {
|
229 |
+
return rows[rowIndex].cells[cellIndex];
|
230 |
+
}
|
231 |
+
|
232 |
+
function trimAndGetNodeText(config, node) {
|
233 |
+
return $.trim(getElementText(config, node));
|
234 |
+
}
|
235 |
+
|
236 |
+
function getParserById(name) {
|
237 |
+
var l = parsers.length;
|
238 |
+
for (var i = 0; i < l; i++) {
|
239 |
+
if (parsers[i].id.toLowerCase() == name.toLowerCase()) {
|
240 |
+
return parsers[i];
|
241 |
+
}
|
242 |
+
}
|
243 |
+
return false;
|
244 |
+
}
|
245 |
+
|
246 |
+
/* utils */
|
247 |
+
|
248 |
+
function buildCache(table) {
|
249 |
+
|
250 |
+
if (table.config.debug) {
|
251 |
+
var cacheTime = new Date();
|
252 |
+
}
|
253 |
+
|
254 |
+
var totalRows = (table.tBodies[0] && table.tBodies[0].rows.length) || 0,
|
255 |
+
totalCells = (table.tBodies[0].rows[0] && table.tBodies[0].rows[0].cells.length) || 0,
|
256 |
+
parsers = table.config.parsers,
|
257 |
+
cache = {
|
258 |
+
row: [],
|
259 |
+
normalized: []
|
260 |
+
};
|
261 |
+
|
262 |
+
for (var i = 0; i < totalRows; ++i) {
|
263 |
+
|
264 |
+
/** Add the table data to main data array */
|
265 |
+
var c = $(table.tBodies[0].rows[i]),
|
266 |
+
cols = [];
|
267 |
+
|
268 |
+
// if this is a child row, add it to the last row's children and
|
269 |
+
// continue to the next row
|
270 |
+
if (c.hasClass(table.config.cssChildRow)) {
|
271 |
+
cache.row[cache.row.length - 1] = cache.row[cache.row.length - 1].add(c);
|
272 |
+
// go to the next for loop
|
273 |
+
continue;
|
274 |
+
}
|
275 |
+
|
276 |
+
cache.row.push(c);
|
277 |
+
|
278 |
+
for (var j = 0; j < totalCells; ++j) {
|
279 |
+
cols.push(parsers[j].format(getElementText(table.config, c[0].cells[j]), table, c[0].cells[j]));
|
280 |
+
}
|
281 |
+
|
282 |
+
cols.push(cache.normalized.length); // add position for rowCache
|
283 |
+
cache.normalized.push(cols);
|
284 |
+
cols = null;
|
285 |
+
};
|
286 |
+
|
287 |
+
if (table.config.debug) {
|
288 |
+
benchmark("Building cache for " + totalRows + " rows:", cacheTime);
|
289 |
+
}
|
290 |
+
|
291 |
+
return cache;
|
292 |
+
};
|
293 |
+
|
294 |
+
function getElementText(config, node) {
|
295 |
+
|
296 |
+
var text = "";
|
297 |
+
|
298 |
+
if (!node) return "";
|
299 |
+
|
300 |
+
if (!config.supportsTextContent) config.supportsTextContent = node.textContent || false;
|
301 |
+
|
302 |
+
if (config.textExtraction == "simple") {
|
303 |
+
if (config.supportsTextContent) {
|
304 |
+
text = node.textContent;
|
305 |
+
} else {
|
306 |
+
if (node.childNodes[0] && node.childNodes[0].hasChildNodes()) {
|
307 |
+
text = node.childNodes[0].innerHTML;
|
308 |
+
} else {
|
309 |
+
text = node.innerHTML;
|
310 |
+
}
|
311 |
+
}
|
312 |
+
} else {
|
313 |
+
if (typeof(config.textExtraction) == "function") {
|
314 |
+
text = config.textExtraction(node);
|
315 |
+
} else {
|
316 |
+
text = $(node).text();
|
317 |
+
}
|
318 |
+
}
|
319 |
+
return text;
|
320 |
+
}
|
321 |
+
|
322 |
+
function appendToTable(table, cache) {
|
323 |
+
|
324 |
+
if (table.config.debug) {
|
325 |
+
var appendTime = new Date()
|
326 |
+
}
|
327 |
+
|
328 |
+
var c = cache,
|
329 |
+
r = c.row,
|
330 |
+
n = c.normalized,
|
331 |
+
totalRows = n.length,
|
332 |
+
checkCell = (n[0].length - 1),
|
333 |
+
tableBody = $(table.tBodies[0]),
|
334 |
+
rows = [];
|
335 |
+
|
336 |
+
|
337 |
+
for (var i = 0; i < totalRows; i++) {
|
338 |
+
var pos = n[i][checkCell];
|
339 |
+
|
340 |
+
rows.push(r[pos]);
|
341 |
+
|
342 |
+
if (!table.config.appender) {
|
343 |
+
|
344 |
+
//var o = ;
|
345 |
+
var l = r[pos].length;
|
346 |
+
for (var j = 0; j < l; j++) {
|
347 |
+
tableBody[0].appendChild(r[pos][j]);
|
348 |
+
}
|
349 |
+
|
350 |
+
//
|
351 |
+
}
|
352 |
+
}
|
353 |
+
|
354 |
+
|
355 |
+
|
356 |
+
if (table.config.appender) {
|
357 |
+
|
358 |
+
table.config.appender(table, rows);
|
359 |
+
}
|
360 |
+
|
361 |
+
rows = null;
|
362 |
+
|
363 |
+
if (table.config.debug) {
|
364 |
+
benchmark("Rebuilt table:", appendTime);
|
365 |
+
}
|
366 |
+
|
367 |
+
// apply table widgets
|
368 |
+
applyWidget(table);
|
369 |
+
|
370 |
+
// trigger sortend
|
371 |
+
setTimeout(function () {
|
372 |
+
$(table).trigger("sortEnd");
|
373 |
+
}, 0);
|
374 |
+
|
375 |
+
};
|
376 |
+
|
377 |
+
function buildHeaders(table) {
|
378 |
+
|
379 |
+
if (table.config.debug) {
|
380 |
+
var time = new Date();
|
381 |
+
}
|
382 |
+
|
383 |
+
var meta = ($.metadata) ? true : false;
|
384 |
+
|
385 |
+
var header_index = computeTableHeaderCellIndexes(table);
|
386 |
+
|
387 |
+
$tableHeaders = $(table.config.selectorHeaders, table).each(function (index) {
|
388 |
+
|
389 |
+
this.column = header_index[this.parentNode.rowIndex + "-" + this.cellIndex];
|
390 |
+
// this.column = index;
|
391 |
+
this.order = formatSortingOrder(table.config.sortInitialOrder);
|
392 |
+
|
393 |
+
|
394 |
+
this.count = this.order;
|
395 |
+
|
396 |
+
if (checkHeaderMetadata(this) || checkHeaderOptions(table, index)) this.sortDisabled = true;
|
397 |
+
if (checkHeaderOptionsSortingLocked(table, index)) this.order = this.lockedOrder = checkHeaderOptionsSortingLocked(table, index);
|
398 |
+
|
399 |
+
if (!this.sortDisabled) {
|
400 |
+
var $th = $(this).addClass(table.config.cssHeader);
|
401 |
+
if (table.config.onRenderHeader) table.config.onRenderHeader.apply($th);
|
402 |
+
}
|
403 |
+
|
404 |
+
// add cell to headerList
|
405 |
+
table.config.headerList[index] = this;
|
406 |
+
});
|
407 |
+
|
408 |
+
if (table.config.debug) {
|
409 |
+
benchmark("Built headers:", time);
|
410 |
+
log($tableHeaders);
|
411 |
+
}
|
412 |
+
|
413 |
+
return $tableHeaders;
|
414 |
+
|
415 |
+
};
|
416 |
+
|
417 |
+
// from:
|
418 |
+
// http://www.javascripttoolbox.com/lib/table/examples.php
|
419 |
+
// http://www.javascripttoolbox.com/temp/table_cellindex.html
|
420 |
+
|
421 |
+
|
422 |
+
function computeTableHeaderCellIndexes(t) {
|
423 |
+
var matrix = [];
|
424 |
+
var lookup = {};
|
425 |
+
var thead = t.getElementsByTagName('THEAD')[0];
|
426 |
+
var trs = thead.getElementsByTagName('TR');
|
427 |
+
|
428 |
+
for (var i = 0; i < trs.length; i++) {
|
429 |
+
var cells = trs[i].cells;
|
430 |
+
for (var j = 0; j < cells.length; j++) {
|
431 |
+
var c = cells[j];
|
432 |
+
|
433 |
+
var rowIndex = c.parentNode.rowIndex;
|
434 |
+
var cellId = rowIndex + "-" + c.cellIndex;
|
435 |
+
var rowSpan = c.rowSpan || 1;
|
436 |
+
var colSpan = c.colSpan || 1
|
437 |
+
var firstAvailCol;
|
438 |
+
if (typeof(matrix[rowIndex]) == "undefined") {
|
439 |
+
matrix[rowIndex] = [];
|
440 |
+
}
|
441 |
+
// Find first available column in the first row
|
442 |
+
for (var k = 0; k < matrix[rowIndex].length + 1; k++) {
|
443 |
+
if (typeof(matrix[rowIndex][k]) == "undefined") {
|
444 |
+
firstAvailCol = k;
|
445 |
+
break;
|
446 |
+
}
|
447 |
+
}
|
448 |
+
lookup[cellId] = firstAvailCol;
|
449 |
+
for (var k = rowIndex; k < rowIndex + rowSpan; k++) {
|
450 |
+
if (typeof(matrix[k]) == "undefined") {
|
451 |
+
matrix[k] = [];
|
452 |
+
}
|
453 |
+
var matrixrow = matrix[k];
|
454 |
+
for (var l = firstAvailCol; l < firstAvailCol + colSpan; l++) {
|
455 |
+
matrixrow[l] = "x";
|
456 |
+
}
|
457 |
+
}
|
458 |
+
}
|
459 |
+
}
|
460 |
+
return lookup;
|
461 |
+
}
|
462 |
+
|
463 |
+
function checkCellColSpan(table, rows, row) {
|
464 |
+
var arr = [],
|
465 |
+
r = table.tHead.rows,
|
466 |
+
c = r[row].cells;
|
467 |
+
|
468 |
+
for (var i = 0; i < c.length; i++) {
|
469 |
+
var cell = c[i];
|
470 |
+
|
471 |
+
if (cell.colSpan > 1) {
|
472 |
+
arr = arr.concat(checkCellColSpan(table, headerArr, row++));
|
473 |
+
} else {
|
474 |
+
if (table.tHead.length == 1 || (cell.rowSpan > 1 || !r[row + 1])) {
|
475 |
+
arr.push(cell);
|
476 |
+
}
|
477 |
+
// headerArr[row] = (i+row);
|
478 |
+
}
|
479 |
+
}
|
480 |
+
return arr;
|
481 |
+
};
|
482 |
+
|
483 |
+
function checkHeaderMetadata(cell) {
|
484 |
+
if (($.metadata) && ($(cell).metadata().sorter === false)) {
|
485 |
+
return true;
|
486 |
+
};
|
487 |
+
return false;
|
488 |
+
}
|
489 |
+
|
490 |
+
function checkHeaderOptions(table, i) {
|
491 |
+
if ((table.config.headers[i]) && (table.config.headers[i].sorter === false)) {
|
492 |
+
return true;
|
493 |
+
};
|
494 |
+
return false;
|
495 |
+
}
|
496 |
+
|
497 |
+
function checkHeaderOptionsSortingLocked(table, i) {
|
498 |
+
if ((table.config.headers[i]) && (table.config.headers[i].lockedOrder)) return table.config.headers[i].lockedOrder;
|
499 |
+
return false;
|
500 |
+
}
|
501 |
+
|
502 |
+
function applyWidget(table) {
|
503 |
+
var c = table.config.widgets;
|
504 |
+
var l = c.length;
|
505 |
+
for (var i = 0; i < l; i++) {
|
506 |
+
|
507 |
+
getWidgetById(c[i]).format(table);
|
508 |
+
}
|
509 |
+
|
510 |
+
}
|
511 |
+
|
512 |
+
function getWidgetById(name) {
|
513 |
+
var l = widgets.length;
|
514 |
+
for (var i = 0; i < l; i++) {
|
515 |
+
if (widgets[i].id.toLowerCase() == name.toLowerCase()) {
|
516 |
+
return widgets[i];
|
517 |
+
}
|
518 |
+
}
|
519 |
+
};
|
520 |
+
|
521 |
+
function formatSortingOrder(v) {
|
522 |
+
if (typeof(v) != "Number") {
|
523 |
+
return (v.toLowerCase() == "desc") ? 1 : 0;
|
524 |
+
} else {
|
525 |
+
return (v == 1) ? 1 : 0;
|
526 |
+
}
|
527 |
+
}
|
528 |
+
|
529 |
+
function isValueInArray(v, a) {
|
530 |
+
var l = a.length;
|
531 |
+
for (var i = 0; i < l; i++) {
|
532 |
+
if (a[i][0] == v) {
|
533 |
+
return true;
|
534 |
+
}
|
535 |
+
}
|
536 |
+
return false;
|
537 |
+
}
|
538 |
+
|
539 |
+
function setHeadersCss(table, $headers, list, css) {
|
540 |
+
// remove all header information
|
541 |
+
$headers.removeClass(css[0]).removeClass(css[1]);
|
542 |
+
|
543 |
+
var h = [];
|
544 |
+
$headers.each(function (offset) {
|
545 |
+
if (!this.sortDisabled) {
|
546 |
+
h[this.column] = $(this);
|
547 |
+
}
|
548 |
+
});
|
549 |
+
|
550 |
+
var l = list.length;
|
551 |
+
for (var i = 0; i < l; i++) {
|
552 |
+
h[list[i][0]].addClass(css[list[i][1]]);
|
553 |
+
}
|
554 |
+
}
|
555 |
+
|
556 |
+
function fixColumnWidth(table, $headers) {
|
557 |
+
var c = table.config;
|
558 |
+
if (c.widthFixed) {
|
559 |
+
var colgroup = $('<colgroup>');
|
560 |
+
$("tr:first td", table.tBodies[0]).each(function () {
|
561 |
+
colgroup.append($('<col>').css('width', $(this).width()));
|
562 |
+
});
|
563 |
+
$(table).prepend(colgroup);
|
564 |
+
};
|
565 |
+
}
|
566 |
+
|
567 |
+
function updateHeaderSortCount(table, sortList) {
|
568 |
+
var c = table.config,
|
569 |
+
l = sortList.length;
|
570 |
+
for (var i = 0; i < l; i++) {
|
571 |
+
var s = sortList[i],
|
572 |
+
o = c.headerList[s[0]];
|
573 |
+
o.count = s[1];
|
574 |
+
o.count++;
|
575 |
+
}
|
576 |
+
}
|
577 |
+
|
578 |
+
/* sorting methods */
|
579 |
+
|
580 |
+
function multisort(table, sortList, cache) {
|
581 |
+
|
582 |
+
if (table.config.debug) {
|
583 |
+
var sortTime = new Date();
|
584 |
+
}
|
585 |
+
|
586 |
+
var dynamicExp = "var sortWrapper = function(a,b) {",
|
587 |
+
l = sortList.length;
|
588 |
+
|
589 |
+
// TODO: inline functions.
|
590 |
+
for (var i = 0; i < l; i++) {
|
591 |
+
|
592 |
+
var c = sortList[i][0];
|
593 |
+
var order = sortList[i][1];
|
594 |
+
// var s = (getCachedSortType(table.config.parsers,c) == "text") ?
|
595 |
+
// ((order == 0) ? "sortText" : "sortTextDesc") : ((order == 0) ?
|
596 |
+
// "sortNumeric" : "sortNumericDesc");
|
597 |
+
// var s = (table.config.parsers[c].type == "text") ? ((order == 0)
|
598 |
+
// ? makeSortText(c) : makeSortTextDesc(c)) : ((order == 0) ?
|
599 |
+
// makeSortNumeric(c) : makeSortNumericDesc(c));
|
600 |
+
var s = (table.config.parsers[c].type == "text") ? ((order == 0) ? makeSortFunction("text", "asc", c) : makeSortFunction("text", "desc", c)) : ((order == 0) ? makeSortFunction("numeric", "asc", c) : makeSortFunction("numeric", "desc", c));
|
601 |
+
var e = "e" + i;
|
602 |
+
|
603 |
+
dynamicExp += "var " + e + " = " + s; // + "(a[" + c + "],b[" + c
|
604 |
+
// + "]); ";
|
605 |
+
dynamicExp += "if(" + e + ") { return " + e + "; } ";
|
606 |
+
dynamicExp += "else { ";
|
607 |
+
|
608 |
+
}
|
609 |
+
|
610 |
+
// if value is the same keep orignal order
|
611 |
+
var orgOrderCol = cache.normalized[0].length - 1;
|
612 |
+
dynamicExp += "return a[" + orgOrderCol + "]-b[" + orgOrderCol + "];";
|
613 |
+
|
614 |
+
for (var i = 0; i < l; i++) {
|
615 |
+
dynamicExp += "}; ";
|
616 |
+
}
|
617 |
+
|
618 |
+
dynamicExp += "return 0; ";
|
619 |
+
dynamicExp += "}; ";
|
620 |
+
|
621 |
+
if (table.config.debug) {
|
622 |
+
benchmark("Evaling expression:" + dynamicExp, new Date());
|
623 |
+
}
|
624 |
+
|
625 |
+
eval(dynamicExp);
|
626 |
+
|
627 |
+
cache.normalized.sort(sortWrapper);
|
628 |
+
|
629 |
+
if (table.config.debug) {
|
630 |
+
benchmark("Sorting on " + sortList.toString() + " and dir " + order + " time:", sortTime);
|
631 |
+
}
|
632 |
+
|
633 |
+
return cache;
|
634 |
+
};
|
635 |
+
|
636 |
+
function makeSortFunction(type, direction, index) {
|
637 |
+
var a = "a[" + index + "]",
|
638 |
+
b = "b[" + index + "]";
|
639 |
+
if (type == 'text' && direction == 'asc') {
|
640 |
+
return "(" + a + " == " + b + " ? 0 : (" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : (" + a + " < " + b + ") ? -1 : 1 )));";
|
641 |
+
} else if (type == 'text' && direction == 'desc') {
|
642 |
+
return "(" + a + " == " + b + " ? 0 : (" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : (" + b + " < " + a + ") ? -1 : 1 )));";
|
643 |
+
} else if (type == 'numeric' && direction == 'asc') {
|
644 |
+
return "(" + a + " === null && " + b + " === null) ? 0 :(" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : " + a + " - " + b + "));";
|
645 |
+
} else if (type == 'numeric' && direction == 'desc') {
|
646 |
+
return "(" + a + " === null && " + b + " === null) ? 0 :(" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : " + b + " - " + a + "));";
|
647 |
+
}
|
648 |
+
};
|
649 |
+
|
650 |
+
function makeSortText(i) {
|
651 |
+
return "((a[" + i + "] < b[" + i + "]) ? -1 : ((a[" + i + "] > b[" + i + "]) ? 1 : 0));";
|
652 |
+
};
|
653 |
+
|
654 |
+
function makeSortTextDesc(i) {
|
655 |
+
return "((b[" + i + "] < a[" + i + "]) ? -1 : ((b[" + i + "] > a[" + i + "]) ? 1 : 0));";
|
656 |
+
};
|
657 |
+
|
658 |
+
function makeSortNumeric(i) {
|
659 |
+
return "a[" + i + "]-b[" + i + "];";
|
660 |
+
};
|
661 |
+
|
662 |
+
function makeSortNumericDesc(i) {
|
663 |
+
return "b[" + i + "]-a[" + i + "];";
|
664 |
+
};
|
665 |
+
|
666 |
+
function sortText(a, b) {
|
667 |
+
if (table.config.sortLocaleCompare) return a.localeCompare(b);
|
668 |
+
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
669 |
+
};
|
670 |
+
|
671 |
+
function sortTextDesc(a, b) {
|
672 |
+
if (table.config.sortLocaleCompare) return b.localeCompare(a);
|
673 |
+
return ((b < a) ? -1 : ((b > a) ? 1 : 0));
|
674 |
+
};
|
675 |
+
|
676 |
+
function sortNumeric(a, b) {
|
677 |
+
return a - b;
|
678 |
+
};
|
679 |
+
|
680 |
+
function sortNumericDesc(a, b) {
|
681 |
+
return b - a;
|
682 |
+
};
|
683 |
+
|
684 |
+
function getCachedSortType(parsers, i) {
|
685 |
+
return parsers[i].type;
|
686 |
+
}; /* public methods */
|
687 |
+
this.construct = function (settings) {
|
688 |
+
return this.each(function () {
|
689 |
+
// if no thead or tbody quit.
|
690 |
+
if (!this.tHead || !this.tBodies) return;
|
691 |
+
// declare
|
692 |
+
var $this, $document, $headers, cache, config, shiftDown = 0,
|
693 |
+
sortOrder;
|
694 |
+
// new blank config object
|
695 |
+
this.config = {};
|
696 |
+
// merge and extend.
|
697 |
+
config = $.extend(this.config, $.tablesorter.defaults, settings);
|
698 |
+
// store common expression for speed
|
699 |
+
$this = $(this);
|
700 |
+
// save the settings where they read
|
701 |
+
$.data(this, "tablesorter", config);
|
702 |
+
// build headers
|
703 |
+
$headers = buildHeaders(this);
|
704 |
+
// try to auto detect column type, and store in tables config
|
705 |
+
this.config.parsers = buildParserCache(this, $headers);
|
706 |
+
// build the cache for the tbody cells
|
707 |
+
cache = buildCache(this);
|
708 |
+
// get the css class names, could be done else where.
|
709 |
+
var sortCSS = [config.cssDesc, config.cssAsc];
|
710 |
+
// fixate columns if the users supplies the fixedWidth option
|
711 |
+
fixColumnWidth(this);
|
712 |
+
// apply event handling to headers
|
713 |
+
// this is to big, perhaps break it out?
|
714 |
+
$headers.click(
|
715 |
+
|
716 |
+
function (e) {
|
717 |
+
var totalRows = ($this[0].tBodies[0] && $this[0].tBodies[0].rows.length) || 0;
|
718 |
+
if (!this.sortDisabled && totalRows > 0) {
|
719 |
+
// Only call sortStart if sorting is
|
720 |
+
// enabled.
|
721 |
+
$this.trigger("sortStart");
|
722 |
+
// store exp, for speed
|
723 |
+
var $cell = $(this);
|
724 |
+
// get current column index
|
725 |
+
var i = this.column;
|
726 |
+
// get current column sort order
|
727 |
+
this.order = this.count++ % 2;
|
728 |
+
// always sort on the locked order.
|
729 |
+
if(this.lockedOrder) this.order = this.lockedOrder;
|
730 |
+
|
731 |
+
// user only whants to sort on one
|
732 |
+
// column
|
733 |
+
if (!e[config.sortMultiSortKey]) {
|
734 |
+
// flush the sort list
|
735 |
+
config.sortList = [];
|
736 |
+
if (config.sortForce != null) {
|
737 |
+
var a = config.sortForce;
|
738 |
+
for (var j = 0; j < a.length; j++) {
|
739 |
+
if (a[j][0] != i) {
|
740 |
+
config.sortList.push(a[j]);
|
741 |
+
}
|
742 |
+
}
|
743 |
+
}
|
744 |
+
// add column to sort list
|
745 |
+
config.sortList.push([i, this.order]);
|
746 |
+
// multi column sorting
|
747 |
+
} else {
|
748 |
+
// the user has clicked on an all
|
749 |
+
// ready sortet column.
|
750 |
+
if (isValueInArray(i, config.sortList)) {
|
751 |
+
// revers the sorting direction
|
752 |
+
// for all tables.
|
753 |
+
for (var j = 0; j < config.sortList.length; j++) {
|
754 |
+
var s = config.sortList[j],
|
755 |
+
o = config.headerList[s[0]];
|
756 |
+
if (s[0] == i) {
|
757 |
+
o.count = s[1];
|
758 |
+
o.count++;
|
759 |
+
s[1] = o.count % 2;
|
760 |
+
}
|
761 |
+
}
|
762 |
+
} else {
|
763 |
+
// add column to sort list array
|
764 |
+
config.sortList.push([i, this.order]);
|
765 |
+
}
|
766 |
+
};
|
767 |
+
setTimeout(function () {
|
768 |
+
// set css for headers
|
769 |
+
setHeadersCss($this[0], $headers, config.sortList, sortCSS);
|
770 |
+
appendToTable(
|
771 |
+
$this[0], multisort(
|
772 |
+
$this[0], config.sortList, cache)
|
773 |
+
);
|
774 |
+
}, 1);
|
775 |
+
// stop normal event by returning false
|
776 |
+
return false;
|
777 |
+
}
|
778 |
+
// cancel selection
|
779 |
+
}).mousedown(function () {
|
780 |
+
if (config.cancelSelection) {
|
781 |
+
this.onselectstart = function () {
|
782 |
+
return false
|
783 |
+
};
|
784 |
+
return false;
|
785 |
+
}
|
786 |
+
});
|
787 |
+
// apply easy methods that trigger binded events
|
788 |
+
$this.bind("update", function () {
|
789 |
+
var me = this;
|
790 |
+
setTimeout(function () {
|
791 |
+
// rebuild parsers.
|
792 |
+
me.config.parsers = buildParserCache(
|
793 |
+
me, $headers);
|
794 |
+
// rebuild the cache map
|
795 |
+
cache = buildCache(me);
|
796 |
+
}, 1);
|
797 |
+
}).bind("updateCell", function (e, cell) {
|
798 |
+
var config = this.config;
|
799 |
+
// get position from the dom.
|
800 |
+
var pos = [(cell.parentNode.rowIndex - 1), cell.cellIndex];
|
801 |
+
// update cache
|
802 |
+
cache.normalized[pos[0]][pos[1]] = config.parsers[pos[1]].format(
|
803 |
+
getElementText(config, cell), cell);
|
804 |
+
}).bind("sorton", function (e, list) {
|
805 |
+
$(this).trigger("sortStart");
|
806 |
+
config.sortList = list;
|
807 |
+
// update and store the sortlist
|
808 |
+
var sortList = config.sortList;
|
809 |
+
// update header count index
|
810 |
+
updateHeaderSortCount(this, sortList);
|
811 |
+
// set css for headers
|
812 |
+
setHeadersCss(this, $headers, sortList, sortCSS);
|
813 |
+
// sort the table and append it to the dom
|
814 |
+
appendToTable(this, multisort(this, sortList, cache));
|
815 |
+
}).bind("appendCache", function () {
|
816 |
+
appendToTable(this, cache);
|
817 |
+
}).bind("applyWidgetId", function (e, id) {
|
818 |
+
getWidgetById(id).format(this);
|
819 |
+
}).bind("applyWidgets", function () {
|
820 |
+
// apply widgets
|
821 |
+
applyWidget(this);
|
822 |
+
});
|
823 |
+
if ($.metadata && ($(this).metadata() && $(this).metadata().sortlist)) {
|
824 |
+
config.sortList = $(this).metadata().sortlist;
|
825 |
+
}
|
826 |
+
// if user has supplied a sort list to constructor.
|
827 |
+
if (config.sortList.length > 0) {
|
828 |
+
$this.trigger("sorton", [config.sortList]);
|
829 |
+
}
|
830 |
+
// apply widgets
|
831 |
+
applyWidget(this);
|
832 |
+
});
|
833 |
+
};
|
834 |
+
this.addParser = function (parser) {
|
835 |
+
var l = parsers.length,
|
836 |
+
a = true;
|
837 |
+
for (var i = 0; i < l; i++) {
|
838 |
+
if (parsers[i].id.toLowerCase() == parser.id.toLowerCase()) {
|
839 |
+
a = false;
|
840 |
+
}
|
841 |
+
}
|
842 |
+
if (a) {
|
843 |
+
parsers.push(parser);
|
844 |
+
};
|
845 |
+
};
|
846 |
+
this.addWidget = function (widget) {
|
847 |
+
widgets.push(widget);
|
848 |
+
};
|
849 |
+
this.formatFloat = function (s) {
|
850 |
+
var i = parseFloat(s);
|
851 |
+
return (isNaN(i)) ? 0 : i;
|
852 |
+
};
|
853 |
+
this.formatInt = function (s) {
|
854 |
+
var i = parseInt(s);
|
855 |
+
return (isNaN(i)) ? 0 : i;
|
856 |
+
};
|
857 |
+
this.isDigit = function (s, config) {
|
858 |
+
// replace all an wanted chars and match.
|
859 |
+
return /^[-+]?\d*$/.test($.trim(s.replace(/[,.']/g, '')));
|
860 |
+
};
|
861 |
+
this.clearTableBody = function (table) {
|
862 |
+
if ($.browser.msie) {
|
863 |
+
function empty() {
|
864 |
+
while (this.firstChild)
|
865 |
+
this.removeChild(this.firstChild);
|
866 |
+
}
|
867 |
+
empty.apply(table.tBodies[0]);
|
868 |
+
} else {
|
869 |
+
table.tBodies[0].innerHTML = "";
|
870 |
+
}
|
871 |
+
};
|
872 |
+
}
|
873 |
+
});
|
874 |
+
|
875 |
+
// extend plugin scope
|
876 |
+
$.fn.extend({
|
877 |
+
tablesorter: $.tablesorter.construct
|
878 |
+
});
|
879 |
+
|
880 |
+
// make shortcut
|
881 |
+
var ts = $.tablesorter;
|
882 |
+
|
883 |
+
// add default parsers
|
884 |
+
ts.addParser({
|
885 |
+
id: "text",
|
886 |
+
is: function (s) {
|
887 |
+
return true;
|
888 |
+
}, format: function (s) {
|
889 |
+
return $.trim(s.toLocaleLowerCase());
|
890 |
+
}, type: "text"
|
891 |
+
});
|
892 |
+
|
893 |
+
ts.addParser({
|
894 |
+
id: "digit",
|
895 |
+
is: function (s, table) {
|
896 |
+
var c = table.config;
|
897 |
+
return $.tablesorter.isDigit(s, c);
|
898 |
+
}, format: function (s) {
|
899 |
+
return $.tablesorter.formatFloat(s);
|
900 |
+
}, type: "numeric"
|
901 |
+
});
|
902 |
+
|
903 |
+
ts.addParser({
|
904 |
+
id: "currency",
|
905 |
+
is: function (s) {
|
906 |
+
return /^[£$€?.]/.test(s);
|
907 |
+
}, format: function (s) {
|
908 |
+
return $.tablesorter.formatFloat(s.replace(new RegExp(/[£$€]/g), ""));
|
909 |
+
}, type: "numeric"
|
910 |
+
});
|
911 |
+
|
912 |
+
ts.addParser({
|
913 |
+
id: "ipAddress",
|
914 |
+
is: function (s) {
|
915 |
+
return /^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);
|
916 |
+
}, format: function (s) {
|
917 |
+
var a = s.split("."),
|
918 |
+
r = "",
|
919 |
+
l = a.length;
|
920 |
+
for (var i = 0; i < l; i++) {
|
921 |
+
var item = a[i];
|
922 |
+
if (item.length == 2) {
|
923 |
+
r += "0" + item;
|
924 |
+
} else {
|
925 |
+
r += item;
|
926 |
+
}
|
927 |
+
}
|
928 |
+
return $.tablesorter.formatFloat(r);
|
929 |
+
}, type: "numeric"
|
930 |
+
});
|
931 |
+
|
932 |
+
ts.addParser({
|
933 |
+
id: "url",
|
934 |
+
is: function (s) {
|
935 |
+
return /^(https?|ftp|file):\/\/$/.test(s);
|
936 |
+
}, format: function (s) {
|
937 |
+
return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//), ''));
|
938 |
+
}, type: "text"
|
939 |
+
});
|
940 |
+
|
941 |
+
ts.addParser({
|
942 |
+
id: "isoDate",
|
943 |
+
is: function (s) {
|
944 |
+
return /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);
|
945 |
+
}, format: function (s) {
|
946 |
+
return $.tablesorter.formatFloat((s != "") ? new Date(s.replace(
|
947 |
+
new RegExp(/-/g), "/")).getTime() : "0");
|
948 |
+
}, type: "numeric"
|
949 |
+
});
|
950 |
+
|
951 |
+
ts.addParser({
|
952 |
+
id: "percent",
|
953 |
+
is: function (s) {
|
954 |
+
return /\%$/.test($.trim(s));
|
955 |
+
}, format: function (s) {
|
956 |
+
return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g), ""));
|
957 |
+
}, type: "numeric"
|
958 |
+
});
|
959 |
+
|
960 |
+
ts.addParser({
|
961 |
+
id: "usLongDate",
|
962 |
+
is: function (s) {
|
963 |
+
return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));
|
964 |
+
}, format: function (s) {
|
965 |
+
return $.tablesorter.formatFloat(new Date(s).getTime());
|
966 |
+
}, type: "numeric"
|
967 |
+
});
|
968 |
+
|
969 |
+
ts.addParser({
|
970 |
+
id: "shortDate",
|
971 |
+
is: function (s) {
|
972 |
+
return /\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);
|
973 |
+
}, format: function (s, table) {
|
974 |
+
var c = table.config;
|
975 |
+
s = s.replace(/\-/g, "/");
|
976 |
+
if (c.dateFormat == "us") {
|
977 |
+
// reformat the string in ISO format
|
978 |
+
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$1/$2");
|
979 |
+
} else if (c.dateFormat == "uk") {
|
980 |
+
// reformat the string in ISO format
|
981 |
+
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$2/$1");
|
982 |
+
} else if (c.dateFormat == "dd/mm/yy" || c.dateFormat == "dd-mm-yy") {
|
983 |
+
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$1/$2/$3");
|
984 |
+
}
|
985 |
+
return $.tablesorter.formatFloat(new Date(s).getTime());
|
986 |
+
}, type: "numeric"
|
987 |
+
});
|
988 |
+
ts.addParser({
|
989 |
+
id: "time",
|
990 |
+
is: function (s) {
|
991 |
+
return /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);
|
992 |
+
}, format: function (s) {
|
993 |
+
return $.tablesorter.formatFloat(new Date("2000/01/01 " + s).getTime());
|
994 |
+
}, type: "numeric"
|
995 |
+
});
|
996 |
+
ts.addParser({
|
997 |
+
id: "metadata",
|
998 |
+
is: function (s) {
|
999 |
+
return false;
|
1000 |
+
}, format: function (s, table, cell) {
|
1001 |
+
var c = table.config,
|
1002 |
+
p = (!c.parserMetadataName) ? 'sortValue' : c.parserMetadataName;
|
1003 |
+
return $(cell).metadata()[p];
|
1004 |
+
}, type: "numeric"
|
1005 |
+
});
|
1006 |
+
// add default widgets
|
1007 |
+
ts.addWidget({
|
1008 |
+
id: "zebra",
|
1009 |
+
format: function (table) {
|
1010 |
+
if (table.config.debug) {
|
1011 |
+
var time = new Date();
|
1012 |
+
}
|
1013 |
+
var $tr, row = -1,
|
1014 |
+
odd;
|
1015 |
+
// loop through the visible rows
|
1016 |
+
$("tr:visible", table.tBodies[0]).each(function (i) {
|
1017 |
+
$tr = $(this);
|
1018 |
+
// style children rows the same way the parent
|
1019 |
+
// row was styled
|
1020 |
+
if (!$tr.hasClass(table.config.cssChildRow)) row++;
|
1021 |
+
odd = (row % 2 == 0);
|
1022 |
+
$tr.removeClass(
|
1023 |
+
table.config.widgetZebra.css[odd ? 0 : 1]).addClass(
|
1024 |
+
table.config.widgetZebra.css[odd ? 1 : 0])
|
1025 |
+
});
|
1026 |
+
if (table.config.debug) {
|
1027 |
+
$.tablesorter.benchmark("Applying Zebra widget", time);
|
1028 |
+
}
|
1029 |
+
}
|
1030 |
+
});
|
1031 |
+
})(jQuery);
|
js/jquery.total-storage.min.js
ADDED
@@ -0,0 +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);
|
js/libraries/easyXDM.debug.js
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
* easyXDM
|
1 |
* http://easyxdm.net/
|
2 |
* Copyright(c) 2009-2011, Øyvind Sean Kinsey, oyvind@kinsey.no.
|
3 |
*
|
4 |
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
5 |
* of this software and associated documentation files (the "Software"), to deal
|
6 |
* in the Software without restriction, including without limitation the rights
|
7 |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8 |
* copies of the Software, and to permit persons to whom the Software is
|
9 |
* furnished to do so, subject to the following conditions:
|
10 |
*
|
11 |
* The above copyright notice and this permission notice shall be included in
|
12 |
* all copies or substantial portions of the Software.
|
13 |
*
|
14 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17 |
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19 |
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20 |
* THE SOFTWARE.
|
21 |
*/
|
22 |
var t = typeof object[property];
|
23 |
return t == 'function' ||
|
24 |
(!!(t == 'object' && object[property])) ||
|
25 |
t == 'unknown';
|
26 |
return !!(typeof(object[property]) == 'object' && object[property]);
|
27 |
return Object.prototype.toString.call(o) === '[object Array]';
|
28 |
try {
|
29 |
var activeX = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
|
30 |
flashVersion = Array.prototype.slice.call(activeX.GetVariable("$version").match(/(\d+),(\d+),(\d+),(\d+)/), 1);
|
31 |
HAS_FLASH_THROTTLED_BUG = parseInt(flashVersion[0], 10) > 9 && parseInt(flashVersion[1], 10) > 0;
|
32 |
activeX = null;
|
33 |
return true;
|
34 |
}
|
35 |
catch (notSupportedException) {
|
36 |
return false;
|
37 |
}
|
38 |
* Cross Browser implementation for adding and removing event listeners.
|
39 |
*/
|
40 |
on = function(target, type, listener){
|
41 |
_trace("adding listener " + type);
|
42 |
target.addEventListener(type, listener, false);
|
43 |
};
|
44 |
un = function(target, type, listener){
|
45 |
_trace("removing listener " + type);
|
46 |
target.removeEventListener(type, listener, false);
|
47 |
};
|
48 |
on = function(object, sEvent, fpNotify){
|
49 |
_trace("adding listener " + sEvent);
|
50 |
object.attachEvent("on" + sEvent, fpNotify);
|
51 |
};
|
52 |
un = function(object, sEvent, fpNotify){
|
53 |
_trace("removing listener " + sEvent);
|
54 |
object.detachEvent("on" + sEvent, fpNotify);
|
55 |
};
|
56 |
throw new Error("Browser not supported");
|
57 |
* Cross Browser implementation of DOMContentLoaded.
|
58 |
*/
|
59 |
// If browser is WebKit-powered, check for both 'loaded' (legacy browsers) and
|
60 |
// 'interactive' (HTML5 specs, recent WebKit builds) states.
|
61 |
// https://bugs.webkit.org/show_bug.cgi?id=45119
|
62 |
readyState = document.readyState;
|
63 |
domIsReady = readyState == "complete" || (~ navigator.userAgent.indexOf('AppleWebKit/') && (readyState == "loaded" || readyState == "interactive"));
|
64 |
// If readyState is not supported in the browser, then in order to be able to fire whenReady functions apropriately
|
65 |
// when added dynamically _after_ DOM load, we have to deduce wether the DOM is ready or not.
|
66 |
// We only need a body to add elements to, so the existence of document.body is enough for us.
|
67 |
domIsReady = !!document.body;
|
68 |
if (domIsReady) {
|
69 |
return;
|
70 |
}
|
71 |
domIsReady = true;
|
72 |
_trace("firing dom_onReady");
|
73 |
for (var i = 0; i < domReadyQueue.length; i++) {
|
74 |
domReadyQueue[i]();
|
75 |
}
|
76 |
domReadyQueue.length = 0;
|
77 |
if (isHostMethod(window, "addEventListener")) {
|
78 |
on(document, "DOMContentLoaded", dom_onReady);
|
79 |
}
|
80 |
else {
|
81 |
on(document, "readystatechange", function(){
|
82 |
if (document.readyState == "complete") {
|
83 |
dom_onReady();
|
84 |
}
|
85 |
});
|
86 |
if (document.documentElement.doScroll && window === top) {
|
87 |
var doScrollCheck = function(){
|
88 |
if (domIsReady) {
|
89 |
return;
|
90 |
}
|
91 |
// http://javascript.nwbox.com/IEContentLoaded/
|
92 |
try {
|
93 |
document.documentElement.doScroll("left");
|
94 |
}
|
95 |
catch (e) {
|
96 |
setTimeout(doScrollCheck, 1);
|
97 |
return;
|
98 |
}
|
99 |
dom_onReady();
|
100 |
};
|
101 |
doScrollCheck();
|
102 |
}
|
103 |
}
|
104 |
|
105 |
// A fallback to window.onload, that will always work
|
106 |
on(window, "load", dom_onReady);
|
107 |
* This will add a function to the queue of functions to be run once the DOM reaches a ready state.
|
108 |
* If functions are added after this event then they will be executed immediately.
|
109 |
* @param {function} fn The function to add
|
110 |
* @param {Object} scope An optional scope for the function to be called with.
|
111 |
*/
|
112 |
if (domIsReady) {
|
113 |
fn.call(scope);
|
114 |
return;
|
115 |
}
|
116 |
domReadyQueue.push(function(){
|
117 |
fn.call(scope);
|
118 |
});
|
119 |
* Returns an instance of easyXDM from the parent window with
|
120 |
* respect to the namespace.
|
121 |
*
|
122 |
* @return An instance of easyXDM (in the parent window)
|
123 |
*/
|
124 |
var obj = parent;
|
125 |
if (namespace !== "") {
|
126 |
for (var i = 0, ii = namespace.split("."); i < ii.length; i++) {
|
127 |
if (!obj) {
|
128 |
throw new Error(ii.slice(0, i + 1).join('.') + ' is not an object');
|
129 |
}
|
130 |
obj = obj[ii[i]];
|
131 |
}
|
132 |
}
|
133 |
if (!obj || !obj.easyXDM) {
|
134 |
throw new Error('Could not find easyXDM in parent.' + namespace);
|
135 |
}
|
136 |
return obj.easyXDM;
|
137 |
* Removes easyXDM variable from the global scope. It also returns control
|
138 |
* of the easyXDM variable to whatever code used it before.
|
139 |
*
|
140 |
* @param {String} ns A string representation of an object that will hold
|
141 |
* an instance of easyXDM.
|
142 |
* @return An instance of easyXDM
|
143 |
*/
|
144 |
if (typeof ns != "string" || !ns) {
|
145 |
throw new Error('namespace must be a non-empty string');
|
146 |
}
|
147 |
_trace("Settings namespace to '" + ns + "'");
|
148 |
|
149 |
window.easyXDM = _easyXDM;
|
150 |
namespace = ns;
|
151 |
if (namespace) {
|
152 |
IFRAME_PREFIX = "easyXDM_" + namespace.replace(".", "_") + "_";
|
153 |
}
|
154 |
return easyXDM;
|
155 |
* Methods for working with URLs
|
156 |
*/
|
157 |
* Get the domain name from a url.
|
158 |
* @param {String} url The url to extract the domain from.
|
159 |
* @return The domain part of the url.
|
160 |
* @type {String}
|
161 |
*/
|
162 |
if (!url) {
|
163 |
throw new Error("url is undefined or empty");
|
164 |
}
|
165 |
return url.match(reURI)[3];
|
166 |
* Get the port for a given URL, or "" if none
|
167 |
* @param {String} url The url to extract the port from.
|
168 |
* @return The port part of the url.
|
169 |
* @type {String}
|
170 |
*/
|
171 |
if (!url) {
|
172 |
throw new Error("url is undefined or empty");
|
173 |
}
|
174 |
return url.match(reURI)[4] || "";
|
175 |
* Returns a string containing the schema, domain and if present the port
|
176 |
* @param {String} url The url to extract the location from
|
177 |
* @return {String} The location part of the url
|
178 |
*/
|
179 |
if (!url) {
|
180 |
throw new Error("url is undefined or empty");
|
181 |
}
|
182 |
if (/^file/.test(url)) {
|
183 |
throw new Error("The file:// protocol is not supported");
|
184 |
}
|
185 |
var m = url.toLowerCase().match(reURI);
|
186 |
var proto = m[2], domain = m[3], port = m[4] || "";
|
187 |
if ((proto == "http:" && port == ":80") || (proto == "https:" && port == ":443")) {
|
188 |
port = "";
|
189 |
}
|
190 |
return proto + "//" + domain + port;
|
191 |
* Resolves a relative url into an absolute one.
|
192 |
* @param {String} url The path to resolve.
|
193 |
* @return {String} The resolved url.
|
194 |
*/
|
195 |
if (!url) {
|
196 |
throw new Error("url is undefined or empty");
|
197 |
}
|
198 |
|
199 |
// replace all // except the one in proto with /
|
200 |
url = url.replace(reDoubleSlash, "$1/");
|
201 |
|
202 |
// If the url is a valid url we do nothing
|
203 |
if (!url.match(/^(http||https):\/\//)) {
|
204 |
// If this is a relative path
|
205 |
var path = (url.substring(0, 1) === "/") ? "" : location.pathname;
|
206 |
if (path.substring(path.length - 1) !== "/") {
|
207 |
path = path.substring(0, path.lastIndexOf("/") + 1);
|
208 |
}
|
209 |
|
210 |
url = location.protocol + "//" + location.host + path + url;
|
211 |
}
|
212 |
|
213 |
// reduce all 'xyz/../' to just ''
|
214 |
while (reParent.test(url)) {
|
215 |
url = url.replace(reParent, "");
|
216 |
}
|
217 |
|
218 |
_trace("resolved url '" + url + "'");
|
219 |
return url;
|
220 |
* Appends the parameters to the given url.<br/>
|
221 |
* The base url can contain existing query parameters.
|
222 |
* @param {String} url The base url.
|
223 |
* @param {Object} parameters The parameters to add.
|
224 |
* @return {String} A new valid url with the parameters appended.
|
225 |
*/
|
226 |
if (!parameters) {
|
227 |
throw new Error("parameters is undefined or null");
|
228 |
}
|
229 |
|
230 |
var hash = "", indexOf = url.indexOf("#");
|
231 |
if (indexOf !== -1) {
|
232 |
hash = url.substring(indexOf);
|
233 |
url = url.substring(0, indexOf);
|
234 |
}
|
235 |
var q = [];
|
236 |
for (var key in parameters) {
|
237 |
if (parameters.hasOwnProperty(key)) {
|
238 |
q.push(key + "=" + encodeURIComponent(parameters[key]));
|
239 |
}
|
240 |
}
|
241 |
return url + (useHash ? "#" : (url.indexOf("?") == -1 ? "?" : "&")) + q.join("&") + hash;
|
242 |
input = input.substring(1).split("&");
|
243 |
var data = {}, pair, i = input.length;
|
244 |
while (i--) {
|
245 |
pair = input[i].split("=");
|
246 |
data[pair[0]] = decodeURIComponent(pair[1]);
|
247 |
}
|
248 |
return data;
|
249 |
* Helper methods
|
250 |
*/
|
251 |
* Helper for checking if a variable/property is undefined
|
252 |
* @param {Object} v The variable to test
|
253 |
* @return {Boolean} True if the passed variable is undefined
|
254 |
*/
|
255 |
return typeof v === "undefined";
|
256 |
* A safe implementation of HTML5 JSON. Feature testing is used to make sure the implementation works.
|
257 |
* @return {JSON} A valid JSON conforming object, or null if not found.
|
258 |
*/
|
259 |
var cached = {};
|
260 |
var obj = {
|
261 |
a: [1, 2, 3]
|
262 |
}, json = "{\"a\":[1,2,3]}";
|
263 |
|
264 |
if (typeof JSON != "undefined" && typeof JSON.stringify === "function" && JSON.stringify(obj).replace((/\s/g), "") === json) {
|
265 |
// this is a working JSON instance
|
266 |
return JSON;
|
267 |
}
|
268 |
if (Object.toJSON) {
|
269 |
if (Object.toJSON(obj).replace((/\s/g), "") === json) {
|
270 |
// this is a working stringify method
|
271 |
cached.stringify = Object.toJSON;
|
272 |
}
|
273 |
}
|
274 |
|
275 |
if (typeof String.prototype.evalJSON === "function") {
|
276 |
obj = json.evalJSON();
|
277 |
if (obj.a && obj.a.length === 3 && obj.a[2] === 3) {
|
278 |
// this is a working parse method
|
279 |
cached.parse = function(str){
|
280 |
return str.evalJSON();
|
281 |
};
|
282 |
}
|
283 |
}
|
284 |
|
285 |
if (cached.stringify && cached.parse) {
|
286 |
// Only memoize the result if we have valid instance
|
287 |
getJSON = function(){
|
288 |
return cached;
|
289 |
};
|
290 |
return cached;
|
291 |
}
|
292 |
return null;
|
293 |
* Applies properties from the source object to the target object.<br/>
|
294 |
* @param {Object} target The target of the properties.
|
295 |
* @param {Object} source The source of the properties.
|
296 |
* @param {Boolean} noOverwrite Set to True to only set non-existing properties.
|
297 |
*/
|
298 |
var member;
|
299 |
for (var prop in source) {
|
300 |
if (source.hasOwnProperty(prop)) {
|
301 |
if (prop in destination) {
|
302 |
member = source[prop];
|
303 |
if (typeof member === "object") {
|
304 |
apply(destination[prop], member, noOverwrite);
|
305 |
}
|
306 |
else if (!noOverwrite) {
|
307 |
destination[prop] = source[prop];
|
308 |
}
|
309 |
}
|
310 |
else {
|
311 |
destination[prop] = source[prop];
|
312 |
}
|
313 |
}
|
314 |
}
|
315 |
return destination;
|
316 |
var form = document.body.appendChild(document.createElement("form")), input = form.appendChild(document.createElement("input"));
|
317 |
input.name = IFRAME_PREFIX + "TEST" + channelId; // append channelId in order to avoid caching issues
|
318 |
HAS_NAME_PROPERTY_BUG = input !== form.elements[input.name];
|
319 |
document.body.removeChild(form);
|
320 |
_trace("HAS_NAME_PROPERTY_BUG: " + HAS_NAME_PROPERTY_BUG);
|
321 |
* Creates a frame and appends it to the DOM.
|
322 |
* @param config {object} This object can have the following properties
|
323 |
* <ul>
|
324 |
* <li> {object} prop The properties that should be set on the frame. This should include the 'src' property.</li>
|
325 |
* <li> {object} attr The attributes that should be set on the frame.</li>
|
326 |
* <li> {DOMElement} container Its parent element (Optional).</li>
|
327 |
* <li> {function} onLoad A method that should be called with the frames contentWindow as argument when the frame is fully loaded. (Optional)</li>
|
328 |
* </ul>
|
329 |
* @return The frames DOMElement
|
330 |
* @type DOMElement
|
331 |
*/
|
332 |
_trace("creating frame: " + config.props.src);
|
333 |
if (undef(HAS_NAME_PROPERTY_BUG)) {
|
334 |
testForNamePropertyBug();
|
335 |
}
|
336 |
var frame;
|
337 |
// This is to work around the problems in IE6/7 with setting the name property.
|
338 |
// Internally this is set as 'submitName' instead when using 'iframe.name = ...'
|
339 |
// This is not required by easyXDM itself, but is to facilitate other use cases
|
340 |
if (HAS_NAME_PROPERTY_BUG) {
|
341 |
frame = document.createElement("<iframe name=\"" + config.props.name + "\"/>");
|
342 |
}
|
343 |
else {
|
344 |
frame = document.createElement("IFRAME");
|
345 |
frame.name = config.props.name;
|
346 |
}
|
347 |
|
348 |
frame.id = frame.name = config.props.name;
|
349 |
delete config.props.name;
|
350 |
|
351 |
if (config.onLoad) {
|
352 |
on(frame, "load", config.onLoad);
|
353 |
}
|
354 |
|
355 |
if (typeof config.container == "string") {
|
356 |
config.container = document.getElementById(config.container);
|
357 |
}
|
358 |
|
359 |
if (!config.container) {
|
360 |
// This needs to be hidden like this, simply setting display:none and the like will cause failures in some browsers.
|
361 |
apply(frame.style, {
|
362 |
position: "absolute",
|
363 |
top: "-2000px"
|
364 |
});
|
365 |
config.container = document.body;
|
366 |
}
|
367 |
|
368 |
// HACK for some reason, IE needs the source set
|
369 |
// after the frame has been appended into the DOM
|
370 |
// so remove the src, and set it afterwards
|
371 |
var src = config.props.src;
|
372 |
delete config.props.src;
|
373 |
|
374 |
// transfer properties to the frame
|
375 |
apply(frame, config.props);
|
376 |
|
377 |
frame.border = frame.frameBorder = 0;
|
378 |
frame.allowTransparency = true;
|
379 |
config.container.appendChild(frame);
|
380 |
|
381 |
// HACK see above
|
382 |
frame.src = src;
|
383 |
config.props.src = src;
|
384 |
|
385 |
return frame;
|
386 |
* Check whether a domain is allowed using an Access Control List.
|
387 |
* The ACL can contain * and ? as wildcards, or can be regular expressions.
|
388 |
* If regular expressions they need to begin with ^ and end with $.
|
389 |
* @param {Array/String} acl The list of allowed domains
|
390 |
* @param {String} domain The domain to test.
|
391 |
* @return {Boolean} True if the domain is allowed, false if not.
|
392 |
*/
|
393 |
// normalize into an array
|
394 |
if (typeof acl == "string") {
|
395 |
acl = [acl];
|
396 |
}
|
397 |
var re, i = acl.length;
|
398 |
while (i--) {
|
399 |
re = acl[i];
|
400 |
re = new RegExp(re.substr(0, 1) == "^" ? re : ("^" + re.replace(/(\*)/g, ".$1").replace(/\?/g, ".") + "$"));
|
401 |
if (re.test(domain)) {
|
402 |
return true;
|
403 |
}
|
404 |
}
|
405 |
return false;
|
406 |
* Functions related to stacks
|
407 |
*/
|
408 |
* Prepares an array of stack-elements suitable for the current configuration
|
409 |
* @param {Object} config The Transports configuration. See easyXDM.Socket for more.
|
410 |
* @return {Array} An array of stack-elements with the TransportElement at index 0.
|
411 |
*/
|
412 |
var protocol = config.protocol, stackEls;
|
413 |
config.isHost = config.isHost || undef(query.xdm_p);
|
414 |
useHash = config.hash || false;
|
415 |
_trace("preparing transport stack");
|
416 |
|
417 |
if (!config.props) {
|
418 |
config.props = {};
|
419 |
}
|
420 |
if (!config.isHost) {
|
421 |
_trace("using parameters from query");
|
422 |
config.channel = query.xdm_c;
|
423 |
config.secret = query.xdm_s;
|
424 |
config.remote = query.xdm_e;
|
425 |
protocol = query.xdm_p;
|
426 |
if (config.acl && !checkAcl(config.acl, config.remote)) {
|
427 |
throw new Error("Access denied for " + config.remote);
|
428 |
}
|
429 |
}
|
430 |
else {
|
431 |
config.remote = resolveUrl(config.remote);
|
432 |
config.channel = config.channel || "default" + channelId++;
|
433 |
config.secret = Math.random().toString(16).substring(2);
|
434 |
if (undef(protocol)) {
|
435 |
if (getLocation(location.href) == getLocation(config.remote)) {
|
436 |
/*
|
437 |
* Both documents has the same origin, lets use direct access.
|
438 |
*/
|
439 |
protocol = "4";
|
440 |
}
|
441 |
else if (isHostMethod(window, "postMessage") || isHostMethod(document, "postMessage")) {
|
442 |
/*
|
443 |
* This is supported in IE8+, Firefox 3+, Opera 9+, Chrome 2+ and Safari 4+
|
444 |
*/
|
445 |
protocol = "1";
|
446 |
}
|
447 |
else if (config.swf && isHostMethod(window, "ActiveXObject") && hasFlash()) {
|
448 |
/*
|
449 |
* The Flash transport superseedes the NixTransport as the NixTransport has been blocked by MS
|
450 |
*/
|
451 |
protocol = "6";
|
452 |
}
|
453 |
else if (navigator.product === "Gecko" && "frameElement" in window && navigator.userAgent.indexOf('WebKit') == -1) {
|
454 |
/*
|
455 |
* This is supported in Gecko (Firefox 1+)
|
456 |
*/
|
457 |
protocol = "5";
|
458 |
}
|
459 |
else if (config.remoteHelper) {
|
460 |
/*
|
461 |
* This is supported in all browsers that retains the value of window.name when
|
462 |
* navigating from one domain to another, and where parent.frames[foo] can be used
|
463 |
* to get access to a frame from the same domain
|
464 |
*/
|
465 |
config.remoteHelper = resolveUrl(config.remoteHelper);
|
466 |
protocol = "2";
|
467 |
}
|
468 |
else {
|
469 |
/*
|
470 |
* This is supported in all browsers where [window].location is writable for all
|
471 |
* The resize event will be used if resize is supported and the iframe is not put
|
472 |
* into a container, else polling will be used.
|
473 |
*/
|
474 |
protocol = "0";
|
475 |
}
|
476 |
_trace("selecting protocol: " + protocol);
|
477 |
}
|
478 |
else {
|
479 |
_trace("using protocol: " + protocol);
|
480 |
}
|
481 |
}
|
482 |
config.protocol = protocol; // for conditional branching
|
483 |
switch (protocol) {
|
484 |
case "0":// 0 = HashTransport
|
485 |
apply(config, {
|
486 |
interval: 100,
|
487 |
delay: 2000,
|
488 |
useResize: true,
|
489 |
useParent: false,
|
490 |
usePolling: false
|
491 |
}, true);
|
492 |
if (config.isHost) {
|
493 |
if (!config.local) {
|
494 |
_trace("looking for image to use as local");
|
495 |
// If no local is set then we need to find an image hosted on the current domain
|
496 |
var domain = location.protocol + "//" + location.host, images = document.body.getElementsByTagName("img"), image;
|
497 |
var i = images.length;
|
498 |
while (i--) {
|
499 |
image = images[i];
|
500 |
if (image.src.substring(0, domain.length) === domain) {
|
501 |
config.local = image.src;
|
502 |
break;
|
503 |
}
|
504 |
}
|
505 |
if (!config.local) {
|
506 |
_trace("no image found, defaulting to using the window");
|
507 |
// If no local was set, and we are unable to find a suitable file, then we resort to using the current window
|
508 |
config.local = window;
|
509 |
}
|
510 |
}
|
511 |
|
512 |
var parameters = {
|
513 |
xdm_c: config.channel,
|
514 |
xdm_p: 0
|
515 |
};
|
516 |
|
517 |
if (config.local === window) {
|
518 |
// We are using the current window to listen to
|
519 |
config.usePolling = true;
|
520 |
config.useParent = true;
|
521 |
config.local = location.protocol + "//" + location.host + location.pathname + location.search;
|
522 |
parameters.xdm_e = config.local;
|
523 |
parameters.xdm_pa = 1; // use parent
|
524 |
}
|
525 |
else {
|
526 |
parameters.xdm_e = resolveUrl(config.local);
|
527 |
}
|
528 |
|
529 |
if (config.container) {
|
530 |
config.useResize = false;
|
531 |
parameters.xdm_po = 1; // use polling
|
532 |
}
|
533 |
config.remote = appendQueryParameters(config.remote, parameters);
|
534 |
}
|
535 |
else {
|
536 |
apply(config, {
|
537 |
channel: query.xdm_c,
|
538 |
remote: query.xdm_e,
|
539 |
useParent: !undef(query.xdm_pa),
|
540 |
usePolling: !undef(query.xdm_po),
|
541 |
useResize: config.useParent ? false : config.useResize
|
542 |
});
|
543 |
}
|
544 |
stackEls = [new easyXDM.stack.HashTransport(config), new easyXDM.stack.ReliableBehavior({}), new easyXDM.stack.QueueBehavior({
|
545 |
encode: true,
|
546 |
maxLength: 4000 - config.remote.length
|
547 |
}), new easyXDM.stack.VerifyBehavior({
|
548 |
initiate: config.isHost
|
549 |
})];
|
550 |
break;
|
551 |
case "1":
|
552 |
stackEls = [new easyXDM.stack.PostMessageTransport(config)];
|
553 |
break;
|
554 |
case "2":
|
555 |
stackEls = [new easyXDM.stack.NameTransport(config), new easyXDM.stack.QueueBehavior(), new easyXDM.stack.VerifyBehavior({
|
556 |
initiate: config.isHost
|
557 |
})];
|
558 |
break;
|
559 |
case "3":
|
560 |
stackEls = [new easyXDM.stack.NixTransport(config)];
|
561 |
break;
|
562 |
case "4":
|
563 |
stackEls = [new easyXDM.stack.SameOriginTransport(config)];
|
564 |
break;
|
565 |
case "5":
|
566 |
stackEls = [new easyXDM.stack.FrameElementTransport(config)];
|
567 |
break;
|
568 |
case "6":
|
569 |
if (!flashVersion) {
|
570 |
hasFlash();
|
571 |
}
|
572 |
stackEls = [new easyXDM.stack.FlashTransport(config)];
|
573 |
break;
|
574 |
}
|
575 |
// this behavior is responsible for buffering outgoing messages, and for performing lazy initialization
|
576 |
stackEls.push(new easyXDM.stack.QueueBehavior({
|
577 |
lazy: config.lazy,
|
578 |
remove: true
|
579 |
}));
|
580 |
return stackEls;
|
581 |
* Chains all the separate stack elements into a single usable stack.<br/>
|
582 |
* If an element is missing a necessary method then it will have a pass-through method applied.
|
583 |
* @param {Array} stackElements An array of stack elements to be linked.
|
584 |
* @return {easyXDM.stack.StackElement} The last element in the chain.
|
585 |
*/
|
586 |
var stackEl, defaults = {
|
587 |
incoming: function(message, origin){
|
588 |
this.up.incoming(message, origin);
|
589 |
},
|
590 |
outgoing: function(message, recipient){
|
591 |
this.down.outgoing(message, recipient);
|
592 |
},
|
593 |
callback: function(success){
|
594 |
this.up.callback(success);
|
595 |
},
|
596 |
init: function(){
|
597 |
this.down.init();
|
598 |
},
|
599 |
destroy: function(){
|
600 |
this.down.destroy();
|
601 |
}
|
602 |
};
|
603 |
for (var i = 0, len = stackElements.length; i < len; i++) {
|
604 |
stackEl = stackElements[i];
|
605 |
apply(stackEl, defaults, true);
|
606 |
if (i !== 0) {
|
607 |
stackEl.down = stackElements[i - 1];
|
608 |
}
|
609 |
if (i !== len - 1) {
|
610 |
stackEl.up = stackElements[i + 1];
|
611 |
}
|
612 |
}
|
613 |
return stackEl;
|
614 |
* This will remove a stackelement from its stack while leaving the stack functional.
|
615 |
* @param {Object} element The elment to remove from the stack.
|
616 |
*/
|
617 |
element.up.down = element.down;
|
618 |
element.down.up = element.up;
|
619 |
element.up = element.down = null;
|
620 |
* Export the main object and any other methods applicable
|
621 |
*/
|
622 |
* @class easyXDM
|
623 |
* A javascript library providing cross-browser, cross-domain messaging/RPC.
|
624 |
* @version 2.4.15.118
|
625 |
* @singleton
|
626 |
*/
|
627 |
/**
|
628 |
* The version of the library
|
629 |
* @type {string}
|
630 |
*/
|
631 |
version: "2.4.15.118",
|
632 |
/**
|
633 |
* This is a map containing all the query parameters passed to the document.
|
634 |
* All the values has been decoded using decodeURIComponent.
|
635 |
* @type {object}
|
636 |
*/
|
637 |
query: query,
|
638 |
/**
|
639 |
* @private
|
640 |
*/
|
641 |
stack: {},
|
642 |
/**
|
643 |
* Applies properties from the source object to the target object.<br/>
|
644 |
* @param {object} target The target of the properties.
|
645 |
* @param {object} source The source of the properties.
|
646 |
* @param {boolean} noOverwrite Set to True to only set non-existing properties.
|
647 |
*/
|
648 |
apply: apply,
|
649 |
|
650 |
/**
|
651 |
* A safe implementation of HTML5 JSON. Feature testing is used to make sure the implementation works.
|
652 |
* @return {JSON} A valid JSON conforming object, or null if not found.
|
653 |
*/
|
654 |
getJSONObject: getJSON,
|
655 |
/**
|
656 |
* This will add a function to the queue of functions to be run once the DOM reaches a ready state.
|
657 |
* If functions are added after this event then they will be executed immediately.
|
658 |
* @param {function} fn The function to add
|
659 |
* @param {object} scope An optional scope for the function to be called with.
|
660 |
*/
|
661 |
whenReady: whenReady,
|
662 |
/**
|
663 |
* Removes easyXDM variable from the global scope. It also returns control
|
664 |
* of the easyXDM variable to whatever code used it before.
|
665 |
*
|
666 |
* @param {String} ns A string representation of an object that will hold
|
667 |
* an instance of easyXDM.
|
668 |
* @return An instance of easyXDM
|
669 |
*/
|
670 |
noConflict: noConflict
|
671 |
checkAcl: checkAcl,
|
672 |
getDomainName: getDomainName,
|
673 |
getLocation: getLocation,
|
674 |
appendQueryParameters: appendQueryParameters
|
675 |
_deferred: [],
|
676 |
flush: function(){
|
677 |
this.trace("... deferred messages ...");
|
678 |
for (var i = 0, len = this._deferred.length; i < len; i++) {
|
679 |
this.trace(this._deferred[i]);
|
680 |
}
|
681 |
this._deferred.length = 0;
|
682 |
this.trace("... end of deferred messages ...");
|
683 |
},
|
684 |
getTime: function(){
|
685 |
var d = new Date(), h = d.getHours() + "", m = d.getMinutes() + "", s = d.getSeconds() + "", ms = d.getMilliseconds() + "", zeros = "000";
|
686 |
if (h.length == 1) {
|
687 |
h = "0" + h;
|
688 |
}
|
689 |
if (m.length == 1) {
|
690 |
m = "0" + m;
|
691 |
}
|
692 |
if (s.length == 1) {
|
693 |
s = "0" + s;
|
694 |
}
|
695 |
ms = zeros.substring(ms.length) + ms;
|
696 |
return h + ":" + m + ":" + s + "." + ms;
|
697 |
},
|
698 |
/**
|
699 |
* Logs the message to console.log if available
|
700 |
* @param {String} msg The message to log
|
701 |
*/
|
702 |
log: function(msg){
|
703 |
// Uses memoizing to cache the implementation
|
704 |
if (!isHostObject(window, "console") || undef(console.log)) {
|
705 |
/**
|
706 |
* Sets log to be an empty function since we have no output available
|
707 |
* @ignore
|
708 |
*/
|
709 |
this.log = emptyFn;
|
710 |
}
|
711 |
else {
|
712 |
/**
|
713 |
* Sets log to be a wrapper around console.log
|
714 |
* @ignore
|
715 |
* @param {String} msg
|
716 |
*/
|
717 |
this.log = function(msg){
|
718 |
console.log(location.host + (namespace ? ":" + namespace : "") + " - " + this.getTime() + ": " + msg);
|
719 |
};
|
720 |
}
|
721 |
this.log(msg);
|
722 |
},
|
723 |
/**
|
724 |
* Will try to trace the given message either to a DOMElement with the id "log",
|
725 |
* or by using console.info.
|
726 |
* @param {String} msg The message to trace
|
727 |
*/
|
728 |
trace: function(msg){
|
729 |
// Uses memoizing to cache the implementation
|
730 |
if (!domIsReady) {
|
731 |
if (this._deferred.length === 0) {
|
732 |
easyXDM.whenReady(debug.flush, debug);
|
733 |
}
|
734 |
this._deferred.push(msg);
|
735 |
this.log(msg);
|
736 |
}
|
737 |
else {
|
738 |
var el = document.getElementById("log");
|
739 |
// is there a log element present?
|
740 |
if (el) {
|
741 |
/**
|
742 |
* Sets trace to be a function that outputs the messages to the DOMElement with id "log"
|
743 |
* @ignore
|
744 |
* @param {String} msg
|
745 |
*/
|
746 |
this.trace = function(msg){
|
747 |
try {
|
748 |
el.appendChild(document.createElement("div")).appendChild(document.createTextNode(location.host + (namespace ? ":" + namespace : "") + " - " + this.getTime() + ":" + msg));
|
749 |
el.scrollTop = el.scrollHeight;
|
750 |
}
|
751 |
catch (e) {
|
752 |
//In case we are unloading
|
753 |
}
|
754 |
};
|
755 |
}
|
756 |
else if (isHostObject(window, "console") && !undef(console.info)) {
|
757 |
/**
|
758 |
* Sets trace to be a wrapper around console.info
|
759 |
* @ignore
|
760 |
* @param {String} msg
|
761 |
*/
|
762 |
this.trace = function(msg){
|
763 |
console.info(location.host + (namespace ? ":" + namespace : "") + " - " + this.getTime() + ":" + msg);
|
764 |
};
|
765 |
}
|
766 |
else {
|
767 |
/**
|
768 |
* Create log window
|
769 |
* @ignore
|
770 |
*/
|
771 |
var domain = location.host, windowname = domain.replace(/\[-.:]/g, "") + "easyxdm_log", logWin;
|
772 |
try {
|
773 |
logWin = window.open("", windowname, "width=800,height=200,status=0,navigation=0,scrollbars=1");
|
774 |
}
|
775 |
catch (e) {
|
776 |
}
|
777 |
if (logWin) {
|
778 |
var doc = logWin.document;
|
779 |
el = doc.getElementById("log");
|
780 |
if (!el) {
|
781 |
doc.write("<html><head><title>easyXDM log " + domain + "</title></head>");
|
782 |
doc.write("<body><div id=\"log\"></div></body></html>");
|
783 |
doc.close();
|
784 |
el = doc.getElementById("log");
|
785 |
}
|
786 |
this.trace = function(msg){
|
787 |
try {
|
788 |
el.appendChild(doc.createElement("div")).appendChild(doc.createTextNode(location.host + (namespace ? ":" + namespace : "") + " - " + this.getTime() + ":" + msg));
|
789 |
el.scrollTop = el.scrollHeight;
|
790 |
}
|
791 |
catch (e) {
|
792 |
//In case we are unloading
|
793 |
}
|
794 |
};
|
795 |
this.trace("---- new logger at " + location.href);
|
796 |
}
|
797 |
|
798 |
if (!el) {
|
799 |
// We are unable to use any logging
|
800 |
this.trace = emptyFn;
|
801 |
}
|
802 |
}
|
803 |
this.trace(msg);
|
804 |
}
|
805 |
},
|
806 |
/**
|
807 |
* Creates a method usable for tracing.
|
808 |
* @param {String} name The name the messages should be marked with
|
809 |
* @return {Function} A function that accepts a single string as argument.
|
810 |
*/
|
811 |
getTracer: function(name){
|
812 |
return function(msg){
|
813 |
debug.trace(name + ": " + msg);
|
814 |
};
|
815 |
}
|
816 |
* @class easyXDM.DomHelper
|
817 |
* Contains methods for dealing with the DOM
|
818 |
* @singleton
|
819 |
*/
|
820 |
/**
|
821 |
* Provides a consistent interface for adding eventhandlers
|
822 |
* @param {Object} target The target to add the event to
|
823 |
* @param {String} type The name of the event
|
824 |
* @param {Function} listener The listener
|
825 |
*/
|
826 |
on: on,
|
827 |
/**
|
828 |
* Provides a consistent interface for removing eventhandlers
|
829 |
* @param {Object} target The target to remove the event from
|
830 |
* @param {String} type The name of the event
|
831 |
* @param {Function} listener The listener
|
832 |
*/
|
833 |
un: un,
|
834 |
/**
|
835 |
* Checks for the presence of the JSON object.
|
836 |
* If it is not present it will use the supplied path to load the JSON2 library.
|
837 |
* This should be called in the documents head right after the easyXDM script tag.
|
838 |
* http://json.org/json2.js
|
839 |
* @param {String} path A valid path to json2.js
|
840 |
*/
|
841 |
requiresJSON: function(path){
|
842 |
if (!isHostObject(window, "JSON")) {
|
843 |
debug.log("loading external JSON");
|
844 |
// we need to encode the < in order to avoid an illegal token error
|
845 |
// when the script is inlined in a document.
|
846 |
document.write('<' + 'script type="text/javascript" src="' + path + '"><' + '/script>');
|
847 |
}
|
848 |
else {
|
849 |
debug.log("native JSON found");
|
850 |
}
|
851 |
}
|
852 |
// The map containing the stored functions
|
853 |
var _map = {};
|
854 |
|
855 |
/**
|
856 |
* @class easyXDM.Fn
|
857 |
* This contains methods related to function handling, such as storing callbacks.
|
858 |
* @singleton
|
859 |
* @namespace easyXDM
|
860 |
*/
|
861 |
easyXDM.Fn = {
|
862 |
/**
|
863 |
* Stores a function using the given name for reference
|
864 |
* @param {String} name The name that the function should be referred by
|
865 |
* @param {Function} fn The function to store
|
866 |
* @namespace easyXDM.fn
|
867 |
*/
|
868 |
set: function(name, fn){
|
869 |
this._trace("storing function " + name);
|
870 |
_map[name] = fn;
|
871 |
},
|
872 |
/**
|
873 |
* Retrieves the function referred to by the given name
|
874 |
* @param {String} name The name of the function to retrieve
|
875 |
* @param {Boolean} del If the function should be deleted after retrieval
|
876 |
* @return {Function} The stored function
|
877 |
* @namespace easyXDM.fn
|
878 |
*/
|
879 |
get: function(name, del){
|
880 |
this._trace("retrieving function " + name);
|
881 |
var fn = _map[name];
|
882 |
if (!fn) {
|
883 |
this._trace(name + " not found");
|
884 |
}
|
885 |
|
886 |
if (del) {
|
887 |
delete _map[name];
|
888 |
}
|
889 |
return fn;
|
890 |
}
|
891 |
};
|
892 |
|
893 |
easyXDM.Fn._trace = debug.getTracer("easyXDM.Fn");
|
894 |
* @class easyXDM.Socket
|
895 |
* This class creates a transport channel between two domains that is usable for sending and receiving string-based messages.<br/>
|
896 |
* The channel is reliable, supports queueing, and ensures that the message originates from the expected domain.<br/>
|
897 |
* Internally different stacks will be used depending on the browsers features and the available parameters.
|
898 |
* <h2>How to set up</h2>
|
899 |
* Setting up the provider:
|
900 |
* <pre><code>
|
901 |
* var socket = new easyXDM.Socket({
|
902 |
* local: "name.html",
|
903 |
* onReady: function(){
|
904 |
* // you need to wait for the onReady callback before using the socket
|
905 |
* socket.postMessage("foo-message");
|
906 |
* },
|
907 |
* onMessage: function(message, origin) {
|
908 |
* alert("received " + message + " from " + origin);
|
909 |
* }
|
910 |
* });
|
911 |
* </code></pre>
|
912 |
* Setting up the consumer:
|
913 |
* <pre><code>
|
914 |
* var socket = new easyXDM.Socket({
|
915 |
* remote: "http://remotedomain/page.html",
|
916 |
* remoteHelper: "http://remotedomain/name.html",
|
917 |
* onReady: function(){
|
918 |
* // you need to wait for the onReady callback before using the socket
|
919 |
* socket.postMessage("foo-message");
|
920 |
* },
|
921 |
* onMessage: function(message, origin) {
|
922 |
* alert("received " + message + " from " + origin);
|
923 |
* }
|
924 |
* });
|
925 |
* </code></pre>
|
926 |
* If you are unable to upload the <code>name.html</code> file to the consumers domain then remove the <code>remoteHelper</code> property
|
927 |
* and easyXDM will fall back to using the HashTransport instead of the NameTransport when not able to use any of the primary transports.
|
928 |
* @namespace easyXDM
|
929 |
* @constructor
|
930 |
* @cfg {String/Window} local The url to the local name.html document, a local static file, or a reference to the local window.
|
931 |
* @cfg {Boolean} lazy (Consumer only) Set this to true if you want easyXDM to defer creating the transport until really needed.
|
932 |
* @cfg {String} remote (Consumer only) The url to the providers document.
|
933 |
* @cfg {String} remoteHelper (Consumer only) The url to the remote name.html file. This is to support NameTransport as a fallback. Optional.
|
934 |
* @cfg {Number} delay The number of milliseconds easyXDM should try to get a reference to the local window. Optional, defaults to 2000.
|
935 |
* @cfg {Number} interval The interval used when polling for messages. Optional, defaults to 300.
|
936 |
* @cfg {String} channel (Consumer only) The name of the channel to use. Can be used to set consistent iframe names. Must be unique. Optional.
|
937 |
* @cfg {Function} onMessage The method that should handle incoming messages.<br/> This method should accept two arguments, the message as a string, and the origin as a string. Optional.
|
938 |
* @cfg {Function} onReady A method that should be called when the transport is ready. Optional.
|
939 |
* @cfg {DOMElement|String} container (Consumer only) The element, or the id of the element that the primary iframe should be inserted into. If not set then the iframe will be positioned off-screen. Optional.
|
940 |
* @cfg {Array/String} acl (Provider only) Here you can specify which '[protocol]://[domain]' patterns that should be allowed to act as the consumer towards this provider.<br/>
|
941 |
* This can contain the wildcards ? and *. Examples are 'http://example.com', '*.foo.com' and '*dom?.com'. If you want to use reqular expressions then you pattern needs to start with ^ and end with $.
|
942 |
* If none of the patterns match an Error will be thrown.
|
943 |
* @cfg {Object} props (Consumer only) Additional properties that should be applied to the iframe. This can also contain nested objects e.g: <code>{style:{width:"100px", height:"100px"}}</code>.
|
944 |
* Properties such as 'name' and 'src' will be overrided. Optional.
|
945 |
*/
|
946 |
var trace = debug.getTracer("easyXDM.Socket");
|
947 |
trace("constructor");
|
948 |
|
949 |
// create the stack
|
950 |
var stack = chainStack(prepareTransportStack(config).concat([{
|
951 |
incoming: function(message, origin){
|
952 |
config.onMessage(message, origin);
|
953 |
},
|
954 |
callback: function(success){
|
955 |
if (config.onReady) {
|
956 |
config.onReady(success);
|
957 |
}
|
958 |
}
|
959 |
}])), recipient = getLocation(config.remote);
|
960 |
|
961 |
// set the origin
|
962 |
this.origin = getLocation(config.remote);
|
963 |
/**
|
964 |
* Initiates the destruction of the stack.
|
965 |
*/
|
966 |
this.destroy = function(){
|
967 |
stack.destroy();
|
968 |
};
|
969 |
|
970 |
/**
|
971 |
* Posts a message to the remote end of the channel
|
972 |
* @param {String} message The message to send
|
973 |
*/
|
974 |
this.postMessage = function(message){
|
975 |
stack.outgoing(message, recipient);
|
976 |
};
|
977 |
|
978 |
stack.init();
|
979 |
* @class easyXDM.Rpc
|
980 |
* Creates a proxy object that can be used to call methods implemented on the remote end of the channel, and also to provide the implementation
|
981 |
* of methods to be called from the remote end.<br/>
|
982 |
* The instantiated object will have methods matching those specified in <code>config.remote</code>.<br/>
|
983 |
* This requires the JSON object present in the document, either natively, using json.org's json2 or as a wrapper around library spesific methods.
|
984 |
* <h2>How to set up</h2>
|
985 |
* <pre><code>
|
986 |
* var rpc = new easyXDM.Rpc({
|
987 |
* // this configuration is equal to that used by the Socket.
|
988 |
* remote: "http://remotedomain/...",
|
989 |
* onReady: function(){
|
990 |
* // you need to wait for the onReady callback before using the proxy
|
991 |
* rpc.foo(...
|
992 |
* }
|
993 |
* },{
|
994 |
* local: {..},
|
995 |
* remote: {..}
|
996 |
* });
|
997 |
* </code></pre>
|
998 |
*
|
999 |
* <h2>Exposing functions (procedures)</h2>
|
1000 |
* <pre><code>
|
1001 |
* var rpc = new easyXDM.Rpc({
|
1002 |
* ...
|
1003 |
* },{
|
1004 |
* local: {
|
1005 |
* nameOfMethod: {
|
1006 |
* method: function(arg1, arg2, success, error){
|
1007 |
* ...
|
1008 |
* }
|
1009 |
* },
|
1010 |
* // with shorthand notation
|
1011 |
* nameOfAnotherMethod: function(arg1, arg2, success, error){
|
1012 |
* }
|
1013 |
* },
|
1014 |
* remote: {...}
|
1015 |
* });
|
1016 |
* </code></pre>
|
1017 |
* The function referenced by [method] will receive the passed arguments followed by the callback functions <code>success</code> and <code>error</code>.<br/>
|
1018 |
* To send a successfull result back you can use
|
1019 |
* <pre><code>
|
1020 |
* return foo;
|
1021 |
* </pre></code>
|
1022 |
* or
|
1023 |
* <pre><code>
|
1024 |
* success(foo);
|
1025 |
* </pre></code>
|
1026 |
* To return an error you can use
|
1027 |
* <pre><code>
|
1028 |
* throw new Error("foo error");
|
1029 |
* </code></pre>
|
1030 |
* or
|
1031 |
* <pre><code>
|
1032 |
* error("foo error");
|
1033 |
* </code></pre>
|
1034 |
*
|
1035 |
* <h2>Defining remotely exposed methods (procedures/notifications)</h2>
|
1036 |
* The definition of the remote end is quite similar:
|
1037 |
* <pre><code>
|
1038 |
* var rpc = new easyXDM.Rpc({
|
1039 |
* ...
|
1040 |
* },{
|
1041 |
* local: {...},
|
1042 |
* remote: {
|
1043 |
* nameOfMethod: {}
|
1044 |
* }
|
1045 |
* });
|
1046 |
* </code></pre>
|
1047 |
* To call a remote method use
|
1048 |
* <pre><code>
|
1049 |
* rpc.nameOfMethod("arg1", "arg2", function(value) {
|
1050 |
* alert("success: " + value);
|
1051 |
* }, function(message) {
|
1052 |
* alert("error: " + message + );
|
1053 |
* });
|
1054 |
* </code></pre>
|
1055 |
* Both the <code>success</code> and <code>errror</code> callbacks are optional.<br/>
|
1056 |
* When called with no callback a JSON-RPC 2.0 notification will be executed.
|
1057 |
* Be aware that you will not be notified of any errors with this method.
|
1058 |
* <br/>
|
1059 |
* <h2>Specifying a custom serializer</h2>
|
1060 |
* If you do not want to use the JSON2 library for non-native JSON support, but instead capabilities provided by some other library
|
1061 |
* then you can specify a custom serializer using <code>serializer: foo</code>
|
1062 |
* <pre><code>
|
1063 |
* var rpc = new easyXDM.Rpc({
|
1064 |
* ...
|
1065 |
* },{
|
1066 |
* local: {...},
|
1067 |
* remote: {...},
|
1068 |
* serializer : {
|
1069 |
* parse: function(string){ ... },
|
1070 |
* stringify: function(object) {...}
|
1071 |
* }
|
1072 |
* });
|
1073 |
* </code></pre>
|
1074 |
* If <code>serializer</code> is set then the class will not attempt to use the native implementation.
|
1075 |
* @namespace easyXDM
|
1076 |
* @constructor
|
1077 |
* @param {Object} config The underlying transports configuration. See easyXDM.Socket for available parameters.
|
1078 |
* @param {Object} jsonRpcConfig The description of the interface to implement.
|
1079 |
*/
|
1080 |
var trace = debug.getTracer("easyXDM.Rpc");
|
1081 |
trace("constructor");
|
1082 |
|
1083 |
// expand shorthand notation
|
1084 |
if (jsonRpcConfig.local) {
|
1085 |
for (var method in jsonRpcConfig.local) {
|
1086 |
if (jsonRpcConfig.local.hasOwnProperty(method)) {
|
1087 |
var member = jsonRpcConfig.local[method];
|
1088 |
if (typeof member === "function") {
|
1089 |
jsonRpcConfig.local[method] = {
|
1090 |
method: member
|
1091 |
};
|
1092 |
}
|
1093 |
}
|
1094 |
}
|
1095 |
}
|
1096 |
// create the stack
|
1097 |
var stack = chainStack(prepareTransportStack(config).concat([new easyXDM.stack.RpcBehavior(this, jsonRpcConfig), {
|
1098 |
callback: function(success){
|
1099 |
if (config.onReady) {
|
1100 |
config.onReady(success);
|
1101 |
}
|
1102 |
}
|
1103 |
}]));
|
1104 |
// set the origin
|
1105 |
this.origin = getLocation(config.remote);
|
1106 |
|
1107 |
/**
|
1108 |
* Initiates the destruction of the stack.
|
1109 |
*/
|
1110 |
this.destroy = function(){
|
1111 |
stack.destroy();
|
1112 |
};
|
1113 |
|
1114 |
stack.init();
|
1115 |
* @class easyXDM.stack.SameOriginTransport
|
1116 |
* SameOriginTransport is a transport class that can be used when both domains have the same origin.<br/>
|
1117 |
* This can be useful for testing and for when the main application supports both internal and external sources.
|
1118 |
* @namespace easyXDM.stack
|
1119 |
* @constructor
|
1120 |
* @param {Object} config The transports configuration.
|
1121 |
* @cfg {String} remote The remote document to communicate with.
|
1122 |
*/
|
1123 |
var trace = debug.getTracer("easyXDM.stack.SameOriginTransport");
|
1124 |
trace("constructor");
|
1125 |
var pub, frame, send, targetOrigin;
|
1126 |
|
1127 |
return (pub = {
|
1128 |
outgoing: function(message, domain, fn){
|
1129 |
send(message);
|
1130 |
if (fn) {
|
1131 |
fn();
|
1132 |
}
|
1133 |
},
|
1134 |
destroy: function(){
|
1135 |
trace("destroy");
|
1136 |
if (frame) {
|
1137 |
frame.parentNode.removeChild(frame);
|
1138 |
frame = null;
|
1139 |
}
|
1140 |
},
|
1141 |
onDOMReady: function(){
|
1142 |
trace("init");
|
1143 |
targetOrigin = getLocation(config.remote);
|
1144 |
|
1145 |
if (config.isHost) {
|
1146 |
// set up the iframe
|
1147 |
apply(config.props, {
|
1148 |
src: appendQueryParameters(config.remote, {
|
1149 |
xdm_e: location.protocol + "//" + location.host + location.pathname,
|
1150 |
xdm_c: config.channel,
|
1151 |
xdm_p: 4 // 4 = SameOriginTransport
|
1152 |
}),
|
1153 |
name: IFRAME_PREFIX + config.channel + "_provider"
|
1154 |
});
|
1155 |
frame = createFrame(config);
|
1156 |
easyXDM.Fn.set(config.channel, function(sendFn){
|
1157 |
send = sendFn;
|
1158 |
setTimeout(function(){
|
1159 |
pub.up.callback(true);
|
1160 |
}, 0);
|
1161 |
return function(msg){
|
1162 |
pub.up.incoming(msg, targetOrigin);
|
1163 |
};
|
1164 |
});
|
1165 |
}
|
1166 |
else {
|
1167 |
send = getParentObject().Fn.get(config.channel, true)(function(msg){
|
1168 |
pub.up.incoming(msg, targetOrigin);
|
1169 |
});
|
1170 |
setTimeout(function(){
|
1171 |
pub.up.callback(true);
|
1172 |
}, 0);
|
1173 |
}
|
1174 |
},
|
1175 |
init: function(){
|
1176 |
whenReady(pub.onDOMReady, pub);
|
1177 |
}
|
1178 |
});
|
1179 |
* @class easyXDM.stack.FlashTransport
|
1180 |
* FlashTransport is a transport class that uses an SWF with LocalConnection to pass messages back and forth.
|
1181 |
* @namespace easyXDM.stack
|
1182 |
* @constructor
|
1183 |
* @param {Object} config The transports configuration.
|
1184 |
* @cfg {String} remote The remote domain to communicate with.
|
1185 |
* @cfg {String} secret the pre-shared secret used to secure the communication.
|
1186 |
* @cfg {String} swf The path to the swf file
|
1187 |
* @cfg {Boolean} swfNoThrottle Set this to true if you want to take steps to avoid beeing throttled when hidden.
|
1188 |
* @cfg {String || DOMElement} swfContainer Set this if you want to control where the swf is placed
|
1189 |
*/
|
1190 |
var trace = debug.getTracer("easyXDM.stack.FlashTransport");
|
1191 |
trace("constructor");
|
1192 |
if (!config.swf) {
|
1193 |
throw new Error("Path to easyxdm.swf is missing");
|
1194 |
}
|
1195 |
var pub, // the public interface
|
1196 |
frame, send, targetOrigin, swf, swfContainer;
|
1197 |
|
1198 |
function onMessage(message, origin){
|
1199 |
setTimeout(function(){
|
1200 |
trace("received message");
|
1201 |
pub.up.incoming(message, targetOrigin);
|
1202 |
}, 0);
|
1203 |
}
|
1204 |
|
1205 |
/**
|
1206 |
* This method adds the SWF to the DOM and prepares the initialization of the channel
|
1207 |
*/
|
1208 |
function addSwf(domain){
|
1209 |
trace("creating factory with SWF from " + domain);
|
1210 |
// the differentiating query argument is needed in Flash9 to avoid a caching issue where LocalConnection would throw an error.
|
1211 |
var url = config.swf + "?host=" + config.isHost;
|
1212 |
var id = "easyXDM_swf_" + Math.floor(Math.random() * 10000);
|
1213 |
|
1214 |
// prepare the init function that will fire once the swf is ready
|
1215 |
easyXDM.Fn.set("flash_loaded" + domain.replace(/[\-.]/g, "_"), function(){
|
1216 |
easyXDM.stack.FlashTransport[domain].swf = swf = swfContainer.firstChild;
|
1217 |
var queue = easyXDM.stack.FlashTransport[domain].queue;
|
1218 |
for (var i = 0; i < queue.length; i++) {
|
1219 |
queue[i]();
|
1220 |
}
|
1221 |
queue.length = 0;
|
1222 |
});
|
1223 |
|
1224 |
if (config.swfContainer) {
|
1225 |
swfContainer = (typeof config.swfContainer == "string") ? document.getElementById(config.swfContainer) : config.swfContainer;
|
1226 |
}
|
1227 |
else {
|
1228 |
// create the container that will hold the swf
|
1229 |
swfContainer = document.createElement('div');
|
1230 |
|
1231 |
// http://bugs.adobe.com/jira/browse/FP-4796
|
1232 |
// http://tech.groups.yahoo.com/group/flexcoders/message/162365
|
1233 |
// https://groups.google.com/forum/#!topic/easyxdm/mJZJhWagoLc
|
1234 |
apply(swfContainer.style, HAS_FLASH_THROTTLED_BUG && config.swfNoThrottle ? {
|
1235 |
height: "20px",
|
1236 |
width: "20px",
|
1237 |
position: "fixed",
|
1238 |
right: 0,
|
1239 |
top: 0
|
1240 |
} : {
|
1241 |
height: "1px",
|
1242 |
width: "1px",
|
1243 |
position: "absolute",
|
1244 |
overflow: "hidden",
|
1245 |
right: 0,
|
1246 |
top: 0
|
1247 |
});
|
1248 |
document.body.appendChild(swfContainer);
|
1249 |
}
|
1250 |
|
1251 |
// create the object/embed
|
1252 |
var flashVars = "callback=flash_loaded" + domain.replace(/[\-.]/g, "_") + "&proto=" + global.location.protocol + "&domain=" + getDomainName(global.location.href) + "&port=" + getPort(global.location.href) + "&ns=" + namespace;
|
1253 |
flashVars += "&log=true";
|
1254 |
swfContainer.innerHTML = "<object height='20' width='20' type='application/x-shockwave-flash' id='" + id + "' data='" + url + "'>" +
|
1255 |
"<param name='allowScriptAccess' value='always'></param>" +
|
1256 |
"<param name='wmode' value='transparent'>" +
|
1257 |
"<param name='movie' value='" +
|
1258 |
url +
|
1259 |
"'></param>" +
|
1260 |
"<param name='flashvars' value='" +
|
1261 |
flashVars +
|
1262 |
"'></param>" +
|
1263 |
"<embed type='application/x-shockwave-flash' FlashVars='" +
|
1264 |
flashVars +
|
1265 |
"' allowScriptAccess='always' wmode='transparent' src='" +
|
1266 |
url +
|
1267 |
"' height='1' width='1'></embed>" +
|
1268 |
"</object>";
|
1269 |
}
|
1270 |
|
1271 |
return (pub = {
|
1272 |
outgoing: function(message, domain, fn){
|
1273 |
swf.postMessage(config.channel, message.toString());
|
1274 |
if (fn) {
|
1275 |
fn();
|
1276 |
}
|
1277 |
},
|
1278 |
destroy: function(){
|
1279 |
trace("destroy");
|
1280 |
try {
|
1281 |
swf.destroyChannel(config.channel);
|
1282 |
}
|
1283 |
catch (e) {
|
1284 |
}
|
1285 |
swf = null;
|
1286 |
if (frame) {
|
1287 |
frame.parentNode.removeChild(frame);
|
1288 |
frame = null;
|
1289 |
}
|
1290 |
},
|
1291 |
onDOMReady: function(){
|
1292 |
trace("init");
|
1293 |
|
1294 |
targetOrigin = config.remote;
|
1295 |
|
1296 |
// Prepare the code that will be run after the swf has been intialized
|
1297 |
easyXDM.Fn.set("flash_" + config.channel + "_init", function(){
|
1298 |
setTimeout(function(){
|
1299 |
trace("firing onReady");
|
1300 |
pub.up.callback(true);
|
1301 |
});
|
1302 |
});
|
1303 |
|
1304 |
// set up the omMessage handler
|
1305 |
easyXDM.Fn.set("flash_" + config.channel + "_onMessage", onMessage);
|
1306 |
|
1307 |
config.swf = resolveUrl(config.swf); // reports have been made of requests gone rogue when using relative paths
|
1308 |
var swfdomain = getDomainName(config.swf);
|
1309 |
var fn = function(){
|
1310 |
// set init to true in case the fn was called was invoked from a separate instance
|
1311 |
easyXDM.stack.FlashTransport[swfdomain].init = true;
|
1312 |
swf = easyXDM.stack.FlashTransport[swfdomain].swf;
|
1313 |
// create the channel
|
1314 |
swf.createChannel(config.channel, config.secret, getLocation(config.remote), config.isHost);
|
1315 |
|
1316 |
if (config.isHost) {
|
1317 |
// if Flash is going to be throttled and we want to avoid this
|
1318 |
if (HAS_FLASH_THROTTLED_BUG && config.swfNoThrottle) {
|
1319 |
apply(config.props, {
|
1320 |
position: "fixed",
|
1321 |
right: 0,
|
1322 |
top: 0,
|
1323 |
height: "20px",
|
1324 |
width: "20px"
|
1325 |
});
|
1326 |
}
|
1327 |
// set up the iframe
|
1328 |
apply(config.props, {
|
1329 |
src: appendQueryParameters(config.remote, {
|
1330 |
xdm_e: getLocation(location.href),
|
1331 |
xdm_c: config.channel,
|
1332 |
xdm_p: 6, // 6 = FlashTransport
|
1333 |
xdm_s: config.secret
|
1334 |
}),
|
1335 |
name: IFRAME_PREFIX + config.channel + "_provider"
|
1336 |
});
|
1337 |
frame = createFrame(config);
|
1338 |
}
|
1339 |
};
|
1340 |
|
1341 |
if (easyXDM.stack.FlashTransport[swfdomain] && easyXDM.stack.FlashTransport[swfdomain].init) {
|
1342 |
// if the swf is in place and we are the consumer
|
1343 |
fn();
|
1344 |
}
|
1345 |
else {
|
1346 |
// if the swf does not yet exist
|
1347 |
if (!easyXDM.stack.FlashTransport[swfdomain]) {
|
1348 |
// add the queue to hold the init fn's
|
1349 |
easyXDM.stack.FlashTransport[swfdomain] = {
|
1350 |
queue: [fn]
|
1351 |
};
|
1352 |
addSwf(swfdomain);
|
1353 |
}
|
1354 |
else {
|
1355 |
easyXDM.stack.FlashTransport[swfdomain].queue.push(fn);
|
1356 |
}
|
1357 |
}
|
1358 |
},
|
1359 |
init: function(){
|
1360 |
whenReady(pub.onDOMReady, pub);
|
1361 |
}
|
1362 |
});
|
1363 |
* @class easyXDM.stack.PostMessageTransport
|
1364 |
* PostMessageTransport is a transport class that uses HTML5 postMessage for communication.<br/>
|
1365 |
* <a href="http://msdn.microsoft.com/en-us/library/ms644944(VS.85).aspx">http://msdn.microsoft.com/en-us/library/ms644944(VS.85).aspx</a><br/>
|
1366 |
* <a href="https://developer.mozilla.org/en/DOM/window.postMessage">https://developer.mozilla.org/en/DOM/window.postMessage</a>
|
1367 |
* @namespace easyXDM.stack
|
1368 |
* @constructor
|
1369 |
* @param {Object} config The transports configuration.
|
1370 |
* @cfg {String} remote The remote domain to communicate with.
|
1371 |
*/
|
1372 |
var trace = debug.getTracer("easyXDM.stack.PostMessageTransport");
|
1373 |
trace("constructor");
|
1374 |
var pub, // the public interface
|
1375 |
frame, // the remote frame, if any
|
1376 |
callerWindow, // the window that we will call with
|
1377 |
targetOrigin; // the domain to communicate with
|
1378 |
/**
|
1379 |
* Resolves the origin from the event object
|
1380 |
* @private
|
1381 |
* @param {Object} event The messageevent
|
1382 |
* @return {String} The scheme, host and port of the origin
|
1383 |
*/
|
1384 |
function _getOrigin(event){
|
1385 |
if (event.origin) {
|
1386 |
// This is the HTML5 property
|
1387 |
return getLocation(event.origin);
|
1388 |
}
|
1389 |
if (event.uri) {
|
1390 |
// From earlier implementations
|
1391 |
return getLocation(event.uri);
|
1392 |
}
|
1393 |
if (event.domain) {
|
1394 |
// This is the last option and will fail if the
|
1395 |
// origin is not using the same schema as we are
|
1396 |
return location.protocol + "//" + event.domain;
|
1397 |
}
|
1398 |
throw "Unable to retrieve the origin of the event";
|
1399 |
}
|
1400 |
|
1401 |
/**
|
1402 |
* This is the main implementation for the onMessage event.<br/>
|
1403 |
* It checks the validity of the origin and passes the message on if appropriate.
|
1404 |
* @private
|
1405 |
* @param {Object} event The messageevent
|
1406 |
*/
|
1407 |
function _window_onMessage(event){
|
1408 |
var origin = _getOrigin(event);
|
1409 |
trace("received message '" + event.data + "' from " + origin);
|
1410 |
if (origin == targetOrigin && event.data.substring(0, config.channel.length + 1) == config.channel + " ") {
|
1411 |
pub.up.incoming(event.data.substring(config.channel.length + 1), origin);
|
1412 |
}
|
1413 |
}
|
1414 |
|
1415 |
return (pub = {
|
1416 |
outgoing: function(message, domain, fn){
|
1417 |
callerWindow.postMessage(config.channel + " " + message, domain || targetOrigin);
|
1418 |
if (fn) {
|
1419 |
fn();
|
1420 |
}
|
1421 |
},
|
1422 |
destroy: function(){
|
1423 |
trace("destroy");
|
1424 |
un(window, "message", _window_onMessage);
|
1425 |
if (frame) {
|
1426 |
callerWindow = null;
|
1427 |
frame.parentNode.removeChild(frame);
|
1428 |
frame = null;
|
1429 |
}
|
1430 |
},
|
1431 |
onDOMReady: function(){
|
1432 |
trace("init");
|
1433 |
targetOrigin = getLocation(config.remote);
|
1434 |
if (config.isHost) {
|
1435 |
// add the event handler for listening
|
1436 |
var waitForReady = function(event){
|
1437 |
if (event.data == config.channel + "-ready") {
|
1438 |
trace("firing onReady");
|
1439 |
// replace the eventlistener
|
1440 |
callerWindow = ("postMessage" in frame.contentWindow) ? frame.contentWindow : frame.contentWindow.document;
|
1441 |
un(window, "message", waitForReady);
|
1442 |
on(window, "message", _window_onMessage);
|
1443 |
setTimeout(function(){
|
1444 |
pub.up.callback(true);
|
1445 |
}, 0);
|
1446 |
}
|
1447 |
};
|
1448 |
on(window, "message", waitForReady);
|
1449 |
|
1450 |
// set up the iframe
|
1451 |
apply(config.props, {
|
1452 |
src: appendQueryParameters(config.remote, {
|
1453 |
xdm_e: getLocation(location.href),
|
1454 |
xdm_c: config.channel,
|
1455 |
xdm_p: 1 // 1 = PostMessage
|
1456 |
}),
|
1457 |
name: IFRAME_PREFIX + config.channel + "_provider"
|
1458 |
});
|
1459 |
frame = createFrame(config);
|
1460 |
}
|
1461 |
else {
|
1462 |
// add the event handler for listening
|
1463 |
on(window, "message", _window_onMessage);
|
1464 |
callerWindow = ("postMessage" in window.parent) ? window.parent : window.parent.document;
|
1465 |
callerWindow.postMessage(config.channel + "-ready", targetOrigin);
|
1466 |
|
1467 |
setTimeout(function(){
|
1468 |
pub.up.callback(true);
|
1469 |
}, 0);
|
1470 |
}
|
1471 |
},
|
1472 |
init: function(){
|
1473 |
whenReady(pub.onDOMReady, pub);
|
1474 |
}
|
1475 |
});
|
1476 |
* @class easyXDM.stack.FrameElementTransport
|
1477 |
* FrameElementTransport is a transport class that can be used with Gecko-browser as these allow passing variables using the frameElement property.<br/>
|
1478 |
* Security is maintained as Gecho uses Lexical Authorization to determine under which scope a function is running.
|
1479 |
* @namespace easyXDM.stack
|
1480 |
* @constructor
|
1481 |
* @param {Object} config The transports configuration.
|
1482 |
* @cfg {String} remote The remote document to communicate with.
|
1483 |
*/
|
1484 |
var trace = debug.getTracer("easyXDM.stack.FrameElementTransport");
|
1485 |
trace("constructor");
|
1486 |
var pub, frame, send, targetOrigin;
|
1487 |
|
1488 |
return (pub = {
|
1489 |
outgoing: function(message, domain, fn){
|
1490 |
send.call(this, message);
|
1491 |
if (fn) {
|
1492 |
fn();
|
1493 |
}
|
1494 |
},
|
1495 |
destroy: function(){
|
1496 |
trace("destroy");
|
1497 |
if (frame) {
|
1498 |
frame.parentNode.removeChild(frame);
|
1499 |
frame = null;
|
1500 |
}
|
1501 |
},
|
1502 |
onDOMReady: function(){
|
1503 |
trace("init");
|
1504 |
targetOrigin = getLocation(config.remote);
|
1505 |
|
1506 |
if (config.isHost) {
|
1507 |
// set up the iframe
|
1508 |
apply(config.props, {
|
1509 |
src: appendQueryParameters(config.remote, {
|
1510 |
xdm_e: getLocation(location.href),
|
1511 |
xdm_c: config.channel,
|
1512 |
xdm_p: 5 // 5 = FrameElementTransport
|
1513 |
}),
|
1514 |
name: IFRAME_PREFIX + config.channel + "_provider"
|
1515 |
});
|
1516 |
frame = createFrame(config);
|
1517 |
frame.fn = function(sendFn){
|
1518 |
delete frame.fn;
|
1519 |
send = sendFn;
|
1520 |
setTimeout(function(){
|
1521 |
pub.up.callback(true);
|
1522 |
}, 0);
|
1523 |
// remove the function so that it cannot be used to overwrite the send function later on
|
1524 |
return function(msg){
|
1525 |
pub.up.incoming(msg, targetOrigin);
|
1526 |
};
|
1527 |
};
|
1528 |
}
|
1529 |
else {
|
1530 |
// This is to mitigate origin-spoofing
|
1531 |
if (document.referrer && getLocation(document.referrer) != query.xdm_e) {
|
1532 |
window.top.location = query.xdm_e;
|
1533 |
}
|
1534 |
send = window.frameElement.fn(function(msg){
|
1535 |
pub.up.incoming(msg, targetOrigin);
|
1536 |
});
|
1537 |
pub.up.callback(true);
|
1538 |
}
|
1539 |
},
|
1540 |
init: function(){
|
1541 |
whenReady(pub.onDOMReady, pub);
|
1542 |
}
|
1543 |
});
|
1544 |
* @class easyXDM.stack.NameTransport
|
1545 |
* NameTransport uses the window.name property to relay data.
|
1546 |
* The <code>local</code> parameter needs to be set on both the consumer and provider,<br/>
|
1547 |
* and the <code>remoteHelper</code> parameter needs to be set on the consumer.
|
1548 |
* @constructor
|
1549 |
* @param {Object} config The transports configuration.
|
1550 |
* @cfg {String} remoteHelper The url to the remote instance of hash.html - this is only needed for the host.
|
1551 |
* @namespace easyXDM.stack
|
1552 |
*/
|
1553 |
var trace = debug.getTracer("easyXDM.stack.NameTransport");
|
1554 |
trace("constructor");
|
1555 |
if (config.isHost && undef(config.remoteHelper)) {
|
1556 |
trace("missing remoteHelper");
|
1557 |
throw new Error("missing remoteHelper");
|
1558 |
}
|
1559 |
|
1560 |
var pub; // the public interface
|
1561 |
var isHost, callerWindow, remoteWindow, readyCount, callback, remoteOrigin, remoteUrl;
|
1562 |
|
1563 |
function _sendMessage(message){
|
1564 |
var url = config.remoteHelper + (isHost ? "#_3" : "#_2") + config.channel;
|
1565 |
trace("sending message " + message);
|
1566 |
trace("navigating to '" + url + "'");
|
1567 |
callerWindow.contentWindow.sendMessage(message, url);
|
1568 |
}
|
1569 |
|
1570 |
function _onReady(){
|
1571 |
if (isHost) {
|
1572 |
if (++readyCount === 2 || !isHost) {
|
1573 |
pub.up.callback(true);
|
1574 |
}
|
1575 |
}
|
1576 |
else {
|
1577 |
_sendMessage("ready");
|
1578 |
trace("calling onReady");
|
1579 |
pub.up.callback(true);
|
1580 |
}
|
1581 |
}
|
1582 |
|
1583 |
function _onMessage(message){
|
1584 |
trace("received message " + message);
|
1585 |
pub.up.incoming(message, remoteOrigin);
|
1586 |
}
|
1587 |
|
1588 |
function _onLoad(){
|
1589 |
if (callback) {
|
1590 |
setTimeout(function(){
|
1591 |
callback(true);
|
1592 |
}, 0);
|
1593 |
}
|
1594 |
}
|
1595 |
|
1596 |
return (pub = {
|
1597 |
outgoing: function(message, domain, fn){
|
1598 |
callback = fn;
|
1599 |
_sendMessage(message);
|
1600 |
},
|
1601 |
destroy: function(){
|
1602 |
trace("destroy");
|
1603 |
callerWindow.parentNode.removeChild(callerWindow);
|
1604 |
callerWindow = null;
|
1605 |
if (isHost) {
|
1606 |
remoteWindow.parentNode.removeChild(remoteWindow);
|
1607 |
remoteWindow = null;
|
1608 |
}
|
1609 |
},
|
1610 |
onDOMReady: function(){
|
1611 |
trace("init");
|
1612 |
isHost = config.isHost;
|
1613 |
readyCount = 0;
|
1614 |
remoteOrigin = getLocation(config.remote);
|
1615 |
config.local = resolveUrl(config.local);
|
1616 |
|
1617 |
if (isHost) {
|
1618 |
// Register the callback
|
1619 |
easyXDM.Fn.set(config.channel, function(message){
|
1620 |
trace("received initial message " + message);
|
1621 |
if (isHost && message === "ready") {
|
1622 |
// Replace the handler
|
1623 |
easyXDM.Fn.set(config.channel, _onMessage);
|
1624 |
_onReady();
|
1625 |
}
|
1626 |
});
|
1627 |
|
1628 |
// Set up the frame that points to the remote instance
|
1629 |
remoteUrl = appendQueryParameters(config.remote, {
|
1630 |
xdm_e: config.local,
|
1631 |
xdm_c: config.channel,
|
1632 |
xdm_p: 2
|
1633 |
});
|
1634 |
apply(config.props, {
|
1635 |
src: remoteUrl + '#' + config.channel,
|
1636 |
name: IFRAME_PREFIX + config.channel + "_provider"
|
1637 |
});
|
1638 |
remoteWindow = createFrame(config);
|
1639 |
}
|
1640 |
else {
|
1641 |
config.remoteHelper = config.remote;
|
1642 |
easyXDM.Fn.set(config.channel, _onMessage);
|
1643 |
}
|
1644 |
// Set up the iframe that will be used for the transport
|
1645 |
|
1646 |
callerWindow = createFrame({
|
1647 |
props: {
|
1648 |
src: config.local + "#_4" + config.channel
|
1649 |
},
|
1650 |
onLoad: function onLoad(){
|
1651 |
// Remove the handler
|
1652 |
var w = callerWindow || this;
|
1653 |
un(w, "load", onLoad);
|
1654 |
easyXDM.Fn.set(config.channel + "_load", _onLoad);
|
1655 |
(function test(){
|
1656 |
if (typeof w.contentWindow.sendMessage == "function") {
|
1657 |
_onReady();
|
1658 |
}
|
1659 |
else {
|
1660 |
setTimeout(test, 50);
|
1661 |
}
|
1662 |
}());
|
1663 |
}
|
1664 |
});
|
1665 |
},
|
1666 |
init: function(){
|
1667 |
whenReady(pub.onDOMReady, pub);
|
1668 |
}
|
1669 |
});
|
1670 |
* @class easyXDM.stack.HashTransport
|
1671 |
* HashTransport is a transport class that uses the IFrame URL Technique for communication.<br/>
|
1672 |
* <a href="http://msdn.microsoft.com/en-us/library/bb735305.aspx">http://msdn.microsoft.com/en-us/library/bb735305.aspx</a><br/>
|
1673 |
* @namespace easyXDM.stack
|
1674 |
* @constructor
|
1675 |
* @param {Object} config The transports configuration.
|
1676 |
* @cfg {String/Window} local The url to the local file used for proxying messages, or the local window.
|
1677 |
* @cfg {Number} delay The number of milliseconds easyXDM should try to get a reference to the local window.
|
1678 |
* @cfg {Number} interval The interval used when polling for messages.
|
1679 |
*/
|
1680 |
var trace = debug.getTracer("easyXDM.stack.HashTransport");
|
1681 |
trace("constructor");
|
1682 |
var pub;
|
1683 |
var me = this, isHost, _timer, pollInterval, _lastMsg, _msgNr, _listenerWindow, _callerWindow;
|
1684 |
var useParent, _remoteOrigin;
|
1685 |
|
1686 |
function _sendMessage(message){
|
1687 |
trace("sending message '" + (_msgNr + 1) + " " + message + "' to " + _remoteOrigin);
|
1688 |
if (!_callerWindow) {
|
1689 |
trace("no caller window");
|
1690 |
return;
|
1691 |
}
|
1692 |
var url = config.remote + "#" + (_msgNr++) + "_" + message;
|
1693 |
((isHost || !useParent) ? _callerWindow.contentWindow : _callerWindow).location = url;
|
1694 |
}
|
1695 |
|
1696 |
function _handleHash(hash){
|
1697 |
_lastMsg = hash;
|
1698 |
trace("received message '" + _lastMsg + "' from " + _remoteOrigin);
|
1699 |
pub.up.incoming(_lastMsg.substring(_lastMsg.indexOf("_") + 1), _remoteOrigin);
|
1700 |
}
|
1701 |
|
1702 |
/**
|
1703 |
* Checks location.hash for a new message and relays this to the receiver.
|
1704 |
* @private
|
1705 |
*/
|
1706 |
function _pollHash(){
|
1707 |
if (!_listenerWindow) {
|
1708 |
return;
|
1709 |
}
|
1710 |
var href = _listenerWindow.location.href, hash = "", indexOf = href.indexOf("#");
|
1711 |
if (indexOf != -1) {
|
1712 |
hash = href.substring(indexOf);
|
1713 |
}
|
1714 |
if (hash && hash != _lastMsg) {
|
1715 |
trace("poll: new message");
|
1716 |
_handleHash(hash);
|
1717 |
}
|
1718 |
}
|
1719 |
|
1720 |
function _attachListeners(){
|
1721 |
trace("starting polling");
|
1722 |
_timer = setInterval(_pollHash, pollInterval);
|
1723 |
}
|
1724 |
|
1725 |
return (pub = {
|
1726 |
outgoing: function(message, domain){
|
1727 |
_sendMessage(message);
|
1728 |
},
|
1729 |
destroy: function(){
|
1730 |
window.clearInterval(_timer);
|
1731 |
if (isHost || !useParent) {
|
1732 |
_callerWindow.parentNode.removeChild(_callerWindow);
|
1733 |
}
|
1734 |
_callerWindow = null;
|
1735 |
},
|
1736 |
onDOMReady: function(){
|
1737 |
isHost = config.isHost;
|
1738 |
pollInterval = config.interval;
|
1739 |
_lastMsg = "#" + config.channel;
|
1740 |
_msgNr = 0;
|
1741 |
useParent = config.useParent;
|
1742 |
_remoteOrigin = getLocation(config.remote);
|
1743 |
if (isHost) {
|
1744 |
config.props = {
|
1745 |
src: config.remote,
|
1746 |
name: IFRAME_PREFIX + config.channel + "_provider"
|
1747 |
};
|
1748 |
if (useParent) {
|
1749 |
config.onLoad = function(){
|
1750 |
_listenerWindow = window;
|
1751 |
_attachListeners();
|
1752 |
pub.up.callback(true);
|
1753 |
};
|
1754 |
}
|
1755 |
else {
|
1756 |
var tries = 0, max = config.delay / 50;
|
1757 |
(function getRef(){
|
1758 |
if (++tries > max) {
|
1759 |
trace("unable to get reference to _listenerWindow, giving up");
|
1760 |
throw new Error("Unable to reference listenerwindow");
|
1761 |
}
|
1762 |
try {
|
1763 |
_listenerWindow = _callerWindow.contentWindow.frames[IFRAME_PREFIX + config.channel + "_consumer"];
|
1764 |
}
|
1765 |
catch (ex) {
|
1766 |
}
|
1767 |
if (_listenerWindow) {
|
1768 |
_attachListeners();
|
1769 |
trace("got a reference to _listenerWindow");
|
1770 |
pub.up.callback(true);
|
1771 |
}
|
1772 |
else {
|
1773 |
setTimeout(getRef, 50);
|
1774 |
}
|
1775 |
}());
|
1776 |
}
|
1777 |
_callerWindow = createFrame(config);
|
1778 |
}
|
1779 |
else {
|
1780 |
_listenerWindow = window;
|
1781 |
_attachListeners();
|
1782 |
if (useParent) {
|
1783 |
_callerWindow = parent;
|
1784 |
pub.up.callback(true);
|
1785 |
}
|
1786 |
else {
|
1787 |
apply(config, {
|
1788 |
props: {
|
1789 |
src: config.remote + "#" + config.channel + new Date(),
|
1790 |
name: IFRAME_PREFIX + config.channel + "_consumer"
|
1791 |
},
|
1792 |
onLoad: function(){
|
1793 |
pub.up.callback(true);
|
1794 |
}
|
1795 |
});
|
1796 |
_callerWindow = createFrame(config);
|
1797 |
}
|
1798 |
}
|
1799 |
},
|
1800 |
init: function(){
|
1801 |
whenReady(pub.onDOMReady, pub);
|
1802 |
}
|
1803 |
});
|
1804 |
* @class easyXDM.stack.ReliableBehavior
|
1805 |
* This is a behavior that tries to make the underlying transport reliable by using acknowledgements.
|
1806 |
* @namespace easyXDM.stack
|
1807 |
* @constructor
|
1808 |
* @param {Object} config The behaviors configuration.
|
1809 |
*/
|
1810 |
var trace = debug.getTracer("easyXDM.stack.ReliableBehavior");
|
1811 |
trace("constructor");
|
1812 |
var pub, // the public interface
|
1813 |
callback; // the callback to execute when we have a confirmed success/failure
|
1814 |
var idOut = 0, idIn = 0, currentMessage = "";
|
1815 |
|
1816 |
return (pub = {
|
1817 |
incoming: function(message, origin){
|
1818 |
trace("incoming: " + message);
|
1819 |
var indexOf = message.indexOf("_"), ack = message.substring(0, indexOf).split(",");
|
1820 |
message = message.substring(indexOf + 1);
|
1821 |
|
1822 |
if (ack[0] == idOut) {
|
1823 |
trace("message delivered");
|
1824 |
currentMessage = "";
|
1825 |
if (callback) {
|
1826 |
callback(true);
|
1827 |
}
|
1828 |
}
|
1829 |
if (message.length > 0) {
|
1830 |
trace("sending ack, and passing on " + message);
|
1831 |
pub.down.outgoing(ack[1] + "," + idOut + "_" + currentMessage, origin);
|
1832 |
if (idIn != ack[1]) {
|
1833 |
idIn = ack[1];
|
1834 |
pub.up.incoming(message, origin);
|
1835 |
}
|
1836 |
}
|
1837 |
|
1838 |
},
|
1839 |
outgoing: function(message, origin, fn){
|
1840 |
currentMessage = message;
|
1841 |
callback = fn;
|
1842 |
pub.down.outgoing(idIn + "," + (++idOut) + "_" + message, origin);
|
1843 |
}
|
1844 |
});
|
1845 |
* @class easyXDM.stack.QueueBehavior
|
1846 |
* This is a behavior that enables queueing of messages. <br/>
|
1847 |
* It will buffer incoming messages and dispach these as fast as the underlying transport allows.
|
1848 |
* This will also fragment/defragment messages so that the outgoing message is never bigger than the
|
1849 |
* set length.
|
1850 |
* @namespace easyXDM.stack
|
1851 |
* @constructor
|
1852 |
* @param {Object} config The behaviors configuration. Optional.
|
1853 |
* @cfg {Number} maxLength The maximum length of each outgoing message. Set this to enable fragmentation.
|
1854 |
*/
|
1855 |
var trace = debug.getTracer("easyXDM.stack.QueueBehavior");
|
1856 |
trace("constructor");
|
1857 |
var pub, queue = [], waiting = true, incoming = "", destroying, maxLength = 0, lazy = false, doFragment = false;
|
1858 |
|
1859 |
function dispatch(){
|
1860 |
if (config.remove && queue.length === 0) {
|
1861 |
trace("removing myself from the stack");
|
1862 |
removeFromStack(pub);
|
1863 |
return;
|
1864 |
}
|
1865 |
if (waiting || queue.length === 0 || destroying) {
|
1866 |
return;
|
1867 |
}
|
1868 |
trace("dispatching from queue");
|
1869 |
waiting = true;
|
1870 |
var message = queue.shift();
|
1871 |
|
1872 |
pub.down.outgoing(message.data, message.origin, function(success){
|
1873 |
waiting = false;
|
1874 |
if (message.callback) {
|
1875 |
setTimeout(function(){
|
1876 |
message.callback(success);
|
1877 |
}, 0);
|
1878 |
}
|
1879 |
dispatch();
|
1880 |
});
|
1881 |
}
|
1882 |
return (pub = {
|
1883 |
init: function(){
|
1884 |
if (undef(config)) {
|
1885 |
config = {};
|
1886 |
}
|
1887 |
if (config.maxLength) {
|
1888 |
maxLength = config.maxLength;
|
1889 |
doFragment = true;
|
1890 |
}
|
1891 |
if (config.lazy) {
|
1892 |
lazy = true;
|
1893 |
}
|
1894 |
else {
|
1895 |
pub.down.init();
|
1896 |
}
|
1897 |
},
|
1898 |
callback: function(success){
|
1899 |
waiting = false;
|
1900 |
var up = pub.up; // in case dispatch calls removeFromStack
|
1901 |
dispatch();
|
1902 |
up.callback(success);
|
1903 |
},
|
1904 |
incoming: function(message, origin){
|
1905 |
if (doFragment) {
|
1906 |
var indexOf = message.indexOf("_"), seq = parseInt(message.substring(0, indexOf), 10);
|
1907 |
incoming += message.substring(indexOf + 1);
|
1908 |
if (seq === 0) {
|
1909 |
trace("received the last fragment");
|
1910 |
if (config.encode) {
|
1911 |
incoming = decodeURIComponent(incoming);
|
1912 |
}
|
1913 |
pub.up.incoming(incoming, origin);
|
1914 |
incoming = "";
|
1915 |
}
|
1916 |
else {
|
1917 |
trace("waiting for more fragments, seq=" + message);
|
1918 |
}
|
1919 |
}
|
1920 |
else {
|
1921 |
pub.up.incoming(message, origin);
|
1922 |
}
|
1923 |
},
|
1924 |
outgoing: function(message, origin, fn){
|
1925 |
if (config.encode) {
|
1926 |
message = encodeURIComponent(message);
|
1927 |
}
|
1928 |
var fragments = [], fragment;
|
1929 |
if (doFragment) {
|
1930 |
// fragment into chunks
|
1931 |
while (message.length !== 0) {
|
1932 |
fragment = message.substring(0, maxLength);
|
1933 |
message = message.substring(fragment.length);
|
1934 |
fragments.push(fragment);
|
1935 |
}
|
1936 |
// enqueue the chunks
|
1937 |
while ((fragment = fragments.shift())) {
|
1938 |
trace("enqueuing");
|
1939 |
queue.push({
|
1940 |
data: fragments.length + "_" + fragment,
|
1941 |
origin: origin,
|
1942 |
callback: fragments.length === 0 ? fn : null
|
1943 |
});
|
1944 |
}
|
1945 |
}
|
1946 |
else {
|
1947 |
queue.push({
|
1948 |
data: message,
|
1949 |
origin: origin,
|
1950 |
callback: fn
|
1951 |
});
|
1952 |
}
|
1953 |
if (lazy) {
|
1954 |
pub.down.init();
|
1955 |
}
|
1956 |
else {
|
1957 |
dispatch();
|
1958 |
}
|
1959 |
},
|
1960 |
destroy: function(){
|
1961 |
trace("destroy");
|
1962 |
destroying = true;
|
1963 |
pub.down.destroy();
|
1964 |
}
|
1965 |
});
|
1966 |
* @class easyXDM.stack.VerifyBehavior
|
1967 |
* This behavior will verify that communication with the remote end is possible, and will also sign all outgoing,
|
1968 |
* and verify all incoming messages. This removes the risk of someone hijacking the iframe to send malicious messages.
|
1969 |
* @namespace easyXDM.stack
|
1970 |
* @constructor
|
1971 |
* @param {Object} config The behaviors configuration.
|
1972 |
* @cfg {Boolean} initiate If the verification should be initiated from this end.
|
1973 |
*/
|
1974 |
var trace = debug.getTracer("easyXDM.stack.VerifyBehavior");
|
1975 |
trace("constructor");
|
1976 |
if (undef(config.initiate)) {
|
1977 |
throw new Error("settings.initiate is not set");
|
1978 |
}
|
1979 |
var pub, mySecret, theirSecret, verified = false;
|
1980 |
|
1981 |
function startVerification(){
|
1982 |
trace("requesting verification");
|
1983 |
mySecret = Math.random().toString(16).substring(2);
|
1984 |
pub.down.outgoing(mySecret);
|
1985 |
}
|
1986 |
|
1987 |
return (pub = {
|
1988 |
incoming: function(message, origin){
|
1989 |
var indexOf = message.indexOf("_");
|
1990 |
if (indexOf === -1) {
|
1991 |
if (message === mySecret) {
|
1992 |
trace("verified, calling callback");
|
1993 |
pub.up.callback(true);
|
1994 |
}
|
1995 |
else if (!theirSecret) {
|
1996 |
trace("returning secret");
|
1997 |
theirSecret = message;
|
1998 |
if (!config.initiate) {
|
1999 |
startVerification();
|
2000 |
}
|
2001 |
pub.down.outgoing(message);
|
2002 |
}
|
2003 |
}
|
2004 |
else {
|
2005 |
if (message.substring(0, indexOf) === theirSecret) {
|
2006 |
pub.up.incoming(message.substring(indexOf + 1), origin);
|
2007 |
}
|
2008 |
}
|
2009 |
},
|
2010 |
outgoing: function(message, origin, fn){
|
2011 |
pub.down.outgoing(mySecret + "_" + message, origin, fn);
|
2012 |
},
|
2013 |
callback: function(success){
|
2014 |
if (config.initiate) {
|
2015 |
startVerification();
|
2016 |
}
|
2017 |
}
|
2018 |
});
|
2019 |
* @class easyXDM.stack.RpcBehavior
|
2020 |
* This uses JSON-RPC 2.0 to expose local methods and to invoke remote methods and have responses returned over the the string based transport stack.<br/>
|
2021 |
* Exposed methods can return values synchronous, asyncronous, or bet set up to not return anything.
|
2022 |
* @namespace easyXDM.stack
|
2023 |
* @constructor
|
2024 |
* @param {Object} proxy The object to apply the methods to.
|
2025 |
* @param {Object} config The definition of the local and remote interface to implement.
|
2026 |
* @cfg {Object} local The local interface to expose.
|
2027 |
* @cfg {Object} remote The remote methods to expose through the proxy.
|
2028 |
* @cfg {Object} serializer The serializer to use for serializing and deserializing the JSON. Should be compatible with the HTML5 JSON object. Optional, will default to JSON.
|
2029 |
*/
|
2030 |
var trace = debug.getTracer("easyXDM.stack.RpcBehavior");
|
2031 |
var pub, serializer = config.serializer || getJSON();
|
2032 |
var _callbackCounter = 0, _callbacks = {};
|
2033 |
|
2034 |
/**
|
2035 |
* Serializes and sends the message
|
2036 |
* @private
|
2037 |
* @param {Object} data The JSON-RPC message to be sent. The jsonrpc property will be added.
|
2038 |
*/
|
2039 |
function _send(data){
|
2040 |
data.jsonrpc = "2.0";
|
2041 |
pub.down.outgoing(serializer.stringify(data));
|
2042 |
}
|
2043 |
|
2044 |
/**
|
2045 |
* Creates a method that implements the given definition
|
2046 |
* @private
|
2047 |
* @param {Object} The method configuration
|
2048 |
* @param {String} method The name of the method
|
2049 |
* @return {Function} A stub capable of proxying the requested method call
|
2050 |
*/
|
2051 |
function _createMethod(definition, method){
|
2052 |
var slice = Array.prototype.slice;
|
2053 |
|
2054 |
trace("creating method " + method);
|
2055 |
return function(){
|
2056 |
trace("executing method " + method);
|
2057 |
var l = arguments.length, callback, message = {
|
2058 |
method: method
|
2059 |
};
|
2060 |
|
2061 |
if (l > 0 && typeof arguments[l - 1] === "function") {
|
2062 |
//with callback, procedure
|
2063 |
if (l > 1 && typeof arguments[l - 2] === "function") {
|
2064 |
// two callbacks, success and error
|
2065 |
callback = {
|
2066 |
success: arguments[l - 2],
|
2067 |
error: arguments[l - 1]
|
2068 |
};
|
2069 |
message.params = slice.call(arguments, 0, l - 2);
|
2070 |
}
|
2071 |
else {
|
2072 |
// single callback, success
|
2073 |
callback = {
|
2074 |
success: arguments[l - 1]
|
2075 |
};
|
2076 |
message.params = slice.call(arguments, 0, l - 1);
|
2077 |
}
|
2078 |
_callbacks["" + (++_callbackCounter)] = callback;
|
2079 |
message.id = _callbackCounter;
|
2080 |
}
|
2081 |
else {
|
2082 |
// no callbacks, a notification
|
2083 |
message.params = slice.call(arguments, 0);
|
2084 |
}
|
2085 |
if (definition.namedParams && message.params.length === 1) {
|
2086 |
message.params = message.params[0];
|
2087 |
}
|
2088 |
// Send the method request
|
2089 |
_send(message);
|
2090 |
};
|
2091 |
}
|
2092 |
|
2093 |
/**
|
2094 |
* Executes the exposed method
|
2095 |
* @private
|
2096 |
* @param {String} method The name of the method
|
2097 |
* @param {Number} id The callback id to use
|
2098 |
* @param {Function} method The exposed implementation
|
2099 |
* @param {Array} params The parameters supplied by the remote end
|
2100 |
*/
|
2101 |
function _executeMethod(method, id, fn, params){
|
2102 |
if (!fn) {
|
2103 |
trace("requested to execute non-existent procedure " + method);
|
2104 |
if (id) {
|
2105 |
_send({
|
2106 |
id: id,
|
2107 |
error: {
|
2108 |
code: -32601,
|
2109 |
message: "Procedure not found."
|
2110 |
}
|
2111 |
});
|
2112 |
}
|
2113 |
return;
|
2114 |
}
|
2115 |
|
2116 |
trace("requested to execute procedure " + method);
|
2117 |
var success, error;
|
2118 |
if (id) {
|
2119 |
success = function(result){
|
2120 |
success = emptyFn;
|
2121 |
_send({
|
2122 |
id: id,
|
2123 |
result: result
|
2124 |
});
|
2125 |
};
|
2126 |
error = function(message, data){
|
2127 |
error = emptyFn;
|
2128 |
var msg = {
|
2129 |
id: id,
|
2130 |
error: {
|
2131 |
code: -32099,
|
2132 |
message: message
|
2133 |
}
|
2134 |
};
|
2135 |
if (data) {
|
2136 |
msg.error.data = data;
|
2137 |
}
|
2138 |
_send(msg);
|
2139 |
};
|
2140 |
}
|
2141 |
else {
|
2142 |
success = error = emptyFn;
|
2143 |
}
|
2144 |
// Call local method
|
2145 |
if (!isArray(params)) {
|
2146 |
params = [params];
|
2147 |
}
|
2148 |
try {
|
2149 |
var result = fn.method.apply(fn.scope, params.concat([success, error]));
|
2150 |
if (!undef(result)) {
|
2151 |
success(result);
|
2152 |
}
|
2153 |
}
|
2154 |
catch (ex1) {
|
2155 |
error(ex1.message);
|
2156 |
}
|
2157 |
}
|
2158 |
|
2159 |
return (pub = {
|
2160 |
incoming: function(message, origin){
|
2161 |
var data = serializer.parse(message);
|
2162 |
if (data.method) {
|
2163 |
trace("received request to execute method " + data.method + (data.id ? (" using callback id " + data.id) : ""));
|
2164 |
// A method call from the remote end
|
2165 |
if (config.handle) {
|
2166 |
config.handle(data, _send);
|
2167 |
}
|
2168 |
else {
|
2169 |
_executeMethod(data.method, data.id, config.local[data.method], data.params);
|
2170 |
}
|
2171 |
}
|
2172 |
else {
|
2173 |
trace("received return value destined to callback with id " + data.id);
|
2174 |
// A method response from the other end
|
2175 |
var callback = _callbacks[data.id];
|
2176 |
if (data.error) {
|
2177 |
if (callback.error) {
|
2178 |
callback.error(data.error);
|
2179 |
}
|
2180 |
else {
|
2181 |
trace("unhandled error returned.");
|
2182 |
}
|
2183 |
}
|
2184 |
else if (callback.success) {
|
2185 |
callback.success(data.result);
|
2186 |
}
|
2187 |
delete _callbacks[data.id];
|
2188 |
}
|
2189 |
},
|
2190 |
init: function(){
|
2191 |
trace("init");
|
2192 |
if (config.remote) {
|
2193 |
trace("creating stubs");
|
2194 |
// Implement the remote sides exposed methods
|
2195 |
for (var method in config.remote) {
|
2196 |
if (config.remote.hasOwnProperty(method)) {
|
2197 |
proxy[method] = _createMethod(config.remote[method], method);
|
2198 |
}
|
2199 |
}
|
2200 |
}
|
2201 |
pub.down.init();
|
2202 |
},
|
2203 |
destroy: function(){
|
2204 |
trace("destroy");
|
2205 |
for (var method in config.remote) {
|
2206 |
if (config.remote.hasOwnProperty(method) && proxy.hasOwnProperty(method)) {
|
2207 |
delete proxy[method];
|
2208 |
}
|
2209 |
}
|
2210 |
pub.down.destroy();
|
2211 |
}
|
2212 |
});
|
1 |
+
/**
|
2 |
* easyXDM
|
3 |
* http://easyxdm.net/
|
4 |
* Copyright(c) 2009-2011, Øyvind Sean Kinsey, oyvind@kinsey.no.
|
5 |
*
|
6 |
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 |
* of this software and associated documentation files (the "Software"), to deal
|
8 |
* in the Software without restriction, including without limitation the rights
|
9 |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10 |
* copies of the Software, and to permit persons to whom the Software is
|
11 |
* furnished to do so, subject to the following conditions:
|
12 |
*
|
13 |
* The above copyright notice and this permission notice shall be included in
|
14 |
* all copies or substantial portions of the Software.
|
15 |
*
|
16 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19 |
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21 |
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22 |
* THE SOFTWARE.
|
23 |
*/
|
24 |
var t = typeof object[property];
|
25 |
return t == 'function' ||
|
26 |
(!!(t == 'object' && object[property])) ||
|
27 |
t == 'unknown';
|
28 |
return !!(typeof(object[property]) == 'object' && object[property]);
|
29 |
return Object.prototype.toString.call(o) === '[object Array]';
|
30 |
try {
|
31 |
var activeX = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
|
32 |
flashVersion = Array.prototype.slice.call(activeX.GetVariable("$version").match(/(\d+),(\d+),(\d+),(\d+)/), 1);
|
33 |
HAS_FLASH_THROTTLED_BUG = parseInt(flashVersion[0], 10) > 9 && parseInt(flashVersion[1], 10) > 0;
|
34 |
activeX = null;
|
35 |
return true;
|
36 |
}
|
37 |
catch (notSupportedException) {
|
38 |
return false;
|
39 |
}
|
40 |
* Cross Browser implementation for adding and removing event listeners.
|
41 |
*/
|
42 |
on = function(target, type, listener){
|
43 |
_trace("adding listener " + type);
|
44 |
target.addEventListener(type, listener, false);
|
45 |
};
|
46 |
un = function(target, type, listener){
|
47 |
_trace("removing listener " + type);
|
48 |
target.removeEventListener(type, listener, false);
|
49 |
};
|
50 |
on = function(object, sEvent, fpNotify){
|
51 |
_trace("adding listener " + sEvent);
|
52 |
object.attachEvent("on" + sEvent, fpNotify);
|
53 |
};
|
54 |
un = function(object, sEvent, fpNotify){
|
55 |
_trace("removing listener " + sEvent);
|
56 |
object.detachEvent("on" + sEvent, fpNotify);
|
57 |
};
|
58 |
throw new Error("Browser not supported");
|
59 |
* Cross Browser implementation of DOMContentLoaded.
|
60 |
*/
|
61 |
// If browser is WebKit-powered, check for both 'loaded' (legacy browsers) and
|
62 |
// 'interactive' (HTML5 specs, recent WebKit builds) states.
|
63 |
// https://bugs.webkit.org/show_bug.cgi?id=45119
|
64 |
readyState = document.readyState;
|
65 |
domIsReady = readyState == "complete" || (~ navigator.userAgent.indexOf('AppleWebKit/') && (readyState == "loaded" || readyState == "interactive"));
|
66 |
// If readyState is not supported in the browser, then in order to be able to fire whenReady functions apropriately
|
67 |
// when added dynamically _after_ DOM load, we have to deduce wether the DOM is ready or not.
|
68 |
// We only need a body to add elements to, so the existence of document.body is enough for us.
|
69 |
domIsReady = !!document.body;
|
70 |
if (domIsReady) {
|
71 |
return;
|
72 |
}
|
73 |
domIsReady = true;
|
74 |
_trace("firing dom_onReady");
|
75 |
for (var i = 0; i < domReadyQueue.length; i++) {
|
76 |
domReadyQueue[i]();
|
77 |
}
|
78 |
domReadyQueue.length = 0;
|
79 |
if (isHostMethod(window, "addEventListener")) {
|
80 |
on(document, "DOMContentLoaded", dom_onReady);
|
81 |
}
|
82 |
else {
|
83 |
on(document, "readystatechange", function(){
|
84 |
if (document.readyState == "complete") {
|
85 |
dom_onReady();
|
86 |
}
|
87 |
});
|
88 |
if (document.documentElement.doScroll && window === top) {
|
89 |
var doScrollCheck = function(){
|
90 |
if (domIsReady) {
|
91 |
return;
|
92 |
}
|
93 |
// http://javascript.nwbox.com/IEContentLoaded/
|
94 |
try {
|
95 |
document.documentElement.doScroll("left");
|
96 |
}
|
97 |
catch (e) {
|
98 |
setTimeout(doScrollCheck, 1);
|
99 |
return;
|
100 |
}
|
101 |
dom_onReady();
|
102 |
};
|
103 |
doScrollCheck();
|
104 |
}
|
105 |
}
|
106 |
|
107 |
// A fallback to window.onload, that will always work
|
108 |
on(window, "load", dom_onReady);
|
109 |
* This will add a function to the queue of functions to be run once the DOM reaches a ready state.
|
110 |
* If functions are added after this event then they will be executed immediately.
|
111 |
* @param {function} fn The function to add
|
112 |
* @param {Object} scope An optional scope for the function to be called with.
|
113 |
*/
|
114 |
if (domIsReady) {
|
115 |
fn.call(scope);
|
116 |
return;
|
117 |
}
|
118 |
domReadyQueue.push(function(){
|
119 |
fn.call(scope);
|
120 |
});
|
121 |
* Returns an instance of easyXDM from the parent window with
|
122 |
* respect to the namespace.
|
123 |
*
|
124 |
* @return An instance of easyXDM (in the parent window)
|
125 |
*/
|
126 |
var obj = parent;
|
127 |
if (namespace !== "") {
|
128 |
for (var i = 0, ii = namespace.split("."); i < ii.length; i++) {
|
129 |
if (!obj) {
|
130 |
throw new Error(ii.slice(0, i + 1).join('.') + ' is not an object');
|
131 |
}
|
132 |
obj = obj[ii[i]];
|
133 |
}
|
134 |
}
|
135 |
if (!obj || !obj.easyXDM) {
|
136 |
throw new Error('Could not find easyXDM in parent.' + namespace);
|
137 |
}
|
138 |
return obj.easyXDM;
|
139 |
* Removes easyXDM variable from the global scope. It also returns control
|
140 |
* of the easyXDM variable to whatever code used it before.
|
141 |
*
|
142 |
* @param {String} ns A string representation of an object that will hold
|
143 |
* an instance of easyXDM.
|
144 |
* @return An instance of easyXDM
|
145 |
*/
|
146 |
if (typeof ns != "string" || !ns) {
|
147 |
throw new Error('namespace must be a non-empty string');
|
148 |
}
|
149 |
_trace("Settings namespace to '" + ns + "'");
|
150 |
|
151 |
window.easyXDM = _easyXDM;
|
152 |
namespace = ns;
|
153 |
if (namespace) {
|
154 |
IFRAME_PREFIX = "easyXDM_" + namespace.replace(".", "_") + "_";
|
155 |
}
|
156 |
return easyXDM;
|
157 |
* Methods for working with URLs
|
158 |
*/
|
159 |
* Get the domain name from a url.
|
160 |
* @param {String} url The url to extract the domain from.
|
161 |
* @return The domain part of the url.
|
162 |
* @type {String}
|
163 |
*/
|
164 |
if (!url) {
|
165 |
throw new Error("url is undefined or empty");
|
166 |
}
|
167 |
return url.match(reURI)[3];
|
168 |
* Get the port for a given URL, or "" if none
|
169 |
* @param {String} url The url to extract the port from.
|
170 |
* @return The port part of the url.
|
171 |
* @type {String}
|
172 |
*/
|
173 |
if (!url) {
|
174 |
throw new Error("url is undefined or empty");
|
175 |
}
|
176 |
return url.match(reURI)[4] || "";
|
177 |
* Returns a string containing the schema, domain and if present the port
|
178 |
* @param {String} url The url to extract the location from
|
179 |
* @return {String} The location part of the url
|
180 |
*/
|
181 |
if (!url) {
|
182 |
throw new Error("url is undefined or empty");
|
183 |
}
|
184 |
if (/^file/.test(url)) {
|
185 |
throw new Error("The file:// protocol is not supported");
|
186 |
}
|
187 |
var m = url.toLowerCase().match(reURI);
|
188 |
var proto = m[2], domain = m[3], port = m[4] || "";
|
189 |
if ((proto == "http:" && port == ":80") || (proto == "https:" && port == ":443")) {
|
190 |
port = "";
|
191 |
}
|
192 |
return proto + "//" + domain + port;
|
193 |
* Resolves a relative url into an absolute one.
|
194 |
* @param {String} url The path to resolve.
|
195 |
* @return {String} The resolved url.
|
196 |
*/
|
197 |
if (!url) {
|
198 |
throw new Error("url is undefined or empty");
|
199 |
}
|
200 |
|
201 |
// replace all // except the one in proto with /
|
202 |
url = url.replace(reDoubleSlash, "$1/");
|
203 |
|
204 |
// If the url is a valid url we do nothing
|
205 |
if (!url.match(/^(http||https):\/\//)) {
|
206 |
// If this is a relative path
|
207 |
var path = (url.substring(0, 1) === "/") ? "" : location.pathname;
|
208 |
if (path.substring(path.length - 1) !== "/") {
|
209 |
path = path.substring(0, path.lastIndexOf("/") + 1);
|
210 |
}
|
211 |
|
212 |
url = location.protocol + "//" + location.host + path + url;
|
213 |
}
|
214 |
|
215 |
// reduce all 'xyz/../' to just ''
|
216 |
while (reParent.test(url)) {
|
217 |
url = url.replace(reParent, "");
|
218 |
}
|
219 |
|
220 |
_trace("resolved url '" + url + "'");
|
221 |
return url;
|
222 |
* Appends the parameters to the given url.<br/>
|
223 |
* The base url can contain existing query parameters.
|
224 |
* @param {String} url The base url.
|
225 |
* @param {Object} parameters The parameters to add.
|
226 |
* @return {String} A new valid url with the parameters appended.
|
227 |
*/
|
228 |
if (!parameters) {
|
229 |
throw new Error("parameters is undefined or null");
|
230 |
}
|
231 |
|
232 |
var hash = "", indexOf = url.indexOf("#");
|
233 |
if (indexOf !== -1) {
|
234 |
hash = url.substring(indexOf);
|
235 |
url = url.substring(0, indexOf);
|
236 |
}
|
237 |
var q = [];
|
238 |
for (var key in parameters) {
|
239 |
if (parameters.hasOwnProperty(key)) {
|
240 |
q.push(key + "=" + encodeURIComponent(parameters[key]));
|
241 |
}
|
242 |
}
|
243 |
return url + (useHash ? "#" : (url.indexOf("?") == -1 ? "?" : "&")) + q.join("&") + hash;
|
244 |
input = input.substring(1).split("&");
|
245 |
var data = {}, pair, i = input.length;
|
246 |
while (i--) {
|
247 |
pair = input[i].split("=");
|
248 |
data[pair[0]] = decodeURIComponent(pair[1]);
|
249 |
}
|
250 |
return data;
|
251 |
* Helper methods
|
252 |
*/
|
253 |
* Helper for checking if a variable/property is undefined
|
254 |
* @param {Object} v The variable to test
|
255 |
* @return {Boolean} True if the passed variable is undefined
|
256 |
*/
|
257 |
return typeof v === "undefined";
|
258 |
* A safe implementation of HTML5 JSON. Feature testing is used to make sure the implementation works.
|
259 |
* @return {JSON} A valid JSON conforming object, or null if not found.
|
260 |
*/
|
261 |
var cached = {};
|
262 |
var obj = {
|
263 |
a: [1, 2, 3]
|
264 |
}, json = "{\"a\":[1,2,3]}";
|
265 |
|
266 |
if (typeof JSON != "undefined" && typeof JSON.stringify === "function" && JSON.stringify(obj).replace((/\s/g), "") === json) {
|
267 |
// this is a working JSON instance
|
268 |
return JSON;
|
269 |
}
|
270 |
if (Object.toJSON) {
|
271 |
if (Object.toJSON(obj).replace((/\s/g), "") === json) {
|
272 |
// this is a working stringify method
|
273 |
cached.stringify = Object.toJSON;
|
274 |
}
|
275 |
}
|
276 |
|
277 |
if (typeof String.prototype.evalJSON === "function") {
|
278 |
obj = json.evalJSON();
|
279 |
if (obj.a && obj.a.length === 3 && obj.a[2] === 3) {
|
280 |
// this is a working parse method
|
281 |
cached.parse = function(str){
|
282 |
return str.evalJSON();
|
283 |
};
|
284 |
}
|
285 |
}
|
286 |
|
287 |
if (cached.stringify && cached.parse) {
|
288 |
// Only memoize the result if we have valid instance
|
289 |
getJSON = function(){
|
290 |
return cached;
|
291 |
};
|
292 |
return cached;
|
293 |
}
|
294 |
return null;
|
295 |
* Applies properties from the source object to the target object.<br/>
|
296 |
* @param {Object} target The target of the properties.
|
297 |
* @param {Object} source The source of the properties.
|
298 |
* @param {Boolean} noOverwrite Set to True to only set non-existing properties.
|
299 |
*/
|
300 |
var member;
|
301 |
for (var prop in source) {
|
302 |
if (source.hasOwnProperty(prop)) {
|
303 |
if (prop in destination) {
|
304 |
member = source[prop];
|
305 |
if (typeof member === "object") {
|
306 |
apply(destination[prop], member, noOverwrite);
|
307 |
}
|
308 |
else if (!noOverwrite) {
|
309 |
destination[prop] = source[prop];
|
310 |
}
|
311 |
}
|
312 |
else {
|
313 |
destination[prop] = source[prop];
|
314 |
}
|
315 |
}
|
316 |
}
|
317 |
return destination;
|
318 |
var form = document.body.appendChild(document.createElement("form")), input = form.appendChild(document.createElement("input"));
|
319 |
input.name = IFRAME_PREFIX + "TEST" + channelId; // append channelId in order to avoid caching issues
|
320 |
HAS_NAME_PROPERTY_BUG = input !== form.elements[input.name];
|
321 |
document.body.removeChild(form);
|
322 |
_trace("HAS_NAME_PROPERTY_BUG: " + HAS_NAME_PROPERTY_BUG);
|
323 |
* Creates a frame and appends it to the DOM.
|
324 |
* @param config {object} This object can have the following properties
|
325 |
* <ul>
|
326 |
* <li> {object} prop The properties that should be set on the frame. This should include the 'src' property.</li>
|
327 |
* <li> {object} attr The attributes that should be set on the frame.</li>
|
328 |
* <li> {DOMElement} container Its parent element (Optional).</li>
|
329 |
* <li> {function} onLoad A method that should be called with the frames contentWindow as argument when the frame is fully loaded. (Optional)</li>
|
330 |
* </ul>
|
331 |
* @return The frames DOMElement
|
332 |
* @type DOMElement
|
333 |
*/
|
334 |
_trace("creating frame: " + config.props.src);
|
335 |
if (undef(HAS_NAME_PROPERTY_BUG)) {
|
336 |
testForNamePropertyBug();
|
337 |
}
|
338 |
var frame;
|
339 |
// This is to work around the problems in IE6/7 with setting the name property.
|
340 |
// Internally this is set as 'submitName' instead when using 'iframe.name = ...'
|
341 |
// This is not required by easyXDM itself, but is to facilitate other use cases
|
342 |
if (HAS_NAME_PROPERTY_BUG) {
|
343 |
frame = document.createElement("<iframe name=\"" + config.props.name + "\"/>");
|
344 |
}
|
345 |
else {
|
346 |
frame = document.createElement("IFRAME");
|
347 |
frame.name = config.props.name;
|
348 |
}
|
349 |
|
350 |
frame.id = frame.name = config.props.name;
|
351 |
delete config.props.name;
|
352 |
|
353 |
if (config.onLoad) {
|
354 |
on(frame, "load", config.onLoad);
|
355 |
}
|
356 |
|
357 |
if (typeof config.container == "string") {
|
358 |
config.container = document.getElementById(config.container);
|
359 |
}
|
360 |
|
361 |
if (!config.container) {
|
362 |
// This needs to be hidden like this, simply setting display:none and the like will cause failures in some browsers.
|
363 |
apply(frame.style, {
|
364 |
position: "absolute",
|
365 |
top: "-2000px"
|
366 |
});
|
367 |
config.container = document.body;
|
368 |
}
|
369 |
|
370 |
// HACK for some reason, IE needs the source set
|
371 |
// after the frame has been appended into the DOM
|
372 |
// so remove the src, and set it afterwards
|
373 |
var src = config.props.src;
|
374 |
delete config.props.src;
|
375 |
|
376 |
// transfer properties to the frame
|
377 |
apply(frame, config.props);
|
378 |
|
379 |
frame.border = frame.frameBorder = 0;
|
380 |
frame.allowTransparency = true;
|
381 |
config.container.appendChild(frame);
|
382 |
|
383 |
// HACK see above
|
384 |
frame.src = src;
|
385 |
config.props.src = src;
|
386 |
|
387 |
return frame;
|
388 |
* Check whether a domain is allowed using an Access Control List.
|
389 |
* The ACL can contain * and ? as wildcards, or can be regular expressions.
|
390 |
* If regular expressions they need to begin with ^ and end with $.
|
391 |
* @param {Array/String} acl The list of allowed domains
|
392 |
* @param {String} domain The domain to test.
|
393 |
* @return {Boolean} True if the domain is allowed, false if not.
|
394 |
*/
|
395 |
// normalize into an array
|
396 |
if (typeof acl == "string") {
|
397 |
acl = [acl];
|
398 |
}
|
399 |
var re, i = acl.length;
|
400 |
while (i--) {
|
401 |
re = acl[i];
|
402 |
re = new RegExp(re.substr(0, 1) == "^" ? re : ("^" + re.replace(/(\*)/g, ".$1").replace(/\?/g, ".") + "$"));
|
403 |
if (re.test(domain)) {
|
404 |
return true;
|
405 |
}
|
406 |
}
|
407 |
return false;
|
408 |
* Functions related to stacks
|
409 |
*/
|
410 |
* Prepares an array of stack-elements suitable for the current configuration
|
411 |
* @param {Object} config The Transports configuration. See easyXDM.Socket for more.
|
412 |
* @return {Array} An array of stack-elements with the TransportElement at index 0.
|
413 |
*/
|
414 |
var protocol = config.protocol, stackEls;
|
415 |
config.isHost = config.isHost || undef(query.xdm_p);
|
416 |
useHash = config.hash || false;
|
417 |
_trace("preparing transport stack");
|
418 |
|
419 |
if (!config.props) {
|
420 |
config.props = {};
|
421 |
}
|
422 |
if (!config.isHost) {
|
423 |
_trace("using parameters from query");
|
424 |
config.channel = query.xdm_c;
|
425 |
config.secret = query.xdm_s;
|
426 |
config.remote = query.xdm_e;
|
427 |
protocol = query.xdm_p;
|
428 |
if (config.acl && !checkAcl(config.acl, config.remote)) {
|
429 |
throw new Error("Access denied for " + config.remote);
|
430 |
}
|
431 |
}
|
432 |
else {
|
433 |
config.remote = resolveUrl(config.remote);
|
434 |
config.channel = config.channel || "default" + channelId++;
|
435 |
config.secret = Math.random().toString(16).substring(2);
|
436 |
if (undef(protocol)) {
|
437 |
if (getLocation(location.href) == getLocation(config.remote)) {
|
438 |
/*
|
439 |
* Both documents has the same origin, lets use direct access.
|
440 |
*/
|
441 |
protocol = "4";
|
442 |
}
|
443 |
else if (isHostMethod(window, "postMessage") || isHostMethod(document, "postMessage")) {
|
444 |
/*
|
445 |
* This is supported in IE8+, Firefox 3+, Opera 9+, Chrome 2+ and Safari 4+
|
446 |
*/
|
447 |
protocol = "1";
|
448 |
}
|
449 |
else if (config.swf && isHostMethod(window, "ActiveXObject") && hasFlash()) {
|
450 |
/*
|
451 |
* The Flash transport superseedes the NixTransport as the NixTransport has been blocked by MS
|
452 |
*/
|
453 |
protocol = "6";
|
454 |
}
|
455 |
else if (navigator.product === "Gecko" && "frameElement" in window && navigator.userAgent.indexOf('WebKit') == -1) {
|
456 |
/*
|
457 |
* This is supported in Gecko (Firefox 1+)
|
458 |
*/
|
459 |
protocol = "5";
|
460 |
}
|
461 |
else if (config.remoteHelper) {
|
462 |
/*
|
463 |
* This is supported in all browsers that retains the value of window.name when
|
464 |
* navigating from one domain to another, and where parent.frames[foo] can be used
|
465 |
* to get access to a frame from the same domain
|
466 |
*/
|
467 |
config.remoteHelper = resolveUrl(config.remoteHelper);
|
468 |
protocol = "2";
|
469 |
}
|
470 |
else {
|
471 |
/*
|
472 |
* This is supported in all browsers where [window].location is writable for all
|
473 |
* The resize event will be used if resize is supported and the iframe is not put
|
474 |
* into a container, else polling will be used.
|
475 |
*/
|
476 |
protocol = "0";
|
477 |
}
|
478 |
_trace("selecting protocol: " + protocol);
|
479 |
}
|
480 |
else {
|
481 |
_trace("using protocol: " + protocol);
|
482 |
}
|
483 |
}
|
484 |
config.protocol = protocol; // for conditional branching
|
485 |
switch (protocol) {
|
486 |
case "0":// 0 = HashTransport
|
487 |
apply(config, {
|
488 |
interval: 100,
|
489 |
delay: 2000,
|
490 |
useResize: true,
|
491 |
useParent: false,
|
492 |
usePolling: false
|
493 |
}, true);
|
494 |
if (config.isHost) {
|
495 |
if (!config.local) {
|
496 |
_trace("looking for image to use as local");
|
497 |
// If no local is set then we need to find an image hosted on the current domain
|
498 |
var domain = location.protocol + "//" + location.host, images = document.body.getElementsByTagName("img"), image;
|
499 |
var i = images.length;
|
500 |
while (i--) {
|
501 |
image = images[i];
|
502 |
if (image.src.substring(0, domain.length) === domain) {
|
503 |
config.local = image.src;
|
504 |
break;
|
505 |
}
|
506 |
}
|
507 |
if (!config.local) {
|
508 |
_trace("no image found, defaulting to using the window");
|
509 |
// If no local was set, and we are unable to find a suitable file, then we resort to using the current window
|
510 |
config.local = window;
|
511 |
}
|
512 |
}
|
513 |
|
514 |
var parameters = {
|
515 |
xdm_c: config.channel,
|
516 |
xdm_p: 0
|
517 |
};
|
518 |
|
519 |
if (config.local === window) {
|
520 |
// We are using the current window to listen to
|
521 |
config.usePolling = true;
|
522 |
config.useParent = true;
|
523 |
config.local = location.protocol + "//" + location.host + location.pathname + location.search;
|
524 |
parameters.xdm_e = config.local;
|
525 |
parameters.xdm_pa = 1; // use parent
|
526 |
}
|
527 |
else {
|
528 |
parameters.xdm_e = resolveUrl(config.local);
|
529 |
}
|
530 |
|
531 |
if (config.container) {
|
532 |
config.useResize = false;
|
533 |
parameters.xdm_po = 1; // use polling
|
534 |
}
|
535 |
config.remote = appendQueryParameters(config.remote, parameters);
|
536 |
}
|
537 |
else {
|
538 |
apply(config, {
|
539 |
channel: query.xdm_c,
|
540 |
remote: query.xdm_e,
|
541 |
useParent: !undef(query.xdm_pa),
|
542 |
usePolling: !undef(query.xdm_po),
|
543 |
useResize: config.useParent ? false : config.useResize
|
544 |
});
|
545 |
}
|
546 |
stackEls = [new easyXDM.stack.HashTransport(config), new easyXDM.stack.ReliableBehavior({}), new easyXDM.stack.QueueBehavior({
|
547 |
encode: true,
|
548 |
maxLength: 4000 - config.remote.length
|
549 |
}), new easyXDM.stack.VerifyBehavior({
|
550 |
initiate: config.isHost
|
551 |
})];
|
552 |
break;
|
553 |
case "1":
|
554 |
stackEls = [new easyXDM.stack.PostMessageTransport(config)];
|
555 |
break;
|
556 |
case "2":
|
557 |
stackEls = [new easyXDM.stack.NameTransport(config), new easyXDM.stack.QueueBehavior(), new easyXDM.stack.VerifyBehavior({
|
558 |
initiate: config.isHost
|
559 |
})];
|
560 |
break;
|
561 |
case "3":
|
562 |
stackEls = [new easyXDM.stack.NixTransport(config)];
|
563 |
break;
|
564 |
case "4":
|
565 |
stackEls = [new easyXDM.stack.SameOriginTransport(config)];
|
566 |
break;
|
567 |
case "5":
|
568 |
stackEls = [new easyXDM.stack.FrameElementTransport(config)];
|
569 |
break;
|
570 |
case "6":
|
571 |
if (!flashVersion) {
|
572 |
hasFlash();
|
573 |
}
|
574 |
stackEls = [new easyXDM.stack.FlashTransport(config)];
|
575 |
break;
|
576 |
}
|
577 |
// this behavior is responsible for buffering outgoing messages, and for performing lazy initialization
|
578 |
stackEls.push(new easyXDM.stack.QueueBehavior({
|
579 |
lazy: config.lazy,
|
580 |
remove: true
|
581 |
}));
|
582 |
return stackEls;
|
583 |
* Chains all the separate stack elements into a single usable stack.<br/>
|
584 |
* If an element is missing a necessary method then it will have a pass-through method applied.
|
585 |
* @param {Array} stackElements An array of stack elements to be linked.
|
586 |
* @return {easyXDM.stack.StackElement} The last element in the chain.
|
587 |
*/
|
588 |
var stackEl, defaults = {
|
589 |
incoming: function(message, origin){
|
590 |
this.up.incoming(message, origin);
|
591 |
},
|
592 |
outgoing: function(message, recipient){
|
593 |
this.down.outgoing(message, recipient);
|
594 |
},
|
595 |
callback: function(success){
|
596 |
this.up.callback(success);
|
597 |
},
|
598 |
init: function(){
|
599 |
this.down.init();
|
600 |
},
|
601 |
destroy: function(){
|
602 |
this.down.destroy();
|
603 |
}
|
604 |
};
|
605 |
for (var i = 0, len = stackElements.length; i < len; i++) {
|
606 |
stackEl = stackElements[i];
|
607 |
apply(stackEl, defaults, true);
|
608 |
if (i !== 0) {
|
609 |
stackEl.down = stackElements[i - 1];
|
610 |
}
|
611 |
if (i !== len - 1) {
|
612 |
stackEl.up = stackElements[i + 1];
|
613 |
}
|
614 |
}
|
615 |
return stackEl;
|
616 |
* This will remove a stackelement from its stack while leaving the stack functional.
|
617 |
* @param {Object} element The elment to remove from the stack.
|
618 |
*/
|
619 |
element.up.down = element.down;
|
620 |
element.down.up = element.up;
|
621 |
element.up = element.down = null;
|
622 |
* Export the main object and any other methods applicable
|
623 |
*/
|
624 |
* @class easyXDM
|
625 |
* A javascript library providing cross-browser, cross-domain messaging/RPC.
|
626 |
* @version 2.4.15.118
|
627 |
* @singleton
|
628 |
*/
|
629 |
/**
|
630 |
* The version of the library
|
631 |
* @type {string}
|
632 |
*/
|
633 |
version: "2.4.15.118",
|
634 |
/**
|
635 |
* This is a map containing all the query parameters passed to the document.
|
636 |
* All the values has been decoded using decodeURIComponent.
|
637 |
* @type {object}
|
638 |
*/
|
639 |
query: query,
|
640 |
/**
|
641 |
* @private
|
642 |
*/
|
643 |
stack: {},
|
644 |
/**
|
645 |
* Applies properties from the source object to the target object.<br/>
|
646 |
* @param {object} target The target of the properties.
|
647 |
* @param {object} source The source of the properties.
|
648 |
* @param {boolean} noOverwrite Set to True to only set non-existing properties.
|
649 |
*/
|
650 |
apply: apply,
|
651 |
|
652 |
/**
|
653 |
* A safe implementation of HTML5 JSON. Feature testing is used to make sure the implementation works.
|
654 |
* @return {JSON} A valid JSON conforming object, or null if not found.
|
655 |
*/
|
656 |
getJSONObject: getJSON,
|
657 |
/**
|
658 |
* This will add a function to the queue of functions to be run once the DOM reaches a ready state.
|
659 |
* If functions are added after this event then they will be executed immediately.
|
660 |
* @param {function} fn The function to add
|
661 |
* @param {object} scope An optional scope for the function to be called with.
|
662 |
*/
|
663 |
whenReady: whenReady,
|
664 |
/**
|
665 |
* Removes easyXDM variable from the global scope. It also returns control
|
666 |
* of the easyXDM variable to whatever code used it before.
|
667 |
*
|
668 |
* @param {String} ns A string representation of an object that will hold
|
669 |
* an instance of easyXDM.
|
670 |
* @return An instance of easyXDM
|
671 |
*/
|
672 |
noConflict: noConflict
|
673 |
checkAcl: checkAcl,
|
674 |
getDomainName: getDomainName,
|
675 |
getLocation: getLocation,
|
676 |
appendQueryParameters: appendQueryParameters
|
677 |
_deferred: [],
|
678 |
flush: function(){
|
679 |
this.trace("... deferred messages ...");
|
680 |
for (var i = 0, len = this._deferred.length; i < len; i++) {
|
681 |
this.trace(this._deferred[i]);
|
682 |
}
|
683 |
this._deferred.length = 0;
|
684 |
this.trace("... end of deferred messages ...");
|
685 |
},
|
686 |
getTime: function(){
|
687 |
var d = new Date(), h = d.getHours() + "", m = d.getMinutes() + "", s = d.getSeconds() + "", ms = d.getMilliseconds() + "", zeros = "000";
|
688 |
if (h.length == 1) {
|
689 |
h = "0" + h;
|
690 |
}
|
691 |
if (m.length == 1) {
|
692 |
m = "0" + m;
|
693 |
}
|
694 |
if (s.length == 1) {
|
695 |
s = "0" + s;
|
696 |
}
|
697 |
ms = zeros.substring(ms.length) + ms;
|
698 |
return h + ":" + m + ":" + s + "." + ms;
|
699 |
},
|
700 |
/**
|
701 |
* Logs the message to console.log if available
|
702 |
* @param {String} msg The message to log
|
703 |
*/
|
704 |
log: function(msg){
|
705 |
// Uses memoizing to cache the implementation
|
706 |
if (!isHostObject(window, "console") || undef(console.log)) {
|
707 |
/**
|
708 |
* Sets log to be an empty function since we have no output available
|
709 |
* @ignore
|
710 |
*/
|
711 |
this.log = emptyFn;
|
712 |
}
|
713 |
else {
|
714 |
/**
|
715 |
* Sets log to be a wrapper around console.log
|
716 |
* @ignore
|
717 |
* @param {String} msg
|
718 |
*/
|
719 |
this.log = function(msg){
|
720 |
console.log(location.host + (namespace ? ":" + namespace : "") + " - " + this.getTime() + ": " + msg);
|
721 |
};
|
722 |
}
|
723 |
this.log(msg);
|
724 |
},
|
725 |
/**
|
726 |
* Will try to trace the given message either to a DOMElement with the id "log",
|
727 |
* or by using console.info.
|
728 |
* @param {String} msg The message to trace
|
729 |
*/
|
730 |
trace: function(msg){
|
731 |
// Uses memoizing to cache the implementation
|
732 |
if (!domIsReady) {
|
733 |
if (this._deferred.length === 0) {
|
734 |
easyXDM.whenReady(debug.flush, debug);
|
735 |
}
|
736 |
this._deferred.push(msg);
|
737 |
this.log(msg);
|
738 |
}
|
739 |
else {
|
740 |
var el = document.getElementById("log");
|
741 |
// is there a log element present?
|
742 |
if (el) {
|
743 |
/**
|
744 |
* Sets trace to be a function that outputs the messages to the DOMElement with id "log"
|
745 |
* @ignore
|
746 |
* @param {String} msg
|
747 |
*/
|
748 |
this.trace = function(msg){
|
749 |
try {
|
750 |
el.appendChild(document.createElement("div")).appendChild(document.createTextNode(location.host + (namespace ? ":" + namespace : "") + " - " + this.getTime() + ":" + msg));
|
751 |
el.scrollTop = el.scrollHeight;
|
752 |
}
|
753 |
catch (e) {
|
754 |
//In case we are unloading
|
755 |
}
|
756 |
};
|
757 |
}
|
758 |
else if (isHostObject(window, "console") && !undef(console.info)) {
|
759 |
/**
|
760 |
* Sets trace to be a wrapper around console.info
|
761 |
* @ignore
|
762 |
* @param {String} msg
|
763 |
*/
|
764 |
this.trace = function(msg){
|
765 |
console.info(location.host + (namespace ? ":" + namespace : "") + " - " + this.getTime() + ":" + msg);
|
766 |
};
|
767 |
}
|
768 |
else {
|
769 |
/**
|
770 |
* Create log window
|
771 |
* @ignore
|
772 |
*/
|
773 |
var domain = location.host, windowname = domain.replace(/\[-.:]/g, "") + "easyxdm_log", logWin;
|
774 |
try {
|
775 |
logWin = window.open("", windowname, "width=800,height=200,status=0,navigation=0,scrollbars=1");
|
776 |
}
|
777 |
catch (e) {
|
778 |
}
|
779 |
if (logWin) {
|
780 |
var doc = logWin.document;
|
781 |
el = doc.getElementById("log");
|
782 |
if (!el) {
|
783 |
doc.write("<html><head><title>easyXDM log " + domain + "</title></head>");
|
784 |
doc.write("<body><div id=\"log\"></div></body></html>");
|
785 |
doc.close();
|
786 |
el = doc.getElementById("log");
|
787 |
}
|
788 |
this.trace = function(msg){
|
789 |
try {
|
790 |
el.appendChild(doc.createElement("div")).appendChild(doc.createTextNode(location.host + (namespace ? ":" + namespace : "") + " - " + this.getTime() + ":" + msg));
|
791 |
el.scrollTop = el.scrollHeight;
|
792 |
}
|
793 |
catch (e) {
|
794 |
//In case we are unloading
|
795 |
}
|
796 |
};
|
797 |
this.trace("---- new logger at " + location.href);
|
798 |
}
|
799 |
|
800 |
if (!el) {
|
801 |
// We are unable to use any logging
|
802 |
this.trace = emptyFn;
|
803 |
}
|
804 |
}
|
805 |
this.trace(msg);
|
806 |
}
|
807 |
},
|
808 |
/**
|
809 |
* Creates a method usable for tracing.
|
810 |
* @param {String} name The name the messages should be marked with
|
811 |
* @return {Function} A function that accepts a single string as argument.
|
812 |
*/
|
813 |
getTracer: function(name){
|
814 |
return function(msg){
|
815 |
debug.trace(name + ": " + msg);
|
816 |
};
|
817 |
}
|
818 |
* @class easyXDM.DomHelper
|
819 |
* Contains methods for dealing with the DOM
|
820 |
* @singleton
|
821 |
*/
|
822 |
/**
|
823 |
* Provides a consistent interface for adding eventhandlers
|
824 |
* @param {Object} target The target to add the event to
|
825 |
* @param {String} type The name of the event
|
826 |
* @param {Function} listener The listener
|
827 |
*/
|
828 |
on: on,
|
829 |
/**
|
830 |
* Provides a consistent interface for removing eventhandlers
|
831 |
* @param {Object} target The target to remove the event from
|
832 |
* @param {String} type The name of the event
|
833 |
* @param {Function} listener The listener
|
834 |
*/
|
835 |
un: un,
|
836 |
/**
|
837 |
* Checks for the presence of the JSON object.
|
838 |
* If it is not present it will use the supplied path to load the JSON2 library.
|
839 |
* This should be called in the documents head right after the easyXDM script tag.
|
840 |
* http://json.org/json2.js
|
841 |
* @param {String} path A valid path to json2.js
|
842 |
*/
|
843 |
requiresJSON: function(path){
|
844 |
if (!isHostObject(window, "JSON")) {
|
845 |
debug.log("loading external JSON");
|
846 |
// we need to encode the < in order to avoid an illegal token error
|
847 |
// when the script is inlined in a document.
|
848 |
document.write('<' + 'script type="text/javascript" src="' + path + '"><' + '/script>');
|
849 |
}
|
850 |
else {
|
851 |
debug.log("native JSON found");
|
852 |
}
|
853 |
}
|
854 |
// The map containing the stored functions
|
855 |
var _map = {};
|
856 |
|
857 |
/**
|
858 |
* @class easyXDM.Fn
|
859 |
* This contains methods related to function handling, such as storing callbacks.
|
860 |
* @singleton
|
861 |
* @namespace easyXDM
|
862 |
*/
|
863 |
easyXDM.Fn = {
|
864 |
/**
|
865 |
* Stores a function using the given name for reference
|
866 |
* @param {String} name The name that the function should be referred by
|
867 |
* @param {Function} fn The function to store
|
868 |
* @namespace easyXDM.fn
|
869 |
*/
|
870 |
set: function(name, fn){
|
871 |
this._trace("storing function " + name);
|
872 |
_map[name] = fn;
|
873 |
},
|
874 |
/**
|
875 |
* Retrieves the function referred to by the given name
|
876 |
* @param {String} name The name of the function to retrieve
|
877 |
* @param {Boolean} del If the function should be deleted after retrieval
|
878 |
* @return {Function} The stored function
|
879 |
* @namespace easyXDM.fn
|
880 |
*/
|
881 |
get: function(name, del){
|
882 |
this._trace("retrieving function " + name);
|
883 |
var fn = _map[name];
|
884 |
if (!fn) {
|
885 |
this._trace(name + " not found");
|
886 |
}
|
887 |
|
888 |
if (del) {
|
889 |
delete _map[name];
|
890 |
}
|
891 |
return fn;
|
892 |
}
|
893 |
};
|
894 |
|
895 |
easyXDM.Fn._trace = debug.getTracer("easyXDM.Fn");
|
896 |
* @class easyXDM.Socket
|
897 |
* This class creates a transport channel between two domains that is usable for sending and receiving string-based messages.<br/>
|
898 |
* The channel is reliable, supports queueing, and ensures that the message originates from the expected domain.<br/>
|
899 |
* Internally different stacks will be used depending on the browsers features and the available parameters.
|
900 |
* <h2>How to set up</h2>
|
901 |
* Setting up the provider:
|
902 |
* <pre><code>
|
903 |
* var socket = new easyXDM.Socket({
|
904 |
* local: "name.html",
|
905 |
* onReady: function(){
|
906 |
* // you need to wait for the onReady callback before using the socket
|
907 |
* socket.postMessage("foo-message");
|
908 |
* },
|
909 |
* onMessage: function(message, origin) {
|
910 |
* alert("received " + message + " from " + origin);
|
911 |
* }
|
912 |
* });
|
913 |
* </code></pre>
|
914 |
* Setting up the consumer:
|
915 |
* <pre><code>
|
916 |
* var socket = new easyXDM.Socket({
|
917 |
* remote: "http://remotedomain/page.html",
|
918 |
* remoteHelper: "http://remotedomain/name.html",
|
919 |
* onReady: function(){
|
920 |
* // you need to wait for the onReady callback before using the socket
|
921 |
* socket.postMessage("foo-message");
|
922 |
* },
|
923 |
* onMessage: function(message, origin) {
|
924 |
* alert("received " + message + " from " + origin);
|
925 |
* }
|
926 |
* });
|
927 |
* </code></pre>
|
928 |
* If you are unable to upload the <code>name.html</code> file to the consumers domain then remove the <code>remoteHelper</code> property
|
929 |
* and easyXDM will fall back to using the HashTransport instead of the NameTransport when not able to use any of the primary transports.
|
930 |
* @namespace easyXDM
|
931 |
* @constructor
|
932 |
* @cfg {String/Window} local The url to the local name.html document, a local static file, or a reference to the local window.
|
933 |
* @cfg {Boolean} lazy (Consumer only) Set this to true if you want easyXDM to defer creating the transport until really needed.
|
934 |
* @cfg {String} remote (Consumer only) The url to the providers document.
|
935 |
* @cfg {String} remoteHelper (Consumer only) The url to the remote name.html file. This is to support NameTransport as a fallback. Optional.
|
936 |
* @cfg {Number} delay The number of milliseconds easyXDM should try to get a reference to the local window. Optional, defaults to 2000.
|
937 |
* @cfg {Number} interval The interval used when polling for messages. Optional, defaults to 300.
|
938 |
* @cfg {String} channel (Consumer only) The name of the channel to use. Can be used to set consistent iframe names. Must be unique. Optional.
|
939 |
* @cfg {Function} onMessage The method that should handle incoming messages.<br/> This method should accept two arguments, the message as a string, and the origin as a string. Optional.
|
940 |
* @cfg {Function} onReady A method that should be called when the transport is ready. Optional.
|
941 |
* @cfg {DOMElement|String} container (Consumer only) The element, or the id of the element that the primary iframe should be inserted into. If not set then the iframe will be positioned off-screen. Optional.
|
942 |
* @cfg {Array/String} acl (Provider only) Here you can specify which '[protocol]://[domain]' patterns that should be allowed to act as the consumer towards this provider.<br/>
|
943 |
* This can contain the wildcards ? and *. Examples are 'http://example.com', '*.foo.com' and '*dom?.com'. If you want to use reqular expressions then you pattern needs to start with ^ and end with $.
|
944 |
* If none of the patterns match an Error will be thrown.
|
945 |
* @cfg {Object} props (Consumer only) Additional properties that should be applied to the iframe. This can also contain nested objects e.g: <code>{style:{width:"100px", height:"100px"}}</code>.
|
946 |
* Properties such as 'name' and 'src' will be overrided. Optional.
|
947 |
*/
|
948 |
var trace = debug.getTracer("easyXDM.Socket");
|
949 |
trace("constructor");
|
950 |
|
951 |
// create the stack
|
952 |
var stack = chainStack(prepareTransportStack(config).concat([{
|
953 |
incoming: function(message, origin){
|
954 |
config.onMessage(message, origin);
|
955 |
},
|
956 |
callback: function(success){
|
957 |
if (config.onReady) {
|
958 |
config.onReady(success);
|
959 |
}
|
960 |
}
|
961 |
}])), recipient = getLocation(config.remote);
|
962 |
|
963 |
// set the origin
|
964 |
this.origin = getLocation(config.remote);
|
965 |
/**
|
966 |
* Initiates the destruction of the stack.
|
967 |
*/
|
968 |
this.destroy = function(){
|
969 |
stack.destroy();
|
970 |
};
|
971 |
|
972 |
/**
|
973 |
* Posts a message to the remote end of the channel
|
974 |
* @param {String} message The message to send
|
975 |
*/
|
976 |
this.postMessage = function(message){
|
977 |
stack.outgoing(message, recipient);
|
978 |
};
|
979 |
|
980 |
stack.init();
|
981 |
* @class easyXDM.Rpc
|
982 |
* Creates a proxy object that can be used to call methods implemented on the remote end of the channel, and also to provide the implementation
|
983 |
* of methods to be called from the remote end.<br/>
|
984 |
* The instantiated object will have methods matching those specified in <code>config.remote</code>.<br/>
|
985 |
* This requires the JSON object present in the document, either natively, using json.org's json2 or as a wrapper around library spesific methods.
|
986 |
* <h2>How to set up</h2>
|
987 |
* <pre><code>
|
988 |
* var rpc = new easyXDM.Rpc({
|
989 |
* // this configuration is equal to that used by the Socket.
|
990 |
* remote: "http://remotedomain/...",
|
991 |
* onReady: function(){
|
992 |
* // you need to wait for the onReady callback before using the proxy
|
993 |
* rpc.foo(...
|
994 |
* }
|
995 |
* },{
|
996 |
* local: {..},
|
997 |
* remote: {..}
|
998 |
* });
|
999 |
* </code></pre>
|
1000 |
*
|
1001 |
* <h2>Exposing functions (procedures)</h2>
|
1002 |
* <pre><code>
|
1003 |
* var rpc = new easyXDM.Rpc({
|
1004 |
* ...
|
1005 |
* },{
|
1006 |
* local: {
|
1007 |
* nameOfMethod: {
|
1008 |
* method: function(arg1, arg2, success, error){
|
1009 |
* ...
|
1010 |
* }
|
1011 |
* },
|
1012 |
* // with shorthand notation
|
1013 |
* nameOfAnotherMethod: function(arg1, arg2, success, error){
|
1014 |
* }
|
1015 |
* },
|
1016 |
* remote: {...}
|
1017 |
* });
|
1018 |
* </code></pre>
|
1019 |
* The function referenced by [method] will receive the passed arguments followed by the callback functions <code>success</code> and <code>error</code>.<br/>
|
1020 |
* To send a successfull result back you can use
|
1021 |
* <pre><code>
|
1022 |
* return foo;
|
1023 |
* </pre></code>
|
1024 |
* or
|
1025 |
* <pre><code>
|
1026 |
* success(foo);
|
1027 |
* </pre></code>
|
1028 |
* To return an error you can use
|
1029 |
* <pre><code>
|
1030 |
* throw new Error("foo error");
|
1031 |
* </code></pre>
|
1032 |
* or
|
1033 |
* <pre><code>
|
1034 |
* error("foo error");
|
1035 |
* </code></pre>
|
1036 |
*
|
1037 |
* <h2>Defining remotely exposed methods (procedures/notifications)</h2>
|
1038 |
* The definition of the remote end is quite similar:
|
1039 |
* <pre><code>
|
1040 |
* var rpc = new easyXDM.Rpc({
|
1041 |
* ...
|
1042 |
* },{
|
1043 |
* local: {...},
|
1044 |
* remote: {
|
1045 |
* nameOfMethod: {}
|
1046 |
* }
|
1047 |
* });
|
1048 |
* </code></pre>
|
1049 |
* To call a remote method use
|
1050 |
* <pre><code>
|
1051 |
* rpc.nameOfMethod("arg1", "arg2", function(value) {
|
1052 |
* alert("success: " + value);
|
1053 |
* }, function(message) {
|
1054 |
* alert("error: " + message + );
|
1055 |
* });
|
1056 |
* </code></pre>
|
1057 |
* Both the <code>success</code> and <code>errror</code> callbacks are optional.<br/>
|
1058 |
* When called with no callback a JSON-RPC 2.0 notification will be executed.
|
1059 |
* Be aware that you will not be notified of any errors with this method.
|
1060 |
* <br/>
|
1061 |
* <h2>Specifying a custom serializer</h2>
|
1062 |
* If you do not want to use the JSON2 library for non-native JSON support, but instead capabilities provided by some other library
|
1063 |
* then you can specify a custom serializer using <code>serializer: foo</code>
|
1064 |
* <pre><code>
|
1065 |
* var rpc = new easyXDM.Rpc({
|
1066 |
* ...
|
1067 |
* },{
|
1068 |
* local: {...},
|
1069 |
* remote: {...},
|
1070 |
* serializer : {
|
1071 |
* parse: function(string){ ... },
|
1072 |
* stringify: function(object) {...}
|
1073 |
* }
|
1074 |
* });
|
1075 |
* </code></pre>
|
1076 |
* If <code>serializer</code> is set then the class will not attempt to use the native implementation.
|
1077 |
* @namespace easyXDM
|
1078 |
* @constructor
|
1079 |
* @param {Object} config The underlying transports configuration. See easyXDM.Socket for available parameters.
|
1080 |
* @param {Object} jsonRpcConfig The description of the interface to implement.
|
1081 |
*/
|
1082 |
var trace = debug.getTracer("easyXDM.Rpc");
|
1083 |
trace("constructor");
|
1084 |
|
1085 |
// expand shorthand notation
|
1086 |
if (jsonRpcConfig.local) {
|
1087 |
for (var method in jsonRpcConfig.local) {
|
1088 |
if (jsonRpcConfig.local.hasOwnProperty(method)) {
|
1089 |
var member = jsonRpcConfig.local[method];
|
1090 |
if (typeof member === "function") {
|
1091 |
jsonRpcConfig.local[method] = {
|
1092 |
method: member
|
1093 |
};
|
1094 |
}
|
1095 |
}
|
1096 |
}
|
1097 |
}
|
1098 |
// create the stack
|
1099 |
var stack = chainStack(prepareTransportStack(config).concat([new easyXDM.stack.RpcBehavior(this, jsonRpcConfig), {
|
1100 |
callback: function(success){
|
1101 |
if (config.onReady) {
|
1102 |
config.onReady(success);
|
1103 |
}
|
1104 |
}
|
1105 |
}]));
|
1106 |
// set the origin
|
1107 |
this.origin = getLocation(config.remote);
|
1108 |
|
1109 |
/**
|
1110 |
* Initiates the destruction of the stack.
|
1111 |
*/
|
1112 |
this.destroy = function(){
|
1113 |
stack.destroy();
|
1114 |
};
|
1115 |
|
1116 |
stack.init();
|
1117 |
* @class easyXDM.stack.SameOriginTransport
|
1118 |
* SameOriginTransport is a transport class that can be used when both domains have the same origin.<br/>
|
1119 |
* This can be useful for testing and for when the main application supports both internal and external sources.
|
1120 |
* @namespace easyXDM.stack
|
1121 |
* @constructor
|
1122 |
* @param {Object} config The transports configuration.
|
1123 |
* @cfg {String} remote The remote document to communicate with.
|
1124 |
*/
|
1125 |
var trace = debug.getTracer("easyXDM.stack.SameOriginTransport");
|
1126 |
trace("constructor");
|
1127 |
var pub, frame, send, targetOrigin;
|
1128 |
|
1129 |
return (pub = {
|
1130 |
outgoing: function(message, domain, fn){
|
1131 |
send(message);
|
1132 |
if (fn) {
|
1133 |
fn();
|
1134 |
}
|
1135 |
},
|
1136 |
destroy: function(){
|
1137 |
trace("destroy");
|
1138 |
if (frame) {
|
1139 |
frame.parentNode.removeChild(frame);
|
1140 |
frame = null;
|
1141 |
}
|
1142 |
},
|
1143 |
onDOMReady: function(){
|
1144 |
trace("init");
|
1145 |
targetOrigin = getLocation(config.remote);
|
1146 |
|
1147 |
if (config.isHost) {
|
1148 |
// set up the iframe
|
1149 |
apply(config.props, {
|
1150 |
src: appendQueryParameters(config.remote, {
|
1151 |
xdm_e: location.protocol + "//" + location.host + location.pathname,
|
1152 |
xdm_c: config.channel,
|
1153 |
xdm_p: 4 // 4 = SameOriginTransport
|
1154 |
}),
|
1155 |
name: IFRAME_PREFIX + config.channel + "_provider"
|
1156 |
});
|
1157 |
frame = createFrame(config);
|
1158 |
easyXDM.Fn.set(config.channel, function(sendFn){
|
1159 |
send = sendFn;
|
1160 |
setTimeout(function(){
|
1161 |
pub.up.callback(true);
|
1162 |
}, 0);
|
1163 |
return function(msg){
|
1164 |
pub.up.incoming(msg, targetOrigin);
|
1165 |
};
|
1166 |
});
|
1167 |
}
|
1168 |
else {
|
1169 |
send = getParentObject().Fn.get(config.channel, true)(function(msg){
|
1170 |
pub.up.incoming(msg, targetOrigin);
|
1171 |
});
|
1172 |
setTimeout(function(){
|
1173 |
pub.up.callback(true);
|
1174 |
}, 0);
|
1175 |
}
|
1176 |
},
|
1177 |
init: function(){
|
1178 |
whenReady(pub.onDOMReady, pub);
|
1179 |
}
|
1180 |
});
|
1181 |
* @class easyXDM.stack.FlashTransport
|
1182 |
* FlashTransport is a transport class that uses an SWF with LocalConnection to pass messages back and forth.
|
1183 |
* @namespace easyXDM.stack
|
1184 |
* @constructor
|
1185 |
* @param {Object} config The transports configuration.
|
1186 |
* @cfg {String} remote The remote domain to communicate with.
|
1187 |
* @cfg {String} secret the pre-shared secret used to secure the communication.
|
1188 |
* @cfg {String} swf The path to the swf file
|
1189 |
* @cfg {Boolean} swfNoThrottle Set this to true if you want to take steps to avoid beeing throttled when hidden.
|
1190 |
* @cfg {String || DOMElement} swfContainer Set this if you want to control where the swf is placed
|
1191 |
*/
|
1192 |
var trace = debug.getTracer("easyXDM.stack.FlashTransport");
|
1193 |
trace("constructor");
|
1194 |
if (!config.swf) {
|
1195 |
throw new Error("Path to easyxdm.swf is missing");
|
1196 |
}
|
1197 |
var pub, // the public interface
|
1198 |
frame, send, targetOrigin, swf, swfContainer;
|
1199 |
|
1200 |
function onMessage(message, origin){
|
1201 |
setTimeout(function(){
|
1202 |
trace("received message");
|
1203 |
pub.up.incoming(message, targetOrigin);
|
1204 |
}, 0);
|
1205 |
}
|
1206 |
|
1207 |
/**
|
1208 |
* This method adds the SWF to the DOM and prepares the initialization of the channel
|
1209 |
*/
|
1210 |
function addSwf(domain){
|
1211 |
trace("creating factory with SWF from " + domain);
|
1212 |
// the differentiating query argument is needed in Flash9 to avoid a caching issue where LocalConnection would throw an error.
|
1213 |
var url = config.swf + "?host=" + config.isHost;
|
1214 |
var id = "easyXDM_swf_" + Math.floor(Math.random() * 10000);
|
1215 |
|
1216 |
// prepare the init function that will fire once the swf is ready
|
1217 |
easyXDM.Fn.set("flash_loaded" + domain.replace(/[\-.]/g, "_"), function(){
|
1218 |
easyXDM.stack.FlashTransport[domain].swf = swf = swfContainer.firstChild;
|
1219 |
var queue = easyXDM.stack.FlashTransport[domain].queue;
|
1220 |
for (var i = 0; i < queue.length; i++) {
|
1221 |
queue[i]();
|
1222 |
}
|
1223 |
queue.length = 0;
|
1224 |
});
|
1225 |
|
1226 |
if (config.swfContainer) {
|
1227 |
swfContainer = (typeof config.swfContainer == "string") ? document.getElementById(config.swfContainer) : config.swfContainer;
|
1228 |
}
|
1229 |
else {
|
1230 |
// create the container that will hold the swf
|
1231 |
swfContainer = document.createElement('div');
|
1232 |
|
1233 |
// http://bugs.adobe.com/jira/browse/FP-4796
|
1234 |
// http://tech.groups.yahoo.com/group/flexcoders/message/162365
|
1235 |
// https://groups.google.com/forum/#!topic/easyxdm/mJZJhWagoLc
|
1236 |
apply(swfContainer.style, HAS_FLASH_THROTTLED_BUG && config.swfNoThrottle ? {
|
1237 |
height: "20px",
|
1238 |
width: "20px",
|
1239 |
position: "fixed",
|
1240 |
right: 0,
|
1241 |
top: 0
|
1242 |
} : {
|
1243 |
height: "1px",
|
1244 |
width: "1px",
|
1245 |
position: "absolute",
|
1246 |
overflow: "hidden",
|
1247 |
right: 0,
|
1248 |
top: 0
|
1249 |
});
|
1250 |
document.body.appendChild(swfContainer);
|
1251 |
}
|
1252 |
|
1253 |
// create the object/embed
|
1254 |
var flashVars = "callback=flash_loaded" + domain.replace(/[\-.]/g, "_") + "&proto=" + global.location.protocol + "&domain=" + getDomainName(global.location.href) + "&port=" + getPort(global.location.href) + "&ns=" + namespace;
|
1255 |
flashVars += "&log=true";
|
1256 |
swfContainer.innerHTML = "<object height='20' width='20' type='application/x-shockwave-flash' id='" + id + "' data='" + url + "'>" +
|
1257 |
"<param name='allowScriptAccess' value='always'></param>" +
|
1258 |
"<param name='wmode' value='transparent'>" +
|
1259 |
"<param name='movie' value='" +
|
1260 |
url +
|
1261 |
"'></param>" +
|
1262 |
"<param name='flashvars' value='" +
|
1263 |
flashVars +
|
1264 |
"'></param>" +
|
1265 |
"<embed type='application/x-shockwave-flash' FlashVars='" +
|
1266 |
flashVars +
|
1267 |
"' allowScriptAccess='always' wmode='transparent' src='" +
|
1268 |
url +
|
1269 |
"' height='1' width='1'></embed>" +
|
1270 |
"</object>";
|
1271 |
}
|
1272 |
|
1273 |
return (pub = {
|
1274 |
outgoing: function(message, domain, fn){
|
1275 |
swf.postMessage(config.channel, message.toString());
|
1276 |
if (fn) {
|
1277 |
fn();
|
1278 |
}
|
1279 |
},
|
1280 |
destroy: function(){
|
1281 |
trace("destroy");
|
1282 |
try {
|
1283 |
swf.destroyChannel(config.channel);
|
1284 |
}
|
1285 |
catch (e) {
|
1286 |
}
|
1287 |
swf = null;
|
1288 |
if (frame) {
|
1289 |
frame.parentNode.removeChild(frame);
|
1290 |
frame = null;
|
1291 |
}
|
1292 |
},
|
1293 |
onDOMReady: function(){
|
1294 |
trace("init");
|
1295 |
|
1296 |
targetOrigin = config.remote;
|
1297 |
|
1298 |
// Prepare the code that will be run after the swf has been intialized
|
1299 |
easyXDM.Fn.set("flash_" + config.channel + "_init", function(){
|
1300 |
setTimeout(function(){
|
1301 |
trace("firing onReady");
|
1302 |
pub.up.callback(true);
|
1303 |
});
|
1304 |
});
|
1305 |
|
1306 |
// set up the omMessage handler
|
1307 |
easyXDM.Fn.set("flash_" + config.channel + "_onMessage", onMessage);
|
1308 |
|
1309 |
config.swf = resolveUrl(config.swf); // reports have been made of requests gone rogue when using relative paths
|
1310 |
var swfdomain = getDomainName(config.swf);
|
1311 |
var fn = function(){
|
1312 |
// set init to true in case the fn was called was invoked from a separate instance
|
1313 |
easyXDM.stack.FlashTransport[swfdomain].init = true;
|
1314 |
swf = easyXDM.stack.FlashTransport[swfdomain].swf;
|
1315 |
// create the channel
|
1316 |
swf.createChannel(config.channel, config.secret, getLocation(config.remote), config.isHost);
|
1317 |
|
1318 |
if (config.isHost) {
|
1319 |
// if Flash is going to be throttled and we want to avoid this
|
1320 |
if (HAS_FLASH_THROTTLED_BUG && config.swfNoThrottle) {
|
1321 |
apply(config.props, {
|
1322 |
position: "fixed",
|
1323 |
right: 0,
|
1324 |
top: 0,
|
1325 |
height: "20px",
|
1326 |
width: "20px"
|
1327 |
});
|
1328 |
}
|
1329 |
// set up the iframe
|
1330 |
apply(config.props, {
|
1331 |
src: appendQueryParameters(config.remote, {
|
1332 |
xdm_e: getLocation(location.href),
|
1333 |
xdm_c: config.channel,
|
1334 |
xdm_p: 6, // 6 = FlashTransport
|
1335 |
xdm_s: config.secret
|
1336 |
}),
|
1337 |
name: IFRAME_PREFIX + config.channel + "_provider"
|
1338 |
});
|
1339 |
frame = createFrame(config);
|
1340 |
}
|
1341 |
};
|
1342 |
|
1343 |
if (easyXDM.stack.FlashTransport[swfdomain] && easyXDM.stack.FlashTransport[swfdomain].init) {
|
1344 |
// if the swf is in place and we are the consumer
|
1345 |
fn();
|
1346 |
}
|
1347 |
else {
|
1348 |
// if the swf does not yet exist
|
1349 |
if (!easyXDM.stack.FlashTransport[swfdomain]) {
|
1350 |
// add the queue to hold the init fn's
|
1351 |
easyXDM.stack.FlashTransport[swfdomain] = {
|
1352 |
queue: [fn]
|
1353 |
};
|
1354 |
addSwf(swfdomain);
|
1355 |
}
|
1356 |
else {
|
1357 |
easyXDM.stack.FlashTransport[swfdomain].queue.push(fn);
|
1358 |
}
|
1359 |
}
|
1360 |
},
|
1361 |
init: function(){
|
1362 |
whenReady(pub.onDOMReady, pub);
|
1363 |
}
|
1364 |
});
|
1365 |
* @class easyXDM.stack.PostMessageTransport
|
1366 |
* PostMessageTransport is a transport class that uses HTML5 postMessage for communication.<br/>
|
1367 |
* <a href="http://msdn.microsoft.com/en-us/library/ms644944(VS.85).aspx">http://msdn.microsoft.com/en-us/library/ms644944(VS.85).aspx</a><br/>
|
1368 |
* <a href="https://developer.mozilla.org/en/DOM/window.postMessage">https://developer.mozilla.org/en/DOM/window.postMessage</a>
|
1369 |
* @namespace easyXDM.stack
|
1370 |
* @constructor
|
1371 |
* @param {Object} config The transports configuration.
|
1372 |
* @cfg {String} remote The remote domain to communicate with.
|
1373 |
*/
|
1374 |
var trace = debug.getTracer("easyXDM.stack.PostMessageTransport");
|
1375 |
trace("constructor");
|
1376 |
var pub, // the public interface
|
1377 |
frame, // the remote frame, if any
|
1378 |
callerWindow, // the window that we will call with
|
1379 |
targetOrigin; // the domain to communicate with
|
1380 |
/**
|
1381 |
* Resolves the origin from the event object
|
1382 |
* @private
|
1383 |
* @param {Object} event The messageevent
|
1384 |
* @return {String} The scheme, host and port of the origin
|
1385 |
*/
|
1386 |
function _getOrigin(event){
|
1387 |
if (event.origin) {
|
1388 |
// This is the HTML5 property
|
1389 |
return getLocation(event.origin);
|
1390 |
}
|
1391 |
if (event.uri) {
|
1392 |
// From earlier implementations
|
1393 |
return getLocation(event.uri);
|
1394 |
}
|
1395 |
if (event.domain) {
|
1396 |
// This is the last option and will fail if the
|
1397 |
// origin is not using the same schema as we are
|
1398 |
return location.protocol + "//" + event.domain;
|
1399 |
}
|
1400 |
throw "Unable to retrieve the origin of the event";
|
1401 |
}
|
1402 |
|
1403 |
/**
|
1404 |
* This is the main implementation for the onMessage event.<br/>
|
1405 |
* It checks the validity of the origin and passes the message on if appropriate.
|
1406 |
* @private
|
1407 |
* @param {Object} event The messageevent
|
1408 |
*/
|
1409 |
function _window_onMessage(event){
|
1410 |
var origin = _getOrigin(event);
|
1411 |
trace("received message '" + event.data + "' from " + origin);
|
1412 |
if (origin == targetOrigin && event.data.substring(0, config.channel.length + 1) == config.channel + " ") {
|
1413 |
pub.up.incoming(event.data.substring(config.channel.length + 1), origin);
|
1414 |
}
|
1415 |
}
|
1416 |
|
1417 |
return (pub = {
|
1418 |
outgoing: function(message, domain, fn){
|
1419 |
callerWindow.postMessage(config.channel + " " + message, domain || targetOrigin);
|
1420 |
if (fn) {
|
1421 |
fn();
|
1422 |
}
|
1423 |
},
|
1424 |
destroy: function(){
|
1425 |
trace("destroy");
|
1426 |
un(window, "message", _window_onMessage);
|
1427 |
if (frame) {
|
1428 |
callerWindow = null;
|
1429 |
frame.parentNode.removeChild(frame);
|
1430 |
frame = null;
|
1431 |
}
|
1432 |
},
|
1433 |
onDOMReady: function(){
|
1434 |
trace("init");
|
1435 |
targetOrigin = getLocation(config.remote);
|
1436 |
if (config.isHost) {
|
1437 |
// add the event handler for listening
|
1438 |
var waitForReady = function(event){
|
1439 |
if (event.data == config.channel + "-ready") {
|
1440 |
trace("firing onReady");
|
1441 |
// replace the eventlistener
|
1442 |
callerWindow = ("postMessage" in frame.contentWindow) ? frame.contentWindow : frame.contentWindow.document;
|
1443 |
un(window, "message", waitForReady);
|
1444 |
on(window, "message", _window_onMessage);
|
1445 |
setTimeout(function(){
|
1446 |
pub.up.callback(true);
|
1447 |
}, 0);
|
1448 |
}
|
1449 |
};
|
1450 |
on(window, "message", waitForReady);
|
1451 |
|
1452 |
// set up the iframe
|
1453 |
apply(config.props, {
|
1454 |
src: appendQueryParameters(config.remote, {
|
1455 |
xdm_e: getLocation(location.href),
|
1456 |
xdm_c: config.channel,
|
1457 |
xdm_p: 1 // 1 = PostMessage
|
1458 |
}),
|
1459 |
name: IFRAME_PREFIX + config.channel + "_provider"
|
1460 |
});
|
1461 |
frame = createFrame(config);
|
1462 |
}
|
1463 |
else {
|
1464 |
// add the event handler for listening
|
1465 |
on(window, "message", _window_onMessage);
|
1466 |
callerWindow = ("postMessage" in window.parent) ? window.parent : window.parent.document;
|
1467 |
callerWindow.postMessage(config.channel + "-ready", targetOrigin);
|
1468 |
|
1469 |
setTimeout(function(){
|
1470 |
pub.up.callback(true);
|
1471 |
}, 0);
|
1472 |
}
|
1473 |
},
|
1474 |
init: function(){
|
1475 |
whenReady(pub.onDOMReady, pub);
|
1476 |
}
|
1477 |
});
|
1478 |
* @class easyXDM.stack.FrameElementTransport
|
1479 |
* FrameElementTransport is a transport class that can be used with Gecko-browser as these allow passing variables using the frameElement property.<br/>
|
1480 |
* Security is maintained as Gecho uses Lexical Authorization to determine under which scope a function is running.
|
1481 |
* @namespace easyXDM.stack
|
1482 |
* @constructor
|
1483 |
* @param {Object} config The transports configuration.
|
1484 |
* @cfg {String} remote The remote document to communicate with.
|
1485 |
*/
|
1486 |
var trace = debug.getTracer("easyXDM.stack.FrameElementTransport");
|
1487 |
trace("constructor");
|
1488 |
var pub, frame, send, targetOrigin;
|
1489 |
|
1490 |
return (pub = {
|
1491 |
outgoing: function(message, domain, fn){
|
1492 |
send.call(this, message);
|
1493 |
if (fn) {
|
1494 |
fn();
|
1495 |
}
|
1496 |
},
|
1497 |
destroy: function(){
|
1498 |
trace("destroy");
|
1499 |
if (frame) {
|
1500 |
frame.parentNode.removeChild(frame);
|
1501 |
frame = null;
|
1502 |
}
|
1503 |
},
|
1504 |
onDOMReady: function(){
|
1505 |
trace("init");
|
1506 |
targetOrigin = getLocation(config.remote);
|
1507 |
|
1508 |
if (config.isHost) {
|
1509 |
// set up the iframe
|
1510 |
apply(config.props, {
|
1511 |
src: appendQueryParameters(config.remote, {
|
1512 |
xdm_e: getLocation(location.href),
|
1513 |
xdm_c: config.channel,
|
1514 |
xdm_p: 5 // 5 = FrameElementTransport
|
1515 |
}),
|
1516 |
name: IFRAME_PREFIX + config.channel + "_provider"
|
1517 |
});
|
1518 |
frame = createFrame(config);
|
1519 |
frame.fn = function(sendFn){
|
1520 |
delete frame.fn;
|
1521 |
send = sendFn;
|
1522 |
setTimeout(function(){
|
1523 |
pub.up.callback(true);
|
1524 |
}, 0);
|
1525 |
// remove the function so that it cannot be used to overwrite the send function later on
|
1526 |
return function(msg){
|
1527 |
pub.up.incoming(msg, targetOrigin);
|
1528 |
};
|
1529 |
};
|
1530 |
}
|
1531 |
else {
|
1532 |
// This is to mitigate origin-spoofing
|
1533 |
if (document.referrer && getLocation(document.referrer) != query.xdm_e) {
|
1534 |
window.top.location = query.xdm_e;
|
1535 |
}
|
1536 |
send = window.frameElement.fn(function(msg){
|
1537 |
pub.up.incoming(msg, targetOrigin);
|
1538 |
});
|
1539 |
pub.up.callback(true);
|
1540 |
}
|
1541 |
},
|
1542 |
init: function(){
|
1543 |
whenReady(pub.onDOMReady, pub);
|
1544 |
}
|
1545 |
});
|
1546 |
* @class easyXDM.stack.NameTransport
|
1547 |
* NameTransport uses the window.name property to relay data.
|
1548 |
* The <code>local</code> parameter needs to be set on both the consumer and provider,<br/>
|
1549 |
* and the <code>remoteHelper</code> parameter needs to be set on the consumer.
|
1550 |
* @constructor
|
1551 |
* @param {Object} config The transports configuration.
|
1552 |
* @cfg {String} remoteHelper The url to the remote instance of hash.html - this is only needed for the host.
|
1553 |
* @namespace easyXDM.stack
|
1554 |
*/
|
1555 |
var trace = debug.getTracer("easyXDM.stack.NameTransport");
|
1556 |
trace("constructor");
|
1557 |
if (config.isHost && undef(config.remoteHelper)) {
|
1558 |
trace("missing remoteHelper");
|
1559 |
throw new Error("missing remoteHelper");
|
1560 |
}
|
1561 |
|
1562 |
var pub; // the public interface
|
1563 |
var isHost, callerWindow, remoteWindow, readyCount, callback, remoteOrigin, remoteUrl;
|
1564 |
|
1565 |
function _sendMessage(message){
|
1566 |
var url = config.remoteHelper + (isHost ? "#_3" : "#_2") + config.channel;
|
1567 |
trace("sending message " + message);
|
1568 |
trace("navigating to '" + url + "'");
|
1569 |
callerWindow.contentWindow.sendMessage(message, url);
|
1570 |
}
|
1571 |
|
1572 |
function _onReady(){
|
1573 |
if (isHost) {
|
1574 |
if (++readyCount === 2 || !isHost) {
|
1575 |
pub.up.callback(true);
|
1576 |
}
|
1577 |
}
|
1578 |
else {
|
1579 |
_sendMessage("ready");
|
1580 |
trace("calling onReady");
|
1581 |
pub.up.callback(true);
|
1582 |
}
|
1583 |
}
|
1584 |
|
1585 |
function _onMessage(message){
|
1586 |
trace("received message " + message);
|
1587 |
pub.up.incoming(message, remoteOrigin);
|
1588 |
}
|
1589 |
|
1590 |
function _onLoad(){
|
1591 |
if (callback) {
|
1592 |
setTimeout(function(){
|
1593 |
callback(true);
|
1594 |
}, 0);
|
1595 |
}
|
1596 |
}
|
1597 |
|
1598 |
return (pub = {
|
1599 |
outgoing: function(message, domain, fn){
|
1600 |
callback = fn;
|
1601 |
_sendMessage(message);
|
1602 |
},
|
1603 |
destroy: function(){
|
1604 |
trace("destroy");
|
1605 |
callerWindow.parentNode.removeChild(callerWindow);
|
1606 |
callerWindow = null;
|
1607 |
if (isHost) {
|
1608 |
remoteWindow.parentNode.removeChild(remoteWindow);
|
1609 |
remoteWindow = null;
|
1610 |
}
|
1611 |
},
|
1612 |
onDOMReady: function(){
|
1613 |
trace("init");
|
1614 |
isHost = config.isHost;
|
1615 |
readyCount = 0;
|
1616 |
remoteOrigin = getLocation(config.remote);
|
1617 |
config.local = resolveUrl(config.local);
|
1618 |
|
1619 |
if (isHost) {
|
1620 |
// Register the callback
|
1621 |
easyXDM.Fn.set(config.channel, function(message){
|
1622 |
trace("received initial message " + message);
|
1623 |
if (isHost && message === "ready") {
|
1624 |
// Replace the handler
|
1625 |
easyXDM.Fn.set(config.channel, _onMessage);
|
1626 |
_onReady();
|
1627 |
}
|
1628 |
});
|
1629 |
|
1630 |
// Set up the frame that points to the remote instance
|
1631 |
remoteUrl = appendQueryParameters(config.remote, {
|
1632 |
xdm_e: config.local,
|
1633 |
xdm_c: config.channel,
|
1634 |
xdm_p: 2
|
1635 |
});
|
1636 |
apply(config.props, {
|
1637 |
src: remoteUrl + '#' + config.channel,
|
1638 |
name: IFRAME_PREFIX + config.channel + "_provider"
|
1639 |
});
|
1640 |
remoteWindow = createFrame(config);
|
1641 |
}
|
1642 |
else {
|
1643 |
config.remoteHelper = config.remote;
|
1644 |
easyXDM.Fn.set(config.channel, _onMessage);
|
1645 |
}
|
1646 |
// Set up the iframe that will be used for the transport
|
1647 |
|
1648 |
callerWindow = createFrame({
|
1649 |
props: {
|
1650 |
src: config.local + "#_4" + config.channel
|
1651 |
},
|
1652 |
onLoad: function onLoad(){
|
1653 |
// Remove the handler
|
1654 |
var w = callerWindow || this;
|
1655 |
un(w, "load", onLoad);
|
1656 |
easyXDM.Fn.set(config.channel + "_load", _onLoad);
|
1657 |
(function test(){
|
1658 |
if (typeof w.contentWindow.sendMessage == "function") {
|
1659 |
_onReady();
|
1660 |
}
|
1661 |
else {
|
1662 |
setTimeout(test, 50);
|
1663 |
}
|
1664 |
}());
|
1665 |
}
|
1666 |
});
|
1667 |
},
|
1668 |
init: function(){
|
1669 |
whenReady(pub.onDOMReady, pub);
|
1670 |
}
|
1671 |
});
|
1672 |
* @class easyXDM.stack.HashTransport
|
1673 |
* HashTransport is a transport class that uses the IFrame URL Technique for communication.<br/>
|
1674 |
* <a href="http://msdn.microsoft.com/en-us/library/bb735305.aspx">http://msdn.microsoft.com/en-us/library/bb735305.aspx</a><br/>
|
1675 |
* @namespace easyXDM.stack
|
1676 |
* @constructor
|
1677 |
* @param {Object} config The transports configuration.
|
1678 |
* @cfg {String/Window} local The url to the local file used for proxying messages, or the local window.
|
1679 |
* @cfg {Number} delay The number of milliseconds easyXDM should try to get a reference to the local window.
|
1680 |
* @cfg {Number} interval The interval used when polling for messages.
|
1681 |
*/
|
1682 |
var trace = debug.getTracer("easyXDM.stack.HashTransport");
|
1683 |
trace("constructor");
|
1684 |
var pub;
|
1685 |
var me = this, isHost, _timer, pollInterval, _lastMsg, _msgNr, _listenerWindow, _callerWindow;
|
1686 |
var useParent, _remoteOrigin;
|
1687 |
|
1688 |
function _sendMessage(message){
|
1689 |
trace("sending message '" + (_msgNr + 1) + " " + message + "' to " + _remoteOrigin);
|
1690 |
if (!_callerWindow) {
|
1691 |
trace("no caller window");
|
1692 |
return;
|
1693 |
}
|
1694 |
var url = config.remote + "#" + (_msgNr++) + "_" + message;
|
1695 |
((isHost || !useParent) ? _callerWindow.contentWindow : _callerWindow).location = url;
|
1696 |
}
|
1697 |
|
1698 |
function _handleHash(hash){
|
1699 |
_lastMsg = hash;
|
1700 |
trace("received message '" + _lastMsg + "' from " + _remoteOrigin);
|
1701 |
pub.up.incoming(_lastMsg.substring(_lastMsg.indexOf("_") + 1), _remoteOrigin);
|
1702 |
}
|
1703 |
|
1704 |
/**
|
1705 |
* Checks location.hash for a new message and relays this to the receiver.
|
1706 |
* @private
|
1707 |
*/
|
1708 |
function _pollHash(){
|
1709 |
if (!_listenerWindow) {
|
1710 |
return;
|
1711 |
}
|
1712 |
var href = _listenerWindow.location.href, hash = "", indexOf = href.indexOf("#");
|
1713 |
if (indexOf != -1) {
|
1714 |
hash = href.substring(indexOf);
|
1715 |
}
|
1716 |
if (hash && hash != _lastMsg) {
|
1717 |
trace("poll: new message");
|
1718 |
_handleHash(hash);
|
1719 |
}
|
1720 |
}
|
1721 |
|
1722 |
function _attachListeners(){
|
1723 |
trace("starting polling");
|
1724 |
_timer = setInterval(_pollHash, pollInterval);
|
1725 |
}
|
1726 |
|
1727 |
return (pub = {
|
1728 |
outgoing: function(message, domain){
|
1729 |
_sendMessage(message);
|
1730 |
},
|
1731 |
destroy: function(){
|
1732 |
window.clearInterval(_timer);
|
1733 |
if (isHost || !useParent) {
|
1734 |
_callerWindow.parentNode.removeChild(_callerWindow);
|
1735 |
}
|
1736 |
_callerWindow = null;
|
1737 |
},
|
1738 |
onDOMReady: function(){
|
1739 |
isHost = config.isHost;
|
1740 |
pollInterval = config.interval;
|
1741 |
_lastMsg = "#" + config.channel;
|
1742 |
_msgNr = 0;
|
1743 |
useParent = config.useParent;
|
1744 |
_remoteOrigin = getLocation(config.remote);
|
1745 |
if (isHost) {
|
1746 |
config.props = {
|
1747 |
src: config.remote,
|
1748 |
name: IFRAME_PREFIX + config.channel + "_provider"
|
1749 |
};
|
1750 |
if (useParent) {
|
1751 |
config.onLoad = function(){
|
1752 |
_listenerWindow = window;
|
1753 |
_attachListeners();
|
1754 |
pub.up.callback(true);
|
1755 |
};
|
1756 |
}
|
1757 |
else {
|
1758 |
var tries = 0, max = config.delay / 50;
|
1759 |
(function getRef(){
|
1760 |
if (++tries > max) {
|
1761 |
trace("unable to get reference to _listenerWindow, giving up");
|
1762 |
throw new Error("Unable to reference listenerwindow");
|
1763 |
}
|
1764 |
try {
|
1765 |
_listenerWindow = _callerWindow.contentWindow.frames[IFRAME_PREFIX + config.channel + "_consumer"];
|
1766 |
}
|
1767 |
catch (ex) {
|
1768 |
}
|
1769 |
if (_listenerWindow) {
|
1770 |
_attachListeners();
|
1771 |
trace("got a reference to _listenerWindow");
|
1772 |
pub.up.callback(true);
|
1773 |
}
|
1774 |
else {
|
1775 |
setTimeout(getRef, 50);
|
1776 |
}
|
1777 |
}());
|
1778 |
}
|
1779 |
_callerWindow = createFrame(config);
|
1780 |
}
|
1781 |
else {
|
1782 |
_listenerWindow = window;
|
1783 |
_attachListeners();
|
1784 |
if (useParent) {
|
1785 |
_callerWindow = parent;
|
1786 |
pub.up.callback(true);
|
1787 |
}
|
1788 |
else {
|
1789 |
apply(config, {
|
1790 |
props: {
|
1791 |
src: config.remote + "#" + config.channel + new Date(),
|
1792 |
name: IFRAME_PREFIX + config.channel + "_consumer"
|
1793 |
},
|
1794 |
onLoad: function(){
|
1795 |
pub.up.callback(true);
|
1796 |
}
|
1797 |
});
|
1798 |
_callerWindow = createFrame(config);
|
1799 |
}
|
1800 |
}
|
1801 |
},
|
1802 |
init: function(){
|
1803 |
whenReady(pub.onDOMReady, pub);
|
1804 |
}
|
1805 |
});
|
1806 |
* @class easyXDM.stack.ReliableBehavior
|
1807 |
* This is a behavior that tries to make the underlying transport reliable by using acknowledgements.
|
1808 |
* @namespace easyXDM.stack
|
1809 |
* @constructor
|
1810 |
* @param {Object} config The behaviors configuration.
|
1811 |
*/
|
1812 |
var trace = debug.getTracer("easyXDM.stack.ReliableBehavior");
|
1813 |
trace("constructor");
|
1814 |
var pub, // the public interface
|
1815 |
callback; // the callback to execute when we have a confirmed success/failure
|
1816 |
var idOut = 0, idIn = 0, currentMessage = "";
|
1817 |
|
1818 |
return (pub = {
|
1819 |
incoming: function(message, origin){
|
1820 |
trace("incoming: " + message);
|
1821 |
var indexOf = message.indexOf("_"), ack = message.substring(0, indexOf).split(",");
|
1822 |
message = message.substring(indexOf + 1);
|
1823 |
|
1824 |
if (ack[0] == idOut) {
|
1825 |
trace("message delivered");
|
1826 |
currentMessage = "";
|
1827 |
if (callback) {
|
1828 |
callback(true);
|
1829 |
}
|
1830 |
}
|
1831 |
if (message.length > 0) {
|
1832 |
trace("sending ack, and passing on " + message);
|
1833 |
pub.down.outgoing(ack[1] + "," + idOut + "_" + currentMessage, origin);
|
1834 |
if (idIn != ack[1]) {
|
1835 |
idIn = ack[1];
|
1836 |
pub.up.incoming(message, origin);
|
1837 |
}
|
1838 |
}
|
1839 |
|
1840 |
},
|
1841 |
outgoing: function(message, origin, fn){
|
1842 |
currentMessage = message;
|
1843 |
callback = fn;
|
1844 |
pub.down.outgoing(idIn + "," + (++idOut) + "_" + message, origin);
|
1845 |
}
|
1846 |
});
|
1847 |
* @class easyXDM.stack.QueueBehavior
|
1848 |
* This is a behavior that enables queueing of messages. <br/>
|
1849 |
* It will buffer incoming messages and dispach these as fast as the underlying transport allows.
|
1850 |
* This will also fragment/defragment messages so that the outgoing message is never bigger than the
|
1851 |
* set length.
|
1852 |
* @namespace easyXDM.stack
|
1853 |
* @constructor
|
1854 |
* @param {Object} config The behaviors configuration. Optional.
|
1855 |
* @cfg {Number} maxLength The maximum length of each outgoing message. Set this to enable fragmentation.
|
1856 |
*/
|
1857 |
var trace = debug.getTracer("easyXDM.stack.QueueBehavior");
|
1858 |
trace("constructor");
|
1859 |
var pub, queue = [], waiting = true, incoming = "", destroying, maxLength = 0, lazy = false, doFragment = false;
|
1860 |
|
1861 |
function dispatch(){
|
1862 |
if (config.remove && queue.length === 0) {
|
1863 |
trace("removing myself from the stack");
|
1864 |
removeFromStack(pub);
|
1865 |
return;
|
1866 |
}
|
1867 |
if (waiting || queue.length === 0 || destroying) {
|
1868 |
return;
|
1869 |
}
|
1870 |
trace("dispatching from queue");
|
1871 |
waiting = true;
|
1872 |
var message = queue.shift();
|
1873 |
|
1874 |
pub.down.outgoing(message.data, message.origin, function(success){
|
1875 |
waiting = false;
|
1876 |
if (message.callback) {
|
1877 |
setTimeout(function(){
|
1878 |
message.callback(success);
|
1879 |
}, 0);
|
1880 |
}
|
1881 |
dispatch();
|
1882 |
});
|
1883 |
}
|
1884 |
return (pub = {
|
1885 |
init: function(){
|
1886 |
if (undef(config)) {
|
1887 |
config = {};
|
1888 |
}
|
1889 |
if (config.maxLength) {
|
1890 |
maxLength = config.maxLength;
|
1891 |
doFragment = true;
|
1892 |
}
|
1893 |
if (config.lazy) {
|
1894 |
lazy = true;
|
1895 |
}
|
1896 |
else {
|
1897 |
pub.down.init();
|
1898 |
}
|
1899 |
},
|
1900 |
callback: function(success){
|
1901 |
waiting = false;
|
1902 |
var up = pub.up; // in case dispatch calls removeFromStack
|
1903 |
dispatch();
|
1904 |
up.callback(success);
|
1905 |
},
|
1906 |
incoming: function(message, origin){
|
1907 |
if (doFragment) {
|
1908 |
var indexOf = message.indexOf("_"), seq = parseInt(message.substring(0, indexOf), 10);
|
1909 |
incoming += message.substring(indexOf + 1);
|
1910 |
if (seq === 0) {
|
1911 |
trace("received the last fragment");
|
1912 |
if (config.encode) {
|
1913 |
incoming = decodeURIComponent(incoming);
|
1914 |
}
|
1915 |
pub.up.incoming(incoming, origin);
|
1916 |
incoming = "";
|
1917 |
}
|
1918 |
else {
|
1919 |
trace("waiting for more fragments, seq=" + message);
|
1920 |
}
|
1921 |
}
|
1922 |
else {
|
1923 |
pub.up.incoming(message, origin);
|
1924 |
}
|
1925 |
},
|
1926 |
outgoing: function(message, origin, fn){
|
1927 |
if (config.encode) {
|
1928 |
message = encodeURIComponent(message);
|
1929 |
}
|
1930 |
var fragments = [], fragment;
|
1931 |
if (doFragment) {
|
1932 |
// fragment into chunks
|
1933 |
while (message.length !== 0) {
|
1934 |
fragment = message.substring(0, maxLength);
|
1935 |
message = message.substring(fragment.length);
|
1936 |
fragments.push(fragment);
|
1937 |
}
|
1938 |
// enqueue the chunks
|
1939 |
while ((fragment = fragments.shift())) {
|
1940 |
trace("enqueuing");
|
1941 |
queue.push({
|
1942 |
data: fragments.length + "_" + fragment,
|
1943 |
origin: origin,
|
1944 |
callback: fragments.length === 0 ? fn : null
|
1945 |
});
|
1946 |
}
|
1947 |
}
|
1948 |
else {
|
1949 |
queue.push({
|
1950 |
data: message,
|
1951 |
origin: origin,
|
1952 |
callback: fn
|
1953 |
});
|
1954 |
}
|
1955 |
if (lazy) {
|
1956 |
pub.down.init();
|
1957 |
}
|
1958 |
else {
|
1959 |
dispatch();
|
1960 |
}
|
1961 |
},
|
1962 |
destroy: function(){
|
1963 |
trace("destroy");
|
1964 |
destroying = true;
|
1965 |
pub.down.destroy();
|
1966 |
}
|
1967 |
});
|
1968 |
* @class easyXDM.stack.VerifyBehavior
|
1969 |
* This behavior will verify that communication with the remote end is possible, and will also sign all outgoing,
|
1970 |
* and verify all incoming messages. This removes the risk of someone hijacking the iframe to send malicious messages.
|
1971 |
* @namespace easyXDM.stack
|
1972 |
* @constructor
|
1973 |
* @param {Object} config The behaviors configuration.
|
1974 |
* @cfg {Boolean} initiate If the verification should be initiated from this end.
|
1975 |
*/
|
1976 |
var trace = debug.getTracer("easyXDM.stack.VerifyBehavior");
|
1977 |
trace("constructor");
|
1978 |
if (undef(config.initiate)) {
|
1979 |
throw new Error("settings.initiate is not set");
|
1980 |
}
|
1981 |
var pub, mySecret, theirSecret, verified = false;
|
1982 |
|
1983 |
function startVerification(){
|
1984 |
trace("requesting verification");
|
1985 |
mySecret = Math.random().toString(16).substring(2);
|
1986 |
pub.down.outgoing(mySecret);
|
1987 |
}
|
1988 |
|
1989 |
return (pub = {
|
1990 |
incoming: function(message, origin){
|
1991 |
var indexOf = message.indexOf("_");
|
1992 |
if (indexOf === -1) {
|
1993 |
if (message === mySecret) {
|
1994 |
trace("verified, calling callback");
|
1995 |
pub.up.callback(true);
|
1996 |
}
|
1997 |
else if (!theirSecret) {
|
1998 |
trace("returning secret");
|
1999 |
theirSecret = message;
|
2000 |
if (!config.initiate) {
|
2001 |
startVerification();
|
2002 |
}
|
2003 |
pub.down.outgoing(message);
|
2004 |
}
|
2005 |
}
|
2006 |
else {
|
2007 |
if (message.substring(0, indexOf) === theirSecret) {
|
2008 |
pub.up.incoming(message.substring(indexOf + 1), origin);
|
2009 |
}
|
2010 |
}
|
2011 |
},
|
2012 |
outgoing: function(message, origin, fn){
|
2013 |
pub.down.outgoing(mySecret + "_" + message, origin, fn);
|
2014 |
},
|
2015 |
callback: function(success){
|
2016 |
if (config.initiate) {
|
2017 |
startVerification();
|
2018 |
}
|
2019 |
}
|
2020 |
});
|
2021 |
* @class easyXDM.stack.RpcBehavior
|
2022 |
* This uses JSON-RPC 2.0 to expose local methods and to invoke remote methods and have responses returned over the the string based transport stack.<br/>
|
2023 |
* Exposed methods can return values synchronous, asyncronous, or bet set up to not return anything.
|
2024 |
* @namespace easyXDM.stack
|
2025 |
* @constructor
|
2026 |
* @param {Object} proxy The object to apply the methods to.
|
2027 |
* @param {Object} config The definition of the local and remote interface to implement.
|
2028 |
* @cfg {Object} local The local interface to expose.
|
2029 |
* @cfg {Object} remote The remote methods to expose through the proxy.
|
2030 |
* @cfg {Object} serializer The serializer to use for serializing and deserializing the JSON. Should be compatible with the HTML5 JSON object. Optional, will default to JSON.
|
2031 |
*/
|
2032 |
var trace = debug.getTracer("easyXDM.stack.RpcBehavior");
|
2033 |
var pub, serializer = config.serializer || getJSON();
|
2034 |
var _callbackCounter = 0, _callbacks = {};
|
2035 |
|
2036 |
/**
|
2037 |
* Serializes and sends the message
|
2038 |
* @private
|
2039 |
* @param {Object} data The JSON-RPC message to be sent. The jsonrpc property will be added.
|
2040 |
*/
|
2041 |
function _send(data){
|
2042 |
data.jsonrpc = "2.0";
|
2043 |
pub.down.outgoing(serializer.stringify(data));
|
2044 |
}
|
2045 |
|
2046 |
/**
|
2047 |
* Creates a method that implements the given definition
|
2048 |
* @private
|
2049 |
* @param {Object} The method configuration
|
2050 |
* @param {String} method The name of the method
|
2051 |
* @return {Function} A stub capable of proxying the requested method call
|
2052 |
*/
|
2053 |
function _createMethod(definition, method){
|
2054 |
var slice = Array.prototype.slice;
|
2055 |
|
2056 |
trace("creating method " + method);
|
2057 |
return function(){
|
2058 |
trace("executing method " + method);
|
2059 |
var l = arguments.length, callback, message = {
|
2060 |
method: method
|
2061 |
};
|
2062 |
|
2063 |
if (l > 0 && typeof arguments[l - 1] === "function") {
|
2064 |
//with callback, procedure
|
2065 |
if (l > 1 && typeof arguments[l - 2] === "function") {
|
2066 |
// two callbacks, success and error
|
2067 |
callback = {
|
2068 |
success: arguments[l - 2],
|
2069 |
error: arguments[l - 1]
|
2070 |
};
|
2071 |
message.params = slice.call(arguments, 0, l - 2);
|
2072 |
}
|
2073 |
else {
|
2074 |
// single callback, success
|
2075 |
callback = {
|
2076 |
success: arguments[l - 1]
|
2077 |
};
|
2078 |
message.params = slice.call(arguments, 0, l - 1);
|
2079 |
}
|
2080 |
_callbacks["" + (++_callbackCounter)] = callback;
|
2081 |
message.id = _callbackCounter;
|
2082 |
}
|
2083 |
else {
|
2084 |
// no callbacks, a notification
|
2085 |
message.params = slice.call(arguments, 0);
|
2086 |
}
|
2087 |
if (definition.namedParams && message.params.length === 1) {
|
2088 |
message.params = message.params[0];
|
2089 |
}
|
2090 |
// Send the method request
|
2091 |
_send(message);
|
2092 |
};
|
2093 |
}
|
2094 |
|
2095 |
/**
|
2096 |
* Executes the exposed method
|
2097 |
* @private
|
2098 |
* @param {String} method The name of the method
|
2099 |
* @param {Number} id The callback id to use
|
2100 |
* @param {Function} method The exposed implementation
|
2101 |
* @param {Array} params The parameters supplied by the remote end
|
2102 |
*/
|
2103 |
function _executeMethod(method, id, fn, params){
|
2104 |
if (!fn) {
|
2105 |
trace("requested to execute non-existent procedure " + method);
|
2106 |
if (id) {
|
2107 |
_send({
|
2108 |
id: id,
|
2109 |
error: {
|
2110 |
code: -32601,
|
2111 |
message: "Procedure not found."
|
2112 |
}
|
2113 |
});
|
2114 |
}
|
2115 |
return;
|
2116 |
}
|
2117 |
|
2118 |
trace("requested to execute procedure " + method);
|
2119 |
var success, error;
|
2120 |
if (id) {
|
2121 |
success = function(result){
|
2122 |
success = emptyFn;
|
2123 |
_send({
|
2124 |
id: id,
|
2125 |
result: result
|
2126 |
});
|
2127 |
};
|
2128 |
error = function(message, data){
|
2129 |
error = emptyFn;
|
2130 |
var msg = {
|
2131 |
id: id,
|
2132 |
error: {
|
2133 |
code: -32099,
|
2134 |
message: message
|
2135 |
}
|
2136 |
};
|
2137 |
if (data) {
|
2138 |
msg.error.data = data;
|
2139 |
}
|
2140 |
_send(msg);
|
2141 |
};
|
2142 |
}
|
2143 |
else {
|
2144 |
success = error = emptyFn;
|
2145 |
}
|
2146 |
// Call local method
|
2147 |
if (!isArray(params)) {
|
2148 |
params = [params];
|
2149 |
}
|
2150 |
try {
|
2151 |
var result = fn.method.apply(fn.scope, params.concat([success, error]));
|
2152 |
if (!undef(result)) {
|
2153 |
success(result);
|
2154 |
}
|
2155 |
}
|
2156 |
catch (ex1) {
|
2157 |
error(ex1.message);
|
2158 |
}
|
2159 |
}
|
2160 |
|
2161 |
return (pub = {
|
2162 |
incoming: function(message, origin){
|
2163 |
var data = serializer.parse(message);
|
2164 |
if (data.method) {
|
2165 |
trace("received request to execute method " + data.method + (data.id ? (" using callback id " + data.id) : ""));
|
2166 |
// A method call from the remote end
|
2167 |
if (config.handle) {
|
2168 |
config.handle(data, _send);
|
2169 |
}
|
2170 |
else {
|
2171 |
_executeMethod(data.method, data.id, config.local[data.method], data.params);
|
2172 |
}
|
2173 |
}
|
2174 |
else {
|
2175 |
trace("received return value destined to callback with id " + data.id);
|
2176 |
// A method response from the other end
|
2177 |
var callback = _callbacks[data.id];
|
2178 |
if (data.error) {
|
2179 |
if (callback.error) {
|
2180 |
callback.error(data.error);
|
2181 |
}
|
2182 |
else {
|
2183 |
trace("unhandled error returned.");
|
2184 |
}
|
2185 |
}
|
2186 |
else if (callback.success) {
|
2187 |
callback.success(data.result);
|
2188 |
}
|
2189 |
delete _callbacks[data.id];
|
2190 |
}
|
2191 |
},
|
2192 |
init: function(){
|
2193 |
trace("init");
|
2194 |
if (config.remote) {
|
2195 |
trace("creating stubs");
|
2196 |
// Implement the remote sides exposed methods
|
2197 |
for (var method in config.remote) {
|
2198 |
if (config.remote.hasOwnProperty(method)) {
|
2199 |
proxy[method] = _createMethod(config.remote[method], method);
|
2200 |
}
|
2201 |
}
|
2202 |
}
|
2203 |
pub.down.init();
|
2204 |
},
|
2205 |
destroy: function(){
|
2206 |
trace("destroy");
|
2207 |
for (var method in config.remote) {
|
2208 |
if (config.remote.hasOwnProperty(method) && proxy.hasOwnProperty(method)) {
|
2209 |
delete proxy[method];
|
2210 |
}
|
2211 |
}
|
2212 |
pub.down.destroy();
|
2213 |
}
|
2214 |
});
|
js/libraries/isotope/css/style.css
ADDED
@@ -0,0 +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; height: 64px; 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
ADDED
@@ -0,0 +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 );
|
js/libraries/isotope/jquery.isotope.min.js
ADDED
@@ -0,0 +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);
|
js/libraries/isotope/js/fake-element.js
ADDED
@@ -0,0 +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 |
+
};
|
js/libraries/isotope/js/jquery-1.7.1.min.js
ADDED
@@ -0,0 +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);
|
js/libraries/isotope/js/jquery.ba-bbq.min.js
ADDED
@@ -0,0 +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);
|
js/libraries/isotope/js/jquery.infinitescroll.min.js
ADDED
@@ -0,0 +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);
|
js/libraries/isotope/js/make-big-graph-projects.js
ADDED
@@ -0,0 +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 |
+
}
|
js/libraries/jpicker/css/jPicker-1.1.6.css
ADDED
@@ -0,0 +1,232 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.jPicker .Icon {
|
2 |
+
display: inline-block;
|
3 |
+
height: 24px; /* change this value if using a different sized color picker icon */
|
4 |
+
position: relative; /* make this element an absolute positioning container */
|
5 |
+
text-align: left; /* make the zero width children position to the left of container */
|
6 |
+
width: 25px; /* change this value if using a different sized color picker icon */
|
7 |
+
}
|
8 |
+
.jPicker .Icon span.Color, .jPicker .Icon span.Alpha {
|
9 |
+
background-position: 2px 2px;
|
10 |
+
display: block;
|
11 |
+
height: 100%;
|
12 |
+
left: 0px;
|
13 |
+
position: absolute;
|
14 |
+
top: 0px;
|
15 |
+
width: 100%;
|
16 |
+
}
|
17 |
+
.jPicker .Icon span.Image {
|
18 |
+
background-repeat: no-repeat;
|
19 |
+
cursor: pointer;
|
20 |
+
display: block;
|
21 |
+
height: 100%;
|
22 |
+
left: 0px;
|
23 |
+
position: absolute;
|
24 |
+
top: 0px;
|
25 |
+
width: 100%;
|
26 |
+
}
|
27 |
+
.jPicker.Container {
|
28 |
+
color: #000;
|
29 |
+
z-index: 10;
|
30 |
+
}
|
31 |
+
table.jPicker {
|
32 |
+
background-color: #efefef;
|
33 |
+
border: 1px outset #666;
|
34 |
+
font-family: Arial, Helvetica, Sans-Serif;
|
35 |
+
font-size: 12px !important;
|
36 |
+
margin: 0px;
|
37 |
+
padding: 5px;
|
38 |
+
width: 545px;
|
39 |
+
z-index: 20;
|
40 |
+
}
|
41 |
+
.jPicker .Move {
|
42 |
+
background-color: #dddddd;
|
43 |
+
border-color: #fff #666 #666 #fff;
|
44 |
+
border-style: solid;
|
45 |
+
border-width: 1px;
|
46 |
+
cursor: move;
|
47 |
+
height: 12px;
|
48 |
+
padding: 0px;
|
49 |
+
}
|
50 |
+
.jPicker .Title {
|
51 |
+
font-size: 11px !important;
|
52 |
+
font-weight: bold;
|
53 |
+
margin: -2px 0px 0px 0px;
|
54 |
+
padding: 10px 0px 0px 0px;
|
55 |
+
text-align: center;
|
56 |
+
width: 100%;
|
57 |
+
}
|
58 |
+
.jPicker div.Map {
|
59 |
+
border-bottom: 2px solid #fff;
|
60 |
+
border-left: 2px solid #9a9a9a;
|
61 |
+
border-right: 2px solid #fff;
|
62 |
+
border-top: 2px solid #9a9a9a;
|
63 |
+
cursor: crosshair;
|
64 |
+
height: 260px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 256px later */
|
65 |
+
margin: 0px 10px 10px 10px;
|
66 |
+
overflow: hidden; /* hide the overdraw of the Color Map icon when at edge of viewing box */
|
67 |
+
padding: 0px;
|
68 |
+
position: relative; /* make this element an absolute positioning container */
|
69 |
+
width: 260px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 256px later */
|
70 |
+
}
|
71 |
+
.jPicker div[class="Map"] {
|
72 |
+
height: 256px; /* correct to 256px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
|
73 |
+
width: 256px; /* correct to 256px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
|
74 |
+
}
|
75 |
+
.jPicker div.Bar {
|
76 |
+
border-bottom: 2px solid #fff;
|
77 |
+
border-left: 2px solid #9a9a9a;
|
78 |
+
border-right: 2px solid #fff;
|
79 |
+
border-top: 2px solid #9a9a9a;
|
80 |
+
cursor: n-resize;
|
81 |
+
height: 260px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 256px later */
|
82 |
+
margin: 12px 10px 0px 5px;
|
83 |
+
overflow: hidden;
|
84 |
+
padding: 0px;
|
85 |
+
position: relative;
|
86 |
+
width: 24px; /* IE 6 incorrectly draws border inside the width and height instead of outside - We will fix this to 20px later */
|
87 |
+
}
|
88 |
+
.jPicker div[class="Bar"] {
|
89 |
+
height: 256px; /* correct to 256px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
|
90 |
+
width: 20px; /* correct to 20px for browsers that support the "[class="xxx"]" selector (IE7+,Firefox,Safari,Chrome,Opera,etc.) */
|
91 |
+
}
|
92 |
+
.jPicker .Map .Map1, .jPicker .Map .Map2, .jPicker .Map .Map3, .jPicker .Bar .Map1, .jPicker .Bar .Map2, .jPicker .Bar .Map3, .jPicker .Bar .Map4, .jPicker .Bar .Map5, .jPicker .Bar .Map6 {
|
93 |
+
background-color: transparent;
|
94 |
+
background-image: none;
|
95 |
+
display: block;
|
96 |
+
left: 0px;
|
97 |
+
position: absolute;
|
98 |
+
top: 0px;
|
99 |
+
}
|
100 |
+
.jPicker .Map .Map1, .jPicker .Map .Map2, .jPicker .Map .Map3 {
|
101 |
+
height: 2596px;
|
102 |
+
width: 256px; /* must specify pixel width. IE7/8 Quirks mode ignores opacity for an absolutely positioned item in a relative container with "overflow: visible". The marker in the colorBar
|
103 |
+
would not be drawn if its overflow is set to hidden. */
|
104 |
+
}
|
105 |
+
.jPicker .Bar .Map1, .jPicker .Bar .Map2, .jPicker .Bar .Map3, .jPicker .Bar .Map4 {
|
106 |
+
height: 3896px;
|
107 |
+
width: 20px; /* must specify pixel width. IE7/8 Quirks mode ignores opacity for an absolutely positioned item in a relative container with "overflow: visible". The marker in the colorBar
|
108 |
+
would not be drawn if its overflow is set to hidden. */
|
109 |
+
}
|
110 |
+
.jPicker .Bar .Map5, .jPicker .Bar .Map6 {
|
111 |
+
height: 256px;
|
112 |
+
width: 20px; /* must specify pixel width. IE7/8 Quirks mode ignores opacity for an absolutely positioned item in a relative container with "overflow: visible". The marker in the colorBar
|
113 |
+
would not be drawn if its overflow is set to hidden. */
|
114 |
+
}
|
115 |
+
.jPicker .Map .Map1, .jPicker .Map .Map2, .jPicker .Bar .Map6 {
|
116 |
+
background-repeat: no-repeat;
|
117 |
+
}
|
118 |
+
.jPicker .Map .Map3, .jPicker .Bar .Map5 {
|
119 |
+
background-repeat: repeat;
|
120 |
+
}
|
121 |
+
.jPicker .Bar .Map1, .jPicker .Bar .Map2, .jPicker .Bar .Map3, .jPicker .Bar .Map4 {
|
122 |
+
background-repeat: repeat-x;
|
123 |
+
}
|
124 |
+
.jPicker .Map .Arrow {
|
125 |
+
display: block;
|
126 |
+
position: absolute;
|
127 |
+
}
|
128 |
+
.jPicker .Bar .Arrow {
|
129 |
+
display: block;
|
130 |
+
left: 0px; /* (arrow width / 2) - (element width / 2) - position arrows' center in elements' center */
|
131 |
+
position: absolute;
|
132 |
+
}
|
133 |
+
.jPicker .Preview {
|
134 |
+
font-size: 9px;
|
135 |
+
padding: 5px 0px 0px 0px;
|
136 |
+
text-align: center;
|
137 |
+
}
|
138 |
+
.jPicker .Preview div {
|
139 |
+
border: 2px inset #eee;
|
140 |
+
height: 62px;
|
141 |
+
margin: 0px auto;
|
142 |
+
padding: 0px;
|
143 |
+
width: 62px;
|
144 |
+
}
|
145 |
+
.jPicker .Preview div span {
|
146 |
+
border: 1px solid #000;
|
147 |
+
display: block;
|
148 |
+
height: 30px;
|
149 |
+
margin: 0px auto;
|
150 |
+
padding: 0px;
|
151 |
+
width: 60px;
|
152 |
+
}
|
153 |
+
.jPicker .Preview .Active {
|
154 |
+
border-bottom-width: 0px;
|
155 |
+
}
|
156 |
+
.jPicker .Preview .Current {
|
157 |
+
border-top-width: 0px;
|
158 |
+
cursor: pointer;
|
159 |
+
}
|
160 |
+
.jPicker input {
|
161 |
+
font-size: 13px;
|
162 |
+
}
|
163 |
+
.jPicker .Button {
|
164 |
+
text-align: center;
|
165 |
+
padding: 0px 4px;
|
166 |
+
width: 115px;
|
167 |
+
}
|
168 |
+
.jPicker .Button input {
|
169 |
+
padding: 2px 0px;
|
170 |
+
width: 100px;
|
171 |
+
}
|
172 |
+
.jPicker .Button .Ok {
|
173 |
+
margin: 12px 0px 5px 0px;
|
174 |
+
}
|
175 |
+
.jPicker td {
|
176 |
+
margin: 0px;
|
177 |
+
padding: 0px;
|
178 |
+
}
|
179 |
+
.jPicker td.Radio {
|
180 |
+
margin: 0px;
|
181 |
+
padding: 0px;
|
182 |
+
width: 31px;
|
183 |
+
}
|
184 |
+
.jPicker td.Radio input {
|
185 |
+
margin: 0px 5px 0px 0px;
|
186 |
+
padding: 0px;
|
187 |
+
}
|
188 |
+
.jPicker td.Text {
|
189 |
+
font-size: 12px !important;
|
190 |
+
height: 22px;
|
191 |
+
margin: 0px;
|
192 |
+
padding: 0px;
|
193 |
+
text-align: left;
|
194 |
+
width: 70px;
|
195 |
+
}
|
196 |
+
.jPicker tr.Hex td.Text {
|
197 |
+
width: 100px;
|
198 |
+
}
|
199 |
+
.jPicker td.Text input {
|
200 |
+
background-color: #fff;
|
201 |
+
border: 1px inset #aaa;
|
202 |
+
height: 19px;
|
203 |
+
margin: 0px 0px 0px 5px;
|
204 |
+
text-align: left;
|
205 |
+
width: 30px;
|
206 |
+
}
|
207 |
+
.jPicker td[class="Text"] input {
|
208 |
+
height: 15px;
|
209 |
+
}
|
210 |
+
.jPicker tr.Hex td.Text input.Hex {
|
211 |
+
width: 50px;
|
212 |
+
}
|
213 |
+
.jPicker tr.Hex td.Text input.AHex {
|
214 |
+
width: 20px;
|
215 |
+
}
|
216 |
+
.jPicker .Grid {
|
217 |
+
text-align: center;
|
218 |
+
width: 114px;
|
219 |
+
}
|
220 |
+
.jPicker .Grid span.QuickColor {
|
221 |
+
border: 1px inset #aaa;
|
222 |
+
cursor: pointer;
|
223 |
+
display: inline-block;
|
224 |
+
height: 15px;
|
225 |
+
line-height: 15px;
|
226 |
+
margin: 0px;
|
227 |
+
padding: 0px;
|
228 |
+
width: 19px;
|
229 |
+
}
|
230 |
+
.jPicker .Grid span[class="QuickColor"] {
|
231 |
+
width: 17px;
|
232 |
+
}
|
js/libraries/jpicker/css/jPicker-1.1.6.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.jPicker .Icon{display:inline-block;height:24px;position:relative;text-align:left;width:25px}.jPicker .Icon span.Color,.jPicker .Icon span.Alpha{background-position:2px 2px;display:block;height:100%;left:0;position:absolute;top:0;width:100%}.jPicker .Icon span.Image{background-repeat:no-repeat;cursor:pointer;display:block;height:100%;left:0;position:absolute;top:0;width:100%}.jPicker.Container{color:#000;z-index:10}table.jPicker{background-color:#efefef;border:1px outset #666;font-family:Arial,Helvetica,Sans-Serif;font-size:12px!important;margin:0;padding:5px;width:545px;z-index:20}.jPicker .Move{background-color:#ddd;border-color:#fff #666 #666 #fff;border-style:solid;border-width:1px;cursor:move;height:12px;padding:0}.jPicker .Title{font-size:11px!important;font-weight:bold;margin:-2px 0 0 0;padding:10px 0 0 0;text-align:center;width:100%}.jPicker div.Map{border-bottom:2px solid #fff;border-left:2px solid #9a9a9a;border-right:2px solid #fff;border-top:2px solid #9a9a9a;cursor:crosshair;height:260px;margin:0 10px 10px 10px;overflow:hidden;padding:0;position:relative;width:260px}.jPicker div[class="Map"]{height:256px;width:256px}.jPicker div.Bar{border-bottom:2px solid #fff;border-left:2px solid #9a9a9a;border-right:2px solid #fff;border-top:2px solid #9a9a9a;cursor:n-resize;height:260px;margin:12px 10px 0 5px;overflow:hidden;padding:0;position:relative;width:24px}.jPicker div[class="Bar"]{height:256px;width:20px}.jPicker .Map .Map1,.jPicker .Map .Map2,.jPicker .Map .Map3,.jPicker .Bar .Map1,.jPicker .Bar .Map2,.jPicker .Bar .Map3,.jPicker .Bar .Map4,.jPicker .Bar .Map5,.jPicker .Bar .Map6{background-color:transparent;background-image:none;display:block;left:0;position:absolute;top:0}.jPicker .Map .Map1,.jPicker .Map .Map2,.jPicker .Map .Map3{height:2596px;width:256px}.jPicker .Bar .Map1,.jPicker .Bar .Map2,.jPicker .Bar .Map3,.jPicker .Bar .Map4{height:3896px;width:20px}.jPicker .Bar .Map5,.jPicker .Bar .Map6{height:256px;width:20px}.jPicker .Map .Map1,.jPicker .Map .Map2,.jPicker .Bar .Map6{background-repeat:no-repeat}.jPicker .Map .Map3,.jPicker .Bar .Map5{background-repeat:repeat}.jPicker .Bar .Map1,.jPicker .Bar .Map2,.jPicker .Bar .Map3,.jPicker .Bar .Map4{background-repeat:repeat-x}.jPicker .Map .Arrow{display:block;position:absolute}.jPicker .Bar .Arrow{display:block;left:0;position:absolute}.jPicker .Preview{font-size:9px;padding:5px 0 0 0;text-align:center}.jPicker .Preview div{border:2px inset #eee;height:62px;margin:0 auto;padding:0;width:62px}.jPicker .Preview div span{border:1px solid #000;display:block;height:30px;margin:0 auto;padding:0;width:60px}.jPicker .Preview .Active{border-bottom-width:0}.jPicker .Preview .Current{border-top-width:0;cursor:pointer}.jPicker input{font-size:13px}.jPicker .Button{text-align:center;padding:0 4px;width:115px}.jPicker .Button input{padding:2px 0;width:100px}.jPicker .Button .Ok{margin:12px 0 5px 0}.jPicker td{margin:0;padding:0}.jPicker td.Radio{margin:0;padding:0;width:31px}.jPicker td.Radio input{margin:0 5px 0 0;padding:0}.jPicker td.Text{font-size:12px!important;height:22px;margin:0;padding:0;text-align:left;width:70px}.jPicker tr.Hex td.Text{width:100px}.jPicker td.Text input{background-color:#fff;border:1px inset #aaa;height:28px;margin:0 0 0 5px;text-align:left;width:30px}.jPicker td[class="Text"] input{height:27px}.jPicker tr.Hex td.Text input.Hex{width:50px}.jPicker tr.Hex td.Text input.AHex{width:20px}.jPicker .Grid{text-align:center;width:114px}.jPicker .Grid span.QuickColor{border:1px inset #aaa;cursor:pointer;display:inline-block;height:15px;line-height:15px;margin:0;padding:0;width:19px}.jPicker .Grid span[class="QuickColor"]{width:17px}
|
js/libraries/jpicker/css/jPicker.css
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@media all
|
2 |
+
{
|
3 |
+
#jPicker { margin: 0px 8px; text-align: left; }
|
4 |
+
#jPicker ul { font-size: 15px; margin: 0px 0px 0px 15px; padding: 0px; }
|
5 |
+
#jPicker ul li { list-style: disc; padding: 2px 0px; }
|
6 |
+
#jPicker ul li ul { margin-bottom: 10px; }
|
7 |
+
#jPicker ul li ul li { list-style: circle; }
|
8 |
+
#jPicker p { font-size: 13px; padding: 0px 10px; }
|
9 |
+
#jPicker hr { clear: both; }
|
10 |
+
#jPicker h2.jPicker { font-size: 16px; padding: 20px 10px; }
|
11 |
+
#jPicker code { color: #8bd; font-size: 14px; font-weight: bold; }
|
12 |
+
#jPicker pre { background: #eee; border: 1px solid #000; color: #000; display: block; font-size: 11px; margin: 10px 5px; padding: 5px; }
|
13 |
+
#jPicker span { font-size: 13px; text-align: center; }
|
14 |
+
#jPicker a { color: #ff8050; }
|
15 |
+
#jPicker input { font-size: 13px; padding: 2px 5px; }
|
16 |
+
#jPicker h2 { font-size: 16px; margin: 10px 0px; }
|
17 |
+
}
|
js/libraries/jpicker/images/AlphaBar.png
ADDED
Binary file
|
js/libraries/jpicker/images/Bars.png
ADDED
Binary file
|
js/libraries/jpicker/images/Maps.png
ADDED
Binary file
|
js/libraries/jpicker/images/NoColor.png
ADDED
Binary file
|
js/libraries/jpicker/images/Thumbs.db
ADDED
Binary file
|
js/libraries/jpicker/images/bar-opacity.png
ADDED
Binary file
|
js/libraries/jpicker/images/map-opacity.png
ADDED
Binary file
|
js/libraries/jpicker/images/mappoint.gif
ADDED
Binary file
|
js/libraries/jpicker/images/picker.gif
ADDED
Binary file
|
js/libraries/jpicker/images/preview-opacity.png
ADDED
Binary file
|
js/libraries/jpicker/images/rangearrows.gif
ADDED
Binary file
|
js/libraries/jpicker/jpicker-1.1.6.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(e,a){Math.precision=function(j,h){if(h===undefined){h=0}return Math.round(j*Math.pow(10,h))/Math.pow(10,h)};var d=function(z,k){var o=this,j=z.find("img:first"),F=0,E=100,w=100,D=0,C=100,v=100,s=0,p=0,n,q,u=new Array(),l=function(y){for(var x=0;x<u.length;x++){u[x].call(o,o,y)}},H=function(x){var y=z.offset();n={l:y.left|0,t:y.top|0};clearTimeout(q);q=setTimeout(function(){A.call(o,x)},0);e(document).bind("mousemove",h).bind("mouseup",B);x.preventDefault()},h=function(x){clearTimeout(q);q=setTimeout(function(){A.call(o,x)},0);x.stopPropagation();x.preventDefault();return false},B=function(x){e(document).unbind("mouseup",B).unbind("mousemove",h);x.stopPropagation();x.preventDefault();return false},A=function(M){var K=M.pageX-n.l,x=M.pageY-n.t,L=z.w,y=z.h;if(K<0){K=0}else{if(K>L){K=L}}if(x<0){x=0}else{if(x>y){x=y}}J.call(o,"xy",{x:((K/L)*w)+F,y:((x/y)*v)+D})},r=function(){var L=0,x=0,N=z.w,K=z.h,M=j.w,y=j.h;setTimeout(function(){if(w>0){if(s==E){L=N}else{L=((s/w)*N)|0}}if(v>0){if(p==C){x=K}else{x=((p/v)*K)|0}}if(M>=N){L=(N>>1)-(M>>1)}else{L-=M>>1}if(y>=K){x=(K>>1)-(y>>1)}else{x-=y>>1}j.css({left:L+"px",top:x+"px"})},0)},J=function(x,K,y){var O=K!==undefined;if(!O){if(x===undefined||x==null){x="xy"}switch(x.toLowerCase()){case"x":return s;case"y":return p;case"xy":default:return{x:s,y:p}}}if(y!=null&&y==o){return}var N=false,M,L;if(x==null){x="xy"}switch(x.toLowerCase()){case"x":M=K&&(K.x&&K.x|0||K|0)||0;break;case"y":L=K&&(K.y&&K.y|0||K|0)||0;break;case"xy":default:M=K&&K.x&&K.x|0||0;L=K&&K.y&&K.y|0||0;break}if(M!=null){if(M<F){M=F}else{if(M>E){M=E}}if(s!=M){s=M;N=true}}if(L!=null){if(L<D){L=D}else{if(L>C){L=C}}if(p!=L){p=L;N=true}}N&&l.call(o,y||o)},t=function(x,L){var P=L!==undefined;if(!P){if(x===undefined||x==null){x="all"}switch(x.toLowerCase()){case"minx":return F;case"maxx":return E;case"rangex":return{minX:F,maxX:E,rangeX:w};case"miny":return D;case"maxy":return C;case"rangey":return{minY:D,maxY:C,rangeY:v};case"all":default:return{minX:F,maxX:E,rangeX:w,minY:D,maxY:C,rangeY:v}}}var O=false,N,K,M,y;if(x==null){x="all"}switch(x.toLowerCase()){case"minx":N=L&&(L.minX&&L.minX|0||L|0)||0;break;case"maxx":K=L&&(L.maxX&&L.maxX|0||L|0)||0;break;case"rangex":N=L&&L.minX&&L.minX|0||0;K=L&&L.maxX&&L.maxX|0||0;break;case"miny":M=L&&(L.minY&&L.minY|0||L|0)||0;break;case"maxy":y=L&&(L.maxY&&L.maxY|0||L|0)||0;break;case"rangey":M=L&&L.minY&&L.minY|0||0;y=L&&L.maxY&&L.maxY|0||0;break;case"all":default:N=L&&L.minX&&L.minX|0||0;K=L&&L.maxX&&L.maxX|0||0;M=L&&L.minY&&L.minY|0||0;y=L&&L.maxY&&L.maxY|0||0;break}if(N!=null&&F!=N){F=N;w=E-F}if(K!=null&&E!=K){E=K;w=E-F}if(M!=null&&D!=M){D=M;v=C-D}if(y!=null&&C!=y){C=y;v=C-D}},I=function(x){if(e.isFunction(x)){u.push(x)}},m=function(y){if(!e.isFunction(y)){return}var x;while((x=e.inArray(y,u))!=-1){u.splice(x,1)}},G=function(){e(document).unbind("mouseup",B).unbind("mousemove",h);z.unbind("mousedown",H);z=null;j=null;u=null};e.extend(true,o,{val:J,range:t,bind:I,unbind:m,destroy:G});j.src=k.arrow&&k.arrow.image;j.w=k.arrow&&k.arrow.width||j.width();j.h=k.arrow&&k.arrow.height||j.height();z.w=k.map&&k.map.width||z.width();z.h=k.map&&k.map.height||z.height();z.bind("mousedown",H);I.call(o,r)},b=function(u,z,k,y){var q=this,l=u.find("td.Text input"),r=l.eq(3),v=l.eq(4),h=l.eq(5),o=l.length>7?l.eq(6):null,n=l.eq(0),p=l.eq(1),x=l.eq(2),s=l.eq(l.length>7?7:6),B=l.length>7?l.eq(8):null,C=function(E){if(E.target.value==""&&E.target!=s.get(0)&&(k!=null&&E.target!=k.get(0)||k==null)){return}if(!t(E)){return E}switch(E.target){case r.get(0):switch(E.keyCode){case 38:r.val(j.call(q,(r.val()<<0)+1,0,255));z.val("r",r.val(),E.target);return false;case 40:r.val(j.call(q,(r.val()<<0)-1,0,255));z.val("r",r.val(),E.target);return false}break;case v.get(0):switch(E.keyCode){case 38:v.val(j.call(q,(v.val()<<0)+1,0,255));z.val("g",v.val(),E.target);return false;case 40:v.val(j.call(q,(v.val()<<0)-1,0,255));z.val("g",v.val(),E.target);return false}break;case h.get(0):switch(E.keyCode){case 38:h.val(j.call(q,(h.val()<<0)+1,0,255));z.val("b",h.val(),E.target);return false;case 40:h.val(j.call(q,(h.val()<<0)-1,0,255));z.val("b",h.val(),E.target);return false}break;case o&&o.get(0):switch(E.keyCode){case 38:o.val(j.call(q,parseFloat(o.val())+1,0,100));z.val("a",Math.precision((o.val()*255)/100,y),E.target);return false;case 40:o.val(j.call(q,parseFloat(o.val())-1,0,100));z.val("a",Math.precision((o.val()*255)/100,y),E.target);return false}break;case n.get(0):switch(E.keyCode){case 38:n.val(j.call(q,(n.val()<<0)+1,0,360));z.val("h",n.val(),E.target);return false;case 40:n.val(j.call(q,(n.val()<<0)-1,0,360));z.val("h",n.val(),E.target);return false}break;case p.get(0):switch(E.keyCode){case 38:p.val(j.call(q,(p.val()<<0)+1,0,100));z.val("s",p.val(),E.target);return false;case 40:p.val(j.call(q,(p.val()<<0)-1,0,100));z.val("s",p.val(),E.target);return false}break;case x.get(0):switch(E.keyCode){case 38:x.val(j.call(q,(x.val()<<0)+1,0,100));z.val("v",x.val(),E.target);return false;case 40:x.val(j.call(q,(x.val()<<0)-1,0,100));z.val("v",x.val(),E.target);return false}break}},w=function(E){if(E.target.value==""&&E.target!=s.get(0)&&(k!=null&&E.target!=k.get(0)||k==null)){return}if(!t(E)){return E}switch(E.target){case r.get(0):r.val(j.call(q,r.val(),0,255));z.val("r",r.val(),E.target);break;case v.get(0):v.val(j.call(q,v.val(),0,255));z.val("g",v.val(),E.target);break;case h.get(0):h.val(j.call(q,h.val(),0,255));z.val("b",h.val(),E.target);break;case o&&o.get(0):o.val(j.call(q,o.val(),0,100));z.val("a",Math.precision((o.val()*255)/100,y),E.target);break;case n.get(0):n.val(j.call(q,n.val(),0,360));z.val("h",n.val(),E.target);break;case p.get(0):p.val(j.call(q,p.val(),0,100));z.val("s",p.val(),E.target);break;case x.get(0):x.val(j.call(q,x.val(),0,100));z.val("v",x.val(),E.target);break;case s.get(0):s.val(s.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,6));k&&k.val(s.val());z.val("hex",s.val()!=""?s.val():null,E.target);break;case k&&k.get(0):k.val(k.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,6));s.val(k.val());z.val("hex",k.val()!=""?k.val():null,E.target);break;case B&&B.get(0):B.val(B.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,2));z.val("a",B.val()!=null?parseInt(B.val(),16):null,E.target);break}},A=function(E){if(z.val()!=null){switch(E.target){case r.get(0):r.val(z.val("r"));break;case v.get(0):v.val(z.val("g"));break;case h.get(0):h.val(z.val("b"));break;case o&&o.get(0):o.val(Math.precision((z.val("a")*100)/255,y));break;case n.get(0):n.val(z.val("h"));break;case p.get(0):p.val(z.val("s"));break;case x.get(0):x.val(z.val("v"));break;case s.get(0):case k&&k.get(0):s.val(z.val("hex"));k&&k.val(z.val("hex"));break;case B&&B.get(0):B.val(z.val("ahex").substring(6));break}}},t=function(E){switch(E.keyCode){case 9:case 16:case 29:case 37:case 39:return false;case"c".charCodeAt():case"v".charCodeAt():if(E.ctrlKey){return false}}return true},j=function(G,F,E){if(G==""||isNaN(G)){return F}if(G>E){return E}if(G<F){return F}return G},m=function(G,E){var F=G.val("all");if(E!=r.get(0)){r.val(F!=null?F.r:"")}if(E!=v.get(0)){v.val(F!=null?F.g:"")}if(E!=h.get(0)){h.val(F!=null?F.b:"")}if(o&&E!=o.get(0)){o.val(F!=null?Math.precision((F.a*100)/255,y):"")}if(E!=n.get(0)){n.val(F!=null?F.h:"")}if(E!=p.get(0)){p.val(F!=null?F.s:"")}if(E!=x.get(0)){x.val(F!=null?F.v:"")}if(E!=s.get(0)&&(k&&E!=k.get(0)||!k)){s.val(F!=null?F.hex:"")}if(k&&E!=k.get(0)&&E!=s.get(0)){k.val(F!=null?F.hex:"")}if(B&&E!=B.get(0)){B.val(F!=null?F.ahex.substring(6):"")}},D=function(){r.add(v).add(h).add(o).add(n).add(p).add(x).add(s).add(k).add(B).unbind("keyup",w).unbind("blur",A);r.add(v).add(h).add(o).add(n).add(p).add(x).unbind("keydown",C);z.unbind(m);r=null;v=null;h=null;o=null;n=null;p=null;x=null;s=null;B=null};e.extend(true,q,{destroy:D});r.add(v).add(h).add(o).add(n).add(p).add(x).add(s).add(k).add(B).bind("keyup",w).bind("blur",A);r.add(v).add(h).add(o).add(n).add(p).add(x).bind("keydown",C);z.bind(m)};e.jPicker={List:[],Color:function(z){var q=this,j,o,t,u,n,A,x,k=new Array(),m=function(r){for(var h=0;h<k.length;h++){k[h].call(q,q,r)}},l=function(h,G,r){var F=G!==undefined;if(!F){if(h===undefined||h==null||h==""){h="all"}if(j==null){return null}switch(h.toLowerCase()){case"ahex":return g.rgbaToHex({r:j,g:o,b:t,a:u});case"hex":return l("ahex").substring(0,6);case"all":return{r:j,g:o,b:t,a:u,h:n,s:A,v:x,hex:l.call(q,"hex"),ahex:l.call(q,"ahex")};default:var D={};for(var B=0;B<h.length;B++){switch(h.charAt(B)){case"r":if(h.length==1){D=j}else{D.r=j}break;case"g":if(h.length==1){D=o}else{D.g=o}break;case"b":if(h.length==1){D=t}else{D.b=t}break;case"a":if(h.length==1){D=u}else{D.a=u}break;case"h":if(h.length==1){D=n}else{D.h=n}break;case"s":if(h.length==1){D=A}else{D.s=A}break;case"v":if(h.length==1){D=x}else{D.v=x}break}}return D=={}?l.call(q,"all"):D;break}}if(r!=null&&r==q){return}var v=false;if(h==null){h=""}if(G==null){if(j!=null){j=null;v=true}if(o!=null){o=null;v=true}if(t!=null){t=null;v=true}if(u!=null){u=null;v=true}if(n!=null){n=null;v=true}if(A!=null){A=null;v=true}if(x!=null){x=null;v=true}v&&m.call(q,r||q);return}switch(h.toLowerCase()){case"ahex":case"hex":var D=g.hexToRgba(G&&(G.ahex||G.hex)||G||"00000000");l.call(q,"rgba",{r:D.r,g:D.g,b:D.b,a:h=="ahex"?D.a:u!=null?u:255},r);break;default:if(G&&(G.ahex!=null||G.hex!=null)){l.call(q,"ahex",G.ahex||G.hex||"00000000",r);return}var s={},E=false,C=false;if(G.r!==undefined&&!h.indexOf("r")==-1){h+="r"}if(G.g!==undefined&&!h.indexOf("g")==-1){h+="g"}if(G.b!==undefined&&!h.indexOf("b")==-1){h+="b"}if(G.a!==undefined&&!h.indexOf("a")==-1){h+="a"}if(G.h!==undefined&&!h.indexOf("h")==-1){h+="h"}if(G.s!==undefined&&!h.indexOf("s")==-1){h+="s"}if(G.v!==undefined&&!h.indexOf("v")==-1){h+="v"}for(var B=0;B<h.length;B++){switch(h.charAt(B)){case"r":if(C){continue}E=true;s.r=G&&G.r&&G.r|0||G&&G|0||0;if(s.r<0){s.r=0}else{if(s.r>255){s.r=255}}if(j!=s.r){j=s.r;v=true}break;case"g":if(C){continue}E=true;s.g=G&&G.g&&G.g|0||G&&G|0||0;if(s.g<0){s.g=0}else{if(s.g>255){s.g=255}}if(o!=s.g){o=s.g;v=true}break;case"b":if(C){continue}E=true;s.b=G&&G.b&&G.b|0||G&&G|0||0;if(s.b<0){s.b=0}else{if(s.b>255){s.b=255}}if(t!=s.b){t=s.b;v=true}break;case"a":s.a=G&&G.a!=null?G.a|0:G!=null?G|0:255;if(s.a<0){s.a=0}else{if(s.a>255){s.a=255}}if(u!=s.a){u=s.a;v=true}break;case"h":if(E){continue}C=true;s.h=G&&G.h&&G.h|0||G&&G|0||0;if(s.h<0){s.h=0}else{if(s.h>360){s.h=360}}if(n!=s.h){n=s.h;v=true}break;case"s":if(E){continue}C=true;s.s=G&&G.s!=null?G.s|0:G!=null?G|0:100;if(s.s<0){s.s=0}else{if(s.s>100){s.s=100}}if(A!=s.s){A=s.s;v=true}break;case"v":if(E){continue}C=true;s.v=G&&G.v!=null?G.v|0:G!=null?G|0:100;if(s.v<0){s.v=0}else{if(s.v>100){s.v=100}}if(x!=s.v){x=s.v;v=true}break}}if(v){if(E){j=j||0;o=o||0;t=t||0;var D=g.rgbToHsv({r:j,g:o,b:t});n=D.h;A=D.s;x=D.v}else{if(C){n=n||0;A=A!=null?A:100;x=x!=null?x:100;var D=g.hsvToRgb({h:n,s:A,v:x});j=D.r;o=D.g;t=D.b}}u=u!=null?u:255;m.call(q,r||q)}break}},p=function(h){if(e.isFunction(h)){k.push(h)}},y=function(r){if(!e.isFunction(r)){return}var h;while((h=e.inArray(r,k))!=-1){k.splice(h,1)}},w=function(){k=null};e.extend(true,q,{val:l,bind:p,unbind:y,destroy:w});if(z){if(z.ahex!=null){l("ahex",z)}else{if(z.hex!=null){l((z.a!=null?"a":"")+"hex",z.a!=null?{ahex:z.hex+g.intToHex(z.a)}:z)}else{if(z.r!=null&&z.g!=null&&z.b!=null){l("rgb"+(z.a!=null?"a":""),z)}else{if(z.h!=null&&z.s!=null&&z.v!=null){l("hsv"+(z.a!=null?"a":""),z)}}}}}},ColorMethods:{hexToRgba:function(m){m=this.validateHex(m);if(m==""){return{r:null,g:null,b:null,a:null}}var l="00",k="00",h="00",j="255";if(m.length==6){m+="ff"}if(m.length>6){l=m.substring(0,2);k=m.substring(2,4);h=m.substring(4,6);j=m.substring(6,m.length)}else{if(m.length>4){l=m.substring(4,m.length);m=m.substring(0,4)}if(m.length>2){k=m.substring(2,m.length);m=m.substring(0,2)}if(m.length>0){h=m.substring(0,m.length)}}return{r:this.hexToInt(l),g:this.hexToInt(k),b:this.hexToInt(h),a:this.hexToInt(j)}},validateHex:function(h){h=h.toLowerCase().replace(/[^a-f0-9]/g,"");if(h.length>8){h=h.substring(0,8)}return h},rgbaToHex:function(h){return this.intToHex(h.r)+this.intToHex(h.g)+this.intToHex(h.b)+this.intToHex(h.a)},intToHex:function(j){var h=(j|0).toString(16);if(h.length==1){h=("0"+h)}return h.toLowerCase()},hexToInt:function(h){return parseInt(h,16)},rgbToHsv:function(l){var o=l.r/255,n=l.g/255,j=l.b/255,k={h:0,s:0,v:0},m=0,h=0,p;if(o>=n&&o>=j){h=o;m=n>j?j:n}else{if(n>=j&&n>=o){h=n;m=o>j?j:o}else{h=j;m=n>o?o:n}}k.v=h;k.s=h?(h-m)/h:0;if(!k.s){k.h=0}else{p=h-m;if(o==h){k.h=(n-j)/p}else{if(n==h){k.h=2+(j-o)/p}else{k.h=4+(o-n)/p}}k.h=parseInt(k.h*60);if(k.h<0){k.h+=360}}k.s=(k.s*100)|0;k.v=(k.v*100)|0;return k},hsvToRgb:function(n){var r={r:0,g:0,b:0,a:100},m=n.h,x=n.s,u=n.v;if(x==0){if(u==0){r.r=r.g=r.b=0}else{r.r=r.g=r.b=(u*255/100)|0}}else{if(m==360){m=0}m/=60;x=x/100;u=u/100;var l=m|0,o=m-l,k=u*(1-x),j=u*(1-(x*o)),w=u*(1-(x*(1-o)));switch(l){case 0:r.r=u;r.g=w;r.b=k;break;case 1:r.r=j;r.g=u;r.b=k;break;case 2:r.r=k;r.g=u;r.b=w;break;case 3:r.r=k;r.g=j;r.b=u;break;case 4:r.r=w;r.g=k;r.b=u;break;case 5:r.r=u;r.g=k;r.b=j;break}r.r=(r.r*255)|0;r.g=(r.g*255)|0;r.b=(r.b*255)|0}return r}}};var f=e.jPicker.Color,c=e.jPicker.List,g=e.jPicker.ColorMethods;e.fn.jPicker=function(j){var h=arguments;return this.each(function(){var w=this,av=e.extend(true,{},e.fn.jPicker.defaults,j);if(e(w).get(0).nodeName.toLowerCase()=="input"){e.extend(true,av,{window:{bindToInput:true,expandable:true,input:e(w)}});if(e(w).val()==""){av.color.active=new f({hex:null});av.color.current=new f({hex:null})}else{if(g.validateHex(e(w).val())){av.color.active=new f({hex:e(w).val(),a:av.color.active.val("a")});av.color.current=new f({hex:e(w).val(),a:av.color.active.val("a")})}}}if(av.window.expandable){e(w).after('<span class="jPicker"><span class="Icon"><span class="Color"> </span><span class="Alpha"> </span><span class="Image" title="Click To Open Color Picker"> </span><span class="Container"> </span></span></span>')}else{av.window.liveUpdate=false}var Q=parseFloat(navigator.appVersion.split("MSIE")[1])<7&&document.body.filters,R=null,l=null,s=null,au=null,at=null,ar=null,P=null,O=null,N=null,M=null,L=null,K=null,D=null,U=null,aw=null,J=null,I=null,am=null,ai=null,E=null,an=null,ah=null,X=null,ab=null,aq=null,r=null,C=null,u=null,ag=function(aB){var aD=G.active,aE=n.clientPath,aA=aD.val("hex"),aC,az;av.color.mode=aB;switch(aB){case"h":setTimeout(function(){y.call(w,l,"transparent");x.call(w,au,0);Y.call(w,au,100);x.call(w,at,260);Y.call(w,at,100);y.call(w,s,"transparent");x.call(w,P,0);Y.call(w,P,100);x.call(w,O,260);Y.call(w,O,100);x.call(w,N,260);Y.call(w,N,100);x.call(w,M,260);Y.call(w,M,100);x.call(w,K,260);Y.call(w,K,100)},0);D.range("all",{minX:0,maxX:100,minY:0,maxY:100});U.range("rangeY",{minY:0,maxY:360});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("s"),y:100-aD.val("v")},D);U.val("y",360-aD.val("h"),U);break;case"s":setTimeout(function(){y.call(w,l,"transparent");x.call(w,au,-260);x.call(w,at,-520);x.call(w,P,-260);x.call(w,O,-520);x.call(w,K,260);Y.call(w,K,100)},0);D.range("all",{minX:0,maxX:360,minY:0,maxY:100});U.range("rangeY",{minY:0,maxY:100});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("h"),y:100-aD.val("v")},D);U.val("y",100-aD.val("s"),U);break;case"v":setTimeout(function(){y.call(w,l,"000000");x.call(w,au,-780);x.call(w,at,260);y.call(w,s,aA);x.call(w,P,-520);x.call(w,O,260);Y.call(w,O,100);x.call(w,K,260);Y.call(w,K,100)},0);D.range("all",{minX:0,maxX:360,minY:0,maxY:100});U.range("rangeY",{minY:0,maxY:100});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("h"),y:100-aD.val("s")},D);U.val("y",100-aD.val("v"),U);break;case"r":aC=-1040;az=-780;D.range("all",{minX:0,maxX:255,minY:0,maxY:255});U.range("rangeY",{minY:0,maxY:255});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("b"),y:255-aD.val("g")},D);U.val("y",255-aD.val("r"),U);break;case"g":aC=-1560;az=-1820;D.range("all",{minX:0,maxX:255,minY:0,maxY:255});U.range("rangeY",{minY:0,maxY:255});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("b"),y:255-aD.val("r")},D);U.val("y",255-aD.val("g"),U);break;case"b":aC=-2080;az=-2860;D.range("all",{minX:0,maxX:255,minY:0,maxY:255});U.range("rangeY",{minY:0,maxY:255});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("r"),y:255-aD.val("g")},D);U.val("y",255-aD.val("b"),U);break;case"a":setTimeout(function(){y.call(w,l,"transparent");x.call(w,au,-260);x.call(w,at,-520);x.call(w,P,260);x.call(w,O,260);Y.call(w,O,100);x.call(w,K,0);Y.call(w,K,100)},0);D.range("all",{minX:0,maxX:360,minY:0,maxY:100});U.range("rangeY",{minY:0,maxY:255});if(aD.val("ahex")==null){break}D.val("xy",{x:aD.val("h"),y:100-aD.val("v")},D);U.val("y",255-aD.val("a"),U);break;default:throw ("Invalid Mode");break}switch(aB){case"h":break;case"s":case"v":case"a":setTimeout(function(){Y.call(w,au,100);Y.call(w,P,100);x.call(w,N,260);Y.call(w,N,100);x.call(w,M,260);Y.call(w,M,100)},0);break;case"r":case"g":case"b":setTimeout(function(){y.call(w,l,"transparent");y.call(w,s,"transparent");Y.call(w,P,100);Y.call(w,au,100);x.call(w,au,aC);x.call(w,at,aC-260);x.call(w,P,az-780);x.call(w,O,az-520);x.call(w,N,az);x.call(w,M,az-260);x.call(w,K,260);Y.call(w,K,100)},0);break}if(aD.val("ahex")==null){return}aj.call(w,aD)},aj=function(aA,az){if(az==null||(az!=U&&az!=D)){v.call(w,aA,az)}setTimeout(function(){ay.call(w,aA);al.call(w,aA);W.call(w,aA)},0)},z=function(aA,az){var aC=G.active;if(az!=D&&aC.val()==null){return}var aB=aA.val("all");switch(av.color.mode){case"h":aC.val("sv",{s:aB.x,v:100-aB.y},az);break;case"s":case"a":aC.val("hv",{h:aB.x,v:100-aB.y},az);break;case"v":aC.val("hs",{h:aB.x,s:100-aB.y},az);break;case"r":aC.val("gb",{g:255-aB.y,b:aB.x},az);break;case"g":aC.val("rb",{r:255-aB.y,b:aB.x},az);break;case"b":aC.val("rg",{r:aB.x,g:255-aB.y},az);break}},ac=function(aA,az){var aB=G.active;if(az!=U&&aB.val()==null){return}switch(av.color.mode){case"h":aB.val("h",{h:360-aA.val("y")},az);break;case"s":aB.val("s",{s:100-aA.val("y")},az);break;case"v":aB.val("v",{v:100-aA.val("y")},az);break;case"r":aB.val("r",{r:255-aA.val("y")},az);break;case"g":aB.val("g",{g:255-aA.val("y")},az);break;case"b":aB.val("b",{b:255-aA.val("y")},az);break;case"a":aB.val("a",255-aA.val("y"),az);break}},v=function(aC,az){if(az!=D){switch(av.color.mode){case"h":var aH=aC.val("sv");D.val("xy",{x:aH!=null?aH.s:100,y:100-(aH!=null?aH.v:100)},az);break;case"s":case"a":var aB=aC.val("hv");D.val("xy",{x:aB&&aB.h||0,y:100-(aB!=null?aB.v:100)},az);break;case"v":var aE=aC.val("hs");D.val("xy",{x:aE&&aE.h||0,y:100-(aE!=null?aE.s:100)},az);break;case"r":var aA=aC.val("bg");D.val("xy",{x:aA&&aA.b||0,y:255-(aA&&aA.g||0)},az);break;case"g":var aI=aC.val("br");D.val("xy",{x:aI&&aI.b||0,y:255-(aI&&aI.r||0)},az);break;case"b":var aG=aC.val("rg");D.val("xy",{x:aG&&aG.r||0,y:255-(aG&&aG.g||0)},az);break}}if(az!=U){switch(av.color.mode){case"h":U.val("y",360-(aC.val("h")||0),az);break;case"s":var aJ=aC.val("s");U.val("y",100-(aJ!=null?aJ:100),az);break;case"v":var aF=aC.val("v");U.val("y",100-(aF!=null?aF:100),az);break;case"r":U.val("y",255-(aC.val("r")||0),az);break;case"g":U.val("y",255-(aC.val("g")||0),az);break;case"b":U.val("y",255-(aC.val("b")||0),az);break;case"a":var aD=aC.val("a");U.val("y",255-(aD!=null?aD:255),az);break}}},ay=function(aA){try{var az=aA.val("all");E.css({backgroundColor:az&&"#"+az.hex||"transparent"});Y.call(w,E,az&&Math.precision((az.a*100)/255,4)||0)}catch(aB){}},al=function(aC){switch(av.color.mode){case"h":y.call(w,l,new f({h:aC.val("h")||0,s:100,v:100}).val("hex"));break;case"s":case"a":var aB=aC.val("s");Y.call(w,at,100-(aB!=null?aB:100));break;case"v":var aA=aC.val("v");Y.call(w,au,aA!=null?aA:100);break;case"r":Y.call(w,at,Math.precision((aC.val("r")||0)/255*100,4));break;case"g":Y.call(w,at,Math.precision((aC.val("g")||0)/255*100,4));break;case"b":Y.call(w,at,Math.precision((aC.val("b")||0)/255*100));break}var az=aC.val("a");Y.call(w,ar,Math.precision(((255-(az||0))*100)/255,4))},W=function(aF){switch(av.color.mode){case"h":var aH=aF.val("a");Y.call(w,L,Math.precision(((255-(aH||0))*100)/255,4));break;case"s":var aA=aF.val("hva"),aB=new f({h:aA&&aA.h||0,s:100,v:aA!=null?aA.v:100});y.call(w,s,aB.val("hex"));Y.call(w,O,100-(aA!=null?aA.v:100));Y.call(w,L,Math.precision(((255-(aA&&aA.a||0))*100)/255,4));break;case"v":var aC=aF.val("hsa"),aE=new f({h:aC&&aC.h||0,s:aC!=null?aC.s:100,v:100});y.call(w,s,aE.val("hex"));Y.call(w,L,Math.precision(((255-(aC&&aC.a||0))*100)/255,4));break;case"r":case"g":case"b":var aD=0,aG=0,az=aF.val("rgba");if(av.color.mode=="r"){aD=az&&az.b||0;aG=az&&az.g||0}else{if(av.color.mode=="g"){aD=az&&az.b||0;aG=az&&az.r||0}else{if(av.color.mode=="b"){aD=az&&az.r||0;aG=az&&az.g||0}}}var aI=aG>aD?aD:aG;Y.call(w,O,aD>aG?Math.precision(((aD-aG)/(255-aG))*100,4):0);Y.call(w,N,aG>aD?Math.precision(((aG-aD)/(255-aD))*100,4):0);Y.call(w,M,Math.precision((aI/255)*100,4));Y.call(w,L,Math.precision(((255-(az&&az.a||0))*100)/255,4));break;case"a":var aH=aF.val("a");y.call(w,s,aF.val("hex")||"000000");Y.call(w,L,aH!=null?0:100);Y.call(w,K,aH!=null?100:0);break}},y=function(az,aA){az.css({backgroundColor:aA&&aA.length==6&&"#"+aA||"transparent"})},t=function(az,aA){if(Q&&(aA.indexOf("AlphaBar.png")!=-1||aA.indexOf("Bars.png")!=-1||aA.indexOf("Maps.png")!=-1)){az.attr("pngSrc",aA);az.css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+aA+"', sizingMethod='scale')"})}else{az.css({backgroundImage:"url('"+aA+"')"})}},x=function(az,aA){az.css({top:aA+"px"})},Y=function(aA,az){aA.css({visibility:az>0?"visible":"hidden"});if(az>0&&az<100){if(Q){var aB=aA.attr("pngSrc");if(aB!=null&&(aB.indexOf("AlphaBar.png")!=-1||aB.indexOf("Bars.png")!=-1||aB.indexOf("Maps.png")!=-1)){aA.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+aB+"', sizingMethod='scale') progid:DXImageTransform.Microsoft.Alpha(opacity="+az+")"})}else{aA.css({opacity:Math.precision(az/100,4)})}}else{aA.css({opacity:Math.precision(az/100,4)})}}else{if(az==0||az==100){if(Q){var aB=aA.attr("pngSrc");if(aB!=null&&(aB.indexOf("AlphaBar.png")!=-1||aB.indexOf("Bars.png")!=-1||aB.indexOf("Maps.png")!=-1)){aA.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+aB+"', sizingMethod='scale')"})}else{aA.css({opacity:""})}}else{aA.css({opacity:""})}}}},B=function(){G.active.val("ahex",G.current.val("ahex"))},T=function(){G.current.val("ahex",G.active.val("ahex"))},A=function(az){e(this).parents("tbody:first").find('input:radio[value!="'+az.target.value+'"]').removeAttr("checked");ag.call(w,az.target.value)},Z=function(){B.call(w)},q=function(){B.call(w);av.window.expandable&&ao.call(w);e.isFunction(ax)&&ax.call(w,G.active,X)},m=function(){T.call(w);av.window.expandable&&ao.call(w);e.isFunction(ae)&&ae.call(w,G.active,ah)},af=function(){V.call(w)},ap=function(aB,az){var aA=aB.val("hex");an.css({backgroundColor:aA&&"#"+aA||"transparent"});Y.call(w,an,Math.precision(((aB.val("a")||0)*100)/255,4))},H=function(aC,az){var aB=aC.val("hex");var aA=aC.val("va");aq.css({backgroundColor:aB&&"#"+aB||"transparent"});Y.call(w,r,Math.precision(((255-(aA&&aA.a||0))*100)/255,4));if(av.window.bindToInput&&av.window.updateInputColor){av.window.input.css({backgroundColor:aB&&"#"+aB||"transparent",color:aA==null||aA.v>75?"#000000":"#ffffff"})}},S=function(aB){var az=av.window.element,aA=av.window.page;J=parseInt(R.css("left"));I=parseInt(R.css("top"));am=aB.pageX;ai=aB.pageY;e(document).bind("mousemove",k).bind("mouseup",p);aB.preventDefault()},k=function(az){R.css({left:J-(am-az.pageX)+"px",top:I-(ai-az.pageY)+"px"});if(av.window.expandable&&!e.support.boxModel){R.prev().css({left:R.css("left"),top:R.css("top")})}az.stopPropagation();az.preventDefault();return false},p=function(az){e(document).unbind("mousemove",k).unbind("mouseup",p);az.stopPropagation();az.preventDefault();return false},F=function(az){az.preventDefault();az.stopPropagation();G.active.val("ahex",e(this).attr("title")||null,az.target);return false},ae=e.isFunction(h[1])&&h[1]||null,ad=e.isFunction(h[2])&&h[2]||null,ax=e.isFunction(h[3])&&h[3]||null,V=function(){G.current.val("ahex",G.active.val("ahex"));var az=function(){if(!av.window.expandable||e.support.boxModel){return}var aA=R.find("table:first");R.before("<iframe/>");R.prev().css({width:aA.width(),height:R.height(),opacity:0,position:"absolute",left:R.css("left"),top:R.css("top")})};if(av.window.expandable){e(document.body).children("div.jPicker.Container").css({zIndex:10});R.css({zIndex:20})}switch(av.window.effects.type){case"fade":R.fadeIn(av.window.effects.speed.show,az);break;case"slide":R.slideDown(av.window.effects.speed.show,az);break;case"show":default:R.show(av.window.effects.speed.show,az);break}},ao=function(){var az=function(){if(av.window.expandable){R.css({zIndex:10})}if(!av.window.expandable||e.support.boxModel){return}R.prev().remove()};switch(av.window.effects.type){case"fade":R.fadeOut(av.window.effects.speed.hide,az);break;case"slide":R.slideUp(av.window.effects.speed.hide,az);break;case"show":default:R.hide(av.window.effects.speed.hide,az);break}},o=function(){var aG=av.window,az=aG.expandable?e(w).next().find(".Container:first"):null;R=aG.expandable?e("<div/>"):e(w);R.addClass("jPicker Container");if(aG.expandable){R.hide()}R.get(0).onselectstart=function(aN){if(aN.target.nodeName.toLowerCase()!=="input"){return false}};var aJ=G.active.val("all");if(aG.alphaPrecision<0){aG.alphaPrecision=0}else{if(aG.alphaPrecision>2){aG.alphaPrecision=2}}var aK='<table class="jPicker" cellpadding="0" cellspacing="0"><tbody>'+(aG.expandable?'<tr><td class="Move" colspan="5"> </td></tr>':"")+'<tr><td rowspan="9"><h2 class="Title">'+(aG.title||aa.text.title)+'</h2><div class="Map"><span class="Map1"> </span><span class="Map2"> </span><span class="Map3"> </span><img src="'+n.clientPath+n.colorMap.arrow.file+'" class="Arrow"/></div></td><td rowspan="9"><div class="Bar"><span class="Map1"> </span><span class="Map2"> </span><span class="Map3"> </span><span class="Map4"> </span><span class="Map5"> </span><span class="Map6"> </span><img src="'+n.clientPath+n.colorBar.arrow.file+'" class="Arrow"/></div></td><td colspan="2" class="Preview">'+aa.text.newColor+'<div><span class="Active" title="'+aa.tooltips.colors.newColor+'"> </span><span class="Current" title="'+aa.tooltips.colors.currentColor+'"> </span></div>'+aa.text.currentColor+'</td><td rowspan="9" class="Button"><input type="button" class="Ok" value="'+aa.text.ok+'" title="'+aa.tooltips.buttons.ok+'"/><input type="button" class="Cancel" value="'+aa.text.cancel+'" title="'+aa.tooltips.buttons.cancel+'"/><hr/><div class="Grid"> </div></td></tr><tr class="Hue"><td class="Radio"><label title="'+aa.tooltips.hue.radio+'"><input type="radio" value="h"'+(av.color.mode=="h"?' checked="checked"':"")+'/>H:</label></td><td class="Text"><input type="text" maxlength="3" value="'+(aJ!=null?aJ.h:"")+'" title="'+aa.tooltips.hue.textbox+'"/> °</td></tr><tr class="Saturation"><td class="Radio"><label title="'+aa.tooltips.saturation.radio+'"><input type="radio" value="s"'+(av.color.mode=="s"?' checked="checked"':"")+'/>S:</label></td><td class="Text"><input type="text" maxlength="3" value="'+(aJ!=null?aJ.s:"")+'" title="'+aa.tooltips.saturation.textbox+'"/> %</td></tr><tr class="Value"><td class="Radio"><label title="'+aa.tooltips.value.radio+'"><input type="radio" value="v"'+(av.color.mode=="v"?' checked="checked"':"")+'/>V:</label><br/><br/></td><td class="Text"><input type="text" maxlength="3" value="'+(aJ!=null?aJ.v:"")+'" title="'+aa.tooltips.value.textbox+'"/> %<br/><br/></td></tr><tr class="Red"><td class="Radio"><label title="'+aa.tooltips.red.radio+'"><input type="radio" value="r"'+(av.color.mode=="r"?' checked="checked"':"")+'/>R:</label></td><td class="Text"><input type="text" maxlength="3" value="'+(aJ!=null?aJ.r:"")+'" title="'+aa.tooltips.red.textbox+'"/></td></tr><tr class="Green"><td class="Radio"><label title="'+aa.tooltips.green.radio+'"><input type="radio" value="g"'+(av.color.mode=="g"?' checked="checked"':"")+'/>G:</label></td><td class="Text"><input type="text" maxlength="3" value="'+(aJ!=null?aJ.g:"")+'" title="'+aa.tooltips.green.textbox+'"/></td></tr><tr class="Blue"><td class="Radio"><label title="'+aa.tooltips.blue.radio+'"><input type="radio" value="b"'+(av.color.mode=="b"?' checked="checked"':"")+'/>B:</label></td><td class="Text"><input type="text" maxlength="3" value="'+(aJ!=null?aJ.b:"")+'" title="'+aa.tooltips.blue.textbox+'"/></td></tr><tr class="Alpha"><td class="Radio">'+(aG.alphaSupport?'<label title="'+aa.tooltips.alpha.radio+'"><input type="radio" value="a"'+(av.color.mode=="a"?' checked="checked"':"")+"/>A:</label>":" ")+'</td><td class="Text">'+(aG.alphaSupport?'<input type="text" maxlength="'+(3+aG.alphaPrecision)+'" value="'+(aJ!=null?Math.precision((aJ.a*100)/255,aG.alphaPrecision):"")+'" title="'+aa.tooltips.alpha.textbox+'"/> %':" ")+'</td></tr><tr class="Hex"><td colspan="2" class="Text"><label title="'+aa.tooltips.hex.textbox+'">#:<input type="text" maxlength="6" class="Hex" value="'+(aJ!=null?aJ.hex:"")+'"/></label>'+(aG.alphaSupport?'<input type="text" maxlength="2" class="AHex" value="'+(aJ!=null?aJ.ahex.substring(6):"")+'" title="'+aa.tooltips.hex.alpha+'"/></td>':" ")+"</tr></tbody></table>";if(aG.expandable){R.html(aK);if(e(document.body).children("div.jPicker.Container").length==0){e(document.body).prepend(R)}else{e(document.body).children("div.jPicker.Container:last").after(R)}R.mousedown(function(){e(document.body).children("div.jPicker.Container").css({zIndex:10});R.css({zIndex:20})});R.css({left:aG.position.x=="left"?(az.offset().left-530-(aG.position.y=="center"?25:0))+"px":aG.position.x=="center"?(az.offset().left-260)+"px":aG.position.x=="right"?(az.offset().left-10+(aG.position.y=="center"?25:0))+"px":aG.position.x=="screenCenter"?((e(document).width()>>1)-260)+"px":(az.offset().left+parseInt(aG.position.x))+"px",position:"absolute",top:aG.position.y=="top"?(az.offset().top-312)+"px":aG.position.y=="center"?(az.offset().top-156)+"px":aG.position.y=="bottom"?(az.offset().top+25)+"px":(az.offset().top+parseInt(aG.position.y))+"px"})}else{R=e(w);R.html(aK)}var aD=R.find("tbody:first");l=aD.find("div.Map:first");s=aD.find("div.Bar:first");var aL=l.find("span"),aI=s.find("span");au=aL.filter(".Map1:first");at=aL.filter(".Map2:first");ar=aL.filter(".Map3:first");P=aI.filter(".Map1:first");O=aI.filter(".Map2:first");N=aI.filter(".Map3:first");M=aI.filter(".Map4:first");L=aI.filter(".Map5:first");K=aI.filter(".Map6:first");D=new d(l,{map:{width:n.colorMap.width,height:n.colorMap.height},arrow:{image:n.clientPath+n.colorMap.arrow.file,width:n.colorMap.arrow.width,height:n.colorMap.arrow.height}});D.bind(z);U=new d(s,{map:{width:n.colorBar.width,height:n.colorBar.height},arrow:{image:n.clientPath+n.colorBar.arrow.file,width:n.colorBar.arrow.width,height:n.colorBar.arrow.height}});U.bind(ac);aw=new b(aD,G.active,aG.expandable&&aG.bindToInput?aG.input:null,aG.alphaPrecision);var aB=aJ!=null?aJ.hex:null,aH=aD.find(".Preview"),aF=aD.find(".Button");E=aH.find(".Active:first").css({backgroundColor:aB&&"#"+aB||"transparent"});an=aH.find(".Current:first").css({backgroundColor:aB&&"#"+aB||"transparent"}).bind("click",Z);Y.call(w,an,Math.precision(G.current.val("a")*100)/255,4);ah=aF.find(".Ok:first").bind("click",m);X=aF.find(".Cancel:first").bind("click",q);ab=aF.find(".Grid:first");setTimeout(function(){t.call(w,au,n.clientPath+"Maps.png");t.call(w,at,n.clientPath+"Maps.png");t.call(w,ar,n.clientPath+"map-opacity.png");t.call(w,P,n.clientPath+"Bars.png");t.call(w,O,n.clientPath+"Bars.png");t.call(w,N,n.clientPath+"Bars.png");t.call(w,M,n.clientPath+"Bars.png");t.call(w,L,n.clientPath+"bar-opacity.png");t.call(w,K,n.clientPath+"AlphaBar.png");t.call(w,aH.find("div:first"),n.clientPath+"preview-opacity.png")},0);aD.find("td.Radio input").bind("click",A);if(G.quickList&&G.quickList.length>0){var aE="";for(i=0;i<G.quickList.length;i++){if((typeof(G.quickList[i])).toString().toLowerCase()=="string"){G.quickList[i]=new f({hex:G.quickList[i]})}var aC=G.quickList[i].val("a");var aM=G.quickList[i].val("ahex");if(!aG.alphaSupport&&aM){aM=aM.substring(0,6)+"ff"}var aA=G.quickList[i].val("hex");aE+='<span class="QuickColor"'+(aM&&' title="#'+aM+'"'||"")+' style="background-color:'+(aA&&"#"+aA||"")+";"+(aA?"":"background-image:url("+n.clientPath+"NoColor.png)")+(aG.alphaSupport&&aC&&aC<255?";opacity:"+Math.precision(aC/255,4)+";filter:Alpha(opacity="+Math.precision(aC/2.55,4)+")":"")+'"> </span>'}t.call(w,ab,n.clientPath+"bar-opacity.png");ab.html(aE);ab.find(".QuickColor").click(F)}ag.call(w,av.color.mode);G.active.bind(aj);e.isFunction(ad)&&G.active.bind(ad);G.current.bind(ap);if(aG.expandable){w.icon=az.parents(".Icon:first");aq=w.icon.find(".Color:first").css({backgroundColor:aB&&"#"+aB||"transparent"});r=w.icon.find(".Alpha:first");t.call(w,r,n.clientPath+"bar-opacity.png");Y.call(w,r,Math.precision(((255-(aJ!=null?aJ.a:0))*100)/255,4));C=w.icon.find(".Image:first").css({backgroundImage:"url('"+n.clientPath+n.picker.file+"')"}).bind("click",af);if(aG.bindToInput&&aG.updateInputColor){aG.input.css({backgroundColor:aB&&"#"+aB||"transparent",color:aJ==null||aJ.v>75?"#000000":"#ffffff"})}u=aD.find(".Move:first").bind("mousedown",S);G.active.bind(H)}else{V.call(w)}},ak=function(){R.find("td.Radio input").unbind("click",A);an.unbind("click",Z);X.unbind("click",q);ah.unbind("click",m);if(av.window.expandable){C.unbind("click",af);u.unbind("mousedown",S);w.icon=null}R.find(".QuickColor").unbind("click",F);l=null;s=null;au=null;at=null;ar=null;P=null;O=null;N=null;M=null;L=null;K=null;D.destroy();D=null;U.destroy();U=null;aw.destroy();aw=null;E=null;an=null;ah=null;X=null;ab=null;ae=null;ax=null;ad=null;R.html("");for(i=0;i<c.length;i++){if(c[i]==w){c.splice(i,1)}}},n=av.images,aa=av.localization,G={active:(typeof(av.color.active)).toString().toLowerCase()=="string"?new f({ahex:!av.window.alphaSupport&&av.color.active?av.color.active.substring(0,6)+"ff":av.color.active}):new f({ahex:!av.window.alphaSupport&&av.color.active.val("ahex")?av.color.active.val("ahex").substring(0,6)+"ff":av.color.active.val("ahex")}),current:(typeof(av.color.active)).toString().toLowerCase()=="string"?new f({ahex:!av.window.alphaSupport&&av.color.active?av.color.active.substring(0,6)+"ff":av.color.active}):new f({ahex:!av.window.alphaSupport&&av.color.active.val("ahex")?av.color.active.val("ahex").substring(0,6)+"ff":av.color.active.val("ahex")}),quickList:av.color.quickList};e.extend(true,w,{commitCallback:ae,liveCallback:ad,cancelCallback:ax,color:G,show:V,hide:ao,destroy:ak});c.push(w);setTimeout(function(){o.call(w)},0)})};e.fn.jPicker.defaults={window:{title:null,effects:{type:"slide",speed:{show:"fast",hide:"fast"}},position:{x:"screenCenter",y:"top"},expandable:false,liveUpdate:true,alphaSupport:false,alphaPrecision:0,updateInputColor:true},color:{mode:"h",active:new f({ahex:"#ffcc00ff"}),quickList:[new f({h:360,s:33,v:100}),new f({h:360,s:66,v:100}),new f({h:360,s:100,v:100}),new f({h:360,s:100,v:75}),new f({h:360,s:100,v:50}),new f({h:180,s:0,v:100}),new f({h:30,s:33,v:100}),new f({h:30,s:66,v:100}),new f({h:30,s:100,v:100}),new f({h:30,s:100,v:75}),new f({h:30,s:100,v:50}),new f({h:180,s:0,v:90}),new f({h:60,s:33,v:100}),new f({h:60,s:66,v:100}),new f({h:60,s:100,v:100}),new f({h:60,s:100,v:75}),new f({h:60,s:100,v:50}),new f({h:180,s:0,v:80}),new f({h:90,s:33,v:100}),new f({h:90,s:66,v:100}),new f({h:90,s:100,v:100}),new f({h:90,s:100,v:75}),new f({h:90,s:100,v:50}),new f({h:180,s:0,v:70}),new f({h:120,s:33,v:100}),new f({h:120,s:66,v:100}),new f({h:120,s:100,v:100}),new f({h:120,s:100,v:75}),new f({h:120,s:100,v:50}),new f({h:180,s:0,v:60}),new f({h:150,s:33,v:100}),new f({h:150,s:66,v:100}),new f({h:150,s:100,v:100}),new f({h:150,s:100,v:75}),new f({h:150,s:100,v:50}),new f({h:180,s:0,v:50}),new f({h:180,s:33,v:100}),new f({h:180,s:66,v:100}),new f({h:180,s:100,v:100}),new f({h:180,s:100,v:75}),new f({h:180,s:100,v:50}),new f({h:180,s:0,v:40}),new f({h:210,s:33,v:100}),new f({h:210,s:66,v:100}),new f({h:210,s:100,v:100}),new f({h:210,s:100,v:75}),new f({h:210,s:100,v:50}),new f({h:180,s:0,v:30}),new f({h:240,s:33,v:100}),new f({h:240,s:66,v:100}),new f({h:240,s:100,v:100}),new f({h:240,s:100,v:75}),new f({h:240,s:100,v:50}),new f({h:180,s:0,v:20}),new f({h:270,s:33,v:100}),new f({h:270,s:66,v:100}),new f({h:270,s:100,v:100}),new f({h:270,s:100,v:75}),new f({h:270,s:100,v:50}),new f({h:180,s:0,v:10}),new f({h:300,s:33,v:100}),new f({h:300,s:66,v:100}),new f({h:300,s:100,v:100}),new f({h:300,s:100,v:75}),new f({h:300,s:100,v:50}),new f({h:180,s:0,v:0}),new f({h:330,s:33,v:100}),new f({h:330,s:66,v:100}),new f({h:330,s:100,v:100}),new f({h:330,s:100,v:75}),new f({h:330,s:100,v:50}),new f()]},images:{clientPath:jpicker.thispath,colorMap:{width:256,height:256,arrow:{file:"mappoint.gif",width:15,height:15}},colorBar:{width:20,height:256,arrow:{file:"rangearrows.gif",width:20,height:7}},picker:{file:"picker.gif",width:25,height:24}},localization:{text:{title:"Drag Markers To Pick A Color",newColor:"new",currentColor:"current",ok:"OK",cancel:"Cancel"},tooltips:{colors:{newColor:"New Color - Press “OK” To Commit",currentColor:"Click To Revert To Original Color"},buttons:{ok:"Commit To This Color Selection",cancel:"Cancel And Revert To Original Color"},hue:{radio:"Set To “Hue” Color Mode",textbox:"Enter A “Hue” Value (0-360°)"},saturation:{radio:"Set To “Saturation” Color Mode",textbox:"Enter A “Saturation” Value (0-100%)"},value:{radio:"Set To “Value” Color Mode",textbox:"Enter A “Value” Value (0-100%)"},red:{radio:"Set To “Red” Color Mode",textbox:"Enter A “Red” Value (0-255)"},green:{radio:"Set To “Green” Color Mode",textbox:"Enter A “Green” Value (0-255)"},blue:{radio:"Set To “Blue” Color Mode",textbox:"Enter A “Blue” Value (0-255)"},alpha:{radio:"Set To “Alpha” Color Mode",textbox:"Enter A “Alpha” Value (0-100)"},hex:{textbox:"Enter A “Hex” Color Value (#000000-#ffffff)",alpha:"Enter A “Alpha” Value (#00-#ff)"}}}}})(jQuery,"1.1.6");
|
js/libraries/jquery-datepicker/jquery.timepicker.css
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.ui-timepicker-list {
|
2 |
+
overflow-y: auto;
|
3 |
+
height: 150px;
|
4 |
+
width: 6.5em;
|
5 |
+
background: #fff;
|
6 |
+
border: 1px solid #ddd;
|
7 |
+
margin: 0;
|
8 |
+
padding: 0;
|
9 |
+
list-style: none;
|
10 |
+
-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);
|
11 |
+
-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);
|
12 |
+
box-shadow:0 5px 10px rgba(0,0,0,0.2);
|
13 |
+
outline: none;
|
14 |
+
z-index: 10001;
|
15 |
+
}
|
16 |
+
|
17 |
+
.ui-timepicker-list.ui-timepicker-with-duration {
|
18 |
+
width: 11em;
|
19 |
+
}
|
20 |
+
|
21 |
+
.ui-timepicker-duration {
|
22 |
+
margin-left: 5px; color: #888;
|
23 |
+
}
|
24 |
+
|
25 |
+
.ui-timepicker-list:hover .ui-timepicker-duration {
|
26 |
+
color: #888;
|
27 |
+
}
|
28 |
+
|
29 |
+
.ui-timepicker-list li {
|
30 |
+
padding: 3px 0 3px 5px;
|
31 |
+
cursor: pointer;
|
32 |
+
white-space: nowrap;
|
33 |
+
color: #000;
|
34 |
+
list-style: none;
|
35 |
+
margin: 0;
|
36 |
+
}
|
37 |
+
|
38 |
+
.ui-timepicker-list:hover .ui-timepicker-selected {
|
39 |
+
background: #fff; color: #000;
|
40 |
+
}
|
41 |
+
|
42 |
+
li.ui-timepicker-selected,
|
43 |
+
.ui-timepicker-list li:hover,
|
44 |
+
.ui-timepicker-list:hover .ui-timepicker-selected:hover {
|
45 |
+
background: #1980EC; color: #fff;
|
46 |
+
}
|
47 |
+
|
48 |
+
li.ui-timepicker-selected .ui-timepicker-duration,
|
49 |
+
.ui-timepicker-list li:hover .ui-timepicker-duration {
|
50 |
+
color: #ccc;
|
51 |
+
}
|
js/libraries/jquery-datepicker/jquery.timepicker.js
ADDED
@@ -0,0 +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 |
+
}));
|
js/libraries/jquery-datepicker/jquery.timepicker.min.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
+
(function(e){typeof define=="function"&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function o(t){var r=t.data("timepicker-settings"),i=t.data("timepicker-list");i&&i.length&&(i.remove(),t.data("timepicker-list",!1)),i=e("<ul />",{tabindex:-1,"class":"ui-timepicker-list"}),r.className&&i.addClass(r.className),i.css({display:"none",position:"absolute"}),(r.minTime!==null||r.durationTime!==null)&&r.showDuration&&i.addClass("ui-timepicker-with-duration");var s=r.durationTime!==null?r.durationTime:r.minTime,o=r.minTime!==null?r.minTime:0,u=r.maxTime!==null?r.maxTime:o+n-1;u<=o&&(u+=n);for(var a=o;a<=u;a+=r.step*60){var f=a%n,l=e("<li />");l.data("time",f),l.text(m(f,r.timeFormat));if((r.minTime!==null||r.durationTime!==null)&&r.showDuration){var h=e("<span />");h.addClass("ui-timepicker-duration"),h.text(" ("+v(a-s)+")"),l.append(h)}i.append(l)}i.data("timepicker-input",t),t.data("timepicker-list",i);var p=r.appendTo;typeof p=="string"?p=e(p):typeof p=="function"&&(p=p(t)),p.append(i),c(t,i),i.on("click","li",function(n){t.addClass("ui-timepicker-hideme"),t[0].focus(),i.find("li").removeClass("ui-timepicker-selected"),e(this).addClass("ui-timepicker-selected"),d(t),i.hide()})}function u(){var e=new Date,t=e.getTimezoneOffset()*6e4;e.setHours(0),e.setMinutes(0),e.setSeconds(0);var n=e.getTimezoneOffset()*6e4;return new Date(e.valueOf()-n+t)}function a(){"ontouchstart"in document?e("body").on("touchstart.ui-timepicker",f):(e("body").on("mousedown.ui-timepicker",f),e(window).on("scroll.ui-timepicker",f))}function f(t){var n=e(t.target),r=n.closest(".ui-timepicker-input");r.length===0&&n.closest(".ui-timepicker-list").length===0&&s.hide(),e("body").unbind(".ui-timepicker"),e(window).unbind(".ui-timepicker")}function l(t,n,r){if(!r&&r!==0)return!1;var i=t.data("timepicker-settings"),s=!1,o=i.step*30;return n.find("li").each(function(t,n){var i=e(n),u=i.data("time")-r;if(Math.abs(u)<o||u==o)return s=i,!1}),s}function c(e,t){var n=g(e.val()),r=l(e,t,n);r&&r.addClass("ui-timepicker-selected")}function h(){if(this.value==="")return;var t=e(this),n=g(this.value);if(n===null){t.trigger("timeFormatError");return}var r=t.data("timepicker-settings");if(r.forceRoundTime){var i=n%(r.step*60);i>=r.step*30?n+=r.step*60-i:n-=i}var s=m(n,r.timeFormat);t.val(s)}function p(t){var n=e(this),r=n.data("timepicker-list");if(!r.is(":visible")){if(t.keyCode!=40)return!0;n.focus()}switch(t.keyCode){case 13:return d(n),s.hide.apply(this),t.preventDefault(),!1;case 38:var i=r.find(".ui-timepicker-selected");i.length?i.is(":first-child")||(i.removeClass("ui-timepicker-selected"),i.prev().addClass("ui-timepicker-selected"),i.prev().position().top<i.outerHeight()&&r.scrollTop(r.scrollTop()-i.outerHeight())):(r.children().each(function(t,n){if(e(n).position().top>0)return i=e(n),!1}),i.addClass("ui-timepicker-selected"));break;case 40:i=r.find(".ui-timepicker-selected"),i.length===0?(r.children().each(function(t,n){if(e(n).position().top>0)return i=e(n),!1}),i.addClass("ui-timepicker-selected")):i.is(":last-child")||(i.removeClass("ui-timepicker-selected"),i.next().addClass("ui-timepicker-selected"),i.next().position().top+2*i.outerHeight()>r.outerHeight()&&r.scrollTop(r.scrollTop()+i.outerHeight()));break;case 27:r.find("li").removeClass("ui-timepicker-selected"),r.hide();break;case 9:s.hide();break;case 16:case 17:case 18:case 19:case 20:case 33:case 34:case 35:case 36:case 37:case 39:case 45:return;default:r.find("li").removeClass("ui-timepicker-selected");return}}function d(e){var t=e.data("timepicker-settings"),n=e.data("timepicker-list"),r=null,i=n.find(".ui-timepicker-selected");i.length?r=i.data("time"):e.val()&&(r=g(e.val()),c(e,n));if(r!==null){var s=m(r,t.timeFormat);e.val(s)}e.trigger("change").trigger("changeTime")}function v(e){var t=Math.round(e/60),n;if(Math.abs(t)<60)n=[t,i.mins];else if(t==60)n=["1",i.hr];else{var r=(t/60).toFixed(1);i.decimal!="."&&(r=r.replace(".",i.decimal)),n=[r,i.hrs]}return n.join(" ")}function m(e,n){if(e===null)return;var r=new Date(t.valueOf()+e*1e3),i="",s,o;for(var u=0;u<n.length;u++){o=n.charAt(u);switch(o){case"a":i+=r.getHours()>11?"pm":"am";break;case"A":i+=r.getHours()>11?"PM":"AM";break;case"g":s=r.getHours()%12,i+=s===0?"12":s;break;case"G":i+=r.getHours();break;case"h":s=r.getHours()%12,s!==0&&s<10&&(s="0"+s),i+=s===0?"12":s;break;case"H":s=r.getHours(),i+=s>9?s:"0"+s;break;case"i":var a=r.getMinutes();i+=a>9?a:"0"+a;break;case"s":e=r.getSeconds(),i+=e>9?e:"0"+e;break;default:i+=o}}return i}function g(e){if(e==="")return null;if(e+0==e)return e;typeof e=="object"&&(e=e.getHours()+":"+e.getMinutes()+":"+e.getSeconds());var t=new Date(0),n=e.toLowerCase().match(/(\d{1,2})(?::(\d{1,2}))?(?::(\d{2}))?\s*([pa]?)/);if(!n)return null;var r=parseInt(n[1]*1,10),i;n[4]?r==12?i=n[4]=="p"?12:0:i=r+(n[4]=="p"?12:0):i=r;var s=n[2]*1||0,o=n[3]*1||0;return i*3600+s*60+o}var t=u(),n=86400,r={className:null,minTime:null,maxTime:null,durationTime:null,step:30,showDuration:!1,timeFormat:"g:ia",scrollDefaultNow:!1,scrollDefaultTime:!1,selectOnBlur:!1,forceRoundTime:!1,appendTo:"body"},i={decimal:".",mins:"mins",hr:"hr",hrs:"hrs"},s={init:function(t){return this.each(function(){var n=e(this);if(n[0].tagName=="SELECT"){var o={type:"text",value:n.val()},u=n[0].attributes;for(var a=0;a<u.length;a++)o[u[a].nodeName]=u[a].nodeValue;var f=e("<input />",o);n.replaceWith(f),n=f}var l=e.extend({},r);t&&(l=e.extend(l,t)),l.minTime&&(l.minTime=g(l.minTime)),l.maxTime&&(l.maxTime=g(l.maxTime)),l.durationTime&&(l.durationTime=g(l.durationTime)),l.lang&&(i=e.extend(i,l.lang)),n.data("timepicker-settings",l),n.prop("autocomplete","off"),n.on("click.timepicker focus.timepicker",s.show),n.on("blur.timepicker",h),n.on("keydown.timepicker",p),n.addClass("ui-timepicker-input"),h.call(n.get(0))})},show:function(t){var n=e(this);"ontouchstart"in document&&n.blur();var r=n.data("timepicker-list");if(n.prop("readonly"))return;if(!r||r.length===0)o(n),r=n.data("timepicker-list");if(n.hasClass("ui-timepicker-hideme")){n.removeClass("ui-timepicker-hideme"),r.hide();return}if(r.is(":visible"))return;s.hide(),n.offset().top+n.outerHeight(!0)+r.outerHeight()>e(window).height()+e(window).scrollTop()?r.css({left:n.offset().left,top:n.offset().top-r.outerHeight()}):r.css({left:n.offset().left,top:n.offset().top+n.outerHeight()}),r.show();var i=n.data("timepicker-settings"),u=r.find(".ui-timepicker-selected");u.length||(n.val()?u=l(n,r,g(n.val())):i.scrollDefaultNow?u=l(n,r,g(new Date)):i.scrollDefaultTime!==!1&&(u=l(n,r,g(i.scrollDefaultTime))));if(u&&u.length){var f=r.scrollTop()+u.position().top-u.outerHeight();r.scrollTop(f)}else r.scrollTop(0);a(),n.trigger("showTimepicker")},hide:function(t){e(".ui-timepicker-list:visible").each(function(){var t=e(this),n=t.data("timepicker-input"),r=n.data("timepicker-settings");r&&r.selectOnBlur&&d(n),t.hide(),n.trigger("hideTimepicker")})},option:function(t,n){var r=e(this),i=r.data("timepicker-settings"),s=r.data("timepicker-list");if(typeof t=="object")i=e.extend(i,t);else if(typeof t=="string"&&typeof n!="undefined")i[t]=n;else if(typeof t=="string")return i[t];i.minTime&&(i.minTime=g(i.minTime)),i.maxTime&&(i.maxTime=g(i.maxTime)),i.durationTime&&(i.durationTime=g(i.durationTime)),r.data("timepicker-settings",i),s&&(s.remove(),r.data("timepicker-list",!1))},getSecondsFromMidnight:function(){return g(e(this).val())},getTime:function(){return new Date(t.valueOf()+g(e(this).val())*1e3)},setTime:function(t){var n=e(this),r=m(g(t),n.data("timepicker-settings").timeFormat);n.val(r)},remove:function(){var t=e(this);if(!t.hasClass("ui-timepicker-input"))return;t.removeAttr("autocomplete","off"),t.removeClass("ui-timepicker-input"),t.removeData("timepicker-settings"),t.off(".timepicker"),t.data("timepicker-list")&&t.data("timepicker-list").remove(),t.removeData("timepicker-list")}};e.fn.timepicker=function(t){if(s[t])return s[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return s.init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery.timepicker")}});
|
3 |
+
});
|
js/libraries/jquery-datepicker/lib/base.css
ADDED
@@ -0,0 +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; }
|
js/libraries/jquery-datepicker/lib/base.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Rainbow v1.1.8 rainbowco.de | included languages: generic, javascript */
|
2 |
+
window.Rainbow=function(){function q(a){var b,c=a.getAttribute&&a.getAttribute("data-language")||0;if(!c){a=a.attributes;for(b=0;b<a.length;++b)if("data-language"===a[b].nodeName)return a[b].nodeValue}return c}function B(a){var b=q(a)||q(a.parentNode);if(!b){var c=/\blang(?:uage)?-(\w+)/;(a=a.className.match(c)||a.parentNode.className.match(c))&&(b=a[1])}return b}function C(a,b){for(var c in e[d]){c=parseInt(c,10);if(a==c&&b==e[d][c]?0:a<=c&&b>=e[d][c])delete e[d][c],delete j[d][c];if(a>=c&&a<e[d][c]||
|
3 |
+
b>c&&b<e[d][c])return!0}return!1}function r(a,b){return'<span class="'+a.replace(/\./g," ")+(l?" "+l:"")+'">'+b+"</span>"}function s(a,b,c,h){var f=a.exec(c);if(f){++t;!b.name&&"string"==typeof b.matches[0]&&(b.name=b.matches[0],delete b.matches[0]);var k=f[0],i=f.index,u=f[0].length+i,g=function(){function f(){s(a,b,c,h)}t%100>0?f():setTimeout(f,0)};if(C(i,u))g();else{var m=v(b.matches),l=function(a,c,h){if(a>=c.length)h(k);else{var d=f[c[a]];if(d){var e=b.matches[c[a]],i=e.language,g=e.name&&e.matches?
|
4 |
+
e.matches:e,j=function(b,d,e){var i;i=0;var g;for(g=1;g<c[a];++g)f[g]&&(i=i+f[g].length);d=e?r(e,d):d;k=k.substr(0,i)+k.substr(i).replace(b,d);l(++a,c,h)};i?n(d,i,function(a){j(d,a)}):typeof e==="string"?j(d,d,e):w(d,g.length?g:[g],function(a){j(d,a,e.matches?e.name:0)})}else l(++a,c,h)}};l(0,m,function(a){b.name&&(a=r(b.name,a));if(!j[d]){j[d]={};e[d]={}}j[d][i]={replace:f[0],"with":a};e[d][i]=u;g()})}}else h()}function v(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b.sort(function(a,
|
5 |
+
b){return b-a})}function w(a,b,c){function h(b,k){k<b.length?s(b[k].pattern,b[k],a,function(){h(b,++k)}):D(a,function(a){delete j[d];delete e[d];--d;c(a)})}++d;h(b,0)}function D(a,b){function c(a,b,h,e){if(h<b.length){++x;var g=b[h],l=j[d][g],a=a.substr(0,g)+a.substr(g).replace(l.replace,l["with"]),g=function(){c(a,b,++h,e)};0<x%250?g():setTimeout(g,0)}else e(a)}var h=v(j[d]);c(a,h,0,b)}function n(a,b,c){var d=m[b]||[],f=m[y]||[],b=z[b]?d:d.concat(f);w(a.replace(/</g,"<").replace(/>/g,">").replace(/&(?![\w\#]+;)/g,
|
6 |
+
"&"),b,c)}function o(a,b,c){if(b<a.length){var d=a[b],f=B(d);return!(-1<(" "+d.className+" ").indexOf(" rainbow "))&&f?(f=f.toLowerCase(),d.className+=d.className?" rainbow":"rainbow",n(d.innerHTML,f,function(k){d.innerHTML=k;j={};e={};p&&p(d,f);setTimeout(function(){o(a,++b,c)},0)})):o(a,++b,c)}c&&c()}function A(a,b){var a=a&&"function"==typeof a.getElementsByTagName?a:document,c=a.getElementsByTagName("pre"),d=a.getElementsByTagName("code"),f,e=[];for(f=0;f<d.length;++f)e.push(d[f]);for(f=0;f<
|
7 |
+
c.length;++f)c[f].getElementsByTagName("code").length||e.push(c[f]);o(e,0,b)}var j={},e={},m={},z={},d=0,y=0,t=0,x=0,l,p;return{extend:function(a,b,c){1==arguments.length&&(b=a,a=y);z[a]=c;m[a]=b.concat(m[a]||[])},b:function(a){p=a},a:function(a){l=a},color:function(a,b,c){if("string"==typeof a)return n(a,b,c);if("function"==typeof a)return A(0,a);A(a,b)}}}();window.addEventListener?window.addEventListener("load",Rainbow.color,!1):window.attachEvent("onload",Rainbow.color);Rainbow.onHighlight=Rainbow.b;
|
8 |
+
Rainbow.addClass=Rainbow.a;Rainbow.extend([{matches:{1:{name:"keyword.operator",pattern:/\=/g},2:{name:"string",matches:{name:"constant.character.escape",pattern:/\\('|"){1}/g}}},pattern:/(\(|\s|\[|\=|:)(('|")([^\\\1]|\\.)*?(\3))/gm},{name:"comment",pattern:/\/\*[\s\S]*?\*\/|(\/\/|\#)[\s\S]*?$/gm},{name:"constant.numeric",pattern:/\b(\d+(\.\d+)?(e(\+|\-)?\d+)?(f|d)?|0x[\da-f]+)\b/gi},{matches:{1:"keyword"},pattern:/\b(and|array|as|bool(ean)?|c(atch|har|lass|onst)|d(ef|elete|o(uble)?)|e(cho|lse(if)?|xit|xtends|xcept)|f(inally|loat|or(each)?|unction)|global|if|import|int(eger)?|long|new|object|or|pr(int|ivate|otected)|public|return|self|st(ring|ruct|atic)|switch|th(en|is|row)|try|(un)?signed|var|void|while)(?=\(|\b)/gi},
|
9 |
+
{name:"constant.language",pattern:/true|false|null/g},{name:"keyword.operator",pattern:/\+|\!|\-|&(gt|lt|amp);|\||\*|\=/g},{matches:{1:"function.call"},pattern:/(\w+?)(?=\()/g},{matches:{1:"storage.function",2:"entity.name.function"},pattern:/(function)\s(.*?)(?=\()/g}]);Rainbow.extend("javascript",[{name:"selector",pattern:/(\s|^)\$(?=\.|\()/g},{name:"support",pattern:/\b(window|document)\b/g},{matches:{1:"support.property"},pattern:/\.(length|node(Name|Value))\b/g},{matches:{1:"support.function"},pattern:/(setTimeout|setInterval)(?=\()/g},{matches:{1:"support.method"},pattern:/\.(getAttribute|push|getElementById|getElementsByClassName|log|setTimeout|setInterval)(?=\()/g},{matches:{1:"support.tag.script",2:[{name:"string",pattern:/('|")(.*?)(\1)/g},{name:"entity.tag.script",
|
10 |
+
pattern:/(\w+)/g}],3:"support.tag.script"},pattern:/(<\/?)(script.*?)(>)/g},{name:"string.regexp",matches:{1:"string.regexp.open",2:{name:"constant.regexp.escape",pattern:/\\(.){1}/g},3:"string.regexp.close",4:"string.regexp.modifier"},pattern:/(\/)(?!\*)(.+)(\/)([igm]{0,3})/g},{matches:{1:"storage",3:"entity.function"},pattern:/(var)?(\s|^)(.*)(?=\s?=\s?function\()/g},{name:"entity.function",pattern:/(\w+)(?=:\s{0,}function)/g}]);
|
11 |
+
|
12 |
+
|
13 |
+
// https://github.com/eternicode/bootstrap-datepicker
|
14 |
+
!function(a){function b(){return new Date(Date.UTC.apply(Date,arguments))}var d=function(b,c){var d=this;switch(this.element=a(b),this.language=c.language||this.element.data("date-language")||"en",this.language=this.language in e?this.language:"en",this.format=f.parseFormat(c.format||this.element.data("date-format")||"mm/dd/yyyy"),this.picker=a(f.template).appendTo("body").on({click:a.proxy(this.click,this)}),this.isInput=this.element.is("input"),this.component=this.element.is(".date")?this.element.find(".add-on"):!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this._attachEvents(),this.forceParse=!0,"forceParse"in c?this.forceParse=c.forceParse:"dateForceParse"in this.element.data()&&(this.forceParse=this.element.data("date-force-parse")),a(document).on("mousedown",function(b){0==a(b.target).closest(".datepicker").length&&d.hide()}),this.autoclose=!1,"autoclose"in c?this.autoclose=c.autoclose:"dateAutoclose"in this.element.data()&&(this.autoclose=this.element.data("date-autoclose")),this.keyboardNavigation=!0,"keyboardNavigation"in c?this.keyboardNavigation=c.keyboardNavigation:"dateKeyboardNavigation"in this.element.data()&&(this.keyboardNavigation=this.element.data("date-keyboard-navigation")),c.startView||this.element.data("date-start-view")){case 2:case"decade":this.viewMode=this.startViewMode=2;break;case 1:case"year":this.viewMode=this.startViewMode=1;break;case 0:case"month":default:this.viewMode=this.startViewMode=0}this.todayBtn=c.todayBtn||this.element.data("date-today-btn")||!1,this.todayHighlight=c.todayHighlight||this.element.data("date-today-highlight")||!1,this.weekStart=(c.weekStart||this.element.data("date-weekstart")||e[this.language].weekStart||0)%7,this.weekEnd=(this.weekStart+6)%7,this.startDate=-1/0,this.endDate=1/0,this.daysOfWeekDisabled=[],this.setStartDate(c.startDate||this.element.data("date-startdate")),this.setEndDate(c.endDate||this.element.data("date-enddate")),this.setDaysOfWeekDisabled(c.daysOfWeekDisabled||this.element.data("date-days-of-week-disabled")),this.fillDow(),this.fillMonths(),this.update(),this.showMode()};d.prototype={constructor:d,_events:[],_attachEvents:function(){this._detachEvents(),this._events=this.isInput?[[this.element,{focus:a.proxy(this.show,this),keyup:a.proxy(this.update,this),keydown:a.proxy(this.keydown,this)}]]:this.component&&this.hasInput?[[this.element.find("input"),{focus:a.proxy(this.show,this),keyup:a.proxy(this.update,this),keydown:a.proxy(this.keydown,this)}],[this.component,{click:a.proxy(this.show,this)}]]:[[this.element,{click:a.proxy(this.show,this)}]];for(var c,d,b=0;this._events.length>b;b++)c=this._events[b][0],d=this._events[b][1],c.on(d)},_detachEvents:function(){for(var b,c,a=0;this._events.length>a;a++)b=this._events[a][0],c=this._events[a][1],b.off(c);this._events=[]},show:function(b){this.picker.show(),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.update(),this.place(),a(window).on("resize",a.proxy(this.place,this)),b&&(b.stopPropagation(),b.preventDefault()),this.element.trigger({type:"show",date:this.date})},hide:function(){this.picker.hide(),a(window).off("resize",this.place),this.viewMode=this.startViewMode,this.showMode(),this.isInput||a(document).off("mousedown",this.hide),this.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this.element.trigger({type:"hide",date:this.date})},remove:function(){this._detachEvents(),this.picker.remove(),delete this.element.data().datepicker},getDate:function(){var a=this.getUTCDate();return new Date(a.getTime()+6e4*a.getTimezoneOffset())},getUTCDate:function(){return this.date},setDate:function(a){this.setUTCDate(new Date(a.getTime()-6e4*a.getTimezoneOffset()))},setUTCDate:function(a){this.date=a,this.setValue()},setValue:function(){var a=f.formatDate(this.date,this.format,this.language);this.isInput?this.element.prop("value",a):(this.component&&this.element.find("input").prop("value",a),this.element.data("date",a))},setStartDate:function(a){this.startDate=a||-1/0,this.startDate!==-1/0&&(this.startDate=f.parseDate(this.startDate,this.format,this.language)),this.update(),this.updateNavArrows()},setEndDate:function(a){this.endDate=a||1/0,1/0!==this.endDate&&(this.endDate=f.parseDate(this.endDate,this.format,this.language)),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(b){this.daysOfWeekDisabled=b||[],a.isArray(this.daysOfWeekDisabled)||(this.daysOfWeekDisabled=this.daysOfWeekDisabled.split(/,\s*/)),this.daysOfWeekDisabled=a.map(this.daysOfWeekDisabled,function(a){return parseInt(a,10)}),this.update(),this.updateNavArrows()},place:function(){var b=parseInt(this.element.parents().filter(function(){return"auto"!=a(this).css("z-index")}).first().css("z-index"))+10,c=this.component?this.component.offset():this.element.offset();this.picker.css({top:c.top+this.height,left:c.left,zIndex:b})},update:function(){this.date=f.parseDate(this.isInput?this.element.prop("value"):this.element.data("date")||this.element.find("input").prop("value"),this.format,this.language),this.viewDate=this.date<this.startDate?new Date(this.startDate):this.date>this.endDate?new Date(this.endDate):new Date(this.date),this.fill()},fillDow:function(){for(var a=this.weekStart,b="<tr>";this.weekStart+7>a;)b+='<th class="dow">'+e[this.language].daysMin[a++%7]+"</th>";b+="</tr>",this.picker.find(".datepicker-days thead").append(b)},fillMonths:function(){for(var a="",b=0;12>b;)a+='<span class="month">'+e[this.language].monthsShort[b++]+"</span>";this.picker.find(".datepicker-months td").html(a)},fill:function(){var c=new Date(this.viewDate),d=c.getUTCFullYear(),g=c.getUTCMonth(),h=this.startDate!==-1/0?this.startDate.getUTCFullYear():-1/0,i=this.startDate!==-1/0?this.startDate.getUTCMonth():-1/0,j=1/0!==this.endDate?this.endDate.getUTCFullYear():1/0,k=1/0!==this.endDate?this.endDate.getUTCMonth():1/0,l=this.date.valueOf(),m=new Date;this.picker.find(".datepicker-days thead th:eq(1)").text(e[this.language].months[g]+" "+d),this.picker.find("tfoot th.today").text(e[this.language].today).toggle(this.todayBtn!==!1),this.updateNavArrows(),this.fillMonths();var n=b(d,g-1,28,0,0,0,0),o=f.getDaysInMonth(n.getUTCFullYear(),n.getUTCMonth());n.setUTCDate(o),n.setUTCDate(o-(n.getUTCDay()-this.weekStart+7)%7);var p=new Date(n);p.setUTCDate(p.getUTCDate()+42),p=p.valueOf();for(var r,q=[];p>n.valueOf();)n.getUTCDay()==this.weekStart&&q.push("<tr>"),r="",d>n.getUTCFullYear()||n.getUTCFullYear()==d&&g>n.getUTCMonth()?r+=" old":(n.getUTCFullYear()>d||n.getUTCFullYear()==d&&n.getUTCMonth()>g)&&(r+=" new"),this.todayHighlight&&n.getUTCFullYear()==m.getFullYear()&&n.getUTCMonth()==m.getMonth()&&n.getUTCDate()==m.getDate()&&(r+=" today"),n.valueOf()==l&&(r+=" active"),(n.valueOf()<this.startDate||n.valueOf()>this.endDate||-1!==a.inArray(n.getUTCDay(),this.daysOfWeekDisabled))&&(r+=" disabled"),q.push('<td class="day'+r+'">'+n.getUTCDate()+"</td>"),n.getUTCDay()==this.weekEnd&&q.push("</tr>"),n.setUTCDate(n.getUTCDate()+1);this.picker.find(".datepicker-days tbody").empty().append(q.join(""));var s=this.date.getUTCFullYear(),t=this.picker.find(".datepicker-months").find("th:eq(1)").text(d).end().find("span").removeClass("active");s==d&&t.eq(this.date.getUTCMonth()).addClass("active"),(h>d||d>j)&&t.addClass("disabled"),d==h&&t.slice(0,i).addClass("disabled"),d==j&&t.slice(k+1).addClass("disabled"),q="",d=10*parseInt(d/10,10);var u=this.picker.find(".datepicker-years").find("th:eq(1)").text(d+"-"+(d+9)).end().find("td");d-=1;for(var v=-1;11>v;v++)q+='<span class="year'+(-1==v||10==v?" old":"")+(s==d?" active":"")+(h>d||d>j?" disabled":"")+'">'+d+"</span>",d+=1;u.html(q)},updateNavArrows:function(){var a=new Date(this.viewDate),b=a.getUTCFullYear(),c=a.getUTCMonth();switch(this.viewMode){case 0:this.startDate!==-1/0&&this.startDate.getUTCFullYear()>=b&&this.startDate.getUTCMonth()>=c?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.endDate&&b>=this.endDate.getUTCFullYear()&&c>=this.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.startDate!==-1/0&&this.startDate.getUTCFullYear()>=b?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.endDate&&b>=this.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}},click:function(c){c.stopPropagation(),c.preventDefault();var d=a(c.target).closest("span, td, th");if(1==d.length)switch(d[0].nodeName.toLowerCase()){case"th":switch(d[0].className){case"switch":this.showMode(1);break;case"prev":case"next":var e=f.modes[this.viewMode].navStep*("prev"==d[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,e);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,e)}this.fill();break;case"today":var g=new Date;g.setUTCHours(0),g.setUTCMinutes(0),g.setUTCSeconds(0),g.setUTCMilliseconds(0),this.showMode(-2);var h="linked"==this.todayBtn?null:"view";this._setDate(g,h)}break;case"span":if(!d.is(".disabled")){if(this.viewDate.setUTCDate(1),d.is(".month")){var i=d.parent().find("span").index(d);this.viewDate.setUTCMonth(i),this.element.trigger({type:"changeMonth",date:this.viewDate})}else{var j=parseInt(d.text(),10)||0;this.viewDate.setUTCFullYear(j),this.element.trigger({type:"changeYear",date:this.viewDate})}this.showMode(-1),this.fill()}break;case"td":if(d.is(".day")&&!d.is(".disabled")){var k=parseInt(d.text(),10)||1,j=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth();d.is(".old")?0==i?(i=11,j-=1):i-=1:d.is(".new")&&(11==i?(i=0,j+=1):i+=1),this._setDate(b(j,i,k,0,0,0,0))}}},_setDate:function(a,b){b&&"date"!=b||(this.date=a),b&&"view"!=b||(this.viewDate=a),this.fill(),this.setValue(),this.element.trigger({type:"changeDate",date:this.date});var c;this.isInput?c=this.element:this.component&&(c=this.element.find("input")),c&&(c.change(),this.autoclose&&this.hide())},moveMonth:function(a,b){if(!b)return a;var g,h,c=new Date(a.valueOf()),d=c.getUTCDate(),e=c.getUTCMonth(),f=Math.abs(b);if(b=b>0?1:-1,1==f)h=-1==b?function(){return c.getUTCMonth()==e}:function(){return c.getUTCMonth()!=g},g=e+b,c.setUTCMonth(g),(0>g||g>11)&&(g=(g+12)%12);else{for(var i=0;f>i;i++)c=this.moveMonth(c,b);g=c.getUTCMonth(),c.setUTCDate(d),h=function(){return g!=c.getUTCMonth()}}for(;h();)c.setUTCDate(--d),c.setUTCMonth(g);return c},moveYear:function(a,b){return this.moveMonth(a,12*b)},dateWithinRange:function(a){return a>=this.startDate&&this.endDate>=a},keydown:function(a){if(this.picker.is(":not(:visible)"))return 27==a.keyCode&&this.show(),void 0;var c,f,g,b=!1;switch(a.keyCode){case 27:this.hide(),a.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation)break;c=37==a.keyCode?-1:1,a.ctrlKey?(f=this.moveYear(this.date,c),g=this.moveYear(this.viewDate,c)):a.shiftKey?(f=this.moveMonth(this.date,c),g=this.moveMonth(this.viewDate,c)):(f=new Date(this.date),f.setUTCDate(this.date.getUTCDate()+c),g=new Date(this.viewDate),g.setUTCDate(this.viewDate.getUTCDate()+c)),this.dateWithinRange(f)&&(this.date=f,this.viewDate=g,this.setValue(),this.update(),a.preventDefault(),b=!0);break;case 38:case 40:if(!this.keyboardNavigation)break;c=38==a.keyCode?-1:1,a.ctrlKey?(f=this.moveYear(this.date,c),g=this.moveYear(this.viewDate,c)):a.shiftKey?(f=this.moveMonth(this.date,c),g=this.moveMonth(this.viewDate,c)):(f=new Date(this.date),f.setUTCDate(this.date.getUTCDate()+7*c),g=new Date(this.viewDate),g.setUTCDate(this.viewDate.getUTCDate()+7*c)),this.dateWithinRange(f)&&(this.date=f,this.viewDate=g,this.setValue(),this.update(),a.preventDefault(),b=!0);break;case 13:this.hide(),a.preventDefault();break;case 9:this.hide()}if(b){this.element.trigger({type:"changeDate",date:this.date});var h;this.isInput?h=this.element:this.component&&(h=this.element.find("input")),h&&h.change()}},showMode:function(a){a&&(this.viewMode=Math.max(0,Math.min(2,this.viewMode+a))),this.picker.find(">div").hide().filter(".datepicker-"+f.modes[this.viewMode].clsName).show(),this.updateNavArrows()}},a.fn.datepicker=function(b){var c=Array.apply(null,arguments);return c.shift(),this.each(function(){var e=a(this),f=e.data("datepicker"),g="object"==typeof b&&b;f||e.data("datepicker",f=new d(this,a.extend({},a.fn.datepicker.defaults,g))),"string"==typeof b&&"function"==typeof f[b]&&f[b].apply(f,c)})},a.fn.datepicker.defaults={},a.fn.datepicker.Constructor=d;var e=a.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today"}},f={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(a){return 0===a%4&&0!==a%100||0===a%400},getDaysInMonth:function(a,b){return[31,f.isLeapYear(a)?29:28,31,30,31,30,31,31,30,31,30,31][b]},validParts:/dd?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[-`{-~\t\n\r]+/g,parseFormat:function(a){var b=a.replace(this.validParts,"\0").split("\0"),c=a.match(this.validParts);if(!b||!b.length||!c||0==c.length)throw Error("Invalid date format.");return{separators:b,parts:c}},parseDate:function(c,f,g){if(c instanceof Date)return c;if(/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(c)){var j,k,h=/([-+]\d+)([dmwy])/,i=c.match(/([-+]\d+)([dmwy])/g);c=new Date;for(var l=0;i.length>l;l++)switch(j=h.exec(i[l]),k=parseInt(j[1]),j[2]){case"d":c.setUTCDate(c.getUTCDate()+k);break;case"m":c=d.prototype.moveMonth.call(d.prototype,c,k);break;case"w":c.setUTCDate(c.getUTCDate()+7*k);break;case"y":c=d.prototype.moveYear.call(d.prototype,c,k)}return b(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate(),0,0,0)}var p,q,j,i=c&&c.match(this.nonpunctuation)||[],c=new Date,m={},n=["yyyy","yy","M","MM","m","mm","d","dd"],o={yyyy:function(a,b){return a.setUTCFullYear(b)},yy:function(a,b){return a.setUTCFullYear(2e3+b)},m:function(a,b){for(b-=1;0>b;)b+=12;for(b%=12,a.setUTCMonth(b);a.getUTCMonth()!=b;)a.setUTCDate(a.getUTCDate()-1);return a},d:function(a,b){return a.setUTCDate(b)}};if(o.M=o.MM=o.mm=o.m,o.dd=o.d,c=b(c.getFullYear(),c.getMonth(),c.getDate(),0,0,0),i.length==f.parts.length){for(var l=0,r=f.parts.length;r>l;l++){if(p=parseInt(i[l],10),j=f.parts[l],isNaN(p))switch(j){case"MM":q=a(e[g].months).filter(function(){var a=this.slice(0,i[l].length),b=i[l].slice(0,a.length);return a==b}),p=a.inArray(q[0],e[g].months)+1;break;case"M":q=a(e[g].monthsShort).filter(function(){var a=this.slice(0,i[l].length),b=i[l].slice(0,a.length);return a==b}),p=a.inArray(q[0],e[g].monthsShort)+1}m[j]=p}for(var s,l=0;n.length>l;l++)s=n[l],s in m&&!isNaN(m[s])&&o[s](c,m[s])}return c},formatDate:function(b,c,d){var f={d:b.getUTCDate(),m:b.getUTCMonth()+1,M:e[d].monthsShort[b.getUTCMonth()],MM:e[d].months[b.getUTCMonth()],yy:(""+b.getUTCFullYear()).substring(2),yyyy:b.getUTCFullYear()};f.dd=(10>f.d?"0":"")+f.d,f.mm=(10>f.m?"0":"")+f.m;for(var b=[],g=a.extend([],c.separators),h=0,i=c.parts.length;i>h;h++)g.length&&b.push(g.shift()),b.push(f[c.parts[h]]);return b.join("")},headTemplate:'<thead><tr><th class="prev"><i class="icon-arrow-left"/></th><th colspan="5" class="switch"></th><th class="next"><i class="icon-arrow-right"/></th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr></tfoot>'};f.template='<div class="datepicker dropdown-menu"><div class="datepicker-days"><table class=" table-condensed">'+f.headTemplate+"<tbody></tbody>"+f.footTemplate+"</table>"+"</div>"+'<div class="datepicker-months">'+'<table class="table-condensed">'+f.headTemplate+f.contTemplate+f.footTemplate+"</table>"+"</div>"+'<div class="datepicker-years">'+'<table class="table-condensed">'+f.headTemplate+f.contTemplate+f.footTemplate+"</table>"+"</div>"+"</div>"}(window.jQuery);
|
js/libraries/jquery-datepicker/lib/datepair.js
ADDED
@@ -0,0 +1,204 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
+
$(function() {
|
3 |
+
|
4 |
+
var DATE_FORMAT = 'Y-m-d';
|
5 |
+
var DATEPICKER_FORMAT = 'yyyy-m-d';
|
6 |
+
|
7 |
+
$('.datepair input.date').each(function(){
|
8 |
+
var $this = $(this);
|
9 |
+
$this.datepicker({
|
10 |
+
'format': DATEPICKER_FORMAT,
|
11 |
+
'autoclose': true
|
12 |
+
});
|
13 |
+
|
14 |
+
if ($this.hasClass('start') || $this.hasClass('end')) {
|
15 |
+
$this.on('changeDate change', doDatepair);
|
16 |
+
}
|
17 |
+
|
18 |
+
});
|
19 |
+
|
20 |
+
$('.datepair input.time').each(function() {
|
21 |
+
var $this = $(this);
|
22 |
+
var opts = { 'showDuration': true, 'timeFormat': 'g:ia', 'scrollDefaultNow': true };
|
23 |
+
|
24 |
+
if ($this.hasClass('start') || $this.hasClass('end')) {
|
25 |
+
opts.onSelect = doDatepair;
|
26 |
+
}
|
27 |
+
|
28 |
+
$this.timepicker(opts);
|
29 |
+
});
|
30 |
+
|
31 |
+
$('.datepair').each(initDatepair);
|
32 |
+
|
33 |
+
function initDatepair()
|
34 |
+
{
|
35 |
+
var container = $(this);
|
36 |
+
|
37 |
+
var startDateInput = container.find('input.start.date');
|
38 |
+
var endDateInput = container.find('input.end.date');
|
39 |
+
var dateDelta = 0;
|
40 |
+
|
41 |
+
if (startDateInput.length && endDateInput.length) {
|
42 |
+
var startDate = new Date(startDateInput.val());
|
43 |
+
var endDate = new Date(endDateInput.val());
|
44 |
+
|
45 |
+
dateDelta = endDate.getTime() - startDate.getTime();
|
46 |
+
|
47 |
+
container.data('dateDelta', dateDelta);
|
48 |
+
}
|
49 |
+
|
50 |
+
var startTimeInput = container.find('input.start.time');
|
51 |
+
var endTimeInput = container.find('input.end.time');
|
52 |
+
|
53 |
+
if (startTimeInput.length && endTimeInput.length) {
|
54 |
+
var startInt = startTimeInput.timepicker('getSecondsFromMidnight');
|
55 |
+
var endInt = endTimeInput.timepicker('getSecondsFromMidnight');
|
56 |
+
|
57 |
+
container.data('timeDelta', endInt - startInt);
|
58 |
+
|
59 |
+
if (dateDelta < 86400000) {
|
60 |
+
endTimeInput.timepicker('option', 'minTime', startInt);
|
61 |
+
}
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
function doDatepair()
|
66 |
+
{
|
67 |
+
var target = $(this);
|
68 |
+
if (target.val() == '') {
|
69 |
+
return;
|
70 |
+
}
|
71 |
+
|
72 |
+
var container = target.closest('.datepair');
|
73 |
+
|
74 |
+
if (target.hasClass('date')) {
|
75 |
+
updateDatePair(target, container);
|
76 |
+
|
77 |
+
} else if (target.hasClass('time')) {
|
78 |
+
updateTimePair(target, container);
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
function updateDatePair(target, container)
|
83 |
+
{
|
84 |
+
var start = container.find('input.start.date');
|
85 |
+
var end = container.find('input.end.date');
|
86 |
+
|
87 |
+
if (!start.length || !end.length) {
|
88 |
+
return;
|
89 |
+
}
|
90 |
+
|
91 |
+
var startDate = new Date(start.val());
|
92 |
+
var endDate = new Date(end.val());
|
93 |
+
|
94 |
+
var oldDelta = container.data('dateDelta');
|
95 |
+
|
96 |
+
if (oldDelta && target.hasClass('start')) {
|
97 |
+
var newEnd = new Date(startDate.getTime()+oldDelta);
|
98 |
+
end.val(newEnd.format(DATE_FORMAT));
|
99 |
+
end.datepicker('update');
|
100 |
+
return;
|
101 |
+
|
102 |
+
} else {
|
103 |
+
var newDelta = endDate.getTime() - startDate.getTime();
|
104 |
+
|
105 |
+
if (newDelta < 0) {
|
106 |
+
newDelta = 0;
|
107 |
+
|
108 |
+
if (target.hasClass('start')) {
|
109 |
+
end.val(start.val());
|
110 |
+
end.datepicker('update');
|
111 |
+
} else if (target.hasClass('end')) {
|
112 |
+
start.val(end.val());
|
113 |
+
start.datepicker('update');
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
if (newDelta < 86400000) {
|
118 |
+
var startTimeVal = container.find('input.start.time').val();
|
119 |
+
|
120 |
+
if (startTimeVal) {
|
121 |
+
container.find('input.end.time').timepicker('option', {'minTime': startTimeVal});
|
122 |
+
}
|
123 |
+
} else {
|
124 |
+
container.find('input.end.time').timepicker('option', {'minTime': null});
|
125 |
+
}
|
126 |
+
|
127 |
+
container.data('dateDelta', newDelta);
|
128 |
+
}
|
129 |
+
}
|
130 |
+
|
131 |
+
function updateTimePair(target, container)
|
132 |
+
{
|
133 |
+
var start = container.find('input.start.time');
|
134 |
+
var end = container.find('input.end.time');
|
135 |
+
|
136 |
+
if (!start.length || !end.length) {
|
137 |
+
return;
|
138 |
+
}
|
139 |
+
|
140 |
+
var startInt = start.timepicker('getSecondsFromMidnight');
|
141 |
+
var endInt = end.timepicker('getSecondsFromMidnight');
|
142 |
+
|
143 |
+
var oldDelta = container.data('timeDelta');
|
144 |
+
var dateDelta = container.data('dateDelta');
|
145 |
+
|
146 |
+
if (target.hasClass('start') && (!dateDelta || dateDelta < 86400000)) {
|
147 |
+
end.timepicker('option', 'minTime', startInt);
|
148 |
+
}
|
149 |
+
|
150 |
+
var endDateAdvance = 0;
|
151 |
+
var newDelta;
|
152 |
+
|
153 |
+
if (oldDelta && target.hasClass('start')) {
|
154 |
+
// lock the duration and advance the end time
|
155 |
+
|
156 |
+
var newEnd = (startInt+oldDelta)%86400;
|
157 |
+
|
158 |
+
if (newEnd < 0) {
|
159 |
+
newEnd += 86400;
|
160 |
+
}
|
161 |
+
|
162 |
+
end.timepicker('setTime', newEnd);
|
163 |
+
newDelta = newEnd - startInt;
|
164 |
+
} else if (startInt !== null && endInt !== null) {
|
165 |
+
newDelta = endInt - startInt;
|
166 |
+
} else {
|
167 |
+
return;
|
168 |
+
}
|
169 |
+
|
170 |
+
container.data('timeDelta', newDelta);
|
171 |
+
|
172 |
+
if (newDelta < 0 && (!oldDelta || oldDelta > 0)) {
|
173 |
+
// overnight time span. advance the end date 1 day
|
174 |
+
var endDateAdvance = 86400000;
|
175 |
+
|
176 |
+
} else if (newDelta > 0 && oldDelta < 0) {
|
177 |
+
// switching from overnight to same-day time span. decrease the end date 1 day
|
178 |
+
var endDateAdvance = -86400000;
|
179 |
+
}
|
180 |
+
|
181 |
+
var startInput = container.find('.start.date');
|
182 |
+
var endInput = container.find('.end.date');
|
183 |
+
|
184 |
+
if (startInput.val() && !endInput.val()) {
|
185 |
+
endInput.val(startInput.val());
|
186 |
+
endInput.datepicker('update');
|
187 |
+
dateDelta = 0;
|
188 |
+
container.data('dateDelta', 0);
|
189 |
+
}
|
190 |
+
|
191 |
+
if (endDateAdvance != 0) {
|
192 |
+
if (dateDelta || dateDelta === 0) {
|
193 |
+
var endDate = new Date(endInput.val());
|
194 |
+
var newEnd = new Date(endDate.getTime() + endDateAdvance);
|
195 |
+
endInput.val(newEnd.format(DATE_FORMAT));
|
196 |
+
endInput.datepicker('update');
|
197 |
+
container.data('dateDelta', dateDelta + endDateAdvance);
|
198 |
+
}
|
199 |
+
}
|
200 |
+
}
|
201 |
+
});
|
202 |
+
});
|
203 |
+
// Simulates PHP's date function
|
204 |
+
Date.prototype.format=function(format){var returnStr='';var replace=Date.replaceChars;for(var i=0;i<format.length;i++){var curChar=format.charAt(i);if(replace[curChar]){returnStr+=replace[curChar].call(this);}else{returnStr+=curChar;}}return returnStr;};Date.replaceChars={shortMonths:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],longMonths:['January','February','March','April','May','June','July','August','September','October','November','December'],shortDays:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],longDays:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],d:function(){return(this.getDate()<10?'0':'')+this.getDate();},D:function(){return Date.replaceChars.shortDays[this.getDay()];},j:function(){return this.getDate();},l:function(){return Date.replaceChars.longDays[this.getDay()];},N:function(){return this.getDay()+1;},S:function(){return(this.getDate()%10==1&&this.getDate()!=11?'st':(this.getDate()%10==2&&this.getDate()!=12?'nd':(this.getDate()%10==3&&this.getDate()!=13?'rd':'th')));},w:function(){return this.getDay();},z:function(){return"Not Yet Supported";},W:function(){return"Not Yet Supported";},F:function(){return Date.replaceChars.longMonths[this.getMonth()];},m:function(){return(this.getMonth()<9?'0':'')+(this.getMonth()+1);},M:function(){return Date.replaceChars.shortMonths[this.getMonth()];},n:function(){return this.getMonth()+1;},t:function(){return"Not Yet Supported";},L:function(){return(((this.getFullYear()%4==0)&&(this.getFullYear()%100!=0))||(this.getFullYear()%400==0))?'1':'0';},o:function(){return"Not Supported";},Y:function(){return this.getFullYear();},y:function(){return(''+this.getFullYear()).substr(2);},a:function(){return this.getHours()<12?'am':'pm';},A:function(){return this.getHours()<12?'AM':'PM';},B:function(){return"Not Yet Supported";},g:function(){return this.getHours()%12||12;},G:function(){return this.getHours();},h:function(){return((this.getHours()%12||12)<10?'0':'')+(this.getHours()%12||12);},H:function(){return(this.getHours()<10?'0':'')+this.getHours();},i:function(){return(this.getMinutes()<10?'0':'')+this.getMinutes();},s:function(){return(this.getSeconds()<10?'0':'')+this.getSeconds();},e:function(){return"Not Yet Supported";},I:function(){return"Not Supported";},O:function(){return(-this.getTimezoneOffset()<0?'-':'+')+(Math.abs(this.getTimezoneOffset()/60)<10?'0':'')+(Math.abs(this.getTimezoneOffset()/60))+'00';},P:function(){return(-this.getTimezoneOffset()<0?'-':'+')+(Math.abs(this.getTimezoneOffset()/60)<10?'0':'')+(Math.abs(this.getTimezoneOffset()/60))+':'+(Math.abs(this.getTimezoneOffset()%60)<10?'0':'')+(Math.abs(this.getTimezoneOffset()%60));},T:function(){var m=this.getMonth();this.setMonth(0);var result=this.toTimeString().replace(/^.+ \(?([^\)]+)\)?$/,'$1');this.setMonth(m);return result;},Z:function(){return-this.getTimezoneOffset()*60;},c:function(){return this.format("Y-m-d")+"T"+this.format("H:i:sP");},r:function(){return this.toString();},U:function(){return this.getTime()/1000;}};
|
js/libraries/jquery-datepicker/lib/glyphicons-halflings.png
ADDED
Binary file
|
js/libraries/jquery-datepicker/lib/screenshot.png
ADDED
Binary file
|
js/libraries/jquery-datepicker/picker_functions.js
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function ($) {
|
2 |
+
|
3 |
+
jQuery('.time-picker').timepicker({ 'timeFormat': 'H:i' });
|
4 |
+
|
5 |
+
if ($('.current_lander .new-date').length) { // implies *not* zero
|
6 |
+
var current_val = jQuery(".current_lander .new-date").val();
|
7 |
+
} else {
|
8 |
+
var current_val = jQuery(".new-date").val();
|
9 |
+
}
|
10 |
+
// if no timepicker in options fix it
|
11 |
+
if (typeof (current_val) == "undefined" || current_val === null || current_val == "") {
|
12 |
+
var current_val = '';
|
13 |
+
}
|
14 |
+
|
15 |
+
console.log(current_val);
|
16 |
+
var ret = current_val.split(" ");
|
17 |
+
var current_date = ret[0];
|
18 |
+
var current_time = ret[1];
|
19 |
+
jQuery(".date").val(current_date);
|
20 |
+
jQuery(".time").val(current_time);
|
21 |
+
|
22 |
+
jQuery('.lp_select_template').live('click', function() {
|
23 |
+
var template = jQuery(this).attr('id');
|
24 |
+
jQuery("#date-picker-"+template).val(current_date).addClass("live_date");
|
25 |
+
jQuery("#time-picker-"+template).val(current_time).addClass("live_time");
|
26 |
+
});
|
27 |
+
|
28 |
+
jQuery('.current_lander .date, .current_lander .time').live('change', function () {
|
29 |
+
var date_chosen = jQuery(".current_lander .date").val();
|
30 |
+
var time_chosen = jQuery(".current_lander .time").val();
|
31 |
+
var total_time = date_chosen + " " + time_chosen;
|
32 |
+
jQuery(".new-date").val(total_time);
|
33 |
+
|
34 |
+
});
|
35 |
+
|
36 |
+
});
|
js/libraries/jquery-qtip/jquery.qtip.min.js
ADDED
@@ -0,0 +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);
|
js/libraries/jquery-qtip/load.qtip.js
ADDED
@@ -0,0 +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\'s this do?'
|
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/jquery.tinymce.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(c){var b,e,a=[],d=window;c.fn.tinymce=function(j){var p=this,g,k,h,m,i,l="",n="";if(!p.length){return p}if(!j){return tinyMCE.get(p[0].id)}p.css("visibility","hidden");function o(){var r=[],q=0;if(f){f();f=null}p.each(function(t,u){var s,w=u.id,v=j.oninit;if(!w){u.id=w=tinymce.DOM.uniqueId()}s=new tinymce.Editor(w,j);r.push(s);s.onInit.add(function(){var x,y=v;p.css("visibility","");if(v){if(++q==r.length){if(tinymce.is(y,"string")){x=(y.indexOf(".")===-1)?null:tinymce.resolve(y.replace(/\.\w+$/,""));y=tinymce.resolve(y)}y.apply(x||tinymce,r)}}})});c.each(r,function(t,s){s.render()})}if(!d.tinymce&&!e&&(g=j.script_url)){e=1;h=g.substring(0,g.lastIndexOf("/"));if(/_(src|dev)\.js/g.test(g)){n="_src"}m=g.lastIndexOf("?");if(m!=-1){l=g.substring(m+1)}d.tinyMCEPreInit=d.tinyMCEPreInit||{base:h,suffix:n,query:l};if(g.indexOf("gzip")!=-1){i=j.language||"en";g=g+(/\?/.test(g)?"&":"?")+"js=true&core=true&suffix="+escape(n)+"&themes="+escape(j.theme)+"&plugins="+escape(j.plugins)+"&languages="+i;if(!d.tinyMCE_GZ){tinyMCE_GZ={start:function(){tinymce.suffix=n;function q(r){tinymce.ScriptLoader.markDone(tinyMCE.baseURI.toAbsolute(r))}q("langs/"+i+".js");q("themes/"+j.theme+"/editor_template"+n+".js");q("themes/"+j.theme+"/langs/"+i+".js");c.each(j.plugins.split(","),function(s,r){if(r){q("plugins/"+r+"/editor_plugin"+n+".js");q("plugins/"+r+"/langs/"+i+".js")}})},end:function(){}}}}c.ajax({type:"GET",url:g,dataType:"script",cache:true,success:function(){tinymce.dom.Event.domLoaded=1;e=2;if(j.script_loaded){j.script_loaded()}o();c.each(a,function(q,r){r()})}})}else{if(e===1){a.push(o)}else{o()}}return p};c.extend(c.expr[":"],{tinymce:function(g){return !!(g.id&&"tinyMCE" in window&&tinyMCE.get(g.id))}});function f(){function i(l){if(l==="remove"){this.each(function(n,o){var m=h(o);if(m){m.remove()}})}this.find("span.mceEditor,div.mceEditor").each(function(n,o){var m=tinyMCE.get(o.id.replace(/_parent$/,""));if(m){m.remove()}})}function k(n){var m=this,l;if(n!==b){i.call(m);m.each(function(p,q){var o;if(o=tinyMCE.get(q.id)){o.setContent(n)}})}else{if(m.length>0){if(l=tinyMCE.get(m[0].id)){return l.getContent()}}}}function h(m){var l=null;(m)&&(m.id)&&(d.tinymce)&&(l=tinyMCE.get(m.id));return l}function g(l){return !!((l)&&(l.length)&&(d.tinymce)&&(l.is(":tinymce")))}var j={};c.each(["text","html","val"],function(n,l){var o=j[l]=c.fn[l],m=(l==="text");c.fn[l]=function(s){var p=this;if(!g(p)){return o.apply(p,arguments)}if(s!==b){k.call(p.filter(":tinymce"),s);o.apply(p.not(":tinymce"),arguments);return p}else{var r="";var q=arguments;(m?p:p.eq(0)).each(function(u,v){var t=h(v);r+=t?(m?t.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):t.getContent({save:true})):o.apply(c(v),q)});return r}}});c.each(["append","prepend"],function(n,m){var o=j[m]=c.fn[m],l=(m==="prepend");c.fn[m]=function(q){var p=this;if(!g(p)){return o.apply(p,arguments)}if(q!==b){p.filter(":tinymce").each(function(s,t){var r=h(t);r&&r.setContent(l?q+r.getContent():r.getContent()+q)});o.apply(p.not(":tinymce"),arguments);return p}}});c.each(["remove","replaceWith","replaceAll","empty"],function(m,l){var n=j[l]=c.fn[l];c.fn[l]=function(){i.call(this,l);return n.apply(this,arguments)}});j.attr=c.fn.attr;c.fn.attr=function(o,q){var m=this,n=arguments;if((!o)||(o!=="value")||(!g(m))){if(q!==b){return j.attr.apply(m,n)}else{return j.attr.apply(m,n)}}if(q!==b){k.call(m.filter(":tinymce"),q);j.attr.apply(m.not(":tinymce"),n);return m}else{var p=m[0],l=h(p);return l?l.getContent({save:true}):j.attr.apply(c(p),n)}}}})(jQuery);
|
js/libraries/tiny_mce/langs/en.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.addI18n({en:{common:{"more_colors":"More Colors...","invalid_data":"Error: Invalid values entered, these are marked in red.","popup_blocked":"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.","clipboard_no_support":"Currently not supported by your browser, use keyboard shortcuts instead.","clipboard_msg":"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?","not_set":"-- Not Set --","class_name":"Class",browse:"Browse",close:"Close",cancel:"Cancel",update:"Update",insert:"Insert",apply:"Apply","edit_confirm":"Do you want to use the WYSIWYG mode for this textarea?","invalid_data_number":"{#field} must be a number","invalid_data_min":"{#field} must be a number greater than {#min}","invalid_data_size":"{#field} must be a number or percentage",value:"(value)"},contextmenu:{full:"Full",right:"Right",center:"Center",left:"Left",align:"Alignment"},insertdatetime:{"day_short":"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun","day_long":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday","months_short":"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec","months_long":"January,February,March,April,May,June,July,August,September,October,November,December","inserttime_desc":"Insert Time","insertdate_desc":"Insert Date","time_fmt":"%H:%M:%S","date_fmt":"%Y-%m-%d"},print:{"print_desc":"Print"},preview:{"preview_desc":"Preview"},directionality:{"rtl_desc":"Direction Right to Left","ltr_desc":"Direction Left to Right"},layer:{content:"New layer...","absolute_desc":"Toggle Absolute Positioning","backward_desc":"Move Backward","forward_desc":"Move Forward","insertlayer_desc":"Insert New Layer"},save:{"save_desc":"Save","cancel_desc":"Cancel All Changes"},nonbreaking:{"nonbreaking_desc":"Insert Non-Breaking Space Character"},iespell:{download:"ieSpell not detected. Do you want to install it now?","iespell_desc":"Check Spelling"},advhr:{"delta_height":"","delta_width":"","advhr_desc":"Insert Horizontal Line"},emotions:{"delta_height":"","delta_width":"","emotions_desc":"Emotions"},searchreplace:{"replace_desc":"Find/Replace","delta_width":"","delta_height":"","search_desc":"Find"},advimage:{"delta_width":"","image_desc":"Insert/Edit Image","delta_height":""},advlink:{"delta_height":"","delta_width":"","link_desc":"Insert/Edit Link"},xhtmlxtras:{"attribs_delta_height":"","attribs_delta_width":"","ins_delta_height":"","ins_delta_width":"","del_delta_height":"","del_delta_width":"","acronym_delta_height":"","acronym_delta_width":"","abbr_delta_height":"","abbr_delta_width":"","cite_delta_height":"","cite_delta_width":"","attribs_desc":"Insert/Edit Attributes","ins_desc":"Insertion","del_desc":"Deletion","acronym_desc":"Acronym","abbr_desc":"Abbreviation","cite_desc":"Citation"},style:{"delta_height":"","delta_width":"",desc:"Edit CSS Style"},paste:{"plaintext_mode_stick":"Paste is now in plain text mode. Click again to toggle back to regular paste mode.","plaintext_mode":"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.","selectall_desc":"Select All","paste_word_desc":"Paste from Word","paste_text_desc":"Paste as Plain Text"},"paste_dlg":{"word_title":"Use Ctrl+V on your keyboard to paste the text into the window.","text_linebreaks":"Keep Linebreaks","text_title":"Use Ctrl+V on your keyboard to paste the text into the window."},table:{"merge_cells_delta_height":"","merge_cells_delta_width":"","table_delta_height":"","table_delta_width":"","cellprops_delta_height":"","cellprops_delta_width":"","rowprops_delta_height":"","rowprops_delta_width":"",cell:"Cell",col:"Column",row:"Row",del:"Delete Table","copy_row_desc":"Copy Table Row","cut_row_desc":"Cut Table Row","paste_row_after_desc":"Paste Table Row After","paste_row_before_desc":"Paste Table Row Before","props_desc":"Table Properties","cell_desc":"Table Cell Properties","row_desc":"Table Row Properties","merge_cells_desc":"Merge Table Cells","split_cells_desc":"Split Merged Table Cells","delete_col_desc":"Delete Column","col_after_desc":"Insert Column After","col_before_desc":"Insert Column Before","delete_row_desc":"Delete Row","row_after_desc":"Insert Row After","row_before_desc":"Insert Row Before",desc:"Insert/Edit Table"},autosave:{"warning_message":"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?","restore_content":"Restore auto-saved content.","unload_msg":"The changes you made will be lost if you navigate away from this page."},fullscreen:{desc:"Toggle Full Screen Mode"},media:{"delta_height":"","delta_width":"",edit:"Edit Embedded Media",desc:"Insert/Edit Embedded Media"},fullpage:{desc:"Document Properties","delta_width":"","delta_height":""},template:{desc:"Insert Predefined Template Content"},visualchars:{desc:"Show/Hide Visual Control Characters"},spellchecker:{desc:"Toggle Spell Checker",menu:"Spell Checker Settings","ignore_word":"Ignore Word","ignore_words":"Ignore All",langs:"Languages",wait:"Please wait...",sug:"Suggestions","no_sug":"No Suggestions","no_mpell":"No misspellings found.","learn_word":"Learn word"},pagebreak:{desc:"Insert Page Break for Printing"},advlist:{types:"Types",def:"Default","lower_alpha":"Lower Alpha","lower_greek":"Lower Greek","lower_roman":"Lower Roman","upper_alpha":"Upper Alpha","upper_roman":"Upper Roman",circle:"Circle",disc:"Disc",square:"Square"},colors:{"333300":"Dark olive","993300":"Burnt orange","000000":"Black","003300":"Dark green","003366":"Dark azure","000080":"Navy Blue","333399":"Indigo","333333":"Very dark gray","800000":"Maroon",FF6600:"Orange","808000":"Olive","008000":"Green","008080":"Teal","0000FF":"Blue","666699":"Grayish blue","808080":"Gray",FF0000:"Red",FF9900:"Amber","99CC00":"Yellow green","339966":"Sea green","33CCCC":"Turquoise","3366FF":"Royal blue","800080":"Purple","999999":"Medium gray",FF00FF:"Magenta",FFCC00:"Gold",FFFF00:"Yellow","00FF00":"Lime","00FFFF":"Aqua","00CCFF":"Sky blue","993366":"Brown",C0C0C0:"Silver",FF99CC:"Pink",FFCC99:"Peach",FFFF99:"Light yellow",CCFFCC:"Pale green",CCFFFF:"Pale cyan","99CCFF":"Light sky blue",CC99FF:"Plum",FFFFFF:"White"},aria:{"rich_text_area":"Rich Text Area"},wordcount:{words:"Words:"},visualblocks:{desc:'Show/hide block elements'}}});
|
js/libraries/tiny_mce/license.txt
ADDED
@@ -0,0 +1,504 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU LESSER GENERAL PUBLIC LICENSE
|
2 |
+
Version 2.1, February 1999
|
3 |
+
|
4 |
+
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
5 |
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
6 |
+
Everyone is permitted to copy and distribute verbatim copies
|
7 |
+
of this license document, but changing it is not allowed.
|
8 |
+
|
9 |
+
[This is the first released version of the Lesser GPL. It also counts
|
10 |
+
as the successor of the GNU Library Public License, version 2, hence
|
11 |
+
the version number 2.1.]
|
12 |
+
|
13 |
+
Preamble
|
14 |
+
|
15 |
+
The licenses for most software are designed to take away your
|
16 |
+
freedom to share and change it. By contrast, the GNU General Public
|
17 |
+
Licenses are intended to guarantee your freedom to share and change
|
18 |
+
free software--to make sure the software is free for all its users.
|
19 |
+
|
20 |
+
This license, the Lesser General Public License, applies to some
|
21 |
+
specially designated software packages--typically libraries--of the
|
22 |
+
Free Software Foundation and other authors who decide to use it. You
|
23 |
+
can use it too, but we suggest you first think carefully about whether
|
24 |
+
this license or the ordinary General Public License is the better
|
25 |
+
strategy to use in any particular case, based on the explanations below.
|
26 |
+
|
27 |
+
When we speak of free software, we are referring to freedom of use,
|
28 |
+
not price. Our General Public Licenses are designed to make sure that
|
29 |
+
you have the freedom to distribute copies of free software (and charge
|
30 |
+
for this service if you wish); that you receive source code or can get
|
31 |
+
it if you want it; that you can change the software and use pieces of
|
32 |
+
it in new free programs; and that you are informed that you can do
|
33 |
+
these things.
|
34 |
+
|
35 |
+
To protect your rights, we need to make restrictions that forbid
|
36 |
+
distributors to deny you these rights or to ask you to surrender these
|
37 |
+
rights. These restrictions translate to certain responsibilities for
|
38 |
+
you if you distribute copies of the library or if you modify it.
|
39 |
+
|
40 |
+
For example, if you distribute copies of the library, whether gratis
|
41 |
+
or for a fee, you must give the recipients all the rights that we gave
|
42 |
+
you. You must make sure that they, too, receive or can get the source
|
43 |
+
code. If you link other code with the library, you must provide
|
44 |
+
complete object files to the recipients, so that they can relink them
|
45 |
+
with the library after making changes to the library and recompiling
|
46 |
+
it. And you must show them these terms so they know their rights.
|
47 |
+
|
48 |
+
We protect your rights with a two-step method: (1) we copyright the
|
49 |
+
library, and (2) we offer you this license, which gives you legal
|
50 |
+
permission to copy, distribute and/or modify the library.
|
51 |
+
|
52 |
+
To protect each distributor, we want to make it very clear that
|
53 |
+
there is no warranty for the free library. Also, if the library is
|
54 |
+
modified by someone else and passed on, the recipients should know
|
55 |
+
that what they have is not the original version, so that the original
|
56 |
+
author's reputation will not be affected by problems that might be
|
57 |
+
introduced by others.
|
58 |
+
|
59 |
+
Finally, software patents pose a constant threat to the existence of
|
60 |
+
any free program. We wish to make sure that a company cannot
|
61 |
+
effectively restrict the users of a free program by obtaining a
|
62 |
+
restrictive license from a patent holder. Therefore, we insist that
|
63 |
+
any patent license obtained for a version of the library must be
|
64 |
+
consistent with the full freedom of use specified in this license.
|
65 |
+
|
66 |
+
Most GNU software, including some libraries, is covered by the
|
67 |
+
ordinary GNU General Public License. This license, the GNU Lesser
|
68 |
+
General Public License, applies to certain designated libraries, and
|
69 |
+
is quite different from the ordinary General Public License. We use
|
70 |
+
this license for certain libraries in order to permit linking those
|
71 |
+
libraries into non-free programs.
|
72 |
+
|
73 |
+
When a program is linked with a library, whether statically or using
|
74 |
+
a shared library, the combination of the two is legally speaking a
|
75 |
+
combined work, a derivative of the original library. The ordinary
|
76 |
+
General Public License therefore permits such linking only if the
|
77 |
+
entire combination fits its criteria of freedom. The Lesser General
|
78 |
+
Public License permits more lax criteria for linking other code with
|
79 |
+
the library.
|
80 |
+
|
81 |
+
We call this license the "Lesser" General Public License because it
|
82 |
+
does Less to protect the user's freedom than the ordinary General
|
83 |
+
Public License. It also provides other free software developers Less
|
84 |
+
of an advantage over competing non-free programs. These disadvantages
|
85 |
+
are the reason we use the ordinary General Public License for many
|
86 |
+
libraries. However, the Lesser license provides advantages in certain
|
87 |
+
special circumstances.
|
88 |
+
|
89 |
+
For example, on rare occasions, there may be a special need to
|
90 |
+
encourage the widest possible use of a certain library, so that it becomes
|
91 |
+
a de-facto standard. To achieve this, non-free programs must be
|
92 |
+
allowed to use the library. A more frequent case is that a free
|
93 |
+
library does the same job as widely used non-free libraries. In this
|
94 |
+
case, there is little to gain by limiting the free library to free
|
95 |
+
software only, so we use the Lesser General Public License.
|
96 |
+
|
97 |
+
In other cases, permission to use a particular library in non-free
|
98 |
+
programs enables a greater number of people to use a large body of
|
99 |
+
free software. For example, permission to use the GNU C Library in
|
100 |
+
non-free programs enables many more people to use the whole GNU
|
101 |
+
operating system, as well as its variant, the GNU/Linux operating
|
102 |
+
system.
|
103 |
+
|
104 |
+
Although the Lesser General Public License is Less protective of the
|
105 |
+
users' freedom, it does ensure that the user of a program that is
|
106 |
+
linked with the Library has the freedom and the wherewithal to run
|
107 |
+
that program using a modified version of the Library.
|
108 |
+
|
109 |
+
The precise terms and conditions for copying, distribution and
|
110 |
+
modification follow. Pay close attention to the difference between a
|
111 |
+
"work based on the library" and a "work that uses the library". The
|
112 |
+
former contains code derived from the library, whereas the latter must
|
113 |
+
be combined with the library in order to run.
|
114 |
+
|
115 |
+
GNU LESSER GENERAL PUBLIC LICENSE
|
116 |
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
117 |
+
|
118 |
+
0. This License Agreement applies to any software library or other
|
119 |
+
program which contains a notice placed by the copyright holder or
|
120 |
+
other authorized party saying it may be distributed under the terms of
|
121 |
+
this Lesser General Public License (also called "this License").
|
122 |
+
Each licensee is addressed as "you".
|
123 |
+
|
124 |
+
A "library" means a collection of software functions and/or data
|
125 |
+
prepared so as to be conveniently linked with application programs
|
126 |
+
(which use some of those functions and data) to form executables.
|
127 |
+
|
128 |
+
The "Library", below, refers to any such software library or work
|
129 |
+
which has been distributed under these terms. A "work based on the
|
130 |
+
Library" means either the Library or any derivative work under
|
131 |
+
copyright law: that is to say, a work containing the Library or a
|
132 |
+
portion of it, either verbatim or with modifications and/or translated
|
133 |
+
straightforwardly into another language. (Hereinafter, translation is
|
134 |
+
included without limitation in the term "modification".)
|
135 |
+
|
136 |
+
"Source code" for a work means the preferred form of the work for
|
137 |
+
making modifications to it. For a library, complete source code means
|
138 |
+
all the source code for all modules it contains, plus any associated
|
139 |
+
interface definition files, plus the scripts used to control compilation
|
140 |
+
and installation of the library.
|
141 |
+
|
142 |
+
Activities other than copying, distribution and modification are not
|
143 |
+
covered by this License; they are outside its scope. The act of
|
144 |
+
running a program using the Library is not restricted, and output from
|
145 |
+
such a program is covered only if its contents constitute a work based
|
146 |
+
on the Library (independent of the use of the Library in a tool for
|
147 |
+
writing it). Whether that is true depends on what the Library does
|
148 |
+
and what the program that uses the Library does.
|
149 |
+
|
150 |
+
1. You may copy and distribute verbatim copies of the Library's
|
151 |
+
complete source code as you receive it, in any medium, provided that
|
152 |
+
you conspicuously and appropriately publish on each copy an
|
153 |
+
appropriate copyright notice and disclaimer of warranty; keep intact
|
154 |
+
all the notices that refer to this License and to the absence of any
|
155 |
+
warranty; and distribute a copy of this License along with the
|
156 |
+
Library.
|
157 |
+
|
158 |
+
You may charge a fee for the physical act of transferring a copy,
|
159 |
+
and you may at your option offer warranty protection in exchange for a
|
160 |
+
fee.
|
161 |
+
|
162 |
+
2. You may modify your copy or copies of the Library or any portion
|
163 |
+
of it, thus forming a work based on the Library, and copy and
|
164 |
+
distribute such modifications or work under the terms of Section 1
|
165 |
+
above, provided that you also meet all of these conditions:
|
166 |
+
|
167 |
+
a) The modified work must itself be a software library.
|
168 |
+
|
169 |
+
b) You must cause the files modified to carry prominent notices
|
170 |
+
stating that you changed the files and the date of any change.
|
171 |
+
|
172 |
+
c) You must cause the whole of the work to be licensed at no
|
173 |
+
charge to all third parties under the terms of this License.
|
174 |
+
|
175 |
+
d) If a facility in the modified Library refers to a function or a
|
176 |
+
table of data to be supplied by an application program that uses
|
177 |
+
the facility, other than as an argument passed when the facility
|
178 |
+
is invoked, then you must make a good faith effort to ensure that,
|
179 |
+
in the event an application does not supply such function or
|
180 |
+
table, the facility still operates, and performs whatever part of
|
181 |
+
its purpose remains meaningful.
|
182 |
+
|
183 |
+
(For example, a function in a library to compute square roots has
|
184 |
+
a purpose that is entirely well-defined independent of the
|
185 |
+
application. Therefore, Subsection 2d requires that any
|
186 |
+
application-supplied function or table used by this function must
|
187 |
+
be optional: if the application does not supply it, the square
|
188 |
+
root function must still compute square roots.)
|
189 |
+
|
190 |
+
These requirements apply to the modified work as a whole. If
|
191 |
+
identifiable sections of that work are not derived from the Library,
|
192 |
+
and can be reasonably considered independent and separate works in
|
193 |
+
themselves, then this License, and its terms, do not apply to those
|
194 |
+
sections when you distribute them as separate works. But when you
|
195 |
+
distribute the same sections as part of a whole which is a work based
|
196 |
+
on the Library, the distribution of the whole must be on the terms of
|
197 |
+
this License, whose permissions for other licensees extend to the
|
198 |
+
entire whole, and thus to each and every part regardless of who wrote
|
199 |
+
it.
|
200 |
+
|
201 |
+
Thus, it is not the intent of this section to claim rights or contest
|
202 |
+
your rights to work written entirely by you; rather, the intent is to
|
203 |
+
exercise the right to control the distribution of derivative or
|
204 |
+
collective works based on the Library.
|
205 |
+
|
206 |
+
In addition, mere aggregation of another work not based on the Library
|
207 |
+
with the Library (or with a work based on the Library) on a volume of
|
208 |
+
a storage or distribution medium does not bring the other work under
|
209 |
+
the scope of this License.
|
210 |
+
|
211 |
+
3. You may opt to apply the terms of the ordinary GNU General Public
|
212 |
+
License instead of this License to a given copy of the Library. To do
|
213 |
+
this, you must alter all the notices that refer to this License, so
|
214 |
+
that they refer to the ordinary GNU General Public License, version 2,
|
215 |
+
instead of to this License. (If a newer version than version 2 of the
|
216 |
+
ordinary GNU General Public License has appeared, then you can specify
|
217 |
+
that version instead if you wish.) Do not make any other change in
|
218 |
+
these notices.
|
219 |
+
|
220 |
+
Once this change is made in a given copy, it is irreversible for
|
221 |
+
that copy, so the ordinary GNU General Public License applies to all
|
222 |
+
subsequent copies and derivative works made from that copy.
|
223 |
+
|
224 |
+
This option is useful when you wish to copy part of the code of
|
225 |
+
the Library into a program that is not a library.
|
226 |
+
|
227 |
+
4. You may copy and distribute the Library (or a portion or
|
228 |
+
derivative of it, under Section 2) in object code or executable form
|
229 |
+
under the terms of Sections 1 and 2 above provided that you accompany
|
230 |
+
it with the complete corresponding machine-readable source code, which
|
231 |
+
must be distributed under the terms of Sections 1 and 2 above on a
|
232 |
+
medium customarily used for software interchange.
|
233 |
+
|
234 |
+
If distribution of object code is made by offering access to copy
|
235 |
+
from a designated place, then offering equivalent access to copy the
|
236 |
+
source code from the same place satisfies the requirement to
|
237 |
+
distribute the source code, even though third parties are not
|
238 |
+
compelled to copy the source along with the object code.
|
239 |
+
|
240 |
+
5. A program that contains no derivative of any portion of the
|
241 |
+
Library, but is designed to work with the Library by being compiled or
|
242 |
+
linked with it, is called a "work that uses the Library". Such a
|
243 |
+
work, in isolation, is not a derivative work of the Library, and
|
244 |
+
therefore falls outside the scope of this License.
|
245 |
+
|
246 |
+
However, linking a "work that uses the Library" with the Library
|
247 |
+
creates an executable that is a derivative of the Library (because it
|
248 |
+
contains portions of the Library), rather than a "work that uses the
|
249 |
+
library". The executable is therefore covered by this License.
|
250 |
+
Section 6 states terms for distribution of such executables.
|
251 |
+
|
252 |
+
When a "work that uses the Library" uses material from a header file
|
253 |
+
that is part of the Library, the object code for the work may be a
|
254 |
+
derivative work of the Library even though the source code is not.
|
255 |
+
Whether this is true is especially significant if the work can be
|
256 |
+
linked without the Library, or if the work is itself a library. The
|
257 |
+
threshold for this to be true is not precisely defined by law.
|
258 |
+
|
259 |
+
If such an object file uses only numerical parameters, data
|
260 |
+
structure layouts and accessors, and small macros and small inline
|
261 |
+
functions (ten lines or less in length), then the use of the object
|
262 |
+
file is unrestricted, regardless of whether it is legally a derivative
|
263 |
+
work. (Executables containing this object code plus portions of the
|
264 |
+
Library will still fall under Section 6.)
|
265 |
+
|
266 |
+
Otherwise, if the work is a derivative of the Library, you may
|
267 |
+
distribute the object code for the work under the terms of Section 6.
|
268 |
+
Any executables containing that work also fall under Section 6,
|
269 |
+
whether or not they are linked directly with the Library itself.
|
270 |
+
|
271 |
+
6. As an exception to the Sections above, you may also combine or
|
272 |
+
link a "work that uses the Library" with the Library to produce a
|
273 |
+
work containing portions of the Library, and distribute that work
|
274 |
+
under terms of your choice, provided that the terms permit
|
275 |
+
modification of the work for the customer's own use and reverse
|
276 |
+
engineering for debugging such modifications.
|
277 |
+
|
278 |
+
You must give prominent notice with each copy of the work that the
|
279 |
+
Library is used in it and that the Library and its use are covered by
|
280 |
+
this License. You must supply a copy of this License. If the work
|
281 |
+
during execution displays copyright notices, you must include the
|
282 |
+
copyright notice for the Library among them, as well as a reference
|
283 |
+
directing the user to the copy of this License. Also, you must do one
|
284 |
+
of these things:
|
285 |
+
|
286 |
+
a) Accompany the work with the complete corresponding
|
287 |
+
machine-readable source code for the Library including whatever
|
288 |
+
changes were used in the work (which must be distributed under
|
289 |
+
Sections 1 and 2 above); and, if the work is an executable linked
|
290 |
+
with the Library, with the complete machine-readable "work that
|
291 |
+
uses the Library", as object code and/or source code, so that the
|
292 |
+
user can modify the Library and then relink to produce a modified
|
293 |
+
executable containing the modified Library. (It is understood
|
294 |
+
that the user who changes the contents of definitions files in the
|
295 |
+
Library will not necessarily be able to recompile the application
|
296 |
+
to use the modified definitions.)
|
297 |
+
|
298 |
+
b) Use a suitable shared library mechanism for linking with the
|
299 |
+
Library. A suitable mechanism is one that (1) uses at run time a
|
300 |
+
copy of the library already present on the user's computer system,
|
301 |
+
rather than copying library functions into the executable, and (2)
|
302 |
+
will operate properly with a modified version of the library, if
|
303 |
+
the user installs one, as long as the modified version is
|
304 |
+
interface-compatible with the version that the work was made with.
|
305 |
+
|
306 |
+
c) Accompany the work with a written offer, valid for at
|
307 |
+
least three years, to give the same user the materials
|
308 |
+
specified in Subsection 6a, above, for a charge no more
|
309 |
+
than the cost of performing this distribution.
|
310 |
+
|
311 |
+
d) If distribution of the work is made by offering access to copy
|
312 |
+
from a designated place, offer equivalent access to copy the above
|
313 |
+
specified materials from the same place.
|
314 |
+
|
315 |
+
e) Verify that the user has already received a copy of these
|
316 |
+
materials or that you have already sent this user a copy.
|
317 |
+
|
318 |
+
For an executable, the required form of the "work that uses the
|
319 |
+
Library" must include any data and utility programs needed for
|
320 |
+
reproducing the executable from it. However, as a special exception,
|
321 |
+
the materials to be distributed need not include anything that is
|
322 |
+
normally distributed (in either source or binary form) with the major
|
323 |
+
components (compiler, kernel, and so on) of the operating system on
|
324 |
+
which the executable runs, unless that component itself accompanies
|
325 |
+
the executable.
|
326 |
+
|
327 |
+
It may happen that this requirement contradicts the license
|
328 |
+
restrictions of other proprietary libraries that do not normally
|
329 |
+
accompany the operating system. Such a contradiction means you cannot
|
330 |
+
use both them and the Library together in an executable that you
|
331 |
+
distribute.
|
332 |
+
|
333 |
+
7. You may place library facilities that are a work based on the
|
334 |
+
Library side-by-side in a single library together with other library
|
335 |
+
facilities not covered by this License, and distribute such a combined
|
336 |
+
library, provided that the separate distribution of the work based on
|
337 |
+
the Library and of the other library facilities is otherwise
|
338 |
+
permitted, and provided that you do these two things:
|
339 |
+
|
340 |
+
a) Accompany the combined library with a copy of the same work
|
341 |
+
based on the Library, uncombined with any other library
|
342 |
+
facilities. This must be distributed under the terms of the
|
343 |
+
Sections above.
|
344 |
+
|
345 |
+
b) Give prominent notice with the combined library of the fact
|
346 |
+
that part of it is a work based on the Library, and explaining
|
347 |
+
where to find the accompanying uncombined form of the same work.
|
348 |
+
|
349 |
+
8. You may not copy, modify, sublicense, link with, or distribute
|
350 |
+
the Library except as expressly provided under this License. Any
|
351 |
+
attempt otherwise to copy, modify, sublicense, link with, or
|
352 |
+
distribute the Library is void, and will automatically terminate your
|
353 |
+
rights under this License. However, parties who have received copies,
|
354 |
+
or rights, from you under this License will not have their licenses
|
355 |
+
terminated so long as such parties remain in full compliance.
|
356 |
+
|
357 |
+
9. You are not required to accept this License, since you have not
|
358 |
+
signed it. However, nothing else grants you permission to modify or
|
359 |
+
distribute the Library or its derivative works. These actions are
|
360 |
+
prohibited by law if you do not accept this License. Therefore, by
|
361 |
+
modifying or distributing the Library (or any work based on the
|
362 |
+
Library), you indicate your acceptance of this License to do so, and
|
363 |
+
all its terms and conditions for copying, distributing or modifying
|
364 |
+
the Library or works based on it.
|
365 |
+
|
366 |
+
10. Each time you redistribute the Library (or any work based on the
|
367 |
+
Library), the recipient automatically receives a license from the
|
368 |
+
original licensor to copy, distribute, link with or modify the Library
|
369 |
+
subject to these terms and conditions. You may not impose any further
|
370 |
+
restrictions on the recipients' exercise of the rights granted herein.
|
371 |
+
You are not responsible for enforcing compliance by third parties with
|
372 |
+
this License.
|
373 |
+
|
374 |
+
11. If, as a consequence of a court judgment or allegation of patent
|
375 |
+
infringement or for any other reason (not limited to patent issues),
|
376 |
+
conditions are imposed on you (whether by court order, agreement or
|
377 |
+
otherwise) that contradict the conditions of this License, they do not
|
378 |
+
excuse you from the conditions of this License. If you cannot
|
379 |
+
distribute so as to satisfy simultaneously your obligations under this
|
380 |
+
License and any other pertinent obligations, then as a consequence you
|
381 |
+
may not distribute the Library at all. For example, if a patent
|
382 |
+
license would not permit royalty-free redistribution of the Library by
|
383 |
+
all those who receive copies directly or indirectly through you, then
|
384 |
+
the only way you could satisfy both it and this License would be to
|
385 |
+
refrain entirely from distribution of the Library.
|
386 |
+
|
387 |
+
If any portion of this section is held invalid or unenforceable under any
|
388 |
+
particular circumstance, the balance of the section is intended to apply,
|
389 |
+
and the section as a whole is intended to apply in other circumstances.
|
390 |
+
|
391 |
+
It is not the purpose of this section to induce you to infringe any
|
392 |
+
patents or other property right claims or to contest validity of any
|
393 |
+
such claims; this section has the sole purpose of protecting the
|
394 |
+
integrity of the free software distribution system which is
|
395 |
+
implemented by public license practices. Many people have made
|
396 |
+
generous contributions to the wide range of software distributed
|
397 |
+
through that system in reliance on consistent application of that
|
398 |
+
system; it is up to the author/donor to decide if he or she is willing
|
399 |
+
to distribute software through any other system and a licensee cannot
|
400 |
+
impose that choice.
|
401 |
+
|
402 |
+
This section is intended to make thoroughly clear what is believed to
|
403 |
+
be a consequence of the rest of this License.
|
404 |
+
|
405 |
+
12. If the distribution and/or use of the Library is restricted in
|
406 |
+
certain countries either by patents or by copyrighted interfaces, the
|
407 |
+
original copyright holder who places the Library under this License may add
|
408 |
+
an explicit geographical distribution limitation excluding those countries,
|
409 |
+
so that distribution is permitted only in or among countries not thus
|
410 |
+
excluded. In such case, this License incorporates the limitation as if
|
411 |
+
written in the body of this License.
|
412 |
+
|
413 |
+
13. The Free Software Foundation may publish revised and/or new
|
414 |
+
versions of the Lesser General Public License from time to time.
|
415 |
+
Such new versions will be similar in spirit to the present version,
|
416 |
+
but may differ in detail to address new problems or concerns.
|
417 |
+
|
418 |
+
Each version is given a distinguishing version number. If the Library
|
419 |
+
specifies a version number of this License which applies to it and
|
420 |
+
"any later version", you have the option of following the terms and
|
421 |
+
conditions either of that version or of any later version published by
|
422 |
+
the Free Software Foundation. If the Library does not specify a
|
423 |
+
license version number, you may choose any version ever published by
|
424 |
+
the Free Software Foundation.
|
425 |
+
|
426 |
+
14. If you wish to incorporate parts of the Library into other free
|
427 |
+
programs whose distribution conditions are incompatible with these,
|
428 |
+
write to the author to ask for permission. For software which is
|
429 |
+
copyrighted by the Free Software Foundation, write to the Free
|
430 |
+
Software Foundation; we sometimes make exceptions for this. Our
|
431 |
+
decision will be guided by the two goals of preserving the free status
|
432 |
+
of all derivatives of our free software and of promoting the sharing
|
433 |
+
and reuse of software generally.
|
434 |
+
|
435 |
+
NO WARRANTY
|
436 |
+
|
437 |
+
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
438 |
+
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
439 |
+
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
440 |
+
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
441 |
+
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
442 |
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
443 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
444 |
+
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
445 |
+
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
446 |
+
|
447 |
+
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
448 |
+
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
449 |
+
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
450 |
+
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
451 |
+
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
452 |
+
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
453 |
+
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
454 |
+
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
455 |
+
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
456 |
+
DAMAGES.
|
457 |
+
|
458 |
+
END OF TERMS AND CONDITIONS
|
459 |
+
|
460 |
+
How to Apply These Terms to Your New Libraries
|
461 |
+
|
462 |
+
If you develop a new library, and you want it to be of the greatest
|
463 |
+
possible use to the public, we recommend making it free software that
|
464 |
+
everyone can redistribute and change. You can do so by permitting
|
465 |
+
redistribution under these terms (or, alternatively, under the terms of the
|
466 |
+
ordinary General Public License).
|
467 |
+
|
468 |
+
To apply these terms, attach the following notices to the library. It is
|
469 |
+
safest to attach them to the start of each source file to most effectively
|
470 |
+
convey the exclusion of warranty; and each file should have at least the
|
471 |
+
"copyright" line and a pointer to where the full notice is found.
|
472 |
+
|
473 |
+
<one line to give the library's name and a brief idea of what it does.>
|
474 |
+
Copyright (C) <year> <name of author>
|
475 |
+
|
476 |
+
This library is free software; you can redistribute it and/or
|
477 |
+
modify it under the terms of the GNU Lesser General Public
|
478 |
+
License as published by the Free Software Foundation; either
|
479 |
+
version 2.1 of the License, or (at your option) any later version.
|
480 |
+
|
481 |
+
This library is distributed in the hope that it will be useful,
|
482 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
483 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
484 |
+
Lesser General Public License for more details.
|
485 |
+
|
486 |
+
You should have received a copy of the GNU Lesser General Public
|
487 |
+
License along with this library; if not, write to the Free Software
|
488 |
+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
489 |
+
|
490 |
+
Also add information on how to contact you by electronic and paper mail.
|
491 |
+
|
492 |
+
You should also get your employer (if you work as a programmer) or your
|
493 |
+
school, if any, to sign a "copyright disclaimer" for the library, if
|
494 |
+
necessary. Here is a sample; alter the names:
|
495 |
+
|
496 |
+
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
497 |
+
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
498 |
+
|
499 |
+
<signature of Ty Coon>, 1 April 1990
|
500 |
+
Ty Coon, President of Vice
|
501 |
+
|
502 |
+
That's all there is to it!
|
503 |
+
|
504 |
+
|
js/libraries/tiny_mce/plugins/advhr/css/advhr.css
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
input.radio {border:1px none #000; background:transparent; vertical-align:middle;}
|
2 |
+
.panel_wrapper div.current {height:80px;}
|
3 |
+
#width {width:50px; vertical-align:middle;}
|
4 |
+
#width2 {width:50px; vertical-align:middle;}
|
5 |
+
#size {width:100px;}
|
js/libraries/tiny_mce/plugins/advhr/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){tinymce.create("tinymce.plugins.AdvancedHRPlugin",{init:function(a,b){a.addCommand("mceAdvancedHr",function(){a.windowManager.open({file:b+"/rule.htm",width:250+parseInt(a.getLang("advhr.delta_width",0)),height:160+parseInt(a.getLang("advhr.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advhr",{title:"advhr.advhr_desc",cmd:"mceAdvancedHr"});a.onNodeChange.add(function(d,c,e){c.setActive("advhr",e.nodeName=="HR")});a.onClick.add(function(c,d){d=d.target;if(d.nodeName==="HR"){c.selection.select(d)}})},getInfo:function(){return{longname:"Advanced HR",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advhr",tinymce.plugins.AdvancedHRPlugin)})();
|
js/libraries/tiny_mce/plugins/advhr/editor_plugin_src.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.AdvancedHRPlugin', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
// Register commands
|
15 |
+
ed.addCommand('mceAdvancedHr', function() {
|
16 |
+
ed.windowManager.open({
|
17 |
+
file : url + '/rule.htm',
|
18 |
+
width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),
|
19 |
+
height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),
|
20 |
+
inline : 1
|
21 |
+
}, {
|
22 |
+
plugin_url : url
|
23 |
+
});
|
24 |
+
});
|
25 |
+
|
26 |
+
// Register buttons
|
27 |
+
ed.addButton('advhr', {
|
28 |
+
title : 'advhr.advhr_desc',
|
29 |
+
cmd : 'mceAdvancedHr'
|
30 |
+
});
|
31 |
+
|
32 |
+
ed.onNodeChange.add(function(ed, cm, n) {
|
33 |
+
cm.setActive('advhr', n.nodeName == 'HR');
|
34 |
+
});
|
35 |
+
|
36 |
+
ed.onClick.add(function(ed, e) {
|
37 |
+
e = e.target;
|
38 |
+
|
39 |
+
if (e.nodeName === 'HR')
|
40 |
+
ed.selection.select(e);
|
41 |
+
});
|
42 |
+
},
|
43 |
+
|
44 |
+
getInfo : function() {
|
45 |
+
return {
|
46 |
+
longname : 'Advanced HR',
|
47 |
+
author : 'Moxiecode Systems AB',
|
48 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
49 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
|
50 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
51 |
+
};
|
52 |
+
}
|
53 |
+
});
|
54 |
+
|
55 |
+
// Register plugin
|
56 |
+
tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);
|
57 |
+
})();
|
js/libraries/tiny_mce/plugins/advhr/js/rule.js
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var AdvHRDialog = {
|
2 |
+
init : function(ed) {
|
3 |
+
var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w;
|
4 |
+
|
5 |
+
w = dom.getAttrib(n, 'width');
|
6 |
+
f.width.value = w ? parseInt(w) : (dom.getStyle('width') || '');
|
7 |
+
f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || '';
|
8 |
+
f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width');
|
9 |
+
selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px');
|
10 |
+
},
|
11 |
+
|
12 |
+
update : function() {
|
13 |
+
var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = '';
|
14 |
+
|
15 |
+
h = '<hr';
|
16 |
+
|
17 |
+
if (f.size.value) {
|
18 |
+
h += ' size="' + f.size.value + '"';
|
19 |
+
st += ' height:' + f.size.value + 'px;';
|
20 |
+
}
|
21 |
+
|
22 |
+
if (f.width.value) {
|
23 |
+
h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"';
|
24 |
+
st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';';
|
25 |
+
}
|
26 |
+
|
27 |
+
if (f.noshade.checked) {
|
28 |
+
h += ' noshade="noshade"';
|
29 |
+
st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;';
|
30 |
+
}
|
31 |
+
|
32 |
+
if (ed.settings.inline_styles)
|
33 |
+
h += ' style="' + tinymce.trim(st) + '"';
|
34 |
+
|
35 |
+
h += ' />';
|
36 |
+
|
37 |
+
ed.execCommand("mceInsertContent", false, h);
|
38 |
+
tinyMCEPopup.close();
|
39 |
+
}
|
40 |
+
};
|
41 |
+
|
42 |
+
tinyMCEPopup.requireLangPack();
|
43 |
+
tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog);
|
js/libraries/tiny_mce/plugins/advhr/langs/en_dlg.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.addI18n('en.advhr_dlg',{size:"Height",noshade:"No Shadow",width:"Width",normal:"Normal",widthunits:"Units"});
|
js/libraries/tiny_mce/plugins/advhr/rule.htm
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>{#advhr.advhr_desc}</title>
|
5 |
+
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
6 |
+
<script type="text/javascript" src="js/rule.js"></script>
|
7 |
+
<script type="text/javascript" src="../../utils/mctabs.js"></script>
|
8 |
+
<script type="text/javascript" src="../../utils/form_utils.js"></script>
|
9 |
+
<link href="css/advhr.css" rel="stylesheet" type="text/css" />
|
10 |
+
</head>
|
11 |
+
<body role="application">
|
12 |
+
<form onsubmit="AdvHRDialog.update();return false;" action="#">
|
13 |
+
<div class="tabs">
|
14 |
+
<ul>
|
15 |
+
<li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advhr.advhr_desc}</a></span></li>
|
16 |
+
</ul>
|
17 |
+
</div>
|
18 |
+
|
19 |
+
<div class="panel_wrapper">
|
20 |
+
<div id="general_panel" class="panel current">
|
21 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
22 |
+
<tr role="group" aria-labelledby="width_label">
|
23 |
+
<td><label id="width_label" for="width">{#advhr_dlg.width}</label></td>
|
24 |
+
<td class="nowrap">
|
25 |
+
<input id="width" name="width" type="text" value="" class="mceFocus" />
|
26 |
+
<span style="display:none;" id="width_unit_label">{#advhr_dlg.widthunits}</span>
|
27 |
+
<select name="width2" id="width2" aria-labelledby="width_unit_label">
|
28 |
+
<option value="">px</option>
|
29 |
+
<option value="%">%</option>
|
30 |
+
</select>
|
31 |
+
</td>
|
32 |
+
</tr>
|
33 |
+
<tr>
|
34 |
+
<td><label for="size">{#advhr_dlg.size}</label></td>
|
35 |
+
<td><select id="size" name="size">
|
36 |
+
<option value="">{#advhr_dlg.normal}</option>
|
37 |
+
<option value="1">1</option>
|
38 |
+
<option value="2">2</option>
|
39 |
+
<option value="3">3</option>
|
40 |
+
<option value="4">4</option>
|
41 |
+
<option value="5">5</option>
|
42 |
+
</select></td>
|
43 |
+
</tr>
|
44 |
+
<tr>
|
45 |
+
<td><label for="noshade">{#advhr_dlg.noshade}</label></td>
|
46 |
+
<td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td>
|
47 |
+
</tr>
|
48 |
+
</table>
|
49 |
+
</div>
|
50 |
+
</div>
|
51 |
+
|
52 |
+
<div class="mceActionPanel">
|
53 |
+
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
54 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
55 |
+
</div>
|
56 |
+
</form>
|
57 |
+
</body>
|
58 |
+
</html>
|
js/libraries/tiny_mce/plugins/advimage/css/advimage.css
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#src_list, #over_list, #out_list {width:280px;}
|
2 |
+
.mceActionPanel {margin-top:7px;}
|
3 |
+
.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;}
|
4 |
+
.checkbox {border:0;}
|
5 |
+
.panel_wrapper div.current {height:305px;}
|
6 |
+
#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;}
|
7 |
+
#align, #classlist {width:150px;}
|
8 |
+
#width, #height {vertical-align:middle; width:50px; text-align:center;}
|
9 |
+
#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;}
|
10 |
+
#class_list {width:180px;}
|
11 |
+
input {width: 280px;}
|
12 |
+
#constrain, #onmousemovecheck {width:auto;}
|
13 |
+
#id, #dir, #lang, #usemap, #longdesc {width:200px;}
|
js/libraries/tiny_mce/plugins/advimage/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})();
|
js/libraries/tiny_mce/plugins/advimage/editor_plugin_src.js
ADDED
@@ -0,0 +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 |
+
tinymce.create('tinymce.plugins.AdvancedImagePlugin', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
// Register commands
|
15 |
+
ed.addCommand('mceAdvImage', function() {
|
16 |
+
// Internal image object like a flash placeholder
|
17 |
+
if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1)
|
18 |
+
return;
|
19 |
+
|
20 |
+
ed.windowManager.open({
|
21 |
+
file : url + '/image.htm',
|
22 |
+
width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)),
|
23 |
+
height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)),
|
24 |
+
inline : 1
|
25 |
+
}, {
|
26 |
+
plugin_url : url
|
27 |
+
});
|
28 |
+
});
|
29 |
+
|
30 |
+
// Register buttons
|
31 |
+
ed.addButton('image', {
|
32 |
+
title : 'advimage.image_desc',
|
33 |
+
cmd : 'mceAdvImage'
|
34 |
+
});
|
35 |
+
},
|
36 |
+
|
37 |
+
getInfo : function() {
|
38 |
+
return {
|
39 |
+
longname : 'Advanced image',
|
40 |
+
author : 'Moxiecode Systems AB',
|
41 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
42 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',
|
43 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
44 |
+
};
|
45 |
+
}
|
46 |
+
});
|
47 |
+
|
48 |
+
// Register plugin
|
49 |
+
tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin);
|
50 |
+
})();
|
js/libraries/tiny_mce/plugins/advimage/image.htm
ADDED
@@ -0,0 +1,235 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>{#advimage_dlg.dialog_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/form_utils.js"></script>
|
8 |
+
<script type="text/javascript" src="../../utils/validate.js"></script>
|
9 |
+
<script type="text/javascript" src="../../utils/editable_selects.js"></script>
|
10 |
+
<script type="text/javascript" src="js/image.js"></script>
|
11 |
+
<link href="css/advimage.css" rel="stylesheet" type="text/css" />
|
12 |
+
</head>
|
13 |
+
<body id="advimage" style="display: none" role="application" aria-labelledby="app_title">
|
14 |
+
<span id="app_title" style="display:none">{#advimage_dlg.dialog_title}</span>
|
15 |
+
<form onsubmit="ImageDialog.insert();return false;" action="#">
|
16 |
+
<div class="tabs">
|
17 |
+
<ul>
|
18 |
+
<li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advimage_dlg.tab_general}</a></span></li>
|
19 |
+
<li id="appearance_tab" aria-controls="appearance_panel"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#advimage_dlg.tab_appearance}</a></span></li>
|
20 |
+
<li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advimage_dlg.tab_advanced}</a></span></li>
|
21 |
+
</ul>
|
22 |
+
</div>
|
23 |
+
|
24 |
+
<div class="panel_wrapper">
|
25 |
+
<div id="general_panel" class="panel current">
|
26 |
+
<fieldset>
|
27 |
+
<legend>{#advimage_dlg.general}</legend>
|
28 |
+
|
29 |
+
<table role="presentation" class="properties">
|
30 |
+
<tr>
|
31 |
+
<td class="column1"><label id="srclabel" for="src">{#advimage_dlg.src}</label></td>
|
32 |
+
<td colspan="2"><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
33 |
+
<tr>
|
34 |
+
<td><input name="src" type="text" id="src" value="" class="mceFocus" onchange="ImageDialog.showPreviewImage(this.value);" aria-required="true" /></td>
|
35 |
+
<td id="srcbrowsercontainer"> </td>
|
36 |
+
</tr>
|
37 |
+
</table></td>
|
38 |
+
</tr>
|
39 |
+
<tr>
|
40 |
+
<td><label for="src_list">{#advimage_dlg.image_list}</label></td>
|
41 |
+
<td><select id="src_list" name="src_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;document.getElementById('title').value=this.options[this.selectedIndex].text;ImageDialog.showPreviewImage(this.options[this.selectedIndex].value);"><option value=""></option></select></td>
|
42 |
+
</tr>
|
43 |
+
<tr>
|
44 |
+
<td class="column1"><label id="altlabel" for="alt">{#advimage_dlg.alt}</label></td>
|
45 |
+
<td colspan="2"><input id="alt" name="alt" type="text" value="" /></td>
|
46 |
+
</tr>
|
47 |
+
<tr>
|
48 |
+
<td class="column1"><label id="titlelabel" for="title">{#advimage_dlg.title}</label></td>
|
49 |
+
<td colspan="2"><input id="title" name="title" type="text" value="" /></td>
|
50 |
+
</tr>
|
51 |
+
</table>
|
52 |
+
</fieldset>
|
53 |
+
|
54 |
+
<fieldset>
|
55 |
+
<legend>{#advimage_dlg.preview}</legend>
|
56 |
+
<div id="prev"></div>
|
57 |
+
</fieldset>
|
58 |
+
</div>
|
59 |
+
|
60 |
+
<div id="appearance_panel" class="panel">
|
61 |
+
<fieldset>
|
62 |
+
<legend>{#advimage_dlg.tab_appearance}</legend>
|
63 |
+
|
64 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
65 |
+
<tr>
|
66 |
+
<td class="column1"><label id="alignlabel" for="align">{#advimage_dlg.align}</label></td>
|
67 |
+
<td><select id="align" name="align" onchange="ImageDialog.updateStyle('align');ImageDialog.changeAppearance();">
|
68 |
+
<option value="">{#not_set}</option>
|
69 |
+
<option value="baseline">{#advimage_dlg.align_baseline}</option>
|
70 |
+
<option value="top">{#advimage_dlg.align_top}</option>
|
71 |
+
<option value="middle">{#advimage_dlg.align_middle}</option>
|
72 |
+
<option value="bottom">{#advimage_dlg.align_bottom}</option>
|
73 |
+
<option value="text-top">{#advimage_dlg.align_texttop}</option>
|
74 |
+
<option value="text-bottom">{#advimage_dlg.align_textbottom}</option>
|
75 |
+
<option value="left">{#advimage_dlg.align_left}</option>
|
76 |
+
<option value="right">{#advimage_dlg.align_right}</option>
|
77 |
+
</select>
|
78 |
+
</td>
|
79 |
+
<td rowspan="6" valign="top">
|
80 |
+
<div class="alignPreview">
|
81 |
+
<img id="alignSampleImg" src="img/sample.gif" alt="{#advimage_dlg.example_img}" />
|
82 |
+
Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam
|
83 |
+
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum
|
84 |
+
edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam
|
85 |
+
erat volutpat.
|
86 |
+
</div>
|
87 |
+
</td>
|
88 |
+
</tr>
|
89 |
+
|
90 |
+
<tr role="group" aria-labelledby="widthlabel">
|
91 |
+
<td class="column1"><label id="widthlabel" for="width">{#advimage_dlg.dimensions}</label></td>
|
92 |
+
<td class="nowrap">
|
93 |
+
<span style="display:none" id="width_voiceLabel">{#advimage_dlg.width}</span>
|
94 |
+
<input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeHeight();" aria-labelledby="width_voiceLabel" /> x
|
95 |
+
<span style="display:none" id="height_voiceLabel">{#advimage_dlg.height}</span>
|
96 |
+
<input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeWidth();" aria-labelledby="height_voiceLabel" /> px
|
97 |
+
</td>
|
98 |
+
</tr>
|
99 |
+
|
100 |
+
<tr>
|
101 |
+
<td> </td>
|
102 |
+
<td><table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
103 |
+
<tr>
|
104 |
+
<td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
|
105 |
+
<td><label id="constrainlabel" for="constrain">{#advimage_dlg.constrain_proportions}</label></td>
|
106 |
+
</tr>
|
107 |
+
</table></td>
|
108 |
+
</tr>
|
109 |
+
|
110 |
+
<tr>
|
111 |
+
<td class="column1"><label id="vspacelabel" for="vspace">{#advimage_dlg.vspace}</label></td>
|
112 |
+
<td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" />
|
113 |
+
</td>
|
114 |
+
</tr>
|
115 |
+
|
116 |
+
<tr>
|
117 |
+
<td class="column1"><label id="hspacelabel" for="hspace">{#advimage_dlg.hspace}</label></td>
|
118 |
+
<td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" /></td>
|
119 |
+
</tr>
|
120 |
+
|
121 |
+
<tr>
|
122 |
+
<td class="column1"><label id="borderlabel" for="border">{#advimage_dlg.border}</label></td>
|
123 |
+
<td><input id="border" name="border" type="text" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" /></td>
|
124 |
+
</tr>
|
125 |
+
|
126 |
+
<tr>
|
127 |
+
<td><label for="class_list">{#class_name}</label></td>
|
128 |
+
<td colspan="2"><select id="class_list" name="class_list" class="mceEditableSelect"><option value=""></option></select></td>
|
129 |
+
</tr>
|
130 |
+
|
131 |
+
<tr>
|
132 |
+
<td class="column1"><label id="stylelabel" for="style">{#advimage_dlg.style}</label></td>
|
133 |
+
<td colspan="2"><input id="style" name="style" type="text" value="" onchange="ImageDialog.changeAppearance();" /></td>
|
134 |
+
</tr>
|
135 |
+
|
136 |
+
<!-- <tr>
|
137 |
+
<td class="column1"><label id="classeslabel" for="classes">{#advimage_dlg.classes}</label></td>
|
138 |
+
<td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
|
139 |
+
</tr> -->
|
140 |
+
</table>
|
141 |
+
</fieldset>
|
142 |
+
</div>
|
143 |
+
|
144 |
+
<div id="advanced_panel" class="panel">
|
145 |
+
<fieldset>
|
146 |
+
<legend>{#advimage_dlg.swap_image}</legend>
|
147 |
+
|
148 |
+
<input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="ImageDialog.setSwapImage(this.checked);" aria-controls="onmouseoversrc onmouseoutsrc" />
|
149 |
+
<label id="onmousemovechecklabel" for="onmousemovecheck">{#advimage_dlg.alt_image}</label>
|
150 |
+
|
151 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0" width="100%">
|
152 |
+
<tr>
|
153 |
+
<td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{#advimage_dlg.mouseover}</label></td>
|
154 |
+
<td><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
155 |
+
<tr>
|
156 |
+
<td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td>
|
157 |
+
<td id="onmouseoversrccontainer"> </td>
|
158 |
+
</tr>
|
159 |
+
</table></td>
|
160 |
+
</tr>
|
161 |
+
<tr>
|
162 |
+
<td><label for="over_list">{#advimage_dlg.image_list}</label></td>
|
163 |
+
<td><select id="over_list" name="over_list" onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>
|
164 |
+
</tr>
|
165 |
+
<tr>
|
166 |
+
<td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{#advimage_dlg.mouseout}</label></td>
|
167 |
+
<td class="column2"><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
168 |
+
<tr>
|
169 |
+
<td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td>
|
170 |
+
<td id="onmouseoutsrccontainer"> </td>
|
171 |
+
</tr>
|
172 |
+
</table></td>
|
173 |
+
</tr>
|
174 |
+
<tr>
|
175 |
+
<td><label for="out_list">{#advimage_dlg.image_list}</label></td>
|
176 |
+
<td><select id="out_list" name="out_list" onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td>
|
177 |
+
</tr>
|
178 |
+
</table>
|
179 |
+
</fieldset>
|
180 |
+
|
181 |
+
<fieldset>
|
182 |
+
<legend>{#advimage_dlg.misc}</legend>
|
183 |
+
|
184 |
+
<table role="presentation" border="0" cellpadding="4" cellspacing="0">
|
185 |
+
<tr>
|
186 |
+
<td class="column1"><label id="idlabel" for="id">{#advimage_dlg.id}</label></td>
|
187 |
+
<td><input id="id" name="id" type="text" value="" /></td>
|
188 |
+
</tr>
|
189 |
+
|
190 |
+
<tr>
|
191 |
+
<td class="column1"><label id="dirlabel" for="dir">{#advimage_dlg.langdir}</label></td>
|
192 |
+
<td>
|
193 |
+
<select id="dir" name="dir" onchange="ImageDialog.changeAppearance();">
|
194 |
+
<option value="">{#not_set}</option>
|
195 |
+
<option value="ltr">{#advimage_dlg.ltr}</option>
|
196 |
+
<option value="rtl">{#advimage_dlg.rtl}</option>
|
197 |
+
</select>
|
198 |
+
</td>
|
199 |
+
</tr>
|
200 |
+
|
201 |
+
<tr>
|
202 |
+
<td class="column1"><label id="langlabel" for="lang">{#advimage_dlg.langcode}</label></td>
|
203 |
+
<td>
|
204 |
+
<input id="lang" name="lang" type="text" value="" />
|
205 |
+
</td>
|
206 |
+
</tr>
|
207 |
+
|
208 |
+
<tr>
|
209 |
+
<td class="column1"><label id="usemaplabel" for="usemap">{#advimage_dlg.map}</label></td>
|
210 |
+
<td>
|
211 |
+
<input id="usemap" name="usemap" type="text" value="" />
|
212 |
+
</td>
|
213 |
+
</tr>
|
214 |
+
|
215 |
+
<tr>
|
216 |
+
<td class="column1"><label id="longdesclabel" for="longdesc">{#advimage_dlg.long_desc}</label></td>
|
217 |
+
<td><table role="presentation" border="0" cellspacing="0" cellpadding="0">
|
218 |
+
<tr>
|
219 |
+
<td><input id="longdesc" name="longdesc" type="text" value="" /></td>
|
220 |
+
<td id="longdesccontainer"> </td>
|
221 |
+
</tr>
|
222 |
+
</table></td>
|
223 |
+
</tr>
|
224 |
+
</table>
|
225 |
+
</fieldset>
|
226 |
+
</div>
|
227 |
+
</div>
|
228 |
+
|
229 |
+
<div class="mceActionPanel">
|
230 |
+
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
231 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
232 |
+
</div>
|
233 |
+
</form>
|
234 |
+
</body>
|
235 |
+
</html>
|
js/libraries/tiny_mce/plugins/advimage/img/sample.gif
ADDED
Binary file
|
js/libraries/tiny_mce/plugins/advimage/js/image.js
ADDED
@@ -0,0 +1,464 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var ImageDialog = {
|
2 |
+
preInit : function() {
|
3 |
+
var url;
|
4 |
+
|
5 |
+
tinyMCEPopup.requireLangPack();
|
6 |
+
|
7 |
+
if (url = tinyMCEPopup.getParam("external_image_list_url"))
|
8 |
+
document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
|
9 |
+
},
|
10 |
+
|
11 |
+
init : function(ed) {
|
12 |
+
var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList');
|
13 |
+
|
14 |
+
tinyMCEPopup.resizeToInnerSize();
|
15 |
+
this.fillClassList('class_list');
|
16 |
+
this.fillFileList('src_list', fl);
|
17 |
+
this.fillFileList('over_list', fl);
|
18 |
+
this.fillFileList('out_list', fl);
|
19 |
+
TinyMCE_EditableSelects.init();
|
20 |
+
|
21 |
+
if (n.nodeName == 'IMG') {
|
22 |
+
nl.src.value = dom.getAttrib(n, 'src');
|
23 |
+
nl.width.value = dom.getAttrib(n, 'width');
|
24 |
+
nl.height.value = dom.getAttrib(n, 'height');
|
25 |
+
nl.alt.value = dom.getAttrib(n, 'alt');
|
26 |
+
nl.title.value = dom.getAttrib(n, 'title');
|
27 |
+
nl.vspace.value = this.getAttrib(n, 'vspace');
|
28 |
+
nl.hspace.value = this.getAttrib(n, 'hspace');
|
29 |
+
nl.border.value = this.getAttrib(n, 'border');
|
30 |
+
selectByValue(f, 'align', this.getAttrib(n, 'align'));
|
31 |
+
selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true);
|
32 |
+
nl.style.value = dom.getAttrib(n, 'style');
|
33 |
+
nl.id.value = dom.getAttrib(n, 'id');
|
34 |
+
nl.dir.value = dom.getAttrib(n, 'dir');
|
35 |
+
nl.lang.value = dom.getAttrib(n, 'lang');
|
36 |
+
nl.usemap.value = dom.getAttrib(n, 'usemap');
|
37 |
+
nl.longdesc.value = dom.getAttrib(n, 'longdesc');
|
38 |
+
nl.insert.value = ed.getLang('update');
|
39 |
+
|
40 |
+
if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover')))
|
41 |
+
nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');
|
42 |
+
|
43 |
+
if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout')))
|
44 |
+
nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');
|
45 |
+
|
46 |
+
if (ed.settings.inline_styles) {
|
47 |
+
// Move attribs to styles
|
48 |
+
if (dom.getAttrib(n, 'align'))
|
49 |
+
this.updateStyle('align');
|
50 |
+
|
51 |
+
if (dom.getAttrib(n, 'hspace'))
|
52 |
+
this.updateStyle('hspace');
|
53 |
+
|
54 |
+
if (dom.getAttrib(n, 'border'))
|
55 |
+
this.updateStyle('border');
|
56 |
+
|
57 |
+
if (dom.getAttrib(n, 'vspace'))
|
58 |
+
this.updateStyle('vspace');
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
// Setup browse button
|
63 |
+
document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');
|
64 |
+
if (isVisible('srcbrowser'))
|
65 |
+
document.getElementById('src').style.width = '260px';
|
66 |
+
|
67 |
+
// Setup browse button
|
68 |
+
document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image');
|
69 |
+
if (isVisible('overbrowser'))
|
70 |
+
document.getElementById('onmouseoversrc').style.width = '260px';
|
71 |
+
|
72 |
+
// Setup browse button
|
73 |
+
document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image');
|
74 |
+
if (isVisible('outbrowser'))
|
75 |
+
document.getElementById('onmouseoutsrc').style.width = '260px';
|
76 |
+
|
77 |
+
// If option enabled default contrain proportions to checked
|
78 |
+
if (ed.getParam("advimage_constrain_proportions", true))
|
79 |
+
f.constrain.checked = true;
|
80 |
+
|
81 |
+
// Check swap image if valid data
|
82 |
+
if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value)
|
83 |
+
this.setSwapImage(true);
|
84 |
+
else
|
85 |
+
this.setSwapImage(false);
|
86 |
+
|
87 |
+
this.changeAppearance();
|
88 |
+
this.showPreviewImage(nl.src.value, 1);
|
89 |
+
},
|
90 |
+
|
91 |
+
insert : function(file, title) {
|
92 |
+
var ed = tinyMCEPopup.editor, t = this, f = document.forms[0];
|
93 |
+
|
94 |
+
if (f.src.value === '') {
|
95 |
+
if (ed.selection.getNode().nodeName == 'IMG') {
|
96 |
+
ed.dom.remove(ed.selection.getNode());
|
97 |
+
ed.execCommand('mceRepaint');
|
98 |
+
}
|
99 |
+
|
100 |
+
tinyMCEPopup.close();
|
101 |
+
return;
|
102 |
+
}
|
103 |
+
|
104 |
+
if (tinyMCEPopup.getParam("accessibility_warnings", 1)) {
|
105 |
+
if (!f.alt.value) {
|
106 |
+
tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) {
|
107 |
+
if (s)
|
108 |
+
t.insertAndClose();
|
109 |
+
});
|
110 |
+
|
111 |
+
return;
|
112 |
+
}
|
113 |
+
}
|
114 |
+
|
115 |
+
t.insertAndClose();
|
116 |
+
},
|
117 |
+
|
118 |
+
insertAndClose : function() {
|
119 |
+
var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el;
|
120 |
+
|
121 |
+
tinyMCEPopup.restoreSelection();
|
122 |
+
|
123 |
+
// Fixes crash in Safari
|
124 |
+
if (tinymce.isWebKit)
|
125 |
+
ed.getWin().focus();
|
126 |
+
|
127 |
+
if (!ed.settings.inline_styles) {
|
128 |
+
args = {
|
129 |
+
vspace : nl.vspace.value,
|
130 |
+
hspace : nl.hspace.value,
|
131 |
+
border : nl.border.value,
|
132 |
+
align : getSelectValue(f, 'align')
|
133 |
+
};
|
134 |
+
} else {
|
135 |
+
// Remove deprecated values
|
136 |
+
args = {
|
137 |
+
vspace : '',
|
138 |
+
hspace : '',
|
139 |
+
border : '',
|
140 |
+
align : ''
|
141 |
+
};
|
142 |
+
}
|
143 |
+
|
144 |
+
tinymce.extend(args, {
|
145 |
+
src : nl.src.value.replace(/ /g, '%20'),
|
146 |
+
width : nl.width.value,
|
147 |
+
height : nl.height.value,
|
148 |
+
alt : nl.alt.value,
|
149 |
+
title : nl.title.value,
|
150 |
+
'class' : getSelectValue(f, 'class_list'),
|
151 |
+
style : nl.style.value,
|
152 |
+
id : nl.id.value,
|
153 |
+
dir : nl.dir.value,
|
154 |
+
lang : nl.lang.value,
|
155 |
+
usemap : nl.usemap.value,
|
156 |
+
longdesc : nl.longdesc.value
|
157 |
+
});
|
158 |
+
|
159 |
+
args.onmouseover = args.onmouseout = '';
|
160 |
+
|
161 |
+
if (f.onmousemovecheck.checked) {
|
162 |
+
if (nl.onmouseoversrc.value)
|
163 |
+
args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';";
|
164 |
+
|
165 |
+
if (nl.onmouseoutsrc.value)
|
166 |
+
args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';";
|
167 |
+
}
|
168 |
+
|
169 |
+
el = ed.selection.getNode();
|
170 |
+
|
171 |
+
if (el && el.nodeName == 'IMG') {
|
172 |
+
ed.dom.setAttribs(el, args);
|
173 |
+
} else {
|
174 |
+
tinymce.each(args, function(value, name) {
|
175 |
+
if (value === "") {
|
176 |
+
delete args[name];
|
177 |
+
}
|
178 |
+
});
|
179 |
+
|
180 |
+
ed.execCommand('mceInsertContent', false, tinyMCEPopup.editor.dom.createHTML('img', args), {skip_undo : 1});
|
181 |
+
ed.undoManager.add();
|
182 |
+
}
|
183 |
+
|
184 |
+
tinyMCEPopup.editor.execCommand('mceRepaint');
|
185 |
+
tinyMCEPopup.editor.focus();
|
186 |
+
tinyMCEPopup.close();
|
187 |
+
},
|
188 |
+
|
189 |
+
getAttrib : function(e, at) {
|
190 |
+
var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
|
191 |
+
|
192 |
+
if (ed.settings.inline_styles) {
|
193 |
+
switch (at) {
|
194 |
+
case 'align':
|
195 |
+
if (v = dom.getStyle(e, 'float'))
|
196 |
+
return v;
|
197 |
+
|
198 |
+
if (v = dom.getStyle(e, 'vertical-align'))
|
199 |
+
return v;
|
200 |
+
|
201 |
+
break;
|
202 |
+
|
203 |
+
case 'hspace':
|
204 |
+
v = dom.getStyle(e, 'margin-left')
|
205 |
+
v2 = dom.getStyle(e, 'margin-right');
|
206 |
+
|
207 |
+
if (v && v == v2)
|
208 |
+
return parseInt(v.replace(/[^0-9]/g, ''));
|
209 |
+
|
210 |
+
break;
|
211 |
+
|
212 |
+
case 'vspace':
|
213 |
+
v = dom.getStyle(e, 'margin-top')
|
214 |
+
v2 = dom.getStyle(e, 'margin-bottom');
|
215 |
+
if (v && v == v2)
|
216 |
+
return parseInt(v.replace(/[^0-9]/g, ''));
|
217 |
+
|
218 |
+
break;
|
219 |
+
|
220 |
+
case 'border':
|
221 |
+
v = 0;
|
222 |
+
|
223 |
+
tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {
|
224 |
+
sv = dom.getStyle(e, 'border-' + sv + '-width');
|
225 |
+
|
226 |
+
// False or not the same as prev
|
227 |
+
if (!sv || (sv != v && v !== 0)) {
|
228 |
+
v = 0;
|
229 |
+
return false;
|
230 |
+
}
|
231 |
+
|
232 |
+
if (sv)
|
233 |
+
v = sv;
|
234 |
+
});
|
235 |
+
|
236 |
+
if (v)
|
237 |
+
return parseInt(v.replace(/[^0-9]/g, ''));
|
238 |
+
|
239 |
+
break;
|
240 |
+
}
|
241 |
+
}
|
242 |
+
|
243 |
+
if (v = dom.getAttrib(e, at))
|
244 |
+
return v;
|
245 |
+
|
246 |
+
return '';
|
247 |
+
},
|
248 |
+
|
249 |
+
setSwapImage : function(st) {
|
250 |
+
var f = document.forms[0];
|
251 |
+
|
252 |
+
f.onmousemovecheck.checked = st;
|
253 |
+
setBrowserDisabled('overbrowser', !st);
|
254 |
+
setBrowserDisabled('outbrowser', !st);
|
255 |
+
|
256 |
+
if (f.over_list)
|
257 |
+
f.over_list.disabled = !st;
|
258 |
+
|
259 |
+
if (f.out_list)
|
260 |
+
f.out_list.disabled = !st;
|
261 |
+
|
262 |
+
f.onmouseoversrc.disabled = !st;
|
263 |
+
f.onmouseoutsrc.disabled = !st;
|
264 |
+
},
|
265 |
+
|
266 |
+
fillClassList : function(id) {
|
267 |
+
var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
|
268 |
+
|
269 |
+
if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {
|
270 |
+
cl = [];
|
271 |
+
|
272 |
+
tinymce.each(v.split(';'), function(v) {
|
273 |
+
var p = v.split('=');
|
274 |
+
|
275 |
+
cl.push({'title' : p[0], 'class' : p[1]});
|
276 |
+
});
|
277 |
+
} else
|
278 |
+
cl = tinyMCEPopup.editor.dom.getClasses();
|
279 |
+
|
280 |
+
if (cl.length > 0) {
|
281 |
+
lst.options.length = 0;
|
282 |
+
lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
|
283 |
+
|
284 |
+
tinymce.each(cl, function(o) {
|
285 |
+
lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);
|
286 |
+
});
|
287 |
+
} else
|
288 |
+
dom.remove(dom.getParent(id, 'tr'));
|
289 |
+
},
|
290 |
+
|
291 |
+
fillFileList : function(id, l) {
|
292 |
+
var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
|
293 |
+
|
294 |
+
l = typeof(l) === 'function' ? l() : window[l];
|
295 |
+
lst.options.length = 0;
|
296 |
+
|
297 |
+
if (l && l.length > 0) {
|
298 |
+
lst.options[lst.options.length] = new Option('', '');
|
299 |
+
|
300 |
+
tinymce.each(l, function(o) {
|
301 |
+
lst.options[lst.options.length] = new Option(o[0], o[1]);
|
302 |
+
});
|
303 |
+
} else
|
304 |
+
dom.remove(dom.getParent(id, 'tr'));
|
305 |
+
},
|
306 |
+
|
307 |
+
resetImageData : function() {
|
308 |
+
var f = document.forms[0];
|
309 |
+
|
310 |
+
f.elements.width.value = f.elements.height.value = '';
|
311 |
+
},
|
312 |
+
|
313 |
+
updateImageData : function(img, st) {
|
314 |
+
var f = document.forms[0];
|
315 |
+
|
316 |
+
if (!st) {
|
317 |
+
f.elements.width.value = img.width;
|
318 |
+
f.elements.height.value = img.height;
|
319 |
+
}
|
320 |
+
|
321 |
+
this.preloadImg = img;
|
322 |
+
},
|
323 |
+
|
324 |
+
changeAppearance : function() {
|
325 |
+
var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg');
|
326 |
+
|
327 |
+
if (img) {
|
328 |
+
if (ed.getParam('inline_styles')) {
|
329 |
+
ed.dom.setAttrib(img, 'style', f.style.value);
|
330 |
+
} else {
|
331 |
+
img.align = f.align.value;
|
332 |
+
img.border = f.border.value;
|
333 |
+
img.hspace = f.hspace.value;
|
334 |
+
img.vspace = f.vspace.value;
|
335 |
+
}
|
336 |
+
}
|
337 |
+
},
|
338 |
+
|
339 |
+
changeHeight : function() {
|
340 |
+
var f = document.forms[0], tp, t = this;
|
341 |
+
|
342 |
+
if (!f.constrain.checked || !t.preloadImg) {
|
343 |
+
return;
|
344 |
+
}
|
345 |
+
|
346 |
+
if (f.width.value == "" || f.height.value == "")
|
347 |
+
return;
|
348 |
+
|
349 |
+
tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height;
|
350 |
+
f.height.value = tp.toFixed(0);
|
351 |
+
},
|
352 |
+
|
353 |
+
changeWidth : function() {
|
354 |
+
var f = document.forms[0], tp, t = this;
|
355 |
+
|
356 |
+
if (!f.constrain.checked || !t.preloadImg) {
|
357 |
+
return;
|
358 |
+
}
|
359 |
+
|
360 |
+
if (f.width.value == "" || f.height.value == "")
|
361 |
+
return;
|
362 |
+
|
363 |
+
tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width;
|
364 |
+
f.width.value = tp.toFixed(0);
|
365 |
+
},
|
366 |
+
|
367 |
+
updateStyle : function(ty) {
|
368 |
+
var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value});
|
369 |
+
|
370 |
+
if (tinyMCEPopup.editor.settings.inline_styles) {
|
371 |
+
// Handle align
|
372 |
+
if (ty == 'align') {
|
373 |
+
dom.setStyle(img, 'float', '');
|
374 |
+
dom.setStyle(img, 'vertical-align', '');
|
375 |
+
|
376 |
+
v = getSelectValue(f, 'align');
|
377 |
+
if (v) {
|
378 |
+
if (v == 'left' || v == 'right')
|
379 |
+
dom.setStyle(img, 'float', v);
|
380 |
+
else
|
381 |
+
img.style.verticalAlign = v;
|
382 |
+
}
|
383 |
+
}
|
384 |
+
|
385 |
+
// Handle border
|
386 |
+
if (ty == 'border') {
|
387 |
+
b = img.style.border ? img.style.border.split(' ') : [];
|
388 |
+
bStyle = dom.getStyle(img, 'border-style');
|
389 |
+
bColor = dom.getStyle(img, 'border-color');
|
390 |
+
|
391 |
+
dom.setStyle(img, 'border', '');
|
392 |
+
|
393 |
+
v = f.border.value;
|
394 |
+
if (v || v == '0') {
|
395 |
+
if (v == '0')
|
396 |
+
img.style.border = isIE ? '0' : '0 none none';
|
397 |
+
else {
|
398 |
+
var isOldIE = tinymce.isIE && (!document.documentMode || document.documentMode < 9);
|
399 |
+
|
400 |
+
if (b.length == 3 && b[isOldIE ? 2 : 1])
|
401 |
+
bStyle = b[isOldIE ? 2 : 1];
|
402 |
+
else if (!bStyle || bStyle == 'none')
|
403 |
+
bStyle = 'solid';
|
404 |
+
if (b.length == 3 && b[isIE ? 0 : 2])
|
405 |
+
bColor = b[isOldIE ? 0 : 2];
|
406 |
+
else if (!bColor || bColor == 'none')
|
407 |
+
bColor = 'black';
|
408 |
+
img.style.border = v + 'px ' + bStyle + ' ' + bColor;
|
409 |
+
}
|
410 |
+
}
|
411 |
+
}
|
412 |
+
|
413 |
+
// Handle hspace
|
414 |
+
if (ty == 'hspace') {
|
415 |
+
dom.setStyle(img, 'marginLeft', '');
|
416 |
+
dom.setStyle(img, 'marginRight', '');
|
417 |
+
|
418 |
+
v = f.hspace.value;
|
419 |
+
if (v) {
|
420 |
+
img.style.marginLeft = v + 'px';
|
421 |
+
img.style.marginRight = v + 'px';
|
422 |
+
}
|
423 |
+
}
|
424 |
+
|
425 |
+
// Handle vspace
|
426 |
+
if (ty == 'vspace') {
|
427 |
+
dom.setStyle(img, 'marginTop', '');
|
428 |
+
dom.setStyle(img, 'marginBottom', '');
|
429 |
+
|
430 |
+
v = f.vspace.value;
|
431 |
+
if (v) {
|
432 |
+
img.style.marginTop = v + 'px';
|
433 |
+
img.style.marginBottom = v + 'px';
|
434 |
+
}
|
435 |
+
}
|
436 |
+
|
437 |
+
// Merge
|
438 |
+
dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img');
|
439 |
+
}
|
440 |
+
},
|
441 |
+
|
442 |
+
changeMouseMove : function() {
|
443 |
+
},
|
444 |
+
|
445 |
+
showPreviewImage : function(u, st) {
|
446 |
+
if (!u) {
|
447 |
+
tinyMCEPopup.dom.setHTML('prev', '');
|
448 |
+
return;
|
449 |
+
}
|
450 |
+
|
451 |
+
if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true))
|
452 |
+
this.resetImageData();
|
453 |
+
|
454 |
+
u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u);
|
455 |
+
|
456 |
+
if (!st)
|
457 |
+
tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this);" onerror="ImageDialog.resetImageData();" />');
|
458 |
+
else
|
459 |
+
tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this, 1);" />');
|
460 |
+
}
|
461 |
+
};
|
462 |
+
|
463 |
+
ImageDialog.preInit();
|
464 |
+
tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);
|
js/libraries/tiny_mce/plugins/advimage/langs/en_dlg.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.addI18n('en.advimage_dlg',{"image_list":"Image List","align_right":"Right","align_left":"Left","align_textbottom":"Text Bottom","align_texttop":"Text Top","align_bottom":"Bottom","align_middle":"Middle","align_top":"Top","align_baseline":"Baseline",align:"Alignment",hspace:"Horizontal Space",vspace:"Vertical Space",dimensions:"Dimensions",border:"Border",list:"Image List",alt:"Image Description",src:"Image URL","dialog_title":"Insert/Edit Image","missing_alt":"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.","example_img":"Appearance Preview Image",misc:"Miscellaneous",mouseout:"For Mouse Out",mouseover:"For Mouse Over","alt_image":"Alternative Image","swap_image":"Swap Image",map:"Image Map",id:"ID",rtl:"Right to Left",ltr:"Left to Right",classes:"Classes",style:"Style","long_desc":"Long Description Link",langcode:"Language Code",langdir:"Language Direction","constrain_proportions":"Constrain Proportions",preview:"Preview",title:"Title",general:"General","tab_advanced":"Advanced","tab_appearance":"Appearance","tab_general":"General",width:"Width",height:"Height"});
|
js/libraries/tiny_mce/plugins/advlink/css/advlink.css
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.mceLinkList, .mceAnchorList, #targetlist {width:280px;}
|
2 |
+
.mceActionPanel {margin-top:7px;}
|
3 |
+
.panel_wrapper div.current {height:320px;}
|
4 |
+
#classlist, #title, #href {width:280px;}
|
5 |
+
#popupurl, #popupname {width:200px;}
|
6 |
+
#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;}
|
7 |
+
#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;}
|
8 |
+
#events_panel input {width:200px;}
|
js/libraries/tiny_mce/plugins/advlink/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})();
|
js/libraries/tiny_mce/plugins/advlink/editor_plugin_src.js
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.AdvancedLinkPlugin', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
this.editor = ed;
|
15 |
+
|
16 |
+
// Register commands
|
17 |
+
ed.addCommand('mceAdvLink', function() {
|
18 |
+
var se = ed.selection;
|
19 |
+
|
20 |
+
// No selection and not in link
|
21 |
+
if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))
|
22 |
+
return;
|
23 |
+
|
24 |
+
ed.windowManager.open({
|
25 |
+
file : url + '/link.htm',
|
26 |
+
width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)),
|
27 |
+
height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)),
|
28 |
+
inline : 1
|
29 |
+
}, {
|
30 |
+
plugin_url : url
|
31 |
+
});
|
32 |
+
});
|
33 |
+
|
34 |
+
// Register buttons
|
35 |
+
ed.addButton('link', {
|
36 |
+
title : 'advlink.link_desc',
|
37 |
+
cmd : 'mceAdvLink'
|
38 |
+
});
|
39 |
+
|
40 |
+
ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink');
|
41 |
+
|
42 |
+
ed.onNodeChange.add(function(ed, cm, n, co) {
|
43 |
+
cm.setDisabled('link', co && n.nodeName != 'A');
|
44 |
+
cm.setActive('link', n.nodeName == 'A' && !n.name);
|
45 |
+
});
|
46 |
+
},
|
47 |
+
|
48 |
+
getInfo : function() {
|
49 |
+
return {
|
50 |
+
longname : 'Advanced link',
|
51 |
+
author : 'Moxiecode Systems AB',
|
52 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
53 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',
|
54 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
55 |
+
};
|
56 |
+
}
|
57 |
+
});
|
58 |
+
|
59 |
+
// Register plugin
|
60 |
+
tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin);
|
61 |
+
})();
|
js/libraries/tiny_mce/plugins/advlink/js/advlink.js
ADDED
@@ -0,0 +1,543 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Functions for the advlink plugin popup */
|
2 |
+
|
3 |
+
tinyMCEPopup.requireLangPack();
|
4 |
+
|
5 |
+
var templates = {
|
6 |
+
"window.open" : "window.open('${url}','${target}','${options}')"
|
7 |
+
};
|
8 |
+
|
9 |
+
function preinit() {
|
10 |
+
var url;
|
11 |
+
|
12 |
+
if (url = tinyMCEPopup.getParam("external_link_list_url"))
|
13 |
+
document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
|
14 |
+
}
|
15 |
+
|
16 |
+
function changeClass() {
|
17 |
+
var f = document.forms[0];
|
18 |
+
|
19 |
+
f.classes.value = getSelectValue(f, 'classlist');
|
20 |
+
}
|
21 |
+
|
22 |
+
function init() {
|
23 |
+
tinyMCEPopup.resizeToInnerSize();
|
24 |
+
|
25 |
+
var formObj = document.forms[0];
|
26 |
+
var inst = tinyMCEPopup.editor;
|
27 |
+
var elm = inst.selection.getNode();
|
28 |
+
var action = "insert";
|
29 |
+
var html;
|
30 |
+
|
31 |
+
document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink');
|
32 |
+
document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink');
|
33 |
+
document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target');
|
34 |
+
|
35 |
+
// Link list
|
36 |
+
html = getLinkListHTML('linklisthref','href');
|
37 |
+
if (html == "")
|
38 |
+
document.getElementById("linklisthrefrow").style.display = 'none';
|
39 |
+
else
|
40 |
+
document.getElementById("linklisthrefcontainer").innerHTML = html;
|
41 |
+
|
42 |
+
// Anchor list
|
43 |
+
html = getAnchorListHTML('anchorlist','href');
|
44 |
+
if (html == "")
|
45 |
+
document.getElementById("anchorlistrow").style.display = 'none';
|
46 |
+
else
|
47 |
+
document.getElementById("anchorlistcontainer").innerHTML = html;
|
48 |
+
|
49 |
+
// Resize some elements
|
50 |
+
if (isVisible('hrefbrowser'))
|
51 |
+
document.getElementById('href').style.width = '260px';
|
52 |
+
|
53 |
+
if (isVisible('popupurlbrowser'))
|
54 |
+
document.getElementById('popupurl').style.width = '180px';
|
55 |
+
|
56 |
+
elm = inst.dom.getParent(elm, "A");
|
57 |
+
if (elm == null) {
|
58 |
+
var prospect = inst.dom.create("p", null, inst.selection.getContent());
|
59 |
+
if (prospect.childNodes.length === 1) {
|
60 |
+
elm = prospect.firstChild;
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
if (elm != null && elm.nodeName == "A")
|
65 |
+
action = "update";
|
66 |
+
|
67 |
+
formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true);
|
68 |
+
|
69 |
+
setPopupControlsDisabled(true);
|
70 |
+
|
71 |
+
if (action == "update") {
|
72 |
+
var href = inst.dom.getAttrib(elm, 'href');
|
73 |
+
var onclick = inst.dom.getAttrib(elm, 'onclick');
|
74 |
+
var linkTarget = inst.dom.getAttrib(elm, 'target') ? inst.dom.getAttrib(elm, 'target') : "_self";
|
75 |
+
|
76 |
+
// Setup form data
|
77 |
+
setFormValue('href', href);
|
78 |
+
setFormValue('title', inst.dom.getAttrib(elm, 'title'));
|
79 |
+
setFormValue('id', inst.dom.getAttrib(elm, 'id'));
|
80 |
+
setFormValue('style', inst.dom.getAttrib(elm, "style"));
|
81 |
+
setFormValue('rel', inst.dom.getAttrib(elm, 'rel'));
|
82 |
+
setFormValue('rev', inst.dom.getAttrib(elm, 'rev'));
|
83 |
+
setFormValue('charset', inst.dom.getAttrib(elm, 'charset'));
|
84 |
+
setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang'));
|
85 |
+
setFormValue('dir', inst.dom.getAttrib(elm, 'dir'));
|
86 |
+
setFormValue('lang', inst.dom.getAttrib(elm, 'lang'));
|
87 |
+
setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
|
88 |
+
setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
|
89 |
+
setFormValue('type', inst.dom.getAttrib(elm, 'type'));
|
90 |
+
setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus'));
|
91 |
+
setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur'));
|
92 |
+
setFormValue('onclick', onclick);
|
93 |
+
setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick'));
|
94 |
+
setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown'));
|
95 |
+
setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup'));
|
96 |
+
setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover'));
|
97 |
+
setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove'));
|
98 |
+
setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout'));
|
99 |
+
setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress'));
|
100 |
+
setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown'));
|
101 |
+
setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup'));
|
102 |
+
setFormValue('target', linkTarget);
|
103 |
+
setFormValue('classes', inst.dom.getAttrib(elm, 'class'));
|
104 |
+
|
105 |
+
// Parse onclick data
|
106 |
+
if (onclick != null && onclick.indexOf('window.open') != -1)
|
107 |
+
parseWindowOpen(onclick);
|
108 |
+
else
|
109 |
+
parseFunction(onclick);
|
110 |
+
|
111 |
+
// Select by the values
|
112 |
+
selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir'));
|
113 |
+
selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel'));
|
114 |
+
selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev'));
|
115 |
+
selectByValue(formObj, 'linklisthref', href);
|
116 |
+
|
117 |
+
if (href.charAt(0) == '#')
|
118 |
+
selectByValue(formObj, 'anchorlist', href);
|
119 |
+
|
120 |
+
addClassesToList('classlist', 'advlink_styles');
|
121 |
+
|
122 |
+
selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true);
|
123 |
+
selectByValue(formObj, 'targetlist', linkTarget, true);
|
124 |
+
} else
|
125 |
+
addClassesToList('classlist', 'advlink_styles');
|
126 |
+
}
|
127 |
+
|
128 |
+
function checkPrefix(n) {
|
129 |
+
if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email')))
|
130 |
+
n.value = 'mailto:' + n.value;
|
131 |
+
|
132 |
+
if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external')))
|
133 |
+
n.value = 'http://' + n.value;
|
134 |
+
}
|
135 |
+
|
136 |
+
function setFormValue(name, value) {
|
137 |
+
document.forms[0].elements[name].value = value;
|
138 |
+
}
|
139 |
+
|
140 |
+
function parseWindowOpen(onclick) {
|
141 |
+
var formObj = document.forms[0];
|
142 |
+
|
143 |
+
// Preprocess center code
|
144 |
+
if (onclick.indexOf('return false;') != -1) {
|
145 |
+
formObj.popupreturn.checked = true;
|
146 |
+
onclick = onclick.replace('return false;', '');
|
147 |
+
} else
|
148 |
+
formObj.popupreturn.checked = false;
|
149 |
+
|
150 |
+
var onClickData = parseLink(onclick);
|
151 |
+
|
152 |
+
if (onClickData != null) {
|
153 |
+
formObj.ispopup.checked = true;
|
154 |
+
setPopupControlsDisabled(false);
|
155 |
+
|
156 |
+
var onClickWindowOptions = parseOptions(onClickData['options']);
|
157 |
+
var url = onClickData['url'];
|
158 |
+
|
159 |
+
formObj.popupname.value = onClickData['target'];
|
160 |
+
formObj.popupurl.value = url;
|
161 |
+
formObj.popupwidth.value = getOption(onClickWindowOptions, 'width');
|
162 |
+
formObj.popupheight.value = getOption(onClickWindowOptions, 'height');
|
163 |
+
|
164 |
+
formObj.popupleft.value = getOption(onClickWindowOptions, 'left');
|
165 |
+
formObj.popuptop.value = getOption(onClickWindowOptions, 'top');
|
166 |
+
|
167 |
+
if (formObj.popupleft.value.indexOf('screen') != -1)
|
168 |
+
formObj.popupleft.value = "c";
|
169 |
+
|
170 |
+
if (formObj.popuptop.value.indexOf('screen') != -1)
|
171 |
+
formObj.popuptop.value = "c";
|
172 |
+
|
173 |
+
formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes";
|
174 |
+
formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes";
|
175 |
+
formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes";
|
176 |
+
formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes";
|
177 |
+
formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes";
|
178 |
+
formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes";
|
179 |
+
formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes";
|
180 |
+
|
181 |
+
buildOnClick();
|
182 |
+
}
|
183 |
+
}
|
184 |
+
|
185 |
+
function parseFunction(onclick) {
|
186 |
+
var formObj = document.forms[0];
|
187 |
+
var onClickData = parseLink(onclick);
|
188 |
+
|
189 |
+
// TODO: Add stuff here
|
190 |
+
}
|
191 |
+
|
192 |
+
function getOption(opts, name) {
|
193 |
+
return typeof(opts[name]) == "undefined" ? "" : opts[name];
|
194 |
+
}
|
195 |
+
|
196 |
+
function setPopupControlsDisabled(state) {
|
197 |
+
var formObj = document.forms[0];
|
198 |
+
|
199 |
+
formObj.popupname.disabled = state;
|
200 |
+
formObj.popupurl.disabled = state;
|
201 |
+
formObj.popupwidth.disabled = state;
|
202 |
+
formObj.popupheight.disabled = state;
|
203 |
+
formObj.popupleft.disabled = state;
|
204 |
+
formObj.popuptop.disabled = state;
|
205 |
+
formObj.popuplocation.disabled = state;
|
206 |
+
formObj.popupscrollbars.disabled = state;
|
207 |
+
formObj.popupmenubar.disabled = state;
|
208 |
+
formObj.popupresizable.disabled = state;
|
209 |
+
formObj.popuptoolbar.disabled = state;
|
210 |
+
formObj.popupstatus.disabled = state;
|
211 |
+
formObj.popupreturn.disabled = state;
|
212 |
+
formObj.popupdependent.disabled = state;
|
213 |
+
|
214 |
+
setBrowserDisabled('popupurlbrowser', state);
|
215 |
+
}
|
216 |
+
|
217 |
+
function parseLink(link) {
|
218 |
+
link = link.replace(new RegExp(''', 'g'), "'");
|
219 |
+
|
220 |
+
var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1");
|
221 |
+
|
222 |
+
// Is function name a template function
|
223 |
+
var template = templates[fnName];
|
224 |
+
if (template) {
|
225 |
+
// Build regexp
|
226 |
+
var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi"));
|
227 |
+
var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\(";
|
228 |
+
var replaceStr = "";
|
229 |
+
for (var i=0; i<variableNames.length; i++) {
|
230 |
+
// Is string value
|
231 |
+
if (variableNames[i].indexOf("'${") != -1)
|
232 |
+
regExp += "'(.*)'";
|
233 |
+
else // Number value
|
234 |
+
regExp += "([0-9]*)";
|
235 |
+
|
236 |
+
replaceStr += "$" + (i+1);
|
237 |
+
|
238 |
+
// Cleanup variable name
|
239 |
+
variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), "");
|
240 |
+
|
241 |
+
if (i != variableNames.length-1) {
|
242 |
+
regExp += "\\s*,\\s*";
|
243 |
+
replaceStr += "<delim>";
|
244 |
+
} else
|
245 |
+
regExp += ".*";
|
246 |
+
}
|
247 |
+
|
248 |
+
regExp += "\\);?";
|
249 |
+
|
250 |
+
// Build variable array
|
251 |
+
var variables = [];
|
252 |
+
variables["_function"] = fnName;
|
253 |
+
var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');
|
254 |
+
for (var i=0; i<variableNames.length; i++)
|
255 |
+
variables[variableNames[i]] = variableValues[i];
|
256 |
+
|
257 |
+
return variables;
|
258 |
+
}
|
259 |
+
|
260 |
+
return null;
|
261 |
+
}
|
262 |
+
|
263 |
+
function parseOptions(opts) {
|
264 |
+
if (opts == null || opts == "")
|
265 |
+
return [];
|
266 |
+
|
267 |
+
// Cleanup the options
|
268 |
+
opts = opts.toLowerCase();
|
269 |
+
opts = opts.replace(/;/g, ",");
|
270 |
+
opts = opts.replace(/[^0-9a-z=,]/g, "");
|
271 |
+
|
272 |
+
var optionChunks = opts.split(',');
|
273 |
+
var options = [];
|
274 |
+
|
275 |
+
for (var i=0; i<optionChunks.length; i++) {
|
276 |
+
var parts = optionChunks[i].split('=');
|
277 |
+
|
278 |
+
if (parts.length == 2)
|
279 |
+
options[parts[0]] = parts[1];
|
280 |
+
}
|
281 |
+
|
282 |
+
return options;
|
283 |
+
}
|
284 |
+
|
285 |
+
function buildOnClick() {
|
286 |
+
var formObj = document.forms[0];
|
287 |
+
|
288 |
+
if (!formObj.ispopup.checked) {
|
289 |
+
formObj.onclick.value = "";
|
290 |
+
return;
|
291 |
+
}
|
292 |
+
|
293 |
+
var onclick = "window.open('";
|
294 |
+
var url = formObj.popupurl.value;
|
295 |
+
|
296 |
+
onclick += url + "','";
|
297 |
+
onclick += formObj.popupname.value + "','";
|
298 |
+
|
299 |
+
if (formObj.popuplocation.checked)
|
300 |
+
onclick += "location=yes,";
|
301 |
+
|
302 |
+
if (formObj.popupscrollbars.checked)
|
303 |
+
onclick += "scrollbars=yes,";
|
304 |
+
|
305 |
+
if (formObj.popupmenubar.checked)
|
306 |
+
onclick += "menubar=yes,";
|
307 |
+
|
308 |
+
if (formObj.popupresizable.checked)
|
309 |
+
onclick += "resizable=yes,";
|
310 |
+
|
311 |
+
if (formObj.popuptoolbar.checked)
|
312 |
+
onclick += "toolbar=yes,";
|
313 |
+
|
314 |
+
if (formObj.popupstatus.checked)
|
315 |
+
onclick += "status=yes,";
|
316 |
+
|
317 |
+
if (formObj.popupdependent.checked)
|
318 |
+
onclick += "dependent=yes,";
|
319 |
+
|
320 |
+
if (formObj.popupwidth.value != "")
|
321 |
+
onclick += "width=" + formObj.popupwidth.value + ",";
|
322 |
+
|
323 |
+
if (formObj.popupheight.value != "")
|
324 |
+
onclick += "height=" + formObj.popupheight.value + ",";
|
325 |
+
|
326 |
+
if (formObj.popupleft.value != "") {
|
327 |
+
if (formObj.popupleft.value != "c")
|
328 |
+
onclick += "left=" + formObj.popupleft.value + ",";
|
329 |
+
else
|
330 |
+
onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',";
|
331 |
+
}
|
332 |
+
|
333 |
+
if (formObj.popuptop.value != "") {
|
334 |
+
if (formObj.popuptop.value != "c")
|
335 |
+
onclick += "top=" + formObj.popuptop.value + ",";
|
336 |
+
else
|
337 |
+
onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',";
|
338 |
+
}
|
339 |
+
|
340 |
+
if (onclick.charAt(onclick.length-1) == ',')
|
341 |
+
onclick = onclick.substring(0, onclick.length-1);
|
342 |
+
|
343 |
+
onclick += "');";
|
344 |
+
|
345 |
+
if (formObj.popupreturn.checked)
|
346 |
+
onclick += "return false;";
|
347 |
+
|
348 |
+
// tinyMCE.debug(onclick);
|
349 |
+
|
350 |
+
formObj.onclick.value = onclick;
|
351 |
+
|
352 |
+
if (formObj.href.value == "")
|
353 |
+
formObj.href.value = url;
|
354 |
+
}
|
355 |
+
|
356 |
+
function setAttrib(elm, attrib, value) {
|
357 |
+
var formObj = document.forms[0];
|
358 |
+
var valueElm = formObj.elements[attrib.toLowerCase()];
|
359 |
+
var dom = tinyMCEPopup.editor.dom;
|
360 |
+
|
361 |
+
if (typeof(value) == "undefined" || value == null) {
|
362 |
+
value = "";
|
363 |
+
|
364 |
+
if (valueElm)
|
365 |
+
value = valueElm.value;
|
366 |
+
}
|
367 |
+
|
368 |
+
// Clean up the style
|
369 |
+
if (attrib == 'style')
|
370 |
+
value = dom.serializeStyle(dom.parseStyle(value), 'a');
|
371 |
+
|
372 |
+
dom.setAttrib(elm, attrib, value);
|
373 |
+
}
|
374 |
+
|
375 |
+
function getAnchorListHTML(id, target) {
|
376 |
+
var ed = tinyMCEPopup.editor, nodes = ed.dom.select('a'), name, i, len, html = "";
|
377 |
+
|
378 |
+
for (i=0, len=nodes.length; i<len; i++) {
|
379 |
+
if ((name = ed.dom.getAttrib(nodes[i], "name")) != "")
|
380 |
+
html += '<option value="#' + name + '">' + name + '</option>';
|
381 |
+
|
382 |
+
if ((name = nodes[i].id) != "" && !nodes[i].href)
|
383 |
+
html += '<option value="#' + name + '">' + name + '</option>';
|
384 |
+
}
|
385 |
+
|
386 |
+
if (html == "")
|
387 |
+
return "";
|
388 |
+
|
389 |
+
html = '<select id="' + id + '" name="' + id + '" class="mceAnchorList"'
|
390 |
+
+ ' onchange="this.form.' + target + '.value=this.options[this.selectedIndex].value"'
|
391 |
+
+ '>'
|
392 |
+
+ '<option value="">---</option>'
|
393 |
+
+ html
|
394 |
+
+ '</select>';
|
395 |
+
|
396 |
+
return html;
|
397 |
+
}
|
398 |
+
|
399 |
+
function insertAction() {
|
400 |
+
var inst = tinyMCEPopup.editor;
|
401 |
+
var elm, elementArray, i;
|
402 |
+
|
403 |
+
elm = inst.selection.getNode();
|
404 |
+
checkPrefix(document.forms[0].href);
|
405 |
+
|
406 |
+
elm = inst.dom.getParent(elm, "A");
|
407 |
+
|
408 |
+
// Remove element if there is no href
|
409 |
+
if (!document.forms[0].href.value) {
|
410 |
+
i = inst.selection.getBookmark();
|
411 |
+
inst.dom.remove(elm, 1);
|
412 |
+
inst.selection.moveToBookmark(i);
|
413 |
+
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
414 |
+
tinyMCEPopup.close();
|
415 |
+
return;
|
416 |
+
}
|
417 |
+
|
418 |
+
// Create new anchor elements
|
419 |
+
if (elm == null) {
|
420 |
+
inst.getDoc().execCommand("unlink", false, null);
|
421 |
+
tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1});
|
422 |
+
|
423 |
+
elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});
|
424 |
+
for (i=0; i<elementArray.length; i++)
|
425 |
+
setAllAttribs(elm = elementArray[i]);
|
426 |
+
} else
|
427 |
+
setAllAttribs(elm);
|
428 |
+
|
429 |
+
// Don't move caret if selection was image
|
430 |
+
if (elm.childNodes.length != 1 || elm.firstChild.nodeName != 'IMG') {
|
431 |
+
inst.focus();
|
432 |
+
inst.selection.select(elm);
|
433 |
+
inst.selection.collapse(0);
|
434 |
+
tinyMCEPopup.storeSelection();
|
435 |
+
}
|
436 |
+
|
437 |
+
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
438 |
+
tinyMCEPopup.close();
|
439 |
+
}
|
440 |
+
|
441 |
+
function setAllAttribs(elm) {
|
442 |
+
var formObj = document.forms[0];
|
443 |
+
var href = formObj.href.value.replace(/ /g, '%20');
|
444 |
+
var target = getSelectValue(formObj, 'targetlist');
|
445 |
+
|
446 |
+
setAttrib(elm, 'href', href);
|
447 |
+
setAttrib(elm, 'title');
|
448 |
+
setAttrib(elm, 'target', target == '_self' ? '' : target);
|
449 |
+
setAttrib(elm, 'id');
|
450 |
+
setAttrib(elm, 'style');
|
451 |
+
setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));
|
452 |
+
setAttrib(elm, 'rel');
|
453 |
+
setAttrib(elm, 'rev');
|
454 |
+
setAttrib(elm, 'charset');
|
455 |
+
setAttrib(elm, 'hreflang');
|
456 |
+
setAttrib(elm, 'dir');
|
457 |
+
setAttrib(elm, 'lang');
|
458 |
+
setAttrib(elm, 'tabindex');
|
459 |
+
setAttrib(elm, 'accesskey');
|
460 |
+
setAttrib(elm, 'type');
|
461 |
+
setAttrib(elm, 'onfocus');
|
462 |
+
setAttrib(elm, 'onblur');
|
463 |
+
setAttrib(elm, 'onclick');
|
464 |
+
setAttrib(elm, 'ondblclick');
|
465 |
+
setAttrib(elm, 'onmousedown');
|
466 |
+
setAttrib(elm, 'onmouseup');
|
467 |
+
setAttrib(elm, 'onmouseover');
|
468 |
+
setAttrib(elm, 'onmousemove');
|
469 |
+
setAttrib(elm, 'onmouseout');
|
470 |
+
setAttrib(elm, 'onkeypress');
|
471 |
+
setAttrib(elm, 'onkeydown');
|
472 |
+
setAttrib(elm, 'onkeyup');
|
473 |
+
|
474 |
+
// Refresh in old MSIE
|
475 |
+
if (tinyMCE.isMSIE5)
|
476 |
+
elm.outerHTML = elm.outerHTML;
|
477 |
+
}
|
478 |
+
|
479 |
+
function getSelectValue(form_obj, field_name) {
|
480 |
+
var elm = form_obj.elements[field_name];
|
481 |
+
|
482 |
+
if (!elm || elm.options == null || elm.selectedIndex == -1)
|
483 |
+
return "";
|
484 |
+
|
485 |
+
return elm.options[elm.selectedIndex].value;
|
486 |
+
}
|
487 |
+
|
488 |
+
function getLinkListHTML(elm_id, target_form_element, onchange_func) {
|
489 |
+
if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0)
|
490 |
+
return "";
|
491 |
+
|
492 |
+
var html = "";
|
493 |
+
|
494 |
+
html += '<select id="' + elm_id + '" name="' + elm_id + '"';
|
495 |
+
html += ' class="mceLinkList" onchange="this.form.' + target_form_element + '.value=';
|
496 |
+
html += 'this.options[this.selectedIndex].value;';
|
497 |
+
|
498 |
+
if (typeof(onchange_func) != "undefined")
|
499 |
+
html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';
|
500 |
+
|
501 |
+
html += '"><option value="">---</option>';
|
502 |
+
|
503 |
+
for (var i=0; i<tinyMCELinkList.length; i++)
|
504 |
+
html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';
|
505 |
+
|
506 |
+
html += '</select>';
|
507 |
+
|
508 |
+
return html;
|
509 |
+
|
510 |
+
// tinyMCE.debug('-- image list start --', html, '-- image list end --');
|
511 |
+
}
|
512 |
+
|
513 |
+
function getTargetListHTML(elm_id, target_form_element) {
|
514 |
+
var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';');
|
515 |
+
var html = '';
|
516 |
+
|
517 |
+
html += '<select id="' + elm_id + '" name="' + elm_id + '" onchange="this.form.' + target_form_element + '.value=';
|
518 |
+
html += 'this.options[this.selectedIndex].value;">';
|
519 |
+
html += '<option value="_self">' + tinyMCEPopup.getLang('advlink_dlg.target_same') + '</option>';
|
520 |
+
html += '<option value="_blank">' + tinyMCEPopup.getLang('advlink_dlg.target_blank') + ' (_blank)</option>';
|
521 |
+
html += '<option value="_parent">' + tinyMCEPopup.getLang('advlink_dlg.target_parent') + ' (_parent)</option>';
|
522 |
+
html += '<option value="_top">' + tinyMCEPopup.getLang('advlink_dlg.target_top') + ' (_top)</option>';
|
523 |
+
|
524 |
+
for (var i=0; i<targets.length; i++) {
|
525 |
+
var key, value;
|
526 |
+
|
527 |
+
if (targets[i] == "")
|
528 |
+
continue;
|
529 |
+
|
530 |
+
key = targets[i].split('=')[0];
|
531 |
+
value = targets[i].split('=')[1];
|
532 |
+
|
533 |
+
html += '<option value="' + key + '">' + value + ' (' + key + ')</option>';
|
534 |
+
}
|
535 |
+
|
536 |
+
html += '</select>';
|
537 |
+
|
538 |
+
return html;
|
539 |
+
}
|
540 |
+
|
541 |
+
// While loading
|
542 |
+
preinit();
|
543 |
+
tinyMCEPopup.onInit.add(init);
|
js/libraries/tiny_mce/plugins/advlink/langs/en_dlg.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.addI18n('en.advlink_dlg',{"target_name":"Target Name",classes:"Classes",style:"Style",id:"ID","popup_position":"Position (X/Y)",langdir:"Language Direction","popup_size":"Size","popup_dependent":"Dependent (Mozilla/Firefox Only)","popup_resizable":"Make Window Resizable","popup_location":"Show Location Bar","popup_menubar":"Show Menu Bar","popup_toolbar":"Show Toolbars","popup_statusbar":"Show Status Bar","popup_scrollbars":"Show Scrollbars","popup_return":"Insert \'return false\'","popup_name":"Window Name","popup_url":"Popup URL",popup:"JavaScript Popup","target_blank":"Open in New Window","target_top":"Open in Top Frame (Replaces All Frames)","target_parent":"Open in Parent Window/Frame","target_same":"Open in This Window/Frame","anchor_names":"Anchors","popup_opts":"Options","advanced_props":"Advanced Properties","event_props":"Events","popup_props":"Popup Properties","general_props":"General Properties","advanced_tab":"Advanced","events_tab":"Events","popup_tab":"Popup","general_tab":"General",list:"Link List","is_external":"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?","is_email":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",titlefield:"Title",target:"Target",url:"Link URL",title:"Insert/Edit Link","link_list":"Link List",rtl:"Right to Left",ltr:"Left to Right",accesskey:"AccessKey",tabindex:"TabIndex",rev:"Relationship Target to Page",rel:"Relationship Page to Target",mime:"Target MIME Type",encoding:"Target Character Encoding",langcode:"Language Code","target_langcode":"Target Language",width:"Width",height:"Height"});
|
js/libraries/tiny_mce/plugins/advlink/link.htm
ADDED
@@ -0,0 +1,338 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>{#advlink_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/form_utils.js"></script>
|
8 |
+
<script type="text/javascript" src="../../utils/validate.js"></script>
|
9 |
+
<script type="text/javascript" src="js/advlink.js"></script>
|
10 |
+
<link href="css/advlink.css" rel="stylesheet" type="text/css" />
|
11 |
+
</head>
|
12 |
+
<body id="advlink" style="display: none" role="application" onload="javascript:mcTabs.displayTab('general_tab','general_panel', true);" aria-labelledby="app_label">
|
13 |
+
<span class="mceVoiceLabel" id="app_label" style="display:none;">{#advlink_dlg.title}</span>
|
14 |
+
<form onsubmit="insertAction();return false;" action="#">
|
15 |
+
<div class="tabs" role="presentation">
|
16 |
+
<ul>
|
17 |
+
<li id="general_tab" class="current" aria-controls="general_panel" ><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advlink_dlg.general_tab}</a></span></li>
|
18 |
+
<li id="popup_tab" aria-controls="popup_panel" ><span><a href="javascript:mcTabs.displayTab('popup_tab','popup_panel');" onmousedown="return false;">{#advlink_dlg.popup_tab}</a></span></li>
|
19 |
+
<li id="events_tab" aria-controls="events_panel"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#advlink_dlg.events_tab}</a></span></li>
|
20 |
+
<li id="advanced_tab" aria-controls="advanced_panel"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advlink_dlg.advanced_tab}</a></span></li>
|
21 |
+
</ul>
|
22 |
+
</div>
|
23 |
+
|
24 |
+
<div class="panel_wrapper" role="presentation">
|
25 |
+
<div id="general_panel" class="panel current">
|
26 |
+
<fieldset>
|
27 |
+
<legend>{#advlink_dlg.general_props}</legend>
|
28 |
+
|
29 |
+
<table border="0" cellpadding="4" cellspacing="0" role="presentation">
|
30 |
+
<tr>
|
31 |
+
<td class="nowrap"><label id="hreflabel" for="href">{#advlink_dlg.url}</label></td>
|
32 |
+
<td><table border="0" cellspacing="0" cellpadding="0">
|
33 |
+
<tr>
|
34 |
+
<td><input id="href" name="href" type="text" class="mceFocus" value="" onchange="selectByValue(this.form,'linklisthref',this.value);" aria-required="true" /></td>
|
35 |
+
<td id="hrefbrowsercontainer"> </td>
|
36 |
+
</tr>
|
37 |
+
</table></td>
|
38 |
+
</tr>
|
39 |
+
<tr id="linklisthrefrow">
|
40 |
+
<td class="column1"><label for="linklisthref">{#advlink_dlg.list}</label></td>
|
41 |
+
<td colspan="2" id="linklisthrefcontainer"><select id="linklisthref"><option value=""></option></select></td>
|
42 |
+
</tr>
|
43 |
+
<tr id="anchorlistrow">
|
44 |
+
<td class="column1"><label for="anchorlist">{#advlink_dlg.anchor_names}</label></td>
|
45 |
+
<td colspan="2" id="anchorlistcontainer"><select id="anchorlist"><option value=""></option></select></td>
|
46 |
+
</tr>
|
47 |
+
<tr>
|
48 |
+
<td><label id="targetlistlabel" for="targetlist">{#advlink_dlg.target}</label></td>
|
49 |
+
<td id="targetlistcontainer"><select id="targetlist"><option value=""></option></select></td>
|
50 |
+
</tr>
|
51 |
+
<tr>
|
52 |
+
<td class="nowrap"><label id="titlelabel" for="title">{#advlink_dlg.titlefield}</label></td>
|
53 |
+
<td><input id="title" name="title" type="text" value="" /></td>
|
54 |
+
</tr>
|
55 |
+
<tr>
|
56 |
+
<td><label id="classlabel" for="classlist">{#class_name}</label></td>
|
57 |
+
<td>
|
58 |
+
<select id="classlist" name="classlist" onchange="changeClass();">
|
59 |
+
<option value="" selected="selected">{#not_set}</option>
|
60 |
+
</select>
|
61 |
+
</td>
|
62 |
+
</tr>
|
63 |
+
</table>
|
64 |
+
</fieldset>
|
65 |
+
</div>
|
66 |
+
|
67 |
+
<div id="popup_panel" class="panel">
|
68 |
+
<fieldset>
|
69 |
+
<legend>{#advlink_dlg.popup_props}</legend>
|
70 |
+
|
71 |
+
<input type="checkbox" id="ispopup" name="ispopup" class="radio" onclick="setPopupControlsDisabled(!this.checked);buildOnClick();" />
|
72 |
+
<label id="ispopuplabel" for="ispopup">{#advlink_dlg.popup}</label>
|
73 |
+
|
74 |
+
<table border="0" cellpadding="0" cellspacing="4" role="presentation" >
|
75 |
+
<tr>
|
76 |
+
<td class="nowrap"><label for="popupurl">{#advlink_dlg.popup_url}</label> </td>
|
77 |
+
<td>
|
78 |
+
<table border="0" cellspacing="0" cellpadding="0">
|
79 |
+
<tr>
|
80 |
+
<td><input type="text" name="popupurl" id="popupurl" value="" onchange="buildOnClick();" /></td>
|
81 |
+
<td id="popupurlbrowsercontainer"> </td>
|
82 |
+
</tr>
|
83 |
+
</table>
|
84 |
+
</td>
|
85 |
+
</tr>
|
86 |
+
<tr>
|
87 |
+
<td class="nowrap"><label for="popupname">{#advlink_dlg.popup_name}</label> </td>
|
88 |
+
<td><input type="text" name="popupname" id="popupname" value="" onchange="buildOnClick();" /></td>
|
89 |
+
</tr>
|
90 |
+
<tr role="group" aria-labelledby="popup_size_label">
|
91 |
+
<td class="nowrap"><label id="popup_size_label">{#advlink_dlg.popup_size}</label> </td>
|
92 |
+
<td class="nowrap">
|
93 |
+
<span style="display:none" id="width_voiceLabel">{#advlink_dlg.width}</span>
|
94 |
+
<input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" aria-labelledby="width_voiceLabel" /> x
|
95 |
+
<span style="display:none" id="height_voiceLabel">{#advlink_dlg.height}</span>
|
96 |
+
<input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" aria-labelledby="height_voiceLabel" /> px
|
97 |
+
</td>
|
98 |
+
</tr>
|
99 |
+
<tr role="group" aria-labelledby="popup_position_label center_hint">
|
100 |
+
<td class="nowrap" id="labelleft"><label id="popup_position_label">{#advlink_dlg.popup_position}</label> </td>
|
101 |
+
<td class="nowrap">
|
102 |
+
<span style="display:none" id="x_voiceLabel">X</span>
|
103 |
+
<input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" aria-labelledby="x_voiceLabel" /> /
|
104 |
+
<span style="display:none" id="y_voiceLabel">Y</span>
|
105 |
+
<input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" aria-labelledby="y_voiceLabel" /> <span id="center_hint">(c /c = center)</span>
|
106 |
+
</td>
|
107 |
+
</tr>
|
108 |
+
</table>
|
109 |
+
|
110 |
+
<fieldset>
|
111 |
+
<legend>{#advlink_dlg.popup_opts}</legend>
|
112 |
+
|
113 |
+
<table border="0" cellpadding="0" cellspacing="4" role="presentation" >
|
114 |
+
<tr>
|
115 |
+
<td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td>
|
116 |
+
<td class="nowrap"><label id="popuplocationlabel" for="popuplocation">{#advlink_dlg.popup_location}</label></td>
|
117 |
+
<td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td>
|
118 |
+
<td class="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{#advlink_dlg.popup_scrollbars}</label></td>
|
119 |
+
</tr>
|
120 |
+
<tr>
|
121 |
+
<td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td>
|
122 |
+
<td class="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{#advlink_dlg.popup_menubar}</label></td>
|
123 |
+
<td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td>
|
124 |
+
<td class="nowrap"><label id="popupresizablelabel" for="popupresizable">{#advlink_dlg.popup_resizable}</label></td>
|
125 |
+
</tr>
|
126 |
+
<tr>
|
127 |
+
<td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td>
|
128 |
+
<td class="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{#advlink_dlg.popup_toolbar}</label></td>
|
129 |
+
<td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td>
|
130 |
+
<td class="nowrap"><label id="popupdependentlabel" for="popupdependent">{#advlink_dlg.popup_dependent}</label></td>
|
131 |
+
</tr>
|
132 |
+
<tr>
|
133 |
+
<td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td>
|
134 |
+
<td class="nowrap"><label id="popupstatuslabel" for="popupstatus">{#advlink_dlg.popup_statusbar}</label></td>
|
135 |
+
<td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td>
|
136 |
+
<td class="nowrap"><label id="popupreturnlabel" for="popupreturn">{#advlink_dlg.popup_return}</label></td>
|
137 |
+
</tr>
|
138 |
+
</table>
|
139 |
+
</fieldset>
|
140 |
+
</fieldset>
|
141 |
+
</div>
|
142 |
+
|
143 |
+
<div id="advanced_panel" class="panel">
|
144 |
+
<fieldset>
|
145 |
+
<legend>{#advlink_dlg.advanced_props}</legend>
|
146 |
+
|
147 |
+
<table border="0" cellpadding="0" cellspacing="4" role="presentation" >
|
148 |
+
<tr>
|
149 |
+
<td class="column1"><label id="idlabel" for="id">{#advlink_dlg.id}</label></td>
|
150 |
+
<td><input id="id" name="id" type="text" value="" /></td>
|
151 |
+
</tr>
|
152 |
+
|
153 |
+
<tr>
|
154 |
+
<td><label id="stylelabel" for="style">{#advlink_dlg.style}</label></td>
|
155 |
+
<td><input type="text" id="style" name="style" value="" /></td>
|
156 |
+
</tr>
|
157 |
+
|
158 |
+
<tr>
|
159 |
+
<td><label id="classeslabel" for="classes">{#advlink_dlg.classes}</label></td>
|
160 |
+
<td><input type="text" id="classes" name="classes" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
|
161 |
+
</tr>
|
162 |
+
|
163 |
+
<tr>
|
164 |
+
<td><label id="targetlabel" for="target">{#advlink_dlg.target_name}</label></td>
|
165 |
+
<td><input type="text" id="target" name="target" value="" onchange="selectByValue(this.form,'targetlist',this.value,true);" /></td>
|
166 |
+
</tr>
|
167 |
+
|
168 |
+
<tr>
|
169 |
+
<td class="column1"><label id="dirlabel" for="dir">{#advlink_dlg.langdir}</label></td>
|
170 |
+
<td>
|
171 |
+
<select id="dir" name="dir">
|
172 |
+
<option value="">{#not_set}</option>
|
173 |
+
<option value="ltr">{#advlink_dlg.ltr}</option>
|
174 |
+
<option value="rtl">{#advlink_dlg.rtl}</option>
|
175 |
+
</select>
|
176 |
+
</td>
|
177 |
+
</tr>
|
178 |
+
|
179 |
+
<tr>
|
180 |
+
<td><label id="hreflanglabel" for="hreflang">{#advlink_dlg.target_langcode}</label></td>
|
181 |
+
<td><input type="text" id="hreflang" name="hreflang" value="" /></td>
|
182 |
+
</tr>
|
183 |
+
|
184 |
+
<tr>
|
185 |
+
<td class="column1"><label id="langlabel" for="lang">{#advlink_dlg.langcode}</label></td>
|
186 |
+
<td>
|
187 |
+
<input id="lang" name="lang" type="text" value="" />
|
188 |
+
</td>
|
189 |
+
</tr>
|
190 |
+
|
191 |
+
<tr>
|
192 |
+
<td><label id="charsetlabel" for="charset">{#advlink_dlg.encoding}</label></td>
|
193 |
+
<td><input type="text" id="charset" name="charset" value="" /></td>
|
194 |
+
</tr>
|
195 |
+
|
196 |
+
<tr>
|
197 |
+
<td><label id="typelabel" for="type">{#advlink_dlg.mime}</label></td>
|
198 |
+
<td><input type="text" id="type" name="type" value="" /></td>
|
199 |
+
</tr>
|
200 |
+
|
201 |
+
<tr>
|
202 |
+
<td><label id="rellabel" for="rel">{#advlink_dlg.rel}</label></td>
|
203 |
+
<td><select id="rel" name="rel">
|
204 |
+
<option value="">{#not_set}</option>
|
205 |
+
<option value="lightbox">Lightbox</option>
|
206 |
+
<option value="alternate">Alternate</option>
|
207 |
+
<option value="designates">Designates</option>
|
208 |
+
<option value="stylesheet">Stylesheet</option>
|
209 |
+
<option value="start">Start</option>
|
210 |
+
<option value="next">Next</option>
|
211 |
+
<option value="prev">Prev</option>
|
212 |
+
<option value="contents">Contents</option>
|
213 |
+
<option value="index">Index</option>
|
214 |
+
<option value="glossary">Glossary</option>
|
215 |
+
<option value="copyright">Copyright</option>
|
216 |
+
<option value="chapter">Chapter</option>
|
217 |
+
<option value="subsection">Subsection</option>
|
218 |
+
<option value="appendix">Appendix</option>
|
219 |
+
<option value="help">Help</option>
|
220 |
+
<option value="bookmark">Bookmark</option>
|
221 |
+
<option value="nofollow">No Follow</option>
|
222 |
+
<option value="tag">Tag</option>
|
223 |
+
</select>
|
224 |
+
</td>
|
225 |
+
</tr>
|
226 |
+
|
227 |
+
<tr>
|
228 |
+
<td><label id="revlabel" for="rev">{#advlink_dlg.rev}</label></td>
|
229 |
+
<td><select id="rev" name="rev">
|
230 |
+
<option value="">{#not_set}</option>
|
231 |
+
<option value="alternate">Alternate</option>
|
232 |
+
<option value="designates">Designates</option>
|
233 |
+
<option value="stylesheet">Stylesheet</option>
|
234 |
+
<option value="start">Start</option>
|
235 |
+
<option value="next">Next</option>
|
236 |
+
<option value="prev">Prev</option>
|
237 |
+
<option value="contents">Contents</option>
|
238 |
+
<option value="index">Index</option>
|
239 |
+
<option value="glossary">Glossary</option>
|
240 |
+
<option value="copyright">Copyright</option>
|
241 |
+
<option value="chapter">Chapter</option>
|
242 |
+
<option value="subsection">Subsection</option>
|
243 |
+
<option value="appendix">Appendix</option>
|
244 |
+
<option value="help">Help</option>
|
245 |
+
<option value="bookmark">Bookmark</option>
|
246 |
+
</select>
|
247 |
+
</td>
|
248 |
+
</tr>
|
249 |
+
|
250 |
+
<tr>
|
251 |
+
<td><label id="tabindexlabel" for="tabindex">{#advlink_dlg.tabindex}</label></td>
|
252 |
+
<td><input type="text" id="tabindex" name="tabindex" value="" /></td>
|
253 |
+
</tr>
|
254 |
+
|
255 |
+
<tr>
|
256 |
+
<td><label id="accesskeylabel" for="accesskey">{#advlink_dlg.accesskey}</label></td>
|
257 |
+
<td><input type="text" id="accesskey" name="accesskey" value="" /></td>
|
258 |
+
</tr>
|
259 |
+
</table>
|
260 |
+
</fieldset>
|
261 |
+
</div>
|
262 |
+
|
263 |
+
<div id="events_panel" class="panel">
|
264 |
+
<fieldset>
|
265 |
+
<legend>{#advlink_dlg.event_props}</legend>
|
266 |
+
|
267 |
+
<table border="0" cellpadding="0" cellspacing="4" role="presentation" >
|
268 |
+
<tr>
|
269 |
+
<td class="column1"><label for="onfocus">onfocus</label></td>
|
270 |
+
<td><input id="onfocus" name="onfocus" type="text" value="" /></td>
|
271 |
+
</tr>
|
272 |
+
|
273 |
+
<tr>
|
274 |
+
<td class="column1"><label for="onblur">onblur</label></td>
|
275 |
+
<td><input id="onblur" name="onblur" type="text" value="" /></td>
|
276 |
+
</tr>
|
277 |
+
|
278 |
+
<tr>
|
279 |
+
<td class="column1"><label for="onclick">onclick</label></td>
|
280 |
+
<td><input id="onclick" name="onclick" type="text" value="" /></td>
|
281 |
+
</tr>
|
282 |
+
|
283 |
+
<tr>
|
284 |
+
<td class="column1"><label for="ondblclick">ondblclick</label></td>
|
285 |
+
<td><input id="ondblclick" name="ondblclick" type="text" value="" /></td>
|
286 |
+
</tr>
|
287 |
+
|
288 |
+
<tr>
|
289 |
+
<td class="column1"><label for="onmousedown">onmousedown</label></td>
|
290 |
+
<td><input id="onmousedown" name="onmousedown" type="text" value="" /></td>
|
291 |
+
</tr>
|
292 |
+
|
293 |
+
<tr>
|
294 |
+
<td class="column1"><label for="onmouseup">onmouseup</label></td>
|
295 |
+
<td><input id="onmouseup" name="onmouseup" type="text" value="" /></td>
|
296 |
+
</tr>
|
297 |
+
|
298 |
+
<tr>
|
299 |
+
<td class="column1"><label for="onmouseover">onmouseover</label></td>
|
300 |
+
<td><input id="onmouseover" name="onmouseover" type="text" value="" /></td>
|
301 |
+
</tr>
|
302 |
+
|
303 |
+
<tr>
|
304 |
+
<td class="column1"><label for="onmousemove">onmousemove</label></td>
|
305 |
+
<td><input id="onmousemove" name="onmousemove" type="text" value="" /></td>
|
306 |
+
</tr>
|
307 |
+
|
308 |
+
<tr>
|
309 |
+
<td class="column1"><label for="onmouseout">onmouseout</label></td>
|
310 |
+
<td><input id="onmouseout" name="onmouseout" type="text" value="" /></td>
|
311 |
+
</tr>
|
312 |
+
|
313 |
+
<tr>
|
314 |
+
<td class="column1"><label for="onkeypress">onkeypress</label></td>
|
315 |
+
<td><input id="onkeypress" name="onkeypress" type="text" value="" /></td>
|
316 |
+
</tr>
|
317 |
+
|
318 |
+
<tr>
|
319 |
+
<td class="column1"><label for="onkeydown">onkeydown</label></td>
|
320 |
+
<td><input id="onkeydown" name="onkeydown" type="text" value="" /></td>
|
321 |
+
</tr>
|
322 |
+
|
323 |
+
<tr>
|
324 |
+
<td class="column1"><label for="onkeyup">onkeyup</label></td>
|
325 |
+
<td><input id="onkeyup" name="onkeyup" type="text" value="" /></td>
|
326 |
+
</tr>
|
327 |
+
</table>
|
328 |
+
</fieldset>
|
329 |
+
</div>
|
330 |
+
</div>
|
331 |
+
|
332 |
+
<div class="mceActionPanel">
|
333 |
+
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
334 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
335 |
+
</div>
|
336 |
+
</form>
|
337 |
+
</body>
|
338 |
+
</html>
|
js/libraries/tiny_mce/plugins/advlist/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.AdvListPlugin",{init:function(b,c){var d=this;d.editor=b;function e(g){var f=[];a(g.split(/,/),function(h){f.push({title:"advlist."+(h=="default"?"def":h.replace(/-/g,"_")),styles:{listStyleType:h=="default"?"":h}})});return f}d.numlist=b.getParam("advlist_number_styles")||e("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");d.bullist=b.getParam("advlist_bullet_styles")||e("default,circle,disc,square");if(tinymce.isIE&&/MSIE [2-7]/.test(navigator.userAgent)){d.isIE7=true}},createControl:function(d,b){var f=this,e,i,g=f.editor;if(d=="numlist"||d=="bullist"){if(f[d][0].title=="advlist.def"){i=f[d][0]}function c(j,l){var k=true;a(l.styles,function(n,m){if(g.dom.getStyle(j,m)!=n){k=false;return false}});return k}function h(){var k,l=g.dom,j=g.selection;k=l.getParent(j.getNode(),"ol,ul");if(!k||k.nodeName==(d=="bullist"?"OL":"UL")||c(k,i)){g.execCommand(d=="bullist"?"InsertUnorderedList":"InsertOrderedList")}if(i){k=l.getParent(j.getNode(),"ol,ul");if(k){l.setStyles(k,i.styles);k.removeAttribute("data-mce-style")}}g.focus()}e=b.createSplitButton(d,{title:"advanced."+d+"_desc","class":"mce_"+d,onclick:function(){h()}});e.onRenderMenu.add(function(j,k){k.onHideMenu.add(function(){if(f.bookmark){g.selection.moveToBookmark(f.bookmark);f.bookmark=0}});k.onShowMenu.add(function(){var n=g.dom,m=n.getParent(g.selection.getNode(),"ol,ul"),l;if(m||i){l=f[d];a(k.items,function(o){var p=true;o.setSelected(0);if(m&&!o.isDisabled()){a(l,function(q){if(q.id==o.id){if(!c(m,q)){p=false;return false}}});if(p){o.setSelected(1)}}});if(!m){k.items[i.id].setSelected(1)}}g.focus();if(tinymce.isIE){f.bookmark=g.selection.getBookmark(1)}});k.add({id:g.dom.uniqueId(),title:"advlist.types","class":"mceMenuItemTitle",titleItem:true}).setDisabled(1);a(f[d],function(l){if(f.isIE7&&l.styles.listStyleType=="lower-greek"){return}l.id=g.dom.uniqueId();k.add({id:l.id,title:l.title,onclick:function(){i=l;h()}})})});return e}},getInfo:function(){return{longname:"Advanced lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlist",tinymce.plugins.AdvListPlugin)})();
|
js/libraries/tiny_mce/plugins/advlist/editor_plugin_src.js
ADDED
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 each = tinymce.each;
|
13 |
+
|
14 |
+
tinymce.create('tinymce.plugins.AdvListPlugin', {
|
15 |
+
init : function(ed, url) {
|
16 |
+
var t = this;
|
17 |
+
|
18 |
+
t.editor = ed;
|
19 |
+
|
20 |
+
function buildFormats(str) {
|
21 |
+
var formats = [];
|
22 |
+
|
23 |
+
each(str.split(/,/), function(type) {
|
24 |
+
formats.push({
|
25 |
+
title : 'advlist.' + (type == 'default' ? 'def' : type.replace(/-/g, '_')),
|
26 |
+
styles : {
|
27 |
+
listStyleType : type == 'default' ? '' : type
|
28 |
+
}
|
29 |
+
});
|
30 |
+
});
|
31 |
+
|
32 |
+
return formats;
|
33 |
+
};
|
34 |
+
|
35 |
+
// Setup number formats from config or default
|
36 |
+
t.numlist = ed.getParam("advlist_number_styles") || buildFormats("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");
|
37 |
+
t.bullist = ed.getParam("advlist_bullet_styles") || buildFormats("default,circle,disc,square");
|
38 |
+
|
39 |
+
if (tinymce.isIE && /MSIE [2-7]/.test(navigator.userAgent))
|
40 |
+
t.isIE7 = true;
|
41 |
+
},
|
42 |
+
|
43 |
+
createControl: function(name, cm) {
|
44 |
+
var t = this, btn, format, editor = t.editor;
|
45 |
+
|
46 |
+
if (name == 'numlist' || name == 'bullist') {
|
47 |
+
// Default to first item if it's a default item
|
48 |
+
if (t[name][0].title == 'advlist.def')
|
49 |
+
format = t[name][0];
|
50 |
+
|
51 |
+
function hasFormat(node, format) {
|
52 |
+
var state = true;
|
53 |
+
|
54 |
+
each(format.styles, function(value, name) {
|
55 |
+
// Format doesn't match
|
56 |
+
if (editor.dom.getStyle(node, name) != value) {
|
57 |
+
state = false;
|
58 |
+
return false;
|
59 |
+
}
|
60 |
+
});
|
61 |
+
|
62 |
+
return state;
|
63 |
+
};
|
64 |
+
|
65 |
+
function applyListFormat() {
|
66 |
+
var list, dom = editor.dom, sel = editor.selection;
|
67 |
+
|
68 |
+
// Check for existing list element
|
69 |
+
list = dom.getParent(sel.getNode(), 'ol,ul');
|
70 |
+
|
71 |
+
// Switch/add list type if needed
|
72 |
+
if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || hasFormat(list, format))
|
73 |
+
editor.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList');
|
74 |
+
|
75 |
+
// Append styles to new list element
|
76 |
+
if (format) {
|
77 |
+
list = dom.getParent(sel.getNode(), 'ol,ul');
|
78 |
+
if (list) {
|
79 |
+
dom.setStyles(list, format.styles);
|
80 |
+
list.removeAttribute('data-mce-style');
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
editor.focus();
|
85 |
+
};
|
86 |
+
|
87 |
+
btn = cm.createSplitButton(name, {
|
88 |
+
title : 'advanced.' + name + '_desc',
|
89 |
+
'class' : 'mce_' + name,
|
90 |
+
onclick : function() {
|
91 |
+
applyListFormat();
|
92 |
+
}
|
93 |
+
});
|
94 |
+
|
95 |
+
btn.onRenderMenu.add(function(btn, menu) {
|
96 |
+
menu.onHideMenu.add(function() {
|
97 |
+
if (t.bookmark) {
|
98 |
+
editor.selection.moveToBookmark(t.bookmark);
|
99 |
+
t.bookmark = 0;
|
100 |
+
}
|
101 |
+
});
|
102 |
+
|
103 |
+
menu.onShowMenu.add(function() {
|
104 |
+
var dom = editor.dom, list = dom.getParent(editor.selection.getNode(), 'ol,ul'), fmtList;
|
105 |
+
|
106 |
+
if (list || format) {
|
107 |
+
fmtList = t[name];
|
108 |
+
|
109 |
+
// Unselect existing items
|
110 |
+
each(menu.items, function(item) {
|
111 |
+
var state = true;
|
112 |
+
|
113 |
+
item.setSelected(0);
|
114 |
+
|
115 |
+
if (list && !item.isDisabled()) {
|
116 |
+
each(fmtList, function(fmt) {
|
117 |
+
if (fmt.id == item.id) {
|
118 |
+
if (!hasFormat(list, fmt)) {
|
119 |
+
state = false;
|
120 |
+
return false;
|
121 |
+
}
|
122 |
+
}
|
123 |
+
});
|
124 |
+
|
125 |
+
if (state)
|
126 |
+
item.setSelected(1);
|
127 |
+
}
|
128 |
+
});
|
129 |
+
|
130 |
+
// Select the current format
|
131 |
+
if (!list)
|
132 |
+
menu.items[format.id].setSelected(1);
|
133 |
+
}
|
134 |
+
|
135 |
+
editor.focus();
|
136 |
+
|
137 |
+
// IE looses it's selection so store it away and restore it later
|
138 |
+
if (tinymce.isIE) {
|
139 |
+
t.bookmark = editor.selection.getBookmark(1);
|
140 |
+
}
|
141 |
+
});
|
142 |
+
|
143 |
+
menu.add({id : editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle', titleItem: true}).setDisabled(1);
|
144 |
+
|
145 |
+
each(t[name], function(item) {
|
146 |
+
// IE<8 doesn't support lower-greek, skip it
|
147 |
+
if (t.isIE7 && item.styles.listStyleType == 'lower-greek')
|
148 |
+
return;
|
149 |
+
|
150 |
+
item.id = editor.dom.uniqueId();
|
151 |
+
|
152 |
+
menu.add({id : item.id, title : item.title, onclick : function() {
|
153 |
+
format = item;
|
154 |
+
applyListFormat();
|
155 |
+
}});
|
156 |
+
});
|
157 |
+
});
|
158 |
+
|
159 |
+
return btn;
|
160 |
+
}
|
161 |
+
},
|
162 |
+
|
163 |
+
getInfo : function() {
|
164 |
+
return {
|
165 |
+
longname : 'Advanced lists',
|
166 |
+
author : 'Moxiecode Systems AB',
|
167 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
168 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist',
|
169 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
170 |
+
};
|
171 |
+
}
|
172 |
+
});
|
173 |
+
|
174 |
+
// Register plugin
|
175 |
+
tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin);
|
176 |
+
})();
|
js/libraries/tiny_mce/plugins/autolink/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;a.onKeyDown.addToTop(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}});if(tinyMCE.isIE){return}a.onKeyPress.add(function(d,f){if(f.which==41){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng(true).cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}if(n.nodeType==3){a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f-2);a.setEnd(n,f-1);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}var m=a.toString();if(m.charAt(m.length-1)=="."){a.setEnd(n,c-1)}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}else{if(/@$/.test(h[1])&&!/^mailto:/.test(h[1])){h[1]="mailto:"+h[1]}}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("createlink",false,h[1]+h[2]);i.selection.moveToBookmark(k);i.nodeChanged();if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})();
|
js/libraries/tiny_mce/plugins/autolink/editor_plugin_src.js
ADDED
@@ -0,0 +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 |
+
})();
|
js/libraries/tiny_mce/plugins/autoresize/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this,e=0;if(a.getParam("fullscreen_is_enabled")){return}function b(){var j,i=a.getDoc(),f=i.body,l=i.documentElement,h=tinymce.DOM,k=d.autoresize_min_height,g;g=tinymce.isIE?f.scrollHeight:(tinymce.isWebKit&&f.clientHeight==0?0:f.offsetHeight);if(g>d.autoresize_min_height){k=g}if(d.autoresize_max_height&&g>d.autoresize_max_height){k=d.autoresize_max_height;f.style.overflowY="auto";l.style.overflowY="auto"}else{f.style.overflowY="hidden";l.style.overflowY="hidden";f.scrollTop=0}if(k!==e){j=k-e;h.setStyle(h.get(a.id+"_ifr"),"height",k+"px");e=k;if(tinymce.isWebKit&&j<0){b()}}}d.editor=a;d.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight));d.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0));a.onInit.add(function(f){f.dom.setStyle(f.getBody(),"paddingBottom",f.getParam("autoresize_bottom_margin",50)+"px")});a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);if(a.getParam("autoresize_on_init",true)){a.onLoad.add(b);a.onLoadContent.add(b)}a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})();
|
js/libraries/tiny_mce/plugins/autoresize/editor_plugin_src.js
ADDED
@@ -0,0 +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 |
+
})();
|
js/libraries/tiny_mce/plugins/autosave/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(e){var c="autosave",g="restoredraft",b=true,f,d,a=e.util.Dispatcher;e.create("tinymce.plugins.AutoSave",{init:function(i,j){var h=this,l=i.settings;h.editor=i;function k(n){var m={s:1000,m:60000};n=/^(\d+)([ms]?)$/.exec(""+n);return(n[2]?m[n[2]]:1)*parseInt(n)}e.each({ask_before_unload:b,interval:"30s",retention:"20m",minlength:50},function(n,m){m=c+"_"+m;if(l[m]===f){l[m]=n}});l.autosave_interval=k(l.autosave_interval);l.autosave_retention=k(l.autosave_retention);i.addButton(g,{title:c+".restore_content",onclick:function(){if(i.getContent({draft:true}).replace(/\s| |<\/?p[^>]*>|<br[^>]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){if(!i.removed){h.storeDraft();i.nodeChanged()}},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();try{m.save("TinyMCE")}catch(o){}},getItem:function(l){var m=i.getElement();try{m.load("TinyMCE");return m.getAttribute(l)}catch(n){return null}},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent({draft:true});if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,j=h.storage,i;if(j){i=j.getItem(h.key);if(i){h.editor.setContent(i);h.onRestoreDraft.dispatch(h,{content:i})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()<i.getTime()){return b}h.removeDraft()}else{return b}}}return false},removeDraft:function(){var h=this,k=h.storage,i=h.key,j;if(k){j=k.getItem(i);k.removeItem(i);k.removeItem(i+"_expires");if(j){h.onRemoveDraft.dispatch(h,{content:j})}}},"static":{_beforeUnloadHandler:function(h){var i;e.each(tinyMCE.editors,function(j){if(j.plugins.autosave){j.plugins.autosave.storeDraft()}if(j.getParam("fullscreen_is_enabled")){return}if(!i&&j.isDirty()&&j.getParam("autosave_ask_before_unload")){i=j.getLang("autosave.unload_msg")}});return i}}});e.PluginManager.add("autosave",e.plugins.AutoSave)})(tinymce);
|
js/libraries/tiny_mce/plugins/autosave/editor_plugin_src.js
ADDED
@@ -0,0 +1,433 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Adds auto-save capability to the TinyMCE text editor to rescue content
|
11 |
+
* inadvertently lost. This plugin was originally developed by Speednet
|
12 |
+
* and that project can be found here: http://code.google.com/p/tinyautosave/
|
13 |
+
*
|
14 |
+
* TECHNOLOGY DISCUSSION:
|
15 |
+
*
|
16 |
+
* The plugin attempts to use the most advanced features available in the current browser to save
|
17 |
+
* as much content as possible. There are a total of four different methods used to autosave the
|
18 |
+
* content. In order of preference, they are:
|
19 |
+
*
|
20 |
+
* 1. localStorage - A new feature of HTML 5, localStorage can store megabytes of data per domain
|
21 |
+
* on the client computer. Data stored in the localStorage area has no expiration date, so we must
|
22 |
+
* manage expiring the data ourselves. localStorage is fully supported by IE8, and it is supposed
|
23 |
+
* to be working in Firefox 3 and Safari 3.2, but in reality is is flaky in those browsers. As
|
24 |
+
* HTML 5 gets wider support, the AutoSave plugin will use it automatically. In Windows Vista/7,
|
25 |
+
* localStorage is stored in the following folder:
|
26 |
+
* C:\Users\[username]\AppData\Local\Microsoft\Internet Explorer\DOMStore\[tempFolder]
|
27 |
+
*
|
28 |
+
* 2. sessionStorage - A new feature of HTML 5, sessionStorage works similarly to localStorage,
|
29 |
+
* except it is designed to expire after a certain amount of time. Because the specification
|
30 |
+
* around expiration date/time is very loosely-described, it is preferrable to use locaStorage and
|
31 |
+
* manage the expiration ourselves. sessionStorage has similar storage characteristics to
|
32 |
+
* localStorage, although it seems to have better support by Firefox 3 at the moment. (That will
|
33 |
+
* certainly change as Firefox continues getting better at HTML 5 adoption.)
|
34 |
+
*
|
35 |
+
* 3. UserData - A very under-exploited feature of Microsoft Internet Explorer, UserData is a
|
36 |
+
* way to store up to 128K of data per "document", or up to 1MB of data per domain, on the client
|
37 |
+
* computer. The feature is available for IE 5+, which makes it available for every version of IE
|
38 |
+
* supported by TinyMCE. The content is persistent across browser restarts and expires on the
|
39 |
+
* date/time specified, just like a cookie. However, the data is not cleared when the user clears
|
40 |
+
* cookies on the browser, which makes it well-suited for rescuing autosaved content. UserData,
|
41 |
+
* like other Microsoft IE browser technologies, is implemented as a behavior attached to a
|
42 |
+
* specific DOM object, so in this case we attach the behavior to the same DOM element that the
|
43 |
+
* TinyMCE editor instance is attached to.
|
44 |
+
*/
|
45 |
+
|
46 |
+
(function(tinymce) {
|
47 |
+
// Setup constants to help the compressor to reduce script size
|
48 |
+
var PLUGIN_NAME = 'autosave',
|
49 |
+
RESTORE_DRAFT = 'restoredraft',
|
50 |
+
TRUE = true,
|
51 |
+
undefined,
|
52 |
+
unloadHandlerAdded,
|
53 |
+
Dispatcher = tinymce.util.Dispatcher;
|
54 |
+
|
55 |
+
/**
|
56 |
+
* This plugin adds auto-save capability to the TinyMCE text editor to rescue content
|
57 |
+
* inadvertently lost. By using localStorage.
|
58 |
+
*
|
59 |
+
* @class tinymce.plugins.AutoSave
|
60 |
+
*/
|
61 |
+
tinymce.create('tinymce.plugins.AutoSave', {
|
62 |
+
/**
|
63 |
+
* Initializes the plugin, this will be executed after the plugin has been created.
|
64 |
+
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
65 |
+
* of the editor instance to intercept that event.
|
66 |
+
*
|
67 |
+
* @method init
|
68 |
+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
69 |
+
* @param {string} url Absolute URL to where the plugin is located.
|
70 |
+
*/
|
71 |
+
init : function(ed, url) {
|
72 |
+
var self = this, settings = ed.settings;
|
73 |
+
|
74 |
+
self.editor = ed;
|
75 |
+
|
76 |
+
// Parses the specified time string into a milisecond number 10m, 10s etc.
|
77 |
+
function parseTime(time) {
|
78 |
+
var multipels = {
|
79 |
+
s : 1000,
|
80 |
+
m : 60000
|
81 |
+
};
|
82 |
+
|
83 |
+
time = /^(\d+)([ms]?)$/.exec('' + time);
|
84 |
+
|
85 |
+
return (time[2] ? multipels[time[2]] : 1) * parseInt(time);
|
86 |
+
};
|
87 |
+
|
88 |
+
// Default config
|
89 |
+
tinymce.each({
|
90 |
+
ask_before_unload : TRUE,
|
91 |
+
interval : '30s',
|
92 |
+
retention : '20m',
|
93 |
+
minlength : 50
|
94 |
+
}, function(value, key) {
|
95 |
+
key = PLUGIN_NAME + '_' + key;
|
96 |
+
|
97 |
+
if (settings[key] === undefined)
|
98 |
+
settings[key] = value;
|
99 |
+
});
|
100 |
+
|
101 |
+
// Parse times
|
102 |
+
settings.autosave_interval = parseTime(settings.autosave_interval);
|
103 |
+
settings.autosave_retention = parseTime(settings.autosave_retention);
|
104 |
+
|
105 |
+
// Register restore button
|
106 |
+
ed.addButton(RESTORE_DRAFT, {
|
107 |
+
title : PLUGIN_NAME + ".restore_content",
|
108 |
+
onclick : function() {
|
109 |
+
if (ed.getContent({draft: true}).replace(/\s| |<\/?p[^>]*>|<br[^>]*>/gi, "").length > 0) {
|
110 |
+
// Show confirm dialog if the editor isn't empty
|
111 |
+
ed.windowManager.confirm(
|
112 |
+
PLUGIN_NAME + ".warning_message",
|
113 |
+
function(ok) {
|
114 |
+
if (ok)
|
115 |
+
self.restoreDraft();
|
116 |
+
}
|
117 |
+
);
|
118 |
+
} else
|
119 |
+
self.restoreDraft();
|
120 |
+
}
|
121 |
+
});
|
122 |
+
|
123 |
+
// Enable/disable restoredraft button depending on if there is a draft stored or not
|
124 |
+
ed.onNodeChange.add(function() {
|
125 |
+
var controlManager = ed.controlManager;
|
126 |
+
|
127 |
+
if (controlManager.get(RESTORE_DRAFT))
|
128 |
+
controlManager.setDisabled(RESTORE_DRAFT, !self.hasDraft());
|
129 |
+
});
|
130 |
+
|
131 |
+
ed.onInit.add(function() {
|
132 |
+
// Check if the user added the restore button, then setup auto storage logic
|
133 |
+
if (ed.controlManager.get(RESTORE_DRAFT)) {
|
134 |
+
// Setup storage engine
|
135 |
+
self.setupStorage(ed);
|
136 |
+
|
137 |
+
// Auto save contents each interval time
|
138 |
+
setInterval(function() {
|
139 |
+
if (!ed.removed) {
|
140 |
+
self.storeDraft();
|
141 |
+
ed.nodeChanged();
|
142 |
+
}
|
143 |
+
}, settings.autosave_interval);
|
144 |
+
}
|
145 |
+
});
|
146 |
+
|
147 |
+
/**
|
148 |
+
* This event gets fired when a draft is stored to local storage.
|
149 |
+
*
|
150 |
+
* @event onStoreDraft
|
151 |
+
* @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.
|
152 |
+
* @param {Object} draft Draft object containing the HTML contents of the editor.
|
153 |
+
*/
|
154 |
+
self.onStoreDraft = new Dispatcher(self);
|
155 |
+
|
156 |
+
/**
|
157 |
+
* This event gets fired when a draft is restored from local storage.
|
158 |
+
*
|
159 |
+
* @event onStoreDraft
|
160 |
+
* @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.
|
161 |
+
* @param {Object} draft Draft object containing the HTML contents of the editor.
|
162 |
+
*/
|
163 |
+
self.onRestoreDraft = new Dispatcher(self);
|
164 |
+
|
165 |
+
/**
|
166 |
+
* This event gets fired when a draft removed/expired.
|
167 |
+
*
|
168 |
+
* @event onRemoveDraft
|
169 |
+
* @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.
|
170 |
+
* @param {Object} draft Draft object containing the HTML contents of the editor.
|
171 |
+
*/
|
172 |
+
self.onRemoveDraft = new Dispatcher(self);
|
173 |
+
|
174 |
+
// Add ask before unload dialog only add one unload handler
|
175 |
+
if (!unloadHandlerAdded) {
|
176 |
+
window.onbeforeunload = tinymce.plugins.AutoSave._beforeUnloadHandler;
|
177 |
+
unloadHandlerAdded = TRUE;
|
178 |
+
}
|
179 |
+
},
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Returns information about the plugin as a name/value array.
|
183 |
+
* The current keys are longname, author, authorurl, infourl and version.
|
184 |
+
*
|
185 |
+
* @method getInfo
|
186 |
+
* @return {Object} Name/value array containing information about the plugin.
|
187 |
+
*/
|
188 |
+
getInfo : function() {
|
189 |
+
return {
|
190 |
+
longname : 'Auto save',
|
191 |
+
author : 'Moxiecode Systems AB',
|
192 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
193 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',
|
194 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
195 |
+
};
|
196 |
+
},
|
197 |
+
|
198 |
+
/**
|
199 |
+
* Returns an expiration date UTC string.
|
200 |
+
*
|
201 |
+
* @method getExpDate
|
202 |
+
* @return {String} Expiration date UTC string.
|
203 |
+
*/
|
204 |
+
getExpDate : function() {
|
205 |
+
return new Date(
|
206 |
+
new Date().getTime() + this.editor.settings.autosave_retention
|
207 |
+
).toUTCString();
|
208 |
+
},
|
209 |
+
|
210 |
+
/**
|
211 |
+
* This method will setup the storage engine. If the browser has support for it.
|
212 |
+
*
|
213 |
+
* @method setupStorage
|
214 |
+
*/
|
215 |
+
setupStorage : function(ed) {
|
216 |
+
var self = this, testKey = PLUGIN_NAME + '_test', testVal = "OK";
|
217 |
+
|
218 |
+
self.key = PLUGIN_NAME + ed.id;
|
219 |
+
|
220 |
+
// Loop though each storage engine type until we find one that works
|
221 |
+
tinymce.each([
|
222 |
+
function() {
|
223 |
+
// Try HTML5 Local Storage
|
224 |
+
if (localStorage) {
|
225 |
+
localStorage.setItem(testKey, testVal);
|
226 |
+
|
227 |
+
if (localStorage.getItem(testKey) === testVal) {
|
228 |
+
localStorage.removeItem(testKey);
|
229 |
+
|
230 |
+
return localStorage;
|
231 |
+
}
|
232 |
+
}
|
233 |
+
},
|
234 |
+
|
235 |
+
function() {
|
236 |
+
// Try HTML5 Session Storage
|
237 |
+
if (sessionStorage) {
|
238 |
+
sessionStorage.setItem(testKey, testVal);
|
239 |
+
|
240 |
+
if (sessionStorage.getItem(testKey) === testVal) {
|
241 |
+
sessionStorage.removeItem(testKey);
|
242 |
+
|
243 |
+
return sessionStorage;
|
244 |
+
}
|
245 |
+
}
|
246 |
+
},
|
247 |
+
|
248 |
+
function() {
|
249 |
+
// Try IE userData
|
250 |
+
if (tinymce.isIE) {
|
251 |
+
ed.getElement().style.behavior = "url('#default#userData')";
|
252 |
+
|
253 |
+
// Fake localStorage on old IE
|
254 |
+
return {
|
255 |
+
autoExpires : TRUE,
|
256 |
+
|
257 |
+
setItem : function(key, value) {
|
258 |
+
var userDataElement = ed.getElement();
|
259 |
+
|
260 |
+
userDataElement.setAttribute(key, value);
|
261 |
+
userDataElement.expires = self.getExpDate();
|
262 |
+
|
263 |
+
try {
|
264 |
+
userDataElement.save("TinyMCE");
|
265 |
+
} catch (e) {
|
266 |
+
// Ignore, saving might fail if "Userdata Persistence" is disabled in IE
|
267 |
+
}
|
268 |
+
},
|
269 |
+
|
270 |
+
getItem : function(key) {
|
271 |
+
var userDataElement = ed.getElement();
|
272 |
+
|
273 |
+
try {
|
274 |
+
userDataElement.load("TinyMCE");
|
275 |
+
return userDataElement.getAttribute(key);
|
276 |
+
} catch (e) {
|
277 |
+
// Ignore, loading might fail if "Userdata Persistence" is disabled in IE
|
278 |
+
return null;
|
279 |
+
}
|
280 |
+
},
|
281 |
+
|
282 |
+
removeItem : function(key) {
|
283 |
+
ed.getElement().removeAttribute(key);
|
284 |
+
}
|
285 |
+
};
|
286 |
+
}
|
287 |
+
},
|
288 |
+
], function(setup) {
|
289 |
+
// Try executing each function to find a suitable storage engine
|
290 |
+
try {
|
291 |
+
self.storage = setup();
|
292 |
+
|
293 |
+
if (self.storage)
|
294 |
+
return false;
|
295 |
+
} catch (e) {
|
296 |
+
// Ignore
|
297 |
+
}
|
298 |
+
});
|
299 |
+
},
|
300 |
+
|
301 |
+
/**
|
302 |
+
* This method will store the current contents in the the storage engine.
|
303 |
+
*
|
304 |
+
* @method storeDraft
|
305 |
+
*/
|
306 |
+
storeDraft : function() {
|
307 |
+
var self = this, storage = self.storage, editor = self.editor, expires, content;
|
308 |
+
|
309 |
+
// Is the contents dirty
|
310 |
+
if (storage) {
|
311 |
+
// If there is no existing key and the contents hasn't been changed since
|
312 |
+
// it's original value then there is no point in saving a draft
|
313 |
+
if (!storage.getItem(self.key) && !editor.isDirty())
|
314 |
+
return;
|
315 |
+
|
316 |
+
// Store contents if the contents if longer than the minlength of characters
|
317 |
+
content = editor.getContent({draft: true});
|
318 |
+
if (content.length > editor.settings.autosave_minlength) {
|
319 |
+
expires = self.getExpDate();
|
320 |
+
|
321 |
+
// Store expiration date if needed IE userData has auto expire built in
|
322 |
+
if (!self.storage.autoExpires)
|
323 |
+
self.storage.setItem(self.key + "_expires", expires);
|
324 |
+
|
325 |
+
self.storage.setItem(self.key, content);
|
326 |
+
self.onStoreDraft.dispatch(self, {
|
327 |
+
expires : expires,
|
328 |
+
content : content
|
329 |
+
});
|
330 |
+
}
|
331 |
+
}
|
332 |
+
},
|
333 |
+
|
334 |
+
/**
|
335 |
+
* This method will restore the contents from the storage engine back to the editor.
|
336 |
+
*
|
337 |
+
* @method restoreDraft
|
338 |
+
*/
|
339 |
+
restoreDraft : function() {
|
340 |
+
var self = this, storage = self.storage, content;
|
341 |
+
|
342 |
+
if (storage) {
|
343 |
+
content = storage.getItem(self.key);
|
344 |
+
|
345 |
+
if (content) {
|
346 |
+
self.editor.setContent(content);
|
347 |
+
self.onRestoreDraft.dispatch(self, {
|
348 |
+
content : content
|
349 |
+
});
|
350 |
+
}
|
351 |
+
}
|
352 |
+
},
|
353 |
+
|
354 |
+
/**
|
355 |
+
* This method will return true/false if there is a local storage draft available.
|
356 |
+
*
|
357 |
+
* @method hasDraft
|
358 |
+
* @return {boolean} true/false state if there is a local draft.
|
359 |
+
*/
|
360 |
+
hasDraft : function() {
|
361 |
+
var self = this, storage = self.storage, expDate, exists;
|
362 |
+
|
363 |
+
if (storage) {
|
364 |
+
// Does the item exist at all
|
365 |
+
exists = !!storage.getItem(self.key);
|
366 |
+
if (exists) {
|
367 |
+
// Storage needs autoexpire
|
368 |
+
if (!self.storage.autoExpires) {
|
369 |
+
expDate = new Date(storage.getItem(self.key + "_expires"));
|
370 |
+
|
371 |
+
// Contents hasn't expired
|
372 |
+
if (new Date().getTime() < expDate.getTime())
|
373 |
+
return TRUE;
|
374 |
+
|
375 |
+
// Remove it if it has
|
376 |
+
self.removeDraft();
|
377 |
+
} else
|
378 |
+
return TRUE;
|
379 |
+
}
|
380 |
+
}
|
381 |
+
|
382 |
+
return false;
|
383 |
+
},
|
384 |
+
|
385 |
+
/**
|
386 |
+
* Removes the currently stored draft.
|
387 |
+
*
|
388 |
+
* @method removeDraft
|
389 |
+
*/
|
390 |
+
removeDraft : function() {
|
391 |
+
var self = this, storage = self.storage, key = self.key, content;
|
392 |
+
|
393 |
+
if (storage) {
|
394 |
+
// Get current contents and remove the existing draft
|
395 |
+
content = storage.getItem(key);
|
396 |
+
storage.removeItem(key);
|
397 |
+
storage.removeItem(key + "_expires");
|
398 |
+
|
399 |
+
// Dispatch remove event if we had any contents
|
400 |
+
if (content) {
|
401 |
+
self.onRemoveDraft.dispatch(self, {
|
402 |
+
content : content
|
403 |
+
});
|
404 |
+
}
|
405 |
+
}
|
406 |
+
},
|
407 |
+
|
408 |
+
"static" : {
|
409 |
+
// Internal unload handler will be called before the page is unloaded
|
410 |
+
_beforeUnloadHandler : function(e) {
|
411 |
+
var msg;
|
412 |
+
|
413 |
+
tinymce.each(tinyMCE.editors, function(ed) {
|
414 |
+
// Store a draft for each editor instance
|
415 |
+
if (ed.plugins.autosave)
|
416 |
+
ed.plugins.autosave.storeDraft();
|
417 |
+
|
418 |
+
// Never ask in fullscreen mode
|
419 |
+
if (ed.getParam("fullscreen_is_enabled"))
|
420 |
+
return;
|
421 |
+
|
422 |
+
// Setup a return message if the editor is dirty
|
423 |
+
if (!msg && ed.isDirty() && ed.getParam("autosave_ask_before_unload"))
|
424 |
+
msg = ed.getLang("autosave.unload_msg");
|
425 |
+
});
|
426 |
+
|
427 |
+
return msg;
|
428 |
+
}
|
429 |
+
}
|
430 |
+
});
|
431 |
+
|
432 |
+
tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSave);
|
433 |
+
})(tinymce);
|
js/libraries/tiny_mce/plugins/autosave/langs/en.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('en.autosave',{
|
2 |
+
restore_content: "Restore auto-saved content",
|
3 |
+
warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?"
|
4 |
+
});
|
js/libraries/tiny_mce/plugins/bbcode/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a,b){var d=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.onBeforeSetContent.add(function(e,f){f.content=d["_"+c+"_bbcode2html"](f.content)});a.onPostProcess.add(function(e,f){if(f.set){f.content=d["_"+c+"_bbcode2html"](f.content)}if(f.get){f.content=d["_"+c+"_html2bbcode"](f.content)}})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_punbb_html2bbcode:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/<font>(.*?)<\/font>/gi,"$1");b(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");b(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");b(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");b(/<u>/gi,"[u]");b(/<blockquote[^>]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/<br \/>/gi,"\n");b(/<br\/>/gi,"\n");b(/<br>/gi,"\n");b(/<p>/gi,"");b(/<\/p>/gi,"\n");b(/ |\u00a0/gi," ");b(/"/gi,'"');b(/</gi,"<");b(/>/gi,">");b(/&/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"<br />");b(/\[b\]/gi,"<strong>");b(/\[\/b\]/gi,"</strong>");b(/\[i\]/gi,"<em>");b(/\[\/i\]/gi,"</em>");b(/\[u\]/gi,"<u>");b(/\[\/u\]/gi,"</u>");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>');b(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>');b(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>');b(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span> ');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span> ');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})();
|
js/libraries/tiny_mce/plugins/bbcode/editor_plugin_src.js
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.BBCodePlugin', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase();
|
15 |
+
|
16 |
+
ed.onBeforeSetContent.add(function(ed, o) {
|
17 |
+
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
18 |
+
});
|
19 |
+
|
20 |
+
ed.onPostProcess.add(function(ed, o) {
|
21 |
+
if (o.set)
|
22 |
+
o.content = t['_' + dialect + '_bbcode2html'](o.content);
|
23 |
+
|
24 |
+
if (o.get)
|
25 |
+
o.content = t['_' + dialect + '_html2bbcode'](o.content);
|
26 |
+
});
|
27 |
+
},
|
28 |
+
|
29 |
+
getInfo : function() {
|
30 |
+
return {
|
31 |
+
longname : 'BBCode Plugin',
|
32 |
+
author : 'Moxiecode Systems AB',
|
33 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
34 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
|
35 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
36 |
+
};
|
37 |
+
},
|
38 |
+
|
39 |
+
// Private methods
|
40 |
+
|
41 |
+
// HTML -> BBCode in PunBB dialect
|
42 |
+
_punbb_html2bbcode : function(s) {
|
43 |
+
s = tinymce.trim(s);
|
44 |
+
|
45 |
+
function rep(re, str) {
|
46 |
+
s = s.replace(re, str);
|
47 |
+
};
|
48 |
+
|
49 |
+
// example: <strong> to [b]
|
50 |
+
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
|
51 |
+
rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
|
52 |
+
rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
|
53 |
+
rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
|
54 |
+
rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
|
55 |
+
rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
|
56 |
+
rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");
|
57 |
+
rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
|
58 |
+
rep(/<font>(.*?)<\/font>/gi,"$1");
|
59 |
+
rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
|
60 |
+
rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");
|
61 |
+
rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");
|
62 |
+
rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");
|
63 |
+
rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");
|
64 |
+
rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");
|
65 |
+
rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");
|
66 |
+
rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");
|
67 |
+
rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");
|
68 |
+
rep(/<\/(strong|b)>/gi,"[/b]");
|
69 |
+
rep(/<(strong|b)>/gi,"[b]");
|
70 |
+
rep(/<\/(em|i)>/gi,"[/i]");
|
71 |
+
rep(/<(em|i)>/gi,"[i]");
|
72 |
+
rep(/<\/u>/gi,"[/u]");
|
73 |
+
rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");
|
74 |
+
rep(/<u>/gi,"[u]");
|
75 |
+
rep(/<blockquote[^>]*>/gi,"[quote]");
|
76 |
+
rep(/<\/blockquote>/gi,"[/quote]");
|
77 |
+
rep(/<br \/>/gi,"\n");
|
78 |
+
rep(/<br\/>/gi,"\n");
|
79 |
+
rep(/<br>/gi,"\n");
|
80 |
+
rep(/<p>/gi,"");
|
81 |
+
rep(/<\/p>/gi,"\n");
|
82 |
+
rep(/ |\u00a0/gi," ");
|
83 |
+
rep(/"/gi,"\"");
|
84 |
+
rep(/</gi,"<");
|
85 |
+
rep(/>/gi,">");
|
86 |
+
rep(/&/gi,"&");
|
87 |
+
|
88 |
+
return s;
|
89 |
+
},
|
90 |
+
|
91 |
+
// BBCode -> HTML from PunBB dialect
|
92 |
+
_punbb_bbcode2html : function(s) {
|
93 |
+
s = tinymce.trim(s);
|
94 |
+
|
95 |
+
function rep(re, str) {
|
96 |
+
s = s.replace(re, str);
|
97 |
+
};
|
98 |
+
|
99 |
+
// example: [b] to <strong>
|
100 |
+
rep(/\n/gi,"<br />");
|
101 |
+
rep(/\[b\]/gi,"<strong>");
|
102 |
+
rep(/\[\/b\]/gi,"</strong>");
|
103 |
+
rep(/\[i\]/gi,"<em>");
|
104 |
+
rep(/\[\/i\]/gi,"</em>");
|
105 |
+
rep(/\[u\]/gi,"<u>");
|
106 |
+
rep(/\[\/u\]/gi,"</u>");
|
107 |
+
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");
|
108 |
+
rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
|
109 |
+
rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
|
110 |
+
rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");
|
111 |
+
rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span> ");
|
112 |
+
rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span> ");
|
113 |
+
|
114 |
+
return s;
|
115 |
+
}
|
116 |
+
});
|
117 |
+
|
118 |
+
// Register plugin
|
119 |
+
tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
|
120 |
+
})();
|
js/libraries/tiny_mce/plugins/contextmenu/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(f){var i=this,g,d,j,e;i.editor=f;d=f.settings.contextmenu_never_use_native;i.onContextMenu=new tinymce.util.Dispatcher(this);e=function(k){h(f,k)};g=f.onContextMenu.add(function(k,l){if((j!==0?j:l.ctrlKey)&&!d){return}a.cancel(l);if(l.target.nodeName=="IMG"){k.selection.select(l.target)}i._getMenu(k).showMenu(l.clientX||l.pageX,l.clientY||l.pageY);a.add(k.getDoc(),"click",e);k.nodeChanged()});f.onRemove.add(function(){if(i._menu){i._menu.removeAll()}});function h(k,l){j=0;if(l&&l.button==2){j=l.ctrlKey;return}if(i._menu){i._menu.removeAll();i._menu.destroy();a.remove(k.getDoc(),"click",e);i._menu=null}}f.onMouseDown.add(h);f.onKeyDown.add(h);f.onKeyDown.add(function(k,l){if(l.shiftKey&&!l.ctrlKey&&!l.altKey&&l.keyCode===121){a.cancel(l);g(k,l)}})},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(e){var g=this,d=g._menu,j=e.selection,f=j.isCollapsed(),h=j.getNode()||e.getBody(),i,k;if(d){d.removeAll();d.destroy()}k=b.getPos(e.getContentAreaContainer());d=e.controlManager.createDropMenu("contextmenu",{offset_x:k.x+e.getParam("contextmenu_offset_x",0),offset_y:k.y+e.getParam("contextmenu_offset_y",0),constrain:1,keyboard_focus:true});g._menu=d;d.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(f);d.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(f);d.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((h.nodeName=="A"&&!e.dom.getAttrib(h,"name"))||!f){d.addSeparator();d.add({title:"advanced.link_desc",icon:"link",cmd:e.plugins.advlink?"mceAdvLink":"mceLink",ui:true});d.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}d.addSeparator();d.add({title:"advanced.image_desc",icon:"image",cmd:e.plugins.advimage?"mceAdvImage":"mceImage",ui:true});d.addSeparator();i=d.addMenu({title:"contextmenu.align"});i.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});i.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});i.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});i.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});g.onContextMenu.dispatch(g,d,h,f);return d}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})();
|
js/libraries/tiny_mce/plugins/contextmenu/editor_plugin_src.js
ADDED
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* This plugin a context menu to TinyMCE editor instances.
|
16 |
+
*
|
17 |
+
* @class tinymce.plugins.ContextMenu
|
18 |
+
*/
|
19 |
+
tinymce.create('tinymce.plugins.ContextMenu', {
|
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 |
+
* @method init
|
26 |
+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
27 |
+
* @param {string} url Absolute URL to where the plugin is located.
|
28 |
+
*/
|
29 |
+
init : function(ed) {
|
30 |
+
var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey, hideMenu;
|
31 |
+
|
32 |
+
t.editor = ed;
|
33 |
+
|
34 |
+
contextmenuNeverUseNative = ed.settings.contextmenu_never_use_native;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* This event gets fired when the context menu is shown.
|
38 |
+
*
|
39 |
+
* @event onContextMenu
|
40 |
+
* @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event.
|
41 |
+
* @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed.
|
42 |
+
*/
|
43 |
+
t.onContextMenu = new tinymce.util.Dispatcher(this);
|
44 |
+
|
45 |
+
hideMenu = function(e) {
|
46 |
+
hide(ed, e);
|
47 |
+
};
|
48 |
+
|
49 |
+
showMenu = ed.onContextMenu.add(function(ed, e) {
|
50 |
+
// Block TinyMCE menu on ctrlKey and work around Safari issue
|
51 |
+
if ((realCtrlKey !== 0 ? realCtrlKey : e.ctrlKey) && !contextmenuNeverUseNative)
|
52 |
+
return;
|
53 |
+
|
54 |
+
Event.cancel(e);
|
55 |
+
|
56 |
+
// Select the image if it's clicked. WebKit would other wise expand the selection
|
57 |
+
if (e.target.nodeName == 'IMG')
|
58 |
+
ed.selection.select(e.target);
|
59 |
+
|
60 |
+
t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageY);
|
61 |
+
Event.add(ed.getDoc(), 'click', hideMenu);
|
62 |
+
|
63 |
+
ed.nodeChanged();
|
64 |
+
});
|
65 |
+
|
66 |
+
ed.onRemove.add(function() {
|
67 |
+
if (t._menu)
|
68 |
+
t._menu.removeAll();
|
69 |
+
});
|
70 |
+
|
71 |
+
function hide(ed, e) {
|
72 |
+
realCtrlKey = 0;
|
73 |
+
|
74 |
+
// Since the contextmenu event moves
|
75 |
+
// the selection we need to store it away
|
76 |
+
if (e && e.button == 2) {
|
77 |
+
realCtrlKey = e.ctrlKey;
|
78 |
+
return;
|
79 |
+
}
|
80 |
+
|
81 |
+
if (t._menu) {
|
82 |
+
t._menu.removeAll();
|
83 |
+
t._menu.destroy();
|
84 |
+
Event.remove(ed.getDoc(), 'click', hideMenu);
|
85 |
+
t._menu = null;
|
86 |
+
}
|
87 |
+
};
|
88 |
+
|
89 |
+
ed.onMouseDown.add(hide);
|
90 |
+
ed.onKeyDown.add(hide);
|
91 |
+
ed.onKeyDown.add(function(ed, e) {
|
92 |
+
if (e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode === 121) {
|
93 |
+
Event.cancel(e);
|
94 |
+
showMenu(ed, e);
|
95 |
+
}
|
96 |
+
});
|
97 |
+
},
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Returns information about the plugin as a name/value array.
|
101 |
+
* The current keys are longname, author, authorurl, infourl and version.
|
102 |
+
*
|
103 |
+
* @method getInfo
|
104 |
+
* @return {Object} Name/value array containing information about the plugin.
|
105 |
+
*/
|
106 |
+
getInfo : function() {
|
107 |
+
return {
|
108 |
+
longname : 'Contextmenu',
|
109 |
+
author : 'Moxiecode Systems AB',
|
110 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
111 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',
|
112 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
113 |
+
};
|
114 |
+
},
|
115 |
+
|
116 |
+
_getMenu : function(ed) {
|
117 |
+
var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p;
|
118 |
+
|
119 |
+
if (m) {
|
120 |
+
m.removeAll();
|
121 |
+
m.destroy();
|
122 |
+
}
|
123 |
+
|
124 |
+
p = DOM.getPos(ed.getContentAreaContainer());
|
125 |
+
|
126 |
+
m = ed.controlManager.createDropMenu('contextmenu', {
|
127 |
+
offset_x : p.x + ed.getParam('contextmenu_offset_x', 0),
|
128 |
+
offset_y : p.y + ed.getParam('contextmenu_offset_y', 0),
|
129 |
+
constrain : 1,
|
130 |
+
keyboard_focus: true
|
131 |
+
});
|
132 |
+
|
133 |
+
t._menu = m;
|
134 |
+
|
135 |
+
m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col);
|
136 |
+
m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col);
|
137 |
+
m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'});
|
138 |
+
|
139 |
+
if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) {
|
140 |
+
m.addSeparator();
|
141 |
+
m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});
|
142 |
+
m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});
|
143 |
+
}
|
144 |
+
|
145 |
+
m.addSeparator();
|
146 |
+
m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
|
147 |
+
|
148 |
+
m.addSeparator();
|
149 |
+
am = m.addMenu({title : 'contextmenu.align'});
|
150 |
+
am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'});
|
151 |
+
am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'});
|
152 |
+
am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'});
|
153 |
+
am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'});
|
154 |
+
|
155 |
+
t.onContextMenu.dispatch(t, m, el, col);
|
156 |
+
|
157 |
+
return m;
|
158 |
+
}
|
159 |
+
});
|
160 |
+
|
161 |
+
// Register plugin
|
162 |
+
tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu);
|
163 |
+
})();
|
js/libraries/tiny_mce/plugins/directionality/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(b,c){var d=this;d.editor=b;function a(e){var h=b.dom,g,f=b.selection.getSelectedBlocks();if(f.length){g=h.getAttrib(f[0],"dir");tinymce.each(f,function(i){if(!h.getParent(i.parentNode,"*[dir='"+e+"']",h.getRoot())){if(g!=e){h.setAttrib(i,"dir",e)}else{h.setAttrib(i,"dir",null)}}});b.nodeChanged()}}b.addCommand("mceDirectionLTR",function(){a("ltr")});b.addCommand("mceDirectionRTL",function(){a("rtl")});b.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});b.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});b.onNodeChange.add(d._nodeChange,d)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})();
|
js/libraries/tiny_mce/plugins/directionality/editor_plugin_src.js
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.Directionality', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
var t = this;
|
15 |
+
|
16 |
+
t.editor = ed;
|
17 |
+
|
18 |
+
function setDir(dir) {
|
19 |
+
var dom = ed.dom, curDir, blocks = ed.selection.getSelectedBlocks();
|
20 |
+
|
21 |
+
if (blocks.length) {
|
22 |
+
curDir = dom.getAttrib(blocks[0], "dir");
|
23 |
+
|
24 |
+
tinymce.each(blocks, function(block) {
|
25 |
+
// Add dir to block if the parent block doesn't already have that dir
|
26 |
+
if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) {
|
27 |
+
if (curDir != dir) {
|
28 |
+
dom.setAttrib(block, "dir", dir);
|
29 |
+
} else {
|
30 |
+
dom.setAttrib(block, "dir", null);
|
31 |
+
}
|
32 |
+
}
|
33 |
+
});
|
34 |
+
|
35 |
+
ed.nodeChanged();
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
ed.addCommand('mceDirectionLTR', function() {
|
40 |
+
setDir("ltr");
|
41 |
+
});
|
42 |
+
|
43 |
+
ed.addCommand('mceDirectionRTL', function() {
|
44 |
+
setDir("rtl");
|
45 |
+
});
|
46 |
+
|
47 |
+
ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'});
|
48 |
+
ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'});
|
49 |
+
|
50 |
+
ed.onNodeChange.add(t._nodeChange, t);
|
51 |
+
},
|
52 |
+
|
53 |
+
getInfo : function() {
|
54 |
+
return {
|
55 |
+
longname : 'Directionality',
|
56 |
+
author : 'Moxiecode Systems AB',
|
57 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
58 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',
|
59 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
60 |
+
};
|
61 |
+
},
|
62 |
+
|
63 |
+
// Private methods
|
64 |
+
|
65 |
+
_nodeChange : function(ed, cm, n) {
|
66 |
+
var dom = ed.dom, dir;
|
67 |
+
|
68 |
+
n = dom.getParent(n, dom.isBlock);
|
69 |
+
if (!n) {
|
70 |
+
cm.setDisabled('ltr', 1);
|
71 |
+
cm.setDisabled('rtl', 1);
|
72 |
+
return;
|
73 |
+
}
|
74 |
+
|
75 |
+
dir = dom.getAttrib(n, 'dir');
|
76 |
+
cm.setActive('ltr', dir == "ltr");
|
77 |
+
cm.setDisabled('ltr', 0);
|
78 |
+
cm.setActive('rtl', dir == "rtl");
|
79 |
+
cm.setDisabled('rtl', 0);
|
80 |
+
}
|
81 |
+
});
|
82 |
+
|
83 |
+
// Register plugin
|
84 |
+
tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality);
|
85 |
+
})();
|
js/libraries/tiny_mce/plugins/emotions/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(a){a.create("tinymce.plugins.EmotionsPlugin",{init:function(b,c){b.addCommand("mceEmotion",function(){b.windowManager.open({file:c+"/emotions.htm",width:250+parseInt(b.getLang("emotions.delta_width",0)),height:160+parseInt(b.getLang("emotions.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("emotions",{title:"emotions.emotions_desc",cmd:"mceEmotion"})},getInfo:function(){return{longname:"Emotions",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("emotions",a.plugins.EmotionsPlugin)})(tinymce);
|
js/libraries/tiny_mce/plugins/emotions/editor_plugin_src.js
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
tinymce.create('tinymce.plugins.EmotionsPlugin', {
|
13 |
+
init : function(ed, url) {
|
14 |
+
// Register commands
|
15 |
+
ed.addCommand('mceEmotion', function() {
|
16 |
+
ed.windowManager.open({
|
17 |
+
file : url + '/emotions.htm',
|
18 |
+
width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)),
|
19 |
+
height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)),
|
20 |
+
inline : 1
|
21 |
+
}, {
|
22 |
+
plugin_url : url
|
23 |
+
});
|
24 |
+
});
|
25 |
+
|
26 |
+
// Register buttons
|
27 |
+
ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'});
|
28 |
+
},
|
29 |
+
|
30 |
+
getInfo : function() {
|
31 |
+
return {
|
32 |
+
longname : 'Emotions',
|
33 |
+
author : 'Moxiecode Systems AB',
|
34 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
35 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',
|
36 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
37 |
+
};
|
38 |
+
}
|
39 |
+
});
|
40 |
+
|
41 |
+
// Register plugin
|
42 |
+
tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin);
|
43 |
+
})(tinymce);
|
js/libraries/tiny_mce/plugins/emotions/emotions.htm
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<title>{#emotions_dlg.title}</title>
|
5 |
+
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
6 |
+
<script type="text/javascript" src="js/emotions.js"></script>
|
7 |
+
</head>
|
8 |
+
<body style="display: none" role="application" aria-labelledby="app_title">
|
9 |
+
<span style="display:none;" id="app_title">{#emotions_dlg.title}</span>
|
10 |
+
<div align="center">
|
11 |
+
<div class="title">{#emotions_dlg.title}:<br /><br /></div>
|
12 |
+
|
13 |
+
<table id="emoticon_table" role="presentation" border="0" cellspacing="0" cellpadding="4">
|
14 |
+
<tr>
|
15 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.cool}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-cool.gif','emotions_dlg.cool');"><img src="img/smiley-cool.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cool}. {#emotions_dlg.usage}" /></a></td>
|
16 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.cry}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-cry.gif','emotions_dlg.cry');"><img src="img/smiley-cry.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cry}. {#emotions_dlg.usage}" /></a></td>
|
17 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.embarassed}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-embarassed.gif','emotions_dlg.embarassed');"><img src="img/smiley-embarassed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.embarassed}. {#emotions_dlg.usage}" /></a></td>
|
18 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.foot_in_mouth}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-foot-in-mouth.gif','emotions_dlg.foot_in_mouth');"><img src="img/smiley-foot-in-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.foot_in_mouth}. {#emotions_dlg.usage}" /></a></td>
|
19 |
+
</tr>
|
20 |
+
<tr>
|
21 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.frown}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-frown.gif','emotions_dlg.frown');"><img src="img/smiley-frown.gif" width="18" height="18" border="0" alt="{#emotions_dlg.frown}. {#emotions_dlg.usage}" /></a></td>
|
22 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.innocent}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-innocent.gif','emotions_dlg.innocent');"><img src="img/smiley-innocent.gif" width="18" height="18" border="0" alt="{#emotions_dlg.innocent}. {#emotions_dlg.usage}" /></a></td>
|
23 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.kiss}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-kiss.gif','emotions_dlg.kiss');"><img src="img/smiley-kiss.gif" width="18" height="18" border="0" alt="{#emotions_dlg.kiss}. {#emotions_dlg.usage}" /></a></td>
|
24 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.laughing}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-laughing.gif','emotions_dlg.laughing');"><img src="img/smiley-laughing.gif" width="18" height="18" border="0" alt="{#emotions_dlg.laughing}. {#emotions_dlg.usage}" /></a></td>
|
25 |
+
</tr>
|
26 |
+
<tr>
|
27 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.money_mouth}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-money-mouth.gif','emotions_dlg.money_mouth');"><img src="img/smiley-money-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.money_mouth}. {#emotions_dlg.usage}"/></a></td>
|
28 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.sealed}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-sealed.gif','emotions_dlg.sealed');"><img src="img/smiley-sealed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.sealed}. {#emotions_dlg.usage}" /></a></td>
|
29 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.smile}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-smile.gif','emotions_dlg.smile');"><img src="img/smiley-smile.gif" width="18" height="18" border="0" alt="{#emotions_dlg.smile}. {#emotions_dlg.usage}" /></a></td>
|
30 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.surprised}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-surprised.gif','emotions_dlg.surprised');"><img src="img/smiley-surprised.gif" width="18" height="18" border="0" alt="{#emotions_dlg.surprised}. {#emotions_dlg.usage}" /></a></td>
|
31 |
+
</tr>
|
32 |
+
<tr>
|
33 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.tongue_out}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-tongue-out.gif','emotions_dlg.tongue_out');"><img src="img/smiley-tongue-out.gif" width="18" height="18" border="0" alt="{#emotions_dlg.tongue-out}. {#emotions_dlg.usage}" /></a></td>
|
34 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.undecided}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-undecided.gif','emotions_dlg.undecided');"><img src="img/smiley-undecided.gif" width="18" height="18" border="0" alt="{#emotions_dlg.undecided}. {#emotions_dlg.usage}" /></a></td>
|
35 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.wink}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-wink.gif','emotions_dlg.wink');"><img src="img/smiley-wink.gif" width="18" height="18" border="0" alt="{#emotions_dlg.wink}. {#emotions_dlg.usage}" /></a></td>
|
36 |
+
<td><a class="emoticon_link" role="button" title="{#emotions_dlg.yell}. {#emotions_dlg.usage}" href="javascript:EmotionsDialog.insert('smiley-yell.gif','emotions_dlg.yell');"><img src="img/smiley-yell.gif" width="18" height="18" border="0" alt="{#emotions_dlg.yell}. {#emotions_dlg.usage}" /></a></td>
|
37 |
+
</tr>
|
38 |
+
</table>
|
39 |
+
<div>{#emotions_dlg.usage}</div>
|
40 |
+
</div>
|
41 |
+
</body>
|
42 |
+
</html>
|
js/libraries/tiny_mce/plugins/emotions/img/smiley-cool.gif
ADDED
Binary file
|
js/libraries/tiny_mce/plugins/emotions/img/smiley-cry.gif
ADDED
Binary file
|
js/libraries/tiny_mce/plugins/emotions/img/smiley-embarassed.gif
ADDED
Binary file
|
js/libraries/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif
ADDED
Binary file
|
js/libraries/tiny_mce/plugins/emotions/img/smiley-frown.gif
ADDED
Binary file
|
js/libraries/tiny_mce/plugins/emotions/img/smiley-innocent.gif
ADDED
Binary file
|
js/libraries/tiny_mce/plugins/emotions/img/smiley-kiss.gif
ADDED
Binary file
|
js/libraries/tiny_mce/plugins/emotions/img/smiley-laughing.gif
ADDED
Binary file
|
js/libraries/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif
ADDED
Binary file
|
js/libraries/tiny_mce/plugins/emotions/img/smiley-sealed.gif
ADDED
Binary file
|
js/libraries/tiny_mce/plugins/emotions/img/smiley-smile.gif
ADDED
Binary file
|
js/libraries/tiny_mce/plugins/emotions/img/smiley-surprised.gif
ADDED
Binary file
|
js/libraries/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif
ADDED
Binary file
|
js/libraries/tiny_mce/plugins/emotions/img/smiley-undecided.gif
ADDED
Binary file
|
js/libraries/tiny_mce/plugins/emotions/img/smiley-wink.gif
ADDED
Binary file
|
js/libraries/tiny_mce/plugins/emotions/img/smiley-yell.gif
ADDED
Binary file
|
js/libraries/tiny_mce/plugins/emotions/js/emotions.js
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
tinyMCEPopup.requireLangPack();
|
2 |
+
|
3 |
+
var EmotionsDialog = {
|
4 |
+
addKeyboardNavigation: function(){
|
5 |
+
var tableElm, cells, settings;
|
6 |
+
|
7 |
+
cells = tinyMCEPopup.dom.select("a.emoticon_link", "emoticon_table");
|
8 |
+
|
9 |
+
settings ={
|
10 |
+
root: "emoticon_table",
|
11 |
+
items: cells
|
12 |
+
};
|
13 |
+
cells[0].tabindex=0;
|
14 |
+
tinyMCEPopup.dom.addClass(cells[0], "mceFocus");
|
15 |
+
if (tinymce.isGecko) {
|
16 |
+
cells[0].focus();
|
17 |
+
} else {
|
18 |
+
setTimeout(function(){
|
19 |
+
cells[0].focus();
|
20 |
+
}, 100);
|
21 |
+
}
|
22 |
+
tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom);
|
23 |
+
},
|
24 |
+
init : function(ed) {
|
25 |
+
tinyMCEPopup.resizeToInnerSize();
|
26 |
+
this.addKeyboardNavigation();
|
27 |
+
},
|
28 |
+
|
29 |
+
insert : function(file, title) {
|
30 |
+
var ed = tinyMCEPopup.editor, dom = ed.dom;
|
31 |
+
|
32 |
+
tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {
|
33 |
+
src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,
|
34 |
+
alt : ed.getLang(title),
|
35 |
+
title : ed.getLang(title),
|
36 |
+
border : 0
|
37 |
+
}));
|
38 |
+
|
39 |
+
tinyMCEPopup.close();
|
40 |
+
}
|
41 |
+
};
|
42 |
+
|
43 |
+
tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog);
|
js/libraries/tiny_mce/plugins/emotions/langs/en_dlg.js
ADDED
@@ -0,0 +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"});
|
js/libraries/tiny_mce/plugins/example/dialog.htm
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>{#example_dlg.title}</title>
|
5 |
+
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
6 |
+
<script type="text/javascript" src="js/dialog.js"></script>
|
7 |
+
</head>
|
8 |
+
<body>
|
9 |
+
|
10 |
+
<form onsubmit="ExampleDialog.insert();return false;" action="#">
|
11 |
+
<p>Here is a example dialog.</p>
|
12 |
+
<p>Selected text: <input id="someval" name="someval" type="text" class="text" /></p>
|
13 |
+
<p>Custom arg: <input id="somearg" name="somearg" type="text" class="text" /></p>
|
14 |
+
|
15 |
+
<div class="mceActionPanel">
|
16 |
+
<input type="button" id="insert" name="insert" value="{#insert}" onclick="ExampleDialog.insert();" />
|
17 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
18 |
+
</div>
|
19 |
+
</form>
|
20 |
+
|
21 |
+
</body>
|
22 |
+
</html>
|
js/libraries/tiny_mce/plugins/example/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){tinymce.PluginManager.requireLangPack("example");tinymce.create("tinymce.plugins.ExamplePlugin",{init:function(a,b){a.addCommand("mceExample",function(){a.windowManager.open({file:b+"/dialog.htm",width:320+parseInt(a.getLang("example.delta_width",0)),height:120+parseInt(a.getLang("example.delta_height",0)),inline:1},{plugin_url:b,some_custom_arg:"custom arg"})});a.addButton("example",{title:"example.desc",cmd:"mceExample",image:b+"/img/example.gif"});a.onNodeChange.add(function(d,c,e){c.setActive("example",e.nodeName=="IMG")})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Example plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example",version:"1.0"}}});tinymce.PluginManager.add("example",tinymce.plugins.ExamplePlugin)})();
|
js/libraries/tiny_mce/plugins/example/editor_plugin_src.js
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
// Load plugin specific language pack
|
13 |
+
tinymce.PluginManager.requireLangPack('example');
|
14 |
+
|
15 |
+
tinymce.create('tinymce.plugins.ExamplePlugin', {
|
16 |
+
/**
|
17 |
+
* Initializes the plugin, this will be executed after the plugin has been created.
|
18 |
+
* This call is done before the editor instance has finished it's initialization so use the onInit event
|
19 |
+
* of the editor instance to intercept that event.
|
20 |
+
*
|
21 |
+
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
|
22 |
+
* @param {string} url Absolute URL to where the plugin is located.
|
23 |
+
*/
|
24 |
+
init : function(ed, url) {
|
25 |
+
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
|
26 |
+
ed.addCommand('mceExample', function() {
|
27 |
+
ed.windowManager.open({
|
28 |
+
file : url + '/dialog.htm',
|
29 |
+
width : 320 + parseInt(ed.getLang('example.delta_width', 0)),
|
30 |
+
height : 120 + parseInt(ed.getLang('example.delta_height', 0)),
|
31 |
+
inline : 1
|
32 |
+
}, {
|
33 |
+
plugin_url : url, // Plugin absolute URL
|
34 |
+
some_custom_arg : 'custom arg' // Custom argument
|
35 |
+
});
|
36 |
+
});
|
37 |
+
|
38 |
+
// Register example button
|
39 |
+
ed.addButton('example', {
|
40 |
+
title : 'example.desc',
|
41 |
+
cmd : 'mceExample',
|
42 |
+
image : url + '/img/example.gif'
|
43 |
+
});
|
44 |
+
|
45 |
+
// Add a node change handler, selects the button in the UI when a image is selected
|
46 |
+
ed.onNodeChange.add(function(ed, cm, n) {
|
47 |
+
cm.setActive('example', n.nodeName == 'IMG');
|
48 |
+
});
|
49 |
+
},
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Creates control instances based in the incomming name. This method is normally not
|
53 |
+
* needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
|
54 |
+
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this
|
55 |
+
* method can be used to create those.
|
56 |
+
*
|
57 |
+
* @param {String} n Name of the control to create.
|
58 |
+
* @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
|
59 |
+
* @return {tinymce.ui.Control} New control instance or null if no control was created.
|
60 |
+
*/
|
61 |
+
createControl : function(n, cm) {
|
62 |
+
return null;
|
63 |
+
},
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Returns information about the plugin as a name/value array.
|
67 |
+
* The current keys are longname, author, authorurl, infourl and version.
|
68 |
+
*
|
69 |
+
* @return {Object} Name/value array containing information about the plugin.
|
70 |
+
*/
|
71 |
+
getInfo : function() {
|
72 |
+
return {
|
73 |
+
longname : 'Example plugin',
|
74 |
+
author : 'Some author',
|
75 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
76 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',
|
77 |
+
version : "1.0"
|
78 |
+
};
|
79 |
+
}
|
80 |
+
});
|
81 |
+
|
82 |
+
// Register plugin
|
83 |
+
tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin);
|
84 |
+
})();
|
js/libraries/tiny_mce/plugins/example/img/example.gif
ADDED
Binary file
|
js/libraries/tiny_mce/plugins/example/js/dialog.js
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
tinyMCEPopup.requireLangPack();
|
2 |
+
|
3 |
+
var ExampleDialog = {
|
4 |
+
init : function() {
|
5 |
+
var f = document.forms[0];
|
6 |
+
|
7 |
+
// Get the selected contents as text and place it in the input
|
8 |
+
f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'});
|
9 |
+
f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg');
|
10 |
+
},
|
11 |
+
|
12 |
+
insert : function() {
|
13 |
+
// Insert the contents from the input into the document
|
14 |
+
tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value);
|
15 |
+
tinyMCEPopup.close();
|
16 |
+
}
|
17 |
+
};
|
18 |
+
|
19 |
+
tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog);
|
js/libraries/tiny_mce/plugins/example/langs/en.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('en.example',{
|
2 |
+
desc : 'This is just a template button'
|
3 |
+
});
|
js/libraries/tiny_mce/plugins/example/langs/en_dlg.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
tinyMCE.addI18n('en.example_dlg',{
|
2 |
+
title : 'This is just a example title'
|
3 |
+
});
|
js/libraries/tiny_mce/plugins/example_dependency/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){tinymce.create("tinymce.plugins.ExampleDependencyPlugin",{init:function(a,b){},getInfo:function(){return{longname:"Example Dependency plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example_dependency",version:"1.0"}}});tinymce.PluginManager.add("example_dependency",tinymce.plugins.ExampleDependencyPlugin,["example"])})();
|
js/libraries/tiny_mce/plugins/example_dependency/editor_plugin_src.js
ADDED
@@ -0,0 +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 |
+
})();
|
js/libraries/tiny_mce/plugins/fullpage/css/fullpage.css
ADDED
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Hide the advanced tab */
|
2 |
+
#advanced_tab {
|
3 |
+
display: none;
|
4 |
+
}
|
5 |
+
|
6 |
+
#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright {
|
7 |
+
width: 280px;
|
8 |
+
}
|
9 |
+
|
10 |
+
#doctype, #docencoding {
|
11 |
+
width: 200px;
|
12 |
+
}
|
13 |
+
|
14 |
+
#langcode {
|
15 |
+
width: 30px;
|
16 |
+
}
|
17 |
+
|
18 |
+
#bgimage {
|
19 |
+
width: 220px;
|
20 |
+
}
|
21 |
+
|
22 |
+
#fontface {
|
23 |
+
width: 240px;
|
24 |
+
}
|
25 |
+
|
26 |
+
#leftmargin, #rightmargin, #topmargin, #bottommargin {
|
27 |
+
width: 50px;
|
28 |
+
}
|
29 |
+
|
30 |
+
.panel_wrapper div.current {
|
31 |
+
height: 400px;
|
32 |
+
}
|
33 |
+
|
34 |
+
#stylesheet, #style {
|
35 |
+
width: 240px;
|
36 |
+
}
|
37 |
+
|
38 |
+
#doctypes {
|
39 |
+
width: 200px;
|
40 |
+
}
|
41 |
+
|
42 |
+
/* Head list classes */
|
43 |
+
|
44 |
+
.headlistwrapper {
|
45 |
+
width: 100%;
|
46 |
+
}
|
47 |
+
|
48 |
+
.selected {
|
49 |
+
border: 1px solid #0A246A;
|
50 |
+
background-color: #B6BDD2;
|
51 |
+
}
|
52 |
+
|
53 |
+
.toolbar {
|
54 |
+
width: 100%;
|
55 |
+
}
|
56 |
+
|
57 |
+
#headlist {
|
58 |
+
width: 100%;
|
59 |
+
margin-top: 3px;
|
60 |
+
font-size: 11px;
|
61 |
+
}
|
62 |
+
|
63 |
+
#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element {
|
64 |
+
display: none;
|
65 |
+
}
|
66 |
+
|
67 |
+
#addmenu {
|
68 |
+
position: absolute;
|
69 |
+
border: 1px solid gray;
|
70 |
+
display: none;
|
71 |
+
z-index: 100;
|
72 |
+
background-color: white;
|
73 |
+
}
|
74 |
+
|
75 |
+
#addmenu a {
|
76 |
+
display: block;
|
77 |
+
width: 100%;
|
78 |
+
line-height: 20px;
|
79 |
+
text-decoration: none;
|
80 |
+
background-color: white;
|
81 |
+
}
|
82 |
+
|
83 |
+
#addmenu a:hover {
|
84 |
+
background-color: #B6BDD2;
|
85 |
+
color: black;
|
86 |
+
}
|
87 |
+
|
88 |
+
#addmenu span {
|
89 |
+
padding-left: 10px;
|
90 |
+
padding-right: 10px;
|
91 |
+
}
|
92 |
+
|
93 |
+
#updateElementPanel {
|
94 |
+
display: none;
|
95 |
+
}
|
96 |
+
|
97 |
+
#script_element .panel_wrapper div.current {
|
98 |
+
height: 108px;
|
99 |
+
}
|
100 |
+
|
101 |
+
#style_element .panel_wrapper div.current {
|
102 |
+
height: 108px;
|
103 |
+
}
|
104 |
+
|
105 |
+
#link_element .panel_wrapper div.current {
|
106 |
+
height: 140px;
|
107 |
+
}
|
108 |
+
|
109 |
+
#element_script_value {
|
110 |
+
width: 100%;
|
111 |
+
height: 100px;
|
112 |
+
}
|
113 |
+
|
114 |
+
#element_comment_value {
|
115 |
+
width: 100%;
|
116 |
+
height: 120px;
|
117 |
+
}
|
118 |
+
|
119 |
+
#element_style_value {
|
120 |
+
width: 100%;
|
121 |
+
height: 100px;
|
122 |
+
}
|
123 |
+
|
124 |
+
#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title {
|
125 |
+
width: 250px;
|
126 |
+
}
|
127 |
+
|
128 |
+
.updateElementButton {
|
129 |
+
margin-top: 3px;
|
130 |
+
}
|
131 |
+
|
132 |
+
/* MSIE specific styles */
|
133 |
+
|
134 |
+
* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton {
|
135 |
+
width: 22px;
|
136 |
+
height: 22px;
|
137 |
+
}
|
138 |
+
|
139 |
+
textarea {
|
140 |
+
height: 55px;
|
141 |
+
}
|
142 |
+
|
143 |
+
.panel_wrapper div.current {height:420px;}
|
js/libraries/tiny_mce/plugins/fullpage/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){var b=tinymce.each,a=tinymce.html.Node;tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(c,d){var e=this;e.editor=c;c.addCommand("mceFullPageProperties",function(){c.windowManager.open({file:d+"/fullpage.htm",width:430+parseInt(c.getLang("fullpage.delta_width",0)),height:495+parseInt(c.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:d,data:e._htmlToData()})});c.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});c.onBeforeSetContent.add(e._setContent,e);c.onGetContent.add(e._getContent,e)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_htmlToData:function(){var f=this._parseHeader(),h={},c,i,g,e=this.editor;function d(l,j){var k=l.attr(j);return k||""}h.fontface=e.getParam("fullpage_default_fontface","");h.fontsize=e.getParam("fullpage_default_fontsize","");i=f.firstChild;if(i.type==7){h.xml_pi=true;g=/encoding="([^"]+)"/.exec(i.value);if(g){h.docencoding=g[1]}}i=f.getAll("#doctype")[0];if(i){h.doctype="<!DOCTYPE"+i.value+">"}i=f.getAll("title")[0];if(i&&i.firstChild){h.metatitle=i.firstChild.value}b(f.getAll("meta"),function(m){var k=m.attr("name"),j=m.attr("http-equiv"),l;if(k){h["meta"+k.toLowerCase()]=m.attr("content")}else{if(j=="Content-Type"){l=/charset\s*=\s*(.*)\s*/gi.exec(m.attr("content"));if(l){h.docencoding=l[1]}}}});i=f.getAll("html")[0];if(i){h.langcode=d(i,"lang")||d(i,"xml:lang")}i=f.getAll("link")[0];if(i&&i.attr("rel")=="stylesheet"){h.stylesheet=i.attr("href")}i=f.getAll("body")[0];if(i){h.langdir=d(i,"dir");h.style=d(i,"style");h.visited_color=d(i,"vlink");h.link_color=d(i,"link");h.active_color=d(i,"alink")}return h},_dataToHtml:function(g){var f,d,h,j,k,e=this.editor.dom;function c(n,l,m){n.attr(l,m?m:undefined)}function i(l){if(d.firstChild){d.insert(l,d.firstChild)}else{d.append(l)}}f=this._parseHeader();d=f.getAll("head")[0];if(!d){j=f.getAll("html")[0];d=new a("head",1);if(j.firstChild){j.insert(d,j.firstChild,true)}else{j.append(d)}}j=f.firstChild;if(g.xml_pi){k='version="1.0"';if(g.docencoding){k+=' encoding="'+g.docencoding+'"'}if(j.type!=7){j=new a("xml",7);f.insert(j,f.firstChild,true)}j.value=k}else{if(j&&j.type==7){j.remove()}}j=f.getAll("#doctype")[0];if(g.doctype){if(!j){j=new a("#doctype",10);if(g.xml_pi){f.insert(j,f.firstChild)}else{i(j)}}j.value=g.doctype.substring(9,g.doctype.length-1)}else{if(j){j.remove()}}j=f.getAll("title")[0];if(g.metatitle){if(!j){j=new a("title",1);j.append(new a("#text",3)).value=g.metatitle;i(j)}}if(g.docencoding){j=null;b(f.getAll("meta"),function(l){if(l.attr("http-equiv")=="Content-Type"){j=l}});if(!j){j=new a("meta",1);j.attr("http-equiv","Content-Type");j.shortEnded=true;i(j)}j.attr("content","text/html; charset="+g.docencoding)}b("keywords,description,author,copyright,robots".split(","),function(m){var l=f.getAll("meta"),n,p,o=g["meta"+m];for(n=0;n<l.length;n++){p=l[n];if(p.attr("name")==m){if(o){p.attr("content",o)}else{p.remove()}return}}if(o){j=new a("meta",1);j.attr("name",m);j.attr("content",o);j.shortEnded=true;i(j)}});j=f.getAll("link")[0];if(j&&j.attr("rel")=="stylesheet"){if(g.stylesheet){j.attr("href",g.stylesheet)}else{j.remove()}}else{if(g.stylesheet){j=new a("link",1);j.attr({rel:"stylesheet",text:"text/css",href:g.stylesheet});j.shortEnded=true;i(j)}}j=f.getAll("body")[0];if(j){c(j,"dir",g.langdir);c(j,"style",g.style);c(j,"vlink",g.visited_color);c(j,"link",g.link_color);c(j,"alink",g.active_color);e.setAttribs(this.editor.getBody(),{style:g.style,dir:g.dir,vLink:g.visited_color,link:g.link_color,aLink:g.active_color})}j=f.getAll("html")[0];if(j){c(j,"lang",g.langcode);c(j,"xml:lang",g.langcode)}h=new tinymce.html.Serializer({validate:false,indent:true,apply_source_formatting:true,indent_before:"head,html,body,meta,title,script,link,style",indent_after:"head,html,body,meta,title,script,link,style"}).serialize(f);this.head=h.substring(0,h.indexOf("</body>"))},_parseHeader:function(){return new tinymce.html.DomParser({validate:false,root_name:"#document"}).parse(this.head)},_setContent:function(g,d){var m=this,i,c,h=d.content,f,l="",e=m.editor.dom,j;function k(n){return n.replace(/<\/?[A-Z]+/g,function(o){return o.toLowerCase()})}if(d.format=="raw"&&m.head){return}if(d.source_view&&g.getParam("fullpage_hide_in_source_view")){return}h=h.replace(/<(\/?)BODY/gi,"<$1body");i=h.indexOf("<body");if(i!=-1){i=h.indexOf(">",i);m.head=k(h.substring(0,i+1));c=h.indexOf("</body",i);if(c==-1){c=h.length}d.content=h.substring(i+1,c);m.foot=k(h.substring(c))}else{m.head=this._getDefaultHeader();m.foot="\n</body>\n</html>"}f=m._parseHeader();b(f.getAll("style"),function(n){if(n.firstChild){l+=n.firstChild.value}});j=f.getAll("body")[0];if(j){e.setAttribs(m.editor.getBody(),{style:j.attr("style")||"",dir:j.attr("dir")||"",vLink:j.attr("vlink")||"",link:j.attr("link")||"",aLink:j.attr("alink")||""})}e.remove("fullpage_styles");if(l){e.add(m.editor.getDoc().getElementsByTagName("head")[0],"style",{id:"fullpage_styles"},l);j=e.get("fullpage_styles");if(j.styleSheet){j.styleSheet.cssText=l}}},_getDefaultHeader:function(){var f="",c=this.editor,e,d="";if(c.getParam("fullpage_default_xml_pi")){f+='<?xml version="1.0" encoding="'+c.getParam("fullpage_default_encoding","ISO-8859-1")+'" ?>\n'}f+=c.getParam("fullpage_default_doctype",'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');f+="\n<html>\n<head>\n";if(e=c.getParam("fullpage_default_title")){f+="<title>"+e+"</title>\n"}if(e=c.getParam("fullpage_default_encoding")){f+='<meta http-equiv="Content-Type" content="text/html; charset='+e+'" />\n'}if(e=c.getParam("fullpage_default_font_family")){d+="font-family: "+e+";"}if(e=c.getParam("fullpage_default_font_size")){d+="font-size: "+e+";"}if(e=c.getParam("fullpage_default_text_color")){d+="color: "+e+";"}f+="</head>\n<body"+(d?' style="'+d+'"':"")+">\n";return f},_getContent:function(d,e){var c=this;if(!e.source_view||!d.getParam("fullpage_hide_in_source_view")){e.content=tinymce.trim(c.head)+"\n"+tinymce.trim(e.content)+"\n"+tinymce.trim(c.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})();
|
js/libraries/tiny_mce/plugins/fullpage/editor_plugin_src.js
ADDED
@@ -0,0 +1,405 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 each = tinymce.each, Node = tinymce.html.Node;
|
13 |
+
|
14 |
+
tinymce.create('tinymce.plugins.FullPagePlugin', {
|
15 |
+
init : function(ed, url) {
|
16 |
+
var t = this;
|
17 |
+
|
18 |
+
t.editor = ed;
|
19 |
+
|
20 |
+
// Register commands
|
21 |
+
ed.addCommand('mceFullPageProperties', function() {
|
22 |
+
ed.windowManager.open({
|
23 |
+
file : url + '/fullpage.htm',
|
24 |
+
width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)),
|
25 |
+
height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)),
|
26 |
+
inline : 1
|
27 |
+
}, {
|
28 |
+
plugin_url : url,
|
29 |
+
data : t._htmlToData()
|
30 |
+
});
|
31 |
+
});
|
32 |
+
|
33 |
+
// Register buttons
|
34 |
+
ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'});
|
35 |
+
|
36 |
+
ed.onBeforeSetContent.add(t._setContent, t);
|
37 |
+
ed.onGetContent.add(t._getContent, t);
|
38 |
+
},
|
39 |
+
|
40 |
+
getInfo : function() {
|
41 |
+
return {
|
42 |
+
longname : 'Fullpage',
|
43 |
+
author : 'Moxiecode Systems AB',
|
44 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
45 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage',
|
46 |
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
47 |
+
};
|
48 |
+
},
|
49 |
+
|
50 |
+
// Private plugin internal methods
|
51 |
+
|
52 |
+
_htmlToData : function() {
|
53 |
+
var headerFragment = this._parseHeader(), data = {}, nodes, elm, matches, editor = this.editor;
|
54 |
+
|
55 |
+
function getAttr(elm, name) {
|
56 |
+
var value = elm.attr(name);
|
57 |
+
|
58 |
+
return value || '';
|
59 |
+
};
|
60 |
+
|
61 |
+
// Default some values
|
62 |
+
data.fontface = editor.getParam("fullpage_default_fontface", "");
|
63 |
+
data.fontsize = editor.getParam("fullpage_default_fontsize", "");
|
64 |
+
|
65 |
+
// Parse XML PI
|
66 |
+
elm = headerFragment.firstChild;
|
67 |
+
if (elm.type == 7) {
|
68 |
+
data.xml_pi = true;
|
69 |
+
matches = /encoding="([^"]+)"/.exec(elm.value);
|
70 |
+
if (matches)
|
71 |
+
data.docencoding = matches[1];
|
72 |
+
}
|
73 |
+
|
74 |
+
// Parse doctype
|
75 |
+
elm = headerFragment.getAll('#doctype')[0];
|
76 |
+
if (elm)
|
77 |
+
data.doctype = '<!DOCTYPE' + elm.value + ">";
|
78 |
+
|
79 |
+
// Parse title element
|
80 |
+
elm = headerFragment.getAll('title')[0];
|
81 |
+
if (elm && elm.firstChild) {
|
82 |
+
data.metatitle = elm.firstChild.value;
|
83 |
+
}
|
84 |
+
|
85 |
+
// Parse meta elements
|
86 |
+
each(headerFragment.getAll('meta'), function(meta) {
|
87 |
+
var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches;
|
88 |
+
|
89 |
+
if (name)
|
90 |
+
data['meta' + name.toLowerCase()] = meta.attr('content');
|
91 |
+
else if (httpEquiv == "Content-Type") {
|
92 |
+
matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content'));
|
93 |
+
|
94 |
+
if (matches)
|
95 |
+
data.docencoding = matches[1];
|
96 |
+
}
|
97 |
+
});
|
98 |
+
|
99 |
+
// Parse html attribs
|
100 |
+
elm = headerFragment.getAll('html')[0];
|
101 |
+
if (elm)
|
102 |
+
data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang');
|
103 |
+
|
104 |
+
// Parse stylesheet
|
105 |
+
elm = headerFragment.getAll('link')[0];
|
106 |
+
if (elm && elm.attr('rel') == 'stylesheet')
|
107 |
+
data.stylesheet = elm.attr('href');
|
108 |
+
|
109 |
+
// Parse body parts
|
110 |
+
elm = headerFragment.getAll('body')[0];
|
111 |
+
if (elm) {
|
112 |
+
data.langdir = getAttr(elm, 'dir');
|
113 |
+
data.style = getAttr(elm, 'style');
|
114 |
+
data.visited_color = getAttr(elm, 'vlink');
|
115 |
+
data.link_color = getAttr(elm, 'link');
|
116 |
+
data.active_color = getAttr(elm, 'alink');
|
117 |
+
}
|
118 |
+
|
119 |
+
return data;
|
120 |
+
},
|
121 |
+
|
122 |
+
_dataToHtml : function(data) {
|
123 |
+
var headerFragment, headElement, html, elm, value, dom = this.editor.dom;
|
124 |
+
|
125 |
+
function setAttr(elm, name, value) {
|
126 |
+
elm.attr(name, value ? value : undefined);
|
127 |
+
};
|
128 |
+
|
129 |
+
function addHeadNode(node) {
|
130 |
+
if (headElement.firstChild)
|
131 |
+
headElement.insert(node, headElement.firstChild);
|
132 |
+
else
|
133 |
+
headElement.append(node);
|
134 |
+
};
|
135 |
+
|
136 |
+
headerFragment = this._parseHeader();
|
137 |
+
headElement = headerFragment.getAll('head')[0];
|
138 |
+
if (!headElement) {
|
139 |
+
elm = headerFragment.getAll('html')[0];
|
140 |
+
headElement = new Node('head', 1);
|
141 |
+
|
142 |
+
if (elm.firstChild)
|
143 |
+
elm.insert(headElement, elm.firstChild, true);
|
144 |
+
else
|
145 |
+
elm.append(headElement);
|
146 |
+
}
|
147 |
+
|
148 |
+
// Add/update/remove XML-PI
|
149 |
+
elm = headerFragment.firstChild;
|
150 |
+
if (data.xml_pi) {
|
151 |
+
value = 'version="1.0"';
|
152 |
+
|
153 |
+
if (data.docencoding)
|
154 |
+
value += ' encoding="' + data.docencoding + '"';
|
155 |
+
|
156 |
+
if (elm.type != 7) {
|
157 |
+
elm = new Node('xml', 7);
|
158 |
+
headerFragment.insert(elm, headerFragment.firstChild, true);
|
159 |
+
}
|
160 |
+
|
161 |
+
elm.value = value;
|
162 |
+
} else if (elm && elm.type == 7)
|
163 |
+
elm.remove();
|
164 |
+
|
165 |
+
// Add/update/remove doctype
|
166 |
+
elm = headerFragment.getAll('#doctype')[0];
|
167 |
+
if (data.doctype) {
|
168 |
+
if (!elm) {
|
169 |
+
elm = new Node('#doctype', 10);
|
170 |
+
|
171 |
+
if (data.xml_pi)
|
172 |
+
headerFragment.insert(elm, headerFragment.firstChild);
|
173 |
+
else
|
174 |
+
addHeadNode(elm);
|
175 |
+
}
|
176 |
+
|
177 |
+
elm.value = data.doctype.substring(9, data.doctype.length - 1);
|
178 |
+
} else if (elm)
|
179 |
+
elm.remove();
|
180 |
+
|
181 |
+
// Add/update/remove title
|
182 |
+
elm = headerFragment.getAll('title')[0];
|
183 |
+
if (data.metatitle) {
|
184 |
+
if (!elm) {
|
185 |
+
elm = new Node('title', 1);
|
186 |
+
elm.append(new Node('#text', 3)).value = data.metatitle;
|
187 |
+
addHeadNode(elm);
|
188 |
+
}
|
189 |
+
}
|
190 |
+
|
191 |
+
// Add meta encoding
|
192 |
+
if (data.docencoding) {
|
193 |
+
elm = null;
|
194 |
+
each(headerFragment.getAll('meta'), function(meta) {
|
195 |
+
if (meta.attr('http-equiv') == 'Content-Type')
|
196 |
+
elm = meta;
|
197 |
+
});
|
198 |
+
|
199 |
+
if (!elm) {
|
200 |
+
elm = new Node('meta', 1);
|
201 |
+
elm.attr('http-equiv', 'Content-Type');
|
202 |
+
elm.shortEnded = true;
|
203 |
+
addHeadNode(elm);
|
204 |
+
}
|
205 |
+
|
206 |
+
elm.attr('content', 'text/html; charset=' + data.docencoding);
|
207 |
+
}
|
208 |
+
|
209 |
+
// Add/update/remove meta
|
210 |
+
each('keywords,description,author,copyright,robots'.split(','), function(name) {
|
211 |
+
var nodes = headerFragment.getAll('meta'), i, meta, value = data['meta' + name];
|
212 |
+
|
213 |
+
for (i = 0; i < nodes.length; i++) {
|
214 |
+
meta = nodes[i];
|
215 |
+
|
216 |
+
if (meta.attr('name') == name) {
|
217 |
+
if (value)
|
218 |
+
meta.attr('content', value);
|
219 |
+
else
|
220 |
+
meta.remove();
|
221 |
+
|
222 |
+
return;
|
223 |
+
}
|
224 |
+
}
|
225 |
+
|
226 |
+
if (value) {
|
227 |
+
elm = new Node('meta', 1);
|
228 |
+
elm.attr('name', name);
|
229 |
+
elm.attr('content', value);
|
230 |
+
elm.shortEnded = true;
|
231 |
+
|
232 |
+
addHeadNode(elm);
|
233 |
+
}
|
234 |
+
});
|
235 |
+
|
236 |
+
// Add/update/delete link
|
237 |
+
elm = headerFragment.getAll('link')[0];
|
238 |
+
if (elm && elm.attr('rel') == 'stylesheet') {
|
239 |
+
if (data.stylesheet)
|
240 |
+
elm.attr('href', data.stylesheet);
|
241 |
+
else
|
242 |
+
elm.remove();
|
243 |
+
} else if (data.stylesheet) {
|
244 |
+
elm = new Node('link', 1);
|
245 |
+
elm.attr({
|
246 |
+
rel : 'stylesheet',
|
247 |
+
text : 'text/css',
|
248 |
+
href : data.stylesheet
|
249 |
+
});
|
250 |
+
elm.shortEnded = true;
|
251 |
+
|
252 |
+
addHeadNode(elm);
|
253 |
+
}
|
254 |
+
|
255 |
+
// Update body attributes
|
256 |
+
elm = headerFragment.getAll('body')[0];
|
257 |
+
if (elm) {
|
258 |
+
setAttr(elm, 'dir', data.langdir);
|
259 |
+
setAttr(elm, 'style', data.style);
|
260 |
+
setAttr(elm, 'vlink', data.visited_color);
|
261 |
+
setAttr(elm, 'link', data.link_color);
|
262 |
+
setAttr(elm, 'alink', data.active_color);
|
263 |
+
|
264 |
+
// Update iframe body as well
|
265 |
+
dom.setAttribs(this.editor.getBody(), {
|
266 |
+
style : data.style,
|
267 |
+
dir : data.dir,
|
268 |
+
vLink : data.visited_color,
|
269 |
+
link : data.link_color,
|
270 |
+
aLink : data.active_color
|
271 |
+
});
|
272 |
+
}
|
273 |
+
|
274 |
+
// Set html attributes
|
275 |
+
elm = headerFragment.getAll('html')[0];
|
276 |
+
if (elm) {
|
277 |
+
setAttr(elm, 'lang', data.langcode);
|
278 |
+
setAttr(elm, 'xml:lang', data.langcode);
|
279 |
+
}
|
280 |
+
|
281 |
+
// Serialize header fragment and crop away body part
|
282 |
+
html = new tinymce.html.Serializer({
|
283 |
+
validate: false,
|
284 |
+
indent: true,
|
285 |
+
apply_source_formatting : true,
|
286 |
+
indent_before: 'head,html,body,meta,title,script,link,style',
|
287 |
+
indent_after: 'head,html,body,meta,title,script,link,style'
|
288 |
+
}).serialize(headerFragment);
|
289 |
+
|
290 |
+
this.head = html.substring(0, html.indexOf('</body>'));
|
291 |
+
},
|
292 |
+
|
293 |
+
_parseHeader : function() {
|
294 |
+
// Parse the contents with a DOM parser
|
295 |
+
return new tinymce.html.DomParser({
|
296 |
+
validate: false,
|
297 |
+
root_name: '#document'
|
298 |
+
}).parse(this.head);
|
299 |
+
},
|
300 |
+
|
301 |
+
_setContent : function(ed, o) {
|
302 |
+
var self = this, startPos, endPos, content = o.content, headerFragment, styles = '', dom = self.editor.dom, elm;
|
303 |
+
|
304 |
+
function low(s) {
|
305 |
+
return s.replace(/<\/?[A-Z]+/g, function(a) {
|
306 |
+
return a.toLowerCase();
|
307 |
+
})
|
308 |
+
};
|
309 |
+
|
310 |
+
// Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate
|
311 |
+
if (o.format == 'raw' && self.head)
|
312 |
+
return;
|
313 |
+
|
314 |
+
if (o.source_view && ed.getParam('fullpage_hide_in_source_view'))
|
315 |
+
return;
|
316 |
+
|
317 |
+
// Parse out head, body and footer
|
318 |
+
content = content.replace(/<(\/?)BODY/gi, '<$1body');
|
319 |
+
startPos = content.indexOf('<body');
|
320 |
+
|
321 |
+
if (startPos != -1) {
|
322 |
+
startPos = content.indexOf('>', startPos);
|
323 |
+
self.head = low(content.substring(0, startPos + 1));
|
324 |
+
|
325 |
+
endPos = content.indexOf('</body', startPos);
|
326 |
+
if (endPos == -1)
|
327 |
+
endPos = content.length;
|
328 |
+
|
329 |
+
o.content = content.substring(startPos + 1, endPos);
|
330 |
+
self.foot = low(content.substring(endPos));
|
331 |
+
} else {
|
332 |
+
self.head = this._getDefaultHeader();
|
333 |
+
self.foot = '\n</body>\n</html>';
|
334 |
+
}
|
335 |
+
|
336 |
+
// Parse header and update iframe
|
337 |
+
headerFragment = self._parseHeader();
|
338 |
+
each(headerFragment.getAll('style'), function(node) {
|
339 |
+
if (node.firstChild)
|
340 |
+
styles += node.firstChild.value;
|
341 |
+
});
|
342 |
+
|
343 |
+
elm = headerFragment.getAll('body')[0];
|
344 |
+
if (elm) {
|
345 |
+
dom.setAttribs(self.editor.getBody(), {
|
346 |
+
style : elm.attr('style') || '',
|
347 |
+
dir : elm.attr('dir') || '',
|
348 |
+
vLink : elm.attr('vlink') || '',
|
349 |
+
link : elm.attr('link') || '',
|
350 |
+
aLink : elm.attr('alink') || ''
|
351 |
+
});
|
352 |
+
}
|
353 |
+
|
354 |
+
dom.remove('fullpage_styles');
|
355 |
+
|
356 |
+
if (styles) {
|
357 |
+
dom.add(self.editor.getDoc().getElementsByTagName('head')[0], 'style', {id : 'fullpage_styles'}, styles);
|
358 |
+
|
359 |
+
// Needed for IE 6/7
|
360 |
+
elm = dom.get('fullpage_styles');
|
361 |
+
if (elm.styleSheet)
|
362 |
+
elm.styleSheet.cssText = styles;
|
363 |
+
}
|
364 |
+
},
|
365 |
+
|
366 |
+
_getDefaultHeader : function() {
|
367 |
+
var header = '', editor = this.editor, value, styles = '';
|
368 |
+
|
369 |
+
if (editor.getParam('fullpage_default_xml_pi'))
|
370 |
+
header += '<?xml version="1.0" encoding="' + editor.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n';
|
371 |
+
|
372 |
+
header += editor.getParam('fullpage_default_doctype', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
|
373 |
+
header += '\n<html>\n<head>\n';
|
374 |
+
|
375 |
+
if (value = editor.getParam('fullpage_default_title'))
|
376 |
+
header += '<title>' + value + '</title>\n';
|
377 |
+
|
378 |
+
if (value = editor.getParam('fullpage_default_encoding'))
|
379 |
+
header += '<meta http-equiv="Content-Type" content="text/html; charset=' + value + '" />\n';
|
380 |
+
|
381 |
+
if (value = editor.getParam('fullpage_default_font_family'))
|
382 |
+
styles += 'font-family: ' + value + ';';
|
383 |
+
|
384 |
+
if (value = editor.getParam('fullpage_default_font_size'))
|
385 |
+
styles += 'font-size: ' + value + ';';
|
386 |
+
|
387 |
+
if (value = editor.getParam('fullpage_default_text_color'))
|
388 |
+
styles += 'color: ' + value + ';';
|
389 |
+
|
390 |
+
header += '</head>\n<body' + (styles ? ' style="' + styles + '"' : '') + '>\n';
|
391 |
+
|
392 |
+
return header;
|
393 |
+
},
|
394 |
+
|
395 |
+
_getContent : function(ed, o) {
|
396 |
+
var self = this;
|
397 |
+
|
398 |
+
if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view'))
|
399 |
+
o.content = tinymce.trim(self.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(self.foot);
|
400 |
+
}
|
401 |
+
});
|
402 |
+
|
403 |
+
// Register plugin
|
404 |
+
tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin);
|
405 |
+
})();
|
js/libraries/tiny_mce/plugins/fullpage/fullpage.htm
ADDED
@@ -0,0 +1,259 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>{#fullpage_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/form_utils.js"></script>
|
8 |
+
<script type="text/javascript" src="js/fullpage.js"></script>
|
9 |
+
<link href="css/fullpage.css" rel="stylesheet" type="text/css" />
|
10 |
+
</head>
|
11 |
+
<body id="fullpage" style="display: none">
|
12 |
+
<form onsubmit="FullPageDialog.update();return false;" name="fullpage" action="#">
|
13 |
+
<div class="tabs">
|
14 |
+
<ul>
|
15 |
+
<li id="meta_tab" class="current"><span><a href="javascript:mcTabs.displayTab('meta_tab','meta_panel');" onmousedown="return false;">{#fullpage_dlg.meta_tab}</a></span></li>
|
16 |
+
<li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#fullpage_dlg.appearance_tab}</a></span></li>
|
17 |
+
</ul>
|
18 |
+
</div>
|
19 |
+
|
20 |
+
<div class="panel_wrapper">
|
21 |
+
<div id="meta_panel" class="panel current">
|
22 |
+
<fieldset>
|
23 |
+
<legend>{#fullpage_dlg.meta_props}</legend>
|
24 |
+
|
25 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
26 |
+
<tr>
|
27 |
+
<td class="nowrap"><label for="metatitle">{#fullpage_dlg.meta_title}</label> </td>
|
28 |
+
<td><input type="text" id="metatitle" name="metatitle" value="" class="mceFocus" /></td>
|
29 |
+
</tr>
|
30 |
+
<tr>
|
31 |
+
<td class="nowrap"><label for="metakeywords">{#fullpage_dlg.meta_keywords}</label> </td>
|
32 |
+
<td><textarea id="metakeywords" name="metakeywords" rows="4"></textarea></td>
|
33 |
+
</tr>
|
34 |
+
<tr>
|
35 |
+
<td class="nowrap"><label for="metadescription">{#fullpage_dlg.meta_description}</label> </td>
|
36 |
+
<td><textarea id="metadescription" name="metadescription" rows="4"></textarea></td>
|
37 |
+
</tr>
|
38 |
+
<tr>
|
39 |
+
<td class="nowrap"><label for="metaauthor">{#fullpage_dlg.author}</label> </td>
|
40 |
+
<td><input type="text" id="metaauthor" name="metaauthor" value="" /></td>
|
41 |
+
</tr>
|
42 |
+
<tr>
|
43 |
+
<td class="nowrap"><label for="metacopyright">{#fullpage_dlg.copyright}</label> </td>
|
44 |
+
<td><input type="text" id="metacopyright" name="metacopyright" value="" /></td>
|
45 |
+
</tr>
|
46 |
+
<tr>
|
47 |
+
<td class="nowrap"><label for="metarobots">{#fullpage_dlg.meta_robots}</label> </td>
|
48 |
+
<td>
|
49 |
+
<select id="metarobots" name="metarobots">
|
50 |
+
<option value="">{#not_set}</option>
|
51 |
+
<option value="index,follow">{#fullpage_dlg.meta_index_follow}</option>
|
52 |
+
<option value="index,nofollow">{#fullpage_dlg.meta_index_nofollow}</option>
|
53 |
+
<option value="noindex,follow">{#fullpage_dlg.meta_noindex_follow}</option>
|
54 |
+
<option value="noindex,nofollow">{#fullpage_dlg.meta_noindex_nofollow}</option>
|
55 |
+
</select>
|
56 |
+
</td>
|
57 |
+
</tr>
|
58 |
+
</table>
|
59 |
+
</fieldset>
|
60 |
+
|
61 |
+
<fieldset>
|
62 |
+
<legend>{#fullpage_dlg.langprops}</legend>
|
63 |
+
|
64 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
65 |
+
<tr>
|
66 |
+
<td class="column1"><label for="docencoding">{#fullpage_dlg.encoding}</label></td>
|
67 |
+
<td>
|
68 |
+
<select id="docencoding" name="docencoding">
|
69 |
+
<option value="">{#not_set}</option>
|
70 |
+
</select>
|
71 |
+
</td>
|
72 |
+
</tr>
|
73 |
+
<tr>
|
74 |
+
<td class="nowrap"><label for="doctype">{#fullpage_dlg.doctypes}</label> </td>
|
75 |
+
<td>
|
76 |
+
<select id="doctype" name="doctype">
|
77 |
+
<option value="">{#not_set}</option>
|
78 |
+
</select>
|
79 |
+
</td>
|
80 |
+
</tr>
|
81 |
+
<tr>
|
82 |
+
<td class="nowrap"><label for="langcode">{#fullpage_dlg.langcode}</label> </td>
|
83 |
+
<td><input type="text" id="langcode" name="langcode" value="" /></td>
|
84 |
+
</tr>
|
85 |
+
<tr>
|
86 |
+
<td class="column1"><label for="langdir">{#fullpage_dlg.langdir}</label></td>
|
87 |
+
<td>
|
88 |
+
<select id="langdir" name="langdir">
|
89 |
+
<option value="">{#not_set}</option>
|
90 |
+
<option value="ltr">{#fullpage_dlg.ltr}</option>
|
91 |
+
<option value="rtl">{#fullpage_dlg.rtl}</option>
|
92 |
+
</select>
|
93 |
+
</td>
|
94 |
+
</tr>
|
95 |
+
<tr>
|
96 |
+
<td class="nowrap"><label for="xml_pi">{#fullpage_dlg.xml_pi}</label> </td>
|
97 |
+
<td><input type="checkbox" id="xml_pi" name="xml_pi" class="checkbox" /></td>
|
98 |
+
</tr>
|
99 |
+
</table>
|
100 |
+
</fieldset>
|
101 |
+
</div>
|
102 |
+
|
103 |
+
<div id="appearance_panel" class="panel">
|
104 |
+
<fieldset>
|
105 |
+
<legend>{#fullpage_dlg.appearance_textprops}</legend>
|
106 |
+
|
107 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
108 |
+
<tr>
|
109 |
+
<td class="column1"><label for="fontface">{#fullpage_dlg.fontface}</label></td>
|
110 |
+
<td>
|
111 |
+
<select id="fontface" name="fontface" onchange="FullPageDialog.changedStyleProp();">
|
112 |
+
<option value="">{#not_set}</option>
|
113 |
+
</select>
|
114 |
+
</td>
|
115 |
+
</tr>
|
116 |
+
|
117 |
+
<tr>
|
118 |
+
<td class="column1"><label for="fontsize">{#fullpage_dlg.fontsize}</label></td>
|
119 |
+
<td>
|
120 |
+
<select id="fontsize" name="fontsize" onchange="FullPageDialog.changedStyleProp();">
|
121 |
+
<option value="">{#not_set}</option>
|
122 |
+
</select>
|
123 |
+
</td>
|
124 |
+
</tr>
|
125 |
+
|
126 |
+
<tr>
|
127 |
+
<td class="column1"><label for="textcolor">{#fullpage_dlg.textcolor}</label></td>
|
128 |
+
<td>
|
129 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
130 |
+
<tr>
|
131 |
+
<td><input id="textcolor" name="textcolor" type="text" value="" size="9" onchange="updateColor('textcolor_pick','textcolor');FullPageDialog.changedStyleProp();" /></td>
|
132 |
+
<td id="textcolor_pickcontainer"> </td>
|
133 |
+
</tr>
|
134 |
+
</table>
|
135 |
+
</td>
|
136 |
+
</tr>
|
137 |
+
</table>
|
138 |
+
</fieldset>
|
139 |
+
|
140 |
+
<fieldset>
|
141 |
+
<legend>{#fullpage_dlg.appearance_bgprops}</legend>
|
142 |
+
|
143 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
144 |
+
<tr>
|
145 |
+
<td class="column1"><label for="bgimage">{#fullpage_dlg.bgimage}</label></td>
|
146 |
+
<td>
|
147 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
148 |
+
<tr>
|
149 |
+
<td><input id="bgimage" name="bgimage" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
|
150 |
+
<td id="bgimage_pickcontainer"> </td>
|
151 |
+
</tr>
|
152 |
+
</table>
|
153 |
+
</td>
|
154 |
+
</tr>
|
155 |
+
<tr>
|
156 |
+
<td class="column1"><label for="bgcolor">{#fullpage_dlg.bgcolor}</label></td>
|
157 |
+
<td>
|
158 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
159 |
+
<tr>
|
160 |
+
<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');FullPageDialog.changedStyleProp();" /></td>
|
161 |
+
<td id="bgcolor_pickcontainer"> </td>
|
162 |
+
</tr>
|
163 |
+
</table>
|
164 |
+
</td>
|
165 |
+
</tr>
|
166 |
+
</table>
|
167 |
+
</fieldset>
|
168 |
+
|
169 |
+
<fieldset>
|
170 |
+
<legend>{#fullpage_dlg.appearance_marginprops}</legend>
|
171 |
+
|
172 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
173 |
+
<tr>
|
174 |
+
<td class="column1"><label for="leftmargin">{#fullpage_dlg.left_margin}</label></td>
|
175 |
+
<td><input id="leftmargin" name="leftmargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
|
176 |
+
<td class="column1"><label for="rightmargin">{#fullpage_dlg.right_margin}</label></td>
|
177 |
+
<td><input id="rightmargin" name="rightmargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
|
178 |
+
</tr>
|
179 |
+
<tr>
|
180 |
+
<td class="column1"><label for="topmargin">{#fullpage_dlg.top_margin}</label></td>
|
181 |
+
<td><input id="topmargin" name="topmargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
|
182 |
+
<td class="column1"><label for="bottommargin">{#fullpage_dlg.bottom_margin}</label></td>
|
183 |
+
<td><input id="bottommargin" name="bottommargin" type="text" value="" onchange="FullPageDialog.changedStyleProp();" /></td>
|
184 |
+
</tr>
|
185 |
+
</table>
|
186 |
+
</fieldset>
|
187 |
+
|
188 |
+
<fieldset>
|
189 |
+
<legend>{#fullpage_dlg.appearance_linkprops}</legend>
|
190 |
+
|
191 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
192 |
+
<tr>
|
193 |
+
<td class="column1"><label for="link_color">{#fullpage_dlg.link_color}</label></td>
|
194 |
+
<td>
|
195 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
196 |
+
<tr>
|
197 |
+
<td><input id="link_color" name="link_color" type="text" value="" size="9" onchange="updateColor('link_color_pick','link_color');FullPageDialog.changedStyleProp();" /></td>
|
198 |
+
<td id="link_color_pickcontainer"> </td>
|
199 |
+
</tr>
|
200 |
+
</table>
|
201 |
+
</td>
|
202 |
+
|
203 |
+
<td class="column1"><label for="visited_color">{#fullpage_dlg.visited_color}</label></td>
|
204 |
+
<td>
|
205 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
206 |
+
<tr>
|
207 |
+
<td><input id="visited_color" name="visited_color" type="text" value="" size="9" onchange="updateColor('visited_color_pick','visited_color');FullPageDialog.changedStyleProp();" /></td>
|
208 |
+
<td id="visited_color_pickcontainer"> </td>
|
209 |
+
</tr>
|
210 |
+
</table>
|
211 |
+
</td>
|
212 |
+
</tr>
|
213 |
+
|
214 |
+
<tr>
|
215 |
+
<td class="column1"><label for="active_color">{#fullpage_dlg.active_color}</label></td>
|
216 |
+
<td>
|
217 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
218 |
+
<tr>
|
219 |
+
<td><input id="active_color" name="active_color" type="text" value="" size="9" onchange="updateColor('active_color_pick','active_color');FullPageDialog.changedStyleProp();" /></td>
|
220 |
+
<td id="active_color_pickcontainer"> </td>
|
221 |
+
</tr>
|
222 |
+
</table>
|
223 |
+
</td>
|
224 |
+
|
225 |
+
<td> </td>
|
226 |
+
<td> </td>
|
227 |
+
</tr>
|
228 |
+
</table>
|
229 |
+
</fieldset>
|
230 |
+
|
231 |
+
<fieldset>
|
232 |
+
<legend>{#fullpage_dlg.appearance_style}</legend>
|
233 |
+
|
234 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
235 |
+
<tr>
|
236 |
+
<td class="column1"><label for="stylesheet">{#fullpage_dlg.stylesheet}</label></td>
|
237 |
+
<td><table border="0" cellpadding="0" cellspacing="0">
|
238 |
+
<tr>
|
239 |
+
<td><input id="stylesheet" name="stylesheet" type="text" value="" /></td>
|
240 |
+
<td id="stylesheet_browsercontainer"> </td>
|
241 |
+
</tr>
|
242 |
+
</table></td>
|
243 |
+
</tr>
|
244 |
+
<tr>
|
245 |
+
<td class="column1"><label for="style">{#fullpage_dlg.style}</label></td>
|
246 |
+
<td><input id="style" name="style" type="text" value="" onchange="FullPageDialog.changedStyle();" /></td>
|
247 |
+
</tr>
|
248 |
+
</table>
|
249 |
+
</fieldset>
|
250 |
+
</div>
|
251 |
+
</div>
|
252 |
+
|
253 |
+
<div class="mceActionPanel">
|
254 |
+
<input type="submit" id="insert" name="update" value="{#update}" />
|
255 |
+
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
256 |
+
</div>
|
257 |
+
</form>
|
258 |
+
</body>
|
259 |
+
</html>
|
js/libraries/tiny_mce/plugins/fullpage/js/fullpage.js
ADDED
@@ -0,0 +1,232 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* fullpage.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 |
+
tinyMCEPopup.requireLangPack();
|
13 |
+
|
14 |
+
var defaultDocTypes =
|
15 |
+
'XHTML 1.0 Transitional=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">,' +
|
16 |
+
'XHTML 1.0 Frameset=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">,' +
|
17 |
+
'XHTML 1.0 Strict=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">,' +
|
18 |
+
'XHTML 1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">,' +
|
19 |
+
'HTML 4.01 Transitional=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">,' +
|
20 |
+
'HTML 4.01 Strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">,' +
|
21 |
+
'HTML 4.01 Frameset=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
|
22 |
+
|
23 |
+
var defaultEncodings =
|
24 |
+
'Western european (iso-8859-1)=iso-8859-1,' +
|
25 |
+
'Central European (iso-8859-2)=iso-8859-2,' +
|
26 |
+
'Unicode (UTF-8)=utf-8,' +
|
27 |
+
'Chinese traditional (Big5)=big5,' +
|
28 |
+
'Cyrillic (iso-8859-5)=iso-8859-5,' +
|
29 |
+
'Japanese (iso-2022-jp)=iso-2022-jp,' +
|
30 |
+
'Greek (iso-8859-7)=iso-8859-7,' +
|
31 |
+
'Korean (iso-2022-kr)=iso-2022-kr,' +
|
32 |
+
'ASCII (us-ascii)=us-ascii';
|
33 |
+
|
34 |
+
var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';
|
35 |
+
var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px';
|
36 |
+
|
37 |
+
function setVal(id, value) {
|
38 |
+
var elm = document.getElementById(id);
|
39 |
+
|
40 |
+
if (elm) {
|
41 |
+
value = value || '';
|
42 |
+
|
43 |
+
if (elm.nodeName == "SELECT")
|
44 |
+
selectByValue(document.forms[0], id, value);
|
45 |
+
else if (elm.type == "checkbox")
|
46 |
+
elm.checked = !!value;
|
47 |
+
else
|
48 |
+
elm.value = value;
|
49 |
+
}
|
50 |
+
};
|
51 |
+
|
52 |
+
function getVal(id) {
|
53 |
+
var elm = document.getElementById(id);
|
54 |
+
|
55 |
+
if (elm.nodeName == "SELECT")
|
56 |
+
return elm.options[elm.selectedIndex].value;
|
57 |
+
|
58 |
+
if (elm.type == "checkbox")
|
59 |
+
return elm.checked;
|
60 |
+
|
61 |
+
return elm.value;
|
62 |
+
};
|
63 |
+
|
64 |
+
window.FullPageDialog = {
|
65 |
+
changedStyle : function() {
|
66 |
+
var val, styles = tinyMCEPopup.editor.dom.parseStyle(getVal('style'));
|
67 |
+
|
68 |
+
setVal('fontface', styles['font-face']);
|
69 |
+
setVal('fontsize', styles['font-size']);
|
70 |
+
setVal('textcolor', styles['color']);
|
71 |
+
|
72 |
+
if (val = styles['background-image'])
|
73 |
+
setVal('bgimage', val.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"));
|
74 |
+
else
|
75 |
+
setVal('bgimage', '');
|
76 |
+
|
77 |
+
setVal('bgcolor', styles['background-color']);
|
78 |
+
|
79 |
+
// Reset margin form elements
|
80 |
+
setVal('topmargin', '');
|
81 |
+
setVal('rightmargin', '');
|
82 |
+
setVal('bottommargin', '');
|
83 |
+
setVal('leftmargin', '');
|
84 |
+
|
85 |
+
// Expand margin
|
86 |
+
if (val = styles['margin']) {
|
87 |
+
val = val.split(' ');
|
88 |
+
styles['margin-top'] = val[0] || '';
|
89 |
+
styles['margin-right'] = val[1] || val[0] || '';
|
90 |
+
styles['margin-bottom'] = val[2] || val[0] || '';
|
91 |
+
styles['margin-left'] = val[3] || val[0] || '';
|
92 |
+
}
|
93 |
+
|
94 |
+
if (val = styles['margin-top'])
|
95 |
+
setVal('topmargin', val.replace(/px/, ''));
|
96 |
+
|
97 |
+
if (val = styles['margin-right'])
|
98 |
+
setVal('rightmargin', val.replace(/px/, ''));
|
99 |
+
|
100 |
+
if (val = styles['margin-bottom'])
|
101 |
+
setVal('bottommargin', val.replace(/px/, ''));
|
102 |
+
|
103 |
+
if (val = styles['margin-left'])
|
104 |
+
setVal('leftmargin', val.replace(/px/, ''));
|
105 |
+
|
106 |
+
updateColor('bgcolor_pick', 'bgcolor');
|
107 |
+
updateColor('textcolor_pick', 'textcolor');
|
108 |
+
},
|
109 |
+
|
110 |
+
changedStyleProp : function() {
|
111 |
+
var val, dom = tinyMCEPopup.editor.dom, styles = dom.parseStyle(getVal('style'));
|
112 |
+
|
113 |
+
styles['font-face'] = getVal('fontface');
|
114 |
+
styles['font-size'] = getVal('fontsize');
|
115 |
+
styles['color'] = getVal('textcolor');
|
116 |
+
styles['background-color'] = getVa
|