Skip to content

Commit

Permalink
Merge pull request #55 from bu-ist/release/1.2.19
Browse files Browse the repository at this point in the history
Release/1.2.19
  • Loading branch information
jdub233 authored Aug 26, 2020
2 parents a11b13b + 7b4f12d commit 4676a05
Show file tree
Hide file tree
Showing 13 changed files with 95 additions and 64 deletions.
4 changes: 2 additions & 2 deletions bu-navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Author: Boston University (IS&T)
Author URI: http://sites.bu.edu/web/
Description: Provides alternative navigation elements designed for blogs with large page counts
Version: 1.2.18
Version: 1.2.19
Text Domain: bu-navigation
Domain Path: /languages
*/
Expand Down Expand Up @@ -60,7 +60,7 @@ class BU_Navigation_Plugin {
// Plugin settings
public $settings;

const VERSION = '1.2.15';
const VERSION = '1.2.19';

public function __construct() {

Expand Down
50 changes: 26 additions & 24 deletions js/bu-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ bu.plugins.navigation = {};

// DOM ready -- browser classes
$(document).ready(function () {
if( $.browser.msie === true && parseInt($.browser.version, 10) == 7 )
$(document.body).addClass('ie7');
if( $.browser.msie === true && parseInt($.browser.version, 10) == 8 )
$(document.body).addClass('ie8');
if( $.browser.msie === true && parseInt($.browser.version, 10) == 9 )
$(document.body).addClass('ie9');
if($.browser && $.browser.msie){
if( $.browser.msie === true && parseInt($.browser.version, 10) === 7 )
$(document.body).addClass('ie7');
if( $.browser.msie === true && parseInt($.browser.version, 10) === 8 )
$(document.body).addClass('ie8');
if( $.browser.msie === true && parseInt($.browser.version, 10) === 9 )
$(document.body).addClass('ie9');
}
});

// Tree constructor
Expand Down Expand Up @@ -164,7 +166,7 @@ bu.plugins.navigation = {};
isTopLevelMove = m.cr === -1;
isVisible = post.post_meta['excluded'] === false || post.post_type === c.linksPostType;

allowed = true;
var allowed = true;

// Don't allow top level posts if global option prohibits it
if (isTopLevelMove && isVisible && !wasTop && !c.allowTop) {
Expand Down Expand Up @@ -659,7 +661,7 @@ bu.plugins.navigation = {};

my.getRelAttrForPost = function(post, hasChildren) {
var rel;

if (hasChildren) {
rel = 'section';
} else {
Expand Down Expand Up @@ -811,7 +813,7 @@ bu.plugins.navigation = {};
// ======= jsTree Event Handlers ======= //

// Tree instance is loaded (before initial opens/selections are made)
$tree.bind('loaded.jstree', function( event, data ) {
$tree.on('loaded.jstree', function( event, data ) {

// jstree breaks spectacularly if the stylesheet hasn't set an li height
// when the tree is created -- this is what they call a hack...
Expand All @@ -823,21 +825,21 @@ bu.plugins.navigation = {};
});

// Run after initial node openings and selections have completed
$tree.bind('reselect.jstree', function( event, data ) {
$tree.on('reselect.jstree', function( event, data ) {

that.broadcast('postsSelected');

});

// Run after lazy load operation has completed
$tree.bind('lazy_loaded.jstree', function (event, data) {
$tree.on('lazy_loaded.jstree', function (event, data) {

that.broadcast('lazyLoadComplete');

});

// After node is loaded from server using json_data
$tree.bind('load_node.jstree', function( event, data ) {
$tree.on('load_node.jstree', function( event, data ) {
if( data.rslt.obj !== -1 ) {
var $node = data.rslt.obj;

Expand All @@ -848,7 +850,7 @@ bu.plugins.navigation = {};
});

// Append extra markup to each tree node
$tree.bind('clean_node.jstree', function( event, data ) {
$tree.on('clean_node.jstree', function( event, data ) {
var $nodes = data.rslt.obj;

// skip root node
Expand All @@ -873,7 +875,7 @@ bu.plugins.navigation = {};
}
});

$tree.bind('before.jstree', function (event, data) {
$tree.on('before.jstree', function (event, data) {
var $node;

switch (data.func) {
Expand All @@ -890,18 +892,18 @@ bu.plugins.navigation = {};

});

$tree.bind('create_node.jstree', function(event, data ) {
$tree.on('create_node.jstree', function(event, data ) {
var $node = data.rslt.obj;
var post = my.nodeToPost( $node );
that.broadcast( 'postCreated', [ post ] );
});

$tree.bind('select_node.jstree', function(event, data ) {
$tree.on('select_node.jstree', function(event, data ) {
var post = my.nodeToPost(data.rslt.obj);
that.broadcast('postSelected', [post]);
});

$tree.bind('create.jstree', function (event, data) {
$tree.on('create.jstree', function (event, data) {
var $node = data.rslt.obj,
$parent = data.rslt.parent,
position = data.rslt.position,
Expand All @@ -921,7 +923,7 @@ bu.plugins.navigation = {};
that.broadcast('postInserted', [post]);
});

$tree.bind('remove.jstree', function (event, data) {
$tree.on('remove.jstree', function (event, data) {
var $node = data.rslt.obj,
post = my.nodeToPost($node),
$oldParent = data.rslt.parent,
Expand All @@ -943,16 +945,16 @@ bu.plugins.navigation = {};
});
});

$tree.bind('deselect_node.jstree', function(event, data ) {
$tree.on('deselect_node.jstree', function(event, data ) {
var post = my.nodeToPost( data.rslt.obj );
that.broadcast('postDeselected', [post]);
});

$tree.bind('deselect_all.jstree', function (event, data) {
$tree.on('deselect_all.jstree', function (event, data) {
that.broadcast('postsDeselected');
});

$tree.bind('move_node.jstree', function (event, data ) {
$tree.on('move_node.jstree', function (event, data ) {
var $moved = data.rslt.o;

// Repeat move behavior for each moved node (handles multi-select)
Expand Down Expand Up @@ -1007,7 +1009,7 @@ bu.plugins.navigation = {};
};

if (c.deselectOnDocumentClick) {
$(document).bind( "click", deselectOnDocumentClick );
$(document).on( "click", deselectOnDocumentClick );
}

return that;
Expand Down Expand Up @@ -1142,14 +1144,14 @@ bu.plugins.navigation = {};

$(this).addClass('clicked');

if (currentMenuTarget && currentMenuTarget.attr('id') != obj.attr('id')) {
if (currentMenuTarget && currentMenuTarget.attr('id') !== obj.attr('id')) {
removeMenu(currentMenuTarget);
}
currentMenuTarget = obj;
});

// Remove active state on edit options button when the menu is removed
$(document).bind('context_hide.vakata', function(e, data){
$(document).on('context_hide.vakata', function(e, data){
removeMenu(currentMenuTarget);
});

Expand Down
2 changes: 1 addition & 1 deletion js/bu-navigation.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/deletion.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
* displays a warning confirmation box when a post is hidden and has children
* @returns bool true/false (where true means delete the post, false means don't delete)
*/
$('a.submitdelete').live('click', function(){
$('a.submitdelete').on('click', function(){

var id = ( typeof(inlineEditPost) != "undefined" ) ? inlineEditPost.getId(this) : parseInt($('#post_ID').val(), 10);

Expand Down Expand Up @@ -100,7 +100,7 @@

// if we have warnings
if (warnings.length) {
var multiple_warnings = warnings.length > 1 ? true : false;
var multiple_warnings = warnings.length > 1;
// now warn them
return processResp({ ignore: false, msg: warnings.join('\n\n') }, multiple_warnings);
}
Expand Down
2 changes: 1 addition & 1 deletion js/deletion.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions js/manage.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ if ((typeof bu === 'undefined') ||
Linkman.initialize({allowTop: !!settings.allowTop, isSectionEditor: !!settings.isSectionEditor});

// Subscribe to relevant tree signals
Navtree.listenFor('editPost', $.proxy(this.editPost, this));
Navtree.listenFor('editPost', this.editPost.bind(this));

Navtree.listenFor('postRemoved', $.proxy(this.postRemoved, this));
Navtree.listenFor('postMoved', $.proxy(this.postMoved, this));
Linkman.listenFor('linkInserted', $.proxy(this.linkInserted, this));
Linkman.listenFor('linkUpdated', $.proxy(this.linkUpdated, this));
Navtree.listenFor('postRemoved', this.postRemoved.bind(this));
Navtree.listenFor('postMoved', this.postMoved.bind(this));
Linkman.listenFor('linkInserted', this.linkInserted.bind(this));
Linkman.listenFor('linkUpdated', this.linkUpdated.bind(this));

// Form submission
$(this.ui.form).bind('submit', $.proxy(this.save, this));
$(this.ui.expandAllBtn).bind('click', this.expandAll);
$(this.ui.collapseAllBtn).bind('click', this.collapseAll);
$(this.ui.form).on('submit', this.save.bind(this));
$(this.ui.expandAllBtn).on('click', this.expandAll);
$(this.ui.collapseAllBtn).on('click', this.collapseAll);

},

Expand Down Expand Up @@ -273,8 +273,8 @@ if ((typeof bu === 'undefined') ||
this.$form = $(this.ui.form);

var buttons = {};
buttons[bu_navman_settings.confirmLinkBtn] = $.proxy(this.save, this);
buttons[bu_navman_settings.cancelLinkBtn] = $.proxy(this.cancel, this);
buttons[bu_navman_settings.confirmLinkBtn] = this.save.bind(this);
buttons[bu_navman_settings.cancelLinkBtn] = this.cancel.bind(this);

// Edit link dialog
this.$el.dialog({
Expand All @@ -287,15 +287,15 @@ if ((typeof bu === 'undefined') ||
});

// Prevent clicks in dialog/overlay from removing tree selections
$(document.body).delegate('.ui-widget-overlay, .ui-widget', 'click', this.stopPropagation);
$(document.body).on('click', '.ui-widget-overlay, .ui-widget', this.stopPropagation);

// Add link event
$(this.ui.addBtn).bind('click', $.proxy(this.add, this));
$(this.ui.addBtn).on('click', this.add.bind(this));

// Enable/disable add link button with selection if allow top is false
Navtree.listenFor('postSelected', $.proxy(this.onPostSelected, this));
Navtree.listenFor('postDeselected', $.proxy(this.onPostDeselected, this));
Navtree.listenFor('postsDeselected', $.proxy(this.onPostDeselected, this));
Navtree.listenFor('postSelected', this.onPostSelected.bind(this));
Navtree.listenFor('postDeselected', this.onPostDeselected.bind(this));
Navtree.listenFor('postsDeselected', this.onPostDeselected.bind(this));

},

Expand Down
Loading

0 comments on commit 4676a05

Please sign in to comment.