From 3ace8e6e7f18094510cfd784254f3abdbf6bdd57 Mon Sep 17 00:00:00 2001 From: Wayne Date: Fri, 24 Nov 2017 11:48:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=84=A6=E7=82=B9=E5=9B=BE=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=B8=8D=E8=83=BD=E6=9B=B4=E6=96=B0=20#103?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ZKEACMS.WebHost/Views/Media/Index.cshtml | 2 +- src/ZKEACMS.WebHost/wwwroot/js/admin.js | 2 ++ src/ZKEACMS.WebHost/wwwroot/js/admin.min.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ZKEACMS.WebHost/Views/Media/Index.cshtml b/src/ZKEACMS.WebHost/Views/Media/Index.cshtml index ddb568ea..74fa58fa 100644 --- a/src/ZKEACMS.WebHost/Views/Media/Index.cshtml +++ b/src/ZKEACMS.WebHost/Views/Media/Index.cshtml @@ -36,7 +36,7 @@ } -
+
@if (Model.Medias != null) { diff --git a/src/ZKEACMS.WebHost/wwwroot/js/admin.js b/src/ZKEACMS.WebHost/wwwroot/js/admin.js index a352f390..9100a395 100644 --- a/src/ZKEACMS.WebHost/wwwroot/js/admin.js +++ b/src/ZKEACMS.WebHost/wwwroot/js/admin.js @@ -57,11 +57,13 @@ $(function () { var target = obj.parent().siblings("input.form-control"); target.val(win.GetSelected()); box.close(); + target.trigger("change"); }); $(this.document).on("click", ".confirm", function () { var target = obj.parent().siblings("input.form-control"); target.val($(this).data("result")); box.close(); + target.trigger("change"); }); } }); diff --git a/src/ZKEACMS.WebHost/wwwroot/js/admin.min.js b/src/ZKEACMS.WebHost/wwwroot/js/admin.min.js index 3e1db65d..9f3ca6ab 100644 --- a/src/ZKEACMS.WebHost/wwwroot/js/admin.min.js +++ b/src/ZKEACMS.WebHost/wwwroot/js/admin.min.js @@ -3,4 +3,4 @@ * Copyright 2017 ZKEASOFT * http://www.zkea.net/licenses */ -$(function(){$(".accordion-group>a").click(function(){return $(this).nextAll(".accordion-inner").hasClass("active")?!1:($(this).parents("ul").find(".accordion-inner.active").removeClass("active").hide(200),$(this).nextAll(".accordion-inner").addClass("active").show(200),!1)});$(document).on("click",".cancel",function(){window.history.back()}).on("click",".publish",function(){return confirm("确认要发布吗?")?!0:!1}).on("click","input[type=submit]",function(){return $("#ActionType").val($(this).data("value")),!0}).on("click",".input-group-collection .add",function(){var i=$(this).siblings(".items").children(".item").size(),t=$(this).data("name-prefex"),n=$($(this).siblings(".Template").html());$("input,select,area",n).attr("data-val",!0).each(function(){var n=$(this).attr("name");n&&$(this).attr("name",n.replace(t,t+"["+i+"]"))});n.find(".ActionType").val($(this).data("value"));$(this).siblings(".items").append(n)}).on("click",".input-group-collection .delete",function(){$(this).parent().hide();$(this).siblings(".hide").find(".ActionType").val($(this).data("value"))}).on("change",".input-group-collection .form-control",function(){var n=$(".ActionType",$(this).closest(".item"));n.val()!=="Create"&&n.val("Update")}).on("click",".input-group .glyphicon.glyphicon-search",function(){var n=$(this);window.top.Easy.ShowUrlWindow({url:n.parent().siblings("input.form-control").data("url"),width:n.parent().siblings("input.form-control").data("width")||800,onLoad:function(t){var i=this;$(this.document).find("#confirm").click(function(){var r=n.parent().siblings("input.form-control");r.val(i.GetSelected());t.close()});$(this.document).on("click",".confirm",function(){var i=n.parent().siblings("input.form-control");i.val($(this).data("result"));t.close()})}})}).on("click",".form-group select#ZoneID",function(){var n=$(this),t="/admin/Layout/SelectZone?layoutId="+$(".hide #LayoutID").val()+"&pageId="+$(".hide #PageID").val()+"&zoneId="+n.val();window.top.Easy.ShowUrlWindow({url:t,width:1e3,title:"选择区域",onLoad:function(t){var i=this;$(this.document).find("#confirm").click(function(){n.val(i.GetSelected());t.close()})}})}).on("click",".custom-style-editor",function(){window.top.Easy.ShowUrlWindow({url:"/js/StyleEditor/index.html",width:1024,title:"编辑样式",onLoad:function(n){n.addClass("loaded")},isDialog:!1});$(".WeiWindow.BoxShadow").addClass("StyleEditor")}).on("click",".form-group select.select",function(){var n=$(this);window.top.Easy.ShowUrlWindow({url:n.data("url")+"?selected="+n.val(),width:n.data("width")||800,onLoad:function(t){var i=this;$(this.document).find("#confirm").click(function(){n.val(i.GetSelected());t.close();n.trigger("change")});$(this.document).on("click",".confirm",function(){n.val($(this).data("result"));t.close();n.trigger("change")})}})}).on("submit","form",function(){Easy.Block()});$(".form-group select#ZoneID,.form-group select.select").on("mousedown",!1);var i=$("#main-menu"),n,t=0;$("a.menu-item",i).each(function(){var i=$(this).attr("href");i&&location.pathname.toLocaleLowerCase().indexOf(i.toLowerCase())===0&&i.length>t&&(n=$(this),t=i.length)});n&&n.size()&&(n.addClass("active"),n.parent().hasClass("accordion-inner")&&(n.parent().show(),n.parent().prev().addClass("active")));$.fn.datepicker&&$(".Date").each(function(){$(this).prop("readonly")||$(this).prop("disabled")||$(this).datepicker({language:"zh-CN",format:$(this).attr("JsDateFormat")})});$(document).on("click",".nav.nav-tabs a",function(){return $(this).tab("show"),!1});$(".nav.nav-tabs").each(function(){var n=!1;$("li",this).each(function(){$(this).hasClass("active")&&($(this).removeClass("active"),$("a",this).tab("show"),n=!0)});n||($("li:first a",this).tab("show"),location.hash&&$("li a[href='"+location.hash+"']",this).tab("show"))});$("#StyleClass.form-control").popover({trigger:"focus",html:!0,title:"自定义样式用法",content:function(){for(var t=[{name:"边框",value:"border"},{name:"文字居中",value:"align-center"},{name:"文字右对齐",value:"align-right"},{name:"图片边框",value:"image-border"},{name:"阴影",value:"box-shadow"},{name:"图片圆形",value:"image-circle"},{name:"取消外边距",value:"full"},{name:"居中容器",value:"container"}],i="

