update manifest
This commit is contained in:
parent
443894d488
commit
6b8e7b0ede
|
@ -351,9 +351,9 @@ function feature_gallery() {
|
||||||
$img = array_rand($img_array);
|
$img = array_rand($img_array);
|
||||||
$img_domain = akina_option('cover_cdn') ? akina_option('cover_cdn') : get_template_directory_uri();
|
$img_domain = akina_option('cover_cdn') ? akina_option('cover_cdn') : get_template_directory_uri();
|
||||||
if(strpos($_SERVER['HTTP_ACCEPT'], 'image/webp')) {
|
if(strpos($_SERVER['HTTP_ACCEPT'], 'image/webp')) {
|
||||||
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["webp"][1];
|
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["webp"][0];
|
||||||
} else {
|
} else {
|
||||||
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["jpeg"][1];
|
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["jpeg"][0];
|
||||||
}
|
}
|
||||||
$data = array('cover image');
|
$data = array('cover image');
|
||||||
$response = new WP_REST_Response($data);
|
$response = new WP_REST_Response($data);
|
||||||
|
|
Binary file not shown.
|
@ -1,8 +1,8 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Sakura\n"
|
"Project-Id-Version: Sakura\n"
|
||||||
"POT-Creation-Date: 2019-12-15 14:40+0800\n"
|
"POT-Creation-Date: 2019-12-21 20:24+0800\n"
|
||||||
"PO-Revision-Date: 2019-12-15 14:40+0800\n"
|
"PO-Revision-Date: 2019-12-21 20:24+0800\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"Language: en_US\n"
|
"Language: en_US\n"
|
||||||
|
@ -1303,14 +1303,14 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.php:879
|
#: options.php:879
|
||||||
msgid "Cover CDN"
|
msgid "Cover manifest"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.php:880
|
#: options.php:880
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid ""
|
msgid ""
|
||||||
"Fill in the cdn path for random picture display, without adding a slash at "
|
"Fill in the manifest path for random picture display, without adding a slash "
|
||||||
"the end, for example: https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3, "
|
"at the end, for example: https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3, "
|
||||||
"please refer to <a href = \"https: //github.com/mashirozx/Sakura/wiki/options"
|
"please refer to <a href = \"https: //github.com/mashirozx/Sakura/wiki/options"
|
||||||
"\">Wiki </a>. Click <a href = \"%s\">here</a> to update manifest"
|
"\">Wiki </a>. Click <a href = \"%s\">here</a> to update manifest"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -3,7 +3,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
||||||
"Project-Id-Version: Sakura\n"
|
"Project-Id-Version: Sakura\n"
|
||||||
"POT-Creation-Date: 2019-12-15 14:40+0800\n"
|
"POT-Creation-Date: 2019-12-21 20:23+0800\n"
|
||||||
"PO-Revision-Date: 2019-11-01 14:27+0800\n"
|
"PO-Revision-Date: 2019-11-01 14:27+0800\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
|
@ -1287,13 +1287,13 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.php:879
|
#: options.php:879
|
||||||
msgid "Cover CDN"
|
msgid "Cover manifest"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.php:880
|
#: options.php:880
|
||||||
#, php-format
|
#, php-format
|
||||||
msgid ""
|
msgid ""
|
||||||
"Fill in the cdn path for random picture display, without adding a slash at the end, for "
|
"Fill in the manifest path for random picture display, without adding a slash at the end, for "
|
||||||
"example: https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3, please refer to <a href = "
|
"example: https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3, please refer to <a href = "
|
||||||
"\"https: //github.com/mashirozx/Sakura/wiki/options\">Wiki </a>. Click <a href = \"%s\">here</"
|
"\"https: //github.com/mashirozx/Sakura/wiki/options\">Wiki </a>. Click <a href = \"%s\">here</"
|
||||||
"a> to update manifest"
|
"a> to update manifest"
|
||||||
|
|
Binary file not shown.
|
@ -1,8 +1,8 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Sakura\n"
|
"Project-Id-Version: Sakura\n"
|
||||||
"POT-Creation-Date: 2019-12-15 14:41+0800\n"
|
"POT-Creation-Date: 2019-12-21 20:23+0800\n"
|
||||||
"PO-Revision-Date: 2019-12-15 14:41+0800\n"
|
"PO-Revision-Date: 2019-12-21 20:24+0800\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"Language: zh_CN\n"
|
"Language: zh_CN\n"
|
||||||
|
@ -1324,27 +1324,21 @@ msgstr ""
|
||||||
"名/2018/05/xx.png 加载"
|
"名/2018/05/xx.png 加载"
|
||||||
|
|
||||||
#: options.php:879
|
#: options.php:879
|
||||||
msgid "Cover CDN"
|
msgid "Cover manifest"
|
||||||
msgstr "封面图图片库"
|
msgstr ""
|
||||||
|
|
||||||
#: options.php:880
|
#: options.php:880
|
||||||
#, fuzzy, php-format
|
#, php-format
|
||||||
#| msgid ""
|
|
||||||
#| "Fill in the cdn path for random picture display, without adding a slash "
|
|
||||||
#| "at the end, for example: https://cdn.jsdelivr.net/gh/mashirozx/"
|
|
||||||
#| "sakura@3.3.3, please refer to <a href = \"https: //github.com/mashirozx/"
|
|
||||||
#| "Sakura/wiki/options\">Wiki </a>. Click <a href = \"%s\">here</> to update "
|
|
||||||
#| "manifest"
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Fill in the cdn path for random picture display, without adding a slash at "
|
"Fill in the manifest path for random picture display, without adding a slash "
|
||||||
"the end, for example: https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3, "
|
"at the end, for example: https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3, "
|
||||||
"please refer to <a href = \"https: //github.com/mashirozx/Sakura/wiki/options"
|
"please refer to <a href = \"https: //github.com/mashirozx/Sakura/wiki/options"
|
||||||
"\">Wiki </a>. Click <a href = \"%s\">here</a> to update manifest"
|
"\">Wiki </a>. Click <a href = \"%s\">here</a> to update manifest"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"填写 cdn 路径,用于随机图片展示,最后不用加斜杠,例:https://cdn.jsdelivr."
|
"填写 manifest 路径,用于随机图片展示,最后不用加斜杠,例:https://cdn."
|
||||||
"net/gh/mashirozx/sakura@3.3.3 ,更多信息请参考<a href=\"https://github.com/"
|
"jsdelivr.net/gh/mashirozx/sakura@3.3.3 ,更多信息请参考<a href=\"https://"
|
||||||
"mashirozx/Sakura/wiki/options\">Wiki</a>。点击<a href =\"%s\">这里</a>更新"
|
"github.com/mashirozx/Sakura/wiki/options\">Wiki</a>。点击<a href =\"%s\">这里"
|
||||||
"manifest"
|
"</a>更新manifest"
|
||||||
|
|
||||||
#: options.php:886
|
#: options.php:886
|
||||||
msgid "Use the front-end library locally (lib.js、lib.css)"
|
msgid "Use the front-end library locally (lib.js、lib.css)"
|
||||||
|
@ -1858,6 +1852,9 @@ msgstr "注 册"
|
||||||
msgid "Registration is not open yet."
|
msgid "Registration is not open yet."
|
||||||
msgstr "暂未开放注册。"
|
msgstr "暂未开放注册。"
|
||||||
|
|
||||||
|
#~ msgid "Cover CDN"
|
||||||
|
#~ msgstr "封面图图片库"
|
||||||
|
|
||||||
#~ msgid "Jsdelivr CDN"
|
#~ msgid "Jsdelivr CDN"
|
||||||
#~ msgstr "随机图片"
|
#~ msgstr "随机图片"
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,10 @@ class Single(object):
|
||||||
def main(self):
|
def main(self):
|
||||||
self.hash()
|
self.hash()
|
||||||
# if os.path.exists(self.jpeg) and os.path.exists(self.webp):
|
# if os.path.exists(self.jpeg) and os.path.exists(self.webp):
|
||||||
|
try:
|
||||||
self.optimize()
|
self.optimize()
|
||||||
|
except OSError:
|
||||||
|
print("Falied to optimize the picture: " + self.file)
|
||||||
self.manifest()
|
self.manifest()
|
||||||
return self.mani
|
return self.mani
|
||||||
|
|
||||||
|
|
|
@ -876,8 +876,8 @@ function optionsframework_options() {
|
||||||
'type' => 'text');
|
'type' => 'text');
|
||||||
|
|
||||||
$options[] = array(
|
$options[] = array(
|
||||||
'name' => __('Cover CDN', 'sakura'),/*封面图片库*/
|
'name' => __('Cover manifest', 'sakura'),/*封面图片库*/
|
||||||
'desc' => sprintf(__('Fill in the cdn path for random picture display, without adding a slash at the end, for example: https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3, please refer to <a href = "https: //github.com/mashirozx/Sakura/wiki/options">Wiki </a>. Click <a href = "%s">here</a> to update manifest', 'sakura'), rest_url('sakura/v1/database/update')),/*填写 cdn 路径,用于随机图片展示,最后不用加斜杠,例:https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3 ,更多信息请参考<a href="https://github.com/mashirozx/Sakura/wiki/options">Wiki</a>*/
|
'desc' => sprintf(__('Fill in the manifest path for random picture display, without adding a slash at the end, for example: https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3, please refer to <a href = "https: //github.com/mashirozx/Sakura/wiki/options">Wiki </a>. Click <a href = "%s">here</a> to update manifest', 'sakura'), rest_url('sakura/v1/database/update')),/*填写 manifest 路径 ,用于随机图片展示,最后不用加斜杠,例:https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3 ,更多信息请参考<a href="https://github.com/mashirozx/Sakura/wiki/options">Wiki</a>*/
|
||||||
'id' => 'cover_cdn',
|
'id' => 'cover_cdn',
|
||||||
'std' => 'https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3',
|
'std' => 'https://cdn.jsdelivr.net/gh/mashirozx/sakura@3.3.3',
|
||||||
'type' => 'text');
|
'type' => 'text');
|
||||||
|
|
Loading…
Reference in New Issue