aboutsummaryrefslogtreecommitdiffhomepage
path: root/main/app/sprinkles/ConfigManager/assets/js/ConfigManager.js
diff options
context:
space:
mode:
authorMarvin Borner2018-04-26 21:59:59 +0200
committerMarvin Borner2018-04-26 21:59:59 +0200
commit111c0366708428c49b4e3a1d28b5628b6aec6c06 (patch)
tree2c6f06a8506a0610858e58ac977182119b2908d1 /main/app/sprinkles/ConfigManager/assets/js/ConfigManager.js
parent684482407f8cdd0f0c9b866c3966b95f5b8be219 (diff)
code cleanup and extended permissions (mainly database side)
Diffstat (limited to 'main/app/sprinkles/ConfigManager/assets/js/ConfigManager.js')
-rw-r--r--main/app/sprinkles/ConfigManager/assets/js/ConfigManager.js92
1 files changed, 0 insertions, 92 deletions
diff --git a/main/app/sprinkles/ConfigManager/assets/js/ConfigManager.js b/main/app/sprinkles/ConfigManager/assets/js/ConfigManager.js
deleted file mode 100644
index 2a298f5..0000000
--- a/main/app/sprinkles/ConfigManager/assets/js/ConfigManager.js
+++ /dev/null
@@ -1,92 +0,0 @@
-/*!
- * UF Config Manager - Config Manager Widget
- *
- * @link https://github.com/lcharette/UF_ConfigManager
- * @copyright Copyright (c) 2016 Louis Charette
- * @license https://github.com/lcharette/UF_ConfigManager/blob/master/LICENSE (MIT License)
- */
-
-(function( $ ){
-
- 'use strict';
-
- var options = {};
-
- var methods = {
- init : function(optionsArg) {
-
- // Setup options
- options = $.extend( options, $.fn.ConfigManager.defaultOptions, optionsArg );
-
- // To use this inside sub-functions
- var elements = this;
-
- // Get the currently selected panel from the url anchor and switch to it
- var hash = window.location.hash.substr(1);
- if (hash != undefined && hash !== "") {
- $(elements).hide();
- $("#"+hash).show();
-
- // Change the menu
- $(options.menu).find("li").removeClass('active');
- $(options.menu).find('a[href="#'+hash+'"]').parent().addClass("active");
- }
-
- // Set the menu
- $(options.menu).find("li > a").click(function () {
-
- // Change the menu first
- $(options.menu).find("li").removeClass('active');
- $(this).parent().addClass("active");
-
- // Change the displayed forms next
- $(elements).hide();
- $("#"+$(this).data('target')).show();
- });
-
- // For each element the plugin is called on
- this.each(function() {
-
- // To use this inside sub-functions
- var formPanel = this;
-
- // ufForm instance. Don't need FormGeneator now
- $(formPanel).find("form").ufForm({
- validators: options.validators[ $(formPanel).attr('id') ],
- msgTarget: $(formPanel).find("form .form-alerts")
- }).on("submitSuccess.ufForm", function() {
- // Forward to settings page on success
- window.location.reload(true);
- }).on("submitError.ufForm", function() {
- $(formPanel).find("form .form-alerts").show();
- });
-
- });
- return;
- }
- };
-
- /*
- * Main plugin function
- */
- $.fn.ConfigManager = function(methodOrOptions) {
- if ( methods[methodOrOptions] ) {
- return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));
- } else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {
- // Default to "init"
- return methods.init.apply( this, arguments );
- } else {
- $.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.ConfigManager' );
- }
- };
-
- /*
- * Default plugin options
- */
- $.fn.ConfigManager.defaultOptions = {
- menu : $(".configMenu"),
- validators: {}
- };
-
-
-})( jQuery ); \ No newline at end of file