diff --git a/README.txt b/README.txt
index 2007f0a..aa64469 100644
--- a/README.txt
+++ b/README.txt
@@ -1,8 +1,8 @@
=== pageMash > pageManagement ===
Contributors: JoelStarnes
Tags: order pages, ajax, re-order, drag-and-drop, admin, manage, page, pages, sidebar, header, hide,
-Requires at least: 2.1
-Tested up to: 2.5
+Requires at least: 2.0
+Tested up to: 2.4-bleeding
Stable tag: 1.0.4
Organise page order and manage page structure with this simple drag-and-drop Ajax interface.
@@ -38,7 +38,7 @@ The code here is very simple and flexible, for more information look up `wp_list
If you have any questions or comments, please drop me an email: http://joelstarnes.co.uk/contact
= Do I need any special code in my template =
-No. You no longer need to add the pageMash parameter as you did with the previous versions [<1.0.2]. You can leave the code in as it will do no harm, but it's good to keep your template clean of unnecessary code.
+No. You no longer need to add the pageMash parameter as you did with the previous versions [<1.0.2]. You can leave the code in as it will do no harm, but it's a good idea to keep your template clean of unnecessary code.
== Screenshots ==
@@ -68,7 +68,6 @@ No. You no longer need to add the pageMash parameter as you did with the previou
1.0.4 > Removed shorthand PHP and updated CSS and JS headers to admin_print_scripts hook.
-
== Localization ==
Currently only available in english.
\ No newline at end of file
diff --git a/inlineEdit.v1.2.js b/inlineEdit.v1.2.js
new file mode 100644
index 0000000..de79d35
--- /dev/null
+++ b/inlineEdit.v1.2.js
@@ -0,0 +1,47 @@
+var inlineEdit = new Class({
+ getOptions: function(){
+ return {
+ onComplete: function(el,oldContent,newContent){
+ },
+ type: 'input'
+ };
+ },
+ initialize: function(element,options){
+ this.setOptions(this.getOptions(), options);
+ if(!element.innerHTML.toLowerCase().match('<'+this.options.type)){
+ this.editting = element;
+ this.oldContent = element.innerHTML;
+ var content = this.oldContent.trim().replace(new RegExp("
", "gi"), "\n");
+ this.inputBox = new Element(this.options.type).setProperty('value',content).setStyles('margin:0;background:transparent;width:99.5%;font-size:100%;border:0;');
+ if(!this.inputBox.value){this.inputBox.setHTML(content)}
+ this.editting.setHTML('');
+ this.inputBox.injectInside(this.editting);
+ (function(){this.inputBox.focus()}.bind(this)).delay(300);
+ this.inputBox.addEvent('change',this.onSave.bind(this));
+ this.inputBox.addEvent('blur',this.onSave.bind(this));
+ this.inputBox.addEvent('keyup',this.onKeyUp.bindWithEvent(this));
+ this.fireEvent('onStart', [this.editting]);
+ }
+ },
+ onKeyUp: function(e){
+ if("enter" == e.key)
+ {
+ this.onSave();
+ }
+ },
+ onSave: function(){
+ this.inputBox.removeEvents();
+ this.newContent = this.inputBox.value.trim().replace(new RegExp("\n", "gi"), "
");
+ this.editting.setHTML(this.newContent);
+ this.fireEvent('onComplete', [this.editting,this.oldContent,this.newContent]);
+ }
+});
+
+Element.extend({
+ inlineEdit: function(options) {
+ return new inlineEdit(this, options);
+ }
+});
+
+inlineEdit.implement(new Events);
+inlineEdit.implement(new Options);
diff --git a/nested.js b/nested.js
index 8879786..64a5423 100644
--- a/nested.js
+++ b/nested.js
@@ -231,10 +231,11 @@ var Nested = new Class({
$$(listEl.childNodes).each(function(node, i) {
kids = $E('ul', node); /* set 'this.options.parentTag' straight to 'ul' to avoid safari bug */
serial[i] = {
- id: node.id,
- hide: (node.hasClass('remove')) ? 'exclude' : "",
- children: (kids) ? this.serialize(kids) : []
+ id: node.id
};
+ if (node.hasClass('remove')) serial[i].hide = true;
+ if (node.hasClass('renamed')) serial[i].renamed = $E('span.title', node).innerHTML;
+ if (kids) serial[i].children = this.serialize(kids);
}.bind(this));
return serial;
},
diff --git a/pagemash-css.php b/pagemash-css.php
new file mode 100644
index 0000000..e056de6
--- /dev/null
+++ b/pagemash-css.php
@@ -0,0 +1,91 @@
+
+/* __ __ _
+ WordPress Plugin | \/ | | |
+ _ __ __ _ __ _ ___| \ / | __ _ ___| |__
+ | '_ \ / _` |/ _` |/ _ \ |\/| |/ _` / __| '_ \
+ | |_) | (_| | (_| | __/ | | | (_| \__ \ | | |
+ | .__/ \__,_|\__, |\___|_| |_|\__,_|___/_| |_|
+ | | __/ | Author: Joel Starnes
+ |_| |___/ URL: pagemash.joelstarnes.co.uk
+
+ >>CSS styling for pageMash Admin
+*/
+
+
+
+body.wp-admin div#wpwrap div#wpcontent ul#pageMash_pages {
+ margin:0 0 0 0;
+ list-style:none;
+}
+ul#pageMash_pages li.collapsed ul { display:none; }
+ul#pageMash_pages li.children {
+ background-image: url('collapse.png');
+}
+ul#pageMash_pages li.collapsed.children {
+ background-image: url('expand.png');
+}
+ul#pageMash_pages li {
+ display:block;
+ margin:2px 0 0 0;
+ border-bottom:1px solid #aaa; border-right:1px solid #aaa; border-top:1px solid #ccc; border-left:1px solid #ccc;
+ padding:4px 6px 4px 24px;
+ background:#F1F1F1 url('page.png') no-repeat 4px 4px;
+ list-style-type:none;
+}
+ul#pageMash_pages li span.title { font-weight: bold; }
+ul#pageMash_pages li.collapsed.children span.title { text-decoration: underline; }
+ul#pageMash_pages li.collapsed.children li span.title { text-decoration: none; }
+#update_status {
+ font-weight:bold;
+ display:block;
+ border:2px solid #AC604C;
+ background-color: #DDA37A;
+ padding: 2px 6px;
+}
+ul#pageMash_pages li.remove {
+ color:grey;
+ border-style:dashed;
+ border-color:#aaa;
+ opacity:.5;
+ filter:alpha(opacity=50); zoom:1; /* ie hack[has layout] for opacity */
+}
+ul#pageMash_pages li.remove a { color:grey; }
+ul#pageMash_pages li span.pageMash_box {
+ font-weight:normal;
+ font-size: 1em;
+ line-height: 110%;
+ border:1px solid #bbb;
+ background-color: #eee;
+ padding: 0px 3px;
+ margin: 0;
+ opacity:.5;
+ filter:alpha(opacity=50); zoom:1; /* ie hack[has layout] for opacity */
+}
+ul#pageMash_pages li .pageMash_box:hover {
+ opacity:1;
+ filter:alpha(opacity=100); zoom:1; /* ie hack[has layout] for opacity */
+}
+ul#pageMash_pages li .pageMash_box .pageMash_pageFunctions { display:none; }
+ul#pageMash_pages li .pageMash_box:hover .more { display:none; }
+ul#pageMash_pages li .pageMash_box:hover .pageMash_pageFunctions { display:inline; }
+ul#pageMash_pages li .pageMash_box a { border:0; }
+ul#pageMash_pages li.renaming>.pageMash_box { display:none; }
+ul#pageMash_pages li.renaming>span.title {
+ border:1px solid #aaa;
+ background-color: #ccc;
+}
+ul#pageMash_pages li.renaming li span.title input {
+ font-weight:bold;
+}
+
+#pageMash_code {display:block; border:solid 3px #858EF4; background-color:#211E1E; padding:7px; margin:0px;}
+#pageMash_code .white{color:#DADADA;}
+#pageMash_code .purple{color:#9B2E4D; font-weight:bold;}
+#pageMash_code .green{color:#00FF00;}
+#pageMash_code .blue{color:#858EF4;}
+#pageMash_code .yellow{color:#C1C144;}
+#pageMash_code .orange{color:#EC9E00;}
\ No newline at end of file
diff --git a/pagemash-js.php b/pagemash-js.php
new file mode 100644
index 0000000..c6c2de4
--- /dev/null
+++ b/pagemash-js.php
@@ -0,0 +1,194 @@
+
+/* __ __ _
+ WordPress Plugin | \/ | | |
+ _ __ __ _ __ _ ___| \ / | __ _ ___| |__
+ | '_ \ / _` |/ _` |/ _ \ |\/| |/ _` / __| '_ \
+ | |_) | (_| | (_| | __/ | | | (_| \__ \ | | |
+ | .__/ \__,_|\__, |\___|_| |_|\__,_|___/_| |_|
+ | | __/ | Author: Joel Starnes
+ |_| |___/ URL: pagemash.joelstarnes.co.uk
+
+ >>Main javascript include
+*/
+
+window.addEvent('domready', function(){
+ // When logging debug messages with console.warn
+ // if user doesn't have Firebug, write them to the DOM instead
+ if (typeof console == "undefined") {
+ // Create an unordered list to display warning messages
+ var logsOutput = document.createElement('ul');
+ $("debug_list").appendChild(logsOutput);
+
+ // Define console.warn() function
+ console = {
+ warn: function(msg) {
+ logsOutput.innerHTML += '
- Just drag the pages up or down to change the page order and left or right to change the page's parent, then hit 'update'.
- The icon to the left of each page shows if it has child pages, double click anywhere on that item to toggle expand|collapse of it's children.
-
+ Just drag the pages up or down to change the page order and left or right to change the page's parent, then hit 'update'.
+ The icon to the left of each page shows if it has child pages, double click anywhere on that item to toggle expand|collapse of it's children.
+
-
- - - - -+
+ + + + +pageMash works with the wp_list_pages function. The easiest way to use it is to put the pages widget in your sidebar [WP admin page > Presentation > Widgets]. Click the configure button on the widget and ensure that 'sort by' is set to 'page order'. Hey presto, you're done.
-You can also use the function anywhere in your theme code. e.g. in your sidebar.php file (but the code in here will not run if you're using any widgets) or your header.php file (somewhere under the body tag, you may want to use the depth=1 parameter to only show top levle pages). The code should look something like the following:
+You can also use the function anywhere in your theme code. e.g. in your sidebar.php file (but the code in here will not run if you're using any widgets) or your header.php file (somewhere under the body tag, you may want to use the depth=1 parameter to only show top level pages). The code should look something like the following:
Code:
<?php wp_list_pages('title_li=<h2>Pages</h2>&depth=0'); ?>
You can also hard-code pages to exclude and these will be merged with the pages you set to exclude in your pageMash admin.
The code here is very simple and flexible, for more information look up wp_list_pages() in the Wordpress Codex as it is very well documented and if you have any further questions or feedback I like getting messages, so drop me an email.
+