WordPress.org

Plugin Directory

Changeset 623479


Ignore:
Timestamp:
11/10/12 21:00:37 (18 months ago)
Author:
eskapism
Message:

stuff

Location:
cms-tree-page-view/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • cms-tree-page-view/trunk/functions.php

    r552373 r623479  
    66 
    77function cms_tpv_admin_head() { 
     8 
     9    if (!cms_tpv_is_one_of_our_pages()) return; 
    810 
    911    global $cms_tpv_view; 
     
    3537} 
    3638 
     39/** 
     40 * Detect if we are on a page that use CMS Tree Page View 
     41 */ 
     42function cms_tpv_is_one_of_our_pages() { 
     43 
     44    $options = cms_tpv_get_options(); 
     45    $post_type = cms_tpv_get_selected_post_type(); 
     46    $current_screen = get_current_screen(); # sf_d($current_screen); 
     47    $is_plugin_page = FALSE; 
     48 
     49    // Check if current page is one of the ones defined in $options["menu"] 
     50    foreach ($options["menu"] as $one_post_type) { 
     51        if ( strpos($current_screen->id, "_page_cms-tpv-page-{$one_post_type}") !== FALSE) { 
     52            $is_plugin_page = TRUE; 
     53            break; 
     54        } 
     55    } 
     56 
     57    if ($current_screen->id === "settings_page_cms-tpv-options") { 
     58        // Is settings page for plugin 
     59        $is_plugin_page = TRUE; 
     60    } elseif ($current_screen->id === "dashboard" && !empty($options["dashboard"])) { 
     61        $is_plugin_page = TRUE; 
     62    } 
     63 
     64    return $is_plugin_page; 
     65 
     66} 
     67 
     68/** 
     69 * Add styles and scripts to pages that use the plugin 
     70 */ 
    3771function cms_admin_enqueue_scripts() { 
    3872 
    39     wp_enqueue_script( "jquery-cookie", CMS_TPV_URL . "scripts/jquery.biscuit.js", array("jquery")); // renamed from cookie to fix problems with mod_security 
    40     wp_enqueue_script( "jquery-jstree", CMS_TPV_URL . "scripts/jquery.jstree.js", false, CMS_TPV_VERSION); 
    41     wp_enqueue_script( "jquery-alerts", CMS_TPV_URL . "scripts/jquery.alerts.js", false, CMS_TPV_VERSION); 
    42     wp_enqueue_script( "jquery-hoverintent", CMS_TPV_URL . "scripts/jquery.hoverIntent.minified.js", false, CMS_TPV_VERSION); 
    43     #wp_enqueue_script( "jquery-ui-dialog", CMS_TPV_URL . "scripts/jquery.ui.dialog.min.js", false, CMS_TPV_VERSION); 
    44     wp_enqueue_script( "cms_tree_page_view", CMS_TPV_URL . "scripts/cms_tree_page_view.js", false, CMS_TPV_VERSION);     
    45  
    46     // @todo: only load these when we do show a tree, ie. on the dashboard or showing the tree for a post type 
    47     // see: http://devpress.com/blog/how-to-load-javascript-in-the-wordpress-admin/ 
    48     // admin_enqueue_scripts-hook? 
    49     wp_enqueue_style( "cms_tpv_styles", CMS_TPV_URL . "styles/styles.css", false, CMS_TPV_VERSION ); 
    50     wp_enqueue_style( "jquery-alerts", CMS_TPV_URL . "styles/jquery.alerts.css", false, CMS_TPV_VERSION ); 
    51  
    52     $oLocale = array( 
    53         "Enter_title_of_new_page" => __("Enter title of new page", 'cms-tree-page-view'), 
    54         "child_pages"  => __("child pages", 'cms-tree-page-view'), 
    55         "Edit_page"  => __("Edit page", 'cms-tree-page-view'), 
    56         "View_page"  => __("View page", 'cms-tree-page-view'), 
    57         "Edit"  => __("Edit", 'cms-tree-page-view'), 
    58         "View"  => __("View", 'cms-tree-page-view'), 
    59         "Add_page"  => __("Add page", 'cms-tree-page-view'), 
    60         "Add_new_page_after"  => __("Add new page after", 'cms-tree-page-view'), 
    61         "after"  => __("after", 'cms-tree-page-view'), 
    62         "inside"  => __("inside", 'cms-tree-page-view'), 
    63         "Can_not_add_sub_page_when_status_is_draft"  => __("Sorry, can't create a sub page to a page with status \"draft\".", 'cms-tree-page-view'), 
    64         "Can_not_add_sub_page_when_status_is_trash"  => __("Sorry, can't create a sub page to a page with status \"trash\".", 'cms-tree-page-view'), 
    65         "Can_not_add_page_after_when_status_is_trash"  => __("Sorry, can't create a page after a page with status \"trash\".", 'cms-tree-page-view'), 
    66         "Add_new_page_inside"  => __("Add new page inside", 'cms-tree-page-view'), 
    67         "Status_draft" => __("draft", 'cms-tree-page-view'), 
    68         "Status_future" => __("future", 'cms-tree-page-view'), 
    69         "Status_password" => __("protected", 'cms-tree-page-view'), // is "protected" word better than "password" ? 
    70         "Status_pending" => __("pending", 'cms-tree-page-view'), 
    71         "Status_private" => __("private", 'cms-tree-page-view'), 
    72         "Status_trash" => __("trash", 'cms-tree-page-view'), 
    73         "Password_protected_page" => __("Password protected page", 'cms-tree-page-view'), 
    74         "Adding_page" => __("Adding page...", 'cms-tree-page-view'), 
    75     ); 
    76     wp_localize_script( "cms_tree_page_view", 'cmstpv_l10n', $oLocale); 
    77  
     73 
     74    if (cms_tpv_is_one_of_our_pages()) { 
     75 
     76        wp_enqueue_script( "jquery-cookie", CMS_TPV_URL . "scripts/jquery.biscuit.js", array("jquery")); // renamed from cookie to fix problems with mod_security 
     77        wp_enqueue_script( "jquery-jstree", CMS_TPV_URL . "scripts/jquery.jstree.js", false, CMS_TPV_VERSION); 
     78        wp_enqueue_script( "jquery-alerts", CMS_TPV_URL . "scripts/jquery.alerts.js", false, CMS_TPV_VERSION); 
     79        wp_enqueue_script( "jquery-hoverintent", CMS_TPV_URL . "scripts/jquery.hoverIntent.minified.js", false, CMS_TPV_VERSION); 
     80        wp_enqueue_script( "cms_tree_page_view", CMS_TPV_URL . "scripts/cms_tree_page_view.js", false, CMS_TPV_VERSION);     
     81 
     82        wp_enqueue_style( "cms_tpv_styles", CMS_TPV_URL . "styles/styles.css", false, CMS_TPV_VERSION ); 
     83        wp_enqueue_style( "jquery-alerts", CMS_TPV_URL . "styles/jquery.alerts.css", false, CMS_TPV_VERSION ); 
     84 
     85        $oLocale = array( 
     86            "Enter_title_of_new_page" => __("Enter title of new page", 'cms-tree-page-view'), 
     87            "child_pages"  => __("child pages", 'cms-tree-page-view'), 
     88            "Edit_page"  => __("Edit page", 'cms-tree-page-view'), 
     89            "View_page"  => __("View page", 'cms-tree-page-view'), 
     90            "Edit"  => __("Edit", 'cms-tree-page-view'), 
     91            "View"  => __("View", 'cms-tree-page-view'), 
     92            "Add_page"  => __("Add page", 'cms-tree-page-view'), 
     93            "Add_new_page_after"  => __("Add new page after", 'cms-tree-page-view'), 
     94            "after"  => __("after", 'cms-tree-page-view'), 
     95            "inside"  => __("inside", 'cms-tree-page-view'), 
     96            "Can_not_add_sub_page_when_status_is_draft"  => __("Sorry, can't create a sub page to a page with status \"draft\".", 'cms-tree-page-view'), 
     97            "Can_not_add_sub_page_when_status_is_trash"  => __("Sorry, can't create a sub page to a page with status \"trash\".", 'cms-tree-page-view'), 
     98            "Can_not_add_page_after_when_status_is_trash"  => __("Sorry, can't create a page after a page with status \"trash\".", 'cms-tree-page-view'), 
     99            "Add_new_page_inside"  => __("Add new page inside", 'cms-tree-page-view'), 
     100            "Status_draft" => __("draft", 'cms-tree-page-view'), 
     101            "Status_future" => __("future", 'cms-tree-page-view'), 
     102            "Status_password" => __("protected", 'cms-tree-page-view'), // is "protected" word better than "password" ? 
     103            "Status_pending" => __("pending", 'cms-tree-page-view'), 
     104            "Status_private" => __("private", 'cms-tree-page-view'), 
     105            "Status_trash" => __("trash", 'cms-tree-page-view'), 
     106            "Status_draft_ucase" => ucfirst( __("draft", 'cms-tree-page-view') ), 
     107            "Status_future_ucase" => ucfirst( __("future", 'cms-tree-page-view') ), 
     108            "Status_password_ucase" => ucfirst( __("protected", 'cms-tree-page-view') ),    // is "protected" word better than "password" ? 
     109            "Status_pending_ucase" => ucfirst( __("pending", 'cms-tree-page-view') ), 
     110            "Status_private_ucase" => ucfirst( __("private", 'cms-tree-page-view') ), 
     111            "Status_trash_ucase" => ucfirst( __("trash", 'cms-tree-page-view') ), 
     112            "Password_protected_page" => __("Password protected page", 'cms-tree-page-view'), 
     113            "Adding_page" => __("Adding page...", 'cms-tree-page-view'), 
     114        ); 
     115        wp_localize_script( "cms_tree_page_view", 'cmstpv_l10n', $oLocale); 
     116 
     117    } 
    78118 
    79119} 
     
    97137        update_option('cms_tpv_options', $options); // enable this to show box 
    98138    } 
    99     /* 
    100  [post-type-dashboard] => Array 
    101         ( 
    102             [0] => post 
    103             [1] => page 
    104         ) 
    105  
    106     [post-type-menu] => Array 
    107         ( 
    108             [0] => post 
    109             [1] => page 
    110         ) 
    111  
    112     */ 
    113 } 
    114  
     139} 
     140 
     141/** 
     142 * Add widget to dashboard 
     143 */ 
    115144function cms_tpv_wp_dashboard_setup() { 
    116145    // add dashboard to capability edit_pages only 
     
    120149            $post_type_object = get_post_type_object($one_dashboard_post_type); 
    121150            $new_func_name = create_function('', "cms_tpv_dashboard('$one_dashboard_post_type');"); 
    122             wp_add_dashboard_widget( "cms_tpv_dashboard_widget_{$one_dashboard_post_type}", $post_type_object->labels->name . " Tree View", $new_func_name ); 
     151            $widget_name = _x(sprintf('%1$s Tree', $post_type_object->labels->name), "name of dashboard", "cms-tree-page-view"); 
     152            wp_add_dashboard_widget( "cms_tpv_dashboard_widget_{$one_dashboard_post_type}", $widget_name, $new_func_name ); 
    123153        } 
    124154    } 
     
    130160 */ 
    131161function cms_tpv_dashboard($post_type = "") { 
    132     // cms_tpv_show_annoying_box(); 
     162    //cms_tpv_show_annoying_box(); 
    133163    cms_tpv_print_common_tree_stuff($post_type); 
    134164} 
     
    146176        } 
    147177        $post_type_object = get_post_type_object($one_menu_post_type); 
    148         // print_r($post_type_object); 
    149         add_submenu_page($slug, $post_type_object->labels->name . " Tree View", $post_type_object->labels->name . " Tree View", $post_type_object->cap->edit_posts, "cms-tpv-page-$one_menu_post_type", "cms_tpv_pages_page"); 
     178         
     179        $menu_name = _x("Tree View", "name in menu", "cms-tree-page-view"); 
     180        $page_title = _x(sprintf('%1$s Tree View', $post_type_object->labels->name), "title on page with tree", "cms-tree-page-view"); 
     181        add_submenu_page($slug, $page_title, $menu_name, $post_type_object->cap->edit_posts, "cms-tpv-page-$one_menu_post_type", "cms_tpv_pages_page"); 
    150182    } 
    151183 
     
    160192function cms_tpv_options() { 
    161193 
    162 /* 
    163 // Just som testing stuff 
    164 $args = array( 
    165     "numberposts" => "-1", 
    166     "orderby" => "menu_order", 
    167     "order" => "ASC", 
    168     "caller_get_posts" => 1, // get sticky posts in natural order (or so I understand it anyway) 
    169     "post_status" => "publish", // "any" seems to get all but auto-drafts 
    170     "post_type" => "page" 
    171 ); 
    172 $posts = get_pages($args); // works 
    173 // $posts = get_posts($args); // does not work 
    174 var_dump($posts); 
    175 echo "num of posts: " . sizeof($posts); 
    176 foreach ($posts as $one_post) { 
    177     #bonny_d($one_post); 
    178     echo "<br><br>title: " . esc_html($one_post->post_title); 
    179     echo "<br>status: " . $one_post->post_status; 
    180     echo "<br>type: " . $one_post->post_type; 
    181 } 
    182 // */ 
    183  
    184194    ?> 
    185195    <div class="wrap"> 
    186196     
     197        <?php cms_tpv_show_annoying_box(); ?> 
     198         
    187199        <h2><?php echo CMS_TPV_NAME ?> <?php _e("settings", 'cms-tree-page-view') ?></h2> 
    188200 
     
    258270    if (!$post_type) { 
    259271        // no post type, happens with ozh admin drop down, so get it via page instead 
    260         $page = $_GET["page"]; 
     272        $page = isset($_GET["page"]) ? $_GET["page"] : ""; 
    261273        $post_type = str_replace("cms-tpv-page-", "", $page); 
    262274    } 
     
    452464    $post_type = cms_tpv_get_selected_post_type(); 
    453465    $post_type_object = get_post_type_object($post_type); 
    454  
     466     
    455467    ?> 
    456468    <div class="wrap"> 
    457         <h2><?php echo ($post_type_object->labels->name); ?> Tree View</h2> 
     469        <?php echo get_screen_icon(); ?> 
     470        <h2><?php 
     471            $page_title = _x(sprintf('%1$s Tree View', $post_type_object->labels->name), "headline of page with tree", "cms-tree-page-view"); 
     472            echo $page_title; 
     473        ?></h2> 
    458474         
    459475        <?php 
     
    600616        global $post; 
    601617         
     618        // Translated post statuses 
     619        $post_statuses = get_post_statuses(); 
     620 
    602621        #cms_tpv_firedebug(timer_stop()); 
    603622         
     
    728747                    "post_type": "<?php echo $onePage->post_type ?>", 
    729748                    "post_status": "<?php echo $onePage->post_status ?>", 
     749                    "post_status_translated": "<?php echo isset($post_statuses[$onePage->post_status]) ? $post_statuses[$onePage->post_status] : $onePage->post_status  ?>", 
    730750                    "rel": "<?php echo $rel ?>", 
    731751                    "childCount": <?php echo ( !empty( $arrChildPages ) ) ? sizeof( $arrChildPages ) : 0 ; ?>, 
     
    10441064 */ 
    10451065function cms_tpv_show_annoying_box() { 
    1046     #update_option('cms_tpv_show_annoying_little_box', 1); // enable this to show box 
     1066     
     1067    // update_option('cms_tpv_show_annoying_little_box', 1); // enable this to show box while testing 
     1068 
    10471069    if ( isset($_GET["action"]) && "cms_tpv_remove_annoying_box" == $_GET["action"] ) { 
    10481070        $show_box = 0; 
     
    10541076        ?> 
    10551077        <div class="cms_tpv_annoying_little_box"> 
    1056             <p class="cms_tpv_annoying_little_box_close"><a href="<?php echo add_query_arg("action", "cms_tpv_remove_annoying_box")?>"><?php _e("Close", 'cms-tree-page-view') ?></a></p> 
    1057             <p><?php _e('<strong>Thank you for using this plugin!</strong> If you need help please check out the <a href="http://eskapism.se/code-playground/cms-tree-page-view/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox">plugin homepage</a> or the <a href="http://wordpress.org/tags/cms-tree-page-view?forum_id=10">support forum</a>.', 'cms-tree-page-view') ?></p> 
    1058             <p><?php _e('If you like this plugin, please <a href="http://eskapism.se/sida/donate/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox">support my work by donating</a> - or at least say something nice about this plugin in a blog post or tweet.', 'cms-tree-page-view') ?></p> 
     1078 
     1079            <h3><?php _e('Thanks for using my plugin', 'cms-tree-page-view') ?></h3> 
     1080            <p class="cms_tpv_annoying_little_box_gravatar"><a href="https://twitter.com/eskapism"><?php echo get_avatar("par.thernstrom@gmail.com", '64'); ?></a></p> 
     1081            <p><?php _e('Hi there! I just wanna says thanks for using my plugin. I hope you like it as much as I do.', 'cms-tree-page-view') ?></p> 
     1082            <p class="cms_tpv_annoying_little_box_author"><a href="https://twitter.com/eskapism"><?php _e('/Pär Thernström - plugin creator', 'cms-tree-page-view') ?></a></p> 
     1083 
     1084            <h3><?php _e('I like this plugin<br>– how can I thank you?', 'cms-tree-page-view') ?></h3> 
     1085            <p><?php _e('There are serveral ways for you to show your appreciation:', 'cms-tree-page-view') ?></p> 
     1086            <ul> 
     1087                <li><?php printf(__('<a href="%1$s">Give it a nice review</a> over at the WordPress Plugin Directory', 'cms-tree-page-view'), "http://wordpress.org/support/view/plugin-reviews/cms-tree-page-view") ?></li> 
     1088                <li><?php printf(__('<a href="%1$s">Give a donation</a> – any amount will make me happy', 'cms-tree-page-view'), "http://eskapism.se/sida/donate/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox") ?></li> 
     1089                <li><?php printf(__('<a href="%1$s">Post a nice tweet</a> or make a nice blog post about the plugin', 'cms-tree-page-view'), "https://twitter.com/intent/tweet?text=I really like the CMS Tree Page View plugin for WordPress http://wordpress.org/extend/plugins/cms-tree-page-view/") ?></li> 
     1090            </ul> 
     1091 
     1092            <h3><?php _e('Support', 'cms-tree-page-view') ?></h3> 
     1093            <p><?php printf(__('Plese see the <a href="%1$s">support forum</a> for help.', 'cms-tree-page-view'), "http://wordpress.org/support/plugin/cms-tree-page-view") ?></p> 
     1094 
     1095            <p class="cms_tpv_annoying_little_box_close"> 
     1096                <a href="<?php echo add_query_arg("action", "cms_tpv_remove_annoying_box")?>"> 
     1097                    <?php _e("Hide until next upgrade", 'cms-tree-page-view') ?> 
     1098                </a> 
     1099            </p> 
    10591100        </div> 
    10601101        <?php 
  • cms-tree-page-view/trunk/readme.txt

    r596679 r623479  
    44Tags: page, pages, posts, custom posts, tree, cms, dashboard, overview, drag-and-drop, rearrange, management, manage, admin 
    55Requires at least: 3.0 
    6 Tested up to: 3.4.2 
     6Tested up to: 3.5 
    77Stable tag: 0.8.14 
    88 
     
    8787== Changelog == 
    8888 
     89= 0.8.x = 
     90- Only output scripts and styles on pages that the plugin uses. This should speed up other parts of the WordPress admin a little tiny itsy bitsy bit. 
     91- Added a hopefully not to spammy box about donation and stuff. Hopefully it it encourages some of you to give it a good review or maybe even donate some money. I've spent a lot, lot, LOT of time developing this plugin you know ;) 
     92- Changed title on dashboard widgets and changed name of the menu item under each supported post type. Makes the titles/names look/feel a bit less dorky. 
     93- Show icons next to the headline of top of pages with the tree 
     94- Minor CSS changes like a little bit bigger text on the pages and a bit more spacing between each page. Makes a bit easier to drag and drop/move them around. 
     95- Changed javascript to to use on() istead on live() 
     96 
    8997= 0.8.14 = 
    9098- Added Estonian translation 
  • cms-tree-page-view/trunk/scripts/cms_tree_page_view.js

    r359498 r623479  
    44jQuery(function($) { 
    55     
    6     cms_tpv_tree = $(".cms_tpv_container"); 
    7     div_actions = $(".cms_tpv_page_actions"); 
     6    cms_tpv_tree = $("div.cms_tpv_container"); 
     7    div_actions = $("div.cms_tpv_page_actions"); 
     8 
     9    // try to override css 
     10    var height = "20", height2 = "18", ins_height = "18"; 
     11    css_string = '' +  
     12        '.jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } ' +  
     13        '.jstree li { display:block; min-height:'+height+'px; line-height:'+height+'px; white-space:nowrap; margin-left:18px; min-width:18px; } ' +  
     14        '.jstree-rtl li { margin-left:0; margin-right:18px; } ' +  
     15        '.jstree > ul > li { margin-left:0px; } ' +  
     16        '.jstree-rtl > ul > li { margin-right:0px; } ' +  
     17        '.jstree ins { display:inline-block; text-decoration:none; width:18px; height:'+height+'px; margin:0 0 0 0; padding:0; } ' +  
     18        '.jstree a { display:inline-block; line-height:'+height2+'px; height:'+height2+'px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } ' +  
     19        '.jstree a:focus { outline: none; } ' +  
     20        '.jstree a > ins { height:'+ins_height+'px; width:16px; } ' +  
     21        '.jstree a > .jstree-icon { margin-right:3px; } ' +  
     22        '.jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } ' +  
     23        'li.jstree-open > ul { display:block; } ' +  
     24        'li.jstree-closed > ul { display:none; } '; 
     25    $.vakata.css.add_sheet({ 
     26        str : css_string, 
     27        title : "jstree_cms_tpv" 
     28    }); 
    829 
    930    treeOptions = { 
    10         xplugins: ["cookie","ui","crrm","themes","json_data","search","types","dnd"], 
    1131        plugins: ["themes","json_data","cookies","search","dnd", "types"], 
    1232        core: { 
     
    1838                // this function is executed in the instance's scope (this refers to the tree instance) 
    1939                // the parameter is the node being loaded (may be -1, 0, or undefined when loading the root nodes) 
    20                 "data" : function (n) {  
     40                "data" : function (n) { 
    2141                    // the result is fed to the AJAX request `data` option 
    2242                    if (n.data) { 
     
    2444                        return { 
    2545                            "id": post_id 
    26                         } 
     46                        }; 
    2747                    } 
    2848                } 
    2949 
    3050            } 
    31             /* 
    32             // data can be initially set like this 
    33             // but it has to be set by type... 
    34             "data": [{ 
    35                 "data": { 
    36                     "title": "I am a new page", 
    37                     "attr": { 
    38                         "href": "http://localhost/wp-admin/post.php?post=1060&action=edit", 
    39                         "xid": "cms-tpv-1060" 
    40                     }, 
    41                     "xicon": "http://localhost/wp-content/plugins/cms-tree-page-view/images/page_white_text.png" 
    42                 }, 
    43                 "attr": { 
    44                     "xhref": "http://localhost/wp-admin/post.php?post=1060&action=edit", 
    45                     "id": "cms-tpv-1060", 
    46                     "xtitle": "Click to edit. Drag to move.", 
    47                     "class": "cms_tpv_user_can_edit_page_yes" 
    48                 }, 
    49                                 "metadata": { 
    50                     "id": "cms-tpv-1060", 
    51                     "post_id": "1060", 
    52                     "post_type": "page", 
    53                     "post_status": "publish", 
    54                     "rel": "publish", 
    55                     "childCount": 0, 
    56                     "permalink": "http://localhost/i-am-a-new-page/", 
    57                     "editlink": "http://localhost/wp-admin/post.php?post=1060&action=edit", 
    58                     "modified_time": "August 15, 2010", 
    59                     "modified_author": "admin", 
    60                     "columns": "%3Cdl%3E%3Cdt%3EComments%3C%2Fdt%3E%3Cdd%3E%3Cdiv%20class%3D%22post-com-count-wrapper%22%3E%3Ca%20href%3D%27edit-comments.php%3Fp%3D1060%27%20title%3D%270%20pending%27%3E%3Cspan%3E0%3C%2Fspan%3E%3C%2Fa%3E%3C%2Fdiv%3E%3C%2Fdd%3E%3C%2Fdl%3E", 
    61                     "user_can_edit_page": "1" 
    62                 } 
    63                  
    64             } 
    65         ]*/ 
     51 
    6652        }, 
    6753        "themes": { 
    68             "theme": "wordpress" 
     54            "theme": "wordpress", 
     55            "dots": false 
    6956        }, 
    7057        "search": { 
     
    7663        "dnd": { 
    7764        } 
    78     } 
     65    }; 
    7966 
    8067    if (cms_tpv_tree.length > 0) { 
     
    10087                    } 
    10188                } 
    102             } 
     89            }; 
    10390        } 
    10491         
    10592        $elm.bind("search.jstree", function (event, data) { 
    106             if (data.rslt.nodes.length == 0) { 
     93            if (data.rslt.nodes.length === 0) { 
    10794                // no hits. doh. 
    10895                $(this).closest(".cms_tpv_wrapper").find(".cms_tree_view_search_form_no_hits").fadeIn("fast"); 
     
    137124 
    138125 
    139 // add page after 
    140 jQuery(".cms_tpv_action_add_page_after").live("click", function() { 
     126// Click on link to add page after the current page 
     127jQuery(document).on("click", "a.cms_tpv_action_add_page_after", function(e) { 
     128 
    141129    var $this = jQuery(this); 
    142130    var post_type = cms_tpv_get_post_type(this); 
     
    171159}); 
    172160 
    173 // add page inside 
    174 jQuery(".cms_tpv_action_add_page_inside").live("click", function() { 
     161// Click on link to add page insde another page 
     162jQuery(document).on("click", "a.cms_tpv_action_add_page_inside", function(e) { 
    175163    var $this = jQuery(this); 
    176164    var post_type = cms_tpv_get_post_type(this); 
     
    286274} 
    287275 
    288 // mouse over, show actions 
    289 // but only if the mouse not already is over the li (don't know why it fires multiple times, but it does) 
    290 // 29 August, 2010 this worked nice but it had problems with child-lis... 
    291276/* 
    292 jQuery(".jstree li").live("mouseenter", function(e) { 
    293  
    294     //console.log("mouseenter"); 
    295     var $li = jQuery(this); 
    296     var li_id = $li.attr("id"); 
    297      
    298     // add hoverIntent, if not prev. attached 
    299     if ($li.data("hasHoverIntent")) { 
    300         // already got it 
    301     } else { 
    302         $li.data("hasHoverIntent", true); 
    303         $li.hoverIntent(function() { 
    304             // console.log("over"); 
    305             cms_tpv_mouseover_li(this); 
    306         }, function() { 
    307             console.log("out"); 
    308             //cms_tpv_mouseout_li(this); 
    309         }); 
    310         // lastlt trigger mouseenter again so the popup will show 
    311         $li.trigger("mouseover"); 
    312     } 
    313  
    314 }); 
    315 */ 
    316  
    317277jQuery(".jstree li").live("mouseover", function(e) { 
    318278    var $li = jQuery(this); 
     
    326286    cms_tpv_mouseout_li(this); 
    327287}); 
    328  
     288*/ 
    329289 
    330290// hide action links on drag 
     
    425385                    // check if we have an existing translation for the string, otherwise use the post status directly 
    426386                    var post_status_to_show = ""; 
    427                     if (post_status_to_show = cmstpv_l10n["Status_"+post_status]) { 
     387                    if (post_status_to_show = cmstpv_l10n["Status_"+post_status + "_ucase"]) { 
    428388                        // it's ok 
    429389                    } else { 
     
    440400} 
    441401 
    442 // search: perform 
    443 jQuery(".cms_tree_view_search_form").live("submit", function() { 
     402// Perform search when submiting form 
     403jQuery(document).on("submit", "form.cms_tree_view_search_form", function(e) { 
     404     
    444405    var $wrapper = jQuery(this).closest(".cms_tpv_wrapper"); 
    445406    $wrapper.find(".cms_tpv_search_no_hits").hide(); 
    446407    var s = $wrapper.find(".cms_tree_view_search").attr("value"); 
    447408    s = jQuery.trim( s ); 
    448     // search, oh the mighty search! 
     409 
    449410    if (s) { 
    450411        $wrapper.find(".cms_tree_view_search_form_no_hits").fadeOut("fast"); 
     
    459420    } 
    460421    $wrapper.find(".cms_tree_view_search_form_working").fadeOut("fast"); 
    461     return false; 
    462 }); 
    463  
    464 // search: reset 
    465 jQuery(".cms_tree_view_search_form_reset").live("click", function() { 
     422     
     423    return false; 
     424 
     425}); 
     426 
     427// Reset search when click on x-link 
     428jQuery(document).on("click", "a.cms_tree_view_search_form_reset", function(e) { 
    466429    var $wrapper = jQuery(this).closest(".cms_tpv_wrapper"); 
    467     $wrapper.find(".cms_tree_view_search").val("") 
     430    $wrapper.find(".cms_tree_view_search").val(""); 
    468431    $wrapper.find(".cms_tpv_container").jstree("clear_search"); 
    469432    $wrapper.find(".cms_tree_view_search_form_reset").fadeOut("fast"); 
     
    473436 
    474437// open/close links 
    475 jQuery(".cms_tpv_open_all").live("click", function() { 
     438jQuery(document).on("click", "a.cms_tpv_open_all", function(e) { 
    476439    var $wrapper = jQuery(this).closest(".cms_tpv_wrapper"); 
    477440    $wrapper.find(".cms_tpv_container").jstree("open_all"); 
    478441    return false; 
    479442}); 
    480 jQuery(".cms_tpv_close_all").live("click", function() { 
     443 
     444jQuery(document).on("click", "a.cms_tpv_close_all", function(e) { 
    481445    var $wrapper = jQuery(this).closest(".cms_tpv_wrapper"); 
    482446    $wrapper.find(".cms_tpv_container").jstree("close_all"); 
     
    485449 
    486450// view all or public or trash 
    487 jQuery(".cms_tvp_view_all").live("click", function() { 
     451jQuery(document).on("click", "a.cms_tvp_view_all", function(e) { 
    488452    cms_tvp_set_view("all", this); 
    489453    return false; 
    490454}); 
    491 jQuery(".cms_tvp_view_public").live("click", function() { 
     455 
     456jQuery(document).on("click", "a.cms_tvp_view_public", function(e) { 
    492457    cms_tvp_set_view("public", this); 
    493458    return false; 
    494459}); 
    495 jQuery(".cms_tvp_view_trash").live("click", function() { 
     460 
     461jQuery(document).on("click", "a.cms_tvp_view_trash", function() { 
    496462    cms_tvp_set_view("trash", this); 
    497463    return false; 
     
    500466 
    501467// change lang 
    502 jQuery("a.cms_tvp_switch_lang").live("click", function(e) { 
     468jQuery(document).on("click", "a.cms_tvp_switch_lang", function(e) { 
    503469    $wrapper = cms_tpv_get_wrapper(this); 
    504470    $wrapper.find("ul.cms_tvp_switch_langs a").removeClass("current"); 
     
    518484 
    519485function cms_tpv_get_current_view(elm) { 
     486     
    520487    $wrapper = cms_tpv_get_wrapper(elm); 
     488     
    521489    if ($wrapper.find(".cms_tvp_view_all").hasClass("current")) { 
    522490        return "all"; 
     
    524492        return "public"; 
    525493    } else { 
    526         return false; // like unknown  
     494        return false; // like unknown 
    527495    } 
    528496 
  • cms-tree-page-view/trunk/scripts/jquery.jstree.js

    r356140 r623479  
    6767                    if(opts.title) { tmp.setAttribute("id", opts.title + "-stylesheet"); } 
    6868                } 
     69 
    6970                if(tmp.styleSheet) { 
    7071                    if(is_new) {  
     
    268269    // load the css when DOM is ready 
    269270    $(function() { 
     271 
    270272        // code is copied from jQuery ($.browser is deprecated + there is a bug in IE) 
    271273        var u = navigator.userAgent.toLowerCase(), 
  • cms-tree-page-view/trunk/scripts/themes/wordpress/style.css

    r356140 r623479  
    9090    background-color: #e7f4f9; 
    9191} 
     92 
     93 
  • cms-tree-page-view/trunk/styles/styles.css

    r475010 r623479  
    2020    overflow: visible; 
    2121    margin-top: 1.5em; 
     22    font-size: 13px; 
    2223} 
    2324 
     
    100101    color: #999; 
    101102    border: none; 
    102     font-size: .8em; 
     103    font-size: .9em; 
    103104    margin-left: .5em; 
    104105} 
     
    114115 
    115116.tree-default span.post_type { 
    116     background-color: #f85b11; 
    117     -moz-border-radius: 3px; 
    118     -webkit-border-radius: 3px; 
    119     border-radius: 3px; 
    120     padding: 1px 4px 1px 4px; 
     117    background-color: rgba(248, 98, 16, .75); 
     118    -moz-border-radius: 2px; 
     119    -webkit-border-radius: 2px; 
     120    border-radius: 2px; 
     121    padding: 1px 4px 2px 4px; 
    121122    color: white; 
    122123    border: none; 
     
    128129     
    129130} 
    130 .tree-default span.post_type_password { 
    131     background-color: #25b61a; 
    132 } 
     131.tree-default span.post_type_password, 
    133132.tree-default span.post_type_private { 
    134     background-color: #25b61a; 
     133    background-color: rgba(37, 182, 26, .75); 
    135134} 
    136135.tree-default span.post_type_pending, 
    137136.tree-default span.post_type_future 
    138137{ 
    139     background-color: #0069e0; 
     138    background-color: rgba(0, 105, 224, .75); 
    140139} 
    141140 
     
    212211 
    213212.cms_tpv_annoying_little_box { 
    214     padding: 1em; 
    215     background-color: #FFFBCC; 
    216     border: 1px solid #E6DB55; 
     213    padding: 1.5em; 
     214    background-color: #FAFAFA; 
     215    border: 1px solid #ddd; 
    217216    margin: 1em 0 1em 0; 
    218     -moz-border-radius: 6px; 
    219     -webkit-border-radius: 6px; 
    220     border-radius: 6px; 
    221 } 
    222 .cms_tpv_annoying_little_box p { 
    223     margin: 0 0 .5em 0; 
    224 } 
    225 p.cms_tpv_annoying_little_box_close { 
    226217    float: right; 
    227     margin-left: 2em; 
    228     font-size: .8em; 
    229     margin-top: -1em; 
    230     margin-right: -.5em; 
    231 } 
     218    width: 22em; 
     219} 
     220 
     221    .cms_tpv_annoying_little_box h3:first-of-type { 
     222        margin-top: 0; 
     223    } 
     224 
     225    .cms_tpv_annoying_little_box_author { 
     226        font-style: italic; 
     227    } 
     228 
     229    .cms_tpv_annoying_little_box p { 
     230        margin: 0 0 .5em 0; 
     231    } 
     232 
     233    p.cms_tpv_annoying_little_box_gravatar { 
     234        float: right; 
     235        margin: 0 0 1em 1em; 
     236    } 
     237 
     238    .cms_tpv_annoying_little_box ul { 
     239        list-style-type: disc; 
     240        margin-left: 20px; 
     241    } 
     242 
     243    p.cms_tpv_annoying_little_box_close { 
     244        text-align: right; 
     245        font-size: .8em; 
     246        margin-top: 1.5em; 
     247        margin-bottom: 0; 
     248    } 
    232249 
    233250.cms_tpv_page_actions { 
Note: See TracChangeset for help on using the changeset viewer.