5
This commit is contained in:
@@ -6,10 +6,13 @@ define(['form'], function (Form) {
|
||||
$(this).parent().addClass('active');
|
||||
$('.tab-pane').hide('active');
|
||||
$($(this).attr('href')).show('active');
|
||||
return false;
|
||||
})
|
||||
//return false;
|
||||
});
|
||||
if(location.hash){
|
||||
$('.nav-tabs li a[href='+location.hash+']').trigger('click');
|
||||
}
|
||||
var form = $('#settingsform');
|
||||
Config['upload_url'] = 'attach/upload';
|
||||
//Config['upload_url'] = 'files/upload';
|
||||
Form.api.bindevent(form,function(res){
|
||||
if (res.code) {
|
||||
return lightyear.notify(res.msg, 'danger', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
requirejs.config({
|
||||
//urlArgs: "v=" + (new Date()).getTime(),
|
||||
urlArgs: "v=" + (location.host == 'q.sjqqzc.top' ? (new Date()).getTime() : require.s.contexts._.config.config.version),
|
||||
baseUrl: require.s.contexts._.config.config.cdnurl+require.s.contexts._.config.'js/',
|
||||
urlArgs: "v=" + (location.host != window.Config.domain ? (new Date()).getTime() : window.Config.version),
|
||||
baseUrl: window.Config.cdnurl+window.Config.admin_path+'/js/',
|
||||
packages: [{
|
||||
name: 'moment',
|
||||
location: '../libs/moment',
|
||||
@@ -12,7 +12,7 @@ requirejs.config({
|
||||
'fast': '../libs/fast',
|
||||
'upload': '../libs/require-upload',
|
||||
'form': '../libs/require-form',
|
||||
'dropzone': '../libs/dropzone.min',
|
||||
'dropzone': '../libs/dropzone/dropzone.min',
|
||||
'table': '../libs/require-table',
|
||||
'jquery': '../libs/jquery.min',
|
||||
'bootstrap': '../libs/bootstrap.min',
|
||||
@@ -48,7 +48,7 @@ requirejs.config({
|
||||
},
|
||||
map: {
|
||||
'*': {
|
||||
'css': require.s.contexts._.config.'libs/require-css.min.js' // or whatever the path to require-css is
|
||||
'css': '../libs/require-css.min.js' // or whatever the path to require-css is
|
||||
}
|
||||
},
|
||||
shim: {
|
||||
@@ -58,7 +58,7 @@ requirejs.config({
|
||||
'tagsinput': {
|
||||
deps: [
|
||||
'jquery',
|
||||
'css!'+require.s.contexts._.config.'libs/jquery-tags-input/jquery.tagsinput.min.css'
|
||||
'css!'+window.Config.admin_path+'/libs/jquery-tags-input/jquery.tagsinput.min.css'
|
||||
]
|
||||
},
|
||||
'yntree': {
|
||||
@@ -68,7 +68,7 @@ requirejs.config({
|
||||
},
|
||||
'bootstrap-select': {
|
||||
deps: [
|
||||
'css!'+require.s.contexts._.config.'libs/bootstrap-select/dist/css/bootstrap-select.min.css'
|
||||
'css!'+window.Config.admin_path+'/libs/bootstrap-select/dist/css/bootstrap-select.min.css'
|
||||
]
|
||||
},
|
||||
'bootstrap-select-lang': ['bootstrap-select'],
|
||||
@@ -131,7 +131,7 @@ requirejs.config({
|
||||
'bootstrap-datetimepicker':{
|
||||
deps: [
|
||||
'jquery',
|
||||
'css!'+require.s.contexts._.config.'libs/bootstrap-datetimepicker/style.css'
|
||||
'css!'+window.Config.admin_path+'/libs/bootstrap-datetimepicker/style.css'
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
define(['table', 'upload','form'], function (Table,Upload,Form) {
|
||||
var User = {
|
||||
imgpreview:function(e,v,d,index){
|
||||
var that = $(e.currentTarget);
|
||||
var srcs = [];
|
||||
var index = $(that).parents('table').find('.img-center').index($(that))
|
||||
$(that).parents('table').find('.img-center').each(function(v,k){
|
||||
var src = $(that).attr('data-url') || $(that).attr('src');
|
||||
srcs.push({
|
||||
"src": src,
|
||||
"alt": $(that).attr('alt') || $(that).attr('title') || src,
|
||||
"pid":k,
|
||||
"thumb": $(that).attr('data-url') || $(that).attr('src')
|
||||
});
|
||||
});
|
||||
(parent ? parent.layer : layer).photos({
|
||||
zIndex:19891033,
|
||||
photos: { // 图片层的数据源
|
||||
"title": "", // 相册标题
|
||||
"id": 123, // 相册 id
|
||||
"start": index, // 初始显示的图片序号,默认 0
|
||||
"data": srcs
|
||||
}
|
||||
});
|
||||
return false;
|
||||
},
|
||||
//Do setup work hereAction
|
||||
index: function () {
|
||||
|
||||
@@ -31,19 +55,34 @@ define(['table', 'upload','form'], function (Table,Upload,Form) {
|
||||
title: 'ID',
|
||||
sortable: true // 是否排序
|
||||
},
|
||||
{
|
||||
title: "adapter",
|
||||
field: "adapter",
|
||||
filter: "string",
|
||||
},
|
||||
{
|
||||
title: "名字",
|
||||
field: "title",
|
||||
field: "origin_name",
|
||||
filter: "string",
|
||||
},
|
||||
{
|
||||
title: "文件",
|
||||
field: "path",
|
||||
formatter: function (v,d) {
|
||||
field: "file_name",
|
||||
formatter: function (v,d,index) {
|
||||
if (["jpg", "jpeg", "png", "gif", "bmp", "webp", "svg"].indexOf(d.extension.toLowerCase()) !== -1) {
|
||||
return '<img src="' + Fast.api.cdnurl(v) + '" style="max-width:32px;max-height:32px;" />';
|
||||
var value = d['file_url'] == null || d['file_url'].length === 0 ? '' : d['file_url'].toString();
|
||||
value = value ? value : '/assets/img/blank.gif';
|
||||
var classname = 'img-sm img-center previewitem';
|
||||
var url = Fast.api.cdnurl(value, true);
|
||||
url = url.match(/^(\/|data:image\\)/) ? url : url + Config.upload_thumbstyle;
|
||||
return '<a href="javascript:"><img class="' + classname + '" src="' + url + '" alt="'+d['origin_name']+'" /></a>';
|
||||
}
|
||||
return '<a href="' + d['file_url'] + '" target="_blank" title="'+d['origin_name']+'">' + v + '</a>';
|
||||
},
|
||||
events:{
|
||||
'click .img-center': function(e,v,d,index){
|
||||
User.imgpreview.call(this,e,d['file_url'],d,index);
|
||||
}
|
||||
return '<a href="' + encodeURI(v) + '" target="_blank">' + escape(v) + '</a>';
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -70,11 +109,11 @@ define(['table', 'upload','form'], function (Table,Upload,Form) {
|
||||
},
|
||||
{
|
||||
title: "图片宽度",
|
||||
field: "width",
|
||||
field: "file_width",
|
||||
},
|
||||
{
|
||||
title: "图片高度",
|
||||
field: "height",
|
||||
field: "file_height",
|
||||
},{
|
||||
title: "扩展名",
|
||||
field: "extension",
|
||||
@@ -170,27 +209,39 @@ define(['table', 'upload','form'], function (Table,Upload,Form) {
|
||||
totalField: "count",
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{
|
||||
field: 'id',
|
||||
title: 'ID',
|
||||
filter: "number",
|
||||
sortable: true // 是否排序
|
||||
},
|
||||
{
|
||||
title: "adapter",
|
||||
field: "adapter",
|
||||
filter: "string",
|
||||
},
|
||||
{
|
||||
title: "名字",
|
||||
field: "title",
|
||||
field: "origin_name",
|
||||
filter: "string",
|
||||
},
|
||||
{
|
||||
title: "文件",
|
||||
field: "path",
|
||||
filter: "string",
|
||||
formatter: function (v,d) {
|
||||
field: "file_name",
|
||||
formatter: function (v,d,index) {
|
||||
if (["jpg", "jpeg", "png", "gif", "bmp", "webp", "svg"].indexOf(d.extension.toLowerCase()) !== -1) {
|
||||
return '<img src="' + Fast.api.cdnurl(v) + '" style="max-width:32px;max-height:32px;" />';
|
||||
var value = d['file_url'] == null || d['file_url'].length === 0 ? '' : d['file_url'].toString();
|
||||
value = value ? value : '/assets/img/blank.gif';
|
||||
var classname = 'img-sm img-center previewitem';
|
||||
var url = Fast.api.cdnurl(value, true);
|
||||
url = url.match(/^(\/|data:image\\)/) ? url : url + Config.upload_thumbstyle;
|
||||
return '<a href="javascript:"><img class="' + classname + '" src="' + url + '" alt="'+d['origin_name']+'" /></a>';
|
||||
}
|
||||
return '<a href="' + d['file_url'] + '" target="_blank" title="'+d['origin_name']+'">' + v + '</a>';
|
||||
},
|
||||
events:{
|
||||
'click .img-center': function(e,v,d,index){
|
||||
User.imgpreview.call(this,e,d['file_url'],d,index);
|
||||
}
|
||||
return '<a href="' + encodeURI(v) + '" target="_blank">' + escape(v) + '</a>';
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -211,19 +262,17 @@ define(['table', 'upload','form'], function (Table,Upload,Form) {
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "mime类型",
|
||||
title: "类型",
|
||||
field: "mime_type",
|
||||
hide: true,
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
title: "图片宽度",
|
||||
field: "width",
|
||||
visible: false,
|
||||
field: "file_width",
|
||||
},
|
||||
{
|
||||
title: "图片高度",
|
||||
field: "height",
|
||||
visible: false,
|
||||
field: "file_height",
|
||||
},{
|
||||
title: "扩展名",
|
||||
field: "extension",
|
||||
|
||||
Reference in New Issue
Block a user