1 WCF
.Moderation
={};WCF
.Moderation
.Management
=Class
.extend({_buttonSelector
:"",_className
:"",_confirmationTemplate
:{},_languageItem
:"",_proxy
:null,_queueID
:0,_redirectURL
:"",init:function(a
,c
,b
){if(!this._buttonSelector
){console
.debug("[WCF.Moderation.Management] Missing button selector, aborting.");return}else{if(!this._className
){console
.debug("[WCF.Moderation.Management] Missing class name, aborting.");return}}this._queueID
=a
;this._redirectURL
=c
;this._languageItem
=b
;this._proxy
=new WCF
.Action
.Proxy({success
:$.proxy(this._success
,this)});$(this._buttonSelector
).click($.proxy(this._click
,this))},_click:function(c
){var b
=$(c
.currentTarget
).wcfIdentify();var a
="";if(this._confirmationTemplate
[b
]){a
=this._confirmationTemplate
[b
]}WCF
.System
.Confirmation
.show(WCF
.Language
.get(this._languageItem
.replace(/{actionName}/,b
)),$.proxy(function(e
){if(e
==="confirm"){var d
={actionName
:b
,className
:this._className
,objectIDs
:[this._queueID
]};if(this._confirmationTemplate
[b
]){d
.parameters
={};a
.find("input, textarea").each(function(g
,i
){var f
=$(i
);var h
=f
.val();if(f
.getTagName()==="input"&&f
.attr("type")==="checkbox"){if(!f
.is(":checked")){h
=null}}if(h
!==null){d
.parameters
[f
.attr("name")]=h
}})}this._proxy
.setOption("data",d
);this._proxy
.sendRequest();$(this._buttonSelector
).disable()}},this),{},a
)},_success:function(c
,e
,b
){var d
=new WCF
.System
.Notification(WCF
.Language
.get("wcf.global.success"));var a
=this;d
.show(function(){window
.location
=a
._redirectURL
})}});WCF
.Moderation
.Activation
={};WCF
.Moderation
.Activation
.Management
=WCF
.Moderation
.Management
.extend({init:function(a
,b
){this._buttonSelector
="#enableContent, #removeContent";this._className
="wcf\\data\\moderation\\queue\\ModerationQueueActivationAction";this._super(a
,b
,"wcf.moderation.activation.{actionName}.confirmMessage")}});WCF
.Moderation
.Report
={};WCF
.Moderation
.Report
.Content
=Class
.extend({_buttons
:{},_buttonSelector
:"",_dialog
:null,_notification
:null,_objectID
:0,_objectType
:"",_proxy
:null,init:function(a
,b
){this._objectType
=a
;this._buttonSelector
=b
;this._buttons
={};this._notification
=null;this._objectID
=0;this._proxy
=new WCF
.Action
.Proxy({success
:$.proxy(this._success
,this)});this._initButtons();WCF
.DOMNodeInsertedHandler
.addCallback("WCF.Moderation.Report"+this._objectType
.hashCode(),$.proxy(this._initButtons
,this))},_initButtons:function(){var a
=this;$(this._buttonSelector
).each(function(c
,d
){var e
=$(d
);var b
=e
.wcfIdentify();if(!a
._buttons
[b
]){a
._buttons
[b
]=e
;e
.click($.proxy(a
._click
,a
))}})},_click:function(a
){this._objectID
=$(a
.currentTarget
).data("objectID");this._proxy
.setOption("data",{actionName
:"prepareReport",className
:"wcf\\data\\moderation\\queue\\ModerationQueueReportAction",parameters
:{objectID
:this._objectID
,objectType
:this._objectType
}});this._proxy
.sendRequest()},_success:function(b
,c
,a
){if(b
.returnValues
.reported
){if(this._notification
===null){this._notification
=new WCF
.System
.Notification(WCF
.Language
.get("wcf.moderation.report.success"))}this._dialog
.wcfDialog("close");this._notification
.show()}else{if(b
.returnValues
.template
){this._showDialog(b
.returnValues
.template
);if(!b
.returnValues
.alreadyReported
){this._dialog
.find(".jsSubmitReport").click($.proxy(this._submit
,this))}}}},_showDialog:function(a
){if(this._dialog
===null){this._dialog
=$("#moderationReport");if(!this._dialog
.length
){this._dialog
=$('<div id="moderationReport" />').hide().appendTo(document
.body
)}}this._dialog
.html(a
).wcfDialog({title
:WCF
.Language
.get("wcf.moderation.report.reportContent")}).wcfDialog("render")},_submit:function(){var a
=this._dialog
.find(".jsReportMessage").val();if(a
==""){this._dialog
.find("fieldset > dl").addClass("formError");if(!this._dialog
.find(".innerError").length
){this._dialog
.find(".jsReportMessage").after($('<small class="innerError">'+WCF
.Language
.get("wcf.global.form.error.empty")+"</small>"))}return}this._proxy
.setOption("data",{actionName
:"report",className
:"wcf\\data\\moderation\\queue\\ModerationQueueReportAction",parameters
:{message
:a
,objectID
:this._objectID
,objectType
:this._objectType
}});this._proxy
.sendRequest()}});WCF
.Moderation
.Report
.Management
=WCF
.Moderation
.Management
.extend({init:function(a
,b
){this._buttonSelector
="#removeContent, #removeReport";this._className
="wcf\\data\\moderation\\queue\\ModerationQueueReportAction";this._super(a
,b
,"wcf.moderation.report.{actionName}.confirmMessage");this._confirmationTemplate
.removeContent
=$('<fieldset><dl><dt><label for="message">'+WCF
.Language
.get("wcf.moderation.report.removeContent.reason")+'</label></dt><dd><textarea name="message" id="message" cols="40" rows="3" /></dd></dl></fieldset>')}});WCF
.Moderation
.UserPanel
=WCF
.UserPanel
.extend({_showAllLink
:"",_deletedContentLink
:"",init:function(a
,b
){this._noItems
="wcf.moderation.noMoreItems";this._showAllLink
=a
;this._deletedContentLink
=b
;this._super("outstandingModeration")},_addDefaultItems:function(a
){this._addDivider(a
);$('<li><a href="'+this._showAllLink
+'">'+WCF
.Language
.get("wcf.moderation.showAll")+"</a></li>").appendTo(a
);this._addDivider(a
);$('<li><a href="'+this._deletedContentLink
+'">'+WCF
.Language
.get("wcf.moderation.showDeletedContent")+"</a></li>").appendTo(a
)},_getParameters:function(){return{actionName
:"getOutstandingQueues",className
:"wcf\\data\\moderation\\queue\\ModerationQueueAction"}}});