+-
+
+-
+-
+--- 1,651 ----
+ You do not have permission to access this page.') );
+ }
+
++ $id = intval( $_GET['id'] );
++
++ if ( $_GET['updated'] == 'true' ) {
++ ?>
++
++
++
++ get_results( "SELECT * FROM {$wpmuBaseTablePrefix}{$id}_options WHERE option_name NOT LIKE 'rss%' AND option_name NOT LIKE '%user_roles'", ARRAY_A );
++ $details = $wpdb->get_row( "SELECT * FROM {$wpdb->blogs} WHERE blog_id = '{$id}'", ARRAY_A );
++ $editblog_roles = get_blog_option( $id, "{$wpmuBaseTablePrefix}{$id}_user_roles" );
+ ?>
++
+
\ No newline at end of file
diff --git a/wp-content/themes/default/attachment.php b/wp-content/themes/default/attachment.php
deleted file mode 100644
index 779af0d..0000000
--- a/wp-content/themes/default/attachment.php
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-ID, true, array(450, 800)); // This also populates the iconsize for the next line ?>
-ID); $classname = ($_post->iconsize[0] <= 128 ? 'small' : '') . 'attachment'; // This lets us style narrow icons specially ?>
-
-
- This entry was posted
- post_date) - (60*120)); echo time_since($entry_datetime); echo ' ago'; */ ?>
- on at
- and is filed under .
- You can follow any responses to this entry through the feed.
-
- comment_status) && ('open' == $post->ping_status)) {
- // Both Comments and Pings are open ?>
- You can leave a response, or trackback from your own site.
-
- comment_status) && ('open' == $post->ping_status)) {
- // Only Pings are Open ?>
- Responses are currently closed, but you can trackback from your own site.
-
- comment_status) && !('open' == $post->ping_status)) {
- // Comments are open, Pings are not ?>
- You can skip to the end and leave a response. Pinging is currently not allowed.
-
- comment_status) && !('open' == $post->ping_status)) {
- // Neither Comments, nor Pings are open ?>
- Both comments and pings are currently closed.
-
-
-
-
-
+
+ This entry was posted on at
+ and is filed under .
+ You can follow any responses to this entry through the feed.
+
+ comment_status) && ('open' == $post->ping_status)) {
+ // Both Comments and Pings are open ?>
+ You can leave a response, or trackback from your own site.
+
+ comment_status) && ('open' == $post->ping_status)) {
+ // Only Pings are Open ?>
+ Responses are currently closed, but you can trackback from your own site.
+
+ comment_status) && !('open' == $post->ping_status)) {
+ // Comments are open, Pings are not ?>
+ You can skip to the end and leave a response. Pinging is currently not allowed.
+
+ comment_status) && !('open' == $post->ping_status)) {
+ // Neither Comments, nor Pings are open ?>
+ Both comments and pings are currently closed.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Sorry, no attachments matched your criteria.
+
+
+
+
+
+
diff --git a/wp-includes/class-phpass.php b/wp-includes/class-phpass.php
new file mode 100644
index 0000000..656caa3
--- /dev/null
+++ b/wp-includes/class-phpass.php
@@ -0,0 +1,256 @@
+ in 2004-2006 and placed in
+# the public domain.
+#
+# There's absolutely no warranty.
+#
+# The homepage URL for this framework is:
+#
+# http://www.openwall.com/phpass/
+#
+# Please be sure to update the Version line if you edit this file in any way.
+# It is suggested that you leave the main version number intact, but indicate
+# your project name (after the slash) and add your own revision information.
+#
+# Please do not change the "private" password hashing method implemented in
+# here, thereby making your hashes incompatible. However, if you must, please
+# change the hash type identifier (the "$P$") to something different.
+#
+# Obviously, since this code is in the public domain, the above are not
+# requirements (there can be none), but merely suggestions.
+#
+class PasswordHash {
+ var $itoa64;
+ var $iteration_count_log2;
+ var $portable_hashes;
+ var $random_state;
+
+ function PasswordHash($iteration_count_log2, $portable_hashes)
+ {
+ $this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
+
+ if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31)
+ $iteration_count_log2 = 8;
+ $this->iteration_count_log2 = $iteration_count_log2;
+
+ $this->portable_hashes = $portable_hashes;
+
+ $this->random_state = microtime() . getmypid();
+ }
+
+ function get_random_bytes($count)
+ {
+ $output = '';
+ if (($fh = @fopen('/dev/urandom', 'rb'))) {
+ $output = fread($fh, $count);
+ fclose($fh);
+ }
+
+ if (strlen($output) < $count) {
+ $output = '';
+ for ($i = 0; $i < $count; $i += 16) {
+ $this->random_state =
+ md5(microtime() . $this->random_state);
+ $output .=
+ pack('H*', md5($this->random_state));
+ }
+ $output = substr($output, 0, $count);
+ }
+
+ return $output;
+ }
+
+ function encode64($input, $count)
+ {
+ $output = '';
+ $i = 0;
+ do {
+ $value = ord($input[$i++]);
+ $output .= $this->itoa64[$value & 0x3f];
+ if ($i < $count)
+ $value |= ord($input[$i]) << 8;
+ $output .= $this->itoa64[($value >> 6) & 0x3f];
+ if ($i++ >= $count)
+ break;
+ if ($i < $count)
+ $value |= ord($input[$i]) << 16;
+ $output .= $this->itoa64[($value >> 12) & 0x3f];
+ if ($i++ >= $count)
+ break;
+ $output .= $this->itoa64[($value >> 18) & 0x3f];
+ } while ($i < $count);
+
+ return $output;
+ }
+
+ function gensalt_private($input)
+ {
+ $output = '$P$';
+ $output .= $this->itoa64[min($this->iteration_count_log2 +
+ ((PHP_VERSION >= '5') ? 5 : 3), 30)];
+ $output .= $this->encode64($input, 6);
+
+ return $output;
+ }
+
+ function crypt_private($password, $setting)
+ {
+ $output = '*0';
+ if (substr($setting, 0, 2) == $output)
+ $output = '*1';
+
+ if (substr($setting, 0, 3) != '$P$')
+ return $output;
+
+ $count_log2 = strpos($this->itoa64, $setting[3]);
+ if ($count_log2 < 7 || $count_log2 > 30)
+ return $output;
+
+ $count = 1 << $count_log2;
+
+ $salt = substr($setting, 4, 8);
+ if (strlen($salt) != 8)
+ return $output;
+
+ # We're kind of forced to use MD5 here since it's the only
+ # cryptographic primitive available in all versions of PHP
+ # currently in use. To implement our own low-level crypto
+ # in PHP would result in much worse performance and
+ # consequently in lower iteration counts and hashes that are
+ # quicker to crack (by non-PHP code).
+ if (PHP_VERSION >= '5') {
+ $hash = md5($salt . $password, TRUE);
+ do {
+ $hash = md5($hash . $password, TRUE);
+ } while (--$count);
+ } else {
+ $hash = pack('H*', md5($salt . $password));
+ do {
+ $hash = pack('H*', md5($hash . $password));
+ } while (--$count);
+ }
+
+ $output = substr($setting, 0, 12);
+ $output .= $this->encode64($hash, 16);
+
+ return $output;
+ }
+
+ function gensalt_extended($input)
+ {
+ $count_log2 = min($this->iteration_count_log2 + 8, 24);
+ # This should be odd to not reveal weak DES keys, and the
+ # maximum valid value is (2**24 - 1) which is odd anyway.
+ $count = (1 << $count_log2) - 1;
+
+ $output = '_';
+ $output .= $this->itoa64[$count & 0x3f];
+ $output .= $this->itoa64[($count >> 6) & 0x3f];
+ $output .= $this->itoa64[($count >> 12) & 0x3f];
+ $output .= $this->itoa64[($count >> 18) & 0x3f];
+
+ $output .= $this->encode64($input, 3);
+
+ return $output;
+ }
+
+ function gensalt_blowfish($input)
+ {
+ # This one needs to use a different order of characters and a
+ # different encoding scheme from the one in encode64() above.
+ # We care because the last character in our encoded string will
+ # only represent 2 bits. While two known implementations of
+ # bcrypt will happily accept and correct a salt string which
+ # has the 4 unused bits set to non-zero, we do not want to take
+ # chances and we also do not want to waste an additional byte
+ # of entropy.
+ $itoa64 = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
+
+ $output = '$2a$';
+ $output .= chr(ord('0') + $this->iteration_count_log2 / 10);
+ $output .= chr(ord('0') + $this->iteration_count_log2 % 10);
+ $output .= '$';
+
+ $i = 0;
+ do {
+ $c1 = ord($input[$i++]);
+ $output .= $itoa64[$c1 >> 2];
+ $c1 = ($c1 & 0x03) << 4;
+ if ($i >= 16) {
+ $output .= $itoa64[$c1];
+ break;
+ }
+
+ $c2 = ord($input[$i++]);
+ $c1 |= $c2 >> 4;
+ $output .= $itoa64[$c1];
+ $c1 = ($c2 & 0x0f) << 2;
+
+ $c2 = ord($input[$i++]);
+ $c1 |= $c2 >> 6;
+ $output .= $itoa64[$c1];
+ $output .= $itoa64[$c2 & 0x3f];
+ } while (1);
+
+ return $output;
+ }
+
+ function HashPassword($password)
+ {
+ $random = '';
+
+ if (CRYPT_BLOWFISH == 1 && !$this->portable_hashes) {
+ $random = $this->get_random_bytes(16);
+ $hash =
+ crypt($password, $this->gensalt_blowfish($random));
+ if (strlen($hash) == 60)
+ return $hash;
+ }
+
+ if (CRYPT_EXT_DES == 1 && !$this->portable_hashes) {
+ if (strlen($random) < 3)
+ $random = $this->get_random_bytes(3);
+ $hash =
+ crypt($password, $this->gensalt_extended($random));
+ if (strlen($hash) == 20)
+ return $hash;
+ }
+
+ if (strlen($random) < 6)
+ $random = $this->get_random_bytes(6);
+ $hash =
+ $this->crypt_private($password,
+ $this->gensalt_private($random));
+ if (strlen($hash) == 34)
+ return $hash;
+
+ # Returning '*' on error is safe here, but would _not_ be safe
+ # in a crypt(3)-like function used _both_ for generating new
+ # hashes and for validating passwords against existing hashes.
+ return '*';
+ }
+
+ function CheckPassword($password, $stored_hash)
+ {
+ $hash = $this->crypt_private($password, $stored_hash);
+ if ($hash[0] == '*')
+ $hash = crypt($password, $stored_hash);
+
+ return $hash == $stored_hash;
+ }
+}
+
+?>
diff --git a/wp-includes/images/audio.png b/wp-includes/images/audio.png
new file mode 100644
index 0000000..7b2a854
Binary files /dev/null and b/wp-includes/images/audio.png differ
diff --git a/wp-includes/images/crystal/archive.png b/wp-includes/images/crystal/archive.png
new file mode 100644
index 0000000..670648a
Binary files /dev/null and b/wp-includes/images/crystal/archive.png differ
diff --git a/wp-includes/images/crystal/audio.png b/wp-includes/images/crystal/audio.png
new file mode 100644
index 0000000..5a3d4d3
Binary files /dev/null and b/wp-includes/images/crystal/audio.png differ
diff --git a/wp-includes/images/crystal/code.png b/wp-includes/images/crystal/code.png
new file mode 100644
index 0000000..b67c600
Binary files /dev/null and b/wp-includes/images/crystal/code.png differ
diff --git a/wp-includes/images/crystal/default.png b/wp-includes/images/crystal/default.png
new file mode 100644
index 0000000..b1bbbc7
Binary files /dev/null and b/wp-includes/images/crystal/default.png differ
diff --git a/wp-includes/images/crystal/document.png b/wp-includes/images/crystal/document.png
new file mode 100644
index 0000000..3295ccd
Binary files /dev/null and b/wp-includes/images/crystal/document.png differ
diff --git a/wp-includes/images/crystal/interactive.png b/wp-includes/images/crystal/interactive.png
new file mode 100644
index 0000000..fd6de7d
Binary files /dev/null and b/wp-includes/images/crystal/interactive.png differ
diff --git a/wp-includes/images/crystal/license.txt b/wp-includes/images/crystal/license.txt
new file mode 100644
index 0000000..cdabd2f
--- /dev/null
+++ b/wp-includes/images/crystal/license.txt
@@ -0,0 +1,9 @@
+Crystal Project Icons
+by Everaldo Coelho
+http://everaldo.com
+
+Released under LGPL
+
+Modified February 2008
+for WordPress
+http://wordpress.org
\ No newline at end of file
diff --git a/wp-includes/images/crystal/spreadsheet.png b/wp-includes/images/crystal/spreadsheet.png
new file mode 100644
index 0000000..f2c4d30
Binary files /dev/null and b/wp-includes/images/crystal/spreadsheet.png differ
diff --git a/wp-includes/images/crystal/text.png b/wp-includes/images/crystal/text.png
new file mode 100644
index 0000000..feaed5b
Binary files /dev/null and b/wp-includes/images/crystal/text.png differ
diff --git a/wp-includes/images/crystal/video.png b/wp-includes/images/crystal/video.png
new file mode 100644
index 0000000..e1b879d
Binary files /dev/null and b/wp-includes/images/crystal/video.png differ
diff --git a/wp-includes/images/css.png b/wp-includes/images/css.png
new file mode 100644
index 0000000..038e34d
Binary files /dev/null and b/wp-includes/images/css.png differ
diff --git a/wp-includes/images/default.png b/wp-includes/images/default.png
new file mode 100644
index 0000000..c551227
Binary files /dev/null and b/wp-includes/images/default.png differ
diff --git a/wp-includes/images/doc.png b/wp-includes/images/doc.png
new file mode 100644
index 0000000..e4e62a1
Binary files /dev/null and b/wp-includes/images/doc.png differ
diff --git a/wp-includes/images/exe.png b/wp-includes/images/exe.png
new file mode 100644
index 0000000..d994265
Binary files /dev/null and b/wp-includes/images/exe.png differ
diff --git a/wp-includes/images/html.png b/wp-includes/images/html.png
new file mode 100644
index 0000000..ed81af1
Binary files /dev/null and b/wp-includes/images/html.png differ
diff --git a/wp-includes/images/js.png b/wp-includes/images/js.png
new file mode 100644
index 0000000..e0862d3
Binary files /dev/null and b/wp-includes/images/js.png differ
diff --git a/wp-includes/images/pdf.png b/wp-includes/images/pdf.png
new file mode 100644
index 0000000..b4d5f9c
Binary files /dev/null and b/wp-includes/images/pdf.png differ
diff --git a/wp-includes/images/swf.png b/wp-includes/images/swf.png
new file mode 100644
index 0000000..156e3e4
Binary files /dev/null and b/wp-includes/images/swf.png differ
diff --git a/wp-includes/images/tar.png b/wp-includes/images/tar.png
new file mode 100644
index 0000000..0468ef8
Binary files /dev/null and b/wp-includes/images/tar.png differ
diff --git a/wp-includes/images/text.png b/wp-includes/images/text.png
new file mode 100644
index 0000000..10bcf5e
Binary files /dev/null and b/wp-includes/images/text.png differ
diff --git a/wp-includes/images/video.png b/wp-includes/images/video.png
new file mode 100644
index 0000000..f822ac4
Binary files /dev/null and b/wp-includes/images/video.png differ
diff --git a/wp-includes/images/zip.png b/wp-includes/images/zip.png
new file mode 100644
index 0000000..d1eaf1e
Binary files /dev/null and b/wp-includes/images/zip.png differ
diff --git a/wp-includes/js/dbx.js b/wp-includes/js/dbx.js
deleted file mode 100644
index 8e89c5a..0000000
--- a/wp-includes/js/dbx.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// DBX2.05 :: Docking Boxes (dbx)
-// *****************************************************
-// DOM scripting by brothercake -- http://www.brothercake.com/
-// GNU Lesser General Public License -- http://www.gnu.org/licenses/lgpl.html
-//******************************************************
-var dbx;function dbxManager(sid){dbx = this;if(!/^[-_a-z0-9]+$/i.test(sid)) { alert('Error from dbxManager:\n"' + sid + '" is an invalid session ID'); return; }this.supported = !(document.getElementsByTagName('*').length == 0 || (navigator.vendor == 'KDE' && typeof window.sidebar == 'undefined'));if(!this.supported) { return; }this.etype = typeof document.addEventListener != 'undefined' ? 'addEventListener' : typeof document.attachEvent != 'undefined' ? 'attachEvent' : 'none';this.eprefix = (this.etype == 'attachEvent' ? 'on' : '');if(typeof window.opera != 'undefined' && parseFloat(navigator.userAgent.toLowerCase().split(/opera[\/ ]/)[1].split(' ')[0], 10) < 7.5){this.etype = 'none';}if(this.etype == 'none') { this.supported = false; return; }this.running = 0;this.sid = sid;this.savedata = {};this.cookiestate = this.getCookieState();};dbxManager.prototype.setCookieState = function(){var now = new Date();now.setTime(now.getTime() + (365*24*60*60*1000));var str = '';for(j in this.savedata){if(typeof this.savedata[j]!='function'){str += j + '=' + this.savedata[j] + '&'}}this.state = str.replace(/^(.+)&$/, '$1');this.cookiestring = this.state.replace(/,/g, '|');this.cookiestring = this.cookiestring.replace(/=/g, ':');if(typeof this.onstatechange == 'undefined' || this.onstatechange()){document.cookie = 'dbx-' + this.sid + '='+ this.cookiestring+ '; expires=' + now.toGMTString()+ '; path=/';}};dbxManager.prototype.getCookieState = function(){this.cookiestate = null;if(document.cookie){if(document.cookie.indexOf('dbx-' + this.sid)!=-1){this.cookie = document.cookie.split('dbx-' + this.sid + '=')[1].split(';')[0].split('&');for(var i in this.cookie){if(typeof this.cookie[i]!='function'){this.cookie[i] = this.cookie[i].replace(/\|/g, ',');this.cookie[i]= this.cookie[i].replace(/:/g, '=');this.cookie[i] = this.cookie[i].split('=');this.cookie[i][1] = this.cookie[i][1].split(',');}}this.cookiestate = {};for(i in this.cookie){if(typeof this.cookie[i]!='function'){this.cookiestate[this.cookie[i][0]] = this.cookie[i][1];}}}}return this.cookiestate;};dbxManager.prototype.addDataMember = function(gid, order){this.savedata[gid] = order;};dbxManager.prototype.createElement = function(tag){return typeof document.createElementNS != 'undefined' ? document.createElementNS('http://www.w3.org/1999/xhtml', tag) : document.createElement(tag);};dbxManager.prototype.getTarget = function(e, pattern, node){if(typeof node != 'undefined'){var target = node;}else{target = typeof e.target != 'undefined' ? e.target : e.srcElement;}var regex = new RegExp(pattern, '');while(!regex.test(target.className)){target = target.parentNode;}return target;};function dbxGroup(gid, dir, thresh, fix, ani, togs, def, open, close, move, toggle, kmove, ktoggle, syntax){if(!/^[-_a-z0-9]+$/i.test(gid)) { alert('Error from dbxGroup:\n"' + gid + '" is an invalid container ID'); return; }this.container = document.getElementById(gid);if(this.container == null || !dbx.supported) { return; }var self = this;this.gid = gid;this.dragok = false;this.box = null;this.vertical = dir == 'vertical';this.threshold = parseInt(thresh, 10);this.restrict = fix == 'yes';this.resolution = parseInt(ani, 10);this.toggles = togs == 'yes';this.defopen = def != 'closed';this.vocab = {'open' : open,'close' : close,'move' : move,'toggle' : toggle,'kmove' : kmove,'ktoggle' : ktoggle,'syntax' : syntax};this.container.style.position = 'relative';this.container.style.display = 'block';if(typeof window.opera != 'undefined'){this.container.style.display = 'run-in';}this.boxes = [];this.buttons = [];this.order = [];this.eles = this.container.getElementsByTagName('*');for(var i=0; i 0)){var sibling = this.boxes[positions[i + (positive ? 1 : -1)][0]];if(this.resolution > 0){var visipos = { 'x' : parent.offsetLeft, 'y' : parent.offsetTop };var siblingpos = { 'x' : sibling.offsetLeft, 'y' : sibling.offsetTop };}var obj = { 'insert' : (positive ? sibling : parent), 'before' : (positive ? parent : sibling) };this.container.insertBefore(obj.insert, obj.before);if(this.resolution > 0){var animators ={'sibling' : new dbxAnimator(this, sibling, siblingpos, this.resolution, true, anchor),'parent' : new dbxAnimator(this, parent, visipos, this.resolution, true, anchor)};}else{anchor.focus();}break;}}}this.getBoxOrder();}};dbxGroup.prototype.compare = function(a, b){return a[1] - b[1];};dbxGroup.prototype.createTooltip = function(isopen, anchor){if(this.keydown){this.tooltip = this.container.appendChild(dbx.createElement('span'));this.tooltip.style.visibility = 'hidden';this.tooltip.className = 'dbx-tooltip';if(isopen != null){this.tooltip.appendChild(document.createTextNode(this.vocab.kmove + this.vocab.ktoggle.replace('%toggle%', isopen ? this.vocab.close : this.vocab.open)));}else{this.tooltip.appendChild(document.createTextNode(this.vocab.kmove));}var parent = dbx.getTarget(null, 'dbx\-box', anchor);this.tooltip.style.left = parent.offsetLeft + 'px';this.tooltip.style.top = parent.offsetTop + 'px';var tooltip = this.tooltip;window.setTimeout(function(){if(tooltip != null) { tooltip.style.visibility = 'visible'; }}, 500);}};dbxGroup.prototype.removeTooltip = function(){if(this.tooltip != null){this.tooltip.parentNode.removeChild(this.tooltip);this.tooltip = null;}};dbxGroup.prototype.mousedown = function(e, box){var node = typeof e.target != 'undefined' ? e.target : e.srcElement;if(node.nodeName == '#text') { node = node.parentNode; }if(!/dbx\-(toggle|box|group)/i.test(node.className)){while(!/dbx\-(handle|box|group)/i.test(node.className)){node = node.parentNode;}}if(/dbx\-handle/i.test(node.className)){this.removeTooltip();this.released = false;this.initial = { 'x' : e.clientX, 'y' : e.clientY };this.current = { 'x' : 0, 'y' : 0 };this.createCloneBox(box);if(typeof e.preventDefault != 'undefined' ) { e.preventDefault(); }if(typeof document.onselectstart != 'undefined'){document.onselectstart = function() { return false; }}}};dbxGroup.prototype.mousemove = function(e){if(this.dragok && this.box != null){this.positive = this.vertical ? (e.clientY > this.current.y ? true : false) : (e.clientX > this.current.x ? true : false);this.current = { 'x' : e.clientX, 'y' : e.clientY };var overall = { 'x' : this.current.x - this.initial.x, 'y' : this.current.y - this.initial.y };if(((overall.x >= 0 && overall.x <= this.threshold) || (overall.x <= 0 && overall.x >= 0 - this.threshold))&&((overall.y >= 0 && overall.y <= this.threshold) || (overall.y <= 0 && overall.y >= 0 - this.threshold))){this.current.x -= overall.x;this.current.y -= overall.y;}if(this.released || overall.x > this.threshold || overall.x < (0 - this.threshold) || overall.y > this.threshold || overall.y < (0 - this.threshold)){dbx.group = this.container;dbx.box = this.box;dbx.event = e;if(typeof dbx.onboxdrag == 'undefined' || dbx.onboxdrag()){this.released = true;if(!this.restrict || !this.vertical) { this.boxclone.style.left = (this.current.x - this.difference.x) + 'px'; }if(!this.restrict || this.vertical) { this.boxclone.style.top = (this.current.y - this.difference.y) + 'px'; }this.moveOriginalToPosition(this.current.x, this.current.y);if(typeof e.preventDefault != 'undefined' ) { e.preventDefault(); }}}}return true;};dbxGroup.prototype.mouseup = function(e){if(this.box != null){this.moveOriginalToPosition(e.clientX, e.clientY);this.removeCloneBox();this.getBoxOrder();if(typeof document.onselectstart != 'undefined'){document.onselectstart = function() { return true; }}}this.dragok = false;};dbxGroup.prototype.keypress = function(e, anchor){if(/^(3[7-9])|(40)$/.test(e.keyCode)){this.removeTooltip();if((this.vertical && /^(38|40)$/.test(e.keyCode)) || (!this.vertical && /^(37|39)$/.test(e.keyCode))){this.shiftBoxPosition(e, anchor, /^[3][78]$/.test(e.keyCode) ? false : true);if(typeof e.preventDefault != 'undefined') { e.preventDefault(); }else { return false; }typeof e.stopPropagation != 'undefined' ? e.stopPropagation() : e.cancelBubble = true;this.keydown = false;}}return true;};dbxGroup.prototype.getBoxOrder = function(){this.order = [];var len = this.eles.length;for(var j=0; j boxprops.xy && cloneprops.xy < boxprops.xy)||(!this.positive && cloneprops.xy < boxprops.xy && cloneprops.xy + cloneprops.wh > boxprops.xy)){if(this.boxes[i] == this.box) { return; }var sibling = this.box.nextSibling;while(sibling.className == null || !/dbx\-box/.test(sibling.className)){sibling = sibling.nextSibling;}if(this.boxes[i] == sibling) { return; }if(this.resolution > 0){if(this.box[this.vertical ? 'offsetTop' : 'offsetLeft'] < boxprops.xy){var visibox = this.boxes[i].previousSibling;while(visibox.className == null || !/dbx\-box/.test(visibox.className)){visibox = visibox.previousSibling;}}else{visibox = this.boxes[i];}var visipos = { 'x' : visibox.offsetLeft, 'y' : visibox.offsetTop };}var prepos = { 'x' : this.box.offsetLeft, 'y' : this.box.offsetTop };this.container.insertBefore(this.box, this.boxes[i]);this.initial.x += (this.box.offsetLeft - prepos.x);this.initial.y += (this.box.offsetTop - prepos.y);if(this.resolution > 0 && visibox != this.box){var animator = new dbxAnimator(this, visibox, visipos, this.resolution, false, null);}else{}break;}}};function dbxAnimator(caller, box, pos, res, kbd, anchor){this.caller = caller;this.box = box;this.timer = null;var before = pos[this.caller.vertical ? 'y' : 'x'];var after = this.box[this.caller.vertical ? 'offsetTop' : 'offsetLeft'];if(before != after){if(dbx.running > this.caller.boxes.length - 1) { return; }var clone = this.caller.createClone(this.box, 29999, arguments[2]);clone.style.visibility = 'visible';this.box.style.visibility = 'hidden';this.animateClone(clone,before,after > before ? after - before : 0 - (before - after),this.caller.vertical ? 'top' : 'left',res,kbd,anchor);}};dbxAnimator.prototype.animateClone = function(clone, current, change, dir, res, kbd, anchor){var self = this;var count = 0;dbx.running ++;this.timer = window.setInterval(function(){count ++;current += change / res;clone.style[dir] = current + 'px';if(count == res){window.clearTimeout(self.timer);self.timer = null;dbx.running --;self.caller.container.removeChild(clone);self.box.style.visibility = 'visible';if(kbd){if(anchor != null && anchor.parentNode.style.visibility != 'hidden'){anchor.focus();}else if(self.caller.toggles){var button = self.caller.buttons[parseInt(self.box.className.split('dbxid')[1],10)];if(button != null && typeof button.isactive != 'undefined'){button.focus();}}}}}, 20);};if(typeof window.attachEvent != 'undefined'){window.attachEvent('onunload', function(){var ev = ['mousedown', 'mousemove', 'mouseup', 'mouseout', 'click', 'keydown', 'keyup', 'focus', 'blur', 'selectstart', 'statechange', 'boxdrag', 'boxopen', 'boxclose'];var el = ev.length;var dl = document.all.length;for(var i=0; i
+ // 4. otherwise use given initial argument
+ // 5. check if tab is disabled
+ this.$tabs.each(function(i, a) {
+ if (location.hash) {
+ if (a.hash == location.hash) {
+ o.initial = i;
+ // prevent page scroll to fragment
+ //if (($.browser.msie || $.browser.opera) && !o.remote) {
+ if ($.browser.msie || $.browser.opera) {
+ var $toShow = $(location.hash), toShowId = $toShow.attr('id');
+ $toShow.attr('id', '');
+ setTimeout(function() {
+ $toShow.attr('id', toShowId); // restore id
+ }, 500);
+ }
+ scrollTo(0, 0);
+ return false; // break
+ }
+ } else if (o.cookie) {
+ o.initial = parseInt($.cookie( $.ui.tabs.INSTANCE_KEY + $.data(self.source) )) || 0;
+ return false; // break
+ } else if ( self.$lis.eq(i).hasClass(o.selectedClass) ) {
+ o.initial = i;
+ return false; // break
+ }
+ });
+ var n = this.$lis.length;
+ while (this.$lis.eq(o.initial).hasClass(o.disabledClass) && n) {
+ o.initial = ++o.initial < this.$lis.length ? o.initial : 0;
+ n--;
+ }
+ if (!n) { // all tabs disabled, set option unselected to true
+ o.unselected = o.unselect = true;
+ }
+
+ // highlight selected tab
+ this.$panels.addClass(o.hideClass);
+ this.$lis.removeClass(o.selectedClass);
+ if (!o.unselected) {
+ this.$panels.eq(o.initial).show().removeClass(o.hideClass); // use show and remove class to show in any case no matter how it has been hidden before
+ this.$lis.eq(o.initial).addClass(o.selectedClass);
+ }
+
+ // load if remote tab
+ var href = !o.unselected && $.data(this.$tabs[o.initial], 'href');
+ if (href) {
+ this.load(o.initial + 1, href);
+ }
+
+ // disable click if event is configured to something else
+ if (!/^click/.test(o.event)) {
+ this.$tabs.bind('click', function(e) { e.preventDefault(); });
+ }
+
+ }
+
+ // setup animations
+ var showAnim = {}, showSpeed = o.fxShowSpeed || o.fxSpeed,
+ hideAnim = {}, hideSpeed = o.fxHideSpeed || o.fxSpeed;
+ if (o.fxSlide || o.fxFade) {
+ if (o.fxSlide) {
+ showAnim['height'] = 'show';
+ hideAnim['height'] = 'hide';
+ }
+ if (o.fxFade) {
+ showAnim['opacity'] = 'show';
+ hideAnim['opacity'] = 'hide';
+ }
+ } else {
+ if (o.fxShow) {
+ showAnim = o.fxShow;
+ } else { // use some kind of animation to prevent browser scrolling to the tab
+ showAnim['min-width'] = 0; // avoid opacity, causes flicker in Firefox
+ showSpeed = 1; // as little as 1 is sufficient
+ }
+ if (o.fxHide) {
+ hideAnim = o.fxHide;
+ } else { // use some kind of animation to prevent browser scrolling to the tab
+ hideAnim['min-width'] = 0; // avoid opacity, causes flicker in Firefox
+ hideSpeed = 1; // as little as 1 is sufficient
+ }
+ }
+
+ // reset some styles to maintain print style sheets etc.
+ var resetCSS = { display: '', overflow: '', height: '' };
+ if (!$.browser.msie) { // not in IE to prevent ClearType font issue
+ resetCSS['opacity'] = '';
+ }
+
+ // Hide a tab, animation prevents browser scrolling to fragment,
+ // $show is optional.
+ function hideTab(clicked, $hide, $show) {
+ $hide.animate(hideAnim, hideSpeed, function() { //
+ $hide.addClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
+ if ($.browser.msie && hideAnim['opacity']) {
+ $hide[0].style.filter = '';
+ }
+ o.hide(clicked, $hide[0], $show && $show[0] || null);
+ if ($show) {
+ showTab(clicked, $show, $hide);
+ }
+ });
+ }
+
+ // Show a tab, animation prevents browser scrolling to fragment,
+ // $hide is optional
+ function showTab(clicked, $show, $hide) {
+ if (!(o.fxSlide || o.fxFade || o.fxShow)) {
+ $show.css('display', 'block'); // prevent occasionally occuring flicker in Firefox cause by gap between showing and hiding the tab panels
+ }
+ $show.animate(showAnim, showSpeed, function() {
+ $show.removeClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
+ if ($.browser.msie && showAnim['opacity']) {
+ $show[0].style.filter = '';
+ }
+ o.show(clicked, $show[0], $hide && $hide[0] || null);
+ });
+ }
+
+ // switch a tab
+ function switchTab(clicked, $li, $hide, $show) {
+ /*if (o.bookmarkable && trueClick) { // add to history only if true click occured, not a triggered click
+ $.ajaxHistory.update(clicked.hash);
+ }*/
+ $li.addClass(o.selectedClass)
+ .siblings().removeClass(o.selectedClass);
+ hideTab(clicked, $hide, $show);
+ }
+
+ // attach tab event handler, unbind to avoid duplicates from former tabifying...
+ this.$tabs.unbind(o.event).bind(o.event, function() {
+
+ //var trueClick = e.clientX; // add to history only if true click occured, not a triggered click
+ var $li = $(this).parents('li:eq(0)'),
+ $hide = self.$panels.filter(':visible'),
+ $show = $(this.hash);
+
+ // If tab is already selected and not unselectable or tab disabled or click callback returns false stop here.
+ // Check if click handler returns false last so that it is not executed for a disabled tab!
+ if (($li.hasClass(o.selectedClass) && !o.unselect) || $li.hasClass(o.disabledClass)
+ || o.click(this, $show[0], $hide[0]) === false) {
+ this.blur();
+ return false;
+ }
+
+ if (o.cookie) {
+ $.cookie($.ui.tabs.INSTANCE_KEY + $.data(self.source), self.$tabs.index(this), o.cookie);
+ }
+
+ // if tab may be closed
+ if (o.unselect) {
+ if ($li.hasClass(o.selectedClass)) {
+ $li.removeClass(o.selectedClass);
+ self.$panels.stop();
+ hideTab(this, $hide);
+ this.blur();
+ return false;
+ } else if (!$hide.length) {
+ self.$panels.stop();
+ if ($.data(this, 'href')) { // remote tab
+ var a = this;
+ self.load(self.$tabs.index(this) + 1, $.data(this, 'href'), function() {
+ $li.addClass(o.selectedClass).addClass(o.unselectClass);
+ showTab(a, $show);
+ });
+ } else {
+ $li.addClass(o.selectedClass).addClass(o.unselectClass);
+ showTab(this, $show);
+ }
+ this.blur();
+ return false;
+ }
+ }
+
+ // stop possibly running animations
+ self.$panels.stop();
+
+ // show new tab
+ if ($show.length) {
+
+ // prevent scrollbar scrolling to 0 and than back in IE7, happens only if bookmarking/history is enabled
+ /*if ($.browser.msie && o.bookmarkable) {
+ var showId = this.hash.replace('#', '');
+ $show.attr('id', '');
+ setTimeout(function() {
+ $show.attr('id', showId); // restore id
+ }, 0);
+ }*/
+
+ if ($.data(this, 'href')) { // remote tab
+ var a = this;
+ self.load(self.$tabs.index(this) + 1, $.data(this, 'href'), function() {
+ switchTab(a, $li, $hide, $show);
+ });
+ } else {
+ switchTab(this, $li, $hide, $show);
+ }
+
+ // Set scrollbar to saved position - need to use timeout with 0 to prevent browser scroll to target of hash
+ /*var scrollX = window.pageXOffset || document.documentElement && document.documentElement.scrollLeft || document.body.scrollLeft || 0;
+ var scrollY = window.pageYOffset || document.documentElement && document.documentElement.scrollTop || document.body.scrollTop || 0;
+ setTimeout(function() {
+ scrollTo(scrollX, scrollY);
+ }, 0);*/
+
+ } else {
+ throw 'jQuery UI Tabs: Mismatching fragment identifier.';
+ }
+
+ // Prevent IE from keeping other link focussed when using the back button
+ // and remove dotted border from clicked link. This is controlled in modern
+ // browsers via CSS, also blur removes focus from address bar in Firefox
+ // which can become a usability and annoying problem with tabsRotate.
+ if ($.browser.msie) {
+ this.blur();
+ }
+
+ //return o.bookmarkable && !!trueClick; // convert trueClick == undefined to Boolean required in IE
+ return false;
+
+ });
+
+ },
+ add: function(url, text, position) {
+ if (url && text) {
+ position = position || this.$tabs.length; // append by default
+
+ var o = this.options,
+ $li = $(o.tabTemplate.replace(/#\{href\}/, url).replace(/#\{text\}/, text));
+
+ var id = url.indexOf('#') == 0 ? url.replace('#', '') : this.tabId( $('a:first-child', $li)[0] );
+
+ // try to find an existing element before creating a new one
+ var $panel = $('#' + id);
+ $panel = $panel.length && $panel
+ || $(o.panelTemplate).attr('id', id).addClass(o.panelClass).addClass(o.hideClass);
+ if (position >= this.$lis.length) {
+ $li.appendTo(this.source);
+ $panel.appendTo(this.source.parentNode);
+ } else {
+ $li.insertBefore(this.$lis[position - 1]);
+ $panel.insertBefore(this.$panels[position - 1]);
+ }
+
+ this.tabify();
+
+ if (this.$tabs.length == 1) {
+ $li.addClass(o.selectedClass);
+ $panel.removeClass(o.hideClass);
+ var href = $.data(this.$tabs[0], 'href');
+ if (href) {
+ this.load(position + 1, href);
+ }
+ }
+ o.add(this.$tabs[position], this.$panels[position]); // callback
+ } else {
+ throw 'jQuery UI Tabs: Not enough arguments to add tab.';
+ }
+ },
+ remove: function(position) {
+ if (position && position.constructor == Number) {
+ var o = this.options, $li = this.$lis.eq(position - 1).remove(),
+ $panel = this.$panels.eq(position - 1).remove();
+
+ // If selected tab was removed focus tab to the right or
+ // tab to the left if last tab was removed.
+ if ($li.hasClass(o.selectedClass) && this.$tabs.length > 1) {
+ this.click(position + (position < this.$tabs.length ? 1 : -1));
+ }
+ this.tabify();
+ o.remove($li.end()[0], $panel[0]); // callback
+ }
+ },
+ enable: function(position) {
+ var o = this.options, $li = this.$lis.eq(position - 1);
+ $li.removeClass(o.disabledClass);
+ if ($.browser.safari) { // fix disappearing tab (that used opacity indicating disabling) after enabling in Safari 2...
+ $li.css('display', 'inline-block');
+ setTimeout(function() {
+ $li.css('display', 'block')
+ }, 0)
+ }
+ o.enable(this.$tabs[position - 1], this.$panels[position - 1]); // callback
+ },
+ disable: function(position) {
+ var o = this.options;
+ this.$lis.eq(position - 1).addClass(o.disabledClass);
+ o.disable(this.$tabs[position - 1], this.$panels[position - 1]); // callback
+ },
+ click: function(position) {
+ this.$tabs.eq(position - 1).trigger(this.options.event);
+ },
+ load: function(position, url, callback) {
+ var self = this, o = this.options,
+ $a = this.$tabs.eq(position - 1), a = $a[0], $span = $('span', a);
+
+ // shift arguments
+ if (url && url.constructor == Function) {
+ callback = url;
+ url = null;
+ }
+
+ // set new URL or get existing
+ if (url) {
+ $.data(a, 'href', url);
+ } else {
+ url = $.data(a, 'href');
+ }
+
+ // load
+ if (o.spinner) {
+ $.data(a, 'title', $span.html());
+ $span.html('' + o.spinner + '');
+ }
+ var finish = function() {
+ self.$tabs.filter('.' + o.loadingClass).each(function() {
+ $(this).removeClass(o.loadingClass);
+ if (o.spinner) {
+ $('span', this).html( $.data(this, 'title') );
+ }
+ });
+ self.xhr = null;
+ };
+ var ajaxOptions = $.extend(o.ajaxOptions, {
+ url: url,
+ success: function(r) {
+ $(a.hash).html(r);
+ finish();
+ // This callback is required because the switch has to take
+ // place after loading has completed.
+ if (callback && callback.constructor == Function) {
+ callback();
+ }
+ if (o.cache) {
+ $.removeData(a, 'href'); // if loaded once do not load them again
+ }
+ o.load(self.$tabs[position - 1], self.$panels[position - 1]); // callback
+ }
+ });
+ if (this.xhr) {
+ // terminate pending requests from other tabs and restore title
+ this.xhr.abort();
+ finish();
+ }
+ $a.addClass(o.loadingClass);
+ setTimeout(function() { // timeout is again required in IE, "wait" for id being restored
+ self.xhr = $.ajax(ajaxOptions);
+ }, 0);
+
+ },
+ href: function(position, href) {
+ $.data(this.$tabs.eq(position - 1)[0], 'href', href);
+ }
+ });
+
+})(jQuery);
diff --git a/wp-includes/js/list-manipulation.js b/wp-includes/js/list-manipulation.js
deleted file mode 100644
index e522709..0000000
--- a/wp-includes/js/list-manipulation.js
+++ /dev/null
@@ -1,295 +0,0 @@
-addLoadEvent( function() {
- if ( 'undefined' != typeof listManL10n )
- Object.extend(listMan.prototype, listManL10n);
- theList = new listMan();
-} );
-
-function deleteSomething( what, id, message, obj ) {
- if ( !obj )
- obj=theList;
- if ( !message )
- message = obj.delText.replace(/%thing%/g, what);
- if( confirm(message) )
- return obj.ajaxDelete( what, id );
- else return false;
-}
-
-function dimSomething( what, id, dimClass, obj ) {
- if ( !obj )
- obj = theList;
- return obj.ajaxDimmer(what,id,dimClass);
-}
-
-var listMan = Class.create();
-Object.extend(listMan.prototype, {
- ajaxRespEl: 'ajax-response',
- ajaxHandler: false,
- inputData: '',
- clearInputs: [],
- showLink: true,
- topAdder: false,
- alt: 'alternate',
- altOffset: 0,
- addComplete: null,
- delComplete: null,
- dimComplete: null,
- dataStore: null,
- formStore: null,
-
- jumpText: '', // We get these from listManL10n
- delText: '',
-
- initialize: function(theListId) {
- this.theList = $(theListId ? theListId : 'the-list');
- if ( !this.theList )
- return false;
- Element.cleanWhitespace(this.theList);
- },
-
- // sends add-what and fields contained in where
- // recieves html with top element having an id like what-#
- ajaxAdder: function( what, where, update ) { // Do NOT wrap TR in TABLE TBODY
- var ajaxAdd = new WPAjax( this.ajaxHandler, this.ajaxRespEl );
- if ( ajaxAdd.notInitialized() )
- return true;
- var action = ( update ? 'update-' : 'add-' ) + what;
- ajaxAdd.options.parameters = $H(ajaxAdd.options.parameters).merge({action: action}).merge(this.inputData.toQueryParams()).merge(this.grabInputs( where, ajaxAdd ).toQueryParams());
-
- var tempObj=this;
- ajaxAdd.addOnComplete( function(transport) {
- var newItems = $A(transport.responseXML.getElementsByTagName(what));
- if ( newItems ) {
- var showLinkMessage = '';
- var m = '';
- newItems.each( function(i) {
- var id = i.getAttribute('id');
- var exists = $(what+'-'+id);
- if ( exists )
- tempObj.replaceListItem( exists, getNodeValue(i,'response_data'), update );
- else
- tempObj.addListItem( getNodeValue(i, 'response_data') );
- m = getNodeValue(i, 'show-link');
- showLinkMessage += showLinkMessage ? " \n" : '';
- if ( m )
- showLinkMessage += m;
- else
- showLinkMessage += "" + tempObj.jumpText + "";
- });
- if ( tempObj.showLink && showLinkMessage )
- Element.update(ajaxAdd.myResponseElement,"
" + showLinkMessage + "
");
- }
- if ( tempObj.addComplete && typeof tempObj.addComplete == 'function' )
- tempObj.addComplete( what, where, update, transport );
- tempObj.recolorList();
- ajaxAdd.restoreInputs = null;
- });
- if ( !update )
- ajaxAdd.addOnWPError( function(transport) { tempObj.restoreForm(ajaxAdd.restoreInputs); });
- ajaxAdd.request(ajaxAdd.url);
- if ( !update )
- this.clear();
- return false;
- },
-
- // sends update-what and fields contained in where
- // recieves html with top element having an id like what-#
- ajaxUpdater: function( what, where ) { return this.ajaxAdder( what, where, true ); },
-
- // sends delete-what and id#
- ajaxDelete: function( what, id ) {
- var ajaxDel = new WPAjax( this.ajaxHandler, this.ajaxRespEl );
- if( ajaxDel.notInitialized() )
- return true;
- var tempObj = this;
- var action = 'delete-' + what;
- var actionId = action + '&id=' + id;
- var idName = what.replace('-as-spam','') + '-' + id;
- ajaxDel.addOnComplete( function(transport) {
- Element.update(ajaxDel.myResponseElement,'');
- tempObj.destore(actionId);
- if( tempObj.delComplete && typeof tempObj.delComplete == 'function' )
- tempObj.delComplete( what, id, transport );
- });
- ajaxDel.addOnWPError( function(transport) { tempObj.restore(actionId, true); });
- ajaxDel.options.parameters = $H(ajaxDel.options.parameters).merge({action: action, id: id}).merge(this.inputData.toQueryParams());
- ajaxDel.request(ajaxDel.url);
- this.store(actionId, idName);
- tempObj.removeListItem( idName );
- return false;
- },
-
- // Toggles class nomes
- // sends dim-what and id#
- ajaxDimmer: function( what, id, dimClass ) {
- ajaxDim = new WPAjax( this.ajaxHandler, this.ajaxRespEl );
- if ( ajaxDim.notInitialized() )
- return true;
- var tempObj = this;
- var action = 'dim-' + what;
- var actionId = action + '&id=' + id;
- var idName = what + '-' + id;
- ajaxDim.addOnComplete( function(transport) {
- Element.update(ajaxDim.myResponseElement,'');
- tempObj.destore(actionId);
- if ( tempObj.dimComplete && typeof tempObj.dimComplete == 'function' )
- tempObj.dimComplete( what, id, dimClass, transport );
- });
- ajaxDim.addOnWPError( function(transport) { tempObj.restore(actionId, true); });
- ajaxDim.options.parameters = $H(ajaxDim.options.parameters).merge({action: action, id: id}).merge(this.inputData.toQueryParams());
- ajaxDim.request(ajaxDim.url);
- this.store(actionId, idName);
- this.dimItem( idName, dimClass );
- return false;
- },
-
- addListItem: function( h ) {
- new Insertion[this.topAdder ? 'Top' : 'Bottom'](this.theList,h);
- Element.cleanWhitespace(this.theList);
- var id = this.topAdder ? this.theList.firstChild.id : this.theList.lastChild.id;
- if ( this.alt )
- if ( ( this.theList.childNodes.length + this.altOffset ) % 2 )
- Element.addClassName($(id),this.alt);
- Fat.fade_element(id);
- },
-
- // only hides the element sa it can be put back again if necessary
- removeListItem: function( id, noFade ) {
- id = $(id);
- if ( !noFade ) {
- Fat.fade_element(id.id,null,700,'#FF3333');
- var tempObj = this;
- var func = function() { id.hide(); tempObj.recolorList(); }
- setTimeout(func, 705);
- } else {
- id.hide();
- this.recolorList();
- }
- },
-
- replaceListItem: function( id, h, update ) {
- id = $(id);
- if ( !update ) {
- Element.remove(id);
- this.addListItem( h );
- return;
- }
- id.replace(h);
- Fat.fade_element(id.id);
- },
-
- // toggles class
- dimItem: function( id, dimClass, noFade ) {
- id = $(id);
- if ( Element.hasClassName(id,dimClass) ) {
- if ( !noFade )
- Fat.fade_element(id.id,null,700,null);
- Element.removeClassName(id,dimClass);
- } else {
- if ( !noFade )
- Fat.fade_element(id.id,null,700,'#FF3333');
- Element.addClassName(id,dimClass);
- }
- },
-
- // store an element in case we need it later
- store: function(action, id) {
- if ( !this.dataStore )
- this.dataStore = $H();
- this.dataStore[action] = $(id).cloneNode(true);
- },
-
- // delete from store
- destore: function(action) { delete(this.dataStore[action]); },
-
- // restore element from store into existing (possibly hidden) element of same id
- restore: function(action, error) {
- var id = this.dataStore[action].id;
- this.theList.replaceChild(this.dataStore[action], $(id));
- delete(this.dataStore[action]);
- if ( error ) {
- func = function() { Element.setStyle($(id),{backgroundColor:'#FF3333'}); }
- func(); setTimeout(func, 705); // Hit it twice in case it's still fading.
- }
- },
-
- // Like Form.serialize, but excludes action and sets up clearInputs
- grabInputs: function( where, ajaxObj ) {
- if ( ajaxObj )
- ajaxObj.restoreInputs = [];
- var elements = Form.getElements($(where));
- var queryComponents = new Array();
- for (var i = 0; i < elements.length; i++) {
- if ( 'action' == elements[i].name )
- continue;
- if ( 'hidden' != elements[i].type && 'submit' != elements[i].type && 'button' != elements[i].type ) {
- this.clearInputs.push(elements[i]);
- if ( ajaxObj )
- ajaxObj.restoreInputs.push([elements[i], elements[i].value]);
- }
- var queryComponent = Form.Element.serialize(elements[i]);
- if (queryComponent) {
- queryComponents.push(queryComponent);
- }
- }
- return queryComponents.join('&');
- },
-
- // form.reset() can only do whole forms. This can do subsections.
- clear: function() {
- this.clearInputs.each( function(i) {
- i = $(i);
- if ( 'textarea' == i.tagName.toLowerCase() )
- i.value = '';
- else
- switch ( i.type.toLowerCase() ) {
- case 'password': case 'text':
- i.value = '';
- break;
- case 'checkbox': case 'radio':
- i.checked = false;
- break;
- case 'select': case 'select-one':
- i.selectedIndex = null;
- break;
- case 'select-multiple':
- for (var o = 0; o < i.length; o++) i.options[o].selected = false;
- break;
- }
- });
- this.clearInputs = [];
- },
-
- restoreForm: function(elements) {
- elements.each( function(i) {
- i[0].value = i[1];
- });
- },
-
- recolorList: function() {
- if ( !this.alt )
- return;
- var alt = this.alt;
- var offset = this.altOffset;
- var listItems = $A(this.theList.childNodes).findAll( function(i) { return Element.visible(i) } );
- listItems.each( function(i,n) {
- if ( ( n + offset ) % 2 )
- Element.removeClassName(i,alt);
- else
- Element.addClassName(i,alt);
- });
- }
-});
-
-//No submit unless code returns true.
-function killSubmit ( code, e ) {
- e = e ? e : window.event;
- if ( !e ) return;
- var t = e.target ? e.target : e.srcElement;
- if ( ( 'text' == t.type && e.keyCode == 13 ) || ( 'submit' == t.type && 'click' == e.type ) ) {
- if ( ( 'string' == typeof code && !eval(code) ) || ( 'function' == typeof code && !code() ) ) {
- e.returnValue = false; e.cancelBubble = true; return false;
- }
- }
-}
-//Generic but lame JS closure
-function encloseFunc(f){var a=arguments[1];return function(){return f(a);}}
diff --git a/wp-includes/js/swfupload/handlers.js b/wp-includes/js/swfupload/handlers.js
new file mode 100644
index 0000000..c53edf1
--- /dev/null
+++ b/wp-includes/js/swfupload/handlers.js
@@ -0,0 +1,227 @@
+function uploadLoaded() {
+ jQuery("#html-upload-ui").remove();
+ jQuery("#flash-upload-ui").show();
+}
+
+function fileDialogStart() {
+ jQuery("#media-upload-error").empty();
+}
+
+// progress and success handlers for media multi uploads
+function fileQueued(fileObj) {
+ // Get rid of unused form
+ jQuery('.media-blank').remove();
+ // Collapse a single item
+ if ( jQuery('.type-form #media-items>*').length == 1 && jQuery('#media-items .hidden').length > 0 ) {
+ jQuery('.toggle').toggle();
+ jQuery('.slidetoggle').slideUp(200).siblings().removeClass('hidden');
+ }
+ // Create a progress bar containing the filename
+ jQuery('#media-items').append('
' + fileObj.name + '
');
+
+ // Disable the submit button
+ jQuery('#insert-gallery').attr('disabled', 'disabled');
+}
+
+function uploadStart(fileObj) { return true; }
+
+function uploadProgress(fileObj, bytesDone, bytesTotal) {
+ // Lengthen the progress bar
+ jQuery('#media-item-' + fileObj.id + ' .bar').width(620*bytesDone/bytesTotal);
+
+ if ( bytesDone== bytesTotal )
+ jQuery('#media-item-' + fileObj.id + ' .bar').html('' + swfuploadL10n.crunching + '');
+}
+
+function prepareMediaItem(fileObj, serverData) {
+ // Move the progress bar to 100%
+ jQuery('#media-item-' + fileObj.id + ' .bar').remove();
+
+ // Append the HTML returned by the server -- thumbnail and form inputs
+ jQuery('#media-item-' + fileObj.id).append(serverData);
+
+ // Clone the thumbnail as a "pinkynail" -- a tiny image to the left of the filename
+ jQuery('#media-item-' + fileObj.id + ' .thumbnail').clone().attr('className', 'pinkynail toggle').prependTo('#media-item-' + fileObj.id);
+
+ // Replace the original filename with the new (unique) one assigned during upload
+ jQuery('#media-item-' + fileObj.id + ' .filename.original').replaceWith(jQuery('#media-item-' + fileObj.id + ' .filename.new'));
+
+ // Bind toggle function to a new mask over the progress bar area
+ jQuery('#media-item-' + fileObj.id + ' .progress').clone().empty().addClass('clickmask').bind('click', function(){jQuery(this).siblings('.slidetoggle').slideToggle(150);jQuery(this).siblings('.toggle').toggle();}).appendTo('#media-item-' + fileObj.id);
+
+ // Also bind toggle to the links
+ jQuery('#media-item-' + fileObj.id + ' a.toggle').bind('click', function(){jQuery(this).siblings('.slidetoggle').slideToggle(150);jQuery(this).parent().eq(0).children('.toggle').toggle();jQuery(this).siblings('a.toggle').focus();return false;});
+
+ // Bind AJAX to the new Delete button
+ jQuery('#media-item-' + fileObj.id + ' a.delete').bind('click',function(){
+ // Tell the server to delete it. TODO: handle exceptions
+ jQuery.ajax({url:'admin-ajax.php',type:'post',success:deleteSuccess,error:deleteError,id:fileObj.id,data:{
+ id : this.id.replace(/[^0-9]/g,''),
+ action : 'delete-post',
+ _ajax_nonce : this.href.replace(/^.*wpnonce=/,'')}
+ });
+ return false;
+ });
+
+ // Open this item if it says to start open (e.g. to display an error)
+ jQuery('#media-item-' + fileObj.id + '.startopen')
+ .removeClass('startopen')
+ .slideToggle(500)
+ .parent().eq(0).children('.toggle').toggle();
+}
+
+function itemAjaxError(id, html) {
+ var error = jQuery('#media-item-error' + id);
+
+ error.html('
'+html+'
');
+ jQuery('#dismiss-'+id).click(function(){jQuery(this).parents('.file-error').slideUp(200, function(){jQuery(this).empty();})});
+}
+
+function deleteSuccess(data, textStatus) {
+ if ( data == '-1' )
+ return itemAjaxError(this.id, 'You do not have permission. Has your session expired?');
+ if ( data == '0' )
+ return itemAjaxError(this.id, 'Could not be deleted. Has it been deleted already?');
+
+ var item = jQuery('#media-item-' + this.id);
+
+ // Decrement the counters.
+ if ( type = jQuery('#type-of-' + this.id).val() )
+ jQuery('#' + type + '-counter').text(jQuery('#' + type + '-counter').text()-1);
+ if ( item.hasClass('child-of-'+post_id) )
+ jQuery('#attachments-count').text(jQuery('#attachments-count').text()-1);
+
+ if ( jQuery('.type-form #media-items>*').length == 1 && jQuery('#media-items .hidden').length > 0 ) {
+ jQuery('.toggle').toggle();
+ jQuery('.slidetoggle').slideUp(200).siblings().removeClass('hidden');
+ }
+
+ jQuery('#media-item-' + this.id + ' .filename:empty').remove();
+ jQuery('#media-item-' + this.id + ' .filename').append(' '+swfuploadL10n.deleted+'').siblings('a.toggle').remove();
+ jQuery('#media-item-' + this.id + ' .describe').slideUp(500, function(){jQuery(this).parents('.media-item').slideUp(1500,function(){jQuery(this).remove();updateMediaForm();})}).end.remove();
+
+ return;
+ // Vanish it.
+ item.slideToggle(300,function(){jQuery(this).remove();if(jQuery('.media-item').length==0)jQuery('.insert-gallery').hide();updateMediaForm();});
+}
+
+function deleteError(X, textStatus, errorThrown) {
+ // TODO
+}
+
+function updateMediaForm() {
+ // Just one file, no need for collapsible part
+ if ( jQuery('.type-form #media-items>*').length == 1 ) {
+ jQuery('#media-items .slidetoggle').slideDown(500).parent().eq(0).children('.toggle').toggle();
+ jQuery('.type-form .slidetoggle').siblings().addClass('hidden');
+ }
+
+ // Only show Save buttons when there is at least one file.
+ if ( jQuery('#media-items>*').not('.media-blank').length > 0 )
+ jQuery('.savebutton').show();
+ else
+ jQuery('.savebutton').hide();
+
+ // Only show Gallery button when there are at least two files.
+ if ( jQuery('#media-items>*').length > 1 )
+ jQuery('.insert-gallery').show();
+ else
+ jQuery('.insert-gallery').hide();
+}
+
+function uploadSuccess(fileObj, serverData) {
+ // if async-upload returned an error message, place it in the media item div and return
+ if ( serverData.match('media-upload-error') ) {
+ jQuery('#media-item-' + fileObj.id).html(serverData);
+ return;
+ }
+
+ prepareMediaItem(fileObj, serverData);
+ updateMediaForm();
+
+ // Increment the counter.
+ if ( jQuery('#media-item-' + fileObj.id).hasClass('child-of-' + post_id) )
+ jQuery('#attachments-count').text(1 * jQuery('#attachments-count').text() + 1);
+}
+
+function uploadComplete(fileObj) {
+ // If no more uploads queued, enable the submit button
+ if ( swfu.getStats().files_queued == 0 )
+ jQuery('#insert-gallery').attr('disabled', '');
+}
+
+
+// wp-specific error handlers
+
+// generic message
+function wpQueueError(message) {
+ jQuery('#media-upload-error').show().text(message);
+}
+
+// file-specific message
+function wpFileError(fileObj, message) {
+ jQuery('#media-item-' + fileObj.id + ' .filename').after('
'+message+'
').siblings('.toggle').remove();
+ jQuery('#dismiss-' + fileObj.id).click(function(){jQuery(this).parents('.media-item').slideUp(200, function(){jQuery(this).remove();})});
+}
+
+function fileQueueError(fileObj, error_code, message) {
+ // Handle this error separately because we don't want to create a FileProgress element for it.
+ if ( error_code == SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED ) {
+ wpQueueError(swfuploadL10n.queue_limit_exceeded);
+ }
+ else if ( error_code == SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT ) {
+ fileQueued(fileObj);
+ wpFileError(fileObj, swfuploadL10n.file_exceeds_size_limit);
+ }
+ else if ( error_code == SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE ) {
+ fileQueued(fileObj);
+ wpFileError(fileObj, swfuploadL10n.zero_byte_file);
+ }
+ else if ( error_code == SWFUpload.QUEUE_ERROR.INVALID_FILETYPE ) {
+ fileQueued(fileObj);
+ wpFileError(fileObj, swfuploadL10n.invalid_filetype);
+ }
+ else {
+ wpQueueError(swfuploadL10n.default_error);
+ }
+}
+
+function fileDialogComplete(num_files_queued) {
+ try {
+ if (num_files_queued > 0) {
+ this.startUpload();
+ }
+ } catch (ex) {
+ this.debug(ex);
+ }
+}
+
+function uploadError(fileObj, error_code, message) {
+ // first the file specific error
+ if ( error_code == SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL ) {
+ wpFileError(fileObj, swfuploadL10n.missing_upload_url);
+ }
+ else if ( error_code == SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED ) {
+ wpFileError(fileObj, swfuploadL10n.upload_limit_exceeded);
+ }
+ else {
+ wpFileError(fileObj, swfuploadL10n.default_error);
+ }
+
+ // now the general upload status
+ if ( error_code == SWFUpload.UPLOAD_ERROR.HTTP_ERROR ) {
+ wpQueueError(swfuploadL10n.http_error);
+ }
+ else if ( error_code == SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED ) {
+ wpQueueError(swfuploadL10n.upload_failed);
+ }
+ else if ( error_code == SWFUpload.UPLOAD_ERROR.IO_ERROR ) {
+ wpQueueError(swfuploadL10n.io_error);
+ }
+ else if ( error_code == SWFUpload.UPLOAD_ERROR.SECURITY_ERROR ) {
+ wpQueueError(swfuploadL10n.security_error);
+ }
+ else if ( error_code == SWFUpload.UPLOAD_ERROR.FILE_CANCELLED ) {
+ wpQueueError(swfuploadL10n.security_error);
+ }
+}
diff --git a/wp-includes/js/swfupload/plugins/swfupload.cookies.js b/wp-includes/js/swfupload/plugins/swfupload.cookies.js
new file mode 100644
index 0000000..4d41612
--- /dev/null
+++ b/wp-includes/js/swfupload/plugins/swfupload.cookies.js
@@ -0,0 +1,50 @@
+/*
+ Cookie Plug-in
+
+ This plug in automatically gets all the cookies for this site and adds them to the post_params.
+ Cookies are loaded only on initialization. The refreshCookies function can be called to update the post_params.
+ The cookies will override any other post params with the same name.
+*/
+
+var SWFUpload;
+if (typeof(SWFUpload) === "function") {
+ SWFUpload.prototype.initSettings = function (old_initSettings) {
+ return function (init_settings) {
+ if (typeof(old_initSettings) === "function") {
+ old_initSettings.call(this, init_settings);
+ }
+
+ this.refreshCookies(false); // The false parameter must be sent since SWFUpload has not initialzed at this point
+ };
+ }(SWFUpload.prototype.initSettings);
+
+ // refreshes the post_params and updates SWFUpload. The send_to_flash parameters is optional and defaults to True
+ SWFUpload.prototype.refreshCookies = function (send_to_flash) {
+ if (send_to_flash !== false) send_to_flash = true;
+
+ // Get the post_params object
+ var post_params = this.getSetting("post_params");
+
+ // Get the cookies
+ var i, cookie_array = document.cookie.split(';'), ca_length = cookie_array.length, c, eq_index, name, value;
+ for(i = 0; i < ca_length; i++) {
+ c = cookie_array[i];
+
+ // Left Trim spaces
+ while (c.charAt(0) == " ") {
+ c = c.substring(1, c.length);
+ }
+ eq_index = c.indexOf("=");
+ if (eq_index > 0) {
+ name = c.substring(0, eq_index);
+ value = c.substring(eq_index+1);
+ post_params[name] = value;
+ }
+ }
+
+ if (send_to_flash) {
+ this.setPostParams(post_params);
+ }
+ };
+
+}
diff --git a/wp-includes/js/swfupload/plugins/swfupload.documentready.js b/wp-includes/js/swfupload/plugins/swfupload.documentready.js
new file mode 100644
index 0000000..a95bac5
--- /dev/null
+++ b/wp-includes/js/swfupload/plugins/swfupload.documentready.js
@@ -0,0 +1,102 @@
+/*
+ DocumentReady Plug-in
+
+ This plugin loads SWFUpload as soon as the document is ready. You should not load SWFUpload inside window.onload using this plugin.
+ You can also chain other functions by calling SWFUpload.DocumentReady(your function).
+
+ Warning: Embedded Ads or other scripts that overwrite window.onload or use their own document ready functions may interfer with this plugin. You
+ should not set window.onload when using this plugin.
+
+ Usage Example:
+
+ var swfu = new SWFUpload(your settings object);
+ SWFUpload.DocumentReady(function () { alert('Document Ready!'; });
+
+*/
+
+var SWFUpload;
+if (typeof(SWFUpload) === "function") {
+ // Override iniSWFUpload so SWFUpload gets inited when the document is ready rather than immediately
+ SWFUpload.prototype.initSWFUpload = function (old_initSWFUpload) {
+ return function (init_settings) {
+ var self = this;
+ if (typeof(old_initSWFUpload) === "function") {
+ SWFUpload.DocumentReady(function () {
+ old_initSWFUpload.call(self, init_settings);
+ });
+ }
+ }
+
+ }(SWFUpload.prototype.initSWFUpload);
+
+
+ // The DocumentReady function adds the passed in function to
+ // the functions that will be executed when the document is ready/loaded
+ SWFUpload.DocumentReady = function (fn) {
+ // Add the function to the chain
+ SWFUpload.DocumentReady.InternalOnloadChain = function (previous_link_fn) {
+ return function () {
+ if (typeof(previous_link_fn) === "function") {
+ previous_link_fn();
+ }
+ fn();
+ };
+ }(SWFUpload.DocumentReady.InternalOnloadChain);
+ };
+ SWFUpload.DocumentReady.InternalOnloadChain = null;
+ SWFUpload.DocumentReady.Onload = function () {
+ // Execute the onload function chain
+ if (typeof(SWFUpload.DocumentReady.InternalOnloadChain) === "function") {
+ SWFUpload.DocumentReady.InternalOnloadChain();
+ }
+ };
+ SWFUpload.DocumentReady.SetupComplete = false;
+
+
+ /* ********************************************
+ This portion of the code gets executed as soon it is loaded.
+ It binds the proper event for executing JavaScript is
+ early as possible. This is a per browser function and so
+ some browser sniffing is used.
+
+ This solution still has the "exposed" issue (See the Global Delegation section at http://peter.michaux.ca/article/553 )
+
+ Base solution from http://dean.edwards.name/weblog/2006/06/again/ and http://dean.edwards.name/weblog/2005/09/busted/
+ ******************************************** */
+ if (!SWFUpload.DocumentReady.SetupComplete) {
+ // for Internet Explorer (using conditional comments)
+ /*@cc_on @*/
+ /*@if (@_win32)
+ document.write("
+
+
+
+
+