metremark/web/templates/met/js/own.js

92 lines
3.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*!
* M['weburl'] 网站网址
* M['lang'] 网站语言
* M['tem'] 模板目录路径
* M['user_name'] 页面登录用户名
* met_prevarrow,
met_nextarrow slick插件翻页按钮自定义html
* M['device_type'] 客户端判断dPC端t平板端m手机端
* M['n'] 当前模块名称
* M['c'] 当前类
* M['a'] 当前方法
* M['langtxt'] 当前语言文字
* M['langset'] 当前后台语言
* M['anyid'] 当前模块id
* M['met_editor'] 当前系统编辑器名称
* M['met_keywords'] 页面关键词
* M['url']['admin'] 后台文件夹路径
* M['url']['static']
* M['url']['static_vendor']
* M['url']['static2']
* M['url']['static2_vendor']
* M['url']['static2_plugin']
* M['url']['uiv2'] 模板框架v2路径
* M['url']['uiv2_css']
* M['url']['uiv2_js']
* M['url']['app'] 应用文件夹路径
* M['url']['pub'] 后台模块公用文件夹路径
* M['url']['epl'] 后台模块公用示例文件夹路径
* M['url']['ui'] 应用前后台公用UI文件app/system/include/piblic/ui/里面
* M['url']['own_form'] 当前页面程序地址
* M['url']['own_name'] 当前模块地址
* M['url']['own'] 当前模块后台路径
* M['url']['own_tem'] 当前页面模板路径
* M['url']['api'] app站点地址
* M['url']['editor'] 当前编辑器应用文件夹路径
*/
$(function () {
var appfun = function () {
var self = this;
if(self.isEmpty(M['n'])) M['n'] = $('div[data-m_name]').data('m_name');
self.own_name = $('div[data-own_name]').data('own_name');
self.config();
};
appfun.prototype = {
config:function(){
var self = this;
$.ajax({
type: "GET",
url: self.own_name + 'c=index&a=doajaxcl&lang=' + M['lang'],
dataType: "jsonp",
async: false
}).done(function (data) {
CL = data;
});
},
isEmpty: function (val) {
switch (typeof val) {
case 'undefined':
return true;
case 'string':
if (val.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0)
return true;
break;
case 'boolean':
if (!val)
return true;
break;
case 'number':
if (0 === val || isNaN(val))
return true;
break;
case 'object':
if (null === val || val.length === 0)
return true;
for (var i in val) {
return false;
}
return true;
}
return false;
}
};
APPFUN = new appfun();
//缓存
$.ajaxSetup({cache: false});
});