Version Description
- An ul that was opened because of a search did not get the minus-sign
- New "popup" with actions when hovering a page. No more clicking to get to the actions. I really like it!
Download this release
Release Info
| Developer | eskapism |
| Plugin | |
| Version | 1.3 |
| Comparing to | |
| See all releases | |
Code changes from version 1.2.1 to 1.3
- index.php +32 -9
- jquery.client.js +127 -0
- readme.txt +5 -1
- scripts.js +95 -1
- styles.css +79 -7
index.php
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
Plugin Name: Admin Menu Tree Page View
|
| 4 |
Plugin URI: http://eskapism.se/code-playground/admin-menu-tree-page-view/
|
| 5 |
Description: Get a tree view of all your pages directly in the admin menu. Search, edit, view and add pages - all with just one click away!
|
| 6 |
-
Version: 1.
|
| 7 |
Author: Pär Thernström
|
| 8 |
Author URI: http://eskapism.se/
|
| 9 |
License: GPL2
|
|
@@ -32,13 +32,14 @@ add_action('wp_ajax_admin_menu_tree_page_view_add_page', 'admin_menu_tree_page_v
|
|
| 32 |
|
| 33 |
function admin_menu_tree_page_view_admin_init() {
|
| 34 |
|
| 35 |
-
define( "admin_menu_tree_page_view_VERSION", "1.
|
| 36 |
define( "admin_menu_tree_page_view_URL", WP_PLUGIN_URL . '/admin-menu-tree-page-view/' );
|
| 37 |
|
| 38 |
wp_enqueue_style("admin_menu_tree_page_view_styles", admin_menu_tree_page_view_URL . "styles.css", false, admin_menu_tree_page_view_VERSION);
|
| 39 |
wp_enqueue_script("jquery.highlight", admin_menu_tree_page_view_URL . "jquery.highlight.js", array("jquery"));
|
| 40 |
wp_enqueue_script("jquery-cookie", admin_menu_tree_page_view_URL . "jquery.biscuit.js", array("jquery")); // renamed from cookie to fix problems with mod_security
|
| 41 |
wp_enqueue_script("jquery.ui.nestedSortable", admin_menu_tree_page_view_URL . "jquery.ui.nestedSortable.js", array("jquery", "jquery-ui-sortable"));
|
|
|
|
| 42 |
wp_enqueue_script("admin_menu_tree_page_view", admin_menu_tree_page_view_URL . "scripts.js", array("jquery"));
|
| 43 |
|
| 44 |
$oLocale = array(
|
|
@@ -119,7 +120,10 @@ function admin_menu_tree_page_view_get_pages($args) {
|
|
| 119 |
if ( isset($_GET["action"]) && "edit" == $_GET["action"] && isset($_GET["post"])) {
|
| 120 |
// if post with id get[post] is a parent of the current post, show it
|
| 121 |
if ($_GET["post"] != $one_page->ID) {
|
| 122 |
-
$
|
|
|
|
|
|
|
|
|
|
| 123 |
if (in_array($one_page->ID, $one_page_parents)) {
|
| 124 |
$isOpened = TRUE;
|
| 125 |
}
|
|
@@ -134,24 +138,43 @@ function admin_menu_tree_page_view_get_pages($args) {
|
|
| 134 |
|
| 135 |
$class .= " nestedSortable";
|
| 136 |
|
| 137 |
-
$output .= "<li class='$class'
|
| 138 |
-
|
|
|
|
|
|
|
| 139 |
$output .= $title;
|
| 140 |
|
| 141 |
// add the view link, hidden, used in popup
|
| 142 |
$permalink = get_permalink($one_page->ID);
|
| 143 |
$output .= "<span class='admin-menu-tree-page-view-view-link'>$permalink</span>";
|
| 144 |
-
|
| 145 |
$output .= "<span class='admin-menu-tree-page-view-edit'></span>";
|
| 146 |
|
| 147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
|
| 149 |
-
|
|
|
|
|
|
|
|
|
|
| 150 |
|
| 151 |
|
|
|
|
| 152 |
$output .= $str_child_output;
|
| 153 |
|
| 154 |
-
$output .= "</
|
| 155 |
}
|
| 156 |
|
| 157 |
// if this is a child listing, add ul
|
| 3 |
Plugin Name: Admin Menu Tree Page View
|
| 4 |
Plugin URI: http://eskapism.se/code-playground/admin-menu-tree-page-view/
|
| 5 |
Description: Get a tree view of all your pages directly in the admin menu. Search, edit, view and add pages - all with just one click away!
|
| 6 |
+
Version: 1.3
|
| 7 |
Author: Pär Thernström
|
| 8 |
Author URI: http://eskapism.se/
|
| 9 |
License: GPL2
|
| 32 |
|
| 33 |
function admin_menu_tree_page_view_admin_init() {
|
| 34 |
|
| 35 |
+
define( "admin_menu_tree_page_view_VERSION", "1.3" );
|
| 36 |
define( "admin_menu_tree_page_view_URL", WP_PLUGIN_URL . '/admin-menu-tree-page-view/' );
|
| 37 |
|
| 38 |
wp_enqueue_style("admin_menu_tree_page_view_styles", admin_menu_tree_page_view_URL . "styles.css", false, admin_menu_tree_page_view_VERSION);
|
| 39 |
wp_enqueue_script("jquery.highlight", admin_menu_tree_page_view_URL . "jquery.highlight.js", array("jquery"));
|
| 40 |
wp_enqueue_script("jquery-cookie", admin_menu_tree_page_view_URL . "jquery.biscuit.js", array("jquery")); // renamed from cookie to fix problems with mod_security
|
| 41 |
wp_enqueue_script("jquery.ui.nestedSortable", admin_menu_tree_page_view_URL . "jquery.ui.nestedSortable.js", array("jquery", "jquery-ui-sortable"));
|
| 42 |
+
wp_enqueue_script("jquery.client", admin_menu_tree_page_view_URL . "jquery.client.js", array("jquery"));
|
| 43 |
wp_enqueue_script("admin_menu_tree_page_view", admin_menu_tree_page_view_URL . "scripts.js", array("jquery"));
|
| 44 |
|
| 45 |
$oLocale = array(
|
| 120 |
if ( isset($_GET["action"]) && "edit" == $_GET["action"] && isset($_GET["post"])) {
|
| 121 |
// if post with id get[post] is a parent of the current post, show it
|
| 122 |
if ($_GET["post"] != $one_page->ID) {
|
| 123 |
+
$post_to_check_parents_for = $_GET["post"];
|
| 124 |
+
// seems to be a problem with get_post_ancestors (yes, it's in the trac too)
|
| 125 |
+
wp_cache_delete($post_to_check_parents_for, 'posts');
|
| 126 |
+
$one_page_parents = get_post_ancestors($post_to_check_parents_for);
|
| 127 |
if (in_array($one_page->ID, $one_page_parents)) {
|
| 128 |
$isOpened = TRUE;
|
| 129 |
}
|
| 138 |
|
| 139 |
$class .= " nestedSortable";
|
| 140 |
|
| 141 |
+
$output .= "<li class='$class'>";
|
| 142 |
+
// first div used for nestedSortable
|
| 143 |
+
$output .= "<div>";
|
| 144 |
+
$output .= "<a href='$edit_link' data-post-id='".$one_page->ID."'>$status_span";
|
| 145 |
$output .= $title;
|
| 146 |
|
| 147 |
// add the view link, hidden, used in popup
|
| 148 |
$permalink = get_permalink($one_page->ID);
|
| 149 |
$output .= "<span class='admin-menu-tree-page-view-view-link'>$permalink</span>";
|
|
|
|
| 150 |
$output .= "<span class='admin-menu-tree-page-view-edit'></span>";
|
| 151 |
|
| 152 |
+
// popup edit div
|
| 153 |
+
$output .= "
|
| 154 |
+
<span class='amtpv-editpopup'>
|
| 155 |
+
<span class='amtpv-editpopup-editview'>
|
| 156 |
+
<span class='amtpv-editpopup-edit' data-link='".$edit_link."'>".__("Edit", 'admin-menu-tree-page-view')."</span>
|
| 157 |
+
|
|
| 158 |
+
<span class='amtpv-editpopup-view' data-link='".$permalink."'>".__("View", 'admin-menu-tree-page-view')."</span>
|
| 159 |
+
</span>
|
| 160 |
+
<span class='amtpv-editpopup-add'>".__("Add new page", 'admin-menu-tree-page-view')."<br />
|
| 161 |
+
<span class='amtpv-editpopup-add-after'>".__("After", 'admin-menu-tree-page-view')."</span>
|
| 162 |
+
|
|
| 163 |
+
<span class='amtpv-editpopup-add-inside'>".__("Inside", 'admin-menu-tree-page-view')."</span>
|
| 164 |
+
</span>
|
| 165 |
+
</span>
|
| 166 |
+
";
|
| 167 |
|
| 168 |
+
$output .= "</a>";
|
| 169 |
+
|
| 170 |
+
// close div for nestedSortable
|
| 171 |
+
$output .= "</div>";
|
| 172 |
|
| 173 |
|
| 174 |
+
// add child articles
|
| 175 |
$output .= $str_child_output;
|
| 176 |
|
| 177 |
+
$output .= "</li>";
|
| 178 |
}
|
| 179 |
|
| 180 |
// if this is a child listing, add ul
|
jquery.client.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
Plugin from http://www.stoimen.com/jquery.client.plugin/
|
| 3 |
+
Modfied to pass $ by Pär Thernström par.thernstrom@gmail.com
|
| 4 |
+
*/
|
| 5 |
+
;(function($) {
|
| 6 |
+
|
| 7 |
+
var BrowserDetect = {
|
| 8 |
+
init: function () {
|
| 9 |
+
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
|
| 10 |
+
this.version = this.searchVersion(navigator.userAgent)
|
| 11 |
+
|| this.searchVersion(navigator.appVersion)
|
| 12 |
+
|| "an unknown version";
|
| 13 |
+
this.OS = this.searchString(this.dataOS) || "an unknown OS";
|
| 14 |
+
},
|
| 15 |
+
searchString: function (data) {
|
| 16 |
+
for (var i=0;i<data.length;i++) {
|
| 17 |
+
var dataString = data[i].string;
|
| 18 |
+
var dataProp = data[i].prop;
|
| 19 |
+
this.versionSearchString = data[i].versionSearch || data[i].identity;
|
| 20 |
+
if (dataString) {
|
| 21 |
+
if (dataString.indexOf(data[i].subString) != -1)
|
| 22 |
+
return data[i].identity;
|
| 23 |
+
}
|
| 24 |
+
else if (dataProp)
|
| 25 |
+
return data[i].identity;
|
| 26 |
+
}
|
| 27 |
+
},
|
| 28 |
+
searchVersion: function (dataString) {
|
| 29 |
+
var index = dataString.indexOf(this.versionSearchString);
|
| 30 |
+
if (index == -1) return;
|
| 31 |
+
return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
|
| 32 |
+
},
|
| 33 |
+
dataBrowser: [
|
| 34 |
+
{
|
| 35 |
+
string: navigator.userAgent,
|
| 36 |
+
subString: "Chrome",
|
| 37 |
+
identity: "Chrome"
|
| 38 |
+
},
|
| 39 |
+
{ string: navigator.userAgent,
|
| 40 |
+
subString: "OmniWeb",
|
| 41 |
+
versionSearch: "OmniWeb/",
|
| 42 |
+
identity: "OmniWeb"
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
string: navigator.vendor,
|
| 46 |
+
subString: "Apple",
|
| 47 |
+
identity: "Safari",
|
| 48 |
+
versionSearch: "Version"
|
| 49 |
+
},
|
| 50 |
+
{
|
| 51 |
+
prop: window.opera,
|
| 52 |
+
identity: "Opera"
|
| 53 |
+
},
|
| 54 |
+
{
|
| 55 |
+
string: navigator.vendor,
|
| 56 |
+
subString: "iCab",
|
| 57 |
+
identity: "iCab"
|
| 58 |
+
},
|
| 59 |
+
{
|
| 60 |
+
string: navigator.vendor,
|
| 61 |
+
subString: "KDE",
|
| 62 |
+
identity: "Konqueror"
|
| 63 |
+
},
|
| 64 |
+
{
|
| 65 |
+
string: navigator.userAgent,
|
| 66 |
+
subString: "Firefox",
|
| 67 |
+
identity: "Firefox"
|
| 68 |
+
},
|
| 69 |
+
{
|
| 70 |
+
string: navigator.vendor,
|
| 71 |
+
subString: "Camino",
|
| 72 |
+
identity: "Camino"
|
| 73 |
+
},
|
| 74 |
+
{ // for newer Netscapes (6+)
|
| 75 |
+
string: navigator.userAgent,
|
| 76 |
+
subString: "Netscape",
|
| 77 |
+
identity: "Netscape"
|
| 78 |
+
},
|
| 79 |
+
{
|
| 80 |
+
string: navigator.userAgent,
|
| 81 |
+
subString: "MSIE",
|
| 82 |
+
identity: "Explorer",
|
| 83 |
+
versionSearch: "MSIE"
|
| 84 |
+
},
|
| 85 |
+
{
|
| 86 |
+
string: navigator.userAgent,
|
| 87 |
+
subString: "Gecko",
|
| 88 |
+
identity: "Mozilla",
|
| 89 |
+
versionSearch: "rv"
|
| 90 |
+
},
|
| 91 |
+
{ // for older Netscapes (4-)
|
| 92 |
+
string: navigator.userAgent,
|
| 93 |
+
subString: "Mozilla",
|
| 94 |
+
identity: "Netscape",
|
| 95 |
+
versionSearch: "Mozilla"
|
| 96 |
+
}
|
| 97 |
+
],
|
| 98 |
+
dataOS : [
|
| 99 |
+
{
|
| 100 |
+
string: navigator.platform,
|
| 101 |
+
subString: "Win",
|
| 102 |
+
identity: "Windows"
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
string: navigator.platform,
|
| 106 |
+
subString: "Mac",
|
| 107 |
+
identity: "Mac"
|
| 108 |
+
},
|
| 109 |
+
{
|
| 110 |
+
string: navigator.userAgent,
|
| 111 |
+
subString: "iPhone",
|
| 112 |
+
identity: "iPhone/iPod"
|
| 113 |
+
},
|
| 114 |
+
{
|
| 115 |
+
string: navigator.platform,
|
| 116 |
+
subString: "Linux",
|
| 117 |
+
identity: "Linux"
|
| 118 |
+
}
|
| 119 |
+
]
|
| 120 |
+
|
| 121 |
+
};
|
| 122 |
+
|
| 123 |
+
BrowserDetect.init();
|
| 124 |
+
|
| 125 |
+
$.client = { os : BrowserDetect.OS, browser : BrowserDetect.browser };
|
| 126 |
+
|
| 127 |
+
})(jQuery);
|
readme.txt
CHANGED
|
@@ -4,7 +4,7 @@ Donate link: http://eskapism.se/sida/donate/
|
|
| 4 |
Tags: admin, page, pages, tree, view, admin menu, menu
|
| 5 |
Requires at least: 3.0
|
| 6 |
Tested up to: 3.0
|
| 7 |
-
Stable tag: 1.
|
| 8 |
|
| 9 |
Get a tree view of all your pages directly in the admin menu. Search, edit, view and add pages - all with just one click away!
|
| 10 |
|
|
@@ -40,6 +40,10 @@ Now the tree with the pages will be visible in the admin menu to the left.
|
|
| 40 |
|
| 41 |
== Changelog ==
|
| 42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
= 1.2.1 =
|
| 44 |
- The plus-sign/expand link now works at least three levels down in the tree
|
| 45 |
|
| 4 |
Tags: admin, page, pages, tree, view, admin menu, menu
|
| 5 |
Requires at least: 3.0
|
| 6 |
Tested up to: 3.0
|
| 7 |
+
Stable tag: 1.3
|
| 8 |
|
| 9 |
Get a tree view of all your pages directly in the admin menu. Search, edit, view and add pages - all with just one click away!
|
| 10 |
|
| 40 |
|
| 41 |
== Changelog ==
|
| 42 |
|
| 43 |
+
= 1.3 =
|
| 44 |
+
- An ul that was opened because of a search did not get the minus-sign
|
| 45 |
+
- New "popup" with actions when hovering a page. No more clicking to get to the actions. I really like it!
|
| 46 |
+
|
| 47 |
= 1.2.1 =
|
| 48 |
- The plus-sign/expand link now works at least three levels down in the tree
|
| 49 |
|
scripts.js
CHANGED
|
@@ -133,9 +133,11 @@ jQuery(function($) {
|
|
| 133 |
// hits can be childs of hidden li:s, so we must show the parents of the hits too
|
| 134 |
hits.each(function(i, elm) {
|
| 135 |
var parent = elm.parentNode;
|
|
|
|
| 136 |
if (parent) {
|
| 137 |
parent = $(parent);
|
| 138 |
-
|
|
|
|
| 139 |
//console.log(parent.parent());
|
| 140 |
parent.show();
|
| 141 |
}
|
|
@@ -210,6 +212,98 @@ jQuery(function($) {
|
|
| 210 |
});
|
| 211 |
|
| 212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 213 |
});
|
| 214 |
|
| 215 |
function admin_menu_tree_page_view_save_opened_posts() {
|
| 133 |
// hits can be childs of hidden li:s, so we must show the parents of the hits too
|
| 134 |
hits.each(function(i, elm) {
|
| 135 |
var parent = elm.parentNode;
|
| 136 |
+
console.log(parent);
|
| 137 |
if (parent) {
|
| 138 |
parent = $(parent);
|
| 139 |
+
// ul -> div -> ul
|
| 140 |
+
parent.parent().parent().addClass("admin-menu-tree-page-view-opened").removeClass("admin-menu-tree-page-view-closed");
|
| 141 |
//console.log(parent.parent());
|
| 142 |
parent.show();
|
| 143 |
}
|
| 212 |
});
|
| 213 |
|
| 214 |
|
| 215 |
+
|
| 216 |
+
// mouse over to show edit-box
|
| 217 |
+
$("ul.admin-menu-tree-page-tree li a:first-child").live("mouseenter mouseleave", function(e) {
|
| 218 |
+
//console.log("e", e);
|
| 219 |
+
var t = $(this);
|
| 220 |
+
var li = t.closest("li");
|
| 221 |
+
//console.log("li", li);
|
| 222 |
+
var popupdiv = li.find("span.amtpv-editpopup:first");
|
| 223 |
+
if (e.type == "mouseenter") {
|
| 224 |
+
var ul = t.closest("ul.admin-menu-tree-page-tree");
|
| 225 |
+
ul.find("span.amtpv-editpopup").removeClass("amtpv-editpopup-hover");
|
| 226 |
+
popupdiv.addClass("amtpv-editpopup-hover");
|
| 227 |
+
} else if (e.type == "mouseleave") {
|
| 228 |
+
// don't hide if related target is the shadow of the menu, aka #adminmenushadow
|
| 229 |
+
var do_hide = true;
|
| 230 |
+
if (e.relatedTarget && e.relatedTarget.id == "adminmenushadow") {
|
| 231 |
+
do_hide = false;
|
| 232 |
+
}
|
| 233 |
+
if (do_hide) {
|
| 234 |
+
popupdiv.removeClass("amtpv-editpopup-hover");
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
}
|
| 238 |
+
});
|
| 239 |
+
|
| 240 |
+
// don't allow clicks directly on .amtpv-editpopup. it's kinda confusing
|
| 241 |
+
$("span.amtpv-editpopup").live("click", function(e) {
|
| 242 |
+
e.preventDefault();
|
| 243 |
+
});
|
| 244 |
+
|
| 245 |
+
// edit/view links
|
| 246 |
+
$("span.amtpv-editpopup-edit, span.amtpv-editpopup-view").live("click",function(e) {
|
| 247 |
+
e.preventDefault();
|
| 248 |
+
var t = $(this);
|
| 249 |
+
var link = t.data("link");
|
| 250 |
+
var new_win = false;
|
| 251 |
+
|
| 252 |
+
if ( ($.client.os == "Mac" && (e.metaKey || e.shiftKey)) || ($.client.os != "Mac" && e.ctrlKey) ) {
|
| 253 |
+
new_win = true;
|
| 254 |
+
}
|
| 255 |
+
if (new_win) {
|
| 256 |
+
window.open(link);
|
| 257 |
+
} else {
|
| 258 |
+
document.location = link;
|
| 259 |
+
}
|
| 260 |
+
|
| 261 |
+
});
|
| 262 |
+
|
| 263 |
+
// add links
|
| 264 |
+
$("span.amtpv-editpopup-add-after, span.amtpv-editpopup-add-inside").live("click", function(e) {
|
| 265 |
+
|
| 266 |
+
var t = $(this);
|
| 267 |
+
var post_id = t.closest("a").data("post-id");
|
| 268 |
+
|
| 269 |
+
var type = "after";
|
| 270 |
+
if ($(this).hasClass("amtpv-editpopup-add-inside")) {
|
| 271 |
+
type = "inside";
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
var page_title = prompt("Enter name of new page", amtpv_l10n.Untitled);
|
| 275 |
+
if (page_title) {
|
| 276 |
+
|
| 277 |
+
var data = {
|
| 278 |
+
"action": 'admin_menu_tree_page_view_add_page',
|
| 279 |
+
"pageID": post_id,
|
| 280 |
+
"type": type,
|
| 281 |
+
"page_title": page_title,
|
| 282 |
+
"post_type": "page"
|
| 283 |
+
};
|
| 284 |
+
jQuery.post(ajaxurl, data, function(response) {
|
| 285 |
+
if (response != "0") {
|
| 286 |
+
var new_win = false;
|
| 287 |
+
if ( ($.client.os == "Mac" && (e.metaKey || e.shiftKey)) || ($.client.os != "Mac" && e.ctrlKey) ) {
|
| 288 |
+
new_win = true;
|
| 289 |
+
}
|
| 290 |
+
if (new_win) {
|
| 291 |
+
window.open(response);
|
| 292 |
+
} else {
|
| 293 |
+
document.location = response;
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
}
|
| 297 |
+
});
|
| 298 |
+
return false;
|
| 299 |
+
|
| 300 |
+
} else {
|
| 301 |
+
return false;
|
| 302 |
+
}
|
| 303 |
+
|
| 304 |
+
});
|
| 305 |
+
|
| 306 |
+
|
| 307 |
});
|
| 308 |
|
| 309 |
function admin_menu_tree_page_view_save_opened_posts() {
|
styles.css
CHANGED
|
@@ -27,6 +27,10 @@ li.toplevel_page_admin-menu-tree-page-tree_main .wp-submenu a {
|
|
| 27 |
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li {
|
| 28 |
position: relative;
|
| 29 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li div > a {
|
| 31 |
border-left-width: 0px;
|
| 32 |
border-left-style: solid;
|
|
@@ -35,9 +39,14 @@ li.toplevel_page_admin-menu-tree-page-tree_main .wp-submenu a {
|
|
| 35 |
background: transparent url(page-small.gif) no-repeat 7px 2px !important;
|
| 36 |
padding-left: 19px;
|
| 37 |
padding-right: 8px;
|
|
|
|
|
|
|
| 38 |
}
|
| 39 |
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li a:hover {
|
| 40 |
background-color: #eaf2fa !important;
|
|
|
|
|
|
|
|
|
|
| 41 |
}
|
| 42 |
|
| 43 |
#adminmenu li.wp-has-current-submenu ul.admin-menu-tree-page-tree li a {
|
|
@@ -47,7 +56,7 @@ li.toplevel_page_admin-menu-tree-page-tree_main .wp-submenu a {
|
|
| 47 |
|
| 48 |
#adminmenu li ul.admin-menu-tree-page-tree li a {
|
| 49 |
font-size: 10px;
|
| 50 |
-
line-height:
|
| 51 |
padding-top: 2px;
|
| 52 |
}
|
| 53 |
|
|
@@ -66,7 +75,8 @@ li.toplevel_page_admin-menu-tree-page-tree_main .wp-submenu a {
|
|
| 66 |
}
|
| 67 |
|
| 68 |
#adminmenu li ul.admin-menu-tree-page-tree a:hover .admin-menu-tree-page-view-edit {
|
| 69 |
-
|
|
|
|
| 70 |
}
|
| 71 |
|
| 72 |
#adminmenu li ul.admin-menu-tree-page-tree a:hover .admin-menu-tree-page-view-edit:hover {
|
|
@@ -116,7 +126,7 @@ li.admin-menu-tree-page-filter
|
|
| 116 |
{
|
| 117 |
padding-left: 27px;
|
| 118 |
padding-right: 8px;
|
| 119 |
-
background-position: 15px
|
| 120 |
font-weight: normal;
|
| 121 |
color: #21759B;
|
| 122 |
}
|
|
@@ -126,7 +136,7 @@ li.admin-menu-tree-page-filter
|
|
| 126 |
{
|
| 127 |
padding-left: 37px;
|
| 128 |
padding-right: 8px;
|
| 129 |
-
background-position: 25px
|
| 130 |
font-weight: normal;
|
| 131 |
color: #21759B;
|
| 132 |
}
|
|
@@ -136,7 +146,7 @@ li.admin-menu-tree-page-filter
|
|
| 136 |
{
|
| 137 |
padding-left: 47px;
|
| 138 |
padding-right: 8px;
|
| 139 |
-
background-position: 35px
|
| 140 |
font-weight: normal;
|
| 141 |
color: #21759B;
|
| 142 |
}
|
|
@@ -224,11 +234,16 @@ li.admin-menu-tree-page-filter
|
|
| 224 |
.admin-menu-tree-page-filter {
|
| 225 |
position: relative;
|
| 226 |
}
|
| 227 |
-
.admin-menu-tree-page-filter input {
|
| 228 |
width: 125px;
|
| 229 |
font-size: 10px;
|
| 230 |
line-height: 1em;
|
| 231 |
padding: 2px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 232 |
}
|
| 233 |
|
| 234 |
.admin-menu-tree-page-filter-reset {
|
|
@@ -287,7 +302,7 @@ ul.admin-menu-tree-page-tree ul ul ul .admin-menu-tree-page-expand {
|
|
| 287 |
ul.admin-menu-tree-page-tree ul {
|
| 288 |
display: none;
|
| 289 |
}
|
| 290 |
-
ul.admin-menu-tree-page-tree li.admin-menu-tree-page-view-opened > div
|
| 291 |
display: block;
|
| 292 |
}
|
| 293 |
|
|
@@ -299,3 +314,60 @@ ul.admin-menu-tree-page-tree span.child-count {
|
|
| 299 |
.admin-menu-tree-page-placeholder {
|
| 300 |
background-color: yellow;
|
| 301 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li {
|
| 28 |
position: relative;
|
| 29 |
}
|
| 30 |
+
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li.admin-menu-tree-page-view-has-childs.admin-menu-tree-page-view-opened {
|
| 31 |
+
margin-bottom: 2px;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li div > a {
|
| 35 |
border-left-width: 0px;
|
| 36 |
border-left-style: solid;
|
| 39 |
background: transparent url(page-small.gif) no-repeat 7px 2px !important;
|
| 40 |
padding-left: 19px;
|
| 41 |
padding-right: 8px;
|
| 42 |
+
border-bottom: 1px solid transparent;
|
| 43 |
+
border-top: 1px solid transparent;
|
| 44 |
}
|
| 45 |
#adminmenu li .wp-submenu ul.admin-menu-tree-page-tree li a:hover {
|
| 46 |
background-color: #eaf2fa !important;
|
| 47 |
+
border-bottom: 1px solid #ccc;
|
| 48 |
+
border-top: 1px solid #ccc;
|
| 49 |
+
/* box-shadow: 2px 2px 2px #DDDDDD; */
|
| 50 |
}
|
| 51 |
|
| 52 |
#adminmenu li.wp-has-current-submenu ul.admin-menu-tree-page-tree li a {
|
| 56 |
|
| 57 |
#adminmenu li ul.admin-menu-tree-page-tree li a {
|
| 58 |
font-size: 10px;
|
| 59 |
+
line-height: 11px;
|
| 60 |
padding-top: 2px;
|
| 61 |
}
|
| 62 |
|
| 75 |
}
|
| 76 |
|
| 77 |
#adminmenu li ul.admin-menu-tree-page-tree a:hover .admin-menu-tree-page-view-edit {
|
| 78 |
+
/* disabled to support new edit popup */
|
| 79 |
+
/* display: block; */
|
| 80 |
}
|
| 81 |
|
| 82 |
#adminmenu li ul.admin-menu-tree-page-tree a:hover .admin-menu-tree-page-view-edit:hover {
|
| 126 |
{
|
| 127 |
padding-left: 27px;
|
| 128 |
padding-right: 8px;
|
| 129 |
+
background-position: 15px 2px !important;
|
| 130 |
font-weight: normal;
|
| 131 |
color: #21759B;
|
| 132 |
}
|
| 136 |
{
|
| 137 |
padding-left: 37px;
|
| 138 |
padding-right: 8px;
|
| 139 |
+
background-position: 25px 2px !important;
|
| 140 |
font-weight: normal;
|
| 141 |
color: #21759B;
|
| 142 |
}
|
| 146 |
{
|
| 147 |
padding-left: 47px;
|
| 148 |
padding-right: 8px;
|
| 149 |
+
background-position: 35px 2px !important;
|
| 150 |
font-weight: normal;
|
| 151 |
color: #21759B;
|
| 152 |
}
|
| 234 |
.admin-menu-tree-page-filter {
|
| 235 |
position: relative;
|
| 236 |
}
|
| 237 |
+
#adminmenu .admin-menu-tree-page-filter input {
|
| 238 |
width: 125px;
|
| 239 |
font-size: 10px;
|
| 240 |
line-height: 1em;
|
| 241 |
padding: 2px;
|
| 242 |
+
-webkit-user-select: text;
|
| 243 |
+
-moz-user-select: text;
|
| 244 |
+
}
|
| 245 |
+
#menu-pages * {
|
| 246 |
+
-moz-user-select: text;
|
| 247 |
}
|
| 248 |
|
| 249 |
.admin-menu-tree-page-filter-reset {
|
| 302 |
ul.admin-menu-tree-page-tree ul {
|
| 303 |
display: none;
|
| 304 |
}
|
| 305 |
+
ul.admin-menu-tree-page-tree li.admin-menu-tree-page-view-opened > div + ul {
|
| 306 |
display: block;
|
| 307 |
}
|
| 308 |
|
| 314 |
.admin-menu-tree-page-placeholder {
|
| 315 |
background-color: yellow;
|
| 316 |
}
|
| 317 |
+
|
| 318 |
+
.amtpv-editpopup {
|
| 319 |
+
display: none;
|
| 320 |
+
width: 200px;
|
| 321 |
+
left: 145px;
|
| 322 |
+
top: 0;
|
| 323 |
+
position: absolute;
|
| 324 |
+
background-color: white;
|
| 325 |
+
border: 1px solid #ccc;
|
| 326 |
+
border-left: none;
|
| 327 |
+
padding: 10px;
|
| 328 |
+
opacity: .5;
|
| 329 |
+
font-weight: normal;
|
| 330 |
+
border-radius: 0 3px 3px 3px;
|
| 331 |
+
cursor: default;
|
| 332 |
+
box-shadow: 2px 2px 2px #ddd;
|
| 333 |
+
font-size: 12px;
|
| 334 |
+
line-height: 1.3;
|
| 335 |
+
background-color: #EAF2FA;
|
| 336 |
+
background-image: -moz-linear-gradient(left , #d3dbe1, #EAF2FA 10px);
|
| 337 |
+
background-image: -webkit-linear-gradient(left , #d3dbe1, #EAF2FA 5px);
|
| 338 |
+
margin-top: -8px;
|
| 339 |
+
}
|
| 340 |
+
.amtpv-editpopup-hover {
|
| 341 |
+
display: block;
|
| 342 |
+
}
|
| 343 |
+
.amtpv-editpopup-hover:hover {
|
| 344 |
+
/* i know... hover hover! in sweden we call that "kaka på kaka" */
|
| 345 |
+
opacity: 1;
|
| 346 |
+
}
|
| 347 |
+
.amtpv-editpopup-editview,
|
| 348 |
+
.amtpv-editpopup-add
|
| 349 |
+
{
|
| 350 |
+
display: block;
|
| 351 |
+
}
|
| 352 |
+
.amtpv-editpopup-editview {
|
| 353 |
+
margin-bottom: .5em;
|
| 354 |
+
}
|
| 355 |
+
/* "links" */
|
| 356 |
+
.amtpv-editpopup-edit,
|
| 357 |
+
.amtpv-editpopup-view,
|
| 358 |
+
.amtpv-editpopup-add-after,
|
| 359 |
+
.amtpv-editpopup-add-inside {
|
| 360 |
+
text-decoration: underline;
|
| 361 |
+
color: #21759B;
|
| 362 |
+
cursor: pointer;
|
| 363 |
+
}
|
| 364 |
+
.amtpv-editpopup-edit:hover,
|
| 365 |
+
.amtpv-editpopup-view:hover,
|
| 366 |
+
.amtpv-editpopup-add-after:hover,
|
| 367 |
+
.amtpv-editpopup-add-inside:hover {
|
| 368 |
+
color: #D54E21;
|
| 369 |
+
}
|
| 370 |
+
|
| 371 |
+
.ui-nestedSortable-error {
|
| 372 |
+
border: 1px solid red;
|
| 373 |
+
}
|
