Version Description
- updated french translation
- new box for mouse-over/pop-up - please let me know what you think about it
- new box: it's bigger so it's less likely that you slide out of it with your mouse (happend to me all the time! very annoying...) .
- new box: more information can be fitted there. let me know if there is any information you would like to see in the popup (right now it will show you the last modified date + the id of the page)
- new box: edit and view links are real links now, so you can edit or view pages in for example a new tab
- new box: oh.. and it's much better looking! :)
Download this release
Release Info
Developer | eskapism |
Plugin | CMS Tree Page View |
Version | 0.6 |
Comparing to | |
See all releases |
Code changes from version 0.5.7 to 0.6
- functions.php +36 -4
- index.php +2 -2
- languages/cms-tree-page-view-fr_FR.mo +0 -0
- languages/cms-tree-page-view-fr_FR.po +98 -65
- readme.txt +8 -0
- screenshot-2.png +0 -0
- scripts/cms_tree_page_view.js +66 -46
- scripts/themes/wordpress/style.css +9 -0
- styles/images/arrow-left.gif +0 -0
- styles/styles.css +67 -17
functions.php
CHANGED
@@ -176,7 +176,24 @@ function cms_tpv_print_common_tree_stuff() {
|
|
176 |
|
177 |
<div id="cms_tpv_container" class="tree-default"><?php _e("Loading tree", 'cms-tree-page-view') ?></div>
|
178 |
<div style="clear: both;"></div>
|
179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
<?php
|
181 |
}
|
182 |
} // func
|
@@ -239,7 +256,6 @@ function cms_tpv_get_pages($args = null) {
|
|
239 |
|
240 |
|
241 |
|
242 |
-
|
243 |
/**
|
244 |
* Output JSON for the children of a node
|
245 |
* $arrOpenChilds = array with id of pages to open children on
|
@@ -272,6 +288,20 @@ function cms_tpv_print_childs($pageID, $view = "all", $arrOpenChilds = null) {
|
|
272 |
$rel = "password";
|
273 |
}
|
274 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
275 |
$title = get_the_title($onePage->ID); // so hooks and stuff will do their work
|
276 |
if (empty($title)) {
|
277 |
$title = __("<Untitled page>", 'cms-tree-page-view');
|
@@ -302,8 +332,10 @@ function cms_tpv_print_childs($pageID, $view = "all", $arrOpenChilds = null) {
|
|
302 |
"post_status": "<?php echo $onePage->post_status ?>",
|
303 |
"rel": "<?php echo $rel ?>",
|
304 |
"childCount": <?php echo sizeof($arrChildPages) ?>,
|
305 |
-
"permalink": "<?php echo get_permalink($onePage->ID) ?>",
|
306 |
-
"editlink": "<?php echo $editLink ?>"
|
|
|
|
|
307 |
}
|
308 |
<?php
|
309 |
// if id is in $arrOpenChilds then also output children on this one
|
176 |
|
177 |
<div id="cms_tpv_container" class="tree-default"><?php _e("Loading tree", 'cms-tree-page-view') ?></div>
|
178 |
<div style="clear: both;"></div>
|
179 |
+
<div id="cms_tpv_page_actions">
|
180 |
+
<p>
|
181 |
+
<a href="#" title='<?php _e("Edit page", "cms-tree-page-view")?>' class='cms_tpv_action_edit'><?php _e("Edit", "cms-tree-page-view")?></a> |
|
182 |
+
<a href="#" title='<?php _e("View page", "cms-tree-page-view")?>' class='cms_tpv_action_view'><?php _e("View", "cms-tree-page-view")?></a>
|
183 |
+
</p>
|
184 |
+
<p>
|
185 |
+
<span class='cms_tpv_action_add_page'><?php _e("Add page", "cms-tree-page-view")?></span>
|
186 |
+
<a href="#" title='<?php _e("Add new page after", "cms-tree-page-view")?>' class='cms_tpv_action_add_page_after'><?php _e("after", "cms-tree-page-view")?></a> |
|
187 |
+
<a href="#" title='<?php _e("Add new page inside", "cms-tree-page-view")?>' class='cms_tpv_action_add_page_inside'><?php _e("inside", "cms-tree-page-view")?></a>
|
188 |
+
</ul>
|
189 |
+
<dl>
|
190 |
+
<dt><?php _e("Last modified", "cms-tree-page-view") ?></dt>
|
191 |
+
<dd><span id="cms_tpv_page_actions_modified_time"></span> <?php _e("by", "cms-tree-page-view") ?> <span id="cms_tpv_page_actions_modified_by"></span></dd>
|
192 |
+
<dt><?php _e("Page ID", "cms-tree-page-view") ?></dt>
|
193 |
+
<dd><span id="cms_tpv_page_actions_page_id"></span></dd>
|
194 |
+
</dl>
|
195 |
+
<span id="cms_tpv_page_actions_arrow"></span>
|
196 |
+
</div>
|
197 |
<?php
|
198 |
}
|
199 |
} // func
|
256 |
|
257 |
|
258 |
|
|
|
259 |
/**
|
260 |
* Output JSON for the children of a node
|
261 |
* $arrOpenChilds = array with id of pages to open children on
|
288 |
$rel = "password";
|
289 |
}
|
290 |
|
291 |
+
// modified time
|
292 |
+
$post_modified_time = get_post_modified_time('U', false, $onePage, false);
|
293 |
+
$post_modified_time = date_i18n(get_option('date_format'), $post_modified_time, false);
|
294 |
+
|
295 |
+
// last edited by
|
296 |
+
global $post;
|
297 |
+
$tmpPost = $post;
|
298 |
+
$post = $onePage;
|
299 |
+
$post_author = get_the_modified_author();
|
300 |
+
if (empty($post_author)) {
|
301 |
+
$post_author = __("Unknown user", 'cms-tree-page-view');
|
302 |
+
}
|
303 |
+
$post = $tmpPost;
|
304 |
+
|
305 |
$title = get_the_title($onePage->ID); // so hooks and stuff will do their work
|
306 |
if (empty($title)) {
|
307 |
$title = __("<Untitled page>", 'cms-tree-page-view');
|
332 |
"post_status": "<?php echo $onePage->post_status ?>",
|
333 |
"rel": "<?php echo $rel ?>",
|
334 |
"childCount": <?php echo sizeof($arrChildPages) ?>,
|
335 |
+
"permalink": "<?php echo htmlspecialchars_decode(get_permalink($onePage->ID)) ?>",
|
336 |
+
"editlink": "<?php echo htmlspecialchars_decode($editLink) ?>",
|
337 |
+
"modified_time": "<?php echo $post_modified_time ?>",
|
338 |
+
"modified_author": "<?php echo $post_author ?>"
|
339 |
}
|
340 |
<?php
|
341 |
// if id is in $arrOpenChilds then also output children on this one
|
index.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: CMS Tree Page View
|
4 |
Plugin URI: http://eskapism.se/code-playground/cms-tree-page-view/
|
5 |
Description: Adds a CMS-like tree view of all your pages, like the view often found in a page-focused CMS. By using the tree you can edit, view, add pages and even search pages (useful if you have many pages). And with drag and drop you can rearrange the order of your pages. Page management won't get any easier than this!
|
6 |
-
Version: 0.
|
7 |
Author: Pär Thernström
|
8 |
Author URI: http://eskapism.se/
|
9 |
License: GPL2
|
@@ -27,7 +27,7 @@ License: GPL2
|
|
27 |
|
28 |
require("functions.php");
|
29 |
|
30 |
-
define( "CMS_TPV_VERSION", "0.
|
31 |
define( "CMS_TPV_URL", WP_PLUGIN_URL . '/cms-tree-page-view/');
|
32 |
define( "CMS_TPV_NAME", "CMS Tree Page View");
|
33 |
|
3 |
Plugin Name: CMS Tree Page View
|
4 |
Plugin URI: http://eskapism.se/code-playground/cms-tree-page-view/
|
5 |
Description: Adds a CMS-like tree view of all your pages, like the view often found in a page-focused CMS. By using the tree you can edit, view, add pages and even search pages (useful if you have many pages). And with drag and drop you can rearrange the order of your pages. Page management won't get any easier than this!
|
6 |
+
Version: 0.6
|
7 |
Author: Pär Thernström
|
8 |
Author URI: http://eskapism.se/
|
9 |
License: GPL2
|
27 |
|
28 |
require("functions.php");
|
29 |
|
30 |
+
define( "CMS_TPV_VERSION", "0.6");
|
31 |
define( "CMS_TPV_URL", WP_PLUGIN_URL . '/cms-tree-page-view/');
|
32 |
define( "CMS_TPV_NAME", "CMS Tree Page View");
|
33 |
|
languages/cms-tree-page-view-fr_FR.mo
CHANGED
Binary file
|
languages/cms-tree-page-view-fr_FR.po
CHANGED
@@ -7,124 +7,157 @@ msgid ""
|
|
7 |
msgstr ""
|
8 |
"Project-Id-Version: \n"
|
9 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/cms-tree-page-view\n"
|
10 |
-
"POT-Creation-Date: 2010-
|
11 |
-
"PO-Revision-Date: 2010-
|
12 |
-
"Last-Translator:
|
13 |
"Language-Team: \n"
|
14 |
"MIME-Version: 1.0\n"
|
15 |
"Content-Type: text/plain; charset=UTF-8\n"
|
16 |
"Content-Transfer-Encoding: 8bit\n"
|
|
|
|
|
17 |
|
18 |
-
#: functions.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
msgid "settings"
|
20 |
msgstr "paramètres"
|
21 |
|
22 |
-
#: functions.php:
|
23 |
msgid "Show tree"
|
24 |
msgstr "Voir l'arborescence"
|
25 |
|
26 |
-
#: functions.php:
|
27 |
msgid "on the dashboard"
|
28 |
msgstr "dans le menu"
|
29 |
|
30 |
-
#: functions.php:
|
31 |
msgid "under the pages menu"
|
32 |
msgstr "sous les pages du menu"
|
33 |
|
34 |
-
#: functions.php:
|
35 |
msgid "Save Changes"
|
36 |
msgstr "Enregistrer"
|
37 |
|
38 |
-
#: functions.php:
|
|
|
|
|
|
|
|
|
39 |
msgid "All"
|
40 |
msgstr "Toutes les pages"
|
41 |
|
42 |
-
#: functions.php:
|
43 |
msgid "Public"
|
44 |
msgstr "Pages publiées"
|
45 |
|
46 |
-
#: functions.php:
|
47 |
msgid "Expand"
|
48 |
msgstr "Dérouler"
|
49 |
|
50 |
-
#: functions.php:
|
51 |
msgid "Collapse"
|
52 |
msgstr "Refermer"
|
53 |
|
54 |
-
#: functions.php:
|
|
|
|
|
|
|
|
|
55 |
msgid "Search"
|
56 |
msgstr "Rechercher"
|
57 |
|
58 |
-
#: functions.php:
|
59 |
msgid "Searching..."
|
60 |
msgstr "Recherche en cours"
|
61 |
|
62 |
-
#: functions.php:
|
63 |
msgid "Loading..."
|
64 |
msgstr "Chargement en cours"
|
65 |
|
66 |
-
#: functions.php:
|
67 |
msgid "Search: no pages found"
|
68 |
msgstr "Recherche : aucune page trouvée"
|
69 |
|
70 |
-
#: functions.php:
|
71 |
msgid "Loading tree"
|
72 |
msgstr "Chargement de l'arborescence"
|
73 |
|
74 |
-
#: functions.php:
|
75 |
msgid "<Untitled page>"
|
76 |
msgstr "<Sans-titre>"
|
77 |
|
78 |
-
#: functions.php:
|
79 |
msgid "Click to edit. Drag to move."
|
80 |
msgstr "Cliquez pour modifier, vous pouvez aussi déplacer la page"
|
81 |
|
82 |
-
#: functions.php:
|
83 |
msgid "New page"
|
84 |
msgstr "Nouvelle page"
|
85 |
|
86 |
-
#: scripts/cms_tree_page_view.php:85
|
87 |
-
#: scripts/cms_tree_page_view.php:102
|
88 |
-
msgid "Enter title of new page"
|
89 |
-
msgstr "Saisissez le titre de la page"
|
90 |
-
|
91 |
-
#: scripts/cms_tree_page_view.php:283
|
92 |
-
msgid "child pages"
|
93 |
-
msgstr "Pages sous cette page"
|
94 |
-
|
95 |
-
#: scripts/cms_tree_page_view.php:293
|
96 |
-
msgid "Edit page"
|
97 |
-
msgstr "Modifier la page"
|
98 |
-
|
99 |
-
#: scripts/cms_tree_page_view.php:293
|
100 |
-
msgid "Edit"
|
101 |
-
msgstr "Modifier"
|
102 |
-
|
103 |
-
#: scripts/cms_tree_page_view.php:294
|
104 |
-
msgid "View page"
|
105 |
-
msgstr "Voir la page"
|
106 |
-
|
107 |
-
#: scripts/cms_tree_page_view.php:294
|
108 |
-
msgid "View"
|
109 |
-
msgstr "Voir"
|
110 |
-
|
111 |
-
#: scripts/cms_tree_page_view.php:296
|
112 |
-
msgid "Add page"
|
113 |
-
msgstr "Ajouter une page"
|
114 |
-
|
115 |
-
#: scripts/cms_tree_page_view.php:297
|
116 |
-
msgid "Add new page after"
|
117 |
-
msgstr "Ajouter une page après cette page"
|
118 |
-
|
119 |
-
#: scripts/cms_tree_page_view.php:297
|
120 |
-
msgid "after"
|
121 |
-
msgstr "après"
|
122 |
-
|
123 |
-
#: scripts/cms_tree_page_view.php:298
|
124 |
-
msgid "Add new page inside"
|
125 |
-
msgstr "Ajouter une page sous cette page"
|
126 |
-
|
127 |
-
#: scripts/cms_tree_page_view.php:298
|
128 |
-
msgid "inside"
|
129 |
-
msgstr "sous cette page"
|
130 |
-
|
7 |
msgstr ""
|
8 |
"Project-Id-Version: \n"
|
9 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/cms-tree-page-view\n"
|
10 |
+
"POT-Creation-Date: 2010-06-30 19:00+0000\n"
|
11 |
+
"PO-Revision-Date: 2010-07-01 14:45+0100\n"
|
12 |
+
"Last-Translator: Pär Thernström <par.thernstrom@gmail.com>\n"
|
13 |
"Language-Team: \n"
|
14 |
"MIME-Version: 1.0\n"
|
15 |
"Content-Type: text/plain; charset=UTF-8\n"
|
16 |
"Content-Transfer-Encoding: 8bit\n"
|
17 |
+
"X-Poedit-Language: French\n"
|
18 |
+
"X-Poedit-Country: FRANCE\n"
|
19 |
|
20 |
+
#: functions.php:45
|
21 |
+
msgid "Enter title of new page"
|
22 |
+
msgstr "Saisissez le titre de la page"
|
23 |
+
|
24 |
+
#: functions.php:46
|
25 |
+
msgid "child pages"
|
26 |
+
msgstr "Pages sous cette page"
|
27 |
+
|
28 |
+
#: functions.php:47
|
29 |
+
msgid "Edit page"
|
30 |
+
msgstr "Modifier la page"
|
31 |
+
|
32 |
+
#: functions.php:48
|
33 |
+
msgid "View page"
|
34 |
+
msgstr "Voir la page"
|
35 |
+
|
36 |
+
#: functions.php:49
|
37 |
+
msgid "Edit"
|
38 |
+
msgstr "Modifier"
|
39 |
+
|
40 |
+
#: functions.php:50
|
41 |
+
msgid "View"
|
42 |
+
msgstr "Voir"
|
43 |
+
|
44 |
+
#: functions.php:51
|
45 |
+
msgid "Add page"
|
46 |
+
msgstr "Ajouter une page"
|
47 |
+
|
48 |
+
#: functions.php:52
|
49 |
+
msgid "Add new page after"
|
50 |
+
msgstr "Ajouter une page après cette page"
|
51 |
+
|
52 |
+
#: functions.php:53
|
53 |
+
msgid "after"
|
54 |
+
msgstr "après"
|
55 |
+
|
56 |
+
#: functions.php:54
|
57 |
+
msgid "inside"
|
58 |
+
msgstr "sous cette page"
|
59 |
+
|
60 |
+
#: functions.php:55
|
61 |
+
msgid "Add new page inside"
|
62 |
+
msgstr "Ajouter une page sous cette page"
|
63 |
+
|
64 |
+
#: functions.php:56
|
65 |
+
msgid "draft"
|
66 |
+
msgstr "brouillon"
|
67 |
+
|
68 |
+
#: functions.php:57
|
69 |
+
msgid "future"
|
70 |
+
msgstr "planifié"
|
71 |
+
|
72 |
+
#: functions.php:58
|
73 |
+
msgid "protected"
|
74 |
+
msgstr "protégé"
|
75 |
+
|
76 |
+
#: functions.php:59
|
77 |
+
msgid "pending"
|
78 |
+
msgstr "en attente"
|
79 |
+
|
80 |
+
#: functions.php:60
|
81 |
+
msgid "private"
|
82 |
+
msgstr "privé"
|
83 |
+
|
84 |
+
#: functions.php:61
|
85 |
+
msgid "Password protected page"
|
86 |
+
msgstr "Page protégée par mot de passe"
|
87 |
+
|
88 |
+
#: functions.php:113
|
89 |
msgid "settings"
|
90 |
msgstr "paramètres"
|
91 |
|
92 |
+
#: functions.php:120
|
93 |
msgid "Show tree"
|
94 |
msgstr "Voir l'arborescence"
|
95 |
|
96 |
+
#: functions.php:124
|
97 |
msgid "on the dashboard"
|
98 |
msgstr "dans le menu"
|
99 |
|
100 |
+
#: functions.php:128
|
101 |
msgid "under the pages menu"
|
102 |
msgstr "sous les pages du menu"
|
103 |
|
104 |
+
#: functions.php:135
|
105 |
msgid "Save Changes"
|
106 |
msgstr "Enregistrer"
|
107 |
|
108 |
+
#: functions.php:150
|
109 |
+
msgid "No pages found. Maybe you want to <a href='post-new.php?post_type=page'>add a new page</a>?"
|
110 |
+
msgstr "Aucune page trouvée. Peut-être voulez-vous <a href='post-new.php?post_type=page'>ajouter une page</a>?"
|
111 |
+
|
112 |
+
#: functions.php:157
|
113 |
msgid "All"
|
114 |
msgstr "Toutes les pages"
|
115 |
|
116 |
+
#: functions.php:158
|
117 |
msgid "Public"
|
118 |
msgstr "Pages publiées"
|
119 |
|
120 |
+
#: functions.php:160
|
121 |
msgid "Expand"
|
122 |
msgstr "Dérouler"
|
123 |
|
124 |
+
#: functions.php:161
|
125 |
msgid "Collapse"
|
126 |
msgstr "Refermer"
|
127 |
|
128 |
+
#: functions.php:166
|
129 |
+
msgid "Clear search"
|
130 |
+
msgstr "Effacer la recherche"
|
131 |
+
|
132 |
+
#: functions.php:167
|
133 |
msgid "Search"
|
134 |
msgstr "Rechercher"
|
135 |
|
136 |
+
#: functions.php:168
|
137 |
msgid "Searching..."
|
138 |
msgstr "Recherche en cours"
|
139 |
|
140 |
+
#: functions.php:173
|
141 |
msgid "Loading..."
|
142 |
msgstr "Chargement en cours"
|
143 |
|
144 |
+
#: functions.php:175
|
145 |
msgid "Search: no pages found"
|
146 |
msgstr "Recherche : aucune page trouvée"
|
147 |
|
148 |
+
#: functions.php:177
|
149 |
msgid "Loading tree"
|
150 |
msgstr "Chargement de l'arborescence"
|
151 |
|
152 |
+
#: functions.php:277
|
153 |
msgid "<Untitled page>"
|
154 |
msgstr "<Sans-titre>"
|
155 |
|
156 |
+
#: functions.php:295
|
157 |
msgid "Click to edit. Drag to move."
|
158 |
msgstr "Cliquez pour modifier, vous pouvez aussi déplacer la page"
|
159 |
|
160 |
+
#: functions.php:432
|
161 |
msgid "New page"
|
162 |
msgstr "Nouvelle page"
|
163 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -47,6 +47,14 @@ Now the tree with the pages will be visible both on the dashboard and in the men
|
|
47 |
|
48 |
== Changelog ==
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
= 0.5.7 =
|
51 |
- jquery.cookie.js renamed to jquery.biscuit.js to fix problems with apache module mod_security. let me know if it actually works! :)
|
52 |
- updated .pot-file, so translators out there may want to check if everything is up to date
|
47 |
|
48 |
== Changelog ==
|
49 |
|
50 |
+
= 0.6 =
|
51 |
+
- updated french translation
|
52 |
+
- new box for mouse-over/pop-up - please let me know what you think about it
|
53 |
+
- new box: it's bigger so it's less likely that you slide out of it with your mouse (happend to me all the time! very annoying...) .
|
54 |
+
- new box: more information can be fitted there. let me know if there is any information you would like to see in the popup (right now it will show you the last modified date + the id of the page)
|
55 |
+
- new box: edit and view links are real links now, so you can edit or view pages in for example a new tab
|
56 |
+
- new box: oh.. and it's much better looking! :)
|
57 |
+
|
58 |
= 0.5.7 =
|
59 |
- jquery.cookie.js renamed to jquery.biscuit.js to fix problems with apache module mod_security. let me know if it actually works! :)
|
60 |
- updated .pot-file, so translators out there may want to check if everything is up to date
|
screenshot-2.png
CHANGED
Binary file
|
scripts/cms_tree_page_view.js
CHANGED
@@ -1,8 +1,9 @@
|
|
1 |
|
2 |
-
var cms_tpv_tree, treeOptions;
|
3 |
jQuery(function($) {
|
4 |
|
5 |
cms_tpv_tree = $("#cms_tpv_container");
|
|
|
6 |
|
7 |
/**
|
8 |
* show div with options
|
@@ -59,6 +60,7 @@ jQuery(function($) {
|
|
59 |
|
60 |
|
61 |
// view page on click
|
|
|
62 |
jQuery(".cms_tpv_action_view").live("click", function() {
|
63 |
var $li = jQuery(this).closest("li");
|
64 |
var permalink = $li.data("jstree").permalink;
|
@@ -77,13 +79,14 @@ jQuery(".cms_tpv_action_edit").live("click", function() {
|
|
77 |
}
|
78 |
return false;
|
79 |
});
|
|
|
80 |
|
81 |
// add page after
|
82 |
jQuery(".cms_tpv_action_add_page_after").live("click", function() {
|
83 |
var $this = jQuery(this);
|
84 |
jPrompt(cmstpv_l10n.Enter_title_of_new_page, "", "CMS Tree Page View", function(new_page_title) {
|
85 |
if (new_page_title) {
|
86 |
-
var pageID = $this.
|
87 |
jQuery.post(ajaxurl, {
|
88 |
action: "cms_tpv_add_page",
|
89 |
pageID: pageID,
|
@@ -103,7 +106,7 @@ jQuery(".cms_tpv_action_add_page_inside").live("click", function() {
|
|
103 |
var $this = jQuery(this);
|
104 |
jPrompt(cmstpv_l10n.Enter_title_of_new_page, "", "CMS Tree Page View", function(new_page_title) {
|
105 |
if (new_page_title) {
|
106 |
-
var pageID = $this.
|
107 |
jQuery.post(ajaxurl, {
|
108 |
action: "cms_tpv_add_page",
|
109 |
pageID: pageID,
|
@@ -128,19 +131,53 @@ function cms_tpv_is_dragging() {
|
|
128 |
}
|
129 |
|
130 |
// mouse over, show actions
|
131 |
-
jQuery(".jstree li
|
132 |
-
$
|
133 |
-
|
134 |
-
// $actions.show();
|
135 |
if (cms_tpv_is_dragging() == false) {
|
136 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
}
|
138 |
});
|
139 |
// ..and hide them again
|
140 |
-
jQuery(".jstree li
|
141 |
-
$
|
142 |
-
$
|
143 |
-
|
144 |
});
|
145 |
|
146 |
|
@@ -222,41 +259,24 @@ function cms_tpv_bind_clean_node() {
|
|
222 |
}
|
223 |
|
224 |
// add number of children
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
|
|
|
|
240 |
}
|
241 |
-
|
242 |
-
// add div for mega super über cool mouseover/dropdown actions
|
243 |
-
/*
|
244 |
-
var divHTML = "<div class='cms_tpv_tree_actions'>";
|
245 |
-
divHTML += "<p>ola!</p>";
|
246 |
-
divHTML += "<p>lorem ipsum dolor sit amet</p>";
|
247 |
-
divHTML += "</div>";
|
248 |
-
li.prepend(divHTML);
|
249 |
-
*/
|
250 |
-
|
251 |
-
// add actions that are revealed on mouse over
|
252 |
-
var html = "";
|
253 |
-
html += " <span title='"+cmstpv_l10n.Edit_page+"' class='cms_tpv_action_edit'>"+cmstpv_l10n.Edit+"</span>";
|
254 |
-
html += " <span title='"+cmstpv_l10n.View_page+"' class='cms_tpv_action_view'>"+cmstpv_l10n.View+"</span>";
|
255 |
-
|
256 |
-
html += " <span class='cms_tpv_action_add_page'>"+cmstpv_l10n.Add_page+":</span>";
|
257 |
-
html += " <span title='"+cmstpv_l10n.Add_new_page_after+"' class='cms_tpv_action_add_page_after'>"+cmstpv_l10n.after+"</span> ";
|
258 |
-
html += " <span title='"+cmstpv_l10n.Add_new_page_inside+"' class='cms_tpv_action_add_page_inside'>"+cmstpv_l10n.inside+"</span>";
|
259 |
-
aFirst.append(html);
|
260 |
|
261 |
});
|
262 |
}
|
1 |
|
2 |
+
var cms_tpv_tree, treeOptions, div_actions;
|
3 |
jQuery(function($) {
|
4 |
|
5 |
cms_tpv_tree = $("#cms_tpv_container");
|
6 |
+
div_actions = $("#cms_tpv_page_actions");
|
7 |
|
8 |
/**
|
9 |
* show div with options
|
60 |
|
61 |
|
62 |
// view page on click
|
63 |
+
/*
|
64 |
jQuery(".cms_tpv_action_view").live("click", function() {
|
65 |
var $li = jQuery(this).closest("li");
|
66 |
var permalink = $li.data("jstree").permalink;
|
79 |
}
|
80 |
return false;
|
81 |
});
|
82 |
+
*/
|
83 |
|
84 |
// add page after
|
85 |
jQuery(".cms_tpv_action_add_page_after").live("click", function() {
|
86 |
var $this = jQuery(this);
|
87 |
jPrompt(cmstpv_l10n.Enter_title_of_new_page, "", "CMS Tree Page View", function(new_page_title) {
|
88 |
if (new_page_title) {
|
89 |
+
var pageID = $this.parents("li:first").attr("id");
|
90 |
jQuery.post(ajaxurl, {
|
91 |
action: "cms_tpv_add_page",
|
92 |
pageID: pageID,
|
106 |
var $this = jQuery(this);
|
107 |
jPrompt(cmstpv_l10n.Enter_title_of_new_page, "", "CMS Tree Page View", function(new_page_title) {
|
108 |
if (new_page_title) {
|
109 |
+
var pageID = $this.parents("li:first").attr("id");
|
110 |
jQuery.post(ajaxurl, {
|
111 |
action: "cms_tpv_add_page",
|
112 |
pageID: pageID,
|
131 |
}
|
132 |
|
133 |
// mouse over, show actions
|
134 |
+
jQuery(".jstree li").live("mouseover", function(e) {
|
135 |
+
$li = jQuery(this);
|
136 |
+
//$actions = $t.find(".cms_tpv_action_view, .cms_tpv_action_edit, .cms_tpv_action_add_page, .cms_tpv_action_add_page_after, .cms_tpv_action_add_page_inside");
|
|
|
137 |
if (cms_tpv_is_dragging() == false) {
|
138 |
+
|
139 |
+
if (div_actions.is(":visible")) {
|
140 |
+
// do nada
|
141 |
+
//console.log("it's visible");
|
142 |
+
} else {
|
143 |
+
//console.log("it's not visible");
|
144 |
+
|
145 |
+
$li.find("a:first").addClass("hover");
|
146 |
+
|
147 |
+
// setup links
|
148 |
+
|
149 |
+
// view page
|
150 |
+
$view = div_actions.find(".cms_tpv_action_view");
|
151 |
+
var permalink = $li.data("jstree").permalink;
|
152 |
+
$view.attr("href", permalink);
|
153 |
+
|
154 |
+
// edit page
|
155 |
+
$edit = div_actions.find(".cms_tpv_action_edit");
|
156 |
+
var editlink = $li.data("jstree").editlink;
|
157 |
+
$edit.attr("href", editlink);
|
158 |
+
|
159 |
+
// ..and some extras
|
160 |
+
jQuery("#cms_tpv_page_actions_modified_time").text($li.data("jstree").modified_time);
|
161 |
+
jQuery("#cms_tpv_page_actions_modified_by").text($li.data("jstree").modified_author);
|
162 |
+
jQuery("#cms_tpv_page_actions_page_id").text($li.data("jstree").post_id);
|
163 |
+
|
164 |
+
// position and show action div
|
165 |
+
var $a = $li.find("a");
|
166 |
+
var width = $a.outerWidth(true);
|
167 |
+
$li.append(div_actions);
|
168 |
+
left = width+28;
|
169 |
+
top = -3;
|
170 |
+
div_actions.css("left", left);
|
171 |
+
div_actions.css("top", top);
|
172 |
+
div_actions.show();
|
173 |
+
}
|
174 |
}
|
175 |
});
|
176 |
// ..and hide them again
|
177 |
+
jQuery(".jstree li").live("mouseout", function() {
|
178 |
+
$li = jQuery(this);
|
179 |
+
$li.find("a:first").removeClass("hover");
|
180 |
+
div_actions.hide();
|
181 |
});
|
182 |
|
183 |
|
259 |
}
|
260 |
|
261 |
// add number of children
|
262 |
+
if (li.data("jstree")) {
|
263 |
+
var childCount = li.data("jstree").childCount;
|
264 |
+
if (childCount > 0) {
|
265 |
+
aFirst.append("<span title='" + childCount + " " + cmstpv_l10n.child_pages + "' class='child_count'>("+childCount+")</span>");
|
266 |
+
}
|
267 |
+
|
268 |
+
// add protection type
|
269 |
+
var rel = li.data("jstree").rel;
|
270 |
+
if(rel == "password") {
|
271 |
+
aFirst.find("ins").after("<span class='post_protected' title='" + cmstpv_l10n.Password_protected_page + "'> </span>");
|
272 |
+
}
|
273 |
+
|
274 |
+
// add page type
|
275 |
+
var post_status = li.data("jstree").post_status;
|
276 |
+
if (post_status != "publish") {
|
277 |
+
aFirst.find("ins").first().after("<span class='post_type post_type_"+post_status+"'>" + cmstpv_l10n["Status_"+post_status] + "</span>");
|
278 |
+
}
|
279 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
|
281 |
});
|
282 |
}
|
scripts/themes/wordpress/style.css
CHANGED
@@ -65,8 +65,17 @@
|
|
65 |
padding-top: 4px;
|
66 |
padding-bottom: 4px;
|
67 |
}
|
|
|
68 |
.jstree a:hover {
|
69 |
background-color: #e7f4f9;
|
70 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
/* TODO: IE6 support - the `>` selectors */
|
65 |
padding-top: 4px;
|
66 |
padding-bottom: 4px;
|
67 |
}
|
68 |
+
/*
|
69 |
.jstree a:hover {
|
70 |
background-color: #e7f4f9;
|
71 |
}
|
72 |
+
*/
|
73 |
+
|
74 |
+
.jstree li.hover a,
|
75 |
+
.jstree li a.hover
|
76 |
+
{
|
77 |
+
background-color: #e7f4f9;
|
78 |
+
}
|
79 |
+
|
80 |
|
81 |
/* TODO: IE6 support - the `>` selectors */
|
styles/images/arrow-left.gif
ADDED
Binary file
|
styles/styles.css
CHANGED
@@ -32,6 +32,7 @@
|
|
32 |
clear: both;
|
33 |
}
|
34 |
|
|
|
35 |
span.cms_tpv_action_edit,
|
36 |
li span.cms_tpv_action_view,
|
37 |
li span.cms_tpv_action_add_page_after,
|
@@ -52,6 +53,7 @@ li span.cms_tpv_action_add_page {
|
|
52 |
padding: 0 0 0 .5em;
|
53 |
color: #666;
|
54 |
}
|
|
|
55 |
|
56 |
.cms-tree-view-search
|
57 |
{
|
@@ -62,22 +64,6 @@ li span.cms_tpv_action_add_page {
|
|
62 |
}
|
63 |
|
64 |
|
65 |
-
.cms_tpv_action_edit,
|
66 |
-
.cms_tpv_action_view,
|
67 |
-
.cms_tpv_action_add_page_after,
|
68 |
-
.cms_tpv_action_add_page_inside
|
69 |
-
{
|
70 |
-
color: #21759B !important;
|
71 |
-
}
|
72 |
-
|
73 |
-
.cms_tpv_action_edit:hover,
|
74 |
-
.cms_tpv_action_view:hover,
|
75 |
-
.cms_tpv_action_add_page_after:hover,
|
76 |
-
.cms_tpv_action_add_page_inside:hover
|
77 |
-
{
|
78 |
-
color: #d54e21 !important;
|
79 |
-
}
|
80 |
-
|
81 |
.jstree a ins {
|
82 |
cursor: move;
|
83 |
}
|
@@ -214,4 +200,68 @@ p#cms_tpv_annoying_little_box_close {
|
|
214 |
font-size: .8em;
|
215 |
margin-top: -1em;
|
216 |
margin-right: -.5em;
|
217 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
clear: both;
|
33 |
}
|
34 |
|
35 |
+
/*
|
36 |
span.cms_tpv_action_edit,
|
37 |
li span.cms_tpv_action_view,
|
38 |
li span.cms_tpv_action_add_page_after,
|
53 |
padding: 0 0 0 .5em;
|
54 |
color: #666;
|
55 |
}
|
56 |
+
*/
|
57 |
|
58 |
.cms-tree-view-search
|
59 |
{
|
64 |
}
|
65 |
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
.jstree a ins {
|
68 |
cursor: move;
|
69 |
}
|
200 |
font-size: .8em;
|
201 |
margin-top: -1em;
|
202 |
margin-right: -.5em;
|
203 |
+
}
|
204 |
+
|
205 |
+
#cms_tpv_page_actions {
|
206 |
+
width: auto;
|
207 |
+
height: auto;
|
208 |
+
background-color: white;
|
209 |
+
position: absolute;
|
210 |
+
top: 0;
|
211 |
+
white-space: normal;
|
212 |
+
z-index: 100;
|
213 |
+
padding: 7px;
|
214 |
+
display: none;
|
215 |
+
-moz-box-shadow: 2px 2px 8px #ddd; /* FF3.5+ */
|
216 |
+
border: 1px solid #bbb;
|
217 |
+
}
|
218 |
+
#cms_tpv_page_actions p {
|
219 |
+
margin: 0 0 .5em 0;
|
220 |
+
}
|
221 |
+
#cms_tpv_page_actions a {
|
222 |
+
display: inline;
|
223 |
+
background: transparent;
|
224 |
+
text-decoration: underline;
|
225 |
+
padding: 0;
|
226 |
+
color: #21759B;
|
227 |
+
}
|
228 |
+
|
229 |
+
#cms_tpv_page_actions a:hover
|
230 |
+
{
|
231 |
+
color: #d54e21;
|
232 |
+
}
|
233 |
+
|
234 |
+
#cms_tpv_page_actions ul {
|
235 |
+
display: block;
|
236 |
+
overflow: auto;
|
237 |
+
margin: 0 0 1em 0;
|
238 |
+
}
|
239 |
+
#cms_tpv_page_actions li {
|
240 |
+
padding: 0;
|
241 |
+
margin: 0;
|
242 |
+
background: none;
|
243 |
+
display: inline;
|
244 |
+
}
|
245 |
+
.cms_tpv_action_add_page {
|
246 |
+
display: block;
|
247 |
+
}
|
248 |
+
#cms_tpv_page_actions dl {
|
249 |
+
margin-top: 1em;
|
250 |
+
color: #333;
|
251 |
+
font-size: 11px;
|
252 |
+
}
|
253 |
+
#cms_tpv_page_actions dl dd {
|
254 |
+
}
|
255 |
+
#cms_tpv_page_actions dl dt {
|
256 |
+
color: #999;
|
257 |
+
}
|
258 |
+
|
259 |
+
#cms_tpv_page_actions_arrow {
|
260 |
+
width: 8px;
|
261 |
+
height: 15px;
|
262 |
+
background: url(images/arrow-left.gif) no-repeat top left;
|
263 |
+
position: absolute;
|
264 |
+
display: block;
|
265 |
+
top: 7px;
|
266 |
+
left: -8px;
|
267 |
+
}
|