1
0
mirror of https://gitee.com/coder-xiaomo/flashsale synced 2025-09-12 23:11:38 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

添加Metronic(作为LFS)

This commit is contained in:
2022-03-01 21:24:58 +08:00
parent 080ca33954
commit 465c454101
3280 changed files with 561969 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
var ComponentsEditors = function () {
var handleWysihtml5 = function () {
if (!jQuery().wysihtml5) {
return;
}
if ($('.wysihtml5').size() > 0) {
$('.wysihtml5').wysihtml5({
"stylesheets": ["../../assets/global/plugins/bootstrap-wysihtml5/wysiwyg-color.css"]
});
}
}
var handleSummernote = function () {
$('#summernote_1').summernote({
height: 600,
onImageUpload: function (files,editor, $editable) { //the onImageUpload API
//img = sendFile(files[0]);
// console.log(files);
// img = files;
data = new FormData();
data.append("image", files[0]);
//增加额外的参数
// data.append("folder", '商品信息');
// data.append("guid", $("#ID").val());
$.ajax({
data: data,
type: "POST",
url: "/pic/files/upload",
cache: false,
contentType: false,
processData: false,
success: function (json) {
var url = json.data.originFileUrl;
editor.insertImage($editable, url); // the insertImage API
},
fail:function(e){
alert(e);
}
});
}
});
//API:
//var sHTML = $('#summernote_1').code(); // get code
//$('#summernote_1').destroy(); // destroy
}
return {
//main function to initiate the module
init: function () {
handleWysihtml5();
handleSummernote();
}
};
}();