").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cc=a.document.documentElement;function dc(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cc;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cc})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=La(k.pixelPosition,function(a,c){return c?(c=Ja(a,b),Ha.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ec=a.jQuery,fc=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fc),b&&a.jQuery===m&&(a.jQuery=ec),m},typeof b===K&&(a.jQuery=a.$=m),m});
;
/**
* 结束加载Jquery
*/
;(function($){
$.phpokurl = {
base:function(ctrl,func,ext,file)
{
var url = webroot + "" +file;
var is_wen = true;
if(ctrl && ctrl != 'index'){
url += "?"+ctrl_id+"="+ctrl;
is_wen = false;
}
if(func && func != 'index'){
if(is_wen){
url += "?";
is_wen = false;
}else{
url += "&";
}
url += func_id+"="+func;
}
if(ext){
url += is_wen ? ("?"+ext) : ("&"+ext);
}
if(phpok_site_id && site_id && phpok_site_id != site_id){
url += is_wen ? ("?siteId="+phpok_site_id) : ("&siteId="+phpok_site_id);
}
return url;
},
plugin:function(id,efunc,ext,file)
{
var url = webroot+""+file+"?"+ctrl_id+"=plugin&"+func_id+"=exec";
if(id){
url += "&_phpokid="+id;
}
if(efunc){
url += "&exec="+efunc;
}
if(ext){
url += "&"+ext;
}
if(phpok_site_id && site_id && phpok_site_id != site_id){
url += "&siteId="+phpok_site_id;
}
return url;
}
}
})(jQuery);
function get_url(ctrl,func,ext)
{
return $.phpokurl.base(ctrl,func,ext,basefile);
}
function get_plugin_url(id,efunc,ext)
{
return $.phpokurl.plugin(id,efunc,ext,basefile);
}
function admin_url(ctrl,func,ext)
{
return $.phpokurl.base(ctrl,func,ext,adminfile);
}
function admin_plugin_url(id,efunc,ext)
{
return $.phpokurl.plugin(id,efunc,ext,adminfile);
}
function www_url(ctrl,func,ext)
{
return $.phpokurl.base(ctrl,func,ext,wwwfile);
}
function www_plugin_url(id,efunc,ext)
{
return $.phpokurl.plugin(id,efunc,ext,wwwfile);
}
function api_url(ctrl,func,ext)
{
return $.phpokurl.base(ctrl,func,ext,apifile);
}
function api_plugin_url(id,efunc,ext)
{
return $.phpokurl.plugin(id,efunc,ext,apifile);
}
/**
* 自定义表单中涉及到的JS操作
*
* @版本 4.x
* @授权 /lgpl.html 授权协议:GNU Lesser General Public License
* @时间 2017年03月22日
**/
function phpok_form_password(id,len)
{
var list = new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");
if(!len || len == "undefined") len = 8;
var rand = "";
for(var i = 0;i
',
"lock":true
});
}
}
}
//清空
function phpok_btn_clear(btn,id)
{
$("#"+id).val("");
}
function _phpok_form_opt(val,id,eid,etype)
{
if(!val || val == "undefined"){
$("#"+id).html("").hide();
return false;
}
var url = get_url("form","config") + "&id="+$.str.encode(val);
if(eid && eid != "undefined"){
url += "&eid="+eid;
}
if(etype && etype != "undefined"){
url += "&etype="+etype;
}
$.phpok.ajax(url,function(rs){
if(rs && rs != 'exit'){
$("#"+id).html(rs).show();
layui.form.render();
}
});
}
function phpok_btn_editor_picture(id)
{
var url = get_url("edit","picture") + "&input="+id;
$.dialog.open(url,{
"title" : "图片库",
"width" : "760px",
"height" : "80%",
"resize" : false,
"lock" : true
});
}
function phpok_btn_editor_file(id)
{
var url = get_url("edit","file") + "&input="+id+"&nopic=1";
$.dialog.open(url,{
"title" : "附件资源",
"width" : "760px",
"height" : "80%",
"resize" : false,
"lock" : true
});
}
function phpok_btn_editor_video(id)
{
var url = get_url("edit","video") + "&input="+id+"&nopic=1";
$.dialog.open(url,{
"title" : "添加影音",
"width" : "760px",
"height" : "80%",
"resize" : false,
"lock" : true
});
}
function phpok_btn_filename(input,type)
{
var url = get_url("fields","filemanage") + "&input="+input;
if(type && type != 'undefined'){
url += "&type="+type;
}
var old = $("#"+input).val();
if(old){
var tmp = old.split('/');
tmp = tmp.slice(0,-1);
var folder = tmp.join('/');
url += "&folder="+$.str.encode(folder+'/');
}
$.dialog.open(url,{
"title" : "选择文件",
"width" : "760px",
"height" : "80%",
"resize" : false,
"lock" : true
});
}
//删除单个主题关联
function phpok_title_delete_single(id)
{
$("#"+id).val("");
$("#title_"+id).hide();
$("#layui-btn-"+id+"-delete").hide();
}
//删除多个主题关联
function phpok_title_delete(id,val)
{
if(val && val != "undefined")
{
//移除DIV值
$("#"+id+"_div_"+val).remove();
//移除值
var c = $("#"+id).val();
if(c == "" || c == "undefined")
{
$("#"+id+"_div").hide();
$("#"+id+"_button_checkbox").hide();
$("#"+id).val("");
return true;
}
var clist = c.split(",");
var n_list = new Array();
var m = 0;
for(var i=0;i
"+val+"");
obj.find("option[value="+data.info+"]").attr("selected",true);
}else{
$.dialog.alert(data.info);
return false;
}
});
},'');
},
//图片预览
upload_preview:function(id)
{
$.dialog.open(get_url('upload','preview','id='+id),{
'title':p_lang('预览附件信息'),
'width':'700px',
'height':'400px',
'lock':true,
'button': [{
'name': p_lang('下载原文件'),
'callback': function () {
$.phpok.open(get_url('res','download','id='+id));
return false;
}
}],
'okVal':p_lang('关闭'),
'ok':true
});
},
upload_update:function(id)
{
$.dialog.open(get_url('upload','editopen','id='+id),{
'title':p_lang('编辑附件信息'),
'width':'700px',
'height':'400px',
'lock':true,
'okVal':p_lang('提交'),
'ok':function(){
var iframe = this.iframe.contentWindow;
if (!iframe.document.body) {
alert(p_lang('iframe还没加载完毕呢'));
return false;
};
iframe.save();
return false;
},
'cancelVal':p_lang('取消修改'),
'cancel':function(){}
});
},
upload_delete:function(identifier,id)
{
var fid = identifier;
if(fid.substr(0,1) != '#' && fid.substr(0,1) != '.'){
fid = '#'+fid;
}
var content = $(fid).val();
if(!content || content == "undefined"){
$(fid+"_sort").hide();
return true;
}
//删除单个附件
if(content == id){
$(fid).val("");
$(fid+"_list").fadeOut().html('');
$(fid+"_sort").hide();
this.upload_remote_delete(identifier,id);
return true;
}
var list = content.split(",");
var newlist = new Array();
var new_i = 0;
for(var i=0;i';
if(multiple){
html += '';
}
html += '';
html += ' ';
html += '';
return html;
},
upload_remote_delete:function(identifier,id)
{
var tmp = $.phpok.data('upload-'+identifier)
if(!tmp || tmp == 'undefined'){
return true;
}
var delete_status = false;
if(tmp != id){
var list = tmp.split(',');
var newlist = new Array();
var new_i = 0;
for(var i=0;i