Skip to content

Commit

Permalink
fluid-projectGH-32: disable the page level reading
Browse files Browse the repository at this point in the history
  • Loading branch information
cindyli committed Dec 20, 2022
1 parent 58a7f5f commit ebd7b55
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 39 deletions.
36 changes: 12 additions & 24 deletions src/js/enactors.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,29 +304,17 @@ uioPlus.enactor.tableOfContents.injectToCContainer = function (that) {

fluid.defaults("uioPlus.enactor.selfVoicing", {
gradeNames: ["uioPlus.contentView", "fluid.prefs.enactor.selfVoicing"],
selectors: {
controllerParentContainer: ".flc-prefs-selfVoicingWidget",
domReaderContent: ".flc-orator-content"
},
domReaderContent: ["domReaderContent", "main", "article"],
controllerParentContainer: ["controllerParentContainer", "main", "article"],
distributeOptions: [{
record: {
expander: {
funcName: "uioPlus.contentView.findFirstSelector",
args: ["{selfVoicing}.locate", "{selfVoicing}.options.controllerParentContainer", "{selfVoicing}.container"]
}
// Temporarily disable the page level reading due to these issues:
// https://issues.fluidproject.org/browse/FLUID-6760
// https://issues.fluidproject.org/browse/FLUID-6761
distributeOptions: {
removeController: {
record: "fluid.emptySubcomponent",
target: "{that orator controller}.type"
},
target: "{that orator > controller}.options.parentContainer",
namespace: "controllerParentContainer"
}, {
record: {
expander: {
funcName: "uioPlus.contentView.findFirstSelector",
args: ["{selfVoicing}.locate", "{selfVoicing}.options.domReaderContent", "{selfVoicing}.container"]
}
},
target: "{that orator}.options.components.domReader.container",
namespace: "domReaderContainer"
}]
removeDomReader: {
record: "fluid.emptySubcomponent",
target: "{that orator domReader}.type"
}
}
});
18 changes: 3 additions & 15 deletions tests/browser/js/enactorTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ fluid.defaults("uioPlus.tests.selfVoicingTester", {
name: "Self Voicing Tests",
tests: [{
name: "Model Changes",
expect: 5,
expect: 3,
sequence: [{
// The orator subcomponent is not initialized until the enactor is enabled for the first time.
func: "uioPlus.tests.assertSubComponentNotCreated",
Expand All @@ -635,26 +635,14 @@ fluid.defaults("uioPlus.tests.selfVoicingTester", {
spec: {priority: "last:testing"},
listener: "uioPlus.tests.selfVoicingTester.assertOratorInit",
args: ["{selfVoicing}"]
}, {
func: "{selfVoicing}.applier.change",
args: ["enabled", false]
}, {
changeEvent: "{selfVoicing}.applier.modelChanged",
spec: {path: "enabled", priority: "last:testing"},
listener: "jqUnit.notVisible",
args: ["The orator controller should no longer be visible", "{selfVoicing}.orator.controller.container"]
}]
}]
}]
});

uioPlus.tests.selfVoicingTester.assertOratorInit = function (that) {
var controller = that.orator.controller;
var domReader = that.orator.domReader;

jqUnit.assertTrue("The domReaders's container should be set properly", domReader.container.hasClass("flc-orator-content"));
jqUnit.assertTrue("The controller's parentContainer should be set properly", controller.options.parentContainer.hasClass("flc-prefs-selfVoicingWidget"));
jqUnit.isVisible("The orator controller should be visible", controller.container);
jqUnit.assertUndefined("The controller component is not instantiated", that.orator.controller);
jqUnit.assertUndefined("The domReaders component is not instantiated", that.orator.domReader);
};

fluid.test.runTests([
Expand Down

0 comments on commit ebd7b55

Please sign in to comment.