mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 06:57:35 +01:00
HTML and JS cleanup
git-svn-id: http://svn.automattic.com/wordpress/trunk@3422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bfbe1f2def
commit
759faa6b9a
@ -1,324 +1,66 @@
|
|||||||
<?php
|
<?php
|
||||||
@header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
|
@header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
|
||||||
if (!isset($_GET["page"])) require_once('admin.php'); ?>
|
if (!isset($_GET["page"])) require_once('admin.php');
|
||||||
|
if ( $list_js || $cat_js )
|
||||||
|
$sack_js = true;
|
||||||
|
if ( $editing ) {
|
||||||
|
$dbx_js = true;
|
||||||
|
$cat_js = true;
|
||||||
|
}
|
||||||
|
?>
|
||||||
<?php get_admin_page_title(); ?>
|
<?php get_admin_page_title(); ?>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" />
|
||||||
<title><?php bloginfo('name') ?> › <?php echo $title; ?> — WordPress</title>
|
<title><?php bloginfo('name') ?> › <?php echo $title; ?> — WordPress</title>
|
||||||
<link rel="stylesheet" href="<?php echo get_settings('siteurl') ?>/wp-admin/wp-admin.css?version=<?php bloginfo('version'); ?>" type="text/css" />
|
<link rel="stylesheet" href="<?php echo get_settings('siteurl') ?>/wp-admin/wp-admin.css?version=<?php bloginfo('version'); ?>" type="text/css" />
|
||||||
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" />
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
|
function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}else{ var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}
|
||||||
function addLoadEvent(func) {
|
|
||||||
if ( typeof wpOnload != 'function' ) {
|
|
||||||
wpOnload = func;
|
|
||||||
} else {
|
|
||||||
var oldonload = wpOnload;
|
|
||||||
wpOnload = function() {
|
|
||||||
oldonload();
|
|
||||||
func();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<?php if ( isset($xfn) ) : ?>
|
|
||||||
|
|
||||||
function GetElementsWithClassName(elementName, className) {
|
|
||||||
var allElements = document.getElementsByTagName(elementName);
|
|
||||||
var elemColl = new Array();
|
|
||||||
for (i = 0; i < allElements.length; i++) {
|
|
||||||
if (allElements[i].className == className) {
|
|
||||||
elemColl[elemColl.length] = allElements[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return elemColl;
|
|
||||||
}
|
|
||||||
|
|
||||||
function meChecked() {
|
|
||||||
var undefined;
|
|
||||||
var eMe = document.getElementById('me');
|
|
||||||
if (eMe == undefined) return false;
|
|
||||||
else return eMe.checked;
|
|
||||||
}
|
|
||||||
|
|
||||||
function upit() {
|
|
||||||
var isMe = meChecked(); //document.getElementById('me').checked;
|
|
||||||
var inputColl = GetElementsWithClassName('input', 'valinp');
|
|
||||||
var results = document.getElementById('link_rel');
|
|
||||||
var linkText, linkUrl, inputs = '';
|
|
||||||
for (i = 0; i < inputColl.length; i++) {
|
|
||||||
inputColl[i].disabled = isMe;
|
|
||||||
inputColl[i].parentNode.className = isMe ? 'disabled' : '';
|
|
||||||
if (!isMe && inputColl[i].checked && inputColl[i].value != '') {
|
|
||||||
inputs += inputColl[i].value + ' ';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
inputs = inputs.substr(0,inputs.length - 1);
|
|
||||||
if (isMe) inputs='me';
|
|
||||||
results.value = inputs;
|
|
||||||
}
|
|
||||||
|
|
||||||
function blurry() {
|
|
||||||
if (!document.getElementById) return;
|
|
||||||
|
|
||||||
var aInputs = document.getElementsByTagName('input');
|
|
||||||
|
|
||||||
for (var i = 0; i < aInputs.length; i++) {
|
|
||||||
aInputs[i].onclick = aInputs[i].onkeyup = upit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
addLoadEvent(blurry);
|
|
||||||
<?php endif; ?>
|
|
||||||
//]]>
|
//]]>
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="../wp-includes/js/fat.js"></script>
|
<script type="text/javascript" src="../wp-includes/js/fat.js"></script>
|
||||||
|
<?php if ( $xfn_js ) { ?>
|
||||||
|
<script type="text/javascript" src="xfn.js"></script>
|
||||||
|
<?php } ?>
|
||||||
|
<?php if ( $sack_js ) { ?>
|
||||||
<script type="text/javascript" src="../wp-includes/js/tw-sack.js"></script>
|
<script type="text/javascript" src="../wp-includes/js/tw-sack.js"></script>
|
||||||
|
<?php } ?>
|
||||||
|
<?php if ( $list_js ) { ?>
|
||||||
<script type="text/javascript" src="list-manipulation.js"></script>
|
<script type="text/javascript" src="list-manipulation.js"></script>
|
||||||
<?php if ( isset( $editing ) ) : ?>
|
<?php } ?>
|
||||||
<?php if ( $editing && user_can_richedit() ) : ?>
|
<?php if ( $dbx_js ) { ?>
|
||||||
<script type="text/javascript" src="../wp-includes/js/tinymce/tiny_mce_gzip.php?ver=20051211"></script>
|
|
||||||
<?php endif; ?>
|
|
||||||
<script type="text/javascript" src="../wp-includes/js/dbx.js"></script>
|
<script type="text/javascript" src="../wp-includes/js/dbx.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
addLoadEvent( function() {
|
addLoadEvent( function() {
|
||||||
<?php switch ( $pagenow ) : case 'post.php' : ?>
|
<?php switch ( $pagenow ) : case 'post.php' : ?>
|
||||||
var manager = new dbxManager('postmeta'); //session ID [/-_a-zA-Z0-9/]
|
var manager = new dbxManager('postmeta');
|
||||||
<?php break; case 'page-new.php' : ?>
|
<?php break; case 'page-new.php' : ?>
|
||||||
var manager = new dbxManager('pagemeta'); //session ID [/-_a-zA-Z0-9/]
|
var manager = new dbxManager('pagemeta');
|
||||||
<?php break; endswitch; ?>
|
<?php break; endswitch; ?>
|
||||||
});
|
});
|
||||||
//]]>
|
//]]>
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="../wp-includes/js/dbx-key.js"></script>
|
<script type="text/javascript" src="../wp-includes/js/dbx-key.js"></script>
|
||||||
|
<?php } ?>
|
||||||
<?php if ( current_user_can('manage_categories') ) : ?>
|
<?php if ( $editing && user_can_richedit() ) { ?>
|
||||||
<style type="text/css">
|
<script type="text/javascript" src="../wp-includes/js/tinymce/tiny_mce_gzip.php?ver=20051211"></script>
|
||||||
#newcat { width: 120px; margin-right: 5px; }
|
<?php } ?>
|
||||||
input#catadd { background: #a4a4a4;
|
<?php if ( $cat_js ) { ?>
|
||||||
border-bottom: 1px solid #898989;
|
<script type="text/javascript" src="cat-js.php"></script>
|
||||||
border-left: 1px solid #bcbcbc;
|
<?php } ?>
|
||||||
border-right: 1px solid #898989;
|
|
||||||
border-top: 1px solid #bcbcbc;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 10px;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
font-weight: bold;
|
|
||||||
height: 20px;
|
|
||||||
margin-bottom: 2px;
|
|
||||||
text-align: center;
|
|
||||||
width: 37px; }
|
|
||||||
#howto {
|
|
||||||
font-size: 11px;
|
|
||||||
margin: 0 5px;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
#jaxcat {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script type="text/javascript">
|
|
||||||
//<![CDATA[
|
|
||||||
var ajaxCat = new sack();
|
|
||||||
var newcat;
|
|
||||||
|
|
||||||
function newCatAddIn() {
|
|
||||||
if ( !document.getElementById('jaxcat') ) return false;
|
|
||||||
var ajaxcat = document.createElement('span');
|
|
||||||
ajaxcat.id = 'ajaxcat';
|
|
||||||
|
|
||||||
newcat = document.createElement('input');
|
|
||||||
newcat.type = 'text';
|
|
||||||
newcat.name = 'newcat';
|
|
||||||
newcat.id = 'newcat';
|
|
||||||
newcat.size = '16';
|
|
||||||
newcat.setAttribute('autocomplete', 'off');
|
|
||||||
newcat.onkeypress = ajaxNewCatKeyPress;
|
|
||||||
|
|
||||||
var newcatSub = document.createElement('input');
|
|
||||||
newcatSub.type = 'button';
|
|
||||||
newcatSub.name = 'Button';
|
|
||||||
newcatSub.id = 'catadd';
|
|
||||||
newcatSub.value = '<?php echo addslashes(__('Add')); ?>';
|
|
||||||
newcatSub.onclick = ajaxNewCat;
|
|
||||||
|
|
||||||
ajaxcat.appendChild(newcat);
|
|
||||||
ajaxcat.appendChild(newcatSub);
|
|
||||||
document.getElementById('jaxcat').appendChild(ajaxcat);
|
|
||||||
|
|
||||||
howto = document.createElement('span');
|
|
||||||
howto.innerHTML = '<?php echo addslashes(__('Separate multiple categories with commas.')); ?>';
|
|
||||||
howto.id = 'howto';
|
|
||||||
ajaxcat.appendChild(howto);
|
|
||||||
}
|
|
||||||
|
|
||||||
addLoadEvent(newCatAddIn);
|
|
||||||
|
|
||||||
function getResponseElement() {
|
|
||||||
var p = document.getElementById('ajaxcatresponse');
|
|
||||||
if (!p) {
|
|
||||||
p = document.createElement('span');
|
|
||||||
document.getElementById('jaxcat').appendChild(p);
|
|
||||||
p.id = 'ajaxcatresponse';
|
|
||||||
}
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
function newCatLoading() {
|
|
||||||
var p = getResponseElement();
|
|
||||||
p.innerHTML = '<?php echo addslashes(__('Sending Data...')); ?>';
|
|
||||||
}
|
|
||||||
|
|
||||||
function newCatLoaded() {
|
|
||||||
var p = getResponseElement();
|
|
||||||
p.innerHTML = '<?php echo addslashes(__('Data Sent...')); ?>';
|
|
||||||
}
|
|
||||||
|
|
||||||
function newCatInteractive() {
|
|
||||||
var p = getResponseElement();
|
|
||||||
p.innerHTML = '<?php echo addslashes(__('Processing Request...')); ?>';
|
|
||||||
}
|
|
||||||
|
|
||||||
function newCatCompletion() {
|
|
||||||
var p = getResponseElement();
|
|
||||||
var id = 0;
|
|
||||||
var ids = new Array();
|
|
||||||
var names = new Array();
|
|
||||||
|
|
||||||
ids = myPload( ajaxCat.response );
|
|
||||||
names = myPload( newcat.value );
|
|
||||||
for ( i = 0; i < ids.length; i++ ) {
|
|
||||||
id = ids[i].replace(/[\n\r]+/g, "");
|
|
||||||
if ( id == '-1' ) {
|
|
||||||
p.innerHTML = "<?php echo addslashes(__("You don't have permission to do that.")); ?>";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ( id == '0' ) {
|
|
||||||
p.innerHTML = "<?php echo addslashes(__('That category name is invalid. Try something else.')); ?>";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var exists = document.getElementById('category-' + id);
|
|
||||||
|
|
||||||
if (exists) {
|
|
||||||
var moveIt = exists.parentNode;
|
|
||||||
var container = moveIt.parentNode;
|
|
||||||
container.removeChild(moveIt);
|
|
||||||
container.insertBefore(moveIt, container.firstChild);
|
|
||||||
moveIt.id = 'new-category-' + id;
|
|
||||||
exists.checked = 'checked';
|
|
||||||
var nowClass = moveIt.className;
|
|
||||||
moveIt.className = nowClass + ' fade';
|
|
||||||
Fat.fade_all();
|
|
||||||
moveIt.className = nowClass;
|
|
||||||
} else {
|
|
||||||
var catDiv = document.getElementById('categorychecklist');
|
|
||||||
var newLabel = document.createElement('label');
|
|
||||||
newLabel.setAttribute('for', 'category-' + id);
|
|
||||||
newLabel.id = 'new-category-' + id;
|
|
||||||
newLabel.className = 'selectit fade';
|
|
||||||
|
|
||||||
var newCheck = document.createElement('input');
|
|
||||||
newCheck.type = 'checkbox';
|
|
||||||
newCheck.value = id;
|
|
||||||
newCheck.name = 'post_category[]';
|
|
||||||
newCheck.id = 'category-' + id;
|
|
||||||
newLabel.appendChild(newCheck);
|
|
||||||
|
|
||||||
var newLabelText = document.createTextNode(' ' + names[i]);
|
|
||||||
newLabel.appendChild(newLabelText);
|
|
||||||
|
|
||||||
catDiv.insertBefore(newLabel, catDiv.firstChild);
|
|
||||||
newCheck.checked = 'checked';
|
|
||||||
|
|
||||||
Fat.fade_all();
|
|
||||||
newLabel.className = 'selectit';
|
|
||||||
}
|
|
||||||
newcat.value = '';
|
|
||||||
}
|
|
||||||
p.parentNode.removeChild(p);
|
|
||||||
// var id = parseInt(ajaxCat.response, 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
function ajaxNewCatKeyPress(e) {
|
|
||||||
if (!e) {
|
|
||||||
if (window.event) {
|
|
||||||
e = window.event;
|
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (e.keyCode == 13) {
|
|
||||||
ajaxNewCat();
|
|
||||||
e.returnValue = false;
|
|
||||||
e.cancelBubble = true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function ajaxNewCat() {
|
|
||||||
var newcat = document.getElementById('newcat');
|
|
||||||
var split_cats = new Array(1);
|
|
||||||
var catString = '';
|
|
||||||
|
|
||||||
catString = 'ajaxnewcat=' + encodeURIComponent(newcat.value);
|
|
||||||
ajaxCat.requestFile = 'edit-form-ajax-cat.php';
|
|
||||||
ajaxCat.method = 'GET';
|
|
||||||
ajaxCat.onLoading = newCatLoading;
|
|
||||||
ajaxCat.onLoaded = newCatLoaded;
|
|
||||||
ajaxCat.onInteractive = newCatInteractive;
|
|
||||||
ajaxCat.onCompletion = newCatCompletion;
|
|
||||||
ajaxCat.runAJAX(catString);
|
|
||||||
}
|
|
||||||
|
|
||||||
function myPload( str ) {
|
|
||||||
var fixedExplode = new Array();
|
|
||||||
var comma = new String(',');
|
|
||||||
var count = 0;
|
|
||||||
var currentElement = '';
|
|
||||||
|
|
||||||
for( x=0; x < str.length; x++) {
|
|
||||||
andy = str.charAt(x);
|
|
||||||
if ( comma.indexOf(andy) != -1 ) {
|
|
||||||
currentElement = currentElement.replace(new RegExp('^\\s*(.*?)\\s*$', ''), '$1'); // trim
|
|
||||||
fixedExplode[count] = currentElement;
|
|
||||||
currentElement = "";
|
|
||||||
count++;
|
|
||||||
} else {
|
|
||||||
currentElement += andy;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( currentElement != "" )
|
|
||||||
fixedExplode[count] = currentElement;
|
|
||||||
return fixedExplode;
|
|
||||||
}
|
|
||||||
//]]>
|
|
||||||
</script>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if ( ($parent_file != 'link-manager.php') && ($parent_file != 'options-general.php') ) : ?>
|
<?php if ( ($parent_file != 'link-manager.php') && ($parent_file != 'options-general.php') ) : ?>
|
||||||
<style type="text/css">* html { overflow-x: hidden; }</style>
|
<style type="text/css">* html { overflow-x: hidden; }</style>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php do_action('admin_head'); ?>
|
<?php do_action('admin_head'); ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div id="wphead">
|
<div id="wphead">
|
||||||
<h1><?php echo wptexturize(get_settings(('blogname'))); ?> <span>(<a href="<?php echo get_settings('home') . '/'; ?>"><?php _e('View site') ?> »</a>)</span></h1>
|
<h1><?php echo wptexturize(get_settings(('blogname'))); ?> <span>(<a href="<?php echo get_settings('home') . '/'; ?>"><?php _e('View site') ?> »</a>)</span></h1>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="user_info"><p><?php printf(__('Howdy, <strong>%s</strong>.'), $user_identity) ?> [<a href="<?php echo get_settings('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php _e('Sign Out'); ?></a>, <a href="profile.php"><?php _e('My Account'); ?></a>] </p></div>
|
||||||
<div id="user_info"><p><?php printf(__('Howdy, <strong>%s</strong>.'), $user_identity) ?> [<a href="<?php echo get_settings('siteurl')
|
|
||||||
?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php _e('Sign Out'); ?></a>, <a href="profile.php"><?php _e('My Account'); ?></a>] </p></div>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
require(ABSPATH . '/wp-admin/menu-header.php');
|
require(ABSPATH . '/wp-admin/menu-header.php');
|
||||||
|
@ -40,6 +40,8 @@ for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$xfn_js = $sack_js = $list_js = $cat_js = $dbx_js = $editing = false;
|
||||||
|
|
||||||
require(ABSPATH . '/wp-admin/menu.php');
|
require(ABSPATH . '/wp-admin/menu.php');
|
||||||
|
|
||||||
// Handle plugin admin pages.
|
// Handle plugin admin pages.
|
||||||
|
174
wp-admin/cat-js.php
Normal file
174
wp-admin/cat-js.php
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
var ajaxCat = new sack();
|
||||||
|
var newcat;
|
||||||
|
|
||||||
|
function newCatAddIn() {
|
||||||
|
if ( !document.getElementById('jaxcat') ) return false;
|
||||||
|
var ajaxcat = document.createElement('span');
|
||||||
|
ajaxcat.id = 'ajaxcat';
|
||||||
|
|
||||||
|
newcat = document.createElement('input');
|
||||||
|
newcat.type = 'text';
|
||||||
|
newcat.name = 'newcat';
|
||||||
|
newcat.id = 'newcat';
|
||||||
|
newcat.size = '16';
|
||||||
|
newcat.setAttribute('autocomplete', 'off');
|
||||||
|
newcat.onkeypress = ajaxNewCatKeyPress;
|
||||||
|
|
||||||
|
var newcatSub = document.createElement('input');
|
||||||
|
newcatSub.type = 'button';
|
||||||
|
newcatSub.name = 'Button';
|
||||||
|
newcatSub.id = 'catadd';
|
||||||
|
newcatSub.value = '<?php echo addslashes(__('Add')); ?>';
|
||||||
|
newcatSub.onclick = ajaxNewCat;
|
||||||
|
|
||||||
|
ajaxcat.appendChild(newcat);
|
||||||
|
ajaxcat.appendChild(newcatSub);
|
||||||
|
document.getElementById('jaxcat').appendChild(ajaxcat);
|
||||||
|
|
||||||
|
howto = document.createElement('span');
|
||||||
|
howto.innerHTML = '<?php echo addslashes(__('Separate multiple categories with commas.')); ?>';
|
||||||
|
howto.id = 'howto';
|
||||||
|
ajaxcat.appendChild(howto);
|
||||||
|
}
|
||||||
|
|
||||||
|
addLoadEvent(newCatAddIn);
|
||||||
|
|
||||||
|
function getResponseElement() {
|
||||||
|
var p = document.getElementById('ajaxcatresponse');
|
||||||
|
if (!p) {
|
||||||
|
p = document.createElement('span');
|
||||||
|
document.getElementById('jaxcat').appendChild(p);
|
||||||
|
p.id = 'ajaxcatresponse';
|
||||||
|
}
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
function newCatLoading() {
|
||||||
|
var p = getResponseElement();
|
||||||
|
p.innerHTML = '<?php echo addslashes(__('Sending Data...')); ?>';
|
||||||
|
}
|
||||||
|
|
||||||
|
function newCatLoaded() {
|
||||||
|
var p = getResponseElement();
|
||||||
|
p.innerHTML = '<?php echo addslashes(__('Data Sent...')); ?>';
|
||||||
|
}
|
||||||
|
|
||||||
|
function newCatInteractive() {
|
||||||
|
var p = getResponseElement();
|
||||||
|
p.innerHTML = '<?php echo addslashes(__('Processing Request...')); ?>';
|
||||||
|
}
|
||||||
|
|
||||||
|
function newCatCompletion() {
|
||||||
|
var p = getResponseElement();
|
||||||
|
var id = 0;
|
||||||
|
var ids = new Array();
|
||||||
|
var names = new Array();
|
||||||
|
|
||||||
|
ids = myPload( ajaxCat.response );
|
||||||
|
names = myPload( newcat.value );
|
||||||
|
for ( i = 0; i < ids.length; i++ ) {
|
||||||
|
id = ids[i].replace(/[\n\r]+/g, "");
|
||||||
|
if ( id == '-1' ) {
|
||||||
|
p.innerHTML = "<?php echo addslashes(__("You don't have permission to do that.")); ?>";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( id == '0' ) {
|
||||||
|
p.innerHTML = "<?php echo addslashes(__('That category name is invalid. Try something else.')); ?>";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var exists = document.getElementById('category-' + id);
|
||||||
|
|
||||||
|
if (exists) {
|
||||||
|
var moveIt = exists.parentNode;
|
||||||
|
var container = moveIt.parentNode;
|
||||||
|
container.removeChild(moveIt);
|
||||||
|
container.insertBefore(moveIt, container.firstChild);
|
||||||
|
moveIt.id = 'new-category-' + id;
|
||||||
|
exists.checked = 'checked';
|
||||||
|
var nowClass = moveIt.className;
|
||||||
|
moveIt.className = nowClass + ' fade';
|
||||||
|
Fat.fade_all();
|
||||||
|
moveIt.className = nowClass;
|
||||||
|
} else {
|
||||||
|
var catDiv = document.getElementById('categorychecklist');
|
||||||
|
var newLabel = document.createElement('label');
|
||||||
|
newLabel.setAttribute('for', 'category-' + id);
|
||||||
|
newLabel.id = 'new-category-' + id;
|
||||||
|
newLabel.className = 'selectit fade';
|
||||||
|
|
||||||
|
var newCheck = document.createElement('input');
|
||||||
|
newCheck.type = 'checkbox';
|
||||||
|
newCheck.value = id;
|
||||||
|
newCheck.name = 'post_category[]';
|
||||||
|
newCheck.id = 'category-' + id;
|
||||||
|
newLabel.appendChild(newCheck);
|
||||||
|
|
||||||
|
var newLabelText = document.createTextNode(' ' + names[i]);
|
||||||
|
newLabel.appendChild(newLabelText);
|
||||||
|
|
||||||
|
catDiv.insertBefore(newLabel, catDiv.firstChild);
|
||||||
|
newCheck.checked = 'checked';
|
||||||
|
|
||||||
|
Fat.fade_all();
|
||||||
|
newLabel.className = 'selectit';
|
||||||
|
}
|
||||||
|
newcat.value = '';
|
||||||
|
}
|
||||||
|
p.parentNode.removeChild(p);
|
||||||
|
// var id = parseInt(ajaxCat.response, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
function ajaxNewCatKeyPress(e) {
|
||||||
|
if (!e) {
|
||||||
|
if (window.event) {
|
||||||
|
e = window.event;
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (e.keyCode == 13) {
|
||||||
|
ajaxNewCat();
|
||||||
|
e.returnValue = false;
|
||||||
|
e.cancelBubble = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function ajaxNewCat() {
|
||||||
|
var newcat = document.getElementById('newcat');
|
||||||
|
var split_cats = new Array(1);
|
||||||
|
var catString = '';
|
||||||
|
|
||||||
|
catString = 'ajaxnewcat=' + encodeURIComponent(newcat.value);
|
||||||
|
ajaxCat.requestFile = 'edit-form-ajax-cat.php';
|
||||||
|
ajaxCat.method = 'GET';
|
||||||
|
ajaxCat.onLoading = newCatLoading;
|
||||||
|
ajaxCat.onLoaded = newCatLoaded;
|
||||||
|
ajaxCat.onInteractive = newCatInteractive;
|
||||||
|
ajaxCat.onCompletion = newCatCompletion;
|
||||||
|
ajaxCat.runAJAX(catString);
|
||||||
|
}
|
||||||
|
|
||||||
|
function myPload( str ) {
|
||||||
|
var fixedExplode = new Array();
|
||||||
|
var comma = new String(',');
|
||||||
|
var count = 0;
|
||||||
|
var currentElement = '';
|
||||||
|
|
||||||
|
for( x=0; x < str.length; x++) {
|
||||||
|
andy = str.charAt(x);
|
||||||
|
if ( comma.indexOf(andy) != -1 ) {
|
||||||
|
currentElement = currentElement.replace(new RegExp('^\\s*(.*?)\\s*$', ''), '$1'); // trim
|
||||||
|
fixedExplode[count] = currentElement;
|
||||||
|
currentElement = "";
|
||||||
|
count++;
|
||||||
|
} else {
|
||||||
|
currentElement += andy;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( currentElement != "" )
|
||||||
|
fixedExplode[count] = currentElement;
|
||||||
|
return fixedExplode;
|
||||||
|
}
|
@ -3,6 +3,7 @@ require_once('admin.php');
|
|||||||
|
|
||||||
$title = __('Categories');
|
$title = __('Categories');
|
||||||
$parent_file = 'edit.php';
|
$parent_file = 'edit.php';
|
||||||
|
$list_js = true;
|
||||||
|
|
||||||
$wpvarstoreset = array('action','cat');
|
$wpvarstoreset = array('action','cat');
|
||||||
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
||||||
|
@ -3,6 +3,7 @@ require_once('admin.php');
|
|||||||
|
|
||||||
$title = __('Edit Comments');
|
$title = __('Edit Comments');
|
||||||
$parent_file = 'edit.php';
|
$parent_file = 'edit.php';
|
||||||
|
$list_js = true;
|
||||||
|
|
||||||
require_once('admin-header.php');
|
require_once('admin-header.php');
|
||||||
if (empty($_GET['mode'])) $mode = 'view';
|
if (empty($_GET['mode'])) $mode = 'view';
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
require_once('admin.php');
|
require_once('admin.php');
|
||||||
$title = __('Pages');
|
$title = __('Pages');
|
||||||
$parent_file = 'edit.php';
|
$parent_file = 'edit.php';
|
||||||
|
$list_js = true;
|
||||||
require_once('admin-header.php');
|
require_once('admin-header.php');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ require_once('admin.php');
|
|||||||
|
|
||||||
$title = __('Posts');
|
$title = __('Posts');
|
||||||
$parent_file = 'edit.php';
|
$parent_file = 'edit.php';
|
||||||
|
$list_js = true;
|
||||||
require_once('admin-header.php');
|
require_once('admin-header.php');
|
||||||
|
|
||||||
$_GET['m'] = (int) $_GET['m'];
|
$_GET['m'] = (int) $_GET['m'];
|
||||||
|
@ -25,7 +25,7 @@ for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$xfn = true;
|
$xfn_js = true;
|
||||||
require('admin-header.php');
|
require('admin-header.php');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ require_once('admin.php');
|
|||||||
$title = __('Link Categories');
|
$title = __('Link Categories');
|
||||||
$this_file='link-categories.php';
|
$this_file='link-categories.php';
|
||||||
$parent_file = 'link-manager.php';
|
$parent_file = 'link-manager.php';
|
||||||
|
$list_js = true;
|
||||||
|
|
||||||
$wpvarstoreset = array('action', 'cat', 'auto_toggle');
|
$wpvarstoreset = array('action', 'cat', 'auto_toggle');
|
||||||
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
||||||
|
@ -6,6 +6,7 @@ require_once('admin.php');
|
|||||||
|
|
||||||
$title = __('Manage Links');
|
$title = __('Manage Links');
|
||||||
$this_file = $parent_file = 'link-manager.php';
|
$this_file = $parent_file = 'link-manager.php';
|
||||||
|
$list_js = true;
|
||||||
|
|
||||||
$wpvarstoreset = array('action','cat_id', 'linkurl', 'name', 'image',
|
$wpvarstoreset = array('action','cat_id', 'linkurl', 'name', 'image',
|
||||||
'description', 'visible', 'target', 'category', 'link_id',
|
'description', 'visible', 'target', 'category', 'link_id',
|
||||||
@ -179,18 +180,18 @@ switch ($action) {
|
|||||||
} // end Delete
|
} // end Delete
|
||||||
|
|
||||||
case 'linkedit': {
|
case 'linkedit': {
|
||||||
$xfn = true;
|
$xfn_js = true;
|
||||||
include_once ('admin-header.php');
|
include_once ('admin-header.php');
|
||||||
if ( !current_user_can('manage_links') )
|
if ( !current_user_can('manage_links') )
|
||||||
die(__('You do not have sufficient permissions to edit the links for this blog.'));
|
die(__('You do not have sufficient permissions to edit the links for this blog.'));
|
||||||
|
|
||||||
$link_id = (int) $_GET['link_id'];
|
$link_id = (int) $_GET['link_id'];
|
||||||
|
|
||||||
if ( !$link = get_link_to_edit($link_id) )
|
if ( !$link = get_link_to_edit($link_id) )
|
||||||
die( __('Link not found.') );
|
die( __('Link not found.') );
|
||||||
|
|
||||||
include('edit-link-form.php');
|
include('edit-link-form.php');
|
||||||
break;
|
break;
|
||||||
} // end linkedit
|
} // end linkedit
|
||||||
case __("Show"):
|
case __("Show"):
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,7 @@ require_once('admin.php');
|
|||||||
|
|
||||||
$title = __('Moderate comments');
|
$title = __('Moderate comments');
|
||||||
$parent_file = 'edit.php';
|
$parent_file = 'edit.php';
|
||||||
|
$list_js = true;
|
||||||
|
|
||||||
$wpvarstoreset = array('action', 'item_ignored', 'item_deleted', 'item_approved', 'item_spam', 'feelinglucky');
|
$wpvarstoreset = array('action', 'item_ignored', 'item_deleted', 'item_approved', 'item_spam', 'feelinglucky');
|
||||||
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
||||||
|
@ -1,20 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once('admin.php');
|
require_once('./admin.php');
|
||||||
|
|
||||||
$title = __('General Options');
|
$title = __('General Options');
|
||||||
$parent_file = 'options-general.php';
|
$parent_file = 'options-general.php';
|
||||||
|
|
||||||
include('admin-header.php');
|
include('./admin-header.php');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<h2><?php _e('General Options') ?></h2>
|
<h2><?php _e('General Options') ?></h2>
|
||||||
<form name="form1" method="post" action="options.php">
|
<form method="post" action="options.php">
|
||||||
<input type="hidden" name="action" value="update" />
|
<table class="optiontable">
|
||||||
<input type="hidden" name="page_options" value="blogname,blogdescription,siteurl,admin_email,users_can_register,gmt_offset,date_format,time_format,home,start_of_week,comment_registration,default_role" />
|
|
||||||
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
|
|
||||||
<tr valign="top">
|
<tr valign="top">
|
||||||
<th width="33%" scope="row"><?php _e('Weblog title:') ?></th>
|
<th scope="row"><?php _e('Weblog title:') ?></th>
|
||||||
<td><input name="blogname" type="text" id="blogname" value="<?php form_option('blogname'); ?>" size="40" /></td>
|
<td><input name="blogname" type="text" id="blogname" value="<?php form_option('blogname'); ?>" size="40" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr valign="top">
|
<tr valign="top">
|
||||||
@ -62,9 +60,9 @@ foreach($wp_roles->role_names as $role => $name) {
|
|||||||
</table>
|
</table>
|
||||||
<fieldset class="options">
|
<fieldset class="options">
|
||||||
<legend><?php _e('Date and Time') ?></legend>
|
<legend><?php _e('Date and Time') ?></legend>
|
||||||
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
|
<table class="optiontable">
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row" width="33%"><?php _e('<abbr title="Coordinated Universal Time">UTC</abbr> time is:') ?> </th>
|
<th scope="row"><?php _e('<abbr title="Coordinated Universal Time">UTC</abbr> time is:') ?> </th>
|
||||||
<td><code><?php echo gmdate('Y-m-d g:i:s a'); ?></code></td>
|
<td><code><?php echo gmdate('Y-m-d g:i:s a'); ?></code></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -98,13 +96,15 @@ endfor;
|
|||||||
?>
|
?>
|
||||||
</select></td>
|
</select></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<p class="submit">
|
|
||||||
<input type="submit" name="Submit" value="<?php _e('Update Options') ?> »" />
|
<p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options') ?> »" />
|
||||||
|
<input type="hidden" name="action" value="update" />
|
||||||
|
<input type="hidden" name="page_options" value="blogname,blogdescription,siteurl,admin_email,users_can_register,gmt_offset,date_format,time_format,home,start_of_week,comment_registration,default_role" />
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<?php include("admin-footer.php") ?>
|
|
||||||
|
<?php include('./admin-footer.php') ?>
|
@ -14,20 +14,23 @@ include('admin-header.php');
|
|||||||
|
|
||||||
<fieldset class="options">
|
<fieldset class="options">
|
||||||
<legend><?php _e('Uploading'); ?></legend>
|
<legend><?php _e('Uploading'); ?></legend>
|
||||||
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
|
<table class="editform optiontable">
|
||||||
<tr valign="top"><th scope="row"><?php _e('Store uploads in this folder'); ?>:</th>
|
<tr valign="top">
|
||||||
<td>
|
<th scope="row"><?php _e('Store uploads in this folder'); ?>:</th>
|
||||||
<input name="fileupload_realpath" type="text" id="fileupload_realpath" class="code" value="<?php echo str_replace(ABSPATH, '', get_settings('fileupload_realpath')); ?>" size="40" />
|
<td><input name="fileupload_realpath" type="text" id="fileupload_realpath" class="code" value="<?php echo str_replace(ABSPATH, '', get_settings('fileupload_realpath')); ?>" size="40" />
|
||||||
<br />
|
<br />
|
||||||
<?php _e('Default is <code>wp-content/uploads</code>'); ?>
|
<?php _e('Default is <code>wp-content/uploads</code>'); ?>
|
||||||
</td></tr>
|
</td>
|
||||||
<tr valign="top"><th scope="row" width="33%"> </th>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
<td>
|
<td>
|
||||||
<label for="uploads_use_yearmonth_folders">
|
<label for="uploads_use_yearmonth_folders">
|
||||||
<input name="uploads_use_yearmonth_folders" type="checkbox" id="uploads_use_yearmonth_folders" value="1" <?php checked('1', get_settings('uploads_use_yearmonth_folders')); ?> />
|
<input name="uploads_use_yearmonth_folders" type="checkbox" id="uploads_use_yearmonth_folders" value="1" <?php checked('1', get_settings('uploads_use_yearmonth_folders')); ?> />
|
||||||
<?php _e('Organize my uploads into month- and year-based folders'); ?>
|
<?php _e('Organize my uploads into month- and year-based folders'); ?>
|
||||||
</label>
|
</label>
|
||||||
</td></tr>
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
@ -297,6 +297,19 @@ form#upload #post_content {
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.optiontable {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.optiontable td, .optiontable th {
|
||||||
|
padding: .5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.optiontable th {
|
||||||
|
width: 33%;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
.unapproved {
|
.unapproved {
|
||||||
color: #888;
|
color: #888;
|
||||||
}
|
}
|
||||||
@ -902,3 +915,28 @@ a.dbx-toggle, a.dbx-toggle:visited {
|
|||||||
-khtml-opacity: 0.8;
|
-khtml-opacity: 0.8;
|
||||||
filter: alpha(opacity=80);
|
filter: alpha(opacity=80);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#newcat { width: 120px; margin-right: 5px; }
|
||||||
|
input#catadd { background: #a4a4a4;
|
||||||
|
border-bottom: 1px solid #898989;
|
||||||
|
border-left: 1px solid #bcbcbc;
|
||||||
|
border-right: 1px solid #898989;
|
||||||
|
border-top: 1px solid #bcbcbc;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 10px;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
font-weight: bold;
|
||||||
|
height: 20px;
|
||||||
|
margin-bottom: 2px;
|
||||||
|
text-align: center;
|
||||||
|
width: 37px; }
|
||||||
|
#howto {
|
||||||
|
font-size: 11px;
|
||||||
|
margin: 0 5px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
#jaxcat {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
46
wp-admin/xfn.js
Normal file
46
wp-admin/xfn.js
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
function GetElementsWithClassName(elementName, className) {
|
||||||
|
var allElements = document.getElementsByTagName(elementName);
|
||||||
|
var elemColl = new Array();
|
||||||
|
for (i = 0; i < allElements.length; i++) {
|
||||||
|
if (allElements[i].className == className) {
|
||||||
|
elemColl[elemColl.length] = allElements[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return elemColl;
|
||||||
|
}
|
||||||
|
|
||||||
|
function meChecked() {
|
||||||
|
var undefined;
|
||||||
|
var eMe = document.getElementById('me');
|
||||||
|
if (eMe == undefined) return false;
|
||||||
|
else return eMe.checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
function upit() {
|
||||||
|
var isMe = meChecked(); //document.getElementById('me').checked;
|
||||||
|
var inputColl = GetElementsWithClassName('input', 'valinp');
|
||||||
|
var results = document.getElementById('link_rel');
|
||||||
|
var linkText, linkUrl, inputs = '';
|
||||||
|
for (i = 0; i < inputColl.length; i++) {
|
||||||
|
inputColl[i].disabled = isMe;
|
||||||
|
inputColl[i].parentNode.className = isMe ? 'disabled' : '';
|
||||||
|
if (!isMe && inputColl[i].checked && inputColl[i].value != '') {
|
||||||
|
inputs += inputColl[i].value + ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
inputs = inputs.substr(0,inputs.length - 1);
|
||||||
|
if (isMe) inputs='me';
|
||||||
|
results.value = inputs;
|
||||||
|
}
|
||||||
|
|
||||||
|
function blurry() {
|
||||||
|
if (!document.getElementById) return;
|
||||||
|
|
||||||
|
var aInputs = document.getElementsByTagName('input');
|
||||||
|
|
||||||
|
for (var i = 0; i < aInputs.length; i++) {
|
||||||
|
aInputs[i].onclick = aInputs[i].onkeyup = upit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addLoadEvent(blurry);
|
Loading…
Reference in New Issue
Block a user