Wp-Insert - Version 2.0

Version Description

Users of old versions of Wp-Insert will lose your widget placements when upgrading to 2.0 as we have finally switched to the new widget API. Wp-Insert is now upto 4 times more efficient and have extremely high emphasis on security compared to previous versions.

Download this release

Release Info

Developer namith.jawahar
Plugin Icon 128x128 Wp-Insert
Version 2.0
Comparing to
See all releases

Code changes from version 1.7.6 to 2.0

Files changed (203) hide show
  1. css/IE6adminStyle.css +0 -9
  2. css/adminStyle.css +0 -77
  3. feeds/insert-feeds.php +0 -171
  4. highlighter/syntax.php +0 -87
  5. images/move-16x16.png +0 -0
  6. images/popUpBtm.png +0 -0
  7. images/popUpBtmLft.png +0 -0
  8. images/popUpBtmRgt.png +0 -0
  9. images/popUpLft.png +0 -0
  10. images/popUpRgt.png +0 -0
  11. images/popUpTop.png +0 -0
  12. images/popUpTopLft.png +0 -0
  13. images/popUpTopRgt.png +0 -0
  14. images/search-16x16.png +0 -0
  15. images/style-16x16.png +0 -0
  16. includes/ads.php +0 -130
  17. includes/adsadvanced.php +0 -54
  18. includes/adwidgets.php +0 -91
  19. includes/adwidgets/activate-upgrade.php +79 -0
  20. includes/adwidgets/admin-page.php +254 -0
  21. includes/adwidgets/adwidgets.php +6 -0
  22. includes/adwidgets/menu.php +9 -0
  23. includes/adwidgets/widget.php +57 -0
  24. includes/common/activate-upgrade.php +19 -0
  25. includes/common/admin-page.php +34 -0
  26. includes/common/common.php +11 -0
  27. includes/common/controls.php +146 -0
  28. includes/common/countries.php +269 -0
  29. includes/common/css/style.css +419 -0
  30. includes/common/geoip/GeoIP.dat +0 -0
  31. includes/common/geoip/LICENSE.txt +39 -0
  32. includes/common/geoip/geoip.inc +726 -0
  33. includes/common/images/ClosedTabBackground.png +0 -0
  34. includes/common/images/ClosedTabBackgroundHover.png +0 -0
  35. includes/common/images/better_checkbox.png +0 -0
  36. includes/common/images/border.png +0 -0
  37. includes/common/images/check.png +0 -0
  38. includes/common/images/controls.png +0 -0
  39. includes/common/images/help.png +0 -0
  40. includes/common/images/iphone_off.png +0 -0
  41. includes/common/images/iphone_on.png +0 -0
  42. includes/common/images/iphone_slider.png +0 -0
  43. includes/common/images/iphone_slider_center.png +0 -0
  44. includes/common/images/iphone_slider_left.png +0 -0
  45. includes/common/images/iphone_slider_right.png +0 -0
  46. includes/common/images/loading.gif +0 -0
  47. includes/common/images/loading_background.png +0 -0
  48. includes/common/images/logo.png +0 -0
  49. includes/common/images/overlay.png +0 -0
  50. includes/common/images/pointer.png +0 -0
  51. includes/common/jquery.php +18 -0
  52. includes/common/js/iphone-style-checkboxes.js +284 -0
  53. includes/common/js/jquery-jvert-tabs-1.1.4.js +356 -0
  54. includes/common/js/jquery.colorbox-min.js +4 -0
  55. includes/common/js/jquery.tzCheckbox.js +47 -0
  56. includes/common/js/nicEdit-latest.js +126 -0
  57. includes/common/js/ui.multiselect.js +336 -0
  58. includes/common/js/wp-insert-functions.js +12 -0
  59. includes/common/menu.php +6 -0
  60. includes/common/popups/categories.php +51 -0
  61. includes/common/popups/countries.php +51 -0
  62. includes/common/popups/instances.php +62 -0
  63. includes/common/popups/pages.php +51 -0
  64. includes/common/popups/posts.php +51 -0
  65. includes/common/rules.php +3 -0
  66. includes/common/status.php +100 -0
  67. includes/common/styles.php +18 -0
  68. includes/contenthook.php +0 -7
  69. includes/dashboardwidget.php +0 -24
  70. includes/essentials.php +0 -140
  71. includes/feeds.php +0 -90
  72. includes/includes.php +10 -0
  73. includes/inpostads.php +0 -269
  74. includes/inpostads/activate-upgrade.php +216 -0
  75. includes/inpostads/admin-page.php +284 -0
  76. includes/inpostads/content.php +95 -0
  77. includes/inpostads/inpostads.php +6 -0
  78. includes/inpostads/menu.php +7 -0
  79. includes/legal-pages/activate-upgrade.php +35 -0
  80. includes/legal-pages/admin-page.php +67 -0
  81. includes/legal-pages/content.php +35 -0
  82. includes/legal-pages/data.php +48 -0
  83. includes/legal-pages/legal-pages.php +7 -0
  84. includes/legal-pages/menu.php +7 -0
  85. includes/menu.php +0 -67
  86. includes/miscellaneous.php +0 -133
  87. includes/multiple-adnetwork/activate-upgrade.php +28 -0
  88. includes/multiple-adnetwork/meta-box.php +15 -0
  89. includes/multiple-adnetwork/multiple-adnetwork.php +4 -0
  90. includes/pages.php +0 -67
  91. includes/postpicker.php +0 -271
  92. includes/privacypolicy.php +0 -103
  93. includes/syntax-highlighter.php +0 -105
  94. includes/syntax-highlighting/activate-upgrade.php +26 -0
  95. includes/syntax-highlighting/admin-page.php +40 -0
  96. includes/syntax-highlighting/codes.php +74 -0
  97. {editarea → includes/syntax-highlighting/editarea}/change_log.txt +0 -0
  98. {editarea → includes/syntax-highlighting/editarea}/edit_area.css +0 -0
  99. {editarea → includes/syntax-highlighting/editarea}/edit_area_full.js +0 -0
  100. {editarea → includes/syntax-highlighting/editarea}/images/autocompletion.gif +0 -0
  101. {editarea → includes/syntax-highlighting/editarea}/images/close.gif +0 -0
  102. {editarea → includes/syntax-highlighting/editarea}/images/fullscreen.gif +0 -0
  103. {editarea → includes/syntax-highlighting/editarea}/images/go_to_line.gif +0 -0
  104. {editarea → includes/syntax-highlighting/editarea}/images/help.gif +0 -0
  105. {editarea → includes/syntax-highlighting/editarea}/images/highlight.gif +0 -0
  106. {editarea → includes/syntax-highlighting/editarea}/images/load.gif +0 -0
  107. {editarea → includes/syntax-highlighting/editarea}/images/move.gif +0 -0
  108. {editarea → includes/syntax-highlighting/editarea}/images/newdocument.gif +0 -0
  109. {editarea → includes/syntax-highlighting/editarea}/images/opacity.png +0 -0
  110. {editarea → includes/syntax-highlighting/editarea}/images/processing.gif +0 -0
  111. {editarea → includes/syntax-highlighting/editarea}/images/redo.gif +0 -0
  112. {editarea → includes/syntax-highlighting/editarea}/images/reset_highlight.gif +0 -0
  113. {editarea → includes/syntax-highlighting/editarea}/images/save.gif +0 -0
  114. {editarea → includes/syntax-highlighting/editarea}/images/search.gif +0 -0
  115. {editarea → includes/syntax-highlighting/editarea}/images/smooth_selection.gif +0 -0
  116. {editarea → includes/syntax-highlighting/editarea}/images/spacer.gif +0 -0
  117. {editarea → includes/syntax-highlighting/editarea}/images/statusbar_resize.gif +0 -0
  118. {editarea → includes/syntax-highlighting/editarea}/images/undo.gif +0 -0
  119. {editarea → includes/syntax-highlighting/editarea}/images/word_wrap.gif +0 -0
  120. {editarea → includes/syntax-highlighting/editarea}/langs/bg.js +0 -0
  121. {editarea → includes/syntax-highlighting/editarea}/langs/cs.js +0 -0
  122. {editarea → includes/syntax-highlighting/editarea}/langs/de.js +0 -0
  123. {editarea → includes/syntax-highlighting/editarea}/langs/dk.js +0 -0
  124. {editarea → includes/syntax-highlighting/editarea}/langs/en.js +0 -0
  125. {editarea → includes/syntax-highlighting/editarea}/langs/eo.js +0 -0
  126. {editarea → includes/syntax-highlighting/editarea}/langs/es.js +0 -0
  127. {editarea → includes/syntax-highlighting/editarea}/langs/fi.js +0 -0
  128. {editarea → includes/syntax-highlighting/editarea}/langs/fr.js +0 -0
  129. {editarea → includes/syntax-highlighting/editarea}/langs/hr.js +0 -0
  130. {editarea → includes/syntax-highlighting/editarea}/langs/id.js +0 -0
  131. {editarea → includes/syntax-highlighting/editarea}/langs/it.js +0 -0
  132. {editarea → includes/syntax-highlighting/editarea}/langs/ja.js +0 -0
  133. {editarea → includes/syntax-highlighting/editarea}/langs/mk.js +0 -0
  134. {editarea → includes/syntax-highlighting/editarea}/langs/nl.js +0 -0
  135. {editarea → includes/syntax-highlighting/editarea}/langs/pl.js +0 -0
  136. {editarea → includes/syntax-highlighting/editarea}/langs/pt.js +0 -0
  137. {editarea → includes/syntax-highlighting/editarea}/langs/ru.js +0 -0
  138. {editarea → includes/syntax-highlighting/editarea}/langs/sk.js +0 -0
  139. {editarea → includes/syntax-highlighting/editarea}/langs/zh.js +0 -0
  140. {editarea → includes/syntax-highlighting/editarea}/license_apache.txt +0 -0
  141. {editarea → includes/syntax-highlighting/editarea}/license_bsd.txt +0 -0
  142. {editarea → includes/syntax-highlighting/editarea}/license_lgpl.txt +0 -0
  143. {editarea → includes/syntax-highlighting/editarea}/reg_syntax/basic.js +0 -0
  144. {editarea → includes/syntax-highlighting/editarea}/reg_syntax/brainfuck.js +0 -0
  145. {editarea → includes/syntax-highlighting/editarea}/reg_syntax/c.js +0 -0
  146. {editarea → includes/syntax-highlighting/editarea}/reg_syntax/coldfusion.js +0 -0
  147. {editarea → includes/syntax-highlighting/editarea}/reg_syntax/cpp.js +0 -0
  148. {editarea → includes/syntax-highlighting/editarea}/reg_syntax/css.js +0 -0
  149. {editarea → includes/syntax-highlighting/editarea}/reg_syntax/html.js +0 -0
  150. {editarea → includes/syntax-highlighting/editarea}/reg_syntax/java.js +0 -0
  151. {editarea → includes/syntax-highlighting/editarea}/reg_syntax/js.js +0 -0
  152. {editarea → includes/syntax-highlighting/editarea}/reg_syntax/pas.js +0 -0
  153. {editarea → includes/syntax-highlighting/editarea}/reg_syntax/perl.js +0 -0
  154. {editarea → includes/syntax-highlighting/editarea}/reg_syntax/php.js +0 -0
  155. {editarea → includes/syntax-highlighting/editarea}/reg_syntax/python.js +0 -0
  156. {editarea → includes/syntax-highlighting/editarea}/reg_syntax/robotstxt.js +0 -0
  157. {editarea → includes/syntax-highlighting/editarea}/reg_syntax/ruby.js +0 -0
  158. {editarea → includes/syntax-highlighting/editarea}/reg_syntax/sql.js +0 -0
  159. {editarea → includes/syntax-highlighting/editarea}/reg_syntax/tsql.js +0 -0
  160. {editarea → includes/syntax-highlighting/editarea}/reg_syntax/vb.js +0 -0
  161. {editarea → includes/syntax-highlighting/editarea}/reg_syntax/xml.js +0 -0
  162. {editarea → includes/syntax-highlighting/editarea}/todo.txt +0 -0
  163. includes/syntax-highlighting/menu.php +7 -0
  164. includes/syntax-highlighting/syntax-highlighting.php +6 -0
  165. includes/tandc.php +0 -111
  166. includes/templateads.php +0 -58
  167. includes/templateads/activate-upgrade.php +79 -0
  168. includes/templateads/admin-page.php +258 -0
  169. includes/templateads/menu.php +10 -0
  170. includes/templateads/template-tag.php +18 -0
  171. includes/templateads/templateads.php +6 -0
  172. includes/tracking-codes/activate-upgrade.php +41 -0
  173. includes/tracking-codes/admin-page.php +48 -0
  174. includes/tracking-codes/codes.php +27 -0
  175. includes/tracking-codes/menu.php +7 -0
  176. includes/tracking-codes/tracking-codes.php +6 -0
  177. includes/tracking.php +0 -133
  178. includes/twitter-lib/CHANGES +0 -43
  179. includes/twitter-lib/LICENSE +0 -22
  180. includes/twitter-lib/README +0 -33
  181. includes/twitter-lib/twitter.lib.php +0 -535
  182. includes/widgethook.php +0 -18
  183. js/common.js +0 -269
  184. js/jquery.qtip-1.0.0-rc3.min.js +0 -15
  185. js/jquery/jquery-ui-1.7.1.custom.min.js +0 -273
  186. js/jquery/jquery-ui-1.8.14.custom.min.js +0 -789
  187. js/jquery/jquery.corner.js +0 -152
  188. js/jquery/ui.core.js +0 -295
  189. js/jquery/ui.draggable.js +0 -560
  190. readme.txt +55 -84
  191. screenshot-1.png +0 -0
  192. screenshot-10.png +0 -0
  193. screenshot-2.png +0 -0
  194. screenshot-3.png +0 -0
  195. screenshot-4.png +0 -0
  196. screenshot-5.png +0 -0
  197. screenshot-6.png +0 -0
  198. screenshot-7.png +0 -0
  199. screenshot-8.png +0 -0
  200. screenshot-9.png +0 -0
  201. support/support.php +0 -19
  202. tracking/insert-analytics.php +0 -72
  203. wp-insert.php +11 -7
css/IE6adminStyle.css DELETED
@@ -1,9 +0,0 @@
1
- /*Begin Make default admin menu wider*/
2
- #adminmenu {
3
- width:145px;
4
- }
5
-
6
- #wpbody {
7
- margin-left:175px;
8
- }
9
- /*End Make default admin menu wider*/
 
 
 
 
 
 
 
 
 
css/adminStyle.css DELETED
@@ -1,77 +0,0 @@
1
- .wp-insert-submit {
2
- text-align: center;
3
- }
4
-
5
- .wp-insert-submit #submit {
6
- background: green none repeat scroll 0% 0% !important;
7
- height: 60px;
8
- font-weight: bold;
9
- font-size: 26px !important;
10
- width: 80%;
11
- }
12
-
13
- .earnings {
14
- margin: 30px 15px;
15
- font-weight: bold;
16
- font-size: 40px;
17
- color: green;
18
- float: right;
19
- }
20
-
21
- .bigbold {
22
- font-size: 11px;
23
- font-weight: bold;
24
- }
25
-
26
- .GreyOutLayer
27
- {
28
- position: absolute;
29
- top: 0px;
30
- left: 0px;
31
- width: 100%;
32
- height: 100%;
33
- bottom: 0px;
34
- background-color: #666;
35
- z-index: 100;
36
- filter: progid:DXImageTransform.Microsoft.Alpha(opacity = 30);
37
- opacity: 0.30;
38
- }
39
-
40
- #popUpMaster{position:relative;padding:10px 0 0 10px;display:none}
41
- #popUpTopLft{position:absolute;left:0px;top:0}
42
- #popUpTop{position:absolute;left:10px;top:0;height:36px;z-index:9}
43
- #popUpTopRgt{position:absolute;right:0px;top:0;z-index:9}
44
- #popUpLft{position:absolute;left:0px;top:30px;width:17px;}
45
- #popUpRgt{position:absolute;right:0px;top:36px;width:26px;}
46
- #popUpBtmLft{position:absolute;left:0px;bottom:0px;}
47
- #popUpBtm{position:absolute;left:17px;bottom:0px;height:20px}
48
- #popUpBtmRgt{position:absolute;right:0px;bottom:0px;}
49
- #popUpMaster #content{background:#F2F2F2;height:520px;width:725px;margin:0px;z-index:100;position:absolute;top:26px;right:15px;}
50
- .closePopUp{display:block;position:absolute;right:10px;top:4px;width:20px;height:18px;z-index:10;text-decoration:none;background:none}
51
- #popUpMaster h4{position:absolute;top:0;left:0;z-index:10;padding:0;margin:6px 0 0 10px;color:#333333;text-shadow:0 1px 0 #FFFFFF;
52
- font-family:Arial, Helvetica, sans-serif;font-size:12px;line-height:15px;cursor:move;background:nonImage.gif;
53
- width:100%}
54
-
55
- .multipleSelectBoxControl div select option {
56
- font-size: 10px;
57
- padding: 0px;
58
- }
59
-
60
- #wp_insert_page_list {
61
- list-style: none;
62
- }
63
-
64
- #wp_insert_page_list li {
65
- display: block;
66
- padding: 5px 10px; margin-bottom: 3px;
67
- background-color: #efefef;
68
- }
69
-
70
- #wp_insert_page_list li img.handle {
71
- margin-right: 20px;
72
- cursor: move;
73
- }
74
-
75
- .column-postID {
76
- width: 3em;
77
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
feeds/insert-feeds.php DELETED
@@ -1,171 +0,0 @@
1
- <?php
2
- add_action('template_redirect', 'register_feed_redirect');
3
- add_action("plugins_loaded", "register_feed_head_manipulation");
4
- add_filter('the_content', 'register_feed_ad_manipulation');
5
- add_action("plugins_loaded", "register_email_feed_widget");
6
-
7
- // Creating the dynamic widget for the widgets page
8
- function register_email_feed_widget() {
9
- if(get_option('smart_feed_email_enabled')) { register_sidebar_widget(__('Feedburner : Subscribe via Email'), 'feed_email_subscribe_widget_create'); }
10
- if(get_option('smart_feed_subscribe_widget_enabled')) { register_sidebar_widget(__('Subscribe to Feed'), 'feed_subscribe_widget_create'); }
11
- }
12
-
13
- function feed_subscribe_widget_create($args) {
14
- extract($args);
15
- echo $before_widget;
16
- if(get_option('smart_feed_subscribe_widget_header') != "") {
17
- echo $before_title.get_option('smart_feed_subscribe_widget_header').$after_title;
18
- }
19
- if(get_option('smart_feed_feedburner_enabled')) {
20
- echo '<ul><li><a href="'.get_option('smart_feed_feedburner').'"><img src="'.get_bloginfo('url').'/wp-content/plugins/wp-insert/images/feed-icon-24x24.gif" /> Subscribe</a></li></ul>';
21
- } else {
22
- echo '<ul><li><a href="'.get_bloginfo('rss2_url').'"><img src="'.get_bloginfo('url').'/wp-content/plugins/wp-insert/images/feed-icon-24x24.gif" /> Subscribe</a></li></ul>';
23
- }
24
- echo $after_widget;
25
- }
26
-
27
- function feed_email_subscribe_widget_create($args) {
28
- extract($args);
29
- echo $before_widget;
30
- echo get_option('smart_feed_email');
31
- echo $after_widget;
32
- }
33
-
34
- function register_feed_redirect() {
35
- if(get_option('smart_feed_feedburner_enabled')) {
36
- if (!is_feed()) { return; }
37
- else if (preg_match('/feedburner/', $_SERVER['HTTP_USER_AGENT'])) { return; }
38
- else {
39
- header("Location: ".get_option('smart_feed_feedburner'));
40
- }
41
- }
42
- else { return; }
43
- }
44
-
45
- function register_feed_ad_manipulation($content) {
46
- if(is_feed()) {
47
- $prefix = '';
48
- $suffix = '';
49
- if(get_option('smart_feed_ad_top_enabled')) {
50
- $prefix = get_option('smart_feed_ad_top');
51
- }
52
- if(get_option('smart_feed_ad_bottom_enabled')) {
53
- $suffix = "<p>".get_option('smart_feed_ad_bottom')."</p>";
54
- }
55
- return $prefix.$content.$suffix;
56
- }
57
- else { return $content; }
58
- }
59
-
60
- function register_feed_head_manipulation() {
61
- if(get_option('smart_feed_head_enable')) {
62
- add_action('rss_head', 'smart_add_feedimage_rss');
63
- add_action('rss2_head', 'smart_add_feedimage_rss');
64
- }
65
- }
66
-
67
- function smart_add_feedimage_rss() {
68
- echo "<image>
69
- <title>".get_bloginfo('name')."</title>
70
- <url>".get_option('smart_feed_head')."</url>
71
- <link>".get_bloginfo('url')."</link>
72
- <width>".get_option('smart_feed_head_width')."</width>
73
- <height>".get_option('smart_feed_head_height')."</height>
74
- <description>get_bloginfo('description')</description>
75
- </image>";
76
- }
77
- // action function for adding the administrative page
78
- function smart_add_feedspage() { ?>
79
- <div class="wrap">
80
- <h2>WP-INSERT : Manage Feeds</h2>
81
- <?php show_support_options(); ?>
82
- <form method="post" action="options.php">
83
- <?php wp_nonce_field('update-options'); ?>
84
-
85
- <table class="form-table">
86
-
87
- <tr valign="top">
88
- <th scope="row"><b>Logo for your feed</b></th>
89
- <td><input id="smart_feed_head_enable" name="smart_feed_head_enable" type="checkbox" value="1" <?php if(get_option('smart_feed_head_enable')) echo 'checked="checked"'; ?> /> Enabled</td>
90
- </tr>
91
-
92
- <tr valign="top">
93
- <th scope="row">Logo URL</th>
94
- <td><input id="smart_feed_head" name="smart_feed_head" type="text" value="<?php echo get_option('smart_feed_head'); ?>" style="width:350px;" /><br/>
95
- <small>( Paste the URL of your logo image in the box above )</small></td>
96
- </tr>
97
-
98
- <tr valign="top">
99
- <th scope="row">Logo Width</th>
100
- <td><input id="smart_feed_head_width" name="smart_feed_head_width" type="text" value="<?php echo get_option('smart_feed_head_width'); ?>" style="width:350px;" /><br/>
101
- <small>( The width of your logo image )</small></td>
102
- </tr>
103
-
104
- <tr valign="top">
105
- <th scope="row">Logo Height</th>
106
- <td><input id="smart_feed_head_height" name="smart_feed_head_height" type="text" value="<?php echo get_option('smart_feed_head_height'); ?>" style="width:350px;" /><br/>
107
- <small>( The height of your logo image )</small></td>
108
- </tr>
109
-
110
- <tr valign="top">
111
- <th scope="row"><b>Insert ads into your feed</b></th>
112
- <td>The ads might not show up for already written posts!</td>
113
- </tr>
114
-
115
- <tr valign="top">
116
- <th scope="row">Ad code to insert<br/>( Above feed content )<br/>
117
- <br/><input id="smart_feed_ad_top_enabled" name="smart_feed_ad_top_enabled" type="checkbox" value="1"<?php if(get_option('smart_feed_ad_top_enabled')) echo ' checked="checked"'; ?>/> Enabled</th>
118
- <td><textarea id="smart_feed_ad_top" name="smart_feed_ad_top" style="width:350px;height:150px;"><?php echo get_option('smart_feed_ad_top'); ?></textarea><br/>
119
- <small>( Paste your ad-sense or similar code in the box above )</small></td>
120
- </tr>
121
-
122
- <tr valign="top">
123
- <th scope="row">Ad code to insert<br/>( Below feed content )<br/>
124
- <br/><input id="smart_feed_ad_bottom_enabled" name="smart_feed_ad_bottom_enabled" type="checkbox" value="1"<?php if(get_option('smart_feed_ad_bottom_enabled')) echo ' checked="checked"'; ?>/> Enabled</th>
125
- <td><textarea id="smart_feed_ad_bottom" name="smart_feed_ad_bottom" style="width:350px;height:150px;"><?php echo get_option('smart_feed_ad_bottom'); ?></textarea><br/>
126
- <small>( Paste your ad-sense or similar code in the box above )</small></td>
127
- </tr>
128
-
129
- <tr valign="top">
130
- <th scope="row"><b>Feedburner</b></th>
131
- <td></td>
132
- </tr>
133
-
134
- <tr valign="top">
135
- <th scope="row">Feedburner Feed URL<br/>
136
- <br/><input id="smart_feed_feedburner_enabled" name="smart_feed_feedburner_enabled" type="checkbox" value="1"<?php if(get_option('smart_feed_feedburner_enabled')) echo ' checked="checked"'; ?>/> Enabled</th>
137
- <td><input type="text" id="smart_feed_feedburner" name="smart_feed_feedburner" style="width:350px;" value="<?php echo get_option('smart_feed_feedburner'); ?>" /><br/>
138
- <small>( Paste your Feedburner feed URL in the box above )</small></td>
139
- </tr>
140
-
141
- <tr valign="top">
142
- <th scope="row">Subscribe via E-mail Widget<br/>
143
- <br/><input id="smart_feed_email_enabled" name="smart_feed_email_enabled" type="checkbox" value="1"<?php if(get_option('smart_feed_email_enabled')) echo ' checked="checked"'; ?>/> Enabled</th>
144
- <td><textarea id="smart_feed_email" name="smart_feed_email" style="width:350px;height:150px;"><?php echo get_option('smart_feed_email'); ?></textarea><br/>
145
- <small>( Paste your Feedburner Subscribe via email code in the box above )</small></td>
146
- </tr>
147
-
148
- <tr valign="top">
149
- <th scope="row"><b>Subscribe Widget</b></th>
150
- <td></td>
151
- </tr>
152
-
153
- <tr valign="top">
154
- <th scope="row">Subscribe Widget Header<br/>( Optional ) <input id="smart_feed_subscribe_widget_enabled" name="smart_feed_subscribe_widget_enabled" type="checkbox" value="1"<?php if(get_option('smart_feed_subscribe_widget_enabled')) echo ' checked="checked"'; ?>/> Enabled</th>
155
- <td><input type="text" id="smart_feed_subscribe_widget_header" name="smart_feed_subscribe_widget_header" style="width:350px;" value="<?php echo get_option('smart_feed_subscribe_widget_header'); ?>" /><br/>
156
- <small>( Paste the header text for subscribe in the box above )</small></td>
157
- </tr>
158
-
159
- </table>
160
-
161
- <input type="hidden" name="action" value="update" />
162
- <input type="hidden" name="page_options" value="smart_feed_head_enable,smart_feed_head,smart_feed_head_width,smart_feed_head_height,smart_feed_ad_top_enabled,smart_feed_ad_top,smart_feed_ad_bottom_enabled,smart_feed_ad_bottom,smart_feed_feedburner_enabled,smart_feed_feedburner,smart_feed_email,smart_feed_email_enabled,smart_feed_subscribe_widget_enabled,smart_feed_subscribe_widget_header" />
163
- <p class="submit">
164
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
165
- </p>
166
- </form>
167
- <p>
168
- <script type="text/javascript" src="http://www.wp-insert.smartlogix.co.in/wp-content/plugins/wp-adnetwork/wp-adnetwork.php?showad=1"></script>
169
- </p>
170
- </div>
171
- <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
highlighter/syntax.php DELETED
@@ -1,87 +0,0 @@
1
- <?php
2
- add_action("plugins_loaded", "smart_syntaxhighlighting_init");
3
- function smart_syntaxhighlighting_init() {
4
- if(get_option('smart_enable_sh')) {
5
- add_action('admin_footer', 'smart_init_syntaxhighlighting');
6
- }
7
- }
8
-
9
- function smart_init_syntaxhighlighting() {
10
- if(basename($_SERVER['SCRIPT_NAME']) == 'plugin-editor.php' || basename($_SERVER['SCRIPT_NAME']) == 'theme-editor.php') {
11
- global $file;
12
- $ext=strstr(basename($file),'.');
13
- if($ext == '.php') {
14
- $ext = 'php';
15
- }
16
- else if($ext == '.css') {
17
- $ext = 'css';
18
- }
19
- else if($ext == '.js') {
20
- $ext = 'javascript';
21
- }
22
- else if($ext == '.html' ||$ext == '.htm') {
23
- $ext = 'html';
24
- }
25
- else {
26
- $ext = '';
27
- } ?>
28
- <script type="text/javascript" src="<?php echo get_bloginfo('url') ?>/wp-content/plugins/wp-insert/codepress/codepress.js"></script>
29
- <script type="text/javascript">
30
- try {
31
- var smart_editor = document.getElementById('newcontent');
32
- smart_editor.form.onsubmit=function() {
33
- var smart_input = document.createElement("input");
34
- smart_input.setAttribute("type","hidden");
35
- smart_input.setAttribute("name","newcontent");
36
- smart_input.setAttribute("value",newcontent.getCode());
37
- smart_editor.form.appendChild(smart_input);
38
- return true;
39
- }
40
- smart_editor.className="codepress <?php echo $ext ?> linenumbers-on autocomplete-off readonly-off";
41
- var smart_options_content = "<table><tr><td colspan='6'><b><a title='WP-Insert by Smart Logix' href='http://www.smartlogix.co.in'>WP-insert</a> : Syntax Highlighter Options</b></td></tr><tr><td>&nbsp;</td></tr><tr><td><input type='checkbox' onclick='newcontent.toggleAutoComplete()' />&nbsp;Turn on Autocomplete</td><td>&nbsp;&nbsp;&nbsp;</td><td><input type='checkbox' onclick='newcontent.toggleLineNumbers()' />&nbsp;Turn off Linenumbers</td><td>&nbsp;&nbsp;&nbsp;</td><td><input type='checkbox' onclick='newcontent.toggleEditor()' />&nbsp;Turn off Syntax Highlighting</td></tr></table>"
42
- var smart_options = document.createElement("div");
43
- smart_options.innerHTML = smart_options_content;
44
- smart_editor.form.appendChild(smart_options);
45
- }
46
- catch (e) { void(0); }
47
- </script>
48
- <?php }
49
- }
50
-
51
- function smart_add_syntaxhighlighting_pages() { ?>
52
- <div class="wrap">
53
- <h2>WP-INSERT : Syntax Highlighting</h2>
54
- <?php show_support_options(); ?>
55
- <form method="post" action="options.php">
56
- <?php wp_nonce_field('update-options'); ?>
57
- <table class="form-table">
58
- <tr valign="top">
59
- <th scope="row"></th>
60
- <td></td>
61
- </tr>
62
- <tr valign="top">
63
- <th scope="row"><input id="smart_enable_sh" name="smart_enable_sh" type="checkbox" value="1"<?php if(get_option('smart_enable_sh')) echo ' checked="checked"'; ?>/> <b>Plugin/Theme Editor</b></th>
64
- <td>( Syntax highlighting in plugin and theme editor )<br/>
65
- Syntax highlighting by codepress</td>
66
- </tr>
67
- <tr><th>Codepress Features</th>
68
- <td>
69
- <ul>
70
- <li>Real-time syntax highlighting</li>
71
- <li>Code snippets - on PHP pages just type "if" and press [tab]</li>
72
- <li>Auto completion - simple type single/double quotes or ( or [ or {</li>
73
- <li>Shortcuts - on PHP pages press [ctrl][shift][space]. Its shortcut to <code>&<b></b>nbsp;</code></li></ul>
74
- </td>
75
- </tr>
76
- </table>
77
- <input type="hidden" name="action" value="update" />
78
- <input type="hidden" name="page_options" value="smart_enable_sh" />
79
- <p class="submit">
80
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
81
- </p>
82
- </form>
83
- <p>
84
- <script type="text/javascript" src="http://www.wp-insert.smartlogix.co.in/wp-content/plugins/wp-adnetwork/wp-adnetwork.php?showad=1"></script>
85
- </p>
86
- </div>
87
- <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
images/move-16x16.png DELETED
Binary file
images/popUpBtm.png DELETED
Binary file
images/popUpBtmLft.png DELETED
Binary file
images/popUpBtmRgt.png DELETED
Binary file
images/popUpLft.png DELETED
Binary file
images/popUpRgt.png DELETED
Binary file
images/popUpTop.png DELETED
Binary file
images/popUpTopLft.png DELETED
Binary file
images/popUpTopRgt.png DELETED
Binary file
images/search-16x16.png DELETED
Binary file
images/style-16x16.png DELETED
Binary file
includes/ads.php DELETED
@@ -1,130 +0,0 @@
1
- <?php
2
- require_once (dirname(__FILE__) . '/adwidgets.php');
3
- require_once (dirname(__FILE__) . '/inpostads.php');
4
-
5
- function wp_insert_add_adspage() {
6
- global $screen_layout_columns;
7
-
8
- add_meta_box('wp_insert_multiple_ad_network', 'Multiple Ad Networks', 'wp_insert_multiple_ad_network_HTML', 'col_1');
9
- add_meta_box('wp_insert_in_post_ad_top_1', 'Ad - Above Post Content', 'wp_insert_in_post_ad_top_1_HTML', 'col_1');
10
- add_meta_box('wp_insert_in_post_ad_bottom_1', 'Ad - Below Post Content', 'wp_insert_in_post_ad_bottom_1_HTML', 'col_1');
11
- add_meta_box('wp_insert_in_post_ad_left_1', 'Ad - Left of Post Content', 'wp_insert_in_post_ad_left_1_HTML', 'col_1');
12
- add_meta_box('wp_insert_in_post_ad_right_1', 'Ad - Right of Post Content', 'wp_insert_in_post_ad_right_1_HTML', 'col_1');
13
- add_meta_box('wp_insert_in_post_ad_middle_1', 'Ad - Middle of Post Content', 'wp_insert_in_post_ad_middle_1_HTML', 'col_1');
14
- add_meta_box('wp_insert_ad_widget_1', 'Ad Widget : 1', 'wp_insert_ad_widget_1_HTML', 'col_1');
15
- add_meta_box('wp_insert_ad_widget_2', 'Ad Widget : 2', 'wp_insert_ad_widget_2_HTML', 'col_1');
16
- add_meta_box('wp_insert_ad_widget_3', 'Ad Widget : 3', 'wp_insert_ad_widget_3_HTML', 'col_1');
17
- add_meta_box('wp_insert_ad_widget_4', 'Ad Widget : 4', 'wp_insert_ad_widget_4_HTML', 'col_1');
18
- add_meta_box('wp_insert_ad_widget_5', 'Ad Widget : 5', 'wp_insert_ad_widget_5_HTML', 'col_1');
19
- add_meta_box('wp_insert_ad_widget_6', 'Ad Widget : 6', 'wp_insert_ad_widget_6_HTML', 'col_1');
20
- add_meta_box('wp_insert_ad_widget_7', 'Ad Widget : 7', 'wp_insert_ad_widget_7_HTML', 'col_1');
21
- add_meta_box('wp_insert_ad_widget_8', 'Ad Widget : 8', 'wp_insert_ad_widget_8_HTML', 'col_1');
22
- add_meta_box('wp_insert_ad_widget_9', 'Ad Widget : 9', 'wp_insert_ad_widget_9_HTML', 'col_1');
23
- add_meta_box('wp_insert_ad_widget_10', 'Ad Widget : 10', 'wp_insert_ad_widget_10_HTML', 'col_1');
24
-
25
- $parameters = 'wp_insert_multiple_ad_network_type,'.wp_insert_in_post_ad_parameters('middle_1').','.wp_insert_in_post_ad_parameters('right_1').','.wp_insert_in_post_ad_parameters('left_1').','.wp_insert_in_post_ad_parameters('bottom_1').','.wp_insert_in_post_ad_parameters('top_1').','.wp_insert_ad_widget_parameters(1).','.wp_insert_ad_widget_parameters(2).','.wp_insert_ad_widget_parameters(3).','.wp_insert_ad_widget_parameters(4).','.wp_insert_ad_widget_parameters(5).','.wp_insert_ad_widget_parameters(6).','.wp_insert_ad_widget_parameters(7).','.wp_insert_ad_widget_parameters(8).','.wp_insert_ad_widget_parameters(9).','.wp_insert_ad_widget_parameters(10);
26
- wp_insert_settings_page_layout($parameters, 'WP-INSERT : Manage Ads (Posts and Sidebars)', 'ads');
27
- }
28
-
29
- function wp_insert_in_post_ad_parameters($in_post_adID) { return wp_insert_ad_parameters($in_post_adID, 'in_post_ad'); }
30
- function wp_insert_in_post_ad_top_1_HTML() { wp_insert_ad_HTML('top_1', 'in_post_ad'); }
31
- function wp_insert_in_post_ad_bottom_1_HTML() { wp_insert_ad_HTML('bottom_1', 'in_post_ad'); }
32
- function wp_insert_in_post_ad_left_1_HTML() { wp_insert_ad_HTML('left_1', 'in_post_ad'); }
33
- function wp_insert_in_post_ad_right_1_HTML() { wp_insert_ad_HTML('right_1', 'in_post_ad'); }
34
- function wp_insert_in_post_ad_middle_1_HTML() { wp_insert_ad_HTML('middle_1', 'in_post_ad'); }
35
-
36
- function wp_insert_ad_widget_parameters($widgetID) { return wp_insert_ad_parameters($widgetID, 'ad_widget'); }
37
- function wp_insert_ad_widget_1_HTML() { wp_insert_ad_HTML(1, 'ad_widget'); }
38
- function wp_insert_ad_widget_2_HTML() { wp_insert_ad_HTML(2, 'ad_widget'); }
39
- function wp_insert_ad_widget_3_HTML() { wp_insert_ad_HTML(3, 'ad_widget'); }
40
- function wp_insert_ad_widget_4_HTML() { wp_insert_ad_HTML(4, 'ad_widget'); }
41
- function wp_insert_ad_widget_5_HTML() { wp_insert_ad_HTML(5, 'ad_widget'); }
42
- function wp_insert_ad_widget_6_HTML() { wp_insert_ad_HTML(6, 'ad_widget'); }
43
- function wp_insert_ad_widget_7_HTML() { wp_insert_ad_HTML(7, 'ad_widget'); }
44
- function wp_insert_ad_widget_8_HTML() { wp_insert_ad_HTML(8, 'ad_widget'); }
45
- function wp_insert_ad_widget_9_HTML() { wp_insert_ad_HTML(9, 'ad_widget'); }
46
- function wp_insert_ad_widget_10_HTML() { wp_insert_ad_HTML(10, 'ad_widget'); }
47
-
48
- function wp_insert_multiple_ad_network_HTML() {
49
- if(!get_option('wp_insert_multiple_ad_network_type')) { add_option("wp_insert_multiple_ad_network_type", 'Primary Ad Network Only', '', 'yes'); }
50
- ?>
51
- <div>
52
- Select the Multiple Ad Network Setup that best suits you : <select name="wp_insert_multiple_ad_network_type" id="wp_insert_multiple_ad_network_type" onchange="wpInsertToggleNotSavedAlert()" >
53
- <?php
54
- $multiple_ad_network_types = array("Primary Ad Network Only","Primary and Alternate Ad Network 1","All Ad Networks");
55
- $output = '';
56
- foreach ($multiple_ad_network_types as $multiple_ad_network_type) {
57
- $output .= '<option';
58
- if ( get_option('wp_insert_multiple_ad_network_type') == $multiple_ad_network_type) { $output .= ' selected="selected"'; }
59
- $output .= '>'.$multiple_ad_network_type.'</option>';
60
- }
61
- echo $output;
62
- ?>
63
- </select>
64
- <p>
65
- <small>Multiple Ad Networks can be setup to display ads from different networks without infringing the terms of any network.<br/>At a time only ads from one network (Randomly Choosen) will be shown.<br/>This feature can also be used to randomly display different sized Ads from the same network.<br/>Please note that this option is global and applied to Template Ads, In Post Ads as well as Ad Widgets.</small>
66
- </p>
67
- </div>
68
- <?php }
69
-
70
- function wp_insert_ad_parameters($adID, $ad_type) {
71
- $output = '';
72
- if($ad_type == 'ad_widget') { $output .= 'wp_insert_'.$ad_type.'_'.$adID.'_title,'; }
73
- $output .= 'wp_insert_'.$ad_type.'_'.$adID.'_enable,wp_insert_'.$ad_type.'_'.$adID.'_content,wp_insert_'.$ad_type.'_'.$adID.'_content_1,wp_insert_'.$ad_type.'_'.$adID.'_content_2,wp_insert_'.$ad_type.'_'.$adID.'_exclude_ids,wp_insert_'.$ad_type.'_'.$adID.'_exclude_home,wp_insert_'.$ad_type.'_'.$adID.'_exclude_archives,wp_insert_'.$ad_type.'_'.$adID.'_style';
74
- return $output;
75
- }
76
-
77
- function wp_insert_ad_HTML($adID, $ad_type) { ?>
78
- <div>
79
- <?php if(get_option('wp_insert_'.$ad_type.'_'.$adID.'_enable')) { ?><input type="button" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_enable_button" value="Click to Deactivate" class="button" style="font-weight:bold;color:red;" onclick="wpInsertToggleAdWidget('#wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_enable_button', '#wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_enable')"/>
80
- <?php } else { ?><input type="button" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_enable_button" value="Click to Activate" class="button" style="font-weight:bold;color:#2f9303;" onclick="wpInsertToggleAdWidget('#wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_enable_button', '#wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_enable')"/><?php } ?>
81
- <input style="display:none;" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_enable" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_enable" type="checkbox" value="1"<?php if(get_option('wp_insert_'.$ad_type.'_'.$adID.'_enable')) echo ' checked="checked"'; ?> />
82
-
83
- <?php if($ad_type == 'template_ad') { ?>
84
- <p>
85
- <label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_insertion_code">Code to add in your theme:</label>
86
- <input id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_insertion_code" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_insertion_code" type="text" style="border: medium none ; padding: 3px; font-size: 11px; width: 100%; display: inline;" class="widefat" readonly="true" value="&lt;?php if(function_exists('wp_template_ad')) { wp_template_ad('<?php echo $adID; ?>'); } ?&gt;" />
87
- </p>
88
- <?php } ?>
89
-
90
- <?php if($ad_type == 'ad_widget') { ?>
91
- <p>
92
- <label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_title">Title:</label>
93
- <input id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_title" class="widefat" type="text" value="<?php echo get_option('wp_insert_'.$ad_type.'_'.$adID.'_title'); ?>" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_title" onchange="wpInsertToggleNotSavedAlert()" />
94
- </p>
95
- <?php } ?>
96
-
97
- <div style="margin:10px 6px;">
98
- <?php if((get_option('wp_insert_multiple_ad_network_type') == "Primary and Alternate Ad Network 1") || (get_option('wp_insert_multiple_ad_network_type') == "All Ad Networks")) { ?><input type="button" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_button" value="Primary Ad Code" class="button" style="color:#2f9303;" onclick="SwitchAds('wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content','wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_1','wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_2')"/> <?php } else {?><label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content">Primary Ad Code:</label><?php } ?>
99
- <?php if((get_option('wp_insert_multiple_ad_network_type') == "Primary and Alternate Ad Network 1") || (get_option('wp_insert_multiple_ad_network_type') == "All Ad Networks")) { ?><input type="button" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_1_button" value="Alternative Ad Code : 1" class="button" style="color:red;" onclick="SwitchAds('wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_1','wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content','wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_2')"/> <?php } ?>
100
- <?php if(get_option('wp_insert_multiple_ad_network_type') == "All Ad Networks") { ?><input type="button" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_2_button" value="Alternative Ad Code : 2" class="button" style="color:red;" onclick="SwitchAds('wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_2','wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_1','wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content')"/> <?php } ?>
101
- <textarea style="display:block;height:200px;" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content" class="widefat" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content" cols="20" rows="16" onchange="wpInsertToggleNotSavedAlert()" ><?php echo get_option('wp_insert_'.$ad_type.'_'.$adID.'_content'); ?></textarea>
102
- <textarea style="display:none;height:0px;" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_1" class="widefat" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_1" cols="20" rows="16" onchange="wpInsertToggleNotSavedAlert()" ><?php echo get_option('wp_insert_'.$ad_type.'_'.$adID.'_content_1'); ?></textarea>
103
- <textarea style="display:none;height:0px;" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_2" class="widefat" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_content_2" cols="20" rows="16" onchange="wpInsertToggleNotSavedAlert()" ><?php echo get_option('wp_insert_'.$ad_type.'_'.$adID.'_content_2'); ?></textarea>
104
- </div>
105
-
106
- <div style="margin:6px;">
107
- <label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_ids">Exclude On Posts/Pages:</label><div class="clear"></div>
108
- <input style="margin: 10px 6px 0pt; float: left; width: 60%;" class="widefat" type="text" value="<?php echo get_option('wp_insert_'.$ad_type.'_'.$adID.'_exclude_ids'); ?>" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_ids" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_ids" onchange="wpInsertToggleNotSavedAlert()" />
109
- <img style="float:left; margin-top:14px; cursor: pointer;" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/images/search-16x16.png" width="16px" height="16px" onclick="ShowPostPicker('wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_ids')" />
110
- <div class="clear"></div>
111
- </div>
112
- <p>
113
- <label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_home">Exclude On Home Page:</label>
114
- <input id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_home" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_home" type="checkbox" value="1"<?php if(get_option('wp_insert_'.$ad_type.'_'.$adID.'_exclude_home')) echo ' checked="checked"'; ?> onchange="wpInsertToggleNotSavedAlert()" />
115
- </p>
116
- <p>
117
- <label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_archives">Exclude On Archives Pages:</label>
118
- <input id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_archives" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_exclude_archives" type="checkbox" value="1"<?php if(get_option('wp_insert_'.$ad_type.'_'.$adID.'_exclude_archives')) echo ' checked="checked"'; ?> onchange="wpInsertToggleNotSavedAlert()" />
119
- </p>
120
-
121
- <div style="margin:6px;padding: 6px;border: 1px solid #DDDDDD;">
122
- <label for="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_style">Ad Box CSS Styler</label><div class="clear"></div>
123
- <input style="float:left; width:60%; margin: 10px 6px 0pt;background: #FFEEEE;" class="widefat" type="text" value="<?php if(get_option('wp_insert_'.$ad_type.'_'.$adID.'_style') != '') { echo get_option('wp_insert_'.$ad_type.'_'.$adID.'_style'); } else { echo 'margin: 5px;padding: 0px;'; } ?>" name="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_style" id="wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_style" onchange="wpInsertToggleNotSavedAlert()" />
124
- <img style="float:left; margin-top:14px; cursor: pointer;" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/images/style-16x16.png" width="0px" height="0px" onclick="ShowStyler('wp_insert_<?php echo $ad_type; ?>_<?php echo $adID; ?>_style')" />
125
- <div class="clear"></div>
126
- </div>
127
-
128
- </div>
129
- <?php
130
- } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/adsadvanced.php DELETED
@@ -1,54 +0,0 @@
1
- <?php
2
- require_once (dirname(__FILE__) . '/templateads.php');
3
-
4
- function wp_insert_add_advanced_page() {
5
- global $screen_layout_columns;
6
-
7
- add_meta_box('wp_insert_multiple_ad_network', 'Multiple Ad Networks', 'wp_insert_multiple_ad_network_HTML', 'col_1');
8
- add_meta_box('wp_insert_ad_template_1', 'Template Ad : 1', 'wp_insert_ad_template_1_HTML', 'col_1');
9
- add_meta_box('wp_insert_ad_template_2', 'Template Ad : 2', 'wp_insert_ad_template_2_HTML', 'col_1');
10
- add_meta_box('wp_insert_ad_template_3', 'Template Ad : 3', 'wp_insert_ad_template_3_HTML', 'col_1');
11
- add_meta_box('wp_insert_ad_template_4', 'Template Ad : 4', 'wp_insert_ad_template_4_HTML', 'col_1');
12
- add_meta_box('wp_insert_ad_template_5', 'Template Ad : 5', 'wp_insert_ad_template_5_HTML', 'col_1');
13
- add_meta_box('wp_insert_ad_template_6', 'Template Ad : 6', 'wp_insert_ad_template_6_HTML', 'col_1');
14
- add_meta_box('wp_insert_ad_template_7', 'Template Ad : 7', 'wp_insert_ad_template_7_HTML', 'col_1');
15
- add_meta_box('wp_insert_ad_template_8', 'Template Ad : 8', 'wp_insert_ad_template_8_HTML', 'col_1');
16
- add_meta_box('wp_insert_ad_template_9', 'Template Ad : 9', 'wp_insert_ad_template_9_HTML', 'col_1');
17
- add_meta_box('wp_insert_ad_template_10', 'Template Ad : 10', 'wp_insert_ad_template_10_HTML', 'col_1');
18
- add_meta_box('wp_insert_ad_template_11', 'Template Ad : 11', 'wp_insert_ad_template_11_HTML', 'col_1');
19
- add_meta_box('wp_insert_ad_template_12', 'Template Ad : 12', 'wp_insert_ad_template_12_HTML', 'col_1');
20
- add_meta_box('wp_insert_ad_template_13', 'Template Ad : 13', 'wp_insert_ad_template_13_HTML', 'col_1');
21
- add_meta_box('wp_insert_ad_template_14', 'Template Ad : 14', 'wp_insert_ad_template_14_HTML', 'col_1');
22
- add_meta_box('wp_insert_ad_template_15', 'Template Ad : 15', 'wp_insert_ad_template_15_HTML', 'col_1');
23
- add_meta_box('wp_insert_ad_template_16', 'Template Ad : 16', 'wp_insert_ad_template_16_HTML', 'col_1');
24
- add_meta_box('wp_insert_ad_template_17', 'Template Ad : 17', 'wp_insert_ad_template_17_HTML', 'col_1');
25
- add_meta_box('wp_insert_ad_template_18', 'Template Ad : 18', 'wp_insert_ad_template_18_HTML', 'col_1');
26
- add_meta_box('wp_insert_ad_template_19', 'Template Ad : 19', 'wp_insert_ad_template_19_HTML', 'col_1');
27
- add_meta_box('wp_insert_ad_template_20', 'Template Ad : 20', 'wp_insert_ad_template_20_HTML', 'col_1');
28
-
29
- $parameters = 'wp_insert_multiple_ad_network_type,'.wp_insert_ad_template_parameters('1').','.wp_insert_ad_template_parameters('2').','.wp_insert_ad_template_parameters('3').','.wp_insert_ad_template_parameters('4').','.wp_insert_ad_template_parameters('5').','.wp_insert_ad_template_parameters('6').','.wp_insert_ad_template_parameters('7').','.wp_insert_ad_template_parameters('8').','.wp_insert_ad_template_parameters('9').','.wp_insert_ad_template_parameters('10').','.wp_insert_ad_template_parameters('11').','.wp_insert_ad_template_parameters('12').','.wp_insert_ad_template_parameters('13').','.wp_insert_ad_template_parameters('14').','.wp_insert_ad_template_parameters('15').','.wp_insert_ad_template_parameters('16').','.wp_insert_ad_template_parameters('17').','.wp_insert_ad_template_parameters('18').','.wp_insert_ad_template_parameters('19').','.wp_insert_ad_template_parameters('20');
30
- wp_insert_settings_page_layout($parameters, 'WP-INSERT : Manage Ads (Template Tags)', 'ads');
31
- }
32
-
33
- function wp_insert_ad_template_parameters($template_adID) { return wp_insert_ad_parameters($template_adID, 'template_ad'); }
34
- function wp_insert_ad_template_1_HTML() { wp_insert_ad_HTML('1', 'template_ad'); }
35
- function wp_insert_ad_template_2_HTML() { wp_insert_ad_HTML('2', 'template_ad'); }
36
- function wp_insert_ad_template_3_HTML() { wp_insert_ad_HTML('3', 'template_ad'); }
37
- function wp_insert_ad_template_4_HTML() { wp_insert_ad_HTML('4', 'template_ad'); }
38
- function wp_insert_ad_template_5_HTML() { wp_insert_ad_HTML('5', 'template_ad'); }
39
- function wp_insert_ad_template_6_HTML() { wp_insert_ad_HTML('6', 'template_ad'); }
40
- function wp_insert_ad_template_7_HTML() { wp_insert_ad_HTML('7', 'template_ad'); }
41
- function wp_insert_ad_template_8_HTML() { wp_insert_ad_HTML('8', 'template_ad'); }
42
- function wp_insert_ad_template_9_HTML() { wp_insert_ad_HTML('9', 'template_ad'); }
43
- function wp_insert_ad_template_10_HTML() { wp_insert_ad_HTML('10', 'template_ad'); }
44
- function wp_insert_ad_template_11_HTML() { wp_insert_ad_HTML('11', 'template_ad'); }
45
- function wp_insert_ad_template_12_HTML() { wp_insert_ad_HTML('12', 'template_ad'); }
46
- function wp_insert_ad_template_13_HTML() { wp_insert_ad_HTML('13', 'template_ad'); }
47
- function wp_insert_ad_template_14_HTML() { wp_insert_ad_HTML('14', 'template_ad'); }
48
- function wp_insert_ad_template_15_HTML() { wp_insert_ad_HTML('15', 'template_ad'); }
49
- function wp_insert_ad_template_16_HTML() { wp_insert_ad_HTML('16', 'template_ad'); }
50
- function wp_insert_ad_template_17_HTML() { wp_insert_ad_HTML('17', 'template_ad'); }
51
- function wp_insert_ad_template_18_HTML() { wp_insert_ad_HTML('18', 'template_ad'); }
52
- function wp_insert_ad_template_19_HTML() { wp_insert_ad_HTML('19', 'template_ad'); }
53
- function wp_insert_ad_template_20_HTML() { wp_insert_ad_HTML('20', 'template_ad'); }
54
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/adwidgets.php DELETED
@@ -1,91 +0,0 @@
1
- <?php
2
- function wp_insert_ad_widget_create($widgetID, $args) {
3
- extract($args);
4
-
5
- global $random;
6
- $page_details = wp_insert_get_current_page_details();
7
-
8
- switch($random) {
9
- case 0:
10
- if(get_option('wp_insert_ad_widget_'.$widgetID.'_content') == '' ) { return ''; }
11
- break;
12
- case 1:
13
- if(get_option('wp_insert_ad_widget_'.$widgetID.'_content_1') == '' ) { return ''; }
14
- break;
15
- case 2:
16
- if(get_option('wp_insert_ad_widget_'.$widgetID.'_content_2') == '' ) { return ''; }
17
- break;
18
- }
19
-
20
- $ad_style = get_option('wp_insert_ad_widget_'.$widgetID.'_style');
21
- if($ad_style == '') { $ad_style = 'margin: 5px; padding: 0px;'; }
22
-
23
- if(!get_option('wp_insert_ad_widget_'.$widgetID.'_exclude_home') && ($page_details == 'HOME')) {
24
- $title = get_option('wp_insert_ad_widget_'.$widgetID.'_title');
25
- echo $before_widget;
26
- if($title != "") { echo $before_title.$title.$after_title; }
27
- switch($random) {
28
- case 0:
29
- echo '<div id="ad_widget_'.$widgetID.'" style="'.$ad_style.'">'.get_option('wp_insert_ad_widget_'.$widgetID.'_content').'</div>';
30
- break;
31
- case 1:
32
- echo '<div id="ad_widget_'.$widgetID.'" style="'.$ad_style.'">'.get_option('wp_insert_ad_widget_'.$widgetID.'_content_1').'</div>';
33
- break;
34
- case 2:
35
- echo '<div id="ad_widget_'.$widgetID.'" style="'.$ad_style.'">'.get_option('wp_insert_ad_widget_'.$widgetID.'_content_2').'</div>';
36
- break;
37
- }
38
- echo $after_widget;
39
- }
40
- else if(!get_option('wp_insert_ad_widget_'.$widgetID.'_exclude_archives') && ($page_details == 'ARCHIVE')) {
41
- $title = get_option('wp_insert_ad_widget_'.$widgetID.'_title');
42
- echo $before_widget;
43
- if($title != "") { echo $before_title.$title.$after_title; }
44
- switch($random) {
45
- case 0:
46
- echo '<div id="ad_widget_'.$widgetID.'" style="'.$ad_style.'">'.get_option('wp_insert_ad_widget_'.$widgetID.'_content').'</div>';
47
- break;
48
- case 1:
49
- echo '<div id="ad_widget_'.$widgetID.'" style="'.$ad_style.'">'.get_option('wp_insert_ad_widget_'.$widgetID.'_content_1').'</div>';
50
- break;
51
- case 2:
52
- echo '<div id="ad_widget_'.$widgetID.'" style="'.$ad_style.'">'.get_option('wp_insert_ad_widget_'.$widgetID.'_content_2').'</div>';
53
- break;
54
- }
55
- echo $after_widget;
56
- }
57
- else {
58
- if(is_singular()) {
59
- $page_ids = explode(',', str_replace(" ", "", get_option('wp_insert_ad_widget_'.$widgetID.'_exclude_ids')));
60
- if(wp_insert_is_in_array($page_details, $page_ids) =='FALSE') {
61
- $title = get_option('wp_insert_ad_widget_'.$widgetID.'_title');
62
- echo $before_widget;
63
- if($title != "") { echo $before_title.$title.$after_title; }
64
- switch($random) {
65
- case 0:
66
- echo '<div id="ad_widget_'.$widgetID.'" style="'.$ad_style.'">'.get_option('wp_insert_ad_widget_'.$widgetID.'_content').'</div>';
67
- break;
68
- case 1:
69
- echo '<div id="ad_widget_'.$widgetID.'" style="'.$ad_style.'">'.get_option('wp_insert_ad_widget_'.$widgetID.'_content_1').'</div>';
70
- break;
71
- case 2:
72
- echo '<div id="ad_widget_'.$widgetID.'" style="'.$ad_style.'">'.get_option('wp_insert_ad_widget_'.$widgetID.'_content_2').'</div>';
73
- break;
74
- }
75
- echo $after_widget;
76
- }
77
- }
78
- }
79
- }
80
-
81
- function wp_insert_ad_widget_1_create($args) { wp_insert_ad_widget_create(1, $args); }
82
- function wp_insert_ad_widget_2_create($args) { wp_insert_ad_widget_create(2, $args); }
83
- function wp_insert_ad_widget_3_create($args) { wp_insert_ad_widget_create(3, $args); }
84
- function wp_insert_ad_widget_4_create($args) { wp_insert_ad_widget_create(4, $args); }
85
- function wp_insert_ad_widget_5_create($args) { wp_insert_ad_widget_create(5, $args); }
86
- function wp_insert_ad_widget_6_create($args) { wp_insert_ad_widget_create(6, $args); }
87
- function wp_insert_ad_widget_7_create($args) { wp_insert_ad_widget_create(7, $args); }
88
- function wp_insert_ad_widget_8_create($args) { wp_insert_ad_widget_create(8, $args); }
89
- function wp_insert_ad_widget_9_create($args) { wp_insert_ad_widget_create(9, $args); }
90
- function wp_insert_ad_widget_10_create($args) { wp_insert_ad_widget_create(10, $args); }
91
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/adwidgets/activate-upgrade.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('wp_insert_activate_upgrade', 'wp_insert_adwidgets_activate_upgrade');
3
+ function wp_insert_adwidgets_activate_upgrade() {
4
+ if(!get_option('wp_insert_adwidgets_options')) {
5
+ $values = array();
6
+ for($i = 1; $i <= 10; $i++) {
7
+ $values['adwidgets-'.$i] = array(
8
+ 'status' => '',
9
+ 'ad_code_1' => '',
10
+ 'ad_code_2' => '',
11
+ 'ad_code_3' => '',
12
+ 'country_1' => '',
13
+ 'country_code_1' => '',
14
+ 'rules_exclude_home' => '',
15
+ 'rules_exclude_archives' => '',
16
+ 'rules_exclude_categories' => '',
17
+ 'rules_categories_exceptions' => '',
18
+ 'rules_exclude_search' => '',
19
+ 'rules_exclude_page' => '',
20
+ 'rules_page_exceptions' => '',
21
+ 'rules_exclude_post' => '',
22
+ 'rules_post_exceptions' => '',
23
+ 'styles' => 'margin: 5px; padding: 0px;',
24
+ );
25
+ }
26
+ $values = wp_insert_adwidgets_upgrade_from_1x($values);
27
+ update_option('wp_insert_adwidgets_options', $values);
28
+ }
29
+
30
+ if(!get_option('wp_insert_more_adwidgets_options')) {
31
+ $values = array();
32
+ for($i = 11; $i <= 20; $i++) {
33
+ $values['adwidgets-'.$i] = array(
34
+ 'status' => '',
35
+ 'ad_code_1' => '',
36
+ 'ad_code_2' => '',
37
+ 'ad_code_3' => '',
38
+ 'country_1' => '',
39
+ 'country_code_1' => '',
40
+ 'rules_exclude_home' => '',
41
+ 'rules_exclude_archives' => '',
42
+ 'rules_exclude_categories' => '',
43
+ 'rules_categories_exceptions' => '',
44
+ 'rules_exclude_search' => '',
45
+ 'rules_exclude_page' => '',
46
+ 'rules_page_exceptions' => '',
47
+ 'rules_exclude_post' => '',
48
+ 'rules_post_exceptions' => '',
49
+ 'styles' => 'margin: 5px; padding: 0px;',
50
+ );
51
+ }
52
+ update_option('wp_insert_more_adwidgets_options', $values);
53
+ }
54
+ }
55
+
56
+ function wp_insert_adwidgets_upgrade_from_1x($values) {
57
+ for($i = 1; $i <= 10; $i++) {
58
+ wp_insert_read_and_destroy_old_option('wp_insert_ad_widget_'.$i.'_title');
59
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_ad_widget_'.$i.'_enable');
60
+ $values['adwidgets-'.$i]['status'] = ($val == null)?$values['adwidgets-'.$i]['status']:$val;
61
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_ad_widget_'.$i.'_content');
62
+ $values['adwidgets-'.$i]['ad_code_1'] = ($val == null)?$values['adwidgets-'.$i]['ad_code_1']:$val;
63
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_ad_widget_'.$i.'_content_1');
64
+ $values['adwidgets-'.$i]['ad_code_2'] = ($val == null)?$values['adwidgets-'.$i]['ad_code_2']:$val;
65
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_ad_widget_'.$i.'_content_2');
66
+ $values['adwidgets-'.$i]['ad_code_3'] = ($val == null)?$values['adwidgets-'.$i]['ad_code_3']:$val;
67
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_ad_widget_'.$i.'_exclude_ids');
68
+ $values['adwidgets-'.$i]['rules_exclude_page'] = ($val == null)?$values['adwidgets-'.$i]['rules_exclude_page']:$val;
69
+ $values['adwidgets-'.$i]['rules_exclude_page'] = ($val == null)?$values['adwidgets-'.$i]['rules_exclude_page']:$val;
70
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_ad_widget_'.$i.'_exclude_home');
71
+ $values['adwidgets-'.$i]['rules_exclude_home'] = ($val == null)?$values['adwidgets-'.$i]['rules_exclude_home']:$val;
72
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_ad_widget_'.$i.'_exclude_archives');
73
+ $values['adwidgets-'.$i]['rules_exclude_archives'] = ($val == null)?$values['adwidgets-'.$i]['rules_exclude_archives']:$val;
74
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_ad_widget_'.$i.'_style');
75
+ $values['adwidgets-'.$i]['styles'] = ($val == null)?$values['adwidgets-'.$i]['styles']:$val;
76
+ }
77
+ return $values;
78
+ }
79
+ ?>
includes/adwidgets/admin-page.php ADDED
@@ -0,0 +1,254 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_insert_adwidgets_admin_page() {
3
+ wp_insert_admin_page('Ad Widgets', 'wp-insert-adwidgets', 'wp_insert_adwidgets_options');
4
+ }
5
+
6
+ function wp_insert_more_adwidgets_admin_page() {
7
+ wp_insert_admin_page('Ad Widgets', 'wp-insert-more-adwidgets', 'wp_insert_more_adwidgets_options');
8
+ }
9
+
10
+ add_action('admin_init', 'wp_insert_adwidgets_admin_init');
11
+ function wp_insert_adwidgets_admin_init() {
12
+ register_setting('wp_insert_adwidgets_options', 'wp_insert_adwidgets_options', 'wp_insert_adwidgets_validate');
13
+ add_settings_section('wp-insert-adwidgets', '', 'wp_insert_adwidgets_section', 'wp-insert-adwidgets');
14
+
15
+ $options = get_option('wp_insert_adwidgets_options');
16
+ add_meta_box('wp_insert_multiple_network_status', 'Multiple Ad Networks', 'wp_insert_multiple_network_status_content', 'wp-insert-adwidgets', 'advanced', 'high', array('location' => 'multiple-network', 'name' => 'wp_insert_adwidgets_options', 'data' => $options));
17
+ for($i = 1; $i <= 10; $i++) {
18
+ add_meta_box('wp-insert-adwidgets-'.$i, 'Ad Widget : '.$i, 'wp_insert_adwidgets_content', 'wp-insert-adwidgets', 'advanced', 'low', array('location' => 'adwidgets-'.$i, 'name' => 'wp_insert_adwidgets_options', 'data' => $options));
19
+ }
20
+
21
+ register_setting('wp_insert_more_adwidgets_options', 'wp_insert_more_adwidgets_options', 'wp_insert_adwidgets_validate');
22
+ add_settings_section('wp-insert-more-adwidgets', '', 'wp_insert_more_adwidgets_section', 'wp-insert-more-adwidgets');
23
+
24
+ $options = get_option('wp_insert_more_adwidgets_options');
25
+ add_meta_box('wp_insert_multiple_network_status', 'Multiple Ad Networks', 'wp_insert_multiple_network_status_content', 'wp-insert-more-adwidgets', 'advanced', 'high', array('location' => 'multiple-network', 'name' => 'wp_insert_more_adwidgets_options', 'data' => $options));
26
+ for($i = 11; $i <= 20; $i++) {
27
+ add_meta_box('wp-insert-more-adwidgets-'.$i, 'Ad Widget : '.$i, 'wp_insert_adwidgets_content', 'wp-insert-more-adwidgets', 'advanced', 'low', array('location' => 'adwidgets-'.$i, 'name' => 'wp_insert_more_adwidgets_options', 'data' => $options));
28
+ }
29
+ }
30
+
31
+ function wp_insert_adwidgets_section() {
32
+ do_meta_boxes('wp-insert-adwidgets', 'advanced', null);
33
+ }
34
+
35
+ function wp_insert_more_adwidgets_section() {
36
+ do_meta_boxes('wp-insert-more-adwidgets', 'advanced', null);
37
+ }
38
+
39
+ function wp_insert_adwidgets_content($post, $args) {
40
+ $location = $args['args']['location'];
41
+ $data = $args['args']['data'];
42
+ $id = $args['id'];
43
+ $name = $args['args']['name'].'['.$location.']';
44
+
45
+ if(!$data) {
46
+ $data = array();
47
+ }
48
+
49
+ $controls = array();
50
+ $controls['status'] = wp_insert_get_control('tz-checkbox', false, $name.'[status]', $id.'-status', $data[$location]['status']);
51
+ $controls['ad_code_1'] = wp_insert_get_control('textarea', false, $name.'[ad_code_1]', $id.'-ad_code_1', $data[$location]['ad_code_1'], 'Ad Code (Primary Network):');
52
+ $controls['ad_code_2'] = wp_insert_get_control('textarea', false, $name.'[ad_code_2]', $id.'-ad_code_2', $data[$location]['ad_code_2'], 'Ad Code (Secondary Network):');
53
+ $controls['ad_code_3'] = wp_insert_get_control('textarea', false, $name.'[ad_code_3]', $id.'-ad_code_3', $data[$location]['ad_code_3'], 'Ad Code (Tertiary Network):');
54
+
55
+ $countries = wp_insert_get_countries();
56
+ $controls['country_1'] = wp_insert_get_control('popup', false, $name.'[country_1]', $id.'-country_1', $data[$location]['country_1'], 'Geo Targets', '', array('type' => 'countries'));
57
+ $controls['country_code_1'] = wp_insert_get_control('textarea', false, $name.'[country_code_1]', $id.'-country_code_1', $data[$location]['country_code_1'], 'Ad Code', '', null, 'input widefat');
58
+
59
+ $controls['rules_exclude_home'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_home]', $id.'-rules_exclude_home', $data[$location]['rules_exclude_home'], '', '', null, '', false);
60
+ $controls['rules_exclude_archives'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_archives]', $id.'-rules_exclude_archives', $data[$location]['rules_exclude_archives'], '', '', null, '', false);
61
+ $controls['rules_exclude_categories'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_categories]', $id.'-rules_exclude_categories', $data[$location]['rules_exclude_categories'], '', '', null, '', false);
62
+ $controls['rules_categories_exceptions'] = wp_insert_get_control('popup', false, $name.'[rules_categories_exceptions]', $id.'-rules_categories_exceptions', $data[$location]['rules_categories_exceptions'], '', '', array('type' => 'categories'), '', false);
63
+ $controls['rules_exclude_search'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_search]', $id.'-rules_exclude_search', $data[$location]['rules_exclude_search'], '', '', null, '', false);
64
+ $controls['rules_exclude_page'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_page]', $id.'-rules_exclude_page', $data[$location]['rules_exclude_page'], '', '', null, '', false);
65
+ $controls['rules_page_exceptions'] = wp_insert_get_control('popup', false, $name.'[rules_page_exceptions]', $id.'-rules_page_exceptions', $data[$location]['rules_page_exceptions'], '', '', array('type' => 'pages'), '', false);
66
+ $controls['rules_exclude_post'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_post]', $id.'-rules_exclude_post', $data[$location]['rules_exclude_post'], '', '', null, '', false);
67
+ $controls['rules_post_exceptions'] = wp_insert_get_control('popup', false, $name.'[rules_post_exceptions]', $id.'-rules_post_exceptions', $data[$location]['rules_post_exceptions'], '', '', array('type' => 'posts'), '', false);
68
+
69
+ $controls['styles'] = wp_insert_get_control('textarea', false, $name.'[styles]', $id.'-styles', $data[$location]['styles'], 'Styles:');
70
+
71
+ echo $controls['status']['html'];
72
+
73
+ $multiple_network_status = get_option('wp_insert_multiple_network_status');
74
+ if($multiple_network_status == 2 || $multiple_network_status == 1) {
75
+ $controls['ad_code_3']['html'] = '<div style="display: none;">'.$controls['ad_code_3']['html'].'</div>';
76
+ }
77
+
78
+ if($multiple_network_status == 1) {
79
+ $controls['ad_code_2']['html'] = '<div style="display: none;">'.$controls['ad_code_2']['html'].'</div>';
80
+ }
81
+ $tabData = array(
82
+ array(
83
+ 'title' => 'Ad Code',
84
+ 'content' => $controls['ad_code_1']['html'].$controls['ad_code_2']['html'].$controls['ad_code_3']['html']
85
+ ),
86
+ array(
87
+ 'title' => 'Rules',
88
+ 'content' => wp_insert_adwidgets_rules_content($controls)
89
+ ),
90
+ array(
91
+ 'title' => 'Geo Targeting',
92
+ 'content' => '<p>'.$controls['country_1']['html'].$controls['country_code_1']['html'].'</p>'
93
+ ),
94
+ array(
95
+ 'title' => 'Styles',
96
+ 'content' => $controls['styles']['html']
97
+ )
98
+ );
99
+ $controls['vtab'] = wp_insert_get_vtabs('vtab_'.$location, $tabData);
100
+ echo $controls['vtab']['html'];
101
+
102
+ echo wp_insert_get_script_tag($controls);
103
+ }
104
+
105
+ function wp_insert_adwidgets_rules_content($controls) {
106
+ $rulesTable = array(
107
+ 'class' => 'rules',
108
+ 'rows' => array()
109
+ );
110
+ array_push(
111
+ $rulesTable['rows'],
112
+ array(
113
+ 'cells' => array(
114
+ array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Home')
115
+ )
116
+ ),
117
+ array(
118
+ 'cells' => array(
119
+ array('content' => 'Status'),
120
+ array('content' => '&nbsp;:&nbsp;'),
121
+ array('content' => $controls['rules_exclude_home']['html'])
122
+ )
123
+ )
124
+ );
125
+ array_push(
126
+ $rulesTable['rows'],
127
+ array(
128
+ 'cells' => array(
129
+ array('colspan' => '3', 'content' => '&nbsp;')
130
+ )
131
+ ),
132
+ array(
133
+ 'cells' => array(
134
+ array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Archives')
135
+ )
136
+ ),
137
+ array(
138
+ 'cells' => array(
139
+ array('content' => 'Status'),
140
+ array('content' => '&nbsp;:&nbsp;'),
141
+ array('content' => $controls['rules_exclude_archives']['html'])
142
+ )
143
+ )
144
+ );
145
+ array_push(
146
+ $rulesTable['rows'],
147
+ array(
148
+ 'cells' => array(
149
+ array('colspan' => '3', 'content' => '&nbsp;')
150
+ )
151
+ ),
152
+ array(
153
+ 'cells' => array(
154
+ array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Categories')
155
+ )
156
+ ),
157
+ array(
158
+ 'cells' => array(
159
+ array('content' => 'Status'),
160
+ array('content' => '&nbsp;:&nbsp;'),
161
+ array('content' => $controls['rules_exclude_categories']['html'])
162
+ )
163
+ ),
164
+ array(
165
+ 'cells' => array(
166
+ array('content' => 'Exceptions'),
167
+ array('content' => '&nbsp;:&nbsp;'),
168
+ array('content' => $controls['rules_categories_exceptions']['html'])
169
+ )
170
+ )
171
+ );
172
+ array_push(
173
+ $rulesTable['rows'],
174
+ array(
175
+ 'cells' => array(
176
+ array('colspan' => '3', 'content' => '&nbsp;')
177
+ )
178
+ ),
179
+ array(
180
+ 'cells' => array(
181
+ array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Search Results')
182
+ )
183
+ ),
184
+ array(
185
+ 'cells' => array(
186
+ array('content' => 'Status'),
187
+ array('content' => '&nbsp;:&nbsp;'),
188
+ array('content' => $controls['rules_exclude_search']['html'])
189
+ )
190
+ )
191
+ );
192
+ array_push(
193
+ $rulesTable['rows'],
194
+ array(
195
+ 'cells' => array(
196
+ array('colspan' => '3', 'content' => '&nbsp;')
197
+ )
198
+ ),
199
+ array(
200
+ 'cells' => array(
201
+ array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Single Page')
202
+ )
203
+ ),
204
+ array(
205
+ 'cells' => array(
206
+ array('content' => 'Status'),
207
+ array('content' => '&nbsp;:&nbsp;'),
208
+ array('content' => $controls['rules_exclude_page']['html'])
209
+ )
210
+ ),
211
+ array(
212
+ 'cells' => array(
213
+ array('content' => 'Exceptions'),
214
+ array('content' => '&nbsp;:&nbsp;'),
215
+ array('content' => $controls['rules_page_exceptions']['html'])
216
+ )
217
+ )
218
+ );
219
+ array_push(
220
+ $rulesTable['rows'],
221
+ array(
222
+ 'cells' => array(
223
+ array('colspan' => '3', 'content' => '&nbsp;')
224
+ )
225
+ ),
226
+ array(
227
+ 'cells' => array(
228
+ array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Single Blog Post')
229
+ )
230
+ ),
231
+ array(
232
+ 'cells' => array(
233
+ array('content' => 'Status'),
234
+ array('content' => '&nbsp;:&nbsp;'),
235
+ array('content' => $controls['rules_exclude_post']['html'])
236
+ )
237
+ ),
238
+ array(
239
+ 'cells' => array(
240
+ array('content' => 'Exceptions'),
241
+ array('content' => '&nbsp;:&nbsp;'),
242
+ array('content' => $controls['rules_post_exceptions']['html'])
243
+ )
244
+ )
245
+ );
246
+
247
+ return wp_insert_get_table($rulesTable);
248
+ }
249
+
250
+ function wp_insert_adwidgets_validate($input) {
251
+ update_option('wp_insert_multiple_network_status', $input['multiple-network']['status']);
252
+ return $input;
253
+ }
254
+ ?>
includes/adwidgets/adwidgets.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ require_once(dirname(__FILE__).'/activate-upgrade.php');
3
+ require_once(dirname(__FILE__).'/menu.php');
4
+ require_once(dirname(__FILE__).'/admin-page.php');
5
+ require_once(dirname(__FILE__).'/widget.php');
6
+ ?>
includes/adwidgets/menu.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_insert_adwidgets_menu() {
3
+ $subPageHandle = add_submenu_page('wp-insert', 'Manage Ad Widgets<br /><small>(1 - 10)</small>', 'Manage Ad Widgets<br /><small>(1 - 10)</small>', 'manage_options', 'wp-insert-adwidgets', 'wp_insert_adwidgets_admin_page');
4
+ add_action('admin_print_styles-'.$subPageHandle, 'wp_insert_admin_styles');
5
+ $subPageHandle = add_submenu_page('wp-insert', 'Manage Ad Widgets<br /><small>(11 - 20)</small>', 'Manage Ad Widgets<br /><small>(11 - 20)</small>', 'manage_options', 'wp-insert-more-adwidgets', 'wp_insert_more_adwidgets_admin_page');
6
+ add_action('admin_print_styles-'.$subPageHandle, 'wp_insert_admin_styles');
7
+ }
8
+ add_action('admin_menu', 'wp_insert_adwidgets_menu');
9
+ ?>
includes/adwidgets/widget.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('widgets_init', create_function('', 'register_widget("wpInsertAdWidget");'));
3
+ class wpInsertAdWidget extends WP_Widget {
4
+ public function __construct() {
5
+ parent::__construct('wp_insert_ad_widget', 'Wp-Insert Ad Widget', array('description' => 'Wp-Insert Ad Widget'));
6
+ }
7
+
8
+ public function widget($args, $instance) {
9
+ global $wpInsertAdInstance;
10
+ global $wpInsertGeoLocation;
11
+ extract($args);
12
+ $title = apply_filters('widget_title', $instance['title']);
13
+ if($instance['instance'] <= 10) {
14
+ $options = get_option('wp_insert_adwidgets_options');
15
+ } else {
16
+ $options = get_option('wp_insert_more_adwidgets_options');
17
+ }
18
+ if(wp_insert_get_ad_status($options['adwidgets-'.$instance['instance']])) {
19
+ echo $before_widget;
20
+ if (!empty($title)) { echo $before_title.$title.$after_title; }
21
+
22
+ if(($options['adwidgets-'.$instance['instance']]['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['adwidgets-'.$instance['instance']]['country_1'])))) {
23
+ echo '<div class="wpInsert wpInsertAdWidget"'.(($options['adwidgets-'.$instance['instance']]['styles'] != '')?' style="'.$options['adwidgets-'.$instance['instance']]['styles'].'"':'').'>'.$options['adwidgets-'.$instance['instance']]['country_code_1'].'</div>';
24
+ } else {
25
+ echo '<div class="wpInsert wpInsertAdWidget"'.(($options['adwidgets-'.$instance['instance']]['styles'] != '')?' style="'.$options['adwidgets-'.$instance['instance']]['styles'].'"':'').'>'.$options['adwidgets-'.$instance['instance']]['ad_code_'.$wpInsertAdInstance].'</div>';
26
+ }
27
+ echo $after_widget;
28
+ }
29
+ }
30
+
31
+ public function update($new_opts, $old_opts) {
32
+ $opts = array();
33
+ $opts['title'] = $new_opts['title'];
34
+ $opts['instance'] = $new_opts['instance'];
35
+ return $opts;
36
+ }
37
+
38
+ public function form($instance) {
39
+ ?>
40
+ <p>
41
+ <label for="<?php echo $this->get_field_id('title'); ?>">Title:</label>
42
+ <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $instance['title']; ?>" />
43
+ </p>
44
+ <p>
45
+ <label for="<?php echo $this->get_field_id('instance'); ?>">Widget Instance:</label>
46
+ <select class="widefat" id="<?php echo $this->get_field_id('instance'); ?>" name="<?php echo $this->get_field_name('instance'); ?>">
47
+ <?php
48
+ for($i = 1; $i <= 20; $i++) {
49
+ echo '<option value="'.$i.'" '.selected($i, $instance['instance'], false).'>Ad Widget : '.$i.'</option>';
50
+ }
51
+ ?>
52
+ </select>
53
+ </p>
54
+ <?php
55
+ }
56
+ }
57
+ ?>
includes/common/activate-upgrade.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('init', 'wp_insert_activate_upgrade', 0);
3
+ function wp_insert_activate_upgrade() {
4
+ $databaseVersion = get_option('wp_insert_version');
5
+ if($databaseVersion != WP_INSERT_VERSION) {
6
+ do_action('wp_insert_activate_upgrade');
7
+ update_option('wp_insert_version', WP_INSERT_VERSION);
8
+ }
9
+ }
10
+
11
+ function wp_insert_read_and_destroy_old_option($name) {
12
+ $val = get_option($name, false);
13
+ delete_option($name);
14
+ if($val) {
15
+ return $val;
16
+ }
17
+ return null;
18
+ }
19
+ ?>
includes/common/admin-page.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_insert_admin_page($pageTitle, $sectionName, $optionName) { ?>
3
+ <div class="wrap wp-insert">
4
+ <a href="http://www.wp-insert.smartlogix.co.in"><img src="<?php echo WP_INSERT_URL; ?>/includes/common/images/logo.png" /></a>
5
+ <form method="post" action="options.php" name="wp_auto_commenter_form">
6
+ <?php settings_fields($optionName); ?>
7
+ <div id="poststuff" class="metabox-holder has-right-sidebar wp-insert-plugin">
8
+ <div id="side-info-column" class="inner-sidebar">
9
+ <p class="submit">
10
+ <input type="submit" name="Submit" class="button-primary submit" value="<?php esc_attr_e('Save Changes') ?>" />
11
+ </p>
12
+ </div>
13
+ <div id="post-body" class="has-sidebar">
14
+ <div id="post-body-content" class="has-sidebar-content">
15
+ <?php do_settings_sections($sectionName); ?>
16
+ </div>
17
+ </div>
18
+ <br class="clear"/>
19
+ </div>
20
+ <?php
21
+ wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
22
+ wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
23
+ ?>
24
+ <script type="text/javascript">
25
+ jQuery(document).ready( function($) {
26
+ jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
27
+ postboxes.add_postbox_toggles('<?php echo $sectionName; ?>');
28
+ });
29
+ </script>
30
+ </form>
31
+ </div>
32
+ <?php
33
+ }
34
+ ?>
includes/common/common.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once(dirname(__FILE__).'/activate-upgrade.php');
3
+ require_once(dirname(__FILE__).'/status.php');
4
+ require_once(dirname(__FILE__).'/countries.php');
5
+ require_once(dirname(__FILE__).'/menu.php');
6
+ require_once(dirname(__FILE__).'/styles.php');
7
+ require_once(dirname(__FILE__).'/admin-page.php');
8
+ require_once(dirname(__FILE__).'/controls.php');
9
+ require_once(dirname(__FILE__).'/rules.php');
10
+ require_once(dirname(__FILE__).'/jquery.php');
11
+ ?>
includes/common/controls.php ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_insert_get_control($type = 'text', $returnHTML = false, $name = '', $id='', $value = '', $label = '', $info = '', $data = null, $class = '', $useParagraph = true, $dummy = '') {
3
+ $control = array(
4
+ 'html' => '',
5
+ 'javascript' => ''
6
+ );
7
+ if($useParagraph) { $control['html'] .= '<p>'; }
8
+ switch($type) {
9
+ case 'hidden':
10
+ if($value == '') { $value = 0; }
11
+ if($class == '') { $class = 'input widefat'; }
12
+ if($label != '') { $control['html'] .= '<label for="'.$id.'">'.$label.' '.$value.'</label><br />'; }
13
+ $control['html'] .= '<input type="hidden" id="'.$id.'" name="'.$name.'" value="'.$value.'" class="'.$class.'" />';
14
+ break;
15
+ case 'text':
16
+ if($class == '') { $class = 'input widefat'; }
17
+ if($label != '') { $control['html'] .= '<label for="'.$id.'">'.$label.'</label><br />'; }
18
+ $control['html'] .= '<input type="text" id="'.$id.'" name="'.$name.'" value="'.$value.'" class="'.$class.'" />';
19
+ break;
20
+ case 'checkbox':
21
+ if($class == '') { $class = 'input'; }
22
+ $control['html'] .= '<input type="checkbox" id="'.$id.'" name="'.$name.'" value="1" class="'.$class.'" '.checked($value, 1, false).' />';
23
+ if($label != '') { $control['html'] .= '&nbsp;<label for="'.$id.'">'.$label.'</label>'; }
24
+ break;
25
+ case 'select':
26
+ if($class == '') { $class = 'input widefat'; }
27
+ if($label != '') { $control['html'] .= '<label for="'.$id.'">'.$label.'</label><br />'; }
28
+ $control['html'] .= '<select id="'.$id.'" name="'.$name.'" class="'.$class.'">';
29
+ if($data) {
30
+ foreach($data as $option) {
31
+ $control['html'] .= '<option value='.(($option['value'] == '')?$option['text']:$option['value']).' '.selected($value, (($option['value'] == '')?$option['text']:$option['value']), false).'>'.$option['text'].'</option>';
32
+ }
33
+ }
34
+ $control['html'] .= '</select>';
35
+ break;
36
+ case 'textarea':
37
+ if($class == '') { $class = 'input widefat'; }
38
+ if($label != '') { $control['html'] .= '<label for="'.$id.'">'.$label.'</label><br />'; }
39
+ $control['html'] .= '<textarea id="'.$id.'" name="'.$name.'" class="'.$class.'">'.$value.'</textarea>';
40
+ break;
41
+ case 'upload':
42
+ if($class == '') { $class = 'input widefat'; }
43
+ if($label != '') { $control['html'] .= '<label for="'.$id.'">'.$label.'</label><br />'; }
44
+ $control['html'] .= '<input type="text" id="'.$id.'" name="'.$name.'" value="'.$value.'" class="'.$class.'" style="width: 74%;" />';
45
+ $control['html'] .= '<input type="button" value="Upload Image" class="wp_insert_uploader_button" id="upload_image_button" style="width: 25%;" />';
46
+ break;
47
+ case 'nicedit':
48
+ if($class == '') { $class = 'input widefat'; }
49
+ if($label != '') { $control['html'] .= '<label for="'.$id.'">'.$label.'</label><br />'; }
50
+ $control['html'] .= '<textarea id="'.$id.'" name="'.$name.'" class="'.$class.'" cols="100" style="height: 250px;">'.$value.'</textarea>';
51
+ $control['javascript'] .= 'new nicEditor({maxHeight : 400, buttonList : ["fontSize","bold","italic","underline","left","center","right","justify","strikeThrough","subscript","superscript","indent","outdent","hr","image","forecolor","bgcolor","link","unlink","fontSize","fontFormat","xhtml"]} ).panelInstance("'.$id.'");';
52
+ break;
53
+ case 'tz-checkbox':
54
+ if($class == '') { $class = 'input betterCheckbox'; }
55
+ if($label != '') { $control['html'] .= '<label for="'.$id.'">'.$label.'</label><br />'; }
56
+ $control['html'] .= '<input type="checkbox" id="'.$id.'" name="'.$name.'" class="'.$class.'" value="1" '.checked($value, 1, false).' />';
57
+ $control['javascript'] .= 'jQuery("#'.$id.'").tzCheckbox({labels: ["Active", "Inactive"]});';
58
+ break;
59
+ case 'ip-checkbox':
60
+ if($class == '') { $class = 'input iphoneCheckbox'; }
61
+ if($label != '') { $control['html'] .= '<label for="'.$id.'">'.$label.'</label><br />'; }
62
+ $control['html'] .= '<input type="checkbox" id="'.$id.'" name="'.$name.'" class="'.$class.'" value="1" '.checked($value, 1, false).' />';
63
+ $control['javascript'] .= 'jQuery("#'.$id.'").iphoneStyle({checkedLabel: "Hide Ads", uncheckedLabel: "Show Ads", resizeContainer: false, resizeHandle: false});';
64
+ break;
65
+ case 'popup':
66
+ if($class == '') { $class = 'input narrowfat'; }
67
+ if($label != '') { $control['html'] .= '<label for="'.$id.'">'.$label.'</label><br />'; }
68
+ $control['html'] .= '<input type="text" id="'.$id.'" name="'.$name.'" value="'.$value.'" class="'.$class.'" />';
69
+ $control['html'] .= '<a id="'.$id.'_button" href="#"><img style="width: 16px; height: 16px; margin: 0 0 -3px 5px;" src="'.WP_INSERT_URL.'/includes/common/images/pointer.png" /></a>';
70
+ if($data) {
71
+ $control['javascript'] .= 'jQuery("#'.$id.'_button").click(function() {';
72
+ $control['javascript'] .= 'jQuery.colorbox({overlayClose: false, scrolling: false, transition: "elastic", innerWidth: "577px", innerHeight: "402px", iframe: true, href: "'.WP_INSERT_URL.'/includes/common/popups/'.$data['type'].'.php?data="+escape(jQuery("#'.$id.'").val())+"&target='.$id.'"});';
73
+ $control['javascript'] .= 'return false;';
74
+ $control['javascript'] .= '});';
75
+ }
76
+ break;
77
+ }
78
+ if($info != '') {
79
+ $control['html'] .= '<small style="float: right;">'.$info.'</small>';
80
+ }
81
+ if($useParagraph) { $control['html'] .= '</p>'; }
82
+ if($info != '') {
83
+ $control['html'] .= '<div class="clear"></div>';
84
+ }
85
+
86
+ if($returnHTML) {
87
+ return $control['html'];
88
+ } else {
89
+ return $control;
90
+ }
91
+ }
92
+
93
+ function wp_insert_get_vtabs($id, $args) {
94
+ $control = array(
95
+ 'html' => '',
96
+ 'javascript' => ''
97
+ );
98
+ $control['html'] .= '<div id="'.$id.'">';
99
+ $control['html'] .= '<div>';
100
+ $control['html'] .= '<ul>';
101
+ foreach($args as $tab) {
102
+ $control['html'] .= '<li><a href="#'.str_replace(array(' ', '-'), '_', strtolower($tab['title'])).'">'.$tab['title'].'</a></li>';
103
+ }
104
+ $control['html'] .= '</ul>';
105
+ $control['html'] .= '</div>';
106
+ $control['html'] .= '<div>';
107
+ foreach($args as $tab) {
108
+ $control['html'] .= '<div id="#'.str_replace(array(' ', '-'), '_', strtolower($tab['title'])).'">'.$tab['content'].'</div>';
109
+ }
110
+ $control['html'] .= '</div>';
111
+ $control['html'] .= '</div>';
112
+ $control['javascript'] .= 'jQuery("#'.$id.'").jVertTabs({equalHeights: false});';
113
+ return $control;
114
+ }
115
+
116
+ function wp_insert_get_table($args) {
117
+ $output = '<table'.(($args['id'] != '')?' id="'.$args['id'].'"':'').(($args['class'] != '')?' class="'.$args['class'].'"':'').(($args['style'] != '')?' style="'.$args['style'].'"':'').'>';
118
+ foreach($args['rows'] as $row) {
119
+ $output .= '<tr'.(($row['id'] != '')?' id="'.$row['id'].'"':'').(($row['class'] != '')?' class="'.$row['class'].'"':'').(($row['style'] != '')?' style="'.$row['style'].'"':'').'>';
120
+ foreach($row['cells'] as $cell) {
121
+ if($cell['type'] == '') { $cell['type'] = 'td'; }
122
+ $output .= '<'.$cell['type'].(($cell['colspan'] != '')?' colspan="'.$cell['colspan'].'"':'').(($cell['id'] != '')?' id="'.$cell['id'].'"':'').(($cell['class'] != '')?' class="'.$cell['class'].'"':'').(($cell['style'] != '')?' style="'.$cell['style'].'"':'').'>';
123
+ $output .= $cell['content'];
124
+ $output .= '</'.$cell['type'].'>';
125
+ }
126
+ $output .= '</tr>';
127
+ }
128
+ $output .= '</table>';
129
+ return $output;
130
+ }
131
+
132
+ function wp_insert_get_script_tag($content) {
133
+ $script = '';
134
+ if(is_array($content)) {
135
+ foreach($content as $control) {
136
+ $script .= $control['javascript'];
137
+ }
138
+ } else {
139
+ $script = $content;
140
+ }
141
+ $output = '<script type="text/javascript">';
142
+ $output .= 'jQuery(document).ready(function(){'.$script.'});';
143
+ $output .= '</script>';
144
+ return $output;
145
+ }
146
+ ?>
includes/common/countries.php ADDED
@@ -0,0 +1,269 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $wpInsertGeoLocation = 'DEFAULT';
3
+ function wp_insert_countries_init() {
4
+ global $wpInsertGeoLocation;
5
+ include(WP_INSERT_DIR.'/includes/common/geoip/geoip.inc');
6
+ $geoIP = geoip_open(WP_INSERT_DIR.'/includes/common/geoip/GeoIP.dat', GEOIP_MEMORY_CACHE);
7
+ $wpInsertGeoLocation = geoip_country_code_by_addr($geoIP, $_SERVER["REMOTE_ADDR"]);
8
+ geoip_close($geoIP);
9
+ }
10
+ add_action('init', 'wp_insert_countries_init');
11
+
12
+ function wp_insert_get_countries() {
13
+ $data = array(
14
+ array('value' => 'AP', 'text' => 'Asia/Pacific Region'),
15
+ array('value' => 'EU', 'text' => 'Europe'),
16
+ array('value' => 'AD', 'text' => 'Andorra'),
17
+ array('value' => 'AE', 'text' => 'United Arab Emirates'),
18
+ array('value' => 'AF', 'text' => 'Afghanistan'),
19
+ array('value' => 'AG', 'text' => 'Antigua and Barbuda'),
20
+ array('value' => 'AI', 'text' => 'Anguilla'),
21
+ array('value' => 'AL', 'text' => 'Albania'),
22
+ array('value' => 'AM', 'text' => 'Armenia'),
23
+ array('value' => 'AN', 'text' => 'Netherlands Antilles'),
24
+ array('value' => 'AO', 'text' => 'Angola'),
25
+ array('value' => 'AQ', 'text' => 'Antarctica'),
26
+ array('value' => 'AR', 'text' => 'Argentina'),
27
+ array('value' => 'AS', 'text' => 'American Samoa'),
28
+ array('value' => 'AT', 'text' => 'Austria'),
29
+ array('value' => 'AU', 'text' => 'Australia'),
30
+ array('value' => 'AW', 'text' => 'Aruba'),
31
+ array('value' => 'AZ', 'text' => 'Azerbaijan'),
32
+ array('value' => 'BA', 'text' => 'Bosnia and Herzegovina'),
33
+ array('value' => 'BB', 'text' => 'Barbados'),
34
+ array('value' => 'BD', 'text' => 'Bangladesh'),
35
+ array('value' => 'BE', 'text' => 'Belgium'),
36
+ array('value' => 'BF', 'text' => 'Burkina Faso'),
37
+ array('value' => 'BG', 'text' => 'Bulgaria'),
38
+ array('value' => 'BH', 'text' => 'Bahrain'),
39
+ array('value' => 'BI', 'text' => 'Burundi'),
40
+ array('value' => 'BJ', 'text' => 'Benin'),
41
+ array('value' => 'BM', 'text' => 'Bermuda'),
42
+ array('value' => 'BN', 'text' => 'Brunei Darussalam'),
43
+ array('value' => 'BO', 'text' => 'Bolivia'),
44
+ array('value' => 'BR', 'text' => 'Brazil'),
45
+ array('value' => 'BS', 'text' => 'Bahamas'),
46
+ array('value' => 'BT', 'text' => 'Bhutan'),
47
+ array('value' => 'BV', 'text' => 'Bouvet Island'),
48
+ array('value' => 'BW', 'text' => 'Botswana'),
49
+ array('value' => 'BY', 'text' => 'Belarus'),
50
+ array('value' => 'BZ', 'text' => 'Belize'),
51
+ array('value' => 'CA', 'text' => 'Canada'),
52
+ array('value' => 'CC', 'text' => 'Cocos (Keeling) Islands'),
53
+ array('value' => 'CD', 'text' => 'The Democratic Republic of the Congo'),
54
+ array('value' => 'CF', 'text' => 'Central African Republic'),
55
+ array('value' => 'CG', 'text' => 'Congo'),
56
+ array('value' => 'CH', 'text' => 'Switzerland'),
57
+ array('value' => 'CI', 'text' => 'Cote D\'Ivoire'),
58
+ array('value' => 'CK', 'text' => 'Cook Islands'),
59
+ array('value' => 'CL', 'text' => 'Chile'),
60
+ array('value' => 'CM', 'text' => 'Cameroon'),
61
+ array('value' => 'CN', 'text' => 'China'),
62
+ array('value' => 'CO', 'text' => 'Colombia'),
63
+ array('value' => 'CR', 'text' => 'Costa Rica'),
64
+ array('value' => 'CU', 'text' => 'Cuba'),
65
+ array('value' => 'CV', 'text' => 'Cape Verde'),
66
+ array('value' => 'CX', 'text' => 'Christmas Island'),
67
+ array('value' => 'CY', 'text' => 'Cyprus'),
68
+ array('value' => 'CZ', 'text' => 'Czech Republic'),
69
+ array('value' => 'DE', 'text' => 'Germany'),
70
+ array('value' => 'DJ', 'text' => 'Djibouti'),
71
+ array('value' => 'DK', 'text' => 'Denmark'),
72
+ array('value' => 'DM', 'text' => 'Dominica'),
73
+ array('value' => 'DO', 'text' => 'Dominican Republic'),
74
+ array('value' => 'DZ', 'text' => 'Algeria'),
75
+ array('value' => 'EC', 'text' => 'Ecuador'),
76
+ array('value' => 'EE', 'text' => 'Estonia'),
77
+ array('value' => 'EG', 'text' => 'Egypt'),
78
+ array('value' => 'EH', 'text' => 'Western Sahara'),
79
+ array('value' => 'ER', 'text' => 'Eritrea'),
80
+ array('value' => 'ES', 'text' => 'Spain'),
81
+ array('value' => 'ET', 'text' => 'Ethiopia'),
82
+ array('value' => 'FI', 'text' => 'Finland'),
83
+ array('value' => 'FJ', 'text' => 'Fiji'),
84
+ array('value' => 'FK', 'text' => 'Falkland Islands (Malvinas)'),
85
+ array('value' => 'FM', 'text' => 'Federated States of Micronesia'),
86
+ array('value' => 'FO', 'text' => 'Faroe Islands'),
87
+ array('value' => 'FR', 'text' => 'France'),
88
+ array('value' => 'FX', 'text' => 'France Metropolitan'),
89
+ array('value' => 'GA', 'text' => 'Gabon'),
90
+ array('value' => 'GB', 'text' => 'United Kingdom'),
91
+ array('value' => 'GD', 'text' => 'Grenada'),
92
+ array('value' => 'GE', 'text' => 'Georgia'),
93
+ array('value' => 'GF', 'text' => 'French Guiana'),
94
+ array('value' => 'GH', 'text' => 'Ghana'),
95
+ array('value' => 'GI', 'text' => 'Gibraltar'),
96
+ array('value' => 'GL', 'text' => 'Greenland'),
97
+ array('value' => 'GM', 'text' => 'Gambia'),
98
+ array('value' => 'GN', 'text' => 'Guinea'),
99
+ array('value' => 'GP', 'text' => 'Guadeloupe'),
100
+ array('value' => 'GQ', 'text' => 'Equatorial Guinea'),
101
+ array('value' => 'GR', 'text' => 'Greece'),
102
+ array('value' => 'GS', 'text' => 'South Georgia and the South Sandwich Islands'),
103
+ array('value' => 'GT', 'text' => 'Guatemala'),
104
+ array('value' => 'GU', 'text' => 'Guam'),
105
+ array('value' => 'GW', 'text' => 'Guinea-Bissau'),
106
+ array('value' => 'GY', 'text' => 'Guyana'),
107
+ array('value' => 'HK', 'text' => 'Hong Kong'),
108
+ array('value' => 'HM', 'text' => 'Heard Island and McDonald Islands'),
109
+ array('value' => 'HN', 'text' => 'Honduras'),
110
+ array('value' => 'HR', 'text' => 'Croatia'),
111
+ array('value' => 'HT', 'text' => 'Haiti'),
112
+ array('value' => 'HU', 'text' => 'Hungary'),
113
+ array('value' => 'ID', 'text' => 'Indonesia'),
114
+ array('value' => 'IE', 'text' => 'Ireland'),
115
+ array('value' => 'IL', 'text' => 'Israel'),
116
+ array('value' => 'IN', 'text' => 'India'),
117
+ array('value' => 'IO', 'text' => 'British Indian Ocean Territory'),
118
+ array('value' => 'IQ', 'text' => 'Iraq'),
119
+ array('value' => 'IR', 'text' => 'Islamic Republic of Iran'),
120
+ array('value' => 'IS', 'text' => 'Iceland'),
121
+ array('value' => 'IT', 'text' => 'Italy'),
122
+ array('value' => 'JM', 'text' => 'Jamaica'),
123
+ array('value' => 'JO', 'text' => 'Jordan'),
124
+ array('value' => 'JP', 'text' => 'Japan'),
125
+ array('value' => 'KE', 'text' => 'Kenya'),
126
+ array('value' => 'KG', 'text' => 'Kyrgyzstan'),
127
+ array('value' => 'KH', 'text' => 'Cambodia'),
128
+ array('value' => 'KI', 'text' => 'Kiribati'),
129
+ array('value' => 'KM', 'text' => 'Comoros'),
130
+ array('value' => 'KN', 'text' => 'Saint Kitts and Nevis'),
131
+ array('value' => 'KP', 'text' => 'Democratic People\'s Republic of Korea'),
132
+ array('value' => 'KR', 'text' => 'Republic of Korea'),
133
+ array('value' => 'KW', 'text' => 'Kuwait'),
134
+ array('value' => 'KY', 'text' => 'Cayman Islands'),
135
+ array('value' => 'KZ', 'text' => 'Kazakhstan'),
136
+ array('value' => 'LA', 'text' => 'Lao People\'s Democratic Republic'),
137
+ array('value' => 'LB', 'text' => 'Lebanon'),
138
+ array('value' => 'LC', 'text' => 'Saint Lucia'),
139
+ array('value' => 'LI', 'text' => 'Liechtenstein'),
140
+ array('value' => 'LK', 'text' => 'Sri Lanka'),
141
+ array('value' => 'LR', 'text' => 'Liberia'),
142
+ array('value' => 'LS', 'text' => 'Lesotho'),
143
+ array('value' => 'LT', 'text' => 'Lithuania'),
144
+ array('value' => 'LU', 'text' => 'Luxembourg'),
145
+ array('value' => 'LV', 'text' => 'Latvia'),
146
+ array('value' => 'LY', 'text' => 'Libyan Arab Jamahiriya'),
147
+ array('value' => 'MA', 'text' => 'Morocco'),
148
+ array('value' => 'MC', 'text' => 'Monaco'),
149
+ array('value' => 'MD', 'text' => 'Republic of Moldova'),
150
+ array('value' => 'MG', 'text' => 'Madagascar'),
151
+ array('value' => 'MH', 'text' => 'Marshall Islands'),
152
+ array('value' => 'MK', 'text' => 'Macedonia'),
153
+ array('value' => 'ML', 'text' => 'Mali'),
154
+ array('value' => 'MM', 'text' => 'Myanmar'),
155
+ array('value' => 'MN', 'text' => 'Mongolia'),
156
+ array('value' => 'MO', 'text' => 'Macau'),
157
+ array('value' => 'MP', 'text' => 'Northern Mariana Islands'),
158
+ array('value' => 'MQ', 'text' => 'Martinique'),
159
+ array('value' => 'MR', 'text' => 'Mauritania'),
160
+ array('value' => 'MS', 'text' => 'Montserrat'),
161
+ array('value' => 'MT', 'text' => 'Malta'),
162
+ array('value' => 'MU', 'text' => 'Mauritius'),
163
+ array('value' => 'MV', 'text' => 'Maldives'),
164
+ array('value' => 'MW', 'text' => 'Malawi'),
165
+ array('value' => 'MX', 'text' => 'Mexico'),
166
+ array('value' => 'MY', 'text' => 'Malaysia'),
167
+ array('value' => 'MZ', 'text' => 'Mozambique'),
168
+ array('value' => 'NA', 'text' => 'Namibia'),
169
+ array('value' => 'NC', 'text' => 'New Caledonia'),
170
+ array('value' => 'NE', 'text' => 'Niger'),
171
+ array('value' => 'NF', 'text' => 'Norfolk Island'),
172
+ array('value' => 'NG', 'text' => 'Nigeria'),
173
+ array('value' => 'NI', 'text' => 'Nicaragua'),
174
+ array('value' => 'NL', 'text' => 'Netherlands'),
175
+ array('value' => 'NO', 'text' => 'Norway'),
176
+ array('value' => 'NP', 'text' => 'Nepal'),
177
+ array('value' => 'NR', 'text' => 'Nauru'),
178
+ array('value' => 'NU', 'text' => 'Niue'),
179
+ array('value' => 'NZ', 'text' => 'New Zealand'),
180
+ array('value' => 'OM', 'text' => 'Oman'),
181
+ array('value' => 'PA', 'text' => 'Panama'),
182
+ array('value' => 'PE', 'text' => 'Peru'),
183
+ array('value' => 'PF', 'text' => 'French Polynesia'),
184
+ array('value' => 'PG', 'text' => 'Papua New Guinea'),
185
+ array('value' => 'PH', 'text' => 'Philippines'),
186
+ array('value' => 'PK', 'text' => 'Pakistan'),
187
+ array('value' => 'PL', 'text' => 'Poland'),
188
+ array('value' => 'PM', 'text' => 'Saint Pierre and Miquelon'),
189
+ array('value' => 'PN', 'text' => 'Pitcairn Islands'),
190
+ array('value' => 'PR', 'text' => 'Puerto Rico'),
191
+ array('value' => 'PS', 'text' => 'Palestinian Territory'),
192
+ array('value' => 'PT', 'text' => 'Portugal'),
193
+ array('value' => 'PW', 'text' => 'Palau'),
194
+ array('value' => 'PY', 'text' => 'Paraguay'),
195
+ array('value' => 'QA', 'text' => 'Qatar'),
196
+ array('value' => 'RE', 'text' => 'Reunion'),
197
+ array('value' => 'RO', 'text' => 'Romania'),
198
+ array('value' => 'RU', 'text' => 'Russian Federation'),
199
+ array('value' => 'RW', 'text' => 'Rwanda'),
200
+ array('value' => 'SA', 'text' => 'Saudi Arabia'),
201
+ array('value' => 'SB', 'text' => 'Solomon Islands'),
202
+ array('value' => 'SC', 'text' => 'Seychelles'),
203
+ array('value' => 'SD', 'text' => 'Sudan'),
204
+ array('value' => 'SE', 'text' => 'Sweden'),
205
+ array('value' => 'SG', 'text' => 'Singapore'),
206
+ array('value' => 'SH', 'text' => 'Saint Helena'),
207
+ array('value' => 'SI', 'text' => 'Slovenia'),
208
+ array('value' => 'SJ', 'text' => 'Svalbard and Jan Mayen'),
209
+ array('value' => 'SK', 'text' => 'Slovakia'),
210
+ array('value' => 'SL', 'text' => 'Sierra Leone'),
211
+ array('value' => 'SM', 'text' => 'San Marino'),
212
+ array('value' => 'SN', 'text' => 'Senegal'),
213
+ array('value' => 'SO', 'text' => 'Somalia'),
214
+ array('value' => 'SR', 'text' => 'Suriname'),
215
+ array('value' => 'ST', 'text' => 'Sao Tome and Principe'),
216
+ array('value' => 'SV', 'text' => 'El Salvador'),
217
+ array('value' => 'SY', 'text' => 'Syrian Arab Republic'),
218
+ array('value' => 'SZ', 'text' => 'Swaziland'),
219
+ array('value' => 'TC', 'text' => 'Turks and Caicos Islands'),
220
+ array('value' => 'TD', 'text' => 'Chad'),
221
+ array('value' => 'TF', 'text' => 'French Southern Territories'),
222
+ array('value' => 'TG', 'text' => 'Togo'),
223
+ array('value' => 'TH', 'text' => 'Thailand'),
224
+ array('value' => 'TJ', 'text' => 'Tajikistan'),
225
+ array('value' => 'TK', 'text' => 'Tokelau'),
226
+ array('value' => 'TM', 'text' => 'Turkmenistan'),
227
+ array('value' => 'TN', 'text' => 'Tunisia'),
228
+ array('value' => 'TO', 'text' => 'Tonga'),
229
+ array('value' => 'TL', 'text' => 'Timor-Leste'),
230
+ array('value' => 'TR', 'text' => 'Turkey'),
231
+ array('value' => 'TT', 'text' => 'Trinidad and Tobago'),
232
+ array('value' => 'TV', 'text' => 'Tuvalu'),
233
+ array('value' => 'TW', 'text' => 'Taiwan'),
234
+ array('value' => 'TZ', 'text' => 'United Republic of Tanzania'),
235
+ array('value' => 'UA', 'text' => 'Ukraine'),
236
+ array('value' => 'UG', 'text' => 'Uganda'),
237
+ array('value' => 'UM', 'text' => 'United States Minor Outlying Islands'),
238
+ array('value' => 'US', 'text' => 'United States'),
239
+ array('value' => 'UY', 'text' => 'Uruguay'),
240
+ array('value' => 'UZ', 'text' => 'Uzbekistan'),
241
+ array('value' => 'VA', 'text' => 'Holy See (Vatican City State)'),
242
+ array('value' => 'VC', 'text' => 'Saint Vincent and the Grenadines'),
243
+ array('value' => 'VE', 'text' => 'Venezuela'),
244
+ array('value' => 'VG', 'text' => 'British Virgin Islands'),
245
+ array('value' => 'VI', 'text' => 'U.S. Virgin Islands'),
246
+ array('value' => 'VN', 'text' => 'Vietnam'),
247
+ array('value' => 'VU', 'text' => 'Vanuatu'),
248
+ array('value' => 'WF', 'text' => 'Wallis and Futuna'),
249
+ array('value' => 'WS', 'text' => 'Samoa'),
250
+ array('value' => 'YE', 'text' => 'Yemen'),
251
+ array('value' => 'YT', 'text' => 'Mayotte'),
252
+ array('value' => 'RS', 'text' => 'Serbia'),
253
+ array('value' => 'ZA', 'text' => 'South Africa'),
254
+ array('value' => 'ZM', 'text' => 'Zambia'),
255
+ array('value' => 'ME', 'text' => 'Montenegro'),
256
+ array('value' => 'ZW', 'text' => 'Zimbabwe'),
257
+ array('value' => 'A1', 'text' => 'Anonymous Proxy'),
258
+ array('value' => 'A2', 'text' => 'Satellite Provider'),
259
+ array('value' => 'O1', 'text' => 'Other'),
260
+ array('value' => 'AX', 'text' => 'Aland Islands'),
261
+ array('value' => 'GG', 'text' => 'Guernsey'),
262
+ array('value' => 'IM', 'text' => 'Isle of Man'),
263
+ array('value' => 'JE', 'text' => 'Jersey'),
264
+ array('value' => 'BL', 'text' => 'Saint Barthelemy'),
265
+ array('value' => 'MF', 'text' => 'Saint Martin')
266
+ );
267
+ return $data;
268
+ }
269
+ ?>
includes/common/css/style.css ADDED
@@ -0,0 +1,419 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*ColorBox*/
2
+ #colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
3
+ #cboxOverlay{position:fixed; width:100%; height:100%;}
4
+ #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
5
+ #cboxContent{position:relative;}
6
+ #cboxLoadedContent{overflow:auto;}
7
+ #cboxTitle{margin:0;}
8
+ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
9
+ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
10
+ .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;}
11
+ .cboxIframe{width:100%; height:100%; display:block; border:0;}
12
+ #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box;}
13
+
14
+ #cboxOverlay{background:#000;}
15
+ #cboxTopLeft{width:21px; height:21px; background:url(../images/controls.png) no-repeat -101px 0;}
16
+ #cboxTopRight{width:21px; height:21px; background:url(../images/controls.png) no-repeat -130px 0;}
17
+ #cboxBottomLeft{width:21px; height:21px; background:url(../images/controls.png) no-repeat -101px -29px;}
18
+ #cboxBottomRight{width:21px; height:21px; background:url(../images/controls.png) no-repeat -130px -29px;}
19
+ #cboxMiddleLeft{width:21px; background:url(../images/controls.png) left top repeat-y;}
20
+ #cboxMiddleRight{width:21px; background:url(../images/controls.png) right top repeat-y;}
21
+ #cboxTopCenter{height:21px; background:url(../images/border.png) 0 0 repeat-x;}
22
+ #cboxBottomCenter{height:21px; background:url(../images/border.png) 0 -29px repeat-x;}
23
+ #cboxContent{background:#fff; overflow:hidden;}
24
+ .cboxIframe{background:#fff;}
25
+ #cboxError{padding:50px; border:1px solid #ccc;}
26
+ #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
27
+ #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
28
+ #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
29
+ #cboxPrevious{position:absolute; bottom:0; left:0; background:url(../images/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;}
30
+ #cboxPrevious:hover{background-position:-75px -25px;}
31
+ #cboxNext{position:absolute; bottom:0; left:27px; background:url(../images/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;}
32
+ #cboxNext:hover{background-position:-50px -25px;}
33
+ #cboxLoadingOverlay{background:url(../images/loading_background.png) no-repeat center center;}
34
+ #cboxLoadingGraphic{background:url(../images/loading.gif) no-repeat center center;}
35
+ #cboxClose{position:absolute; bottom:0; right:0; background:url(../images/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px; display: none;}
36
+ #cboxClose:hover{background-position:-25px -25px;}
37
+
38
+ .cboxIE #cboxTopLeft, .cboxIE #cboxTopCenter, .cboxIE #cboxTopRight, .cboxIE #cboxBottomLeft, .cboxIE #cboxBottomCenter, .cboxIE #cboxBottomRight, .cboxIE #cboxMiddleLeft, .cboxIE #cboxMiddleRight {
39
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
40
+ }
41
+
42
+ /*Jquery Better Checkboxes*/
43
+ .tzCheckBox {
44
+ background: url('../images/better_checkbox.png') no-repeat right bottom;
45
+ display: inline-block;
46
+ min-width: 60px;
47
+ height: 33px;
48
+ white-space: nowrap;
49
+ position: relative;
50
+ cursor: pointer;
51
+ margin-left: 14px;
52
+ }
53
+
54
+ .tzCheckBox.checked {
55
+ background-position: top left;
56
+ margin: 0 14px 0 0;
57
+ }
58
+
59
+ .tzCheckBox .tzCBContent {
60
+ color: white;
61
+ line-height: 31px;
62
+ padding-right: 38px;
63
+ text-align: right;
64
+ }
65
+
66
+ .tzCheckBox.checked .tzCBContent {
67
+ text-align: left;
68
+ padding: 0 0 0 38px;
69
+ }
70
+
71
+ .tzCBPart {
72
+ background: url('../images/better_checkbox.png') no-repeat left bottom;
73
+ width: 14px;
74
+ position: absolute;
75
+ top: 0;
76
+ left: -14px;
77
+ height: 33px;
78
+ overflow: hidden;
79
+ }
80
+
81
+ .tzCheckBox.checked .tzCBPart {
82
+ background-position: top right;
83
+ left: auto;
84
+ right: -14px;
85
+ }
86
+
87
+ /*Jquery Vetical Tabs*/
88
+ .vtabs {
89
+ border: 1px solid #FFFFFF;
90
+ margin: 10px 0 0;
91
+ position: relative;
92
+ }
93
+
94
+ .vtabs .vtabs-tab-column {
95
+ position: absolute; left: 0; margin: 0; width: 120px; min-width: 120px;
96
+ }
97
+
98
+ .vtabs .vtabs-tab-column ul {
99
+ list-style: none;
100
+ margin: 0px;
101
+ padding: 0px;
102
+ }
103
+
104
+ .vtabs .vtabs-tab-column ul li.open, .vtabs .vtabs-tab-column ul li.closed {
105
+ background-color: #ffffff;
106
+ margin: 0 0 3px;
107
+ min-height: 20px;
108
+ padding: 4px 5px 1px 7px;
109
+ z-index: 10;
110
+ /* round corners do not work in IE */
111
+ -moz-border-radius-topleft: 3px;
112
+ -moz-border-radius-bottomleft: 3px;
113
+ -webkit-border-top-left-radius: 3px;
114
+ -webkit-border-bottom-left-radius: 3px;
115
+ border-top: 1px solid #999999;
116
+ border-bottom: 1px solid #999999;
117
+ border-left: 1px solid #999999;
118
+ }
119
+
120
+ .vtabs .vtabs-tab-column ul li.closed {
121
+ background-color: #bbbbbb;
122
+ border-right: 1px solid #777777;
123
+ background-image: url('../images/ClosedTabBackground.png');
124
+ background-repeat:repeat-x;
125
+ }
126
+
127
+ .vtabs .vtabs-tab-column ul li:hover {
128
+ cursor: pointer;
129
+ }
130
+
131
+ .vtabs .vtabs-tab-column ul li a.open, .vtabs .vtabs-tab-column ul li a.closed {
132
+ font-weight: bold;
133
+ margin: 0px;
134
+ padding: 0px;
135
+ text-decoration: none;
136
+ }
137
+
138
+ .vtabs .vtabs-content-column {
139
+ padding: 0px;
140
+ margin: 0px;
141
+ }
142
+
143
+ .vtabs .vtabs-content-column .vtabs-content-panel {
144
+ background-color: #ffffff;
145
+ padding-left: 7px;
146
+ padding-right: 7px;
147
+ padding-top: 3px;
148
+ padding-bottom: 3px;
149
+ margin: 0px;
150
+ -moz-border-radius-topright: 3px;
151
+ -moz-border-radius-bottomright: 3px;
152
+ -moz-border-radius-bottomleft: 3px;
153
+ -webkit-border-top-right-radius: 3px;
154
+ -webkit-border-bottom-right-radius: 3px;
155
+ -webkit-border-bottom-left-radius: 3px;
156
+ border-top: 1px solid #999999;
157
+ border-bottom: 1px solid #999999;
158
+ border-right: 1px solid #999999;
159
+ border-left: 1px solid #999999;
160
+ }
161
+
162
+ .vtabs-content-panel textarea, .wp-insert textarea {
163
+ width: 100%;
164
+ height: 150px;
165
+ }
166
+
167
+ .vtabs-content-panel p {
168
+ margin: 5px 0 15px !important;
169
+ }
170
+ /*IOS CheckBox*/
171
+ div.iPhoneCheckContainer {
172
+ width: 129px;
173
+ }
174
+
175
+ .iPhoneCheckContainer {
176
+ position: relative;
177
+ height: 27px;
178
+ cursor: pointer;
179
+ overflow: hidden;
180
+ }
181
+
182
+ .iPhoneCheckContainer input {
183
+ position: absolute;
184
+ top: 5px;
185
+ left: 30px;
186
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
187
+ opacity: 0;
188
+ }
189
+
190
+ .iPhoneCheckContainer label {
191
+ white-space: nowrap;
192
+ font-size: 10px;
193
+ line-height: 17px;
194
+ font-weight: bold;
195
+ font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
196
+ cursor: pointer;
197
+ display: block;
198
+ height: 27px;
199
+ position: absolute;
200
+ width: auto;
201
+ top: 0;
202
+ padding-top: 5px;
203
+ overflow: hidden;
204
+ }
205
+
206
+ .iPhoneCheckContainer, .iPhoneCheckContainer label {
207
+ user-select: none;
208
+ -moz-user-select: none;
209
+ -khtml-user-select: none;
210
+ }
211
+
212
+ .iPhoneCheckDisabled {
213
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50);
214
+ opacity: 0.5;
215
+ }
216
+
217
+ label.iPhoneCheckLabelOn {
218
+ color: white;
219
+ background: url('../images/iphone_on.png') no-repeat;
220
+ text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.6);
221
+ left: 0;
222
+ padding-top: 5px;+
223
+ }
224
+
225
+ label.iPhoneCheckLabelOn span {
226
+ padding-left: 8px;
227
+ }
228
+ label.iPhoneCheckLabelOff {
229
+ color: #8b8b8b;
230
+ background: url('../images/iphone_off.png') no-repeat right 0;
231
+ text-shadow: 0px 0px 2px rgba(255, 255, 255, 0.6);
232
+ text-align: right;
233
+ right: 0;
234
+ }
235
+
236
+ label.iPhoneCheckLabelOff span {
237
+ padding-right: 8px;
238
+ }
239
+
240
+ .iPhoneCheckHandle {
241
+ display: block;
242
+ height: 27px;
243
+ cursor: pointer;
244
+ position: absolute;
245
+ top: 0;
246
+ left: 0;
247
+ width: 0;
248
+ background: url('../images/iphone_slider_left.png') no-repeat;
249
+ padding-left: 3px;
250
+ }
251
+
252
+ .iPhoneCheckHandleRight {
253
+ height: 100%;
254
+ width: 100%;
255
+ padding-right: 3px;
256
+ background: url('../images/iphone_slider_right.png') no-repeat right 0;
257
+ }
258
+
259
+ .iPhoneCheckHandleCenter {
260
+ height: 100%;
261
+ width: 100%;
262
+ background: url('../images/iphone_slider_center.png');
263
+ }
264
+
265
+ .iOSCheckContainer {
266
+ position: relative;
267
+ height: 27px;
268
+ cursor: pointer;
269
+ overflow: hidden;
270
+ }
271
+
272
+ .iOSCheckContainer input {
273
+ position: absolute;
274
+ top: 5px;
275
+ left: 30px;
276
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
277
+ opacity: 0;
278
+ }
279
+
280
+ .iOSCheckContainer label {
281
+ white-space: nowrap;
282
+ font-size: 17px;
283
+ line-height: 17px;
284
+ font-weight: bold;
285
+ font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
286
+ cursor: pointer;
287
+ display: block;
288
+ height: 27px;
289
+ position: absolute;
290
+ width: auto;
291
+ top: 0;
292
+ padding-top: 5px;
293
+ overflow: hidden;
294
+ }
295
+
296
+ .iOSCheckContainer, .iOSCheckContainer label {
297
+ user-select: none;
298
+ -moz-user-select: none;
299
+ -khtml-user-select: none;
300
+ }
301
+
302
+ .iOSCheckDisabled {
303
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50);
304
+ opacity: 0.5;
305
+ }
306
+
307
+ label.iOSCheckLabelOn {
308
+ color: white;
309
+ background: url('../images/iphone_on.png') no-repeat;
310
+ text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.6);
311
+ left: 0;
312
+ padding-top: 5px;
313
+ }
314
+
315
+ label.iOSCheckLabelOn span {
316
+ padding-left: 8px;
317
+ }
318
+
319
+ label.iOSCheckLabelOff {
320
+ color: #8b8b8b;
321
+ background: url('../images/iphone_off.png') no-repeat right 0;
322
+ text-shadow: 0px 0px 2px rgba(255, 255, 255, 0.6);
323
+ text-align: right;
324
+ right: 0;
325
+ }
326
+
327
+ label.iOSCheckLabelOff span {
328
+ padding-right: 8px;
329
+ }
330
+
331
+ .iOSCheckHandle {
332
+ display: block;
333
+ height: 27px;
334
+ cursor: pointer;
335
+ position: absolute;
336
+ top: 0;
337
+ left: 0;
338
+ width: 0;
339
+ background: url('../images/iphone_slider_left.png') no-repeat;
340
+ padding-left: 3px;
341
+ }
342
+
343
+ .iOSCheckHandleRight {
344
+ height: 100%;
345
+ width: 100%;
346
+ padding-right: 3px;
347
+ background: url('../images/iphone_slider_right.png') no-repeat right 0;
348
+ }
349
+
350
+ .iOSCheckHandleCenter {
351
+ height: 100%;
352
+ width: 100%;
353
+ background: url('../images/iphone_slider_center.png');
354
+ }
355
+
356
+ /* Multiselect*/
357
+ .multiselect { height: 360px; width: 560px; }
358
+ .ui-multiselect { border: solid 1px; font-size: 0.8em; margin-bottom: 10px; }
359
+ .ui-multiselect ul { -moz-user-select: none; }
360
+ .ui-multiselect li { margin: 0; padding: 0; cursor: default; line-height: 20px; height: 20px; font-size: 11px; list-style: none; }
361
+ .ui-multiselect li a { color: #999; text-decoration: none; padding: 0; display: block; float: left; cursor: pointer;}
362
+ .ui-multiselect li.ui-draggable-dragging { padding-left: 10px; }
363
+
364
+ .ui-multiselect div.selected { position: relative; padding: 0; margin: 0; border: 0; float:left; }
365
+ .ui-multiselect ul.selected { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; position: relative; width: 100%; }
366
+ .ui-multiselect ul.selected li { }
367
+
368
+ .ui-multiselect div.available { position: relative; padding: 0; margin: 0; border: 0; float:left; border-left: 1px solid; }
369
+ .ui-multiselect ul.available { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; width: 100%; }
370
+ .ui-multiselect ul.available li { padding-left: 10px; }
371
+
372
+ .ui-multiselect .ui-state-default { border: none; margin-bottom: 1px; position: relative; padding-left: 20px;}
373
+ .ui-multiselect .ui-state-hover { border: none; }
374
+ .ui-multiselect .ui-widget-header {border: none; font-size: 11px; margin-bottom: 1px;}
375
+
376
+ .ui-multiselect .add-all { float: right; padding: 7px;}
377
+ .ui-multiselect .remove-all { float: right; padding: 7px;}
378
+ .ui-multiselect .search { float: left; padding: 4px;}
379
+ .ui-multiselect .count { float: left; padding: 7px;}
380
+
381
+ .ui-multiselect li span.ui-icon-arrowthick-2-n-s { position: absolute; left: 2px; }
382
+ .ui-multiselect li a.action { position: absolute; right: 2px; top: 2px; }
383
+
384
+ .ui-multiselect input.search { height: 14px; padding: 1px; opacity: 0.5; margin: 4px; width: 100px; }
385
+
386
+ /*Admin Page*/
387
+ .wp-insert .countryCode {
388
+ margin: 5px 0 0;
389
+ }
390
+
391
+ .wp-insert input.submit {
392
+ background: #21759B;
393
+ padding: 10px 0;
394
+ width: 100%;
395
+ }
396
+
397
+ .wp-insert .rules {
398
+ margin: 10px 0;
399
+ }
400
+
401
+ .wp-insert .rules td {
402
+ font-size: 10px;
403
+ }
404
+
405
+ .wp-insert .codeSnippet code {
406
+ display: block;
407
+ font-size: 16px;
408
+ padding: 10px;
409
+ vertical-align: middle;
410
+ }
411
+
412
+ .wp-insert .nicEdit-main ul {
413
+ margin: 10px 0;
414
+ padding: 10px 10px 10px 25px;
415
+ }
416
+
417
+ .wp-insert .nicEdit-main ul li {
418
+ list-style: disc;
419
+ }
includes/common/geoip/GeoIP.dat ADDED
Binary file
includes/common/geoip/LICENSE.txt ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ There are two licenses, one for the C library software, and one for
2
+ the database.
3
+
4
+ SOFTWARE LICENSE (C library)
5
+
6
+ The GeoIP C Library is licensed under the LGPL. For details see
7
+ the COPYING file.
8
+
9
+ OPEN DATA LICENSE (GeoLite Country and GeoLite City databases)
10
+
11
+ Copyright (c) 2008 MaxMind, Inc. All Rights Reserved.
12
+
13
+ All advertising materials and documentation mentioning features or use of
14
+ this database must display the following acknowledgment:
15
+ "This product includes GeoLite data created by MaxMind, available from
16
+ http://maxmind.com/"
17
+
18
+ Redistribution and use with or without modification, are permitted provided
19
+ that the following conditions are met:
20
+ 1. Redistributions must retain the above copyright notice, this list of
21
+ conditions and the following disclaimer in the documentation and/or other
22
+ materials provided with the distribution.
23
+ 2. All advertising materials and documentation mentioning features or use of
24
+ this database must display the following acknowledgement:
25
+ "This product includes GeoLite data created by MaxMind, available from
26
+ http://maxmind.com/"
27
+ 3. "MaxMind" may not be used to endorse or promote products derived from this
28
+ database without specific prior written permission.
29
+
30
+ THIS DATABASE IS PROVIDED BY MAXMIND, INC ``AS IS'' AND ANY
31
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
32
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
33
+ DISCLAIMED. IN NO EVENT SHALL MAXMIND BE LIABLE FOR ANY
34
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
35
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
36
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
37
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
39
+ DATABASE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
includes/common/geoip/geoip.inc ADDED
@@ -0,0 +1,726 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
3
+ /* geoip.inc
4
+ *
5
+ * Copyright (C) 2007 MaxMind LLC
6
+ *
7
+ * This library is free software; you can redistribute it and/or
8
+ * modify it under the terms of the GNU Lesser General Public
9
+ * License as published by the Free Software Foundation; either
10
+ * version 2.1 of the License, or (at your option) any later version.
11
+ *
12
+ * This library is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ * Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public
18
+ * License along with this library; if not, write to the Free Software
19
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
+ */
21
+
22
+ define("GEOIP_COUNTRY_BEGIN", 16776960);
23
+ define("GEOIP_STATE_BEGIN_REV0", 16700000);
24
+ define("GEOIP_STATE_BEGIN_REV1", 16000000);
25
+ define("GEOIP_STANDARD", 0);
26
+ define("GEOIP_MEMORY_CACHE", 1);
27
+ define("GEOIP_SHARED_MEMORY", 2);
28
+ define("STRUCTURE_INFO_MAX_SIZE", 20);
29
+ define("DATABASE_INFO_MAX_SIZE", 100);
30
+ define("GEOIP_COUNTRY_EDITION", 106);
31
+ define("GEOIP_PROXY_EDITION", 8);
32
+ define("GEOIP_ASNUM_EDITION", 9);
33
+ define("GEOIP_NETSPEED_EDITION", 10);
34
+ define("GEOIP_REGION_EDITION_REV0", 112);
35
+ define("GEOIP_REGION_EDITION_REV1", 3);
36
+ define("GEOIP_CITY_EDITION_REV0", 111);
37
+ define("GEOIP_CITY_EDITION_REV1", 2);
38
+ define("GEOIP_ORG_EDITION", 110);
39
+ define("GEOIP_ISP_EDITION", 4);
40
+ define("SEGMENT_RECORD_LENGTH", 3);
41
+ define("STANDARD_RECORD_LENGTH", 3);
42
+ define("ORG_RECORD_LENGTH", 4);
43
+ define("MAX_RECORD_LENGTH", 4);
44
+ define("MAX_ORG_RECORD_LENGTH", 300);
45
+ define("GEOIP_SHM_KEY", 0x4f415401);
46
+ define("US_OFFSET", 1);
47
+ define("CANADA_OFFSET", 677);
48
+ define("WORLD_OFFSET", 1353);
49
+ define("FIPS_RANGE", 360);
50
+ define("GEOIP_UNKNOWN_SPEED", 0);
51
+ define("GEOIP_DIALUP_SPEED", 1);
52
+ define("GEOIP_CABLEDSL_SPEED", 2);
53
+ define("GEOIP_CORPORATE_SPEED", 3);
54
+ define("GEOIP_DOMAIN_EDITION", 11);
55
+ define("GEOIP_COUNTRY_EDITION_V6", 12);
56
+ define("GEOIP_LOCATIONA_EDITION", 13);
57
+ define("GEOIP_ACCURACYRADIUS_EDITION", 14);
58
+ define("GEOIP_CITYCOMBINED_EDITION", 15);
59
+ define("GEOIP_CITY_EDITION_REV1_V6", 30);
60
+ define("GEOIP_CITY_EDITION_REV0_V6",31);
61
+ define("GEOIP_NETSPEED_EDITION_REV1",32);
62
+ define("GEOIP_NETSPEED_EDITION_REV1_V6",33);
63
+ define("GEOIP_USERTYPE_EDITION",28);
64
+ define("GEOIP_USERTYPE_EDITION_V6",29);
65
+ define("GEOIP_ASNUM_EDITION_V6",21);
66
+ define("GEOIP_ISP_EDITION_V6",22);
67
+ define("GEOIP_ORG_EDITION_V6",23);
68
+ define("GEOIP_DOMAIN_EDITION_V6",24);
69
+
70
+ define("CITYCOMBINED_FIXED_RECORD", 7 );
71
+
72
+ class GeoIP {
73
+ var $flags;
74
+ var $filehandle;
75
+ var $memory_buffer;
76
+ var $databaseType;
77
+ var $databaseSegments;
78
+ var $record_length;
79
+ var $shmid;
80
+ var $GEOIP_COUNTRY_CODE_TO_NUMBER = array(
81
+ "" => 0, "AP" => 1, "EU" => 2, "AD" => 3, "AE" => 4, "AF" => 5,
82
+ "AG" => 6, "AI" => 7, "AL" => 8, "AM" => 9, "AN" => 10, "AO" => 11,
83
+ "AQ" => 12, "AR" => 13, "AS" => 14, "AT" => 15, "AU" => 16, "AW" => 17,
84
+ "AZ" => 18, "BA" => 19, "BB" => 20, "BD" => 21, "BE" => 22, "BF" => 23,
85
+ "BG" => 24, "BH" => 25, "BI" => 26, "BJ" => 27, "BM" => 28, "BN" => 29,
86
+ "BO" => 30, "BR" => 31, "BS" => 32, "BT" => 33, "BV" => 34, "BW" => 35,
87
+ "BY" => 36, "BZ" => 37, "CA" => 38, "CC" => 39, "CD" => 40, "CF" => 41,
88
+ "CG" => 42, "CH" => 43, "CI" => 44, "CK" => 45, "CL" => 46, "CM" => 47,
89
+ "CN" => 48, "CO" => 49, "CR" => 50, "CU" => 51, "CV" => 52, "CX" => 53,
90
+ "CY" => 54, "CZ" => 55, "DE" => 56, "DJ" => 57, "DK" => 58, "DM" => 59,
91
+ "DO" => 60, "DZ" => 61, "EC" => 62, "EE" => 63, "EG" => 64, "EH" => 65,
92
+ "ER" => 66, "ES" => 67, "ET" => 68, "FI" => 69, "FJ" => 70, "FK" => 71,
93
+ "FM" => 72, "FO" => 73, "FR" => 74, "FX" => 75, "GA" => 76, "GB" => 77,
94
+ "GD" => 78, "GE" => 79, "GF" => 80, "GH" => 81, "GI" => 82, "GL" => 83,
95
+ "GM" => 84, "GN" => 85, "GP" => 86, "GQ" => 87, "GR" => 88, "GS" => 89,
96
+ "GT" => 90, "GU" => 91, "GW" => 92, "GY" => 93, "HK" => 94, "HM" => 95,
97
+ "HN" => 96, "HR" => 97, "HT" => 98, "HU" => 99, "ID" => 100, "IE" => 101,
98
+ "IL" => 102, "IN" => 103, "IO" => 104, "IQ" => 105, "IR" => 106, "IS" => 107,
99
+ "IT" => 108, "JM" => 109, "JO" => 110, "JP" => 111, "KE" => 112, "KG" => 113,
100
+ "KH" => 114, "KI" => 115, "KM" => 116, "KN" => 117, "KP" => 118, "KR" => 119,
101
+ "KW" => 120, "KY" => 121, "KZ" => 122, "LA" => 123, "LB" => 124, "LC" => 125,
102
+ "LI" => 126, "LK" => 127, "LR" => 128, "LS" => 129, "LT" => 130, "LU" => 131,
103
+ "LV" => 132, "LY" => 133, "MA" => 134, "MC" => 135, "MD" => 136, "MG" => 137,
104
+ "MH" => 138, "MK" => 139, "ML" => 140, "MM" => 141, "MN" => 142, "MO" => 143,
105
+ "MP" => 144, "MQ" => 145, "MR" => 146, "MS" => 147, "MT" => 148, "MU" => 149,
106
+ "MV" => 150, "MW" => 151, "MX" => 152, "MY" => 153, "MZ" => 154, "NA" => 155,
107
+ "NC" => 156, "NE" => 157, "NF" => 158, "NG" => 159, "NI" => 160, "NL" => 161,
108
+ "NO" => 162, "NP" => 163, "NR" => 164, "NU" => 165, "NZ" => 166, "OM" => 167,
109
+ "PA" => 168, "PE" => 169, "PF" => 170, "PG" => 171, "PH" => 172, "PK" => 173,
110
+ "PL" => 174, "PM" => 175, "PN" => 176, "PR" => 177, "PS" => 178, "PT" => 179,
111
+ "PW" => 180, "PY" => 181, "QA" => 182, "RE" => 183, "RO" => 184, "RU" => 185,
112
+ "RW" => 186, "SA" => 187, "SB" => 188, "SC" => 189, "SD" => 190, "SE" => 191,
113
+ "SG" => 192, "SH" => 193, "SI" => 194, "SJ" => 195, "SK" => 196, "SL" => 197,
114
+ "SM" => 198, "SN" => 199, "SO" => 200, "SR" => 201, "ST" => 202, "SV" => 203,
115
+ "SY" => 204, "SZ" => 205, "TC" => 206, "TD" => 207, "TF" => 208, "TG" => 209,
116
+ "TH" => 210, "TJ" => 211, "TK" => 212, "TM" => 213, "TN" => 214, "TO" => 215,
117
+ "TL" => 216, "TR" => 217, "TT" => 218, "TV" => 219, "TW" => 220, "TZ" => 221,
118
+ "UA" => 222, "UG" => 223, "UM" => 224, "US" => 225, "UY" => 226, "UZ" => 227,
119
+ "VA" => 228, "VC" => 229, "VE" => 230, "VG" => 231, "VI" => 232, "VN" => 233,
120
+ "VU" => 234, "WF" => 235, "WS" => 236, "YE" => 237, "YT" => 238, "RS" => 239,
121
+ "ZA" => 240, "ZM" => 241, "ME" => 242, "ZW" => 243, "A1" => 244, "A2" => 245,
122
+ "O1" => 246, "AX" => 247, "GG" => 248, "IM" => 249, "JE" => 250, "BL" => 251,
123
+ "MF" => 252
124
+ );
125
+ var $GEOIP_COUNTRY_CODES = array(
126
+ "", "AP", "EU", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ",
127
+ "AR", "AS", "AT", "AU", "AW", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH",
128
+ "BI", "BJ", "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA",
129
+ "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU",
130
+ "CV", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG",
131
+ "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "FX", "GA", "GB",
132
+ "GD", "GE", "GF", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT",
133
+ "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IN",
134
+ "IO", "IQ", "IR", "IS", "IT", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM",
135
+ "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS",
136
+ "LT", "LU", "LV", "LY", "MA", "MC", "MD", "MG", "MH", "MK", "ML", "MM", "MN",
137
+ "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA",
138
+ "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA",
139
+ "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY",
140
+ "QA", "RE", "RO", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI",
141
+ "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD",
142
+ "TF", "TG", "TH", "TJ", "TK", "TM", "TN", "TO", "TL", "TR", "TT", "TV", "TW",
143
+ "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN",
144
+ "VU", "WF", "WS", "YE", "YT", "RS", "ZA", "ZM", "ME", "ZW", "A1", "A2", "O1",
145
+ "AX", "GG", "IM", "JE", "BL", "MF"
146
+ );
147
+ var $GEOIP_COUNTRY_CODES3 = array(
148
+ "","AP","EU","AND","ARE","AFG","ATG","AIA","ALB","ARM","ANT","AGO","ATA","ARG",
149
+ "ASM","AUT","AUS","ABW","AZE","BIH","BRB","BGD","BEL","BFA","BGR","BHR","BDI",
150
+ "BEN","BMU","BRN","BOL","BRA","BHS","BTN","BVT","BWA","BLR","BLZ","CAN","CCK",
151
+ "COD","CAF","COG","CHE","CIV","COK","CHL","CMR","CHN","COL","CRI","CUB","CPV",
152
+ "CXR","CYP","CZE","DEU","DJI","DNK","DMA","DOM","DZA","ECU","EST","EGY","ESH",
153
+ "ERI","ESP","ETH","FIN","FJI","FLK","FSM","FRO","FRA","FX","GAB","GBR","GRD",
154
+ "GEO","GUF","GHA","GIB","GRL","GMB","GIN","GLP","GNQ","GRC","SGS","GTM","GUM",
155
+ "GNB","GUY","HKG","HMD","HND","HRV","HTI","HUN","IDN","IRL","ISR","IND","IOT",
156
+ "IRQ","IRN","ISL","ITA","JAM","JOR","JPN","KEN","KGZ","KHM","KIR","COM","KNA",
157
+ "PRK","KOR","KWT","CYM","KAZ","LAO","LBN","LCA","LIE","LKA","LBR","LSO","LTU",
158
+ "LUX","LVA","LBY","MAR","MCO","MDA","MDG","MHL","MKD","MLI","MMR","MNG","MAC",
159
+ "MNP","MTQ","MRT","MSR","MLT","MUS","MDV","MWI","MEX","MYS","MOZ","NAM","NCL",
160
+ "NER","NFK","NGA","NIC","NLD","NOR","NPL","NRU","NIU","NZL","OMN","PAN","PER",
161
+ "PYF","PNG","PHL","PAK","POL","SPM","PCN","PRI","PSE","PRT","PLW","PRY","QAT",
162
+ "REU","ROU","RUS","RWA","SAU","SLB","SYC","SDN","SWE","SGP","SHN","SVN","SJM",
163
+ "SVK","SLE","SMR","SEN","SOM","SUR","STP","SLV","SYR","SWZ","TCA","TCD","ATF",
164
+ "TGO","THA","TJK","TKL","TKM","TUN","TON","TLS","TUR","TTO","TUV","TWN","TZA",
165
+ "UKR","UGA","UMI","USA","URY","UZB","VAT","VCT","VEN","VGB","VIR","VNM","VUT",
166
+ "WLF","WSM","YEM","MYT","SRB","ZAF","ZMB","MNE","ZWE","A1","A2","O1",
167
+ "ALA","GGY","IMN","JEY","BLM","MAF"
168
+ );
169
+ var $GEOIP_COUNTRY_NAMES = array(
170
+ "", "Asia/Pacific Region", "Europe", "Andorra", "United Arab Emirates",
171
+ "Afghanistan", "Antigua and Barbuda", "Anguilla", "Albania", "Armenia",
172
+ "Netherlands Antilles", "Angola", "Antarctica", "Argentina", "American Samoa",
173
+ "Austria", "Australia", "Aruba", "Azerbaijan", "Bosnia and Herzegovina",
174
+ "Barbados", "Bangladesh", "Belgium", "Burkina Faso", "Bulgaria", "Bahrain",
175
+ "Burundi", "Benin", "Bermuda", "Brunei Darussalam", "Bolivia", "Brazil",
176
+ "Bahamas", "Bhutan", "Bouvet Island", "Botswana", "Belarus", "Belize",
177
+ "Canada", "Cocos (Keeling) Islands", "Congo, The Democratic Republic of the",
178
+ "Central African Republic", "Congo", "Switzerland", "Cote D'Ivoire", "Cook Islands",
179
+ "Chile", "Cameroon", "China", "Colombia", "Costa Rica", "Cuba", "Cape Verde",
180
+ "Christmas Island", "Cyprus", "Czech Republic", "Germany", "Djibouti",
181
+ "Denmark", "Dominica", "Dominican Republic", "Algeria", "Ecuador", "Estonia",
182
+ "Egypt", "Western Sahara", "Eritrea", "Spain", "Ethiopia", "Finland", "Fiji",
183
+ "Falkland Islands (Malvinas)", "Micronesia, Federated States of", "Faroe Islands",
184
+ "France", "France, Metropolitan", "Gabon", "United Kingdom",
185
+ "Grenada", "Georgia", "French Guiana", "Ghana", "Gibraltar", "Greenland",
186
+ "Gambia", "Guinea", "Guadeloupe", "Equatorial Guinea", "Greece", "South Georgia and the South Sandwich Islands",
187
+ "Guatemala", "Guam", "Guinea-Bissau",
188
+ "Guyana", "Hong Kong", "Heard Island and McDonald Islands", "Honduras",
189
+ "Croatia", "Haiti", "Hungary", "Indonesia", "Ireland", "Israel", "India",
190
+ "British Indian Ocean Territory", "Iraq", "Iran, Islamic Republic of",
191
+ "Iceland", "Italy", "Jamaica", "Jordan", "Japan", "Kenya", "Kyrgyzstan",
192
+ "Cambodia", "Kiribati", "Comoros", "Saint Kitts and Nevis", "Korea, Democratic People's Republic of",
193
+ "Korea, Republic of", "Kuwait", "Cayman Islands",
194
+ "Kazakhstan", "Lao People's Democratic Republic", "Lebanon", "Saint Lucia",
195
+ "Liechtenstein", "Sri Lanka", "Liberia", "Lesotho", "Lithuania", "Luxembourg",
196
+ "Latvia", "Libyan Arab Jamahiriya", "Morocco", "Monaco", "Moldova, Republic of",
197
+ "Madagascar", "Marshall Islands", "Macedonia",
198
+ "Mali", "Myanmar", "Mongolia", "Macau", "Northern Mariana Islands",
199
+ "Martinique", "Mauritania", "Montserrat", "Malta", "Mauritius", "Maldives",
200
+ "Malawi", "Mexico", "Malaysia", "Mozambique", "Namibia", "New Caledonia",
201
+ "Niger", "Norfolk Island", "Nigeria", "Nicaragua", "Netherlands", "Norway",
202
+ "Nepal", "Nauru", "Niue", "New Zealand", "Oman", "Panama", "Peru", "French Polynesia",
203
+ "Papua New Guinea", "Philippines", "Pakistan", "Poland", "Saint Pierre and Miquelon",
204
+ "Pitcairn Islands", "Puerto Rico", "Palestinian Territory",
205
+ "Portugal", "Palau", "Paraguay", "Qatar", "Reunion", "Romania",
206
+ "Russian Federation", "Rwanda", "Saudi Arabia", "Solomon Islands",
207
+ "Seychelles", "Sudan", "Sweden", "Singapore", "Saint Helena", "Slovenia",
208
+ "Svalbard and Jan Mayen", "Slovakia", "Sierra Leone", "San Marino", "Senegal",
209
+ "Somalia", "Suriname", "Sao Tome and Principe", "El Salvador", "Syrian Arab Republic",
210
+ "Swaziland", "Turks and Caicos Islands", "Chad", "French Southern Territories",
211
+ "Togo", "Thailand", "Tajikistan", "Tokelau", "Turkmenistan",
212
+ "Tunisia", "Tonga", "Timor-Leste", "Turkey", "Trinidad and Tobago", "Tuvalu",
213
+ "Taiwan", "Tanzania, United Republic of", "Ukraine",
214
+ "Uganda", "United States Minor Outlying Islands", "United States", "Uruguay",
215
+ "Uzbekistan", "Holy See (Vatican City State)", "Saint Vincent and the Grenadines",
216
+ "Venezuela", "Virgin Islands, British", "Virgin Islands, U.S.",
217
+ "Vietnam", "Vanuatu", "Wallis and Futuna", "Samoa", "Yemen", "Mayotte",
218
+ "Serbia", "South Africa", "Zambia", "Montenegro", "Zimbabwe",
219
+ "Anonymous Proxy","Satellite Provider","Other",
220
+ "Aland Islands","Guernsey","Isle of Man","Jersey","Saint Barthelemy","Saint Martin"
221
+ );
222
+
223
+ var $GEOIP_CONTINENT_CODES = array(
224
+ "--", "AS", "EU", "EU", "AS", "AS", "NA", "NA", "EU", "AS",
225
+ "NA", "AF", "AN", "SA", "OC", "EU", "OC", "NA", "AS", "EU",
226
+ "NA", "AS", "EU", "AF", "EU", "AS", "AF", "AF", "NA", "AS",
227
+ "SA", "SA", "NA", "AS", "AN", "AF", "EU", "NA", "NA", "AS",
228
+ "AF", "AF", "AF", "EU", "AF", "OC", "SA", "AF", "AS", "SA",
229
+ "NA", "NA", "AF", "AS", "AS", "EU", "EU", "AF", "EU", "NA",
230
+ "NA", "AF", "SA", "EU", "AF", "AF", "AF", "EU", "AF", "EU",
231
+ "OC", "SA", "OC", "EU", "EU", "EU", "AF", "EU", "NA", "AS",
232
+ "SA", "AF", "EU", "NA", "AF", "AF", "NA", "AF", "EU", "AN",
233
+ "NA", "OC", "AF", "SA", "AS", "AN", "NA", "EU", "NA", "EU",
234
+ "AS", "EU", "AS", "AS", "AS", "AS", "AS", "EU", "EU", "NA",
235
+ "AS", "AS", "AF", "AS", "AS", "OC", "AF", "NA", "AS", "AS",
236
+ "AS", "NA", "AS", "AS", "AS", "NA", "EU", "AS", "AF", "AF",
237
+ "EU", "EU", "EU", "AF", "AF", "EU", "EU", "AF", "OC", "EU",
238
+ "AF", "AS", "AS", "AS", "OC", "NA", "AF", "NA", "EU", "AF",
239
+ "AS", "AF", "NA", "AS", "AF", "AF", "OC", "AF", "OC", "AF",
240
+ "NA", "EU", "EU", "AS", "OC", "OC", "OC", "AS", "NA", "SA",
241
+ "OC", "OC", "AS", "AS", "EU", "NA", "OC", "NA", "AS", "EU",
242
+ "OC", "SA", "AS", "AF", "EU", "EU", "AF", "AS", "OC", "AF",
243
+ "AF", "EU", "AS", "AF", "EU", "EU", "EU", "AF", "EU", "AF",
244
+ "AF", "SA", "AF", "NA", "AS", "AF", "NA", "AF", "AN", "AF",
245
+ "AS", "AS", "OC", "AS", "AF", "OC", "AS", "EU", "NA", "OC",
246
+ "AS", "AF", "EU", "AF", "OC", "NA", "SA", "AS", "EU", "NA",
247
+ "SA", "NA", "NA", "AS", "OC", "OC", "OC", "AS", "AF", "EU",
248
+ "AF", "AF", "EU", "AF", "--", "--", "--", "EU", "EU", "EU",
249
+ "EU", "NA", "NA"
250
+ );
251
+
252
+ }
253
+ function geoip_load_shared_mem ($file) {
254
+
255
+ $fp = fopen($file, "rb");
256
+ if (!$fp) {
257
+ print "error opening $file: $php_errormsg\n";
258
+ exit;
259
+ }
260
+ $s_array = fstat($fp);
261
+ $size = $s_array['size'];
262
+ if ($shmid = @shmop_open (GEOIP_SHM_KEY, "w", 0, 0)) {
263
+ shmop_delete ($shmid);
264
+ shmop_close ($shmid);
265
+ }
266
+ $shmid = shmop_open (GEOIP_SHM_KEY, "c", 0644, $size);
267
+ shmop_write ($shmid, fread($fp, $size), 0);
268
+ shmop_close ($shmid);
269
+ }
270
+
271
+ function _setup_segments($gi){
272
+ $gi->databaseType = GEOIP_COUNTRY_EDITION;
273
+ $gi->record_length = STANDARD_RECORD_LENGTH;
274
+ if ($gi->flags & GEOIP_SHARED_MEMORY) {
275
+ $offset = @shmop_size ($gi->shmid) - 3;
276
+ for ($i = 0; $i < STRUCTURE_INFO_MAX_SIZE; $i++) {
277
+ $delim = @shmop_read ($gi->shmid, $offset, 3);
278
+ $offset += 3;
279
+ if ($delim == (chr(255).chr(255).chr(255))) {
280
+ $gi->databaseType = ord(@shmop_read ($gi->shmid, $offset, 1));
281
+ $offset++;
282
+
283
+ if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){
284
+ $gi->databaseSegments = GEOIP_STATE_BEGIN_REV0;
285
+ } else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1){
286
+ $gi->databaseSegments = GEOIP_STATE_BEGIN_REV1;
287
+ } else if (($gi->databaseType == GEOIP_CITY_EDITION_REV0)||
288
+ ($gi->databaseType == GEOIP_CITY_EDITION_REV1)
289
+ || ($gi->databaseType == GEOIP_ORG_EDITION)
290
+ || ($gi->databaseType == GEOIP_ORG_EDITION_V6)
291
+ || ($gi->databaseType == GEOIP_DOMAIN_EDITION)
292
+ || ($gi->databaseType == GEOIP_DOMAIN_EDITION_V6)
293
+ || ($gi->databaseType == GEOIP_ISP_EDITION)
294
+ || ($gi->databaseType == GEOIP_ISP_EDITION_V6)
295
+ || ($gi->databaseType == GEOIP_USERTYPE_EDITION)
296
+ || ($gi->databaseType == GEOIP_USERTYPE_EDITION_V6)
297
+ || ($gi->databaseType == GEOIP_LOCATIONA_EDITION)
298
+ || ($gi->databaseType == GEOIP_ACCURACYRADIUS_EDITION)
299
+ || ($gi->databaseType == GEOIP_CITY_EDITION_REV0_V6)
300
+ || ($gi->databaseType == GEOIP_CITY_EDITION_REV1_V6)
301
+ || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1)
302
+ || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1_V6)
303
+ || ($gi->databaseType == GEOIP_ASNUM_EDITION)
304
+ || ($gi->databaseType == GEOIP_ASNUM_EDITION_V6)){
305
+ $gi->databaseSegments = 0;
306
+ $buf = @shmop_read ($gi->shmid, $offset, SEGMENT_RECORD_LENGTH);
307
+ for ($j = 0;$j < SEGMENT_RECORD_LENGTH;$j++){
308
+ $gi->databaseSegments += (ord($buf[$j]) << ($j * 8));
309
+ }
310
+ if (($gi->databaseType == GEOIP_ORG_EDITION)
311
+ || ($gi->databaseType == GEOIP_ORG_EDITION_V6)
312
+ || ($gi->databaseType == GEOIP_DOMAIN_EDITION)
313
+ || ($gi->databaseType == GEOIP_DOMAIN_EDITION_V6)
314
+ || ($gi->databaseType == GEOIP_ISP_EDITION)
315
+ || ($gi->databaseType == GEOIP_ISP_EDITION_V6)) {
316
+ $gi->record_length = ORG_RECORD_LENGTH;
317
+ }
318
+ }
319
+ break;
320
+ } else {
321
+ $offset -= 4;
322
+ }
323
+ }
324
+ if (($gi->databaseType == GEOIP_COUNTRY_EDITION)||
325
+ ($gi->databaseType == GEOIP_COUNTRY_EDITION_V6)||
326
+ ($gi->databaseType == GEOIP_PROXY_EDITION)||
327
+ ($gi->databaseType == GEOIP_NETSPEED_EDITION)){
328
+ $gi->databaseSegments = GEOIP_COUNTRY_BEGIN;
329
+ }
330
+ } else {
331
+ $filepos = ftell($gi->filehandle);
332
+ fseek($gi->filehandle, -3, SEEK_END);
333
+ for ($i = 0; $i < STRUCTURE_INFO_MAX_SIZE; $i++) {
334
+ $delim = fread($gi->filehandle,3);
335
+ if ($delim == (chr(255).chr(255).chr(255))){
336
+ $gi->databaseType = ord(fread($gi->filehandle,1));
337
+ if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){
338
+ $gi->databaseSegments = GEOIP_STATE_BEGIN_REV0;
339
+ }
340
+ else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1){
341
+ $gi->databaseSegments = GEOIP_STATE_BEGIN_REV1;
342
+ } else if (($gi->databaseType == GEOIP_CITY_EDITION_REV0)
343
+ || ($gi->databaseType == GEOIP_CITY_EDITION_REV1)
344
+ || ($gi->databaseType == GEOIP_CITY_EDITION_REV0_V6)
345
+ || ($gi->databaseType == GEOIP_CITY_EDITION_REV1_V6)
346
+ || ($gi->databaseType == GEOIP_ORG_EDITION)
347
+ || ($gi->databaseType == GEOIP_DOMAIN_EDITION)
348
+ || ($gi->databaseType == GEOIP_ISP_EDITION)
349
+ || ($gi->databaseType == GEOIP_ORG_EDITION_V6)
350
+ || ($gi->databaseType == GEOIP_DOMAIN_EDITION_V6)
351
+ || ($gi->databaseType == GEOIP_ISP_EDITION_V6)
352
+ || ($gi->databaseType == GEOIP_LOCATIONA_EDITION)
353
+ || ($gi->databaseType == GEOIP_ACCURACYRADIUS_EDITION)
354
+ || ($gi->databaseType == GEOIP_CITY_EDITION_REV0_V6)
355
+ || ($gi->databaseType == GEOIP_CITY_EDITION_REV1_V6)
356
+ || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1)
357
+ || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1_V6)
358
+ || ($gi->databaseType == GEOIP_USERTYPE_EDITION)
359
+ || ($gi->databaseType == GEOIP_USERTYPE_EDITION_V6)
360
+ || ($gi->databaseType == GEOIP_ASNUM_EDITION)
361
+ || ($gi->databaseType == GEOIP_ASNUM_EDITION_V6)){
362
+ $gi->databaseSegments = 0;
363
+ $buf = fread($gi->filehandle,SEGMENT_RECORD_LENGTH);
364
+ for ($j = 0;$j < SEGMENT_RECORD_LENGTH;$j++){
365
+ $gi->databaseSegments += (ord($buf[$j]) << ($j * 8));
366
+ }
367
+ if ( ( $gi->databaseType == GEOIP_ORG_EDITION )
368
+ || ( $gi->databaseType == GEOIP_DOMAIN_EDITION )
369
+ || ( $gi->databaseType == GEOIP_ISP_EDITION )
370
+ || ( $gi->databaseType == GEOIP_ORG_EDITION_V6 )
371
+ || ( $gi->databaseType == GEOIP_DOMAIN_EDITION_V6 )
372
+ || ( $gi->databaseType == GEOIP_ISP_EDITION_V6 )) {
373
+ $gi->record_length = ORG_RECORD_LENGTH;
374
+ }
375
+ }
376
+ break;
377
+ } else {
378
+ fseek($gi->filehandle, -4, SEEK_CUR);
379
+ }
380
+ }
381
+ if (($gi->databaseType == GEOIP_COUNTRY_EDITION)||
382
+ ($gi->databaseType == GEOIP_COUNTRY_EDITION_V6)||
383
+ ($gi->databaseType == GEOIP_PROXY_EDITION)||
384
+ ($gi->databaseType == GEOIP_NETSPEED_EDITION)){
385
+ $gi->databaseSegments = GEOIP_COUNTRY_BEGIN;
386
+ }
387
+ fseek($gi->filehandle,$filepos,SEEK_SET);
388
+ }
389
+ return $gi;
390
+ }
391
+
392
+ function geoip_open($filename, $flags) {
393
+ $gi = new GeoIP;
394
+ $gi->flags = $flags;
395
+ if ($gi->flags & GEOIP_SHARED_MEMORY) {
396
+ $gi->shmid = @shmop_open (GEOIP_SHM_KEY, "a", 0, 0);
397
+ } else {
398
+ $gi->filehandle = fopen($filename,"rb") or die( "Can not open $filename\n" );
399
+ if ($gi->flags & GEOIP_MEMORY_CACHE) {
400
+ $s_array = fstat($gi->filehandle);
401
+ $gi->memory_buffer = fread($gi->filehandle, $s_array['size']);
402
+ }
403
+ }
404
+
405
+ $gi = _setup_segments($gi);
406
+ return $gi;
407
+ }
408
+
409
+ function geoip_close($gi) {
410
+ if ($gi->flags & GEOIP_SHARED_MEMORY) {
411
+ return true;
412
+ }
413
+
414
+ return fclose($gi->filehandle);
415
+ }
416
+
417
+ function geoip_country_id_by_name_v6($gi, $name) {
418
+ $rec = dns_get_record($name, DNS_AAAA);
419
+ if ( !$rec ) {
420
+ return false;
421
+ }
422
+ $addr = $rec[0]["ipv6"];
423
+ if (!$addr || $addr == $name) {
424
+ return false;
425
+ }
426
+ return geoip_country_id_by_addr_v6($gi, $addr);
427
+ }
428
+
429
+ function geoip_country_id_by_name($gi, $name) {
430
+ $addr = gethostbyname($name);
431
+ if (!$addr || $addr == $name) {
432
+ return false;
433
+ }
434
+ return geoip_country_id_by_addr($gi, $addr);
435
+ }
436
+
437
+ function geoip_country_code_by_name_v6($gi, $name) {
438
+ $country_id = geoip_country_id_by_name_v6($gi,$name);
439
+ if ($country_id !== false) {
440
+ return $gi->GEOIP_COUNTRY_CODES[$country_id];
441
+ }
442
+ return false;
443
+ }
444
+
445
+ function geoip_country_code_by_name($gi, $name) {
446
+ $country_id = geoip_country_id_by_name($gi,$name);
447
+ if ($country_id !== false) {
448
+ return $gi->GEOIP_COUNTRY_CODES[$country_id];
449
+ }
450
+ return false;
451
+ }
452
+
453
+ function geoip_country_name_by_name_v6($gi, $name) {
454
+ $country_id = geoip_country_id_by_name_v6($gi,$name);
455
+ if ($country_id !== false) {
456
+ return $gi->GEOIP_COUNTRY_NAMES[$country_id];
457
+ }
458
+ return false;
459
+ }
460
+
461
+ function geoip_country_name_by_name($gi, $name) {
462
+ $country_id = geoip_country_id_by_name($gi,$name);
463
+ if ($country_id !== false) {
464
+ return $gi->GEOIP_COUNTRY_NAMES[$country_id];
465
+ }
466
+ return false;
467
+ }
468
+
469
+ function geoip_country_id_by_addr_v6($gi, $addr) {
470
+ $ipnum = inet_pton($addr);
471
+ return _geoip_seek_country_v6($gi, $ipnum) - GEOIP_COUNTRY_BEGIN;
472
+ }
473
+
474
+ function geoip_country_id_by_addr($gi, $addr) {
475
+ $ipnum = ip2long($addr);
476
+ return _geoip_seek_country($gi, $ipnum) - GEOIP_COUNTRY_BEGIN;
477
+ }
478
+
479
+ function geoip_country_code_by_addr_v6($gi, $addr) {
480
+ $country_id = geoip_country_id_by_addr_v6($gi,$addr);
481
+ if ($country_id !== false) {
482
+ return $gi->GEOIP_COUNTRY_CODES[$country_id];
483
+ }
484
+ return false;
485
+ }
486
+
487
+ function geoip_country_code_by_addr($gi, $addr) {
488
+ if ($gi->databaseType == GEOIP_CITY_EDITION_REV1) {
489
+ $record = geoip_record_by_addr($gi,$addr);
490
+ if ( $record !== false ) {
491
+ return $record->country_code;
492
+ }
493
+ } else {
494
+ $country_id = geoip_country_id_by_addr($gi,$addr);
495
+ if ($country_id !== false) {
496
+ return $gi->GEOIP_COUNTRY_CODES[$country_id];
497
+ }
498
+ }
499
+ return false;
500
+ }
501
+
502
+ function geoip_country_name_by_addr_v6($gi, $addr) {
503
+ $country_id = geoip_country_id_by_addr_v6($gi,$addr);
504
+ if ($country_id !== false) {
505
+ return $gi->GEOIP_COUNTRY_NAMES[$country_id];
506
+ }
507
+ return false;
508
+ }
509
+
510
+ function geoip_country_name_by_addr($gi, $addr) {
511
+ if ($gi->databaseType == GEOIP_CITY_EDITION_REV1) {
512
+ $record = geoip_record_by_addr($gi,$addr);
513
+ return $record->country_name;
514
+ } else {
515
+ $country_id = geoip_country_id_by_addr($gi,$addr);
516
+ if ($country_id !== false) {
517
+ return $gi->GEOIP_COUNTRY_NAMES[$country_id];
518
+ }
519
+ }
520
+ return false;
521
+ }
522
+
523
+ function _geoip_seek_country_v6($gi, $ipnum) {
524
+
525
+ # arrays from unpack start with offset 1
526
+ # yet another php mystery. array_merge work around
527
+ # this broken behaviour
528
+ $v6vec = array_merge(unpack( "C16", $ipnum));
529
+
530
+ $offset = 0;
531
+ for ($depth = 127; $depth >= 0; --$depth) {
532
+ if ($gi->flags & GEOIP_MEMORY_CACHE) {
533
+ // workaround php's broken substr, strpos, etc handling with
534
+ // mbstring.func_overload and mbstring.internal_encoding
535
+ $enc = mb_internal_encoding();
536
+ mb_internal_encoding('ISO-8859-1');
537
+
538
+ $buf = substr($gi->memory_buffer,
539
+ 2 * $gi->record_length * $offset,
540
+ 2 * $gi->record_length);
541
+
542
+ mb_internal_encoding($enc);
543
+ } elseif ($gi->flags & GEOIP_SHARED_MEMORY) {
544
+ $buf = @shmop_read ($gi->shmid,
545
+ 2 * $gi->record_length * $offset,
546
+ 2 * $gi->record_length );
547
+ } else {
548
+ fseek($gi->filehandle, 2 * $gi->record_length * $offset, SEEK_SET) == 0
549
+ or die("fseek failed");
550
+ $buf = fread($gi->filehandle, 2 * $gi->record_length);
551
+ }
552
+ $x = array(0,0);
553
+ for ($i = 0; $i < 2; ++$i) {
554
+ for ($j = 0; $j < $gi->record_length; ++$j) {
555
+ $x[$i] += ord($buf[$gi->record_length * $i + $j]) << ($j * 8);
556
+ }
557
+ }
558
+
559
+ $bnum = 127 - $depth;
560
+ $idx = $bnum >> 3;
561
+ $b_mask = 1 << ( $bnum & 7 ^ 7 );
562
+ if (($v6vec[$idx] & $b_mask) > 0) {
563
+ if ($x[1] >= $gi->databaseSegments) {
564
+ return $x[1];
565
+ }
566
+ $offset = $x[1];
567
+ } else {
568
+ if ($x[0] >= $gi->databaseSegments) {
569
+ return $x[0];
570
+ }
571
+ $offset = $x[0];
572
+ }
573
+ }
574
+ trigger_error("error traversing database - perhaps it is corrupt?", E_USER_ERROR);
575
+ return false;
576
+ }
577
+
578
+ function _geoip_seek_country($gi, $ipnum) {
579
+ $offset = 0;
580
+ for ($depth = 31; $depth >= 0; --$depth) {
581
+ if ($gi->flags & GEOIP_MEMORY_CACHE) {
582
+ // workaround php's broken substr, strpos, etc handling with
583
+ // mbstring.func_overload and mbstring.internal_encoding
584
+ $enc = mb_internal_encoding();
585
+ mb_internal_encoding('ISO-8859-1');
586
+
587
+ $buf = substr($gi->memory_buffer,
588
+ 2 * $gi->record_length * $offset,
589
+ 2 * $gi->record_length);
590
+
591
+ mb_internal_encoding($enc);
592
+ } elseif ($gi->flags & GEOIP_SHARED_MEMORY) {
593
+ $buf = @shmop_read ($gi->shmid,
594
+ 2 * $gi->record_length * $offset,
595
+ 2 * $gi->record_length );
596
+ } else {
597
+ fseek($gi->filehandle, 2 * $gi->record_length * $offset, SEEK_SET) == 0
598
+ or die("fseek failed");
599
+ $buf = fread($gi->filehandle, 2 * $gi->record_length);
600
+ }
601
+ $x = array(0,0);
602
+ for ($i = 0; $i < 2; ++$i) {
603
+ for ($j = 0; $j < $gi->record_length; ++$j) {
604
+ $x[$i] += ord($buf[$gi->record_length * $i + $j]) << ($j * 8);
605
+ }
606
+ }
607
+ if ($ipnum & (1 << $depth)) {
608
+ if ($x[1] >= $gi->databaseSegments) {
609
+ return $x[1];
610
+ }
611
+ $offset = $x[1];
612
+ } else {
613
+ if ($x[0] >= $gi->databaseSegments) {
614
+ return $x[0];
615
+ }
616
+ $offset = $x[0];
617
+ }
618
+ }
619
+ trigger_error("error traversing database - perhaps it is corrupt?", E_USER_ERROR);
620
+ return false;
621
+ }
622
+
623
+ function _common_get_org($gi, $seek_org){
624
+ $record_pointer = $seek_org + (2 * $gi->record_length - 1) * $gi->databaseSegments;
625
+ if ($gi->flags & GEOIP_SHARED_MEMORY) {
626
+ $org_buf = @shmop_read ($gi->shmid, $record_pointer, MAX_ORG_RECORD_LENGTH);
627
+ } else {
628
+ fseek($gi->filehandle, $record_pointer, SEEK_SET);
629
+ $org_buf = fread($gi->filehandle,MAX_ORG_RECORD_LENGTH);
630
+ }
631
+ // workaround php's broken substr, strpos, etc handling with
632
+ // mbstring.func_overload and mbstring.internal_encoding
633
+ $enc = mb_internal_encoding();
634
+ mb_internal_encoding('ISO-8859-1');
635
+ $org_buf = substr($org_buf, 0, strpos($org_buf, "\0"));
636
+ mb_internal_encoding($enc);
637
+ return $org_buf;
638
+ }
639
+
640
+ function _get_org_v6($gi,$ipnum){
641
+ $seek_org = _geoip_seek_country_v6($gi,$ipnum);
642
+ if ($seek_org == $gi->databaseSegments) {
643
+ return NULL;
644
+ }
645
+ return _common_get_org($gi, $seek_org);
646
+ }
647
+
648
+ function _get_org($gi,$ipnum){
649
+ $seek_org = _geoip_seek_country($gi,$ipnum);
650
+ if ($seek_org == $gi->databaseSegments) {
651
+ return NULL;
652
+ }
653
+ return _common_get_org($gi, $seek_org);
654
+ }
655
+
656
+
657
+
658
+ function geoip_name_by_addr_v6 ($gi,$addr) {
659
+ if ($addr == NULL) {
660
+ return 0;
661
+ }
662
+ $ipnum = inet_pton($addr);
663
+ return _get_org_v6($gi, $ipnum);
664
+ }
665
+
666
+ function geoip_name_by_addr ($gi,$addr) {
667
+ if ($addr == NULL) {
668
+ return 0;
669
+ }
670
+ $ipnum = ip2long($addr);
671
+ return _get_org($gi, $ipnum);
672
+ }
673
+
674
+ function geoip_org_by_addr ($gi,$addr) {
675
+ return geoip_name_by_addr($gi, $addr);
676
+ }
677
+
678
+ function _get_region($gi,$ipnum){
679
+ if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){
680
+ $seek_region = _geoip_seek_country($gi,$ipnum) - GEOIP_STATE_BEGIN_REV0;
681
+ if ($seek_region >= 1000){
682
+ $country_code = "US";
683
+ $region = chr(($seek_region - 1000)/26 + 65) . chr(($seek_region - 1000)%26 + 65);
684
+ } else {
685
+ $country_code = $gi->GEOIP_COUNTRY_CODES[$seek_region];
686
+ $region = "";
687
+ }
688
+ return array ($country_code,$region);
689
+ } else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1) {
690
+ $seek_region = _geoip_seek_country($gi,$ipnum) - GEOIP_STATE_BEGIN_REV1;
691
+ //print $seek_region;
692
+ if ($seek_region < US_OFFSET){
693
+ $country_code = "";
694
+ $region = "";
695
+ } else if ($seek_region < CANADA_OFFSET) {
696
+ $country_code = "US";
697
+ $region = chr(($seek_region - US_OFFSET)/26 + 65) . chr(($seek_region - US_OFFSET)%26 + 65);
698
+ } else if ($seek_region < WORLD_OFFSET) {
699
+ $country_code = "CA";
700
+ $region = chr(($seek_region - CANADA_OFFSET)/26 + 65) . chr(($seek_region - CANADA_OFFSET)%26 + 65);
701
+ } else {
702
+ $country_code = $gi->GEOIP_COUNTRY_CODES[($seek_region - WORLD_OFFSET) / FIPS_RANGE];
703
+ $region = "";
704
+ }
705
+ return array ($country_code,$region);
706
+ }
707
+ }
708
+
709
+ function geoip_region_by_addr ($gi,$addr) {
710
+ if ($addr == NULL) {
711
+ return 0;
712
+ }
713
+ $ipnum = ip2long($addr);
714
+ return _get_region($gi, $ipnum);
715
+ }
716
+
717
+ function getdnsattributes ($l,$ip){
718
+ $r = new Net_DNS_Resolver();
719
+ $r->nameservers = array("ws1.maxmind.com");
720
+ $p = $r->search($l."." . $ip .".s.maxmind.com","TXT","IN");
721
+ $str = is_object($p->answer[0])?$p->answer[0]->string():'';
722
+ $str = substr( $str, 1, -1 );
723
+ return $str;
724
+ }
725
+
726
+ ?>
includes/common/images/ClosedTabBackground.png ADDED
Binary file
includes/common/images/ClosedTabBackgroundHover.png ADDED
Binary file
includes/common/images/better_checkbox.png ADDED
Binary file
includes/common/images/border.png ADDED
Binary file
includes/common/images/check.png ADDED
Binary file
includes/common/images/controls.png ADDED
Binary file
includes/common/images/help.png ADDED
Binary file
includes/common/images/iphone_off.png ADDED
Binary file
includes/common/images/iphone_on.png ADDED
Binary file
includes/common/images/iphone_slider.png ADDED
Binary file
includes/common/images/iphone_slider_center.png ADDED
Binary file
includes/common/images/iphone_slider_left.png ADDED
Binary file
includes/common/images/iphone_slider_right.png ADDED
Binary file
includes/common/images/loading.gif ADDED
Binary file
includes/common/images/loading_background.png ADDED
Binary file
includes/common/images/logo.png ADDED
Binary file
includes/common/images/overlay.png ADDED
Binary file
includes/common/images/pointer.png ADDED
Binary file
includes/common/jquery.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_insert_get_jquery() {
3
+ $output = '<script type="text/javascript">';
4
+ $output .= 'var jQueryScriptOutputted = false;';
5
+ $output .= 'function initJQuery() {';
6
+ $output .= 'if (typeof(jQuery) == "undefined") {';
7
+ $output .= 'if (! jQueryScriptOutputted) {';
8
+ $output .= 'jQueryScriptOutputted = true;';
9
+ $output .= 'document.write("<scr" + "ipt type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js\"></scr" + "ipt>");';
10
+ $output .= '}';
11
+ $output .= 'setTimeout("initJQuery()", 50);';
12
+ $output .= '}';
13
+ $output .= '}';
14
+ $output .= 'initJQuery();';
15
+ $output .= '</script>';
16
+ return $output;
17
+ }
18
+ ?>
includes/common/js/iphone-style-checkboxes.js ADDED
@@ -0,0 +1,284 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function() {
2
+ var iOSCheckbox;
3
+ var __slice = Array.prototype.slice;
4
+ iOSCheckbox = (function() {
5
+ function iOSCheckbox(elem, options) {
6
+ var key, opts, value;
7
+ this.elem = jQuery(elem);
8
+ opts = jQuery.extend({}, iOSCheckbox.defaults, options);
9
+ for (key in opts) {
10
+ value = opts[key];
11
+ this[key] = value;
12
+ }
13
+ this.elem.data(this.dataName, this);
14
+ this.wrapCheckboxWithDivs();
15
+ this.attachEvents();
16
+ this.disableTextSelection();
17
+ if (this.resizeHandle) {
18
+ this.optionallyResize('handle');
19
+ }
20
+ if (this.resizeContainer) {
21
+ this.optionallyResize('container');
22
+ }
23
+ this.initialPosition();
24
+ }
25
+ iOSCheckbox.prototype.isDisabled = function() {
26
+ return this.elem.is(':disabled');
27
+ };
28
+ iOSCheckbox.prototype.wrapCheckboxWithDivs = function() {
29
+ this.elem.wrap("<div class='" + this.containerClass + "' />");
30
+ this.container = this.elem.parent();
31
+ this.offLabel = jQuery("<label class='" + this.labelOffClass + "'>\n <span>" + this.uncheckedLabel + "</span>\n</label>").appendTo(this.container);
32
+ this.offSpan = this.offLabel.children('span');
33
+ this.onLabel = jQuery("<label class='" + this.labelOnClass + "'>\n <span>" + this.checkedLabel + "</span>\n</label>").appendTo(this.container);
34
+ this.onSpan = this.onLabel.children('span');
35
+ return this.handle = jQuery("<div class='" + this.handleClass + "'>\n <div class='" + this.handleRightClass + "'>\n <div class='" + this.handleCenterClass + "' />\n </div>\n</div>").appendTo(this.container);
36
+ };
37
+ iOSCheckbox.prototype.disableTextSelection = function() {
38
+ if (jQuery.browser.msie) {
39
+ return jQuery([this.handle, this.offLabel, this.onLabel, this.container]).attr("unselectable", "on");
40
+ }
41
+ };
42
+ iOSCheckbox.prototype._getDimension = function(elem, dimension) {
43
+ if (jQuery.fn.actual != null) {
44
+ return elem.actual(dimension);
45
+ } else {
46
+ return elem[dimension]();
47
+ }
48
+ };
49
+ iOSCheckbox.prototype.optionallyResize = function(mode) {
50
+ var newWidth, offLabelWidth, onLabelWidth;
51
+ onLabelWidth = this._getDimension(this.onLabel, "width");
52
+ offLabelWidth = this._getDimension(this.offLabel, "width");
53
+ if (mode === "container") {
54
+ newWidth = onLabelWidth > offLabelWidth ? onLabelWidth : offLabelWidth;
55
+ newWidth += this._getDimension(this.handle, "width") + this.handleMargin;
56
+ return this.container.css({
57
+ width: newWidth
58
+ });
59
+ } else {
60
+ newWidth = onLabelWidth > offLabelWidth ? onLabelWidth : offLabelWidth;
61
+ return this.handle.css({
62
+ width: newWidth
63
+ });
64
+ }
65
+ };
66
+ iOSCheckbox.prototype.onMouseDown = function(event) {
67
+ var x;
68
+ event.preventDefault();
69
+ if (this.isDisabled()) {
70
+ return;
71
+ }
72
+ x = event.pageX || event.originalEvent.changedTouches[0].pageX;
73
+ iOSCheckbox.currentlyClicking = this.handle;
74
+ iOSCheckbox.dragStartPosition = x;
75
+ return iOSCheckbox.handleLeftOffset = parseInt(this.handle.css('left'), 10) || 0;
76
+ };
77
+ iOSCheckbox.prototype.onDragMove = function(event, x) {
78
+ var newWidth, p;
79
+ if (iOSCheckbox.currentlyClicking !== this.handle) {
80
+ return;
81
+ }
82
+ p = (x + iOSCheckbox.handleLeftOffset - iOSCheckbox.dragStartPosition) / this.rightSide;
83
+ if (p < 0) {
84
+ p = 0;
85
+ }
86
+ if (p > 1) {
87
+ p = 1;
88
+ }
89
+ newWidth = p * this.rightSide;
90
+ this.handle.css({
91
+ left: newWidth
92
+ });
93
+ this.onLabel.css({
94
+ width: newWidth + this.handleRadius
95
+ });
96
+ this.offSpan.css({
97
+ marginRight: -newWidth
98
+ });
99
+ return this.onSpan.css({
100
+ marginLeft: -(1 - p) * this.rightSide
101
+ });
102
+ };
103
+ iOSCheckbox.prototype.onDragEnd = function(event, x) {
104
+ var p;
105
+ if (iOSCheckbox.currentlyClicking !== this.handle) {
106
+ return;
107
+ }
108
+ if (this.isDisabled()) {
109
+ return;
110
+ }
111
+ if (iOSCheckbox.dragging) {
112
+ p = (x - iOSCheckbox.dragStartPosition) / this.rightSide;
113
+ this.elem.prop('checked', p >= 0.5);
114
+ } else {
115
+ this.elem.prop('checked', !this.elem.prop('checked'));
116
+ }
117
+ iOSCheckbox.currentlyClicking = null;
118
+ iOSCheckbox.dragging = null;
119
+ return this.didChange();
120
+ };
121
+ iOSCheckbox.prototype.refresh = function() {
122
+ return this.didChange();
123
+ };
124
+ iOSCheckbox.prototype.didChange = function() {
125
+ var new_left;
126
+ if (typeof this.onChange === "function") {
127
+ this.onChange(this.elem, this.elem.prop('checked'));
128
+ }
129
+ if (this.isDisabled()) {
130
+ this.container.addClass(this.disabledClass);
131
+ return false;
132
+ } else {
133
+ this.container.removeClass(this.disabledClass);
134
+ }
135
+ new_left = this.elem.prop('checked') ? this.rightSide : 0;
136
+ this.handle.animate({
137
+ left: new_left
138
+ }, this.duration);
139
+ this.onLabel.animate({
140
+ width: new_left + this.handleRadius
141
+ }, this.duration);
142
+ this.offSpan.animate({
143
+ marginRight: -new_left
144
+ }, this.duration);
145
+ return this.onSpan.animate({
146
+ marginLeft: new_left - this.rightSide
147
+ }, this.duration);
148
+ };
149
+ iOSCheckbox.prototype.attachEvents = function() {
150
+ var localMouseMove, localMouseUp, self;
151
+ self = this;
152
+ localMouseMove = function(event) {
153
+ return self.onGlobalMove.apply(self, arguments);
154
+ };
155
+ localMouseUp = function(event) {
156
+ self.onGlobalUp.apply(self, arguments);
157
+ jQuery(document).unbind('mousemove touchmove', localMouseMove);
158
+ return jQuery(document).unbind('mouseup touchend', localMouseUp);
159
+ };
160
+ this.elem.change(function() {
161
+ return self.refresh();
162
+ });
163
+ return this.container.bind('mousedown touchstart', function(event) {
164
+ self.onMouseDown.apply(self, arguments);
165
+ jQuery(document).bind('mousemove touchmove', localMouseMove);
166
+ return jQuery(document).bind('mouseup touchend', localMouseUp);
167
+ });
168
+ };
169
+ iOSCheckbox.prototype.initialPosition = function() {
170
+ var containerWidth, offset;
171
+ containerWidth = this._getDimension(this.container, "width");
172
+ this.offLabel.css({
173
+ width: containerWidth - this.containerRadius
174
+ });
175
+ offset = this.containerRadius + 1;
176
+ if (jQuery.browser.msie && jQuery.browser.version < 7) {
177
+ offset -= 3;
178
+ }
179
+ this.rightSide = containerWidth - this._getDimension(this.handle, "width") - offset;
180
+ if (this.elem.is(':checked')) {
181
+ this.handle.css({
182
+ left: this.rightSide
183
+ });
184
+ this.onLabel.css({
185
+ width: this.rightSide + this.handleRadius
186
+ });
187
+ this.offSpan.css({
188
+ marginRight: -this.rightSide
189
+ });
190
+ } else {
191
+ this.onLabel.css({
192
+ width: 0
193
+ });
194
+ this.onSpan.css({
195
+ marginLeft: -this.rightSide
196
+ });
197
+ }
198
+ if (this.isDisabled()) {
199
+ return this.container.addClass(this.disabledClass);
200
+ }
201
+ };
202
+ iOSCheckbox.prototype.onGlobalMove = function(event) {
203
+ var x;
204
+ if (!(!this.isDisabled() && iOSCheckbox.currentlyClicking)) {
205
+ return;
206
+ }
207
+ event.preventDefault();
208
+ x = event.pageX || event.originalEvent.changedTouches[0].pageX;
209
+ if (!iOSCheckbox.dragging && (Math.abs(iOSCheckbox.dragStartPosition - x) > this.dragThreshold)) {
210
+ iOSCheckbox.dragging = true;
211
+ }
212
+ return this.onDragMove(event, x);
213
+ };
214
+ iOSCheckbox.prototype.onGlobalUp = function(event) {
215
+ var x;
216
+ if (!iOSCheckbox.currentlyClicking) {
217
+ return;
218
+ }
219
+ event.preventDefault();
220
+ x = event.pageX || event.originalEvent.changedTouches[0].pageX;
221
+ this.onDragEnd(event, x);
222
+ return false;
223
+ };
224
+ iOSCheckbox.defaults = {
225
+ duration: 200,
226
+ checkedLabel: 'ON',
227
+ uncheckedLabel: 'OFF',
228
+ resizeHandle: true,
229
+ resizeContainer: true,
230
+ disabledClass: 'iPhoneCheckDisabled',
231
+ containerClass: 'iPhoneCheckContainer',
232
+ labelOnClass: 'iPhoneCheckLabelOn',
233
+ labelOffClass: 'iPhoneCheckLabelOff',
234
+ handleClass: 'iPhoneCheckHandle',
235
+ handleCenterClass: 'iPhoneCheckHandleCenter',
236
+ handleRightClass: 'iPhoneCheckHandleRight',
237
+ dragThreshold: 5,
238
+ handleMargin: 15,
239
+ handleRadius: 4,
240
+ containerRadius: 5,
241
+ dataName: "iphoneStyle",
242
+ onChange: function() {}
243
+ };
244
+ return iOSCheckbox;
245
+ })();
246
+ jQuery.iphoneStyle = this.iOSCheckbox = iOSCheckbox;
247
+ jQuery.fn.iphoneStyle = function() {
248
+ var args, checkbox, dataName, existingControl, method, params, _i, _len, _ref, _ref2, _ref3, _ref4;
249
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
250
+ dataName = (_ref = (_ref2 = args[0]) != null ? _ref2.dataName : void 0) != null ? _ref : iOSCheckbox.defaults.dataName;
251
+ _ref3 = this.filter(':checkbox');
252
+ for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
253
+ checkbox = _ref3[_i];
254
+ existingControl = jQuery(checkbox).data(dataName);
255
+ if (existingControl != null) {
256
+ method = args[0], params = 2 <= args.length ? __slice.call(args, 1) : [];
257
+ if ((_ref4 = existingControl[method]) != null) {
258
+ _ref4.apply(existingControl, params);
259
+ }
260
+ } else {
261
+ new iOSCheckbox(checkbox, args[0]);
262
+ }
263
+ }
264
+ return this;
265
+ };
266
+ jQuery.fn.iOSCheckbox = function(options) {
267
+ var opts;
268
+ if (options == null) {
269
+ options = {};
270
+ }
271
+ opts = jQuery.extend({}, options, {
272
+ resizeHandle: false,
273
+ disabledClass: 'iOSCheckDisabled',
274
+ containerClass: 'iOSCheckContainer',
275
+ labelOnClass: 'iOSCheckLabelOn',
276
+ labelOffClass: 'iOSCheckLabelOff',
277
+ handleClass: 'iOSCheckHandle',
278
+ handleCenterClass: 'iOSCheckHandleCenter',
279
+ handleRightClass: 'iOSCheckHandleRight',
280
+ dataName: 'iOSCheckbox'
281
+ });
282
+ return this.iphoneStyle(opts);
283
+ };
284
+ }).call(this);
includes/common/js/jquery-jvert-tabs-1.1.4.js ADDED
@@ -0,0 +1,356 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * ########################################################
3
+ * jVertTabs - JQuery plugin for creating vertical tabs.
4
+ * By Seth Lenzi - slenzi@gmail.com
5
+ * This is free! Do with it as you want!
6
+ * MIT License. - http://en.wikipedia.org/wiki/MIT_License
7
+ * ########################################################
8
+ *
9
+ * Change History:
10
+ *
11
+ * June 30, 2010 - v1.1.4 ---- CSS Updates. IE-8 fixes relating to height, width, & margin settings.
12
+ *
13
+ * March 3, 2010 - v1.1.3 ---- Added code to ensure that all vtabs-content-panel elements are at least as tall as the tabColumn element.
14
+ * This is to address issue #1, http://code.google.com/p/jquery-vert-tabs/issues/detail?id=1
15
+ *
16
+ * February 8, 2010 - v1.1.2 - More bug fixes...sigh. Plugin now keeps track of options for each tab set via the
17
+ * allTabOptions object.
18
+ *
19
+ * February 6, 2010 - v1.1.1 - Bug fix dealing with varying length tabs that go beyond the default CSS width of 150px.
20
+ *
21
+ * February 5, 2010 - v1.1 --- Added set selected tab function.
22
+ * (e.g. $("#elm").jVertTabs('selected',2); // select 3rd tab, 0-based.)
23
+ *
24
+ * February 3, 2010 - v1.0 --- Initial release.
25
+ *
26
+ *
27
+ * ------------------------------------------------------
28
+ *
29
+ * default options
30
+ *
31
+ * selected: Index of the tab to open on initialization. 0-based, first tab is 0, second tab is 1, etc..
32
+ *
33
+ * select: A callback function that is called when a tab is clicked. The 'index' value will be the index of
34
+ * the tab that was clicked. 0-based, first tab is 0, second tab is 1, etc..
35
+ *
36
+ * spinner: Text to show during ajax request. Pass in empty string to deactivate that behavior.
37
+ *
38
+ * equalHeights: If set to true the content panels will all have the same height. The min-heigh value
39
+ * for each panel will be set to that of the tallest panel in the group. By default this
40
+ * feature is turned off, or "false". Set to "true" to turn on.
41
+ */
42
+ (function($) {
43
+
44
+ // keep track of options for each tab group
45
+ var allTabOptions = new Array();
46
+
47
+ /**
48
+ * String startsWith function.
49
+ */
50
+ String.prototype.startsWith = function(str){
51
+ return (this.match("^"+str)==str);
52
+ }
53
+
54
+ $.fn.jVertTabs = function(attr,options) {
55
+
56
+ var elmId = $(this).attr('id');
57
+
58
+ var opts;
59
+ var defaults = {
60
+ selected: 0,
61
+ select: function(index){
62
+ //alert("Tab " + index + " clicked.");
63
+ },
64
+ spinner: "Retrieving data...",
65
+ equalHeights: false
66
+ };
67
+
68
+ var tabColumnHeight = 0;
69
+
70
+ // Check to see if an object is a plain object (created using "{}" or "new Object").
71
+ if($.isPlainObject(attr)){
72
+
73
+ // This block will be executed when we call our plugin with options:
74
+ // $("#elmId").jVertTabsDev({
75
+ // selected: 1
76
+ // });
77
+
78
+ // extend default options with any that were provided by user
79
+ options = attr;
80
+ opts = $.extend(defaults, options);
81
+ allTabOptions[elmId] = opts;
82
+
83
+ }else{
84
+
85
+ // This block will be executed when we call our plugin like so:
86
+ // $("#elmId").jVertTabsDev();
87
+ // Or..
88
+ // $("#elmId").jVertTabsDev('active',true);
89
+
90
+ if(attr != null && options != null){
91
+ if(attr == "selected"){
92
+ //alert("a attr: " + attr + ", options: " + options);
93
+ var thisTabOpts = allTabOptions[elmId];
94
+ //alert(elmId + " before: " + thisTabOpts.selected);
95
+ thisTabOpts.selected = options;
96
+ //alert(elmId + " after: " + thisTabOpts.selected);
97
+ /* add css classes to elements */
98
+ var tabRoot = $(this);
99
+ doSelectTab($(this),options);
100
+ return;
101
+ }
102
+ }else{
103
+
104
+ //alert("b attr: " + attr + ", options: " + options);
105
+
106
+ // extend default options with any that were provided by user
107
+ opts = $.extend(defaults, options);
108
+ allTabOptions[elmId] = opts;
109
+
110
+ }
111
+ }
112
+
113
+ // apply jVertTabs to all matching elements
114
+ return this.each(function() {
115
+
116
+ /* add css classes to elements */
117
+ var tabRoot = $(this);
118
+ setStyle(tabRoot);
119
+
120
+ /* references to tab column and tab content column */
121
+ var tabColumn = tabRoot.children("div.vtabs-tab-column");
122
+ var tabContentColumn = tabRoot.children("div.vtabs-content-column");
123
+ //tabColumnHeight = tabColumn.height();
124
+
125
+ /* locate all li elements */
126
+ $(this).find(".vtabs-tab-column > ul > li").each(function(i){
127
+
128
+ /* set css for initial state of tabs. first tab is open, the rest are closed.*/
129
+ if(i < 1){
130
+ $(this).addClass("open");
131
+ $(this).find("a").addClass("open");
132
+ }else{
133
+ $(this).addClass("closed");
134
+ $(this).find("a").addClass("closed");
135
+ }
136
+
137
+ /* add click events to all li elements */
138
+ $(this).click(function() {
139
+ handleTabClick($(this),i,tabRoot,true);
140
+ return false;
141
+ });
142
+ });
143
+
144
+ /* set initial state of tab content panels. first panel is open, the rest are closed */
145
+ $(this).children(".vtabs-content-column > div.vtabs-content-panel").each(function(i){
146
+ if(i>0){
147
+ $(this).hide();
148
+ }
149
+ });
150
+
151
+ /* open specified tab on itialization. this is customizable via the 'selected' option */
152
+ var thisTabOpts = allTabOptions[elmId];
153
+ if(thisTabOpts != null){
154
+ var preSelectLi = tabColumn.find("ul > li").eq(thisTabOpts.selected);
155
+ handleTabClick(preSelectLi,thisTabOpts.selected,tabRoot,false);
156
+ }
157
+
158
+ /* equalize heights if user specified to do so */
159
+ var thisTabOpts = allTabOptions[elmId];
160
+ if(thisTabOpts != null && thisTabOpts.equalHeights){
161
+ equalizeHeights(tabContentColumn);
162
+ }
163
+
164
+ /* make sure that the content panels are not shorter than the tabColumn element */
165
+ tabColumnHeight = getTotalTabsHeight(tabRoot);
166
+ setMinHeight(tabContentColumn,tabColumnHeight);
167
+
168
+ adjustMargin(tabRoot);
169
+
170
+ });
171
+
172
+ /**
173
+ * Selects a tab (opens the tab.)
174
+ *
175
+ * tabRoot - Reference to the root tab element.
176
+ * index - the tab to open, 0-based index. 0 = first tab, 1 = second tab, etc...
177
+ */
178
+ function doSelectTab(tabRoot,index){
179
+ var tabColumn = tabRoot.children("div.vtabs-tab-column");
180
+ var tabContentColumn = tabRoot.children("div.vtabs-content-column");
181
+ var selectLi = tabColumn.find("ul > li").eq(index);
182
+ handleTabClick(selectLi,index,tabRoot,true);
183
+ }
184
+
185
+ /**
186
+ * Click event handler.
187
+ *
188
+ * li - <li></li> element that was clicked
189
+ * liIndex - index of the <li></li> element that was clicked. 0-based.
190
+ * tabRoot - Reference to the root tab element.
191
+ * doSelectedCallBack - true to call the 'select' callback function, false not to.
192
+ */
193
+ function handleTabClick(li,liIndex,tabRoot,doSelectedCallBack){
194
+
195
+ var elmId = tabRoot.attr('id');
196
+ var tabCol = tabRoot.children("div.vtabs-tab-column");
197
+ var tabContentCol = tabRoot.children("div.vtabs-content-column");
198
+
199
+ /* set css to closed for ones that are currently open */
200
+ tabCol.find("ul > li").each(function(i){
201
+ if($(this).hasClass("open")){
202
+ $(this).removeClass("open").addClass("closed");
203
+ $(this).find("a").removeClass("open").addClass("closed");
204
+ }
205
+ });
206
+ /* set css for tab that was clicked */
207
+ li.removeClass("closed").addClass("open");
208
+ li.find("a").removeClass("closed").addClass("open");
209
+
210
+ /* hide all content panels and get reference to panel that needs to be showed. */
211
+ var openContentPanel;
212
+ tabContentCol.children("div.vtabs-content-panel").each(function(i){
213
+ $(this).hide();
214
+ if(i == liIndex){
215
+ openContentPanel = $(this);
216
+ }
217
+ });
218
+
219
+ /* get link ahref value to see if we need to make an ajax call */
220
+ var link = li.find("a");
221
+ var linkText = link.text();
222
+ var linkValue = link.attr("href");
223
+ if(!linkValue.startsWith("#")){
224
+ // set spinner message on link if we have a spinner value
225
+ if(opts.spinner != ""){
226
+ link.text(opts.spinner);
227
+ }
228
+ // make ajax call to get data
229
+ $.ajax({
230
+ url: linkValue,
231
+ type: "POST",
232
+ //dataType: "html",
233
+ success: function(data) {
234
+ // set data
235
+ openContentPanel.html(data);
236
+ // open panel
237
+ openContentPanel.fadeIn(10);
238
+ // set link text back to what it originally was
239
+ link.text(linkText);
240
+ /* re-equalize heights if user specified to do so */
241
+ var thisTabOpts = allTabOptions[elmId];
242
+ if(thisTabOpts != null && thisTabOpts.equalHeights){
243
+ equalizeHeights(tabContentCol);
244
+ }
245
+ },
246
+ error: function(request,status,errorThrown) {
247
+ // set link text back to what it originally was
248
+ link.text(linkText);
249
+ // alert error to user
250
+ alert("Error requesting " + linkValue + ": " + errorThrown);
251
+ }
252
+ });
253
+ }else{
254
+ // no ajax request, open the panel
255
+ openContentPanel.fadeIn(10);
256
+ }
257
+
258
+ /* see if the user provided an optional callback function to call when a tab is clicked */
259
+ var thisTabOpts = allTabOptions[elmId];
260
+ if(thisTabOpts != null && doSelectedCallBack){
261
+ if(jQuery.isFunction(thisTabOpts.select)){
262
+ thisTabOpts.select.call(this,liIndex);
263
+ }
264
+ }
265
+
266
+ };
267
+
268
+ /**
269
+ * Loop through all tabs and sum all their heights.
270
+ */
271
+ function getTotalTabsHeight(tabRoot){
272
+ /* locate all li elements */
273
+ var height = 0;
274
+ tabRoot.find(".vtabs-tab-column > ul > li").each(function(i){
275
+ //height += parseInt( $(this).css("height").replace("px","") );
276
+ height += $(this).outerHeight(true);
277
+ });
278
+ return height;
279
+ }
280
+
281
+ /**
282
+ * Sets the height (min-height) of all content panels to that of the tallest one.
283
+ *
284
+ * tabContentCol - reference to the #vtabs-content-column element
285
+ */
286
+ function equalizeHeights(tabContentCol){
287
+ var tallest = getTallestHeight(tabContentCol);
288
+ //alert("Equalize heights to: " + tallest);
289
+ setMinHeight(tabContentCol,tallest);
290
+ };
291
+
292
+ /**
293
+ * Iterates through all content panels and gets the height of the tallest one.
294
+ *
295
+ * tabContentCol - reference to the #vtabs-content-column element
296
+ */
297
+ function getTallestHeight(tabContentCol){
298
+ var maxHeight = 0, currentHeight = 0;
299
+ tabContentCol.children("div.vtabs-content-panel").each(function(i){
300
+ //currentHeight = parseInt( $(this).css("height").replace("px","") );
301
+ currentHeight = $(this).height();
302
+ if(currentHeight > maxHeight){
303
+ maxHeight = currentHeight;
304
+ }
305
+ });
306
+ return maxHeight;
307
+ };
308
+
309
+ /**
310
+ * Iterates through all content panels and sets the min-height value for each one.
311
+ *
312
+ * tabContentCol - reference to the #vtabs-content-column element
313
+ * minHeight - the min-height value
314
+ */
315
+ function setMinHeight(tabContentCol,minHeight){
316
+ var panelHeight = 0;
317
+ tabContentCol.children("div.vtabs-content-panel").each(function(i){
318
+ panelHeight = $(this).height();
319
+ if(panelHeight < minHeight){
320
+ $(this).css("min-height",minHeight);
321
+ //$(this).css("height",minHeight);
322
+ // set height if IE
323
+ if ($.browser.msie) {
324
+ //$(this).css("height",minHeight);
325
+ }
326
+ }
327
+ });
328
+ };
329
+
330
+ /**
331
+ * Adds the tab css classes to all the elements.
332
+ *
333
+ * tabRoot - reference to the root tab element.
334
+ */
335
+ function setStyle(tabRoot){
336
+ tabRoot.addClass("vtabs");
337
+ tabRoot.children("div").eq(0).addClass("vtabs-tab-column");
338
+ tabRoot.children("div").eq(1).addClass("vtabs-content-column");
339
+ tabRoot.children("div").eq(1).children("div").addClass("vtabs-content-panel");
340
+ };
341
+
342
+ /**
343
+ * Adjusts the left margin of the content column so it lines up with the edges of the tabs.
344
+ *
345
+ * tabRoot - reference to the root tab element.
346
+ */
347
+ function adjustMargin(tabRoot){
348
+ var tabColumn = tabRoot.children("div.vtabs-tab-column");
349
+ var tabColWidth = tabColumn.width();
350
+ $(tabRoot).children('div.vtabs-content-column').css({"margin-left": tabColWidth-1 + "px"});
351
+ //alert("Client Width of tabColumn: " + $(tabColumn).get(0).clientWidth); // convert jquery object to DOM element using get(0) call.
352
+ }
353
+
354
+ };
355
+
356
+ })(jQuery);
includes/common/js/jquery.colorbox-min.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ // ColorBox v1.3.19.3 - jQuery lightbox plugin
2
+ // (c) 2011 Jack Moore - jacklmoore.com
3
+ // License: http://www.opensource.org/licenses/mit-license.php
4
+ (function(a,b,c){function Z(c,d,e){var g=b.createElement(c);return d&&(g.id=f+d),e&&(g.style.cssText=e),a(g)}function $(a){var b=y.length,c=(Q+a)%b;return c<0?b+c:c}function _(a,b){return Math.round((/%/.test(a)?(b==="x"?z.width():z.height())/100:1)*parseInt(a,10))}function ab(a){return K.photo||/\.(gif|png|jpe?g|bmp|ico)((#|\?).*)?$/i.test(a)}function bb(){var b,c=a.data(P,e);c==null?(K=a.extend({},d),console&&console.log&&console.log("Error: cboxElement missing settings object")):K=a.extend({},c);for(b in K)a.isFunction(K[b])&&b.slice(0,2)!=="on"&&(K[b]=K[b].call(P));K.rel=K.rel||P.rel||"nofollow",K.href=K.href||a(P).attr("href"),K.title=K.title||P.title,typeof K.href=="string"&&(K.href=a.trim(K.href))}function cb(b,c){a.event.trigger(b),c&&c.call(P)}function db(){var a,b=f+"Slideshow_",c="click."+f,d,e,g;K.slideshow&&y[1]?(d=function(){F.text(K.slideshowStop).unbind(c).bind(j,function(){if(K.loop||y[Q+1])a=setTimeout(W.next,K.slideshowSpeed)}).bind(i,function(){clearTimeout(a)}).one(c+" "+k,e),r.removeClass(b+"off").addClass(b+"on"),a=setTimeout(W.next,K.slideshowSpeed)},e=function(){clearTimeout(a),F.text(K.slideshowStart).unbind([j,i,k,c].join(" ")).one(c,function(){W.next(),d()}),r.removeClass(b+"on").addClass(b+"off")},K.slideshowAuto?d():e()):r.removeClass(b+"off "+b+"on")}function eb(b){U||(P=b,bb(),y=a(P),Q=0,K.rel!=="nofollow"&&(y=a("."+g).filter(function(){var b=a.data(this,e),c;return b&&(c=b.rel||this.rel),c===K.rel}),Q=y.index(P),Q===-1&&(y=y.add(P),Q=y.length-1)),S||(S=T=!0,r.show(),K.returnFocus&&a(P).blur().one(l,function(){a(this).focus()}),q.css({opacity:+K.opacity,cursor:K.overlayClose?"pointer":"auto"}).show(),K.w=_(K.initialWidth,"x"),K.h=_(K.initialHeight,"y"),W.position(),o&&z.bind("resize."+p+" scroll."+p,function(){q.css({width:z.width(),height:z.height(),top:z.scrollTop(),left:z.scrollLeft()})}).trigger("resize."+p),cb(h,K.onOpen),J.add(D).hide(),I.html(K.close).show()),W.load(!0))}function fb(){!r&&b.body&&(Y=!1,z=a(c),r=Z(X).attr({id:e,"class":n?f+(o?"IE6":"IE"):""}).hide(),q=Z(X,"Overlay",o?"position:absolute":"").hide(),s=Z(X,"Wrapper"),t=Z(X,"Content").append(A=Z(X,"LoadedContent","width:0; height:0; overflow:hidden"),C=Z(X,"LoadingOverlay").add(Z(X,"LoadingGraphic")),D=Z(X,"Title"),E=Z(X,"Current"),G=Z(X,"Next"),H=Z(X,"Previous"),F=Z(X,"Slideshow").bind(h,db),I=Z(X,"Close")),s.append(Z(X).append(Z(X,"TopLeft"),u=Z(X,"TopCenter"),Z(X,"TopRight")),Z(X,!1,"clear:left").append(v=Z(X,"MiddleLeft"),t,w=Z(X,"MiddleRight")),Z(X,!1,"clear:left").append(Z(X,"BottomLeft"),x=Z(X,"BottomCenter"),Z(X,"BottomRight"))).find("div div").css({"float":"left"}),B=Z(X,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),J=G.add(H).add(E).add(F),a(b.body).append(q,r.append(s,B)))}function gb(){return r?(Y||(Y=!0,L=u.height()+x.height()+t.outerHeight(!0)-t.height(),M=v.width()+w.width()+t.outerWidth(!0)-t.width(),N=A.outerHeight(!0),O=A.outerWidth(!0),r.css({"padding-bottom":L,"padding-right":M}),G.click(function(){W.next()}),H.click(function(){W.prev()}),I.click(function(){W.close()}),q.click(function(){K.overlayClose&&W.close()}),a(b).bind("keydown."+f,function(a){var b=a.keyCode;S&&K.escKey&&b===27&&(a.preventDefault(),W.close()),S&&K.arrowKey&&y[1]&&(b===37?(a.preventDefault(),H.click()):b===39&&(a.preventDefault(),G.click()))}),a("."+g,b).live("click",function(a){a.which>1||a.shiftKey||a.altKey||a.metaKey||(a.preventDefault(),eb(this))})),!0):!1}var d={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",open:!1,returnFocus:!0,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:undefined},e="colorbox",f="cbox",g=f+"Element",h=f+"_open",i=f+"_load",j=f+"_complete",k=f+"_cleanup",l=f+"_closed",m=f+"_purge",n=!a.support.opacity&&!a.support.style,o=n&&!c.XMLHttpRequest,p=f+"_IE6",q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X="div",Y;if(a.colorbox)return;a(fb),W=a.fn[e]=a[e]=function(b,c){var f=this;b=b||{},fb();if(gb()){if(!f[0]){if(f.selector)return f;f=a("<a/>"),b.open=!0}c&&(b.onComplete=c),f.each(function(){a.data(this,e,a.extend({},a.data(this,e)||d,b))}).addClass(g),(a.isFunction(b.open)&&b.open.call(f)||b.open)&&eb(f[0])}return f},W.position=function(a,b){function i(a){u[0].style.width=x[0].style.width=t[0].style.width=a.style.width,t[0].style.height=v[0].style.height=w[0].style.height=a.style.height}var c=0,d=0,e=r.offset(),g,h;z.unbind("resize."+f),r.css({top:-9e4,left:-9e4}),g=z.scrollTop(),h=z.scrollLeft(),K.fixed&&!o?(e.top-=g,e.left-=h,r.css({position:"fixed"})):(c=g,d=h,r.css({position:"absolute"})),K.right!==!1?d+=Math.max(z.width()-K.w-O-M-_(K.right,"x"),0):K.left!==!1?d+=_(K.left,"x"):d+=Math.round(Math.max(z.width()-K.w-O-M,0)/2),K.bottom!==!1?c+=Math.max(z.height()-K.h-N-L-_(K.bottom,"y"),0):K.top!==!1?c+=_(K.top,"y"):c+=Math.round(Math.max(z.height()-K.h-N-L,0)/2),r.css({top:e.top,left:e.left}),a=r.width()===K.w+O&&r.height()===K.h+N?0:a||0,s[0].style.width=s[0].style.height="9999px",r.dequeue().animate({width:K.w+O,height:K.h+N,top:c,left:d},{duration:a,complete:function(){i(this),T=!1,s[0].style.width=K.w+O+M+"px",s[0].style.height=K.h+N+L+"px",K.reposition&&setTimeout(function(){z.bind("resize."+f,W.position)},1),b&&b()},step:function(){i(this)}})},W.resize=function(a){S&&(a=a||{},a.width&&(K.w=_(a.width,"x")-O-M),a.innerWidth&&(K.w=_(a.innerWidth,"x")),A.css({width:K.w}),a.height&&(K.h=_(a.height,"y")-N-L),a.innerHeight&&(K.h=_(a.innerHeight,"y")),!a.innerHeight&&!a.height&&(A.css({height:"auto"}),K.h=A.height()),A.css({height:K.h}),W.position(K.transition==="none"?0:K.speed))},W.prep=function(b){function g(){return K.w=K.w||A.width(),K.w=K.mw&&K.mw<K.w?K.mw:K.w,K.w}function h(){return K.h=K.h||A.height(),K.h=K.mh&&K.mh<K.h?K.mh:K.h,K.h}if(!S)return;var c,d=K.transition==="none"?0:K.speed;A.remove(),A=Z(X,"LoadedContent").append(b),A.hide().appendTo(B.show()).css({width:g(),overflow:K.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(t),B.hide(),a(R).css({"float":"none"}),o&&a("select").not(r.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(k,function(){this.style.visibility="inherit"}),c=function(){function s(){n&&r[0].style.removeAttribute("filter")}var b,c,g=y.length,h,i="frameBorder",k="allowTransparency",l,o,p,q;if(!S)return;l=function(){clearTimeout(V),C.hide(),cb(j,K.onComplete)},n&&R&&A.fadeIn(100),D.html(K.title).add(A).show();if(g>1){typeof K.current=="string"&&E.html(K.current.replace("{current}",Q+1).replace("{total}",g)).show(),G[K.loop||Q<g-1?"show":"hide"]().html(K.next),H[K.loop||Q?"show":"hide"]().html(K.previous),K.slideshow&&F.show();if(K.preloading){b=[$(-1),$(1)];while(c=y[b.pop()])q=a.data(c,e),q&&q.href?(o=q.href,a.isFunction(o)&&(o=o.call(c))):o=c.href,ab(o)&&(p=new Image,p.src=o)}}else J.hide();K.iframe?(h=Z("iframe")[0],i in h&&(h[i]=0),k in h&&(h[k]="true"),h.name=f+ +(new Date),K.fastIframe?l():a(h).one("load",l),h.src=K.href,K.scrolling||(h.scrolling="no"),a(h).addClass(f+"Iframe").appendTo(A).one(m,function(){h.src="//about:blank"})):l(),K.transition==="fade"?r.fadeTo(d,1,s):s()},K.transition==="fade"?r.fadeTo(d,0,function(){W.position(0,c)}):W.position(d,c)},W.load=function(b){var c,d,e=W.prep;T=!0,R=!1,P=y[Q],b||bb(),cb(m),cb(i,K.onLoad),K.h=K.height?_(K.height,"y")-N-L:K.innerHeight&&_(K.innerHeight,"y"),K.w=K.width?_(K.width,"x")-O-M:K.innerWidth&&_(K.innerWidth,"x"),K.mw=K.w,K.mh=K.h,K.maxWidth&&(K.mw=_(K.maxWidth,"x")-O-M,K.mw=K.w&&K.w<K.mw?K.w:K.mw),K.maxHeight&&(K.mh=_(K.maxHeight,"y")-N-L,K.mh=K.h&&K.h<K.mh?K.h:K.mh),c=K.href,V=setTimeout(function(){C.show()},100),K.inline?(Z(X).hide().insertBefore(a(c)[0]).one(m,function(){a(this).replaceWith(A.children())}),e(a(c))):K.iframe?e(" "):K.html?e(K.html):ab(c)?(a(R=new Image).addClass(f+"Photo").error(function(){K.title=!1,e(Z(X,"Error").html(K.imgError))}).load(function(){var a;R.onload=null,K.scalePhotos&&(d=function(){R.height-=R.height*a,R.width-=R.width*a},K.mw&&R.width>K.mw&&(a=(R.width-K.mw)/R.width,d()),K.mh&&R.height>K.mh&&(a=(R.height-K.mh)/R.height,d())),K.h&&(R.style.marginTop=Math.max(K.h-R.height,0)/2+"px"),y[1]&&(K.loop||y[Q+1])&&(R.style.cursor="pointer",R.onclick=function(){W.next()}),n&&(R.style.msInterpolationMode="bicubic"),setTimeout(function(){e(R)},1)}),setTimeout(function(){R.src=c},1)):c&&B.load(c,K.data,function(b,c,d){e(c==="error"?Z(X,"Error").html(K.xhrError):a(this).contents())})},W.next=function(){!T&&y[1]&&(K.loop||y[Q+1])&&(Q=$(1),W.load())},W.prev=function(){!T&&y[1]&&(K.loop||Q)&&(Q=$(-1),W.load())},W.close=function(){S&&!U&&(U=!0,S=!1,cb(k,K.onCleanup),z.unbind("."+f+" ."+p),q.fadeTo(200,0),r.stop().fadeTo(300,0,function(){r.add(q).css({opacity:1,cursor:"auto"}).hide(),cb(m),A.remove(),setTimeout(function(){U=!1,cb(l,K.onClosed)},1)}))},W.remove=function(){a([]).add(r).add(q).remove(),r=null,a("."+g).removeData(e).removeClass(g).die()},W.element=function(){return a(P)},W.settings=d})(jQuery,document,this);
includes/common/js/jquery.tzCheckbox.js ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($){
2
+ $.fn.tzCheckbox = function(options){
3
+
4
+ // Default On / Off labels:
5
+
6
+ options = $.extend({
7
+ labels : ['ON','OFF']
8
+ },options);
9
+
10
+ return this.each(function(){
11
+ var originalCheckBox = $(this),
12
+ labels = [];
13
+
14
+ // Checking for the data-on / data-off HTML5 data attributes:
15
+ if(originalCheckBox.data('on')){
16
+ labels[0] = originalCheckBox.data('on');
17
+ labels[1] = originalCheckBox.data('off');
18
+ }
19
+ else labels = options.labels;
20
+
21
+ // Creating the new checkbox markup:
22
+ var checkBox = $('<span>',{
23
+ class : 'tzCheckBox '+(this.checked?'checked':''),
24
+ html: '<span class="tzCBContent">'+labels[this.checked?0:1]+
25
+ '</span><span class="tzCBPart"></span>'
26
+ });
27
+
28
+ // Inserting the new checkbox, and hiding the original:
29
+ checkBox.insertAfter(originalCheckBox.hide());
30
+
31
+ checkBox.click(function(){
32
+ checkBox.toggleClass('checked');
33
+
34
+ var isChecked = checkBox.hasClass('checked');
35
+
36
+ // Synchronizing the original checkbox:
37
+ originalCheckBox.attr('checked',isChecked);
38
+ checkBox.find('.tzCBContent').html(labels[isChecked?0:1]);
39
+ });
40
+
41
+ // Listening for changes on the original and affecting the new one:
42
+ originalCheckBox.bind('change',function(){
43
+ checkBox.click();
44
+ });
45
+ });
46
+ };
47
+ })(jQuery);
includes/common/js/nicEdit-latest.js ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* NicEdit - Micro Inline WYSIWYG
2
+ * Copyright 2007-2008 Brian Kirchoff
3
+ *
4
+ * NicEdit is distributed under the terms of the MIT license
5
+ * For more information visit http://nicedit.com/
6
+ * Do not remove this copyright message
7
+ */
8
+ var bkExtend=function(){var A=arguments;if(A.length==1){A=[this,A[0]]}for(var B in A[1]){A[0][B]=A[1][B]}return A[0]};function bkClass(){}bkClass.prototype.construct=function(){};bkClass.extend=function(C){var A=function(){if(arguments[0]!==bkClass){return this.construct.apply(this,arguments)}};var B=new this(bkClass);bkExtend(B,C);A.prototype=B;A.extend=this.extend;return A};var bkElement=bkClass.extend({construct:function(B,A){if(typeof (B)=="string"){B=(A||document).createElement(B)}B=$BK(B);return B},appendTo:function(A){A.appendChild(this);return this},appendBefore:function(A){A.parentNode.insertBefore(this,A);return this},addEvent:function(B,A){bkLib.addEvent(this,B,A);return this},setContent:function(A){this.innerHTML=A;return this},pos:function(){var C=curtop=0;var B=obj=this;if(obj.offsetParent){do{C+=obj.offsetLeft;curtop+=obj.offsetTop}while(obj=obj.offsetParent)}var A=(!window.opera)?parseInt(this.getStyle("border-width")||this.style.border)||0:0;return[C+A,curtop+A+this.offsetHeight]},noSelect:function(){bkLib.noSelect(this);return this},parentTag:function(A){var B=this;do{if(B&&B.nodeName&&B.nodeName.toUpperCase()==A){return B}B=B.parentNode}while(B);return false},hasClass:function(A){return this.className.match(new RegExp("(\\s|^)nicEdit-"+A+"(\\s|$)"))},addClass:function(A){if(!this.hasClass(A)){this.className+=" nicEdit-"+A}return this},removeClass:function(A){if(this.hasClass(A)){this.className=this.className.replace(new RegExp("(\\s|^)nicEdit-"+A+"(\\s|$)")," ")}return this},setStyle:function(A){var B=this.style;for(var C in A){switch(C){case"float":B.cssFloat=B.styleFloat=A[C];break;case"opacity":B.opacity=A[C];B.filter="alpha(opacity="+Math.round(A[C]*100)+")";break;case"className":this.className=A[C];break;default:B[C]=A[C]}}return this},getStyle:function(A,C){var B=(!C)?document.defaultView:C;if(this.nodeType==1){return(B&&B.getComputedStyle)?B.getComputedStyle(this,null).getPropertyValue(A):this.currentStyle[bkLib.camelize(A)]}},remove:function(){this.parentNode.removeChild(this);return this},setAttributes:function(A){for(var B in A){this[B]=A[B]}return this}});var bkLib={isMSIE:(navigator.appVersion.indexOf("MSIE")!=-1),addEvent:function(C,B,A){(C.addEventListener)?C.addEventListener(B,A,false):C.attachEvent("on"+B,A)},toArray:function(C){var B=C.length,A=new Array(B);while(B--){A[B]=C[B]}return A},noSelect:function(B){if(B.setAttribute&&B.nodeName.toLowerCase()!="input"&&B.nodeName.toLowerCase()!="textarea"){B.setAttribute("unselectable","on")}for(var A=0;A<B.childNodes.length;A++){bkLib.noSelect(B.childNodes[A])}},camelize:function(A){return A.replace(/\-(.)/g,function(B,C){return C.toUpperCase()})},inArray:function(A,B){return(bkLib.search(A,B)!=null)},search:function(A,C){for(var B=0;B<A.length;B++){if(A[B]==C){return B}}return null},cancelEvent:function(A){A=A||window.event;if(A.preventDefault&&A.stopPropagation){A.preventDefault();A.stopPropagation()}return false},domLoad:[],domLoaded:function(){if(arguments.callee.done){return }arguments.callee.done=true;for(i=0;i<bkLib.domLoad.length;i++){bkLib.domLoad[i]()}},onDomLoaded:function(A){this.domLoad.push(A);if(document.addEventListener){document.addEventListener("DOMContentLoaded",bkLib.domLoaded,null)}else{if(bkLib.isMSIE){document.write("<style>.nicEdit-main p { margin: 0; }</style><script id=__ie_onload defer "+((location.protocol=="https:")?"src='javascript:void(0)'":"src=//0")+"><\/script>");$BK("__ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){bkLib.domLoaded()}}}}window.onload=bkLib.domLoaded}};function $BK(A){if(typeof (A)=="string"){A=document.getElementById(A)}return(A&&!A.appendTo)?bkExtend(A,bkElement.prototype):A}var bkEvent={addEvent:function(A,B){if(B){this.eventList=this.eventList||{};this.eventList[A]=this.eventList[A]||[];this.eventList[A].push(B)}return this},fireEvent:function(){var A=bkLib.toArray(arguments),C=A.shift();if(this.eventList&&this.eventList[C]){for(var B=0;B<this.eventList[C].length;B++){this.eventList[C][B].apply(this,A)}}}};function __(A){return A}Function.prototype.closure=function(){var A=this,B=bkLib.toArray(arguments),C=B.shift();return function(){if(typeof (bkLib)!="undefined"){return A.apply(C,B.concat(bkLib.toArray(arguments)))}}};Function.prototype.closureListener=function(){var A=this,C=bkLib.toArray(arguments),B=C.shift();return function(E){E=E||window.event;if(E.target){var D=E.target}else{var D=E.srcElement}return A.apply(B,[E,D].concat(C))}};
9
+
10
+
11
+
12
+ var nicEditorConfig = bkClass.extend({
13
+ buttons : {
14
+ 'bold' : {name : __('Click to Bold'), command : 'Bold', tags : ['B','STRONG'], css : {'font-weight' : 'bold'}, key : 'b'},
15
+ 'italic' : {name : __('Click to Italic'), command : 'Italic', tags : ['EM','I'], css : {'font-style' : 'italic'}, key : 'i'},
16
+ 'underline' : {name : __('Click to Underline'), command : 'Underline', tags : ['U'], css : {'text-decoration' : 'underline'}, key : 'u'},
17
+ 'left' : {name : __('Left Align'), command : 'justifyleft', noActive : true},
18
+ 'center' : {name : __('Center Align'), command : 'justifycenter', noActive : true},
19
+ 'right' : {name : __('Right Align'), command : 'justifyright', noActive : true},
20
+ 'justify' : {name : __('Justify Align'), command : 'justifyfull', noActive : true},
21
+ 'ol' : {name : __('Insert Ordered List'), command : 'insertorderedlist', tags : ['OL']},
22
+ 'ul' : {name : __('Insert Unordered List'), command : 'insertunorderedlist', tags : ['UL']},
23
+ 'subscript' : {name : __('Click to Subscript'), command : 'subscript', tags : ['SUB']},
24
+ 'superscript' : {name : __('Click to Superscript'), command : 'superscript', tags : ['SUP']},
25
+ 'strikethrough' : {name : __('Click to Strike Through'), command : 'strikeThrough', css : {'text-decoration' : 'line-through'}},
26
+ 'removeformat' : {name : __('Remove Formatting'), command : 'removeformat', noActive : true},
27
+ 'indent' : {name : __('Indent Text'), command : 'indent', noActive : true},
28
+ 'outdent' : {name : __('Remove Indent'), command : 'outdent', noActive : true},
29
+ 'hr' : {name : __('Horizontal Rule'), command : 'insertHorizontalRule', noActive : true}
30
+ },
31
+ iconsPath : 'http://js.nicedit.com/nicEditIcons-latest.gif',
32
+ buttonList : ['save','bold','italic','underline','left','center','right','justify','ol','ul','fontSize','fontFamily','fontFormat','indent','outdent','image','upload','link','unlink','forecolor','bgcolor'],
33
+ iconList : {"xhtml":1,"bgcolor":2,"forecolor":3,"bold":4,"center":5,"hr":6,"indent":7,"italic":8,"justify":9,"left":10,"ol":11,"outdent":12,"removeformat":13,"right":14,"save":25,"strikethrough":16,"subscript":17,"superscript":18,"ul":19,"underline":20,"image":21,"link":22,"unlink":23,"close":24,"arrow":26,"upload":27}
34
+
35
+ });
36
+ ;
37
+ var nicEditors={nicPlugins:[],editors:[],registerPlugin:function(B,A){this.nicPlugins.push({p:B,o:A})},allTextAreas:function(C){var A=document.getElementsByTagName("textarea");for(var B=0;B<A.length;B++){nicEditors.editors.push(new nicEditor(C).panelInstance(A[B]))}return nicEditors.editors},findEditor:function(C){var B=nicEditors.editors;for(var A=0;A<B.length;A++){if(B[A].instanceById(C)){return B[A].instanceById(C)}}}};var nicEditor=bkClass.extend({construct:function(C){this.options=new nicEditorConfig();bkExtend(this.options,C);this.nicInstances=new Array();this.loadedPlugins=new Array();var A=nicEditors.nicPlugins;for(var B=0;B<A.length;B++){this.loadedPlugins.push(new A[B].p(this,A[B].o))}nicEditors.editors.push(this);bkLib.addEvent(document.body,"mousedown",this.selectCheck.closureListener(this))},panelInstance:function(B,C){B=this.checkReplace($BK(B));var A=new bkElement("DIV").setStyle({width:"100%"}).appendBefore(B);this.setPanel(A);return this.addInstance(B,C)},checkReplace:function(B){var A=nicEditors.findEditor(B);if(A){A.removeInstance(B);A.removePanel()}return B},addInstance:function(B,C){B=this.checkReplace($BK(B));if(B.contentEditable||!!window.opera){var A=new nicEditorInstance(B,C,this)}else{var A=new nicEditorIFrameInstance(B,C,this)}this.nicInstances.push(A);return this},removeInstance:function(C){C=$BK(C);var B=this.nicInstances;for(var A=0;A<B.length;A++){if(B[A].e==C){B[A].remove();this.nicInstances.splice(A,1)}}},removePanel:function(A){if(this.nicPanel){this.nicPanel.remove();this.nicPanel=null}},instanceById:function(C){C=$BK(C);var B=this.nicInstances;for(var A=0;A<B.length;A++){if(B[A].e==C){return B[A]}}},setPanel:function(A){this.nicPanel=new nicEditorPanel($BK(A),this.options,this);this.fireEvent("panel",this.nicPanel);return this},nicCommand:function(B,A){if(this.selectedInstance){this.selectedInstance.nicCommand(B,A)}},getIcon:function(D,A){var C=this.options.iconList[D];var B=(A.iconFiles)?A.iconFiles[D]:"";return{backgroundImage:"url('"+((C)?this.options.iconsPath:B)+"')",backgroundPosition:((C)?((C-1)*-18):0)+"px 0px"}},selectCheck:function(C,A){var B=false;do{if(A.className&&A.className.indexOf("nicEdit")!=-1){return false}}while(A=A.parentNode);this.fireEvent("blur",this.selectedInstance,A);this.lastSelectedInstance=this.selectedInstance;this.selectedInstance=null;return false}});nicEditor=nicEditor.extend(bkEvent);
38
+ var nicEditorInstance=bkClass.extend({isSelected:false,construct:function(G,D,C){this.ne=C;this.elm=this.e=G;this.options=D||{};newX=parseInt(G.getStyle("width"))||G.clientWidth;newY=parseInt(G.getStyle("height"))||G.clientHeight;this.initialHeight=newY-8;var H=(G.nodeName.toLowerCase()=="textarea");if(H||this.options.hasPanel){var B=(bkLib.isMSIE&&!((typeof document.body.style.maxHeight!="undefined")&&document.compatMode=="CSS1Compat"));var E={width:"100%",border:"1px solid #ccc",borderTop:0,overflowY:"auto",overflowX:"hidden"};E[(B)?"height":"maxHeight"]=(this.ne.options.maxHeight)?this.ne.options.maxHeight+"px":null;this.editorContain=new bkElement("DIV").setStyle(E).appendBefore(G);var A=new bkElement("DIV").setStyle({width:"100%",margin:"4px",minHeight:newY+"px"}).addClass("main").appendTo(this.editorContain);G.setStyle({display:"none"});A.innerHTML=G.innerHTML;if(H){A.setContent(G.value);this.copyElm=G;var F=G.parentTag("FORM");if(F){bkLib.addEvent(F,"submit",this.saveContent.closure(this))}}A.setStyle((B)?{height:newY+"px"}:{overflow:"hidden"});this.elm=A}this.ne.addEvent("blur",this.blur.closure(this));this.init();this.blur()},init:function(){this.elm.setAttribute("contentEditable","true");if(this.getContent()==""){this.setContent("<br />")}this.instanceDoc=document.defaultView;this.elm.addEvent("mousedown",this.selected.closureListener(this)).addEvent("keypress",this.keyDown.closureListener(this)).addEvent("focus",this.selected.closure(this)).addEvent("blur",this.blur.closure(this)).addEvent("keyup",this.selected.closure(this));this.ne.fireEvent("add",this)},remove:function(){this.saveContent();if(this.copyElm||this.options.hasPanel){this.editorContain.remove();this.e.setStyle({display:"block"});this.ne.removePanel()}this.disable();this.ne.fireEvent("remove",this)},disable:function(){this.elm.setAttribute("contentEditable","false")},getSel:function(){return(window.getSelection)?window.getSelection():document.selection},getRng:function(){var A=this.getSel();if(!A||A.rangeCount===0){return }return(A.rangeCount>0)?A.getRangeAt(0):A.createRange()},selRng:function(A,B){if(window.getSelection){B.removeAllRanges();B.addRange(A)}else{A.select()}},selElm:function(){var C=this.getRng();if(!C){return }if(C.startContainer){var D=C.startContainer;if(C.cloneContents().childNodes.length==1){for(var B=0;B<D.childNodes.length;B++){var A=D.childNodes[B].ownerDocument.createRange();A.selectNode(D.childNodes[B]);if(C.compareBoundaryPoints(Range.START_TO_START,A)!=1&&C.compareBoundaryPoints(Range.END_TO_END,A)!=-1){return $BK(D.childNodes[B])}}}return $BK(D)}else{return $BK((this.getSel().type=="Control")?C.item(0):C.parentElement())}},saveRng:function(){this.savedRange=this.getRng();this.savedSel=this.getSel()},restoreRng:function(){if(this.savedRange){this.selRng(this.savedRange,this.savedSel)}},keyDown:function(B,A){if(B.ctrlKey){this.ne.fireEvent("key",this,B)}},selected:function(C,A){if(!A&&!(A=this.selElm)){A=this.selElm()}if(!C.ctrlKey){var B=this.ne.selectedInstance;if(B!=this){if(B){this.ne.fireEvent("blur",B,A)}this.ne.selectedInstance=this;this.ne.fireEvent("focus",B,A)}this.ne.fireEvent("selected",B,A);this.isFocused=true;this.elm.addClass("selected")}return false},blur:function(){this.isFocused=false;this.elm.removeClass("selected")},saveContent:function(){if(this.copyElm||this.options.hasPanel){this.ne.fireEvent("save",this);(this.copyElm)?this.copyElm.value=this.getContent():this.e.innerHTML=this.getContent()}},getElm:function(){return this.elm},getContent:function(){this.content=this.getElm().innerHTML;this.ne.fireEvent("get",this);return this.content},setContent:function(A){this.content=A;this.ne.fireEvent("set",this);this.elm.innerHTML=this.content},nicCommand:function(B,A){document.execCommand(B,false,A)}});
39
+ var nicEditorIFrameInstance=nicEditorInstance.extend({savedStyles:[],init:function(){var B=this.elm.innerHTML.replace(/^\s+|\s+$/g,"");this.elm.innerHTML="";(!B)?B="<br />":B;this.initialContent=B;this.elmFrame=new bkElement("iframe").setAttributes({src:"javascript:;",frameBorder:0,allowTransparency:"true",scrolling:"no"}).setStyle({height:"100px",width:"100%"}).addClass("frame").appendTo(this.elm);if(this.copyElm){this.elmFrame.setStyle({width:(this.elm.offsetWidth-4)+"px"})}var A=["font-size","font-family","font-weight","color"];for(itm in A){this.savedStyles[bkLib.camelize(itm)]=this.elm.getStyle(itm)}setTimeout(this.initFrame.closure(this),50)},disable:function(){this.elm.innerHTML=this.getContent()},initFrame:function(){var B=$BK(this.elmFrame.contentWindow.document);B.designMode="on";B.open();var A=this.ne.options.externalCSS;B.write("<html><head>"+((A)?'<link href="'+A+'" rel="stylesheet" type="text/css" />':"")+'</head><body id="nicEditContent" style="margin: 0 !important; background-color: transparent !important;">'+this.initialContent+"</body></html>");B.close();this.frameDoc=B;this.frameWin=$BK(this.elmFrame.contentWindow);this.frameContent=$BK(this.frameWin.document.body).setStyle(this.savedStyles);this.instanceDoc=this.frameWin.document.defaultView;this.heightUpdate();this.frameDoc.addEvent("mousedown",this.selected.closureListener(this)).addEvent("keyup",this.heightUpdate.closureListener(this)).addEvent("keydown",this.keyDown.closureListener(this)).addEvent("keyup",this.selected.closure(this));this.ne.fireEvent("add",this)},getElm:function(){return this.frameContent},setContent:function(A){this.content=A;this.ne.fireEvent("set",this);this.frameContent.innerHTML=this.content;this.heightUpdate()},getSel:function(){return(this.frameWin)?this.frameWin.getSelection():this.frameDoc.selection},heightUpdate:function(){this.elmFrame.style.height=Math.max(this.frameContent.offsetHeight,this.initialHeight)+"px"},nicCommand:function(B,A){this.frameDoc.execCommand(B,false,A);setTimeout(this.heightUpdate.closure(this),100)}});
40
+ var nicEditorPanel=bkClass.extend({construct:function(E,B,A){this.elm=E;this.options=B;this.ne=A;this.panelButtons=new Array();this.buttonList=bkExtend([],this.ne.options.buttonList);this.panelContain=new bkElement("DIV").setStyle({overflow:"hidden",width:"100%",border:"1px solid #cccccc",backgroundColor:"#efefef"}).addClass("panelContain");this.panelElm=new bkElement("DIV").setStyle({margin:"2px",marginTop:"0px",zoom:1,overflow:"hidden"}).addClass("panel").appendTo(this.panelContain);this.panelContain.appendTo(E);var C=this.ne.options;var D=C.buttons;for(button in D){this.addButton(button,C,true)}this.reorder();E.noSelect()},addButton:function(buttonName,options,noOrder){var button=options.buttons[buttonName];var type=(button.type)?eval("(typeof("+button.type+') == "undefined") ? null : '+button.type+";"):nicEditorButton;var hasButton=bkLib.inArray(this.buttonList,buttonName);if(type&&(hasButton||this.ne.options.fullPanel)){this.panelButtons.push(new type(this.panelElm,buttonName,options,this.ne));if(!hasButton){this.buttonList.push(buttonName)}}},findButton:function(B){for(var A=0;A<this.panelButtons.length;A++){if(this.panelButtons[A].name==B){return this.panelButtons[A]}}},reorder:function(){var C=this.buttonList;for(var B=0;B<C.length;B++){var A=this.findButton(C[B]);if(A){this.panelElm.appendChild(A.margin)}}},remove:function(){this.elm.remove()}});
41
+ var nicEditorButton=bkClass.extend({construct:function(D,A,C,B){this.options=C.buttons[A];this.name=A;this.ne=B;this.elm=D;this.margin=new bkElement("DIV").setStyle({"float":"left",marginTop:"2px"}).appendTo(D);this.contain=new bkElement("DIV").setStyle({width:"20px",height:"20px"}).addClass("buttonContain").appendTo(this.margin);this.border=new bkElement("DIV").setStyle({backgroundColor:"#efefef",border:"1px solid #efefef"}).appendTo(this.contain);this.button=new bkElement("DIV").setStyle({width:"18px",height:"18px",overflow:"hidden",zoom:1,cursor:"pointer"}).addClass("button").setStyle(this.ne.getIcon(A,C)).appendTo(this.border);this.button.addEvent("mouseover",this.hoverOn.closure(this)).addEvent("mouseout",this.hoverOff.closure(this)).addEvent("mousedown",this.mouseClick.closure(this)).noSelect();if(!window.opera){this.button.onmousedown=this.button.onclick=bkLib.cancelEvent}B.addEvent("selected",this.enable.closure(this)).addEvent("blur",this.disable.closure(this)).addEvent("key",this.key.closure(this));this.disable();this.init()},init:function(){},hide:function(){this.contain.setStyle({display:"none"})},updateState:function(){if(this.isDisabled){this.setBg()}else{if(this.isHover){this.setBg("hover")}else{if(this.isActive){this.setBg("active")}else{this.setBg()}}}},setBg:function(A){switch(A){case"hover":var B={border:"1px solid #666",backgroundColor:"#ddd"};break;case"active":var B={border:"1px solid #666",backgroundColor:"#ccc"};break;default:var B={border:"1px solid #efefef",backgroundColor:"#efefef"}}this.border.setStyle(B).addClass("button-"+A)},checkNodes:function(A){var B=A;do{if(this.options.tags&&bkLib.inArray(this.options.tags,B.nodeName)){this.activate();return true}}while(B=B.parentNode&&B.className!="nicEdit");B=$BK(A);while(B.nodeType==3){B=$BK(B.parentNode)}if(this.options.css){for(itm in this.options.css){if(B.getStyle(itm,this.ne.selectedInstance.instanceDoc)==this.options.css[itm]){this.activate();return true}}}this.deactivate();return false},activate:function(){if(!this.isDisabled){this.isActive=true;this.updateState();this.ne.fireEvent("buttonActivate",this)}},deactivate:function(){this.isActive=false;this.updateState();if(!this.isDisabled){this.ne.fireEvent("buttonDeactivate",this)}},enable:function(A,B){this.isDisabled=false;this.contain.setStyle({opacity:1}).addClass("buttonEnabled");this.updateState();this.checkNodes(B)},disable:function(A,B){this.isDisabled=true;this.contain.setStyle({opacity:0.6}).removeClass("buttonEnabled");this.updateState()},toggleActive:function(){(this.isActive)?this.deactivate():this.activate()},hoverOn:function(){if(!this.isDisabled){this.isHover=true;this.updateState();this.ne.fireEvent("buttonOver",this)}},hoverOff:function(){this.isHover=false;this.updateState();this.ne.fireEvent("buttonOut",this)},mouseClick:function(){if(this.options.command){this.ne.nicCommand(this.options.command,this.options.commandArgs);if(!this.options.noActive){this.toggleActive()}}this.ne.fireEvent("buttonClick",this)},key:function(A,B){if(this.options.key&&B.ctrlKey&&String.fromCharCode(B.keyCode||B.charCode).toLowerCase()==this.options.key){this.mouseClick();if(B.preventDefault){B.preventDefault()}}}});
42
+ var nicPlugin=bkClass.extend({construct:function(B,A){this.options=A;this.ne=B;this.ne.addEvent("panel",this.loadPanel.closure(this));this.init()},loadPanel:function(C){var B=this.options.buttons;for(var A in B){C.addButton(A,this.options)}C.reorder()},init:function(){}});
43
+
44
+
45
+ var nicPaneOptions = { };
46
+
47
+ var nicEditorPane=bkClass.extend({construct:function(D,C,B,A){this.ne=C;this.elm=D;this.pos=D.pos();this.contain=new bkElement("div").setStyle({zIndex:"99999",overflow:"hidden",position:"absolute",left:this.pos[0]+"px",top:this.pos[1]+"px"});this.pane=new bkElement("div").setStyle({fontSize:"12px",border:"1px solid #ccc",overflow:"hidden",padding:"4px",textAlign:"left",backgroundColor:"#ffffc9"}).addClass("pane").setStyle(B).appendTo(this.contain);if(A&&!A.options.noClose){this.close=new bkElement("div").setStyle({"float":"right",height:"16px",width:"16px",cursor:"pointer"}).setStyle(this.ne.getIcon("close",nicPaneOptions)).addEvent("mousedown",A.removePane.closure(this)).appendTo(this.pane)}this.contain.noSelect().appendTo(document.body);this.position();this.init()},init:function(){},position:function(){if(this.ne.nicPanel){var B=this.ne.nicPanel.elm;var A=B.pos();var C=A[0]+parseInt(B.getStyle("width"))-(parseInt(this.pane.getStyle("width"))+8);if(C<this.pos[0]){this.contain.setStyle({left:C+"px"})}}},toggle:function(){this.isVisible=!this.isVisible;this.contain.setStyle({display:((this.isVisible)?"block":"none")})},remove:function(){if(this.contain){this.contain.remove();this.contain=null}},append:function(A){A.appendTo(this.pane)},setContent:function(A){this.pane.setContent(A)}});
48
+
49
+
50
+ var nicSelectOptions = {
51
+ buttons : {
52
+ 'fontSize' : {name : __('Select Font Size'), type : 'nicEditorFontSizeSelect', command : 'fontsize'},
53
+ 'fontFamily' : {name : __('Select Font Family'), type : 'nicEditorFontFamilySelect', command : 'fontname'},
54
+ 'fontFormat' : {name : __('Select Font Format'), type : 'nicEditorFontFormatSelect', command : 'formatBlock'}
55
+ }
56
+ };
57
+
58
+ var nicEditorSelect=bkClass.extend({construct:function(D,A,C,B){this.options=C.buttons[A];this.elm=D;this.ne=B;this.name=A;this.selOptions=new Array();this.margin=new bkElement("div").setStyle({"float":"left",margin:"2px 1px 0 1px"}).appendTo(this.elm);this.contain=new bkElement("div").setStyle({width:"90px",height:"20px",cursor:"pointer",overflow:"hidden"}).addClass("selectContain").addEvent("click",this.toggle.closure(this)).appendTo(this.margin);this.items=new bkElement("div").setStyle({overflow:"hidden",zoom:1,border:"1px solid #ccc",paddingLeft:"3px",backgroundColor:"#fff"}).appendTo(this.contain);this.control=new bkElement("div").setStyle({overflow:"hidden","float":"right",height:"18px",width:"16px"}).addClass("selectControl").setStyle(this.ne.getIcon("arrow",C)).appendTo(this.items);this.txt=new bkElement("div").setStyle({overflow:"hidden","float":"left",width:"66px",height:"14px",marginTop:"1px",fontFamily:"sans-serif",textAlign:"center",fontSize:"12px"}).addClass("selectTxt").appendTo(this.items);if(!window.opera){this.contain.onmousedown=this.control.onmousedown=this.txt.onmousedown=bkLib.cancelEvent}this.margin.noSelect();this.ne.addEvent("selected",this.enable.closure(this)).addEvent("blur",this.disable.closure(this));this.disable();this.init()},disable:function(){this.isDisabled=true;this.close();this.contain.setStyle({opacity:0.6})},enable:function(A){this.isDisabled=false;this.close();this.contain.setStyle({opacity:1})},setDisplay:function(A){this.txt.setContent(A)},toggle:function(){if(!this.isDisabled){(this.pane)?this.close():this.open()}},open:function(){this.pane=new nicEditorPane(this.items,this.ne,{width:"88px",padding:"0px",borderTop:0,borderLeft:"1px solid #ccc",borderRight:"1px solid #ccc",borderBottom:"0px",backgroundColor:"#fff"});for(var C=0;C<this.selOptions.length;C++){var B=this.selOptions[C];var A=new bkElement("div").setStyle({overflow:"hidden",borderBottom:"1px solid #ccc",width:"88px",textAlign:"left",overflow:"hidden",cursor:"pointer"});var D=new bkElement("div").setStyle({padding:"0px 4px"}).setContent(B[1]).appendTo(A).noSelect();D.addEvent("click",this.update.closure(this,B[0])).addEvent("mouseover",this.over.closure(this,D)).addEvent("mouseout",this.out.closure(this,D)).setAttributes("id",B[0]);this.pane.append(A);if(!window.opera){D.onmousedown=bkLib.cancelEvent}}},close:function(){if(this.pane){this.pane=this.pane.remove()}},over:function(A){A.setStyle({backgroundColor:"#ccc"})},out:function(A){A.setStyle({backgroundColor:"#fff"})},add:function(B,A){this.selOptions.push(new Array(B,A))},update:function(A){this.ne.nicCommand(this.options.command,A);this.close()}});var nicEditorFontSizeSelect=nicEditorSelect.extend({sel:{1:"1&nbsp;(8pt)",2:"2&nbsp;(10pt)",3:"3&nbsp;(12pt)",4:"4&nbsp;(14pt)",5:"5&nbsp;(18pt)",6:"6&nbsp;(24pt)"},init:function(){this.setDisplay("Font&nbsp;Size...");for(itm in this.sel){this.add(itm,'<font size="'+itm+'">'+this.sel[itm]+"</font>")}}});var nicEditorFontFamilySelect=nicEditorSelect.extend({sel:{arial:"Arial","comic sans ms":"Comic Sans","courier new":"Courier New",georgia:"Georgia",helvetica:"Helvetica",impact:"Impact","times new roman":"Times","trebuchet ms":"Trebuchet",verdana:"Verdana"},init:function(){this.setDisplay("Font&nbsp;Family...");for(itm in this.sel){this.add(itm,'<font face="'+itm+'">'+this.sel[itm]+"</font>")}}});var nicEditorFontFormatSelect=nicEditorSelect.extend({sel:{p:"Paragraph",pre:"Pre",h6:"Heading&nbsp;6",h5:"Heading&nbsp;5",h4:"Heading&nbsp;4",h3:"Heading&nbsp;3",h2:"Heading&nbsp;2",h1:"Heading&nbsp;1"},init:function(){this.setDisplay("Font&nbsp;Format...");for(itm in this.sel){var A=itm.toUpperCase();this.add("<"+A+">","<"+itm+' style="padding: 0px; margin: 0px;">'+this.sel[itm]+"</"+A+">")}}});nicEditors.registerPlugin(nicPlugin,nicSelectOptions);
59
+
60
+ var nicButtonTips=bkClass.extend({construct:function(A){this.ne=A;A.addEvent("buttonOver",this.show.closure(this)).addEvent("buttonOut",this.hide.closure(this))},show:function(A){this.timer=setTimeout(this.create.closure(this,A),400)},create:function(A){this.timer=null;if(!this.pane){this.pane=new nicEditorPane(A.button,this.ne,{fontSize:"12px",marginTop:"5px"});this.pane.setContent(A.options.name)}},hide:function(A){if(this.timer){clearTimeout(this.timer)}if(this.pane){this.pane=this.pane.remove()}}});nicEditors.registerPlugin(nicButtonTips);
61
+
62
+ var nicEditorAdvancedButton=nicEditorButton.extend({init:function(){this.ne.addEvent("selected",this.removePane.closure(this)).addEvent("blur",this.removePane.closure(this))},mouseClick:function(){if(!this.isDisabled){if(this.pane&&this.pane.pane){this.removePane()}else{this.pane=new nicEditorPane(this.contain,this.ne,{width:(this.width||"270px"),backgroundColor:"#fff"},this);this.addPane();this.ne.selectedInstance.saveRng()}}},addForm:function(C,G){this.form=new bkElement("form").addEvent("submit",this.submit.closureListener(this));this.pane.append(this.form);this.inputs={};for(itm in C){var D=C[itm];var F="";if(G){F=G.getAttribute(itm)}if(!F){F=D.value||""}var A=C[itm].type;if(A=="title"){new bkElement("div").setContent(D.txt).setStyle({fontSize:"14px",fontWeight:"bold",padding:"0px",margin:"2px 0"}).appendTo(this.form)}else{var B=new bkElement("div").setStyle({overflow:"hidden",clear:"both"}).appendTo(this.form);if(D.txt){new bkElement("label").setAttributes({"for":itm}).setContent(D.txt).setStyle({margin:"2px 4px",fontSize:"13px",width:"50px",lineHeight:"20px",textAlign:"right","float":"left"}).appendTo(B)}switch(A){case"text":this.inputs[itm]=new bkElement("input").setAttributes({id:itm,value:F,type:"text"}).setStyle({margin:"2px 0",fontSize:"13px","float":"left",height:"20px",border:"1px solid #ccc",overflow:"hidden"}).setStyle(D.style).appendTo(B);break;case"select":this.inputs[itm]=new bkElement("select").setAttributes({id:itm}).setStyle({border:"1px solid #ccc","float":"left",margin:"2px 0"}).appendTo(B);for(opt in D.options){var E=new bkElement("option").setAttributes({value:opt,selected:(opt==F)?"selected":""}).setContent(D.options[opt]).appendTo(this.inputs[itm])}break;case"content":this.inputs[itm]=new bkElement("textarea").setAttributes({id:itm}).setStyle({border:"1px solid #ccc","float":"left"}).setStyle(D.style).appendTo(B);this.inputs[itm].value=F}}}new bkElement("input").setAttributes({type:"submit"}).setStyle({backgroundColor:"#efefef",border:"1px solid #ccc",margin:"3px 0","float":"left",clear:"both"}).appendTo(this.form);this.form.onsubmit=bkLib.cancelEvent},submit:function(){},findElm:function(B,A,E){var D=this.ne.selectedInstance.getElm().getElementsByTagName(B);for(var C=0;C<D.length;C++){if(D[C].getAttribute(A)==E){return $BK(D[C])}}},removePane:function(){if(this.pane){this.pane.remove();this.pane=null;this.ne.selectedInstance.restoreRng()}}});
63
+
64
+
65
+ var nicLinkOptions = {
66
+ buttons : {
67
+ 'link' : {name : 'Add Link', type : 'nicLinkButton', tags : ['A']},
68
+ 'unlink' : {name : 'Remove Link', command : 'unlink', noActive : true}
69
+ }
70
+ };
71
+
72
+ var nicLinkButton=nicEditorAdvancedButton.extend({addPane:function(){this.ln=this.ne.selectedInstance.selElm().parentTag("A");this.addForm({"":{type:"title",txt:"Add/Edit Link"},href:{type:"text",txt:"URL",value:"http://",style:{width:"150px"}},title:{type:"text",txt:"Title"},target:{type:"select",txt:"Open In",options:{"":"Current Window",_blank:"New Window"},style:{width:"100px"}}},this.ln)},submit:function(C){var A=this.inputs.href.value;if(A=="http://"||A==""){alert("You must enter a URL to Create a Link");return false}this.removePane();if(!this.ln){var B="javascript:nicTemp();";this.ne.nicCommand("createlink",B);this.ln=this.findElm("A","href",B)}if(this.ln){this.ln.setAttributes({href:this.inputs.href.value,title:this.inputs.title.value,target:this.inputs.target.options[this.inputs.target.selectedIndex].value})}}});nicEditors.registerPlugin(nicPlugin,nicLinkOptions);
73
+
74
+
75
+ var nicColorOptions = {
76
+ buttons : {
77
+ 'forecolor' : {name : __('Change Text Color'), type : 'nicEditorColorButton', noClose : true},
78
+ 'bgcolor' : {name : __('Change Background Color'), type : 'nicEditorBgColorButton', noClose : true}
79
+ }
80
+ };
81
+
82
+ var nicEditorColorButton=nicEditorAdvancedButton.extend({addPane:function(){var D={0:"00",1:"33",2:"66",3:"99",4:"CC",5:"FF"};var H=new bkElement("DIV").setStyle({width:"270px"});for(var A in D){for(var F in D){for(var E in D){var I="#"+D[A]+D[E]+D[F];var C=new bkElement("DIV").setStyle({cursor:"pointer",height:"15px","float":"left"}).appendTo(H);var G=new bkElement("DIV").setStyle({border:"2px solid "+I}).appendTo(C);var B=new bkElement("DIV").setStyle({backgroundColor:I,overflow:"hidden",width:"11px",height:"11px"}).addEvent("click",this.colorSelect.closure(this,I)).addEvent("mouseover",this.on.closure(this,G)).addEvent("mouseout",this.off.closure(this,G,I)).appendTo(G);if(!window.opera){C.onmousedown=B.onmousedown=bkLib.cancelEvent}}}}this.pane.append(H.noSelect())},colorSelect:function(A){this.ne.nicCommand("foreColor",A);this.removePane()},on:function(A){A.setStyle({border:"2px solid #000"})},off:function(A,B){A.setStyle({border:"2px solid "+B})}});var nicEditorBgColorButton=nicEditorColorButton.extend({colorSelect:function(A){this.ne.nicCommand("hiliteColor",A);this.removePane()}});nicEditors.registerPlugin(nicPlugin,nicColorOptions);
83
+
84
+
85
+ var nicImageOptions = {
86
+ buttons : {
87
+ 'image' : {name : 'Add Image', type : 'nicImageButton', tags : ['IMG']}
88
+ }
89
+
90
+ };
91
+
92
+ var nicImageButton=nicEditorAdvancedButton.extend({addPane:function(){this.im=this.ne.selectedInstance.selElm().parentTag("IMG");this.addForm({"":{type:"title",txt:"Add/Edit Image"},src:{type:"text",txt:"URL",value:"http://",style:{width:"150px"}},alt:{type:"text",txt:"Alt Text",style:{width:"100px"}},align:{type:"select",txt:"Align",options:{none:"Default",left:"Left",right:"Right"}}},this.im)},submit:function(B){var C=this.inputs.src.value;if(C==""||C=="http://"){alert("You must enter a Image URL to insert");return false}this.removePane();if(!this.im){var A="javascript:nicImTemp();";this.ne.nicCommand("insertImage",A);this.im=this.findElm("IMG","src",A)}if(this.im){this.im.setAttributes({src:this.inputs.src.value,alt:this.inputs.alt.value,align:this.inputs.align.value})}}});nicEditors.registerPlugin(nicPlugin,nicImageOptions);
93
+
94
+
95
+ var nicSaveOptions = {
96
+ buttons : {
97
+ 'save' : {name : __('Save this content'), type : 'nicEditorSaveButton'}
98
+ }
99
+ };
100
+
101
+ var nicEditorSaveButton=nicEditorButton.extend({init:function(){if(!this.ne.options.onSave){this.margin.setStyle({display:"none"})}},mouseClick:function(){var B=this.ne.options.onSave;var A=this.ne.selectedInstance;B(A.getContent(),A.elm.id,A)}});nicEditors.registerPlugin(nicPlugin,nicSaveOptions);
102
+
103
+ var nicXHTML=bkClass.extend({stripAttributes:["_moz_dirty","_moz_resizing","_extended"],noShort:["style","title","script","textarea","a"],cssReplace:{"font-weight:bold;":"strong","font-style:italic;":"em"},sizes:{1:"xx-small",2:"x-small",3:"small",4:"medium",5:"large",6:"x-large"},construct:function(A){this.ne=A;if(this.ne.options.xhtml){A.addEvent("get",this.cleanup.closure(this))}},cleanup:function(A){var B=A.getElm();var C=this.toXHTML(B);A.content=C},toXHTML:function(C,A,L){var G="";var O="";var P="";var I=C.nodeType;var Q=C.nodeName.toLowerCase();var N=C.hasChildNodes&&C.hasChildNodes();var B=new Array();switch(I){case 1:var H=C.attributes;switch(Q){case"b":Q="strong";break;case"i":Q="em";break;case"font":Q="span";break}if(A){for(var F=0;F<H.length;F++){var K=H[F];var M=K.nodeName.toLowerCase();var D=K.nodeValue;if(!K.specified||!D||bkLib.inArray(this.stripAttributes,M)||typeof (D)=="function"){continue}switch(M){case"style":var J=D.replace(/ /g,"");for(itm in this.cssReplace){if(J.indexOf(itm)!=-1){B.push(this.cssReplace[itm]);J=J.replace(itm,"")}}P+=J;D="";break;case"class":D=D.replace("Apple-style-span","");break;case"size":P+="font-size:"+this.sizes[D]+";";D="";break}if(D){O+=" "+M+'="'+D+'"'}}if(P){O+=' style="'+P+'"'}for(var F=0;F<B.length;F++){G+="<"+B[F]+">"}if(O==""&&Q=="span"){A=false}if(A){G+="<"+Q;if(Q!="br"){G+=O}}}if(!N&&!bkLib.inArray(this.noShort,M)){if(A){G+=" />"}}else{if(A){G+=">"}for(var F=0;F<C.childNodes.length;F++){var E=this.toXHTML(C.childNodes[F],true,true);if(E){G+=E}}}if(A&&N){G+="</"+Q+">"}for(var F=0;F<B.length;F++){G+="</"+B[F]+">"}break;case 3:G+=C.nodeValue;break}return G}});nicEditors.registerPlugin(nicXHTML);
104
+
105
+
106
+ var nicCodeOptions = {
107
+ buttons : {
108
+ 'xhtml' : {name : 'Edit HTML', type : 'nicCodeButton'}
109
+ }
110
+
111
+ };
112
+
113
+ var nicCodeButton=nicEditorAdvancedButton.extend({width:"350px",addPane:function(){this.addForm({"":{type:"title",txt:"Edit HTML"},code:{type:"content",value:this.ne.selectedInstance.getContent(),style:{width:"340px",height:"200px"}}})},submit:function(B){var A=this.inputs.code.value;this.ne.selectedInstance.setContent(A);this.removePane()}});nicEditors.registerPlugin(nicPlugin,nicCodeOptions);
114
+
115
+ var nicBBCode=bkClass.extend({construct:function(A){this.ne=A;if(this.ne.options.bbCode){A.addEvent("get",this.bbGet.closure(this));A.addEvent("set",this.bbSet.closure(this));var B=this.ne.loadedPlugins;for(itm in B){if(B[itm].toXHTML){this.xhtml=B[itm]}}}},bbGet:function(A){var B=this.xhtml.toXHTML(A.getElm());A.content=this.toBBCode(B)},bbSet:function(A){A.content=this.fromBBCode(A.content)},toBBCode:function(B){function A(D,C){B=B.replace(D,C)}A(/\n/gi,"");A(/<strong>(.*?)<\/strong>/gi,"[b]$1[/b]");A(/<em>(.*?)<\/em>/gi,"[i]$1[/i]");A(/<span.*?style="text-decoration:underline;">(.*?)<\/span>/gi,"[u]$1[/u]");A(/<ul>(.*?)<\/ul>/gi,"[list]$1[/list]");A(/<li>(.*?)<\/li>/gi,"[*]$1[]");A(/<ol>(.*?)<\/ol>/gi,"[list=1]$1[/list]");A(/<img.*?src="(.*?)".*?>/gi,"[img]$1[/img]");A(/<a.*?href="(.*?)".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");A(/<br.*?>/gi,"\n");A(/<.*?>.*?<\/.*?>/gi,"");return B},fromBBCode:function(A){function B(D,C){A=A.replace(D,C)}B(/\[b\](.*?)\[\/b\]/gi,"<strong>$1</strong>");B(/\[i\](.*?)\[\/i\]/gi,"<em>$1</em>");B(/\[u\](.*?)\[\/u\]/gi,'<span style="text-decoration:underline;">$1</span>');B(/\[list\](.*?)\[\/list\]/gi,"<ul>$1</ul>");B(/\[list=1\](.*?)\[\/list\]/gi,"<ol>$1</ol>");B(/\[\*\](.*?)\[\/\*\]/gi,"<li>$1</li>");B(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />');B(/\[url=(.*?)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>');B(/\n/gi,"<br />");return A}});nicEditors.registerPlugin(nicBBCode);
116
+
117
+
118
+ var nicUploadOptions = {
119
+ buttons : {
120
+ 'upload' : {name : 'Upload Image', type : 'nicUploadButton'}
121
+ }
122
+
123
+ };
124
+
125
+ var nicUploadButton=nicEditorAdvancedButton.extend({nicURI:"http://api.imgur.com/2/upload.json",errorText:"Failed to upload image",addPane:function(){if(typeof window.FormData==="undefined"){return this.onError("Image uploads are not supported in this browser, use Chrome, Firefox, or Safari instead.")}this.im=this.ne.selectedInstance.selElm().parentTag("IMG");var A=new bkElement("div").setStyle({padding:"10px"}).appendTo(this.pane.pane);new bkElement("div").setStyle({fontSize:"14px",fontWeight:"bold",paddingBottom:"5px"}).setContent("Insert an Image").appendTo(A);this.fileInput=new bkElement("input").setAttributes({type:"file"}).appendTo(A);this.progress=new bkElement("progress").setStyle({width:"100%",display:"none"}).setAttributes("max",100).appendTo(A);this.fileInput.onchange=this.uploadFile.closure(this)},onError:function(A){this.removePane();alert(A||"Failed to upload image")},uploadFile:function(){var B=this.fileInput.files[0];if(!B||!B.type.match(/image.*/)){this.onError("Only image files can be uploaded");return }this.fileInput.setStyle({display:"none"});this.setProgress(0);var A=new FormData();A.append("image",B);A.append("key","b7ea18a4ecbda8e92203fa4968d10660");var C=new XMLHttpRequest();C.open("POST",this.ne.options.uploadURI||this.nicURI);C.onload=function(){try{var D=JSON.parse(C.responseText)}catch(E){return this.onError()}this.onUploaded(D.upload)}.closure(this);C.onerror=this.onError.closure(this);C.upload.onprogress=function(D){this.setProgress(D.loaded/D.total)}.closure(this);C.send(A)},setProgress:function(A){this.progress.setStyle({display:"block"});if(A<0.98){this.progress.value=A}else{this.progress.removeAttribute("value")}},onUploaded:function(B){this.removePane();var D=B.links.original;if(!this.im){this.ne.selectedInstance.restoreRng();var C="javascript:nicImTemp();";this.ne.nicCommand("insertImage",D);this.im=this.findElm("IMG","src",D)}var A=parseInt(this.ne.selectedInstance.elm.getStyle("width"));if(this.im){this.im.setAttributes({src:D,width:(A&&B.image.width)?Math.min(A,B.image.width):""})}}});nicEditors.registerPlugin(nicPlugin,nicUploadOptions);
126
+
includes/common/js/ui.multiselect.js ADDED
@@ -0,0 +1,336 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI Multiselect
3
+ *
4
+ * Authors:
5
+ * Michael Aufreiter (quasipartikel.at)
6
+ * Yanick Rochon (yanick.rochon[at]gmail[dot]com)
7
+ *
8
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
9
+ * and GPL (GPL-LICENSE.txt) licenses.
10
+ *
11
+ * http://www.quasipartikel.at/multiselect/
12
+ *
13
+ *
14
+ * Depends:
15
+ * ui.core.js
16
+ * ui.sortable.js
17
+ *
18
+ * Optional:
19
+ * localization (http://plugins.jquery.com/project/localisation)
20
+ * scrollTo (http://plugins.jquery.com/project/ScrollTo)
21
+ *
22
+ * Todo:
23
+ * Make batch actions faster
24
+ * Implement dynamic insertion through remote calls
25
+ */
26
+
27
+
28
+ (function($) {
29
+
30
+ $.widget("ui.multiselect", {
31
+ options: {
32
+ sortable: true,
33
+ searchable: true,
34
+ doubleClickable: true,
35
+ animated: 'fast',
36
+ show: 'slideDown',
37
+ hide: 'slideUp',
38
+ dividerLocation: 0.6,
39
+ nodeComparator: function(node1,node2) {
40
+ var text1 = node1.text(),
41
+ text2 = node2.text();
42
+ return text1 == text2 ? 0 : (text1 < text2 ? -1 : 1);
43
+ }
44
+ },
45
+ _create: function() {
46
+ this.element.hide();
47
+ this.id = this.element.attr("id");
48
+ this.container = $('<div class="ui-multiselect ui-helper-clearfix ui-widget"></div>').insertAfter(this.element);
49
+ this.count = 0; // number of currently selected options
50
+ this.selectedContainer = $('<div class="selected"></div>').appendTo(this.container);
51
+ this.availableContainer = $('<div class="available"></div>').appendTo(this.container);
52
+ this.selectedActions = $('<div class="actions ui-widget-header ui-helper-clearfix"><span class="count">0 '+$.ui.multiselect.locale.itemsCount+'</span><a href="#" class="remove-all">'+$.ui.multiselect.locale.removeAll+'</a></div>').appendTo(this.selectedContainer);
53
+ this.availableActions = $('<div class="actions ui-widget-header ui-helper-clearfix"><input type="text" class="search empty ui-widget-content ui-corner-all"/><a href="#" class="add-all">'+$.ui.multiselect.locale.addAll+'</a></div>').appendTo(this.availableContainer);
54
+ this.selectedList = $('<ul class="selected connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart', function(){return false;}).appendTo(this.selectedContainer);
55
+ this.availableList = $('<ul class="available connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart', function(){return false;}).appendTo(this.availableContainer);
56
+
57
+ var that = this;
58
+
59
+ // set dimensions
60
+ this.container.width(this.element.width()+1);
61
+ this.selectedContainer.width(Math.floor(this.element.width()*this.options.dividerLocation));
62
+ this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation)));
63
+
64
+ // fix list height to match <option> depending on their individual header's heights
65
+ this.selectedList.height(Math.max(this.element.height()-this.selectedActions.height(),1));
66
+ this.availableList.height(Math.max(this.element.height()-this.availableActions.height(),1));
67
+
68
+ if ( !this.options.animated ) {
69
+ this.options.show = 'show';
70
+ this.options.hide = 'hide';
71
+ }
72
+
73
+ // init lists
74
+ this._populateLists(this.element.find('option'));
75
+
76
+ // make selection sortable
77
+ if (this.options.sortable) {
78
+ this.selectedList.sortable({
79
+ placeholder: 'ui-state-highlight',
80
+ axis: 'y',
81
+ update: function(event, ui) {
82
+ // apply the new sort order to the original selectbox
83
+ that.selectedList.find('li').each(function() {
84
+ if ($(this).data('optionLink'))
85
+ $(this).data('optionLink').remove().appendTo(that.element);
86
+ });
87
+ },
88
+ receive: function(event, ui) {
89
+ ui.item.data('optionLink').attr('selected', true);
90
+ // increment count
91
+ that.count += 1;
92
+ that._updateCount();
93
+ // workaround, because there's no way to reference
94
+ // the new element, see http://dev.jqueryui.com/ticket/4303
95
+ that.selectedList.children('.ui-draggable').each(function() {
96
+ $(this).removeClass('ui-draggable');
97
+ $(this).data('optionLink', ui.item.data('optionLink'));
98
+ $(this).data('idx', ui.item.data('idx'));
99
+ that._applyItemState($(this), true);
100
+ });
101
+
102
+ // workaround according to http://dev.jqueryui.com/ticket/4088
103
+ setTimeout(function() { ui.item.remove(); }, 1);
104
+ }
105
+ });
106
+ }
107
+
108
+ // set up livesearch
109
+ if (this.options.searchable) {
110
+ this._registerSearchEvents(this.availableContainer.find('input.search'));
111
+ } else {
112
+ $('.search').hide();
113
+ }
114
+
115
+ // batch actions
116
+ this.container.find(".remove-all").click(function() {
117
+ that._populateLists(that.element.find('option').removeAttr('selected'));
118
+ return false;
119
+ });
120
+
121
+ this.container.find(".add-all").click(function() {
122
+ var options = that.element.find('option').not(":selected");
123
+ if (that.availableList.children('li:hidden').length > 1) {
124
+ that.availableList.children('li').each(function(i) {
125
+ if ($(this).is(":visible")) $(options[i-1]).attr('selected', 'selected');
126
+ });
127
+ } else {
128
+ options.attr('selected', 'selected');
129
+ }
130
+ that._populateLists(that.element.find('option'));
131
+ return false;
132
+ });
133
+ },
134
+ destroy: function() {
135
+ this.element.show();
136
+ this.container.remove();
137
+
138
+ $.Widget.prototype.destroy.apply(this, arguments);
139
+ },
140
+ _populateLists: function(options) {
141
+ this.selectedList.children('.ui-element').remove();
142
+ this.availableList.children('.ui-element').remove();
143
+ this.count = 0;
144
+
145
+ var that = this;
146
+ var items = $(options.map(function(i) {
147
+ var item = that._getOptionNode(this).appendTo(this.selected ? that.selectedList : that.availableList).show();
148
+
149
+ if (this.selected) that.count += 1;
150
+ that._applyItemState(item, this.selected);
151
+ item.data('idx', i);
152
+ return item[0];
153
+ }));
154
+
155
+ // update count
156
+ this._updateCount();
157
+ that._filter.apply(this.availableContainer.find('input.search'), [that.availableList]);
158
+ },
159
+ _updateCount: function() {
160
+ this.selectedContainer.find('span.count').text(this.count+" "+$.ui.multiselect.locale.itemsCount);
161
+ },
162
+ _getOptionNode: function(option) {
163
+ option = $(option);
164
+ var node = $('<li class="ui-state-default ui-element" title="'+option.text()+'"><span class="ui-icon"/>'+option.text()+'<a href="#" class="action"><span class="ui-corner-all ui-icon"/></a></li>').hide();
165
+ node.data('optionLink', option);
166
+ return node;
167
+ },
168
+ // clones an item with associated data
169
+ // didn't find a smarter away around this
170
+ _cloneWithData: function(clonee) {
171
+ var clone = clonee.clone(false,false);
172
+ clone.data('optionLink', clonee.data('optionLink'));
173
+ clone.data('idx', clonee.data('idx'));
174
+ return clone;
175
+ },
176
+ _setSelected: function(item, selected) {
177
+ item.data('optionLink').attr('selected', selected);
178
+
179
+ if (selected) {
180
+ var selectedItem = this._cloneWithData(item);
181
+ item[this.options.hide](this.options.animated, function() { $(this).remove(); });
182
+ selectedItem.appendTo(this.selectedList).hide()[this.options.show](this.options.animated);
183
+
184
+ this._applyItemState(selectedItem, true);
185
+ return selectedItem;
186
+ } else {
187
+
188
+ // look for successor based on initial option index
189
+ var items = this.availableList.find('li'), comparator = this.options.nodeComparator;
190
+ var succ = null, i = item.data('idx'), direction = comparator(item, $(items[i]));
191
+
192
+ // TODO: test needed for dynamic list populating
193
+ if ( direction ) {
194
+ while (i>=0 && i<items.length) {
195
+ direction > 0 ? i++ : i--;
196
+ if ( direction != comparator(item, $(items[i])) ) {
197
+ // going up, go back one item down, otherwise leave as is
198
+ succ = items[direction > 0 ? i : i+1];
199
+ break;
200
+ }
201
+ }
202
+ } else {
203
+ succ = items[i];
204
+ }
205
+
206
+ var availableItem = this._cloneWithData(item);
207
+ succ ? availableItem.insertBefore($(succ)) : availableItem.appendTo(this.availableList);
208
+ item[this.options.hide](this.options.animated, function() { $(this).remove(); });
209
+ availableItem.hide()[this.options.show](this.options.animated);
210
+
211
+ this._applyItemState(availableItem, false);
212
+ return availableItem;
213
+ }
214
+ },
215
+ _applyItemState: function(item, selected) {
216
+ if (selected) {
217
+ if (this.options.sortable)
218
+ item.children('span').addClass('ui-icon-arrowthick-2-n-s').removeClass('ui-helper-hidden').addClass('ui-icon');
219
+ else
220
+ item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon');
221
+ item.find('a.action span').addClass('ui-icon-minus').removeClass('ui-icon-plus');
222
+ this._registerRemoveEvents(item.find('a.action'));
223
+
224
+ } else {
225
+ item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon');
226
+ item.find('a.action span').addClass('ui-icon-plus').removeClass('ui-icon-minus');
227
+ this._registerAddEvents(item.find('a.action'));
228
+ }
229
+
230
+ this._registerDoubleClickEvents(item);
231
+ this._registerHoverEvents(item);
232
+ },
233
+ // taken from John Resig's liveUpdate script
234
+ _filter: function(list) {
235
+ var input = $(this);
236
+ var rows = list.children('li'),
237
+ cache = rows.map(function(){
238
+
239
+ return $(this).text().toLowerCase();
240
+ });
241
+
242
+ var term = $.trim(input.val().toLowerCase()), scores = [];
243
+
244
+ if (!term) {
245
+ rows.show();
246
+ } else {
247
+ rows.hide();
248
+
249
+ cache.each(function(i) {
250
+ if (this.indexOf(term)>-1) { scores.push(i); }
251
+ });
252
+
253
+ $.each(scores, function() {
254
+ $(rows[this]).show();
255
+ });
256
+ }
257
+ },
258
+ _registerDoubleClickEvents: function(elements) {
259
+ if (!this.options.doubleClickable) return;
260
+ elements.dblclick(function() {
261
+ elements.find('a.action').click();
262
+ });
263
+ },
264
+ _registerHoverEvents: function(elements) {
265
+ elements.removeClass('ui-state-hover');
266
+ elements.mouseover(function() {
267
+ $(this).addClass('ui-state-hover');
268
+ });
269
+ elements.mouseout(function() {
270
+ $(this).removeClass('ui-state-hover');
271
+ });
272
+ },
273
+ _registerAddEvents: function(elements) {
274
+ var that = this;
275
+ elements.click(function() {
276
+ var item = that._setSelected($(this).parent(), true);
277
+ that.count += 1;
278
+ that._updateCount();
279
+ return false;
280
+ });
281
+
282
+ // make draggable
283
+ if (this.options.sortable) {
284
+ elements.each(function() {
285
+ $(this).parent().draggable({
286
+ connectToSortable: that.selectedList,
287
+ helper: function() {
288
+ var selectedItem = that._cloneWithData($(this)).width($(this).width() - 50);
289
+ selectedItem.width($(this).width());
290
+ return selectedItem;
291
+ },
292
+ appendTo: that.container,
293
+ containment: that.container,
294
+ revert: 'invalid'
295
+ });
296
+ });
297
+ }
298
+ },
299
+ _registerRemoveEvents: function(elements) {
300
+ var that = this;
301
+ elements.click(function() {
302
+ that._setSelected($(this).parent(), false);
303
+ that.count -= 1;
304
+ that._updateCount();
305
+ return false;
306
+ });
307
+ },
308
+ _registerSearchEvents: function(input) {
309
+ var that = this;
310
+
311
+ input.focus(function() {
312
+ $(this).addClass('ui-state-active');
313
+ })
314
+ .blur(function() {
315
+ $(this).removeClass('ui-state-active');
316
+ })
317
+ .keypress(function(e) {
318
+ if (e.keyCode == 13)
319
+ return false;
320
+ })
321
+ .keyup(function() {
322
+ that._filter.apply(this, [that.availableList]);
323
+ });
324
+ }
325
+ });
326
+
327
+ $.extend($.ui.multiselect, {
328
+ locale: {
329
+ addAll:'Add all',
330
+ removeAll:'Remove all',
331
+ itemsCount:'items selected'
332
+ }
333
+ });
334
+
335
+
336
+ })(jQuery);
includes/common/js/wp-insert-functions.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function() {
2
+ jQuery('.wp_insert_uploader_button').click(function() {
3
+ formfield = jQuery(this).prev().attr("name");
4
+ tb_show('', 'media-upload.php?type=image&TB_iframe=true');
5
+ return false;
6
+ });
7
+ window.send_to_editor = function(html) {
8
+ imgurl = jQuery('img',html).attr('src');
9
+ jQuery("input[name=\'"+formfield+"\']").val(imgurl);
10
+ tb_remove();
11
+ }
12
+ });
includes/common/menu.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ function wp_insert_add_main_menu() {
3
+ add_menu_page('Wp Insert', 'Wp Insert', 'manage_options', 'wp-insert', 'wp_insert_inpostads_admin_page');
4
+ }
5
+ add_action('admin_menu', 'wp_insert_add_main_menu');
6
+ ?>
includes/common/popups/categories.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ define('WP_USE_THEMES', false);
3
+ require('../../../../../../wp-blog-header.php');
4
+ ?>
5
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6
+ <html xmlns="http://www.w3.org/1999/xhtml">
7
+ <head>
8
+ <link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/themes/smoothness/jquery-ui.css" />
9
+ <link rel="stylesheet" type="text/css" href="<?php echo WP_INSERT_URL; ?>/includes/common/css/style.css" />
10
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
11
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js"></script>
12
+ <script type="text/javascript" src="<?php echo WP_INSERT_URL; ?>/includes/common/js/ui.multiselect.js"></script>
13
+ <script type="text/javascript">
14
+ jQuery(function(){
15
+ jQuery(".multiselect").multiselect({dividerLocation: 0.5});
16
+ });
17
+
18
+ function submit_popup() {
19
+ var selectedItems = new Array();
20
+ var pagePicker = document.getElementById('category_picker');
21
+ while (pagePicker.selectedIndex != -1) {
22
+ selectedItems.push(pagePicker.options[pagePicker.selectedIndex].value);
23
+ pagePicker.options[pagePicker.selectedIndex].selected = false;
24
+ }
25
+ parent.jQuery('#<?php echo (string)$_GET['target']; ?>').val(selectedItems.join(','));
26
+ parent.jQuery.colorbox.close();
27
+ }
28
+ </script>
29
+ </head>
30
+ <body>
31
+ <?php
32
+ $categories = get_categories('number=100');
33
+ $selected = null;
34
+ if(isset($_GET['data'])) {
35
+ $selected = split(',', urldecode((string)$_GET['data']));
36
+ }
37
+ ?>
38
+ <select id="category_picker" class="multiselect" multiple="multiple" >
39
+ <?php
40
+ foreach($categories as $category) {
41
+ if($selected && in_array($category->term_id, $selected)) {
42
+ echo '<option value="'.$category->term_id.'" selected="selected">'.$category->name.'</option>';
43
+ } else {
44
+ echo '<option value="'.$category->term_id.'">'.$category->name.'</option>';
45
+ }
46
+ }
47
+ ?>
48
+ </select>
49
+ <input type="image" src="<?php echo WP_INSERT_URL; ?>/includes/common/images/check.png" style="float: right; margin: 2px 20px 0 0;" onclick="submit_popup()" />
50
+ </body>
51
+ </html>
includes/common/popups/countries.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ define('WP_USE_THEMES', false);
3
+ require('../../../../../../wp-blog-header.php');
4
+ ?>
5
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6
+ <html xmlns="http://www.w3.org/1999/xhtml">
7
+ <head>
8
+ <link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/themes/smoothness/jquery-ui.css" />
9
+ <link rel="stylesheet" type="text/css" href="<?php echo WP_INSERT_URL; ?>/includes/common/css/style.css" />
10
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
11
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js"></script>
12
+ <script type="text/javascript" src="<?php echo WP_INSERT_URL; ?>/includes/common/js/ui.multiselect.js"></script>
13
+ <script type="text/javascript">
14
+ jQuery(function(){
15
+ jQuery(".multiselect").multiselect({dividerLocation: 0.5});
16
+ });
17
+
18
+ function submit_popup() {
19
+ var selectedItems = new Array();
20
+ var pagePicker = document.getElementById('country_picker');
21
+ while (pagePicker.selectedIndex != -1) {
22
+ selectedItems.push(pagePicker.options[pagePicker.selectedIndex].value);
23
+ pagePicker.options[pagePicker.selectedIndex].selected = false;
24
+ }
25
+ parent.jQuery('#<?php echo (string)$_GET['target']; ?>').val(selectedItems.join(','));
26
+ parent.jQuery.colorbox.close();
27
+ }
28
+ </script>
29
+ </head>
30
+ <body>
31
+ <?php
32
+ $selected = null;
33
+ if(isset($_GET['data'])) {
34
+ $selected = split(',', urldecode((string)$_GET['data']));
35
+ }
36
+ ?>
37
+ <select id="country_picker" class="multiselect" multiple="multiple" >
38
+ <?php
39
+ $countries = wp_insert_get_countries();
40
+ foreach($countries as $country) {
41
+ if($selected && in_array($country['value'], $selected)) {
42
+ echo '<option value="'.$country['value'].'" selected="selected">'.$country['text'].'</option>';
43
+ } else {
44
+ echo '<option value="'.$country['value'].'">'.$country['text'].'</option>';
45
+ }
46
+ }
47
+ ?>
48
+ </select>
49
+ <input type="image" src="<?php echo WP_INSERT_URL; ?>/includes/common/images/check.png" style="float: right; margin: 2px 20px 0 0;" onclick="submit_popup()" />
50
+ </body>
51
+ </html>
includes/common/popups/instances.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ define('WP_USE_THEMES', false);
3
+ require('../../../../../../wp-blog-header.php');
4
+
5
+ function wp_insert_add_ordinal_number_suffix($num) {
6
+ if (!in_array(($num % 100),array(11,12,13))){
7
+ switch ($num % 10) {
8
+ case 1: return $num.'st';
9
+ case 2: return $num.'nd';
10
+ case 3: return $num.'rd';
11
+ }
12
+ }
13
+ return $num.'th';
14
+ }
15
+ ?>
16
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
17
+ <html xmlns="http://www.w3.org/1999/xhtml">
18
+ <head>
19
+ <link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/themes/smoothness/jquery-ui.css" />
20
+ <link rel="stylesheet" type="text/css" href="<?php echo WP_INSERT_URL; ?>/includes/common/css/style.css" />
21
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
22
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js"></script>
23
+ <script type="text/javascript" src="<?php echo WP_INSERT_URL; ?>/includes/common/js/ui.multiselect.js"></script>
24
+ <script type="text/javascript">
25
+ jQuery(function(){
26
+ jQuery(".multiselect").multiselect({dividerLocation: 0.5});
27
+ });
28
+
29
+ function submit_popup() {
30
+ var selectedItems = new Array();
31
+ var pagePicker = document.getElementById('instance_picker');
32
+ while (pagePicker.selectedIndex != -1) {
33
+ selectedItems.push(pagePicker.options[pagePicker.selectedIndex].value);
34
+ pagePicker.options[pagePicker.selectedIndex].selected = false;
35
+ }
36
+ parent.jQuery('#<?php echo (string)$_GET['target']; ?>').val(selectedItems.join(','));
37
+ parent.jQuery.colorbox.close();
38
+ }
39
+ </script>
40
+ </head>
41
+ <body>
42
+ <?php
43
+ $posts_per_page = get_option('posts_per_page');
44
+ $selected = null;
45
+ if(isset($_GET['data'])) {
46
+ $selected = split(',', urldecode((string)$_GET['data']));
47
+ }
48
+ ?>
49
+ <select id="instance_picker" class="multiselect" multiple="multiple" >
50
+ <?php
51
+ for($i = 1; $i <= $posts_per_page; $i++) {
52
+ if($selected && in_array($i, $selected)) {
53
+ echo '<option value="'.$i.'" selected="selected">Hide on '.wp_insert_add_ordinal_number_suffix($i).' Post</option>';
54
+ } else {
55
+ echo '<option value="'.$i.'">Hide on '.wp_insert_add_ordinal_number_suffix($i).' Post</option>';
56
+ }
57
+ }
58
+ ?>
59
+ </select>
60
+ <input type="image" src="<?php echo WP_INSERT_URL; ?>/includes/common/images/check.png" style="float: right; margin: 2px 20px 0 0;" onclick="submit_popup()" />
61
+ </body>
62
+ </html>
includes/common/popups/pages.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ define('WP_USE_THEMES', false);
3
+ require('../../../../../../wp-blog-header.php');
4
+ ?>
5
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6
+ <html xmlns="http://www.w3.org/1999/xhtml">
7
+ <head>
8
+ <link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/themes/smoothness/jquery-ui.css" />
9
+ <link rel="stylesheet" type="text/css" href="<?php echo WP_INSERT_URL; ?>/includes/common/css/style.css" />
10
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
11
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js"></script>
12
+ <script type="text/javascript" src="<?php echo WP_INSERT_URL; ?>/includes/common/js/ui.multiselect.js"></script>
13
+ <script type="text/javascript">
14
+ jQuery(function(){
15
+ jQuery(".multiselect").multiselect({dividerLocation: 0.5});
16
+ });
17
+
18
+ function submit_popup() {
19
+ var selectedItems = new Array();
20
+ var pagePicker = document.getElementById('page_picker');
21
+ while (pagePicker.selectedIndex != -1) {
22
+ selectedItems.push(pagePicker.options[pagePicker.selectedIndex].value);
23
+ pagePicker.options[pagePicker.selectedIndex].selected = false;
24
+ }
25
+ parent.jQuery('#<?php echo (string)$_GET['target']; ?>').val(selectedItems.join(','));
26
+ parent.jQuery.colorbox.close();
27
+ }
28
+ </script>
29
+ </head>
30
+ <body>
31
+ <?php
32
+ $pages = get_pages('number=100');
33
+ $selected = null;
34
+ if(isset($_GET['data'])) {
35
+ $selected = split(',', urldecode((string)$_GET['data']));
36
+ }
37
+ ?>
38
+ <select id="page_picker" class="multiselect" multiple="multiple" >
39
+ <?php
40
+ foreach($pages as $page) {
41
+ if($selected && in_array($page->ID, $selected)) {
42
+ echo '<option value="'.$page->ID.'" selected="selected">'.$page->post_title.'</option>';
43
+ } else {
44
+ echo '<option value="'.$page->ID.'">'.$page->post_title.'</option>';
45
+ }
46
+ }
47
+ ?>
48
+ </select>
49
+ <input type="image" src="<?php echo WP_INSERT_URL; ?>/includes/common/images/check.png" style="float: right; margin: 2px 20px 0 0;" onclick="submit_popup()" />
50
+ </body>
51
+ </html>
includes/common/popups/posts.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ define('WP_USE_THEMES', false);
3
+ require('../../../../../../wp-blog-header.php');
4
+ ?>
5
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6
+ <html xmlns="http://www.w3.org/1999/xhtml">
7
+ <head>
8
+ <link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/themes/smoothness/jquery-ui.css" />
9
+ <link rel="stylesheet" type="text/css" href="<?php echo WP_INSERT_URL; ?>/includes/common/css/style.css" />
10
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
11
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js"></script>
12
+ <script type="text/javascript" src="<?php echo WP_INSERT_URL; ?>/includes/common/js/ui.multiselect.js"></script>
13
+ <script type="text/javascript">
14
+ jQuery(function(){
15
+ jQuery(".multiselect").multiselect({dividerLocation: 0.5});
16
+ });
17
+
18
+ function submit_popup() {
19
+ var selectedItems = new Array();
20
+ var pagePicker = document.getElementById('post_picker');
21
+ while (pagePicker.selectedIndex != -1) {
22
+ selectedItems.push(pagePicker.options[pagePicker.selectedIndex].value);
23
+ pagePicker.options[pagePicker.selectedIndex].selected = false;
24
+ }
25
+ parent.jQuery('#<?php echo (string)$_GET['target']; ?>').val(selectedItems.join(','));
26
+ parent.jQuery.colorbox.close();
27
+ }
28
+ </script>
29
+ </head>
30
+ <body>
31
+ <?php
32
+ $post = get_posts('numberposts=100');
33
+ $selected = null;
34
+ if(isset($_GET['data'])) {
35
+ $selected = split(',', urldecode((string)$_GET['data']));
36
+ }
37
+ ?>
38
+ <select id="post_picker" class="multiselect" multiple="multiple" >
39
+ <?php
40
+ foreach($posts as $post) {
41
+ if($selected && in_array($post->ID, $selected)) {
42
+ echo '<option value="'.$post->ID.'" selected="selected">'.$post->post_title.'</option>';
43
+ } else {
44
+ echo '<option value="'.$post->ID.'">'.$post->post_title.'</option>';
45
+ }
46
+ }
47
+ ?>
48
+ </select>
49
+ <input type="image" src="<?php echo WP_INSERT_URL; ?>/includes/common/images/check.png" style="float: right; margin: 2px 20px 0 0;" onclick="submit_popup()" />
50
+ </body>
51
+ </html>
includes/common/rules.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+
3
+ ?>
includes/common/status.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $wpInsertPostInstance;
3
+ $wpInsertAdInstance;
4
+ add_action('the_content', 'wp_insert_track_post_instance', 1);
5
+ function wp_insert_track_post_instance($content) {
6
+ global $wpInsertPostInstance;
7
+ if($wpInsertPostInstance == '') {
8
+ $wpInsertPostInstance = 1;
9
+ } else {
10
+ $wpInsertPostInstance++;
11
+ }
12
+ return $content;
13
+ }
14
+
15
+ add_action('wp', 'wp_insert_track_ad_instance', 1);
16
+ function wp_insert_track_ad_instance($content) {
17
+ global $wpInsertAdInstance;
18
+ $networkCount = get_option('wp-insert-multiple-network-status');
19
+ $wpInsertAdInstance = rand(1, $networkCount);
20
+ }
21
+
22
+ function wp_insert_get_page_details() {
23
+ global $post;
24
+ $page_details = array(
25
+ 'type' => 'POST',
26
+ 'ID' => $post->ID
27
+ );
28
+ if(is_home() || is_front_page()) {
29
+ $page_details['type'] = 'HOME';
30
+ } else if(is_category()) {
31
+ $page_details['type'] = 'CATEGORY';
32
+ $page_details['ID'] = get_query_var('cat');
33
+ } else if(is_archive()) {
34
+ $page_details['type'] = 'ARCHIVE';
35
+ } else if(is_search()) {
36
+ $page_details['type'] = 'SEARCH';
37
+ } else if(is_page()) {
38
+ $page_details['type'] = 'PAGE';
39
+ } else if(is_single()) {
40
+ $page_details['type'] = 'POST';
41
+ }
42
+
43
+ return $page_details;
44
+ }
45
+
46
+ function wp_insert_get_ad_status($rules) {
47
+ if(!$rules['status']) {
48
+ return false;
49
+ }
50
+ global $wpInsertPostInstance;
51
+ $page_details = wp_insert_get_page_details();
52
+ switch($page_details['type']) {
53
+ case 'HOME':
54
+ if($rules['rules_exclude_home']) {
55
+ return false;
56
+ } else if($rules['rules_home_instances'] && (in_array($wpInsertPostInstance, split(',', $rules['rules_home_instances'])))) {
57
+ return false;
58
+ }
59
+ break;
60
+ case 'ARCHIVE':
61
+ if($rules['rules_exclude_archives']) {
62
+ return false;
63
+ } else if($rules['rules_archives_instances'] && (in_array($wpInsertPostInstance, split(',', $rules['rules_archives_instances'])))) {
64
+ return false;
65
+ }
66
+ break;
67
+ case 'CATEGORY':
68
+ if($rules['rules_exclude_categories']) {
69
+ return false;
70
+ } else if($rules['rules_categories_exceptions'] && (in_array($page_details['ID'], split(',', $rules['rules_categories_exceptions'])))) {
71
+ return false;
72
+ } else if($rules['rules_categories_instances'] && (in_array($wpInsertPostInstance, split(',', $rules['rules_categories_instances'])))) {
73
+ return false;
74
+ }
75
+ break;
76
+ case 'SEARCH':
77
+ if($rules['rules_exclude_search']) {
78
+ return false;
79
+ } else if($rules['rules_search_instances'] && (in_array($wpInsertPostInstance, split(',', $rules['rules_search_instances'])))) {
80
+ return false;
81
+ }
82
+ break;
83
+ case 'PAGE':
84
+ if($rules['rules_exclude_page']) {
85
+ return false;
86
+ } else if($rules['rules_page_exceptions'] && (in_array($page_details['ID'], split(',', $rules['rules_page_exceptions'])))) {
87
+ return false;
88
+ }
89
+ break;
90
+ case 'POST':
91
+ if($rules['rules_exclude_post']) {
92
+ return false;
93
+ } else if($rules['rules_post_exceptions'] && (in_array($page_details['ID'], split(',', $rules['rules_post_exceptions'])))) {
94
+ return false;
95
+ }
96
+ break;
97
+ }
98
+ return true;
99
+ }
100
+ ?>
includes/common/styles.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_insert_admin_styles() {
3
+ wp_enqueue_style('wp-insert-styles', WP_INSERT_URL.'/includes/common/css/style.css', false);
4
+ wp_enqueue_style('thickbox');
5
+ wp_enqueue_script('common');
6
+ wp_enqueue_script('jquery-ui-tabs');
7
+ wp_enqueue_script('wp-lists');
8
+ wp_enqueue_script('postbox');
9
+ wp_enqueue_script('media-upload');
10
+ wp_enqueue_script('thickbox');
11
+ wp_enqueue_script('colorbox', WP_INSERT_URL.'/includes/common/js/jquery.colorbox-min.js', array('jquery'));
12
+ wp_enqueue_script('better-checkboxes', WP_INSERT_URL.'/includes/common/js/jquery.tzCheckbox.js', array('jquery'));
13
+ wp_enqueue_script('iphone-checkboxes', WP_INSERT_URL.'/includes/common/js/iphone-style-checkboxes.js', array('jquery'));
14
+ wp_enqueue_script('jquery-vertical-tabs', WP_INSERT_URL.'/includes/common/js/jquery-jvert-tabs-1.1.4.js', array('jquery'));
15
+ wp_enqueue_script('nicEdit', WP_INSERT_URL.'/includes/common/js/nicEdit-latest.js', array('jquery'));
16
+ wp_enqueue_script('image-uploader', WP_INSERT_URL.'/includes/common/js/wp-insert-functions.js', array('jquery'));
17
+ }
18
+ ?>
includes/contenthook.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
- add_filter('the_content', 'wp_insert_filter_content');
3
-
4
- function wp_insert_filter_content($content) {
5
- return wp_insert_filter_content_ads($content, '1');
6
- }
7
- ?>
 
 
 
 
 
 
 
includes/dashboardwidget.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
- add_action('wp_dashboard_setup', 'wp_insert_add_dashboard_widgets' );
3
- function wp_insert_dashboard_widget_function() {
4
- include_once(ABSPATH . WPINC . '/feed.php');
5
- $rss = fetch_feed('http://www.wp-insert.smartlogix.co.in/feed/');
6
- if (!is_wp_error( $rss ) ) :
7
- $maxitems = $rss->get_item_quantity(10);
8
- $rss_items = $rss->get_items(0, $maxitems);
9
- endif;
10
- ?>
11
- <ul>
12
- <?php if ($maxitems == 0) echo '<li>No items.</li>';
13
- else
14
- foreach ($rss_items as $item) : ?>
15
- <li><a href='<?php echo $item->get_permalink(); ?>'><?php echo $item->get_title(); ?></a></li>
16
- <?php endforeach; ?>
17
- </ul>
18
- <?php
19
- }
20
-
21
- function wp_insert_add_dashboard_widgets() {
22
- wp_add_dashboard_widget('wp_insert_dashboard_widget', 'Wp-Insert News', 'wp_insert_dashboard_widget_function');
23
- }
24
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/essentials.php DELETED
@@ -1,140 +0,0 @@
1
- <?php
2
- //avoid direct calls to this file where wp core files not present
3
- if (!function_exists ('add_action')) {
4
- header('Status: 403 Forbidden');
5
- header('HTTP/1.1 403 Forbidden');
6
- exit();
7
- }
8
- // Pre-2.6 compatibility
9
- if ( ! defined( 'WP_CONTENT_URL' ) )
10
- define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' );
11
- if ( ! defined( 'WP_CONTENT_DIR' ) )
12
- define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
13
- if ( ! defined( 'WP_PLUGIN_URL' ) )
14
- define( 'WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' );
15
- if ( ! defined( 'WP_PLUGIN_DIR' ) )
16
- define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
17
-
18
- function screen_layout_columns($columns, $screen) {
19
- $columns[$screen] = 2;
20
- return $columns;
21
- }
22
-
23
- add_action( 'admin_init', 'wp_insert_admin_init' );
24
- function wp_insert_admin_init() {
25
- wp_register_style('WpInsertAdminCSS', WP_PLUGIN_URL.'/wp-insert/css/adminStyle.css');
26
- }
27
-
28
- function wp_insert_admin_styles() {
29
- wp_enqueue_style('WpInsertAdminCSS');
30
- }
31
-
32
- function wp_insert_admin_register_head() {
33
- echo "<link rel='stylesheet' type='text/css' href='".WP_PLUGIN_URL.'/wp-insert/css/adminStyle.css'."' />";
34
- }
35
- add_action('admin_head', 'wp_insert_admin_register_head');
36
-
37
-
38
- function wp_insert_get_current_page_details() {
39
- if(is_home()) return 'HOME';
40
- else if(is_archive()) return 'ARCHIVE';
41
- else if(is_singular()) {
42
- global $wp_query;
43
- return $wp_query->post->ID;
44
- }
45
- else return 'NULL';
46
- }
47
-
48
- function wp_insert_is_in_array($inputString, $inputArray) {
49
- foreach($inputArray as $arrayElements)
50
- {
51
- if($arrayElements == $inputString)
52
- {
53
- return 'TRUE';
54
- }
55
- }
56
- return 'FALSE';
57
- }
58
-
59
- $random = 0;
60
- switch(get_option('wp_insert_multiple_ad_network_type')) {
61
- case "All Ad Networks":
62
- $random = rand(0,2);
63
- break;
64
- case "Primary and Alternate Ad Network 1":
65
- $random = rand(0,1);
66
- break;
67
- }
68
-
69
- function wp_insert_settings_page_layout($page_parameters, $page_title, $page_type) { ?>
70
- <div id="post_ads_container" class="wrap">
71
- <?php screen_icon('options-general'); ?>
72
- <h2><?php echo $page_title; ?></h2>
73
- <div class="updated fade below-h2" id="message" style="opacity:0;display:none;">
74
- <p>Changes have been made to this page. Please click <b>Save Changes</b> to make them permanent</p>
75
- </div>
76
- <?php show_support_options(); ?>
77
- <form method="post" action="options.php">
78
- <?php
79
- wp_nonce_field('update-options');
80
- wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
81
- wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
82
- ?>
83
- <?php if($page_type == 'pages') { ?>
84
- <script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/js/jquery/jquery-ui-1.8.14.custom.min.js"></script>
85
- <?php } ?>
86
- <?php if($page_type == 'ads') { ?>
87
- <script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/js/jquery/jquery-ui-1.8.14.custom.min.js"></script>
88
- <script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/js/jquery/jquery.corner.js"></script>
89
- <?php
90
- require_once (dirname(__FILE__) . '/postpicker.php');
91
- } ?>
92
- <script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/js/common.js"></script>
93
- <div id="poststuff" class="metabox-holder has-right-sidebar">
94
- <div id="side-info-column" class="inner-sidebar">
95
- <p style="text-align:center;">
96
- <script type="text/javascript" src="http://www.wp-insert.smartlogix.co.in/wp-content/plugins/wp-adnetwork/wp-adnetwork.php?showad=1"></script>
97
- </p>
98
- <?php do_meta_boxes('col_2','advanced',null); ?>
99
- <p class="submit wp-insert-submit">
100
- <input type="hidden" name="action" value="update" />
101
- <input type="hidden" name="page_options" value="<?php echo $page_parameters; ?>" />
102
- <input type="submit" id="submit" class="button-primary button-wp-insert" value="<?php _e('Save Changes') ?>" />
103
- </p>
104
- </div>
105
- <div id="post-body" class="has-sidebar">
106
- <div id="post-body-content" class="has-sidebar-content">
107
- <?php do_meta_boxes('col_1','advanced',null); ?>
108
- </div>
109
- </div>
110
- <br class="clear"/>
111
- </div>
112
- </form>
113
- <script type="text/javascript">
114
- //<![CDATA[
115
- jQuery(document).ready( function($) {
116
- // close postboxes that should be closed
117
- jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
118
- jQuery('.postbox').addClass('closed');
119
- // postboxes setup
120
- postboxes.add_postbox_toggles('wp-insert');
121
- });
122
- //]]>
123
- </script>
124
- </div>
125
- <?php }
126
-
127
- require_once (dirname(__FILE__) . '/menu.php');
128
-
129
- require_once (dirname(__FILE__) . '/widgethook.php');
130
- require_once (dirname(__FILE__) . '/contenthook.php');
131
- require_once (dirname(__FILE__) . '/ads.php');
132
- require_once (dirname(__FILE__) . '/adsadvanced.php');
133
- require_once (dirname(__FILE__) . '/pages.php');
134
- require_once (dirname(__FILE__) . '/syntax-highlighter.php');
135
- require_once (dirname(__FILE__) . '/privacypolicy.php');
136
- require_once (dirname(__FILE__) . '/tandc.php');
137
- require_once (dirname(__FILE__) . '/feeds.php');
138
- require_once (dirname(__FILE__) . '/miscellaneous.php');
139
- require_once (dirname(__FILE__) . '/dashboardwidget.php');
140
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/feeds.php DELETED
@@ -1,90 +0,0 @@
1
- <?php
2
- function wp_insert_add_feedspage() {
3
- global $screen_layout_columns;
4
-
5
- add_meta_box('wp_insert_feed_ad_top', 'Ad - Above Feed Content', 'wp_insert_feed_ad_top_HTML', 'col_1');
6
- add_meta_box('wp_insert_feed_ad_bottom', 'Ad - Below Feed Content', 'wp_insert_feed_ad_bottom_HTML', 'col_1');
7
- add_meta_box('wp_insert_post_feed_feedburner', 'FeedBurner Feed URL', 'wp_insert_feed_feedburner_HTML', 'col_1');
8
- add_meta_box('wp_insert_comments_feed_feedburner', 'FeedBurner Comments Feed URL', 'wp_insert_feed_feedburner_HTML', 'col_1');
9
- add_meta_box('wp_insert_feed_logo', 'Logo for your Feed', 'wp_insert_feed_logo_HTML', 'col_1');
10
- add_meta_box('wp_insert_feed_feedburner_email', 'FeedBurner - Subscribe via Email Widget', 'wp_insert_feed_feedburner_email_HTML', 'col_1');
11
- add_meta_box('wp_insert_subscribe_widget_1', 'Subscribe Widget : Type 1', 'wp_insert_subscribe_widget_1_HTML', 'col_1');
12
- add_meta_box('wp_insert_subscribe_widget_2', 'Subscribe Widget : Type 2', 'wp_insert_subscribe_widget_2_HTML', 'col_1');
13
- add_meta_box('wp_insert_subscribe_widget_3', 'Subscribe Widget : Type 3', 'wp_insert_subscribe_widget_3_HTML', 'col_1');
14
-
15
- wp_insert_settings_page_layout('', 'WP-INSERT : Feeds', 'feeds');
16
- }
17
-
18
- function wp_insert_subscribe_widget_HTML($widgetID) { ?>
19
- <div>
20
- <?php if(get_option('wp_insert_feed_widget_'.$widgetID.'_enable')) { ?><input type="button" id="wp_insert_feed_widget_<?php echo $widgetID; ?>_enable_button" value="Click to Deactivate" class="button" style="font-weight:bold;color:red;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_widget_<?php echo $widgetID; ?>_enable_button', '#wp_insert_feed_widget_<?php echo $widgetID; ?>_enable')"/>
21
- <?php } else { ?><input type="button" id="wp_insert_feed_widget_<?php echo $widgetID; ?>_enable_button" value="Click to Activate" class="button" style="font-weight:bold;color:#2f9303;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_widget_<?php echo $widgetID; ?>_enable_button', '#wp_insert_feed_widget_<?php echo $widgetID; ?>_enable')"/><?php } ?>
22
- <input style="display:none;" id="wp_insert_feed_widget_<?php echo $widgetID; ?>_enable" name="wp_insert_feed_widget_<?php echo $widgetID; ?>_enable" type="checkbox" value="1"<?php if(get_option('wp_insert_feed_widget_'.$widgetID.'_enable')) echo ' checked="checked"'; ?> />
23
- <p>
24
- <label for="wp_insert_feed_widget_<?php echo $widgetID; ?>_title">Title:</label>
25
- <input id="wp_insert_feed_widget_<?php echo $widgetID; ?>_title" class="widefat" type="text" value="<?php echo get_option('wp_insert_feed_widget_'.$widgetID.'_title'); ?>" name="wp_insert_feed_widget_<?php echo $widgetID; ?>_title"/>
26
- </p>
27
- </div>
28
- <?php }
29
-
30
- function wp_insert_subscribe_widget_1_HTML() { wp_insert_subscribe_widget_HTML(1); }
31
- function wp_insert_subscribe_widget_2_HTML() { wp_insert_subscribe_widget_HTML(2); }
32
- function wp_insert_subscribe_widget_3_HTML() { wp_insert_subscribe_widget_HTML(3); }
33
-
34
- function wp_insert_feed_feedburner_email_HTML() { ?>
35
- <div>
36
- <?php if(get_option('wp_insert_feed_feedburner_email_enable')) { ?><input type="button" id="wp_insert_feed_feedburner_email_enable_button" value="Click to Deactivate" class="button" style="font-weight:bold;color:red;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_feedburner_email_enable_button', '#wp_insert_feed_feedburner_email_enable')"/>
37
- <?php } else { ?><input type="button" id="wp_insert_feed_feedburner_email_enable_button" value="Click to Activate" class="button" style="font-weight:bold;color:#2f9303;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_feedburner_email_enable_button', '#wp_insert_feed_feedburner_email_enable')"/><?php } ?>
38
- <input style="display:none;" id="wp_insert_feed_feedburner_email_enable" name="wp_insert_feed_feedburner_email_enable" type="checkbox" value="1"<?php if(get_option('wp_insert_feed_feedburner_email_enable')) echo ' checked="checked"'; ?> />
39
- <p>
40
- <label for="wp_insert_feed_feedburner_email_widget_code">Subscribe via Email Code:</label>
41
- <textarea id="wp_insert_feed_feedburner_email_widget_code" class="widefat" name="wp_insert_feed_feedburner_email_widget_code" cols="20" rows="16"><?php echo get_option('wp_insert_feed_feedburner_email_widget_code'); ?></textarea></p>
42
- </div>
43
- <?php }
44
-
45
- function wp_insert_feed_feedburner_HTML() { ?>
46
- <div>
47
- <?php if(get_option('wp_insert_feed_feedburner_enable')) { ?><input type="button" id="wp_insert_feed_feedburner_enable_button" value="Click to Deactivate" class="button" style="font-weight:bold;color:red;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_feedburner_enable_button', '#wp_insert_feed_feedburner_enable')"/>
48
- <?php } else { ?><input type="button" id="wp_insert_feed_feedburner_enable_button" value="Click to Activate" class="button" style="font-weight:bold;color:#2f9303;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_feedburner_enable_button', '#wp_insert_feed_feedburner_enable')"/><?php } ?>
49
- <input style="display:none;" id="wp_insert_feed_feedburner_enable" name="wp_insert_feed_feedburner_enable" type="checkbox" value="1"<?php if(get_option('wp_insert_feed_feedburner_enable')) echo ' checked="checked"'; ?> />
50
- <p>
51
- <label for="wp_insert_feed_feedburner_url">Logo URL:</label>
52
- <input id="wp_insert_feed_feedburner_url" class="widefat" type="text" value="<?php echo get_option('wp_insert_feed_feedburner_url'); ?>" name="wp_insert_feed_feedburner_url"/>
53
- </p>
54
- </div>
55
- <?php }
56
-
57
- function wp_insert_feed_ad_HTML($feed_adID) { ?>
58
- <div>
59
- <?php if(get_option('wp_insert_feed_ad_'.$in_post_adID.'_enable')) { ?><input type="button" id="wp_insert_feed_ad_<?php echo $in_post_adID; ?>_enable_button" value="Click to Deactivate" class="button" style="font-weight:bold;color:red;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_ad_<?php echo $in_post_adID; ?>_enable_button', '#wp_insert_feed_ad_<?php echo $in_post_adID; ?>_enable')"/>
60
- <?php } else { ?><input type="button" id="wp_insert_feed_ad_<?php echo $in_post_adID; ?>_enable_button" value="Click to Activate" class="button" style="font-weight:bold;color:#2f9303;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_ad_<?php echo $in_post_adID; ?>_enable_button', '#wp_insert_feed_ad_<?php echo $in_post_adID; ?>_enable')"/><?php } ?>
61
- <input style="display:none;" id="wp_insert_feed_ad_<?php echo $in_post_adID; ?>_enable" name="wp_insert_feed_ad_<?php echo $in_post_adID; ?>_enable" type="checkbox" value="1"<?php if(get_option('wp_insert_feed_ad_'.$in_post_adID.'_enable')) echo ' checked="checked"'; ?> />
62
- <p>
63
- <label for="wp_insert_feed_ad_<?php echo $in_post_adID; ?>_content">Ad Code:</label>
64
- <textarea id="wp_insert_feed_ad_<?php echo $in_post_adID; ?>_content" class="widefat" name="wp_insert_feed_ad_<?php echo $in_post_adID; ?>_content" cols="20" rows="16"><?php echo get_option('wp_insert_feed_ad_'.$in_post_adID.'_content'); ?></textarea>
65
- </p>
66
- </div>
67
- <?php }
68
-
69
- function wp_insert_feed_ad_top_HTML() { wp_insert_feed_ad_HTML("top"); }
70
- function wp_insert_feed_ad_bottom_HTML() { wp_insert_feed_ad_HTML("bottom"); }
71
-
72
- function wp_insert_feed_logo_HTML() { ?>
73
- <div>
74
- <?php if(get_option('wp_insert_feed_logo_enable')) { ?><input type="button" id="wp_insert_feed_logo_enable_button" value="Click to Deactivate" class="button" style="font-weight:bold;color:red;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_logo_enable_button', '#wp_insert_feed_logo_enable')"/>
75
- <?php } else { ?><input type="button" id="wp_insert_feed_logo_enable_button" value="Click to Activate" class="button" style="font-weight:bold;color:#2f9303;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_logo_enable_button', '#wp_insert_feed_logo_enable')"/><?php } ?>
76
- <input style="display:none;" id="wp_insert_feed_logo_enable" name="wp_insert_feed_logo_enable" type="checkbox" value="1"<?php if(get_option('wp_insert_feed_logo_enable')) echo ' checked="checked"'; ?> />
77
- <p>
78
- <label for="wp_insert_feed_logo_url">Logo URL:</label>
79
- <input id="wp_insert_feed_logo_url" class="widefat" type="text" value="<?php echo get_option('wp_insert_feed_logo_url'); ?>" name="wp_insert_feed_logo_url"/>
80
- </p>
81
- <p>
82
- <label for="wp_insert_feed_logo_width">Logo width:</label>
83
- <input id="wp_insert_feed_logo_width" class="widefat" type="text" value="<?php echo get_option('wp_insert_feed_logo_width'); ?>" name="wp_insert_feed_logo_width" />
84
- </p>
85
- <p>
86
- <label for="wp_insert_feed_logo_height">Logo height:</label>
87
- <input id="wp_insert_feed_logo_height" class="widefat" type="text" value="<?php echo get_option('wp_insert_feed_logo_height'); ?>" name="wp_insert_feed_logo_height"/>
88
- </p>
89
- </div>
90
- <?php }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/includes.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once (dirname(__FILE__).'/common/common.php');
3
+ require_once (dirname(__FILE__).'/multiple-adnetwork/multiple-adnetwork.php');
4
+ require_once (dirname(__FILE__).'/inpostads/inpostads.php');
5
+ require_once (dirname(__FILE__).'/adwidgets/adwidgets.php');
6
+ require_once (dirname(__FILE__).'/templateads/templateads.php');
7
+ require_once (dirname(__FILE__).'/legal-pages/legal-pages.php');
8
+ require_once (dirname(__FILE__).'/tracking-codes/tracking-codes.php');
9
+ require_once (dirname(__FILE__).'/syntax-highlighting/syntax-highlighting.php');
10
+ ?>
includes/inpostads.php DELETED
@@ -1,269 +0,0 @@
1
- <?php
2
- function wp_insert_filter_content_ads($content, $ad_ID) {
3
- $output = '';
4
- global $random;
5
- $page_details = wp_insert_get_current_page_details();
6
-
7
- if(get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_enable')) {
8
- /*Finding a appropriate position near the middle of the content to insert the ad*/
9
- $positions = array();
10
- $endpos = -1;
11
- $trigger = "<p";
12
- if(strpos($content, "<p") === false)
13
- $trigger = "<br";
14
-
15
- while(strpos($content, $trigger, $endpos+1) !== false){
16
- $endpos = strpos($content, $trigger, $endpos+1);
17
- $positions[] = $endpos;
18
- }
19
- $middle = sizeof($positions);
20
- while(sizeof($positions) > $middle)
21
- array_pop($positions);
22
- $triggerpoint = $positions[floor(sizeof($positions)/2)];
23
- /*End of Finding a appropriate position near the middle of the content to insert the ad*/
24
-
25
- if ($middle > 2) {
26
- $ad_style = get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_style');
27
- if($ad_style == '') { $ad_style = 'margin: 5px; padding: 0px;'; }
28
- if(!get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_exclude_home') && ($page_details == 'HOME')) {
29
- switch($random) {
30
- case 0:
31
- $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content').'</div>'.$trigger, $triggerpoint, 2);
32
- break;
33
- case 1:
34
- $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content_1').'</div>'.$trigger, $triggerpoint, 2);
35
- break;
36
- case 2:
37
- $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content_2').'</div>'.$trigger, $triggerpoint, 2);
38
- break;
39
- }
40
- }
41
- else if(!get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_exclude_archives') && ($page_details == 'ARCHIVE')) {
42
- switch($random) {
43
- case 0:
44
- $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content').'</div>'.$trigger, $triggerpoint, 2);
45
- break;
46
- case 1:
47
- $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content_1').'</div>'.$trigger, $triggerpoint, 2);
48
- break;
49
- case 2:
50
- $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content_2').'</div>'.$trigger, $triggerpoint, 2);
51
- break;
52
- }
53
- }
54
- else {
55
- if(is_singular()) {
56
- $page_ids = explode(',', str_replace(" ", "", get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_exclude_ids')));
57
- if(wp_insert_is_in_array($page_details, $page_ids) =='FALSE') {
58
- switch($random) {
59
- case 0:
60
- $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content').'</div>'.$trigger, $triggerpoint, 2);
61
- break;
62
- case 1:
63
- $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content_1').'</div>'.$trigger, $triggerpoint, 2);
64
- break;
65
- case 2:
66
- $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content_2').'</div>'.$trigger, $triggerpoint, 2);
67
- break;
68
- }
69
- }
70
- }
71
- }
72
- }
73
- }
74
- if(get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_enable')) {
75
- $ad_style = get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_style');
76
- if($ad_style == '') { $ad_style = 'margin: 5px; padding: 0px;'; }
77
- if(!get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_exclude_home') && ($page_details == 'HOME')) {
78
- switch($random) {
79
- case 0:
80
- $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content').'</div>';
81
- break;
82
- case 1:
83
- $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content_1').'</div>';
84
- break;
85
- case 2:
86
- $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content_2').'</div>';
87
- break;
88
- }
89
- }
90
- else if(!get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_exclude_archives') && ($page_details == 'ARCHIVE')) {
91
- switch($random) {
92
- case 0:
93
- $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content').'</div>';
94
- break;
95
- case 1:
96
- $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content_1').'</div>';
97
- break;
98
- case 2:
99
- $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content_2').'</div>';
100
- break;
101
- }
102
- }
103
- else {
104
- if(is_singular()) {
105
- $page_ids = explode(',', str_replace(" ", "", get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_exclude_ids')));
106
- if(wp_insert_is_in_array($page_details, $page_ids) =='FALSE') {
107
- switch($random) {
108
- case 0:
109
- $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content').'</div>';
110
- break;
111
- case 1:
112
- $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content_1').'</div>';
113
- break;
114
- case 2:
115
- $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content_2').'</div>';
116
- break;
117
- }
118
- }
119
- }
120
- }
121
- }
122
- if(get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_enable')) {
123
- $ad_style = get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_style');
124
- if($ad_style == '') { $ad_style = 'margin: 5px; padding: 0px;'; }
125
- if(!get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_exclude_home') && ($page_details == 'HOME')) {
126
- switch($random) {
127
- case 0:
128
- $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content').'</div>';
129
- break;
130
- case 1:
131
- $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content_1').'</div>';
132
- break;
133
- case 2:
134
- $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content_2').'</div>';
135
- break;
136
- }
137
- }
138
- else if(!get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_exclude_archives') && ($page_details == 'ARCHIVE')) {
139
- switch($random) {
140
- case 0:
141
- $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content').'</div>';
142
- break;
143
- case 1:
144
- $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content_1').'</div>';
145
- break;
146
- case 2:
147
- $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content_2').'</div>';
148
- break;
149
- }
150
- }
151
- else {
152
- if(is_singular()) {
153
- $page_ids = explode(',', str_replace(" ", "", get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_exclude_ids')));
154
- if(wp_insert_is_in_array($page_details, $page_ids) =='FALSE') {
155
- switch($random) {
156
- case 0:
157
- $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content').'</div>';
158
- break;
159
- case 1:
160
- $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content_1').'</div>';
161
- break;
162
- case 2:
163
- $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content_2').'</div>';
164
- break;
165
- }
166
- }
167
- }
168
- }
169
- }
170
- if(get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_enable')) {
171
- $ad_style = get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_style');
172
- if($ad_style == '') { $ad_style = 'margin: 5px; padding: 0px;'; }
173
- if(!get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_exclude_home') && ($page_details == 'HOME')) {
174
- switch($random) {
175
- case 0:
176
- $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content').'</div>';
177
- break;
178
- case 1:
179
- $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content_1').'</div>';
180
- break;
181
- case 2:
182
- $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content_2').'</div>';
183
- break;
184
- }
185
- }
186
- else if(!get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_exclude_archives') && ($page_details == 'ARCHIVE')) {
187
- switch($random) {
188
- case 0:
189
- $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content').'</div>';
190
- break;
191
- case 1:
192
- $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content_1').'</div>';
193
- break;
194
- case 2:
195
- $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content_2').'</div>';
196
- break;
197
- }
198
- }
199
- else {
200
- if(is_singular()) {
201
- $page_ids = explode(',', str_replace(" ", "", get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_exclude_ids')));
202
- if(wp_insert_is_in_array($page_details, $page_ids) =='FALSE') {
203
- switch($random) {
204
- case 0:
205
- $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content').'</div>';
206
- break;
207
- case 1:
208
- $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content_1').'</div>';
209
- break;
210
- case 2:
211
- $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content_2').'</div>';
212
- break;
213
- }
214
- }
215
- }
216
- }
217
- }
218
- if(get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_enable')) {
219
- $ad_style = get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_style');
220
- if($ad_style == '') { $ad_style = 'margin: 5px; padding: 0px;'; }
221
- if(!get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_exclude_home') && ($page_details == 'HOME')) {
222
- switch($random) {
223
- case 0:
224
- $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content').'</div>';
225
- break;
226
- case 1:
227
- $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content_1').'</div>';
228
- break;
229
- case 2:
230
- $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content_2').'</div>';
231
- break;
232
- }
233
- }
234
- else if(!get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_exclude_archives') && ($page_details == 'ARCHIVE')) {
235
- switch($random) {
236
- case 0:
237
- $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content').'</div>';
238
- break;
239
- case 1:
240
- $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content_1').'</div>';
241
- break;
242
- case 2:
243
- $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content_2').'</div>';
244
- break;
245
- }
246
- }
247
- else {
248
- if(is_singular()) {
249
- $page_ids = explode(',', str_replace(" ", "", get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_exclude_ids')));
250
- if(wp_insert_is_in_array($page_details, $page_ids) =='FALSE') {
251
- switch($random) {
252
- case 0:
253
- $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content').'</div>';
254
- break;
255
- case 1:
256
- $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content_1').'</div>';
257
- break;
258
- case 2:
259
- $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content_2').'</div>';
260
- break;
261
- }
262
- }
263
- }
264
- }
265
- }
266
- $content = $output.$content."<div style='clear:both'></div>";
267
- return $content;
268
- }
269
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/inpostads/activate-upgrade.php ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('wp_insert_activate_upgrade', 'wp_insert_inpostads_activate_upgrade');
3
+ function wp_insert_inpostads_activate_upgrade() {
4
+ if(!get_option('wp_insert_inpostads_options')) {
5
+ $values = array(
6
+ 'above' => array(
7
+ 'status' => '',
8
+ 'ad_code_1' => '',
9
+ 'ad_code_2' => '',
10
+ 'ad_code_3' => '',
11
+ 'country_1' => '',
12
+ 'country_code_1' => '',
13
+ 'rules_exclude_home' => '',
14
+ 'rules_home_instances' => '',
15
+ 'rules_exclude_archives' => '',
16
+ 'rules_archives_instances' => '',
17
+ 'rules_exclude_categories' => '',
18
+ 'rules_categories_instances' => '',
19
+ 'rules_categories_exceptions' => '',
20
+ 'rules_exclude_search' => '',
21
+ 'rules_search_instances' => '',
22
+ 'rules_exclude_page' => '',
23
+ 'rules_page_exceptions' => '',
24
+ 'rules_exclude_post' => '',
25
+ 'rules_post_exceptions' => '',
26
+ 'styles' => 'margin: 5px; padding: 0px;',
27
+ ),
28
+ 'middle' => array(
29
+ 'status' => '',
30
+ 'ad_code_1' => '',
31
+ 'ad_code_2' => '',
32
+ 'ad_code_3' => '',
33
+ 'country_1' => '',
34
+ 'country_code_1' => '',
35
+ 'rules_exclude_home' => '',
36
+ 'rules_home_instances' => '',
37
+ 'rules_exclude_archives' => '',
38
+ 'rules_archives_instances' => '',
39
+ 'rules_exclude_categories' => '',
40
+ 'rules_categories_instances' => '',
41
+ 'rules_categories_exceptions' => '',
42
+ 'rules_exclude_search' => '',
43
+ 'rules_search_instances' => '',
44
+ 'rules_exclude_page' => '',
45
+ 'rules_page_exceptions' => '',
46
+ 'rules_exclude_post' => '',
47
+ 'rules_post_exceptions' => '',
48
+ 'styles' => 'margin: 5px; padding: 0px;',
49
+ 'minimum_character_count' => '500',
50
+ 'paragraph_buffer_count' => '',
51
+ ),
52
+ 'below' => array(
53
+ 'status' => '',
54
+ 'ad_code_1' => '',
55
+ 'ad_code_2' => '',
56
+ 'ad_code_3' => '',
57
+ 'country_1' => '',
58
+ 'country_code_1' => '',
59
+ 'rules_exclude_home' => '',
60
+ 'rules_home_instances' => '',
61
+ 'rules_exclude_archives' => '',
62
+ 'rules_archives_instances' => '',
63
+ 'rules_exclude_categories' => '',
64
+ 'rules_categories_instances' => '',
65
+ 'rules_categories_exceptions' => '',
66
+ 'rules_exclude_search' => '',
67
+ 'rules_search_instances' => '',
68
+ 'rules_exclude_page' => '',
69
+ 'rules_page_exceptions' => '',
70
+ 'rules_exclude_post' => '',
71
+ 'rules_post_exceptions' => '',
72
+ 'styles' => 'margin: 5px; padding: 0px;',
73
+ ),
74
+ 'left' => array(
75
+ 'status' => '',
76
+ 'ad_code_1' => '',
77
+ 'ad_code_2' => '',
78
+ 'ad_code_3' => '',
79
+ 'country_1' => '',
80
+ 'country_code_1' => '',
81
+ 'rules_exclude_home' => '',
82
+ 'rules_home_instances' => '',
83
+ 'rules_exclude_archives' => '',
84
+ 'rules_archives_instances' => '',
85
+ 'rules_exclude_categories' => '',
86
+ 'rules_categories_instances' => '',
87
+ 'rules_categories_exceptions' => '',
88
+ 'rules_exclude_search' => '',
89
+ 'rules_search_instances' => '',
90
+ 'rules_exclude_page' => '',
91
+ 'rules_page_exceptions' => '',
92
+ 'rules_exclude_post' => '',
93
+ 'rules_post_exceptions' => '',
94
+ 'styles' => 'margin: 5px; padding: 0px;',
95
+ ),
96
+ 'right' => array(
97
+ 'status' => '',
98
+ 'ad_code_1' => '',
99
+ 'ad_code_2' => '',
100
+ 'ad_code_3' => '',
101
+ 'country_1' => '',
102
+ 'country_code_1' => '',
103
+ 'rules_exclude_home' => '',
104
+ 'rules_home_instances' => '',
105
+ 'rules_exclude_archives' => '',
106
+ 'rules_archives_instances' => '',
107
+ 'rules_exclude_categories' => '',
108
+ 'rules_categories_instances' => '',
109
+ 'rules_categories_exceptions' => '',
110
+ 'rules_exclude_search' => '',
111
+ 'rules_search_instances' => '',
112
+ 'rules_exclude_page' => '',
113
+ 'rules_page_exceptions' => '',
114
+ 'rules_exclude_post' => '',
115
+ 'rules_post_exceptions' => '',
116
+ 'styles' => 'margin: 5px; padding: 0px;',
117
+ ),
118
+ );
119
+ $values = wp_insert_inpostads_upgrade_from_1x($values);
120
+ update_option('wp_insert_inpostads_options', $values);
121
+ }
122
+ }
123
+
124
+ function wp_insert_inpostads_upgrade_from_1x($values) {
125
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_top_1_enable');
126
+ $values['above']['status'] = ($val == null)?$values['above']['status']:$val;
127
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_top_1_content');
128
+ $values['above']['ad_code_1'] = ($val == null)?$values['above']['ad_code_1']:$val;
129
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_top_1_content_1');
130
+ $values['above']['ad_code_2'] = ($val == null)?$values['above']['ad_code_2']:$val;
131
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_top_1_content_2');
132
+ $values['above']['ad_code_3'] = ($val == null)?$values['above']['ad_code_3']:$val;
133
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_top_1_exclude_ids');
134
+ $values['above']['rules_exclude_page'] = ($val == null)?$values['above']['rules_exclude_page']:$val;
135
+ $values['above']['rules_exclude_page'] = ($val == null)?$values['above']['rules_exclude_page']:$val;
136
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_top_1_exclude_home');
137
+ $values['above']['rules_exclude_home'] = ($val == null)?$values['above']['rules_exclude_home']:$val;
138
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_top_1_exclude_archives');
139
+ $values['above']['rules_exclude_archives'] = ($val == null)?$values['above']['rules_exclude_archives']:$val;
140
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_top_1_style');
141
+ $values['above']['styles'] = ($val == null)?$values['above']['styles']:$val;
142
+
143
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_middle_1_enable');
144
+ $values['middle']['status'] = ($val == null)?$values['middle']['status']:$val;
145
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_middle_1_content');
146
+ $values['middle']['ad_code_1'] = ($val == null)?$values['middle']['ad_code_1']:$val;
147
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_middle_1_content_1');
148
+ $values['middle']['ad_code_2'] = ($val == null)?$values['middle']['ad_code_2']:$val;
149
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_middle_1_content_2');
150
+ $values['middle']['ad_code_3'] = ($val == null)?$values['middle']['ad_code_3']:$val;
151
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_middle_1_exclude_ids');
152
+ $values['middle']['rules_exclude_page'] = ($val == null)?$values['middle']['rules_exclude_page']:$val;
153
+ $values['middle']['rules_exclude_page'] = ($val == null)?$values['middle']['rules_exclude_page']:$val;
154
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_middle_1_exclude_home');
155
+ $values['middle']['rules_exclude_home'] = ($val == null)?$values['middle']['rules_exclude_home']:$val;
156
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_middle_1_exclude_archives');
157
+ $values['middle']['rules_exclude_archives'] = ($val == null)?$values['middle']['rules_exclude_archives']:$val;
158
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_middle_1_style');
159
+ $values['middle']['styles'] = ($val == null)?$values['middle']['styles']:$val;
160
+
161
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_bottom_1_enable');
162
+ $values['below']['status'] = ($val == null)?$values['below']['status']:$val;
163
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_bottom_1_content');
164
+ $values['below']['ad_code_1'] = ($val == null)?$values['below']['ad_code_1']:$val;
165
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_bottom_1_content_1');
166
+ $values['below']['ad_code_2'] = ($val == null)?$values['below']['ad_code_2']:$val;
167
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_bottom_1_content_2');
168
+ $values['below']['ad_code_3'] = ($val == null)?$values['below']['ad_code_3']:$val;
169
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_bottom_1_exclude_ids');
170
+ $values['below']['rules_exclude_page'] = ($val == null)?$values['below']['rules_exclude_page']:$val;
171
+ $values['below']['rules_exclude_page'] = ($val == null)?$values['below']['rules_exclude_page']:$val;
172
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_bottom_1_exclude_home');
173
+ $values['below']['rules_exclude_home'] = ($val == null)?$values['below']['rules_exclude_home']:$val;
174
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_bottom_1_exclude_archives');
175
+ $values['below']['rules_exclude_archives'] = ($val == null)?$values['below']['rules_exclude_archives']:$val;
176
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_bottom_1_style');
177
+ $values['below']['styles'] = ($val == null)?$values['below']['styles']:$val;
178
+
179
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_left_1_enable');
180
+ $values['left']['status'] = ($val == null)?$values['left']['status']:$val;
181
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_left_1_content');
182
+ $values['left']['ad_code_1'] = ($val == null)?$values['left']['ad_code_1']:$val;
183
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_left_1_content_1');
184
+ $values['left']['ad_code_2'] = ($val == null)?$values['left']['ad_code_2']:$val;
185
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_left_1_content_2');
186
+ $values['left']['ad_code_3'] = ($val == null)?$values['left']['ad_code_3']:$val;
187
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_left_1_exclude_ids');
188
+ $values['left']['rules_exclude_page'] = ($val == null)?$values['left']['rules_exclude_page']:$val;
189
+ $values['left']['rules_exclude_page'] = ($val == null)?$values['left']['rules_exclude_page']:$val;
190
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_left_1_exclude_home');
191
+ $values['left']['rules_exclude_home'] = ($val == null)?$values['left']['rules_exclude_home']:$val;
192
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_left_1_exclude_archives');
193
+ $values['left']['rules_exclude_archives'] = ($val == null)?$values['left']['rules_exclude_archives']:$val;
194
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_left_1_style');
195
+ $values['left']['styles'] = ($val == null)?$values['left']['styles']:$val;
196
+
197
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_right_1_enable');
198
+ $values['right']['status'] = ($val == null)?$values['right']['status']:$val;
199
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_right_1_content');
200
+ $values['right']['ad_code_1'] = ($val == null)?$values['right']['ad_code_1']:$val;
201
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_right_1_content_1');
202
+ $values['right']['ad_code_2'] = ($val == null)?$values['right']['ad_code_2']:$val;
203
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_right_1_content_2');
204
+ $values['right']['ad_code_3'] = ($val == null)?$values['right']['ad_code_3']:$val;
205
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_right_1_exclude_ids');
206
+ $values['right']['rules_exclude_page'] = ($val == null)?$values['right']['rules_exclude_page']:$val;
207
+ $values['right']['rules_exclude_page'] = ($val == null)?$values['right']['rules_exclude_page']:$val;
208
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_right_1_exclude_home');
209
+ $values['right']['rules_exclude_home'] = ($val == null)?$values['right']['rules_exclude_home']:$val;
210
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_right_1_exclude_archives');
211
+ $values['right']['rules_exclude_archives'] = ($val == null)?$values['right']['rules_exclude_archives']:$val;
212
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_in_post_ad_right_1_style');
213
+ $values['right']['styles'] = ($val == null)?$values['right']['styles']:$val;
214
+ return $values;
215
+ }
216
+ ?>
includes/inpostads/admin-page.php ADDED
@@ -0,0 +1,284 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_insert_inpostads_admin_page() {
3
+ wp_insert_admin_page('In Post Ads', 'wp-insert', 'wp_insert_inpostads_options');
4
+ }
5
+
6
+ add_action('admin_init', 'wp_insert_inpostads_admin_init');
7
+ function wp_insert_inpostads_admin_init() {
8
+ register_setting('wp_insert_inpostads_options', 'wp_insert_inpostads_options', 'wp_insert_inpostads_validate');
9
+ add_settings_section('wp-insert-inpostads', '', 'wp_insert_inpostads_section', 'wp-insert');
10
+
11
+ $options = get_option('wp_insert_inpostads_options');
12
+ add_meta_box('wp_insert_multiple_network_status', 'Multiple Ad Networks', 'wp_insert_multiple_network_status_content', 'wp-insert-inpostads', 'advanced', 'high', array('location' => 'multiple-network', 'name' => 'wp_insert_inpostads_options', 'data' => $options));
13
+ add_meta_box('wp-insert-inpostads-above-content', 'Ad - Above Post Content', 'wp_insert_inpostads_content', 'wp-insert-inpostads', 'advanced', 'low', array('location' => 'above', 'name' => 'wp_insert_inpostads_options', 'data' => $options));
14
+ add_meta_box('wp-insert-inpostads-middle-content', 'Ad - Middle of Post Content', 'wp_insert_inpostads_content', 'wp-insert-inpostads', 'advanced', 'low', array('location' => 'middle', 'name' => 'wp_insert_inpostads_options', 'data' => $options));
15
+ add_meta_box('wp-insert-inpostads-below-content', 'Ad - Below Post Content', 'wp_insert_inpostads_content', 'wp-insert-inpostads', 'advanced', 'low', array('location' => 'below', 'name' => 'wp_insert_inpostads_options', 'data' => $options));
16
+ add_meta_box('wp-insert-inpostads-left-content', 'Ad - Left of Post Content', 'wp_insert_inpostads_content', 'wp-insert-inpostads', 'advanced', 'low', array('location' => 'left', 'name' => 'wp_insert_inpostads_options', 'data' => $options));
17
+ add_meta_box('wp-insert-inpostads-right-content', 'Ad - Right of Post Content', 'wp_insert_inpostads_content', 'wp-insert-inpostads', 'advanced', 'low', array('location' => 'right', 'name' => 'wp_insert_inpostads_options', 'data' => $options));
18
+ }
19
+
20
+ function wp_insert_inpostads_section() {
21
+ do_meta_boxes('wp-insert-inpostads', 'advanced', null);
22
+ }
23
+
24
+ function wp_insert_inpostads_content($post, $args) {
25
+ $location = $args['args']['location'];
26
+ $data = $args['args']['data'];
27
+ $id = $args['id'];
28
+ $name = $args['args']['name'].'['.$location.']';
29
+
30
+ if(!$data) {
31
+ $data = array();
32
+ }
33
+
34
+ $controls = array();
35
+ $controls['status'] = wp_insert_get_control('tz-checkbox', false, $name.'[status]', $id.'-status', $data[$location]['status']);
36
+ $controls['ad_code_1'] = wp_insert_get_control('textarea', false, $name.'[ad_code_1]', $id.'-ad_code_1', $data[$location]['ad_code_1'], 'Ad Code (Primary Network):');
37
+ $controls['ad_code_2'] = wp_insert_get_control('textarea', false, $name.'[ad_code_2]', $id.'-ad_code_2', $data[$location]['ad_code_2'], 'Ad Code (Secondary Network):');
38
+ $controls['ad_code_3'] = wp_insert_get_control('textarea', false, $name.'[ad_code_3]', $id.'-ad_code_3', $data[$location]['ad_code_3'], 'Ad Code (Tertiary Network):');
39
+
40
+ $controls['country_1'] = wp_insert_get_control('popup', false, $name.'[country_1]', $id.'-country_1', $data[$location]['country_1'], 'Geo Targets', '', array('type' => 'countries'));
41
+ $controls['country_code_1'] = wp_insert_get_control('textarea', false, $name.'[country_code_1]', $id.'-country_code_1', $data[$location]['country_code_1'], 'Ad Code', '', null, 'input widefat');
42
+
43
+ $controls['rules_exclude_home'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_home]', $id.'-rules_exclude_home', $data[$location]['rules_exclude_home'], '', '', null, '', false);
44
+ $controls['rules_home_instances'] = wp_insert_get_control('popup', false, $name.'[rules_home_instances]', $id.'-rules_home_instances', $data[$location]['rules_home_instances'], '', '', array('type' => 'instances'), '', false);
45
+ $controls['rules_exclude_archives'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_archives]', $id.'-rules_exclude_archives', $data[$location]['rules_exclude_archives'], '', '', null, '', false);
46
+ $controls['rules_archives_instances'] = wp_insert_get_control('popup', false, $name.'[rules_archives_instances]', $id.'-rules_archives_instances', $data[$location]['rules_archives_instances'], '', '', array('type' => 'instances'), '', false);
47
+ $controls['rules_exclude_categories'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_categories]', $id.'-rules_exclude_categories', $data[$location]['rules_exclude_categories'], '', '', null, '', false);
48
+ $controls['rules_categories_instances'] = wp_insert_get_control('popup', false, $name.'[rules_categories_instances]', $id.'-rules_categories_instances', $data[$location]['rules_categories_instances'], '', '', array('type' => 'instances'), '', false);
49
+ $controls['rules_categories_exceptions'] = wp_insert_get_control('popup', false, $name.'[rules_categories_exceptions]', $id.'-rules_categories_exceptions', $data[$location]['rules_categories_exceptions'], '', '', array('type' => 'categories'), '', false);
50
+ $controls['rules_exclude_search'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_search]', $id.'-rules_exclude_search', $data[$location]['rules_exclude_search'], '', '', null, '', false);
51
+ $controls['rules_search_instances'] = wp_insert_get_control('popup', false, $name.'[rules_search_instances]', $id.'-rules_search_instances', $data[$location]['rules_search_instances'], '', '', array('type' => 'instances'), '', false);
52
+ $controls['rules_exclude_page'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_page]', $id.'-rules_exclude_page', $data[$location]['rules_exclude_page'], '', '', null, '', false);
53
+ $controls['rules_page_exceptions'] = wp_insert_get_control('popup', false, $name.'[rules_page_exceptions]', $id.'-rules_page_exceptions', $data[$location]['rules_page_exceptions'], '', '', array('type' => 'pages'), '', false);
54
+ $controls['rules_exclude_post'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_post]', $id.'-rules_exclude_post', $data[$location]['rules_exclude_post'], '', '', null, '', false);
55
+ $controls['rules_post_exceptions'] = wp_insert_get_control('popup', false, $name.'[rules_post_exceptions]', $id.'-rules_post_exceptions', $data[$location]['rules_post_exceptions'], '', '', array('type' => 'posts'), '', false);
56
+
57
+ $controls['styles'] = wp_insert_get_control('textarea', false, $name.'[styles]', $id.'-styles', $data[$location]['styles'], 'Styles:');
58
+
59
+ if($location == 'middle') {
60
+ $controls['minimum_character_count'] = wp_insert_get_control('text', false, $name.'[minimum_character_count]', $id.'-minimum_character_count', $data[$location]['minimum_character_count'], 'Minimum Character Count', 'Show the ad only if the Content meets the minimum character count. If this parameter is set to 0 (or empty) minimum character count check will be deactivated.', null, 'input widefat');
61
+ $controls['paragraph_buffer_count'] = wp_insert_get_control('text', false, $name.'[paragraph_buffer_count]', $id.'-paragraph_buffer_count', $data[$location]['paragraph_buffer_count'], 'Paragraph Buffer Count', 'Shows the ad after X number of Paragraphs. If this parameter is set to 0 (or empty) the ad will appear in the middle of the content.', null, 'input widefat');
62
+ }
63
+
64
+ echo $controls['status']['html'];
65
+
66
+ $multiple_network_status = get_option('wp_insert_multiple_network_status');
67
+ if($multiple_network_status == 2 || $multiple_network_status == 1) {
68
+ $controls['ad_code_3']['html'] = '<div style="display: none;">'.$controls['ad_code_3']['html'].'</div>';
69
+ }
70
+
71
+ if($multiple_network_status == 1) {
72
+ $controls['ad_code_2']['html'] = '<div style="display: none;">'.$controls['ad_code_2']['html'].'</div>';
73
+ }
74
+ $tabData = array(
75
+ array(
76
+ 'title' => 'Ad Code',
77
+ 'content' => $controls['ad_code_1']['html'].$controls['ad_code_2']['html'].$controls['ad_code_3']['html']
78
+ ),
79
+ array(
80
+ 'title' => 'Rules',
81
+ 'content' => wp_insert_inpostads_rules_content($controls)
82
+ ),
83
+ array(
84
+ 'title' => 'Geo Targeting',
85
+ 'content' => '<p>'.$controls['country_1']['html'].$controls['country_code_1']['html'].'</p>'
86
+ ),
87
+ array(
88
+ 'title' => 'Styles',
89
+ 'content' => $controls['styles']['html']
90
+ )
91
+ );
92
+ if($location == 'middle') {
93
+ array_push(
94
+ $tabData,
95
+ array(
96
+ 'title' => 'Settings',
97
+ 'content' => $controls['minimum_character_count']['html'].$controls['paragraph_buffer_count']['html']
98
+ )
99
+ );
100
+ }
101
+ $controls['vtab'] = wp_insert_get_vtabs('vtab_'.$location, $tabData);
102
+ echo $controls['vtab']['html'];
103
+
104
+ echo wp_insert_get_script_tag($controls);
105
+ }
106
+
107
+ function wp_insert_inpostads_rules_content($controls) {
108
+ $rulesTable = array(
109
+ 'class' => 'rules',
110
+ 'rows' => array()
111
+ );
112
+ array_push(
113
+ $rulesTable['rows'],
114
+ array(
115
+ 'cells' => array(
116
+ array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Home')
117
+ )
118
+ ),
119
+ array(
120
+ 'cells' => array(
121
+ array('content' => 'Status'),
122
+ array('content' => '&nbsp;:&nbsp;'),
123
+ array('content' => $controls['rules_exclude_home']['html'])
124
+ )
125
+ ),
126
+ array(
127
+ 'cells' => array(
128
+ array('content' => 'Instances'),
129
+ array('content' => '&nbsp;:&nbsp;'),
130
+ array('content' => $controls['rules_home_instances']['html'])
131
+ )
132
+ )
133
+ );
134
+ array_push(
135
+ $rulesTable['rows'],
136
+ array(
137
+ 'cells' => array(
138
+ array('colspan' => '3', 'content' => '&nbsp;')
139
+ )
140
+ ),
141
+ array(
142
+ 'cells' => array(
143
+ array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Archives')
144
+ )
145
+ ),
146
+ array(
147
+ 'cells' => array(
148
+ array('content' => 'Status'),
149
+ array('content' => '&nbsp;:&nbsp;'),
150
+ array('content' => $controls['rules_exclude_archives']['html'])
151
+ )
152
+ ),
153
+ array(
154
+ 'cells' => array(
155
+ array('content' => 'Instances'),
156
+ array('content' => '&nbsp;:&nbsp;'),
157
+ array('content' => $controls['rules_archives_instances']['html'])
158
+ )
159
+ )
160
+ );
161
+ array_push(
162
+ $rulesTable['rows'],
163
+ array(
164
+ 'cells' => array(
165
+ array('colspan' => '3', 'content' => '&nbsp;')
166
+ )
167
+ ),
168
+ array(
169
+ 'cells' => array(
170
+ array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Categories')
171
+ )
172
+ ),
173
+ array(
174
+ 'cells' => array(
175
+ array('content' => 'Status'),
176
+ array('content' => '&nbsp;:&nbsp;'),
177
+ array('content' => $controls['rules_exclude_categories']['html'])
178
+ )
179
+ ),
180
+ array(
181
+ 'cells' => array(
182
+ array('content' => 'Instances'),
183
+ array('content' => '&nbsp;:&nbsp;'),
184
+ array('content' => $controls['rules_categories_instances']['html'])
185
+ )
186
+ ),
187
+ array(
188
+ 'cells' => array(
189
+ array('content' => 'Exceptions'),
190
+ array('content' => '&nbsp;:&nbsp;'),
191
+ array('content' => $controls['rules_categories_exceptions']['html'])
192
+ )
193
+ )
194
+ );
195
+ array_push(
196
+ $rulesTable['rows'],
197
+ array(
198
+ 'cells' => array(
199
+ array('colspan' => '3', 'content' => '&nbsp;')
200
+ )
201
+ ),
202
+ array(
203
+ 'cells' => array(
204
+ array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Search Results')
205
+ )
206
+ ),
207
+ array(
208
+ 'cells' => array(
209
+ array('content' => 'Status'),
210
+ array('content' => '&nbsp;:&nbsp;'),
211
+ array('content' => $controls['rules_exclude_search']['html'])
212
+ )
213
+ ),
214
+ array(
215
+ 'cells' => array(
216
+ array('content' => 'Instances'),
217
+ array('content' => '&nbsp;:&nbsp;'),
218
+ array('content' => $controls['rules_search_instances']['html'])
219
+ )
220
+ )
221
+ );
222
+ array_push(
223
+ $rulesTable['rows'],
224
+ array(
225
+ 'cells' => array(
226
+ array('colspan' => '3', 'content' => '&nbsp;')
227
+ )
228
+ ),
229
+ array(
230
+ 'cells' => array(
231
+ array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Single Page')
232
+ )
233
+ ),
234
+ array(
235
+ 'cells' => array(
236
+ array('content' => 'Status'),
237
+ array('content' => '&nbsp;:&nbsp;'),
238
+ array('content' => $controls['rules_exclude_page']['html'])
239
+ )
240
+ ),
241
+ array(
242
+ 'cells' => array(
243
+ array('content' => 'Exceptions'),
244
+ array('content' => '&nbsp;:&nbsp;'),
245
+ array('content' => $controls['rules_page_exceptions']['html'])
246
+ )
247
+ )
248
+ );
249
+ array_push(
250
+ $rulesTable['rows'],
251
+ array(
252
+ 'cells' => array(
253
+ array('colspan' => '3', 'content' => '&nbsp;')
254
+ )
255
+ ),
256
+ array(
257
+ 'cells' => array(
258
+ array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Single Blog Post')
259
+ )
260
+ ),
261
+ array(
262
+ 'cells' => array(
263
+ array('content' => 'Status'),
264
+ array('content' => '&nbsp;:&nbsp;'),
265
+ array('content' => $controls['rules_exclude_post']['html'])
266
+ )
267
+ ),
268
+ array(
269
+ 'cells' => array(
270
+ array('content' => 'Exceptions'),
271
+ array('content' => '&nbsp;:&nbsp;'),
272
+ array('content' => $controls['rules_post_exceptions']['html'])
273
+ )
274
+ )
275
+ );
276
+
277
+ return wp_insert_get_table($rulesTable);
278
+ }
279
+
280
+ function wp_insert_inpostads_validate($input) {
281
+ update_option('wp_insert_multiple_network_status', $input['multiple-network']['status']);
282
+ return $input;
283
+ }
284
+ ?>
includes/inpostads/content.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_filter('the_content', 'wp_insert_inpostads_filter_the_content', 100);
3
+ function wp_insert_inpostads_filter_the_content($content) {
4
+ global $wpInsertAdInstance;
5
+ global $wpInsertGeoLocation;
6
+ $options = get_option('wp_insert_inpostads_options');
7
+
8
+ if(wp_insert_get_ad_status($options['middle'])) {
9
+ $paragraphs = explode('/p>', $content);
10
+ $paragraphCount = 0;
11
+ if(is_array($paragraphs)) {
12
+ foreach($paragraphs as $paragraph) {
13
+ if(strlen($paragraph) > 1) {
14
+ $paragraphCount++;
15
+ }
16
+ }
17
+ }
18
+ if($paragraphCount > 1) {
19
+ if(($options['middle']['minimum_character_count'] == 0) || ($options['middle']['minimum_character_count'] == '')) {
20
+ if(($options['middle']['paragraph_buffer_count'] == 0) || ($options['middle']['paragraph_buffer_count'] == '')) {
21
+ $position = wp_insert_inpostads_get_middle_position('/p>', $content, round($paragraphCount / 2));
22
+ } else {
23
+ $position = wp_insert_inpostads_get_middle_position('/p>', $content, $options['middle']['paragraph_buffer_count']);
24
+ }
25
+ if($position) {
26
+ if(($options['middle']['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['middle']['country_1'])))) {
27
+ $content = substr_replace($content, '/p>'.'<div class="wpInsert wpInsertInPostAd wpInsertMiddle"'.(($options['middle']['styles'] != '')?' style="'.$options['middle']['styles'].'"':'').'>'.$options['middle']['country_code_1'].'</div>', $position, 3);
28
+ } else {
29
+ $content = substr_replace($content, '/p>'.'<div class="wpInsert wpInsertInPostAd wpInsertMiddle"'.(($options['middle']['styles'] != '')?' style="'.$options['middle']['styles'].'"':'').'>'.$options['middle']['ad_code_'.$wpInsertAdInstance].'</div>', $position, 3);
30
+ }
31
+ }
32
+ } else {
33
+ if(strlen(strip_tags($content)) > $options['middle']['minimum_character_count']) {
34
+ if(($options['middle']['paragraph_buffer_count'] == 0) || ($options['middle']['paragraph_buffer_count'] == '')) {
35
+ $position = wp_insert_inpostads_get_middle_position('/p>', $content, round($paragraphCount / 2));
36
+ } else {
37
+ $position = wp_insert_inpostads_get_middle_position('/p>', $content, $options['middle']['paragraph_buffer_count']);
38
+ }
39
+ if($position) {
40
+ if(($options['middle']['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['middle']['country_1'])))) {
41
+ $content = substr_replace($content, '/p>'.'<div class="wpInsert wpInsertInPostAd wpInsertMiddle"'.(($options['middle']['styles'] != '')?' style="'.$options['middle']['styles'].'"':'').'>'.$options['middle']['country_code_1'].'</div>', $position, 3);
42
+ } else {
43
+ $content = substr_replace($content, '/p>'.'<div class="wpInsert wpInsertInPostAd wpInsertMiddle"'.(($options['middle']['styles'] != '')?' style="'.$options['middle']['styles'].'"':'').'>'.$options['middle']['ad_code_'.$wpInsertAdInstance].'</div>', $position, 3);
44
+ }
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }
50
+ if(wp_insert_get_ad_status($options['left'])) {
51
+ if(($options['left']['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['left']['country_1'])))) {
52
+ $content = '<div class="wpInsert wpInsertInPostAd wpInsertLeft" style="float: left; '.(($options['left']['styles'] != '')?$options['left']['styles']:'').'">'.$options['left']['country_code_1'].'</div>'.$content;
53
+ } else {
54
+ $content = '<div class="wpInsert wpInsertInPostAd wpInsertLeft" style="float: left; '.(($options['left']['styles'] != '')?$options['left']['styles']:'').'">'.$options['left']['ad_code_'.$wpInsertAdInstance].'</div>'.$content;
55
+ }
56
+ }
57
+ if(wp_insert_get_ad_status($options['right'])) {
58
+ if(($options['right']['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['right']['country_1'])))) {
59
+ $content = '<div class="wpInsert wpInsertInPostAd wpInsertRight" style="float: right; '.(($options['right']['styles'] != '')?$options['right']['styles']:'').'">'.$options['right']['country_code_1'].'</div>'.$content;
60
+ } else {
61
+ $content = '<div class="wpInsert wpInsertInPostAd wpInsertRight" style="float: right; '.(($options['right']['styles'] != '')?$options['right']['styles']:'').'">'.$options['right']['ad_code_'.$wpInsertAdInstance].'</div>'.$content;
62
+ }
63
+ }
64
+ if(wp_insert_get_ad_status($options['above'])) {
65
+ if(($options['above']['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['above']['country_1'])))) {
66
+ $content = '<div class="wpInsert wpInsertInPostAd wpInsertAbove"'.(($options['above']['styles'] != '')?' style="'.$options['above']['styles'].'"':'').'>'.$options['above']['country_code_1'].'</div>'.$content;
67
+ } else {
68
+ $content = '<div class="wpInsert wpInsertInPostAd wpInsertAbove"'.(($options['above']['styles'] != '')?' style="'.$options['above']['styles'].'"':'').'>'.$options['above']['ad_code_'.$wpInsertAdInstance].'</div>'.$content;
69
+ }
70
+ }
71
+ if(wp_insert_get_ad_status($options['below'])) {
72
+ if(($options['below']['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['below']['country_1'])))) {
73
+ $content = $content.'<div class="wpInsert wpInsertInPostAd wpInsertBelow"'.(($options['below']['styles'] != '')?' style="'.$options['below']['styles'].'"':'').'>'.$options['below']['country_code_1'].'</div>';
74
+ } else {
75
+ $content = $content.'<div class="wpInsert wpInsertInPostAd wpInsertBelow"'.(($options['below']['styles'] != '')?' style="'.$options['below']['styles'].'"':'').'>'.$options['below']['ad_code_'.$wpInsertAdInstance].'</div>';
76
+ }
77
+ }
78
+ return $content;
79
+ }
80
+
81
+ function wp_insert_inpostads_get_middle_position($search, $string, $offset) {
82
+ $arr = explode($search, $string);
83
+ switch($offset) {
84
+ case $offset == 0:
85
+ return false;
86
+ break;
87
+ case $offset > max(array_keys($arr)):
88
+ return false;
89
+ break;
90
+ default:
91
+ return strlen(implode($search, array_slice($arr, 0, $offset)));
92
+ break;
93
+ }
94
+ }
95
+ ?>
includes/inpostads/inpostads.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ require_once(dirname(__FILE__).'/activate-upgrade.php');
3
+ require_once(dirname(__FILE__).'/menu.php');
4
+ require_once(dirname(__FILE__).'/admin-page.php');
5
+ require_once(dirname(__FILE__).'/content.php');
6
+ ?>
includes/inpostads/menu.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_insert_inpostads_menu() {
3
+ $subPageHandle = add_submenu_page('wp-insert', 'Manage In-Post Ads', 'Manage In-Post Ads', 'manage_options', 'wp-insert', 'wp_insert_inpostads_admin_page');
4
+ add_action('admin_print_styles-'.$subPageHandle, 'wp_insert_admin_styles');
5
+ }
6
+ add_action('admin_menu', 'wp_insert_inpostads_menu');
7
+ ?>
includes/legal-pages/activate-upgrade.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('wp_insert_activate_upgrade', 'wp_insert_legal_activate_upgrade');
3
+ function wp_insert_legal_activate_upgrade() {
4
+ if(!get_option('wp_insert_legal_options')) {
5
+ $values = array(
6
+ 'privacy-policy' => array(
7
+ 'content' => wp_insert_legal_get_default_privacy_policy(),
8
+ 'pages' => ''
9
+ ),
10
+ 'terms-and-conditions' => array(
11
+ 'content' => wp_insert_legal_get_default_terms_and_conditions(),
12
+ 'pages' => ''
13
+ ),
14
+ 'disclaimer' => array(
15
+ 'content' => wp_insert_legal_get_default_disclaimer(),
16
+ 'pages' => ''
17
+ ),
18
+ 'copyright-notice' => array(
19
+ 'content' => wp_insert_legal_get_default_copyright_notice(),
20
+ 'pages' => ''
21
+ )
22
+ );
23
+ $values = wp_insert_legal_upgrade_from_1x($values);
24
+ update_option('wp_insert_legal_options', $values);
25
+ }
26
+ }
27
+
28
+ function wp_insert_legal_upgrade_from_1x($values) {
29
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_privacy_policy_content');
30
+ $values['privacy-policy']['content'] = ($val == null)?$values['privacy-policy']['content']:$val;
31
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_terms_conditions_content');
32
+ $values['terms-and-conditions']['content'] = ($val == null)?$values['terms-and-conditions']['content']:$val;
33
+ return $values;
34
+ }
35
+ ?>
includes/legal-pages/admin-page.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_insert_legal_admin_page() {
3
+ wp_insert_admin_page('Legal Pages', 'wp-insert-legal', 'wp_insert_legal_options');
4
+ }
5
+
6
+ add_action('admin_init', 'wp_insert_legal_admin_init');
7
+ function wp_insert_legal_admin_init() {
8
+ register_setting('wp_insert_legal_options', 'wp_insert_legal_options', 'wp_insert_legal_validate');
9
+ add_settings_section('wp-insert-legal', '', 'wp_insert_legal_section', 'wp-insert-legal');
10
+
11
+ $options = get_option('wp_insert_legal_options');
12
+ add_meta_box('wp-insert-legal-privacy-policy', 'Privacy Policy', 'wp_insert_legal_content', 'wp-insert-legal', 'advanced', 'low', array('location' => 'privacy-policy', 'name' => 'wp_insert_legal_options', 'data' => $options));
13
+ add_meta_box('wp-insert-legal-terms-and-conditions', 'Terms and Conditions', 'wp_insert_legal_content', 'wp-insert-legal', 'advanced', 'low', array('location' => 'terms-and-conditions', 'name' => 'wp_insert_legal_options', 'data' => $options));
14
+ add_meta_box('wp-insert-legal-disclaimer', 'Disclaimer', 'wp_insert_legal_content', 'wp-insert-legal', 'advanced', 'low', array('location' => 'disclaimer', 'name' => 'wp_insert_legal_options', 'data' => $options));
15
+ add_meta_box('wp-insert-copyright-notice', 'Copyright Notice', 'wp_insert_legal_content', 'wp-insert-legal', 'advanced', 'low', array('location' => 'copyright-notice', 'name' => 'wp_insert_legal_options', 'data' => $options));
16
+ }
17
+
18
+ function wp_insert_legal_section() {
19
+ do_meta_boxes('wp-insert-legal', 'advanced', null);
20
+ }
21
+
22
+ function wp_insert_legal_content($post, $args) {
23
+ $location = $args['args']['location'];
24
+ $data = $args['args']['data'];
25
+ $id = $args['id'];
26
+ $name = $args['args']['name'].'['.$location.']';
27
+
28
+ if(!$data) {
29
+ $data = array();
30
+ }
31
+
32
+ $controls = array();
33
+ $controls['content'] = wp_insert_get_control('nicedit', false, $name.'[content]', $id.'-content', $data[$location]['content'], '', 'Leave the field empty to reset to the default content', null);
34
+ $controls['pages'] = wp_insert_get_control('popup', false, $name.'[pages]', $id.'-pages', $data[$location]['pages'], 'Assign Page(s):', '', array('type' => 'pages'));
35
+
36
+ $tabData = array(
37
+ array(
38
+ 'title' => 'Content',
39
+ 'content' => $controls['content']['html']
40
+ ),
41
+ array(
42
+ 'title' => 'Assign Page(s)',
43
+ 'content' => $controls['pages']['html']
44
+ )
45
+ );
46
+ $controls['vtab'] = wp_insert_get_vtabs('vtab_'.$location, $tabData);
47
+ echo $controls['vtab']['html'];
48
+
49
+ echo wp_insert_get_script_tag($controls);
50
+ }
51
+
52
+ function wp_insert_legal_validate($input) {
53
+ if($input['privacy-policy']['content'] == '<br>') {
54
+ $input['privacy-policy']['content'] = wp_insert_legal_get_default_privacy_policy();
55
+ }
56
+ if($input['terms-and-conditions']['content'] == '<br>') {
57
+ $input['terms-and-conditions']['content'] = wp_insert_legal_get_default_terms_and_conditions();
58
+ }
59
+ if($input['disclaimer']['content'] == '<br>') {
60
+ $input['disclaimer']['content'] = wp_insert_legal_get_default_disclaimer();
61
+ }
62
+ if($input['copyright-notice']['content'] == '<br>') {
63
+ $input['copyright-notice']['content'] = wp_insert_legal_get_default_copyright_notice();
64
+ }
65
+ return $input;
66
+ }
67
+ ?>
includes/legal-pages/content.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_filter('the_content', 'wp_insert_legal_filter_the_content');
3
+ function wp_insert_legal_filter_the_content($content) {
4
+ $options = get_option('wp_insert_legal_options');
5
+ $page_details = wp_insert_get_page_details();
6
+ if(in_array($page_details['ID'], split(',', $options['privacy-policy']['pages']))) {
7
+ return $options['privacy-policy']['content'];
8
+ } else if(in_array($page_details['ID'], split(',', $options['terms-and-conditions']['pages']))) {
9
+ return $options['terms-and-conditions']['content'];
10
+ } if(in_array($page_details['ID'], split(',', $options['disclaimer']['pages']))) {
11
+ return $options['disclaimer']['content'];
12
+ } if(in_array($page_details['ID'], split(',', $options['copyright-notice']['pages']))) {
13
+ return $options['copyright-notice']['content'];
14
+ }
15
+ return $content;
16
+ }
17
+
18
+ add_shortcode('sitename', 'wp_insert_legal_shortcode_sitename');
19
+ function wp_insert_legal_shortcode_sitename($atts) {
20
+ return '<i>'.get_bloginfo('name').'</i>';
21
+ }
22
+
23
+ /*Legacy Support*/
24
+ add_shortcode('Privacy', 'wp_insert_legal_shortcode_privacy');
25
+ function wp_insert_legal_shortcode_privacy($atts) {
26
+ $options = get_option('wp_insert_legal_options');
27
+ return do_shortcode($options['privacy-policy']['content']);
28
+ }
29
+
30
+ add_shortcode('Terms', 'wp_insert_legal_shortcode_terms');
31
+ function wp_insert_legal_shortcode_terms($atts) {
32
+ $options = get_option('wp_insert_legal_options');
33
+ return do_shortcode($options['terms-and-conditions']['content']);
34
+ }
35
+ ?>
includes/legal-pages/data.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_insert_legal_get_default_privacy_policy() {
3
+ $output = '<p>At [sitename], the privacy of our visitors is of extreme importance to us (See <a target="_blank" href="http://www.wp-insert.smartlogix.co.in/what-is-a-privacy-policy/">this article</a> to learn more about Privacy Policies.). This privacy policy document outlines the types of personal information is received and collected by [sitename] and how it is used.</p>';
4
+ $output .= '<p><b>Log Files</b></p><p>Like many other Web sites, [sitename] makes use of log files. The information inside the log files includes internet protocol (IP) addresses, type of browser, Internet Service Provider (ISP), date/time stamp, referring/exit pages, and number of clicks to analyze trends, administer the site, track user\'s movement around the site, and gather demographic information. IP addresses, and other such information are not linked to any information that is personally identifiable.</p>';
5
+ $output .= '<p><b>Cookies and Web Beacons</b></p><p>[sitename] does use cookies to store information about visitors preferences, record user-specific information on which pages the user access or visit, customize Web page content based on visitors browser type or other information that the visitor sends via their browser.</p>';
6
+ $output .= '<p><b>DoubleClick DART Cookie</b></p><ul><li>Google, as a third party vendor, uses cookies to serve ads on [sitename].</li><li>Google\'s use of the DART cookie enables it to serve ads to users based on their visit to [sitename] and other sites on the Internet.</li><li>Users may opt out of the use of the DART cookie by visiting the Google ad and content network privacy policy at the following URL - <a href="http://www.google.com/privacy_ads.html">http://www.google.com/privacy_ads.html</a>.</li></ul>';
7
+ $output .= '<p>These third-party ad servers or ad networks use technology to the advertisements and links that appear on [sitename] send directly to your browsers. They automatically receive your IP address when this occurs. Other technologies ( such as cookies, JavaScript, or Web Beacons ) may also be used by the third-party ad networks to measure the effectiveness of their advertisements and / or to personalize the advertising content that you see.</p>';
8
+ $output .= '<p>[sitename] has no access to or control over these cookies that are used by third-party advertisers.</p>';
9
+ $output .= '<p>You should consult the respective privacy policies of these third-party ad servers for more detailed information on their practices as well as for instructions about how to opt-out of certain practices. [sitename]\'s privacy policy does not apply to, and we cannot control the activities of, such other advertisers or web sites.</p>';
10
+ $output .= '<p>If you wish to disable cookies, you may do so through your individual browser options. More detailed information about cookie management with specific web browsers can be found at the browser\'s respective websites.</p>';
11
+ return $output;
12
+ }
13
+
14
+ function wp_insert_legal_get_default_terms_and_conditions() {
15
+ $output = '<p>Welcome to [sitename]. If you continue to browse and use this website you are agreeing to comply with and be bound by the following terms and conditions of use, which together with our privacy policy govern [sitename]\'s relationship with you in relation to this website.</p>';
16
+ $output .= '<p>The term [sitename] or \'us\' or \'we\' refers to the owner of the website. The term \'you\' refers to the user or viewer of our website. The use of this website is subject to the following terms of use:</p>';
17
+ $output .= '<ul>';
18
+ $output .= '<li>The content of the pages of this website is for your general information and use only. It is subject to change without notice.</li>';
19
+ $output .= '<li>Neither we nor any third parties provide any warranty or guarantee as to the accuracy, timeliness, performance, completeness or suitability of the information and materials found or offered on this website for any particular purpose. You acknowledge that such information and materials may contain inaccuracies or errors and we expressly exclude liability for any such inaccuracies or errors to the fullest extent permitted by law.</li>';
20
+ $output .= '<li>Your use of any information or materials on this website is entirely at your own risk, for which we shall not be liable. It shall be your own responsibility to ensure that any products, services or information available through this website meet your specific requirements.</li>';
21
+ $output .= '<li>This website contains material which is owned by or licensed to us. This material includes, but is not limited to, the design, layout, look, appearance and graphics. Reproduction is prohibited other than in accordance with the copyright notice, which forms part of these terms and conditions.</li>';
22
+ $output .= '<li>All trademarks reproduced in this website, which are not the property of, or licensed to the operator, are acknowledged on the website.</li>';
23
+ $output .= '<li>Unauthorized use of this website may give rise to a claim for damages and/or be a criminal offense.</li>';
24
+ $output .= '<li>From time to time this website may also include links to other websites. These links are provided for your convenience to provide further information. They do not signify that we endorse the website(s). We have no responsibility for the content of the linked website(s).</li>';
25
+ $output .= '<li>You may not create a link to this website from another website or document without [sitename]\'s prior written consent.</li>';
26
+ $output .= '</ul>';
27
+ return $output;
28
+ }
29
+
30
+ function wp_insert_legal_get_default_disclaimer() {
31
+ $output = '<p>The information contained in this website is for general information purposes only. The information is provided by [sitename] and while we endeavour to keep the information up to date and correct, we make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability or availability with respect to the website or the information, products, services, or related graphics contained on the website for any purpose. Any reliance you place on such information is therefore strictly at your own risk.</p>';
32
+ $output .= '<p>In no event will we be liable for any loss or damage including without limitation, indirect or consequential loss or damage, or any loss or damage whatsoever arising from loss of data or profits arising out of, or in connection with, the use of this website.</p>';
33
+ $output .= '<p>Through this website you are able to link to other websites which are not under the control of [sitename]. We have no control over the nature, content and availability of those sites. The inclusion of any links does not necessarily imply a recommendation or endorse the views expressed within them.</p>';
34
+ $output .= '<p>Every effort is made to keep the website up and running smoothly. However, [sitename] takes no responsibility for, and will not be liable for, the website being temporarily unavailable due to technical issues beyond our control.</p>';
35
+ return $output;
36
+ }
37
+
38
+ function wp_insert_legal_get_default_copyright_notice() {
39
+ $output = '<p>This website and its content is copyright of [sitename] - &copy; [sitename] 2012. All rights reserved.</p>';
40
+ $output .= '</p>Any redistribution or reproduction of part or all of the contents in any form is prohibited other than the following:</p>';
41
+ $output .= '<ul>';
42
+ $output .= '<li>you may print or download to a local hard disk extracts for your personal and non-commercial use only</li>';
43
+ $output .= '<li>you may copy the content to individual third parties for their personal use, but only if you acknowledge the website as the source of the material</li>';
44
+ $output .= '</ul>';
45
+ $output .= '<p>You may not, except with our express written permission, distribute or commercially exploit the content. Nor may you transmit it or store it in any other website or other form of electronic retrieval system.</p>';
46
+ return $output;
47
+ }
48
+ ?>
includes/legal-pages/legal-pages.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once (dirname(__FILE__).'/activate-upgrade.php');
3
+ require_once (dirname(__FILE__).'/data.php');
4
+ require_once (dirname(__FILE__).'/menu.php');
5
+ require_once (dirname(__FILE__).'/admin-page.php');
6
+ require_once (dirname(__FILE__).'/content.php');
7
+ ?>
includes/legal-pages/menu.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_insert_legal_menu() {
3
+ $subPageHandle = add_submenu_page('wp-insert', 'Setup Legal Pages', 'Setup Legal Pages', 'manage_options', 'wp-insert-legal', 'wp_insert_legal_admin_page');
4
+ add_action('admin_print_styles-'.$subPageHandle, 'wp_insert_admin_styles');
5
+ }
6
+ add_action('admin_menu', 'wp_insert_legal_menu');
7
+ ?>
includes/menu.php DELETED
@@ -1,67 +0,0 @@
1
- <?php
2
- add_action('admin_menu', 'wp_insert_add_menu');
3
-
4
- function wp_insert_add_menu() {
5
- $handle = 'wp-insert';
6
- add_menu_page(__('Wp-Insert','wp-insert'), __('Wp-Insert','wp-insert'), 'manage_options', $handle, 'wp_insert_add_adspage');
7
- add_action( 'admin_print_styles-' . $handle, 'wp_insert_admin_styles' );
8
-
9
- $subMenuItems = array(
10
- 'AdsInContent' => array(
11
- 'Title' => 'Manage Ads<br/>(Posts and Sidebars)',
12
- 'Handle' => 'wp-insert',
13
- 'Function' => 'wp_insert_add_adspage'
14
- ),
15
- 'AdsTemplate' => array(
16
- 'Title' => 'Manage Ads<br/>(Template Tags)',
17
- 'Handle' => 'ads-template-tags',
18
- 'Function' => 'wp_insert_add_advanced_page'
19
- ),
20
- 'PrivacyPolicy' => array(
21
- 'Title' => 'Manage Privacy Policy',
22
- 'Handle' => 'manage-privacy-policy',
23
- 'Function' => 'wp_insert_privacy_policy_page'
24
- ),
25
- 'TandC' => array(
26
- 'Title' => 'Manage T & C',
27
- 'Handle' => 'manage-terms-and-conditions',
28
- 'Function' => 'wp_insert_terms_conditions_page'
29
- ),
30
- 'Pages' => array(
31
- 'Title' => 'Manage Pages',
32
- 'Handle' => 'manage-pages',
33
- 'Function' => 'wp_insert_pages_page'
34
- ),
35
- 'SyntaxHighlighting' => array(
36
- 'Title' => 'Syntax Highlighting',
37
- 'Handle' => 'manage-syntax-highlighting',
38
- 'Function' => 'wp_insert_syntax_highlighter_page'
39
- ),
40
- 'Feed' => array(
41
- 'Title' => 'Manage Feed',
42
- 'Handle' => 'manage-feed',
43
- 'Function' => 'smart_add_feedspage'
44
- ),
45
- 'TrackingCodes' => array(
46
- 'Title' => 'Tracking Codes',
47
- 'Handle' => 'manage-tracking-codes',
48
- 'Function' => 'smart_add_analytics'
49
- ),
50
- 'miscellaneous' => array(
51
- 'Title' => 'Miscellaneous',
52
- 'Handle' => 'miscellaneous_options',
53
- 'Function' => 'wp_insert_miscellaneous_pages'
54
- ),
55
- );
56
-
57
- foreach($subMenuItems as $subMenuItem) {
58
- add_submenu_page($handle, $subMenuItem['Title'], $subMenuItem['Title'], 'manage_options', $subMenuItem['Handle'], $subMenuItem['Function']);
59
- }
60
-
61
- //ensure, that the needed javascripts been loaded to allow drag/drop, expand/collapse and hide/show of boxes
62
- wp_enqueue_script('common');
63
- wp_enqueue_script('wp-lists');
64
- wp_enqueue_script('postbox');
65
- //$columns[$screen] = 2;
66
- }
67
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/miscellaneous.php DELETED
@@ -1,133 +0,0 @@
1
- <?php
2
- add_action('admin_menu','wp_insert_update_notification');
3
- add_action('widgets_init', 'wp_insert_unregister_widgets');
4
-
5
- function wp_insert_update_notification() {
6
- if(get_option('wp_insert_hide_core_update_notification_enable')) {
7
- remove_action('admin_notices', 'update_nag', 3);
8
- remove_filter('update_footer', 'core_update_footer');
9
- }
10
-
11
- if(get_option('wp_insert_show_id_enable')) {
12
- add_filter('manage_posts_columns', 'wp_insert_posts_columns_header');
13
- add_filter('manage_posts_custom_column', 'wp_insert_posts_columns_row', 10, 2);
14
-
15
- add_filter('manage_pages_columns', 'wp_insert_posts_columns_header');
16
- add_filter('manage_pages_custom_column', 'wp_insert_posts_columns_row', 10, 2);
17
- }
18
-
19
- if(get_option('wp_insert_load_theme_styles_enable')) {
20
- add_filter('mce_css', 'wp_insert_editor_style');
21
- }
22
- }
23
-
24
- function wp_insert_unregister_widgets() {
25
- if(get_option('wp_insert_hide_default_widgets_enable')) {
26
- unregister_widget('WP_Widget_Pages');
27
- unregister_widget('WP_Widget_Calendar');
28
- unregister_widget('WP_Widget_Archives');
29
- unregister_widget('WP_Widget_Links');
30
- unregister_widget('WP_Widget_Categories');
31
- unregister_widget('WP_Widget_Recent_Posts');
32
- unregister_widget('WP_Widget_Search');
33
- unregister_widget('WP_Widget_Tag_Cloud');
34
- unregister_widget('WP_Widget_Meta');
35
- unregister_widget('WP_Widget_Recent_Comments');
36
- unregister_widget('WP_Widget_RSS');
37
- //unregister_widget('WP_Widget_Text');
38
- }
39
- }
40
-
41
- function wp_insert_posts_columns_header($columns) {
42
- $columns = array_merge(array_slice($columns, 0, 1), array('postID' => 'ID'),array_slice($columns, 1, count($columns)));
43
- return $columns;
44
- }
45
- function wp_insert_posts_columns_row($columnTitle, $postID){
46
- if($columnTitle == 'postID'){
47
- echo $postID;
48
- }
49
- }
50
-
51
- function wp_insert_editor_style($url) {
52
- if (!empty($url)) $url .= ',';
53
- $url .= trailingslashit(get_stylesheet_directory_uri()).'style.css';
54
- return $url;
55
- }
56
-
57
-
58
- function wp_insert_miscellaneous_pages() {
59
- global $screen_layout_columns;
60
-
61
- add_meta_box('wp_insert_miscellaneous_core_update_notification', 'Hide Core Update Notification', 'wp_insert_miscellaneous_core_update_notification_HTML', 'col_1');
62
- add_meta_box('wp_insert_hide_default_widgets', 'Hide Default Widgets', 'wp_insert_hide_default_widgets_HTML', 'col_1');
63
- add_meta_box('wp_insert_show_id', 'Show ID in Post & Page Listing', 'wp_insert_show_id_HTML', 'col_1');
64
- add_meta_box('wp_insert_load_theme_styles', 'Load theme styles in Visual Editor', 'wp_insert_load_theme_styles_HTML', 'col_1');
65
-
66
- $parameters = 'wp_insert_hide_core_update_notification_enable, wp_insert_hide_default_widgets_enable, wp_insert_show_id_enable, wp_insert_load_theme_styles_enable';
67
- wp_insert_settings_page_layout($parameters, 'WP-INSERT : Miscellaneous Options', 'miscellaneous');
68
- }
69
-
70
- function wp_insert_miscellaneous_core_update_notification_HTML() { ?>
71
- <div>
72
- <?php if(get_option('wp_insert_hide_core_update_notification_enable')) { ?>
73
- <input type="button" id="wp_insert_hide_core_update_notification_enable_button" value="Click to Deactivate" class="button" style="font-weight:bold;color:red;" onclick="wpInsertToggleAdWidget('#wp_insert_hide_core_update_notification_enable_button', '#wp_insert_hide_core_update_notification_enable')"/>
74
- <?php } else { ?>
75
- <input type="button" id="wp_insert_hide_core_update_notification_enable_button" value="Click to Activate" class="button" style="font-weight:bold;color:#2f9303;" onclick="wpInsertToggleAdWidget('#wp_insert_hide_core_update_notification_enable_button', '#wp_insert_hide_core_update_notification_enable')"/>
76
- <?php } ?>
77
- <input style="display:none;" id="wp_insert_hide_core_update_notification_enable" name="wp_insert_hide_core_update_notification_enable" type="checkbox" value="1"<?php if(get_option('wp_insert_hide_core_update_notification_enable')) echo ' checked="checked"'; ?> />
78
- <p>
79
- <small>
80
- You can hide the message which says : "WordPress XX.XX.XX is available! Please update now." if you dont want users to accidently upgrade the core when you suspect an upgrade might break a feature.
81
- </small>
82
- </p>
83
- </div>
84
- <?php }
85
-
86
- function wp_insert_hide_default_widgets_HTML() { ?>
87
- <div>
88
- <?php if(get_option('wp_insert_hide_default_widgets_enable')) { ?>
89
- <input type="button" id="wp_insert_hide_default_widgets_enable_button" value="Click to Deactivate" class="button" style="font-weight:bold;color:red;" onclick="wpInsertToggleAdWidget('#wp_insert_hide_default_widgets_enable_button', '#wp_insert_hide_default_widgets_enable')"/>
90
- <?php } else { ?>
91
- <input type="button" id="wp_insert_hide_default_widgets_enable_button" value="Click to Activate" class="button" style="font-weight:bold;color:#2f9303;" onclick="wpInsertToggleAdWidget('#wp_insert_hide_default_widgets_enable_button', '#wp_insert_hide_default_widgets_enable')"/>
92
- <?php } ?>
93
- <input style="display:none;" id="wp_insert_hide_default_widgets_enable" name="wp_insert_hide_default_widgets_enable" type="checkbox" value="1"<?php if(get_option('wp_insert_hide_default_widgets_enable')) echo ' checked="checked"'; ?> />
94
- <p>
95
- <small>
96
- Disables all default widgets except the Text Widget
97
- </small>
98
- </p>
99
- </div>
100
- <?php }
101
-
102
- function wp_insert_show_id_HTML() { ?>
103
- <div>
104
- <?php if(get_option('wp_insert_show_id_enable')) { ?>
105
- <input type="button" id="wp_insert_show_id_enable_button" value="Click to Deactivate" class="button" style="font-weight:bold;color:red;" onclick="wpInsertToggleAdWidget('#wp_insert_show_id_enable_button', '#wp_insert_show_id_enable')"/>
106
- <?php } else { ?>
107
- <input type="button" id="wp_insert_show_id_enable_button" value="Click to Activate" class="button" style="font-weight:bold;color:#2f9303;" onclick="wpInsertToggleAdWidget('#wp_insert_show_id_enable_button', '#wp_insert_show_id_enable')"/>
108
- <?php } ?>
109
- <input style="display:none;" id="wp_insert_show_id_enable" name="wp_insert_show_id_enable" type="checkbox" value="1"<?php if(get_option('wp_insert_show_id_enable')) echo ' checked="checked"'; ?> />
110
- <p>
111
- <small>
112
- Disables all default widgets except the Text Widget
113
- </small>
114
- </p>
115
- </div>
116
- <?php }
117
-
118
- function wp_insert_load_theme_styles_HTML() { ?>
119
- <div>
120
- <?php if(get_option('wp_insert_load_theme_styles_enable')) { ?>
121
- <input type="button" id="wp_insert_load_theme_styles_enable_button" value="Click to Deactivate" class="button" style="font-weight:bold;color:red;" onclick="wpInsertToggleAdWidget('#wp_insert_load_theme_styles_enable_button', '#wp_insert_load_theme_styles_enable')"/>
122
- <?php } else { ?>
123
- <input type="button" id="wp_insert_load_theme_styles_enable_button" value="Click to Activate" class="button" style="font-weight:bold;color:#2f9303;" onclick="wpInsertToggleAdWidget('#wp_insert_load_theme_styles_enable_button', '#wp_insert_load_theme_styles_enable')"/>
124
- <?php } ?>
125
- <input style="display:none;" id="wp_insert_load_theme_styles_enable" name="wp_insert_load_theme_styles_enable" type="checkbox" value="1"<?php if(get_option('wp_insert_load_theme_styles_enable')) echo ' checked="checked"'; ?> />
126
- <p>
127
- <small>
128
- Disables all default widgets except the Text Widget
129
- </small>
130
- </p>
131
- </div>
132
- <?php }
133
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/multiple-adnetwork/activate-upgrade.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('wp_insert_activate_upgrade', 'wp_insert_multiple_network_activate_upgrade');
3
+ function wp_insert_multiple_network_activate_upgrade() {
4
+ if(!get_option('wp_insert_multiple_network_status')) {
5
+ $value = '1';
6
+ $value = wp_insert_multiple_network_upgrade_from_1x($value);
7
+ update_option('wp_insert_multiple_network_status', $values);
8
+ }
9
+ }
10
+
11
+ function wp_insert_multiple_network_upgrade_from_1x($value) {
12
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_multiple_ad_network_type');
13
+ if($val != null) {
14
+ switch($val) {
15
+ case 'Primary Ad Network Only':
16
+ $value = '1';
17
+ break;
18
+ case 'Primary and Alternate Ad Network 1':
19
+ $value = '2';
20
+ break;
21
+ case 'All Ad Networks':
22
+ $value = '3';
23
+ break;
24
+ }
25
+ }
26
+ return $value;
27
+ }
28
+ ?>
includes/multiple-adnetwork/meta-box.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_insert_multiple_network_status_content($post, $args) {
3
+ $location = $args['args']['location'];
4
+ $data = get_option('wp_insert_multiple_network_status');
5
+ $id = $args['id'];
6
+ $name = $args['args']['name'].'['.$location.']';
7
+ $networkOptions = array(
8
+ array('value' => '1', 'text' => 'Primary Ad Network'),
9
+ array('value' => '2', 'text' => 'Primary and Secondary Ad Networks'),
10
+ array('value' => '3', 'text' => 'All Ad Networks'),
11
+ );
12
+ $info = "Multiple Ad Networks can be setup to display ads from different networks without infringing the terms of any network. At a time only ads from one network (Randomly Choosen) will be shown. This feature can also be used to randomly display different sized Ads from the same network. Please note that this option is global and applied to Template Ads, In Post Ads as well as Ad Widgets.";
13
+ echo wp_insert_get_control('select', true, $name.'[status]', $id.'-status', $data, 'Select the Ad Network Setup that best suits you :', $info, $networkOptions);
14
+ }
15
+ ?>
includes/multiple-adnetwork/multiple-adnetwork.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ require_once(dirname(__FILE__).'/activate-upgrade.php');
3
+ require_once(dirname(__FILE__).'/meta-box.php');
4
+ ?>
includes/pages.php DELETED
@@ -1,67 +0,0 @@
1
- <?php
2
- function wp_insert_pages_page() {
3
- global $screen_layout_columns;
4
- wp_insert_update_page_order();
5
- add_meta_box('wp_insert_manage_page_order', 'Manage Page Order', 'wp_insert_manage_page_order_HTML', 'col_1');
6
-
7
- $parameters = 'wp_insert_updated_page_order';
8
- wp_insert_settings_page_layout($parameters, 'WP-INSERT : Manage Pages', 'pages');
9
- }
10
-
11
- function wp_insert_manage_page_order_HTML() { ?>
12
- <input id="wp_insert_updated_page_order" name="wp_insert_updated_page_order" type="hidden" value="" />
13
- <ul id="wp_insert_page_list">
14
- <?php
15
- $pages = get_pages('sort_column=menu_order');
16
- foreach($pages as $page) { ?>
17
- <li id="wp_insert_listItem_<?php echo $page->ID; ?>">
18
- <img src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/images/move-16x16.png" width="16px" height="16px" alt="move" class="handle" />
19
- <strong>
20
- <?php if($page->post_parent != 0) { echo get_the_title($page->post_parent)."&nbsp;&raquo;&nbsp;".$page->post_title; } else { echo $page->post_title; } ?>
21
- </strong>
22
- <?php
23
- /*$temp = '';
24
- foreach($pages as $subPage) {
25
- if($subPage->post_parent == $page->ID) {
26
- $temp .= '<li id="wp_insert_listItem_'.$subPage->ID.'">';
27
- $temp .= '<img src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/images/move-16x16.png" width="16px" height="16px" alt="move" class="handle" />';
28
- $temp .= '<strong>'.$subPage->post_title.'</strong></a>';
29
- $temp .= '</li>';
30
- }
31
- }
32
- if($temp != '') { echo '<ul style="margin-left: 25px;">'.$temp.'</ul>'; }*/
33
- ?>
34
- </li>
35
- <?php }
36
- ?>
37
- </ul>
38
- <script type="text/javascript">
39
- jQuery("#wp_insert_page_list").sortable({
40
- handle : '.handle',
41
- update : function () {
42
- wpInsertToggleNotSavedAlert();
43
- var items = jQuery('#wp_insert_page_list').sortable('toArray');
44
- for (i=0; i<items.length; i++) {
45
- items[i] = items[i].replace("wp_insert_listItem_", "");
46
- }
47
- document.getElementById('wp_insert_updated_page_order').value = items.join(",");
48
- }
49
- });
50
- </script>
51
- <?php }
52
-
53
- function wp_insert_update_page_order() {
54
- if(get_option(wp_insert_updated_page_order) != '') {
55
- global $wpdb;
56
- $pageOrder = explode(",", get_option(wp_insert_updated_page_order));
57
- $sql = "UPDATE $wpdb->posts SET menu_order = CASE id ";
58
- for($i = 0; $i < count($pageOrder); $i++) {
59
- global $wpdb;
60
- $sql .= "WHEN ".$pageOrder[$i]." THEN ".$i." ";
61
- }
62
- $sql .= "END WHERE id IN (".get_option(wp_insert_updated_page_order).")";
63
- $wpdb->query($sql);
64
- update_option(wp_insert_updated_page_order, '');
65
- }
66
- }
67
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/postpicker.php DELETED
@@ -1,271 +0,0 @@
1
- <style type="text/css">
2
- .multipleSelectBoxControl span{ /* Labels above select boxes*/
3
- font-family:arial;
4
- font-size:11px;
5
- font-weight:bold;
6
- }
7
- .multipleSelectBoxControl div select{ /* Select box layout */
8
- font-family:arial;
9
- height:100%;
10
- }
11
- .multipleSelectBoxControl input{ /* Small butons */
12
- width:25px;
13
- }
14
-
15
- .multipleSelectBoxControl div{
16
- float:left;
17
- }
18
- </style>
19
- <script type="text/javascript">
20
-
21
- var fromBoxArray = new Array();
22
- var toBoxArray = new Array();
23
- var selectBoxIndex = 0;
24
- var arrayOfItemsToSelect = new Array();
25
-
26
- function moveSingleElement()
27
- {
28
- var selectBoxIndex = this.parentNode.parentNode.id.replace(/[^\d]/g,'');
29
- var tmpFromBox;
30
- var tmpToBox;
31
- if(this.tagName.toLowerCase()=='select'){
32
- tmpFromBox = this;
33
- if(tmpFromBox==fromBoxArray[selectBoxIndex])tmpToBox = toBoxArray[selectBoxIndex]; else tmpToBox = fromBoxArray[selectBoxIndex];
34
- }else{
35
-
36
- if(this.value.indexOf('>')>=0){
37
- tmpFromBox = fromBoxArray[selectBoxIndex];
38
- tmpToBox = toBoxArray[selectBoxIndex];
39
- }else{
40
- tmpFromBox = toBoxArray[selectBoxIndex];
41
- tmpToBox = fromBoxArray[selectBoxIndex];
42
- }
43
- }
44
-
45
- for(var no=0;no<tmpFromBox.options.length;no++){
46
- if(tmpFromBox.options[no].selected){
47
- tmpFromBox.options[no].selected = false;
48
- tmpToBox.options[tmpToBox.options.length] = new Option(tmpFromBox.options[no].text,tmpFromBox.options[no].value);
49
-
50
- for(var no2=no;no2<(tmpFromBox.options.length-1);no2++){
51
- tmpFromBox.options[no2].value = tmpFromBox.options[no2+1].value;
52
- tmpFromBox.options[no2].text = tmpFromBox.options[no2+1].text;
53
- tmpFromBox.options[no2].selected = tmpFromBox.options[no2+1].selected;
54
- }
55
- no = no -1;
56
- tmpFromBox.options.length = tmpFromBox.options.length-1;
57
-
58
- }
59
- }
60
-
61
-
62
- var tmpTextArray = new Array();
63
- for(var no=0;no<tmpFromBox.options.length;no++){
64
- tmpTextArray.push(tmpFromBox.options[no].text + '___' + tmpFromBox.options[no].value);
65
- }
66
- tmpTextArray.sort();
67
- var tmpTextArray2 = new Array();
68
- for(var no=0;no<tmpToBox.options.length;no++){
69
- tmpTextArray2.push(tmpToBox.options[no].text + '___' + tmpToBox.options[no].value);
70
- }
71
- tmpTextArray2.sort();
72
-
73
- for(var no=0;no<tmpTextArray.length;no++){
74
- var items = tmpTextArray[no].split('___');
75
- tmpFromBox.options[no] = new Option(items[0],items[1]);
76
-
77
- }
78
-
79
- for(var no=0;no<tmpTextArray2.length;no++){
80
- var items = tmpTextArray2[no].split('___');
81
- tmpToBox.options[no] = new Option(items[0],items[1]);
82
- }
83
- }
84
-
85
- function sortAllElement(boxRef)
86
- {
87
- var tmpTextArray2 = new Array();
88
- for(var no=0;no<boxRef.options.length;no++){
89
- tmpTextArray2.push(boxRef.options[no].text + '___' + boxRef.options[no].value);
90
- }
91
- tmpTextArray2.sort();
92
- for(var no=0;no<tmpTextArray2.length;no++){
93
- var items = tmpTextArray2[no].split('___');
94
- boxRef.options[no] = new Option(items[0],items[1]);
95
- }
96
-
97
- }
98
- function moveAllElements()
99
- {
100
- var selectBoxIndex = this.parentNode.parentNode.id.replace(/[^\d]/g,'');
101
- var tmpFromBox;
102
- var tmpToBox;
103
- if(this.value.indexOf('>')>=0){
104
- tmpFromBox = fromBoxArray[selectBoxIndex];
105
- tmpToBox = toBoxArray[selectBoxIndex];
106
- }else{
107
- tmpFromBox = toBoxArray[selectBoxIndex];
108
- tmpToBox = fromBoxArray[selectBoxIndex];
109
- }
110
-
111
- for(var no=0;no<tmpFromBox.options.length;no++){
112
- tmpToBox.options[tmpToBox.options.length] = new Option(tmpFromBox.options[no].text,tmpFromBox.options[no].value);
113
- }
114
-
115
- tmpFromBox.options.length=0;
116
- sortAllElement(tmpToBox);
117
-
118
- }
119
-
120
-
121
- function createMovableOptions(fromBox,toBox,totalWidth,totalHeight,labelLeft,labelRight)
122
- {
123
- fromObj = document.getElementById(fromBox);
124
- toObj = document.getElementById(toBox);
125
-
126
- arrayOfItemsToSelect[arrayOfItemsToSelect.length] = toObj;
127
-
128
-
129
- fromObj.ondblclick = moveSingleElement;
130
- toObj.ondblclick = moveSingleElement;
131
-
132
-
133
- fromBoxArray.push(fromObj);
134
- toBoxArray.push(toObj);
135
-
136
- var parentEl = fromObj.parentNode;
137
-
138
- var parentDiv = document.createElement('DIV');
139
- parentDiv.className='multipleSelectBoxControl';
140
- parentDiv.id = 'selectBoxGroup' + selectBoxIndex;
141
- parentDiv.style.width = totalWidth + 'px';
142
- parentDiv.style.height = totalHeight + 'px';
143
- parentEl.insertBefore(parentDiv,fromObj);
144
-
145
-
146
- var subDiv = document.createElement('DIV');
147
- subDiv.style.width = (Math.floor(totalWidth/2) - 15) + 'px';
148
- fromObj.style.width = (Math.floor(totalWidth/2) - 15) + 'px';
149
-
150
- var label = document.createElement('SPAN');
151
- label.innerHTML = labelLeft;
152
- subDiv.appendChild(label);
153
-
154
- subDiv.appendChild(fromObj);
155
- subDiv.className = 'multipleSelectBoxDiv';
156
- parentDiv.appendChild(subDiv);
157
-
158
-
159
- var buttonDiv = document.createElement('DIV');
160
- buttonDiv.style.verticalAlign = 'middle';
161
- buttonDiv.style.paddingTop = (totalHeight/2) - 50 + 'px';
162
- buttonDiv.style.width = '30px';
163
- buttonDiv.style.textAlign = 'center';
164
- parentDiv.appendChild(buttonDiv);
165
-
166
- var buttonRight = document.createElement('INPUT');
167
- buttonRight.type='button';
168
- buttonRight.value = '>';
169
- buttonDiv.appendChild(buttonRight);
170
- buttonRight.onclick = moveSingleElement;
171
-
172
- var buttonAllRight = document.createElement('INPUT');
173
- buttonAllRight.type='button';
174
- buttonAllRight.value = '>>';
175
- buttonAllRight.onclick = moveAllElements;
176
- buttonDiv.appendChild(buttonAllRight);
177
-
178
- var buttonLeft = document.createElement('INPUT');
179
- buttonLeft.style.marginTop='10px';
180
- buttonLeft.type='button';
181
- buttonLeft.value = '<';
182
- buttonLeft.onclick = moveSingleElement;
183
- buttonDiv.appendChild(buttonLeft);
184
-
185
- var buttonAllLeft = document.createElement('INPUT');
186
- buttonAllLeft.type='button';
187
- buttonAllLeft.value = '<<';
188
- buttonAllLeft.onclick = moveAllElements;
189
- buttonDiv.appendChild(buttonAllLeft);
190
-
191
- var subDiv = document.createElement('DIV');
192
- subDiv.style.width = (Math.floor(totalWidth/2) - 15) + 'px';
193
- toObj.style.width = (Math.floor(totalWidth/2) - 15) + 'px';
194
-
195
- var label = document.createElement('SPAN');
196
- label.innerHTML = labelRight;
197
- subDiv.appendChild(label);
198
-
199
- subDiv.appendChild(toObj);
200
- parentDiv.appendChild(subDiv);
201
-
202
- toObj.style.height = (totalHeight - label.offsetHeight) + 'px';
203
- fromObj.style.height = (totalHeight - label.offsetHeight) + 'px';
204
-
205
-
206
- selectBoxIndex++;
207
-
208
- }
209
-
210
- function SavePostPicker(sender) {
211
- var count = 0;
212
- var value = '';
213
- var list = document.getElementById('toBox');
214
- for(var i = 0; i < list.options.length; ++i) {
215
- if(count > 0) { value += ',' + list.options[i].value; }
216
- else { value += list.options[i].value; }
217
- count++;
218
- }
219
- document.getElementById(sender).value = value;
220
-
221
- ClosePopup();
222
- }
223
-
224
- function ShowPostPicker(sender) {
225
- sender = document.getElementById(sender);
226
- GreyOutScreen();
227
- divPopup = CreatePopUp("Select Posts/Pages", 525, 390, YPos(sender) - 375, XPos(sender) + 150);
228
-
229
- <?php
230
- $count = 0;
231
- //Change 100 below to a bigger number if you want to show more posts/pages in the post picker. May cause the server to run out of memory if number of posts/pages is to high.
232
- $pages = get_pages('numberposts=100&sort_column=menu_order');
233
- $posts = get_posts('numberposts=100&sort_column=desc');
234
- $allposts = "<select multiple name='fromBox' id='fromBox'>";
235
- $selectedposts = "<select multiple name='toBox' id='toBox'></select>";
236
- foreach($pages as $page) {
237
- if($count < 100) {
238
- $allposts .= "<option value='".$page->ID."'>".htmlspecialchars($page->post_title)."</option>";
239
- }
240
- $count++;
241
- }
242
- foreach($posts as $post) {
243
- if($count < 100) {
244
- $allposts .= "<option value='".$post->ID."'>".htmlspecialchars($post->post_title)."</option>";
245
- }
246
- $count++;
247
- }
248
- $allposts .= "</select>";
249
- echo 'divPopup.innerHTML = "'.$allposts.$selectedposts.'";';
250
- ?>
251
- divPopup.innerHTML += "<p class='submit'><input class='button-primary' type='button' value='OK' style='float:right;' onclick='SavePostPicker(\"" + sender.id + "\")' /></p>";
252
- createMovableOptions('fromBox','toBox',500,300,'All Posts/Pages','Selected Posts/Pages');
253
- for(var counter = 0; counter < 1000; counter++) { void(0); }
254
- SelectedPosts = sender.value.split(",");
255
- for (var counter = 0; counter < SelectedPosts.length; counter++) {
256
- var list = document.getElementById('fromBox');
257
- for(var i = 0; i < list.options.length; ++i) {
258
- if(list.options[i].value == SelectedPosts[counter]) {
259
- var toBox = document.createElement('option');
260
- toBox.value = SelectedPosts[counter];
261
- toBox.innerHTML = moveAllElements;
262
- toBox.innerHTML = list.options[i].innerHTML;
263
- document.getElementById("toBox").appendChild(toBox);
264
- break;
265
- }
266
- }
267
- }
268
- document.getElementById('fromBox').focus();
269
- return false;
270
- }
271
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/privacypolicy.php DELETED
@@ -1,103 +0,0 @@
1
- <?php
2
- $Domain = str_replace('', "www.", $_SERVER['HTTP_HOST']);
3
- $PrivacyPolicyText = '<p>At <a href="'.get_bloginfo('url').'">'.$Domain.'</a>, the privacy of our visitors is of extreme importance to us (See <a target="_blank" href="http://www.wp-insert.smartlogix.co.in/what-is-a-privacy-policy/">this article</a> to learn more about Privacy Policies.). This privacy policy document outlines the types of personal information is received and collected by <a href="'.get_bloginfo('url').'">'.$Domain.'</a> and how it is used.</p>
4
- <p><b>Log Files</b><br/>Like many other Web sites, <a href="'.get_bloginfo('url').'">'.$Domain.'</a> makes use of log files. The information inside the log files includes internet protocol ( IP ) addresses, type of browser, Internet Service Provider ( ISP ), date/time stamp, referring/exit pages, and number of clicks to analyze trends, administer the site, track user’s movement around the site, and gather demographic information. IP addresses, and other such information are not linked to any information that is personally identifiable.</p>
5
- <p><b>Cookies and Web Beacons</b><br/><a href="'.get_bloginfo('url').'">'.$Domain.'</a> does use cookies to store information about visitors preferences, record user-specific information on which pages the user access or visit, customize Web page content based on visitors browser type or other information that the visitor sends via their browser.</p>
6
- <p><b>DoubleClick DART Cookie</b></p><ul><li>Google, as a third party vendor, uses cookies to serve ads on <a href="'.get_bloginfo('url').'">'.$Domain.'</a>.</li><li>Google\'s use of the DART cookie enables it to serve ads to users based on their visit to <a href="'.get_bloginfo('url').'">'.$Domain.'</a> and other sites on the Internet.</li><li>Users may opt out of the use of the DART cookie by visiting the Google ad and content network privacy policy at the following URL - <a href="http://www.google.com/privacy_ads.html">http://www.google.com/privacy_ads.html</a>.</li></ul>
7
- <p>These third-party ad servers or ad networks use technology to the advertisements and links that appear on <a href="'.get_bloginfo('url').'">'.$Domain.'</a> send directly to your browsers. They automatically receive your IP address when this occurs. Other technologies ( such as cookies, JavaScript, or Web Beacons ) may also be used by the third-party ad networks to measure the effectiveness of their advertisements and / or to personalize the advertising content that you see.</p>
8
- <p><a href="'.get_bloginfo('url').'">'.$Domain.'</a> has no access to or control over these cookies that are used by third-party advertisers.</p>
9
- <p>You should consult the respective privacy policies of these third-party ad servers for more detailed information on their practices as well as for instructions about how to opt-out of certain practices. <a href="'.get_bloginfo('url').'">'.$Domain.'\'s</a> privacy policy does not apply to, and we cannot control the activities of, such other advertisers or web sites.</p>
10
- <p>If you wish to disable cookies, you may do so through your individual browser options. More detailed information about cookie management with specific web browsers can be found at the browsers\' respective websites.</p>';
11
- if(get_option('wp_insert_privacy_policy_content') == "") { add_option("wp_insert_privacy_policy_content", $PrivacyPolicyText, '', 'yes'); }
12
-
13
- add_shortcode('Privacy', 'wp_insert_privacy_policy_shortcode');
14
-
15
- function wp_insert_privacy_policy_shortcode() {
16
- return get_option('wp_insert_privacy_policy_content');
17
- }
18
-
19
- function wp_insert_privacy_policy_page() {
20
- if(isset($_GET["assign"])) {
21
- $my_post = array();
22
- $my_post['ID'] = $_GET["assign"];
23
- $my_post['post_content'] = '[Privacy]';
24
- wp_update_post($my_post);
25
- header("Location: ".get_bloginfo('url')."/wp-admin/admin.php?page=manage-privacy-policy");
26
- }
27
- else if(isset($_GET["create"])) {
28
- $my_post = array();
29
- $my_post['post_title'] = 'Privacy Policy';
30
- $my_post['post_content'] = '[Privacy]';
31
- $my_post['post_status'] = 'publish';
32
- $my_post['post_author'] = 1;
33
- $my_post['post_type'] = 'page';
34
- wp_insert_post($my_post);
35
- header("Location: ".get_bloginfo('url')."/wp-admin/admin.php?page=manage-privacy-policy");
36
- }
37
- else if(isset($_GET["reset"])) {
38
- $Domain = str_replace('', "www.", $_SERVER['HTTP_HOST']);
39
- $PrivacyPolicyText = '<p>At <a href="'.get_bloginfo('url').'">'.$Domain.'</a>, the privacy of our visitors is of extreme importance to us (See <a target="_blank" href="http://www.wp-insert.smartlogix.co.in/what-is-a-privacy-policy/">this article</a> to learn more about Privacy Policies.). This privacy policy document outlines the types of personal information is received and collected by <a href="'.get_bloginfo('url').'">'.$Domain.'</a> and how it is used.</p>
40
- <p><b>Log Files</b><br/>Like many other Web sites, <a href="'.get_bloginfo('url').'">'.$Domain.'</a> makes use of log files. The information inside the log files includes internet protocol ( IP ) addresses, type of browser, Internet Service Provider ( ISP ), date/time stamp, referring/exit pages, and number of clicks to analyze trends, administer the site, track user’s movement around the site, and gather demographic information. IP addresses, and other such information are not linked to any information that is personally identifiable.</p>
41
- <p><b>Cookies and Web Beacons</b><br/><a href="'.get_bloginfo('url').'">'.$Domain.'</a> does use cookies to store information about visitors preferences, record user-specific information on which pages the user access or visit, customize Web page content based on visitors browser type or other information that the visitor sends via their browser.</p>
42
- <p><b>DoubleClick DART Cookie</b></p><ul><li>Google, as a third party vendor, uses cookies to serve ads on <a href="'.get_bloginfo('url').'">'.$Domain.'</a>.</li><li>Google\'s use of the DART cookie enables it to serve ads to users based on their visit to <a href="'.get_bloginfo('url').'">'.$Domain.'</a> and other sites on the Internet.</li><li>Users may opt out of the use of the DART cookie by visiting the Google ad and content network privacy policy at the following URL - <a href="http://www.google.com/privacy_ads.html">http://www.google.com/privacy_ads.html</a>.</li></ul>
43
- <p>These third-party ad servers or ad networks use technology to the advertisements and links that appear on <a href="'.get_bloginfo('url').'">'.$Domain.'</a> send directly to your browsers. They automatically receive your IP address when this occurs. Other technologies ( such as cookies, JavaScript, or Web Beacons ) may also be used by the third-party ad networks to measure the effectiveness of their advertisements and / or to personalize the advertising content that you see.</p>
44
- <p><a href="'.get_bloginfo('url').'">'.$Domain.'</a> has no access to or control over these cookies that are used by third-party advertisers.</p>
45
- <p>You should consult the respective privacy policies of these third-party ad servers for more detailed information on their practices as well as for instructions about how to opt-out of certain practices. <a href="'.get_bloginfo('url').'">'.$Domain.'\'s</a> privacy policy does not apply to, and we cannot control the activities of, such other advertisers or web sites.</p>
46
- <p>If you wish to disable cookies, you may do so through your individual browser options. More detailed information about cookie management with specific web browsers can be found at the browsers\' respective websites.</p>';
47
-
48
- update_option("wp_insert_privacy_policy_content", $PrivacyPolicyText);
49
- header("Location: ".get_bloginfo('url')."/wp-admin/admin.php?page=manage-privacy-policy");
50
- }
51
- global $screen_layout_columns;
52
-
53
- add_meta_box('wp_insert_edit_privacy_policy', 'Finetune your Privacy Policy', 'wp_insert_edit_privacy_policy_HTML', 'col_1');
54
- add_meta_box('wp_insert_edit_assign_privacy_policy_page', 'Assign Page for Privacy Policy', 'wp_insert_edit_assign_privacy_policy_page_HTML', 'col_1');
55
-
56
- $parameters = 'wp_insert_privacy_policy_content';
57
- wp_insert_settings_page_layout($parameters, 'WP-INSERT : manage-privacy-policy', 'privacy');
58
- }
59
-
60
- function wp_insert_edit_assign_privacy_policy_page_HTML() { ?>
61
- <div>
62
- <p>Assign
63
- <select id="wp_insert_select_assign_pages" onchange="UpdateAssignlink()">
64
- <option value="#" selected="selected">-- Select a Page --</option>
65
- <?php
66
- $count = 0;
67
- $pages = get_pages('sort_column=menu_order');
68
- foreach($pages as $page) {
69
- if($count < 100) {
70
- echo "<option value='".get_bloginfo('url')."/wp-admin/admin.php?page=manage-privacy-policy&assign=".$page->ID."'>".$page->post_title."</option>";
71
- }
72
- $count++;
73
- }
74
- ?>
75
- </select>
76
- <script type="text/javascript">
77
- document.getElementById('wp_insert_select_assign_pages').selectedIndex = 0;
78
- function UpdateAssignlink() {
79
- document.getElementById('wp_insert_assign_now_link').href = document.getElementById('wp_insert_select_assign_pages')[document.getElementById('wp_insert_select_assign_pages').selectedIndex].value;
80
- }
81
- </script>
82
- as Privacy Policy page : <a id="wp_insert_assign_now_link" href="#" class="button-secondary">Assign Now</a></p>
83
- <p><b>OR</b></p>
84
- <p>Create Privacy Policy Page Automatically : <a href="<?php echo get_bloginfo('url')."/wp-admin/admin.php?page=manage-privacy-policy&create=1"; ?>" class="button-secondary">Create Now</a></p>
85
- </div>
86
- <?php }
87
-
88
- function wp_insert_edit_privacy_policy_HTML() { ?>
89
- <script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/fckeditor/fckeditor.js"></script>
90
- <textarea id="wp_insert_privacy_policy_content" name="wp_insert_privacy_policy_content" style="width:100%; height: 400px;">
91
- <?php echo get_option('wp_insert_privacy_policy_content'); ?>
92
- </textarea>
93
- <p><a href="<?php echo get_bloginfo('url')."/wp-admin/admin.php?page=manage-privacy-policy&reset=1"; ?>" class="button-secondary alignright">Reset</a></p><p><small>This is an automatically generated "Privacy Policy".</small></p>
94
- <script type="text/javascript">
95
- if(document.getElementById('wp_insert_privacy_policy_content')) {
96
- var wp_insert_fckeditor = new FCKeditor('wp_insert_privacy_policy_content') ;
97
- wp_insert_fckeditor.Height = "400"
98
- wp_insert_fckeditor.BasePath = '<?php echo WP_PLUGIN_URL; ?>/wp-insert/fckeditor/';
99
- wp_insert_fckeditor.ReplaceTextarea() ;
100
- }
101
- </script>
102
- <?php }
103
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighter.php DELETED
@@ -1,105 +0,0 @@
1
- <?php
2
- function wp_insert_syntax_highlighter_page() {
3
- global $screen_layout_columns;
4
- wp_insert_update_page_order();
5
- add_meta_box('wp_insert_syntax_highlighter_editor', 'Theme & Plugin Editor Syntax Highlighting', 'wp_insert_syntax_highlighter_editor_HTML', 'col_1');
6
- add_meta_box('wp_insert_syntax_highlighter_posts', 'Syntax Highlighting for Code in Posts & Pages', 'wp_insert_syntax_highlighter_posts_HTML', 'col_1');
7
-
8
- $parameters = 'wp_insert_sh_editor_enable, wp_insert_sh_posts_enable';
9
- wp_insert_settings_page_layout($parameters, 'WP-INSERT : Syntax Highlighting', 'syntax');
10
- }
11
-
12
- function wp_insert_syntax_highlighter_editor_HTML() { ?>
13
- <div>
14
- <?php if(get_option('wp_insert_sh_editor_enable')) { ?><input type="button" id="wp_insert_sh_editor_enable_button" value="Click to Deactivate" class="button" style="font-weight:bold;color:red;" onclick="wpInsertToggleAdWidget('#wp_insert_sh_editor_enable_button', '#wp_insert_sh_enable')"/>
15
- <?php } else { ?><input type="button" id="wp_insert_sh_editor_enable_button" value="Click to Activate" class="button" style="font-weight:bold;color:#2f9303;" onclick="wpInsertToggleAdWidget('#wp_insert_sh_editor_enable_button', '#wp_insert_sh_editor_enable')"/><?php } ?>
16
- <input style="display:none;" id="wp_insert_sh_editor_enable" name="wp_insert_sh_editor_enable" type="checkbox" value="1"<?php if(get_option('wp_insert_sh_editor_enable')) echo ' checked="checked"'; ?> />
17
- <p><small>Syntax Highlighting support using Editarea 0.8.2 by <a target="_blank" href="http://www.cdolivet.com/index.php?page=editArea">Christophe Dolivet</a></small></p>
18
- </div>
19
- <?php }
20
-
21
- function wp_insert_syntax_highlighter_posts_HTML() { ?>
22
- <div>
23
- <?php if(get_option('wp_insert_sh_posts_enable')) { ?><input type="button" id="wp_insert_sh_posts_enable_button" value="Click to Deactivate" class="button" style="font-weight:bold;color:red;" onclick="wpInsertToggleAdWidget('#wp_insert_sh_posts_enable_button', '#wp_insert_sh_posts_enable')"/>
24
- <?php } else { ?><input type="button" id="wp_insert_sh_posts_enable_button" value="Click to Activate" class="button" style="font-weight:bold;color:#2f9303;" onclick="wpInsertToggleAdWidget('#wp_insert_sh_posts_enable_button', '#wp_insert_sh_posts_enable')"/><?php } ?>
25
- <input style="display:none;" id="wp_insert_sh_posts_enable" name="wp_insert_sh_posts_enable" type="checkbox" value="1"<?php if(get_option('wp_insert_sh_posts_enable')) echo ' checked="checked"'; ?> />
26
- <p><small>Enclose CODE snippets between [code] and [/code].<br/>Visit <a href="http://wp-insert.smartlogix.co.in/">Wp-Insert Tutorial Site</a> for advanced options.</a></small></p>
27
- </div>
28
- <?php }
29
-
30
- add_action("plugins_loaded", "wp_insert_syntaxhighlighting_init");
31
- function wp_insert_syntaxhighlighting_init() {
32
- if(get_option('wp_insert_sh_editor_enable')) {
33
- add_action('admin_footer', 'wp_insert_editor_syntaxhighlighting');
34
- }
35
- if(get_option('wp_insert_sh_posts_enable')) {
36
- add_action('wp_footer', 'wp_insert_posts_syntaxhighlighting');
37
- add_shortcode('code', 'wp_insert_posts_shortcode');
38
- }
39
- }
40
- function wp_insert_editor_syntaxhighlighting() {
41
- if(basename($_SERVER['SCRIPT_NAME']) == 'plugin-editor.php' || basename($_SERVER['SCRIPT_NAME']) == 'theme-editor.php') {
42
- global $file;
43
- $ext=strstr(basename($file),'.');
44
- if($ext == '.php') {
45
- $ext = 'php';
46
- } else if($ext == '.css') {
47
- $ext = 'css';
48
- } else if($ext == '.js') {
49
- $ext = 'javascript';
50
- } else if($ext == '.html' ||$ext == '.htm') {
51
- $ext = 'html';
52
- } else {
53
- $ext = '';
54
- } ?>
55
- <script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/editarea/edit_area_full.js"></script>
56
- <script type="text/javascript">
57
- try {
58
- editAreaLoader.init({
59
- id: "newcontent"
60
- ,start_highlight: true
61
- ,allow_resize: "y"
62
- ,allow_toggle: true
63
- ,toolbar: "search, go_to_line, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, word_wrap, help"
64
- ,syntax_selection_allow: "css,html,js,php,xml"
65
- ,word_wrap: true
66
- ,syntax: "<?php echo $ext; ?>"
67
- });
68
- }
69
- catch (e) { void(0); }
70
- </script>
71
- <?php
72
- }
73
- }
74
-
75
- function wp_insert_posts_syntaxhighlighting() { ?>
76
- <script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/editarea/edit_area_full.js"></script>
77
- <script type="text/javascript">
78
- try {
79
- var codeBlocks = document.getElementsByName("codeSnippet");
80
- for(var i = 0; i < codeBlocks.length; i++) {
81
- editAreaLoader.init({
82
- id: codeBlocks[i].id
83
- ,start_highlight: true
84
- ,allow_resize: "y"
85
- ,allow_toggle: false
86
- ,toolbar: "go_to_line, |, select_font, |, syntax_selection, |, highlight, reset_highlight, |, word_wrap"
87
- ,is_editable: true
88
- ,word_wrap: true
89
- ,syntax: codeBlocks[i].title
90
- });
91
- }
92
- }
93
- catch (e) { void(0); }
94
- </script>
95
- <?php }
96
- function wp_insert_posts_shortcode($atts, $content = null, $code = "" ) {
97
- $attributes = shortcode_atts(array('language' => 'php', 'custom' => ''), $atts);
98
- if($attributes['custom'] != '') {
99
- global $post;
100
- return '<textarea title="'.$attributes['language'].'" class="codeSnippet" name="codeSnippet" id="codeSnippet_'.rand(0,999999).'_'.rand(0,999999).'">'.get_post_meta($post->ID, $attributes['custom'], true).'</textarea>';
101
- } else {
102
- return '<textarea title="'.$attributes['language'].'" class="codeSnippet" name="codeSnippet" id="codeSnippet_'.rand(0,999999).'_'.rand(0,999999).'">'.$content.'</textarea>';
103
- }
104
- }
105
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/activate-upgrade.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('wp_insert_activate_upgrade', 'wp_insert_syntax_highlighting_activate_upgrade');
3
+ function wp_insert_syntax_highlighting_activate_upgrade() {
4
+ if(!get_option('wp_insert_syntax_highlighting_options')) {
5
+ $values = array(
6
+ 'editor' => array(
7
+ 'status' => '',
8
+ ),
9
+ 'content' => array(
10
+ 'status' => '',
11
+ )
12
+ );
13
+ $values = wp_insert_syntax_highlighting_upgrade_from_1x($values);
14
+ update_option('wp_insert_syntax_highlighting_options', $values);
15
+ }
16
+ }
17
+
18
+ function wp_insert_syntax_highlighting_upgrade_from_1x($values) {
19
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_sh_editor_enable_button');
20
+ $values['editor']['status'] = ($val == null)?$values['editor']['status']:$val;
21
+
22
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_sh_posts_enable_button');
23
+ $values['content']['status'] = ($val == null)?$values['content']['status']:$val;
24
+ return $values;
25
+ }
26
+ ?>
includes/syntax-highlighting/admin-page.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_insert_syntax_highlighting_admin_page() {
3
+ wp_insert_admin_page('Tracking Codes', 'wp-insert-syntax-highlighting', 'wp_insert_syntax_highlighting_options');
4
+ }
5
+
6
+ add_action('admin_init', 'wp_insert_syntax_highlighting_admin_init');
7
+ function wp_insert_syntax_highlighting_admin_init() {
8
+ register_setting('wp_insert_syntax_highlighting_options', 'wp_insert_syntax_highlighting_options', 'wp_insert_syntax_highlighting_validate');
9
+ add_settings_section('wp-insert-syntax-highlighting', '', 'wp_insert_syntax_highlighting_section', 'wp-insert-syntax-highlighting');
10
+
11
+ $options = get_option('wp_insert_syntax_highlighting_options');
12
+ add_meta_box('wp-insert-syntax-highlighting-editor', 'Theme & Plugin Editor Syntax Highlighting', 'wp_insert_syntax_highlighting_content', 'wp-insert-syntax-highlighting', 'advanced', 'low', array('location' => 'editor', 'name' => 'wp_insert_syntax_highlighting_options', 'data' => $options));
13
+ add_meta_box('wp-insert-syntax-highlighting-content', 'Syntax Highlighting for Code in Posts & Pages', 'wp_insert_syntax_highlighting_content', 'wp-insert-syntax-highlighting', 'advanced', 'low', array('location' => 'content', 'name' => 'wp_insert_syntax_highlighting_options', 'data' => $options));
14
+ }
15
+
16
+ function wp_insert_syntax_highlighting_section() {
17
+ do_meta_boxes('wp-insert-syntax-highlighting', 'advanced', null);
18
+ }
19
+
20
+ function wp_insert_syntax_highlighting_content($post, $args) {
21
+ $location = $args['args']['location'];
22
+ $data = $args['args']['data'];
23
+ $id = $args['id'];
24
+ $name = $args['args']['name'].'['.$location.']';
25
+
26
+ if(!$data) {
27
+ $data = array();
28
+ }
29
+
30
+ $controls = array();
31
+ $controls['status'] = wp_insert_get_control('tz-checkbox', false, $name.'[status]', $id.'-status', $data[$location]['status'], '', 'Syntax Highlighting support using Editarea 0.8.2 by <a target="_blank" href="http://www.cdolivet.com/index.php?page=editArea">Christophe Dolivet</a>');
32
+
33
+ echo $controls['status']['html'];
34
+ echo wp_insert_get_script_tag($controls);
35
+ }
36
+
37
+ function wp_insert_syntax_highlighting_validate($input) {
38
+ return $input;
39
+ }
40
+ ?>
includes/syntax-highlighting/codes.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('init', 'wp_insert_syntax_highlighting_admin_scripts');
3
+ function wp_insert_syntax_highlighting_admin_scripts() {
4
+ $options = get_option('wp_insert_syntax_highlighting_options');
5
+ if($options) {
6
+ if($options['editor']['status']) {
7
+ wp_enqueue_script('editarea', WP_INSERT_URL.'/includes/syntax-highlighting/editarea/edit_area_full.js');
8
+ add_action('admin_footer', 'wp_insert_syntax_highlighting_admin_footer');
9
+ }
10
+
11
+ if($options['content']['status']) {
12
+ wp_enqueue_script('editarea', WP_INSERT_URL.'/includes/syntax-highlighting/editarea/edit_area_full.js');
13
+ add_action('wp_footer', 'wp_insert_syntax_highlighting_wp_footer');
14
+ add_shortcode('code', 'wp_insert_syntax_highlighting_shortcode_code');
15
+ }
16
+ }
17
+ }
18
+
19
+ function wp_insert_syntax_highlighting_shortcode_code($atts, $content = null) {
20
+ extract(shortcode_atts(array('language' => 'php', 'custom' => ''), $atts));
21
+ $random = rand(0,999999);
22
+ if($custom != '') {
23
+ global $post;
24
+ return '<textarea title="'.$language.'" class="codeSnippet" name="codeSnippet" id="codeSnippet_'.$random.'">'.get_post_meta($post->ID, $custom, true).'</textarea>';
25
+ } else {
26
+ return '<textarea title="'.$language.'" class="codeSnippet" name="codeSnippet" id="codeSnippet_'.$random.'">'.$content.'</textarea>';
27
+ }
28
+ }
29
+
30
+ function wp_insert_syntax_highlighting_wp_footer() {
31
+ echo '<script type="text/javascript">';
32
+ echo 'try {';
33
+ echo 'var codeBlocks = document.getElementsByName("codeSnippet");';
34
+ echo 'for(var i = 0; i < codeBlocks.length; i++) {';
35
+ echo 'editAreaLoader.init({';
36
+ echo 'id: codeBlocks[i].id, start_highlight: true, allow_resize: "y", allow_toggle: false, toolbar: "go_to_line, |, select_font, |, syntax_selection, |, highlight, reset_highlight, |, word_wrap", is_editable: true, word_wrap: true, syntax: codeBlocks[i].title';
37
+ echo '});';
38
+ echo '}';
39
+ echo '} catch (e) { void(0); }';
40
+ echo '</script>';
41
+ }
42
+
43
+ function wp_insert_syntax_highlighting_admin_footer() {
44
+ if(basename($_SERVER['SCRIPT_NAME']) == 'plugin-editor.php' || basename($_SERVER['SCRIPT_NAME']) == 'theme-editor.php') {
45
+ global $file;
46
+ $ext = strstr(basename($file),'.');
47
+ switch($ext) {
48
+ case '.php':
49
+ $ext = 'php';
50
+ break;
51
+ case '.css':
52
+ $ext = 'css';
53
+ break;
54
+ case '.js':
55
+ $ext = 'js';
56
+ break;
57
+ case '.html':
58
+ case '.htm':
59
+ $ext = 'html';
60
+ break;
61
+ default:
62
+ $ext = '';
63
+ break;
64
+ }
65
+ echo '<script type="text/javascript">';
66
+ echo 'try {';
67
+ echo 'editAreaLoader.init({';
68
+ echo 'id: "newcontent", start_highlight: true ,allow_resize: "y", allow_toggle: true, toolbar: "search, go_to_line, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, word_wrap, help", syntax_selection_allow: "css,html,js,php,xml", word_wrap: true, syntax: "'.$ext.'"';
69
+ echo '});';
70
+ echo '} catch (e) { void(0); }';
71
+ echo '</script>';
72
+ }
73
+ }
74
+ ?>
{editarea → includes/syntax-highlighting/editarea}/change_log.txt RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/edit_area.css RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/edit_area_full.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/autocompletion.gif RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/close.gif RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/fullscreen.gif RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/go_to_line.gif RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/help.gif RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/highlight.gif RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/load.gif RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/move.gif RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/newdocument.gif RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/opacity.png RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/processing.gif RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/redo.gif RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/reset_highlight.gif RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/save.gif RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/search.gif RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/smooth_selection.gif RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/spacer.gif RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/statusbar_resize.gif RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/undo.gif RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/images/word_wrap.gif RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/bg.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/cs.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/de.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/dk.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/en.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/eo.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/es.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/fi.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/fr.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/hr.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/id.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/it.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/ja.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/mk.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/nl.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/pl.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/pt.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/ru.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/sk.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/langs/zh.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/license_apache.txt RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/license_bsd.txt RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/license_lgpl.txt RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/reg_syntax/basic.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/reg_syntax/brainfuck.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/reg_syntax/c.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/reg_syntax/coldfusion.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/reg_syntax/cpp.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/reg_syntax/css.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/reg_syntax/html.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/reg_syntax/java.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/reg_syntax/js.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/reg_syntax/pas.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/reg_syntax/perl.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/reg_syntax/php.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/reg_syntax/python.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/reg_syntax/robotstxt.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/reg_syntax/ruby.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/reg_syntax/sql.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/reg_syntax/tsql.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/reg_syntax/vb.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/reg_syntax/xml.js RENAMED
File without changes
{editarea → includes/syntax-highlighting/editarea}/todo.txt RENAMED
File without changes
includes/syntax-highlighting/menu.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_insert_syntax_highlighting_menu() {
3
+ $subPageHandle = add_submenu_page('wp-insert', 'Syntax Highlighting', 'Syntax Highlighting', 'manage_options', 'wp-insert-syntax-highlighting', 'wp_insert_syntax_highlighting_admin_page');
4
+ add_action('admin_print_styles-'.$subPageHandle, 'wp_insert_admin_styles');
5
+ }
6
+ add_action('admin_menu', 'wp_insert_syntax_highlighting_menu');
7
+ ?>
includes/syntax-highlighting/syntax-highlighting.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ require_once(dirname(__FILE__).'/activate-upgrade.php');
3
+ require_once(dirname(__FILE__).'/menu.php');
4
+ require_once(dirname(__FILE__).'/admin-page.php');
5
+ require_once(dirname(__FILE__).'/codes.php');
6
+ ?>
includes/tandc.php DELETED
@@ -1,111 +0,0 @@
1
- <?php
2
- $Domain = str_replace('', "www.", $_SERVER['HTTP_HOST']);
3
- $TermsandConditionsText = '<p>Welcome to '.$Domain.'. If you continue to browse and use this website you are agreeing to comply with and be bound by the following terms and conditions of use, which together with our privacy policy govern '.$Domain.'\'s relationship with you in relation to this website.</p>
4
- <p>The term '.$Domain.' or \'us\' or \'we\' refers to the owner of the website. The term \'you\' refers to the user or viewer of our website.
5
- The use of this website is subject to the following terms of use:
6
- <ul>
7
- <li>The content of the pages of this website is for your general information and use only. It is subject to change without notice.</li>
8
- <li>Neither we nor any third parties provide any warranty or guarantee as to the accuracy, timeliness, performance, completeness or suitability of the information and materials found or offered on this website for any particular purpose. You acknowledge that such information and materials may contain inaccuracies or errors and we expressly exclude liability for any such inaccuracies or errors to the fullest extent permitted by law.</li>
9
- <li>Your use of any information or materials on this website is entirely at your own risk, for which we shall not be liable. It shall be your own responsibility to ensure that any products, services or information available through this website meet your specific requirements.</li>
10
- <li>This website contains material which is owned by or licensed to us. This material includes, but is not limited to, the design, layout, look, appearance and graphics. Reproduction is prohibited other than in accordance with the copyright notice, which forms part of these terms and conditions.</li>
11
- <li>All trademarks reproduced in this website, which are not the property of, or licensed to the operator, are acknowledged on the website.</li>
12
- <li>Unauthorised use of this website may give rise to a claim for damages and/or be a criminal offence.</li>
13
- <li>From time to time this website may also include links to other websites. These links are provided for your convenience to provide further information. They do not signify that we endorse the website(s). We have no responsibility for the content of the linked website(s).</li>
14
- <li>You may not create a link to this website from another website or document without '.$Domain.'\'s prior written consent.</li></ul></p>';
15
- if(get_option('wp_insert_terms_conditions_content') == "") { add_option("wp_insert_terms_conditions_content", $TermsandConditionsText, '', 'yes'); }
16
-
17
- add_shortcode('Terms', 'wp_insert_terms_conditions_shortcode');
18
-
19
- function wp_insert_terms_conditions_shortcode() {
20
- return get_option('wp_insert_terms_conditions_content');
21
- }
22
-
23
- function wp_insert_terms_conditions_page() {
24
- if(isset($_GET["assign"])) {
25
- $my_post = array();
26
- $my_post['ID'] = $_GET["assign"];
27
- $my_post['post_content'] = '[Terms]';
28
- wp_update_post($my_post);
29
- header("Location: ".get_bloginfo('url')."/wp-admin/admin.php?page=manage-terms-and-conditions");
30
- }
31
- else if(isset($_GET["create"])) {
32
- $my_post = array();
33
- $my_post['post_title'] = 'Terms and Conditions';
34
- $my_post['post_content'] = '[Terms]';
35
- $my_post['post_status'] = 'publish';
36
- $my_post['post_author'] = 1;
37
- $my_post['post_type'] = 'page';
38
- wp_insert_post($my_post);
39
- header("Location: ".get_bloginfo('url')."/wp-admin/admin.php?page=manage-terms-and-conditions");
40
- }
41
- else if(isset($_GET["reset"])) {
42
- $Domain = str_replace('', "www.", $_SERVER['HTTP_HOST']);
43
- $TermsandConditionsText = '<p>Welcome to '.$Domain.'. If you continue to browse and use this website you are agreeing to comply with and be bound by the following terms and conditions of use, which together with our privacy policy govern '.$Domain.'\'s relationship with you in relation to this website.</p>
44
- <p>The term '.$Domain.' or \'us\' or \'we\' refers to the owner of the website. The term \'you\' refers to the user or viewer of our website.
45
- The use of this website is subject to the following terms of use:
46
- <ul>
47
- <li>The content of the pages of this website is for your general information and use only. It is subject to change without notice.</li>
48
- <li>Neither we nor any third parties provide any warranty or guarantee as to the accuracy, timeliness, performance, completeness or suitability of the information and materials found or offered on this website for any particular purpose. You acknowledge that such information and materials may contain inaccuracies or errors and we expressly exclude liability for any such inaccuracies or errors to the fullest extent permitted by law.</li>
49
- <li>Your use of any information or materials on this website is entirely at your own risk, for which we shall not be liable. It shall be your own responsibility to ensure that any products, services or information available through this website meet your specific requirements.</li>
50
- <li>This website contains material which is owned by or licensed to us. This material includes, but is not limited to, the design, layout, look, appearance and graphics. Reproduction is prohibited other than in accordance with the copyright notice, which forms part of these terms and conditions.</li>
51
- <li>All trademarks reproduced in this website, which are not the property of, or licensed to the operator, are acknowledged on the website.</li>
52
- <li>Unauthorised use of this website may give rise to a claim for damages and/or be a criminal offence.</li>
53
- <li>From time to time this website may also include links to other websites. These links are provided for your convenience to provide further information. They do not signify that we endorse the website(s). We have no responsibility for the content of the linked website(s).</li>
54
- <li>You may not create a link to this website from another website or document without '.$Domain.'\'s prior written consent.</li></ul></p>';
55
-
56
- update_option("wp_insert_terms_conditions_content", $TermsandConditionsText);
57
- header("Location: ".get_bloginfo('url')."/wp-admin/admin.php?page=manage-terms-and-conditions");
58
- }
59
- global $screen_layout_columns;
60
-
61
- add_meta_box('wp_insert_edit_terms_conditions', 'Finetune your Terms and Conditions', 'wp_insert_edit_terms_conditions_HTML', 'col_1');
62
- add_meta_box('wp_insert_edit_assign_terms_conditions_page', 'Assign Page for manage-terms-and-conditions', 'wp_insert_edit_assign_terms_conditions_page_HTML', 'col_1');
63
-
64
- $parameters = 'wp_insert_terms_conditions_content';
65
- wp_insert_settings_page_layout($parameters, 'WP-INSERT : manage-terms-and-conditions', 'terms');
66
- }
67
-
68
- function wp_insert_edit_assign_terms_conditions_page_HTML() { ?>
69
- <div>
70
- <p>Assign
71
- <select id="wp_insert_select_assign_pages" onchange="UpdateAssignlink()">
72
- <option value="#" selected="selected">-- Select a Page --</option>
73
- <?php
74
- $count = 0;
75
- $pages = get_pages('sort_column=menu_order');
76
- foreach($pages as $page) {
77
- if($count < 100) {
78
- echo "<option value='".get_bloginfo('url')."/wp-admin/admin.php?page=manage-terms-and-conditions&assign=".$page->ID."'>".$page->post_title."</option>";
79
- }
80
- $count++;
81
- }
82
- ?>
83
- </select>
84
- <script type="text/javascript">
85
- document.getElementById('wp_insert_select_assign_pages').selectedIndex = 0;
86
- function UpdateAssignlink() {
87
- document.getElementById('wp_insert_assign_now_link').href = document.getElementById('wp_insert_select_assign_pages')[document.getElementById('wp_insert_select_assign_pages').selectedIndex].value;
88
- }
89
- </script>
90
- as Terms and Conditions page : <a id="wp_insert_assign_now_link" href="#" class="button-secondary">Assign Now</a></p>
91
- <p><b>OR</b></p>
92
- <p>Create Terms and Conditions Page Automatically : <a href="<?php echo get_bloginfo('url')."/wp-admin/admin.php?page=manage-terms-and-conditions&create=1"; ?>" class="button-secondary">Create Now</a></p>
93
- </div>
94
- <?php }
95
-
96
- function wp_insert_edit_terms_conditions_HTML() { ?>
97
- <script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/fckeditor/fckeditor.js"></script>
98
- <textarea id="wp_insert_terms_conditions_content" name="wp_insert_terms_conditions_content" style="width:100%; height: 400px;">
99
- <?php echo get_option('wp_insert_terms_conditions_content'); ?>
100
- </textarea>
101
- <p><a href="<?php echo get_bloginfo('url')."/wp-admin/admin.php?page=manage-terms-and-conditions&reset=1"; ?>" class="button-secondary alignright">Reset</a></p><p><small>This is an automatically generated "Terms and Conditions".</small></p>
102
- <script type="text/javascript">
103
- if(document.getElementById('wp_insert_terms_conditions_content')) {
104
- var wp_insert_fckeditor = new FCKeditor('wp_insert_terms_conditions_content') ;
105
- wp_insert_fckeditor.Height = "400"
106
- wp_insert_fckeditor.BasePath = '<?php echo WP_PLUGIN_URL; ?>/wp-insert/fckeditor/';
107
- wp_insert_fckeditor.ReplaceTextarea() ;
108
- }
109
- </script>
110
- <?php }
111
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/templateads.php DELETED
@@ -1,58 +0,0 @@
1
- <?php
2
- function wp_template_ad($ad_ID) {
3
- $output = '';
4
- global $random;
5
- $page_details = wp_insert_get_current_page_details();
6
-
7
- if(get_option('wp_insert_template_ad_'.$ad_ID.'_enable')) {
8
- $ad_style = get_option('wp_insert_template_ad_'.$ad_ID.'_style');
9
- if($ad_style == '') { $ad_style = 'margin: 5px; padding: 0px;'; }
10
- if(!get_option('wp_insert_template_ad_'.$ad_ID.'_exclude_home') && ($page_details == 'HOME')) {
11
- switch($random) {
12
- case 0:
13
- $output .= '<div id="template_ad_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_template_ad_'.$ad_ID.'_content').'</div>';
14
- break;
15
- case 1:
16
- $output .= '<div id="template_ad_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_template_ad_'.$ad_ID.'_content_1').'</div>';
17
- break;
18
- case 2:
19
- $output .= '<div id="template_ad_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_template_ad_'.$ad_ID.'_content_2').'</div>';
20
- break;
21
- }
22
- }
23
- else if(!get_option('wp_insert_template_ad_'.$ad_ID.'_exclude_archives') && ($page_details == 'ARCHIVE')) {
24
- switch($random) {
25
- case 0:
26
- $output .= '<div id="template_ad_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_template_ad_'.$ad_ID.'_content').'</div>';
27
- break;
28
- case 1:
29
- $output .= '<div id="template_ad_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_template_ad_'.$ad_ID.'_content_1').'</div>';
30
- break;
31
- case 2:
32
- $output .= '<div id="template_ad_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_template_ad_'.$ad_ID.'_content_2').'</div>';
33
- break;
34
- }
35
- }
36
- else {
37
- if(is_singular()) {
38
- $page_ids = explode(',', str_replace(" ", "", get_option('wp_insert_template_ad_'.$ad_ID.'_exclude_ids')));
39
- if(wp_insert_is_in_array($page_details, $page_ids) =='FALSE') {
40
- switch($random) {
41
- case 0:
42
- $output .= '<div id="template_ad_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_template_ad_'.$ad_ID.'_content').'</div>';
43
- break;
44
- case 1:
45
- $output .= '<div id="template_ad_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_template_ad_'.$ad_ID.'_content_1').'</div>';
46
- break;
47
- case 2:
48
- $output .= '<div id="template_ad_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_template_ad_'.$ad_ID.'_content_2').'</div>';
49
- break;
50
- }
51
- }
52
- }
53
- }
54
- }
55
-
56
- echo $output;
57
- }
58
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/templateads/activate-upgrade.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('wp_insert_activate_upgrade', 'wp_insert_templateads_activate_upgrade');
3
+ function wp_insert_templateads_activate_upgrade() {
4
+ if(!get_option('wp_insert_templateads_options')) {
5
+ $values = array();
6
+ for($i = 1; $i <= 10; $i++) {
7
+ $values['templateads-'.$i] = array(
8
+ 'status' => '',
9
+ 'ad_code_1' => '',
10
+ 'ad_code_2' => '',
11
+ 'ad_code_3' => '',
12
+ 'country_1' => '',
13
+ 'country_code_1' => '',
14
+ 'rules_exclude_home' => '',
15
+ 'rules_exclude_archives' => '',
16
+ 'rules_exclude_categories' => '',
17
+ 'rules_categories_exceptions' => '',
18
+ 'rules_exclude_search' => '',
19
+ 'rules_exclude_page' => '',
20
+ 'rules_page_exceptions' => '',
21
+ 'rules_exclude_post' => '',
22
+ 'rules_post_exceptions' => '',
23
+ 'styles' => 'margin: 5px; padding: 0px;',
24
+ );
25
+ }
26
+ $values = wp_insert_templateads_upgrade_from_1x($values, 1);
27
+ update_option('wp_insert_templateads_options', $values);
28
+ }
29
+
30
+ if(!get_option('wp_insert_more_templateads_options')) {
31
+ $values = array();
32
+ for($i = 11; $i <= 20; $i++) {
33
+ $values['templateads-'.$i] = array(
34
+ 'status' => '',
35
+ 'ad_code_1' => '',
36
+ 'ad_code_2' => '',
37
+ 'ad_code_3' => '',
38
+ 'country_1' => '',
39
+ 'country_code_1' => '',
40
+ 'rules_exclude_home' => '',
41
+ 'rules_exclude_archives' => '',
42
+ 'rules_exclude_categories' => '',
43
+ 'rules_categories_exceptions' => '',
44
+ 'rules_exclude_search' => '',
45
+ 'rules_exclude_page' => '',
46
+ 'rules_page_exceptions' => '',
47
+ 'rules_exclude_post' => '',
48
+ 'rules_post_exceptions' => '',
49
+ 'styles' => 'margin: 5px; padding: 0px;',
50
+ );
51
+ }
52
+ $values = wp_insert_templateads_upgrade_from_1x($values, 11);
53
+ update_option('wp_insert_more_templateads_options', $values);
54
+ }
55
+ }
56
+
57
+ function wp_insert_templateads_upgrade_from_1x($values, $group) {
58
+ for($i = $group; $i < ($group + 10); $i++) {
59
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_template_ad_'.$i.'_enable');
60
+ $values['templateads-'.$i]['status'] = ($val == null)?$values['templateads-'.$i]['status']:$val;
61
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_template_ad_'.$i.'_content');
62
+ $values['templateads-'.$i]['ad_code_1'] = ($val == null)?$values['templateads-'.$i]['ad_code_1']:$val;
63
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_template_ad_'.$i.'_content_1');
64
+ $values['templateads-'.$i]['ad_code_2'] = ($val == null)?$values['templateads-'.$i]['ad_code_2']:$val;
65
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_template_ad_'.$i.'_content_2');
66
+ $values['templateads-'.$i]['ad_code_3'] = ($val == null)?$values['templateads-'.$i]['ad_code_3']:$val;
67
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_template_ad_'.$i.'_exclude_ids');
68
+ $values['templateads-'.$i]['rules_exclude_page'] = ($val == null)?$values['templateads-'.$i]['rules_exclude_page']:$val;
69
+ $values['templateads-'.$i]['rules_exclude_page'] = ($val == null)?$values['templateads-'.$i]['rules_exclude_page']:$val;
70
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_template_ad_'.$i.'_exclude_home');
71
+ $values['templateads-'.$i]['rules_exclude_home'] = ($val == null)?$values['templateads-'.$i]['rules_exclude_home']:$val;
72
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_template_ad_'.$i.'_exclude_archives');
73
+ $values['templateads-'.$i]['rules_exclude_archives'] = ($val == null)?$values['templateads-'.$i]['rules_exclude_archives']:$val;
74
+ $val = wp_insert_read_and_destroy_old_option('wp_insert_template_ad_'.$i.'_style');
75
+ $values['templateads-'.$i]['styles'] = ($val == null)?$values['templateads-'.$i]['styles']:$val;
76
+ }
77
+ return $values;
78
+ }
79
+ ?>
includes/templateads/admin-page.php ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_insert_templateads_admin_page() {
3
+ wp_insert_admin_page('Template Tags', 'wp-insert-templateads', 'wp_insert_templateads_options');
4
+ }
5
+
6
+ function wp_insert_more_templateads_admin_page() {
7
+ wp_insert_admin_page('Template Tags', 'wp-insert-more-templateads', 'wp_insert_more_templateads_options');
8
+ }
9
+
10
+ add_action('admin_init', 'wp_insert_templateads_admin_init');
11
+ function wp_insert_templateads_admin_init() {
12
+ register_setting('wp_insert_templateads_options', 'wp_insert_templateads_options', 'wp_insert_templateads_validate');
13
+ add_settings_section('wp-insert-templateads', '', 'wp_insert_templateads_section', 'wp-insert-templateads');
14
+
15
+ $options = get_option('wp_insert_templateads_options');
16
+ add_meta_box('wp_insert_multiple_network_status', 'Multiple Ad Networks', 'wp_insert_multiple_network_status_content', 'wp-insert-templateads', 'advanced', 'high', array('location' => 'multiple-network', 'name' => 'wp_insert_templateads_options', 'data' => $options));
17
+ for($i = 1; $i <= 10; $i++) {
18
+ add_meta_box('wp-insert-templateads-'.$i, 'Template Ad '.$i, 'wp_insert_templateads_content', 'wp-insert-templateads', 'advanced', 'low', array('location' => 'templateads-'.$i, 'name' => 'wp_insert_templateads_options', 'data' => $options));
19
+ }
20
+
21
+ register_setting('wp_insert_more_templateads_options', 'wp_insert_more_templateads_options', 'wp_insert_templateads_validate');
22
+ add_settings_section('wp-insert-more-templateads', '', 'wp_insert_more_templateads_section', 'wp-insert-more-templateads');
23
+
24
+ $options = get_option('wp_insert_more_templateads_options');
25
+ add_meta_box('wp_insert_multiple_network_status', 'Multiple Ad Networks', 'wp_insert_multiple_network_status_content', 'wp-insert-more-templateads', 'advanced', 'high', array('location' => 'multiple-network', 'name' => 'wp_insert_more_templateads_options', 'data' => $options));
26
+ for($i = 11; $i <= 20; $i++) {
27
+ add_meta_box('wp-insert-more-templateads-'.$i, 'Template Ad '.$i, 'wp_insert_templateads_content', 'wp-insert-more-templateads', 'advanced', 'low', array('location' => 'templateads-'.$i, 'name' => 'wp_insert_more_templateads_options', 'data' => $options));
28
+ }
29
+ }
30
+
31
+ function wp_insert_templateads_section() {
32
+ do_meta_boxes('wp-insert-templateads', 'advanced', null);
33
+ }
34
+
35
+ function wp_insert_more_templateads_section() {
36
+ do_meta_boxes('wp-insert-more-templateads', 'advanced', null);
37
+ }
38
+
39
+ function wp_insert_templateads_content($post, $args) {
40
+ $location = $args['args']['location'];
41
+ $data = $args['args']['data'];
42
+ $id = $args['id'];
43
+ $name = $args['args']['name'].'['.$location.']';
44
+
45
+ if(!$data) {
46
+ $data = array();
47
+ }
48
+
49
+ $controls = array();
50
+ $controls['status'] = wp_insert_get_control('tz-checkbox', false, $name.'[status]', $id.'-status', $data[$location]['status']);
51
+ $controls['ad_code_1'] = wp_insert_get_control('textarea', false, $name.'[ad_code_1]', $id.'-ad_code_1', $data[$location]['ad_code_1'], 'Ad Code (Primary Network):');
52
+ $controls['ad_code_2'] = wp_insert_get_control('textarea', false, $name.'[ad_code_2]', $id.'-ad_code_2', $data[$location]['ad_code_2'], 'Ad Code (Secondary Network):');
53
+ $controls['ad_code_3'] = wp_insert_get_control('textarea', false, $name.'[ad_code_3]', $id.'-ad_code_3', $data[$location]['ad_code_3'], 'Ad Code (Tertiary Network):');
54
+
55
+ $countries = wp_insert_get_countries();
56
+ $controls['country_1'] = wp_insert_get_control('popup', false, $name.'[country_1]', $id.'-country_1', $data[$location]['country_1'], 'Geo Targets', '', array('type' => 'countries'));
57
+ $controls['country_code_1'] = wp_insert_get_control('textarea', false, $name.'[country_code_1]', $id.'-country_code_1', $data[$location]['country_code_1'], 'Ad Code', '', null, 'input widefat');
58
+
59
+ $controls['rules_exclude_home'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_home]', $id.'-rules_exclude_home', $data[$location]['rules_exclude_home'], '', '', null, '', false);
60
+ $controls['rules_exclude_archives'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_archives]', $id.'-rules_exclude_archives', $data[$location]['rules_exclude_archives'], '', '', null, '', false);
61
+ $controls['rules_exclude_categories'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_categories]', $id.'-rules_exclude_categories', $data[$location]['rules_exclude_categories'], '', '', null, '', false);
62
+ $controls['rules_categories_exceptions'] = wp_insert_get_control('popup', false, $name.'[rules_categories_exceptions]', $id.'-rules_categories_exceptions', $data[$location]['rules_categories_exceptions'], '', '', array('type' => 'categories'), '', false);
63
+ $controls['rules_exclude_search'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_search]', $id.'-rules_exclude_search', $data[$location]['rules_exclude_search'], '', '', null, '', false);
64
+ $controls['rules_exclude_page'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_page]', $id.'-rules_exclude_page', $data[$location]['rules_exclude_page'], '', '', null, '', false);
65
+ $controls['rules_page_exceptions'] = wp_insert_get_control('popup', false, $name.'[rules_page_exceptions]', $id.'-rules_page_exceptions', $data[$location]['rules_page_exceptions'], '', '', array('type' => 'pages'), '', false);
66
+ $controls['rules_exclude_post'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_post]', $id.'-rules_exclude_post', $data[$location]['rules_exclude_post'], '', '', null, '', false);
67
+ $controls['rules_post_exceptions'] = wp_insert_get_control('popup', false, $name.'[rules_post_exceptions]', $id.'-rules_post_exceptions', $data[$location]['rules_post_exceptions'], '', '', array('type' => 'posts'), '', false);
68
+
69
+ $controls['styles'] = wp_insert_get_control('textarea', false, $name.'[styles]', $id.'-styles', $data[$location]['styles'], 'Styles:');
70
+
71
+ echo $controls['status']['html'];
72
+
73
+ $multiple_network_status = get_option('wp_insert_multiple_network_status');
74
+ if($multiple_network_status == 2 || $multiple_network_status == 1) {
75
+ $controls['ad_code_3']['html'] = '<div style="display: none;">'.$controls['ad_code_3']['html'].'</div>';
76
+ }
77
+
78
+ if($multiple_network_status == 1) {
79
+ $controls['ad_code_2']['html'] = '<div style="display: none;">'.$controls['ad_code_2']['html'].'</div>';
80
+ }
81
+ $tabData = array(
82
+ array(
83
+ 'title' => 'Code Snippet',
84
+ 'content' => '<p class="codeSnippet"><label>Code to add to your theme files:</label><br /><code>&lt;?php if(function_exists("wp_template_ad")) { wp_template_ad("'.str_replace('templateads-', '', $location).'"); } ?&gt;</code></p>'
85
+ ),
86
+ array(
87
+ 'title' => 'Ad Code',
88
+ 'content' => $controls['ad_code_1']['html'].$controls['ad_code_2']['html'].$controls['ad_code_3']['html']
89
+ ),
90
+ array(
91
+ 'title' => 'Rules',
92
+ 'content' => wp_insert_templateads_rules_content($controls)
93
+ ),
94
+ array(
95
+ 'title' => 'Geo Targeting',
96
+ 'content' => '<p>'.$controls['country_1']['html'].$controls['country_code_1']['html'].'</p>'
97
+ ),
98
+ array(
99
+ 'title' => 'Styles',
100
+ 'content' => $controls['styles']['html']
101
+ )
102
+ );
103
+ $controls['vtab'] = wp_insert_get_vtabs('vtab_'.$location, $tabData);
104
+ echo $controls['vtab']['html'];
105
+
106
+ echo wp_insert_get_script_tag($controls);
107
+ }
108
+
109
+ function wp_insert_templateads_rules_content($controls) {
110
+ $rulesTable = array(
111
+ 'class' => 'rules',
112
+ 'rows' => array()
113
+ );
114
+ array_push(
115
+ $rulesTable['rows'],
116
+ array(
117
+ 'cells' => array(
118
+ array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Home')
119
+ )
120
+ ),
121
+ array(
122
+ 'cells' => array(
123
+ array('content' => 'Status'),
124
+ array('content' => '&nbsp;:&nbsp;'),
125
+ array('content' => $controls['rules_exclude_home']['html'])
126
+ )
127
+ )
128
+ );
129
+ array_push(
130
+ $rulesTable['rows'],
131
+ array(
132
+ 'cells' => array(
133
+ array('colspan' => '3', 'content' => '&nbsp;')
134
+ )
135
+ ),
136
+ array(
137
+ 'cells' => array(
138
+ array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Archives')
139
+ )
140
+ ),
141
+ array(
142
+ 'cells' => array(
143
+ array('content' => 'Status'),
144
+ array('content' => '&nbsp;:&nbsp;'),
145
+ array('content' => $controls['rules_exclude_archives']['html'])
146
+ )
147
+ )
148
+ );
149
+ array_push(
150
+ $rulesTable['rows'],
151
+ array(
152
+ 'cells' => array(
153
+ array('colspan' => '3', 'content' => '&nbsp;')
154
+ )
155
+ ),
156
+ array(
157
+ 'cells' => array(
158
+ array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Categories')
159
+ )
160
+ ),
161
+ array(
162
+ 'cells' => array(
163
+ array('content' => 'Status'),
164
+ array('content' => '&nbsp;:&nbsp;'),
165
+ array('content' => $controls['rules_exclude_categories']['html'])
166
+ )
167
+ ),
168
+ array(
169
+ 'cells' => array(
170
+ array('content' => 'Exceptions'),
171
+ array('content' => '&nbsp;:&nbsp;'),
172
+ array('content' => $controls['rules_categories_exceptions']['html'])
173
+ )
174
+ )
175
+ );
176
+ array_push(
177
+ $rulesTable['rows'],
178
+ array(
179
+ 'cells' => array(
180
+ array('colspan' => '3', 'content' => '&nbsp;')
181
+ )
182
+ ),
183
+ array(
184
+ 'cells' => array(
185
+ array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Search Results')
186
+ )
187
+ ),
188
+ array(
189
+ 'cells' => array(
190
+ array('content' => 'Status'),
191
+ array('content' => '&nbsp;:&nbsp;'),
192
+ array('content' => $controls['rules_exclude_search']['html'])
193
+ )
194
+ )
195
+ );
196
+ array_push(
197
+ $rulesTable['rows'],
198
+ array(
199
+ 'cells' => array(
200
+ array('colspan' => '3', 'content' => '&nbsp;')
201
+ )
202
+ ),
203
+ array(
204
+ 'cells' => array(
205
+ array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Single Page')
206
+ )
207
+ ),
208
+ array(
209
+ 'cells' => array(
210
+ array('content' => 'Status'),
211
+ array('content' => '&nbsp;:&nbsp;'),
212
+ array('content' => $controls['rules_exclude_page']['html'])
213
+ )
214
+ ),
215
+ array(
216
+ 'cells' => array(
217
+ array('content' => 'Exceptions'),
218
+ array('content' => '&nbsp;:&nbsp;'),
219
+ array('content' => $controls['rules_page_exceptions']['html'])
220
+ )
221
+ )
222
+ );
223
+ array_push(
224
+ $rulesTable['rows'],
225
+ array(
226
+ 'cells' => array(
227
+ array('colspan' => '3', 'content' => '&nbsp;')
228
+ )
229
+ ),
230
+ array(
231
+ 'cells' => array(
232
+ array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Single Blog Post')
233
+ )
234
+ ),
235
+ array(
236
+ 'cells' => array(
237
+ array('content' => 'Status'),
238
+ array('content' => '&nbsp;:&nbsp;'),
239
+ array('content' => $controls['rules_exclude_post']['html'])
240
+ )
241
+ ),
242
+ array(
243
+ 'cells' => array(
244
+ array('content' => 'Exceptions'),
245
+ array('content' => '&nbsp;:&nbsp;'),
246
+ array('content' => $controls['rules_post_exceptions']['html'])
247
+ )
248
+ )
249
+ );
250
+
251
+ return wp_insert_get_table($rulesTable);
252
+ }
253
+
254
+ function wp_insert_templateads_validate($input) {
255
+ update_option('wp_insert_multiple_network_status', $input['multiple-network']['status']);
256
+ return $input;
257
+ }
258
+ ?>
includes/templateads/menu.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_insert_templateads_menu() {
3
+ $subPageHandle = add_submenu_page('wp-insert', 'Manage Ad Tags<br /><small>(1 - 10)</small>', 'Manage Ad Tags<br /><small>(1 - 10)</small>', 'manage_options', 'wp-insert-templateads', 'wp_insert_templateads_admin_page');
4
+ add_action('admin_print_styles-'.$subPageHandle, 'wp_insert_admin_styles');
5
+
6
+ $subPageHandle = add_submenu_page('wp-insert', 'Manage Ad Tags<br /><small>(11 - 20)</small>', 'Manage Ad Tags<br /><small>(11 - 20)</small>', 'manage_options', 'wp-insert-more-templateads', 'wp_insert_more_templateads_admin_page');
7
+ add_action('admin_print_styles-'.$subPageHandle, 'wp_insert_admin_styles');
8
+ }
9
+ add_action('admin_menu', 'wp_insert_templateads_menu');
10
+ ?>
includes/templateads/template-tag.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_template_ad($instance) {
3
+ global $wpInsertAdInstance;
4
+ global $wpInsertGeoLocation;
5
+ if($instance <= 10) {
6
+ $options = get_option('wp_insert_templateads_options');
7
+ } else {
8
+ $options = get_option('wp_insert_more_templateads_options');
9
+ }
10
+ if(wp_insert_get_ad_status($options['templateads-'.$instance])) {
11
+ if(($options['templateads-'.$instance]['country_1'] != '') && ($wpInsertGeoLocation != '') && (in_array($wpInsertGeoLocation, split(',', $options['templateads-'.$instance]['country_1'])))) {
12
+ echo '<div class="wpInsert wpInsertTemplateTag"'.(($options['templateads-'.$instance]['styles'] != '')?' style="'.$options['templateads-'.$instance]['styles'].'"':'').'>'.$options['templateads-'.$instance]['country_code_1'].'</div>';
13
+ } else {
14
+ echo '<div class="wpInsert wpInsertTemplateTag"'.(($options['templateads-'.$instance]['styles'] != '')?' style="'.$options['templateads-'.$instance]['styles'].'"':'').'>'.$options['templateads-'.$instance]['ad_code_'.$wpInsertAdInstance].'</div>';
15
+ }
16
+ }
17
+ }
18
+ ?>
includes/templateads/templateads.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ require_once(dirname(__FILE__).'/activate-upgrade.php');
3
+ require_once(dirname(__FILE__).'/menu.php');
4
+ require_once(dirname(__FILE__).'/admin-page.php');
5
+ require_once(dirname(__FILE__).'/template-tag.php');
6
+ ?>
includes/tracking-codes/activate-upgrade.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('wp_insert_activate_upgrade', 'wp_insert_tracking_codes_activate_upgrade');
3
+ function wp_insert_tracking_codes_activate_upgrade() {
4
+ if(!get_option('wp_insert_tracking_codes_options')) {
5
+ $values = array(
6
+ 'analytics' => array(
7
+ 'status' => '',
8
+ 'code' => ''
9
+ ),
10
+ 'header' => array(
11
+ 'status' => '',
12
+ 'code' => ''
13
+ ),
14
+ 'footer' => array(
15
+ 'status' => '',
16
+ 'code' => ''
17
+ )
18
+ );
19
+ $values = wp_insert_tracking_codes_upgrade_from_1x($values);
20
+ update_option('wp_insert_tracking_codes_options', $values);
21
+ }
22
+ }
23
+
24
+ function wp_insert_tracking_codes_upgrade_from_1x($values) {
25
+ $val = wp_insert_read_and_destroy_old_option('smart_analytics_enabled');
26
+ $values['analytics']['status'] = ($val == null)?$values['analytics']['status']:$val;
27
+ $val = wp_insert_read_and_destroy_old_option('smart_analytics_id');
28
+ $values['analytics']['code'] = ($val == null)?$values['analytics']['code']:$val;
29
+
30
+ $val = wp_insert_read_and_destroy_old_option('smart_analytics_header_enabled');
31
+ $values['header']['status'] = ($val == null)?$values['header']['status']:$val;
32
+ $val = wp_insert_read_and_destroy_old_option('smart_analytics_header_code');
33
+ $values['header']['code'] = ($val == null)?$values['header']['code']:$val;
34
+
35
+ $val = wp_insert_read_and_destroy_old_option('smart_analytics_footer_enabled');
36
+ $values['footer']['status'] = ($val == null)?$values['footer']['status']:$val;
37
+ $val = wp_insert_read_and_destroy_old_option('smart_analytics_footer_code');
38
+ $values['footer']['code'] = ($val == null)?$values['footer']['code']:$val;
39
+ return $values;
40
+ }
41
+ ?>
includes/tracking-codes/admin-page.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_insert_tracking_codes_admin_page() {
3
+ wp_insert_admin_page('Tracking Codes', 'wp-insert-tracking-codes', 'wp_insert_tracking_codes_options');
4
+ }
5
+
6
+ add_action('admin_init', 'wp_insert_tracking_codes_admin_init');
7
+ function wp_insert_tracking_codes_admin_init() {
8
+ register_setting('wp_insert_tracking_codes_options', 'wp_insert_tracking_codes_options', 'wp_insert_tracking_codes_validate');
9
+ add_settings_section('wp-insert-tracking-codes', '', 'wp_insert_tracking_codes_section', 'wp-insert-tracking-codes');
10
+
11
+ $options = get_option('wp_insert_tracking_codes_options');
12
+ add_meta_box('wp-insert-tracking-codes-google-analytics', 'Google Analytics', 'wp_insert_tracking_codes_content', 'wp-insert-tracking-codes', 'advanced', 'low', array('location' => 'analytics', 'name' => 'wp_insert_tracking_codes_options', 'data' => $options));
13
+ add_meta_box('wp-insert-tracking-codes-header', 'Custom code in Header', 'wp_insert_tracking_codes_content', 'wp-insert-tracking-codes', 'advanced', 'low', array('location' => 'header', 'name' => 'wp_insert_tracking_codes_options', 'data' => $options));
14
+ add_meta_box('wp-insert-tracking-codes-footer', 'Custom code in Footer', 'wp_insert_tracking_codes_content', 'wp-insert-tracking-codes', 'advanced', 'low', array('location' => 'footer', 'name' => 'wp_insert_tracking_codes_options', 'data' => $options));
15
+ }
16
+
17
+ function wp_insert_tracking_codes_section() {
18
+ do_meta_boxes('wp-insert-tracking-codes', 'advanced', null);
19
+ }
20
+
21
+ function wp_insert_tracking_codes_content($post, $args) {
22
+ $location = $args['args']['location'];
23
+ $data = $args['args']['data'];
24
+ $id = $args['id'];
25
+ $name = $args['args']['name'].'['.$location.']';
26
+
27
+ if(!$data) {
28
+ $data = array();
29
+ }
30
+
31
+ $controls = array();
32
+ $controls['status'] = wp_insert_get_control('tz-checkbox', false, $name.'[status]', $id.'-status', $data[$location]['status']);
33
+
34
+ if($location == 'analytics') {
35
+ $controls['code'] = wp_insert_get_control('text', false, $name.'[code]', $id.'-code', $data[$location]['code'], 'Google Analytics Tracker ID:', 'Your Google Analytics Tracker ID (XX-XXXXX-X)');
36
+ } else {
37
+ $controls['code'] = wp_insert_get_control('textarea', false, $name.'[code]', $id.'-code', $data[$location]['code'], 'Code:');
38
+ }
39
+
40
+ echo $controls['status']['html'];
41
+ echo $controls['code']['html'];
42
+ echo wp_insert_get_script_tag($controls);
43
+ }
44
+
45
+ function wp_insert_tracking_codes_validate($input) {
46
+ return $input;
47
+ }
48
+ ?>
includes/tracking-codes/codes.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('wp_head', 'wp_insert_tracking_codes_wp_head');
3
+ function wp_insert_tracking_codes_wp_head() {
4
+ $options = get_option('wp_insert_tracking_codes_options');
5
+ if($options['header']['status']) {
6
+ echo $options['header']['code'];
7
+ }
8
+ }
9
+
10
+ add_action('wp_footer', 'wp_insert_tracking_codes_wp_footer');
11
+ function wp_insert_tracking_codes_wp_footer() {
12
+ $options = get_option('wp_insert_tracking_codes_options');
13
+ if($options['analytics']['status'] && ($options['analytics']['code'] != '')) {
14
+ echo '<script type="text/javascript">';
15
+ echo 'var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");';
16
+ echo 'document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));';
17
+ echo '</script>';
18
+ echo '<script type="text/javascript">';
19
+ echo 'var pageTracker = _gat._getTracker("'.$options['analytics']['code'].'");';
20
+ echo 'pageTracker._trackPageview();';
21
+ echo '</script>';
22
+ }
23
+ if($options['footer']['status']) {
24
+ echo $options['footer']['code'];
25
+ }
26
+ }
27
+ ?>
includes/tracking-codes/menu.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_insert_tracking_codes_menu() {
3
+ $subPageHandle = add_submenu_page('wp-insert', 'Tracking Codes', 'Tracking Codes', 'manage_options', 'wp-insert-tracking-codes', 'wp_insert_tracking_codes_admin_page');
4
+ add_action('admin_print_styles-'.$subPageHandle, 'wp_insert_admin_styles');
5
+ }
6
+ add_action('admin_menu', 'wp_insert_tracking_codes_menu');
7
+ ?>
includes/tracking-codes/tracking-codes.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ require_once(dirname(__FILE__).'/activate-upgrade.php');
3
+ require_once(dirname(__FILE__).'/menu.php');
4
+ require_once(dirname(__FILE__).'/admin-page.php');
5
+ require_once(dirname(__FILE__).'/codes.php');
6
+ ?>
includes/tracking.php DELETED
@@ -1,133 +0,0 @@
1
- <?php
2
- function wp_insert_add_trackingpage() {
3
- global $screen_layout_columns;
4
-
5
- add_meta_box('wp_insert_feed_logo', 'Logo for your Feed', 'wp_insert_feed_logo_HTML', 'feedLogo');
6
- add_meta_box('wp_insert_subscribe_widget_1', 'Subscribe Widget : Type 1', 'wp_insert_subscribe_widget_1_HTML', 'subscribeWidgets');
7
- add_meta_box('wp_insert_subscribe_widget_2', 'Subscribe Widget : Type 2', 'wp_insert_subscribe_widget_2_HTML', 'subscribeWidgets');
8
- add_meta_box('wp_insert_subscribe_widget_3', 'Subscribe Widget : Type 3', 'wp_insert_subscribe_widget_3_HTML', 'subscribeWidgets');
9
- add_meta_box('wp_insert_feed_ad_top', 'Ad - Above Feed Content', 'wp_insert_feed_ad_top_HTML', 'inFeedAds');
10
- add_meta_box('wp_insert_feed_ad_bottom', 'Ad - Below Feed Content', 'wp_insert_feed_ad_bottom_HTML', 'inFeedAds');
11
- add_meta_box('wp_insert_feed_feedburner', 'FeedBurner Feed URL', 'wp_insert_feed_feedburner_HTML', 'feedburner');
12
- add_meta_box('wp_insert_feed_feedburner_email', 'FeedBurner - Subscribe via Email Widget', 'wp_insert_feed_feedburner_email_HTML', 'feedburner');
13
- ?>
14
- <div id="post_ads_container" class="wrap">
15
- <?php screen_icon('options-general'); ?>
16
- <h2>WP-INSERT : Manage Feeds</h2>
17
- <div class="updated fade below-h2" id="message" style="opacity:0;display:none;"><p>Changes have been made to this page. Please click <b>Save Changes</b> to make them permanent</p></div>
18
- <form method="post" action="options.php">
19
- <?php
20
- wp_nonce_field('update-options');
21
- wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
22
- wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
23
- ?>
24
- <script type="text/javascript" src="<?php echo WP_PLUGIN_URL; ?>/wp-insert/js/common.js"></script>
25
- <div id="poststuff" class="metabox-holder has-right-sidebar">
26
- <div id="side-info-column" class="inner-sidebar">
27
- <?php do_meta_boxes('feedLogo','advanced',null); ?>
28
- <?php do_meta_boxes('subscribeWidgets','advanced',null); ?>
29
- </div>
30
- <div id="post-body" class="has-sidebar">
31
- <div id="post-body-content" class="has-sidebar-content">
32
- <?php do_meta_boxes('inFeedAds','advanced',null); ?>
33
- <?php do_meta_boxes('feedburner','advanced',null); ?>
34
- <input type="hidden" name="action" value="update" />
35
- <input type="hidden" name="page_options" value="" />
36
- <p class="submit">
37
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
38
- </p>
39
- </div>
40
- </div>
41
- <br class="clear"/>
42
-
43
- </div>
44
- </form>
45
- </div>
46
- <script type="text/javascript">
47
- //<![CDATA[
48
- jQuery(document).ready( function($) {
49
- // close postboxes that should be closed
50
- jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
51
- jQuery('.postbox').addClass('closed');
52
- // postboxes setup
53
- postboxes.add_postbox_toggles('wp-insert');
54
- });
55
- //]]>
56
- </script>
57
- </div>
58
- <?php
59
- }
60
-
61
- function wp_insert_subscribe_widget_HTML($widgetID) { ?>
62
- <div>
63
- <?php if(get_option('wp_insert_feed_widget_'.$widgetID.'_enable')) { ?><input type="button" id="wp_insert_feed_widget_<?php echo $widgetID; ?>_enable_button" value="Click to Deactivate" class="button" style="font-weight:bold;color:red;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_widget_<?php echo $widgetID; ?>_enable_button', '#wp_insert_feed_widget_<?php echo $widgetID; ?>_enable')"/>
64
- <?php } else { ?><input type="button" id="wp_insert_feed_widget_<?php echo $widgetID; ?>_enable_button" value="Click to Activate" class="button" style="font-weight:bold;color:#2f9303;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_widget_<?php echo $widgetID; ?>_enable_button', '#wp_insert_feed_widget_<?php echo $widgetID; ?>_enable')"/><?php } ?>
65
- <input style="display:none;" id="wp_insert_feed_widget_<?php echo $widgetID; ?>_enable" name="wp_insert_feed_widget_<?php echo $widgetID; ?>_enable" type="checkbox" value="1"<?php if(get_option('wp_insert_feed_widget_'.$widgetID.'_enable')) echo ' checked="checked"'; ?> />
66
- <p>
67
- <label for="wp_insert_feed_widget_<?php echo $widgetID; ?>_title">Title:</label>
68
- <input id="wp_insert_feed_widget_<?php echo $widgetID; ?>_title" class="widefat" type="text" value="<?php echo get_option('wp_insert_feed_widget_'.$widgetID.'_title'); ?>" name="wp_insert_feed_widget_<?php echo $widgetID; ?>_title"/>
69
- </p>
70
- </div>
71
- <?php }
72
-
73
- function wp_insert_subscribe_widget_1_HTML() { wp_insert_subscribe_widget_HTML(1); }
74
- function wp_insert_subscribe_widget_2_HTML() { wp_insert_subscribe_widget_HTML(2); }
75
- function wp_insert_subscribe_widget_3_HTML() { wp_insert_subscribe_widget_HTML(3); }
76
-
77
- function wp_insert_feed_feedburner_email_HTML() { ?>
78
- <div>
79
- <?php if(get_option('wp_insert_feed_feedburner_email_enable')) { ?><input type="button" id="wp_insert_feed_feedburner_email_enable_button" value="Click to Deactivate" class="button" style="font-weight:bold;color:red;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_feedburner_email_enable_button', '#wp_insert_feed_feedburner_email_enable')"/>
80
- <?php } else { ?><input type="button" id="wp_insert_feed_feedburner_email_enable_button" value="Click to Activate" class="button" style="font-weight:bold;color:#2f9303;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_feedburner_email_enable_button', '#wp_insert_feed_feedburner_email_enable')"/><?php } ?>
81
- <input style="display:none;" id="wp_insert_feed_feedburner_email_enable" name="wp_insert_feed_feedburner_email_enable" type="checkbox" value="1"<?php if(get_option('wp_insert_feed_feedburner_email_enable')) echo ' checked="checked"'; ?> />
82
- <p>
83
- <label for="wp_insert_feed_feedburner_email_widget_code">Subscribe via Email Code:</label>
84
- <textarea id="wp_insert_feed_feedburner_email_widget_code" class="widefat" name="wp_insert_feed_feedburner_email_widget_code" cols="20" rows="16"><?php echo get_option('wp_insert_feed_feedburner_email_widget_code'); ?></textarea></p>
85
- </div>
86
- <?php }
87
-
88
- function wp_insert_feed_feedburner_HTML() { ?>
89
- <div>
90
- <?php if(get_option('wp_insert_feed_feedburner_enable')) { ?><input type="button" id="wp_insert_feed_feedburner_enable_button" value="Click to Deactivate" class="button" style="font-weight:bold;color:red;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_feedburner_enable_button', '#wp_insert_feed_feedburner_enable')"/>
91
- <?php } else { ?><input type="button" id="wp_insert_feed_feedburner_enable_button" value="Click to Activate" class="button" style="font-weight:bold;color:#2f9303;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_feedburner_enable_button', '#wp_insert_feed_feedburner_enable')"/><?php } ?>
92
- <input style="display:none;" id="wp_insert_feed_feedburner_enable" name="wp_insert_feed_feedburner_enable" type="checkbox" value="1"<?php if(get_option('wp_insert_feed_feedburner_enable')) echo ' checked="checked"'; ?> />
93
- <p>
94
- <label for="wp_insert_feed_feedburner_url">Logo URL:</label>
95
- <input id="wp_insert_feed_feedburner_url" class="widefat" type="text" value="<?php echo get_option('wp_insert_feed_feedburner_url'); ?>" name="wp_insert_feed_feedburner_url"/>
96
- </p>
97
- </div>
98
- <?php }
99
-
100
- function wp_insert_feed_ad_HTML($feed_adID) { ?>
101
- <div>
102
- <?php if(get_option('wp_insert_feed_ad_'.$in_post_adID.'_enable')) { ?><input type="button" id="wp_insert_feed_ad_<?php echo $in_post_adID; ?>_enable_button" value="Click to Deactivate" class="button" style="font-weight:bold;color:red;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_ad_<?php echo $in_post_adID; ?>_enable_button', '#wp_insert_feed_ad_<?php echo $in_post_adID; ?>_enable')"/>
103
- <?php } else { ?><input type="button" id="wp_insert_feed_ad_<?php echo $in_post_adID; ?>_enable_button" value="Click to Activate" class="button" style="font-weight:bold;color:#2f9303;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_ad_<?php echo $in_post_adID; ?>_enable_button', '#wp_insert_feed_ad_<?php echo $in_post_adID; ?>_enable')"/><?php } ?>
104
- <input style="display:none;" id="wp_insert_feed_ad_<?php echo $in_post_adID; ?>_enable" name="wp_insert_feed_ad_<?php echo $in_post_adID; ?>_enable" type="checkbox" value="1"<?php if(get_option('wp_insert_feed_ad_'.$in_post_adID.'_enable')) echo ' checked="checked"'; ?> />
105
- <p>
106
- <label for="wp_insert_feed_ad_<?php echo $in_post_adID; ?>_content">Ad Code:</label>
107
- <textarea id="wp_insert_feed_ad_<?php echo $in_post_adID; ?>_content" class="widefat" name="wp_insert_feed_ad_<?php echo $in_post_adID; ?>_content" cols="20" rows="16"><?php echo get_option('wp_insert_feed_ad_'.$in_post_adID.'_content'); ?></textarea>
108
- </p>
109
- </div>
110
- <?php }
111
-
112
- function wp_insert_feed_ad_top_HTML() { wp_insert_feed_ad_HTML("top"); }
113
- function wp_insert_feed_ad_bottom_HTML() { wp_insert_feed_ad_HTML("bottom"); }
114
-
115
- function wp_insert_feed_logo_HTML() { ?>
116
- <div>
117
- <?php if(get_option('wp_insert_feed_logo_enable')) { ?><input type="button" id="wp_insert_feed_logo_enable_button" value="Click to Deactivate" class="button" style="font-weight:bold;color:red;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_logo_enable_button', '#wp_insert_feed_logo_enable')"/>
118
- <?php } else { ?><input type="button" id="wp_insert_feed_logo_enable_button" value="Click to Activate" class="button" style="font-weight:bold;color:#2f9303;" onclick="wpInsertToggleAdWidget('#wp_insert_feed_logo_enable_button', '#wp_insert_feed_logo_enable')"/><?php } ?>
119
- <input style="display:none;" id="wp_insert_feed_logo_enable" name="wp_insert_feed_logo_enable" type="checkbox" value="1"<?php if(get_option('wp_insert_feed_logo_enable')) echo ' checked="checked"'; ?> />
120
- <p>
121
- <label for="wp_insert_feed_logo_url">Logo URL:</label>
122
- <input id="wp_insert_feed_logo_url" class="widefat" type="text" value="<?php echo get_option('wp_insert_feed_logo_url'); ?>" name="wp_insert_feed_logo_url"/>
123
- </p>
124
- <p>
125
- <label for="wp_insert_feed_logo_width">Logo width:</label>
126
- <input id="wp_insert_feed_logo_width" class="widefat" type="text" value="<?php echo get_option('wp_insert_feed_logo_width'); ?>" name="wp_insert_feed_logo_width" />
127
- </p>
128
- <p>
129
- <label for="wp_insert_feed_logo_height">Logo height:</label>
130
- <input id="wp_insert_feed_logo_height" class="widefat" type="text" value="<?php echo get_option('wp_insert_feed_logo_height'); ?>" name="wp_insert_feed_logo_height"/>
131
- </p>
132
- </div>
133
- <?php }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/twitter-lib/CHANGES DELETED
@@ -1,43 +0,0 @@
1
- + Added
2
- - Removed
3
- * Changed/fixed
4
-
5
- * fixed a bug in destroyStatus
6
- * removed a call to buildRequest I forgot to get rid of
7
- * fixed bugs with createFavorite and destroyFavorite
8
- * removed debug output
9
-
10
- 05 14 2009
11
- - buildRequest was actually kind of unneccessary. Like the second c in that word.
12
- * Smarter handling of GET/POST requests, thanks to Gabriel Sosa @pendexgabo
13
- * $require_credentials now defaults to true in apiCall
14
- + getMentions method maps to statuses/mentions
15
- * createFriendship takes an array of options now
16
- * getRateLimitStatus allows you to choose whether or not to authenticate
17
- + blockExists method maps to blocks/exists
18
- + getBlocking method maps to blocks/blocking
19
- + getBlockingIDs method maps to blocks/blocking/ids
20
-
21
- 03 28 2009
22
- * Moved core functionality to TwitterBase class, and made Twitter a subclass
23
- of it. That way, a TwitterOAuth class can be extended from TwitterBase in the
24
- future
25
- - Removed a debug message, oops
26
-
27
- 03 24 2009
28
- * Return formats are no longer first in the argument list, and they all have
29
- defaults of XML. That was one of the more irritating things in the library.
30
- * A lot of methods with multiple options now take a single array that gets
31
- mapped to GET parameters, so you don't have to worry about order.
32
- * Changed showStatus to getStatus
33
- - Removed getFeatured method
34
- + Added getFriendIDs method
35
- + Added getFollowerIDs method
36
- - Removed updateLocation method
37
- + Added updateProfileColors method
38
- + Added updateProfile method
39
- - Removed downtimeSchedule method
40
- - Removed getArchive method
41
-
42
- 11 26 2007
43
- * Initial release!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/twitter-lib/LICENSE DELETED
@@ -1,22 +0,0 @@
1
- Copyright (c) <2008> Justin Poliey <jdp34@njit.edu>
2
-
3
- Permission is hereby granted, free of charge, to any person
4
- obtaining a copy of this software and associated documentation
5
- files (the "Software"), to deal in the Software without
6
- restriction, including without limitation the rights to use,
7
- copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the
9
- Software is furnished to do so, subject to the following
10
- conditions:
11
-
12
- The above copyright notice and this permission notice shall be
13
- included in all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
- OTHER DEALINGS IN THE SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/twitter-lib/README DELETED
@@ -1,33 +0,0 @@
1
- twitterlibphp - Twitter/PHP interface
2
- http://jdp.github.com/twitterlibphp
3
-
4
- This is a simple interface to the Twitter API.
5
-
6
- I've tried to keep as close as possible to the real API
7
- calls (some had to be changed due to ambiguity), but all
8
- of the arguments are as they are in the official docs.
9
-
10
- For documentation, go to:
11
-
12
- http://jdp.github.com/twitterlibphp/doc
13
- http://apiwiki.twitter.com
14
-
15
- Usage:
16
-
17
- $twitter = new Twitter("username", "password");
18
- $public_timeline = $twitter->getPublicTimeline();
19
-
20
- When you go through the docs, a lot of methods just take
21
- an $options array and a $format parameter. The $options array
22
- allows you to pass API arguments just like you would if you
23
- were calling it from pure HTTP. For example:
24
-
25
- $twitter->getMentions(array('page'=>2), 'json')
26
-
27
- is mapped to...
28
-
29
- http://twitter.com/statuses/mentions.json?page=2
30
-
31
- Justin Poliey <jdp34@njit.edu>
32
- http://justinpoliey.com
33
- @justinpoliey
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/twitter-lib/twitter.lib.php DELETED
@@ -1,535 +0,0 @@
1
- <?php
2
- /*
3
- * Copyright (c) <2008> Justin Poliey <jdp34@njit.edu>
4
- *
5
- * Permission is hereby granted, free of charge, to any person
6
- * obtaining a copy of this software and associated documentation
7
- * files (the "Software"), to deal in the Software without
8
- * restriction, including without limitation the rights to use,
9
- * copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the
11
- * Software is furnished to do so, subject to the following
12
- * conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be
15
- * included in all copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
- * OTHER DEALINGS IN THE SOFTWARE.
25
- */
26
-
27
- /**
28
- * Twitterlibphp is a PHP implementation of the Twitter API, allowing you
29
- * to take advantage of it from within your PHP applications.
30
- *
31
- * @author Justin Poliey <jdp34@njit.edu>
32
- * @package twitterlibphp
33
- */
34
-
35
- /**
36
- * Twitter API abstract class
37
- * @package twitterlibphp
38
- */
39
- abstract class TwitterBase {
40
-
41
- /**
42
- * the last HTTP status code returned
43
- * @access private
44
- * @var integer
45
- */
46
- private $http_status;
47
-
48
- /**
49
- * the whole URL of the last API call
50
- * @access private
51
- * @var string
52
- */
53
- private $last_api_call;
54
-
55
- /**
56
- * the application calling the API
57
- * @access private
58
- * @var string
59
- */
60
- private $application_source;
61
-
62
- /**
63
- * Returns the 20 most recent statuses from non-protected users who have set a custom user icon.
64
- * @param string $format Return format
65
- * @return string
66
- */
67
- function getPublicTimeline($format = 'xml') {
68
- return $this->apiCall('statuses/public_timeline', 'get', $format, array(), false);
69
- }
70
-
71
- /**
72
- * Returns the 20 most recent statuses posted by the authenticating user and that user's friends.
73
- * @param array $options Options to pass to the method
74
- * @param string $format Return format
75
- * @return string
76
- */
77
- function getFriendsTimeline($options = array(), $format = 'xml') {
78
- return $this->apiCall('statuses/friends_timeline', 'get', $format, $options);
79
- }
80
-
81
- /**
82
- * Returns the 20 most recent statuses posted from the authenticating user.
83
- * @param array $options Options to pass to the method
84
- * @param string $format Return format
85
- * @return string
86
- */
87
- function getUserTimeline($options = array(), $format = 'xml') {
88
- return $this->apiCall('statuses/user_timeline', 'get', $format, $options, true);
89
- }
90
-
91
- /**
92
- * Returns the 20 most recent mentions (status containing @username) for the authenticating user.
93
- * @param array $options Options to pass to the method
94
- * @param string $format Return format
95
- * @return string
96
- */
97
- function getMentions($options = array(), $format = 'xml') {
98
- return $this->apiCall("statuses/mentions", 'get', $format, $options);
99
- }
100
-
101
- /**
102
- * Returns the 20 most recent @replies (status updates prefixed with @username) for the authenticating user.
103
- * @param array $options Options to pass to the method
104
- * @param string $format Return format
105
- * @return string
106
- * @deprecated
107
- */
108
- function getReplies($options = array(), $format = 'xml') {
109
- return $this->apiCall('statuses/replies', 'get', $format, $options);
110
- }
111
-
112
- /**
113
- * Returns a single status, specified by the $id parameter.
114
- * @param string|integer $id The numerical ID of the status to retrieve
115
- * @param string $format Return format
116
- * @return string
117
- */
118
- function getStatus($id, $format = 'xml') {
119
- return $this->apiCall("statuses/show/{$id}", 'get', $format, array(), false);
120
- }
121
-
122
- /**
123
- * Updates the authenticated user's status.
124
- * @param string $status Text of the status, no URL encoding necessary
125
- * @param string|integer $reply_to ID of the status to reply to. Optional
126
- * @param string $format Return format
127
- * @return string
128
- */
129
- function updateStatus($status, $reply_to = null, $format = 'xml') {
130
- $options = array('status' => $status);
131
- if ($reply_to) {
132
- $options['in_reply_to_status_id'] = $reply_to;
133
- }
134
- return $this->apiCall('statuses/update', 'post', $format, $options);
135
- }
136
-
137
- /**
138
- * Destroys the status specified by the required ID parameter. The authenticating user must be the author of the specified status.
139
- * @param integer|string $id ID of the status to destroy
140
- * @param string $format Return format
141
- * @return string
142
- */
143
- function destroyStatus($id, $format = 'xml') {
144
- return $this->apiCall("statuses/destroy/{$id}", 'post', $format, $options);
145
- }
146
-
147
- /**
148
- * Returns the authenticating user's friends, each with current status inline.
149
- * @param array $options Options to pass to the method
150
- * @param string $format Return format
151
- * @return string
152
- */
153
- function getFriends($options = array(), $format = 'xml') {
154
- return $this->apiCall('statuses/friends', 'get', $format, $options, false);
155
- }
156
-
157
- /**
158
- * Returns the authenticating user's followers, each with current status inline.
159
- * @param array $options Options to pass to the method
160
- * @param string $format Return format
161
- * @return string
162
- */
163
- function getFollowers($options = array(), $format = 'xml') {
164
- return $this->apiCall('statuses/followers', 'get', $format, $options);
165
- }
166
-
167
- /**
168
- * Returns extended information of a given user.
169
- * @param array $options Options to pass to the method
170
- * @param string $format Return format
171
- * @return string
172
- */
173
- function showUser($options = array(), $format = 'xml') {
174
- if (!array_key_exists('id', $options) && !array_key_exists('user_id', $options) && !array_key_exists('screen_name', $options)) {
175
- $options['id'] = substr($this->credentials, 0, strpos($this->credentials, ':'));
176
- }
177
- return $this->apiCall('users/show', 'get', $format, $options, false);
178
- }
179
-
180
- /**
181
- * Returns a list of the 20 most recent direct messages sent to the authenticating user.
182
- * @param array $options Options to pass to the method
183
- * @param string $format Return format
184
- * @return string
185
- */
186
- function getMessages($options = array(), $format = 'xml') {
187
- return $this->apiCall('direct_messages', 'get', $format, $options);
188
- }
189
-
190
- /**
191
- * Returns a list of the 20 most recent direct messages sent by the authenticating user.
192
- * @param array $options Options to pass to the method
193
- * @param string $format Return format
194
- * @return string
195
- */
196
- function getSentMessages($options = array(), $format = 'xml') {
197
- return $this->apiCall('direct_messages/sent', 'get', $format, $options);
198
- }
199
-
200
- /**
201
- * Sends a new direct message to the specified user from the authenticating user.
202
- * @param string $user The ID or screen name of a recipient
203
- * @param string $text The message to send
204
- * @param string $format Return format
205
- * @return string
206
- */
207
- function newMessage($user, $text, $format = 'xml') {
208
- $options = array(
209
- 'user' => $user,
210
- 'text' => $text
211
- );
212
- return $this->apiCall('direct_messages/new', 'post', $format, $options);
213
- }
214
-
215
- /**
216
- * Destroys the direct message specified in the required $id parameter.
217
- * @param integer|string $id The ID of the direct message to destroy
218
- * @param string $format Return format
219
- * @return string
220
- */
221
- function destroyMessage($id, $format = 'xml') {
222
- return $this->apiCall("direct_messages/destroy/{$id}", 'post', $format, $options);
223
- }
224
-
225
- /**
226
- * Befriends the user specified in the ID parameter as the authenticating user.
227
- * @param array $options Options to pass to the method
228
- * @param string $format Return format
229
- * @return string
230
- */
231
- function createFriendship($options = array(), $format = 'xml') {
232
- if (!array_key_exists('follow', $options)) {
233
- $options['follow'] = 'true';
234
- }
235
- return $this->apiCall('friendships/create', 'post', $format, $options);
236
- }
237
-
238
- /**
239
- * Discontinues friendship with the user specified in the ID parameter as the authenticating user.
240
- * @param integer|string $id The ID or screen name of the user to unfriend
241
- * @param string $format Return format
242
- * @return string
243
- */
244
- function destroyFriendship($id, $format = 'xml') {
245
- $options = array('id' => $id);
246
- return $this->apiCall('friendships/destroy', 'post', $format, $options);
247
- }
248
-
249
- /**
250
- * Tests if a friendship exists between two users.
251
- * @param integer|string $user_a The ID or screen name of the first user
252
- * @param integer|string $user_b The ID or screen name of the second user
253
- * @param string $format Return format
254
- * @return string
255
- */
256
- function friendshipExists($user_a, $user_b, $format = 'xml') {
257
- $options = array(
258
- 'user_a' => $user_a,
259
- 'user_b' => $user_b
260
- );
261
- return $this->apiCall('friendships/exists', 'get', $format, $options);
262
- }
263
-
264
- /**
265
- * Returns an array of numeric IDs for every user the specified user is followed by.
266
- * @param array $options Options to pass to the method
267
- * @param string $format Return format
268
- * @return string
269
- */
270
- function getFriendIDs($options = array(), $format = 'xml') {
271
- return $this->apiCall('friends/ids', 'get', $format, $options);
272
- }
273
-
274
- /**
275
- * Returns an array of numeric IDs for every user the specified user is following.
276
- * @param array $options Options to pass to the method
277
- * @param string $format Return format
278
- * @return string
279
- */
280
- function getFollowerIDs($options = array(), $format = 'xml') {
281
- return $this->apiCall('followers/ids', 'get', $format, $options);
282
- }
283
-
284
- /**
285
- * Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful; returns a 401 status code and an error message if not.
286
- * @param string $format Return format
287
- * @return string
288
- */
289
- function verifyCredentials($format = 'xml') {
290
- return $this->apiCall('account/verify_credentials', 'get', $format, array());
291
- }
292
-
293
- /**
294
- * Returns the remaining number of API requests available to the requesting user before the API limit is reached for the current hour.
295
- * @param boolean $authenticate Authenticate before calling method
296
- * @param string $format Return format
297
- * @return string
298
- */
299
- function rateLimitStatus($authenticate = false, $format = 'xml') {
300
- return $this->apiCall('account/rate_limit_status', 'get', $format, array(), $authenticate);
301
- }
302
-
303
- /**
304
- * Ends the session of the authenticating user, returning a null cookie.
305
- * @param string $format Return format
306
- * @return string
307
- */
308
- function endSession($format = 'xml') {
309
- return $this->apiCall('account/end_session', 'post', $format, array());
310
- }
311
-
312
- /**
313
- * Sets which device Twitter delivers updates to for the authenticating user.
314
- * @param string $device The delivery device used. Must be sms, im, or none
315
- * @return string
316
- */
317
- function updateDeliveryDevice($device, $format = 'xml') {
318
- $options = array('device' => $device);
319
- return $this->apiCall('account/update_delivery_device', 'post', $format, $options);
320
- }
321
-
322
- /**
323
- * Sets one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com.
324
- * @param array $options Options to pass to the method
325
- * @param string $format Return format
326
- * @return string
327
- */
328
- function updateProfileColors($options, $format = 'xml') {
329
- return $this->apiCall('account/update_profile_colors', 'post', $format, $options);
330
- }
331
-
332
- /**
333
- * Sets values that users are able to set under the "Account" tab of their settings page.
334
- * @param array $options Options to pass to the method
335
- * @param string $format Return format
336
- * @return string
337
- */
338
- function updateProfile($options, $format = 'xml') {
339
- return $this->apiCall('account/update_profile', 'post', $format, array());
340
- }
341
-
342
-
343
- /**
344
- * Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
345
- * @param array $options Options to pass to the method
346
- * @param string $format Return format
347
- * @return string
348
- */
349
- function getFavorites($options = array(), $format = 'xml') {
350
- return $this->apiCall('favorites', 'get', $format, $options);
351
- }
352
-
353
- /**
354
- * Favorites the status specified in the ID parameter as the authenticating user.
355
- * @param integer|string $id The ID of the status to favorite
356
- * @param string $format Return format
357
- * @return string
358
- */
359
- function createFavorite($id, $format = 'xml') {
360
- return $this->apiCall("favorites/create/{$id}", 'post', $format, array());
361
- }
362
-
363
- /**
364
- * Un-favorites the status specified in the ID parameter as the authenticating user.
365
- * @param integer|string $id The ID of the status to un-favorite
366
- * @param string $format Return format
367
- * @return string
368
- */
369
- function destroyFavorite($id, $format = 'xml') {
370
- return $this->apiCall("favorites/destroy/{$id}", 'post', $format, array());
371
- }
372
-
373
- /**
374
- * Enables notifications for updates from the specified user to the authenticating user.
375
- * @param integer|string $id The ID or screen name of the user to follow
376
- * @param string $format Return format
377
- * @return string
378
- */
379
- function follow($id, $format = 'xml') {
380
- $options = array('id' => $id);
381
- return $this->apiCall('notifications/follow', 'post', $format, $options);
382
- }
383
-
384
- /**
385
- * Disables notifications for updates from the specified user to the authenticating user.
386
- * @param integer|string $id The ID or screen name of the user to leave
387
- * @param string $format Return format
388
- * @return string
389
- */
390
- function leave($id, $format = 'xml') {
391
- $options = array('id' => $id);
392
- return $this->apiCall('notifications/leave', 'post', $format, $options);
393
- }
394
-
395
- /**
396
- * Blocks the user specified in the ID parameter as the authenticating user.
397
- * @param integer|string $id The ID or screen name of the user to block
398
- * @param string $format Return format
399
- * @return string
400
- */
401
- function createBlock($id, $format = 'xml') {
402
- $options = array('id' => $id);
403
- return $this->apiCall('blocks/create', 'post', $format, $options);
404
- }
405
-
406
- /**
407
- * Unblocks the user specified in the ID parameter as the authenticating user.
408
- * @param integer|string $id The ID or screen name of the user to unblock
409
- * @param string $format Return format
410
- * @return string
411
- */
412
- function destroyBlock($id, $format = 'xml') {
413
- $options = array('id' => $id);
414
- return $this->apiCall('blocks/destroy', 'post', $format, $options);
415
- }
416
-
417
- /**
418
- * Returns if the authenticating user is blocking a target user.
419
- * @param array $options Options to pass to the method
420
- * @param string $format Return format
421
- * @return string
422
- */
423
- function blockExists($options, $format = 'xml') {
424
- return $this->apiCall('blocks/exists', 'get', $format, $options);
425
- }
426
-
427
- /**
428
- * Returns an array of user objects that the authenticating user is blocking.
429
- * @param array $options Options to pass to the method
430
- * @param string $format Return format
431
- * @return string
432
- */
433
- function getBlocking($options, $format = 'xml') {
434
- return $this->apiCall('blocks/blocking', 'get', $format, $options);
435
- }
436
-
437
- /**
438
- * Returns an array of numeric user ids the authenticating user is blocking.
439
- * @param array $options Options to pass to the method
440
- * @param string $format Return format
441
- * @return string
442
- */
443
- function getBlockingIDs($format = 'xml') {
444
- return $this->apiCall('blocks/blocking/ids', 'get', $format, array());
445
- }
446
-
447
- /**
448
- * Returns the string "ok" in the requested format with a 200 OK HTTP status code.
449
- * @param string $format Return format
450
- * @return string
451
- */
452
- function test($format = 'xml') {
453
- return $this->apiCall('help/test', 'get', $format, array(), false);
454
- }
455
-
456
- /**
457
- * Returns the last HTTP status code
458
- * @return integer
459
- */
460
- function lastStatusCode() {
461
- return $this->http_status;
462
- }
463
-
464
- /**
465
- * Returns the URL of the last API call
466
- * @return string
467
- */
468
- function lastApiCall() {
469
- return $this->last_api_call;
470
- }
471
- }
472
-
473
- /**
474
- * Access to the Twitter API through HTTP auth
475
- * @package twitterlibphp
476
- */
477
- class Twitter extends TwitterBase {
478
-
479
- /**
480
- * the Twitter credentials in HTTP format, username:password
481
- * @access private
482
- * @var string
483
- */
484
- var $credentials;
485
-
486
- /**
487
- * Fills in the credentials {@link $credentials} and the application source {@link $application_source}.
488
- * @param string $username Twitter username
489
- * @param string $password Twitter password
490
- * @param $source string Optional. Name of the application using the API
491
- */
492
- function __construct($username, $password, $source = null) {
493
- $this->credentials = sprintf("%s:%s", $username, $password);
494
- $this->application_source = $source;
495
- }
496
-
497
- /**
498
- * Executes an API call
499
- * @param string $twitter_method The Twitter method to call
500
- * @param string $http_method The HTTP method to use
501
- * @param string $format Return format
502
- * @param array $options Options to pass to the Twitter method
503
- * @param boolean $require_credentials Whether or not credentials are required
504
- * @return string
505
- */
506
- protected function apiCall($twitter_method, $http_method, $format, $options, $require_credentials = true) {
507
- $curl_handle = curl_init();
508
- $api_url = sprintf('http://twitter.com/%s.%s', $twitter_method, $format);
509
- if (($http_method == 'get') && (count($options) > 0)) {
510
- $api_url .= '?' . http_build_query($options);
511
- }
512
- //echo $api_url . "\n";
513
- curl_setopt($curl_handle, CURLOPT_URL, $api_url);
514
- if ($require_credentials) {
515
- curl_setopt($curl_handle, CURLOPT_USERPWD, $this->credentials);
516
- }
517
- if ($http_method == 'post') {
518
- curl_setopt($curl_handle, CURLOPT_POST, true);
519
- curl_setopt($curl_handle, CURLOPT_POSTFIELDS, http_build_query($options));
520
- }
521
- curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, TRUE);
522
- curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array('Expect:'));
523
- $twitter_data = curl_exec($curl_handle);
524
- $this->http_status = curl_getinfo($curl_handle, CURLINFO_HTTP_CODE);
525
- $this->last_api_call = $api_url;
526
- curl_close($curl_handle);
527
- return $twitter_data;
528
- }
529
-
530
- }
531
-
532
- /**
533
- * TODO: Add TwitterOAuth class
534
- */
535
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/widgethook.php DELETED
@@ -1,18 +0,0 @@
1
- <?php
2
- add_action("plugins_loaded", "wp_insert_register_widgets");
3
-
4
- // Creating the dynamic widgets for the widgets page
5
- function wp_insert_register_widgets() {
6
- //Ad Widgets
7
- if(get_option('wp_insert_ad_widget_1_enable')) { register_sidebar_widget(__('WP-INSERT : Ad Widget - 1'), 'wp_insert_ad_widget_1_create'); }
8
- if(get_option('wp_insert_ad_widget_2_enable')) { register_sidebar_widget(__('WP-INSERT : Ad Widget - 2'), 'wp_insert_ad_widget_2_create'); }
9
- if(get_option('wp_insert_ad_widget_3_enable')) { register_sidebar_widget(__('WP-INSERT : Ad Widget - 3'), 'wp_insert_ad_widget_3_create'); }
10
- if(get_option('wp_insert_ad_widget_4_enable')) { register_sidebar_widget(__('WP-INSERT : Ad Widget - 4'), 'wp_insert_ad_widget_4_create'); }
11
- if(get_option('wp_insert_ad_widget_5_enable')) { register_sidebar_widget(__('WP-INSERT : Ad Widget - 5'), 'wp_insert_ad_widget_5_create'); }
12
- if(get_option('wp_insert_ad_widget_6_enable')) { register_sidebar_widget(__('WP-INSERT : Ad Widget - 6'), 'wp_insert_ad_widget_6_create'); }
13
- if(get_option('wp_insert_ad_widget_7_enable')) { register_sidebar_widget(__('WP-INSERT : Ad Widget - 7'), 'wp_insert_ad_widget_7_create'); }
14
- if(get_option('wp_insert_ad_widget_8_enable')) { register_sidebar_widget(__('WP-INSERT : Ad Widget - 8'), 'wp_insert_ad_widget_8_create'); }
15
- if(get_option('wp_insert_ad_widget_9_enable')) { register_sidebar_widget(__('WP-INSERT : Ad Widget - 9'), 'wp_insert_ad_widget_9_create'); }
16
- if(get_option('wp_insert_ad_widget_10_enable')) { register_sidebar_widget(__('WP-INSERT : Ad Widget - 10'), 'wp_insert_ad_widget_10_create'); }
17
- }
18
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/common.js DELETED
@@ -1,269 +0,0 @@
1
- function wpInsertToggleNotSavedAlert() {
2
- document.getElementById("message").style.display = "block";
3
- jQuery("#message").animate({opacity: 1, height: "100%"}, 1500);
4
- }
5
-
6
- function wpInsertToggleAdWidget(sender, pointerid) {
7
- if(jQuery(sender).attr("value") == "Click to Activate") {
8
- jQuery(pointerid).attr("checked", true);
9
- jQuery(sender).animate({color: "red"}, 1500, "linear", function() { wpInsertToggleNotSavedAlert(); } );
10
- jQuery(sender).attr("value", "Click to Deactivate");
11
- }
12
- else {
13
- jQuery(pointerid).attr("checked", false);
14
- jQuery(sender).animate({color: "#2f9303"}, 1500, "linear", function() { wpInsertToggleNotSavedAlert(); } );
15
- jQuery(sender).attr("value", "Click to Activate");
16
- }
17
- }
18
-
19
- function SwitchAds(adBox0,adBox1,adBox2) {
20
- if(document.getElementById(adBox0).style.display == "block") {
21
- jQuery("#"+adBox0).animate({backgroundColor: "#FFFBCC"}, 500, "linear", function() { jQuery("#"+adBox0).animate({backgroundColor: "#FFFFFF"}, 500, "linear"); } );
22
- }
23
- else {
24
- if(document.getElementById(adBox1).style.display == "block") {
25
- jQuery("#"+adBox1+"_button").animate({color: "red"}, 1500, "linear");
26
- jQuery("#"+adBox0+"_button").animate({color: "#2f9303"}, 1500, "linear");
27
- jQuery("#"+adBox1).animate({height: "0px"}, 500, "linear", function() { document.getElementById(adBox0).style.display = "block";jQuery("#"+adBox0).animate({height: "200px"}, 1000, "linear");document.getElementById(adBox1).style.display = "none"; } );
28
- }
29
- else {
30
- jQuery("#"+adBox2+"_button").animate({color: "red"}, 1500, "linear");
31
- jQuery("#"+adBox0+"_button").animate({color: "#2f9303"}, 1500, "linear");
32
- jQuery("#"+adBox2).animate({height: "0px"}, 500, "linear", function() { document.getElementById(adBox0).style.display = "block";jQuery("#"+adBox0).animate({height: "200px"}, 1000, "linear");document.getElementById(adBox2).style.display = "none"; } );
33
- }
34
- }
35
- }
36
-
37
- /* PopUps */
38
-
39
- //Code to find Y coordinates of any element starts here
40
-
41
- function YPos(obj) {
42
- var curtop = 0;
43
- if (obj.offsetParent) {
44
- while (1) {
45
- curtop += obj.offsetTop;
46
- if (!obj.offsetParent)
47
- break;
48
- obj = obj.offsetParent;
49
- }
50
- }
51
- else if (obj.y) {
52
- curtop += obj.y;
53
- }
54
- return curtop;
55
- }
56
-
57
- //Code to find Y coordinates of any element ends here
58
-
59
- /****************************************/
60
-
61
- //Code to find X coordinates of any element starts here
62
-
63
- function XPos(obj) {
64
- var curtop = 0;
65
- if (obj.offsetParent) {
66
- while (1) {
67
- curtop += obj.offsetLeft;
68
- if (!obj.offsetParent)
69
- break;
70
- obj = obj.offsetParent;
71
- }
72
- }
73
- else if (obj.x) {
74
- curtop += obj.x;
75
- }
76
- return curtop;
77
- }
78
-
79
- //Code to find X coordinates of any element ends here
80
-
81
- //Code to find page Height/Width starts here
82
-
83
- function GetPageHeight() {
84
- if (window.innerHeight && window.scrollMaxY) {// Firefox
85
- yWithScroll = window.innerHeight + window.scrollMaxY;
86
- xWithScroll = window.innerWidth + window.scrollMaxX;
87
- } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
88
- yWithScroll = document.body.scrollHeight;
89
- xWithScroll = document.body.scrollWidth;
90
- } else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
91
- yWithScroll = document.body.offsetHeight;
92
- xWithScroll = document.body.offsetWidth;
93
- }
94
- return yWithScroll;
95
-
96
- }
97
-
98
- function GetPageWidth() {
99
- var IE=document.all;
100
- var iXPos;
101
- if (!IE) {
102
- iXPos = self.innerWidth;
103
- }
104
- else {
105
- iXPos = (document.body.clientWidth);
106
- }
107
- return iXPos;
108
- }
109
-
110
- //Code to find page Height/Width starts here
111
-
112
-
113
- function vIE() {
114
- if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { //test for MSIE x.x;
115
- var ieversion = new Number(RegExp.jQuery1) // capture x.x portion and store as a number
116
- return ieversion;
117
- }
118
- else
119
- return 0; // this is for other browsers
120
- }
121
-
122
- function InitialisePopUP(width, height, ypos, xpos) {
123
-
124
- if (width > 749) { alert('Please Use a smaller value for the Popup (less than 749)'); }
125
- if (height > 540) { alert('Please Use a smaller value for the Popup (less than 540)'); }
126
- jQuery("#popUpMaster").draggable({
127
- containment: ['parent'],
128
- effect: ['fade', 'fade']
129
- });
130
- var top;
131
- var bottom;
132
- var left;
133
- var right;
134
- var contentHeight;
135
- var contentWidth;
136
- left = height - 40;
137
- right = left - 16;
138
- top = width - 24;
139
- bottom = top - 19;
140
- contentWidth = top;
141
- if (vIE()) {
142
- right = left - 16;
143
- contentHeight = height - 44;
144
-
145
- if (vIE() >= 7) {
146
- contentHeight = height - 46;
147
- right = right;
148
- bottom = bottom;
149
- }
150
- }
151
- else if (vIE() == 0) {
152
- contentHeight = height - 45;
153
- right = right;
154
- bottom = bottom;
155
- }
156
- jQuery("#popUpMaster").css('width', width);
157
- jQuery("#popUpMaster").css('height', height);
158
- jQuery("#popUpTop").css('width', top);
159
- jQuery("#popUpLft").css('height', left);
160
- jQuery("#popUpRgt").css('height', right);
161
- jQuery("#popUpBtm").css('width', bottom);
162
- jQuery("#content").css('width', contentWidth);
163
- jQuery("#content").css('height', contentHeight);
164
-
165
- jQuery("#popUpMaster").show();
166
- jQuery("#popUpMaster").css('top', ypos);
167
- jQuery("#popUpMaster").css('left', xpos);
168
-
169
- if (vIE() == 6) {
170
- jQuery('img[@srcjQuery=.png], div#popUpMaster').ifixpng();
171
- }
172
- }
173
-
174
- function GreyOutScreen() {
175
- var divGreyOut = document.createElement("div");
176
- divGreyOut.id = "GreyOut";
177
- divGreyOut.className = "GreyOutLayer";
178
- divGreyOut.style.visibility = "visible";
179
- divGreyOut.style.height = GetPageHeight().toString(10) + "px";
180
- document.body.appendChild(divGreyOut);
181
- }
182
-
183
- function CreatePopUp(headerText, width, height, top, left) {
184
- var divTemp = document.createElement("div");
185
-
186
- divTemp.style.padding = "0";
187
- divTemp.style.zIndex = "103";
188
- divTemp.style.position = "absolute";
189
- divTemp.id = "popUpMaster";
190
-
191
- var headingText = document.createElement("h4");
192
- headingText.innerHTML = headerText;
193
-
194
- var closeButton = document.createElement("a");
195
- closeButton.innerHTML = "&nbsp&nbsp&nbsp&nbsp";
196
- closeButton.href = "javascript:;";
197
- closeButton.className = "closePopUp";
198
- closeButton.onclick = ClosePopup;
199
- closeButton.id = "closeButton";
200
-
201
- var img1 = document.createElement("img");
202
- img1.src ="../wp-content/plugins/wp-insert/images/popUpTopLft.png";
203
- img1.id = "popUpTopLft";
204
-
205
- var img2 = document.createElement("img");
206
- img2.src = "../wp-content/plugins/wp-insert/images/popUpTop.png";
207
- img2.id = "popUpTop";
208
-
209
- var img3 = document.createElement("img");
210
- img3.src = "../wp-content/plugins/wp-insert/images/popUpTopRgt.png";
211
- img3.id = "popUpTopRgt";
212
-
213
- var img4 = document.createElement("img");
214
- img4.src = "../wp-content/plugins/wp-insert/images/popUpLft.png";
215
- img4.id = "popUpLft";
216
-
217
- var img5 = document.createElement("img");
218
- img5.src = "../wp-content/plugins/wp-insert/images/popUpRgt.png";
219
- img5.id = "popUpRgt";
220
-
221
- var img6 = document.createElement("img");
222
- img6.src = "../wp-content/plugins/wp-insert/images/popUpBtmLft.png";
223
- img6.id = "popUpBtmLft";
224
-
225
- var img7 = document.createElement("img");
226
- img7.src = "../wp-content/plugins/wp-insert/images/popUpBtmRgt.png";
227
- img7.id = "popUpBtmRgt";
228
-
229
- var img8 = document.createElement("img");
230
- img8.src = "../wp-content/plugins/wp-insert/images/popUpBtm.png";
231
- img8.id = "popUpBtm";
232
-
233
- var divContentArea = document.createElement("div");
234
- divContentArea.id = "content";
235
-
236
- divTemp.appendChild(headingText);
237
- divTemp.appendChild(closeButton);
238
- divTemp.appendChild(img1);
239
- divTemp.appendChild(img2);
240
- divTemp.appendChild(img3);
241
- divTemp.appendChild(img4);
242
- divTemp.appendChild(img5);
243
- divTemp.appendChild(img6);
244
- divTemp.appendChild(img7);
245
- divTemp.appendChild(img8);
246
- divTemp.appendChild(divContentArea);
247
-
248
-
249
- document.body.appendChild(divTemp);
250
-
251
- try {
252
- InitialisePopUP(width, height, top, left);
253
- }
254
- catch (err) {
255
- }
256
- return divContentArea; ;
257
-
258
- }
259
-
260
- function ClosePopup() {
261
- if (document.getElementById("popUpMaster")) {
262
- document.body.removeChild(document.getElementById("popUpMaster"));
263
- }
264
- if (document.getElementById("GreyOut")) {
265
- document.body.removeChild(document.getElementById("GreyOut"));
266
- }
267
- }
268
-
269
- /* End PopUps */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/jquery.qtip-1.0.0-rc3.min.js DELETED
@@ -1,15 +0,0 @@
1
- /*
2
- * jquery.qtip. The jQuery tooltip plugin
3
- *
4
- * Copyright (c) 2009 Craig Thompson
5
- * http://craigsworks.com
6
- *
7
- * Licensed under MIT
8
- * http://www.opensource.org/licenses/mit-license.php
9
- *
10
- * Launch : February 2009
11
- * Version : 1.0.0-rc3
12
- * Released: Tuesday 12th May, 2009 - 00:00
13
- * Debug: jquery.qtip.debug.js
14
- */
15
- (function(f){f.fn.qtip=function(B,u){var y,t,A,s,x,w,v,z;if(typeof B=="string"){if(typeof f(this).data("qtip")!=="object"){f.fn.qtip.log.error.call(self,1,f.fn.qtip.constants.NO_TOOLTIP_PRESENT,false)}if(B=="api"){return f(this).data("qtip").interfaces[f(this).data("qtip").current]}else{if(B=="interfaces"){return f(this).data("qtip").interfaces}}}else{if(!B){B={}}if(typeof B.content!=="object"||(B.content.jquery&&B.content.length>0)){B.content={text:B.content}}if(typeof B.content.title!=="object"){B.content.title={text:B.content.title}}if(typeof B.position!=="object"){B.position={corner:B.position}}if(typeof B.position.corner!=="object"){B.position.corner={target:B.position.corner,tooltip:B.position.corner}}if(typeof B.show!=="object"){B.show={when:B.show}}if(typeof B.show.when!=="object"){B.show.when={event:B.show.when}}if(typeof B.show.effect!=="object"){B.show.effect={type:B.show.effect}}if(typeof B.hide!=="object"){B.hide={when:B.hide}}if(typeof B.hide.when!=="object"){B.hide.when={event:B.hide.when}}if(typeof B.hide.effect!=="object"){B.hide.effect={type:B.hide.effect}}if(typeof B.style!=="object"){B.style={name:B.style}}B.style=c(B.style);s=f.extend(true,{},f.fn.qtip.defaults,B);s.style=a.call({options:s},s.style);s.user=f.extend(true,{},B)}return f(this).each(function(){if(typeof B=="string"){w=B.toLowerCase();A=f(this).qtip("interfaces");if(typeof A=="object"){if(u===true&&w=="destroy"){while(A.length>0){A[A.length-1].destroy()}}else{if(u!==true){A=[f(this).qtip("api")]}for(y=0;y<A.length;y++){if(w=="destroy"){A[y].destroy()}else{if(A[y].status.rendered===true){if(w=="show"){A[y].show()}else{if(w=="hide"){A[y].hide()}else{if(w=="focus"){A[y].focus()}else{if(w=="disable"){A[y].disable(true)}else{if(w=="enable"){A[y].disable(false)}}}}}}}}}}}else{v=f.extend(true,{},s);v.hide.effect.length=s.hide.effect.length;v.show.effect.length=s.show.effect.length;if(v.position.container===false){v.position.container=f(document.body)}if(v.position.target===false){v.position.target=f(this)}if(v.show.when.target===false){v.show.when.target=f(this)}if(v.hide.when.target===false){v.hide.when.target=f(this)}t=f.fn.qtip.interfaces.length;for(y=0;y<t;y++){if(typeof f.fn.qtip.interfaces[y]=="undefined"){t=y;break}}x=new d(f(this),v,t);f.fn.qtip.interfaces[t]=x;if(typeof f(this).data("qtip")=="object"){if(typeof f(this).attr("qtip")==="undefined"){f(this).data("qtip").current=f(this).data("qtip").interfaces.length}f(this).data("qtip").interfaces.push(x)}else{f(this).data("qtip",{current:0,interfaces:[x]})}if(v.content.prerender===false&&v.show.when.event!==false&&v.show.ready!==true){v.show.when.target.bind(v.show.when.event+".qtip-"+t+"-create",{qtip:t},function(C){z=f.fn.qtip.interfaces[C.data.qtip];z.options.show.when.target.unbind(z.options.show.when.event+".qtip-"+C.data.qtip+"-create");z.cache.mouse={x:C.pageX,y:C.pageY};p.call(z);z.options.show.when.target.trigger(z.options.show.when.event)})}else{x.cache.mouse={x:v.show.when.target.offset().left,y:v.show.when.target.offset().top};p.call(x)}}})};function d(u,t,v){var s=this;s.id=v;s.options=t;s.status={animated:false,rendered:false,disabled:false,focused:false};s.elements={target:u.addClass(s.options.style.classes.target),tooltip:null,wrapper:null,content:null,contentWrapper:null,title:null,button:null,tip:null,bgiframe:null};s.cache={mouse:{},position:{},toggle:0};s.timers={};f.extend(s,s.options.api,{show:function(y){var x,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"show")}if(s.elements.tooltip.css("display")!=="none"){return s}s.elements.tooltip.stop(true,false);x=s.beforeShow.call(s,y);if(x===false){return s}function w(){if(s.options.position.type!=="static"){s.focus()}s.onShow.call(s,y);if(f.browser.msie){s.elements.tooltip.get(0).style.removeAttribute("filter")}}s.cache.toggle=1;if(s.options.position.type!=="static"){s.updatePosition(y,(s.options.show.effect.length>0))}if(typeof s.options.show.solo=="object"){z=f(s.options.show.solo)}else{if(s.options.show.solo===true){z=f("div.qtip").not(s.elements.tooltip)}}if(z){z.each(function(){if(f(this).qtip("api").status.rendered===true){f(this).qtip("api").hide()}})}if(typeof s.options.show.effect.type=="function"){s.options.show.effect.type.call(s.elements.tooltip,s.options.show.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.show.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeIn(s.options.show.effect.length,w);break;case"slide":s.elements.tooltip.slideDown(s.options.show.effect.length,function(){w();if(s.options.position.type!=="static"){s.updatePosition(y,true)}});break;case"grow":s.elements.tooltip.show(s.options.show.effect.length,w);break;default:s.elements.tooltip.show(null,w);break}s.elements.tooltip.addClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_SHOWN,"show")},hide:function(y){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"hide")}else{if(s.elements.tooltip.css("display")==="none"){return s}}clearTimeout(s.timers.show);s.elements.tooltip.stop(true,false);x=s.beforeHide.call(s,y);if(x===false){return s}function w(){s.onHide.call(s,y)}s.cache.toggle=0;if(typeof s.options.hide.effect.type=="function"){s.options.hide.effect.type.call(s.elements.tooltip,s.options.hide.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.hide.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeOut(s.options.hide.effect.length,w);break;case"slide":s.elements.tooltip.slideUp(s.options.hide.effect.length,w);break;case"grow":s.elements.tooltip.hide(s.options.hide.effect.length,w);break;default:s.elements.tooltip.hide(null,w);break}s.elements.tooltip.removeClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_HIDDEN,"hide")},updatePosition:function(w,x){var C,G,L,J,H,E,y,I,B,D,K,A,F,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updatePosition")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_POSITION_STATIC,"updatePosition")}}G={position:{left:0,top:0},dimensions:{height:0,width:0},corner:s.options.position.corner.target};L={position:s.getPosition(),dimensions:s.getDimensions(),corner:s.options.position.corner.tooltip};if(s.options.position.target!=="mouse"){if(s.options.position.target.get(0).nodeName.toLowerCase()=="area"){J=s.options.position.target.attr("coords").split(",");for(C=0;C<J.length;C++){J[C]=parseInt(J[C])}H=s.options.position.target.parent("map").attr("name");E=f('img[usemap="#'+H+'"]:first').offset();G.position={left:Math.floor(E.left+J[0]),top:Math.floor(E.top+J[1])};switch(s.options.position.target.attr("shape").toLowerCase()){case"rect":G.dimensions={width:Math.ceil(Math.abs(J[2]-J[0])),height:Math.ceil(Math.abs(J[3]-J[1]))};break;case"circle":G.dimensions={width:J[2]+1,height:J[2]+1};break;case"poly":G.dimensions={width:J[0],height:J[1]};for(C=0;C<J.length;C++){if(C%2==0){if(J[C]>G.dimensions.width){G.dimensions.width=J[C]}if(J[C]<J[0]){G.position.left=Math.floor(E.left+J[C])}}else{if(J[C]>G.dimensions.height){G.dimensions.height=J[C]}if(J[C]<J[1]){G.position.top=Math.floor(E.top+J[C])}}}G.dimensions.width=G.dimensions.width-(G.position.left-E.left);G.dimensions.height=G.dimensions.height-(G.position.top-E.top);break;default:return f.fn.qtip.log.error.call(s,4,f.fn.qtip.constants.INVALID_AREA_SHAPE,"updatePosition");break}G.dimensions.width-=2;G.dimensions.height-=2}else{if(s.options.position.target.add(document.body).length===1){G.position={left:f(document).scrollLeft(),top:f(document).scrollTop()};G.dimensions={height:f(window).height(),width:f(window).width()}}else{if(typeof s.options.position.target.attr("qtip")!=="undefined"){G.position=s.options.position.target.qtip("api").cache.position}else{G.position=s.options.position.target.offset()}G.dimensions={height:s.options.position.target.outerHeight(),width:s.options.position.target.outerWidth()}}}y=f.extend({},G.position);if(G.corner.search(/right/i)!==-1){y.left+=G.dimensions.width}if(G.corner.search(/bottom/i)!==-1){y.top+=G.dimensions.height}if(G.corner.search(/((top|bottom)Middle)|center/)!==-1){y.left+=(G.dimensions.width/2)}if(G.corner.search(/((left|right)Middle)|center/)!==-1){y.top+=(G.dimensions.height/2)}}else{G.position=y={left:s.cache.mouse.x,top:s.cache.mouse.y};G.dimensions={height:1,width:1}}if(L.corner.search(/right/i)!==-1){y.left-=L.dimensions.width}if(L.corner.search(/bottom/i)!==-1){y.top-=L.dimensions.height}if(L.corner.search(/((top|bottom)Middle)|center/)!==-1){y.left-=(L.dimensions.width/2)}if(L.corner.search(/((left|right)Middle)|center/)!==-1){y.top-=(L.dimensions.height/2)}I=(f.browser.msie)?1:0;B=(f.browser.msie&&parseInt(f.browser.version.charAt(0))===6)?1:0;if(s.options.style.border.radius>0){if(L.corner.search(/Left/)!==-1){y.left-=s.options.style.border.radius}else{if(L.corner.search(/Right/)!==-1){y.left+=s.options.style.border.radius}}if(L.corner.search(/Top/)!==-1){y.top-=s.options.style.border.radius}else{if(L.corner.search(/Bottom/)!==-1){y.top+=s.options.style.border.radius}}}if(I){if(L.corner.search(/top/)!==-1){y.top-=I}else{if(L.corner.search(/bottom/)!==-1){y.top+=I}}if(L.corner.search(/left/)!==-1){y.left-=I}else{if(L.corner.search(/right/)!==-1){y.left+=I}}if(L.corner.search(/leftMiddle|rightMiddle/)!==-1){y.top-=1}}if(s.options.position.adjust.screen===true){y=o.call(s,y,G,L)}if(s.options.position.target==="mouse"&&s.options.position.adjust.mouse===true){if(s.options.position.adjust.screen===true&&s.elements.tip){K=s.elements.tip.attr("rel")}else{K=s.options.position.corner.tooltip}y.left+=(K.search(/right/i)!==-1)?-6:6;y.top+=(K.search(/bottom/i)!==-1)?-6:6}if(!s.elements.bgiframe&&f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){f("select, object").each(function(){A=f(this).offset();A.bottom=A.top+f(this).height();A.right=A.left+f(this).width();if(y.top+L.dimensions.height>=A.top&&y.left+L.dimensions.width>=A.left){k.call(s)}})}y.left+=s.options.position.adjust.x;y.top+=s.options.position.adjust.y;F=s.getPosition();if(y.left!=F.left||y.top!=F.top){z=s.beforePositionUpdate.call(s,w);if(z===false){return s}s.cache.position=y;if(x===true){s.status.animated=true;s.elements.tooltip.animate(y,200,"swing",function(){s.status.animated=false})}else{s.elements.tooltip.css(y)}s.onPositionUpdate.call(s,w);if(typeof w!=="undefined"&&w.type&&w.type!=="mousemove"){f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_POSITION_UPDATED,"updatePosition")}}return s},updateWidth:function(w){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateWidth")}else{if(w&&typeof w!=="number"){return f.fn.qtip.log.error.call(s,2,"newWidth must be of type number","updateWidth")}}x=s.elements.contentWrapper.siblings().add(s.elements.tip).add(s.elements.button);if(!w){if(typeof s.options.style.width.value=="number"){w=s.options.style.width.value}else{s.elements.tooltip.css({width:"auto"});x.hide();if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"normal"})}w=s.getDimensions().width+1;if(!s.options.style.width.value){if(w>s.options.style.width.max){w=s.options.style.width.max}if(w<s.options.style.width.min){w=s.options.style.width.min}}}}if(w%2!==0){w-=1}s.elements.tooltip.width(w);x.show();if(s.options.style.border.radius){s.elements.tooltip.find(".qtip-betweenCorners").each(function(y){f(this).width(w-(s.options.style.border.radius*2))})}if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"1"});s.elements.wrapper.width(w);if(s.elements.bgiframe){s.elements.bgiframe.width(w).height(s.getDimensions.height)}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_WIDTH_UPDATED,"updateWidth")},updateStyle:function(w){var z,A,x,y,B;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateStyle")}else{if(typeof w!=="string"||!f.fn.qtip.styles[w]){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.STYLE_NOT_DEFINED,"updateStyle")}}s.options.style=a.call(s,f.fn.qtip.styles[w],s.options.user.style);s.elements.content.css(q(s.options.style));if(s.options.content.title.text!==false){s.elements.title.css(q(s.options.style.title,true))}s.elements.contentWrapper.css({borderColor:s.options.style.border.color});if(s.options.style.tip.corner!==false){if(f("<canvas>").get(0).getContext){z=s.elements.tooltip.find(".qtip-tip canvas:first");x=z.get(0).getContext("2d");x.clearRect(0,0,300,300);y=z.parent("div[rel]:first").attr("rel");B=b(y,s.options.style.tip.size.width,s.options.style.tip.size.height);h.call(s,z,B,s.options.style.tip.color||s.options.style.border.color)}else{if(f.browser.msie){z=s.elements.tooltip.find('.qtip-tip [nodeName="shape"]');z.attr("fillcolor",s.options.style.tip.color||s.options.style.border.color)}}}if(s.options.style.border.radius>0){s.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:s.options.style.border.color});if(f("<canvas>").get(0).getContext){A=g(s.options.style.border.radius);s.elements.tooltip.find(".qtip-wrapper canvas").each(function(){x=f(this).get(0).getContext("2d");x.clearRect(0,0,300,300);y=f(this).parent("div[rel]:first").attr("rel");r.call(s,f(this),A[y],s.options.style.border.radius,s.options.style.border.color)})}else{if(f.browser.msie){s.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function(){f(this).attr("fillcolor",s.options.style.border.color)})}}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_STYLE_UPDATED,"updateStyle")},updateContent:function(A,y){var z,x,w;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateContent")}else{if(!A){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateContent")}}z=s.beforeContentUpdate.call(s,A);if(typeof z=="string"){A=z}else{if(z===false){return}}if(f.browser.msie){s.elements.contentWrapper.children().css({zoom:"normal"})}if(A.jquery&&A.length>0){A.clone(true).appendTo(s.elements.content).show()}else{s.elements.content.html(A)}x=s.elements.content.find("img[complete=false]");if(x.length>0){w=0;x.each(function(C){f('<img src="'+f(this).attr("src")+'" />').load(function(){if(++w==x.length){B()}})})}else{B()}function B(){s.updateWidth();if(y!==false){if(s.options.position.type!=="static"){s.updatePosition(s.elements.tooltip.is(":visible"),true)}if(s.options.style.tip.corner!==false){n.call(s)}}}s.onContentUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_UPDATED,"loadContent")},loadContent:function(w,z,A){var y;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"loadContent")}y=s.beforeContentLoad.call(s);if(y===false){return s}if(A=="post"){f.post(w,z,x)}else{f.get(w,z,x)}function x(B){s.onContentLoad.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_LOADED,"loadContent");s.updateContent(B)}return s},updateTitle:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateTitle")}else{if(!w){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateTitle")}}returned=s.beforeTitleUpdate.call(s);if(returned===false){return s}if(s.elements.button){s.elements.button=s.elements.button.clone(true)}s.elements.title.html(w);if(s.elements.button){s.elements.title.prepend(s.elements.button)}s.onTitleUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_TITLE_UPDATED,"updateTitle")},focus:function(A){var y,x,w,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"focus")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_FOCUS_STATIC,"focus")}}y=parseInt(s.elements.tooltip.css("z-index"));x=6000+f("div.qtip[qtip]").length-1;if(!s.status.focused&&y!==x){z=s.beforeFocus.call(s,A);if(z===false){return s}f("div.qtip[qtip]").not(s.elements.tooltip).each(function(){if(f(this).qtip("api").status.rendered===true){w=parseInt(f(this).css("z-index"));if(typeof w=="number"&&w>-1){f(this).css({zIndex:parseInt(f(this).css("z-index"))-1})}f(this).qtip("api").status.focused=false}});s.elements.tooltip.css({zIndex:x});s.status.focused=true;s.onFocus.call(s,A);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_FOCUSED,"focus")}return s},disable:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"disable")}if(w){if(!s.status.disabled){s.status.disabled=true;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DISABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED,"disable")}}else{if(s.status.disabled){s.status.disabled=false;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_ENABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED,"disable")}}return s},destroy:function(){var w,x,y;x=s.beforeDestroy.call(s);if(x===false){return s}if(s.status.rendered){s.options.show.when.target.unbind("mousemove.qtip",s.updatePosition);s.options.show.when.target.unbind("mouseout.qtip",s.hide);s.options.show.when.target.unbind(s.options.show.when.event+".qtip");s.options.hide.when.target.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind("mouseover.qtip",s.focus);s.elements.tooltip.remove()}else{s.options.show.when.target.unbind(s.options.show.when.event+".qtip-create")}if(typeof s.elements.target.data("qtip")=="object"){y=s.elements.target.data("qtip").interfaces;if(typeof y=="object"&&y.length>0){for(w=0;w<y.length-1;w++){if(y[w].id==s.id){y.splice(w,1)}}}}delete f.fn.qtip.interfaces[s.id];if(typeof y=="object"&&y.length>0){s.elements.target.data("qtip").current=y.length-1}else{s.elements.target.removeData("qtip")}s.onDestroy.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DESTROYED,"destroy");return s.elements.target},getPosition:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getPosition")}w=(s.elements.tooltip.css("display")!=="none")?false:true;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x=s.elements.tooltip.offset();if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x},getDimensions:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getDimensions")}w=(!s.elements.tooltip.is(":visible"))?true:false;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x={height:s.elements.tooltip.outerHeight(),width:s.elements.tooltip.outerWidth()};if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x}})}function p(){var s,w,u,t,v,y,x;s=this;s.beforeRender.call(s);s.status.rendered=true;s.elements.tooltip='<div qtip="'+s.id+'" class="qtip '+(s.options.style.classes.tooltip||s.options.style)+'"style="display:none; -moz-border-radius:0; -webkit-border-radius:0; border-radius:0;position:'+s.options.position.type+';"> <div class="qtip-wrapper" style="position:relative; overflow:hidden; text-align:left;"> <div class="qtip-contentWrapper" style="overflow:hidden;"> <div class="qtip-content '+s.options.style.classes.content+'"></div></div></div></div>';s.elements.tooltip=f(s.elements.tooltip);s.elements.tooltip.appendTo(s.options.position.container);s.elements.tooltip.data("qtip",{current:0,interfaces:[s]});s.elements.wrapper=s.elements.tooltip.children("div:first");s.elements.contentWrapper=s.elements.wrapper.children("div:first").css({background:s.options.style.background});s.elements.content=s.elements.contentWrapper.children("div:first").css(q(s.options.style));if(f.browser.msie){s.elements.wrapper.add(s.elements.content).css({zoom:1})}if(s.options.hide.when.event=="unfocus"){s.elements.tooltip.attr("unfocus",true)}if(typeof s.options.style.width.value=="number"){s.updateWidth()}if(f("<canvas>").get(0).getContext||f.browser.msie){if(s.options.style.border.radius>0){m.call(s)}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color})}if(s.options.style.tip.corner!==false){e.call(s)}}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color});s.options.style.border.radius=0;s.options.style.tip.corner=false;f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED,"render")}if((typeof s.options.content.text=="string"&&s.options.content.text.length>0)||(s.options.content.text.jquery&&s.options.content.text.length>0)){u=s.options.content.text}else{if(typeof s.elements.target.attr("title")=="string"&&s.elements.target.attr("title").length>0){u=s.elements.target.attr("title").replace("\\n","<br />");s.elements.target.attr("title","")}else{if(typeof s.elements.target.attr("alt")=="string"&&s.elements.target.attr("alt").length>0){u=s.elements.target.attr("alt").replace("\\n","<br />");s.elements.target.attr("alt","")}else{u=" ";f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.NO_VALID_CONTENT,"render")}}}if(s.options.content.title.text!==false){j.call(s)}s.updateContent(u);l.call(s);if(s.options.show.ready===true){s.show()}if(s.options.content.url!==false){t=s.options.content.url;v=s.options.content.data;y=s.options.content.method||"get";s.loadContent(t,v,y)}s.onRender.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_RENDERED,"render")}function m(){var F,z,t,B,x,E,u,G,D,y,w,C,A,s,v;F=this;F.elements.wrapper.find(".qtip-borderBottom, .qtip-borderTop").remove();t=F.options.style.border.width;B=F.options.style.border.radius;x=F.options.style.border.color||F.options.style.tip.color;E=g(B);u={};for(z in E){u[z]='<div rel="'+z+'" style="'+((z.search(/Left/)!==-1)?"left":"right")+":0; position:absolute; height:"+B+"px; width:"+B+'px; overflow:hidden; line-height:0.1px; font-size:1px">';if(f("<canvas>").get(0).getContext){u[z]+='<canvas height="'+B+'" width="'+B+'" style="vertical-align: top"></canvas>'}else{if(f.browser.msie){G=B*2+3;u[z]+='<v:arc stroked="false" fillcolor="'+x+'" startangle="'+E[z][0]+'" endangle="'+E[z][1]+'" style="width:'+G+"px; height:"+G+"px; margin-top:"+((z.search(/bottom/)!==-1)?-2:-1)+"px; margin-left:"+((z.search(/Right/)!==-1)?E[z][2]-3.5:-1)+'px; vertical-align:top; display:inline-block; behavior:url(#default#VML)"></v:arc>'}}u[z]+="</div>"}D=F.getDimensions().width-(Math.max(t,B)*2);y='<div class="qtip-betweenCorners" style="height:'+B+"px; width:"+D+"px; overflow:hidden; background-color:"+x+'; line-height:0.1px; font-size:1px;">';w='<div class="qtip-borderTop" dir="ltr" style="height:'+B+"px; margin-left:"+B+'px; line-height:0.1px; font-size:1px; padding:0;">'+u.topLeft+u.topRight+y;F.elements.wrapper.prepend(w);C='<div class="qtip-borderBottom" dir="ltr" style="height:'+B+"px; margin-left:"+B+'px; line-height:0.1px; font-size:1px; padding:0;">'+u.bottomLeft+u.bottomRight+y;F.elements.wrapper.append(C);if(f("<canvas>").get(0).getContext){F.elements.wrapper.find("canvas").each(function(){A=E[f(this).parent("[rel]:first").attr("rel")];r.call(F,f(this),A,B,x)})}else{if(f.browser.msie){F.elements.tooltip.append('<v:image style="behavior:url(#default#VML);"></v:image>')}}s=Math.max(B,(B+(t-B)));v=Math.max(t-B,0);F.elements.contentWrapper.css({border:"0px solid "+x,borderWidth:v+"px "+s+"px"})}function r(u,w,s,t){var v=u.get(0).getContext("2d");v.fillStyle=t;v.beginPath();v.arc(w[0],w[1],s,0,Math.PI*2,false);v.fill()}function e(v){var t,s,x,u,w;t=this;if(t.elements.tip!==null){t.elements.tip.remove()}s=t.options.style.tip.color||t.options.style.border.color;if(t.options.style.tip.corner===false){return}else{if(!v){v=t.options.style.tip.corner}}x=b(v,t.options.style.tip.size.width,t.options.style.tip.size.height);t.elements.tip='<div class="'+t.options.style.classes.tip+'" dir="ltr" rel="'+v+'" style="position:absolute; height:'+t.options.style.tip.size.height+"px; width:"+t.options.style.tip.size.width+'px; margin:0 auto; line-height:0.1px; font-size:1px;">';if(f("<canvas>").get(0).getContext){t.elements.tip+='<canvas height="'+t.options.style.tip.size.height+'" width="'+t.options.style.tip.size.width+'"></canvas>'}else{if(f.browser.msie){u=t.options.style.tip.size.width+","+t.options.style.tip.size.height;w="m"+x[0][0]+","+x[0][1];w+=" l"+x[1][0]+","+x[1][1];w+=" "+x[2][0]+","+x[2][1];w+=" xe";t.elements.tip+='<v:shape fillcolor="'+s+'" stroked="false" filled="true" path="'+w+'" coordsize="'+u+'" style="width:'+t.options.style.tip.size.width+"px; height:"+t.options.style.tip.size.height+"px; line-height:0.1px; display:inline-block; behavior:url(#default#VML); vertical-align:"+((v.search(/top/)!==-1)?"bottom":"top")+'"></v:shape>';t.elements.tip+='<v:image style="behavior:url(#default#VML);"></v:image>';t.elements.contentWrapper.css("position","relative")}}t.elements.tooltip.prepend(t.elements.tip+"</div>");t.elements.tip=t.elements.tooltip.find("."+t.options.style.classes.tip).eq(0);if(f("<canvas>").get(0).getContext){h.call(t,t.elements.tip.find("canvas:first"),x,s)}if(v.search(/top/)!==-1&&f.browser.msie&&parseInt(f.browser.version.charAt(0))===6){t.elements.tip.css({marginTop:-4})}n.call(t,v)}function h(t,v,s){var u=t.get(0).getContext("2d");u.fillStyle=s;u.beginPath();u.moveTo(v[0][0],v[0][1]);u.lineTo(v[1][0],v[1][1]);u.lineTo(v[2][0],v[2][1]);u.fill()}function n(u){var t,w,s,x,v;t=this;if(t.options.style.tip.corner===false||!t.elements.tip){return}if(!u){u=t.elements.tip.attr("rel")}w=positionAdjust=(f.browser.msie)?1:0;t.elements.tip.css(u.match(/left|right|top|bottom/)[0],0);if(u.search(/top|bottom/)!==-1){if(f.browser.msie){if(parseInt(f.browser.version.charAt(0))===6){positionAdjust=(u.search(/top/)!==-1)?-3:1}else{positionAdjust=(u.search(/top/)!==-1)?1:2}}if(u.search(/Middle/)!==-1){t.elements.tip.css({left:"50%",marginLeft:-(t.options.style.tip.size.width/2)})}else{if(u.search(/Left/)!==-1){t.elements.tip.css({left:t.options.style.border.radius-w})}else{if(u.search(/Right/)!==-1){t.elements.tip.css({right:t.options.style.border.radius+w})}}}if(u.search(/top/)!==-1){t.elements.tip.css({top:-positionAdjust})}else{t.elements.tip.css({bottom:positionAdjust})}}else{if(u.search(/left|right/)!==-1){if(f.browser.msie){positionAdjust=(parseInt(f.browser.version.charAt(0))===6)?1:((u.search(/left/)!==-1)?1:2)}if(u.search(/Middle/)!==-1){t.elements.tip.css({top:"50%",marginTop:-(t.options.style.tip.size.height/2)})}else{if(u.search(/Top/)!==-1){t.elements.tip.css({top:t.options.style.border.radius-w})}else{if(u.search(/Bottom/)!==-1){t.elements.tip.css({bottom:t.options.style.border.radius+w})}}}if(u.search(/left/)!==-1){t.elements.tip.css({left:-positionAdjust})}else{t.elements.tip.css({right:positionAdjust})}}}s="padding-"+u.match(/left|right|top|bottom/)[0];x=t.options.style.tip.size[(s.search(/left|right/)!==-1)?"width":"height"];t.elements.tooltip.css("padding",0);t.elements.tooltip.css(s,x);if(f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){v=parseInt(t.elements.tip.css("margin-top"))||0;v+=parseInt(t.elements.content.css("margin-top"))||0;t.elements.tip.css({marginTop:v})}}function j(){var s=this;if(s.elements.title!==null){s.elements.title.remove()}s.elements.title=f('<div class="'+s.options.style.classes.title+'">').css(q(s.options.style.title,true)).css({zoom:(f.browser.msie)?1:0}).prependTo(s.elements.contentWrapper);if(s.options.content.title.text){s.updateTitle.call(s,s.options.content.title.text)}if(s.options.content.title.button!==false&&typeof s.options.content.title.button=="string"){s.elements.button=f('<a class="'+s.options.style.classes.button+'" style="float:right; position: relative"></a>').css(q(s.options.style.button,true)).html(s.options.content.title.button).prependTo(s.elements.title).click(function(t){if(!s.status.disabled){s.hide(t)}})}}function l(){var t,v,u,s;t=this;v=t.options.show.when.target;u=t.options.hide.when.target;if(t.options.hide.fixed){u=u.add(t.elements.tooltip)}if(t.options.hide.when.event=="inactive"){s=["click","dblclick","mousedown","mouseup","mousemove","mouseout","mouseenter","mouseleave","mouseover"];function y(z){if(t.status.disabled===true){return}clearTimeout(t.timers.inactive);t.timers.inactive=setTimeout(function(){f(s).each(function(){u.unbind(this+".qtip-inactive");t.elements.content.unbind(this+".qtip-inactive")});t.hide(z)},t.options.hide.delay)}}else{if(t.options.hide.fixed===true){t.elements.tooltip.bind("mouseover.qtip",function(){if(t.status.disabled===true){return}clearTimeout(t.timers.hide)})}}function x(z){if(t.status.disabled===true){return}if(t.options.hide.when.event=="inactive"){f(s).each(function(){u.bind(this+".qtip-inactive",y);t.elements.content.bind(this+".qtip-inactive",y)});y()}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.timers.show=setTimeout(function(){t.show(z)},t.options.show.delay)}function w(z){if(t.status.disabled===true){return}if(t.options.hide.fixed===true&&t.options.hide.when.event.search(/mouse(out|leave)/i)!==-1&&f(z.relatedTarget).parents("div.qtip[qtip]").length>0){z.stopPropagation();z.preventDefault();clearTimeout(t.timers.hide);return false}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.elements.tooltip.stop(true,true);t.timers.hide=setTimeout(function(){t.hide(z)},t.options.hide.delay)}if((t.options.show.when.target.add(t.options.hide.when.target).length===1&&t.options.show.when.event==t.options.hide.when.event&&t.options.hide.when.event!=="inactive")||t.options.hide.when.event=="unfocus"){t.cache.toggle=0;v.bind(t.options.show.when.event+".qtip",function(z){if(t.cache.toggle==0){x(z)}else{w(z)}})}else{v.bind(t.options.show.when.event+".qtip",x);if(t.options.hide.when.event!=="inactive"){u.bind(t.options.hide.when.event+".qtip",w)}}if(t.options.position.type.search(/(fixed|absolute)/)!==-1){t.elements.tooltip.bind("mouseover.qtip",t.focus)}if(t.options.position.target==="mouse"&&t.options.position.type!=="static"){v.bind("mousemove.qtip",function(z){t.cache.mouse={x:z.pageX,y:z.pageY};if(t.status.disabled===false&&t.options.position.adjust.mouse===true&&t.options.position.type!=="static"&&t.elements.tooltip.css("display")!=="none"){t.updatePosition(z)}})}}function o(u,v,A){var z,s,x,y,t,w;z=this;if(A.corner=="center"){return v.position}s=f.extend({},u);y={x:false,y:false};t={left:(s.left<f.fn.qtip.cache.screen.scroll.left),right:(s.left+A.dimensions.width+2>=f.fn.qtip.cache.screen.width+f.fn.qtip.cache.screen.scroll.left),top:(s.top<f.fn.qtip.cache.screen.scroll.top),bottom:(s.top+A.dimensions.height+2>=f.fn.qtip.cache.screen.height+f.fn.qtip.cache.screen.scroll.top)};x={left:(t.left&&(A.corner.search(/right/i)!=-1||(A.corner.search(/right/i)==-1&&!t.right))),right:(t.right&&(A.corner.search(/left/i)!=-1||(A.corner.search(/left/i)==-1&&!t.left))),top:(t.top&&A.corner.search(/top/i)==-1),bottom:(t.bottom&&A.corner.search(/bottom/i)==-1)};if(x.left){if(z.options.position.target!=="mouse"){s.left=v.position.left+v.dimensions.width}else{s.left=z.cache.mouse.x}y.x="Left"}else{if(x.right){if(z.options.position.target!=="mouse"){s.left=v.position.left-A.dimensions.width}else{s.left=z.cache.mouse.x-A.dimensions.width}y.x="Right"}}if(x.top){if(z.options.position.target!=="mouse"){s.top=v.position.top+v.dimensions.height}else{s.top=z.cache.mouse.y}y.y="top"}else{if(x.bottom){if(z.options.position.target!=="mouse"){s.top=v.position.top-A.dimensions.height}else{s.top=z.cache.mouse.y-A.dimensions.height}y.y="bottom"}}if(s.left<0){s.left=u.left;y.x=false}if(s.top<0){s.top=u.top;y.y=false}if(z.options.style.tip.corner!==false){s.corner=new String(A.corner);if(y.x!==false){s.corner=s.corner.replace(/Left|Right|Middle/,y.x)}if(y.y!==false){s.corner=s.corner.replace(/top|bottom/,y.y)}if(s.corner!==z.elements.tip.attr("rel")){e.call(z,s.corner)}}return s}function q(u,t){var v,s;v=f.extend(true,{},u);for(s in v){if(t===true&&s.search(/(tip|classes)/i)!==-1){delete v[s]}else{if(!t&&s.search(/(width|border|tip|title|classes|user)/i)!==-1){delete v[s]}}}return v}function c(s){if(typeof s.tip!=="object"){s.tip={corner:s.tip}}if(typeof s.tip.size!=="object"){s.tip.size={width:s.tip.size,height:s.tip.size}}if(typeof s.border!=="object"){s.border={width:s.border}}if(typeof s.width!=="object"){s.width={value:s.width}}if(typeof s.width.max=="string"){s.width.max=parseInt(s.width.max.replace(/([0-9]+)/i,"$1"))}if(typeof s.width.min=="string"){s.width.min=parseInt(s.width.min.replace(/([0-9]+)/i,"$1"))}if(typeof s.tip.size.x=="number"){s.tip.size.width=s.tip.size.x;delete s.tip.size.x}if(typeof s.tip.size.y=="number"){s.tip.size.height=s.tip.size.y;delete s.tip.size.y}return s}function a(){var s,t,u,x,v,w;s=this;u=[true,{}];for(t=0;t<arguments.length;t++){u.push(arguments[t])}x=[f.extend.apply(f,u)];while(typeof x[0].name=="string"){x.unshift(c(f.fn.qtip.styles[x[0].name]))}x.unshift(true,{classes:{tooltip:"qtip-"+(arguments[0].name||"defaults")}},f.fn.qtip.styles.defaults);v=f.extend.apply(f,x);w=(f.browser.msie)?1:0;v.tip.size.width+=w;v.tip.size.height+=w;if(v.tip.size.width%2>0){v.tip.size.width+=1}if(v.tip.size.height%2>0){v.tip.size.height+=1}if(v.tip.corner===true){v.tip.corner=(s.options.position.corner.tooltip==="center")?false:s.options.position.corner.tooltip}return v}function b(v,u,t){var s={bottomRight:[[0,0],[u,t],[u,0]],bottomLeft:[[0,0],[u,0],[0,t]],topRight:[[0,t],[u,0],[u,t]],topLeft:[[0,0],[0,t],[u,t]],topMiddle:[[0,t],[u/2,0],[u,t]],bottomMiddle:[[0,0],[u,0],[u/2,t]],rightMiddle:[[0,0],[u,t/2],[0,t]],leftMiddle:[[u,0],[u,t],[0,t/2]]};s.leftTop=s.bottomRight;s.rightTop=s.bottomLeft;s.leftBottom=s.topRight;s.rightBottom=s.topLeft;return s[v]}function g(s){var t;if(f("<canvas>").get(0).getContext){t={topLeft:[s,s],topRight:[0,s],bottomLeft:[s,0],bottomRight:[0,0]}}else{if(f.browser.msie){t={topLeft:[-90,90,0],topRight:[-90,90,-s],bottomLeft:[90,270,0],bottomRight:[90,270,-s]}}}return t}function k(){var s,t,u;s=this;u=s.getDimensions();t='<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:false" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=\'0\'); border: 1px solid red; height:'+u.height+"px; width:"+u.width+'px" />';s.elements.bgiframe=s.elements.wrapper.prepend(t).children(".qtip-bgiframe:first")}f(document).ready(function(){f.fn.qtip.cache={screen:{scroll:{left:f(window).scrollLeft(),top:f(window).scrollTop()},width:f(window).width(),height:f(window).height()}};var s;f(window).bind("resize scroll",function(t){clearTimeout(s);s=setTimeout(function(){if(t.type==="scroll"){f.fn.qtip.cache.screen.scroll={left:f(window).scrollLeft(),top:f(window).scrollTop()}}else{f.fn.qtip.cache.screen.width=f(window).width();f.fn.qtip.cache.screen.height=f(window).height()}for(i=0;i<f.fn.qtip.interfaces.length;i++){var u=f.fn.qtip.interfaces[i];if(u.status.rendered===true&&(u.options.position.type!=="static"||u.options.position.adjust.scroll&&t.type==="scroll"||u.options.position.adjust.resize&&t.type==="resize")){u.updatePosition(t,true)}}},100)});f(document).bind("mousedown.qtip",function(t){if(f(t.target).parents("div.qtip").length===0){f(".qtip[unfocus]").each(function(){var u=f(this).qtip("api");if(f(this).is(":visible")&&!u.status.disabled&&f(t.target).add(u.elements.target).length>1){u.hide(t)}})}})});f.fn.qtip.interfaces=[];f.fn.qtip.log={error:function(){return this}};f.fn.qtip.constants={};f.fn.qtip.defaults={content:{prerender:false,text:false,url:false,data:null,title:{text:false,button:false}},position:{target:false,corner:{target:"bottomRight",tooltip:"topLeft"},adjust:{x:0,y:0,mouse:true,screen:false,scroll:true,resize:true},type:"absolute",container:false},show:{when:{target:false,event:"mouseover"},effect:{type:"fade",length:100},delay:140,solo:false,ready:false},hide:{when:{target:false,event:"mouseout"},effect:{type:"fade",length:100},delay:0,fixed:false},api:{beforeRender:function(){},onRender:function(){},beforePositionUpdate:function(){},onPositionUpdate:function(){},beforeShow:function(){},onShow:function(){},beforeHide:function(){},onHide:function(){},beforeContentUpdate:function(){},onContentUpdate:function(){},beforeContentLoad:function(){},onContentLoad:function(){},beforeTitleUpdate:function(){},onTitleUpdate:function(){},beforeDestroy:function(){},onDestroy:function(){},beforeFocus:function(){},onFocus:function(){}}};f.fn.qtip.styles={defaults:{background:"white",color:"#111",overflow:"hidden",textAlign:"left",width:{min:0,max:250},padding:"5px 9px",border:{width:1,radius:0,color:"#d3d3d3"},tip:{corner:false,color:false,size:{width:13,height:13},opacity:1},title:{background:"#e1e1e1",fontWeight:"bold",padding:"7px 12px"},button:{cursor:"pointer"},classes:{target:"",tip:"qtip-tip",title:"qtip-title",button:"qtip-button",content:"qtip-content",active:"qtip-active"}},cream:{border:{width:3,radius:0,color:"#F9E98E"},title:{background:"#F0DE7D",color:"#A27D35"},background:"#FBF7AA",color:"#A27D35",classes:{tooltip:"qtip-cream"}},light:{border:{width:3,radius:0,color:"#E2E2E2"},title:{background:"#f1f1f1",color:"#454545"},background:"white",color:"#454545",classes:{tooltip:"qtip-light"}},dark:{border:{width:3,radius:0,color:"#303030"},title:{background:"#404040",color:"#f3f3f3"},background:"#505050",color:"#f3f3f3",classes:{tooltip:"qtip-dark"}},red:{border:{width:3,radius:0,color:"#CE6F6F"},title:{background:"#f28279",color:"#9C2F2F"},background:"#F79992",color:"#9C2F2F",classes:{tooltip:"qtip-red"}},green:{border:{width:3,radius:0,color:"#A9DB66"},title:{background:"#b9db8c",color:"#58792E"},background:"#CDE6AC",color:"#58792E",classes:{tooltip:"qtip-green"}},blue:{border:{width:3,radius:0,color:"#ADD9ED"},title:{background:"#D0E9F5",color:"#5E99BD"},background:"#E5F6FE",color:"#4D9FBF",classes:{tooltip:"qtip-blue"}}}})(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/jquery/jquery-ui-1.7.1.custom.min.js DELETED
@@ -1,273 +0,0 @@
1
- /*
2
- * jQuery UI 1.7.1
3
- *
4
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
5
- * Dual licensed under the MIT (MIT-LICENSE.txt)
6
- * and GPL (GPL-LICENSE.txt) licenses.
7
- *
8
- * http://docs.jquery.com/UI
9
- */
10
- * jQuery UI Draggable 1.7.1
11
- *
12
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
13
- * Dual licensed under the MIT (MIT-LICENSE.txt)
14
- * and GPL (GPL-LICENSE.txt) licenses.
15
- *
16
- * http://docs.jquery.com/UI/Draggables
17
- *
18
- * Depends:
19
- * ui.core.js
20
- */
21
- * jQuery UI Droppable 1.7.1
22
- *
23
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
24
- * Dual licensed under the MIT (MIT-LICENSE.txt)
25
- * and GPL (GPL-LICENSE.txt) licenses.
26
- *
27
- * http://docs.jquery.com/UI/Droppables
28
- *
29
- * Depends:
30
- * ui.core.js
31
- * ui.draggable.js
32
- */
33
- * jQuery UI Resizable 1.7.1
34
- *
35
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
36
- * Dual licensed under the MIT (MIT-LICENSE.txt)
37
- * and GPL (GPL-LICENSE.txt) licenses.
38
- *
39
- * http://docs.jquery.com/UI/Resizables
40
- *
41
- * Depends:
42
- * ui.core.js
43
- */
44
- * jQuery UI Selectable 1.7.1
45
- *
46
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
47
- * Dual licensed under the MIT (MIT-LICENSE.txt)
48
- * and GPL (GPL-LICENSE.txt) licenses.
49
- *
50
- * http://docs.jquery.com/UI/Selectables
51
- *
52
- * Depends:
53
- * ui.core.js
54
- */
55
- * jQuery UI Sortable 1.7.1
56
- *
57
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
58
- * Dual licensed under the MIT (MIT-LICENSE.txt)
59
- * and GPL (GPL-LICENSE.txt) licenses.
60
- *
61
- * http://docs.jquery.com/UI/Sortables
62
- *
63
- * Depends:
64
- * ui.core.js
65
- */
66
- * jQuery UI Accordion 1.7.1
67
- *
68
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
69
- * Dual licensed under the MIT (MIT-LICENSE.txt)
70
- * and GPL (GPL-LICENSE.txt) licenses.
71
- *
72
- * http://docs.jquery.com/UI/Accordion
73
- *
74
- * Depends:
75
- * ui.core.js
76
- */
77
- * jQuery UI Dialog 1.7.1
78
- *
79
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
80
- * Dual licensed under the MIT (MIT-LICENSE.txt)
81
- * and GPL (GPL-LICENSE.txt) licenses.
82
- *
83
- * http://docs.jquery.com/UI/Dialog
84
- *
85
- * Depends:
86
- * ui.core.js
87
- * ui.draggable.js
88
- * ui.resizable.js
89
- */
90
- * jQuery UI Slider 1.7.1
91
- *
92
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
93
- * Dual licensed under the MIT (MIT-LICENSE.txt)
94
- * and GPL (GPL-LICENSE.txt) licenses.
95
- *
96
- * http://docs.jquery.com/UI/Slider
97
- *
98
- * Depends:
99
- * ui.core.js
100
- */
101
- * jQuery UI Tabs 1.7.1
102
- *
103
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
104
- * Dual licensed under the MIT (MIT-LICENSE.txt)
105
- * and GPL (GPL-LICENSE.txt) licenses.
106
- *
107
- * http://docs.jquery.com/UI/Tabs
108
- *
109
- * Depends:
110
- * ui.core.js
111
- */
112
- * jQuery UI Datepicker 1.7.1
113
- *
114
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
115
- * Dual licensed under the MIT (MIT-LICENSE.txt)
116
- * and GPL (GPL-LICENSE.txt) licenses.
117
- *
118
- * http://docs.jquery.com/UI/Datepicker
119
- *
120
- * Depends:
121
- * ui.core.js
122
- */
123
- * jQuery UI Progressbar 1.7.1
124
- *
125
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
126
- * Dual licensed under the MIT (MIT-LICENSE.txt)
127
- * and GPL (GPL-LICENSE.txt) licenses.
128
- *
129
- * http://docs.jquery.com/UI/Progressbar
130
- *
131
- * Depends:
132
- * ui.core.js
133
- */
134
- * jQuery UI Effects 1.7.1
135
- *
136
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
137
- * Dual licensed under the MIT (MIT-LICENSE.txt)
138
- * and GPL (GPL-LICENSE.txt) licenses.
139
- *
140
- * http://docs.jquery.com/UI/Effects/
141
- */
142
- * jQuery UI Effects Blind 1.7.1
143
- *
144
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
145
- * Dual licensed under the MIT (MIT-LICENSE.txt)
146
- * and GPL (GPL-LICENSE.txt) licenses.
147
- *
148
- * http://docs.jquery.com/UI/Effects/Blind
149
- *
150
- * Depends:
151
- * effects.core.js
152
- */
153
- * jQuery UI Effects Bounce 1.7.1
154
- *
155
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
156
- * Dual licensed under the MIT (MIT-LICENSE.txt)
157
- * and GPL (GPL-LICENSE.txt) licenses.
158
- *
159
- * http://docs.jquery.com/UI/Effects/Bounce
160
- *
161
- * Depends:
162
- * effects.core.js
163
- */
164
- * jQuery UI Effects Clip 1.7.1
165
- *
166
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
167
- * Dual licensed under the MIT (MIT-LICENSE.txt)
168
- * and GPL (GPL-LICENSE.txt) licenses.
169
- *
170
- * http://docs.jquery.com/UI/Effects/Clip
171
- *
172
- * Depends:
173
- * effects.core.js
174
- */
175
- * jQuery UI Effects Drop 1.7.1
176
- *
177
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
178
- * Dual licensed under the MIT (MIT-LICENSE.txt)
179
- * and GPL (GPL-LICENSE.txt) licenses.
180
- *
181
- * http://docs.jquery.com/UI/Effects/Drop
182
- *
183
- * Depends:
184
- * effects.core.js
185
- */
186
- * jQuery UI Effects Explode 1.7.1
187
- *
188
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
189
- * Dual licensed under the MIT (MIT-LICENSE.txt)
190
- * and GPL (GPL-LICENSE.txt) licenses.
191
- *
192
- * http://docs.jquery.com/UI/Effects/Explode
193
- *
194
- * Depends:
195
- * effects.core.js
196
- */
197
- * jQuery UI Effects Fold 1.7.1
198
- *
199
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
200
- * Dual licensed under the MIT (MIT-LICENSE.txt)
201
- * and GPL (GPL-LICENSE.txt) licenses.
202
- *
203
- * http://docs.jquery.com/UI/Effects/Fold
204
- *
205
- * Depends:
206
- * effects.core.js
207
- */
208
- * jQuery UI Effects Highlight 1.7.1
209
- *
210
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
211
- * Dual licensed under the MIT (MIT-LICENSE.txt)
212
- * and GPL (GPL-LICENSE.txt) licenses.
213
- *
214
- * http://docs.jquery.com/UI/Effects/Highlight
215
- *
216
- * Depends:
217
- * effects.core.js
218
- */
219
- * jQuery UI Effects Pulsate 1.7.1
220
- *
221
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
222
- * Dual licensed under the MIT (MIT-LICENSE.txt)
223
- * and GPL (GPL-LICENSE.txt) licenses.
224
- *
225
- * http://docs.jquery.com/UI/Effects/Pulsate
226
- *
227
- * Depends:
228
- * effects.core.js
229
- */
230
- * jQuery UI Effects Scale 1.7.1
231
- *
232
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
233
- * Dual licensed under the MIT (MIT-LICENSE.txt)
234
- * and GPL (GPL-LICENSE.txt) licenses.
235
- *
236
- * http://docs.jquery.com/UI/Effects/Scale
237
- *
238
- * Depends:
239
- * effects.core.js
240
- */
241
- * jQuery UI Effects Shake 1.7.1
242
- *
243
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
244
- * Dual licensed under the MIT (MIT-LICENSE.txt)
245
- * and GPL (GPL-LICENSE.txt) licenses.
246
- *
247
- * http://docs.jquery.com/UI/Effects/Shake
248
- *
249
- * Depends:
250
- * effects.core.js
251
- */
252
- * jQuery UI Effects Slide 1.7.1
253
- *
254
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
255
- * Dual licensed under the MIT (MIT-LICENSE.txt)
256
- * and GPL (GPL-LICENSE.txt) licenses.
257
- *
258
- * http://docs.jquery.com/UI/Effects/Slide
259
- *
260
- * Depends:
261
- * effects.core.js
262
- */
263
- * jQuery UI Effects Transfer 1.7.1
264
- *
265
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
266
- * Dual licensed under the MIT (MIT-LICENSE.txt)
267
- * and GPL (GPL-LICENSE.txt) licenses.
268
- *
269
- * http://docs.jquery.com/UI/Effects/Transfer
270
- *
271
- * Depends:
272
- * effects.core.js
273
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/jquery/jquery-ui-1.8.14.custom.min.js DELETED
@@ -1,789 +0,0 @@
1
- /*!
2
- * jQuery UI 1.8.14
3
- *
4
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
- * Dual licensed under the MIT or GPL Version 2 licenses.
6
- * http://jquery.org/license
7
- *
8
- * http://docs.jquery.com/UI
9
- */
10
- (function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.14",
11
- keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();
12
- b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,
13
- "overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",
14
- function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,
15
- outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,"tabindex"),d=isNaN(b);
16
- return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=
17
- 0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
18
- ;/*!
19
- * jQuery UI Widget 1.8.14
20
- *
21
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
22
- * Dual licensed under the MIT or GPL Version 2 licenses.
23
- * http://jquery.org/license
24
- *
25
- * http://docs.jquery.com/UI/Widget
26
- */
27
- (function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
28
- a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;
29
- e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,
30
- this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
31
- widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},
32
- enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
33
- ;/*!
34
- * jQuery UI Mouse 1.8.14
35
- *
36
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
37
- * Dual licensed under the MIT or GPL Version 2 licenses.
38
- * http://jquery.org/license
39
- *
40
- * http://docs.jquery.com/UI/Mouse
41
- *
42
- * Depends:
43
- * jquery.ui.widget.js
44
- */
45
- (function(b){var d=false;b(document).mousedown(function(){d=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+
46
- this.widgetName)},_mouseDown:function(a){if(!d){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,f=a.which==1,g=typeof this.options.cancel=="string"?b(a.target).closest(this.options.cancel).length:false;if(!f||g||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==
47
- false;if(!this._mouseStarted){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(e){return c._mouseMove(e)};this._mouseUpDelegate=function(e){return c._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return d=true}},_mouseMove:function(a){if(b.browser.msie&&
48
- !(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=
49
- false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
50
- ;/*
51
- * jQuery UI Position 1.8.14
52
- *
53
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
54
- * Dual licensed under the MIT or GPL Version 2 licenses.
55
- * http://jquery.org/license
56
- *
57
- * http://docs.jquery.com/UI/Position
58
- */
59
- (function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY,
60
- left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+=
61
- k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-=
62
- m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left=
63
- d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+=
64
- a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b),
65
- g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery);
66
- ;/*
67
- * jQuery UI Draggable 1.8.14
68
- *
69
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
70
- * Dual licensed under the MIT or GPL Version 2 licenses.
71
- * http://jquery.org/license
72
- *
73
- * http://docs.jquery.com/UI/Draggables
74
- *
75
- * Depends:
76
- * jquery.ui.core.js
77
- * jquery.ui.mouse.js
78
- * jquery.ui.widget.js
79
- */
80
- (function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
81
- "original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=
82
- this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options;this.helper=
83
- this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});
84
- this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return true},
85
- _mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=
86
- false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,
87
- 10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},_mouseUp:function(a){this.options.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||
88
- !d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&
89
- a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=
90
- this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),
91
- 10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),
92
- 10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,
93
- (a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.containment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!=
94
- "hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),
95
- 10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+
96
- this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&
97
- !(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset.click.left<g[0])e=g[0]+this.offset.click.left;
98
- if(a.pageY-this.offset.click.top<g[1])h=g[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>g[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.top<g[1]||h-this.offset.click.top>g[3])?h:!(h-this.offset.click.top<g[1])?h-b.grid[1]:h+b.grid[1]:h;e=b.grid[0]?this.originalPageX+Math.round((e-this.originalPageX)/
99
- b.grid[0])*b.grid[0]:this.originalPageX;e=g?!(e-this.offset.click.left<g[0]||e-this.offset.click.left>g[2])?e:!(e-this.offset.click.left<g[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<
100
- 526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,
101
- c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.14"});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var h=d.data(this,"sortable");if(h&&!h.options.disabled){c.sortables.push({instance:h,shouldRevert:h.options.revert});
102
- h.refreshPositions();h._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=
103
- false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=d(f).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",true);
104
- this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;
105
- c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&
106
- this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=
107
- a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!=
108
- "x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX-b.overflowOffset.left<
109
- c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()-
110
- c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable","snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this,
111
- width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),f=c.options,e=f.snapTolerance,h=b.offset.left,g=h+c.helperProportions.width,n=b.offset.top,o=n+c.helperProportions.height,i=c.snapElements.length-1;i>=0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements[i].top,m=k+c.snapElements[i].height;if(j-e<h&&h<l+e&&k-e<n&&n<m+e||j-e<h&&h<l+e&&k-e<o&&o<m+e||j-e<g&&g<l+e&&k-e<n&&n<m+e||j-e<g&&g<l+e&&k-e<o&&
112
- o<m+e){if(f.snapMode!="inner"){var p=Math.abs(k-o)<=e,q=Math.abs(m-n)<=e,r=Math.abs(j-g)<=e,s=Math.abs(l-h)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:k-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:m,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:j-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:l}).left-c.margins.left}var t=
113
- p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(k-n)<=e;q=Math.abs(m-o)<=e;r=Math.abs(j-h)<=e;s=Math.abs(l-g)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:k,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:m-c.helperProportions.height,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:j}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:l-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[i].snapping&&
114
- (p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=p||q||r||s||t}else{c.snapElements[i].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"),
115
- 10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery);
116
- ;/*
117
- * jQuery UI Droppable 1.8.14
118
- *
119
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
120
- * Dual licensed under the MIT or GPL Version 2 licenses.
121
- * http://jquery.org/license
122
- *
123
- * http://docs.jquery.com/UI/Droppables
124
- *
125
- * Depends:
126
- * jquery.ui.core.js
127
- * jquery.ui.widget.js
128
- * jquery.ui.mouse.js
129
- * jquery.ui.draggable.js
130
- */
131
- (function(d){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var a=this.options,b=a.accept;this.isover=0;this.isout=1;this.accept=d.isFunction(b)?b:function(c){return c.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};d.ui.ddmanager.droppables[a.scope]=d.ui.ddmanager.droppables[a.scope]||[];d.ui.ddmanager.droppables[a.scope].push(this);
132
- a.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var a=d.ui.ddmanager.droppables[this.options.scope],b=0;b<a.length;b++)a[b]==this&&a.splice(b,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(a,b){if(a=="accept")this.accept=d.isFunction(b)?b:function(c){return c.is(b)};d.Widget.prototype._setOption.apply(this,arguments)},_activate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&
133
- this.element.addClass(this.options.activeClass);b&&this._trigger("activate",a,this.ui(b))},_deactivate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);b&&this._trigger("deactivate",a,this.ui(b))},_over:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);
134
- this._trigger("over",a,this.ui(b))}},_out:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",a,this.ui(b))}},_drop:function(a,b){var c=b||d.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return false;var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var g=
135
- d.data(this,"droppable");if(g.options.greedy&&!g.options.disabled&&g.options.scope==c.options.scope&&g.accept.call(g.element[0],c.currentItem||c.element)&&d.ui.intersect(c,d.extend(g,{offset:g.element.offset()}),g.options.tolerance)){e=true;return false}});if(e)return false;if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",
136
- a,this.ui(c));return this.element}return false},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}});d.extend(d.ui.droppable,{version:"1.8.14"});d.ui.intersect=function(a,b,c){if(!b.offset)return false;var e=(a.positionAbs||a.position.absolute).left,g=e+a.helperProportions.width,f=(a.positionAbs||a.position.absolute).top,h=f+a.helperProportions.height,i=b.offset.left,k=i+b.proportions.width,j=b.offset.top,l=j+b.proportions.height;
137
- switch(c){case "fit":return i<=e&&g<=k&&j<=f&&h<=l;case "intersect":return i<e+a.helperProportions.width/2&&g-a.helperProportions.width/2<k&&j<f+a.helperProportions.height/2&&h-a.helperProportions.height/2<l;case "pointer":return d.ui.isOver((a.positionAbs||a.position.absolute).top+(a.clickOffset||a.offset.click).top,(a.positionAbs||a.position.absolute).left+(a.clickOffset||a.offset.click).left,j,i,b.proportions.height,b.proportions.width);case "touch":return(f>=j&&f<=l||h>=j&&h<=l||f<j&&h>l)&&(e>=
138
- i&&e<=k||g>=i&&g<=k||e<i&&g>k);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f<c.length;f++)if(!(c[f].options.disabled||a&&!c[f].accept.call(c[f].element[0],a.currentItem||a.element))){for(var h=0;h<g.length;h++)if(g[h]==c[f].element[0]){c[f].proportions.height=0;continue a}c[f].visible=c[f].element.css("display")!=
139
- "none";if(c[f].visible){e=="mousedown"&&c[f]._activate.call(c[f],b);c[f].offset=c[f].element.offset();c[f].proportions={width:c[f].element[0].offsetWidth,height:c[f].element[0].offsetHeight}}}},drop:function(a,b){var c=false;d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(this.options){if(!this.options.disabled&&this.visible&&d.ui.intersect(a,this,this.options.tolerance))c=c||this._drop.call(this,b);if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],a.currentItem||
140
- a.element)){this.isout=1;this.isover=0;this._deactivate.call(this,b)}}});return c},dragStart:function(a,b){a.element.parentsUntil("body").bind("scroll.droppable",function(){a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)})},drag:function(a,b){a.options.refreshPositions&&d.ui.ddmanager.prepareOffsets(a,b);d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var c=d.ui.intersect(a,this,this.options.tolerance);if(c=
141
- !c&&this.isover==1?"isout":c&&this.isover==0?"isover":null){var e;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");if(g.length){e=d.data(g[0],"droppable");e.greedyChild=c=="isover"?1:0}}if(e&&c=="isover"){e.isover=0;e.isout=1;e._out.call(e,b)}this[c]=1;this[c=="isout"?"isover":"isout"]=0;this[c=="isover"?"_over":"_out"].call(this,b);if(e&&c=="isout"){e.isout=0;e.isover=1;e._over.call(e,b)}}}})},dragStop:function(a,b){a.element.parentsUntil("body").unbind("scroll.droppable");
142
- a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)}}})(jQuery);
143
- ;/*
144
- * jQuery UI Resizable 1.8.14
145
- *
146
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
147
- * Dual licensed under the MIT or GPL Version 2 licenses.
148
- * http://jquery.org/license
149
- *
150
- * http://docs.jquery.com/UI/Resizables
151
- *
152
- * Depends:
153
- * jquery.ui.core.js
154
- * jquery.ui.mouse.js
155
- * jquery.ui.widget.js
156
- */
157
- (function(e){e.widget("ui.resizable",e.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,
158
- _proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&e.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),
159
- top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=
160
- this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",
161
- nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d<c.length;d++){var f=e.trim(c[d]),g=e('<div class="ui-resizable-handle '+("ui-resizable-"+f)+'"></div>');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor==
162
- String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection();
163
- this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){if(!a.disabled){e(this).removeClass("ui-resizable-autohide");b._handles.show()}},function(){if(!a.disabled)if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();
164
- var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=
165
- false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});
166
- this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff=
167
- {width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];
168
- if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},
169
- _mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;f=f?0:c.sizeDiff.width;f={width:c.helper.width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,
170
- {top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",b);this._helper&&this.helper.remove();return false},_updateVirtualBoundaries:function(b){var a=this.options,c,d,f;a={minWidth:k(a.minWidth)?a.minWidth:0,maxWidth:k(a.maxWidth)?a.maxWidth:Infinity,minHeight:k(a.minHeight)?a.minHeight:0,maxHeight:k(a.maxHeight)?a.maxHeight:
171
- Infinity};if(this._aspectRatio||b){b=a.minHeight*this.aspectRatio;d=a.minWidth/this.aspectRatio;c=a.maxHeight*this.aspectRatio;f=a.maxWidth/this.aspectRatio;if(b>a.minWidth)a.minWidth=b;if(d>a.minHeight)a.minHeight=d;if(c<a.maxWidth)a.maxWidth=c;if(f<a.maxHeight)a.maxHeight=f}this._vBoundaries=a},_updateCache:function(b){this.offset=this.helper.offset();if(k(b.left))this.position.left=b.left;if(k(b.top))this.position.top=b.top;if(k(b.height))this.size.height=b.height;if(k(b.width))this.size.width=
172
- b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(k(b.height))b.width=b.height*this.aspectRatio;else if(k(b.width))b.height=b.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(d=="nw"){b.top=a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this._vBoundaries,c=this.axis,d=k(b.width)&&a.maxWidth&&a.maxWidth<b.width,f=k(b.height)&&a.maxHeight&&a.maxHeight<b.height,g=k(b.width)&&a.minWidth&&
173
- a.minWidth>b.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height,l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&l)b.left=i-a.minWidth;if(d&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=
174
- null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a<this._proportionallyResizeElements.length;a++){var c=this._proportionallyResizeElements[a];if(!this.borderDif){var d=[c.css("borderTopWidth"),c.css("borderRightWidth"),c.css("borderBottomWidth"),c.css("borderLeftWidth")],f=[c.css("paddingTop"),c.css("paddingRight"),c.css("paddingBottom"),c.css("paddingLeft")];this.borderDif=e.map(d,function(g,h){g=parseInt(g,10)||
175
- 0;h=parseInt(f[h],10)||0;return g+h})}e.browser.msie&&(e(b).is(":hidden")||e(b).parents(":hidden").length)||c.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+
176
- a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+
177
- c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);
178
- b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.14"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),
179
- 10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-
180
- f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var l=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:l.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(l.css("position"))){c._revertToRelativePosition=true;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?
181
- e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=
182
- e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,
183
- step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=
184
- e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;
185
- var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset,f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:
186
- a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-
187
- d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,
188
- f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,
189
- display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=
190
- e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=
191
- d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery);
192
- ;/*
193
- * jQuery UI Selectable 1.8.14
194
- *
195
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
196
- * Dual licensed under the MIT or GPL Version 2 licenses.
197
- * http://jquery.org/license
198
- *
199
- * http://docs.jquery.com/UI/Selectables
200
- *
201
- * Depends:
202
- * jquery.ui.core.js
203
- * jquery.ui.mouse.js
204
- * jquery.ui.widget.js
205
- */
206
- (function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),
207
- selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX,
208
- c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting",
209
- c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d=
210
- this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.right<b||a.top>i||a.bottom<g);else if(d.tolerance=="fit")k=a.left>b&&a.right<h&&a.top>g&&a.bottom<i;if(k){if(a.selected){a.$element.removeClass("ui-selected");a.selected=false}if(a.unselecting){a.$element.removeClass("ui-unselecting");
211
- a.unselecting=false}if(!a.selecting){a.$element.addClass("ui-selecting");a.selecting=true;f._trigger("selecting",c,{selecting:a.element})}}else{if(a.selecting)if(c.metaKey&&a.startselected){a.$element.removeClass("ui-selecting");a.selecting=false;a.$element.addClass("ui-selected");a.selected=true}else{a.$element.removeClass("ui-selecting");a.selecting=false;if(a.startselected){a.$element.addClass("ui-unselecting");a.unselecting=true}f._trigger("unselecting",c,{unselecting:a.element})}if(a.selected)if(!c.metaKey&&
212
- !a.startselected){a.$element.removeClass("ui-selected");a.selected=false;a.$element.addClass("ui-unselecting");a.unselecting=true;f._trigger("unselecting",c,{unselecting:a.element})}}}});return false}},_mouseStop:function(c){var f=this;this.dragged=false;e(".ui-unselecting",this.element[0]).each(function(){var d=e.data(this,"selectable-item");d.$element.removeClass("ui-unselecting");d.unselecting=false;d.startselected=false;f._trigger("unselected",c,{unselected:d.element})});e(".ui-selecting",this.element[0]).each(function(){var d=
213
- e.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected");d.selecting=false;d.selected=true;d.startselected=true;f._trigger("selected",c,{selected:d.element})});this._trigger("stop",c);this.helper.remove();return false}});e.extend(e.ui.selectable,{version:"1.8.14"})})(jQuery);
214
- ;/*
215
- * jQuery UI Sortable 1.8.14
216
- *
217
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
218
- * Dual licensed under the MIT or GPL Version 2 licenses.
219
- * http://jquery.org/license
220
- *
221
- * http://docs.jquery.com/UI/Sortables
222
- *
223
- * Depends:
224
- * jquery.ui.core.js
225
- * jquery.ui.mouse.js
226
- * jquery.ui.widget.js
227
- */
228
- (function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable");
229
- this.refresh();this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a===
230
- "disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&
231
- !b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,
232
- left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};
233
- this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=
234
- document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);
235
- return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop+b.scrollSpeed;else if(a.pageY-this.overflowOffset.top<
236
- b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-b.scrollSpeed;if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-a.pageX<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft+b.scrollSpeed;else if(a.pageX-this.overflowOffset.left<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-b.scrollSpeed}else{if(a.pageY-d(document).scrollTop()<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()-
237
- b.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()+b.scrollSpeed);if(a.pageX-d(document).scrollLeft()<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()-b.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()+b.scrollSpeed)}c!==false&&d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,
238
- a)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(b=this.items.length-1;b>=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],
239
- e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();
240
- c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):
241
- this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,
242
- dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")},
243
- toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+j<k&&b+l>g&&b+l<h;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||
244
- this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?j:g<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<h&&i<e+this.helperProportions.height/2&&f-this.helperProportions.height/2<k},_intersectsWithPointer:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width);b=b&&a;a=this._getDragVerticalDirection();
245
- var c=this._getDragHorizontalDirection();if(!b)return false;return this.floating?c&&c=="right"||a=="down"?2:1:a&&(a=="down"?2:1)},_intersectsWithSides:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width);var c=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?e=="right"&&a||e=="left"&&!a:c&&(c=="down"&&b||c=="up"&&!b)},
246
- _getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();
247
- if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),
248
- this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(a){this.items=[];this.containers=[this];var b=this.items,c=[[d.isFunction(this.options.items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):d(this.options.items,this.element),
249
- this]],e=this._connectWith();if(e)for(var f=e.length-1;f>=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h<g;h++){i=d(e[h]);i.data("sortable-item",a);b.push({item:i,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(a){if(this.offsetParent&&
250
- this.helper)this.offset.parent=this._getParentOffset();for(var b=this.items.length-1;b>=0;b--){var c=this.items[b];if(!(c.instance!=this.currentContainer&&this.currentContainer&&c.item[0]!=this.currentItem[0])){var e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=
251
- this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=
252
- d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||
253
- 0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",
254
- a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-
255
- f)<b){b=Math.abs(h-f);e=this.items[g]}}if(e||this.options.dropOnEmpty){this.currentContainer=this.containers[c];e?this._rearrange(a,e,null,true):this._rearrange(a,null,this.containers[c].element,true);this._trigger("change",a,this._uiHash());this.containers[c]._trigger("change",a,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}}},_createHelper:function(a){var b=
256
- this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a,this.currentItem])):b.helper=="clone"?this.currentItem.clone():this.currentItem;a.parents("body").length||d(b.appendTo!="parent"?b.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0]);if(a[0]==this.currentItem[0])this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(a[0].style.width==
257
- ""||b.forceHelperSize)a.width(this.currentItem.width());if(a[0].style.height==""||b.forceHelperSize)a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=
258
- this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a=
259
- {top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),
260
- 10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?
261
- document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)){var b=d(a.containment)[0];a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),
262
- 10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(a,b){if(!b)b=
263
- this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&
264
- this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();
265
- var f=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])f=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-
266
- this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;f=this.originalPageX+Math.round((f-this.originalPageX)/b.grid[0])*b.grid[0];f=this.containment?!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:!(f-this.offset.click.left<this.containment[0])?f-b.grid[0]:f+b.grid[0]:f}}return{top:g-
267
- this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())}},_rearrange:function(a,b,c,e){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],
268
- this.direction=="down"?b.item[0]:b.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var f=this,g=this.counter;window.setTimeout(function(){g==f.counter&&f.refreshPositions(!e)},0)},_clear:function(a,b){this.reverting=false;var c=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if(this._storedCSS[e]=="auto"||this._storedCSS[e]=="static")this._storedCSS[e]=
269
- "";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!b&&c.push(function(f){this._trigger("receive",f,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!b)c.push(function(f){this._trigger("update",f,this._uiHash())});if(!d.ui.contains(this.element[0],this.currentItem[0])){b||c.push(function(f){this._trigger("remove",
270
- f,this._uiHash())});for(e=this.containers.length-1;e>=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,
271
- this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",
272
- a,this._uiHash());for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}return false}b||this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!b){for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){d.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},
273
- _uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||d([]),position:b.position,originalPosition:b.originalPosition,offset:b.positionAbs,item:b.currentItem,sender:a?a.element:null}}});d.extend(d.ui.sortable,{version:"1.8.14"})})(jQuery);
274
- ;/*
275
- * jQuery UI Accordion 1.8.14
276
- *
277
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
278
- * Dual licensed under the MIT or GPL Version 2 licenses.
279
- * http://jquery.org/license
280
- *
281
- * http://docs.jquery.com/UI/Accordion
282
- *
283
- * Depends:
284
- * jquery.ui.core.js
285
- * jquery.ui.widget.js
286
- */
287
- (function(c){c.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");
288
- a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
289
- if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var h=d.closest(".ui-accordion-header");a.active=h.length?h:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion",
290
- function(f){return a._keydown(f)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(f){a._clickHandler.call(a,f,this);f.preventDefault()})},_createIcons:function(){var a=
291
- this.options;if(a.icons){c("<span></span>").addClass("ui-icon "+a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex");
292
- this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons();
293
- b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,h=this.headers.index(a.target),f=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:f=this.headers[(h+1)%d];break;case b.LEFT:case b.UP:f=this.headers[(h-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target);
294
- a.preventDefault()}if(f){c(a.target).attr("tabIndex",-1);c(f).attr("tabIndex",0);f.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+
295
- c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options;
296
- if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){var h=this.active;j=a.next();g=this.active.next();e={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):j,oldContent:g};var f=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(j,g,e,b,f);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);
297
- if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);a.next().addClass("ui-accordion-content-active")}}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var g=this.active.next(),
298
- e={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:g},j=this.active=c([]);this._toggle(j,g,e)}},_toggle:function(a,b,d,h,f){var g=this,e=g.options;g.toShow=a;g.toHide=b;g.data=d;var j=function(){if(g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data);g.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&h?{toShow:c([]),toHide:b,complete:j,down:f,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:f,autoHeight:e.autoHeight||
299
- e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;h=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!h[k]&&!c.easing[k])k="slide";h[k]||(h[k]=function(l){this.slide(l,{easing:k,duration:i||700})});h[k](d)}else{if(e.collapsible&&h)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false",
300
- "aria-selected":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.14",
301
- animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),h=0,f={},g={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){g[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/);
302
- f[i]={value:j[1],unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(g,{step:function(j,i){if(i.prop=="height")h=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=h*f[i.prop].value+f[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide",
303
- paddingTop:"hide",paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery);
304
- ;/*
305
- * jQuery UI Autocomplete 1.8.14
306
- *
307
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
308
- * Dual licensed under the MIT or GPL Version 2 licenses.
309
- * http://jquery.org/license
310
- *
311
- * http://docs.jquery.com/UI/Autocomplete
312
- *
313
- * Depends:
314
- * jquery.ui.core.js
315
- * jquery.ui.widget.js
316
- * jquery.ui.position.js
317
- */
318
- (function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.attr("readonly"))){g=
319
- false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=
320
- a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)};
321
- this.menu=d("<ul></ul>").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&&
322
- a.element.val(f.value)},selected:function(c,f){var h=f.item.data("item.autocomplete"),i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");
323
- d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&&
324
- b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source==="string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else this.source=
325
- this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)!==false)return this._search(a)},_search:function(a){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:a},this.response)},_response:function(a){if(!this.options.disabled&&a&&a.length){a=this._normalize(a);this._suggest(a);this._trigger("open")}else this.close();
326
- this.pending--;this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",a)}},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(a){if(a.length&&a[0].label&&a[0].value)return a;return d.map(a,function(b){if(typeof b==="string")return{label:b,value:b};return d.extend({label:b.label||
327
- b.value,value:b.value||b.label},b)})},_suggest:function(a){var b=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(b,a);this.menu.deactivate();this.menu.refresh();b.show();this._resizeMenu();b.position(d.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next(new d.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(a,b){var g=this;
328
- d.each(b,function(c,f){g._renderItem(a,f)})},_renderItem:function(a,b){return d("<li></li>").data("item.autocomplete",b).append(d("<a></a>").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,
329
- "\\$&")},filter:function(a,b){var g=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label||c.value||c)})}})})(jQuery);
330
- (function(d){d.widget("ui.menu",{_create:function(){var e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",
331
- -1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,g=this.element.scrollTop(),c=this.element.height();if(b<0)this.element.scrollTop(g+b);else b>=c&&this.element.scrollTop(g+b-c+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");
332
- this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0);e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else this.activate(b,
333
- this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element.children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e,g)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||
334
- this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(e,result)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||
335
- this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[d.fn.prop?"prop":"attr"]("scrollHeight")},select:function(e){this._trigger("selected",e,{item:this.active})}})})(jQuery);
336
- ;/*
337
- * jQuery UI Button 1.8.14
338
- *
339
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
340
- * Dual licensed under the MIT or GPL Version 2 licenses.
341
- * http://jquery.org/license
342
- *
343
- * http://docs.jquery.com/UI/Button
344
- *
345
- * Depends:
346
- * jquery.ui.core.js
347
- * jquery.ui.widget.js
348
- */
349
- (function(b){var h,i,j,g,l=function(){var a=b(this).find(":ui-button");setTimeout(function(){a.button("refresh")},1)},k=function(a){var c=a.name,e=a.form,f=b([]);if(c)f=e?b(e).find("[name='"+c+"']"):b("[name='"+c+"']",a.ownerDocument).filter(function(){return!this.form});return f};b.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",l);if(typeof this.options.disabled!==
350
- "boolean")this.options.disabled=this.element.attr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var a=this,c=this.options,e=this.type==="checkbox"||this.type==="radio",f="ui-state-hover"+(!e?" ui-state-active":"");if(c.label===null)c.label=this.buttonElement.html();if(this.element.is(":disabled"))c.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!c.disabled){b(this).addClass("ui-state-hover");
351
- this===h&&b(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){c.disabled||b(this).removeClass(f)}).bind("click.button",function(d){if(c.disabled){d.preventDefault();d.stopImmediatePropagation()}});this.element.bind("focus.button",function(){a.buttonElement.addClass("ui-state-focus")}).bind("blur.button",function(){a.buttonElement.removeClass("ui-state-focus")});if(e){this.element.bind("change.button",function(){g||a.refresh()});this.buttonElement.bind("mousedown.button",function(d){if(!c.disabled){g=
352
- false;i=d.pageX;j=d.pageY}}).bind("mouseup.button",function(d){if(!c.disabled)if(i!==d.pageX||j!==d.pageY)g=true})}if(this.type==="checkbox")this.buttonElement.bind("click.button",function(){if(c.disabled||g)return false;b(this).toggleClass("ui-state-active");a.buttonElement.attr("aria-pressed",a.element[0].checked)});else if(this.type==="radio")this.buttonElement.bind("click.button",function(){if(c.disabled||g)return false;b(this).addClass("ui-state-active");a.buttonElement.attr("aria-pressed",true);
353
- var d=a.element[0];k(d).not(d).map(function(){return b(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed",false)});else{this.buttonElement.bind("mousedown.button",function(){if(c.disabled)return false;b(this).addClass("ui-state-active");h=this;b(document).one("mouseup",function(){h=null})}).bind("mouseup.button",function(){if(c.disabled)return false;b(this).removeClass("ui-state-active")}).bind("keydown.button",function(d){if(c.disabled)return false;if(d.keyCode==b.ui.keyCode.SPACE||
354
- d.keyCode==b.ui.keyCode.ENTER)b(this).addClass("ui-state-active")}).bind("keyup.button",function(){b(this).removeClass("ui-state-active")});this.buttonElement.is("a")&&this.buttonElement.keyup(function(d){d.keyCode===b.ui.keyCode.SPACE&&b(this).click()})}this._setOption("disabled",c.disabled);this._resetButton()},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type==="checkbox"||this.type===
355
- "radio"){var a=this.element.parents().filter(":last"),c="label[for="+this.element.attr("id")+"]";this.buttonElement=a.find(c);if(!this.buttonElement.length){a=a.length?a.siblings():this.element.siblings();this.buttonElement=a.filter(c);if(!this.buttonElement.length)this.buttonElement=a.find(c)}this.element.addClass("ui-helper-hidden-accessible");(a=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",a)}else this.buttonElement=this.element},
356
- widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());this.hasTitle||this.buttonElement.removeAttr("title");
357
- b.Widget.prototype.destroy.call(this)},_setOption:function(a,c){b.Widget.prototype._setOption.apply(this,arguments);if(a==="disabled")c?this.element.attr("disabled",true):this.element.removeAttr("disabled");else this._resetButton()},refresh:function(){var a=this.element.is(":disabled");a!==this.options.disabled&&this._setOption("disabled",a);if(this.type==="radio")k(this.element[0]).each(function(){b(this).is(":checked")?b(this).button("widget").addClass("ui-state-active").attr("aria-pressed",true):
358
- b(this).button("widget").removeClass("ui-state-active").attr("aria-pressed",false)});else if(this.type==="checkbox")this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed",true):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed",false)},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var a=this.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only"),
359
- c=b("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(a.empty()).text(),e=this.options.icons,f=e.primary&&e.secondary,d=[];if(e.primary||e.secondary){if(this.options.text)d.push("ui-button-text-icon"+(f?"s":e.primary?"-primary":"-secondary"));e.primary&&a.prepend("<span class='ui-button-icon-primary ui-icon "+e.primary+"'></span>");e.secondary&&a.append("<span class='ui-button-icon-secondary ui-icon "+e.secondary+"'></span>");if(!this.options.text){d.push(f?"ui-button-icons-only":
360
- "ui-button-icon-only");this.hasTitle||a.attr("title",c)}}else d.push("ui-button-text-only");a.addClass(d.join(" "))}}});b.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(a,c){a==="disabled"&&this.buttons.button("option",a,c);b.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var a=this.element.css("direction")===
361
- "ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(a?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(a?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");
362
- b.Widget.prototype.destroy.call(this)}})})(jQuery);
363
- ;/*
364
- * jQuery UI Dialog 1.8.14
365
- *
366
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
367
- * Dual licensed under the MIT or GPL Version 2 licenses.
368
- * http://jquery.org/license
369
- *
370
- * http://docs.jquery.com/UI/Dialog
371
- *
372
- * Depends:
373
- * jquery.ui.core.js
374
- * jquery.ui.widget.js
375
- * jquery.ui.button.js
376
- * jquery.ui.draggable.js
377
- * jquery.ui.mouse.js
378
- * jquery.ui.position.js
379
- * jquery.ui.resizable.js
380
- */
381
- (function(c,l){var m={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},n={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},o=c.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,
382
- position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||"&#160;",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+
383
- b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),
384
- h=c('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("<span></span>")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("<span></span>").addClass("ui-dialog-title").attr("id",
385
- e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");
386
- a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!==
387
- b.uiDialog[0]){e=c(this).css("z-index");isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=
388
- 1;d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target===
389
- f[0]&&e.shiftKey){g.focus(1);return false}}});c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,
390
- function(){return!(d=true)});if(d){c.each(a,function(f,h){h=c.isFunction(h)?{click:h,text:f}:h;var i=c('<button type="button"></button>').click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.each(h,function(j,k){if(j!=="click")j in o?i[j](k):i.attr(j,k)});c.fn.button&&i.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",
391
- handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition,
392
- originalSize:f.originalSize,position:f.position,size:f.size}}a=a===l?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize",
393
- f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):
394
- [a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f);
395
- if(g in m)e=true;if(g in n)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"):
396
- e.removeClass("ui-dialog-disabled");break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||"&#160;"));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a=
397
- this.options,b,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height-
398
- b,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.14",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),
399
- create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()<c.ui.dialog.overlay.maxZ)return false})},1);c(document).bind("keydown.dialog-overlay",function(d){if(a.options.closeOnEscape&&d.keyCode&&d.keyCode===c.ui.keyCode.ESCAPE){a.close(d);d.preventDefault()}});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var b=(this.oldInstances.pop()||c("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),
400
- height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);
401
- b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a<b?c(window).height()+"px":a+"px"}else return c(document).height()+"px"},width:function(){var a,b;if(c.browser.msie){a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);b=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return a<b?c(window).width()+"px":a+"px"}else return c(document).width()+"px"},resize:function(){var a=c([]);c.each(c.ui.dialog.overlay.instances,function(){a=
402
- a.add(this)});a.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
403
- ;/*
404
- * jQuery UI Slider 1.8.14
405
- *
406
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
407
- * Dual licensed under the MIT or GPL Version 2 licenses.
408
- * http://jquery.org/license
409
- *
410
- * http://docs.jquery.com/UI/Slider
411
- *
412
- * Depends:
413
- * jquery.ui.core.js
414
- * jquery.ui.mouse.js
415
- * jquery.ui.widget.js
416
- */
417
- (function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var b=this,a=this.options,c=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f=a.values&&a.values.length||1,e=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+
418
- this.orientation+" ui-widget ui-widget-content ui-corner-all"+(a.disabled?" ui-slider-disabled ui-disabled":""));this.range=d([]);if(a.range){if(a.range===true){if(!a.values)a.values=[this._valueMin(),this._valueMin()];if(a.values.length&&a.values.length!==2)a.values=[a.values[0],a.values[0]]}this.range=d("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(a.range==="min"||a.range==="max"?" ui-slider-range-"+a.range:""))}for(var j=c.length;j<f;j+=1)e.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");
419
- this.handles=c.add(d(e.join("")).appendTo(b.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){a.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(a.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handle",
420
- g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-slider-handle"),i,h,m;if(!b.options.disabled){switch(g.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:k=false;if(!b._keySliding){b._keySliding=true;d(this).addClass("ui-state-active");i=b._start(g,l);if(i===false)return}break}m=b.options.step;i=b.options.values&&b.options.values.length?
421
- (h=b.values(l)):(h=b.value());switch(g.keyCode){case d.ui.keyCode.HOME:h=b._valueMin();break;case d.ui.keyCode.END:h=b._valueMax();break;case d.ui.keyCode.PAGE_UP:h=b._trimAlignValue(i+(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=b._trimAlignValue(i-(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i===b._valueMax())return;h=b._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===b._valueMin())return;h=b._trimAlignValue(i-
422
- m);break}b._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index.ui-slider-handle");if(b._keySliding){b._keySliding=false;b._stop(g,k);b._change(g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();
423
- return this},_mouseCapture:function(b){var a=this.options,c,f,e,j,g;if(a.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:b.pageX,y:b.pageY});f=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.values(k));if(f>l){f=l;e=d(this);g=k}});if(a.range===true&&this.values(1)===a.min){g+=1;e=d(this.handles[g])}if(this._start(b,g)===false)return false;
424
- this._mouseSliding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();a=e.offset();this._clickOffset=!d(b.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:b.pageX-a.left-e.width()/2,top:b.pageY-a.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(b,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(b){var a=
425
- this._normValueFromMouse({x:b.pageX,y:b.pageY});this._slide(b,this._handleIndex,a);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(b){var a;if(this.orientation==="horizontal"){a=
426
- this.elementSize.width;b=b.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{a=this.elementSize.height;b=b.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}a=b/a;if(a>1)a=1;if(a<0)a=0;if(this.orientation==="vertical")a=1-a;b=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+a*b)},_start:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);
427
- c.values=this.values()}return this._trigger("start",b,c)},_slide:function(b,a,c){var f;if(this.options.values&&this.options.values.length){f=this.values(a?0:1);if(this.options.values.length===2&&this.options.range===true&&(a===0&&c>f||a===1&&c<f))c=f;if(c!==this.values(a)){f=this.values();f[a]=c;b=this._trigger("slide",b,{handle:this.handles[a],value:c,values:f});this.values(a?0:1);b!==false&&this.values(a,c,true)}}else if(c!==this.value()){b=this._trigger("slide",b,{handle:this.handles[a],value:c});
428
- b!==false&&this.value(c)}},_stop:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);c.values=this.values()}this._trigger("stop",b,c)},_change:function(b,a){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);c.values=this.values()}this._trigger("change",b,c)}},value:function(b){if(arguments.length){this.options.value=
429
- this._trimAlignValue(b);this._refreshValue();this._change(null,0)}else return this._value()},values:function(b,a){var c,f,e;if(arguments.length>1){this.options.values[b]=this._trimAlignValue(a);this._refreshValue();this._change(null,b)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e<c.length;e+=1){c[e]=this._trimAlignValue(f[e]);this._change(null,e)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(b):
430
- this.value();else return this._values()},_setOption:function(b,a){var c,f=0;if(d.isArray(this.options.values))f=this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(b){case "disabled":if(a){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation();
431
- this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(c=0;c<f;c+=1)this._change(null,c);this._animateOff=false;break}},_value:function(){var b=this.options.value;return b=this._trimAlignValue(b)},_values:function(b){var a,c;if(arguments.length){a=this.options.values[b];
432
- return a=this._trimAlignValue(a)}else{a=this.options.values.slice();for(c=0;c<a.length;c+=1)a[c]=this._trimAlignValue(a[c]);return a}},_trimAlignValue:function(b){if(b<=this._valueMin())return this._valueMin();if(b>=this._valueMax())return this._valueMax();var a=this.options.step>0?this.options.step:1,c=(b-this._valueMin())%a;alignValue=b-c;if(Math.abs(c)*2>=a)alignValue+=c>0?a:-a;return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},
433
- _refreshValue:function(){var b=this.options.range,a=this.options,c=this,f=!this._animateOff?a.animate:false,e,j={},g,k,l,i;if(this.options.values&&this.options.values.length)this.handles.each(function(h){e=(c.values(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,a.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},a.animate);
434
- if(h===1)c.range[f?"animate":"css"]({width:e-g+"%"},{queue:false,duration:a.animate})}else{if(h===0)c.range.stop(1,1)[f?"animate":"css"]({bottom:e+"%"},a.animate);if(h===1)c.range[f?"animate":"css"]({height:e-g+"%"},{queue:false,duration:a.animate})}g=e});else{k=this.value();l=this._valueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,a.animate);if(b==="min"&&this.orientation==="horizontal")this.range.stop(1,
435
- 1)[f?"animate":"css"]({width:e+"%"},a.animate);if(b==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:a.animate});if(b==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},a.animate);if(b==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:a.animate})}}});d.extend(d.ui.slider,{version:"1.8.14"})})(jQuery);
436
- ;/*
437
- * jQuery UI Tabs 1.8.14
438
- *
439
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
440
- * Dual licensed under the MIT or GPL Version 2 licenses.
441
- * http://jquery.org/license
442
- *
443
- * http://docs.jquery.com/UI/Tabs
444
- *
445
- * Depends:
446
- * jquery.ui.core.js
447
- * jquery.ui.widget.js
448
- */
449
- (function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&&
450
- e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=
451
- d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]||
452
- (q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");
453
- this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected=
454
- this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");
455
- if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));
456
- this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+
457
- g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal",
458
- function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")};
459
- this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected=
460
- -1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";
461
- d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e=
462
- d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b,
463
- e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]);
464
- j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();
465
- if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1<this.anchors.length?1:-1));e.disabled=d.map(d.grep(e.disabled,function(h){return h!=b}),function(h){return h>=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null,
466
- this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this},
467
- load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c,
468
- "cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},
469
- url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.14"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k<a.anchors.length?k:0)},b);j&&j.stopPropagation()});e=a._unrotate||(a._unrotate=!e?function(j){j.clientX&&
470
- a.rotate(null)}:function(){t=c.selected;h()});if(b){this.element.bind("tabsshow",h);this.anchors.bind(c.event+".tabs",e);h()}else{clearTimeout(a.rotation);this.element.unbind("tabsshow",h);this.anchors.unbind(c.event+".tabs",e);delete this._rotate;delete this._unrotate}return this}})})(jQuery);
471
- ;/*
472
- * jQuery UI Datepicker 1.8.14
473
- *
474
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
475
- * Dual licensed under the MIT or GPL Version 2 licenses.
476
- * http://jquery.org/license
477
- *
478
- * http://docs.jquery.com/UI/Datepicker
479
- *
480
- * Depends:
481
- * jquery.ui.core.js
482
- */
483
- (function(d,C){function M(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
484
- "ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su",
485
- "Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
486
- minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=N(d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function N(a){return a.bind("mouseout",function(b){b=
487
- d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");b.length&&b.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(d.datepicker._isDisabledDatepicker(J.inline?a.parent()[0]:J.input[0])||!b.length)){b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");b.addClass("ui-state-hover");
488
- b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover");b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover")}})}function H(a,b){d.extend(a,b);for(var c in b)if(b[c]==null||b[c]==C)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.14"}});var A=(new Date).getTime(),J;d.extend(M.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){H(this._defaults,
489
- a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,
490
- selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:N(d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=
491
- h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=
492
- this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,
493
- "autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++)if(f[g].length>h){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",
494
- function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.dpDiv.show()}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);
495
- a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}H(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",
496
- this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",
497
- this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span"){b=
498
- b.children("."+this._inlineClass);b.children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",
499
- cursor:"default"})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return true;return false},
500
- _getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?d.extend({},e.settings):this._get(e,b):null;var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepicker(a,true),i=this._getMinMaxDate(e,"min"),g=this._getMinMaxDate(e,
501
- "max");H(e.settings,f);if(i!==null&&f.dateFormat!==C&&f.minDate===C)e.settings.minDate=this._formatDate(e,i);if(g!==null&&f.dateFormat!==C&&f.maxDate===C)e.settings.maxDate=this._formatDate(e,g);this._attachments(d(a),e);this._autoSize(e);this._setDate(e,h);this._updateAlternate(e);this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,
502
- b);this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=true;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv);
503
- c[0]?d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]):d.datepicker._hideDatepicker();return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)d.datepicker._clearDate(a.target);
504
- c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)d.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?+1:-1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||
505
- a.metaKey)d.datepicker._adjustDate(a.target,e?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,+7,"D");c=a.ctrlKey||a.metaKey;break;default:c=false}else if(a.keyCode==36&&a.ctrlKey)d.datepicker._showDatepicker(this);else c=false;if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=
506
- d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));var c=String.fromCharCode(a.charCode==C?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);
507
- d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);if(d.datepicker._curInst&&d.datepicker._curInst!=b){d.datepicker._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._curInst);d.datepicker._curInst.dpDiv.stop(true,true)}var c=
508
- d.datepicker._get(b,"beforeShow");H(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c=
509
- {left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover");
510
- if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing=true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);
511
- J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");
512
- a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||
513
- c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+
514
- i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b)b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b=
515
- this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();d.datepicker._triggerOnClose(b);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",
516
- left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&
517
- d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=
518
- b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=
519
- !b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);
520
- a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));
521
- d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%
522
- 100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=B+1<a.length&&a.charAt(B+1)==p)&&B++;return p},m=function(p){var D=o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"&&D?4:p=="o"?3:2)+"}");p=b.substring(q).match(p);if(!p)throw"Missing number at position "+q;q+=
523
- p[0].length;return parseInt(p[0],10)},n=function(p,D,K){p=d.map(o(p)?K:D,function(w,x){return[[x,w]]}).sort(function(w,x){return-(w[1].length-x[1].length)});var E=-1;d.each(p,function(w,x){w=x[1];if(b.substr(q,w.length).toLowerCase()==w.toLowerCase()){E=x[0];q+=w.length;return false}});if(E!=-1)return E+1;else throw"Unknown name at position "+q;},s=function(){if(b.charAt(q)!=a.charAt(B))throw"Unexpected literal at position "+q;q++},q=0,B=0;B<a.length;B++)if(k)if(a.charAt(B)=="'"&&!o("'"))k=false;
524
- else s();else switch(a.charAt(B)){case "d":l=m("d");break;case "D":n("D",f,h);break;case "o":u=m("o");break;case "m":j=m("m");break;case "M":j=n("M",i,g);break;case "y":c=m("y");break;case "@":var v=new Date(m("@"));c=v.getFullYear();j=v.getMonth()+1;l=v.getDate();break;case "!":v=new Date((m("!")-this._ticksTo1970)/1E4);c=v.getFullYear();j=v.getMonth()+1;l=v.getDate();break;case "'":if(o("'"))s();else k=true;break;default:s()}if(q<b.length)throw"Extra/unparsed characters found in date: "+b.substring(q);
525
- if(c==-1)c=(new Date).getFullYear();else if(c<100)c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100);if(u>-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,j-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=j||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",
526
- TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+1<a.length&&a.charAt(k+1)==o)&&k++;return o},g=function(o,m,n){m=""+m;if(i(o))for(;m.length<
527
- n;)m="0"+m;return m},j=function(o,m,n,s){return i(o)?s[m]:n[m]},l="",u=false;if(b)for(var k=0;k<a.length;k++)if(u)if(a.charAt(k)=="'"&&!i("'"))u=false;else l+=a.charAt(k);else switch(a.charAt(k)){case "d":l+=g("d",b.getDate(),2);break;case "D":l+=j("D",b.getDay(),e,f);break;case "o":l+=g("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864E5),3);break;case "m":l+=g("m",b.getMonth()+1,2);break;case "M":l+=j("M",b.getMonth(),h,
528
- c);break;case "y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case "@":l+=b.getTime();break;case "!":l+=b.getTime()*1E4+this._ticksTo1970;break;case "'":if(i("'"))l+="'";else u=true;break;default:l+=a.charAt(k)}return l},_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f=0;f<a.length;f++)if(c)if(a.charAt(f)=="'"&&!e("'"))c=false;else b+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":b+=
529
- "0123456789";break;case "D":case "M":return null;case "'":if(e("'"))b+="'";else c=true;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return a.settings[b]!==C?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=
530
- f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date;i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=
531
- (h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,j=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,k=u.exec(h);k;){switch(k[2]||"d"){case "d":case "D":g+=parseInt(k[1],10);break;case "w":case "W":g+=parseInt(k[1],10)*7;break;case "m":case "M":l+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break;case "y":case "Y":j+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break}k=u.exec(h)}return new Date(j,
532
- l,g)};if(b=(b=b==null||b===""?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):new Date(b.getTime()))&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=
533
- a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),
534
- b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=
535
- this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&n<k?k:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+A+".datepicker._adjustDate('#"+a.id+"', -"+j+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+
536
- (c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var s=this._get(a,"nextText");s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(m,g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+A+".datepicker._adjustDate('#"+a.id+"', +"+j+", 'M');\" title=\""+s+'"><span class="ui-icon ui-icon-circle-triangle-'+
537
- (c?"w":"e")+'">'+s+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>";j=this._get(a,"currentText");s=this._get(a,"gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,s,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+A+'.datepicker._hideDatepicker();">'+this._get(a,
538
- "closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,s)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+A+".datepicker._gotoToday('#"+a.id+"');\">"+j+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var q=this._get(a,"dayNamesMin"),B=
539
- this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),D=this._get(a,"showOtherMonths"),K=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x=0;x<i[0];x++){var O="";this.maxRows=4;for(var G=0;G<i[1];G++){var P=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",y="";if(l){y+='<div class="ui-datepicker-group';if(i[1]>1)switch(G){case 0:y+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":
540
- "left");break;case i[1]-1:y+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepicker-group-middle";t="";break}y+='">'}y+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&x==0?c?f:n:"")+(/all|right/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,B,v)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var z=j?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":
541
- "";for(t=0;t<7;t++){var r=(t+h)%7;z+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+s[r]+'">'+q[r]+"</span></th>"}y+=z+"</tr></thead><tbody>";z=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,z);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;z=Math.ceil((t+z)/7);this.maxRows=z=l?this.maxRows>z?this.maxRows:z:z;r=this._daylightSavingAdjust(new Date(m,g,1-t));for(var Q=0;Q<z;Q++){y+="<tr>";var R=!j?"":'<td class="ui-datepicker-week-col">'+
542
- this._get(a,"calculateWeek")(r)+"</td>";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[r]):[true,""],F=r.getMonth()!=g,L=F&&!K||!I[0]||k&&r<k||o&&r>o;R+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(r.getTime()==P.getTime()&&g==a.selectedMonth&&a._keyEvent||E.getTime()==r.getTime()&&E.getTime()==P.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!D?"":" "+I[1]+(r.getTime()==u.getTime()?" "+
543
- this._currentClass:"")+(r.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!F||D)&&I[2]?' title="'+I[2]+'"':"")+(L?"":' onclick="DP_jQuery_'+A+".datepicker._selectDay('#"+a.id+"',"+r.getMonth()+","+r.getFullYear()+', this);return false;"')+">"+(F&&!D?"&#xa0;":L?'<span class="ui-state-default">'+r.getDate()+"</span>":'<a class="ui-state-default'+(r.getTime()==b.getTime()?" ui-state-highlight":"")+(r.getTime()==u.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+'" href="#">'+
544
- r.getDate()+"</a>")+"</td>";r.setDate(r.getDate()+1);r=this._daylightSavingAdjust(r)}y+=R+"</tr>"}g++;if(g>11){g=0;m++}y+="</tbody></table>"+(l?"</div>"+(i[0]>0&&G==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");O+=y}w+=O}w+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");a._keyEvent=false;return w},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),
545
- l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-title">',o="";if(h||!j)o+='<span class="ui-datepicker-month">'+i[b]+"</span>";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+A+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" onclick=\"DP_jQuery_"+A+".datepicker._clickMonthYear('#"+a.id+"');\">";for(var n=0;n<12;n++)if((!i||n>=e.getMonth())&&(!m||n<=f.getMonth()))o+='<option value="'+
546
- n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";o+="</select>"}u||(k+=o+(h||!(j&&l)?"&#xa0;":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+='<span class="ui-datepicker-year">'+c+"</span>";else{g=this._get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q.match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10):parseInt(q,10);return isNaN(q)?s:q};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):
547
- g;for(a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+A+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" onclick=\"DP_jQuery_"+A+".datepicker._clickMonthYear('#"+a.id+"');\">";b<=g;b++)a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";a.yearshtml+="</select>";k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?"&#xa0;":"")+o;k+="</div>";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c==
548
- "Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");
549
- if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);
550
- c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,
551
- "dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=
552
- function(a){if(!this.length)return this;if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,
553
- [this[0]].concat(b));return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.14";window["DP_jQuery_"+A]=d})(jQuery);
554
- ;/*
555
- * jQuery UI Progressbar 1.8.14
556
- *
557
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
558
- * Dual licensed under the MIT or GPL Version 2 licenses.
559
- * http://jquery.org/license
560
- *
561
- * http://docs.jquery.com/UI/Progressbar
562
- *
563
- * Depends:
564
- * jquery.ui.core.js
565
- * jquery.ui.widget.js
566
- */
567
- (function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");
568
- this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*
569
- this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.14"})})(jQuery);
570
- ;/*
571
- * jQuery UI Effects 1.8.14
572
- *
573
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
574
- * Dual licensed under the MIT or GPL Version 2 licenses.
575
- * http://jquery.org/license
576
- *
577
- * http://docs.jquery.com/UI/Effects/
578
- */
579
- jQuery.effects||function(f,j){function m(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1],
580
- 16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return n.transparent;return n[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return m(b)}function o(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,
581
- a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function p(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d=
582
- a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function l(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor",
583
- "borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=m(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var n={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,
584
- 0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,
585
- 211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},q=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,
586
- d){if(f.isFunction(b)){d=b;b=null}return this.queue(function(){var e=f(this),g=e.attr("style")||" ",h=p(o.call(this)),r,v=e.attr("class");f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});r=p(o.call(this));e.attr("class",v);e.animate(u(h,r),{queue:false,duration:a,easing:b,complete:function(){f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments);f.dequeue(this)}})})};
587
- f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,
588
- [{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.14",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,a){var b;switch(c[0]){case "top":b=
589
- 0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});
590
- c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);return c},setTransition:function(c,
591
- a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)},_show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments);else{var a=k.apply(this,arguments);
592
- a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%",
593
- "pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*
594
- ((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=
595
- e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=
596
- e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/
597
- h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);if(a<1)return-0.5*
598
- h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,a,b,d,e){return d-f.easing.easeOutBounce(c,
599
- e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+b;return f.easing.easeOutBounce(c,a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);
600
- ;/*
601
- * jQuery UI Effects Blind 1.8.14
602
- *
603
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
604
- * Dual licensed under the MIT or GPL Version 2 licenses.
605
- * http://jquery.org/license
606
- *
607
- * http://docs.jquery.com/UI/Effects/Blind
608
- *
609
- * Depends:
610
- * jquery.effects.core.js
611
- */
612
- (function(b){b.effects.blind=function(c){return this.queue(function(){var a=b(this),g=["position","top","bottom","left","right"],f=b.effects.setMode(a,c.options.mode||"hide"),d=c.options.direction||"vertical";b.effects.save(a,g);a.show();var e=b.effects.createWrapper(a).css({overflow:"hidden"}),h=d=="vertical"?"height":"width";d=d=="vertical"?e.height():e.width();f=="show"&&e.css(h,0);var i={};i[h]=f=="show"?d:0;e.animate(i,c.duration,c.options.easing,function(){f=="hide"&&a.hide();b.effects.restore(a,
613
- g);b.effects.removeWrapper(a);c.callback&&c.callback.apply(a[0],arguments);a.dequeue()})})}})(jQuery);
614
- ;/*
615
- * jQuery UI Effects Bounce 1.8.14
616
- *
617
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
618
- * Dual licensed under the MIT or GPL Version 2 licenses.
619
- * http://jquery.org/license
620
- *
621
- * http://docs.jquery.com/UI/Effects/Bounce
622
- *
623
- * Depends:
624
- * jquery.effects.core.js
625
- */
626
- (function(e){e.effects.bounce=function(b){return this.queue(function(){var a=e(this),l=["position","top","bottom","left","right"],h=e.effects.setMode(a,b.options.mode||"effect"),d=b.options.direction||"up",c=b.options.distance||20,m=b.options.times||5,i=b.duration||250;/show|hide/.test(h)&&l.push("opacity");e.effects.save(a,l);a.show();e.effects.createWrapper(a);var f=d=="up"||d=="down"?"top":"left";d=d=="up"||d=="left"?"pos":"neg";c=b.options.distance||(f=="top"?a.outerHeight({margin:true})/3:a.outerWidth({margin:true})/
627
- 3);if(h=="show")a.css("opacity",0).css(f,d=="pos"?-c:c);if(h=="hide")c/=m*2;h!="hide"&&m--;if(h=="show"){var g={opacity:1};g[f]=(d=="pos"?"+=":"-=")+c;a.animate(g,i/2,b.options.easing);c/=2;m--}for(g=0;g<m;g++){var j={},k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing);c=h=="hide"?c*2:c/2}if(h=="hide"){g={opacity:0};g[f]=(d=="pos"?"-=":"+=")+c;a.animate(g,i/2,b.options.easing,function(){a.hide();e.effects.restore(a,l);e.effects.removeWrapper(a);
628
- b.callback&&b.callback.apply(this,arguments)})}else{j={};k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing,function(){e.effects.restore(a,l);e.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments)})}a.queue("fx",function(){a.dequeue()});a.dequeue()})}})(jQuery);
629
- ;/*
630
- * jQuery UI Effects Clip 1.8.14
631
- *
632
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
633
- * Dual licensed under the MIT or GPL Version 2 licenses.
634
- * http://jquery.org/license
635
- *
636
- * http://docs.jquery.com/UI/Effects/Clip
637
- *
638
- * Depends:
639
- * jquery.effects.core.js
640
- */
641
- (function(b){b.effects.clip=function(e){return this.queue(function(){var a=b(this),i=["position","top","bottom","left","right","height","width"],f=b.effects.setMode(a,e.options.mode||"hide"),c=e.options.direction||"vertical";b.effects.save(a,i);a.show();var d=b.effects.createWrapper(a).css({overflow:"hidden"});d=a[0].tagName=="IMG"?d:a;var g={size:c=="vertical"?"height":"width",position:c=="vertical"?"top":"left"};c=c=="vertical"?d.height():d.width();if(f=="show"){d.css(g.size,0);d.css(g.position,
642
- c/2)}var h={};h[g.size]=f=="show"?c:0;h[g.position]=f=="show"?0:c/2;d.animate(h,{queue:false,duration:e.duration,easing:e.options.easing,complete:function(){f=="hide"&&a.hide();b.effects.restore(a,i);b.effects.removeWrapper(a);e.callback&&e.callback.apply(a[0],arguments);a.dequeue()}})})}})(jQuery);
643
- ;/*
644
- * jQuery UI Effects Drop 1.8.14
645
- *
646
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
647
- * Dual licensed under the MIT or GPL Version 2 licenses.
648
- * http://jquery.org/license
649
- *
650
- * http://docs.jquery.com/UI/Effects/Drop
651
- *
652
- * Depends:
653
- * jquery.effects.core.js
654
- */
655
- (function(c){c.effects.drop=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right","opacity"],e=c.effects.setMode(a,d.options.mode||"hide"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a);var f=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var g=d.options.distance||(f=="top"?a.outerHeight({margin:true})/2:a.outerWidth({margin:true})/2);if(e=="show")a.css("opacity",0).css(f,b=="pos"?-g:g);var i={opacity:e==
656
- "show"?1:0};i[f]=(e=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+g;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){e=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
657
- ;/*
658
- * jQuery UI Effects Explode 1.8.14
659
- *
660
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
661
- * Dual licensed under the MIT or GPL Version 2 licenses.
662
- * http://jquery.org/license
663
- *
664
- * http://docs.jquery.com/UI/Effects/Explode
665
- *
666
- * Depends:
667
- * jquery.effects.core.js
668
- */
669
- (function(j){j.effects.explode=function(a){return this.queue(function(){var c=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3,d=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3;a.options.mode=a.options.mode=="toggle"?j(this).is(":visible")?"hide":"show":a.options.mode;var b=j(this).show().css("visibility","hidden"),g=b.offset();g.top-=parseInt(b.css("marginTop"),10)||0;g.left-=parseInt(b.css("marginLeft"),10)||0;for(var h=b.outerWidth(true),i=b.outerHeight(true),e=0;e<c;e++)for(var f=
670
- 0;f<d;f++)b.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+
671
- e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery);
672
- ;/*
673
- * jQuery UI Effects Fade 1.8.14
674
- *
675
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
676
- * Dual licensed under the MIT or GPL Version 2 licenses.
677
- * http://jquery.org/license
678
- *
679
- * http://docs.jquery.com/UI/Effects/Fade
680
- *
681
- * Depends:
682
- * jquery.effects.core.js
683
- */
684
- (function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
685
- ;/*
686
- * jQuery UI Effects Fold 1.8.14
687
- *
688
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
689
- * Dual licensed under the MIT or GPL Version 2 licenses.
690
- * http://jquery.org/license
691
- *
692
- * http://docs.jquery.com/UI/Effects/Fold
693
- *
694
- * Depends:
695
- * jquery.effects.core.js
696
- */
697
- (function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],
698
- 10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery);
699
- ;/*
700
- * jQuery UI Effects Highlight 1.8.14
701
- *
702
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
703
- * Dual licensed under the MIT or GPL Version 2 licenses.
704
- * http://jquery.org/license
705
- *
706
- * http://docs.jquery.com/UI/Effects/Highlight
707
- *
708
- * Depends:
709
- * jquery.effects.core.js
710
- */
711
- (function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&&
712
- this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
713
- ;/*
714
- * jQuery UI Effects Pulsate 1.8.14
715
- *
716
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
717
- * Dual licensed under the MIT or GPL Version 2 licenses.
718
- * http://jquery.org/license
719
- *
720
- * http://docs.jquery.com/UI/Effects/Pulsate
721
- *
722
- * Depends:
723
- * jquery.effects.core.js
724
- */
725
- (function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c<times;c++){b.animate({opacity:animateTo},duration,a.options.easing);animateTo=(animateTo+1)%2}b.animate({opacity:animateTo},duration,
726
- a.options.easing,function(){animateTo==0&&b.hide();a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()}).dequeue()})}})(jQuery);
727
- ;/*
728
- * jQuery UI Effects Scale 1.8.14
729
- *
730
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
731
- * Dual licensed under the MIT or GPL Version 2 licenses.
732
- * http://jquery.org/license
733
- *
734
- * http://docs.jquery.com/UI/Effects/Scale
735
- *
736
- * Depends:
737
- * jquery.effects.core.js
738
- */
739
- (function(c){c.effects.puff=function(b){return this.queue(function(){var a=c(this),e=c.effects.setMode(a,b.options.mode||"hide"),g=parseInt(b.options.percent,10)||150,h=g/100,i={height:a.height(),width:a.width()};c.extend(b.options,{fade:true,mode:e,percent:e=="hide"?g:100,from:e=="hide"?i:{height:i.height*h,width:i.width*h}});a.effect("scale",b.options,b.duration,b.callback);a.dequeue()})};c.effects.scale=function(b){return this.queue(function(){var a=c(this),e=c.extend(true,{},b.options),g=c.effects.setMode(a,
740
- b.options.mode||"effect"),h=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:g=="hide"?0:100),i=b.options.direction||"both",f=b.options.origin;if(g!="effect"){e.origin=f||["middle","center"];e.restore=true}f={height:a.height(),width:a.width()};a.from=b.options.from||(g=="show"?{height:0,width:0}:f);h={y:i!="horizontal"?h/100:1,x:i!="vertical"?h/100:1};a.to={height:f.height*h.y,width:f.width*h.x};if(b.options.fade){if(g=="show"){a.from.opacity=0;a.to.opacity=1}if(g=="hide"){a.from.opacity=
741
- 1;a.to.opacity=0}}e.from=a.from;e.to=a.to;e.mode=g;a.effect("size",e,b.duration,b.callback);a.dequeue()})};c.effects.size=function(b){return this.queue(function(){var a=c(this),e=["position","top","bottom","left","right","width","height","overflow","opacity"],g=["position","top","bottom","left","right","overflow","opacity"],h=["width","height","overflow"],i=["fontSize"],f=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],k=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],
742
- p=c.effects.setMode(a,b.options.mode||"effect"),n=b.options.restore||false,m=b.options.scale||"both",l=b.options.origin,j={height:a.height(),width:a.width()};a.from=b.options.from||j;a.to=b.options.to||j;if(l){l=c.effects.getBaseline(l,j);a.from.top=(j.height-a.from.height)*l.y;a.from.left=(j.width-a.from.width)*l.x;a.to.top=(j.height-a.to.height)*l.y;a.to.left=(j.width-a.to.width)*l.x}var d={from:{y:a.from.height/j.height,x:a.from.width/j.width},to:{y:a.to.height/j.height,x:a.to.width/j.width}};
743
- if(m=="box"||m=="both"){if(d.from.y!=d.to.y){e=e.concat(f);a.from=c.effects.setTransition(a,f,d.from.y,a.from);a.to=c.effects.setTransition(a,f,d.to.y,a.to)}if(d.from.x!=d.to.x){e=e.concat(k);a.from=c.effects.setTransition(a,k,d.from.x,a.from);a.to=c.effects.setTransition(a,k,d.to.x,a.to)}}if(m=="content"||m=="both")if(d.from.y!=d.to.y){e=e.concat(i);a.from=c.effects.setTransition(a,i,d.from.y,a.from);a.to=c.effects.setTransition(a,i,d.to.y,a.to)}c.effects.save(a,n?e:g);a.show();c.effects.createWrapper(a);
744
- a.css("overflow","hidden").css(a.from);if(m=="content"||m=="both"){f=f.concat(["marginTop","marginBottom"]).concat(i);k=k.concat(["marginLeft","marginRight"]);h=e.concat(f).concat(k);a.find("*[width]").each(function(){child=c(this);n&&c.effects.save(child,h);var o={height:child.height(),width:child.width()};child.from={height:o.height*d.from.y,width:o.width*d.from.x};child.to={height:o.height*d.to.y,width:o.width*d.to.x};if(d.from.y!=d.to.y){child.from=c.effects.setTransition(child,f,d.from.y,child.from);
745
- child.to=c.effects.setTransition(child,f,d.to.y,child.to)}if(d.from.x!=d.to.x){child.from=c.effects.setTransition(child,k,d.from.x,child.from);child.to=c.effects.setTransition(child,k,d.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){n&&c.effects.restore(child,h)})})}a.animate(a.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){a.to.opacity===0&&a.css("opacity",a.from.opacity);p=="hide"&&a.hide();c.effects.restore(a,
746
- n?e:g);c.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
747
- ;/*
748
- * jQuery UI Effects Shake 1.8.14
749
- *
750
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
751
- * Dual licensed under the MIT or GPL Version 2 licenses.
752
- * http://jquery.org/license
753
- *
754
- * http://docs.jquery.com/UI/Effects/Shake
755
- *
756
- * Depends:
757
- * jquery.effects.core.js
758
- */
759
- (function(d){d.effects.shake=function(a){return this.queue(function(){var b=d(this),j=["position","top","bottom","left","right"];d.effects.setMode(b,a.options.mode||"effect");var c=a.options.direction||"left",e=a.options.distance||20,l=a.options.times||3,f=a.duration||a.options.duration||140;d.effects.save(b,j);b.show();d.effects.createWrapper(b);var g=c=="up"||c=="down"?"top":"left",h=c=="up"||c=="left"?"pos":"neg";c={};var i={},k={};c[g]=(h=="pos"?"-=":"+=")+e;i[g]=(h=="pos"?"+=":"-=")+e*2;k[g]=
760
- (h=="pos"?"-=":"+=")+e*2;b.animate(c,f,a.options.easing);for(e=1;e<l;e++)b.animate(i,f,a.options.easing).animate(k,f,a.options.easing);b.animate(i,f,a.options.easing).animate(c,f/2,a.options.easing,function(){d.effects.restore(b,j);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()});b.dequeue()})}})(jQuery);
761
- ;/*
762
- * jQuery UI Effects Slide 1.8.14
763
- *
764
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
765
- * Dual licensed under the MIT or GPL Version 2 licenses.
766
- * http://jquery.org/license
767
- *
768
- * http://docs.jquery.com/UI/Effects/Slide
769
- *
770
- * Depends:
771
- * jquery.effects.core.js
772
- */
773
- (function(c){c.effects.slide=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right"],f=c.effects.setMode(a,d.options.mode||"show"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a).css({overflow:"hidden"});var g=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var e=d.options.distance||(g=="top"?a.outerHeight({margin:true}):a.outerWidth({margin:true}));if(f=="show")a.css(g,b=="pos"?isNaN(e)?"-"+e:-e:e);
774
- var i={};i[g]=(f=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+e;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){f=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
775
- ;/*
776
- * jQuery UI Effects Transfer 1.8.14
777
- *
778
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
779
- * Dual licensed under the MIT or GPL Version 2 licenses.
780
- * http://jquery.org/license
781
- *
782
- * http://docs.jquery.com/UI/Effects/Transfer
783
- *
784
- * Depends:
785
- * jquery.effects.core.js
786
- */
787
- (function(e){e.effects.transfer=function(a){return this.queue(function(){var b=e(this),c=e(a.options.to),d=c.offset();c={top:d.top,left:d.left,height:c.innerHeight(),width:c.innerWidth()};d=b.offset();var f=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments);
788
- b.dequeue()})})}})(jQuery);
789
- ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/jquery/jquery.corner.js DELETED
@@ -1,152 +0,0 @@
1
- /*
2
- * jQuery corner plugin
3
- *
4
- * version 1.7 (1/26/2007)
5
- *
6
- * Dual licensed under the MIT and GPL licenses:
7
- * http://www.opensource.org/licenses/mit-license.php
8
- * http://www.gnu.org/licenses/gpl.html
9
- */
10
-
11
- /**
12
- * The corner() method provides a simple way of styling DOM elements.
13
- *
14
- * corner() takes a single string argument: $().corner("effect corners width")
15
- *
16
- * effect: The name of the effect to apply, such as round or bevel.
17
- * If you don't specify an effect, rounding is used.
18
- *
19
- * corners: The corners can be one or more of top, bottom, tr, tl, br, or bl.
20
- * By default, all four corners are adorned.
21
- *
22
- * width: The width specifies the width of the effect; in the case of rounded corners this
23
- * will be the radius of the width.
24
- * Specify this value using the px suffix such as 10px, and yes it must be pixels.
25
- *
26
- * For more details see: http://methvin.com/jquery/jq-corner.html
27
- * For a full demo see: http://malsup.com/jquery/corner/
28
- *
29
- *
30
- * @example $('.adorn').corner();
31
- * @desc Create round, 10px corners
32
- *
33
- * @example $('.adorn').corner("25px");
34
- * @desc Create round, 25px corners
35
- *
36
- * @example $('.adorn').corner("notch bottom");
37
- * @desc Create notched, 10px corners on bottom only
38
- *
39
- * @example $('.adorn').corner("tr dog 25px");
40
- * @desc Create dogeared, 25px corner on the top-right corner only
41
- *
42
- * @example $('.adorn').corner("round 8px").parent().css('padding', '4px').corner("round 10px");
43
- * @desc Create a rounded border effect by styling both the element and its parent
44
- *
45
- * @name corner
46
- * @type jQuery
47
- * @param String options Options which control the corner style
48
- * @cat Plugins/Corner
49
- * @return jQuery
50
- * @author Dave Methvin (dave.methvin@gmail.com)
51
- * @author Mike Alsup (malsup@gmail.com)
52
- */
53
- jQuery.fn.corner = function(o) {
54
- function hex2(s) {
55
- var s = parseInt(s).toString(16);
56
- return ( s.length < 2 ) ? '0'+s : s;
57
- };
58
- function gpc(node) {
59
- for ( ; node && node.nodeName.toLowerCase() != 'html'; node = node.parentNode ) {
60
- var v = jQuery.css(node,'backgroundColor');
61
- if ( v.indexOf('rgb') >= 0 ) {
62
- rgb = v.match(/\d+/g);
63
- return '#'+ hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]);
64
- }
65
- if ( v && v != 'transparent' )
66
- return v;
67
- }
68
- return '#ffffff';
69
- };
70
- function getW(i) {
71
- switch(fx) {
72
- case 'round': return Math.round(width*(1-Math.cos(Math.asin(i/width))));
73
- case 'cool': return Math.round(width*(1+Math.cos(Math.asin(i/width))));
74
- case 'sharp': return Math.round(width*(1-Math.cos(Math.acos(i/width))));
75
- case 'bite': return Math.round(width*(Math.cos(Math.asin((width-i-1)/width))));
76
- case 'slide': return Math.round(width*(Math.atan2(i,width/i)));
77
- case 'jut': return Math.round(width*(Math.atan2(width,(width-i-1))));
78
- case 'curl': return Math.round(width*(Math.atan(i)));
79
- case 'tear': return Math.round(width*(Math.cos(i)));
80
- case 'wicked': return Math.round(width*(Math.tan(i)));
81
- case 'long': return Math.round(width*(Math.sqrt(i)));
82
- case 'sculpt': return Math.round(width*(Math.log((width-i-1),width)));
83
- case 'dog': return (i&1) ? (i+1) : width;
84
- case 'dog2': return (i&2) ? (i+1) : width;
85
- case 'dog3': return (i&3) ? (i+1) : width;
86
- case 'fray': return (i%2)*width;
87
- case 'notch': return width;
88
- case 'bevel': return i+1;
89
- }
90
- };
91
- o = (o||"").toLowerCase();
92
- var keep = /keep/.test(o); // keep borders?
93
- var cc = ((o.match(/cc:(#[0-9a-f]+)/)||[])[1]); // corner color
94
- var sc = ((o.match(/sc:(#[0-9a-f]+)/)||[])[1]); // strip color
95
- var width = parseInt((o.match(/(\d+)px/)||[])[1]) || 10; // corner width
96
- var re = /round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/;
97
- var fx = ((o.match(re)||['round'])[0]);
98
- var edges = { T:0, B:1 };
99
- var opts = {
100
- TL: /top|tl/.test(o), TR: /top|tr/.test(o),
101
- BL: /bottom|bl/.test(o), BR: /bottom|br/.test(o)
102
- };
103
- if ( !opts.TL && !opts.TR && !opts.BL && !opts.BR )
104
- opts = { TL:1, TR:1, BL:1, BR:1 };
105
- var strip = document.createElement('div');
106
- strip.style.overflow = 'hidden';
107
- strip.style.height = '1px';
108
- strip.style.backgroundColor = sc || 'transparent';
109
- strip.style.borderStyle = 'solid';
110
- return this.each(function(index){
111
- var pad = {
112
- T: parseInt(jQuery.css(this,'paddingTop'))||0, R: parseInt(jQuery.css(this,'paddingRight'))||0,
113
- B: parseInt(jQuery.css(this,'paddingBottom'))||0, L: parseInt(jQuery.css(this,'paddingLeft'))||0
114
- };
115
-
116
- if (jQuery.browser.msie) this.style.zoom = 1; // force 'hasLayout' in IE
117
- if (!keep) this.style.border = 'none';
118
- strip.style.borderColor = cc || gpc(this.parentNode);
119
- var cssHeight = jQuery.curCSS(this, 'height');
120
-
121
- for (var j in edges) {
122
- var bot = edges[j];
123
- strip.style.borderStyle = 'none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none');
124
- var d = document.createElement('div');
125
- var ds = d.style;
126
-
127
- bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild);
128
-
129
- if (bot && cssHeight != 'auto') {
130
- if (jQuery.css(this,'position') == 'static')
131
- this.style.position = 'relative';
132
- ds.position = 'absolute';
133
- ds.bottom = ds.left = ds.padding = ds.margin = '0';
134
- if (jQuery.browser.msie)
135
- ds.setExpression('width', 'this.parentNode.offsetWidth');
136
- else
137
- ds.width = '100%';
138
- }
139
- else {
140
- ds.margin = !bot ? '-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px' :
141
- (pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px';
142
- }
143
-
144
- for (var i=0; i < width; i++) {
145
- var w = Math.max(0,getW(i));
146
- var e = strip.cloneNode(false);
147
- e.style.borderWidth = '0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px';
148
- bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild);
149
- }
150
- }
151
- });
152
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/jquery/ui.core.js DELETED
@@ -1,295 +0,0 @@
1
- /*
2
- * jQuery UI @VERSION
3
- *
4
- * Copyright (c) 2008 Paul Bakaus (ui.jquery.com)
5
- * Dual licensed under the MIT (MIT-LICENSE.txt)
6
- * and GPL (GPL-LICENSE.txt) licenses.
7
- *
8
- * http://docs.jquery.com/UI
9
- */
10
- ;(function($) {
11
-
12
- $.ui = {
13
- plugin: {
14
- add: function(module, option, set) {
15
- var proto = $.ui[module].prototype;
16
- for(var i in set) {
17
- proto.plugins[i] = proto.plugins[i] || [];
18
- proto.plugins[i].push([option, set[i]]);
19
- }
20
- },
21
- call: function(instance, name, args) {
22
- var set = instance.plugins[name];
23
- if(!set) { return; }
24
-
25
- for (var i = 0; i < set.length; i++) {
26
- if (instance.options[set[i][0]]) {
27
- set[i][1].apply(instance.element, args);
28
- }
29
- }
30
- }
31
- },
32
- cssCache: {},
33
- css: function(name) {
34
- if ($.ui.cssCache[name]) { return $.ui.cssCache[name]; }
35
- var tmp = $('<div class="ui-gen">').addClass(name).css({position:'absolute', top:'-5000px', left:'-5000px', display:'block'}).appendTo('body');
36
-
37
- //if (!$.browser.safari)
38
- //tmp.appendTo('body');
39
-
40
- //Opera and Safari set width and height to 0px instead of auto
41
- //Safari returns rgba(0,0,0,0) when bgcolor is not set
42
- $.ui.cssCache[name] = !!(
43
- (!(/auto|default/).test(tmp.css('cursor')) || (/^[1-9]/).test(tmp.css('height')) || (/^[1-9]/).test(tmp.css('width')) ||
44
- !(/none/).test(tmp.css('backgroundImage')) || !(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor')))
45
- );
46
- try { $('body').get(0).removeChild(tmp.get(0)); } catch(e){}
47
- return $.ui.cssCache[name];
48
- },
49
- disableSelection: function(e) {
50
- e.unselectable = "on";
51
- e.onselectstart = function() { return false; };
52
- if (e.style) { e.style.MozUserSelect = "none"; }
53
- },
54
- enableSelection: function(e) {
55
- e.unselectable = "off";
56
- e.onselectstart = function() { return true; };
57
- if (e.style) { e.style.MozUserSelect = ""; }
58
- },
59
- hasScroll: function(e, a) {
60
- var scroll = /top/.test(a||"top") ? 'scrollTop' : 'scrollLeft', has = false;
61
- if (e[scroll] > 0) return true; e[scroll] = 1;
62
- has = e[scroll] > 0 ? true : false; e[scroll] = 0;
63
- return has;
64
- }
65
- };
66
-
67
-
68
- /** jQuery core modifications and additions **/
69
-
70
- var _remove = $.fn.remove;
71
- $.fn.remove = function() {
72
- $("*", this).add(this).trigger("remove");
73
- return _remove.apply(this, arguments );
74
- };
75
-
76
- // $.widget is a factory to create jQuery plugins
77
- // taking some boilerplate code out of the plugin code
78
- // created by Scott González and Jörn Zaefferer
79
- function getter(namespace, plugin, method) {
80
- var methods = $[namespace][plugin].getter || [];
81
- methods = (typeof methods == "string" ? methods.split(/,?\s+/) : methods);
82
- return ($.inArray(method, methods) != -1);
83
- }
84
-
85
- $.widget = function(name, prototype) {
86
- var namespace = name.split(".")[0];
87
- name = name.split(".")[1];
88
-
89
- // create plugin method
90
- $.fn[name] = function(options) {
91
- var isMethodCall = (typeof options == 'string'),
92
- args = Array.prototype.slice.call(arguments, 1);
93
-
94
- if (isMethodCall && getter(namespace, name, options)) {
95
- var instance = $.data(this[0], name);
96
- return (instance ? instance[options].apply(instance, args)
97
- : undefined);
98
- }
99
-
100
- return this.each(function() {
101
- var instance = $.data(this, name);
102
- if (isMethodCall && instance && $.isFunction(instance[options])) {
103
- instance[options].apply(instance, args);
104
- } else if (!isMethodCall) {
105
- $.data(this, name, new $[namespace][name](this, options));
106
- }
107
- });
108
- };
109
-
110
- // create widget constructor
111
- $[namespace][name] = function(element, options) {
112
- var self = this;
113
-
114
- this.widgetName = name;
115
- this.widgetBaseClass = namespace + '-' + name;
116
-
117
- this.options = $.extend({}, $.widget.defaults, $[namespace][name].defaults, options);
118
- this.element = $(element)
119
- .bind('setData.' + name, function(e, key, value) {
120
- return self.setData(key, value);
121
- })
122
- .bind('getData.' + name, function(e, key) {
123
- return self.getData(key);
124
- })
125
- .bind('remove', function() {
126
- return self.destroy();
127
- });
128
- this.init();
129
- };
130
-
131
- // add widget prototype
132
- $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
133
- };
134
-
135
- $.widget.prototype = {
136
- init: function() {},
137
- destroy: function() {
138
- this.element.removeData(this.widgetName);
139
- },
140
-
141
- getData: function(key) {
142
- return this.options[key];
143
- },
144
- setData: function(key, value) {
145
- this.options[key] = value;
146
-
147
- if (key == 'disabled') {
148
- this.element[value ? 'addClass' : 'removeClass'](
149
- this.widgetBaseClass + '-disabled');
150
- }
151
- },
152
-
153
- enable: function() {
154
- this.setData('disabled', false);
155
- },
156
- disable: function() {
157
- this.setData('disabled', true);
158
- }
159
- };
160
-
161
- $.widget.defaults = {
162
- disabled: false
163
- };
164
-
165
-
166
- /** Mouse Interaction Plugin **/
167
-
168
- $.ui.mouse = {
169
- mouseInit: function() {
170
- var self = this;
171
-
172
- this.element.bind('mousedown.'+this.widgetName, function(e) {
173
- return self.mouseDown(e);
174
- });
175
-
176
- // Prevent text selection in IE
177
- if ($.browser.msie) {
178
- this._mouseUnselectable = this.element.attr('unselectable');
179
- this.element.attr('unselectable', 'on');
180
- }
181
-
182
- this.started = false;
183
- },
184
-
185
- // TODO: make sure destroying one instance of mouse doesn't mess with
186
- // other instances of mouse
187
- mouseDestroy: function() {
188
- this.element.unbind('.'+this.widgetName);
189
-
190
- // Restore text selection in IE
191
- ($.browser.msie
192
- && this.element.attr('unselectable', this._mouseUnselectable));
193
- },
194
-
195
- mouseDown: function(e) {
196
- // we may have missed mouseup (out of window)
197
- (this._mouseStarted && this.mouseUp(e));
198
-
199
- this._mouseDownEvent = e;
200
-
201
- var self = this,
202
- btnIsLeft = (e.which == 1),
203
- elIsCancel = (typeof this.options.cancel == "string" ? $(e.target).is(this.options.cancel) : false);
204
- if (!btnIsLeft || elIsCancel || !this.mouseCapture(e)) {
205
- return true;
206
- }
207
-
208
- this._mouseDelayMet = !this.options.delay;
209
- if (!this._mouseDelayMet) {
210
- this._mouseDelayTimer = setTimeout(function() {
211
- self._mouseDelayMet = true;
212
- }, this.options.delay);
213
- }
214
-
215
- if (this.mouseDistanceMet(e) && this.mouseDelayMet(e)) {
216
- this._mouseStarted = (this.mouseStart(e) !== false);
217
- if (!this._mouseStarted) {
218
- e.preventDefault();
219
- return true;
220
- }
221
- }
222
-
223
- // these delegates are required to keep context
224
- this._mouseMoveDelegate = function(e) {
225
- return self.mouseMove(e);
226
- };
227
- this._mouseUpDelegate = function(e) {
228
- return self.mouseUp(e);
229
- };
230
- $(document)
231
- .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
232
- .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
233
-
234
- return false;
235
- },
236
-
237
- mouseMove: function(e) {
238
- // IE mouseup check - mouseup happened when mouse was out of window
239
- if ($.browser.msie && !e.button) {
240
- return this.mouseUp(e);
241
- }
242
-
243
- if (this._mouseStarted) {
244
- this.mouseDrag(e);
245
- return false;
246
- }
247
-
248
- if (this.mouseDistanceMet(e) && this.mouseDelayMet(e)) {
249
- this._mouseStarted =
250
- (this.mouseStart(this._mouseDownEvent, e) !== false);
251
- (this._mouseStarted ? this.mouseDrag(e) : this.mouseUp(e));
252
- }
253
-
254
- return !this._mouseStarted;
255
- },
256
-
257
- mouseUp: function(e) {
258
- $(document)
259
- .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
260
- .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
261
-
262
- if (this._mouseStarted) {
263
- this._mouseStarted = false;
264
- this.mouseStop(e);
265
- }
266
-
267
- return false;
268
- },
269
-
270
- mouseDistanceMet: function(e) {
271
- return (Math.max(
272
- Math.abs(this._mouseDownEvent.pageX - e.pageX),
273
- Math.abs(this._mouseDownEvent.pageY - e.pageY)
274
- ) >= this.options.distance
275
- );
276
- },
277
-
278
- mouseDelayMet: function(e) {
279
- return this._mouseDelayMet;
280
- },
281
-
282
- // These are placeholder methods, to be overriden by extending plugin
283
- mouseStart: function(e) {},
284
- mouseDrag: function(e) {},
285
- mouseStop: function(e) {},
286
- mouseCapture: function(e) { return true; }
287
- };
288
-
289
- $.ui.mouse.defaults = {
290
- cancel: null,
291
- distance: 1,
292
- delay: 0
293
- };
294
-
295
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/jquery/ui.draggable.js DELETED
@@ -1,560 +0,0 @@
1
- /*
2
- * jQuery UI Draggable
3
- *
4
- * Copyright (c) 2008 Paul Bakaus
5
- * Dual licensed under the MIT (MIT-LICENSE.txt)
6
- * and GPL (GPL-LICENSE.txt) licenses.
7
- *
8
- * http://docs.jquery.com/UI/Draggables
9
- *
10
- * Depends:
11
- * ui.core.js
12
- */
13
- (function($) {
14
-
15
- $.widget("ui.draggable", $.extend($.ui.mouse, {
16
- init: function() {
17
-
18
- //Initialize needed constants
19
- var o = this.options;
20
-
21
- //Position the node
22
- if (o.helper == 'original' && !(/(relative|absolute|fixed)/).test(this.element.css('position')))
23
- this.element.css('position', 'relative');
24
-
25
- this.element.addClass('ui-draggable');
26
- (o.disabled && this.element.addClass('ui-draggable-disabled'));
27
-
28
- this.mouseInit();
29
-
30
- },
31
- mouseStart: function(e) {
32
- var o = this.options;
33
-
34
- if (this.helper || o.disabled || $(e.target).is('.ui-resizable-handle')) return false;
35
-
36
- var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
37
-
38
-
39
- $(this.options.handle, this.element).find("*").andSelf().each(function() {
40
- if(this == e.target) handle = true;
41
- });
42
- if (!handle) return false;
43
-
44
- if($.ui.ddmanager) $.ui.ddmanager.current = this;
45
-
46
- //Create and append the visible helper
47
- this.helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [e])) : (o.helper == 'clone' ? this.element.clone() : this.element);
48
- if(!this.helper.parents('body').length) this.helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
49
- if(this.helper[0] != this.element[0] && !(/(fixed|absolute)/).test(this.helper.css("position"))) this.helper.css("position", "absolute");
50
-
51
- /*
52
- * - Position generation -
53
- * This block generates everything position related - it's the core of draggables.
54
- */
55
-
56
- this.margins = { //Cache the margins
57
- left: (parseInt(this.element.css("marginLeft"),10) || 0),
58
- top: (parseInt(this.element.css("marginTop"),10) || 0)
59
- };
60
-
61
- this.cssPosition = this.helper.css("position"); //Store the helper's css position
62
- this.offset = this.element.offset(); //The element's absolute position on the page
63
- this.offset = { //Substract the margins from the element's absolute offset
64
- top: this.offset.top - this.margins.top,
65
- left: this.offset.left - this.margins.left
66
- };
67
-
68
- this.offset.click = { //Where the click happened, relative to the element
69
- left: e.pageX - this.offset.left,
70
- top: e.pageY - this.offset.top
71
- };
72
-
73
- this.offsetParent = this.helper.offsetParent(); var po = this.offsetParent.offset(); //Get the offsetParent and cache its position
74
- if(this.offsetParent[0] == document.body && $.browser.mozilla) po = { top: 0, left: 0 }; //Ugly FF3 fix
75
- this.offset.parent = { //Store its position plus border
76
- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
77
- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
78
- };
79
-
80
- var p = this.element.position(); //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helpers
81
- this.offset.relative = this.cssPosition == "relative" ? {
82
- top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.offsetParent[0].scrollTop,
83
- left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.offsetParent[0].scrollLeft
84
- } : { top: 0, left: 0 };
85
-
86
- this.originalPosition = this.generatePosition(e); //Generate the original position
87
- this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Cache the helper size
88
-
89
- if(o.cursorAt) {
90
- if(o.cursorAt.left != undefined) this.offset.click.left = o.cursorAt.left + this.margins.left;
91
- if(o.cursorAt.right != undefined) this.offset.click.left = this.helperProportions.width - o.cursorAt.right + this.margins.left;
92
- if(o.cursorAt.top != undefined) this.offset.click.top = o.cursorAt.top + this.margins.top;
93
- if(o.cursorAt.bottom != undefined) this.offset.click.top = this.helperProportions.height - o.cursorAt.bottom + this.margins.top;
94
- }
95
-
96
-
97
- /*
98
- * - Position constraining -
99
- * Here we prepare position constraining like grid and containment.
100
- */
101
-
102
- if(o.containment) {
103
- if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
104
- if(o.containment == 'document' || o.containment == 'window') this.containment = [
105
- 0 - this.offset.relative.left - this.offset.parent.left,
106
- 0 - this.offset.relative.top - this.offset.parent.top,
107
- $(o.containment == 'document' ? document : window).width() - this.offset.relative.left - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.element.css("marginRight"),10) || 0),
108
- ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.offset.relative.top - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.element.css("marginBottom"),10) || 0)
109
- ];
110
-
111
- if(!(/^(document|window|parent)$/).test(o.containment)) {
112
- var ce = $(o.containment)[0];
113
- var co = $(o.containment).offset();
114
-
115
- this.containment = [
116
- co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.relative.left - this.offset.parent.left,
117
- co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.relative.top - this.offset.parent.top,
118
- co.left+Math.max(ce.scrollWidth,ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.relative.left - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.element.css("marginRight"),10) || 0),
119
- co.top+Math.max(ce.scrollHeight,ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.relative.top - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.element.css("marginBottom"),10) || 0)
120
- ];
121
- }
122
- }
123
-
124
- //Call plugins and callbacks
125
- this.propagate("start", e);
126
-
127
- this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Recache the helper size
128
- if ($.ui.ddmanager && !o.dropBehaviour) $.ui.ddmanager.prepareOffsets(this, e);
129
-
130
- this.helper.addClass("ui-draggable-dragging");
131
- this.mouseDrag(e); //Execute the drag once - this causes the helper not to be visible before getting its correct position
132
- return true;
133
- },
134
- convertPositionTo: function(d, pos) {
135
- if(!pos) pos = this.position;
136
- var mod = d == "absolute" ? 1 : -1;
137
- return {
138
- top: (
139
- pos.top // the calculated relative position
140
- + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
141
- + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
142
- - (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollTop) * mod // The offsetParent's scroll position, not if the element is fixed
143
- + (this.cssPosition == "fixed" ? $(document).scrollTop() : 0) * mod
144
- + this.margins.top * mod //Add the margin (you don't want the margin counting in intersection methods)
145
- ),
146
- left: (
147
- pos.left // the calculated relative position
148
- + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
149
- + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
150
- - (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollLeft) * mod // The offsetParent's scroll position, not if the element is fixed
151
- + (this.cssPosition == "fixed" ? $(document).scrollLeft() : 0) * mod
152
- + this.margins.left * mod //Add the margin (you don't want the margin counting in intersection methods)
153
- )
154
- };
155
- },
156
- generatePosition: function(e) {
157
-
158
- var o = this.options;
159
- var position = {
160
- top: (
161
- e.pageY // The absolute mouse position
162
- - this.offset.click.top // Click offset (relative to the element)
163
- - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
164
- - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
165
- + (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollTop) // The offsetParent's scroll position, not if the element is fixed
166
- - (this.cssPosition == "fixed" ? $(document).scrollTop() : 0)
167
- ),
168
- left: (
169
- e.pageX // The absolute mouse position
170
- - this.offset.click.left // Click offset (relative to the element)
171
- - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
172
- - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
173
- + (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollLeft) // The offsetParent's scroll position, not if the element is fixed
174
- - (this.cssPosition == "fixed" ? $(document).scrollLeft() : 0)
175
- )
176
- };
177
-
178
- if(!this.originalPosition) return position; //If we are not dragging yet, we won't check for options
179
-
180
- /*
181
- * - Position constraining -
182
- * Constrain the position to a mix of grid, containment.
183
- */
184
- if(this.containment) {
185
- if(position.left < this.containment[0]) position.left = this.containment[0];
186
- if(position.top < this.containment[1]) position.top = this.containment[1];
187
- if(position.left > this.containment[2]) position.left = this.containment[2];
188
- if(position.top > this.containment[3]) position.top = this.containment[3];
189
- }
190
-
191
- if(o.grid) {
192
- var top = this.originalPosition.top + Math.round((position.top - this.originalPosition.top) / o.grid[1]) * o.grid[1];
193
- position.top = this.containment ? (!(top < this.containment[1] || top > this.containment[3]) ? top : (!(top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
194
-
195
- var left = this.originalPosition.left + Math.round((position.left - this.originalPosition.left) / o.grid[0]) * o.grid[0];
196
- position.left = this.containment ? (!(left < this.containment[0] || left > this.containment[2]) ? left : (!(left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
197
- }
198
-
199
- return position;
200
- },
201
- mouseDrag: function(e) {
202
-
203
- //Compute the helpers position
204
- this.position = this.generatePosition(e);
205
- this.positionAbs = this.convertPositionTo("absolute");
206
-
207
- //Call plugins and callbacks and use the resulting position if something is returned
208
- this.position = this.propagate("drag", e) || this.position;
209
-
210
- if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
211
- if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
212
- if($.ui.ddmanager) $.ui.ddmanager.drag(this, e);
213
-
214
- return false;
215
- },
216
- mouseStop: function(e) {
217
-
218
- //If we are using droppables, inform the manager about the drop
219
- if ($.ui.ddmanager && !this.options.dropBehaviour)
220
- $.ui.ddmanager.drop(this, e);
221
-
222
- if(this.options.revert) {
223
- var self = this;
224
- $(this.helper).animate(this.originalPosition, parseInt(this.options.revert, 10) || 500, function() {
225
- self.propagate("stop", e);
226
- self.clear();
227
- });
228
- } else {
229
- this.propagate("stop", e);
230
- this.clear();
231
- }
232
-
233
- return false;
234
- },
235
- clear: function() {
236
- this.helper.removeClass("ui-draggable-dragging");
237
- if(this.options.helper != 'original' && !this.cancelHelperRemoval) this.helper.remove();
238
- //if($.ui.ddmanager) $.ui.ddmanager.current = null;
239
- this.helper = null;
240
- this.cancelHelperRemoval = false;
241
- },
242
-
243
- // From now on bulk stuff - mainly helpers
244
- plugins: {},
245
- uiHash: function(e) {
246
- return {
247
- helper: this.helper,
248
- position: this.position,
249
- absolutePosition: this.positionAbs,
250
- options: this.options
251
- };
252
- },
253
- propagate: function(n,e) {
254
- $.ui.plugin.call(this, n, [e, this.uiHash()]);
255
- return this.element.triggerHandler(n == "drag" ? n : "drag"+n, [e, this.uiHash()], this.options[n]);
256
- },
257
- destroy: function() {
258
- if(!this.element.data('draggable')) return;
259
- this.element.removeData("draggable").unbind(".draggable").removeClass('ui-draggable');
260
- this.mouseDestroy();
261
- }
262
- }));
263
-
264
- $.extend($.ui.draggable, {
265
- defaults: {
266
- appendTo: "parent",
267
- axis: false,
268
- cancel: ":input",
269
- delay: 0,
270
- distance: 1,
271
- helper: "original"
272
- }
273
- });
274
-
275
- $.ui.plugin.add("draggable", "cursor", {
276
- start: function(e, ui) {
277
- var t = $('body');
278
- if (t.css("cursor")) ui.options._cursor = t.css("cursor");
279
- t.css("cursor", ui.options.cursor);
280
- },
281
- stop: function(e, ui) {
282
- if (ui.options._cursor) $('body').css("cursor", ui.options._cursor);
283
- }
284
- });
285
-
286
- $.ui.plugin.add("draggable", "zIndex", {
287
- start: function(e, ui) {
288
- var t = $(ui.helper);
289
- if(t.css("zIndex")) ui.options._zIndex = t.css("zIndex");
290
- t.css('zIndex', ui.options.zIndex);
291
- },
292
- stop: function(e, ui) {
293
- if(ui.options._zIndex) $(ui.helper).css('zIndex', ui.options._zIndex);
294
- }
295
- });
296
-
297
- $.ui.plugin.add("draggable", "opacity", {
298
- start: function(e, ui) {
299
- var t = $(ui.helper);
300
- if(t.css("opacity")) ui.options._opacity = t.css("opacity");
301
- t.css('opacity', ui.options.opacity);
302
- },
303
- stop: function(e, ui) {
304
- if(ui.options._opacity) $(ui.helper).css('opacity', ui.options._opacity);
305
- }
306
- });
307
-
308
- $.ui.plugin.add("draggable", "iframeFix", {
309
- start: function(e, ui) {
310
- $(ui.options.iframeFix === true ? "iframe" : ui.options.iframeFix).each(function() {
311
- $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
312
- .css({
313
- width: this.offsetWidth+"px", height: this.offsetHeight+"px",
314
- position: "absolute", opacity: "0.001", zIndex: 1000
315
- })
316
- .css($(this).offset())
317
- .appendTo("body");
318
- });
319
- },
320
- stop: function(e, ui) {
321
- $("div.DragDropIframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
322
- }
323
- });
324
-
325
- $.ui.plugin.add("draggable", "scroll", {
326
- start: function(e, ui) {
327
- var o = ui.options;
328
- var i = $(this).data("draggable");
329
- o.scrollSensitivity = o.scrollSensitivity || 20;
330
- o.scrollSpeed = o.scrollSpeed || 20;
331
-
332
- i.overflowY = function(el) {
333
- do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-y'))) return el; el = el.parent(); } while (el[0].parentNode);
334
- return $(document);
335
- }(this);
336
- i.overflowX = function(el) {
337
- do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-x'))) return el; el = el.parent(); } while (el[0].parentNode);
338
- return $(document);
339
- }(this);
340
-
341
- if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') i.overflowYOffset = i.overflowY.offset();
342
- if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') i.overflowXOffset = i.overflowX.offset();
343
-
344
- },
345
- drag: function(e, ui) {
346
-
347
- var o = ui.options;
348
- var i = $(this).data("draggable");
349
-
350
- if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') {
351
- if((i.overflowYOffset.top + i.overflowY[0].offsetHeight) - e.pageY < o.scrollSensitivity)
352
- i.overflowY[0].scrollTop = i.overflowY[0].scrollTop + o.scrollSpeed;
353
- if(e.pageY - i.overflowYOffset.top < o.scrollSensitivity)
354
- i.overflowY[0].scrollTop = i.overflowY[0].scrollTop - o.scrollSpeed;
355
-
356
- } else {
357
- if(e.pageY - $(document).scrollTop() < o.scrollSensitivity)
358
- $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
359
- if($(window).height() - (e.pageY - $(document).scrollTop()) < o.scrollSensitivity)
360
- $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
361
- }
362
-
363
- if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') {
364
- if((i.overflowXOffset.left + i.overflowX[0].offsetWidth) - e.pageX < o.scrollSensitivity)
365
- i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft + o.scrollSpeed;
366
- if(e.pageX - i.overflowXOffset.left < o.scrollSensitivity)
367
- i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft - o.scrollSpeed;
368
- } else {
369
- if(e.pageX - $(document).scrollLeft() < o.scrollSensitivity)
370
- $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
371
- if($(window).width() - (e.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
372
- $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
373
- }
374
-
375
- }
376
- });
377
-
378
- $.ui.plugin.add("draggable", "snap", {
379
- start: function(e, ui) {
380
-
381
- var inst = $(this).data("draggable");
382
- inst.snapElements = [];
383
- $(ui.options.snap === true ? '.ui-draggable' : ui.options.snap).each(function() {
384
- var $t = $(this); var $o = $t.offset();
385
- if(this != inst.element[0]) inst.snapElements.push({
386
- item: this,
387
- width: $t.outerWidth(), height: $t.outerHeight(),
388
- top: $o.top, left: $o.left
389
- });
390
- });
391
-
392
- },
393
- drag: function(e, ui) {
394
-
395
- var inst = $(this).data("draggable");
396
- var d = ui.options.snapTolerance || 20;
397
- var x1 = ui.absolutePosition.left, x2 = x1 + inst.helperProportions.width,
398
- y1 = ui.absolutePosition.top, y2 = y1 + inst.helperProportions.height;
399
-
400
- for (var i = inst.snapElements.length - 1; i >= 0; i--){
401
-
402
- var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
403
- t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
404
-
405
- //Yes, I know, this is insane ;)
406
- if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) continue;
407
-
408
- if(ui.options.snapMode != 'inner') {
409
- var ts = Math.abs(t - y2) <= 20;
410
- var bs = Math.abs(b - y1) <= 20;
411
- var ls = Math.abs(l - x2) <= 20;
412
- var rs = Math.abs(r - x1) <= 20;
413
- if(ts) ui.position.top = inst.convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top;
414
- if(bs) ui.position.top = inst.convertPositionTo("relative", { top: b, left: 0 }).top;
415
- if(ls) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left;
416
- if(rs) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: r }).left;
417
- }
418
-
419
- if(ui.options.snapMode != 'outer') {
420
- var ts = Math.abs(t - y1) <= 20;
421
- var bs = Math.abs(b - y2) <= 20;
422
- var ls = Math.abs(l - x1) <= 20;
423
- var rs = Math.abs(r - x2) <= 20;
424
- if(ts) ui.position.top = inst.convertPositionTo("relative", { top: t, left: 0 }).top;
425
- if(bs) ui.position.top = inst.convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top;
426
- if(ls) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: l }).left;
427
- if(rs) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left;
428
- }
429
-
430
- };
431
- }
432
- });
433
-
434
- $.ui.plugin.add("draggable", "connectToSortable", {
435
- start: function(e,ui) {
436
-
437
- var inst = $(this).data("draggable");
438
- inst.sortables = [];
439
- $(ui.options.connectToSortable).each(function() {
440
- if($.data(this, 'sortable')) {
441
- var sortable = $.data(this, 'sortable');
442
- inst.sortables.push({
443
- instance: sortable,
444
- shouldRevert: sortable.options.revert
445
- });
446
- sortable.refreshItems(); //Do a one-time refresh at start to refresh the containerCache
447
- sortable.propagate("activate", e, inst);
448
- }
449
- });
450
-
451
- },
452
- stop: function(e,ui) {
453
-
454
- //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
455
- var inst = $(this).data("draggable");
456
-
457
- $.each(inst.sortables, function() {
458
- if(this.instance.isOver) {
459
- this.instance.isOver = 0;
460
- inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
461
- this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
462
- if(this.shouldRevert) this.instance.options.revert = true; //revert here
463
- this.instance.mouseStop(e);
464
-
465
- //Also propagate receive event, since the sortable is actually receiving a element
466
- this.instance.element.triggerHandler("sortreceive", [e, $.extend(this.instance.ui(), { sender: inst.element })], this.instance.options["receive"]);
467
-
468
- this.instance.options.helper = this.instance.options._helper;
469
- } else {
470
- this.instance.propagate("deactivate", e, inst);
471
- }
472
-
473
- });
474
-
475
- },
476
- drag: function(e,ui) {
477
-
478
- var inst = $(this).data("draggable"), self = this;
479
-
480
- var checkPos = function(o) {
481
-
482
- var l = o.left, r = l + o.width,
483
- t = o.top, b = t + o.height;
484
-
485
- return (l < (this.positionAbs.left + this.offset.click.left) && (this.positionAbs.left + this.offset.click.left) < r
486
- && t < (this.positionAbs.top + this.offset.click.top) && (this.positionAbs.top + this.offset.click.top) < b);
487
- };
488
-
489
- $.each(inst.sortables, function(i) {
490
-
491
- if(checkPos.call(inst, this.instance.containerCache)) {
492
-
493
- //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
494
- if(!this.instance.isOver) {
495
- this.instance.isOver = 1;
496
-
497
- //Now we fake the start of dragging for the sortable instance,
498
- //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
499
- //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
500
- this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
501
- this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
502
- this.instance.options.helper = function() { return ui.helper[0]; };
503
-
504
- e.target = this.instance.currentItem[0];
505
- this.instance.mouseCapture(e, true);
506
- this.instance.mouseStart(e, true, true);
507
-
508
- //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
509
- this.instance.offset.click.top = inst.offset.click.top;
510
- this.instance.offset.click.left = inst.offset.click.left;
511
- this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
512
- this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
513
-
514
- inst.propagate("toSortable", e);
515
-
516
- }
517
-
518
- //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
519
- if(this.instance.currentItem) this.instance.mouseDrag(e);
520
-
521
- } else {
522
-
523
- //If it doesn't intersect with the sortable, and it intersected before,
524
- //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
525
- if(this.instance.isOver) {
526
- this.instance.isOver = 0;
527
- this.instance.cancelHelperRemoval = true;
528
- this.instance.options.revert = false; //No revert here
529
- this.instance.mouseStop(e, true);
530
- this.instance.options.helper = this.instance.options._helper;
531
-
532
- //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
533
- this.instance.currentItem.remove();
534
- if(this.instance.placeholder) this.instance.placeholder.remove();
535
-
536
- inst.propagate("fromSortable", e);
537
- }
538
-
539
- };
540
-
541
- });
542
-
543
- }
544
- });
545
-
546
- $.ui.plugin.add("draggable", "stack", {
547
- start: function(e,ui) {
548
- var group = $.makeArray($(ui.options.stack.group)).sort(function(a,b) {
549
- return (parseInt($(a).css("zIndex"),10) || ui.options.stack.min) - (parseInt($(b).css("zIndex"),10) || ui.options.stack.min);
550
- });
551
-
552
- $(group).each(function(i) {
553
- this.style.zIndex = ui.options.stack.min + i;
554
- });
555
-
556
- this[0].style.zIndex = ui.options.stack.min + group.length;
557
- }
558
- });
559
-
560
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -1,127 +1,98 @@
1
  === Wp-Insert ===
2
  Contributors: Namith Jawahar
3
- Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7834514
4
- Tags: adsense,google,widget,post,admin,plugin,rss,feedburner,ads,subscribe,fck editor,category description editor,excerpt,WYSIWYG,WYSIWYG editor,in post ads,feed logo,smartlogix,ads in feeds,analytics,google analytics,header,footer,ad management,advertisements,content,ad,advertising,privacy policy,privacy,policy,automatic privacy policy,blog,feed,feeds,formatting,html,javascript,manage,post,posts,seo,sidebar,widget,widgets,wordpress,tracking,syntex highlighter,highlighting,theme tools,plugin tools,developer tools,highlighting,theme editor,plugin editor,middle ad,ad filtration,pagewise ad filtration,template ads,ad tags,adbrite ads,adsense ready,easy adsense,adsense optimized,terms and conditions,terms,conditions,automatic terms and conditions
5
- Requires at least: 3.0
6
- Tested up to: 3.3.1
7
- Stable tag: 1.7.6
 
 
8
 
9
- Wp-Insert is the most powerful yet easiest to use wordpress ad management plugin which does a lot more than ad management.
10
 
11
  == Description ==
12
 
13
- **WP-INSERT by <a href="http://www.smartlogix.co.in/" target="_self" title="Smart Logix">Smart Logix</a> : The ultimate wordpress plugin**
14
- Wp-Insert is the most powerful yet easiest to use wordpress ad management plugin which does a lot more than ad management.
15
- Wp-Insert can manage your feeds, google analytics, blog editing and even make editing your themes easier for you.
16
- All from within a well contained and easy to use interface.
17
- **Features**
18
- **Manage Ads**
19
- *Multiple Ad Network Support.* (You can now run any ad-network along with adsense or any other network)
20
- *In post ads - Allows you to insert your ads around and inside your content*
21
-
22
- * Allows copy/past of html, adsense and other ads code
23
- * Insert Ads above the content
24
- * Insert Ads below the content
25
- * Insert Ads in the middle of the content (Automatically adjusts to the length of content eliminating ads on short posts)
26
- * Insert Ads to the left of the post
27
- * Insert ads to the right of the post
28
- * Option to show/hide ads on Home Page
29
- * Option to show/hide ads on Archive/Category/Tag Pages
30
- * Option to fiter ads from specified posts/pages (With Popup picker for selecting the posts / pages)
31
- * Option to control each and every ad
32
 
33
- *10 ad widgets at your disposal*
34
 
35
- * Go to the widgets page under "Appearance" and place the widgets onto the sidebars you want the ads to appear onto
36
- * Option to style the Ads
37
- * Support for upto three different Ad networks all delivering at the same time
38
 
39
- *20 custom ad areas compatible with all themes.*
 
 
40
 
41
- * Now insert Ads anywhere on your site.
42
- * Indivigually control each ads.
43
- * Try different ad sizes and positions easily.
44
 
45
- Run adsense ads along with yahoo, adbrite, chitika or any other ad network without interfering with the terms of each network.
46
-
47
- **Manage Privacy Policy**
48
 
49
- * Readymade Adsense Compatible privacy policy for your site.
50
- * Create a Privacy policy page without even typing a Word.
51
- * Assign Privacy Policy to an existing page or create one automatically.
52
- * WYSIWYG Editor to finetune the Privacy Policy to your requirements.
 
 
 
53
 
54
- **Manage Terms and Conditions**
 
55
 
56
- * Readymade general Terms and Conditions for your site.
57
- * Create a Terms and Conditions page without even typing a Word.
58
- * Assign Terms and Conditions to an existing page or create one automatically.
59
- * WYSIWYG Editor to finetune the Terms and Conditions to your requirements.
60
 
61
- **Manage Pages**
62
 
63
- * Reorder Pages using a drag and drop interface.
 
 
64
 
65
- **Manage Feeds**
66
 
67
- * Your logo in your feeds
68
- * Insert Ads into feeds
69
- * Link your feeds to feedburner (Experimental)
70
- * Subscribe via Email widge
71
- * Subscribe to feed widget
72
 
73
  **Manage Tracking Codes**
74
 
75
  * Insert Google Analytics tracking onto all you blog pages instantly
76
- * Paste other tracking code into the header or footer of your blog
77
-
78
- **Manage WYSIWYG editing**
79
-
80
- * Replace TINY MCE with FCK EDITOR
81
- * Disable auto formatting done by wordpress (Stops the annoying autoformatting done by wordpress. You can now write your posts as you intented to write it. Also allows you to paste in javascript etc easily into your posts/pages)
82
- * WYSIWYG Category description Editor
83
- * WYSIWYG Excerpt Editor
84
 
85
  **Syntax Highlighting**
86
 
87
- * Syntax HighLighting for theme editor
88
  * Syntax Highlighting for plugin editor
89
  * Different highlighting for different file types
90
  * Syntax Highlighting for Code snippets in posts and pages
91
  * Syntax Highlighting for Code in post and pages using shortcodes and custom fields.
92
 
93
- **Miscellaneous Options**
94
 
95
- * Several miscellaneous Options
96
 
97
- All these features in an easy to use and novice user friendly interface which can still cater to the geekiest of webmasters.
 
98
 
 
99
 
 
 
 
100
 
101
- == Installation ==
102
 
103
- Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page.
104
 
 
105
 
 
106
 
107
- == Screenshots ==
108
 
109
- 1. Wp-Insert - Managing Ads (Auto insertion).
110
- 2. Wp-Insert - Managing Ads using Template tags.
111
- 3. Wp-Insert - Managing Feeds
112
- 4. Wp-Insert - Managing Tracking Codes.
113
- 5. Wp-Insert - Managing WYSIWYG editing.
114
- 6. Wp-Insert - Syntax Highlighting.
115
- 7. Wp-Insert - Adding an in post Ad.
116
- 8. Wp-Insert - Managing Privacy policy.
117
- 9. Wp-Insert - Managing Terms and Conditions.
118
- 10. Wp-Insert - Reordering pages.
119
 
 
120
 
121
- == Frequently Asked Questions ==
 
 
 
122
 
123
- <a href="http://www.wp-insert.smartlogix.co.in/" target="_self" title="Wp-Insert Tutorial and Support Website">Wp-Insert Tutorial and Support Website</a>
124
- <a href="http://www.smartlogix.co.in/" target="_self" title="Wp-Insert Developers">Wp-Insert Developers</a>
125
- == Changelog ==
126
- 1.7.3 : This is a bugfix release which takes care of two issues causing the blank manage ads pages in some blogs.
127
- <a href="http://www.wp-insert.smartlogix.co.in/" target="_self" title="Wp-Insert Tutorial and Support Website">Wp-Insert Tutorial and Support Website</a>
1
  === Wp-Insert ===
2
  Contributors: Namith Jawahar
3
+ Donate link:www.wp-insert.smartlogix.co.in/support
4
+ Tags: adsense,google,widget,post,admin,plugin,ads,in post ads,feed logo,smartlogix,ads in feeds,analytics,google analytics,header,footer,ad management,advertisements,content,ad,advertising,privacy policy,privacy,policy,automatic privacy policy,blog,feed,feeds,formatting,html,javascript,manage,post,posts,seo,sidebar,widget,widgets,wordpress,tracking,syntex highlighter,highlighting,theme tools,plugin tools,developer tools,highlighting,theme editor,plugin editor,middle ad,ad filtration,pagewise ad filtration,template ads,ad tags,adbrite ads,adsense ready,easy adsense,adsense optimized,terms and conditions,terms,conditions,automatic terms and conditions
5
+ Requires at least: 3.2
6
+ Tested up to: 3.4.2
7
+ Stable tag: 2.0
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Wp-Insert is the most powerful yet easiest to use WordPress ad management plugin which does a lot more than ad management.
12
 
13
  == Description ==
14
 
15
+ **WP-INSERT by <a href=\"http://www.smartlogix.co.in/\" title=\"Smart Logix\">Smart Logix</a> : The ultimate wordpress plugin**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
+ Wp-Insert is the most powerful yet easiest to use wordpress ad management plugin which does a lot more than ad management.
18
 
19
+ Wp-Insert can manage your ads, google analytics or any other tracking scripts, legal stuff and even make editing your themes or writing code in content easier for you.
 
 
20
 
21
+ All these from within a well contained and easy to use interface.
22
+
23
+ **Manage Ads**
24
 
25
+ *Multiple Ad Network Support :* You can now run any ad-network along with adsense or any other network without infringing with the terms of one another. The plugin supports upto 3 different ad network simultaneously. Run Adsense ads along with yahoo, Adbrite, Chitika or any other ad network without interfering with the terms of each network.
 
 
26
 
27
+ *In Post ads :* Allows you to insert your ads around and inside your content.
 
 
28
 
29
+ * Insert Ads above the content.
30
+ * Insert Ads below the content.
31
+ * Insert Ads in the middle of the content. (Option to control the minimum length required for an articles in which middle ads show up as well as option to exactly define where the middle ads appears in a post)
32
+ * Insert Ads to the left of the content.
33
+ * Insert Ads to the right of the content.
34
+ * Extensive and elaborate RULES section to control when and where you display the ads. (Precise control down to single post/page level)
35
+ * Geo Targeting : Pick different ads for different Geographical locations. (You might want to promote an affiliate product for visitors from USA while showing Google Adsense to Rest of the World)
36
 
37
+
38
+ *Widget Ads :* 20 ad widgets at your disposal with elaborate setting to when, where and how to display them.
39
 
40
+ *Template Ads :* Now insert Ads anywhere on your site by placing them directly within the theme code while still allowing users to control them from the Dashboard.
 
 
 
41
 
 
42
 
43
+ **Manage Legal Pages**
44
+
45
+ *One Click Privacy Policy for your Wordpress Site :* Customizable Ready made Adsense Compatible privacy policy for your site which you can add to any existing page with one click.
46
 
47
+ *One Click Terms and Conditions for your Wordpress Site :* Customizable Ready made general Terms and Conditions for your site which you can add to any existing page with one click.
48
 
49
+ *Disclaimer and Copyright Notices :* Add Disclaimer and Copyright Notices to your site in one click.
 
 
 
 
50
 
51
  **Manage Tracking Codes**
52
 
53
  * Insert Google Analytics tracking onto all you blog pages instantly
54
+ * Paste any other tracking code into the header or footer of your blog
 
 
 
 
 
 
 
55
 
56
  **Syntax Highlighting**
57
 
58
+ * Syntax Highlighting for theme editor
59
  * Syntax Highlighting for plugin editor
60
  * Different highlighting for different file types
61
  * Syntax Highlighting for Code snippets in posts and pages
62
  * Syntax Highlighting for Code in post and pages using shortcodes and custom fields.
63
 
64
+ All these features in an easy to use and novice user friendly interface which can still cater to the geekiest of webmasters.
65
 
66
+ == Installation ==
67
 
68
+ Extract the zip file and just drop the contents in the wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page.
69
+ == Frequently Asked Questions ==
70
 
71
+ <a href=\"http://www.wp-insert.smartlogix.co.in/\" title=\"Wp-Insert Tutorial and Support Website\">Wp-Insert Tutorial and Support Website</a>
72
 
73
+ <a href=\"http://www.smartlogix.co.in/\" title=\"Wp-Insert Developers\">Wp-Insert Developers</a>
74
+ == Screenshots ==
75
+ 1. Multiple Ad Network Support
76
 
77
+ 2. Elaborate Rules System for precise control over Ads
78
 
79
+ 3. Rules system popup for controlling ads on Posts
80
 
81
+ 4. Rules system popup for controlling ads on Pages
82
 
83
+ 5. Geo Targeting : Show differnet ads for visitors from different locations
84
 
85
+ 6. Geo Targeting : Popup showing the targetable areas
86
 
87
+ 7. Customizable Ready made Adsense Compatible privacy policy
 
 
 
 
 
 
 
 
 
88
 
89
+ 8. Different Legal Page Templates
90
 
91
+ 9. Easy to manage analiytics or any other tracking codes
92
+
93
+ 10. Syntax Highlighting
94
+ == Upgrade Notice ==
95
 
96
+ = 2.0 =
97
+ Users of old versions of Wp-Insert will lose your widget placements when upgrading to 2.0 as we have finally switched to the new widget API.
98
+ Wp-Insert is now upto 4 times more efficient and have extremely high emphasis on security compared to previous versions.
 
 
screenshot-1.png CHANGED
Binary file
screenshot-10.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
screenshot-3.png CHANGED
Binary file
screenshot-4.png CHANGED
Binary file
screenshot-5.png CHANGED
Binary file
screenshot-6.png CHANGED
Binary file
screenshot-7.png CHANGED
Binary file
screenshot-8.png CHANGED
Binary file
screenshot-9.png CHANGED
Binary file
support/support.php DELETED
@@ -1,19 +0,0 @@
1
- <?php function show_support_options() { ?>
2
- <table class="form-table">
3
- <tr valign="bottom">
4
- <th scope="row"><small><span style="color:#FF0000;"><b>Donate a few Dollars</b></span><br/><span style="color:#008E04;">Support our FREE Plugins</span><br/>
5
- You Might Also Like <a target="_blank" href="http://wordpress.org/extend/plugins/wp-private/">WP-PRIVATE</a></small></th>
6
- <td width="100px">
7
- <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
8
- <input type="hidden" name="cmd" value="_s-xclick">
9
- <input type="hidden" name="hosted_button_id" value="7834514">
10
- <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
11
- <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
12
- </form>
13
- </td>
14
- <td>
15
- <b>Think we have done a great job?</b><br/><a target="_blank" href="http://wordpress.org/extend/plugins/wp-insert/">Rate the plugin</a> or <a target="_blank" href="http://www.smartlogix.co.in/">Leave Us a Comment</a><br/>
16
- <b></b>Let us match your blog to your website : <a target="_blank" href="http://www.smartlogix.co.in/request-a-free-quote/">Request a Quote</a></td>
17
- </tr>
18
- </table>
19
- <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
tracking/insert-analytics.php DELETED
@@ -1,72 +0,0 @@
1
- <?php
2
- add_action('wp_footer', 'smart_add_footer_code');
3
- add_action('wp_head', 'smart_add_header_code');
4
-
5
- function smart_add_header_code($arg) {
6
- if(get_option('smart_analytics_header_enabled')) {
7
- echo get_option('smart_analytics_header_code');
8
- }
9
- return $arg;
10
- }
11
-
12
- function smart_add_footer_code($arg) {
13
- if(get_option('smart_analytics_enabled')) { ?>
14
- <script type="text/javascript">
15
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
16
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
17
- </script>
18
- <script type="text/javascript">
19
- var pageTracker = _gat._getTracker("<?php echo get_option('smart_analytics_id'); ?>");
20
- pageTracker._trackPageview();
21
- </script>
22
- <?php }
23
- if(get_option('smart_analytics_footer_enabled')) {
24
- echo get_option('smart_analytics_footer_code');
25
- }
26
- return $arg;
27
- }
28
-
29
- // action function for adding the administrative page
30
- function smart_add_analytics() { ?>
31
- <div class="wrap">
32
- <h2>WP-INSERT : Tracking Codes</h2>
33
- <?php show_support_options(); ?>
34
- <form method="post" action="options.php">
35
- <?php wp_nonce_field('update-options'); ?>
36
-
37
- <table class="form-table">
38
-
39
- <tr valign="top">
40
- <th scope="row">Google Analytics Tracker ID
41
- <br/><input id="smart_analytics_enabled" name="smart_analytics_enabled" type="checkbox" value="1"<?php if(get_option('smart_analytics_enabled')) echo ' checked="checked"'; ?>/> Enabled</th>
42
- <td><input id="smart_analytics_id" name="smart_analytics_id" type="text" value="<?php echo get_option('smart_analytics_id'); ?>" style="width:350px;" /><br/>
43
- <small>( Paste your Google Analytics Tracker ID (XX-XXXXX-X) above )</small></td>
44
- </tr>
45
-
46
- <tr valign="top">
47
- <th scope="row">Insert Code into Header<br/>
48
- <br/><input id="smart_analytics_header_enabled" name="smart_analytics_header_enabled" type="checkbox" value="1"<?php if(get_option('smart_analytics_header_enabled')) echo ' checked="checked"'; ?>/> Enabled</th>
49
- <td><textarea id="smart_analytics_header_code" name="smart_analytics_header_code" style="width:350px;height:150px;"><?php echo get_option('smart_analytics_header_code'); ?></textarea><br/>
50
- <small>( Paste Analytics or similar code in the box above )</small></td>
51
- </tr>
52
-
53
- <tr valign="top">
54
- <th scope="row">Insert Code into Footer<br/>
55
- <br/><input id="smart_analytics_footer_enabled" name="smart_analytics_footer_enabled" type="checkbox" value="1"<?php if(get_option('smart_analytics_footer_enabled')) echo ' checked="checked"'; ?>/> Enabled</th>
56
- <td><textarea id="smart_analytics_footer_code" name="smart_analytics_footer_code" style="width:350px;height:150px;"><?php echo get_option('smart_analytics_footer_code'); ?></textarea><br/>
57
- <small>( Paste Analytics or similar code in the box above )</small></td>
58
- </tr>
59
-
60
- </table>
61
-
62
- <input type="hidden" name="action" value="update" />
63
- <input type="hidden" name="page_options" value="smart_analytics_enabled,smart_analytics_id,smart_analytics_header_enabled,smart_analytics_header_code,smart_analytics_footer_enabled,smart_analytics_footer_code" />
64
- <p class="submit">
65
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
66
- </p>
67
- </form>
68
- <p>
69
- <script type="text/javascript" src="http://www.wp-insert.smartlogix.co.in/wp-content/plugins/wp-adnetwork/wp-adnetwork.php?showad=1"></script>
70
- </p>
71
- </div>
72
- <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wp-insert.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: wp-insert
4
  Plugin URI: http://www.wp-insert.smartlogix.co.in/
5
  Description: The ultimate wordpress plugin
6
- Version: 1.7.6
7
  Author: Namith Jawahar
8
  Author URI: http://www.smartlogix.co.in/
9
  WP-INSERT by SMARTLOGIX : The ultimate wordpress plugin
@@ -25,9 +25,13 @@ WP-INSERT by SMARTLOGIX : The ultimate wordpress plugin
25
  along with this program; if not, write to the Free Software
26
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
  */
28
- require_once (dirname(__FILE__) . '/includes/essentials.php');
29
-
30
- require_once (dirname(__FILE__) . '/support/support.php');
31
- require_once (dirname(__FILE__) . '/feeds/insert-feeds.php');
32
- require_once (dirname(__FILE__) . '/tracking/insert-analytics.php');
33
- ?>
 
 
 
 
3
  Plugin Name: wp-insert
4
  Plugin URI: http://www.wp-insert.smartlogix.co.in/
5
  Description: The ultimate wordpress plugin
6
+ Version: 2.0
7
  Author: Namith Jawahar
8
  Author URI: http://www.smartlogix.co.in/
9
  WP-INSERT by SMARTLOGIX : The ultimate wordpress plugin
25
  along with this program; if not, write to the Free Software
26
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
  */
28
+ /*Definitions*/
29
+ if(!defined('WP_INSERT_URL'))
30
+ define('WP_INSERT_URL',WP_PLUGIN_URL.'/wp-insert');
31
+ if(!defined('WP_INSERT_DIR'))
32
+ define('WP_INSERT_DIR',WP_PLUGIN_DIR.'/wp-insert');
33
+ if(!defined('WP_INSERT_VERSION'))
34
+ define('WP_INSERT_VERSION', '2.0');
35
+ /*Includes*/
36
+ require_once (dirname(__FILE__).'/includes/includes.php');
37
+ ?>