1 WCF
.Tagging
={};WCF
.Tagging
.TagList
=WCF
.EditableItemList
.extend({_className
:"wcf\\data\\tag\\TagAction",_maxLength
:0,init:function(c
,a
,b
){this._allowCustomInput
=true;this._maxLength
=b
;this._super(c
,a
);this._data
=[];this._search
=new WCF
.Tagging
.TagSearch(this._searchInput
,$.proxy(this.addItem
,this));this._itemList
.addClass("tagList");$(c
).data("__api",this)},_keyDown:function(b
){if(this._super(b
)){if(b
===null){return true}var a
=b
.which
;if(a
===8||a
===27||a
===13||a
===46){return true}else{if(a
>36&&a
<41){return true}}if(this._searchInput
.val().length
>=this._maxLength
){return false}return true}return false},_submit:function(){this._super();for(var b
=0,a
=this._data
.length
;b
<a
;b
++){if(this._data
[b
]){$('<input type="hidden" name="tags[]" />').val(this._data
[b
]).appendTo(this._form
)}}},addItem:function(b
){if(!b
.objectID
&&b
.label
.length
>this._maxLength
){b
.label
=b
.label
.substr(0,this._maxLength
)}var a
=this._super(b
);$(this._itemList
).find(".badge:not(tag)").addClass("tag");return a
},_addItem:function(b
,a
){this._data
.push(a
)},clearList:function(){this._super();this._data
=[]},getTags:function(){return this._data
},_removeItem:function(d
,a
){for(var c
=0,b
=this._data
.length
;c
<b
;c
++){if(this._data
[c
]===a
){this._data
.splice(c
,1);return}}},load:function(a
){if(a
&&a
.length
){for(var c
=0,b
=a
.length
;c
<b
;c
++){this.addItem({objectID
:0,label
:WCF
.String
.unescapeHTML(a
[c
])})}}}});WCF
.Tagging
.TagSearch
=WCF
.Search
.Base
.extend({_className
:"wcf\\data\\tag\\TagAction",init:function(b
,d
,a
,c
){this._super(b
,d
,a
,c
,false)}});