Trim trailing whites

git-svn-id: https://develop.svn.wordpress.org/trunk@13268 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2010-02-21 00:03:42 +00:00
parent 42c92f9fdc
commit f24e88359e
23 changed files with 570 additions and 570 deletions
+1 -1
View File
@@ -249,7 +249,7 @@ case 'unapprovecomment' :
wp_set_comment_status( $comment_id, 'hold' );
$redir = add_query_arg( array( 'unapproved' => 1 ), $redir );
break;
}
}
wp_redirect( $redir );
die;
+1 -1
View File
@@ -8,7 +8,7 @@
* @package WordPress
* @subpackage Administration
*/
.fix{clear: both;height: 1px;margin: -1px 0 0;overflow: hidden;}
#no-js {display:block;}
+113 -113
View File
@@ -9,7 +9,7 @@
* @package WordPress
* @subpackage Administration
*/
require_once('admin.php');
wp_admin_css( 'custom-navigation' );
@@ -28,9 +28,9 @@ wp_custom_navigation();
function wp_custom_nav_reset() {
wp_custom_navigation_setup(true);
return true;
}
@@ -46,20 +46,20 @@ function wp_custom_navigation() {
<div class="wrap">
<div id="no-js"><h3>You do not have JavaScript enabled in your browser. Please enable it to access the Custom Menu functionality.</h3></div>
<?php
$messagesdiv = '';
$menu_id_in_edit = 0;
// Get the theme name
$themename = get_current_theme();
// Check which menu is selected and if menu is in edit already
if ( isset( $_POST['switch_menu'] ) )
$menu_selected_id = $_POST['menu_select'];
elseif ( isset( $_POST['menu_id_in_edit'] ) )
$menu_selected_id = $_POST['menu_id_in_edit'];
// Default Menu to show
$custom_menus = get_terms( 'menu', array( 'hide_empty' => false ) );
if ( !empty( $custom_menus ) )
@@ -74,12 +74,12 @@ function wp_custom_navigation() {
}
}
}
if ( isset( $_POST['set_wp_menu'] ) ) {
update_option( 'wp_custom_nav_menu', $_POST['enable_wp_menu'] );
$messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$themename.'s Custom Menu has been updated!</p></div>';
}
}
if ( isset( $_POST['licount'] ) )
$postCounter = $_POST['licount'];
else
@@ -93,13 +93,13 @@ function wp_custom_navigation() {
$existing_term = get_term_by( 'name', $insert_menu_name, 'menu' );
if ( $existing_term ) {
$messagesdiv = '<div id="message" class="error fade below-h2"><p>'.$insert_menu_name.' Menu has already created - please try another name</p></div>';
} else {
} else {
$term = wp_insert_term( $insert_menu_name, 'menu' );
if ( $term ) {
$custom_menus[$term['term_id']] = $term;
$menu_selected_id = $term['term_id'];
$menu_id_in_edit = $menu_selected_id;
$messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$insert_menu_name.' Menu has been created!</p></div>';
$messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$insert_menu_name.' Menu has been created!</p></div>';
$postCounter = 0;
}
@@ -108,8 +108,8 @@ function wp_custom_navigation() {
$messagesdiv = '<div id="message" class="error fade below-h2"><p>Please enter a valid Menu name</p></div>';
}
}
if ( isset($_POST['reset_wp_menu']) ) {
if ( isset($_POST['reset_wp_menu']) ) {
$success = wp_custom_nav_reset();
if ($success) {
// DISPLAY SUCCESS MESSAGE IF Menu Reset Correctly
@@ -128,7 +128,7 @@ function wp_custom_navigation() {
$update_fields = array( 'menu_order', 'guid', 'post_content', 'post_title', 'post_excerpt', 'post_content_filtered' );
//Loop through all POST variables
for ($k = 1;$k<= $postCounter; $k++) {
if (isset($_POST['dbid'.$k])) { $db_id = $_POST['dbid'.$k]; } else { $db_id = 0; }
if (isset($_POST['postmenu'.$k])) { $post_id = $_POST['postmenu'.$k]; } else { $post_id = 0; }
//@todo implement heirarchy
@@ -142,7 +142,7 @@ function wp_custom_navigation() {
if (isset($_POST['linktype'.$k])) { $linktype = $_POST['linktype'.$k]; } else { $linktype = 'custom'; }
if (isset($_POST['anchortitle'.$k])) { $custom_anchor_title = stripslashes($_POST['anchortitle'.$k]); } else { $custom_anchor_title = $custom_title; }
if (isset($_POST['newwindow'.$k])) { $new_window = $_POST['newwindow'.$k]; } else { $new_window = 0; }
$post = array( 'post_status' => 'publish', 'post_type' => 'menu_item', 'post_author' => $user_ID,
'ping_status' => 0, 'post_parent' => $post_id, '`menu_order' => $position,
'guid' => $custom_linkurl, 'post_excerpt' => $custom_anchor_title, 'tax_input' => array( 'menu' => $menu_title ),
@@ -175,43 +175,43 @@ function wp_custom_navigation() {
//DISPLAY SUCCESS MESSAGE IF POST CORRECT
$messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$themename.'s Custom Menu has been updated!</p></div>';
}
//DISPLAY Custom Navigation
?>
<div id="pages-left">
<div class="inside">
<h2 class="maintitle">Custom Navigation</h2>
<?php
//CHECK if custom menu has been enabled
$enabled_menu = get_option('wp_custom_nav_menu');
$checked = strtolower($enabled_menu);
if ($checked == 'true') {
} else {
echo '<div id="message-enabled" class="error fade below-h2"><p><strong>The Custom Menu has not been Enabled yet. Please enable it in order to use it --------></strong></p></div>';
}
?>
<?php echo $messagesdiv; ?>
<form onsubmit="updatepostdata()" action="custom-navigation.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="licount" id="licount" value="0" />
<input type="hidden" name="menu_id_in_edit" id="menu_id_in_edit" value="<?php echo $menu_selected_id; ?>" />
<div class="sidebar-name">
<div class="sidebar-name-arrow">
<br/>
</div>
<h3><?php echo $menu_title; ?></h3>
</div>
<div id="nav-container">
<ul id="custom-nav">
<?php
//DISPLAY existing menu
if ( $menu_selected_id > 0 ) {
@@ -219,59 +219,59 @@ function wp_custom_navigation() {
$output_type = "backend";
//MAIN OUTPUT FUNCTION
wp_custom_navigation_output( 'type='.$output_type.'&name='.$menu_title.'&id='.$menu_selected_id );
}
}
?>
</ul>
</div><!-- /#nav-container -->
<p class="submit">
<script type="text/javascript">
updatepostdata();
updatepostdata();
</script>
<input id="save_bottom" name="save_bottom" type="submit" value="Save All Changes" /></p>
</div><!-- /.inside -->
</div>
<div id="menu-right">
<h2 class="heading">Options</h2>
<div class="widgets-holder-wrap">
<div class="sidebar-name">
<div class="sidebar-name-arrow"></div>
<h3>Setup Custom Menu</h3>
</div>
<div class="widget-holder">
<?php
//SETUP Custom Menu
$enabled_menu = get_option('wp_custom_nav_menu');
$checked = strtolower($enabled_menu);
?>
<span >
<label>Enable</label><input type="radio" name="enable_wp_menu" value="true" <?php if ($checked=='true') { echo 'checked="checked"'; } ?> />
<label>Disable</label><input type="radio" name="enable_wp_menu" value="false" <?php if ($checked=='true') { } else { echo 'checked="checked"'; } ?> />
</span><!-- /.checkboxes -->
</span><!-- /.checkboxes -->
<input id="set_wp_menu" type="submit" value="Set Menu" name="set_wp_menu" class="button" /><br />
<span>
<label>Reset Menu to Default</label>
<input id="reset_wp_menu" type="submit" value="Reset" name="reset_wp_menu" class="button" onclick="return confirm('Are you sure you want to RESET the Custom Navigation Menu to its Default Settings?');" />
</span>
<div class="fix"></div>
</div>
</div><!-- /.widgets-holder-wrap -->
<div class="widgets-holder-wrap">
<div class="sidebar-name">
<div class="sidebar-name-arrow"></div>
@@ -279,8 +279,8 @@ function wp_custom_navigation() {
</div>
<div class="widget-holder">
<select id="menu_select" name="menu_select">
<?php
<?php
//DISPLAY SELECT OPTIONS
foreach( $custom_menus as $menu ) {
$menu_term = get_term( $menu, 'menu' );
@@ -291,15 +291,15 @@ function wp_custom_navigation() {
?>
<option value="<?php echo $menu_term->term_id; ?>" <?php echo $selected_option; ?>><?php echo $menu_term->name; ?></option>
<?php
}
?>
</select>
<input id="switch_menu" type="submit" value="Switch" name="switch_menu" class="button" />
<input id="add_menu_name" name="add_menu_name" type="text" value="" />
<input id="add_menu" type="submit" value="Add Menu" name="add_menu" class="button" />
<div class="fix"></div>
</div>
</div><!-- /.widgets-holder-wrap -->
@@ -309,25 +309,25 @@ function wp_custom_navigation() {
<div class="sidebar-name-arrow"></div>
<h3>Top Level Menu Descriptions</h3>
</div>
<div class="widget-holder">
<div class="widget-holder">
<span>Display Descriptions in Top Level Menu?</span>
<?php
//UPDATE and DISPLAY Menu Description Option
if (isset($_POST['menu-descriptions']))
{
if (isset($_POST['switch_menu'])) {
}
else {
$menu_options_to_edit = $_POST['menu_id_in_edit'];
update_option('wp_settings_custom_nav_'.$menu_options_to_edit.'_descriptions',$_POST['menu-descriptions']);
update_option('wp_settings_custom_nav_'.$menu_options_to_edit.'_descriptions',$_POST['menu-descriptions']);
}
}
if ($menu_id_in_edit > 0)
{
$checkedraw = get_option('wp_settings_custom_nav_'.$menu_id_in_edit.'_descriptions');
@@ -335,16 +335,16 @@ function wp_custom_navigation() {
else {
$checkedraw = get_option('wp_settings_custom_nav_'.$menu_selected_id.'_descriptions');
}
$checked = strtolower($checkedraw);
if ($advanced_option_descriptions == 'no')
{
$checked = 'no';
}
?>
<span class="checkboxes">
<label>Yes</label><input type="radio" name="menu-descriptions" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> />
<label>No</label><input type="radio" name="menu-descriptions" value="no" <?php if ($checked=='yes') { } else { echo 'checked="checked"'; } ?> />
@@ -353,16 +353,16 @@ function wp_custom_navigation() {
<div class="fix"></div>
</div>
</div><!-- /.widgets-holder-wrap -->
<div class="widgets-holder-wrap">
<div class="sidebar-name">
<div class="sidebar-name-arrow"></div>
<h3>Add an Existing Page</h3>
</div>
<div class="widget-holder">
<?php
$pages_args = array(
'child_of' => 0,
'sort_order' => 'ASC',
@@ -377,8 +377,8 @@ function wp_custom_navigation() {
'exclude_tree' => '',
'number' => '',
'offset' => 0 );
//GET all pages
//GET all pages
$pages_array = get_pages($pages_args);
$page_name = '';
//CHECK if pages exist
@@ -386,7 +386,7 @@ function wp_custom_navigation() {
{
foreach ($pages_array as $post)
{
//Add page name to
//Add page name to
$page_name .= htmlentities($post->post_title).'|';
}
}
@@ -394,43 +394,43 @@ function wp_custom_navigation() {
{
$page_name = "No pages available";
}
?>
<script>
jQuery(document).ready(function(){
//GET PHP pages
var dataposts = "<?php echo $page_name; ?>".split("|");
//Set autocomplete
jQuery("#page-search").autocomplete(dataposts);
//Handle autocomplete result
jQuery("#page-search").result(function(event, data, formatted) {
jQuery('#existing-pages').css('display','block');
jQuery("#existing-pages dt:contains('" + data + "')").css("display", "block");
jQuery('#show-pages').hide();
jQuery('#hide-pages').show();
});
jQuery('#existing-pages').css('display','none');
});
</script>
<input type="text" onfocus="jQuery('#page-search').attr('value','');" id="page-search" value="Search Pages" />
<a id="show-pages" style="cursor:pointer;" onclick="jQuery('#existing-pages').css('display','block');jQuery('#page-search').attr('value','');jQuery('#existing-pages dt').css('display','block');jQuery('#show-pages').hide();jQuery('#hide-pages').show();">View All</a>
<input type="text" onfocus="jQuery('#page-search').attr('value','');" id="page-search" value="Search Pages" />
<a id="show-pages" style="cursor:pointer;" onclick="jQuery('#existing-pages').css('display','block');jQuery('#page-search').attr('value','');jQuery('#existing-pages dt').css('display','block');jQuery('#show-pages').hide();jQuery('#hide-pages').show();">View All</a>
<a id="hide-pages" style="cursor:pointer;" onclick="jQuery('#existing-pages').css('display','none');jQuery('#page-search').attr('value','Search Pages');jQuery('#existing-pages dt').css('display','none');jQuery('#show-pages').show();jQuery('#hide-pages').hide();">Hide All</a>
<script type="text/javascript">
jQuery('#hide-pages').hide();
</script>
<ul id="existing-pages" class="list">
<?php
$intCounter = 0;
@@ -438,40 +438,40 @@ function wp_custom_navigation() {
$intCounter = wp_custom_nav_get_pages($intCounter,'default');
?>
</ul>
<div class="fix"></div>
</div>
</div><!-- /.widgets-holder-wrap -->
<div class="widgets-holder-wrap">
<div class="sidebar-name">
<div class="sidebar-name-arrow"></div>
<h3>Add an Existing Category</h3>
</div>
<div class="widget-holder">
<?php
//Custom GET categories query
$categories = $wpdb->get_results("SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = 'category' ORDER BY term_id ASC");
$cat_name = '';
//CHECK for results
if ($categories)
{
foreach($categories as $category)
{
foreach($categories as $category)
{
$cat_id = $category->term_id;
$cat_args=array(
'orderby' => 'name',
'include' => $cat_id,
'hierarchical' => 1,
'order' => 'ASC'
);
$category_names=get_categories($cat_args);
if (isset($category_names[0]->name))
{
//Add category name to data string
@@ -483,7 +483,7 @@ function wp_custom_navigation() {
{
$cat_name = "No categories available";
}
?>
<script>
@@ -491,48 +491,48 @@ function wp_custom_navigation() {
//GET PHP categories
var datacats = "<?php echo $cat_name; ?>".split("|");
//Set autocomplete
jQuery("#cat-search").autocomplete(datacats);
//Handle autocomplete result
jQuery("#cat-search").result(function(event, data, formatted) {
jQuery('#existing-categories').css('display','block');
jQuery("#existing-categories dt:contains('" + data + "')").css("display", "block");
jQuery('#show-cats').hide();
jQuery('#hide-cats').show();
});
jQuery('#existing-categories').css('display','none');
});
</script>
<input type="text" onfocus="jQuery('#cat-search').attr('value','');" id="cat-search" value="Search Categories" />
<a id="show-cats" style="cursor:pointer;" onclick="jQuery('#existing-categories').css('display','block');jQuery('#cat-search').attr('value','');jQuery('#existing-categories dt').css('display','block');jQuery('#show-cats').hide();jQuery('#hide-cats').show();">View All</a>
<input type="text" onfocus="jQuery('#cat-search').attr('value','');" id="cat-search" value="Search Categories" />
<a id="show-cats" style="cursor:pointer;" onclick="jQuery('#existing-categories').css('display','block');jQuery('#cat-search').attr('value','');jQuery('#existing-categories dt').css('display','block');jQuery('#show-cats').hide();jQuery('#hide-cats').show();">View All</a>
<a id="hide-cats" style="cursor:pointer;" onclick="jQuery('#existing-categories').css('display','none');jQuery('#cat-search').attr('value','Search Categories');jQuery('#existing-categories dt').css('display','none');jQuery('#show-cats').show();jQuery('#hide-cats').hide();">Hide All</a>
<script type="text/javascript">
jQuery('#hide-cats').hide();
</script>
<ul id="existing-categories" class="list">
<?php
//Get default Categories
$intCounter = wp_custom_nav_get_categories($intCounter,'default');
$intCounter = wp_custom_nav_get_categories($intCounter,'default');
?>
</ul>
<div class="fix"></div>
</div>
</div><!-- /.widgets-holder-wrap -->
<div class="widgets-holder-wrap">
<div class="sidebar-name">
<div class="sidebar-name-arrow"></div>
@@ -551,16 +551,16 @@ function wp_custom_navigation() {
<div class="fix"></div>
</div>
</div><!-- /.widgets-holder-wrap -->
</div>
</div>
<script type="text/javascript">
document.getElementById('pages-left').style.display='block';
document.getElementById('menu-right').style.display='block';
document.getElementById('no-js').style.display='none';
</script>
<div id="dialog-confirm" title="Edit Menu Item">
</label><input id="edittitle" type="text" name="edittitle" value="" /><label class="editlabel" for="edittitle">Menu Title</label><br />
<input id="editlink" type="text" name="editlink" value="" /><label class="editlabel" for="editlink">URL</label><br />
+5 -5
View File
@@ -224,7 +224,7 @@ if ( empty($tags_per_page) || $tags_per_page < 1 )
if ( 'post_tag' == $taxonomy ) {
$tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
$tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); // Old filter
} elseif ( 'category' == $taxonomy ) {
} elseif ( 'category' == $taxonomy ) {
$tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page ); // Old filter
} else {
$tags_per_page = apply_filters( 'edit_' . $taxonomy . '_per_page', $tags_per_page );
@@ -304,10 +304,10 @@ if ( $page_links )
</form>
<?php if ( 'category' == $taxonomy ) : ?>
<div class="form-wrap">
<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category <strong>%s</strong>.'), apply_filters('the_category', get_cat_name(get_option('default_category')))) ?></p>
<p><?php printf(__('Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.'), 'admin.php?import=wp-cat2tag') ?></p>
</div>
<div class="form-wrap">
<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category <strong>%s</strong>.'), apply_filters('the_category', get_cat_name(get_option('default_category')))) ?></p>
<p><?php printf(__('Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.'), 'admin.php?import=wp-cat2tag') ?></p>
</div>
<?php endif; ?>
@@ -8,7 +8,7 @@
* @package WordPress
* @subpackage Administration
*/
/*
* Init Functions
*/
@@ -23,37 +23,37 @@ jQuery(function($)
modal: true,
buttons: {
'Save': function() {
titletosave = $('#edittitle').attr('value');
linktosave = $('#editlink').attr('value');
anchortitletosave = $('#editanchortitle').attr('value');
newwindowtosave = $('#editnewwindow').attr('value');
desctosave = $('#editdescription').attr('value');
$('#title' + $(this).dialog('option', 'itemID')).attr('value',titletosave);
$('#linkurl' + $(this).dialog('option', 'itemID')).attr('value',linktosave);
$('#anchortitle' + $(this).dialog('option', 'itemID')).attr('value',anchortitletosave);
$('#newwindow' + $(this).dialog('option', 'itemID')).attr('value',newwindowtosave);
$('#description' + $(this).dialog('option', 'itemID')).attr('value',desctosave);
$('#menu-' + $(this).dialog('option', 'itemID') + ' > dl > dt > span.title').text(titletosave);
$('#view' + + $(this).dialog('option', 'itemID')).attr('href', linktosave);
$(this).dialog('close');
},
Cancel: function() {
$(this).dialog('close');
}
}
});
$('#message').animate({ opacity: 1.0 },2000).fadeOut(300, function(){ $(this).remove();});
//Add dropzone
$('#custom-nav li').prepend('<div class="dropzone"></div>');
$('#custom-nav li').prepend('<div class="dropzone"></div>');
//Make li items draggable
$('#custom-nav li').draggable({
handle: ' > dl',
@@ -68,70 +68,70 @@ jQuery(function($)
{
accept: '#custom-nav li',
tolerance: 'pointer',
drop: function(e, ui)
drop: function(e, ui)
{
var li = $(this).parent();
var child = !$(this).hasClass('dropzone');
//Add UL to first child
if (child && li.children('ul').length == 0)
if (child && li.children('ul').length == 0)
{
li.append('<ul id="sub-menu" />');
}
//Make it draggable
if (child)
if (child)
{
li.children('ul').append(ui.draggable);
}
else
else
{
li.before(ui.draggable);
}
li.find('dl,.dropzone').css({ backgroundColor: '', borderColor: '' });
var draggablevalue = ui.draggable.attr('value');
var droppablevalue = li.attr('value');
li.find('#menu-' + draggablevalue).find('#parent' + draggablevalue).val(droppablevalue);
li.find('#menu-' + draggablevalue).find('#parent' + draggablevalue).val(droppablevalue);
$(this).parent().find("dt").removeAttr('style');
$(this).parent().find("div:first").removeAttr('style');
},
over: function()
over: function()
{
//Add child
if ($(this).attr('class') == 'dropzone ui-droppable')
if ($(this).attr('class') == 'dropzone ui-droppable')
{
$(this).parent().find("div:first").css('background', 'none').css('height', '50px');
}
//Add above
else if ($(this).attr('class') == 'ui-droppable')
else if ($(this).attr('class') == 'ui-droppable')
{
$(this).parent().find("dt:first").css('background', '#d8d8d8');
}
//do nothing
else {
}
var parentid = $(this).parent().attr('id');
},
out: function()
out: function()
{
$(this).parent().find("dt").removeAttr('style');
$(this).parent().find("div:first").removeAttr('style');
$(this).filter('.dropzone').css({ borderColor: '' });
},
deactivate: function()
{
{
}
});
//Handle Save Button Clicks
//Handle Save Button Clicks
$('#save_top').click(function()
{
updatepostdata();
@@ -140,7 +140,7 @@ jQuery(function($)
{
updatepostdata();
});
});
@@ -8,22 +8,22 @@
* @package WordPress
* @subpackage Administration
*/
/*
* Removes menu items from current menu
* @param int o - the id of the menu li to remove.
*/
function removeitem(o)
function removeitem(o)
{
var todelete = document.getElementById('menu-' + o);
if (todelete)
{
{
var parenttodelete = document.getElementById('menu-' + o).parentNode;
throwaway_node = parenttodelete.removeChild(todelete);
}
throwaway_node = parenttodelete.removeChild(todelete);
}
updatepostdata();
};
@@ -31,50 +31,50 @@ function removeitem(o)
* Loads dialog window to edit menu items from current menu
* @param int o - the id of the menu li to edit.
*/
function edititem(o)
function edititem(o)
{
itemTitle = jQuery('#title' + o).attr('value');
itemURL = jQuery('#linkurl' + o).attr('value');
itemAnchorTitle = jQuery('#anchortitle' + o).attr('value');
itemNewWindow = jQuery('#newwindow' + o).attr('value');
itemDesc = jQuery('#description' + o).attr('value');
jQuery('#dialog-confirm').dialog( 'option' , 'itemID' , o )
jQuery('#dialog-confirm').dialog('open');
jQuery('#edittitle').attr('value', itemTitle);
jQuery('#editlink').attr('value', itemURL);
jQuery('#editanchortitle').attr('value', itemAnchorTitle);
jQuery("#editnewwindow option[value='" + itemNewWindow + "']").attr('selected', 'selected');
jQuery('#editdescription').attr('value', itemDesc);
};
/*
* Prepares menu items for POST
*/
function updatepostdata()
{
function updatepostdata()
{
var i = 0;
jQuery("#custom-nav").find("li").each(function(i) {
i = i + 1;
var j = jQuery(this).attr('value');
jQuery(this).find('#position' + j).attr('value', i);
jQuery(this).attr('id','menu-' + i);
jQuery(this).attr('value', i);
jQuery(this).find('#dbid' + j).attr('name','dbid' + i);
jQuery(this).find('#dbid' + j).attr('id','dbid' + i);
jQuery(this).find('#postmenu' + j).attr('name','postmenu' + i);
jQuery(this).find('#postmenu' + j).attr('id','postmenu' + i);
var p = jQuery(this).find('#parent' + j).parent().parent().parent().attr('value');
jQuery(this).find('#parent' + j).attr('name','parent' + i);
jQuery(this).find('#parent' + j).attr('id','parent' + i);
if (p) {
@@ -84,33 +84,33 @@ function updatepostdata()
//reset p to be top level
p = 0;
}
jQuery(this).find('#parent' + j).attr('value', p);
jQuery(this).find('#title' + j).attr('name','title' + i);
jQuery(this).find('#title' + j).attr('id','title' + i);
jQuery(this).find('#linkurl' + j).attr('name','linkurl' + i);
jQuery(this).find('#linkurl' + j).attr('id','linkurl' + i);
jQuery(this).find('#description' + j).attr('name','description' + i);
jQuery(this).find('#description' + j).attr('id','description' + i);
jQuery(this).find('#icon' + j).attr('name','icon' + i);
jQuery(this).find('#icon' + j).attr('id','icon' + i);
jQuery(this).find('#position' + j).attr('name','position' + i);
jQuery(this).find('#position' + j).attr('id','position' + i);
jQuery(this).find('#linktype' + j).attr('name','linktype' + i);
jQuery(this).find('#linktype' + j).attr('id','linktype' + i);
jQuery(this).find('#anchortitle' + j).attr('name','anchortitle' + i);
jQuery(this).find('#anchortitle' + j).attr('id','anchortitle' + i);
jQuery(this).find('#newwindow' + j).attr('name','newwindow' + i);
jQuery(this).find('#newwindow' + j).attr('id','newwindow' + i);
jQuery(this).find('dl > dt > span > #remove' + j).attr('value', i);
jQuery(this).find('dl > dt > span > #remove' + j).attr('onClick', 'removeitem(' + i + ')');
jQuery(this).find('dl > dt > span > #remove' + j).attr('id','remove' + i);
@@ -118,10 +118,10 @@ function updatepostdata()
jQuery('#licount').attr('value',i);
});
};
};
/*
* Adds item from Page, Category, or Custom options menu
@@ -132,8 +132,8 @@ function updatepostdata()
* @param int itemid - menu id.
* @param int itemparentid - default 0.
* @param string itemdescription - the description of the menu item.
*/
function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparentid,itemdescription)
*/
function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparentid,itemdescription)
{
var inputvaluevarname = '';
var inputvaluevarurl = '';
@@ -142,7 +142,7 @@ function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparent
var inputdescription = '';
var inputicon = '';
if (additemtype == 'Custom')
if (additemtype == 'Custom')
{
inputvaluevarname = document.getElementById('custom_menu_item_name').value;
inputvaluevarurl = document.getElementById('custom_menu_item_url').value;
@@ -159,7 +159,7 @@ function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparent
inputparentid = '0';
inputlinktype = 'page';
inputdescription = htmlentities(itemdescription.toString());
}
else if (additemtype == 'Category')
{
@@ -170,7 +170,7 @@ function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparent
inputlinktype = 'category';
inputdescription = htmlentities(itemdescription.toString());
}
else
else
{
inputvaluevarname = '';
inputvaluevarname = '';
@@ -179,40 +179,40 @@ function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparent
inputlinktype = 'custom';
inputdescription = '';
}
var count=document.getElementById('custom-nav').getElementsByTagName('li').length;
var randomnumber = count;
var validatetest = 0;
try
try
{
var test=document.getElementById("menu-" + randomnumber.toString()).value;
}
catch (err)
catch (err)
{
validatetest = 1;
}
while (validatetest == 0)
while (validatetest == 0)
{
randomnumber = randomnumber + 1;
try
try
{
var test2=document.getElementById("menu-" + randomnumber.toString()).value;
}
catch (err)
catch (err)
{
validatetest = 1;
}
}
//Notification Message
jQuery('.maintitle').after('<div id="message" class="updated fade below-h2"><p>Menu Item added!</p></div>');
jQuery('#message').animate({ opacity: 1.0 },2000).fadeOut(300, function(){ jQuery(this).remove();});
//Appends HTML to the menu
jQuery('#custom-nav').append('<li id="menu-' + randomnumber + '" value="' + randomnumber + '"><div class="dropzone ui-droppable"></div><dl class="ui-droppable"><dt><span class="title">' + inputvaluevarname + '</span><span class="controls"><span class="type">' + additemtype + '</span><a id="edit' + randomnumber + '" onclick="edititem(' + randomnumber + ')" value="' + randomnumber +'"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="' + templatedir + '/wp-admin/images/ico-edit.png" /></a> <a id="remove' + randomnumber + '" onclick="removeitem(' + randomnumber + ')" value="' + randomnumber +'"><img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="' + templatedir + '/wp-admin/images/ico-close.png" /></a> <a href="' + inputvaluevarurl + '" target="_blank"><img alt="View Custom Link" title="View Custom Link" src="' + templatedir + '/wp-admin/images/ico-viewpage.png" /></a></span></dt></dl><a class="hide" href="' + inputvaluevarurl + '">' + inputvaluevarname + '</a><input type="hidden" name="postmenu' + randomnumber + '" id="postmenu' + randomnumber + '" value="' + inputitemid + '" /><input type="hidden" name="parent' + randomnumber + '" id="parent' + randomnumber + '" value="' + inputparentid + '" /><input type="hidden" name="title' + randomnumber + '" id="title' + randomnumber + '" value="' + inputvaluevarname + '" /><input type="hidden" name="linkurl' + randomnumber + '" id="linkurl' + randomnumber + '" value="' + inputvaluevarurl + '" /><input type="hidden" name="description' + randomnumber + '" id="description' + randomnumber + '" value="' + inputdescription + '" /><input type="hidden" name="icon' + randomnumber + '" id="icon' + randomnumber + '" value="' + inputicon + '" /><input type="hidden" name="position' + randomnumber + '" id="position' + randomnumber + '" value="' + randomnumber + '" /><input type="hidden" name="linktype' + randomnumber + '" id="linktype' + randomnumber + '" value="' + inputlinktype + '" /><input type="hidden" name="anchortitle' + randomnumber + '" id="anchortitle' + randomnumber + '" value="' + inputvaluevarname + '" /><input type="hidden" name="newwindow' + randomnumber + '" id="newwindow' + randomnumber + '" value="0" /></li>');
@@ -230,54 +230,54 @@ function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparent
jQuery('#menu-' + randomnumber + ' dl, #menu-' + randomnumber + ' .dropzone').droppable({
accept: '#' + randomnumber + ', #custom-nav li',
tolerance: 'pointer',
drop: function(e, ui)
drop: function(e, ui)
{
var li = jQuery(this).parent();
var child = !jQuery(this).hasClass('dropzone');
//Append UL to first child
if (child && li.children('ul').length == 0)
if (child && li.children('ul').length == 0)
{
li.append('<ul/>');
}
//Make it draggable
if (child)
if (child)
{
li.children('ul').append(ui.draggable);
}
else
else
{
li.before(ui.draggable);
}
li.find('dl,.dropzone').css({ backgroundColor: '', borderColor: '' });
li.find('dl,.dropzone').css({ backgroundColor: '', borderColor: '' });
var draggablevalue = ui.draggable.attr('value');
var droppablevalue = li.attr('value');
li.find('#menu-' + draggablevalue).find('#parent' + draggablevalue).val(droppablevalue);
li.find('#menu-' + draggablevalue).find('#parent' + draggablevalue).val(droppablevalue);
jQuery(this).parent().find("dt").removeAttr('style');
jQuery(this).parent().find("div:first").removeAttr('style');
},
over: function()
over: function()
{
//Add child
if (jQuery(this).attr('class') == 'dropzone ui-droppable')
if (jQuery(this).attr('class') == 'dropzone ui-droppable')
{
jQuery(this).parent().find("div:first").css('background', 'none').css('height', '50px');
}
//Add above
else if (jQuery(this).attr('class') == 'ui-droppable')
else if (jQuery(this).attr('class') == 'ui-droppable')
{
jQuery(this).parent().find("dt:first").css('background', '#d8d8d8');
}
//do nothing
else {
}
var parentid = jQuery(this).parent().attr('id');
},
out: function()
out: function()
{
jQuery(this).parent().find("dt").removeAttr('style');
jQuery(this).parent().find("div:first").removeAttr('style');
@@ -1,9 +1,9 @@
/*
/*
* More info at: http://phpjs.org
*
*
* This is version: 3.08
* php.js is copyright 2010 Kevin van Zonneveld.
*
*
* Portions copyright Brett Zamir (http://brett-zamir.me), Kevin van Zonneveld
* (http://kevin.vanzonneveld.net), Onno Marsman, Theriault, Michael White
* (http://getsprink.com), Waldo Malqui Silva, Paulo Ricardo F. Santos, Jack,
@@ -84,10 +84,10 @@
* taith, Matt Bradley, FremyCompany, T.J. Leahy, Greg Frazier, Valentina De
* Rosa, Tod Gentille, Riddler (http://www.frontierwebdev.com/), Alexander M
* Beedie
*
*
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -95,10 +95,10 @@
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
@@ -106,7 +106,7 @@
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
*/
function get_html_translation_table (table, quote_style) {
// http://kevin.vanzonneveld.net
@@ -128,11 +128,11 @@ function get_html_translation_table (table, quote_style) {
// % note: chooses to create the constants themselves.
// * example 1: get_html_translation_table('HTML_SPECIALCHARS');
// * returns 1: {'"': '&quot;', '&': '&amp;', '<': '&lt;', '>': '&gt;'}
var entities = {}, hash_map = {}, decimal = 0, symbol = '';
var constMappingTable = {}, constMappingQuoteStyle = {};
var useTable = {}, useQuoteStyle = {};
// Translate arguments
constMappingTable[0] = 'HTML_SPECIALCHARS';
constMappingTable[1] = 'HTML_ENTITIES';
@@ -263,7 +263,7 @@ function get_html_translation_table (table, quote_style) {
symbol = String.fromCharCode(decimal);
hash_map[symbol] = entities[decimal];
}
return hash_map;
}
@@ -286,7 +286,7 @@ function htmlentities (string, quote_style) {
var hash_map = {}, symbol = '', tmp_str = '', entity = '';
tmp_str = string.toString();
if (false === (hash_map = this.get_html_translation_table('HTML_ENTITIES', quote_style))) {
return false;
}
@@ -295,6 +295,6 @@ function htmlentities (string, quote_style) {
entity = hash_map[symbol];
tmp_str = tmp_str.split(symbol).join(entity);
}
return tmp_str;
}
+1 -1
View File
@@ -38,7 +38,7 @@ jQuery(document).ready(function($) {
if ( ! res )
return;
var parent = form.find('select#parent').val();
var parent = form.find('select#parent').val();
if ( parent > 0 && $('#tag-' + parent ).length > 0 ) // If the parent exists on this page, insert it below. Else insert it at the top of the list.
$('#the-list #tag-' + parent).after( res.responses[0].supplemental['noparents'] ); // As the parent exists, Insert the version with - - - prefixed
+2 -2
View File
@@ -545,10 +545,10 @@ function print_plugins_table($plugins, $context = '') {
$actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
if ( is_multisite() && is_super_admin() )
$actions[] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;networkwide=1&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>';
if ( !is_multisite() && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
$actions[] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
if ( ! $is_active && current_user_can('delete_plugins') )
$actions[] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
}