Wp-Insert - Version 2.1

Version Description

  • Completely Rewritten from ground up.

=

Download this release

Release Info

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

Code changes from version 2.0.16 to 2.1

Files changed (193) hide show
  1. includes/adwidgets.php +335 -0
  2. includes/adwidgets/activate-upgrade.php +0 -79
  3. includes/adwidgets/admin-page.php +0 -343
  4. includes/adwidgets/adwidgets.php +0 -6
  5. includes/adwidgets/menu.php +0 -9
  6. includes/adwidgets/widget.php +0 -57
  7. includes/assets/css/wp-insert.css +96 -0
  8. includes/{common → assets}/images/adsense.gif +0 -0
  9. includes/assets/images/ajax-loader-flat.gif +0 -0
  10. includes/assets/images/ajax-loader.gif +0 -0
  11. includes/{common → assets}/images/chitika.png +0 -0
  12. includes/assets/images/header-banner.png +0 -0
  13. includes/assets/images/icon.png +0 -0
  14. includes/assets/js/wp-insert.js +582 -0
  15. includes/common/abtesting.php +46 -0
  16. includes/common/activate-upgrade.php +0 -19
  17. includes/common/admin-page.php +0 -37
  18. includes/common/common.php +24 -12
  19. includes/common/control-panel.php +128 -0
  20. includes/common/controls.php +0 -154
  21. includes/common/css/style.css +0 -167
  22. includes/common/geoip/GeoIP.dat +0 -0
  23. includes/common/geoip/LICENSE.txt +0 -39
  24. includes/common/geoip/geoip.inc +0 -717
  25. includes/common/{countries.php → geotargeting.php} +49 -30
  26. includes/common/http-post.php +0 -113
  27. includes/common/images/ClosedTabBackground.png +0 -0
  28. includes/common/images/ClosedTabBackgroundHover.png +0 -0
  29. includes/common/images/better_checkbox.png +0 -0
  30. includes/common/images/blog_for_$100_ad.png +0 -0
  31. includes/common/images/border.png +0 -0
  32. includes/common/images/check.png +0 -0
  33. includes/common/images/chitika.gif +0 -0
  34. includes/common/images/chitika_banner.png +0 -0
  35. includes/common/images/chitika_btn.png +0 -0
  36. includes/common/images/clicksor.gif +0 -0
  37. includes/common/images/controls.png +0 -0
  38. includes/common/images/donate_btn.png +0 -0
  39. includes/common/images/fb_like_btn.png +0 -0
  40. includes/common/images/help.png +0 -0
  41. includes/common/images/hireme.png +0 -0
  42. includes/common/images/iphone_off.png +0 -0
  43. includes/common/images/iphone_on.png +0 -0
  44. includes/common/images/iphone_slider.png +0 -0
  45. includes/common/images/iphone_slider_center.png +0 -0
  46. includes/common/images/iphone_slider_left.png +0 -0
  47. includes/common/images/iphone_slider_right.png +0 -0
  48. includes/common/images/jquery.minicolors.png +0 -0
  49. includes/common/images/loading.gif +0 -0
  50. includes/common/images/loading_background.png +0 -0
  51. includes/common/images/logo.png +0 -0
  52. includes/common/images/overlay.png +0 -0
  53. includes/common/images/pointer.png +0 -0
  54. includes/common/jquery.php +0 -18
  55. includes/common/js/iphone-style-checkboxes.js +0 -284
  56. includes/common/js/jquery-jvert-tabs-1.1.4.js +0 -356
  57. includes/common/js/jquery.colorbox-min.js +0 -4
  58. includes/common/js/jquery.miniColors.js +0 -857
  59. includes/common/js/jquery.tzCheckbox.js +0 -47
  60. includes/common/js/nicEdit-latest.js +0 -126
  61. includes/common/js/ui.multiselect.js +0 -336
  62. includes/common/js/wp-insert-functions.js +0 -24
  63. includes/common/menu.php +0 -6
  64. includes/common/popups/categories.php +0 -51
  65. includes/common/popups/chitika.php +0 -177
  66. includes/common/popups/countries.php +0 -51
  67. includes/common/popups/instances.php +0 -62
  68. includes/common/popups/pages.php +0 -51
  69. includes/common/popups/posts.php +0 -51
  70. includes/common/rules.php +138 -0
  71. includes/common/sanitize.php +0 -15
  72. includes/common/status.php +0 -129
  73. includes/common/styles.php +0 -18
  74. includes/common/support.php +0 -194
  75. includes/controls/assets/css/controls.css +557 -0
  76. includes/controls/assets/images/chosen-sprite.png +0 -0
  77. includes/controls/assets/images/chosen-sprite@2x.png +0 -0
  78. includes/controls/assets/js/controls.js +1270 -0
  79. includes/controls/controls.php +542 -0
  80. includes/includes.php +0 -10
  81. includes/inpostads.php +491 -0
  82. includes/inpostads/activate-upgrade.php +0 -216
  83. includes/inpostads/admin-page.php +0 -378
  84. includes/inpostads/content.php +0 -95
  85. includes/inpostads/inpostads.php +0 -6
  86. includes/inpostads/menu.php +0 -7
  87. includes/inthemeads.php +308 -0
  88. includes/legal-pages.php +395 -0
  89. includes/legal-pages/activate-upgrade.php +0 -35
  90. includes/legal-pages/admin-page.php +0 -66
  91. includes/legal-pages/content.php +0 -35
  92. includes/legal-pages/data.php +0 -48
  93. includes/legal-pages/legal-pages.php +0 -7
  94. includes/legal-pages/menu.php +0 -7
  95. includes/multiple-adnetwork/activate-upgrade.php +0 -28
  96. includes/multiple-adnetwork/meta-box.php +0 -20
  97. includes/multiple-adnetwork/multiple-adnetwork.php +0 -4
  98. includes/syntax-highlighting/activate-upgrade.php +0 -26
  99. includes/syntax-highlighting/admin-page.php +0 -39
  100. includes/syntax-highlighting/codes.php +0 -81
  101. includes/syntax-highlighting/editarea/change_log.txt +0 -293
  102. includes/syntax-highlighting/editarea/edit_area.css +0 -530
  103. includes/syntax-highlighting/editarea/edit_area_full.js +0 -38
  104. includes/syntax-highlighting/editarea/images/autocompletion.gif +0 -0
  105. includes/syntax-highlighting/editarea/images/close.gif +0 -0
  106. includes/syntax-highlighting/editarea/images/fullscreen.gif +0 -0
  107. includes/syntax-highlighting/editarea/images/go_to_line.gif +0 -0
  108. includes/syntax-highlighting/editarea/images/help.gif +0 -0
  109. includes/syntax-highlighting/editarea/images/highlight.gif +0 -0
  110. includes/syntax-highlighting/editarea/images/load.gif +0 -0
  111. includes/syntax-highlighting/editarea/images/move.gif +0 -0
  112. includes/syntax-highlighting/editarea/images/newdocument.gif +0 -0
  113. includes/syntax-highlighting/editarea/images/opacity.png +0 -0
  114. includes/syntax-highlighting/editarea/images/processing.gif +0 -0
  115. includes/syntax-highlighting/editarea/images/redo.gif +0 -0
  116. includes/syntax-highlighting/editarea/images/reset_highlight.gif +0 -0
  117. includes/syntax-highlighting/editarea/images/save.gif +0 -0
  118. includes/syntax-highlighting/editarea/images/search.gif +0 -0
  119. includes/syntax-highlighting/editarea/images/smooth_selection.gif +0 -0
  120. includes/syntax-highlighting/editarea/images/spacer.gif +0 -0
  121. includes/syntax-highlighting/editarea/images/statusbar_resize.gif +0 -0
  122. includes/syntax-highlighting/editarea/images/undo.gif +0 -0
  123. includes/syntax-highlighting/editarea/images/word_wrap.gif +0 -0
  124. includes/syntax-highlighting/editarea/langs/bg.js +0 -54
  125. includes/syntax-highlighting/editarea/langs/cs.js +0 -48
  126. includes/syntax-highlighting/editarea/langs/de.js +0 -48
  127. includes/syntax-highlighting/editarea/langs/dk.js +0 -48
  128. includes/syntax-highlighting/editarea/langs/en.js +0 -48
  129. includes/syntax-highlighting/editarea/langs/eo.js +0 -48
  130. includes/syntax-highlighting/editarea/langs/es.js +0 -48
  131. includes/syntax-highlighting/editarea/langs/fi.js +0 -48
  132. includes/syntax-highlighting/editarea/langs/fr.js +0 -48
  133. includes/syntax-highlighting/editarea/langs/hr.js +0 -48
  134. includes/syntax-highlighting/editarea/langs/id.js +0 -48
  135. includes/syntax-highlighting/editarea/langs/it.js +0 -48
  136. includes/syntax-highlighting/editarea/langs/ja.js +0 -48
  137. includes/syntax-highlighting/editarea/langs/mk.js +0 -48
  138. includes/syntax-highlighting/editarea/langs/nl.js +0 -48
  139. includes/syntax-highlighting/editarea/langs/pl.js +0 -48
  140. includes/syntax-highlighting/editarea/langs/pt.js +0 -48
  141. includes/syntax-highlighting/editarea/langs/ru.js +0 -48
  142. includes/syntax-highlighting/editarea/langs/sk.js +0 -48
  143. includes/syntax-highlighting/editarea/langs/zh.js +0 -48
  144. includes/syntax-highlighting/editarea/license_apache.txt +0 -7
  145. includes/syntax-highlighting/editarea/license_bsd.txt +0 -10
  146. includes/syntax-highlighting/editarea/license_lgpl.txt +0 -458
  147. includes/syntax-highlighting/editarea/reg_syntax/basic.js +0 -70
  148. includes/syntax-highlighting/editarea/reg_syntax/brainfuck.js +0 -45
  149. includes/syntax-highlighting/editarea/reg_syntax/c.js +0 -63
  150. includes/syntax-highlighting/editarea/reg_syntax/coldfusion.js +0 -120
  151. includes/syntax-highlighting/editarea/reg_syntax/cpp.js +0 -66
  152. includes/syntax-highlighting/editarea/reg_syntax/css.js +0 -85
  153. includes/syntax-highlighting/editarea/reg_syntax/html.js +0 -51
  154. includes/syntax-highlighting/editarea/reg_syntax/java.js +0 -57
  155. includes/syntax-highlighting/editarea/reg_syntax/js.js +0 -94
  156. includes/syntax-highlighting/editarea/reg_syntax/pas.js +0 -83
  157. includes/syntax-highlighting/editarea/reg_syntax/perl.js +0 -88
  158. includes/syntax-highlighting/editarea/reg_syntax/php.js +0 -157
  159. includes/syntax-highlighting/editarea/reg_syntax/python.js +0 -145
  160. includes/syntax-highlighting/editarea/reg_syntax/robotstxt.js +0 -25
  161. includes/syntax-highlighting/editarea/reg_syntax/ruby.js +0 -68
  162. includes/syntax-highlighting/editarea/reg_syntax/sql.js +0 -56
  163. includes/syntax-highlighting/editarea/reg_syntax/tsql.js +0 -88
  164. includes/syntax-highlighting/editarea/reg_syntax/vb.js +0 -53
  165. includes/syntax-highlighting/editarea/reg_syntax/xml.js +0 -57
  166. includes/syntax-highlighting/editarea/todo.txt +0 -71
  167. includes/syntax-highlighting/menu.php +0 -7
  168. includes/syntax-highlighting/syntax-highlighting.php +0 -6
  169. includes/templateads/activate-upgrade.php +0 -79
  170. includes/templateads/admin-page.php +0 -347
  171. includes/templateads/menu.php +0 -10
  172. includes/templateads/template-tag.php +0 -18
  173. includes/templateads/templateads.php +0 -6
  174. includes/tracking-codes.php +147 -0
  175. includes/tracking-codes/activate-upgrade.php +0 -41
  176. includes/tracking-codes/admin-page.php +0 -47
  177. includes/tracking-codes/codes.php +0 -30
  178. includes/tracking-codes/menu.php +0 -7
  179. includes/tracking-codes/tracking-codes.php +0 -6
  180. index.html +0 -12
  181. license.txt +0 -674
  182. readme.txt +56 -81
  183. screenshot-1.png +0 -0
  184. screenshot-10.png +0 -0
  185. screenshot-2.png +0 -0
  186. screenshot-3.png +0 -0
  187. screenshot-4.png +0 -0
  188. screenshot-5.png +0 -0
  189. screenshot-6.png +0 -0
  190. screenshot-7.png +0 -0
  191. screenshot-8.png +0 -0
  192. screenshot-9.png +0 -0
  193. wp-insert.php +16 -6
includes/adwidgets.php ADDED
@@ -0,0 +1,335 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* Begin Add New Adwidget Content */
3
+ add_action('wp_ajax_wp_insert_adwidgets_new_form_get_content', 'wp_insert_adwidgets_new_form_get_content');
4
+ function wp_insert_adwidgets_new_form_get_content() {
5
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
6
+ wp_insert_adwidgets_form_get_content(uniqid());
7
+ die();
8
+ }
9
+ /* End Add New Adwidget Content */
10
+
11
+ /* Begin Edit Adwidget Content */
12
+ add_action('wp_ajax_wp_insert_adwidgets_existing_form_get_content', 'wp_insert_adwidgets_existing_form_get_content');
13
+ function wp_insert_adwidgets_existing_form_get_content() {
14
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
15
+ if(isset($_POST['wp_insert_adwidgets_identifier'])) {
16
+ wp_insert_adwidgets_form_get_content($_POST['wp_insert_adwidgets_identifier']);
17
+ }
18
+ die();
19
+ }
20
+
21
+ add_action('wp_ajax_wp_insert_adwidgets_existing_form_save_action', 'wp_insert_adwidgets_existing_form_save_action');
22
+ function wp_insert_adwidgets_existing_form_save_action() {
23
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
24
+ if(isset($_POST['wp_insert_adwidgets_identifier'])) {
25
+ wp_insert_adwidgets_form_save_action($_POST['wp_insert_adwidgets_identifier']);
26
+ }
27
+ die();
28
+ }
29
+ /* End Edit Adwidget Content */
30
+
31
+ /* Begin Delete Adwidget Content */
32
+ add_action('wp_ajax_wp_insert_adwidgets_remove', 'wp_insert_adwidgets_remove');
33
+ function wp_insert_adwidgets_remove() {
34
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
35
+ if(isset($_POST['wp_insert_adwidgets_identifier'])) {
36
+ $adwidgets = get_option('wp_insert_adwidgets');
37
+ unset($adwidgets[$_POST['wp_insert_adwidgets_identifier']]);
38
+ update_option('wp_insert_adwidgets', $adwidgets);
39
+ }
40
+ die();
41
+ }
42
+ /* End Delete Adwidget Content */
43
+
44
+ /* Begin Shared UI Functions */
45
+ function wp_insert_adwidgets_form_get_content($identifier) {
46
+ $adwidgets = get_option('wp_insert_adwidgets');
47
+ echo '<div class="wp_insert_popup_content_wrapper">';
48
+ $control = new smartlogixControls(array('optionIdentifier' => 'wp_insert_adwidgets['.$identifier.']', 'values' => $adwidgets[$identifier]));
49
+ $control->add_control(array('type' => 'ipCheckbox', 'className' => 'wp_insert_adwidgets_status', 'optionName' => 'status'));
50
+ $control->add_control(array('type' => 'hidden', 'className' => 'wp_insert_adwidgets_identifier', 'optionName' => 'identifier', 'value' => $identifier));
51
+ echo $control->HTML;
52
+ $control->clear_controls();
53
+ echo '<div id="wp_insert_adwidgets_'.$identifier.'_accordion">';
54
+ echo '<h3>Ad Code</h3>';
55
+ echo '<div>';
56
+ $abtestingMode = get_option('wp_insert_abtesting_mode');
57
+ $control->add_control(array('type' => 'textarea', 'style' => 'height: 220px;', 'optionName' => 'primary_ad_code'));
58
+ $control->create_section('Ad Code (Primary Network)');
59
+ echo $control->HTML;
60
+ $control->clear_controls();
61
+
62
+ $control->add_control(array('type' => 'textarea', 'style' => 'height: 220px;', 'optionName' => 'secondary_ad_code'));
63
+ $control->create_section('Ad Code (Secondary Network)');
64
+ if($abtestingMode != '2' && $abtestingMode != '3') {
65
+ $control->set_HTML('<div style="display: none;">'.$control->HTML.'</div>');
66
+ }
67
+ echo $control->HTML;
68
+ $control->clear_controls();
69
+
70
+ $control->add_control(array('type' => 'textarea', 'style' => 'height: 220px;', 'optionName' => 'tertiary_ad_code'));
71
+ $control->create_section('Ad Code (Tertiary Network)');
72
+ if($abtestingMode != '3') {
73
+ $control->set_HTML('<div style="display: none;">'.$control->HTML.'</div>');
74
+ }
75
+ echo $control->HTML;
76
+ $control->clear_controls();
77
+ echo '</div>';
78
+ echo '<h3>Rules</h3>';
79
+ echo '<div>';
80
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_loggedin'));
81
+ $control->create_section('Logged in Users');
82
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
83
+ echo $control->HTML;
84
+ $control->clear_controls();
85
+
86
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_mobile_devices'));
87
+ $control->create_section('Mobile Devices');
88
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
89
+ echo $control->HTML;
90
+ $control->clear_controls();
91
+
92
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_home'));
93
+ $control->create_section('Home');
94
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
95
+ echo $control->HTML;
96
+ $control->clear_controls();
97
+
98
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_archives'));
99
+ $control->create_section('Archives');
100
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
101
+ echo $control->HTML;
102
+ $control->clear_controls();
103
+
104
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_search'));
105
+ $control->create_section('Search Results');
106
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
107
+ echo $control->HTML;
108
+ $control->clear_controls();
109
+
110
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_page'));
111
+ $control->add_control(array('type' => 'pages-chosen-multiselect', 'label' => 'Exceptions', 'optionName' => 'rules_page_exceptions'));
112
+ $control->create_section('Single Pages');
113
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
114
+ echo $control->HTML;
115
+ $control->clear_controls();
116
+
117
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_post'));
118
+ $control->add_control(array('type' => 'posts-chosen-multiselect', 'label' => 'Exceptions', 'optionName' => 'rules_post_exceptions'));
119
+ $control->add_control(array('type' => 'categories-chosen-multiselect', 'label' => 'Category Exceptions', 'optionName' => 'rules_post_categories_exceptions'));
120
+ $control->create_section('Single Posts');
121
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
122
+ echo $control->HTML;
123
+ $control->clear_controls();
124
+
125
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_categories'));
126
+ $control->add_control(array('type' => 'categories-chosen-multiselect', 'label' => 'Exceptions', 'optionName' => 'rules_categories_exceptions'));
127
+ $control->create_section('Category Archives');
128
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
129
+ echo $control->HTML;
130
+ $control->clear_controls();
131
+
132
+ echo '</div>';
133
+ echo '<h3>Geo Targeting</h3>';
134
+ echo '<div>';
135
+ echo '<p>A Geo Targeted Ads have a higher priority than Ads configured via Multiple Ad Networks / A-B Testing.<br />If a Geo Targeting match is found all other Ads (Primary, Secondary and Tertiary Networks) will be ignored.</p>';
136
+ $control->add_control(array('type' => 'choosen-multiselect', 'label' => 'Countries', 'optionName' => 'geo_group1_countries', 'options' => wp_insert_get_countries()));
137
+ $control->add_control(array('type' => 'textarea', 'label' => 'Ad Code', 'style' => 'height: 220px;', 'optionName' => 'geo_group1_adcode'));
138
+ $control->create_section('Group 1');
139
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
140
+ echo $control->HTML;
141
+ $control->clear_controls();
142
+
143
+ $control->add_control(array('type' => 'choosen-multiselect', 'label' => 'Countries', 'optionName' => 'geo_group2_countries', 'options' => wp_insert_get_countries()));
144
+ $control->add_control(array('type' => 'textarea', 'label' => 'Ad Code', 'style' => 'height: 220px;', 'optionName' => 'geo_group2_adcode'));
145
+ $control->create_section('Group 2');
146
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
147
+ echo $control->HTML;
148
+ $control->clear_controls();
149
+ echo '</div>';
150
+ echo '<h3>Styles</h3>';
151
+ echo '<div>';
152
+ $control->add_control(array('type' => 'textarea', 'style' => 'height: 220px;', 'optionName' => 'styles'));
153
+ $control->create_section('Styles');
154
+ echo $control->HTML;
155
+ $control->clear_controls();
156
+ echo '</div>';
157
+ echo '<h3>Notes</h3>';
158
+ echo '<div>';
159
+ $control->add_control(array('type' => 'text', 'optionName' => 'title', 'helpText' => 'The title is used to identify your Ad Widget easily in future. A Random Title will be assigned to your Ad widget by default.', 'value' => ((isset($adwidgets[$identifier]['title']))?$adwidgets[$identifier]['title']:$identifier)));
160
+ $control->create_section('Title');
161
+ echo $control->HTML;
162
+ $control->clear_controls();
163
+
164
+ $control->add_control(array('type' => 'textarea', 'style' => 'height: 220px;', 'optionName' => 'notes'));
165
+ $control->create_section('Notes');
166
+ echo $control->HTML;
167
+ $control->clear_controls();
168
+ echo '</div>';
169
+ echo '</div>';
170
+ echo '<script type="text/javascript">';
171
+ echo $control->JS;
172
+ echo 'jQuery("#wp_insert_adwidgets_'.$identifier.'_accordion").accordion({ icons: { header: "ui-icon-circle-arrow-e", activeHeader: "ui-icon-circle-arrow-s" }, heightStyle: "auto" });';
173
+ echo '</script>';
174
+ echo '</div>';
175
+ }
176
+
177
+ function wp_insert_adwidgets_form_save_action($identifier) {
178
+ $adwidgets = get_option('wp_insert_adwidgets');
179
+ $adwidgets[$identifier]['identifier'] = ((isset($_POST['wp_insert_adwidgets_identifier']))?$_POST['wp_insert_adwidgets_identifier']:'');
180
+ $adwidgets[$identifier]['status'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_status']) && ($_POST['wp_insert_adwidgets_'.$identifier.'_status'] == 'true'))?'1':'');
181
+
182
+ $adwidgets[$identifier]['title'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_title']))?$_POST['wp_insert_adwidgets_'.$identifier.'_title']:'');
183
+
184
+ $adwidgets[$identifier]['primary_ad_code'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_primary_ad_code']))?$_POST['wp_insert_adwidgets_'.$identifier.'_primary_ad_code']:'');
185
+ $adwidgets[$identifier]['secondary_ad_code'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_secondary_ad_code']))?$_POST['wp_insert_adwidgets_'.$identifier.'_secondary_ad_code']:'');
186
+ $adwidgets[$identifier]['tertiary_ad_code'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_tertiary_ad_code']))?$_POST['wp_insert_adwidgets_'.$identifier.'_tertiary_ad_code']:'');
187
+
188
+ $adwidgets[$identifier]['rules_exclude_loggedin'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_loggedin']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_loggedin']:'');
189
+ $adwidgets[$identifier]['rules_exclude_mobile_devices'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_mobile_devices']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_mobile_devices']:'');
190
+ $adwidgets[$identifier]['rules_exclude_home'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_home']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_home']:'');
191
+ $adwidgets[$identifier]['rules_exclude_archives'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_archives']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_archives']:'');
192
+ $adwidgets[$identifier]['rules_exclude_search'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_search']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_search']:'');
193
+ $adwidgets[$identifier]['rules_exclude_page'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_page']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_page']:'');
194
+ $adwidgets[$identifier]['rules_page_exceptions'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_page_exceptions']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_page_exceptions']:'');
195
+ $adwidgets[$identifier]['rules_exclude_post'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_post']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_post']:'');
196
+ $adwidgets[$identifier]['rules_post_exceptions'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_post_exceptions']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_post_exceptions']:'');
197
+ $adwidgets[$identifier]['rules_post_categories_exceptions'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_post_categories_exceptions']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_post_categories_exceptions']:'');
198
+ $adwidgets[$identifier]['rules_exclude_categories'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_categories']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_exclude_categories']:'');
199
+ $adwidgets[$identifier]['rules_categories_exceptions'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_rules_categories_exceptions']))?$_POST['wp_insert_adwidgets_'.$identifier.'_rules_categories_exceptions']:'');
200
+
201
+ $adwidgets[$identifier]['geo_group1_countries'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_geo_group1_countries']))?$_POST['wp_insert_adwidgets_'.$identifier.'_geo_group1_countries']:'');
202
+ $adwidgets[$identifier]['geo_group1_adcode'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_geo_group1_adcode']))?$_POST['wp_insert_adwidgets_'.$identifier.'_geo_group1_adcode']:'');
203
+ $adwidgets[$identifier]['geo_group2_countries'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_geo_group2_countries']))?$_POST['wp_insert_adwidgets_'.$identifier.'_geo_group2_countries']:'');
204
+ $adwidgets[$identifier]['geo_group2_adcode'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_geo_group2_adcode']))?$_POST['wp_insert_adwidgets_'.$identifier.'_geo_group2_adcode']:'');
205
+
206
+ $adwidgets[$identifier]['styles'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_styles']))?$_POST['wp_insert_adwidgets_'.$identifier.'_styles']:'');
207
+
208
+ $adwidgets[$identifier]['notes'] = ((isset($_POST['wp_insert_adwidgets_'.$identifier.'_notes']))?$_POST['wp_insert_adwidgets_'.$identifier.'_notes']:'');
209
+ update_option('wp_insert_adwidgets', $adwidgets);
210
+ }
211
+ /* End Shared UI Functions */
212
+
213
+ /* Begin Database Upgrade */
214
+ add_action('wp_insert_upgrade_database', 'wp_insert_adwidgets_upgrade_database');
215
+ function wp_insert_adwidgets_upgrade_database() {
216
+ if(!get_option('wp_insert_adwidgets')) {
217
+ $newValues = array();
218
+
219
+ $oldValues = get_option('wp_insert_adwidgets_options');
220
+ for($i = 1; $i <= 10; $i++) {
221
+ if(isset($oldValues['adwidgets-'.$i]['ad_code_1']) && ($oldValues['adwidgets-'.$i]['ad_code_1'] != '')) {
222
+ $newValues[$i] = array (
223
+ 'identifier' => $i,
224
+ 'status' => ((isset($oldValues['adwidgets-'.$i]['status']) && $oldValues['adwidgets-'.$i]['status'] == true)?'1':''),
225
+ 'title' => 'adwidgets-'.$i,
226
+ 'primary_ad_code' => ((isset($oldValues['adwidgets-'.$i]['ad_code_1']))?$oldValues['adwidgets-'.$i]['ad_code_1']:''),
227
+ 'secondary_ad_code' => ((isset($oldValues['adwidgets-'.$i]['ad_code_2']))?$oldValues['adwidgets-'.$i]['ad_code_2']:''),
228
+ 'tertiary_ad_code' => ((isset($oldValues['adwidgets-'.$i]['ad_code_3']))?$oldValues['adwidgets-'.$i]['ad_code_3']:''),
229
+ 'rules_exclude_loggedin' => ((isset($oldValues['adwidgets-'.$i]['rules_exclude_loggedin']))?true:false),
230
+ 'rules_exclude_mobile_devices' => ((isset($oldValues['adwidgets-'.$i]['rules_exclude_mobile_devices']))?true:false),
231
+ 'rules_exclude_home' => ((isset($oldValues['adwidgets-'.$i]['rules_exclude_home']))?true:false),
232
+ 'rules_exclude_archives' => ((isset($oldValues['adwidgets-'.$i]['rules_exclude_archives']))?true:false),
233
+ 'rules_exclude_search' => ((isset($oldValues['adwidgets-'.$i]['rules_exclude_search']))?true:false),
234
+ 'rules_exclude_page' => ((isset($oldValues['adwidgets-'.$i]['rules_exclude_page']))?true:false),
235
+ 'rules_page_exceptions' => ((isset($options['adwidgets-'.$i]['rules_page_exceptions']) && ($options['adwidgets-'.$i]['rules_page_exceptions'] != ''))?explode(',', $options['adwidgets-'.$i]['rules_page_exceptions']):array()),
236
+ 'rules_exclude_post' => ((isset($oldValues['adwidgets-'.$i]['rules_exclude_post']))?true:false),
237
+ 'rules_post_exceptions' => ((isset($options['adwidgets-'.$i]['rules_post_exceptions']) && ($options['adwidgets-'.$i]['rules_post_exceptions'] != ''))?explode(',', $options['adwidgets-'.$i]['rules_post_exceptions']):array()),
238
+ 'rules_post_categories_exceptions' => ((isset($options['adwidgets-'.$i]['rules_post_categories_exceptions']) && ($options['adwidgets-'.$i]['rules_post_categories_exceptions'] != ''))?explode(',', $options['adwidgets-'.$i]['rules_post_categories_exceptions']):array()),
239
+ 'rules_exclude_categories' => ((isset($oldValues['adwidgets-'.$i]['rules_exclude_categories']))?true:false),
240
+ 'rules_categories_exceptions' => ((isset($options['adwidgets-'.$i]['rules_categories_exceptions']) && ($options['adwidgets-'.$i]['rules_categories_exceptions'] != ''))?explode(',', $options['adwidgets-'.$i]['rules_categories_exceptions']):array()),
241
+ 'geo_group1_countries' => ((isset($options['adwidgets-'.$i]['country_1']) && ($options['adwidgets-'.$i]['country_1'] != ''))?explode(',', $options['adwidgets-'.$i]['country_1']):array()),
242
+ 'geo_group1_adcode' => ((isset($oldValues['adwidgets-'.$i]['country_code_1']))?$oldValues['adwidgets-'.$i]['country_code_1']:''),
243
+ 'geo_group2_countries' => array(),
244
+ 'geo_group2_adcode' => '',
245
+ 'styles' => ((isset($oldValues['adwidgets-'.$i]['styles']))?$oldValues['adwidgets-'.$i]['styles']:'margin: 5px; padding: 0px;'),
246
+ 'notes' => ((isset($oldValues['adwidgets-'.$i]['notes']))?$oldValues['adwidgets-'.$i]['notes']:''),
247
+ );
248
+ }
249
+ }
250
+
251
+ $oldValues = get_option('wp_insert_more_adwidgets_options');
252
+ for($i = 11; $i <= 20; $i++) {
253
+ if(isset($oldValues['adwidgets-'.$i]['ad_code_1']) && ($oldValues['adwidgets-'.$i]['ad_code_1'] != '')) {
254
+ $newValues[$i] = array (
255
+ 'identifier' => $i,
256
+ 'status' => ((isset($oldValues['adwidgets-'.$i]['status']) && $oldValues['adwidgets-'.$i]['status'] == true)?'1':''),
257
+ 'title' => 'adwidgets-'.$i,
258
+ 'primary_ad_code' => ((isset($oldValues['adwidgets-'.$i]['ad_code_1']))?$oldValues['adwidgets-'.$i]['ad_code_1']:''),
259
+ 'secondary_ad_code' => ((isset($oldValues['adwidgets-'.$i]['ad_code_2']))?$oldValues['adwidgets-'.$i]['ad_code_2']:''),
260
+ 'tertiary_ad_code' => ((isset($oldValues['adwidgets-'.$i]['ad_code_3']))?$oldValues['adwidgets-'.$i]['ad_code_3']:''),
261
+ 'rules_exclude_loggedin' => ((isset($oldValues['adwidgets-'.$i]['rules_exclude_loggedin']))?true:false),
262
+ 'rules_exclude_mobile_devices' => ((isset($oldValues['adwidgets-'.$i]['rules_exclude_mobile_devices']))?true:false),
263
+ 'rules_exclude_home' => ((isset($oldValues['adwidgets-'.$i]['rules_exclude_home']))?true:false),
264
+ 'rules_exclude_archives' => ((isset($oldValues['adwidgets-'.$i]['rules_exclude_archives']))?true:false),
265
+ 'rules_exclude_search' => ((isset($oldValues['adwidgets-'.$i]['rules_exclude_search']))?true:false),
266
+ 'rules_exclude_page' => ((isset($oldValues['adwidgets-'.$i]['rules_exclude_page']))?true:false),
267
+ 'rules_page_exceptions' => ((isset($options['adwidgets-'.$i]['rules_page_exceptions']) && ($options['adwidgets-'.$i]['rules_page_exceptions'] != ''))?explode(',', $options['adwidgets-'.$i]['rules_page_exceptions']):array()),
268
+ 'rules_exclude_post' => ((isset($oldValues['adwidgets-'.$i]['rules_exclude_post']))?true:false),
269
+ 'rules_post_exceptions' => ((isset($options['adwidgets-'.$i]['rules_post_exceptions']) && ($options['adwidgets-'.$i]['rules_post_exceptions'] != ''))?explode(',', $options['adwidgets-'.$i]['rules_post_exceptions']):array()),
270
+ 'rules_post_categories_exceptions' => ((isset($options['adwidgets-'.$i]['rules_post_categories_exceptions']) && ($options['adwidgets-'.$i]['rules_post_categories_exceptions'] != ''))?explode(',', $options['adwidgets-'.$i]['rules_post_categories_exceptions']):array()),
271
+ 'rules_exclude_categories' => ((isset($oldValues['adwidgets-'.$i]['rules_exclude_categories']))?true:false),
272
+ 'rules_categories_exceptions' => ((isset($options['adwidgets-'.$i]['rules_categories_exceptions']) && ($options['adwidgets-'.$i]['rules_categories_exceptions'] != ''))?explode(',', $options['adwidgets-'.$i]['rules_categories_exceptions']):array()),
273
+ 'geo_group1_countries' => ((isset($options['adwidgets-'.$i]['country_1']) && ($options['adwidgets-'.$i]['country_1'] != ''))?explode(',', $options['adwidgets-'.$i]['country_1']):array()),
274
+ 'geo_group1_adcode' => ((isset($oldValues['adwidgets-'.$i]['country_code_1']))?$oldValues['adwidgets-'.$i]['country_code_1']:''),
275
+ 'geo_group2_countries' => array(),
276
+ 'geo_group2_adcode' => '',
277
+ 'styles' => ((isset($oldValues['adwidgets-'.$i]['styles']))?$oldValues['adwidgets-'.$i]['styles']:'margin: 5px; padding: 0px;'),
278
+ 'notes' => ((isset($oldValues['adwidgets-'.$i]['notes']))?$oldValues['adwidgets-'.$i]['notes']:''),
279
+ );
280
+ }
281
+ }
282
+ update_option('wp_insert_adwidgets', $newValues);
283
+ }
284
+ }
285
+ /* End Database Upgrade */
286
+
287
+ /* Begin Ad Widget Insertion */
288
+ add_action('widgets_init', create_function('', 'register_widget("wpInsertAdWidget");'));
289
+ class wpInsertAdWidget extends WP_Widget {
290
+ public function __construct() {
291
+ parent::__construct('wp_insert_ad_widget', 'Wp-Insert Ad Widget', array('description' => 'Wp-Insert Ad Widget'));
292
+ }
293
+
294
+ public function widget($args, $instance) {
295
+ extract($args);
296
+ $title = apply_filters('widget_title', $instance['title']);
297
+ $adwidgets = get_option('wp_insert_adwidgets');
298
+ if(wp_insert_get_ad_status($adwidgets[$instance['instance']])) {
299
+ echo $before_widget;
300
+ if(!empty($title)) { echo $before_title.$title.$after_title; }
301
+ echo '<div class="wpInsert wpInsertAdWidget"'.(($adwidgets[$instance['instance']]['styles'] != '')?' style="'.$adwidgets[$instance['instance']]['styles'].'"':'').'>'.wp_insert_get_geotargeted_adcode($adwidgets[$instance['instance']]).'</div>';
302
+ echo $after_widget;
303
+ }
304
+ }
305
+
306
+ public function update($new_opts, $old_opts) {
307
+ $opts = array();
308
+ $opts['title'] = $new_opts['title'];
309
+ $opts['instance'] = $new_opts['instance'];
310
+ return $opts;
311
+ }
312
+
313
+ public function form($instance) {
314
+ $adwidgets = get_option('wp_insert_adwidgets');
315
+ echo '<p>';
316
+ echo '<label for="'.$this->get_field_id('title').'">Title:</label>';
317
+ echo '<input class="widefat" id="'.$this->get_field_id('title').'" name="'.$this->get_field_name('title').'" type="text" value="'.$instance['title'].'" />';
318
+ echo '</p>';
319
+ echo '<p>';
320
+ if(is_array($adwidgets) && (count($adwidgets) > 0)) {
321
+ echo '<label for="'.$this->get_field_id('instance').'">Select Ad-Widget:</label>';
322
+ echo '<select class="widefat" id="'.$this->get_field_id('instance').'" name="'.$this->get_field_name('instance').'">';
323
+ foreach($adwidgets as $adwidget) {
324
+ echo '<option value="'.$adwidget['identifier'].'" '.selected($adwidget['identifier'], $instance['instance'], false).'>Ad Widget : '.$adwidget['title'].'</option>';
325
+ }
326
+ echo '</select>';
327
+ } else {
328
+ echo 'Please <a href="'.admin_url('admin.php?page=wp-insert').'">Configure an Ad-Widget</a> to Proceed.';
329
+ echo '<input class="widefat" id="'.$this->get_field_id('instance').'" name="'.$this->get_field_name('instance').'" type="hidden" value="" />';
330
+ }
331
+ echo '</p>';
332
+ }
333
+ }
334
+ /* End Ad Widget Insertion */
335
+ ?>
includes/adwidgets/activate-upgrade.php DELETED
@@ -1,79 +0,0 @@
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 DELETED
@@ -1,343 +0,0 @@
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(!isset($data[$location])) { $data[$location] = array(); }
46
- $data = wp_insert_sanitize_array($data[$location], array('status', 'ad_code_1', 'ad_code_2', 'ad_code_3', 'country_1', 'country_code_1', 'rules_exclude_loggedin', 'rules_exclude_mobile_devices', 'rules_exclude_home', 'rules_exclude_archives', 'rules_exclude_categories', 'rules_categories_exceptions', 'rules_categories_post_exceptions', 'rules_exclude_search', 'rules_exclude_page', 'rules_page_exceptions', 'rules_exclude_post', 'rules_post_exceptions', 'styles'));
47
-
48
- $controls = array();
49
- $controls['status'] = wp_insert_get_control('tz-checkbox', false, $name.'[status]', $id.'-status', $data['status']);
50
- $controls['ad_code_1'] = wp_insert_get_control('textarea', false, $name.'[ad_code_1]', $id.'-ad_code_1', $data['ad_code_1'], 'Ad Code (Primary Network):', '', null, 'input widefat chitika');
51
- $controls['ad_code_2'] = wp_insert_get_control('textarea', false, $name.'[ad_code_2]', $id.'-ad_code_2', $data['ad_code_2'], 'Ad Code (Secondary Network):', '', null, 'input widefat chitika');
52
- $controls['ad_code_3'] = wp_insert_get_control('textarea', false, $name.'[ad_code_3]', $id.'-ad_code_3', $data['ad_code_3'], 'Ad Code (Tertiary Network):', '', null, 'input widefat chitika');
53
-
54
- $controls['country_1'] = wp_insert_get_control('popup', false, $name.'[country_1]', $id.'-country_1', $data['country_1'], 'Geo Targets', '', array('type' => 'countries'));
55
- $controls['country_code_1'] = wp_insert_get_control('textarea', false, $name.'[country_code_1]', $id.'-country_code_1', $data['country_code_1'], 'Ad Code', '', null, 'input widefat chitika');
56
-
57
- $controls['rules_exclude_loggedin'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_loggedin]', $id.'-rules_exclude_loggedin', $data['rules_exclude_loggedin'], '', '', null, '', false);
58
- $controls['rules_exclude_mobile_devices'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_mobile_devices]', $id.'-rules_exclude_mobile_devices', $data['rules_exclude_mobile_devices'], '', '', null, '', false);
59
- $controls['rules_exclude_home'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_home]', $id.'-rules_exclude_home', $data['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['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['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['rules_categories_exceptions'], '', '', array('type' => 'categories'), '', false);
63
- $controls['rules_categories_post_exceptions'] = wp_insert_get_control('popup', false, $name.'[rules_categories_post_exceptions]', $id.'-rules_categories_post_exceptions', $data['rules_categories_post_exceptions'], '', '', array('type' => 'categories'), '', false);
64
- $controls['rules_exclude_search'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_search]', $id.'-rules_exclude_search', $data['rules_exclude_search'], '', '', null, '', false);
65
- $controls['rules_exclude_page'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_page]', $id.'-rules_exclude_page', $data['rules_exclude_page'], '', '', null, '', false);
66
- $controls['rules_page_exceptions'] = wp_insert_get_control('popup', false, $name.'[rules_page_exceptions]', $id.'-rules_page_exceptions', $data['rules_page_exceptions'], '', '', array('type' => 'pages'), '', false);
67
- $controls['rules_exclude_post'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_post]', $id.'-rules_exclude_post', $data['rules_exclude_post'], '', '', null, '', false);
68
- $controls['rules_post_exceptions'] = wp_insert_get_control('popup', false, $name.'[rules_post_exceptions]', $id.'-rules_post_exceptions', $data['rules_post_exceptions'], '', '', array('type' => 'posts'), '', false);
69
- $post_types = get_post_types(array('public' => true, '_builtin' => false), 'names');
70
- if($post_types) {
71
- foreach($post_types as $post_type) {
72
- $controls['rules_exclude_cpt_'.$post_type] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_cpt_'.$post_type.']', $id.'-rules_exclude_cpt_'.$post_type, $data['rules_exclude_cpt_'.$post_type], '', '', null, '', false);
73
- }
74
- }
75
-
76
- $controls['styles'] = wp_insert_get_control('textarea', false, $name.'[styles]', $id.'-styles', $data['styles'], 'Styles:');
77
-
78
- $controls['notes'] = wp_insert_get_control('textarea', false, $name.'[notes]', $id.'-notes', $data['notes'], 'Notes:', 'Add a note to this Ad block for your personal use. This note is not displayed anywhere on the site');
79
-
80
- echo $controls['status']['html'];
81
-
82
- $multiple_network_status = get_option('wp_insert_multiple_network_status');
83
- if($multiple_network_status == 2 || $multiple_network_status == 1) {
84
- $controls['ad_code_3']['html'] = '<div style="display: none;">'.$controls['ad_code_3']['html'].'</div>';
85
- }
86
-
87
- if($multiple_network_status == 1) {
88
- $controls['ad_code_2']['html'] = '<div style="display: none;">'.$controls['ad_code_2']['html'].'</div>';
89
- }
90
- $tabData = array(
91
- array(
92
- 'title' => 'Ad Code',
93
- 'content' => $controls['ad_code_1']['html'].$controls['ad_code_2']['html'].$controls['ad_code_3']['html']
94
- ),
95
- array(
96
- 'title' => 'Rules',
97
- 'content' => wp_insert_adwidgets_rules_content($controls)
98
- ),
99
- array(
100
- 'title' => 'Geo Targeting',
101
- 'content' => '<p>'.$controls['country_1']['html'].$controls['country_code_1']['html'].'</p>'
102
- ),
103
- array(
104
- 'title' => 'Styles',
105
- 'content' => $controls['styles']['html']
106
- ),
107
- array(
108
- 'title' => 'Notes',
109
- 'content' => $controls['notes']['html']
110
- )
111
- );
112
- $controls['vtab'] = wp_insert_get_vtabs('vtab_'.$location, $tabData);
113
- echo $controls['vtab']['html'];
114
-
115
- echo wp_insert_get_script_tag($controls);
116
- }
117
-
118
- function wp_insert_adwidgets_rules_content($controls) {
119
- $rulesTable = array(
120
- 'class' => 'rules',
121
- 'rows' => array()
122
- );
123
- array_push(
124
- $rulesTable['rows'],
125
- array(
126
- 'cells' => array(
127
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Logged in Users')
128
- )
129
- ),
130
- array(
131
- 'cells' => array(
132
- array('content' => 'Status'),
133
- array('content' => '&nbsp;:&nbsp;'),
134
- array('content' => $controls['rules_exclude_loggedin']['html'])
135
- )
136
- ),
137
- array(
138
- 'cells' => array(
139
- array('colspan' => '3', 'content' => '&nbsp;')
140
- )
141
- )
142
- );
143
- array_push(
144
- $rulesTable['rows'],
145
- array(
146
- 'cells' => array(
147
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Mobile Devices')
148
- )
149
- ),
150
- array(
151
- 'cells' => array(
152
- array('content' => 'Status'),
153
- array('content' => '&nbsp;:&nbsp;'),
154
- array('content' => $controls['rules_exclude_mobile_devices']['html'])
155
- )
156
- ),
157
- array(
158
- 'cells' => array(
159
- array('colspan' => '3', 'content' => '&nbsp;')
160
- )
161
- )
162
- );
163
- array_push(
164
- $rulesTable['rows'],
165
- array(
166
- 'cells' => array(
167
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Home')
168
- )
169
- ),
170
- array(
171
- 'cells' => array(
172
- array('content' => 'Status'),
173
- array('content' => '&nbsp;:&nbsp;'),
174
- array('content' => $controls['rules_exclude_home']['html'])
175
- )
176
- )
177
- );
178
- array_push(
179
- $rulesTable['rows'],
180
- array(
181
- 'cells' => array(
182
- array('colspan' => '3', 'content' => '&nbsp;')
183
- )
184
- ),
185
- array(
186
- 'cells' => array(
187
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Archives')
188
- )
189
- ),
190
- array(
191
- 'cells' => array(
192
- array('content' => 'Status'),
193
- array('content' => '&nbsp;:&nbsp;'),
194
- array('content' => $controls['rules_exclude_archives']['html'])
195
- )
196
- )
197
- );
198
- array_push(
199
- $rulesTable['rows'],
200
- array(
201
- 'cells' => array(
202
- array('colspan' => '3', 'content' => '&nbsp;')
203
- )
204
- ),
205
- array(
206
- 'cells' => array(
207
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Categories')
208
- )
209
- ),
210
- array(
211
- 'cells' => array(
212
- array('content' => 'Status'),
213
- array('content' => '&nbsp;:&nbsp;'),
214
- array('content' => $controls['rules_exclude_categories']['html'])
215
- )
216
- ),
217
- array(
218
- 'cells' => array(
219
- array('content' => 'Exceptions'),
220
- array('content' => '&nbsp;:&nbsp;'),
221
- array('content' => $controls['rules_categories_exceptions']['html'])
222
- )
223
- ),
224
- array(
225
- 'cells' => array(
226
- array('content' => 'Post Exceptions'),
227
- array('content' => '&nbsp;:&nbsp;'),
228
- array('content' => $controls['rules_categories_post_exceptions']['html'])
229
- )
230
- )
231
- );
232
- array_push(
233
- $rulesTable['rows'],
234
- array(
235
- 'cells' => array(
236
- array('colspan' => '3', 'content' => '&nbsp;')
237
- )
238
- ),
239
- array(
240
- 'cells' => array(
241
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Search Results')
242
- )
243
- ),
244
- array(
245
- 'cells' => array(
246
- array('content' => 'Status'),
247
- array('content' => '&nbsp;:&nbsp;'),
248
- array('content' => $controls['rules_exclude_search']['html'])
249
- )
250
- )
251
- );
252
- array_push(
253
- $rulesTable['rows'],
254
- array(
255
- 'cells' => array(
256
- array('colspan' => '3', 'content' => '&nbsp;')
257
- )
258
- ),
259
- array(
260
- 'cells' => array(
261
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Single Page')
262
- )
263
- ),
264
- array(
265
- 'cells' => array(
266
- array('content' => 'Status'),
267
- array('content' => '&nbsp;:&nbsp;'),
268
- array('content' => $controls['rules_exclude_page']['html'])
269
- )
270
- ),
271
- array(
272
- 'cells' => array(
273
- array('content' => 'Exceptions'),
274
- array('content' => '&nbsp;:&nbsp;'),
275
- array('content' => $controls['rules_page_exceptions']['html'])
276
- )
277
- )
278
- );
279
- array_push(
280
- $rulesTable['rows'],
281
- array(
282
- 'cells' => array(
283
- array('colspan' => '3', 'content' => '&nbsp;')
284
- )
285
- ),
286
- array(
287
- 'cells' => array(
288
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Single Blog Post')
289
- )
290
- ),
291
- array(
292
- 'cells' => array(
293
- array('content' => 'Status'),
294
- array('content' => '&nbsp;:&nbsp;'),
295
- array('content' => $controls['rules_exclude_post']['html'])
296
- )
297
- ),
298
- array(
299
- 'cells' => array(
300
- array('content' => 'Exceptions'),
301
- array('content' => '&nbsp;:&nbsp;'),
302
- array('content' => $controls['rules_post_exceptions']['html'])
303
- )
304
- )
305
- );
306
- array_push(
307
- $rulesTable['rows'],
308
- array(
309
- 'cells' => array(
310
- array('colspan' => '3', 'content' => '&nbsp;')
311
- )
312
- ),
313
- array(
314
- 'cells' => array(
315
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Custom Post Types')
316
- )
317
- )
318
- );
319
-
320
- $post_types = get_post_types(array('public' => true, '_builtin' => false), 'object');
321
- if($post_types) {
322
- foreach($post_types as $post_type) {
323
- array_push(
324
- $rulesTable['rows'],
325
- array(
326
- 'cells' => array(
327
- array('content' => $post_type->labels->name),
328
- array('content' => '&nbsp;:&nbsp;'),
329
- array('content' => $controls['rules_exclude_cpt_'.$post_type->name]['html'])
330
- )
331
- )
332
- );
333
- }
334
- }
335
-
336
- return wp_insert_get_table($rulesTable);
337
- }
338
-
339
- function wp_insert_adwidgets_validate($input) {
340
- update_option('wp_insert_multiple_network_status', $input['multiple-network']['status']);
341
- return $input;
342
- }
343
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/adwidgets/adwidgets.php DELETED
@@ -1,6 +0,0 @@
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 DELETED
@@ -1,9 +0,0 @@
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 DELETED
@@ -1,57 +0,0 @@
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, explode(',', $options['adwidgets-'.$instance['instance']]['country_1'])))) {
23
- echo '<div class="wpInsert wpInsertAdWidget"'.(($options['adwidgets-'.$instance['instance']]['styles'] != '')?' style="'.$options['adwidgets-'.$instance['instance']]['styles'].'"':'').'>'.do_shortcode($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'].'"':'').'>'.do_shortcode($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/assets/css/wp-insert.css ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wp-insert .upgrade-notice {
2
+ background: #FFFFD1;
3
+ padding: 10px;
4
+ border: 1px dashed red;
5
+ text-align: center;
6
+ font-weight: bold;
7
+ }
8
+
9
+ .wp_insert_ajaxloader {
10
+ background: url(../images/ajax-loader.gif) no-repeat center center;
11
+ max-width: 320px;
12
+ min-width: 100px;
13
+ height: 100px;
14
+ margin: auto;
15
+ }
16
+
17
+ .wp_insert_ajaxloader_flat {
18
+ background: url(../images/ajax-loader-flat.gif) no-repeat center center;
19
+ max-width: 320px;
20
+ min-width: 100px;
21
+ height: 50px;
22
+ margin: auto;
23
+ }
24
+
25
+ .wp-insert .plugin-card-bottom .wp_insert_delete_icon {
26
+ color: #b20a0a;
27
+ cursor: pointer;
28
+ float: right;
29
+ }
30
+
31
+ .wp-insert .plugin-card-bottom .wp_insert_delete_icon:hover {
32
+ color: #FC0505;
33
+ }
34
+
35
+ .wp-insert .plugin-card-bottom p {
36
+ border-top: 1px solid #dedede;
37
+ margin: 0;
38
+ padding: 10px 5px;
39
+ }
40
+
41
+ .wp-insert .plugin-card-bottom p:first-child {
42
+ border-top: none;
43
+ }
44
+
45
+ .wp_insert_OR {
46
+ font-size: larger;
47
+ margin: 10px;
48
+ text-align: center;
49
+ }
50
+
51
+ .smartlogixControlsSectionInner .wp_insert_generate_page_button {
52
+ border-radius: 7px;
53
+ display: block;
54
+ font-size: 18px;
55
+ height: auto;
56
+ margin: auto;
57
+ padding: 10px 18px;
58
+ text-transform: uppercase;
59
+ }
60
+
61
+ .wp_insert_rule_block {
62
+ width: calc(50% - 40px);
63
+ margin: 20px;
64
+ float: left;
65
+ }
66
+
67
+ .wp_insert_rule_block .ui-button {
68
+ background: #6ddc5f !important;
69
+ border: 2px solid #000 !important;
70
+ color: #fff !important;
71
+ display: block;
72
+ font-weight: bold !important;
73
+ height: 30px;
74
+ margin: auto;
75
+ text-shadow: 1px 1px 5px #000;
76
+ width: 80%;
77
+ }
78
+
79
+ .wp_insert_rule_block .ui-button.ui-state-active {
80
+ background: #C8161B !important;
81
+ }
82
+
83
+ .codeSnippet code {
84
+ display: block;
85
+ font-size: 18px;
86
+ height: auto;
87
+ padding: 10px;
88
+ word-wrap: break-word;
89
+ }
90
+
91
+ @media screen and (max-width:768px) {
92
+ .wp_insert_rule_block {
93
+ width: auto;
94
+ float: none;
95
+ }
96
+ }
includes/{common → assets}/images/adsense.gif RENAMED
File without changes
includes/assets/images/ajax-loader-flat.gif ADDED
Binary file
includes/assets/images/ajax-loader.gif ADDED
Binary file
includes/{common → assets}/images/chitika.png RENAMED
File without changes
includes/assets/images/header-banner.png ADDED
Binary file
includes/assets/images/icon.png ADDED
Binary file
includes/assets/js/wp-insert.js ADDED
@@ -0,0 +1,582 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function() {
2
+ wp_insert_click_handler(
3
+ 'wp_insert_abtesting_configuration',
4
+ 'Multiple Ad Networks / A-B Testing : Configuration',
5
+ '480',
6
+ '480',
7
+ function() { },
8
+ function() {
9
+ jQuery.post(
10
+ jQuery('#wp_insert_admin_ajax').val(), {
11
+ 'action': "wp_insert_abtesting_configuration_form_save_action",
12
+ 'wp_insert_nonce': jQuery('#wp_insert_nonce').val(),
13
+ 'wp_insert_abtesting_mode': jQuery('input[name=wp_insert_abtesting_mode]:checked').val()
14
+ }, function(response) { }
15
+ );
16
+ },
17
+ function() { }
18
+ );
19
+
20
+ wp_insert_click_handler(
21
+ 'wp_insert_trackingcodes_google_analytics',
22
+ 'Tracking Codes : Google Analytics',
23
+ '480',
24
+ '480',
25
+ function() {
26
+ jQuery('#wp_insert_trackingcodes_analytics_status').parent().css({'display': 'inline-block', 'margin': '5px 0 0'}).prependTo('.ui-dialog-buttonpane');
27
+ },
28
+ function() {
29
+ jQuery.post(
30
+ jQuery('#wp_insert_admin_ajax').val(), {
31
+ 'action': 'wp_insert_trackingcodes_google_analytics_form_save_action',
32
+ 'wp_insert_nonce': jQuery('#wp_insert_nonce').val(),
33
+ 'wp_insert_trackingcodes_analytics_status': jQuery('#wp_insert_trackingcodes_analytics_status').prop('checked'),
34
+ 'wp_insert_trackingcodes_analytics_code': jQuery('#wp_insert_trackingcodes_analytics_code').val(),
35
+ }, function(response) { }
36
+ );
37
+ },
38
+ function() { }
39
+ );
40
+
41
+ wp_insert_click_handler(
42
+ 'wp_insert_trackingcodes_header',
43
+ 'Tracking Codes : Header',
44
+ jQuery("body").width() * 0.8,
45
+ jQuery("body").height() * 0.8,
46
+ function() {
47
+ jQuery('#wp_insert_trackingcodes_header_code').css('height', (jQuery("body").height() * 0.5)+'px');
48
+ jQuery('#wp_insert_trackingcodes_header_status').parent().css({'display': 'inline-block', 'margin': '5px 0 0'}).prependTo('.ui-dialog-buttonpane');
49
+ },
50
+ function() {
51
+ jQuery.post(
52
+ jQuery('#wp_insert_admin_ajax').val(), {
53
+ 'action': 'wp_insert_trackingcodes_header_form_save_action',
54
+ 'wp_insert_nonce': jQuery('#wp_insert_nonce').val(),
55
+ 'wp_insert_trackingcodes_header_status': jQuery('#wp_insert_trackingcodes_header_status').prop('checked'),
56
+ 'wp_insert_trackingcodes_header_code': jQuery('#wp_insert_trackingcodes_header_code').val(),
57
+ }, function(response) { }
58
+ );
59
+ },
60
+ function() { }
61
+ );
62
+
63
+ wp_insert_click_handler(
64
+ 'wp_insert_trackingcodes_footer',
65
+ 'Tracking Codes : Footer',
66
+ jQuery("body").width() * 0.8,
67
+ jQuery("body").height() * 0.8,
68
+ function() {
69
+ jQuery('#wp_insert_trackingcodes_footer_code').css('height', (jQuery("body").height() * 0.5)+'px');
70
+ jQuery('#wp_insert_trackingcodes_footer_status').parent().css({'display': 'inline-block', 'margin': '5px 0 0'}).prependTo('.ui-dialog-buttonpane');
71
+ },
72
+ function() {
73
+ jQuery.post(
74
+ jQuery('#wp_insert_admin_ajax').val(), {
75
+ 'action': 'wp_insert_trackingcodes_footer_form_save_action',
76
+ 'wp_insert_nonce': jQuery('#wp_insert_nonce').val(),
77
+ 'wp_insert_trackingcodes_footer_status': jQuery('#wp_insert_trackingcodes_footer_status').prop('checked'),
78
+ 'wp_insert_trackingcodes_footer_code': jQuery('#wp_insert_trackingcodes_footer_code').val(),
79
+ }, function(response) { }
80
+ );
81
+ },
82
+ function() { }
83
+ );
84
+
85
+ wp_insert_click_handler(
86
+ 'wp_insert_legalpages_privacy_policy',
87
+ 'Legal Pages : Privacy Policy',
88
+ jQuery("body").width() * 0.8,
89
+ jQuery("body").height() * 0.8,
90
+ function() { },
91
+ function() {
92
+ tinyMCE.triggerSave();
93
+ jQuery.post(
94
+ jQuery('#wp_insert_admin_ajax').val(), {
95
+ 'action': 'wp_insert_legalpages_privacy_policy_form_save_action',
96
+ 'wp_insert_nonce': jQuery('#wp_insert_nonce').val(),
97
+ 'wp_insert_legalpages_privacy_policy_content': jQuery('#wp_insert_legalpages_privacy_policy_content').val(),
98
+ 'wp_insert_legalpages_privacy_policy_assigned_page': jQuery('#wp_insert_legalpages_privacy_policy_assigned_page').val(),
99
+ }, function(response) { }
100
+ );
101
+ },
102
+ function() { }
103
+ );
104
+
105
+ wp_insert_click_handler(
106
+ 'wp_insert_legalpages_terms_conditions',
107
+ 'Legal Pages : Terms and Conditions',
108
+ jQuery("body").width() * 0.8,
109
+ jQuery("body").height() * 0.8,
110
+ function() { },
111
+ function() {
112
+ tinyMCE.triggerSave();
113
+ jQuery.post(
114
+ jQuery('#wp_insert_admin_ajax').val(), {
115
+ 'action': 'wp_insert_legalpages_terms_conditions_form_save_action',
116
+ 'wp_insert_nonce': jQuery('#wp_insert_nonce').val(),
117
+ 'wp_insert_legalpages_terms_conditions_content': jQuery('#wp_insert_legalpages_terms_conditions_content').val(),
118
+ 'wp_insert_legalpages_terms_conditions_assigned_page': jQuery('#wp_insert_legalpages_terms_conditions_assigned_page').val(),
119
+ }, function(response) { }
120
+ );
121
+ },
122
+ function() { }
123
+ );
124
+
125
+ wp_insert_click_handler(
126
+ 'wp_insert_legalpages_disclaimer',
127
+ 'Legal Pages : Disclaimer',
128
+ jQuery("body").width() * 0.8,
129
+ jQuery("body").height() * 0.8,
130
+ function() { },
131
+ function() {
132
+ tinyMCE.triggerSave();
133
+ jQuery.post(
134
+ jQuery('#wp_insert_admin_ajax').val(), {
135
+ 'action': 'wp_insert_legalpages_disclaimer_form_save_action',
136
+ 'wp_insert_nonce': jQuery('#wp_insert_nonce').val(),
137
+ 'wp_insert_legalpages_disclaimer_content': jQuery('#wp_insert_legalpages_disclaimer_content').val(),
138
+ 'wp_insert_legalpages_disclaimer_assigned_page': jQuery('#wp_insert_legalpages_disclaimer_assigned_page').val(),
139
+ }, function(response) { }
140
+ );
141
+ },
142
+ function() { }
143
+ );
144
+
145
+ wp_insert_click_handler(
146
+ 'wp_insert_legalpages_copyright',
147
+ 'Legal Pages : Copyright Notice',
148
+ jQuery("body").width() * 0.8,
149
+ jQuery("body").height() * 0.8,
150
+ function() { },
151
+ function() {
152
+ tinyMCE.triggerSave();
153
+ jQuery.post(
154
+ jQuery('#wp_insert_admin_ajax').val(), {
155
+ 'action': 'wp_insert_legalpages_copyright_form_save_action',
156
+ 'wp_insert_nonce': jQuery('#wp_insert_nonce').val(),
157
+ 'wp_insert_legalpages_copyright_content': jQuery('#wp_insert_legalpages_copyright_content').val(),
158
+ 'wp_insert_legalpages_copyright_assigned_page': jQuery('#wp_insert_legalpages_copyright_assigned_page').val(),
159
+ }, function(response) { }
160
+ );
161
+ },
162
+ function() { }
163
+ );
164
+
165
+ wp_insert_inpostads_click_handler('above');
166
+ wp_insert_inpostads_click_handler('middle');
167
+ wp_insert_inpostads_click_handler('below');
168
+ wp_insert_inpostads_click_handler('left');
169
+ wp_insert_inpostads_click_handler('right');
170
+
171
+ wp_insert_click_handler(
172
+ 'wp_insert_adwidgets_new',
173
+ 'Ad Widget : Add New',
174
+ jQuery("body").width() * 0.8,
175
+ jQuery("body").height() * 0.8,
176
+ function() {
177
+ jQuery('.wp_insert_adwidgets_status').parent().css({'display': 'inline-block', 'margin': '5px 0 0'}).prependTo('.ui-dialog-buttonpane');
178
+ },
179
+ function() {
180
+ var identifier = jQuery(".wp_insert_adwidgets_identifier").val();
181
+ var adwidgetLink = jQuery("<a></a>");
182
+ adwidgetLink.attr("id", "wp_insert_adwidgets_"+identifier);
183
+ adwidgetLink.attr("href", "javascript:;");
184
+ adwidgetLink.attr("onClick", "wp_insert_adwidgets_click_handler(\'"+identifier+"\', \'"+jQuery("#wp_insert_adwidgets_"+identifier+"_title").val()+"\')");
185
+ adwidgetLink.html("Ad Widget : "+jQuery("#wp_insert_adwidgets_"+identifier+"_title").val());
186
+ var deleteButton = jQuery("<span></span>");
187
+ deleteButton.attr("class", "dashicons dashicons-dismiss wp_insert_delete_icon");
188
+ deleteButton.attr("onClick", "wp_insert_adwidgets_remove(\'"+identifier+"\')");
189
+ jQuery("#wp_insert_adwidgets_new").parent().before(jQuery("<p></p>").append(adwidgetLink, deleteButton));
190
+ wp_insert_adwidgets_update(identifier);
191
+ },
192
+ function() { }
193
+ );
194
+
195
+ wp_insert_click_handler(
196
+ 'wp_insert_inthemeads_new',
197
+ 'In-Theme Ad : Add New',
198
+ jQuery("body").width() * 0.8,
199
+ jQuery("body").height() * 0.8,
200
+ function() {
201
+ jQuery('.wp_insert_inthemeads_status').parent().css({'display': 'inline-block', 'margin': '5px 0 0'}).prependTo('.ui-dialog-buttonpane');
202
+ },
203
+ function() {
204
+ var identifier = jQuery(".wp_insert_inthemeads_identifier").val();
205
+ var inthemeadLink = jQuery("<a></a>");
206
+ inthemeadLink.attr("id", "wp_insert_inthemeads_"+identifier);
207
+ inthemeadLink.attr("href", "javascript:;");
208
+ inthemeadLink.attr("onClick", "wp_insert_inthemeads_click_handler(\'"+identifier+"\', \'"+jQuery("#wp_insert_inthemeads_"+identifier+"_title").val()+"\')");
209
+ inthemeadLink.html("Ad Widget : "+jQuery("#wp_insert_inthemeads_"+identifier+"_title").val());
210
+ var deleteButton = jQuery("<span></span>");
211
+ deleteButton.attr("class", "dashicons dashicons-dismiss wp_insert_delete_icon");
212
+ deleteButton.attr("onClick", "wp_insert_inthemeads_remove(\'"+identifier+"\')");
213
+ jQuery("#wp_insert_inthemeads_new").parent().before(jQuery("<p></p>").append(inthemeadLink, deleteButton));
214
+ wp_insert_inthemeads_update(identifier);
215
+ },
216
+ function() { }
217
+ );
218
+ });
219
+
220
+
221
+ function wp_insert_inpostads_click_handler(location) {
222
+ wp_insert_click_handler(
223
+ 'wp_insert_inpostads_'+location,
224
+ 'Inpost Ads : Ad '+location.charAt(0).toUpperCase()+location.slice(1)+' Post Content',
225
+ jQuery("body").width() * 0.8,
226
+ jQuery("body").height() * 0.9,
227
+ function() {
228
+ jQuery('#wp_insert_inpostads_'+location+'_status').parent().css({'display': 'inline-block', 'margin': '5px 0 0'}).prependTo('.ui-dialog-buttonpane');
229
+ },
230
+ function() {
231
+ args = {};
232
+ args['action'] = 'wp_insert_inpostads_'+location+'_form_save_action';
233
+ args['wp_insert_nonce'] = jQuery('#wp_insert_nonce').val();
234
+ args['wp_insert_inpostads_'+location+'_status'] = jQuery('#wp_insert_inpostads_'+location+'_status').prop('checked');
235
+
236
+ args['wp_insert_inpostads_'+location+'_primary_ad_code'] = jQuery('#wp_insert_inpostads_'+location+'_primary_ad_code').val();
237
+ args['wp_insert_inpostads_'+location+'_secondary_ad_code'] = jQuery('#wp_insert_inpostads_'+location+'_secondary_ad_code').val();
238
+ args['wp_insert_inpostads_'+location+'_tertiary_ad_code'] = jQuery('#wp_insert_inpostads_'+location+'_tertiary_ad_code').val();
239
+
240
+ args['wp_insert_inpostads_'+location+'_rules_exclude_loggedin'] = jQuery('#wp_insert_inpostads_'+location+'_rules_exclude_loggedin').prop('checked');
241
+ args['wp_insert_inpostads_'+location+'_rules_exclude_mobile_devices'] = jQuery('#wp_insert_inpostads_'+location+'_rules_exclude_mobile_devices').prop('checked');
242
+ args['wp_insert_inpostads_'+location+'_rules_exclude_home'] = jQuery('#wp_insert_inpostads_'+location+'_rules_exclude_home').prop('checked');
243
+ args['wp_insert_inpostads_'+location+'_rules_home_instances'] = jQuery.map(jQuery('#wp_insert_inpostads_'+location+'_rules_home_instances :selected'), function(e) { return jQuery(e).val(); });
244
+ args['wp_insert_inpostads_'+location+'_rules_exclude_archives'] = jQuery('#wp_insert_inpostads_'+location+'_rules_exclude_archives').prop('checked');
245
+ args['wp_insert_inpostads_'+location+'_rules_archives_instances'] = jQuery.map(jQuery('#wp_insert_inpostads_'+location+'_rules_archives_instances :selected'), function(e) { return jQuery(e).val(); });
246
+ args['wp_insert_inpostads_'+location+'_rules_exclude_search'] = jQuery('#wp_insert_inpostads_'+location+'_rules_exclude_search').prop('checked');
247
+ args['wp_insert_inpostads_'+location+'_rules_search_instances'] = jQuery.map(jQuery('#wp_insert_inpostads_'+location+'_rules_search_instances :selected'), function(e) { return jQuery(e).val(); });
248
+ args['wp_insert_inpostads_'+location+'_rules_exclude_page'] = jQuery('#wp_insert_inpostads_'+location+'_rules_exclude_page').prop('checked');
249
+ args['wp_insert_inpostads_'+location+'_rules_page_exceptions'] = jQuery.map(jQuery('#wp_insert_inpostads_'+location+'_rules_page_exceptions :selected'), function(e) { return jQuery(e).val(); });
250
+ args['wp_insert_inpostads_'+location+'_rules_exclude_post'] = jQuery('#wp_insert_inpostads_'+location+'_rules_exclude_post').prop('checked');
251
+ args['wp_insert_inpostads_'+location+'_rules_post_exceptions'] = jQuery.map(jQuery('#wp_insert_inpostads_'+location+'_rules_post_exceptions :selected'), function(e) { return jQuery(e).val(); });
252
+ args['wp_insert_inpostads_'+location+'_rules_post_categories_exceptions'] = jQuery.map(jQuery('#wp_insert_inpostads_'+location+'_rules_post_categories_exceptions :selected'), function(e) { return jQuery(e).val(); });
253
+ args['wp_insert_inpostads_'+location+'_rules_exclude_categories'] = jQuery('#wp_insert_inpostads_'+location+'_rules_exclude_categories').prop('checked');
254
+ args['wp_insert_inpostads_'+location+'_rules_categories_instances'] = jQuery.map(jQuery('#wp_insert_inpostads_'+location+'_rules_categories_instances :selected'), function(e) { return jQuery(e).val(); });
255
+ args['wp_insert_inpostads_'+location+'_rules_categories_exceptions'] = jQuery.map(jQuery('#wp_insert_inpostads_'+location+'_rules_categories_exceptions :selected'), function(e) { return jQuery(e).val(); });
256
+
257
+ args['wp_insert_inpostads_'+location+'_geo_group1_countries'] = jQuery.map(jQuery('#wp_insert_inpostads_'+location+'_geo_group1_countries :selected'), function(e) { return jQuery(e).val(); });
258
+ args['wp_insert_inpostads_'+location+'_geo_group1_adcode'] = jQuery('#wp_insert_inpostads_'+location+'_geo_group1_adcode').val();
259
+ args['wp_insert_inpostads_'+location+'_geo_group2_countries'] = jQuery.map(jQuery('#wp_insert_inpostads_'+location+'_geo_group2_countries :selected'), function(e) { return jQuery(e).val(); });
260
+ args['wp_insert_inpostads_'+location+'_geo_group2_adcode'] = jQuery('#wp_insert_inpostads_'+location+'_geo_group2_adcode').val();
261
+
262
+ args['wp_insert_inpostads_'+location+'_styles'] = jQuery('#wp_insert_inpostads_'+location+'_styles').val();
263
+
264
+ args['wp_insert_inpostads_'+location+'_notes'] = jQuery('#wp_insert_inpostads_'+location+'_notes').val();
265
+
266
+ if(location == 'middle') {
267
+ args['wp_insert_inpostads_'+location+'_minimum_character_count'] = jQuery('#wp_insert_inpostads_'+location+'_minimum_character_count').val();
268
+ args['wp_insert_inpostads_'+location+'_paragraph_buffer_count'] = jQuery('#wp_insert_inpostads_'+location+'_paragraph_buffer_count').val();
269
+ }
270
+ jQuery.post(
271
+ jQuery('#wp_insert_admin_ajax').val(), args, function(response) { }
272
+ );
273
+ },
274
+ function() { }
275
+ );
276
+ }
277
+
278
+ function wp_insert_adwidgets_click_handler(identifier, title) {
279
+ jQuery('<div id="wp_insert_adwidgets_'+identifier+'_dialog"></div>').html('<div class="wp_insert_ajaxloader"></div>').dialog({
280
+ 'modal': true,
281
+ 'resizable': false,
282
+ 'width': jQuery("body").width() * 0.8,
283
+ 'maxWidth': jQuery("body").width() * 0.8,
284
+ 'maxHeight': jQuery("body").height() * 0.9,
285
+ 'title': 'Ad Widget : '+title,
286
+ position: { my: 'center', at: 'center', of: window },
287
+ open: function (event, ui) {
288
+ jQuery('.ui-dialog').css({'z-index': 999999, 'max-width': '90%'});
289
+ jQuery('.ui-widget-overlay').css({'z-index': 999998, 'opacity': 0.8, 'background': '#000000'});
290
+ jQuery('.ui-dialog-buttonpane button:contains("Update")').button('disable');
291
+ jQuery.post(
292
+ jQuery('#wp_insert_admin_ajax').val(), {
293
+ 'action': 'wp_insert_adwidgets_existing_form_get_content',
294
+ 'wp_insert_adwidgets_identifier': identifier,
295
+ 'wp_insert_nonce': jQuery('#wp_insert_nonce').val()
296
+ }, function(response) {
297
+ jQuery('.wp_insert_ajaxloader').hide();
298
+ jQuery('.ui-dialog-content').html(response);
299
+ jQuery('.ui-accordion .ui-accordion-content').css('max-height', (jQuery("body").height() * 0.45));
300
+ jQuery('.ui-dialog-buttonpane button:contains("Update")').button('enable');
301
+ jQuery('.wp_insert_adwidgets_status').parent().css({'display': 'inline-block', 'margin': '5px 0 0'}).prependTo('.ui-dialog-buttonpane');
302
+ jQuery('.ui-dialog').css({'position': 'fixed'});
303
+ jQuery('#wp_insert_adwidgets_'+identifier+'_dialog').delay(500).dialog({position: { my: 'center', at: 'center', of: window }});
304
+ }
305
+ );
306
+ },
307
+ buttons: {
308
+ 'Update': function() {
309
+ jQuery("#wp_insert_adwidgets_"+identifier).html("Ad Widget : "+jQuery("#wp_insert_adwidgets_"+identifier+"_title").val());
310
+ jQuery("#wp_insert_adwidgets_"+identifier).attr("onClick", "wp_insert_adwidgets_click_handler(\'"+identifier+"\', \'"+jQuery("#wp_insert_adwidgets_"+identifier+"_title").val()+"\')");
311
+ wp_insert_adwidgets_update(identifier);
312
+ jQuery(this).dialog('close');
313
+ },
314
+ Cancel: function() {
315
+ jQuery(this).dialog('close');
316
+ }
317
+ },
318
+ close: function() {
319
+ jQuery(this).dialog('destroy');
320
+ }
321
+ });
322
+ }
323
+
324
+ function wp_insert_adwidgets_update(identifier) {
325
+ args = {};
326
+ args['action'] = 'wp_insert_adwidgets_existing_form_save_action';
327
+ args['wp_insert_nonce'] = jQuery('#wp_insert_nonce').val();
328
+ args['wp_insert_adwidgets_identifier'] = identifier;
329
+ args['wp_insert_adwidgets_'+identifier+'_status'] = jQuery('#wp_insert_adwidgets_'+identifier+'_status').prop('checked');
330
+
331
+ args['wp_insert_adwidgets_'+identifier+'_title'] = jQuery('#wp_insert_adwidgets_'+identifier+'_title').val();
332
+
333
+ args['wp_insert_adwidgets_'+identifier+'_primary_ad_code'] = jQuery('#wp_insert_adwidgets_'+identifier+'_primary_ad_code').val();
334
+ args['wp_insert_adwidgets_'+identifier+'_secondary_ad_code'] = jQuery('#wp_insert_adwidgets_'+identifier+'_secondary_ad_code').val();
335
+ args['wp_insert_adwidgets_'+identifier+'_tertiary_ad_code'] = jQuery('#wp_insert_adwidgets_'+identifier+'_tertiary_ad_code').val();
336
+
337
+ args['wp_insert_adwidgets_'+identifier+'_rules_exclude_loggedin'] = jQuery('#wp_insert_adwidgets_'+identifier+'_rules_exclude_loggedin').prop('checked');
338
+ args['wp_insert_adwidgets_'+identifier+'_rules_exclude_mobile_devices'] = jQuery('#wp_insert_adwidgets_'+identifier+'_rules_exclude_mobile_devices').prop('checked');
339
+ args['wp_insert_adwidgets_'+identifier+'_rules_exclude_home'] = jQuery('#wp_insert_adwidgets_'+identifier+'_rules_exclude_home').prop('checked');
340
+ args['wp_insert_adwidgets_'+identifier+'_rules_exclude_archives'] = jQuery('#wp_insert_adwidgets_'+identifier+'_rules_exclude_archives').prop('checked');
341
+ args['wp_insert_adwidgets_'+identifier+'_rules_exclude_search'] = jQuery('#wp_insert_adwidgets_'+identifier+'_rules_exclude_search').prop('checked');
342
+ args['wp_insert_adwidgets_'+identifier+'_rules_exclude_page'] = jQuery('#wp_insert_adwidgets_'+identifier+'_rules_exclude_page').prop('checked');
343
+ args['wp_insert_adwidgets_'+identifier+'_rules_page_exceptions'] = jQuery.map(jQuery('#wp_insert_adwidgets_'+identifier+'_rules_page_exceptions :selected'), function(e) { return jQuery(e).val(); });
344
+ args['wp_insert_adwidgets_'+identifier+'_rules_exclude_post'] = jQuery('#wp_insert_adwidgets_'+identifier+'_rules_exclude_post').prop('checked');
345
+ args['wp_insert_adwidgets_'+identifier+'_rules_post_exceptions'] = jQuery.map(jQuery('#wp_insert_adwidgets_'+identifier+'_rules_post_exceptions :selected'), function(e) { return jQuery(e).val(); });
346
+ args['wp_insert_adwidgets_'+identifier+'_rules_post_categories_exceptions'] = jQuery.map(jQuery('#wp_insert_adwidgets_'+identifier+'_rules_post_categories_exceptions :selected'), function(e) { return jQuery(e).val(); });
347
+ args['wp_insert_adwidgets_'+identifier+'_rules_exclude_categories'] = jQuery('#wp_insert_adwidgets_'+identifier+'_rules_exclude_categories').prop('checked');
348
+ args['wp_insert_adwidgets_'+identifier+'_rules_categories_exceptions'] = jQuery.map(jQuery('#wp_insert_adwidgets_'+identifier+'_rules_categories_exceptions :selected'), function(e) { return jQuery(e).val(); });
349
+
350
+ args['wp_insert_adwidgets_'+identifier+'_geo_group1_countries'] = jQuery.map(jQuery('#wp_insert_adwidgets_'+identifier+'_geo_group1_countries :selected'), function(e) { return jQuery(e).val(); });
351
+ args['wp_insert_adwidgets_'+identifier+'_geo_group1_adcode'] = jQuery('#wp_insert_adwidgets_'+identifier+'_geo_group1_adcode').val();
352
+ args['wp_insert_adwidgets_'+identifier+'_geo_group2_countries'] = jQuery.map(jQuery('#wp_insert_adwidgets_'+identifier+'_geo_group2_countries :selected'), function(e) { return jQuery(e).val(); });
353
+ args['wp_insert_adwidgets_'+identifier+'_geo_group2_adcode'] = jQuery('#wp_insert_adwidgets_'+identifier+'_geo_group2_adcode').val();
354
+
355
+ args['wp_insert_adwidgets_'+identifier+'_styles'] = jQuery('#wp_insert_adwidgets_'+identifier+'_styles').val();
356
+
357
+ args['wp_insert_adwidgets_'+identifier+'_notes'] = jQuery('#wp_insert_adwidgets_'+identifier+'_notes').val();
358
+
359
+ jQuery.post(
360
+ jQuery('#wp_insert_admin_ajax').val(), args, function(response) { }
361
+ );
362
+ }
363
+
364
+ function wp_insert_adwidgets_remove(identifier) {
365
+ jQuery("<p>Are you Sure you want to remove this Ad Unit?</p>").dialog({
366
+ 'modal': true,
367
+ 'resizable': false,
368
+ 'title': 'Deletion Confirmation',
369
+ position: { my: 'center', at: 'center', of: window },
370
+ open: function (event, ui) {
371
+ jQuery('.ui-dialog').css({'z-index': 999999, 'max-width': '90%'});
372
+ jQuery('.ui-widget-overlay').css({'z-index': 999998, 'opacity': 0.8, 'background': '#000000'});
373
+ },
374
+ buttons : {
375
+ 'Confirm': function() {
376
+ jQuery("#wp_insert_adwidgets_"+identifier).parent().remove();
377
+ jQuery.post(
378
+ jQuery('#wp_insert_admin_ajax').val(), {
379
+ 'action': 'wp_insert_adwidgets_remove',
380
+ 'wp_insert_adwidgets_identifier': identifier,
381
+ 'wp_insert_nonce': jQuery('#wp_insert_nonce').val()
382
+ }, function(response) {
383
+ }
384
+ );
385
+ jQuery(this).dialog("close");
386
+ },
387
+ 'Cancel': function() {
388
+ jQuery(this).dialog("close");
389
+ }
390
+ },
391
+ close: function() {
392
+ jQuery(this).dialog('destroy');
393
+ }
394
+ });
395
+ }
396
+
397
+ function wp_insert_inthemeads_click_handler(identifier, title) {
398
+ jQuery('<div id="wp_insert_inthemeads_'+identifier+'_dialog"></div>').html('<div class="wp_insert_ajaxloader"></div>').dialog({
399
+ 'modal': true,
400
+ 'resizable': false,
401
+ 'width': jQuery("body").width() * 0.8,
402
+ 'maxWidth': jQuery("body").width() * 0.8,
403
+ 'maxHeight': jQuery("body").height() * 0.9,
404
+ 'title': 'In-Theme Ad : '+title,
405
+ position: { my: 'center', at: 'center', of: window },
406
+ open: function (event, ui) {
407
+ jQuery('.ui-dialog').css({'z-index': 999999, 'max-width': '90%'});
408
+ jQuery('.ui-widget-overlay').css({'z-index': 999998, 'opacity': 0.8, 'background': '#000000'});
409
+ jQuery('.ui-dialog-buttonpane button:contains("Update")').button('disable');
410
+ jQuery.post(
411
+ jQuery('#wp_insert_admin_ajax').val(), {
412
+ 'action': 'wp_insert_inthemeads_existing_form_get_content',
413
+ 'wp_insert_inthemeads_identifier': identifier,
414
+ 'wp_insert_nonce': jQuery('#wp_insert_nonce').val()
415
+ }, function(response) {
416
+ jQuery('.wp_insert_ajaxloader').hide();
417
+ jQuery('.ui-dialog-content').html(response);
418
+ jQuery('.ui-accordion .ui-accordion-content').css('max-height', (jQuery("body").height() * 0.45));
419
+ jQuery('.ui-dialog-buttonpane button:contains("Update")').button('enable');
420
+ jQuery('.wp_insert_inthemeads_status').parent().css({'display': 'inline-block', 'margin': '5px 0 0'}).prependTo('.ui-dialog-buttonpane');
421
+ jQuery('.ui-dialog').css({'position': 'fixed'});
422
+ jQuery('#wp_insert_inthemeads_'+identifier+'_dialog').delay(500).dialog({position: { my: 'center', at: 'center', of: window }});
423
+ }
424
+ );
425
+ },
426
+ buttons: {
427
+ 'Update': function() {
428
+ jQuery("#wp_insert_inthemeads_"+identifier).html("In-Theme Ad : "+jQuery("#wp_insert_inthemeads_"+identifier+"_title").val());
429
+ jQuery("#wp_insert_inthemeads_"+identifier).attr("onClick", "wp_insert_inthemeads_click_handler(\'"+identifier+"\', \'"+jQuery("#wp_insert_inthemeads_"+identifier+"_title").val()+"\')");
430
+ wp_insert_inthemeads_update(identifier);
431
+ jQuery(this).dialog('close');
432
+ },
433
+ Cancel: function() {
434
+ jQuery(this).dialog('close');
435
+ }
436
+ },
437
+ close: function() {
438
+ jQuery(this).dialog('destroy');
439
+ }
440
+ });
441
+ }
442
+
443
+ function wp_insert_inthemeads_update(identifier) {
444
+ args = {};
445
+ args['action'] = 'wp_insert_inthemeads_existing_form_save_action';
446
+ args['wp_insert_nonce'] = jQuery('#wp_insert_nonce').val();
447
+ args['wp_insert_inthemeads_identifier'] = identifier;
448
+ args['wp_insert_inthemeads_'+identifier+'_status'] = jQuery('#wp_insert_inthemeads_'+identifier+'_status').prop('checked');
449
+
450
+ args['wp_insert_inthemeads_'+identifier+'_title'] = jQuery('#wp_insert_inthemeads_'+identifier+'_title').val();
451
+
452
+ args['wp_insert_inthemeads_'+identifier+'_primary_ad_code'] = jQuery('#wp_insert_inthemeads_'+identifier+'_primary_ad_code').val();
453
+ args['wp_insert_inthemeads_'+identifier+'_secondary_ad_code'] = jQuery('#wp_insert_inthemeads_'+identifier+'_secondary_ad_code').val();
454
+ args['wp_insert_inthemeads_'+identifier+'_tertiary_ad_code'] = jQuery('#wp_insert_inthemeads_'+identifier+'_tertiary_ad_code').val();
455
+
456
+ args['wp_insert_inthemeads_'+identifier+'_rules_exclude_loggedin'] = jQuery('#wp_insert_inthemeads_'+identifier+'_rules_exclude_loggedin').prop('checked');
457
+ args['wp_insert_inthemeads_'+identifier+'_rules_exclude_mobile_devices'] = jQuery('#wp_insert_inthemeads_'+identifier+'_rules_exclude_mobile_devices').prop('checked');
458
+ args['wp_insert_inthemeads_'+identifier+'_rules_exclude_home'] = jQuery('#wp_insert_inthemeads_'+identifier+'_rules_exclude_home').prop('checked');
459
+ args['wp_insert_inthemeads_'+identifier+'_rules_exclude_archives'] = jQuery('#wp_insert_inthemeads_'+identifier+'_rules_exclude_archives').prop('checked');
460
+ args['wp_insert_inthemeads_'+identifier+'_rules_exclude_search'] = jQuery('#wp_insert_inthemeads_'+identifier+'_rules_exclude_search').prop('checked');
461
+ args['wp_insert_inthemeads_'+identifier+'_rules_exclude_page'] = jQuery('#wp_insert_inthemeads_'+identifier+'_rules_exclude_page').prop('checked');
462
+ args['wp_insert_inthemeads_'+identifier+'_rules_page_exceptions'] = jQuery.map(jQuery('#wp_insert_inthemeads_'+identifier+'_rules_page_exceptions :selected'), function(e) { return jQuery(e).val(); });
463
+ args['wp_insert_inthemeads_'+identifier+'_rules_exclude_post'] = jQuery('#wp_insert_inthemeads_'+identifier+'_rules_exclude_post').prop('checked');
464
+ args['wp_insert_inthemeads_'+identifier+'_rules_post_exceptions'] = jQuery.map(jQuery('#wp_insert_inthemeads_'+identifier+'_rules_post_exceptions :selected'), function(e) { return jQuery(e).val(); });
465
+ args['wp_insert_inthemeads_'+identifier+'_rules_post_categories_exceptions'] = jQuery.map(jQuery('#wp_insert_inthemeads_'+identifier+'_rules_post_categories_exceptions :selected'), function(e) { return jQuery(e).val(); });
466
+ args['wp_insert_inthemeads_'+identifier+'_rules_exclude_categories'] = jQuery('#wp_insert_inthemeads_'+identifier+'_rules_exclude_categories').prop('checked');
467
+ args['wp_insert_inthemeads_'+identifier+'_rules_categories_exceptions'] = jQuery.map(jQuery('#wp_insert_inthemeads_'+identifier+'_rules_categories_exceptions :selected'), function(e) { return jQuery(e).val(); });
468
+
469
+ args['wp_insert_inthemeads_'+identifier+'_geo_group1_countries'] = jQuery.map(jQuery('#wp_insert_inthemeads_'+identifier+'_geo_group1_countries :selected'), function(e) { return jQuery(e).val(); });
470
+ args['wp_insert_inthemeads_'+identifier+'_geo_group1_adcode'] = jQuery('#wp_insert_inthemeads_'+identifier+'_geo_group1_adcode').val();
471
+ args['wp_insert_inthemeads_'+identifier+'_geo_group2_countries'] = jQuery.map(jQuery('#wp_insert_inthemeads_'+identifier+'_geo_group2_countries :selected'), function(e) { return jQuery(e).val(); });
472
+ args['wp_insert_inthemeads_'+identifier+'_geo_group2_adcode'] = jQuery('#wp_insert_inthemeads_'+identifier+'_geo_group2_adcode').val();
473
+
474
+ args['wp_insert_inthemeads_'+identifier+'_styles'] = jQuery('#wp_insert_inthemeads_'+identifier+'_styles').val();
475
+
476
+ args['wp_insert_inthemeads_'+identifier+'_notes'] = jQuery('#wp_insert_inthemeads_'+identifier+'_notes').val();
477
+
478
+ jQuery.post(
479
+ jQuery('#wp_insert_admin_ajax').val(), args, function(response) { }
480
+ );
481
+ }
482
+
483
+ function wp_insert_inthemeads_remove(identifier) {
484
+ jQuery("<p>Are you Sure you want to remove this Ad Unit?</p>").dialog({
485
+ 'modal': true,
486
+ 'resizable': false,
487
+ 'title': 'Deletion Confirmation',
488
+ position: { my: 'center', at: 'center', of: window },
489
+ open: function (event, ui) {
490
+ jQuery('.ui-dialog').css({'z-index': 999999, 'max-width': '90%'});
491
+ jQuery('.ui-widget-overlay').css({'z-index': 999998, 'opacity': 0.8, 'background': '#000000'});
492
+ },
493
+ buttons : {
494
+ 'Confirm': function() {
495
+ jQuery("#wp_insert_inthemeads_"+identifier).parent().remove();
496
+ jQuery.post(
497
+ jQuery('#wp_insert_admin_ajax').val(), {
498
+ 'action': 'wp_insert_inthemeads_remove',
499
+ 'wp_insert_inthemeads_identifier': identifier,
500
+ 'wp_insert_nonce': jQuery('#wp_insert_nonce').val()
501
+ }, function(response) {
502
+ }
503
+ );
504
+ jQuery(this).dialog("close");
505
+ },
506
+ 'Cancel': function() {
507
+ jQuery(this).dialog("close");
508
+ }
509
+ },
510
+ close: function() {
511
+ jQuery(this).dialog('destroy');
512
+ }
513
+ });
514
+ }
515
+
516
+ function wp_insert_legalpages_generate_page(target, title) {
517
+ jQuery('.ui-dialog-buttonpane button:contains("Update")').button('disable');
518
+ jQuery('#'+target+'_generate_page').hide();
519
+ jQuery('#'+target+'_accordion .wp_insert_ajaxloader_flat').show();
520
+ jQuery.post(
521
+ jQuery('#wp_insert_admin_ajax').val(), {
522
+ 'action': target+'_form_generate_page_action',
523
+ 'wp_insert_nonce': jQuery('#wp_insert_nonce').val(),
524
+ }, function(response) {
525
+ if(response != '0') {
526
+ jQuery('#'+target+'_assigned_page').append(jQuery('<option>', {value: response, text: title})).val(response);
527
+ }
528
+ jQuery('#'+target+'_generate_page').show();
529
+ jQuery('#'+target+'_accordion .wp_insert_ajaxloader_flat').hide();
530
+ jQuery('.ui-dialog-buttonpane button:contains("Update")').button('enable');
531
+ }
532
+ );
533
+ }
534
+
535
+ function wp_insert_click_handler(target, title, width, height, openAction, UpdateAction, closeAction) {
536
+ jQuery('#'+target).click(function() {
537
+ jQuery('<div id="'+target+'_dialog"></div>').html('<div class="wp_insert_ajaxloader"></div>').dialog({
538
+ 'modal': true,
539
+ 'resizable': false,
540
+ 'width': width,
541
+ 'maxWidth': width,
542
+ 'maxHeight': height,
543
+ 'title': title,
544
+ position: { my: 'center', at: 'center', of: window },
545
+ open: function (event, ui) {
546
+ jQuery('.ui-dialog').css({'z-index': 999999, 'max-width': '90%'});
547
+ jQuery('.ui-widget-overlay').css({'z-index': 999998, 'opacity': 0.8, 'background': '#000000'});
548
+ jQuery('.ui-dialog-buttonpane button:contains("Update")').button('disable');
549
+
550
+ jQuery.post(
551
+ jQuery('#wp_insert_admin_ajax').val(), {
552
+ 'action': target+'_form_get_content',
553
+ 'wp_insert_nonce': jQuery('#wp_insert_nonce').val()
554
+ }, function(response) {
555
+ jQuery('.wp_insert_ajaxloader').hide();
556
+ jQuery('.ui-dialog-content').html(response);
557
+ jQuery('.ui-accordion .ui-accordion-content').css('max-height', (jQuery("body").height() * 0.45));
558
+ jQuery('.ui-dialog-buttonpane button:contains("Update")').button('enable');
559
+ openAction();
560
+ jQuery('.ui-dialog').css({'position': 'fixed'});
561
+ jQuery('#'+target+'_dialog').delay(500).dialog({position: { my: 'center', at: 'center', of: window }});
562
+
563
+ }
564
+ );
565
+ },
566
+ buttons: {
567
+ 'Update': function() {
568
+ UpdateAction();
569
+ jQuery(this).dialog('close');
570
+ },
571
+ Cancel: function() {
572
+ jQuery(this).dialog('close');
573
+ }
574
+ },
575
+ close: function() {
576
+ closeAction();
577
+ jQuery(this).dialog('destroy');
578
+ }
579
+ })
580
+ });
581
+ }
582
+
includes/common/abtesting.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* Begin AB Testing Content */
3
+ add_action('wp_ajax_wp_insert_abtesting_configuration_form_get_content', 'wp_insert_abtesting_configuration_form_get_content');
4
+ function wp_insert_abtesting_configuration_form_get_content() {
5
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
6
+
7
+ $abtestingMode = get_option('wp_insert_abtesting_mode');
8
+ $abtestingModes = array(
9
+ array('value' => '1', 'text' => 'Primary Ad Network'),
10
+ array('value' => '2', 'text' => 'Primary and Secondary Ad Networks'),
11
+ array('value' => '3', 'text' => 'All Ad Networks'),
12
+ );
13
+ echo '<div class="wp_insert_popup_content_wrapper">';
14
+ $control = new smartlogixControls(array('type' => 'radio-group', 'id' => 'wp_insert_abtesting_mode', 'name' => 'wp_insert_abtesting_mode', 'label' => 'Select the Ad Network Setup that best suits you', 'value' => $abtestingMode, 'options' => $abtestingModes));
15
+ $control->add_control();
16
+ echo $control->HTML;
17
+ echo '<p>';
18
+ echo '<b>Recommended Ad Networks</b><br />';
19
+ echo '<a href="http://google.com/adsense" target="_blank"><img src="'.WP_INSERT_URL.'/includes/assets/images/adsense.gif" /></a>';
20
+ echo '<a href="http://www.chitika.com/publishers/apply?refid=smartlogix" style="margin-left: 10px;" target="_blank"><img src="'.WP_INSERT_URL.'/includes/assets/images/chitika.png" /></a>';
21
+ echo '</p>';
22
+ echo '</div>';
23
+ die();
24
+ }
25
+
26
+ add_action('wp_ajax_wp_insert_abtesting_configuration_form_save_action', 'wp_insert_abtesting_configuration_form_save_action');
27
+ function wp_insert_abtesting_configuration_form_save_action() {
28
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
29
+
30
+ if(isset($_POST['wp_insert_abtesting_mode'])) {
31
+ update_option('wp_insert_abtesting_mode', $_POST['wp_insert_abtesting_mode']);
32
+ }
33
+ die();
34
+ }
35
+ /* End AB Testing Content */
36
+
37
+ /* Begin Database Upgrade */
38
+ add_action('wp_insert_upgrade_database', 'wp_insert_upgrade_database');
39
+ function wp_insert_upgrade_database() {
40
+ if(!get_option('wp_insert_abtesting_mode')) {
41
+ $oldValues = get_option('wp_insert_multiple_network_status');
42
+ update_option('wp_insert_abtesting_mode', ((isset($oldValues))?$oldValues:'1'));
43
+ }
44
+ }
45
+ /* End Database Upgrade */
46
+ ?>
includes/common/activate-upgrade.php DELETED
@@ -1,19 +0,0 @@
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 DELETED
@@ -1,37 +0,0 @@
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" id="wp_insert_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
- <?php do_settings_sections('wp-insert-support'); ?>
10
- </div>
11
- <div id="post-body" class="has-sidebar">
12
- <div id="post-body-content" class="has-sidebar-content">
13
- <?php do_settings_sections($sectionName); ?>
14
- </div>
15
- </div>
16
- <br class="clear"/>
17
- </div>
18
- <?php
19
- wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
20
- wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
21
- ?>
22
- <script type="text/javascript">
23
- jQuery(document).ready( function($) {
24
- jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
25
- postboxes.add_postbox_toggles('<?php echo $sectionName; ?>');
26
- });
27
-
28
- function wpInsertChitikaPopUpHandler(sender) {
29
- jQuery.colorbox({overlayClose: false, scrolling: false, transition: "elastic", innerWidth: "577px", innerHeight: "402px", iframe: true, href: "<?php echo WP_INSERT_URL; ?>/includes/common/popups/chitika.php?target="+sender});
30
- return false;
31
- }
32
- </script>
33
- </form>
34
- </div>
35
- <?php
36
- }
37
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/common/common.php CHANGED
@@ -1,13 +1,25 @@
1
- <?php
2
- require_once(dirname(__FILE__).'/sanitize.php');
3
- require_once(dirname(__FILE__).'/activate-upgrade.php');
4
- require_once(dirname(__FILE__).'/status.php');
5
- require_once(dirname(__FILE__).'/countries.php');
6
- require_once(dirname(__FILE__).'/menu.php');
7
- require_once(dirname(__FILE__).'/styles.php');
8
- require_once(dirname(__FILE__).'/support.php');
9
- require_once(dirname(__FILE__).'/admin-page.php');
10
- require_once(dirname(__FILE__).'/controls.php');
11
- require_once(dirname(__FILE__).'/jquery.php');
12
- require_once(dirname(__FILE__).'/http-post.php');
 
 
 
 
 
 
 
 
 
 
 
 
13
  ?>
1
+ <?php
2
+ /* Begin Version Upgrade */
3
+ add_action('init', 'wp_insert_upgrade_version', 0);
4
+ function wp_insert_upgrade_version() {
5
+ $databaseVersion = get_option('wp_insert_version');
6
+ if($databaseVersion != WP_INSERT_VERSION) {
7
+ do_action('wp_insert_upgrade_database');
8
+ update_option('wp_insert_version', WP_INSERT_VERSION);
9
+ }
10
+ }
11
+ /* End Version Upgrade */
12
+
13
+ /* Begin Misc Functions */
14
+ function wp_insert_add_ordinal_number_suffix($num) {
15
+ if (!in_array(($num % 100),array(11,12,13))){
16
+ switch ($num % 10) {
17
+ case 1: return $num.'st';
18
+ case 2: return $num.'nd';
19
+ case 3: return $num.'rd';
20
+ }
21
+ }
22
+ return $num.'th';
23
+ }
24
+ /* End Misc Functions */
25
  ?>
includes/common/control-panel.php ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ add_action('admin_menu', 'wp_insert_admin_menu');
3
+ function wp_insert_admin_menu() {
4
+ add_menu_page('Wp Insert', 'Wp Insert', 'manage_options', 'wp-insert', 'wp_insert_admin_page', WP_INSERT_URL.'/includes/assets/images/icon.png');
5
+ }
6
+
7
+ add_action('admin_enqueue_scripts', 'wp_insert_admin_enqueue_scripts');
8
+ function wp_insert_admin_enqueue_scripts($page) {
9
+ if($page == 'toplevel_page_wp-insert') {
10
+ wp_register_style('wp-insert-css', WP_INSERT_URL.'includes/assets/css/wp-insert.css', array(), WP_INSERT_VERSION);
11
+ wp_enqueue_style('wp-insert-css');
12
+ wp_register_style('wp-insert-jquery-ui', 'https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css', array(), WP_INSERT_VERSION);
13
+ wp_enqueue_style('wp-insert-jquery-ui');
14
+ wp_register_script('wp-insert-js', WP_INSERT_URL.'includes/assets/js/wp-insert.js', array('jquery', 'jquery-ui-core', 'jquery-ui-accordion', 'jquery-ui-dialog'), WP_INSERT_VERSION);
15
+ wp_enqueue_script('wp-insert-js');
16
+ smartlogixControls::enqueue_assets(WP_INSERT_URL.'includes/controls', WP_INSERT_VERSION);
17
+ wp_enqueue_script('editor');
18
+ wp_enqueue_script('quicktags');
19
+ wp_enqueue_style('buttons');
20
+ }
21
+ }
22
+
23
+ function wp_insert_admin_page() { ?>
24
+ <div class="wrap wp-insert">
25
+ <a href="http://www.wp-insert.smartlogix.co.in"><img src="<?php echo WP_INSERT_URL; ?>/includes/assets/images/header-banner.png" /></a>
26
+ <div class="wp-list-table widefat plugin-install">
27
+ <div class="plugin-card">
28
+ <div class="plugin-card-top">
29
+ <h4>In-Post Ads</h4>
30
+ <p>Ads shown within the post content.</p>
31
+ </div>
32
+ <div class="plugin-card-bottom">
33
+ <p><a id="wp_insert_inpostads_above" href="javascript:;">Ad - Above Post Content</a></p>
34
+ <p><a id="wp_insert_inpostads_middle" href="javascript:;">Ad - Middle of Post Content</a></p>
35
+ <p><a id="wp_insert_inpostads_below" href="javascript:;">Ad - Below Post Content</a></p>
36
+ <p><a id="wp_insert_inpostads_left" href="javascript:;">Ad - Left of Post Content</a></p>
37
+ <p><a id="wp_insert_inpostads_right" href="javascript:;">Ad - Right of Post Content</a></p>
38
+ </div>
39
+ </div>
40
+
41
+ <div class="plugin-card">
42
+ <div class="plugin-card-top">
43
+ <h4>Ad Widgets</h4>
44
+ <p>Ads shown inside widget enabled areas.</p>
45
+ </div>
46
+ <div class="plugin-card-bottom">
47
+ <?php
48
+ $adwidgets = get_option('wp_insert_adwidgets');
49
+ if(isset($adwidgets) && is_array($adwidgets)) {
50
+ foreach($adwidgets as $key => $value) {
51
+ echo '<p>';
52
+ echo '<a id="wp_insert_adwidgets_'.$key.'" href="javascript:;" onclick="wp_insert_adwidgets_click_handler(\''.$key.'\', \''.$value['title'].'\')">Ad Widget : '.$value['title'].'</a>';
53
+ echo '<span class="dashicons dashicons-dismiss wp_insert_delete_icon" onclick="wp_insert_adwidgets_remove(\''.$key.'\')"></span>';
54
+ echo '</p>';
55
+ }
56
+ }
57
+ ?>
58
+ <p style="text-align: center; padding: 20px 0 10px;"><a id="wp_insert_adwidgets_new" href="#" class="button-secondary">Add New Ad Widget</a></p>
59
+ </div>
60
+ </div>
61
+
62
+ <div class="plugin-card">
63
+ <div class="plugin-card-top">
64
+ <h4>In-Theme Ads</h4>
65
+ <p>Ads embedded directly inside theme files (Advanced Users Only).</p>
66
+ </div>
67
+ <div class="plugin-card-bottom">
68
+ <?php
69
+ $inthemeads = get_option('wp_insert_inthemeads');
70
+ if(isset($inthemeads) && is_array($inthemeads)) {
71
+ foreach($inthemeads as $key => $value) {
72
+ echo '<p>';
73
+ echo '<a id="wp_insert_inthemeads_'.$key.'" href="javascript:;" onclick="wp_insert_inthemeads_click_handler(\''.$key.'\', \''.$value['title'].'\')">In-Theme Ad : '.$value['title'].'</a>';
74
+ echo '<span class="dashicons dashicons-dismiss wp_insert_delete_icon" onclick="wp_insert_inthemeads_remove(\''.$key.'\')"></span>';
75
+ echo '</p>';
76
+ }
77
+ }
78
+ ?>
79
+ <p style="text-align: center; padding: 20px 0 10px;"><a id="wp_insert_inthemeads_new" href="#" class="button-secondary">Add New In-Theme Ad</a></p>
80
+ </div>
81
+ </div>
82
+
83
+ <div class="plugin-card">
84
+ <div class="plugin-card-top">
85
+ <h4>Multiple Ad Networks / A-B Testing</h4>
86
+ <p>Multiple Ad Networks can be setup to display ads from different networks without infringing the terms of any network.
87
+ At a time only ads from one network (Randomly Choosen) will be shown.
88
+ This feature can also be used to randomly display different sized Ads from the same network.
89
+ Please note that this option is global and applied to In-Post Ads, Ad Widgets and In-Theme Ads.</p>
90
+ </div>
91
+ <div class="plugin-card-bottom">
92
+ <p><a id="wp_insert_abtesting_configuration" href="javascript:;">Configuration</a></p>
93
+ </div>
94
+ </div>
95
+
96
+ <div class="plugin-card">
97
+ <div class="plugin-card-top">
98
+ <h4>Tracking Codes</h4>
99
+ <p>Google Analytics and other embeddable codes directly inserted into the site.</p>
100
+ </div>
101
+ <div class="plugin-card-bottom">
102
+ <p><a id="wp_insert_trackingcodes_google_analytics" href="javascript:;">Google Analytics</a></p>
103
+ <p><a id="wp_insert_trackingcodes_header" href="javascript:;">Embed Code in Header</a></p>
104
+ <p><a id="wp_insert_trackingcodes_footer" href="javascript:;">Embed Code in Footer</a></p>
105
+ </div>
106
+ </div>
107
+
108
+ <div class="plugin-card">
109
+ <div class="plugin-card-top">
110
+ <h4>Legal Pages</h4>
111
+ <p>Legal Page Templates to kick start your Legal Notices.</p>
112
+ </div>
113
+ <div class="plugin-card-bottom">
114
+ <p><a id="wp_insert_legalpages_privacy_policy" href="javascript:;">Privacy Policy</a></p>
115
+ <p><a id="wp_insert_legalpages_terms_conditions" href="javascript:;">Terms and Conditions</a></p>
116
+ <p><a id="wp_insert_legalpages_disclaimer" href="javascript:;">Disclaimer</a></p>
117
+ <p><a id="wp_insert_legalpages_copyright" href="javascript:;">Copyright Notice</a></p>
118
+ <!--<p><a href="#">EU Cookie Compliance</a></p>-->
119
+ </div>
120
+ </div>
121
+
122
+ <input type="hidden" id="wp_insert_admin_ajax" name="wp_insert_admin_ajax" value="<?php echo admin_url('admin-ajax.php'); ?>" />
123
+ <input type="hidden" id="wp_insert_nonce" name="wp_insert_nonce" value="<?php echo wp_create_nonce('wp-insert'); ?>" />
124
+ </div>
125
+ </div>
126
+ <?php
127
+ }
128
+ ?>
includes/common/controls.php DELETED
@@ -1,154 +0,0 @@
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
- $args = wp_insert_sanitize_array($args, array('id', 'class', 'style', 'rows'));
118
- $output = '<table'.(($args['id'] != '')?' id="'.$args['id'].'"':'').(($args['class'] != '')?' class="'.$args['class'].'"':'').(($args['style'] != '')?' style="'.$args['style'].'"':'').'>';
119
- if(isset($args['rows']) && is_array($args['rows'])) {
120
- foreach($args['rows'] as $row) {
121
- $row = wp_insert_sanitize_array($row, array('id', 'class', 'style', 'cells'));
122
- $output .= '<tr'.(($row['id'] != '')?' id="'.$row['id'].'"':'').(($row['class'] != '')?' class="'.$row['class'].'"':'').(($row['style'] != '')?' style="'.$row['style'].'"':'').'>';
123
- if(isset($row['cells']) && is_array($row['cells'])) {
124
- foreach($row['cells'] as $cell) {
125
- $cell = wp_insert_sanitize_array($cell, array('type', 'colspan', 'id', 'class', 'style', 'content'));
126
- if($cell['type'] == '') { $cell['type'] = 'td'; }
127
- $output .= '<'.$cell['type'].(($cell['colspan'] != '')?' colspan="'.$cell['colspan'].'"':'').(($cell['id'] != '')?' id="'.$cell['id'].'"':'').(($cell['class'] != '')?' class="'.$cell['class'].'"':'').(($cell['style'] != '')?' style="'.$cell['style'].'"':'').'>';
128
- $output .= $cell['content'];
129
- $output .= '</'.$cell['type'].'>';
130
- }
131
- }
132
- $output .= '</tr>';
133
- }
134
- }
135
- $output .= '</table>';
136
- return $output;
137
- }
138
-
139
- function wp_insert_get_script_tag($content) {
140
- $script = '';
141
- if(is_array($content)) {
142
- foreach($content as $control) {
143
- $script .= $control['javascript'];
144
- }
145
- } else {
146
- $script = $content;
147
- }
148
-
149
- $output = '<script type="text/javascript">';
150
- $output .= 'jQuery(document).ready(function(){'.$script.'});';
151
- $output .= '</script>';
152
- return $output;
153
- }
154
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/common/css/style.css DELETED
@@ -1,167 +0,0 @@
1
-
2
- /*ColorBox*/
3
- #colorbox, #cboxOverlay, #cboxWrapper{ position:absolute; top:0; left:0; z-index:9999; overflow:hidden; }
4
- #cboxOverlay{ position:fixed; width:100%; height:100%; }
5
- #cboxMiddleLeft, #cboxBottomLeft{ clear:left; }
6
- #cboxContent{ position:relative; }
7
- #cboxLoadedContent{ overflow:auto; }
8
- #cboxTitle{ margin:0; }
9
- #cboxLoadingOverlay, #cboxLoadingGraphic{ position:absolute; top:0; left:0; width:100%; height:100%; }
10
- #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{ cursor:pointer; }
11
- .cboxPhoto{ float:left; margin:auto; border:0; display:block; max-width:none; }
12
- .cboxIframe{ width:100%; height:100%; display:block; border:0; }
13
- #colorbox, #cboxContent, #cboxLoadedContent{ box-sizing:content-box; }
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
- .cboxIE #cboxTopLeft, .cboxIE #cboxTopCenter, .cboxIE #cboxTopRight, .cboxIE #cboxBottomLeft, .cboxIE #cboxBottomCenter, .cboxIE #cboxBottomRight, .cboxIE #cboxMiddleLeft, .cboxIE #cboxMiddleRight{ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF, endColorstr=#00FFFFFF); }
38
-
39
- /*Jquery Better Checkboxes*/
40
- .tzCheckBox{ background:url('../images/better_checkbox.png') no-repeat right bottom; display:inline-block; min-width:60px; height:33px; white-space:nowrap; position:relative; cursor:pointer; margin-left:14px; }
41
- .tzCheckBox.checked{ background-position:top left; margin:0 14px 0 0; }
42
- .tzCheckBox .tzCBContent{ color:white; line-height:31px; padding-right:38px; text-align:right; }
43
- .tzCheckBox.checked .tzCBContent{ text-align:left; padding:0 0 0 38px; }
44
- .tzCBPart{ background:url('../images/better_checkbox.png') no-repeat left bottom; width:14px; position:absolute; top:0; left:-14px; height:33px; overflow:hidden; }
45
- .tzCheckBox.checked .tzCBPart{ background-position:top right; left:auto; right:-14px; }
46
-
47
- /*Jquery Vetical Tabs*/
48
- .vtabs{ border:1px solid #FFFFFF; margin:10px 0 0; position:relative; }
49
- .vtabs .vtabs-tab-column{ position:absolute; left:0; margin:0; width:120px; min-width:120px; }
50
- .vtabs .vtabs-tab-column ul{ list-style:none; margin:0px; padding:0px; }
51
- .vtabs .vtabs-tab-column ul li.open, .vtabs .vtabs-tab-column ul li.closed{ background-color:#ffffff; margin:0 0 3px; min-height:20px; padding:4px 5px 1px 7px; z-index:10;
52
- /* round corners do not work in IE */
53
- -moz-border-radius-topleft:3px; -moz-border-radius-bottomleft:3px; -webkit-border-top-left-radius:3px; -webkit-border-bottom-left-radius:3px; border-top:1px solid #999999; border-bottom:1px solid #999999; border-left:1px solid #999999; }
54
- .vtabs .vtabs-tab-column ul li.closed{ background-color:#bbbbbb; border-right:1px solid #777777; background-image:url('../images/ClosedTabBackground.png'); background-repeat:repeat-x; }
55
- .vtabs .vtabs-tab-column ul li:hover{ cursor:pointer; }
56
- .vtabs .vtabs-tab-column ul li a.open, .vtabs .vtabs-tab-column ul li a.closed{ font-weight:bold; margin:0px; padding:0px; text-decoration:none; }
57
- .vtabs .vtabs-content-column{ padding:0px; margin:0px; }
58
- .vtabs .vtabs-content-column .vtabs-content-panel{ background-color:#ffffff; padding-left:7px; padding-right:7px; padding-top:3px; padding-bottom:3px; margin:0px; -moz-border-radius-topright:3px; -moz-border-radius-bottomright:3px; -moz-border-radius-bottomleft:3px; -webkit-border-top-right-radius:3px; -webkit-border-bottom-right-radius:3px; -webkit-border-bottom-left-radius:3px; border-top:1px solid #999999; border-bottom:1px solid #999999; border-right:1px solid #999999; border-left:1px solid #999999; }
59
- .vtabs-content-panel textarea, .wp-insert textarea{ width:100%; height:250px; }
60
- .vtabs-content-panel p{ margin:5px 0 15px !important; }
61
-
62
- /*IOS CheckBox*/
63
- div.iPhoneCheckContainer{ width:129px; }
64
- .iPhoneCheckContainer{ position:relative; height:27px; cursor:pointer; overflow:hidden; }
65
- .iPhoneCheckContainer input{ position:absolute; top:5px; left:30px; filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0); opacity:0; }
66
- .iPhoneCheckContainer label{ white-space:nowrap; font-size:10px; line-height:17px; font-weight:bold; font-family:"Helvetica Neue", Arial, Helvetica, sans-serif; cursor:pointer; display:block; height:27px; position:absolute; width:auto; top:0; padding-top:5px; overflow:hidden; }
67
- .iPhoneCheckContainer, .iPhoneCheckContainer label{ user-select:none; -moz-user-select:none; -khtml-user-select:none; }
68
- .iPhoneCheckDisabled{ filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=50); opacity:0.5; }
69
- label.iPhoneCheckLabelOn{ color:white; background:url('../images/iphone_on.png') no-repeat; text-shadow:0px 0px 2px rgba(0, 0, 0, 0.6); left:0; padding-top:5px; +}
70
- label.iPhoneCheckLabelOn span{ padding-left:8px; }
71
- label.iPhoneCheckLabelOff{ color:#8b8b8b; background:url('../images/iphone_off.png') no-repeat right 0; text-shadow:0px 0px 2px rgba(255, 255, 255, 0.6); text-align:right; right:0; }
72
- label.iPhoneCheckLabelOff span{ padding-right:8px; }
73
- .iPhoneCheckHandle{ display:block; height:27px; cursor:pointer; position:absolute; top:0; left:0; width:0; background:url('../images/iphone_slider_left.png') no-repeat; padding-left:3px; }
74
- .iPhoneCheckHandleRight{ height:100%; width:100%; padding-right:3px; background:url('../images/iphone_slider_right.png') no-repeat right 0; }
75
- .iPhoneCheckHandleCenter{ height:100%; width:100%; background:url('../images/iphone_slider_center.png'); }
76
- .iOSCheckContainer{ position:relative; height:27px; cursor:pointer; overflow:hidden; }
77
- .iOSCheckContainer input{ position:absolute; top:5px; left:30px; filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0); opacity:0; }
78
- .iOSCheckContainer label{ white-space:nowrap; font-size:17px; line-height:17px; font-weight:bold; font-family:"Helvetica Neue", Arial, Helvetica, sans-serif; cursor:pointer; display:block; height:27px; position:absolute; width:auto; top:0; padding-top:5px; overflow:hidden; }
79
- .iOSCheckContainer, .iOSCheckContainer label{ user-select:none; -moz-user-select:none; -khtml-user-select:none; }
80
- .iOSCheckDisabled{ filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=50); opacity:0.5; }
81
- label.iOSCheckLabelOn{ color:white; background:url('../images/iphone_on.png') no-repeat; text-shadow:0px 0px 2px rgba(0, 0, 0, 0.6); left:0; padding-top:5px; }
82
- label.iOSCheckLabelOn span{ padding-left:8px; }
83
- label.iOSCheckLabelOff{ color:#8b8b8b; background:url('../images/iphone_off.png') no-repeat right 0; text-shadow:0px 0px 2px rgba(255, 255, 255, 0.6); text-align:right; right:0; }
84
- label.iOSCheckLabelOff span{ padding-right:8px; }
85
- .iOSCheckHandle{ display:block; height:27px; cursor:pointer; position:absolute; top:0; left:0; width:0; background:url('../images/iphone_slider_left.png') no-repeat; padding-left:3px; }
86
- .iOSCheckHandleRight{ height:100%; width:100%; padding-right:3px; background:url('../images/iphone_slider_right.png') no-repeat right 0; }
87
- .iOSCheckHandleCenter{ height:100%; width:100%; background:url('../images/iphone_slider_center.png'); }
88
-
89
- /* Multiselect*/
90
- .multiselect{ height:360px; width:560px; }
91
- .ui-multiselect{ border:solid 1px; font-size:0.8em; margin-bottom:10px; }
92
- .ui-multiselect ul{ -moz-user-select:none; }
93
- .ui-multiselect li{ margin:0; padding:0; cursor:default; line-height:20px; height:20px; font-size:11px; list-style:none; }
94
- .ui-multiselect li a{ color:#999; text-decoration:none; padding:0; display:block; float:left; cursor:pointer; }
95
- .ui-multiselect li.ui-draggable-dragging{ padding-left:10px; }
96
- .ui-multiselect div.selected{ position:relative; padding:0; margin:0; border:0; float:left; }
97
- .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%; }
98
- .ui-multiselect ul.selected li{ }
99
- .ui-multiselect div.available{ position:relative; padding:0; margin:0; border:0; float:left; border-left:1px solid; }
100
- .ui-multiselect ul.available{ position:relative; padding:0; overflow:auto; overflow-x:hidden; background:#fff; margin:0; list-style:none; border:0; width:100%; }
101
- .ui-multiselect ul.available li{ padding-left:10px; }
102
- .ui-multiselect .ui-state-default{ border:none; margin-bottom:1px; position:relative; padding-left:20px; }
103
- .ui-multiselect .ui-state-hover{ border:none; }
104
- .ui-multiselect .ui-widget-header{ border:none; font-size:11px; margin-bottom:1px; }
105
- .ui-multiselect .add-all{ float:right; padding:7px; }
106
- .ui-multiselect .remove-all{ float:right; padding:7px; }
107
- .ui-multiselect .search{ float:left; padding:4px; }
108
- .ui-multiselect .count{ float:left; padding:7px; }
109
- .ui-multiselect li span.ui-icon-arrowthick-2-n-s{ position:absolute; left:2px; }
110
- .ui-multiselect li a.action{ position:absolute; right:2px; top:2px; }
111
- .ui-multiselect input.search{ height:14px; padding:1px; opacity:0.5; margin:4px; width:100px; }
112
-
113
- /*Mini Colors*/
114
- .minicolors{ position:relative; display: block; z-index:1; }
115
- .minicolors-focus{ z-index:2; }
116
- .minicolors.minicolors-theme-default .minicolors-input{ margin:0px; margin-right:3px; border:solid 1px #CCC; font:14px sans-serif; width:65px; height:16px; border-radius:0; box-shadow:inset 0 2px 4px rgba(0,0,0,.04); padding:2px; margin-right:-1px; }
117
- .minicolors-theme-default.minicolors .minicolors-input{ vertical-align:middle; outline:none; }
118
- .minicolors-theme-default.minicolors-swatch-left .minicolors-input{ margin-left:-1px; margin-right:auto; }
119
- .minicolors-theme-default.minicolors-focus .minicolors-input,.minicolors-theme-default.minicolors-focus .minicolors-swatch{ border-color:#999; }
120
- .minicolors-hidden{ position:absolute; left:-9999em; }
121
- .minicolors-swatch{ position:relative; width:16px; height:16px; text-align:left; background:url(../images/jquery.minicolors.png) -80px 0; border:solid 1px #CCC; vertical-align:middle; display:inline-block; }
122
- .minicolors-swatch span{ position:absolute; width:100%; height:100%; background:none; box-shadow:inset 0 9px 0 rgba(255,255,255,.1); display:inline-block; }
123
- .minicolors-panel{ position:absolute; top:2px; left:0; width:173px; height:152px; background:white; border:solid 1px #CCC; box-shadow:0 0 20px rgba(0,0,0,.2); display:none; }
124
- .minicolors-position-top .minicolors-panel{ top:-133px; }
125
- .minicolors-position-left .minicolors-panel{ left:-83px; }
126
- .minicolors-position-left.minicolors-with-opacity .minicolors-panel{ left:-104px; }
127
- .minicolors-with-opacity .minicolors-panel{ width:194px; }
128
- .minicolors .minicolors-grid{ position:absolute; top:1px; left:1px; width:150px; height:150px; background:url(../images/jquery.minicolors.png) -120px 0; cursor:crosshair; }
129
- .minicolors .minicolors-grid-inner{ position:absolute; top:0; left:0; width:150px; height:150px; background:none; }
130
- .minicolors-slider-saturation .minicolors-grid{ background-position:-420px 0; }
131
- .minicolors-slider-saturation .minicolors-grid-inner{ background:url(../images/jquery.minicolors.png) -270px 0; }
132
- .minicolors-slider-brightness .minicolors-grid{ background-position:-570px 0; }
133
- .minicolors-slider-brightness .minicolors-grid-inner{ background:black; }
134
- .minicolors-slider-wheel .minicolors-grid{ background-position:-720px 0; }
135
- .minicolors-slider,.minicolors-opacity-slider{ position:absolute; top:1px; left:152px; width:20px; height:150px; background:white url(../images/jquery.minicolors.png) 0 0; cursor:crosshair; }
136
- .minicolors-slider-saturation .minicolors-slider{ background-position:-60px 0; }
137
- .minicolors-slider-brightness .minicolors-slider{ background-position:-20px 0; }
138
- .minicolors-slider-wheel .minicolors-slider{ background-position:-20px 0; }
139
- .minicolors-opacity-slider{ left:173px; background-position:-40px 0; display:none; }
140
- .minicolors-with-opacity .minicolors-opacity-slider{ display:block; }
141
- .minicolors-grid .minicolors-picker{ position:absolute; top:70px; left:70px; width:10px; height:10px; border:solid 1px black; border-radius:10px; margin-top:-6px; margin-left:-6px; background:none; }
142
- .minicolors-grid .minicolors-picker span{ position:absolute; top:0; left:0; width:6px; height:6px; border-radius:6px; border:solid 2px white; }
143
- .minicolors-picker{ position:absolute; top:0; left:0; width:18px; height:2px; background:white; border:solid 1px black; margin-top:-2px; }
144
- .minicolors-inline .minicolors-input,.minicolors-inline .minicolors-swatch{ display:none; }
145
- .minicolors-inline .minicolors-panel{ position:relative; top:auto; left:auto; display:inline-block; }
146
- .minicolors-theme-bootstrap .minicolors-input{ padding:4px 6px; padding-left:30px; background-color:white; border:1px solid #CCC; border-radius:3px; height:19px; margin:0px; box-shadow:inset 0 1px 1px rgba(0,0,0,0.075); }
147
- .minicolors-theme-bootstrap.minicolors-focus .minicolors-input{ border-color:#6fb8f1; box-shadow:0 0 10px #6fb8f1; outline:none; }
148
- .minicolors-theme-bootstrap .minicolors-swatch{ position:absolute; left:2px; top:2px; z-index:2; }
149
- .minicolors-theme-bootstrap.minicolors-swatch-position-right .minicolors-input{ height: 22px; padding: 1px 30px 0 6px; }
150
- .minicolors-theme-bootstrap.minicolors-swatch-position-right .minicolors-swatch{ left:auto; right:2px; }
151
- .minicolors-theme-bootstrap .minicolors-panel{ top:2px; z-index:3; }
152
- .minicolors-theme-bootstrap.minicolors-position-top .minicolors-panel{ top:-133px; }
153
- .minicolors-theme-bootstrap.minicolors-position-left .minicolors-panel{ left:-63px; }
154
- .minicolors-theme-bootstrap.minicolors-position-left.minicolors-with-opacity .minicolors-panel{ left:-84px; }
155
-
156
- /*Admin Page*/
157
- .wp-insert .countryCode{ margin:5px 0 0; }
158
- .wp-insert input.submit{ border:4px solid gold; border-radius:10px 10px 10px 10px; font-size:24px; height:auto; padding:10px 0; width:100%; }
159
- .wp-insert .rules{ margin:10px 0; }
160
- .wp-insert .rules td{ font-size:10px; }
161
- .wp-insert .codeSnippet code{ display:block; font-size:16px; padding:10px; vertical-align:middle; }
162
- .wp-insert .nicEdit-main ul{ margin:10px 0; padding:10px 10px 10px 25px; }
163
- .wp-insert .nicEdit-main ul li{ list-style:disc; }
164
- .wp-insert .chitikaButton{ background:url('../images/chitika_btn.png'); border-radius:5px 5px 5px 5px; box-shadow:0 0 6px #666666; cursor:pointer; height:48px; margin-left:10px; margin-top:-60px; position:relative; width:48px; z-index:10; opacity:0; }
165
- .wp_insert_hireme { width: 230px; margin: 17px auto 5px; }
166
- .wp_insert_hireme a { display: block; background:url('../images/hireme.png') no-repeat 0 0; height: 40px; text-indent: -9999px; width: 230px; }
167
- .wp_insert_hireme a:hover { opacity: 0.8; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/common/geoip/GeoIP.dat DELETED
Binary file
includes/common/geoip/LICENSE.txt DELETED
@@ -1,39 +0,0 @@
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 DELETED
@@ -1,717 +0,0 @@
1
- <?php
2
-
3
- /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
4
- /* geoip.inc
5
- *
6
- * Copyright (C) 2007 MaxMind LLC
7
- *
8
- * This library is free software; you can redistribute it and/or
9
- * modify it under the terms of the GNU Lesser General Public
10
- * License as published by the Free Software Foundation; either
11
- * version 2.1 of the License, or (at your option) any later version.
12
- *
13
- * This library is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
- * Lesser General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU Lesser General Public
19
- * License along with this library; if not, write to the Free Software
20
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
- */
22
-
23
- define("GEOIP_COUNTRY_BEGIN", 16776960);
24
- define("GEOIP_STATE_BEGIN_REV0", 16700000);
25
- define("GEOIP_STATE_BEGIN_REV1", 16000000);
26
- define("GEOIP_STANDARD", 0);
27
- define("GEOIP_MEMORY_CACHE", 1);
28
- define("GEOIP_SHARED_MEMORY", 2);
29
- define("STRUCTURE_INFO_MAX_SIZE", 20);
30
- define("DATABASE_INFO_MAX_SIZE", 100);
31
- define("GEOIP_COUNTRY_EDITION", 106);
32
- define("GEOIP_PROXY_EDITION", 8);
33
- define("GEOIP_ASNUM_EDITION", 9);
34
- define("GEOIP_NETSPEED_EDITION", 10);
35
- define("GEOIP_REGION_EDITION_REV0", 112);
36
- define("GEOIP_REGION_EDITION_REV1", 3);
37
- define("GEOIP_CITY_EDITION_REV0", 111);
38
- define("GEOIP_CITY_EDITION_REV1", 2);
39
- define("GEOIP_ORG_EDITION", 110);
40
- define("GEOIP_ISP_EDITION", 4);
41
- define("SEGMENT_RECORD_LENGTH", 3);
42
- define("STANDARD_RECORD_LENGTH", 3);
43
- define("ORG_RECORD_LENGTH", 4);
44
- define("MAX_RECORD_LENGTH", 4);
45
- define("MAX_ORG_RECORD_LENGTH", 300);
46
- define("GEOIP_SHM_KEY", 0x4f415401);
47
- define("US_OFFSET", 1);
48
- define("CANADA_OFFSET", 677);
49
- define("WORLD_OFFSET", 1353);
50
- define("FIPS_RANGE", 360);
51
- define("GEOIP_UNKNOWN_SPEED", 0);
52
- define("GEOIP_DIALUP_SPEED", 1);
53
- define("GEOIP_CABLEDSL_SPEED", 2);
54
- define("GEOIP_CORPORATE_SPEED", 3);
55
- define("GEOIP_DOMAIN_EDITION", 11);
56
- define("GEOIP_COUNTRY_EDITION_V6", 12);
57
- define("GEOIP_LOCATIONA_EDITION", 13);
58
- define("GEOIP_ACCURACYRADIUS_EDITION", 14);
59
- define("GEOIP_CITYCOMBINED_EDITION", 15);
60
- define("GEOIP_CITY_EDITION_REV1_V6", 30);
61
- define("GEOIP_CITY_EDITION_REV0_V6",31);
62
- define("GEOIP_NETSPEED_EDITION_REV1",32);
63
- define("GEOIP_NETSPEED_EDITION_REV1_V6",33);
64
- define("GEOIP_USERTYPE_EDITION",28);
65
- define("GEOIP_USERTYPE_EDITION_V6",29);
66
- define("GEOIP_ASNUM_EDITION_V6",21);
67
- define("GEOIP_ISP_EDITION_V6",22);
68
- define("GEOIP_ORG_EDITION_V6",23);
69
- define("GEOIP_DOMAIN_EDITION_V6",24);
70
-
71
- define("CITYCOMBINED_FIXED_RECORD", 7 );
72
-
73
- class GeoIP {
74
- var $flags;
75
- var $filehandle;
76
- var $memory_buffer;
77
- var $databaseType;
78
- var $databaseSegments;
79
- var $record_length;
80
- var $shmid;
81
- var $GEOIP_COUNTRY_CODE_TO_NUMBER = array(
82
- "" => 0, "AP" => 1, "EU" => 2, "AD" => 3, "AE" => 4, "AF" => 5,
83
- "AG" => 6, "AI" => 7, "AL" => 8, "AM" => 9, "CW" => 10, "AO" => 11,
84
- "AQ" => 12, "AR" => 13, "AS" => 14, "AT" => 15, "AU" => 16, "AW" => 17,
85
- "AZ" => 18, "BA" => 19, "BB" => 20, "BD" => 21, "BE" => 22, "BF" => 23,
86
- "BG" => 24, "BH" => 25, "BI" => 26, "BJ" => 27, "BM" => 28, "BN" => 29,
87
- "BO" => 30, "BR" => 31, "BS" => 32, "BT" => 33, "BV" => 34, "BW" => 35,
88
- "BY" => 36, "BZ" => 37, "CA" => 38, "CC" => 39, "CD" => 40, "CF" => 41,
89
- "CG" => 42, "CH" => 43, "CI" => 44, "CK" => 45, "CL" => 46, "CM" => 47,
90
- "CN" => 48, "CO" => 49, "CR" => 50, "CU" => 51, "CV" => 52, "CX" => 53,
91
- "CY" => 54, "CZ" => 55, "DE" => 56, "DJ" => 57, "DK" => 58, "DM" => 59,
92
- "DO" => 60, "DZ" => 61, "EC" => 62, "EE" => 63, "EG" => 64, "EH" => 65,
93
- "ER" => 66, "ES" => 67, "ET" => 68, "FI" => 69, "FJ" => 70, "FK" => 71,
94
- "FM" => 72, "FO" => 73, "FR" => 74, "SX" => 75, "GA" => 76, "GB" => 77,
95
- "GD" => 78, "GE" => 79, "GF" => 80, "GH" => 81, "GI" => 82, "GL" => 83,
96
- "GM" => 84, "GN" => 85, "GP" => 86, "GQ" => 87, "GR" => 88, "GS" => 89,
97
- "GT" => 90, "GU" => 91, "GW" => 92, "GY" => 93, "HK" => 94, "HM" => 95,
98
- "HN" => 96, "HR" => 97, "HT" => 98, "HU" => 99, "ID" => 100, "IE" => 101,
99
- "IL" => 102, "IN" => 103, "IO" => 104, "IQ" => 105, "IR" => 106, "IS" => 107,
100
- "IT" => 108, "JM" => 109, "JO" => 110, "JP" => 111, "KE" => 112, "KG" => 113,
101
- "KH" => 114, "KI" => 115, "KM" => 116, "KN" => 117, "KP" => 118, "KR" => 119,
102
- "KW" => 120, "KY" => 121, "KZ" => 122, "LA" => 123, "LB" => 124, "LC" => 125,
103
- "LI" => 126, "LK" => 127, "LR" => 128, "LS" => 129, "LT" => 130, "LU" => 131,
104
- "LV" => 132, "LY" => 133, "MA" => 134, "MC" => 135, "MD" => 136, "MG" => 137,
105
- "MH" => 138, "MK" => 139, "ML" => 140, "MM" => 141, "MN" => 142, "MO" => 143,
106
- "MP" => 144, "MQ" => 145, "MR" => 146, "MS" => 147, "MT" => 148, "MU" => 149,
107
- "MV" => 150, "MW" => 151, "MX" => 152, "MY" => 153, "MZ" => 154, "NA" => 155,
108
- "NC" => 156, "NE" => 157, "NF" => 158, "NG" => 159, "NI" => 160, "NL" => 161,
109
- "NO" => 162, "NP" => 163, "NR" => 164, "NU" => 165, "NZ" => 166, "OM" => 167,
110
- "PA" => 168, "PE" => 169, "PF" => 170, "PG" => 171, "PH" => 172, "PK" => 173,
111
- "PL" => 174, "PM" => 175, "PN" => 176, "PR" => 177, "PS" => 178, "PT" => 179,
112
- "PW" => 180, "PY" => 181, "QA" => 182, "RE" => 183, "RO" => 184, "RU" => 185,
113
- "RW" => 186, "SA" => 187, "SB" => 188, "SC" => 189, "SD" => 190, "SE" => 191,
114
- "SG" => 192, "SH" => 193, "SI" => 194, "SJ" => 195, "SK" => 196, "SL" => 197,
115
- "SM" => 198, "SN" => 199, "SO" => 200, "SR" => 201, "ST" => 202, "SV" => 203,
116
- "SY" => 204, "SZ" => 205, "TC" => 206, "TD" => 207, "TF" => 208, "TG" => 209,
117
- "TH" => 210, "TJ" => 211, "TK" => 212, "TM" => 213, "TN" => 214, "TO" => 215,
118
- "TL" => 216, "TR" => 217, "TT" => 218, "TV" => 219, "TW" => 220, "TZ" => 221,
119
- "UA" => 222, "UG" => 223, "UM" => 224, "US" => 225, "UY" => 226, "UZ" => 227,
120
- "VA" => 228, "VC" => 229, "VE" => 230, "VG" => 231, "VI" => 232, "VN" => 233,
121
- "VU" => 234, "WF" => 235, "WS" => 236, "YE" => 237, "YT" => 238, "RS" => 239,
122
- "ZA" => 240, "ZM" => 241, "ME" => 242, "ZW" => 243, "A1" => 244, "A2" => 245,
123
- "O1" => 246, "AX" => 247, "GG" => 248, "IM" => 249, "JE" => 250, "BL" => 251,
124
- "MF" => 252, "BQ" => 253,
125
- );
126
- var $GEOIP_COUNTRY_CODES = array(
127
- "","AP","EU","AD","AE","AF","AG","AI","AL","AM","CW",
128
- "AO","AQ","AR","AS","AT","AU","AW","AZ","BA","BB",
129
- "BD","BE","BF","BG","BH","BI","BJ","BM","BN","BO",
130
- "BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD",
131
- "CF","CG","CH","CI","CK","CL","CM","CN","CO","CR",
132
- "CU","CV","CX","CY","CZ","DE","DJ","DK","DM","DO",
133
- "DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ",
134
- "FK","FM","FO","FR","SX","GA","GB","GD","GE","GF",
135
- "GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT",
136
- "GU","GW","GY","HK","HM","HN","HR","HT","HU","ID",
137
- "IE","IL","IN","IO","IQ","IR","IS","IT","JM","JO",
138
- "JP","KE","KG","KH","KI","KM","KN","KP","KR","KW",
139
- "KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT",
140
- "LU","LV","LY","MA","MC","MD","MG","MH","MK","ML",
141
- "MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV",
142
- "MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI",
143
- "NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF",
144
- "PG","PH","PK","PL","PM","PN","PR","PS","PT","PW",
145
- "PY","QA","RE","RO","RU","RW","SA","SB","SC","SD",
146
- "SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO",
147
- "SR","ST","SV","SY","SZ","TC","TD","TF","TG","TH",
148
- "TJ","TK","TM","TN","TO","TL","TR","TT","TV","TW",
149
- "TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE",
150
- "VG","VI","VN","VU","WF","WS","YE","YT","RS","ZA",
151
- "ZM","ME","ZW","A1","A2","O1","AX","GG","IM","JE",
152
- "BL","MF", "BQ");
153
- var $GEOIP_COUNTRY_CODES3 = array(
154
- "","AP","EU","AND","ARE","AFG","ATG","AIA","ALB","ARM","CUW",
155
- "AGO","ATA","ARG","ASM","AUT","AUS","ABW","AZE","BIH","BRB",
156
- "BGD","BEL","BFA","BGR","BHR","BDI","BEN","BMU","BRN","BOL",
157
- "BRA","BHS","BTN","BVT","BWA","BLR","BLZ","CAN","CCK","COD",
158
- "CAF","COG","CHE","CIV","COK","CHL","CMR","CHN","COL","CRI",
159
- "CUB","CPV","CXR","CYP","CZE","DEU","DJI","DNK","DMA","DOM",
160
- "DZA","ECU","EST","EGY","ESH","ERI","ESP","ETH","FIN","FJI",
161
- "FLK","FSM","FRO","FRA","SXM","GAB","GBR","GRD","GEO","GUF",
162
- "GHA","GIB","GRL","GMB","GIN","GLP","GNQ","GRC","SGS","GTM",
163
- "GUM","GNB","GUY","HKG","HMD","HND","HRV","HTI","HUN","IDN",
164
- "IRL","ISR","IND","IOT","IRQ","IRN","ISL","ITA","JAM","JOR",
165
- "JPN","KEN","KGZ","KHM","KIR","COM","KNA","PRK","KOR","KWT",
166
- "CYM","KAZ","LAO","LBN","LCA","LIE","LKA","LBR","LSO","LTU",
167
- "LUX","LVA","LBY","MAR","MCO","MDA","MDG","MHL","MKD","MLI",
168
- "MMR","MNG","MAC","MNP","MTQ","MRT","MSR","MLT","MUS","MDV",
169
- "MWI","MEX","MYS","MOZ","NAM","NCL","NER","NFK","NGA","NIC",
170
- "NLD","NOR","NPL","NRU","NIU","NZL","OMN","PAN","PER","PYF",
171
- "PNG","PHL","PAK","POL","SPM","PCN","PRI","PSE","PRT","PLW",
172
- "PRY","QAT","REU","ROU","RUS","RWA","SAU","SLB","SYC","SDN",
173
- "SWE","SGP","SHN","SVN","SJM","SVK","SLE","SMR","SEN","SOM",
174
- "SUR","STP","SLV","SYR","SWZ","TCA","TCD","ATF","TGO","THA",
175
- "TJK","TKL","TKM","TUN","TON","TLS","TUR","TTO","TUV","TWN",
176
- "TZA","UKR","UGA","UMI","USA","URY","UZB","VAT","VCT","VEN",
177
- "VGB","VIR","VNM","VUT","WLF","WSM","YEM","MYT","SRB","ZAF",
178
- "ZMB","MNE","ZWE","A1","A2","O1","ALA","GGY","IMN","JEY",
179
- "BLM","MAF", "BES"
180
- );
181
- var $GEOIP_COUNTRY_NAMES = array(
182
- "","Asia/Pacific Region","Europe","Andorra","United Arab Emirates","Afghanistan","Antigua and Barbuda","Anguilla","Albania","Armenia","Curacao",
183
- "Angola","Antarctica","Argentina","American Samoa","Austria","Australia","Aruba","Azerbaijan","Bosnia and Herzegovina","Barbados",
184
- "Bangladesh","Belgium","Burkina Faso","Bulgaria","Bahrain","Burundi","Benin","Bermuda","Brunei Darussalam","Bolivia",
185
- "Brazil","Bahamas","Bhutan","Bouvet Island","Botswana","Belarus","Belize","Canada","Cocos (Keeling) Islands","Congo, The Democratic Republic of the",
186
- "Central African Republic","Congo","Switzerland","Cote D'Ivoire","Cook Islands","Chile","Cameroon","China","Colombia","Costa Rica",
187
- "Cuba","Cape Verde","Christmas Island","Cyprus","Czech Republic","Germany","Djibouti","Denmark","Dominica","Dominican Republic",
188
- "Algeria","Ecuador","Estonia","Egypt","Western Sahara","Eritrea","Spain","Ethiopia","Finland","Fiji",
189
- "Falkland Islands (Malvinas)","Micronesia, Federated States of","Faroe Islands","France","Sint Maarten (Dutch part)","Gabon","United Kingdom","Grenada","Georgia","French Guiana",
190
- "Ghana","Gibraltar","Greenland","Gambia","Guinea","Guadeloupe","Equatorial Guinea","Greece","South Georgia and the South Sandwich Islands","Guatemala",
191
- "Guam","Guinea-Bissau","Guyana","Hong Kong","Heard Island and McDonald Islands","Honduras","Croatia","Haiti","Hungary","Indonesia",
192
- "Ireland","Israel","India","British Indian Ocean Territory","Iraq","Iran, Islamic Republic of","Iceland","Italy","Jamaica","Jordan",
193
- "Japan","Kenya","Kyrgyzstan","Cambodia","Kiribati","Comoros","Saint Kitts and Nevis","Korea, Democratic People's Republic of","Korea, Republic of","Kuwait",
194
- "Cayman Islands","Kazakhstan","Lao People's Democratic Republic","Lebanon","Saint Lucia","Liechtenstein","Sri Lanka","Liberia","Lesotho","Lithuania",
195
- "Luxembourg","Latvia","Libya","Morocco","Monaco","Moldova, Republic of","Madagascar","Marshall Islands","Macedonia","Mali",
196
- "Myanmar","Mongolia","Macau","Northern Mariana Islands","Martinique","Mauritania","Montserrat","Malta","Mauritius","Maldives",
197
- "Malawi","Mexico","Malaysia","Mozambique","Namibia","New Caledonia","Niger","Norfolk Island","Nigeria","Nicaragua",
198
- "Netherlands","Norway","Nepal","Nauru","Niue","New Zealand","Oman","Panama","Peru","French Polynesia",
199
- "Papua New Guinea","Philippines","Pakistan","Poland","Saint Pierre and Miquelon","Pitcairn Islands","Puerto Rico","Palestinian Territory","Portugal","Palau",
200
- "Paraguay","Qatar","Reunion","Romania","Russian Federation","Rwanda","Saudi Arabia","Solomon Islands","Seychelles","Sudan",
201
- "Sweden","Singapore","Saint Helena","Slovenia","Svalbard and Jan Mayen","Slovakia","Sierra Leone","San Marino","Senegal","Somalia","Suriname",
202
- "Sao Tome and Principe","El Salvador","Syrian Arab Republic","Swaziland","Turks and Caicos Islands","Chad","French Southern Territories","Togo","Thailand",
203
- "Tajikistan","Tokelau","Turkmenistan","Tunisia","Tonga","Timor-Leste","Turkey","Trinidad and Tobago","Tuvalu","Taiwan",
204
- "Tanzania, United Republic of","Ukraine","Uganda","United States Minor Outlying Islands","United States","Uruguay","Uzbekistan","Holy See (Vatican City State)","Saint Vincent and the Grenadines","Venezuela",
205
- "Virgin Islands, British","Virgin Islands, U.S.","Vietnam","Vanuatu","Wallis and Futuna","Samoa","Yemen","Mayotte","Serbia","South Africa",
206
- "Zambia","Montenegro","Zimbabwe","Anonymous Proxy","Satellite Provider","Other","Aland Islands","Guernsey","Isle of Man","Jersey",
207
- "Saint Barthelemy","Saint Martin", "Bonaire, Saint Eustatius and Saba"
208
- );
209
-
210
- var $GEOIP_CONTINENT_CODES = array(
211
- "--", "AS","EU","EU","AS","AS","NA","NA","EU","AS","NA",
212
- "AF","AN","SA","OC","EU","OC","NA","AS","EU","NA",
213
- "AS","EU","AF","EU","AS","AF","AF","NA","AS","SA",
214
- "SA","NA","AS","AN","AF","EU","NA","NA","AS","AF",
215
- "AF","AF","EU","AF","OC","SA","AF","AS","SA","NA",
216
- "NA","AF","AS","AS","EU","EU","AF","EU","NA","NA",
217
- "AF","SA","EU","AF","AF","AF","EU","AF","EU","OC",
218
- "SA","OC","EU","EU","NA","AF","EU","NA","AS","SA",
219
- "AF","EU","NA","AF","AF","NA","AF","EU","AN","NA",
220
- "OC","AF","SA","AS","AN","NA","EU","NA","EU","AS",
221
- "EU","AS","AS","AS","AS","AS","EU","EU","NA","AS",
222
- "AS","AF","AS","AS","OC","AF","NA","AS","AS","AS",
223
- "NA","AS","AS","AS","NA","EU","AS","AF","AF","EU",
224
- "EU","EU","AF","AF","EU","EU","AF","OC","EU","AF",
225
- "AS","AS","AS","OC","NA","AF","NA","EU","AF","AS",
226
- "AF","NA","AS","AF","AF","OC","AF","OC","AF","NA",
227
- "EU","EU","AS","OC","OC","OC","AS","NA","SA","OC",
228
- "OC","AS","AS","EU","NA","OC","NA","AS","EU","OC",
229
- "SA","AS","AF","EU","EU","AF","AS","OC","AF","AF",
230
- "EU","AS","AF","EU","EU","EU","AF","EU","AF","AF",
231
- "SA","AF","NA","AS","AF","NA","AF","AN","AF","AS",
232
- "AS","OC","AS","AF","OC","AS","EU","NA","OC","AS",
233
- "AF","EU","AF","OC","NA","SA","AS","EU","NA","SA",
234
- "NA","NA","AS","OC","OC","OC","AS","AF","EU","AF",
235
- "AF","EU","AF","--","--","--","EU","EU","EU","EU",
236
- "NA","NA","NA"
237
- );
238
-
239
- }
240
- function geoip_load_shared_mem ($file) {
241
-
242
- $fp = fopen($file, "rb");
243
- if (!$fp) {
244
- print "error opening $file: $php_errormsg\n";
245
- exit;
246
- }
247
- $s_array = fstat($fp);
248
- $size = $s_array['size'];
249
- if ($shmid = @shmop_open (GEOIP_SHM_KEY, "w", 0, 0)) {
250
- shmop_delete ($shmid);
251
- shmop_close ($shmid);
252
- }
253
- $shmid = shmop_open (GEOIP_SHM_KEY, "c", 0644, $size);
254
- shmop_write ($shmid, fread($fp, $size), 0);
255
- shmop_close ($shmid);
256
- }
257
-
258
- function _setup_segments($gi){
259
- $gi->databaseType = GEOIP_COUNTRY_EDITION;
260
- $gi->record_length = STANDARD_RECORD_LENGTH;
261
- if ($gi->flags & GEOIP_SHARED_MEMORY) {
262
- $offset = @shmop_size ($gi->shmid) - 3;
263
- for ($i = 0; $i < STRUCTURE_INFO_MAX_SIZE; $i++) {
264
- $delim = @shmop_read ($gi->shmid, $offset, 3);
265
- $offset += 3;
266
- if ($delim == (chr(255).chr(255).chr(255))) {
267
- $gi->databaseType = ord(@shmop_read ($gi->shmid, $offset, 1));
268
- $offset++;
269
-
270
- if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){
271
- $gi->databaseSegments = GEOIP_STATE_BEGIN_REV0;
272
- } else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1){
273
- $gi->databaseSegments = GEOIP_STATE_BEGIN_REV1;
274
- } else if (($gi->databaseType == GEOIP_CITY_EDITION_REV0)||
275
- ($gi->databaseType == GEOIP_CITY_EDITION_REV1)
276
- || ($gi->databaseType == GEOIP_ORG_EDITION)
277
- || ($gi->databaseType == GEOIP_ORG_EDITION_V6)
278
- || ($gi->databaseType == GEOIP_DOMAIN_EDITION)
279
- || ($gi->databaseType == GEOIP_DOMAIN_EDITION_V6)
280
- || ($gi->databaseType == GEOIP_ISP_EDITION)
281
- || ($gi->databaseType == GEOIP_ISP_EDITION_V6)
282
- || ($gi->databaseType == GEOIP_USERTYPE_EDITION)
283
- || ($gi->databaseType == GEOIP_USERTYPE_EDITION_V6)
284
- || ($gi->databaseType == GEOIP_LOCATIONA_EDITION)
285
- || ($gi->databaseType == GEOIP_ACCURACYRADIUS_EDITION)
286
- || ($gi->databaseType == GEOIP_CITY_EDITION_REV0_V6)
287
- || ($gi->databaseType == GEOIP_CITY_EDITION_REV1_V6)
288
- || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1)
289
- || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1_V6)
290
- || ($gi->databaseType == GEOIP_ASNUM_EDITION)
291
- || ($gi->databaseType == GEOIP_ASNUM_EDITION_V6)){
292
- $gi->databaseSegments = 0;
293
- $buf = @shmop_read ($gi->shmid, $offset, SEGMENT_RECORD_LENGTH);
294
- for ($j = 0;$j < SEGMENT_RECORD_LENGTH;$j++){
295
- $gi->databaseSegments += (ord($buf[$j]) << ($j * 8));
296
- }
297
- if (($gi->databaseType == GEOIP_ORG_EDITION)
298
- || ($gi->databaseType == GEOIP_ORG_EDITION_V6)
299
- || ($gi->databaseType == GEOIP_DOMAIN_EDITION)
300
- || ($gi->databaseType == GEOIP_DOMAIN_EDITION_V6)
301
- || ($gi->databaseType == GEOIP_ISP_EDITION)
302
- || ($gi->databaseType == GEOIP_ISP_EDITION_V6)) {
303
- $gi->record_length = ORG_RECORD_LENGTH;
304
- }
305
- }
306
- break;
307
- } else {
308
- $offset -= 4;
309
- }
310
- }
311
- if (($gi->databaseType == GEOIP_COUNTRY_EDITION)||
312
- ($gi->databaseType == GEOIP_COUNTRY_EDITION_V6)||
313
- ($gi->databaseType == GEOIP_PROXY_EDITION)||
314
- ($gi->databaseType == GEOIP_NETSPEED_EDITION)){
315
- $gi->databaseSegments = GEOIP_COUNTRY_BEGIN;
316
- }
317
- } else {
318
- $filepos = ftell($gi->filehandle);
319
- fseek($gi->filehandle, -3, SEEK_END);
320
- for ($i = 0; $i < STRUCTURE_INFO_MAX_SIZE; $i++) {
321
- $delim = fread($gi->filehandle,3);
322
- if ($delim == (chr(255).chr(255).chr(255))){
323
- $gi->databaseType = ord(fread($gi->filehandle,1));
324
- if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){
325
- $gi->databaseSegments = GEOIP_STATE_BEGIN_REV0;
326
- }
327
- else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1){
328
- $gi->databaseSegments = GEOIP_STATE_BEGIN_REV1;
329
- } else if (($gi->databaseType == GEOIP_CITY_EDITION_REV0)
330
- || ($gi->databaseType == GEOIP_CITY_EDITION_REV1)
331
- || ($gi->databaseType == GEOIP_CITY_EDITION_REV0_V6)
332
- || ($gi->databaseType == GEOIP_CITY_EDITION_REV1_V6)
333
- || ($gi->databaseType == GEOIP_ORG_EDITION)
334
- || ($gi->databaseType == GEOIP_DOMAIN_EDITION)
335
- || ($gi->databaseType == GEOIP_ISP_EDITION)
336
- || ($gi->databaseType == GEOIP_ORG_EDITION_V6)
337
- || ($gi->databaseType == GEOIP_DOMAIN_EDITION_V6)
338
- || ($gi->databaseType == GEOIP_ISP_EDITION_V6)
339
- || ($gi->databaseType == GEOIP_LOCATIONA_EDITION)
340
- || ($gi->databaseType == GEOIP_ACCURACYRADIUS_EDITION)
341
- || ($gi->databaseType == GEOIP_CITY_EDITION_REV0_V6)
342
- || ($gi->databaseType == GEOIP_CITY_EDITION_REV1_V6)
343
- || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1)
344
- || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1_V6)
345
- || ($gi->databaseType == GEOIP_USERTYPE_EDITION)
346
- || ($gi->databaseType == GEOIP_USERTYPE_EDITION_V6)
347
- || ($gi->databaseType == GEOIP_ASNUM_EDITION)
348
- || ($gi->databaseType == GEOIP_ASNUM_EDITION_V6)){
349
- $gi->databaseSegments = 0;
350
- $buf = fread($gi->filehandle,SEGMENT_RECORD_LENGTH);
351
- for ($j = 0;$j < SEGMENT_RECORD_LENGTH;$j++){
352
- $gi->databaseSegments += (ord($buf[$j]) << ($j * 8));
353
- }
354
- if ( ( $gi->databaseType == GEOIP_ORG_EDITION )
355
- || ( $gi->databaseType == GEOIP_DOMAIN_EDITION )
356
- || ( $gi->databaseType == GEOIP_ISP_EDITION )
357
- || ( $gi->databaseType == GEOIP_ORG_EDITION_V6 )
358
- || ( $gi->databaseType == GEOIP_DOMAIN_EDITION_V6 )
359
- || ( $gi->databaseType == GEOIP_ISP_EDITION_V6 )) {
360
- $gi->record_length = ORG_RECORD_LENGTH;
361
- }
362
- }
363
- break;
364
- } else {
365
- fseek($gi->filehandle, -4, SEEK_CUR);
366
- }
367
- }
368
- if (($gi->databaseType == GEOIP_COUNTRY_EDITION)||
369
- ($gi->databaseType == GEOIP_COUNTRY_EDITION_V6)||
370
- ($gi->databaseType == GEOIP_PROXY_EDITION)||
371
- ($gi->databaseType == GEOIP_NETSPEED_EDITION)){
372
- $gi->databaseSegments = GEOIP_COUNTRY_BEGIN;
373
- }
374
- fseek($gi->filehandle,$filepos,SEEK_SET);
375
- }
376
- return $gi;
377
- }
378
-
379
- function geoip_open($filename, $flags) {
380
- $gi = new GeoIP;
381
- $gi->flags = $flags;
382
- if ($gi->flags & GEOIP_SHARED_MEMORY) {
383
- $gi->shmid = @shmop_open (GEOIP_SHM_KEY, "a", 0, 0);
384
- } else {
385
- $gi->filehandle = fopen($filename,"rb") or die( "Can not open $filename\n" );
386
- if ($gi->flags & GEOIP_MEMORY_CACHE) {
387
- $s_array = fstat($gi->filehandle);
388
- $gi->memory_buffer = fread($gi->filehandle, $s_array['size']);
389
- }
390
- }
391
-
392
- $gi = _setup_segments($gi);
393
- return $gi;
394
- }
395
-
396
- function geoip_close($gi) {
397
- if ($gi->flags & GEOIP_SHARED_MEMORY) {
398
- return true;
399
- }
400
-
401
- return fclose($gi->filehandle);
402
- }
403
-
404
- function geoip_country_id_by_name_v6($gi, $name) {
405
- $rec = dns_get_record($name, DNS_AAAA);
406
- if ( !$rec ) {
407
- return false;
408
- }
409
- $addr = $rec[0]["ipv6"];
410
- if (!$addr || $addr == $name) {
411
- return false;
412
- }
413
- return geoip_country_id_by_addr_v6($gi, $addr);
414
- }
415
-
416
- function geoip_country_id_by_name($gi, $name) {
417
- $addr = gethostbyname($name);
418
- if (!$addr || $addr == $name) {
419
- return false;
420
- }
421
- return geoip_country_id_by_addr($gi, $addr);
422
- }
423
-
424
- if(!function_exists('geoip_country_code_by_name_v6')) {
425
- function geoip_country_code_by_name_v6($gi, $name) {
426
- $country_id = geoip_country_id_by_name_v6($gi,$name);
427
- if ($country_id !== false) {
428
- return $gi->GEOIP_COUNTRY_CODES[$country_id];
429
- }
430
- return false;
431
- }
432
- }
433
-
434
- if(!function_exists('geoip_country_code_by_name')) {
435
- function geoip_country_code_by_name($gi, $name) {
436
- $country_id = geoip_country_id_by_name($gi,$name);
437
- if ($country_id !== false) {
438
- return $gi->GEOIP_COUNTRY_CODES[$country_id];
439
- }
440
- return false;
441
- }
442
- }
443
-
444
- function geoip_country_name_by_name_v6($gi, $name) {
445
- $country_id = geoip_country_id_by_name_v6($gi,$name);
446
- if ($country_id !== false) {
447
- return $gi->GEOIP_COUNTRY_NAMES[$country_id];
448
- }
449
- return false;
450
- }
451
-
452
- function geoip_country_name_by_name($gi, $name) {
453
- $country_id = geoip_country_id_by_name($gi,$name);
454
- if ($country_id !== false) {
455
- return $gi->GEOIP_COUNTRY_NAMES[$country_id];
456
- }
457
- return false;
458
- }
459
-
460
- function geoip_country_id_by_addr_v6($gi, $addr) {
461
- $ipnum = inet_pton($addr);
462
- return _geoip_seek_country_v6($gi, $ipnum) - GEOIP_COUNTRY_BEGIN;
463
- }
464
-
465
- function geoip_country_id_by_addr($gi, $addr) {
466
- $ipnum = ip2long($addr);
467
- return _geoip_seek_country($gi, $ipnum) - GEOIP_COUNTRY_BEGIN;
468
- }
469
-
470
- function geoip_country_code_by_addr_v6($gi, $addr) {
471
- $country_id = geoip_country_id_by_addr_v6($gi,$addr);
472
- if ($country_id !== false) {
473
- return $gi->GEOIP_COUNTRY_CODES[$country_id];
474
- }
475
- return false;
476
- }
477
-
478
- function geoip_country_code_by_addr($gi, $addr) {
479
- if ($gi->databaseType == GEOIP_CITY_EDITION_REV1) {
480
- $record = geoip_record_by_addr($gi,$addr);
481
- if ( $record !== false ) {
482
- return $record->country_code;
483
- }
484
- } else {
485
- $country_id = geoip_country_id_by_addr($gi,$addr);
486
- if ($country_id !== false) {
487
- return $gi->GEOIP_COUNTRY_CODES[$country_id];
488
- }
489
- }
490
- return false;
491
- }
492
-
493
- function geoip_country_name_by_addr_v6($gi, $addr) {
494
- $country_id = geoip_country_id_by_addr_v6($gi,$addr);
495
- if ($country_id !== false) {
496
- return $gi->GEOIP_COUNTRY_NAMES[$country_id];
497
- }
498
- return false;
499
- }
500
-
501
- function geoip_country_name_by_addr($gi, $addr) {
502
- if ($gi->databaseType == GEOIP_CITY_EDITION_REV1) {
503
- $record = geoip_record_by_addr($gi,$addr);
504
- return $record->country_name;
505
- } else {
506
- $country_id = geoip_country_id_by_addr($gi,$addr);
507
- if ($country_id !== false) {
508
- return $gi->GEOIP_COUNTRY_NAMES[$country_id];
509
- }
510
- }
511
- return false;
512
- }
513
-
514
- function _geoip_seek_country_v6($gi, $ipnum) {
515
-
516
- # arrays from unpack start with offset 1
517
- # yet another php mystery. array_merge work around
518
- # this broken behaviour
519
- $v6vec = array_merge(unpack( "C16", $ipnum));
520
-
521
- $offset = 0;
522
- for ($depth = 127; $depth >= 0; --$depth) {
523
- if ($gi->flags & GEOIP_MEMORY_CACHE) {
524
- // workaround php's broken substr, strpos, etc handling with
525
- // mbstring.func_overload and mbstring.internal_encoding
526
- $enc = mb_internal_encoding();
527
- mb_internal_encoding('ISO-8859-1');
528
-
529
- $buf = substr($gi->memory_buffer,
530
- 2 * $gi->record_length * $offset,
531
- 2 * $gi->record_length);
532
-
533
- mb_internal_encoding($enc);
534
- } elseif ($gi->flags & GEOIP_SHARED_MEMORY) {
535
- $buf = @shmop_read ($gi->shmid,
536
- 2 * $gi->record_length * $offset,
537
- 2 * $gi->record_length );
538
- } else {
539
- fseek($gi->filehandle, 2 * $gi->record_length * $offset, SEEK_SET) == 0
540
- or die("fseek failed");
541
- $buf = fread($gi->filehandle, 2 * $gi->record_length);
542
- }
543
- $x = array(0,0);
544
- for ($i = 0; $i < 2; ++$i) {
545
- for ($j = 0; $j < $gi->record_length; ++$j) {
546
- $x[$i] += ord($buf[$gi->record_length * $i + $j]) << ($j * 8);
547
- }
548
- }
549
-
550
- $bnum = 127 - $depth;
551
- $idx = $bnum >> 3;
552
- $b_mask = 1 << ( $bnum & 7 ^ 7 );
553
- if (($v6vec[$idx] & $b_mask) > 0) {
554
- if ($x[1] >= $gi->databaseSegments) {
555
- return $x[1];
556
- }
557
- $offset = $x[1];
558
- } else {
559
- if ($x[0] >= $gi->databaseSegments) {
560
- return $x[0];
561
- }
562
- $offset = $x[0];
563
- }
564
- }
565
- trigger_error("error traversing database - perhaps it is corrupt?", E_USER_ERROR);
566
- return false;
567
- }
568
-
569
- function _geoip_seek_country($gi, $ipnum) {
570
- $offset = 0;
571
- for ($depth = 31; $depth >= 0; --$depth) {
572
- if ($gi->flags & GEOIP_MEMORY_CACHE) {
573
- // workaround php's broken substr, strpos, etc handling with
574
- // mbstring.func_overload and mbstring.internal_encoding
575
- $enc = mb_internal_encoding();
576
- mb_internal_encoding('ISO-8859-1');
577
-
578
- $buf = substr($gi->memory_buffer,
579
- 2 * $gi->record_length * $offset,
580
- 2 * $gi->record_length);
581
-
582
- mb_internal_encoding($enc);
583
- } elseif ($gi->flags & GEOIP_SHARED_MEMORY) {
584
- $buf = @shmop_read ($gi->shmid,
585
- 2 * $gi->record_length * $offset,
586
- 2 * $gi->record_length );
587
- } else {
588
- fseek($gi->filehandle, 2 * $gi->record_length * $offset, SEEK_SET) == 0
589
- or die("fseek failed");
590
- $buf = fread($gi->filehandle, 2 * $gi->record_length);
591
- }
592
- $x = array(0,0);
593
- for ($i = 0; $i < 2; ++$i) {
594
- for ($j = 0; $j < $gi->record_length; ++$j) {
595
- $x[$i] += ord($buf[$gi->record_length * $i + $j]) << ($j * 8);
596
- }
597
- }
598
- if ($ipnum & (1 << $depth)) {
599
- if ($x[1] >= $gi->databaseSegments) {
600
- return $x[1];
601
- }
602
- $offset = $x[1];
603
- } else {
604
- if ($x[0] >= $gi->databaseSegments) {
605
- return $x[0];
606
- }
607
- $offset = $x[0];
608
- }
609
- }
610
- trigger_error("error traversing database - perhaps it is corrupt?", E_USER_ERROR);
611
- return false;
612
- }
613
-
614
- function _common_get_org($gi, $seek_org){
615
- $record_pointer = $seek_org + (2 * $gi->record_length - 1) * $gi->databaseSegments;
616
- if ($gi->flags & GEOIP_SHARED_MEMORY) {
617
- $org_buf = @shmop_read ($gi->shmid, $record_pointer, MAX_ORG_RECORD_LENGTH);
618
- } else {
619
- fseek($gi->filehandle, $record_pointer, SEEK_SET);
620
- $org_buf = fread($gi->filehandle,MAX_ORG_RECORD_LENGTH);
621
- }
622
- // workaround php's broken substr, strpos, etc handling with
623
- // mbstring.func_overload and mbstring.internal_encoding
624
- $enc = mb_internal_encoding();
625
- mb_internal_encoding('ISO-8859-1');
626
- $org_buf = substr($org_buf, 0, strpos($org_buf, "\0"));
627
- mb_internal_encoding($enc);
628
- return $org_buf;
629
- }
630
-
631
- function _get_org_v6($gi,$ipnum){
632
- $seek_org = _geoip_seek_country_v6($gi,$ipnum);
633
- if ($seek_org == $gi->databaseSegments) {
634
- return NULL;
635
- }
636
- return _common_get_org($gi, $seek_org);
637
- }
638
-
639
- function _get_org($gi,$ipnum){
640
- $seek_org = _geoip_seek_country($gi,$ipnum);
641
- if ($seek_org == $gi->databaseSegments) {
642
- return NULL;
643
- }
644
- return _common_get_org($gi, $seek_org);
645
- }
646
-
647
-
648
-
649
- function geoip_name_by_addr_v6 ($gi,$addr) {
650
- if ($addr == NULL) {
651
- return 0;
652
- }
653
- $ipnum = inet_pton($addr);
654
- return _get_org_v6($gi, $ipnum);
655
- }
656
-
657
- function geoip_name_by_addr ($gi,$addr) {
658
- if ($addr == NULL) {
659
- return 0;
660
- }
661
- $ipnum = ip2long($addr);
662
- return _get_org($gi, $ipnum);
663
- }
664
-
665
- function geoip_org_by_addr ($gi,$addr) {
666
- return geoip_name_by_addr($gi, $addr);
667
- }
668
-
669
- function _get_region($gi,$ipnum){
670
- if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){
671
- $seek_region = _geoip_seek_country($gi,$ipnum) - GEOIP_STATE_BEGIN_REV0;
672
- if ($seek_region >= 1000){
673
- $country_code = "US";
674
- $region = chr(($seek_region - 1000)/26 + 65) . chr(($seek_region - 1000)%26 + 65);
675
- } else {
676
- $country_code = $gi->GEOIP_COUNTRY_CODES[$seek_region];
677
- $region = "";
678
- }
679
- return array ($country_code,$region);
680
- } else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1) {
681
- $seek_region = _geoip_seek_country($gi,$ipnum) - GEOIP_STATE_BEGIN_REV1;
682
- //print $seek_region;
683
- if ($seek_region < US_OFFSET){
684
- $country_code = "";
685
- $region = "";
686
- } else if ($seek_region < CANADA_OFFSET) {
687
- $country_code = "US";
688
- $region = chr(($seek_region - US_OFFSET)/26 + 65) . chr(($seek_region - US_OFFSET)%26 + 65);
689
- } else if ($seek_region < WORLD_OFFSET) {
690
- $country_code = "CA";
691
- $region = chr(($seek_region - CANADA_OFFSET)/26 + 65) . chr(($seek_region - CANADA_OFFSET)%26 + 65);
692
- } else {
693
- $country_code = $gi->GEOIP_COUNTRY_CODES[($seek_region - WORLD_OFFSET) / FIPS_RANGE];
694
- $region = "";
695
- }
696
- return array ($country_code,$region);
697
- }
698
- }
699
-
700
- function geoip_region_by_addr ($gi,$addr) {
701
- if ($addr == NULL) {
702
- return 0;
703
- }
704
- $ipnum = ip2long($addr);
705
- return _get_region($gi, $ipnum);
706
- }
707
-
708
- function getdnsattributes ($l,$ip){
709
- $r = new Net_DNS_Resolver();
710
- $r->nameservers = array("ws1.maxmind.com");
711
- $p = $r->search($l."." . $ip .".s.maxmind.com","TXT","IN");
712
- $str = is_object($p->answer[0])?$p->answer[0]->string():'';
713
- $str = substr( $str, 1, -1 );
714
- return $str;
715
- }
716
-
717
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/common/{countries.php → geotargeting.php} RENAMED
@@ -1,36 +1,8 @@
1
  <?php
2
- $wpInsertGeoLocation = 'DEFAULT';
3
- function wp_insert_countries_init() {
4
- global $wpInsertGeoLocation;
5
- try {
6
- if(!class_exists('GeoIP')) {
7
- include(WP_INSERT_DIR.'/includes/common/geoip/geoip.inc');
8
- }
9
- if(function_exists('geoip_open') && function_exists('mb_internal_encoding')) {
10
- $geoIP = geoip_open(WP_INSERT_DIR.'/includes/common/geoip/GeoIP.dat', GEOIP_MEMORY_CACHE);
11
- $wpInsertGeoLocation = geoip_country_code_by_addr($geoIP, $_SERVER["REMOTE_ADDR"]);
12
- geoip_close($geoIP);
13
- } else {
14
- add_action('admin_notices', 'wp_insert_countries_error_notice', 0);
15
- }
16
- } catch(Exception $e) {
17
- add_action('admin_notices', 'wp_insert_countries_error_notice', 0);
18
- }
19
- }
20
- add_action('init', 'wp_insert_countries_init');
21
-
22
- function wp_insert_countries_error_notice(){
23
- if (current_user_can('manage_options')) {
24
- echo '<div id="message" class="error"><p>Geo Targeting has encountered an error, Please contact your web master.&nbsp;&nbsp;&nbsp;<b>ERROR DETAILS</b> : Please enable PHP mbstring extension on your server.</p></div>';
25
- }
26
- remove_action('admin_notices', 'wp_insert_countries_error_notice');
27
- }
28
-
29
-
30
  function wp_insert_get_countries() {
31
  $data = array(
32
- array('value' => 'AP', 'text' => 'Asia/Pacific Region'),
33
- array('value' => 'EU', 'text' => 'Europe'),
34
  array('value' => 'AD', 'text' => 'Andorra'),
35
  array('value' => 'AE', 'text' => 'United Arab Emirates'),
36
  array('value' => 'AF', 'text' => 'Afghanistan'),
@@ -284,4 +256,51 @@ function wp_insert_get_countries() {
284
  );
285
  return $data;
286
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  ?>
1
  <?php
2
+ $wpInsertGeoLocation = false;
3
+ /* Begin Generate Country List */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  function wp_insert_get_countries() {
5
  $data = array(
 
 
6
  array('value' => 'AD', 'text' => 'Andorra'),
7
  array('value' => 'AE', 'text' => 'United Arab Emirates'),
8
  array('value' => 'AF', 'text' => 'Afghanistan'),
256
  );
257
  return $data;
258
  }
259
+ /* End Generate Country List */
260
+
261
+ /* Begin Get Geo Targeted Ad Code */
262
+ function wp_insert_get_geotargeted_adcode($adOptions) {
263
+ global $wpInsertGeoLocation;
264
+ global $wpInsertABTestingMode;
265
+ if(($wpInsertGeoLocation != false) && ($wpInsertGeoLocation != '') && (is_array($adOptions['geo_group1_countries']) || is_array($adOptions['geo_group2_countries']))) {
266
+ if(($adOptions['geo_group1_adcode'] != '') && in_array($wpInsertGeoLocation, $adOptions['geo_group1_countries'])) {
267
+ return do_shortcode(stripslashes($adOptions['geo_group1_adcode']));
268
+ }
269
+ if(($adOptions['geo_group2_adcode'] != '') && in_array($wpInsertGeoLocation, $adOptions['geo_group2_countries'])) {
270
+ return do_shortcode(stripslashes($adOptions['geo_group2_adcode']));
271
+ }
272
+ }
273
+ switch($wpInsertABTestingMode) {
274
+ case 1:
275
+ return do_shortcode(stripslashes($adOptions['primary_ad_code']));
276
+ case 2:
277
+ return do_shortcode(stripslashes($adOptions['secondary_ad_code']));
278
+ case 3:
279
+ return do_shortcode(stripslashes($adOptions['tertiary_ad_code']));
280
+ default:
281
+ return do_shortcode(stripslashes($adOptions['primary_ad_code']));
282
+ }
283
+ }
284
+
285
+ add_action('init', 'wp_insert_ip_to_country');
286
+ function wp_insert_ip_to_country() {
287
+ global $wpInsertGeoLocation;
288
+ $userIp = $_SERVER["REMOTE_ADDR"];
289
+ delete_transient('wp_insert_ip_'.$userIp);
290
+ if($wpInsertGeoLocation != false) {
291
+ return $wpInsertGeoLocation;
292
+ } else {
293
+ $countryCode = get_transient('wp_insert_ip_'.$userIp);
294
+ if($countryCode === false) {
295
+ $response = wp_remote_get('http://api.hostip.info/country.php?ip='.$userIp, array('timeout' => 5));
296
+ if(!is_wp_error($response) && isset($response['response']['code']) && ($response['response']['code'] == 200) && isset($response['body']) && ($response['body'] != '') && ($response['body'] != 'XX')) {
297
+ $wpInsertGeoLocation = $response['body'];
298
+ set_transient('wp_insert_ip_'.$userIp, $wpInsertGeoLocation, WEEK_IN_SECONDS);
299
+ }
300
+ } else {
301
+ $wpInsertGeoLocation = $countryCode;
302
+ }
303
+ }
304
+ }
305
+ /* End Get Geo Targeted Ad Code */
306
  ?>
includes/common/http-post.php DELETED
@@ -1,113 +0,0 @@
1
- <?php
2
- //
3
- // Post provided content to an http server and optionally
4
- // convert chunk encoded results. Returns false on errors,
5
- // result of post on success. This example only handles http,
6
- // not https.
7
- //
8
- function wp_insert_httpPost($ip=null,$port=80,$uri=null,$content=null) {
9
- if (empty($ip)) { return false; }
10
- if (!is_numeric($port)) { return false; }
11
- if (empty($uri)) { return false; }
12
- if (empty($content)) { return false; }
13
- // generate headers in array.
14
- $t = array();
15
- $t[] = 'POST ' . $uri . ' HTTP/1.1';
16
- $t[] = 'Content-Type: application/x-www-form-urlencoded';
17
- $t[] = 'Host: ' . $ip . ':' . $port;
18
- $t[] = 'Content-Length: ' . strlen($content);
19
- $t[] = 'Connection: close';
20
- $t = implode("\r\n",$t) . "\r\n\r\n" . $content;
21
- //
22
- // Open socket, provide error report vars and timeout of 10
23
- // seconds.
24
- //
25
- $fp = @fsockopen($ip,$port,$errno,$errstr,10);
26
- // If we don't have a stream resource, abort.
27
- if (!(get_resource_type($fp) == 'stream')) { return false; }
28
- //
29
- // Send headers and content.
30
- //
31
- if (!fwrite($fp,$t)) {
32
- fclose($fp);
33
- return false;
34
- }
35
- //
36
- // Read all of response into $rsp and close the socket.
37
- //
38
- $rsp = '';
39
- while(!feof($fp)) { $rsp .= fgets($fp,8192); }
40
- fclose($fp);
41
- //
42
- // Call parseHttpResponse() to return the results.
43
- //
44
- return wp_insert_parseHttpResponse($rsp);
45
- }
46
-
47
- //
48
- // Accepts provided http content, checks for a valid http response,
49
- // unchunks if needed, returns http content without headers on
50
- // success, false on any errors.
51
- //
52
- function wp_insert_parseHttpResponse($content=null) {
53
- if (empty($content)) { return false; }
54
- // split into array, headers and content.
55
- $hunks = explode("\r\n\r\n",trim($content));
56
- if (!is_array($hunks) or count($hunks) < 2) {
57
- return false;
58
- }
59
- $header = $hunks[count($hunks) - 2];
60
- $body = $hunks[count($hunks) - 1];
61
- $headers = explode("\n",$header);
62
- unset($hunks);
63
- unset($header);
64
- if (!wp_insert_validateHttpResponse($headers)) { return false; }
65
- if (in_array('Transfer-Coding: chunked',$headers)) {
66
- return trim(wp_insert_unchunkHttpResponse($body));
67
- } else {
68
- return trim($body);
69
- }
70
- }
71
-
72
- //
73
- // Validate http responses by checking header. Expects array of
74
- // headers as argument. Returns boolean.
75
- //
76
- function wp_insert_validateHttpResponse($headers=null) {
77
- if (!is_array($headers) or count($headers) < 1) { return false; }
78
- switch(trim(strtolower($headers[0]))) {
79
- case 'http/1.0 100 ok':
80
- case 'http/1.0 200 ok':
81
- case 'http/1.1 100 ok':
82
- case 'http/1.1 200 ok':
83
- return true;
84
- break;
85
- }
86
- return false;
87
- }
88
-
89
- //
90
- // Unchunk http content. Returns unchunked content on success,
91
- // false on any errors... Borrows from code posted above by
92
- // jbr at ya-right dot com.
93
- //
94
- function wp_insert_unchunkHttpResponse($str=null) {
95
- if (!is_string($str) or strlen($str) < 1) { return false; }
96
- $eol = "\r\n";
97
- $add = strlen($eol);
98
- $tmp = $str;
99
- $str = '';
100
- do {
101
- $tmp = ltrim($tmp);
102
- $pos = strpos($tmp, $eol);
103
- if ($pos === false) { return false; }
104
- $len = hexdec(substr($tmp,0,$pos));
105
- if (!is_numeric($len) or $len < 0) { return false; }
106
- $str .= substr($tmp, ($pos + $add), $len);
107
- $tmp = substr($tmp, ($len + $pos + $add));
108
- $check = trim($tmp);
109
- } while(!empty($check));
110
- unset($tmp);
111
- return $str;
112
- }
113
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/common/images/ClosedTabBackground.png DELETED
Binary file
includes/common/images/ClosedTabBackgroundHover.png DELETED
Binary file
includes/common/images/better_checkbox.png DELETED
Binary file
includes/common/images/blog_for_$100_ad.png DELETED
Binary file
includes/common/images/border.png DELETED
Binary file
includes/common/images/check.png DELETED
Binary file
includes/common/images/chitika.gif DELETED
Binary file
includes/common/images/chitika_banner.png DELETED
Binary file
includes/common/images/chitika_btn.png DELETED
Binary file
includes/common/images/clicksor.gif DELETED
Binary file
includes/common/images/controls.png DELETED
Binary file
includes/common/images/donate_btn.png DELETED
Binary file
includes/common/images/fb_like_btn.png DELETED
Binary file
includes/common/images/help.png DELETED
Binary file
includes/common/images/hireme.png DELETED
Binary file
includes/common/images/iphone_off.png DELETED
Binary file
includes/common/images/iphone_on.png DELETED
Binary file
includes/common/images/iphone_slider.png DELETED
Binary file
includes/common/images/iphone_slider_center.png DELETED
Binary file
includes/common/images/iphone_slider_left.png DELETED
Binary file
includes/common/images/iphone_slider_right.png DELETED
Binary file
includes/common/images/jquery.minicolors.png DELETED
Binary file
includes/common/images/loading.gif DELETED
Binary file
includes/common/images/loading_background.png DELETED
Binary file
includes/common/images/logo.png DELETED
Binary file
includes/common/images/overlay.png DELETED
Binary file
includes/common/images/pointer.png DELETED
Binary file
includes/common/jquery.php DELETED
@@ -1,18 +0,0 @@
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 DELETED
@@ -1,284 +0,0 @@
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 DELETED
@@ -1,356 +0,0 @@
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 DELETED
@@ -1,4 +0,0 @@
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.miniColors.js DELETED
@@ -1,857 +0,0 @@
1
- /*
2
- * jQuery MiniColors: A tiny color picker built on jQuery
3
- *
4
- * Copyright Cory LaViska for A Beautiful Site, LLC. (http://www.abeautifulsite.net/)
5
- *
6
- * Dual-licensed under the MIT and GPL Version 2 licenses
7
- *
8
- */
9
- if(jQuery) (function($) {
10
-
11
- // Yay, MiniColors!
12
- $.minicolors = {
13
- // Default settings
14
- defaultSettings: {
15
- animationSpeed: 100,
16
- animationEasing: 'swing',
17
- change: null,
18
- changeDelay: 0,
19
- control: 'hue',
20
- defaultValue: '',
21
- hide: null,
22
- hideSpeed: 100,
23
- inline: false,
24
- letterCase: 'lowercase',
25
- opacity: false,
26
- position: 'default',
27
- show: null,
28
- showSpeed: 100,
29
- swatchPosition: 'left',
30
- textfield: true,
31
- theme: 'default'
32
- }
33
- };
34
-
35
- // Public methods
36
- $.extend($.fn, {
37
- minicolors: function(method, data) {
38
-
39
- switch(method) {
40
-
41
- // Destroy the control
42
- case 'destroy':
43
- $(this).each( function() {
44
- destroy($(this));
45
- });
46
- return $(this);
47
-
48
- // Hide the color picker
49
- case 'hide':
50
- hide();
51
- return $(this);
52
-
53
- // Get/set opacity
54
- case 'opacity':
55
- if( data === undefined ) {
56
- // Getter
57
- return $(this).attr('data-opacity');
58
- } else {
59
- // Setter
60
- $(this).each( function() {
61
- refresh($(this).attr('data-opacity', data));
62
- });
63
- return $(this);
64
- }
65
-
66
- // Get an RGB(A) object based on the current color/opacity
67
- case 'rgbObject':
68
- return rgbObject($(this), method === 'rgbaObject');
69
-
70
- // Get an RGB(A) string based on the current color/opacity
71
- case 'rgbString':
72
- case 'rgbaString':
73
- return rgbString($(this), method === 'rgbaString')
74
-
75
- // Get/set settings on the fly
76
- case 'settings':
77
- if( data === undefined ) {
78
- return $(this).data('minicolors-settings');
79
- } else {
80
- // Setter
81
- $(this).each( function() {
82
- var settings = $(this).data('minicolors-settings') || {};
83
- destroy($(this));
84
- $(this).minicolors($.extend(true, settings, data));
85
- });
86
- return $(this);
87
- }
88
-
89
- // Show the color picker
90
- case 'show':
91
- show( $(this).eq(0) );
92
- return $(this);
93
-
94
- // Get/set the hex color value
95
- case 'value':
96
- if( data === undefined ) {
97
- // Getter
98
- return $(this).val();
99
- } else {
100
- // Setter
101
- $(this).each( function() {
102
- refresh($(this).val(data));
103
- });
104
- return $(this);
105
- }
106
-
107
- // Initializes the control
108
- case 'create':
109
- default:
110
- if( method !== 'create' ) data = method;
111
- $(this).each( function() {
112
- init($(this), data);
113
- });
114
- return $(this);
115
-
116
- }
117
-
118
- }
119
- });
120
-
121
- // Initialize input elements
122
- function init(input, settings) {
123
-
124
- var minicolors = $('<span class="minicolors" />'),
125
- defaultSettings = $.minicolors.defaultSettings;
126
-
127
- // Do nothing if already initialized
128
- if( input.data('minicolors-initialized') ) return;
129
-
130
- // Handle settings
131
- settings = $.extend(true, {}, defaultSettings, settings);
132
-
133
- // The wrapper
134
- minicolors
135
- .addClass('minicolors-theme-' + settings.theme)
136
- .addClass('minicolors-swatch-position-' + settings.swatchPosition)
137
- .toggleClass('minicolors-swatch-left', settings.swatchPosition === 'left')
138
- .toggleClass('minicolors-with-opacity', settings.opacity);
139
-
140
- // Custom positioning
141
- if( settings.position !== undefined ) {
142
- $.each(settings.position.split(' '), function() {
143
- minicolors.addClass('minicolors-position-' + this);
144
- });
145
- }
146
-
147
- // The input
148
- input
149
- .addClass('minicolors-input')
150
- .data('minicolors-initialized', true)
151
- .data('minicolors-settings', settings)
152
- .prop('size', 7)
153
- .prop('maxlength', 7)
154
- .wrap(minicolors)
155
- .after(
156
- '<span class="minicolors-panel minicolors-slider-' + settings.control + '">' +
157
- '<span class="minicolors-slider">' +
158
- '<span class="minicolors-picker"></span>' +
159
- '</span>' +
160
- '<span class="minicolors-opacity-slider">' +
161
- '<span class="minicolors-picker"></span>' +
162
- '</span>' +
163
- '<span class="minicolors-grid">' +
164
- '<span class="minicolors-grid-inner"></span>' +
165
- '<span class="minicolors-picker"><span></span></span>' +
166
- '</span>' +
167
- '</span>'
168
- );
169
-
170
- // Prevent text selection in IE
171
- input.parent().find('.minicolors-panel').on('selectstart', function() { return false; }).end();
172
-
173
- // Detect swatch position
174
- if( settings.swatchPosition === 'left' ) {
175
- // Left
176
- input.before('<span class="minicolors-swatch"><span></span></span>');
177
- } else {
178
- // Right
179
- input.after('<span class="minicolors-swatch"><span></span></span>');
180
- }
181
-
182
- // Disable textfield
183
- if( !settings.textfield ) input.addClass('minicolors-hidden');
184
-
185
- // Inline controls
186
- if( settings.inline ) input.parent().addClass('minicolors-inline');
187
-
188
- updateFromInput(input, false, true);
189
-
190
- }
191
-
192
- // Returns the input back to its original state
193
- function destroy(input) {
194
-
195
- var minicolors = input.parent();
196
-
197
- // Revert the input element
198
- input
199
- .removeData('minicolors-initialized')
200
- .removeData('minicolors-settings')
201
- .removeProp('size')
202
- .removeProp('maxlength')
203
- .removeClass('minicolors-input');
204
-
205
- // Remove the wrap and destroy whatever remains
206
- minicolors.before(input).remove();
207
-
208
- }
209
-
210
- // Refresh the specified control
211
- function refresh(input) {
212
- updateFromInput(input);
213
- }
214
-
215
- // Shows the specified dropdown panel
216
- function show(input) {
217
-
218
- var minicolors = input.parent(),
219
- panel = minicolors.find('.minicolors-panel'),
220
- settings = input.data('minicolors-settings');
221
-
222
- // Do nothing if uninitialized, disabled, inline, or already open
223
- if( !input.data('minicolors-initialized') ||
224
- input.prop('disabled') ||
225
- minicolors.hasClass('minicolors-inline') ||
226
- minicolors.hasClass('minicolors-focus')
227
- ) return;
228
-
229
- hide();
230
-
231
- minicolors.addClass('minicolors-focus');
232
- panel
233
- .stop(true, true)
234
- .fadeIn(settings.showSpeed, function() {
235
- if( settings.show ) settings.show.call(input.get(0));
236
- });
237
-
238
- }
239
-
240
- // Hides all dropdown panels
241
- function hide() {
242
-
243
- $('.minicolors-input').each( function() {
244
-
245
- var input = $(this),
246
- settings = input.data('minicolors-settings'),
247
- minicolors = input.parent();
248
-
249
- // Don't hide inline controls
250
- if( settings.inline ) return;
251
-
252
- minicolors.find('.minicolors-panel').fadeOut(settings.hideSpeed, function() {
253
- if(minicolors.hasClass('minicolors-focus')) {
254
- if( settings.hide ) settings.hide.call(input.get(0));
255
- }
256
- minicolors.removeClass('minicolors-focus');
257
- });
258
-
259
- });
260
- }
261
-
262
- // Moves the selected picker
263
- function move(target, event, animate) {
264
-
265
- var input = target.parents('.minicolors').find('.minicolors-input'),
266
- settings = input.data('minicolors-settings'),
267
- picker = target.find('[class$=-picker]'),
268
- offsetX = target.offset().left,
269
- offsetY = target.offset().top,
270
- x = Math.round(event.pageX - offsetX),
271
- y = Math.round(event.pageY - offsetY),
272
- duration = animate ? settings.animationSpeed : 0,
273
- wx, wy, r, phi;
274
-
275
-
276
- // Touch support
277
- if( event.originalEvent.changedTouches ) {
278
- x = event.originalEvent.changedTouches[0].pageX - offsetX;
279
- y = event.originalEvent.changedTouches[0].pageY - offsetY;
280
- }
281
-
282
- // Constrain picker to its container
283
- if( x < 0 ) x = 0;
284
- if( y < 0 ) y = 0;
285
- if( x > target.width() ) x = target.width();
286
- if( y > target.height() ) y = target.height();
287
-
288
- // Constrain color wheel values to the wheel
289
- if( target.parent().is('.minicolors-slider-wheel') && picker.parent().is('.minicolors-grid') ) {
290
- wx = 75 - x;
291
- wy = 75 - y;
292
- r = Math.sqrt(wx * wx + wy * wy);
293
- phi = Math.atan2(wy, wx);
294
- if( phi < 0 ) phi += Math.PI * 2;
295
- if( r > 75 ) {
296
- r = 75;
297
- x = 75 - (75 * Math.cos(phi));
298
- y = 75 - (75 * Math.sin(phi));
299
- }
300
- x = Math.round(x);
301
- y = Math.round(y);
302
- }
303
-
304
- // Move the picker
305
- if( target.is('.minicolors-grid') ) {
306
- picker
307
- .stop(true)
308
- .animate({
309
- top: y + 'px',
310
- left: x + 'px'
311
- }, duration, settings.animationEasing, function() {
312
- updateFromControl(input, target);
313
- });
314
- } else {
315
- picker
316
- .stop(true)
317
- .animate({
318
- top: y + 'px'
319
- }, duration, settings.animationEasing, function() {
320
- updateFromControl(input, target);
321
- });
322
- }
323
-
324
- }
325
-
326
- // Sets the input based on the color picker values
327
- function updateFromControl(input, target) {
328
-
329
- function getCoords(picker, container) {
330
-
331
- var left, top;
332
- if( !picker.length || !container ) return null;
333
- left = picker.offset().left;
334
- top = picker.offset().top;
335
-
336
- return {
337
- x: left - container.offset().left + (picker.outerWidth() / 2),
338
- y: top - container.offset().top + (picker.outerHeight() / 2)
339
- };
340
-
341
- }
342
-
343
- var hue, saturation, brightness, rgb, x, y, r, phi,
344
-
345
- hex = input.val(),
346
- opacity = input.attr('data-opacity'),
347
-
348
- // Helpful references
349
- minicolors = input.parent(),
350
- settings = input.data('minicolors-settings'),
351
- panel = minicolors.find('.minicolors-panel'),
352
- swatch = minicolors.find('.minicolors-swatch'),
353
-
354
- // Panel objects
355
- grid = minicolors.find('.minicolors-grid'),
356
- slider = minicolors.find('.minicolors-slider'),
357
- opacitySlider = minicolors.find('.minicolors-opacity-slider'),
358
-
359
- // Picker objects
360
- gridPicker = grid.find('[class$=-picker]'),
361
- sliderPicker = slider.find('[class$=-picker]'),
362
- opacityPicker = opacitySlider.find('[class$=-picker]'),
363
-
364
- // Picker positions
365
- gridPos = getCoords(gridPicker, grid),
366
- sliderPos = getCoords(sliderPicker, slider),
367
- opacityPos = getCoords(opacityPicker, opacitySlider);
368
-
369
- // Handle colors
370
- if( target.is('.minicolors-grid, .minicolors-slider') ) {
371
-
372
- // Determine HSB values
373
- switch(settings.control) {
374
-
375
- case 'wheel':
376
- // Calculate hue, saturation, and brightness
377
- x = (grid.width() / 2) - gridPos.x;
378
- y = (grid.height() / 2) - gridPos.y;
379
- r = Math.sqrt(x * x + y * y);
380
- phi = Math.atan2(y, x);
381
- if( phi < 0 ) phi += Math.PI * 2;
382
- if( r > 75 ) {
383
- r = 75;
384
- gridPos.x = 69 - (75 * Math.cos(phi));
385
- gridPos.y = 69 - (75 * Math.sin(phi));
386
- }
387
- saturation = keepWithin(r / 0.75, 0, 100);
388
- hue = keepWithin(phi * 180 / Math.PI, 0, 360);
389
- brightness = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);
390
- hex = hsb2hex({
391
- h: hue,
392
- s: saturation,
393
- b: brightness
394
- });
395
-
396
- // Update UI
397
- slider.css('backgroundColor', hsb2hex({ h: hue, s: saturation, b: 100 }));
398
- break;
399
-
400
- case 'saturation':
401
- // Calculate hue, saturation, and brightness
402
- hue = keepWithin(parseInt(gridPos.x * (360 / grid.width())), 0, 360);
403
- saturation = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);
404
- brightness = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);
405
- hex = hsb2hex({
406
- h: hue,
407
- s: saturation,
408
- b: brightness
409
- });
410
-
411
- // Update UI
412
- slider.css('backgroundColor', hsb2hex({ h: hue, s: 100, b: brightness }));
413
- minicolors.find('.minicolors-grid-inner').css('opacity', saturation / 100);
414
- break;
415
-
416
- case 'brightness':
417
- // Calculate hue, saturation, and brightness
418
- hue = keepWithin(parseInt(gridPos.x * (360 / grid.width())), 0, 360);
419
- saturation = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);
420
- brightness = keepWithin(100 - Math.floor(sliderPos.y * (100 / slider.height())), 0, 100);
421
- hex = hsb2hex({
422
- h: hue,
423
- s: saturation,
424
- b: brightness
425
- });
426
-
427
- // Update UI
428
- slider.css('backgroundColor', hsb2hex({ h: hue, s: saturation, b: 100 }));
429
- minicolors.find('.minicolors-grid-inner').css('opacity', 1 - (brightness / 100));
430
- break;
431
-
432
- default:
433
- // Calculate hue, saturation, and brightness
434
- hue = keepWithin(360 - parseInt(sliderPos.y * (360 / slider.height())), 0, 360);
435
- saturation = keepWithin(Math.floor(gridPos.x * (100 / grid.width())), 0, 100);
436
- brightness = keepWithin(100 - Math.floor(gridPos.y * (100 / grid.height())), 0, 100);
437
- hex = hsb2hex({
438
- h: hue,
439
- s: saturation,
440
- b: brightness
441
- });
442
-
443
- // Update UI
444
- grid.css('backgroundColor', hsb2hex({ h: hue, s: 100, b: 100 }));
445
- break;
446
-
447
- }
448
-
449
- // Adjust case
450
- input.val( convertCase(hex, settings.letterCase) );
451
-
452
- }
453
-
454
- // Handle opacity
455
- if( target.is('.minicolors-opacity-slider') ) {
456
- if( settings.opacity ) {
457
- opacity = parseFloat(1 - (opacityPos.y / opacitySlider.height())).toFixed(2);
458
- } else {
459
- opacity = 1;
460
- }
461
- if( settings.opacity ) input.attr('data-opacity', opacity);
462
- }
463
-
464
- // Set swatch color
465
- swatch.find('SPAN').css({
466
- backgroundColor: hex,
467
- opacity: opacity
468
- });
469
-
470
- // Handle change event
471
- doChange(input, hex, opacity);
472
-
473
- }
474
-
475
- // Sets the color picker values from the input
476
- function updateFromInput(input, preserveInputValue, firstRun) {
477
-
478
- var hex,
479
- hsb,
480
- opacity,
481
- x, y, r, phi,
482
-
483
- // Helpful references
484
- minicolors = input.parent(),
485
- settings = input.data('minicolors-settings'),
486
- swatch = minicolors.find('.minicolors-swatch'),
487
-
488
- // Panel objects
489
- grid = minicolors.find('.minicolors-grid'),
490
- slider = minicolors.find('.minicolors-slider'),
491
- opacitySlider = minicolors.find('.minicolors-opacity-slider'),
492
-
493
- // Picker objects
494
- gridPicker = grid.find('[class$=-picker]'),
495
- sliderPicker = slider.find('[class$=-picker]'),
496
- opacityPicker = opacitySlider.find('[class$=-picker]');
497
-
498
- // Determine hex/HSB values
499
- hex = convertCase(parseHex(input.val(), true), settings.letterCase);
500
- if( !hex ) hex = convertCase(parseHex(settings.defaultValue, true));
501
- hsb = hex2hsb(hex);
502
-
503
- // Update input value
504
- if( !preserveInputValue ) input.val(hex);
505
-
506
- // Determine opacity value
507
- if( settings.opacity ) {
508
- // Get from data-opacity attribute and keep within 0-1 range
509
- opacity = input.attr('data-opacity') === '' ? 1 : keepWithin(parseFloat(input.attr('data-opacity')).toFixed(2), 0, 1);
510
- if( isNaN(opacity) ) opacity = 1;
511
- input.attr('data-opacity', opacity);
512
- swatch.find('SPAN').css('opacity', opacity);
513
-
514
- // Set opacity picker position
515
- y = keepWithin(opacitySlider.height() - (opacitySlider.height() * opacity), 0, opacitySlider.height());
516
- opacityPicker.css('top', y + 'px');
517
- }
518
-
519
- // Update swatch
520
- swatch.find('SPAN').css('backgroundColor', hex);
521
-
522
- // Determine picker locations
523
- switch(settings.control) {
524
-
525
- case 'wheel':
526
- // Set grid position
527
- r = keepWithin(Math.ceil(hsb.s * 0.75), 0, grid.height() / 2);
528
- phi = hsb.h * Math.PI / 180;
529
- x = keepWithin(75 - Math.cos(phi) * r, 0, grid.width());
530
- y = keepWithin(75 - Math.sin(phi) * r, 0, grid.height());
531
- gridPicker.css({
532
- top: y + 'px',
533
- left: x + 'px'
534
- });
535
-
536
- // Set slider position
537
- y = 150 - (hsb.b / (100 / grid.height()));
538
- if( hex === '' ) y = 0;
539
- sliderPicker.css('top', y + 'px');
540
-
541
- // Update panel color
542
- slider.css('backgroundColor', hsb2hex({ h: hsb.h, s: hsb.s, b: 100 }));
543
- break;
544
-
545
- case 'saturation':
546
- // Set grid position
547
- x = keepWithin((5 * hsb.h) / 12, 0, 150);
548
- y = keepWithin(grid.height() - Math.ceil(hsb.b / (100 / grid.height())), 0, grid.height());
549
- gridPicker.css({
550
- top: y + 'px',
551
- left: x + 'px'
552
- });
553
-
554
- // Set slider position
555
- y = keepWithin(slider.height() - (hsb.s * (slider.height() / 100)), 0, slider.height());
556
- sliderPicker.css('top', y + 'px');
557
-
558
- // Update UI
559
- slider.css('backgroundColor', hsb2hex({ h: hsb.h, s: 100, b: hsb.b }));
560
- minicolors.find('.minicolors-grid-inner').css('opacity', hsb.s / 100);
561
-
562
- break;
563
-
564
- case 'brightness':
565
- // Set grid position
566
- x = keepWithin((5 * hsb.h) / 12, 0, 150);
567
- y = keepWithin(grid.height() - Math.ceil(hsb.s / (100 / grid.height())), 0, grid.height());
568
- gridPicker.css({
569
- top: y + 'px',
570
- left: x + 'px'
571
- });
572
-
573
- // Set slider position
574
- y = keepWithin(slider.height() - (hsb.b * (slider.height() / 100)), 0, slider.height());
575
- sliderPicker.css('top', y + 'px');
576
-
577
- // Update UI
578
- slider.css('backgroundColor', hsb2hex({ h: hsb.h, s: hsb.s, b: 100 }));
579
- minicolors.find('.minicolors-grid-inner').css('opacity', 1 - (hsb.b / 100));
580
- break;
581
-
582
- default:
583
- // Set grid position
584
- x = keepWithin(Math.ceil(hsb.s / (100 / grid.width())), 0, grid.width());
585
- y = keepWithin(grid.height() - Math.ceil(hsb.b / (100 / grid.height())), 0, grid.height());
586
- gridPicker.css({
587
- top: y + 'px',
588
- left: x + 'px'
589
- });
590
-
591
- // Set slider position
592
- y = keepWithin(slider.height() - (hsb.h / (360 / slider.height())), 0, slider.height());
593
- sliderPicker.css('top', y + 'px');
594
-
595
- // Update panel color
596
- grid.css('backgroundColor', hsb2hex({ h: hsb.h, s: 100, b: 100 }));
597
- break;
598
-
599
- }
600
-
601
- // Handle change event
602
- if( !firstRun ) doChange(input, hex, opacity);
603
-
604
- }
605
-
606
- // Runs the change and changeDelay callbacks
607
- function doChange(input, hex, opacity) {
608
-
609
- var settings = input.data('minicolors-settings');
610
-
611
- // Only run if it actually changed
612
- if( hex + opacity !== input.data('minicolors-lastChange') ) {
613
-
614
- // Remember last-changed value
615
- input.data('minicolors-lastChange', hex + opacity);
616
-
617
- // Fire change event
618
- if( settings.change ) {
619
- if( settings.changeDelay ) {
620
- // Call after a delay
621
- clearTimeout(input.data('minicolors-changeTimeout'));
622
- input.data('minicolors-changeTimeout', setTimeout( function() {
623
- settings.change.call(input.get(0), hex, opacity);
624
- }, settings.changeDelay));
625
- } else {
626
- // Call immediately
627
- settings.change.call(input.get(0), hex, opacity);
628
- }
629
- }
630
-
631
- }
632
-
633
- }
634
-
635
- // Generates an RGB(A) object based on the input's value
636
- function rgbObject(input) {
637
- var hex = parseHex($(input).val(), true),
638
- rgb = hex2rgb(hex),
639
- opacity = $(input).attr('data-opacity');
640
- if( !rgb ) return null;
641
- if( opacity !== undefined ) $.extend(rgb, { a: parseFloat(opacity) });
642
- return rgb;
643
- }
644
-
645
- // Genearates an RGB(A) string based on the input's value
646
- function rgbString(input, alpha) {
647
- var hex = parseHex($(input).val(), true),
648
- rgb = hex2rgb(hex),
649
- opacity = $(input).attr('data-opacity');
650
- if( !rgb ) return null;
651
- if( opacity === undefined ) opacity = 1;
652
- if( alpha ) {
653
- return 'rgba(' + rgb.r + ', ' + rgb.g + ', ' + rgb.b + ', ' + parseFloat(opacity) + ')';
654
- } else {
655
- return 'rgb(' + rgb.r + ', ' + rgb.g + ', ' + rgb.b + ')';
656
- }
657
- }
658
-
659
- // Converts to the letter case specified in settings
660
- function convertCase(string, letterCase) {
661
- return letterCase === 'uppercase' ? string.toUpperCase() : string.toLowerCase();
662
- }
663
-
664
- // Parses a string and returns a valid hex string when possible
665
- function parseHex(string, expand) {
666
- string = string.replace(/[^A-F0-9]/ig, '');
667
- if( string.length !== 3 && string.length !== 6 ) return '';
668
- if( string.length === 3 && expand ) {
669
- string = string[0] + string[0] + string[1] + string[1] + string[2] + string[2];
670
- }
671
- return '#' + string;
672
- }
673
-
674
- // Keeps value within min and max
675
- function keepWithin(value, min, max) {
676
- if( value < min ) value = min;
677
- if( value > max ) value = max;
678
- return value;
679
- }
680
-
681
- // Converts an HSB object to an RGB object
682
- function hsb2rgb(hsb) {
683
- var rgb = {};
684
- var h = Math.round(hsb.h);
685
- var s = Math.round(hsb.s * 255 / 100);
686
- var v = Math.round(hsb.b * 255 / 100);
687
- if(s === 0) {
688
- rgb.r = rgb.g = rgb.b = v;
689
- } else {
690
- var t1 = v;
691
- var t2 = (255 - s) * v / 255;
692
- var t3 = (t1 - t2) * (h % 60) / 60;
693
- if( h === 360 ) h = 0;
694
- if( h < 60 ) { rgb.r = t1; rgb.b = t2; rgb.g = t2 + t3; }
695
- else if( h < 120 ) {rgb.g = t1; rgb.b = t2; rgb.r = t1 - t3; }
696
- else if( h < 180 ) {rgb.g = t1; rgb.r = t2; rgb.b = t2 + t3; }
697
- else if( h < 240 ) {rgb.b = t1; rgb.r = t2; rgb.g = t1 - t3; }
698
- else if( h < 300 ) {rgb.b = t1; rgb.g = t2; rgb.r = t2 + t3; }
699
- else if( h < 360 ) {rgb.r = t1; rgb.g = t2; rgb.b = t1 - t3; }
700
- else { rgb.r = 0; rgb.g = 0; rgb.b = 0; }
701
- }
702
- return {
703
- r: Math.round(rgb.r),
704
- g: Math.round(rgb.g),
705
- b: Math.round(rgb.b)
706
- };
707
- }
708
-
709
- // Converts an RGB object to a hex string
710
- function rgb2hex(rgb) {
711
- var hex = [
712
- rgb.r.toString(16),
713
- rgb.g.toString(16),
714
- rgb.b.toString(16)
715
- ];
716
- $.each(hex, function(nr, val) {
717
- if (val.length === 1) hex[nr] = '0' + val;
718
- });
719
- return '#' + hex.join('');
720
- }
721
-
722
- // Converts an HSB object to a hex string
723
- function hsb2hex(hsb) {
724
- return rgb2hex(hsb2rgb(hsb));
725
- }
726
-
727
- // Converts a hex string to an HSB object
728
- function hex2hsb(hex) {
729
- var hsb = rgb2hsb(hex2rgb(hex));
730
- if( hsb.s === 0 ) hsb.h = 360;
731
- return hsb;
732
- }
733
-
734
- // Converts an RGB object to an HSB object
735
- function rgb2hsb(rgb) {
736
- var hsb = { h: 0, s: 0, b: 0 };
737
- var min = Math.min(rgb.r, rgb.g, rgb.b);
738
- var max = Math.max(rgb.r, rgb.g, rgb.b);
739
- var delta = max - min;
740
- hsb.b = max;
741
- hsb.s = max !== 0 ? 255 * delta / max : 0;
742
- if( hsb.s !== 0 ) {
743
- if( rgb.r === max ) {
744
- hsb.h = (rgb.g - rgb.b) / delta;
745
- } else if( rgb.g === max ) {
746
- hsb.h = 2 + (rgb.b - rgb.r) / delta;
747
- } else {
748
- hsb.h = 4 + (rgb.r - rgb.g) / delta;
749
- }
750
- } else {
751
- hsb.h = -1;
752
- }
753
- hsb.h *= 60;
754
- if( hsb.h < 0 ) {
755
- hsb.h += 360;
756
- }
757
- hsb.s *= 100/255;
758
- hsb.b *= 100/255;
759
- return hsb;
760
- }
761
-
762
- // Converts a hex string to an RGB object
763
- function hex2rgb(hex) {
764
- hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
765
- return {
766
- r: hex >> 16,
767
- g: (hex & 0x00FF00) >> 8,
768
- b: (hex & 0x0000FF)
769
- };
770
- }
771
-
772
- // Handle events
773
- $(document)
774
- // Hide on clicks outside of the control
775
- .on('mousedown.minicolors touchstart.minicolors', function(event) {
776
- if( !$(event.target).parents().add(event.target).hasClass('minicolors') ) {
777
- hide();
778
- }
779
- })
780
- // Start moving
781
- .on('mousedown.minicolors touchstart.minicolors', '.minicolors-grid, .minicolors-slider, .minicolors-opacity-slider', function(event) {
782
- var target = $(this);
783
- event.preventDefault();
784
- $(document).data('minicolors-target', target);
785
- move(target, event, true);
786
- })
787
- // Move pickers
788
- .on('mousemove.minicolors touchmove.minicolors', function(event) {
789
- var target = $(document).data('minicolors-target');
790
- if( target ) move(target, event);
791
- })
792
- // Stop moving
793
- .on('mouseup.minicolors touchend.minicolors', function() {
794
- $(this).removeData('minicolors-target');
795
- })
796
- // Toggle panel when swatch is clicked
797
- .on('mousedown.minicolors touchstart.minicolors', '.minicolors-swatch', function(event) {
798
- var input = $(this).parent().find('.minicolors-input'),
799
- minicolors = input.parent();
800
- if( minicolors.hasClass('minicolors-focus') ) {
801
- hide(input);
802
- } else {
803
- show(input);
804
- }
805
- })
806
- // Show on focus
807
- .on('focus.minicolors', '.minicolors-input', function(event) {
808
- var input = $(this);
809
- if( !input.data('minicolors-initialized') ) return;
810
- show(input);
811
- })
812
- // Fix hex on blur
813
- .on('blur.minicolors', '.minicolors-input', function(event) {
814
- var input = $(this),
815
- settings = input.data('minicolors-settings');
816
- if( !input.data('minicolors-initialized') ) return;
817
-
818
- // Parse Hex
819
- input.val(parseHex(input.val(), true));
820
-
821
- // Is it blank?
822
- if( input.val() === '' ) input.val(parseHex(settings.defaultValue, true));
823
-
824
- // Adjust case
825
- input.val( convertCase(input.val(), settings.letterCase) );
826
-
827
- })
828
- // Handle keypresses
829
- .on('keydown.minicolors', '.minicolors-input', function(event) {
830
- var input = $(this);
831
- if( !input.data('minicolors-initialized') ) return;
832
- switch(event.keyCode) {
833
- case 9: // tab
834
- hide();
835
- break;
836
- case 27: // esc
837
- hide();
838
- input.blur();
839
- break;
840
- }
841
- })
842
- // Update on keyup
843
- .on('keyup.minicolors', '.minicolors-input', function(event) {
844
- var input = $(this);
845
- if( !input.data('minicolors-initialized') ) return;
846
- updateFromInput(input, true);
847
- })
848
- // Update on paste
849
- .on('paste.minicolors', '.minicolors-input', function(event) {
850
- var input = $(this);
851
- if( !input.data('minicolors-initialized') ) return;
852
- setTimeout( function() {
853
- updateFromInput(input, true);
854
- }, 1);
855
- });
856
-
857
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/common/js/jquery.tzCheckbox.js DELETED
@@ -1,47 +0,0 @@
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 DELETED
@@ -1,126 +0,0 @@
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 DELETED
@@ -1,336 +0,0 @@
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 DELETED
@@ -1,24 +0,0 @@
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
-
13
- jQuery("#wp_insert_form textarea.chitika").focus(function() {
14
- jQuery(this).after("<div title='Click Here to Insert Chitika Ad Code' class='chitikaButton' onclick='wpInsertChitikaPopUpHandler(\""+jQuery(this).attr('id')+"\")'></div>");
15
- jQuery(".chitikaButton").delay(100).animate({"opacity": "1"}, 500);
16
- return true;
17
- });
18
-
19
- jQuery("#wp_insert_form textarea.chitika").blur(function() {
20
- jQuery(".chitikaButton").animate({"opacity": "0"}, 500);
21
- setTimeout(function(){jQuery(".chitikaButton").remove()}, 200);
22
- return true;
23
- });
24
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/common/menu.php DELETED
@@ -1,6 +0,0 @@
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 DELETED
@@ -1,51 +0,0 @@
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?version=<?php echo WP_INSERT_VERSION; ?>" />
10
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/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?version=<?php echo WP_INSERT_VERSION; ?>"></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 wp_kses((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&hide_empty=0');
33
- $selected = null;
34
- if(isset($_GET['data'])) {
35
- $selected = explode(',', 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">'.esc_html(substr($category->name, 0, 35)).'</option>';
43
- } else {
44
- echo '<option value="'.$category->term_id.'">'.esc_html(substr($category->name, 0, 35)).'</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/chitika.php DELETED
@@ -1,177 +0,0 @@
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?version=<?php echo WP_INSERT_VERSION; ?>" />
10
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
11
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
12
- <script type="text/javascript" src="<?php echo WP_INSERT_URL; ?>/includes/common/js/jquery-jvert-tabs-1.1.4.js?version=<?php echo WP_INSERT_VERSION; ?>"></script>
13
- <script type="text/javascript" src="<?php echo WP_INSERT_URL; ?>/includes/common/js/jquery.miniColors.js?version=<?php echo WP_INSERT_VERSION; ?>"></script>
14
- <script type="text/javascript">
15
- jQuery(document).ready( function(jQuery) {
16
- jQuery("#chitikaVtabs").jVertTabs({equalHeights: false});
17
- jQuery('.minicolors').each( function() {
18
- jQuery(this).minicolors({letterCase: 'uppercase', swatchPosition: 'right', theme: 'bootstrap', position: jQuery(this).attr('data-position') || 'default',});
19
- });
20
- });
21
- function submit_popup() {
22
- var adCode = '<script type="text/javascript">\n';
23
- adCode += 'ch_client = "'+jQuery("#chitikaUserName").val()+'";\n';
24
- adCode += 'ch_width = '+jQuery("#chitikaAdFormat").children("option").filter(":selected").attr("data-width")+';\n';
25
- adCode += 'ch_height = '+jQuery("#chitikaAdFormat").children("option").filter(":selected").attr("data-height")+';\n';
26
- adCode += 'ch_type = "'+jQuery("#chitikaAdType").children("option").filter(":selected").val()+'";\n';
27
- adCode += 'ch_sid = "'+jQuery("#chitikaAdChannel").val()+'";\n';
28
- adCode += 'ch_color_site_link = "'+jQuery("#chitikaLinkColor").val()+'";\n';
29
- adCode += 'ch_color_title = "'+jQuery("#chitikaLinkColor").val()+'";\n';
30
- adCode += 'ch_color_border = "'+jQuery("#chitikaBorderColor").val()+'";\n';
31
- adCode += 'ch_color_text = "'+jQuery("#chitikaTextColor").val()+'";\n';
32
- adCode += 'ch_color_bg = "'+jQuery("#chitikaBackgroundColor").val()+'";\n';
33
- adCode += '</'+'script>\n';
34
- adCode += '<script src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"></'+'script>';
35
- parent.jQuery('#<?php echo wp_kses((string)$_GET['target'], ''); ?>').val(adCode);
36
- parent.jQuery.colorbox.close();
37
- }
38
- function validateUsername(sender) {
39
- if(sender.value != '') {
40
- jQuery("#submitButton").css("display", "inline");
41
- } else {
42
- jQuery("#submitButton").css("display", "none");
43
- }
44
- }
45
- </script>
46
- <style type="text/css">
47
- body {
48
- color: #333333;
49
- font-family: sans-serif;
50
- font-size: 12px;
51
- line-height: 1.4em;
52
- }
53
- #chitikaVtabs p {
54
- margin: 5px 0 7px !important;
55
- }
56
- a {
57
- color: #21759B;
58
- }
59
- a:hover {
60
- color: #D54E21;
61
- }
62
- label {
63
- line-height: 16.8px;
64
- vertical-align: middle;
65
- cursor: pointer;
66
- }
67
- select, input[type="text"] {
68
- width: 100%;
69
- -moz-box-sizing: border-box;
70
- outline: 0 none;
71
- border-radius: 3px 3px 3px 3px;
72
- border: 1px solid #AAAAAA;
73
- border-spacing: 0;
74
- clear: both;
75
- margin: 0;
76
- padding: 3px;
77
- box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
78
- }
79
- </style>
80
- </head>
81
- <body bgcolor="">
82
- <a href="https://chitika.com/publishers/apply.php?refid=smartlogix"><img src="<?php echo WP_INSERT_URL; ?>/includes/common/images/chitika_banner.png" style="width: 100%;" /></a>
83
- <div id="chitikaVtabs" style="height: 288px; overflow: hidden;">
84
- <div>
85
- <ul>
86
- <li><a href="#chitikaVtabUsername">Username</a></li>
87
- <li><a href="#chitikaVtabColors">Colors</a></li>
88
- <li><a href="#chitikaVtabUnitOptions">Unit Options</a></li>
89
- <li><a href="#chitikaVtabChannel">Channel</a></li>
90
- </ul>
91
- </div>
92
- <div>
93
- <div id="#chitikaVtabUsername" style="min-height: 263px;">
94
- <p>
95
- <label>Username</label>
96
- <input id="chitikaUserName" type="text" class="input widefat" onchange="validateUsername(this)" onkeyup="validateUsername(this)" />
97
- <small>It is essential that you enter the correct the username for your ads. Entering an incorrect username means you will lose any stats recorded to the changed username.</small>
98
- </p>
99
- <p>
100
- <strong>Dont have a Chitika Account? <a href="https://chitika.com/publishers/apply.php?refid=smartlogix">Click Here</a> to open an Account.</strong>
101
- </p>
102
- </div>
103
- <div id="#chitikaVtabColors" style="min-height: 263px;">
104
- <p>
105
- <label>Link</label>
106
- <input id="chitikaLinkColor" type="text" class="input widefat minicolors" value="#0000CC" />
107
- <small>Use this field to specify the color of links in your ad.</small>
108
- </p>
109
- <p>
110
- <label>Text</label>
111
- <input id="chitikaTextColor" type="text" class="input widefat minicolors" value="#000000" />
112
- <small>Use this field to specify the color of the text under your ad link.</small>
113
- </p>
114
- <p>
115
- <label>Background</label>
116
- <input id="chitikaBackgroundColor" type="text" class="input widefat minicolors" data-position="top" value="#FFFFFF" />
117
- <small>Use this field to specify the color you prefer for the background of your ad.</small>
118
- </p>
119
- <p>
120
- <label>Border</label>
121
- <input id="chitikaBorderColor" type="text" class="input widefat minicolors" data-position="top" value="#FFFFFF" />
122
- <small>Use this field to specify the color of your ad's border.</small>
123
- </p>
124
- </div>
125
- <div id="#chitikaVtabUnitOptions" style="min-height: 263px;">
126
- <p>
127
- <label>Format</label>
128
- <select id="chitikaAdFormat">
129
- <option value="550x250" data-width="550" data-height="250">550 x 250 MEGA-Unit</option>
130
- <option value="500x250" data-width="500" data-height="250">500 x 250 MEGA-Unit</option>
131
- <option value="728x90" data-width="728" data-height="90">728 x 90 Leaderboard</option>
132
- <option value="120x600" data-width="120" data-height="600">120 x 600 Skyscraper</option>
133
- <option value="160x600" data-width="160" data-height="600">160 x 600 Wide Skyscraper</option>
134
- <option value="468x250" data-width="468" data-height="250">468 x 250 *New!* MEGA-Unit Jr.</option>
135
- <option value="468x180" data-width="468" data-height="180">468 x 180 Blog Banner</option>
136
- <option value="468x120" data-width="468" data-height="120">468 x 120 Blog Banner</option>
137
- <option value="468x90" data-width="468" data-height="90">468 x 90 Small Blog Banner</option>
138
- <option value="468x60" data-width="468" data-height="60">468 x 60 Mini Blog Banner</option>
139
- <option value="550x120" data-width="550" data-height="120">550 x 120 Content Banner</option>
140
- <option value="550x90" data-width="550" data-height="90">550 x 90 Content Banner</option>
141
- <option value="450x90" data-width="450" data-height="90">450 x 90 Small Content Banner</option>
142
- <option value="430x90" data-width="430" data-height="90">430 x 90 Small Content Banner</option>
143
- <option value="400x90" data-width="400" data-height="90">400 x 90 Small Content Banner</option>
144
- <option value="300x250" data-width="300" data-height="250">300 x 250 Rectangle</option>
145
- <option value="300x150" data-width="300" data-height="150">300 x 150 Rectangle, Wide</option>
146
- <option value="300x125" data-width="300" data-height="125">300 x 125 Mini Rectangle, Wide</option>
147
- <option value="300x70" data-width="300" data-height="70">300 x 70 Mini Rectangle, Wide</option>
148
- <option value="250x250" data-width="250" data-height="250">250 x 250 Square</option>
149
- <option value="200x200" data-width="200" data-height="200">200 x 200 Small Square</option>
150
- <option value="160x160" data-width="160" data-height="160">160 x 160 Small Square</option>
151
- <option value="336x280" data-width="336" data-height="280">336 x 280 Rectangle</option>
152
- <option value="336x160" data-width="336" data-height="160">336 x 160 Rectangle, Wide</option>
153
- <option value="334x100" data-width="334" data-height="100">334 x 100 Small Rectangle, Wide</option>
154
- </select>
155
- <small>Here is where you can select the size of your ad unit.</small>
156
- </p>
157
- <p>
158
- <label>Type</label>
159
- <select id="chitikaAdType">
160
- <option selected="selected" value="mpu">Text Ad</option>
161
- <option value="mobile">Mobile Ad</option>
162
- </select>
163
- <small>Choose which type of ad unit you would like.<br /><b>Multi Purpose Unit : </b>Our regular search targeted text ads composed of thumbnail images and text.<br /><b>Mobile Unit : </b>These ads will only be visible to users on mobile devices and will 'hover' at the bottom of their screen.</small>
164
- </p>
165
- </div>
166
- <div id="#chitikaVtabChannel" style="min-height: 263px;">
167
- <p>
168
- <label>Channel <small>(Optional)</small></label>
169
- <input id="chitikaAdChannel" type="text" class="input widefat" value="Chitika Default" />
170
- <small>Create a channel to keep track of individual ad unit or website's stats.</small>
171
- </p>
172
- </div>
173
- </div>
174
- </div>
175
- <input id="submitButton" type="image" src="<?php echo WP_INSERT_URL; ?>/includes/common/images/check.png" style="float: right; margin: 2px 20px 0 0; display: none;" onclick="submit_popup()" />
176
- </body>
177
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/common/popups/countries.php DELETED
@@ -1,51 +0,0 @@
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?version=<?php echo WP_INSERT_VERSION; ?>" />
10
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
11
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
12
- <script type="text/javascript" src="<?php echo WP_INSERT_URL; ?>/includes/common/js/ui.multiselect.js?version=<?php echo WP_INSERT_VERSION; ?>"></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 wp_kses((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 = explode(',', 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 DELETED
@@ -1,62 +0,0 @@
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?version=<?php echo WP_INSERT_VERSION; ?>" />
21
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
22
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
23
- <script type="text/javascript" src="<?php echo WP_INSERT_URL; ?>/includes/common/js/ui.multiselect.js?version=<?php echo WP_INSERT_VERSION; ?>"></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 wp_kses((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 = explode(',', 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 DELETED
@@ -1,51 +0,0 @@
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?version=<?php echo WP_INSERT_VERSION; ?>" />
10
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
11
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
12
- <script type="text/javascript" src="<?php echo WP_INSERT_URL; ?>/includes/common/js/ui.multiselect.js?version=<?php echo WP_INSERT_VERSION; ?>"></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 wp_kses((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 = explode(',', 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">'.esc_html(substr($page->post_title, 0, 35)).'</option>';
43
- } else {
44
- echo '<option value="'.$page->ID.'">'.esc_html(substr($page->post_title, 0, 35)).'</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 DELETED
@@ -1,51 +0,0 @@
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?version=<?php echo WP_INSERT_VERSION; ?>" />
10
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
11
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
12
- <script type="text/javascript" src="<?php echo WP_INSERT_URL; ?>/includes/common/js/ui.multiselect.js?version=<?php echo WP_INSERT_VERSION; ?>"></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 wp_kses((string)$_GET['target'], ''); ?>').val(selectedItems.join(','));
26
- parent.jQuery.colorbox.close();
27
- }
28
- </script>
29
- </head>
30
- <body>
31
- <?php
32
- $posts = get_posts('numberposts=100');
33
- $selected = null;
34
- if(isset($_GET['data'])) {
35
- $selected = explode(',', 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">'.esc_html(substr($post->post_title, 0, 35)).'</option>';
43
- } else {
44
- echo '<option value="'.$post->ID.'">'.esc_html(substr($post->post_title, 0, 35)).'</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,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $wpInsertPostInstance;
3
+ $wpInsertABTestingMode;
4
+ /* Begin Assign Instance Identifier */
5
+ add_action('the_content', 'wp_insert_track_post_instance', 1);
6
+ function wp_insert_track_post_instance($content) {
7
+ global $wpInsertPostInstance;
8
+ if(is_main_query()) {
9
+ if($wpInsertPostInstance == '') {
10
+ $wpInsertPostInstance = 1;
11
+ } else {
12
+ $wpInsertPostInstance++;
13
+ }
14
+ }
15
+ return $content;
16
+ }
17
+ /* End Assign Instance Identifier */
18
+
19
+ /* Begin Assign AB Testing Mode */
20
+ add_action('wp', 'wp_insert_track_ad_instance', 1);
21
+ function wp_insert_track_ad_instance() {
22
+ global $wpInsertABTestingMode;
23
+ $abtestingMode = get_option('wp_insert_abtesting_mode');
24
+ if(isset($abtestingMode)) {
25
+ $wpInsertABTestingMode = rand(1, floatval($abtestingMode));
26
+ } else {
27
+ $wpInsertABTestingMode = 1;
28
+ }
29
+ }
30
+ /* End Assign AB Testing Mode */
31
+
32
+ /* Begin Get Current Page Type */
33
+ function wp_insert_get_page_details() {
34
+ global $post;
35
+ $page_details = array(
36
+ 'type' => 'POST',
37
+ 'ID' => $post->ID
38
+ );
39
+ if(is_home() || is_front_page()) {
40
+ $page_details['type'] = 'HOME';
41
+ } else if(is_category()) {
42
+ $page_details['type'] = 'CATEGORY';
43
+ $page_details['ID'] = get_query_var('cat');
44
+ } else if(is_archive()) {
45
+ $page_details['type'] = 'ARCHIVE';
46
+ } else if(is_search()) {
47
+ $page_details['type'] = 'SEARCH';
48
+ } else if(is_page()) {
49
+ $page_details['type'] = 'PAGE';
50
+ } else if(is_single()) {
51
+ if(is_singular('post')) {
52
+ $page_details['type'] = 'POST';
53
+ $page_details['categories'] = wp_get_post_categories($page_details['ID']);
54
+ } else {
55
+ $page_details['type'] = 'CUSTOM';
56
+ $page_details['type_name'] = $post->post_type;
57
+ }
58
+ }
59
+
60
+ return $page_details;
61
+ }
62
+ /* End Get Current Page Type */
63
+
64
+ /* Begin Get Ad Status */
65
+ function wp_insert_get_ad_status($rules) {
66
+ if(!isset($rules)) { return false; }
67
+
68
+ if(!$rules['status']) {
69
+ return false;
70
+ }
71
+
72
+ if(isset($rules['rules_exclude_loggedin']) && filter_var($rules['rules_exclude_loggedin'], FILTER_VALIDATE_BOOLEAN) && is_user_logged_in()) {
73
+ return false;
74
+ }
75
+
76
+ if($rules['rules_exclude_mobile_devices'] && wp_is_mobile()) {
77
+ return false;
78
+ }
79
+
80
+ global $wpInsertPostInstance;
81
+ $page_details = wp_insert_get_page_details();
82
+ switch($page_details['type']) {
83
+ case 'HOME':
84
+ if(isset($rules['rules_exclude_home']) && filter_var($rules['rules_exclude_home'], FILTER_VALIDATE_BOOLEAN)) {
85
+ return false;
86
+ } else if(isset($rules['rules_home_instances']) && is_array($rules['rules_home_instances']) && (in_array($wpInsertPostInstance, $rules['rules_home_instances']))) {
87
+ return false;
88
+ }
89
+ break;
90
+ case 'ARCHIVE':
91
+ if(isset($rules['rules_exclude_archives']) && filter_var($rules['rules_exclude_archives'], FILTER_VALIDATE_BOOLEAN)) {
92
+ return false;
93
+ } else if(isset($rules['rules_archives_instances']) && is_array($rules['rules_archives_instances']) && (in_array($wpInsertPostInstance, $rules['rules_archives_instances']))) {
94
+ return false;
95
+ }
96
+ break;
97
+ case 'SEARCH':
98
+ if(isset($rules['rules_exclude_search']) && filter_var($rules['rules_exclude_search'], FILTER_VALIDATE_BOOLEAN)) {
99
+ return false;
100
+ } else if(isset($rules['rules_search_instances']) && is_array($rules['rules_search_instances']) && (in_array($wpInsertPostInstance, $rules['rules_search_instances']))) {
101
+ return false;
102
+ }
103
+ break;
104
+ case 'PAGE':
105
+ if(isset($rules['rules_exclude_page']) && filter_var($rules['rules_exclude_page'], FILTER_VALIDATE_BOOLEAN)) {
106
+ return false;
107
+ } else if(isset($rules['rules_page_exceptions']) && is_array($rules['rules_page_exceptions']) && (in_array($page_details['ID'], $rules['rules_page_exceptions']))) {
108
+ return false;
109
+ }
110
+ break;
111
+ case 'POST':
112
+ if(isset($rules['rules_exclude_post']) && filter_var($rules['rules_exclude_post'], FILTER_VALIDATE_BOOLEAN)) {
113
+ return false;
114
+ } else if(isset($rules['rules_post_exceptions']) && is_array($rules['rules_post_exceptions']) && (in_array($page_details['ID'], $rules['rules_post_exceptions']))) {
115
+ return false;
116
+ } else if(isset($rules['rules_categories_post_exceptions']) && isset($page_details['categories']) && is_array($rules['rules_categories_post_exceptions']) && is_array($page_details['categories']) && (count(array_intersect($page_details['categories'], $rules['rules_categories_post_exceptions'])) > 0)) {
117
+ return false;
118
+ }
119
+ break;
120
+ case 'CATEGORY':
121
+ if(isset($rules['rules_exclude_categories']) && filter_var($rules['rules_exclude_categories'], FILTER_VALIDATE_BOOLEAN)) {
122
+ return false;
123
+ } else if(isset($rules['rules_categories_exceptions']) && is_array($rules['rules_categories_exceptions']) && (in_array($page_details['ID'], $rules['rules_categories_exceptions']))) {
124
+ return false;
125
+ } else if(isset($rules['rules_categories_instances']) && is_array($rules['rules_categories_instances']) && (in_array($wpInsertPostInstance, $rules['rules_categories_instances']))) {
126
+ return false;
127
+ }
128
+ break;
129
+ case 'CUSTOM':
130
+ if(isset($rules['rules_exclude_cpt_'.$page_details['type_name']]) && filter_var($rules['rules_exclude_cpt_'.$page_details['type_name']], FILTER_VALIDATE_BOOLEAN)) {
131
+ return false;
132
+ }
133
+ break;
134
+ }
135
+ return true;
136
+ }
137
+ /* End Get Ad Status */
138
+ ?>
includes/common/sanitize.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
- function wp_insert_sanitize_array($masterArray, $parameters) {
3
- if(!is_array($masterArray)) {
4
- $masterArray = array();
5
- }
6
- if(isset($masterArray) && isset($parameters) && is_array($parameters)) {
7
- foreach($parameters as $parameter) {
8
- if(!isset($masterArray[$parameter])) {
9
- $masterArray[$parameter] = '';
10
- }
11
- }
12
- }
13
- return $masterArray;
14
- }
15
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/common/status.php DELETED
@@ -1,129 +0,0 @@
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, floatval($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
- if(is_singular('post')) {
41
- $page_details['type'] = 'POST';
42
- $page_details['categories'] = wp_get_post_categories($page_details['ID']);
43
- } else {
44
- $page_details['type'] = 'CUSTOM';
45
- $page_details['type_name'] = $post->post_type;
46
- }
47
- }
48
-
49
- return $page_details;
50
- }
51
-
52
- function wp_insert_get_ad_status($rules) {
53
- if(!isset($rules)) { return false; }
54
- $rules = wp_insert_sanitize_array($rules, array('status', 'rules_exclude_loggedin', 'rules_exclude_mobile_devices', 'rules_exclude_home', 'rules_home_instances', 'rules_exclude_archives', 'rules_archives_instances', 'rules_exclude_categories', 'rules_categories_exceptions', 'rules_categories_instances', 'rules_exclude_search', 'rules_search_instances', 'rules_exclude_page', 'rules_page_exceptions', 'rules_exclude_post', 'rules_post_exceptions'));
55
-
56
- if(!$rules['status']) {
57
- return false;
58
- }
59
-
60
- if($rules['rules_exclude_loggedin']) {
61
- if(is_user_logged_in()) {
62
- return false;
63
- }
64
- }
65
-
66
- if($rules['rules_exclude_mobile_devices']) {
67
- if(wp_is_mobile()) {
68
- return false;
69
- }
70
- }
71
-
72
- global $wpInsertPostInstance;
73
- $page_details = wp_insert_get_page_details();
74
- switch($page_details['type']) {
75
- case 'HOME':
76
- if($rules['rules_exclude_home']) {
77
- return false;
78
- } else if($rules['rules_home_instances'] && (in_array($wpInsertPostInstance, explode(',', $rules['rules_home_instances'])))) {
79
- return false;
80
- }
81
- break;
82
- case 'ARCHIVE':
83
- if($rules['rules_exclude_archives']) {
84
- return false;
85
- } else if($rules['rules_archives_instances'] && (in_array($wpInsertPostInstance, explode(',', $rules['rules_archives_instances'])))) {
86
- return false;
87
- }
88
- break;
89
- case 'CATEGORY':
90
- if($rules['rules_exclude_categories']) {
91
- return false;
92
- } else if($rules['rules_categories_exceptions'] && (in_array($page_details['ID'], explode(',', $rules['rules_categories_exceptions'])))) {
93
- return false;
94
- } else if($rules['rules_categories_instances'] && (in_array($wpInsertPostInstance, explode(',', $rules['rules_categories_instances'])))) {
95
- return false;
96
- }
97
- break;
98
- case 'SEARCH':
99
- if($rules['rules_exclude_search']) {
100
- return false;
101
- } else if($rules['rules_search_instances'] && (in_array($wpInsertPostInstance, explode(',', $rules['rules_search_instances'])))) {
102
- return false;
103
- }
104
- break;
105
- case 'PAGE':
106
- if($rules['rules_exclude_page']) {
107
- return false;
108
- } else if($rules['rules_page_exceptions'] && (in_array($page_details['ID'], explode(',', $rules['rules_page_exceptions'])))) {
109
- return false;
110
- }
111
- break;
112
- case 'POST':
113
- if($rules['rules_exclude_post']) {
114
- return false;
115
- } else if($rules['rules_post_exceptions'] && (in_array($page_details['ID'], explode(',', $rules['rules_post_exceptions'])))) {
116
- return false;
117
- } else if($rules['rules_categories_post_exceptions'] && is_array($page_details['categories']) && (count(array_intersect(array_unique($page_details['categories']), array_unique(explode(',', $rules['rules_categories_post_exceptions'])))) > 0)) {
118
- return false;
119
- }
120
- break;
121
- case 'CUSTOM':
122
- if($rules['rules_exclude_cpt_'.$page_details['type_name']]) {
123
- return false;
124
- }
125
- break;
126
- }
127
- return true;
128
- }
129
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/common/styles.php DELETED
@@ -1,18 +0,0 @@
1
- <?php
2
- function wp_insert_admin_styles() {
3
- wp_enqueue_style('wp-insert-styles', WP_INSERT_URL.'/includes/common/css/style.css?version='.WP_INSERT_VERSION, 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?version='.WP_INSERT_VERSION, array('jquery'));
12
- wp_enqueue_script('better-checkboxes', WP_INSERT_URL.'/includes/common/js/jquery.tzCheckbox.js?version='.WP_INSERT_VERSION, array('jquery'));
13
- wp_enqueue_script('iphone-checkboxes', WP_INSERT_URL.'/includes/common/js/iphone-style-checkboxes.js?version='.WP_INSERT_VERSION, array('jquery'));
14
- wp_enqueue_script('jquery-vertical-tabs', WP_INSERT_URL.'/includes/common/js/jquery-jvert-tabs-1.1.4.js?version='.WP_INSERT_VERSION, array('jquery'));
15
- wp_enqueue_script('nicEdit', WP_INSERT_URL.'/includes/common/js/nicEdit-latest.js?version='.WP_INSERT_VERSION, array('jquery'));
16
- wp_enqueue_script('image-uploader', WP_INSERT_URL.'/includes/common/js/wp-insert-functions.js?version='.WP_INSERT_VERSION, array('jquery'));
17
- }
18
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/common/support.php DELETED
@@ -1,194 +0,0 @@
1
- <?php
2
- add_action('admin_init', 'wp_insert_support_admin_init');
3
- function wp_insert_support_admin_init() {
4
- if(isset($_POST['is_showcase_submission']) && ($_POST['is_showcase_submission'] == 'true')) {
5
- $data = 'site_name='.(string)$_POST['site_name'].'&site_description='.(string)$_POST['site_description'].'&site_category='.(string)$_POST['site_category'].'&site_url='.(string)$_POST['site_url'].'&admin_email='.(string)$_POST['admin_email'];
6
- try {
7
- $post_results = wp_insert_httpPost('wp-insert.smartlogix.co.in','80', '/wp-content/plugins/wp-insert-directory/request-handler.php', $data);
8
- if(($post_results != false) && (strpos($post_results, 'SUBMISSION SUCCESSFUL') !== false)) {
9
- update_option('wp_insert_showcase_submission', 'PENDING');
10
- } else {
11
- echo '<div id="message" class="error">A error occurred while submitting the request. Please try again later.</div>';
12
- }
13
- } catch(Exception $e) {
14
- echo '<div id="message" class="error">A error occurred while submitting the request. Please try again later.</div>';
15
- }
16
- }
17
- add_settings_section('wp-insert-support-top', '', 'wp_insert_support_section', 'wp-insert-support');
18
- //add_meta_box('wp_insert_facebook', 'Like Us On Facebook', 'wp_insert_facebook_content', 'wp-insert-support-top', 'advanced', 'high');
19
- add_meta_box('wp_insert_donate', 'Donate and Support Free Plugins', 'wp_insert_donate_content', 'wp-insert-support-bottom', 'advanced', 'high');
20
- add_meta_box('wp_insert_hire_me', 'Hire Me', 'wp_insert_hire_me_content', 'wp-insert-support-bottom', 'advanced', 'high');
21
- add_meta_box('wp_insert_hate_campaign', 'Ratings and Reviews', 'wp_insert_ratings_and_reviews_content', 'wp-insert-support-bottom', 'advanced', 'high');
22
- /*delete_option('wp_insert_showcase_submission');
23
- if(get_option('wp_insert_showcase_submission') != 'SUBMITTED') {
24
- add_meta_box('wp_insert_showcase', 'Showcase your Site', 'wp_insert_showcase_content', 'wp-insert-support-bottom', 'advanced', 'high');
25
- }*/
26
- }
27
-
28
- function wp_insert_support_section() {
29
- do_meta_boxes('wp-insert-support-top', 'advanced', null);
30
- echo '<p class="submit"><input type="submit" name="Submit" class="button-primary submit" value="Save Changes" /></p>';
31
- do_meta_boxes('wp-insert-support-bottom', 'advanced', null);
32
- }
33
-
34
- function wp_insert_hire_me_content() {
35
- echo '<div class="wp_insert_hireme">';
36
- echo '<a title="Hire me! on Freelancer.com" href="https://www.freelancer.com/affiliates/email/899781/" target="_blank">Namith Jawahar - Wordpress Expert</a>';
37
- echo '<p><b>Hourly : $30</b><br />Minimum Hire Period 1 Hour / $30.</p>';
38
- echo '</div>';
39
- }
40
-
41
- function wp_insert_facebook_content() {
42
- echo '<iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2FSmartLogix&amp;width=256&amp;height=258&amp;colorscheme=light&amp;show_faces=true&amp;header=false&amp;stream=false&amp;show_border=false&amp;appId=344044952413253" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:256px; height:258px;" allowTransparency="true"></iframe>';
43
- }
44
-
45
- function wp_insert_donate_content() {
46
- echo '<p style="text-align: justify; color: rgb(34, 34, 34); font-weight: bold; font-size: 13px;"><b style="text-align: center; display: block; margin: 0px 0px 5px; color: rgb(227, 25, 46); text-shadow: 1px 1px 1px rgb(34, 34, 34); text-transform: uppercase; letter-spacing: 0.5px; font-size: 16px;">Save the Plugin from Dying</b>Developing, Maintaining and Supporting a Popular Plugin requires a lot of time and effort to the tune of a few hours every day. The project is supposed to purely run on donations, yet the total amount received in Donations in the year 2014 is only $84.<br />A few bucks from you will help me spent more time on the plugin and add more amazing features. I am requesting every user of the plugin to spare a few dollars so that I can spent enough time on developing more advanced features for the plugin.</p>';
47
- //echo '<a href="http://www.wp-insert.smartlogix.co.in/support/" target="_blank"><img src="'.WP_INSERT_URL.'/includes/common/images/donate_btn.png" style="margin-top: 5px;" /></a>';
48
- //echo '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"><input type="hidden" name="cmd" value="_xclick"><input type="hidden" name="business" value="support@smartlogix.co.in"><input type="hidden" name="lc" value="IN"><input type="hidden" name="item_name" value="Wp-Insert Plugin Development Support"><input type="hidden" name="item_number" value="01234156"><input type="hidden" name="button_subtype" value="services"><input type="hidden" name="no_note" value="0"><input type="hidden" name="currency_code" value="USD"><input type="hidden" name="bn" value="PP-BuyNowBF:btn_paynowCC_LG.gif:NonHostedGuest"><input type="hidden" name="on0" value="Choose your Denomination">Choose your Denomination <select name="os0" class="input widefat"><option value="1)">1) $9.00 USD</option><option value="2)">2) $19.00 USD</option><option value="3)">3) $29.00 USD</option><option value="4)">4) $49.00 USD</option><option value="5)">5) $99.00 USD</option><option value="6)">6) $199.00 USD</option><option value="7)">7) $299.00 USD</option><option value="8)">8) $399.00 USD</option><option value="9)">9) $599.00 USD</option><option value="10)">10) $999.00 USD</option></select><input type="hidden" name="currency_code" value="USD"><input type="hidden" name="option_select0" value="1)"><input type="hidden" name="option_amount0" value="9.00"><input type="hidden" name="option_select1" value="2)"><input type="hidden" name="option_amount1" value="19.00"><input type="hidden" name="option_select2" value="3)"><input type="hidden" name="option_amount2" value="29.00"><input type="hidden" name="option_select3" value="4)"><input type="hidden" name="option_amount3" value="49.00"><input type="hidden" name="option_select4" value="5)"><input type="hidden" name="option_amount4" value="99.00"><input type="hidden" name="option_select5" value="6)"><input type="hidden" name="option_amount5" value="199.00"><input type="hidden" name="option_select6" value="7)"><input type="hidden" name="option_amount6" value="299.00"><input type="hidden" name="option_select7" value="8)"><input type="hidden" name="option_amount7" value="399.00"><input type="hidden" name="option_select8" value="9)"><input type="hidden" name="option_amount8" value="599.00"><input type="hidden" name="option_select9" value="10)"><input type="hidden" name="option_amount9" value="999.00"><input type="hidden" name="option_index" value="0"><input type="image" src="https://www.paypalobjects.com/en_GB/i/btn/btn_paynowCC_LG.gif" style="margin: 10px auto 0px; display: block;" border="0" name="submit" alt="PayPal � The safer, easier way to pay online."><img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1"></form>';
49
- echo 'Choose your Denomination';
50
- echo '<select name="os0" class="input widefat" id="support_denomination">';
51
- echo '<option value="9">1) $9.00 USD</option>';
52
- echo '<option value="19">2) $19.00 USD</option>';
53
- echo '<option value="29">3) $29.00 USD</option>';
54
- echo '<option value="49">4) $49.00 USD</option>';
55
- echo '<option value="99">5) $99.00 USD</option>';
56
- echo '<option value="199">6) $199.00 USD</option>';
57
- echo '<option value="299">7) $299.00 USD</option>';
58
- echo '<option value="399">8) $399.00 USD</option>';
59
- echo '<option value="599">9) $599.00 USD</option>';
60
- echo '<option value="999">10) $999.00 USD</option>';
61
- echo '</select>';
62
- echo '<a onclick="javascript:this.href=\'https://www.paypal.com/cgi-bin/webscr?&cmd=_xclick&business=support@smartlogix.co.in&currency_code=USD&amount=\'+jQuery(\'#support_denomination\').val()+\'&item_name=Wp-Insert Plugin Development Support\';" href="#" target="_blank">';
63
- echo '<img src="https://www.paypalobjects.com/en_GB/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" style="display: block; margin: 10px auto 0px;">';
64
- echo '</a>';
65
- }
66
-
67
- function wp_insert_ratings_and_reviews_content() {
68
- //echo '<p>Some users (most likely sponsored by some premium plugin) are spreading a Hate Campaign against Wp-Insert churning away Forum Posts and Negative reviews about the plugin on different sites.</p>';
69
- //echo '<p>Please help us defend these unscrupulous activities by writing a honest <a href="http://wordpress.org/support/view/plugin-reviews/wp-insert">review</a> about the plugin and <a href="http://wordpress.org/plugins/wp-insert">rating</a> the plugin in the Plugin Repository.</p>';
70
- //echo '<p>Most of you will think about leaving a rating or visiting the forum only when something goes wrong while thousands are using the plugin satisfactorily which unfortunately is not Reported OR Documented.</p>';
71
- echo '<p style="font-weight: bold; color: #FF0000;"">IF YOU FIND THIS PLUGIN USEFUL DO LEAVE A HONEST <a href="http://wordpress.org/plugins/wp-insert">RATING</a> AND <a href="http://wordpress.org/support/view/plugin-reviews/wp-insert">REVIEW</a> IN THE REPOSITORY AND HELP US AGAINST THE MARKETING CAMPAIGN AIMED TO TARNISH A HIGHLY USEFUL, FREE, FEATURE RICH PLUGIN.</p>';
72
- }
73
-
74
- function wp_insert_showcase_content() {
75
- if(get_option('wp_insert_showcase_submission') == 'PENDING') {
76
- echo '<div id="message" class="updated" style="margin-top: 15px;"><p>Thank you for submitting your site to the Wp-Insert user directory. You will receive a notification Email when the site is published in the Directory</p></div>';
77
- update_option('wp_insert_showcase_submission', 'SUBMITTED');
78
- } else {
79
- echo '<div id="showcaseForm">';
80
- echo '<p style="text-align: justify;">Showcase your site in the Wp-Insert User Directory and get a free backlink and targeted visitors. A screenshot of the site will be automatically generated and the site will appear in the selected category in our <a href="http://www.wp-insert.smartlogix.co.in/directory/">user directory</a> within a couple of hours.</p>';
81
- echo '<p><label for="site_url">Site URL:</label></br /><input type="text" readonly="readonly" class="widefat" id="site_url" name="site_url" value="'.get_bloginfo('url').'" /></p>';
82
- echo '<p><label for="site_name">Site Name:</label></br /><input type="text" class="widefat" id="site_name" name="site_name" value="'.get_bloginfo('name').'" /><small>Site Name will be Cropped at 40 Characters</small></p>';
83
- echo '<p><label for="site_description">Site Description</label></br /><textarea class="widefat" id="site_description" name="site_description" >'.get_bloginfo('description').'</textarea><small>Site Description will be Cropped at 300 Characters</small></p>';
84
- echo '<p><label for="site_category">Site Category</label></br />';
85
- echo '<select id="site_category" name="site_category" class="widefat">';
86
- echo '<option value="529">Accounting & Auditing</option>';
87
- echo '<option value="530">Advertising & Marketing</option>';
88
- echo '<option value="531">Antivirus & Malware</option>';
89
- echo '<option value="532">Apparel</option>';
90
- echo '<option value="533">Arts & Entertainment</option>';
91
- echo '<option value="534">Auctions</option>';
92
- echo '<option value="535">Banking</option>';
93
- echo '<option value="536">Baseball</option>';
94
- echo '<option value="537">Blogging Resources & Services</option>';
95
- echo '<option value="538">Broadcast & Network News</option>';
96
- echo '<option value="539">Business Plans & Presentations</option>';
97
- echo '<option value="540">Cartoons</option>';
98
- echo '<option value="541">Casual Games</option>';
99
- echo '<option value="542">Celebrities & Entertainment News</option>';
100
- echo '<option value="543">Classifieds</option>';
101
- echo '<option value="544">Clip Art & Animated GIFs</option>';
102
- echo '<option value="545">Computer & Video Games</option>';
103
- echo '<option value="546">Computer Hardware</option>';
104
- echo '<option value="547">Consumer Electronics</option>';
105
- echo '<option value="548">Coupons & Discount Offers</option>';
106
- echo '<option value="549">Credit Cards</option>';
107
- echo '<option value="550">Dating & Personals</option>';
108
- echo '<option value="551">Dictionaries & Encyclopedias</option>';
109
- echo '<option value="552">Directories & Listings</option>';
110
- echo '<option value="553">DVD & Video Rentals</option>';
111
- echo '<option value="554">E-Commerce Services</option>';
112
- echo '<option value="555">Email & Messaging</option>';
113
- echo '<option value="556">Entertainment Media</option>';
114
- echo '<option value="557">Fantasy Sports</option>';
115
- echo '<option value="558">Fashion & Style</option>';
116
- echo '<option value="559">File Sharing & Hosting</option>';
117
- echo '<option value="560">Flash-Based Entertainment</option>';
118
- echo '<option value="561">Freeware & Shareware</option>';
119
- echo '<option value="562">Games</option>';
120
- echo '<option value="563">General Reference</option>';
121
- echo '<option value="564">Health</option>';
122
- echo '<option value="565">Home Furnishings</option>';
123
- echo '<option value="566">Hotels & Accommodations</option>';
124
- echo '<option value="567">How-To� DIY & Expert Content</option>';
125
- echo '<option value="568">Import & Export</option>';
126
- echo '<option value="569">Internet & Telecom</option>';
127
- echo '<option value="570">Internet Clients & Browsers</option>';
128
- echo '<option value="571">Investing</option>';
129
- echo '<option value="572">ISPs</option>';
130
- echo '<option value="573">Java</option>';
131
- echo '<option value="574">Jobs</option>';
132
- echo '<option value="575">Local News</option>';
133
- echo '<option value="576">Mac OS</option>';
134
- echo '<option value="577">Mail & Package Delivery</option>';
135
- echo '<option value="578">Maps</option>';
136
- echo '<option value="579">Marketing Services</option>';
137
- echo '<option value="580">Mass Merchants & Department Stores</option>';
138
- echo '<option value="581">Merchant Services & Payment Systems</option>';
139
- echo '<option value="582">Movie Reference</option>';
140
- echo '<option value="583">Movies</option>';
141
- echo '<option value="584">Multimedia Software</option>';
142
- echo '<option value="585">Music & Audio</option>';
143
- echo '<option value="586">Music Streams & Downloads</option>';
144
- echo '<option value="5">News</option>';
145
- echo '<option value="587">Newspapers</option>';
146
- echo '<option value="588">Online Communities</option>';
147
- echo '<option value="589">Online Games</option>';
148
- echo '<option value="590">Online Journals & Personal Sites</option>';
149
- echo '<option value="591">Online Media</option>';
150
- echo '<option value="592">Online Video</option>';
151
- echo '<option value="593">Open Source</option>';
152
- echo '<option value="594">Phone Service Providers</option>';
153
- echo '<option value="595">Photo & Image Sharing</option>';
154
- echo '<option value="596">Photo & Video Sharing</option>';
155
- echo '<option value="597">Radio</option>';
156
- echo '<option value="598">Real Estate</option>';
157
- echo '<option value="599">Search Engine Optimization & Marketing</option>';
158
- echo '<option value="600">Search Engines</option>';
159
- echo '<option value="601">Service Providers</option>';
160
- echo '<option value="602">Shopping</option>';
161
- echo '<option value="603">Shopping Portals & Search Engines</option>';
162
- echo '<option value="604">Social Network Apps & Add-Ons</option>';
163
- echo '<option value="605">Social Networks</option>';
164
- echo '<option value="606">Software</option>';
165
- echo '<option value="607">Sports News</option>';
166
- echo '<option value="608">Translation Tools & Resources</option>';
167
- echo '<option value="609">Travel</option>';
168
- echo '<option value="610">TV Networks & Stations</option>';
169
- echo '<option value="611">Vehicle Shopping</option>';
170
- echo '<option value="612">Video Sharing</option>';
171
- echo '<option value="613">Voice & Video Chat</option>';
172
- echo '<option value="614">Weather</option>';
173
- echo '<option value="615">Web Apps & Online Tools</option>';
174
- echo '<option value="616">Web Design & Development</option>';
175
- echo '<option value="617">Web Hosting & Domain Registration</option>';
176
- echo '<option value="618">Web Portals</option>';
177
- echo '<option value="619">Web Services</option>';
178
- echo '<option value="620">Webcams & Virtual Tours</option>';
179
- echo '<option value="621">Windows OS</option>';
180
- echo '<option value="622">World News</option>';
181
- echo '</select>';
182
- echo '</p>';
183
- echo '<p><label for="admin_email">Admin Email</label></br /><input type="email" class="widefat" id="admin_email" name="admin_email" value="" /><br /><small style="text-align: justify; display: block">Your Email wont be shared with any third party and will only be used to sent notifications about SmartLogix Services related to WordPress. All data provided to SmartLogix is bound by our <a href="http://smartlogix.co.in/privacy-policy/">privacy policy</a></small></p>';
184
- echo '<p><input type="hidden" id="is_showcase_submission" name="is_showcase_submission" value="false" /><input type="button" class="button-secondary" value="Submit" style="float: right" onclick="showcase_submit()" /></p><div style="clear: both;"></div>';
185
- echo '<script type="text/javascript">';
186
- echo 'function showcase_submit() {';
187
- echo 'jQuery("#is_showcase_submission").val("true");';
188
- echo 'jQuery("#wp_insert_form").submit();';
189
- echo '}';
190
- echo '</script>';
191
- echo '</div>';
192
- }
193
- }
194
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/controls/assets/css/controls.css ADDED
@@ -0,0 +1,557 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .smartlogixControlsSectionWrapper {
2
+ margin: 15px 0;
3
+ padding: 5px;
4
+ border: 1px solid #DDDDDD;
5
+ border-radius: 5px;
6
+ position: relative;
7
+ }
8
+
9
+ .smartlogixControlsSectionWrapper .smartlogixControlsSectionTitle {
10
+ font-weight: bold;
11
+ position: absolute;
12
+ left: 15px;
13
+ top: -10px;
14
+ background: #FFFFFF;
15
+ padding: 0px 10px;
16
+ }
17
+
18
+ .smartlogixControlsSectionWrapper .smartlogixControlsSectionInner {
19
+ background: #EFEFEF;
20
+ margin: 10px 0;
21
+ padding: 10px;
22
+ position: relative;
23
+ }
24
+
25
+ .ipcheckbox{
26
+ background: #C8161B;
27
+ border: none;
28
+ height: 36px;
29
+ -webkit-border-radius: 18px;
30
+ border-radius: 18px;
31
+ width: 120px;
32
+ -webkit-transition: all 0.3s ease-in-out;
33
+ -moz-transition: all 0.3s ease-in-out;
34
+ -ms-transition: all 0.3s ease-in-out;
35
+ -o-transition: all 0.3s ease-in-out;
36
+ transition: all 0.3s ease-in-out;
37
+ -webkit-box-shadow: none;
38
+ box-shadow: none;
39
+ cursor: pointer;
40
+ position: relative;
41
+ display: inline-block;
42
+ }
43
+
44
+ .ipcheckbox.checked{
45
+ -webkit-box-shadow: inset 0 0 0 36px #6ddc5f;
46
+ box-shadow: inset 0 0 0 36px #6ddc5f;
47
+ }
48
+
49
+ .ipcheckbox.checked .handle{
50
+ left: 87px;
51
+ }
52
+
53
+ .ipcheckbox .handle{
54
+ width: 30px;
55
+ height: 30px;
56
+ position: absolute;
57
+ top: 3px;
58
+ left: 3px;
59
+ -webkit-border-radius: 100%;
60
+ border-radius: 100%;
61
+ background: white;
62
+ -webkit-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
63
+ -moz-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
64
+ -o-transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
65
+ transition: all 350ms cubic-bezier(0, 0.89, 0.44, 1);
66
+ -webkit-box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2),0 3px 4px 0 rgba(0,0,0,0.1);
67
+ box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2),0 3px 4px 0 rgba(0,0,0,0.1);
68
+ }
69
+
70
+ .chosen-container {
71
+ position: relative;
72
+ display: inline-block;
73
+ vertical-align: middle;
74
+ font-size: 13px;
75
+ zoom: 1;
76
+ *display: inline;
77
+ -webkit-user-select: none;
78
+ -moz-user-select: none;
79
+ user-select: none;
80
+ }
81
+
82
+ .chosen-container * {
83
+ -webkit-box-sizing: border-box;
84
+ -moz-box-sizing: border-box;
85
+ box-sizing: border-box;
86
+ }
87
+
88
+ .chosen-container .chosen-drop {
89
+ display: block;
90
+ height: 241px;
91
+ width: 100%;
92
+ border: 1px solid #aaa;
93
+ border-top: 0;
94
+ background: #fff;
95
+ box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
96
+ }
97
+
98
+ .chosen-container.chosen-with-drop .chosen-drop {
99
+ left: 0;
100
+ }
101
+
102
+ .chosen-container a {
103
+ cursor: pointer;
104
+ }
105
+
106
+ .chosen-container .search-choice .group-name,
107
+ .chosen-container .chosen-single .group-name {
108
+ margin-right: 4px;
109
+ overflow: hidden;
110
+ white-space: nowrap;
111
+ text-overflow: ellipsis;
112
+ font-weight: normal;
113
+ color: #999999;
114
+ }
115
+
116
+ .chosen-container .search-choice .group-name:after,
117
+ .chosen-container .chosen-single .group-name:after {
118
+ content: ":";
119
+ padding-left: 2px;
120
+ vertical-align: top;
121
+ }
122
+
123
+ .chosen-container-single .chosen-single {
124
+ position: relative;
125
+ display: block;
126
+ overflow: hidden;
127
+ padding: 0 0 0 8px;
128
+ height: 25px;
129
+ border: 1px solid #aaa;
130
+ border-radius: 5px;
131
+ background-color: #fff;
132
+ background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
133
+ background: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
134
+ background: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
135
+ background: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
136
+ background: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
137
+ background-clip: padding-box;
138
+ box-shadow: 0 0 3px white inset, 0 1px 1px rgba(0, 0, 0, 0.1);
139
+ color: #444;
140
+ text-decoration: none;
141
+ white-space: nowrap;
142
+ line-height: 24px;
143
+ }
144
+
145
+ .chosen-container-single .chosen-default {
146
+ color: #999;
147
+ }
148
+
149
+ .chosen-container-single .chosen-single span {
150
+ display: block;
151
+ overflow: hidden;
152
+ margin-right: 26px;
153
+ text-overflow: ellipsis;
154
+ white-space: nowrap;
155
+ }
156
+
157
+ .chosen-container-single .chosen-single-with-deselect span {
158
+ margin-right: 38px;
159
+ }
160
+
161
+ .chosen-container-single .chosen-single abbr {
162
+ position: absolute;
163
+ top: 6px;
164
+ right: 26px;
165
+ display: block;
166
+ width: 12px;
167
+ height: 12px;
168
+ background: url('../images/chosen-sprite.png') -42px 1px no-repeat;
169
+ font-size: 1px;
170
+ }
171
+
172
+ .chosen-container-single .chosen-single abbr:hover {
173
+ background-position: -42px -10px;
174
+ }
175
+
176
+ .chosen-container-single.chosen-disabled .chosen-single abbr:hover {
177
+ background-position: -42px -10px;
178
+ }
179
+
180
+ .chosen-container-single .chosen-single div {
181
+ position: absolute;
182
+ top: 0;
183
+ right: 0;
184
+ display: block;
185
+ width: 18px;
186
+ height: 100%;
187
+ }
188
+
189
+ .chosen-container-single .chosen-single div b {
190
+ display: block;
191
+ width: 100%;
192
+ height: 100%;
193
+ background: url('../images/chosen-sprite.png') no-repeat 0px 2px;
194
+ }
195
+
196
+ .chosen-container-single .chosen-search {
197
+ position: relative;
198
+ z-index: 1010;
199
+ margin: 0;
200
+ padding: 3px 4px;
201
+ white-space: nowrap;
202
+ }
203
+
204
+ .chosen-container-single .chosen-search input[type="text"] {
205
+ margin: 1px 0;
206
+ padding: 4px 20px 4px 5px;
207
+ width: 100%;
208
+ height: auto;
209
+ outline: 0;
210
+ border: 1px solid #aaa;
211
+ background: white url('../images/chosen-sprite.png') no-repeat 100% -20px;
212
+ background: url('../images/chosen-sprite.png') no-repeat 100% -20px;
213
+ font-size: 1em;
214
+ font-family: sans-serif;
215
+ line-height: normal;
216
+ border-radius: 0;
217
+ }
218
+
219
+ .chosen-container-single .chosen-drop {
220
+ margin-top: -1px;
221
+ border-radius: 0 0 4px 4px;
222
+ background-clip: padding-box;
223
+ }
224
+
225
+ .chosen-container-single.chosen-container-single-nosearch .chosen-search {
226
+ position: absolute;
227
+ left: -9999px;
228
+ }
229
+
230
+ .chosen-container .chosen-results {
231
+ color: #444;
232
+ position: relative;
233
+ overflow-x: hidden;
234
+ overflow-y: auto;
235
+ margin: 0 4px 4px 0;
236
+ padding: 0 0 0 4px;
237
+ max-height: 240px;
238
+ -webkit-overflow-scrolling: touch;
239
+ }
240
+
241
+ .chosen-container .chosen-results li {
242
+ display: none;
243
+ margin: 0;
244
+ padding: 5px 6px;
245
+ list-style: none;
246
+ line-height: 15px;
247
+ word-wrap: break-word;
248
+ -webkit-touch-callout: none;
249
+ }
250
+
251
+ .chosen-container .chosen-results li.active-result {
252
+ display: list-item;
253
+ cursor: pointer;
254
+ }
255
+
256
+ .chosen-container .chosen-results li.disabled-result {
257
+ display: list-item;
258
+ color: #ccc;
259
+ cursor: default;
260
+ }
261
+
262
+ .chosen-container .chosen-results li.highlighted {
263
+ background-color: #3875d7;
264
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
265
+ background-image: -webkit-linear-gradient(#3875d7 20%, #2a62bc 90%);
266
+ background-image: -moz-linear-gradient(#3875d7 20%, #2a62bc 90%);
267
+ background-image: -o-linear-gradient(#3875d7 20%, #2a62bc 90%);
268
+ background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
269
+ color: #fff;
270
+ }
271
+
272
+ .chosen-container .chosen-results li.no-results {
273
+ color: #777;
274
+ display: list-item;
275
+ background: #f4f4f4;
276
+ }
277
+
278
+ .chosen-container .chosen-results li.group-result {
279
+ display: list-item;
280
+ font-weight: bold;
281
+ cursor: default;
282
+ }
283
+
284
+ .chosen-container .chosen-results li.group-option {
285
+ padding-left: 15px;
286
+ }
287
+
288
+ .chosen-container .chosen-results li em {
289
+ font-style: normal;
290
+ text-decoration: underline;
291
+ }
292
+
293
+ .chosen-container-multi .chosen-choices {
294
+ position: relative;
295
+ overflow: hidden;
296
+ margin: 0;
297
+ padding: 0 5px;
298
+ width: 100%;
299
+ height: auto !important;
300
+ height: 1%;
301
+ border: 1px solid #aaa;
302
+ background-color: #fff;
303
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
304
+ background-image: -webkit-linear-gradient(#eeeeee 1%, #ffffff 15%);
305
+ background-image: -moz-linear-gradient(#eeeeee 1%, #ffffff 15%);
306
+ background-image: -o-linear-gradient(#eeeeee 1%, #ffffff 15%);
307
+ background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
308
+ cursor: text;
309
+ }
310
+
311
+ .chosen-container-multi .chosen-choices li {
312
+ float: left;
313
+ list-style: none;
314
+ }
315
+
316
+ .chosen-container-multi .chosen-choices li.search-field {
317
+ margin: 0;
318
+ padding: 0;
319
+ white-space: nowrap;
320
+ }
321
+
322
+ .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
323
+ margin: 1px 0;
324
+ padding: 0;
325
+ height: 25px;
326
+ outline: 0;
327
+ border: 0 !important;
328
+ background: transparent !important;
329
+ box-shadow: none;
330
+ color: #999;
331
+ font-size: 100%;
332
+ font-family: sans-serif;
333
+ line-height: normal;
334
+ border-radius: 0;
335
+ }
336
+
337
+ .chosen-container-multi .chosen-choices li.search-choice {
338
+ position: relative;
339
+ margin: 3px 5px 3px 0;
340
+ padding: 3px 20px 3px 5px;
341
+ border: 1px solid #aaa;
342
+ max-width: 100%;
343
+ border-radius: 3px;
344
+ background-color: #eeeeee;
345
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
346
+ background-image: -webkit-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
347
+ background-image: -moz-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
348
+ background-image: -o-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
349
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
350
+ background-size: 100% 19px;
351
+ background-repeat: repeat-x;
352
+ background-clip: padding-box;
353
+ box-shadow: 0 0 2px white inset, 0 1px 0 rgba(0, 0, 0, 0.05);
354
+ color: #333;
355
+ line-height: 13px;
356
+ cursor: default;
357
+ }
358
+
359
+ .chosen-container-multi .chosen-choices li.search-choice span {
360
+ word-wrap: break-word;
361
+ }
362
+
363
+ .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
364
+ position: absolute;
365
+ top: 4px;
366
+ right: 3px;
367
+ display: block;
368
+ width: 12px;
369
+ height: 12px;
370
+ background: url('../images/chosen-sprite.png') -42px 1px no-repeat;
371
+ font-size: 1px;
372
+ }
373
+
374
+ .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
375
+ background-position: -42px -10px;
376
+ }
377
+
378
+ .chosen-container-multi .chosen-choices li.search-choice-disabled {
379
+ padding-right: 5px;
380
+ border: 1px solid #ccc;
381
+ background-color: #e4e4e4;
382
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
383
+ background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
384
+ background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
385
+ background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
386
+ background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
387
+ color: #666;
388
+ }
389
+
390
+ .chosen-container-multi .chosen-choices li.search-choice-focus {
391
+ background: #d4d4d4;
392
+ }
393
+
394
+ .chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close {
395
+ background-position: -42px -10px;
396
+ }
397
+
398
+ .chosen-container-multi .chosen-results {
399
+ margin: 0;
400
+ padding: 0;
401
+ }
402
+
403
+ .chosen-container-multi .chosen-drop .result-selected {
404
+ display: list-item;
405
+ color: #ccc;
406
+ cursor: default;
407
+ }
408
+
409
+ .chosen-container-active .chosen-single {
410
+ border: 1px solid #5897fb;
411
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
412
+ }
413
+
414
+ .chosen-container-active.chosen-with-drop .chosen-single {
415
+ border: 1px solid #aaa;
416
+ -moz-border-radius-bottomright: 0;
417
+ border-bottom-right-radius: 0;
418
+ -moz-border-radius-bottomleft: 0;
419
+ border-bottom-left-radius: 0;
420
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
421
+ background-image: -webkit-linear-gradient(#eeeeee 20%, #ffffff 80%);
422
+ background-image: -moz-linear-gradient(#eeeeee 20%, #ffffff 80%);
423
+ background-image: -o-linear-gradient(#eeeeee 20%, #ffffff 80%);
424
+ background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
425
+ box-shadow: 0 1px 0 #fff inset;
426
+ }
427
+
428
+ .chosen-container-active.chosen-with-drop .chosen-single div {
429
+ border-left: none;
430
+ background: transparent;
431
+ }
432
+
433
+ .chosen-container-active.chosen-with-drop .chosen-single div b {
434
+ background-position: -18px 2px;
435
+ }
436
+
437
+ .chosen-container-active .chosen-choices {
438
+ border: 1px solid #5897fb;
439
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
440
+ }
441
+
442
+ .chosen-container-active .chosen-choices li.search-field input[type="text"] {
443
+ color: #222 !important;
444
+ }
445
+
446
+ .chosen-disabled {
447
+ opacity: 0.5 !important;
448
+ cursor: default;
449
+ }
450
+
451
+ .chosen-disabled .chosen-single {
452
+ cursor: default;
453
+ }
454
+
455
+ .chosen-disabled .chosen-choices .search-choice .search-choice-close {
456
+ cursor: default;
457
+ }
458
+
459
+ .chosen-rtl {
460
+ text-align: right;
461
+ }
462
+
463
+ .chosen-rtl .chosen-single {
464
+ overflow: visible;
465
+ padding: 0 8px 0 0;
466
+ }
467
+
468
+ .chosen-rtl .chosen-single span {
469
+ margin-right: 0;
470
+ margin-left: 26px;
471
+ direction: rtl;
472
+ }
473
+
474
+ .chosen-rtl .chosen-single-with-deselect span {
475
+ margin-left: 38px;
476
+ }
477
+
478
+ .chosen-rtl .chosen-single div {
479
+ right: auto;
480
+ left: 3px;
481
+ }
482
+
483
+ .chosen-rtl .chosen-single abbr {
484
+ right: auto;
485
+ left: 26px;
486
+ }
487
+
488
+ .chosen-rtl .chosen-choices li {
489
+ float: right;
490
+ }
491
+
492
+ .chosen-rtl .chosen-choices li.search-field input[type="text"] {
493
+ direction: rtl;
494
+ }
495
+
496
+ .chosen-rtl .chosen-choices li.search-choice {
497
+ margin: 3px 5px 3px 0;
498
+ padding: 3px 5px 3px 19px;
499
+ }
500
+
501
+ .chosen-rtl .chosen-choices li.search-choice .search-choice-close {
502
+ right: auto;
503
+ left: 4px;
504
+ }
505
+
506
+ .chosen-rtl.chosen-container-single-nosearch .chosen-search,
507
+ .chosen-rtl .chosen-drop {
508
+ left: 9999px;
509
+ }
510
+
511
+ .chosen-rtl.chosen-container-single .chosen-results {
512
+ margin: 0 0 4px 4px;
513
+ padding: 0 4px 0 0;
514
+ }
515
+
516
+ .chosen-rtl .chosen-results li.group-option {
517
+ padding-right: 15px;
518
+ padding-left: 0;
519
+ }
520
+
521
+ .chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
522
+ border-right: none;
523
+ }
524
+
525
+ .chosen-rtl .chosen-search input[type="text"] {
526
+ padding: 4px 5px 4px 20px;
527
+ background: white url('../images/chosen-sprite.png') no-repeat -30px -20px;
528
+ background: url('../images/chosen-sprite.png') no-repeat -30px -20px;
529
+ direction: rtl;
530
+ }
531
+
532
+ .chosen-rtl.chosen-container-single .chosen-single div b {
533
+ background-position: 6px 2px;
534
+ }
535
+
536
+ .chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b {
537
+ background-position: -12px 2px;
538
+ }
539
+
540
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
541
+ only screen and (min-resolution: 144dpi),
542
+ only screen and (min-resolution: 1.5dppx) {
543
+ .chosen-rtl .chosen-search input[type="text"],
544
+ .chosen-container-single .chosen-single abbr,
545
+ .chosen-container-single .chosen-single div b,
546
+ .chosen-container-single .chosen-search input[type="text"],
547
+ .chosen-container-multi .chosen-choices .search-choice .search-choice-close,
548
+ .chosen-container .chosen-results-scroll-down span,
549
+ .chosen-container .chosen-results-scroll-up span {
550
+ background-image: url('../images/chosen-sprite@2x.png') !important;
551
+ background-size: 52px 37px !important;
552
+ background-repeat: no-repeat !important;
553
+ }
554
+
555
+ }
556
+
557
+ /* @end */
includes/controls/assets/images/chosen-sprite.png ADDED
Binary file
includes/controls/assets/images/chosen-sprite@2x.png ADDED
Binary file
includes/controls/assets/js/controls.js ADDED
@@ -0,0 +1,1270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Begin ipCheckbox */
2
+ (function($){
3
+ $.fn.extend({
4
+ ipCheckbox: function () {
5
+ $(this).each(function (){
6
+ var sourceCheckbox = $(this);
7
+ var ipcheckbox = jQuery("<div>",{class: 'ipcheckbox'}).append(jQuery("<div>",{class: 'handle'}));
8
+ if(sourceCheckbox.is(":checked")){ ipcheckbox.addClass("checked"); }
9
+ sourceCheckbox.hide().after(ipcheckbox);
10
+ ipcheckbox.click(function (){
11
+ ipcheckbox.toggleClass("checked");
12
+ if (ipcheckbox.hasClass("checked")){
13
+ sourceCheckbox.prop('checked', true);
14
+ }else{
15
+ sourceCheckbox.prop('checked', false);
16
+ }
17
+ });
18
+ });
19
+ }
20
+ });
21
+ })(jQuery);
22
+ /* End ipCheckbox */
23
+
24
+ /* Begin Chosen Selectbox */
25
+ (function() {
26
+ var $, AbstractChosen, Chosen, SelectParser, _ref,
27
+ __hasProp = {}.hasOwnProperty,
28
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
29
+
30
+ SelectParser = (function() {
31
+ function SelectParser() {
32
+ this.options_index = 0;
33
+ this.parsed = [];
34
+ }
35
+
36
+ SelectParser.prototype.add_node = function(child) {
37
+ if (child.nodeName.toUpperCase() === "OPTGROUP") {
38
+ return this.add_group(child);
39
+ } else {
40
+ return this.add_option(child);
41
+ }
42
+ };
43
+
44
+ SelectParser.prototype.add_group = function(group) {
45
+ var group_position, option, _i, _len, _ref, _results;
46
+ group_position = this.parsed.length;
47
+ this.parsed.push({
48
+ array_index: group_position,
49
+ group: true,
50
+ label: this.escapeExpression(group.label),
51
+ title: group.title ? group.title : void 0,
52
+ children: 0,
53
+ disabled: group.disabled,
54
+ classes: group.className
55
+ });
56
+ _ref = group.childNodes;
57
+ _results = [];
58
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
59
+ option = _ref[_i];
60
+ _results.push(this.add_option(option, group_position, group.disabled));
61
+ }
62
+ return _results;
63
+ };
64
+
65
+ SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
66
+ if (option.nodeName.toUpperCase() === "OPTION") {
67
+ if (option.text !== "") {
68
+ if (group_position != null) {
69
+ this.parsed[group_position].children += 1;
70
+ }
71
+ this.parsed.push({
72
+ array_index: this.parsed.length,
73
+ options_index: this.options_index,
74
+ value: option.value,
75
+ text: option.text,
76
+ html: option.innerHTML,
77
+ title: option.title ? option.title : void 0,
78
+ selected: option.selected,
79
+ disabled: group_disabled === true ? group_disabled : option.disabled,
80
+ group_array_index: group_position,
81
+ group_label: group_position != null ? this.parsed[group_position].label : null,
82
+ classes: option.className,
83
+ style: option.style.cssText
84
+ });
85
+ } else {
86
+ this.parsed.push({
87
+ array_index: this.parsed.length,
88
+ options_index: this.options_index,
89
+ empty: true
90
+ });
91
+ }
92
+ return this.options_index += 1;
93
+ }
94
+ };
95
+
96
+ SelectParser.prototype.escapeExpression = function(text) {
97
+ var map, unsafe_chars;
98
+ if ((text == null) || text === false) {
99
+ return "";
100
+ }
101
+ if (!/[\&\<\>\"\'\`]/.test(text)) {
102
+ return text;
103
+ }
104
+ map = {
105
+ "<": "&lt;",
106
+ ">": "&gt;",
107
+ '"': "&quot;",
108
+ "'": "&#x27;",
109
+ "`": "&#x60;"
110
+ };
111
+ unsafe_chars = /&(?!\w+;)|[\<\>\"\'\`]/g;
112
+ return text.replace(unsafe_chars, function(chr) {
113
+ return map[chr] || "&amp;";
114
+ });
115
+ };
116
+
117
+ return SelectParser;
118
+
119
+ })();
120
+
121
+ SelectParser.select_to_array = function(select) {
122
+ var child, parser, _i, _len, _ref;
123
+ parser = new SelectParser();
124
+ _ref = select.childNodes;
125
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
126
+ child = _ref[_i];
127
+ parser.add_node(child);
128
+ }
129
+ return parser.parsed;
130
+ };
131
+
132
+ AbstractChosen = (function() {
133
+ function AbstractChosen(form_field, options) {
134
+ this.form_field = form_field;
135
+ this.options = options != null ? options : {};
136
+ if (!AbstractChosen.browser_is_supported()) {
137
+ return;
138
+ }
139
+ this.is_multiple = this.form_field.multiple;
140
+ this.set_default_text();
141
+ this.set_default_values();
142
+ this.setup();
143
+ this.set_up_html();
144
+ this.register_observers();
145
+ this.on_ready();
146
+ }
147
+
148
+ AbstractChosen.prototype.set_default_values = function() {
149
+ var _this = this;
150
+ this.click_test_action = function(evt) {
151
+ return _this.test_active_click(evt);
152
+ };
153
+ this.activate_action = function(evt) {
154
+ return _this.activate_field(evt);
155
+ };
156
+ this.active_field = false;
157
+ this.mouse_on_container = false;
158
+ this.results_showing = false;
159
+ this.result_highlighted = null;
160
+ this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
161
+ this.disable_search_threshold = this.options.disable_search_threshold || 0;
162
+ this.disable_search = this.options.disable_search || false;
163
+ this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
164
+ this.group_search = this.options.group_search != null ? this.options.group_search : true;
165
+ this.search_contains = this.options.search_contains || false;
166
+ this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
167
+ this.max_selected_options = this.options.max_selected_options || Infinity;
168
+ this.inherit_select_classes = this.options.inherit_select_classes || false;
169
+ this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
170
+ this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
171
+ return this.include_group_label_in_selected = this.options.include_group_label_in_selected || false;
172
+ };
173
+
174
+ AbstractChosen.prototype.set_default_text = function() {
175
+ if (this.form_field.getAttribute("data-placeholder")) {
176
+ this.default_text = this.form_field.getAttribute("data-placeholder");
177
+ } else if (this.is_multiple) {
178
+ this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;
179
+ } else {
180
+ this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
181
+ }
182
+ return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
183
+ };
184
+
185
+ AbstractChosen.prototype.choice_label = function(item) {
186
+ if (this.include_group_label_in_selected && (item.group_label != null)) {
187
+ return "<b class='group-name'>" + item.group_label + "</b>" + item.html;
188
+ } else {
189
+ return item.html;
190
+ }
191
+ };
192
+
193
+ AbstractChosen.prototype.mouse_enter = function() {
194
+ return this.mouse_on_container = true;
195
+ };
196
+
197
+ AbstractChosen.prototype.mouse_leave = function() {
198
+ return this.mouse_on_container = false;
199
+ };
200
+
201
+ AbstractChosen.prototype.input_focus = function(evt) {
202
+ var _this = this;
203
+ if (this.is_multiple) {
204
+ if (!this.active_field) {
205
+ return setTimeout((function() {
206
+ return _this.container_mousedown();
207
+ }), 50);
208
+ }
209
+ } else {
210
+ if (!this.active_field) {
211
+ return this.activate_field();
212
+ }
213
+ }
214
+ };
215
+
216
+ AbstractChosen.prototype.input_blur = function(evt) {
217
+ var _this = this;
218
+ if (!this.mouse_on_container) {
219
+ this.active_field = false;
220
+ return setTimeout((function() {
221
+ return _this.blur_test();
222
+ }), 100);
223
+ }
224
+ };
225
+
226
+ AbstractChosen.prototype.results_option_build = function(options) {
227
+ var content, data, _i, _len, _ref;
228
+ content = '';
229
+ _ref = this.results_data;
230
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
231
+ data = _ref[_i];
232
+ if (data.group) {
233
+ content += this.result_add_group(data);
234
+ } else {
235
+ content += this.result_add_option(data);
236
+ }
237
+ if (options != null ? options.first : void 0) {
238
+ if (data.selected && this.is_multiple) {
239
+ this.choice_build(data);
240
+ } else if (data.selected && !this.is_multiple) {
241
+ this.single_set_selected_text(this.choice_label(data));
242
+ }
243
+ }
244
+ }
245
+ return content;
246
+ };
247
+
248
+ AbstractChosen.prototype.result_add_option = function(option) {
249
+ var classes, option_el;
250
+ if (!option.search_match) {
251
+ return '';
252
+ }
253
+ if (!this.include_option_in_results(option)) {
254
+ return '';
255
+ }
256
+ classes = [];
257
+ if (!option.disabled && !(option.selected && this.is_multiple)) {
258
+ classes.push("active-result");
259
+ }
260
+ if (option.disabled && !(option.selected && this.is_multiple)) {
261
+ classes.push("disabled-result");
262
+ }
263
+ if (option.selected) {
264
+ classes.push("result-selected");
265
+ }
266
+ if (option.group_array_index != null) {
267
+ classes.push("group-option");
268
+ }
269
+ if (option.classes !== "") {
270
+ classes.push(option.classes);
271
+ }
272
+ option_el = document.createElement("li");
273
+ option_el.className = classes.join(" ");
274
+ option_el.style.cssText = option.style;
275
+ option_el.setAttribute("data-option-array-index", option.array_index);
276
+ option_el.innerHTML = option.search_text;
277
+ if (option.title) {
278
+ option_el.title = option.title;
279
+ }
280
+ return this.outerHTML(option_el);
281
+ };
282
+
283
+ AbstractChosen.prototype.result_add_group = function(group) {
284
+ var classes, group_el;
285
+ if (!(group.search_match || group.group_match)) {
286
+ return '';
287
+ }
288
+ if (!(group.active_options > 0)) {
289
+ return '';
290
+ }
291
+ classes = [];
292
+ classes.push("group-result");
293
+ if (group.classes) {
294
+ classes.push(group.classes);
295
+ }
296
+ group_el = document.createElement("li");
297
+ group_el.className = classes.join(" ");
298
+ group_el.innerHTML = group.search_text;
299
+ if (group.title) {
300
+ group_el.title = group.title;
301
+ }
302
+ return this.outerHTML(group_el);
303
+ };
304
+
305
+ AbstractChosen.prototype.results_update_field = function() {
306
+ this.set_default_text();
307
+ if (!this.is_multiple) {
308
+ this.results_reset_cleanup();
309
+ }
310
+ this.result_clear_highlight();
311
+ this.results_build();
312
+ if (this.results_showing) {
313
+ return this.winnow_results();
314
+ }
315
+ };
316
+
317
+ AbstractChosen.prototype.reset_single_select_options = function() {
318
+ var result, _i, _len, _ref, _results;
319
+ _ref = this.results_data;
320
+ _results = [];
321
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
322
+ result = _ref[_i];
323
+ if (result.selected) {
324
+ _results.push(result.selected = false);
325
+ } else {
326
+ _results.push(void 0);
327
+ }
328
+ }
329
+ return _results;
330
+ };
331
+
332
+ AbstractChosen.prototype.results_toggle = function() {
333
+ if (this.results_showing) {
334
+ return this.results_hide();
335
+ } else {
336
+ return this.results_show();
337
+ }
338
+ };
339
+
340
+ AbstractChosen.prototype.results_search = function(evt) {
341
+ if (this.results_showing) {
342
+ return this.winnow_results();
343
+ } else {
344
+ return this.results_show();
345
+ }
346
+ };
347
+
348
+ AbstractChosen.prototype.winnow_results = function() {
349
+ var escapedSearchText, option, regex, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref;
350
+ this.no_results_clear();
351
+ results = 0;
352
+ searchText = this.get_search_text();
353
+ escapedSearchText = searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
354
+ zregex = new RegExp(escapedSearchText, 'i');
355
+ regex = this.get_search_regex(escapedSearchText);
356
+ _ref = this.results_data;
357
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
358
+ option = _ref[_i];
359
+ option.search_match = false;
360
+ results_group = null;
361
+ if (this.include_option_in_results(option)) {
362
+ if (option.group) {
363
+ option.group_match = false;
364
+ option.active_options = 0;
365
+ }
366
+ if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {
367
+ results_group = this.results_data[option.group_array_index];
368
+ if (results_group.active_options === 0 && results_group.search_match) {
369
+ results += 1;
370
+ }
371
+ results_group.active_options += 1;
372
+ }
373
+ option.search_text = option.group ? option.label : option.html;
374
+ if (!(option.group && !this.group_search)) {
375
+ option.search_match = this.search_string_match(option.search_text, regex);
376
+ if (option.search_match && !option.group) {
377
+ results += 1;
378
+ }
379
+ if (option.search_match) {
380
+ if (searchText.length) {
381
+ startpos = option.search_text.search(zregex);
382
+ text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
383
+ option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
384
+ }
385
+ if (results_group != null) {
386
+ results_group.group_match = true;
387
+ }
388
+ } else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
389
+ option.search_match = true;
390
+ }
391
+ }
392
+ }
393
+ }
394
+ this.result_clear_highlight();
395
+ if (results < 1 && searchText.length) {
396
+ this.update_results_content("");
397
+ return this.no_results(searchText);
398
+ } else {
399
+ this.update_results_content(this.results_option_build());
400
+ return this.winnow_results_set_highlight();
401
+ }
402
+ };
403
+
404
+ AbstractChosen.prototype.get_search_regex = function(escaped_search_string) {
405
+ var regex_anchor;
406
+ regex_anchor = this.search_contains ? "" : "^";
407
+ return new RegExp(regex_anchor + escaped_search_string, 'i');
408
+ };
409
+
410
+ AbstractChosen.prototype.search_string_match = function(search_string, regex) {
411
+ var part, parts, _i, _len;
412
+ if (regex.test(search_string)) {
413
+ return true;
414
+ } else if (this.enable_split_word_search && (search_string.indexOf(" ") >= 0 || search_string.indexOf("[") === 0)) {
415
+ parts = search_string.replace(/\[|\]/g, "").split(" ");
416
+ if (parts.length) {
417
+ for (_i = 0, _len = parts.length; _i < _len; _i++) {
418
+ part = parts[_i];
419
+ if (regex.test(part)) {
420
+ return true;
421
+ }
422
+ }
423
+ }
424
+ }
425
+ };
426
+
427
+ AbstractChosen.prototype.choices_count = function() {
428
+ var option, _i, _len, _ref;
429
+ if (this.selected_option_count != null) {
430
+ return this.selected_option_count;
431
+ }
432
+ this.selected_option_count = 0;
433
+ _ref = this.form_field.options;
434
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
435
+ option = _ref[_i];
436
+ if (option.selected) {
437
+ this.selected_option_count += 1;
438
+ }
439
+ }
440
+ return this.selected_option_count;
441
+ };
442
+
443
+ AbstractChosen.prototype.choices_click = function(evt) {
444
+ evt.preventDefault();
445
+ if (!(this.results_showing || this.is_disabled)) {
446
+ return this.results_show();
447
+ }
448
+ };
449
+
450
+ AbstractChosen.prototype.keyup_checker = function(evt) {
451
+ var stroke, _ref;
452
+ stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
453
+ this.search_field_scale();
454
+ switch (stroke) {
455
+ case 8:
456
+ if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
457
+ return this.keydown_backstroke();
458
+ } else if (!this.pending_backstroke) {
459
+ this.result_clear_highlight();
460
+ return this.results_search();
461
+ }
462
+ break;
463
+ case 13:
464
+ evt.preventDefault();
465
+ if (this.results_showing) {
466
+ return this.result_select(evt);
467
+ }
468
+ break;
469
+ case 27:
470
+ if (this.results_showing) {
471
+ this.results_hide();
472
+ }
473
+ return true;
474
+ case 9:
475
+ case 38:
476
+ case 40:
477
+ case 16:
478
+ case 91:
479
+ case 17:
480
+ break;
481
+ default:
482
+ return this.results_search();
483
+ }
484
+ };
485
+
486
+ AbstractChosen.prototype.clipboard_event_checker = function(evt) {
487
+ var _this = this;
488
+ return setTimeout((function() {
489
+ return _this.results_search();
490
+ }), 50);
491
+ };
492
+
493
+ AbstractChosen.prototype.container_width = function() {
494
+ if (this.options.width != null) {
495
+ return this.options.width;
496
+ } else {
497
+ return "" + this.form_field.offsetWidth + "px";
498
+ }
499
+ };
500
+
501
+ AbstractChosen.prototype.include_option_in_results = function(option) {
502
+ if (this.is_multiple && (!this.display_selected_options && option.selected)) {
503
+ return false;
504
+ }
505
+ if (!this.display_disabled_options && option.disabled) {
506
+ return false;
507
+ }
508
+ if (option.empty) {
509
+ return false;
510
+ }
511
+ return true;
512
+ };
513
+
514
+ AbstractChosen.prototype.search_results_touchstart = function(evt) {
515
+ this.touch_started = true;
516
+ return this.search_results_mouseover(evt);
517
+ };
518
+
519
+ AbstractChosen.prototype.search_results_touchmove = function(evt) {
520
+ this.touch_started = false;
521
+ return this.search_results_mouseout(evt);
522
+ };
523
+
524
+ AbstractChosen.prototype.search_results_touchend = function(evt) {
525
+ if (this.touch_started) {
526
+ return this.search_results_mouseup(evt);
527
+ }
528
+ };
529
+
530
+ AbstractChosen.prototype.outerHTML = function(element) {
531
+ var tmp;
532
+ if (element.outerHTML) {
533
+ return element.outerHTML;
534
+ }
535
+ tmp = document.createElement("div");
536
+ tmp.appendChild(element);
537
+ return tmp.innerHTML;
538
+ };
539
+
540
+ AbstractChosen.browser_is_supported = function() {
541
+ if (window.navigator.appName === "Microsoft Internet Explorer") {
542
+ return document.documentMode >= 8;
543
+ }
544
+ if (/iP(od|hone)/i.test(window.navigator.userAgent)) {
545
+ return false;
546
+ }
547
+ if (/Android/i.test(window.navigator.userAgent)) {
548
+ if (/Mobile/i.test(window.navigator.userAgent)) {
549
+ return false;
550
+ }
551
+ }
552
+ return true;
553
+ };
554
+
555
+ AbstractChosen.default_multiple_text = "Select Some Options";
556
+
557
+ AbstractChosen.default_single_text = "Select an Option";
558
+
559
+ AbstractChosen.default_no_result_text = "No results match";
560
+
561
+ return AbstractChosen;
562
+
563
+ })();
564
+
565
+ $ = jQuery;
566
+
567
+ $.fn.extend({
568
+ chosen: function(options) {
569
+ if (!AbstractChosen.browser_is_supported()) {
570
+ return this;
571
+ }
572
+ return this.each(function(input_field) {
573
+ var $this, chosen;
574
+ $this = $(this);
575
+ chosen = $this.data('chosen');
576
+ if (options === 'destroy' && chosen instanceof Chosen) {
577
+ chosen.destroy();
578
+ } else if (!(chosen instanceof Chosen)) {
579
+ $this.data('chosen', new Chosen(this, options));
580
+ }
581
+ });
582
+ }
583
+ });
584
+
585
+ Chosen = (function(_super) {
586
+ __extends(Chosen, _super);
587
+
588
+ function Chosen() {
589
+ _ref = Chosen.__super__.constructor.apply(this, arguments);
590
+ return _ref;
591
+ }
592
+
593
+ Chosen.prototype.setup = function() {
594
+ this.form_field_jq = $(this.form_field);
595
+ this.current_selectedIndex = this.form_field.selectedIndex;
596
+ return this.is_rtl = this.form_field_jq.hasClass("chosen-rtl");
597
+ };
598
+
599
+ Chosen.prototype.set_up_html = function() {
600
+ var container_classes, container_props;
601
+ container_classes = ["chosen-container"];
602
+ container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
603
+ if (this.inherit_select_classes && this.form_field.className) {
604
+ container_classes.push(this.form_field.className);
605
+ }
606
+ if (this.is_rtl) {
607
+ container_classes.push("chosen-rtl");
608
+ }
609
+ container_props = {
610
+ 'class': container_classes.join(' '),
611
+ 'style': "width: " + (this.container_width()) + ";",
612
+ 'title': this.form_field.title
613
+ };
614
+ if (this.form_field.id.length) {
615
+ container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
616
+ }
617
+ this.container = $("<div />", container_props);
618
+ if (this.is_multiple) {
619
+ this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');
620
+ } else {
621
+ this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');
622
+ }
623
+ this.form_field_jq.hide().after(this.container);
624
+ this.dropdown = this.container.find('div.chosen-drop').first();
625
+ this.search_field = this.container.find('input').first();
626
+ this.search_results = this.container.find('ul.chosen-results').first();
627
+ this.search_field_scale();
628
+ this.search_no_results = this.container.find('li.no-results').first();
629
+ if (this.is_multiple) {
630
+ this.search_choices = this.container.find('ul.chosen-choices').first();
631
+ this.search_container = this.container.find('li.search-field').first();
632
+ } else {
633
+ this.search_container = this.container.find('div.chosen-search').first();
634
+ this.selected_item = this.container.find('.chosen-single').first();
635
+ }
636
+ this.results_build();
637
+ this.set_tab_index();
638
+ return this.set_label_behavior();
639
+ };
640
+
641
+ Chosen.prototype.on_ready = function() {
642
+ return this.form_field_jq.trigger("chosen:ready", {
643
+ chosen: this
644
+ });
645
+ };
646
+
647
+ Chosen.prototype.register_observers = function() {
648
+ var _this = this;
649
+ this.container.bind('touchstart.chosen', function(evt) {
650
+ _this.container_mousedown(evt);
651
+ return evt.preventDefault();
652
+ });
653
+ this.container.bind('touchend.chosen', function(evt) {
654
+ _this.container_mouseup(evt);
655
+ return evt.preventDefault();
656
+ });
657
+ this.container.bind('mousedown.chosen', function(evt) {
658
+ _this.container_mousedown(evt);
659
+ });
660
+ this.container.bind('mouseup.chosen', function(evt) {
661
+ _this.container_mouseup(evt);
662
+ });
663
+ this.container.bind('mouseenter.chosen', function(evt) {
664
+ _this.mouse_enter(evt);
665
+ });
666
+ this.container.bind('mouseleave.chosen', function(evt) {
667
+ _this.mouse_leave(evt);
668
+ });
669
+ this.search_results.bind('mouseup.chosen', function(evt) {
670
+ _this.search_results_mouseup(evt);
671
+ });
672
+ this.search_results.bind('mouseover.chosen', function(evt) {
673
+ _this.search_results_mouseover(evt);
674
+ });
675
+ this.search_results.bind('mouseout.chosen', function(evt) {
676
+ _this.search_results_mouseout(evt);
677
+ });
678
+ this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen', function(evt) {
679
+ _this.search_results_mousewheel(evt);
680
+ });
681
+ this.search_results.bind('touchstart.chosen', function(evt) {
682
+ _this.search_results_touchstart(evt);
683
+ });
684
+ this.search_results.bind('touchmove.chosen', function(evt) {
685
+ _this.search_results_touchmove(evt);
686
+ });
687
+ this.search_results.bind('touchend.chosen', function(evt) {
688
+ _this.search_results_touchend(evt);
689
+ });
690
+ this.form_field_jq.bind("chosen:updated.chosen", function(evt) {
691
+ _this.results_update_field(evt);
692
+ });
693
+ this.form_field_jq.bind("chosen:activate.chosen", function(evt) {
694
+ _this.activate_field(evt);
695
+ });
696
+ this.form_field_jq.bind("chosen:open.chosen", function(evt) {
697
+ _this.container_mousedown(evt);
698
+ });
699
+ this.form_field_jq.bind("chosen:close.chosen", function(evt) {
700
+ _this.input_blur(evt);
701
+ });
702
+ this.search_field.bind('blur.chosen', function(evt) {
703
+ _this.input_blur(evt);
704
+ });
705
+ this.search_field.bind('keyup.chosen', function(evt) {
706
+ _this.keyup_checker(evt);
707
+ });
708
+ this.search_field.bind('keydown.chosen', function(evt) {
709
+ _this.keydown_checker(evt);
710
+ });
711
+ this.search_field.bind('focus.chosen', function(evt) {
712
+ _this.input_focus(evt);
713
+ });
714
+ this.search_field.bind('cut.chosen', function(evt) {
715
+ _this.clipboard_event_checker(evt);
716
+ });
717
+ this.search_field.bind('paste.chosen', function(evt) {
718
+ _this.clipboard_event_checker(evt);
719
+ });
720
+ if (this.is_multiple) {
721
+ return this.search_choices.bind('click.chosen', function(evt) {
722
+ _this.choices_click(evt);
723
+ });
724
+ } else {
725
+ return this.container.bind('click.chosen', function(evt) {
726
+ evt.preventDefault();
727
+ });
728
+ }
729
+ };
730
+
731
+ Chosen.prototype.destroy = function() {
732
+ $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
733
+ if (this.search_field[0].tabIndex) {
734
+ this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex;
735
+ }
736
+ this.container.remove();
737
+ this.form_field_jq.removeData('chosen');
738
+ return this.form_field_jq.show();
739
+ };
740
+
741
+ Chosen.prototype.search_field_disabled = function() {
742
+ this.is_disabled = this.form_field_jq[0].disabled;
743
+ if (this.is_disabled) {
744
+ this.container.addClass('chosen-disabled');
745
+ this.search_field[0].disabled = true;
746
+ if (!this.is_multiple) {
747
+ this.selected_item.unbind("focus.chosen", this.activate_action);
748
+ }
749
+ return this.close_field();
750
+ } else {
751
+ this.container.removeClass('chosen-disabled');
752
+ this.search_field[0].disabled = false;
753
+ if (!this.is_multiple) {
754
+ return this.selected_item.bind("focus.chosen", this.activate_action);
755
+ }
756
+ }
757
+ };
758
+
759
+ Chosen.prototype.container_mousedown = function(evt) {
760
+ if (!this.is_disabled) {
761
+ if (evt && evt.type === "mousedown" && !this.results_showing) {
762
+ evt.preventDefault();
763
+ }
764
+ if (!((evt != null) && ($(evt.target)).hasClass("search-choice-close"))) {
765
+ if (!this.active_field) {
766
+ if (this.is_multiple) {
767
+ this.search_field.val("");
768
+ }
769
+ $(this.container[0].ownerDocument).bind('click.chosen', this.click_test_action);
770
+ this.results_show();
771
+ } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chosen-single").length)) {
772
+ evt.preventDefault();
773
+ this.results_toggle();
774
+ }
775
+ return this.activate_field();
776
+ }
777
+ }
778
+ };
779
+
780
+ Chosen.prototype.container_mouseup = function(evt) {
781
+ if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
782
+ return this.results_reset(evt);
783
+ }
784
+ };
785
+
786
+ Chosen.prototype.search_results_mousewheel = function(evt) {
787
+ var delta;
788
+ if (evt.originalEvent) {
789
+ delta = evt.originalEvent.deltaY || -evt.originalEvent.wheelDelta || evt.originalEvent.detail;
790
+ }
791
+ if (delta != null) {
792
+ evt.preventDefault();
793
+ if (evt.type === 'DOMMouseScroll') {
794
+ delta = delta * 40;
795
+ }
796
+ return this.search_results.scrollTop(delta + this.search_results.scrollTop());
797
+ }
798
+ };
799
+
800
+ Chosen.prototype.blur_test = function(evt) {
801
+ if (!this.active_field && this.container.hasClass("chosen-container-active")) {
802
+ return this.close_field();
803
+ }
804
+ };
805
+
806
+ Chosen.prototype.close_field = function() {
807
+ $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
808
+ this.active_field = false;
809
+ this.results_hide();
810
+ this.container.removeClass("chosen-container-active");
811
+ this.clear_backstroke();
812
+ this.show_search_field_default();
813
+ return this.search_field_scale();
814
+ };
815
+
816
+ Chosen.prototype.activate_field = function() {
817
+ this.container.addClass("chosen-container-active");
818
+ this.active_field = true;
819
+ this.search_field.val(this.search_field.val());
820
+ return this.search_field.focus();
821
+ };
822
+
823
+ Chosen.prototype.test_active_click = function(evt) {
824
+ var active_container;
825
+ active_container = $(evt.target).closest('.chosen-container');
826
+ if (active_container.length && this.container[0] === active_container[0]) {
827
+ return this.active_field = true;
828
+ } else {
829
+ return this.close_field();
830
+ }
831
+ };
832
+
833
+ Chosen.prototype.results_build = function() {
834
+ this.parsing = true;
835
+ this.selected_option_count = null;
836
+ this.results_data = SelectParser.select_to_array(this.form_field);
837
+ if (this.is_multiple) {
838
+ this.search_choices.find("li.search-choice").remove();
839
+ } else if (!this.is_multiple) {
840
+ this.single_set_selected_text();
841
+ if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
842
+ this.search_field[0].readOnly = true;
843
+ this.container.addClass("chosen-container-single-nosearch");
844
+ } else {
845
+ this.search_field[0].readOnly = false;
846
+ this.container.removeClass("chosen-container-single-nosearch");
847
+ }
848
+ }
849
+ this.update_results_content(this.results_option_build({
850
+ first: true
851
+ }));
852
+ this.search_field_disabled();
853
+ this.show_search_field_default();
854
+ this.search_field_scale();
855
+ return this.parsing = false;
856
+ };
857
+
858
+ Chosen.prototype.result_do_highlight = function(el) {
859
+ var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
860
+ if (el.length) {
861
+ this.result_clear_highlight();
862
+ this.result_highlight = el;
863
+ this.result_highlight.addClass("highlighted");
864
+ maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
865
+ visible_top = this.search_results.scrollTop();
866
+ visible_bottom = maxHeight + visible_top;
867
+ high_top = this.result_highlight.position().top + this.search_results.scrollTop();
868
+ high_bottom = high_top + this.result_highlight.outerHeight();
869
+ if (high_bottom >= visible_bottom) {
870
+ return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
871
+ } else if (high_top < visible_top) {
872
+ return this.search_results.scrollTop(high_top);
873
+ }
874
+ }
875
+ };
876
+
877
+ Chosen.prototype.result_clear_highlight = function() {
878
+ if (this.result_highlight) {
879
+ this.result_highlight.removeClass("highlighted");
880
+ }
881
+ return this.result_highlight = null;
882
+ };
883
+
884
+ Chosen.prototype.results_show = function() {
885
+ if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
886
+ this.form_field_jq.trigger("chosen:maxselected", {
887
+ chosen: this
888
+ });
889
+ return false;
890
+ }
891
+ this.container.addClass("chosen-with-drop");
892
+ this.results_showing = true;
893
+ this.search_field.focus();
894
+ this.search_field.val(this.search_field.val());
895
+ this.winnow_results();
896
+ return this.form_field_jq.trigger("chosen:showing_dropdown", {
897
+ chosen: this
898
+ });
899
+ };
900
+
901
+ Chosen.prototype.update_results_content = function(content) {
902
+ return this.search_results.html(content);
903
+ };
904
+
905
+ Chosen.prototype.results_hide = function() {
906
+ if (this.results_showing) {
907
+ this.result_clear_highlight();
908
+ this.container.removeClass("chosen-with-drop");
909
+ this.form_field_jq.trigger("chosen:hiding_dropdown", {
910
+ chosen: this
911
+ });
912
+ }
913
+ return this.results_showing = false;
914
+ };
915
+
916
+ Chosen.prototype.set_tab_index = function(el) {
917
+ var ti;
918
+ if (this.form_field.tabIndex) {
919
+ ti = this.form_field.tabIndex;
920
+ this.form_field.tabIndex = -1;
921
+ return this.search_field[0].tabIndex = ti;
922
+ }
923
+ };
924
+
925
+ Chosen.prototype.set_label_behavior = function() {
926
+ var _this = this;
927
+ this.form_field_label = this.form_field_jq.parents("label");
928
+ if (!this.form_field_label.length && this.form_field.id.length) {
929
+ this.form_field_label = $("label[for='" + this.form_field.id + "']");
930
+ }
931
+ if (this.form_field_label.length > 0) {
932
+ return this.form_field_label.bind('click.chosen', function(evt) {
933
+ if (_this.is_multiple) {
934
+ return _this.container_mousedown(evt);
935
+ } else {
936
+ return _this.activate_field();
937
+ }
938
+ });
939
+ }
940
+ };
941
+
942
+ Chosen.prototype.show_search_field_default = function() {
943
+ if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
944
+ this.search_field.val(this.default_text);
945
+ return this.search_field.addClass("default");
946
+ } else {
947
+ this.search_field.val("");
948
+ return this.search_field.removeClass("default");
949
+ }
950
+ };
951
+
952
+ Chosen.prototype.search_results_mouseup = function(evt) {
953
+ var target;
954
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
955
+ if (target.length) {
956
+ this.result_highlight = target;
957
+ this.result_select(evt);
958
+ return this.search_field.focus();
959
+ }
960
+ };
961
+
962
+ Chosen.prototype.search_results_mouseover = function(evt) {
963
+ var target;
964
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
965
+ if (target) {
966
+ return this.result_do_highlight(target);
967
+ }
968
+ };
969
+
970
+ Chosen.prototype.search_results_mouseout = function(evt) {
971
+ if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
972
+ return this.result_clear_highlight();
973
+ }
974
+ };
975
+
976
+ Chosen.prototype.choice_build = function(item) {
977
+ var choice, close_link,
978
+ _this = this;
979
+ choice = $('<li />', {
980
+ "class": "search-choice"
981
+ }).html("<span>" + (this.choice_label(item)) + "</span>");
982
+ if (item.disabled) {
983
+ choice.addClass('search-choice-disabled');
984
+ } else {
985
+ close_link = $('<a />', {
986
+ "class": 'search-choice-close',
987
+ 'data-option-array-index': item.array_index
988
+ });
989
+ close_link.bind('click.chosen', function(evt) {
990
+ return _this.choice_destroy_link_click(evt);
991
+ });
992
+ choice.append(close_link);
993
+ }
994
+ return this.search_container.before(choice);
995
+ };
996
+
997
+ Chosen.prototype.choice_destroy_link_click = function(evt) {
998
+ evt.preventDefault();
999
+ evt.stopPropagation();
1000
+ if (!this.is_disabled) {
1001
+ return this.choice_destroy($(evt.target));
1002
+ }
1003
+ };
1004
+
1005
+ Chosen.prototype.choice_destroy = function(link) {
1006
+ if (this.result_deselect(link[0].getAttribute("data-option-array-index"))) {
1007
+ this.show_search_field_default();
1008
+ if (this.is_multiple && this.choices_count() > 0 && this.search_field.val().length < 1) {
1009
+ this.results_hide();
1010
+ }
1011
+ link.parents('li').first().remove();
1012
+ return this.search_field_scale();
1013
+ }
1014
+ };
1015
+
1016
+ Chosen.prototype.results_reset = function() {
1017
+ this.reset_single_select_options();
1018
+ this.form_field.options[0].selected = true;
1019
+ this.single_set_selected_text();
1020
+ this.show_search_field_default();
1021
+ this.results_reset_cleanup();
1022
+ this.form_field_jq.trigger("change");
1023
+ if (this.active_field) {
1024
+ return this.results_hide();
1025
+ }
1026
+ };
1027
+
1028
+ Chosen.prototype.results_reset_cleanup = function() {
1029
+ this.current_selectedIndex = this.form_field.selectedIndex;
1030
+ return this.selected_item.find("abbr").remove();
1031
+ };
1032
+
1033
+ Chosen.prototype.result_select = function(evt) {
1034
+ var high, item;
1035
+ if (this.result_highlight) {
1036
+ high = this.result_highlight;
1037
+ this.result_clear_highlight();
1038
+ if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
1039
+ this.form_field_jq.trigger("chosen:maxselected", {
1040
+ chosen: this
1041
+ });
1042
+ return false;
1043
+ }
1044
+ if (this.is_multiple) {
1045
+ high.removeClass("active-result");
1046
+ } else {
1047
+ this.reset_single_select_options();
1048
+ }
1049
+ high.addClass("result-selected");
1050
+ item = this.results_data[high[0].getAttribute("data-option-array-index")];
1051
+ item.selected = true;
1052
+ this.form_field.options[item.options_index].selected = true;
1053
+ this.selected_option_count = null;
1054
+ if (this.is_multiple) {
1055
+ this.choice_build(item);
1056
+ } else {
1057
+ this.single_set_selected_text(this.choice_label(item));
1058
+ }
1059
+ if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) {
1060
+ this.results_hide();
1061
+ }
1062
+ this.search_field.val("");
1063
+ if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
1064
+ this.form_field_jq.trigger("change", {
1065
+ 'selected': this.form_field.options[item.options_index].value
1066
+ });
1067
+ }
1068
+ this.current_selectedIndex = this.form_field.selectedIndex;
1069
+ evt.preventDefault();
1070
+ return this.search_field_scale();
1071
+ }
1072
+ };
1073
+
1074
+ Chosen.prototype.single_set_selected_text = function(text) {
1075
+ if (text == null) {
1076
+ text = this.default_text;
1077
+ }
1078
+ if (text === this.default_text) {
1079
+ this.selected_item.addClass("chosen-default");
1080
+ } else {
1081
+ this.single_deselect_control_build();
1082
+ this.selected_item.removeClass("chosen-default");
1083
+ }
1084
+ return this.selected_item.find("span").html(text);
1085
+ };
1086
+
1087
+ Chosen.prototype.result_deselect = function(pos) {
1088
+ var result_data;
1089
+ result_data = this.results_data[pos];
1090
+ if (!this.form_field.options[result_data.options_index].disabled) {
1091
+ result_data.selected = false;
1092
+ this.form_field.options[result_data.options_index].selected = false;
1093
+ this.selected_option_count = null;
1094
+ this.result_clear_highlight();
1095
+ if (this.results_showing) {
1096
+ this.winnow_results();
1097
+ }
1098
+ this.form_field_jq.trigger("change", {
1099
+ deselected: this.form_field.options[result_data.options_index].value
1100
+ });
1101
+ this.search_field_scale();
1102
+ return true;
1103
+ } else {
1104
+ return false;
1105
+ }
1106
+ };
1107
+
1108
+ Chosen.prototype.single_deselect_control_build = function() {
1109
+ if (!this.allow_single_deselect) {
1110
+ return;
1111
+ }
1112
+ if (!this.selected_item.find("abbr").length) {
1113
+ this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
1114
+ }
1115
+ return this.selected_item.addClass("chosen-single-with-deselect");
1116
+ };
1117
+
1118
+ Chosen.prototype.get_search_text = function() {
1119
+ return $('<div/>').text($.trim(this.search_field.val())).html();
1120
+ };
1121
+
1122
+ Chosen.prototype.winnow_results_set_highlight = function() {
1123
+ var do_high, selected_results;
1124
+ selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
1125
+ do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
1126
+ if (do_high != null) {
1127
+ return this.result_do_highlight(do_high);
1128
+ }
1129
+ };
1130
+
1131
+ Chosen.prototype.no_results = function(terms) {
1132
+ var no_results_html;
1133
+ no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
1134
+ no_results_html.find("span").first().html(terms);
1135
+ this.search_results.append(no_results_html);
1136
+ return this.form_field_jq.trigger("chosen:no_results", {
1137
+ chosen: this
1138
+ });
1139
+ };
1140
+
1141
+ Chosen.prototype.no_results_clear = function() {
1142
+ return this.search_results.find(".no-results").remove();
1143
+ };
1144
+
1145
+ Chosen.prototype.keydown_arrow = function() {
1146
+ var next_sib;
1147
+ if (this.results_showing && this.result_highlight) {
1148
+ next_sib = this.result_highlight.nextAll("li.active-result").first();
1149
+ if (next_sib) {
1150
+ return this.result_do_highlight(next_sib);
1151
+ }
1152
+ } else {
1153
+ return this.results_show();
1154
+ }
1155
+ };
1156
+
1157
+ Chosen.prototype.keyup_arrow = function() {
1158
+ var prev_sibs;
1159
+ if (!this.results_showing && !this.is_multiple) {
1160
+ return this.results_show();
1161
+ } else if (this.result_highlight) {
1162
+ prev_sibs = this.result_highlight.prevAll("li.active-result");
1163
+ if (prev_sibs.length) {
1164
+ return this.result_do_highlight(prev_sibs.first());
1165
+ } else {
1166
+ if (this.choices_count() > 0) {
1167
+ this.results_hide();
1168
+ }
1169
+ return this.result_clear_highlight();
1170
+ }
1171
+ }
1172
+ };
1173
+
1174
+ Chosen.prototype.keydown_backstroke = function() {
1175
+ var next_available_destroy;
1176
+ if (this.pending_backstroke) {
1177
+ this.choice_destroy(this.pending_backstroke.find("a").first());
1178
+ return this.clear_backstroke();
1179
+ } else {
1180
+ next_available_destroy = this.search_container.siblings("li.search-choice").last();
1181
+ if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
1182
+ this.pending_backstroke = next_available_destroy;
1183
+ if (this.single_backstroke_delete) {
1184
+ return this.keydown_backstroke();
1185
+ } else {
1186
+ return this.pending_backstroke.addClass("search-choice-focus");
1187
+ }
1188
+ }
1189
+ }
1190
+ };
1191
+
1192
+ Chosen.prototype.clear_backstroke = function() {
1193
+ if (this.pending_backstroke) {
1194
+ this.pending_backstroke.removeClass("search-choice-focus");
1195
+ }
1196
+ return this.pending_backstroke = null;
1197
+ };
1198
+
1199
+ Chosen.prototype.keydown_checker = function(evt) {
1200
+ var stroke, _ref1;
1201
+ stroke = (_ref1 = evt.which) != null ? _ref1 : evt.keyCode;
1202
+ this.search_field_scale();
1203
+ if (stroke !== 8 && this.pending_backstroke) {
1204
+ this.clear_backstroke();
1205
+ }
1206
+ switch (stroke) {
1207
+ case 8:
1208
+ this.backstroke_length = this.search_field.val().length;
1209
+ break;
1210
+ case 9:
1211
+ if (this.results_showing && !this.is_multiple) {
1212
+ this.result_select(evt);
1213
+ }
1214
+ this.mouse_on_container = false;
1215
+ break;
1216
+ case 13:
1217
+ if (this.results_showing) {
1218
+ evt.preventDefault();
1219
+ }
1220
+ break;
1221
+ case 32:
1222
+ if (this.disable_search) {
1223
+ evt.preventDefault();
1224
+ }
1225
+ break;
1226
+ case 38:
1227
+ evt.preventDefault();
1228
+ this.keyup_arrow();
1229
+ break;
1230
+ case 40:
1231
+ evt.preventDefault();
1232
+ this.keydown_arrow();
1233
+ break;
1234
+ }
1235
+ };
1236
+
1237
+ Chosen.prototype.search_field_scale = function() {
1238
+ var div, f_width, h, style, style_block, styles, w, _i, _len;
1239
+ if (this.is_multiple) {
1240
+ h = 0;
1241
+ w = 0;
1242
+ style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
1243
+ styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
1244
+ for (_i = 0, _len = styles.length; _i < _len; _i++) {
1245
+ style = styles[_i];
1246
+ style_block += style + ":" + this.search_field.css(style) + ";";
1247
+ }
1248
+ div = $('<div />', {
1249
+ 'style': style_block
1250
+ });
1251
+ div.text(this.search_field.val());
1252
+ $('body').append(div);
1253
+ w = div.width() + 25;
1254
+ div.remove();
1255
+ f_width = this.container.outerWidth();
1256
+ if (w > f_width - 10) {
1257
+ w = f_width - 10;
1258
+ }
1259
+ return this.search_field.css({
1260
+ 'width': w + 'px'
1261
+ });
1262
+ }
1263
+ };
1264
+
1265
+ return Chosen;
1266
+
1267
+ })(AbstractChosen);
1268
+
1269
+ }).call(this);
1270
+ /* End Chosen Selectbox */
includes/controls/controls.php ADDED
@@ -0,0 +1,542 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class smartlogixControls {
3
+ private $type;
4
+ private $plainHTML;
5
+ private $useParagraph;
6
+ private $helpText;
7
+ private $id;
8
+ private $name;
9
+ private $value;
10
+ private $label;
11
+ private $className;
12
+ private $style;
13
+ private $required;
14
+ private $options;
15
+
16
+ private $optionName;
17
+ private $optionIdentifier;
18
+ private $values;
19
+
20
+ private $pages;
21
+ private $posts;
22
+ private $categories;
23
+
24
+ public $HTML;
25
+ public $JS;
26
+
27
+ function __construct($args = null) {
28
+ $this->HTML = '';
29
+ $this->JS = '';
30
+
31
+ $this->type = 'text';
32
+ $this->plainHTML = false;
33
+ $this->useParagraph = true;
34
+ $this->helpText = '';
35
+ $this->id = '';
36
+ $this->name = '';
37
+ $this->value = '';
38
+ $this->label = '';
39
+ $this->className = 'input widefat';
40
+ $this->style = '';
41
+ $this->required = '';
42
+ $this->options = null;
43
+
44
+ $this->optionName = '';
45
+ $this->optionIdentifier = '';
46
+ $this->values = '';
47
+
48
+ if(isset($args) && is_array($args)) {
49
+ if(isset($args['type']) && ($args['type'] != '')) {
50
+ $this->type = $args['type'];
51
+ }
52
+ if(isset($args['plainHTML']) && ($args['plainHTML'] != '')) {
53
+ $this->plainHTML = $args['plainHTML'];
54
+ }
55
+ if(isset($args['useParagraph']) && ($args['useParagraph'] != '')) {
56
+ $this->useParagraph = $args['useParagraph'];
57
+ }
58
+ if(isset($args['helpText']) && ($args['helpText'] != '')) {
59
+ $this->helpText = $args['helpText'];
60
+ }
61
+ if(isset($args['id']) && ($args['id'] != '')) {
62
+ $this->id = $args['id'];
63
+ }
64
+ if(isset($args['name']) && ($args['name'] != '')) {
65
+ $this->name = $args['name'];
66
+ }
67
+ if(isset($args['value']) && ($args['value'] != '')) {
68
+ $this->value = $args['value'];
69
+ }
70
+ if(isset($args['label']) && ($args['label'] != '')) {
71
+ $this->label = $args['label'];
72
+ }
73
+ if(isset($args['className']) && ($args['className'] != '')) {
74
+ $this->className = $args['className'];
75
+ }
76
+ if(isset($args['style']) && ($args['style'] != '')) {
77
+ $this->style = $args['style'];
78
+ }
79
+ if(isset($args['required']) && ($args['required'] != '')) {
80
+ $this->required = $args['required'];
81
+ }
82
+ if(isset($args['options']) && is_array($args['options'])) {
83
+ $this->options = $args['options'];
84
+ }
85
+
86
+ if(isset($args['optionIdentifier']) && ($args['optionIdentifier'] != '')) {
87
+ $this->optionIdentifier = $args['optionIdentifier'];
88
+ }
89
+ if(isset($args['optionName']) && ($args['optionName'] != '')) {
90
+ $this->optionName = $args['optionName'];
91
+ }
92
+ if(isset($args['values']) && ($args['values'] != '')) {
93
+ $this->values = $args['values'];
94
+ }
95
+
96
+ if(isset($args['optionIdentifier']) && ($args['optionIdentifier'] != '') && isset($args['optionName']) && ($args['optionName'] != '')) {
97
+ $this->id = str_replace(array('[', ']'), array('_', ''), $args['optionIdentifier']).'_'.$args['optionName'];
98
+ $this->name = $args['optionIdentifier'].'['.$args['optionName'].']';
99
+ } elseif(isset($this->optionIdentifier) && ($this->optionIdentifier != '') && isset($args['optionName']) && ($args['optionName'] != '')) {
100
+ $this->id = str_replace(array('[', ']'), array('_', ''), $this->optionIdentifier).'_'.$args['optionName'];
101
+ $this->name = $this->optionIdentifier.'['.$args['optionName'].']';
102
+ } elseif(isset($args['optionIdentifier']) && ($args['optionIdentifier'] != '') && isset($this->optionName) && ($this->optionName != '')) {
103
+ $this->id = str_replace(array('[', ']'), array('_', ''), $args['optionIdentifier']).'_'.$this->optionName;
104
+ $this->name = $args['optionIdentifier'].'['.$this->optionName.']';
105
+ } elseif(isset($this->optionIdentifier) && ($this->optionIdentifier != '') && isset($this->optionName) && ($this->optionName != '')) {
106
+ $this->id = str_replace(array('[', ']'), array('_', ''), $this->optionIdentifier).'_'.$this->optionName;
107
+ $this->name = $this->optionIdentifier.'['.$this->optionName.']';
108
+ }
109
+
110
+ if(isset($args['values']) && is_array($args['values'])) {
111
+ if(isset($args['optionName']) && ($args['optionName'] != '')) {
112
+ $this->value = $args['values'][$args['optionName']];
113
+ } elseif(isset($this->optionName) && ($this->optionName != '')) {
114
+ $this->value = $args['values'][$this->optionName];
115
+ }
116
+ } elseif(isset($this->values) && is_array($this->values)) {
117
+ if(isset($args['optionName']) && ($args['optionName'] != '')) {
118
+ $this->value = $this->values[$args['optionName']];
119
+ } elseif(isset($this->optionName) && ($this->optionName != '')) {
120
+ $this->value = $this->values[$this->optionName];
121
+ }
122
+ }
123
+ }
124
+ }
125
+
126
+ private function sync_args($args) {
127
+ $syncedArgs = array();
128
+ if(is_array($args)) {
129
+ $syncedArgs = $args;
130
+ }
131
+
132
+ if(isset($args['type']) && ($args['type'] != '')) {
133
+ $syncedArgs['type'] = $args['type'];
134
+ } else {
135
+ $syncedArgs['type'] = $this->type;
136
+ }
137
+
138
+ if(isset($args['plainHTML']) && ($args['plainHTML'] != '')) {
139
+ $syncedArgs['plainHTML'] = $args['plainHTML'];
140
+ } else {
141
+ $syncedArgs['plainHTML'] = $this->plainHTML;
142
+ }
143
+
144
+ if(isset($args['useParagraph']) && ($args['useParagraph'] != '')) {
145
+ $syncedArgs['useParagraph'] = $args['useParagraph'];
146
+ } else {
147
+ $syncedArgs['useParagraph'] = $this->useParagraph;
148
+ }
149
+
150
+ if(isset($args['helpText']) && ($args['helpText'] != '')) {
151
+ $syncedArgs['helpText'] = $args['helpText'];
152
+ } else {
153
+ $syncedArgs['helpText'] = $this->helpText;
154
+ }
155
+
156
+ if(isset($args['id']) && ($args['id'] != '')) {
157
+ $syncedArgs['id'] = $args['id'];
158
+ } else {
159
+ $syncedArgs['id'] = $this->id;
160
+ }
161
+
162
+ if(isset($args['name']) && ($args['name'] != '')) {
163
+ $syncedArgs['name'] = $args['name'];
164
+ } else {
165
+ $syncedArgs['name'] = $this->name;
166
+ }
167
+
168
+ if(isset($args['value']) && ($args['value'] != '')) {
169
+ $syncedArgs['value'] = $args['value'];
170
+ } else {
171
+ $syncedArgs['value'] = $this->value;
172
+ }
173
+
174
+ if(isset($args['label']) && ($args['label'] != '')) {
175
+ $syncedArgs['label'] = $args['label'];
176
+ } else {
177
+ $syncedArgs['label'] = $this->label;
178
+ }
179
+
180
+ if(isset($args['className']) && ($args['className'] != '')) {
181
+ $syncedArgs['className'] = $args['className'];
182
+ } else {
183
+ $syncedArgs['className'] = $this->className;
184
+ }
185
+
186
+ if(isset($args['style']) && ($args['style'] != '')) {
187
+ $syncedArgs['style'] = $args['style'];
188
+ } else {
189
+ $syncedArgs['style'] = $this->style;
190
+ }
191
+
192
+ if(isset($args['required']) && ($args['required'] != '')) {
193
+ $syncedArgs['required'] = $args['required'];
194
+ } else {
195
+ $syncedArgs['required'] = $this->required;
196
+ }
197
+
198
+ if(isset($args['options']) && is_array($args['options'])) {
199
+ $syncedArgs['options'] = $args['options'];
200
+ } else {
201
+ $syncedArgs['options'] = $this->options;
202
+ }
203
+
204
+
205
+ if(isset($args['optionIdentifier']) && ($args['optionIdentifier'] != '') && isset($args['optionName']) && ($args['optionName'] != '')) {
206
+ $syncedArgs['id'] = str_replace(array('[', ']'), array('_', ''), $args['optionIdentifier']).'_'.$args['optionName'];
207
+ $syncedArgs['name'] = $args['optionIdentifier'].'['.$args['optionName'].']';
208
+ } elseif(isset($this->optionIdentifier) && ($this->optionIdentifier != '') && isset($args['optionName']) && ($args['optionName'] != '')) {
209
+ $syncedArgs['id'] = str_replace(array('[', ']'), array('_', ''), $this->optionIdentifier).'_'.$args['optionName'];
210
+ $syncedArgs['name'] = $this->optionIdentifier.'['.$args['optionName'].']';
211
+ } elseif(isset($args['optionIdentifier']) && ($args['optionIdentifier'] != '') && isset($this->optionName) && ($this->optionName != '')) {
212
+ $syncedArgs['id'] = str_replace(array('[', ']'), array('_', ''), $args['optionIdentifier']).'_'.$this->optionName;
213
+ $syncedArgs['name'] = $args['optionIdentifier'].'['.$this->optionName.']';
214
+ } elseif(isset($this->optionIdentifier) && ($this->optionIdentifier != '') && isset($this->optionName) && ($this->optionName != '')) {
215
+ $syncedArgs['id'] = str_replace(array('[', ']'), array('_', ''), $this->optionIdentifier).'_'.$this->optionName;
216
+ $syncedArgs['name'] = $this->optionIdentifier.'['.$this->optionName.']';
217
+ }
218
+
219
+ if(isset($args['values']) && is_array($args['values'])) {
220
+ if(isset($args['optionName']) && ($args['optionName'] != '')) {
221
+ $syncedArgs['value'] = $args['values'][$args['optionName']];
222
+ } elseif(isset($this->optionName) && ($this->optionName != '')) {
223
+ $syncedArgs['value'] = $args['values'][$this->optionName];
224
+ }
225
+ } elseif(isset($this->values) && is_array($this->values)) {
226
+ if(isset($args['optionName']) && ($args['optionName'] != '')) {
227
+ $syncedArgs['value'] = $this->values[$args['optionName']];
228
+ } elseif(isset($this->optionName) && ($this->optionName != '')) {
229
+ $syncedArgs['value'] = $this->values[$this->optionName];
230
+ }
231
+ }
232
+
233
+ return $syncedArgs;
234
+ }
235
+
236
+ public function add_control($args = null) {
237
+ $control = $this->get_control($args, true);
238
+ $this->HTML .= $control['HTML'];
239
+ $this->JS .= $control['JS'];
240
+ }
241
+
242
+ public function get_control($args = null, $ignorePlainHTML = false) {
243
+ $HTML = '';
244
+ $JS = '';
245
+ $args = $this->sync_args($args);
246
+
247
+ switch($args['type']) {
248
+ case 'hidden':
249
+ $HTML .= '<input type="hidden" '.(($args['id'] != '')?'id="'.$args['id'].'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' '.(($args['value'] != '')?'value="'.$args['value'].'"':'').' '.(($args['className'] != '')?'class="'.$args['className'].'"':'').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' />';
250
+ break;
251
+ case 'text':
252
+ if($args['useParagraph']) { $HTML .= '<p>'; }
253
+ if($args['label'] != '') { $HTML .= '<label '.(($args['name'] != '')?'for="'.$args['name'].'"':'').'>'.$args['label'].'</label><br />'; }
254
+ $HTML .= '<input type="text" '.(($args['id'] != '')?'id="'.$args['id'].'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' '.(($args['value'] != '')?'value="'.$args['value'].'"':'').' '.(($args['className'] != '')?'class="'.$args['className'].'"':'').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' '.(($args['required'])?'required':'').' />';
255
+ if($args['helpText'] != '') { $HTML .= '<small>'.$args['helpText'].'</small>'; }
256
+ if($args['useParagraph']) { $HTML .= '</p>'; }
257
+ break;
258
+ case 'textarea':
259
+ if($args['useParagraph']) { $HTML .= '<p>'; }
260
+ if($args['label'] != '') { $HTML .= '<label '.(($args['name'] != '')?'for="'.$args['name'].'"':'').'>'.$args['label'].'</label><br />'; }
261
+ $HTML .= '<textarea '.(($args['id'] != '')?'id="'.$args['id'].'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' '.(($args['className'] != '')?'class="'.$args['className'].'"':'').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' '.(($args['required'])?'required':'').'>'.stripslashes((($args['value'] != '')?$args['value']:'')).'</textarea>';
262
+ if($args['helpText'] != '') { $HTML .= '<small>'.$args['helpText'].'</small>'; }
263
+ if($args['useParagraph']) { $HTML .= '</p>'; }
264
+ break;
265
+ case 'checkbox':
266
+ if($args['useParagraph']) { $HTML .= '<p>'; }
267
+ if(isset($args['value']) && (filter_var($args['value'], FILTER_VALIDATE_BOOLEAN))) {
268
+ $HTML .= '<input type="checkbox" '.(($args['id'] != '')?'id="'.$args['id'].'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' value="1" '.checked(true, true, false).' '.(($args['className'] != '')?'class="'.$args['className'].'"':'').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' '.(($args['required'])?'required':'').' />';
269
+ } else {
270
+ $HTML .= '<input type="checkbox" '.(($args['id'] != '')?'id="'.$args['id'].'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' value="1" '.(($args['className'] != '')?'class="'.$args['className'].'"':'').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' '.(($args['required'])?'required':'').' />';
271
+ }
272
+ if($args['label'] != '') { $HTML .= '&nbsp;<label '.(($args['name'] != '')?'for="'.$args['name'].'"':'').'>'.$args['label'].'</label>'; }
273
+ if($args['helpText'] != '') { $HTML .= '<small>'.$args['helpText'].'</small>'; }
274
+ if($args['useParagraph']) { $HTML .= '</p>'; }
275
+ break;
276
+ case 'radio':
277
+ if($args['useParagraph']) { $HTML .= '<p>'; }
278
+ if(isset($args['value']) && (filter_var($args['value'], FILTER_VALIDATE_BOOLEAN))) {
279
+ $HTML .= '<input type="radio" '.(($args['id'] != '')?'id="'.$args['id'].'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' value="1" '.checked(true, true, false).' '.(($args['className'] != '')?'class="'.$args['className'].'"':'').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' '.(($args['required'])?'required':'').' />';
280
+ } else {
281
+ $HTML .= '<input type="radio" '.(($args['id'] != '')?'id="'.$args['id'].'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' value="1" '.(($args['className'] != '')?'class="'.$args['className'].'"':'').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' '.(($args['required'])?'required':'').' />';
282
+ }
283
+ if($args['label'] != '') { $HTML .= '&nbsp;<label '.(($args['name'] != '')?'for="'.$args['name'].'"':'').'>'.$args['label'].'</label>'; }
284
+ if($args['helpText'] != '') { $HTML .= '<small>'.$args['helpText'].'</small>'; }
285
+ if($args['useParagraph']) { $HTML .= '</p>'; }
286
+ break;
287
+ case 'select':
288
+ if($args['useParagraph']) { $HTML .= '<p>'; }
289
+ if($args['label'] != '') { $HTML .= '<label '.(($args['name'] != '')?'for="'.$args['name'].'"':'').'>'.$args['label'].'</label><br />'; }
290
+ $HTML .= '<select '.(($args['id'] != '')?'id="'.$args['id'].'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' '.(($args['value'] != '')?'value="'.$args['value'].'"':'').' '.(($args['className'] != '')?'class="'.$args['className'].'"':'').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' '.(($args['required'])?'required':'').'>';
291
+ if(is_array($args['options'])) {
292
+ foreach($args['options'] as $option) {
293
+ $HTML .= '<option '.(($option['value'] != '')?'value="'.$option['value'].'"':'').' '.selected((($args['value'] != '')?$args['value']:''), (($option['value'] != '')?$option['value']:''), false).'>'.(($option['text'] != '')?$option['text']:'').'</option>';
294
+ }
295
+ }
296
+ $HTML .= '</select>';
297
+ if($args['helpText'] != '') { $HTML .= '<small>'.$args['helpText'].'</small>'; }
298
+ if($args['useParagraph']) { $HTML .= '</p>'; }
299
+ break;
300
+ case 'choosen-multiselect':
301
+ if($args['useParagraph']) { $HTML .= '<p>'; }
302
+ if($args['label'] != '') { $HTML .= '<label '.(($args['name'] != '')?'for="'.$args['name'].'"':'').'>'.$args['label'].'</label><br />'; }
303
+ $HTML .= '<select data-placeholder="'.(($args['label'] != '')?$args['label']:'Select Your Options').'" multiple '.(($args['id'] != '')?'id="'.$args['id'].'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' '.(($args['value'] != '')?'value="'.$args['value'].'"':'').' '.(($args['className'] != '')?'class="'.$args['className'].'"':'').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' '.(($args['required'])?'required':'').'>';
304
+ if(is_array($args['options'])) {
305
+ foreach($args['options'] as $option) {
306
+ if(in_array((($option['value'] != '')?$option['value']:''), ((is_array($args['value']))?$args['value']:array()))) {
307
+ $HTML .= '<option '.(($option['value'] != '')?'value="'.$option['value'].'"':'').' '.selected(1, 1, false).'>'.(($option['text'] != '')?$option['text']:'').'</option>';
308
+ } else {
309
+ $HTML .= '<option '.(($option['value'] != '')?'value="'.$option['value'].'"':'').'>'.(($option['text'] != '')?$option['text']:'').'</option>';
310
+ }
311
+ }
312
+ }
313
+ $HTML .= '</select>';
314
+ if($args['helpText'] != '') { $HTML .= '<small>'.$args['helpText'].'</small>'; }
315
+ if($args['useParagraph']) { $HTML .= '</p>'; }
316
+ $JS .= 'jQuery("#'.(($args['id'] != '')?$args['id']:'').'").chosen({ width: "100%" }).on("change", function(evt, params) { jQuery("#'.(($args['id'] != '')?$args['id']:'').'_chosen .search-field input").click(); }).trigger("chosen:open");';
317
+ break;
318
+ case 'radio-group':
319
+ if($args['useParagraph']) { $HTML .= '<p>'; }
320
+ if($args['label'] != '') { $HTML .= '<label '.(($args['name'] != '')?'for="'.$args['name'].'"':'').'>'.$args['label'].'</label><br />'; }
321
+ if(is_array($args['options'])) {
322
+ $index = 1;
323
+ foreach($args['options'] as $option) {
324
+ $HTML .= '<input type="radio" '.(($args['id'] != '')?'id="'.$args['id'].'_'.$index.'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' '.(($option['value'] != '')?'value="'.$option['value'].'"':'').' '.checked(((isset($args['value']))?$args['value']:''), ((isset($option['value']))?$option['value']:''), false).' '.(($args['className'] != '')?'class="'.$args['className'].'"':'').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' />';
325
+ if($option['text'] != '') { $HTML .= '&nbsp;<label '.(($args['name'] != '')?'for="'.$args['name'].'"':'').'>'.(($option['text'] != '')?$option['text']:'').'</label><br />'; }
326
+ $index++;
327
+ }
328
+ }
329
+ if($args['helpText'] != '') { $HTML .= '<small>'.$args['helpText'].'</small>'; }
330
+ if($args['useParagraph']) { $HTML .= '</p>'; }
331
+ break;
332
+ case 'ipCheckbox':
333
+ if($args['useParagraph']) { $HTML .= '<p>'; }
334
+ if(isset($args['value']) && (filter_var($args['value'], FILTER_VALIDATE_BOOLEAN))) {
335
+ $HTML .= '<input type="checkbox" '.(($args['id'] != '')?'id="'.$args['id'].'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' value="true" '.checked(true, true, false).' '.(($args['className'] != '')?'class="ipCheckbox '.$args['className'].'"':'class="ipCheckbox"').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' '.(($args['required'])?'required':'').' />';
336
+ } else {
337
+ $HTML .= '<input type="checkbox" '.(($args['id'] != '')?'id="'.$args['id'].'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' value="true" '.(($args['className'] != '')?'class="ipCheckbox '.$args['className'].'"':'class="ipCheckbox"').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' '.(($args['required'])?'required':'').' />';
338
+ }
339
+ if($args['label'] != '') { $HTML .= '&nbsp;<label '.(($args['name'] != '')?'for="'.$args['name'].'"':'').'>'.$args['label'].'</label>'; }
340
+ if($args['helpText'] != '') { $HTML .= '<small>'.$args['helpText'].'</small>'; }
341
+ if($args['useParagraph']) { $HTML .= '</p>'; }
342
+ $JS .= 'jQuery("#'.(($args['id'] != '')?$args['id']:'').'").ipCheckbox();';
343
+ break;
344
+ case 'checkbox-button':
345
+ if($args['useParagraph']) { $HTML .= '<p>'; }
346
+ if(isset($args['value']) && (filter_var($args['value'], FILTER_VALIDATE_BOOLEAN))) {
347
+ $HTML .= '<input type="checkbox" '.(($args['id'] != '')?'id="'.$args['id'].'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' value="true" '.checked(true, true, false).' '.(($args['className'] != '')?'class="'.$args['className'].'"':'').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' '.(($args['required'])?'required':'').' />';
348
+ } else {
349
+ $HTML .= '<input type="checkbox" '.(($args['id'] != '')?'id="'.$args['id'].'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' value="true" '.(($args['className'] != '')?'class="'.$args['className'].'"':'').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' '.(($args['required'])?'required':'').' />';
350
+ }
351
+ if($args['label'] != '') { $HTML .= '&nbsp;<label for="'.(($args['id'] != '')?$args['id']:'').'">'.$args['label'].'</label>'; }
352
+ if($args['helpText'] != '') { $HTML .= '<small>'.$args['helpText'].'</small>'; }
353
+ if($args['useParagraph']) { $HTML .= '</p>'; }
354
+ $JS .= 'jQuery("#'.(($args['id'] != '')?$args['id']:'').'").button({ create: function(event, ui) { jQuery(this).button("option", "label", (jQuery(this).is(":checked")?"'.(($args['checkedLabel'] != '')?$args['checkedLabel']:'').'":"'.(($args['uncheckedLabel'] != '')?$args['uncheckedLabel']:'').'")) }}).change(function () { jQuery(this).button("option", "label", (jQuery(this).is(":checked")?"'.(($args['checkedLabel'] != '')?$args['checkedLabel']:'').'":"'.(($args['uncheckedLabel'] != '')?$args['uncheckedLabel']:'').'")); });';
355
+ break;
356
+ case 'pages-select':
357
+ $this->load_data('pages');
358
+ if($args['useParagraph']) { $HTML .= '<p>'; }
359
+ if($args['label'] != '') { $HTML .= '<label '.(($args['name'] != '')?'for="'.$args['name'].'"':'').'>'.$args['label'].'</label><br />'; }
360
+ $HTML .= '<select '.(($args['id'] != '')?'id="'.$args['id'].'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' '.(($args['value'] != '')?'value="'.$args['value'].'"':'').' '.(($args['className'] != '')?'class="'.$args['className'].'"':'').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' '.(($args['required'])?'required':'').'>';
361
+ if(is_array($this->pages)) {
362
+ foreach($this->pages as $option) {
363
+ $HTML .= '<option '.(($option['value'] != '')?'value="'.$option['value'].'"':'').' '.selected((($args['value'] != '')?$args['value']:''), (($option['value'] != '')?$option['value']:''), false).'>'.(($option['text'] != '')?$option['text']:'').'</option>';
364
+ }
365
+ }
366
+ $HTML .= '</select>';
367
+ if($args['helpText'] != '') { $HTML .= '<small>'.$args['helpText'].'</small>'; }
368
+ if($args['useParagraph']) { $HTML .= '</p>'; }
369
+ break;
370
+ case 'pages-chosen-multiselect':
371
+ $this->load_data('pages');
372
+ if($args['useParagraph']) { $HTML .= '<p>'; }
373
+ if($args['label'] != '') { $HTML .= '<label '.(($args['name'] != '')?'for="'.$args['name'].'"':'').'>'.$args['label'].'</label><br />'; }
374
+ $HTML .= '<select multiple data-placeholder="'.(($args['label'] != '')?$args['label']:'Select Your Options').'" '.(($args['id'] != '')?'id="'.$args['id'].'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' '.(($args['value'] != '')?'value="'.$args['value'].'"':'').' '.(($args['className'] != '')?'class="'.$args['className'].'"':'').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' '.(($args['required'])?'required':'').'>';
375
+ if(is_array($this->pages)) {
376
+ foreach($this->pages as $option) {
377
+ if(in_array((($option['value'] != '')?$option['value']:''), ((is_array($args['value']))?$args['value']:array()))) {
378
+ $HTML .= '<option '.(($option['value'] != '')?'value="'.$option['value'].'"':'').' '.selected(1, 1, false).'>'.(($option['text'] != '')?$option['text']:'').'</option>';
379
+ } else {
380
+ $HTML .= '<option '.(($option['value'] != '')?'value="'.$option['value'].'"':'').'>'.(($option['text'] != '')?$option['text']:'').'</option>';
381
+ }
382
+ }
383
+ }
384
+ $HTML .= '</select>';
385
+ if($args['helpText'] != '') { $HTML .= '<small>'.$args['helpText'].'</small>'; }
386
+ if($args['useParagraph']) { $HTML .= '</p>'; }
387
+ $JS .= 'jQuery("#'.(($args['id'] != '')?$args['id']:'').'").chosen({ width: "100%" }).on("change", function(evt, params) { jQuery("#'.(($args['id'] != '')?$args['id']:'').'_chosen .search-field input").click(); }).trigger("chosen:open");';
388
+ break;
389
+ case 'posts-select':
390
+ $this->load_data('posts');
391
+ if($args['useParagraph']) { $HTML .= '<p>'; }
392
+ if($args['label'] != '') { $HTML .= '<label '.(($args['name'] != '')?'for="'.$args['name'].'"':'').'>'.$args['label'].'</label><br />'; }
393
+ $HTML .= '<select '.(($args['id'] != '')?'id="'.$args['id'].'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' '.(($args['value'] != '')?'value="'.$args['value'].'"':'').' '.(($args['className'] != '')?'class="'.$args['className'].'"':'').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' '.(($args['required'])?'required':'').'>';
394
+ if(is_array($this->posts)) {
395
+ foreach($this->posts as $option) {
396
+ $HTML .= '<option '.(($option['value'] != '')?'value="'.$option['value'].'"':'').' '.selected((($args['value'] != '')?$args['value']:''), (($option['value'] != '')?$option['value']:''), false).'>'.(($option['text'] != '')?$option['text']:'').'</option>';
397
+ }
398
+ }
399
+ $HTML .= '</select>';
400
+ if($args['helpText'] != '') { $HTML .= '<small>'.$args['helpText'].'</small>'; }
401
+ if($args['useParagraph']) { $HTML .= '</p>'; }
402
+ break;
403
+ case 'posts-chosen-multiselect':
404
+ $this->load_data('posts');
405
+ if($args['useParagraph']) { $HTML .= '<p>'; }
406
+ if($args['label'] != '') { $HTML .= '<label '.(($args['name'] != '')?'for="'.$args['name'].'"':'').'>'.$args['label'].'</label><br />'; }
407
+ $HTML .= '<select multiple data-placeholder="'.(($args['label'] != '')?$args['label']:'Select Your Options').'" '.(($args['id'] != '')?'id="'.$args['id'].'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' '.(($args['value'] != '')?'value="'.$args['value'].'"':'').' '.(($args['className'] != '')?'class="'.$args['className'].'"':'').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' '.(($args['required'])?'required':'').'>';
408
+ if(is_array($this->posts)) {
409
+ foreach($this->posts as $option) {
410
+ if(in_array((($option['value'] != '')?$option['value']:''), ((is_array($args['value']))?$args['value']:array()))) {
411
+ $HTML .= '<option '.(($option['value'] != '')?'value="'.$option['value'].'"':'').' '.selected(1, 1, false).'>'.(($option['text'] != '')?$option['text']:'').'</option>';
412
+ } else {
413
+ $HTML .= '<option '.(($option['value'] != '')?'value="'.$option['value'].'"':'').'>'.(($option['text'] != '')?$option['text']:'').'</option>';
414
+ }
415
+ }
416
+ }
417
+ $HTML .= '</select>';
418
+ if($args['helpText'] != '') { $HTML .= '<small>'.$args['helpText'].'</small>'; }
419
+ if($args['useParagraph']) { $HTML .= '</p>'; }
420
+ $JS .= 'jQuery("#'.(($args['id'] != '')?$args['id']:'').'").chosen({ width: "100%" }).on("change", function(evt, params) { jQuery("#'.(($args['id'] != '')?$args['id']:'').'_chosen .search-field input").click(); }).trigger("chosen:open");';
421
+ break;
422
+ case 'categories-select':
423
+ $this->load_data('categories');
424
+ if($args['useParagraph']) { $HTML .= '<p>'; }
425
+ if($args['label'] != '') { $HTML .= '<label '.(($args['name'] != '')?'for="'.$args['name'].'"':'').'>'.$args['label'].'</label><br />'; }
426
+ $HTML .= '<select '.(($args['id'] != '')?'id="'.$args['id'].'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' '.(($args['value'] != '')?'value="'.$args['value'].'"':'').' '.(($args['className'] != '')?'class="'.$args['className'].'"':'').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' '.(($args['required'])?'required':'').'>';
427
+ if(is_array($this->categories)) {
428
+ foreach($this->categories as $option) {
429
+ $HTML .= '<option '.(($option['value'] != '')?'value="'.$option['value'].'"':'').' '.selected((($args['value'] != '')?$args['value']:''), (($option['value'] != '')?$option['value']:''), false).'>'.(($option['text'] != '')?$option['text']:'').'</option>';
430
+ }
431
+ }
432
+ $HTML .= '</select>';
433
+ if($args['helpText'] != '') { $HTML .= '<small>'.$args['helpText'].'</small>'; }
434
+ if($args['useParagraph']) { $HTML .= '</p>'; }
435
+ break;
436
+ case 'categories-chosen-multiselect':
437
+ $this->load_data('categories');
438
+ if($args['useParagraph']) { $HTML .= '<p>'; }
439
+ if($args['label'] != '') { $HTML .= '<label '.(($args['name'] != '')?'for="'.$args['name'].'"':'').'>'.$args['label'].'</label><br />'; }
440
+ $HTML .= '<select multiple data-placeholder="'.(($args['label'] != '')?$args['label']:'Select Your Options').'" '.(($args['id'] != '')?'id="'.$args['id'].'"':'').' '.(($args['name'] != '')?'name="'.$args['name'].'"':'').' '.(($args['value'] != '')?'value="'.$args['value'].'"':'').' '.(($args['className'] != '')?'class="'.$args['className'].'"':'').' '.(($args['style'] != '')?'style="'.$args['style'].'"':'').' '.(($args['required'])?'required':'').'>';
441
+ if(is_array($this->categories)) {
442
+ foreach($this->categories as $option) {
443
+ if(in_array((($option['value'] != '')?$option['value']:''), ((is_array($args['value']))?$args['value']:array()))) {
444
+ $HTML .= '<option '.(($option['value'] != '')?'value="'.$option['value'].'"':'').' '.selected(1, 1, false).'>'.(($option['text'] != '')?$option['text']:'').'</option>';
445
+ } else {
446
+ $HTML .= '<option '.(($option['value'] != '')?'value="'.$option['value'].'"':'').'>'.(($option['text'] != '')?$option['text']:'').'</option>';
447
+ }
448
+ }
449
+ }
450
+ $HTML .= '</select>';
451
+ if($args['helpText'] != '') { $HTML .= '<small>'.$args['helpText'].'</small>'; }
452
+ if($args['useParagraph']) { $HTML .= '</p>'; }
453
+ $JS .= 'jQuery("#'.(($args['id'] != '')?$args['id']:'').'").chosen({ width: "100%" }).on("change", function(evt, params) { jQuery("#'.(($args['id'] != '')?$args['id']:'').'_chosen .search-field input").click(); }).trigger("chosen:open");';
454
+ break;
455
+ }
456
+
457
+ if($args['plainHTML'] && !$ignorePlainHTML) {
458
+ return $HTML;
459
+ } else {
460
+ return array(
461
+ 'HTML' => $HTML,
462
+ 'JS' => $JS
463
+ );
464
+ }
465
+ }
466
+
467
+ private function load_data($type) {
468
+ switch($type) {
469
+ case 'pages':
470
+ if(!is_array($this->pages)) {
471
+ $pages = get_pages('numberposts=-1');
472
+ if(isset($pages) && is_array($pages)) {
473
+ $this->pages = array();
474
+ foreach($pages as $page) {
475
+ $this->pages[] = array('text' => (($page->post_title != '')?$page->post_title:'Untitled Page ('.$page->ID.')'), 'value' => $page->ID);
476
+ }
477
+ }
478
+ }
479
+ break;
480
+ case 'posts':
481
+ if(!is_array($this->posts)) {
482
+ $posts = get_posts('numberposts=-1');
483
+ if(isset($posts) && is_array($posts)) {
484
+ $this->posts = array();
485
+ foreach($posts as $post) {
486
+ $this->posts[] = array('text' => $post->post_title, 'value' => $post->ID);
487
+ }
488
+ }
489
+ }
490
+ break;
491
+ case 'categories':
492
+ if(!is_array($this->categories)) {
493
+ $categories = get_categories('number=200&hide_empty=0');
494
+ if(isset($categories) && is_array($categories)) {
495
+ $this->categories = array();
496
+ foreach($categories as $category) {
497
+ $this->categories[] = array('text' => $category->name, 'value' => $category->term_id);
498
+ }
499
+ }
500
+ }
501
+ break;
502
+ }
503
+ }
504
+
505
+ public function create_section($sectionTitle = '', $includeBlock = true) {
506
+ $wrapperHTML = '<div class="smartlogixControlsSectionWrapper">';
507
+ if($sectionTitle != '') {
508
+ $wrapperHTML .= '<label class="smartlogixControlsSectionTitle">'.$sectionTitle.'</label>';
509
+ }
510
+ if($includeBlock) {
511
+ $wrapperHTML .= $this->create_block();
512
+ }
513
+ $wrapperHTML .= $this->HTML;
514
+ $wrapperHTML .= '</div>';
515
+ $this->HTML = $wrapperHTML;
516
+ }
517
+
518
+ public function create_block() {
519
+ $this->HTML = '<div class="smartlogixControlsSectionInner">'.$this->HTML.'</div>';
520
+ }
521
+
522
+ public function set_HTML($HTML) {
523
+ $this->HTML = $HTML;
524
+ }
525
+
526
+ public function clear_controls($clearHTML = true, $clearJS = false) {
527
+ if($clearHTML) {
528
+ $this->HTML = '';
529
+ }
530
+ if($clearJS) {
531
+ $this->JS = '';
532
+ }
533
+ }
534
+
535
+ public static function enqueue_assets($path, $version = '1') {
536
+ wp_register_style('smartlogix-controls-css', $path.'/assets/css/controls.css', array(), $version);
537
+ wp_enqueue_style('smartlogix-controls-css');
538
+ wp_register_script('smartlogix-controls-js', $path.'/assets/js/controls.js', array('jquery', 'jquery-ui-core'), $version);
539
+ wp_enqueue_script('smartlogix-controls-js');
540
+ }
541
+ }
542
+ ?>
includes/includes.php DELETED
@@ -1,10 +0,0 @@
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 ADDED
@@ -0,0 +1,491 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* Begin Ad Above Post Content */
3
+ add_action('wp_ajax_wp_insert_inpostads_above_form_get_content', 'wp_insert_inpostads_above_form_get_content');
4
+ function wp_insert_inpostads_above_form_get_content() {
5
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
6
+ wp_insert_inpostads_form_get_content('above');
7
+ die();
8
+ }
9
+
10
+ add_action('wp_ajax_wp_insert_inpostads_above_form_save_action', 'wp_insert_inpostads_above_form_save_action');
11
+ function wp_insert_inpostads_above_form_save_action() {
12
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
13
+ wp_insert_inpostads_form_save_action('above');
14
+ die();
15
+ }
16
+ /* End Ad Above Post Content */
17
+
18
+ /* Begin Ad Middle Post Content */
19
+ add_action('wp_ajax_wp_insert_inpostads_middle_form_get_content', 'wp_insert_inpostads_middle_form_get_content');
20
+ function wp_insert_inpostads_middle_form_get_content() {
21
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
22
+ wp_insert_inpostads_form_get_content('middle');
23
+ die();
24
+ }
25
+
26
+ add_action('wp_ajax_wp_insert_inpostads_middle_form_save_action', 'wp_insert_inpostads_middle_form_save_action');
27
+ function wp_insert_inpostads_middle_form_save_action() {
28
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
29
+ wp_insert_inpostads_form_save_action('middle');
30
+ die();
31
+ }
32
+ /* End Ad Middle Post Content */
33
+
34
+ /* Begin Ad Below Post Content */
35
+ add_action('wp_ajax_wp_insert_inpostads_below_form_get_content', 'wp_insert_inpostads_below_form_get_content');
36
+ function wp_insert_inpostads_below_form_get_content() {
37
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
38
+ wp_insert_inpostads_form_get_content('below');
39
+ die();
40
+ }
41
+
42
+ add_action('wp_ajax_wp_insert_inpostads_below_form_save_action', 'wp_insert_inpostads_below_form_save_action');
43
+ function wp_insert_inpostads_below_form_save_action() {
44
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
45
+ wp_insert_inpostads_form_save_action('below');
46
+ die();
47
+ }
48
+ /* End Ad Below Post Content */
49
+
50
+ /* Begin Ad Left Post Content */
51
+ add_action('wp_ajax_wp_insert_inpostads_left_form_get_content', 'wp_insert_inpostads_left_form_get_content');
52
+ function wp_insert_inpostads_left_form_get_content() {
53
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
54
+ wp_insert_inpostads_form_get_content('left');
55
+ die();
56
+ }
57
+
58
+ add_action('wp_ajax_wp_insert_inpostads_left_form_save_action', 'wp_insert_inpostads_left_form_save_action');
59
+ function wp_insert_inpostads_left_form_save_action() {
60
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
61
+ wp_insert_inpostads_form_save_action('left');
62
+ die();
63
+ }
64
+ /* End Ad Left Post Content */
65
+
66
+ /* Begin Ad Right Post Content */
67
+ add_action('wp_ajax_wp_insert_inpostads_right_form_get_content', 'wp_insert_inpostads_right_form_get_content');
68
+ function wp_insert_inpostads_right_form_get_content() {
69
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
70
+ wp_insert_inpostads_form_get_content('right');
71
+ die();
72
+ }
73
+
74
+ add_action('wp_ajax_wp_insert_inpostads_right_form_save_action', 'wp_insert_inpostads_right_form_save_action');
75
+ function wp_insert_inpostads_right_form_save_action() {
76
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
77
+ wp_insert_inpostads_form_save_action('right');
78
+ die();
79
+ }
80
+ /* End Ad Right Post Content */
81
+
82
+ /* Begin Shared UI Functions */
83
+ function wp_insert_inpostads_form_get_content($position) {
84
+ $inpostads = get_option('wp_insert_inpostads');
85
+ echo '<div class="wp_insert_popup_content_wrapper">';
86
+ $posts_per_page = get_option('posts_per_page');
87
+ $instances = array();
88
+ for($i = 1; $i <= $posts_per_page; $i++) {
89
+ $instances[] = array('text' => 'Hide on '.wp_insert_add_ordinal_number_suffix($i).' Post', 'value' => $i);
90
+ }
91
+ $control = new smartlogixControls(array('optionIdentifier' => 'wp_insert_inpostads['.$position.']', 'values' => $inpostads[$position]));
92
+ $control->add_control(array('type' => 'ipCheckbox', 'optionName' => 'status'));
93
+ echo '<div id="wp_insert_inpostads_'.$position.'_accordion">';
94
+ echo '<h3>Ad Code</h3>';
95
+ echo '<div>';
96
+ $abtestingMode = get_option('wp_insert_abtesting_mode');
97
+ $control->add_control(array('type' => 'textarea', 'style' => 'height: 220px;', 'optionName' => 'primary_ad_code'));
98
+ $control->create_section('Ad Code (Primary Network)');
99
+ echo $control->HTML;
100
+ $control->clear_controls();
101
+
102
+ $control->add_control(array('type' => 'textarea', 'style' => 'height: 220px;', 'optionName' => 'secondary_ad_code'));
103
+ $control->create_section('Ad Code (Secondary Network)');
104
+ if($abtestingMode != '2' && $abtestingMode != '3') {
105
+ $control->set_HTML('<div style="display: none;">'.$control->HTML.'</div>');
106
+ }
107
+ echo $control->HTML;
108
+ $control->clear_controls();
109
+
110
+ $control->add_control(array('type' => 'textarea', 'style' => 'height: 220px;', 'optionName' => 'tertiary_ad_code'));
111
+ $control->create_section('Ad Code (Tertiary Network)');
112
+ if($abtestingMode != '3') {
113
+ $control->set_HTML('<div style="display: none;">'.$control->HTML.'</div>');
114
+ }
115
+ echo $control->HTML;
116
+ $control->clear_controls();
117
+ echo '</div>';
118
+ echo '<h3>Rules</h3>';
119
+ echo '<div>';
120
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_loggedin'));
121
+ $control->create_section('Logged in Users');
122
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
123
+ echo $control->HTML;
124
+ $control->clear_controls();
125
+
126
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_mobile_devices'));
127
+ $control->create_section('Mobile Devices');
128
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
129
+ echo $control->HTML;
130
+ $control->clear_controls();
131
+
132
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_home'));
133
+ $control->add_control(array('type' => 'choosen-multiselect', 'label' => 'Instances', 'optionName' => 'rules_home_instances', 'options' => $instances));
134
+ $control->create_section('Home');
135
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
136
+ echo $control->HTML;
137
+ $control->clear_controls();
138
+
139
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_archives'));
140
+ $control->add_control(array('type' => 'choosen-multiselect', 'label' => 'Instances', 'optionName' => 'rules_archives_instances', 'options' => $instances));
141
+ $control->create_section('Archives');
142
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
143
+ echo $control->HTML;
144
+ $control->clear_controls();
145
+
146
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_search'));
147
+ $control->add_control(array('type' => 'choosen-multiselect', 'label' => 'Instances', 'optionName' => 'rules_search_instances', 'options' => $instances));
148
+ $control->create_section('Search Results');
149
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
150
+ echo $control->HTML;
151
+ $control->clear_controls();
152
+
153
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_page'));
154
+ $control->add_control(array('type' => 'pages-chosen-multiselect', 'label' => 'Exceptions', 'optionName' => 'rules_page_exceptions'));
155
+ $control->create_section('Single Pages');
156
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
157
+ echo $control->HTML;
158
+ $control->clear_controls();
159
+
160
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_post'));
161
+ $control->add_control(array('type' => 'posts-chosen-multiselect', 'label' => 'Exceptions', 'optionName' => 'rules_post_exceptions'));
162
+ $control->add_control(array('type' => 'categories-chosen-multiselect', 'label' => 'Category Exceptions', 'optionName' => 'rules_post_categories_exceptions'));
163
+ $control->create_section('Single Posts');
164
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
165
+ echo $control->HTML;
166
+ $control->clear_controls();
167
+
168
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_categories'));
169
+ $control->add_control(array('type' => 'choosen-multiselect', 'label' => 'Instances', 'optionName' => 'rules_categories_instances', 'options' => $instances));
170
+ $control->add_control(array('type' => 'categories-chosen-multiselect', 'label' => 'Exceptions', 'optionName' => 'rules_categories_exceptions'));
171
+ $control->create_section('Category Archives');
172
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
173
+ echo $control->HTML;
174
+ $control->clear_controls();
175
+
176
+ echo '</div>';
177
+ echo '<h3>Geo Targeting</h3>';
178
+ echo '<div>';
179
+ echo '<p>A Geo Targeted Ads have a higher priority than Ads configured via Multiple Ad Networks / A-B Testing.<br />If a Geo Targeting match is found all other Ads (Primary, Secondary and Tertiary Networks) will be ignored.</p>';
180
+ $control->add_control(array('type' => 'choosen-multiselect', 'label' => 'Countries', 'optionName' => 'geo_group1_countries', 'options' => wp_insert_get_countries()));
181
+ $control->add_control(array('type' => 'textarea', 'label' => 'Ad Code', 'style' => 'height: 220px;', 'optionName' => 'geo_group1_adcode'));
182
+ $control->create_section('Group 1');
183
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
184
+ echo $control->HTML;
185
+ $control->clear_controls();
186
+
187
+ $control->add_control(array('type' => 'choosen-multiselect', 'label' => 'Countries', 'optionName' => 'geo_group2_countries', 'options' => wp_insert_get_countries()));
188
+ $control->add_control(array('type' => 'textarea', 'label' => 'Ad Code', 'style' => 'height: 220px;', 'optionName' => 'geo_group2_adcode'));
189
+ $control->create_section('Group 2');
190
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
191
+ echo $control->HTML;
192
+ $control->clear_controls();
193
+ echo '</div>';
194
+ echo '<h3>Styles</h3>';
195
+ echo '<div>';
196
+ $control->add_control(array('type' => 'textarea', 'style' => 'height: 220px;', 'optionName' => 'styles'));
197
+ $control->create_section('Styles');
198
+ echo $control->HTML;
199
+ $control->clear_controls();
200
+ echo '</div>';
201
+ echo '<h3>Notes</h3>';
202
+ echo '<div>';
203
+ $control->add_control(array('type' => 'textarea', 'style' => 'height: 220px;', 'optionName' => 'notes'));
204
+ $control->create_section('Notes');
205
+ echo $control->HTML;
206
+ $control->clear_controls();
207
+ echo '</div>';
208
+ if($position == 'middle') {
209
+ echo '<h3>Positioning</h3>';
210
+ echo '<div>';
211
+ $control->add_control(array('type' => 'text', 'label' => 'Minimum Character Count', 'optionName' => 'minimum_character_count', 'helpText' => '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.'));
212
+ $control->add_control(array('type' => 'text', 'label' => 'Paragraph Buffer Count', 'optionName' => 'paragraph_buffer_count', 'helpText' => '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.'));
213
+ $control->create_section('Positioning');
214
+ echo $control->HTML;
215
+ $control->clear_controls();
216
+ echo '</div>';
217
+ }
218
+ echo '</div>';
219
+ echo '<script type="text/javascript">';
220
+ echo $control->JS;
221
+ echo 'jQuery("#wp_insert_inpostads_'.$position.'_accordion").accordion({ icons: { header: "ui-icon-circle-arrow-e", activeHeader: "ui-icon-circle-arrow-s" }, heightStyle: "auto" });';
222
+ echo '</script>';
223
+ echo '</div>';
224
+ }
225
+
226
+ function wp_insert_inpostads_form_save_action($position) {
227
+ $inpostAds = get_option('wp_insert_inpostads');
228
+ $inpostAds[$position]['status'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_status']) && ($_POST['wp_insert_inpostads_'.$position.'_status'] == 'true'))?'1':'');
229
+
230
+ $inpostAds[$position]['primary_ad_code'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_primary_ad_code']))?$_POST['wp_insert_inpostads_'.$position.'_primary_ad_code']:'');
231
+ $inpostAds[$position]['secondary_ad_code'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_secondary_ad_code']))?$_POST['wp_insert_inpostads_'.$position.'_secondary_ad_code']:'');
232
+ $inpostAds[$position]['tertiary_ad_code'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_tertiary_ad_code']))?$_POST['wp_insert_inpostads_'.$position.'_tertiary_ad_code']:'');
233
+
234
+ $inpostAds[$position]['rules_exclude_loggedin'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_exclude_loggedin']))?$_POST['wp_insert_inpostads_'.$position.'_rules_exclude_loggedin']:'');
235
+ $inpostAds[$position]['rules_exclude_mobile_devices'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_exclude_mobile_devices']))?$_POST['wp_insert_inpostads_'.$position.'_rules_exclude_mobile_devices']:'');
236
+ $inpostAds[$position]['rules_exclude_home'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_exclude_home']))?$_POST['wp_insert_inpostads_'.$position.'_rules_exclude_home']:'');
237
+ $inpostAds[$position]['rules_home_instances'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_home_instances']))?$_POST['wp_insert_inpostads_'.$position.'_rules_home_instances']:'');
238
+ $inpostAds[$position]['rules_exclude_archives'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_exclude_archives']))?$_POST['wp_insert_inpostads_'.$position.'_rules_exclude_archives']:'');
239
+ $inpostAds[$position]['rules_archives_instances'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_archives_instances']))?$_POST['wp_insert_inpostads_'.$position.'_rules_archives_instances']:'');
240
+ $inpostAds[$position]['rules_exclude_search'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_exclude_search']))?$_POST['wp_insert_inpostads_'.$position.'_rules_exclude_search']:'');
241
+ $inpostAds[$position]['rules_search_instances'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_search_instances']))?$_POST['wp_insert_inpostads_'.$position.'_rules_search_instances']:'');
242
+ $inpostAds[$position]['rules_exclude_page'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_exclude_page']))?$_POST['wp_insert_inpostads_'.$position.'_rules_exclude_page']:'');
243
+ $inpostAds[$position]['rules_page_exceptions'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_page_exceptions']))?$_POST['wp_insert_inpostads_'.$position.'_rules_page_exceptions']:'');
244
+ $inpostAds[$position]['rules_exclude_post'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_exclude_post']))?$_POST['wp_insert_inpostads_'.$position.'_rules_exclude_post']:'');
245
+ $inpostAds[$position]['rules_post_exceptions'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_post_exceptions']))?$_POST['wp_insert_inpostads_'.$position.'_rules_post_exceptions']:'');
246
+ $inpostAds[$position]['rules_post_categories_exceptions'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_post_categories_exceptions']))?$_POST['wp_insert_inpostads_'.$position.'_rules_post_categories_exceptions']:'');
247
+ $inpostAds[$position]['rules_exclude_categories'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_exclude_categories']))?$_POST['wp_insert_inpostads_'.$position.'_rules_exclude_categories']:'');
248
+ $inpostAds[$position]['rules_categories_instances'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_categories_instances']))?$_POST['wp_insert_inpostads_'.$position.'_rules_categories_instances']:'');
249
+ $inpostAds[$position]['rules_categories_exceptions'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_rules_categories_exceptions']))?$_POST['wp_insert_inpostads_'.$position.'_rules_categories_exceptions']:'');
250
+
251
+ $inpostAds[$position]['geo_group1_countries'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_geo_group1_countries']))?$_POST['wp_insert_inpostads_'.$position.'_geo_group1_countries']:'');
252
+ $inpostAds[$position]['geo_group1_adcode'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_geo_group1_adcode']))?$_POST['wp_insert_inpostads_'.$position.'_geo_group1_adcode']:'');
253
+ $inpostAds[$position]['geo_group2_countries'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_geo_group2_countries']))?$_POST['wp_insert_inpostads_'.$position.'_geo_group2_countries']:'');
254
+ $inpostAds[$position]['geo_group2_adcode'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_geo_group2_adcode']))?$_POST['wp_insert_inpostads_'.$position.'_geo_group2_adcode']:'');
255
+
256
+ $inpostAds[$position]['styles'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_styles']))?$_POST['wp_insert_inpostads_'.$position.'_styles']:'');
257
+
258
+ $inpostAds[$position]['notes'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_notes']))?$_POST['wp_insert_inpostads_'.$position.'_notes']:'');
259
+
260
+ if($position == 'middle') {
261
+ $inpostAds[$position]['minimum_character_count'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_minimum_character_count']))?$_POST['wp_insert_inpostads_'.$position.'_minimum_character_count']:'');
262
+ $inpostAds[$position]['paragraph_buffer_count'] = ((isset($_POST['wp_insert_inpostads_'.$position.'_paragraph_buffer_count']))?$_POST['wp_insert_inpostads_'.$position.'_paragraph_buffer_count']:'');
263
+ }
264
+ update_option('wp_insert_inpostads', $inpostAds);
265
+ }
266
+ /* End Shared UI Functions */
267
+
268
+ /* Begin Database Upgrade */
269
+ add_action('wp_insert_upgrade_database', 'wp_insert_inpostads_upgrade_database');
270
+ function wp_insert_inpostads_upgrade_database() {
271
+ if(!get_option('wp_insert_inpostads')) {
272
+ $oldValues = get_option('wp_insert_inpostads_options');
273
+ $newValues = array(
274
+ 'above' => array (
275
+ 'status' => ((isset($oldValues['above']['status']) && $oldValues['above']['status'] == true)?'1':''),
276
+ 'primary_ad_code' => ((isset($oldValues['above']['ad_code_1']))?$oldValues['above']['ad_code_1']:''),
277
+ 'secondary_ad_code' => ((isset($oldValues['above']['ad_code_2']))?$oldValues['above']['ad_code_2']:''),
278
+ 'tertiary_ad_code' => ((isset($oldValues['above']['ad_code_3']))?$oldValues['above']['ad_code_3']:''),
279
+ 'rules_exclude_loggedin' => ((isset($oldValues['above']['rules_exclude_loggedin']))?true:false),
280
+ 'rules_exclude_mobile_devices' => ((isset($oldValues['above']['rules_exclude_mobile_devices']))?true:false),
281
+ 'rules_exclude_home' => ((isset($oldValues['above']['rules_exclude_home']))?true:false),
282
+ 'rules_home_instances' => ((isset($options['above']['rules_home_instances']) && ($options['above']['rules_home_instances'] != ''))?explode(',', $options['above']['rules_home_instances']):array()),
283
+ 'rules_exclude_archives' => ((isset($oldValues['above']['rules_exclude_archives']))?true:false),
284
+ 'rules_archives_instances' => ((isset($options['above']['rules_archives_instances']) && ($options['above']['rules_archives_instances'] != ''))?explode(',', $options['above']['rules_archives_instances']):array()),
285
+ 'rules_exclude_search' => ((isset($oldValues['above']['rules_exclude_search']))?true:false),
286
+ 'rules_search_instances' => ((isset($options['above']['rules_search_instances']) && ($options['above']['rules_search_instances'] != ''))?explode(',', $options['above']['rules_search_instances']):array()),
287
+ 'rules_exclude_page' => ((isset($oldValues['above']['rules_exclude_page']))?true:false),
288
+ 'rules_page_exceptions' => ((isset($options['above']['rules_page_exceptions']) && ($options['above']['rules_page_exceptions'] != ''))?explode(',', $options['above']['rules_page_exceptions']):array()),
289
+ 'rules_exclude_post' => ((isset($oldValues['above']['rules_exclude_post']))?true:false),
290
+ 'rules_post_exceptions' => ((isset($options['above']['rules_post_exceptions']) && ($options['above']['rules_post_exceptions'] != ''))?explode(',', $options['above']['rules_post_exceptions']):array()),
291
+ 'rules_post_categories_exceptions' => ((isset($options['above']['rules_post_categories_exceptions']) && ($options['above']['rules_post_categories_exceptions'] != ''))?explode(',', $options['above']['rules_post_categories_exceptions']):array()),
292
+ 'rules_exclude_categories' => ((isset($oldValues['above']['rules_exclude_categories']))?true:false),
293
+ 'rules_categories_instances' => ((isset($options['above']['rules_categories_instances']) && ($options['above']['rules_categories_instances'] != ''))?explode(',', $options['above']['rules_categories_instances']):array()),
294
+ 'rules_categories_exceptions' => ((isset($options['above']['rules_categories_exceptions']) && ($options['above']['rules_categories_exceptions'] != ''))?explode(',', $options['above']['rules_categories_exceptions']):array()),
295
+ 'geo_group1_countries' => ((isset($options['above']['country_1']) && ($options['above']['country_1'] != ''))?explode(',', $options['above']['country_1']):array()),
296
+ 'geo_group1_adcode' => ((isset($oldValues['above']['country_code_1']))?$oldValues['above']['country_code_1']:''),
297
+ 'geo_group2_countries' => array(),
298
+ 'geo_group2_adcode' => '',
299
+ 'styles' => ((isset($oldValues['above']['styles']))?$oldValues['above']['styles']:'margin: 5px; padding: 0px;'),
300
+ 'notes' => ((isset($oldValues['above']['notes']))?$oldValues['above']['notes']:''),
301
+ ),
302
+ 'middle' => array (
303
+ 'status' => ((isset($oldValues['middle']['status']) && $oldValues['middle']['status'] == true)?'1':''),
304
+ 'primary_ad_code' => ((isset($oldValues['middle']['ad_code_1']))?$oldValues['middle']['ad_code_1']:''),
305
+ 'secondary_ad_code' => ((isset($oldValues['middle']['ad_code_2']))?$oldValues['middle']['ad_code_2']:''),
306
+ 'tertiary_ad_code' => ((isset($oldValues['middle']['ad_code_3']))?$oldValues['middle']['ad_code_3']:''),
307
+ 'rules_exclude_loggedin' => ((isset($oldValues['middle']['rules_exclude_loggedin']))?true:false),
308
+ 'rules_exclude_mobile_devices' => ((isset($oldValues['middle']['rules_exclude_mobile_devices']))?true:false),
309
+ 'rules_exclude_home' => ((isset($oldValues['middle']['rules_exclude_home']))?true:false),
310
+ 'rules_home_instances' => ((isset($options['middle']['rules_home_instances']) && ($options['middle']['rules_home_instances'] != ''))?explode(',', $options['middle']['rules_home_instances']):array()),
311
+ 'rules_exclude_archives' => ((isset($oldValues['middle']['rules_exclude_archives']))?true:false),
312
+ 'rules_archives_instances' => ((isset($options['middle']['rules_archives_instances']) && ($options['middle']['rules_archives_instances'] != ''))?explode(',', $options['middle']['rules_archives_instances']):array()),
313
+ 'rules_exclude_search' => ((isset($oldValues['middle']['rules_exclude_search']))?true:false),
314
+ 'rules_search_instances' => ((isset($options['middle']['rules_search_instances']) && ($options['middle']['rules_search_instances'] != ''))?explode(',', $options['middle']['rules_search_instances']):array()),
315
+ 'rules_exclude_page' => ((isset($oldValues['middle']['rules_exclude_page']))?true:false),
316
+ 'rules_page_exceptions' => ((isset($options['middle']['rules_page_exceptions']) && ($options['middle']['rules_page_exceptions'] != ''))?explode(',', $options['middle']['rules_page_exceptions']):array()),
317
+ 'rules_exclude_post' => ((isset($oldValues['middle']['rules_exclude_post']))?true:false),
318
+ 'rules_post_exceptions' => ((isset($options['middle']['rules_post_exceptions']) && ($options['middle']['rules_post_exceptions'] != ''))?explode(',', $options['middle']['rules_post_exceptions']):array()),
319
+ 'rules_post_categories_exceptions' => ((isset($options['middle']['rules_post_categories_exceptions']) && ($options['middle']['rules_post_categories_exceptions'] != ''))?explode(',', $options['middle']['rules_post_categories_exceptions']):array()),
320
+ 'rules_exclude_categories' => ((isset($oldValues['middle']['rules_exclude_categories']))?true:false),
321
+ 'rules_categories_instances' => ((isset($options['middle']['rules_categories_instances']) && ($options['middle']['rules_categories_instances'] != ''))?explode(',', $options['middle']['rules_categories_instances']):array()),
322
+ 'rules_categories_exceptions' => ((isset($options['middle']['rules_categories_exceptions']) && ($options['middle']['rules_categories_exceptions'] != ''))?explode(',', $options['middle']['rules_categories_exceptions']):array()),
323
+ 'geo_group1_countries' => ((isset($options['middle']['country_1']) && ($options['middle']['country_1'] != ''))?explode(',', $options['middle']['country_1']):array()),
324
+ 'geo_group1_adcode' => ((isset($oldValues['middle']['country_code_1']))?$oldValues['middle']['country_code_1']:''),
325
+ 'geo_group2_countries' => array(),
326
+ 'geo_group2_adcode' => '',
327
+ 'styles' => ((isset($oldValues['middle']['styles']))?$oldValues['middle']['styles']:'margin: 5px; padding: 0px;'),
328
+ 'notes' => ((isset($oldValues['middle']['notes']))?$oldValues['middle']['notes']:''),
329
+ 'minimum_character_count' => ((isset($oldValues['middle']['minimum_character_count']))?$oldValues['middle']['minimum_character_count']:'500'),
330
+ 'paragraph_buffer_count' => ((isset($oldValues['middle']['paragraph_buffer_count']))?$oldValues['middle']['paragraph_buffer_count']:''),
331
+ ),
332
+ 'below' => array (
333
+ 'status' => ((isset($oldValues['below']['status']) && $oldValues['below']['status'] == true)?'1':''),
334
+ 'primary_ad_code' => ((isset($oldValues['below']['ad_code_1']))?$oldValues['below']['ad_code_1']:''),
335
+ 'secondary_ad_code' => ((isset($oldValues['below']['ad_code_2']))?$oldValues['below']['ad_code_2']:''),
336
+ 'tertiary_ad_code' => ((isset($oldValues['below']['ad_code_3']))?$oldValues['below']['ad_code_3']:''),
337
+ 'rules_exclude_loggedin' => ((isset($oldValues['below']['rules_exclude_loggedin']))?true:false),
338
+ 'rules_exclude_mobile_devices' => ((isset($oldValues['below']['rules_exclude_mobile_devices']))?true:false),
339
+ 'rules_exclude_home' => ((isset($oldValues['below']['rules_exclude_home']))?true:false),
340
+ 'rules_home_instances' => ((isset($options['below']['rules_home_instances']) && ($options['below']['rules_home_instances'] != ''))?explode(',', $options['below']['rules_home_instances']):array()),
341
+ 'rules_exclude_archives' => ((isset($oldValues['below']['rules_exclude_archives']))?true:false),
342
+ 'rules_archives_instances' => ((isset($options['below']['rules_archives_instances']) && ($options['below']['rules_archives_instances'] != ''))?explode(',', $options['below']['rules_archives_instances']):array()),
343
+ 'rules_exclude_search' => ((isset($oldValues['below']['rules_exclude_search']))?true:false),
344
+ 'rules_search_instances' => ((isset($options['below']['rules_search_instances']) && ($options['below']['rules_search_instances'] != ''))?explode(',', $options['below']['rules_search_instances']):array()),
345
+ 'rules_exclude_page' => ((isset($oldValues['below']['rules_exclude_page']))?true:false),
346
+ 'rules_page_exceptions' => ((isset($options['below']['rules_page_exceptions']) && ($options['below']['rules_page_exceptions'] != ''))?explode(',', $options['below']['rules_page_exceptions']):array()),
347
+ 'rules_exclude_post' => ((isset($oldValues['below']['rules_exclude_post']))?true:false),
348
+ 'rules_post_exceptions' => ((isset($options['below']['rules_post_exceptions']) && ($options['below']['rules_post_exceptions'] != ''))?explode(',', $options['below']['rules_post_exceptions']):array()),
349
+ 'rules_post_categories_exceptions' => ((isset($options['below']['rules_post_categories_exceptions']) && ($options['below']['rules_post_categories_exceptions'] != ''))?explode(',', $options['below']['rules_post_categories_exceptions']):array()),
350
+ 'rules_exclude_categories' => ((isset($oldValues['below']['rules_exclude_categories']))?true:false),
351
+ 'rules_categories_instances' => ((isset($options['below']['rules_categories_instances']) && ($options['below']['rules_categories_instances'] != ''))?explode(',', $options['below']['rules_categories_instances']):array()),
352
+ 'rules_categories_exceptions' => ((isset($options['below']['rules_categories_exceptions']) && ($options['below']['rules_categories_exceptions'] != ''))?explode(',', $options['below']['rules_categories_exceptions']):array()),
353
+ 'geo_group1_countries' => ((isset($options['below']['country_1']) && ($options['below']['country_1'] != ''))?explode(',', $options['below']['country_1']):array()),
354
+ 'geo_group1_adcode' => ((isset($oldValues['below']['country_code_1']))?$oldValues['below']['country_code_1']:''),
355
+ 'geo_group2_countries' => array(),
356
+ 'geo_group2_adcode' => '',
357
+ 'styles' => ((isset($oldValues['below']['styles']))?$oldValues['below']['styles']:'margin: 5px; padding: 0px;'),
358
+ 'notes' => ((isset($oldValues['below']['notes']))?$oldValues['below']['notes']:''),
359
+ ),
360
+ 'left' => array (
361
+ 'status' => ((isset($oldValues['left']['status']) && $oldValues['left']['status'] == true)?'1':''),
362
+ 'primary_ad_code' => ((isset($oldValues['left']['ad_code_1']))?$oldValues['left']['ad_code_1']:''),
363
+ 'secondary_ad_code' => ((isset($oldValues['left']['ad_code_2']))?$oldValues['left']['ad_code_2']:''),
364
+ 'tertiary_ad_code' => ((isset($oldValues['left']['ad_code_3']))?$oldValues['left']['ad_code_3']:''),
365
+ 'rules_exclude_loggedin' => ((isset($oldValues['left']['rules_exclude_loggedin']))?true:false),
366
+ 'rules_exclude_mobile_devices' => ((isset($oldValues['left']['rules_exclude_mobile_devices']))?true:false),
367
+ 'rules_exclude_home' => ((isset($oldValues['left']['rules_exclude_home']))?true:false),
368
+ 'rules_home_instances' => ((isset($options['left']['rules_home_instances']) && ($options['left']['rules_home_instances'] != ''))?explode(',', $options['left']['rules_home_instances']):array()),
369
+ 'rules_exclude_archives' => ((isset($oldValues['left']['rules_exclude_archives']))?true:false),
370
+ 'rules_archives_instances' => ((isset($options['left']['rules_archives_instances']) && ($options['left']['rules_archives_instances'] != ''))?explode(',', $options['left']['rules_archives_instances']):array()),
371
+ 'rules_exclude_search' => ((isset($oldValues['left']['rules_exclude_search']))?true:false),
372
+ 'rules_search_instances' => ((isset($options['left']['rules_search_instances']) && ($options['left']['rules_search_instances'] != ''))?explode(',', $options['left']['rules_search_instances']):array()),
373
+ 'rules_exclude_page' => ((isset($oldValues['left']['rules_exclude_page']))?true:false),
374
+ 'rules_page_exceptions' => ((isset($options['left']['rules_page_exceptions']) && ($options['left']['rules_page_exceptions'] != ''))?explode(',', $options['left']['rules_page_exceptions']):array()),
375
+ 'rules_exclude_post' => ((isset($oldValues['left']['rules_exclude_post']))?true:false),
376
+ 'rules_post_exceptions' => ((isset($options['left']['rules_post_exceptions']) && ($options['left']['rules_post_exceptions'] != ''))?explode(',', $options['left']['rules_post_exceptions']):array()),
377
+ 'rules_post_categories_exceptions' => ((isset($options['left']['rules_post_categories_exceptions']) && ($options['left']['rules_post_categories_exceptions'] != ''))?explode(',', $options['left']['rules_post_categories_exceptions']):array()),
378
+ 'rules_exclude_categories' => ((isset($oldValues['left']['rules_exclude_categories']))?true:false),
379
+ 'rules_categories_instances' => ((isset($options['left']['rules_categories_instances']) && ($options['left']['rules_categories_instances'] != ''))?explode(',', $options['left']['rules_categories_instances']):array()),
380
+ 'rules_categories_exceptions' => ((isset($options['left']['rules_categories_exceptions']) && ($options['left']['rules_categories_exceptions'] != ''))?explode(',', $options['left']['rules_categories_exceptions']):array()),
381
+ 'geo_group1_countries' => ((isset($options['left']['country_1']) && ($options['left']['country_1'] != ''))?explode(',', $options['left']['country_1']):array()),
382
+ 'geo_group1_adcode' => ((isset($oldValues['left']['country_code_1']))?$oldValues['left']['country_code_1']:''),
383
+ 'geo_group2_countries' => array(),
384
+ 'geo_group2_adcode' => '',
385
+ 'styles' => ((isset($oldValues['left']['styles']))?$oldValues['left']['styles']:'margin: 5px; padding: 0px;'),
386
+ 'notes' => ((isset($oldValues['left']['notes']))?$oldValues['left']['notes']:''),
387
+ ),
388
+ 'right' => array (
389
+ 'status' => ((isset($oldValues['right']['status']) && $oldValues['right']['status'] == true)?'1':''),
390
+ 'primary_ad_code' => ((isset($oldValues['right']['ad_code_1']))?$oldValues['right']['ad_code_1']:''),
391
+ 'secondary_ad_code' => ((isset($oldValues['right']['ad_code_2']))?$oldValues['right']['ad_code_2']:''),
392
+ 'tertiary_ad_code' => ((isset($oldValues['right']['ad_code_3']))?$oldValues['right']['ad_code_3']:''),
393
+ 'rules_exclude_loggedin' => ((isset($oldValues['right']['rules_exclude_loggedin']))?true:false),
394
+ 'rules_exclude_mobile_devices' => ((isset($oldValues['right']['rules_exclude_mobile_devices']))?true:false),
395
+ 'rules_exclude_home' => ((isset($oldValues['right']['rules_exclude_home']))?true:false),
396
+ 'rules_home_instances' => ((isset($options['right']['rules_home_instances']) && ($options['right']['rules_home_instances'] != ''))?explode(',', $options['right']['rules_home_instances']):array()),
397
+ 'rules_exclude_archives' => ((isset($oldValues['right']['rules_exclude_archives']))?true:false),
398
+ 'rules_archives_instances' => ((isset($options['right']['rules_archives_instances']) && ($options['right']['rules_archives_instances'] != ''))?explode(',', $options['right']['rules_archives_instances']):array()),
399
+ 'rules_exclude_search' => ((isset($oldValues['right']['rules_exclude_search']))?true:false),
400
+ 'rules_search_instances' => ((isset($options['right']['rules_search_instances']) && ($options['right']['rules_search_instances'] != ''))?explode(',', $options['right']['rules_search_instances']):array()),
401
+ 'rules_exclude_page' => ((isset($oldValues['right']['rules_exclude_page']))?true:false),
402
+ 'rules_page_exceptions' => ((isset($options['right']['rules_page_exceptions']) && ($options['right']['rules_page_exceptions'] != ''))?explode(',', $options['right']['rules_page_exceptions']):array()),
403
+ 'rules_exclude_post' => ((isset($oldValues['right']['rules_exclude_post']))?true:false),
404
+ 'rules_post_exceptions' => ((isset($options['right']['rules_post_exceptions']) && ($options['right']['rules_post_exceptions'] != ''))?explode(',', $options['right']['rules_post_exceptions']):array()),
405
+ 'rules_post_categories_exceptions' => ((isset($options['right']['rules_post_categories_exceptions']) && ($options['right']['rules_post_categories_exceptions'] != ''))?explode(',', $options['right']['rules_post_categories_exceptions']):array()),
406
+ 'rules_exclude_categories' => ((isset($oldValues['right']['rules_exclude_categories']))?true:false),
407
+ 'rules_categories_instances' => ((isset($options['right']['rules_categories_instances']) && ($options['right']['rules_categories_instances'] != ''))?explode(',', $options['right']['rules_categories_instances']):array()),
408
+ 'rules_categories_exceptions' => ((isset($options['right']['rules_categories_exceptions']) && ($options['right']['rules_categories_exceptions'] != ''))?explode(',', $options['right']['rules_categories_exceptions']):array()),
409
+ 'geo_group1_countries' => ((isset($options['right']['country_1']) && ($options['right']['country_1'] != ''))?explode(',', $options['right']['country_1']):array()),
410
+ 'geo_group1_adcode' => ((isset($oldValues['right']['country_code_1']))?$oldValues['right']['country_code_1']:''),
411
+ 'geo_group2_countries' => array(),
412
+ 'geo_group2_adcode' => '',
413
+ 'styles' => ((isset($oldValues['right']['styles']))?$oldValues['right']['styles']:'margin: 5px; padding: 0px;'),
414
+ 'notes' => ((isset($oldValues['right']['notes']))?$oldValues['right']['notes']:''),
415
+ )
416
+ );
417
+ update_option('wp_insert_inpostads', $newValues);
418
+ }
419
+ }
420
+ /* End Database Upgrade */
421
+
422
+ /* Begin Ad Insertion */
423
+ add_filter('the_content', 'wp_insert_inpostads_the_content', 100);
424
+ function wp_insert_inpostads_the_content($content) {
425
+ if(!is_feed() && is_main_query()) {
426
+ $inpostAds = get_option('wp_insert_inpostads');
427
+
428
+ if(wp_insert_get_ad_status($inpostAds['middle'])) {
429
+ $paragraphCount = wp_insert_inpostads_get_paragraph_count($content);
430
+ if($paragraphCount > 1) {
431
+ if(($inpostAds['middle']['paragraph_buffer_count'] == 0) || ($inpostAds['middle']['paragraph_buffer_count'] == '')) {
432
+ $position = wp_insert_inpostads_get_midpoint('/p>', $content, round($paragraphCount / 2));
433
+ } else {
434
+ $position = wp_insert_inpostads_get_midpoint('/p>', $content, $inpostAds['middle']['paragraph_buffer_count']);
435
+ }
436
+ if($position) {
437
+ if(($inpostAds['middle']['minimum_character_count'] == 0) || ($inpostAds['middle']['minimum_character_count'] == '')) {
438
+ $content = substr_replace($content, '/p>'.'<div class="wpInsert wpInsertInPostAd wpInsertMiddle"'.(($inpostAds['middle']['styles'] != '')?' style="'.$inpostAds['middle']['styles'].'"':'').'>'.wp_insert_get_geotargeted_adcode($inpostAds['middle']).'</div>', $position, 3);
439
+ } else {
440
+ if(strlen(strip_tags($content)) > $inpostAds['middle']['minimum_character_count']) {
441
+ $content = substr_replace($content, '/p>'.'<div class="wpInsert wpInsertInPostAd wpInsertMiddle"'.(($inpostAds['middle']['styles'] != '')?' style="'.$inpostAds['middle']['styles'].'"':'').'>'.wp_insert_get_geotargeted_adcode($inpostAds['middle']).'</div>', $position, 3);
442
+ }
443
+ }
444
+ }
445
+ }
446
+ }
447
+ if(wp_insert_get_ad_status($inpostAds['left'])) {
448
+ $content = '<div class="wpInsert wpInsertInPostAd wpInsertLeft" style="float: left; '.(($inpostAds['left']['styles'] != '')?$inpostAds['left']['styles']:'').'">'.wp_insert_get_geotargeted_adcode($inpostAds['left']).'</div>'.$content;
449
+ }
450
+ if(wp_insert_get_ad_status($inpostAds['right'])) {
451
+ $content = '<div class="wpInsert wpInsertInPostAd wpInsertRight" style="float: right; '.(($inpostAds['right']['styles'] != '')?$inpostAds['right']['styles']:'').'">'.wp_insert_get_geotargeted_adcode($inpostAds['right']).'</div>'.$content;
452
+ }
453
+ if(wp_insert_get_ad_status($inpostAds['above'])) {
454
+ $content = '<div class="wpInsert wpInsertInPostAd wpInsertAbove"'.(($inpostAds['above']['styles'] != '')?' style="'.$inpostAds['above']['styles'].'"':'').'>'.wp_insert_get_geotargeted_adcode($inpostAds['above']).'</div>'.$content;
455
+ }
456
+ if(wp_insert_get_ad_status($inpostAds['below'])) {
457
+ $content = $content.'<div class="wpInsert wpInsertInPostAd wpInsertBelow"'.(($inpostAds['below']['styles'] != '')?' style="'.$inpostAds['below']['styles'].'"':'').'>'.wp_insert_get_geotargeted_adcode($inpostAds['below']).'</div>';
458
+ }
459
+ }
460
+ return $content;
461
+ }
462
+
463
+ function wp_insert_inpostads_get_paragraph_count($content) {
464
+ $paragraphs = explode('/p>', $content);
465
+ $paragraphCount = 0;
466
+ if(is_array($paragraphs)) {
467
+ foreach($paragraphs as $paragraph) {
468
+ if(strlen($paragraph) > 1) {
469
+ $paragraphCount++;
470
+ }
471
+ }
472
+ }
473
+ return $paragraphCount;
474
+ }
475
+
476
+ function wp_insert_inpostads_get_midpoint($search, $string, $offset) {
477
+ $arr = explode($search, $string);
478
+ switch($offset) {
479
+ case $offset == 0:
480
+ return false;
481
+ break;
482
+ case $offset > max(array_keys($arr)):
483
+ return false;
484
+ break;
485
+ default:
486
+ return strlen(implode($search, array_slice($arr, 0, $offset)));
487
+ break;
488
+ }
489
+ }
490
+ /* End Ad Insertion */
491
+ ?>
includes/inpostads/activate-upgrade.php DELETED
@@ -1,216 +0,0 @@
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 DELETED
@@ -1,378 +0,0 @@
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(!isset($data[$location])) { $data[$location] = array(); }
31
- if($location == 'middle') {
32
- $data = wp_insert_sanitize_array($data[$location], array('status', 'ad_code_1', 'ad_code_2', 'ad_code_3', 'country_1', 'country_code_1', 'rules_exclude_loggedin', 'rules_exclude_mobile_devices', 'rules_exclude_home', 'rules_exclude_archives', 'rules_exclude_categories', 'rules_categories_exceptions', 'rules_categories_post_exceptions', 'rules_exclude_search', 'rules_exclude_page', 'rules_page_exceptions', 'rules_exclude_post', 'rules_post_exceptions', 'styles', 'minimum_character_count', 'paragraph_buffer_count'));
33
- } else {
34
- $data = wp_insert_sanitize_array($data[$location], array('status', 'ad_code_1', 'ad_code_2', 'ad_code_3', 'country_1', 'country_code_1', 'rules_exclude_loggedin', 'rules_exclude_mobile_devices', 'rules_exclude_home', 'rules_exclude_archives', 'rules_exclude_categories', 'rules_categories_exceptions', 'rules_categories_post_exceptions', 'rules_exclude_search', 'rules_exclude_page', 'rules_page_exceptions', 'rules_exclude_post', 'rules_post_exceptions', 'styles'));
35
- }
36
-
37
- $controls = array();
38
- $controls['status'] = wp_insert_get_control('tz-checkbox', false, $name.'[status]', $id.'-status', $data['status']);
39
- $controls['ad_code_1'] = wp_insert_get_control('textarea', false, $name.'[ad_code_1]', $id.'-ad_code_1', $data['ad_code_1'], 'Ad Code (Primary Network):', '', null, 'input widefat chitika');
40
- $controls['ad_code_2'] = wp_insert_get_control('textarea', false, $name.'[ad_code_2]', $id.'-ad_code_2', $data['ad_code_2'], 'Ad Code (Secondary Network):', '', null, 'input widefat chitika');
41
- $controls['ad_code_3'] = wp_insert_get_control('textarea', false, $name.'[ad_code_3]', $id.'-ad_code_3', $data['ad_code_3'], 'Ad Code (Tertiary Network):', '', null, 'input widefat chitika');
42
-
43
- $controls['country_1'] = wp_insert_get_control('popup', false, $name.'[country_1]', $id.'-country_1', $data['country_1'], 'Geo Targets', '', array('type' => 'countries'));
44
- $controls['country_code_1'] = wp_insert_get_control('textarea', false, $name.'[country_code_1]', $id.'-country_code_1', $data['country_code_1'], 'Ad Code', '', null, 'input widefat chitika');
45
-
46
- $controls['rules_exclude_loggedin'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_loggedin]', $id.'-rules_exclude_loggedin', $data['rules_exclude_loggedin'], '', '', null, '', false);
47
- $controls['rules_exclude_mobile_devices'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_mobile_devices]', $id.'-rules_exclude_mobile_devices', $data['rules_exclude_mobile_devices'], '', '', null, '', false);
48
- $controls['rules_exclude_home'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_home]', $id.'-rules_exclude_home', $data['rules_exclude_home'], '', '', null, '', false);
49
- $controls['rules_home_instances'] = wp_insert_get_control('popup', false, $name.'[rules_home_instances]', $id.'-rules_home_instances', $data['rules_home_instances'], '', '', array('type' => 'instances'), '', false);
50
- $controls['rules_exclude_archives'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_archives]', $id.'-rules_exclude_archives', $data['rules_exclude_archives'], '', '', null, '', false);
51
- $controls['rules_archives_instances'] = wp_insert_get_control('popup', false, $name.'[rules_archives_instances]', $id.'-rules_archives_instances', $data['rules_archives_instances'], '', '', array('type' => 'instances'), '', false);
52
- $controls['rules_exclude_categories'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_categories]', $id.'-rules_exclude_categories', $data['rules_exclude_categories'], '', '', null, '', false);
53
- $controls['rules_categories_instances'] = wp_insert_get_control('popup', false, $name.'[rules_categories_instances]', $id.'-rules_categories_instances', $data['rules_categories_instances'], '', '', array('type' => 'instances'), '', false);
54
- $controls['rules_categories_exceptions'] = wp_insert_get_control('popup', false, $name.'[rules_categories_exceptions]', $id.'-rules_categories_exceptions', $data['rules_categories_exceptions'], '', '', array('type' => 'categories'), '', false);
55
- $controls['rules_categories_post_exceptions'] = wp_insert_get_control('popup', false, $name.'[rules_categories_post_exceptions]', $id.'-rules_categories_post_exceptions', $data['rules_categories_post_exceptions'], '', '', array('type' => 'categories'), '', false);
56
- $controls['rules_exclude_search'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_search]', $id.'-rules_exclude_search', $data['rules_exclude_search'], '', '', null, '', false);
57
- $controls['rules_search_instances'] = wp_insert_get_control('popup', false, $name.'[rules_search_instances]', $id.'-rules_search_instances', $data['rules_search_instances'], '', '', array('type' => 'instances'), '', false);
58
- $controls['rules_exclude_page'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_page]', $id.'-rules_exclude_page', $data['rules_exclude_page'], '', '', null, '', false);
59
- $controls['rules_page_exceptions'] = wp_insert_get_control('popup', false, $name.'[rules_page_exceptions]', $id.'-rules_page_exceptions', $data['rules_page_exceptions'], '', '', array('type' => 'pages'), '', false);
60
- $controls['rules_exclude_post'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_post]', $id.'-rules_exclude_post', $data['rules_exclude_post'], '', '', null, '', false);
61
- $controls['rules_post_exceptions'] = wp_insert_get_control('popup', false, $name.'[rules_post_exceptions]', $id.'-rules_post_exceptions', $data['rules_post_exceptions'], '', '', array('type' => 'posts'), '', false);
62
- $post_types = get_post_types(array('public' => true, '_builtin' => false), 'names');
63
- if($post_types) {
64
- foreach($post_types as $post_type) {
65
- $controls['rules_exclude_cpt_'.$post_type] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_cpt_'.$post_type.']', $id.'-rules_exclude_cpt_'.$post_type, $data['rules_exclude_cpt_'.$post_type], '', '', null, '', false);
66
- }
67
- }
68
-
69
- $controls['styles'] = wp_insert_get_control('textarea', false, $name.'[styles]', $id.'-styles', $data['styles'], 'Styles:');
70
-
71
- $controls['notes'] = wp_insert_get_control('textarea', false, $name.'[notes]', $id.'-notes', $data['notes'], 'Notes:', 'Add a note to this Ad block for your personal use. This note is not displayed anywhere on the site');
72
-
73
- if($location == 'middle') {
74
- $controls['minimum_character_count'] = wp_insert_get_control('text', false, $name.'[minimum_character_count]', $id.'-minimum_character_count', $data['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');
75
- $controls['paragraph_buffer_count'] = wp_insert_get_control('text', false, $name.'[paragraph_buffer_count]', $id.'-paragraph_buffer_count', $data['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');
76
- }
77
-
78
- echo $controls['status']['html'];
79
-
80
- $multiple_network_status = get_option('wp_insert_multiple_network_status');
81
- if($multiple_network_status == 2 || $multiple_network_status == 1) {
82
- $controls['ad_code_3']['html'] = '<div style="display: none;">'.$controls['ad_code_3']['html'].'</div>';
83
- }
84
-
85
- if($multiple_network_status == 1) {
86
- $controls['ad_code_2']['html'] = '<div style="display: none;">'.$controls['ad_code_2']['html'].'</div>';
87
- }
88
- $tabData = array(
89
- array(
90
- 'title' => 'Ad Code',
91
- 'content' => $controls['ad_code_1']['html'].$controls['ad_code_2']['html'].$controls['ad_code_3']['html']
92
- ),
93
- array(
94
- 'title' => 'Rules',
95
- 'content' => wp_insert_inpostads_rules_content($controls)
96
- ),
97
- array(
98
- 'title' => 'Geo Targeting',
99
- 'content' => '<p>'.$controls['country_1']['html'].$controls['country_code_1']['html'].'</p>'
100
- ),
101
- array(
102
- 'title' => 'Styles',
103
- 'content' => $controls['styles']['html']
104
- ),
105
- array(
106
- 'title' => 'Notes',
107
- 'content' => $controls['notes']['html']
108
- )
109
- );
110
- if($location == 'middle') {
111
- array_push(
112
- $tabData,
113
- array(
114
- 'title' => 'Settings',
115
- 'content' => $controls['minimum_character_count']['html'].$controls['paragraph_buffer_count']['html']
116
- )
117
- );
118
- }
119
- $controls['vtab'] = wp_insert_get_vtabs('vtab_'.$location, $tabData);
120
- echo $controls['vtab']['html'];
121
-
122
- echo wp_insert_get_script_tag($controls);
123
- }
124
-
125
- function wp_insert_inpostads_rules_content($controls) {
126
- $rulesTable = array(
127
- 'class' => 'rules',
128
- 'rows' => array()
129
- );
130
- array_push(
131
- $rulesTable['rows'],
132
- array(
133
- 'cells' => array(
134
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Logged in Users')
135
- )
136
- ),
137
- array(
138
- 'cells' => array(
139
- array('content' => 'Status'),
140
- array('content' => '&nbsp;:&nbsp;'),
141
- array('content' => $controls['rules_exclude_loggedin']['html'])
142
- )
143
- ),
144
- array(
145
- 'cells' => array(
146
- array('colspan' => '3', 'content' => '&nbsp;')
147
- )
148
- )
149
- );
150
- array_push(
151
- $rulesTable['rows'],
152
- array(
153
- 'cells' => array(
154
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Mobile Devices')
155
- )
156
- ),
157
- array(
158
- 'cells' => array(
159
- array('content' => 'Status'),
160
- array('content' => '&nbsp;:&nbsp;'),
161
- array('content' => $controls['rules_exclude_mobile_devices']['html'])
162
- )
163
- ),
164
- array(
165
- 'cells' => array(
166
- array('colspan' => '3', 'content' => '&nbsp;')
167
- )
168
- )
169
- );
170
- array_push(
171
- $rulesTable['rows'],
172
- array(
173
- 'cells' => array(
174
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Home')
175
- )
176
- ),
177
- array(
178
- 'cells' => array(
179
- array('content' => 'Status'),
180
- array('content' => '&nbsp;:&nbsp;'),
181
- array('content' => $controls['rules_exclude_home']['html'])
182
- )
183
- ),
184
- array(
185
- 'cells' => array(
186
- array('content' => 'Instances'),
187
- array('content' => '&nbsp;:&nbsp;'),
188
- array('content' => $controls['rules_home_instances']['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' => 'Archives')
202
- )
203
- ),
204
- array(
205
- 'cells' => array(
206
- array('content' => 'Status'),
207
- array('content' => '&nbsp;:&nbsp;'),
208
- array('content' => $controls['rules_exclude_archives']['html'])
209
- )
210
- ),
211
- array(
212
- 'cells' => array(
213
- array('content' => 'Instances'),
214
- array('content' => '&nbsp;:&nbsp;'),
215
- array('content' => $controls['rules_archives_instances']['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' => 'Categories')
229
- )
230
- ),
231
- array(
232
- 'cells' => array(
233
- array('content' => 'Status'),
234
- array('content' => '&nbsp;:&nbsp;'),
235
- array('content' => $controls['rules_exclude_categories']['html'])
236
- )
237
- ),
238
- array(
239
- 'cells' => array(
240
- array('content' => 'Instances'),
241
- array('content' => '&nbsp;:&nbsp;'),
242
- array('content' => $controls['rules_categories_instances']['html'])
243
- )
244
- ),
245
- array(
246
- 'cells' => array(
247
- array('content' => 'Exceptions'),
248
- array('content' => '&nbsp;:&nbsp;'),
249
- array('content' => $controls['rules_categories_exceptions']['html'])
250
- )
251
- ),
252
- array(
253
- 'cells' => array(
254
- array('content' => 'Post Exceptions'),
255
- array('content' => '&nbsp;:&nbsp;'),
256
- array('content' => $controls['rules_categories_post_exceptions']['html'])
257
- )
258
- )
259
- );
260
- array_push(
261
- $rulesTable['rows'],
262
- array(
263
- 'cells' => array(
264
- array('colspan' => '3', 'content' => '&nbsp;')
265
- )
266
- ),
267
- array(
268
- 'cells' => array(
269
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Search Results')
270
- )
271
- ),
272
- array(
273
- 'cells' => array(
274
- array('content' => 'Status'),
275
- array('content' => '&nbsp;:&nbsp;'),
276
- array('content' => $controls['rules_exclude_search']['html'])
277
- )
278
- ),
279
- array(
280
- 'cells' => array(
281
- array('content' => 'Instances'),
282
- array('content' => '&nbsp;:&nbsp;'),
283
- array('content' => $controls['rules_search_instances']['html'])
284
- )
285
- )
286
- );
287
- array_push(
288
- $rulesTable['rows'],
289
- array(
290
- 'cells' => array(
291
- array('colspan' => '3', 'content' => '&nbsp;')
292
- )
293
- ),
294
- array(
295
- 'cells' => array(
296
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Single Page')
297
- )
298
- ),
299
- array(
300
- 'cells' => array(
301
- array('content' => 'Status'),
302
- array('content' => '&nbsp;:&nbsp;'),
303
- array('content' => $controls['rules_exclude_page']['html'])
304
- )
305
- ),
306
- array(
307
- 'cells' => array(
308
- array('content' => 'Exceptions'),
309
- array('content' => '&nbsp;:&nbsp;'),
310
- array('content' => $controls['rules_page_exceptions']['html'])
311
- )
312
- )
313
- );
314
- array_push(
315
- $rulesTable['rows'],
316
- array(
317
- 'cells' => array(
318
- array('colspan' => '3', 'content' => '&nbsp;')
319
- )
320
- ),
321
- array(
322
- 'cells' => array(
323
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Single Blog Post')
324
- )
325
- ),
326
- array(
327
- 'cells' => array(
328
- array('content' => 'Status'),
329
- array('content' => '&nbsp;:&nbsp;'),
330
- array('content' => $controls['rules_exclude_post']['html'])
331
- )
332
- ),
333
- array(
334
- 'cells' => array(
335
- array('content' => 'Exceptions'),
336
- array('content' => '&nbsp;:&nbsp;'),
337
- array('content' => $controls['rules_post_exceptions']['html'])
338
- )
339
- )
340
- );
341
-
342
- $post_types = get_post_types(array('public' => true, '_builtin' => false), 'object');
343
- if($post_types) {
344
- array_push(
345
- $rulesTable['rows'],
346
- array(
347
- 'cells' => array(
348
- array('colspan' => '3', 'content' => '&nbsp;')
349
- )
350
- ),
351
- array(
352
- 'cells' => array(
353
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Custom Post Types')
354
- )
355
- )
356
- );
357
- foreach($post_types as $post_type) {
358
- array_push(
359
- $rulesTable['rows'],
360
- array(
361
- 'cells' => array(
362
- array('content' => $post_type->labels->name),
363
- array('content' => '&nbsp;:&nbsp;'),
364
- array('content' => $controls['rules_exclude_cpt_'.$post_type->name]['html'])
365
- )
366
- )
367
- );
368
- }
369
- }
370
-
371
- return wp_insert_get_table($rulesTable);
372
- }
373
-
374
- function wp_insert_inpostads_validate($input) {
375
- update_option('wp_insert_multiple_network_status', $input['multiple-network']['status']);
376
- return $input;
377
- }
378
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/inpostads/content.php DELETED
@@ -1,95 +0,0 @@
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, explode(',', $options['middle']['country_1'])))) {
27
- $content = substr_replace($content, '/p>'.'<div class="wpInsert wpInsertInPostAd wpInsertMiddle"'.(($options['middle']['styles'] != '')?' style="'.$options['middle']['styles'].'"':'').'>'.do_shortcode($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'].'"':'').'>'.do_shortcode($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, explode(',', $options['middle']['country_1'])))) {
41
- $content = substr_replace($content, '/p>'.'<div class="wpInsert wpInsertInPostAd wpInsertMiddle"'.(($options['middle']['styles'] != '')?' style="'.$options['middle']['styles'].'"':'').'>'.do_shortcode($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'].'"':'').'>'.do_shortcode($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, explode(',', $options['left']['country_1'])))) {
52
- $content = '<div class="wpInsert wpInsertInPostAd wpInsertLeft" style="float: left; '.(($options['left']['styles'] != '')?$options['left']['styles']:'').'">'.do_shortcode($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']:'').'">'.do_shortcode($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, explode(',', $options['right']['country_1'])))) {
59
- $content = '<div class="wpInsert wpInsertInPostAd wpInsertRight" style="float: right; '.(($options['right']['styles'] != '')?$options['right']['styles']:'').'">'.do_shortcode($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']:'').'">'.do_shortcode($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, explode(',', $options['above']['country_1'])))) {
66
- $content = '<div class="wpInsert wpInsertInPostAd wpInsertAbove"'.(($options['above']['styles'] != '')?' style="'.$options['above']['styles'].'"':'').'>'.do_shortcode($options['above']['country_code_1']).'</div>'.$content;
67
- } else {
68
- $content = '<div class="wpInsert wpInsertInPostAd wpInsertAbove"'.(($options['above']['styles'] != '')?' style="'.$options['above']['styles'].'"':'').'>'.do_shortcode($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, explode(',', $options['below']['country_1'])))) {
73
- $content = $content.'<div class="wpInsert wpInsertInPostAd wpInsertBelow"'.(($options['below']['styles'] != '')?' style="'.$options['below']['styles'].'"':'').'>'.do_shortcode($options['below']['country_code_1']).'</div>';
74
- } else {
75
- $content = $content.'<div class="wpInsert wpInsertInPostAd wpInsertBelow"'.(($options['below']['styles'] != '')?' style="'.$options['below']['styles'].'"':'').'>'.do_shortcode($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 DELETED
@@ -1,6 +0,0 @@
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 DELETED
@@ -1,7 +0,0 @@
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/inthemeads.php ADDED
@@ -0,0 +1,308 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* Begin Add New In-Theme Content */
3
+ add_action('wp_ajax_wp_insert_inthemeads_new_form_get_content', 'wp_insert_inthemeads_new_form_get_content');
4
+ function wp_insert_inthemeads_new_form_get_content() {
5
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
6
+ wp_insert_inthemeads_form_get_content(uniqid());
7
+ die();
8
+ }
9
+ /* End Add New In-Theme Content */
10
+
11
+ /* Begin Edit In-Theme Content */
12
+ add_action('wp_ajax_wp_insert_inthemeads_existing_form_get_content', 'wp_insert_inthemeads_existing_form_get_content');
13
+ function wp_insert_inthemeads_existing_form_get_content() {
14
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
15
+ if(isset($_POST['wp_insert_inthemeads_identifier'])) {
16
+ wp_insert_inthemeads_form_get_content($_POST['wp_insert_inthemeads_identifier']);
17
+ }
18
+ die();
19
+ }
20
+
21
+ add_action('wp_ajax_wp_insert_inthemeads_existing_form_save_action', 'wp_insert_inthemeads_existing_form_save_action');
22
+ function wp_insert_inthemeads_existing_form_save_action() {
23
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
24
+ if(isset($_POST['wp_insert_inthemeads_identifier'])) {
25
+ wp_insert_inthemeads_form_save_action($_POST['wp_insert_inthemeads_identifier']);
26
+ }
27
+ die();
28
+ }
29
+ /* End Edit In-Theme Content */
30
+
31
+ /* Begin Delete In-Theme Content */
32
+ add_action('wp_ajax_wp_insert_inthemeads_remove', 'wp_insert_inthemeads_remove');
33
+ function wp_insert_inthemeads_remove() {
34
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
35
+ if(isset($_POST['wp_insert_inthemeads_identifier'])) {
36
+ $inthemeads = get_option('wp_insert_inthemeads');
37
+ unset($inthemeads[$_POST['wp_insert_inthemeads_identifier']]);
38
+ update_option('wp_insert_inthemeads', $inthemeads);
39
+ }
40
+ die();
41
+ }
42
+ /* End Delete In-Theme Content */
43
+
44
+ /* Begin Shared UI Functions */
45
+ function wp_insert_inthemeads_form_get_content($identifier) {
46
+ $inthemeads = get_option('wp_insert_inthemeads');
47
+ echo '<div class="wp_insert_popup_content_wrapper">';
48
+ $control = new smartlogixControls(array('optionIdentifier' => 'wp_insert_inthemeads['.$identifier.']', 'values' => $inthemeads[$identifier]));
49
+ $control->add_control(array('type' => 'ipCheckbox', 'className' => 'wp_insert_inthemeads_status', 'optionName' => 'status'));
50
+ $control->add_control(array('type' => 'hidden', 'className' => 'wp_insert_inthemeads_identifier', 'optionName' => 'identifier', 'value' => $identifier));
51
+ echo $control->HTML;
52
+ $control->clear_controls();
53
+ echo '<div id="wp_insert_inthemeads_'.$identifier.'_accordion">';
54
+ echo '<h3>Code Snippet</h3>';
55
+ echo '<div>';
56
+ $control->set_HTML('<p class="codeSnippet"><code>&lt;?php if(function_exists("wp_intheme_ad")) { wp_intheme_ad("'.$identifier.'"); } ?&gt;</code></p>');
57
+ $control->create_section('Code to add to your theme files');
58
+ echo $control->HTML;
59
+ $control->clear_controls();
60
+ echo '</div>';
61
+ echo '<h3>Ad Code</h3>';
62
+ echo '<div>';
63
+ $abtestingMode = get_option('wp_insert_abtesting_mode');
64
+ $control->add_control(array('type' => 'textarea', 'style' => 'height: 220px;', 'optionName' => 'primary_ad_code'));
65
+ $control->create_section('Ad Code (Primary Network)');
66
+ echo $control->HTML;
67
+ $control->clear_controls();
68
+
69
+ $control->add_control(array('type' => 'textarea', 'style' => 'height: 220px;', 'optionName' => 'secondary_ad_code'));
70
+ $control->create_section('Ad Code (Secondary Network)');
71
+ if($abtestingMode != '2' && $abtestingMode != '3') {
72
+ $control->set_HTML('<div style="display: none;">'.$control->HTML.'</div>');
73
+ }
74
+ echo $control->HTML;
75
+ $control->clear_controls();
76
+
77
+ $control->add_control(array('type' => 'textarea', 'style' => 'height: 220px;', 'optionName' => 'tertiary_ad_code'));
78
+ $control->create_section('Ad Code (Tertiary Network)');
79
+ if($abtestingMode != '3') {
80
+ $control->set_HTML('<div style="display: none;">'.$control->HTML.'</div>');
81
+ }
82
+ echo $control->HTML;
83
+ $control->clear_controls();
84
+ echo '</div>';
85
+ echo '<h3>Rules</h3>';
86
+ echo '<div>';
87
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_loggedin'));
88
+ $control->create_section('Logged in Users');
89
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
90
+ echo $control->HTML;
91
+ $control->clear_controls();
92
+
93
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_mobile_devices'));
94
+ $control->create_section('Mobile Devices');
95
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
96
+ echo $control->HTML;
97
+ $control->clear_controls();
98
+
99
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_home'));
100
+ $control->create_section('Home');
101
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
102
+ echo $control->HTML;
103
+ $control->clear_controls();
104
+
105
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_archives'));
106
+ $control->create_section('Archives');
107
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
108
+ echo $control->HTML;
109
+ $control->clear_controls();
110
+
111
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_search'));
112
+ $control->create_section('Search Results');
113
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
114
+ echo $control->HTML;
115
+ $control->clear_controls();
116
+
117
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_page'));
118
+ $control->add_control(array('type' => 'pages-chosen-multiselect', 'label' => 'Exceptions', 'optionName' => 'rules_page_exceptions'));
119
+ $control->create_section('Single Pages');
120
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
121
+ echo $control->HTML;
122
+ $control->clear_controls();
123
+
124
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_post'));
125
+ $control->add_control(array('type' => 'posts-chosen-multiselect', 'label' => 'Exceptions', 'optionName' => 'rules_post_exceptions'));
126
+ $control->add_control(array('type' => 'categories-chosen-multiselect', 'label' => 'Category Exceptions', 'optionName' => 'rules_post_categories_exceptions'));
127
+ $control->create_section('Single Posts');
128
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
129
+ echo $control->HTML;
130
+ $control->clear_controls();
131
+
132
+ $control->add_control(array('type' => 'checkbox-button', 'label' => 'Status : Show Ads', 'checkedLabel' => 'Status : Hide Ads', 'uncheckedLabel' => 'Status : Show Ads', 'optionName' => 'rules_exclude_categories'));
133
+ $control->add_control(array('type' => 'categories-chosen-multiselect', 'label' => 'Exceptions', 'optionName' => 'rules_categories_exceptions'));
134
+ $control->create_section('Category Archives');
135
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
136
+ echo $control->HTML;
137
+ $control->clear_controls();
138
+
139
+ echo '</div>';
140
+ echo '<h3>Geo Targeting</h3>';
141
+ echo '<div>';
142
+ echo '<p>A Geo Targeted Ads have a higher priority than Ads configured via Multiple Ad Networks / A-B Testing.<br />If a Geo Targeting match is found all other Ads (Primary, Secondary and Tertiary Networks) will be ignored.</p>';
143
+ $control->add_control(array('type' => 'choosen-multiselect', 'label' => 'Countries', 'optionName' => 'geo_group1_countries', 'options' => wp_insert_get_countries()));
144
+ $control->add_control(array('type' => 'textarea', 'label' => 'Ad Code', 'style' => 'height: 220px;', 'optionName' => 'geo_group1_adcode'));
145
+ $control->create_section('Group 1');
146
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div>');
147
+ echo $control->HTML;
148
+ $control->clear_controls();
149
+
150
+ $control->add_control(array('type' => 'choosen-multiselect', 'label' => 'Countries', 'optionName' => 'geo_group2_countries', 'options' => wp_insert_get_countries()));
151
+ $control->add_control(array('type' => 'textarea', 'label' => 'Ad Code', 'style' => 'height: 220px;', 'optionName' => 'geo_group2_adcode'));
152
+ $control->create_section('Group 2');
153
+ $control->set_HTML('<div class="wp_insert_rule_block">'.$control->HTML.'</div><div style="clear: both;"></div>');
154
+ echo $control->HTML;
155
+ $control->clear_controls();
156
+ echo '</div>';
157
+ echo '<h3>Styles</h3>';
158
+ echo '<div>';
159
+ $control->add_control(array('type' => 'textarea', 'style' => 'height: 220px;', 'optionName' => 'styles'));
160
+ $control->create_section('Styles');
161
+ echo $control->HTML;
162
+ $control->clear_controls();
163
+ echo '</div>';
164
+ echo '<h3>Notes</h3>';
165
+ echo '<div>';
166
+ $control->add_control(array('type' => 'text', 'optionName' => 'title', 'helpText' => 'The title is used to identify your Ad Widget easily in future. A Random Title will be assigned to your Ad widget by default.', 'value' => ((isset($inthemeads[$identifier]['title']))?$inthemeads[$identifier]['title']:$identifier)));
167
+ $control->create_section('Title');
168
+ echo $control->HTML;
169
+ $control->clear_controls();
170
+
171
+ $control->add_control(array('type' => 'textarea', 'style' => 'height: 220px;', 'optionName' => 'notes'));
172
+ $control->create_section('Notes');
173
+ echo $control->HTML;
174
+ $control->clear_controls();
175
+ echo '</div>';
176
+ echo '</div>';
177
+ echo '<script type="text/javascript">';
178
+ echo $control->JS;
179
+ echo 'jQuery("#wp_insert_inthemeads_'.$identifier.'_accordion").accordion({ icons: { header: "ui-icon-circle-arrow-e", activeHeader: "ui-icon-circle-arrow-s" }, heightStyle: "auto" });';
180
+ echo '</script>';
181
+ echo '</div>';
182
+ }
183
+
184
+ function wp_insert_inthemeads_form_save_action($identifier) {
185
+ $inthemeads = get_option('wp_insert_inthemeads');
186
+ $inthemeads[$identifier]['identifier'] = ((isset($_POST['wp_insert_inthemeads_identifier']))?$_POST['wp_insert_inthemeads_identifier']:'');
187
+ $inthemeads[$identifier]['status'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_status']) && ($_POST['wp_insert_inthemeads_'.$identifier.'_status'] == 'true'))?'1':'');
188
+
189
+ $inthemeads[$identifier]['title'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_title']))?$_POST['wp_insert_inthemeads_'.$identifier.'_title']:'');
190
+
191
+ $inthemeads[$identifier]['primary_ad_code'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_primary_ad_code']))?$_POST['wp_insert_inthemeads_'.$identifier.'_primary_ad_code']:'');
192
+ $inthemeads[$identifier]['secondary_ad_code'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_secondary_ad_code']))?$_POST['wp_insert_inthemeads_'.$identifier.'_secondary_ad_code']:'');
193
+ $inthemeads[$identifier]['tertiary_ad_code'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_tertiary_ad_code']))?$_POST['wp_insert_inthemeads_'.$identifier.'_tertiary_ad_code']:'');
194
+
195
+ $inthemeads[$identifier]['rules_exclude_loggedin'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_loggedin']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_loggedin']:'');
196
+ $inthemeads[$identifier]['rules_exclude_mobile_devices'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_mobile_devices']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_mobile_devices']:'');
197
+ $inthemeads[$identifier]['rules_exclude_home'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_home']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_home']:'');
198
+ $inthemeads[$identifier]['rules_exclude_archives'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_archives']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_archives']:'');
199
+ $inthemeads[$identifier]['rules_exclude_search'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_search']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_search']:'');
200
+ $inthemeads[$identifier]['rules_exclude_page'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_page']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_page']:'');
201
+ $inthemeads[$identifier]['rules_page_exceptions'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_page_exceptions']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_page_exceptions']:'');
202
+ $inthemeads[$identifier]['rules_exclude_post'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_post']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_post']:'');
203
+ $inthemeads[$identifier]['rules_post_exceptions'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_post_exceptions']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_post_exceptions']:'');
204
+ $inthemeads[$identifier]['rules_post_categories_exceptions'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_post_categories_exceptions']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_post_categories_exceptions']:'');
205
+ $inthemeads[$identifier]['rules_exclude_categories'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_categories']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_exclude_categories']:'');
206
+ $inthemeads[$identifier]['rules_categories_exceptions'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_rules_categories_exceptions']))?$_POST['wp_insert_inthemeads_'.$identifier.'_rules_categories_exceptions']:'');
207
+
208
+ $inthemeads[$identifier]['geo_group1_countries'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_geo_group1_countries']))?$_POST['wp_insert_inthemeads_'.$identifier.'_geo_group1_countries']:'');
209
+ $inthemeads[$identifier]['geo_group1_adcode'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_geo_group1_adcode']))?$_POST['wp_insert_inthemeads_'.$identifier.'_geo_group1_adcode']:'');
210
+ $inthemeads[$identifier]['geo_group2_countries'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_geo_group2_countries']))?$_POST['wp_insert_inthemeads_'.$identifier.'_geo_group2_countries']:'');
211
+ $inthemeads[$identifier]['geo_group2_adcode'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_geo_group2_adcode']))?$_POST['wp_insert_inthemeads_'.$identifier.'_geo_group2_adcode']:'');
212
+
213
+ $inthemeads[$identifier]['styles'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_styles']))?$_POST['wp_insert_inthemeads_'.$identifier.'_styles']:'');
214
+
215
+ $inthemeads[$identifier]['notes'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_notes']))?$_POST['wp_insert_inthemeads_'.$identifier.'_notes']:'');
216
+
217
+ if($identifier == 'middle') {
218
+ $inthemeads[$identifier]['minimum_character_count'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_minimum_character_count']))?$_POST['wp_insert_inthemeads_'.$identifier.'_minimum_character_count']:'');
219
+ $inthemeads[$identifier]['paragraph_buffer_count'] = ((isset($_POST['wp_insert_inthemeads_'.$identifier.'_paragraph_buffer_count']))?$_POST['wp_insert_inthemeads_'.$identifier.'_paragraph_buffer_count']:'');
220
+ }
221
+ update_option('wp_insert_inthemeads', $inthemeads);
222
+ }
223
+ /* End Shared UI Functions */
224
+
225
+ /* Begin Database Upgrade */
226
+ add_action('wp_insert_upgrade_database', 'wp_insert_inthemeads_upgrade_database');
227
+ function wp_insert_inthemeads_upgrade_database() {
228
+ if(!get_option('wp_insert_inthemeads')) {
229
+ $newValues = array();
230
+
231
+ $oldValues = get_option('wp_insert_templateads_options');
232
+ for($i = 1; $i <= 10; $i++) {
233
+ if(isset($oldValues['templateads-'.$i]['ad_code_1']) && ($oldValues['templateads-'.$i]['ad_code_1'] != '')) {
234
+ $newValues['templateads-'.$i] = array (
235
+ 'identifier' => 'templateads-'.$i,
236
+ 'status' => ((isset($oldValues['templateads-'.$i]['status']) && $oldValues['templateads-'.$i]['status'] == true)?'1':''),
237
+ 'title' => 'templateads-'.$i,
238
+ 'primary_ad_code' => ((isset($oldValues['templateads-'.$i]['ad_code_1']))?$oldValues['templateads-'.$i]['ad_code_1']:''),
239
+ 'secondary_ad_code' => ((isset($oldValues['templateads-'.$i]['ad_code_2']))?$oldValues['templateads-'.$i]['ad_code_2']:''),
240
+ 'tertiary_ad_code' => ((isset($oldValues['templateads-'.$i]['ad_code_3']))?$oldValues['templateads-'.$i]['ad_code_3']:''),
241
+ 'rules_exclude_loggedin' => ((isset($oldValues['templateads-'.$i]['rules_exclude_loggedin']))?true:false),
242
+ 'rules_exclude_mobile_devices' => ((isset($oldValues['templateads-'.$i]['rules_exclude_mobile_devices']))?true:false),
243
+ 'rules_exclude_home' => ((isset($oldValues['templateads-'.$i]['rules_exclude_home']))?true:false),
244
+ 'rules_exclude_archives' => ((isset($oldValues['templateads-'.$i]['rules_exclude_archives']))?true:false),
245
+ 'rules_exclude_search' => ((isset($oldValues['templateads-'.$i]['rules_exclude_search']))?true:false),
246
+ 'rules_exclude_page' => ((isset($oldValues['templateads-'.$i]['rules_exclude_page']))?true:false),
247
+ 'rules_page_exceptions' => ((isset($options['templateads-'.$i]['rules_page_exceptions']) && ($options['templateads-'.$i]['rules_page_exceptions'] != ''))?explode(',', $options['templateads-'.$i]['rules_page_exceptions']):array()),
248
+ 'rules_exclude_post' => ((isset($oldValues['templateads-'.$i]['rules_exclude_post']))?true:false),
249
+ 'rules_post_exceptions' => ((isset($options['templateads-'.$i]['rules_post_exceptions']) && ($options['templateads-'.$i]['rules_post_exceptions'] != ''))?explode(',', $options['templateads-'.$i]['rules_post_exceptions']):array()),
250
+ 'rules_post_categories_exceptions' => ((isset($options['templateads-'.$i]['rules_post_categories_exceptions']) && ($options['templateads-'.$i]['rules_post_categories_exceptions'] != ''))?explode(',', $options['templateads-'.$i]['rules_post_categories_exceptions']):array()),
251
+ 'rules_exclude_categories' => ((isset($oldValues['templateads-'.$i]['rules_exclude_categories']))?true:false),
252
+ 'rules_categories_exceptions' => ((isset($options['templateads-'.$i]['rules_categories_exceptions']) && ($options['templateads-'.$i]['rules_categories_exceptions'] != ''))?explode(',', $options['templateads-'.$i]['rules_categories_exceptions']):array()),
253
+ 'geo_group1_countries' => ((isset($options['templateads-'.$i]['country_1']) && ($options['templateads-'.$i]['country_1'] != ''))?explode(',', $options['templateads-'.$i]['country_1']):array()),
254
+ 'geo_group1_adcode' => ((isset($oldValues['templateads-'.$i]['country_code_1']))?$oldValues['templateads-'.$i]['country_code_1']:''),
255
+ 'geo_group2_countries' => array(),
256
+ 'geo_group2_adcode' => '',
257
+ 'styles' => ((isset($oldValues['templateads-'.$i]['styles']))?$oldValues['templateads-'.$i]['styles']:'margin: 5px; padding: 0px;'),
258
+ 'notes' => ((isset($oldValues['templateads-'.$i]['notes']))?$oldValues['templateads-'.$i]['notes']:''),
259
+ );
260
+ }
261
+ }
262
+
263
+ $oldValues = get_option('wp_insert_more_templateads_options');
264
+ for($i = 11; $i <= 20; $i++) {
265
+ if(isset($oldValues['templateads-'.$i]['ad_code_1']) && ($oldValues['templateads-'.$i]['ad_code_1'] != '')) {
266
+ $newValues['templateads-'.$i] = array (
267
+ 'identifier' => 'templateads-'.$i,
268
+ 'status' => ((isset($oldValues['templateads-'.$i]['status']) && $oldValues['templateads-'.$i]['status'] == true)?'1':''),
269
+ 'title' => 'templateads-'.$i,
270
+ 'primary_ad_code' => ((isset($oldValues['templateads-'.$i]['ad_code_1']))?$oldValues['templateads-'.$i]['ad_code_1']:''),
271
+ 'secondary_ad_code' => ((isset($oldValues['templateads-'.$i]['ad_code_2']))?$oldValues['templateads-'.$i]['ad_code_2']:''),
272
+ 'tertiary_ad_code' => ((isset($oldValues['templateads-'.$i]['ad_code_3']))?$oldValues['templateads-'.$i]['ad_code_3']:''),
273
+ 'rules_exclude_loggedin' => ((isset($oldValues['templateads-'.$i]['rules_exclude_loggedin']))?true:false),
274
+ 'rules_exclude_mobile_devices' => ((isset($oldValues['templateads-'.$i]['rules_exclude_mobile_devices']))?true:false),
275
+ 'rules_exclude_home' => ((isset($oldValues['templateads-'.$i]['rules_exclude_home']))?true:false),
276
+ 'rules_exclude_archives' => ((isset($oldValues['templateads-'.$i]['rules_exclude_archives']))?true:false),
277
+ 'rules_exclude_search' => ((isset($oldValues['templateads-'.$i]['rules_exclude_search']))?true:false),
278
+ 'rules_exclude_page' => ((isset($oldValues['templateads-'.$i]['rules_exclude_page']))?true:false),
279
+ 'rules_page_exceptions' => ((isset($options['templateads-'.$i]['rules_page_exceptions']) && ($options['templateads-'.$i]['rules_page_exceptions'] != ''))?explode(',', $options['templateads-'.$i]['rules_page_exceptions']):array()),
280
+ 'rules_exclude_post' => ((isset($oldValues['templateads-'.$i]['rules_exclude_post']))?true:false),
281
+ 'rules_post_exceptions' => ((isset($options['templateads-'.$i]['rules_post_exceptions']) && ($options['templateads-'.$i]['rules_post_exceptions'] != ''))?explode(',', $options['templateads-'.$i]['rules_post_exceptions']):array()),
282
+ 'rules_post_categories_exceptions' => ((isset($options['templateads-'.$i]['rules_post_categories_exceptions']) && ($options['templateads-'.$i]['rules_post_categories_exceptions'] != ''))?explode(',', $options['templateads-'.$i]['rules_post_categories_exceptions']):array()),
283
+ 'rules_exclude_categories' => ((isset($oldValues['templateads-'.$i]['rules_exclude_categories']))?true:false),
284
+ 'rules_categories_exceptions' => ((isset($options['templateads-'.$i]['rules_categories_exceptions']) && ($options['templateads-'.$i]['rules_categories_exceptions'] != ''))?explode(',', $options['templateads-'.$i]['rules_categories_exceptions']):array()),
285
+ 'geo_group1_countries' => ((isset($options['templateads-'.$i]['country_1']) && ($options['templateads-'.$i]['country_1'] != ''))?explode(',', $options['templateads-'.$i]['country_1']):array()),
286
+ 'geo_group1_adcode' => ((isset($oldValues['templateads-'.$i]['country_code_1']))?$oldValues['templateads-'.$i]['country_code_1']:''),
287
+ 'geo_group2_countries' => array(),
288
+ 'geo_group2_adcode' => '',
289
+ 'styles' => ((isset($oldValues['templateads-'.$i]['styles']))?$oldValues['templateads-'.$i]['styles']:'margin: 5px; padding: 0px;'),
290
+ 'notes' => ((isset($oldValues['templateads-'.$i]['notes']))?$oldValues['templateads-'.$i]['notes']:''),
291
+ );
292
+ }
293
+ }
294
+ update_option('wp_insert_inthemeads', $newValues);
295
+ }
296
+ }
297
+ /* End Database Upgrade */
298
+
299
+ /* Begin In-Theme Ad Insertion */
300
+ function wp_template_ad($identifier) { wp_intheme_ad('templateads-'.$identifier); }
301
+ function wp_intheme_ad($identifier) {
302
+ $inthemeads = get_option('wp_insert_inthemeads');
303
+ if(wp_insert_get_ad_status($inthemeads[$identifier])) {
304
+ echo '<div class="wpInsert wpInsertTemplateTag"'.(($inthemeads[$identifier]['styles'] != '')?' style="'.$inthemeads[$identifier]['styles'].'"':'').'>'.wp_insert_get_geotargeted_adcode($inthemeads[$identifier]).'</div>';
305
+ }
306
+ }
307
+ /* End In-Theme Ad Insertion */
308
+ ?>
includes/legal-pages.php ADDED
@@ -0,0 +1,395 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* Begin Privacy Policy */
3
+ add_action('wp_ajax_wp_insert_legalpages_privacy_policy_form_get_content', 'wp_insert_legalpages_privacy_policy_form_get_content');
4
+ function wp_insert_legalpages_privacy_policy_form_get_content() {
5
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
6
+
7
+ $legalPages = get_option('wp_insert_legalpages');
8
+ echo '<div class="wp_insert_popup_content_wrapper">';
9
+ $control = new smartlogixControls(array('optionIdentifier' => 'wp_insert_legalpages[privacy_policy]', 'values' => $legalPages['privacy_policy']));
10
+ echo '<div id="wp_insert_legalpages_privacy_policy_accordion">';
11
+ echo '<h3>Content</h3>';
12
+ echo '<div>';
13
+ add_filter('teeny_mce_buttons', create_function('', 'return array("bold", "italic", "underline", "blockquote", "separator", "strikethrough", "bullist", "numlist", "justifyleft", "justifycenter", "justifyright", "undo", "redo", "outdent", "indent");'), 10, 2);
14
+ add_filter('wp_default_editor', create_function('', 'return "tinymce";'));
15
+ wp_editor(
16
+ (($legalPages['privacy_policy']['content'] != '')?$legalPages['privacy_policy']['content']:wp_insert_legalpages_get_default_data('privacy_policy')),
17
+ 'wp_insert_legalpages_privacy_policy_content',
18
+ array('media_buttons' => false, 'textarea_name' => 'wp_insert_legalpages[privacy_policy][content]', 'teeny' => true, 'quicktags' => array('buttons' => ','), 'drag_drop_upload' => false, 'textarea_rows' => '15', 'tinymce' => array('wp_skip_init' => false), 'editor_height' => 225)
19
+ );
20
+ echo '</div>';
21
+ echo '<h3>Assign Pages(s)</h3>';
22
+ echo '<div>';
23
+ $control->add_control(array('type' => 'pages-select', 'optionName' => 'assigned_page'));
24
+ $control->create_section('Assign a Page');
25
+ echo $control->HTML;
26
+ echo '<p class="wp_insert_OR">OR</p>';
27
+ $control->set_HTML('<input type="button" id="wp_insert_legalpages_privacy_policy_generate_page" value="Click to Generate" class="input button-secondary wp_insert_generate_page_button" onclick="wp_insert_legalpages_generate_page(\'wp_insert_legalpages_privacy_policy\', \'Privacy Policy\')" /><div class="wp_insert_ajaxloader_flat" style="display: none;"></div>');
28
+ $control->create_section('Generate New Page');
29
+ echo $control->HTML;
30
+ echo '</div>';
31
+ echo '</div>';
32
+ \_WP_Editors::editor_js();
33
+ echo '<script type="text/javascript">';
34
+ echo $control->JS;
35
+ echo 'jQuery("#wp_insert_legalpages_privacy_policy_accordion").accordion({ icons: { header: "ui-icon-circle-arrow-e", activeHeader: "ui-icon-circle-arrow-s" }, heightStyle: "fill" });';
36
+ echo '</script>';
37
+ echo '</div>';
38
+ die();
39
+ }
40
+
41
+ add_action('wp_ajax_wp_insert_legalpages_privacy_policy_form_save_action', 'wp_insert_legalpages_privacy_policy_form_save_action');
42
+ function wp_insert_legalpages_privacy_policy_form_save_action() {
43
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
44
+
45
+ $legalPages = get_option('wp_insert_legalpages');
46
+ $legalPages['privacy_policy']['content'] = ((isset($_POST['wp_insert_legalpages_privacy_policy_content']))?$_POST['wp_insert_legalpages_privacy_policy_content']:'');
47
+ $legalPages['privacy_policy']['assigned_page'] = ((isset($_POST['wp_insert_legalpages_privacy_policy_assigned_page']))?$_POST['wp_insert_legalpages_privacy_policy_assigned_page']:'');
48
+ update_option('wp_insert_legalpages', $legalPages);
49
+ die();
50
+ }
51
+
52
+ add_action('wp_ajax_wp_insert_legalpages_privacy_policy_form_generate_page_action', 'wp_insert_legalpages_privacy_policy_form_generate_page_action');
53
+ function wp_insert_legalpages_privacy_policy_form_generate_page_action() {
54
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
55
+
56
+ $legalPages = get_option('wp_insert_legalpages');
57
+ $postID = wp_insert_post(array(
58
+ 'post_type' => 'page',
59
+ 'post_title' => 'Privacy Policy',
60
+ 'post_content' => '',
61
+ 'post_status' => 'publish',
62
+ 'post_author' => get_current_user_id()
63
+ ));
64
+ if(!is_wp_error($postID)) {
65
+ echo $postID;
66
+ $legalPages['privacy_policy']['assigned_page'] = $postID;
67
+ update_option('wp_insert_legalpages', $legalPages);
68
+ } else {
69
+ echo '0';
70
+ }
71
+ die();
72
+ }
73
+ /* End Privacy Policy */
74
+
75
+ /* Begin Terms and Conditions */
76
+ add_action('wp_ajax_wp_insert_legalpages_terms_conditions_form_get_content', 'wp_insert_legalpages_terms_conditions_form_get_content');
77
+ function wp_insert_legalpages_terms_conditions_form_get_content() {
78
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
79
+
80
+ $legalPages = get_option('wp_insert_legalpages');
81
+ echo '<div class="wp_insert_popup_content_wrapper">';
82
+ $control = new smartlogixControls(array('optionIdentifier' => 'wp_insert_legalpages[terms_conditions]', 'values' => $legalPages['terms_conditions']));
83
+ echo '<div id="wp_insert_legalpages_terms_conditions_accordion">';
84
+ echo '<h3>Content</h3>';
85
+ echo '<div>';
86
+ add_filter('teeny_mce_buttons', create_function('', 'return array("bold", "italic", "underline", "blockquote", "separator", "strikethrough", "bullist", "numlist", "justifyleft", "justifycenter", "justifyright", "undo", "redo", "outdent", "indent");'), 10, 2);
87
+ add_filter('wp_default_editor', create_function('', 'return "tinymce";'));
88
+ wp_editor(
89
+ (($legalPages['terms_conditions']['content'] != '')?$legalPages['terms_conditions']['content']:wp_insert_legalpages_get_default_data('terms_conditions')),
90
+ 'wp_insert_legalpages_terms_conditions_content',
91
+ array('media_buttons' => false, 'textarea_name' => 'wp_insert_legalpages[terms_conditions][content]', 'teeny' => true, 'quicktags' => array('buttons' => ','), 'drag_drop_upload' => false, 'textarea_rows' => '15', 'tinymce' => array('wp_skip_init' => false), 'editor_height' => 225)
92
+ );
93
+ echo '</div>';
94
+ echo '<h3>Assign Pages(s)</h3>';
95
+ echo '<div>';
96
+ $control->add_control(array('type' => 'pages-select', 'optionName' => 'assigned_page'));
97
+ $control->create_section('Assign a Page');
98
+ echo $control->HTML;
99
+ echo '<p class="wp_insert_OR">OR</p>';
100
+ $control->set_HTML('<input type="button" id="wp_insert_legalpages_terms_conditions_generate_page" value="Click to Generate" class="input button-secondary wp_insert_generate_page_button" onclick="wp_insert_legalpages_generate_page(\'wp_insert_legalpages_terms_conditions\', \'Terms and Conditions\')" /><div class="wp_insert_ajaxloader_flat" style="display: none;"></div>');
101
+ $control->create_section('Generate New Page');
102
+ echo $control->HTML;
103
+ echo '</div>';
104
+ echo '</div>';
105
+ \_WP_Editors::editor_js();
106
+ echo '<script type="text/javascript">';
107
+ echo $control->JS;
108
+ echo 'jQuery("#wp_insert_legalpages_terms_conditions_accordion").accordion({ icons: { header: "ui-icon-circle-arrow-e", activeHeader: "ui-icon-circle-arrow-s" }, heightStyle: "fill" });';
109
+ echo '</script>';
110
+ echo '</div>';
111
+ die();
112
+ }
113
+
114
+ add_action('wp_ajax_wp_insert_legalpages_terms_conditions_form_save_action', 'wp_insert_legalpages_terms_conditions_form_save_action');
115
+ function wp_insert_legalpages_terms_conditions_form_save_action() {
116
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
117
+
118
+ $legalPages = get_option('wp_insert_legalpages');
119
+ $legalPages['terms_conditions']['content'] = ((isset($_POST['wp_insert_legalpages_terms_conditions_content']))?$_POST['wp_insert_legalpages_terms_conditions_content']:'');
120
+ $legalPages['terms_conditions']['assigned_page'] = ((isset($_POST['wp_insert_legalpages_terms_conditions_assigned_page']))?$_POST['wp_insert_legalpages_terms_conditions_assigned_page']:'');
121
+ update_option('wp_insert_legalpages', $legalPages);
122
+ die();
123
+ }
124
+
125
+ add_action('wp_ajax_wp_insert_legalpages_terms_conditions_form_generate_page_action', 'wp_insert_legalpages_terms_conditions_form_generate_page_action');
126
+ function wp_insert_legalpages_terms_conditions_form_generate_page_action() {
127
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
128
+
129
+ $legalPages = get_option('wp_insert_legalpages');
130
+ $postID = wp_insert_post(array(
131
+ 'post_type' => 'page',
132
+ 'post_title' => 'Terms and Conditions',
133
+ 'post_content' => '',
134
+ 'post_status' => 'publish',
135
+ 'post_author' => get_current_user_id()
136
+ ));
137
+ if(!is_wp_error($postID)) {
138
+ echo $postID;
139
+ $legalPages['terms_conditions']['assigned_page'] = $postID;
140
+ update_option('wp_insert_legalpages', $legalPages);
141
+ } else {
142
+ echo '0';
143
+ }
144
+ die();
145
+ }
146
+ /* End Terms and Conditions */
147
+
148
+ /* Begin Disclaimer */
149
+ add_action('wp_ajax_wp_insert_legalpages_disclaimer_form_get_content', 'wp_insert_legalpages_disclaimer_form_get_content');
150
+ function wp_insert_legalpages_disclaimer_form_get_content() {
151
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
152
+
153
+ $legalPages = get_option('wp_insert_legalpages');
154
+ echo '<div class="wp_insert_popup_content_wrapper">';
155
+ $control = new smartlogixControls(array('optionIdentifier' => 'wp_insert_legalpages[disclaimer]', 'values' => $legalPages['disclaimer']));
156
+ echo '<div id="wp_insert_legalpages_disclaimer_accordion">';
157
+ echo '<h3>Content</h3>';
158
+ echo '<div>';
159
+ add_filter('teeny_mce_buttons', create_function('', 'return array("bold", "italic", "underline", "blockquote", "separator", "strikethrough", "bullist", "numlist", "justifyleft", "justifycenter", "justifyright", "undo", "redo", "outdent", "indent");'), 10, 2);
160
+ add_filter('wp_default_editor', create_function('', 'return "tinymce";'));
161
+ wp_editor(
162
+ (($legalPages['disclaimer']['content'] != '')?$legalPages['disclaimer']['content']:wp_insert_legalpages_get_default_data('disclaimer')),
163
+ 'wp_insert_legalpages_disclaimer_content',
164
+ array('media_buttons' => false, 'textarea_name' => 'wp_insert_legalpages[disclaimer][content]', 'teeny' => true, 'quicktags' => array('buttons' => ','), 'drag_drop_upload' => false, 'textarea_rows' => '15', 'tinymce' => array('wp_skip_init' => false), 'editor_height' => 225)
165
+ );
166
+ echo '</div>';
167
+ echo '<h3>Assign Pages(s)</h3>';
168
+ echo '<div>';
169
+ $control->add_control(array('type' => 'pages-select', 'optionName' => 'assigned_page'));
170
+ $control->create_section('Assign a Page');
171
+ echo $control->HTML;
172
+ echo '<p class="wp_insert_OR">OR</p>';
173
+ $control->set_HTML('<input type="button" id="wp_insert_legalpages_disclaimer_generate_page" value="Click to Generate" class="input button-secondary wp_insert_generate_page_button" onclick="wp_insert_legalpages_generate_page(\'wp_insert_legalpages_disclaimer\', \'Disclaimer\')" /><div class="wp_insert_ajaxloader_flat" style="display: none;"></div>');
174
+ $control->create_section('Generate New Page');
175
+ echo $control->HTML;
176
+ echo '</div>';
177
+ echo '</div>';
178
+ \_WP_Editors::editor_js();
179
+ echo '<script type="text/javascript">';
180
+ echo $control->JS;
181
+ echo 'jQuery("#wp_insert_legalpages_disclaimer_accordion").accordion({ icons: { header: "ui-icon-circle-arrow-e", activeHeader: "ui-icon-circle-arrow-s" }, heightStyle: "fill" });';
182
+ echo '</script>';
183
+ echo '</div>';
184
+ die();
185
+ }
186
+
187
+ add_action('wp_ajax_wp_insert_legalpages_disclaimer_form_save_action', 'wp_insert_legalpages_disclaimer_form_save_action');
188
+ function wp_insert_legalpages_disclaimer_form_save_action() {
189
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
190
+
191
+ $legalPages = get_option('wp_insert_legalpages');
192
+ $legalPages['disclaimer']['content'] = ((isset($_POST['wp_insert_legalpages_disclaimer_content']))?$_POST['wp_insert_legalpages_disclaimer_content']:'');
193
+ $legalPages['disclaimer']['assigned_page'] = ((isset($_POST['wp_insert_legalpages_disclaimer_assigned_page']))?$_POST['wp_insert_legalpages_disclaimer_assigned_page']:'');
194
+ update_option('wp_insert_legalpages', $legalPages);
195
+ die();
196
+ }
197
+
198
+ add_action('wp_ajax_wp_insert_legalpages_disclaimer_form_generate_page_action', 'wp_insert_legalpages_disclaimer_form_generate_page_action');
199
+ function wp_insert_legalpages_disclaimer_form_generate_page_action() {
200
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
201
+
202
+ $legalPages = get_option('wp_insert_legalpages');
203
+ $postID = wp_insert_post(array(
204
+ 'post_type' => 'page',
205
+ 'post_title' => 'Disclaimer',
206
+ 'post_content' => '',
207
+ 'post_status' => 'publish',
208
+ 'post_author' => get_current_user_id()
209
+ ));
210
+ if(!is_wp_error($postID)) {
211
+ echo $postID;
212
+ $legalPages['disclaimer']['assigned_page'] = $postID;
213
+ update_option('wp_insert_legalpages', $legalPages);
214
+ } else {
215
+ echo '0';
216
+ }
217
+ die();
218
+ }
219
+ /* End Disclaimer */
220
+
221
+ /* Begin Copyright Notice */
222
+ add_action('wp_ajax_wp_insert_legalpages_copyright_form_get_content', 'wp_insert_legalpages_copyright_form_get_content');
223
+ function wp_insert_legalpages_copyright_form_get_content() {
224
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
225
+
226
+ $legalPages = get_option('wp_insert_legalpages');
227
+ echo '<div class="wp_insert_popup_content_wrapper">';
228
+ $control = new smartlogixControls(array('optionIdentifier' => 'wp_insert_legalpages[copyright]', 'values' => $legalPages['copyright']));
229
+ echo '<div id="wp_insert_legalpages_copyright_accordion">';
230
+ echo '<h3>Content</h3>';
231
+ echo '<div>';
232
+ add_filter('teeny_mce_buttons', create_function('', 'return array("bold", "italic", "underline", "blockquote", "separator", "strikethrough", "bullist", "numlist", "justifyleft", "justifycenter", "justifyright", "undo", "redo", "outdent", "indent");'), 10, 2);
233
+ add_filter('wp_default_editor', create_function('', 'return "tinymce";'));
234
+ wp_editor(
235
+ (($legalPages['copyright']['content'] != '')?$legalPages['copyright']['content']:wp_insert_legalpages_get_default_data('copyright')),
236
+ 'wp_insert_legalpages_copyright_content',
237
+ array('media_buttons' => false, 'textarea_name' => 'wp_insert_legalpages[copyright][content]', 'teeny' => true, 'quicktags' => array('buttons' => ','), 'drag_drop_upload' => false, 'textarea_rows' => '15', 'tinymce' => array('wp_skip_init' => false), 'editor_height' => 225)
238
+ );
239
+ echo '</div>';
240
+ echo '<h3>Assign Pages(s)</h3>';
241
+ echo '<div>';
242
+ $control->add_control(array('type' => 'pages-select', 'optionName' => 'assigned_page'));
243
+ $control->create_section('Assign a Page');
244
+ echo $control->HTML;
245
+ echo '<p class="wp_insert_OR">OR</p>';
246
+ $control->set_HTML('<input type="button" id="wp_insert_legalpages_copyright_generate_page" value="Click to Generate" class="input button-secondary wp_insert_generate_page_button" onclick="wp_insert_legalpages_generate_page(\'wp_insert_legalpages_copyright\', \'Copyright Notice\')" /><div class="wp_insert_ajaxloader_flat" style="display: none;"></div>');
247
+ $control->create_section('Generate New Page');
248
+ echo $control->HTML;
249
+ echo '</div>';
250
+ echo '</div>';
251
+ \_WP_Editors::editor_js();
252
+ echo '<script type="text/javascript">';
253
+ echo $control->JS;
254
+ echo 'jQuery("#wp_insert_legalpages_copyright_accordion").accordion({ icons: { header: "ui-icon-circle-arrow-e", activeHeader: "ui-icon-circle-arrow-s" }, heightStyle: "fill" });';
255
+ echo '</script>';
256
+ echo '</div>';
257
+ die();
258
+ }
259
+
260
+ add_action('wp_ajax_wp_insert_legalpages_copyright_form_save_action', 'wp_insert_legalpages_copyright_form_save_action');
261
+ function wp_insert_legalpages_copyright_form_save_action() {
262
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
263
+
264
+ $legalPages = get_option('wp_insert_legalpages');
265
+ $legalPages['copyright']['content'] = ((isset($_POST['wp_insert_legalpages_copyright_content']))?$_POST['wp_insert_legalpages_copyright_content']:'');
266
+ $legalPages['copyright']['assigned_page'] = ((isset($_POST['wp_insert_legalpages_copyright_assigned_page']))?$_POST['wp_insert_legalpages_copyright_assigned_page']:'');
267
+ update_option('wp_insert_legalpages', $legalPages);
268
+ die();
269
+ }
270
+
271
+ add_action('wp_ajax_wp_insert_legalpages_copyright_form_generate_page_action', 'wp_insert_legalpages_copyright_form_generate_page_action');
272
+ function wp_insert_legalpages_copyright_form_generate_page_action() {
273
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
274
+
275
+ $legalPages = get_option('wp_insert_legalpages');
276
+ $postID = wp_insert_post(array(
277
+ 'post_type' => 'page',
278
+ 'post_title' => 'Copyright Notice',
279
+ 'post_content' => '',
280
+ 'post_status' => 'publish',
281
+ 'post_author' => get_current_user_id()
282
+ ));
283
+ if(!is_wp_error($postID)) {
284
+ echo $postID;
285
+ $legalPages['copyright']['assigned_page'] = $postID;
286
+ update_option('wp_insert_legalpages', $legalPages);
287
+ } else {
288
+ echo '0';
289
+ }
290
+ die();
291
+ }
292
+ /* End Copyright Notice */
293
+
294
+ /* Begin Database Upgrade */
295
+ add_action('wp_insert_upgrade_database', 'wp_insert_legalpages_upgrade_database');
296
+ function wp_insert_legalpages_upgrade_database() {
297
+ if(!get_option('wp_insert_legalpages')) {
298
+ $oldValues = get_option('wp_insert_legal_options');
299
+ $newValues = array(
300
+ 'privacy_policy' => array(
301
+ 'content' => ((isset($oldValues['privacy-policy']['content']))?$oldValues['privacy-policy']['content']:''),
302
+ 'assigned_page' => ((isset($oldValues['privacy-policy']['pages']))?$oldValues['privacy-policy']['pages']:''),
303
+ ),
304
+ 'terms_conditions' => array(
305
+ 'content' => ((isset($oldValues['terms-and-conditions']['content']))?$oldValues['terms-and-conditions']['content']:''),
306
+ 'assigned_page' => ((isset($oldValues['terms-and-conditions']['pages']))?$oldValues['terms-and-conditions']['pages']:''),
307
+ ),
308
+ 'disclaimer' => array(
309
+ 'content' => ((isset($oldValues['disclaimer']['content']))?$oldValues['disclaimer']['content']:''),
310
+ 'assigned_page' => ((isset($oldValues['disclaimer']['pages']))?$oldValues['disclaimer']['pages']:''),
311
+ ),
312
+ 'copyright' => array(
313
+ 'content' => ((isset($oldValues['copyright-notice']['content']))?$oldValues['copyright-notice']['content']:''),
314
+ 'assigned_page' => ((isset($oldValues['copyright-notice']['pages']))?$oldValues['copyright-notice']['pages']:''),
315
+ ),
316
+ );
317
+ update_option('wp_insert_legalpages', $newValues);
318
+ }
319
+ }
320
+ /* End Database Upgrade */
321
+
322
+ /* Begin Legal Pages Content Insertion */
323
+ add_filter('the_content', 'wp_insert_legalpages_the_content');
324
+ function wp_insert_legalpages_the_content($content) {
325
+ global $post;
326
+ $legalPages = get_option('wp_insert_legalpages');
327
+
328
+ if(isset($legalPages['privacy_policy']['assigned_page']) && ($legalPages['privacy_policy']['assigned_page'] != '') && ($post->ID == $legalPages['privacy_policy']['assigned_page'])) {
329
+ return do_shortcode(stripslashes($legalPages['privacy_policy']['content']));
330
+ }
331
+ if(isset($legalPages['terms_conditions']['assigned_page']) && ($legalPages['terms_conditions']['assigned_page'] != '') && ($post->ID == $legalPages['terms_conditions']['assigned_page'])) {
332
+ return do_shortcode(stripslashes($legalPages['terms_conditions']['content']));
333
+ }
334
+ if(isset($legalPages['disclaimer']['assigned_page']) && ($legalPages['disclaimer']['assigned_page'] != '') && ($post->ID == $legalPages['disclaimer']['assigned_page'])) {
335
+ return do_shortcode(stripslashes($legalPages['disclaimer']['content']));
336
+ }
337
+ if(isset($legalPages['copyright']['assigned_page']) && ($legalPages['copyright']['assigned_page'] != '') && ($post->ID == $legalPages['copyright']['assigned_page'])) {
338
+ return do_shortcode(stripslashes($legalPages['copyright']['content']));
339
+ }
340
+
341
+ return $content;
342
+ }
343
+
344
+ add_shortcode('sitename', 'wp_insert_legalpages_sitename_shortcode');
345
+ function wp_insert_legalpages_sitename_shortcode($atts) {
346
+ return '<i>'.get_bloginfo('name').'</i>';
347
+ }
348
+
349
+ function wp_insert_legalpages_get_default_data($pageType) {
350
+ $output = '';
351
+ switch($pageType) {
352
+ case 'privacy_policy':
353
+ $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>';
354
+ $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>';
355
+ $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>';
356
+ $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>';
357
+ $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>';
358
+ $output .= '<p>[sitename] has no access to or control over these cookies that are used by third-party advertisers.</p>';
359
+ $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>';
360
+ $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>';
361
+ break;
362
+ case 'terms_conditions':
363
+ $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>';
364
+ $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>';
365
+ $output .= '<ul>';
366
+ $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>';
367
+ $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>';
368
+ $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>';
369
+ $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>';
370
+ $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>';
371
+ $output .= '<li>Unauthorized use of this website may give rise to a claim for damages and/or be a criminal offense.</li>';
372
+ $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>';
373
+ $output .= '<li>You may not create a link to this website from another website or document without [sitename]\'s prior written consent.</li>';
374
+ $output .= '</ul>';
375
+ break;
376
+ case 'disclaimer':
377
+ $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>';
378
+ $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>';
379
+ $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>';
380
+ $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>';
381
+ break;
382
+ case 'copyright':
383
+ $output = '<p>This website and its content is copyright of [sitename] - &copy; [sitename] '.date('Y').'. All rights reserved.</p>';
384
+ $output .= '</p>Any redistribution or reproduction of part or all of the contents in any form is prohibited other than the following:</p>';
385
+ $output .= '<ul>';
386
+ $output .= '<li>you may print or download to a local hard disk extracts for your personal and non-commercial use only</li>';
387
+ $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>';
388
+ $output .= '</ul>';
389
+ $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>';
390
+ break;
391
+ }
392
+ return $output;
393
+ }
394
+ /* End Legal Pages Content Insertion */
395
+ ?>
includes/legal-pages/activate-upgrade.php DELETED
@@ -1,35 +0,0 @@
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 DELETED
@@ -1,66 +0,0 @@
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(!isset($data[$location])) { $data[$location] = array(); }
29
- $data = wp_insert_sanitize_array($data[$location], array('content', 'pages'));
30
-
31
- $controls = array();
32
- $controls['content'] = wp_insert_get_control('nicedit', false, $name.'[content]', $id.'-content', $data['content'], '', 'Leave the field empty to reset to the default content', null);
33
- $controls['pages'] = wp_insert_get_control('popup', false, $name.'[pages]', $id.'-pages', $data['pages'], 'Assign Page(s):', '', array('type' => 'pages'));
34
-
35
- $tabData = array(
36
- array(
37
- 'title' => 'Content',
38
- 'content' => $controls['content']['html']
39
- ),
40
- array(
41
- 'title' => 'Assign Page(s)',
42
- 'content' => $controls['pages']['html']
43
- )
44
- );
45
- $controls['vtab'] = wp_insert_get_vtabs('vtab_'.$location, $tabData);
46
- echo $controls['vtab']['html'];
47
-
48
- echo wp_insert_get_script_tag($controls);
49
- }
50
-
51
- function wp_insert_legal_validate($input) {
52
- if($input['privacy-policy']['content'] == '<br>') {
53
- $input['privacy-policy']['content'] = wp_insert_legal_get_default_privacy_policy();
54
- }
55
- if($input['terms-and-conditions']['content'] == '<br>') {
56
- $input['terms-and-conditions']['content'] = wp_insert_legal_get_default_terms_and_conditions();
57
- }
58
- if($input['disclaimer']['content'] == '<br>') {
59
- $input['disclaimer']['content'] = wp_insert_legal_get_default_disclaimer();
60
- }
61
- if($input['copyright-notice']['content'] == '<br>') {
62
- $input['copyright-notice']['content'] = wp_insert_legal_get_default_copyright_notice();
63
- }
64
- return $input;
65
- }
66
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/legal-pages/content.php DELETED
@@ -1,35 +0,0 @@
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'], explode(',', $options['privacy-policy']['pages']))) {
7
- return $options['privacy-policy']['content'];
8
- } else if(in_array($page_details['ID'], explode(',', $options['terms-and-conditions']['pages']))) {
9
- return $options['terms-and-conditions']['content'];
10
- } if(in_array($page_details['ID'], explode(',', $options['disclaimer']['pages']))) {
11
- return $options['disclaimer']['content'];
12
- } if(in_array($page_details['ID'], explode(',', $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 DELETED
@@ -1,48 +0,0 @@
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 DELETED
@@ -1,7 +0,0 @@
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 DELETED
@@ -1,7 +0,0 @@
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/multiple-adnetwork/activate-upgrade.php DELETED
@@ -1,28 +0,0 @@
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', $value);
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 DELETED
@@ -1,20 +0,0 @@
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
- echo wp_insert_get_control('select', true, $name.'[status]', $id.'-status', $data, 'Select the Ad Network Setup that best suits you :', '', $networkOptions);
13
- echo '<small>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.</small>';
14
- echo '<p>';
15
- echo '<b>Recommended Ad Networks</b><br />';
16
- echo '<a href="http://google.com/adsense"><img src="'.WP_INSERT_URL.'/includes/common/images/adsense.gif" /></a>';
17
- echo '<a href="https://chitika.com/publishers/apply.php?refid=smartlogix" style="margin-left: 10px;"><img src="'.WP_INSERT_URL.'/includes/common/images/chitika.png" /></a>';
18
- echo '</p>';
19
- }
20
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/multiple-adnetwork/multiple-adnetwork.php DELETED
@@ -1,4 +0,0 @@
1
- <?php
2
- require_once(dirname(__FILE__).'/activate-upgrade.php');
3
- require_once(dirname(__FILE__).'/meta-box.php');
4
- ?>
 
 
 
 
includes/syntax-highlighting/activate-upgrade.php DELETED
@@ -1,26 +0,0 @@
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 DELETED
@@ -1,39 +0,0 @@
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(!isset($data[$location])) { $data[$location] = array(); }
27
- $data = wp_insert_sanitize_array($data[$location], array('status'));
28
-
29
- $controls = array();
30
- $controls['status'] = wp_insert_get_control('tz-checkbox', false, $name.'[status]', $id.'-status', $data['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>');
31
-
32
- echo $controls['status']['html'];
33
- echo wp_insert_get_script_tag($controls);
34
- }
35
-
36
- function wp_insert_syntax_highlighting_validate($input) {
37
- return $input;
38
- }
39
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/codes.php DELETED
@@ -1,81 +0,0 @@
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
- add_action('admin_enqueue_scripts', 'wp_insert_syntax_highlighting_admin_enqueue_scripts');
8
-
9
- add_action('admin_footer', 'wp_insert_syntax_highlighting_admin_footer');
10
- }
11
-
12
- if($options['content']['status']) {
13
- wp_enqueue_script('editarea', WP_INSERT_URL.'/includes/syntax-highlighting/editarea/edit_area_full.js');
14
- add_action('wp_footer', 'wp_insert_syntax_highlighting_wp_footer');
15
- add_shortcode('code', 'wp_insert_syntax_highlighting_shortcode_code');
16
- }
17
- }
18
- }
19
-
20
- function wp_insert_syntax_highlighting_admin_enqueue_scripts($page) {
21
- if(('theme-editor.php' == $page) || ('plugin-editor.php' == $page)) {
22
- wp_enqueue_script('editarea', WP_INSERT_URL.'/includes/syntax-highlighting/editarea/edit_area_full.js');
23
- }
24
- }
25
-
26
- function wp_insert_syntax_highlighting_shortcode_code($atts, $content = null) {
27
- extract(shortcode_atts(array('language' => 'php', 'custom' => ''), $atts));
28
- $random = rand(0,999999);
29
- if($custom != '') {
30
- global $post;
31
- return '<textarea title="'.$language.'" class="codeSnippet" name="codeSnippet" id="codeSnippet_'.$random.'">'.get_post_meta($post->ID, $custom, true).'</textarea>';
32
- } else {
33
- return '<textarea title="'.$language.'" class="codeSnippet" name="codeSnippet" id="codeSnippet_'.$random.'">'.$content.'</textarea>';
34
- }
35
- }
36
-
37
- function wp_insert_syntax_highlighting_wp_footer() {
38
- echo '<script type="text/javascript">';
39
- echo 'try {';
40
- echo 'var codeBlocks = document.getElementsByName("codeSnippet");';
41
- echo 'for(var i = 0; i < codeBlocks.length; i++) {';
42
- echo 'editAreaLoader.init({';
43
- 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';
44
- echo '});';
45
- echo '}';
46
- echo '} catch (e) { void(0); }';
47
- echo '</script>';
48
- }
49
-
50
- function wp_insert_syntax_highlighting_admin_footer() {
51
- if(basename($_SERVER['SCRIPT_NAME']) == 'plugin-editor.php' || basename($_SERVER['SCRIPT_NAME']) == 'theme-editor.php') {
52
- global $file;
53
- $ext = strstr(basename($file),'.');
54
- switch($ext) {
55
- case '.php':
56
- $ext = 'php';
57
- break;
58
- case '.css':
59
- $ext = 'css';
60
- break;
61
- case '.js':
62
- $ext = 'js';
63
- break;
64
- case '.html':
65
- case '.htm':
66
- $ext = 'html';
67
- break;
68
- default:
69
- $ext = '';
70
- break;
71
- }
72
- echo '<script type="text/javascript">';
73
- echo 'try {';
74
- echo 'editAreaLoader.init({';
75
- 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.'"';
76
- echo '});';
77
- echo '} catch (e) { void(0); }';
78
- echo '</script>';
79
- }
80
- }
81
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/change_log.txt DELETED
@@ -1,293 +0,0 @@
1
- **** v 0.8.2 ****
2
- - Change back to remove the speed optimization for highlight process introduced in 0.8.1 that has too much bugs
3
- - Syntax name are no more stored in language files but in syntax files. Thoses display names will be used only if the compressor tools is used, otherwise syntax code is displayed
4
- - Activate word-wrap feature for opera > 9.6
5
- - Bug fix: Selection wasn't corretcly remembered between file tabs
6
- - Bug fix: [2886499] Page up and page Down action are no more executed if Alt touch is pressed
7
- - Bug fix: [2887118] UTF-8 encoded URLs return wrong base URL
8
- - Bug fix: [2851936] Unresolved reference to isIE in elements_functions.js
9
- - Bug fix: [2886836] get_IE_selection bug when closed...
10
- - bug fix: JavaScript error when switching to fullscreen (https://sourceforge.net/projects/editarea/forums/forum/556921/topic/3388824)
11
- - Bug fix (but not applicable due to change back) : [2854519, 2854642, 2792217, 2834579 ] Desynchronisation occcured with <, > and & characters
12
-
13
- **** v 0.8.1.1 ****
14
- - Fix bug of frequent syntax desynchronisation when the first character of the textarea was highlighted
15
- - In unload now check that parent.editareaLoader still exists before calling it
16
- - Now consider that gecko and webkit based browser are valid browsers (but I won't test them all)
17
-
18
- **** v 0.8.1 ****
19
- - Improved speed of text highlighting process for huge file. Now we try to only insert or delete the changed caracters inside DOM text node instead of refreshing the whole area. (3 time faster in firefox)
20
- - Greatly improved speed of line-height management in word-wrap context
21
- - Add java syntax (thanks to Dawson Goodell)
22
- - Use faster regexp for matching quoted strings
23
- - Bug fix: if a highlighted quote or comment string contains cariage return, editing text on one of the lines was causin a highlight desynchronisation
24
- - Bug fix: text war blur on Safari 3.2 (thanks to spellcoder)
25
- - Bug fix: there had several mistake with non-monospace font (thanks to spellcoder)
26
- - Bug fix: if show_line_colors was disabled and word wrap enable, highlighted text wasn't refreshed if a new line appears
27
- - Bug fix: in multi file edition, closing the last tab was throwing an error in Firefox and let the content of the textarea displayed
28
- - Browser bug detection: when using non-monospace font Firefox will sometime have strange behavior on text-width (the highlighted text-width in the background may change fron textarea one and simply can change after beeing updated); look likes a browser rendering bug
29
-
30
- **** v 0.8 ****
31
- - Word-wrap is now supported (except for opera...). The new init() option is 'word_wrap' to set to 'true' (default is false). A new button appears in the default toolbar (button_code: 'word_wrap' )
32
- - We can now clearly see the selected text
33
- - Add Internet explorer 8 support (but sadly I must use IE7 emulate mode in iframe due to a bug with tabulation width not beeing resized in IE's textarea)
34
- - Add Safari 4 support
35
- - Add Chrome 2 support
36
- - Better support of Opera 9.6
37
- - Add Simplified Chinese translation "zh" (thanks to Abentian)
38
- - Add Bulgarian translation "bg" (thanks to Valentin Hristov)
39
- - Rename internal function $() by _$()
40
- - Delete EditArea.add_event() method (duplicate af editAreaLoader.add_event() method)
41
- - Do some code cleanup-up
42
- - Bug fix: highlight optimisation process was not working under IE (don't known how long it remain broken but must be since a long time)
43
- - Bug fix: EditArea.update_size sometimes uses undefined variable (fix this possibility and cleanup events)
44
- - Bug fix: Template.html was not valid XHTML
45
- - Bug fix: The checked attribute of the toogle button was not defined in xhtml syntax
46
- - Bug fix: If the editArea was loaded on a page related to a domain which was itself an iframe comming from another domain a JS error was thrown on load
47
- - Bug fix: When EditArea is used to replace a textarea which has style="visibility:hidden;", switching off EditArea would throw an error under IE
48
-
49
- **** v 0.7.3 ****
50
- - Add Finnish transaltion (thanks to Janne Mäntyharju)
51
- - Add 'cursor_position' init() option for defining where the cursor should be when the editor is show on the first time ('auto' or 'begin'). This was like 'auto' before now this is like 'begin' by default
52
- - better add_style method (faster than old one) thanks to Spellcoder
53
- - Bug fix: fix bug with mootools 1.2
54
- - Bug fix: if page had no stylesheets when editarea load, it would generate an error
55
-
56
- **** v 0.7.2.3 ****
57
- - it's now released under both LGPL, Apache, BSD license (you can use the one you prefer)
58
- - add support for bonEcho browser
59
-
60
- **** v 0.7.2.2 ****
61
- - Fix bug regression introduced in 0.7.2 that make IE7 not working
62
- - add Esperento translation (thanks to Olivier)
63
- - add Coldfusion syntax (thanks to Max Leynov)
64
-
65
- **** v 0.7.2.1 ****
66
- - fix bug for firefox rendering of highlighted lines that doesn't begin with a tab
67
- - support for browser with grandParadisio agent instead of firefox
68
-
69
- **** v 0.7.2 ****
70
- - add Chrome support
71
- - add show_line_colors init() option for enabling syntax color display and update on the currently edited line (disable the blue bar) (default to false)
72
- - Add Perl syntax definition file (thanks to Christoph Pinkel)
73
- - Bug fix: there allways was an horizontal scrollbar even if the content fit in the area.
74
-
75
- **** v 0.7.1.3 ****
76
- - Fix a bug introduced in Firefox 3.0.1 => the browser is no more able to render properly "pre" element with left padding...
77
- - Add Robots.txt (thanks to Pavle Ggardijan) and T-SQL syntax definition files (thanks to Miladin Joksic)
78
-
79
- **** v 0.7.1.2 ****
80
- - Fix a bug on the full screen mode (regression added on 0.7.1.1)
81
-
82
- **** v 0.7.1.1 ****
83
- - Firefox 3 RC1 compatibility
84
- - Code size reduction: 120Ko => 107Ko for edit_area_full.js
85
-
86
- **** v 0.7.1 ****
87
- - released under both LGPL and Apache license (you can use the one you prefer)
88
- - it's now possible to get a readonly mode:
89
- * new EditAreaLoader.init()'s option: "is_editable": true/false
90
- * Possibility to switch edition mode by using the execCommand function: editAreaLoader.execCommand('editor_id', 'set_editable', !editAreaLoader.execCommand('editor_id', 'is_editable'));
91
- - Added Ruby syntax (thanks to Patrice De Saint Steban)
92
- - Fix a bug where the textarea lose the focus under firefox for Mac
93
- - Minor other bug fixes
94
-
95
- **** v 0.7.0.2 ****
96
- - Fixed a bug with translation files containing non-latin caracters. Translations files must be in UTF-8.
97
- - Added Czech, Macedionian and Russian translations
98
-
99
-
100
- **** v 0.7.0.1 ****
101
- - in multiple file mode, it's now possible to cancel the 'EA_file_close_callback' function. if the callback return false, the edited file won't be closed
102
- - bug fix: if no syntax was defined in the main init() function in multifile mode, the first time the text was not highlighted
103
-
104
-
105
- **** v 0.7 ****
106
- - it's now possible to edit multiple files into one instance of EditArea. This (sponsored by Jupiter) feature comes with:
107
- * new EditAreaLoader.init()'s option: "is_multi_files": true
108
- * new editAreaLoader's functions: editAreaLoader.getCurrentFile(editArea_id), editAreaLoader.getFile(editArea_id, file_id), editAreaLoader.getAllFiles(editArea_id), editAreaLoader.openFile(editArea_id, file_infos), editAreaLoader.closeFile(editArea_id, file_id), editAreaLoader.setFileEditedMode(editArea_id, file_id, edited_mode)
109
- * new callabacks: EA_file_switch_on_callback, EA_file_switch_off_callback, EA_file_close_callback
110
- - look likes Safari 3 is working with EditArea
111
- - add spanish translation (thanks Garito)
112
- - add slovak translation (thanks Gabriel Schwardy)
113
- - add SQL syntax definition file (thanks to Philippe Lewicki)
114
- - the syntax selection plugin has been integrated to editarea core and load only needed files (the plugins was loading all the possible syntax files...). Toolbar button name: "syntax_selection", comma separated available syntax list: "syntax_selection_allow"
115
- - add a 'compression' option in edit_area_compressor.php that allow to set where the code should be compressed or just packed (simple packed mode usefull for debugging)
116
- - the yellow area that indicate the current edited line is now blue
117
- - bug fix: parenthesis matching was not working correctly if there where an "<" between parenthesis
118
-
119
- **** v 0.6.7 ****
120
- - add a new plugin that allow the user to change the syntax definition in use. It adds a select in the toolbar. - plugin name to add to the plugin list: "syntax_selection". - plugin name to add to the toolbar list: "syntax_selection". - possible parameter to add to EditAreaLoader.init():
121
- "syntax_selection_allow": (String) define a list separated by "," of possible language syntax to use (eg: "php,js,python,html")
122
- - add Croatian translation (HR) (thanks to Ivan Vucica and Davor Cihlar)
123
- - add BASIC, Brainf*ck, C, C++ and Pascal syntax definition files (thanks to Ivan Vucica and Davor Cihlar)
124
- - add Iceweasel as a known working navigator (its a clone of Firefox)
125
- - improved the php syntax by highlighting the variables ($...)
126
- - reactivate gzip compression for IE7 (was desactivate for IE as it sometimes failed). (Let me know if you see that the load fails under IE7)
127
- - pressing "enter" while being in the search box now perform a search.
128
- - add Camino as a supported browser
129
- - bug fix: when clicking between the bottom toolbar and the textarea (when there is only few lines of text), the textarea didn't get the focus
130
- - bug fix: under IE the delete_instance() method was throwing an error
131
- - bug fix: if the textarea to convert in an EditArea was in a frame (or iframe) getting back from fullscreen to normal display was not restoring the correct settings to the frame containing the textarea.
132
- - bug fix (at least I hope): in IE if the textarea to convert in an EditArea was in a frame, resizing the frame was not correctly resizing the editor if it was in fullscreen.
133
- - bug fix: in Opera the selectionned line was not rendered correctly if containing \t caracters (bug introduced in one of the latest version...)
134
- - bug fix: "altgr+f" was openning the searchbox and avoid to write "[" and "]" in croatian keyboards.
135
- - bug fix: in Firefox "ctrl+tab" was inserting a tabulation while switching active tab (window)
136
-
137
- Note: v 0.6.5 and v 0.6.6 have been private release (change log is regrouped in v 0.6.7)
138
-
139
- **** v 0.6.4 ****
140
- - add replace_tab_by_spaces init() option which allow to replace all tabulation caracters typped in the text by a given number of spaces
141
- - add min_width and min_height init() option for the minimum size in pixel for the editor
142
- - add dutch translation files (NL) (thanks to Bart Bosma)
143
- - pressing Shift+Tab when no text is selected now delete the tabulation before the cursor (if a tabulation is present directly behing the cursor)
144
- - improve Python syntax (thanks to Andre Roberge)
145
- - bug fix: the fullpage plugin was not working correctly when the Editor was placed inside several divs that have positioning of there own
146
- - bug fix: one regexp used in edit_area_compressor.php was not compatible with latest PCRE version
147
-
148
- - fix the my_load and my_save functions of the 'exemple_full.html' page
149
-
150
- **** v 0.6.3.1 ****
151
- - regression: restore monospace as default font
152
- - add little improvements to the PHP compressor: allow to win 7 Ko on edit_area_full.js
153
- - add the version number in the about popup
154
- - bug fix: fix a regexp that was not compliant with newer version of PCRE
155
- - bug fix: fix some bug with the fullscreen mode (still not perfect in Opera)
156
- - bug fix: the close button of the help popup was not correctly translated
157
- - bug fix: when deleting an instance of editArea toggle_off was called even if the editArea was not displayed
158
-
159
-
160
- **** v 0.6.3 ****
161
- - allow to use non monospace font using the font_family init option. Firefox get smaller tabulation with non monospace fonts. IE doesn't change the tabulation width and Opera doesn't take this option into account... new default font-familly: 'verdana,monospace'
162
- - add fullscreen option in the toolbar and as an init() option.
163
- - if the based textarea has a width (or height) in '%', EditArea will get the same '%' width (or height), allowing EditArea to be resized in the same time than the window.
164
- - add many callback possibility: submit_callback, EA_load_callback, EA_unload_callback, EA_init_callback, EA_toggle_on_callback, EA_toggle_off_callback, EA_delete_callback (see documentation for more information)
165
- - bug fix: when toggling from textarea to editarea, IE was almost of the time not keeping the selection
166
- - bug fix: the brackets where still highlighted in red when being deleted
167
- - bug fix: brackets where not placed correctly when the line contains html entitites (&amp; &quot; etc....)
168
-
169
-
170
- **** v 0.6.2 ****
171
- WARNING => POSSIBLE BREAK COMPATIBILITY:
172
- - the load_callback now receive the 'id' of the textarea and no more a reference to the textarea. Developpers should use editAreaLoder methods rather than modfying directly the textarea.
173
- - the save_callback now receive the 'id' of the textarea as first argument, and it's content in the second argument.
174
-
175
- - EditArea is now compatible with javascript libraries like "prototype" (1.5) and "mootools" (release 83)
176
- - add two function to EditAreaLoader: hide(id) and show(id), that will allow to completly hide/restore both EditArea and normal textarea (usefull when EditArea is included in tabs).
177
- - it's no more possible to move the search window out of the frame.
178
- - gecko_spellcheck option is now set to false by default.
179
- - add a onchange_callback option (cf doc)
180
- - bug fix: in IE when syntax highlight was on, clicking on the textarea outside the range of the text, the click wasn't taking into account.
181
- - bug fix: references to the orginal textarea could be lost while using EditArea.
182
- - bug fix: using insertTags, getSelectionRange when editArea was not focused, IE failed
183
- - bug fix: main script could fail to load additionnal files in certain specific cases
184
-
185
- **** v 0.6.1 ****
186
- - compatiblity with Firefox 2 checked (was already compatible before).
187
- - compatiblity with IE7 checked (was already compatible before).
188
- - added possibility to call the editAreaLoader.init() function at any moment (no more limited to window load). Allow to replace an EditArea instance by a new one with other options.
189
- - added new gecko_spellcheck option, this enables you to disable/enable the FF 2.0 spellchecker.
190
- - added editAreaLoader.delete_instance(id) to allow to delete an EditArea instance
191
- - Fix a bug where "Ctrl+G" wasn't openning anymore the go to line prompt box.
192
-
193
-
194
- **** v 0.6.0.1 ****
195
- - add italian translation (thanks to Luciano Vernaschi)
196
- - add polish translation (thanks to Piotr Furman)
197
- - improve deutsh translation (thanks to Felix Riesterer)
198
- - add a little style improvement for buttons in search popup. they can't be splited in two line anymore
199
- - change color for tags in html and xml syntax due to visibility problems
200
-
201
-
202
- **** v 0.6 ****
203
- - add plugins possibilies
204
- - add editAreaLoader.insertTags function to allow easy tags insertion.
205
- - improve undo & redo functionnality
206
- - improve php compression: "edit_area_full.js" is 9 Ko smaller
207
- - improve syntax highlight regexp for quotted string. \\" or \\' (or \\\\", etc...) will now effectively close quotted string
208
- - add scrollbars to the popups when the popup's height is smaller than the editor's height
209
- - add japanese translation file (thanks to ISHITOYA Kentaro)
210
- - add possibility to add line-break in toolbar ("*")
211
- - disable gzip compression for IE (see: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312496)
212
- - bug fix: when submitting form while editarea toggled off, the post value was equals to the old content of editarea and not the visible textarea
213
- - bug fix: under IE the editor was scrolling when pressing enter
214
- - bug fix: when insterting text on first line there was an highlight desynchronization
215
-
216
-
217
-
218
- **** v 0.5.3 ****
219
- WARNING => POSSIBLE BREAK COMPATIBILITY:
220
- - correct a spelling error: "toogle" become "toggle" in the whole code. This can perturb the initialization with the "allow_toggle" init parameters
221
-
222
- - add a case sensitive option in syntax definition files
223
- - improve html syntax definition file
224
- - add xml syntax definition file
225
- - add vb syntax definition file (thanks to Martin Gottlieb)
226
- - add some function that will allow dynamic EditArea content management, taking into account if the editor is displayed or toggled off (editAreaLodaer.getValue(), editAreaLoader.setValue(), editAreaLoader.getSelectedText(), editAreaLoader.setSelectedText(), editAreaLoader.getSelectionRange and editAreaLoader.setSelectionRange()). See "javascript functions" documentation for more informations
227
- - add a generic function (editaAreaLoader.execCommand) to allow to access EditArea's functions and datas
228
- - add portuguese translation file (thanks to Leonardo Sapucaia)
229
- - add compatibility to IE7 RC1
230
-
231
-
232
- **** v 0.5.2 ****
233
- - Opera improvement: text indentation is now working, and "go to line" is now working as in other browsers
234
- - Bug fix: It was still possible to select text in search popup
235
- - Bug fix: the "go to line" popup wasn't displaying anymore
236
- - There was still some hard codded word in the search field => added them to translation files
237
- - Bug fix: when multiple languages were used in the same page, there could have translation exchange between the different editors
238
-
239
-
240
- **** v 0.5.1 ****
241
- - Bug fix: the highlighted bracket was displayed on line 1 when it should be in line 2
242
- - Bug fix: the highlighted bracket were bad displayed in IE
243
- - Bug fix: their was some error in the optimisation process of the highlight mode
244
- - Bug fix: their was a bug when moving the search popup on IE
245
-
246
- **** v 0.5 ****
247
- - Now released under LGPL
248
- - Rewrite nearly from scratch
249
- - Added Danish translation file (thanks to Peter Klein)
250
- - Add python syntax
251
-
252
-
253
- WARNING => BREAK COMPATIBILITY:
254
- - the whole loading process (javascript include and init function call) is changed (but it's similar to the old version)
255
- - the languages translation files are not stored in the same variable
256
-
257
-
258
- IMPROVEMENTS:
259
- - The whole code is more stable
260
- - Allow several instance on the same page
261
- - Faster to load
262
- - The highlight process is more stable and there is nearly no more to use the "re sync" button
263
- - Add support of Opera 9 (even if its still not perfect)
264
- - Add the possibility to load a new compressed script of only 20Ko for the whole core script even if PHP is not installed
265
- - The textarea can be toggled to an EditArea on window load or later
266
- - The EditArea is loaded in a iframe => there is no more interaction with user css
267
- - Support the reset action of a form
268
- - Add support for "page up" & "page down" button
269
- - There is now a waiting screen when toggling on the highlight syntax (but it can't be an animated one, even gif are not animated due to CPU load)
270
- - All supported browsers can now change font-size
271
-
272
- BUG FIXES:
273
- - Sometimes while using the "toggle editor" button to turn of the editor, the standard textarea was expanded to the full size of the textarea content.
274
- - When resizing the area the selection was lost
275
- - Allow translation for some forgotten hard-coded word (the "move" button for search popup, and "font size", and keys word in help panel).
276
- - It was possible to "drag" the buttons from the Search/Replace popup into the content of the textarea.
277
- - On first display (when the files are not in cache) or with xhtml doctype there is a display bug (the content of the textarea exceed of 4px)
278
- - when the cursor was at the beginning of the 1st line of the textarea, the caracter position was set to 0 instead of 1
279
-
280
-
281
-
282
- ***v 0.4****
283
- - Increases syntax highlight proccess speed by 5 => allow a better live editing mode with syntax highlight.
284
- - Now syntax highlight has a real language syntax. Text is parsing with rules depending of the language definition file. (limitation: there is only one language on the same time > doesn't allow to parse html and php on the same page).
285
- - Syntax highlight can be easily extended with new code languages (there is currently: php, css, js, html).
286
- - Add german language file (thanks to Olaf Brambrink).
287
- - Fix some little bugs.
288
-
289
-
290
-
291
-
292
- ***v0.33***
293
- - First release.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/edit_area.css DELETED
@@ -1,530 +0,0 @@
1
- body, html{
2
- margin: 0;
3
- padding: 0;
4
- height: 100%;
5
- border: none;
6
- overflow: hidden;
7
- background-color: #FFF;
8
- }
9
-
10
- body, html, table, form, textarea{
11
- font: 12px monospace, sans-serif;
12
- }
13
-
14
- #editor{
15
- border: solid #888 1px;
16
- overflow: hidden;
17
- }
18
-
19
- #result{
20
- z-index: 4;
21
- overflow-x: auto;
22
- overflow-y: scroll;
23
- border-top: solid #888 1px;
24
- border-bottom: solid #888 1px;
25
- position: relative;
26
- clear: both;
27
- }
28
-
29
- #result.empty{
30
- overflow: hidden;
31
- }
32
-
33
- #container{
34
- overflow: hidden;
35
- border: solid blue 0;
36
- position: relative;
37
- z-index: 10;
38
- padding: 0 5px 0 45px;
39
- /*padding-right: 5px;*/
40
- }
41
-
42
- #textarea{
43
- position: relative;
44
- top: 0;
45
- left: 0;
46
- margin: 0;
47
- padding: 0;
48
- width: 100%;
49
- height: 100%;
50
- overflow: hidden;
51
- z-index: 7;
52
- border-width: 0;
53
- background-color: transparent;
54
- resize: none;
55
- }
56
-
57
- #textarea, #textarea:hover{
58
- outline: none; /* safari outline fix */
59
- }
60
-
61
- #content_highlight{
62
- white-space: pre;
63
- margin: 0;
64
- padding: 0;
65
- position : absolute;
66
- z-index: 4;
67
- overflow: visible;
68
- }
69
-
70
-
71
- #selection_field, #selection_field_text{
72
- margin: 0;
73
- background-color: #E1F2F9;
74
- /* height: 1px; */
75
- position: absolute;
76
- z-index: 5;
77
- top: -100px;
78
- padding: 0;
79
- white-space: pre;
80
- overflow: hidden;
81
- }
82
-
83
- #selection_field.show_colors {
84
- z-index: 3;
85
- background-color:#EDF9FC;
86
-
87
- }
88
-
89
- #selection_field strong{
90
- font-weight:normal;
91
- }
92
-
93
- #selection_field.show_colors *, #selection_field_text * {
94
- visibility: hidden;
95
- }
96
-
97
- #selection_field_text{
98
- background-color:transparent;
99
- }
100
-
101
- #selection_field_text strong{
102
- font-weight:normal;
103
- background-color:#3399FE;
104
- color: #FFF;
105
- visibility:visible;
106
- }
107
-
108
- #container.word_wrap #content_highlight,
109
- #container.word_wrap #selection_field,
110
- #container.word_wrap #selection_field_text,
111
- #container.word_wrap #test_font_size{
112
- white-space: pre-wrap; /* css-3 */
113
- white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
114
- white-space: -pre-wrap; /* Opera 4-6 */
115
- white-space: -o-pre-wrap; /* Opera 7 */
116
- word-wrap: break-word; /* Internet Explorer 5.5+ */
117
- width: 99%;
118
- }
119
-
120
- #line_number{
121
- position: absolute;
122
- overflow: hidden;
123
- border-right: solid black 1px;
124
- z-index:8;
125
- width: 38px;
126
- padding: 0 5px 0 0;
127
- margin: 0 0 0 -45px;
128
- text-align: right;
129
- color: #AAAAAA;
130
- }
131
-
132
- #test_font_size{
133
- padding: 0;
134
- margin: 0;
135
- visibility: hidden;
136
- position: absolute;
137
- white-space: pre;
138
- }
139
-
140
- pre{
141
- margin: 0;
142
- padding: 0;
143
- }
144
-
145
- .hidden{
146
- opacity: 0.2;
147
- filter:alpha(opacity=20);
148
- }
149
-
150
- #result .edit_area_cursor{
151
- position: absolute;
152
- z-index:6;
153
- background-color: #FF6633;
154
- top: -100px;
155
- margin: 0;
156
- }
157
-
158
- #result .edit_area_selection_field .overline{
159
- background-color: #996600;
160
- }
161
-
162
-
163
- /* area popup */
164
- .editarea_popup{
165
- border: solid 1px #888888;
166
- background-color: #ECE9D8;
167
- width: 250px;
168
- padding: 4px;
169
- position: absolute;
170
- visibility: hidden;
171
- z-index: 15;
172
- top: -500px;
173
- }
174
-
175
- .editarea_popup, .editarea_popup table{
176
- font-family: sans-serif;
177
- font-size: 10pt;
178
- }
179
-
180
- .editarea_popup img{
181
- border: 0;
182
- }
183
-
184
- .editarea_popup .close_popup{
185
- float: right;
186
- line-height: 16px;
187
- border: 0;
188
- padding: 0;
189
- }
190
-
191
- .editarea_popup h1,.editarea_popup h2,.editarea_popup h3,.editarea_popup h4,.editarea_popup h5,.editarea_popup h6{
192
- margin: 0;
193
- padding: 0;
194
- }
195
-
196
- .editarea_popup .copyright{
197
- text-align: right;
198
- }
199
-
200
- /* Area_search */
201
- div#area_search_replace{
202
- /*width: 250px;*/
203
- }
204
-
205
- div#area_search_replace img{
206
- border: 0;
207
- }
208
-
209
- div#area_search_replace div.button{
210
- text-align: center;
211
- line-height: 1.7em;
212
- }
213
-
214
- div#area_search_replace .button a{
215
- cursor: pointer;
216
- border: solid 1px #888888;
217
- background-color: #DEDEDE;
218
- text-decoration: none;
219
- padding: 0 2px;
220
- color: #000000;
221
- white-space: nowrap;
222
- }
223
-
224
- div#area_search_replace a:hover{
225
- /*border: solid 1px #888888;*/
226
- background-color: #EDEDED;
227
- }
228
-
229
- div#area_search_replace #move_area_search_replace{
230
- cursor: move;
231
- border: solid 1px #888;
232
- }
233
-
234
- div#area_search_replace #close_area_search_replace{
235
- text-align: right;
236
- vertical-align: top;
237
- white-space: nowrap;
238
- }
239
-
240
- div#area_search_replace #area_search_msg{
241
- height: 18px;
242
- overflow: hidden;
243
- border-top: solid 1px #888;
244
- margin-top: 3px;
245
- }
246
-
247
- /* area help */
248
- #edit_area_help{
249
- width: 350px;
250
- }
251
-
252
- #edit_area_help div.close_popup{
253
- float: right;
254
- }
255
-
256
- /* area_toolbar */
257
- .area_toolbar{
258
- /*font: 11px sans-serif;*/
259
- width: 100%;
260
- /*height: 21px; */
261
- margin: 0;
262
- padding: 0;
263
- background-color: #ECE9D8;
264
- text-align: center;
265
- }
266
-
267
- .area_toolbar, .area_toolbar table{
268
- font: 11px sans-serif;
269
- }
270
-
271
- .area_toolbar img{
272
- border: 0;
273
- vertical-align: middle;
274
- }
275
-
276
- .area_toolbar input{
277
- margin: 0;
278
- padding: 0;
279
- }
280
-
281
- .area_toolbar select{
282
- font-family: 'MS Sans Serif',sans-serif,Verdana,Arial;
283
- font-size: 7pt;
284
- font-weight: normal;
285
- margin: 2px 0 0 0 ;
286
- padding: 0;
287
- vertical-align: top;
288
- background-color: #F0F0EE;
289
- }
290
-
291
- table.statusbar{
292
- width: 100%;
293
- }
294
-
295
- .area_toolbar td.infos{
296
- text-align: center;
297
- width: 130px;
298
- border-right: solid 1px #888;
299
- border-width: 0 1px 0 0;
300
- padding: 0;
301
- }
302
-
303
- .area_toolbar td.total{
304
- text-align: right;
305
- width: 50px;
306
- padding: 0;
307
- }
308
-
309
- .area_toolbar td.resize{
310
- text-align: right;
311
- }
312
- /*
313
- .area_toolbar span{
314
- line-height: 1px;
315
- padding: 0;
316
- margin: 0;
317
- }*/
318
-
319
- .area_toolbar span#resize_area{
320
- cursor: nw-resize;
321
- visibility: hidden;
322
- }
323
-
324
- /* toolbar buttons */
325
- .editAreaButtonNormal, .editAreaButtonOver, .editAreaButtonDown, .editAreaSeparator, .editAreaSeparatorLine, .editAreaButtonDisabled, .editAreaButtonSelected {
326
- border: 0; margin: 0; padding: 0; background: transparent;
327
- margin-top: 0;
328
- margin-left: 1px;
329
- padding: 0;
330
- }
331
-
332
- .editAreaButtonNormal {
333
- border: 1px solid #ECE9D8 !important;
334
- cursor: pointer;
335
- }
336
-
337
- .editAreaButtonOver {
338
- border: 1px solid #0A246A !important;
339
- cursor: pointer;
340
- background-color: #B6BDD2;
341
- }
342
-
343
- .editAreaButtonDown {
344
- cursor: pointer;
345
- border: 1px solid #0A246A !important;
346
- background-color: #8592B5;
347
- }
348
-
349
- .editAreaButtonSelected {
350
- border: 1px solid #C0C0BB !important;
351
- cursor: pointer;
352
- background-color: #F4F2E8;
353
- }
354
-
355
- .editAreaButtonDisabled {
356
- filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
357
- -moz-opacity:0.3;
358
- opacity: 0.3;
359
- border: 1px solid #F0F0EE !important;
360
- cursor: pointer;
361
- }
362
-
363
- .editAreaSeparatorLine {
364
- margin: 1px 2px;
365
- background-color: #C0C0BB;
366
- width: 2px;
367
- height: 18px;
368
- }
369
-
370
- /* waiting screen */
371
- #processing{
372
- display: none;
373
- background-color:#ECE9D8;
374
- border: solid #888 1px;
375
- position: absolute;
376
- top: 0;
377
- left: 0;
378
- width: 100%;
379
- height: 100%;
380
- z-index: 100;
381
- text-align: center;
382
- }
383
-
384
- #processing_text{
385
- position:absolute;
386
- left: 50%;
387
- top: 50%;
388
- width: 200px;
389
- height: 20px;
390
- margin-left: -100px;
391
- margin-top: -10px;
392
- text-align: center;
393
- }
394
- /* end */
395
-
396
-
397
- /**** tab browsing area ****/
398
- #tab_browsing_area{
399
- display: none;
400
- background-color: #CCC9A8;
401
- border-top: 1px solid #888;
402
- text-align: left;
403
- margin: 0;
404
- }
405
-
406
- #tab_browsing_list {
407
- padding: 0;
408
- margin: 0;
409
- list-style-type: none;
410
- white-space: nowrap;
411
- }
412
- #tab_browsing_list li {
413
- float: left;
414
- margin: -1px;
415
- }
416
- #tab_browsing_list a {
417
- position: relative;
418
- display: block;
419
- text-decoration: none;
420
- float: left;
421
- cursor: pointer;
422
- line-height:14px;
423
- }
424
-
425
- #tab_browsing_list a span {
426
- display: block;
427
- color: #000;
428
- background: #ECE9D8;
429
- border: 1px solid #888;
430
- border-width: 1px 1px 0;
431
- text-align: center;
432
- padding: 2px 2px 1px 4px;
433
- position: relative; /*IE 6 hack */
434
- }
435
-
436
- #tab_browsing_list a b {
437
- display: block;
438
- border-bottom: 2px solid #617994;
439
- }
440
-
441
- #tab_browsing_list a .edited {
442
- display: none;
443
- }
444
-
445
- #tab_browsing_list a.edited .edited {
446
- display: inline;
447
- }
448
-
449
- #tab_browsing_list a img{
450
- margin-left: 7px;
451
- }
452
-
453
- #tab_browsing_list a.edited img{
454
- margin-left: 3px;
455
- }
456
-
457
- #tab_browsing_list a:hover span {
458
- background: #F4F2E8;
459
- border-color: #0A246A;
460
- }
461
-
462
- #tab_browsing_list .selected a span{
463
- background: #046380;
464
- color: #FFF;
465
- }
466
-
467
-
468
- #no_file_selected{
469
- height: 100%;
470
- width: 150%; /* Opera need more than 100% */
471
- background: #CCC;
472
- display: none;
473
- z-index: 20;
474
- position: absolute;
475
- }
476
-
477
-
478
- /*** Non-editable mode ***/
479
- .non_editable #editor
480
- {
481
- border-width: 0 1px;
482
- }
483
-
484
- .non_editable .area_toolbar
485
- {
486
- display: none;
487
- }
488
-
489
- /*** Auto completion ***/
490
- #auto_completion_area
491
- {
492
- background: #FFF;
493
- border: solid 1px #888;
494
- position: absolute;
495
- z-index: 15;
496
- width: 280px;
497
- height: 180px;
498
- overflow: auto;
499
- display:none;
500
- }
501
-
502
- #auto_completion_area a, #auto_completion_area a:visited
503
- {
504
- display: block;
505
- padding: 0 2px 1px;
506
- color: #000;
507
- text-decoration:none;
508
- }
509
-
510
- #auto_completion_area a:hover, #auto_completion_area a:focus, #auto_completion_area a.focus
511
- {
512
- background: #D6E1FE;
513
- text-decoration:none;
514
- }
515
-
516
- #auto_completion_area ul
517
- {
518
- margin: 0;
519
- padding: 0;
520
- list-style: none inside;
521
- }
522
- #auto_completion_area li
523
- {
524
- padding: 0;
525
- }
526
- #auto_completion_area .prefix
527
- {
528
- font-style: italic;
529
- padding: 0 3px;
530
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/edit_area_full.js DELETED
@@ -1,38 +0,0 @@
1
- function EAL(){var t=this;t.version="0.8.2";date=new Date();t.start_time=date.getTime();t.win="loading";t.error=false;t.baseURL="";t.template="";t.lang={};t.load_syntax={};t.syntax={};t.loadedFiles=[];t.waiting_loading={};t.scripts_to_load=[];t.sub_scripts_to_load=[];t.syntax_display_name={'basic':'Basic','brainfuck':'Brainfuck','c':'C','coldfusion':'Coldfusion','cpp':'CPP','css':'CSS','html':'HTML','java':'Java','js':'Javascript','pas':'Pascal','perl':'Perl','php':'Php','python':'Python','robotstxt':'Robots txt','ruby':'Ruby','sql':'SQL','tsql':'T-SQL','vb':'Visual Basic','xml':'XML'};t.resize=[];t.hidden={};t.default_settings={debug:false,smooth_selection:true,font_size:"10",font_family:"monospace",start_highlight:false,toolbar:"search,go_to_line,fullscreen,|,undo,redo,|,select_font,|,change_smooth_selection,highlight,reset_highlight,word_wrap,|,help",begin_toolbar:"",end_toolbar:"",is_multi_files:false,allow_resize:"both",show_line_colors:false,min_width:400,min_height:125,replace_tab_by_spaces:false,allow_toggle:true,language:"en",syntax:"",syntax_selection_allow:"basic,brainfuck,c,coldfusion,cpp,css,html,java,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml",display:"onload",max_undo:30,browsers:"known",plugins:"",gecko_spellcheck:false,fullscreen:false,is_editable:true,cursor_position:"begin",word_wrap:false,autocompletion:false,load_callback:"",save_callback:"",change_callback:"",submit_callback:"",EA_init_callback:"",EA_delete_callback:"",EA_load_callback:"",EA_unload_callback:"",EA_toggle_on_callback:"",EA_toggle_off_callback:"",EA_file_switch_on_callback:"",EA_file_switch_off_callback:"",EA_file_close_callback:""};t.advanced_buttons=[ ['new_document','newdocument.gif','new_document',false],['search','search.gif','show_search',false],['go_to_line','go_to_line.gif','go_to_line',false],['undo','undo.gif','undo',true],['redo','redo.gif','redo',true],['change_smooth_selection','smooth_selection.gif','change_smooth_selection_mode',true],['reset_highlight','reset_highlight.gif','resync_highlight',true],['highlight','highlight.gif','change_highlight',true],['help','help.gif','show_help',false],['save','save.gif','save',false],['load','load.gif','load',false],['fullscreen','fullscreen.gif','toggle_full_screen',false],['word_wrap','word_wrap.gif','toggle_word_wrap',true],['autocompletion','autocompletion.gif','toggle_autocompletion',true] ];t.set_browser_infos(t);if(t.isIE>=6||t.isGecko||(t.isWebKit&&!t.isSafari<3)||t.isOpera>=9||t.isCamino)t.isValidBrowser=true;
2
- else t.isValidBrowser=false;t.set_base_url();for(var i=0;i<t.scripts_to_load.length;i++){setTimeout("eAL.load_script('"+t.baseURL+t.scripts_to_load[i]+".js');",1);t.waiting_loading[t.scripts_to_load[i]+".js"]=false;}t.add_event(window,"load",EAL.prototype.window_loaded);};EAL.prototype={has_error:function(){this.error=true;for(var i in EAL.prototype){EAL.prototype[i]=function(){};}},set_browser_infos:function(o){ua=navigator.userAgent;o.isWebKit=/WebKit/.test(ua);o.isGecko=!o.isWebKit&&/Gecko/.test(ua);o.isMac=/Mac/.test(ua);o.isIE=(navigator.appName=="Microsoft Internet Explorer");if(o.isIE){o.isIE=ua.replace(/^.*?MSIE\s+([0-9\.]+).*$/,"$1");if(o.isIE<6)o.has_error();}if(o.isOpera=(ua.indexOf('Opera')!=-1)){o.isOpera=ua.replace(/^.*?Opera.*?([0-9\.]+).*$/i,"$1");if(o.isOpera<9)o.has_error();o.isIE=false;}if(o.isFirefox=(ua.indexOf('Firefox')!=-1))o.isFirefox=ua.replace(/^.*?Firefox.*?([0-9\.]+).*$/i,"$1");if(ua.indexOf('Iceweasel')!=-1)o.isFirefox=ua.replace(/^.*?Iceweasel.*?([0-9\.]+).*$/i,"$1");if(ua.indexOf('GranParadiso')!=-1)o.isFirefox=ua.replace(/^.*?GranParadiso.*?([0-9\.]+).*$/i,"$1");if(ua.indexOf('BonEcho')!=-1)o.isFirefox=ua.replace(/^.*?BonEcho.*?([0-9\.]+).*$/i,"$1");if(ua.indexOf('SeaMonkey')!=-1)o.isFirefox=(ua.replace(/^.*?SeaMonkey.*?([0-9\.]+).*$/i,"$1"))+1;if(o.isCamino=(ua.indexOf('Camino')!=-1))o.isCamino=ua.replace(/^.*?Camino.*?([0-9\.]+).*$/i,"$1");if(o.isSafari=(ua.indexOf('Safari')!=-1))o.isSafari=ua.replace(/^.*?Version\/([0-9]+\.[0-9]+).*$/i,"$1");if(o.isChrome=(ua.indexOf('Chrome')!=-1)){o.isChrome=ua.replace(/^.*?Chrome.*?([0-9\.]+).*$/i,"$1");o.isSafari=false;}},window_loaded:function(){eAL.win="loaded";if(document.forms){for(var i=0;i<document.forms.length;i++){var form=document.forms[i];form.edit_area_replaced_submit=null;try{form.edit_area_replaced_submit=form.onsubmit;form.onsubmit="";}catch(e){}eAL.add_event(form,"submit",EAL.prototype.submit);eAL.add_event(form,"reset",EAL.prototype.reset);}}eAL.add_event(window,"unload",function(){for(var i in eAs){eAL.delete_instance(i);}});},init_ie_textarea:function(id){var a=document.getElementById(id);try{if(a&&typeof(a.focused)=="undefined"){a.focus();a.focused=true;a.selectionStart=a.selectionEnd=0;get_IE_selection(a);eAL.add_event(a,"focus",IE_textarea_focus);eAL.add_event(a,"blur",IE_textarea_blur);}}catch(ex){}},init:function(settings){var t=this,s=settings,i;if(!s["id"])t.has_error();if(t.error)return;if(eAs[s["id"]])t.delete_instance(s["id"]);for(i in t.default_settings){if(typeof(s[i])=="undefined")s[i]=t.default_settings[i];}if(s["browsers"]=="known"&&t.isValidBrowser==false){return;}if(s["begin_toolbar"].length>0)s["toolbar"]=s["begin_toolbar"]+","+s["toolbar"];if(s["end_toolbar"].length>0)s["toolbar"]=s["toolbar"]+","+s["end_toolbar"];s["tab_toolbar"]=s["toolbar"].replace(/ /g,"").split(",");s["plugins"]=s["plugins"].replace(/ /g,"").split(",");for(i=0;i<s["plugins"].length;i++){if(s["plugins"][i].length==0)s["plugins"].splice(i,1);}t.get_template();t.load_script(t.baseURL+"langs/"+s["language"]+".js");if(s["syntax"].length>0){s["syntax"]=s["syntax"].toLowerCase();t.load_script(t.baseURL+"reg_syntax/"+s["syntax"]+".js");}eAs[s["id"]]={"settings":s};eAs[s["id"]]["displayed"]=false;eAs[s["id"]]["hidden"]=false;t.start(s["id"]);},delete_instance:function(id){var d=document,fs=window.frames,span,iframe;eAL.execCommand(id,"EA_delete");if(fs["frame_"+id]&&fs["frame_"+id].editArea){if(eAs[id]["displayed"])eAL.toggle(id,"off");fs["frame_"+id].editArea.execCommand("EA_unload");}span=d.getElementById("EditAreaArroundInfos_"+id);if(span)span.parentNode.removeChild(span);iframe=d.getElementById("frame_"+id);if(iframe){iframe.parentNode.removeChild(iframe);try{delete fs["frame_"+id];}catch(e){}}delete eAs[id];},start:function(id){var t=this,d=document,f,span,father,next,html='',html_toolbar_content='',template,content,i;if(t.win!="loaded"){setTimeout("eAL.start('"+id+"');",50);return;}for(i in t.waiting_loading){if(t.waiting_loading[i]!="loaded"&&typeof(t.waiting_loading[i])!="function"){setTimeout("eAL.start('"+id+"');",50);return;}}if(!t.lang[eAs[id]["settings"]["language"]]||(eAs[id]["settings"]["syntax"].length>0&&!t.load_syntax[eAs[id]["settings"]["syntax"]])){setTimeout("eAL.start('"+id+"');",50);return;}if(eAs[id]["settings"]["syntax"].length>0)t.init_syntax_regexp();if(!d.getElementById("EditAreaArroundInfos_"+id)&&(eAs[id]["settings"]["debug"]||eAs[id]["settings"]["allow_toggle"])){span=d.createElement("span");span.id="EditAreaArroundInfos_"+id;if(eAs[id]["settings"]["allow_toggle"]){checked=(eAs[id]["settings"]["display"]=="onload")?"checked='checked'":"";html+="<div id='edit_area_toggle_"+i+"'>";html+="<input id='edit_area_toggle_checkbox_"+id+"' class='toggle_"+id+"' type='checkbox' onclick='eAL.toggle(\""+id+"\");' accesskey='e' "+checked+" />";html+="<label for='edit_area_toggle_checkbox_"+id+"'>{$toggle}</label></div>";}if(eAs[id]["settings"]["debug"])html+="<textarea id='edit_area_debug_"+id+"' spellcheck='off' style='z-index:20;width:100%;height:120px;overflow:auto;border:solid black 1px;'></textarea><br />";html=t.translate(html,eAs[id]["settings"]["language"]);span.innerHTML=html;father=d.getElementById(id).parentNode;next=d.getElementById(id).nextSibling;if(next==null)father.appendChild(span);
3
- else father.insertBefore(span,next);}if(!eAs[id]["initialized"]){t.execCommand(id,"EA_init");if(eAs[id]["settings"]["display"]=="later"){eAs[id]["initialized"]=true;return;}}if(t.isIE){t.init_ie_textarea(id);}var area=eAs[id];for(i=0;i<area["settings"]["tab_toolbar"].length;i++){html_toolbar_content+=t.get_control_html(area["settings"]["tab_toolbar"][i],area["settings"]["language"]);}html_toolbar_content=t.translate(html_toolbar_content,area["settings"]["language"],"template");if(!t.iframe_script){t.iframe_script="";for(i=0;i<t.sub_scripts_to_load.length;i++)t.iframe_script+='<script language="javascript" type="text/javascript" src="'+t.baseURL+t.sub_scripts_to_load[i]+'.js"></script>';}for(i=0;i<area["settings"]["plugins"].length;i++){if(!t.all_plugins_loaded)t.iframe_script+='<script language="javascript" type="text/javascript" src="'+t.baseURL+'plugins/'+area["settings"]["plugins"][i]+'/'+area["settings"]["plugins"][i]+'.js"></script>';t.iframe_script+='<script language="javascript" type="text/javascript" src="'+t.baseURL+'plugins/'+area["settings"]["plugins"][i]+'/langs/'+area["settings"]["language"]+'.js"></script>';}if(!t.iframe_css){t.iframe_css="<link href='"+t.baseURL+"edit_area.css' rel='stylesheet' type='text/css' />";}template=t.template.replace(/\[__BASEURL__\]/g,t.baseURL);template=template.replace("[__TOOLBAR__]",html_toolbar_content);template=t.translate(template,area["settings"]["language"],"template");template=template.replace("[__CSSRULES__]",t.iframe_css);template=template.replace("[__JSCODE__]",t.iframe_script);template=template.replace("[__EA_VERSION__]",t.version);area.textarea=d.getElementById(area["settings"]["id"]);eAs[area["settings"]["id"]]["textarea"]=area.textarea;if(typeof(window.frames["frame_"+area["settings"]["id"]])!='undefined')delete window.frames["frame_"+area["settings"]["id"]];father=area.textarea.parentNode;content=d.createElement("iframe");content.name="frame_"+area["settings"]["id"];content.id="frame_"+area["settings"]["id"];content.style.borderWidth="0px";setAttribute(content,"frameBorder","0");content.style.overflow="hidden";content.style.display="none";next=area.textarea.nextSibling;if(next==null)father.appendChild(content);
4
- else father.insertBefore(content,next);f=window.frames["frame_"+area["settings"]["id"]];f.document.open();f.eAs=eAs;f.area_id=area["settings"]["id"];f.document.area_id=area["settings"]["id"];f.document.write(template);f.document.close();},toggle:function(id,toggle_to){if(!toggle_to)toggle_to=(eAs[id]["displayed"]==true)?"off":"on";if(eAs[id]["displayed"]==true&&toggle_to=="off"){this.toggle_off(id);}
5
- else if(eAs[id]["displayed"]==false&&toggle_to=="on"){this.toggle_on(id);}return false;},toggle_off:function(id){var fs=window.frames,f,t,parNod,nxtSib,selStart,selEnd,scrollTop,scrollLeft;if(fs["frame_"+id]){f=fs["frame_"+id];t=eAs[id]["textarea"];if(f.editArea.fullscreen['isFull'])f.editArea.toggle_full_screen(false);eAs[id]["displayed"]=false;t.wrap="off";setAttribute(t,"wrap","off");parNod=t.parentNode;nxtSib=t.nextSibling;parNod.removeChild(t);parNod.insertBefore(t,nxtSib);t.value=f.editArea.textarea.value;selStart=f.editArea.last_selection["selectionStart"];selEnd=f.editArea.last_selection["selectionEnd"];scrollTop=f.document.getElementById("result").scrollTop;scrollLeft=f.document.getElementById("result").scrollLeft;document.getElementById("frame_"+id).style.display='none';t.style.display="inline";try{t.focus();}catch(e){};if(this.isIE){t.selectionStart=selStart;t.selectionEnd=selEnd;t.focused=true;set_IE_selection(t);}
6
- else{if(this.isOpera&&this.isOpera < 9.6){t.setSelectionRange(0,0);}try{t.setSelectionRange(selStart,selEnd);}catch(e){};}t.scrollTop=scrollTop;t.scrollLeft=scrollLeft;f.editArea.execCommand("toggle_off");}},toggle_on:function(id){var fs=window.frames,f,t,selStart=0,selEnd=0,scrollTop=0,scrollLeft=0,curPos,elem;if(fs["frame_"+id]){f=fs["frame_"+id];t=eAs[id]["textarea"];area=f.editArea;area.textarea.value=t.value;curPos=eAs[id]["settings"]["cursor_position"];if(t.use_last==true){selStart=t.last_selectionStart;selEnd=t.last_selectionEnd;scrollTop=t.last_scrollTop;scrollLeft=t.last_scrollLeft;t.use_last=false;}
7
- else if(curPos=="auto"){try{selStart=t.selectionStart;selEnd=t.selectionEnd;scrollTop=t.scrollTop;scrollLeft=t.scrollLeft;}catch(ex){}}this.set_editarea_size_from_textarea(id,document.getElementById("frame_"+id));t.style.display="none";document.getElementById("frame_"+id).style.display="inline";area.execCommand("focus");eAs[id]["displayed"]=true;area.execCommand("update_size");f.document.getElementById("result").scrollTop=scrollTop;f.document.getElementById("result").scrollLeft=scrollLeft;area.area_select(selStart,selEnd-selStart);area.execCommand("toggle_on");}
8
- else{elem=document.getElementById(id);elem.last_selectionStart=elem.selectionStart;elem.last_selectionEnd=elem.selectionEnd;elem.last_scrollTop=elem.scrollTop;elem.last_scrollLeft=elem.scrollLeft;elem.use_last=true;eAL.start(id);}},set_editarea_size_from_textarea:function(id,frame){var elem,width,height;elem=document.getElementById(id);width=Math.max(eAs[id]["settings"]["min_width"],elem.offsetWidth)+"px";height=Math.max(eAs[id]["settings"]["min_height"],elem.offsetHeight)+"px";if(elem.style.width.indexOf("%")!=-1)width=elem.style.width;if(elem.style.height.indexOf("%")!=-1)height=elem.style.height;frame.style.width=width;frame.style.height=height;},set_base_url:function(){var t=this,elems,i,docBasePath;if(!this.baseURL){elems=document.getElementsByTagName('script');for(i=0;i<elems.length;i++){if(elems[i].src&&elems[i].src.match(/edit_area_[^\\\/]*$/i)){var src=unescape(elems[i].src);src=src.substring(0,src.lastIndexOf('/'));this.baseURL=src;this.file_name=elems[i].src.substr(elems[i].src.lastIndexOf("/")+1);break;}}}docBasePath=document.location.href;if(docBasePath.indexOf('?')!=-1)docBasePath=docBasePath.substring(0,docBasePath.indexOf('?'));docBasePath=docBasePath.substring(0,docBasePath.lastIndexOf('/'));if(t.baseURL.indexOf('://')==-1&&t.baseURL.charAt(0)!='/'){t.baseURL=docBasePath+"/"+t.baseURL;}t.baseURL+="/";},get_button_html:function(id,img,exec,isFileSpecific,baseURL){var cmd,html;if(!baseURL)baseURL=this.baseURL;cmd='editArea.execCommand(\''+exec+'\')';html='<a id="a_'+id+'" href="javascript:'+cmd+'" onclick="'+cmd+';return false;" onmousedown="return false;" target="_self" fileSpecific="'+(isFileSpecific?'yes':'no')+'">';html+='<img id="'+id+'" src="'+baseURL+'images/'+img+'" title="{$'+id+'}" width="20" height="20" class="editAreaButtonNormal" onmouseover="editArea.switchClass(this,\'editAreaButtonOver\');" onmouseout="editArea.restoreClass(this);" onmousedown="editArea.restoreAndSwitchClass(this,\'editAreaButtonDown\');" /></a>';return html;},get_control_html:function(button_name,lang){var t=this,i,but,html,si;for(i=0;i<t.advanced_buttons.length;i++){but=t.advanced_buttons[i];if(but[0]==button_name){return t.get_button_html(but[0],but[1],but[2],but[3]);}}switch(button_name){case "*":case "return":return "<br />";case "|":case "separator":return '<img src="'+t.baseURL+'images/spacer.gif" width="1" height="15" class="editAreaSeparatorLine">';case "select_font":html="<select id='area_font_size' onchange='javascript:editArea.execCommand(\"change_font_size\")' fileSpecific='yes'>";html+="<option value='-1'>{$font_size}</option>";si=[8,9,10,11,12,14];for(i=0;i<si.length;i++){html+="<option value='"+si[i]+"'>"+si[i]+" pt</option>";}html+="</select>";return html;case "syntax_selection":html="<select id='syntax_selection' onchange='javascript:editArea.execCommand(\"change_syntax\",this.value)' fileSpecific='yes'>";html+="<option value='-1'>{$syntax_selection}</option>";html+="</select>";return html;}return "<span id='tmp_tool_"+button_name+"'>["+button_name+"]</span>";},get_template:function(){if(this.template==""){var xhr_object=null;if(window.XMLHttpRequest)xhr_object=new XMLHttpRequest();
9
- else if(window.ActiveXObject)xhr_object=new ActiveXObject("Microsoft.XMLHTTP");
10
- else{alert("XMLHTTPRequest not supported. EditArea not loaded");return;}xhr_object.open("GET",this.baseURL+"template.html",false);xhr_object.send(null);if(xhr_object.readyState==4)this.template=xhr_object.responseText;
11
- else this.has_error();}},translate:function(text,lang,mode){if(mode=="word")text=eAL.get_word_translation(text,lang);
12
- else if(mode="template"){eAL.current_language=lang;text=text.replace(/\{\$([^\}]+)\}/gm,eAL.translate_template);}return text;},translate_template:function(){return eAL.get_word_translation(EAL.prototype.translate_template.arguments[1],eAL.current_language);},get_word_translation:function(val,lang){var i;for(i in eAL.lang[lang]){if(i==val)return eAL.lang[lang][i];}return "_"+val;},load_script:function(url){var t=this,d=document,script,head;if(t.loadedFiles[url])return;try{script=d.createElement("script");script.type="text/javascript";script.src=url;script.charset="UTF-8";d.getElementsByTagName("head")[0].appendChild(script);}catch(e){d.write('<sc'+'ript language="javascript" type="text/javascript" src="'+url+'" charset="UTF-8"></sc'+'ript>');}t.loadedFiles[url]=true;},add_event:function(obj,name,handler){try{if(obj.attachEvent){obj.attachEvent("on"+name,handler);}
13
- else{obj.addEventListener(name,handler,false);}}catch(e){}},remove_event:function(obj,name,handler){try{if(obj.detachEvent)obj.detachEvent("on"+name,handler);
14
- else obj.removeEventListener(name,handler,false);}catch(e){}},reset:function(e){var formObj,is_child,i,x;formObj=eAL.isIE ? window.event.srcElement:e.target;if(formObj.tagName!='FORM')formObj=formObj.form;for(i in eAs){is_child=false;for(x=0;x<formObj.elements.length;x++){if(formObj.elements[x].id==i)is_child=true;}if(window.frames["frame_"+i]&&is_child&&eAs[i]["displayed"]==true){var exec='window.frames["frame_'+i+'"].editArea.textarea.value=document.getElementById("'+i+'").value;';exec+='window.frames["frame_'+i+'"].editArea.execCommand("focus");';exec+='window.frames["frame_'+i+'"].editArea.check_line_selection();';exec+='window.frames["frame_'+i+'"].editArea.execCommand("reset");';window.setTimeout(exec,10);}}return;},submit:function(e){var formObj,is_child,fs=window.frames,i,x;formObj=eAL.isIE ? window.event.srcElement:e.target;if(formObj.tagName!='FORM')formObj=formObj.form;for(i in eAs){is_child=false;for(x=0;x<formObj.elements.length;x++){if(formObj.elements[x].id==i)is_child=true;}if(is_child){if(fs["frame_"+i]&&eAs[i]["displayed"]==true)document.getElementById(i).value=fs["frame_"+i].editArea.textarea.value;eAL.execCommand(i,"EA_submit");}}if(typeof(formObj.edit_area_replaced_submit)=="function"){res=formObj.edit_area_replaced_submit();if(res==false){if(eAL.isIE)return false;
15
- else e.preventDefault();}}return;},getValue:function(id){if(window.frames["frame_"+id]&&eAs[id]["displayed"]==true){return window.frames["frame_"+id].editArea.textarea.value;}
16
- else if(elem=document.getElementById(id)){return elem.value;}return false;},setValue:function(id,new_val){var fs=window.frames;if((f=fs["frame_"+id])&&eAs[id]["displayed"]==true){f.editArea.textarea.value=new_val;f.editArea.execCommand("focus");f.editArea.check_line_selection(false);f.editArea.execCommand("onchange");}
17
- else if(elem=document.getElementById(id)){elem.value=new_val;}},getSelectionRange:function(id){var sel,eA,fs=window.frames;sel={"start":0,"end":0};if(fs["frame_"+id]&&eAs[id]["displayed"]==true){eA=fs["frame_"+id].editArea;sel["start"]=eA.textarea.selectionStart;sel["end"]=eA.textarea.selectionEnd;}
18
- else if(elem=document.getElementById(id)){sel=getSelectionRange(elem);}return sel;},setSelectionRange:function(id,new_start,new_end){var fs=window.frames;if(fs["frame_"+id]&&eAs[id]["displayed"]==true){fs["frame_"+id].editArea.area_select(new_start,new_end-new_start);if(!this.isIE){fs["frame_"+id].editArea.check_line_selection(false);fs["frame_"+id].editArea.scroll_to_view();}}
19
- else if(elem=document.getElementById(id)){setSelectionRange(elem,new_start,new_end);}},getSelectedText:function(id){var sel=this.getSelectionRange(id);return this.getValue(id).substring(sel["start"],sel["end"]);},setSelectedText:function(id,new_val){var fs=window.frames,d=document,sel,text,scrollTop,scrollLeft,new_sel_end;new_val=new_val.replace(/\r/g,"");sel=this.getSelectionRange(id);text=this.getValue(id);if(fs["frame_"+id]&&eAs[id]["displayed"]==true){scrollTop=fs["frame_"+id].document.getElementById("result").scrollTop;scrollLeft=fs["frame_"+id].document.getElementById("result").scrollLeft;}
20
- else{scrollTop=d.getElementById(id).scrollTop;scrollLeft=d.getElementById(id).scrollLeft;}text=text.substring(0,sel["start"])+new_val+text.substring(sel["end"]);this.setValue(id,text);new_sel_end=sel["start"]+new_val.length;this.setSelectionRange(id,sel["start"],new_sel_end);if(new_val !=this.getSelectedText(id).replace(/\r/g,"")){this.setSelectionRange(id,sel["start"],new_sel_end+new_val.split("\n").length-1);}if(fs["frame_"+id]&&eAs[id]["displayed"]==true){fs["frame_"+id].document.getElementById("result").scrollTop=scrollTop;fs["frame_"+id].document.getElementById("result").scrollLeft=scrollLeft;fs["frame_"+id].editArea.execCommand("onchange");}
21
- else{d.getElementById(id).scrollTop=scrollTop;d.getElementById(id).scrollLeft=scrollLeft;}},insertTags:function(id,open_tag,close_tag){var old_sel,new_sel;old_sel=this.getSelectionRange(id);text=open_tag+this.getSelectedText(id)+close_tag;eAL.setSelectedText(id,text);new_sel=this.getSelectionRange(id);if(old_sel["end"] > old_sel["start"])this.setSelectionRange(id,new_sel["end"],new_sel["end"]);
22
- else this.setSelectionRange(id,old_sel["start"]+open_tag.length,old_sel["start"]+open_tag.length);},hide:function(id){var fs=window.frames,d=document,t=this,scrollTop,scrollLeft,span;if(d.getElementById(id)&&!t.hidden[id]){t.hidden[id]={};t.hidden[id]["selectionRange"]=t.getSelectionRange(id);if(d.getElementById(id).style.display!="none"){t.hidden[id]["scrollTop"]=d.getElementById(id).scrollTop;t.hidden[id]["scrollLeft"]=d.getElementById(id).scrollLeft;}if(fs["frame_"+id]){t.hidden[id]["toggle"]=eAs[id]["displayed"];if(fs["frame_"+id]&&eAs[id]["displayed"]==true){scrollTop=fs["frame_"+id].document.getElementById("result").scrollTop;scrollLeft=fs["frame_"+id].document.getElementById("result").scrollLeft;}
23
- else{scrollTop=d.getElementById(id).scrollTop;scrollLeft=d.getElementById(id).scrollLeft;}t.hidden[id]["scrollTop"]=scrollTop;t.hidden[id]["scrollLeft"]=scrollLeft;if(eAs[id]["displayed"]==true)eAL.toggle_off(id);}span=d.getElementById("EditAreaArroundInfos_"+id);if(span){span.style.display='none';}d.getElementById(id).style.display="none";}},show:function(id){var fs=window.frames,d=document,t=this,span;if((elem=d.getElementById(id))&&t.hidden[id]){elem.style.display="inline";elem.scrollTop=t.hidden[id]["scrollTop"];elem.scrollLeft=t.hidden[id]["scrollLeft"];span=d.getElementById("EditAreaArroundInfos_"+id);if(span){span.style.display='inline';}if(fs["frame_"+id]){elem.style.display="inline";if(t.hidden[id]["toggle"]==true)eAL.toggle_on(id);scrollTop=t.hidden[id]["scrollTop"];scrollLeft=t.hidden[id]["scrollLeft"];if(fs["frame_"+id]&&eAs[id]["displayed"]==true){fs["frame_"+id].document.getElementById("result").scrollTop=scrollTop;fs["frame_"+id].document.getElementById("result").scrollLeft=scrollLeft;}
24
- else{elem.scrollTop=scrollTop;elem.scrollLeft=scrollLeft;}}sel=t.hidden[id]["selectionRange"];t.setSelectionRange(id,sel["start"],sel["end"]);delete t.hidden[id];}},getCurrentFile:function(id){return this.execCommand(id,'get_file',this.execCommand(id,'curr_file'));},getFile:function(id,file_id){return this.execCommand(id,'get_file',file_id);},getAllFiles:function(id){return this.execCommand(id,'get_all_files()');},openFile:function(id,file_infos){return this.execCommand(id,'open_file',file_infos);},closeFile:function(id,file_id){return this.execCommand(id,'close_file',file_id);},setFileEditedMode:function(id,file_id,to){var reg1,reg2;reg1=new RegExp('\\\\','g');reg2=new RegExp('"','g');return this.execCommand(id,'set_file_edited_mode("'+file_id.replace(reg1,'\\\\').replace(reg2,'\\"')+'",'+to+')');},execCommand:function(id,cmd,fct_param){switch(cmd){case "EA_init":if(eAs[id]['settings']["EA_init_callback"].length>0)eval(eAs[id]['settings']["EA_init_callback"]+"('"+id+"');");break;case "EA_delete":if(eAs[id]['settings']["EA_delete_callback"].length>0)eval(eAs[id]['settings']["EA_delete_callback"]+"('"+id+"');");break;case "EA_submit":if(eAs[id]['settings']["submit_callback"].length>0)eval(eAs[id]['settings']["submit_callback"]+"('"+id+"');");break;}if(window.frames["frame_"+id]&&window.frames["frame_"+id].editArea){if(fct_param!=undefined)return eval('window.frames["frame_'+id+'"].editArea.'+cmd+'(fct_param);');
25
- else return eval('window.frames["frame_'+id+'"].editArea.'+cmd+';');}return false;}};var eAL=new EAL();var eAs={}; function getAttribute(elm,aName){var aValue,taName,i;try{aValue=elm.getAttribute(aName);}catch(exept){}if(! aValue){for(i=0;i < elm.attributes.length;i++){taName=elm.attributes[i] .name.toLowerCase();if(taName==aName){aValue=elm.attributes[i] .value;return aValue;}}}return aValue;};function setAttribute(elm,attr,val){if(attr=="class"){elm.setAttribute("className",val);elm.setAttribute("class",val);}
26
- else{elm.setAttribute(attr,val);}};function getChildren(elem,elem_type,elem_attribute,elem_attribute_match,option,depth){if(!option)var option="single";if(!depth)var depth=-1;if(elem){var children=elem.childNodes;var result=null;var results=[];for(var x=0;x<children.length;x++){strTagName=new String(children[x].tagName);children_class="?";if(strTagName!="undefined"){child_attribute=getAttribute(children[x],elem_attribute);if((strTagName.toLowerCase()==elem_type.toLowerCase()||elem_type=="")&&(elem_attribute==""||child_attribute==elem_attribute_match)){if(option=="all"){results.push(children[x]);}
27
- else{return children[x];}}if(depth!=0){result=getChildren(children[x],elem_type,elem_attribute,elem_attribute_match,option,depth-1);if(option=="all"){if(result.length>0){results=results.concat(result);}}
28
- else if(result!=null){return result;}}}}if(option=="all")return results;}return null;};function isChildOf(elem,parent){if(elem){if(elem==parent)return true;while(elem.parentNode !='undefined'){return isChildOf(elem.parentNode,parent);}}return false;};function getMouseX(e){if(e!=null&&typeof(e.pageX)!="undefined"){return e.pageX;}
29
- else{return(e!=null?e.x:event.x)+document.documentElement.scrollLeft;}};function getMouseY(e){if(e!=null&&typeof(e.pageY)!="undefined"){return e.pageY;}
30
- else{return(e!=null?e.y:event.y)+document.documentElement.scrollTop;}};function calculeOffsetLeft(r){return calculeOffset(r,"offsetLeft")};function calculeOffsetTop(r){return calculeOffset(r,"offsetTop")};function calculeOffset(element,attr){var offset=0;while(element){offset+=element[attr];element=element.offsetParent}return offset;};function get_css_property(elem,prop){if(document.defaultView){return document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop);}
31
- else if(elem.currentStyle){var prop=prop.replace(/-\D/gi,function(sMatch){return sMatch.charAt(sMatch.length-1).toUpperCase();});return elem.currentStyle[prop];}
32
- else return null;}var _mCE;function start_move_element(e,id,frame){var elem_id=(e.target||e.srcElement).id;if(id)elem_id=id;if(!frame)frame=window;if(frame.event)e=frame.event;_mCE=frame.document.getElementById(elem_id);_mCE.frame=frame;frame.document.onmousemove=move_element;frame.document.onmouseup=end_move_element;mouse_x=getMouseX(e);mouse_y=getMouseY(e);_mCE.start_pos_x=mouse_x-(_mCE.style.left.replace("px","")||calculeOffsetLeft(_mCE));_mCE.start_pos_y=mouse_y-(_mCE.style.top.replace("px","")||calculeOffsetTop(_mCE));return false;};function end_move_element(e){_mCE.frame.document.onmousemove="";_mCE.frame.document.onmouseup="";_mCE=null;};function move_element(e){var newTop,newLeft,maxLeft;if(_mCE.frame&&_mCE.frame.event)e=_mCE.frame.event;newTop=getMouseY(e)-_mCE.start_pos_y;newLeft=getMouseX(e)-_mCE.start_pos_x;maxLeft=_mCE.frame.document.body.offsetWidth-_mCE.offsetWidth;max_top=_mCE.frame.document.body.offsetHeight-_mCE.offsetHeight;newTop=Math.min(Math.max(0,newTop),max_top);newLeft=Math.min(Math.max(0,newLeft),maxLeft);_mCE.style.top=newTop+"px";_mCE.style.left=newLeft+"px";return false;};var nav=eAL.nav;function getSelectionRange(textarea){return{"start":textarea.selectionStart,"end":textarea.selectionEnd};};function setSelectionRange(t,start,end){t.focus();start=Math.max(0,Math.min(t.value.length,start));end=Math.max(start,Math.min(t.value.length,end));if(nav.isOpera&&nav.isOpera < 9.6){t.selectionEnd=1;t.selectionStart=0;t.selectionEnd=1;t.selectionStart=0;}t.selectionStart=start;t.selectionEnd=end;if(nav.isIE)set_IE_selection(t);};function get_IE_selection(t){var d=document,div,range,stored_range,elem,scrollTop,relative_top,line_start,line_nb,range_start,range_end,tab;if(t&&t.focused){if(!t.ea_line_height){div=d.createElement("div");div.style.fontFamily=get_css_property(t,"font-family");div.style.fontSize=get_css_property(t,"font-size");div.style.visibility="hidden";div.innerHTML="0";d.body.appendChild(div);t.ea_line_height=div.offsetHeight;d.body.removeChild(div);}range=d.selection.createRange();try{stored_range=range.duplicate();stored_range.moveToElementText(t);stored_range.setEndPoint('EndToEnd',range);if(stored_range.parentElement()==t){elem=t;scrollTop=0;while(elem.parentNode){scrollTop+=elem.scrollTop;elem=elem.parentNode;}relative_top=range.offsetTop-calculeOffsetTop(t)+scrollTop;line_start=Math.round((relative_top / t.ea_line_height)+1);line_nb=Math.round(range.boundingHeight / t.ea_line_height);range_start=stored_range.text.length-range.text.length;tab=t.value.substr(0,range_start).split("\n");range_start+=(line_start-tab.length)*2;t.selectionStart=range_start;range_end=t.selectionStart+range.text.length;tab=t.value.substr(0,range_start+range.text.length).split("\n");range_end+=(line_start+line_nb-1-tab.length)*2;t.selectionEnd=range_end;}}catch(e){}}if(t&&t.id){setTimeout("get_IE_selection(document.getElementById('"+t.id+"'));",50);}};function IE_textarea_focus(){event.srcElement.focused=true;}function IE_textarea_blur(){event.srcElement.focused=false;}function set_IE_selection(t){var nbLineStart,nbLineStart,nbLineEnd,range;if(!window.closed){nbLineStart=t.value.substr(0,t.selectionStart).split("\n").length-1;nbLineEnd=t.value.substr(0,t.selectionEnd).split("\n").length-1;try{range=document.selection.createRange();range.moveToElementText(t);range.setEndPoint('EndToStart',range);range.moveStart('character',t.selectionStart-nbLineStart);range.moveEnd('character',t.selectionEnd-nbLineEnd-(t.selectionStart-nbLineStart));range.select();}catch(e){}}};eAL.waiting_loading["elements_functions.js"]="loaded";
33
- EAL.prototype.start_resize_area=function(){var d=document,a,div,width,height,father;d.onmouseup=eAL.end_resize_area;d.onmousemove=eAL.resize_area;eAL.toggle(eAL.resize["id"]);a=eAs[eAL.resize["id"]]["textarea"];div=d.getElementById("edit_area_resize");if(!div){div=d.createElement("div");div.id="edit_area_resize";div.style.border="dashed #888888 1px";}width=a.offsetWidth-2;height=a.offsetHeight-2;div.style.display="block";div.style.width=width+"px";div.style.height=height+"px";father=a.parentNode;father.insertBefore(div,a);a.style.display="none";eAL.resize["start_top"]=calculeOffsetTop(div);eAL.resize["start_left"]=calculeOffsetLeft(div);};EAL.prototype.end_resize_area=function(e){var d=document,div,a,width,height;d.onmouseup="";d.onmousemove="";div=d.getElementById("edit_area_resize");a=eAs[eAL.resize["id"]]["textarea"];width=Math.max(eAs[eAL.resize["id"]]["settings"]["min_width"],div.offsetWidth-4);height=Math.max(eAs[eAL.resize["id"]]["settings"]["min_height"],div.offsetHeight-4);if(eAL.isIE==6){width-=2;height-=2;}a.style.width=width+"px";a.style.height=height+"px";div.style.display="none";a.style.display="inline";a.selectionStart=eAL.resize["selectionStart"];a.selectionEnd=eAL.resize["selectionEnd"];eAL.toggle(eAL.resize["id"]);return false;};EAL.prototype.resize_area=function(e){var allow,newHeight,newWidth;allow=eAs[eAL.resize["id"]]["settings"]["allow_resize"];if(allow=="both"||allow=="y"){newHeight=Math.max(20,getMouseY(e)-eAL.resize["start_top"]);document.getElementById("edit_area_resize").style.height=newHeight+"px";}if(allow=="both"||allow=="x"){newWidth=Math.max(20,getMouseX(e)-eAL.resize["start_left"]);document.getElementById("edit_area_resize").style.width=newWidth+"px";}return false;};eAL.waiting_loading["resize_area.js"]="loaded";
34
- EAL.prototype.get_regexp=function(text_array){res="(\\b)(";for(i=0;i<text_array.length;i++){if(i>0)res+="|";res+=this.get_escaped_regexp(text_array[i]);}res+=")(\\b)";reg=new RegExp(res);return res;};EAL.prototype.get_escaped_regexp=function(str){return str.toString().replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g,"\\$1");};EAL.prototype.init_syntax_regexp=function(){var lang_style={};for(var lang in this.load_syntax){if(!this.syntax[lang]){this.syntax[lang]={};this.syntax[lang]["keywords_reg_exp"]={};this.keywords_reg_exp_nb=0;if(this.load_syntax[lang]['KEYWORDS']){param="g";if(this.load_syntax[lang]['KEYWORD_CASE_SENSITIVE']===false)param+="i";for(var i in this.load_syntax[lang]['KEYWORDS']){if(typeof(this.load_syntax[lang]['KEYWORDS'][i])=="function")continue;this.syntax[lang]["keywords_reg_exp"][i]=new RegExp(this.get_regexp(this.load_syntax[lang]['KEYWORDS'][i]),param);this.keywords_reg_exp_nb++;}}if(this.load_syntax[lang]['OPERATORS']){var str="";var nb=0;for(var i in this.load_syntax[lang]['OPERATORS']){if(typeof(this.load_syntax[lang]['OPERATORS'][i])=="function")continue;if(nb>0)str+="|";str+=this.get_escaped_regexp(this.load_syntax[lang]['OPERATORS'][i]);nb++;}if(str.length>0)this.syntax[lang]["operators_reg_exp"]=new RegExp("("+str+")","g");}if(this.load_syntax[lang]['DELIMITERS']){var str="";var nb=0;for(var i in this.load_syntax[lang]['DELIMITERS']){if(typeof(this.load_syntax[lang]['DELIMITERS'][i])=="function")continue;if(nb>0)str+="|";str+=this.get_escaped_regexp(this.load_syntax[lang]['DELIMITERS'][i]);nb++;}if(str.length>0)this.syntax[lang]["delimiters_reg_exp"]=new RegExp("("+str+")","g");}var syntax_trace=[];this.syntax[lang]["quotes"]={};var quote_tab=[];if(this.load_syntax[lang]['QUOTEMARKS']){for(var i in this.load_syntax[lang]['QUOTEMARKS']){if(typeof(this.load_syntax[lang]['QUOTEMARKS'][i])=="function")continue;var x=this.get_escaped_regexp(this.load_syntax[lang]['QUOTEMARKS'][i]);this.syntax[lang]["quotes"][x]=x;quote_tab[quote_tab.length]="("+x+"(\\\\.|[^"+x+"])*(?:"+x+"|$))";syntax_trace.push(x);}}this.syntax[lang]["comments"]={};if(this.load_syntax[lang]['COMMENT_SINGLE']){for(var i in this.load_syntax[lang]['COMMENT_SINGLE']){if(typeof(this.load_syntax[lang]['COMMENT_SINGLE'][i])=="function")continue;var x=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_SINGLE'][i]);quote_tab[quote_tab.length]="("+x+"(.|\\r|\\t)*(\\n|$))";syntax_trace.push(x);this.syntax[lang]["comments"][x]="\n";}}if(this.load_syntax[lang]['COMMENT_MULTI']){for(var i in this.load_syntax[lang]['COMMENT_MULTI']){if(typeof(this.load_syntax[lang]['COMMENT_MULTI'][i])=="function")continue;var start=this.get_escaped_regexp(i);var end=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_MULTI'][i]);quote_tab[quote_tab.length]="("+start+"(.|\\n|\\r)*?("+end+"|$))";syntax_trace.push(start);syntax_trace.push(end);this.syntax[lang]["comments"][i]=this.load_syntax[lang]['COMMENT_MULTI'][i];}}if(quote_tab.length>0)this.syntax[lang]["comment_or_quote_reg_exp"]=new RegExp("("+quote_tab.join("|")+")","gi");if(syntax_trace.length>0)this.syntax[lang]["syntax_trace_regexp"]=new RegExp("((.|\n)*?)(\\\\*("+syntax_trace.join("|")+"|$))","gmi");if(this.load_syntax[lang]['SCRIPT_DELIMITERS']){this.syntax[lang]["script_delimiters"]={};for(var i in this.load_syntax[lang]['SCRIPT_DELIMITERS']){if(typeof(this.load_syntax[lang]['SCRIPT_DELIMITERS'][i])=="function")continue;this.syntax[lang]["script_delimiters"][i]=this.load_syntax[lang]['SCRIPT_DELIMITERS'];}}this.syntax[lang]["custom_regexp"]={};if(this.load_syntax[lang]['REGEXPS']){for(var i in this.load_syntax[lang]['REGEXPS']){if(typeof(this.load_syntax[lang]['REGEXPS'][i])=="function")continue;var val=this.load_syntax[lang]['REGEXPS'][i];if(!this.syntax[lang]["custom_regexp"][val['execute']])this.syntax[lang]["custom_regexp"][val['execute']]={};this.syntax[lang]["custom_regexp"][val['execute']][i]={'regexp':new RegExp(val['search'],val['modifiers']),'class':val['class']};}}if(this.load_syntax[lang]['STYLES']){lang_style[lang]={};for(var i in this.load_syntax[lang]['STYLES']){if(typeof(this.load_syntax[lang]['STYLES'][i])=="function")continue;if(typeof(this.load_syntax[lang]['STYLES'][i])!="string"){for(var j in this.load_syntax[lang]['STYLES'][i]){lang_style[lang][j]=this.load_syntax[lang]['STYLES'][i][j];}}
35
- else{lang_style[lang][i]=this.load_syntax[lang]['STYLES'][i];}}}var style="";for(var i in lang_style[lang]){if(lang_style[lang][i].length>0){style+="."+lang+" ."+i.toLowerCase()+" span{"+lang_style[lang][i]+"}\n";style+="."+lang+" ."+i.toLowerCase()+"{"+lang_style[lang][i]+"}\n";}}this.syntax[lang]["styles"]=style;}}};eAL.waiting_loading["reg_syntax.js"]="loaded";
36
- var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;editAreaLoader.iframe_script= "<script type='text/javascript'> Ã EA(){var t=Á;t.error=Ì;t.inlinePopup=[{popup_id:\"area_search_replace\",icon_id:\"search\"},{popup_id:\"edit_area_help\",icon_id:\"help\"}];t.plugins={};t.line_number=0;È.eAL.set_browser_infos(t);if(t.isIE >=8)t.isIE=7;t.É={};t.last_text_to_highlight=\"\";t.last_hightlighted_text=\"\";t.syntax_list=[];t.allready_used_syntax={};t.check_line_selection_timer=50;t.ÂFocused=Ì;t.highlight_selection_line=null;t.previous=[];t.next=[];t.last_undo=\"\";t.files={};t.filesIdAssoc={};t.curr_file='';t.assocBracket={};t.revertAssocBracket={};t.assocBracket[\"(\"]=\")\";t.assocBracket[\"{\"]=\"}\";t.assocBracket[\"[\"]=\"]\";for(var index in t.assocBracket){t.revertAssocBracket[t.assocBracket[index]]=index;}t.is_editable=Ë;t.lineHeight=16;t.tab_nb_char=8;if(t.isOpera)t.tab_nb_char=6;t.is_tabbing=Ì;t.fullscreen={'isFull':Ì};t.isResizing=Ì;t.id=area_id;t.Å=eAs[t.id][\"Å\"];if((\"\"+t.Å['replace_tab_by_spaces']).match(/^[0-9]+$/)){t.tab_nb_char=t.Å['replace_tab_by_spaces'];t.tabulation=\"\";for(var i=0;i<t.tab_nb_char;i++)t.tabulation+=\" \";}\nelse{t.tabulation=\"\t\";}if(t.Å[\"syntax_selection_allow\"]&&t.Å[\"syntax_selection_allow\"].Æ>0)t.syntax_list=t.Å[\"syntax_selection_allow\"].replace(/ /g,\"\").split(\",\");if(t.Å['syntax'])t.allready_used_syntax[t.Å['syntax']]=Ë;};EA.Ä.init=Ã(){var t=Á,a,s=t.Å;t.Â=_$(\"Â\");t.container=_$(\"container\");t.result=_$(\"result\");t.content_highlight=_$(\"content_highlight\");t.selection_field=_$(\"selection_field\");t.selection_field_text=_$(\"selection_field_text\");t.processing_screen=_$(\"processing\");t.editor_area=_$(\"editor\");t.tab_browsing_area=_$(\"tab_browsing_area\");t.test_font_size=_$(\"test_font_size\");a=t.Â;if(!s['is_editable'])t.set_editable(Ì);t.set_show_line_colors(s['show_line_colors']);if(syntax_selec=_$(\"syntax_selection\")){for(var i=0;i<t.syntax_list.Æ;i++){var syntax=t.syntax_list[i];var option=document.createElement(\"option\");option.Ê=syntax;if(syntax==s['syntax'])option.selected=\"selected\";dispSyntax=È.eAL.syntax_display_name[ syntax ];option.innerHTML=typeof(dispSyntax)=='undefined' ? syntax.substring(0,1).toUpperCase()+syntax.substring(1):dispSyntax;syntax_selec.appendChild(option);}}spans=È.getChildren(_$(\"toolbar_1\"),\"span\",\"\",\"\",\"all\",-1);for(var i=0;i<spans.Æ;i++){id=spans[i].id.replace(/tmp_tool_(.*)/,\"$1\");if(id!=spans[i].id){for(var j in t.plugins){if(typeof(t.plugins[j].get_control_html)==\"Ã\"){html=t.plugins[j].get_control_html(id);if(html!=Ì){html=t.get_translation(html,\"template\");var new_span=document.createElement(\"span\");new_span.innerHTML=html;var father=spans[i].ÈNode;spans[i].ÈNode.replaceChild(new_span,spans[i]);break;}}}}}if(s[\"debug\"]){t.debug=È.document.getElementById(\"edit_area_debug_\"+t.id);}if(_$(\"redo\")!=null)t.switchClassSticky(_$(\"redo\"),'editAreaButtonDisabled',Ë);if(typeof(È.eAL.syntax[s[\"syntax\"]])!=\"undefined\"){for(var i in È.eAL.syntax){if(typeof(È.eAL.syntax[i][\"Çs\"])!=\"undefined\"){t.add_Ç(È.eAL.syntax[i][\"Çs\"]);}}}if(t.isOpera)_$(\"editor\").onkeypress=keyDown;\nelse _$(\"editor\").onkeydown=keyDown;for(var i=0;i<t.inlinePopup.Æ;i++){if(t.isOpera)_$(t.inlinePopup[i][\"popup_id\"]).onkeypress=keyDown;\nelse _$(t.inlinePopup[i][\"popup_id\"]).onkeydown=keyDown;}if(s[\"allow_resize\"]==\"both\"||s[\"allow_resize\"]==\"x\"||s[\"allow_resize\"]==\"y\")t.allow_resize(Ë);È.eAL.toggle(t.id,\"on\");t.change_smooth_selection_mode(eA.smooth_selection);t.execCommand(\"change_highlight\",s[\"start_highlight\"]);t.set_font(eA.Å[\"font_family\"],eA.Å[\"font_size\"]);children=È.getChildren(document.body,\"\",\"selec\",\"none\",\"all\",-1);for(var i=0;i<children.Æ;i++){if(t.isIE)children[i].unselectable=Ë;\nelse children[i].onmousedown=Ã(){return Ì};}a.spellcheck=s[\"gecko_spellcheck\"];if(t.isFirefox >='3'){t.content_highlight.Ç.paddingLeft=\"1px\";t.selection_field.Ç.paddingLeft=\"1px\";t.selection_field_text.Ç.paddingLeft=\"1px\";}if(t.isIE&&t.isIE < 8){a.Ç.marginTop=\"-1px\";}if(t.isSafari){t.editor_area.Ç.position=\"absolute\";a.Ç.marginLeft=\"-3px\";if(t.isSafari < 3.2)a.Ç.marginTop=\"1px\";}È.eAL.add_event(t.result,\"click\",Ã(e){if((e.target||e.srcElement)==eA.result){eA.area_select(eA.Â.Ê.Æ,0);}});if(s['is_multi_files']!=Ì)t.open_file({'id':t.curr_file,'text':''});t.set_word_wrap(s['word_wrap']);setTimeout(\"eA.focus();eA.manage_size();eA.execCommand('EA_load');\",10);t.check_undo();t.check_line_selection(Ë);t.scroll_to_view();for(var i in t.plugins){if(typeof(t.plugins[i].onload)==\"Ã\")t.plugins[i].onload();}if(s['fullscreen']==Ë)t.toggle_full_screen(Ë);È.eAL.add_event(window,\"resize\",eA.update_size);È.eAL.add_event(È.window,\"resize\",eA.update_size);È.eAL.add_event(top.window,\"resize\",eA.update_size);È.eAL.add_event(window,\"unload\",Ã(){if(È.eAL){È.eAL.remove_event(È.window,\"resize\",eA.update_size);È.eAL.remove_event(top.window,\"resize\",eA.update_size);}if(eAs[eA.id]&&eAs[eA.id][\"displayed\"]){eA.execCommand(\"EA_unload\");}});};EA.Ä.update_size=Ã(){var d=document,pd=È.document,height,width,popup,maxLeft,maxTop;if(typeof eAs !='undefined'&&eAs[eA.id]&&eAs[eA.id][\"displayed\"]==Ë){if(eA.fullscreen['isFull']){pd.getElementById(\"frame_\"+eA.id).Ç.width=pd.getElementsByTagName(\"html\")[0].clientWidth+\"px\";pd.getElementById(\"frame_\"+eA.id).Ç.height=pd.getElementsByTagName(\"html\")[0].clientHeight+\"px\";}if(eA.tab_browsing_area.Ç.display=='block'&&(!eA.isIE||eA.isIE >=8)){eA.tab_browsing_area.Ç.height=\"0px\";eA.tab_browsing_area.Ç.height=(eA.result.offsetTop-eA.tab_browsing_area.offsetTop-1)+\"px\";}height=d.body.offsetHeight-eA.get_all_toolbar_height()-4;eA.result.Ç.height=height+\"px\";width=d.body.offsetWidth-2;eA.result.Ç.width=width+\"px\";for(i=0;i < eA.inlinePopup.Æ;i++){popup=_$(eA.inlinePopup[i][\"popup_id\"]);maxLeft=d.body.offsetWidth-popup.offsetWidth;maxTop=d.body.offsetHeight-popup.offsetHeight;if(popup.offsetTop > maxTop)popup.Ç.top=maxTop+\"px\";if(popup.offsetLeft > maxLeft)popup.Ç.left=maxLeft+\"px\";}eA.manage_size(Ë);eA.fixLinesHeight(eA.Â.Ê,0,-1);}};EA.Ä.manage_size=Ã(onlyOneTime){if(!eAs[Á.id])return Ì;if(eAs[Á.id][\"displayed\"]==Ë&&Á.ÂFocused){var area_height,resized=Ì;if(!Á.Å['word_wrap']){var area_width=Á.Â.scrollWidth;area_height=Á.Â.scrollHeight;if(Á.isOpera&&Á.isOpera < 9.6){area_width=10000;}if(Á.Â.previous_scrollWidth!=area_width){Á.container.Ç.width=area_width+\"px\";Á.Â.Ç.width=area_width+\"px\";Á.content_highlight.Ç.width=area_width+\"px\";Á.Â.previous_scrollWidth=area_width;resized=Ë;}}if(Á.Å['word_wrap']){newW=Á.Â.offsetWidth;if(Á.isFirefox||Á.isIE)newW-=2;if(Á.isSafari)newW-=6;Á.content_highlight.Ç.width=Á.selection_field_text.Ç.width=Á.selection_field.Ç.width=Á.test_font_size.Ç.width=newW+\"px\";}if(Á.isOpera||Á.isFirefox||Á.isSafari){area_height=Á.getLinePosTop(Á.É[\"nb_line\"]+1);}\nelse{area_height=Á.Â.scrollHeight;}if(Á.Â.previous_scrollHeight!=area_height){Á.container.Ç.height=(area_height+2)+\"px\";Á.Â.Ç.height=area_height+\"px\";Á.content_highlight.Ç.height=area_height+\"px\";Á.Â.previous_scrollHeight=area_height;resized=Ë;}if(Á.É[\"nb_line\"] >=Á.line_number){var newLines='',destDiv=_$(\"line_number\"),start=Á.line_number,end=Á.É[\"nb_line\"]+100;for(i=start+1;i < end;i++){newLines+='<div id=\"line_'+i+'\">'+i+\"</div>\";Á.line_number++;}destDiv.innerHTML=destDiv.innerHTML+newLines;if(Á.Å['word_wrap']){Á.fixLinesHeight(Á.Â.Ê,start,-1);}}Á.Â.scrollTop=\"0px\";Á.Â.scrollLeft=\"0px\";if(resized==Ë){Á.scroll_to_view();}}if(!onlyOneTime)setTimeout(\"eA.manage_size();\",100);};EA.Ä.execCommand=Ã(cmd,param){for(var i in Á.plugins){if(typeof(Á.plugins[i].execCommand)==\"Ã\"){if(!Á.plugins[i].execCommand(cmd,param))return;}}switch(cmd){case \"save\":if(Á.Å[\"save_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"save_callback\"]+\"('\"+Á.id+\"',eA.Â.Ê);\");break;case \"load\":if(Á.Å[\"load_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"load_callback\"]+\"('\"+Á.id+\"');\");break;case \"onchange\":if(Á.Å[\"change_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"change_callback\"]+\"('\"+Á.id+\"');\");break;case \"EA_load\":if(Á.Å[\"EA_load_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_load_callback\"]+\"('\"+Á.id+\"');\");break;case \"EA_unload\":if(Á.Å[\"EA_unload_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_unload_callback\"]+\"('\"+Á.id+\"');\");break;case \"toggle_on\":if(Á.Å[\"EA_toggle_on_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_toggle_on_callback\"]+\"('\"+Á.id+\"');\");break;case \"toggle_off\":if(Á.Å[\"EA_toggle_off_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_toggle_off_callback\"]+\"('\"+Á.id+\"');\");break;case \"re_sync\":if(!Á.do_highlight)break;case \"file_switch_on\":if(Á.Å[\"EA_file_switch_on_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_file_switch_on_callback\"]+\"(param);\");break;case \"file_switch_off\":if(Á.Å[\"EA_file_switch_off_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_file_switch_off_callback\"]+\"(param);\");break;case \"file_close\":if(Á.Å[\"EA_file_close_callback\"].Æ>0)return eval(\"È.\"+Á.Å[\"EA_file_close_callback\"]+\"(param);\");break;default:if(typeof(eval(\"eA.\"+cmd))==\"Ã\"){if(Á.Å[\"debug\"])eval(\"eA.\"+cmd+\"(param);\");\nelse try{eval(\"eA.\"+cmd+\"(param);\");}catch(e){};}}};EA.Ä.get_translation=Ã(word,mode){if(mode==\"template\")return È.eAL.translate(word,Á.Å[\"language\"],mode);\nelse return È.eAL.get_word_translation(word,Á.Å[\"language\"]);};EA.Ä.add_plugin=Ã(plug_name,plug_obj){for(var i=0;i<Á.Å[\"plugins\"].Æ;i++){if(Á.Å[\"plugins\"][i]==plug_name){Á.plugins[plug_name]=plug_obj;plug_obj.baseURL=È.eAL.baseURL+\"plugins/\"+plug_name+\"/\";if(typeof(plug_obj.init)==\"Ã\")plug_obj.init();}}};EA.Ä.load_css=Ã(url){try{link=document.createElement(\"link\");link.type=\"text/css\";link.rel=\"Çsheet\";link.media=\"all\";link.href=url;head=document.getElementsByTagName(\"head\");head[0].appendChild(link);}catch(e){document.write(\"<link href='\"+url+\"' rel='Çsheet' type='text/css' />\");}};EA.Ä.load_script=Ã(url){try{script=document.createElement(\"script\");script.type=\"text/javascript\";script.src=url;script.charset=\"UTF-8\";head=document.getElementsByTagName(\"head\");head[0].appendChild(script);}catch(e){document.write(\"<script type='text/javascript' src='\"+url+\"' charset=\\\"UTF-8\\\"><\"+\"/script>\");}};EA.Ä.add_lang=Ã(language,Ês){if(!È.eAL.lang[language])È.eAL.lang[language]={};for(var i in Ês)È.eAL.lang[language][i]=Ês[i];};Ã _$(id){return document.getElementById(id);};var eA=new EA();È.eAL.add_event(window,\"load\",init);Ã init(){setTimeout(\"eA.init();\",10);}; EA.Ä.focus=Ã(){Á.Â.focus();Á.ÂFocused=Ë;};EA.Ä.check_line_selection=Ã(timer_checkup){var changes,infos,new_top,new_width,i;var t1=t2=t2_1=t3=tLines=tend=new Date().getTime();if(!eAs[Á.id])return Ì;if(!Á.smooth_selection&&!Á.do_highlight){}\nelse if(Á.ÂFocused&&eAs[Á.id][\"displayed\"]==Ë&&Á.isResizing==Ì){infos=Á.get_selection_infos();changes=Á.checkTextEvolution(typeof(Á.É['full_text'])=='undefined' ? '':Á.É['full_text'],infos['full_text']);t2=new Date().getTime();if(Á.É[\"line_start\"] !=infos[\"line_start\"]||Á.É[\"line_nb\"] !=infos[\"line_nb\"]||infos[\"full_text\"] !=Á.É[\"full_text\"]||Á.reload_highlight||Á.É[\"selectionStart\"] !=infos[\"selectionStart\"]||Á.É[\"selectionEnd\"] !=infos[\"selectionEnd\"]||!timer_checkup){new_top=Á.getLinePosTop(infos[\"line_start\"]);new_width=Math.max(Á.Â.scrollWidth,Á.container.clientWidth-50);Á.selection_field.Ç.top=Á.selection_field_text.Ç.top=new_top+\"px\";if(!Á.Å['word_wrap']){Á.selection_field.Ç.width=Á.selection_field_text.Ç.width=Á.test_font_size.Ç.width=new_width+\"px\";}if(Á.do_highlight==Ë){var curr_text=infos[\"full_text\"].split(\"\\n\");var content=\"\";var start=Math.max(0,infos[\"line_start\"]-1);var end=Math.min(curr_text.Æ,infos[\"line_start\"]+infos[\"line_nb\"]-1);for(i=start;i< end;i++){content+=curr_text[i]+\"\\n\";}selLength=infos['selectionEnd']-infos['selectionStart'];content=content.substr(0,infos[\"curr_pos\"]-1)+\"\\r\\r\"+content.substr(infos[\"curr_pos\"]-1,selLength)+\"\\r\\r\"+content.substr(infos[\"curr_pos\"]-1+selLength);content='<span>'+content.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(\"\\r\\r\",'</span><strong>').replace(\"\\r\\r\",'</strong><span>')+'</span>';if(Á.isIE||(Á.isOpera&&Á.isOpera < 9.6)){Á.selection_field.innerHTML=\"<pre>\"+content.replace(/^\\r?\\n/,\"<br>\")+\"</pre>\";}\nelse{Á.selection_field.innerHTML=content;}Á.selection_field_text.innerHTML=Á.selection_field.innerHTML;t2_1=new Date().getTime();if(Á.reload_highlight||(infos[\"full_text\"] !=Á.last_text_to_highlight&&(Á.É[\"line_start\"]!=infos[\"line_start\"]||Á.show_line_colors||Á.Å['word_wrap']||Á.É[\"line_nb\"]!=infos[\"line_nb\"]||Á.É[\"nb_line\"]!=infos[\"nb_line\"]))){Á.maj_highlight(infos);}}}t3=new Date().getTime();if(Á.Å['word_wrap']&&infos[\"full_text\"] !=Á.É[\"full_text\"]){if(changes.newText.split(\"\\n\").Æ==1&&Á.É['nb_line']&&infos['nb_line']==Á.É['nb_line']){Á.fixLinesHeight(infos['full_text'],changes.lineStart,changes.lineStart);}\nelse{Á.fixLinesHeight(infos['full_text'],changes.lineStart,-1);}}tLines=new Date().getTime();if(infos[\"line_start\"] !=Á.É[\"line_start\"]||infos[\"curr_pos\"] !=Á.É[\"curr_pos\"]||infos[\"full_text\"].Æ!=Á.É[\"full_text\"].Æ||Á.reload_highlight||!timer_checkup){var selec_char=infos[\"curr_line\"].charAt(infos[\"curr_pos\"]-1);var no_real_move=Ë;if(infos[\"line_nb\"]==1&&(Á.assocBracket[selec_char]||Á.revertAssocBracket[selec_char])){no_real_move=Ì;if(Á.findEndBracket(infos,selec_char)===Ë){_$(\"end_bracket\").Ç.visibility=\"visible\";_$(\"cursor_pos\").Ç.visibility=\"visible\";_$(\"cursor_pos\").innerHTML=selec_char;_$(\"end_bracket\").innerHTML=(Á.assocBracket[selec_char]||Á.revertAssocBracket[selec_char]);}\nelse{_$(\"end_bracket\").Ç.visibility=\"hidden\";_$(\"cursor_pos\").Ç.visibility=\"hidden\";}}\nelse{_$(\"cursor_pos\").Ç.visibility=\"hidden\";_$(\"end_bracket\").Ç.visibility=\"hidden\";}Á.displayToCursorPosition(\"cursor_pos\",infos[\"line_start\"],infos[\"curr_pos\"]-1,infos[\"curr_line\"],no_real_move);if(infos[\"line_nb\"]==1&&infos[\"line_start\"]!=Á.É[\"line_start\"])Á.scroll_to_view();}Á.É=infos;}tend=new Date().getTime();if(timer_checkup){setTimeout(\"eA.check_line_selection(Ë)\",Á.check_line_selection_timer);}};EA.Ä.get_selection_infos=Ã(){var sel={},start,end,len,str;Á.getIESelection();start=Á.Â.selectionStart;end=Á.Â.selectionEnd;if(Á.É[\"selectionStart\"]==start&&Á.É[\"selectionEnd\"]==end&&Á.É[\"full_text\"]==Á.Â.Ê){return Á.É;}if(Á.tabulation!=\"\t\"&&Á.Â.Ê.indexOf(\"\t\")!=-1){len=Á.Â.Ê.Æ;Á.Â.Ê=Á.replace_tab(Á.Â.Ê);start=end=start+(Á.Â.Ê.Æ-len);Á.area_select(start,0);}sel[\"selectionStart\"]=start;sel[\"selectionEnd\"]=end;sel[\"full_text\"]=Á.Â.Ê;sel[\"line_start\"]=1;sel[\"line_nb\"]=1;sel[\"curr_pos\"]=0;sel[\"curr_line\"]=\"\";sel[\"indexOfCursor\"]=0;sel[\"selec_direction\"]=Á.É[\"selec_direction\"];var splitTab=sel[\"full_text\"].split(\"\\n\");var nbLine=Math.max(0,splitTab.Æ);var nbChar=Math.max(0,sel[\"full_text\"].Æ-(nbLine-1));if(sel[\"full_text\"].indexOf(\"\\r\")!=-1)nbChar=nbChar-(nbLine-1);sel[\"nb_line\"]=nbLine;sel[\"nb_char\"]=nbChar;if(start>0){str=sel[\"full_text\"].substr(0,start);sel[\"curr_pos\"]=start-str.lastIndexOf(\"\\n\");sel[\"line_start\"]=Math.max(1,str.split(\"\\n\").Æ);}\nelse{sel[\"curr_pos\"]=1;}if(end>start){sel[\"line_nb\"]=sel[\"full_text\"].substring(start,end).split(\"\\n\").Æ;}sel[\"indexOfCursor\"]=start;sel[\"curr_line\"]=splitTab[Math.max(0,sel[\"line_start\"]-1)];if(sel[\"selectionStart\"]==Á.É[\"selectionStart\"]){if(sel[\"selectionEnd\"]>Á.É[\"selectionEnd\"])sel[\"selec_direction\"]=\"down\";\nelse if(sel[\"selectionEnd\"]==Á.É[\"selectionStart\"])sel[\"selec_direction\"]=Á.É[\"selec_direction\"];}\nelse if(sel[\"selectionStart\"]==Á.É[\"selectionEnd\"]&&sel[\"selectionEnd\"]>Á.É[\"selectionEnd\"]){sel[\"selec_direction\"]=\"down\";}\nelse{sel[\"selec_direction\"]=\"up\";}_$(\"nbLine\").innerHTML=nbLine;_$(\"nbChar\").innerHTML=nbChar;_$(\"linePos\").innerHTML=sel[\"line_start\"];_$(\"currPos\").innerHTML=sel[\"curr_pos\"];return sel;};EA.Ä.getIESelection=Ã(){var selectionStart,selectionEnd,range,stored_range;if(!Á.isIE)return Ì;if(Á.Å['word_wrap'])Á.Â.wrap='off';try{range=document.selection.createRange();stored_range=range.duplicate();stored_range.moveToElementText(Á.Â);stored_range.setEndPoint('EndToEnd',range);if(stored_range.ÈElement()!=Á.Â)throw \"invalid focus\";var scrollTop=Á.result.scrollTop+document.body.scrollTop;var relative_top=range.offsetTop-È.calculeOffsetTop(Á.Â)+scrollTop;var line_start=Math.round((relative_top / Á.lineHeight)+1);var line_nb=Math.round(range.boundingHeight / Á.lineHeight);selectionStart=stored_range.text.Æ-range.text.Æ;selectionStart+=(line_start-Á.Â.Ê.substr(0,selectionStart).split(\"\\n\").Æ)*2;selectionStart-=(line_start-Á.Â.Ê.substr(0,selectionStart).split(\"\\n\").Æ)* 2;selectionEnd=selectionStart+range.text.Æ;selectionEnd+=(line_start+line_nb-1-Á.Â.Ê.substr(0,selectionEnd).split(\"\\n\").Æ)*2;Á.Â.selectionStart=selectionStart;Á.Â.selectionEnd=selectionEnd;}catch(e){}if(Á.Å['word_wrap'])Á.Â.wrap='soft';};EA.Ä.setIESelection=Ã(){var a=Á.Â,nbLineStart,nbLineEnd,range;if(!Á.isIE)return Ì;nbLineStart=a.Ê.substr(0,a.selectionStart).split(\"\\n\").Æ-1;nbLineEnd=a.Ê.substr(0,a.selectionEnd).split(\"\\n\").Æ-1;range=document.selection.createRange();range.moveToElementText(a);range.setEndPoint('EndToStart',range);range.moveStart('character',a.selectionStart-nbLineStart);range.moveEnd('character',a.selectionEnd-nbLineEnd-(a.selectionStart-nbLineStart));range.select();};EA.Ä.checkTextEvolution=Ã(lastText,newText){var ch={},baseStep=200,cpt=0,end,step,tStart=new Date().getTime();end=Math.min(newText.Æ,lastText.Æ);step=baseStep;while(cpt<end&&step>=1){if(lastText.substr(cpt,step)==newText.substr(cpt,step)){cpt+=step;}\nelse{step=Math.floor(step/2);}}ch.posStart=cpt;ch.lineStart=newText.substr(0,ch.posStart).split(\"\\n\").Æ-1;cpt_last=lastText.Æ;cpt=newText.Æ;step=baseStep;while(cpt>=0&&cpt_last>=0&&step>=1){if(lastText.substr(cpt_last-step,step)==newText.substr(cpt-step,step)){cpt-=step;cpt_last-=step;}\nelse{step=Math.floor(step/2);}}ch.posNewEnd=cpt;ch.posLastEnd=cpt_last;if(ch.posNewEnd<=ch.posStart){if(lastText.Æ < newText.Æ){ch.posNewEnd=ch.posStart+newText.Æ-lastText.Æ;ch.posLastEnd=ch.posStart;}\nelse{ch.posLastEnd=ch.posStart+lastText.Æ-newText.Æ;ch.posNewEnd=ch.posStart;}}ch.newText=newText.substring(ch.posStart,ch.posNewEnd);ch.lastText=lastText.substring(ch.posStart,ch.posLastEnd);ch.lineNewEnd=newText.substr(0,ch.posNewEnd).split(\"\\n\").Æ-1;ch.lineLastEnd=lastText.substr(0,ch.posLastEnd).split(\"\\n\").Æ-1;ch.newTextLine=newText.split(\"\\n\").slice(ch.lineStart,ch.lineNewEnd+1).join(\"\\n\");ch.lastTextLine=lastText.split(\"\\n\").slice(ch.lineStart,ch.lineLastEnd+1).join(\"\\n\");return ch;};EA.Ä.tab_selection=Ã(){if(Á.is_tabbing)return;Á.is_tabbing=Ë;Á.getIESelection();var start=Á.Â.selectionStart;var end=Á.Â.selectionEnd;var insText=Á.Â.Ê.substring(start,end);var pos_start=start;var pos_end=end;if(insText.Æ==0){Á.Â.Ê=Á.Â.Ê.substr(0,start)+Á.tabulation+Á.Â.Ê.substr(end);pos_start=start+Á.tabulation.Æ;pos_end=pos_start;}\nelse{start=Math.max(0,Á.Â.Ê.substr(0,start).lastIndexOf(\"\\n\")+1);endText=Á.Â.Ê.substr(end);startText=Á.Â.Ê.substr(0,start);tmp=Á.Â.Ê.substring(start,end).split(\"\\n\");insText=Á.tabulation+tmp.join(\"\\n\"+Á.tabulation);Á.Â.Ê=startText+insText+endText;pos_start=start;pos_end=Á.Â.Ê.indexOf(\"\\n\",startText.Æ+insText.Æ);if(pos_end==-1)pos_end=Á.Â.Ê.Æ;}Á.Â.selectionStart=pos_start;Á.Â.selectionEnd=pos_end;if(Á.isIE){Á.setIESelection();setTimeout(\"eA.is_tabbing=Ì;\",100);}\nelse{Á.is_tabbing=Ì;}};EA.Ä.invert_tab_selection=Ã(){var t=Á,a=Á.Â;if(t.is_tabbing)return;t.is_tabbing=Ë;t.getIESelection();var start=a.selectionStart;var end=a.selectionEnd;var insText=a.Ê.substring(start,end);var pos_start=start;var pos_end=end;if(insText.Æ==0){if(a.Ê.substring(start-t.tabulation.Æ,start)==t.tabulation){a.Ê=a.Ê.substr(0,start-t.tabulation.Æ)+a.Ê.substr(end);pos_start=Math.max(0,start-t.tabulation.Æ);pos_end=pos_start;}}\nelse{start=a.Ê.substr(0,start).lastIndexOf(\"\\n\")+1;endText=a.Ê.substr(end);startText=a.Ê.substr(0,start);tmp=a.Ê.substring(start,end).split(\"\\n\");insText=\"\";for(i=0;i<tmp.Æ;i++){for(j=0;j<t.tab_nb_char;j++){if(tmp[i].charAt(0)==\"\t\"){tmp[i]=tmp[i].substr(1);j=t.tab_nb_char;}\nelse if(tmp[i].charAt(0)==\" \")tmp[i]=tmp[i].substr(1);}insText+=tmp[i];if(i<tmp.Æ-1)insText+=\"\\n\";}a.Ê=startText+insText+endText;pos_start=start;pos_end=a.Ê.indexOf(\"\\n\",startText.Æ+insText.Æ);if(pos_end==-1)pos_end=a.Ê.Æ;}a.selectionStart=pos_start;a.selectionEnd=pos_end;if(t.isIE){t.setIESelection();setTimeout(\"eA.is_tabbing=Ì;\",100);}\nelse t.is_tabbing=Ì;};EA.Ä.press_enter=Ã(){if(!Á.smooth_selection)return Ì;Á.getIESelection();var scrollTop=Á.result.scrollTop;var scrollLeft=Á.result.scrollLeft;var start=Á.Â.selectionStart;var end=Á.Â.selectionEnd;var start_last_line=Math.max(0,Á.Â.Ê.substring(0,start).lastIndexOf(\"\\n\")+1);var begin_line=Á.Â.Ê.substring(start_last_line,start).replace(/^([ \t]*).*/gm,\"$1\");var lineStart=Á.Â.Ê.substring(0,start).split(\"\\n\").Æ;if(begin_line==\"\\n\"||begin_line==\"\\r\"||begin_line.Æ==0){return Ì;}if(Á.isIE||(Á.isOpera&&Á.isOpera < 9.6)){begin_line=\"\\r\\n\"+begin_line;}\nelse{begin_line=\"\\n\"+begin_line;}Á.Â.Ê=Á.Â.Ê.substring(0,start)+begin_line+Á.Â.Ê.substring(end);Á.area_select(start+begin_line.Æ,0);if(Á.isIE){Á.result.scrollTop=scrollTop;Á.result.scrollLeft=scrollLeft;}return Ë;};EA.Ä.findEndBracket=Ã(infos,bracket){var start=infos[\"indexOfCursor\"];var normal_order=Ë;if(Á.assocBracket[bracket])endBracket=Á.assocBracket[bracket];\nelse if(Á.revertAssocBracket[bracket]){endBracket=Á.revertAssocBracket[bracket];normal_order=Ì;}var end=-1;var nbBracketOpen=0;for(var i=start;i<infos[\"full_text\"].Æ&&i>=0;){if(infos[\"full_text\"].charAt(i)==endBracket){nbBracketOpen--;if(nbBracketOpen<=0){end=i;break;}}\nelse if(infos[\"full_text\"].charAt(i)==bracket)nbBracketOpen++;if(normal_order)i++;\nelse i--;}if(end==-1)return Ì;var endLastLine=infos[\"full_text\"].substr(0,end).lastIndexOf(\"\\n\");if(endLastLine==-1)line=1;\nelse line=infos[\"full_text\"].substr(0,endLastLine).split(\"\\n\").Æ+1;var curPos=end-endLastLine-1;var endLineLength=infos[\"full_text\"].substring(end).split(\"\\n\")[0].Æ;Á.displayToCursorPosition(\"end_bracket\",line,curPos,infos[\"full_text\"].substring(endLastLine+1,end+endLineLength));return Ë;};EA.Ä.displayToCursorPosition=Ã(id,start_line,cur_pos,lineContent,no_real_move){var elem,dest,content,posLeft=0,posTop,fixPadding,topOffset,endElem;elem=Á.test_font_size;dest=_$(id);content=\"<span id='test_font_size_inner'>\"+lineContent.substr(0,cur_pos).replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\")+\"</span><span id='endTestFont'>\"+lineContent.substr(cur_pos).replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\")+\"</span>\";if(Á.isIE||(Á.isOpera&&Á.isOpera < 9.6)){elem.innerHTML=\"<pre>\"+content.replace(/^\\r?\\n/,\"<br>\")+\"</pre>\";}\nelse{elem.innerHTML=content;}endElem=_$('endTestFont');topOffset=endElem.offsetTop;fixPadding=parseInt(Á.content_highlight.Ç.paddingLeft.replace(\"px\",\"\"));posLeft=45+endElem.offsetLeft+(!isNaN(fixPadding)&&topOffset > 0 ? fixPadding:0);posTop=Á.getLinePosTop(start_line)+topOffset;if(Á.isIE&&cur_pos > 0&&endElem.offsetLeft==0){posTop+=Á.lineHeight;}if(no_real_move!=Ë){dest.Ç.top=posTop+\"px\";dest.Ç.left=posLeft+\"px\";}dest.cursor_top=posTop;dest.cursor_left=posLeft;};EA.Ä.getLinePosTop=Ã(start_line){var elem=_$('line_'+start_line),posTop=0;if(elem)posTop=elem.offsetTop;\nelse posTop=Á.lineHeight *(start_line-1);return posTop;};EA.Ä.getTextHeight=Ã(text){var t=Á,elem,height;elem=t.test_font_size;content=text.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\");if(t.isIE||(Á.isOpera&&Á.isOpera < 9.6)){elem.innerHTML=\"<pre>\"+content.replace(/^\\r?\\n/,\"<br>\")+\"</pre>\";}\nelse{elem.innerHTML=content;}height=elem.offsetHeight;height=Math.max(1,Math.floor(elem.offsetHeight / Á.lineHeight))* Á.lineHeight;return height;};EA.Ä.fixLinesHeight=Ã(textValue,lineStart,lineEnd){var aText=textValue.split(\"\\n\");if(lineEnd==-1)lineEnd=aText.Æ-1;for(var i=Math.max(0,lineStart);i <=lineEnd;i++){if(elem=_$('line_'+(i+1))){elem.Ç.height=typeof(aText[i])!=\"undefined\" ? Á.getTextHeight(aText[i])+\"px\":Á.lineHeight;}}};EA.Ä.area_select=Ã(start,Æ){Á.Â.focus();start=Math.max(0,Math.min(Á.Â.Ê.Æ,start));end=Math.max(start,Math.min(Á.Â.Ê.Æ,start+Æ));if(Á.isIE){Á.Â.selectionStart=start;Á.Â.selectionEnd=end;Á.setIESelection();}\nelse{if(Á.isOpera&&Á.isOpera < 9.6){Á.Â.setSelectionRange(0,0);}Á.Â.setSelectionRange(start,end);}Á.check_line_selection();};EA.Ä.area_get_selection=Ã(){var text=\"\";if(document.selection){var range=document.selection.createRange();text=range.text;}\nelse{text=Á.Â.Ê.substring(Á.Â.selectionStart,Á.Â.selectionEnd);}return text;}; EA.Ä.replace_tab=Ã(text){return text.replace(/((\\n?)([^\t\\n]*)\t)/gi,eA.smartTab);};EA.Ä.smartTab=Ã(){val=\" \";return EA.Ä.smartTab.arguments[2]+EA.Ä.smartTab.arguments[3]+val.substr(0,eA.tab_nb_char-(EA.Ä.smartTab.arguments[3].Æ)%eA.tab_nb_char);};EA.Ä.show_waiting_screen=Ã(){width=Á.editor_area.offsetWidth;height=Á.editor_area.offsetHeight;if(!(Á.isIE&&Á.isIE<6)){width-=2;height-=2;}Á.processing_screen.Ç.display=\"block\";Á.processing_screen.Ç.width=width+\"px\";Á.processing_screen.Ç.height=height+\"px\";Á.waiting_screen_displayed=Ë;};EA.Ä.hide_waiting_screen=Ã(){Á.processing_screen.Ç.display=\"none\";Á.waiting_screen_displayed=Ì;};EA.Ä.add_Ç=Ã(Çs){if(Çs.Æ>0){newcss=document.createElement(\"Ç\");newcss.type=\"text/css\";newcss.media=\"all\";if(newcss.ÇSheet){newcss.ÇSheet.cssText=Çs;}\nelse{newcss.appendChild(document.createTextNode(Çs));}document.getElementsByTagName(\"head\")[0].appendChild(newcss);}};EA.Ä.set_font=Ã(family,size){var t=Á,a=Á.Â,s=Á.Å,elem_font,i,elem;var elems=[\"Â\",\"content_highlight\",\"cursor_pos\",\"end_bracket\",\"selection_field\",\"selection_field_text\",\"line_number\"];if(family&&family!=\"\")s[\"font_family\"]=family;if(size&&size>0)s[\"font_size\"]=size;if(t.isOpera&&t.isOpera < 9.6)s['font_family']=\"monospace\";if(elem_font=_$(\"area_font_size\")){for(i=0;i < elem_font.Æ;i++){if(elem_font.options[i].Ê&&elem_font.options[i].Ê==s[\"font_size\"])elem_font.options[i].selected=Ë;}}if(t.isFirefox){var nbTry=3;do{var div1=document.createElement('div'),text1=document.createElement('Â');var Çs={width:'40px',overflow:'scroll',zIndex:50,visibility:'hidden',fontFamily:s[\"font_family\"],fontSize:s[\"font_size\"]+\"pt\",lineHeight:t.lineHeight+\"px\",padding:'0',margin:'0',border:'none',whiteSpace:'nowrap'};var diff,changed=Ì;for(i in Çs){div1.Ç[ i ]=Çs[i];text1.Ç[ i ]=Çs[i];}text1.wrap='off';text1.setAttribute('wrap','off');t.container.appendChild(div1);t.container.appendChild(text1);div1.innerHTML=text1.Ê='azertyuiopqsdfghjklm';div1.innerHTML=text1.Ê=text1.Ê+'wxcvbn^p*ù$!:;,,';diff=text1.scrollWidth-div1.scrollWidth;if(Math.abs(diff)>=2){s[\"font_size\"]++;changed=Ë;}t.container.removeChild(div1);t.container.removeChild(text1);nbTry--;}while(changed&&nbTry > 0);}elem=t.test_font_size;elem.Ç.fontFamily=\"\"+s[\"font_family\"];elem.Ç.fontSize=s[\"font_size\"]+\"pt\";elem.innerHTML=\"0\";t.lineHeight=elem.offsetHeight;for(i=0;i<elems.Æ;i++){elem=_$(elems[i]);elem.Ç.fontFamily=s[\"font_family\"];elem.Ç.fontSize=s[\"font_size\"]+\"pt\";elem.Ç.lineHeight=t.lineHeight+\"px\";}t.add_Ç(\"pre{font-family:\"+s[\"font_family\"]+\"}\");if((t.isOpera&&t.isOpera < 9.6)||t.isIE >=8){var parNod=a.ÈNode,nxtSib=a.nextSibling,start=a.selectionStart,end=a.selectionEnd;parNod.removeChild(a);parNod.insertBefore(a,nxtSib);t.area_select(start,end-start);}Á.focus();Á.update_size();Á.check_line_selection();};EA.Ä.change_font_size=Ã(){var size=_$(\"area_font_size\").Ê;if(size>0)Á.set_font(\"\",size);};EA.Ä.open_inline_popup=Ã(popup_id){Á.close_all_inline_popup();var popup=_$(popup_id);var editor=_$(\"editor\");for(var i=0;i<Á.inlinePopup.Æ;i++){if(Á.inlinePopup[i][\"popup_id\"]==popup_id){var icon=_$(Á.inlinePopup[i][\"icon_id\"]);if(icon){Á.switchClassSticky(icon,'editAreaButtonSelected',Ë);break;}}}popup.Ç.height=\"auto\";popup.Ç.overflow=\"visible\";if(document.body.offsetHeight< popup.offsetHeight){popup.Ç.height=(document.body.offsetHeight-10)+\"px\";popup.Ç.overflow=\"auto\";}if(!popup.positionned){var new_left=editor.offsetWidth /2-popup.offsetWidth /2;var new_top=editor.offsetHeight /2-popup.offsetHeight /2;popup.Ç.left=new_left+\"px\";popup.Ç.top=new_top+\"px\";popup.positionned=Ë;}popup.Ç.visibility=\"visible\";};EA.Ä.close_inline_popup=Ã(popup_id){var popup=_$(popup_id);for(var i=0;i<Á.inlinePopup.Æ;i++){if(Á.inlinePopup[i][\"popup_id\"]==popup_id){var icon=_$(Á.inlinePopup[i][\"icon_id\"]);if(icon){Á.switchClassSticky(icon,'editAreaButtonNormal',Ì);break;}}}popup.Ç.visibility=\"hidden\";};EA.Ä.close_all_inline_popup=Ã(e){for(var i=0;i<Á.inlinePopup.Æ;i++){Á.close_inline_popup(Á.inlinePopup[i][\"popup_id\"]);}Á.Â.focus();};EA.Ä.show_help=Ã(){Á.open_inline_popup(\"edit_area_help\");};EA.Ä.new_document=Ã(){Á.Â.Ê=\"\";Á.area_select(0,0);};EA.Ä.get_all_toolbar_height=Ã(){var area=_$(\"editor\");var results=È.getChildren(area,\"div\",\"class\",\"area_toolbar\",\"all\",\"0\");var height=0;for(var i=0;i<results.Æ;i++){height+=results[i].offsetHeight;}return height;};EA.Ä.go_to_line=Ã(line){if(!line){var icon=_$(\"go_to_line\");if(icon !=null){Á.restoreClass(icon);Á.switchClassSticky(icon,'editAreaButtonSelected',Ë);}line=prompt(Á.get_translation(\"go_to_line_prompt\"));if(icon !=null)Á.switchClassSticky(icon,'editAreaButtonNormal',Ì);}if(line&&line!=null&&line.search(/^[0-9]+$/)!=-1){var start=0;var lines=Á.Â.Ê.split(\"\\n\");if(line > lines.Æ)start=Á.Â.Ê.Æ;\nelse{for(var i=0;i<Math.min(line-1,lines.Æ);i++)start+=lines[i].Æ+1;}Á.area_select(start,0);}};EA.Ä.change_smooth_selection_mode=Ã(setTo){if(Á.do_highlight)return;if(setTo !=null){if(setTo===Ì)Á.smooth_selection=Ë;\nelse Á.smooth_selection=Ì;}var icon=_$(\"change_smooth_selection\");Á.Â.focus();if(Á.smooth_selection===Ë){Á.switchClassSticky(icon,'editAreaButtonNormal',Ì);Á.smooth_selection=Ì;Á.selection_field.Ç.display=\"none\";_$(\"cursor_pos\").Ç.display=\"none\";_$(\"end_bracket\").Ç.display=\"none\";}\nelse{Á.switchClassSticky(icon,'editAreaButtonSelected',Ì);Á.smooth_selection=Ë;Á.selection_field.Ç.display=\"block\";_$(\"cursor_pos\").Ç.display=\"block\";_$(\"end_bracket\").Ç.display=\"block\";}};EA.Ä.scroll_to_view=Ã(show){var zone,lineElem;if(!Á.smooth_selection)return;zone=_$(\"result\");var cursor_pos_top=_$(\"cursor_pos\").cursor_top;if(show==\"bottom\"){cursor_pos_top+=Á.getLinePosTop(Á.É['line_start']+Á.É['line_nb']-1);}var max_height_visible=zone.clientHeight+zone.scrollTop;var miss_top=cursor_pos_top+Á.lineHeight-max_height_visible;if(miss_top>0){zone.scrollTop=zone.scrollTop+miss_top;}\nelse if(zone.scrollTop > cursor_pos_top){zone.scrollTop=cursor_pos_top;}var cursor_pos_left=_$(\"cursor_pos\").cursor_left;var max_width_visible=zone.clientWidth+zone.scrollLeft;var miss_left=cursor_pos_left+10-max_width_visible;if(miss_left>0){zone.scrollLeft=zone.scrollLeft+miss_left+50;}\nelse if(zone.scrollLeft > cursor_pos_left){zone.scrollLeft=cursor_pos_left;}\nelse if(zone.scrollLeft==45){zone.scrollLeft=0;}};EA.Ä.check_undo=Ã(only_once){if(!eAs[Á.id])return Ì;if(Á.ÂFocused&&eAs[Á.id][\"displayed\"]==Ë){var text=Á.Â.Ê;if(Á.previous.Æ<=1)Á.switchClassSticky(_$(\"undo\"),'editAreaButtonDisabled',Ë);if(!Á.previous[Á.previous.Æ-1]||Á.previous[Á.previous.Æ-1][\"text\"] !=text){Á.previous.push({\"text\":text,\"selStart\":Á.Â.selectionStart,\"selEnd\":Á.Â.selectionEnd});if(Á.previous.Æ > Á.Å[\"max_undo\"]+1)Á.previous.shift();}if(Á.previous.Æ >=2)Á.switchClassSticky(_$(\"undo\"),'editAreaButtonNormal',Ì);}if(!only_once)setTimeout(\"eA.check_undo()\",3000);};EA.Ä.undo=Ã(){if(Á.previous.Æ > 0){Á.getIESelection();Á.next.push({\"text\":Á.Â.Ê,\"selStart\":Á.Â.selectionStart,\"selEnd\":Á.Â.selectionEnd});var prev=Á.previous.pop();if(prev[\"text\"]==Á.Â.Ê&&Á.previous.Æ > 0)prev=Á.previous.pop();Á.Â.Ê=prev[\"text\"];Á.last_undo=prev[\"text\"];Á.area_select(prev[\"selStart\"],prev[\"selEnd\"]-prev[\"selStart\"]);Á.switchClassSticky(_$(\"redo\"),'editAreaButtonNormal',Ì);Á.resync_highlight(Ë);Á.check_file_changes();}};EA.Ä.redo=Ã(){if(Á.next.Æ > 0){var next=Á.next.pop();Á.previous.push(next);Á.Â.Ê=next[\"text\"];Á.last_undo=next[\"text\"];Á.area_select(next[\"selStart\"],next[\"selEnd\"]-next[\"selStart\"]);Á.switchClassSticky(_$(\"undo\"),'editAreaButtonNormal',Ì);Á.resync_highlight(Ë);Á.check_file_changes();}if(Á.next.Æ==0)Á.switchClassSticky(_$(\"redo\"),'editAreaButtonDisabled',Ë);};EA.Ä.check_redo=Ã(){if(eA.next.Æ==0||eA.Â.Ê!=eA.last_undo){eA.next=[];eA.switchClassSticky(_$(\"redo\"),'editAreaButtonDisabled',Ë);}\nelse{Á.switchClassSticky(_$(\"redo\"),'editAreaButtonNormal',Ì);}};EA.Ä.switchClass=Ã(element,class_name,lock_state){var lockChanged=Ì;if(typeof(lock_state)!=\"undefined\"&&element !=null){element.classLock=lock_state;lockChanged=Ë;}if(element !=null&&(lockChanged||!element.classLock)){element.oldClassName=element.className;element.className=class_name;}};EA.Ä.restoreAndSwitchClass=Ã(element,class_name){if(element !=null&&!element.classLock){Á.restoreClass(element);Á.switchClass(element,class_name);}};EA.Ä.restoreClass=Ã(element){if(element !=null&&element.oldClassName&&!element.classLock){element.className=element.oldClassName;element.oldClassName=null;}};EA.Ä.setClassLock=Ã(element,lock_state){if(element !=null)element.classLock=lock_state;};EA.Ä.switchClassSticky=Ã(element,class_name,lock_state){var lockChanged=Ì;if(typeof(lock_state)!=\"undefined\"&&element !=null){element.classLock=lock_state;lockChanged=Ë;}if(element !=null&&(lockChanged||!element.classLock)){element.className=class_name;element.oldClassName=class_name;}};EA.Ä.scroll_page=Ã(params){var dir=params[\"dir\"],shift_pressed=params[\"shift\"];var lines=Á.Â.Ê.split(\"\\n\");var new_pos=0,Æ=0,char_left=0,line_nb=0,curLine=0;var toScrollAmount=_$(\"result\").clientHeight-30;var nbLineToScroll=0,diff=0;if(dir==\"up\"){nbLineToScroll=Math.ceil(toScrollAmount / Á.lineHeight);for(i=Á.É[\"line_start\"];i-diff > Á.É[\"line_start\"]-nbLineToScroll;i--){if(elem=_$('line_'+i)){diff+=Math.floor((elem.offsetHeight-1)/ Á.lineHeight);}}nbLineToScroll-=diff;if(Á.É[\"selec_direction\"]==\"up\"){for(line_nb=0;line_nb< Math.min(Á.É[\"line_start\"]-nbLineToScroll,lines.Æ);line_nb++){new_pos+=lines[line_nb].Æ+1;}char_left=Math.min(lines[Math.min(lines.Æ-1,line_nb)].Æ,Á.É[\"curr_pos\"]-1);if(shift_pressed)Æ=Á.É[\"selectionEnd\"]-new_pos-char_left;Á.area_select(new_pos+char_left,Æ);view=\"top\";}\nelse{view=\"bottom\";for(line_nb=0;line_nb< Math.min(Á.É[\"line_start\"]+Á.É[\"line_nb\"]-1-nbLineToScroll,lines.Æ);line_nb++){new_pos+=lines[line_nb].Æ+1;}char_left=Math.min(lines[Math.min(lines.Æ-1,line_nb)].Æ,Á.É[\"curr_pos\"]-1);if(shift_pressed){start=Math.min(Á.É[\"selectionStart\"],new_pos+char_left);Æ=Math.max(new_pos+char_left,Á.É[\"selectionStart\"])-start;if(new_pos+char_left < Á.É[\"selectionStart\"])view=\"top\";}\nelse start=new_pos+char_left;Á.area_select(start,Æ);}}\nelse{var nbLineToScroll=Math.floor(toScrollAmount / Á.lineHeight);for(i=Á.É[\"line_start\"];i+diff < Á.É[\"line_start\"]+nbLineToScroll;i++){if(elem=_$('line_'+i)){diff+=Math.floor((elem.offsetHeight-1)/ Á.lineHeight);}}nbLineToScroll-=diff;if(Á.É[\"selec_direction\"]==\"down\"){view=\"bottom\";for(line_nb=0;line_nb< Math.min(Á.É[\"line_start\"]+Á.É[\"line_nb\"]-2+nbLineToScroll,lines.Æ);line_nb++){if(line_nb==Á.É[\"line_start\"]-1)char_left=Á.É[\"selectionStart\"]-new_pos;new_pos+=lines[line_nb].Æ+1;}if(shift_pressed){Æ=Math.abs(Á.É[\"selectionStart\"]-new_pos);Æ+=Math.min(lines[Math.min(lines.Æ-1,line_nb)].Æ,Á.É[\"curr_pos\"]);Á.area_select(Math.min(Á.É[\"selectionStart\"],new_pos),Æ);}\nelse{Á.area_select(new_pos+char_left,0);}}\nelse{view=\"top\";for(line_nb=0;line_nb< Math.min(Á.É[\"line_start\"]+nbLineToScroll-1,lines.Æ,lines.Æ);line_nb++){if(line_nb==Á.É[\"line_start\"]-1)char_left=Á.É[\"selectionStart\"]-new_pos;new_pos+=lines[line_nb].Æ+1;}if(shift_pressed){Æ=Math.abs(Á.É[\"selectionEnd\"]-new_pos-char_left);Æ+=Math.min(lines[Math.min(lines.Æ-1,line_nb)].Æ,Á.É[\"curr_pos\"])-char_left-1;Á.area_select(Math.min(Á.É[\"selectionEnd\"],new_pos+char_left),Æ);if(new_pos+char_left > Á.É[\"selectionEnd\"])view=\"bottom\";}\nelse{Á.area_select(new_pos+char_left,0);}}}Á.check_line_selection();Á.scroll_to_view(view);};EA.Ä.start_resize=Ã(e){È.eAL.resize[\"id\"]=eA.id;È.eAL.resize[\"start_x\"]=(e)? e.pageX:event.x+document.body.scrollLeft;È.eAL.resize[\"start_y\"]=(e)? e.pageY:event.y+document.body.scrollTop;if(eA.isIE){eA.Â.focus();eA.getIESelection();}È.eAL.resize[\"selectionStart\"]=eA.Â.selectionStart;È.eAL.resize[\"selectionEnd\"]=eA.Â.selectionEnd;È.eAL.start_resize_area();};EA.Ä.toggle_full_screen=Ã(to){var t=Á,p=È,a=t.Â,html,frame,selStart,selEnd,old,icon;if(typeof(to)==\"undefined\")to=!t.fullscreen['isFull'];old=t.fullscreen['isFull'];t.fullscreen['isFull']=to;icon=_$(\"fullscreen\");selStart=t.Â.selectionStart;selEnd=t.Â.selectionEnd;html=p.document.getElementsByTagName(\"html\")[0];frame=p.document.getElementById(\"frame_\"+t.id);if(to&&to!=old){t.fullscreen['old_overflow']=p.get_css_property(html,\"overflow\");t.fullscreen['old_height']=p.get_css_property(html,\"height\");t.fullscreen['old_width']=p.get_css_property(html,\"width\");t.fullscreen['old_scrollTop']=html.scrollTop;t.fullscreen['old_scrollLeft']=html.scrollLeft;t.fullscreen['old_zIndex']=p.get_css_property(frame,\"z-index\");if(t.isOpera){html.Ç.height=\"100%\";html.Ç.width=\"100%\";}html.Ç.overflow=\"hidden\";html.scrollTop=0;html.scrollLeft=0;frame.Ç.position=\"absolute\";frame.Ç.width=html.clientWidth+\"px\";frame.Ç.height=html.clientHeight+\"px\";frame.Ç.display=\"block\";frame.Ç.zIndex=\"999999\";frame.Ç.top=\"0px\";frame.Ç.left=\"0px\";frame.Ç.top=\"-\"+p.calculeOffsetTop(frame)+\"px\";frame.Ç.left=\"-\"+p.calculeOffsetLeft(frame)+\"px\";t.switchClassSticky(icon,'editAreaButtonSelected',Ì);t.fullscreen['allow_resize']=t.resize_allowed;t.allow_resize(Ì);if(t.isFirefox){p.eAL.execCommand(t.id,\"update_size();\");t.area_select(selStart,selEnd-selStart);t.scroll_to_view();t.focus();}\nelse{setTimeout(\"È.eAL.execCommand('\"+t.id+\"','update_size();');eA.focus();\",10);}}\nelse if(to!=old){frame.Ç.position=\"static\";frame.Ç.zIndex=t.fullscreen['old_zIndex'];if(t.isOpera){html.Ç.height=\"auto\";html.Ç.width=\"auto\";html.Ç.overflow=\"auto\";}\nelse if(t.isIE&&p!=top){html.Ç.overflow=\"auto\";}\nelse{html.Ç.overflow=t.fullscreen['old_overflow'];}html.scrollTop=t.fullscreen['old_scrollTop'];html.scrollLeft=t.fullscreen['old_scrollLeft'];p.eAL.hide(t.id);p.eAL.show(t.id);t.switchClassSticky(icon,'editAreaButtonNormal',Ì);if(t.fullscreen['allow_resize'])t.allow_resize(t.fullscreen['allow_resize']);if(t.isFirefox){t.area_select(selStart,selEnd-selStart);setTimeout(\"eA.scroll_to_view();\",10);}}};EA.Ä.allow_resize=Ã(allow){var resize=_$(\"resize_area\");if(allow){resize.Ç.visibility=\"visible\";È.eAL.add_event(resize,\"mouseup\",eA.start_resize);}\nelse{resize.Ç.visibility=\"hidden\";È.eAL.remove_event(resize,\"mouseup\",eA.start_resize);}Á.resize_allowed=allow;};EA.Ä.change_syntax=Ã(new_syntax,is_waiting){if(new_syntax==Á.Å['syntax'])return Ë;var founded=Ì;for(var i=0;i<Á.syntax_list.Æ;i++){if(Á.syntax_list[i]==new_syntax)founded=Ë;}if(founded==Ë){if(!È.eAL.load_syntax[new_syntax]){if(!is_waiting)È.eAL.load_script(È.eAL.baseURL+\"reg_syntax/\"+new_syntax+\".js\");setTimeout(\"eA.change_syntax('\"+new_syntax+\"',Ë);\",100);Á.show_waiting_screen();}\nelse{if(!Á.allready_used_syntax[new_syntax]){È.eAL.init_syntax_regexp();Á.add_Ç(È.eAL.syntax[new_syntax][\"Çs\"]);Á.allready_used_syntax[new_syntax]=Ë;}var sel=_$(\"syntax_selection\");if(sel&&sel.Ê!=new_syntax){for(var i=0;i<sel.Æ;i++){if(sel.options[i].Ê&&sel.options[i].Ê==new_syntax)sel.options[i].selected=Ë;}}Á.Å['syntax']=new_syntax;Á.resync_highlight(Ë);Á.hide_waiting_screen();return Ë;}}return Ì;};EA.Ä.set_editable=Ã(is_editable){if(is_editable){document.body.className=\"\";Á.Â.readOnly=Ì;Á.is_editable=Ë;}\nelse{document.body.className=\"non_editable\";Á.Â.readOnly=Ë;Á.is_editable=Ì;}if(eAs[Á.id][\"displayed\"]==Ë)Á.update_size();};EA.Ä.toggle_word_wrap=Ã(){Á.set_word_wrap(!Á.Å['word_wrap']);};EA.Ä.set_word_wrap=Ã(to){var t=Á,a=t.Â;if(t.isOpera&&t.isOpera < 9.8){Á.Å['word_wrap']=Ì;t.switchClassSticky(_$(\"word_wrap\"),'editAreaButtonDisabled',Ë);return Ì;}if(to){wrap_mode='soft';Á.container.className+=' word_wrap';Á.container.Ç.width=\"\";Á.content_highlight.Ç.width=\"\";a.Ç.width=\"100%\";if(t.isIE&&t.isIE < 7){a.Ç.width=(a.offsetWidth-5)+\"px\";}t.switchClassSticky(_$(\"word_wrap\"),'editAreaButtonSelected',Ì);}\nelse{wrap_mode='off';Á.container.className=Á.container.className.replace(/word_wrap/g,'');t.switchClassSticky(_$(\"word_wrap\"),'editAreaButtonNormal',Ë);}Á.Â.previous_scrollWidth='';Á.Â.previous_scrollHeight='';a.wrap=wrap_mode;a.setAttribute('wrap',wrap_mode);if(!Á.isIE){var start=a.selectionStart,end=a.selectionEnd;var parNod=a.ÈNode,nxtSib=a.nextSibling;parNod.removeChild(a);parNod.insertBefore(a,nxtSib);Á.area_select(start,end-start);}Á.Å['word_wrap']=to;Á.focus();Á.update_size();Á.check_line_selection();};EA.Ä.open_file=Ã(Å){if(Å['id']!=\"undefined\"){var id=Å['id'];var new_file={};new_file['id']=id;new_file['title']=id;new_file['text']=\"\";new_file['É']=\"\";new_file['last_text_to_highlight']=\"\";new_file['last_hightlighted_text']=\"\";new_file['previous']=[];new_file['next']=[];new_file['last_undo']=\"\";new_file['smooth_selection']=Á.Å['smooth_selection'];new_file['do_highlight']=Á.Å['start_highlight'];new_file['syntax']=Á.Å['syntax'];new_file['scroll_top']=0;new_file['scroll_left']=0;new_file['selection_start']=0;new_file['selection_end']=0;new_file['edited']=Ì;new_file['font_size']=Á.Å[\"font_size\"];new_file['font_family']=Á.Å[\"font_family\"];new_file['word_wrap']=Á.Å[\"word_wrap\"];new_file['toolbar']={'links':{},'selects':{}};new_file['compare_edited_text']=new_file['text'];Á.files[id]=new_file;Á.update_file(id,Å);Á.files[id]['compare_edited_text']=Á.files[id]['text'];var html_id='tab_file_'+encodeURIComponent(id);Á.filesIdAssoc[html_id]=id;Á.files[id]['html_id']=html_id;if(!_$(Á.files[id]['html_id'])&&id!=\"\"){Á.tab_browsing_area.Ç.display=\"block\";var elem=document.createElement('li');elem.id=Á.files[id]['html_id'];var close=\"<img src=\\\"\"+È.eAL.baseURL+\"images/close.gif\\\" title=\\\"\"+Á.get_translation('close_tab','word')+\"\\\" onclick=\\\"eA.execCommand('close_file',eA.filesIdAssoc['\"+html_id+\"']);return Ì;\\\" class=\\\"hidden\\\" onmouseover=\\\"Á.className=''\\\" onmouseout=\\\"Á.className='hidden'\\\" />\";elem.innerHTML=\"<a onclick=\\\"javascript:eA.execCommand('switch_to_file',eA.filesIdAssoc['\"+html_id+\"']);\\\" selec=\\\"none\\\"><b><span><strong class=\\\"edited\\\">*</strong>\"+Á.files[id]['title']+close+\"</span></b></a>\";_$('tab_browsing_list').appendChild(elem);var elem=document.createElement('text');Á.update_size();}if(id!=\"\")Á.execCommand('file_open',Á.files[id]);Á.switch_to_file(id,Ë);return Ë;}\nelse return Ì;};EA.Ä.close_file=Ã(id){if(Á.files[id]){Á.save_file(id);if(Á.execCommand('file_close',Á.files[id])!==Ì){var li=_$(Á.files[id]['html_id']);li.ÈNode.removeChild(li);if(id==Á.curr_file){var next_file=\"\";var is_next=Ì;for(var i in Á.files){if(is_next){next_file=i;break;}\nelse if(i==id)is_next=Ë;\nelse next_file=i;}Á.switch_to_file(next_file);}delete(Á.files[id]);Á.update_size();}}};EA.Ä.save_file=Ã(id){var t=Á,save,a_links,a_selects,save_butt,img,i;if(t.files[id]){var save=t.files[id];save['É']=t.É;save['last_text_to_highlight']=t.last_text_to_highlight;save['last_hightlighted_text']=t.last_hightlighted_text;save['previous']=t.previous;save['next']=t.next;save['last_undo']=t.last_undo;save['smooth_selection']=t.smooth_selection;save['do_highlight']=t.do_highlight;save['syntax']=t.Å['syntax'];save['text']=t.Â.Ê;save['scroll_top']=t.result.scrollTop;save['scroll_left']=t.result.scrollLeft;save['selection_start']=t.É[\"selectionStart\"];save['selection_end']=t.É[\"selectionEnd\"];save['font_size']=t.Å[\"font_size\"];save['font_family']=t.Å[\"font_family\"];save['word_wrap']=t.Å[\"word_wrap\"];save['toolbar']={'links':{},'selects':{}};a_links=_$(\"toolbar_1\").getElementsByTagName(\"a\");for(i=0;i<a_links.Æ;i++){if(a_links[i].getAttribute('fileSpecific')=='yes'){save_butt={};img=a_links[i].getElementsByTagName('img')[0];save_butt['classLock']=img.classLock;save_butt['className']=img.className;save_butt['oldClassName']=img.oldClassName;save['toolbar']['links'][a_links[i].id]=save_butt;}}a_selects=_$(\"toolbar_1\").getElementsByTagName(\"select\");for(i=0;i<a_selects.Æ;i++){if(a_selects[i].getAttribute('fileSpecific')=='yes'){save['toolbar']['selects'][a_selects[i].id]=a_selects[i].Ê;}}t.files[id]=save;return save;}return Ì;};EA.Ä.update_file=Ã(id,new_Ês){for(var i in new_Ês){Á.files[id][i]=new_Ês[i];}};EA.Ä.display_file=Ã(id){var t=Á,a=t.Â,new_file,a_lis,a_selects,a_links,a_options,i,j;if(id==''){a.readOnly=Ë;t.tab_browsing_area.Ç.display=\"none\";_$(\"no_file_selected\").Ç.display=\"block\";t.result.className=\"empty\";if(!t.files['']){t.open_file({id:''});}}\nelse if(typeof(t.files[id])=='undefined'){return Ì;}\nelse{t.result.className=\"\";a.readOnly=!t.is_editable;_$(\"no_file_selected\").Ç.display=\"none\";t.tab_browsing_area.Ç.display=\"block\";}t.check_redo(Ë);t.check_undo(Ë);t.curr_file=id;a_lis=t.tab_browsing_area.getElementsByTagName('li');for(i=0;i<a_lis.Æ;i++){if(a_lis[i].id==t.files[id]['html_id'])a_lis[i].className='selected';\nelse a_lis[i].className='';}new_file=t.files[id];a.Ê=new_file['text'];t.set_font(new_file['font_family'],new_file['font_size']);t.area_select(new_file['selection_start'],new_file['selection_end']-new_file['selection_start']);t.manage_size(Ë);t.result.scrollTop=new_file['scroll_top'];t.result.scrollLeft=new_file['scroll_left'];t.previous=new_file['previous'];t.next=new_file['next'];t.last_undo=new_file['last_undo'];t.check_redo(Ë);t.check_undo(Ë);t.execCommand(\"change_highlight\",new_file['do_highlight']);t.execCommand(\"change_syntax\",new_file['syntax']);t.execCommand(\"change_smooth_selection_mode\",new_file['smooth_selection']);t.execCommand(\"set_word_wrap\",new_file['word_wrap']);a_links=new_file['toolbar']['links'];for(i in a_links){if(img=_$(i).getElementsByTagName('img')[0]){img.classLock=a_links[i]['classLock'];img.className=a_links[i]['className'];img.oldClassName=a_links[i]['oldClassName'];}}a_selects=new_file['toolbar']['selects'];for(i in a_selects){a_options=_$(i).options;for(j=0;j<a_options.Æ;j++){if(a_options[j].Ê==a_selects[i])_$(i).options[j].selected=Ë;}}};EA.Ä.switch_to_file=Ã(file_to_show,force_refresh){if(file_to_show!=Á.curr_file||force_refresh){Á.save_file(Á.curr_file);if(Á.curr_file!='')Á.execCommand('file_switch_off',Á.files[Á.curr_file]);Á.display_file(file_to_show);if(file_to_show!='')Á.execCommand('file_switch_on',Á.files[file_to_show]);}};EA.Ä.get_file=Ã(id){if(id==Á.curr_file)Á.save_file(id);return Á.files[id];};EA.Ä.get_all_files=Ã(){tmp_files=Á.files;Á.save_file(Á.curr_file);if(tmp_files[''])delete(Á.files['']);return tmp_files;};EA.Ä.check_file_changes=Ã(){var id=Á.curr_file;if(Á.files[id]&&Á.files[id]['compare_edited_text']!=undefined){if(Á.files[id]['compare_edited_text'].Æ==Á.Â.Ê.Æ&&Á.files[id]['compare_edited_text']==Á.Â.Ê){if(Á.files[id]['edited']!=Ì)Á.set_file_edited_mode(id,Ì);}\nelse{if(Á.files[id]['edited']!=Ë)Á.set_file_edited_mode(id,Ë);}}};EA.Ä.set_file_edited_mode=Ã(id,to){if(Á.files[id]&&_$(Á.files[id]['html_id'])){var link=_$(Á.files[id]['html_id']).getElementsByTagName('a')[0];if(to==Ë){link.className='edited';}\nelse{link.className='';if(id==Á.curr_file)text=Á.Â.Ê;\nelse text=Á.files[id]['text'];Á.files[id]['compare_edited_text']=text;}Á.files[id]['edited']=to;}};EA.Ä.set_show_line_colors=Ã(new_Ê){Á.show_line_colors=new_Ê;if(new_Ê)Á.selection_field.className+=' show_colors';\nelse Á.selection_field.className=Á.selection_field.className.replace(/ show_colors/g,'');};var EA_keys={8:\"Retour arriere\",9:\"Tabulation\",12:\"Milieu(pave numerique)\",13:\"Entrer\",16:\"Shift\",17:\"Ctrl\",18:\"Alt\",19:\"Pause\",20:\"Verr Maj\",27:\"Esc\",32:\"Space\",33:\"Page up\",34:\"Page down\",35:\"End\",36:\"Begin\",37:\"Left\",38:\"Up\",39:\"Right\",40:\"Down\",44:\"Impr ecran\",45:\"Inser\",46:\"Suppr\",91:\"Menu Demarrer Windows / touche pomme Mac\",92:\"Menu Demarrer Windows\",93:\"Menu contextuel Windows\",112:\"F1\",113:\"F2\",114:\"F3\",115:\"F4\",116:\"F5\",117:\"F6\",118:\"F7\",119:\"F8\",120:\"F9\",121:\"F10\",122:\"F11\",123:\"F12\",144:\"Verr Num\",145:\"Arret defil\"};Ã keyDown(e){if(!e){e=event;}for(var i in eA.plugins){if(typeof(eA.plugins[i].onkeydown)==\"Ã\"){if(eA.plugins[i].onkeydown(e)===Ì){if(eA.isIE)e.keyCode=0;return Ì;}}}var target_id=(e.target||e.srcElement).id;var use=Ì;if(EA_keys[e.keyCode])letter=EA_keys[e.keyCode];\nelse letter=String.fromCharCode(e.keyCode);var low_letter=letter.toLowerCase();if(letter==\"Page up\"&&!AltPressed(e)&&!eA.isOpera){eA.execCommand(\"scroll_page\",{\"dir\":\"up\",\"shift\":ShiftPressed(e)});use=Ë;}\nelse if(letter==\"Page down\"&&!AltPressed(e)&&!eA.isOpera){eA.execCommand(\"scroll_page\",{\"dir\":\"down\",\"shift\":ShiftPressed(e)});use=Ë;}\nelse if(eA.is_editable==Ì){return Ë;}\nelse if(letter==\"Tabulation\"&&target_id==\"Â\"&&!CtrlPressed(e)&&!AltPressed(e)){if(ShiftPressed(e))eA.execCommand(\"invert_tab_selection\");\nelse eA.execCommand(\"tab_selection\");use=Ë;if(eA.isOpera||(eA.isFirefox&&eA.isMac))setTimeout(\"eA.execCommand('focus');\",1);}\nelse if(letter==\"Entrer\"&&target_id==\"Â\"){if(eA.press_enter())use=Ë;}\nelse if(letter==\"Entrer\"&&target_id==\"area_search\"){eA.execCommand(\"area_search\");use=Ë;}\nelse if(letter==\"Esc\"){eA.execCommand(\"close_all_inline_popup\",e);use=Ë;}\nelse if(CtrlPressed(e)&&!AltPressed(e)&&!ShiftPressed(e)){switch(low_letter){case \"f\":eA.execCommand(\"area_search\");use=Ë;break;case \"r\":eA.execCommand(\"area_replace\");use=Ë;break;case \"q\":eA.execCommand(\"close_all_inline_popup\",e);use=Ë;break;case \"h\":eA.execCommand(\"change_highlight\");use=Ë;break;case \"g\":setTimeout(\"eA.execCommand('go_to_line');\",5);use=Ë;break;case \"e\":eA.execCommand(\"show_help\");use=Ë;break;case \"z\":use=Ë;eA.execCommand(\"undo\");break;case \"y\":use=Ë;eA.execCommand(\"redo\");break;default:break;}}if(eA.next.Æ > 0){setTimeout(\"eA.check_redo();\",10);}setTimeout(\"eA.check_file_changes();\",10);if(use){if(eA.isIE)e.keyCode=0;return Ì;}return Ë;};Ã AltPressed(e){if(window.event){return(window.event.altKey);}\nelse{if(e.modifiers)return(e.altKey||(e.modifiers % 2));\nelse return e.altKey;}};Ã CtrlPressed(e){if(window.event){return(window.event.ctrlKey);}\nelse{return(e.ctrlKey||(e.modifiers==2)||(e.modifiers==3)||(e.modifiers>5));}};Ã ShiftPressed(e){if(window.event){return(window.event.shiftKey);}\nelse{return(e.shiftKey||(e.modifiers>3));}}; EA.Ä.show_search=Ã(){if(_$(\"area_search_replace\").Ç.visibility==\"visible\"){Á.hidden_search();}\nelse{Á.open_inline_popup(\"area_search_replace\");var text=Á.area_get_selection();var search=text.split(\"\\n\")[0];_$(\"area_search\").Ê=search;_$(\"area_search\").focus();}};EA.Ä.hidden_search=Ã(){Á.close_inline_popup(\"area_search_replace\");};EA.Ä.area_search=Ã(mode){if(!mode)mode=\"search\";_$(\"area_search_msg\").innerHTML=\"\";var search=_$(\"area_search\").Ê;Á.Â.focus();Á.Â.ÂFocused=Ë;var infos=Á.get_selection_infos();var start=infos[\"selectionStart\"];var pos=-1;var pos_begin=-1;var Æ=search.Æ;if(_$(\"area_search_replace\").Ç.visibility!=\"visible\"){Á.show_search();return;}if(search.Æ==0){_$(\"area_search_msg\").innerHTML=Á.get_translation(\"search_field_empty\");return;}if(mode!=\"replace\"){if(_$(\"area_search_reg_exp\").checked)start++;\nelse start+=search.Æ;}if(_$(\"area_search_reg_exp\").checked){var opt=\"m\";if(!_$(\"area_search_match_case\").checked)opt+=\"i\";var reg=new RegExp(search,opt);pos=infos[\"full_text\"].substr(start).search(reg);pos_begin=infos[\"full_text\"].search(reg);if(pos!=-1){pos+=start;Æ=infos[\"full_text\"].substr(start).match(reg)[0].Æ;}\nelse if(pos_begin!=-1){Æ=infos[\"full_text\"].match(reg)[0].Æ;}}\nelse{if(_$(\"area_search_match_case\").checked){pos=infos[\"full_text\"].indexOf(search,start);pos_begin=infos[\"full_text\"].indexOf(search);}\nelse{pos=infos[\"full_text\"].toLowerCase().indexOf(search.toLowerCase(),start);pos_begin=infos[\"full_text\"].toLowerCase().indexOf(search.toLowerCase());}}if(pos==-1&&pos_begin==-1){_$(\"area_search_msg\").innerHTML=\"<strong>\"+search+\"</strong> \"+Á.get_translation(\"not_found\");return;}\nelse if(pos==-1&&pos_begin !=-1){begin=pos_begin;_$(\"area_search_msg\").innerHTML=Á.get_translation(\"restart_search_at_begin\");}\nelse begin=pos;if(mode==\"replace\"&&pos==infos[\"indexOfCursor\"]){var replace=_$(\"area_replace\").Ê;var new_text=\"\";if(_$(\"area_search_reg_exp\").checked){var opt=\"m\";if(!_$(\"area_search_match_case\").checked)opt+=\"i\";var reg=new RegExp(search,opt);new_text=infos[\"full_text\"].substr(0,begin)+infos[\"full_text\"].substr(start).replace(reg,replace);}\nelse{new_text=infos[\"full_text\"].substr(0,begin)+replace+infos[\"full_text\"].substr(begin+Æ);}Á.Â.Ê=new_text;Á.area_select(begin,Æ);Á.area_search();}\nelse Á.area_select(begin,Æ);};EA.Ä.area_replace=Ã(){Á.area_search(\"replace\");};EA.Ä.area_replace_all=Ã(){var base_text=Á.Â.Ê;var search=_$(\"area_search\").Ê;var replace=_$(\"area_replace\").Ê;if(search.Æ==0){_$(\"area_search_msg\").innerHTML=Á.get_translation(\"search_field_empty\");return;}var new_text=\"\";var nb_change=0;if(_$(\"area_search_reg_exp\").checked){var opt=\"mg\";if(!_$(\"area_search_match_case\").checked)opt+=\"i\";var reg=new RegExp(search,opt);nb_change=infos[\"full_text\"].match(reg).Æ;new_text=infos[\"full_text\"].replace(reg,replace);}\nelse{if(_$(\"area_search_match_case\").checked){var tmp_tab=base_text.split(search);nb_change=tmp_tab.Æ-1;new_text=tmp_tab.join(replace);}\nelse{var lower_Ê=base_text.toLowerCase();var lower_search=search.toLowerCase();var start=0;var pos=lower_Ê.indexOf(lower_search);while(pos!=-1){nb_change++;new_text+=Á.Â.Ê.substring(start,pos)+replace;start=pos+search.Æ;pos=lower_Ê.indexOf(lower_search,pos+1);}new_text+=Á.Â.Ê.substring(start);}}if(new_text==base_text){_$(\"area_search_msg\").innerHTML=\"<strong>\"+search+\"</strong> \"+Á.get_translation(\"not_found\");}\nelse{Á.Â.Ê=new_text;_$(\"area_search_msg\").innerHTML=\"<strong>\"+nb_change+\"</strong> \"+Á.get_translation(\"occurrence_replaced\");setTimeout(\"eA.Â.focus();eA.Â.ÂFocused=Ë;\",100);}}; EA.Ä.change_highlight=Ã(change_to){if(Á.Å[\"syntax\"].Æ==0&&change_to==Ì){Á.switchClassSticky(_$(\"highlight\"),'editAreaButtonDisabled',Ë);Á.switchClassSticky(_$(\"reset_highlight\"),'editAreaButtonDisabled',Ë);return Ì;}if(Á.do_highlight==change_to)return Ì;Á.getIESelection();var pos_start=Á.Â.selectionStart;var pos_end=Á.Â.selectionEnd;if(Á.do_highlight===Ë||change_to==Ì)Á.disable_highlight();\nelse Á.enable_highlight();Á.Â.focus();Á.Â.selectionStart=pos_start;Á.Â.selectionEnd=pos_end;Á.setIESelection();};EA.Ä.disable_highlight=Ã(displayOnly){var t=Á,a=t.Â,new_Obj,old_class,new_class;t.selection_field.innerHTML=\"\";t.selection_field_text.innerHTML=\"\";t.content_highlight.Ç.visibility=\"hidden\";new_Obj=t.content_highlight.cloneNode(Ì);new_Obj.innerHTML=\"\";t.content_highlight.ÈNode.insertBefore(new_Obj,t.content_highlight);t.content_highlight.ÈNode.removeChild(t.content_highlight);t.content_highlight=new_Obj;old_class=È.getAttribute(a,\"class\");if(old_class){new_class=old_class.replace(\"hidden\",\"\");È.setAttribute(a,\"class\",new_class);}a.Ç.backgroundColor=\"transÈ\";t.switchClassSticky(_$(\"highlight\"),'editAreaButtonNormal',Ë);t.switchClassSticky(_$(\"reset_highlight\"),'editAreaButtonDisabled',Ë);t.do_highlight=Ì;t.switchClassSticky(_$(\"change_smooth_selection\"),'editAreaButtonSelected',Ë);if(typeof(t.smooth_selection_before_highlight)!=\"undefined\"&&t.smooth_selection_before_highlight===Ì){t.change_smooth_selection_mode(Ì);}};EA.Ä.enable_highlight=Ã(){var t=Á,a=t.Â,new_class;t.show_waiting_screen();t.content_highlight.Ç.visibility=\"visible\";new_class=È.getAttribute(a,\"class\")+\" hidden\";È.setAttribute(a,\"class\",new_class);if(t.isIE)a.Ç.backgroundColor=\"#FFFFFF\";t.switchClassSticky(_$(\"highlight\"),'editAreaButtonSelected',Ì);t.switchClassSticky(_$(\"reset_highlight\"),'editAreaButtonNormal',Ì);t.smooth_selection_before_highlight=t.smooth_selection;if(!t.smooth_selection)t.change_smooth_selection_mode(Ë);t.switchClassSticky(_$(\"change_smooth_selection\"),'editAreaButtonDisabled',Ë);t.do_highlight=Ë;t.resync_highlight();t.hide_waiting_screen();};EA.Ä.maj_highlight=Ã(infos){var debug_opti=\"\",tps_start=new Date().getTime(),tps_middle_opti=new Date().getTime();var t=Á,hightlighted_text,updated_highlight;var textToHighlight=infos[\"full_text\"],doSyntaxOpti=Ì,doHtmlOpti=Ì,stay_begin=\"\",stay_end=\"\",trace_new,trace_last;if(t.last_text_to_highlight==infos[\"full_text\"]&&t.resync_highlight!==Ë)return;if(t.reload_highlight===Ë){t.reload_highlight=Ì;}\nelse if(textToHighlight.Æ==0){textToHighlight=\"\\n \";}\nelse{changes=t.checkTextEvolution(t.last_text_to_highlight,textToHighlight);trace_new=t.get_syntax_trace(changes.newTextLine).replace(/\\r/g,'');trace_last=t.get_syntax_trace(changes.lastTextLine).replace(/\\r/g,'');doSyntaxOpti=(trace_new==trace_last);if(!doSyntaxOpti&&trace_new==\"\\n\"+trace_last&&/^[ \t\s]*\\n[ \t\s]*$/.test(changes.newText.replace(/\\r/g,''))&&changes.lastText==\"\"){doSyntaxOpti=Ë;}if(doSyntaxOpti){tps_middle_opti=new Date().getTime();stay_begin=t.last_hightlighted_text.split(\"\\n\").slice(0,changes.lineStart).join(\"\\n\");if(changes.lineStart>0)stay_begin+=\"\\n\";stay_end=t.last_hightlighted_text.split(\"\\n\").slice(changes.lineLastEnd+1).join(\"\\n\");if(stay_end.Æ>0)stay_end=\"\\n\"+stay_end;if(stay_begin.split('<span').Æ !=stay_begin.split('</span').Æ||stay_end.split('<span').Æ !=stay_end.split('</span').Æ){doSyntaxOpti=Ì;stay_end='';stay_begin='';}\nelse{if(stay_begin.Æ==0&&changes.posLastEnd==-1)changes.newTextLine+=\"\\n\";textToHighlight=changes.newTextLine;}}if(t.Å[\"debug\"]){var ch=changes;debug_opti=(doSyntaxOpti?\"Optimisation\":\"No optimisation\")+\" start:\"+ch.posStart+\"(\"+ch.lineStart+\")\"+\" end_new:\"+ch.posNewEnd+\"(\"+ch.lineNewEnd+\")\"+\" end_last:\"+ch.posLastEnd+\"(\"+ch.lineLastEnd+\")\"+\"\\nchanged_text:\"+ch.newText+\"=> trace:\"+trace_new+\"\\nchanged_last_text:\"+ch.lastText+\"=> trace:\"+trace_last+\"\\nchanged_line:\"+ch.newTextLine+\"\\nlast_changed_line:\"+ch.lastTextLine+\"\\nstay_begin:\"+stay_begin.slice(-100)+\"\\nstay_end:\"+stay_end.substr(0,100);+\"\\n\";}}tps_end_opti=new Date().getTime();updated_highlight=t.colorize_text(textToHighlight);tpsAfterReg=new Date().getTime();doSyntaxOpti=doHtmlOpti=Ì;if(doSyntaxOpti){try{var replacedBloc,i,nbStart='',nbEnd='',newHtml,ÆOld,ÆNew;replacedBloc=t.last_hightlighted_text.substring(stay_begin.Æ,t.last_hightlighted_text.Æ-stay_end.Æ);ÆOld=replacedBloc.Æ;ÆNew=updated_highlight.Æ;for(i=0;i < ÆOld&&i < ÆNew&&replacedBloc.charAt(i)==updated_highlight.charAt(i);i++){}nbStart=i;for(i=0;i+nbStart < ÆOld&&i+nbStart < ÆNew&&replacedBloc.charAt(ÆOld-i-1)==updated_highlight.charAt(ÆNew-i-1);i++){}nbEnd=i;lastHtml=replacedBloc.substring(nbStart,ÆOld-nbEnd);newHtml=updated_highlight.substring(nbStart,ÆNew-nbEnd);if(newHtml.indexOf('<span')==-1&&newHtml.indexOf('</span')==-1&&lastHtml.indexOf('<span')==-1&&lastHtml.indexOf('</span')==-1){var beginStr,nbOpendedSpan,nbClosedSpan,nbUnchangedChars,span,textNode;doHtmlOpti=Ë;beginStr=t.last_hightlighted_text.substr(0,stay_begin.Æ+nbStart);newHtml=newHtml.replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&amp;/g,'&');nbOpendedSpan=beginStr.split('<span').Æ-1;nbClosedSpan=beginStr.split('</span').Æ-1;span=t.content_highlight.getElementsByTagName('span')[ nbOpendedSpan ];ÈSpan=span;maxStartOffset=maxEndOffset=0;if(nbOpendedSpan==nbClosedSpan){while(ÈSpan.ÈNode !=t.content_highlight&&ÈSpan.ÈNode.tagName !='PRE'){ÈSpan=ÈSpan.ÈNode;}}\nelse{maxStartOffset=maxEndOffset=beginStr.Æ+1;nbClosed=beginStr.substr(Math.max(0,beginStr.lastIndexOf('<span',maxStartOffset-1))).split('</span').Æ-1;while(nbClosed > 0){nbClosed--;ÈSpan=ÈSpan.ÈNode;}while(ÈSpan.ÈNode !=t.content_highlight&&ÈSpan.ÈNode.tagName !='PRE'&&(tmpMaxStartOffset=Math.max(0,beginStr.lastIndexOf('<span',maxStartOffset-1)))<(tmpMaxEndOffset=Math.max(0,beginStr.lastIndexOf('</span',maxEndOffset-1)))){maxStartOffset=tmpMaxStartOffset;maxEndOffset=tmpMaxEndOffset;}}if(ÈSpan.ÈNode==t.content_highlight||ÈSpan.ÈNode.tagName=='PRE'){maxStartOffset=Math.max(0,beginStr.indexOf('<span'));}if(maxStartOffset==beginStr.Æ){nbSubSpanBefore=0;}\nelse{lastEndPos=Math.max(0,beginStr.lastIndexOf('>',maxStartOffset));nbSubSpanBefore=beginStr.substr(lastEndPos).split('<span').Æ-1;}if(nbSubSpanBefore==0){textNode=ÈSpan.firstChild;}\nelse{lastSubSpan=ÈSpan.getElementsByTagName('span')[ nbSubSpanBefore-1 ];while(lastSubSpan.ÈNode !=ÈSpan){lastSubSpan=lastSubSpan.ÈNode;}if(lastSubSpan.nextSibling==null||lastSubSpan.nextSibling.nodeType !=3){textNode=document.createTextNode('');lastSubSpan.ÈNode.insertBefore(textNode,lastSubSpan.nextSibling);}\nelse{textNode=lastSubSpan.nextSibling;}}if((lastIndex=beginStr.lastIndexOf('>'))==-1){nbUnchangedChars=beginStr.Æ;}\nelse{nbUnchangedChars=beginStr.substr(lastIndex+1).replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&amp;/g,'&').Æ;}if(t.isIE){nbUnchangedChars-=(beginStr.substr(beginStr.Æ-nbUnchangedChars).split(\"\\n\").Æ-1);textNode.replaceData(nbUnchangedChars,lastHtml.replace(/\\n/g,'').Æ,newHtml.replace(/\\n/g,''));}\nelse{textNode.replaceData(nbUnchangedChars,lastHtml.Æ,newHtml);}}}catch(e){doHtmlOpti=Ì;}}tpsAfterOpti2=new Date().getTime();hightlighted_text=stay_begin+updated_highlight+stay_end;if(!doHtmlOpti){var new_Obj=t.content_highlight.cloneNode(Ì);if((t.isIE&&t.isIE < 8)||(t.isOpera&&t.isOpera < 9.6))new_Obj.innerHTML=\"<pre><span class='\"+t.Å[\"syntax\"]+\"'>\"+hightlighted_text+\"</span></pre>\";\nelse new_Obj.innerHTML=\"<span class='\"+t.Å[\"syntax\"]+\"'>\"+hightlighted_text+\"</span>\";t.content_highlight.ÈNode.replaceChild(new_Obj,t.content_highlight);t.content_highlight=new_Obj;}t.last_text_to_highlight=infos[\"full_text\"];t.last_hightlighted_text=hightlighted_text;tps3=new Date().getTime();if(t.Å[\"debug\"]){t.debug.Ê=\"Tps optimisation \"+(tps_end_opti-tps_start)+\" | tps reg exp:\"+(tpsAfterReg-tps_end_opti)+\" | tps opti HTML:\"+(tpsAfterOpti2-tpsAfterReg)+' '+(doHtmlOpti ? 'yes':'no')+\" | tps update highlight content:\"+(tps3-tpsAfterOpti2)+\" | tpsTotal:\"+(tps3-tps_start)+\"(\"+tps3+\")\\n\"+debug_opti;}};EA.Ä.resync_highlight=Ã(reload_now){Á.reload_highlight=Ë;Á.last_text_to_highlight=\"\";Á.focus();if(reload_now)Á.check_line_selection(Ì);}; EA.Ä.comment_or_quote=Ã(){var new_class=\"\",close_tag=\"\",sy,arg,i;sy=È.eAL.syntax[eA.current_code_lang];arg=EA.Ä.comment_or_quote.arguments[0];for(i in sy[\"quotes\"]){if(arg.indexOf(i)==0){new_class=\"quotesmarks\";close_tag=sy[\"quotes\"][i];}}if(new_class.Æ==0){for(var i in sy[\"comments\"]){if(arg.indexOf(i)==0){new_class=\"comments\";close_tag=sy[\"comments\"][i];}}}if(close_tag==\"\\n\"){return \"µ__\"+new_class+\"__µ\"+arg.replace(/(\\r?\\n)?$/m,\"µ_END_µ$1\");}\nelse{reg=new RegExp(È.eAL.get_escaped_regexp(close_tag)+\"$\",\"m\");if(arg.search(reg)!=-1)return \"µ__\"+new_class+\"__µ\"+arg+\"µ_END_µ\";\nelse return \"µ__\"+new_class+\"__µ\"+arg;}};EA.Ä.get_syntax_trace=Ã(text){if(Á.Å[\"syntax\"].Æ>0&&È.eAL.syntax[Á.Å[\"syntax\"]][\"syntax_trace_regexp\"])return text.replace(È.eAL.syntax[Á.Å[\"syntax\"]][\"syntax_trace_regexp\"],\"$3\");};EA.Ä.colorize_text=Ã(text){text=\" \"+text;if(Á.Å[\"syntax\"].Æ>0)text=Á.apply_syntax(text,Á.Å[\"syntax\"]);return text.substr(1).replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/µ_END_µ/g,\"</span>\").replace(/µ__([a-zA-Z0-9]+)__µ/g,\"<span class='$1'>\");};EA.Ä.apply_syntax=Ã(text,lang){var sy;Á.current_code_lang=lang;if(!È.eAL.syntax[lang])return text;sy=È.eAL.syntax[lang];if(sy[\"custom_regexp\"]['before']){for(var i in sy[\"custom_regexp\"]['before']){var convert=\"$1µ__\"+sy[\"custom_regexp\"]['before'][i]['class']+\"__µ$2µ_END_µ$3\";text=text.replace(sy[\"custom_regexp\"]['before'][i]['regexp'],convert);}}if(sy[\"comment_or_quote_reg_exp\"]){text=text.replace(sy[\"comment_or_quote_reg_exp\"],Á.comment_or_quote);}if(sy[\"keywords_reg_exp\"]){for(var i in sy[\"keywords_reg_exp\"]){text=text.replace(sy[\"keywords_reg_exp\"][i],'µ__'+i+'__µ$2µ_END_µ');}}if(sy[\"delimiters_reg_exp\"]){text=text.replace(sy[\"delimiters_reg_exp\"],'µ__delimiters__µ$1µ_END_µ');}if(sy[\"operators_reg_exp\"]){text=text.replace(sy[\"operators_reg_exp\"],'µ__operators__µ$1µ_END_µ');}if(sy[\"custom_regexp\"]['after']){for(var i in sy[\"custom_regexp\"]['after']){var convert=\"$1µ__\"+sy[\"custom_regexp\"]['after'][i]['class']+\"__µ$2µ_END_µ$3\";text=text.replace(sy[\"custom_regexp\"]['after'][i]['regexp'],convert);}}return text;};var editArea= eA;EditArea=EA;</script>".replace(/Á/g,'this').replace(/Â/g,'textarea').replace(/Ã/g,'function').replace(/Ä/g,'prototype').replace(/Å/g,'settings').replace(/Æ/g,'length').replace(/Ç/g,'style').replace(/È/g,'parent').replace(/É/g,'last_selection').replace(/Ê/g,'value').replace(/Ë/g,'true').replace(/Ì/g,'false');
37
- editAreaLoader.template= "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\"> <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" > <head> <title>EditArea</title> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /> <meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7\"/> [__CSSRULES__] [__JSCODE__] </head> <body> <div id='editor'> <div class='area_toolbar' id='toolbar_1'>[__TOOLBAR__]</div> <div class='area_toolbar' id='tab_browsing_area'><ul id='tab_browsing_list' class='menu'> <li> </li> </ul></div> <div id='result'> <div id='no_file_selected'></div> <div id='container'> <div id='cursor_pos' class='edit_area_cursor'>&nbsp;</div> <div id='end_bracket' class='edit_area_cursor'>&nbsp;</div> <div id='selection_field'></div> <div id='line_number' selec='none'></div> <div id='content_highlight'></div> <div id='test_font_size'></div> <div id='selection_field_text'></div> <textarea id='textarea' wrap='off' onchange='editArea.execCommand(\"onchange\");' onfocus='javascript:editArea.textareaFocused=true;' onblur='javascript:editArea.textareaFocused=false;'> </textarea> </div> </div> <div class='area_toolbar' id='toolbar_2'> <table class='statusbar' cellspacing='0' cellpadding='0'> <tr> <td class='total' selec='none'>{$position}:</td> <td class='infos' selec='none'> {$line_abbr} <span id='linePos'>0</span>, {$char_abbr} <span id='currPos'>0</span> </td> <td class='total' selec='none'>{$total}:</td> <td class='infos' selec='none'> {$line_abbr} <span id='nbLine'>0</span>, {$char_abbr} <span id='nbChar'>0</span> </td> <td class='resize'> <span id='resize_area'><img src='[__BASEURL__]images/statusbar_resize.gif' alt='resize' selec='none'></span> </td> </tr> </table> </div> </div> <div id='processing'> <div id='processing_text'> {$processing} </div> </div> <div id='area_search_replace' class='editarea_popup'> <table cellspacing='2' cellpadding='0' style='width: 100%'> <tr> <td selec='none'>{$search}</td> <td><input type='text' id='area_search' /></td> <td id='close_area_search_replace'> <a onclick='Javascript:editArea.execCommand(\"hidden_search\")'><img selec='none' src='[__BASEURL__]images/close.gif' alt='{$close_popup}' title='{$close_popup}' /></a><br /> </tr><tr> <td selec='none'>{$replace}</td> <td><input type='text' id='area_replace' /></td> <td><img id='move_area_search_replace' onmousedown='return parent.start_move_element(event,\"area_search_replace\", parent.frames[\"frame_\"+editArea.id]);' src='[__BASEURL__]images/move.gif' alt='{$move_popup}' title='{$move_popup}' /></td> </tr> </table> <div class='button'> <input type='checkbox' id='area_search_match_case' /><label for='area_search_match_case' selec='none'>{$match_case}</label> <input type='checkbox' id='area_search_reg_exp' /><label for='area_search_reg_exp' selec='none'>{$reg_exp}</label> <br /> <a onclick='Javascript:editArea.execCommand(\"area_search\")' selec='none'>{$find_next}</a> <a onclick='Javascript:editArea.execCommand(\"area_replace\")' selec='none'>{$replace}</a> <a onclick='Javascript:editArea.execCommand(\"area_replace_all\")' selec='none'>{$replace_all}</a><br /> </div> <div id='area_search_msg' selec='none'></div> </div> <div id='edit_area_help' class='editarea_popup'> <div class='close_popup'> <a onclick='Javascript:editArea.execCommand(\"close_all_inline_popup\")'><img src='[__BASEURL__]images/close.gif' alt='{$close_popup}' title='{$close_popup}' /></a> </div> <div><h3>Editarea [__EA_VERSION__] by <a href=\"http://www.cdolivet.com/index.php?page=editArea\" target=\"_blank\">Christophe Dolivet</a></h3><br /> <h3>{$shortcuts}:</h3> {$tab}: {$add_tab}<br /> {$shift}+{$tab}: {$remove_tab}<br /> {$ctrl}+f: {$search_command}<br /> {$ctrl}+r: {$replace_command}<br /> {$ctrl}+h: {$highlight}<br /> {$ctrl}+g: {$go_to_line}<br /> {$ctrl}+z: {$undo}<br /> {$ctrl}+y: {$redo}<br /> {$ctrl}+e: {$help}<br /> {$ctrl}+q, {$esc}: {$close_popup}<br /> {$accesskey} E: {$toggle}<br /> <br /> <em>{$about_notice}</em> <br /><div class='copyright'>&copy; Christophe Dolivet 2007-2010</div> </div> </div> </body> </html> ";
38
- editAreaLoader.iframe_css= "<style>body,html{margin:0;padding:0;height:100%;border:none;overflow:hidden;background-color:#FFF;}body,html,table,form,textarea{font:12px monospace,sans-serif;}#editor{border:solid #888 1px;overflow:hidden;}#result{z-index:4;overflow-x:auto;overflow-y:scroll;border-top:solid #888 1px;border-bottom:solid #888 1px;position:relative;clear:both;}#result.empty{overflow:hidden;}#container{overflow:hidden;border:solid blue 0;position:relative;z-index:10;padding:0 5px 0 45px;}#textarea{position:relative;top:0;left:0;margin:0;padding:0;width:100%;height:100%;overflow:hidden;z-index:7;border-width:0;background-color:transparent;resize:none;}#textarea,#textarea:hover{outline:none;}#content_highlight{white-space:pre;margin:0;padding:0;position:absolute;z-index:4;overflow:visible;}#selection_field,#selection_field_text{margin:0;background-color:#E1F2F9;position:absolute;z-index:5;top:-100px;padding:0;white-space:pre;overflow:hidden;}#selection_field.show_colors {z-index:3;background-color:#EDF9FC;}#selection_field strong{font-weight:normal;}#selection_field.show_colors *,#selection_field_text * {visibility:hidden;}#selection_field_text{background-color:transparent;}#selection_field_text strong{font-weight:normal;background-color:#3399FE;color:#FFF;visibility:visible;}#container.word_wrap #content_highlight,#container.word_wrap #selection_field,#container.word_wrap #selection_field_text,#container.word_wrap #test_font_size{white-space:pre-wrap;white-space:-moz-pre-wrap !important;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;width:99%;}#line_number{position:absolute;overflow:hidden;border-right:solid black 1px;z-index:8;width:38px;padding:0 5px 0 0;margin:0 0 0 -45px;text-align:right;color:#AAAAAA;}#test_font_size{padding:0;margin:0;visibility:hidden;position:absolute;white-space:pre;}pre{margin:0;padding:0;}.hidden{opacity:0.2;filter:alpha(opacity=20);}#result .edit_area_cursor{position:absolute;z-index:6;background-color:#FF6633;top:-100px;margin:0;}#result .edit_area_selection_field .overline{background-color:#996600;}.editarea_popup{border:solid 1px #888888;background-color:#ECE9D8;width:250px;padding:4px;position:absolute;visibility:hidden;z-index:15;top:-500px;}.editarea_popup,.editarea_popup table{font-family:sans-serif;font-size:10pt;}.editarea_popup img{border:0;}.editarea_popup .close_popup{float:right;line-height:16px;border:0;padding:0;}.editarea_popup h1,.editarea_popup h2,.editarea_popup h3,.editarea_popup h4,.editarea_popup h5,.editarea_popup h6{margin:0;padding:0;}.editarea_popup .copyright{text-align:right;}div#area_search_replace{}div#area_search_replace img{border:0;}div#area_search_replace div.button{text-align:center;line-height:1.7em;}div#area_search_replace .button a{cursor:pointer;border:solid 1px #888888;background-color:#DEDEDE;text-decoration:none;padding:0 2px;color:#000000;white-space:nowrap;}div#area_search_replace a:hover{background-color:#EDEDED;}div#area_search_replace #move_area_search_replace{cursor:move;border:solid 1px #888;}div#area_search_replace #close_area_search_replace{text-align:right;vertical-align:top;white-space:nowrap;}div#area_search_replace #area_search_msg{height:18px;overflow:hidden;border-top:solid 1px #888;margin-top:3px;}#edit_area_help{width:350px;}#edit_area_help div.close_popup{float:right;}.area_toolbar{width:100%;margin:0;padding:0;background-color:#ECE9D8;text-align:center;}.area_toolbar,.area_toolbar table{font:11px sans-serif;}.area_toolbar img{border:0;vertical-align:middle;}.area_toolbar input{margin:0;padding:0;}.area_toolbar select{font-family:'MS Sans Serif',sans-serif,Verdana,Arial;font-size:7pt;font-weight:normal;margin:2px 0 0 0 ;padding:0;vertical-align:top;background-color:#F0F0EE;}table.statusbar{width:100%;}.area_toolbar td.infos{text-align:center;width:130px;border-right:solid 1px #888;border-width:0 1px 0 0;padding:0;}.area_toolbar td.total{text-align:right;width:50px;padding:0;}.area_toolbar td.resize{text-align:right;}.area_toolbar span#resize_area{cursor:nw-resize;visibility:hidden;}.editAreaButtonNormal,.editAreaButtonOver,.editAreaButtonDown,.editAreaSeparator,.editAreaSeparatorLine,.editAreaButtonDisabled,.editAreaButtonSelected {border:0; margin:0; padding:0; background:transparent;margin-top:0;margin-left:1px;padding:0;}.editAreaButtonNormal {border:1px solid #ECE9D8 !important;cursor:pointer;}.editAreaButtonOver {border:1px solid #0A246A !important;cursor:pointer;background-color:#B6BDD2;}.editAreaButtonDown {cursor:pointer;border:1px solid #0A246A !important;background-color:#8592B5;}.editAreaButtonSelected {border:1px solid #C0C0BB !important;cursor:pointer;background-color:#F4F2E8;}.editAreaButtonDisabled {filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);-moz-opacity:0.3;opacity:0.3;border:1px solid #F0F0EE !important;cursor:pointer;}.editAreaSeparatorLine {margin:1px 2px;background-color:#C0C0BB;width:2px;height:18px;}#processing{display:none;background-color:#ECE9D8;border:solid #888 1px;position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;text-align:center;}#processing_text{position:absolute;left:50%;top:50%;width:200px;height:20px;margin-left:-100px;margin-top:-10px;text-align:center;}#tab_browsing_area{display:none;background-color:#CCC9A8;border-top:1px solid #888;text-align:left;margin:0;}#tab_browsing_list {padding:0;margin:0;list-style-type:none;white-space:nowrap;}#tab_browsing_list li {float:left;margin:-1px;}#tab_browsing_list a {position:relative;display:block;text-decoration:none;float:left;cursor:pointer;line-height:14px;}#tab_browsing_list a span {display:block;color:#000;background:#ECE9D8;border:1px solid #888;border-width:1px 1px 0;text-align:center;padding:2px 2px 1px 4px;position:relative;}#tab_browsing_list a b {display:block;border-bottom:2px solid #617994;}#tab_browsing_list a .edited {display:none;}#tab_browsing_list a.edited .edited {display:inline;}#tab_browsing_list a img{margin-left:7px;}#tab_browsing_list a.edited img{margin-left:3px;}#tab_browsing_list a:hover span {background:#F4F2E8;border-color:#0A246A;}#tab_browsing_list .selected a span{background:#046380;color:#FFF;}#no_file_selected{height:100%;width:150%;background:#CCC;display:none;z-index:20;position:absolute;}.non_editable #editor{border-width:0 1px;}.non_editable .area_toolbar{display:none;}#auto_completion_area{background:#FFF;border:solid 1px #888;position:absolute;z-index:15;width:280px;height:180px;overflow:auto;display:none;}#auto_completion_area a,#auto_completion_area a:visited{display:block;padding:0 2px 1px;color:#000;text-decoration:none;}#auto_completion_area a:hover,#auto_completion_area a:focus,#auto_completion_area a.focus{background:#D6E1FE;text-decoration:none;}#auto_completion_area ul{margin:0;padding:0;list-style:none inside;}#auto_completion_area li{padding:0;}#auto_completion_area .prefix{font-style:italic;padding:0 3px;}</style>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/images/autocompletion.gif DELETED
Binary file
includes/syntax-highlighting/editarea/images/close.gif DELETED
Binary file
includes/syntax-highlighting/editarea/images/fullscreen.gif DELETED
Binary file
includes/syntax-highlighting/editarea/images/go_to_line.gif DELETED
Binary file
includes/syntax-highlighting/editarea/images/help.gif DELETED
Binary file
includes/syntax-highlighting/editarea/images/highlight.gif DELETED
Binary file
includes/syntax-highlighting/editarea/images/load.gif DELETED
Binary file
includes/syntax-highlighting/editarea/images/move.gif DELETED
Binary file
includes/syntax-highlighting/editarea/images/newdocument.gif DELETED
Binary file
includes/syntax-highlighting/editarea/images/opacity.png DELETED
Binary file
includes/syntax-highlighting/editarea/images/processing.gif DELETED
Binary file
includes/syntax-highlighting/editarea/images/redo.gif DELETED
Binary file
includes/syntax-highlighting/editarea/images/reset_highlight.gif DELETED
Binary file
includes/syntax-highlighting/editarea/images/save.gif DELETED
Binary file
includes/syntax-highlighting/editarea/images/search.gif DELETED
Binary file
includes/syntax-highlighting/editarea/images/smooth_selection.gif DELETED
Binary file
includes/syntax-highlighting/editarea/images/spacer.gif DELETED
Binary file
includes/syntax-highlighting/editarea/images/statusbar_resize.gif DELETED
Binary file
includes/syntax-highlighting/editarea/images/undo.gif DELETED
Binary file
includes/syntax-highlighting/editarea/images/word_wrap.gif DELETED
Binary file
includes/syntax-highlighting/editarea/langs/bg.js DELETED
@@ -1,54 +0,0 @@
1
- /*
2
- * Bulgarian translation
3
- * Author: Valentin Hristov
4
- * Company: SOFTKIT Bulgarian
5
- * Site: http://www.softkit-bg.com
6
- */
7
- editAreaLoader.lang["bg"]={
8
- new_document: "нов документ",
9
- search_button: "търсене и замяна",
10
- search_command: "търси следващия / отвори прозорец с търсачка",
11
- search: "търсене",
12
- replace: "замяна",
13
- replace_command: "замяна / отвори прозорец с търсачка",
14
- find_next: "намери следващия",
15
- replace_all: "замени всички",
16
- reg_exp: "реголярни изрази",
17
- match_case: "чуствителен към регистъра",
18
- not_found: "няма резултат.",
19
- occurrence_replaced: "замяната е осъществена.",
20
- search_field_empty: "Полето за търсене е празно",
21
- restart_search_at_begin: "До края на документа. Почни с началото.",
22
- move_popup: "премести прозореца с търсачката",
23
- font_size: "--Размер на шрифта--",
24
- go_to_line: "премени към реда",
25
- go_to_line_prompt: "премени към номера на реда:",
26
- undo: "отмени",
27
- redo: "върни",
28
- change_smooth_selection: "включи/изключи някой от функциите за преглед (по красиво, но повече натоварва)",
29
- highlight: "превключване на оцветяване на синтаксиса включена/изключена",
30
- reset_highlight: "въстанови оцветяване на синтаксиса (ако не е синхронизиран с текста)",
31
- word_wrap: "режим на пренасяне на дълги редове",
32
- help: "за програмата",
33
- save: "съхрани",
34
- load: "зареди",
35
- line_abbr: "Стр",
36
- char_abbr: "Стлб",
37
- position: "Позиция",
38
- total: "Всичко",
39
- close_popup: "затвори прозореца",
40
- shortcuts: "Бързи клавиши",
41
- add_tab: "добави табулация в текста",
42
- remove_tab: "премахни табулацията в текста",
43
- about_notice: "Внимание: използвайте функцията оцветяване на синтаксиса само за малки текстове",
44
- toggle: "Превключи редактор",
45
- accesskey: "Бърз клавиш",
46
- tab: "Tab",
47
- shift: "Shift",
48
- ctrl: "Ctrl",
49
- esc: "Esc",
50
- processing: "Зареждане...",
51
- fullscreen: "на цял екран",
52
- syntax_selection: "--Синтаксис--",
53
- close_tab: "Затвори файла"
54
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/langs/cs.js DELETED
@@ -1,48 +0,0 @@
1
- editAreaLoader.lang["cs"]={
2
- new_document: "Nový dokument",
3
- search_button: "Najdi a nahraď",
4
- search_command: "Hledej další / otevři vyhledávací pole",
5
- search: "Hledej",
6
- replace: "Nahraď",
7
- replace_command: "Nahraď / otevři vyhledávací pole",
8
- find_next: "Najdi další",
9
- replace_all: "Nahraď vše",
10
- reg_exp: "platné výrazy",
11
- match_case: "vyhodnocené výrazy",
12
- not_found: "nenalezené.",
13
- occurrence_replaced: "výskyty nahrazené.",
14
- search_field_empty: "Pole vyhledávání je prázdné",
15
- restart_search_at_begin: "Dosažen konec souboru, začínám od začátku.",
16
- move_popup: "Přesuň vyhledávací okno",
17
- font_size: "--Velikost textu--",
18
- go_to_line: "Přejdi na řádek",
19
- go_to_line_prompt: "Přejdi na řádek:",
20
- undo: "krok zpět",
21
- redo: "znovu",
22
- change_smooth_selection: "Povolit nebo zakázat některé ze zobrazených funkcí (účelnější zobrazení požaduje větší zatížení procesoru)",
23
- highlight: "Zvýrazňování syntaxe zap./vyp.",
24
- reset_highlight: "Obnovit zvýraznění (v případě nesrovnalostí)",
25
- word_wrap: "toggle word wrapping mode",
26
- help: "O programu",
27
- save: "Uložit",
28
- load: "Otevřít",
29
- line_abbr: "Ř.",
30
- char_abbr: "S.",
31
- position: "Pozice",
32
- total: "Celkem",
33
- close_popup: "Zavřít okno",
34
- shortcuts: "Zkratky",
35
- add_tab: "Přidat tabulování textu",
36
- remove_tab: "Odtsranit tabulování textu",
37
- about_notice: "Upozornění! Funkce zvýrazňování textu je k dispozici pouze pro malý text",
38
- toggle: "Přepnout editor",
39
- accesskey: "Přístupová klávesa",
40
- tab: "Záložka",
41
- shift: "Shift",
42
- ctrl: "Ctrl",
43
- esc: "Esc",
44
- processing: "Zpracovávám ...",
45
- fullscreen: "Celá obrazovka",
46
- syntax_selection: "--vyber zvýrazňovač--",
47
- close_tab: "Close file"
48
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/langs/de.js DELETED
@@ -1,48 +0,0 @@
1
- editAreaLoader.lang["de"]={
2
- new_document: "Neues Dokument",
3
- search_button: "Suchen und Ersetzen",
4
- search_command: "Weitersuchen / &ouml;ffne Suchfeld",
5
- search: "Suchen",
6
- replace: "Ersetzen",
7
- replace_command: "Ersetzen / &ouml;ffne Suchfeld",
8
- find_next: "Weitersuchen",
9
- replace_all: "Ersetze alle Treffer",
10
- reg_exp: "regul&auml;re Ausdr&uuml;cke",
11
- match_case: "passt auf den Begriff<br />",
12
- not_found: "Nicht gefunden.",
13
- occurrence_replaced: "Die Vorkommen wurden ersetzt.",
14
- search_field_empty: "Leeres Suchfeld",
15
- restart_search_at_begin: "Ende des zu durchsuchenden Bereiches erreicht. Es wird die Suche von Anfang an fortgesetzt.", //find a shorter translation
16
- move_popup: "Suchfenster bewegen",
17
- font_size: "--Schriftgr&ouml;&szlig;e--",
18
- go_to_line: "Gehe zu Zeile",
19
- go_to_line_prompt: "Gehe zu Zeilennummmer:",
20
- undo: "R&uuml;ckg&auml;ngig",
21
- redo: "Wiederherstellen",
22
- change_smooth_selection: "Aktiviere/Deaktiviere einige Features (weniger Bildschirmnutzung aber mehr CPU-Belastung)",
23
- highlight: "Syntax Highlighting an- und ausschalten",
24
- reset_highlight: "Highlighting zur&uuml;cksetzen (falls mit Text nicht konform)",
25
- word_wrap: "Toggle word wrapping mode",
26
- help: "Info",
27
- save: "Speichern",
28
- load: "&Ouml;ffnen",
29
- line_abbr: "Ln",
30
- char_abbr: "Ch",
31
- position: "Position",
32
- total: "Gesamt",
33
- close_popup: "Popup schlie&szlig;en",
34
- shortcuts: "Shortcuts",
35
- add_tab: "Tab zum Text hinzuf&uuml;gen",
36
- remove_tab: "Tab aus Text entfernen",
37
- about_notice: "Bemerkung: Syntax Highlighting ist nur f&uuml;r kurze Texte",
38
- toggle: "Editor an- und ausschalten",
39
- accesskey: "Accesskey",
40
- tab: "Tab",
41
- shift: "Shift",
42
- ctrl: "Ctrl",
43
- esc: "Esc",
44
- processing: "In Bearbeitung...",
45
- fullscreen: "Full-Screen",
46
- syntax_selection: "--Syntax--",
47
- close_tab: "Close file"
48
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/langs/dk.js DELETED
@@ -1,48 +0,0 @@
1
- editAreaLoader.lang["dk"]={
2
- new_document: "nyt tomt dokument",
3
- search_button: "s&oslash;g og erstat",
4
- search_command: "find n&aelig;ste / &aring;ben s&oslash;gefelt",
5
- search: "s&oslash;g",
6
- replace: "erstat",
7
- replace_command: "erstat / &aring;ben s&oslash;gefelt",
8
- find_next: "find n&aelig;ste",
9
- replace_all: "erstat alle",
10
- reg_exp: "regular expressions",
11
- match_case: "forskel på store/sm&aring; bogstaver<br />",
12
- not_found: "not found.",
13
- occurrence_replaced: "occurences replaced.",
14
- search_field_empty: "Search field empty",
15
- restart_search_at_begin: "End of area reached. Restart at begin.",
16
- move_popup: "flyt søgepopup",
17
- font_size: "--Skriftstørrelse--",
18
- go_to_line: "g&aring; til linie",
19
- go_to_line_prompt: "gå til linienummer:",
20
- undo: "fortryd",
21
- redo: "gentag",
22
- change_smooth_selection: "sl&aring; display funktioner til/fra (smartere display men mere CPU kr&aelig;vende)",
23
- highlight: "sl&aring; syntax highlight til/fra",
24
- reset_highlight: "nulstil highlight (hvis den er desynkroniseret fra teksten)",
25
- word_wrap: "toggle word wrapping mode",
26
- help: "om",
27
- save: "gem",
28
- load: "hent",
29
- line_abbr: "Ln",
30
- char_abbr: "Ch",
31
- position: "Position",
32
- total: "Total",
33
- close_popup: "luk popup",
34
- shortcuts: "Genveje",
35
- add_tab: "tilf&oslash;j tabulation til tekst",
36
- remove_tab: "fjern tabulation fra tekst",
37
- about_notice: "Husk: syntax highlight funktionen b&oslash;r kun bruge til sm&aring; tekster",
38
- toggle: "Sl&aring; editor til / fra",
39
- accesskey: "Accesskey",
40
- tab: "Tab",
41
- shift: "Skift",
42
- ctrl: "Ctrl",
43
- esc: "Esc",
44
- processing: "Processing...",
45
- fullscreen: "fullscreen",
46
- syntax_selection: "--Syntax--",
47
- close_tab: "Close file"
48
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/langs/en.js DELETED
@@ -1,48 +0,0 @@
1
- editAreaLoader.lang["en"]={
2
- new_document: "new empty document",
3
- search_button: "search and replace",
4
- search_command: "search next / open search area",
5
- search: "search",
6
- replace: "replace",
7
- replace_command: "replace / open search area",
8
- find_next: "find next",
9
- replace_all: "replace all",
10
- reg_exp: "regular expressions",
11
- match_case: "match case",
12
- not_found: "not found.",
13
- occurrence_replaced: "occurences replaced.",
14
- search_field_empty: "Search field empty",
15
- restart_search_at_begin: "End of area reached. Restart at begin.",
16
- move_popup: "move search popup",
17
- font_size: "--Font size--",
18
- go_to_line: "go to line",
19
- go_to_line_prompt: "go to line number:",
20
- undo: "undo",
21
- redo: "redo",
22
- change_smooth_selection: "enable/disable some display features (smarter display but more CPU charge)",
23
- highlight: "toggle syntax highlight on/off",
24
- reset_highlight: "reset highlight (if desyncronized from text)",
25
- word_wrap: "toggle word wrapping mode",
26
- help: "about",
27
- save: "save",
28
- load: "load",
29
- line_abbr: "Ln",
30
- char_abbr: "Ch",
31
- position: "Position",
32
- total: "Total",
33
- close_popup: "close popup",
34
- shortcuts: "Shortcuts",
35
- add_tab: "add tabulation to text",
36
- remove_tab: "remove tabulation to text",
37
- about_notice: "Notice: syntax highlight function is only for small text",
38
- toggle: "Toggle editor",
39
- accesskey: "Accesskey",
40
- tab: "Tab",
41
- shift: "Shift",
42
- ctrl: "Ctrl",
43
- esc: "Esc",
44
- processing: "Processing...",
45
- fullscreen: "fullscreen",
46
- syntax_selection: "--Syntax--",
47
- close_tab: "Close file"
48
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/langs/eo.js DELETED
@@ -1,48 +0,0 @@
1
- editAreaLoader.lang["eo"]={
2
- new_document: "nova dokumento (vakigas la enhavon)",
3
- search_button: "ser&#265;i / anstata&#365;igi",
4
- search_command: "pluser&#265;i / malfermi la ser&#265;o-fenestron",
5
- search: "ser&#265;i",
6
- replace: "anstata&#365;igi",
7
- replace_command: "anstata&#365;igi / malfermi la ser&#265;o-fenestron",
8
- find_next: "ser&#265;i",
9
- replace_all: "anstata&#365;igi &#265;ion",
10
- reg_exp: "regula esprimo",
11
- match_case: "respekti la usklecon",
12
- not_found: "ne trovita.",
13
- occurrence_replaced: "anstata&#365;igoj plenumitaj.",
14
- search_field_empty: "La kampo estas malplena.",
15
- restart_search_at_begin: "Fino de teksto &#285;isrirata, &#265;u da&#365;rigi el la komenco?",
16
- move_popup: "movi la ser&#265;o-fenestron",
17
- font_size: "--Tipara grando--",
18
- go_to_line: "iri al la linio",
19
- go_to_line_prompt: "iri al la linio numero:",
20
- undo: "rezigni",
21
- redo: "refari",
22
- change_smooth_selection: "ebligi/malebligi la funkcioj de vidigo (pli bona vidigo, sed pli da &#349;ar&#285;o de la &#265;eforgano)",
23
- highlight: "ebligi/malebligi la sintaksan kolorigon",
24
- reset_highlight: "repravalorizi la sintaksan kolorigon (se malsinkronigon de la teksto)",
25
- word_wrap: "toggle word wrapping mode",
26
- help: "pri",
27
- save: "registri",
28
- load: "&#349;ar&#285;i",
29
- line_abbr: "Ln",
30
- char_abbr: "Sg",
31
- position: "Pozicio",
32
- total: "Sumo",
33
- close_popup: "fermi la &#349;prucfenestron",
34
- shortcuts: "Fulmoklavo",
35
- add_tab: "aldoni tabon en la tekston",
36
- remove_tab: "forigi tablon el la teksto",
37
- about_notice: "Noto: la sintaksa kolorigo estas nur prikalkulita por mallongaj tekstoj.",
38
- toggle: "baskuligi la redaktilon",
39
- accesskey: "Fulmoklavo",
40
- tab: "Tab",
41
- shift: "Maj",
42
- ctrl: "Ktrl",
43
- esc: "Esk",
44
- processing: "&#349;argante...",
45
- fullscreen: "plenekrane",
46
- syntax_selection: "--Sintakso--",
47
- close_tab: "Fermi la dosieron"
48
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/langs/es.js DELETED
@@ -1,48 +0,0 @@
1
- editAreaLoader.lang["es"]={
2
- new_document: "nuevo documento vacío",
3
- search_button: "buscar y reemplazar",
4
- search_command: "buscar siguiente / abrir área de búsqueda",
5
- search: "buscar",
6
- replace: "reemplazar",
7
- replace_command: "reemplazar / abrir área de búsqueda",
8
- find_next: "encontrar siguiente",
9
- replace_all: "reemplazar todos",
10
- reg_exp: "expresiones regulares",
11
- match_case: "coincidir capitalización",
12
- not_found: "no encontrado.",
13
- occurrence_replaced: "ocurrencias reemplazadas.",
14
- search_field_empty: "Campo de búsqueda vacío",
15
- restart_search_at_begin: "Se ha llegado al final del área. Se va a seguir desde el principio.",
16
- move_popup: "mover la ventana de búsqueda",
17
- font_size: "--Tamaño de la fuente--",
18
- go_to_line: "ir a la línea",
19
- go_to_line_prompt: "ir a la línea número:",
20
- undo: "deshacer",
21
- redo: "rehacer",
22
- change_smooth_selection: "activar/desactivar algunas características de visualización (visualización más inteligente pero más carga de CPU)",
23
- highlight: "intercambiar resaltado de sintaxis",
24
- reset_highlight: "reinicializar resaltado (si no esta sincronizado con el texto)",
25
- word_wrap: "toggle word wrapping mode",
26
- help: "acerca",
27
- save: "guardar",
28
- load: "cargar",
29
- line_abbr: "Ln",
30
- char_abbr: "Ch",
31
- position: "Posición",
32
- total: "Total",
33
- close_popup: "recuadro de cierre",
34
- shortcuts: "Atajos",
35
- add_tab: "añadir tabulado al texto",
36
- remove_tab: "borrar tabulado del texto",
37
- about_notice: "Aviso: el resaltado de sintaxis sólo funciona para texto pequeño",
38
- toggle: "Cambiar editor",
39
- accesskey: "Tecla de acceso",
40
- tab: "Tab",
41
- shift: "Mayúsc",
42
- ctrl: "Ctrl",
43
- esc: "Esc",
44
- processing: "Procesando...",
45
- fullscreen: "pantalla completa",
46
- syntax_selection: "--Syntax--",
47
- close_tab: "Close file"
48
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/langs/fi.js DELETED
@@ -1,48 +0,0 @@
1
- editAreaLoader.lang["fi"]={
2
- new_document: "uusi tyhjä dokumentti",
3
- search_button: "etsi ja korvaa",
4
- search_command: "etsi seuraava / avaa etsintävalikko",
5
- search: "etsi",
6
- replace: "korvaa",
7
- replace_command: "korvaa / avaa etsintävalikko",
8
- find_next: "etsi seuraava",
9
- replace_all: "korvaa kaikki",
10
- reg_exp: "säännölliset lausekkeet",
11
- match_case: "täsmää kirjainkokoon",
12
- not_found: "ei löytynyt.",
13
- occurrence_replaced: "esiintymää korvattu.",
14
- search_field_empty: "Haettava merkkijono on tyhjä",
15
- restart_search_at_begin: "Alueen loppu saavutettiin. Aloitetaan alusta.",
16
- move_popup: "siirrä etsintävalikkoa",
17
- font_size: "--Fontin koko--",
18
- go_to_line: "siirry riville",
19
- go_to_line_prompt: "mene riville:",
20
- undo: "peruuta",
21
- redo: "tee uudelleen",
22
- change_smooth_selection: "kytke/sammuta joitakin näyttötoimintoja (Älykkäämpi toiminta, mutta suurempi CPU kuormitus)",
23
- highlight: "kytke syntaksikorostus päälle/pois",
24
- reset_highlight: "resetoi syntaksikorostus (jos teksti ei ole synkassa korostuksen kanssa)",
25
- word_wrap: "toggle word wrapping mode",
26
- help: "tietoja",
27
- save: "tallenna",
28
- load: "lataa",
29
- line_abbr: "Rv",
30
- char_abbr: "Pos",
31
- position: "Paikka",
32
- total: "Yhteensä",
33
- close_popup: "sulje valikko",
34
- shortcuts: "Pikatoiminnot",
35
- add_tab: "lisää sisennys tekstiin",
36
- remove_tab: "poista sisennys tekstistä",
37
- about_notice: "Huomautus: syntaksinkorostus toimii vain pienelle tekstille",
38
- toggle: "Kytke editori",
39
- accesskey: "Pikanäppäin",
40
- tab: "Tab",
41
- shift: "Shift",
42
- ctrl: "Ctrl",
43
- esc: "Esc",
44
- processing: "Odota...",
45
- fullscreen: "koko ruutu",
46
- syntax_selection: "--Syntaksi--",
47
- close_tab: "Sulje tiedosto"
48
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/langs/fr.js DELETED
@@ -1,48 +0,0 @@
1
- editAreaLoader.lang["fr"]={
2
- new_document: "nouveau document (efface le contenu)",
3
- search_button: "rechercher / remplacer",
4
- search_command: "rechercher suivant / ouvrir la fen&ecirc;tre de recherche",
5
- search: "rechercher",
6
- replace: "remplacer",
7
- replace_command: "remplacer / ouvrir la fen&ecirc;tre de recherche",
8
- find_next: "rechercher",
9
- replace_all: "tout remplacer",
10
- reg_exp: "expr. r&eacute;guli&egrave;re",
11
- match_case: "respecter la casse",
12
- not_found: "pas trouv&eacute;.",
13
- occurrence_replaced: "remplacements &eacute;ffectu&eacute;s.",
14
- search_field_empty: "Le champ de recherche est vide.",
15
- restart_search_at_begin: "Fin du texte atteint, poursuite au d&eacute;but.",
16
- move_popup: "d&eacute;placer la fen&ecirc;tre de recherche",
17
- font_size: "--Taille police--",
18
- go_to_line: "aller &agrave; la ligne",
19
- go_to_line_prompt: "aller a la ligne numero:",
20
- undo: "annuler",
21
- redo: "refaire",
22
- change_smooth_selection: "activer/d&eacute;sactiver des fonctions d'affichage (meilleur affichage mais plus de charge processeur)",
23
- highlight: "activer/d&eacute;sactiver la coloration syntaxique",
24
- reset_highlight: "r&eacute;initialiser la coloration syntaxique (si d&eacute;syncronis&eacute;e du texte)",
25
- word_wrap: "activer/d&eacute;sactiver les retours &agrave; la ligne automatiques",
26
- help: "&agrave; propos",
27
- save: "sauvegarder",
28
- load: "charger",
29
- line_abbr: "Ln",
30
- char_abbr: "Ch",
31
- position: "Position",
32
- total: "Total",
33
- close_popup: "fermer le popup",
34
- shortcuts: "Racourcis clavier",
35
- add_tab: "ajouter une tabulation dans le texte",
36
- remove_tab: "retirer une tabulation dans le texte",
37
- about_notice: "Note: la coloration syntaxique n'est pr&eacute;vue que pour de courts textes.",
38
- toggle: "basculer l'&eacute;diteur",
39
- accesskey: "Accesskey",
40
- tab: "Tab",
41
- shift: "Maj",
42
- ctrl: "Ctrl",
43
- esc: "Esc",
44
- processing: "chargement...",
45
- fullscreen: "plein &eacute;cran",
46
- syntax_selection: "--Syntaxe--",
47
- close_tab: "Fermer le fichier"
48
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/langs/hr.js DELETED
@@ -1,48 +0,0 @@
1
- editAreaLoader.lang["hr"]={
2
- new_document: "Novi dokument",
3
- search_button: "Traži i izmijeni",
4
- search_command: "Traži dalje / Otvori prozor za traženje",
5
- search: "Traži",
6
- replace: "Izmijeni",
7
- replace_command: "Izmijeni / Otvori prozor za traženje",
8
- find_next: "Traži dalje",
9
- replace_all: "Izmjeni sve",
10
- reg_exp: "Regularni izrazi",
11
- match_case: "Bitna vel. slova",
12
- not_found: "nije naðeno.",
13
- occurrence_replaced: "izmjenjenih.",
14
- search_field_empty: "Prazno polje za traženje!",
15
- restart_search_at_begin: "Došao do kraja. Poèeo od poèetka.",
16
- move_popup: "Pomakni prozor",
17
- font_size: "--Velièina teksta--",
18
- go_to_line: "Odi na redak",
19
- go_to_line_prompt: "Odi na redak:",
20
- undo: "Vrati natrag",
21
- redo: "Napravi ponovo",
22
- change_smooth_selection: "Ukljuèi/iskljuèi neke moguænosti prikaza (pametniji prikaz, ali zagušeniji CPU)",
23
- highlight: "Ukljuèi/iskljuèi bojanje sintakse",
24
- reset_highlight: "Ponovi kolorizaciju (ako je nesinkronizirana s tekstom)",
25
- word_wrap: "toggle word wrapping mode",
26
- help: "O edit_area",
27
- save: "Spremi",
28
- load: "Uèitaj",
29
- line_abbr: "Ln",
30
- char_abbr: "Zn",
31
- position: "Pozicija",
32
- total: "Ukupno",
33
- close_popup: "Zatvori prozor",
34
- shortcuts: "Kratice",
35
- add_tab: "Dodaj tabulaciju",
36
- remove_tab: "Makni tabulaciju",
37
- about_notice: "Napomena: koloriziranje sintakse je samo za kratke kodove",
38
- toggle: "Prebaci naèin ureðivanja",
39
- accesskey: "Accesskey",
40
- tab: "Tab",
41
- shift: "Shift",
42
- ctrl: "Ctrl",
43
- esc: "Esc",
44
- processing: "Procesiram...",
45
- fullscreen: "Cijeli prozor",
46
- syntax_selection: "--Syntax--",
47
- close_tab: "Close file"
48
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/langs/id.js DELETED
@@ -1,48 +0,0 @@
1
- editAreaLoader.lang["id"]={
2
- new_document: "dokumen baru",
3
- search_button: "cari dan ganti",
4
- search_command: "cari lagi / buka area pencarian",
5
- search: "cari",
6
- replace: "ganti",
7
- replace_command: "ganti / buka area pencarian",
8
- find_next: "cari lagi",
9
- replace_all: "ganti semua",
10
- reg_exp: "regular expressions",
11
- match_case: "kapitalisasi",
12
- not_found: "tidak ditemukan.",
13
- occurrence_replaced: "occurences replaced.",
14
- search_field_empty: "Kata kunci kosong",
15
- restart_search_at_begin: "Area habis. Mulai lagi dari awal.",
16
- move_popup: "geser popup pencarian",
17
- font_size: "--Ukuran huruf--",
18
- go_to_line: "menuju baris",
19
- go_to_line_prompt: "menuju baris ke:",
20
- undo: "undo",
21
- redo: "redo",
22
- change_smooth_selection: "hidupkan/matikan beberapa fitur tampilan (tampilan lebih baik, sumberdaya CPU lebih besar)",
23
- highlight: "penanda syntax matikan/hidupkan",
24
- reset_highlight: "reset highlight (jika tidak sinkron dengan text)",
25
- word_wrap: "potong baris panjang",
26
- help: "tentang",
27
- save: "simpan",
28
- load: "ambil",
29
- line_abbr: "Baris",
30
- char_abbr: "Kolom",
31
- position: "Posisi",
32
- total: "Total",
33
- close_popup: "tutup popup",
34
- shortcuts: "Pintasan",
35
- add_tab: "tambah tab ke text",
36
- remove_tab: "hapus tab dari text",
37
- about_notice: "Catatan: fungsi syntax highlight hanya untuk text kecil",
38
- toggle: "Matikan/hidupkan editor",
39
- accesskey: "Kunci akses",
40
- tab: "Tab",
41
- shift: "Shift",
42
- ctrl: "Ctrl",
43
- esc: "Esc",
44
- processing: "Memproses...",
45
- fullscreen: "layarpenuh",
46
- syntax_selection: "--Bahasa--",
47
- close_tab: "Tutup file"
48
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/langs/it.js DELETED
@@ -1,48 +0,0 @@
1
- editAreaLoader.lang["it"]={
2
- new_document: "nuovo documento vuoto",
3
- search_button: "cerca e sostituisci",
4
- search_command: "trova successivo / apri finestra di ricerca",
5
- search: "cerca",
6
- replace: "sostituisci",
7
- replace_command: "sostituisci / apri finestra di ricerca",
8
- find_next: "trova successivo",
9
- replace_all: "sostituisci tutti",
10
- reg_exp: "espressioni regolari",
11
- match_case: "confronta maiuscole/minuscole<br />",
12
- not_found: "non trovato.",
13
- occurrence_replaced: "occorrenze sostituite.",
14
- search_field_empty: "Campo ricerca vuoto",
15
- restart_search_at_begin: "Fine del testo raggiunta. Ricomincio dall'inizio.",
16
- move_popup: "sposta popup di ricerca",
17
- font_size: "-- Dimensione --",
18
- go_to_line: "vai alla linea",
19
- go_to_line_prompt: "vai alla linea numero:",
20
- undo: "annulla",
21
- redo: "ripeti",
22
- change_smooth_selection: "abilita/disabilita alcune caratteristiche della visualizzazione",
23
- highlight: "abilita/disabilita colorazione della sintassi",
24
- reset_highlight: "aggiorna colorazione (se non sincronizzata)",
25
- word_wrap: "toggle word wrapping mode",
26
- help: "informazioni su...",
27
- save: "salva",
28
- load: "carica",
29
- line_abbr: "Ln",
30
- char_abbr: "Ch",
31
- position: "Posizione",
32
- total: "Totale",
33
- close_popup: "chiudi popup",
34
- shortcuts: "Scorciatoie",
35
- add_tab: "aggiungi tabulazione",
36
- remove_tab: "rimuovi tabulazione",
37
- about_notice: "Avviso: la colorazione della sintassi vale solo con testo piccolo",
38
- toggle: "Abilita/disabilita editor",
39
- accesskey: "Accesskey",
40
- tab: "Tab",
41
- shift: "Shift",
42
- ctrl: "Ctrl",
43
- esc: "Esc",
44
- processing: "In corso...",
45
- fullscreen: "fullscreen",
46
- syntax_selection: "--Syntax--",
47
- close_tab: "Close file"
48
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/langs/ja.js DELETED
@@ -1,48 +0,0 @@
1
- editAreaLoader.lang["ja"]={
2
- new_document: "新規作成",
3
- search_button: "検索・置換",
4
- search_command: "次を検索 / 検索窓を表示",
5
- search: "検索",
6
- replace: "置換",
7
- replace_command: "置換 / 置換窓を表示",
8
- find_next: "次を検索",
9
- replace_all: "全置換",
10
- reg_exp: "正規表現",
11
- match_case: "大文字小文字の区別",
12
- not_found: "見つかりません。",
13
- occurrence_replaced: "置換しました。",
14
- search_field_empty: "検索対象文字列が空です。",
15
- restart_search_at_begin: "終端に達しました、始めに戻ります",
16
- move_popup: "検索窓を移動",
17
- font_size: "--フォントサイズ--",
18
- go_to_line: "指定行へ移動",
19
- go_to_line_prompt: "指定行へ移動します:",
20
- undo: "元に戻す",
21
- redo: "やり直し",
22
- change_smooth_selection: "スムース表示の切り替え(CPUを使います)",
23
- highlight: "構文強調表示の切り替え",
24
- reset_highlight: "構文強調表示のリセット",
25
- word_wrap: "toggle word wrapping mode",
26
- help: "ヘルプを表示",
27
- save: "保存",
28
- load: "読み込み",
29
- line_abbr: "行",
30
- char_abbr: "文字",
31
- position: "位置",
32
- total: "合計",
33
- close_popup: "ポップアップを閉じる",
34
- shortcuts: "ショートカット",
35
- add_tab: "タブを挿入する",
36
- remove_tab: "タブを削除する",
37
- about_notice: "注意:構文強調表示は短いテキストでしか有効に機能しません。",
38
- toggle: "テキストエリアとeditAreaの切り替え",
39
- accesskey: "アクセスキー",
40
- tab: "Tab",
41
- shift: "Shift",
42
- ctrl: "Ctrl",
43
- esc: "Esc",
44
- processing: "処理中です...",
45
- fullscreen: "fullscreen",
46
- syntax_selection: "--Syntax--",
47
- close_tab: "Close file"
48
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/langs/mk.js DELETED
@@ -1,48 +0,0 @@
1
- editAreaLoader.lang["mk"]={
2
- new_document: "Нов документ",
3
- search_button: "Најди и замени",
4
- search_command: "Барај следно / Отвори нов прозорец за пребарување",
5
- search: "Барај",
6
- replace: "Замени",
7
- replace_command: "Замени / Отвори прозорец за пребарување",
8
- find_next: "најди следно",
9
- replace_all: "Замени ги сите",
10
- reg_exp: "Регуларни изрази",
11
- match_case: "Битна е големината на буквите",
12
- not_found: "не е пронајдено.",
13
- occurrence_replaced: "замени.",
14
- search_field_empty: "Полето за пребарување е празно",
15
- restart_search_at_begin: "Крај на областа. Стартувај од почеток.",
16
- move_popup: "Помести го прозорецот",
17
- font_size: "--Големина на текстот--",
18
- go_to_line: "Оди на линија",
19
- go_to_line_prompt: "Оди на линија со број:",
20
- undo: "Врати",
21
- redo: "Повтори",
22
- change_smooth_selection: "Вклучи/исклучи некои карактеристики за приказ (попаметен приказ, но поголемо оптеретување за процесорот)",
23
- highlight: "Вклучи/исклучи осветлување на синтакса",
24
- reset_highlight: "Ресетирај го осветлувањето на синтакса (доколку е десинхронизиранo со текстот)",
25
- word_wrap: "toggle word wrapping mode",
26
- help: "За",
27
- save: "Зачувај",
28
- load: "Вчитај",
29
- line_abbr: "Лн",
30
- char_abbr: "Зн",
31
- position: "Позиција",
32
- total: "Вкупно",
33
- close_popup: "Затвори го прозорецот",
34
- shortcuts: "Кратенки",
35
- add_tab: "Додај табулација на текстот",
36
- remove_tab: "Отстрани ја табулацијата",
37
- about_notice: "Напомена: Осветлувањето на синтанса е само за краток текст",
38
- toggle: "Смени начин на уредување",
39
- accesskey: "Accesskey",
40
- tab: "Tab",
41
- shift: "Shift",
42
- ctrl: "Ctrl",
43
- esc: "Esc",
44
- processing: "Обработувам...",
45
- fullscreen: "Цел прозорец",
46
- syntax_selection: "--Синтакса--",
47
- close_tab: "Избери датотека"
48
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/langs/nl.js DELETED
@@ -1,48 +0,0 @@
1
- editAreaLoader.lang["nl"]={
2
- new_document: "nieuw leeg document",
3
- search_button: "zoek en vervang",
4
- search_command: "zoek volgende / zoekscherm openen",
5
- search: "zoek",
6
- replace: "vervang",
7
- replace_command: "vervang / zoekscherm openen",
8
- find_next: "volgende vinden",
9
- replace_all: "alles vervangen",
10
- reg_exp: "reguliere expressies",
11
- match_case: "hoofdletter gevoelig",
12
- not_found: "niet gevonden.",
13
- occurrence_replaced: "object vervangen.",
14
- search_field_empty: "Zoek veld leeg",
15
- restart_search_at_begin: "Niet meer instanties gevonden, begin opnieuw",
16
- move_popup: "versleep zoek scherm",
17
- font_size: "--Letter grootte--",
18
- go_to_line: "Ga naar regel",
19
- go_to_line_prompt: "Ga naar regel nummer:",
20
- undo: "Ongedaan maken",
21
- redo: "Opnieuw doen",
22
- change_smooth_selection: "zet wat schermopties aan/uit (kan langzamer zijn)",
23
- highlight: "zet syntax highlight aan/uit",
24
- reset_highlight: "reset highlight (indien gedesynchronizeerd)",
25
- word_wrap: "toggle word wrapping mode",
26
- help: "informatie",
27
- save: "opslaan",
28
- load: "laden",
29
- line_abbr: "Ln",
30
- char_abbr: "Ch",
31
- position: "Positie",
32
- total: "Totaal",
33
- close_popup: "Popup sluiten",
34
- shortcuts: "Snelkoppelingen",
35
- add_tab: "voeg tabs toe in tekst",
36
- remove_tab: "verwijder tabs uit tekst",
37
- about_notice: "Notitie: syntax highlight functie is alleen voor kleine tekst",
38
- toggle: "geavanceerde bewerkingsopties",
39
- accesskey: "Accessknop",
40
- tab: "Tab",
41
- shift: "Shift",
42
- ctrl: "Ctrl",
43
- esc: "Esc",
44
- processing: "Verwerken...",
45
- fullscreen: "fullscreen",
46
- syntax_selection: "--Syntax--",
47
- close_tab: "Close file"
48
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/langs/pl.js DELETED
@@ -1,48 +0,0 @@
1
- editAreaLoader.lang["pl"]={
2
- new_document: "nowy dokument",
3
- search_button: "znajdź i zamień",
4
- search_command: "znajdź następny",
5
- search: "znajdź",
6
- replace: "zamień",
7
- replace_command: "zamień",
8
- find_next: "następny",
9
- replace_all: "zamień wszystko",
10
- reg_exp: "wyrażenie regularne",
11
- match_case: "uwzględnij wielkość liter<br />",
12
- not_found: "nie znaleziono.",
13
- occurrence_replaced: "wystąpień zamieniono.",
14
- search_field_empty: "Nie wprowadzono tekstu",
15
- restart_search_at_begin: "Koniec dokumentu. Wyszukiwanie od początku.",
16
- move_popup: "przesuń okienko wyszukiwania",
17
- font_size: "Rozmiar",
18
- go_to_line: "idź do linii",
19
- go_to_line_prompt: "numer linii:",
20
- undo: "cofnij",
21
- redo: "przywróć",
22
- change_smooth_selection: "włącz/wyłącz niektóre opcje wyglądu (zaawansowane opcje wyglądu obciążają procesor)",
23
- highlight: "włącz/wyłącz podświetlanie składni",
24
- reset_highlight: "odśwież podświetlanie składni (jeśli rozsynchronizowało się z tekstem)",
25
- word_wrap: "toggle word wrapping mode",
26
- help: "o programie",
27
- save: "zapisz",
28
- load: "otwórz",
29
- line_abbr: "Ln",
30
- char_abbr: "Zn",
31
- position: "Pozycja",
32
- total: "W sumie",
33
- close_popup: "zamknij okienko",
34
- shortcuts: "Skróty klawiaturowe",
35
- add_tab: "dodaj wcięcie do zaznaczonego tekstu",
36
- remove_tab: "usuń wcięcie",
37
- about_notice: "Uwaga: podświetlanie składni nie jest zalecane dla długich tekstów",
38
- toggle: "Włącz/wyłącz edytor",
39
- accesskey: "Alt+",
40
- tab: "Tab",
41
- shift: "Shift",
42
- ctrl: "Ctrl",
43
- esc: "Esc",
44
- processing: "Przetwarzanie...",
45
- fullscreen: "fullscreen",
46
- syntax_selection: "--Syntax--",
47
- close_tab: "Close file"
48
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/langs/pt.js DELETED
@@ -1,48 +0,0 @@
1
- editAreaLoader.lang["pt"]={
2
- new_document: "Novo documento",
3
- search_button: "Localizar e substituir",
4
- search_command: "Localizar próximo",
5
- search: "Localizar",
6
- replace: "Substituir",
7
- replace_command: "Substituir",
8
- find_next: "Localizar",
9
- replace_all: "Subst. tudo",
10
- reg_exp: "Expressões regulares",
11
- match_case: "Diferenciar maiúsculas e minúsculas",
12
- not_found: "Não encontrado.",
13
- occurrence_replaced: "Ocorrências substituidas",
14
- search_field_empty: "Campo localizar vazio.",
15
- restart_search_at_begin: "Fim das ocorrências. Recomeçar do inicio.",
16
- move_popup: "Mover janela",
17
- font_size: "--Tamanho da fonte--",
18
- go_to_line: "Ir para linha",
19
- go_to_line_prompt: "Ir para a linha:",
20
- undo: "Desfazer",
21
- redo: "Refazer",
22
- change_smooth_selection: "Opções visuais",
23
- highlight: "Cores de sintaxe",
24
- reset_highlight: "Resetar cores (se não sincronizado)",
25
- word_wrap: "toggle word wrapping mode",
26
- help: "Sobre",
27
- save: "Salvar",
28
- load: "Carregar",
29
- line_abbr: "Ln",
30
- char_abbr: "Ch",
31
- position: "Posição",
32
- total: "Total",
33
- close_popup: "Fechar",
34
- shortcuts: "Shortcuts",
35
- add_tab: "Adicionar tabulação",
36
- remove_tab: "Remover tabulação",
37
- about_notice: "Atenção: Cores de sintaxe são indicados somente para textos pequenos",
38
- toggle: "Exibir editor",
39
- accesskey: "Accesskey",
40
- tab: "Tab",
41
- shift: "Shift",
42
- ctrl: "Ctrl",
43
- esc: "Esc",
44
- processing: "Processando...",
45
- fullscreen: "fullscreen",
46
- syntax_selection: "--Syntax--",
47
- close_tab: "Close file"
48
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/langs/ru.js DELETED
@@ -1,48 +0,0 @@
1
- editAreaLoader.lang["ru"]={
2
- new_document: "новый пустой документ",
3
- search_button: "поиск и замена",
4
- search_command: "искать следующий / открыть панель поиска",
5
- search: "поиск",
6
- replace: "замена",
7
- replace_command: "заменить / открыть панель поиска",
8
- find_next: "найти следующее",
9
- replace_all: "заменить все",
10
- reg_exp: "регулярное выражение",
11
- match_case: "учитывать регистр",
12
- not_found: "не найдено.",
13
- occurrence_replaced: "вхождение заменено.",
14
- search_field_empty: "Поле поиска пустое",
15
- restart_search_at_begin: "Достигнут конец документа. Начинаю с начала.",
16
- move_popup: "переместить окно поиска",
17
- font_size: "--Размер шрифта--",
18
- go_to_line: "перейти к строке",
19
- go_to_line_prompt: "перейти к строке номер:",
20
- undo: "отменить",
21
- redo: "вернуть",
22
- change_smooth_selection: "включить/отключить некоторые функции просмотра (более красиво, но больше использует процессор)",
23
- highlight: "переключить подсветку синтаксиса включена/выключена",
24
- reset_highlight: "восстановить подсветку (если разсинхронизирована от текста)",
25
- word_wrap: "toggle word wrapping mode",
26
- help: "о программе",
27
- save: "сохранить",
28
- load: "загрузить",
29
- line_abbr: "Стр",
30
- char_abbr: "Стлб",
31
- position: "Позиция",
32
- total: "Всего",
33
- close_popup: "закрыть всплывающее окно",
34
- shortcuts: "Горячие клавиши",
35
- add_tab: "добавить табуляцию в текст",
36
- remove_tab: "убрать табуляцию из текста",
37
- about_notice: "Внимание: функция подсветки синтаксиса только для небольших текстов",
38
- toggle: "Переключить редактор",
39
- accesskey: "Горячая клавиша",
40
- tab: "Tab",
41
- shift: "Shift",
42
- ctrl: "Ctrl",
43
- esc: "Esc",
44
- processing: "Обработка...",
45
- fullscreen: "полный экран",
46
- syntax_selection: "--Синтакс--",
47
- close_tab: "Закрыть файл"
48
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/langs/sk.js DELETED
@@ -1,48 +0,0 @@
1
- editAreaLoader.lang["sk"]={
2
- new_document: "nový prázdy dokument",
3
- search_button: "vyhľadaj a nahraď",
4
- search_command: "hľadaj ďalsšie / otvor vyhľadávacie pole",
5
- search: "hľadaj",
6
- replace: "nahraď",
7
- replace_command: "nahraď / otvor vyhľadávacie pole",
8
- find_next: "nájdi ďalšie",
9
- replace_all: "nahraď všetko",
10
- reg_exp: "platné výrazy",
11
- match_case: "zhodujúce sa výrazy",
12
- not_found: "nenájdené.",
13
- occurrence_replaced: "výskyty nahradené.",
14
- search_field_empty: "Pole vyhľadávanie je prádzne",
15
- restart_search_at_begin: "End of area reached. Restart at begin.",
16
- move_popup: "presuň vyhľadávacie okno",
17
- font_size: "--Veľkosť textu--",
18
- go_to_line: "prejdi na riadok",
19
- go_to_line_prompt: "prejdi na riadok:",
20
- undo: "krok späť",
21
- redo: "prepracovať",
22
- change_smooth_selection: "povoliť/zamietnúť niektoré zo zobrazených funkcií (účelnejšie zobrazenie vyžaduje väčšie zaťaženie procesora CPU)",
23
- highlight: "prepnúť zvýrazňovanie syntaxe zap/vyp",
24
- reset_highlight: "zrušiť zvýrazňovanie (ak je nesynchronizované s textom)",
25
- word_wrap: "toggle word wrapping mode",
26
- help: "o programe",
27
- save: "uložiť",
28
- load: "načítať",
29
- line_abbr: "Ln",
30
- char_abbr: "Ch",
31
- position: "Pozícia",
32
- total: "Spolu",
33
- close_popup: "zavrieť okno",
34
- shortcuts: "Skratky",
35
- add_tab: "pridať tabulovanie textu",
36
- remove_tab: "odstrániť tabulovanie textu",
37
- about_notice: "Upozornenie: funkcia zvýrazňovania syntaxe je dostupná iba pre malý text",
38
- toggle: "Prepnúť editor",
39
- accesskey: "Accesskey",
40
- tab: "Záložka",
41
- shift: "Shift",
42
- ctrl: "Ctrl",
43
- esc: "Esc",
44
- processing: "Spracúvam...",
45
- fullscreen: "cel=a obrazovka",
46
- syntax_selection: "--Vyber Syntax--",
47
- close_tab: "Close file"
48
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/langs/zh.js DELETED
@@ -1,48 +0,0 @@
1
- editAreaLoader.lang["zh"]={
2
- new_document: "新建空白文档",
3
- search_button: "查找与替换",
4
- search_command: "查找下一个 / 打开查找框",
5
- search: "查找",
6
- replace: "替换",
7
- replace_command: "替换 / 打开查找框",
8
- find_next: "查找下一个",
9
- replace_all: "全部替换",
10
- reg_exp: "正则表达式",
11
- match_case: "匹配大小写",
12
- not_found: "未找到.",
13
- occurrence_replaced: "处被替换.",
14
- search_field_empty: "查找框没有内容",
15
- restart_search_at_begin: "已到到文档末尾. 从头重新查找.",
16
- move_popup: "移动查找对话框",
17
- font_size: "--字体大小--",
18
- go_to_line: "转到行",
19
- go_to_line_prompt: "转到行:",
20
- undo: "恢复",
21
- redo: "重做",
22
- change_smooth_selection: "启用/禁止一些显示特性(更好看但更耗费资源)",
23
- highlight: "启用/禁止语法高亮",
24
- reset_highlight: "重置语法高亮(当文本显示不同步时)",
25
- word_wrap: "toggle word wrapping mode",
26
- help: "关于",
27
- save: "保存",
28
- load: "加载",
29
- line_abbr: "行",
30
- char_abbr: "字符",
31
- position: "位置",
32
- total: "总计",
33
- close_popup: "关闭对话框",
34
- shortcuts: "快捷键",
35
- add_tab: "添加制表符(Tab)",
36
- remove_tab: "移除制表符(Tab)",
37
- about_notice: "注意:语法高亮功能仅用于较少内容的文本(文件内容太大会导致浏览器反应慢)",
38
- toggle: "切换编辑器",
39
- accesskey: "快捷键",
40
- tab: "Tab",
41
- shift: "Shift",
42
- ctrl: "Ctrl",
43
- esc: "Esc",
44
- processing: "正在处理中...",
45
- fullscreen: "全屏编辑",
46
- syntax_selection: "--语法--",
47
- close_tab: "关闭文件"
48
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/license_apache.txt DELETED
@@ -1,7 +0,0 @@
1
- Copyright 2008 Christophe Dolivet
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
4
-
5
- http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/license_bsd.txt DELETED
@@ -1,10 +0,0 @@
1
- Copyright (c) 2008, Christophe Dolivet
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
-
6
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
- * Neither the name of EditArea nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9
-
10
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/license_lgpl.txt DELETED
@@ -1,458 +0,0 @@
1
- GNU LESSER GENERAL PUBLIC LICENSE
2
- Version 2.1, February 1999
3
-
4
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
5
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
- Everyone is permitted to copy and distribute verbatim copies
7
- of this license document, but changing it is not allowed.
8
-
9
- [This is the first released version of the Lesser GPL. It also counts
10
- as the successor of the GNU Library Public License, version 2, hence
11
- the version number 2.1.]
12
-
13
- Preamble
14
-
15
- The licenses for most software are designed to take away your
16
- freedom to share and change it. By contrast, the GNU General Public
17
- Licenses are intended to guarantee your freedom to share and change
18
- free software--to make sure the software is free for all its users.
19
-
20
- This license, the Lesser General Public License, applies to some
21
- specially designated software packages--typically libraries--of the
22
- Free Software Foundation and other authors who decide to use it. You
23
- can use it too, but we suggest you first think carefully about whether
24
- this license or the ordinary General Public License is the better
25
- strategy to use in any particular case, based on the explanations below.
26
-
27
- When we speak of free software, we are referring to freedom of use,
28
- not price. Our General Public Licenses are designed to make sure that
29
- you have the freedom to distribute copies of free software (and charge
30
- for this service if you wish); that you receive source code or can get
31
- it if you want it; that you can change the software and use pieces of
32
- it in new free programs; and that you are informed that you can do
33
- these things.
34
-
35
- To protect your rights, we need to make restrictions that forbid
36
- distributors to deny you these rights or to ask you to surrender these
37
- rights. These restrictions translate to certain responsibilities for
38
- you if you distribute copies of the library or if you modify it.
39
-
40
- For example, if you distribute copies of the library, whether gratis
41
- or for a fee, you must give the recipients all the rights that we gave
42
- you. You must make sure that they, too, receive or can get the source
43
- code. If you link other code with the library, you must provide
44
- complete object files to the recipients, so that they can relink them
45
- with the library after making changes to the library and recompiling
46
- it. And you must show them these terms so they know their rights.
47
-
48
- We protect your rights with a two-step method: (1) we copyright the
49
- library, and (2) we offer you this license, which gives you legal
50
- permission to copy, distribute and/or modify the library.
51
-
52
- To protect each distributor, we want to make it very clear that
53
- there is no warranty for the free library. Also, if the library is
54
- modified by someone else and passed on, the recipients should know
55
- that what they have is not the original version, so that the original
56
- author's reputation will not be affected by problems that might be
57
- introduced by others.
58
-
59
- Finally, software patents pose a constant threat to the existence of
60
- any free program. We wish to make sure that a company cannot
61
- effectively restrict the users of a free program by obtaining a
62
- restrictive license from a patent holder. Therefore, we insist that
63
- any patent license obtained for a version of the library must be
64
- consistent with the full freedom of use specified in this license.
65
-
66
- Most GNU software, including some libraries, is covered by the
67
- ordinary GNU General Public License. This license, the GNU Lesser
68
- General Public License, applies to certain designated libraries, and
69
- is quite different from the ordinary General Public License. We use
70
- this license for certain libraries in order to permit linking those
71
- libraries into non-free programs.
72
-
73
- When a program is linked with a library, whether statically or using
74
- a shared library, the combination of the two is legally speaking a
75
- combined work, a derivative of the original library. The ordinary
76
- General Public License therefore permits such linking only if the
77
- entire combination fits its criteria of freedom. The Lesser General
78
- Public License permits more lax criteria for linking other code with
79
- the library.
80
-
81
- We call this license the "Lesser" General Public License because it
82
- does Less to protect the user's freedom than the ordinary General
83
- Public License. It also provides other free software developers Less
84
- of an advantage over competing non-free programs. These disadvantages
85
- are the reason we use the ordinary General Public License for many
86
- libraries. However, the Lesser license provides advantages in certain
87
- special circumstances.
88
-
89
- For example, on rare occasions, there may be a special need to
90
- encourage the widest possible use of a certain library, so that it becomes
91
- a de-facto standard. To achieve this, non-free programs must be
92
- allowed to use the library. A more frequent case is that a free
93
- library does the same job as widely used non-free libraries. In this
94
- case, there is little to gain by limiting the free library to free
95
- software only, so we use the Lesser General Public License.
96
-
97
- In other cases, permission to use a particular library in non-free
98
- programs enables a greater number of people to use a large body of
99
- free software. For example, permission to use the GNU C Library in
100
- non-free programs enables many more people to use the whole GNU
101
- operating system, as well as its variant, the GNU/Linux operating
102
- system.
103
-
104
- Although the Lesser General Public License is Less protective of the
105
- users' freedom, it does ensure that the user of a program that is
106
- linked with the Library has the freedom and the wherewithal to run
107
- that program using a modified version of the Library.
108
-
109
- The precise terms and conditions for copying, distribution and
110
- modification follow. Pay close attention to the difference between a
111
- "work based on the library" and a "work that uses the library". The
112
- former contains code derived from the library, whereas the latter must
113
- be combined with the library in order to run.
114
-
115
- GNU LESSER GENERAL PUBLIC LICENSE
116
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
117
-
118
- 0. This License Agreement applies to any software library or other
119
- program which contains a notice placed by the copyright holder or
120
- other authorized party saying it may be distributed under the terms of
121
- this Lesser General Public License (also called "this License").
122
- Each licensee is addressed as "you".
123
-
124
- A "library" means a collection of software functions and/or data
125
- prepared so as to be conveniently linked with application programs
126
- (which use some of those functions and data) to form executables.
127
-
128
- The "Library", below, refers to any such software library or work
129
- which has been distributed under these terms. A "work based on the
130
- Library" means either the Library or any derivative work under
131
- copyright law: that is to say, a work containing the Library or a
132
- portion of it, either verbatim or with modifications and/or translated
133
- straightforwardly into another language. (Hereinafter, translation is
134
- included without limitation in the term "modification".)
135
-
136
- "Source code" for a work means the preferred form of the work for
137
- making modifications to it. For a library, complete source code means
138
- all the source code for all modules it contains, plus any associated
139
- interface definition files, plus the scripts used to control compilation
140
- and installation of the library.
141
-
142
- Activities other than copying, distribution and modification are not
143
- covered by this License; they are outside its scope. The act of
144
- running a program using the Library is not restricted, and output from
145
- such a program is covered only if its contents constitute a work based
146
- on the Library (independent of the use of the Library in a tool for
147
- writing it). Whether that is true depends on what the Library does
148
- and what the program that uses the Library does.
149
-
150
- 1. You may copy and distribute verbatim copies of the Library's
151
- complete source code as you receive it, in any medium, provided that
152
- you conspicuously and appropriately publish on each copy an
153
- appropriate copyright notice and disclaimer of warranty; keep intact
154
- all the notices that refer to this License and to the absence of any
155
- warranty; and distribute a copy of this License along with the
156
- Library.
157
-
158
- You may charge a fee for the physical act of transferring a copy,
159
- and you may at your option offer warranty protection in exchange for a
160
- fee.
161
-
162
- 2. You may modify your copy or copies of the Library or any portion
163
- of it, thus forming a work based on the Library, and copy and
164
- distribute such modifications or work under the terms of Section 1
165
- above, provided that you also meet all of these conditions:
166
-
167
- a) The modified work must itself be a software library.
168
-
169
- b) You must cause the files modified to carry prominent notices
170
- stating that you changed the files and the date of any change.
171
-
172
- c) You must cause the whole of the work to be licensed at no
173
- charge to all third parties under the terms of this License.
174
-
175
- d) If a facility in the modified Library refers to a function or a
176
- table of data to be supplied by an application program that uses
177
- the facility, other than as an argument passed when the facility
178
- is invoked, then you must make a good faith effort to ensure that,
179
- in the event an application does not supply such function or
180
- table, the facility still operates, and performs whatever part of
181
- its purpose remains meaningful.
182
-
183
- (For example, a function in a library to compute square roots has
184
- a purpose that is entirely well-defined independent of the
185
- application. Therefore, Subsection 2d requires that any
186
- application-supplied function or table used by this function must
187
- be optional: if the application does not supply it, the square
188
- root function must still compute square roots.)
189
-
190
- These requirements apply to the modified work as a whole. If
191
- identifiable sections of that work are not derived from the Library,
192
- and can be reasonably considered independent and separate works in
193
- themselves, then this License, and its terms, do not apply to those
194
- sections when you distribute them as separate works. But when you
195
- distribute the same sections as part of a whole which is a work based
196
- on the Library, the distribution of the whole must be on the terms of
197
- this License, whose permissions for other licensees extend to the
198
- entire whole, and thus to each and every part regardless of who wrote
199
- it.
200
-
201
- Thus, it is not the intent of this section to claim rights or contest
202
- your rights to work written entirely by you; rather, the intent is to
203
- exercise the right to control the distribution of derivative or
204
- collective works based on the Library.
205
-
206
- In addition, mere aggregation of another work not based on the Library
207
- with the Library (or with a work based on the Library) on a volume of
208
- a storage or distribution medium does not bring the other work under
209
- the scope of this License.
210
-
211
- 3. You may opt to apply the terms of the ordinary GNU General Public
212
- License instead of this License to a given copy of the Library. To do
213
- this, you must alter all the notices that refer to this License, so
214
- that they refer to the ordinary GNU General Public License, version 2,
215
- instead of to this License. (If a newer version than version 2 of the
216
- ordinary GNU General Public License has appeared, then you can specify
217
- that version instead if you wish.) Do not make any other change in
218
- these notices.
219
-
220
- Once this change is made in a given copy, it is irreversible for
221
- that copy, so the ordinary GNU General Public License applies to all
222
- subsequent copies and derivative works made from that copy.
223
-
224
- This option is useful when you wish to copy part of the code of
225
- the Library into a program that is not a library.
226
-
227
- 4. You may copy and distribute the Library (or a portion or
228
- derivative of it, under Section 2) in object code or executable form
229
- under the terms of Sections 1 and 2 above provided that you accompany
230
- it with the complete corresponding machine-readable source code, which
231
- must be distributed under the terms of Sections 1 and 2 above on a
232
- medium customarily used for software interchange.
233
-
234
- If distribution of object code is made by offering access to copy
235
- from a designated place, then offering equivalent access to copy the
236
- source code from the same place satisfies the requirement to
237
- distribute the source code, even though third parties are not
238
- compelled to copy the source along with the object code.
239
-
240
- 5. A program that contains no derivative of any portion of the
241
- Library, but is designed to work with the Library by being compiled or
242
- linked with it, is called a "work that uses the Library". Such a
243
- work, in isolation, is not a derivative work of the Library, and
244
- therefore falls outside the scope of this License.
245
-
246
- However, linking a "work that uses the Library" with the Library
247
- creates an executable that is a derivative of the Library (because it
248
- contains portions of the Library), rather than a "work that uses the
249
- library". The executable is therefore covered by this License.
250
- Section 6 states terms for distribution of such executables.
251
-
252
- When a "work that uses the Library" uses material from a header file
253
- that is part of the Library, the object code for the work may be a
254
- derivative work of the Library even though the source code is not.
255
- Whether this is true is especially significant if the work can be
256
- linked without the Library, or if the work is itself a library. The
257
- threshold for this to be true is not precisely defined by law.
258
-
259
- If such an object file uses only numerical parameters, data
260
- structure layouts and accessors, and small macros and small inline
261
- functions (ten lines or less in length), then the use of the object
262
- file is unrestricted, regardless of whether it is legally a derivative
263
- work. (Executables containing this object code plus portions of the
264
- Library will still fall under Section 6.)
265
-
266
- Otherwise, if the work is a derivative of the Library, you may
267
- distribute the object code for the work under the terms of Section 6.
268
- Any executables containing that work also fall under Section 6,
269
- whether or not they are linked directly with the Library itself.
270
-
271
- 6. As an exception to the Sections above, you may also combine or
272
- link a "work that uses the Library" with the Library to produce a
273
- work containing portions of the Library, and distribute that work
274
- under terms of your choice, provided that the terms permit
275
- modification of the work for the customer's own use and reverse
276
- engineering for debugging such modifications.
277
-
278
- You must give prominent notice with each copy of the work that the
279
- Library is used in it and that the Library and its use are covered by
280
- this License. You must supply a copy of this License. If the work
281
- during execution displays copyright notices, you must include the
282
- copyright notice for the Library among them, as well as a reference
283
- directing the user to the copy of this License. Also, you must do one
284
- of these things:
285
-
286
- a) Accompany the work with the complete corresponding
287
- machine-readable source code for the Library including whatever
288
- changes were used in the work (which must be distributed under
289
- Sections 1 and 2 above); and, if the work is an executable linked
290
- with the Library, with the complete machine-readable "work that
291
- uses the Library", as object code and/or source code, so that the
292
- user can modify the Library and then relink to produce a modified
293
- executable containing the modified Library. (It is understood
294
- that the user who changes the contents of definitions files in the
295
- Library will not necessarily be able to recompile the application
296
- to use the modified definitions.)
297
-
298
- b) Use a suitable shared library mechanism for linking with the
299
- Library. A suitable mechanism is one that (1) uses at run time a
300
- copy of the library already present on the user's computer system,
301
- rather than copying library functions into the executable, and (2)
302
- will operate properly with a modified version of the library, if
303
- the user installs one, as long as the modified version is
304
- interface-compatible with the version that the work was made with.
305
-
306
- c) Accompany the work with a written offer, valid for at
307
- least three years, to give the same user the materials
308
- specified in Subsection 6a, above, for a charge no more
309
- than the cost of performing this distribution.
310
-
311
- d) If distribution of the work is made by offering access to copy
312
- from a designated place, offer equivalent access to copy the above
313
- specified materials from the same place.
314
-
315
- e) Verify that the user has already received a copy of these
316
- materials or that you have already sent this user a copy.
317
-
318
- For an executable, the required form of the "work that uses the
319
- Library" must include any data and utility programs needed for
320
- reproducing the executable from it. However, as a special exception,
321
- the materials to be distributed need not include anything that is
322
- normally distributed (in either source or binary form) with the major
323
- components (compiler, kernel, and so on) of the operating system on
324
- which the executable runs, unless that component itself accompanies
325
- the executable.
326
-
327
- It may happen that this requirement contradicts the license
328
- restrictions of other proprietary libraries that do not normally
329
- accompany the operating system. Such a contradiction means you cannot
330
- use both them and the Library together in an executable that you
331
- distribute.
332
-
333
- 7. You may place library facilities that are a work based on the
334
- Library side-by-side in a single library together with other library
335
- facilities not covered by this License, and distribute such a combined
336
- library, provided that the separate distribution of the work based on
337
- the Library and of the other library facilities is otherwise
338
- permitted, and provided that you do these two things:
339
-
340
- a) Accompany the combined library with a copy of the same work
341
- based on the Library, uncombined with any other library
342
- facilities. This must be distributed under the terms of the
343
- Sections above.
344
-
345
- b) Give prominent notice with the combined library of the fact
346
- that part of it is a work based on the Library, and explaining
347
- where to find the accompanying uncombined form of the same work.
348
-
349
- 8. You may not copy, modify, sublicense, link with, or distribute
350
- the Library except as expressly provided under this License. Any
351
- attempt otherwise to copy, modify, sublicense, link with, or
352
- distribute the Library is void, and will automatically terminate your
353
- rights under this License. However, parties who have received copies,
354
- or rights, from you under this License will not have their licenses
355
- terminated so long as such parties remain in full compliance.
356
-
357
- 9. You are not required to accept this License, since you have not
358
- signed it. However, nothing else grants you permission to modify or
359
- distribute the Library or its derivative works. These actions are
360
- prohibited by law if you do not accept this License. Therefore, by
361
- modifying or distributing the Library (or any work based on the
362
- Library), you indicate your acceptance of this License to do so, and
363
- all its terms and conditions for copying, distributing or modifying
364
- the Library or works based on it.
365
-
366
- 10. Each time you redistribute the Library (or any work based on the
367
- Library), the recipient automatically receives a license from the
368
- original licensor to copy, distribute, link with or modify the Library
369
- subject to these terms and conditions. You may not impose any further
370
- restrictions on the recipients' exercise of the rights granted herein.
371
- You are not responsible for enforcing compliance by third parties with
372
- this License.
373
-
374
- 11. If, as a consequence of a court judgment or allegation of patent
375
- infringement or for any other reason (not limited to patent issues),
376
- conditions are imposed on you (whether by court order, agreement or
377
- otherwise) that contradict the conditions of this License, they do not
378
- excuse you from the conditions of this License. If you cannot
379
- distribute so as to satisfy simultaneously your obligations under this
380
- License and any other pertinent obligations, then as a consequence you
381
- may not distribute the Library at all. For example, if a patent
382
- license would not permit royalty-free redistribution of the Library by
383
- all those who receive copies directly or indirectly through you, then
384
- the only way you could satisfy both it and this License would be to
385
- refrain entirely from distribution of the Library.
386
-
387
- If any portion of this section is held invalid or unenforceable under any
388
- particular circumstance, the balance of the section is intended to apply,
389
- and the section as a whole is intended to apply in other circumstances.
390
-
391
- It is not the purpose of this section to induce you to infringe any
392
- patents or other property right claims or to contest validity of any
393
- such claims; this section has the sole purpose of protecting the
394
- integrity of the free software distribution system which is
395
- implemented by public license practices. Many people have made
396
- generous contributions to the wide range of software distributed
397
- through that system in reliance on consistent application of that
398
- system; it is up to the author/donor to decide if he or she is willing
399
- to distribute software through any other system and a licensee cannot
400
- impose that choice.
401
-
402
- This section is intended to make thoroughly clear what is believed to
403
- be a consequence of the rest of this License.
404
-
405
- 12. If the distribution and/or use of the Library is restricted in
406
- certain countries either by patents or by copyrighted interfaces, the
407
- original copyright holder who places the Library under this License may add
408
- an explicit geographical distribution limitation excluding those countries,
409
- so that distribution is permitted only in or among countries not thus
410
- excluded. In such case, this License incorporates the limitation as if
411
- written in the body of this License.
412
-
413
- 13. The Free Software Foundation may publish revised and/or new
414
- versions of the Lesser General Public License from time to time.
415
- Such new versions will be similar in spirit to the present version,
416
- but may differ in detail to address new problems or concerns.
417
-
418
- Each version is given a distinguishing version number. If the Library
419
- specifies a version number of this License which applies to it and
420
- "any later version", you have the option of following the terms and
421
- conditions either of that version or of any later version published by
422
- the Free Software Foundation. If the Library does not specify a
423
- license version number, you may choose any version ever published by
424
- the Free Software Foundation.
425
-
426
- 14. If you wish to incorporate parts of the Library into other free
427
- programs whose distribution conditions are incompatible with these,
428
- write to the author to ask for permission. For software which is
429
- copyrighted by the Free Software Foundation, write to the Free
430
- Software Foundation; we sometimes make exceptions for this. Our
431
- decision will be guided by the two goals of preserving the free status
432
- of all derivatives of our free software and of promoting the sharing
433
- and reuse of software generally.
434
-
435
- NO WARRANTY
436
-
437
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
438
- WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
439
- EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
440
- OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
441
- KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
442
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
443
- PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
444
- LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
445
- THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
446
-
447
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
448
- WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
449
- AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
450
- FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
451
- CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
452
- LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
453
- RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
454
- FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
455
- SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
456
- DAMAGES.
457
-
458
- END OF TERMS AND CONDITIONS
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/reg_syntax/basic.js DELETED
@@ -1,70 +0,0 @@
1
- editAreaLoader.load_syntax["basic"] = {
2
- 'DISPLAY_NAME' : 'Basic'
3
- ,'COMMENT_SINGLE' : {1 : "'", 2 : 'rem'}
4
- ,'COMMENT_MULTI' : { }
5
- ,'QUOTEMARKS' : {1: '"'}
6
- ,'KEYWORD_CASE_SENSITIVE' : false
7
- ,'KEYWORDS' : {
8
- 'statements' : [
9
- 'if','then','for','wend','while',
10
- 'else','elseif','select','case','end select',
11
- 'until','next','step','to','end if', 'call'
12
- ]
13
- ,'keywords' : [
14
- 'sub', 'end sub', 'function', 'end function', 'exit',
15
- 'exit function', 'dim', 'redim', 'shared', 'const',
16
- 'is', 'absolute', 'access', 'any', 'append', 'as',
17
- 'base', 'beep', 'binary', 'bload', 'bsave', 'chain',
18
- 'chdir', 'circle', 'clear', 'close', 'cls', 'color',
19
- 'com', 'common', 'data', 'date', 'declare', 'def',
20
- 'defdbl', 'defint', 'deflng', 'defsng', 'defstr',
21
- 'double', 'draw', 'environ', 'erase', 'error', 'field',
22
- 'files', 'fn', 'get', 'gosub', 'goto', 'integer', 'key',
23
- 'kill', 'let', 'line', 'list', 'locate', 'lock', 'long',
24
- 'lprint', 'lset', 'mkdir', 'name', 'off', 'on', 'open',
25
- 'option', 'out', 'output', 'paint', 'palette', 'pcopy',
26
- 'poke', 'preset', 'print', 'pset', 'put', 'random',
27
- 'randomize', 'read', 'reset', 'restore', 'resume',
28
- 'return', 'rmdir', 'rset', 'run', 'screen', 'seg',
29
- 'shell', 'single', 'sleep', 'sound', 'static', 'stop',
30
- 'strig', 'string', 'swap', 'system', 'time', 'timer',
31
- 'troff', 'tron', 'type', 'unlock', 'using', 'view',
32
- 'wait', 'width', 'window', 'write'
33
- ]
34
- ,'functions' : [
35
- 'abs', 'asc', 'atn', 'cdbl', 'chr', 'cint', 'clng',
36
- 'cos', 'csng', 'csrlin', 'cvd', 'cvdmbf', 'cvi', 'cvl',
37
- 'cvs', 'cvsmbf', 'eof', 'erdev', 'erl', 'err', 'exp',
38
- 'fileattr', 'fix', 'fre', 'freefile', 'hex', 'inkey',
39
- 'inp', 'input', 'instr', 'int', 'ioctl', 'lbound',
40
- 'lcase', 'left', 'len', 'loc', 'lof', 'log', 'lpos',
41
- 'ltrim', 'mid', 'mkd', 'mkdmbf', 'mki', 'mkl', 'mks',
42
- 'mksmbf', 'oct', 'peek', 'pen', 'play', 'pmap', 'point',
43
- 'pos', 'right', 'rnd', 'rtrim', 'seek', 'sgn', 'sin',
44
- 'space', 'spc', 'sqr', 'stick', 'str', 'tab', 'tan',
45
- 'ubound', 'ucase', 'val', 'varptr', 'varseg'
46
- ]
47
- ,'operators' : [
48
- 'and', 'eqv', 'imp', 'mod', 'not', 'or', 'xor'
49
- ]
50
- }
51
- ,'OPERATORS' :[
52
- '+', '-', '/', '*', '=', '<', '>', '!', '&'
53
- ]
54
- ,'DELIMITERS' :[
55
- '(', ')', '[', ']', '{', '}'
56
- ]
57
- ,'STYLES' : {
58
- 'COMMENTS': 'color: #99CC00;'
59
- ,'QUOTESMARKS': 'color: #333399;'
60
- ,'KEYWORDS' : {
61
- 'keywords' : 'color: #3366FF;'
62
- ,'functions' : 'color: #0000FF;'
63
- ,'statements' : 'color: #3366FF;'
64
- ,'operators' : 'color: #FF0000;'
65
- }
66
- ,'OPERATORS' : 'color: #FF0000;'
67
- ,'DELIMITERS' : 'color: #0000FF;'
68
-
69
- }
70
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/reg_syntax/brainfuck.js DELETED
@@ -1,45 +0,0 @@
1
- editAreaLoader.load_syntax["brainfuck"] = {
2
- 'DISPLAY_NAME' : 'Brainfuck'
3
- ,'COMMENT_SINGLE' : {}
4
- ,'COMMENT_MULTI' : {}
5
- ,'QUOTEMARKS' : {}
6
- ,'KEYWORD_CASE_SENSITIVE' : true
7
- ,'OPERATORS' :[
8
- '+', '-'
9
- ]
10
- ,'DELIMITERS' :[
11
- '[', ']'
12
- ]
13
- ,'REGEXPS' : {
14
- 'bfispis' : {
15
- 'search' : '()(\\.)()'
16
- ,'class' : 'bfispis'
17
- ,'modifiers' : 'g'
18
- ,'execute' : 'before'
19
- }
20
- ,'bfupis' : {
21
- 'search' : '()(\\,)()'
22
- ,'class' : 'bfupis'
23
- ,'modifiers' : 'g'
24
- ,'execute' : 'before'
25
- }
26
- ,'bfmemory' : {
27
- 'search' : '()([<>])()'
28
- ,'class' : 'bfmemory'
29
- ,'modifiers' : 'g'
30
- ,'execute' : 'before'
31
- }
32
- }
33
- ,'STYLES' : {
34
- 'COMMENTS': 'color: #AAAAAA;'
35
- ,'QUOTESMARKS': 'color: #6381F8;'
36
- ,'OPERATORS' : 'color: #88AA00;'
37
- ,'DELIMITERS' : 'color: #00C138;'
38
- ,'REGEXPS' : {
39
- 'bfispis' : 'color: #EE0000;'
40
- ,'bfupis' : 'color: #4455ee;'
41
- ,'bfmemory' : 'color: #DD00DD;'
42
- }
43
- }
44
- };
45
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/reg_syntax/c.js DELETED
@@ -1,63 +0,0 @@
1
- editAreaLoader.load_syntax["c"] = {
2
- 'DISPLAY_NAME' : 'C'
3
- ,'COMMENT_SINGLE' : {1 : '//'}
4
- ,'COMMENT_MULTI' : {'/*' : '*/'}
5
- ,'QUOTEMARKS' : {1: "'", 2: '"'}
6
- ,'KEYWORD_CASE_SENSITIVE' : true
7
- ,'KEYWORDS' : {
8
- 'constants' : [
9
- 'NULL', 'false', 'stdin', 'stdout', 'stderr', 'true'
10
- ]
11
- ,'types' : [
12
- 'FILE', 'auto', 'char', 'const', 'double',
13
- 'extern', 'float', 'inline', 'int', 'long', 'register',
14
- 'short', 'signed', 'size_t', 'static', 'struct',
15
- 'time_t', 'typedef', 'union', 'unsigned', 'void',
16
- 'volatile'
17
- ]
18
- ,'statements' : [
19
- 'do', 'else', 'enum', 'for', 'goto', 'if', 'sizeof',
20
- 'switch', 'while'
21
- ]
22
- ,'keywords' : [
23
- 'break', 'case', 'continue', 'default', 'delete',
24
- 'return'
25
- ]
26
- }
27
- ,'OPERATORS' :[
28
- '+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
29
- ]
30
- ,'DELIMITERS' :[
31
- '(', ')', '[', ']', '{', '}'
32
- ]
33
- ,'REGEXPS' : {
34
- 'precompiler' : {
35
- 'search' : '()(#[^\r\n]*)()'
36
- ,'class' : 'precompiler'
37
- ,'modifiers' : 'g'
38
- ,'execute' : 'before'
39
- }
40
- /* ,'precompilerstring' : {
41
- 'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])'
42
- ,'class' : 'precompilerstring'
43
- ,'modifiers' : 'g'
44
- ,'execute' : 'before'
45
- }*/
46
- }
47
- ,'STYLES' : {
48
- 'COMMENTS': 'color: #AAAAAA;'
49
- ,'QUOTESMARKS': 'color: #6381F8;'
50
- ,'KEYWORDS' : {
51
- 'constants' : 'color: #EE0000;'
52
- ,'types' : 'color: #0000EE;'
53
- ,'statements' : 'color: #60CA00;'
54
- ,'keywords' : 'color: #48BDDF;'
55
- }
56
- ,'OPERATORS' : 'color: #FF00FF;'
57
- ,'DELIMITERS' : 'color: #0038E1;'
58
- ,'REGEXPS' : {
59
- 'precompiler' : 'color: #009900;'
60
- ,'precompilerstring' : 'color: #994400;'
61
- }
62
- }
63
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/reg_syntax/coldfusion.js DELETED
@@ -1,120 +0,0 @@
1
- editAreaLoader.load_syntax["coldfusion"] = {
2
- 'DISPLAY_NAME' : 'Coldfusion'
3
- ,'COMMENT_SINGLE' : {1 : '//', 2 : '#'}
4
- ,'COMMENT_MULTI' : {'<!--' : '-->'}
5
- ,'COMMENT_MULTI2' : {'<!---' : '--->'}
6
- ,'QUOTEMARKS' : {1: "'", 2: '"'}
7
- ,'KEYWORD_CASE_SENSITIVE' : false
8
- ,'KEYWORDS' : {
9
- 'statements' : [
10
- 'include', 'require', 'include_once', 'require_once',
11
- 'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile',
12
- 'endif', 'switch', 'case', 'endswitch',
13
- 'return', 'break', 'continue'
14
- ]
15
- ,'reserved' : [
16
- 'AND', 'break', 'case', 'CONTAIN', 'CONTAINS', 'continue', 'default', 'do',
17
- 'DOES', 'else', 'EQ', 'EQUAL', 'EQUALTO', 'EQV', 'FALSE', 'for', 'GE',
18
- 'GREATER', 'GT', 'GTE', 'if', 'IMP', 'in', 'IS', 'LE', 'LESS', 'LT', 'LTE',
19
- 'MOD', 'NEQ', 'NOT', 'OR', 'return', 'switch', 'THAN', 'TO', 'TRUE', 'var',
20
- 'while', 'XOR'
21
- ]
22
- ,'functions' : [
23
- 'Abs', 'ACos', 'ArrayAppend', 'ArrayAvg', 'ArrayClear', 'ArrayDeleteAt', 'ArrayInsertAt',
24
- 'ArrayIsEmpty', 'ArrayLen', 'ArrayMax', 'ArrayMin', 'ArrayNew', 'ArrayPrepend', 'ArrayResize',
25
- 'ArraySet', 'ArraySort', 'ArraySum', 'ArraySwap', 'ArrayToList', 'Asc', 'ASin', 'Atn', 'AuthenticatedContext',
26
- 'AuthenticatedUser', 'BitAnd', 'BitMaskClear', 'BitMaskRead', 'BitMaskSet', 'BitNot', 'BitOr',
27
- 'BitSHLN', 'BitSHRN', 'BitXor', 'Ceiling', 'Chr', 'CJustify', 'Compare', 'CompareNoCase', 'Cos',
28
- 'CreateDate', 'CreateDateTime', 'CreateODBCDate', 'CreateODBCDateTime', 'CreateODBCTime',
29
- 'CreateTime', 'CreateTimeSpan', 'DateAdd', 'DateCompare', 'DateConvert', 'DateDiff',
30
- 'DateFormat', 'DatePart', 'Day', 'DayOfWeek', 'DayOfWeekAsString', 'DayOfYear', 'DaysInMonth',
31
- 'DaysInYear', 'DE', 'DecimalFormat', 'DecrementValue', 'Decrypt', 'DeleteClientVariable',
32
- 'DirectoryExists', 'DollarFormat', 'Duplicate', 'Encrypt', 'Evaluate', 'Exp', 'ExpandPath',
33
- 'FileExists', 'Find', 'FindNoCase', 'FindOneOf', 'FirstDayOfMonth', 'Fix', 'FormatBaseN',
34
- 'GetBaseTagData', 'GetBaseTagList', 'GetBaseTemplatePath', 'GetClientVariablesList',
35
- 'GetCurrentTemplatePath', 'GetDirectoryFromPath', 'GetException', 'GetFileFromPath',
36
- 'GetFunctionList', 'GetHttpTimeString', 'GetHttpRequestData', 'GetLocale', 'GetMetricData',
37
- 'GetProfileString', 'GetTempDirectory', 'GetTempFile', 'GetTemplatePath', 'GetTickCount',
38
- 'GetTimeZoneInfo', 'GetToken', 'Hash', 'Hour', 'HTMLCodeFormat', 'HTMLEditFormat', 'IIf',
39
- 'IncrementValue', 'InputBaseN', 'Insert', 'Int', 'IsArray', 'IsAuthenticated', 'IsAuthorized',
40
- 'IsBoolean', 'IsBinary', 'IsCustomFunction', 'IsDate', 'IsDebugMode', 'IsDefined', 'IsLeapYear',
41
- 'IsNumeric', 'IsNumericDate', 'IsProtected', 'IsQuery', 'IsSimpleValue', 'IsStruct', 'IsWDDX',
42
- 'JavaCast', 'JSStringFormat', 'LCase', 'Left', 'Len', 'ListAppend', 'ListChangeDelims',
43
- 'ListContains', 'ListContainsNoCase', 'ListDeleteAt', 'ListFind', 'ListFindNoCase', 'ListFirst',
44
- 'ListGetAt', 'ListInsertAt', 'ListLast', 'ListLen', 'ListPrepend', 'ListQualify', 'ListRest',
45
- 'ListSetAt', 'ListSort', 'ListToArray', 'ListValueCount', 'ListValueCountNoCase', 'LJustify',
46
- 'Log', 'Log10', 'LSCurrencyFormat', 'LSDateFormat', 'LSEuroCurrencyFormat', 'LSIsCurrency',
47
- 'LSIsDate', 'LSIsNumeric', 'LSNumberFormat', 'LSParseCurrency', 'LSParseDateTime', 'LSParseNumber',
48
- 'LSTimeFormat', 'LTrim', 'Max', 'Mid', 'Min', 'Minute', 'Month', 'MonthAsString', 'Now', 'NumberFormat',
49
- 'ParagraphFormat', 'ParameterExists', 'ParseDateTime', 'Pi', 'PreserveSingleQuotes', 'Quarter',
50
- 'QueryAddRow', 'QueryNew', 'QuerySetCell', 'QuotedValueList', 'Rand', 'Randomize', 'RandRange',
51
- 'REFind', 'REFindNoCase', 'RemoveChars', 'RepeatString', 'Replace', 'ReplaceList', 'ReplaceNoCase',
52
- 'REReplace', 'REReplaceNoCase', 'Reverse', 'Right', 'RJustify', 'Round', 'RTrim', 'Second', 'SetLocale',
53
- 'SetProfileString', 'SetVariable', 'Sgn', 'Sin', 'SpanExcluding', 'SpanIncluding', 'Sqr', 'StripCR',
54
- 'StructAppend', 'StructClear', 'StructCopy', 'StructCount', 'StructDelete', 'StructFind', 'StructFindKey',
55
- 'StructFindValue', 'StructGet', 'StructInsert', 'StructIsEmpty', 'StructKeyArray', 'StructKeyExists',
56
- 'StructKeyList', 'StructNew', 'StructSort', 'StructUpdate', 'Tan', 'TimeFormat', 'ToBase64', 'ToBinary',
57
- 'ToString', 'Trim', 'UCase', 'URLDecode', 'URLEncodedFormat', 'Val', 'ValueList', 'Week', 'WriteOutput',
58
- 'XMLFormat', 'Year', 'YesNoFormat'
59
- ]
60
- }
61
- ,'OPERATORS' :[
62
- '+', '-', '/', '*', '%', '!', '&&', '||'
63
- ]
64
- ,'DELIMITERS' :[
65
- '(', ')', '[', ']', '{', '}'
66
- ]
67
- ,'REGEXPS' : {
68
- 'doctype' : {
69
- 'search' : '()(<!DOCTYPE[^>]*>)()'
70
- ,'class' : 'doctype'
71
- ,'modifiers' : ''
72
- ,'execute' : 'before' // before or after
73
- }
74
- ,'cftags' : {
75
- 'search' : '(<)(/cf[a-z][^ \r\n\t>]*)([^>]*>)'
76
- ,'class' : 'cftags'
77
- ,'modifiers' : 'gi'
78
- ,'execute' : 'before' // before or after
79
- }
80
- ,'cftags2' : {
81
- 'search' : '(<)(cf[a-z][^ \r\n\t>]*)([^>]*>)'
82
- ,'class' : 'cftags2'
83
- ,'modifiers' : 'gi'
84
- ,'execute' : 'before' // before or after
85
- }
86
- ,'tags' : {
87
- 'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
88
- ,'class' : 'tags'
89
- ,'modifiers' : 'gi'
90
- ,'execute' : 'before' // before or after
91
- }
92
- ,'attributes' : {
93
- 'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
94
- ,'class' : 'attributes'
95
- ,'modifiers' : 'g'
96
- ,'execute' : 'before' // before or after
97
- }
98
- }
99
- ,'STYLES' : {
100
- 'COMMENTS': 'color: #AAAAAA;'
101
- ,'QUOTESMARKS': 'color: #6381F8;'
102
- ,'KEYWORDS' : {
103
- 'reserved' : 'color: #48BDDF;'
104
- ,'functions' : 'color: #0000FF;'
105
- ,'statements' : 'color: #60CA00;'
106
- }
107
- ,'OPERATORS' : 'color: #E775F0;'
108
- ,'DELIMITERS' : ''
109
- ,'REGEXPS' : {
110
- 'attributes': 'color: #990033;'
111
- ,'cftags': 'color: #990033;'
112
- ,'cftags2': 'color: #990033;'
113
- ,'tags': 'color: #000099;'
114
- ,'doctype': 'color: #8DCFB5;'
115
- ,'test': 'color: #00FF00;'
116
- }
117
- }
118
- };
119
-
120
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/reg_syntax/cpp.js DELETED
@@ -1,66 +0,0 @@
1
- editAreaLoader.load_syntax["cpp"] = {
2
- 'DISPLAY_NAME' : 'CPP'
3
- ,'COMMENT_SINGLE' : {1 : '//'}
4
- ,'COMMENT_MULTI' : {'/*' : '*/'}
5
- ,'QUOTEMARKS' : {1: "'", 2: '"'}
6
- ,'KEYWORD_CASE_SENSITIVE' : true
7
- ,'KEYWORDS' : {
8
- 'constants' : [
9
- 'NULL', 'false', 'std', 'stdin', 'stdout', 'stderr',
10
- 'true'
11
- ]
12
- ,'types' : [
13
- 'FILE', 'auto', 'char', 'class', 'const', 'double',
14
- 'extern', 'float', 'friend', 'inline', 'int',
15
- 'iterator', 'long', 'map', 'operator', 'queue',
16
- 'register', 'short', 'signed', 'size_t', 'stack',
17
- 'static', 'string', 'struct', 'time_t', 'typedef',
18
- 'union', 'unsigned', 'vector', 'void', 'volatile'
19
- ]
20
- ,'statements' : [
21
- 'catch', 'do', 'else', 'enum', 'for', 'goto', 'if',
22
- 'sizeof', 'switch', 'this', 'throw', 'try', 'while'
23
- ]
24
- ,'keywords' : [
25
- 'break', 'case', 'continue', 'default', 'delete',
26
- 'namespace', 'new', 'private', 'protected', 'public',
27
- 'return', 'using'
28
- ]
29
- }
30
- ,'OPERATORS' :[
31
- '+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
32
- ]
33
- ,'DELIMITERS' :[
34
- '(', ')', '[', ']', '{', '}'
35
- ]
36
- ,'REGEXPS' : {
37
- 'precompiler' : {
38
- 'search' : '()(#[^\r\n]*)()'
39
- ,'class' : 'precompiler'
40
- ,'modifiers' : 'g'
41
- ,'execute' : 'before'
42
- }
43
- /* ,'precompilerstring' : {
44
- 'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])'
45
- ,'class' : 'precompilerstring'
46
- ,'modifiers' : 'g'
47
- ,'execute' : 'before'
48
- }*/
49
- }
50
- ,'STYLES' : {
51
- 'COMMENTS': 'color: #AAAAAA;'
52
- ,'QUOTESMARKS': 'color: #6381F8;'
53
- ,'KEYWORDS' : {
54
- 'constants' : 'color: #EE0000;'
55
- ,'types' : 'color: #0000EE;'
56
- ,'statements' : 'color: #60CA00;'
57
- ,'keywords' : 'color: #48BDDF;'
58
- }
59
- ,'OPERATORS' : 'color: #FF00FF;'
60
- ,'DELIMITERS' : 'color: #0038E1;'
61
- ,'REGEXPS' : {
62
- 'precompiler' : 'color: #009900;'
63
- ,'precompilerstring' : 'color: #994400;'
64
- }
65
- }
66
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/reg_syntax/css.js DELETED
@@ -1,85 +0,0 @@
1
- editAreaLoader.load_syntax["css"] = {
2
- 'DISPLAY_NAME' : 'CSS'
3
- ,'COMMENT_SINGLE' : {1 : '@'}
4
- ,'COMMENT_MULTI' : {'/*' : '*/'}
5
- ,'QUOTEMARKS' : ['"', "'"]
6
- ,'KEYWORD_CASE_SENSITIVE' : false
7
- ,'KEYWORDS' : {
8
- 'attributes' : [
9
- 'aqua', 'azimuth', 'background-attachment', 'background-color',
10
- 'background-image', 'background-position', 'background-repeat',
11
- 'background', 'border-bottom-color', 'border-bottom-style',
12
- 'border-bottom-width', 'border-left-color', 'border-left-style',
13
- 'border-left-width', 'border-right', 'border-right-color',
14
- 'border-right-style', 'border-right-width', 'border-top-color',
15
- 'border-top-style', 'border-top-width','border-bottom', 'border-collapse',
16
- 'border-left', 'border-width', 'border-color', 'border-spacing',
17
- 'border-style', 'border-top', 'border', 'caption-side',
18
- 'clear', 'clip', 'color', 'content', 'counter-increment', 'counter-reset',
19
- 'cue-after', 'cue-before', 'cue', 'cursor', 'direction', 'display',
20
- 'elevation', 'empty-cells', 'float', 'font-family', 'font-size',
21
- 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant',
22
- 'font-weight', 'font', 'height', 'letter-spacing', 'line-height',
23
- 'list-style', 'list-style-image', 'list-style-position', 'list-style-type',
24
- 'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'margin',
25
- 'marker-offset', 'marks', 'max-height', 'max-width', 'min-height',
26
- 'min-width', 'opacity', 'orphans', 'outline', 'outline-color', 'outline-style',
27
- 'outline-width', 'overflow', 'padding-bottom', 'padding-left',
28
- 'padding-right', 'padding-top', 'padding', 'page', 'page-break-after',
29
- 'page-break-before', 'page-break-inside', 'pause-after', 'pause-before',
30
- 'pause', 'pitch', 'pitch-range', 'play-during', 'position', 'quotes',
31
- 'richness', 'right', 'size', 'speak-header', 'speak-numeral', 'speak-punctuation',
32
- 'speak', 'speech-rate', 'stress', 'table-layout', 'text-align', 'text-decoration',
33
- 'text-indent', 'text-shadow', 'text-transform', 'top', 'unicode-bidi',
34
- 'vertical-align', 'visibility', 'voice-family', 'volume', 'white-space', 'widows',
35
- 'width', 'word-spacing', 'z-index', 'bottom', 'left'
36
- ]
37
- ,'values' : [
38
- 'above', 'absolute', 'always', 'armenian', 'aural', 'auto', 'avoid',
39
- 'baseline', 'behind', 'below', 'bidi-override', 'black', 'blue', 'blink', 'block', 'bold', 'bolder', 'both',
40
- 'capitalize', 'center-left', 'center-right', 'center', 'circle', 'cjk-ideographic',
41
- 'close-quote', 'collapse', 'condensed', 'continuous', 'crop', 'crosshair', 'cross', 'cursive',
42
- 'dashed', 'decimal-leading-zero', 'decimal', 'default', 'digits', 'disc', 'dotted', 'double',
43
- 'e-resize', 'embed', 'extra-condensed', 'extra-expanded', 'expanded',
44
- 'fantasy', 'far-left', 'far-right', 'faster', 'fast', 'fixed', 'fuchsia',
45
- 'georgian', 'gray', 'green', 'groove', 'hebrew', 'help', 'hidden', 'hide', 'higher',
46
- 'high', 'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table', 'inline',
47
- 'inset', 'inside', 'invert', 'italic', 'justify', 'katakana-iroha', 'katakana',
48
- 'landscape', 'larger', 'large', 'left-side', 'leftwards', 'level', 'lighter', 'lime', 'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek', 'lower-roman', 'lowercase', 'ltr', 'lower', 'low',
49
- 'maroon', 'medium', 'message-box', 'middle', 'mix', 'monospace',
50
- 'n-resize', 'narrower', 'navy', 'ne-resize', 'no-close-quote', 'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap', 'nw-resize',
51
- 'oblique', 'olive', 'once', 'open-quote', 'outset', 'outside', 'overline',
52
- 'pointer', 'portrait', 'purple', 'px',
53
- 'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb', 'ridge', 'right-side', 'rightwards',
54
- 's-resize', 'sans-serif', 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded', 'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower', 'small-caps', 'small-caption', 'smaller', 'soft', 'solid', 'spell-out', 'square',
55
- 'static', 'status-bar', 'super', 'sw-resize',
56
- 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row', 'table-row-group', 'teal', 'text', 'text-bottom', 'text-top', 'thick', 'thin', 'transparent',
57
- 'ultra-condensed', 'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin', 'upper-roman', 'uppercase', 'url',
58
- 'visible',
59
- 'w-resize', 'wait', 'white', 'wider',
60
- 'x-fast', 'x-high', 'x-large', 'x-loud', 'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small',
61
- 'yellow', 'yes'
62
- ]
63
- ,'specials' : [
64
- 'important'
65
- ]
66
- }
67
- ,'OPERATORS' :[
68
- ':', ';', '!', '.', '#'
69
- ]
70
- ,'DELIMITERS' :[
71
- '{', '}'
72
- ]
73
- ,'STYLES' : {
74
- 'COMMENTS': 'color: #AAAAAA;'
75
- ,'QUOTESMARKS': 'color: #6381F8;'
76
- ,'KEYWORDS' : {
77
- 'attributes' : 'color: #48BDDF;'
78
- ,'values' : 'color: #2B60FF;'
79
- ,'specials' : 'color: #FF0000;'
80
- }
81
- ,'OPERATORS' : 'color: #FF00FF;'
82
- ,'DELIMITERS' : 'color: #60CA00;'
83
-
84
- }
85
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/reg_syntax/html.js DELETED
@@ -1,51 +0,0 @@
1
- /*
2
- * last update: 2006-08-24
3
- */
4
-
5
- editAreaLoader.load_syntax["html"] = {
6
- 'DISPLAY_NAME' : 'HTML'
7
- ,'COMMENT_SINGLE' : {}
8
- ,'COMMENT_MULTI' : {'<!--' : '-->'}
9
- ,'QUOTEMARKS' : {1: "'", 2: '"'}
10
- ,'KEYWORD_CASE_SENSITIVE' : false
11
- ,'KEYWORDS' : {
12
- }
13
- ,'OPERATORS' :[
14
- ]
15
- ,'DELIMITERS' :[
16
- ]
17
- ,'REGEXPS' : {
18
- 'doctype' : {
19
- 'search' : '()(<!DOCTYPE[^>]*>)()'
20
- ,'class' : 'doctype'
21
- ,'modifiers' : ''
22
- ,'execute' : 'before' // before or after
23
- }
24
- ,'tags' : {
25
- 'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
26
- ,'class' : 'tags'
27
- ,'modifiers' : 'gi'
28
- ,'execute' : 'before' // before or after
29
- }
30
- ,'attributes' : {
31
- 'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
32
- ,'class' : 'attributes'
33
- ,'modifiers' : 'g'
34
- ,'execute' : 'before' // before or after
35
- }
36
- }
37
- ,'STYLES' : {
38
- 'COMMENTS': 'color: #AAAAAA;'
39
- ,'QUOTESMARKS': 'color: #6381F8;'
40
- ,'KEYWORDS' : {
41
- }
42
- ,'OPERATORS' : 'color: #E775F0;'
43
- ,'DELIMITERS' : ''
44
- ,'REGEXPS' : {
45
- 'attributes': 'color: #B1AC41;'
46
- ,'tags': 'color: #E62253;'
47
- ,'doctype': 'color: #8DCFB5;'
48
- ,'test': 'color: #00FF00;'
49
- }
50
- }
51
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/reg_syntax/java.js DELETED
@@ -1,57 +0,0 @@
1
- editAreaLoader.load_syntax["java"] = {
2
- 'DISPLAY_NAME' : 'Java'
3
- ,'COMMENT_SINGLE': { 1: '//', 2: '@' }
4
- , 'COMMENT_MULTI': { '/*': '*/' }
5
- , 'QUOTEMARKS': { 1: "'", 2: '"' }
6
- , 'KEYWORD_CASE_SENSITIVE': true
7
- , 'KEYWORDS': {
8
- 'constants': [
9
- 'null', 'false', 'true'
10
- ]
11
- , 'types': [
12
- 'String', 'int', 'short', 'long', 'char', 'double', 'byte',
13
- 'float', 'static', 'void', 'private', 'boolean', 'protected',
14
- 'public', 'const', 'class', 'final', 'abstract', 'volatile',
15
- 'enum', 'transient', 'interface'
16
- ]
17
- , 'statements': [
18
- 'this', 'extends', 'if', 'do', 'while', 'try', 'catch', 'finally',
19
- 'throw', 'throws', 'else', 'for', 'switch', 'continue', 'implements',
20
- 'break', 'case', 'default', 'goto'
21
- ]
22
- , 'keywords': [
23
- 'new', 'return', 'import', 'native', 'super', 'package', 'assert', 'synchronized',
24
- 'instanceof', 'strictfp'
25
- ]
26
- }
27
- , 'OPERATORS': [
28
- '+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
29
- ]
30
- , 'DELIMITERS': [
31
- '(', ')', '[', ']', '{', '}'
32
- ]
33
- , 'REGEXPS': {
34
- 'precompiler': {
35
- 'search': '()(#[^\r\n]*)()'
36
- , 'class': 'precompiler'
37
- , 'modifiers': 'g'
38
- , 'execute': 'before'
39
- }
40
- }
41
- , 'STYLES': {
42
- 'COMMENTS': 'color: #AAAAAA;'
43
- , 'QUOTESMARKS': 'color: #6381F8;'
44
- , 'KEYWORDS': {
45
- 'constants': 'color: #EE0000;'
46
- , 'types': 'color: #0000EE;'
47
- , 'statements': 'color: #60CA00;'
48
- , 'keywords': 'color: #48BDDF;'
49
- }
50
- , 'OPERATORS': 'color: #FF00FF;'
51
- , 'DELIMITERS': 'color: #0038E1;'
52
- , 'REGEXPS': {
53
- 'precompiler': 'color: #009900;'
54
- , 'precompilerstring': 'color: #994400;'
55
- }
56
- }
57
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/reg_syntax/js.js DELETED
@@ -1,94 +0,0 @@
1
- editAreaLoader.load_syntax["js"] = {
2
- 'DISPLAY_NAME' : 'Javascript'
3
- ,'COMMENT_SINGLE' : {1 : '//'}
4
- ,'COMMENT_MULTI' : {'/*' : '*/'}
5
- ,'QUOTEMARKS' : {1: "'", 2: '"'}
6
- ,'KEYWORD_CASE_SENSITIVE' : false
7
- ,'KEYWORDS' : {
8
- 'statements' : [
9
- 'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
10
- 'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
11
- 'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
12
- 'while', 'write', 'with'
13
- ]
14
- ,'keywords' : [
15
- 'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
16
- 'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
17
- 'protected', 'public', 'super', 'true', 'use', 'var', 'window', 'document',
18
- // the list below must be sorted and checked (if it is a keywords or a function and if it is not present twice
19
- 'Link ', 'outerHeight ', 'Anchor', 'FileUpload',
20
- 'location', 'outerWidth', 'Select', 'Area', 'find', 'Location', 'Packages', 'self',
21
- 'arguments', 'locationbar', 'pageXoffset', 'Form',
22
- 'Math', 'pageYoffset', 'setTimeout', 'assign', 'Frame', 'menubar', 'parent', 'status',
23
- 'blur', 'frames', 'MimeType', 'parseFloat', 'statusbar', 'Boolean', 'Function', 'moveBy',
24
- 'parseInt', 'stop', 'Button', 'getClass', 'moveTo', 'Password', 'String', 'callee', 'Hidden',
25
- 'name', 'personalbar', 'Submit', 'caller', 'history', 'NaN', 'Plugin', 'sun', 'captureEvents',
26
- 'History', 'navigate', 'print', 'taint', 'Checkbox', 'home', 'navigator', 'prompt', 'Text',
27
- 'Image', 'Navigator', 'prototype', 'Textarea', 'clearTimeout', 'Infinity',
28
- 'netscape', 'Radio', 'toolbar', 'close', 'innerHeight', 'Number', 'ref', 'top', 'closed',
29
- 'innerWidth', 'Object', 'RegExp', 'toString', 'confirm', 'isFinite', 'onBlur', 'releaseEvents',
30
- 'unescape', 'constructor', 'isNan', 'onError', 'Reset', 'untaint', 'Date', 'java', 'onFocus',
31
- 'resizeBy', 'unwatch', 'defaultStatus', 'JavaArray', 'onLoad', 'resizeTo', 'valueOf', 'document',
32
- 'JavaClass', 'onUnload', 'routeEvent', 'watch', 'Document', 'JavaObject', 'open', 'scroll', 'window',
33
- 'Element', 'JavaPackage', 'opener', 'scrollbars', 'Window', 'escape', 'length', 'Option', 'scrollBy'
34
- ]
35
- ,'functions' : [
36
- // common functions for Window object
37
- 'alert', 'Array', 'back', 'blur', 'clearInterval', 'close', 'confirm', 'eval ', 'focus', 'forward', 'home',
38
- 'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
39
- 'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'scrollTo', 'setInterval', 'status',
40
- 'stop'
41
- ]
42
- }
43
- ,'OPERATORS' :[
44
- '+', '-', '/', '*', '=', '<', '>', '%', '!'
45
- ]
46
- ,'DELIMITERS' :[
47
- '(', ')', '[', ']', '{', '}'
48
- ]
49
- ,'STYLES' : {
50
- 'COMMENTS': 'color: #AAAAAA;'
51
- ,'QUOTESMARKS': 'color: #6381F8;'
52
- ,'KEYWORDS' : {
53
- 'statements' : 'color: #60CA00;'
54
- ,'keywords' : 'color: #48BDDF;'
55
- ,'functions' : 'color: #2B60FF;'
56
- }
57
- ,'OPERATORS' : 'color: #FF00FF;'
58
- ,'DELIMITERS' : 'color: #0038E1;'
59
-
60
- }
61
- ,'AUTO_COMPLETION' : {
62
- "default": { // the name of this definition group. It's posisble to have different rules inside the same definition file
63
- "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.|
64
- ,"possible_words_letters": "[a-zA-Z0-9_]+"
65
- ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
66
- ,"prefix_separator": "\\."
67
- }
68
- ,"CASE_SENSITIVE": true
69
- ,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position
70
- ,"KEYWORDS": {
71
- '': [ // the prefix of thoses items
72
- /**
73
- * 0 : the keyword the user is typing
74
- * 1 : (optionnal) the string inserted in code ("{@}" being the new position of the cursor, "§" beeing the equivalent to the value the typed string indicated if the previous )
75
- * If empty the keyword will be displayed
76
- * 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed)
77
- */
78
- ['Array', '§()', '']
79
- ,['alert', '§({@})', 'alert(String message)']
80
- ,['document']
81
- ,['window']
82
- ]
83
- ,'window' : [
84
- ['location']
85
- ,['document']
86
- ,['scrollTo', 'scrollTo({@})', 'scrollTo(Int x,Int y)']
87
- ]
88
- ,'location' : [
89
- ['href']
90
- ]
91
- }
92
- }
93
- }
94
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/reg_syntax/pas.js DELETED
@@ -1,83 +0,0 @@
1
- editAreaLoader.load_syntax["pas"] = {
2
- 'DISPLAY_NAME' : 'Pascal'
3
- ,'COMMENT_SINGLE' : {}
4
- ,'COMMENT_MULTI' : {'{' : '}', '(*':'*)'}
5
- ,'QUOTEMARKS' : {1: '"', 2: "'"}
6
- ,'KEYWORD_CASE_SENSITIVE' : false
7
- ,'KEYWORDS' : {
8
- 'constants' : [
9
- 'Blink', 'Black', 'Blue', 'Green', 'Cyan', 'Red',
10
- 'Magenta', 'Brown', 'LightGray', 'DarkGray',
11
- 'LightBlue', 'LightGreen', 'LightCyan', 'LightRed',
12
- 'LightMagenta', 'Yellow', 'White', 'MaxSIntValue',
13
- 'MaxUIntValue', 'maxint', 'maxLongint', 'maxSmallint',
14
- 'erroraddr', 'errorcode', 'LineEnding'
15
- ]
16
- ,'keywords' : [
17
- 'in', 'or', 'div', 'mod', 'and', 'shl', 'shr', 'xor',
18
- 'pow', 'is', 'not','Absolute', 'And_then', 'Array',
19
- 'Begin', 'Bindable', 'Case', 'Const', 'Do', 'Downto',
20
- 'Else', 'End', 'Export', 'File', 'For', 'Function',
21
- 'Goto', 'If', 'Import', 'Implementation', 'Inherited',
22
- 'Inline', 'Interface', 'Label', 'Module', 'Nil',
23
- 'Object', 'Of', 'Only', 'Operator', 'Or_else',
24
- 'Otherwise', 'Packed', 'Procedure', 'Program',
25
- 'Protected', 'Qualified', 'Record', 'Repeat',
26
- 'Restricted', 'Set', 'Then', 'To', 'Type', 'Unit',
27
- 'Until', 'Uses', 'Value', 'Var', 'Virtual', 'While',
28
- 'With'
29
- ]
30
- ,'functions' : [
31
- 'Abs', 'Addr', 'Append', 'Arctan', 'Assert', 'Assign',
32
- 'Assigned', 'BinStr', 'Blockread', 'Blockwrite',
33
- 'Break', 'Chdir', 'Chr', 'Close', 'CompareByte',
34
- 'CompareChar', 'CompareDWord', 'CompareWord', 'Concat',
35
- 'Continue', 'Copy', 'Cos', 'CSeg', 'Dec', 'Delete',
36
- 'Dispose', 'DSeg', 'Eof', 'Eoln', 'Erase', 'Exclude',
37
- 'Exit', 'Exp', 'Filepos', 'Filesize', 'FillByte',
38
- 'Fillchar', 'FillDWord', 'Fillword', 'Flush', 'Frac',
39
- 'Freemem', 'Getdir', 'Getmem', 'GetMemoryManager',
40
- 'Halt', 'HexStr', 'Hi', 'High', 'Inc', 'Include',
41
- 'IndexByte', 'IndexChar', 'IndexDWord', 'IndexWord',
42
- 'Insert', 'IsMemoryManagerSet', 'Int', 'IOresult',
43
- 'Length', 'Ln', 'Lo', 'LongJmp', 'Low', 'Lowercase',
44
- 'Mark', 'Maxavail', 'Memavail', 'Mkdir', 'Move',
45
- 'MoveChar0', 'New', 'Odd', 'OctStr', 'Ofs', 'Ord',
46
- 'Paramcount', 'Paramstr', 'Pi', 'Pos', 'Power', 'Pred',
47
- 'Ptr', 'Random', 'Randomize', 'Read', 'Readln',
48
- 'Real2Double', 'Release', 'Rename', 'Reset', 'Rewrite',
49
- 'Rmdir', 'Round', 'Runerror', 'Seek', 'SeekEof',
50
- 'SeekEoln', 'Seg', 'SetMemoryManager', 'SetJmp',
51
- 'SetLength', 'SetString', 'SetTextBuf', 'Sin', 'SizeOf',
52
- 'Sptr', 'Sqr', 'Sqrt', 'SSeg', 'Str', 'StringOfChar',
53
- 'Succ', 'Swap', 'Trunc', 'Truncate', 'Upcase', 'Val',
54
- 'Write', 'WriteLn'
55
- ]
56
- ,'types' : [
57
- 'Integer', 'Shortint', 'SmallInt', 'Longint',
58
- 'Longword', 'Int64', 'Byte', 'Word', 'Cardinal',
59
- 'QWord', 'Boolean', 'ByteBool', 'LongBool', 'Char',
60
- 'Real', 'Single', 'Double', 'Extended', 'Comp',
61
- 'String', 'ShortString', 'AnsiString', 'PChar'
62
- ]
63
- }
64
- ,'OPERATORS' :[
65
- '@', '*', '+', '-', '/', '^', ':=', '<', '=', '>'
66
- ]
67
- ,'DELIMITERS' :[
68
- '(', ')', '[', ']'
69
- ]
70
- ,'STYLES' : {
71
- 'COMMENTS': 'color: #AAAAAA;'
72
- ,'QUOTESMARKS': 'color: #6381F8;'
73
- ,'KEYWORDS' : {
74
- 'specials' : 'color: #EE0000;'
75
- ,'constants' : 'color: #654321;'
76
- ,'keywords' : 'color: #48BDDF;'
77
- ,'functions' : 'color: #449922;'
78
- ,'types' : 'color: #2B60FF;'
79
- }
80
- ,'OPERATORS' : 'color: #FF00FF;'
81
- ,'DELIMITERS' : 'color: #60CA00;'
82
- }
83
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/reg_syntax/perl.js DELETED
@@ -1,88 +0,0 @@
1
- /***************************************************************************
2
- * (c) 2008 - file created by Christoph Pinkel, MTC Infomedia OHG.
3
- *
4
- * You may choose any license of the current release or any future release
5
- * of editarea to use, modify and/or redistribute this file.
6
- *
7
- * This language specification file supports for syntax checking on
8
- * a large subset of Perl 5.x.
9
- * The basic common syntax of Perl is fully supported, but as for
10
- * the highlighting of built-in operations, it's mainly designed
11
- * to support for hightlighting Perl code in a Safe environment (compartment)
12
- * as used by CoMaNet for evaluation of administrative scripts. This Safe
13
- * compartment basically allows for all of Opcode's :default operations,
14
- * but little others. See http://perldoc.perl.org/Opcode.html to learn
15
- * more.
16
- ***************************************************************************/
17
-
18
- editAreaLoader.load_syntax["perl"] = {
19
- 'DISPLAY_NAME' : 'Perl',
20
- 'COMMENT_SINGLE' : {1 : '#'},
21
- 'QUOTEMARKS' : {1: "'", 2: '"'},
22
- 'KEYWORD_CASE_SENSITIVE' : true,
23
- 'KEYWORDS' :
24
- {
25
- 'core' :
26
- [ "if", "else", "elsif", "while", "for", "each", "foreach",
27
- "next", "last", "goto", "exists", "delete", "undef",
28
- "my", "our", "local", "use", "require", "package", "keys", "values",
29
- "sub", "bless", "ref", "return" ],
30
- 'functions' :
31
- [
32
- //from :base_core
33
- "int", "hex", "oct", "abs", "substr", "vec", "study", "pos",
34
- "length", "index", "rindex", "ord", "chr", "ucfirst", "lcfirst",
35
- "uc", "lc", "quotemeta", "chop", "chomp", "split", "list", "splice",
36
- "push", "pop", "shift", "unshift", "reverse", "and", "or", "dor",
37
- "xor", "warn", "die", "prototype",
38
- //from :base_mem
39
- "concat", "repeat", "join", "range",
40
- //none from :base_loop, as we'll see them as basic statements...
41
- //from :base_orig
42
- "sprintf", "crypt", "tie", "untie", "select", "localtime", "gmtime",
43
- //others
44
- "print", "open", "close"
45
- ]
46
- },
47
- 'OPERATORS' :
48
- [ '+', '-', '/', '*', '=', '<', '>', '!', '||', '.', '&&',
49
- ' eq ', ' ne ', '=~' ],
50
- 'DELIMITERS' :
51
- [ '(', ')', '[', ']', '{', '}' ],
52
- 'REGEXPS' :
53
- {
54
- 'packagedecl' : { 'search': '(package )([^ \r\n\t#;]*)()',
55
- 'class' : 'scopingnames',
56
- 'modifiers' : 'g', 'execute' : 'before' },
57
- 'subdecl' : { 'search': '(sub )([^ \r\n\t#]*)()',
58
- 'class' : 'scopingnames',
59
- 'modifiers' : 'g', 'execute' : 'before' },
60
- 'scalars' : { 'search': '()(\\\$[a-zA-Z0-9_:]*)()',
61
- 'class' : 'vars',
62
- 'modifiers' : 'g', 'execute' : 'after' },
63
- 'arrays' : { 'search': '()(@[a-zA-Z0-9_:]*)()',
64
- 'class' : 'vars',
65
- 'modifiers' : 'g', 'execute' : 'after' },
66
- 'hashs' : { 'search': '()(%[a-zA-Z0-9_:]*)()',
67
- 'class' : 'vars',
68
- 'modifiers' : 'g', 'execute' : 'after' },
69
- },
70
-
71
- 'STYLES' :
72
- {
73
- 'COMMENTS': 'color: #AAAAAA;',
74
- 'QUOTESMARKS': 'color: #DC0000;',
75
- 'KEYWORDS' :
76
- {
77
- 'core' : 'color: #8aca00;',
78
- 'functions' : 'color: #2B60FF;'
79
- },
80
- 'OPERATORS' : 'color: #8aca00;',
81
- 'DELIMITERS' : 'color: #0038E1;',
82
- 'REGEXPS':
83
- {
84
- 'scopingnames' : 'color: #ff0000;',
85
- 'vars' : 'color: #00aaaa;',
86
- }
87
- } //'STYLES'
88
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/reg_syntax/php.js DELETED
@@ -1,157 +0,0 @@
1
- editAreaLoader.load_syntax["php"] = {
2
- 'DISPLAY_NAME' : 'Php'
3
- ,'COMMENT_SINGLE' : {1 : '//', 2 : '#'}
4
- ,'COMMENT_MULTI' : {'/*' : '*/'}
5
- ,'QUOTEMARKS' : {1: "'", 2: '"'}
6
- ,'KEYWORD_CASE_SENSITIVE' : false
7
- ,'KEYWORDS' : {
8
- 'statements' : [
9
- 'include', 'require', 'include_once', 'require_once',
10
- 'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile',
11
- 'endif', 'switch', 'case', 'endswitch',
12
- 'return', 'break', 'continue'
13
- ]
14
- ,'reserved' : [
15
- '_GET', '_POST', '_SESSION', '_SERVER', '_FILES', '_ENV', '_COOKIE', '_REQUEST',
16
- 'null', '__LINE__', '__FILE__',
17
- 'false', '&lt;?php', '?&gt;', '&lt;?',
18
- '&lt;script language', '&lt;/script&gt;',
19
- 'true', 'var', 'default',
20
- 'function', 'class', 'new', '&amp;new', 'this',
21
- '__FUNCTION__', '__CLASS__', '__METHOD__', 'PHP_VERSION',
22
- 'PHP_OS', 'DEFAULT_INCLUDE_PATH', 'PEAR_INSTALL_DIR', 'PEAR_EXTENSION_DIR',
23
- 'PHP_EXTENSION_DIR', 'PHP_BINDIR', 'PHP_LIBDIR', 'PHP_DATADIR', 'PHP_SYSCONFDIR',
24
- 'PHP_LOCALSTATEDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_OUTPUT_HANDLER_START', 'PHP_OUTPUT_HANDLER_CONT',
25
- 'PHP_OUTPUT_HANDLER_END', 'E_ERROR', 'E_WARNING', 'E_PARSE', 'E_NOTICE',
26
- 'E_CORE_ERROR', 'E_CORE_WARNING', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_USER_ERROR',
27
- 'E_USER_WARNING', 'E_USER_NOTICE', 'E_ALL'
28
-
29
- ]
30
- ,'functions' : [
31
- 'func_num_args', 'func_get_arg', 'func_get_args', 'strlen', 'strcmp', 'strncmp', 'strcasecmp', 'strncasecmp', 'each', 'error_reporting', 'define', 'defined',
32
- 'trigger_error', 'user_error', 'set_error_handler', 'restore_error_handler', 'get_declared_classes', 'get_loaded_extensions',
33
- 'extension_loaded', 'get_extension_funcs', 'debug_backtrace',
34
- 'constant', 'bin2hex', 'sleep', 'usleep', 'time', 'mktime', 'gmmktime', 'strftime', 'gmstrftime', 'strtotime', 'date', 'gmdate', 'getdate', 'localtime', 'checkdate', 'flush', 'wordwrap', 'htmlspecialchars', 'htmlentities', 'html_entity_decode', 'md5', 'md5_file', 'crc32', 'getimagesize', 'image_type_to_mime_type', 'phpinfo', 'phpversion', 'phpcredits', 'strnatcmp', 'strnatcasecmp', 'substr_count', 'strspn', 'strcspn', 'strtok', 'strtoupper', 'strtolower', 'strpos', 'strrpos', 'strrev', 'hebrev', 'hebrevc', 'nl2br', 'basename', 'dirname', 'pathinfo', 'stripslashes', 'stripcslashes', 'strstr', 'stristr', 'strrchr', 'str_shuffle', 'str_word_count', 'strcoll', 'substr', 'substr_replace', 'quotemeta', 'ucfirst', 'ucwords', 'strtr', 'addslashes', 'addcslashes', 'rtrim', 'str_replace', 'str_repeat', 'count_chars', 'chunk_split', 'trim', 'ltrim', 'strip_tags', 'similar_text', 'explode', 'implode', 'setlocale', 'localeconv',
35
- 'parse_str', 'str_pad', 'chop', 'strchr', 'sprintf', 'printf', 'vprintf', 'vsprintf', 'sscanf', 'fscanf', 'parse_url', 'urlencode', 'urldecode', 'rawurlencode', 'rawurldecode', 'readlink', 'linkinfo', 'link', 'unlink', 'exec', 'system', 'escapeshellcmd', 'escapeshellarg', 'passthru', 'shell_exec', 'proc_open', 'proc_close', 'rand', 'srand', 'getrandmax', 'mt_rand', 'mt_srand', 'mt_getrandmax', 'base64_decode', 'base64_encode', 'abs', 'ceil', 'floor', 'round', 'is_finite', 'is_nan', 'is_infinite', 'bindec', 'hexdec', 'octdec', 'decbin', 'decoct', 'dechex', 'base_convert', 'number_format', 'fmod', 'ip2long', 'long2ip', 'getenv', 'putenv', 'getopt', 'microtime', 'gettimeofday', 'getrusage', 'uniqid', 'quoted_printable_decode', 'set_time_limit', 'get_cfg_var', 'magic_quotes_runtime', 'set_magic_quotes_runtime', 'get_magic_quotes_gpc', 'get_magic_quotes_runtime',
36
- 'import_request_variables', 'error_log', 'serialize', 'unserialize', 'memory_get_usage', 'var_dump', 'var_export', 'debug_zval_dump', 'print_r','highlight_file', 'show_source', 'highlight_string', 'ini_get', 'ini_get_all', 'ini_set', 'ini_alter', 'ini_restore', 'get_include_path', 'set_include_path', 'restore_include_path', 'setcookie', 'header', 'headers_sent', 'connection_aborted', 'connection_status', 'ignore_user_abort', 'parse_ini_file', 'is_uploaded_file', 'move_uploaded_file', 'intval', 'floatval', 'doubleval', 'strval', 'gettype', 'settype', 'is_null', 'is_resource', 'is_bool', 'is_long', 'is_float', 'is_int', 'is_integer', 'is_double', 'is_real', 'is_numeric', 'is_string', 'is_array', 'is_object', 'is_scalar',
37
- 'ereg', 'ereg_replace', 'eregi', 'eregi_replace', 'split', 'spliti', 'join', 'sql_regcase', 'dl', 'pclose', 'popen', 'readfile', 'rewind', 'rmdir', 'umask', 'fclose', 'feof', 'fgetc', 'fgets', 'fgetss', 'fread', 'fopen', 'fpassthru', 'ftruncate', 'fstat', 'fseek', 'ftell', 'fflush', 'fwrite', 'fputs', 'mkdir', 'rename', 'copy', 'tempnam', 'tmpfile', 'file', 'file_get_contents', 'stream_select', 'stream_context_create', 'stream_context_set_params', 'stream_context_set_option', 'stream_context_get_options', 'stream_filter_prepend', 'stream_filter_append', 'fgetcsv', 'flock', 'get_meta_tags', 'stream_set_write_buffer', 'set_file_buffer', 'set_socket_blocking', 'stream_set_blocking', 'socket_set_blocking', 'stream_get_meta_data', 'stream_register_wrapper', 'stream_wrapper_register', 'stream_set_timeout', 'socket_set_timeout', 'socket_get_status', 'realpath', 'fnmatch', 'fsockopen', 'pfsockopen', 'pack', 'unpack', 'get_browser', 'crypt', 'opendir', 'closedir', 'chdir', 'getcwd', 'rewinddir', 'readdir', 'dir', 'glob', 'fileatime', 'filectime', 'filegroup', 'fileinode', 'filemtime', 'fileowner', 'fileperms', 'filesize', 'filetype', 'file_exists', 'is_writable', 'is_writeable', 'is_readable', 'is_executable', 'is_file', 'is_dir', 'is_link', 'stat', 'lstat', 'chown',
38
- 'touch', 'clearstatcache', 'mail', 'ob_start', 'ob_flush', 'ob_clean', 'ob_end_flush', 'ob_end_clean', 'ob_get_flush', 'ob_get_clean', 'ob_get_length', 'ob_get_level', 'ob_get_status', 'ob_get_contents', 'ob_implicit_flush', 'ob_list_handlers', 'ksort', 'krsort', 'natsort', 'natcasesort', 'asort', 'arsort', 'sort', 'rsort', 'usort', 'uasort', 'uksort', 'shuffle', 'array_walk', 'count', 'end', 'prev', 'next', 'reset', 'current', 'key', 'min', 'max', 'in_array', 'array_search', 'extract', 'compact', 'array_fill', 'range', 'array_multisort', 'array_push', 'array_pop', 'array_shift', 'array_unshift', 'array_splice', 'array_slice', 'array_merge', 'array_merge_recursive', 'array_keys', 'array_values', 'array_count_values', 'array_reverse', 'array_reduce', 'array_pad', 'array_flip', 'array_change_key_case', 'array_rand', 'array_unique', 'array_intersect', 'array_intersect_assoc', 'array_diff', 'array_diff_assoc', 'array_sum', 'array_filter', 'array_map', 'array_chunk', 'array_key_exists', 'pos', 'sizeof', 'key_exists', 'assert', 'assert_options', 'version_compare', 'ftok', 'str_rot13', 'aggregate',
39
- 'session_name', 'session_module_name', 'session_save_path', 'session_id', 'session_regenerate_id', 'session_decode', 'session_register', 'session_unregister', 'session_is_registered', 'session_encode',
40
- 'session_start', 'session_destroy', 'session_unset', 'session_set_save_handler', 'session_cache_limiter', 'session_cache_expire', 'session_set_cookie_params', 'session_get_cookie_params', 'session_write_close', 'preg_match', 'preg_match_all', 'preg_replace', 'preg_replace_callback', 'preg_split', 'preg_quote', 'preg_grep', 'overload', 'ctype_alnum', 'ctype_alpha', 'ctype_cntrl', 'ctype_digit', 'ctype_lower', 'ctype_graph', 'ctype_print', 'ctype_punct', 'ctype_space', 'ctype_upper', 'ctype_xdigit', 'virtual', 'apache_request_headers', 'apache_note', 'apache_lookup_uri', 'apache_child_terminate', 'apache_setenv', 'apache_response_headers', 'apache_get_version', 'getallheaders', 'mysql_connect', 'mysql_pconnect', 'mysql_close', 'mysql_select_db', 'mysql_create_db', 'mysql_drop_db', 'mysql_query', 'mysql_unbuffered_query', 'mysql_db_query', 'mysql_list_dbs', 'mysql_list_tables', 'mysql_list_fields', 'mysql_list_processes', 'mysql_error', 'mysql_errno', 'mysql_affected_rows', 'mysql_insert_id', 'mysql_result', 'mysql_num_rows', 'mysql_num_fields', 'mysql_fetch_row', 'mysql_fetch_array', 'mysql_fetch_assoc', 'mysql_fetch_object', 'mysql_data_seek', 'mysql_fetch_lengths', 'mysql_fetch_field', 'mysql_field_seek', 'mysql_free_result', 'mysql_field_name', 'mysql_field_table', 'mysql_field_len', 'mysql_field_type', 'mysql_field_flags', 'mysql_escape_string', 'mysql_real_escape_string', 'mysql_stat',
41
- 'mysql_thread_id', 'mysql_client_encoding', 'mysql_get_client_info', 'mysql_get_host_info', 'mysql_get_proto_info', 'mysql_get_server_info', 'mysql_info', 'mysql', 'mysql_fieldname', 'mysql_fieldtable', 'mysql_fieldlen', 'mysql_fieldtype', 'mysql_fieldflags', 'mysql_selectdb', 'mysql_createdb', 'mysql_dropdb', 'mysql_freeresult', 'mysql_numfields', 'mysql_numrows', 'mysql_listdbs', 'mysql_listtables', 'mysql_listfields', 'mysql_db_name', 'mysql_dbname', 'mysql_tablename', 'mysql_table_name', 'pg_connect', 'pg_pconnect', 'pg_close', 'pg_connection_status', 'pg_connection_busy', 'pg_connection_reset', 'pg_host', 'pg_dbname', 'pg_port', 'pg_tty', 'pg_options', 'pg_ping', 'pg_query', 'pg_send_query', 'pg_cancel_query', 'pg_fetch_result', 'pg_fetch_row', 'pg_fetch_assoc', 'pg_fetch_array', 'pg_fetch_object', 'pg_fetch_all', 'pg_affected_rows', 'pg_get_result', 'pg_result_seek', 'pg_result_status', 'pg_free_result', 'pg_last_oid', 'pg_num_rows', 'pg_num_fields', 'pg_field_name', 'pg_field_num', 'pg_field_size', 'pg_field_type', 'pg_field_prtlen', 'pg_field_is_null', 'pg_get_notify', 'pg_get_pid', 'pg_result_error', 'pg_last_error', 'pg_last_notice', 'pg_put_line', 'pg_end_copy', 'pg_copy_to', 'pg_copy_from',
42
- 'pg_trace', 'pg_untrace', 'pg_lo_create', 'pg_lo_unlink', 'pg_lo_open', 'pg_lo_close', 'pg_lo_read', 'pg_lo_write', 'pg_lo_read_all', 'pg_lo_import', 'pg_lo_export', 'pg_lo_seek', 'pg_lo_tell', 'pg_escape_string', 'pg_escape_bytea', 'pg_unescape_bytea', 'pg_client_encoding', 'pg_set_client_encoding', 'pg_meta_data', 'pg_convert', 'pg_insert', 'pg_update', 'pg_delete', 'pg_select', 'pg_exec', 'pg_getlastoid', 'pg_cmdtuples', 'pg_errormessage', 'pg_numrows', 'pg_numfields', 'pg_fieldname', 'pg_fieldsize', 'pg_fieldtype', 'pg_fieldnum', 'pg_fieldprtlen', 'pg_fieldisnull', 'pg_freeresult', 'pg_result', 'pg_loreadall', 'pg_locreate', 'pg_lounlink', 'pg_loopen', 'pg_loclose', 'pg_loread', 'pg_lowrite', 'pg_loimport', 'pg_loexport',
43
- 'echo', 'print', 'global', 'static', 'exit', 'array', 'empty', 'eval', 'isset', 'unset', 'die'
44
-
45
- ]
46
- }
47
- ,'OPERATORS' :[
48
- '+', '-', '/', '*', '=', '<', '>', '%', '!', '&&', '||'
49
- ]
50
- ,'DELIMITERS' :[
51
- '(', ')', '[', ']', '{', '}'
52
- ]
53
- ,'REGEXPS' : {
54
- // highlight all variables ($...)
55
- 'variables' : {
56
- 'search' : '()(\\$\\w+)()'
57
- ,'class' : 'variables'
58
- ,'modifiers' : 'g'
59
- ,'execute' : 'before' // before or after
60
- }
61
- }
62
- ,'STYLES' : {
63
- 'COMMENTS': 'color: #AAAAAA;'
64
- ,'QUOTESMARKS': 'color: #879EFA;'
65
- ,'KEYWORDS' : {
66
- 'reserved' : 'color: #48BDDF;'
67
- ,'functions' : 'color: #0040FD;'
68
- ,'statements' : 'color: #60CA00;'
69
- }
70
- ,'OPERATORS' : 'color: #FF00FF;'
71
- ,'DELIMITERS' : 'color: #2B60FF;'
72
- ,'REGEXPS' : {
73
- 'variables' : 'color: #E0BD54;'
74
- }
75
- }
76
- ,'AUTO_COMPLETION' : {
77
- "default": { // the name of this definition group. It's posisble to have different rules inside the same definition file
78
- "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.|
79
- ,"possible_words_letters": "[a-zA-Z0-9_\$]+"
80
- ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
81
- ,"prefix_separator": "\\-\\>|\\:\\:"
82
- }
83
- ,"CASE_SENSITIVE": true
84
- ,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position
85
- ,"KEYWORDS": {
86
- '': [ // the prefix of thoses items
87
- /**
88
- * 0 : the keyword the user is typing
89
- * 1 : (optionnal) the string inserted in code ("{@}" being the new position of the cursor, "§" beeing the equivalent to the value the typed string indicated if the previous )
90
- * If empty the keyword will be displayed
91
- * 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed)
92
- */
93
- ['$_POST']
94
- ,['$_GET']
95
- ,['$_SESSION']
96
- ,['$_SERVER']
97
- ,['$_FILES']
98
- ,['$_ENV']
99
- ,['$_COOKIE']
100
- ,['$_REQUEST']
101
- // magic methods
102
- ,['__construct', '§( {@} )']
103
- ,['__destruct', '§( {@} )']
104
- ,['__sleep', '§( {@} )']
105
- ,['__wakeup', '§( {@} )']
106
- ,['__toString', '§( {@} )']
107
- // include
108
- ,['include', '§ "{@}";']
109
- ,['include_once', '§ "{@}";']
110
- ,['require', '§ "{@}";']
111
- ,['require_once', '§ "{@}";']
112
- // statements
113
- ,['for', '§( {@} )']
114
- ,['foreach', '§( {@} )']
115
- ,['if', '§( {@} )']
116
- ,['elseif', '§( {@} )']
117
- ,['while', '§( {@} )']
118
- ,['switch', '§( {@} )']
119
- ,['break']
120
- ,['case']
121
- ,['continue']
122
- ,['do']
123
- ,['else']
124
- ,['endif']
125
- ,['endswitch']
126
- ,['endwhile']
127
- ,['return']
128
- // function
129
- ,['unset', '§( {@} )']
130
- ]
131
- }
132
- }
133
- ,"live": {
134
-
135
- // class NAME: /class\W+([a-z]+)\W+/gi
136
- // method: /^(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi
137
- // static: /^(public|private|protected)?\s+static\s+(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi
138
- // attributes: /(\$this\-\>|(?:var|public|protected|private)\W+\$)([a-z0-9\_]+)(?!\()\b/gi
139
- // v1 : /(\$this\-\>|var\W+|public\W+|protected\W+|private\W+)([a-z0-9\_]+)\W*(=|;)/gi
140
- // var type: /(\$(this\-\>)?[a-z0-9\_]+)\s*\=\s*new\s+([a-z0-9\_])+/gi
141
-
142
-
143
- "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.|
144
- ,"possible_words_letters": "[a-zA-Z0-9_\$]+"
145
- ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
146
- ,"prefix_separator": "\\-\\>"
147
- }
148
- ,"CASE_SENSITIVE": true
149
- ,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position
150
- ,"KEYWORDS": {
151
- '$this': [ // the prefix of thoses items
152
- ['test']
153
- ]
154
- }
155
- }
156
- }
157
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/reg_syntax/python.js DELETED
@@ -1,145 +0,0 @@
1
- /**
2
- * Python syntax v 1.1
3
- *
4
- * v1.1 by Andre Roberge (2006/12/27)
5
- *
6
- **/
7
- editAreaLoader.load_syntax["python"] = {
8
- 'DISPLAY_NAME' : 'Python'
9
- ,'COMMENT_SINGLE' : {1 : '#'}
10
- ,'COMMENT_MULTI' : {}
11
- ,'QUOTEMARKS' : {1: "'", 2: '"'}
12
- ,'KEYWORD_CASE_SENSITIVE' : true
13
- ,'KEYWORDS' : {
14
- /*
15
- ** Set 1: reserved words
16
- ** http://python.org/doc/current/ref/keywords.html
17
- ** Note: 'as' and 'with' have been added starting with Python 2.5
18
- */
19
- 'reserved' : [
20
- 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif',
21
- 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if',
22
- 'import', 'is', 'in', 'lambda', 'not', 'or', 'pass', 'print', 'raise',
23
- 'return', 'try', 'while', 'with', 'yield'
24
- //the following are *almost* reserved; we'll treat them as such
25
- , 'False', 'True', 'None'
26
- ]
27
- /*
28
- ** Set 2: builtins
29
- ** http://python.org/doc/current/lib/built-in-funcs.html
30
- */
31
- ,'builtins' : [
32
- '__import__', 'abs', 'basestring', 'bool', 'callable', 'chr', 'classmethod', 'cmp',
33
- 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile',
34
- 'file', 'filter', 'float', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help',
35
- 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals',
36
- 'long', 'map', 'max', 'min', 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range',
37
- 'raw_input', 'reduce', 'reload', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice',
38
- 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode',
39
- 'vars', 'xrange', 'zip',
40
- // Built-in constants: http://www.python.org/doc/2.4.1/lib/node35.html
41
- //'False', 'True', 'None' have been included in 'reserved'
42
- 'NotImplemented', 'Ellipsis',
43
- // Built-in Exceptions: http://python.org/doc/current/lib/module-exceptions.html
44
- 'Exception', 'StandardError', 'ArithmeticError', 'LookupError', 'EnvironmentError',
45
- 'AssertionError', 'AttributeError', 'EOFError', 'FloatingPointError', 'IOError',
46
- 'ImportError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'MemoryError', 'NameError',
47
- 'NotImplementedError', 'OSError', 'OverflowError', 'ReferenceError', 'RuntimeError',
48
- 'StopIteration', 'SyntaxError', 'SystemError', 'SystemExit', 'TypeError',
49
- 'UnboundlocalError', 'UnicodeError', 'UnicodeEncodeError', 'UnicodeDecodeError',
50
- 'UnicodeTranslateError', 'ValueError', 'WindowsError', 'ZeroDivisionError', 'Warning',
51
- 'UserWarning', 'DeprecationWarning', 'PendingDeprecationWarning', 'SyntaxWarning',
52
- 'RuntimeWarning', 'FutureWarning',
53
- // we will include the string methods as well
54
- // http://python.org/doc/current/lib/string-methods.html
55
- 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs',
56
- 'find', 'index', 'isalnum', 'isaplpha', 'isdigit', 'islower', 'isspace', 'istitle',
57
- 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust',
58
- 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
59
- 'translate', 'upper', 'zfill'
60
- ]
61
- /*
62
- ** Set 3: standard library
63
- ** http://python.org/doc/current/lib/modindex.html
64
- */
65
- ,'stdlib' : [
66
- '__builtin__', '__future__', '__main__', '_winreg', 'aifc', 'AL', 'al', 'anydbm',
67
- 'array', 'asynchat', 'asyncore', 'atexit', 'audioop', 'base64', 'BaseHTTPServer',
68
- 'Bastion', 'binascii', 'binhex', 'bisect', 'bsddb', 'bz2', 'calendar', 'cd', 'cgi',
69
- 'CGIHTTPServer', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop',
70
- 'collections', 'colorsys', 'commands', 'compileall', 'compiler', 'compiler',
71
- 'ConfigParser', 'Cookie', 'cookielib', 'copy', 'copy_reg', 'cPickle', 'crypt',
72
- 'cStringIO', 'csv', 'curses', 'datetime', 'dbhash', 'dbm', 'decimal', 'DEVICE',
73
- 'difflib', 'dircache', 'dis', 'distutils', 'dl', 'doctest', 'DocXMLRPCServer', 'dumbdbm',
74
- 'dummy_thread', 'dummy_threading', 'email', 'encodings', 'errno', 'exceptions', 'fcntl',
75
- 'filecmp', 'fileinput', 'FL', 'fl', 'flp', 'fm', 'fnmatch', 'formatter', 'fpectl',
76
- 'fpformat', 'ftplib', 'gc', 'gdbm', 'getopt', 'getpass', 'gettext', 'GL', 'gl', 'glob',
77
- 'gopherlib', 'grp', 'gzip', 'heapq', 'hmac', 'hotshot', 'htmlentitydefs', 'htmllib',
78
- 'HTMLParser', 'httplib', 'imageop', 'imaplib', 'imgfile', 'imghdr', 'imp', 'inspect',
79
- 'itertools', 'jpeg', 'keyword', 'linecache', 'locale', 'logging', 'mailbox', 'mailcap',
80
- 'marshal', 'math', 'md5', 'mhlib', 'mimetools', 'mimetypes', 'MimeWriter', 'mimify',
81
- 'mmap', 'msvcrt', 'multifile', 'mutex', 'netrc', 'new', 'nis', 'nntplib', 'operator',
82
- 'optparse', 'os', 'ossaudiodev', 'parser', 'pdb', 'pickle', 'pickletools', 'pipes',
83
- 'pkgutil', 'platform', 'popen2', 'poplib', 'posix', 'posixfile', 'pprint', 'profile',
84
- 'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'Queue', 'quopri', 'random',
85
- 're', 'readline', 'repr', 'resource', 'rexec', 'rfc822', 'rgbimg', 'rlcompleter',
86
- 'robotparser', 'sched', 'ScrolledText', 'select', 'sets', 'sgmllib', 'sha', 'shelve',
87
- 'shlex', 'shutil', 'signal', 'SimpleHTTPServer', 'SimpleXMLRPCServer', 'site', 'smtpd',
88
- 'smtplib', 'sndhdr', 'socket', 'SocketServer', 'stat', 'statcache', 'statvfs', 'string',
89
- 'StringIO', 'stringprep', 'struct', 'subprocess', 'sunau', 'SUNAUDIODEV', 'sunaudiodev',
90
- 'symbol', 'sys', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios',
91
- 'test', 'textwrap', 'thread', 'threading', 'time', 'timeit', 'Tix', 'Tkinter', 'token',
92
- 'tokenize', 'traceback', 'tty', 'turtle', 'types', 'unicodedata', 'unittest', 'urllib2',
93
- 'urllib', 'urlparse', 'user', 'UserDict', 'UserList', 'UserString', 'uu', 'warnings',
94
- 'wave', 'weakref', 'webbrowser', 'whichdb', 'whrandom', 'winsound', 'xdrlib', 'xml',
95
- 'xmllib', 'xmlrpclib', 'zipfile', 'zipimport', 'zlib'
96
-
97
- ]
98
- /*
99
- ** Set 4: special methods
100
- ** http://python.org/doc/current/ref/specialnames.html
101
- */
102
- ,'special' : [
103
- // Basic customization: http://python.org/doc/current/ref/customization.html
104
- '__new__', '__init__', '__del__', '__repr__', '__str__',
105
- '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__cmp__', '__rcmp__',
106
- '__hash__', '__nonzero__', '__unicode__', '__dict__',
107
- // Attribute access: http://python.org/doc/current/ref/attribute-access.html
108
- '__setattr__', '__delattr__', '__getattr__', '__getattribute__', '__get__', '__set__',
109
- '__delete__', '__slots__',
110
- // Class creation, callable objects
111
- '__metaclass__', '__call__',
112
- // Container types: http://python.org/doc/current/ref/sequence-types.html
113
- '__len__', '__getitem__', '__setitem__', '__delitem__', '__iter__', '__contains__',
114
- '__getslice__', '__setslice__', '__delslice__',
115
- // Numeric types: http://python.org/doc/current/ref/numeric-types.html
116
- '__abs__','__add__','__and__','__coerce__','__div__','__divmod__','__float__',
117
- '__hex__','__iadd__','__isub__','__imod__','__idiv__','__ipow__','__iand__',
118
- '__ior__','__ixor__', '__ilshift__','__irshift__','__invert__','__int__',
119
- '__long__','__lshift__',
120
- '__mod__','__mul__','__neg__','__oct__','__or__','__pos__','__pow__',
121
- '__radd__','__rdiv__','__rdivmod__','__rmod__','__rpow__','__rlshift__','__rrshift__',
122
- '__rshift__','__rsub__','__rmul__','__repr__','__rand__','__rxor__','__ror__',
123
- '__sub__','__xor__'
124
- ]
125
- }
126
- ,'OPERATORS' :[
127
- '+', '-', '/', '*', '=', '<', '>', '%', '!', '&', ';', '?', '`', ':', ','
128
- ]
129
- ,'DELIMITERS' :[
130
- '(', ')', '[', ']', '{', '}'
131
- ]
132
- ,'STYLES' : {
133
- 'COMMENTS': 'color: #AAAAAA;'
134
- ,'QUOTESMARKS': 'color: #660066;'
135
- ,'KEYWORDS' : {
136
- 'reserved' : 'color: #0000FF;'
137
- ,'builtins' : 'color: #009900;'
138
- ,'stdlib' : 'color: #009900;'
139
- ,'special': 'color: #006666;'
140
- }
141
- ,'OPERATORS' : 'color: #993300;'
142
- ,'DELIMITERS' : 'color: #993300;'
143
-
144
- }
145
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/reg_syntax/robotstxt.js DELETED
@@ -1,25 +0,0 @@
1
- editAreaLoader.load_syntax["robotstxt"] = {
2
- 'DISPLAY_NAME' : 'Robots txt',
3
- 'COMMENT_SINGLE' : {1 : '#'},
4
- 'COMMENT_MULTI' : {},
5
- 'QUOTEMARKS' : [],
6
- 'KEYWORD_CASE_SENSITIVE' : false,
7
- 'KEYWORDS' : {
8
- 'attributes' : ['User-agent', 'Disallow', 'Allow', 'Crawl-delay'],
9
- 'values' : ['*'],
10
- 'specials' : ['*']
11
- },
12
- 'OPERATORS' :[':'],
13
- 'DELIMITERS' :[],
14
- 'STYLES' : {
15
- 'COMMENTS': 'color: #AAAAAA;',
16
- 'QUOTESMARKS': 'color: #6381F8;',
17
- 'KEYWORDS' : {
18
- 'attributes' : 'color: #48BDDF;',
19
- 'values' : 'color: #2B60FF;',
20
- 'specials' : 'color: #FF0000;'
21
- },
22
- 'OPERATORS' : 'color: #FF00FF;',
23
- 'DELIMITERS' : 'color: #60CA00;'
24
- }
25
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/reg_syntax/ruby.js DELETED
@@ -1,68 +0,0 @@
1
- /**
2
- * Ruby syntax v 1.0
3
- *
4
- * v1.0 by Patrice De Saint Steban (2007/01/03)
5
- *
6
- **/
7
- editAreaLoader.load_syntax["ruby"] = {
8
- 'DISPLAY_NAME' : 'Ruby'
9
- ,'COMMENT_SINGLE' : {1 : '#'}
10
- ,'COMMENT_MULTI' : {}
11
- ,'QUOTEMARKS' : {1: "'", 2: '"'}
12
- ,'KEYWORD_CASE_SENSITIVE' : true
13
- ,'KEYWORDS' : {
14
- 'reserved' : [
15
- 'alias', 'and', 'BEGIN', 'begin', 'break', 'case', 'class', 'def', 'defined', 'do', 'else',
16
- 'elsif', 'END', 'end', 'ensure', 'false', 'for', 'if',
17
- 'in', 'module', 'next', 'not', 'or', 'redo', 'rescue', 'retry',
18
- 'return', 'self', 'super', 'then', 'true', 'undef', 'unless', 'until', 'when', 'while', 'yield'
19
- ]
20
- }
21
- ,'OPERATORS' :[
22
- '+', '-', '/', '*', '=', '<', '>', '%', '!', '&', ';', '?', '`', ':', ','
23
- ]
24
- ,'DELIMITERS' :[
25
- '(', ')', '[', ']', '{', '}'
26
- ]
27
- ,'REGEXPS' : {
28
- 'constants' : {
29
- 'search' : '()([A-Z]\\w*)()'
30
- ,'class' : 'constants'
31
- ,'modifiers' : 'g'
32
- ,'execute' : 'before'
33
- }
34
- ,'variables' : {
35
- 'search' : '()([\$\@\%]+\\w+)()'
36
- ,'class' : 'variables'
37
- ,'modifiers' : 'g'
38
- ,'execute' : 'before'
39
- }
40
- ,'numbers' : {
41
- 'search' : '()(-?[0-9]+)()'
42
- ,'class' : 'numbers'
43
- ,'modifiers' : 'g'
44
- ,'execute' : 'before'
45
- }
46
- ,'symbols' : {
47
- 'search' : '()(:\\w+)()'
48
- ,'class' : 'symbols'
49
- ,'modifiers' : 'g'
50
- ,'execute' : 'before'
51
- }
52
- }
53
- ,'STYLES' : {
54
- 'COMMENTS': 'color: #AAAAAA;'
55
- ,'QUOTESMARKS': 'color: #660066;'
56
- ,'KEYWORDS' : {
57
- 'reserved' : 'font-weight: bold; color: #0000FF;'
58
- }
59
- ,'OPERATORS' : 'color: #993300;'
60
- ,'DELIMITERS' : 'color: #993300;'
61
- ,'REGEXPS' : {
62
- 'variables' : 'color: #E0BD54;'
63
- ,'numbers' : 'color: green;'
64
- ,'constants' : 'color: #00AA00;'
65
- ,'symbols' : 'color: #879EFA;'
66
- }
67
- }
68
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/reg_syntax/sql.js DELETED
@@ -1,56 +0,0 @@
1
- editAreaLoader.load_syntax["sql"] = {
2
- 'DISPLAY_NAME' : 'SQL'
3
- ,'COMMENT_SINGLE' : {1 : '--'}
4
- ,'COMMENT_MULTI' : {'/*' : '*/'}
5
- ,'QUOTEMARKS' : {1: "'", 2: '"', 3: '`'}
6
- ,'KEYWORD_CASE_SENSITIVE' : false
7
- ,'KEYWORDS' : {
8
- 'statements' : [
9
- 'select', 'SELECT', 'where', 'order', 'by',
10
- 'insert', 'from', 'update', 'grant', 'left join', 'right join',
11
- 'union', 'group', 'having', 'limit', 'alter', 'LIKE','IN','CASE'
12
- ]
13
- ,'reserved' : [
14
- 'null', 'enum', 'int', 'boolean', 'add', 'varchar'
15
-
16
- ]
17
- ,'functions' : [
18
- 'ABS','ACOS','ADDDATE','ADDTIME','AES_DECRYPT','AES_ENCRYPT','ASCII','ASIN','ATAN2 ATAN','ATAN','AVG','BENCHMARK','DISTINCT','BIN','BIT_AND','BIT_COUNT','BIT_LENGTH','BIT_OR','BIT_XOR','CAST','CEILING CEIL','CHAR_LENGTH','CHAR',
19
- 'CHARACTER_LENGTH','CHARSET','COALESCE','COERCIBILITY','COLLATION','COMPRESS','CONCAT_WS','CONCAT','CONNECTION_ID','CONV','CONVERT_TZ','COS','COT','COUNT','CRC32','CURDATE','CURRENT_DATE','CURRENT_TIME','CURRENT_TIMESTAMP','CURRENT_USER','CURTIME','DATABASE','DATE_ADD','DATE_FORMAT','DATE_SUB','DATE','DATEDIFF','DAY','DAYNAME','DAYOFMONTH',
20
- 'DAYOFWEEK','DAYOFYEAR','DECODE','DEFAULT','DEGREES','DES_DECRYPT','DES_ENCRYPT','ELT','ENCODE','ENCRYPT','EXP','EXPORT_SET','EXTRACT','FIELD','FIND_IN_SET','FLOOR','FORMAT','FOUND_ROWS','FROM_DAYS','FROM_UNIXTIME','GET_FORMAT','GET_LOCK','GREATEST','GROUP_CONCAT','HEX','HOUR','IF','IFNULL','INET_ATON','INET_NTOA',
21
- 'INSERT','INSTR','INTERVAL','IS_FREE_LOCK','IS_USED_LOCK','ISNULL','LAST_DAY','LAST_INSERT_ID','LCASE','LEAST','LEFT','LENGTH','LN','LOAD_FILE','LOCALTIME','LOCALTIMESTAMP','LOCATE','LOG10','LOG2','LOG','LOWER','LPAD','LTRIM','MAKE_SET','MAKEDATE','MAKETIME','MASTER_POS_WAIT','MAX','MD5','MICROSECOND',
22
- 'MID','MIN','MINUTE','MOD','MONTH','MONTHNAME','NOW','NULLIF','OCT','OCTET_LENGTH','OLD_PASSWORD','ORD','PASSWORD','PERIOD_ADD','PERIOD_DIFF','PI','POSITION','POW','POWER','PROCEDURE ANALYSE','QUARTER','QUOTE','RADIANS','RAND','RELEASE_LOCK','REPEAT','REPLACE','REVERSE','RIGHT','ROUND',
23
- 'RPAD','RTRIM','SEC_TO_TIME','SECOND','SESSION_USER','SHA1','SHA','SIGN','SIN','SOUNDEX','SOUNDS LIKE','SPACE','SQRT','STD','STDDEV','STR_TO_DATE','STRCMP','SUBDATE','SUBSTRING_INDEX','SUBSTRING','SUBSTR','SUBTIME','SUM','SYSDATE','SYSTEM_USER','TAN','TIME_FORMAT','TIME_TO_SEC','TIME','TIMEDIFF',
24
- 'TIMESTAMP','TO_DAYS','TRIM','TRUNCATE','UCASE','UNCOMPRESS','UNCOMPRESSED_LENGTH','UNHEX','UNIX_TIMESTAMP','UPPER','USER','UTC_DATE','UTC_TIME','UTC_TIMESTAMP','UUID','VALUES','VARIANCE','WEEK','WEEKDAY','WEEKOFYEAR','YEAR','YEARWEEK'
25
- ]
26
- }
27
- ,'OPERATORS' :[
28
- 'AND','&&','BETWEEN','BINARY','&','|','^','/','DIV','<=>','=','>=','>','<<','>>','IS','NULL','<=','<','-','%','!=','<>','!','||','OR','+','REGEXP','RLIKE','XOR','~','*'
29
- ]
30
- ,'DELIMITERS' :[
31
- '(', ')', '[', ']', '{', '}'
32
- ]
33
- ,'REGEXPS' : {
34
- // highlight all variables (@...)
35
- 'variables' : {
36
- 'search' : '()(\\@\\w+)()'
37
- ,'class' : 'variables'
38
- ,'modifiers' : 'g'
39
- ,'execute' : 'before' // before or after
40
- }
41
- }
42
- ,'STYLES' : {
43
- 'COMMENTS': 'color: #AAAAAA;'
44
- ,'QUOTESMARKS': 'color: #879EFA;'
45
- ,'KEYWORDS' : {
46
- 'reserved' : 'color: #48BDDF;'
47
- ,'functions' : 'color: #0040FD;'
48
- ,'statements' : 'color: #60CA00;'
49
- }
50
- ,'OPERATORS' : 'color: #FF00FF;'
51
- ,'DELIMITERS' : 'color: #2B60FF;'
52
- ,'REGEXPS' : {
53
- 'variables' : 'color: #E0BD54;'
54
- }
55
- }
56
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/reg_syntax/tsql.js DELETED
@@ -1,88 +0,0 @@
1
- editAreaLoader.load_syntax["tsql"] = {
2
- 'DISPLAY_NAME' : 'T-SQL'
3
- ,'COMMENT_SINGLE' : {1 : '--'}
4
- ,'COMMENT_MULTI' : {'/*' : '*/'}
5
- ,'QUOTEMARKS' : {1: "'" }
6
- ,'KEYWORD_CASE_SENSITIVE' : false
7
- ,'KEYWORDS' : {
8
- 'statements': [
9
- 'ADD', 'EXCEPT', 'PERCENT', 'EXEC', 'PLAN', 'ALTER', 'EXECUTE', 'PRECISION',
10
- 'PRIMARY', 'EXIT', 'PRINT', 'AS', 'FETCH', 'PROC', 'ASC',
11
- 'FILE', 'PROCEDURE', 'AUTHORIZATION', 'FILLFACTOR', 'PUBLIC', 'BACKUP', 'FOR', 'RAISERROR',
12
- 'BEGIN', 'FOREIGN', 'READ', 'FREETEXT', 'READTEXT', 'BREAK', 'FREETEXTTABLE',
13
- 'RECONFIGURE', 'BROWSE', 'FROM', 'REFERENCES', 'BULK', 'FULL', 'REPLICATION', 'BY',
14
- 'FUNCTION', 'RESTORE', 'CASCADE', 'GOTO', 'RESTRICT', 'CASE', 'GRANT', 'RETURN',
15
- 'CHECK', 'GROUP', 'REVOKE', 'CHECKPOINT', 'HAVING', 'RIGHT', 'CLOSE', 'HOLDLOCK', 'ROLLBACK',
16
- 'CLUSTERED', 'IDENTITY', 'ROWCOUNT', 'IDENTITY_INSERT', 'ROWGUIDCOL', 'COLLATE',
17
- 'IDENTITYCOL', 'RULE', 'COLUMN', 'IF', 'SAVE', 'COMMIT', 'SCHEMA', 'COMPUTE', 'INDEX',
18
- 'SELECT', 'CONSTRAINT', 'CONTAINS', 'INSERT', 'SET',
19
- 'CONTAINSTABLE', 'INTERSECT', 'SETUSER', 'CONTINUE', 'INTO', 'SHUTDOWN', 'SOME',
20
- 'CREATE', 'STATISTICS', 'KEY', 'CURRENT', 'KILL', 'TABLE',
21
- 'CURRENT_DATE', 'TEXTSIZE', 'CURRENT_TIME', 'THEN', 'LINENO',
22
- 'TO', 'LOAD', 'TOP', 'CURSOR', 'NATIONAL', 'TRAN', 'DATABASE', 'NOCHECK',
23
- 'TRANSACTION', 'DBCC', 'NONCLUSTERED', 'TRIGGER', 'DEALLOCATE', 'TRUNCATE',
24
- 'DECLARE', 'TSEQUAL', 'DEFAULT', 'UNION', 'DELETE', 'OF', 'UNIQUE',
25
- 'DENY', 'OFF', 'UPDATE', 'DESC', 'OFFSETS', 'UPDATETEXT', 'DISK', 'ON', 'USE', 'DISTINCT', 'OPEN',
26
- 'DISTRIBUTED', 'OPENDATASOURCE', 'VALUES', 'DOUBLE', 'OPENQUERY', 'VARYING', 'DROP',
27
- 'OPENROWSET', 'VIEW', 'DUMMY', 'OPENXML', 'WAITFOR', 'DUMP', 'OPTION', 'WHEN', 'ELSE', 'WHERE',
28
- 'END', 'ORDER', 'WHILE', 'ERRLVL', 'WITH', 'ESCAPE', 'OVER', 'WRITETEXT'
29
- ],
30
- 'functions': [
31
- 'COALESCE', 'SESSION_USER', 'CONVERT', 'SYSTEM_USER', 'CURRENT_TIMESTAMP', 'CURRENT_USER', 'NULLIF', 'USER',
32
- 'AVG', 'MIN', 'CHECKSUM', 'SUM', 'CHECKSUM_AGG', 'STDEV', 'COUNT', 'STDEVP', 'COUNT_BIG', 'VAR', 'GROUPING', 'VARP', 'MAX',
33
- '@@DATEFIRST', '@@OPTIONS', '@@DBTS', '@@REMSERVER', '@@LANGID', '@@SERVERNAME', '@@LANGUAGE', '@@SERVICENAME', '@@LOCK_TIMEOUT',
34
- '@@SPID', '@@MAX_CONNECTIONS', '@@TEXTSIZE', '@@MAX_PRECISION', '@@VERSION', '@@NESTLEVEL',
35
- '@@CURSOR_ROWS', 'CURSOR_STATUS', '@@FETCH_STATUS',
36
- 'DATEADD', 'DATEDIFF', 'DATENAME', 'DATEPART', 'DAY', 'GETDATE', 'GETUTCDATE', 'MONTH', 'YEAR',
37
- 'ABS', 'DEGREES', 'RAND', 'ACOS', 'EXP', 'ROUND', 'ASIN', 'FLOOR', 'SIGN', 'ATAN', 'LOG', 'SIN', 'ATN2', 'LOG10', 'SQRT',
38
- 'CEILING', 'PI ', 'SQUARE', 'COS', 'POWER', 'TAN', 'COT', 'RADIANS',
39
- '@@PROCID', 'COL_LENGTH', 'FULLTEXTCATALOGPROPERTY', 'COL_NAME', 'FULLTEXTSERVICEPROPERTY', 'COLUMNPROPERTY', 'INDEX_COL',
40
- 'DATABASEPROPERTY', 'INDEXKEY_PROPERTY', 'DATABASEPROPERTYEX', 'INDEXPROPERTY', 'DB_ID', 'OBJECT_ID', 'DB_NAME', 'OBJECT_NAME',
41
- 'FILE_ID', 'OBJECTPROPERTY', 'OBJECTPROPERTYEX', 'FILE_NAME', 'SQL_VARIANT_PROPERTY', 'FILEGROUP_ID', 'FILEGROUP_NAME',
42
- 'FILEGROUPPROPERTY', 'TYPEPROPERTY', 'FILEPROPERTY',
43
- 'CURRENT_USER', 'SUSER_ID', 'SUSER_SID', 'IS_MEMBER', 'SUSER_SNAME', 'IS_SRVROLEMEMBER', 'PERMISSIONS', 'SYSTEM_USER',
44
- 'SUSER_NAME', 'USER_ID', 'SESSION_USER', 'USER_NAME', 'ASCII', 'SOUNDEX', 'PATINDEX', 'SPACE', 'CHARINDEX', 'QUOTENAME',
45
- 'STR', 'DIFFERENCE', 'REPLACE', 'STUFF', 'REPLICATE', 'SUBSTRING', 'LEN', 'REVERSE', 'UNICODE', 'LOWER',
46
- 'UPPER', 'LTRIM', 'RTRIM', 'APP_NAME', 'CAST', 'CONVERT', 'COALESCE', 'COLLATIONPROPERTY', 'COLUMNS_UPDATED', 'CURRENT_TIMESTAMP',
47
- 'CURRENT_USER', 'DATALENGTH', '@@ERROR', 'FORMATMESSAGE', 'GETANSINULL', 'HOST_ID', 'HOST_NAME', 'IDENT_CURRENT', 'IDENT_INCR',
48
- 'IDENT_SEED', '@@IDENTITY', 'ISDATE', 'ISNULL', 'ISNUMERIC', 'NEWID', 'NULLIF', 'PARSENAME', '@@ROWCOUNT',
49
- 'SCOPE_IDENTITY', 'SERVERPROPERTY', 'SESSIONPROPERTY', 'SESSION_USER', 'STATS_DATE', 'SYSTEM_USER', '@@TRANCOUNT', 'USER_NAME',
50
- '@@CONNECTIONS', '@@PACK_RECEIVED', '@@CPU_BUSY', '@@PACK_SENT', '@@TIMETICKS', '@@IDLE', '@@TOTAL_ERRORS', '@@IO_BUSY', '@@TOTAL_READ',
51
- '@@PACKET_ERRORS', '@@TOTAL_WRITE', 'PATINDEX', 'TEXTVALID', 'TEXTPTR'
52
- ],
53
- 'reserved': [
54
- 'RIGHT', 'INNER', 'IS', 'JOIN', 'CROSS', 'LEFT', 'NULL', 'OUTER'
55
- ]
56
- }
57
- ,'OPERATORS' :[
58
- '+', '-', '*', '/', '%', '=', '&' ,'|', '^', '>', '<', '>=', '<=', '<>', '!=', '!<', '!>', 'ALL', 'AND', 'ANY', 'BETWEEN', 'EXISTS', 'IN', 'LIKE', 'NOT', 'OR', '~'
59
- ]
60
- ,'DELIMITERS' :[
61
- '(', ')', '[', ']', '{', '}'
62
- ]
63
- ,'REGEXPS' : {
64
- // highlight all variables (@...)
65
- 'variables' : {
66
- 'search' : '()(\\@\\w+)()'
67
- ,'class' : 'variables'
68
- ,'modifiers' : 'g'
69
- ,'execute' : 'before' // before or after
70
- }
71
- }
72
- ,'STYLES' : {
73
- 'COMMENTS': 'color: #008000;'
74
- ,'QUOTESMARKS': 'color: #FF0000;'
75
- ,'KEYWORDS' : {
76
- 'reserved' : 'color: #808080;'
77
- ,'functions' : 'color: #FF00FF;'
78
- ,'statements' : 'color: #0000FF;'
79
- }
80
- ,'OPERATORS' : 'color: #808080;'
81
- ,'DELIMITERS' : 'color: #FF8000;'
82
- ,'REGEXPS' : {
83
- 'variables' : 'color: #E0BD54;'
84
- }
85
- }
86
- };
87
-
88
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/reg_syntax/vb.js DELETED
@@ -1,53 +0,0 @@
1
- editAreaLoader.load_syntax["vb"] = {
2
- 'DISPLAY_NAME' : 'Visual Basic'
3
- ,'COMMENT_SINGLE' : {1 : "'"}
4
- ,'COMMENT_MULTI' : { }
5
- ,'QUOTEMARKS' : {1: '"'}
6
- ,'KEYWORD_CASE_SENSITIVE' : false
7
- ,'KEYWORDS' : {
8
- 'statements' : [
9
- 'if','then','for','each','while','do','loop',
10
- 'else','elseif','select','case','end select',
11
- 'until','next','step','to','in','end if'
12
- ]
13
- ,'keywords' : [
14
- 'empty','isempty','nothing','null','isnull','true','false',
15
- 'set','call',
16
- 'sub','end sub','function','end function','exit','exit function',
17
- 'dim','Mod','In','private','public','shared','const'
18
- ]
19
-
20
- ,'functions' : [
21
- 'CDate','Date','DateAdd','DateDiff','DatePart','DateSerial','DateValue','Day','FormatDateTime',
22
- 'Hour','IsDate','Minute','Month',
23
- 'MonthName','Now','Second','Time','Timer','TimeSerial','TimeValue','Weekday','WeekdayName ','Year',
24
- 'Asc','CBool','CByte','CCur','CDate','CDbl','Chr','CInt','CLng','CSng','CStr','Hex','Oct','FormatCurrency',
25
- 'FormatDateTime','FormatNumber','FormatPercent','Abs','Atn','Cos','Exp','Hex','Int','Fix','Log','Oct',
26
- 'Rnd','Sgn','Sin','Sqr','Tan',
27
- 'Array','Filter','IsArray','Join','LBound','Split','UBound',
28
- 'InStr','InStrRev','LCase','Left','Len','LTrim','RTrim','Trim','Mid','Replace','Right','Space','StrComp',
29
- 'String','StrReverse','UCase',
30
- 'CreateObject','Eval','GetLocale','GetObject','GetRef','InputBox','IsEmpty','IsNull','IsNumeric',
31
- 'IsObject','LoadPicture','MsgBox','RGB','Round','ScriptEngine','ScriptEngineBuildVersion','ScriptEngineMajorVersion',
32
- 'ScriptEngineMinorVersion','SetLocale','TypeName','VarType'
33
- ]
34
- }
35
- ,'OPERATORS' :[
36
- '+', '-', '/', '*', '=', '<', '>', '!', '&'
37
- ]
38
- ,'DELIMITERS' :[
39
- '(', ')', '[', ']', '{', '}'
40
- ]
41
- ,'STYLES' : {
42
- 'COMMENTS': 'color: #99CC00;'
43
- ,'QUOTESMARKS': 'color: #333399;'
44
- ,'KEYWORDS' : {
45
- 'keywords' : 'color: #3366FF;'
46
- ,'functions' : 'color: #0000FF;'
47
- ,'statements' : 'color: #3366FF;'
48
- }
49
- ,'OPERATORS' : 'color: #FF0000;'
50
- ,'DELIMITERS' : 'color: #0000FF;'
51
-
52
- }
53
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/reg_syntax/xml.js DELETED
@@ -1,57 +0,0 @@
1
- /*
2
- * last update: 2006-08-24
3
- */
4
-
5
- editAreaLoader.load_syntax["xml"] = {
6
- 'DISPLAY_NAME' : 'XML'
7
- ,'COMMENT_SINGLE' : {}
8
- ,'COMMENT_MULTI' : {'<!--' : '-->'}
9
- ,'QUOTEMARKS' : {1: "'", 2: '"'}
10
- ,'KEYWORD_CASE_SENSITIVE' : false
11
- ,'KEYWORDS' : {
12
- }
13
- ,'OPERATORS' :[
14
- ]
15
- ,'DELIMITERS' :[
16
- ]
17
- ,'REGEXPS' : {
18
- 'xml' : {
19
- 'search' : '()(<\\?[^>]*?\\?>)()'
20
- ,'class' : 'xml'
21
- ,'modifiers' : 'g'
22
- ,'execute' : 'before' // before or after
23
- }
24
- ,'cdatas' : {
25
- 'search' : '()(<!\\[CDATA\\[.*?\\]\\]>)()'
26
- ,'class' : 'cdata'
27
- ,'modifiers' : 'g'
28
- ,'execute' : 'before' // before or after
29
- }
30
- ,'tags' : {
31
- 'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
32
- ,'class' : 'tags'
33
- ,'modifiers' : 'gi'
34
- ,'execute' : 'before' // before or after
35
- }
36
- ,'attributes' : {
37
- 'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
38
- ,'class' : 'attributes'
39
- ,'modifiers' : 'g'
40
- ,'execute' : 'before' // before or after
41
- }
42
- }
43
- ,'STYLES' : {
44
- 'COMMENTS': 'color: #AAAAAA;'
45
- ,'QUOTESMARKS': 'color: #6381F8;'
46
- ,'KEYWORDS' : {
47
- }
48
- ,'OPERATORS' : 'color: #E775F0;'
49
- ,'DELIMITERS' : ''
50
- ,'REGEXPS' : {
51
- 'attributes': 'color: #B1AC41;'
52
- ,'tags': 'color: #E62253;'
53
- ,'xml': 'color: #8DCFB5;'
54
- ,'cdata': 'color: #50B020;'
55
- }
56
- }
57
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/editarea/todo.txt DELETED
@@ -1,71 +0,0 @@
1
- FOR AUTOCOMPLETION:
2
- - work with tab editing (each one having it's context)
3
- - allow $ in prefix
4
- - allow to call user function for autocompletion
5
- - correctly display the box with window limits
6
- - enable "live" detection for new syntax keyword in the file
7
- - display a long description of the keyword (arround the box)
8
-
9
- DONE:
10
- - beeing able to prefix those word by key words (sort of namespace)
11
- - hide it on click
12
- - enable it for ctrl+space in the middle of a word
13
-
14
- /***** To do Needed *****/
15
-
16
- - Internet explorer: adding a caracter one the longest line as for consequence to make a scrollLeft=0 (in non wrapped mode)
17
- - Do optimisation for trying to only update the changed line in content_highlight
18
- - add real IE8 support (fix the tabulation width bug in IE8 that has now always the same width no matter the font-size and font-family in textarea but not in <pre>...)
19
- - change_callback is called one time at the beginning event if the text has not changed
20
- - check later init call with safari 3
21
- - improve callback documentation.
22
-
23
- /***** To do Optionnal*****/
24
-
25
- - possibility to switch on/off line numbers (allow to get more space)
26
- - amelioration of the scroll_to_view function for when there is several lines selected (center a little more the selected text)
27
- - improve opera 9 compatibility (very hard, need help for workaround) cf "Browser remarks".
28
- - optimize scroll_to_view for Opera?
29
- - add word wrap option for opera (bug with rendering mode of pre-wrap
30
- - possibility to add larger font sizes as options?
31
-
32
- /*** Bugs ***/
33
-
34
- - firefox: when using verdana (or other non-monospace fonts) switching the font size after font load has as results to sometimes give different render in textarea and in content_highlight (espacially near 11 and 12pt)
35
- - opera: (bloc word-wrap on opera) bug with cursor_end ()[] for a wrapped line (has wrong offsetLeft if rendered as multiline)
36
- - opera: (bloc word-wrap on opera) bug if first wraped character follow a <span> (or similar) on wrapped lines
37
- - when pressing "reset highlight" in IE the textarea scroll to the top (don't know how to fix this...)
38
- - (still pending?) when pressing "shift+page down" and then "shift+page up" the top of the selection move where as it should be to the bottom of the selection to move (to fix it: must know in which direction the selection grow in "get_selection_infos")
39
-
40
-
41
- /*** Problems ***/
42
-
43
-
44
- /*** Highlight bugs ***/
45
-
46
- /*** Highlight problems ***/
47
- - only one language at the same time (no html and php in the same textarea. This should be possible, but there would have no optimization and be very very slow)
48
-
49
-
50
- /*** Global remarks ***/
51
- - editarea must be always visible, to hide it use the hide() function
52
-
53
-
54
- /*** Browser remarks/bugs ***/
55
-
56
- OPERA:
57
- - opera bug: pressing the " key is equals to pressing the scrolldown key (with french keyboard at least) (still in opera 9.6?)
58
- - currently disabled: scrollDown/Up function (due to the " key error) (still in oera 9.6?)
59
- - opera is very very slow with syntax highlight (regexp) (still in oera 9.6?)
60
- - opera doesn't manage correctly the width 100% for the iframe
61
- - it's possible to make scroll the window in fullscreen
62
-
63
- IE:
64
- - IE is far slower than firefox in highlight mode due to opacity filter
65
- - It's seems impossible to get the selection range when wrap mode is "soft" (and it's still very diffcult when wrap mode is on)
66
- - The syntax highlight mode is broken when text length is too long (~100000, 150000 chars) don't know why...
67
-
68
- FIREFOX:
69
- - the scrollHeight value for the textarea never decresease when lines are deleted (don't remember anything about this)
70
-
71
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/syntax-highlighting/menu.php DELETED
@@ -1,7 +0,0 @@
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 DELETED
@@ -1,6 +0,0 @@
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/templateads/activate-upgrade.php DELETED
@@ -1,79 +0,0 @@
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 DELETED
@@ -1,347 +0,0 @@
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(!isset($data[$location])) { $data[$location] = array(); }
46
- $data = wp_insert_sanitize_array($data[$location], array('status', 'ad_code_1', 'ad_code_2', 'ad_code_3', 'country_1', 'country_code_1', 'rules_exclude_loggedin', 'rules_exclude_mobile_devices', 'rules_exclude_home', 'rules_exclude_archives', 'rules_exclude_categories', 'rules_categories_exceptions', 'rules_categories_post_exceptions', 'rules_exclude_search', 'rules_exclude_page', 'rules_page_exceptions', 'rules_exclude_post', 'rules_post_exceptions', 'styles'));
47
-
48
- $controls = array();
49
- $controls['status'] = wp_insert_get_control('tz-checkbox', false, $name.'[status]', $id.'-status', $data['status']);
50
- $controls['ad_code_1'] = wp_insert_get_control('textarea', false, $name.'[ad_code_1]', $id.'-ad_code_1', $data['ad_code_1'], 'Ad Code (Primary Network):', '', null, 'input widefat chitika');
51
- $controls['ad_code_2'] = wp_insert_get_control('textarea', false, $name.'[ad_code_2]', $id.'-ad_code_2', $data['ad_code_2'], 'Ad Code (Secondary Network):', '', null, 'input widefat chitika');
52
- $controls['ad_code_3'] = wp_insert_get_control('textarea', false, $name.'[ad_code_3]', $id.'-ad_code_3', $data['ad_code_3'], 'Ad Code (Tertiary Network):', '', null, 'input widefat chitika');
53
-
54
- $controls['country_1'] = wp_insert_get_control('popup', false, $name.'[country_1]', $id.'-country_1', $data['country_1'], 'Geo Targets', '', array('type' => 'countries'));
55
- $controls['country_code_1'] = wp_insert_get_control('textarea', false, $name.'[country_code_1]', $id.'-country_code_1', $data['country_code_1'], 'Ad Code', '', null, 'input widefat chitika');
56
-
57
- $controls['rules_exclude_loggedin'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_loggedin]', $id.'-rules_exclude_loggedin', $data['rules_exclude_loggedin'], '', '', null, '', false);
58
- $controls['rules_exclude_mobile_devices'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_mobile_devices]', $id.'-rules_exclude_mobile_devices', $data['rules_exclude_mobile_devices'], '', '', null, '', false);
59
- $controls['rules_exclude_home'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_home]', $id.'-rules_exclude_home', $data['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['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['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['rules_categories_exceptions'], '', '', array('type' => 'categories'), '', false);
63
- $controls['rules_categories_post_exceptions'] = wp_insert_get_control('popup', false, $name.'[rules_categories_post_exceptions]', $id.'-rules_categories_post_exceptions', $data['rules_categories_post_exceptions'], '', '', array('type' => 'categories'), '', false);
64
- $controls['rules_exclude_search'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_search]', $id.'-rules_exclude_search', $data['rules_exclude_search'], '', '', null, '', false);
65
- $controls['rules_exclude_page'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_page]', $id.'-rules_exclude_page', $data['rules_exclude_page'], '', '', null, '', false);
66
- $controls['rules_page_exceptions'] = wp_insert_get_control('popup', false, $name.'[rules_page_exceptions]', $id.'-rules_page_exceptions', $data['rules_page_exceptions'], '', '', array('type' => 'pages'), '', false);
67
- $controls['rules_exclude_post'] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_post]', $id.'-rules_exclude_post', $data['rules_exclude_post'], '', '', null, '', false);
68
- $controls['rules_post_exceptions'] = wp_insert_get_control('popup', false, $name.'[rules_post_exceptions]', $id.'-rules_post_exceptions', $data['rules_post_exceptions'], '', '', array('type' => 'posts'), '', false);
69
- $post_types = get_post_types(array('public' => true, '_builtin' => false), 'names');
70
- if($post_types) {
71
- foreach($post_types as $post_type) {
72
- $controls['rules_exclude_cpt_'.$post_type] = wp_insert_get_control('ip-checkbox', false, $name.'[rules_exclude_cpt_'.$post_type.']', $id.'-rules_exclude_cpt_'.$post_type, $data['rules_exclude_cpt_'.$post_type], '', '', null, '', false);
73
- }
74
- }
75
-
76
- $controls['styles'] = wp_insert_get_control('textarea', false, $name.'[styles]', $id.'-styles', $data['styles'], 'Styles:');
77
-
78
- $controls['notes'] = wp_insert_get_control('textarea', false, $name.'[notes]', $id.'-notes', $data['notes'], 'Notes:', 'Add a note to this Ad block for your personal use. This note is not displayed anywhere on the site');
79
-
80
- echo $controls['status']['html'];
81
-
82
- $multiple_network_status = get_option('wp_insert_multiple_network_status');
83
- if($multiple_network_status == 2 || $multiple_network_status == 1) {
84
- $controls['ad_code_3']['html'] = '<div style="display: none;">'.$controls['ad_code_3']['html'].'</div>';
85
- }
86
-
87
- if($multiple_network_status == 1) {
88
- $controls['ad_code_2']['html'] = '<div style="display: none;">'.$controls['ad_code_2']['html'].'</div>';
89
- }
90
- $tabData = array(
91
- array(
92
- 'title' => 'Code Snippet',
93
- '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>'
94
- ),
95
- array(
96
- 'title' => 'Ad Code',
97
- 'content' => $controls['ad_code_1']['html'].$controls['ad_code_2']['html'].$controls['ad_code_3']['html']
98
- ),
99
- array(
100
- 'title' => 'Rules',
101
- 'content' => wp_insert_templateads_rules_content($controls)
102
- ),
103
- array(
104
- 'title' => 'Geo Targeting',
105
- 'content' => '<p>'.$controls['country_1']['html'].$controls['country_code_1']['html'].'</p>'
106
- ),
107
- array(
108
- 'title' => 'Styles',
109
- 'content' => $controls['styles']['html']
110
- ),
111
- array(
112
- 'title' => 'Notes',
113
- 'content' => $controls['notes']['html']
114
- )
115
- );
116
- $controls['vtab'] = wp_insert_get_vtabs('vtab_'.$location, $tabData);
117
- echo $controls['vtab']['html'];
118
-
119
- echo wp_insert_get_script_tag($controls);
120
- }
121
-
122
- function wp_insert_templateads_rules_content($controls) {
123
- $rulesTable = array(
124
- 'class' => 'rules',
125
- 'rows' => array()
126
- );
127
- array_push(
128
- $rulesTable['rows'],
129
- array(
130
- 'cells' => array(
131
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Logged in Users')
132
- )
133
- ),
134
- array(
135
- 'cells' => array(
136
- array('content' => 'Status'),
137
- array('content' => '&nbsp;:&nbsp;'),
138
- array('content' => $controls['rules_exclude_loggedin']['html'])
139
- )
140
- ),
141
- array(
142
- 'cells' => array(
143
- array('colspan' => '3', 'content' => '&nbsp;')
144
- )
145
- )
146
- );
147
- array_push(
148
- $rulesTable['rows'],
149
- array(
150
- 'cells' => array(
151
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Mobile Devices')
152
- )
153
- ),
154
- array(
155
- 'cells' => array(
156
- array('content' => 'Status'),
157
- array('content' => '&nbsp;:&nbsp;'),
158
- array('content' => $controls['rules_exclude_mobile_devices']['html'])
159
- )
160
- ),
161
- array(
162
- 'cells' => array(
163
- array('colspan' => '3', 'content' => '&nbsp;')
164
- )
165
- )
166
- );
167
- array_push(
168
- $rulesTable['rows'],
169
- array(
170
- 'cells' => array(
171
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Home')
172
- )
173
- ),
174
- array(
175
- 'cells' => array(
176
- array('content' => 'Status'),
177
- array('content' => '&nbsp;:&nbsp;'),
178
- array('content' => $controls['rules_exclude_home']['html'])
179
- )
180
- )
181
- );
182
- array_push(
183
- $rulesTable['rows'],
184
- array(
185
- 'cells' => array(
186
- array('colspan' => '3', 'content' => '&nbsp;')
187
- )
188
- ),
189
- array(
190
- 'cells' => array(
191
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Archives')
192
- )
193
- ),
194
- array(
195
- 'cells' => array(
196
- array('content' => 'Status'),
197
- array('content' => '&nbsp;:&nbsp;'),
198
- array('content' => $controls['rules_exclude_archives']['html'])
199
- )
200
- )
201
- );
202
- array_push(
203
- $rulesTable['rows'],
204
- array(
205
- 'cells' => array(
206
- array('colspan' => '3', 'content' => '&nbsp;')
207
- )
208
- ),
209
- array(
210
- 'cells' => array(
211
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Categories')
212
- )
213
- ),
214
- array(
215
- 'cells' => array(
216
- array('content' => 'Status'),
217
- array('content' => '&nbsp;:&nbsp;'),
218
- array('content' => $controls['rules_exclude_categories']['html'])
219
- )
220
- ),
221
- array(
222
- 'cells' => array(
223
- array('content' => 'Exceptions'),
224
- array('content' => '&nbsp;:&nbsp;'),
225
- array('content' => $controls['rules_categories_exceptions']['html'])
226
- )
227
- ),
228
- array(
229
- 'cells' => array(
230
- array('content' => 'Post Exceptions'),
231
- array('content' => '&nbsp;:&nbsp;'),
232
- array('content' => $controls['rules_categories_post_exceptions']['html'])
233
- )
234
- )
235
- );
236
- array_push(
237
- $rulesTable['rows'],
238
- array(
239
- 'cells' => array(
240
- array('colspan' => '3', 'content' => '&nbsp;')
241
- )
242
- ),
243
- array(
244
- 'cells' => array(
245
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Search Results')
246
- )
247
- ),
248
- array(
249
- 'cells' => array(
250
- array('content' => 'Status'),
251
- array('content' => '&nbsp;:&nbsp;'),
252
- array('content' => $controls['rules_exclude_search']['html'])
253
- )
254
- )
255
- );
256
- array_push(
257
- $rulesTable['rows'],
258
- array(
259
- 'cells' => array(
260
- array('colspan' => '3', 'content' => '&nbsp;')
261
- )
262
- ),
263
- array(
264
- 'cells' => array(
265
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Single Page')
266
- )
267
- ),
268
- array(
269
- 'cells' => array(
270
- array('content' => 'Status'),
271
- array('content' => '&nbsp;:&nbsp;'),
272
- array('content' => $controls['rules_exclude_page']['html'])
273
- )
274
- ),
275
- array(
276
- 'cells' => array(
277
- array('content' => 'Exceptions'),
278
- array('content' => '&nbsp;:&nbsp;'),
279
- array('content' => $controls['rules_page_exceptions']['html'])
280
- )
281
- )
282
- );
283
- array_push(
284
- $rulesTable['rows'],
285
- array(
286
- 'cells' => array(
287
- array('colspan' => '3', 'content' => '&nbsp;')
288
- )
289
- ),
290
- array(
291
- 'cells' => array(
292
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Single Blog Post')
293
- )
294
- ),
295
- array(
296
- 'cells' => array(
297
- array('content' => 'Status'),
298
- array('content' => '&nbsp;:&nbsp;'),
299
- array('content' => $controls['rules_exclude_post']['html'])
300
- )
301
- ),
302
- array(
303
- 'cells' => array(
304
- array('content' => 'Exceptions'),
305
- array('content' => '&nbsp;:&nbsp;'),
306
- array('content' => $controls['rules_post_exceptions']['html'])
307
- )
308
- )
309
- );
310
- array_push(
311
- $rulesTable['rows'],
312
- array(
313
- 'cells' => array(
314
- array('colspan' => '3', 'content' => '&nbsp;')
315
- )
316
- ),
317
- array(
318
- 'cells' => array(
319
- array('style' => 'text-align: left;', 'colspan' => '3', 'type' => 'th', 'content' => 'Custom Post Types')
320
- )
321
- )
322
- );
323
-
324
- $post_types = get_post_types(array('public' => true, '_builtin' => false), 'object');
325
- if($post_types) {
326
- foreach($post_types as $post_type) {
327
- array_push(
328
- $rulesTable['rows'],
329
- array(
330
- 'cells' => array(
331
- array('content' => $post_type->labels->name),
332
- array('content' => '&nbsp;:&nbsp;'),
333
- array('content' => $controls['rules_exclude_cpt_'.$post_type->name]['html'])
334
- )
335
- )
336
- );
337
- }
338
- }
339
-
340
- return wp_insert_get_table($rulesTable);
341
- }
342
-
343
- function wp_insert_templateads_validate($input) {
344
- update_option('wp_insert_multiple_network_status', $input['multiple-network']['status']);
345
- return $input;
346
- }
347
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/templateads/menu.php DELETED
@@ -1,10 +0,0 @@
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 DELETED
@@ -1,18 +0,0 @@
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, explode(',', $options['templateads-'.$instance]['country_1'])))) {
12
- echo '<div class="wpInsert wpInsertTemplateTag"'.(($options['templateads-'.$instance]['styles'] != '')?' style="'.$options['templateads-'.$instance]['styles'].'"':'').'>'.do_shortcode($options['templateads-'.$instance]['country_code_1']).'</div>';
13
- } else {
14
- echo '<div class="wpInsert wpInsertTemplateTag"'.(($options['templateads-'.$instance]['styles'] != '')?' style="'.$options['templateads-'.$instance]['styles'].'"':'').'>'.do_shortcode($options['templateads-'.$instance]['ad_code_'.$wpInsertAdInstance]).'</div>';
15
- }
16
- }
17
- }
18
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/templateads/templateads.php DELETED
@@ -1,6 +0,0 @@
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.php ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* Begin Analytics Embed */
3
+ add_action('wp_ajax_wp_insert_trackingcodes_google_analytics_form_get_content', 'wp_insert_trackingcodes_google_analytics_form_get_content');
4
+ function wp_insert_trackingcodes_google_analytics_form_get_content() {
5
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
6
+
7
+ $trackingCodes = get_option('wp_insert_trackingcodes');
8
+ echo '<div class="wp_insert_popup_content_wrapper">';
9
+ $control = new smartlogixControls(array('optionIdentifier' => 'wp_insert_trackingcodes[analytics]', 'values' => $trackingCodes['analytics']));
10
+ $control->add_control(array('type' => 'ipCheckbox', 'optionName' => 'status'));
11
+ $control->add_control(array('type' => 'text', 'optionName' => 'code', 'label' => 'Google Analytics Tracker ID', 'helpText' => 'Your Google Analytics Tracker ID (XX-XXXXX-X)'));
12
+ echo $control->HTML;
13
+ echo '<script type="text/javascript">';
14
+ echo $control->JS;
15
+ echo '</script>';
16
+ echo '</div>';
17
+ die();
18
+ }
19
+
20
+ add_action('wp_ajax_wp_insert_trackingcodes_google_analytics_form_save_action', 'wp_insert_trackingcodes_google_analytics_form_save_action');
21
+ function wp_insert_trackingcodes_google_analytics_form_save_action() {
22
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
23
+
24
+ $trackingCodes = get_option('wp_insert_trackingcodes');
25
+ $trackingCodes['analytics']['status'] = ((isset($_POST['wp_insert_trackingcodes_analytics_status']) && ($_POST['wp_insert_trackingcodes_analytics_status'] == 'true'))?'1':'');
26
+ $trackingCodes['analytics']['code'] = ((isset($_POST['wp_insert_trackingcodes_analytics_code']))?$_POST['wp_insert_trackingcodes_analytics_code']:'');
27
+ update_option('wp_insert_trackingcodes', $trackingCodes);
28
+ die();
29
+ }
30
+
31
+ add_action('wp_footer', 'wp_insert_trackingcodes_google_analytics_wp_footer');
32
+ function wp_insert_trackingcodes_google_analytics_wp_footer() {
33
+ $trackingCodes = get_option('wp_insert_trackingcodes');
34
+ if(isset($trackingCodes['analytics']['status']) && isset($trackingCodes['analytics']['code']) && !empty($trackingCodes['analytics']['code'])) {
35
+ echo '<script type="text/javascript">';
36
+ echo 'var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");';
37
+ echo 'document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));';
38
+ echo '</script>';
39
+ echo '<script type="text/javascript">';
40
+ echo 'var pageTracker = _gat._getTracker("'.$trackingCodes['analytics']['code'].'");';
41
+ echo 'pageTracker._trackPageview();';
42
+ echo '</script>';
43
+ }
44
+
45
+ }
46
+ /* End Analytics Embed */
47
+
48
+ /* Begin Header Code Embed */
49
+ add_action('wp_ajax_wp_insert_trackingcodes_header_form_get_content', 'wp_insert_trackingcodes_header_form_get_content');
50
+ function wp_insert_trackingcodes_header_form_get_content() {
51
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
52
+
53
+ $trackingCodes = get_option('wp_insert_trackingcodes');
54
+ echo '<div class="wp_insert_popup_content_wrapper">';
55
+ $control = new smartlogixControls(array('optionIdentifier' => 'wp_insert_trackingcodes[header]', 'values' => $trackingCodes['header']));
56
+ $control->add_control(array('type' => 'ipCheckbox', 'optionName' => 'status'));
57
+ $control->add_control(array('type' => 'textarea', 'optionName' => 'code', 'label' => 'Embed Code'));
58
+ echo $control->HTML;
59
+ echo '<script type="text/javascript">';
60
+ echo $control->JS;
61
+ echo '</script>';
62
+ echo '</div>';
63
+ die();
64
+ }
65
+
66
+ add_action('wp_ajax_wp_insert_trackingcodes_header_form_save_action', 'wp_insert_trackingcodes_header_form_save_action');
67
+ function wp_insert_trackingcodes_header_form_save_action() {
68
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
69
+
70
+ $trackingCodes = get_option('wp_insert_trackingcodes');
71
+ $trackingCodes['header']['status'] = ((isset($_POST['wp_insert_trackingcodes_header_status']) && ($_POST['wp_insert_trackingcodes_header_status'] == 'true'))?'1':'');
72
+ $trackingCodes['header']['code'] = ((isset($_POST['wp_insert_trackingcodes_header_code']))?$_POST['wp_insert_trackingcodes_header_code']:'');
73
+ update_option('wp_insert_trackingcodes', $trackingCodes);
74
+ die();
75
+ }
76
+
77
+ add_action('wp_head', 'wp_insert_trackingcodes_header_wp_head');
78
+ function wp_insert_trackingcodes_header_wp_head() {
79
+ $trackingCodes = get_option('wp_insert_trackingcodes');
80
+ if(isset($trackingCodes['header']['status']) && isset($trackingCodes['header']['code']) && !empty($trackingCodes['header']['code'])) {
81
+ echo stripslashes($trackingCodes['header']['code']);
82
+ }
83
+ }
84
+ /* End Header Code Embed */
85
+
86
+ /* Begin Footer Code Embed */
87
+ add_action('wp_ajax_wp_insert_trackingcodes_footer_form_get_content', 'wp_insert_trackingcodes_footer_form_get_content');
88
+ function wp_insert_trackingcodes_footer_form_get_content() {
89
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
90
+
91
+ $trackingCodes = get_option('wp_insert_trackingcodes');
92
+ echo '<div class="wp_insert_popup_content_wrapper">';
93
+ $control = new smartlogixControls(array('optionIdentifier' => 'wp_insert_trackingcodes[footer]', 'values' => $trackingCodes['footer']));
94
+ $control->add_control(array('type' => 'ipCheckbox', 'optionName' => 'status'));
95
+ $control->add_control(array('type' => 'textarea', 'optionName' => 'code', 'label' => 'Embed Code'));
96
+ echo $control->HTML;
97
+ echo '<script type="text/javascript">';
98
+ echo $control->JS;
99
+ echo '</script>';
100
+ echo '</div>';
101
+ die();
102
+ }
103
+
104
+ add_action('wp_ajax_wp_insert_trackingcodes_footer_form_save_action', 'wp_insert_trackingcodes_footer_form_save_action');
105
+ function wp_insert_trackingcodes_footer_form_save_action() {
106
+ check_ajax_referer('wp-insert', 'wp_insert_nonce');
107
+
108
+ $trackingCodes = get_option('wp_insert_trackingcodes');
109
+ $trackingCodes['footer']['status'] = ((isset($_POST['wp_insert_trackingcodes_footer_status']) && ($_POST['wp_insert_trackingcodes_footer_status'] == 'true'))?'1':'');
110
+ $trackingCodes['footer']['code'] = ((isset($_POST['wp_insert_trackingcodes_footer_code']))?$_POST['wp_insert_trackingcodes_footer_code']:'');
111
+ update_option('wp_insert_trackingcodes', $trackingCodes);
112
+ die();
113
+ }
114
+
115
+ add_action('wp_footer', 'wp_insert_trackingcodes_footer_wp_footer');
116
+ function wp_insert_trackingcodes_footer_wp_footer() {
117
+ $trackingCodes = get_option('wp_insert_trackingcodes');
118
+ if(isset($trackingCodes['footer']['status']) && isset($trackingCodes['footer']['code']) && !empty($trackingCodes['footer']['code'])) {
119
+ echo stripslashes($trackingCodes['footer']['code']);
120
+ }
121
+ }
122
+ /* End Footer Code Embed */
123
+
124
+ /* Begin Database Upgrade */
125
+ add_action('wp_insert_upgrade_database', 'wp_insert_trackingcodes_upgrade_database');
126
+ function wp_insert_trackingcodes_upgrade_database() {
127
+ if(!get_option('wp_insert_trackingcodes')) {
128
+ $oldValues = get_option('wp_insert_tracking_codes_options');
129
+ $newValues = array(
130
+ 'analytics' => array(
131
+ 'status' => ((isset($oldValues['analytics']['status']) && $oldValues['analytics']['status'] == true)?'1':''),
132
+ 'code' => ((isset($oldValues['analytics']['code']))?$oldValues['analytics']['code']:''),
133
+ ),
134
+ 'header' => array(
135
+ 'status' => ((isset($oldValues['header']['status']) && $oldValues['header']['status'] == true)?'1':''),
136
+ 'code' => ((isset($oldValues['header']['code']))?$oldValues['header']['code']:''),
137
+ ),
138
+ 'footer' => array(
139
+ 'status' => ((isset($oldValues['footer']['status']) && $oldValues['footer']['status'] == true)?'1':''),
140
+ 'code' => ((isset($oldValues['footer']['code']))?$oldValues['footer']['code']:''),
141
+ ),
142
+ );
143
+ update_option('wp_insert_trackingcodes', $newValues);
144
+ }
145
+ }
146
+ /* End Database Upgrade */
147
+ ?>
includes/tracking-codes/activate-upgrade.php DELETED
@@ -1,41 +0,0 @@
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 DELETED
@@ -1,47 +0,0 @@
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(!isset($data[$location])) { $data[$location] = array(); }
28
- $data = wp_insert_sanitize_array($data[$location], array('status', 'code'));
29
-
30
- $controls = array();
31
- $controls['status'] = wp_insert_get_control('tz-checkbox', false, $name.'[status]', $id.'-status', $data['status']);
32
-
33
- if($location == 'analytics') {
34
- $controls['code'] = wp_insert_get_control('text', false, $name.'[code]', $id.'-code', $data['code'], 'Google Analytics Tracker ID:', 'Your Google Analytics Tracker ID (XX-XXXXX-X)');
35
- } else {
36
- $controls['code'] = wp_insert_get_control('textarea', false, $name.'[code]', $id.'-code', $data['code'], 'Code:');
37
- }
38
-
39
- echo $controls['status']['html'];
40
- echo $controls['code']['html'];
41
- echo wp_insert_get_script_tag($controls);
42
- }
43
-
44
- function wp_insert_tracking_codes_validate($input) {
45
- return $input;
46
- }
47
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/tracking-codes/codes.php DELETED
@@ -1,30 +0,0 @@
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
- $header = wp_insert_sanitize_array($options['header'], array('status', 'code'));
6
- if($header['status']) {
7
- echo $header['code'];
8
- }
9
- }
10
-
11
- add_action('wp_footer', 'wp_insert_tracking_codes_wp_footer');
12
- function wp_insert_tracking_codes_wp_footer() {
13
- $options = get_option('wp_insert_tracking_codes_options');
14
- $analytics = wp_insert_sanitize_array($options['analytics'], array('status', 'code'));
15
- if($analytics['status'] && ($analytics['code'] != '')) {
16
- echo '<script type="text/javascript">';
17
- echo 'var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");';
18
- echo 'document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));';
19
- echo '</script>';
20
- echo '<script type="text/javascript">';
21
- echo 'var pageTracker = _gat._getTracker("'.$analytics['code'].'");';
22
- echo 'pageTracker._trackPageview();';
23
- echo '</script>';
24
- }
25
- $footer = wp_insert_sanitize_array($options['footer'], array('status', 'code'));
26
- if($footer['status']) {
27
- echo $footer['code'];
28
- }
29
- }
30
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/tracking-codes/menu.php DELETED
@@ -1,7 +0,0 @@
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 DELETED
@@ -1,6 +0,0 @@
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
- ?>
 
 
 
 
 
 
index.html DELETED
@@ -1,12 +0,0 @@
1
- <html>
2
- <head>
3
- <title>Wp-Insert : A Plugin by SmartLogix</title>
4
- </head>
5
- <body style="text-align: center;">
6
- <h1>Wp-Insert - The Ultimate Wordpres Plugin</h1>
7
- A wordpress Plugin by <b><a href="http://www.smartlogix.co.in">SmartLogix</a></b><br/>
8
- SmartLogix is a web development company that specializes in developing Wordpress Plugins and Themes<br/>
9
- You can read the Wp-Insert tutorial <a href="http://www.wp-insert.smartlogix.co.in/">Here</a><br/>
10
- Reach SmartLogix for a quote on your wordpress Project <a href="http://www.smartlogix.co.in/request-a-free-quote/">Here</a>
11
- </body>
12
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
license.txt DELETED
@@ -1,674 +0,0 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 3, 29 June 2007
3
-
4
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
- Everyone is permitted to copy and distribute verbatim copies
6
- of this license document, but changing it is not allowed.
7
-
8
- Preamble
9
-
10
- The GNU General Public License is a free, copyleft license for
11
- software and other kinds of works.
12
-
13
- The licenses for most software and other practical works are designed
14
- to take away your freedom to share and change the works. By contrast,
15
- the GNU General Public License is intended to guarantee your freedom to
16
- share and change all versions of a program--to make sure it remains free
17
- software for all its users. We, the Free Software Foundation, use the
18
- GNU General Public License for most of our software; it applies also to
19
- any other work released this way by its authors. You can apply it to
20
- your programs, too.
21
-
22
- When we speak of free software, we are referring to freedom, not
23
- price. Our General Public Licenses are designed to make sure that you
24
- have the freedom to distribute copies of free software (and charge for
25
- them if you wish), that you receive source code or can get it if you
26
- want it, that you can change the software or use pieces of it in new
27
- free programs, and that you know you can do these things.
28
-
29
- To protect your rights, we need to prevent others from denying you
30
- these rights or asking you to surrender the rights. Therefore, you have
31
- certain responsibilities if you distribute copies of the software, or if
32
- you modify it: responsibilities to respect the freedom of others.
33
-
34
- For example, if you distribute copies of such a program, whether
35
- gratis or for a fee, you must pass on to the recipients the same
36
- freedoms that you received. You must make sure that they, too, receive
37
- or can get the source code. And you must show them these terms so they
38
- know their rights.
39
-
40
- Developers that use the GNU GPL protect your rights with two steps:
41
- (1) assert copyright on the software, and (2) offer you this License
42
- giving you legal permission to copy, distribute and/or modify it.
43
-
44
- For the developers' and authors' protection, the GPL clearly explains
45
- that there is no warranty for this free software. For both users' and
46
- authors' sake, the GPL requires that modified versions be marked as
47
- changed, so that their problems will not be attributed erroneously to
48
- authors of previous versions.
49
-
50
- Some devices are designed to deny users access to install or run
51
- modified versions of the software inside them, although the manufacturer
52
- can do so. This is fundamentally incompatible with the aim of
53
- protecting users' freedom to change the software. The systematic
54
- pattern of such abuse occurs in the area of products for individuals to
55
- use, which is precisely where it is most unacceptable. Therefore, we
56
- have designed this version of the GPL to prohibit the practice for those
57
- products. If such problems arise substantially in other domains, we
58
- stand ready to extend this provision to those domains in future versions
59
- of the GPL, as needed to protect the freedom of users.
60
-
61
- Finally, every program is threatened constantly by software patents.
62
- States should not allow patents to restrict development and use of
63
- software on general-purpose computers, but in those that do, we wish to
64
- avoid the special danger that patents applied to a free program could
65
- make it effectively proprietary. To prevent this, the GPL assures that
66
- patents cannot be used to render the program non-free.
67
-
68
- The precise terms and conditions for copying, distribution and
69
- modification follow.
70
-
71
- TERMS AND CONDITIONS
72
-
73
- 0. Definitions.
74
-
75
- "This License" refers to version 3 of the GNU General Public License.
76
-
77
- "Copyright" also means copyright-like laws that apply to other kinds of
78
- works, such as semiconductor masks.
79
-
80
- "The Program" refers to any copyrightable work licensed under this
81
- License. Each licensee is addressed as "you". "Licensees" and
82
- "recipients" may be individuals or organizations.
83
-
84
- To "modify" a work means to copy from or adapt all or part of the work
85
- in a fashion requiring copyright permission, other than the making of an
86
- exact copy. The resulting work is called a "modified version" of the
87
- earlier work or a work "based on" the earlier work.
88
-
89
- A "covered work" means either the unmodified Program or a work based
90
- on the Program.
91
-
92
- To "propagate" a work means to do anything with it that, without
93
- permission, would make you directly or secondarily liable for
94
- infringement under applicable copyright law, except executing it on a
95
- computer or modifying a private copy. Propagation includes copying,
96
- distribution (with or without modification), making available to the
97
- public, and in some countries other activities as well.
98
-
99
- To "convey" a work means any kind of propagation that enables other
100
- parties to make or receive copies. Mere interaction with a user through
101
- a computer network, with no transfer of a copy, is not conveying.
102
-
103
- An interactive user interface displays "Appropriate Legal Notices"
104
- to the extent that it includes a convenient and prominently visible
105
- feature that (1) displays an appropriate copyright notice, and (2)
106
- tells the user that there is no warranty for the work (except to the
107
- extent that warranties are provided), that licensees may convey the
108
- work under this License, and how to view a copy of this License. If
109
- the interface presents a list of user commands or options, such as a
110
- menu, a prominent item in the list meets this criterion.
111
-
112
- 1. Source Code.
113
-
114
- The "source code" for a work means the preferred form of the work
115
- for making modifications to it. "Object code" means any non-source
116
- form of a work.
117
-
118
- A "Standard Interface" means an interface that either is an official
119
- standard defined by a recognized standards body, or, in the case of
120
- interfaces specified for a particular programming language, one that
121
- is widely used among developers working in that language.
122
-
123
- The "System Libraries" of an executable work include anything, other
124
- than the work as a whole, that (a) is included in the normal form of
125
- packaging a Major Component, but which is not part of that Major
126
- Component, and (b) serves only to enable use of the work with that
127
- Major Component, or to implement a Standard Interface for which an
128
- implementation is available to the public in source code form. A
129
- "Major Component", in this context, means a major essential component
130
- (kernel, window system, and so on) of the specific operating system
131
- (if any) on which the executable work runs, or a compiler used to
132
- produce the work, or an object code interpreter used to run it.
133
-
134
- The "Corresponding Source" for a work in object code form means all
135
- the source code needed to generate, install, and (for an executable
136
- work) run the object code and to modify the work, including scripts to
137
- control those activities. However, it does not include the work's
138
- System Libraries, or general-purpose tools or generally available free
139
- programs which are used unmodified in performing those activities but
140
- which are not part of the work. For example, Corresponding Source
141
- includes interface definition files associated with source files for
142
- the work, and the source code for shared libraries and dynamically
143
- linked subprograms that the work is specifically designed to require,
144
- such as by intimate data communication or control flow between those
145
- subprograms and other parts of the work.
146
-
147
- The Corresponding Source need not include anything that users
148
- can regenerate automatically from other parts of the Corresponding
149
- Source.
150
-
151
- The Corresponding Source for a work in source code form is that
152
- same work.
153
-
154
- 2. Basic Permissions.
155
-
156
- All rights granted under this License are granted for the term of
157
- copyright on the Program, and are irrevocable provided the stated
158
- conditions are met. This License explicitly affirms your unlimited
159
- permission to run the unmodified Program. The output from running a
160
- covered work is covered by this License only if the output, given its
161
- content, constitutes a covered work. This License acknowledges your
162
- rights of fair use or other equivalent, as provided by copyright law.
163
-
164
- You may make, run and propagate covered works that you do not
165
- convey, without conditions so long as your license otherwise remains
166
- in force. You may convey covered works to others for the sole purpose
167
- of having them make modifications exclusively for you, or provide you
168
- with facilities for running those works, provided that you comply with
169
- the terms of this License in conveying all material for which you do
170
- not control copyright. Those thus making or running the covered works
171
- for you must do so exclusively on your behalf, under your direction
172
- and control, on terms that prohibit them from making any copies of
173
- your copyrighted material outside their relationship with you.
174
-
175
- Conveying under any other circumstances is permitted solely under
176
- the conditions stated below. Sublicensing is not allowed; section 10
177
- makes it unnecessary.
178
-
179
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
-
181
- No covered work shall be deemed part of an effective technological
182
- measure under any applicable law fulfilling obligations under article
183
- 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
- similar laws prohibiting or restricting circumvention of such
185
- measures.
186
-
187
- When you convey a covered work, you waive any legal power to forbid
188
- circumvention of technological measures to the extent such circumvention
189
- is effected by exercising rights under this License with respect to
190
- the covered work, and you disclaim any intention to limit operation or
191
- modification of the work as a means of enforcing, against the work's
192
- users, your or third parties' legal rights to forbid circumvention of
193
- technological measures.
194
-
195
- 4. Conveying Verbatim Copies.
196
-
197
- You may convey verbatim copies of the Program's source code as you
198
- receive it, in any medium, provided that you conspicuously and
199
- appropriately publish on each copy an appropriate copyright notice;
200
- keep intact all notices stating that this License and any
201
- non-permissive terms added in accord with section 7 apply to the code;
202
- keep intact all notices of the absence of any warranty; and give all
203
- recipients a copy of this License along with the Program.
204
-
205
- You may charge any price or no price for each copy that you convey,
206
- and you may offer support or warranty protection for a fee.
207
-
208
- 5. Conveying Modified Source Versions.
209
-
210
- You may convey a work based on the Program, or the modifications to
211
- produce it from the Program, in the form of source code under the
212
- terms of section 4, provided that you also meet all of these conditions:
213
-
214
- a) The work must carry prominent notices stating that you modified
215
- it, and giving a relevant date.
216
-
217
- b) The work must carry prominent notices stating that it is
218
- released under this License and any conditions added under section
219
- 7. This requirement modifies the requirement in section 4 to
220
- "keep intact all notices".
221
-
222
- c) You must license the entire work, as a whole, under this
223
- License to anyone who comes into possession of a copy. This
224
- License will therefore apply, along with any applicable section 7
225
- additional terms, to the whole of the work, and all its parts,
226
- regardless of how they are packaged. This License gives no
227
- permission to license the work in any other way, but it does not
228
- invalidate such permission if you have separately received it.
229
-
230
- d) If the work has interactive user interfaces, each must display
231
- Appropriate Legal Notices; however, if the Program has interactive
232
- interfaces that do not display Appropriate Legal Notices, your
233
- work need not make them do so.
234
-
235
- A compilation of a covered work with other separate and independent
236
- works, which are not by their nature extensions of the covered work,
237
- and which are not combined with it such as to form a larger program,
238
- in or on a volume of a storage or distribution medium, is called an
239
- "aggregate" if the compilation and its resulting copyright are not
240
- used to limit the access or legal rights of the compilation's users
241
- beyond what the individual works permit. Inclusion of a covered work
242
- in an aggregate does not cause this License to apply to the other
243
- parts of the aggregate.
244
-
245
- 6. Conveying Non-Source Forms.
246
-
247
- You may convey a covered work in object code form under the terms
248
- of sections 4 and 5, provided that you also convey the
249
- machine-readable Corresponding Source under the terms of this License,
250
- in one of these ways:
251
-
252
- a) Convey the object code in, or embodied in, a physical product
253
- (including a physical distribution medium), accompanied by the
254
- Corresponding Source fixed on a durable physical medium
255
- customarily used for software interchange.
256
-
257
- b) Convey the object code in, or embodied in, a physical product
258
- (including a physical distribution medium), accompanied by a
259
- written offer, valid for at least three years and valid for as
260
- long as you offer spare parts or customer support for that product
261
- model, to give anyone who possesses the object code either (1) a
262
- copy of the Corresponding Source for all the software in the
263
- product that is covered by this License, on a durable physical
264
- medium customarily used for software interchange, for a price no
265
- more than your reasonable cost of physically performing this
266
- conveying of source, or (2) access to copy the
267
- Corresponding Source from a network server at no charge.
268
-
269
- c) Convey individual copies of the object code with a copy of the
270
- written offer to provide the Corresponding Source. This
271
- alternative is allowed only occasionally and noncommercially, and
272
- only if you received the object code with such an offer, in accord
273
- with subsection 6b.
274
-
275
- d) Convey the object code by offering access from a designated
276
- place (gratis or for a charge), and offer equivalent access to the
277
- Corresponding Source in the same way through the same place at no
278
- further charge. You need not require recipients to copy the
279
- Corresponding Source along with the object code. If the place to
280
- copy the object code is a network server, the Corresponding Source
281
- may be on a different server (operated by you or a third party)
282
- that supports equivalent copying facilities, provided you maintain
283
- clear directions next to the object code saying where to find the
284
- Corresponding Source. Regardless of what server hosts the
285
- Corresponding Source, you remain obligated to ensure that it is
286
- available for as long as needed to satisfy these requirements.
287
-
288
- e) Convey the object code using peer-to-peer transmission, provided
289
- you inform other peers where the object code and Corresponding
290
- Source of the work are being offered to the general public at no
291
- charge under subsection 6d.
292
-
293
- A separable portion of the object code, whose source code is excluded
294
- from the Corresponding Source as a System Library, need not be
295
- included in conveying the object code work.
296
-
297
- A "User Product" is either (1) a "consumer product", which means any
298
- tangible personal property which is normally used for personal, family,
299
- or household purposes, or (2) anything designed or sold for incorporation
300
- into a dwelling. In determining whether a product is a consumer product,
301
- doubtful cases shall be resolved in favor of coverage. For a particular
302
- product received by a particular user, "normally used" refers to a
303
- typical or common use of that class of product, regardless of the status
304
- of the particular user or of the way in which the particular user
305
- actually uses, or expects or is expected to use, the product. A product
306
- is a consumer product regardless of whether the product has substantial
307
- commercial, industrial or non-consumer uses, unless such uses represent
308
- the only significant mode of use of the product.
309
-
310
- "Installation Information" for a User Product means any methods,
311
- procedures, authorization keys, or other information required to install
312
- and execute modified versions of a covered work in that User Product from
313
- a modified version of its Corresponding Source. The information must
314
- suffice to ensure that the continued functioning of the modified object
315
- code is in no case prevented or interfered with solely because
316
- modification has been made.
317
-
318
- If you convey an object code work under this section in, or with, or
319
- specifically for use in, a User Product, and the conveying occurs as
320
- part of a transaction in which the right of possession and use of the
321
- User Product is transferred to the recipient in perpetuity or for a
322
- fixed term (regardless of how the transaction is characterized), the
323
- Corresponding Source conveyed under this section must be accompanied
324
- by the Installation Information. But this requirement does not apply
325
- if neither you nor any third party retains the ability to install
326
- modified object code on the User Product (for example, the work has
327
- been installed in ROM).
328
-
329
- The requirement to provide Installation Information does not include a
330
- requirement to continue to provide support service, warranty, or updates
331
- for a work that has been modified or installed by the recipient, or for
332
- the User Product in which it has been modified or installed. Access to a
333
- network may be denied when the modification itself materially and
334
- adversely affects the operation of the network or violates the rules and
335
- protocols for communication across the network.
336
-
337
- Corresponding Source conveyed, and Installation Information provided,
338
- in accord with this section must be in a format that is publicly
339
- documented (and with an implementation available to the public in
340
- source code form), and must require no special password or key for
341
- unpacking, reading or copying.
342
-
343
- 7. Additional Terms.
344
-
345
- "Additional permissions" are terms that supplement the terms of this
346
- License by making exceptions from one or more of its conditions.
347
- Additional permissions that are applicable to the entire Program shall
348
- be treated as though they were included in this License, to the extent
349
- that they are valid under applicable law. If additional permissions
350
- apply only to part of the Program, that part may be used separately
351
- under those permissions, but the entire Program remains governed by
352
- this License without regard to the additional permissions.
353
-
354
- When you convey a copy of a covered work, you may at your option
355
- remove any additional permissions from that copy, or from any part of
356
- it. (Additional permissions may be written to require their own
357
- removal in certain cases when you modify the work.) You may place
358
- additional permissions on material, added by you to a covered work,
359
- for which you have or can give appropriate copyright permission.
360
-
361
- Notwithstanding any other provision of this License, for material you
362
- add to a covered work, you may (if authorized by the copyright holders of
363
- that material) supplement the terms of this License with terms:
364
-
365
- a) Disclaiming warranty or limiting liability differently from the
366
- terms of sections 15 and 16 of this License; or
367
-
368
- b) Requiring preservation of specified reasonable legal notices or
369
- author attributions in that material or in the Appropriate Legal
370
- Notices displayed by works containing it; or
371
-
372
- c) Prohibiting misrepresentation of the origin of that material, or
373
- requiring that modified versions of such material be marked in
374
- reasonable ways as different from the original version; or
375
-
376
- d) Limiting the use for publicity purposes of names of licensors or
377
- authors of the material; or
378
-
379
- e) Declining to grant rights under trademark law for use of some
380
- trade names, trademarks, or service marks; or
381
-
382
- f) Requiring indemnification of licensors and authors of that
383
- material by anyone who conveys the material (or modified versions of
384
- it) with contractual assumptions of liability to the recipient, for
385
- any liability that these contractual assumptions directly impose on
386
- those licensors and authors.
387
-
388
- All other non-permissive additional terms are considered "further
389
- restrictions" within the meaning of section 10. If the Program as you
390
- received it, or any part of it, contains a notice stating that it is
391
- governed by this License along with a term that is a further
392
- restriction, you may remove that term. If a license document contains
393
- a further restriction but permits relicensing or conveying under this
394
- License, you may add to a covered work material governed by the terms
395
- of that license document, provided that the further restriction does
396
- not survive such relicensing or conveying.
397
-
398
- If you add terms to a covered work in accord with this section, you
399
- must place, in the relevant source files, a statement of the
400
- additional terms that apply to those files, or a notice indicating
401
- where to find the applicable terms.
402
-
403
- Additional terms, permissive or non-permissive, may be stated in the
404
- form of a separately written license, or stated as exceptions;
405
- the above requirements apply either way.
406
-
407
- 8. Termination.
408
-
409
- You may not propagate or modify a covered work except as expressly
410
- provided under this License. Any attempt otherwise to propagate or
411
- modify it is void, and will automatically terminate your rights under
412
- this License (including any patent licenses granted under the third
413
- paragraph of section 11).
414
-
415
- However, if you cease all violation of this License, then your
416
- license from a particular copyright holder is reinstated (a)
417
- provisionally, unless and until the copyright holder explicitly and
418
- finally terminates your license, and (b) permanently, if the copyright
419
- holder fails to notify you of the violation by some reasonable means
420
- prior to 60 days after the cessation.
421
-
422
- Moreover, your license from a particular copyright holder is
423
- reinstated permanently if the copyright holder notifies you of the
424
- violation by some reasonable means, this is the first time you have
425
- received notice of violation of this License (for any work) from that
426
- copyright holder, and you cure the violation prior to 30 days after
427
- your receipt of the notice.
428
-
429
- Termination of your rights under this section does not terminate the
430
- licenses of parties who have received copies or rights from you under
431
- this License. If your rights have been terminated and not permanently
432
- reinstated, you do not qualify to receive new licenses for the same
433
- material under section 10.
434
-
435
- 9. Acceptance Not Required for Having Copies.
436
-
437
- You are not required to accept this License in order to receive or
438
- run a copy of the Program. Ancillary propagation of a covered work
439
- occurring solely as a consequence of using peer-to-peer transmission
440
- to receive a copy likewise does not require acceptance. However,
441
- nothing other than this License grants you permission to propagate or
442
- modify any covered work. These actions infringe copyright if you do
443
- not accept this License. Therefore, by modifying or propagating a
444
- covered work, you indicate your acceptance of this License to do so.
445
-
446
- 10. Automatic Licensing of Downstream Recipients.
447
-
448
- Each time you convey a covered work, the recipient automatically
449
- receives a license from the original licensors, to run, modify and
450
- propagate that work, subject to this License. You are not responsible
451
- for enforcing compliance by third parties with this License.
452
-
453
- An "entity transaction" is a transaction transferring control of an
454
- organization, or substantially all assets of one, or subdividing an
455
- organization, or merging organizations. If propagation of a covered
456
- work results from an entity transaction, each party to that
457
- transaction who receives a copy of the work also receives whatever
458
- licenses to the work the party's predecessor in interest had or could
459
- give under the previous paragraph, plus a right to possession of the
460
- Corresponding Source of the work from the predecessor in interest, if
461
- the predecessor has it or can get it with reasonable efforts.
462
-
463
- You may not impose any further restrictions on the exercise of the
464
- rights granted or affirmed under this License. For example, you may
465
- not impose a license fee, royalty, or other charge for exercise of
466
- rights granted under this License, and you may not initiate litigation
467
- (including a cross-claim or counterclaim in a lawsuit) alleging that
468
- any patent claim is infringed by making, using, selling, offering for
469
- sale, or importing the Program or any portion of it.
470
-
471
- 11. Patents.
472
-
473
- A "contributor" is a copyright holder who authorizes use under this
474
- License of the Program or a work on which the Program is based. The
475
- work thus licensed is called the contributor's "contributor version".
476
-
477
- A contributor's "essential patent claims" are all patent claims
478
- owned or controlled by the contributor, whether already acquired or
479
- hereafter acquired, that would be infringed by some manner, permitted
480
- by this License, of making, using, or selling its contributor version,
481
- but do not include claims that would be infringed only as a
482
- consequence of further modification of the contributor version. For
483
- purposes of this definition, "control" includes the right to grant
484
- patent sublicenses in a manner consistent with the requirements of
485
- this License.
486
-
487
- Each contributor grants you a non-exclusive, worldwide, royalty-free
488
- patent license under the contributor's essential patent claims, to
489
- make, use, sell, offer for sale, import and otherwise run, modify and
490
- propagate the contents of its contributor version.
491
-
492
- In the following three paragraphs, a "patent license" is any express
493
- agreement or commitment, however denominated, not to enforce a patent
494
- (such as an express permission to practice a patent or covenant not to
495
- sue for patent infringement). To "grant" such a patent license to a
496
- party means to make such an agreement or commitment not to enforce a
497
- patent against the party.
498
-
499
- If you convey a covered work, knowingly relying on a patent license,
500
- and the Corresponding Source of the work is not available for anyone
501
- to copy, free of charge and under the terms of this License, through a
502
- publicly available network server or other readily accessible means,
503
- then you must either (1) cause the Corresponding Source to be so
504
- available, or (2) arrange to deprive yourself of the benefit of the
505
- patent license for this particular work, or (3) arrange, in a manner
506
- consistent with the requirements of this License, to extend the patent
507
- license to downstream recipients. "Knowingly relying" means you have
508
- actual knowledge that, but for the patent license, your conveying the
509
- covered work in a country, or your recipient's use of the covered work
510
- in a country, would infringe one or more identifiable patents in that
511
- country that you have reason to believe are valid.
512
-
513
- If, pursuant to or in connection with a single transaction or
514
- arrangement, you convey, or propagate by procuring conveyance of, a
515
- covered work, and grant a patent license to some of the parties
516
- receiving the covered work authorizing them to use, propagate, modify
517
- or convey a specific copy of the covered work, then the patent license
518
- you grant is automatically extended to all recipients of the covered
519
- work and works based on it.
520
-
521
- A patent license is "discriminatory" if it does not include within
522
- the scope of its coverage, prohibits the exercise of, or is
523
- conditioned on the non-exercise of one or more of the rights that are
524
- specifically granted under this License. You may not convey a covered
525
- work if you are a party to an arrangement with a third party that is
526
- in the business of distributing software, under which you make payment
527
- to the third party based on the extent of your activity of conveying
528
- the work, and under which the third party grants, to any of the
529
- parties who would receive the covered work from you, a discriminatory
530
- patent license (a) in connection with copies of the covered work
531
- conveyed by you (or copies made from those copies), or (b) primarily
532
- for and in connection with specific products or compilations that
533
- contain the covered work, unless you entered into that arrangement,
534
- or that patent license was granted, prior to 28 March 2007.
535
-
536
- Nothing in this License shall be construed as excluding or limiting
537
- any implied license or other defenses to infringement that may
538
- otherwise be available to you under applicable patent law.
539
-
540
- 12. No Surrender of Others' Freedom.
541
-
542
- If conditions are imposed on you (whether by court order, agreement or
543
- otherwise) that contradict the conditions of this License, they do not
544
- excuse you from the conditions of this License. If you cannot convey a
545
- covered work so as to satisfy simultaneously your obligations under this
546
- License and any other pertinent obligations, then as a consequence you may
547
- not convey it at all. For example, if you agree to terms that obligate you
548
- to collect a royalty for further conveying from those to whom you convey
549
- the Program, the only way you could satisfy both those terms and this
550
- License would be to refrain entirely from conveying the Program.
551
-
552
- 13. Use with the GNU Affero General Public License.
553
-
554
- Notwithstanding any other provision of this License, you have
555
- permission to link or combine any covered work with a work licensed
556
- under version 3 of the GNU Affero General Public License into a single
557
- combined work, and to convey the resulting work. The terms of this
558
- License will continue to apply to the part which is the covered work,
559
- but the special requirements of the GNU Affero General Public License,
560
- section 13, concerning interaction through a network will apply to the
561
- combination as such.
562
-
563
- 14. Revised Versions of this License.
564
-
565
- The Free Software Foundation may publish revised and/or new versions of
566
- the GNU General Public License from time to time. Such new versions will
567
- be similar in spirit to the present version, but may differ in detail to
568
- address new problems or concerns.
569
-
570
- Each version is given a distinguishing version number. If the
571
- Program specifies that a certain numbered version of the GNU General
572
- Public License "or any later version" applies to it, you have the
573
- option of following the terms and conditions either of that numbered
574
- version or of any later version published by the Free Software
575
- Foundation. If the Program does not specify a version number of the
576
- GNU General Public License, you may choose any version ever published
577
- by the Free Software Foundation.
578
-
579
- If the Program specifies that a proxy can decide which future
580
- versions of the GNU General Public License can be used, that proxy's
581
- public statement of acceptance of a version permanently authorizes you
582
- to choose that version for the Program.
583
-
584
- Later license versions may give you additional or different
585
- permissions. However, no additional obligations are imposed on any
586
- author or copyright holder as a result of your choosing to follow a
587
- later version.
588
-
589
- 15. Disclaimer of Warranty.
590
-
591
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
- APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
- HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
- OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
- PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
- IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
- ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
-
600
- 16. Limitation of Liability.
601
-
602
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
- THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
- GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
- USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
- DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
- PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
- EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
- SUCH DAMAGES.
611
-
612
- 17. Interpretation of Sections 15 and 16.
613
-
614
- If the disclaimer of warranty and limitation of liability provided
615
- above cannot be given local legal effect according to their terms,
616
- reviewing courts shall apply local law that most closely approximates
617
- an absolute waiver of all civil liability in connection with the
618
- Program, unless a warranty or assumption of liability accompanies a
619
- copy of the Program in return for a fee.
620
-
621
- END OF TERMS AND CONDITIONS
622
-
623
- How to Apply These Terms to Your New Programs
624
-
625
- If you develop a new program, and you want it to be of the greatest
626
- possible use to the public, the best way to achieve this is to make it
627
- free software which everyone can redistribute and change under these terms.
628
-
629
- To do so, attach the following notices to the program. It is safest
630
- to attach them to the start of each source file to most effectively
631
- state the exclusion of warranty; and each file should have at least
632
- the "copyright" line and a pointer to where the full notice is found.
633
-
634
- <one line to give the program's name and a brief idea of what it does.>
635
- Copyright (C) <year> <name of author>
636
-
637
- This program is free software: you can redistribute it and/or modify
638
- it under the terms of the GNU General Public License as published by
639
- the Free Software Foundation, either version 3 of the License, or
640
- (at your option) any later version.
641
-
642
- This program is distributed in the hope that it will be useful,
643
- but WITHOUT ANY WARRANTY; without even the implied warranty of
644
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
- GNU General Public License for more details.
646
-
647
- You should have received a copy of the GNU General Public License
648
- along with this program. If not, see <http://www.gnu.org/licenses/>.
649
-
650
- Also add information on how to contact you by electronic and paper mail.
651
-
652
- If the program does terminal interaction, make it output a short
653
- notice like this when it starts in an interactive mode:
654
-
655
- <program> Copyright (C) <year> <name of author>
656
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
- This is free software, and you are welcome to redistribute it
658
- under certain conditions; type `show c' for details.
659
-
660
- The hypothetical commands `show w' and `show c' should show the appropriate
661
- parts of the General Public License. Of course, your program's commands
662
- might be different; for a GUI interface, you would use an "about box".
663
-
664
- You should also get your employer (if you work as a programmer) or school,
665
- if any, to sign a "copyright disclaimer" for the program, if necessary.
666
- For more information on this, and how to apply and follow the GNU GPL, see
667
- <http://www.gnu.org/licenses/>.
668
-
669
- The GNU General Public License does not permit incorporating your program
670
- into proprietary programs. If your program is a subroutine library, you
671
- may consider it more useful to permit linking proprietary applications with
672
- the library. If this is what you want to do, use the GNU Lesser General
673
- Public License instead of this License. But first, please read
674
- <http://www.gnu.org/philosophy/why-not-lgpl.html>.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -1,102 +1,77 @@
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: 4.1.1
7
- Stable tag: 2.0.16
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 (No1 Adsense Plugin for Wordpress)**
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
- * Support for Short-codes.
35
- * Extensive and elaborate RULES section to control when and where you display the ads. (Precise control down to single post/page level)
36
- * 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)
37
-
38
-
39
- *Widget Ads :* 20 ad widgets at your disposal with elaborate setting to when, where and how to display them.
40
-
41
- *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.
42
 
 
43
 
44
- **Manage Legal Pages**
45
-
46
- *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.
47
-
48
- *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.
49
-
50
- *Disclaimer and Copyright Notices :* Add Disclaimer and Copyright Notices to your site in one click.
51
-
52
- **Manage Tracking Codes**
53
 
54
- * Insert Google Analytics tracking onto all you blog pages instantly
55
- * Paste any other tracking code into the header or footer of your blog
56
 
57
- **Syntax Highlighting**
 
 
 
 
58
 
59
- * Syntax Highlighting for theme editor
60
- * Syntax Highlighting for plugin editor
61
- * Different highlighting for different file types
62
- * Syntax Highlighting for Code snippets in posts and pages
63
- * Syntax Highlighting for Code in post and pages using shortcodes and custom fields.
64
 
65
- All these features in an easy to use and novice user friendly interface which can still cater to the geekiest of webmasters.
 
 
 
 
 
 
66
 
67
- == Installation ==
68
-
69
- 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.
70
  == Frequently Asked Questions ==
71
-
72
- <a href=\"http://www.wp-insert.smartlogix.co.in/\" title=\"Wp-Insert Tutorial and Support Website\">Wp-Insert Tutorial and Support Website</a>
73
 
74
- <a href=\"http://www.smartlogix.co.in/\" title=\"Wp-Insert Developers\">Wp-Insert Developers</a>
75
- == Screenshots ==
76
- 1. Multiple Ad Network Support
77
-
78
- 2. Elaborate Rules System for precise control over Ads
79
-
80
- 3. Rules system popup for controlling ads on Posts
81
-
82
- 4. Rules system popup for controlling ads on Pages
83
 
84
- 5. Geo Targeting : Show differnet ads for visitors from different locations
 
 
85
 
86
- 6. Geo Targeting : Popup showing the targetable areas
87
-
88
- 7. Customizable Ready made Adsense Compatible privacy policy
89
-
90
- 8. Different Legal Page Templates
91
-
92
- 9. Easy to manage analytics or any other tracking codes
93
-
94
- 10. Syntax Highlighting
95
- == Change Log ==
96
-
97
- <a href=\"http://www.wp-insert.smartlogix.co.in/change-log/\" title=\"Change Log\">Change Log</a>
98
  == Upgrade Notice ==
99
-
100
- = 2.0 =
101
- 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.
102
- Wp-Insert is now upto 4 times more efficient and have extremely high emphasis on security compared to previous versions.
1
  === Wp-Insert ===
2
+ Contributors: Namith Jawahar
3
+ Tags: ads,adsense,advertising,advertisement,google ads,ad widget,analytics,google analytics,code insertion,privacy policy,best adsense plugin
4
+ Donate link: http://wpinsert.smartlogix.co.in/support/
5
+ Requires at least: 4.1.0
6
+ Tested up to: 4.3.1
7
+ Stable tag: 2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ The Ultimate Adsense / Ad-Management Plugin for Wordpress
12
 
13
  == Description ==
14
+ **WP-INSERT by <a href="http://www.smartlogix.co.in/" title="SmartLogix Technologies : Experts in WordPress Themes and Plugins">SmartLogix</a> : The Ultimate WordPress Plugin (Optimized for Adsense)**
 
15
 
16
  Wp-Insert is the most powerful yet easiest to use wordpress ad management plugin which does a lot more than ad management.
17
 
18
+ = Features =
19
+
20
+ * Insert Ad Above, Below, To the Left and Right of Page/Post Content
21
+ * Insert Ad in the Middle of Page/Post Content with intelligent midpoint detection algorithms
22
+ * Insert Ads into the Sidebars using Ad WIdgets
23
+ * GUI Driven Rules based System to control when and where to display Ads
24
+ * Insert Ads directly into the theme files with control over when and where to display Ads
25
+ * Insert Google Analytics Code easily
26
+ * Insert any type of Embed codes into the Header / Footer of your Site
27
+ * Style Ads the Way you want
28
+ * Does not slow down your site (Highly Efficient Algorithms)
29
+ * Legal Page Templates (Privacy Policy, Terms & Conditions, Disclaimer, Copyright) to kick start your Legal Pages
30
+ * A/B Testing Facility for Ads
31
+ * Geo-targeted Country Specific Ad Placement
32
+ * Backed by <a href="http://www.smartlogix.co.in/" title="SmartLogix Technologies : Experts in WordPress Themes and Plugins">SmartLogix</a>, The Unparalleled WordPress Specialist
 
 
 
 
 
 
 
 
33
 
34
+ == Screenshots ==
35
 
36
+ 1. The New Unified plugin admin page.
37
+ 2. Elaborate Rules system to control WHEN and WHERE to show your Ads
38
+ 3. Geotarget Different Ads just for audence from specific Countries
39
+ 4. Easy to use preprepared Legal Page Templates to serve as a starting point to your legal pages.
40
+ 5. Easily insert Ads directly into your theme for Advanced Ad Placement and still support the Rules system.
41
+ 6. Multiple Ad Networks / Ab testing.
42
+ 7. Google Analytics integrated.
43
+ 8. Easily embed codes in the Header / Footer.
44
+ 9. Ad Widgets which support the Rules System.
45
 
46
+ == Installation ==
47
+ = In WordPress =
48
 
49
+ * Go in your Dashboard to 'Plugins' -> 'Install'
50
+ * Search for 'Wp-Insert'
51
+ * Click on 'Install'
52
+ * Activate the plugin through the 'Plugins' menu in WordPress
53
+ * Now you can go to the Settings-Page from the Admin Menu
54
 
55
+ = Manually =
 
 
 
 
56
 
57
+ * Download the Plugin
58
+ * Go in your Dashboard to 'Plugins' -> 'Install'
59
+ * Click on Upload
60
+ * Click on 'Choose file' and choose the downloaded Zip-file
61
+ * Click on 'Install'
62
+ * Activate the plugin through the 'Plugins' menu in WordPress
63
+ * Now you can go to the Settings-Page from the Admin Menu
64
 
 
 
 
65
  == Frequently Asked Questions ==
66
+ <a href="http://wp-insert.smartlogix.co.in/" title="The Ultimate Adsense / Ad-Management Plugin for Wordpress">Wp-Insert Tutorial and Support Website</a>
 
67
 
68
+ <a href="http://www.smartlogix.co.in/" title="SmartLogix Technologies : Experts in WordPress Themes and Plugins">Wp-Insert Developers</a>
 
 
 
 
 
 
 
 
69
 
70
+ == Changelog ==
71
+ = 2.1 =
72
+ * Completely Rewritten from ground up.
73
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  == Upgrade Notice ==
75
+ = 2.1 =
76
+ Users of old versions of Wp-Insert may lose your widget placements when upgrading to 2.1.
77
+ Wp-Insert is now several times more efficient and have extremely high emphasis on security compared to previous versions.
 
screenshot-1.png DELETED
Binary file
screenshot-10.png DELETED
Binary file
screenshot-2.png DELETED
Binary file
screenshot-3.png DELETED
Binary file
screenshot-4.png DELETED
Binary file
screenshot-5.png DELETED
Binary file
screenshot-6.png DELETED
Binary file
screenshot-7.png DELETED
Binary file
screenshot-8.png DELETED
Binary file
screenshot-9.png DELETED
Binary file
wp-insert.php CHANGED
@@ -3,13 +3,13 @@
3
  Plugin Name: Wp-Insert
4
  Plugin URI: http://www.wp-insert.smartlogix.co.in/
5
  Description: WP-INSERT by SMARTLOGIX : The ultimate wordpress plugin (No1 Adsense Plugin for Wordpress)
6
- Version: 2.0.16
7
  Author: Namith Jawahar
8
  Author URI: http://www.smartlogix.co.in/
9
  WP-INSERT by SMARTLOGIX : The ultimate wordpress plugin (No1 Adsense Plugin for Wordpress)
10
  */
11
 
12
- /* Copyright 2009 NAMITH JAWAHAR (website : http://www.smartlogix.co.in)
13
 
14
  This program is free software; you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License as published by
@@ -27,11 +27,21 @@ WP-INSERT by SMARTLOGIX : The ultimate wordpress plugin (No1 Adsense Plugin for
27
  */
28
  /*Definitions*/
29
  if(!defined('WP_INSERT_URL'))
30
- define('WP_INSERT_URL',plugins_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.12');
35
  /*Includes*/
36
- require_once (dirname(__FILE__).'/includes/includes.php');
 
 
 
 
 
 
 
 
 
 
37
  ?>
3
  Plugin Name: Wp-Insert
4
  Plugin URI: http://www.wp-insert.smartlogix.co.in/
5
  Description: WP-INSERT by SMARTLOGIX : The ultimate wordpress plugin (No1 Adsense Plugin for Wordpress)
6
+ Version: 2.1
7
  Author: Namith Jawahar
8
  Author URI: http://www.smartlogix.co.in/
9
  WP-INSERT by SMARTLOGIX : The ultimate wordpress plugin (No1 Adsense Plugin for Wordpress)
10
  */
11
 
12
+ /* Copyright 2015 NAMITH JAWAHAR (website : http://www.smartlogix.co.in)
13
 
14
  This program is free software; you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License as published by
27
  */
28
  /*Definitions*/
29
  if(!defined('WP_INSERT_URL'))
30
+ define('WP_INSERT_URL', plugin_dir_url(__FILE__));
31
  if(!defined('WP_INSERT_DIR'))
32
+ define('WP_INSERT_DIR', plugin_dir_path(__FILE__));
33
  if(!defined('WP_INSERT_VERSION'))
34
+ define('WP_INSERT_VERSION', '2.1');
35
  /*Includes*/
36
+ require_once(dirname(__FILE__).'/includes/common/common.php');
37
+ require_once(dirname(__FILE__).'/includes/controls/controls.php');
38
+ require_once(dirname(__FILE__).'/includes/common/control-panel.php');
39
+ require_once(dirname(__FILE__).'/includes/common/abtesting.php');
40
+ require_once(dirname(__FILE__).'/includes/common/rules.php');
41
+ require_once(dirname(__FILE__).'/includes/common/geotargeting.php');
42
+ require_once(dirname(__FILE__).'/includes/inpostads.php');
43
+ require_once(dirname(__FILE__).'/includes/adwidgets.php');
44
+ require_once(dirname(__FILE__).'/includes/inthemeads.php');
45
+ require_once(dirname(__FILE__).'/includes/tracking-codes.php');
46
+ require_once(dirname(__FILE__).'/includes/legal-pages.php');
47
  ?>