From f2103496db5ef1f504abcc931b33b2a87ebac622 Mon Sep 17 00:00:00 2001 From: joyqi Date: Wed, 16 Oct 2013 16:18:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=84=E8=AE=BA=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/javascript/jquery-ui.js | 1536 +++++++++++++++------------------ admin/manage-comments.php | 73 +- 2 files changed, 775 insertions(+), 834 deletions(-) mode change 100644 => 100755 admin/javascript/jquery-ui.js diff --git a/admin/javascript/jquery-ui.js b/admin/javascript/jquery-ui.js old mode 100644 new mode 100755 index 270e347d..9a94562f --- a/admin/javascript/jquery-ui.js +++ b/admin/javascript/jquery-ui.js @@ -1,6 +1,6 @@ -/*! jQuery UI - v1.10.3 - 2013-10-15 +/*! jQuery UI - v1.10.3 - 2013-10-16 * http://jqueryui.com -* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.spinner.js, jquery.ui.effect.js, jquery.ui.effect-bounce.js, jquery.ui.effect-highlight.js, jquery.ui.effect-shake.js, jquery.ui.effect-transfer.js +* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.datepicker.js, jquery.ui.slider.js, jquery.ui.effect.js, jquery.ui.effect-bounce.js, jquery.ui.effect-highlight.js, jquery.ui.effect-shake.js * Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ (function( $, undefined ) { @@ -826,409 +826,160 @@ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { })( jQuery ); (function( $, undefined ) { -var lastActive, startXPos, startYPos, clickDragged, - baseClasses = "ui-button ui-widget ui-state-default ui-corner-all", - stateClasses = "ui-state-hover ui-state-active ", - typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only", - formResetHandler = function() { - var form = $( this ); - setTimeout(function() { - form.find( ":ui-button" ).button( "refresh" ); - }, 1 ); - }, - radioGroup = function( radio ) { - var name = radio.name, - form = radio.form, - radios = $( [] ); - if ( name ) { - name = name.replace( /'/g, "\\'" ); - if ( form ) { - radios = $( form ).find( "[name='" + name + "']" ); - } else { - radios = $( "[name='" + name + "']", radio.ownerDocument ) - .filter(function() { - return !this.form; - }); - } - } - return radios; - }; +var mouseHandled = false; +$( document ).mouseup( function() { + mouseHandled = false; +}); -$.widget( "ui.button", { +$.widget("ui.mouse", { version: "1.10.3", - defaultElement: "

' @@ -239,7 +245,10 @@ $(document).ready(function () { $('textarea', form).focus(); form.submit(function () { - var t = $(this); + var t = $(this), tr = t.parents('tr'); + + $.post + return false; }); } @@ -248,22 +257,24 @@ $(document).ready(function () { }); $('.operate-edit').click(function () { - var tr = $(this).parents('tr'), id = tr.attr('id'), comment = tr.data('comment'); + var tr = $(this).parents('tr'), t = $(this), id = tr.attr('id'), comment = tr.data('comment'); tr.hide(); var edit = $(' ' - + '' + + '' + '

' + '

' + '

' + '

' - + '

' - + '

' + + '

' + + '

' + '

' + '

' - + '

') - .data('id', id).insertAfter(tr); + + '

') + .data('id', id).data('comment', comment).insertAfter(tr); $('input[name=author]', edit).val(comment.author); $('input[name=mail]', edit).val(comment.mail); @@ -273,11 +284,45 @@ $(document).ready(function () { $('.cancel', edit).click(function () { var tr = $(this).parents('tr'); - $('#' + tr.data('id')).show().effect('highlight', '#AACB36'); + $('#' + tr.data('id')).show(); tr.remove(); }); - $('form', edit + $('form', edit).submit(function () { + var t = $(this), tr = t.parents('tr'), + oldTr = $('#' + tr.data('id')), + comment = oldTr.data('comment'); + + $('form', tr).each(function () { + var items = $(this).serializeArray(); + + for (var i = 0; i < items.length; i ++) { + var item = items[i]; + comment[item.name] = item.value; + } + }); + + var html = '' + + (comment.url ? '' + + comment.author + '' : comment.author) + '' + + ('comment' != comment.type ? '' : '') + + (comment.mail ? '
' + + comment.mail + '' : '') + + (comment.ip ? '
' + comment.ip + '' : ''); + + $('.comment-meta', oldTr).html(html); + $('.comment-content', oldTr).html('

' + comment.text + '

'); + oldTr.data('comment', comment); + + $.post(t.attr('action'), comment, function (o) { + $('.comment-content', oldTr).html(o.comment.content); + }); + + oldTr.show().effect('highlight', '#AACB36'); + tr.remove(); + + return false; + }); return false; });