From 3081dcc8db5d79aa838bda5a2d004e7ea3d25d3b Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Fri, 10 Oct 2014 12:14:37 +0000 Subject: [PATCH] Remove js working with features fields from style files --- .../default/js => js/source}/features.js | 34 ++++++++-------- .../Settings/FeaturesController.php | 2 + .../server_side/settings_features.handlebars | 40 +++++++++---------- 3 files changed, 37 insertions(+), 39 deletions(-) rename src/mibew/{styles/pages/default/js => js/source}/features.js (62%) diff --git a/src/mibew/styles/pages/default/js/features.js b/src/mibew/js/source/features.js similarity index 62% rename from src/mibew/styles/pages/default/js/features.js rename to src/mibew/js/source/features.js index f8eb7d77..de3d704f 100644 --- a/src/mibew/styles/pages/default/js/features.js +++ b/src/mibew/js/source/features.js @@ -18,48 +18,48 @@ (function($) { function updateSurvey() { - if ($("#enablepresurvey").is(":checked")) { - $(".undersurvey").show(); + if ($("#enable-presurvey").is(":checked")) { + $(".under-survey").show(); } else { - $(".undersurvey").hide(); + $(".under-survey").hide(); } } function updateSSL() { - if ($("#enablessl").is(":checked")) { - $(".underssl").show(); + if ($("#enable-ssl").is(":checked")) { + $(".under-ssl").show(); } else { - $(".underssl").hide(); + $(".under-ssl").hide(); } } function updateGroups() { - if ($("#enablegroups").is(":checked")) { - $(".undergroups").show(); + if ($("#enable-groups").is(":checked")) { + $(".under-groups").show(); } else { - $(".undergroups").hide(); + $(".under-groups").hide(); } } function updateTracking() { - if ($("#enabletracking").is(":checked")) { - $(".undertracking").show(); + if ($("#enable-tracking").is(":checked")) { + $(".under-tracking").show(); } else { - $(".undertracking").hide(); + $(".under-tracking").hide(); } } $(function() { - $("#enablepresurvey").change(function() { + $("#enable-presurvey").change(function() { updateSurvey(); }); - $("#enablessl").change(function() { + $("#enable-ssl").change(function() { updateSSL(); }); - $("#enablegroups").change(function() { + $("#enable-groups").change(function() { updateGroups(); }); - $("#enabletracking").change(function() { + $("#enable-tracking").change(function() { updateTracking(); }); updateSurvey(); @@ -67,4 +67,4 @@ updateGroups(); updateTracking(); }); -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/src/mibew/libs/classes/Mibew/Controller/Settings/FeaturesController.php b/src/mibew/libs/classes/Mibew/Controller/Settings/FeaturesController.php index 4508b52b..2e05c6d6 100644 --- a/src/mibew/libs/classes/Mibew/Controller/Settings/FeaturesController.php +++ b/src/mibew/libs/classes/Mibew/Controller/Settings/FeaturesController.php @@ -61,6 +61,8 @@ class FeaturesController extends AbstractController $page = array_merge($page, prepare_menu($operator)); $page['tabs'] = $this->buildTabs($request); + $this->getAssetManager()->attachJs('js/compiled/features.js'); + return $this->render('settings_features', $page); } diff --git a/src/mibew/styles/pages/default/templates_src/server_side/settings_features.handlebars b/src/mibew/styles/pages/default/templates_src/server_side/settings_features.handlebars index 414eed42..608a3d17 100644 --- a/src/mibew/styles/pages/default/templates_src/server_side/settings_features.handlebars +++ b/src/mibew/styles/pages/default/templates_src/server_side/settings_features.handlebars @@ -1,10 +1,6 @@ {{#extends "_layout"}} {{#override "menu"}}{{> _menu}}{{/override}} - {{#override "head"}} - - {{/override}} - {{#override "content"}} {{l10n "Specify options affecting chat window and common system behavior."}} @@ -42,14 +38,14 @@
- +
- +
- +
-
+
@@ -60,14 +56,14 @@
- +
- +
- +
-
+
@@ -87,14 +83,14 @@
- +
- +
- +
-
+
@@ -114,14 +110,14 @@
- +
- +
- +
-
+
@@ -130,7 +126,7 @@
-
+
@@ -139,7 +135,7 @@
-
+