Updating minified JavaScript files
authorroot <root@debian>
Mon, 7 Dec 2015 13:34:38 +0000 (14:34 +0100)
committerroot <root@debian>
Mon, 7 Dec 2015 13:34:38 +0000 (14:34 +0100)
15 files changed:
wcfsetup/install/files/js/WCF.ACL.min.js [new file with mode: 0644]
wcfsetup/install/files/js/WCF.Attachment.min.js [new file with mode: 0644]
wcfsetup/install/files/js/WCF.ColorPicker.min.js [new file with mode: 0644]
wcfsetup/install/files/js/WCF.Comment.min.js [new file with mode: 0644]
wcfsetup/install/files/js/WCF.ImageViewer.min.js [new file with mode: 0644]
wcfsetup/install/files/js/WCF.Label.min.js [new file with mode: 0644]
wcfsetup/install/files/js/WCF.Like.min.js [new file with mode: 0644]
wcfsetup/install/files/js/WCF.Location.min.js [new file with mode: 0644]
wcfsetup/install/files/js/WCF.Message.min.js [new file with mode: 0644]
wcfsetup/install/files/js/WCF.Moderation.min.js [new file with mode: 0644]
wcfsetup/install/files/js/WCF.Poll.min.js [new file with mode: 0644]
wcfsetup/install/files/js/WCF.Search.Message.min.js [new file with mode: 0644]
wcfsetup/install/files/js/WCF.Tagging.min.js [new file with mode: 0644]
wcfsetup/install/files/js/WCF.User.min.js [new file with mode: 0644]
wcfsetup/install/files/js/WCF.min.js [new file with mode: 0644]

diff --git a/wcfsetup/install/files/js/WCF.ACL.min.js b/wcfsetup/install/files/js/WCF.ACL.min.js
new file mode 100644 (file)
index 0000000..ac093ca
--- /dev/null
@@ -0,0 +1 @@
+WCF.ACL={},WCF.ACL.List=Class.extend({_categoryName:"",_container:null,_containerElements:{},_objectID:0,_objectTypeID:null,_options:{},_proxy:null,_search:null,_values:{group:{},user:{}},init:function(e,t,n,a,i,s){this._objectID=a||0,this._objectTypeID=t,this._categoryName=n,void 0===i&&(i=!0),this._values={group:{},user:{}},this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1,success:$.proxy(this._success,this)}),this._container=$(e).hide().addClass("aclContainer");var r=this._container.children("dd"),c=$('<ul class="aclList container" />').appendTo(r),l=$('<input type="text" class="long" placeholder="'+WCF.Language.get("wcf.acl.search."+(i?"":"user.")+"description")+'" />').appendTo(r),o=$('<ul class="aclPermissionList container" />').hide().appendTo(r);this._containerElements={aclList:c,denyAll:null,grantAll:null,permissionList:o,searchInput:l},this._search=new WCF.Search.User(l,$.proxy(this.addObject,this),i);var p=this._container.parents("form:eq(0)");p.submit($.proxy(this.submit,this));var h=p.find("input[type=reset]:eq(0)");h.length&&h.click($.proxy(this._reset,this)),s?this._success(s):this._loadACL()},_reset:function(){this._values={group:{},user:{}},this._containerElements.aclList.empty(),this._containerElements.searchInput.val(""),this._containerElements.permissionList.hide().find("input[type=checkbox]").prop("checked",!1)},_loadACL:function(){this._proxy.setOption("data",{actionName:"loadAll",className:"wcf\\data\\acl\\option\\ACLOptionAction",parameters:{categoryName:this._categoryName,objectID:this._objectID,objectTypeID:this._objectTypeID}}),this._proxy.sendRequest()},addObject:function(e){var t=this._createListItem(e.objectID,e.label,e.type);this._savePermissions(),this._containerElements.aclList.children("li").removeClass("active"),t.addClass("active"),this._search.addExcludedSearchValue(e.label),this._containerElements.permissionList.find("input[type=checkbox]").prop("checked",!1),this._containerElements.searchInput.val(""),this._containerElements.permissionList.show(),WCF.DOMNodeInsertedHandler.execute()},_createListItem:function(e,t,n){var a=$('<li><span class="icon icon16 icon-'+("group"===n?"group":"user")+'" /> <span>'+t+"</span></li>").appendTo(this._containerElements.aclList);return a.data("objectID",e).data("type",n).data("label",t).click($.proxy(this._click,this)),$('<span class="icon icon16 icon-remove jsTooltip pointer" title="'+WCF.Language.get("wcf.global.button.delete")+'" />').click($.proxy(this._removeItem,this)).appendTo(a),a},_removeItem:function(e){var t=$(e.currentTarget).parent(),n=t.data("type"),a=t.data("objectID");this._search.removeExcludedSearchValue(t.data("label")),t.remove(),this._values[n][a]&&delete this._values[n][a],this._selectFirstEntry()},_selectFirstEntry:function(){var e=this._containerElements.aclList.children("li:eq(0)");e.length?this._select(e,!1):this._reset()},_success:function(e){if($.getLength(e.returnValues.options)){var t=0,n={};for(var a in e.returnValues.options){var i=e.returnValues.options[a],s=$("<li><span>"+i.label+"</span></li>").data("optionID",a).data("optionName",i.optionName),r=$('<input type="checkbox" id="grant'+a+'" />').appendTo(s).wrap('<label for="grant'+a+'" class="jsTooltip" title="'+WCF.Language.get("wcf.acl.option.grant")+'" />'),c=$('<input type="checkbox" id="deny'+a+'" />').appendTo(s).wrap('<label for="deny'+a+'" class="jsTooltip" title="'+WCF.Language.get("wcf.acl.option.deny")+'" />');r.data("type","grant").data("optionID",a).change($.proxy(this._change,this)),c.data("type","deny").data("optionID",a).change($.proxy(this._change,this)),n[i.categoryName]||(n[i.categoryName]=[]),""===i.categoryName?s.appendTo(this._containerElements.permissionList):n[i.categoryName].push(s),t++}if(t>1){var s=$('<li class="aclFullAccess"><span>'+WCF.Language.get("wcf.acl.option.fullAccess")+"</span></li>").prependTo(this._containerElements.permissionList);this._containerElements.grantAll=$('<input type="checkbox" id="grantAll" />').appendTo(s).wrap('<label class="jsTooltip" title="'+WCF.Language.get("wcf.acl.option.grant")+'" />'),this._containerElements.denyAll=$('<input type="checkbox" id="denyAll" />').appendTo(s).wrap('<label class="jsTooltip" title="'+WCF.Language.get("wcf.acl.option.deny")+'" />'),this._containerElements.grantAll.data("type","grant").change($.proxy(this._changeAll,this)),this._containerElements.denyAll.data("type","deny").change($.proxy(this._changeAll,this))}if($.getLength(n))for(var l in n){var o=n[l];e.returnValues.categories[l]&&$('<li class="aclCategory">'+e.returnValues.categories[l]+"</li>").appendTo(this._containerElements.permissionList);for(var p=0,h=o.length;h>p;p++)o[p].appendTo(this._containerElements.permissionList)}this._parseData(e,"group"),this._parseData(e,"user"),this._container.show(),this._selectFirstEntry()}},_parseData:function(e,t){if($.getLength(e.returnValues[t].option)){for(var n in e.returnValues[t].label)this._createListItem(n,e.returnValues[t].label[n],t),this._search.addExcludedSearchValue(e.returnValues[t].label[n]);this._values[t]=e.returnValues[t].option,WCF.DOMNodeInsertedHandler.execute()}},_click:function(e){var t=$(e.currentTarget);t.hasClass("active")||this._select(t,!0)},_select:function(e,t){t&&this._savePermissions(),this._containerElements.aclList.children("li").removeClass("active"),e.addClass("active"),this._setupPermissions(e.data("type"),e.data("objectID"))},_change:function(e){var t=$(e.currentTarget),n=t.data("optionID"),a=t.data("type");t.is(":checked")?"deny"===a?($("#grant"+n).prop("checked",!1),null!==this._containerElements.grantAll&&this._containerElements.grantAll.prop("checked",!1)):($("#deny"+n).prop("checked",!1),null!==this._containerElements.denyAll&&this._containerElements.denyAll.prop("checked",!1)):"deny"===a&&null!==this._containerElements.denyAll?this._containerElements.denyAll.prop("checked",!1):"grant"===a&&null!==this._containerElements.grantAll&&this._containerElements.grantAll.prop("checked",!1);var i=!0;this._containerElements.permissionList.find("input[type=checkbox]").each(function(e,t){var n=$(t);return n.data("type")!==a||n.attr("id")===a+"All"||n.is(":checked")?void 0:(i=!1,!1)}),"deny"==a?null!==this._containerElements.denyAll&&(i?this._containerElements.denyAll.prop("checked",!0):this._containerElements.denyAll.prop("checked",!1)):null!==this._containerElements.grantAll&&(i?this._containerElements.grantAll.prop("checked",!0):this._containerElements.grantAll.prop("checked",!1))},_changeAll:function(e){var t=$(e.currentTarget),n=t.data("type");t.is(":checked")?"deny"===n?(this._containerElements.grantAll.prop("checked",!1),this._containerElements.permissionList.find("input[type=checkbox]").each(function(e,t){var n=$(t);"deny"===n.data("type")&&"denyAll"!==n.attr("id")&&n.prop("checked",!0).trigger("change")})):(this._containerElements.denyAll.prop("checked",!1),this._containerElements.permissionList.find("input[type=checkbox]").each(function(e,t){var n=$(t);"grant"===n.data("type")&&"grantAll"!==n.attr("id")&&n.prop("checked",!0).trigger("change")})):"deny"===n?(this._containerElements.grantAll.prop("checked",!1),this._containerElements.permissionList.find("input[type=checkbox]").each(function(e,t){var n=$(t);"deny"===n.data("type")&&"denyAll"!==n.attr("id")&&n.prop("checked",!1).trigger("change")})):(this._containerElements.denyAll.prop("checked",!1),this._containerElements.permissionList.find("input[type=checkbox]").each(function(e,t){var n=$(t);"grant"===n.data("type")&&"grantAll"!==n.attr("id")&&n.prop("checked",!1).trigger("change")}))},_setupPermissions:function(e,t){if(this._containerElements.permissionList.find("input[type='checkbox']").prop("checked",!1),this._values[e]&&this._values[e][t])for(var n in this._values[e][t])1==this._values[e][t][n]?$("#grant"+n).prop("checked",!0).trigger("change"):$("#deny"+n).prop("checked",!0).trigger("change");this._containerElements.permissionList.show()},_savePermissions:function(){var e=this._containerElements.aclList.find("li.active");if(e.length){var t=e.data("objectID"),n=e.data("type");this._values[n][t]={};var a=this;this._containerElements.permissionList.find("input[type='checkbox']").each(function(e,i){var s=$(i);if("grantAll"!=s.attr("id")&&"denyAll"!=s.attr("id")){var r="deny"===s.data("type")?0:1,c=s.data("optionID");s.is(":checked")?(a._values[n][t][c]=r,s.prop("checked",!1)):a._values[n]&&a._values[n][t]&&a._values[n][t][c]&&a._values[n][t][c]==r&&delete a._values[n][t][c]}})}},submit:function(){this._savePermissions(),this._save("group"),this._save("user")},_save:function(e){if($.getLength(this._values[e])){var t=this._container.parents("form:eq(0)");for(var n in this._values[e]){var a=this._values[e][n];for(var i in a)$('<input type="hidden" name="aclValues['+e+"]["+n+"]["+i+']" value="'+a[i]+'" />').appendTo(t)}}}});
\ No newline at end of file
diff --git a/wcfsetup/install/files/js/WCF.Attachment.min.js b/wcfsetup/install/files/js/WCF.Attachment.min.js
new file mode 100644 (file)
index 0000000..fa2ddc7
--- /dev/null
@@ -0,0 +1 @@
+WCF.Attachment={},WCF.Attachment.Upload=WCF.Upload.extend({_objectType:"",_objectID:0,_tmpHash:"",_parentObjectID:0,_wysiwygContainerID:"",init:function(e,t,a,i,n,r,s,l){this._super(e,t,"wcf\\data\\attachment\\AttachmentAction",{multiple:!0,maxUploads:s}),this._objectType=a,this._objectID=i,this._tmpHash=n,this._parentObjectID=r,this._wysiwygContainerID=l,this._buttonSelector.children("p.button").click($.proxy(this._validateLimit,this)),this._fileListSelector.find(".jsButtonInsertAttachment").click($.proxy(this._insert,this)),WCF.DOMNodeRemovedHandler.addCallback("WCF.Attachment.Upload",$.proxy(this._removeLimitError,this))},_validateLimit:function(){var e=this._buttonSelector.next("small.innerError"),t=this._options.maxUploads-this._fileListSelector.children("li:not(.uploadFailed)").length,a=this._fileUpload?this._fileUpload.prop("files").length:0;if(0>=t||a>t){var i=0>=t?WCF.Language.get("wcf.attachment.upload.error.reachedLimit"):WCF.Language.get("wcf.attachment.upload.error.reachedRemainingLimit").replace(/#remaining#/,t);return e.length||(e=$('<small class="innerError" />').insertAfter(this._buttonSelector)),e.html(i),!1}return e.remove(),!0},_removeLimitError:function(e){var t=$(e.target);t.is("li.box48")&&t.parent().wcfIdentify()===this._fileListSelector.wcfIdentify()&&this._buttonSelector.next("small.innerError").remove()},_upload:function(){this._validateLimit()&&this._super(),this._fileUpload&&(this._removeButton(),this._createButton())},_createUploadMatrix:function(e){return this._fileListSelector.children("li.uploadFailed").remove(),this._super(e)},_getParameters:function(){return{objectType:this._objectType,objectID:this._objectID,tmpHash:this._tmpHash,parentObjectID:this._parentObjectID}},_initFile:function(e){var t=$('<li class="box48"><span class="icon icon48 icon-spinner" /><div><div><p>'+e.name+'</p><small><progress max="100"></progress></small></div><ul></ul></div></li>').data("filename",e.name);return this._fileListSelector.append(t),this._fileListSelector.show(),this._buttonSelector.data("maxSize")<e.size&&(t.find("progress").remove(),t.children(".icon-spinner").removeClass("icon-spinner").addClass("icon-ban-circle"),t.find("div > div").append($('<small class="innerError">'+WCF.Language.get("wcf.attachment.upload.error.tooLarge")+"</small>")),t.addClass("uploadFailed")),t},_success:function(e,t){for(var a in this._uploadMatrix[e]){var i=this._uploadMatrix[e][a];i.find("progress").remove();var n=i.data("filename"),r=i.data("internalFileID");if(t.returnValues&&t.returnValues.attachments[r]){t.returnValues.attachments[r].tinyURL?i.children(".icon-spinner").replaceWith($('<img src="'+t.returnValues.attachments[r].tinyURL+'" alt="" class="attachmentTinyThumbnail" />')):i.children(".icon-spinner").removeClass("icon-spinner").addClass("icon-paper-clip");var s=$('<a href=""></a>');s.text(n).attr("href",t.returnValues.attachments[r].url),0!=t.returnValues.attachments[r].isImage&&s.addClass("jsImageViewer").attr("title",n),i.find("p").empty().append(s),i.find("small").append(t.returnValues.attachments[r].formattedFilesize);var l=$('<li><span class="icon icon16 icon-remove pointer jsTooltip jsDeleteButton" title="'+WCF.Language.get("wcf.global.button.delete")+'" data-object-id="'+t.returnValues.attachments[r].attachmentID+'" data-confirm-message="'+WCF.Language.get("wcf.attachment.delete.sure")+'" /></li>');if(i.find("ul").append(l),this._wysiwygContainerID){var o=$('<li><span class="icon icon16 icon-paste pointer jsTooltip jsButtonInsertAttachment" title="'+WCF.Language.get("wcf.attachment.insert")+'" data-object-id="'+t.returnValues.attachments[r].attachmentID+'" /></li>');o.children(".jsButtonInsertAttachment").click($.proxy(this._insert,this)),i.find("ul").append(o)}}else{i.children(".icon-spinner").removeClass("icon-spinner").addClass("icon-ban-circle");var c="";c=t.returnValues&&t.returnValues.errors[r]?t.returnValues.errors[r].errorType:"uploadFailed",i.find("div > div").append($('<small class="innerError">'+WCF.Language.get("wcf.attachment.upload.error."+c)+"</small>")),i.addClass("uploadFailed")}i.css("display","block")}WCF.DOMNodeInsertedHandler.execute()},_insert:function(e){var t=$(e.currentTarget).data("objectID"),a="[attach="+t+"][/attach]",i=$.browser.mobile?null:$("#"+this._wysiwygContainerID).ckeditorGet();if(null!==i&&"wysiwyg"===i.mode)i.insertText(a);else{var n=$.browser.mobile?$("#"+this._wysiwygContainerID):$("#"+this._wysiwygContainerID).next(".cke_editor_text").find("textarea"),r=n.val();if(0==r.length)n.val(a);else{var s=n.getCaret();n.val(r.substr(0,s)+a+r.substr(s))}}},_error:function(e){this._fileListSelector.find("li").each(function(t,a){var i=$(a);i.children(".icon-spinner").length&&(i.addClass("uploadFailed").children(".icon-spinner").removeClass("icon-spinner").addClass("icon-ban-circle"),i.find("div > div").append($('<small class="innerError">'+(e.responseJSON&&e.responseJSON.message?e.responseJSON.message:WCF.Language.get("wcf.attachment.upload.error.uploadFailed"))+"</small>")))})}});
\ No newline at end of file
diff --git a/wcfsetup/install/files/js/WCF.ColorPicker.min.js b/wcfsetup/install/files/js/WCF.ColorPicker.min.js
new file mode 100644 (file)
index 0000000..0dfedcd
--- /dev/null
@@ -0,0 +1 @@
+WCF.ColorPicker=Class.extend({_bar:null,_barActive:!1,_barSelector:null,_dialog:null,_didInit:!1,_elementID:"",_gradient:null,_gradientActive:!1,_gradientSelector:null,_hex:null,_hsv:{},_newColor:null,_oldColor:null,_rgba:{},_rgbaRegExp:null,init:function(t){this._elementID="",this._hsv={h:0,s:100,v:100},this._position={};var a=$(t);return a.length?void a.click($.proxy(this._open,this)):void console.debug("[WCF.ColorPicker] Selector does not match any element, aborting.")},_open:function(t){this._didInit||(this._initColorPicker(),this._didInit=!0);var a=$(t.currentTarget);this._elementID=a.wcfIdentify(),this._parseColor(a);var i=this.hsvToRgb(this._hsv.h,this._hsv.s,this._hsv.v);this._oldColor.css({backgroundColor:"rgb("+i.r+", "+i.g+", "+i.b+")"}),this._dialog.wcfDialog({title:WCF.Language.get("wcf.style.colorPicker")})},_parseColor:function(t){if(t.data("hsv")&&t.data("rgb")){var a=t.data("hsv");for(var i in a)this._hsv[i]=a[i];this._updateValues(t.data("rgb"),!0,!0),this._rgba.a.val(parseInt(t.data("alpha")))}else{null===this._rgbaRegExp&&(this._rgbaRegExp=new RegExp("^rgba\\((\\d{1,3}), ?(\\d{1,3}), ?(\\d{1,3}), ?(1|1\\.00?|0|0?\\.[0-9]{1,2})\\)$")),this._rgbaRegExp.exec(t.data("color"));var s=RegExp.$4;0===s.indexOf(".")&&(s="0"+s),s*=100,this._updateValues({r:RegExp.$1,g:RegExp.$2,b:RegExp.$3,a:Math.round(s)},!0,!0)}},_initColorPicker:function(){this._dialog=$('<div id="colorPickerContainer" />').hide().appendTo(document.body),this._gradient=$('<div id="colorPickerGradient" />').appendTo(this._dialog),this._gradientSelector=$('<span id="colorPickerGradientSelector"><span></span></span>').appendTo(this._gradient),this._bar=$('<div id="colorPickerBar" />').appendTo(this._dialog),this._barSelector=$('<span id="colorPickerBarSelector" />').appendTo(this._bar),this._gradient.mousedown($.proxy(this._mouseDownGradient,this)),this._bar.mousedown($.proxy(this._mouseDownBar,this));var t=this;$(document).mouseup(function(a){t._barActive?(t._barActive=!1,t._mouseBar(a)):t._gradientActive&&(t._gradientActive=!1,t._mouseGradient(a))}).mousemove(function(a){t._barActive?t._mouseBar(a):t._gradientActive&&t._mouseGradient(a)}),this._initColorPickerForm()},_initColorPickerForm:function(){var t=$('<div id="colorPickerForm" />').appendTo(this._dialog);$("<small>"+WCF.Language.get("wcf.style.colorPicker.new")+"</small>").appendTo(t);var a=$('<ul class="colors" />').appendTo(t);this._newColor=$('<li class="new" />').appendTo(a),this._oldColor=$('<li class="old" />').appendTo(a),$("<small>"+WCF.Language.get("wcf.style.colorPicker.current")+"</small>").appendTo(t);var i=$('<ul class="rgba" />').appendTo(t);this._createInputElement("r","R",0,255).appendTo(i),this._createInputElement("g","G",0,255).appendTo(i),this._createInputElement("b","B",0,255).appendTo(i),this._createInputElement("a","a",0,100).appendTo(i);var s=$('<ul class="hex"><li><label><span>#</span></label></li></ul>').appendTo(t);this._hex=$('<input type="text" maxlength="6" />').appendTo(s.find("label")),this._rgba.r.blur($.proxy(this._blurRgba,this)).keyup($.proxy(this._keyUpRGBA,this)),this._rgba.g.blur($.proxy(this._blurRgba,this)).keyup($.proxy(this._keyUpRGBA,this)),this._rgba.b.blur($.proxy(this._blurRgba,this)).keyup($.proxy(this._keyUpRGBA,this)),this._rgba.a.blur($.proxy(this._blurRgba,this)).keyup($.proxy(this._keyUpRGBA,this)),this._hex.blur($.proxy(this._blurHex,this)).keyup($.proxy(this._keyUpHex,this));var e=$('<div class="formSubmit" />').appendTo(this._dialog);$('<button class="buttonPrimary">'+WCF.Language.get("wcf.style.colorPicker.button.apply")+"</button>").appendTo(e).click($.proxy(this._submit,this));var r=this;this._hex.on("paste",function(){r._hex.attr("maxlength","7"),setTimeout(function(){var t=r._hex.val();"#"==t.substring(0,1)&&(t=t.substr(1)),t.length>6&&(t=t.substring(0,6)),r._hex.attr("maxlength","6").val(t)},50)})},_keyUpRGBA:function(t){13==t.which&&(this._blurRgba(),this._submit())},_keyUpHex:function(t){13==t.which&&(this._blurHex(),this._submit())},_submit:function(){var t=this.hsvToRgb(this._hsv.h,this._hsv.s,this._hsv.v),a={};for(var i in this._hsv)a[i]=this._hsv[i];var s=$("#"+this._elementID);s.data("hsv",a).css({backgroundColor:"rgb("+t.r+", "+t.g+", "+t.b+")"}).data("alpha",parseInt(this._rgba.a.val())),s.data("rgb",{r:this._rgba.r.val(),g:this._rgba.g.val(),b:this._rgba.b.val()}),$("#"+s.data("store")).val("rgba("+this._rgba.r.val()+", "+this._rgba.g.val()+", "+this._rgba.b.val()+", "+this._rgba.a.val()/100+")").trigger("change"),this._dialog.wcfDialog("close")},_createInputElement:function(t,a,i,s){var e=$('<li class="'+t+'" />'),r=$("<label />").appendTo(e);return $("<span>"+a+"</span>").appendTo(r),this._rgba[t]=$('<input type="number" value="0" min="'+i+'" max="'+s+'" step="1" />').appendTo(r),e},_mouseDownGradient:function(t){this._gradientActive=!0,this._mouseGradient(t)},_mouseGradient:function(t){var a=this._gradient.getOffsets("offset"),i=Math.max(Math.min(t.pageX-a.left,255),0),s=Math.max(Math.min(t.pageY-a.top,255),0);this._hsv.s=100*Math.max(0,Math.min(1,i/255)),this._hsv.v=100*Math.max(0,Math.min(1,(255-s)/255)),this._updateValues(null)},_mouseDownBar:function(t){this._barActive=!0,this._mouseBar(t)},_mouseBar:function(t){var a=this._bar.getOffsets("offset"),i=Math.max(Math.min(t.pageY-a.top,255),0);this._barSelector.css({top:i+"px"}),this._hsv.h=Math.max(0,Math.min(359,Math.round((255-i)/255*360))),this._updateValues(null)},_blurRgba:function(){for(var t in this._rgba){var a=parseInt(this._rgba[t].val())||0;this._rgba[t].val("a"===t?Math.max(0,Math.min(100,a)):Math.max(0,Math.min(255,a)))}this._updateValues({r:this._rgba.r.val(),g:this._rgba.g.val(),b:this._rgba.b.val()},!0,!0)},_blurHex:function(){var t=this.hexToRgb(this._hex.val());t!==Number.NaN&&this._updateValues(t,!0,!0)},_updateValues:function(t,a,i){a=a===!0?!0:!1,i=i===!0?!0:!1,null===t&&(t=this.hsvToRgb(this._hsv.h,this._hsv.s,this._hsv.v)),void 0===t.a&&(t.a=this._rgba.a.val());for(var s in t)this._rgba[s].val(t[s]);if(this._hex.val(this.rgbToHex(t.r,t.g,t.b)),a||i){var e=this.rgbToHsv(t.r,t.g,t.b);a&&(this._hsv.h=e.h),i&&(this._hsv.s=e.s,this._hsv.v=e.v)}var r=Math.max(0,Math.min(255,255-this._hsv.h/360*255));this._barSelector.css({top:r+"px"});var h=Math.max(0,Math.min(255,this._hsv.s/100*255)),r=Math.max(0,Math.min(255,255-this._hsv.v/100*255));this._gradientSelector.css({left:h-6+"px",top:r-6+"px"}),this._newColor.css({backgroundColor:"rgb("+t.r+", "+t.g+", "+t.b+")"});var n=this.hsvToRgb(this._hsv.h,100,100);this._gradient.css({backgroundColor:"rgb("+n.r+", "+n.g+", "+n.b+")"})},hsvToRgb:function(t,a,i){var s,e,r,h,n,o={r:0,g:0,b:0};if(s=Math.floor(t/60),e=t/60-s,a/=100,i/=100,r=i*(1-a),h=i*(1-a*e),n=i*(1-a*(1-e)),0==a)o.r=o.g=o.b=i;else switch(s){case 1:o.r=h,o.g=i,o.b=r;break;case 2:o.r=r,o.g=i,o.b=n;break;case 3:o.r=r,o.g=h,o.b=i;break;case 4:o.r=n,o.g=r,o.b=i;break;case 5:o.r=i,o.g=r,o.b=h;break;case 0:case 6:o.r=i,o.g=n,o.b=r}return{r:Math.round(255*o.r),g:Math.round(255*o.g),b:Math.round(255*o.b)}},rgbToHsv:function(t,a,i){var s,e,r,h,n,o;if(t/=255,a/=255,i/=255,h=Math.max(Math.max(t,a),i),n=Math.min(Math.min(t,a),i),o=h-n,s=0,h!==n){switch(h){case t:s=60*(0+(a-i)/o);break;case a:s=60*(2+(i-t)/o);break;case i:s=60*(4+(t-a)/o)}0>s&&(s+=360)}return e=0===h?0:o/h,r=h,{h:Math.round(s),s:Math.round(100*e),v:Math.round(100*r)}},hexToRgb:function(t){return/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(t)?(t=t.split(""),"#"===t[0]&&t.shift(),3===t.length?{r:parseInt(t[0]+""+t[0],16),g:parseInt(t[1]+""+t[1],16),b:parseInt(t[2]+""+t[2],16)}:{r:parseInt(t[0]+""+t[1],16),g:parseInt(t[2]+""+t[3],16),b:parseInt(t[4]+""+t[5],16)}):Number.NaN},rgbToHex:function(t,a,i){return"0123456789ABCDEF".charAt((t-t%16)/16)+""+"0123456789ABCDEF".charAt(t%16)+("0123456789ABCDEF".charAt((a-a%16)/16)+""+"0123456789ABCDEF".charAt(a%16))+("0123456789ABCDEF".charAt((i-i%16)/16)+""+"0123456789ABCDEF".charAt(i%16))}});
\ No newline at end of file
diff --git a/wcfsetup/install/files/js/WCF.Comment.min.js b/wcfsetup/install/files/js/WCF.Comment.min.js
new file mode 100644 (file)
index 0000000..7b70ae9
--- /dev/null
@@ -0,0 +1 @@
+WCF.Comment={},WCF.Comment.Handler=Class.extend({_commentAdd:null,_commentButtonList:{},_comments:{},_container:null,_containerID:"",_displayedComments:0,_loadNextComments:null,_loadNextResponses:{},_proxy:null,_responses:{},_userAvatar:"",init:function(e,t){this._commentAdd=null,this._commentButtonList={},this._comments={},this._containerID=e,this._displayedComments=0,this._loadNextComments=null,this._loadNextResponses={},this._responses={},this._userAvatar=t,this._container=$("#"+$.wcfEscapeID(this._containerID)),this._container.length||console.debug("[WCF.Comment.Handler] Unable to find container identified by '"+this._containerID+"'"),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._initComments(),this._initResponses(),this._container.data("canAdd")&&this._initAddComment(),WCF.DOMNodeInsertedHandler.execute(),WCF.DOMNodeInsertedHandler.addCallback("WCF.Comment.Handler",$.proxy(this._domNodeInserted,this))},_handleLoadNextComments:function(){this._displayedComments<this._container.data("comments")?(null===this._loadNextComments&&(this._loadNextComments=$('<li class="commentLoadNext"><button class="small">'+WCF.Language.get("wcf.comment.more")+"</button></li>").appendTo(this._container),this._loadNextComments.children("button").click($.proxy(this._loadComments,this))),this._loadNextComments.children("button").enable()):null!==this._loadNextComments&&this._loadNextComments.hide()},_handleLoadNextResponses:function(e){var t=this._comments[e];if(t.data("displayedResponses",t.find("ul.commentResponseList > li").length),t.data("displayedResponses")<t.data("responses")){if(void 0===this._loadNextResponses[e]){var n=t.data("responses")-t.data("displayedResponses");this._loadNextResponses[e]=$('<li class="jsCommentLoadNextResponses"><a>'+WCF.Language.get("wcf.comment.response.more",{count:n})+"</a></li>").appendTo(this._commentButtonList[e]),this._loadNextResponses[e].children("a").data("commentID",e).click($.proxy(this._loadResponses,this)),this._commentButtonList[e].parent().show()}}else if(void 0!==this._loadNextResponses[e]){var s=this._loadNextResponses[e].next();this._loadNextResponses[e].remove(),s.length&&s.trigger("click")}},_loadComments:function(){this._loadNextComments.children("button").disable(),this._proxy.setOption("data",{actionName:"loadComments",className:"wcf\\data\\comment\\CommentAction",parameters:{data:{objectID:this._container.data("objectID"),objectTypeID:this._container.data("objectTypeID"),lastCommentTime:this._container.data("lastCommentTime")}}}),this._proxy.sendRequest()},_loadResponses:function(e){this._loadResponsesExecute($(e.currentTarget).disable().data("commentID"),!1)},_loadResponsesExecute:function(e,t){this._proxy.setOption("data",{actionName:"loadResponses",className:"wcf\\data\\comment\\response\\CommentResponseAction",parameters:{data:{commentID:e,lastResponseTime:this._comments[e].data("lastResponseTime"),loadAllResponses:t?1:0}}}),this._proxy.sendRequest()},_domNodeInserted:function(){this._initComments(),this._initResponses()},_initComments:function(){var e=this,t=!1;this._container.find(".jsComment").each(function(n,s){var a=$(s).removeClass("jsComment"),o=a.data("commentID");e._comments[o]=a;var i=a.find("ul.commentResponseList");i.length||(i=a.find(".commentContent")),$container=$('<div class="commentOptionContainer" />').hide().insertAfter(i),e._commentButtonList[o]=$("<ul />").appendTo($container),e._handleLoadNextResponses(o),e._initComment(o,a),e._displayedComments++,t=!0}),t&&this._handleLoadNextComments()},_initComment:function(e,t){if(this._container.data("canAdd")&&this._initAddResponse(e,t),t.data("canEdit")){var n=$('<li><a class="jsTooltip" title="'+WCF.Language.get("wcf.global.button.edit")+'"><span class="icon icon16 icon-pencil" /> <span class="invisible">'+WCF.Language.get("wcf.global.button.edit")+"</span></a></li>");n.data("commentID",e).appendTo(t.find("ul.commentOptions:eq(0)")).click($.proxy(this._prepareEdit,this))}if(t.data("canDelete")){var s=$('<li><a class="jsTooltip" title="'+WCF.Language.get("wcf.global.button.delete")+'"><span class="icon icon16 icon-remove" /> <span class="invisible">'+WCF.Language.get("wcf.global.button.delete")+"</span></a></li>");s.data("commentID",e).appendTo(t.find("ul.commentOptions:eq(0)")).click($.proxy(this._delete,this))}},_initResponses:function(){var e=this;this._container.find(".jsCommentResponse").each(function(t,n){var s=$(n).removeClass("jsCommentResponse"),a=s.data("responseID");e._responses[a]=s,e._initResponse(a,s)})},_initResponse:function(e,t){if(t.data("canEdit")){var n=$('<li><a class="jsTooltip" title="'+WCF.Language.get("wcf.global.button.edit")+'"><span class="icon icon16 icon-pencil" /> <span class="invisible">'+WCF.Language.get("wcf.global.button.edit")+"</span></a></li>"),s=this;n.data("responseID",e).appendTo(t.find("ul.commentOptions:eq(0)")).click(function(e){s._prepareEdit(e,!0)})}if(t.data("canDelete")){var a=$('<li><a class="jsTooltip" title="'+WCF.Language.get("wcf.global.button.delete")+'"><span class="icon icon16 icon-remove" /> <span class="invisible">'+WCF.Language.get("wcf.global.button.delete")+"</span></a></li>"),s=this;a.data("responseID",e).appendTo(t.find("ul.commentOptions:eq(0)")).click(function(e){s._delete(e,!0)})}},_initAddComment:function(){this._commentAdd=$('<li class="box32 jsCommentAdd"><span class="framed">'+this._userAvatar+"</span><div /></li>").prependTo(this._container);var e=this._commentAdd.children("div"),t=$('<input type="text" placeholder="'+WCF.Language.get("wcf.comment.add")+'" maxlength="65535" class="long" />').appendTo(e);$("<small>"+WCF.Language.get("wcf.comment.description")+"</small>").appendTo(e),t.keyup($.proxy(this._keyUp,this))},_initAddResponse:function(e,t){var n=null;(!t.data("responses")||this._loadNextResponses[e])&&(n=$('<li class="jsCommentShowAddResponse"><a>'+WCF.Language.get("wcf.comment.button.response.add")+"</a></li>").data("commentID",e).click($.proxy(this._showAddResponse,this)).appendTo(this._commentButtonList[e]));var s=$('<div class="box32 commentResponseAdd jsCommentResponseAdd"><span class="framed">'+this._userAvatar+"</span><div /></div>");null!==n?s.hide():this._commentButtonList[e].parent().addClass("jsAddResponseActive"),s.appendTo(this._commentButtonList[e].parent().show());var a=s.children("div"),o=$('<input type="text" placeholder="'+WCF.Language.get("wcf.comment.response.add")+'" maxlength="65535" class="long" />').data("commentID",e).appendTo(a);$("<small>"+WCF.Language.get("wcf.comment.description")+"</small>").appendTo(a);var i=this;o.keyup(function(e){i._keyUp(e,!0)}),t.data("responsePlaceholder",n).data("responseInput",s)},_prepareEdit:function(e,t){var n=$(e.currentTarget),s={objectID:this._container.data("objectID"),objectTypeID:this._container.data("objectTypeID")};t===!0?s.responseID=n.data("responseID"):s.commentID=n.data("commentID"),this._proxy.setOption("data",{actionName:"prepareEdit",className:"wcf\\data\\comment\\CommentAction",parameters:{data:s}}),this._proxy.sendRequest()},_showAddResponse:function(e){var t=$(e.currentTarget),n=t.data("commentID");t.prev().hasClass("jsCommentLoadNextResponses")&&(this._loadResponsesExecute(n,!0),t.parent().children(".button").disable()),t.remove();var s=this._comments[n].data("responseInput").show();s.find("input").focus(),s.parents(".commentOptionContainer").addClass("jsAddResponseActive")},_keyUp:function(e,t){if(13===e.which||27===e.which){var n=$(e.currentTarget);if(27===e.which)return void n.val("").trigger("blur",e);var s=$.trim(n.val());if(""!=s){var a="addComment",o={message:s,objectID:this._container.data("objectID"),objectTypeID:this._container.data("objectTypeID")};t===!0&&(a="addResponse",o.commentID=n.data("commentID")),this._proxy.setOption("data",{actionName:a,className:"wcf\\data\\comment\\CommentAction",parameters:{data:o}}),this._proxy.sendRequest()}}},_delete:function(e,t){WCF.System.Confirmation.show(WCF.Language.get("wcf.comment.delete.confirmMessage"),$.proxy(function(n){if("confirm"===n){var s={objectID:this._container.data("objectID"),objectTypeID:this._container.data("objectTypeID")};t!==!0?s.commentID=$(e.currentTarget).data("commentID"):s.responseID=$(e.currentTarget).data("responseID"),this._proxy.setOption("data",{actionName:"remove",className:"wcf\\data\\comment\\CommentAction",parameters:{data:s}}),this._proxy.sendRequest()}},this))},_success:function(e){switch(e.actionName){case"addComment":this._commentAdd.find("input").val("").blur(),$(e.returnValues.template).insertAfter(this._commentAdd).wcfFadeIn();break;case"addResponse":var t=this._comments[e.returnValues.commentID];t.find(".jsCommentResponseAdd input").val("").blur();var n=t.find("ul.commentResponseList");n.length||(n=$('<ul class="commentResponseList" />').insertBefore(t.find(".commentOptionContainer"))),$(e.returnValues.template).appendTo(n).wcfFadeIn();break;case"edit":this._update(e);break;case"loadComments":this._insertComments(e);break;case"loadResponses":this._insertResponses(e);break;case"prepareEdit":this._edit(e);break;case"remove":this._remove(e)}WCF.DOMNodeInsertedHandler.execute()},_insertComments:function(e){$(e.returnValues.template).insertBefore(this._loadNextComments),this._container.data("lastCommentTime",e.returnValues.lastCommentTime)},_insertResponses:function(e){var t=this._comments[e.returnValues.commentID];$(e.returnValues.template).appendTo(t.find("ul.commentResponseList")),t.data("lastResponseTime",e.returnValues.lastResponseTime),this._handleLoadNextResponses(e.returnValues.commentID)},_remove:function(e){if(e.returnValues.commentID)this._comments[e.returnValues.commentID].remove(),delete this._comments[e.returnValues.commentID];else{var t=this._responses[e.returnValues.responseID],n=this._comments[t.parents("li.comment:eq(0)").data("commentID")];n.data("responses",parseInt(n.data("responses"))-1),t.remove(),delete this._responses[e.returnValues.responseID]}},_edit:function(e){if(e.returnValues.commentID)var t=this._comments[e.returnValues.commentID].find(".commentContent:eq(0) .userMessage:eq(0)");else var t=this._responses[e.returnValues.responseID].find(".commentContent:eq(0) .userMessage:eq(0)");t.html($.proxy(function(t,n){var s=$('<input type="text" class="long" maxlength="65535" /><small>'+WCF.Language.get("wcf.comment.description")+"</small>").val(e.returnValues.message);return s.data("__html",n).keyup($.proxy(this._saveEdit,this)),e.returnValues.commentID?s.data("commentID",e.returnValues.commentID):s.data("responseID",e.returnValues.responseID),s},this)),t.children("input").focus(),t.parent().find(".containerHeadline:eq(0)").hide(),t.parent().find(".buttonGroupNavigation:eq(0)").hide()},_update:function(e){if(e.returnValues.commentID)var t=this._comments[e.returnValues.commentID].find(".commentContent:eq(0) .userMessage:eq(0) > input");else var t=this._responses[e.returnValues.responseID].find(".commentContent:eq(0) .userMessage:eq(0) > input");t.data("__html",e.returnValues.message),this._cancelEdit(t)},_saveEdit:function(e){var t=$(e.currentTarget);if(27===e.which)return void this._cancelEdit(t);if(13===e.which){var n=$.trim(t.val());if(""!==n){var s={message:n,objectID:this._container.data("objectID"),objectTypeID:this._container.data("objectTypeID")};t.data("commentID")?s.commentID=t.data("commentID"):s.responseID=t.data("responseID"),this._proxy.setOption("data",{actionName:"edit",className:"wcf\\data\\comment\\CommentAction",parameters:{data:s}}),this._proxy.sendRequest()}}},_cancelEdit:function(e){e.parent().prev(".containerHeadline:eq(0)").show(),e.parent().next(".buttonGroupNavigation:eq(0)").show(),e.parent().html(e.data("__html"))}}),WCF.Comment.Like=WCF.Like.extend({_getContainers:function(){return $(".commentList > li.comment")},_getObjectID:function(e){return this._containers[e].data("commentID")},_buildWidget:function(e,t,n,s){this._containers[e].find(".containerHeadline:eq(0) > h3").append(s),this._canLike&&(t.appendTo(this._containers[e].find(".commentOptions:eq(0)")),n.appendTo(this._containers[e].find(".commentOptions:eq(0)")))},_getWidgetContainer:function(){},_addWidget:function(){}}),WCF.Comment.Response={},WCF.Comment.Response.Like=WCF.Like.extend({_addWidget:function(){},_buildWidget:function(e,t,n,s){this._containers[e].find(".containerHeadline:eq(0) > h3").append(s),this._canLike&&(t.appendTo(this._containers[e].find(".commentOptions:eq(0)")),n.appendTo(this._containers[e].find(".commentOptions:eq(0)")))},_getContainers:function(){return $(".commentResponseList > li.commentResponse")},_getObjectID:function(e){return this._containers[e].data("responseID")},_getWidgetContainer:function(){}});
\ No newline at end of file
diff --git a/wcfsetup/install/files/js/WCF.ImageViewer.min.js b/wcfsetup/install/files/js/WCF.ImageViewer.min.js
new file mode 100644 (file)
index 0000000..f1961a4
--- /dev/null
@@ -0,0 +1 @@
+WCF.ImageViewer=Class.extend({init:function(){$('<span class="icon icon16 icon-chevron-left jsTooltip" title="'+WCF.Language.get("wcf.imageViewer.previous")+'" />').appendTo($("#lbPrevLink")),$('<span class="icon icon16 icon-chevron-right jsTooltip" title="'+WCF.Language.get("wcf.imageViewer.next")+'" />').appendTo($("#lbNextLink")),$('<span class="icon icon32 icon-remove jsTooltip" title="'+WCF.Language.get("wcf.imageViewer.close")+'" />').appendTo($("#lbCloseLink"));var i=$('<span class="icon icon32 icon-resize-full jsTooltip" title="'+WCF.Language.get("wcf.imageViewer.enlarge")+'" id="lbEnlarge" />').insertAfter($("#lbCloseLink"));i.click($.proxy(this._enlarge,this)),this._initImageViewer(),WCF.DOMNodeInsertedHandler.addCallback("WCF.ImageViewer",$.proxy(this._domNodeInserted,this)),WCF.DOMNodeInsertedHandler.execute()},_domNodeInserted:function(){this._initImageSizeCheck(),this._initImageViewer()},_initImageViewer:function(){if(!$.browser.touch||!/[Mm]obile/.test(navigator.userAgent)||/iPad/.test(navigator.userAgent)){var i=$("a.jsImageViewer");i.length&&i.removeClass("jsImageViewer").slimbox({counterText:WCF.Language.get("wcf.imageViewer.counter"),loop:!0})}},_enlarge:function(){var i=$("#lbImage").css("backgroundImage");i&&(i=i.replace(/^url\((["']?)(.*)\1\)$/,"$2"),window.location=i)},_initImageSizeCheck:function(){$(".jsResizeImage").each($.proxy(function(i,e){e.complete&&this._checkImageSize({currentTarget:e})},this)),$(".jsResizeImage").on("load",$.proxy(this._checkImageSize,this))},_checkImageSize:function(i){var e=$(i.currentTarget);if(!e.is(":visible"))return void e.off("load");e.removeClass("jsResizeImage");var t=e.getDimensions(),s=e.closest("div").width();t.width>s&&(e.css({height:Math.round(t.height*(s/t.width))+"px",width:s+"px"}),e.parents("a").length||(e.wrap('<a href="'+e.attr("src")+'" />'),e.parent().slimbox()))}}),$.widget("ui.wcfImageViewer",{_active:-1,_activeImage:null,_container:null,_didInit:!1,_disableSlideshow:!1,_eventNamespace:"",_images:[],_isOpen:!1,_items:-1,_maxDimensions:{height:0,width:0},_proxy:null,_slideshowEnabled:!1,_thumbnailContainerWidth:0,_thumbnailMarginRight:0,_thumbnailOffset:0,_thumbnailWidth:0,_timer:null,_ui:{buttonNext:null,buttonPrevious:null,header:null,image:null,imageContainer:null,imageList:null,slideshow:{container:null,enlarge:null,next:null,previous:null,toggle:null}},options:{shiftBy:5,enableSlideshow:1,speed:5,className:""},_create:function(){this._active=-1,this._activeImage=null,this._container=null,this._didInit=!1,this._disableSlideshow=this.element.data("disableSlideshow"),this._eventNamespace=this.element.wcfIdentify(),this._images=[],this._isOpen=!1,this._items=-1,this._maxDimensions={height:document.documentElement.clientHeight,width:document.documentElement.clientWidth},this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._slideshowEnabled=!1,this._thumbnailContainerWidth=0,this._thumbnailMarginRight=0,this._thumbnailOffset=0,this._thumbnaiLWidth=0,this._timer=null,this._ui={},this.element.click($.proxy(this.open,this))},open:function(i){return i&&i.preventDefault(),this._isOpen?!1:(0===this._images.length?this._loadNextImages(!0):(this._render(!1,this.element.data("targetImageID")),this._items>1&&this._slideshowEnabled&&this.startSlideshow(),this._isOpen=!0,WCF.System.DisableScrolling.disable()),this._bindListener(),!0)},close:function(i){return i&&i.preventDefault(),this._isOpen?(this._container.removeClass("open"),null!==this._timer&&this._timer.stop(),this._unbindListener(),this._isOpen=!1,WCF.System.DisableScrolling.enable(),!0):!1},startSlideshow:function(){return this._disableSlideshow||this._slideshowEnabled?!1:(null===this._timer?this._timer=new WCF.PeriodicalExecuter($.proxy(function(){var i=this._active+1;i==this._items&&(i=0),this.showImage(i)},this),1e3*this.options.speed):this._timer.resume(),this._slideshowEnabled=!0,this._ui.slideshow.toggle.children("span").removeClass("icon-play").addClass("icon-pause"),!0)},stopSlideshow:function(i){return this._slideshowEnabled?(this._timer.stop(),i&&this._ui.slideshow.toggle.children("span").removeClass("icon-pause").addClass("icon-play"),this._slideshowEnabled=!1,!0):!1},_bindListener:function(){$(document).on("keydown."+this._eventNamespace,$.proxy(this._keyDown,this)),$(window).on("resize."+this._eventNamespace,$.proxy(this._renderImage,this))},_unbindListener:function(){$(document).off("keydown."+this._eventNamespace),$(window).off("resize."+this._eventNamespace)},_keyDown:function(i){switch(i.which){case $.ui.keyCode.ESCAPE:this.close();break;case $.ui.keyCode.LEFT:this._previousImage();break;case $.ui.keyCode.RIGHT:this._nextImage();break;case $.ui.keyCode.UP:this._container.hasClass("maximized")||this._toggleView();break;case $.ui.keyCode.DOWN:this._container.hasClass("maximized")&&this._toggleView();break;case $.ui.keyCode.ENTER:var e=this._ui.header.find("> div > h1 > a");1==e.length?window.location=e.prop("href"):this._ui.slideshow.full.trigger("click");break;case 80:this._ui.slideshow.toggle.trigger("click");break;default:return!0}return!1},_render:function(i,e){this._container.addClass("open");var t=null;i&&(t=this._ui.imageList.children("li:eq(0)"),this._thumbnailMarginRight=parseInt(t.css("marginRight").replace(/px$/,""))||0,this._thumbnailWidth=t.outerWidth(!0),this._thumbnailContainerWidth=this._ui.imageList.parent().innerWidth(),this._items>1&&this.options.enableSlideshow&&!e&&this.startSlideshow()),e?this._ui.imageList.children("li").each($.proxy(function(i,t){var s=$(t);return s.data("objectID")==e?(s.trigger("click"),this.moveToImage(s.data("index")),!1):void 0},this)):null!==t&&t.trigger("click"),this._toggleButtons(),this._preload()},_preload:function(){if(this._images.length<this._items){var i=this._images.length*this._thumbnailWidth;i-this._thumbnailOffset<this._thumbnailContainerWidth&&this._loadNextImages(!1)}},_showImage:function(i){this.showImage($(i.currentTarget).data("index"),!0)},showImage:function(i,e){if(this._active==i)return!1;this.stopSlideshow(e||!1),-1!=this._active&&this._images[this._active].listItem.removeClass("active"),this._active=i;var t=this._images[i];this._ui.imageList.children("li").removeClass("active"),t.listItem.addClass("active");var s=this._ui.imageContainer.getDimensions("inner"),a=this._activeImage?0:1;null!==this._activeImage&&this._ui.images[this._activeImage].removeClass("active"),this._activeImage=a;var n=this._active;this._ui.imageContainer.addClass("loading"),this._ui.images[a].off("load").prop("src",!1).on("load",$.proxy(function(){this._imageOnLoad(n,a)},this)),this._renderImage(a,t,s);var o=this._ui.header.find("> div > a").prop("href",t.user.link).prop("title",t.user.username);o.children("img").prop("src",t.user.avatarURL);var h=WCF.String.escapeHTML(t.image.title);t.image.link&&(h='<a href="'+t.image.link+'">'+h+"</a>"),this._ui.header.find("> div > h1").html(h);var l=t.series&&t.series.title?WCF.String.escapeHTML(t.series.title):"";return t.series.link&&(l='<a href="'+t.series.link+'">'+l+"</a>"),this._ui.header.find("> div > h2").html(l),this._ui.header.find("> div > h3").text(WCF.Language.get("wcf.imageViewer.seriesIndex").replace(/{x}/,t.listItem.data("index")+1).replace(/{y}/,this._items)),this._ui.slideshow.full.data("link",t.image.fullURL?t.image.fullURL:t.image.url),this.moveToImage(t.listItem.data("index")),this._toggleButtons(),!0},_imageOnLoad:function(i,e){i==this._active&&(this._ui.imageContainer.removeClass("loading"),this._ui.images[e].addClass("active"),this.startSlideshow())},_renderImage:function(i,e,t){e||(i=this._activeImage,e=this._images[this._active],t={height:$(window).height()-(this._container.hasClass("maximized")?0:200),width:this._ui.imageContainer.innerWidth()}),t.height-=22,t.width-=20,this._ui.images[i].prop("src",e.image.url);var s=e.image.height,a=e.image.width,n=0;s>t.height&&(n=t.height/s,s=t.height,a=Math.floor(a*n)),a>t.width&&(n=t.width/a,a=t.width,s=Math.floor(s*n));var o=Math.floor((t.width-a)/2);this._ui.images[i].css({height:s+"px",left:o+10+"px",marginTop:-1*Math.round(s/2)+"px",width:a+"px"})},_initUI:function(){if(this._didInit)return!1;this._didInit=!0,this._container=$('<div class="wcfImageViewer" />').appendTo(document.body);var i=$('<div><img class="active" /><img /></div>').appendTo(this._container),e=$('<footer><span class="wcfImageViewerButtonPrevious icon icon-double-angle-left" /><div><ul /></div><span class="wcfImageViewerButtonNext icon icon-double-angle-right" /></footer>').appendTo(this._container),t=$("<ul />").appendTo(i),s=$('<li class="wcfImageViewerSlideshowButtonPrevious"><span class="icon icon48 icon-angle-left" /></li>').appendTo(t),a=$('<li class="wcfImageViewerSlideshowButtonToggle pointer"><span class="icon icon48 icon-play" /></li>').appendTo(t),n=$('<li class="wcfImageViewerSlideshowButtonNext"><span class="icon icon48 icon-angle-right" /></li>').appendTo(t),o=$('<li class="wcfImageViewerSlideshowButtonEnlarge pointer jsTooltip" title="'+WCF.Language.get("wcf.imageViewer.button.enlarge")+'"><span class="icon icon48 icon-resize-full" /></li>').appendTo(t),h=$('<li class="wcfImageViewerSlideshowButtonFull pointer jsTooltip" title="'+WCF.Language.get("wcf.imageViewer.button.full")+'"><span class="icon icon48 icon-external-link" /></li>').appendTo(t);return this._ui={buttonNext:e.children("span.wcfImageViewerButtonNext"),buttonPrevious:e.children("span.wcfImageViewerButtonPrevious"),header:$('<header><div class="box64"><a class="framed jsTooltip"><img /></a><h1 /><h2 /><h3 /></div></header>').appendTo(this._container),imageContainer:i,images:[i.children("img:eq(0)").on("webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd",function(){$(this).removeClass("animateTransformation")}),i.children("img:eq(1)").on("webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd",function(){$(this).removeClass("animateTransformation")})],imageList:e.find("> div > ul"),slideshow:{container:t,enlarge:o,full:h,next:n,previous:s,toggle:a}},this._ui.buttonNext.click($.proxy(this._next,this)),this._ui.buttonPrevious.click($.proxy(this._previous,this)),n.click($.proxy(this._nextImage,this)),s.click($.proxy(this._previousImage,this)),o.click($.proxy(this._toggleView,this)),a.click($.proxy(function(){this._slideshowEnabled?this.stopSlideshow(!0):(this._disableSlideshow=!1,this.startSlideshow())},this)),h.click(function(i){window.location=$(i.currentTarget).data("link")}),$('<span class="wcfImageViewerButtonClose icon icon48 icon-remove pointer jsTooltip" title="'+WCF.Language.get("wcf.global.button.close")+'" />').appendTo(this._ui.header).click($.proxy(this.close,this)),!0},_toggleView:function(){this._ui.images[this._activeImage].addClass("animateTransformation"),this._container.toggleClass("maximized"),this._ui.slideshow.enlarge.toggleClass("active").children("span").toggleClass("icon-resize-full").toggleClass("icon-resize-small"),this._renderImage(null,void 0,null)},_next:function(i,e){if(this._ui.buttonNext.hasClass("pointer")){void 0==e&&this.stopSlideshow(!0);var t=Math.max(this._items*this._thumbnailWidth-this._thumbnailContainerWidth-this._thumbnailMarginRight,0);this._thumbnailOffset=Math.min(this._thumbnailOffset+this._thumbnailWidth*(e?e:this.options.shiftBy),t),this._ui.imageList.css("marginLeft",-1*this._thumbnailOffset)}this._preload(),this._toggleButtons()},_previous:function(i,e){this._ui.buttonPrevious.hasClass("pointer")&&(void 0==e&&this.stopSlideshow(!0),this._thumbnailOffset=Math.max(this._thumbnailOffset-this._thumbnailWidth*(e?e:this.options.shiftBy),0),this._ui.imageList.css("marginLeft",-1*this._thumbnailOffset)),this._toggleButtons()},_nextImage:function(){this._ui.slideshow.next.hasClass("pointer")&&(this._disableSlideshow=!0,this.stopSlideshow(!0),this.showImage(this._active+1))},_previousImage:function(){this._ui.slideshow.previous.hasClass("pointer")&&(this._disableSlideshow=!0,this.stopSlideshow(!0),this.showImage(this._active-1))},moveToImage:function(i){var e=(i-3)*this._thumbnailWidth,t=e+5*this._thumbnailWidth,s=this._thumbnailOffset,a=this._thumbnailOffset+this._thumbnailContainerWidth,n=!1;if((s>e||t>a)&&(n=!0),n){var o=0;if(s>e){for(;s>e;)o++,s-=this._thumbnailWidth;this._previous(null,o)}else{for(;t>a;)o++,a+=this._thumbnailWidth;this._next(null,o)}}},_toggleButtons:function(){this._thumbnailOffset>0?this._ui.buttonPrevious.addClass("pointer"):this._ui.buttonPrevious.removeClass("pointer");var i=this._images.length*this._thumbnailWidth-this._thumbnailContainerWidth-this._thumbnailMarginRight;this._thumbnailOffset>=i?this._ui.buttonNext.removeClass("pointer"):this._ui.buttonNext.addClass("pointer"),this._active>0?this._ui.slideshow.previous.addClass("pointer"):this._ui.slideshow.previous.removeClass("pointer"),this._active+1<this._images.length?this._ui.slideshow.next.addClass("pointer"):this._ui.slideshow.next.removeClass("pointer")},_createThumbnails:function(i){for(var e=0,t=i.length;t>e;e++){var s=i[e],a=$('<li class="loading pointer"><img src="'+s.thumbnail.url+'" /></li>').appendTo(this._ui.imageList);a.data("index",this._images.length).data("objectID",s.objectID).click($.proxy(this._showImage,this));var n=a.children("img");n.get(0).complete?a.removeClass("loading"):n.on("load",function(){$(this).parent().removeClass("loading")}),s.listItem=a,this._images.push(s)}},_loadNextImages:function(i){this._proxy.setOption("data",{actionName:"loadNextImages",className:this.options.className,interfaceName:"wcf\\data\\IImageViewerAction",objectIDs:[this.element.data("objectID")],parameters:{maximumHeight:this._maxDimensions.height,maximumWidth:this._maxDimensions.width,offset:this._images.length,targetImageID:i&&this.element.data("targetImageID")?this.element.data("targetImageID"):0}}),this._proxy.setOption("showLoadingOverlay",!1),this._proxy.sendRequest()},_success:function(i){i.returnValues.items&&(this._items=i.returnValues.items);var e=this._initUI();this._createThumbnails(i.returnValues.images);var t=i.returnValues.targetImageID?i.returnValues.targetImageID:0;this._render(e,t),this._isOpen||(this._isOpen=!0,WCF.System.DisableScrolling.disable())}});
\ No newline at end of file
diff --git a/wcfsetup/install/files/js/WCF.Label.min.js b/wcfsetup/install/files/js/WCF.Label.min.js
new file mode 100644 (file)
index 0000000..fa58b2d
--- /dev/null
@@ -0,0 +1 @@
+WCF.Label={},WCF.Label.ACPList=Class.extend({_labelInput:null,_labelList:[],init:function(){this._labelInput=$("#label").keydown($.proxy(this._keyPressed,this)).keyup($.proxy(this._keyPressed,this)).blur($.proxy(this._keyPressed,this)),$.browser.mozilla&&$.browser.touch&&this._labelInput.on("input",$.proxy(this._keyPressed,this)),$("#labelList").find('input[type="radio"]').each($.proxy(function(t,e){var i=$(e);"custom"!==i.prop("value")&&this._labelList.push($(i.next("span")))},this))},_keyPressed:function(){var t=this._labelInput.prop("value");""===t&&(t=WCF.Language.get("wcf.acp.label.defaultValue"));for(var e=0,i=this._labelList.length;i>e;e++)this._labelList[e].text(t)}}),WCF.Label.ACPList.Connect=Class.extend({init:function(){var t=$("#connect .structuredList li");t.length&&t.each($.proxy(function(t,e){$(e).find('input[type="checkbox"]').click($.proxy(this._click,this))},this))},_click:function(t){var e=$(t.currentTarget);if(e.is(":checked")){e=e.parents("li");for(var i=e.data("depth");;){if(e=e.next(),!e.length)return!0;if(e.data("depth")<=i)return!0;e.find('input[type="checkbox"]').prop("checked","checked")}}}}),WCF.Label.Chooser=Class.extend({_container:null,_groups:{},_showWithoutSelection:!1,init:function(t,e,i,a){if(this._container=null,this._groups={},this._showWithoutSelection=a===!0,this._initContainers(e),$.getLength(t))for(var n in t){var l=this._groups[n];l&&WCF.Dropdown.getDropdownMenu(l.wcfIdentify()).find("> ul > li:not(.dropdownDivider)").each($.proxy(function(e,i){var a=$(i),l=a.data("labelID")||0;l&&t[n]==l&&this._selectLabel(a,!0)},this))}for(var o in this._containers){var s=this._containers[o];void 0===s.data("labelID")&&s.data("labelID",0)}this._container=$(e),i?$(i).click($.proxy(this._submit,this)):this._container.is("form")&&this._container.submit($.proxy(this._submit,this))},_initContainers:function(t){$(t).find(".labelChooser").each($.proxy(function(t,e){var i=$(e),a=i.data("groupID");if(!this._groups[a]){var n=i.wcfIdentify(),l=WCF.Dropdown.getDropdownMenu(n);null===l&&(WCF.Dropdown.initDropdown(i.find(".dropdownToggle")),l=WCF.Dropdown.getDropdownMenu(n));var o=l;if("div"==l.getTagName()&&l.children(".scrollableDropdownMenu").length&&(o=$("<ul />").appendTo(l),l=l.children(".scrollableDropdownMenu")),this._groups[a]=i,l.children("li").data("groupID",a).click($.proxy(this._click,this)),(!i.data("forceSelection")||this._showWithoutSelection)&&$('<li class="dropdownDivider" />').appendTo(o),this._showWithoutSelection&&$('<li data-label-id="-1"><span><span class="badge label">'+WCF.Language.get("wcf.label.withoutSelection")+"</span></span></li>").data("groupID",a).appendTo(o).click($.proxy(this._click,this)),!i.data("forceSelection")){var s=$('<li data-label-id="0"><span><span class="badge label">'+WCF.Language.get("wcf.label.none")+"</span></span></li>").data("groupID",a).appendTo(o);s.click($.proxy(this._click,this))}}},this))},_click:function(t){this._selectLabel($(t.currentTarget),!1)},_selectLabel:function(t,e){var i=this._groups[t.data("groupID")];e&&void 0!==i.data("labelID")||(t.data("labelID")?i.data("labelID",t.data("labelID")):i.data("labelID",0),t=t.find("span > span"),i.find(".dropdownToggle > span").removeClass().addClass(t.attr("class")).text(t.text()))},_submit:function(){var t=this._container.find(".formSubmit");t.find('input[type="hidden"]').each(function(t,e){var i=$(e);0===i.attr("name").indexOf("labelIDs[")&&i.remove()});for(var e in this._groups){var i=this._groups[e];i.data("labelID")&&$('<input type="hidden" name="labelIDs['+e+']" value="'+i.data("labelID")+'" />').appendTo(t)}}});
\ No newline at end of file
diff --git a/wcfsetup/install/files/js/WCF.Like.min.js b/wcfsetup/install/files/js/WCF.Like.min.js
new file mode 100644 (file)
index 0000000..0693119
--- /dev/null
@@ -0,0 +1 @@
+WCF.Like=Class.extend({_allowForOwnContent:!1,_canLike:!1,_containers:{},_containerData:{},_enableDislikes:!0,_isBusy:!1,_likeDetails:{},_likeDetailsDialog:null,_proxy:null,_showSummary:!0,init:function(t,e,i,a){this._canLike=t,this._enableDislikes=e,this._isBusy=!1,this._likeDetails={},this._likeDetailsDialog=null,this._showSummary=i,this._allowForOwnContent=a;var s=this._getContainers();this._initContainers(s),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});var n=new Date,o=n.toString().hashCode+n.getUTCMilliseconds();WCF.DOMNodeInsertedHandler.addCallback("WCF.Like"+o,$.proxy(this._domNodeInserted,this))},_domNodeInserted:function(){var t=this._getContainers();this._initContainers(t)},_initContainers:function(containers){var $createdWidgets=!1;containers.each($.proxy(function(index,container){var $container=$(container),$containerID=$container.wcfIdentify();this._containers[$containerID]||(this._containers[$containerID]=$container,this._containerData[$containerID]={likeButton:null,badge:null,dislikeButton:null,likes:$container.data("like-likes"),dislikes:$container.data("like-dislikes"),objectType:$container.data("objectType"),objectID:this._getObjectID($containerID),users:eval($container.data("like-users")),liked:$container.data("like-liked")},this._createWidget($containerID),$createdWidgets=!0)},this)),$createdWidgets&&new WCF.PeriodicalExecuter(function(t){t.stop(),WCF.DOMNodeInsertedHandler.execute()},250)},_getContainers:function(){},_getWidgetContainer:function(){},_getObjectID:function(){},_addWidget:function(t,e){var i=this._getWidgetContainer(t);e.appendTo(i)},_buildWidget:function(t,e,i,a){var s=$('<aside class="likesWidget"><ul></ul></aside>');this._canLike&&(e.appendTo(s.find("ul")),i.appendTo(s.find("ul"))),a.appendTo(s),this._addWidget(t,s)},_createWidget:function(t){var e=$('<li class="likeButton"><a title="'+WCF.Language.get("wcf.like.button.like")+'" class="jsTooltip"><span class="icon icon16 icon-thumbs-up-alt" /> <span class="invisible">'+WCF.Language.get("wcf.like.button.like")+"</span></a></li>"),i=$('<li class="dislikeButton"><a title="'+WCF.Language.get("wcf.like.button.dislike")+'" class="jsTooltip"><span class="icon icon16 icon-thumbs-down-alt" /> <span class="invisible">'+WCF.Language.get("wcf.like.button.dislike")+"</span></a></li>");this._enableDislikes||i.hide(),this._allowForOwnContent||WCF.User.userID!=this._containers[t].data("userID")||(e=$(""),i=$(""));var a=$('<a class="badge jsTooltip likesBadge" />').data("containerID",t).click($.proxy(this._showLikeDetails,this)),s=null;this._showSummary&&(s=$('<p class="likesSummary"><span class="pointer" /></p>'),s.children("span").data("containerID",t).click($.proxy(this._showLikeDetails,this))),this._buildWidget(t,e,i,a,s),this._containerData[t].likeButton=e,this._containerData[t].dislikeButton=i,this._containerData[t].badge=a,this._containerData[t].summary=s,e.data("containerID",t).data("type","like").click($.proxy(this._click,this)),i.data("containerID",t).data("type","dislike").click($.proxy(this._click,this)),this._setActiveState(e,i,this._containerData[t].liked),this._updateBadge(t),this._showSummary&&this._updateSummary(t)},_showLikeDetails:function(t,e){var i=null===t?e:$(t.currentTarget).data("containerID");void 0===this._likeDetails[i]?(this._proxy.setOption("data",{actionName:"getLikeDetails",className:"wcf\\data\\like\\LikeAction",parameters:{data:{containerID:i,objectID:this._containerData[i].objectID,objectType:this._containerData[i].objectType}}}),this._proxy.sendRequest()):null===this._likeDetailsDialog?(this._likeDetailsDialog=$("<div>"+this._likeDetails[i]+"</div>").hide().appendTo(document.body),this._likeDetailsDialog.wcfDialog({title:WCF.Language.get("wcf.like.details")})):this._likeDetailsDialog.html(this._likeDetails[i]).wcfDialog("open")},_click:function(t){var e=$(t.currentTarget);return null===e?void console.debug("[WCF.Like] Unable to find target button, aborting."):void this._sendRequest(e.data("containerID"),e.data("type"))},_sendRequest:function(t,e){this._isBusy||(this._isBusy=!0,this._proxy.setOption("data",{actionName:e,className:"wcf\\data\\like\\LikeAction",parameters:{data:{containerID:t,objectID:this._containerData[t].objectID,objectType:this._containerData[t].objectType}}}),this._proxy.sendRequest())},_success:function(t){var e=t.returnValues.containerID;if(this._containers[e])switch(t.actionName){case"dislike":case"like":this._containerData[e].likes=parseInt(t.returnValues.likes),this._containerData[e].dislikes=parseInt(t.returnValues.dislikes),this._containerData[e].users=t.returnValues.users,$.each(this._containerData[e].users,function(t,e){e.username=WCF.String.escapeHTML(e.username)}),this._updateBadge(e),this._showSummary&&this._updateSummary(e);var i=this._containerData[e].likeButton,a=this._containerData[e].dislikeButton,s=0;t.returnValues.isLiked?s=1:t.returnValues.isDisliked&&(s=-1),this._setActiveState(i,a,s),void 0!==this._likeDetails[e]&&delete this._likeDetails[e],this._isBusy=!1;break;case"getLikeDetails":this._likeDetails[e]=t.returnValues.template,this._showLikeDetails(null,e)}},_updateBadge:function(t){if(this._containerData[t].likes||this._containerData[t].dislikes){this._containerData[t].badge.show();var e=this._containerData[t].likes-this._containerData[t].dislikes,i=this._containerData[t].badge;i.removeClass("green red"),e>0?(i.text("+"+WCF.String.formatNumeric(e)),i.addClass("green")):0>e?(i.text(WCF.String.formatNumeric(e)),i.addClass("red")):i.text("±0");var a=this._containerData[t].likes,s=this._containerData[t].dislikes;i.data("tooltip",WCF.Language.get("wcf.like.tooltip",{likes:a,dislikes:s}))}else this._containerData[t].badge.hide()},_updateSummary:function(t){if(this._containerData[t].likes){this._containerData[t].summary.show();var e=this._containerData[t].users,i=[];for(var a in e)i.push(e[a].username);var s=this._containerData[t].likes-i.length;this._containerData[t].summary.children("span").html(WCF.Language.get("wcf.like.summary",{users:i,others:s}))}else this._containerData[t].summary.hide()},_setActiveState:function(t,e,i){t.removeClass("active"),e.removeClass("active"),1==i?t.addClass("active"):-1==i&&e.addClass("active")}});
\ No newline at end of file
diff --git a/wcfsetup/install/files/js/WCF.Location.min.js b/wcfsetup/install/files/js/WCF.Location.min.js
new file mode 100644 (file)
index 0000000..16552e0
--- /dev/null
@@ -0,0 +1 @@
+WCF.Location={},WCF.Location.Util={getLocation:function(e,t){navigator.geolocation?navigator.geolocation.getCurrentPosition(function(t){e(t.coords.latitude,t.coords.longitude)},function(){e(void 0,void 0)},{timeout:t||5e3}):e(void 0,void 0)}},WCF.Location.GoogleMaps={},WCF.Location.GoogleMaps.Settings={_settings:{},get:function(e){return void 0===e?this._settings:void 0!==this._settings[e]?this._settings[e]:null},set:function(e,t){if($.isPlainObject(e))for(var o in e)this._settings[o]=e[o];else this._settings[e]=t}},WCF.Location.GoogleMaps.Map=Class.extend({_map:null,_markers:[],init:function(e,t){this._mapContainer=$("#"+e),this._mapOptions=$.extend(!0,this._getDefaultMapOptions(),t),this._map=new google.maps.Map(this._mapContainer[0],this._mapOptions),this._markers=[],this._mapContainer.parents(".sidebar").length&&enquire.register("screen and (max-width: 800px)",{setup:$.proxy(this._addSidebarMapListener,this),deferSetup:!0}),this.refresh()},_addInfoWindowEventListener:function(e,t){google.maps.event.addListener(e,"click",$.proxy(function(){t.open(this._map,e)},this))},_addSidebarMapListener:function(){$(".content > .mobileSidebarToggleButton").click($.proxy(this.refresh,this))},_getDefaultMapOptions:function(){var e={};switch(e.center=new google.maps.LatLng(WCF.Location.GoogleMaps.Settings.get("defaultLatitude"),WCF.Location.GoogleMaps.Settings.get("defaultLongitude")),e.disableDoubleClickZoom=WCF.Location.GoogleMaps.Settings.get("disableDoubleClickZoom"),e.draggable=WCF.Location.GoogleMaps.Settings.get("draggable"),WCF.Location.GoogleMaps.Settings.get("mapType")){case"map":e.mapTypeId=google.maps.MapTypeId.ROADMAP;break;case"satellite":e.mapTypeId=google.maps.MapTypeId.SATELLITE;break;case"physical":e.mapTypeId=google.maps.MapTypeId.TERRAIN;break;case"hybrid":default:e.mapTypeId=google.maps.MapTypeId.HYBRID}if(e.mapTypeControl="off"!=WCF.Location.GoogleMaps.Settings.get("mapTypeControl"),e.mapTypeControl)switch(WCF.Location.GoogleMaps.Settings.get("mapTypeControl")){case"dropdown":e.mapTypeControlOptions={style:google.maps.MapTypeControlStyle.DROPDOWN_MENU};break;case"horizontalBar":e.mapTypeControlOptions={style:google.maps.MapTypeControlStyle.HORIZONTAL_BAR};break;default:e.mapTypeControlOptions={style:google.maps.MapTypeControlStyle.DEFAULT}}return e.scaleControl=WCF.Location.GoogleMaps.Settings.get("scaleControl"),e.scrollwheel=WCF.Location.GoogleMaps.Settings.get("scrollwheel"),e.zoom=WCF.Location.GoogleMaps.Settings.get("zoom"),e},addDraggableMarker:function(e,t){var o=new google.maps.Marker({clickable:!1,draggable:!0,map:this._map,position:new google.maps.LatLng(e,t),zIndex:1});return this._markers.push(o),o},addMarker:function(e,t,o,a,i){var s=new google.maps.Marker({map:this._map,position:new google.maps.LatLng(e,t),title:o});if(a&&s.setIcon(a),i){var n=new google.maps.InfoWindow({content:i});this._addInfoWindowEventListener(s,n),s.infoWindow=n}return this._markers.push(s),s},getMarkers:function(){return this._markers},getMap:function(){return this._map},refresh:function(){var e=this._map.getCenter();google.maps.event.trigger(this._map,"resize"),this._map.setCenter(e)},refreshBounds:function(){var e=null,t=null,o=null,a=null;for(var i in this._markers){var s=this._markers[i],n=s.getPosition().lat(),r=s.getPosition().lng();null===e?(e=t=n,o=a=r):(e>n?e=n:n>t&&(t=n),o>n?o=n:r>a&&(a=r))}this._map.fitBounds(new google.maps.LatLngBounds(new google.maps.LatLng(e,o),new google.maps.LatLng(t,a)))},removeMarkers:function(){for(var e in this._markers)this._markers[e].setMap(null);this._markers=[]},setCenter:function(e,t){this._map.setCenter(new google.maps.LatLng(e,t))}}),WCF.Location.GoogleMaps.LargeMap=WCF.Location.GoogleMaps.Map.extend({_actionClassName:null,_locationSearch:null,_locationSearchInputSelector:null,_markerClusterer:null,_objectIDs:[],_previousNorthEast:null,_previousSouthWest:null,init:function(e,t,o,a){this._super(e,t),this._actionClassName=o,this._locationSearchInputSelector=a||"",this._objectIDs=[],this._locationSearchInputSelector&&(this._locationSearch=new WCF.Location.GoogleMaps.LocationSearch(a,$.proxy(this._centerMap,this))),this._markerClusterer=new MarkerClusterer(this._map,this._markers,{maxZoom:17}),this._markerSpiderfier=new OverlappingMarkerSpiderfier(this._map,{keepSpiderfied:!0,markersWontHide:!0,markersWontMove:!0}),this._markerSpiderfier.addListener("click",$.proxy(function(e){e.infoWindow&&e.infoWindow.open(this._map,e)},this)),this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1,success:$.proxy(this._success,this)}),this._previousNorthEast=null,this._previousSouthWest=null,google.maps.event.addListener(this._map,"idle",$.proxy(this._loadMarkers,this))},_addInfoWindowEventListener:function(){},_centerMap:function(e){this.setCenter(e.location.lat(),e.location.lng()),$(this._locationSearchInputSelector).val(e.label)},_loadMarkers:function(){var e=this._map.getBounds().getNorthEast(),t=this._map.getBounds().getSouthWest();this._previousNorthEast&&this._previousNorthEast.lat()>=e.lat()&&this._previousNorthEast.lng()>=e.lng()&&this._previousSouthWest.lat()<=t.lat()&&this._previousSouthWest.lng()<=t.lng()||(this._previousNorthEast=e,this._previousSouthWest=t,this._proxy.setOption("data",{actionName:"getMapMarkers",className:this._actionClassName,parameters:{excludedObjectIDs:this._objectIDs,eastLongitude:e.lng(),northLatitude:e.lat(),southLatitude:t.lat(),westLongitude:t.lng()}}),this._proxy.sendRequest())},_success:function(e){if(e.returnValues&&e.returnValues.markers)for(var t in e.returnValues.markers){var o=e.returnValues.markers[t];this.addMarker(o.latitude,o.longitude,o.title,null,o.infoWindow),o.objectID?this._objectIDs.push(o.objectID):o.objectIDs&&(this._objectIDs=this._objectIDs.concat(o.objectIDs))}},addMarker:function(e,t,o,a,i){var s=this._super(e,t,o,a,i);return this._markerClusterer.addMarker(s),this._markerSpiderfier.addMarker(s),s}}),WCF.Location.GoogleMaps.LocationSearch=WCF.Search.Base.extend({_geocoder:null,init:function(e,t,o,a,i){this._super(e,t,o,a,i),this._geocoder=new google.maps.Geocoder},_createListItem:function(e){var t=$("<li><span>"+WCF.String.escapeHTML(e.formatted_address)+"</span></li>").appendTo(this._list);return t.data("location",e.geometry.location).data("label",e.formatted_address).click($.proxy(this._executeCallback,this)),this._itemCount++,t},_keyUp:function(e){switch(e.which){case $.ui.keyCode.LEFT:case $.ui.keyCode.RIGHT:return;case $.ui.keyCode.UP:return void this._selectPreviousItem();case $.ui.keyCode.DOWN:return void this._selectNextItem();case $.ui.keyCode.ENTER:return this._selectElement(e)}var t=this._getSearchString(e);""===t?this._clearList(!0):t.length>=this._triggerLength?this._geocoder.geocode({address:t},$.proxy(this._success,this)):this._clearList(!1)},_success:function(e,t){if(this._clearList(!1),t==google.maps.GeocoderStatus.OK){if($.getLength(e)){var o=0;for(var a in e)if(this._createListItem(e[a]),10==++o)break}else if(!this._handleEmptyResult())return;WCF.CloseOverlayHandler.addCallback("WCF.Search.Base",$.proxy(function(){this._clearList()},this));var i=this._searchInput.parents(".dropdown").wcfIdentify();WCF.Dropdown.getDropdownMenu(i).hasClass("dropdownOpen")||WCF.Dropdown.toggleDropdown(i),this._itemIndex=-1,WCF.Dropdown.getDropdown(i).data("disableAutoFocus")||this._selectNextItem()}}}),WCF.Location.GoogleMaps.LocationInput=Class.extend({_locationSearch:null,_map:null,_marker:null,init:function(e,t,o,a,i){this._searchInput=o,this._map=new WCF.Location.GoogleMaps.Map(e,t),this._locationSearch=new WCF.Location.GoogleMaps.LocationSearch(o,$.proxy(this._setMarkerByLocation,this)),a&&i?this._marker=this._map.addDraggableMarker(a,i):(this._marker=this._map.addDraggableMarker(WCF.Location.GoogleMaps.Settings.get("defaultLatitude"),WCF.Location.GoogleMaps.Settings.get("defaultLongitude")),WCF.Location.Util.getLocation($.proxy(function(e,t){void 0!==e&&void 0!==t&&(WCF.Location.GoogleMaps.Util.moveMarker(this._marker,e,t),WCF.Location.GoogleMaps.Util.focusMarker(this._marker))},this))),this._marker.addListener("dragend",$.proxy(this._updateLocation,this))},getMap:function(){return this._map},getMarker:function(){return this._marker},_updateLocation:function(){WCF.Location.GoogleMaps.Util.reverseGeocoding($.proxy(function(e){null!==e&&$(this._searchInput).val(e)},this),this._marker)},_setMarkerByLocation:function(e){this._marker.setPosition(e.location),WCF.Location.GoogleMaps.Util.focusMarker(this._marker),$(this._searchInput).val(e.label)}}),WCF.Location.GoogleMaps.Util={_geocoder:null,focusMarker:function(e){e.getMap().setCenter(e.getPosition())},getMarkerPosition:function(e){return{latitude:e.getPosition().lat(),longitude:e.getPosition().lng()}},moveMarker:function(e,t,o,a){e.setPosition(new google.maps.LatLng(t,o)),a&&google.maps.event.trigger(e,"dragend")},reverseGeocoding:function(e,t,o,a,i){t&&(o=t.getPosition().lat(),a=t.getPosition().lng()),null===this._geocoder&&(this._geocoder=new google.maps.Geocoder);var s=new google.maps.LatLng(o,a);this._geocoder.geocode({latLng:s},function(t,o){e(o==google.maps.GeocoderStatus.OK?i?t:t[0].formatted_address:null)})}};
\ No newline at end of file
diff --git a/wcfsetup/install/files/js/WCF.Message.min.js b/wcfsetup/install/files/js/WCF.Message.min.js
new file mode 100644 (file)
index 0000000..072aa95
--- /dev/null
@@ -0,0 +1,3 @@
+WCF.Message={},WCF.Message.BBCode={},WCF.Message.BBCode.CodeViewer=Class.extend({_dialog:null,init:function(){this._dialog=null,this._initCodeBoxes(),WCF.DOMNodeInsertedHandler.addCallback("WCF.Message.BBCode.CodeViewer",$.proxy(this._initCodeBoxes,this)),WCF.DOMNodeInsertedHandler.execute()},_initCodeBoxes:function(){$(".codeBox:not(.jsCodeViewer)").each($.proxy(function(e,t){var i=$(t).addClass("jsCodeViewer");$('<span class="icon icon16 icon-copy pointer jsTooltip" title="'+WCF.Language.get("wcf.message.bbcode.code.copy")+'" />').appendTo(i.find("div > h3")).click($.proxy(this._click,this))},this))},_click:function(e){var t="";$(e.currentTarget).parents("div").next("ol").children("li").each(function(e,i){t&&(t+="\n"),t+=$(i).text().replace(/\n+$/,"")}),null===this._dialog?(this._dialog=$('<div><textarea cols="60" rows="12" readonly="readonly" /></div>').hide().appendTo(document.body),this._dialog.children("textarea").val(t),this._dialog.wcfDialog({title:WCF.Language.get("wcf.message.bbcode.code.copy")})):(this._dialog.children("textarea").val(t),this._dialog.wcfDialog("open")),this._dialog.children("textarea").select()}}),WCF.Message.FormGuard=Class.extend({init:function(){var e=$("form.jsFormGuard").removeClass("jsFormGuard").submit(function(){$(this).find(".formSubmit input[type=submit]").disable()});$(window).unload(function(){e.find(".formSubmit input[type=submit]").enable()})}}),WCF.Message.Preview=Class.extend({_className:"",_messageFieldID:"",_messageField:null,_proxy:null,_previewButton:null,_previewButtonLabel:"",init:function(e,t,i){return this._className=e,this._messageFieldID=$.wcfEscapeID(t),this._messageField=$("#"+this._messageFieldID),this._messageField.length?(i=$.wcfEscapeID(i),this._previewButton=$("#"+i),this._previewButton.length?(this._previewButton.click($.proxy(this._click,this)),void(this._proxy=new WCF.Action.Proxy({failure:$.proxy(this._failure,this),success:$.proxy(this._success,this)}))):void console.debug("[WCF.Message.Preview] Unable to find preview button identified by '"+i+"'")):void console.debug("[WCF.Message.Preview] Unable to find message field identified by '"+this._messageFieldID+"'")},_click:function(e){var t=this._getMessage();return null===t?void console.debug("[WCF.Message.Preview] Unable to access ckEditor instance of '"+this._messageFieldID+"'"):(this._proxy.setOption("data",{actionName:"getMessagePreview",className:this._className,parameters:this._getParameters(t)}),this._proxy.sendRequest(),this._previewButtonLabel=this._previewButton.html(),this._previewButton.html(WCF.Language.get("wcf.global.loading")).disable(),e.stopPropagation(),!1)},_getParameters:function(e){var t={};return $("#settings").find("input[type=checkbox]").each(function(e,i){var s=$(i);s.is(":checked")&&(t[s.prop("name")]=s.prop("value"))}),{data:{message:e},options:t}},_getMessage:function(){if(!$.browser.ckeditor)return this._messageField.val();if(this._messageField.data("ckeditorInstance")){var e=this._messageField.ckeditorGet();return e.getData()}return null},_success:function(e){this._previewButton.html(this._previewButtonLabel).enable(),this._messageField.parent().children("small.innerError").remove(),this._handleResponse(e)},_handleResponse:function(){},_failure:function(e){if(null===e||void 0===e.returnValues||void 0===e.returnValues.errorType)return!0;this._previewButton.html(this._previewButtonLabel).enable();var t=this._messageField.next("small.innerError").empty();return t.length||(t=$('<small class="innerError" />').appendTo(this._messageField.parent())),t.html(e.returnValues.errorType),!1}}),WCF.Message.DefaultPreview=WCF.Message.Preview.extend({_attachmentObjectType:null,_attachmentObjectID:null,_tmpHash:null,init:function(e,t,i){this._super("wcf\\data\\bbcode\\MessagePreviewAction","text","previewButton"),this._attachmentObjectType=e||null,this._attachmentObjectID=t||null,this._tmpHash=i||null},_handleResponse:function(e){var t=$("#previewContainer");t.length||(t=$('<div class="container containerPadding marginTop" id="previewContainer"><fieldset><legend>'+WCF.Language.get("wcf.global.preview")+"</legend><div></div></fieldset>").prependTo($("#messageContainer")).wcfFadeIn()),t.find("div:eq(0)").html(e.returnValues.message),(new WCF.Effect.Scroll).scrollTo(t)},_getParameters:function(e){var t=this._super(e);return null!=this._attachmentObjectType&&(t.attachmentObjectType=this._attachmentObjectType,t.attachmentObjectID=this._attachmentObjectID,t.tmpHash=this._tmpHash),t}}),WCF.Message.Multilingualism=Class.extend({_availableLanguages:{},_languageID:0,_languageInput:null,init:function(e,t,i){if(this._availableLanguages=t,this._languageID=e||0,this._languageInput=$("#languageID"),this._updateLabel(),this._languageInput.find(".dropdownMenu > li").click($.proxy(this._click,this)),!i){var s=this._languageInput.find(".dropdownMenu");$('<li class="dropdownDivider" />').appendTo(s),$('<li><span><span class="badge">'+this._availableLanguages[0]+"</span></span></li>").click($.proxy(this._disable,this)).appendTo(s)}this._languageInput.parents("form").submit($.proxy(this._submit,this))},_click:function(e){this._languageID=$(e.currentTarget).data("languageID"),this._updateLabel()},_disable:function(){this._languageID=0,this._updateLabel()},_updateLabel:function(){this._languageInput.find(".dropdownToggle > span").text(this._availableLanguages[this._languageID])},_submit:function(){this._languageInput.next("input[name=languageID]").prop("value",this._languageID)}}),WCF.Message.SmileyCategories=Class.extend({_cache:[],_proxy:null,_ckEditor:null,init:function(){this._cache=[],this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),$("#smilies").on("wcftabsbeforeactivate",$.proxy(this._click,this));var e=this;new WCF.PeriodicalExecuter(function(t){t.stop(),e._click({},{newTab:$("#smilies > .menu li.ui-state-active")})},100)},_click:function(e,t){var i=parseInt($(t.newTab).children("a").data("smileyCategoryID"));i&&!WCF.inArray(i,this._cache)&&(this._proxy.setOption("data",{actionName:"getSmilies",className:"wcf\\data\\smiley\\category\\SmileyCategoryAction",objectIDs:[i]}),this._proxy.sendRequest())},_success:function(e){var t=parseInt(e.returnValues.smileyCategoryID);this._cache.push(t),$("#smilies-"+t).html(e.returnValues.template)}}),WCF.Message.Smilies=Class.extend({_ckEditor:null,init:function(e){e&&(this._ckEditor=$("#"+e),$(document).on("click",".jsSmiley",$.proxy(this._smileyClick,this)))},_smileyClick:function(e){var t=$(e.currentTarget),i=t.data("smileyCode"),s=t.data("smileyPath"),n=this._ckEditor.ckeditorGet();if(WCF.inArray(i,n.config.smiley_descriptions)||(n.config.smiley_descriptions.push(i),n.config.smiley_images.push(s)),"wysiwyg"===n.mode){var a=n.document.createElement("img",{attributes:{src:n.config.smiley_path+s,class:"smiley",alt:i}});n.insertText(" "),n.insertElement(a),n.insertText(" ")}else{var o=this._ckEditor.next(".cke_editor_text").find("textarea"),r=o.val();if(0==r.length)o.val(i),o.setCaret(i.length);else{var l=o.getCaret(),c=(" "!==r.substr(l-1,1)?" ":"")+i+" ";o.val(r.substr(0,l)+c+r.substr(l)),o.setCaret(l+c.length)}}}}),WCF.Message.QuickReply=Class.extend({_container:null,_messageField:null,_notification:null,_pendingSave:!1,_proxy:null,_quoteManager:null,_scrollHandler:null,_successMessageNonVisible:"",init:function(e,t){if(this._container=$("#messageQuickReply"),this._container.children(".message").addClass("jsInvalidQuoteTarget"),this._messageField=$("#text"),this._pendingSave=!1,this._container&&this._messageField){var i=this._container.find(".formSubmit");i.find("button[data-type=save]").click($.proxy(this._save,this)),e&&i.find("button[data-type=extended]").click($.proxy(this._prepareExtended,this)),i.find("button[data-type=cancel]").click($.proxy(this._cancel,this)),t&&(this._quoteManager=t),$(".jsQuickReply").data("__api",this).click($.proxy(this.click,this)),this._proxy=new WCF.Action.Proxy({failure:$.proxy(this._failure,this),showLoadingOverlay:!1,success:$.proxy(this._success,this)}),this._scroll=new WCF.Effect.Scroll,this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success.add")),this._successMessageNonVisible=""}},click:function(e){if(this._container.toggle(),this._container.is(":visible")&&(this._scroll.scrollTo(this._container,!0),WCF.Message.Submit.registerButton("text",this._container.find(".formSubmit button[data-type=save]")),this._quoteManager)){var t=!0;if($.browser.ckeditor){var i=this;this._messageField.ckeditor(function(){t=!$.trim(this.getData()).length,i._ckeditorCallback(t)})}else t=!this._messageField.val().length,this._ckeditorCallback(t)}return null!==e?(e.stopPropagation(),!1):void 0},_ckeditorCallback:function(e){e&&this._quoteManager.insertQuotes(this._getClassName(),this._getObjectID(),$.proxy(this._insertQuotes,this)),$.browser.ckeditor?this._messageField.ckeditorGet().ui.editor.focus():this._messageField.focus()},getContainer:function(){return this._container},_insertQuotes:function(e){if(e.returnValues.template)if($.browser.ckeditor){var t=this._messageField.ckeditorGet();if(null===t.getSelection().getStartElement()){var i=t.createRange();i.moveToPosition(i.root,CKEDITOR.POSITION_BEFORE_END),t.getSelection().selectRanges([i])}t.insertText(e.returnValues.template)}else this._messageField.val(e.returnValues.template)},_save:function(){if(!this._pendingSave){var e="";if($.browser.ckeditor){var t=this._messageField.ckeditorGet();e=$.trim(t.getData())}else e=$.trim(this._messageField.val());var i=this._messageField.parent().find("small.innerError");if(""===e||"0"===e)return i.length||(i=$('<small class="innerError" />').appendTo(this._messageField.parent())),void i.html(WCF.Language.get("wcf.global.form.error.empty"));i.remove(),this._pendingSave=!0,this._proxy.setOption("data",{actionName:"quickReply",className:this._getClassName(),interfaceName:"wcf\\data\\IMessageQuickReplyAction",parameters:this._getParameters(e)}),this._proxy.sendRequest();var s=this._container.find(".messageQuickReplyContent .messageBody");$('<span class="icon icon48 icon-spinner" />').appendTo(s),s.children("#cke_text").hide().end().next().hide()}},_getParameters:function(e){var t={objectID:this._getObjectID(),data:{message:e},lastPostTime:this._container.data("lastPostTime"),pageNo:this._container.data("pageNo"),removeQuoteIDs:null===this._quoteManager?[]:this._quoteManager.getQuotesMarkedForRemoval()};return this._container.data("anchor")&&(t.anchor=this._container.data("anchor")),t},_cancel:function(){this._revertQuickReply(!0),$.browser.ckeditor?this._messageField.ckeditorGet().setData(""):this._messageField.val("")},_revertQuickReply:function(e){var t=this._container.find(".messageQuickReplyContent .messageBody");e&&(this._container.hide(),t.children("small.innerError").remove()),t.children(".icon-spinner").remove(),t.children("#cke_text").show(),t.next().show()},_prepareExtended:function(){this._pendingSave=!0,null!==this._quoteManager&&this._quoteManager.markQuotesForRemoval();var e="";if($.browser.ckeditor){var t=this._messageField.ckeditorGet();e=t.getData()}else e=this._messageField.val();new WCF.Action.Proxy({autoSend:!0,data:{actionName:"jumpToExtended",className:this._getClassName(),interfaceName:"wcf\\data\\IExtendedMessageQuickReplyAction",parameters:{containerID:this._getObjectID(),message:e}},success:function(e){window.location=e.returnValues.url}})},_success:function(e){if(e.returnValues.url)window.location=e.returnValues.url;else{if(e.returnValues.template){var t=$(""+e.returnValues.template);"DESC"==this._container.data("sortOrder")?t.insertAfter(this._container):t.insertBefore(this._container),this._container.data("lastPostTime",e.returnValues.lastPostTime),this._notification.show(void 0,void 0,WCF.Language.get("wcf.global.success.add")),this._updateHistory(t.wcfIdentify())}else{var t=this._successMessageNonVisible?this._successMessageNonVisible:"wcf.global.success.add";this._notification.show(void 0,5e3,WCF.Language.get(t))}$.browser.ckeditor?this._messageField.ckeditorGet().setData(""):this._messageField.val(""),this._revertQuickReply(!0),null!==this._quoteManager&&this._quoteManager.countQuotes(),this._pendingSave=!1}},_failure:function(e){if(this._pendingSave=!1,this._revertQuickReply(!1),null===e||void 0===e.returnValues||void 0===e.returnValues.errorType)return!0;var t=this._container.find(".messageQuickReplyContent .messageBody"),i=t.children("small.innerError").empty();return i.length||(i=$('<small class="innerError" />').appendTo(t)),i.html(e.returnValues.errorType),!1},_getClassName:function(){return""},_getObjectID:function(){return 0},_updateHistory:function(e){window.location.hash=e}}),WCF.Message.InlineEditor=Class.extend({_activeElementID:"",_cache:"",_container:{},_containerID:0,_dropdowns:{},_messageContainerSelector:".jsMessage",_messageEditorIDPrefix:"messageEditor",_notification:null,_proxy:null,_quoteManager:null,_supportExtendedForm:!1,init:function(e,t,i){this._activeElementID="",this._cache="",this._container={},this._containerID=parseInt(e),this._dropdowns={},this._quoteManager=i||null,this._supportExtendedForm=t?!0:!1,this._proxy=new WCF.Action.Proxy({failure:$.proxy(this._failure,this),showLoadingOverlay:!1,success:$.proxy(this._success,this)}),this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success.edit")),this.initContainers(),WCF.DOMNodeInsertedHandler.addCallback("WCF.Message.InlineEditor",$.proxy(this.initContainers,this))},initContainers:function(){$(this._messageContainerSelector).each($.proxy(function(e,t){var i=$(t),s=i.wcfIdentify();if(!this._container[s])if(this._container[s]=i,i.data("canEditInline")){var n=i.find(".jsMessageEditButton:eq(0)").data("containerID",s).click($.proxy(this._clickInline,this));i.data("canEdit")&&n.dblclick($.proxy(this._click,this))}else i.data("canEdit")&&i.find(".jsMessageEditButton:eq(0)").data("containerID",s).click($.proxy(this._click,this))},this))},_click:function(e,t){var i=null===e?t:$(e.currentTarget).data("containerID");if(""===this._activeElementID)this._activeElementID=i,this._prepare(),this._proxy.setOption("data",{actionName:"beginEdit",className:this._getClassName(),interfaceName:"wcf\\data\\IMessageInlineEditorAction",parameters:{containerID:this._containerID,objectID:this._container[i].data("objectID")}}),this._proxy.setOption("failure",$.proxy(function(){this._cancel()},this)),this._proxy.sendRequest();else{var s=new WCF.System.Notification(WCF.Language.get("wcf.message.error.editorAlreadyInUse"),"warning");s.show()}return this._dropdowns[this._container[i].data("objectID")]&&this._dropdowns[this._container[i].data("objectID")].removeClass("dropdownOpen"),null!==e?(e.stopPropagation(),!1):void 0},_clickInline:function(e){var t=$(e.currentTarget);if(!t.hasClass("dropdownToggle")){var i=t.data("containerID");t.addClass("dropdownToggle").parent().addClass("dropdown");var s=$('<ul class="dropdownMenu" />').insertAfter(t);this._initDropdownMenu(i,s),WCF.DOMNodeInsertedHandler.execute(),this._dropdowns[this._container[i].data("objectID")]=s,WCF.Dropdown.registerCallback(t.parent().wcfIdentify(),$.proxy(this._toggleDropdown,this)),t.trigger("click")}return e.stopPropagation(),!1},_failure:function(e){if(this._revertEditor(),null===e||void 0===e.returnValues||void 0===e.returnValues.errorType)return!0;var t=this._container[this._activeElementID].find(".messageBody .messageInlineEditor"),i=t.children("small.innerError").empty();return i.length||(i=$('<small class="innerError" />').insertBefore(t.children(".formSubmit"))),i.html(e.returnValues.errorType),!1},_toggleDropdown:function(e){WCF.Dropdown.getDropdown(e).parents(".messageOptions").toggleClass("forceOpen")},_initDropdownMenu:function(){},_prepare:function(){var e=this._container[this._activeElementID].find(".messageBody");$('<span class="icon icon48 icon-spinner" />').appendTo(e);var t=e.find(".messageText");t.parent().children(".jsInlineEditorHideContent").hide(),this._cache=t.detach()},_cancel:function(){var e=this._container[this._activeElementID].removeClass("jsInvalidQuoteTarget");try{var t=$("#"+this._messageEditorIDPrefix+e.data("objectID")).ckeditorGet();t.destroy()}catch(e){}var i=e.find(".messageBody");i.children(".icon-spinner").remove(),i.children("div:eq(0)").html(this._cache),i.find(".jsInlineEditorHideContent").show(),this._container[this._activeElementID].find(".messageOptions").removeClass("forceHidden"),this._activeElementID="",this._quoteManager&&this._quoteManager.clearAlternativeCKEditor()},_success:function(e){switch(e.returnValues.actionName){case"beginEdit":this._showEditor(e);break;case"save":this._showMessage(e)}},_showEditor:function(e){this._proxy.setOption("failure",$.proxy(this._failure,this));var t=this._container[this._activeElementID].addClass("jsInvalidQuoteTarget").find(".messageBody");t.children(".icon-spinner").remove();var i=t.children("div:eq(0)");$(""+e.returnValues.template).appendTo(i);var s=i.find(".formSubmit"),n=s.find("button[data-type=save]").click($.proxy(this._save,this));this._supportExtendedForm&&s.find("button[data-type=extended]").click($.proxy(this._prepareExtended,this)),s.find("button[data-type=cancel]").click($.proxy(this._cancel,this)),WCF.Message.Submit.registerButton(this._messageEditorIDPrefix+this._container[this._activeElementID].data("objectID"),n),this._container[this._activeElementID].find(".messageOptions").addClass("forceHidden"),$.browser.ckeditor?new WCF.PeriodicalExecuter($.proxy(function(e){e.stop();var t=$("#"+this._messageEditorIDPrefix+this._container[this._activeElementID].data("objectID"));t.ckeditor(function(){this.ui.editor.focus()}),this._quoteManager&&this._quoteManager.setAlternativeCKEditor(t)},this),250):$("#"+this._messageEditorIDPrefix+this._container[this._activeElementID].data("objectID")).focus()},_revertEditor:function(){var e=this._container[this._activeElementID].removeClass("jsInvalidQuoteTarget").find(".messageBody");e.children("span.icon-spinner").remove(),e.children("div:eq(0)").children().show(),e.find(".jsInlineEditorHideContent").show(),this._quoteManager&&this._quoteManager.clearAlternativeCKEditor()},_save:function(){var e=this._container[this._activeElementID],t=e.data("objectID"),i="";if($.browser.ckeditor){var s=$("#"+this._messageEditorIDPrefix+t).ckeditorGet();i=s.getData()}else i=$("#"+this._messageEditorIDPrefix+t).val();this._proxy.setOption("data",{actionName:"save",className:this._getClassName(),interfaceName:"wcf\\data\\IMessageInlineEditorAction",parameters:{containerID:this._containerID,data:{message:i},objectID:t}}),this._proxy.sendRequest(),this._hideEditor()},_prepareExtended:function(){var e=this._container[this._activeElementID],t=e.data("objectID"),i="";if($.browser.ckeditor){var s=$("#"+this._messageEditorIDPrefix+t).ckeditorGet();i=s.getData()}else i=$("#"+this._messageEditorIDPrefix+t).val();new WCF.Action.Proxy({autoSend:!0,data:{actionName:"jumpToExtended",className:this._getClassName(),parameters:{containerID:this._containerID,message:i,messageID:t}},success:function(e){window.location=e.returnValues.url}})},_hideEditor:function(){var e=this._container[this._activeElementID].removeClass("jsInvalidQuoteTarget").find(".messageBody");$('<span class="icon icon48 icon-spinner" />').appendTo(e),e.children("div:eq(0)").children().hide(),e.find(".jsInlineEditorHideContent").show(),this._quoteManager&&this._quoteManager.clearAlternativeCKEditor()},_showMessage:function(e){var t=this._container[this._activeElementID].removeClass("jsInvalidQuoteTarget"),i=t.find(".messageBody");i.children(".icon-spinner").remove();var s=i.children("div:eq(0)");if(s.parent().children(".jsInlineEditorHideContent").show(),this._container[this._activeElementID].find(".messageOptions").removeClass("forceHidden"),$.browser.ckeditor){var n=$("#"+this._messageEditorIDPrefix+t.data("objectID")).ckeditorGet();n.destroy()}s.empty(),s.html('<div class="messageText">'+e.returnValues.message+"</div>"),this._activeElementID="",this._updateHistory(this._getHash(t.data("objectID"))),this._notification.show(),this._quoteManager&&this._quoteManager.clearAlternativeCKEditor()},_getClassName:function(){return""},_getHash:function(e){return"#message"+e},_updateHistory:function(e){window.location.hash=e}}),WCF.Message.Submit={_buttons:{},registerButton:function(e,t){WCF.Browser.isChrome()&&(this._buttons[e]=$(t))},execute:function(e){this._buttons[e]&&this._buttons[e].trigger("click")}},WCF.Message.Quote={},WCF.Message.Quote.Handler=Class.extend({_activeContainerID:"",_className:"",_containers:{},_containerSelector:"",_copyQuote:null,_message:"",_messageBodySelector:"",_objectID:0,_objectType:"",_proxy:null,_quoteManager:null,init:function(e,t,i,s,n,a){return this._className=t,""==this._className?void console.debug("[WCF.Message.QuoteManager] Empty class name given, aborting."):(this._objectType=i,""==this._objectType?void console.debug("[WCF.Message.QuoteManager] Empty object type name given, aborting."):(this._containerSelector=s,this._message="",this._messageBodySelector=n,this._messageContentSelector=a,this._objectID=0,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._initContainers(),this._initCopyQuote(),$(document).mouseup($.proxy(this._mouseUp,this)),this._quoteManager=e,this._quoteManager.register(this._objectType,this),void WCF.DOMNodeInsertedHandler.addCallback("WCF.Message.Quote.Handler"+i.hashCode(),$.proxy(this._initContainers,this))))},_initContainers:function(){var e=this;$(this._containerSelector).each(function(t,i){var s=$(i),n=s.wcfIdentify();if(!e._containers[n]){if(e._containers[n]=s,s.hasClass("jsInvalidQuoteTarget"))return!0;null!==e._messageBodySelector&&(s=s.find(e._messageBodySelector).data("containerID",n)),s.mousedown($.proxy(e._mouseDown,e)),e._containers[n].find(".jsQuoteMessage").click($.proxy(e._saveFullQuote,e))}})},_mouseDown:function(e){this._copyQuote.hide();var t=$(e.currentTarget);return this._messageBodySelector&&(t=this._containers[t.data("containerID")]),t.hasClass("jsInvalidQuoteTarget")?void(this._activeContainerID=""):(this._activeContainerID=t.wcfIdentify(),void($.browser.mozilla&&t.find("img").each(function(){var e=$(this);e.data("__alt",e.attr("alt")).removeAttr("alt")})))},_getNodeText:function(e){for(var t="",i=0;i<e.childNodes.length;i++)if(3==e.childNodes[i].nodeType)t+=e.childNodes[i].nodeValue;else{if(!e.childNodes[i].tagName)continue;var s=e.childNodes[i].tagName.toLowerCase();"li"===s?t+="\r\n":"td"!==s||$.browser.msie||(t+="\r\n"),t+=this._getNodeText(e.childNodes[i]),"ul"===s&&(t+="\n")}return t},_mouseUp:function(){if(""==this._activeContainerID)return void this._copyQuote.hide();var e=this._containers[this._activeContainerID],t=this._getSelectedText(),i=$.trim(t);if(""==i)return void this._copyQuote.hide();var s=null;if(s=this._getNodeText(this._messageBodySelector?e.find(this._messageContentSelector).get(0):e.get(0)),-1!==this._normalize(s).indexOf(this._normalize(i))){this._copyQuote.show();var n=this._getBoundingRectangle(e,t),a=this._copyQuote.getDimensions("outer"),o=(n.right-n.left)/2-a.width/2+n.left;this._copyQuote.css({top:n.top-a.height-7+"px",left:o+"px"}),this._copyQuote.hide(),this._activeContainerID="";var r=this;new WCF.PeriodicalExecuter(function(t){t.stop();var i=$.trim(r._getSelectedText());""!=i&&(r._copyQuote.show(),r._message=i,r._objectID=e.data("objectID"),$.browser.mozilla&&e.find("img").each(function(){var e=$(this);e.attr("alt",e.data("__alt"))}))},10)}},_normalize:function(e){return e.replace(/\r?\n|\r/g,"\n").replace(/\s/g," ").replace(/\s{2,}/g," ")},_getOffset:function(e,t){e.collapse(t);var i=WCF.getRandomID(),s=document.createElement("span");s.innerHTML='<span id="'+i+'"></span>';for(var n,a=document.createDocumentFragment();n=s.firstChild;)a.appendChild(n);e.insertNode(a),s=$("#"+i);var o=s.offset();return o.top=o.top-$(window).scrollTop(),s.remove(),o},_getBoundingRectangle:function(e,t){var i=null;if(document.createRange&&"undefined"!=typeof document.createRange().getBoundingClientRect){if(t.rangeCount>0){var s=(t.getRangeAt(0).getClientRects(),t.getRangeAt(0).getBoundingClientRect()),n=$(document),a=n.scrollTop();i={left:s.left,right:s.right,top:s.top+a}}}else if(document.selection&&"Control"!=document.selection.type){var o=document.selection.createRange();i={left:o.boundingLeft,right:o.boundingRight,top:o.boundingTop}}return i},_saveSelection:function(e){if(window.getSelection&&document.createRange){var t=window.getSelection().getRangeAt(0),i=t.cloneRange();i.selectNodeContents(e),i.setEnd(t.startContainer,t.startOffset);var s=i.toString().length;return{start:s,end:s+t.toString().length}}var n=document.selection.createRange(),a=document.body.createTextRange();a.moveToElementText(e),a.setEndPoint("EndToStart",n);var s=a.text.length;return{start:s,end:s+n.text.length}},_restoreSelection:function(e,t){if(window.getSelection&&document.createRange){var i=0,s=document.createRange();s.setStart(e,0),s.collapse(!0);for(var n,a=[e],o=!1,r=!1;!r&&(n=a.pop());)if(3==n.nodeType){var l=i+n.length;!o&&t.start>=i&&t.start<=l&&(s.setStart(n,t.start-i),o=!0),o&&t.end>=i&&t.end<=l&&(s.setEnd(n,t.end-i),r=!0),i=l}else for(var c=n.childNodes.length;c--;)a.push(n.childNodes[c]);var d=window.getSelection();d.removeAllRanges(),d.addRange(s)}else{var h=document.body.createTextRange();h.moveToElementText(e),h.collapse(!0),h.moveEnd("character",t.end),h.moveStart("character",t.start),h.select()}},_initCopyQuote:function(){this._copyQuote=$("#quoteManagerCopy"),this._copyQuote.length||(this._copyQuote=$('<div id="quoteManagerCopy" class="balloonTooltip"><span>'+WCF.Language.get("wcf.message.quote.quoteSelected")+'</span><span class="pointer"><span></span></span></div>').hide().appendTo(document.body),this._copyQuote.click($.proxy(this._saveQuote,this)))},_getSelectedText:function(){return window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection?document.selection.createRange().text:""},_saveFullQuote:function(e){var t=$(e.currentTarget);return this._proxy.setOption("data",{actionName:"saveFullQuote",className:this._className,interfaceName:"wcf\\data\\IMessageQuoteAction",objectIDs:[t.data("objectID")]}),this._proxy.sendRequest(),t.data("isQuoted")?t.data("isQuoted",!1).children("a").removeClass("active"):t.data("isQuoted",!0).children("a").addClass("active"),e.stopPropagation(),!1},_saveQuote:function(){this._proxy.setOption("data",{actionName:"saveQuote",className:this._className,interfaceName:"wcf\\data\\IMessageQuoteAction",objectIDs:[this._objectID],parameters:{message:this._message}}),this._proxy.sendRequest()},_success:function(e){if(void 0!==e.returnValues.count){var t=void 0!==e.fullQuoteObjectIDs?e.fullQuoteObjectIDs:{};this._quoteManager.updateCount(e.returnValues.count,t)}},updateFullQuoteObjectIDs:function(e){for(var t in this._containers)this._containers[t].find(".jsQuoteMessage").each(function(t,i){var s=$(i).data("isQuoted",0);s.children("a").removeClass("active"),WCF.inArray(s.data("objectID"),e)&&s.data("isQuoted",1).children("a").addClass("active")})}}),WCF.Message.Quote.Manager=Class.extend({_buttons:{},_ckEditor:null,_ckEditorAlternative:null,_count:0,_dialog:null,_form:null,_handlers:{},_hasTemplate:!1,_insertQuotes:!0,_proxy:null,_removeOnSubmit:[],_showQuotes:null,_supportPaste:!1,init:function(e,t,i,s){this._buttons={insert:null,remove:null},this._ckEditor=null,this._ckEditorAlternative=null,this._count=parseInt(e)||0,this._dialog=null,this._form=null,this._handlers={},this._hasTemplate=!1,this._insertQuotes=!0,this._removeOnSubmit=[],this._showQuotes=null,this._supportPaste=!1,t&&(this._ckEditor=$("#"+t),this._ckEditor.length&&(this._supportPaste=!0,this._form=this._ckEditor.parents("form:eq(0)"),this._form.length?(this._form.submit($.proxy(this._submit,this)),this._removeOnSubmit=s||[]):(this._form=null,this._supportPaste=i===!0?!0:!1))),this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1,success:$.proxy(this._success,this),url:"index.php/MessageQuote/?t="+SECURITY_TOKEN+SID_ARG_2ND}),this._toggleShowQuotes()},setAlternativeCKEditor:function(e){this._ckEditorAlternative=e},clearAlternativeCKEditor:function(){this._ckEditorAlternative=null},register:function(e,t){this._handlers[e]=t},updateCount:function(e,t){this._count=parseInt(e)||0,this._toggleShowQuotes();for(var i in this._handlers)t[i]&&this._handlers[i].updateFullQuoteObjectIDs(t[i])},insertQuotes:function(e,t,i){return this._insertQuotes?void new WCF.Action.Proxy({autoSend:!0,data:{actionName:"getRenderedQuotes",className:e,interfaceName:"wcf\\data\\IMessageQuoteAction",parameters:{parentObjectID:t}},success:i}):void(this._insertQuotes=!0)},_toggleShowQuotes:function(){if(this._count){null===this._showQuotes&&(this._showQuotes=$("#showQuotes"),this._showQuotes.length||(this._showQuotes=$('<div id="showQuotes" class="balloonTooltip" />').click($.proxy(this._click,this)).appendTo(document.body)));var e=WCF.Language.get("wcf.message.quote.showQuotes").replace(/#count#/,this._count);this._showQuotes.text(e).show()}else null!==this._showQuotes&&this._showQuotes.hide();this._hasTemplate=!1},_click:function(){this._hasTemplate?this._dialog.wcfDialog("open"):(this._proxy.showLoadingOverlayOnce(),this._proxy.setOption("data",{actionName:"getQuotes",supportPaste:this._supportPaste}),this._proxy.sendRequest())},renderDialog:function(e){null===this._dialog&&(this._dialog=$("#messageQuoteList"),this._dialog.length||(this._dialog=$('<div id="messageQuoteList" />').hide().appendTo(document.body))),this._dialog.html(e);var t=$('<div class="formSubmit" />').appendTo(this._dialog);this._supportPaste&&(this._buttons.insert=$('<button class="buttonPrimary">'+WCF.Language.get("wcf.message.quote.insertAllQuotes")+"</button>").click($.proxy(this._insertSelected,this)).appendTo(t)),this._buttons.remove=$("<button>"+WCF.Language.get("wcf.message.quote.removeAllQuotes")+"</button>").click($.proxy(this._removeSelected,this)).appendTo(t),this._dialog.wcfDialog({title:WCF.Language.get("wcf.message.quote.manageQuotes")}),this._dialog.wcfDialog("render"),this._hasTemplate=!0;var i=this._dialog.find(".jsInsertQuote");if(this._supportPaste?i.click($.proxy(this._insertQuote,this)):i.hide(),this._dialog.find("input.jsCheckbox").change($.proxy(this._changeButtons,this)),this._removeOnSubmit.length){var s=this;this._dialog.find("input.jsRemoveQuote").each(function(e,t){var i=$(t).change($.proxy(this._change,this));WCF.inArray(i.parent("li").attr("data-quote-id"),s._removeOnSubmit)&&i.attr("checked","checked")})}},_changeButtons:function(){this._dialog.find("input.jsCheckbox:checked").length?(this._supportPaste&&this._buttons.insert.html(WCF.Language.get("wcf.message.quote.insertSelectedQuotes")),this._buttons.remove.html(WCF.Language.get("wcf.message.quote.removeSelectedQuotes"))):(this._supportPaste&&this._buttons.insert.html(WCF.Language.get("wcf.message.quote.insertAllQuotes")),this._buttons.remove.html(WCF.Language.get("wcf.message.quote.removeAllQuotes")))},_change:function(e){var t=$(e.currentTarget),i=t.parent("li").attr("data-quote-id");if(t.prop("checked"))this._removeOnSubmit.push(i);else for(var s in this._removeOnSubmit)if(this._removeOnSubmit[s]==i){delete this._removeOnSubmit[s];break}},_insertSelected:function(){if(null===this._ckEditorAlternative){var e=$(".jsQuickReply:eq(0)").data("__api");e&&!e.getContainer().is(":visible")&&(this._insertQuotes=!1,e.click(null))}this._dialog.find("input.jsCheckbox:checked").length||this._dialog.find("input.jsCheckbox").prop("checked","checked"),this._dialog.find("input.jsCheckbox:checked").each($.proxy(function(e,t){this._insertQuote(null,t)},this)),this._dialog.wcfDialog("close")},_insertQuote:function(e,t){if(null!==e&&null===this._ckEditorAlternative){var i=$(".jsQuickReply:eq(0)").data("__api");i&&!i.getContainer().is(":visible")&&(this._insertQuotes=!1,i.click(null))}var s=null===e?$(t).parents("li"):$(e.currentTarget).parents("li"),n=$.trim(s.children("div.jsFullQuote").text()),a=s.parents("article.message");
+
+n="[quote='"+a.attr("data-username")+"','"+a.data("link")+"']"+n+"[/quote]";var o=null;if($.browser.ckeditor&&(o=null===this._ckEditorAlternative?this._ckEditor.ckeditorGet():this._ckEditorAlternative.ckeditorGet()),null!==o&&"wysiwyg"===o.mode)o.removeStyle(new CKEDITOR.style({element:"a",type:CKEDITOR.STYLE_INLINE})),o.insertText(n+"\n\n");else{var r=null;r=null===this._ckEditorAlternative?$.browser.ckeditor?this._ckEditor.next(".cke_editor_text").find("textarea"):this._ckEditor:$.browser.ckeditor?this._ckEditorAlternative.next(".cke_editor_text").find("textarea"):this._ckEditorAlternative;var l=r.val();if(n+="\n\n",0==l.length)r.val(n);else{var c=r.getCaret();r.val(l.substr(0,c)+n+l.substr(c))}}this._removeOnSubmit.push(s.attr("data-quote-id")),null!==e&&this._dialog.wcfDialog("close")},_removeSelected:function(){this._dialog.find("input.jsCheckbox:checked").length||this._dialog.find("input.jsCheckbox").prop("checked","checked");var e=[];if(this._dialog.find("input.jsCheckbox:checked").each(function(t,i){e.push($(i).parents("li").attr("data-quote-id"))}),e.length){var t=[];for(var i in this._handlers)t.push(i);this._proxy.setOption("data",{actionName:"remove",getFullQuoteObjectIDs:this._handlers.length>0,objectTypes:t,quoteIDs:e}),this._proxy.sendRequest(),this._dialog.wcfDialog("close")}},_submit:function(){if(this._supportPaste&&this._removeOnSubmit.length>0){var e=this._form.find(".formSubmit");for(var t in this._removeOnSubmit)$('<input type="hidden" name="__removeQuoteIDs[]" value="'+this._removeOnSubmit[t]+'" />').appendTo(e)}},getQuotesMarkedForRemoval:function(){return this._removeOnSubmit},markQuotesForRemoval:function(){this._removeOnSubmit.length&&(this._proxy.setOption("data",{actionName:"markForRemoval",quoteIDs:this._removeOnSubmit}),this._proxy.suppressErrors(),this._proxy.sendRequest())},removeMarkedQuotes:function(){this._removeOnSubmit.length&&(this._proxy.setOption("data",{actionName:"removeMarkedQuotes",getFullQuoteObjectIDs:this._handlers.length>0}),this._proxy.sendRequest())},countQuotes:function(){var e=[];for(var t in this._handlers)e.push(t);this._proxy.setOption("data",{actionName:"count",getFullQuoteObjectIDs:this._handlers.length>0,objectTypes:e}),this._proxy.sendRequest()},_success:function(e){if(null!==e){if(void 0!==e.count){var t=void 0!==e.fullQuoteObjectIDs?e.fullQuoteObjectIDs:{};this.updateCount(e.count,t)}void 0!==e.template&&(""==$.trim(e.template)?this.updateCount(0,{}):this.renderDialog(e.template))}}}),WCF.Message.Share={},WCF.Message.Share.Content=Class.extend({_cache:{},_dialog:null,init:function(){this._cache={},this._dialog=null,this._initLinks(),WCF.DOMNodeInsertedHandler.addCallback("WCF.Message.Share.Content",$.proxy(this._initLinks,this))},_initLinks:function(){$("a.jsButtonShare").removeClass("jsButtonShare").click($.proxy(this._click,this))},_click:function(e){e.preventDefault();var t=$(e.currentTarget),i=t.prop("href"),s=t.data("linkTitle")?t.data("linkTitle"):i,n=i.hashCode();if(void 0===this._cache[n]){var a=!1;null===this._dialog?(this._dialog=$("<div />").hide().appendTo(document.body),a=!0):this._dialog.empty();var o=$('<fieldset><legend><label for="__sharePermalink">'+WCF.Language.get("wcf.message.share.permalink")+"</label></legend></fieldset>").appendTo(this._dialog);$('<input type="text" id="__sharePermalink" class="long" readonly="readonly" />').attr("value",i).appendTo(o);var o=$('<fieldset><legend><label for="__sharePermalinkBBCode">'+WCF.Language.get("wcf.message.share.permalink.bbcode")+"</label></legend></fieldset>").appendTo(this._dialog);$('<input type="text" id="__sharePermalinkBBCode" class="long" readonly="readonly" />').attr("value","[url='"+i+"']"+s+"[/url]").appendTo(o);var o=$('<fieldset><legend><label for="__sharePermalinkHTML">'+WCF.Language.get("wcf.message.share.permalink.html")+"</label></legend></fieldset>").appendTo(this._dialog);$('<input type="text" id="__sharePermalinkHTML" class="long" readonly="readonly" />').attr("value",'<a href="'+i+'">'+WCF.String.escapeHTML(s)+"</a>").appendTo(o),this._cache[n]=this._dialog.html(),this._dialog.wcfDialog(a?{title:WCF.Language.get("wcf.message.share")}:"open")}else this._dialog.html(this._cache[n]).wcfDialog("open");this._enableSelection()},_enableSelection:function(){var e=this._dialog.find("input").click(function(){$(this).select()});navigator.userAgent.match(/iP(ad|hone|od)/)&&e.keydown(function(){return!1}).removeAttr("readonly").click(function(){this.setSelectionRange(0,9999)})}}),WCF.Message.Share.Page=Class.extend({_ui:{},_pageDescription:"",_pageURL:"",init:function(e){this._pageDescription=encodeURIComponent($('meta[property="og:title"]').prop("content")),this._pageURL=encodeURIComponent($('meta[property="og:url"]').prop("content"));var t=$(".messageShareButtons");this._ui={facebook:t.find(".jsShareFacebook"),google:t.find(".jsShareGoogle"),reddit:t.find(".jsShareReddit"),twitter:t.find(".jsShareTwitter")},this._ui.facebook.children("a").click($.proxy(this._shareFacebook,this)),this._ui.google.children("a").click($.proxy(this._shareGoogle,this)),this._ui.reddit.children("a").click($.proxy(this._shareReddit,this)),this._ui.twitter.children("a").click($.proxy(this._shareTwitter,this)),e===!0&&(this._fetchFacebook(),this._fetchTwitter(),this._fetchReddit())},_share:function(e,t,i){window.open(t.replace(/{pageURL}/,this._pageURL).replace(/{text}/,this._pageDescription+(i?" "+this._pageURL:"")),"height=600,width=600")},_shareFacebook:function(){this._share("facebook","https://www.facebook.com/sharer.php?u={pageURL}&t={text}",!0)},_shareGoogle:function(){this._share("google","https://plus.google.com/share?url={pageURL}",!0)},_shareReddit:function(){this._share("reddit","https://ssl.reddit.com/submit?url={pageURL}",!0)},_shareTwitter:function(){this._share("twitter","https://twitter.com/share?url={pageURL}&text={text}",!1)},_fetchCount:function(e,t,i){var s={autoSend:!0,dataType:"jsonp",showLoadingOverlay:!1,success:t,suppressErrors:!0,type:"GET",url:e.replace(/{pageURL}/,this._pageURL)};i&&(s.jsonp=i),new WCF.Action.Proxy(s)},_fetchFacebook:function(){this._fetchCount("https://graph.facebook.com/?id={pageURL}",$.proxy(function(e){e.shares&&this._ui.facebook.children("span.badge").show().text(e.shares)},this))},_fetchTwitter:function(){window.location.protocol.match(/^https/)||this._fetchCount("http://urls.api.twitter.com/1/urls/count.json?url={pageURL}",$.proxy(function(e){e.count&&this._ui.twitter.children("span.badge").show().text(e.count)},this))},_fetchReddit:function(){window.location.protocol.match(/^https/)||this._fetchCount("http://www.reddit.com/api/info.json?url={pageURL}",$.proxy(function(e){e.data.children.length&&this._ui.reddit.children("span.badge").show().text(e.data.children[0].data.score)},this),"jsonp")}}),WCF.Message.UserMention=Class.extend({_className:"wcf\\data\\user\\UserAction",_dropdown:null,_dropdownMenu:null,_itemIndex:-1,_lineHeight:null,_mentionStart:"",_timer:null,init:function(e){$.browser.msie||(this._textarea=$("#"+e),this._timer=null,CKEDITOR.on("instanceReady",$.proxy(function(e){e.editor.name===this._textarea.wcfIdentify()&&(this._ckEditor=e.editor,this._ckEditor.container.on("keyup",$.proxy(this._keyup,this)),this._ckEditor.container.on("keydown",$.proxy(this._keydown,this)),this._ckEditor.on("key",$.proxy(this._key,this)),this._dropdown=$(this._ckEditor.editable().$),this._dropdownMenu=$('<ul class="dropdownMenu userSuggestionList" />').appendTo(this._textarea.parent()),WCF.Dropdown.initDropdownFragment(this._dropdown,this._dropdownMenu))},this)),this._proxy=new WCF.Action.Proxy({autoAbortPrevious:!0,success:$.proxy(this._success,this)}))},_clearList:function(){this._hideList(),this._dropdownMenu.empty()},_click:function(e){this._setUsername($(e.currentTarget).data("username"))},_createListItem:function(e){var t=$("<li />").data("username",e.label).click($.proxy(this._click,this)).appendTo(this._dropdownMenu),i=$("<div />").addClass("box16").appendTo(t);i.append($(e.icon).addClass("framed")),i.append($("<div />").append($("<span />").text(e.label)))},_getDropdownMenuPosition:function(){var e=this._ckEditor.getSelection().getRanges()[0],t=e.clone(),i=e.startOffset;e.setStart(e.startContainer,i-this._mentionStart.length),e.collapse(!0),e.select();var s=document.createElement("span");$node=new CKEDITOR.dom.node(s),e.insertNode($node),$jElement=$(s),$.browser.opera&&$jElement.text(" ");var n=$jElement.offset();return null===this._lineHeight&&(this._lineHeight=$jElement.height()),(!$.browser.msie||s.previousSibling&&s.nextSibling)&&(s.previousSibling.nodeValue+=s.nextSibling.nodeValue,$(s.nextSibling).remove()),e.setStart(t.startContainer,i),e.setEnd(t.startContainer,i),e.select(),$jElement.remove(),n},_getParameters:function(){return{data:{includeUserGroups:!1,searchString:this._mentionStart}}},_getTextLineInFrontOfCaret:function(){var e=this._ckEditor.getSelection().getRanges()[0];if(!e||!e.collapsed)return"";if($.browser.mozilla&&3!=e.startContainer.$.nodeType){var t=new CKEDITOR.dom.text("");e.insertNode(t),e.selectNodeContents(t),e.select();var i=e.getPreviousNode();if(null===i||"BR"==i.$.nodeName)return t.remove(),"";for(;i&&3!=i.$.nodeType;)i=i.getPrevious();e.selectNodeContents(i),e.collapse(!1),t.remove()}var s=e.startContainer.getText().substr(0,e.startOffset),n=s;s="";for(var a=0;a<n.length;a++){var o=n.charCodeAt(a).toString(16);"200b"==o||/\s/.test(n[a])?s="":("@"===n[a]&&a&&/\s/.test(n[a-1])&&(s=""),s+=n[a])}return s},_hideList:function(){this._dropdown.removeClass("dropdownOpen"),this._dropdownMenu.removeClass("dropdownOpen"),this._itemIndex=-1},_key:function(e){if("wysiwyg"!==this._ckEditor.mode)return!0;if(this._dropdownMenu.is(":visible")&&e.data.keyCode===$.ui.keyCode.ENTER){var t=this._itemIndex;this._hideList(),this._dropdownMenu.children("li").eq(t).trigger("click"),e.cancel()}},_keydown:function(e){if("wysiwyg"!==this._ckEditor.mode)return!0;if(this._dropdownMenu.is(":visible"))switch(e.data.$.keyCode){case 38:e.data.$.preventDefault(),this._selectItem(this._itemIndex-1);break;case 40:e.data.$.preventDefault(),this._selectItem(this._itemIndex+1)}},_keyup:function(e){if("wysiwyg"!==this._ckEditor.mode)return!0;if(null!==this._timer&&(this._timer.stop(),this._timer=null),this._proxy.abortPrevious(),13!==e.data.$.keyCode&&!(this._dropdownMenu.is(":visible")&&e.data.$.keyCode in{13:1,38:1,40:1})){var t=this._getTextLineInFrontOfCaret();if(t){var i=t.match(/@([^,]{3,})$/);i?(!i.index||t[i.index-1].match(/\s/))&&(this._mentionStart=i[1],null!==this._timer&&this._timer.stop(),this._timer=new WCF.PeriodicalExecuter($.proxy(function(){this._proxy.setOption("data",{actionName:"getSearchResultList",className:this._className,interfaceName:"wcf\\data\\ISearchAction",parameters:this._getParameters()}),this._proxy.sendRequest(),this._timer.stop(),this._timer=null},this),500)):this._hideList()}else this._hideList()}},_setUsername:function(e){null!==this._timer&&(this._timer.stop(),this._timer=null),this._proxy.abortPrevious();var t=this._ckEditor.getSelection().getRanges()[0];t.setStart(t.startContainer,t.startOffset-(this._mentionStart.length+1));var i=t.getCommonAncestor();i.getText()=="@"+this._mentionStart&&i.getParent()&&"a"==i.getParent().getName()&&(i.replace(i.getParent()),t.setStart(i)),t.deleteContents(),-1!==e.indexOf("'")&&(e=e.replace(/'/g,"''")),e="'"+e+"'";var s=new CKEDITOR.dom.text("@"+e);t.insertNode(s),t.selectNodeContents(s),t.collapse(!1),t.select(),this._hideList()},_selectItem:function(e){var t=this._dropdownMenu.children("li");0>e?e=t.length-1:e+1>t.length&&(e=0),t.removeClass("dropdownNavigationItem"),t.eq(e).addClass("dropdownNavigationItem"),this._itemIndex=e},_showList:function(){this._dropdown.addClass("dropdownOpen"),this._dropdownMenu.addClass("dropdownOpen")},_success:function(e){if(this._clearList(!1),$.getLength(e.returnValues)){for(var t in e.returnValues){var i=e.returnValues[t];this._createListItem(i)}this._updateSuggestionListPosition(),this._showList()}},_updateSuggestionListPosition:function(){try{var e=this._getDropdownMenuPosition();e.top+=5+this._lineHeight,e.left-=16,this._dropdownMenu.css(e),this._selectItem(0),e.top+this._dropdownMenu.outerHeight()+10>$(window).height()+$(document).scrollTop()?(this._dropdownMenu.addClass("dropdownArrowBottom"),this._dropdownMenu.css({top:e.top-this._dropdownMenu.outerHeight()-2*this._lineHeight+5})):this._dropdownMenu.removeClass("dropdownArrowBottom")}catch(e){}}});
\ No newline at end of file
diff --git a/wcfsetup/install/files/js/WCF.Moderation.min.js b/wcfsetup/install/files/js/WCF.Moderation.min.js
new file mode 100644 (file)
index 0000000..2bcba98
--- /dev/null
@@ -0,0 +1 @@
+WCF.Moderation={},WCF.Moderation.Management=Class.extend({_buttonSelector:"",_className:"",_confirmationTemplate:{},_languageItem:"",_proxy:null,_queueID:0,_redirectURL:"",init:function(t,e,o){return this._buttonSelector?this._className?(this._queueID=t,this._redirectURL=e,this._languageItem=o,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),void $(this._buttonSelector).click($.proxy(this._click,this))):void console.debug("[WCF.Moderation.Management] Missing class name, aborting."):void console.debug("[WCF.Moderation.Management] Missing button selector, aborting.")},_click:function(t){var e=$(t.currentTarget).wcfIdentify(),o="";this._confirmationTemplate[e]&&(o=this._confirmationTemplate[e]),WCF.System.Confirmation.show(WCF.Language.get(this._languageItem.replace(/{actionName}/,e)),$.proxy(function(t){if("confirm"===t){var i={actionName:e,className:this._className,objectIDs:[this._queueID]};this._confirmationTemplate[e]&&(i.parameters={},o.find("input, textarea").each(function(t,e){var o=$(e),n=o.val();"input"===o.getTagName()&&"checkbox"===o.attr("type")&&(o.is(":checked")||(n=null)),null!==n&&(i.parameters[o.attr("name")]=n)})),this._proxy.setOption("data",i),this._proxy.sendRequest(),$(this._buttonSelector).disable()}},this),{},o)},_success:function(){var t=new WCF.System.Notification(WCF.Language.get("wcf.global.success")),e=this;t.show(function(){window.location=e._redirectURL})}}),WCF.Moderation.Activation={},WCF.Moderation.Activation.Management=WCF.Moderation.Management.extend({init:function(t,e){this._buttonSelector="#enableContent, #removeContent",this._className="wcf\\data\\moderation\\queue\\ModerationQueueActivationAction",this._super(t,e,"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(t,e){this._objectType=t,this._buttonSelector=e,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 t=this;$(this._buttonSelector).each(function(e,o){var i=$(o),n=i.wcfIdentify();t._buttons[n]||(t._buttons[n]=i,i.click($.proxy(t._click,t)))})},_click:function(t){this._objectID=$(t.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(t){t.returnValues.reported?(null===this._notification&&(this._notification=new WCF.System.Notification(WCF.Language.get("wcf.moderation.report.success"))),this._dialog.wcfDialog("close"),this._notification.show()):t.returnValues.template&&(this._showDialog(t.returnValues.template),t.returnValues.alreadyReported||this._dialog.find(".jsSubmitReport").click($.proxy(this._submit,this)))},_showDialog:function(t){null===this._dialog&&(this._dialog=$("#moderationReport"),this._dialog.length||(this._dialog=$('<div id="moderationReport" />').hide().appendTo(document.body))),this._dialog.html(t).wcfDialog({title:WCF.Language.get("wcf.moderation.report.reportContent")}).wcfDialog("render")},_submit:function(){var t=this._dialog.find(".jsReportMessage").val();return""==$.trim(t)?(this._dialog.find("fieldset > dl").addClass("formError"),void(this._dialog.find(".innerError").length||this._dialog.find(".jsReportMessage").after($('<small class="innerError">'+WCF.Language.get("wcf.global.form.error.empty")+"</small>")))):(this._proxy.setOption("data",{actionName:"report",className:"wcf\\data\\moderation\\queue\\ModerationQueueReportAction",parameters:{message:t,objectID:this._objectID,objectType:this._objectType}}),void this._proxy.sendRequest())}}),WCF.Moderation.Report.Management=WCF.Moderation.Management.extend({init:function(t,e){this._buttonSelector="#removeContent, #removeReport",this._className="wcf\\data\\moderation\\queue\\ModerationQueueReportAction",this._super(t,e,"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(t,e){this._noItems="wcf.moderation.noMoreItems",this._showAllLink=t,this._deletedContentLink=e,this._super("outstandingModeration")},_addDefaultItems:function(t){this._addDivider(t),$('<li><a href="'+this._showAllLink+'">'+WCF.Language.get("wcf.moderation.showAll")+"</a></li>").appendTo(t),this._addDivider(t),$('<li><a href="'+this._deletedContentLink+'">'+WCF.Language.get("wcf.moderation.showDeletedContent")+"</a></li>").appendTo(t)},_getParameters:function(){return{actionName:"getOutstandingQueues",className:"wcf\\data\\moderation\\queue\\ModerationQueueAction"}}});
\ No newline at end of file
diff --git a/wcfsetup/install/files/js/WCF.Poll.min.js b/wcfsetup/install/files/js/WCF.Poll.min.js
new file mode 100644 (file)
index 0000000..d99f4d1
--- /dev/null
@@ -0,0 +1 @@
+WCF.Poll={},WCF.Poll.Management=Class.extend({_container:null,_count:0,_inputSize:0,_maxOptions:0,init:function(t,i,e){if(this._count=0,this._maxOptions=e||-1,this._container=$("#"+t).children("ol:eq(0)"),!this._container.length)return void console.debug("[WCF.Poll.Management] Invalid container id given, aborting.");i=i||[],this._createOptionList(i),$(window).resize($.proxy(this._resize,this)),this._container.parents("form").submit($.proxy(this._submit,this)),new WCF.Sortable.List(t,"",void 0,void 0,!0),this._resize();var n=this._container.parents(".tabMenuContent:eq(0)"),o=n.wcfIdentify(),s=this;n.parents(".tabMenuContainer:eq(0)").on("wcftabsactivate",function(t,i){i.newPanel.wcfIdentify()==o&&s._resize()})},_createOptionList:function(t){for(var i=0,e=t.length;e>i;i++){var n=t[i];this._createOption(n.optionValue,n.optionID)}this._createOption()},_createOption:function(t,i,e){t=t||"",i=parseInt(i)||0,e=e||null;var n=$('<li class="sortableNode" />').data("optionID",i);null===e?n.appendTo(this._container):n.insertAfter(e);var o=$('<span class="sortableButtonContainer" />').appendTo(n);$('<span class="icon icon16 icon-plus jsTooltip jsAddOption pointer" title="'+WCF.Language.get("wcf.poll.button.addOption")+'" />').click($.proxy(this._addOption,this)).appendTo(o),$('<span class="icon icon16 icon-remove jsTooltip jsDeleteOption pointer" title="'+WCF.Language.get("wcf.poll.button.removeOption")+'" />').click($.proxy(this._removeOption,this)).appendTo(o);var s=$('<input type="text" value="'+t+'" maxlength="255" />').css({width:this._inputSize+"px"}).keydown($.proxy(this._keyDown,this)).appendTo(n);null!==e&&s.focus(),WCF.DOMNodeInsertedHandler.execute(),this._count++,this._count===this._maxOptions&&this._container.find("span.jsAddOption").removeClass("pointer").addClass("disabled")},_keyDown:function(t){return 13!==t.which?!0:($(t.currentTarget).prev(".sortableButtonContainer").children(".jsAddOption").trigger("click"),t.preventDefault(),t.stopPropagation(),!1)},_addOption:function(t){if(this._count===this._maxOptions)return!1;var i=$(t.currentTarget).parents("li");this._createOption(void 0,void 0,i)},_removeOption:function(t){$(t.currentTarget).parents("li").remove(),this._count--,this._container.find("span.jsAddOption").addClass("pointer").removeClass("disabled"),0==this._container.children("li").length&&this._createOption()},_resize:function(){var t=this._container.innerWidth(),i=this._container.children("li:eq(0)"),e=i.children(".sortableButtonContainer").outerWidth(),n=t-e;n!=this._inputSize&&(this._inputSize=n,this._container.find("li > input").css({width:this._inputSize+"px"}))},_submit:function(){var t=[];if(this._container.children("li").each(function(i,e){var n=$(e),o=$.trim(n.children("input").val());""!=o&&t.push({optionID:n.data("optionID"),optionValue:o})}),t.length)for(var i=this._container.parents("form").find(".formSubmit"),e=0,n=t.length;n>e;e++){var o=t[e];$('<input type="hidden" name="pollOptions['+e+']" />').val(o.optionID+"_"+o.optionValue).appendTo(i)}}}),WCF.Poll.Manager=Class.extend({_cache:{},_canViewParticipants:{},_canViewResult:{},_canVote:{},_inputElements:{},_participants:{},_polls:{},_proxy:null,init:function(t){var i=$(t);if(!i.length)return void console.debug("[WCF.Poll.Manager] Given selector '"+t+"' does not match, aborting.");this._cache={},this._canViewParticipants={},this._canViewResult={},this._inputElements={},this._participants={},this._polls={},this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this),url:"index.php/Poll/?t="+SECURITY_TOKEN+SID_ARG_2ND});var e=this;i.each(function(t,i){var n=$(i),o=n.data("pollID");void 0===e._polls[o]&&(e._cache[o]={result:"",vote:""},e._polls[o]=n,e._canViewParticipants[o]=n.data("canViewParticipants")?!0:!1,e._canViewResult[o]=n.data("canViewResult")?!0:!1,e._canVote[o]=n.data("canVote")?!0:!1,e._bindListeners(o),n.data("inVote")&&e._prepareVote(o),e._toggleButtons(o))})},_bindListeners:function(t){this._polls[t].find(".jsButtonPollShowParticipants").data("pollID",t).click($.proxy(this._showParticipants,this)),this._polls[t].find(".jsButtonPollShowResult").data("pollID",t).click($.proxy(this._showResult,this)),this._polls[t].find(".jsButtonPollShowVote").data("pollID",t).click($.proxy(this._showVote,this)),this._polls[t].find(".jsButtonPollVote").data("pollID",t).click($.proxy(this._vote,this))},_showResult:function(t,i){var e=null===t?i:$(t.currentTarget).data("pollID");this._canViewResult[e]&&this._polls[e].data("inVote")&&(this._cache[e].result?(this._polls[e].find(".pollInnerContainer").html(this._cache[e].result),this._polls[e].data("inVote",!1),this._toggleButtons(e)):(this._proxy.setOption("data",{actionName:"getResult",pollID:e}),this._proxy.sendRequest()))},_showParticipants:function(t){var i=$(t.currentTarget).data("pollID");this._participants[i]||(this._participants[i]=new WCF.User.List("wcf\\data\\poll\\PollAction",this._polls[i].data("question"),{pollID:i})),this._participants[i].open()},_showVote:function(t,i){var e=null===t?i:$(t.currentTarget).data("pollID");this._canVote[e]&&(this._polls[e].data("inVote")||(this._cache[e].vote?(this._polls[e].find(".pollInnerContainer").html(this._cache[e].vote),this._polls[e].data("inVote",!0),this._prepareVote(e),this._toggleButtons(e)):(this._proxy.setOption("data",{actionName:"getVote",pollID:e}),this._proxy.sendRequest())))},_success:function(t){if(t&&t.actionName){var i=t.pollID;switch(t.resultTemplate&&(this._cache[i].result=t.resultTemplate),t.voteTemplate&&(this._cache[i].vote=t.voteTemplate),t.actionName){case"getResult":this._showResult(null,i);break;case"getVote":this._showVote(null,i);break;case"vote":this._canViewResult[i]=!0,this._canVote[i]=t.canVote?!0:!1,this._showResult(null,i)}}},_prepareVote:function(t){this._polls[t].find(".jsButtonPollVote").disable();var i=this._polls[t].find(".pollInnerContainer > .jsPollVote"),e=this;this._inputElements[t]=i.find("input").change(function(){e._handleVoteButton(t)}),this._handleVoteButton(t);var n=i.data("maxVotes");this._inputElements[t].filter("[type=checkbox]").length&&(this._inputElements[t].change(function(){e._enforceMaxVotes(t,n)}),this._enforceMaxVotes(t,n))},_enforceMaxVotes:function(t,i){var e=this._inputElements[t];e.filter(":checked").length==i?e.filter(":not(:checked)").disable():e.enable()},_handleVoteButton:function(t){var i=this._inputElements[t],e=this._polls[t].find(".jsButtonPollVote");i.filter(":checked").length?e.enable():e.disable()},_toggleButtons:function(t){var i=this._polls[t].children(".formSubmit");i.find(".jsButtonPollShowParticipants, .jsButtonPollShowResult, .jsButtonPollShowVote, .jsButtonPollVote").hide();var e=!0;this._polls[t].data("inVote")?(e=!1,i.find(".jsButtonPollVote").show(),this._canViewResult[t]&&i.find(".jsButtonPollShowResult").show()):(this._canVote[t]&&(e=!1,i.find(".jsButtonPollShowVote").show()),this._canViewParticipants[t]&&(e=!1,i.find(".jsButtonPollShowParticipants").show())),e&&i.hide()},_vote:function(t){var i=$(t.currentTarget).data("pollID");if(this._canVote[i]){var e=[];this._inputElements[i].each(function(t,i){var n=$(i);n.is(":checked")&&e.push(n.data("optionID"))}),e.length&&(this._proxy.setOption("data",{actionName:"vote",optionIDs:e,pollID:i}),this._proxy.sendRequest())}}});
\ No newline at end of file
diff --git a/wcfsetup/install/files/js/WCF.Search.Message.min.js b/wcfsetup/install/files/js/WCF.Search.Message.min.js
new file mode 100644 (file)
index 0000000..c654333
--- /dev/null
@@ -0,0 +1 @@
+WCF.Search.Message={},WCF.Search.Message.KeywordList=WCF.Search.Base.extend({_className:"wcf\\data\\search\\keyword\\SearchKeywordAction",_divider:null,_forceSubmit:!1,init:function(e,i,t){if(!$.isFunction(i))return void console.debug("[WCF.Search.Message.KeywordList] The given callback is invalid, aborting.");this._callback=i,this._excludedSearchValues=[],t&&(this._excludedSearchValues=t),this._searchInput=$(e).keyup($.proxy(this._keyUp,this)).keydown($.proxy(function(e){13===e.which&&this._itemCount&&-1!==this._itemIndex&&e.preventDefault()},this));var s=WCF.Dropdown.getDropdownMenu(this._searchInput.parents(".dropdown").wcfIdentify()),a=s.find("li.dropdownDivider").last();this._divider=$('<li class="dropdownDivider" />').hide().insertBefore(a),this._list=$('<li class="dropdownList"><ul /></li>').hide().insertBefore(a).children("ul"),s.find("input, label").on("click",function(e){e.stopPropagation()}),this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1,success:$.proxy(this._success,this)})},_createListItem:function(e){this._divider.show(),this._list.parent().show(),this._super(e)},_clearList:function(e){e&&this._searchInput.val(""),this._divider.hide(),this._list.empty().parent().hide(),WCF.CloseOverlayHandler.removeCallback("WCF.Search.Base"),this._itemCount=0,this._itemIndex=-1}}),WCF.Search.Message.SearchArea=Class.extend({_searchArea:null,init:function(e){this._searchArea=e;var i=new WCF.Search.Message.KeywordList(this._searchArea.find("input[type=search]"),$.proxy(this._callback,this));i.setDelay(500);var t=this,s=this._searchArea.find("input[type=search]");if(this._searchArea.click(function(e){return e.target==t._searchArea[0]?(s.focus().trigger("click"),!1):void 0}),this._searchArea.hasClass("dropdown")){var a=this._searchArea.wcfIdentify(),r=this._searchArea.find("form");r.submit(function(){var e=WCF.Dropdown.getDropdownMenu(a);e.find("input[type=hidden]").appendTo(r),e.find("input[type=checkbox]:checked").each(function(e,i){var t=$(i);$('<input type="hidden" name="'+t.attr("name")+'" value="'+t.attr("value")+'" />').appendTo(r)})})}},_callback:function(e){return this._searchArea.find("input[type=search]").val(e.label),this._searchArea.find("input[type=search]").focus(),!1}});
\ No newline at end of file
diff --git a/wcfsetup/install/files/js/WCF.Tagging.min.js b/wcfsetup/install/files/js/WCF.Tagging.min.js
new file mode 100644 (file)
index 0000000..2c9d0d2
--- /dev/null
@@ -0,0 +1 @@
+WCF.Tagging={},WCF.Tagging.TagList=WCF.EditableItemList.extend({_className:"wcf\\data\\tag\\TagAction",_maxLength:0,init:function(t,a,i){this._allowCustomInput=!0,this._maxLength=i,this._super(t,a),this._data=[],this._search=new WCF.Tagging.TagSearch(this._searchInput,$.proxy(this.addItem,this)),this._itemList.addClass("tagList"),$(t).data("__api",this)},_keyDown:function(t){if(this._super(t)){if(null===t)return!0;var a=t.which;return 8===a||27===a||13===a||46===a?!0:a>36&&41>a?!0:this._searchInput.val().length>=this._maxLength?!1:!0}return!1},_submit:function(){this._super();for(var t=0,a=this._data.length;a>t;t++)this._data[t]&&$('<input type="hidden" name="tags[]" />').val(this._data[t]).appendTo(this._form)},addItem:function(t){if(!t.objectID&&t.label.length>this._maxLength&&(t.label=t.label.substr(0,this._maxLength)),WCF.inArray(t.label,this._data))return!0;var a=$('<li class="badge tag">'+WCF.String.escapeHTML(t.label)+"</li>").data("objectID",t.objectID).data("label",t.label).appendTo(this._itemList);return a.click($.proxy(this._click,this)),this._search&&this._search.addExcludedSearchValue(t.label),this._addItem(t.objectID,t.label),!0},_addItem:function(t,a){this._data.push(a)},clearList:function(){this._super(),this._data=[]},getTags:function(){return this._data},_removeItem:function(t,a){for(var i=0,e=this._data.length;e>i;i++)if(this._data[i]===a)return void this._data.splice(i,1)},load:function(t){if(t&&t.length)for(var a=0,i=t.length;i>a;a++)this.addItem({objectID:0,label:WCF.String.unescapeHTML(t[a])})}}),WCF.Tagging.TagSearch=WCF.Search.Base.extend({_className:"wcf\\data\\tag\\TagAction",init:function(t,a,i,e){this._super(t,a,i,e,!1)}});
\ No newline at end of file
diff --git a/wcfsetup/install/files/js/WCF.User.min.js b/wcfsetup/install/files/js/WCF.User.min.js
new file mode 100644 (file)
index 0000000..222734b
--- /dev/null
@@ -0,0 +1 @@
+WCF.User.Login=Class.extend({_loginSubmitButton:null,_password:null,_passwordContainer:null,_useCookies:null,_useCookiesContainer:null,init:function(t){this._loginSubmitButton=$("#loginSubmitButton"),this._password=$("#password"),this._passwordContainer=this._password.parents("dl"),this._useCookies=$("#useCookies"),this._useCookiesContainer=this._useCookies.parents("dl");var e=$("#loginForm");e.find("input[name=action]").change($.proxy(this._change,this)),t&&WCF.User.QuickLogin.init()},_change:function(t){"register"===$(t.currentTarget).val()?this._setState(!1,WCF.Language.get("wcf.user.button.register")):this._setState(!0,WCF.Language.get("wcf.user.button.login"))},_setState:function(t,e){t?(this._password.enable(),this._passwordContainer.removeClass("disabled"),this._useCookies.enable(),this._useCookiesContainer.removeClass("disabled")):(this._password.disable(),this._passwordContainer.addClass("disabled"),this._useCookies.disable(),this._useCookiesContainer.addClass("disabled")),this._loginSubmitButton.val(e)}}),WCF.User.QuickLogin={_dialog:null,_loginMessage:null,init:function(){$(".loginLink").click($.proxy(this._render,this)),$("#loginForm input[name=url]").val(function(t,e){return window.location.protocol+"//"+window.location.host+e})},show:function(t){t?(null===this._loginMessage&&(this._loginMessage=$('<p class="info" />').hide().prependTo($("#loginForm > form"))),this._loginMessage.show().text(t)):null!==this._loginMessage&&this._loginMessage.hide(),this._render()},_render:function(t){void 0!==t&&t.preventDefault(),null===this._dialog?(this._dialog=$("#loginForm").wcfDialog({title:WCF.Language.get("wcf.user.login")}),this._dialog.find("#username").focus()):this._dialog.wcfDialog("open")}},WCF.User.Profile={},WCF.User.Profile.ActivityPointList={_cache:{},_dialog:null,_didInit:!1,_proxy:null,init:function(){this._didInit||(this._cache={},this._dialog=null,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._init(),WCF.DOMNodeInsertedHandler.addCallback("WCF.User.Profile.ActivityPointList",$.proxy(this._init,this)),this._didInit=!0)},_init:function(){$(".activityPointsDisplay").removeClass("activityPointsDisplay").click($.proxy(this._click,this))},_click:function(t){var e=$(t.currentTarget).data("userID");void 0===this._cache[e]?(this._proxy.setOption("data",{actionName:"getDetailedActivityPointList",className:"wcf\\data\\user\\UserProfileAction",objectIDs:[e]}),this._proxy.sendRequest()):this._show(e)},_show:function(t){null===this._dialog?(this._dialog=$("<div>"+this._cache[t]+"</div>").hide().appendTo(document.body),this._dialog.wcfDialog({title:WCF.Language.get("wcf.user.activityPoint")})):(this._dialog.html(this._cache[t]),this._dialog.wcfDialog("open"))},_success:function(t){this._cache[t.returnValues.userID]=t.returnValues.template,this._show(t.returnValues.userID)}},WCF.User.Profile.Follow=Class.extend({_button:null,_following:!1,_proxy:null,_userID:0,init:function(t,e){this._following=e,this._userID=t,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._createButton(),this._showButton()},_createButton:function(){this._button=$('<li id="followUser"><a class="button jsTooltip" title="'+WCF.Language.get("wcf.user.button."+(this._following?"un":"")+"follow")+'"><span class="icon icon16 icon-plus"></span> <span class="invisible">'+WCF.Language.get("wcf.user.button."+(this._following?"un":"")+"follow")+"</span></a></li>").prependTo($("#profileButtonContainer")),this._button.click($.proxy(this._execute,this))},_execute:function(){var t=this._following?"unfollow":"follow";this._proxy.setOption("data",{actionName:t,className:"wcf\\data\\user\\follow\\UserFollowAction",parameters:{data:{userID:this._userID}}}),this._proxy.sendRequest()},_showButton:function(){this._following?this._button.find(".button").data("tooltip",WCF.Language.get("wcf.user.button.unfollow")).addClass("active").children(".icon").removeClass("icon-plus").addClass("icon-minus"):this._button.find(".button").data("tooltip",WCF.Language.get("wcf.user.button.follow")).removeClass("active").children(".icon").removeClass("icon-minus").addClass("icon-plus")},_success:function(t){this._following=t.returnValues.following,this._showButton();var e=new WCF.System.Notification;e.show()}}),WCF.User.Profile.IgnoreUser=Class.extend({_button:null,_isIgnoredUser:!1,_proxy:null,_userID:0,init:function(t,e){this._userID=t,this._isIgnoredUser=e,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._updateButton(),this._button.click($.proxy(this._click,this))},_click:function(){var t=this._isIgnoredUser?"unignore":"ignore";this._proxy.setOption("data",{actionName:t,className:"wcf\\data\\user\\ignore\\UserIgnoreAction",parameters:{data:{ignoreUserID:this._userID}}}),this._proxy.sendRequest()},_success:function(t){this._isIgnoredUser=t.returnValues.isIgnoredUser,this._updateButton();var e=new WCF.System.Notification;e.show()},_updateButton:function(){null===this._button&&(this._button=$('<li id="ignoreUser"><a class="button jsTooltip" title="'+WCF.Language.get("wcf.user.button."+(this._isIgnoredUser?"un":"")+"ignore")+'"><span class="icon icon16 icon-ban-circle"></span> <span class="invisible">'+WCF.Language.get("wcf.user.button."+(this._isIgnoredUser?"un":"")+"ignore")+"</span></a></li>").prependTo($("#profileButtonContainer"))),this._button.find(".button").data("tooltip",WCF.Language.get("wcf.user.button."+(this._isIgnoredUser?"un":"")+"ignore")),this._isIgnoredUser?this._button.find(".button").addClass("active").children(".icon").removeClass("icon-ban-circle").addClass("icon-circle-blank"):this._button.find(".button").removeClass("active").children(".icon").removeClass("icon-circle-blank").addClass("icon-ban-circle")}}),WCF.User.Profile.TabMenu=Class.extend({_hasContent:{},_profileContent:null,_proxy:null,_userID:0,init:function(t){this._profileContent=$("#profileContent"),this._userID=t;var e=this._profileContent.data("active"),i=!1;this._profileContent.find("div.tabMenuContent").each($.proxy(function(t,s){var a=$(s).wcfIdentify();e===a?this._hasContent[a]=!0:(this._hasContent[a]=!1,i=!0)},this)),i&&(this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._profileContent.bind("wcftabsbeforeactivate",$.proxy(this._loadContent,this)))},_loadContent:function(t,e){var i=$(e.newPanel),s=i.attr("id");this._hasContent[s]||(this._proxy.setOption("data",{actionName:"getContent",className:"wcf\\data\\user\\profile\\menu\\item\\UserProfileMenuItemAction",parameters:{data:{containerID:s,menuItem:i.data("menuItem"),userID:this._userID}}}),this._proxy.sendRequest())},_success:function(t){var e=t.returnValues.containerID;this._hasContent[e]=!0;var i=this._profileContent.find("#"+e);$("<div>"+t.returnValues.template+"</div>").hide().appendTo(i),i.children("div").wcfBlindIn()}}),WCF.User.Profile.Editor=Class.extend({_actionName:"",_buttons:{},_cachedTemplate:"",_proxy:null,_tab:null,_userID:0,init:function(t,e){this._actionName="",this._cachedTemplate="",this._tab=$("#about"),this._userID=t,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._initButtons(),e&&this._beginEdit()},_initButtons:function(){var t=$("#profileButtonContainer");this._buttons={beginEdit:$('<li><a class="button"><span class="icon icon16 icon-pencil" /> <span>'+WCF.Language.get("wcf.user.editProfile")+"</span></a></li>").click($.proxy(this._beginEdit,this)).appendTo(t)}},_beginEdit:function(){this._actionName="beginEdit",this._buttons.beginEdit.hide(),$("#profileContent").wcfTabs("select","about"),this._proxy.setOption("data",{actionName:"beginEdit",className:"wcf\\data\\user\\UserProfileAction",objectIDs:[this._userID]}),this._proxy.sendRequest()},_save:function(){this._actionName="save";var t=/values\[([a-zA-Z0-9._-]+)\]/,e={};this._tab.find("input, textarea, select").each(function(i,s){var a=$(s);if("input"===a.getTagName()){var o=a.attr("type");if(("radio"===o||"checkbox"===o)&&!a.prop("checked"))return}var n=a.attr("name");t.test(n)&&(e[RegExp.$1]=a.val())}),this._proxy.setOption("data",{actionName:"save",className:"wcf\\data\\user\\UserProfileAction",objectIDs:[this._userID],parameters:{values:e}}),this._proxy.sendRequest()},_restore:function(){this._actionName="restore",this._buttons.beginEdit.show(),this._destroyCKEditor(),this._tab.html(this._cachedTemplate).children().css({height:"auto"})},_success:function(t){switch(this._actionName){case"beginEdit":this._prepareEdit(t);break;case"save":t.returnValues.success?(this._cachedTemplate=t.returnValues.template,this._restore()):this._prepareEdit(t,!0)}},_prepareEdit:function(t,e){this._destroyCKEditor();var i=this;this._tab.html(function(s,a){return e!==!0&&(i._cachedTemplate=a),t.returnValues.template}),this._tab.find("input[type=text]").attr("autocomplete","off"),this._tab.find(".formSubmit > button[data-type=save]").click($.proxy(this._save,this)),this._tab.find(".formSubmit > button[data-type=restore]").click($.proxy(this._restore,this)),this._tab.find("input").keyup(function(t){return 13===t.which?(i._save(),t.preventDefault(),!1):void 0})},_destroyCKEditor:function(){this._tab.find("textarea + .cke").each(function(t,e){var i=$(e).attr("id").replace(/cke_/,"");CKEDITOR.instances[i]&&CKEDITOR.instances[i].destroy()})}}),WCF.User.Registration={},WCF.User.Registration.Validation=Class.extend({_actionName:"",_className:"",_confirmElement:null,_element:null,_errorMessages:{},_options:{},_proxy:null,init:function(t,e,i){this._element=t,this._element.blur($.proxy(this._blur,this)),this._confirmElement=e||null,null!==this._confirmElement&&this._confirmElement.blur($.proxy(this._blurConfirm,this)),i=i||{},this._setOptions(i),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this),showLoadingOverlay:!1}),this._setErrorMessages()},_setOptions:function(){},_setErrorMessages:function(){this._errorMessages={ajaxError:"",notEqual:""}},_blur:function(){var t=this._element.val();if(!t)return this._showError(this._element,WCF.Language.get("wcf.global.form.error.empty"));if(null!==this._confirmElement){var e=this._confirmElement.val();if(""!=e&&t!=e)return this._showError(this._confirmElement,this._errorMessages.notEqual)}this._validateOptions()&&(this._proxy.setOption("data",{actionName:this._actionName,className:this._className,parameters:this._getParameters()}),this._proxy.sendRequest())},_getParameters:function(){return{}},_validateOptions:function(){return!0},_blurConfirm:function(t){var e=this._confirmElement.val();return e?void this._blur(t):this._showError(this._confirmElement,WCF.Language.get("wcf.global.form.error.empty"))},_success:function(t){t.returnValues.isValid?(this._showSuccess(this._element),null!==this._confirmElement&&this._confirmElement.val()&&this._showSuccess(this._confirmElement)):this._showError(this._element,WCF.Language.get(this._errorMessages.ajaxError+t.returnValues.error))},_showError:function(t,e){t.parent().parent().addClass("formError").removeClass("formSuccess");var i=t.parent().find("small.innerError");i.length||(i=$("<small />").addClass("innerError").insertAfter(t)),i.text(e)},_showSuccess:function(t){t.parent().parent().addClass("formSuccess").removeClass("formError"),t.next("small.innerError").remove()}}),WCF.User.Registration.Validation.Username=WCF.User.Registration.Validation.extend({_actionName:"validateUsername",_className:"wcf\\data\\user\\UserRegistrationAction",_setOptions:function(t){this._options=$.extend(!0,{minlength:3,maxlength:25},t)},_setErrorMessages:function(){this._errorMessages={ajaxError:"wcf.user.username.error."}},_validateOptions:function(){var t=this._element.val();return t.length<this._options.minlength||t.length>this._options.maxlength?(this._showError(this._element,WCF.Language.get("wcf.user.username.error.notValid")),!1):!0},_getParameters:function(){return{username:this._element.val()}}}),WCF.User.Registration.Validation.EmailAddress=WCF.User.Registration.Validation.extend({_actionName:"validateEmailAddress",_className:"wcf\\data\\user\\UserRegistrationAction",_getParameters:function(){return{email:this._element.val()}},_setErrorMessages:function(){this._errorMessages={ajaxError:"wcf.user.email.error.",notEqual:WCF.Language.get("wcf.user.confirmEmail.error.notEqual")}}}),WCF.User.Registration.Validation.Password=WCF.User.Registration.Validation.extend({_actionName:"validatePassword",_className:"wcf\\data\\user\\UserRegistrationAction",_getParameters:function(){return{password:this._element.val()}},_setErrorMessages:function(){this._errorMessages={ajaxError:"wcf.user.password.error.",notEqual:WCF.Language.get("wcf.user.confirmPassword.error.notEqual")}}}),WCF.User.Registration.LostPassword=Class.extend({_email:null,_username:null,init:function(){this._email=$("#emailInput"),this._username=$("#usernameInput"),this._email.keyup($.proxy(this._checkEmail,this)),this._username.keyup($.proxy(this._checkUsername,this)),$.browser.mozilla&&$.browser.touch&&(this._email.on("input",$.proxy(this._checkEmail,this)),this._username.on("input",$.proxy(this._checkUsername,this))),this._checkEmail(),this._checkUsername()},_checkEmail:function(){""==this._email.val()?(this._username.enable(),this._username.parents("dl:eq(0)").removeClass("disabled")):(this._username.disable(),this._username.parents("dl:eq(0)").addClass("disabled"))},_checkUsername:function(){""==this._username.val()?(this._email.enable(),this._email.parents("dl:eq(0)").removeClass("disabled")):(this._email.disable(),this._email.parents("dl:eq(0)").addClass("disabled"))}}),WCF.Notification={},WCF.Notification.UserPanel=WCF.UserPanel.extend({_proxy:null,_showAllLink:"",init:function(t){this._noItems="wcf.user.notification.noMoreNotifications",this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._showAllLink=t,this._super("userNotifications"),this._container.data("count")&&(document.title="("+this._container.data("count")+") "+document.title)},_addDefaultItems:function(t){this._addDivider(t),this._container.data("count")&&($('<li><a href="'+this._showAllLink+'">'+WCF.Language.get("wcf.user.notification.showAll")+"</a></li>").appendTo(t),this._addDivider(t)),$('<li id="userNotificationsMarkAllAsConfirmed"><a>'+WCF.Language.get("wcf.user.notification.markAllAsConfirmed")+"</a></li>").click($.proxy(this._markAllAsConfirmed,this)).appendTo(t)},_getParameters:function(){return{actionName:"getOutstandingNotifications",className:"wcf\\data\\user\\notification\\UserNotificationAction"}},_after:function(){WCF.Dropdown.getDropdownMenu(this._container.wcfIdentify()).children("li.jsNotificationItem").click($.proxy(this._markAsConfirmed,this))},_markAsConfirmed:function(t){this._proxy.setOption("data",{actionName:"markAsConfirmed",className:"wcf\\data\\user\\notification\\UserNotificationAction",parameters:{notificationID:$(t.currentTarget).data("notificationID")}}),this._proxy.sendRequest()},_markAllAsConfirmed:function(){WCF.System.Confirmation.show(WCF.Language.get("wcf.user.notification.markAllAsConfirmed.confirmMessage"),$.proxy(function(t){"confirm"===t&&(this._proxy.setOption("data",{actionName:"markAllAsConfirmed",className:"wcf\\data\\user\\notification\\UserNotificationAction"}),this._proxy.sendRequest())},this))},_success:function(t,e,i){switch(t.actionName){case"markAllAsConfirmed":$(".jsNotificationItem").remove(),document.title=document.title.replace(/^\(([0-9]+)\) /,"");case"getOutstandingNotifications":t.returnValues&&t.returnValues.template||($("#userNotificationsMarkAllAsConfirmed").prev(".dropdownDivider").remove(),$("#userNotificationsMarkAllAsConfirmed").remove()),this._super(t,e,i);break;case"markAsConfirmed":WCF.Dropdown.getDropdownMenu(this._container.wcfIdentify()).children("li.jsNotificationItem").each(function(e,i){var s=$(i);return t.returnValues.notificationID==s.data("notificationID")?(window.location=s.data("link"),!1):void 0})}}}),WCF.Notification.List=Class.extend({_badge:null,_items:{},_proxy:null,init:function(){var t=$("li.jsNotificationItem");t.length&&(t.each($.proxy(function(t,e){var i=$(e);this._items[i.data("notificationID")]=i,i.find(".jsMarkAsConfirmed").data("notificationID",i.data("notificationID")).click($.proxy(this._click,this)),i.find("p").html(function(t,e){return"<a>"+e+"</a>"}).children("a").data("notificationID",i.data("notificationID")).click($.proxy(this._clickLink,this))},this)),this._badge=$(".jsNotificationsBadge:eq(0)"),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),$(".contentNavigation .jsMarkAllAsConfirmed").click($.proxy(this._markAllAsConfirmed,this)))},_clickLink:function(t){this._items[$(t.currentTarget).data("notificationID")].data("redirect",!0),this._click(t)},_click:function(t){this._proxy.setOption("data",{actionName:"markAsConfirmed",className:"wcf\\data\\user\\notification\\UserNotificationAction",parameters:{notificationID:$(t.currentTarget).data("notificationID")}}),this._proxy.sendRequest()},_markAllAsConfirmed:function(){WCF.System.Confirmation.show(WCF.Language.get("wcf.user.notification.markAllAsConfirmed.confirmMessage"),$.proxy(function(t){"confirm"===t&&(this._proxy.setOption("data",{actionName:"markAllAsConfirmed",className:"wcf\\data\\user\\notification\\UserNotificationAction"}),this._proxy.sendRequest())},this))},_success:function(t){switch(t.actionName){case"markAllAsConfirmed":window.location.reload();break;case"markAsConfirmed":var e=this._items[t.returnValues.notificationID];if(e.data("redirect"))return void(window.location=e.data("link"));this._items[t.returnValues.notificationID].remove(),delete this._items[t.returnValues.notificationID],this._badge.html(t.returnValues.totalCount),document.title=document.title.replace(/^\(([0-9]+)\) /,""),t.returnValues.totalCount>0&&(document.title="("+t.returnValues.totalCount+") "+document.title)}}}),WCF.User.SignaturePreview=WCF.Message.Preview.extend({_handleResponse:function(t){var e=$("#previewContainer");e.length||(e=$('<fieldset id="previewContainer"><legend>'+WCF.Language.get("wcf.global.preview")+"</legend><div></div></fieldset>").insertBefore($("#signatureContainer")).wcfFadeIn()),e.children("div").first().html(t.returnValues.message)}}),WCF.User.RecentActivityLoader=Class.extend({_container:null,_filteredByFollowedUsers:!1,_loadButton:null,_proxy:null,_userID:0,init:function(t,e){return this._container=$("#recentActivities"),this._filteredByFollowedUsers=e===!0,this._userID=t,null===this._userID||this._userID?(this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._loadButton=$('<li class="recentActivitiesMore"><button class="small">'+WCF.Language.get("wcf.user.recentActivity.more")+"</button></li>").appendTo(this._container),void(this._loadButton=this._loadButton.children("button").click($.proxy(this._click,this)))):void console.debug("[WCF.User.RecentActivityLoader] Invalid parameter 'userID' given.")},_click:function(){this._loadButton.enable();var t={lastEventTime:this._container.data("lastEventTime")};this._userID?t.userID=this._userID:this._filteredByFollowedUsers&&(t.filteredByFollowedUsers=1),this._proxy.setOption("data",{actionName:"load",className:"wcf\\data\\user\\activity\\event\\UserActivityEventAction",parameters:t}),this._proxy.sendRequest()},_success:function(t){t.returnValues.template?($(t.returnValues.template).insertBefore(this._loadButton.parent()),this._container.data("lastEventTime",t.returnValues.lastEventTime),this._loadButton.enable()):($("<small>"+WCF.Language.get("wcf.user.recentActivity.noMoreEntries")+"</small>").appendTo(this._loadButton.parent()),this._loadButton.remove())}}),WCF.User.ProfilePreview=WCF.Popover.extend({_proxy:null,_userProfiles:{},init:function(){this._super(".userLink"),this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1})},_loadContent:function(){var t=$("#"+this._activeElementID),e=t.data("userID");if(this._userProfiles[e])this._insertContent(this._activeElementID,this._userProfiles[e],!0);else{this._proxy.setOption("data",{actionName:"getUserProfile",className:"wcf\\data\\user\\UserProfileAction",objectIDs:[e]});var i=this._activeElementID,s=this;this._proxy.setOption("success",function(t){s._userProfiles[e]=t.returnValues.template,s._insertContent(i,t.returnValues.template,!0)}),this._proxy.setOption("failure",function(t){return s._userProfiles[e]=t.message,s._insertContent(i,t.message,!0),!1}),this._proxy.sendRequest()}}}),WCF.User.Action={},WCF.User.Action.Follow=Class.extend({_containerList:null,_followButtonSelector:".jsFollowButton",_userID:0,init:function(t,e){t.length&&(this._containerList=t,e&&(this._followButtonSelector=e),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._containerList.each($.proxy(function(t,e){$(e).find(this._followButtonSelector).click($.proxy(this._click,this))},this)))},_click:function(t){var e=$(t.target);e.is("a")||(e=e.closest("a")),this._userID=e.data("objectID"),this._proxy.setOption("data",{actionName:e.data("following")?"unfollow":"follow",className:"wcf\\data\\user\\follow\\UserFollowAction",parameters:{data:{userID:this._userID}}}),this._proxy.sendRequest()},_success:function(t){this._containerList.each($.proxy(function(e,i){var s=$(i).find(this._followButtonSelector).get(0);return s&&$(s).data("objectID")==this._userID?(s=$(s),t.returnValues.following?s.data("tooltip",WCF.Language.get("wcf.user.button.unfollow")).children(".icon").removeClass("icon-plus").addClass("icon-minus"):s.data("tooltip",WCF.Language.get("wcf.user.button.follow")).children(".icon").removeClass("icon-minus").addClass("icon-plus"),s.data("following",t.returnValues.following),!1):void 0},this));var e=new WCF.System.Notification;e.show()}}),WCF.User.Action.Ignore=Class.extend({_containerList:null,_ignoreButtonSelector:".jsIgnoreButton",_userID:0,init:function(t,e){t.length&&(this._containerList=t,e&&(this._ignoreButtonSelector=e),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._containerList.each($.proxy(function(t,e){$(e).find(this._ignoreButtonSelector).click($.proxy(this._click,this))},this)))},_click:function(t){var e=$(t.target);e.is("a")||(e=e.closest("a")),this._userID=e.data("objectID"),this._proxy.setOption("data",{actionName:e.data("ignored")?"unignore":"ignore",className:"wcf\\data\\user\\ignore\\UserIgnoreAction",parameters:{data:{ignoreUserID:this._userID}}}),this._proxy.sendRequest()},_success:function(t){this._containerList.each($.proxy(function(e,i){var s=$(i).find(this._ignoreButtonSelector).get(0);return s&&$(s).data("objectID")==this._userID?(s=$(s),t.returnValues.isIgnoredUser?s.data("tooltip",WCF.Language.get("wcf.user.button.unignore")).children(".icon").removeClass("icon-ban-circle").addClass("icon-circle-blank"):s.data("tooltip",WCF.Language.get("wcf.user.button.ignore")).children(".icon").removeClass("icon-circle-blank").addClass("icon-ban-circle"),s.data("ignored",t.returnValues.isIgnoredUser),!1):void 0},this));var e=new WCF.System.Notification;e.show()}}),WCF.User.Avatar={},WCF.User.Avatar.Crop=Class.extend({_cropX:0,_cropY:0,_dialog:null,_proxy:null,MAX_THUMBNAIL_SIZE:128,init:function(t){this._avatarID=t,this._dialog&&this.destroy(),this._dialog=null,this._proxy||(this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})),$(".userAvatarCrop").click($.proxy(this._showCropDialog,this))},destroy:function(){this._dialog.remove()},_crop:function(){this._proxy.setOption("data",{actionName:"cropAvatar",className:"wcf\\data\\user\\avatar\\UserAvatarAction",objectIDs:[this._avatarID],parameters:{cropX:this._cropX,cropY:this._cropY}}),this._proxy.sendRequest()},_getCropDialog:function(t){this._dialog||(this._dialog=$("<div />").hide().appendTo(document.body),this._dialog.wcfDialog({title:WCF.Language.get("wcf.user.avatar.type.custom.crop")})),this._dialog.html(t.returnValues.template),this._dialog.find('button[data-type="save"]').click($.proxy(this._crop,this)),this._cropX=t.returnValues.cropX,this._cropY=t.returnValues.cropY;var e=$("#userAvatarCropSelection > img");$("#userAvatarCropSelection").css({height:e.height()+"px",width:e.width()+"px"}),$("#userAvatarCropOverlaySelection").css({"background-image":"url("+e.attr("src")+")","background-position":-this._cropX+"px "+-this._cropY+"px",left:this._cropX+"px",top:this._cropY+"px"}).draggable({containment:"parent",drag:$.proxy(this._updateSelection,this),stop:$.proxy(this._updateSelection,this)}),this._dialog.find('button[data-type="save"]').click($.proxy(this._save,this)),this._dialog.wcfDialog("render")},_showCropDialog:function(){this._dialog?this._dialog.wcfDialog("open"):(this._proxy.setOption("data",{actionName:"getCropDialog",className:"wcf\\data\\user\\avatar\\UserAvatarAction",objectIDs:[this._avatarID]}),this._proxy.sendRequest())},_success:function(t){switch(t.actionName){case"getCropDialog":this._getCropDialog(t);break;case"cropAvatar":$("#avatarUpload > dt > img").replaceWith($('<img src="'+t.returnValues.url+'" alt="" class="userAvatarCrop jsTooltip" title="'+WCF.Language.get("wcf.user.avatar.type.custom.crop")+'" />').css({width:"96px",height:"96px"}).click($.proxy(this._showCropDialog,this))),WCF.DOMNodeInsertedHandler.execute(),this._dialog.wcfDialog("close");var e=new WCF.System.Notification;e.show()}},_updateSelection:function(t,e){this._cropX=e.position.left,this._cropY=e.position.top,$("#userAvatarCropOverlaySelection").css({"background-position":-e.position.left+"px "+-e.position.top+"px"})}}),WCF.User.Avatar.Upload=WCF.Upload.extend({_avatarCrop:null,_userID:0,init:function(t,e){this._super($("#avatarUpload > dd > div"),void 0,"wcf\\data\\user\\avatar\\UserAvatarAction"),this._userID=t||0,this._avatarCrop=e,$("#avatarForm input[type=radio]").change(function(){"custom"==$(this).val()?$("#avatarUpload > dd > div").show():$("#avatarUpload > dd > div").hide()}),$("#avatarForm input[type=radio][value=custom]:checked").length||$("#avatarUpload > dd > div").hide()},_initFile:function(){return $("#avatarUpload > dt > img")},_success:function(t,e){if(e.returnValues.url){this._updateImage(e.returnValues.url,e.returnValues.canCrop),e.returnValues.canCrop?this._avatarCrop?this._avatarCrop.init(e.returnValues.avatarID):this._avatarCrop=new WCF.User.Avatar.Crop(e.returnValues.avatarID):this._avatarCrop&&(this._avatarCrop.destroy(),this._avatarCrop=null),$("#avatarUpload > dd > .innerError").remove();var i=new WCF.System.Notification(WCF.Language.get("wcf.user.avatar.upload.success"));i.show()}else e.returnValues.errorType&&this._getInnerErrorElement().text(WCF.Language.get("wcf.user.avatar.upload.error."+e.returnValues.errorType))},_updateImage:function(t,e){$("#avatarUpload > dt > img").remove();var i=$('<img src="'+t+'" alt="" />').css({height:"auto","max-height":"96px","max-width":"96px",width:"auto"});e&&(i.addClass("userAvatarCrop").addClass("jsTooltip"),i.attr("title",WCF.Language.get("wcf.user.avatar.type.custom.crop"))),$("#avatarUpload > dt").prepend(i),WCF.DOMNodeInsertedHandler.execute()},_getInnerErrorElement:function(){var t=$("#avatarUpload > dd > .innerError");return t.length||(t=$('<small class="innerError"></span>'),$("#avatarUpload > dd").append(t)),t},_getParameters:function(){return{userID:this._userID}}}),WCF.User.List=Class.extend({_additionalParameters:{},_cache:{},_className:"",_dialog:null,_dialogTitle:"",_pageCount:0,_pageNo:1,_proxy:null,init:function(t,e,i){this._additionalParameters=i||{},this._cache={},this._className=t,this._dialog=null,this._dialogTitle=e,this._pageCount=0,this._pageNo=1,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})},open:function(){this._pageNo=1,this._showPage()},_showPage:function(t,e){if(e&&e.activePage&&(this._pageNo=e.activePage),0!=this._pageCount&&(this._pageNo<1||this._pageNo>this._pageCount))return void console.debug("[WCF.User.List] Cannot access page "+this._pageNo+" of "+this._pageCount);if(this._cache[this._pageNo]){var i=!1;null===this._dialog&&(this._dialog=$('<div id="userList'+this._className.hashCode()+'" />').hide().appendTo(document.body),i=!0),this._dialog.empty(),this._dialog.html(this._cache[this._pageNo]),this._pageCount>1&&this._dialog.find(".jsPagination").wcfPages({activePage:this._pageNo,maxPage:this._pageCount}).bind("wcfpagesswitched",$.proxy(this._showPage,this)),i?this._dialog.wcfDialog({title:this._dialogTitle}):this._dialog.wcfDialog("open").wcfDialog("render")}else this._additionalParameters.pageNo=this._pageNo,this._proxy.setOption("data",{actionName:"getGroupedUserList",className:this._className,interfaceName:"wcf\\data\\IGroupedUserListAction",parameters:this._additionalParameters}),this._proxy.sendRequest()},_success:function(t){t.returnValues.pageCount&&(this._pageCount=t.returnValues.pageCount),this._cache[this._pageNo]=t.returnValues.template,this._showPage()}}),WCF.User.ObjectWatch={},WCF.User.ObjectWatch.Subscribe=Class.extend({_buttonSelector:".jsSubscribeButton",_buttons:{},_dialog:null,_notification:null,init:function(){this._buttons={},this._notification=null,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),$(this._buttonSelector).each($.proxy(function(t,e){var i=$(e),s=i.data("objectID");this._buttons[s]=i.click($.proxy(this._click,this))},this))},_click:function(t){var e=$(t.currentTarget);this._proxy.setOption("data",{actionName:"manageSubscription",className:"wcf\\data\\user\\object\\watch\\UserObjectWatchAction",parameters:{objectID:e.data("objectID"),objectType:e.data("objectType")}}),this._proxy.sendRequest()},_success:function(t){if("manageSubscription"===t.actionName){null===this._dialog?(this._dialog=$("<div>"+t.returnValues.template+"</div>").hide().appendTo(document.body),this._dialog.wcfDialog({title:WCF.Language.get("wcf.user.objectWatch.manageSubscription")})):(this._dialog.html(t.returnValues.template),this._dialog.wcfDialog("open")),this._dialog.find(".formSubmit > .jsButtonSave").data("objectID",t.returnValues.objectID).click($.proxy(this._save,this));var e=this._dialog.find("input[name=enableNotification]").disable();this._dialog.find("input[name=subscribe]").change(function(t){var i=$(t.currentTarget);1==i.val()?e.enable():e.disable()});var i=this._dialog.find("input[name=subscribe]:checked");i.length&&1==i.val()&&e.enable()}else"saveSubscription"===t.actionName&&this._dialog.is(":visible")&&(this._dialog.wcfDialog("close"),null===this._notification&&(this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success.edit"))),this._notification.show())},_save:function(t){var e=this._buttons[$(t.currentTarget).data("objectID")],i=this._dialog.find("input[name=subscribe]:checked").val(),s=this._dialog.find("input[name=enableNotification]").is(":checked")?1:0;this._proxy.setOption("data",{actionName:"saveSubscription",className:"wcf\\data\\user\\object\\watch\\UserObjectWatchAction",parameters:{enableNotification:s,objectID:e.data("objectID"),objectType:e.data("objectType"),subscribe:i}}),this._proxy.sendRequest()}});
\ No newline at end of file
diff --git a/wcfsetup/install/files/js/WCF.min.js b/wcfsetup/install/files/js/WCF.min.js
new file mode 100644 (file)
index 0000000..6f3beb0
--- /dev/null
@@ -0,0 +1,6 @@
+function shuffle(t){for(var e,i,n=t.length;0!==n;)i=Math.floor(Math.random()*n),n-=1,e=t[n],t[n]=t[i],t[i]=e;return this}function wcfEval(expression){return eval(expression)}!function(){var t=jQuery.fn.data;jQuery.fn.data=function(e){if(e)switch(typeof e){case"object":for(var i in e)if(i.match(/ID$/)){var n=e[i];delete e[i],i=i.replace(/ID$/,"-id"),e[i]=n}arguments[0]=e;break;case"string":e.match(/ID$/)&&(arguments[0]=e.replace(/ID$/,"-id"))}var a=t.apply(this,arguments);if(void 0===e)for(var i in a)i.match(/Id$/)&&(a[i.replace(/Id$/,"ID")]=a[i],delete a[i]);return a},window.console||(window.console={});for(var e=["log","info","warn","exception","assert","dir","dirxml","trace","group","groupEnd","groupCollapsed","profile","profileEnd","count","clear","time","timeEnd","timeStamp","table","error"],i=0;i<e.length;i++)"undefined"==typeof console[e[i]]&&(console[e[i]]=function(){});"undefined"==typeof console.debug&&(console.debug=function(t){console.log(t)})}(),function(){var t=!1,e=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){},Class.extend=function(i){function n(){!t&&this.init&&this.init.apply(this,arguments)}var a=this.prototype;t=!0;var s=new this;t=!1;for(var o in i)s[o]="function"==typeof i[o]&&"function"==typeof a[o]&&e.test(i[o])?function(t,e){return function(){var i=this._super;this._super=a[t];var n=e.apply(this,arguments);return this._super=i,n}}(o,i[o]):i[o];return n.prototype=s,n.prototype.constructor=n,n.extend=arguments.callee,n}}(),window.matchMedia||(window.matchMedia=function(){"use strict";var t=window.styleMedia||window.media;if(!t){var e=document.createElement("style"),i=document.getElementsByTagName("script")[0],n=null;e.type="text/css",e.id="matchmediajs-test",i.parentNode.insertBefore(e,i),n="getComputedStyle"in window&&window.getComputedStyle(e,null)||e.currentStyle,t={matchMedium:function(t){var i="@media "+t+"{ #matchmediajs-test { width: 1px; } }";return e.styleSheet?e.styleSheet.cssText=i:e.textContent=i,"1px"===n.width}}}return function(e){return{matches:t.matchMedium(e||"all"),media:e||"all"}}}()),function(){if(window.matchMedia&&window.matchMedia("all").addListener)return!1;var t=window.matchMedia,e=t("only all").matches,i=!1,n=0,a=[],s=function(){clearTimeout(n),n=setTimeout(function(){for(var e=0,i=a.length;i>e;e++){var n=a[e].mql,s=a[e].listeners||[],o=t(n.media).matches;if(o!==n.matches){n.matches=o;for(var r=0,l=s.length;l>r;r++)s[r].call(window,n)}}},30)};window.matchMedia=function(n){var o=t(n),r=[],l=0;return o.addListener=function(t){e&&(i||(i=!0,window.addEventListener("resize",s,!0)),0===l&&(l=a.push({mql:o,listeners:r})),r.push(t))},o.removeListener=function(t){for(var e=0,i=r.length;i>e;e++)r[e]===t&&r.splice(e,1)},o}}(),function(t,e,i){var n=e.matchMedia;"undefined"!=typeof module&&module.exports?module.exports=i(n):"function"==typeof define&&define.amd?define(function(){return e[t]=i(n)}):e[t]=i(n)}("enquire",this,function(t){"use strict";function e(t,e){var i,n=0,a=t.length;for(n;a>n&&(i=e(t[n],n),i!==!1);n++);}function i(t){return"[object Array]"===Object.prototype.toString.apply(t)}function n(t){return"function"==typeof t}function a(t){this.options=t,!t.deferSetup&&this.setup()}function s(e,i){this.query=e,this.isUnconditional=i,this.handlers=[],this.mql=t(e);var n=this;this.listener=function(t){n.mql=t,n.assess()},this.mql.addListener(this.listener)}function o(){if(!t)throw Error("matchMedia not present, legacy browsers require a polyfill");this.queries={},this.browserIsIncapable=!t("only all").matches}return a.prototype={setup:function(){this.options.setup&&this.options.setup(),this.initialised=!0},on:function(){!this.initialised&&this.setup(),this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(t){return this.options===t||this.options.match===t}},s.prototype={addHandler:function(t){var e=new a(t);this.handlers.push(e),this.matches()&&e.on()},removeHandler:function(t){var i=this.handlers;e(i,function(e,n){return e.equals(t)?(e.destroy(),!i.splice(n,1)):void 0})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){e(this.handlers,function(t){t.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var t=this.matches()?"on":"off";e(this.handlers,function(e){e[t]()})}},o.prototype={register:function(t,a,o){var r=this.queries,l=o&&this.browserIsIncapable;return r[t]||(r[t]=new s(t,l)),n(a)&&(a={match:a}),i(a)||(a=[a]),e(a,function(e){r[t].addHandler(e)}),this},unregister:function(t,e){var i=this.queries[t];return i&&(e?i.removeHandler(e):(i.clear(),delete this.queries[t])),this}},new o}),function(t,e){"use strict";function i(){}function n(t,e){if(t){"object"==typeof t&&(t=[].slice.call(t));for(var i=0,n=t.length;n>i;i++)e.call(t,t[i],i)}}function a(t,i){var n=Object.prototype.toString.call(i).slice(8,-1);return i!==e&&null!==i&&n===t}function s(t){return a("Function",t)}function o(t){return a("Array",t)}function r(t){var e=t.split("/"),i=e[e.length-1],n=i.indexOf("?");return-1!==n?i.substring(0,n):i}function l(t){t=t||i,t._done||(t(),t._done=1)}function c(t,e,n,a){var s="object"==typeof t?t:{test:t,success:e?o(e)?e:[e]:!1,failure:n?o(n)?n:[n]:!1,callback:a||i},r=!!s.test;return r&&s.success?(s.success.push(s.callback),S.load.apply(null,s.success)):r||!s.failure?a():(s.failure.push(s.callback),S.load.apply(null,s.failure)),S}function h(t){var e,i,n={};if("object"==typeof t)for(e in t)!t[e]||(n={name:e,url:t[e]});else n={name:r(t),url:t};return i=F[n.name],i&&i.url===n.url?i:(F[n.name]=n,n)}function d(t){t=t||F;for(var e in t)if(t.hasOwnProperty(e)&&t[e].state!==M)return!1;return!0}function u(t){t.state=N,n(t.onpreload,function(t){t.call()})}function p(t){t.state===e&&(t.state=O,t.onpreload=[],v({url:t.url,type:"cache"},function(){u(t)}))}function _(){var t=arguments,e=t[t.length-1],i=[].slice.call(t,1),a=i[0];return s(e)||(e=null),o(t[0])?(t[0].push(e),S.load.apply(null,t[0]),S):(a?(n(i,function(t){s(t)||!t||p(h(t))}),g(h(t[0]),s(a)?a:function(){S.load.apply(null,i)})):g(h(t[0])),S)}function f(){var t=arguments,e=t[t.length-1],i={};return s(e)||(e=null),o(t[0])?(t[0].push(e),S.load.apply(null,t[0]),S):(n(t,function(t){t!==e&&(t=h(t),i[t.name]=t)}),n(t,function(t){t!==e&&(t=h(t),g(t,function(){d(i)&&l(e)}))}),S)}function g(t,e){return e=e||i,t.state===M?void e():t.state===L?void S.ready(t.name,e):t.state===O?void t.onpreload.push(function(){g(t,e)}):(t.state=L,void v(t,function(){t.state=M,e(),n(k[t.name],function(t){l(t)}),$&&d()&&n(k.ALL,function(t){l(t)})}))}function m(t){t=t||"";var e=t.split("?")[0].split(".");return e[e.length-1].toLowerCase()}function v(e,n){function a(e){e=e||t.event,r.onload=r.onreadystatechange=r.onerror=null,n()}function s(i){i=i||t.event,("load"===i.type||/loaded|complete/.test(r.readyState)&&(!I.documentMode||I.documentMode<9))&&(t.clearTimeout(e.errorTimeout),t.clearTimeout(e.cssTimeout),r.onload=r.onreadystatechange=r.onerror=null,n())}function o(){if(e.state!==M&&e.cssRetries<=20){for(var i=0,n=I.styleSheets.length;n>i;i++)if(I.styleSheets[i].href===r.href)return void s({type:"load"});e.cssRetries++,e.cssTimeout=t.setTimeout(o,250)}}var r,l,c;n=n||i,l=m(e.url),"css"===l?(r=I.createElement("link"),r.type="text/"+(e.type||"css"),r.rel="stylesheet",r.href=e.url,e.cssRetries=0,e.cssTimeout=t.setTimeout(o,500)):(r=I.createElement("script"),r.type="text/"+(e.type||"javascript"),r.src=e.url),r.onload=r.onreadystatechange=s,r.onerror=a,r.async=!1,r.defer=!1,e.errorTimeout=t.setTimeout(function(){a({type:"timeout"})},7e3),c=I.head||I.getElementsByTagName("head")[0],c.insertBefore(r,c.lastChild)}function b(){for(var t,e=I.getElementsByTagName("script"),i=0,n=e.length;n>i;i++)if(t=e[i].getAttribute("data-headjs-load"),!!t)return void S.load(t)}function w(t,e){var i,a,r;return t===I?($?l(e):D.push(e),S):(s(t)&&(e=t,t="ALL"),o(t)?(i={},n(t,function(t){i[t]=F[t],S.ready(t,function(){d(i)&&l(e)})}),S):"string"==typeof t&&s(e)?(a=F[t],a&&a.state===M||"ALL"===t&&d()&&$?(l(e),S):(r=k[t],r?r.push(e):r=k[t]=[e],S)):S)}function y(){return I.body?void($||($=!0,b(),n(D,function(t){l(t)}))):(t.clearTimeout(S.readyTimeout),void(S.readyTimeout=t.setTimeout(y,50)))}function C(){I.addEventListener?(I.removeEventListener("DOMContentLoaded",C,!1),y()):"complete"===I.readyState&&(I.detachEvent("onreadystatechange",C),y())}var $,x,I=t.document,D=[],k={},F={},T="async"in I.createElement("script")||"MozAppearance"in I.documentElement.style||t.opera,W=t.head_conf&&t.head_conf.head||"head",S=t[W]=t[W]||function(){S.ready.apply(null,arguments)},O=1,N=2,L=3,M=4;if("complete"===I.readyState)y();else if(I.addEventListener)I.addEventListener("DOMContentLoaded",C,!1),t.addEventListener("load",y,!1);else{I.attachEvent("onreadystatechange",C),t.attachEvent("onload",y),x=!1;try{x=!t.frameElement&&I.documentElement}catch(t){}x&&x.doScroll&&function e(){if(!$){try{x.doScroll("left")}catch(i){return t.clearTimeout(S.readyTimeout),void(S.readyTimeout=t.setTimeout(e,50))}y()}}()}S.load=S.js=T?f:_,S.test=c,S.ready=w,S.ready(I,function(){d()&&n(k.ALL,function(t){l(t)}),S.feature&&S.feature("domloaded",!0)})}(window),String.prototype.hashCode=function(){var t,e=0;if(this.length)for(var i=0,n=this.length;n>i;i++)t=this.charCodeAt(i),e=(e<<5)-e+t,e&=e;return e},function(){var t=navigator.userAgent.toLowerCase(),e=/(chrome)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[],i={browser:e[1]||"",version:e[2]||"0"};browser={},i.browser&&(browser[i.browser]=!0,browser.version=i.version),browser.chrome?browser.webkit=!0:browser.webkit&&(browser.safari=!0),jQuery.browser=browser,jQuery.browser.touch=!!("ontouchstart"in window)||!!("msMaxTouchPoints"in window.navigator)&&window.navigator.msMaxTouchPoints>0,jQuery.browser.smartphone="bottom"==$("html").css("caption-side"),jQuery.browser.mozilla&&t.match(/trident/)&&(jQuery.browser.mozilla=!1,jQuery.browser.msie=!0),jQuery.browser.iOS=/\((ipad|iphone|ipod);/.test(t),jQuery.browser.iOS&&$("html").addClass("iOS"),jQuery.browser.android=-1!==t.indexOf("android"),jQuery.browser.editor="ckeditor",jQuery.browser.ckeditor=navigator.userAgent.match(/(Android|Windows Phone)/i)?!1:!0}(),function(t){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}(navigator.userAgent||navigator.vendor||window.opera);var WCF={};$.extend(!0,{removeArrayValue:function(t,e){return $.grep(t,function(t){return e!==t})},wcfEscapeID:function(t){return t.replace(/(:|\.)/g,"\\$1")},wcfIsset:function(t){return!!$("#"+$.wcfEscapeID(t)).length},getLength:function(t){var e=0;for(var i in t)t.hasOwnProperty(i)&&e++;return e}}),$.fn.extend({getTagName:function(){return this.length?this.get(0).tagName.toLowerCase():""},getDimensions:function(t){var e=css={},i=!1;switch(this.is(":hidden")&&(css=WCF.getInlineCSS(this),i=!0,this.css({display:"block",visibility:"hidden"})),t){case"inner":e={height:this.innerHeight(),width:this.innerWidth()};break;case"outer":e={height:this.outerHeight(),width:this.outerWidth()};break;default:e={height:this.height(),width:this.width()}}return i&&WCF.revertInlineCSS(this,css,["display","visibility"]),e},getOffsets:function(t){var e=css={},i=!1;switch(this.is(":hidden")&&(css=WCF.getInlineCSS(this),i=!0,this.css({display:"block",visibility:"hidden"})),t){case"offset":e=this.offset();break;case"position":default:e=this.position()}return i&&WCF.revertInlineCSS(this,css,["display","visibility"]),e},makePositioned:function(t,e){"absolute"!=t&&"fixed"!=t&&(t="absolute");var i=this.getOffsets("position");return this.css({position:t,left:i.left,margin:0,top:i.top}),e&&this.remove().appentTo("body"),this},disable:function(){return this.attr("disabled","disabled")},enable:function(){return this.removeAttr("disabled")},wcfIdentify:function(){return this.attr("id")||this.attr("id",WCF.getRandomID()),this.attr("id")},getCaret:function(){if(this.is("input")){if("text"!=this.attr("type")&&"password"!=this.attr("type"))return-1}else if(!this.is("textarea"))return-1;var t=0,e=this.get(0);if(document.selection){this.focus();var i=document.selection.createRange();i.moveStart("character",-this.val().length),t=i.text.length}else(e.selectionStart||"0"==e.selectionStart)&&(t=parseInt(e.selectionStart));return t},setCaret:function(t){if(this.is("input")){if("text"!=this.attr("type")&&"password"!=this.attr("type"))return!1}else if(!this.is("textarea"))return!1;var e=this.get(0);if(this.focus(),document.selection){var i=document.selection.createRange();i.moveStart("character",t),i.moveEnd("character",0),i.select()}else(e.selectionStart||"0"==e.selectionStart)&&(e.selectionStart=t,e.selectionEnd=t);return!0},wcfDropIn:function(t,e,i){return t||(t="up"),i&&parseInt(i)||(i=200),this.show(WCF.getEffect(this,"drop"),{direction:t},i,e)},wcfDropOut:function(t,e,i){return t||(t="down"),i&&parseInt(i)||(i=200),this.hide(WCF.getEffect(this,"drop"),{direction:t},i,e)},wcfBlindIn:function(t,e,i){return t||(t="vertical"),i&&parseInt(i)||(i=200),this.show(WCF.getEffect(this,"blind"),{direction:t},i,e)},wcfBlindOut:function(t,e,i){return t||(t="vertical"),i&&parseInt(i)||(i=200),this.hide(WCF.getEffect(this,"blind"),{direction:t},i,e)},wcfHighlight:function(t,e){return this.effect("highlight",t,600,e)},wcfFadeIn:function(t,e){return e&&parseInt(e)||(e=200),this.show(WCF.getEffect(this,"fade"),{},e,t)},wcfFadeOut:function(t,e){return e&&parseInt(e)||(e=200),this.hide(WCF.getEffect(this,"fade"),{},e,t)}}),$.extend(WCF,{activeDialogs:0,_idCounter:0,getRandomID:function(){var t="";do t="wcf"+this._idCounter++;while($.wcfIsset(t));return t},inArray:function(t,e){return-1!=$.inArray(t,e)},getEffect:function(t,e){return t.is("tr")?"highlight":e},getInlineCSS:function(t){var e={},i=t.attr("style");if(!i)return{};i=i.split(";");for(var n=0,a=i.length;a>n;n++){var s=$.trim(i[n]);""!=s&&(s=s.split(":"),e[$.trim(s[0])]=$.trim(s[1]))}return e},revertInlineCSS:function(t,e,i){for(var n=0,a=i.length;a>n;n++){var s=i[n];e[s]?t.css(s,e[s]):t.css(s,"")}}}),WCF.Browser={_isChrome:null,isChrome:function(){return null===this._isChrome&&(this._isChrome=!1,/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())&&(this._isChrome=!0)),this._isChrome}},WCF.Dropdown={_callbacks:{},_didInit:!1,_dropdowns:{},_menuContainer:null,_menus:{},init:function(){null===this._menuContainer&&(this._menuContainer=$('<div id="dropdownMenuContainer" />').appendTo(document.body));var t=this;$(".dropdownToggle:not(.jsDropdownEnabled)").each(function(e,i){t.initDropdown($(i),!1)}),this._didInit||(this._didInit=!0,WCF.CloseOverlayHandler.addCallback("WCF.Dropdown",$.proxy(this._closeAll,this)),WCF.DOMNodeInsertedHandler.addCallback("WCF.Dropdown",$.proxy(this.init,this)),$(document).on("scroll",$.proxy(this._scroll,this)))},_dialogScroll:function(t){var e=$(t.currentTarget);e.find(".dropdown.dropdownOpen").each(function(t,i){var n=$(i),a=n.wcfIdentify(),s=n.offset(),o=e.offset(),r=$(i).height()/2;s.top+r<=o.top?WCF.Dropdown.toggleDropdown(a):s.top>=o.top+e.height()?WCF.Dropdown.toggleDropdown(a):s.left<=o.left?WCF.Dropdown.toggleDropdown(a):s.left>=o.left+e.width()?WCF.Dropdown.toggleDropdown(a):WCF.Dropdown.setAlignmentByID(n.wcfIdentify())})},_scroll:function(){for(var t in this._dropdowns){var e=this._dropdowns[t];e.data("isOverlayDropdownButton")&&e.hasClass("dropdownOpen")&&this.setAlignmentByID(t)}},initDropdown:function(t,e){if(!t.hasClass("jsDropdownEnabled")&&!t.data("target")){var i=t.parents(".dropdown");if(!i.length)return void console.debug("[WCF.Dropdown] Invalid dropdown passed, button '"+t.wcfIdentify()+"' does not have a parent with .dropdown, aborting.");var n=t.next(".dropdownMenu");if(!n.length)return void console.debug("[WCF.Dropdown] Invalid dropdown passed, dropdown '"+i.wcfIdentify()+"' does not have a dropdown menu, aborting.");n.detach().appendTo(this._menuContainer);var a=i.wcfIdentify();this._dropdowns[a]||(t.addClass("jsDropdownEnabled").click($.proxy(this._toggle,this)),this._dropdowns[a]=i,this._menus[a]=n,a.match(/^wcf\d+$/)||n.attr("data-source",a)),t.data("target",a),e&&t.trigger("click")}},removeDropdown:function(t){this._menus[t]&&($(this._menus[t]).remove(),delete this._menus[t],delete this._dropdowns[t])},initDropdownFragment:function(t,e){var i=t.wcfIdentify();return this._dropdowns[i]?void console.debug("[WCF.Dropdown] Cannot register dropdown identified by '"+i+"' as a fragement."):(this._dropdowns[i]=t,void(this._menus[i]=e.detach().appendTo(this._menuContainer)))},registerCallback:function(t,e){return $.isFunction(e)?(this._callbacks[t]||(this._callbacks[t]=[]),void this._callbacks[t].push(e)):(console.debug("[WCF.Dropdown] Callback for '"+t+"' is invalid"),!1)},_toggle:function(t,e){var i=null===t?e:$(t.currentTarget).data("target"),n=this._dropdowns[i];if(n&&void 0===n.data("isOverlayDropdownButton")){var a=n.parents(".dialogContent");n.data("isOverlayDropdownButton",a.length>0),a.length&&a.on("scroll",this._dialogScroll)}for(var s in this._dropdowns){var o=this._dropdowns[s],r=this._menus[s];o.hasClass("dropdownOpen")?(o.removeClass("dropdownOpen"),r.removeClass("dropdownOpen"),this._notifyCallbacks(s,"close")):s===i&&(o.addClass("dropdownOpen"),r.addClass("dropdownOpen"),this._notifyCallbacks(s,"open"),this.setAlignment(o,r))}return null!==t?(t.stopPropagation(),!1):void 0},toggleDropdown:function(t){this._toggle(null,t)},getDropdown:function(t){return this._dropdowns[t]?this._dropdowns[t]:null},getDropdownMenu:function(t){return this._menus[t]?this._menus[t]:null},setAlignmentByID:function(t){var e=this.getDropdown(t);null===e&&console.debug("[WCF.Dropdown] Unable to find dropdown identified by '"+t+"'");var i=this.getDropdownMenu(t);null===i&&console.debug("[WCF.Dropdown] Unable to find dropdown menu identified by '"+t+"'"),this.setAlignment(e,i)},setAlignment:function(t,e){e.data("isInitialized")||e.data("isInitialized",!0).css({left:0,top:0});var i=t.getDimensions("outer"),n=t.getOffsets("offset"),a=e.getDimensions("outer"),s=$(window).width(),o=t.find(".dropdownToggle");o.hasClass("dropdownCaptionTextarea")&&(i=o.getDimensions("outer"));var r="left";n.left+a.width>s&&(r="right");var l="auto",c="auto";if("left"===r?(e.removeClass("dropdownArrowRight"),l=n.left):(e.addClass("dropdownArrowRight"),c=s-(n.left+i.width)),"rtl"==WCF.Language.get("wcf.global.pageDirection")){var h=l,d=c;"auto"==l?e.removeClass("dropdownArrowRight"):(c=s-(n.left+i.width),l="auto",c+a.width>s&&(l=h,c=d,e.addClass("dropdownArrowRight")))}"auto"==l?c+="px":l+="px";var u=!0;e.hasClass("dropdownOpen")&&(u=!1,e.removeClass("dropdownOpen"));var p="auto",_=n.top+i.height+7;if($.browser.smartphone){var r="bottom",f=!1,g=$(window).height(),m=_+a.height;if(m>g){var v=n.top+10-a.height;if(v>=0)r="top";else{f=!0;var b=Math.abs(v),w=Math.abs(m-g);r=b>=w?"bottom":"top"}}if("top"==r)p=$(window).height()-n.top+10,_="auto",f&&(_=0,e.children("ul.scrollableDropdownMenu").css("max-height",p)),e.addClass("dropdownArrowBottom");else{if(f){p=0;var y=e.children("ul.scrollableDropdownMenu");y.css("max-height",Math.min(y.css("max-height").replace(/px$/,""),g-_))}e.removeClass("dropdownArrowBottom")}}else _+a.height>$(window).height()+$(document).scrollTop()?(p=$(window).height()-n.top+10,_="auto",e.addClass("dropdownArrowBottom")):e.removeClass("dropdownArrowBottom");u||e.addClass("dropdownOpen"),e.css({bottom:p,left:l,right:c,top:_})},_closeAll:function(){for(var t in this._dropdowns){var e=this._dropdowns[t];e.hasClass("dropdownOpen")&&(e.removeClass("dropdownOpen"),this._menus[t].removeClass("dropdownOpen"),this._notifyCallbacks(t,"close"))}},close:function(t){this._dropdowns[t]&&(this._dropdowns[t].removeClass("dropdownMenu"),this._menus[t].removeClass("dropdownMenu"))},_notifyCallbacks:function(t,e){if(this._callbacks[t])for(var i=0,n=this._callbacks[t].length;n>i;i++)this._callbacks[t][i](t,e)}},WCF.Clipboard={_actionProxy:null,_actionObjects:{},_containers:null,_containerData:{},_hasMarkedItems:!1,_markedObjectIDs:{},_page:"",_pageObjectID:0,_proxy:null,_trackedElements:{},init:function(t,e,i,n){this._page=t,this._actionObjects=i||{},this._hasMarkedItems=e>0,this._pageObjectID=parseInt(n)||0,this._actionProxy=new WCF.Action.Proxy({success:$.proxy(this._actionSuccess,this),url:"index.php/ClipboardProxy/?t="+SECURITY_TOKEN+SID_ARG_2ND}),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this),url:"index.php/Clipboard/?t="+SECURITY_TOKEN+SID_ARG_2ND}),this._containers=$(".jsClipboardContainer").each($.proxy(function(t,e){this._initContainer(e)},this)),this._hasMarkedItems&&this._containers.length&&this._loadMarkedItems();var a=this;WCF.DOMNodeInsertedHandler.addCallback("WCF.Clipboard",function(){a._containers=$(".jsClipboardContainer").each($.proxy(function(t,e){a._initContainer(e)},a))})},_loadMarkedItems:function(){new WCF.Action.Proxy({autoSend:!0,data:{containerData:this._containerData,pageClassName:this._page,pageObjectID:this._pageObjectID},success:$.proxy(this._loadMarkedItemsSuccess,this),url:"index.php/ClipboardLoadMarkedItems/?t="+SECURITY_TOKEN+SID_ARG_2ND})},reload:function(){null!==this._containers&&this._loadMarkedItems()},_loadMarkedItemsSuccess:function(t,e,i){this._resetMarkings();for(var n in t.markedItems){this._markedObjectIDs[n]||(this._markedObjectIDs[n]=[]);var a=t.markedItems[n];for(var s in a)this._markedObjectIDs[n].push(a[s]);this._containers.each($.proxy(function(t,e){var i=$(e);return i.data("type")!=n?!0:(i.find("input.jsClipboardItem").each($.proxy(function(t,e){var i=$(e);WCF.inArray(i.data("objectID"),this._markedObjectIDs[n])&&(i.prop("checked",!0),i.parents(".jsClipboardObject").addClass("jsMarked"))},this)),void i.find("input.jsClipboardMarkAll").each(function(t,e){var n=!0;i.find("input.jsClipboardItem").each(function(t,e){var i=$(e);i.prop("checked")||(n=!1)}),n&&$(e).prop("checked",!0)}))},this))}this._success(t,e,i)},_resetMarkings:function(){this._containers.each($.proxy(function(t,e){var i=$(e);this._markedObjectIDs[i.data("type")]=[],i.find("input.jsClipboardItem, input.jsClipboardMarkAll").prop("checked",!1),i.find(".jsClipboardObject").removeClass("jsMarked")},this))},_initContainer:function(t){var e=$(t),i=e.wcfIdentify();this._trackedElements[i]||(e.find(".jsClipboardMarkAll").data("hasContainer",i).click($.proxy(this._markAll,this)),this._markedObjectIDs[e.data("type")]=[],this._containerData[e.data("type")]={},$.each(e.data(),$.proxy(function(t,i){t.match(/^type(.+)/)&&(this._containerData[e.data("type")][WCF.String.lcfirst(t.replace(/^type/,""))]=i)},this)),this._trackedElements[i]=[]),e.find("input.jsClipboardItem").each($.proxy(function(t,e){var n=$(e),a=n.wcfIdentify();WCF.inArray(a,this._trackedElements[i])||(this._trackedElements[i].push(a),n.data("hasContainer",i).click($.proxy(this._click,this)))},this))},_click:function(t){var e=$(t.target),i=e.data("objectID"),n=e.prop("checked")?!0:!1,a=[i];if(e.data("hasContainer"))var s=$("#"+e.data("hasContainer")),o=s.data("type");else var o=e.data("type");if(n?(this._markedObjectIDs[o].push(i),e.parents(".jsClipboardObject").addClass("jsMarked")):(this._markedObjectIDs[o]=$.removeArrayValue(this._markedObjectIDs[o],i),e.parents(".jsClipboardObject").removeClass("jsMarked")),e.data("hasContainer")){var r=!0;s.find("input.jsClipboardItem").each(function(t,e){var i=$(e);i.prop("checked")||(r=!1)}),s.find(".jsClipboardMarkAll").each(function(t,e){r?$(e).prop("checked",!0):$(e).prop("checked",!1)})}this._saveState(o,a,n)},_markAll:function(t){var e=$(t.target),i=[],n=!0;if(e.is("input")&&(n=e.prop("checked")),e.data("hasContainer"))var a=$("#"+e.data("hasContainer")),s=a.data("type");else var s=e.data("type");e.data("hasContainer")&&(a.find("input.jsClipboardItem").each($.proxy(function(t,e){var a=$(e),o=a.data("objectID");n?a.prop("checked")||(a.prop("checked",!0),this._markedObjectIDs[s].push(o),i.push(o)):a.prop("checked")&&(a.prop("checked",!1),this._markedObjectIDs[s]=$.removeArrayValue(this._markedObjectIDs[s],o),i.push(o))},this)),n?a.find(".jsClipboardObject").addClass("jsMarked"):a.find(".jsClipboardObject").removeClass("jsMarked")),this._saveState(s,i,n)},_saveState:function(t,e,i){this._proxy.setOption("data",{action:i?"mark":"unmark",containerData:this._containerData,objectIDs:e,pageClassName:this._page,pageObjectID:this._pageObjectID,type:t}),this._proxy.sendRequest()},_success:function(data,textStatus,jqXHR){var $containers={};if($(".jsClipboardEditor").each(function(index,container){for(var $container=$(container),$types=eval($container.data("types")),$i=0,$length=$types.length;$length>$i;$i++){var $typeName=$types[$i];$containers[$typeName]=$container}var $containerID=$container.wcfIdentify();WCF.CloseOverlayHandler.removeCallback($containerID),$container.empty()}),data.items)for(var $typeName in data.items)if($containers[$typeName]){var $container=$containers[$typeName],$list=$container.children("ul");0==$list.length&&($list=$("<ul />").appendTo($container));var $editor=data.items[$typeName],$label=$('<li class="dropdown"><span class="dropdownToggle button">'+$editor.label+"</span></li>").appendTo($list),$itemList=$('<ol class="dropdownMenu"></ol>').appendTo($label);for(var $itemIndex in $editor.items){var $item=$editor.items[$itemIndex],$listItem=$("<li><span>"+$item.label+"</span></li>").appendTo($itemList);$listItem.data("container",$container),$listItem.data("objectType",$typeName),$listItem.data("actionName",$item.actionName).data("parameters",$item.parameters),$listItem.data("internalData",$item.internalData).data("url",$item.url).data("type",$typeName),$listItem.click($.proxy(this._executeAction,this))}$('<li class="dropdownDivider" />').appendTo($itemList);var $foo=$typeName;$("<li><span>"+WCF.Language.get("wcf.clipboard.item.unmarkAll")+"</span></li>").data("typeName",$typeName).appendTo($itemList).click($.proxy(function(t){var e=$(t.currentTarget).data("typeName");this._proxy.setOption("data",{action:"unmarkAll",type:e}),this._proxy.setOption("success",$.proxy(function(t,i,n){this._containers.each($.proxy(function(t,i){var n=$(i);return n.data("type")==e?(n.find(".jsClipboardMarkAll, .jsClipboardItem").prop("checked",!1),n.find(".jsClipboardObject").removeClass("jsMarked"),!1):void 0},this)),this._success(t,i,n),this._proxy.setOption("success",$.proxy(this._success,this)),this._loadMarkedItems()},this)),this._proxy.sendRequest()},this)),WCF.Dropdown.initDropdown($label.children(".dropdownToggle"),!1)}},_closeLists:function(){$(".jsClipboardEditor ul").removeClass("dropdownOpen")},_executeAction:function(t){var e=$(t.currentTarget),i=e.data("url");if(i&&(window.location.href=i),e.data("parameters").className&&e.data("parameters").actionName&&("unmarkAll"===e.data("parameters").actionName||e.data("parameters").objectIDs)){var n=e.data("internalData").confirmMessage;if(n){var a=e.data("internalData").template;a&&(a=$(a)),WCF.System.Confirmation.show(n,$.proxy(function(t){if("confirm"===t){var i={};a&&a.length&&$("#wcfSystemConfirmationContent").find("input, select, textarea").each(function(t,e){var n=$(e);i[n.prop("name")]=n.val()}),this._executeAJAXActions(e,i)}},this),"",a)}else this._executeAJAXActions(e,{})}e.data("container").trigger("clipboardAction",[e.data("type"),e.data("actionName"),e.data("parameters")])},_executeAJAXActions:function(t,e){e=e||{};var i=[];"unmarkAll"!==t.data("parameters").actionName&&$.each(t.data("parameters").objectIDs,function(t,e){i.push(parseInt(e))});var n={data:e,containerData:this._containerData[t.data("type")]},a=t.data("internalData").parameters;if(void 0!==a)for(var s in a)n[s]=a[s];new WCF.Action.Proxy({autoSend:!0,data:{actionName:t.data("parameters").actionName,className:t.data("parameters").className,objectIDs:i,parameters:n},success:$.proxy(function(e){"unmarkAll"!==t.data("parameters").actionName&&t.data("container").trigger("clipboardActionResponse",[e,t.data("type"),t.data("actionName"),t.data("parameters")]),this._loadMarkedItems()},this)}),this._actionObjects[t.data("objectType")]&&this._actionObjects[t.data("objectType")][t.data("parameters").actionName]&&this._actionObjects[t.data("objectType")][t.data("parameters").actionName].triggerEffect(i)},sendRequest:function(t){var e=$(t);this._actionProxy.setOption("data",{parameters:e.data("parameters"),typeName:e.data("type")}),this._actionProxy.sendRequest()}},WCF.PeriodicalExecuter=Class.extend({_callback:null,_delay:0,_intervalID:null,_isExecuting:!1,init:function(t,e){return $.isFunction(t)?(this._callback=t,this._interval=e,void this.resume()):void console.debug("[WCF.PeriodicalExecuter] Given callback is invalid, aborting.")},_execute:function(){if(!this._isExecuting)try{this._isExecuting=!0,this._callback(this),this._isExecuting=!1}catch(t){throw this._isExecuting=!1,t}},stop:function(){this._intervalID&&clearInterval(this._intervalID)},resume:function(){this._intervalID&&this.stop(),this._intervalID=setInterval($.proxy(this._execute,this),this._interval)}}),WCF.LoadingOverlayHandler={_activeRequests:0,_loadingOverlay:null,_pending:null,show:function(){if(null===this._loadingOverlay){this._loadingOverlay=$('<div class="spinner"><span class="icon icon48 icon-spinner" /> <span>'+WCF.Language.get("wcf.global.loading")+"</span></div>").appendTo($("body"));var t=this._loadingOverlay.outerWidth();70>t&&(t=70),this._loadingOverlay.css({marginLeft:Math.ceil(-1*t/2),width:t}).hide()}if(this._activeRequests++,1==this._activeRequests&&null===this._pending){var e=this;this._pending=new WCF.PeriodicalExecuter(function(t){e._activeRequests&&e._loadingOverlay.stop(!0,!0).fadeIn(100),t.stop(),e._pending=null},250)}},hide:function(){this._activeRequests--,0==this._activeRequests&&(null!==this._pending&&(this._pending.stop(),this._pending=null),this._loadingOverlay.stop(!0,!0).fadeOut(100))},updateIcon:function(t,e){var i=void 0===e||e?"addClass":"removeClass";t.find(".icon")[i]("icon-spinner"),t.hasClass("icon")&&t[i]("icon-spinner");
+
+}},WCF.Action={},WCF.Action.Proxy=Class.extend({_showLoadingOverlayOnce:!1,_suppressErrors:!1,_lastRequest:null,init:function(t){this.options=$.extend(!0,{autoSend:!1,data:{},dataType:"json",after:null,init:null,jsonp:"callback",async:!0,failure:null,showLoadingOverlay:!0,success:null,suppressErrors:!1,type:"POST",url:"index.php/AJAXProxy/?t="+SECURITY_TOKEN+SID_ARG_2ND,aborted:null,autoAbortPrevious:!1},t),this.confirmationDialog=null,this.loading=null,this._showLoadingOverlayOnce=!1,this._suppressErrors=this.options.suppressErrors===!0,this.options.autoSend&&this.sendRequest();var e=this;$(window).on("beforeunload",function(){e._suppressErrors=!0})},sendRequest:function(t){return this._init(),(t||this.options.autoAbortPrevious)&&this.abortPrevious(),this._lastRequest=$.ajax({data:this.options.data,dataType:this.options.dataType,jsonp:this.options.jsonp,async:this.options.async,type:this.options.type,url:this.options.url,success:$.proxy(this._success,this),error:$.proxy(this._failure,this)}),this._lastRequest},abortPrevious:function(){null!==this._lastRequest&&(this._lastRequest.abort(),this._lastRequest=null,(this.options.showLoadingOverlay||this._showLoadingOverlayOnce)&&WCF.LoadingOverlayHandler.hide())},showLoadingOverlayOnce:function(){this._showLoadingOverlayOnce=!0},suppressErrors:function(){this._suppressErrors=!0},_init:function(){$.isFunction(this.options.init)&&this.options.init(this),(this.options.showLoadingOverlay||this._showLoadingOverlayOnce)&&WCF.LoadingOverlayHandler.show()},_failure:function(t,e,i){if("abort"==e)return void($.isFunction(this.options.aborted)&&this.options.aborted(t));try{var n=$.parseJSON(t.responseText),a=!0;if($.isFunction(this.options.failure)&&(a=this.options.failure(n,t,e,i)),!this._suppressErrors&&a!==!1){var s="";n.stacktrace?s="<br /><p>Stacktrace:</p><p>"+n.stacktrace+"</p>":n.exceptionID&&(s="<br /><p>Exception ID: <code>"+n.exceptionID+"</code></p>"),$('<div class="ajaxDebugMessage"><p>'+n.message+"</p>"+s+"</div>").wcfDialog({title:WCF.Language.get("wcf.global.error.title")})}}catch(n){var a=!0;if($.isFunction(this.options.failure)&&(a=this.options.failure(null,t,e,i)),!this._suppressErrors&&a!==!1){var o="timeout"===e?WCF.Language.get("wcf.global.error.timeout"):t.responseText;o&&"undefined"!=o&&$('<div class="ajaxDebugMessage"><p>'+o+"</p></div>").wcfDialog({title:WCF.Language.get("wcf.global.error.title")})}}this._after()},_success:function(t,e,i){$.isFunction(this.options.success)&&(t&&t.returnValues&&void 0!==t.returnValues.template&&(t.returnValues.template=$.trim(t.returnValues.template)),this.options.success(t,e,i)),this._after()},_after:function(){this._lastRequest=null,$.isFunction(this.options.after)&&this.options.after(),(this.options.showLoadingOverlay||this._showLoadingOverlayOnce)&&(WCF.LoadingOverlayHandler.hide(),this._showLoadingOverlayOnce&&(this._showLoadingOverlayOnce=!1)),WCF.DOMNodeInsertedHandler.execute(),$("a[href*=#]").each(function(t,e){var i=$(e);if(-1!=i.prop("href").indexOf("AJAXProxy")){var n=i.prop("href").substr(i.prop("href").indexOf("#")),a=document.location.toString().replace(/#.*/,"");i.prop("href",a+n)}})},setOption:function(t,e){this.options[t]=e}}),WCF.Action.SimpleProxy=Class.extend({init:function(t,e){this.options=$.extend(!0,{action:"",className:"",elements:null,eventName:"click"},t),this.callbacks=$.extend(!0,{after:null,failure:null,init:null,success:null},e),this.options.elements&&(this.proxy=new WCF.Action.Proxy(this.callbacks),this.options.elements.each($.proxy(function(t,e){$(e).bind(this.options.eventName,$.proxy(this._handleEvent,this))},this)))},_handleEvent:function(t){this.proxy.setOption("data",{actionName:this.options.action,className:this.options.className,objectIDs:[$(t.target).data("objectID")]}),this.proxy.sendRequest()}}),WCF.Action.Delete=Class.extend({_buttonSelector:"",_className:"",_containerSelector:"",_containers:[],init:function(t,e,i){this._containerSelector=e,this._className=t,this._buttonSelector=i?i:".jsDeleteButton",this.proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._initElements(),WCF.DOMNodeInsertedHandler.addCallback("WCF.Action.Delete"+this._className.hashCode(),$.proxy(this._initElements,this))},_initElements:function(){var t=this;$(this._containerSelector).each(function(e,i){var n=$(i),a=n.wcfIdentify();WCF.inArray(a,t._containers)||(t._containers.push(a),n.find(t._buttonSelector).click($.proxy(t._click,t)))})},_click:function(t){var e=$(t.currentTarget);t.preventDefault(),e.data("confirmMessage")?WCF.System.Confirmation.show(e.data("confirmMessage"),$.proxy(this._execute,this),{target:e}):(WCF.LoadingOverlayHandler.updateIcon(e),this._sendRequest(e))},_didTriggerEffect:function(){},_execute:function(t,e){"cancel"!==t&&(WCF.LoadingOverlayHandler.updateIcon(e.target),this._sendRequest(e.target))},_sendRequest:function(t){this.proxy.setOption("data",{actionName:"delete",className:this._className,interfaceName:"wcf\\data\\IDeleteAction",objectIDs:[$(t).data("objectID")]}),this.proxy.sendRequest()},_success:function(t){this.triggerEffect(t.objectIDs)},triggerEffect:function(t){for(var e in this._containers){var i=$("#"+this._containers[e]);if(WCF.inArray(i.find(this._buttonSelector).data("objectID"),t)){var n=this;i.wcfBlindOut("up",function(){$(this).remove(),n._containers.splice(n._containers.indexOf($(this).wcfIdentify()),1),n._didTriggerEffect($(this))})}}}}),WCF.Action.NestedDelete=WCF.Action.Delete.extend({triggerEffect:function(t){for(var e in this._containers){var i=$("#"+this._containers[e]);if(WCF.inArray(i.find(this._buttonSelector).data("objectID"),t))if(i.has("ol").has("li").length)i.is(":only-child")?i.parent().replaceWith(i.find("> ol")):i.replaceWith(i.find("> ol > li")),this._containers.splice(this._containers.indexOf(i.wcfIdentify()),1),this._didTriggerEffect(i);else{var n=this;i.wcfBlindOut("up",function(){$(this).remove(),n._containers.splice(n._containers.indexOf($(this).wcfIdentify()),1),n._didTriggerEffect($(this))})}}}}),WCF.Action.Toggle=Class.extend({_buttonSelector:".jsToggleButton",_className:"",_containerSelector:"",_containers:[],init:function(t,e,i){this._containerSelector=e,this._className=t,this._buttonSelector=i?i:".jsToggleButton",this._containers=[];var n={success:$.proxy(this._success,this)};this.proxy=new WCF.Action.Proxy(n),this._initElements(),WCF.DOMNodeInsertedHandler.addCallback("WCF.Action.Toggle"+this._className.hashCode(),$.proxy(this._initElements,this))},_initElements:function(){$(this._containerSelector).each($.proxy(function(t,e){var i=$(e),n=i.wcfIdentify();WCF.inArray(n,this._containers)||(this._containers.push(n),i.find(this._buttonSelector).click($.proxy(this._click,this)))},this))},_click:function(t){var e=$(t.currentTarget);t.preventDefault(),e.data("confirmMessage")?WCF.System.Confirmation.show(e.data("confirmMessage"),$.proxy(this._execute,this),{target:e}):(WCF.LoadingOverlayHandler.updateIcon(e),this._sendRequest(e))},_execute:function(t,e){"cancel"!==t&&(WCF.LoadingOverlayHandler.updateIcon(e.target),this._sendRequest(e.target))},_sendRequest:function(t){this.proxy.setOption("data",{actionName:"toggle",className:this._className,interfaceName:"wcf\\data\\IToggleAction",objectIDs:[$(t).data("objectID")]}),this.proxy.sendRequest()},_success:function(t){this.triggerEffect(t.objectIDs)},triggerEffect:function(t){for(var e in this._containers){var i=$("#"+this._containers[e]),n=i.find(this._buttonSelector);WCF.inArray(n.data("objectID"),t)&&(i.wcfHighlight(),this._toggleButton(i,n))}},_toggleButton:function(t,e){WCF.LoadingOverlayHandler.updateIcon(e,!1),e.hasClass("icon-check-empty")?(e.removeClass("icon-check-empty").addClass("icon-check"),$newTitle=e.data("disableTitle")?e.data("disableTitle"):WCF.Language.get("wcf.global.button.disable"),e.attr("title",$newTitle)):(e.removeClass("icon-check").addClass("icon-check-empty"),$newTitle=e.data("enableTitle")?e.data("enableTitle"):WCF.Language.get("wcf.global.button.enable"),e.attr("title",$newTitle)),t.toggleClass("disabled")}}),WCF.Action.Scroll=Class.extend({_callback:null,_reference:null,_target:null,_threshold:0,init:function(t,e,i,n){return this._threshold=parseInt(t),0===this._threshold?void console.debug("[WCF.Action.Scroll] Given threshold is invalid, aborting."):($.isFunction(e)&&(this._callback=e),null===this._callback?void console.debug("[WCF.Action.Scroll] Given callback is invalid, aborting."):(this._reference=$(i?i:window),this._target=$(n?n:document),this.start(),void this._scroll()))},_scroll:function(){var t=this._target.height(),e=this._reference.scrollTop(),i=this._reference.height();t-(i+e)<this._threshold&&this._callback(this)},start:function(){this._reference.on("scroll",$.proxy(this._scroll,this))},stop:function(){this._reference.off("scroll")}}),WCF.Date={},WCF.Date.Picker={_dateFormat:"yy-mm-dd",_timeFormat:"g:ia",init:function(){var t=$.timepicker.log;$.timepicker.log=function(e){-1==e.indexOf("Error parsing the date/time string: Unexpected literal at position")&&-1==e.indexOf("Error parsing the date/time string: Unknown name at position")&&t(e)},this._convertDateFormat(),this._initDatePicker(),WCF.DOMNodeInsertedHandler.addCallback("WCF.Date.Picker",$.proxy(this._initDatePicker,this))},_convertDateFormat:function(){var t={a:"tt",A:"TT",g:"h",G:"H",h:"hh",H:"HH",i:"mm",s:"ss",u:"l",d:"dd",D:"D",j:"d",l:"DD",z:"o",S:"",F:"MM",m:"mm",M:"M",n:"m",o:"yy",Y:"yy",y:"y",U:"@"};this._dateFormat=WCF.Language.get("wcf.date.dateFormat").replace(/([^dDjlzSFmMnoYyU\\]*(?:\\.[^dDjlzSFmMnoYyU\\]*)*)([dDjlzSFmMnoYyU])/g,function(e,i,n){for(var a in t)n==a&&(n=t[a]);return i+n}),this._timeFormat=WCF.Language.get("wcf.date.timeFormat").replace(/([^aAgGhHisu\\]*(?:\\.[^aAgGhHisu\\]*)*)([aAgGhHisu])/g,function(e,i,n){for(var a in t)n==a&&(n=t[a]);return i+n})},_initDatePicker:function(){$("input[type=date]:not(.jsDatePicker), input[type=datetime]:not(.jsDatePicker)").each($.proxy(function(t,e){var i=$(e),n=i.prop("name"),a=i.val(),s="datetime"==i.attr("type");i.prop("type","text").addClass("jsDatePicker"),i.data("placeholder")&&i.attr("placeholder",i.data("placeholder")),i.removeAttr("name"),i.before('<input type="hidden" id="'+i.wcfIdentify()+'DatePicker" name="'+n+'" value="'+a+'" />');var o=i.attr("max")?new Date(i.attr("max").replace(" ","T")):null,r=i.attr("min")?new Date(i.attr("min").replace(" ","T")):null;if($options={altField:"#"+i.wcfIdentify()+"DatePicker",altFormat:"yy-mm-dd",beforeShow:function(t,e){setTimeout(function(){e.dpDiv.position({my:"left top",at:"left bottom",collision:"none",of:t})},1)},changeMonth:!0,changeYear:!0,dateFormat:this._dateFormat,dayNames:WCF.Language.get("__days"),dayNamesMin:WCF.Language.get("__daysShort"),dayNamesShort:WCF.Language.get("__daysShort"),firstDay:parseInt(WCF.Language.get("wcf.date.firstDayOfTheWeek"))||0,isRTL:"rtl"==WCF.Language.get("wcf.global.pageDirection"),maxDate:o,minDate:r,monthNames:WCF.Language.get("__months"),monthNamesShort:WCF.Language.get("__monthsShort"),showButtonPanel:!1,onClose:function(t,e){""==t&&$(e.settings.altField).val(t)},showOtherMonths:!0,yearRange:i.hasClass("birthday")?"-100:+0":"1900:2038"},s){if(/[0-9]{2}:[0-9]{2}:[0-9]{2}$/.test(a)&&(a=a.replace(/:[0-9]{2}$/,""),i.val(a)),a=a.replace(" ","T"),i.data("ignoreTimezone")){var l=new Date(a).getTimezoneOffset(),c=l>0?"-":"+";l=Math.abs(l);var h=Math.floor(l/60).toString(),d=(l%60).toString();c+=2==h.length?h:"0"+h,c+=":",c+=2==d.length?d:"0"+d,a=a.replace(/[+-][0-9]{2}:[0-9]{2}$/,c)}$options=$.extend($options,{altFieldTimeOnly:!1,altTimeFormat:"HH:mm",controlType:"select",hourText:WCF.Language.get("wcf.date.hour"),minuteText:WCF.Language.get("wcf.date.minute"),showTime:!1,timeFormat:this._timeFormat,yearRange:i.hasClass("birthday")?"-100:+0":"1900:2038"})}s?i.datetimepicker($options):i.datepicker($options),a&&(s||(a=new Date(a),a.setMinutes(a.getMinutes()+a.getTimezoneOffset())),i.datepicker("setDate",a)),i.datepicker("widget").hide()},this))}},WCF.Date.Util={gmdate:function(t){var e=t?t:new Date;return Math.round(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDay(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds())/1e3)},getTimezoneDate:function(t,e){var i=new Date(t),n=6e4*i.getTimezoneOffset();return new Date(t+n+e)}},WCF.Date.Time=Class.extend({_date:0,_elements:null,_offset:null,_timestamp:0,init:function(){this._elements=$("time.datetime"),this._offset=null,this._timestamp=0,this._refresh(),new WCF.PeriodicalExecuter($.proxy(this._refresh,this),6e4),WCF.DOMNodeInsertedHandler.addCallback("WCF.Date.Time",$.proxy(this._domNodeInserted,this))},_domNodeInserted:function(){this._elements=$("time.datetime"),this._refresh()},_refresh:function(){this._date=new Date,this._timestamp=(this._date.getTime()-this._date.getMilliseconds())/1e3,null===this._offset&&(this._offset=this._timestamp-TIME_NOW),this._elements.each($.proxy(this._refreshElement,this))},_refreshElement:function(t,e){var i=$(e);i.attr("title")||i.attr("title",i.text());var n=i.data("timestamp")+this._offset,a=i.data("date"),s=i.data("time"),o=i.data("offset");if(!i.data("isFutureDate"))if(n>=this._timestamp||this._timestamp<n+60)i.text(WCF.Language.get("wcf.date.relative.now"));else if(this._timestamp<n+3540){var r=Math.max(Math.round((this._timestamp-n)/60),1);i.text(WCF.Language.get("wcf.date.relative.minutes",{minutes:r}))}else if(this._timestamp<n+86400){var l=Math.round((this._timestamp-n)/3600);i.text(WCF.Language.get("wcf.date.relative.hours",{hours:l}))}else if(this._timestamp<n+518400){var c=new Date(this._date.getFullYear(),this._date.getMonth(),this._date.getDate()),h=Math.ceil((c/1e3-n)/86400),d=WCF.Date.Util.getTimezoneDate(1e3*n,1e3*o),u=d.getDay(),p=WCF.Language.get("__days")[u];i.text(WCF.Language.get("wcf.date.relative.pastDays",{days:h,day:p,time:s}))}else{var _=WCF.Language.get("wcf.date.shortDateTimeFormat");i.text(_.replace(/\%date\%/,a).replace(/\%time\%/,s))}}}),WCF.Dictionary=Class.extend({_variables:{},init:function(){this._variables={}},add:function(t,e){this._variables[t]=e},addObject:function(t){for(var e in t)this.add(e,t[e])},addDictionary:function(t){t.each($.proxy(function(t){this.add(t.key,t.value)},this))},get:function(t){return this.isset(t)?this._variables[t]:null},isset:function(t){return this._variables.hasOwnProperty(t)},remove:function(t){delete this._variables[t]},each:function(t){if($.isFunction(t))for(var e in this._variables){var i=this._variables[e],n={key:e,value:i};t(n)}},count:function(){return $.getLength(this._variables)},isEmpty:function(){return!this.count()}}),WCF.Language={_variables:new WCF.Dictionary,add:function(t,e){this._variables.add(t,e)},addObject:function(t){this._variables.addObject(t)},get:function(t,e){if(null==e)var e={};var i=this._variables.get(t);return null===i?t:"string"==typeof i?(this.add(t,new WCF.Template(i)),this.get(t,e)):("function"==typeof i.fetch&&(i=i.fetch(e)),i)}},WCF.MultipleLanguageInput=Class.extend({_availableLanguages:{},_button:null,_didInit:!1,_element:null,_insertedDataAfterInit:!1,_isEnabled:!1,_forceSelection:!1,_languageID:0,_list:null,_values:null,init:function(t,e,i,n){if(this._button=null,this._element=$("#"+$.wcfEscapeID(t)),this._forceSelection=e,this._values=i,this._availableLanguages=n,$.getLength(this._values))for(var a in this._values)this._values[a]=WCF.String.unescapeHTML(this._values[a]);if(this._languageID=LANGUAGE_ID,0==this._element.length)return void console.debug("[WCF.MultipleLanguageInput] element id '"+t+"' is unknown");var s=$.getLength(this._values)>0?!0:!1;this._insertedDataAfterInit=s,this._prepareElement(s),this._element.parents("form").submit($.proxy(this._submit,this)),this._didInit=!0},_prepareElement:function(t){this._element.wrap('<div class="dropdown preInput" />');var e=this._element.parent();this._button=$('<p class="button dropdownToggle"><span>'+WCF.Language.get("wcf.global.button.disabledI18n")+"</span></p>").prependTo(e),this._list=$('<ul class="dropdownMenu"></ul>').insertAfter(this._button),this._button.addClass(this._button.nextAll("textarea").length?"dropdownCaptionTextarea":"dropdownCaption");for(var i in this._availableLanguages)$("<li><span>"+this._availableLanguages[i]+"</span></li>").data("languageID",i).click($.proxy(this._changeLanguage,this)).appendTo(this._list);this._forceSelection||($('<li class="dropdownDivider" />').appendTo(this._list),$("<li><span>"+WCF.Language.get("wcf.global.button.disabledI18n")+"</span></li>").click($.proxy(this._disable,this)).appendTo(this._list)),WCF.Dropdown.initDropdown(this._button,t),(t||this._forceSelection)&&(this._isEnabled=!0,this._list.children("li").each($.proxy(function(t,e){var i=$(e);i.data("languageID")==this._languageID&&i.trigger("click")},this))),WCF.Dropdown.registerCallback(e.wcfIdentify(),$.proxy(this._handleAction,this))},_handleAction:function(t,e){"open"===e?this._enable():this._closeSelection()},_enable:function(){if(!this._isEnabled){var t=this._button.is("p")?this._button.children("span:eq(0)"):this._button;t.addClass("active"),this._isEnabled=!0}this._list.is(":visible")&&this._showSelection()},_showSelection:function(){this._isEnabled&&this._list.children("li").each($.proxy(function(t,e){var i=$(e),n=i.data("languageID");n&&(this._values[n]&&""!=this._values[n]?i.removeClass("missingValue"):i.addClass("missingValue"))},this))},_closeSelection:function(){this._disable()},_changeLanguage:function(t){var e=$(t.currentTarget);this._insertedDataAfterInit=!0,this._didInit&&(this._values[this._languageID]=this._element.val()),this._languageID=e.data("languageID"),this._element.val(this._values[this._languageID]?this._values[this._languageID]:""),this._list.children("li").removeClass("active"),e.addClass("active"),this._button.children("span").addClass("active").text(this._availableLanguages[this._languageID]),this._didInit&&this._element.blur().focus()},_disable:function(t){void 0===t&&this._insertedDataAfterInit&&(t=null),!this._forceSelection&&this._list&&null!==t&&(this._button.children("span").removeClass("active").text(WCF.Language.get("wcf.global.button.disabledI18n")),this._values[LANGUAGE_ID]?this._element.val(this._values[LANGUAGE_ID]):this._element.val(),t&&(this._list.children("li").removeClass("active"),$(t.currentTarget).addClass("active")),this._element.blur().focus(),this._insertedDataAfterInit=!1,this._isEnabled=!1,this._values={})},_submit:function(){if(!this._isEnabled)return 3735928559;this._languageID&&(this._values[this._languageID]=this._element.val());var t=$(this._element.parents("form")[0]),e=this._element.wcfIdentify();for(var i in this._availableLanguages)void 0===this._values[i]&&(this._values[i]=""),$('<input type="hidden" name="'+e+"_i18n["+i+']" value="'+WCF.String.escapeHTML(this._values[i])+'" />').appendTo(t);this._element.removeAttr("name")}}),WCF.Number={round:function(t,e){return e=Math.pow(10,e||0),Math.round(t*e)/e}},WCF.String={addThousandsSeparator:function(t){return String(t).replace(/(^-?\d{1,3}|\d{3})(?=(?:\d{3})+(?:$|\.))/g,"$1"+WCF.Language.get("wcf.global.thousandsSeparator"))},escapeHTML:function(t){return String(t).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},escapeRegExp:function(t){return String(t).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")},formatNumeric:function(t,e){return t=String(WCF.Number.round(t,e||2)),t=t.replace(".",WCF.Language.get("wcf.global.decimalPoint")),t=this.addThousandsSeparator(t),t=t.replace("-","−")},lcfirst:function(t){return String(t).substring(0,1).toLowerCase()+t.substring(1)},ucfirst:function(t){return String(t).substring(0,1).toUpperCase()+t.substring(1)},unescapeHTML:function(t){return String(t).replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">")}},WCF.TabMenu={_containers:{},_didInit:!1,init:function(){var t=$(".tabMenuContainer:not(.staticTabMenuContainer)"),e=this;if(t.each(function(t,i){var n=$(i),a=n.wcfIdentify();return e._containers[a]?!0:(n.data("store")&&!$("#"+n.data("store")).length&&$('<input type="hidden" name="'+n.data("store")+'" value="" id="'+n.data("store")+'" />').appendTo(n.parents("form").find(".formSubmit")),e._containers[a]=n,n.wcfTabs({active:!1,activate:function(t,e){for(var i=$(e.newPanel),n=i.closest(".tabMenuContainer"),a=n;;){if(void 0===a.data("isParent"))break;if(a.data("isParent")){a.data("store")&&$("#"+a.data("store")).val(i.attr("id"));break}a=a.data("parent")}WCF.TabMenu._didInit&&(void 0==i.data("inTabMenu")&&i.data("inTabMenu",i.parents(".dialogContainer").length),i.data("inTabMenu")||(window.history?window.history.pushState(null,document.title,window.location.toString().replace(/#.+$/,"")+"#"+i.attr("id")):location.hash="#"+i.attr("id")))}}),n.data("isParent",n.children(".tabMenuContainer, .tabMenuContent").length>0).data("parent",!1),void(n.data("isParent")||n.parent().hasClass("tabMenuContainer")&&n.data("parent",n.parent())))}),!this._didInit&&(this._selectActiveTab(),$(window).bind("hashchange",$.proxy(this.selectTabs,this)),this._selectErroneousTab()||this.selectTabs(),$.browser.mozilla&&location.hash)){var i=$(location.hash);if(i.length&&i.hasClass("tabMenuContent")){var n=i.offset();window.scrollTo(n.left,n.top)}}this._didInit=!0},reload:function(){this._containers={},this.init()},_selectErroneousTab:function(){var t=!1;for(var e in this._containers){var i=this._containers[e];if(i.find(".formError").length&&(t=!0,!i.data("isParent"))){for(;;){if(i.data("parent")===!1)break;i=i.data("parent").wcfTabs("selectTab",i.wcfIdentify())}return!0}}if(t)for(var e in this._containers){var i=this._containers[e],n=i.find(".formError:eq(0)");if(n.length){for(i.wcfTabs("selectTab",n.parents(".tabMenuContent").wcfIdentify());;){if(i.data("parent")===!1)break;i=i.data("parent").wcfTabs("selectTab",i.wcfIdentify())}return!0}}return!1},_selectActiveTab:function(){for(var t in this._containers){var e=this._containers[t];if(e.data("active")){var i=e.data("active"),n=null;if(/-/.test(i)){var a=i.split("-");i=a[0],n=a[1]}e.find(".tabMenuContent").each(function(t,a){var s=$(a);return s.wcfIdentify()==i?(e.wcfTabs("select",t),null!==n&&(s.hasClass("tabMenuContainer")?s.wcfTabs("selectTab",e.data("active")):e.wcfTabs("selectTab",e.data("active"))),!1):void 0})}}},selectTabs:function(){if(location.hash){var t=location.hash.substr(1),e=$("#"+$.wcfEscapeID(t));if(1===e.length&&e.hasClass("ui-tabs-panel")&&(e=e.parent(".ui-tabs"),e.length))return e.wcfTabs("selectTab",t),e.hasClass("ui-tabs-panel")&&(t=e.wcfIdentify(),e=e.parent(".ui-tabs"),e.length&&e.wcfTabs("selectTab",t)),!0}return!1}},WCF.Template=Class.extend({init:function(t){var e=new WCF.Dictionary,i=0;t=t.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/(\r\n|\n|\r)/g,"\\n"),t=t.replace(/\{literal\}(.*?)\{\/literal\}/g,$.proxy(function(t){var i="@@@@@@@@@@@"+Math.random()+"@@@@@@@@@@@";return e.add(i,t.replace(/\{\/?literal\}/g,"")),i},this)),t=t.replace(/\{\*.*?\*\}/g,"");var n=function(t){for(var e=t.split(""),i={},n=!0,a="",s="",o=!1,r=!1,l=!1,c=0,h=e.length;h>c;c++){var d=e[c];n&&"="!=d&&" "!=d?a+=d:n&&"="==d?(n=!1,r=!1,o=!1,l=!1):n||r||o||" "!=d?n||!r||l||"'"!=d?n||r||o||"'"!=d?n||!o||l||'"'!=d?n||r||o||'"'!=d?n||!o&&!r||l||"\\"!=d?n||(l=!1,s+=d):(l=!0,s+=d):(o=!0,s+=d):(o=!1,s+=d):(r=!0,s+=d):(r=!1,s+=d):(n=!0,i[a]=s,s=a="")}if(i[a]=s,o||r||l)throw new Error('Syntax error in parameterList: "'+t+'"');return i},a=function(t){return t.replace(/\\n/g,"\n").replace(/\\\\/g,"\\").replace(/\\'/g,"'")};t=t.replace(/\{(\$[^\}]+?)\}/g,function(t,e){return e=a(e.replace(/\$([^.\[\s]+)/g,"(v['$1'])")),"' + WCF.String.escapeHTML("+e+") + '"}).replace(/\{#(\$[^\}]+?)\}/g,function(t,e){return e=a(e.replace(/\$([^.\[\s]+)/g,"(v['$1'])")),"' + WCF.String.formatNumeric("+e+") + '"}).replace(/\{@(\$[^\}]+?)\}/g,function(t,e){return e=a(e.replace(/\$([^.\[\s]+)/g,"(v['$1'])")),"' + "+e+" + '"}).replace(/{lang}(.+?){\/lang}/g,function(t,e){return"' + WCF.Language.get('"+a(e)+"') + '"}).replace(/\{if (.+?)\}/g,function(t,e){return e=a(e.replace(/\$([^.\[\s]+)/g,"(v['$1'])")),"';\nif ("+e+") {\n     $output += '"}).replace(/\{else ?if (.+?)\}/g,function(t,e){return e=a(e.replace(/\$([^.\[\s]+)/g,"(v['$1'])")),"';\n}\nelse if ("+e+") {\n     $output += '"}).replace(/\{implode (.+?)\}/g,function(t,e){i++,e=e.replace(/\\\\/g,"\\").replace(/\\'/g,"'");var a=n(e);if("undefined"==typeof a.from)throw new Error("Missing from attribute in implode-tag");if("undefined"==typeof a.item)throw new Error("Missing item attribute in implode-tag");return"undefined"==typeof a.glue&&(a.glue="', '"),a.from=a.from.replace(/\$([^.\[\s]+)/g,"(v.$1)"),"';\nvar $implode_"+i+" = false;\nfor ($implodeKey_"+i+" in "+a.from+") {\n    v["+a.item+"] = "+a.from+"[$implodeKey_"+i+"];\n"+("undefined"!=typeof a.key?"          v["+a.key+"] = $implodeKey_"+i+";\n":"")+"      if ($implode_"+i+") $output += "+a.glue+";\n    $implode_"+i+" = true;\n        $output += '"}).replace(/\{foreach (.+?)\}/g,function(t,e){i++,e=e.replace(/\\\\/g,"\\").replace(/\\'/g,"'");var a=n(e);if("undefined"==typeof a.from)throw new Error("Missing from attribute in foreach-tag");if("undefined"==typeof a.item)throw new Error("Missing item attribute in foreach-tag");return a.from=a.from.replace(/\$([^.\[\s]+)/g,"(v.$1)"),"';\n$foreach_"+i+" = false;\nfor ($foreachKey_"+i+" in "+a.from+") {\n   $foreach_"+i+" = true;\n        break;\n}\nif ($foreach_"+i+") {\n      for ($foreachKey_"+i+" in "+a.from+") {\n               v["+a.item+"] = "+a.from+"[$foreachKey_"+i+"];\n"+("undefined"!=typeof a.key?"          v["+a.key+"] = $foreachKey_"+i+";\n":"")+"              $output += '"}).replace(/\{foreachelse\}/g,"';\n        }\n}\nelse {\n  {\n             $output += '").replace(/\{\/foreach\}/g,"';\n   }\n}\n$output += '").replace(/\{else\}/g,"';\n}\nelse {\n       $output += '").replace(/\{\/(if|implode)\}/g,"';\n}\n$output += '");for(var s in WCF.Template.callbacks)t=WCF.Template.callbacks[s](t);t=t.replace("{ldelim}","{").replace("{rdelim}","}"),e.each(function(e){t=t.replace(e.key,e.value)}),t="$output += '"+t+"';";try{this.fetch=new Function("v","if (typeof v != 'object') { v = {}; } v.__window = window; v.__wcf = window.WCF; var $output = ''; "+t+" return $output;")}catch(e){throw console.debug("var $output = ''; "+t+" return $output;"),e}},fetch:function(){}}),WCF.Template.callbacks=[],WCF.ToggleOptions=Class.extend({_element:null,_showItems:[],_hideItems:[],_callback:null,init:function(t,e,i,n){this._element=$("#"+t),this._showItems=e,this._hideItems=i,void 0!==n&&(this._callback=n),this._element.click($.proxy(this._toggle,this)),this._toggle()},_toggle:function(){if(this._element.prop("checked")){for(var t=0,e=this._showItems.length;e>t;t++){var i=this._showItems[t];$("#"+i).show()}for(var t=0,e=this._hideItems.length;e>t;t++){var i=this._hideItems[t];$("#"+i).hide()}null!==this._callback&&this._callback()}}}),WCF.Collapsible={},WCF.Collapsible.Simple={init:function(){$(".jsCollapsible").each($.proxy(function(t,e){this._initButton(e)},this))},_initButton:function(t){var e=$(t),i=e.data("isOpen");i||$("#"+e.data("collapsibleContainer")).hide(),e.click($.proxy(this._toggle,this))},_toggle:function(t){var e=$(t.currentTarget),i=e.data("isOpen"),n=$("#"+$.wcfEscapeID(e.data("collapsibleContainer")));return i?(n.stop().wcfBlindOut("vertical",$.proxy(function(){this._toggleImage(e)},this)),i=!1):(n.stop().wcfBlindIn("vertical",$.proxy(function(){this._toggleImage(e)},this)),i=!0),e.data("isOpen",i),t.stopPropagation(),!1},_toggleImage:function(t){var e=t.find("span.icon");t.data("isOpen")?e.removeClass("icon-chevron-right").addClass("icon-chevron-down"):e.removeClass("icon-chevron-down").addClass("icon-chevron-right")}},WCF.Collapsible.Remote=Class.extend({_className:"",_containers:{},_containerData:{},_proxy:null,init:function(t){this._className=t,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._init(),WCF.DOMNodeInsertedHandler.addCallback("WCF.Collapsible.Remote",$.proxy(this._init,this))},_init:function(){this._getContainers().each($.proxy(function(t,e){var i=$(e),n=i.wcfIdentify();void 0===this._containers[n]&&(this._containers[n]=i,this._initContainer(n))},this))},_initContainer:function(t){var e=this._getTarget(t),i=this._getButtonContainer(t),n=this._createButton(t,i);this._containerData[t]={button:n,buttonContainer:i,isOpen:this._containers[t].data("isOpen"),target:e},this._containers[t].data("isOpen")||$("#"+t).addClass("jsCollapsed")},_getContainers:function(){},_getTarget:function(){},_getButtonContainer:function(){},_createButton:function(t,e){var i=this._containers[t].data("isOpen"),n=$('<span class="collapsibleButton jsTooltip pointer icon icon16 icon-'+(i?"chevron-down":"chevron-right")+'" title="'+WCF.Language.get("wcf.global.button.collapsible")+'">').prependTo(e);return n.data("containerID",t).click($.proxy(this._toggleContainer,this)),n},_toggleContainer:function(t){var e=$(t.currentTarget),i=e.data("containerID"),n=this._containerData[i].isOpen,a=n?"open":"close",s=n?"close":"open";this._proxy.setOption("data",{actionName:"loadContainer",className:this._className,interfaceName:"wcf\\data\\ILoadableContainerAction",objectIDs:[this._getObjectID(i)],parameters:$.extend(!0,{containerID:i,currentState:a,newState:s},this._getAdditionalParameters(i))}),this._proxy.sendRequest(),$("#"+i).toggleClass("jsCollapsed")},_exchangeIcon:function(t,e){e=e||"spinner",t.removeClass("icon-chevron-down icon-chevron-right icon-spinner").addClass("icon-"+e)},_getObjectID:function(t){return $("#"+t).data("objectID")},_getAdditionalParameters:function(){return{}},_updateContent:function(t,e){this._containerData[t].target.html(e)},_success:function(t){if(t.returnValues.containerID){var e=t.returnValues.containerID;if(this._containers[e]){this._containerData[e].isOpen=t.returnValues.isOpen?!0:!1;var i=t.returnValues.isOpen?"open":"close";this._updateContent(e,$.trim(t.returnValues.content),i),this._exchangeIcon(this._containerData[e].button,t.returnValues.isOpen?"chevron-down":"chevron-right")}}}}),WCF.Collapsible.SimpleRemote=WCF.Collapsible.Remote.extend({init:function(t){this._super(t),this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1})},_initContainer:function(t){this._super(t),this._containerData[t].isOpen||(this._containerData[t].target.hide(),this._exchangeIcon(this._containerData[t].button,"chevron-right"))},_toggleContainer:function(t){var e=$(t.currentTarget),i=e.data("containerID"),n=this._containerData[i].isOpen,a=n?"open":"close",s=n?"close":"open";this._proxy.setOption("data",{actionName:"toggleContainer",className:this._className,interfaceName:"wcf\\data\\IToggleContainerAction",objectIDs:[this._getObjectID(i)],parameters:$.extend(!0,{containerID:i,currentState:a,newState:s},this._getAdditionalParameters(i))}),this._proxy.sendRequest(),this._exchangeIcon(this._containerData[i].button,"open"===s?"chevron-down":"chevron-right"),"open"===s?this._containerData[i].target.show():this._containerData[i].target.hide(),$("#"+i).toggleClass("jsCollapsed"),this._containerData[i].isOpen="open"===s?!0:!1}}),WCF.Collapsible.Sidebar=Class.extend({_button:null,_buttonHeight:0,_isOpen:!1,_mainContainer:null,_proxy:null,_sidebar:null,_sidebarHeight:0,_sidebarName:"",_sidebarOffset:0,_userPanelHeight:0,init:function(){if(this._sidebar=$(".sidebar:eq(0)"),!this._sidebar.length)return void console.debug("[WCF.Collapsible.Sidebar] Could not find sidebar, aborting.");this._isOpen=this._sidebar.data("isOpen")?!0:!1,this._sidebarName=this._sidebar.data("sidebarName"),this._mainContainer=$("#main"),this._sidebarHeight=this._sidebar.height(),this._sidebarOffset=this._sidebar.getOffsets("offset").top,this._userPanelHeight=$("#topMenu").outerHeight(),this._button=$('<a class="collapsibleButton jsTooltip" title="'+WCF.Language.get("wcf.global.button.collapsible")+'" />').prependTo(this._sidebar),this._button.wrap("<span />"),this._button.click($.proxy(this._click,this)),this._buttonHeight=this._button.outerHeight(),WCF.DOMNodeInsertedHandler.execute(),this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1,url:"index.php/AJAXInvoke/?t="+SECURITY_TOKEN+SID_ARG_2ND}),$(document).scroll($.proxy(this._scroll,this)).resize($.proxy(this._scroll,this)),
+this._renderSidebar(),this._scroll();var t=$(window);this._sidebar.on("webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd",function(){t.trigger("resize")})},_click:function(){this._isOpen=this._isOpen?!1:!0,this._proxy.setOption("data",{actionName:"toggle",className:"wcf\\system\\user\\collapsible\\content\\UserCollapsibleSidebarHandler",isOpen:this._isOpen?1:0,sidebarName:this._sidebarName}),this._proxy.sendRequest(),this._renderSidebar()},_scroll:function(){var t=$(window),e=t.scrollTop(),i=Math.max(e-this._sidebarOffset,0),n=Math.min(this._mainContainer.height(),t.height()+e-this._sidebarOffset),a=0;if(n===i)a=this._sidebarOffset+this._sidebarHeight;else{a=i+(n-i)/2;var s=Math.max(Math.min(i-this._userPanelHeight,this._userPanelHeight),0);s>0&&(a+=s/2)}n-i-this._userPanelHeight<this._buttonHeight?a-=this._buttonHeight:a=Math.max(a-this._buttonHeight/2,0),this._button.css({top:a+"px"})},_renderSidebar:function(){this._isOpen?$(".sidebarOrientationLeft, .sidebarOrientationRight").removeClass("sidebarCollapsed"):$(".sidebarOrientationLeft, .sidebarOrientationRight").addClass("sidebarCollapsed"),this._scroll(),$.browser.msie&&0===$.browser.version.indexOf("9")&&$(window).trigger("resize")}}),WCF.User={userID:0,username:"",init:function(t,e){this.userID=t,this.username=e}},WCF.Effect={},WCF.Effect.Scroll=Class.extend({scrollTo:function(t,e,i){if(!t.length)return!0;var n=t.getOffsets("offset").top,a=$(document).height(),s=$(window).height();return n>a-s&&(n=a-s,0>n&&(n=0)),i===!0?$("html,body").scrollTop(n):$("html,body").animate({scrollTop:n},400,function(t,e,i,n,a){return-n*((e=e/a-1)*e*e*e-1)+i}),!1}}),WCF.Effect.SmoothScroll=WCF.Effect.Scroll.extend({init:function(){var t=this;$(document).on("click","a[href$=#top],a[href$=#bottom]",function(){var e=$(this.hash);return t.scrollTo(e,!0),!1})}}),WCF.Effect.BalloonTooltip=Class.extend({_didInit:!1,_tooltip:null,_viewportDimensions:{},init:function(){jQuery.browser.mobile||(this._didInit||(this._tooltip=$('<div id="balloonTooltip" class="balloonTooltip"><span id="balloonTooltipText"></span><span class="pointer"><span></span></span></div>').appendTo($("body")).hide(),this._updateViewportDimensions(),$(window).resize($.proxy(this._updateViewportDimensions,this)),WCF.DOMNodeInsertedHandler.addCallback("WCF.Effect.BalloonTooltip",$.proxy(this.init,this)),this._didInit=!0),$(".jsTooltip").each($.proxy(this._initTooltip,this)))},_updateViewportDimensions:function(){this._viewportDimensions=$(document).getDimensions()},_initTooltip:function(t,e){var i=$(e);if(i.hasClass("jsTooltip")){i.removeClass("jsTooltip");var n=i.attr("title");""!==n&&(i.data("tooltip",n),i.removeAttr("title"),i.hover($.proxy(this._mouseEnterHandler,this),$.proxy(this._mouseLeaveHandler,this)),i.click($.proxy(this._mouseLeaveHandler,this)))}},_mouseEnterHandler:function(t){var e=$(t.currentTarget),i=e.attr("title");if(i&&""!==i&&(e.data("tooltip",i),e.removeAttr("title")),this._tooltip.css({top:"0px",left:"0px"}),!e.data("tooltip"))return void this._tooltip.hide();this._tooltip.children("span:eq(0)").text(e.data("tooltip"));var n=this._tooltip.find(".pointer");this._tooltip.show();var a=n.outerWidth();this._tooltip.hide();var s=e.getOffsets("offset"),o=e.getDimensions("outer"),r=this._tooltip.getDimensions("outer"),l=this._tooltip.getDimensions("inner"),c=s.left+Math.ceil(o.width/2),h=Math.ceil(r.width/2),d="center";if(5>c-h?d="left":this._viewportDimensions.width-5<c+h&&(d="right"),s.top+o.height+r.height-$(document).scrollTop()<$(window).height()){var u=s.top+o.height+7;this._tooltip.removeClass("inverse"),n.css("top",-5)}else{var u=s.top-r.height-7;this._tooltip.addClass("inverse"),n.css("top",r.height)}switch(d){case"center":var p=Math.round(s.left-h+o.width/2);n.css({left:l.width/2-a/2+"px"});break;case"left":var p=s.left;n.css({left:"5px"});break;case"right":var p=s.left+o.width-r.width;n.css({left:l.width-a-5+"px"})}this._tooltip.css({top:u+"px",left:p+"px"}),this._tooltip.wcfFadeIn()},_mouseLeaveHandler:function(){this._tooltip.stop().hide().css({opacity:1})}}),WCF.CloseOverlayHandler={_callbacks:new WCF.Dictionary,_isListening:!1,addCallback:function(t,e){return this._bindListener(),this._callbacks.isset(t)?(console.debug("[WCF.CloseOverlayHandler] identifier '"+t+"' is already bound to a callback"),!1):void this._callbacks.add(t,e)},removeCallback:function(t){this._callbacks.isset(t)&&this._callbacks.remove(t)},_bindListener:function(){this._isListening||($("body").click($.proxy(this._executeCallbacks,this)),this._isListening=!0)},_executeCallbacks:function(){this._callbacks.each(function(t){t.value()})}},WCF.DOMNodeInsertedHandler={_callbacks:[],_isExecuting:!1,addCallback:function(t,e){this._callbacks.push(e)},_executeCallbacks:function(){if(!this._isExecuting){this._isExecuting=!0;for(var t=0,e=this._callbacks.length;e>t;t++)this._callbacks[t]();this._isExecuting=!1}},execute:function(){this._executeCallbacks()}},WCF.DOMNodeRemovedHandler={_callbacks:new WCF.Dictionary,_isExecuting:!1,_isListening:!1,addCallback:function(t,e){return this._bindListener(),this._callbacks.isset(t)?(console.debug("[WCF.DOMNodeRemovedHandler] identifier '"+t+"' is already bound to a callback"),!1):void this._callbacks.add(t,e)},removeCallback:function(t){this._callbacks.isset(t)&&this._callbacks.remove(t)},_bindListener:function(){this._isListening||($(document).bind("DOMNodeRemoved",$.proxy(this._executeCallbacks,this)),this._isListening=!0)},_executeCallbacks:function(t){this._isExecuting||(this._isExecuting=!0,this._callbacks.each(function(e){e.value(t)}),this._isExecuting=!1)}},WCF.PageVisibilityHandler={_callbacks:new WCF.Dictionary,_isListening:!1,_hiddenFieldName:"",addCallback:function(t,e){return this._bindListener(),this._callbacks.isset(t)?(console.debug("[WCF.PageVisibilityHandler] identifier '"+t+"' is already bound to a callback"),!1):void this._callbacks.add(t,e)},removeCallback:function(t){this._callbacks.isset(t)&&this._callbacks.remove(t)},_bindListener:function(){if(!this._isListening){var t=null;"undefined"!=typeof document.hidden?(this._hiddenFieldName="hidden",t="visibilitychange"):"undefined"!=typeof document.mozHidden?(this._hiddenFieldName="mozHidden",t="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this._hiddenFieldName="msHidden",t="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this._hiddenFieldName="webkitHidden",t="webkitvisibilitychange"),null===t?console.debug("[WCF.PageVisibilityHandler] This browser does not support the page visibility API."):$(document).on(t,$.proxy(this._executeCallbacks,this)),this._isListening=!0}},_executeCallbacks:function(){if(!this._isExecuting){this._isExecuting=!0;var t=document[this._hiddenFieldName];this._callbacks.each(function(e){e.value(t)}),this._isExecuting=!1}}},WCF.Table={},WCF.Table.EmptyTableHandler=Class.extend({_options:{},_rowClassName:"",init:function(t,e,i){this._rowClassName=e,this._tableContainer=t,this._options=$.extend(!0,{emptyMessage:null,messageType:"info",refreshPage:!1,updatePageNumber:!1},i||{}),WCF.DOMNodeRemovedHandler.addCallback("WCF.Table.EmptyTableHandler."+e,$.proxy(this._remove,this))},_remove:function(t){var e=$(t.target);if(e.hasClass(this._rowClassName)){var i=e.parents("tbody:eq(0)");if(1==i.children("tr").length)if(this._options.emptyMessage)this._tableContainer.replaceWith($("<p />").addClass(this._options.messageType).text(this._options.emptyMessage));else if(this._options.refreshPage)if(this._options.updatePageNumber){var n=window.location.href.match(/(\?|&)pageNo=(\d+)/g);if(n){var a=n[n.length-1].match(/\d+/g);this._options.updatePageNumber>0?a++:a--,window.location=window.location.href.replace(n[n.length-1],n[n.length-1][0]+"pageNo="+a)}}else window.location.reload();else this._tableContainer.remove()}}}),WCF.Search={},WCF.Search.Base=Class.extend({_callback:null,_className:"",_commaSeperated:!1,_delay:0,_excludedSearchValues:[],_itemCount:0,_itemIndex:-1,_list:null,_oldSearchString:[],_proxy:null,_searchInput:null,_triggerLength:3,_timer:null,init:function(t,e,i,n,a){return null===e||void 0===e||$.isFunction(e)?(this._callback=e?e:null,this._delay=0,this._excludedSearchValues=[],i&&(this._excludedSearchValues=i),this._searchInput=$(t),this._searchInput.length?(this._searchInput.keydown($.proxy(this._keyDown,this)).keyup($.proxy(this._keyUp,this)).wrap('<span class="dropdown" />'),$.browser.mozilla&&$.browser.touch&&this._searchInput.on("input",$.proxy(this._keyUp,this)),this._list=$('<ul class="dropdownMenu" />').insertAfter(this._searchInput),this._commaSeperated=n?!0:!1,this._oldSearchString=[],this._itemCount=0,this._itemIndex=-1,this._proxy=new WCF.Action.Proxy({showLoadingOverlay:a!==!0?!1:!0,success:$.proxy(this._success,this),autoAbortPrevious:!0}),this._searchInput.is("input")&&this._searchInput.attr("autocomplete","off"),this._searchInput.blur($.proxy(this._blur,this)),void WCF.Dropdown.initDropdownFragment(this._searchInput.parent(),this._list)):void console.debug("[WCF.Search.Base] Selector '"+t+"' for search input is invalid, aborting.")):void console.debug("[WCF.Search.Base] The given callback is invalid, aborting.")},_blur:function(){var t=this;new WCF.PeriodicalExecuter(function(e){t._list.is(":visible")&&t._clearList(!1),e.stop()},250)},_keyDown:function(t){if(t.which===$.ui.keyCode.ENTER){var e=this._searchInput.parents(".dropdown");e.data("disableAutoFocus")?-1!==this._itemIndex&&t.preventDefault():(e.data("preventSubmit")||-1!==this._itemIndex)&&t.preventDefault()}},_keyUp:function(t){switch(t.which){case 37:case 39:return;case 38:return void this._selectPreviousItem();case 40:return void this._selectNextItem();case 13:return this._selectElement(t)}var e=this._getSearchString(t);if(""===e)this._clearList(!0);else if(e.length>=this._triggerLength){var i={data:{excludedSearchValues:this._excludedSearchValues,searchString:e}};if(this._delay){null!==this._timer&&this._timer.stop();var n=this;this._timer=new WCF.PeriodicalExecuter(function(){n._queryServer(i),n._timer.stop(),n._timer=null},this._delay)}else this._queryServer(i)}else this._clearList(!1)},_queryServer:function(t){this._searchInput.parents(".searchBar").addClass("loading"),this._proxy.setOption("data",{actionName:"getSearchResultList",className:this._className,interfaceName:"wcf\\data\\ISearchAction",parameters:this._getParameters(t)}),this._proxy.sendRequest()},setDelay:function(t){this._delay=t},_selectNextItem:function(){0!==this._itemCount&&(this._itemIndex++,this._itemIndex===this._itemCount&&(this._itemIndex=0),this._highlightSelectedElement())},_selectPreviousItem:function(){0!==this._itemCount&&(this._itemIndex--,-1===this._itemIndex&&(this._itemIndex=this._itemCount-1),this._highlightSelectedElement())},_highlightSelectedElement:function(){this._list.find("li").removeClass("dropdownNavigationItem"),this._list.find("li:eq("+this._itemIndex+")").addClass("dropdownNavigationItem")},_selectElement:function(){return 0===this._itemCount?!0:(this._list.find("li.dropdownNavigationItem").trigger("click"),!1)},_getSearchString:function(t){var e=$.trim(this._searchInput.val());if(this._commaSeperated){var i=t.keyCode||t.which;if(i==$.ui.keyCode.COMMA)return"";for(var n=e.split(","),a=n.length,s=0;a>s;s++)n[s]=$.trim(n[s]);for(var s=0;a>s;s++){var o=n[s];if(!this._oldSearchString[s]){e=o;break}if(o!=this._oldSearchString[s]){e=o;break}}this._oldSearchString=n}return e},_getParameters:function(t){return t},_success:function(t){if(this._clearList(!1),this._searchInput.parents(".searchBar").removeClass("loading"),$.getLength(t.returnValues))for(var e in t.returnValues){var i=t.returnValues[e];this._createListItem(i)}else if(!this._handleEmptyResult())return;WCF.CloseOverlayHandler.addCallback("WCF.Search.Base",$.proxy(function(){this._clearList()},this));var n=this._searchInput.parents(".dropdown").wcfIdentify();WCF.Dropdown.getDropdownMenu(n).hasClass("dropdownOpen")||WCF.Dropdown.toggleDropdown(n),this._itemIndex=-1,WCF.Dropdown.getDropdown(n).data("disableAutoFocus")||this._selectNextItem()},_handleEmptyResult:function(){return!1},_createListItem:function(t){var e=$("<li><span>"+WCF.String.escapeHTML(t.label)+"</span></li>").appendTo(this._list);return e.data("objectID",t.objectID).data("label",t.label).click($.proxy(this._executeCallback,this)),this._itemCount++,e},_executeCallback:function(t){var e=!1,i=$(t.currentTarget);if(this._commaSeperated)for(var n=i.data("label"),a=0,s=this._oldSearchString.length;s>a;a++){var o=this._oldSearchString[a];if(0===n.toLowerCase().indexOf(o.toLowerCase())){this._oldSearchString[a]=n,this._searchInput.val(this._oldSearchString.join(", ")),$.browser.webkit&&this._searchInput.css({display:"block"});var r=this._searchInput.val().toLowerCase().indexOf(n.toLowerCase())+n.length;this._searchInput.focus().setCaret(r);break}}else null===this._callback?this._searchInput.val(i.data("label")):e=this._callback(i.data())===!0?!0:!1;this._clearList(e)},_clearList:function(t){t&&!this._commaSeperated&&this._searchInput.val(""),WCF.Dropdown.getDropdown(this._searchInput.parents(".dropdown").wcfIdentify()).removeClass("dropdownOpen"),WCF.Dropdown.getDropdownMenu(this._searchInput.parents(".dropdown").wcfIdentify()).removeClass("dropdownOpen"),this._list.end().empty(),WCF.CloseOverlayHandler.removeCallback("WCF.Search.Base"),this._itemCount=0,this._itemIndex=-1},addExcludedSearchValue:function(t){WCF.inArray(t,this._excludedSearchValues)||this._excludedSearchValues.push(t)},removeExcludedSearchValue:function(t){var e=$.inArray(t,this._excludedSearchValues);-1!=e&&this._excludedSearchValues.splice(e,1)}}),WCF.Search.User=WCF.Search.Base.extend({_className:"wcf\\data\\user\\UserAction",_includeUserGroups:!1,init:function(t,e,i,n,a){this._includeUserGroups=i,this._super(t,e,n,a)},_getParameters:function(t){return t.data.includeUserGroups=this._includeUserGroups?1:0,t},_createListItem:function(t){var e=this._super(t),i=null;if(t.icon?i=$(t.icon):this._includeUserGroups&&"group"===t.type&&(i=$('<span class="icon icon16 icon-group" />')),i){var n=e.find("span").detach(),a=$("<div />").addClass("box16").appendTo(e);a.append(i),a.append($("<div />").append(n))}return e.data("type",t.type),e}}),WCF.System={},WCF.System.Dependency={},WCF.System.Dependency.Manager={_callbacks:{},_loaded:[],_setupCallbacks:{},register:function(t,e){return $.isFunction(e)?void(WCF.inArray(t,this._loaded)?setTimeout(function(){e()},1):(this._callbacks[t]||(this._callbacks[t]=[]),this._callbacks[t].push(e))):void console.debug("[WCF.System.Dependency.Manager] Callback for identifier '"+t+"' is invalid, aborting.")},setup:function(t,e){return $.isFunction(e)?(this._setupCallbacks[t]||(this._setupCallbacks[t]=[]),void this._setupCallbacks[t].push(e)):void console.debug("[WCF.System.Dependency.Manager] Setup callback for identifier '"+t+"' is invalid, aborting.")},invoke:function(t){if(this._setupCallbacks[t]){for(var e=0,i=this._setupCallbacks[t].length;i>e;e++)this._setupCallbacks[t][e]();delete this._setupCallbacks[t]}if(this._loaded.push(t),this._callbacks[t]){for(var e=0,i=this._callbacks[t].length;i>e;e++)this._callbacks[t][e]();delete this._callbacks[t]}}},WCF.System.FlexibleMenu={_containers:{},_containerIDs:[],_dropdowns:{},_dropdownMenus:{},_hasHiddenItems:{},_isWorking:!1,_menuItems:{},init:function(){this.registerMenu("mainMenu"),this.registerMenu($(".navigationHeader:eq(0)").wcfIdentify()),this._registerTabMenus(),$(window).resize($.proxy(this.rebuildAll,this)),WCF.DOMNodeInsertedHandler.addCallback("WCF.System.FlexibleMenu",$.proxy(this._registerTabMenus,this))},_registerTabMenus:function(){$(".tabMenuContainer:not(.jsFlexibleMenuEnabled)").each(function(t,e){var i=$(e).addClass("jsFlexibleMenuEnabled").children("nav");i.length&&i.find("> ul:eq(0) > li").length&&WCF.System.FlexibleMenu.registerMenu(i.wcfIdentify())})},registerMenu:function(t){var e=$("#"+t);return e.length?(this._containerIDs.push(t),this._containers[t]=e,this._menuItems[t]=e.find("> ul:eq(0) > li"),this._dropdowns[t]=$('<li class="dropdown"><a class="icon icon16 icon-list" /></li>').data("containerID",t).click($.proxy(this._click,this)),this._dropdownMenus[t]=$('<ul class="dropdownMenu" />').appendTo(this._dropdowns[t]),this._hasHiddenItems[t]=!1,this.rebuild(t),void WCF.Dropdown.initDropdown(this._dropdowns[t].children("a"))):void console.debug("[WCF.System.FlexibleMenu] Unable to find container identified by '"+t+"', aborting.")},rebuildAll:function(){if(!this._isWorking){this._isWorking=!0;for(var t=0,e=this._containerIDs.length;e>t;t++)this.rebuild(this._containerIDs[t]);this._isWorking=!1}},rebuild:function(t){if(!this._containers[t])return void console.debug("[WCF.System.FlexibleMenu] Cannot rebuild unknown container identified by '"+t+"'");for(var e=!1,i=this._containers[t],n=0,a=this._menuItems[t].filter(":visible"),s=0,o=a.length;o>s;s++)n+=$(a[s]).outerWidth(!0);this._hasHiddenItems[t]||this._dropdowns[t].appendTo(i.children("ul:eq(0)"));var r=this._dropdowns[t].outerWidth(!0);this._hasHiddenItems[t]||this._dropdowns[t].detach();var l=i.parent().innerWidth();if(l-=parseInt(i.parent().css("padding-left").replace(/px$/,""))+parseInt(i.parent().css("padding-right").replace(/px$/,"")),l-=parseInt(i.css("margin-left").replace(/px$/,""))+parseInt(i.css("margin-right").replace(/px$/,"")),l-=parseInt(i.css("padding-left").replace(/px$/,""))+parseInt(i.css("padding-right").replace(/px$/,"")),l-=parseInt(i.children("ul:eq(0)").css("padding-left").replace(/px$/,""))+parseInt(i.children("ul:eq(0)").css("padding-right").replace(/px$/,"")),n>l||this._hasHiddenItems[t]&&n>l-r){var a=a.filter(":not(.active):not(.ui-state-active):visible");l-=r;for(var s=a.length-1;s>=0&&n>l;s--){var c=$(a[s]);n-=c.outerWidth(!0),c.hide(),e=!0,this._hasHiddenItems[t]=!0}this._hasHiddenItems[t]&&this._dropdowns[t].appendTo(i.children("ul:eq(0)"))}else if(this._hasHiddenItems[t]&&l>n){var h=this._menuItems[t].filter(":not(:visible)");l-=r;for(var s=0,o=h.length;o>s;s++){var c=$(h[s]);if(n+=c.outerWidth(),s+1==o&&(l+=r),!(l>n))break;c.css("display",""),e=!0}e&&(this._hasHiddenItems[t]=this._menuItems[t].filter(":not(:visible)").length>0,this._hasHiddenItems[t]||this._dropdowns[t].detach())}e&&(this._dropdownMenus[t].empty(),this._menuItems[t].filter(":not(:visible)").each($.proxy(function(e,i){$("<li>"+$(i).html()+"</li>").appendTo(this._dropdownMenus[t])},this)))}},WCF.System.Mobile={},WCF.System.Mobile.UX={_enabled:!1,_main:null,_sidebar:null,init:function(){this._enabled=!1,this._main=$("#main"),this._sidebar=this._main.find("> div > div > .sidebar"),$.browser.touch&&$("html").addClass("touch"),enquire.register("screen and (max-width: 800px)",{match:$.proxy(this._enable,this),unmatch:$.proxy(this._disable,this),setup:$.proxy(this._setup,this),deferSetup:!0}),$.browser.msie&&this._sidebar.width()>305&&this._sidebar.css("display","none").css("display","")},_setup:function(){this._initSidebarToggleButtons(),this._initSearchBar(),this._initButtonGroupNavigation(),WCF.CloseOverlayHandler.addCallback("WCF.System.Mobile.UX",$.proxy(this._closeMenus,this)),WCF.DOMNodeInsertedHandler.addCallback("WCF.System.Mobile.UX",$.proxy(this._initButtonGroupNavigation,this))},_enable:function(){this._enabled=!0,$.browser.msie&&this._sidebar.css("display","none").css("display","")},_disable:function(){this._enabled=!1,$.browser.msie&&this._sidebar.css("display","none").css("display","")},_initSidebarToggleButtons:function(){var t=this._main.hasClass("sidebarOrientationLeft"),e=this._main.hasClass("sidebarOrientationRight");if(t||e){var i="wcf.global.sidebar.show"+(t?"Left":"Right")+"Sidebar";(i===WCF.Language.get(i)||""===WCF.Language.get(i))&&(i='<span class="icon icon16 icon-double-angle-'+(t?"left":"right")+'" />');var n="wcf.global.sidebar.hide"+(t?"Left":"Right")+"Sidebar";(n===WCF.Language.get(n)||""===WCF.Language.get(n))&&(n='<span class="icon icon16 icon-double-angle-'+(t?"right":"left")+'" />');var a=this;$('<span class="button small mobileSidebarToggleButton">'+i+"</span>").appendTo($(".content")).click(function(){a._main.addClass("mobileShowSidebar")}),$('<span class="button small mobileSidebarToggleButton">'+n+"</span>").appendTo($(".sidebar")).click(function(){a._main.removeClass("mobileShowSidebar")})}},_initSearchBar:function(){var t=$(".searchBar:eq(0)"),e=this;t.click(function(){e._enabled&&t.addClass("searchBarOpen")}),this._main.click(function(){t.removeClass("searchBarOpen")})},_initButtonGroupNavigation:function(){$(".buttonGroupNavigation:not(.jsMobileButtonGroupNavigation)").each(function(t,e){var i=$(e).addClass("jsMobileButtonGroupNavigation"),n=$('<a class="dropdownLabel"><span class="icon icon24 icon-list" /></a>').prependTo(i);n.click(function(){return n.next().toggleClass("open"),!1})})},_closeMenus:function(){$(".jsMobileButtonGroupNavigation > ul.open").removeClass("open")}},WCF.System.Notification=Class.extend({_callback:null,_cssClassNames:"",_message:"",_overlay:null,init:function(t,e){this._cssClassNames=e||"success",this._message=t||WCF.Language.get("wcf.global.success"),this._overlay=$("#systemNotification"),this._overlay.length||(this._overlay=$('<div id="systemNotification"><p></p></div>').hide().appendTo(document.body))},show:function(t,e,i,n){e=parseInt(e),e||(e=2e3),t&&$.isFunction(t)&&(this._callback=t),this._overlay.children("p").html(i||this._message),this._overlay.children("p").removeClass().addClass(n||this._cssClassNames),new WCF.PeriodicalExecuter($.proxy(this._hide,this),e),this._overlay.wcfFadeIn(void 0,300)},_hide:function(t){null!==this._callback&&this._callback(),this._overlay.wcfFadeOut(void 0,300),t.stop()}}),WCF.System.Confirmation={_callback:null,_dialog:null,_parameters:null,_visible:!1,_confirmationButton:null,show:function(t,e,i,n){if(this._visible)return void console.debug("[WCF.System.Confirmation] Confirmation dialog is already open, refusing action.");if(!$.isFunction(e))return void console.debug("[WCF.System.Confirmation] Given callback is invalid, aborting.");this._callback=e,this._parameters=i;var a=!0;null===this._dialog&&(this._createDialog(),a=!1),this._dialog.find("#wcfSystemConfirmationContent").empty().hide(),n&&n.length&&n.appendTo(this._dialog.find("#wcfSystemConfirmationContent").show()),this._dialog.find("p").text(t),this._dialog.wcfDialog({onClose:$.proxy(this._close,this),onShow:$.proxy(this._show,this),title:WCF.Language.get("wcf.global.confirmation.title")}),a&&this._dialog.wcfDialog("render"),this._confirmationButton.focus(),this._visible=!0},_createDialog:function(){this._dialog=$('<div id="wcfSystemConfirmation" class="systemConfirmation"><p /><div id="wcfSystemConfirmationContent" /></div>').hide().appendTo(document.body);var t=$('<div class="formSubmit" />').appendTo(this._dialog);this._confirmationButton=$('<button class="buttonPrimary">'+WCF.Language.get("wcf.global.confirmation.confirm")+"</button>").data("action","confirm").click($.proxy(this._click,this)).appendTo(t),$("<button>"+WCF.Language.get("wcf.global.confirmation.cancel")+"</button>").data("action","cancel").click($.proxy(this._click,this)).appendTo(t)},_click:function(t){this._notify($(t.currentTarget).data("action"))},_close:function(){this._visible&&this._notify("cancel")},_notify:function(t){this._visible=!1,this._dialog.wcfDialog("close"),this._callback(t,this._parameters)},_show:function(){this._dialog.find("button.buttonPrimary").blur().focus()}},WCF.System.DisableScrolling={_depth:0,_oldOverflow:null,disable:function(){$.browser.touch||(0===this._depth&&(this._oldOverflow=$(document.body).css("overflow"),$(document.body).css("overflow","hidden")),this._depth++)},enable:function(){0!==this._depth&&(this._depth--,0===this._depth&&$(document.body).css("overflow",this._oldOverflow))}},WCF.System.PageNavigation={_button:null,_description:null,_dialog:null,_elementID:"",_elements:{},_pageNo:null,init:function(t,e){var i=$(t);if(i.length)return e=e||null,null===e||$.isFunction(e)?void this._initElements(i,e):void console.debug("[WCF.System.PageNavigation] Callback for selector '"+t+"' is invalid, aborting.")},_initElements:function(t,e){var i=this;t.each(function(t,e){var n=$(e),a=n.wcfIdentify();void 0===i._elements[a]&&(i._elements[a]=n,n.find("li.jumpTo").data("elementID",a).click($.proxy(i._click,i)))}).data("callback",e)},_click:function(t){if(this._elementID=$(t.currentTarget).data("elementID"),null===this._dialog){this._dialog=$('<div id="pageNavigationOverlay" />').hide().appendTo(document.body);var e=$("<fieldset><legend>"+WCF.Language.get("wcf.global.page.jumpTo")+"</legend></fieldset>").appendTo(this._dialog);$('<dl><dt><label for="jsPageNavigationPageNo">'+WCF.Language.get("wcf.global.page.jumpTo")+"</label></dt><dd></dd></dl>").appendTo(e),this._pageNo=$('<input type="number" id="jsPageNavigationPageNo" value="1" min="1" max="1" class="tiny" />').keyup($.proxy(this._keyUp,this)).appendTo(e.find("dd")),this._description=$("<small></small>").insertAfter(this._pageNo);var i=$('<div class="formSubmit" />').appendTo(this._dialog);this._button=$('<button class="buttonPrimary">'+WCF.Language.get("wcf.global.button.submit")+"</button>").click($.proxy(this._submit,this)).appendTo(i)}this._button.enable(),this._description.html(WCF.Language.get("wcf.global.page.jumpTo.description").replace(/#pages#/,this._elements[this._elementID].data("pages"))),this._pageNo.val(this._elements[this._elementID].data("pages")).attr("max",this._elements[this._elementID].data("pages")),this._dialog.wcfDialog({title:WCF.Language.get("wcf.global.page.pageNavigation")})},_keyUp:function(){var t=parseInt(this._pageNo.val())||0;1>t||t>this._pageNo.attr("max")?this._button.disable():this._button.enable()},_submit:function(){var t=this._elements[this._elementID];if(null===t.data("callback")){var e=t.data("link").replace(/pageNo=%d/,"pageNo="+this._pageNo.val());window.location=e}else t.data("callback")(this._pageNo.val()),this._dialog.wcfDialog("close")}},WCF.System.KeepAlive=Class.extend({init:function(t){new WCF.PeriodicalExecuter(function(t){new WCF.Action.Proxy({autoSend:!0,data:{actionName:"keepAlive",className:"wcf\\data\\session\\SessionAction"},failure:function(){t.stop()},showLoadingOverlay:!1,suppressErrors:!0})},1e3*t)}}),WCF.InlineEditor=Class.extend({_callbacks:[],_dropdowns:{},_elements:{},_notification:null,_options:[],_proxy:null,_updateData:[],init:function(t){var e=$(t);if(e.length){this._setOptions();for(var i="",n=0,a=this._options.length;a>n;n++)if(this._options[n].isQuickOption){i=this._options[n].optionName;break}var s=this;e.each(function(t,e){var n=$(e),a=n.wcfIdentify(),o=s._getTriggerElement(n);null!==o&&1===o.length&&(o.click($.proxy(s._show,s)).data("elementID",a),i&&o.disableSelection().data("optionName",i).dblclick($.proxy(s._click,s)),s._elements[a]=n)}),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),WCF.CloseOverlayHandler.addCallback("WCF.InlineEditor",$.proxy(this._closeAll,this)),this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success"),"success")}},_closeAll:function(){for(var t in this._elements)this._hide(t)},_setOptions:function(){this._options=[]},registerCallback:function(t){$.isFunction(t)&&this._callbacks.push(t)},_getTriggerElement:function(){return null},_show:function(t){var e=$(t.currentTarget).data("elementID"),i=null;this._dropdowns[e]||(i=this._getTriggerElement(this._elements[e]).addClass("dropdownToggle").wrap('<span class="dropdown" />'),this._dropdowns[e]=$('<ul class="dropdownMenu" />').insertAfter(i)),this._dropdowns[e].empty();for(var n=!1,a="",s=0,o=this._options.length;o>s;s++){var r=this._options[s];if("divider"===r.optionName)""!==a&&"divider"!==a&&($('<li class="dropdownDivider" />').appendTo(this._dropdowns[e]),a=r.optionName);else if(this._validate(e,r.optionName)||this._validateCallbacks(e,r.optionName)){var l=$("<li><span>"+r.label+"</span></li>").appendTo(this._dropdowns[e]);l.data("elementID",e).data("optionName",r.optionName).data("isQuickOption",r.isQuickOption?!0:!1).click($.proxy(this._click,this)),n=!0,a=r.optionName}}if(n){var c=this._dropdowns[e].children().last();c.hasClass("dropdownDivider")&&c.remove();var h=null,d=0;if(this._dropdowns[e].children().each(function(t,e){var i=$(e);i.hasClass("dropdownDivider")||(i.data("isQuickOption")?h=i:d++)}),!d)return h.trigger("click"),null!==i&&WCF.Dropdown.close(i.parents(".dropdown").wcfIdentify()),!1}return null!==i&&WCF.Dropdown.initDropdown(i,!0),!1},_validate:function(){return!1},_validateCallbacks:function(t,e){var i=this._callbacks.length;if(i)for(var n=0;i>n;n++)if(this._callbacks[n].validate(this._elements[t],e))return!0;return!1},_success:function(t){var e=this._updateData.length;e&&(this._updateState(t),this._updateData=[])},_updateState:function(){},_click:function(t){var e=$(t.currentTarget),i=e.data("elementID"),n=e.data("optionName");this._execute(i,n)||this._executeCallback(i,n),this._hide(i)},_execute:function(){return!1},_executeCallback:function(t,e){var i=this._callbacks.length;if(i)for(var n=0;i>n;n++)if(this._callbacks[n].execute(this._elements[t],e))return!0;return!1},_hide:function(t){this._dropdowns[t]&&this._dropdowns[t].empty().removeClass("dropdownOpen")}}),WCF.Upload=Class.extend({_name:"__files[]",_buttonSelector:null,_fileListSelector:null,_fileUpload:null,_className:"",_iframe:null,_internalFileID:0,_options:{},_uploadMatrix:[],_supportsAJAXUpload:!0,_overlay:null,init:function(t,e,i,n){this._buttonSelector=t,this._fileListSelector=e,this._className=i,this._internalFileID=0,this._options=$.extend(!0,{action:"upload",multiple:!1,url:"index.php/AJAXUpload/?t="+SECURITY_TOKEN+SID_ARG_2ND},n||{});var a=new XMLHttpRequest;this._supportsAJAXUpload=a&&"upload"in a&&"onprogress"in a.upload,this._createButton()},_createButton:function(){if(this._supportsAJAXUpload){this._fileUpload=$('<input type="file" name="'+this._name+'" '+(this._options.multiple?'multiple="true" ':"")+"/>"),this._fileUpload.change($.proxy(this._upload,this));var t=$('<p class="button uploadButton"><span>'+WCF.Language.get("wcf.global.button.upload")+"</span></p>");t.prepend(this._fileUpload)}else{var t=$('<p class="button uploadFallbackButton"><span>'+WCF.Language.get("wcf.global.button.upload")+"</span></p>");t.click($.proxy(this._showOverlay,this))}this._insertButton(t)},_insertButton:function(t){this._buttonSelector.append(t)},_removeButton:function(){var t=".uploadButton";this._supportsAJAXUpload||(t=".uploadFallbackButton"),this._buttonSelector.find(t).remove()},_upload:function(){var t=this._fileUpload.prop("files");if(t.length){var e=new FormData,i=this._createUploadMatrix(t);if(!this._uploadMatrix[i].length)return;for(var n=0,a=t.length;a>n;n++)if(this._uploadMatrix[i][n]){var s=this._uploadMatrix[i][n].data("internalFileID");e.append("__files["+s+"]",t[n])}e.append("actionName",this._options.action),e.append("className",this._className);var o=this._getParameters();for(var r in o)e.append("parameters["+r+"]",o[r]);var l=this;$.ajax({type:"POST",url:this._options.url,enctype:"multipart/form-data",data:e,contentType:!1,processData:!1,success:function(t){l._success(i,t)},error:$.proxy(this._error,this),xhr:function(){var t=$.ajaxSettings.xhr();return t&&t.upload.addEventListener("progress",function(t){l._progress(i,t)},!1),t}})}},_createUploadMatrix:function(t){if(t.length){var e=this._uploadMatrix.length;this._uploadMatrix[e]=[];for(var i=0,n=t.length;n>i;i++){var a=t[i],s=this._initFile(a);s.hasClass("uploadFailed")||(s.data("filename",a.name).data("internalFileID",this._internalFileID++),this._uploadMatrix[e][i]=s)}return e}return null},_success:function(){},_error:function(){},_progress:function(t,e){var i=Math.round(100*e.loaded/e.total);for(var n in this._uploadMatrix[t])this._uploadMatrix[t][n].find("progress").attr("value",i)},_getParameters:function(){return{}},_initFile:function(t){return $("<li>"+t.name+" ("+t.size+')<progress max="100" /></li>').appendTo(this._fileListSelector)},_showOverlay:function(){if(null===this._iframe&&(this._iframe=$('<iframe name="__fileUploadIFrame" />').hide().appendTo(document.body)),
+!this._overlay){this._overlay=$('<div><form enctype="multipart/form-data" method="post" action="'+this._options.url+'" target="__fileUploadIFrame" /></div>').hide().appendTo(document.body);var t=this._overlay.find("form");$('<dl class="wide"><dd><input type="file" id="__fileUpload" name="'+this._name+'" '+(this._options.multiple?'multiple="true" ':"")+"/></dd></dl>").appendTo(t),$('<div class="formSubmit"><input type="submit" value="Upload" accesskey="s" /></div></form>').appendTo(t),$('<input type="hidden" name="isFallback" value="1" />').appendTo(t),$('<input type="hidden" name="actionName" value="'+this._options.action+'" />').appendTo(t),$('<input type="hidden" name="className" value="'+this._className+'" />').appendTo(t);var e=this._getParameters();for(var i in e)$('<input type="hidden" name="'+i+'" value="'+e[i]+'" />').appendTo(t);t.submit($.proxy(function(){var t={name:this._getFilename(),size:""},e=this._createUploadMatrix([t]),i=this;this._iframe.data("loading",!0).off("load").load(function(){i._evaluateResponse(e)}),this._overlay.wcfDialog("close")},this))}this._overlay.wcfDialog({title:WCF.Language.get("wcf.global.button.upload")})},_evaluateResponse:function(t){var e=$.parseJSON(this._iframe.contents().find("pre").html());this._success(t,e)},_getFilename:function(){return $("#__fileUpload").val().split("\\").pop()}}),WCF.Upload.Parallel=WCF.Upload.extend({init:function(t,e,i,n){n=$.extend(!0,n||{},{multiple:!0}),this._super(t,e,i,n)},_upload:function(){for(var t=this._fileUpload.prop("files"),e=0,i=t.length;i>e;e++){var n=t[e],a=new FormData,s=this._createUploadMatrix(n);if(this._uploadMatrix[s].length){a.append("__files["+s+"]",n),a.append("actionName",this._options.action),a.append("className",this._className);var o=this._getParameters();for(var r in o)a.append("parameters["+r+"]",o[r]);this._sendRequest(s,a)}}},_sendRequest:function(t,e){var i=this;$.ajax({type:"POST",url:this._options.url,enctype:"multipart/form-data",data:e,contentType:!1,processData:!1,success:function(e){i._success(t,e)},error:$.proxy(this._error,this),xhr:function(){var e=$.ajaxSettings.xhr();return e&&e.upload.addEventListener("progress",function(e){i._progress(t,e)},!1),e}})},_createUploadMatrix:function(t){var e=this._initFile(t);return e.hasClass("uploadFailed")?null:(e.data("filename",t.name).data("internalFileID",this._internalFileID),this._uploadMatrix[this._internalFileID++]=e,this._internalFileID-1)},_success:function(){},_progress:function(t,e){var i=Math.round(100*e.loaded/e.total);this._uploadMatrix[t].find("progress").attr("value",i)},_showOverlay:function(){if(null===this._iframe&&(this._iframe=$('<iframe name="__fileUploadIFrame" />').hide().appendTo(document.body)),!this._overlay){this._overlay=$('<div><form enctype="multipart/form-data" method="post" action="'+this._options.url+'" target="__fileUploadIFrame" /></div>').hide().appendTo(document.body);var t=this._overlay.find("form");$('<dl class="wide"><dd><input type="file" id="__fileUpload" name="'+this._name+'" '+(this._options.multiple?'multiple="true" ':"")+"/></dd></dl>").appendTo(t),$('<div class="formSubmit"><input type="submit" value="Upload" accesskey="s" /></div></form>').appendTo(t),$('<input type="hidden" name="isFallback" value="1" />').appendTo(t),$('<input type="hidden" name="actionName" value="'+this._options.action+'" />').appendTo(t),$('<input type="hidden" name="className" value="'+this._className+'" />').appendTo(t);var e=this._getParameters();for(var i in e)$('<input type="hidden" name="'+i+'" value="'+e[i]+'" />').appendTo(t);t.submit($.proxy(function(){var t={name:this._getFilename(),size:""},e=this._createUploadMatrix(t),i=this;this._iframe.data("loading",!0).off("load").load(function(){i._evaluateResponse(e)}),this._overlay.wcfDialog("close")},this))}this._overlay.wcfDialog({title:WCF.Language.get("wcf.global.button.upload")})},_evaluateResponse:function(t){var e=$.parseJSON(this._iframe.contents().find("pre").html());this._success(t,e)}}),WCF.Sortable={},WCF.Sortable.List=Class.extend({_additionalParameters:{},_className:"",_containerID:"",_container:null,_notification:null,_offset:0,_options:{},_proxy:null,_structure:{},init:function(t,e,i,n,a,s){if(this._additionalParameters=s||{},this._containerID=$.wcfEscapeID(t),this._container=$("#"+this._containerID),this._className=e,this._offset=i?i:0,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._structure={},this._options=$.extend(!0,{axis:"y",connectWith:"#"+this._containerID+" .sortableList",disableNesting:"sortableNoNesting",doNotClear:!0,errorClass:"sortableInvalidTarget",forcePlaceholderSize:!0,helper:"clone",items:"li:not(.sortableNoSorting)",opacity:.6,placeholder:"sortablePlaceholder",tolerance:"pointer",toleranceElement:"> span"},n||{}),a?$("#"+this._containerID+" .sortableList").sortable(this._options):$("#"+this._containerID+" > .sortableList").nestedSortable(this._options),this._className){var o=this._container.find(".formSubmit");if(!o.length&&(o=this._container.next(".formSubmit"),!o.length))return void console.debug("[WCF.Sortable.Simple] Unable to find form submit for saving, aborting.");o.children('button[data-type="submit"]').click($.proxy(this._submit,this))}},_submit:function(){this._structure={},this._container.find(".sortableList").each($.proxy(function(t,e){var i=$(e),n=i.data("objectID");void 0!==n&&i.children(this._options.items).each($.proxy(function(t,e){var i=$(e).data("objectID");this._structure[n]||(this._structure[n]=[]),this._structure[n].push(i)},this))},this));var t=$.extend(!0,{data:{offset:this._offset,structure:this._structure}},this._additionalParameters);this._proxy.setOption("data",{actionName:"updatePosition",className:this._className,interfaceName:"wcf\\data\\ISortableAction",parameters:t}),this._proxy.sendRequest()},_success:function(){null===this._notification&&(this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success.edit"))),this._notification.show()}}),WCF.Popover=Class.extend({_activeElementID:"",_cancelPopover:!1,_data:{},_defaultDimensions:{height:150,width:450},_defaultOrientation:{x:"right",y:"top"},_delay:{show:800,hide:500},_hoverElement:!1,_hoverElementID:"",_hoverPopover:!1,_margin:20,_peOut:null,_peOverElement:null,_popover:null,_popoverContent:null,_popoverOffset:10,_selector:"",init:function(t){$.browser.mobile||(this._activeElementID="",this._cancelPopover=!1,this._data={},this._defaultDimensions={height:150,width:450},this._defaultOrientation={x:"right",y:"top"},this._delay={show:800,hide:500},this._hoverElement=!1,this._hoverElementID="",this._hoverPopover=!1,this._margin=20,this._peOut=null,this._peOverElement=null,this._popoverOffset=10,this._selector=t,this._popover=$('<div class="popover"><span class="icon icon48 icon-spinner"></span><div class="popoverContent"></div></div>').hide().appendTo(document.body),this._popoverContent=this._popover.children(".popoverContent:eq(0)"),this._popover.hover($.proxy(this._overPopover,this),$.proxy(this._out,this)),this._initContainers(),WCF.DOMNodeInsertedHandler.addCallback("WCF.Popover."+t,$.proxy(this._initContainers,this)))},_initContainers:function(){if(!$.browser.mobile){var t=$(this._selector);t.length&&t.each($.proxy(function(t,e){var i=$(e),n=i.wcfIdentify();this._data[n]||(this._data[n]={content:null,isLoading:!1},i.hover($.proxy(this._overElement,this),$.proxy(this._out,this)),i.is("a")&&i.attr("href")&&i.click($.proxy(this._cancel,this)))},this))}},_cancel:function(){this._cancelPopover=!0,this._hide(!0)},_overElement:function(t){if(!this._cancelPopover){null!==this._peOverElement&&this._peOverElement.stop();var e=$(t.currentTarget).wcfIdentify();this._hoverElementID=e,this._peOverElement=new WCF.PeriodicalExecuter($.proxy(function(t){t.stop(),this._hoverElementID===e&&(this._activeElementID=e,this._prepare())},this),this._delay.show),this._hoverElement=!0,this._hoverPopover=!1}},_prepare:function(){if(!this._cancelPopover){null!==this._peOut&&this._peOut.stop(),this._popover.is(":visible")&&this._hide(!0),!this._data[this._activeElementID].loading&&this._data[this._activeElementID].content?(this._popoverContent.html(this._data[this._activeElementID].content),WCF.DOMNodeInsertedHandler.execute()):this._data[this._activeElementID].loading=!0;var t=this._popover.show().getDimensions();t=this._data[this._activeElementID].loading?{height:Math.max(t.height,this._defaultDimensions.height),width:Math.max(t.width,this._defaultDimensions.width)}:this._fixElementDimensions(this._popover,t),this._popover.hide();var e=this._getOrientation(t.height,t.width);this._popover.css(this._getCSS(e.x,e.y)),this._popover.removeClass("bottom left right top").addClass(e.x).addClass(e.y),this._show()}},_show:function(){this._cancelPopover||(this._popover.stop().show().css({opacity:1}).wcfFadeIn(),this._data[this._activeElementID].loading?(this._popover.children("span").show(),this._loadContent()):(this._popover.children("span").hide(),this._popoverContent.css({opacity:1})))},_loadContent:function(){},_insertContent:function(t,e,i){if(this._data[t]={content:e,loading:!1},this._activeElementID===t)if(i){var n=this._popoverContent.getDimensions();this._popoverContent.css({height:"auto",width:"auto"}),this._popoverContent.html(this._data[t].content);var a=this._popoverContent.getDimensions();this._popoverContent.html("").css({height:n.height+"px",width:n.width+"px"});var s=this;this._popoverContent.animate({height:a.height+"px",width:a.width+"px"},300,function(){s._popover.children("span").hide(),s._popoverContent.html(s._data[t].content).css({opacity:0}).animate({opacity:1},200),WCF.DOMNodeInsertedHandler.execute()})}else this._popover.children("span").hide(),this._popoverContent.html(this._data[t].content),WCF.DOMNodeInsertedHandler.execute()},_hide:function(t){var e=this;this._popoverContent.stop(),this._popover.stop(),t?(e._popover.css({opacity:0}).hide(),e._popoverContent.empty().css({height:"auto",opacity:0,width:"auto"})):this._popover.wcfFadeOut(function(){e._popoverContent.empty().css({height:"auto",opacity:0,width:"auto"}),e._popover.hide()})},_overPopover:function(){null!==this._peOut&&this._peOut.stop(),this._hoverElement=!1,this._hoverPopover=!0},_out:function(){this._cancelPopover||(this._hoverElementID="",this._hoverElement=!1,this._hoverPopover=!1,this._peOut=new WCF.PeriodicalExecuter($.proxy(function(t){t.stop(),this._hoverElement||this._hoverPopover||this._hide(!1)},this),this._delay.hide))},_getOrientation:function(t,e){var i=$("#"+this._activeElementID),n=i.getOffsets("offset"),a=i.getDimensions(),s=$(document).getDimensions(),o="left"===this._defaultOrientation.x?"left":"right",r="bottom"===this._defaultOrientation.y?"bottom":"top",l=this._evaluateOrientation(o,r,n,a,s,t,e);return l.flawed&&(o="left"===o?"right":"left",l=this._evaluateOrientation(o,r,n,a,s,t,e),l.flawed&&(o="right"===o?"left":"right",r="bottom"===r?"top":"bottom",l=this._evaluateOrientation(o,r,n,a,s,t,e),l.flawed&&(o="left"===o?"right":"left",l=this._evaluateOrientation(o,r,n,a,s,t,e),l.flawed&&(o="left"===this._defaultOrientationX?"left":"right",r="bottom"===this._defaultOrientationY?"bottom":"top")))),{x:o,y:r}},_evaluateOrientation:function(t,e,i,n,a,s,o){var r=0,l=0;switch(t){case"left":l=i.left-o;break;case"right":l=a.width-(i.left+o)}switch(e){case"bottom":r=a.height-(i.top+n.height+this._popoverOffset+s);break;case"top":r=i.top-(s-this._popoverOffset)}var c=!1;return(r<this._margin||l<this._margin)&&(c=!0),{flawed:c,x:l,y:r}},_getCSS:function(t,e){var i={bottom:"auto",left:"auto",right:"auto",top:"auto"},n=$("#"+this._activeElementID),a=n.getOffsets("offset"),s=this._fixElementDimensions(n,n.getDimensions()),o=$(window).getDimensions();switch(t){case"left":i.right=o.width-(a.left+s.width);break;case"right":i.left=a.left}switch(e){case"bottom":i.top=a.top+(s.height+this._popoverOffset);break;case"top":i.bottom=o.height-(a.top-this._popoverOffset)}return i},_fixElementDimensions:function(t,e){var i=t.parent().getDimensions();return i.height<e.height&&(e.height=i.height),i.width<e.width&&(e.width=i.width),e}}),WCF.EditableItemList=Class.extend({_allowCustomInput:!1,_className:"",_data:{},_form:null,_itemList:null,_objectID:0,_objectTypeID:0,_search:null,_searchInput:null,init:function(t,e){if(this._itemList=$(t),this._searchInput=$(e),this._data={},!this._itemList.length||!this._searchInput.length)return void console.debug("[WCF.EditableItemList] Item list and/or search input do not exist, aborting.");if(this._objectID=this._getObjectID(),this._objectTypeID=this._getObjectTypeID(),this._itemList.find(".jsEditableItem").click($.proxy(this._click,this)),this._itemList.children("ul").length||$("<ul />").appendTo(this._itemList),this._itemList=this._itemList.children("ul"),this._form=this._itemList.parents("form").submit($.proxy(this._submit,this)),this._allowCustomInput){var i=this;this._searchInput.keydown($.proxy(this._keyDown,this)).on("paste",function(){setTimeout(function(){i._onPaste()},100)})}this._searchInput.parents(".dropdown").data("preventSubmit",!0)},_keyDown:function(t){if(null===t||188===t.which||t.which===$.ui.keyCode.ENTER){if(null!==t&&t.which===$.ui.keyCode.ENTER&&this._search&&-1!==this._search._itemIndex)return!1;var e=$.trim(this._searchInput.val());return t&&188===t.which&&(e=e.substring(0,this._searchInput.getCaret())),""===e?!0:(this.addItem({objectID:0,label:e}),this._searchInput.val(t&&188===t.which?$.trim(this._searchInput.val().substr(this._searchInput.getCaret())):""),null!==t&&t.stopPropagation(),!1)}return!0},_onPaste:function(){var t=$.trim(this._searchInput.val());t=t.split(",");for(var e=0,i=t.length;i>e;e++){var n=$.trim(t[e]);""!==n&&this.addItem({objectID:0,label:n})}this._searchInput.val("")},load:function(){},_click:function(t){var e=$(t.currentTarget),i=e.data("objectID"),n=e.data("label");return this._search&&this._search.removeExcludedSearchValue(n),this._removeItem(i,n),e.remove(),t.stopPropagation(),!1},_getObjectID:function(){return 0},_getObjectTypeID:function(){return 0},addItem:function(t){if(this._data[t.objectID]&&(0!==t.objectID||!this._allowCustomInput))return!0;var e=$('<li class="badge">'+WCF.String.escapeHTML(t.label)+"</li>").data("objectID",t.objectID).data("label",t.label).appendTo(this._itemList);return e.click($.proxy(this._click,this)),this._search&&this._search.addExcludedSearchValue(t.label),this._addItem(t.objectID,t.label),!0},clearList:function(){this._itemList.children("li").each($.proxy(function(t,e){var i=$(e);this._search&&this._search.removeExcludedSearchValue(i.data("label")),i.remove(),this._removeItem(i.data("objectID"),i.data("label"))},this))},_submit:function(){this._keyDown(null)},_addItem:function(t,e){this._data[t]=e},_removeItem:function(t){delete this._data[t]},getSearchInput:function(){return this._searchInput}}),WCF.Sitemap=Class.extend({_cache:[],_dialog:null,_didInit:!1,_proxy:null,init:function(){$("#sitemap").click($.proxy(this._click,this)),this._cache=[],this._dialog=null,this._didInit=!1,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})},_click:function(){null===this._dialog?(this._dialog=$('<div id="sitemapDialog" />').appendTo(document.body),this._proxy.setOption("data",{actionName:"getSitemap",className:"wcf\\data\\sitemap\\SitemapAction"}),this._proxy.sendRequest()):(this._dialog.wcfDialog("open"),$(document).trigger("resize"))},_success:function(t){this._didInit?(this._cache.push(t.returnValues.sitemapName),this._dialog.find("#sitemap_"+t.returnValues.sitemapName).html(t.returnValues.template),this._dialog.wcfDialog("render")):(this._cache.push(t.returnValues.sitemapName),this._dialog.html(t.returnValues.template),this._dialog.find(".sitemapNavigation").click($.proxy(this._navigate,this)),this._dialog.find(".tabMenuContainer").wcfTabs("select","sitemap_"+t.returnValues.sitemapName),this._dialog.wcfDialog({title:WCF.Language.get("wcf.page.sitemap")}),this._didInit=!0),$(document).trigger("resize")},_navigate:function(t){var e=$(t.currentTarget).data("sitemapName");WCF.inArray(e,this._cache)?(this._dialog.find(".tabMenuContainer").wcfTabs("select","sitemap_"+e),this._dialog.wcfDialog("render")):(this._proxy.setOption("data",{actionName:"getSitemap",className:"wcf\\data\\sitemap\\SitemapAction",parameters:{sitemapName:e}}),this._proxy.sendRequest())}}),WCF.Language.Chooser=Class.extend({_callback:null,_dropdown:null,_input:null,init:function(t,e,i,n,a,s){var o=$("#"+t);if(1!=o.length)return void console.debug("[WCF.Language.Chooser] Invalid container id '"+t+"' given");if(this._input=$("#"+e),this._input.length||(this._input=$('<input type="hidden" name="'+e+'" value="'+i+'" />').appendTo(o)),void 0!==a){if(!$.isFunction(a))return void console.debug("[WCF.Language.Chooser] Given callback is invalid");this._callback=a}this._dropdown=$('<div class="dropdown" id="'+t+'-languageChooser" />').appendTo(o),$('<div class="dropdownToggle boxFlag box24" data-toggle="'+t+'-languageChooser"></div>').appendTo(this._dropdown);var r=$('<ul class="dropdownMenu" />').appendTo(this._dropdown);for(var l in n){var c=n[l],h=$('<li class="boxFlag"><a class="box24"><div class="framed"><img src="'+c.iconPath+'" alt="" class="iconFlag" /></div> <div><h3>'+c.languageName+"</h3></div></a></li>").appendTo(r);if(h.data("languageID",l).click($.proxy(this._click,this)),l==i){var d=$(""+h.html()),u=d.children().detach();this._dropdown.children(".dropdownToggle").empty().append(u)}}if(s){$('<li class="dropdownDivider" />').appendTo(r);var h=$("<li><a>"+WCF.Language.get("wcf.global.language.noSelection")+"</a></li>").data("languageID",0).click($.proxy(this._click,this)).appendTo(r);0===i&&this._dropdown.children(".dropdownToggle").empty().append(h.html())}WCF.Dropdown.init()},_click:function(t){var e=$(t.currentTarget),i=e.data("languageID");this._input.val(i);var n=$(""+e.html()),a=0===i?n:n.children().detach();this._dropdown.children(".dropdownToggle").empty().append(a),null!==this._callback&&this._callback(e)}}),WCF.Style={},WCF.Style.Chooser=Class.extend({_dialog:null,_proxy:null,init:function(){$('<li class="styleChooser"><a>'+WCF.Language.get("wcf.style.changeStyle")+"</a></li>").appendTo($("#footerNavigation > ul.navigationItems")).click($.proxy(this._showDialog,this)),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})},_showDialog:function(){null===this._dialog?(this._dialog=$('<div id="styleChooser" />').hide().appendTo(document.body),this._loadDialog()):this._dialog.wcfDialog({title:WCF.Language.get("wcf.style.changeStyle")})},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getStyleChooser",className:"wcf\\data\\style\\StyleAction"}),this._proxy.sendRequest()},_success:function(t){return"changeStyle"===t.actionName?void window.location.reload():(this._dialog.html(t.returnValues.template),this._dialog.find("li").addClass("pointer").click($.proxy(this._click,this)),void this._showDialog())},_click:function(t){this._proxy.setOption("data",{actionName:"changeStyle",className:"wcf\\data\\style\\StyleAction",objectIDs:[$(t.currentTarget).data("styleID")]}),this._proxy.sendRequest()}}),WCF.UserPanel=Class.extend({_container:null,_didLoad:!1,_link:null,_noItems:"",_revertOnEmpty:!0,init:function(t){return this._container=$("#"+t),this._didLoad=!1,this._revertOnEmpty=!0,1!=this._container.length?void console.debug("[WCF.UserPanel] Unable to find container identfied by '"+t+"', aborting."):void this._convert()},_convert:function(){this._container.addClass("dropdown"),this._link=this._container.children("a").remove();var t=$('<a class="dropdownToggle">'+this._link.html()+"</a>").appendTo(this._container).click($.proxy(this._click,this)),e=$('<ul class="dropdownMenu" />').appendTo(this._container);$('<li class="jsDropdownPlaceholder"><span>'+WCF.Language.get("wcf.global.loading")+"</span></li>").appendTo(e),this._addDefaultItems(e),this._container.dblclick($.proxy(function(){return window.location=this._link.attr("href"),!1},this)),WCF.Dropdown.initDropdown(t,!1)},_addDefaultItems:function(){},_addDivider:function(t){$('<li class="dropdownDivider" />').appendTo(t)},_click:function(){this._didLoad||(new WCF.Action.Proxy({autoSend:!0,data:this._getParameters(),success:$.proxy(this._success,this)}),this._didLoad=!0)},_getParameters:function(){return{}},_success:function(t){var e=WCF.Dropdown.getDropdownMenu(this._container.wcfIdentify());if(e.children(".jsDropdownPlaceholder").remove(),t.returnValues&&t.returnValues.template){$(""+t.returnValues.template).prependTo(e);var i=this._container.find(".badge");i.length||(i=$('<span class="badge badgeInverse" />').appendTo(this._container.children(".dropdownToggle")),i.before(" ")),i.html(t.returnValues.totalCount),this._after(e)}else $("<li><span>"+WCF.Language.get(this._noItems)+"</span></li>").prependTo(e),this._container.find(".badge").remove()},_after:function(){}}),$.widget("ui.wcfDialog",{_closeButton:null,_container:null,_content:null,_overlay:null,_title:null,_titlebar:null,_isOpen:!1,options:{autoOpen:!0,closable:!0,closeButtonLabel:null,closeConfirmMessage:null,closeViaModal:!0,hideTitle:!1,modal:!0,title:"",zIndex:400,onClose:null,onShow:null},_createWidget:function(t,e){return"script"===$(e).getTagName()?(console.debug("[ui.wcfDialog] Ignored script tag"),this.element=!1,null):void $.Widget.prototype._createWidget.apply(this,arguments)},_init:function(){this.options.autoOpen&&this.open(),$(window).resize($.proxy(this._resize,this))},_create:function(){null===this.options.closeButtonLabel&&(this.options.closeButtonLabel=WCF.Language.get("wcf.global.button.close")),this._container=$('<div class="dialogContainer" />').hide().css({zIndex:this.options.zIndex}).appendTo(document.body),this._titlebar=$('<header class="dialogTitlebar" />').hide().appendTo(this._container),this._title=$('<span class="dialogTitle" />').hide().appendTo(this._titlebar),this._closeButton=$('<a class="dialogCloseButton jsTooltip" title="'+this.options.closeButtonLabel+'"><span /></a>').click($.proxy(this.close,this)).hide().appendTo(this._titlebar),this._content=$('<div class="dialogContent" />').appendTo(this._container),this._setOption("title",this.options.title),this._setOption("closable",this.options.closable);var t=this.element.detach();this._content.html(t),this.options.modal&&(this._overlay=$("#jsWcfDialogOverlay"),this._overlay.length||(this._overlay=$('<div id="jsWcfDialogOverlay" class="dialogOverlay" />').css({height:"100%",zIndex:399}).hide().appendTo(document.body)),this.options.closable&&this.options.closeViaModal&&(this._overlay.click($.proxy(this.close,this)),$(document).keyup($.proxy(function(t){t.keyCode&&t.keyCode===$.ui.keyCode.ESCAPE&&(this.close(),t.preventDefault())},this)))),WCF.DOMNodeInsertedHandler.execute()},_setOption:function(t,e){return this.options[t]=e,"hideTitle"==t||"title"==t?this.options.hideTitle||""==this.options.title?this._title.html(""):this._title.html(this.options.title).show():("closable"==t||"closeButtonLabel"==t)&&(this.options.closable?(this._closeButton.attr("title",this.options.closeButtonLabel).show().find("span").html(this.options.closeButtonLabel),WCF.DOMNodeInsertedHandler.execute()):this._closeButton.hide()),!this.options.hideTitle&&""!=this.options.title||this.options.closable?this._titlebar.show():this._titlebar.hide(),this},open:function(){this.element!==!1&&(this.isOpen()||(null!==this._overlay&&(WCF.activeDialogs++,1===WCF.activeDialogs&&this._overlay.show()),this.render(),this._isOpen=!0))},isOpen:function(){return this._isOpen},close:function(t){this.isOpen()&&(this.options.closeConfirmMessage?WCF.System.Confirmation.show(this.options.closeConfirmMessage,$.proxy(function(t){"confirm"===t&&this._close()},this)):this._close(),void 0!==t&&t.preventDefault())},_close:function(){this._isOpen=!1,this._container.wcfFadeOut(),null!==this._overlay&&(WCF.activeDialogs--,0===WCF.activeDialogs&&this._overlay.hide()),null!==this.options.onClose&&this.options.onClose()},_resize:function(){this.isOpen()&&this.render()},render:function(){this._container.is(":visible")||"0px"!==this._container.css("top")||window.scrollTo(0,0),this._container.show(),this._content.children().show(),this._content.css({height:"auto",width:"auto"}),this._container.stop(),this._content.stop(),this._container.show().css("opacity",1);var t=0;this._content.find(".formSubmit").length?(t=this._content.find(".formSubmit").outerHeight(),this._content.addClass("dialogForm").css({marginBottom:t+"px"})):this._content.removeClass("dialogForm").css({marginBottom:"0px"});var e=$(window).getDimensions();.9*e.width>800&&this._container.css("maxWidth","800px");var i=this._container.getDimensions("outer"),n=this._content.getDimensions(),t=i.height-n.height,a=e.height-t-120;this._content.css({maxHeight:a+"px"}),this._determineOverflow(),i=this._container.getDimensions("outer");var s=Math.round((e.width-i.width)/2),o=Math.round((e.height-i.height)/2),r=Math.round(e.height/100*20);o>r&&(o=r),this._container.css({left:s+"px",top:o+"px"}),this._content.css({height:"auto",width:"auto"}),this.isOpen()||(this._container.hide(),this._container.wcfFadeIn($.proxy(function(){null!==this.options.onShow&&this.options.onShow()},this)))},_determineOverflow:function(){var t=$(window).getDimensions(),e=this._content.css("maxHeight");this._content.css("maxHeight","none");var i=this._container.getDimensions("outer"),n="visible";if((.8*t.height<i.height||.8*t.width<i.width)&&(n="auto"),this._content.css("overflow",n),this._content.css("maxHeight",e),"visible"===n){var a=0;this._content.children().each(function(t,e){a+=$(e).outerHeight()}),this._content.height()<a&&this._content.css("overflow","auto")}},_getContentDimensions:function(t){var e=this._content.getDimensions();return t&&e.height>t&&(e.height=t),e}}),$.widget("ui.wcfSlideshow",{_buttonList:null,_count:0,_index:0,_itemList:null,_items:null,_timer:null,_width:0,options:{cycle:!0,cycleInterval:5,itemGap:50},_create:function(){this._itemList=this.element.children("ul"),this._items=this._itemList.children("li"),this._count=this._items.length,this._index=0,this._count>1&&this._initSlideshow()},_initSlideshow:function(){var t=$(this._items.get(0)).outerHeight();this._items.addClass("slideshowItem"),this._width=this.element.css("height",t).innerWidth(),this._itemList.addClass("slideshowItemList").css("left",0),this._items.each($.proxy(function(e,i){$(i).show().css({height:t,left:(this._width+this.options.itemGap)*e,width:this._width})},this)),this.element.css({height:t,width:this._width}).hover($.proxy(this._hoverIn,this),$.proxy(this._hoverOut,this)),this._buttonList=$('<ul class="slideshowButtonList" />').appendTo(this.element);for(var e=0;e<this._count;e++){var i=$('<li><a><span class="icon icon16 icon-circle" /></a></li>').data("index",e).click($.proxy(this._click,this)).appendTo(this._buttonList);0==e&&i.find(".icon").addClass("active")}this._resetTimer(),$(window).resize($.proxy(this._resize,this))},rebuildHeight:function(){var t=$(this._items.get(0)).css("height","auto"),e=t.outerHeight();this._items.css("height",e+"px"),this.element.css("height",e+"px")},_resize:function(){this._width=this.element.css("width","auto").innerWidth(),this._items.each($.proxy(function(t,e){$(e).css({left:(this._width+this.options.itemGap)*t,width:this._width})},this)),this._index--,this.moveTo(null)},_hoverIn:function(){null!==this._timer&&this._timer.stop()},_hoverOut:function(){this._resetTimer()},_resetTimer:function(){if(this.options.cycle){null!==this._timer&&this._timer.stop();var t=this;this._timer=new WCF.PeriodicalExecuter(function(){t.moveTo(null)},1e3*this.options.cycleInterval)}},_click:function(t){this.moveTo($(t.currentTarget).data("index")),this._resetTimer()},moveTo:function(t){this._index=null===t?this._index+1:t,this._index==this._count&&(this._index=0),$(this._buttonList.find(".icon").removeClass("active").get(this._index)).addClass("active"),this._itemList.css("left",this._index*(this._width+this.options.itemGap)*-1),this._trigger("moveTo",null,{index:this._index})},getItem:function(t){return this._items[t]?this._items[t]:null}}),$.widget("ui.wcfTabs",$.ui.tabs,{_sanitizeSelector:function(t){return t.replace(/([:\.])/g,"\\$1")},select:function(t){return $.isNumeric(t)||(this.panels.each(function(e,i){return $(i).wcfIdentify()===t?(t=e,!1):void 0}),$.isNumeric(t))?void this._setOption("active",t):void console.debug("[ui.wcfTabs] Unable to find panel identified by '"+t+"', aborting.")},selectTab:function(t){t="#"+t,this.anchors.each(function(e,i){var n=$(i);return n.prop("hash")===t?(n.trigger("click"),!1):void 0})},getCurrentIndex:function(){return this.lis.index(this.lis.filter(".ui-tabs-selected"))},hasAnchor:function(t,e){var i=!1;return this.anchors.each(function(n,a){var s=$(a).attr("href");if(/#.+/.test(s)){var o=s.split("#",2);if(e&&(o=o[1].split("-",2)),o[1]===t)return i=!0,!1}}),i},revertToDefault:function(){var t=this.element.data("active");t&&""!==t||(t=0),this.select(t)},_processTabs:function(){var t=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return $("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=$(),this.anchors.each(function(e,i){var n,a,s=$(i).uniqueId().attr("id"),o=$(i).closest("li"),r=o.attr("aria-controls");n=i.hash,a=t.element.find(t._sanitizeSelector(n)),a.length&&(t.panels=t.panels.add(a)),r&&o.data("ui-tabs-aria-controls",r),o.attr({"aria-controls":n.substring(1),"aria-labelledby":s}),a.attr("aria-labelledby",s)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},load:function(){}}),$.widget("ui.wcfPages",{SHOW_LINKS:11,SHOW_SUB_LINKS:20,options:{activePage:1,maxPage:1,nextPage:null,previousPage:null},_create:function(){null===this.options.nextPage&&(this.options.nextPage=WCF.Language.get("wcf.global.page.next")),null===this.options.previousPage&&(this.options.previousPage=WCF.Language.get("wcf.global.page.previous")),this.element.addClass("pageNavigation"),this._render()},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments),this.element.children().remove()},_render:function(){if(!this.options.disabled&&this.options.maxPage>1){var t=!1;this.element.hasClass("hidden")&&this.element.removeClass("hidden"),this.element.show(),this.element.children().remove();var e=$("<ul />");this.element.append(e);var i=$('<li class="button skip" />');if(e.append(i),this.options.activePage>1){var n=$("<a"+(null!=this.options.previousPage?' title="'+this.options.previousPage+'"':"")+"></a>");i.append(n),this._bindSwitchPage(n,this.options.activePage-1);var a=$('<span class="icon icon16 icon-double-angle-left" />');n.append(a)}else{var a=$('<span class="icon icon16 icon-double-angle-left" />');i.append(a),i.addClass("disabled").removeClass("button"),a.addClass("disabled")}e.append(this._renderLink(1));var s=this.SHOW_LINKS-4,o=this.options.activePage-2;0>o&&(o=0);var r=this.options.maxPage-(this.options.activePage+1);0>r&&(r=0),this.options.activePage>1&&this.options.activePage<this.options.maxPage&&s--;var l=s/2,c=this.options.activePage,h=this.options.activePage;1>c&&(c=1),1>h&&(h=1),h>this.options.maxPage-1&&(h=this.options.maxPage-1),o>=l?c-=l:(c-=o,h+=l-o),r>=l?h+=l:(h+=r,c-=l-r),h=Math.ceil(h),c=Math.ceil(c),1>c&&(c=1),h>this.options.maxPage&&(h=this.options.maxPage),c>1&&(2>c-1?e.append(this._renderLink(2)):($('<li class="button jumpTo"><a title="'+WCF.Language.get("wcf.global.page.jumpTo")+'" class="jsTooltip">...</a></li>').appendTo(e),t=!0));for(var d=c+1;h>d;d++)e.append(this._renderLink(d));h<this.options.maxPage&&(this.options.maxPage-h<2?e.append(this._renderLink(this.options.maxPage-1)):($('<li class="button jumpTo"><a title="'+WCF.Language.get("wcf.global.page.jumpTo")+'" class="jsTooltip">...</a></li>').appendTo(e),
+t=!0)),e.append(this._renderLink(this.options.maxPage));var u=$('<li class="button skip" />');if(e.append(u),this.options.activePage<this.options.maxPage){var p=$("<a"+(null!=this.options.nextPage?' title="'+this.options.nextPage+'"':"")+"></a>");u.append(p),this._bindSwitchPage(p,this.options.activePage+1);var _=$('<span class="icon icon16 icon-double-angle-right" />');p.append(_)}else{var _=$('<span class="icon icon16 icon-double-angle-right" />');u.append(_),u.addClass("disabled").removeClass("button"),_.addClass("disabled")}t&&(e.data("pages",this.options.maxPage),WCF.System.PageNavigation.init("#"+e.wcfIdentify(),$.proxy(function(t){this.switchPage(t)},this)))}else this.element.hide()},_renderLink:function(t,e){var i=$('<li class="button"></li>');if(void 0!=e&&e&&i.addClass("break"),t!=this.options.activePage){var n=$("<a>"+WCF.String.addThousandsSeparator(t)+"</a>");i.append(n),this._bindSwitchPage(n,t)}else{i.addClass("active");var a=$("<span>"+WCF.String.addThousandsSeparator(t)+"</span>");i.append(a)}return i},_bindSwitchPage:function(t,e){var i=this;t.click(function(){i.switchPage(e)})},switchPage:function(t){this._setOption("activePage",t)},_setOption:function(t,e){if("activePage"==t){if(e!=this.options[t]&&e>0&&e<=this.options.maxPage){var i=this._trigger("shouldSwitch",void 0,{nextPage:e});i||void 0!==i?(this.options[t]=e,this._render(),this._trigger("switched",void 0,{activePage:e})):this._trigger("notSwitched",void 0,{activePage:e})}}else this.options[t]=e,"disabled"==t?e?this.element.children().remove():this._render():"maxPage"==t&&this._render();return this},_startInput:function(t){var e=$(t.currentTarget);e.is("a")||(e=e.parent("a")),e.hide();var i=e.parent("li").children("input").css("display","block").val("");i.focus()},_stopInput:function(t){var e=$(t.currentTarget);e.css("display","none");var i=e.parent("li");void 0!=i&&null!=i&&i.children("a").show()},_handleInput:function(t){var e=$.browser.msie&&"7.0"==$.browser.version;("keyup"!=t.type||e)&&(e&&(13!=t.which&&27!=t.which||"keyup"!=t.type)||(13==t.which&&this.switchPage(parseInt($(t.currentTarget).val())),(13==t.which||27==t.which)&&(this._stopInput(t),t.stopPropagation())))}}),WCF.Category={},WCF.Category.NestedList=Class.extend({_categories:{},init:function(){var t=this;$(".jsCategory").each(function(e,i){var n=$(i).data("parentCategoryID",null).change($.proxy(t._updateSelection,t));t._categories[n.val()]=n;var a=[];n.parents("li").find(".jsChildCategory").each(function(e,i){var s=$(i).data("parentCategoryID",n.val()).change($.proxy(t._updateSelection,t));t._categories[s.val()]=s,a.push(s.val()),s.is(":checked")&&n.prop("checked","checked")}),n.data("childCategoryIDs",a)})},_updateSelection:function(t){var e=$(t.currentTarget),i=e.data("parentCategoryID");if(e.is(":checked"))null!==i&&this._categories[i].prop("checked","checked");else if(null===i)for(var n=e.data("childCategoryIDs"),a=0,s=n.length;s>a;a++)this._categories[n[a]].prop("checked",!1)}});
\ No newline at end of file