Skip to content

Commit

Permalink
Merge branch 'master' into FLUID-5185
Browse files Browse the repository at this point in the history
  • Loading branch information
jobara committed Oct 31, 2013
2 parents e6fabd3 + b20510c commit a15346d
Show file tree
Hide file tree
Showing 32 changed files with 2,186 additions and 564 deletions.
132 changes: 70 additions & 62 deletions src/components/slidingPanel/js/SlidingPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,86 +27,94 @@ var fluid_1_5 = fluid_1_5 || {};
gradeNames: ["fluid.viewComponent", "autoInit"],
selectors: {
panel: ".flc-slidingPanel-panel",
toggleButton: ".flc-slidingPanel-toggleButton"
toggleButton: ".flc-slidingPanel-toggleButton",
toggleButtonLabel: ".flc-slidingPanel-toggleButton"
},
strings: {
showText: {
expander: {
func: "fluid.slidingPanel.lookupMsg",
args: ["{that}.msgBundle", "slidingPanelShowText"]
}
},
hideText: {
expander: {
func: "fluid.slidingPanel.lookupMsg",
args: ["{that}.msgBundle", "slidingPanelHideText"]
}
}
showText: "show",
hideText: "hide"
},
events: {
onPanelHide: null,
onPanelShow: null,
afterPanelHide: null,
afterPanelShow: null
},
finalInitFunction: "fluid.slidingPanel.finalInit",
listeners: {
"onCreate.bindClick": {
"this": "{that}.dom.toggleButton",
"method": "click",
"args": ["{that}.togglePanel"]
},
"onCreate.bindModelChange": {
listener: "{that}.applier.modelChanged.addListener",
args: ["isShowing", "{that}.refreshView"]
},
"onCreate.setInitialState": {
listener: "{that}.refreshView"
},
"onPanelHide.setText": {
"this": "{that}.dom.toggleButtonLabel",
"method": "text",
"args": ["{that}.options.strings.showText"],
"priority": "first"
},
"onPanelShow.setText": {
"this": "{that}.dom.toggleButtonLabel",
"method": "text",
"args": ["{that}.options.strings.hideText"],
"priority": "first"
},
"onPanelHide.operate": {
listener: "{that}.operateHide"
},
"onPanelShow.operate": {
listener: "{that}.operateShow"
}
},
invokers: {
operateHide: "fluid.slidingPanel.slideUp",
operateShow: "fluid.slidingPanel.slideDown"
operateHide: {
"this": "{that}.dom.panel",
"method": "slideUp",
"args": ["{that}.options.animationDurations.hide", "{that}.events.afterPanelHide.fire"]
},
operateShow: {
"this": "{that}.dom.panel",
"method": "slideDown",
"args": ["{that}.options.animationDurations.show", "{that}.events.afterPanelShow.fire"]
},
hidePanel: {
func: "{that}.applier.requestChange",
args: ["isShowing", false]
},
showPanel: {
func: "{that}.applier.requestChange",
args: ["isShowing", true]
},
togglePanel: {
funcName: "fluid.slidingPanel.togglePanel",
args: ["{that}"]
},
refreshView: {
funcName: "fluid.slidingPanel.refreshView",
args: ["{that}"]
}
},
model: {
isShowing: false
},
methods: {
showPanel: {
finalState: true,
name: "Show"
},
hidePanel: {
finalState: false,
name: "Hide"
}
animationDurations: {
hide: 400,
show: 400
}
});

fluid.slidingPanel.lookupMsg = function (messageResolver, value) {
var looked = messageResolver.lookup([value]);
return looked ? looked.template : looked;
};

fluid.slidingPanel.slideUp = function (element, callback, duration) {
$(element).slideUp(duration || "400", callback);
fluid.slidingPanel.togglePanel = function (that) {
that.applier.requestChange("isShowing", !that.model.isShowing);
};

fluid.slidingPanel.slideDown = function (element, callback, duration) {
$(element).slideDown(duration || "400", callback);
};

fluid.slidingPanel.finalInit = function (that) {
fluid.each(that.options.methods, function (method, methodName) {
that[methodName] = function () {
that.events["onPanel" + method.name].fire(that);
that.applier.requestChange("isShowing", method.finalState);
that.refreshView();
that["operate" + method.name](that.locate("panel"), that.events["afterPanel" + method.name].fire);
};
});

that.togglePanel = function () {
that[that.model.isShowing ? "hidePanel" : "showPanel"]();
};

that.setPanelHeight = function (newHeight) {
that.locate("panel").height(newHeight);
};

that.refreshView = function () {
that.locate("toggleButton").text(that.options.strings[that.model.isShowing ? "hideText" : "showText"]);
};

that.locate("toggleButton").click(that.togglePanel);

that.refreshView();
fluid.slidingPanel.refreshView = function (that) {
that.events[that.model.isShowing ? "onPanelShow" : "onPanelHide"].fire();
};

})(jQuery, fluid_1_5);
})(jQuery, fluid_1_5);
3 changes: 3 additions & 0 deletions src/framework/core/js/Fluid.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,9 @@ var fluid = fluid || fluid_1_5;
};

