diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php index 5e87a041ca..6527a4e32e 100644 --- a/wp-admin/admin-header.php +++ b/wp-admin/admin-header.php @@ -1,324 +1,66 @@ +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 bloginfo('name') ?> › <?php echo $title; ?> — WordPress - - + + + + + + - - - - + + - - - - - - - - + + + + + + + - - - -

%s.'), $user_identity) ?> [, ]

+

%s.'), $user_identity) ?> [, ]

'; + newcatSub.onclick = ajaxNewCat; + + ajaxcat.appendChild(newcat); + ajaxcat.appendChild(newcatSub); + document.getElementById('jaxcat').appendChild(ajaxcat); + + howto = document.createElement('span'); + howto.innerHTML = ''; + 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 = ''; +} + +function newCatLoaded() { + var p = getResponseElement(); + p.innerHTML = ''; +} + +function newCatInteractive() { + var p = getResponseElement(); + p.innerHTML = ''; +} + +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 = ""; + return; + } + if ( id == '0' ) { + p.innerHTML = ""; + 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; +} \ No newline at end of file diff --git a/wp-admin/categories.php b/wp-admin/categories.php index 219c39ff6f..79163a985c 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -3,6 +3,7 @@ require_once('admin.php'); $title = __('Categories'); $parent_file = 'edit.php'; +$list_js = true; $wpvarstoreset = array('action','cat'); for ($i=0; $i diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 1496a568ce..27d3bc450f 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -3,6 +3,7 @@ require_once('admin.php'); $title = __('Posts'); $parent_file = 'edit.php'; +$list_js = true; require_once('admin-header.php'); $_GET['m'] = (int) $_GET['m']; diff --git a/wp-admin/link-add.php b/wp-admin/link-add.php index d5b609cc93..8a6553a2ec 100644 --- a/wp-admin/link-add.php +++ b/wp-admin/link-add.php @@ -25,7 +25,7 @@ for ($i=0; $i diff --git a/wp-admin/link-categories.php b/wp-admin/link-categories.php index bbbe65e1ad..10fb227723 100644 --- a/wp-admin/link-categories.php +++ b/wp-admin/link-categories.php @@ -5,6 +5,7 @@ require_once('admin.php'); $title = __('Link Categories'); $this_file='link-categories.php'; $parent_file = 'link-manager.php'; +$list_js = true; $wpvarstoreset = array('action', 'cat', 'auto_toggle'); for ($i=0; $i -
-

-
- - - +
+

+ +
- + @@ -62,9 +60,9 @@ foreach($wp_roles->role_names as $role => $name) {
- +
- + @@ -98,13 +96,15 @@ endfor; ?> -
UTC time is:') ?> UTC time is:') ?>
-
-

- + +

+ +

-
+ +
- + + \ No newline at end of file diff --git a/wp-admin/options-misc.php b/wp-admin/options-misc.php index 1fc6a56020..6969f37d9d 100644 --- a/wp-admin/options-misc.php +++ b/wp-admin/options-misc.php @@ -14,20 +14,23 @@ include('admin-header.php');
- - -
: - + + + + - + + + + + +
:
wp-content/uploads'); ?> -
-
diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index bf4e35de59..11bf1ffba1 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -297,6 +297,19 @@ form#upload #post_content { text-align: right; } +.optiontable { + width: 100%; +} + +.optiontable td, .optiontable th { + padding: .5em; +} + +.optiontable th { + width: 33%; + text-align: right; +} + .unapproved { color: #888; } @@ -902,3 +915,28 @@ a.dbx-toggle, a.dbx-toggle:visited { -khtml-opacity: 0.8; 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; +} \ No newline at end of file diff --git a/wp-admin/xfn.js b/wp-admin/xfn.js new file mode 100644 index 0000000000..54c82fbf22 --- /dev/null +++ b/wp-admin/xfn.js @@ -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); \ No newline at end of file