Version Description
- Fix: Assignment Panel Pagination Icon position fixed for Safari browsers.
- Remove: New Block Form Activate, Location Hook and Initial position fields.
- Remove: Block Revisions.
- Remove: Blocks Backup and Restore.
- Remove: Assignment Panel Select-Childs Checkboxes.
- Remove: Minimize and Mazimize All.
- Remove: Batch Process (Delete All and Delete Empty).
- Remove: Output Location Switch (Header and Footer).
- Remove: State Switch (Activate, Deactivate and Invert).
- Remove: Shortcode TinyMCE button (Community users has to write Shortcode manually).
- Remove: Don't load more assignment objects by scroll (Community users has to use the pagination list).
Download this release
Release Info
Developer | xpointer |
Plugin | CSS & JavaScript Toolbox |
Version | 6.1.4 |
Comparing to | |
See all releases |
Code changes from version 6.1.3 to 6.1.4
- access.points/tinymce.accesspoint.php +0 -52
- controllers/blocks-ajax.php +1 -4
- controllers/blocks.php +2 -5
- css-js-toolbox.php +2 -2
- readme.txt +14 -1
- views/blocks/block/public/js/jquery.block/jquery.block.js +1 -72
- views/blocks/block/tmpl/templates/toolbox.html.tmpl +0 -1
- views/blocks/cjt-block/public/css/block.css +1 -1
- views/blocks/cjt-block/public/js/jquery.assignpanel/jquery.assignpanel.js +0 -60
- views/blocks/manager/public/css/blocks.css +3 -2
- views/blocks/manager/public/js/blocks-page/blocks-page.js +6 -262
- views/blocks/manager/tmpl/blocks.html.tmpl +4 -27
- views/blocks/manager/tmpl/toolbox.html.tmpl +0 -31
- views/blocks/new/public/css/add-new-block.css +3 -0
- views/blocks/new/public/js/add-new-block/add-new-block.js +1 -1
- views/blocks/new/tmpl/default.html.tmpl +0 -38
- views/blocks/new/view.php +2 -1
access.points/tinymce.accesspoint.php
DELETED
@@ -1,52 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
*
|
4 |
-
*/
|
5 |
-
|
6 |
-
/**
|
7 |
-
*
|
8 |
-
*/
|
9 |
-
class CJTTinymceAccessPoint extends CJTAccessPoint {
|
10 |
-
|
11 |
-
/**
|
12 |
-
* put your comment there...
|
13 |
-
*
|
14 |
-
*/
|
15 |
-
public function __construct() {
|
16 |
-
// initialize base!
|
17 |
-
parent::__construct();
|
18 |
-
// Set name!
|
19 |
-
$this->name = 'tinymce';
|
20 |
-
}
|
21 |
-
|
22 |
-
/**
|
23 |
-
* put your comment there...
|
24 |
-
*
|
25 |
-
*/
|
26 |
-
protected function doListen() {
|
27 |
-
// Only if installed!
|
28 |
-
if (CJTPlugin::getInstance()->isInstalled()) {
|
29 |
-
// Don't bother doing this stuff if the current user lacks permissions
|
30 |
-
if ((current_user_can('edit_posts') || current_user_can('edit_pages')) && (get_user_option('rich_editing') == 'true')) {
|
31 |
-
add_filter('mce_external_plugins', array($this, 'registerButton'));
|
32 |
-
}
|
33 |
-
}
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
* put your comment there...
|
38 |
-
*
|
39 |
-
* @param mixed $plugins
|
40 |
-
*/
|
41 |
-
public function registerButton($plugins) {
|
42 |
-
// Load tinymce/shortcodes view through default controller!
|
43 |
-
$this->controllerName = 'default';
|
44 |
-
$this->route(null, array('view' => 'tinymce/shortcodes'))
|
45 |
-
// Display
|
46 |
-
->setAction('display')
|
47 |
-
->_doAction();
|
48 |
-
// Don't register anything, we just use this filter as Action.
|
49 |
-
return $plugins;
|
50 |
-
}
|
51 |
-
|
52 |
-
} // End class
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
controllers/blocks-ajax.php
CHANGED
@@ -75,7 +75,7 @@ class CJTBlocksAjaxController extends CJTAjaxController {
|
|
75 |
$blockData = array(
|
76 |
'id' => $blockId,
|
77 |
'name' => $defaultBlockName,
|
78 |
-
'state' =>
|
79 |
'location' => null,
|
80 |
'owner' => get_current_user_id(),
|
81 |
'created' => $wordpressMYSQLTime,
|
@@ -174,7 +174,6 @@ class CJTBlocksAjaxController extends CJTAjaxController {
|
|
174 |
// Blocks are sent ins single array list.
|
175 |
$blocksToSave = filter_input(INPUT_POST, 'blocks', FILTER_UNSAFE_RAW, FILTER_REQUIRE_ARRAY);
|
176 |
$calculatePinPoint = (bool) filter_input(INPUT_POST, 'calculatePinPoint', FILTER_SANITIZE_NUMBER_INT);
|
177 |
-
$createRevision = (bool) filter_input(INPUT_POST, 'createRevision', FILTER_SANITIZE_NUMBER_INT);
|
178 |
// For any reason that cause Client/Javascript to send empty blocks,
|
179 |
// make sure we're save.
|
180 |
if (is_array($blocksToSave) && !empty($blocksToSave)) {
|
@@ -184,8 +183,6 @@ class CJTBlocksAjaxController extends CJTAjaxController {
|
|
184 |
$blockData->id = $id;
|
185 |
// Recalculate pinPoint field value.
|
186 |
!$calculatePinPoint or (CJTBlockModel::arrangePins($blockData) && CJTBlockModel::calculateBlockPinPoint($blockData));
|
187 |
-
// Create block revision.
|
188 |
-
!$createRevision or $this->model->addRevision($id);
|
189 |
// Set lastModified field to current time.
|
190 |
$blockData->lastModified = current_time('mysql');
|
191 |
// Update database.
|
75 |
$blockData = array(
|
76 |
'id' => $blockId,
|
77 |
'name' => $defaultBlockName,
|
78 |
+
'state' => 'active',
|
79 |
'location' => null,
|
80 |
'owner' => get_current_user_id(),
|
81 |
'created' => $wordpressMYSQLTime,
|
174 |
// Blocks are sent ins single array list.
|
175 |
$blocksToSave = filter_input(INPUT_POST, 'blocks', FILTER_UNSAFE_RAW, FILTER_REQUIRE_ARRAY);
|
176 |
$calculatePinPoint = (bool) filter_input(INPUT_POST, 'calculatePinPoint', FILTER_SANITIZE_NUMBER_INT);
|
|
|
177 |
// For any reason that cause Client/Javascript to send empty blocks,
|
178 |
// make sure we're save.
|
179 |
if (is_array($blocksToSave) && !empty($blocksToSave)) {
|
183 |
$blockData->id = $id;
|
184 |
// Recalculate pinPoint field value.
|
185 |
!$calculatePinPoint or (CJTBlockModel::arrangePins($blockData) && CJTBlockModel::calculateBlockPinPoint($blockData));
|
|
|
|
|
186 |
// Set lastModified field to current time.
|
187 |
$blockData->lastModified = current_time('mysql');
|
188 |
// Update database.
|
controllers/blocks.php
CHANGED
@@ -50,15 +50,12 @@ class CJTBlocksController extends CJTController {
|
|
50 |
* @return void
|
51 |
*/
|
52 |
public function indexAction() {
|
53 |
-
//
|
54 |
-
$backupId = filter_input(INPUT_GET, 'backupId', FILTER_SANITIZE_NUMBER_INT);
|
55 |
$blocks['filters']['type'] = 'block';
|
56 |
-
// If backupId is not provided it must be NULL in the filter,
|
57 |
-
$blocks['filters']['backupId'] = $backupId ? $backupId : null;
|
58 |
// Push data to the view.
|
59 |
$this->view->blocks = $this->model->getBlocks(null, $blocks['filters']);
|
60 |
$this->view->order = $this->model->getOrder();
|
61 |
-
$this->view->backupId =
|
62 |
$this->view->securityToken = $this->createSecurityToken();
|
63 |
// page hook is added later after this object is already created.
|
64 |
// Get page hook directrly from controllers.
|
50 |
* @return void
|
51 |
*/
|
52 |
public function indexAction() {
|
53 |
+
// Blocks query.
|
|
|
54 |
$blocks['filters']['type'] = 'block';
|
|
|
|
|
55 |
// Push data to the view.
|
56 |
$this->view->blocks = $this->model->getBlocks(null, $blocks['filters']);
|
57 |
$this->view->order = $this->model->getOrder();
|
58 |
+
$this->view->backupId = null;
|
59 |
$this->view->securityToken = $this->createSecurityToken();
|
60 |
// page hook is added later after this object is already created.
|
61 |
// Get page hook directrly from controllers.
|
css-js-toolbox.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: CSS & JavaScript Toolbox
|
4 |
Plugin URI: http://css-javascript-toolbox.com/css-javascript-toolbox-free
|
5 |
Description: CJT Plugin for WordPress to easily add custom CSS and JavaScript to individual pages
|
6 |
-
Version: 6.1.
|
7 |
Author: Wipeout Media
|
8 |
Author URI: http://css-javascript-toolbox.com/
|
9 |
License:
|
@@ -95,7 +95,7 @@ class CJTPlugin extends CJTHookableClass {
|
|
95 |
/**
|
96 |
*
|
97 |
*/
|
98 |
-
const VERSION = '6.1.
|
99 |
|
100 |
/**
|
101 |
*
|
3 |
Plugin Name: CSS & JavaScript Toolbox
|
4 |
Plugin URI: http://css-javascript-toolbox.com/css-javascript-toolbox-free
|
5 |
Description: CJT Plugin for WordPress to easily add custom CSS and JavaScript to individual pages
|
6 |
+
Version: 6.1.4
|
7 |
Author: Wipeout Media
|
8 |
Author URI: http://css-javascript-toolbox.com/
|
9 |
License:
|
95 |
/**
|
96 |
*
|
97 |
*/
|
98 |
+
const VERSION = '6.1.4 CE';
|
99 |
|
100 |
/**
|
101 |
*
|
readme.txt
CHANGED
@@ -7,7 +7,7 @@ License: GPLv2 or later
|
|
7 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
8 |
Requires at least: 3.6
|
9 |
Tested up to: 3.8.1
|
10 |
-
Stable tag: 6.1.
|
11 |
|
12 |
Easily add custom CSS, JavaScript, HTML and PHP code to unique CJT code blocks and assign them wherever you want.
|
13 |
|
@@ -128,6 +128,19 @@ Sometimes a bug decides to rear its ugly head and when this happens, this is whe
|
|
128 |
|
129 |
== Changelog ==
|
130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
= 6.1.3 =
|
132 |
* Enhance: UI Compatibility with Wordpress >= 3.8.
|
133 |
* Deprecated: New Block Form Activate, Location Hook and Initial position fields.
|
7 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
8 |
Requires at least: 3.6
|
9 |
Tested up to: 3.8.1
|
10 |
+
Stable tag: 6.1.4
|
11 |
|
12 |
Easily add custom CSS, JavaScript, HTML and PHP code to unique CJT code blocks and assign them wherever you want.
|
13 |
|
128 |
|
129 |
== Changelog ==
|
130 |
|
131 |
+
= 6.1.4 =
|
132 |
+
* Fix: Assignment Panel Pagination Icon position fixed for Safari browsers.
|
133 |
+
* Remove: New Block Form Activate, Location Hook and Initial position fields.
|
134 |
+
* Remove: Block Revisions.
|
135 |
+
* Remove: Blocks Backup and Restore.
|
136 |
+
* Remove: Assignment Panel Select-Childs Checkboxes.
|
137 |
+
* Remove: Minimize and Mazimize All.
|
138 |
+
* Remove: Batch Process (Delete All and Delete Empty).
|
139 |
+
* Remove: Output Location Switch (Header and Footer).
|
140 |
+
* Remove: State Switch (Activate, Deactivate and Invert).
|
141 |
+
* Remove: Shortcode TinyMCE button (Community users has to write Shortcode manually).
|
142 |
+
* Remove: Don't load more assignment objects by scroll (Community users has to use the pagination list).
|
143 |
+
|
144 |
= 6.1.3 =
|
145 |
* Enhance: UI Compatibility with Wordpress >= 3.8.
|
146 |
* Deprecated: New Block Form Activate, Location Hook and Initial position fields.
|
views/blocks/block/public/js/jquery.block/jquery.block.js
CHANGED
@@ -93,8 +93,7 @@
|
|
93 |
*/
|
94 |
var defaultOptions = {
|
95 |
showObjectsPanel : true,
|
96 |
-
calculatePinPoint : 1
|
97 |
-
restoreRevision : {fields : ['code']}
|
98 |
};
|
99 |
|
100 |
/**
|
@@ -235,29 +234,6 @@
|
|
235 |
}
|
236 |
}
|
237 |
|
238 |
-
/**
|
239 |
-
*
|
240 |
-
*
|
241 |
-
*
|
242 |
-
*
|
243 |
-
*/
|
244 |
-
this._ondisplayrevisions = function() {
|
245 |
-
// Restore revision only when block is opened.
|
246 |
-
if (this.block.box.hasClass('closed')) {
|
247 |
-
return false;
|
248 |
-
}
|
249 |
-
// Initialize form request.
|
250 |
-
var revisionsFormParams = {
|
251 |
-
id : this.block.get('id'),
|
252 |
-
width : 300,
|
253 |
-
height : 250,
|
254 |
-
TB_iframe : true
|
255 |
-
};
|
256 |
-
var url = CJTBlocksPage.server.getRequestURL('block', 'get_revisions', revisionsFormParams);
|
257 |
-
tb_show(CJTJqueryBlockI18N.blockRevisionsDialogTitle, url);
|
258 |
-
return false;
|
259 |
-
}
|
260 |
-
|
261 |
/**
|
262 |
* Event handler for start editing block name.
|
263 |
*
|
@@ -616,18 +592,6 @@
|
|
616 |
this.toolbox = model.box.find('.block-toolbox').CJTToolBox({
|
617 |
context : this,
|
618 |
handlers : {
|
619 |
-
'templates-lookup' : {
|
620 |
-
type : 'Popup',
|
621 |
-
callback : this._onlookuptemplates,
|
622 |
-
params : {
|
623 |
-
fitToScreen : true, /* Custom to be used inside this._onpopupmenu() method */
|
624 |
-
_type : {
|
625 |
-
onPopup : this._onpopupmenu,
|
626 |
-
targetElement : '.templates-lookup',
|
627 |
-
setTargetPosition : false
|
628 |
-
}
|
629 |
-
}
|
630 |
-
},
|
631 |
'switch-editor-language' : {
|
632 |
type : 'Popup',
|
633 |
params : {
|
@@ -645,10 +609,8 @@
|
|
645 |
'editor-language-php' : {callback : this._onswitcheditorlang, params : {lang : 'php'}},
|
646 |
'state-switch' : {callback : this._onswitchflag, params : {flag : 'state'}},
|
647 |
'save' : {callback : this._onsavechanges, params : {enable : false}},
|
648 |
-
'revisions' : {callback : this._ondisplayrevisions},
|
649 |
'delete' : {callback : this._ondelete},
|
650 |
'location-switch' : {callback : this._onswitchflag, params : {flag : 'location'}},
|
651 |
-
'get-shortcode' : {callback : this._ongetshortcode},
|
652 |
'edit-name' : {callback : this._oneditname},
|
653 |
'info' : {callback : this._ongetinfo},
|
654 |
}
|
@@ -657,9 +619,6 @@
|
|
657 |
this._onswitcheditorlang(undefined, {lang : model.get('editorLang', 'css')});
|
658 |
// Register COMMAND-KEYS.
|
659 |
this.registerCommands();
|
660 |
-
// Switch Block state if required, if state is empty nothing will happen.
|
661 |
-
// Until now only 'restore' state is supported to prevent saving restored block.
|
662 |
-
this.switchState(this.features.state);
|
663 |
// Display block.
|
664 |
// !important: Blocks come from server response doesn't need this but the newly added blocks does.
|
665 |
// need sometime to be ready for display.
|
@@ -684,16 +643,6 @@
|
|
684 |
/** Add Our Ace Save, Full screen and Code-Auto-Completion commands */
|
685 |
editorCommands.addCommands(commands);
|
686 |
}
|
687 |
-
|
688 |
-
/**
|
689 |
-
*
|
690 |
-
*/
|
691 |
-
this.restoreRevision = function(revisionId, data) {
|
692 |
-
// Create new revision control action.
|
693 |
-
var revisionControl = new CJTBlockOptionalRevision(this, data, revisionId);
|
694 |
-
// Display the revision + enter revision mode.
|
695 |
-
revisionControl.display();
|
696 |
-
}
|
697 |
|
698 |
/**
|
699 |
* Change Block options.
|
@@ -703,26 +652,6 @@
|
|
703 |
*/
|
704 |
this.setOptions = function() {}
|
705 |
|
706 |
-
/*
|
707 |
-
*
|
708 |
-
*
|
709 |
-
*
|
710 |
-
*/
|
711 |
-
this.switchState = function(state) {
|
712 |
-
switch (state) {
|
713 |
-
case 'restore':
|
714 |
-
// Hide block toolbox.
|
715 |
-
this.toolbox.jToolbox.hide();
|
716 |
-
// Disable all fields.
|
717 |
-
this.enable(false);
|
718 |
-
// Change state
|
719 |
-
this.state = 'restore';
|
720 |
-
default:
|
721 |
-
// Nothing for now
|
722 |
-
break;
|
723 |
-
}
|
724 |
-
}
|
725 |
-
|
726 |
} // End class.
|
727 |
|
728 |
/**
|
93 |
*/
|
94 |
var defaultOptions = {
|
95 |
showObjectsPanel : true,
|
96 |
+
calculatePinPoint : 1
|
|
|
97 |
};
|
98 |
|
99 |
/**
|
234 |
}
|
235 |
}
|
236 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
/**
|
238 |
* Event handler for start editing block name.
|
239 |
*
|
592 |
this.toolbox = model.box.find('.block-toolbox').CJTToolBox({
|
593 |
context : this,
|
594 |
handlers : {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
595 |
'switch-editor-language' : {
|
596 |
type : 'Popup',
|
597 |
params : {
|
609 |
'editor-language-php' : {callback : this._onswitcheditorlang, params : {lang : 'php'}},
|
610 |
'state-switch' : {callback : this._onswitchflag, params : {flag : 'state'}},
|
611 |
'save' : {callback : this._onsavechanges, params : {enable : false}},
|
|
|
612 |
'delete' : {callback : this._ondelete},
|
613 |
'location-switch' : {callback : this._onswitchflag, params : {flag : 'location'}},
|
|
|
614 |
'edit-name' : {callback : this._oneditname},
|
615 |
'info' : {callback : this._ongetinfo},
|
616 |
}
|
619 |
this._onswitcheditorlang(undefined, {lang : model.get('editorLang', 'css')});
|
620 |
// Register COMMAND-KEYS.
|
621 |
this.registerCommands();
|
|
|
|
|
|
|
622 |
// Display block.
|
623 |
// !important: Blocks come from server response doesn't need this but the newly added blocks does.
|
624 |
// need sometime to be ready for display.
|
643 |
/** Add Our Ace Save, Full screen and Code-Auto-Completion commands */
|
644 |
editorCommands.addCommands(commands);
|
645 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
646 |
|
647 |
/**
|
648 |
* Change Block options.
|
652 |
*/
|
653 |
this.setOptions = function() {}
|
654 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
655 |
} // End class.
|
656 |
|
657 |
/**
|
views/blocks/block/tmpl/templates/toolbox.html.tmpl
CHANGED
@@ -17,7 +17,6 @@
|
|
17 |
</div>
|
18 |
|
19 |
<a href="#" class="cjt-tb-link cjttbl-edit-name" title="<?php echo cssJSToolbox::getText('Edit code block title. Click Save to take affect') ?>"></a>
|
20 |
-
<a href="#" class="cjt-tb-link cjttbl-revisions" title="<?php echo cssJSToolbox::getText('View and restore code block revisions') ?>"></a>
|
21 |
<a href="#" class="cjt-tb-link cjttbl-delete" title="<?php echo cssJSToolbox::getText('Delete code block') ?>"></a>
|
22 |
</div>
|
23 |
<div class="divider"></div>
|
17 |
</div>
|
18 |
|
19 |
<a href="#" class="cjt-tb-link cjttbl-edit-name" title="<?php echo cssJSToolbox::getText('Edit code block title. Click Save to take affect') ?>"></a>
|
|
|
20 |
<a href="#" class="cjt-tb-link cjttbl-delete" title="<?php echo cssJSToolbox::getText('Delete code block') ?>"></a>
|
21 |
</div>
|
22 |
<div class="divider"></div>
|
views/blocks/cjt-block/public/css/block.css
CHANGED
@@ -57,7 +57,7 @@ div.cjpageblock .objects-list-button > a.prog-colored {color: transparent !impor
|
|
57 |
height: 16px;
|
58 |
background-repeat: no-repeat;
|
59 |
display: inline-block;
|
60 |
-
margin-top:
|
61 |
position: relative;
|
62 |
left: 0px;
|
63 |
}
|
57 |
height: 16px;
|
58 |
background-repeat: no-repeat;
|
59 |
display: inline-block;
|
60 |
+
margin-top: -20px;
|
61 |
position: relative;
|
62 |
left: 0px;
|
63 |
}
|
views/blocks/cjt-block/public/js/jquery.assignpanel/jquery.assignpanel.js
CHANGED
@@ -82,32 +82,6 @@
|
|
82 |
ui.newContent.find('textarea').focus();
|
83 |
};
|
84 |
|
85 |
-
/**
|
86 |
-
* put your comment there...
|
87 |
-
*
|
88 |
-
* @param event
|
89 |
-
*/
|
90 |
-
var _ondetectlistscroll = function(event) {
|
91 |
-
// Initialize.
|
92 |
-
var list = this;
|
93 |
-
var jList = $(list);
|
94 |
-
// Don't load unless not all items has been loaded.
|
95 |
-
if (jList.data('itemsLoaded') === true) {
|
96 |
-
return;
|
97 |
-
}
|
98 |
-
// Prevent multiple requests at the same time.
|
99 |
-
var isLoading = jList.data('cjt_isObjectListLoading');
|
100 |
-
// Scroll value.
|
101 |
-
var scrollValue = list.scrollTop;
|
102 |
-
// The hidden zone!
|
103 |
-
var scrollZone = list.scrollHeight - jList.innerHeight();
|
104 |
-
// If the ScrollValue = ScrollZone
|
105 |
-
// then we need to load a new page.
|
106 |
-
if ((scrollValue == scrollZone) && (isLoading === false)) {
|
107 |
-
list.getCJTBlockAPOP(false);
|
108 |
-
}
|
109 |
-
};
|
110 |
-
|
111 |
/**
|
112 |
*
|
113 |
*
|
@@ -172,31 +146,6 @@
|
|
172 |
}
|
173 |
}
|
174 |
};
|
175 |
-
|
176 |
-
/**
|
177 |
-
* put your comment there...
|
178 |
-
*
|
179 |
-
* @param event
|
180 |
-
*
|
181 |
-
* @returns {Boolean}
|
182 |
-
*/
|
183 |
-
var _onselectchilds = function(event) {
|
184 |
-
// Initialize vars.
|
185 |
-
var overlay = $(event.target);
|
186 |
-
var checkbox = overlay.parent().find('.select-childs');
|
187 |
-
var state = checkbox.prop('checked') ? '' : 'checked';
|
188 |
-
// Work only if select-child checkbox is interactive!
|
189 |
-
if (checkbox.attr('disabled') != 'disabled') {
|
190 |
-
// Revert checkbox state.
|
191 |
-
checkbox.prop('checked', state);
|
192 |
-
// Clone state to parent checkbox.
|
193 |
-
checkbox.parent().find('label>input:checkbox').prop('checked', state).trigger('change');
|
194 |
-
//Clone state to all child checkboxes
|
195 |
-
checkbox.parent().find('.children input:checkbox').prop('checked', state).trigger('change');
|
196 |
-
}
|
197 |
-
// For link to behave inactive.
|
198 |
-
return false;
|
199 |
-
};
|
200 |
|
201 |
/**
|
202 |
* put your comment there...
|
@@ -327,12 +276,6 @@
|
|
327 |
}
|
328 |
// Create Child Components IF: NOT-IN-REVISION-MODE AND THE ITEM-HAS-CHILD.
|
329 |
if (!assignPanel.loadAssignedOnlyMode && item.hasChilds) {
|
330 |
-
// Add 'select childs' checkbox just before te title container element.
|
331 |
-
var link = $('<a href="#" class="select-childs-checkbox-overlay"></a>')
|
332 |
-
.click($.proxy(_onselectchilds, this))
|
333 |
-
.insertBefore(title);
|
334 |
-
// Overlay checkbox.
|
335 |
-
link.after('<input type="checkbox" class="select-childs">');
|
336 |
// Add child items list below the title container.
|
337 |
$('<ul class="children"></ul>')
|
338 |
.prop('id', ('objects-list-' + typeParams.type + '-' + mdlBlock.get('id') + '-' + item.id))
|
@@ -520,9 +463,6 @@
|
|
520 |
// List items.
|
521 |
return assignPanel.list_GetAPOP.apply(this, [initialize, 1]);
|
522 |
};
|
523 |
-
listElementNode._ondetectlistscroll = _ondetectlistscroll;
|
524 |
-
// Fetch objects from server with list scrolls event.
|
525 |
-
listElement.bind('scroll.cjt', listElementNode._ondetectlistscroll);
|
526 |
// Cache object-list-element reference for later use.
|
527 |
this.buttons[listParams['group']].push(objectListEle);
|
528 |
}, this)
|
82 |
ui.newContent.find('textarea').focus();
|
83 |
};
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
/**
|
86 |
*
|
87 |
*
|
146 |
}
|
147 |
}
|
148 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
|
150 |
/**
|
151 |
* put your comment there...
|
276 |
}
|
277 |
// Create Child Components IF: NOT-IN-REVISION-MODE AND THE ITEM-HAS-CHILD.
|
278 |
if (!assignPanel.loadAssignedOnlyMode && item.hasChilds) {
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
// Add child items list below the title container.
|
280 |
$('<ul class="children"></ul>')
|
281 |
.prop('id', ('objects-list-' + typeParams.type + '-' + mdlBlock.get('id') + '-' + item.id))
|
463 |
// List items.
|
464 |
return assignPanel.list_GetAPOP.apply(this, [initialize, 1]);
|
465 |
};
|
|
|
|
|
|
|
466 |
// Cache object-list-element reference for later use.
|
467 |
this.buttons[listParams['group']].push(objectListEle);
|
468 |
}, this)
|
views/blocks/manager/public/css/blocks.css
CHANGED
@@ -1,7 +1,9 @@
|
|
1 |
/** CSS & Javascript Toolkit - blocks page CSS **/
|
2 |
/* Wordpress Page */
|
3 |
.wrap { position: relative; }
|
4 |
-
.
|
|
|
|
|
5 |
#cjt-banner-bar-right {right: 0px;position: absolute;top: 2px;}
|
6 |
#cjt-banner-bar-right .cjt-banner-link {margin-bottom: 6px;}
|
7 |
|
@@ -37,7 +39,6 @@
|
|
37 |
margin-bottom: 20px;
|
38 |
padding: 4px 4px 4px 0px !important;
|
39 |
clear: both;
|
40 |
-
visibility: hidden;
|
41 |
border: solid #ccc;
|
42 |
border-width: 1px;
|
43 |
-moz-border-radius: 6px;
|
1 |
/** CSS & Javascript Toolkit - blocks page CSS **/
|
2 |
/* Wordpress Page */
|
3 |
.wrap { position: relative; }
|
4 |
+
a.headerlink, a.headerlink:hover, a.headerlink:visited{color: #A5581B; font-size: 16px;}
|
5 |
+
h2#cjt-title {display: inline-block;}
|
6 |
+
|
7 |
#cjt-banner-bar-right {right: 0px;position: absolute;top: 2px;}
|
8 |
#cjt-banner-bar-right .cjt-banner-link {margin-bottom: 6px;}
|
9 |
|
39 |
margin-bottom: 20px;
|
40 |
padding: 4px 4px 4px 0px !important;
|
41 |
clear: both;
|
|
|
42 |
border: solid #ccc;
|
43 |
border-width: 1px;
|
44 |
-moz-border-radius: 6px;
|
views/blocks/manager/public/js/blocks-page/blocks-page.js
CHANGED
@@ -174,41 +174,8 @@ var CJTBlocksPage;
|
|
174 |
}
|
175 |
);
|
176 |
return isEnabled;
|
177 |
-
},
|
178 |
-
|
179 |
-
/*
|
180 |
-
*
|
181 |
-
*
|
182 |
-
*
|
183 |
-
*/
|
184 |
-
switchState : function(state) {
|
185 |
-
var buttonsToHide;
|
186 |
-
switch (state) {
|
187 |
-
case 'restore':
|
188 |
-
// Hide Add New Block, Save all changes, location tools and state tools buttons.
|
189 |
-
buttonsToHide = ['save-changes', 'add-block', 'state-tools', 'location-tools'];
|
190 |
-
break;
|
191 |
-
default:
|
192 |
-
// Hide Restore & Cancel Restore buttons.
|
193 |
-
buttonsToHide = ['restore', 'cancel-restore'];
|
194 |
-
break;
|
195 |
-
}
|
196 |
-
// Hide buttons.
|
197 |
-
this.toolboxes.each(
|
198 |
-
// Get all toolboxes.
|
199 |
-
function(tbIndex, toolbox) {
|
200 |
-
// Hide all buttons for each toolbox.
|
201 |
-
$.each(buttonsToHide,
|
202 |
-
function(btnIndex, buttonName) {
|
203 |
-
var button = toolbox.CJTToolBox.buttons[buttonName];
|
204 |
-
button.jButton.css('display', 'none');
|
205 |
-
}
|
206 |
-
);
|
207 |
-
}
|
208 |
-
);
|
209 |
-
// Display Toolboxes.
|
210 |
-
this.css('visibility', 'visible');
|
211 |
}
|
|
|
212 |
},
|
213 |
|
214 |
/**
|
@@ -224,7 +191,6 @@ var CJTBlocksPage;
|
|
224 |
// Thick box parameters.
|
225 |
width : 450,
|
226 |
height: 230,
|
227 |
-
position : params.toolbox.position,
|
228 |
TB_iframe : true // Must be last one Thickbox removes this and later params.
|
229 |
};
|
230 |
var url = CJTBlocksPage.server.getRequestURL('blocksPage', 'get_view', requestData);
|
@@ -232,89 +198,6 @@ var CJTBlocksPage;
|
|
232 |
tb_show(CJTBlocksPageI18N.addNewBlockDialogTitle, url);
|
233 |
},
|
234 |
|
235 |
-
/**
|
236 |
-
* put your comment there...
|
237 |
-
*
|
238 |
-
*/
|
239 |
-
_oncancelrestore : function() {
|
240 |
-
window.location.href = window.location.href.replace(/&backupId=\d+/, '');
|
241 |
-
},
|
242 |
-
|
243 |
-
/**
|
244 |
-
*
|
245 |
-
*
|
246 |
-
*
|
247 |
-
*
|
248 |
-
*/
|
249 |
-
_ondeleteall : function() {
|
250 |
-
// Confimation message!
|
251 |
-
var blocksCount = CJTBlocksPage.blocks.getBlocks().length;
|
252 |
-
var confirmMessage = CJTBlocksPageI18N.commonDeleteMessage.replace('%d', blocksCount)
|
253 |
-
+ "\n\n"
|
254 |
-
+ CJTBlocksPage.blocks.toArray('name').join("\n")
|
255 |
-
+ "\n\n"
|
256 |
-
+ CJTBlocksPageI18N.confirmDeleteAll;
|
257 |
-
// Confirm deletion.
|
258 |
-
if (confirm(confirmMessage)) {
|
259 |
-
CJTBlocksPage.deleteBlocks(CJTBlocksPage.blocks.getBlocks());
|
260 |
-
}
|
261 |
-
},
|
262 |
-
|
263 |
-
/**
|
264 |
-
*
|
265 |
-
*
|
266 |
-
*
|
267 |
-
*
|
268 |
-
*/
|
269 |
-
_ondeleteempty : function() {
|
270 |
-
// initialize blocks.
|
271 |
-
var blocks = CJTBlocksPage.blocks.getBlocks();
|
272 |
-
var emptyBlocks = [];
|
273 |
-
// For every block check if there is code content.
|
274 |
-
blocks.each(
|
275 |
-
function(index, block) {
|
276 |
-
var code = block.CJTBlock.block.get('code');
|
277 |
-
if (code == '') {
|
278 |
-
emptyBlocks.push(this);
|
279 |
-
}
|
280 |
-
}
|
281 |
-
);
|
282 |
-
// If there is at least one empty block to delete just confirm
|
283 |
-
// otherwise show error!
|
284 |
-
if (emptyBlocks.length) {
|
285 |
-
// Confimation message!
|
286 |
-
var confirmMessage = CJTBlocksPageI18N.commonDeleteMessage.replace('%d', emptyBlocks.length)
|
287 |
-
+ "\n\n"
|
288 |
-
+ CJTBlocksPage.blocks.toArray('name', emptyBlocks).join("\n")
|
289 |
-
+ "\n\n"
|
290 |
-
+ CJTBlocksPageI18N.confirmDeleteEmpty;
|
291 |
-
if (confirm(confirmMessage)) {
|
292 |
-
CJTBlocksPage.deleteBlocks(emptyBlocks);
|
293 |
-
}
|
294 |
-
}
|
295 |
-
else {
|
296 |
-
alert(CJTBlocksPageI18N.noBlocksToDelete)
|
297 |
-
}
|
298 |
-
},
|
299 |
-
|
300 |
-
/**
|
301 |
-
*
|
302 |
-
*
|
303 |
-
*
|
304 |
-
*
|
305 |
-
*/
|
306 |
-
_onmanagebackups : function() {
|
307 |
-
// Server request.
|
308 |
-
var requestData = {
|
309 |
-
// Thick box parameters.
|
310 |
-
width : 480,
|
311 |
-
height: 400,
|
312 |
-
TB_iframe : true // Must be last one Thickbox removes this and later params.
|
313 |
-
};
|
314 |
-
var url = CJTBlocksPage.server.getRequestURL('blocksBackups', 'list', requestData);
|
315 |
-
tb_show(CJTBlocksPageI18N.manageBackupsDialogTitle, url);
|
316 |
-
},
|
317 |
-
|
318 |
/**
|
319 |
* put your comment there...
|
320 |
*
|
@@ -325,39 +208,6 @@ var CJTBlocksPage;
|
|
325 |
tb_show(CJTBlocksPageI18N.settingsFormTitle, settingsFormURL);
|
326 |
},
|
327 |
|
328 |
-
/**
|
329 |
-
* put your comment there...
|
330 |
-
*
|
331 |
-
*/
|
332 |
-
_onrestore : function() {
|
333 |
-
// Confirm restore.
|
334 |
-
var doRestore = confirm(CJTBlocksPageI18N.confirmRestoreBlocks);
|
335 |
-
if (doRestore) {
|
336 |
-
// Disable restore button for all toolboxes.
|
337 |
-
var ibCancelRestore = CJTBlocksPage.toolboxes.getIButton('cancel-restore', 'enable', [false]);
|
338 |
-
// SHow loading for restore buttons.
|
339 |
-
var ibRestoreLoader = CJTBlocksPage.toolboxes.getIButton('restore', 'loading', [true, false]);
|
340 |
-
// Send request to server.
|
341 |
-
var requestData = {backupId : CJTBlocksPage.isRestore()};
|
342 |
-
CJTBlocksPage.server.send('blocksBackups', 'restore', requestData)
|
343 |
-
.success(
|
344 |
-
function() {
|
345 |
-
// Refresh the page without backupId parameter.
|
346 |
-
CJTBlocksPage._oncancelrestore();
|
347 |
-
}
|
348 |
-
)
|
349 |
-
.error(
|
350 |
-
function() {
|
351 |
-
// Notify user error.
|
352 |
-
alert(CJTBlocksPageI18N.unableToRestoreBackup);
|
353 |
-
// Stop loading progress.
|
354 |
-
ibCancelRestore.dispatch([true]);
|
355 |
-
ibRestoreLoader.dispatch([false, true]);
|
356 |
-
}
|
357 |
-
);
|
358 |
-
}
|
359 |
-
},
|
360 |
-
|
361 |
/**
|
362 |
*
|
363 |
*
|
@@ -386,46 +236,6 @@ var CJTBlocksPage;
|
|
386 |
)
|
387 |
},
|
388 |
|
389 |
-
/**
|
390 |
-
*
|
391 |
-
*
|
392 |
-
*
|
393 |
-
*
|
394 |
-
*/
|
395 |
-
_onswitchflag : function(event, params) {
|
396 |
-
var multiOperationServer = CJTBlocksPage.server.multiOperation;
|
397 |
-
var eventName = 'switch' + params.flag.ucFirst();
|
398 |
-
// First queue blocks flag.
|
399 |
-
multiOperationServer.trigger(eventName, params)
|
400 |
-
// Second send all queued stack to sgerver.
|
401 |
-
.send('post');
|
402 |
-
},
|
403 |
-
|
404 |
-
/**
|
405 |
-
*
|
406 |
-
*
|
407 |
-
*
|
408 |
-
*
|
409 |
-
*/
|
410 |
-
_ontoggle : function(event, params) {
|
411 |
-
// Show or Hide blocks.
|
412 |
-
var blocks = CJTBlocksPage.blocks.getBlocks();
|
413 |
-
switch (params.state) {
|
414 |
-
case false:
|
415 |
-
// Close postboxes.
|
416 |
-
blocks.addClass('closed');
|
417 |
-
break;
|
418 |
-
case true:
|
419 |
-
// Open postboxes.
|
420 |
-
blocks.removeClass('closed');
|
421 |
-
// Notify postbox opened.
|
422 |
-
blocks.each(function() {this.CJTBlock._onpostboxopened();});
|
423 |
-
break;
|
424 |
-
}
|
425 |
-
// Save (batch) state.
|
426 |
-
postboxes.save_state('cjtoolbox');
|
427 |
-
},
|
428 |
-
|
429 |
/**
|
430 |
* put your comment there...
|
431 |
*
|
@@ -463,11 +273,8 @@ var CJTBlocksPage;
|
|
463 |
*
|
464 |
*
|
465 |
*/
|
466 |
-
addBlock : function(
|
467 |
var sortable = CJTBlocksPage.blocksContainer;
|
468 |
-
// New Block positions to jQuery methods mapping.
|
469 |
-
var positions = {top : 'prepend', bottom : 'append'};
|
470 |
-
var positionMethod = positions[position];
|
471 |
// Apply toggling: The only way to apply postboxes it via postboxes.add_postbox_toggles method.
|
472 |
// Method finding all .postbox elements and bind to click.
|
473 |
// Exists .postbox(s) will bind to click event twice and the result is
|
@@ -475,8 +282,8 @@ var CJTBlocksPage;
|
|
475 |
// to the newly added one.
|
476 |
var currentBlocks = CJTBlocksPage.blocks.getBlocks();
|
477 |
currentBlocks.removeClass('postbox').addClass('applying-postbox-to-new-block');
|
478 |
-
//
|
479 |
-
sortable
|
480 |
// Note: Only new block will be returned because its the only one with .postbox class.
|
481 |
var newAddedBlock = CJTBlocksPage.blocks.getBlocks().eq(0);
|
482 |
// Add block element.
|
@@ -485,7 +292,7 @@ var CJTBlocksPage;
|
|
485 |
// JUST USE THE CURRENT HASHED (SAVED ON SERVER) + ADDING THE NEW BLOCK!
|
486 |
var newBlockOrderName = CJTBlocksPage.blocks.getSortableName(blockId);
|
487 |
var order = $.merge([], sortable.data('cjtOrders'));
|
488 |
-
|
489 |
CJTBlocksPage.saveCustomOrder(order);
|
490 |
// If this is the first block hide the intro and show normal sortable.
|
491 |
if (!CJTBlocksPage.blocks.hasBlocks()) {
|
@@ -542,16 +349,6 @@ var CJTBlocksPage;
|
|
542 |
}
|
543 |
},
|
544 |
|
545 |
-
/*
|
546 |
-
*
|
547 |
-
*
|
548 |
-
*
|
549 |
-
*/
|
550 |
-
getStateName : function() {
|
551 |
-
var stateName = this.isRestore() ? 'restore' : '';
|
552 |
-
return stateName;
|
553 |
-
},
|
554 |
-
|
555 |
/*
|
556 |
*
|
557 |
*
|
@@ -572,39 +369,13 @@ var CJTBlocksPage;
|
|
572 |
// Initialize Toolboxes.
|
573 |
CJTBlocksPage.toolboxes.toolboxes = CJTBlocksPage.blocksForm.find('.cjt-toolbox-blocks').CJTToolBox({
|
574 |
handlers : {
|
575 |
-
'state-tools' : {
|
576 |
-
type : 'Popup',
|
577 |
-
params : {_type : {targetElement : '.state-tools'}}
|
578 |
-
},
|
579 |
-
'location-tools' : {
|
580 |
-
type : 'Popup',
|
581 |
-
params : {_type : {targetElement : '.location-tools'}}
|
582 |
-
},
|
583 |
-
'admin-tools' : {
|
584 |
-
type : 'Popup',
|
585 |
-
params : {_type : {targetElement : '.admin-tools'}}
|
586 |
-
},
|
587 |
'save-changes' : {callback : CJTBlocksPage._onsavechanges, params : {enable : false}},
|
588 |
'add-block' : {callback : CJTBlocksPage._onaddnew},
|
589 |
-
'restore' : {callback : CJTBlocksPage._onrestore},
|
590 |
-
'cancel-restore' : {callback : CJTBlocksPage._oncancelrestore},
|
591 |
-
'delete-all' : {callback : CJTBlocksPage._ondeleteall},
|
592 |
-
'delete-empty' : {callback : CJTBlocksPage._ondeleteempty},
|
593 |
-
'reset-order' : {callback : CJTBlocksPage._onresetorder},
|
594 |
-
'manage-backups' : {callback : CJTBlocksPage._onmanagebackups},
|
595 |
-
'footer-all' : {callback : CJTBlocksPage._onswitchflag, params : {flag : 'location', newValue : 'footer'}},
|
596 |
-
'header-all' : {callback : CJTBlocksPage._onswitchflag, params : {flag : 'location', newValue : 'header'}},
|
597 |
-
'activate-all' : {callback : CJTBlocksPage._onswitchflag, params : {flag : 'state', newValue : 'active'}},
|
598 |
-
'deactivate-all' : {callback : CJTBlocksPage._onswitchflag, params : {flag : 'state', newValue : 'inactive'}},
|
599 |
-
'revert-state' : {callback : CJTBlocksPage._onswitchflag, params : {flag : 'state'}},
|
600 |
-
'templates-manager' : {callback : CJTBlocksPage._onmanagetemplates},
|
601 |
'global-settings' : {callback : CJTBlocksPage._onmanagesettings},
|
602 |
-
'close-all' : {callback : CJTBlocksPage._ontoggle, params : {state: false}},
|
603 |
-
'open-all' : {callback : CJTBlocksPage._ontoggle, params : {state : true}}
|
604 |
}
|
605 |
});
|
606 |
// Activate blocks.
|
607 |
-
CJTBlocksPage.blocks.getBlocks().CJTBlock({
|
608 |
// Hide loading image. #cjt-blocks-loader will be used for other loading later.
|
609 |
CJTBlocksPage.loadingImage = CJTBlocksPage.blocksForm.find('#cjt-blocks-loader');
|
610 |
CJTBlocksPage.loadingImage.find('.loading-text').remove();
|
@@ -634,23 +405,6 @@ var CJTBlocksPage;
|
|
634 |
};
|
635 |
// When navigating away notify saving changes.
|
636 |
window.onbeforeunload = CJTBlocksPage._onunload;
|
637 |
-
// Switch blocks page state.
|
638 |
-
CJTBlocksPage.switchState(CJTBlocksPage.getStateName());
|
639 |
-
},
|
640 |
-
|
641 |
-
/*
|
642 |
-
*
|
643 |
-
*
|
644 |
-
*
|
645 |
-
*/
|
646 |
-
isRestore : function() {
|
647 |
-
// If there is backupId parameter then this is a restore state.
|
648 |
-
var regEx = /backupId=(\d+)/;
|
649 |
-
var backupId = false;
|
650 |
-
if (regEx.test(window.location.href)) {
|
651 |
-
backupId = parseInt(window.location.href.match(regEx)[1]);
|
652 |
-
}
|
653 |
-
return backupId;
|
654 |
},
|
655 |
|
656 |
/*
|
@@ -727,16 +481,6 @@ var CJTBlocksPage;
|
|
727 |
CJTBlocksPage.blocksContainer.data('cjtOrders', ordersArray);
|
728 |
}, this)
|
729 |
);
|
730 |
-
},
|
731 |
-
|
732 |
-
/*
|
733 |
-
*
|
734 |
-
*
|
735 |
-
*
|
736 |
-
*/
|
737 |
-
switchState : function(state) {
|
738 |
-
// For now only toolboxes need to switch state.
|
739 |
-
CJTBlocksPage.toolboxes.switchState(state);
|
740 |
}
|
741 |
|
742 |
} // End class.
|
174 |
}
|
175 |
);
|
176 |
return isEnabled;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
}
|
178 |
+
|
179 |
},
|
180 |
|
181 |
/**
|
191 |
// Thick box parameters.
|
192 |
width : 450,
|
193 |
height: 230,
|
|
|
194 |
TB_iframe : true // Must be last one Thickbox removes this and later params.
|
195 |
};
|
196 |
var url = CJTBlocksPage.server.getRequestURL('blocksPage', 'get_view', requestData);
|
198 |
tb_show(CJTBlocksPageI18N.addNewBlockDialogTitle, url);
|
199 |
},
|
200 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
/**
|
202 |
* put your comment there...
|
203 |
*
|
208 |
tb_show(CJTBlocksPageI18N.settingsFormTitle, settingsFormURL);
|
209 |
},
|
210 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
/**
|
212 |
*
|
213 |
*
|
236 |
)
|
237 |
},
|
238 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
/**
|
240 |
* put your comment there...
|
241 |
*
|
273 |
*
|
274 |
*
|
275 |
*/
|
276 |
+
addBlock : function(content) {
|
277 |
var sortable = CJTBlocksPage.blocksContainer;
|
|
|
|
|
|
|
278 |
// Apply toggling: The only way to apply postboxes it via postboxes.add_postbox_toggles method.
|
279 |
// Method finding all .postbox elements and bind to click.
|
280 |
// Exists .postbox(s) will bind to click event twice and the result is
|
282 |
// to the newly added one.
|
283 |
var currentBlocks = CJTBlocksPage.blocks.getBlocks();
|
284 |
currentBlocks.removeClass('postbox').addClass('applying-postbox-to-new-block');
|
285 |
+
// Append Block
|
286 |
+
sortable.append(content);
|
287 |
// Note: Only new block will be returned because its the only one with .postbox class.
|
288 |
var newAddedBlock = CJTBlocksPage.blocks.getBlocks().eq(0);
|
289 |
// Add block element.
|
292 |
// JUST USE THE CURRENT HASHED (SAVED ON SERVER) + ADDING THE NEW BLOCK!
|
293 |
var newBlockOrderName = CJTBlocksPage.blocks.getSortableName(blockId);
|
294 |
var order = $.merge([], sortable.data('cjtOrders'));
|
295 |
+
order.push(newBlockOrderName);
|
296 |
CJTBlocksPage.saveCustomOrder(order);
|
297 |
// If this is the first block hide the intro and show normal sortable.
|
298 |
if (!CJTBlocksPage.blocks.hasBlocks()) {
|
349 |
}
|
350 |
},
|
351 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
352 |
/*
|
353 |
*
|
354 |
*
|
369 |
// Initialize Toolboxes.
|
370 |
CJTBlocksPage.toolboxes.toolboxes = CJTBlocksPage.blocksForm.find('.cjt-toolbox-blocks').CJTToolBox({
|
371 |
handlers : {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
'save-changes' : {callback : CJTBlocksPage._onsavechanges, params : {enable : false}},
|
373 |
'add-block' : {callback : CJTBlocksPage._onaddnew},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
374 |
'global-settings' : {callback : CJTBlocksPage._onmanagesettings},
|
|
|
|
|
375 |
}
|
376 |
});
|
377 |
// Activate blocks.
|
378 |
+
CJTBlocksPage.blocks.getBlocks().CJTBlock({});
|
379 |
// Hide loading image. #cjt-blocks-loader will be used for other loading later.
|
380 |
CJTBlocksPage.loadingImage = CJTBlocksPage.blocksForm.find('#cjt-blocks-loader');
|
381 |
CJTBlocksPage.loadingImage.find('.loading-text').remove();
|
405 |
};
|
406 |
// When navigating away notify saving changes.
|
407 |
window.onbeforeunload = CJTBlocksPage._onunload;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
408 |
},
|
409 |
|
410 |
/*
|
481 |
CJTBlocksPage.blocksContainer.data('cjtOrders', ordersArray);
|
482 |
}, this)
|
483 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
484 |
}
|
485 |
|
486 |
} // End class.
|
views/blocks/manager/tmpl/blocks.html.tmpl
CHANGED
@@ -7,35 +7,12 @@
|
|
7 |
defined('ABSPATH') or die("Access denied");
|
8 |
?>
|
9 |
<div id="cjtoolbox-admin" class="wrap">
|
10 |
-
<
|
11 |
-
<
|
12 |
-
<div id="cjt-banner-bar-left" class="cjt-banner-bar ">
|
13 |
-
<span class="cjt-banner-link" style="margin-left: 47px;">
|
14 |
-
<?php echo cssJSToolbox::getText('Click for') ?>:
|
15 |
-
<a target="_blank" href="http://<?php echo cssJSToolbox::CJT_WEB_SITE_DOMAIN ?>/"><?php echo cssJSToolbox::getText('Pro Edition') ?></a>
|
16 |
-
</span> |
|
17 |
-
<span id="get-packages" class="cjt-banner-link">
|
18 |
-
<a target="_blank" href="http://<?php echo cssJSToolbox::CJT_WEB_SITE_DOMAIN ?>/category/scripts/"><?php echo cssJSToolbox::getText('Script Packages') ?></a>
|
19 |
-
<span id="get-packages-icon"></span>
|
20 |
-
</span> |
|
21 |
-
<?php echo cssJSToolbox::getText('FREE extension plugin') ?>:
|
22 |
-
<a target="_blank" href="http://<?php echo cssJSToolbox::CJT_WEB_SITE_DOMAIN ?>/code-auto-completion-free-download/">
|
23 |
-
<?php echo cssJSToolbox::getText('Code Auto Completion') ?>
|
24 |
-
</a>
|
25 |
-
</div>
|
26 |
<div id="cjt-banner-bar-right" class="cjt-banner-bar">
|
27 |
-
<
|
28 |
-
<?php echo cssJSToolbox::getText('Need Help?') ?>
|
29 |
-
<span class="cjt-banner-link">
|
30 |
-
<a target="_blank" href="http://<?php echo cssJSToolbox::CJT_WEB_SITE_DOMAIN ?>/cjt-free-user-manual-free-download/"><?php echo cssJSToolbox::getText('User Manual') ?></a>
|
31 |
-
</span>
|
32 |
-
|
|
33 |
-
<a target="_blank" href="http://wordpress.org/support/view/plugin-reviews/css-javascript-toolbox#postform">
|
34 |
-
<?php echo cssJSToolbox::getText('Rate & Review') ?>
|
35 |
-
<span id="review-icon"></span>
|
36 |
-
</a>
|
37 |
-
</span>
|
38 |
</div>
|
|
|
39 |
<form id="cjtoolbox-blocks-page-form" method="post">
|
40 |
<?php wp_nonce_field('cjtoolbox'); ?>
|
41 |
<?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?>
|
7 |
defined('ABSPATH') or die("Access denied");
|
8 |
?>
|
9 |
<div id="cjtoolbox-admin" class="wrap">
|
10 |
+
<h2 id="cjt-title"><?php echo cssJSToolbox::getText('CSS & Javascript Toolbox Free') ?></h2>
|
11 |
+
<a class="headerlink" target="_blank" href="http://<?php echo cssJSToolbox::CJT_WEB_SITE_DOMAIN ?>/"><?php echo cssJSToolbox::getText('Want Awesome Features? Click Here') ?></a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
<div id="cjt-banner-bar-right" class="cjt-banner-bar">
|
13 |
+
<a class="headerlink" target="_blank" href="http://<?php echo cssJSToolbox::CJT_WEB_SITE_DOMAIN ?>/"><?php echo cssJSToolbox::getText('Learn about CSS & Javascript Toolbox') ?></a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
</div>
|
15 |
+
|
16 |
<form id="cjtoolbox-blocks-page-form" method="post">
|
17 |
<?php wp_nonce_field('cjtoolbox'); ?>
|
18 |
<?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?>
|
views/blocks/manager/tmpl/toolbox.html.tmpl
CHANGED
@@ -2,39 +2,8 @@
|
|
2 |
<div class="icons-group left-bar">
|
3 |
<a class="cjt-tb-link l-127x23 textButton cjttbl-add-block" title="<?php echo cssJSToolbox::getText('Add new code block') ?>"><?php echo cssJSToolbox::getText('New Code Block') ?></a>
|
4 |
<a class="cjt-tb-link l-127x23 textButton cjttbl-save-changes" title="<?php echo cssJSToolbox::getText('Save changes to all code blocks') ?>"><?php echo cssJSToolbox::getText('Save All Changes') ?></a>
|
5 |
-
<a class="cjt-tb-link l-127x23 textButton cjttbl-cancel-restore" title="<?php echo cssJSToolbox::getText('Cancel backup restoring') ?>"><?php echo cssJSToolbox::getText('Cancel Restore') ?></a>
|
6 |
-
<a class="cjt-tb-link l-127x23 textButton cjttbl-restore" title="<?php echo cssJSToolbox::getText('Save restored Backup') ?>"><?php echo cssJSToolbox::getText('Restore') ?></a>
|
7 |
</div>
|
8 |
<div class="icons-group tools-menu">
|
9 |
-
<a class="cjt-tb-link cjttbl-state-tools" title="<?php echo cssJSToolbox::getText('Tools for block state (batch)') ?>"></a>
|
10 |
-
<div class="popup-menu state-tools" style="display:none">
|
11 |
-
<a class="cjt-tb-link cjt-tb-text-link cjttbl-activate-all" title="<?php echo cssJSToolbox::getText('Activate (turn on) all code blocks') ?>"><?php echo cssJSToolbox::getText('Activate All') ?></a>
|
12 |
-
<br />
|
13 |
-
<a class="cjt-tb-link cjt-tb-text-link cjttbl-deactivate-all" title="<?php echo cssJSToolbox::getText('Deactivate (turn off) all code blocks') ?>"><?php echo cssJSToolbox::getText('Deactivate All') ?></a>
|
14 |
-
<br />
|
15 |
-
<a class="cjt-tb-link cjt-tb-text-link cjttbl-revert-state" title="<?php echo cssJSToolbox::getText('Switch current state for all code blocks') ?>"><?php echo cssJSToolbox::getText('Revert State') ?></a>
|
16 |
-
</div>
|
17 |
-
|
18 |
-
<a class="cjt-tb-link cjttbl-location-tools" title="<?php echo cssJSToolbox::getText('Tools for location hook (batch)') ?>"></a>
|
19 |
-
<div class="popup-menu location-tools" style="display:none">
|
20 |
-
<a class="cjt-tb-link cjt-tb-text-link cjttbl-footer-all" title="<?php echo cssJSToolbox::getText('Set output location hook to footer for all code blocks') ?>"><?php echo cssJSToolbox::getText('Footer all') ?></a>
|
21 |
-
<br />
|
22 |
-
<a class="cjt-tb-link cjt-tb-text-link cjttbl-header-all" title="<?php echo cssJSToolbox::getText('Set output location hook to header for all code blocks') ?>"><?php echo cssJSToolbox::getText('Header all') ?></a>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<div class="divider"></div>
|
26 |
-
<a class="cjt-tb-link cjttbl-admin-tools" title="<?php echo cssJSToolbox::getText('Tools for block cleanup and backup') ?>"></a>
|
27 |
-
<div class="popup-menu admin-tools" style="display:none">
|
28 |
-
<a class="cjt-tb-link cjt-tb-text-link cjttbl-delete-all" title="<?php echo cssJSToolbox::getText('Delete all code blocks') ?>"><?php echo cssJSToolbox::getText('Delete all') ?></a>
|
29 |
-
<br />
|
30 |
-
<a class="cjt-tb-link cjt-tb-text-link cjttbl-delete-empty" title="<?php echo cssJSToolbox::getText('Delete only empty code blocks') ?>"><?php echo cssJSToolbox::getText('Delete Empty') ?></a>
|
31 |
-
<br />
|
32 |
-
<a class="cjt-tb-link cjt-tb-text-link cjttbl-manage-backups" title="<?php echo cssJSToolbox::getText('Backup Manager - Create, restore, or delete backups') ?>"><?php echo cssJSToolbox::getText('Backups') ?></a>
|
33 |
-
</div>
|
34 |
-
|
35 |
<a class="cjt-tb-link cjttbl-global-settings" title="<?php echo cssJSToolbox::getText('General plugin settings') ?>"></a>
|
36 |
-
<div class="divider"></div>
|
37 |
-
<a class="cjt-tb-link cjttbl-open-all" title="<?php echo cssJSToolbox::getText('Maximise all code blocks') ?>"></a>
|
38 |
-
<a class="cjt-tb-link cjttbl-close-all" title="<?php echo cssJSToolbox::getText('Minimise all code blocks') ?>"></a>
|
39 |
</div>
|
40 |
</div>
|
2 |
<div class="icons-group left-bar">
|
3 |
<a class="cjt-tb-link l-127x23 textButton cjttbl-add-block" title="<?php echo cssJSToolbox::getText('Add new code block') ?>"><?php echo cssJSToolbox::getText('New Code Block') ?></a>
|
4 |
<a class="cjt-tb-link l-127x23 textButton cjttbl-save-changes" title="<?php echo cssJSToolbox::getText('Save changes to all code blocks') ?>"><?php echo cssJSToolbox::getText('Save All Changes') ?></a>
|
|
|
|
|
5 |
</div>
|
6 |
<div class="icons-group tools-menu">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
<a class="cjt-tb-link cjttbl-global-settings" title="<?php echo cssJSToolbox::getText('General plugin settings') ?>"></a>
|
|
|
|
|
|
|
8 |
</div>
|
9 |
</div>
|
views/blocks/new/public/css/add-new-block.css
CHANGED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
.cjt-form ul li.last {
|
2 |
+
margin-top: 140px;
|
3 |
+
}
|
views/blocks/new/public/js/add-new-block/add-new-block.js
CHANGED
@@ -77,7 +77,7 @@
|
|
77 |
.success($.proxy(
|
78 |
function(response) {
|
79 |
// Add new block to blocks page.
|
80 |
-
newAddedBlock = CJTBlocksPage.addBlock(
|
81 |
// Close window.
|
82 |
window.parent.tb_remove();
|
83 |
}, this)
|
77 |
.success($.proxy(
|
78 |
function(response) {
|
79 |
// Add new block to blocks page.
|
80 |
+
newAddedBlock = CJTBlocksPage.addBlock(response.view)
|
81 |
// Close window.
|
82 |
window.parent.tb_remove();
|
83 |
}, this)
|
views/blocks/new/tmpl/default.html.tmpl
CHANGED
@@ -24,44 +24,6 @@ do_action('admin_print_styles');
|
|
24 |
<label for="cjt-new-block-name" title="<?php echo cssJSToolbox::getText('Name or title of code block (must be unique and cannot be left blank)') ?>"><?php echo cssJSToolbox::getText('Name') ?>*</label>
|
25 |
<input type="text" id="cjt-new-block-name" name="name" maxlength="50" value="" />
|
26 |
</li>
|
27 |
-
<li>
|
28 |
-
<label for="cjt-new-block-state" title="<?php echo cssJSToolbox::getText('Tick the checkbox to Activate (turn on) code block') ?>"><?php echo cssJSToolbox::getText('Activate') ?></label>
|
29 |
-
<input type="checkbox" id="cjt-new-block-state" name="state" value="active" checked="checked" />
|
30 |
-
</li>
|
31 |
-
<li>
|
32 |
-
<label for="cjt-new-block-hook" title="<?php echo cssJSToolbox::getText('Set location hook for code block output to: Header or Footer') ?>"><?php echo cssJSToolbox::getText('Location Hook') ?></label>
|
33 |
-
<select name="location" id="cjt-new-block-hook">
|
34 |
-
<?php
|
35 |
-
$locations = array(
|
36 |
-
'header' => cssJSToolbox::getText('Header'),
|
37 |
-
'footer' => cssJSToolbox::getText('Footer'),
|
38 |
-
);
|
39 |
-
foreach ($locations as $key => $displayName) :
|
40 |
-
?>
|
41 |
-
<option value="<?php echo $key ?>"><?php echo $displayName ?></option>
|
42 |
-
<?php
|
43 |
-
endforeach;
|
44 |
-
?>
|
45 |
-
</select>
|
46 |
-
</li>
|
47 |
-
<li>
|
48 |
-
<label for="cjt-new-block-position" title="<?php echo cssJSToolbox::getText('Set initial code block position to: First Block or Last Block') ?>"><?php echo cssJSToolbox::getText('Initial Block Position') ?></label>
|
49 |
-
<select name="position" id="cjt-new-block-position">
|
50 |
-
<?php
|
51 |
-
// Static locations.
|
52 |
-
$positions = array(
|
53 |
-
'top' => cssJSToolbox::getText('First Block'),
|
54 |
-
'bottom' => cssJSToolbox::getText('Last Block'),
|
55 |
-
);
|
56 |
-
// Display locations list.
|
57 |
-
foreach ($positions as $position => $displayName) :
|
58 |
-
?>
|
59 |
-
<option value="<?php echo $position ?>"<?php if ($this->position == $position) : ?> selected="selected"<?php endif; ?>><?php echo $displayName ?></option>
|
60 |
-
<?php
|
61 |
-
endforeach;
|
62 |
-
?>
|
63 |
-
</select>
|
64 |
-
</li>
|
65 |
<li class="last">
|
66 |
<input class="cjt-button cancel" type="button" value="<?php echo cssJSToolbox::getText('Cancel') ?>" />
|
67 |
<input class="cjt-button save" type="submit" name="submit" value="<?php echo cssJSToolbox::getText('Create') ?>" />
|
24 |
<label for="cjt-new-block-name" title="<?php echo cssJSToolbox::getText('Name or title of code block (must be unique and cannot be left blank)') ?>"><?php echo cssJSToolbox::getText('Name') ?>*</label>
|
25 |
<input type="text" id="cjt-new-block-name" name="name" maxlength="50" value="" />
|
26 |
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
<li class="last">
|
28 |
<input class="cjt-button cancel" type="button" value="<?php echo cssJSToolbox::getText('Cancel') ?>" />
|
29 |
<input class="cjt-button save" type="submit" name="submit" value="<?php echo cssJSToolbox::getText('Create') ?>" />
|
views/blocks/new/view.php
CHANGED
@@ -79,7 +79,8 @@ class CJTBlocksNewView extends CJTView {
|
|
79 |
self::useStyles(__CLASS__,
|
80 |
'thickbox',
|
81 |
'framework:css:{CJT-}error-dialog',
|
82 |
-
'framework:css:{CJT-}forms'
|
|
|
83 |
);
|
84 |
}
|
85 |
|
79 |
self::useStyles(__CLASS__,
|
80 |
'thickbox',
|
81 |
'framework:css:{CJT-}error-dialog',
|
82 |
+
'framework:css:{CJT-}forms',
|
83 |
+
'views:blocks:new:public:css:{CJT-}add-new-block'
|
84 |
);
|
85 |
}
|
86 |
|