Skip to content

Commit

Permalink
优化主题设置移动端显示问题,
Browse files Browse the repository at this point in the history
优化评论留言表情显示效果,
优化采集功能播放器配置问题,
优化浏览器访问控制功能,
修复详情标签错误导致错位问题,
修复Satari深色模式的问题,
修复图片盗链接口错误的问题,
修复二维码小图标跨域的问题
  • Loading branch information
amujie committed Jul 24, 2020
1 parent 9defef3 commit 595a7a3
Show file tree
Hide file tree
Showing 49 changed files with 670 additions and 424 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- 作者首页:[https://amujie.com](https://amujie.com)
- 加群链接:[https://jq.qq.com/?_wv=1027&k=5Cpumac](https://jq.qq.com/?_wv=1027&k=5Cpumac)
- 扣群号码:137183109
- 静态文件:[https://cdn.jsdelivr.net/gh/amujie/mojia@latest/](https://cdn.jsdelivr.net/gh/amujie/mojia@latest/)
- 静态文件:[https://cdn.jsdelivr.net/gh/amujie/mojia@master/](https://cdn.jsdelivr.net/gh/amujie/mojia@master/)

#### 主题简介
- 主题定价:¥198(一个站点丨售后永久免费更新)
Expand Down
10 changes: 10 additions & 0 deletions about/changelog.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
{
"1.1.0": [
"优化主题设置移动端显示问题",
"优化评论留言表情显示效果",
"优化采集功能播放器配置问题",
"优化浏览器访问控制功能",
"修复详情标签错误导致错位问题",
"修复Satari深色模式的问题",
"修复图片盗链接口错误的问题",
"修复二维码小图标跨域的问题"
],
"1.0.9": [
"修复视频集数列表的问题",
"修复采集优化标签问题",
Expand Down
31 changes: 28 additions & 3 deletions asset/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ p {line-height: 1.875rem;word-wrap: break-word}
i {font-style: normal;display: inline-block}
li {list-style: none}
hr {border-width: 0;border-bottom-width: 1px;}
img {display: inline-block;border: 0;vertical-align: middle;max-width: 100%;}
img {display: inline-block;border: 0;vertical-align: middle;max-width: 100% !important;}
table {border-collapse: collapse;border-spacing: 0}
html,
body {height: auto !important;}
Expand Down Expand Up @@ -569,9 +569,34 @@ input:-webkit-autofill:focus {background-clip: content-box !important;}
.mo-lhxl-24px {line-height: 1.5rem}
.mo-byxl-20by15 {padding-top: 75%}
}
@media(min-width:1400px) {
/* 1440 */
.mo-cols-sl1 {width: 8.33333333%}
.mo-cols-sl2 {width: 16.66666667%}
.mo-cols-sl3 {width: 25%}
.mo-cols-sl4 {width: 33.33333333%}
.mo-cols-sl5 {width: 41.66666667%}
.mo-cols-sl6 {width: 50%}
.mo-cols-sl7 {width: 58.33333333%}
.mo-cols-sl8 {width: 66.66666667%}
.mo-cols-sl9 {width: 75%}
.mo-cols-sl10 {width: 83.33333333%}
.mo-cols-sl11 {width: 91.66666667%}
.mo-cols-sl12 {width: 100%}
.mo-cols-sl1x {width: 10%}
.mo-cols-case {width: 82.5rem}
.mo-cosl-west {float: left;}
.mo-cosl-east {float: right;}
.mo-cosl-none {display: none !important}
.mo-cosl-block {display: block !important}
.mo-cosl-inline {display: inline !important}
.mo-cosl-iblock {display: inline-block !important}
.mo-cosl-table {display: table-cell !important}
.mo-cosl-left {text-align: left !important}
.mo-cosl-right {text-align: right !important}
.mo-cosl-center {text-align: center !important}
}
/* 通用组件 */
.mo-part-hide {display: none !important}
.mo-part-show {display: block !important}
.mo-part-curs {cursor: pointer}
.mo-part-coin {border-radius: 100%}
.mo-part-hund {border-radius: 6.25rem}
Expand Down
11 changes: 9 additions & 2 deletions asset/exc/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
'type' => '',
'brand' => '',
'sort' => '0',
'ver' => '1.2.2',
'ver' => '1.2.3',
'num' => '12',
'state' => '0',
),
Expand Down Expand Up @@ -1046,13 +1046,20 @@
'time' => '2021-05-20 13:14:20',
'state' => '1',
),
'cdns' =>
'cdns' =>
array (
'name' => '静态加速',
'link' => 'https://cdn.jsdelivr.net/gh/amujie/mojia',
'debug' => '1',
'state' => '1',
),
'init' =>
array (
'name' => '脚本入口',
'file' => 'global',
'exclu' => '0',
'state' => '0',
),
'edit' =>
array (
'name' => '编辑按钮',
Expand Down
545 changes: 283 additions & 262 deletions asset/exc/create.php

Large diffs are not rendered by default.

53 changes: 48 additions & 5 deletions asset/exc/obtain.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?php
/**
* 作者:大橙子
* 网址:https://amujie.com
* QQ:1570457334
*/

// 主题路径
function moJiaPath($path) {
$install = '../../../../';
Expand All @@ -12,9 +18,9 @@ function moJiaPath($path) {
} elseif ($path == 'home') {
return $maccms['site']['install_dir'];
} elseif ($path == 'down') {
return 'https://cdn.jsdelivr.net/gh/amujie/download@latest/';
return 'https://cdn.jsdelivr.net/gh/amujie/download@master/';
} elseif ($path == 'vers') {
return 'https://cdn.jsdelivr.net/gh/amujie/mojia@latest/';
return 'https://cdn.jsdelivr.net/gh/amujie/mojia@master/';
} elseif ($path == 'path') {
return $install;
}
Expand Down Expand Up @@ -83,11 +89,13 @@ function moJiaDaTaoKe($api, $param, $appSecret) {
// 表情转换
function moJiaFace($data) {
$version = parse_ini_file(substr(moJiaPath('temp'), strlen(moJiaPath('home'))) . 'info.ini');
$mojia = file_exists('application/extra/mojiaopt.php') ? @require ('application/extra/mojiaopt.php') : @require ('config.php'); ;
$mojia = file_exists('application/extra/mojiaopt.php') ? @require ('application/extra/mojiaopt.php') : @require ('config.php');
$cdnpath = $mojia['other']['cdns']['state'] ? $mojia['other']['cdns']['link'] . (strpos($mojia['other']['cdns']['link'], 'cdn.jsdelivr.net/gh/amujie') !== false ? '@' . $version['version'] : '') . '/' : moJiaPath('temp');
preg_match_all('/(?:\[)[^(?:\])]+]/i', $data, $match);
preg_match_all('/(\[)[^(\])]+]/i', $data, $match);
foreach ($match[0] as $key => $value) {
$data = str_replace($match[0][$key], '<img class="mo-part-mtop" width="auto" height="24" src="' . $cdnpath . 'asset/face/' . str_replace(array('[', ']'), '', $match[0][$key]) . (strstr($match[0][$key], 'qq') ? '.gif' : '.png') . '"/>', $data);
if (preg_match('/\[(.*)\/(.*)\]/', $match[0][$key])) {
$data = str_replace($match[0][$key], '<img class="mo-part-mtop" width="auto" height="24" src="' . $cdnpath . 'asset/face/' . str_replace(array('[', ']'), '', $match[0][$key]) . (strstr($match[0][$key], 'qq') ? '.gif' : '.png') . '"/>', $data);
}
}
return $data;
}
Expand All @@ -103,6 +111,41 @@ function moJiaSimple($data) {
}
}

// HTML标签校对
function moJiaHtmlTags($html, $tags = array()) {
$result = null;
$stack = array();
$single = array('br', 'hr', 'img', 'input');
if ($tags && is_array($tags)) {
$single = array_merge($single, $tags);
$single = array_map('strtolower', $single);
$single = array_unique($single);
}
$content = preg_split('/(<[^>]+>)/si', $html, null, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
foreach ($content as $val) {
if (preg_match('/<(\w+)[^\/]*>/si', $val, $m) && in_array(strtolower($m[1]), $single)) {
$result .= "\r\n" . $val;
} else if (preg_match('/<(\w+)[^\/]*\/>/si', $val, $m)) {
$result .= $val;
} else if (preg_match('/<(\w+)[^\/]*>/si', $val, $m)) {
$result .= "\r\n" . str_repeat("\t", count($stack)) . $val;
array_push($stack, $m[1]);
} else if (preg_match('/<\/(\w+)[^\/]*>/si', $val, $m)) {
if (strtolower(end($stack)) == strtolower($m[1])) {
array_pop($stack);
$result .= $val;
}
} else {
$result .= $val;
}
}
while ($stack) {
$result .= "</" . array_pop($stack) . ">";
$result .= "\r\n";
}
return $result;
}

// 获取网址内容
function moJiaCurlGet($url) {
$curl = curl_init();
Expand Down
119 changes: 84 additions & 35 deletions asset/js/admin.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
layui.define(['mojia', 'common', 'iconfonts', 'multiple', 'sortable'], function(exports) {
layui.define(['income', 'iconfonts', 'multiple', 'sortable'], function(exports) {
var $ = layui.jquery;
var mojia = {
'global': {
'init': function() {
layui.util.fixbar();
mojia.global.seokey();
mojia.global.update(0);
layui.multiple.init('select[multiple]');
layui.income.global.init();
layui.iconfonts.init('.layui-font-info');
layui.multiple.init('select[multiple]');
mojia.global.update();
mojia.global.seokey();
mojia.global.browse();
layui.util.fixbar();
layui.laydate.render({
elem: '.mo-date-time',
type: 'datetime'
Expand All @@ -21,6 +23,9 @@ layui.define(['mojia', 'common', 'iconfonts', 'multiple', 'sortable'], function(
$(this).parents('td').next().next().next().find('input').val(data.elem[data.elem.selectedIndex].dataset.link);
});
layui.form.on('select(iconer)', function(data) {
$(this).parents('td').prev().find('input').next().find('span').find('i').attr('class', 'mo-icon-font ' + data.elem[data.elem.selectedIndex].dataset.icon);
$(this).parents('td').prev().find('input').val(data.elem[data.elem.selectedIndex].dataset.icon);
$(this).parents('td').next().find('input').val(data.elem[data.elem.selectedIndex].dataset.url);
if (data.value == 'artist') {
$(this).parents('td').next().find('.layui-form-select').addClass('mo-cols-show').removeClass('mo-cols-hide');
$(this).parents('td').next().find('.layui-font-select').addClass('mo-cols-hide').removeClass('mo-cols-show');
Expand All @@ -31,8 +36,6 @@ layui.define(['mojia', 'common', 'iconfonts', 'multiple', 'sortable'], function(
});
layui.form.on('submit(submit)', function(data) {
$.post($('.layui-form-pane').attr('action'), data.field, function(data) {
$.post(magic.tpl + 'asset/exc/create.php?id=opt', 'chat=chat&send=' + $('input[name="mojia[play][chat][send]"]').val() + '&code=' + $('input[name="mojia[play][chat][code]"]').val() + '&close=' + $('input[name="mojia[other][close][state]"]:checked').val());
$.post(magic.tpl + 'asset/exc/create.php?id=url', 'tao=tao');
layer.msg(data.msg, {
time: 1000
}, function() {
Expand Down Expand Up @@ -117,12 +120,6 @@ layui.define(['mojia', 'common', 'iconfonts', 'multiple', 'sortable'], function(
}
}
});
layui.element.on('tab(table)', function() {
layui.common.cookie.set('mo_table', this.getAttribute('lay-id'), 1);
});
if (layui.common.cookie.get('mo_table') != null) {
layui.element.tabChange('table', layui.common.cookie.get('mo_table'));
}
$('.mo-look-btns').each(function(nums, info) {
layui.colorpicker.render({
elem: '.mo-look-btns' + nums,
Expand Down Expand Up @@ -162,9 +159,9 @@ layui.define(['mojia', 'common', 'iconfonts', 'multiple', 'sortable'], function(
var array = [];
for (var i = 0; i < string.length; i++) {
var item = string[i];
if (item === "(") {
array.push("(");
} else if (item === ")") {
if (item === '(') {
array.push('(');
} else if (item === ')') {
if (array.length === 0) {
return false;
} else {
Expand All @@ -176,6 +173,60 @@ layui.define(['mojia', 'common', 'iconfonts', 'multiple', 'sortable'], function(
};
return array.length === 0;
},
'browse': function() {
$(document).on('click', '.mo-java-brow', function(data) {
var that = $(this);
if (that.css('background-color') != 'rgb(176, 224, 230)') {
that.css('background-color', 'lemonchiffon');
}
var array = $(this).val().substring(1, $(this).val().indexOf('/i')).split('|');
layer.open({
type: 1,
btn: '确认修改',
area: ['640px', '500px'],
content: '<ul class="mo-brow-nows mo-pzxs-5px mo-coxs-center mo-part-bord mo-bord-muted"></ul><ul class="mo-brow-news mo-pzxs-5px mo-mtxs-10px mo-coxs-center mo-part-bord mo-bord-muted"></ul>',
success: function(layero, index) {
$('.layui-layer-content').addClass('mo-cols-rows mo-paxs-20px');
$('.mo-brow-nows').after('<table class="layui-table"><tbody><tr><td width="70"><a href="https://www.runoob.com/regexp/regexp-syntax.html" target="_blank"><font color="red">正则表达式</font></a></td><td><input type="text" class="layui-input mo-brow-custom" placeholder="自定义内容"></td><td width="90"><a class="layui-btn layui-btn-primary mo-brow-cust">添加内容</a></td></tr><tbody></table>');
var html = '';
for (var i = 0; i < array.length; i++) {
html += '<li class="mo-java-seoe mo-coxs-iblock mo-maxs-5px"><a class="layui-btn layui-btn-sm mo-pnxs-10px"><span class="mo-coxs-arow" style="vertical-align:text-bottom;max-width:500px;display:inline-block!important;cursor:move">' + array[i] + '</span><i class="mo-brow-dels mo-icon-font mo-icon-shibai-line mo-plxs-10px" style="vertical-align:top"></i></a></li>';
}
$('.mo-brow-nows').html(html);
var item = '';
var income = layui.income.browse;
$.each(income, function(nums, info) {
item += '<li class="mo-coxs-iblock mo-maxs-5px"><a class="layui-btn layui-btn-sm mo-pnxs-10px"><span style="vertical-align:text-bottom" data-code="' + nums + '">' + info + '</span><i class="mo-brow-adds mo-icon-font mo-icon-zengjia-line mo-plxs-10px" style="vertical-align:top"></i></a></li>';
});
$('.mo-brow-news').html(item);
},
yes: function(index, layero) {
var array = [];
that.css('background-color', 'powderblue');
$('.mo-brow-nows').find('li').each(function() {
array.push($(this).find('span').text());
});
that.val('/' + array.join('|') + '/i');
layer.close(index);
},
cancel: function(index, layero) {
if (that.css('background-color') == 'rgb(255, 250, 205)') {
that.css('background-color', '');
}
}
});
});
$(document).on('click', '.mo-brow-cust', function(data) {
if (!$(this).parent().prev().find('input').val()) return false;
$('.mo-brow-nows').append('<li class="mo-java-seoe mo-coxs-iblock mo-maxs-5px"><a class="layui-btn layui-btn-sm mo-pnxs-10px"><span class="mo-coxs-arow" style="vertical-align:text-bottom;max-width:500px;display:inline-block!important;cursor:move">' + $(this).parent().prev().find('input').val() + '</span><i class="mo-brow-dels mo-icon-font mo-icon-shibai-line mo-plxs-10px" style="vertical-align:top"></i></a></li>');
});
$(document).on('click', '.mo-brow-dels', function(data) {
$(this).parent().parent().remove();
});
$(document).on('click', '.mo-brow-adds', function(data) {
$('.mo-brow-nows').append('<li class="mo-java-seoe mo-coxs-iblock mo-maxs-5px"><a class="layui-btn layui-btn-sm mo-pnxs-10px"><span class="mo-coxs-arow" style="vertical-align:text-bottom;max-width:500px;display:inline-block!important;cursor:move">' + $(this).prev().attr('data-code') + '</span><i class="mo-brow-dels mo-icon-font mo-icon-shibai-line mo-plxs-10px" style="vertical-align:top"></i></a></li>');
});
},
'seokey': function() {
$(document).on('click', '.mo-java-seos', function(data) {
var that = $(this);
Expand All @@ -192,25 +243,23 @@ layui.define(['mojia', 'common', 'iconfonts', 'multiple', 'sortable'], function(
content: '<ul class="mo-seos-nows mo-pzxs-5px mo-coxs-center mo-part-bord mo-bord-muted"></ul><ul class="mo-seos-news mo-pzxs-5px mo-mtxs-10px mo-coxs-center mo-part-bord mo-bord-muted"></ul>',
success: function(layero, index) {
$('.layui-layer-content').addClass('mo-cols-rows mo-paxs-20px');
$('.mo-seos-nows').after('<table class="layui-table"><tbody><tr><td width="70">自定义内容</td><td><input type="text" value="\'自定义内容\'" class="layui-input mo-seos-custom" placeholder="模块"></td><td width="90"><a class="layui-btn layui-btn-primary mo-seos-cust">添加内容</a></td></tr><tbody></table>');
layui.use('income', function() {
var html = '';
for (var i = 0; i < array.length; i++) {
html += '<li class="mo-java-seoe mo-coxs-iblock mo-maxs-5px"><a class="layui-btn layui-btn-sm mo-pnxs-10px"><span class="mo-coxs-arow" style="vertical-align:text-bottom;max-width:500px;display:inline-block!important;cursor:move">' + array[i] + '</span><i class="mo-seos-dels mo-icon-font mo-icon-shibai-line mo-plxs-10px" style="vertical-align:top"></i></a></li>';
$('.mo-seos-nows').after('<table class="layui-table"><tbody><tr><td width="70">自定义内容</td><td><input type="text" value="\'自定义内容\'" class="layui-input mo-seos-custom" placeholder="自定义内容"></td><td width="90"><a class="layui-btn layui-btn-primary mo-seos-cust">添加内容</a></td></tr><tbody></table>');
var html = '';
for (var i = 0; i < array.length; i++) {
html += '<li class="mo-java-seoe mo-coxs-iblock mo-maxs-5px"><a class="layui-btn layui-btn-sm mo-pnxs-10px"><span class="mo-coxs-arow" style="vertical-align:text-bottom;max-width:500px;display:inline-block!important;cursor:move">' + array[i] + '</span><i class="mo-seos-dels mo-icon-font mo-icon-shibai-line mo-plxs-10px" style="vertical-align:top"></i></a></li>';
}
$('.mo-seos-nows').html(html);
$('.mo-java-seoe').arrangeable();
var item = '';
var income = layui.income.seokey;
$.each(income, function(nums, info) {
if (nums == 'common' || mojia.global.search(aids, nums.split(','))) {
for (var i = 0; i < info.length; i++) {
item += '<li class="mo-coxs-iblock mo-maxs-5px"><a class="layui-btn layui-btn-sm mo-pnxs-10px"><span style="vertical-align:text-bottom" data-code="' + income[nums][i].code + '">' + income[nums][i].name + '</span><i class="mo-seos-adds mo-icon-font mo-icon-zengjia-line mo-plxs-10px" style="vertical-align:top"></i></a></li>';
};
}
$('.mo-seos-nows').html(html);
$('.mo-java-seoe').arrangeable();
var item = '';
var income = layui.income.seokey;
$.each(income, function(nums, info) {
if (nums == 'common' || mojia.global.search(aids, nums.split(','))) {
for (var i = 0; i < info.length; i++) {
item += '<li class="mo-coxs-iblock mo-maxs-5px"><a class="layui-btn layui-btn-sm mo-pnxs-10px"><span style="vertical-align:text-bottom" data-code="' + income[nums][i].code + '">' + income[nums][i].name + '</span><i class="mo-seos-adds mo-icon-font mo-icon-zengjia-line mo-plxs-10px" style="vertical-align:top"></i></a></li>';
};
}
});
$('.mo-seos-news').html(item);
});
$('.mo-seos-news').html(item);
},
yes: function(index, layero) {
var array = [];
Expand Down Expand Up @@ -275,7 +324,7 @@ layui.define(['mojia', 'common', 'iconfonts', 'multiple', 'sortable'], function(
});
});
},
'update': function(count) {
'update': function() {
$('.layui-body', parent.document).css('overflow-y', 'hidden');
$.post(magic.tpl + 'asset/exc/create.php?id=opt', 'ver=new', function(data) {
if (mojia.global.contra(0, $('.mo-opts-vers').text(), data.ver) > 0) {
Expand All @@ -298,7 +347,7 @@ layui.define(['mojia', 'common', 'iconfonts', 'multiple', 'sortable'], function(
$.post(magic.tpl + 'asset/exc/create.php?id=opt', 'tpl=mojia-' + news, function(data) {
if (data.msg == 'mojia-' + news) {
layer.alert('升级成功', function(index) {
$.post($('.j-ajax', parent.document).attr('href'), function(data) {
$.post(magic.path + magic.admin + '/admin/index/clear', function(data) {
layer.msg((data.msg ? data.msg : '请手动清除缓存'), {
time: 1000
}, function() {
Expand Down
Loading

0 comments on commit 595a7a3

Please sign in to comment.