From 1fdfdd07bb46bba0f4f07ecc5ed5a453679553af Mon Sep 17 00:00:00 2001 From: printempw Date: Mon, 11 Apr 2016 17:17:08 +0800 Subject: [PATCH] tweaked performance of config generator --- assets/js/manual.utils.js | 12 ++++++++---- templates/header.tpl.php | 2 +- user/manual.php | 6 +++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/assets/js/manual.utils.js b/assets/js/manual.utils.js index fc948c1c..bd886335 100644 --- a/assets/js/manual.utils.js +++ b/assets/js/manual.utils.js @@ -2,7 +2,7 @@ * @Author: printempw * @Date: 2016-04-03 13:44:36 * @Last Modified by: printempw -* @Last Modified time: 2016-04-03 14:25:52 +* @Last Modified time: 2016-04-11 17:16:30 */ 'use strict'; @@ -24,13 +24,17 @@ $('#mod-select').change(function() { $('#version-select').append(''); $('#version-select').append(''); } + + showConfig(); }); -$('#version-select').change(function() { +function showConfig() { $('#config-13_1-upper').hide(); $('#config-13_1-lower').hide(); $('#config-1_4-upper').hide(); $('#config-1_2-1_3').hide(); $('#config-1_2-lower').hide(); - $('#config-'+$(this).val()).show(); -}); + $('#config-'+$('#version-select').val()).show(); +} + +$('#version-select').change(showConfig); diff --git a/templates/header.tpl.php b/templates/header.tpl.php index ca62face..a4efbc63 100644 --- a/templates/header.tpl.php +++ b/templates/header.tpl.php @@ -103,7 +103,7 @@ $pages = array(1 => ['title'=>'用户中心', 'link'=>'index.php', 'icon'=>'fa-dashboard'], 2 => ['title'=>'皮肤上传', 'link'=>'upload.php', 'icon'=>'fa-upload'], 3 => ['title'=>'个人资料', 'link'=>'profile.php', 'icon'=>'fa-user'], - 4 => ['title'=>'使用说明', 'link'=>'manual.php', 'icon'=>'fa-book']); + 4 => ['title'=>'配置生成', 'link'=>'manual.php', 'icon'=>'fa-book']); foreach ($pages as $key => $value) { echo ($data['page_title'] == $value['title']) ? '
  • ' : '
  • '; diff --git a/user/manual.php b/user/manual.php index b34770d4..e5ac21d7 100644 --- a/user/manual.php +++ b/user/manual.php @@ -3,7 +3,7 @@ * @Author: printempw * @Date: 2016-04-03 12:15:35 * @Last Modified by: printempw - * @Last Modified time: 2016-04-04 08:10:23 + * @Last Modified time: 2016-04-11 17:12:57 */ require "../libraries/session.inc.php"; $data['style'] = <<< 'EOT' @@ -23,8 +23,8 @@ View::show('header', $data);

    - 使用说明 - Manual + 配置生成 + Configuration Generator