2 * headerMenu Plugin Js Controller
4 * Copyright 2012-2013, Franck Villaume - TrivialDev
5 * http://fusionforge.org
7 * This file is part of FusionForge. FusionForge is free software;
8 * you can redistribute it and/or modify it under the terms of the
9 * GNU General Public License as published by the Free Software
10 * Foundation; either version 2 of the Licence, or (at your option)
13 * FusionForge is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 EditHeaderMenuController = function(params) {
26 this.initializeView();
29 HeaderMenuController = function(params) {
32 this.initializeView();
35 GroupMenuController = function(params) {
38 this.initializeView();
41 HeaderMenuController.prototype =
43 bindControls: function() {
44 this.params.inputHtmlCode.click(jQuery.proxy(this, "htmlCodeView"));
45 this.params.inputURL.click(jQuery.proxy(this, "htmlUrlView"));
46 this.params.inputOuter.click(jQuery.proxy(this, "inputHtmlCodeView"));
47 this.params.inputHeader.click(jQuery.proxy(this, "initializeView"));
50 initializeView: function() {
51 this.params.inputHtmlCode.prop('disabled', true);
52 this.params.trHtmlCode.hide();
53 this.params.trUrlCode.show();
54 this.params.inputURL.attr('checked', 'checked');
57 htmlCodeView: function() {
58 this.params.trHtmlCode.show();
59 this.params.trUrlCode.hide();
62 htmlUrlView: function() {
63 this.params.trHtmlCode.hide();
64 this.params.trUrlCode.show();
67 inputHtmlCodeView: function() {
68 this.params.inputHtmlCode.prop('disabled', false);
72 GroupMenuController.prototype =
74 bindControls: function() {
75 this.params.inputHtmlCode.click(jQuery.proxy(this, "htmlCodeView"));
76 this.params.inputURL.click(jQuery.proxy(this, "htmlUrlView"));
79 initializeView: function() {
80 this.params.trHtmlCode.hide();
81 this.params.trUrlCode.show();
82 this.params.inputURL.attr('checked', 'checked');
85 htmlCodeView: function() {
86 this.params.trHtmlCode.show();
87 this.params.trUrlCode.hide();
88 this.params.trIframeView.hide();
91 htmlUrlView: function() {
92 this.params.trHtmlCode.hide();
93 this.params.trUrlCode.show();
94 this.params.trIframeView.show();
97 inputHtmlCodeView: function() {
98 this.params.inputHtmlCode.prop('disabled', false);
102 EditHeaderMenuController.prototype =
104 bindControls: function() {
105 this.params.inputHtmlCode.click(jQuery.proxy(this, "htmlCodeView"));
106 this.params.inputURL.click(jQuery.proxy(this, "htmlUrlView"));
107 if (typeof(this.params.inputOuter) != 'undefined') {
108 this.params.inputOuter.click(jQuery.proxy(this, "inputHtmlCodeView"));
110 if (typeof(this.params.inputHeader) != 'undefined') {
111 this.params.inputHeader.click(jQuery.proxy(this, "headerView"));
113 if (typeof(this.params.inputURLIframe) != 'undefined') {
114 this.params.inputURLIframe.click(jQuery.proxy(this, "htmlUrlView"));
118 initializeView: function() {
119 if (this.params.inputHeader.attr("checked")) {
120 this.params.inputHtmlCode.prop('disabled', true);
122 if (this.params.inputHtmlCode.attr("checked")) {
123 this.params.trHtmlCode.show();
124 this.params.trUrlCode.hide();
126 if (this.params.inputURL.attr("checked")) {
127 this.params.trHtmlCode.hide();
128 this.params.trUrlCode.show();
130 if (typeof(this.params.inputURLIframe) != 'undefined') {
131 if (this.params.inputURLIframe.attr("checked")) {
132 this.params.trHtmlCode.hide();
133 this.params.trUrlCode.show();
138 htmlUrlView: function() {
139 this.params.trHtmlCode.hide();
140 this.params.trUrlCode.show();
143 htmlCodeView: function() {
144 this.params.trHtmlCode.show();
145 this.params.trUrlCode.hide();
148 headerView: function() {
149 this.params.inputHtmlCode.prop('disabled', true);
150 this.params.trHtmlCode.hide();
151 this.params.trUrlCode.show();
152 this.params.inputURL.attr('checked', 'checked');
155 inputHtmlCodeView: function() {
156 this.params.inputHtmlCode.prop('disabled', false);