KindEditor.ready(function(K) {var editor = K.editor({uploadJson : "{:U('Home/File/upload')}"});
    K("#gallery_button").click(function() {
        editor.loadPlugin("multiimage", function() {
            editor.plugin.multiImageDialog({
                clickFn : function(urlList) {
                    var div = K("#gallery_View");
                    d = new Date(); t = d.getTime();
                    K.each(urlList, function(i, data) {
                        div.append("<li><a href='" + data.url + "' rel=\"prettyPhoto[]\"><img src='" + data.url + "'></a><input type='hidden' name='goods_img["+t+"n"+i+"]' value='"+data.url+"'><div class=\"pr\"><input type='text' class='form-control' name='img_desc["+t+"n"+i+"]'><p class=\"tooltip fade top points_input\"><span class=\"tooltip-arrow\"></span><span class=\"tooltip-inner\">{$Think.lang.TAGTIP_PICDESC}</span></p></div><div class=\"clearfix\"><div class=\"pr f_l\"><span class=\"pai_text f_l\">{:L('SORT')}：</span><input type=\"text\" class=\"form-control w80 f_l\" name='img_sort["+t+"n"+i+"]' /><p class=\"tooltip fade top points_input\"><span class=\"tooltip-arrow\"></span><span class=\"tooltip-inner\">{$Think.lang.TAGTIP_PICSORTDESC}</span></p><button type=\"button\" class=\"btn btn-danger btn-xs\" onclick=\"removethis(removethis(this,3))\"><span class=\"glyphicon glyphicon-trash\"></span></button></div></div></li>");
                    });$("a[rel^='prettyPhoto']").prettyPhoto();
                    editor.hideDialog();
                }
            });
        });
    });
});