Skip to content

Commit 2088a64

Browse files
committed
version 2.0.0 released
1 parent b550a93 commit 2088a64

12 files changed

+622
-253
lines changed

README.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: codeboxr, manchumahara
33
Tags: changelog,history,release,version,product log
44
Requires at least: 5.3
55
Tested up to: 6.7.1
6-
Stable tag: 1.1.10
6+
Stable tag: 2.0.0
77
Requires PHP: 7.4
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -73,6 +73,12 @@ This helps to write changes log for any digital products, projects releases. Any
7373

7474

7575
== Changelog ==
76+
= 2.0.0 =
77+
* [fixed] Fixed saving only single changelog from dashboard edit screen
78+
* [new] Added new feature to resync release no/id with dashboard edit screen display index(from top to bottom)
79+
* [new] Added new feature to resync release no/id with dashboard edit screen display index(bottom top to top)
80+
* [new] Added new feature to delete all releases with one single click from the dashboard edit screen
81+
7682
= 1.1.10 =
7783
* [fixed] Changelog added at top from edit screen save error fixed! [Sorry for the inconvenience]
7884

assets/css/cbxchangelog-listing.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/cbxchangelog-edit.js

Lines changed: 148 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
function cbxchangelog_copyStringToClipboard(str) {
55
// Create new element
6-
var el = document.createElement('textarea');
6+
var el = document.createElement('textarea');
77
// Set value (string to be copied)
88
el.value = str;
99
// Set non-editable to avoid focus and move outside of view
@@ -21,14 +21,14 @@
2121
$(document.body).ready(function ($) {
2222
var awn_options = {
2323
labels: {
24-
tip : cbxchangelog_edit.awn_options.tip,
25-
info : cbxchangelog_edit.awn_options.info,
26-
success : cbxchangelog_edit.awn_options.success,
27-
warning : cbxchangelog_edit.awn_options.warning,
28-
alert : cbxchangelog_edit.awn_options.alert,
29-
async : cbxchangelog_edit.awn_options.async,
30-
confirm : cbxchangelog_edit.awn_options.confirm,
31-
confirmOk : cbxchangelog_edit.awn_options.confirmOk,
24+
tip: cbxchangelog_edit.awn_options.tip,
25+
info: cbxchangelog_edit.awn_options.info,
26+
success: cbxchangelog_edit.awn_options.success,
27+
warning: cbxchangelog_edit.awn_options.warning,
28+
alert: cbxchangelog_edit.awn_options.alert,
29+
async: cbxchangelog_edit.awn_options.async,
30+
confirm: cbxchangelog_edit.awn_options.confirm,
31+
confirmOk: cbxchangelog_edit.awn_options.confirmOk,
3232
confirmCancel: cbxchangelog_edit.awn_options.confirmCancel
3333
}
3434
};
@@ -83,14 +83,14 @@
8383

8484
//sort sponsor item
8585
$element.sortable({
86-
group : 'feature_wrap_' + index,
87-
nested : false,
88-
vertical : true,
89-
horizontal : false,
90-
pullPlaceholder : true,
91-
handle : '.move-feature',
92-
placeholder : 'feature_placeholder',
93-
itemSelector : 'p.feature',
86+
group: 'feature_wrap_' + index,
87+
nested: false,
88+
vertical: true,
89+
horizontal: false,
90+
pullPlaceholder: true,
91+
handle: '.move-feature',
92+
placeholder: 'feature_placeholder',
93+
itemSelector: 'p.feature',
9494
containerSelector: $element,
9595
});
9696

@@ -101,11 +101,11 @@
101101
$('#cbxchangelog_metabox').on('click', 'a.cbxchangelog_add_release', function (e) {
102102
e.preventDefault();
103103

104-
var $this = $(this);
105-
var $position = $this.data('position');
104+
var $this = $(this);
105+
var $position = $this.data('position');
106106

107107
//var $counter = Number($this.attr('data-counter'));
108-
var $counter = Number($changelog_wrapper.data('counter'));
108+
var $counter = Number($changelog_wrapper.data('counter'));
109109

110110
//var rendered = Mustache.render($release_template, {increment: $counter, incrementplus: ($counter + 1)});
111111
var rendered = Mustache.render($release_template, {increment: ($counter - 1), incrementplus: ($counter)});
@@ -125,14 +125,14 @@
125125

126126
//sort sponsor item
127127
$element.sortable({
128-
group : 'feature_wrap_' + index,
129-
nested : false,
130-
vertical : true,
131-
horizontal : false,
132-
pullPlaceholder : true,
133-
handle : '.move-feature',
134-
placeholder : 'feature_placeholder',
135-
itemSelector : 'p.feature',
128+
group: 'feature_wrap_' + index,
129+
nested: false,
130+
vertical: true,
131+
horizontal: false,
132+
pullPlaceholder: true,
133+
handle: '.move-feature',
134+
placeholder: 'feature_placeholder',
135+
itemSelector: 'p.feature',
136136
containerSelector: $element,
137137
});
138138
});
@@ -142,8 +142,8 @@
142142
$changelog_wrapper.on('click', '.trash-release', function (e) {
143143
e.preventDefault();
144144

145-
var $this = $(this);
146-
var $post_id = Number($this.data('post-id'));
145+
var $this = $(this);
146+
var $post_id = Number($this.data('post-id'));
147147
var $relesae_id = Number($this.data('id'));
148148

149149
var notifier = new AWN(awn_options);
@@ -159,16 +159,16 @@
159159
});
160160
} else {
161161
$.ajax({
162-
type : 'post',
162+
type: 'post',
163163
dataType: 'json',
164-
url : cbxchangelog_edit.ajaxurl,
165-
data : {
166-
action : 'cbxchangelog_release_delete',
167-
security : cbxchangelog_edit.nonce,
168-
post_id : $post_id,
164+
url: cbxchangelog_edit.ajaxurl,
165+
data: {
166+
action: 'cbxchangelog_release_delete',
167+
security: cbxchangelog_edit.nonce,
168+
post_id: $post_id,
169169
release_id: $relesae_id
170170
},
171-
success : function (data, textStatus, XMLHttpRequest) {
171+
success: function (data, textStatus, XMLHttpRequest) {
172172

173173
if (data.success) {
174174
$this.closest('.cbxchangelog_release').fadeOut('slow', function () {
@@ -201,8 +201,8 @@
201201
$changelog_wrapper.on('click', '.add-feature', function (e) {
202202
e.preventDefault();
203203

204-
var $this = $(this);
205-
var $parent = $this.parents('.release-feature-wrap');
204+
var $this = $(this);
205+
var $parent = $this.parents('.release-feature-wrap');
206206
var $counter = $parent.data('boxincrement');
207207

208208
var rendered = Mustache.render($feature_template, {increment: $counter});
@@ -253,16 +253,117 @@
253253

254254
});
255255

256+
//resync release no/id with index (top to bottom or bottom to top)
257+
$('#cbxchangelog_toolbar_extras').on('click', 'a.cbxchangelog_resync_releases', function (e) {
258+
e.preventDefault();
259+
260+
var $this = $(this);
261+
var $post_id = Number($this.data('post-id'));
262+
var $dir = Number($this.data('dir'));
263+
var $confirm_desc = ($dir) ? cbxchangelog_edit.resync.confirm_desc : cbxchangelog_edit.resync.confirm_desc_alt;
264+
265+
var notifier = new AWN(awn_options);
266+
267+
var onCancel = () => {
268+
};
269+
270+
var onOk = () => {
271+
$this.prop('disabled', true);
272+
$this.addClass('running');
273+
274+
$.ajax({
275+
type: 'post',
276+
dataType: 'json',
277+
url: cbxchangelog_edit.ajaxurl,
278+
data: {
279+
action: 'cbxchangelog_release_resync',
280+
security: cbxchangelog_edit.nonce,
281+
post_id: $post_id,
282+
dir: $dir
283+
},
284+
success: function (data, textStatus, XMLHttpRequest) {
285+
if (data.success) {
286+
new AWN(awn_options).success(data.message);
287+
288+
location.reload();
289+
} else {
290+
new AWN(awn_options).alert(data.message);
291+
}
292+
}//end of success
293+
});//end of ajax
294+
};
295+
296+
notifier.confirm(
297+
$confirm_desc,
298+
onOk,
299+
onCancel,
300+
{
301+
labels: {
302+
confirm: cbxchangelog_edit.resync.confirm
303+
}
304+
}
305+
);
306+
});
307+
308+
//delete all releases
309+
$('#cbxchangelog_toolbar_extras').on('click', 'a.cbxchangelog_delete_releases', function (e) {
310+
e.preventDefault();
311+
312+
var $this = $(this);
313+
var $post_id = Number($this.data('post-id'));
314+
315+
var notifier = new AWN(awn_options);
316+
317+
var onCancel = () => {
318+
};
319+
320+
var onOk = () => {
321+
$this.prop('disabled', true);
322+
$this.addClass('running');
323+
324+
$.ajax({
325+
type: 'post',
326+
dataType: 'json',
327+
url: cbxchangelog_edit.ajaxurl,
328+
data: {
329+
action: 'cbxchangelog_delete_releases',
330+
security: cbxchangelog_edit.nonce,
331+
post_id: $post_id
332+
},
333+
success: function (data, textStatus, XMLHttpRequest) {
334+
if (data.success) {
335+
new AWN(awn_options).success(data.message);
336+
337+
location.reload();
338+
} else {
339+
new AWN(awn_options).alert(data.message);
340+
}
341+
}//end of success
342+
});//end of ajax
343+
};
344+
345+
notifier.confirm(
346+
cbxchangelog_edit.deleteconfirm_all_releases,
347+
onOk,
348+
onCancel,
349+
{
350+
labels: {
351+
confirm: cbxchangelog_edit.deleteconfirm
352+
}
353+
}
354+
);
355+
});
356+
256357
//sorting releases
257358
$changelog_wrapper.sortable({
258-
group : 'cbxchangelog_releases',
259-
nested : false,
260-
vertical : true,
261-
horizontal : false,
262-
pullPlaceholder : true,
263-
handle : '.move-release',
264-
placeholder : 'cbxchangelog_release_placeholder',
265-
itemSelector : 'div.cbxchangelog_release',
359+
group: 'cbxchangelog_releases',
360+
nested: false,
361+
vertical: true,
362+
horizontal: false,
363+
pullPlaceholder: true,
364+
handle: '.move-release',
365+
placeholder: 'cbxchangelog_release_placeholder',
366+
itemSelector: 'div.cbxchangelog_release',
266367
containerSelector: 'div#cbxchangelog_wrapper'
267368
});
268369

cbxchangelog.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Plugin Name: CBX Changelog
1717
* Plugin URI: http://codeboxr.com/product/cbx-changelog-for-wordpress/
1818
* Description: Easy change log manager for WordPress, use for any product post type or releases notes
19-
* Version: 1.1.10
19+
* Version: 2.0.0
2020
* Author: Codeboxr
2121
* Author URI: http://codeboxr.com
2222
* License: GPL-2.0+
@@ -32,7 +32,7 @@
3232

3333

3434
defined( 'CBXCHANGELOG_PLUGIN_NAME' ) or define( 'CBXCHANGELOG_PLUGIN_NAME', 'cbxchangelog' );
35-
defined( 'CBXCHANGELOG_PLUGIN_VERSION' ) or define( 'CBXCHANGELOG_PLUGIN_VERSION', '1.1.10' );
35+
defined( 'CBXCHANGELOG_PLUGIN_VERSION' ) or define( 'CBXCHANGELOG_PLUGIN_VERSION', '2.0.0' );
3636
defined( 'CBXCHANGELOG_ROOT_PATH' ) or define( 'CBXCHANGELOG_ROOT_PATH', plugin_dir_path( __FILE__ ) );
3737
defined( 'CBXCHANGELOG_ROOT_URL' ) or define( 'CBXCHANGELOG_ROOT_URL', plugin_dir_url( __FILE__ ) );
3838
defined( 'CBXCHANGELOG_BASE_NAME' ) or define( 'CBXCHANGELOG_BASE_NAME', plugin_basename( __FILE__ ) );

includes/CBXChangelog.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ private function define_admin_hooks() {
212212

213213
//remove a specific release from changelogs
214214
add_action( 'wp_ajax_cbxchangelog_release_delete', [ $plugin_admin, 'release_delete' ] );
215+
add_action( 'wp_ajax_cbxchangelog_release_resync', [ $plugin_admin, 'release_resync' ] );
216+
add_action( 'wp_ajax_cbxchangelog_delete_releases', [ $plugin_admin, 'delete_releases' ] );
215217
}//end method define_admin_hooks
216218

217219
/**

0 commit comments

Comments
 (0)