| Server IP : 133.18.244.157 / Your IP : 216.73.217.20 Web Server : Apache System : Linux o4022v-135.kagoya.net 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : main2 ( 81069) PHP Version : 5.6.34 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /install/page/ |
Upload File : |
' If ! $incLibraryComment
' $incLibraryComment = 1
''
''<!------------------------------------------------------------------
'' コメント書き込み操作部
'' 構文:Call commentAdd <アプリ名> <コメント入力欄の名前> <submitボタンの名前>
''------------------------------------------------------------------->
' Sub commentAdd $argApp $argCommentAreaName $argSubmitName
<div>
' Call formText $argCommentAreaName "" 80 3
</div>
<div class="submit">
' Call cmButton "書き込む" "onCommentAdd(this.form);" "" "" $argSubmitName
</div>
<script>
function onCommentAdd( form )
{
var commentArea = $('textarea[name=$argCommentAreaName]');
var comment = commentArea.val();
if( comment == '' )
{
alert('コメントが入力されていません');
return false;
}
postComment(form, '$Server?page=AjaxCommentAdd&app=$argApp',{"$argCommentAreaName":comment},
function(){
if (form.elements.Refresh) {
form.elements.Refresh.value = '1';
}
commentArea.val('');
commentArea.focus();
});
}
function postComment(form, url, data, onComplete)
{
var args = $(form).serialize().replace(/&$argCommentAreaName=.*&?/,'');
var submitButton = $('input[name=$argSubmitName]');
$.ajax({
type: 'POST',
url: url + '&' + args,
data: data,
dataType: 'html',
beforeSend: function( xhr )
{
$('.submit').append('<img id="spinner" src="$IMG_PATH/spinner.gif">');
submitButton.attr('disable','disabled');
},
success: function( responseText, textStatus, xhr )
{
if( mw.isErrorResponse( xhr ) )
{
mw.showErrorResponse(xhr);
return;
}
if( responseText )
{
$("#comment-view table").remove();
$("#comment-view").append( responseText );
if (onComplete) onComplete();
}
},
error: function( responseText, textStatus, xhr )
{
mw.showErrorResponse(xhr);
},
complete: function( xhr, textStatus )
{
$('#spinner').remove();
submitButton.removeAttr('disable');
},
cache: false
});
}
</script>
' EndSub
''
''<!------------------------------------------------------------------
'' コメントの表示
'' 構文:Call commentView <アプリ識別子>
''------------------------------------------------------------------->
' Sub commentView $argApp
<div id="comment-view">
' Call commentInner $argApp
</div>
' EndSub
''
''<!------------------------------------------------------------------
'' コメントの表示
'' 構文:Call commentInner <コメントオブジェクト> <削除リンクを出すなら1> <削除URL>
''------------------------------------------------------------------->
' Sub commentInner $argApp
' If $argApp = "Mail"
' If $Type = "Received"
' var Set $obj = $Command.Mail.GetReceivedMailData $BS $MID $DBID
' Else
' var Set $obj = $Command.Mail.GetSentMailData $BS $MID $DBID
' EndIf
' If ( ! $obj.DeleteTime ) and ( ! $VID )
' var $ShowDeleteLink = 1
' Else
' var $ShowDeleteLink = 0
' EndIf
' $System.SetParameter DeleteURL "$Server?page=MailCommentDelete&wid=$WID&bs=$BS&mid=$MID&dbid=$DBID&type=$Type&bpt=$BPT"
' ElIf $argApp = "Post"
' var Set $obj = $Post.Cards.$PCID
' If ! $VID
' var $ShowDeleteLink = 1
' Else
' var $ShowDeleteLink = 0
' EndIf
' $System.SetParameter DeleteURL "$Server?page=PostCommentDelete&wid=$WID&pcid=$PCID&bpt=$BPT&tab=$Tab"
' ElIf $argApp = "Form"
' Set $obj = $Command.Form.GetFormData $BS $RID $DBID
' If ! $VID
' $ShowDeleteLink = 1
' Else
' $ShowDeleteLink = 0
' EndIf
' $System.SetParameter DeleteURL "$Server?page=FormCommentDelete&wid=$WID&bs=$BS&rid=$RID&dbid=$DBID&bpt=$BPT"
' EndIf
' var Set $Comments = $obj.Comments
' If ! $Comments.Count
' Exit
' EndIf
<table class="commentTable">\\
' var $RowNum = 0
' For Each $Comment in $Comments
' Inc $RowNum
' var $Remainder = $Command.Math.Modulus $RowNum 2
' If $Remainder = 0
' var $RowClass = "oddRow"
' Else
' var $RowClass = "evenRow"
' EndIf
' var $UID = $Comment.UID
' var $UserName = $Users.$UID.Name
' Init $UserName = $Comment.UserName
' var $t = $Comment.TimeStamp
<tr class="commentTR $RowClass">\\
<td class="commentUserName" width="1%" nowrap>$UserName</td>\\
<td class="commentBody">\\
' View $Comment.Data 1
</td>
<td class="commentTS" width="1%" align="right" nowrap>($t.Year/$t.Month00/$t.Day00 $t.Hour00:$t.Minute00)</td>\\
' If $ShowDeleteLink
<td class="commentDelete"width="1%" align="right" nowrap>\\
' If $Comment.UID = $Login.ID
' Call cmLink "" "trash20.png" "$DeleteURL&cmid=$Comment.ID"
' Else
<br>\\
' EndIf
</td>
' EndIf
</tr>
' Next
</table>
' EndSub
''
' EndIf