Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'demo' of github.com:fluid-project/infusion into demo

  • Loading branch information...
commit 380d46c69261ffb778ee472a6787df2021bfc7cc 2 parents 6a0b736 + dda0025
@yzen yzen authored
View
2  src/webapp/components/tableOfContents/html/TableOfContents.html
@@ -1,5 +1,5 @@
<!-- Table of contents template -->
-<h1>Table of Contents</h1>
+<h1 class="flc-tableOfContents-exclude">Table of Contents</h1>
<ul class="flc-toc-levels-level1">
<li class="flc-toc-levels-items1">
<a class="flc-toc-levels-link1" href="">1</a>
View
38 src/webapp/components/tableOfContents/js/TableOfContents.js
@@ -43,16 +43,25 @@ var fluid_1_5 = fluid_1_5 || {};
};
/**
- * Invoker function to filter headings. Default is to filter out the visible headings.
+ * Invoker function to filter headings. Default is to filter out the visible headings
+ * that don't have a special 'exclusion' class.
* @param Object Contains a list of headings, usually generated by that.locate("headings")
* @return filtered headings
*/
- fluid.tableOfContents.filterHeadings = function (headings) {
- return headings.filter(":visible");
+ fluid.tableOfContents.filterHeadings = function (headings, exclude) {
+ return headings.filter(":visible").filter('[class!="' + exclude + '"]');
};
+ fluid.tableOfContents.regenerateToc = function (that) {
+ var headings = that.filterHeadings(that.locate("headings"), that.options.selectors.exclude);
+ that.anchorInfo = fluid.transform(headings, function (heading) {
+ return that.headingTextToAnchor(heading);
+ });
+ var headingsModel = that.modelBuilder.assembleModel(headings, that.anchorInfo);
+ that.applier.requestChange("", headingsModel);
+ };
+
fluid.tableOfContents.finalInit = function (that) {
- var headings = that.filterHeadings(that.locate("headings"));
that.headingTextToAnchor = function (heading) {
var guid = that.generateGUID();
@@ -66,9 +75,6 @@ var fluid_1_5 = fluid_1_5 || {};
return anchorInfo;
};
- that.anchorInfo = fluid.transform(headings, function (heading) {
- return that.headingTextToAnchor(heading);
- });
// TODO: is it weird to have hide and show on a component?
that.hide = function () {
@@ -79,9 +85,12 @@ var fluid_1_5 = fluid_1_5 || {};
that.locate("tocContainer").show();
};
- var headingsModel = that.modelBuilder.assembleModel(headings, that.anchorInfo);
-
- that.applier.requestChange("", headingsModel);
+ that.applier.modelChanged.addListener("headingsModel", function () {
+ if (that.levels) {
+ that.levels.refreshView();
+ }
+ });
+ that.regenerateToc();
that.events.onReady.fire();
};
@@ -112,11 +121,16 @@ var fluid_1_5 = fluid_1_5 || {};
invokers: {
insertAnchor: "fluid.tableOfContents.insertAnchor",
generateGUID: "fluid.tableOfContents.generateGUID",
- filterHeadings: "fluid.tableOfContents.filterHeadings"
+ filterHeadings: "fluid.tableOfContents.filterHeadings",
+ regenerateToc: {
+ funcName: "fluid.tableOfContents.regenerateToc",
+ args: "{that}"
+ }
},
selectors: {
headings: ":header",
- tocContainer: ".flc-toc-tocContainer"
+ tocContainer: ".flc-toc-tocContainer",
+ exclude: "flc-tableOfContents-exclude"
},
events: {
onReady: null,
View
50 src/webapp/components/uiOptions/css/FatPanelUIOptions.css
@@ -1,35 +1,53 @@
+@font-face {
+ font-family: 'OpenSans';
+ src:url('fonts/OpenSans-Light.ttf');
+ font-weight: normal;
+ font-style: normal;
+}
+
/* Top bar and show/hide button */
+
.fl-uiOptions-fatPanel .fl-panelBar {
- height: 1em;
+ width: 100%;
+ background-color: #fff;
+ border-bottom: 1px solid #ccc;
}
-.fl-uiOptions-fatPanel .fl-panelBar ul {
- border-radius: 8px;
- border-bottom: 1px solid #ccc;
- display:inline-block;
+.fl-uiOptions-fatPanel .fl-panelBar .fl-uio-tabs {
box-shadow: 2px 2px 3px 0px #6f6f6f;
- float: right;
- margin-right: 10em;
-}
-
-.fl-uiOptions-fatPanel .fl-panelBar ul li {
- display:inline;
+ border-bottom: 1px solid #ccc;
+ border-left: 1px solid #ccc;
+ border-bottom-left-radius:8px;
+ border-bottom-right-radius:8px;
+ background-color: white;
+ min-height: 2em;
+ margin-right: 10em;
+ display:block;
+ float:right;
}
.fl-uiOptions-fatPanel .fl-toggleButton,
.fl-uiOptions-fatPanel .fl-uiOptions-reset {
- float:right;
text-transform: lowercase;
font-weight: bold;
- border: 0px;
- background-color: white;
- padding: 0.5em;
+ border:0;
+ background-color: white;
+ height: 2em;
+ color: #2f2b2a
+ font-family: 'OpenSans',"Myriad Pro", Helvetica, Arial, sans-serif;
+ font-size: 1.1em;
+ margin-right: 0.5em;
+ margin-left: 0.5em;
}
.fl-uiOptions-fatPanel .fl-uiOptions-reset {
border-right: 1px solid #ccc;
}
+.fl-uiOptions-fatPanel .fl-toggleButton {
+ min-width: 15em;
+}
+
/* IFrame */
.fl-uiOptions-fatPanel-iframe {
border: 0;
@@ -61,4 +79,4 @@
.fl-theme-yb,
.fl-theme-yb .fl-uiOptions-fatPanel .fl-panelBar,
.fl-theme-yb .fl-uiOptions-fatPanel .fl-toggleButton,
-.fl-theme-yb .fl-uiOptions-fatPanel .fl-uiOptions-reset { background-color: #000; border-color: #ffff00; color: #ffff00 }
+.fl-theme-yb .fl-uiOptions-fatPanel .fl-uiOptions-reset { background-color: #000; border-color: #ffff00; color: #ffff00 }
View
7 src/webapp/components/uiOptions/css/FatPanelUIOptionsFrame.css
@@ -1,12 +1,13 @@
@font-face {
font-family: 'OpenSans';
- src:url('fonts/OpenSans-Regular.ttf');
+ src:url('fonts/OpenSans-Light.ttf');
font-weight: normal;
font-style: normal;
}
.fl-uiOptions-fatPanel .fl-uiOptions {
font-family: 'OpenSans',"Myriad Pro", Helvetica, Arial, sans-serif;
+ line-height: 1.2em !important; /* FLUID-4959: fix the line height so it doesn't scale with the UIO line spacing scaling. */
}
/* UI Options Fat Panel styles */
@@ -189,6 +190,10 @@
float:left;
}
+.fl-uiOptions-fatPanel .fl-uiOptions-fatPanel-toc label {
+ line-height: 1.7em !important;
+}
+
.fl-uiOptions-fatPanel .fl-uiOptions-fatPanel-option-description {
padding: 0; /* override .fl-uiOptions-option-description style. */
display: inline-block;
View
6 src/webapp/components/uiOptions/css/UIOptions.css
@@ -240,7 +240,7 @@
font-style: normal;
}
-.fl-icon-size, .fl-icon-contrast, .fl-icon-triangle, .fl-icon-simplify, .fl-icon-line-space, .fl-icon-links, .fl-icon-font-style, .fl-icon-list, .fl-icon-text-to-speech, .fl-icon-prefrences{
+.fl-icon-size, .fl-icon-contrast, .fl-icon-triangle, .fl-icon-simplify, .fl-icon-line-space, .fl-icon-links, .fl-icon-font-style, .fl-icon-list, .fl-icon-text-to-speech, .fl-icon-prefrences, .fl-icon-undo {
font-family: 'UIO';
speak: none;
/* Enable Ligatures */
@@ -300,4 +300,8 @@
.fl-icon-prefrences:after {
content: "\6f\70\74\69\6f\6e\73";
+}
+
+.fl-icon-undo:after {
+ content: "\75\6e\64\6f";
}
View
BIN  ...mponents/uiOptions/css/fonts/OpenSans-Regular.ttf → ...components/uiOptions/css/fonts/OpenSans-Light.ttf
Binary file not shown
View
3  src/webapp/components/uiOptions/html/FatPanelUIOptionsFrame.html
@@ -53,7 +53,8 @@
</head>
<body class="fl-uiOptions-fatPanel fl-focus">
- <div class="flc-toc-tocContainer fl-hidden">
+ <div class="fl-hidden">
+ <div class="flc-toc-tocContainer"></div>
</div>
</body>
View
4 src/webapp/components/uiOptions/js/SlidingPanel.js
@@ -30,8 +30,8 @@ var fluid_1_5 = fluid_1_5 || {};
toggleButton: ".flc-slidingPanel-toggleButton"
},
strings: {
- showText: "Display Preferences",
- hideText: "Display Preferences"
+ showText: "+ Show Display Preferences",
+ hideText: "- Hide Display Preferences"
},
events: {
onPanelHide: null,
View
7 src/webapp/demos/uiOptions/css/uiOptions.css
@@ -115,9 +115,6 @@ img {
font-style: italic;
}
-.fl-uiOptions-fatPanel .fl-toggleButton {
- margin-right: 80px;
-}
/* Scoped colours for theme swapping */
/*
@@ -152,13 +149,15 @@ img {
}
/* Overriding some of the default Fat Panel UI Options colours */
-.uio-demo-theme .fl-uiOptions-fatPanel .fl-panelBar {
+.fl-uiOptions-fatPanel .fl-panelBar .fl-uio-tabs {
background-color: #0071BC;
}
+
.uio-demo-theme .fl-uiOptions-fatPanel .fl-toggleButton,
.uio-demo-theme .fl-uiOptions-fatPanel .fl-uiOptions-reset {
font-family: "Myriad Pro", Helvetica, Tahoma, Verdana, sans-serif;
border-radius: 0;
background-color: #0071BC;
color: white;
+ text-transform: uppercase;
}
View
10 src/webapp/demos/uiOptions/html/uiOptions.html
@@ -69,7 +69,7 @@
demo.initFatPanel(".flc-uiOptions-fatPanel");
})
</script>
-
+
<!-- BEGIN markup for fat-panel UI Options -->
<div class="flc-uiOptions-fatPanel fl-uiOptions-fatPanel">
<!-- This is the div that will contain the UI Options component -->
@@ -77,12 +77,14 @@
<!-- This div is for the sliding panel that shows and hides the UI Options controls -->
<div class="fl-panelBar">
- <button class="flc-slidingPanel-toggleButton fl-toggleButton">Show/Hide</button>
- <button id="reset" class="flc-uiOptions-reset fl-uiOptions-reset">Reset</button>
+ <span class="fl-uio-tabs">
+ <button id="reset" class="flc-uiOptions-reset fl-uiOptions-reset">Reset</button>
+ <button id="show-hide" class="flc-slidingPanel-toggleButton fl-toggleButton">Show/Hide</button>
+ </span>
</div>
</div>
<!-- END markup for fat-panel UI Options -->
-
+
<div class="fl-force-right fl-push disp-opts-buttons">
<div class="disp-opts-button-container fl-inverted-color">
<button class="disp-opts-with-preview disp-opts-button">Display Preferences<br/><span class="preview">(with preview)</span></button>
View
8 src/webapp/integration-demos/uiOptions/ClimateChange.html
@@ -81,10 +81,10 @@
<!-- This div is for the sliding panel that shows and hides the UI Options controls -->
<div class="fl-panelBar">
- <ul>
- <li><button class="flc-slidingPanel-toggleButton fl-toggleButton">Show/Hide</button></li>
- <li><button id="reset" class="flc-uiOptions-reset fl-uiOptions-reset">Reset</button></li>
- </ul>
+ <span class="fl-uio-tabs">
+ <button id="reset" class="flc-uiOptions-reset fl-uiOptions-reset">Reset</button>
+ <button id="show-hide" class="flc-slidingPanel-toggleButton fl-toggleButton">Show/Hide</button>
+ </span>
</div>
</div>
<!-- END markup for fat-panel UI Options -->
View
30 src/webapp/integration-demos/uiOptions/js/uiOptionsDemo.js
@@ -6,9 +6,15 @@
var pathToTemplates = "../../components/uiOptions/html/";
var extraSiteSettings = {
- simplifiedContent: false,
- selfVoicing: false
- };
+ simplifiedContent: false,
+ selfVoicing: false
+ };
+
+ demo.updateToc = function (tocEnactor) {
+ if (tocEnactor.tableOfContents) {
+ tocEnactor.tableOfContents.regenerateToc();
+ }
+ };
demo.initPageEnhancer = function (customThemeName) {
fluid.pageEnhancer({
@@ -19,6 +25,24 @@
theme: {
"default": customThemeName
}
+ },
+ components: {
+ simplifiedContent: {
+ options: {
+ listeners: {
+ settingChanged: "{uiEnhancer}.events.simplifyContentChanged"
+ }
+ }
+ }
+ },
+ events: {
+ simplifyContentChanged: null
+ },
+ listeners: {
+ simplifyContentChanged: {
+ listener: "demo.updateToc",
+ args: "{that}.tableOfContents"
+ }
}
});
};
View
33 src/webapp/integration-demos/uiOptions/js/uiOptionsExtra.js
@@ -128,9 +128,15 @@ var fluid_1_5 = fluid_1_5 || {};
selectors: {
content: ".flc-uiOptions-content"
},
+ styles: {
+ simplified: "fl-uiOptins-content-simplified"
+ },
model: {
value: false
},
+ events: {
+ settingChanged: null
+ },
invokers: {
set: {
funcName: "fluid.uiOptions.actionAnts.simplifiedContentEnactor.set",
@@ -147,26 +153,32 @@ var fluid_1_5 = fluid_1_5 || {};
fluid.uiOptions.actionAnts.simplifiedContentEnactor.set = function (value, that) {
var contentContainer = that.container.find(that.options.selectors.content);
+ var simplified = contentContainer.hasClass(that.options.styles.simplified);
if (!that.initialContent || !that.article) {
that.initialContent = contentContainer.html();
- $("aside", that.container).addClass("fl-hidden");
- $("img", that.container).css("float", "none");
- $("figure", that.container).css("float", "none");
- var article = contentContainer.find("article").html();
+ var articleDom = contentContainer.find("article").clone();
+ $("aside", articleDom).remove();
+ $("img", articleDom).css("float", "none");
+ $("figure", articleDom).css("float", "none");
+ var article = articleDom.html();
that.article = article ? article : that.initialContent;
that.origBg = $("body").css("background-image");
}
if (value) {
- if (contentContainer.html() !== that.article) {
+ if (!simplified) {
$("body").css("background-image", "none");
contentContainer.html(that.article);
+ contentContainer.addClass(that.options.styles.simplified);
+ that.events.settingChanged.fire();
}
} else {
- if (contentContainer.html() !== that.initialContent) {
+ if (simplified) {
$("body").css("background-image", that.origBg);
contentContainer.html(that.initialContent);
+ contentContainer.removeClass(that.options.styles.simplified);
+ that.events.settingChanged.fire();
}
}
};
@@ -189,6 +201,7 @@ var fluid_1_5 = fluid_1_5 || {};
simplifiedContent: {
type: "fluid.uiOptions.actionAnts.simplifiedContentEnactor",
container: "{uiEnhancer}.container",
+ createOnEvent: "onCreateSimplifiedContent",
options: {
sourceApplier: "{uiEnhancer}.applier",
rules: {
@@ -205,7 +218,15 @@ var fluid_1_5 = fluid_1_5 || {};
}
}
}
+ },
+ events: {
+ onCreateSimplifiedContent: null
}
});
+ fluid.uiEnhancer.extraActions.finalInit = function (that) {
+ $(document).ready(function () {
+ that.events.onCreateSimplifiedContent.fire();
+ });
+ };
})(jQuery, fluid_1_5);
Please sign in to comment.
Something went wrong with that request. Please try again.