fluid.isPlainObject = function (totest) {
if (!totest) {
return false; // FLUID-5172 - on IE8 the line below produces [object Object] rather than [object Null] or [object Undefined]
}
var string = Object.prototype.toString.call(totest);
return string === "[object Array]" || string === "[object Object]";
};
Expand Down
2 changes: 1 addition & 1 deletion src/framework/preferences/css/PrefsEditor.css
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@
content: "\e011";
}
.fl-prefsEditor .fl-icon-toc:before {
content: "\e012";
content: "\e012";
}

/* Theming */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<input type="checkbox" id="links-choice" class="flc-prefsEditor-links fl-force-left" />
<label class="flc-prefsEditor-links-choice-label" for="links-choice"></label>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<input type="checkbox" id="inputs-choice" class="flc-prefsEditor-inputs-larger fl-force-left" />
<label class="flc-prefsEditor-links-inputs-choice-label" for="inputs-choice"></label>
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ <h2><span class="fl-icon-toc"></span><span class="flc-prefsEditor-toc-label head
<div class="fl-prefsEditor-onoff">
<input type="checkbox" id="toc-choice" class="flc-prefsEditor-toc" />
<label for="toc-choice">
<span class="fl-prefsEditor-switch" data-checkboxStateOn="ON" data-checkboxStateOff="OFF">
<span class="fl-prefsEditor-switch-inner"></span>
</span>
<span class="fl-prefsEditor-switch" data-checkboxStateOn="ON" data-checkboxStateOff="OFF">
<span class="fl-prefsEditor-switch-inner"></span>
</span>
<span class="flc-prefsEditor-toc-choice-label"></span>
</label>
</div>
11 changes: 0 additions & 11 deletions src/framework/preferences/html/PrefsEditorTemplate-links.html

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<h2><span class="fl-icon-links"></span><span class="flc-prefsEditor-linksControls-label heading-text"></span></h2>
<ul class="fl-inputs fl-links-buttons-options">
<li class="flc-prefsEditor-emphasizeLinks"></li>
<li class="flc-prefsEditor-inputsLarger"></li>
</ul>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h2>
<span class="fl-icon-font"></span>
<label class="flc-prefsEditor-text-font-label" for="text-font"></label>
<span class="fl-icon-font"></span>
<label class="flc-prefsEditor-text-font-label" for="text-font"></label>
</h2>
<select class="flc-prefsEditor-text-font fl-inputs" id="text-font"></select>
14 changes: 7 additions & 7 deletions src/framework/preferences/html/SeparatedPanelPrefsEditor.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<form id="options" action="" class="flc-prefsEditor-separatedPanel-tabs fl-prefsEditor">
<div class="flc-prefsEditor-controls">
<ul class="fl-prefsEditor-panels">
<li class="fl-prefsEditor-panel"><div class="flc-prefsEditor-text-size"></div></li>
<li class="fl-prefsEditor-panel"><div class="flc-prefsEditor-text-font"></div></li>
<li class="fl-prefsEditor-panel"><div class="flc-prefsEditor-line-space"></div></li>
<li class="fl-prefsEditor-panel"><div class="flc-prefsEditor-contrast"></div></li>
<li class="fl-prefsEditor-panel"><div class="flc-prefsEditor-layout-controls"></div></li>
<li class="fl-prefsEditor-panel"><div class="flc-prefsEditor-links-controls"></div></li>
</ul>
<li class="fl-prefsEditor-panel"><div class="flc-prefsEditor-text-size"></div></li>
<li class="fl-prefsEditor-panel"><div class="flc-prefsEditor-text-font"></div></li>
<li class="fl-prefsEditor-panel"><div class="flc-prefsEditor-line-space"></div></li>
<li class="fl-prefsEditor-panel"><div class="flc-prefsEditor-contrast"></div></li>
<li class="fl-prefsEditor-panel"><div class="flc-prefsEditor-layout-controls"></div></li>
<li class="fl-prefsEditor-panel"><div class="flc-prefsEditor-links-controls"></div></li>
</ul>
</div>
</form>
Loading

0 comments on commit a15346d

Please sign in to comment.