CSS & JavaScript Toolbox - Version 0.3

Version Description

  • This is the first and latest release

=

Download this release

Release Info

Developer wipeoutmedia
Plugin Icon 128x128 CSS & JavaScript Toolbox
Version 0.3
Comparing to
See all releases

Version 0.3

css-js-toolbox.php ADDED
@@ -0,0 +1,912 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: CSS & JavaScript Toolbox
4
+ Plugin URI: http://wipeoutmedia.com/whats-new/css-javascript-toolbox/
5
+ Description: WordPress plugin to easily add custom CSS and JavaScript to individual pages
6
+ Version: 0.3
7
+ Author: Wipeout Media
8
+ Author URI: http://wipeoutmedia.com/whats-new/css-javascript-toolbox/
9
+
10
+ Copyright (c) 2011, Wipeout Media.
11
+
12
+ This program is free software; you can redistribute it and/or
13
+ modify it under the terms of the GNU General Public License
14
+ as published by the Free Software Foundation; either version 2
15
+ of the License, or (at your option) any later version.
16
+
17
+ This program is distributed in the hope that it will be useful,
18
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
+ GNU General Public License for more details.
21
+
22
+ You should have received a copy of the GNU General Public License
23
+ along with this program; if not, write to the Free Software
24
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25
+ */
26
+
27
+
28
+ //avoid direct calls to this file where wp core files not present
29
+ if (!function_exists ('add_action')) {
30
+ header('Status: 403 Forbidden');
31
+ header('HTTP/1.1 403 Forbidden');
32
+ exit();
33
+ }
34
+
35
+ define('CJTOOLBOX_VERSION', '0.2');
36
+ define('CJTOOLBOX_PATH', plugin_basename( dirname(__FILE__) ));
37
+ define('CJTOOLBOX_URL', WP_PLUGIN_URL . '/' . plugin_basename( dirname(__FILE__) ) . '/' );
38
+
39
+ if( !class_exists('cssJSToolbox') ) {
40
+ class cssJSToolbox {
41
+ var $settings = array();
42
+ var $settings_name;
43
+ var $cjdata = array();
44
+ var $cjdata_name;
45
+
46
+ function __construct() {
47
+
48
+ $this->settings_name = 'cjtoolbox_settings';
49
+ $this->cjdata_name = 'cjtoolbox_data';
50
+
51
+ // Load saved settings
52
+ $this->getSettings();
53
+
54
+ // Start this plugin once all other plugins are fully loaded
55
+ add_action( 'plugins_loaded', array(&$this, 'start_plugin') );
56
+ }
57
+
58
+ function __destruct() {
59
+ // Nothing to do now...
60
+ }
61
+
62
+ // Save new settings
63
+ function saveSettings() {
64
+ update_option($this->settings_name, $this->settings);
65
+ }
66
+
67
+ // Get back all saved settings
68
+ function getSettings() {
69
+ $this->settings = get_option($this->settings_name);
70
+ }
71
+
72
+ // Save/Get data
73
+ function saveData() {
74
+ $this->cjdata = array_values($this->cjdata);
75
+ update_option($this->cjdata_name, $this->cjdata);
76
+ }
77
+ function getData() {
78
+ $this->cjdata = get_option($this->cjdata_name);
79
+ }
80
+
81
+ function start_plugin() {
82
+ if (is_admin() ) {
83
+ // Load for admin panel
84
+ add_action('admin_menu', array(&$this, 'add_plugin_menu'));
85
+ //register the callback been used if options of page been submitted and needs to be processed
86
+ add_action('admin_post_save_cjtoolbox', array(&$this, 'on_save_changes'));
87
+ // register ajax save function
88
+ add_action('wp_ajax_cjtoolbox_save', array(&$this, 'ajax_save_changes'));
89
+ add_action('wp_ajax_cjtoolbox_save_newcode', array(&$this, 'ajax_save_newcode'));
90
+ add_action('wp_ajax_cjtoolbox_form', array(&$this, 'ajax_show_form'));
91
+ add_action('wp_ajax_cjtoolbox_get_code', array(&$this, 'ajax_get_code'));
92
+ add_action('wp_ajax_cjtoolbox_delete_code', array(&$this, 'ajax_delete_code'));
93
+ add_action('wp_ajax_cjtoolbox_add_block', array(&$this, 'ajax_add_block'));
94
+ // Create the tables and sample data
95
+ } else {
96
+ // Add the script and style files to footer
97
+ add_action('wp_head', array(&$this, 'cjtoolbox_insertcode'));
98
+ }
99
+ }
100
+
101
+ function cjtoolbox_insertcode() {
102
+ global $post;
103
+ // Home page displays a page.
104
+ $check_for = '';
105
+ if(is_home()) { // The blog page. It will be either same as front page or will be a page.
106
+ $check_for = 'allposts';
107
+ }
108
+ if(is_front_page()) {
109
+ $check_for = 'frontpage';
110
+ }
111
+ if(is_page()) {
112
+ $check_for = $post->ID;
113
+ }
114
+ if(is_single()) {
115
+ $check_for = 'allposts';
116
+ }
117
+
118
+ $this->getData();
119
+
120
+ $data = $this->cjdata;
121
+ foreach($data as $key => $value) {
122
+ $page_list = $data[$key]['page'];
123
+ if(is_array($page_list)) {
124
+ if(is_page() && in_array('allpages', $page_list)) {
125
+ echo stripslashes($data[$key]['code']);
126
+ continue;
127
+ } else if(in_array($check_for, $page_list)) {
128
+ echo stripslashes($data[$key]['code']);
129
+ continue;
130
+ }
131
+ }
132
+ if(is_category()) {
133
+ $this_category = get_query_var('cat');
134
+ $category_list = $data[$key]['category'];
135
+ if(is_array($category_list)) {
136
+ if(in_array($this_category, $category_list)) {
137
+ echo stripslashes($data[$key]['code']);
138
+ continue;
139
+ }
140
+ }
141
+ }
142
+
143
+ $pageURL = 'http';
144
+ if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
145
+ $pageURL .= "://";
146
+ if ($_SERVER["SERVER_PORT"] != "80") {
147
+ $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
148
+ } else {
149
+ $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
150
+ }
151
+ $links = stripslashes($data[$key]['links']);
152
+ $link_list = explode("\n", $links);
153
+ if(in_array($pageURL, $link_list)) {
154
+ echo stripslashes($data[$key]['code']);
155
+ continue;
156
+ }
157
+ }
158
+ }
159
+
160
+ // To add sub page & meta boxes
161
+ function add_plugin_menu() {
162
+ $this->hook_manage = add_options_page('CSS & JavaScript Toolbox' ,'CSS & JavaScript Toolbox', '10', 'cjtoolbox', array(&$this, 'admin_display'));
163
+ // register callback gets call prior your own page gets rendered
164
+ add_action('load-'.$this->hook_manage, array(&$this, 'admin_load_page'));
165
+
166
+ // register callback to show styles needed for the admin page
167
+ add_action( 'admin_print_styles-' . $this->hook_manage, array(&$this, 'admin_print_styles') );
168
+ // Load scripts for admin panel working
169
+ add_action('admin_print_scripts-' . $this->hook_manage, array(&$this, 'admin_print_scripts'));
170
+ }
171
+
172
+ //will be executed if wordpress core detects this page has to be rendered
173
+ function admin_load_page() {
174
+ //ensure, that the needed javascripts been loaded to allow drag/drop, expand/collapse and hide/show of boxes
175
+ wp_enqueue_script('common');
176
+ wp_enqueue_script('wp-lists');
177
+ wp_enqueue_script('postbox');
178
+ wp_enqueue_script('thickbox');
179
+ wp_enqueue_script('jquery-ui-tabs');
180
+
181
+ //add several metaboxes now, all metaboxes registered during load page can be switched off/on at "Screen Options" automatically, nothing special to do therefore
182
+ // add_meta_box('cjtoolbox-contentbox-1', 'CSS & JavaScript Block 1', array(&$this, 'on_contentbox_1_content'), $this->hook_manage, 'normal', 'core');
183
+ }
184
+
185
+ // Apply our stylesheet
186
+ function admin_print_styles() {
187
+ wp_enqueue_style('thickbox');
188
+ wp_enqueue_style( 'cjtoolbox', CJTOOLBOX_URL . 'media/admin.css', '', CJTOOLBOX_VERSION, 'all' );
189
+ }
190
+
191
+ // Add javascripts
192
+ function admin_print_scripts() {
193
+ wp_enqueue_style('jquery');
194
+ wp_print_scripts('jquery');
195
+ ?>
196
+ <script type="text/javascript" >
197
+ jQuery(document).ready(function($) {
198
+ jQuery('form#cjtoolbox_form').submit(function() {
199
+ var data = jQuery(this).serialize();
200
+ jQuery('#cj-ajax-load').fadeIn();
201
+ jQuery.post(ajaxurl, data, function(response) {
202
+ var success = jQuery('#cj-popup-save');
203
+ var loading = jQuery('#cj-ajax-load');
204
+ loading.fadeOut();
205
+ success.fadeIn();
206
+ window.setTimeout(function(){
207
+ success.fadeOut();
208
+ }, 3000);
209
+ });
210
+ return false;
211
+ });
212
+
213
+ //Update Message popup
214
+ jQuery.fn.center = function () {
215
+ this.animate({"top":( jQuery(window).height() - this.height() - 200 ) / 2+jQuery(window).scrollTop() + "px"}, 50);
216
+ this.animate({"left":( jQuery(window).width() - this.width() - 200 ) / 2 + "px"}, 50);
217
+ return this;
218
+ }
219
+
220
+ // Update loading
221
+ jQuery.fn.loadingcenter = function () {
222
+ this.animate({"top":( jQuery(window).height() - this.height() - 60 ) / 2 + jQuery(window).scrollTop() + "px"}, 50);
223
+ this.animate({"left":( jQuery(window).width() - this.width() - 60 ) / 2 + "px"}, 50);
224
+ return this;
225
+ }
226
+
227
+
228
+ jQuery('#cj-popup-save').center();
229
+ jQuery('#cj-popup-reset').center();
230
+ jQuery('#cj-ajax-load img').loadingcenter();
231
+ jQuery(window).scroll(function() {
232
+ jQuery('#cj-popup-save').center();
233
+ jQuery('#cj-popup-reset').center();
234
+ jQuery('#cj-ajax-load img').loadingcenter();
235
+ });
236
+
237
+ jQuery('#cjtoolbox-addblock').click(function(e) {
238
+ var count = jQuery('#cjblock-count').val();
239
+ var security = jQuery('#cjsecurity').val();
240
+ var data = {
241
+ action : 'cjtoolbox_add_block',
242
+ count : count,
243
+ security : security,
244
+ };
245
+ jQuery('#cj-ajax-load').fadeIn();
246
+ jQuery.post(ajaxurl, data, function(response) {
247
+ var loading = jQuery('#cj-ajax-load');
248
+ loading.fadeOut();
249
+ if(response == '' || response == 0) {
250
+ alert('Oops, unable to add CSS & JavaScript Block! Please try again!!!');
251
+ } else {
252
+ jQuery('#normal-sortables').append(response);
253
+ jQuery(".meta-box-sortables").sortable('refresh');
254
+ jQuery('#cjblock-count').val(parseInt(jQuery('#cjblock-count').val()) + 1);
255
+ }
256
+ });
257
+ return false; // For link to behave inactive
258
+ });
259
+
260
+ });
261
+
262
+ function insert_code(type, id) {
263
+ var cid = jQuery('#cjtoolbox-'+type+'-'+id+ ' option:selected').val();
264
+ var security = jQuery('#cjsecurity').val();
265
+ var data = {
266
+ action : 'cjtoolbox_get_code',
267
+ type : type,
268
+ id : cid,
269
+ security : security,
270
+ };
271
+ jQuery('#cj-ajax-load').fadeIn();
272
+ jQuery.post(ajaxurl, data, function(response) {
273
+ var loading = jQuery('#cj-ajax-load');
274
+ loading.fadeOut();
275
+ if(response == '' || response == 0) {
276
+ alert('Oops, unable to fetch selected '+type+' template! Please try again!!!');
277
+ } else {
278
+ jQuery('#cjcode-'+id).insertAtCaret(response);
279
+ }
280
+ });
281
+ return false; // For link to behave inactive
282
+ }
283
+
284
+ function delete_code(type, id) {
285
+ var sure = confirm('Are you sure? Selected template will be deleted permanently!!!');
286
+ if(!sure) return false;
287
+
288
+ var cid = jQuery('#cjtoolbox-'+type+'-'+id+ ' option:selected').val();
289
+ var security = jQuery('#cjsecurity').val();
290
+ var data = {
291
+ action : 'cjtoolbox_delete_code',
292
+ type : type,
293
+ id : cid,
294
+ security : security,
295
+ };
296
+ jQuery('#cj-ajax-load').fadeIn();
297
+ jQuery.post(ajaxurl, data, function(response) {
298
+ var loading = jQuery('#cj-ajax-load');
299
+ loading.fadeOut();
300
+ if(response == '' || response == 0) {
301
+ alert('Oops, unable to delete selected '+type+' template! Please try again!!!');
302
+ } else {
303
+ alert('Selected '+type+' template deleted successfully!');
304
+ jQuery('.cjtoolbox-'+type).each(function() {
305
+ jQuery(this).find('option[value='+cid+ ']').remove();
306
+ });
307
+ }
308
+ });
309
+ return false; // For link to behave inactive
310
+ }
311
+
312
+ function delete_block(id) {
313
+ var sure = confirm('Are you sure?');
314
+ if(sure) {
315
+ jQuery('#cjtoolbox-'+id).remove();
316
+ alert('Please make sure to click "Save All Changes" to delete the block permanently!');
317
+
318
+ // Reduce total block count by 1 NOTE: Not used now.
319
+ // jQuery('#cjblock-count').val(parseInt(jQuery('#cjblock-count').val()) - 1);
320
+ }
321
+ return false; // For link to behave inactive
322
+ }
323
+
324
+ jQuery.fn.extend({
325
+ insertAtCaret: function(myValue){
326
+ return this.each(function(i) {
327
+ if (document.selection) {
328
+ this.focus();
329
+ sel = document.selection.createRange();
330
+ sel.text = myValue;
331
+ this.focus();
332
+ }
333
+ else if (this.selectionStart || this.selectionStart == '0') {
334
+ var startPos = this.selectionStart;
335
+ var endPos = this.selectionEnd;
336
+ var scrollTop = this.scrollTop;
337
+ this.value = this.value.substring(0, startPos)+myValue+this.value.substring(endPos,this.value.length);
338
+ this.focus();
339
+ this.selectionStart = startPos + myValue.length;
340
+ this.selectionEnd = startPos + myValue.length;
341
+ this.scrollTop = scrollTop;
342
+ } else {
343
+ this.value += myValue;
344
+ this.focus();
345
+ }
346
+ })
347
+ }
348
+ });
349
+
350
+ </script>
351
+ <script type="text/javascript">
352
+ jQuery(document).ready(function($) {
353
+ $('#cjtoolbox_newcode').live('submit',
354
+ function (event) {
355
+ event.preventDefault();
356
+ var title = $('#cjtoolbox_newcode #new_title').val();
357
+ var code = $('#cjtoolbox_newcode #new_code').val();
358
+ var type = $('#cjtoolbox_newcode #new_type').val();
359
+ var security = $('#cjtoolbox_newcode #new_security').val();
360
+ if(title == '') { alert('Please enter title for code!'); return false; }
361
+ if(code == '') { alert('Please enter code to save!'); return false; }
362
+
363
+ var data = {
364
+ action : 'cjtoolbox_save_newcode',
365
+ type : type,
366
+ title : title,
367
+ code : code,
368
+ security : security,
369
+ };
370
+ jQuery('#cjtoolbox_popup .ajax-loading-img').fadeIn();
371
+ jQuery.post(ajaxurl, data, function(response) {
372
+ var loading = jQuery('#cjtoolbox_popup .ajax-loading-img');
373
+ var lastid = parseInt(response);
374
+ loading.fadeOut();
375
+ if(lastid > 0) {
376
+ alert('New code saved successfully!!!');
377
+ jQuery('.cjtoolbox-'+type).each(function() {
378
+ jQuery(this).append( '<option value="'+lastid+'">'+title+'</option>' );
379
+ });
380
+ } else {
381
+ alert('ISSUE: '+response);
382
+ }
383
+ tb_remove();
384
+ });
385
+ return false;
386
+ });
387
+ });
388
+
389
+ </script>
390
+ <?php
391
+ }
392
+
393
+ // Display the admin page for all options
394
+ function admin_display() {
395
+ $this->getData();
396
+ $count = count($this->cjdata);
397
+
398
+ /** RESET the metabox order to normal, we dont want to retain the order now. Just boxes with data are sufficient.*/
399
+ $page = $this->hook_manage;
400
+ $neworder = array();
401
+ for($i = 1; $i <= $count; $i++) {
402
+ $neworder[] = 'cjtoolbox-' . $i;
403
+ }
404
+ $order['normal'] = implode(',', $neworder);
405
+ $user = wp_get_current_user();
406
+ update_user_option($user->ID, "meta-box-order_$page", $order, true);
407
+ /*Block END*/
408
+
409
+ if($count <= 0) $count = 1; // Atleast have one block by default.
410
+ for($i = 1; $i <= $count; $i++) {
411
+ add_meta_box('cjtoolbox-'.$i, 'CSS & JavaScript Block #'.$i, array(&$this, 'cjtoolbox_unit'), $this->hook_manage, 'normal', 'core', $i - 1);
412
+ }
413
+
414
+ echo '<div id="cjtoolbox-admin" class="wrap">';
415
+ echo '<div id="custom-icon" style="background: transparent url(\''. CJTOOLBOX_URL . '/media/CSS_JS_Toolbox_Icon.png\') no-repeat;" class="icon32"><br /></div>';
416
+
417
+ switch ($_GET['page']){
418
+ case 'cjtoolbox':
419
+ default:
420
+ echo '<h2>CSS & JavaScript Toolbox</h2>';
421
+ $this->cjtoolbox_manage();
422
+ break;
423
+ }
424
+
425
+ echo '</div>';
426
+ }
427
+
428
+
429
+ // Display the admin page to manage custom css and javscripts
430
+ function cjtoolbox_manage() {
431
+ $this->getData();
432
+ $count = count($this->cjdata);
433
+
434
+ /*
435
+ print_r($this->cjdata);
436
+
437
+ echo "<pre>";
438
+ $page = $this->hook_manage;
439
+ $sorted = get_user_option( "meta-box-order_$page" );
440
+ print_r($sorted);
441
+ echo "</pre>";
442
+ */
443
+ ?>
444
+
445
+ <div id="cjtoolbox_donate">
446
+ Like this plugin? Please support our work
447
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
448
+ <input type="hidden" name="cmd" value="_s-xclick">
449
+ <input type="hidden" name="hosted_button_id" value="VMXTA3838F6A8">
450
+ <input type="image" src="<?php echo CJTOOLBOX_URL;?>/media/Donate_Button.png" border="0" name="submit" alt="Donate!">
451
+ <img alt="" border="0" src="https://www.paypalobjects.com/en_AU/i/scr/pixel.gif" width="1" height="1">
452
+ </form>
453
+ </div>
454
+ <div class="cj-save-popup" id="cj-popup-save">
455
+ <div id="cj-save-save">Options Updated</div>
456
+ </div>
457
+ <div class="cj-save-popup" id="cj-popup-reset">
458
+ <div id="cj-save-reset">Options Reset</div>
459
+ </div>
460
+ <div id="cj-ajax-load">
461
+ <img src="<?php echo CJTOOLBOX_URL; ?>/media/ajax-loader.gif" class="ajax-loading-img ajax-loading-img-bottom" alt="Working..." />
462
+ </div>
463
+
464
+
465
+ <form id="cjtoolbox_form" action="admin-post.php" method="post">
466
+ <?php wp_nonce_field('cjtoolbox'); ?>
467
+ <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false ); ?>
468
+ <?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false ); ?>
469
+ <input type="hidden" name="action" value="cjtoolbox_save" />
470
+ <input type="hidden" id="cjsecurity" name="security" value="<?php echo wp_create_nonce('cjtoolbox-admin');?>" />
471
+ <input type="hidden" id="cjblock-count" name="count" value="<?php echo $count; ?>" />
472
+ <div id="poststuff" class="metabox-holder">
473
+ <div id="post-body">
474
+ <?php do_meta_boxes($this->hook_manage, 'normal', $this->cjdata); ?>
475
+ </div>
476
+ <br class="clear"/>
477
+ <div id="save_bar">
478
+ <a class="button-secondary" id="cjtoolbox-addblock">Add New CSS/JS Block</a>
479
+ <input type="submit" value="Save All Changes" class="button-primary" name="save" />
480
+ </div>
481
+ </div>
482
+ </form>
483
+
484
+ <div id="cjtoolbox-tips">
485
+ <ul>
486
+ <li>Note: CSS &amp; JavaScript Blocks with EMPTY code will not be saved!</li>
487
+ <li><b>Warning!</b> Please make sure to validate added CSS &amp; JavaScript codes, the plugin doesn't do that for you!</li>
488
+ </ul>
489
+ </div>
490
+ <script type="text/javascript">
491
+ //<![CDATA[
492
+ jQuery(document).ready( function($) {
493
+ // close postboxes that should be closed
494
+ $('.if-js-closed').removeClass('if-js-closed').addClass('closed');
495
+ // postboxes setup
496
+ postboxes.add_postbox_toggles('<?php echo $this->hook_manage; ?>');
497
+ });
498
+ //]]>
499
+ </script>
500
+ <?php
501
+ }
502
+
503
+
504
+ function cjtoolbox_unit($data = '', $arg = '') {
505
+ $boxid = -1; // Because block 1 might have some content...
506
+ if($arg != '') {
507
+ $boxid = $arg['args'];
508
+ }
509
+ $this->getData();
510
+
511
+ ?>
512
+
513
+ <div class="cjpageblock">
514
+ <?php $this->show_page_list($boxid, $this->cjdata[$boxid]['page'], $this->cjdata[$boxid]['category']); ?>
515
+ <div style="clear:both;"></div>
516
+ </div>
517
+ <div class="cjcontainer">
518
+ <div class="cjcodeblock">
519
+ <div class="cssblock">
520
+ <p class="cjtitle">CSS Template <?php $this->show_dropdown_box('css', $boxid);?></p>
521
+ <p class="cjbutton"><a class="insert_code" title="Insert selected CSS Template" href="#" onclick="return insert_code('css', '<?php echo $boxid;?>');">Insert Code</a> <a class="delete_code" title="Delete selected CSS Template" href="#" onclick="return delete_code('css', '<?php echo $boxid;?>');">Delete Code</a> <a class="add_code thickbox" href="<?php echo get_option('siteurl'); ?>/wp-admin/admin-ajax.php?action=cjtoolbox_form&type=css&width=500&height=350" title="Add New CSS Code Template">New</a></p>
522
+ </div>
523
+ <div class="jsblock">
524
+ <p class="cjtitle">JS Template <?php $this->show_dropdown_box('js', $boxid);?></p>
525
+ <p class="cjbutton"><a class="insert_code" title="Insert selected JavaScript Template" href="#" onclick="return insert_code('js', '<?php echo $boxid;?>');">Insert Code</a> <a class="delete_code" title="Delete selected JavaScript Template" href="#" onclick="return delete_code('js', '<?php echo $boxid;?>');">Delete Code</a> <a class="add_code thickbox" href="<?php echo get_option('siteurl'); ?>/wp-admin/admin-ajax.php?action=cjtoolbox_form&type=js&width=500&height=350" title="Add New JavaScript Code Template">New</a></p>
526
+ </div>
527
+ <div class="datablock">
528
+ <textarea cols="100" rows="12" name="cjtoolbox[<?php echo $boxid;?>][code]" id="cjcode-<?php echo $boxid;?>"><?php echo stripslashes($this->cjdata[$boxid]['code']);?></textarea>
529
+ </div>
530
+ </div>
531
+ </div>
532
+ <div class="deleteblock">
533
+ <p class="cjexample">Click for <a target="_blank" href="http://wipeoutmedia.com/wordpress-plugins/css-javascript-toolbox/" title="Click for Hints &amp; Tips"><strong>Hints &amp; Tips</strong></a></p>
534
+ <a class="button-secondary" href="#" onclick="return delete_block('<?php echo ($boxid + 1);?>');">Delete This Block</a>
535
+ <div style="clear:both;"></div>
536
+ </div>
537
+
538
+ <?php
539
+ }
540
+
541
+
542
+ function show_page_list($boxid, $pages, $categories) {
543
+ ?>
544
+ <script type="text/javascript">
545
+ jQuery(function() {
546
+ jQuery( "#tabs-<?php echo $boxid;?>" ).tabs();
547
+ });
548
+ </script>
549
+ <div id="tabs-<?php echo $boxid;?>">
550
+ <ul>
551
+ <li><a href="#tabs-<?php echo $boxid;?>-1">Pages</a></li>
552
+ <li><a href="#tabs-<?php echo $boxid;?>-2">Categories</a></li>
553
+ <li><a href="#tabs-<?php echo $boxid;?>-3">URL List</a></li>
554
+ </ul>
555
+
556
+ <div id="tabs-<?php echo $boxid;?>-1">
557
+ <p>Add this CSS/JS code to ?</p>
558
+ <ul class="pagelist">
559
+ <li><label><input type="checkbox" name="cjtoolbox[<?php echo $boxid;?>][page][]" value="frontpage" <?php echo (is_array($pages) && in_array('frontpage', $pages)) ? 'checked="checked"' : ''; ?> /> Front Page</label> <a class="l_ext" target="_blank" href="<?php bloginfo('url');?>"></a></li>
560
+ <li><label><input type="checkbox" name="cjtoolbox[<?php echo $boxid;?>][page][]" value="allposts" <?php echo (is_array($pages) && in_array('allposts', $pages)) ? 'checked="checked"' : ''; ?> /> All Posts</label></li>
561
+ <li><label><input type="checkbox" name="cjtoolbox[<?php echo $boxid;?>][page][]" value="allpages" <?php echo (is_array($pages) && in_array('allpages', $pages)) ? 'checked="checked"' : ''; ?> /> All Pages</label></li>
562
+ <?php $this->show_pages_with_checkbox($boxid, $pages); ?>
563
+ </ul>
564
+ </div>
565
+ <div id="tabs-<?php echo $boxid;?>-2">
566
+ <p>Add this CSS/JS code to category page?</p>
567
+ <ul class="pagelist">
568
+ <?php $this->show_taxonomy_with_checkbox($boxid, $categories); ?>
569
+ </ul>
570
+ </div>
571
+ <div id="tabs-<?php echo $boxid;?>-3" class="linklist">
572
+ <p>Add one URL per line (include http://)</p>
573
+ <textarea cols="31" rows="9" name="cjtoolbox[<?php echo $boxid;?>][links]" id="cjcode-links-<?php echo $boxid;?>"><?php echo stripslashes($this->cjdata[$boxid]['links']);?></textarea>
574
+ </div>
575
+
576
+ </div>
577
+ <?php
578
+ }
579
+
580
+
581
+ // Copied from nav menu feature of WordPress
582
+ function show_taxonomy_with_checkbox($boxid, $taxonomy_selected) {
583
+ $taxonomy_name = 'category';
584
+ $args = array(
585
+ 'child_of' => 0,
586
+ 'exclude' => '',
587
+ 'hide_empty' => false,
588
+ 'hierarchical' => 1,
589
+ 'include' => '',
590
+ 'include_last_update_time' => false,
591
+ 'number' => 9999,
592
+ 'order' => 'ASC',
593
+ 'orderby' => 'name',
594
+ 'pad_counts' => false,
595
+ );
596
+
597
+ $terms = get_terms( $taxonomy_name, $args );
598
+
599
+ if ( ! $terms || is_wp_error($terms) ) {
600
+ // No items
601
+ return;
602
+ }
603
+
604
+ $db_fields = false;
605
+ if ( is_taxonomy_hierarchical( $taxonomy_name ) ) {
606
+ $db_fields = array( 'parent' => 'parent', 'id' => 'term_id' );
607
+ }
608
+
609
+ $walker = new cj_Walker_Nav_Menu_Checklist( $db_fields, $boxid, 'category', $taxonomy_selected );
610
+ $args['walker'] = $walker;
611
+
612
+ echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $terms), 0, (object) $args );
613
+ }
614
+
615
+ function show_pages_with_checkbox($boxid, $pages_selected) {
616
+
617
+ $post_type_name = 'page';
618
+ $args = array(
619
+ 'order' => 'ASC',
620
+ 'orderby' => 'title',
621
+ 'posts_per_page' => 9999,
622
+ 'post_type' => $post_type_name,
623
+ 'suppress_filters' => true,
624
+ 'update_post_term_cache' => false,
625
+ 'update_post_meta_cache' => false
626
+ );
627
+
628
+ // @todo transient caching of these results with proper invalidation on updating of a post of this type
629
+ $get_posts = new WP_Query;
630
+ $posts = $get_posts->query( $args );
631
+ if ( ! $get_posts->post_count ) {
632
+ // No items
633
+ return;
634
+ }
635
+
636
+ $db_fields = false;
637
+ if ( is_post_type_hierarchical( $post_type_name ) ) {
638
+ $db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' );
639
+ }
640
+
641
+ $walker = new cj_Walker_Nav_Menu_Checklist( $db_fields, $boxid, 'page', $pages_selected );
642
+ $post_type_object = get_post_type_object($post_type_name);
643
+
644
+ $args['walker'] = $walker;
645
+
646
+ $checkbox_items = walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $posts), 0, (object) $args );
647
+ echo $checkbox_items;
648
+ }
649
+
650
+ //executed if the post arrives initiated by pressing the submit button of form
651
+ function on_save_changes() {
652
+ //user permission check
653
+ if ( !current_user_can('manage_options') )
654
+ wp_die( __('Cheatin&#8217; uh?') );
655
+ //cross check the given referer
656
+ check_admin_referer('cjtoolbox');
657
+
658
+ // TODO: This is not coded now because we use AJAX. Should be coded to make the plugin work even if javascript is disabled.
659
+ //process here your on $_POST validation and / or option saving
660
+ //print_r($_POST);
661
+ //die();
662
+
663
+ //lets redirect the post request into get request (you may add additional params at the url, if you need to show save results
664
+ wp_redirect(add_query_arg( array('updated' => 'true'), $_POST['_wp_http_referer']));
665
+ }
666
+
667
+
668
+ function ajax_add_block() {
669
+ check_ajax_referer('cjtoolbox-admin', 'security');
670
+ $count = (int) $_POST['count'];
671
+ if($count == 0) $count = 1;
672
+ $args = array();
673
+ $args['args'] = $count;
674
+ ?>
675
+ <div id="cjtoolbox-<?php echo $count+1; ?>" class="postbox">
676
+ <div class="handlediv" title="Click to toggle"><br /></div><h3 class='hndle'><span>CSS & JavaScript Block #<?php echo $count+1; ?></span></h3>
677
+ <div class="inside">
678
+ <?php $this->cjtoolbox_unit('', $args); ?>
679
+ </div>
680
+ </div>
681
+ <?php
682
+ die();
683
+ }
684
+
685
+ function ajax_save_newcode() {
686
+ check_ajax_referer('cjtoolbox-popup', 'security');
687
+
688
+ // Add new row to cjdata table
689
+ $type = $_POST['type'];
690
+ $title = $_POST['title'];
691
+ $code = $_POST['code'];
692
+ $response = $this->add_cjdata($type, $title, $code);
693
+ if($response != false) {
694
+ die($response);
695
+ }
696
+ die('Oops, unable to save '.$type.' code template! Please try again!!!');
697
+ }
698
+
699
+
700
+ function ajax_save_changes() {
701
+
702
+ check_ajax_referer('cjtoolbox-admin', 'security');
703
+ if($_POST['action'] == 'cjtoolbox_save') {
704
+ // Save data and return 1 on success
705
+ $cjdata = $_POST['cjtoolbox'];
706
+ foreach($cjdata as $key => $value) {
707
+ if($value['code'] == '') {
708
+ unset($cjdata[$key]);
709
+ }
710
+ }
711
+ $this->cjdata = $cjdata;
712
+ $this->saveData();
713
+ return 1; die('1');
714
+ }
715
+ return 0; // Something wrong!
716
+ die(); // this is required to return a proper result
717
+ }
718
+
719
+ function ajax_delete_code() {
720
+ check_ajax_referer('cjtoolbox-admin', 'security');
721
+ $type = $_POST['type'];
722
+ $id = (int) $_POST['id'];
723
+ if($id <=0 || ($type != 'js' && $type != 'css')) return 'Invalid Request: Unable to process the request!';
724
+
725
+ $this->delete_cjdata($type, $id);
726
+ die('1');
727
+ }
728
+
729
+ function ajax_get_code() {
730
+ check_ajax_referer('cjtoolbox-admin', 'security');
731
+ $type = $_POST['type'];
732
+ $id = (int) $_POST['id'];
733
+ if($id <=0 || ($type != 'js' && $type != 'css')) return 'Invalid Request: Unable to process the request!';
734
+
735
+ $code = $this->get_cjdata($type, $id);
736
+ die($code);
737
+ }
738
+
739
+ function ajax_show_form() {
740
+ $type = '';
741
+ switch($_GET['type']) {
742
+ case 'js':
743
+ $type = 'js';
744
+ break;
745
+ case 'css':
746
+ default:
747
+ $type = 'css';
748
+ break;
749
+ }
750
+ ?>
751
+ <div id="cjtoolbox_popup">
752
+ <form id="cjtoolbox_newcode" action="admin-post.php" method="post">
753
+ <input id="new_type" type="hidden" name="new_type" value="<?php echo $type;?>" />
754
+ <input id="new_security" type="hidden" name="security" value="<?php echo wp_create_nonce('cjtoolbox-popup');?>" />
755
+ <p><label>Title <input type="text" id="new_title" name="new_title" value="" size="59" /></label></p>
756
+ <p><label>Code <textarea cols="57" id="new_code"rows="9" name="new_code"></textarea></label></p>
757
+ <input type="submit" name="submit" value="Save Code Template" />
758
+ <img style="display:none;" src="<?php echo CJTOOLBOX_URL; ?>/media/loading-bottom.gif" class="ajax-loading-img ajax-loading-img-bottom" alt="Working..." />
759
+ </form>
760
+ </div>
761
+ <?php
762
+ die();
763
+ }
764
+
765
+ function show_dropdown_box($type, $boxid) {
766
+ global $wpdb;
767
+
768
+ $query = $wpdb->prepare("SELECT id, title FROM {$wpdb->prefix}cjtoolbox_cjdata WHERE type = '{$type}'");
769
+ $list = $wpdb->get_results($query);
770
+ if(count($list)) {
771
+ echo '<select id="cjtoolbox-'.$type.'-'.$boxid.'" class="cjtoolbox-'.$type.'">';
772
+ foreach($list as $def) {
773
+ echo '<option value="' . $def->id . '">'. $def->title . '</option>';
774
+ }
775
+ echo '</select>';
776
+ }
777
+ }
778
+
779
+ function add_cjdata($type, $title, $code) {
780
+ global $wpdb;
781
+
782
+ if($type == '' || $title == '' || $code == '') return false;
783
+ $query = $wpdb->prepare("INSERT INTO {$wpdb->prefix}cjtoolbox_cjdata (type,title,code) VALUES ('%s', '%s', '%s')", $type, $title, $code);
784
+ $wpdb->query($query);
785
+ // Get inserted id
786
+ $lastid = $wpdb->get_var("SELECT id FROM {$wpdb->prefix}cjtoolbox_cjdata ORDER BY id DESC LIMIT 0,1");
787
+ return $lastid;
788
+ }
789
+
790
+ function delete_cjdata($type, $id) {
791
+ global $wpdb;
792
+ if($type == '' || $id <= 0) return false;
793
+ $query = $wpdb->prepare("DELETE FROM {$wpdb->prefix}cjtoolbox_cjdata WHERE type = '%s' AND id = '%d' LIMIT 1", $type, $id);
794
+ $wpdb->query($query);
795
+ return true;
796
+ }
797
+
798
+ function get_cjdata($type, $id) {
799
+ global $wpdb;
800
+
801
+ if($type == '' || $id <= 0) return false;
802
+ $query = $wpdb->prepare("SELECT code FROM {$wpdb->prefix}cjtoolbox_cjdata WHERE type = '%s' AND id = '%d' LIMIT 1", $type, $id);
803
+ $code = $wpdb->get_var($query);
804
+ return $code;
805
+ }
806
+
807
+ function activate_plugin() {
808
+ global $wpdb;
809
+ $database_version = CJTOOLBOX_VERSION;
810
+ $installed_db = get_option('cjtoolbox_db_version');
811
+ if($database_version != $installed_db) {
812
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
813
+ // Create the table structure
814
+ $sql = "CREATE TABLE `{$wpdb->prefix}cjtoolbox_cjdata` (
815
+ `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT ,
816
+ `type` VARCHAR( 15 ) NOT NULL ,
817
+ `title` TINYTEXT NOT NULL ,
818
+ `code` MEDIUMTEXT NOT NULL ,
819
+ PRIMARY KEY ( `id` , `type` )
820
+ )";
821
+ dbDelta($sql);
822
+ update_option( "cjtoolbox_db_version", $database_version );
823
+
824
+ // Add sample code
825
+ $count = $wpdb->get_var("SELECT count(*) FROM {$wpdb->prefix}cjtoolbox_cjdata WHERE type='css'");
826
+ if($count == 0) {
827
+ $wpdb->query("INSERT INTO {$wpdb->prefix}cjtoolbox_cjdata (type,title,code) VALUES ('css','Inline CSS Declaration','<style type=\"text/css\">\n\n</style>')");
828
+ $wpdb->query("INSERT INTO {$wpdb->prefix}cjtoolbox_cjdata (type,title,code) VALUES ('css','External Stylesheet','<link rel=\"stylesheet\" type=\"text/css\" href=\"\"/>')");
829
+ }
830
+
831
+ $count = $wpdb->get_var("SELECT count(*) FROM {$wpdb->prefix}cjtoolbox_cjdata WHERE type='js'");
832
+ if($count == 0) {
833
+ $wpdb->query("INSERT INTO {$wpdb->prefix}cjtoolbox_cjdata (type,title,code) VALUES ('js','Inline JavaScript Declaration','<script type=\"text/javascript\">\n\n</script>')");
834
+ $wpdb->query("INSERT INTO {$wpdb->prefix}cjtoolbox_cjdata (type,title,code) VALUES ('js','External JavaScript','<script type=\"text/javascript\" src=\"\"></script>')");
835
+ }
836
+ }
837
+ }
838
+ }// END Class
839
+
840
+ // Let's start the plugin
841
+ global $cssJSToolbox;
842
+ $cssJSToolbox = new cssJSToolbox();
843
+
844
+ // Activation
845
+ register_activation_hook(__FILE__, array(&$cssJSToolbox, "activate_plugin"));
846
+ }
847
+
848
+ /** Following code copied from WordPress core */
849
+ /**
850
+ * Create HTML list of nav menu input items.
851
+ *
852
+ * @package WordPress
853
+ * @since 3.0.0
854
+ * @uses Walker_Nav_Menu
855
+ */
856
+ class cj_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
857
+ function __construct( $fields = false, $boxid = 0, $type = 'page', $selected = array() ) {
858
+ if ( $fields ) {
859
+ $this->db_fields = $fields;
860
+ }
861
+ $this->boxid = $boxid;
862
+ $this->selected = $selected;
863
+ $this->type = $type;
864
+ }
865
+
866
+ function start_lvl( &$output, $depth ) {
867
+ $indent = str_repeat( "\t", $depth );
868
+ $output .= "\n$indent<ul class='children'>\n";
869
+ }
870
+
871
+ function end_lvl( &$output, $depth ) {
872
+ $indent = str_repeat( "\t", $depth );
873
+ $output .= "\n$indent</ul>";
874
+ }
875
+
876
+ /**
877
+ * @see Walker::start_el()
878
+ * @since 3.0.0
879
+ *
880
+ * @param string $output Passed by reference. Used to append additional content.
881
+ * @param object $item Menu item data object.
882
+ * @param int $depth Depth of menu item. Used for padding.
883
+ * @param object $args
884
+ */
885
+ function start_el(&$output, $item, $depth, $args) {
886
+
887
+ $possible_object_id = $item->object_id;
888
+
889
+ $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
890
+
891
+ $output .= $indent . '<li>';
892
+ $output .= '<label>';
893
+ $output .= '<input type="checkbox" ';
894
+ if ( ! empty( $item->_add_to_top ) ) {
895
+ $output .= ' add-to-top';
896
+ }
897
+ $output .= ' name="cjtoolbox['.$this->boxid.']['.$this->type.'][]" value="'. esc_attr( $item->object_id ) .'" ';
898
+ if(is_array($this->selected)) {
899
+ $output .= in_array($item->object_id, $this->selected) ? 'checked="checked"' : '';
900
+ }
901
+ $output .= '/> ';
902
+ $output .= empty( $item->label ) ? esc_html( $item->title ) : esc_html( $item->label );
903
+ $permalink = '';
904
+ if($this->type == 'category') {
905
+ $permalink = get_category_link($item->object_id);
906
+ } else {
907
+ $permalink = get_permalink($item->object_id);
908
+ }
909
+ $output .= '</label> <a class="l_ext" target="_blank" href="'. $permalink .'"></a>';
910
+
911
+ }
912
+ }
index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // index.php just to prevent indexing of plugin folder
3
+ ?>
license.txt ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 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
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
+
284
+ If you develop a new program, and you want it to be of the greatest
285
+ possible use to the public, the best way to achieve this is to make it
286
+ free software which everyone can redistribute and change under these terms.
287
+
288
+ To do so, attach the following notices to the program. It is safest
289
+ to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
+ the "copyright" line and a pointer to where the full notice is found.
292
+
293
+ <one line to give the program's name and a brief idea of what it does.>
294
+ Copyright (C) <year> <name of author>
295
+
296
+ This program is free software; you can redistribute it and/or modify
297
+ it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
+ (at your option) any later version.
300
+
301
+ This program is distributed in the hope that it will be useful,
302
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
+ GNU General Public License for more details.
305
+
306
+ You should have received a copy of the GNU General Public License along
307
+ with this program; if not, write to the Free Software Foundation, Inc.,
308
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+ Also add information on how to contact you by electronic and paper mail.
311
+
312
+ If the program is interactive, make it output a short notice like this
313
+ when it starts in an interactive mode:
314
+
315
+ Gnomovision version 69, Copyright (C) year name of author
316
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+ This is free software, and you are welcome to redistribute it
318
+ under certain conditions; type `show c' for details.
319
+
320
+ The hypothetical commands `show w' and `show c' should show the appropriate
321
+ parts of the General Public License. Of course, the commands you use may
322
+ be called something other than `show w' and `show c'; they could even be
323
+ mouse-clicks or menu items--whatever suits your program.
324
+
325
+ You should also get your employer (if you work as a programmer) or your
326
+ school, if any, to sign a "copyright disclaimer" for the program, if
327
+ necessary. Here is a sample; alter the names:
328
+
329
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+ <signature of Ty Coon>, 1 April 1989
333
+ Ty Coon, President of Vice
334
+
335
+ This General Public License does not permit incorporating your program into
336
+ proprietary programs. If your program is a subroutine library, you may
337
+ consider it more useful to permit linking proprietary applications with the
338
+ library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License.
media/CSS_JS_Toolbox_Icon.png ADDED
Binary file
media/Donate_Button.png ADDED
Binary file
media/accept.png ADDED
Binary file
media/admin.css ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /** CSS & Javascript Toolkit - Admin CSS **/
2
+ .wrap { position:relative; }
3
+ .wrap h2 { float:left; }
4
+ #wpcontent { min-width:1040px; }
5
+ #post-body { min-width:1020px; }
6
+ #cjtoolbox_donate { float:right; position:relative; right:20px; line-height:40px; width:380px; }
7
+ #cjtoolbox_donate input { position:absolute; right:0; top:0; }
8
+
9
+ #cjtoolbox_form { clear:both; }
10
+ .cjcodeblock { margin-right:350px; min-width:660px; }
11
+ .cjpageblock { width:320px; position:absolute; right:12px; }
12
+ .pagelist { padding:10px; height:172px; overflow:auto; background:#fff; border:1px solid #ccc; }
13
+ .pagelist li { line-height:19px; word-wrap:break-word; margin:0; padding:0; }
14
+ .pagelist ul { margin-left:18px; }
15
+ .cssblock, .jsblock { width:50%; }
16
+ .cssblock { float:left; }
17
+ .jsblock { float:right; }
18
+ .datablock textarea { width:100%; height:242px; }
19
+ .deleteblock a.button-secondary { padding:5px 10px; margin:10px 0 5px; float:right; }
20
+ .linklist textarea { width:290px; font-size:11px; height:190px; }
21
+
22
+ .cjtitle { float:left; width:245px; }
23
+ .cssblock select { width:150px; }
24
+ .jsblock select { width:155px; }
25
+ .cjbutton { width:85px; height:20px; float:left; }
26
+ .cjbutton a { height:20px; width:20px; text-indent:-999em; margin:5px 5px 0 0; display:block; float:left; }
27
+ .cjexample { clear:both; float:left; padding:5px 0 0; }
28
+ a.add_code { background:url(icons/add_code.png) no-repeat; }
29
+ a.delete_code { background:url(icons/delete_code.png) no-repeat; }
30
+ a.insert_code { background:url(icons/insert_code.png) no-repeat; }
31
+ a.l_ext { background:url(icons/external_link.gif) no-repeat; width:13px; height:11px; display:inline-block; }
32
+
33
+ #cjtoolbox-addblock { float:left; padding:5px 10px; }
34
+
35
+ #cjtoolbox-tips { padding:20px; }
36
+ #cjtoolbox-tips ul li { list-style-type:square; }
37
+
38
+
39
+ .cj-save-popup { position:absolute; -moz-border-radius:12px; -webkit-border-radius:12px; border-radius:12px; background:rgba(0, 0, 0, 0.4); color:#fff; font-size:24px; text-align:center; display:none; z-index:99; }
40
+ #cj-save-save { background:url(accept.png) 20px 50% no-repeat; padding:30px 30px 30px 70px; }
41
+ #cj-save-reset { background:url(warning.png) 20px 50% no-repeat; padding:30px 30px 30px 70px; }
42
+
43
+ #cj-ajax-load { position:absolute; background:rgba(255, 255, 255, 0.8); text-align:center; display:none; padding:50px; z-index:999; width:100%; height:100%; }
44
+ #cj-ajax-load img { position:absolute; }
45
+
46
+ #save_bar { background: #f3f3f3; border:solid #ccc; border-width:1px; padding: 10px 20px; text-align: right; -moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; }
47
+ .hide { display:none }
48
+ .ajax-loading-img-top { margin: 8px 4px 0; float:left }
49
+
50
+
51
+ /*
52
+ * jQuery UI Tabs 1.8.16
53
+ *
54
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
55
+ * Dual licensed under the MIT or GPL Version 2 licenses.
56
+ * http://jquery.org/license
57
+ *
58
+ * http://docs.jquery.com/UI/Tabs#theming
59
+ */
60
+ .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
61
+ .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
62
+ .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; padding: 0; white-space: nowrap; }
63
+ .ui-tabs .ui-tabs-nav li a { background:#F1F1F1; color:#999999; border-color:#DFDFDF #DFDFDF #CCCCCC; height:18px;margin:5px 5px 0 0;padding:4px 5px 2px;float:right;cursor:pointer;border-width:1px;border-style:solid;-moz-border-radius:3px 3px 0 0;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px; border-bottom: 0 !important; }
64
+ .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
65
+ .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
66
+ .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; background:#E9E9E9; border-color:#CCCCCC #CCCCCC #E9E9E9; color:#333333; }
67
+ .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
68
+ .ui-tabs .ui-tabs-panel { display: block; padding: 5px 10px; background: #EFEFEF; border-color:#CCCCCC; border-style:solid;border-width:1px;border-collapse:separate;-moz-border-radius:3px 3px 0 0;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px; clear:both; height:228px; }
69
+ .ui-tabs .ui-tabs-hide { display: none !important; }
media/ajax-loader.gif ADDED
Binary file
media/icons/add_code.png ADDED
Binary file
media/icons/delete_code.png ADDED
Binary file
media/icons/external_link.gif ADDED
Binary file
media/icons/insert_code.png ADDED
Binary file
media/icons/insert_code1.png ADDED
Binary file
media/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // index.php just to prevent indexing of plugin folder
3
+ ?>
media/loading-bottom.gif ADDED
Binary file
media/warning.png ADDED
Binary file
readme.txt ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === CSS & JavaScript Toolbox ===
2
+ Contributors: wipeoutmedia
3
+ Author URL: http://wipeoutmedia.com/whats-new/css-javascript-toolbox/
4
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=VMXTA3838F6A8
5
+ Tags: html, css, javascript, code, custom, page, pages, post, posts, category, categories, url
6
+ Requires at least: 3.0
7
+ Tested up to: 3.2.1
8
+ Stable tag: 0.3
9
+
10
+ Easily add custom CSS and JavaScript code to individual Pages, Posts, Categories, and URLs.
11
+
12
+ == Description ==
13
+
14
+ If you are an avid CSS and JavaScript fan, then you will really love this nifty piece of software. Our WordPress plugin provides a great deal of flexibility by allowing you to attach custom CSS or JavaScript code to pages, posts, categories, and URLs.
15
+
16
+ = Key Features =
17
+
18
+ - create and save CSS or JavaScript code snippets, allowing for code reuse
19
+ - give code snippets specific titles, so you can search and add them to the editor window from a drop-down list
20
+ - insert button to add code to pages/posts, categories, and URLs (code is added at the cursor)
21
+ - delete code from the drop-down list
22
+ - add default inline and external CSS and JavaScript declarations
23
+ - add extra CSS & JavaScript code block windows as needed
24
+
25
+ = Instructions =
26
+
27
+ [Instructions with Screenshots](http://wipeoutmedia.com/whats-new/css-javascript-toolbox/)
28
+
29
+ After you have uploaded and activated the CSS & JavaScript Toolbox plugin, you will notice a new menu item appear under Settings in your Dashboard. Click 'CSS & JavaScript Toolbox' link in the left admin bar of your dashboard.
30
+
31
+ Write the code, then choose what the code affects
32
+ Clicking into the toolbox link from the WordPress Dashboard for the first time, you will see a CSS & JavaScript Block. Inside this block is a large editor window, and this is where you write your CSS or JavaScript code. To allow your code to run on your website, you need to specify the pages, posts, categories, or page URLs you want the code to work with. You can select multiple checkboxes and even make selections from the other tabs – just make sure you click the Save All Changes button when you are done. The three tab sections are shown in the slideshow below. Note: clicking the small box icon with the arrow in the corner will open the page for testing purposes.
33
+
34
+ Adding default CSS or JavaScript declaration code
35
+ If you want to add CSS or JavaScript declaration code snippets, but can never remember how they go, that’s cool, we have included these as default code snippets in the drop-down list box. Simply choose the one you want, and click the button with the green down arrow.
36
+
37
+ Creating and saving your own code snippets This plugin allows you to create and save your own snippets of code so you can reuse it across additional CSS & JavaScript Blocks. To create and save your own snippets of code, simply click the button with the green cross. You will see a popup window, where you can create a title for your code, and enter the actual code in the main text area. Once you are happy with your code snippet and title, click the Save Code Template button.
38
+
39
+ You can then click the drop-down list, select the code title you provided, and then click the green down arrow button to insert the code into the editor window.
40
+
41
+ Adding more CSS & JavaScript Blocks We understand that one CSS & JavaScript Block is not enough. You may want to affect a different page with a whole new set of code. In this scenario, we have you covered. Look below the bottom of the block and you will find a button labelled Add New CSS/JS Block. Click that to add an entirely new CSS & JavaScript Block.
42
+
43
+ Although this plugin uses Ajax for the function calls (in other words does not refresh the webpage), please remember to save your code on a regular basis by clicking the Save All Changes button.
44
+
45
+ = Thank You =
46
+ We would like to take this opportunity to thank you for installing our plugin. :)
47
+ We hope you enjoy using our new WordPress plugin with your development work. We do plan on developing it further with some awesomely cool updates in the near future – so stay tuned!!! If you do enjoy this plugin and not only find it useful, but appreciate the huge amount of work that has gone into creating it, you can certainly support us in a number of ways, including:
48
+ - Consider donating through PayPal
49
+ - Join our Newsletter mailing list for updates and news
50
+ - Contact us for WordPress or logo services
51
+ - Like our Facebook page
52
+ - Follow us on Twitter
53
+
54
+ We would also love to hear your thoughts on our plugin. How has it helped you? How did you find using it? And – is there anything that could make it better? Please drop us a comment below, and thanks again for your support! Enjoy!!
55
+
56
+ == Installation ==
57
+
58
+ 1. Upload the 'css-js-toolbox' folder to the `/wp-content/plugins/` directory
59
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
60
+ 3. Click 'CSS & JavaScript Toolbox' link in the left admin bar of your dashboard
61
+
62
+ == Frequently Asked Questions ==
63
+ No frequently asked question at this time - stay tuned!
64
+
65
+ == Screenshots ==
66
+
67
+ 1. Main CSS & JavaScript Toolbox window showing the JS/CSS Block.
68
+ 2. Three tab sections showing Pages (& Posts), Categories, and URL List respectively.
69
+ 3. Adding default CSS or JavaScript declaration code
70
+ 4. Creating and saving your own code snippets
71
+ 5. Using the drop-down list box to add your own code snippets
72
+ 6. Adding more CSS & JavaScript Blocks
73
+
74
+ == Changelog ==
75
+ = 0.3 =
76
+ * This is the first and latest release
77
+
78
+ == Credits ==
79
+
80
+ Copyright (c) 2011, Wipeout Media.
81
+
82
+ This program is free software; you can redistribute it and/or
83
+ modify it under the terms of the GNU General Public License
84
+ as published by the Free Software Foundation; either version 2
85
+ of the License, or (at your option) any later version.
86
+
87
+ This program is distributed in the hope that it will be useful,
88
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
89
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
90
+ GNU General Public License for more details.
91
+
92
+ You should have received a copy of the GNU General Public License
93
+ along with this program; if not, write to the Free Software
94
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.png ADDED
Binary file
screenshot-4.png ADDED
Binary file
screenshot-5.png ADDED
Binary file
screenshot-6.png ADDED
Binary file