Getting much better! Fixes #1566
git-svn-id: https://develop.svn.wordpress.org/trunk@2776 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0edc5efa1f
commit
91d7f28966
@ -100,12 +100,40 @@ tinyMCE.init({
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<script type="text/javascript" src="dbx.js"></script>
|
<script type="text/javascript" src="dbx.js"></script>
|
||||||
<script type="text/javascript" src="dbx-key.js"></script>
|
<script type="text/javascript" src="dbx-key.js"></script>
|
||||||
|
|
||||||
|
<?php if ( current_user_can('manage_categories') ) : ?>
|
||||||
<script type="text/javascript" src="tw-sack.js"></script>
|
<script type="text/javascript" src="tw-sack.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var ajaxCat = new sack();
|
var ajaxCat = new sack();
|
||||||
|
var newcat;
|
||||||
|
|
||||||
|
function newCatAddIn() {
|
||||||
|
var ajaxcat = document.createElement('p');
|
||||||
|
ajaxcat.id = 'ajaxcat';
|
||||||
|
|
||||||
|
newcat = document.createElement('input');
|
||||||
|
newcat.type = 'text';
|
||||||
|
newcat.name = 'newcat';
|
||||||
|
newcat.id = 'newcat';
|
||||||
|
newcat.size = '16';
|
||||||
|
newcat.setAttribute('autocomplete', 'off');
|
||||||
|
newcat.setAttribute('onkeypress', 'return ajaxNewCatKeyPress(event);');
|
||||||
|
|
||||||
|
var newcatSub = document.createElement('input');
|
||||||
|
newcatSub.type = 'button';
|
||||||
|
newcatSub.name = 'Button';
|
||||||
|
newcatSub.value = '+';
|
||||||
|
newcatSub.setAttribute('onclick', 'ajaxNewCat();');
|
||||||
|
|
||||||
|
ajaxcat.appendChild(newcat);
|
||||||
|
ajaxcat.appendChild(newcatSub);
|
||||||
|
document.getElementById('categorychecklist').parentNode.appendChild(ajaxcat);
|
||||||
|
}
|
||||||
|
|
||||||
|
addLoadEvent(newCatAddIn);
|
||||||
|
|
||||||
function getResponseElement() {
|
function getResponseElement() {
|
||||||
var p = document.getElementById('ajaxcatresponse');
|
var p = document.getElementById('ajaxcatresponse');
|
||||||
if (!p) {
|
if (!p) {
|
||||||
p = document.createElement('p');
|
p = document.createElement('p');
|
||||||
document.getElementById('categorydiv').appendChild(p);
|
document.getElementById('categorydiv').appendChild(p);
|
||||||
@ -165,14 +193,15 @@ function newCatCompletion() {
|
|||||||
newCheck.name = 'post_category[]';
|
newCheck.name = 'post_category[]';
|
||||||
newCheck.id = 'category-' + id;
|
newCheck.id = 'category-' + id;
|
||||||
|
|
||||||
var newLabelText = document.createTextNode(' ' + document.getElementById('newcat').value);
|
var newLabelText = document.createTextNode(' ' + newcat.value);
|
||||||
newLabel.appendChild(newLabelText);
|
newLabel.appendChild(newLabelText);
|
||||||
Fat.fade_all();
|
Fat.fade_all();
|
||||||
newLabel.setAttribute('class', 'selectit');
|
newLabel.setAttribute('class', 'selectit');
|
||||||
}
|
}
|
||||||
|
newcat.value = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function ajaxNewCatKeyUp(e) {
|
function ajaxNewCatKeyPress(e) {
|
||||||
if (!e) {
|
if (!e) {
|
||||||
if (window.event) {
|
if (window.event) {
|
||||||
e = window.event;
|
e = window.event;
|
||||||
@ -182,6 +211,9 @@ function ajaxNewCatKeyUp(e) {
|
|||||||
}
|
}
|
||||||
if (e.keyCode == 13) {
|
if (e.keyCode == 13) {
|
||||||
ajaxNewCat();
|
ajaxNewCat();
|
||||||
|
e.returnValue = false;
|
||||||
|
e.cancelBubble = true;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,6 +231,8 @@ function ajaxNewCat() {
|
|||||||
</script>
|
</script>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php do_action('admin_head'); ?>
|
<?php do_action('admin_head'); ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -83,12 +83,7 @@ addLoadEvent(focusit);
|
|||||||
|
|
||||||
<fieldset id="categorydiv" class="dbx-box">
|
<fieldset id="categorydiv" class="dbx-box">
|
||||||
<h3 class="dbx-handle"><?php _e('Categories') ?></h3>
|
<h3 class="dbx-handle"><?php _e('Categories') ?></h3>
|
||||||
<div class="dbx-content"><div id="categorychecklist"><?php dropdown_categories(get_settings('default_category')); ?></div>
|
<div class="dbx-content"><div id="categorychecklist"><?php dropdown_categories(get_settings('default_category')); ?></div></div>
|
||||||
<p id="ajaxcat">
|
|
||||||
<input type="text" name="newcat" id="newcat" size="16" onkeyup="ajaxNewCatKeyUp(event);" />
|
|
||||||
<input type="button" name="Button" value="+" onclick="ajaxNewCat();" />
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset class="dbx-box">
|
<fieldset class="dbx-box">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user