WordPress.org

Plugin Directory

Changeset 631434


Ignore:
Timestamp:
11/28/12 20:16:15 (17 months ago)
Author:
eskapism
Message:

version 1.1

Location:
cms-tree-page-view
Files:
4 edited
8 copied

Legend:

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

    r630338 r631434  
    655655 
    656656            ?> 
    657             <ul class="cms-tpv-subsubsub hidden"> 
    658                 <li> 
    659                     <a class="cms_tvp_view_all <?php echo ($cms_tpv_view=="all") ? "current" : "" ?>" href="#" <?php echo $status_data_attributes["all"] ?>> 
     657            <ul class="cms-tpv-subsubsub cms-tpv-subsubsub-select-view"> 
     658                <li class="cms_tvp_view_is_status_view"> 
     659                    <a class="cms_tvp_view_all  <?php echo ($cms_tpv_view=="all") ? "current" : "" ?>" href="#" <?php echo $status_data_attributes["all"] ?>> 
    660660                        <?php _e("All", 'cms-tree-page-view') ?> 
    661661                        <span class="count">(<?php echo $post_count_all ?>)</span> 
    662662                    </a> | 
    663663                </li> 
    664                 <li> 
     664                <li class="cms_tvp_view_is_status_view"> 
    665665                    <a class="cms_tvp_view_public <?php echo ($cms_tpv_view=="public") ? "current" : "" ?>" href="#" <?php echo $status_data_attributes["publish"] ?>> 
    666666                        <?php _e("Public", 'cms-tree-page-view') ?> 
     
    668668                    </a> | 
    669669                </li> 
    670                 <li> 
     670                <li class="cms_tvp_view_is_status_view"> 
    671671                    <a class="cms_tvp_view_trash <?php echo ($cms_tpv_view=="trash") ? "current" : "" ?>" href="#" <?php echo $status_data_attributes["trash"] ?>> 
    672672                        <?php _e("Trash", 'cms-tree-page-view') ?> 
  • cms-tree-page-view/tags/1.1/index.php

    r629638 r631434  
    44Plugin URI: http://eskapism.se/code-playground/cms-tree-page-view/ 
    55Description: Adds a CMS-like tree view of all your pages, like the view often found in a page-focused CMS. Use the tree view to edit, view, add pages and search pages (very 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: 1.0 
     6Version: 1.1 
    77Author: Pär Thernström 
    88Author URI: http://eskapism.se/ 
     
    2828#require("functions.php"); 
    2929 
    30 define( "CMS_TPV_VERSION", "1.0"); 
     30define( "CMS_TPV_VERSION", "1.1"); 
    3131define( "CMS_TPV_NAME", "CMS Tree Page View"); 
    3232 
  • cms-tree-page-view/tags/1.1/readme.txt

    r630338 r631434  
    55Requires at least: 3.0 
    66Tested up to: 3.5 
    7 Stable tag: 1.0 
     7Stable tag: 1.1 
    88 
    99Adds a tree of all your pages or custom posts. Use drag & drop to reorder your pages, and edit, view, add, and search your pages. 
     
    9292== Changelog == 
    9393 
    94 = 1.x = 
     94= 1.1 = 
    9595- Added "Add new"-link next to headline, to better match the regular post overview page + it makes it possible to add new pages/posts when there are no pages/posts added (previously there needed to be at least one post added to be able to add new posts) 
    9696- Added post count in parenthesis after each post status. Also makes the page match the regular post overview page a it more. Works for both built in post types and custom post types + if WPML is installed it will show post count for each language too. 
    9797- Fixed a bug with sortables (well, I kinda forgot to load that script at all!) that made the plugin only work on the dashboard. 
     98- Fixed some IE-bugs 
    9899 
    99100= 1.0 = 
  • cms-tree-page-view/tags/1.1/scripts/cms_tree_page_view.js

    r630338 r631434  
    328328        if ( ! actions_div_doit.is(":visible") ) { 
    329329 
    330             var timeoutID = setTimeout(function(e) { 
     330            var timeoutID = setTimeout((function() { 
    331331                cms_tpv_mouseover_li(e); 
    332             }, 500, e); 
    333  
    334             //console.log("timer added"); 
     332            }), 500, e); 
    335333 
    336334            $container.data("cmstpv_global_link_timer", timeoutID); 
     
    386384    return $wrapper; 
    387385} 
    388  
    389  
    390386 
    391387 
     
    547543    var $container = $wrapper.find("div.cms_tpv_container"); 
    548544    var timer = $container.data("cmstpv_global_link_timer"); 
    549     // console.log("back to action div"); 
     545     
    550546    clearTimeout(timer); 
    551547 
     
    737733 
    738734 
    739 // change lang 
     735// click on link to change WPML-language 
    740736jQuery(document).on("click", "a.cms_tvp_switch_lang", function(e) { 
    741737     
    742738    $wrapper = cms_tpv_get_wrapper(this); 
     739 
     740    // Mark clicked link as selected 
    743741    $wrapper.find("ul.cms_tvp_switch_langs a").removeClass("current"); 
    744742    jQuery(this).addClass("current"); 
    745743 
     744    // Determine selected language, based on classes on the link 
    746745    var re = /cms_tpv_switch_language_code_([\w-]+)/; 
    747746    var matches = re.exec( jQuery(this).attr("class") ); 
    748747    var lang_code = matches[1]; 
     748 
     749    // Add seleted lang to hidden input 
    749750    $wrapper.find("[name=cms_tpv_meta_wpml_language]").val(lang_code); 
    750751 
     752    // Update post count 
     753    // Post counts are stored on the links for all | public | trash 
     754    var $ul_select_view = $wrapper.find(".cms-tpv-subsubsub-select-view"); 
     755    $ul_select_view.find("li.cms_tvp_view_is_status_view a").each(function(i, a_tag) { 
     756         
     757        // check if this link has a data attr with count for the selected lang 
     758        var $a = jQuery(a_tag); 
     759        var link_count = $a.data("post-count-" + lang_code); 
     760        if ("undefined" === typeof(link_count)) return; 
     761 
     762        $a.find(".count").text("(" + link_count + ")"); 
     763 
     764    }); 
     765 
     766    // Set the view = reload the tree 
    751767    var current_view = cms_tpv_get_current_view(this); 
    752768    cms_tvp_set_view(current_view, this); 
     
    777793/** 
    778794 * Sets the view; load pages for the current lang + post type + status 
     795 * @param view all | public | trash 
     796 * @elm element 
    779797 */ 
    780798function cms_tvp_set_view(view, elm) { 
     
    783801 
    784802    var div_actions_for_post_type = cms_tpv_get_page_actions_div(elm); 
     803 
    785804    $wrapper.append(div_actions_for_post_type); 
    786805    $wrapper.find(".cms_tvp_view_all, .cms_tvp_view_public, .cms_tvp_view_trash").removeClass("current"); 
    787806    $wrapper.find(".cms_tpv_container").jstree("destroy").html(""); 
    788  
    789807    $wrapper.find("div.cms_tpv_page_actions").removeClass("cms_tpv_page_actions_visible"); 
    790808 
    791809    cms_tpv_bind_clean_node(); 
    792810 
     811    // Mark selected link 
    793812    if (view == "all") { 
    794813        $wrapper.find(".cms_tvp_view_all").addClass("current"); 
     
    801820    } 
    802821     
     822    // Reload tree 
    803823    var treeOptionsTmp = jQuery.extend(true, {}, treeOptions); 
    804824    treeOptionsTmp.json_data.ajax.url = ajaxurl + CMS_TPV_AJAXURL + view + "&post_type=" + cms_tpv_get_post_type(elm) + "&lang=" + cms_tpv_get_wpml_selected_lang(elm); 
  • cms-tree-page-view/trunk/functions.php

    r630338 r631434  
    655655 
    656656            ?> 
    657             <ul class="cms-tpv-subsubsub hidden"> 
    658                 <li> 
    659                     <a class="cms_tvp_view_all <?php echo ($cms_tpv_view=="all") ? "current" : "" ?>" href="#" <?php echo $status_data_attributes["all"] ?>> 
     657            <ul class="cms-tpv-subsubsub cms-tpv-subsubsub-select-view"> 
     658                <li class="cms_tvp_view_is_status_view"> 
     659                    <a class="cms_tvp_view_all  <?php echo ($cms_tpv_view=="all") ? "current" : "" ?>" href="#" <?php echo $status_data_attributes["all"] ?>> 
    660660                        <?php _e("All", 'cms-tree-page-view') ?> 
    661661                        <span class="count">(<?php echo $post_count_all ?>)</span> 
    662662                    </a> | 
    663663                </li> 
    664                 <li> 
     664                <li class="cms_tvp_view_is_status_view"> 
    665665                    <a class="cms_tvp_view_public <?php echo ($cms_tpv_view=="public") ? "current" : "" ?>" href="#" <?php echo $status_data_attributes["publish"] ?>> 
    666666                        <?php _e("Public", 'cms-tree-page-view') ?> 
     
    668668                    </a> | 
    669669                </li> 
    670                 <li> 
     670                <li class="cms_tvp_view_is_status_view"> 
    671671                    <a class="cms_tvp_view_trash <?php echo ($cms_tpv_view=="trash") ? "current" : "" ?>" href="#" <?php echo $status_data_attributes["trash"] ?>> 
    672672                        <?php _e("Trash", 'cms-tree-page-view') ?> 
  • cms-tree-page-view/trunk/index.php

    r629638 r631434  
    44Plugin URI: http://eskapism.se/code-playground/cms-tree-page-view/ 
    55Description: Adds a CMS-like tree view of all your pages, like the view often found in a page-focused CMS. Use the tree view to edit, view, add pages and search pages (very 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: 1.0 
     6Version: 1.1 
    77Author: Pär Thernström 
    88Author URI: http://eskapism.se/ 
     
    2828#require("functions.php"); 
    2929 
    30 define( "CMS_TPV_VERSION", "1.0"); 
     30define( "CMS_TPV_VERSION", "1.1"); 
    3131define( "CMS_TPV_NAME", "CMS Tree Page View"); 
    3232 
  • cms-tree-page-view/trunk/readme.txt

    r630338 r631434  
    55Requires at least: 3.0 
    66Tested up to: 3.5 
    7 Stable tag: 1.0 
     7Stable tag: 1.1 
    88 
    99Adds a tree of all your pages or custom posts. Use drag & drop to reorder your pages, and edit, view, add, and search your pages. 
     
    9292== Changelog == 
    9393 
    94 = 1.x = 
     94= 1.1 = 
    9595- Added "Add new"-link next to headline, to better match the regular post overview page + it makes it possible to add new pages/posts when there are no pages/posts added (previously there needed to be at least one post added to be able to add new posts) 
    9696- Added post count in parenthesis after each post status. Also makes the page match the regular post overview page a it more. Works for both built in post types and custom post types + if WPML is installed it will show post count for each language too. 
    9797- Fixed a bug with sortables (well, I kinda forgot to load that script at all!) that made the plugin only work on the dashboard. 
     98- Fixed some IE-bugs 
    9899 
    99100= 1.0 = 
  • cms-tree-page-view/trunk/scripts/cms_tree_page_view.js

    r630338 r631434  
    328328        if ( ! actions_div_doit.is(":visible") ) { 
    329329 
    330             var timeoutID = setTimeout(function(e) { 
     330            var timeoutID = setTimeout((function() { 
    331331                cms_tpv_mouseover_li(e); 
    332             }, 500, e); 
    333  
    334             //console.log("timer added"); 
     332            }), 500, e); 
    335333 
    336334            $container.data("cmstpv_global_link_timer", timeoutID); 
     
    386384    return $wrapper; 
    387385} 
    388  
    389  
    390386 
    391387 
     
    547543    var $container = $wrapper.find("div.cms_tpv_container"); 
    548544    var timer = $container.data("cmstpv_global_link_timer"); 
    549     // console.log("back to action div"); 
     545     
    550546    clearTimeout(timer); 
    551547 
     
    737733 
    738734 
    739 // change lang 
     735// click on link to change WPML-language 
    740736jQuery(document).on("click", "a.cms_tvp_switch_lang", function(e) { 
    741737     
    742738    $wrapper = cms_tpv_get_wrapper(this); 
     739 
     740    // Mark clicked link as selected 
    743741    $wrapper.find("ul.cms_tvp_switch_langs a").removeClass("current"); 
    744742    jQuery(this).addClass("current"); 
    745743 
     744    // Determine selected language, based on classes on the link 
    746745    var re = /cms_tpv_switch_language_code_([\w-]+)/; 
    747746    var matches = re.exec( jQuery(this).attr("class") ); 
    748747    var lang_code = matches[1]; 
     748 
     749    // Add seleted lang to hidden input 
    749750    $wrapper.find("[name=cms_tpv_meta_wpml_language]").val(lang_code); 
    750751 
     752    // Update post count 
     753    // Post counts are stored on the links for all | public | trash 
     754    var $ul_select_view = $wrapper.find(".cms-tpv-subsubsub-select-view"); 
     755    $ul_select_view.find("li.cms_tvp_view_is_status_view a").each(function(i, a_tag) { 
     756         
     757        // check if this link has a data attr with count for the selected lang 
     758        var $a = jQuery(a_tag); 
     759        var link_count = $a.data("post-count-" + lang_code); 
     760        if ("undefined" === typeof(link_count)) return; 
     761 
     762        $a.find(".count").text("(" + link_count + ")"); 
     763 
     764    }); 
     765 
     766    // Set the view = reload the tree 
    751767    var current_view = cms_tpv_get_current_view(this); 
    752768    cms_tvp_set_view(current_view, this); 
     
    777793/** 
    778794 * Sets the view; load pages for the current lang + post type + status 
     795 * @param view all | public | trash 
     796 * @elm element 
    779797 */ 
    780798function cms_tvp_set_view(view, elm) { 
     
    783801 
    784802    var div_actions_for_post_type = cms_tpv_get_page_actions_div(elm); 
     803 
    785804    $wrapper.append(div_actions_for_post_type); 
    786805    $wrapper.find(".cms_tvp_view_all, .cms_tvp_view_public, .cms_tvp_view_trash").removeClass("current"); 
    787806    $wrapper.find(".cms_tpv_container").jstree("destroy").html(""); 
    788  
    789807    $wrapper.find("div.cms_tpv_page_actions").removeClass("cms_tpv_page_actions_visible"); 
    790808 
    791809    cms_tpv_bind_clean_node(); 
    792810 
     811    // Mark selected link 
    793812    if (view == "all") { 
    794813        $wrapper.find(".cms_tvp_view_all").addClass("current"); 
     
    801820    } 
    802821     
     822    // Reload tree 
    803823    var treeOptionsTmp = jQuery.extend(true, {}, treeOptions); 
    804824    treeOptionsTmp.json_data.ajax.url = ajaxurl + CMS_TPV_AJAXURL + view + "&post_type=" + cms_tpv_get_post_type(elm) + "&lang=" + cms_tpv_get_wpml_selected_lang(elm); 
Note: See TracChangeset for help on using the changeset viewer.