var $=require("jquery"),Base=require("basePC"),Dialog=require("./../lib/js/dialogPC.js"),UIkit=require("./../uikit/uikit.js"),Util=require("./../lib/js/util.js"),CommonSelectDialog=require("./../lib/js/commonSelectDialog.js"),LinkSelectDialog=require("./../lib/js/linkSelectDialog.js"),Convenient=require("./../lib/js/convenient.js"),JqueryTimeago=require("./../lib/js/jqueryTimeago.js"),Share=require("./../share.js/share.js"),Lazyload=require("./../lib/js/jqueryLazyload.js"),RadioWidget=require("./../lib/js/radioWidget.js"),TabWidget=require("./../lib/js/tabWidget.js"),ImageWidget=require("./../lib/js/imageWidget.js"),ImageTemplateWidget=require("./../lib/js/imageTemplateWidget.js"),Qrcode=require("./../lib/js/qrcode.js"),Clipboard=require("./../clipboard/clipboard.js"),Editor=require("./../lib/js/editor.js"),ColorPicker=require("./../color-picker/color-picker.js"),ColorPickerCSS=require("./../color-picker/color-picker.css"),EXField=require("./../ex-field/ex-field.js"),EXFieldCSS=require("./../ex-field/ex-field.less"),CommonVerify=require("./../lib/js/commonVerify.js");$.timeago.settings.allowFuture=!0,$(function(){$("[datetime]").timeago(),$("[data-src]").lazyload({data_attribute:"src"}),$("[data-colorpicker]").colpick({submit:0,onChange:function(i,e,a,o,l){$(o).css("border-color","#"+e),$(o).val("#"+e)}}),Share.init(),RadioWidget.init(),TabWidget.init(),ImageWidget.init(),ImageTemplateWidget.init(),Qrcode.init(Dialog),new Clipboard("[data-clipboard-text]").on("success",function(i){Dialog.tipSuccess("复制成功")})});var apiInit=function(){window.api={},window.api.dialog=Dialog,window.api.base=Base,window.api.util=Util,window.api.editor=Editor,window.api.exField=EXField,window.api.commonVerify=CommonVerify,window.api.commonSelectDialog=function(i){return new CommonSelectDialog(i,Dialog)}},callbackInit=function(){window.callback={},window.callback.imageWidgetSelectImage=function(i){new CommonSelectDialog({limitMin:1,limitMax:1,server:"/data/image_select_dialog",callback:function(e){i(e)}},Dialog).show()},window.callback.imageTemplateWidgetSelectImage=function(i){new CommonSelectDialog({limitMin:1,limitMax:1,server:"/data/image_select_dialog",callback:function(e){i(e)}},Dialog).show()},window.callback.editorUploadImage=function(i){new CommonSelectDialog($.extend({server:"/data/image_select_dialog"},{callback:function(e){i(e)}}),Dialog).show()}},commonInit=function(){$(document).on("click","[data-user-info]",function(){var i=$(this).attr("data-user-info");Dialog.dialog("/module/user_info/"+i)}),$(document).on("click","[data-link-selector]",function(){var i=$('[data-link-selector-value="'+$(this).attr("data-link-selector")+'"]');new LinkSelectDialog({limitMin:1,limitMax:1,server:"/module/link_dialog",callback:function(e){var a=e[0];i.val(a)}},Dialog).show()}),$(document).on("click","[data-audio-selector]",function(){var i=$('[data-audio-selector-value="'+$(this).attr("data-audio-selector")+'"]');new CommonSelectDialog($.extend({server:"/data/audio_select_dialog"},{callback:function(e){var a=e[0];i.val(a),i.trigger("audio-selector-value.change",[a])}}),Dialog).show()})};module.exports={init:function(){Base.init(),Convenient.init(Dialog),apiInit(),callbackInit(),commonInit()},Base:Base,Dialog:Dialog,Util:Util};