Changeset 2369747
- Timestamp:
- 08/26/2020 07:51:20 PM (5 years ago)
- Location:
- bu-navigation/trunk
- Files:
-
- 25 edited
-
admin/admin.php (modified) (2 diffs)
-
admin/manager.php (modified) (7 diffs)
-
bin/install-wp-tests.sh (modified) (6 diffs)
-
bu-navigation-widget.php (modified) (3 diffs)
-
bu-navigation.php (modified) (2 diffs)
-
composer.json (modified) (1 diff)
-
css/navigation-metabox.css (modified) (6 diffs)
-
extras/bu-navigation-breadcrumbs.php (modified) (1 diff)
-
includes/class-tree-view.php (modified) (4 diffs)
-
includes/library.php (modified) (1 diff)
-
js/bu-navigation.js (modified) (16 diffs)
-
js/bu-navigation.min.js (modified) (1 diff)
-
js/deletion.js (modified) (2 diffs)
-
js/deletion.min.js (modified) (1 diff)
-
js/manage.js (modified) (3 diffs)
-
js/manage.min.js (modified) (1 diff)
-
js/navigation-metabox.js (modified) (4 diffs)
-
js/navigation-metabox.min.js (modified) (1 diff)
-
js/vendor/jquery.cookie.min.js (modified) (1 diff)
-
js/vendor/jquery.validate.min.js (modified) (1 diff)
-
js/vendor/jstree/themes/bu-jstree/style.css (modified) (2 diffs)
-
package.json (modified) (1 diff)
-
phpunit.xml (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
templates/edit-order.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
bu-navigation/trunk/admin/admin.php
r1048298 r2369747 32 32 global $wp_version; 33 33 34 add_action( 'admin_enqueue_scripts', array( &$this, 'thickbox' ) ); 35 add_action( 'enqueue_block_editor_assets', array( &$this, 'remove_bulb_attributes_panel' ) ); 34 36 add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) ); 35 37 … … 68 70 } 69 71 72 /** 73 * Load script to kill attributes panel in Document editor panel. 74 * 75 * @since 1.3.0 76 */ 77 public function remove_bulb_attributes_panel() { 78 $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 79 $scripts_url = plugins_url( 'js', BU_NAV_PLUGIN ); 80 81 wp_enqueue_script( 82 'remove-panel-js', 83 $scripts_url . '/remove_attributes_panel' . $suffix . '.js', 84 array(), 85 BU_Navigation_Plugin::VERSION, 86 true 87 ); 88 } 89 90 /** 91 * Enqueue Thickbox for Gutenberg editor 92 */ 93 public function thickbox() { 94 add_thickbox(); 95 } 96 70 97 public function admin_scripts() { 71 98 -
bu-navigation/trunk/admin/manager.php
r1498420 r2369747 127 127 wp_register_script( 'bu-navman', $scripts_url . '/manage' . $suffix . '.js', array( 'bu-navigation', 'jquery-ui-dialog', 'bu-jquery-validate' ), BU_Navigation_Plugin::VERSION, true ); 128 128 129 // Strings for localization130 $nav_menu_label = __( 'Appearance > Primary Navigation', 'bu-navigation' );131 $strings = array(132 'optionsLabel' => __( 'options', 'bu-navigation' ),133 'optionsEditLabel' => __( 'Edit', 'bu-navigation' ),134 'optionsViewLabel' => __( 'View', 'bu-navigation' ),135 'optionsDeleteLabel' => __( 'Delete', 'bu-navigation' ),136 'optionsTrashLabel' => __( 'Move to Trash', 'bu-navigation' ),137 'addLinkDialogTitle' => __( 'Add a Link', 'bu-navigation' ),138 'editLinkDialogTitle' => __( 'Edit Link', 'bu-navigation' ),139 'cancelLinkBtn' => __( 'Cancel', 'bu-navigation' ),140 'confirmLinkBtn' => __( 'Ok', 'bu-navigation' ),141 'noTopLevelNotice' => __( 'You are not allowed to create top level published content.', 'bu-navigation' ),142 'noLinksNotice' => __( 'You are not allowed to add links', 'bu-navigation' ),143 'createLinkNotice' => __( 'Select a page that you can edit and click "Add a Link" to create a new link below the selected page.', 'bu-navigation' ),144 'allowTopNotice' => sprintf( __( 'Site administrators can change this behavior by visiting %s and enabling the "Allow Top-Level Pages" setting.', 'bu-navigation' ), $nav_menu_label ),145 'noChildLinkNotice' => __( 'Links are not permitted to have children.', 'bu-navigation' ),146 'unloadWarning' => __( 'You have made changes to your navigation that have not yet been saved.', 'bu-navigation' ),147 'saveNotice' => __( 'Saving navigation changes...', 'bu-navigation' ),148 );149 150 // Setup dynamic script context for manage.js151 $script_context = array(152 'postTypes' => $this->post_type,153 'postStatuses' => array( 'publish', 'private' ),154 'nodePrefix' => 'nm',155 'lazyLoad' => true,156 'showCounts' => true,157 );158 129 // Navigation tree view will handle actual enqueuing of our script 159 $treeview = new BU_Navigation_Tree_View( 'bu_navman', array_merge( $script_context, $strings ));130 $treeview = $this->get_navigation_tree(); 160 131 $treeview->enqueue_script( 'bu-navman' ); 161 132 … … 175 146 } 176 147 148 /** 149 * Get fully configured instance of BU_Navigation_Tree_View 150 */ 151 public function get_navigation_tree() { 152 // Strings for localization 153 $nav_menu_label = __( 'Appearance > Primary Navigation', 'bu-navigation' ); 154 $strings = array( 155 'optionsLabel' => __( 'options', 'bu-navigation' ), 156 'optionsEditLabel' => __( 'Edit', 'bu-navigation' ), 157 'optionsViewLabel' => __( 'View', 'bu-navigation' ), 158 'optionsDeleteLabel' => __( 'Delete', 'bu-navigation' ), 159 'optionsTrashLabel' => __( 'Move to Trash', 'bu-navigation' ), 160 'addLinkDialogTitle' => __( 'Add a Link', 'bu-navigation' ), 161 'editLinkDialogTitle' => __( 'Edit Link', 'bu-navigation' ), 162 'cancelLinkBtn' => __( 'Cancel', 'bu-navigation' ), 163 'confirmLinkBtn' => __( 'Ok', 'bu-navigation' ), 164 'noTopLevelNotice' => __( 'You are not allowed to create top level published content.', 'bu-navigation' ), 165 'noLinksNotice' => __( 'You are not allowed to add links', 'bu-navigation' ), 166 'createLinkNotice' => __( 'Select a page that you can edit and click "Add a Link" to create a new link below the selected page.', 'bu-navigation' ), 167 'allowTopNotice' => sprintf( __( 'Site administrators can change this behavior by visiting %s and enabling the "Allow Top-Level Pages" setting.', 'bu-navigation' ), $nav_menu_label ), 168 'noChildLinkNotice' => __( 'Links are not permitted to have children.', 'bu-navigation' ), 169 'unloadWarning' => __( 'You have made changes to your navigation that have not yet been saved.', 'bu-navigation' ), 170 'saveNotice' => __( 'Saving navigation changes...', 'bu-navigation' ), 171 ); 172 173 // Setup dynamic script context for manage.js 174 $script_context = array( 175 'postTypes' => $this->post_type, 176 'postStatuses' => array( 'publish', 'private' ), 177 'nodePrefix' => 'nm', 178 'lazyLoad' => true, 179 'showCounts' => true, 180 ); 181 182 return new BU_Navigation_Tree_View( 'bu_navman', array_merge( $script_context, $strings ) ); 183 } 184 177 185 /** 178 186 * Handle admin page setup … … 180 188 public function load() { 181 189 182 // Save if post data is present 183 $saved = $this->save(); 190 if ( array_key_exists( 'navman-hash', $_POST ) ) { 191 $tree = $this->get_navigation_tree(); 192 $hash_stayed_same = $tree->hierarchy->as_hash() == $_POST['navman-hash']; 193 } 194 else { 195 $hash_stayed_same = true; 196 } 197 198 if ( $hash_stayed_same ) { 199 $saved = $this->save(); 200 } 201 else { 202 $saved = false; 203 } 184 204 185 205 // Post/Redirect/Get … … 190 210 191 211 // Notifications 192 if ( $saved === true ) { $url = add_query_arg( 'message', 1, $url ); 193 } else { $url = add_query_arg( 'notice', 1, $url ); } 212 if ( $saved === true ) { 213 $url = add_query_arg( 'message', 1, $url ); 214 } else { 215 if ( ! $hash_stayed_same ) { 216 $url = add_query_arg( 'notice', 3, $url ); 217 } 218 else { 219 $url = add_query_arg( 'notice', 1, $url ); 220 } 221 } 194 222 195 223 wp_redirect( $url ); … … 233 261 234 262 $user_markup = '<strong>%s</strong>'; 263 $post_type = get_post_type_object( $this->post_type ); 235 264 236 265 $notices = array( … … 243 272 1 => __( 'Errors occurred while saving your navigation changes.', 'bu-navigation' ), 244 273 2 => sprintf( __( "Warning: %s is currently editing this site's navigation.", 'bu-navigation' ), $user_markup ), 274 3 => sprintf( __( '%s order has been modified by someone else. Please retry.', 'bu-navigation' ), $post_type->labels->singular_name), 245 275 ), 246 276 ); … … 322 352 $include_links = $this->plugin->supports( 'links' ) && 'page' == $this->post_type; 323 353 $disable_add_link = ! $this->can_publish_top_level( $this->post_type ); 324 354 $tree = $this->get_navigation_tree(); 325 355 // Render interface 326 356 include( BU_NAV_PLUGIN_DIR . '/templates/edit-order.php' ); -
bu-navigation/trunk/bin/install-wp-tests.sh
r1322567 r2369747 2 2 3 3 if [ $# -lt 3 ]; then 4 echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version] "4 echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version] [skip-database-creation]" 5 5 exit 1 6 6 fi … … 11 11 DB_HOST=${4-localhost} 12 12 WP_VERSION=${5-latest} 13 SKIP_DB_CREATE=${6-false} 13 14 14 WP_TESTS_DIR=${WP_TESTS_DIR-/tmp/wordpress-tests-lib} 15 WP_CORE_DIR=${WP_CORE_DIR-/tmp/wordpress/} 15 TMPDIR=${TMPDIR-/tmp} 16 TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//") 17 WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib} 18 WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress/} 16 19 17 20 download() { … … 23 26 } 24 27 25 if [[ $WP_VERSION =~ [0-9]+\.[0-9]+(\.[0-9]+)? ]]; then 26 WP_TESTS_TAG="tags/$WP_VERSION" 28 if [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+$ ]]; then 29 WP_TESTS_TAG="branches/$WP_VERSION" 30 elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then 31 if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then 32 # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x 33 WP_TESTS_TAG="tags/${WP_VERSION%??}" 34 else 35 WP_TESTS_TAG="tags/$WP_VERSION" 36 fi 37 elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then 38 WP_TESTS_TAG="trunk" 27 39 else 28 40 # http serves a single offer, whereas https serves multiple. we only want one … … 47 59 mkdir -p $WP_CORE_DIR 48 60 49 if [ $WP_VERSION == 'latest' ]; then 50 local ARCHIVE_NAME='latest' 61 if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then 62 mkdir -p $TMPDIR/wordpress-nightly 63 download https://wordpress.org/nightly-builds/wordpress-latest.zip $TMPDIR/wordpress-nightly/wordpress-nightly.zip 64 unzip -q $TMPDIR/wordpress-nightly/wordpress-nightly.zip -d $TMPDIR/wordpress-nightly/ 65 mv $TMPDIR/wordpress-nightly/wordpress/* $WP_CORE_DIR 51 66 else 52 local ARCHIVE_NAME="wordpress-$WP_VERSION" 67 if [ $WP_VERSION == 'latest' ]; then 68 local ARCHIVE_NAME='latest' 69 elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+ ]]; then 70 # https serves multiple offers, whereas http serves single. 71 download https://api.wordpress.org/core/version-check/1.7/ $TMPDIR/wp-latest.json 72 if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then 73 # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x 74 LATEST_VERSION=${WP_VERSION%??} 75 else 76 # otherwise, scan the releases and get the most up to date minor version of the major release 77 local VERSION_ESCAPED=`echo $WP_VERSION | sed 's/\./\\\\./g'` 78 LATEST_VERSION=$(grep -o '"version":"'$VERSION_ESCAPED'[^"]*' $TMPDIR/wp-latest.json | sed 's/"version":"//' | head -1) 79 fi 80 if [[ -z "$LATEST_VERSION" ]]; then 81 local ARCHIVE_NAME="wordpress-$WP_VERSION" 82 else 83 local ARCHIVE_NAME="wordpress-$LATEST_VERSION" 84 fi 85 else 86 local ARCHIVE_NAME="wordpress-$WP_VERSION" 87 fi 88 download https://wordpress.org/${ARCHIVE_NAME}.tar.gz $TMPDIR/wordpress.tar.gz 89 tar --strip-components=1 -zxmf $TMPDIR/wordpress.tar.gz -C $WP_CORE_DIR 53 90 fi 54 55 download https://wordpress.org/${ARCHIVE_NAME}.tar.gz /tmp/wordpress.tar.gz56 tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR57 91 58 92 download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php … … 72 106 mkdir -p $WP_TESTS_DIR 73 107 svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes 108 svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data 74 109 fi 75 76 cd $WP_TESTS_DIR77 110 78 111 if [ ! -f wp-tests-config.php ]; then 79 112 download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php 80 sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR':" "$WP_TESTS_DIR"/wp-tests-config.php 113 # remove all forward slashes in the end 114 WP_CORE_DIR=$(echo $WP_CORE_DIR | sed "s:/\+$::") 115 sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php 81 116 sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php 82 117 sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php … … 88 123 89 124 install_db() { 125 126 if [ ${SKIP_DB_CREATE} = "true" ]; then 127 return 0 128 fi 129 90 130 # parse DB_HOST for port or socket references 91 131 local PARTS=(${DB_HOST//\:/ }) -
bu-navigation/trunk/bu-navigation-widget.php
r1498420 r2369747 43 43 44 44 // Determine which post to use for the section title 45 if ( $instance['navigation_style'] != 'site' ) {45 if ( ! empty( $instance['navigation_style'] ) && $instance['navigation_style'] != 'site' ) { 46 46 47 47 // Gather ancestors … … 158 158 if ( array_key_exists( 'navigation_style', $instance ) ) { 159 159 160 $list_args['style'] = $instance['navigation_style'];160 $list_args['style'] = $instance['navigation_style']; 161 161 162 162 if ( $instance['navigation_style'] == 'section' ) { … … 168 168 169 169 } else { 170 $ this->plugin->log( 'No nav label widget style set!' );170 $GLOBALS['bu_navigation_plugin']->log( 'No nav label widget style set!' ); 171 171 } 172 172 -
bu-navigation/trunk/bu-navigation.php
r1498420 r2369747 6 6 Author URI: http://sites.bu.edu/web/ 7 7 Description: Provides alternative navigation elements designed for blogs with large page counts 8 Version: 1.2.1 18 Version: 1.2.19 9 9 Text Domain: bu-navigation 10 10 Domain Path: /languages … … 61 61 public $settings; 62 62 63 const VERSION = '1.2. 6';63 const VERSION = '1.2.19'; 64 64 65 65 public function __construct() { -
bu-navigation/trunk/composer.json
r1322567 r2369747 23 23 "name": "Andrew Bauer", 24 24 "email": "[email protected]" 25 }, 26 27 { 28 "name": "Jonathan Desrosiers", 29 "email": "[email protected]" 25 30 } 26 31 ], 27 32 "require": {}, 28 33 "require-dev": { 29 "phpunit/phpunit": "4.3.*" 34 "phpunit/phpunit": "4.3.*", 35 "codeclimate/php-test-reporter": "dev-master" 30 36 } 31 37 } -
bu-navigation/trunk/css/navigation-metabox.css
r682134 r2369747 2 2 margin: 20px 0 0 0; 3 3 text-align: right; 4 } 5 6 #TB_window #TB_ajaxContent li::before { 7 content: none; 8 } 9 10 #TB_window #TB_ajaxContent li { 11 margin: 0; 4 12 } 5 13 … … 16 24 17 25 #TB_window .bu-edit-post .denied > a { 18 color: #AF5D5D;26 color: #af5d5d; 19 27 } 20 28 … … 23 31 #TB_window .bu-edit-post.current-post-status-pending .denied > a, 24 32 #TB_window .bu-edit-post.current-post-status-private .denied > a { 25 color: black;33 color: black; 26 34 background: #eee; 27 35 background: -moz-linear-gradient(top, #ffffff 0%, #eeeeee 100%); 28 36 background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100%, #eeeeee)); 29 background: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee 100%);30 background: -o-linear-gradient(top, #ffffff 0%, #eeeeee 100%);31 background: -ms-linear-gradient(top, #ffffff 0%, #eeeeee 100%);32 background: linear-gradient(to bottom, #ffffff 0%, #eeeeee 100%);37 background: -webkit-linear-gradient(top, #ffffff 0%, #eeeeee 100%); 38 background: -o-linear-gradient(top, #ffffff 0%, #eeeeee 100%); 39 background: -ms-linear-gradient(top, #ffffff 0%, #eeeeee 100%); 40 background: linear-gradient(to bottom, #ffffff 0%, #eeeeee 100%); 33 41 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 ); 34 42 } … … 56 64 } 57 65 58 #bunavattrsdiv input[type= "text"] {66 #bunavattrsdiv input[type='text'] { 59 67 width: 68%; 60 68 } … … 66 74 67 75 #bu-post-breadcrumbs ul { 68 margin-top: 6px;76 margin-top: 6px; 69 77 } 70 78 … … 90 98 margin-left: 2px; 91 99 padding: 3px; 92 background-color: # EEE;93 border: 1px solid # CCC;100 background-color: #eee; 101 border: 1px solid #ccc; 94 102 } -
bu-navigation/trunk/extras/bu-navigation-breadcrumbs.php
r1498420 r2369747 94 94 95 95 if ( ! isset( $current->navigation_label ) ) { 96 $current->navigation_label = apply_filters( 'the_title', $current->post_title );96 $current->navigation_label = apply_filters( 'the_title', $current->post_title, $current->ID ); 97 97 } 98 98 -
bu-navigation/trunk/includes/class-tree-view.php
r1498420 r2369747 13 13 14 14 private $query; 15 16 public $hierarchy; 15 17 16 18 /** … … 61 63 ); 62 64 $this->query = new BU_Navigation_Tree_Query( $query_args ); 65 $this->hierarchy = new BU_Navigation_Tree_Hierarchy( $this->query ); 63 66 64 67 // No need to register scripts during AJAX requests … … 252 255 // Label 253 256 if( !isset( $post->navigation_label ) ) { 254 $post->navigation_label = apply_filters( 'the_title', $post->post_title );257 $post->navigation_label = apply_filters( 'the_title', $post->post_title, $post->ID ); 255 258 } 256 259 … … 318 321 319 322 /** 323 * Collection of methods that allow the page hierarchy be represented as 324 * a hash value. By comparing two hash values, we can tell if there were 325 * any changes in the hierarchy. 326 */ 327 class BU_Navigation_Tree_Hierarchy { 328 329 /** 330 * Holds the BU_Navigation_Tree_Query instance passed into constructor. 331 */ 332 private $tree_query; 333 334 /** 335 * Post properties that describe hierarchy. If any of these changed, 336 * the hierarchy changed. 337 */ 338 const HIERARCHICAL_PROPERTIES = array( 'ID', 'menu_order', 'post_parent' ); 339 340 /** 341 * By taking the posts structure and leaving only hierarchy-related 342 * preperties of it, we get the object that stays the same as long as 343 * the post hierarchy stays the same. 344 * 345 * @return array Object that represents post tree hierarchy 346 */ 347 private function as_object() { 348 $hierarchy = $this->tree_query->posts_by_parent(); 349 foreach ( $hierarchy as $parent ) { 350 foreach ( $parent as $child ) { 351 foreach ( $child as $prop_name => $prop_value ) { 352 if ( ! in_array( $prop_name, self::HIERARCHICAL_PROPERTIES ) ) { 353 unset( $child->$prop_name ); 354 } 355 } 356 } 357 } 358 359 return $hierarchy; 360 } 361 362 /** 363 * Constructor. 364 */ 365 public function __construct( BU_Navigation_Tree_Query $tree_query ) { 366 $this->tree_query = $tree_query; 367 } 368 369 /** 370 * Gets hashed representation of the BU_Navigation_Tree_Query instance 371 * passed into the constructor of this class. 372 * 373 * @return String hashed representation of the post hierarchy 374 */ 375 public function as_hash() { 376 $obj = $this->as_object(); 377 $str = json_encode( $obj ); 378 return md5( $str ); 379 } 380 } 381 382 /** 320 383 * WP_Query-like class optimized for querying hierarchical post types 321 384 * -
bu-navigation/trunk/includes/library.php
r1498420 r2369747 629 629 $r = wp_parse_args( $args, $defaults ); 630 630 631 if ( ! isset( $page->navigation_label ) ) 632 $page->navigation_label = apply_filters( 'the_title', $page->post_title ); 631 if ( ! isset( $page->navigation_label ) ) { 632 $page->navigation_label = apply_filters( 'the_title', $page->post_title, $page->ID ); 633 } 633 634 634 635 $title = $page->navigation_label; -
bu-navigation/trunk/js/bu-navigation.js
r1048298 r2369747 103 103 // DOM ready -- browser classes 104 104 $(document).ready(function () { 105 if( $.browser.msie === true && parseInt($.browser.version, 10) == 7 ) 106 $(document.body).addClass('ie7'); 107 if( $.browser.msie === true && parseInt($.browser.version, 10) == 8 ) 108 $(document.body).addClass('ie8'); 109 if( $.browser.msie === true && parseInt($.browser.version, 10) == 9 ) 110 $(document.body).addClass('ie9'); 105 if($.browser && $.browser.msie){ 106 if( $.browser.msie === true && parseInt($.browser.version, 10) === 7 ) 107 $(document.body).addClass('ie7'); 108 if( $.browser.msie === true && parseInt($.browser.version, 10) === 8 ) 109 $(document.body).addClass('ie8'); 110 if( $.browser.msie === true && parseInt($.browser.version, 10) === 9 ) 111 $(document.body).addClass('ie9'); 112 } 111 113 }); 112 114 … … 165 167 isVisible = post.post_meta['excluded'] === false || post.post_type === c.linksPostType; 166 168 167 allowed = true;169 var allowed = true; 168 170 169 171 // Don't allow top level posts if global option prohibits it … … 660 662 my.getRelAttrForPost = function(post, hasChildren) { 661 663 var rel; 662 664 663 665 if (hasChildren) { 664 666 rel = 'section'; … … 812 814 813 815 // Tree instance is loaded (before initial opens/selections are made) 814 $tree. bind('loaded.jstree', function( event, data ) {816 $tree.on('loaded.jstree', function( event, data ) { 815 817 816 818 // jstree breaks spectacularly if the stylesheet hasn't set an li height … … 824 826 825 827 // Run after initial node openings and selections have completed 826 $tree. bind('reselect.jstree', function( event, data ) {828 $tree.on('reselect.jstree', function( event, data ) { 827 829 828 830 that.broadcast('postsSelected'); … … 831 833 832 834 // Run after lazy load operation has completed 833 $tree. bind('lazy_loaded.jstree', function (event, data) {835 $tree.on('lazy_loaded.jstree', function (event, data) { 834 836 835 837 that.broadcast('lazyLoadComplete'); … … 838 840 839 841 // After node is loaded from server using json_data 840 $tree. bind('load_node.jstree', function( event, data ) {842 $tree.on('load_node.jstree', function( event, data ) { 841 843 if( data.rslt.obj !== -1 ) { 842 844 var $node = data.rslt.obj; … … 849 851 850 852 // Append extra markup to each tree node 851 $tree. bind('clean_node.jstree', function( event, data ) {853 $tree.on('clean_node.jstree', function( event, data ) { 852 854 var $nodes = data.rslt.obj; 853 855 … … 874 876 }); 875 877 876 $tree. bind('before.jstree', function (event, data) {878 $tree.on('before.jstree', function (event, data) { 877 879 var $node; 878 880 … … 891 893 }); 892 894 893 $tree. bind('create_node.jstree', function(event, data ) {895 $tree.on('create_node.jstree', function(event, data ) { 894 896 var $node = data.rslt.obj; 895 897 var post = my.nodeToPost( $node ); … … 897 899 }); 898 900 899 $tree. bind('select_node.jstree', function(event, data ) {901 $tree.on('select_node.jstree', function(event, data ) { 900 902 var post = my.nodeToPost(data.rslt.obj); 901 903 that.broadcast('postSelected', [post]); 902 904 }); 903 905 904 $tree. bind('create.jstree', function (event, data) {906 $tree.on('create.jstree', function (event, data) { 905 907 var $node = data.rslt.obj, 906 908 $parent = data.rslt.parent, … … 922 924 }); 923 925 924 $tree. bind('remove.jstree', function (event, data) {926 $tree.on('remove.jstree', function (event, data) { 925 927 var $node = data.rslt.obj, 926 928 post = my.nodeToPost($node), … … 944 946 }); 945 947 946 $tree. bind('deselect_node.jstree', function(event, data ) {948 $tree.on('deselect_node.jstree', function(event, data ) { 947 949 var post = my.nodeToPost( data.rslt.obj ); 948 950 that.broadcast('postDeselected', [post]); 949 951 }); 950 952 951 $tree. bind('deselect_all.jstree', function (event, data) {953 $tree.on('deselect_all.jstree', function (event, data) { 952 954 that.broadcast('postsDeselected'); 953 955 }); 954 956 955 $tree. bind('move_node.jstree', function (event, data ) {957 $tree.on('move_node.jstree', function (event, data ) { 956 958 var $moved = data.rslt.o; 957 959 … … 1008 1010 1009 1011 if (c.deselectOnDocumentClick) { 1010 $(document). bind( "click", deselectOnDocumentClick );1012 $(document).on( "click", deselectOnDocumentClick ); 1011 1013 } 1012 1014 … … 1143 1145 $(this).addClass('clicked'); 1144 1146 1145 if (currentMenuTarget && currentMenuTarget.attr('id') != obj.attr('id')) {1147 if (currentMenuTarget && currentMenuTarget.attr('id') !== obj.attr('id')) { 1146 1148 removeMenu(currentMenuTarget); 1147 1149 } … … 1150 1152 1151 1153 // Remove active state on edit options button when the menu is removed 1152 $(document). bind('context_hide.vakata', function(e, data){1154 $(document).on('context_hide.vakata', function(e, data){ 1153 1155 removeMenu(currentMenuTarget); 1154 1156 }); -
bu-navigation/trunk/js/bu-navigation.min.js
r1048298 r2369747 1 var bu=bu||{};bu.plugins=bu.plugins||{},bu.plugins.navigation={},function(a){"use strict";bu.signals=function(){var b={};return b.listenFor=function(a,b){var c=this._listeners;void 0===c[a]&&(c[a]=[]),c[a].push(b)},b.broadcast=function(a,b){var c,d=this._listeners;if(d[a])for(c=0;c<d[a].length;c+=1)d[a][c].apply(this,b||[])},{register:function(c){c._listeners={},a.extend(!0,c,b)}}}(),bu.hooks=function(){var a={};return{addFilter:function(b,c){return void 0===a[b]&&(a[b]=[]),a[b].push(c),this},applyFilters:function(b,c){if(void 0===a[b])return c;var d,e=Array.prototype.slice.apply(arguments),f=e.slice(1),g=c;for(d=0;d<a[b].length;d+=1)g=a[b][d].apply(this,f);return g}}}()}(jQuery),function(a){var b=bu.plugins.navigation;b.settings={lazyLoad:!0,showCounts:!0,showStatuses:!0,deselectOnDocumentClick:!0},a(document).ready(function(){a.browser .msie===!0&&7==parseInt(a.browser.version,10)&&a(document.body).addClass("ie7"),a.browser.msie===!0&&8==parseInt(a.browser.version,10)&&a(document.body).addClass("ie8"),a.browser.msie===!0&&9==parseInt(a.browser.version,10)&&a(document.body).addClass("ie9")}),b.tree=function(a,c){return"undefined"==typeof a&&(a="base"),b.trees[a](c).initialize()},b.trees={base:function(c,d){var e={};d=d||{},bu.signals.register(e),e.config=a.extend({},b.settings,c||{}),e.data={treeConfig:{},rollback:void 0};var f=e.config,g=e.data,h=e.$el=a(f.el);if(f.themePath&&document.images){var i=new Image,j=new Image;i.src=f.themePath+"/sprite.png",j.src=f.themePath+"/throbber.gif"}var k=function(a){var b,c,g,h;return b=d.nodeToPost(a.o),c=-1===a.cr,g=b.post_meta.excluded===!1||b.post_type===f.linksPostType,allowed=!0,c&&g&&!h&&!f.allowTop&&(allowed=!1),bu.hooks.applyFilters("moveAllowed",allowed,a,e)},l=function(a){return bu.hooks.applyFilters("canSelectNode",a,e)},m=function(a){return bu.hooks.applyFilters("canHoverNode",a,e)},n=function(a){return bu.hooks.applyFilters("canDragNode",a,e)};g.treeConfig={plugins:["themes","types","json_data","ui","dnd","crrm","bu"],core:{animation:0,html_titles:!0},ui:{selected_parent_close:!1},themes:{theme:"bu",load_css:!1},dnd:{drag_container:document},types:{types:{"default":{max_children:-1,max_depth:-1,valid_children:"all",select_node:l,hover_node:m,start_drag:n},page:{max_children:-1,max_depth:-1,valid_children:"all",select_node:l,hover_node:m,start_drag:n},section:{max_children:-1,max_depth:-1,valid_children:"all",select_node:l,hover_node:m,start_drag:n},link:{max_children:0,max_depth:0,valid_children:"none",select_node:l,hover_node:m,start_drag:n}}},json_data:{ajax:{url:f.rpcUrl,type:"POST",data:function(a){var b;return b=-1===a?{ID:0}:d.nodeToPost(a),{child_of:b.ID,post_types:f.postTypes,post_statuses:f.postStatuses,instance:f.instance,prefix:f.nodePrefix,include_links:f.includeLinks}}},progressive_render:!0},crrm:{move:{default_position:"first",check_move:k}},bu:{lazy_load:f.lazyLoad}},f.showCounts&&(g.treeConfig.json_data.progressive_render=!1),f.initialTreeData&&(g.treeConfig.json_data.data=f.initialTreeData),g.treeConfig=bu.hooks.applyFilters("buNavTreeSettings",g.treeConfig,h),e.initialize=function(){return h.jstree(g.treeConfig),e},e.openPost=function(b,c){var e=d.getNodeForPost(b);return c=c||a.noop,e?void h.jstree("open_node",e,c,!0):!1},e.selectPost=function(a,b){b=b||!0;var c=d.getNodeForPost(a);b&&h.jstree("deselect_all"),h.jstree("select_node",c)},e.getSelectedPost=function(){var a=h.jstree("get_selected");return a.length?d.nodeToPost(a):!1},e.deselectAll=function(){h.jstree("deselect_all")},e.getPost=function(a){var b=d.getNodeForPost(a);return b?d.nodeToPost(b):!1},e.getPosts=function(b){var c,f=[],g={};return c=b?a.jstree._reference(h)._get_node("#"+b):h,c.find("> ul > li").each(function(b,c){c=a(c),g=d.nodeToPost(c),c.find("> ul > li").length&&(g.children=e.getPosts(c.attr("id"))),f.push(g)}),f},e.showAll=function(){h.jstree("open_all")},e.hideAll=function(){h.jstree("close_all")},e.getPostLabel=function(a){var b=d.getNodeForPost(a);return h.jstree("get_text",b)},e.setPostLabel=function(a,b){var c=d.getNodeForPost(a);h.jstree("set_text",c,b)},e.insertPost=function(a,b){if("undefined"==typeof a)throw new TypeError("Post argument for insertPost must be defined!");var c,f,g,i,j,k,l,m;return a.post_parent=a.post_parent||0,a.menu_order=a.menu_order||1,a.post_parent?(f=d.getNodeForPost(a.post_parent),i=e.getPost(a.post_parent)):f=h,1==a.menu_order?(g=f.find("> ul > li").get(0),m="before"):(j=a.menu_order-2,j>=0&&(g=f.find("> ul > li").get(j),m="after")),g||(g=f,m="inside"),k={which:g,position:m,callback:b||function(a){h.jstree("deselect_all"),h.jstree("select_node",a)}},a=bu.hooks.applyFilters("preInsertPost",a,i),l=d.postToNode(a),c=h.jstree("create_node",k.which,k.position,l,k.callback),a.ID||(a.ID=c.attr("id")),a},e.updatePost=function(b){var c,g,i=d.getNodeForPost(b);return i?(c=d.nodeToPost(i),g=a.extend(!0,{},c,b),h.jstree("set_text",i,g.post_title),g.post_parent=parseInt(g.post_parent,10),g.menu_order=parseInt(g.menu_order,10),i.data("post",g),f.showStatuses&&i.find("li").andSelf().each(function(){s(a(this))}),e.broadcast("postUpdated",[g]),g):!1},e.removePost=function(a){var b;a&&"undefined"==typeof a?(b=h.jstree("get_selected"),a=d.nodeToPost(b)):b=d.getNodeForPost(a),h.jstree("remove",b)},e.getAncestors=function(a){var b=d.getNodeForPost(a);return b===!1?!1:h.jstree("get_path",b)},e.save=function(){g.rollback=h.jstree("get_rollback")},e.restore=function(){"undefined"!=typeof g.rollback&&(g.rollback.d.ui.selected=a([]),a.jstree.rollback(g.rollback),g.rollback=h.jstree("get_rollback"))},e.lock=function(){h.jstree("lock")},e.unlock=function(){h.jstree("unlock")},d.nodeToPost=function(b){if("undefined"==typeof b)throw new TypeError("Invalid node!");var c,e;return c=b.attr("id"),e=a.extend({},!0,b.data("post")),-1===c.indexOf("post-new")&&(c=parseInt(d.stripNodePrefix(c),10)),e.ID=c,e.post_title=h.jstree("get_text",b),e.menu_order=b.index()+1,e.post_parent=parseInt(e.post_parent,10),e.originalParent=parseInt(e.originalParent,10),e.originalOrder=parseInt(e.originalOrder,10),e.post_meta=e.post_meta||{},bu.hooks.applyFilters("nodeToPost",e,b)},d.postToNode=function(b,c){if("undefined"==typeof b)throw new TypeError("Invalid post!");var e,g,h,i,c=c||!1;return e={post_title:"(no title)",post_content:"",post_status:"new",post_type:"page",post_parent:0,menu_order:1,post_meta:{},url:""},g=a.extend({},e,b),i=g.ID?f.nodePrefix+g.ID:"post-new-"+d.getNextPostID(),h={attr:{id:i,rel:d.getRelAttrForPost(b,c)},data:{title:g.post_title},metadata:{post:g}},bu.hooks.applyFilters("postToNode",h,g)},d.getNodeForPost=function(b){if("undefined"==typeof b)return!1;var c,d;return b&&"object"==typeof b?(c=b.ID.toString(),-1===c.indexOf("post-new")&&(c=f.nodePrefix+c)):(c=b.toString(),-1===c.indexOf("post-new")&&(c=f.nodePrefix+c)),d=a.jstree._reference(h)._get_node("#"+c),d.length?d:!1},d.getNextPostID=function(){var b=a('[id*="post-new-"]');return b.length},d.stripNodePrefix=function(a){return a.replace(f.nodePrefix,"")},d.getRelAttrForPost=function(a,b){var c;return c=b?"section":a.post_type==f.linksPostType?"link":"page"};var o=function(b,c){var d;d=b.find("li").length,p(b,d),c&&b.find("li").each(function(){o(a(this))})},p=function(a,b){var c,d=a.children("a");0===d.children(".title-count").children(".count").length&&d.children(".title-count").append('<span class="count"></span>'),c=d.find("> .title-count > .count").empty(),c.text(b?"("+b+")":"")},q=function(a){var b,c,d,e;if(a=a||!1,b={excluded:{"class":"excluded",label:f.statusBadgeExcluded,inherited:!1},"protected":{"class":"protected",label:f.statusBadgeProtected,inherited:!1}},c=bu.hooks.applyFilters("navStatusBadges",b),e=c,a){e={};for(d in c)c[d].hasOwnProperty("inherited")&&c[d].inherited&&(e[d]=c[d])}return e},r=function(b){var c,e,f,g;c=d.nodeToPost(b),e=q({inherited:!0});for(f in e)g=b.parentsUntil("#"+h.attr("id"),"li").filter(function(){return a(this).data("post").post_meta[f]||a(this).data("inherited_"+f)}).length,g?b.data("inherited_"+f,!0):b.removeData("inherited_"+f)},s=function(a){var b,c,e,f,g,h,i,j;b=a.children("a"),0===b.children(".post-statuses").length&&b.append('<span class="post-statuses"></span>'),e=b.children(".post-statuses").empty(),c=d.nodeToPost(a),f=[],r(a),"publish"!=c.post_status&&f.push({"class":c.post_status,label:c.post_status}),g=q();for(h in g)i=c.post_meta[h]||a.data("inherited_"+h),i&&f.push({"class":g[h]["class"],label:g[h].label});for(j=0;j<f.length;j+=1)e.append('<span class="post_status '+f[j]["class"]+'">'+f[j].label+"</span>")},t=function(a){var b;0===a.children("ul").length?a.attr("rel","page"):a.attr("rel","section"),f.showCounts&&(b=a.parent("ul").parent("div").attr("id")!=h.attr("id")?a.parents("li:last"):a,o(b,!0))};h.bind("loaded.jstree",function(){var a=h.find("> ul > li:first-child"),b=a.height()>=18?a.height():32;h.jstree("data").data.core.li_height=b,e.broadcast("postsLoaded")}),h.bind("reselect.jstree",function(){e.broadcast("postsSelected")}),h.bind("lazy_loaded.jstree",function(){e.broadcast("lazyLoadComplete")}),h.bind("load_node.jstree",function(a,b){if(-1!==b.rslt.obj){var c=b.rslt.obj;f.showCounts&&o(c,!0)}}),h.bind("clean_node.jstree",function(b,c){var d=c.rslt.obj;d&&-1!==d&&d.each(function(b,c){var d=a(c);d.data("buNavExtrasAdded")||(f.showStatuses&&s(d),d.data("buNavExtrasAdded",!0))})}),h.bind("before.jstree",function(a,b){var c;switch(b.func){case"select_node":case"hover_node":case"start_drag":if(c=b.inst._get_node(b.args[0]),c&&c.hasClass("denied"))return!1}}),h.bind("create_node.jstree",function(a,b){var c=b.rslt.obj,f=d.nodeToPost(c);e.broadcast("postCreated",[f])}),h.bind("select_node.jstree",function(a,b){var c=d.nodeToPost(b.rslt.obj);e.broadcast("postSelected",[c])}),h.bind("create.jstree",function(a,b){var c=b.rslt.obj,f=b.rslt.parent,g=b.rslt.position,h=d.nodeToPost(c),i=null;-1!==f&&(i=d.nodeToPost(f),t(f)),h.post_parent=i?i.ID:0,h.menu_order=g+1,e.broadcast("postInserted",[h])}),h.bind("remove.jstree",function(b,c){var f,g=c.rslt.obj,h=d.nodeToPost(g),i=c.rslt.parent;-1!==i&&t(i),e.broadcast("postRemoved",[h]),g.find("li").each(function(){f=d.nodeToPost(a(this)),f&&e.broadcast("postRemoved",[f])})}),h.bind("deselect_node.jstree",function(a,b){var c=d.nodeToPost(b.rslt.obj);e.broadcast("postDeselected",[c])}),h.bind("deselect_all.jstree",function(){e.broadcast("postsDeselected")}),h.bind("move_node.jstree",function(b,c){var f=c.rslt.o;f.each(function(b,f){var g,i=a(f),j=d.nodeToPost(i),k=c.rslt.np,l=c.rslt.op,m=i.index()+1,n=0,o=0,p=1;h.attr("id")!==k.attr("id")&&(t(k),n=parseInt(d.stripNodePrefix(k.attr("id")),10)),h.attr("id")===l.attr("id")||k.is("#"+l.attr("id"))||(t(l),g=d.nodeToPost(l),o=g.ID),p=j.menu_order,j.post_parent=n,j.menu_order=m,e.updatePost(j),e.broadcast("postMoved",[j,o,p])})});var u=function(b){if("undefined"!=typeof h[0]){var c=a.contains(h[0],b.target),d=a.contains(a("#vakata-contextmenu")[0],b.target);c||d||h.jstree("deselect_all")}};return f.deselectOnDocumentClick&&a(document).bind("click",u),e},navman:function(c,d){var e={};d=d||{},e=b.trees.base(c,d);var f=e.$el,g=e.data,h=e.config,i=function(a){var b=d.nodeToPost(a),c={edit:{label:h.optionsEditLabel,action:j},view:{label:h.optionsViewLabel,action:k},remove:{label:h.optionsTrashLabel,action:l}};return b.url||delete c.view,b.post_type===h.linksPostType&&(c.remove.label=h.optionsDeleteLabel),bu.hooks.applyFilters("navmanOptionsMenuItems",c,a)},j=function(a){var b=d.nodeToPost(a);e.broadcast("editPost",[b])},k=function(a){var b=d.nodeToPost(a);b.url&&window.open(b.url)},l=function(a){var b=d.nodeToPost(a);e.removePost(b)};g.treeConfig.plugins.push("contextmenu"),g.treeConfig.contextmenu={show_at_node:!1,items:i},f.bind("loaded.jstree",function(){f.undelegate("a","contextmenu.jstree")}),f.bind("clean_node.jstree",function(b,c){var d=c.rslt.obj;d&&-1!=d&&d.each(function(b,c){var d=a(c),e=d.children("a");if(!e.children(".edit-options").length){var f=a('<button class="edit-options"><ins class="jstree-icon"> </ins>'+h.optionsLabel+"</button>"),g=e.children(".post-statuses");g.length?g.before(f):e.append(f)}})});var m=null;f.delegate(".edit-options","click",function(b){b.preventDefault(),b.stopPropagation();var c,d,e,g,h,i;c=a(this).offset(),d=a(this).outerWidth(),e=a(this).outerHeight(),g=c.top,h=c.left,g+=e,h=h+d-180,i=a(this).closest("li"),f.jstree("deselect_all"),f.jstree("select_node",i),f.jstree("show_contextmenu",i,h,g),a(this).addClass("clicked"),m&&m.attr("id")!=i.attr("id")&&n(m),m=i}),a(document).bind("context_hide.vakata",function(){n(m)});var n=function(a){a&&a.find("> a > .edit-options").removeClass("clicked")};return f.addClass("bu-navman"),e},edit_post:function(c,d){d=d||{};var e=b.trees.base(c,d),f=e.data,g=a.extend(e.config,c||{}),h=e.$el,i=g.currentPost,j={};j.dnd={drag_container:g.treeDragContainer},a.extend(!0,f.treeConfig,j);var k=function(a,b){if(b.$el.is(e.$el.selector)){var c=d.stripNodePrefix(a.attr("id"));return c==i.ID}};bu.hooks.addFilter("canSelectNode",k),bu.hooks.addFilter("canHoverNode",k),bu.hooks.addFilter("canDragNode",k),h.bind("loaded.jstree",function(){var a;g.ancestors&&g.ancestors.length?(a=g.ancestors.reverse(),l(0,a)):m()});var l=function(a,b){var c=b[a];c?e.openPost(c,function(){l(a+1,b)})===!1&&e.insertPost(c,function(){l(a+1,b)}):m()},m=function(){var a=d.getNodeForPost(i);a?(e.selectPost(i),e.save()):e.insertPost(i,function(){e.selectPost(i),e.save()})};return e.getCurrentPost=function(){var a,b;return a=d.getNodeForPost(i),a?b=d.nodeToPost(a):!1},e.setCurrentPost=function(a){i=a},h.addClass("bu-edit-post"),e}}}(jQuery);1 var bu=bu||{};bu.plugins=bu.plugins||{},bu.plugins.navigation={},function(a){"use strict";bu.signals=function(){var b={};return b.listenFor=function(a,b){var c=this._listeners;void 0===c[a]&&(c[a]=[]),c[a].push(b)},b.broadcast=function(a,b){var c,d=this._listeners;if(d[a])for(c=0;c<d[a].length;c+=1)d[a][c].apply(this,b||[])},{register:function(c){c._listeners={},a.extend(!0,c,b)}}}(),bu.hooks=function(){var a={};return{addFilter:function(b,c){return void 0===a[b]&&(a[b]=[]),a[b].push(c),this},applyFilters:function(b,c){if(void 0===a[b])return c;var d,e=Array.prototype.slice.apply(arguments),f=e.slice(1),g=c;for(d=0;d<a[b].length;d+=1)g=a[b][d].apply(this,f);return g}}}()}(jQuery),function(a){var b=bu.plugins.navigation;b.settings={lazyLoad:!0,showCounts:!0,showStatuses:!0,deselectOnDocumentClick:!0},a(document).ready(function(){a.browser&&a.browser.msie&&(!0===a.browser.msie&&7===parseInt(a.browser.version,10)&&a(document.body).addClass("ie7"),!0===a.browser.msie&&8===parseInt(a.browser.version,10)&&a(document.body).addClass("ie8"),!0===a.browser.msie&&9===parseInt(a.browser.version,10)&&a(document.body).addClass("ie9"))}),b.tree=function(a,c){return void 0===a&&(a="base"),b.trees[a](c).initialize()},b.trees={base:function(c,d){var e={};d=d||{},bu.signals.register(e),e.config=a.extend({},b.settings,c||{}),e.data={treeConfig:{},rollback:void 0};var f=e.config,g=e.data,h=e.$el=a(f.el);if(f.themePath&&document.images){var i=new Image,j=new Image;i.src=f.themePath+"/sprite.png",j.src=f.themePath+"/throbber.gif"}var k=function(a){var b,c,g,h;b=d.nodeToPost(a.o),c=-1===a.cr,g=!1===b.post_meta.excluded||b.post_type===f.linksPostType;var i=!0;return c&&g&&!h&&!f.allowTop&&(i=!1),bu.hooks.applyFilters("moveAllowed",i,a,e)},l=function(a){return bu.hooks.applyFilters("canSelectNode",a,e)},m=function(a){return bu.hooks.applyFilters("canHoverNode",a,e)},n=function(a){return bu.hooks.applyFilters("canDragNode",a,e)};g.treeConfig={plugins:["themes","types","json_data","ui","dnd","crrm","bu"],core:{animation:0,html_titles:!0},ui:{selected_parent_close:!1},themes:{theme:"bu",load_css:!1},dnd:{drag_container:document},types:{types:{default:{max_children:-1,max_depth:-1,valid_children:"all",select_node:l,hover_node:m,start_drag:n},page:{max_children:-1,max_depth:-1,valid_children:"all",select_node:l,hover_node:m,start_drag:n},section:{max_children:-1,max_depth:-1,valid_children:"all",select_node:l,hover_node:m,start_drag:n},link:{max_children:0,max_depth:0,valid_children:"none",select_node:l,hover_node:m,start_drag:n}}},json_data:{ajax:{url:f.rpcUrl,type:"POST",data:function(a){var b;return b=-1===a?{ID:0}:d.nodeToPost(a),{child_of:b.ID,post_types:f.postTypes,post_statuses:f.postStatuses,instance:f.instance,prefix:f.nodePrefix,include_links:f.includeLinks}}},progressive_render:!0},crrm:{move:{default_position:"first",check_move:k}},bu:{lazy_load:f.lazyLoad}},f.showCounts&&(g.treeConfig.json_data.progressive_render=!1),f.initialTreeData&&(g.treeConfig.json_data.data=f.initialTreeData),g.treeConfig=bu.hooks.applyFilters("buNavTreeSettings",g.treeConfig,h),e.initialize=function(){return h.jstree(g.treeConfig),e},e.openPost=function(b,c){var e=d.getNodeForPost(b);if(c=c||a.noop,!e)return!1;h.jstree("open_node",e,c,!0)},e.selectPost=function(a,b){b=b||!0;var c=d.getNodeForPost(a);b&&h.jstree("deselect_all"),h.jstree("select_node",c)},e.getSelectedPost=function(){var a=h.jstree("get_selected");return!!a.length&&d.nodeToPost(a)},e.deselectAll=function(){h.jstree("deselect_all")},e.getPost=function(a){var b=d.getNodeForPost(a);return!!b&&d.nodeToPost(b)},e.getPosts=function(b){var c,f=[],g={};return c=b?a.jstree._reference(h)._get_node("#"+b):h,c.find("> ul > li").each(function(b,c){c=a(c),g=d.nodeToPost(c),c.find("> ul > li").length&&(g.children=e.getPosts(c.attr("id"))),f.push(g)}),f},e.showAll=function(){h.jstree("open_all")},e.hideAll=function(){h.jstree("close_all")},e.getPostLabel=function(a){var b=d.getNodeForPost(a);return h.jstree("get_text",b)},e.setPostLabel=function(a,b){var c=d.getNodeForPost(a);h.jstree("set_text",c,b)},e.insertPost=function(a,b){if(void 0===a)throw new TypeError("Post argument for insertPost must be defined!");var c,f,g,i,j,k,l,m;return a.post_parent=a.post_parent||0,a.menu_order=a.menu_order||1,a.post_parent?(f=d.getNodeForPost(a.post_parent),i=e.getPost(a.post_parent)):f=h,1==a.menu_order?(g=f.find("> ul > li").get(0),m="before"):(j=a.menu_order-2)>=0&&(g=f.find("> ul > li").get(j),m="after"),g||(g=f,m="inside"),k={which:g,position:m,callback:b||function(a){h.jstree("deselect_all"),h.jstree("select_node",a)}},a=bu.hooks.applyFilters("preInsertPost",a,i),l=d.postToNode(a),c=h.jstree("create_node",k.which,k.position,l,k.callback),a.ID||(a.ID=c.attr("id")),a},e.updatePost=function(b){var c,g,i=d.getNodeForPost(b);return!!i&&(c=d.nodeToPost(i),g=a.extend(!0,{},c,b),h.jstree("set_text",i,g.post_title),g.post_parent=parseInt(g.post_parent,10),g.menu_order=parseInt(g.menu_order,10),i.data("post",g),f.showStatuses&&i.find("li").andSelf().each(function(){s(a(this))}),e.broadcast("postUpdated",[g]),g)},e.removePost=function(a){var b;a&&void 0===a?(b=h.jstree("get_selected"),a=d.nodeToPost(b)):b=d.getNodeForPost(a),h.jstree("remove",b)},e.getAncestors=function(a){var b=d.getNodeForPost(a);return!1!==b&&h.jstree("get_path",b)},e.save=function(){g.rollback=h.jstree("get_rollback")},e.restore=function(){void 0!==g.rollback&&(g.rollback.d.ui.selected=a([]),a.jstree.rollback(g.rollback),g.rollback=h.jstree("get_rollback"))},e.lock=function(){h.jstree("lock")},e.unlock=function(){h.jstree("unlock")},d.nodeToPost=function(b){if(void 0===b)throw new TypeError("Invalid node!");var c,e;return c=b.attr("id"),e=a.extend({},!0,b.data("post")),-1===c.indexOf("post-new")&&(c=parseInt(d.stripNodePrefix(c),10)),e.ID=c,e.post_title=h.jstree("get_text",b),e.menu_order=b.index()+1,e.post_parent=parseInt(e.post_parent,10),e.originalParent=parseInt(e.originalParent,10),e.originalOrder=parseInt(e.originalOrder,10),e.post_meta=e.post_meta||{},bu.hooks.applyFilters("nodeToPost",e,b)},d.postToNode=function(b,c){if(void 0===b)throw new TypeError("Invalid post!");var e,g,h,i,c=c||!1;return e={post_title:"(no title)",post_content:"",post_status:"new",post_type:"page",post_parent:0,menu_order:1,post_meta:{},url:""},g=a.extend({},e,b),i=g.ID?f.nodePrefix+g.ID:"post-new-"+d.getNextPostID(),h={attr:{id:i,rel:d.getRelAttrForPost(b,c)},data:{title:g.post_title},metadata:{post:g}},bu.hooks.applyFilters("postToNode",h,g)},d.getNodeForPost=function(b){if(void 0===b)return!1;var c,d;return b&&"object"==typeof b?(c=b.ID.toString(),-1===c.indexOf("post-new")&&(c=f.nodePrefix+c)):(c=b.toString(),-1===c.indexOf("post-new")&&(c=f.nodePrefix+c)),d=a.jstree._reference(h)._get_node("#"+c),!!d.length&&d},d.getNextPostID=function(){return a('[id*="post-new-"]').length},d.stripNodePrefix=function(a){return a.replace(f.nodePrefix,"")},d.getRelAttrForPost=function(a,b){return b?"section":a.post_type==f.linksPostType?"link":"page"};var o=function(b,c){var d;d=b.find("li").length,p(b,d),c&&b.find("li").each(function(){o(a(this))})},p=function(a,b){var c,d=a.children("a");0===d.children(".title-count").children(".count").length&&d.children(".title-count").append('<span class="count"></span>'),c=d.find("> .title-count > .count").empty(),b?c.text("("+b+")"):c.text("")},q=function(a){var b,c,d,e;if(a=a||!1,b={excluded:{class:"excluded",label:f.statusBadgeExcluded,inherited:!1},protected:{class:"protected",label:f.statusBadgeProtected,inherited:!1}},c=bu.hooks.applyFilters("navStatusBadges",b),e=c,a){e={};for(d in c)c[d].hasOwnProperty("inherited")&&c[d].inherited&&(e[d]=c[d])}return e},r=function(b){var c,e,f;d.nodeToPost(b),c=q({inherited:!0});for(e in c)f=b.parentsUntil("#"+h.attr("id"),"li").filter(function(){return a(this).data("post").post_meta[e]||a(this).data("inherited_"+e)}).length,f?b.data("inherited_"+e,!0):b.removeData("inherited_"+e)},s=function(a){var b,c,e,f,g,h,i;b=a.children("a"),0===b.children(".post-statuses").length&&b.append('<span class="post-statuses"></span>'),e=b.children(".post-statuses").empty(),c=d.nodeToPost(a),f=[],r(a),"publish"!=c.post_status&&f.push({class:c.post_status,label:c.post_status}),g=q();for(h in g)(c.post_meta[h]||a.data("inherited_"+h))&&f.push({class:g[h].class,label:g[h].label});for(i=0;i<f.length;i+=1)e.append('<span class="post_status '+f[i].class+'">'+f[i].label+"</span>")},t=function(a){var b;0===a.children("ul").length?a.attr("rel","page"):a.attr("rel","section"),f.showCounts&&(b=a.parent("ul").parent("div").attr("id")!=h.attr("id")?a.parents("li:last"):a,o(b,!0))};h.on("loaded.jstree",function(a,b){var c=h.find("> ul > li:first-child"),d=c.height()>=18?c.height():32;h.jstree("data").data.core.li_height=d,e.broadcast("postsLoaded")}),h.on("reselect.jstree",function(a,b){e.broadcast("postsSelected")}),h.on("lazy_loaded.jstree",function(a,b){e.broadcast("lazyLoadComplete")}),h.on("load_node.jstree",function(a,b){if(-1!==b.rslt.obj){var c=b.rslt.obj;f.showCounts&&o(c,!0)}}),h.on("clean_node.jstree",function(b,c){var d=c.rslt.obj;d&&-1!==d&&d.each(function(b,c){var d=a(c);d.data("buNavExtrasAdded")||(f.showStatuses&&s(d),d.data("buNavExtrasAdded",!0))})}),h.on("before.jstree",function(a,b){var c;switch(b.func){case"select_node":case"hover_node":case"start_drag":if((c=b.inst._get_node(b.args[0]))&&c.hasClass("denied"))return!1}}),h.on("create_node.jstree",function(a,b){var c=b.rslt.obj,f=d.nodeToPost(c);e.broadcast("postCreated",[f])}),h.on("select_node.jstree",function(a,b){var c=d.nodeToPost(b.rslt.obj);e.broadcast("postSelected",[c])}),h.on("create.jstree",function(a,b){var c=b.rslt.obj,f=b.rslt.parent,g=b.rslt.position,h=d.nodeToPost(c),i=null;-1!==f&&(i=d.nodeToPost(f),t(f)),h.post_parent=i?i.ID:0,h.menu_order=g+1,e.broadcast("postInserted",[h])}),h.on("remove.jstree",function(b,c){var f,g=c.rslt.obj,h=d.nodeToPost(g),i=c.rslt.parent;-1!==i&&t(i),e.broadcast("postRemoved",[h]),g.find("li").each(function(){(f=d.nodeToPost(a(this)))&&e.broadcast("postRemoved",[f])})}),h.on("deselect_node.jstree",function(a,b){var c=d.nodeToPost(b.rslt.obj);e.broadcast("postDeselected",[c])}),h.on("deselect_all.jstree",function(a,b){e.broadcast("postsDeselected")}),h.on("move_node.jstree",function(b,c){c.rslt.o.each(function(b,f){var g,i=a(f),j=d.nodeToPost(i),k=c.rslt.np,l=c.rslt.op,m=i.index()+1,n=0,o=0,p=1;h.attr("id")!==k.attr("id")&&(t(k),n=parseInt(d.stripNodePrefix(k.attr("id")),10)),h.attr("id")===l.attr("id")||k.is("#"+l.attr("id"))||(t(l),g=d.nodeToPost(l),o=g.ID),p=j.menu_order,j.post_parent=n,j.menu_order=m,e.updatePost(j),e.broadcast("postMoved",[j,o,p])})});var u=function(b){if(void 0!==h[0]){var c=a.contains(h[0],b.target),d=a.contains(a("#vakata-contextmenu")[0],b.target);c||d||h.jstree("deselect_all")}};return f.deselectOnDocumentClick&&a(document).on("click",u),e},navman:function(c,d){var e={};d=d||{},e=b.trees.base(c,d);var f=e.$el,g=e.data,h=e.config,i=function(a){var b=d.nodeToPost(a),c={edit:{label:h.optionsEditLabel,action:j},view:{label:h.optionsViewLabel,action:k},remove:{label:h.optionsTrashLabel,action:l}};return b.url||delete c.view,b.post_type===h.linksPostType&&(c.remove.label=h.optionsDeleteLabel),bu.hooks.applyFilters("navmanOptionsMenuItems",c,a)},j=function(a){var b=d.nodeToPost(a);e.broadcast("editPost",[b])},k=function(a){var b=d.nodeToPost(a);b.url&&window.open(b.url)},l=function(a){var b=d.nodeToPost(a);e.removePost(b)};g.treeConfig.plugins.push("contextmenu"),g.treeConfig.contextmenu={show_at_node:!1,items:i},f.bind("loaded.jstree",function(a,b){f.undelegate("a","contextmenu.jstree")}),f.bind("clean_node.jstree",function(b,c){var d=c.rslt.obj;d&&-1!=d&&d.each(function(b,c){var d=a(c),e=d.children("a");if(!e.children(".edit-options").length){var f=a('<button class="edit-options"><ins class="jstree-icon"> </ins>'+h.optionsLabel+"</button>"),g=e.children(".post-statuses");g.length?g.before(f):e.append(f)}})});var m=null;f.delegate(".edit-options","click",function(b){b.preventDefault(),b.stopPropagation();var c,d,e,g,h,i;c=a(this).offset(),d=a(this).outerWidth(),e=a(this).outerHeight(),g=c.top,h=c.left,g+=e,h=h+d-180,i=a(this).closest("li"),f.jstree("deselect_all"),f.jstree("select_node",i),f.jstree("show_contextmenu",i,h,g),a(this).addClass("clicked"),m&&m.attr("id")!==i.attr("id")&&n(m),m=i}),a(document).on("context_hide.vakata",function(a,b){n(m)});var n=function(a){a&&a.find("> a > .edit-options").removeClass("clicked")};return f.addClass("bu-navman"),e},edit_post:function(c,d){d=d||{};var e=b.trees.base(c,d),f=e.data,g=a.extend(e.config,c||{}),h=e.$el,i=g.currentPost,j={};j.dnd={drag_container:g.treeDragContainer},a.extend(!0,f.treeConfig,j);var k=function(a,b){if(b.$el.is(e.$el.selector)){return d.stripNodePrefix(a.attr("id"))==i.ID}};bu.hooks.addFilter("canSelectNode",k),bu.hooks.addFilter("canHoverNode",k),bu.hooks.addFilter("canDragNode",k),h.bind("loaded.jstree",function(a,b){var c;g.ancestors&&g.ancestors.length?(c=g.ancestors.reverse(),l(0,c)):m()});var l=function(a,b){var c=b[a];c?!1===e.openPost(c,function(){l(a+1,b)})&&e.insertPost(c,function(c){l(a+1,b)}):m()},m=function(){d.getNodeForPost(i)?(e.selectPost(i),e.save()):e.insertPost(i,function(a){e.selectPost(i),e.save()})};return e.getCurrentPost=function(){var a;return!!(a=d.getNodeForPost(i))&&d.nodeToPost(a)},e.setCurrentPost=function(a){i=a},h.addClass("bu-edit-post"),e}}}(jQuery); -
bu-navigation/trunk/js/deletion.js
r1048298 r2369747 58 58 * @returns bool true/false (where true means delete the post, false means don't delete) 59 59 */ 60 $('a.submitdelete'). live('click', function(){60 $('a.submitdelete').on('click', function(){ 61 61 62 62 var id = ( typeof(inlineEditPost) != "undefined" ) ? inlineEditPost.getId(this) : parseInt($('#post_ID').val(), 10); … … 101 101 // if we have warnings 102 102 if (warnings.length) { 103 var multiple_warnings = warnings.length > 1 ? true : false;103 var multiple_warnings = warnings.length > 1; 104 104 // now warn them 105 105 return processResp({ ignore: false, msg: warnings.join('\n\n') }, multiple_warnings); -
bu-navigation/trunk/js/deletion.min.js
r1048298 r2369747 1 !function(a){a(function(){function b(b){var c={ignore:!0},d={action:"check_hidden_page",post_id:b};return a.ajax({url:ajaxurl,type:"POST",data:d,async:!1,success:function(a){var b=JSON.parse(a);c=b}}),c}function c(b,c){if(!b.ignore){var d=b.msg+"\n\n";return d+=c?bu_page_parent_deletion.confirmDeletePlural:bu_page_parent_deletion.confirmDeleteSingular, window.confirm(d)?!0:(a("#draft-ajax-loading").css("visibility","hidden"),!1)}return!0}a("a.submitdelete").live("click",function(){var d="undefined"!=typeof inlineEditPost?inlineEditPost.getId(this):parseInt(a("#post_ID").val(),10);if(d){var e=b(d);return c(e)}return!0}),a("#posts-filter").submit(function(){var d=null,e=[],f=0;if(a(this).find('select[name="action"],select[name="action2"]').filter('[value="trash"]')){for(var g=a(this).find('input[name="post[]"]:checked'),h=0;h<g.length;h++)f=a(g[h]).val(),d=b(f),d.ignore||e.push(d.msg);if(e.length){var i=e.length>1?!0:!1;return c({ignore:!1,msg:e.join("\n\n")},i)}}return!0})})}(jQuery);1 !function(a){a(function(){function b(b){var c={ignore:!0},d={action:"check_hidden_page",post_id:b};return a.ajax({url:ajaxurl,type:"POST",data:d,async:!1,success:function(a){var b=JSON.parse(a);c=b}}),c}function c(b,c){if(!b.ignore){var d=b.msg+"\n\n";return d+=c?bu_page_parent_deletion.confirmDeletePlural:bu_page_parent_deletion.confirmDeleteSingular,!!window.confirm(d)||(a("#draft-ajax-loading").css("visibility","hidden"),!1)}return!0}a("a.submitdelete").on("click",function(){var d="undefined"!=typeof inlineEditPost?inlineEditPost.getId(this):parseInt(a("#post_ID").val(),10);if(d){return c(b(d))}return!0}),a("#posts-filter").submit(function(){var d=null,e=[],f=0;if(a(this).find('select[name="action"],select[name="action2"]').filter('[value="trash"]')){for(var g=a(this).find('input[name="post[]"]:checked'),h=0;h<g.length;h++)f=a(g[h]).val(),d=b(f),d.ignore||e.push(d.msg);if(e.length){var i=e.length>1;return c({ignore:!1,msg:e.join("\n\n")},i)}}return!0})})}(jQuery); -
bu-navigation/trunk/js/manage.js
r1048298 r2369747 69 69 70 70 // Subscribe to relevant tree signals 71 Navtree.listenFor('editPost', $.proxy(this.editPost,this));72 73 Navtree.listenFor('postRemoved', $.proxy(this.postRemoved,this));74 Navtree.listenFor('postMoved', $.proxy(this.postMoved,this));75 Linkman.listenFor('linkInserted', $.proxy(this.linkInserted,this));76 Linkman.listenFor('linkUpdated', $.proxy(this.linkUpdated,this));71 Navtree.listenFor('editPost', this.editPost.bind(this)); 72 73 Navtree.listenFor('postRemoved', this.postRemoved.bind(this)); 74 Navtree.listenFor('postMoved', this.postMoved.bind(this)); 75 Linkman.listenFor('linkInserted', this.linkInserted.bind(this)); 76 Linkman.listenFor('linkUpdated', this.linkUpdated.bind(this)); 77 77 78 78 // Form submission 79 $(this.ui.form). bind('submit', $.proxy(this.save,this));80 $(this.ui.expandAllBtn). bind('click', this.expandAll);81 $(this.ui.collapseAllBtn). bind('click', this.collapseAll);79 $(this.ui.form).on('submit', this.save.bind(this)); 80 $(this.ui.expandAllBtn).on('click', this.expandAll); 81 $(this.ui.collapseAllBtn).on('click', this.collapseAll); 82 82 83 83 }, … … 274 274 275 275 var buttons = {}; 276 buttons[bu_navman_settings.confirmLinkBtn] = $.proxy(this.save,this);277 buttons[bu_navman_settings.cancelLinkBtn] = $.proxy(this.cancel,this);276 buttons[bu_navman_settings.confirmLinkBtn] = this.save.bind(this); 277 buttons[bu_navman_settings.cancelLinkBtn] = this.cancel.bind(this); 278 278 279 279 // Edit link dialog … … 288 288 289 289 // Prevent clicks in dialog/overlay from removing tree selections 290 $(document.body). delegate('.ui-widget-overlay, .ui-widget', 'click', this.stopPropagation);290 $(document.body).on('click', '.ui-widget-overlay, .ui-widget', this.stopPropagation); 291 291 292 292 // Add link event 293 $(this.ui.addBtn). bind('click', $.proxy(this.add,this));293 $(this.ui.addBtn).on('click', this.add.bind(this)); 294 294 295 295 // Enable/disable add link button with selection if allow top is false 296 Navtree.listenFor('postSelected', $.proxy(this.onPostSelected,this));297 Navtree.listenFor('postDeselected', $.proxy(this.onPostDeselected,this));298 Navtree.listenFor('postsDeselected', $.proxy(this.onPostDeselected,this));296 Navtree.listenFor('postSelected', this.onPostSelected.bind(this)); 297 Navtree.listenFor('postDeselected', this.onPostDeselected.bind(this)); 298 Navtree.listenFor('postsDeselected', this.onPostDeselected.bind(this)); 299 299 300 300 }, -
bu-navigation/trunk/js/manage.min.js
r1048298 r2369747 1 if("undefined"==typeof bu|| "undefined"==typeof bu.plugins.navigation||"undefined"==typeof bu.plugins.navigation.tree)throw new TypeError("BU Navigation Manager script dependencies have not been met!");!function(a){"use strict";bu.plugins.navigation.views=bu.plugins.navigation.views||{};var b,c,d;b=bu.plugins.navigation.views.Navman={el:"#nav-tree-container",ui:{form:"#navman_form",noticesContainer:"#navman-notices",movesField:"#navman-moves",insertsField:"#navman-inserts",updatesField:"#navman-updates",deletionsField:"#navman-deletions",expandAllBtn:"#navman_expand_all",collapseAllBtn:"#navman_collapse_all",saveBtn:"#bu_navman_save"},data:{dirty:!1,deletions:[],insertions:{},updates:{},moves:{}},initialize:function(){var b=this.settings=bu_navman_settings;b.el=this.el,d=bu.plugins.navigation.tree("navman",b),c.initialize({allowTop:!!b.allowTop,isSectionEditor:!!b.isSectionEditor}),d.listenFor("editPost",a.proxy(this.editPost,this)),d.listenFor("postRemoved",a.proxy(this.postRemoved,this)),d.listenFor("postMoved",a.proxy(this.postMoved,this)),c.listenFor("linkInserted",a.proxy(this.linkInserted,this)),c.listenFor("linkUpdated",a.proxy(this.linkUpdated,this)),a(this.ui.form).bind("submit",a.proxy(this.save,this)),a(this.ui.expandAllBtn).bind("click",this.expandAll),a(this.ui.collapseAllBtn).bind("click",this.collapseAll)},expandAll:function(a){a.preventDefault(),a.stopImmediatePropagation(),d.showAll()},collapseAll:function(a){a.preventDefault(),a.stopImmediatePropagation(),d.hideAll()},editPost:function(a){if(bu_navman_settings.linksPostType===a.post_type)c.edit(a);else{var b="post.php?action=edit&post="+a.ID;window.location=b}},linkInserted:function(a){this.data.insertions[a.ID]=a,this.data.dirty=!0},linkUpdated:function(a){"new"===a.post_status?this.data.insertions[a.ID]=a:this.data.updates[a.ID]=a,this.data.dirty=!0},postRemoved:function(a){var b=a.ID;b&&("undefined"!=typeof this.data.insertions[b]?delete this.data.insertions[b]:"undefined"!=typeof this.data.updates[b]?(delete this.data.updates[b],this.data.deletions.push(b),this.data.dirty=!0):"undefined"!=typeof this.data.moves[b]?(delete this.data.moves[b],this.data.deletions.push(b),this.data.dirty=!0):(this.data.deletions.push(b),this.data.dirty=!0))},postMoved:function(a){"new"!==a.post_status&&(this.data.moves[a.ID]=a,this.data.dirty=!0)},save:function(){var b,c=this.data.deletions,e={},f={},g={};a.each(this.data.insertions,function(a){b=d.getPost(a),b&&(g[b.ID]=b)}),a.each(this.data.updates,function(a){b=d.getPost(a),b&&(f[b.ID]=b)}),a.each(this.data.moves,function(a){b=d.getPost(a),b&&(e[b.ID]={ID:b.ID,post_status:b.post_status,post_type:b.post_type,post_parent:b.post_parent,menu_order:b.menu_order})}),a(this.ui.deletionsField).attr("value",JSON.stringify(c)),a(this.ui.insertsField).attr("value",JSON.stringify(g)),a(this.ui.updatesField).attr("value",JSON.stringify(f)),a(this.ui.movesField).attr("value",JSON.stringify(e));var h=a("<span>"+bu_navman_settings.saveNotice+"</span>");a(this.ui.saveBtn).prev("img").css("visibility","visible"),this.notice(h.html(),"message"),d.lock(),this.data.dirty=!1},notice:function(b,c,d){d=d||!0;var e=a(this.ui.noticesContainer),f="";d&&e.empty(),f="message"===c?"updated fade":"error",e.append('<div class="'+f+' below-h2"><p>'+b+"</p></div>")}},c=bu.plugins.navigation.views.Linkman={el:"#navman-link-editor",ui:{form:"#navman_editlink_form",addBtn:"#navman_add_link",urlField:"#editlink_address",labelField:"#editlink_label",targetNewField:"#editlink_target_new",targetSameField:"#editlink_target_same"},data:{currentLink:null,allowTop:!0,isSectionEditor:!1},initialize:function(b){b=b||{},a.extend(!0,this.data,b),bu.signals.register(this),this.$el=a(this.el),this.$form=a(this.ui.form);var c={};c[bu_navman_settings.confirmLinkBtn]=a.proxy(this.save,this),c[bu_navman_settings.cancelLinkBtn]=a.proxy(this.cancel,this),this.$el.dialog({autoOpen:!1,buttons:c,minWidth:400,width:500,modal:!0,resizable:!1}),a(document.body).delegate(".ui-widget-overlay, .ui-widget","click",this.stopPropagation),a(this.ui.addBtn).bind("click",a.proxy(this.add,this)),d.listenFor("postSelected",a.proxy(this.onPostSelected,this)),d.listenFor("postDeselected",a.proxy(this.onPostDeselected,this)),d.listenFor("postsDeselected",a.proxy(this.onPostDeselected,this))},add:function(c){c.preventDefault(),c.stopPropagation();var e,f="";a(c.currentTarget).parent("li").hasClass("disabled")?(e=d.getSelectedPost(),f=bu_navman_settings.noLinksNotice,e&&bu_navman_settings.linksPostType===e.post_type?f=bu_navman_settings.noChildLinkNotice+"\n\n"+bu_navman_settings.createLinkNotice:b.settings.isSectionEditor?f=bu_navman_settings.noTopLevelNotice+"\n\n"+bu_navman_settings.createLinkNotice:b.settings.allowTop||(f=bu_navman_settings.noTopLevelNotice+"\n\n"+bu_navman_settings.createLinkNotice+"\n\n"+bu_navman_settings.allowTopNotice),alert(f)):(this.data.currentLink={post_status:"new",post_type:bu_navman_settings.linksPostType,post_meta:{}},this.$el.dialog("option","title",bu_navman_settings.addLinkDialogTitle).dialog("open"))},edit:function(b){a(this.ui.urlField).attr("value",b.post_content),a(this.ui.labelField).attr("value",b.post_title),"new"===b.post_meta.bu_link_target?a(this.ui.targetNewField).attr("checked","checked"):a(this.ui.targetSameField).attr("checked","checked"),this.data.currentLink=b,this.$el.dialog("option","title",bu_navman_settings.editLinkDialogTitle).dialog("open")},save:function(b){if(b.preventDefault(),b.stopPropagation(),this.$form.valid()){var c,e,f=this.data.currentLink;f.post_content=a(this.ui.urlField).attr("value"),f.post_title=a(this.ui.labelField).attr("value"),f.url=f.post_content,f.post_meta.bu_link_target=a("input[name='editlink_target']:checked").attr("value"),e=d.getSelectedPost(),e?(f.post_parent=e.ID,f.menu_order=1):(f.post_parent=0,f.menu_order=1),"new"!==f.post_status||f.ID?(c=d.updatePost(f),this.broadcast("linkUpdated",[c])):(c=d.insertPost(f),this.broadcast("linkInserted",[c])),this.clear(),this.$el.dialog("close")}},cancel:function(a){a.preventDefault(),a.stopPropagation(),this.$el.dialog("close"),this.clear()},clear:function(){a(this.ui.urlField).attr("value",""),a(this.ui.labelField).attr("value",""),a(this.ui.targetSameField).attr("checked","checked"),a(this.ui.targetNewField).removeAttr("checked"),this.data.currentLink=null},onPostSelected:function(b){var c=!0;b.post_type==bu_navman_settings.linksPostType&&(c=!1),c=bu.hooks.applyFilters("navmanCanAddLink",c,b,d),c?a(this.ui.addBtn).parent("li").removeClass("disabled"):a(this.ui.addBtn).parent("li").addClass("disabled")},onPostDeselected:function(){var b=this.data.allowTop;b=bu.hooks.applyFilters("navmanCanAddLink",b),b?a(this.ui.addBtn).parent("li").removeClass("disabled"):a(this.ui.addBtn).parent("li").addClass("disabled")},stopPropagation:function(a){a.stopPropagation()}},window.onbeforeunload=function(){return b.data.dirty?bu_navman_settings.unloadWarning:void 0}}(jQuery),jQuery(document).ready(function(){"use strict";bu.plugins.navigation.views.Navman.initialize()});1 if("undefined"==typeof bu||void 0===bu.plugins.navigation||void 0===bu.plugins.navigation.tree)throw new TypeError("BU Navigation Manager script dependencies have not been met!");!function(a){"use strict";bu.plugins.navigation.views=bu.plugins.navigation.views||{};var b,c,d;b=bu.plugins.navigation.views.Navman={el:"#nav-tree-container",ui:{form:"#navman_form",noticesContainer:"#navman-notices",movesField:"#navman-moves",insertsField:"#navman-inserts",updatesField:"#navman-updates",deletionsField:"#navman-deletions",expandAllBtn:"#navman_expand_all",collapseAllBtn:"#navman_collapse_all",saveBtn:"#bu_navman_save"},data:{dirty:!1,deletions:[],insertions:{},updates:{},moves:{}},initialize:function(b){var e=this.settings=bu_navman_settings;e.el=this.el,d=bu.plugins.navigation.tree("navman",e),c.initialize({allowTop:!!e.allowTop,isSectionEditor:!!e.isSectionEditor}),d.listenFor("editPost",this.editPost.bind(this)),d.listenFor("postRemoved",this.postRemoved.bind(this)),d.listenFor("postMoved",this.postMoved.bind(this)),c.listenFor("linkInserted",this.linkInserted.bind(this)),c.listenFor("linkUpdated",this.linkUpdated.bind(this)),a(this.ui.form).on("submit",this.save.bind(this)),a(this.ui.expandAllBtn).on("click",this.expandAll),a(this.ui.collapseAllBtn).on("click",this.collapseAll)},expandAll:function(a){a.preventDefault(),a.stopImmediatePropagation(),d.showAll()},collapseAll:function(a){a.preventDefault(),a.stopImmediatePropagation(),d.hideAll()},editPost:function(a){if(bu_navman_settings.linksPostType===a.post_type)c.edit(a);else{var b="post.php?action=edit&post="+a.ID;window.location=b}},linkInserted:function(a){this.data.insertions[a.ID]=a,this.data.dirty=!0},linkUpdated:function(a){"new"===a.post_status?this.data.insertions[a.ID]=a:this.data.updates[a.ID]=a,this.data.dirty=!0},postRemoved:function(a){var b=a.ID;b&&(void 0!==this.data.insertions[b]?delete this.data.insertions[b]:void 0!==this.data.updates[b]?(delete this.data.updates[b],this.data.deletions.push(b),this.data.dirty=!0):void 0!==this.data.moves[b]?(delete this.data.moves[b],this.data.deletions.push(b),this.data.dirty=!0):(this.data.deletions.push(b),this.data.dirty=!0))},postMoved:function(a){"new"!==a.post_status&&(this.data.moves[a.ID]=a,this.data.dirty=!0)},save:function(b){var c,e=this.data.deletions,f={},g={},h={};a.each(this.data.insertions,function(a,b){(c=d.getPost(a))&&(h[c.ID]=c)}),a.each(this.data.updates,function(a,b){(c=d.getPost(a))&&(g[c.ID]=c)}),a.each(this.data.moves,function(a,b){(c=d.getPost(a))&&(f[c.ID]={ID:c.ID,post_status:c.post_status,post_type:c.post_type,post_parent:c.post_parent,menu_order:c.menu_order})}),a(this.ui.deletionsField).attr("value",JSON.stringify(e)),a(this.ui.insertsField).attr("value",JSON.stringify(h)),a(this.ui.updatesField).attr("value",JSON.stringify(g)),a(this.ui.movesField).attr("value",JSON.stringify(f));var i=a("<span>"+bu_navman_settings.saveNotice+"</span>");a(this.ui.saveBtn).prev("img").css("visibility","visible"),this.notice(i.html(),"message"),d.lock(),this.data.dirty=!1},notice:function(b,c,d){d=d||!0;var e=a(this.ui.noticesContainer),f="";d&&e.empty(),f="message"===c?"updated fade":"error",e.append('<div class="'+f+' below-h2"><p>'+b+"</p></div>")}},c=bu.plugins.navigation.views.Linkman={el:"#navman-link-editor",ui:{form:"#navman_editlink_form",addBtn:"#navman_add_link",urlField:"#editlink_address",labelField:"#editlink_label",targetNewField:"#editlink_target_new",targetSameField:"#editlink_target_same"},data:{currentLink:null,allowTop:!0,isSectionEditor:!1},initialize:function(b){b=b||{},a.extend(!0,this.data,b),bu.signals.register(this),this.$el=a(this.el),this.$form=a(this.ui.form);var c={};c[bu_navman_settings.confirmLinkBtn]=this.save.bind(this),c[bu_navman_settings.cancelLinkBtn]=this.cancel.bind(this),this.$el.dialog({autoOpen:!1,buttons:c,minWidth:400,width:500,modal:!0,resizable:!1}),a(document.body).on("click",".ui-widget-overlay, .ui-widget",this.stopPropagation),a(this.ui.addBtn).on("click",this.add.bind(this)),d.listenFor("postSelected",this.onPostSelected.bind(this)),d.listenFor("postDeselected",this.onPostDeselected.bind(this)),d.listenFor("postsDeselected",this.onPostDeselected.bind(this))},add:function(c){c.preventDefault(),c.stopPropagation();var e,f="";a(c.currentTarget).parent("li").hasClass("disabled")?(e=d.getSelectedPost(),f=bu_navman_settings.noLinksNotice,e&&bu_navman_settings.linksPostType===e.post_type?f=bu_navman_settings.noChildLinkNotice+"\n\n"+bu_navman_settings.createLinkNotice:b.settings.isSectionEditor?f=bu_navman_settings.noTopLevelNotice+"\n\n"+bu_navman_settings.createLinkNotice:b.settings.allowTop||(f=bu_navman_settings.noTopLevelNotice+"\n\n"+bu_navman_settings.createLinkNotice+"\n\n"+bu_navman_settings.allowTopNotice),alert(f)):(this.data.currentLink={post_status:"new",post_type:bu_navman_settings.linksPostType,post_meta:{}},this.$el.dialog("option","title",bu_navman_settings.addLinkDialogTitle).dialog("open"))},edit:function(b){a(this.ui.urlField).attr("value",b.post_content),a(this.ui.labelField).attr("value",b.post_title),"new"===b.post_meta.bu_link_target?a(this.ui.targetNewField).attr("checked","checked"):a(this.ui.targetSameField).attr("checked","checked"),this.data.currentLink=b,this.$el.dialog("option","title",bu_navman_settings.editLinkDialogTitle).dialog("open")},save:function(b){if(b.preventDefault(),b.stopPropagation(),this.$form.valid()){var c,e,f=this.data.currentLink;f.post_content=a(this.ui.urlField).attr("value"),f.post_title=a(this.ui.labelField).attr("value"),f.url=f.post_content,f.post_meta.bu_link_target=a("input[name='editlink_target']:checked").attr("value"),e=d.getSelectedPost(),e?(f.post_parent=e.ID,f.menu_order=1):(f.post_parent=0,f.menu_order=1),"new"!==f.post_status||f.ID?(c=d.updatePost(f),this.broadcast("linkUpdated",[c])):(c=d.insertPost(f),this.broadcast("linkInserted",[c])),this.clear(),this.$el.dialog("close")}},cancel:function(a){a.preventDefault(),a.stopPropagation(),this.$el.dialog("close"),this.clear()},clear:function(){a(this.ui.urlField).attr("value",""),a(this.ui.labelField).attr("value",""),a(this.ui.targetSameField).attr("checked","checked"),a(this.ui.targetNewField).removeAttr("checked"),this.data.currentLink=null},onPostSelected:function(b){var c=!0;b.post_type==bu_navman_settings.linksPostType&&(c=!1),c=bu.hooks.applyFilters("navmanCanAddLink",c,b,d),c?a(this.ui.addBtn).parent("li").removeClass("disabled"):a(this.ui.addBtn).parent("li").addClass("disabled")},onPostDeselected:function(){var b=this.data.allowTop;b=bu.hooks.applyFilters("navmanCanAddLink",b),b?a(this.ui.addBtn).parent("li").removeClass("disabled"):a(this.ui.addBtn).parent("li").addClass("disabled")},stopPropagation:function(a){a.stopPropagation()}},window.onbeforeunload=function(){if(b.data.dirty)return bu_navman_settings.unloadWarning}}(jQuery),jQuery(document).ready(function(a){"use strict";bu.plugins.navigation.views.Navman.initialize()}); -
bu-navigation/trunk/js/navigation-metabox.js
r1048298 r2369747 258 258 259 259 // Modal toolbar actions 260 $toolbar. delegate(c.navSaveBtn, 'click', that.onUpdateLocation);261 $toolbar. delegate(c.navCancelBtn, 'click', that.onCancelMove);260 $toolbar.on('click', c.navSaveBtn, that.onUpdateLocation); 261 $toolbar.on('click', c.navCancelBtn, that.onCancelMove); 262 262 263 263 // Store initial tree state, either after lazy load is complete or inital selection is made … … 291 291 292 292 // Restore navtree state on close (cancel) 293 $('#TB_window'). bind('unload tb_unload', function(e){293 $('#TB_window').on('unload tb_unload', function(e){ 294 294 295 295 if(!that.saving) { … … 306 306 that.scrollToSelection = function() { 307 307 var $tree, $node, $container, containerHeight, nodeOffset; 308 $tree = $(c.treeContainer) ,308 $tree = $(c.treeContainer); 309 309 $node = $tree.jstree('get_selected'); 310 310 … … 390 390 }; 391 391 392 $(window). resize(function(){ tb_position(); });392 $(window).on('resize', function(){ tb_position(); }); 393 393 394 394 })(jQuery); -
bu-navigation/trunk/js/navigation-metabox.min.js
r1048298 r2369747 1 if("undefined"==typeof bu|| "undefined"==typeof bu.plugins||"undefined"==typeof bu.plugins.navigation)throw new TypeError("BU Navigation Metabox dependencies have not been met!");!function(a){bu.plugins.navigation.views=bu.plugins.navigation.views||{};var b,c;b=bu.plugins.navigation.views.Metabox={el:"#bunavattrsdiv",ui:{treeContainer:"#edit-post-tree",moveBtn:"#move-post-button",breadcrumbs:"#bu-post-breadcrumbs"},inputs:{label:'[name="nav_label"]',visible:'[name="nav_display"]',postID:'[name="post_ID"]',originalStatus:'[name="original_post_status"]',parent:'[name="parent_id"]',order:'[name="menu_order"]',autoDraft:'[name="auto_draft"]'},data:{modalTree:void 0,breadcrumbs:"",label:""},initialize:function(){var b,c,d,e,f;return this.settings=nav_metabox_settings,this.settings.el=this.ui.treeContainer,this.settings.isNewPost=1==a(this.inputs.autoDraft).val()?!0:!1,b=a(this.inputs.originalStatus).val(),c=parseInt(a(this.inputs.parent).val(),10),d=parseInt(a(this.inputs.order).val(),10),e=a(this.inputs.label).val()||"(no title)",f=a(this.inputs.visible).attr("checked")||!1,this.settings.currentPost={ID:parseInt(a(this.inputs.postID).val(),10),post_title:e,post_status:"auto-draft"==b?"new":b,post_parent:c,menu_order:d,post_meta:{excluded:!f},originalParent:c,originalExclude:!f},a(this.ui.treeContainer).addClass("current-post-status-"+b),this.$el=a(this.el),this.loadNavTree(),this.attachHandlers(),this},loadNavTree:function(){"undefined"==typeof this.data.modalTree&&(this.data.modalTree=ModalPostTree(this.settings),this.data.modalTree.listenFor("locationUpdated",a.proxy(this.onLocationUpdated,this)))},attachHandlers:function(){this.$el.delegate(this.ui.moveBtn,"click",this.data.modalTree.open),this.$el.delegate(this.inputs.label,"blur",a.proxy(this.onLabelChange,this)),this.$el.delegate(this.inputs.visible,"click",a.proxy(this.onToggleVisibility,this))},onLabelChange:function(){var b=a(this.inputs.label).attr("value");this.settings.currentPost.post_title=b,c.updatePost(this.settings.currentPost),c.save(),this.updateBreadcrumbs(this.settings.currentPost)},onToggleVisibility:function(b){var d=a(b.target).attr("checked"),e=nav_metabox_settings.topLevelDisabled+"\n\n"+nav_metabox_settings.topLevelNotice;d&&!this.isAllowedInNavigationLists(this.settings.currentPost)?(b.preventDefault(),this.notify(e)):(this.settings.currentPost.post_meta.excluded=!d,c.updatePost(this.settings.currentPost),c.save())},onLocationUpdated:function(b){a(this.inputs.parent).val(b.post_parent),a(this.inputs.order).val(b.menu_order),this.updateBreadcrumbs(b),this.settings.currentPost=b},updateBreadcrumbs:function(b){var d,e,f;d=c.getAncestors(b.ID),d!==!1&&(e=a(this.ui.breadcrumbs).clone().empty(),a.each(d,function(b,c){f=a("<li></li>").html(c),b<d.length-1?f.append("<ul></ul>"):f.addClass("current"),0===b?e.append(f):e.find("ul").last().append(f)}),e.find("li").length>1?a(this.ui.breadcrumbs).replaceWith(e):a(this.ui.breadcrumbs).html('<li class="current">'+nav_metabox_settings.topLevelLabel+"</li>"))},isAllowedInNavigationLists:function(a){var b=a.originalExclude===!1&&0===a.originalParent;return b||0!==a.post_parent?!0:this.settings.allowTop},notify:function(a){alert(a)}},ModalPostTree=bu.plugins.navigation.views.ModalPostTree=function(b){var d={},e=d.conf={treeContainer:"#edit-post-tree",toolbarContainer:".post-placement-toolbar",navSaveBtn:"#bu-post-placement-save",navCancelBtn:"#bu-post-placement-cancel",treeDragContainer:"#TB_ajaxContent"};e=a.extend(e,b),bu.signals.register(d);var f,g=function(){return c=d.tree=bu.plugins.navigation.tree("edit_post",e),f=a(e.toolbarContainer),f.delegate(e.navSaveBtn,"click",d.onUpdateLocation),f.delegate(e.navCancelBtn,"click",d.onCancelMove),e.lazyLoad?c.listenFor("lazyLoadComplete",c.save):c.listenFor("postsSelected",c.save),d};return d.open=function(b){var e=a(window).width(),f=a(window).height(),g=e>720?720:e,h=b.target.title||b.target.name||null,i=b.target.href||b.target.alt,j=b.target.rel||!1;return i=i.replace(/&width=[0-9]+/g,""),i=i.replace(/&height=[0-9]+/g,""),i=i+"&width="+(g-80)+"&height="+(f-85),tb_show(h,i,j),d.scrollToSelection(),a("#TB_window").bind("unload tb_unload",function(){d.saving?d.saving=!1:c.restore()}),!1},d.scrollToSelection=function(){var b,c,d,f,g;b=a(e.treeContainer),c=b.jstree("get_selected"),c.length&&(d=a(e.treeDragContainer),f=d.innerHeight(),g=c.position().top+c.height()/2-f/2,g>0&&d.scrollTop(g))},d.onUpdateLocation=function(a){a.preventDefault(),d.broadcast("locationUpdated",[c.getCurrentPost()]),c.save(),d.saving=!0,tb_remove()},d.onCancelMove=function(a){a.preventDefault(),tb_remove()},g(b)}}(jQuery);var tb_position;!function(a){tb_position=function(){var b=a("#TB_window"),c=a(window).width(),d=a(window).height(),e=c>720?720:c,f=0;return a("body.admin-bar").length&&(f=28),b.size()&&(b.width(e-50).height(d-45-f),a("#TB_iframeContent").width(e-50).height(d-75-f),a("#TB_ajaxContent").width(e-80).height(d-92-f),b.css({"margin-left":"-"+parseInt((e-50)/2,10)+"px"}),"undefined"!=typeof document.body.style.maxWidth&&b.css({top:20+f+"px","margin-top":"0"})),a("a.thickbox").each(function(){var b=a(this).attr("href");b&&(b=b.replace(/&width=[0-9]+/g,""),b=b.replace(/&height=[0-9]+/g,""),a(this).attr("href",b+"&width="+(e-80)+"&height="+(d-85-f)))})},a(window).resize(function(){tb_position()})}(jQuery),jQuery(document).ready(function(){bu.plugins.navigation.metabox=bu.plugins.navigation.views.Metabox.initialize()});1 if("undefined"==typeof bu||void 0===bu.plugins||void 0===bu.plugins.navigation)throw new TypeError("BU Navigation Metabox dependencies have not been met!");!function(a){bu.plugins.navigation.views=bu.plugins.navigation.views||{};var b;bu.plugins.navigation.views.Metabox={el:"#bunavattrsdiv",ui:{treeContainer:"#edit-post-tree",moveBtn:"#move-post-button",breadcrumbs:"#bu-post-breadcrumbs"},inputs:{label:'[name="nav_label"]',visible:'[name="nav_display"]',postID:'[name="post_ID"]',originalStatus:'[name="original_post_status"]',parent:'[name="parent_id"]',order:'[name="menu_order"]',autoDraft:'[name="auto_draft"]'},data:{modalTree:void 0,breadcrumbs:"",label:""},initialize:function(){var b,c,d,e,f;return this.settings=nav_metabox_settings,this.settings.el=this.ui.treeContainer,this.settings.isNewPost=1==a(this.inputs.autoDraft).val(),b=a(this.inputs.originalStatus).val(),c=parseInt(a(this.inputs.parent).val(),10),d=parseInt(a(this.inputs.order).val(),10),e=a(this.inputs.label).val()||"(no title)",f=a(this.inputs.visible).attr("checked")||!1,this.settings.currentPost={ID:parseInt(a(this.inputs.postID).val(),10),post_title:e,post_status:"auto-draft"==b?"new":b,post_parent:c,menu_order:d,post_meta:{excluded:!f},originalParent:c,originalExclude:!f},a(this.ui.treeContainer).addClass("current-post-status-"+b),this.$el=a(this.el),this.loadNavTree(),this.attachHandlers(),this},loadNavTree:function(b){void 0===this.data.modalTree&&(this.data.modalTree=ModalPostTree(this.settings),this.data.modalTree.listenFor("locationUpdated",a.proxy(this.onLocationUpdated,this)))},attachHandlers:function(){this.$el.delegate(this.ui.moveBtn,"click",this.data.modalTree.open),this.$el.delegate(this.inputs.label,"blur",a.proxy(this.onLabelChange,this)),this.$el.delegate(this.inputs.visible,"click",a.proxy(this.onToggleVisibility,this))},onLabelChange:function(c){var d=a(this.inputs.label).attr("value");this.settings.currentPost.post_title=d,b.updatePost(this.settings.currentPost),b.save(),this.updateBreadcrumbs(this.settings.currentPost)},onToggleVisibility:function(c){var d=a(c.target).attr("checked"),e=nav_metabox_settings.topLevelDisabled+"\n\n"+nav_metabox_settings.topLevelNotice;d&&!this.isAllowedInNavigationLists(this.settings.currentPost)?(c.preventDefault(),this.notify(e)):(this.settings.currentPost.post_meta.excluded=!d,b.updatePost(this.settings.currentPost),b.save())},onLocationUpdated:function(b){a(this.inputs.parent).val(b.post_parent),a(this.inputs.order).val(b.menu_order),this.updateBreadcrumbs(b),this.settings.currentPost=b},updateBreadcrumbs:function(c){var d,e,f;!1!==(d=b.getAncestors(c.ID))&&(e=a(this.ui.breadcrumbs).clone().empty(),a.each(d,function(b,c){f=a("<li></li>").html(c),b<d.length-1?f.append("<ul></ul>"):f.addClass("current"),0===b?e.append(f):e.find("ul").last().append(f)}),e.find("li").length>1?a(this.ui.breadcrumbs).replaceWith(e):a(this.ui.breadcrumbs).html('<li class="current">'+nav_metabox_settings.topLevelLabel+"</li>"))},isAllowedInNavigationLists:function(a){return!((!1!==a.originalExclude||0!==a.originalParent)&&0===a.post_parent)||this.settings.allowTop},notify:function(a){alert(a)}},ModalPostTree=bu.plugins.navigation.views.ModalPostTree=function(c){var d={},e=d.conf={treeContainer:"#edit-post-tree",toolbarContainer:".post-placement-toolbar",navSaveBtn:"#bu-post-placement-save",navCancelBtn:"#bu-post-placement-cancel",treeDragContainer:"#TB_ajaxContent"};e=a.extend(e,c),bu.signals.register(d);var f,g=function(c){return b=d.tree=bu.plugins.navigation.tree("edit_post",e),f=a(e.toolbarContainer),f.on("click",e.navSaveBtn,d.onUpdateLocation),f.on("click",e.navCancelBtn,d.onCancelMove),e.lazyLoad?b.listenFor("lazyLoadComplete",b.save):b.listenFor("postsSelected",b.save),d};return d.open=function(c){var e=a(window).width(),f=a(window).height(),g=720<e?720:e,h=c.target.title||c.target.name||null,i=c.target.href||c.target.alt,j=c.target.rel||!1;return i=i.replace(/&width=[0-9]+/g,""),i=i.replace(/&height=[0-9]+/g,""),i=i+"&width="+(g-80)+"&height="+(f-85),tb_show(h,i,j),d.scrollToSelection(),a("#TB_window").on("unload tb_unload",function(a){d.saving?d.saving=!1:b.restore()}),!1},d.scrollToSelection=function(){var b,c,d,f,g;b=a(e.treeContainer),c=b.jstree("get_selected"),c.length&&(d=a(e.treeDragContainer),f=d.innerHeight(),(g=c.position().top+c.height()/2-f/2)>0&&d.scrollTop(g))},d.onUpdateLocation=function(a){a.preventDefault(),d.broadcast("locationUpdated",[b.getCurrentPost()]),b.save(),d.saving=!0,tb_remove()},d.onCancelMove=function(a){a.preventDefault(),tb_remove()},g(c)}}(jQuery);var tb_position;!function(a){tb_position=function(){var b=a("#TB_window"),c=a(window).width(),d=a(window).height(),e=720<c?720:c,f=0;return a("body.admin-bar").length&&(f=28),b.size()&&(b.width(e-50).height(d-45-f),a("#TB_iframeContent").width(e-50).height(d-75-f),a("#TB_ajaxContent").width(e-80).height(d-92-f),b.css({"margin-left":"-"+parseInt((e-50)/2,10)+"px"}),void 0!==document.body.style.maxWidth&&b.css({top:20+f+"px","margin-top":"0"})),a("a.thickbox").each(function(){var b=a(this).attr("href");b&&(b=b.replace(/&width=[0-9]+/g,""),b=b.replace(/&height=[0-9]+/g,""),a(this).attr("href",b+"&width="+(e-80)+"&height="+(d-85-f)))})},a(window).on("resize",function(){tb_position()})}(jQuery),jQuery(document).ready(function(){bu.plugins.navigation.metabox=bu.plugins.navigation.views.Metabox.initialize()}); -
bu-navigation/trunk/js/vendor/jquery.cookie.min.js
r1048298 r2369747 1 jQuery.cookie=function(a,b,c){if(arguments.length>1&&"[object Object]"!==String(b)){if(c=jQuery.extend({},c), (null===b||void 0===b)&&(c.expires=-1),"number"==typeof c.expires){var d=c.expires,e=c.expires=new Date;e.setDate(e.getDate()+d)}return b=String(b),document.cookie=[encodeURIComponent(a),"=",c.raw?b:encodeURIComponent(b),c.expires?"; expires="+c.expires.toUTCString():"",c.path?"; path="+c.path:"",c.domain?"; domain="+c.domain:"",c.secure?"; secure":""].join("")}c=b||{};var f,g=c.raw?function(a){return a}:decodeURIComponent;return(f=new RegExp("(?:^|; )"+encodeURIComponent(a)+"=([^;]*)").exec(document.cookie))?g(f[1]):null};1 jQuery.cookie=function(a,b,c){if(arguments.length>1&&"[object Object]"!==String(b)){if(c=jQuery.extend({},c),null!==b&&void 0!==b||(c.expires=-1),"number"==typeof c.expires){var d=c.expires,e=c.expires=new Date;e.setDate(e.getDate()+d)}return b=String(b),document.cookie=[encodeURIComponent(a),"=",c.raw?b:encodeURIComponent(b),c.expires?"; expires="+c.expires.toUTCString():"",c.path?"; path="+c.path:"",c.domain?"; domain="+c.domain:"",c.secure?"; secure":""].join("")}c=b||{};var f,g=c.raw?function(a){return a}:decodeURIComponent;return(f=new RegExp("(?:^|; )"+encodeURIComponent(a)+"=([^;]*)").exec(document.cookie))?g(f[1]):null}; -
bu-navigation/trunk/js/vendor/jquery.validate.min.js
r1048298 r2369747 1 !function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing"));var c=a.data(this[0],"validator");return c ?c:(c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.find("input, button").filter(".cancel").click(function(){c.cancelSubmit=!0}),c.settings.submitHandler&&this.find("input, button").filter(":submit").click(function(){c.submitButton=this}),this.submit(function(b){function d(){if(c.settings.submitHandler){if(c.submitButton)var b=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(c.submitButton.value).appendTo(c.currentForm);return c.settings.submitHandler.call(c,c.currentForm),c.submitButton&&b.remove(),!1}return!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){if(a(this[0]).is("form"))return this.validate().form();var b=!0,c=a(this[0].form).validate();return this.each(function(){b&=c.element(this)}),b},removeAttrs:function(b){var c={},d=this;return a.each(b.split(/\s/),function(a,b){c[b]=d.attr(b),d.removeAttr(b)}),c},rules:function(b,c){var d=this[0];if(b){var e=a.data(d.form,"validator").settings,f=e.rules,g=a.validator.staticRules(d);switch(b){case"add":a.extend(g,a.validator.normalizeRule(c)),f[d.name]=g,c.messages&&(e.messages[d.name]=a.extend(e.messages[d.name],c.messages));break;case"remove":if(!c)return delete f[d.name],g;var h={};return a.each(c.split(/\s/),function(a,b){h[b]=g[b],delete g[b]}),h}}var i=a.validator.normalizeRules(a.extend({},a.validator.metadataRules(d),a.validator.classRules(d),a.validator.attributeRules(d),a.validator.staticRules(d)),d);if(i.required){var j=i.required;delete i.required,i=a.extend({required:j},i)}return i}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+b.value)},filled:function(b){return!!a.trim(""+b.value)},unchecked:function(a){return!a.checked}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1==arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!=Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!=Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),c)}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:[],ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(a)).hide())},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(a){(a.name in this.submitted||a==this.lastElement)&&this.element(a)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this[0].form,"validator"),d="on"+b.type.replace(/^validate/,"");c.settings[d]&&c.settings[d].call(c,this[0])}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c=this.groups={};a.each(this.settings.groups,function(b,d){a.each(d.split(/\s/),function(a,d){c[d]=b})});var d=this.settings.rules;a.each(d,function(b,c){d[b]=a.validator.normalizeRule(c)}),a(this.currentForm).validateDelegate(":text, :password, :file, select, textarea","focusin focusout keyup",b).validateDelegate(":radio, :checkbox, select, option","click",b),this.settings.invalidHandler&&a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){b=this.clean(b),this.lastElement=b,this.prepareElement(b),this.currentElements=a(b);var c=this.check(b);return c?delete this.invalid[b.name]:this.invalid[b.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),c},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b=0;for(var c in a)b++;return b},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return 0==this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1==a.grep(this.errorList,function(a){return a.element.name==b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in c||!b.objectLength(a(this).rules())?!1:(c[this.name]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){return a(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},check:function(b){b=this.clean(b),this.checkable(b)&&(b=this.findByName(b.name).not(this.settings.ignore)[0]);var c=a(b).rules(),d=!1;for(var e in c){var f={method:e,parameters:c[e]};try{var g=a.validator.methods[e].call(this,b.value.replace(/\r/g,""),b,f.parameters);if("dependency-mismatch"==g){d=!0;continue}if(d=!1,"pending"==g)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!g)return this.formatAndAdd(b,f),!1}catch(h){throw this.settings.debug&&window.console&&console.log("exception occured when checking element "+b.id+", check the '"+f.method+"' method",h),h}}return d?void 0:(this.objectLength(c)&&this.successList.push(b),!0)},customMetaMessage:function(b,c){if(a.metadata){var d=this.settings.meta?a(b).metadata()[this.settings.meta]:a(b).metadata();return d&&d.messages&&d.messages[c]}},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor==String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a];return void 0},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customMetaMessage(b,c),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b.method),d=/\$?\{(\d+)\}/g;"function"==typeof c?c=c.call(this,b.parameters,a):d.test(c)&&(c=jQuery.format(c.replace(d,"{$1}"),b.parameters)),this.errorList.push({message:c,element:a}),this.errorMap[a.name]=c,this.submitted[a.name]=c},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){for(var a=0;this.errorList[a];a++){var b=this.errorList[a];this.settings.highlight&&this.settings.highlight.call(this,b.element,this.settings.errorClass,this.settings.validClass),this.showLabel(b.element,b.message)}if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(var a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(var a=0,c=this.validElements();c[a];a++)this.settings.unhighlight.call(this,c[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d=this.errorsFor(b);d.length?(d.removeClass().addClass(this.settings.errorClass),d.attr("generated")&&d.html(c)):(d=a("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(b),generated:!0}).addClass(this.settings.errorClass).html(c||""),this.settings.wrapper&&(d=d.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(d).length||(this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b))),!c&&this.settings.success&&(d.text(""),"string"==typeof this.settings.success?d.addClass(this.settings.success):this.settings.success(d)),this.toShow=this.toShow.add(d)},errorsFor:function(b){var c=this.idOrName(b);return this.errors().filter(function(){return a(this).attr("for")==c})},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){var c=this.currentForm;return a(document.getElementsByName(b)).map(function(a,d){return d.form==c&&d.name==b&&d||null})},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){return!a.validator.methods.required.call(this,a.trim(b.value),b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&0==this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0==this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},dateDE:{dateDE:!0},number:{number:!0},numberDE:{numberDE:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor==String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},attributeRules:function(b){var c={},d=a(b);for(var e in a.validator.methods){var f=d.attr(e);f&&(c[e]=f)}return c.maxlength&&/-1|2147483647|524288/.test(c.maxlength)&&delete c.maxlength,c},metadataRules:function(b){if(!a.metadata)return{};var c=a.data(b.form,"validator").settings.meta;return c?a(b).metadata()[c]:a(b).metadata()},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength","min","max"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){b[this]&&(b[this]=[Number(b[this][0]),Number(b[this][1])])}),a.validator.autoCreateRanges&&(b.min&&b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),b.minlength&&b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b.messages&&delete b.messages,b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!=d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";switch(c.nodeName.toLowerCase()){case"select":var e=a(c).val();return e&&e.length>0;case"input":if(this.checkable(c))return this.getLength(b,c)>0;default:return a.trim(b).length>0}},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e=this.previousValue(c);if(this.settings.messages[c.name]||(this.settings.messages[c.name]={}),e.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=e.message,d="string"==typeof d&&{url:d}||d,this.pending[c.name])return"pending";if(e.old===b)return e.valid;e.old=b;var f=this;this.startRequest(c);var g={};return g[c.name]=b,a.ajax(a.extend(!0,{url:d,mode:"abort",port:"validate"+c.name,dataType:"json",data:g,success:function(d){f.settings.messages[c.name].remote=e.originalMessage;var g=d===!0;if(g){var h=f.formSubmitted;f.prepareElement(c),f.formSubmitted=h,f.successList.push(c),f.showErrors()}else{var i={},j=d||f.defaultMessage(c,"remote");i[c.name]=e.message=a.isFunction(j)?j(b):j,f.showErrors(i)}e.valid=g,f.stopRequest(c,g)}},d)),"pending"},minlength:function(b,c,d){return this.optional(c)||this.getLength(a.trim(b),c)>=d},maxlength:function(b,c,d){return this.optional(c)||this.getLength(a.trim(b),c)<=d},rangelength:function(b,c,d){var e=this.getLength(a.trim(b),c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||c>=a},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},email:function(a,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(a)},url:function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a))},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9-]+/.test(a))return!1;var c=0,d=0,e=!1;a=a.replace(/\D/g,"");for(var f=a.length-1;f>=0;f--){var g=a.charAt(f),d=parseInt(g,10);e&&(d*=2)>9&&(d-=9),c+=d,e=!e}return c%10==0},accept:function(a,b,c){return c="string"==typeof c?c.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(b)||a.match(new RegExp(".("+c+")$","i"))},equalTo:function(b,c,d){var e=a(d).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()});return b==e.val()}}}),a.format=a.validator.format}(jQuery),function(a){var b={};if(a.ajaxPrefilter)a.ajaxPrefilter(function(a,c,d){var e=a.port;"abort"==a.mode&&(b[e]&&b[e].abort(),b[e]=d)});else{var c=a.ajax;a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"==e?(b[f]&&b[f].abort(),b[f]=c.apply(this,arguments)):c.apply(this,arguments)}}}(jQuery),function(a){jQuery.event.special.focusin||jQuery.event.special.focusout||!document.addEventListener||a.each({focus:"focusin",blur:"focusout"},function(b,c){function d(b){return b=a.event.fix(b),b.type=c,a.event.handle.call(this,b)}a.event.special[c]={setup:function(){this.addEventListener(b,d,!0)},teardown:function(){this.removeEventListener(b,d,!0)},handler:function(b){return arguments[0]=a.event.fix(b),arguments[0].type=c,a.event.handle.apply(this,arguments)}}}),a.extend(a.fn,{validateDelegate:function(b,c,d){return this.bind(c,function(c){var e=a(c.target);return e.is(b)?d.apply(e,arguments):void 0})}})}(jQuery);1 !function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing"));var c=a.data(this[0],"validator");return c||(c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.find("input, button").filter(".cancel").click(function(){c.cancelSubmit=!0}),c.settings.submitHandler&&this.find("input, button").filter(":submit").click(function(){c.submitButton=this}),this.submit(function(b){function d(){if(c.settings.submitHandler){if(c.submitButton)var b=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(c.submitButton.value).appendTo(c.currentForm);return c.settings.submitHandler.call(c,c.currentForm),c.submitButton&&b.remove(),!1}return!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){if(a(this[0]).is("form"))return this.validate().form();var b=!0,c=a(this[0].form).validate();return this.each(function(){b&=c.element(this)}),b},removeAttrs:function(b){var c={},d=this;return a.each(b.split(/\s/),function(a,b){c[b]=d.attr(b),d.removeAttr(b)}),c},rules:function(b,c){var d=this[0];if(b){var e=a.data(d.form,"validator").settings,f=e.rules,g=a.validator.staticRules(d);switch(b){case"add":a.extend(g,a.validator.normalizeRule(c)),f[d.name]=g,c.messages&&(e.messages[d.name]=a.extend(e.messages[d.name],c.messages));break;case"remove":if(!c)return delete f[d.name],g;var h={};return a.each(c.split(/\s/),function(a,b){h[b]=g[b],delete g[b]}),h}}var i=a.validator.normalizeRules(a.extend({},a.validator.metadataRules(d),a.validator.classRules(d),a.validator.attributeRules(d),a.validator.staticRules(d)),d);if(i.required){var j=i.required;delete i.required,i=a.extend({required:j},i)}return i}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+b.value)},filled:function(b){return!!a.trim(""+b.value)},unchecked:function(a){return!a.checked}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1==arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!=Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!=Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),c)}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:[],ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(a)).hide())},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(a){(a.name in this.submitted||a==this.lastElement)&&this.element(a)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this[0].form,"validator"),d="on"+b.type.replace(/^validate/,"");c.settings[d]&&c.settings[d].call(c,this[0])}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c=this.groups={};a.each(this.settings.groups,function(b,d){a.each(d.split(/\s/),function(a,d){c[d]=b})});var d=this.settings.rules;a.each(d,function(b,c){d[b]=a.validator.normalizeRule(c)}),a(this.currentForm).validateDelegate(":text, :password, :file, select, textarea","focusin focusout keyup",b).validateDelegate(":radio, :checkbox, select, option","click",b),this.settings.invalidHandler&&a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){b=this.clean(b),this.lastElement=b,this.prepareElement(b),this.currentElements=a(b);var c=this.check(b);return c?delete this.invalid[b.name]:this.invalid[b.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),c},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b=0;for(var c in a)b++;return b},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return 0==this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(a){}},findLastActive:function(){var b=this.lastActive;return b&&1==a.grep(this.errorList,function(a){return a.element.name==b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),!(this.name in c||!b.objectLength(a(this).rules()))&&(c[this.name]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){return a(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},check:function(b){b=this.clean(b),this.checkable(b)&&(b=this.findByName(b.name).not(this.settings.ignore)[0]);var c=a(b).rules(),d=!1;for(var e in c){var f={method:e,parameters:c[e]};try{var g=a.validator.methods[e].call(this,b.value.replace(/\r/g,""),b,f.parameters);if("dependency-mismatch"==g){d=!0;continue}if(d=!1,"pending"==g)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!g)return this.formatAndAdd(b,f),!1}catch(a){throw this.settings.debug&&window.console&&console.log("exception occured when checking element "+b.id+", check the '"+f.method+"' method",a),a}}if(!d)return this.objectLength(c)&&this.successList.push(b),!0},customMetaMessage:function(b,c){if(a.metadata){var d=this.settings.meta?a(b).metadata()[this.settings.meta]:a(b).metadata();return d&&d.messages&&d.messages[c]}},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor==String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a]},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customMetaMessage(b,c),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b.method),d=/\$?\{(\d+)\}/g;"function"==typeof c?c=c.call(this,b.parameters,a):d.test(c)&&(c=jQuery.format(c.replace(d,"{$1}"),b.parameters)),this.errorList.push({message:c,element:a}),this.errorMap[a.name]=c,this.submitted[a.name]=c},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){for(var a=0;this.errorList[a];a++){var b=this.errorList[a];this.settings.highlight&&this.settings.highlight.call(this,b.element,this.settings.errorClass,this.settings.validClass),this.showLabel(b.element,b.message)}if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(var a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(var a=0,c=this.validElements();c[a];a++)this.settings.unhighlight.call(this,c[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d=this.errorsFor(b);d.length?(d.removeClass().addClass(this.settings.errorClass),d.attr("generated")&&d.html(c)):(d=a("<"+this.settings.errorElement+"/>").attr({for:this.idOrName(b),generated:!0}).addClass(this.settings.errorClass).html(c||""),this.settings.wrapper&&(d=d.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(d).length||(this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b))),!c&&this.settings.success&&(d.text(""),"string"==typeof this.settings.success?d.addClass(this.settings.success):this.settings.success(d)),this.toShow=this.toShow.add(d)},errorsFor:function(b){var c=this.idOrName(b);return this.errors().filter(function(){return a(this).attr("for")==c})},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){var c=this.currentForm;return a(document.getElementsByName(b)).map(function(a,d){return d.form==c&&d.name==b&&d||null})},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return!this.dependTypes[typeof a]||this.dependTypes[typeof a](a,b)},dependTypes:{boolean:function(a,b){return a},string:function(b,c){return!!a(b,c.form).length},function:function(a,b){return a(b)}},optional:function(b){return!a.validator.methods.required.call(this,a.trim(b.value),b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&0==this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0==this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},dateDE:{dateDE:!0},number:{number:!0},numberDE:{numberDE:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor==String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},attributeRules:function(b){var c={},d=a(b);for(var e in a.validator.methods){var f=d.attr(e);f&&(c[e]=f)}return c.maxlength&&/-1|2147483647|524288/.test(c.maxlength)&&delete c.maxlength,c},metadataRules:function(b){if(!a.metadata)return{};var c=a.data(b.form,"validator").settings.meta;return c?a(b).metadata()[c]:a(b).metadata()},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(!1===e)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0===e.param||e.param:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength","min","max"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){b[this]&&(b[this]=[Number(b[this][0]),Number(b[this][1])])}),a.validator.autoCreateRanges&&(b.min&&b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),b.minlength&&b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b.messages&&delete b.messages,b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!=d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";switch(c.nodeName.toLowerCase()){case"select":var e=a(c).val();return e&&e.length>0;case"input":if(this.checkable(c))return this.getLength(b,c)>0;default:return a.trim(b).length>0}},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e=this.previousValue(c);if(this.settings.messages[c.name]||(this.settings.messages[c.name]={}),e.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=e.message,d="string"==typeof d&&{url:d}||d,this.pending[c.name])return"pending";if(e.old===b)return e.valid;e.old=b;var f=this;this.startRequest(c);var g={};return g[c.name]=b,a.ajax(a.extend(!0,{url:d,mode:"abort",port:"validate"+c.name,dataType:"json",data:g,success:function(d){f.settings.messages[c.name].remote=e.originalMessage;var g=!0===d;if(g){var h=f.formSubmitted;f.prepareElement(c),f.formSubmitted=h,f.successList.push(c),f.showErrors()}else{var i={},j=d||f.defaultMessage(c,"remote");i[c.name]=e.message=a.isFunction(j)?j(b):j,f.showErrors(i)}e.valid=g,f.stopRequest(c,g)}},d)),"pending"},minlength:function(b,c,d){return this.optional(c)||this.getLength(a.trim(b),c)>=d},maxlength:function(b,c,d){return this.optional(c)||this.getLength(a.trim(b),c)<=d},rangelength:function(b,c,d){var e=this.getLength(a.trim(b),c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||a<=c},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},email:function(a,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(a)},url:function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a))},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9-]+/.test(a))return!1;var c=0,d=0,e=!1;a=a.replace(/\D/g,"");for(var f=a.length-1;f>=0;f--){var g=a.charAt(f),d=parseInt(g,10);e&&(d*=2)>9&&(d-=9),c+=d,e=!e}return c%10==0},accept:function(a,b,c){return c="string"==typeof c?c.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(b)||a.match(new RegExp(".("+c+")$","i"))},equalTo:function(b,c,d){return b==a(d).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()}).val()}}}),a.format=a.validator.format}(jQuery),function(a){var b={};if(a.ajaxPrefilter)a.ajaxPrefilter(function(a,c,d){var e=a.port;"abort"==a.mode&&(b[e]&&b[e].abort(),b[e]=d)});else{var c=a.ajax;a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"==e?(b[f]&&b[f].abort(),b[f]=c.apply(this,arguments)):c.apply(this,arguments)}}}(jQuery),function(a){jQuery.event.special.focusin||jQuery.event.special.focusout||!document.addEventListener||a.each({focus:"focusin",blur:"focusout"},function(b,c){function d(b){return b=a.event.fix(b),b.type=c,a.event.handle.call(this,b)}a.event.special[c]={setup:function(){this.addEventListener(b,d,!0)},teardown:function(){this.removeEventListener(b,d,!0)},handler:function(b){return arguments[0]=a.event.fix(b),arguments[0].type=c,a.event.handle.apply(this,arguments)}}}),a.extend(a.fn,{validateDelegate:function(b,c,d){return this.bind(c,function(c){var e=a(c.target);if(e.is(b))return d.apply(e,arguments)})}})}(jQuery); -
bu-navigation/trunk/js/vendor/jstree/themes/bu-jstree/style.css
r977963 r2369747 212 212 } 213 213 214 @-moz-document url-prefix( ) {214 @-moz-document url-prefix(http) { 215 215 .jstree-bu .post-statuses { 216 216 margin-top: -16px; … … 283 283 } 284 284 285 @-moz-document url-prefix( ) {285 @-moz-document url-prefix(http) { 286 286 .jstree-bu .edit-options { 287 287 margin-top: -24px; -
bu-navigation/trunk/package.json
r1498420 r2369747 1 1 { 2 2 "name": "bu-navigation", 3 "version": "1.2.1 1",3 "version": "1.2.19", 4 4 "description": "Provides alternative navigation elements designed for blogs with large page counts", 5 5 "main": "bu-navigation.php", -
bu-navigation/trunk/phpunit.xml
r1048298 r2369747 12 12 </testsuite> 13 13 </testsuites> 14 15 <logging> 16 <log type="coverage-clover" target="build/logs/clover.xml"/> 17 </logging> 14 18 </phpunit> -
bu-navigation/trunk/readme.txt
r1498420 r2369747 3 3 Tags: navigation, hierarchical, post type, boston university, bu 4 4 Requires at least: 3.1 5 Tested up to: 4.6.16 Stable tag: 1.2.1 15 Tested up to: 5.5 6 Stable tag: 1.2.19 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 79 79 == Changelog == 80 80 81 = 1.2.19 = 82 83 * Update deprecated jQuery methods for 5.5 compatibility. (For 5.5, there is still a known bug with the "Add Link" functionality that adds external links to the navigation tree, which will be patched in a future release.) 84 85 = 1.2.18 = 86 87 * Fix phpunit test setup scripts. 88 89 = 1.2.17 = 90 91 * Add styling to override Yoast SEO Thickbox styles. 92 93 = 1.2.16 = 94 95 * Enqueues thickbox explicitly so that the nav modal will open in the block editor and hides the Block Page Attributes panel when BU Navigation is active. 96 97 = 1.2.15 = 98 99 * Add hash comparison before saving changes to post hierarchy in Change Order page. 100 101 = 1.2.13 = 102 103 * Add missing parameter to `the_title` filter call. Part 2. 104 105 = 1.2.12 = 106 107 * Add missing parameter to `the_title` filter call. 108 * Update unit test scripts. 109 * Setup Code Climate. 110 81 111 = 1.2.11 = 82 112 -
bu-navigation/trunk/templates/edit-order.php
r977963 r2369747 6 6 <div id="navman-container"> 7 7 <form method="post" id="navman_form" action=""> 8 <input type="hidden" id="navman-hash" name="navman-hash" value="<?php echo esc_attr( $tree->hierarchy->as_hash() ); ?>" /> 8 9 <input type="hidden" id="navman-moves" name="navman-moves" value="" /> 9 10 <input type="hidden" id="navman-inserts" name="navman-inserts" value="" />
Note: See TracChangeset
for help on using the changeset viewer.