Simple Page Ordering - Version 2.2.2

Version Description

  • Column widths no longer change when dragging a row (partial props griffinjt)
  • Closed obscure XSS vulnerability related to Sort by Order link (props simon-waters)
  • Add German localization (props glueckpress).
Download this release

Release Info

Developer jakemgold
Plugin Icon 128x128 Simple Page Ordering
Version 2.2.2
Comparing to
See all releases

Code changes from version 2.2.1 to 2.2.2

localization/simple-page-ordering-de_DE.mo ADDED
Binary file
localization/simple-page-ordering-de_DE.po ADDED
@@ -0,0 +1,69 @@
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Simple Page Ordering v2.2.1\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2014-07-08 07:20:03+0000\n"
7
+ "Last-Translator: glueckpress <caspar@glueckpress.com>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Generator: CSL v1.x\n"
14
+ "X-Poedit-Language: German\n"
15
+ "X-Poedit-Country: GERMANY\n"
16
+ "X-Poedit-SourceCharset: utf-8\n"
17
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
18
+ "X-Poedit-Basepath: ../\n"
19
+ "X-Poedit-Bookmarks: \n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+ "X-Textdomain-Support: yes"
22
+
23
+ #. translators: plugin header field 'Name'
24
+ #: simple-page-ordering.php:0
25
+ #@ simple-page-ordering
26
+ msgid "Simple Page Ordering"
27
+ msgstr "Simple Page Ordering"
28
+
29
+ #. translators: plugin header field 'PluginURI'
30
+ #: simple-page-ordering.php:0
31
+ #@ simple-page-ordering
32
+ msgid "http://10up.com/plugins/simple-page-ordering-wordpress/"
33
+ msgstr "http://10up.com/plugins/simple-page-ordering-wordpress/"
34
+
35
+ #. translators: plugin header field 'Description'
36
+ #: simple-page-ordering.php:0
37
+ #: simple-page-ordering.php:303
38
+ #@ simple-page-ordering
39
+ msgid "Order your pages and hierarchical post types using drag and drop on the built in page list. For further instructions, open the \"Help\" tab on the Pages screen."
40
+ msgstr "Ordne deine Seite und hierarchischen Post Types mittels Drag&Drop in der Seitenliste von WordPress. Für weitere Anleitungen öffne den „Hilfe“-Tab in der Ansicht „Seiten“."
41
+
42
+ #. translators: plugin header field 'Author'
43
+ #: simple-page-ordering.php:0
44
+ #@ simple-page-ordering
45
+ msgid "Jake Goldman, 10up"
46
+ msgstr "Jake Goldman, 10up"
47
+
48
+ #. translators: plugin header field 'AuthorURI'
49
+ #: simple-page-ordering.php:0
50
+ #@ simple-page-ordering
51
+ msgid "http://10up.com"
52
+ msgstr "http://10up.com"
53
+
54
+ #. translators: plugin header field 'Version'
55
+ #: simple-page-ordering.php:0
56
+ #@ simple-page-ordering
57
+ msgid "2.2.1"
58
+ msgstr "2.2.1"
59
+
60
+ #: simple-page-ordering.php:98
61
+ #@ simple-page-ordering
62
+ msgid "To reposition an item, simply drag and drop the row by \"clicking and holding\" it anywhere (outside of the links and form controls) and moving it to its new position."
63
+ msgstr "Um ein Element neu zu positionieren, verschiebe die entsprechende Zeile einfach mit Drag&Drop, indem du sie anklickst und angeklickt hältst, sie dann zur neuen Position (außerhalb der Links und Formularelemente) bewegst und los lässt."
64
+
65
+ #: simple-page-ordering.php:278
66
+ #@ simple-page-ordering
67
+ msgid "Sort by Order"
68
+ msgstr "Nach Reihenfolge sortieren"
69
+
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: jakemgold, 10up, thinkoomph
3
Donate link: http://10up.com/plugins/simple-page-ordering-wordpress/
4
Tags: order, re-order, ordering, pages, page, manage, menu_order, hierarchical, ajax, drag-and-drop, admin
5
Requires at least: 3.8
6
- Tested up to: 3.9.1
7
- Stable tag: 2.2.1
8
9
Order your pages and other hierarchical post types with simple drag and drop right from the standard page list.
10
@@ -76,6 +76,11 @@ This feature is already built into WordPress natively, but a bit tucked away. If
76
77
78
== Changelog ==
79
80
= 2.2.1 =
81
* Bring back translations / text domain (yikes!)
3
Donate link: http://10up.com/plugins/simple-page-ordering-wordpress/
4
Tags: order, re-order, ordering, pages, page, manage, menu_order, hierarchical, ajax, drag-and-drop, admin
5
Requires at least: 3.8
6
+ Tested up to: 3.9.2
7
+ Stable tag: 2.2.2
8
9
Order your pages and other hierarchical post types with simple drag and drop right from the standard page list.
10
76
77
78
== Changelog ==
79
+
80
+ = 2.2.2 =
81
+ * Column widths no longer change when dragging a row (partial props griffinjt)
82
+ * Closed obscure XSS vulnerability related to Sort by Order link (props simon-waters)
83
+ * Add German localization (props glueckpress).
84
85
= 2.2.1 =
86
* Bring back translations / text domain (yikes!)
simple-page-ordering.css CHANGED
@@ -17,7 +17,7 @@
17
outline: 1px solid #e1e1e1;
18
}
19
.spo-updating-row .check-column {
20
- background: url('../../../wp-admin/images/spinner.gif') 11px 11px no-repeat;
21
}
22
@media print,
23
(-o-min-device-pixel-ratio: 5/4),
17
outline: 1px solid #e1e1e1;
18
}
19
.spo-updating-row .check-column {
20
+ background: url('../../../wp-admin/images/spinner.gif') 10px 9px no-repeat;
21
}
22
@media print,
23
(-o-min-device-pixel-ratio: 5/4),
simple-page-ordering.dev.js CHANGED
@@ -8,34 +8,39 @@ function update_simple_ordering_callback(response) {
8
9
var new_pos = changes.new_pos;
10
for ( var key in new_pos ) {
11
- if ( 'next' === key )
12
continue;
13
14
var inline_key = document.getElementById('inline_' + key);
15
if ( null !== inline_key && new_pos.hasOwnProperty(key) ) {
16
var dom_menu_order = inline_key.querySelector('.menu_order');
17
18
if ( undefined !== new_pos[key]['menu_order'] ) {
19
- if ( null !== dom_menu_order )
20
dom_menu_order.innerHTML = new_pos[key]['menu_order'];
21
22
var dom_post_parent = inline_key.querySelector('.post_parent');
23
- if ( null !== dom_post_parent )
24
dom_post_parent.innerHTML = new_pos[key]['post_parent'];
25
26
var post_title = null;
27
var dom_post_title = inline_key.querySelector('.post_title');
28
- if ( null !== dom_post_title )
29
post_title = dom_post_title.innerHTML;
30
31
var dashes = 0;
32
- while (dashes < new_pos[key]['depth']) {
33
post_title = '&mdash; ' + post_title;
34
dashes++;
35
}
36
var dom_row_title = inline_key.parentNode.querySelector('.row-title');
37
- if ( null !== dom_row_title && null !== post_title )
38
dom_row_title.innerHTML = post_title;
39
} else if ( null !== dom_menu_order ) {
40
dom_menu_order.innerHTML = new_pos[key];
41
}
@@ -52,12 +57,12 @@ function update_simple_ordering_callback(response) {
52
excluded: changes.next['excluded']
53
}, update_simple_ordering_callback );
54
} else {
55
- jQuery(document.querySelector('.spo-updating-row')).removeClass('spo-updating-row');
56
sortable_post_table.removeClass('spo-updating').sortable('enable');
57
}
58
}
59
60
- var sortable_post_table = jQuery( document.querySelector(".wp-list-table tbody") );
61
sortable_post_table.sortable({
62
items: '> tr',
63
cursor: 'move',
@@ -73,7 +78,19 @@ sortable_post_table.sortable({
73
}
74
ui.placeholder.height(ui.item.height());
75
},
76
- update: function(event, ui) {
77
sortable_post_table.sortable('disable').addClass('spo-updating');
78
ui.item.addClass('spo-updating-row');
79
@@ -98,12 +115,11 @@ sortable_post_table.sortable({
98
var table_rows = document.querySelectorAll('tr.iedit'),
99
table_row_count = table_rows.length;
100
while( table_row_count-- ) {
101
- if ( table_row_count%2 == 0 ) {
102
- jQuery( table_rows[table_row_count]).addClass('alternate');
103
} else {
104
- jQuery( table_rows[table_row_count]).removeClass('alternate');
105
}
106
}
107
- // fix quick edit
108
}
109
});
8
9
var new_pos = changes.new_pos;
10
for ( var key in new_pos ) {
11
+ if ( 'next' === key ) {
12
continue;
13
+ }
14
15
var inline_key = document.getElementById('inline_' + key);
16
if ( null !== inline_key && new_pos.hasOwnProperty(key) ) {
17
var dom_menu_order = inline_key.querySelector('.menu_order');
18
19
if ( undefined !== new_pos[key]['menu_order'] ) {
20
+ if ( null !== dom_menu_order ) {
21
dom_menu_order.innerHTML = new_pos[key]['menu_order'];
22
+ }
23
24
var dom_post_parent = inline_key.querySelector('.post_parent');
25
+ if ( null !== dom_post_parent ) {
26
dom_post_parent.innerHTML = new_pos[key]['post_parent'];
27
+ }
28
29
var post_title = null;
30
var dom_post_title = inline_key.querySelector('.post_title');
31
+ if ( null !== dom_post_title ) {
32
post_title = dom_post_title.innerHTML;
33
+ }
34
35
var dashes = 0;
36
+ while ( dashes < new_pos[key]['depth'] ) {
37
post_title = '&mdash; ' + post_title;
38
dashes++;
39
}
40
var dom_row_title = inline_key.parentNode.querySelector('.row-title');
41
+ if ( null !== dom_row_title && null !== post_title ) {
42
dom_row_title.innerHTML = post_title;
43
+ }
44
} else if ( null !== dom_menu_order ) {
45
dom_menu_order.innerHTML = new_pos[key];
46
}
57
excluded: changes.next['excluded']
58
}, update_simple_ordering_callback );
59
} else {
60
+ jQuery('.spo-updating-row').removeClass('spo-updating-row');
61
sortable_post_table.removeClass('spo-updating').sortable('enable');
62
}
63
}
64
65
+ var sortable_post_table = jQuery(".wp-list-table tbody");
66
sortable_post_table.sortable({
67
items: '> tr',
68
cursor: 'move',
78
}
79
ui.placeholder.height(ui.item.height());
80
},
81
+ helper: function(e, ui) {
82
+ var children = ui.children();
83
+ for ( var i=0; i<children.length; i++ ) {
84
+ var selector = jQuery(children[i]);
85
+ selector.width( selector.width() );
86
+ };
87
+ return ui;
88
+ },
89
+ stop: function(e, ui) {
90
+ // remove fixed widths
91
+ ui.item.children().css('width','');
92
+ },
93
+ update: function(e, ui) {
94
sortable_post_table.sortable('disable').addClass('spo-updating');
95
ui.item.addClass('spo-updating-row');
96
115
var table_rows = document.querySelectorAll('tr.iedit'),
116
table_row_count = table_rows.length;
117
while( table_row_count-- ) {
118
+ if ( 0 === table_row_count%2 ) {
119
+ jQuery(table_rows[table_row_count]).addClass('alternate');
120
} else {
121
+ jQuery(table_rows[table_row_count]).removeClass('alternate');
122
}
123
}
124
}
125
});
simple-page-ordering.js CHANGED
@@ -1 +1 @@
1
- function update_simple_ordering_callback(e){if("children"===e){window.location.reload();return}var t=jQuery.parseJSON(e);var n=t.new_pos;for(var r in n){if("next"===r)continue;var i=document.getElementById("inline_"+r);if(null!==i&&n.hasOwnProperty(r)){var s=i.querySelector(".menu_order");if(undefined!==n[r]["menu_order"]){if(null!==s)s.innerHTML=n[r]["menu_order"];var o=i.querySelector(".post_parent");if(null!==o)o.innerHTML=n[r]["post_parent"];var u=null;var a=i.querySelector(".post_title");if(null!==a)u=a.innerHTML;var f=0;while(f<n[r]["depth"]){u="&mdash; "+u;f++}var l=i.parentNode.querySelector(".row-title");if(null!==l&&null!==u)l.innerHTML=u}else if(null!==s){s.innerHTML=n[r]}}}if(t.next){jQuery.post(ajaxurl,{action:"simple_page_ordering",id:t.next["id"],previd:t.next["previd"],nextid:t.next["nextid"],start:t.next["start"],excluded:t.next["excluded"]},update_simple_ordering_callback)}else{jQuery(document.querySelector(".spo-updating-row")).removeClass("spo-updating-row");sortable_post_table.removeClass("spo-updating").sortable("enable")}}var sortable_post_table=jQuery(document.querySelector(".wp-list-table tbody"));sortable_post_table.sortable({items:"> tr",cursor:"move",axis:"y",containment:"table.widefat",cancel:".inline-edit-row",distance:2,opacity:.8,tolerance:"pointer",start:function(e,t){if(typeof inlineEditPost!=="undefined"){inlineEditPost.revert()}t.placeholder.height(t.item.height())},update:function(e,t){sortable_post_table.sortable("disable").addClass("spo-updating");t.item.addClass("spo-updating-row");var n=t.item[0].id.substr(5);var r=false;var i=t.item.prev();if(i.length>0){r=i.attr("id").substr(5)}var s=false;var o=t.item.next();if(o.length>0){s=o.attr("id").substr(5)}jQuery.post(ajaxurl,{action:"simple_page_ordering",id:n,previd:r,nextid:s},update_simple_ordering_callback);var u=document.querySelectorAll("tr.iedit"),a=u.length;while(a--){if(a%2==0){jQuery(u[a]).addClass("alternate")}else{jQuery(u[a]).removeClass("alternate")}}}})
1
+ function update_simple_ordering_callback(e){if("children"===e){window.location.reload();return}var t=jQuery.parseJSON(e);var n=t.new_pos;for(var r in n){if("next"===r){continue}var i=document.getElementById("inline_"+r);if(null!==i&&n.hasOwnProperty(r)){var s=i.querySelector(".menu_order");if(undefined!==n[r]["menu_order"]){if(null!==s){s.innerHTML=n[r]["menu_order"]}var o=i.querySelector(".post_parent");if(null!==o){o.innerHTML=n[r]["post_parent"]}var u=null;var a=i.querySelector(".post_title");if(null!==a){u=a.innerHTML}var f=0;while(f<n[r]["depth"]){u="&mdash; "+u;f++}var l=i.parentNode.querySelector(".row-title");if(null!==l&&null!==u){l.innerHTML=u}}else if(null!==s){s.innerHTML=n[r]}}}if(t.next){jQuery.post(ajaxurl,{action:"simple_page_ordering",id:t.next["id"],previd:t.next["previd"],nextid:t.next["nextid"],start:t.next["start"],excluded:t.next["excluded"]},update_simple_ordering_callback)}else{jQuery(".spo-updating-row").removeClass("spo-updating-row");sortable_post_table.removeClass("spo-updating").sortable("enable")}}var sortable_post_table=jQuery(".wp-list-table tbody");sortable_post_table.sortable({items:"> tr",cursor:"move",axis:"y",containment:"table.widefat",cancel:".inline-edit-row",distance:2,opacity:.8,tolerance:"pointer",start:function(e,t){if(typeof inlineEditPost!=="undefined"){inlineEditPost.revert()}t.placeholder.height(t.item.height())},helper:function(e,t){var n=t.children();for(var r=0;r<n.length;r++){var i=jQuery(n[r]);i.width(i.width())}return t},stop:function(e,t){t.item.children().css("width","")},update:function(e,t){sortable_post_table.sortable("disable").addClass("spo-updating");t.item.addClass("spo-updating-row");var n=t.item[0].id.substr(5);var r=false;var i=t.item.prev();if(i.length>0){r=i.attr("id").substr(5)}var s=false;var o=t.item.next();if(o.length>0){s=o.attr("id").substr(5)}jQuery.post(ajaxurl,{action:"simple_page_ordering",id:n,previd:r,nextid:s},update_simple_ordering_callback);var u=document.querySelectorAll("tr.iedit"),a=u.length;while(a--){if(0===a%2){jQuery(u[a]).addClass("alternate")}else{jQuery(u[a]).removeClass("alternate")}}}})
simple-page-ordering.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: Simple Page Ordering
4
Plugin URI: http://10up.com/plugins/simple-page-ordering-wordpress/
5
Description: Order your pages and hierarchical post types using drag and drop on the built in page list. For further instructions, open the "Help" tab on the Pages screen.
6
- Version: 2.2.1
7
Author: Jake Goldman, 10up
8
Author URI: http://10up.com
9
License: GPLv2 or later
@@ -256,8 +256,9 @@ class Simple_Page_Ordering {
256
'update_post_meta_cache' => false,
257
));
258
259
- if ( ! empty( $children ) )
260
die( 'children' );
261
}
262
263
$return_data->new_pos = $new_pos;
@@ -273,7 +274,7 @@ class Simple_Page_Ordering {
273
*/
274
public static function sort_by_order_link( $views ) {
275
$class = ( get_query_var('orderby') == 'menu_order title' ) ? 'current' : '';
276
- $query_string = remove_query_arg(array( 'orderby', 'order' ));
277
$query_string = add_query_arg( 'orderby', urlencode('menu_order title'), $query_string );
278
$views['byorder'] = sprintf('<a href="%s" class="%s">%s</a>', $query_string, $class, __("Sort by Order", 'simple-page-ordering'));
279
3
Plugin Name: Simple Page Ordering
4
Plugin URI: http://10up.com/plugins/simple-page-ordering-wordpress/
5
Description: Order your pages and hierarchical post types using drag and drop on the built in page list. For further instructions, open the "Help" tab on the Pages screen.
6
+ Version: 2.2.2
7
Author: Jake Goldman, 10up
8
Author URI: http://10up.com
9
License: GPLv2 or later
256
'update_post_meta_cache' => false,
257
));
258
259
+ if ( ! empty( $children ) ) {
260
die( 'children' );
261
+ }
262
}
263
264
$return_data->new_pos = $new_pos;
274
*/
275
public static function sort_by_order_link( $views ) {
276
$class = ( get_query_var('orderby') == 'menu_order title' ) ? 'current' : '';
277
+ $query_string = esc_url( remove_query_arg(array( 'orderby', 'order' )) );
278
$query_string = add_query_arg( 'orderby', urlencode('menu_order title'), $query_string );
279
$views['byorder'] = sprintf('<a href="%s" class="%s">%s</a>', $query_string, $class, __("Sort by Order", 'simple-page-ordering'));
280