2 * headerMenu Plugin Js Controller
4 * Copyright 2012, 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 HeaderMenuController.prototype =
37 bindControls: function() {
38 this.params.inputHtmlCode.click(jQuery.proxy(this, "htmlCodeView"));
39 this.params.inputURL.click(jQuery.proxy(this, "htmlUrlView"));
40 this.params.inputOuter.click(jQuery.proxy(this, "inputHtmlCodeView"));
41 this.params.inputHeader.click(jQuery.proxy(this, "initializeView"));
44 initializeView: function() {
45 this.params.inputHtmlCode.prop('disabled', true);
46 this.params.trHtmlCode.hide();
47 this.params.trUrlCode.show();
48 this.params.inputURL.attr('checked', 'checked');
51 htmlCodeView: function() {
52 this.params.trHtmlCode.show();
53 this.params.trUrlCode.hide();
56 htmlUrlView: function() {
57 this.params.trHtmlCode.hide();
58 this.params.trUrlCode.show();
61 inputHtmlCodeView: function() {
62 this.params.inputHtmlCode.prop('disabled', false);
66 EditHeaderMenuController.prototype =
68 bindControls: function() {
69 this.params.inputHtmlCode.click(jQuery.proxy(this, "htmlCodeView"));
70 this.params.inputURL.click(jQuery.proxy(this, "htmlUrlView"));
71 this.params.inputOuter.click(jQuery.proxy(this, "inputHtmlCodeView"));
72 this.params.inputHeader.click(jQuery.proxy(this, "headerView"));
75 initializeView: function() {
76 if (this.params.inputHeader.attr("checked")) {
77 this.params.inputHtmlCode.prop('disabled', true);
79 if (this.params.inputHtmlCode.attr("checked")) {
80 this.params.trHtmlCode.show();
81 this.params.trUrlCode.hide();
83 if (this.params.inputURL.attr("checked")) {
84 this.params.trHtmlCode.hide();
85 this.params.trUrlCode.show();
89 htmlUrlView: function() {
90 this.params.trHtmlCode.hide();
91 this.params.trUrlCode.show();
94 htmlCodeView: function() {
95 this.params.trHtmlCode.show();
96 this.params.trUrlCode.hide();
99 headerView: function() {
100 this.params.inputHtmlCode.prop('disabled', true);
101 this.params.trHtmlCode.hide();
102 this.params.trUrlCode.show();
103 this.params.inputURL.attr('checked', 'checked');
106 inputHtmlCodeView: function() {
107 this.params.inputHtmlCode.prop('disabled', false);