直接写样式例:style=\"color:#fff\"<\/code><\/p>

预定义样式:

    ",n=0;n"+t[n].name+":"+t[n].value+"<\/code><\/li>";return i+"<\/ol><\/p>"},placement:"bottom"});$("input.select-image").popover({trigger:"focus",html:!0,title:"图片预览",content:function(){var n=$(this).val();return n?(n.indexOf("~")===0&&(n=n.replace("~",location.origin)),"
    <\/div>"):null},placement:"bottom"}).parent().addClass("loading");document.addEventListener&&document.addEventListener("paste",function(n){var t,i,r,e,u,f;if(n.target.className&&n.target.className.indexOf("select-image")>=0&&(t=n.target,n.clipboardData?i=n.clipboardData:window.clipboardData&&(i=window.clipboardData),i&&i.items))for(r=0;r1048e3)continue;t.parentNode.className=t.parentNode.className+" processing";t.value="图片上传中...";u=new XMLHttpRequest;u.open("POST","/admin/media/Upload");u.onload=function(n){t.parentNode.className=t.parentNode.className.replace(" processing","");var i=JSON.parse(n.target.response);i.id&&(t.value="~"+i.url,$(t).blur().focus())};u.onerror=function(){t.parentNode.className=t.parentNode.className.replace(" processing","");t.value="图片上传失败"};f=new FormData;f.append("file",e);f.append("folder","图片");f.append("size",e.size);u.send(f);break}});$(".input-group .glyphicon.glyphicon-play").popover({trigger:"click",html:!0,title:"视频预览",content:function(){var n=$(this).parent().siblings("input").val();return n?(n.indexOf("~")===0&&(n=n.replace("~",location.origin)),"