이것이 내가 사용을 끝낸 이유입니다 ... 많은 것은 hallo와 함께 제공된 "Link"위젯에서 복사되었습니다. 그것은 매우 혼란스럽고, 나는 더 나은 모습으로 보이기 위해 시간을 할애했으면 좋겠지 만 효과가 있으며 나는 서둘렀다. 동일한 사용자 정의가 필요한 다른 사용자에게 유용 할 수 있기를 바랍니다. 반환 값을 원하는 함수로 변경하십시오.
(function(jQuery) {
return jQuery.widget("IKS.hallocustomimage", {
options: {
editable: null,
uuid: "",
link: true,
image: true,
dialogOpts: {
autoOpen: false,
width: 540,
height: 95,
modal: true,
resizable: false,
draggable: false,
dialogClass: 'hallolink-dialog'
},
buttonCssClass: null
},
populateToolbar: function(toolbar) {
var buttonize, buttonset, dialog, dialogSubmitCb, isEmptyLink, urlInput, widget,
_this = this;
widget = this;
dialog = jQuery("<div id=\"" + "\"><form action=\"#\" method=\"post\" class=\"linkForm\"><input class=\"url\" type=\"text\" name=\"url\"value=\"" + "\" /><input type=\"submit\" id=\"addlinkButton\" value=\"" + "\"/></form></div>");
buttonset = jQuery("<span class=\"" + widget.widgetName + "\"></span>");
buttonize = function(type) {
var button, buttonHolder, id;
id = "" + _this.options.uuid + "-" + type;
buttonHolder = jQuery('<span></span>');
buttonHolder.hallobutton({
label: 'Image',
icon: 'icon-picture',
editable: _this.options.editable,
command: null,
queryState: false,
uuid: _this.options.uuid,
cssClass: _this.options.buttonCssClass
});
buttonset.append(buttonHolder);
button = buttonHolder;
button.on("click", function(event) {
var button_selector, selectionParent;
widget.options.editable.keepActivated(true);
return jQuery(function(){$('#gallery').modal();});
});
};
if (this.options.link) {
buttonize("A");
}
if (this.options.link) {
toolbar.append(buttonset);
buttonset.hallobuttonset();
return dialog.dialog(this.options.dialogOpts);
}
}
});})(jQuery);