function toparticle(){$("#articlecategory").load("getTopFolder",{type:"select"},function(e,t){if(t==="success"){$("#articlecategory").selectpicker("refresh")}});var e=document.getElementById("newarticle");var t=e.getAttribute("aria-expanded");if(t==="false"){window.location.hash="#myarticleadd"}else{window.location.hash="#"}}var E=window.wangEditor;var articleeditor=new E("#myarticlecontent");articleeditor.config.menus=["head","bold","fontSize","fontName","italic","underline","foreColor","backColor","list","justify","quote","image","undo"];function uploadArticledoc(){if($("#myarticleid").html()==="0"||$("#myarticleid").html()===""){submitnewarticle(false,false)}var e=$("#myarticleid").html();if(e==="0"||e===""){return}var t=$("#articlecategory option:selected").val();var i="addFile?cmd=upload&pid="+t+"&oid="+e+"&type=3&cid=docatt";$("#upoafile").fileinput("refresh",{uploadUrl:i});guploadtype="articledoc";gtid=e;$("#myModalUploadFile").modal("show")}function doMyArticle(e){$(document).attr("title","文件 - DMS Clouds");$("#mainblock").load("getArticle",{fid:e})}function getArticleDoc(e){$("#myarticledoc").load("getArticleDoc",{oid:e})}var check={myarticletitle:false};$("#myarticletitle").change(function(){success("myarticletitle");if($(this).val().length<2){fail("myarticletitle","标题太短，不能少于2个字符")}});$("#myarticlesubmit").click(function(e){submitnewarticle(true,true)});function submitnewarticle(e,i){title=$("#myarticletitle").val();content=articleeditor.txt.html();if(title===""||title===null){BootstrapDialog.show({draggable:true,title:"提示",message:"标题不能为空！！！"});return}fid=$("#myarticleid").html();var t=$("#articlecategory option:selected").val();if(t===""){BootstrapDialog.show({draggable:true,title:"提示",message:"请选择归属类别！！！"});return}$.ajaxSettings.async=false;$.post("addArticle",{fid:fid,title:title,content:content,pid:t,type:""},function(e){var t=JSON.parse(e);if(t["msg"]!=="ok"){BootstrapDialog.show({draggable:true,title:"提示",message:t["msg"]})}else{$("#myarticleid").html(t["fid"]);if(i){document.getElementById("myarticleadd").click();refreshArticle();articleReset()}}});$.ajaxSettings.async=true}$("#myarticlereset").click(function(){articleReset()});function articleReset(){$("#myarticleid").html("0");$("#newarticle input").val("");articleeditor.txt.html("");$("#newarticle input").slice(0,7).parent().parent().removeClass("has-error has-success");$("#newarticle .tips").hide();$("#newarticle .glyphicon-ok").hide();$("#newarticle .glyphicon-remove").hide();$("#myarticledoc").html("");check={myarticletitle:false}}function refreshArticle(){$("#myarticletable").bootstrapTable("refresh")}function initArticle(){articleeditor.create();$("#myarticletable").bootstrapTable({pagination:true,showRefresh:false,search:true,clickToSelect:false,striped:true,locale:"zh-CN",queryParams:function(e){var t={searchkey:""};return t},url:"queryArticles",contentType:"application/x-www-form-urlencoded;charset=UTF-8",method:"post",columns:[{field:"fid",title:"Fid",hidden:true},{field:"num",title:"序号",align:"center",width:20,formatter:function(e,t,i){return i+1}},{field:"title",title:"标题",align:"center",formatter:function(e,t,i){return'<a href="article.html?id='+t.fid+"&title="+encodeURI(encodeURI(e))+"\" title='"+t.fid+"' target='_blank'>"+e+"</a>"}},{field:"category",title:"类别",align:"center",width:80},{field:"date",title:"日期",width:120,align:"center"}]});$("#myarticletable").bootstrapTable("hideColumn","fid")}