mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
allow cssmanager to manage outer_ace
This commit is contained in:
parent
548f31a46a
commit
f31db205da
3 changed files with 110 additions and 89 deletions
|
@ -313,7 +313,7 @@ window.onload = function () {\n\
|
||||||
|
|
||||||
// bizarrely, in FF2, a file with no "external" dependencies won't finish loading properly
|
// bizarrely, in FF2, a file with no "external" dependencies won't finish loading properly
|
||||||
// (throbs busy while typing)
|
// (throbs busy while typing)
|
||||||
outerHTML.push('<link rel="stylesheet" type="text/css" href="data:text/css,"/>', scriptTag(outerScript), '</head><body id="outerdocbody"><div id="sidediv"><!-- --></div><div id="linemetricsdiv">x</div><div id="overlaysdiv"><!-- --></div></body></html>');
|
outerHTML.push('<style type="text/css" title="dynamicsyntax"></style>', '<link rel="stylesheet" type="text/css" href="data:text/css,"/>', scriptTag(outerScript), '</head><body id="outerdocbody"><div id="sidediv"><!-- --></div><div id="linemetricsdiv">x</div><div id="overlaysdiv"><!-- --></div></body></html>');
|
||||||
|
|
||||||
var outerFrame = document.createElement("IFRAME");
|
var outerFrame = document.createElement("IFRAME");
|
||||||
outerFrame.name = "ace_outer";
|
outerFrame.name = "ace_outer";
|
||||||
|
|
|
@ -167,12 +167,14 @@ function Ace2Inner(){
|
||||||
}
|
}
|
||||||
|
|
||||||
var dynamicCSS = null;
|
var dynamicCSS = null;
|
||||||
|
var outerDynamicCSS = null;
|
||||||
var parentDynamicCSS = null;
|
var parentDynamicCSS = null;
|
||||||
|
|
||||||
function initDynamicCSS()
|
function initDynamicCSS()
|
||||||
{
|
{
|
||||||
dynamicCSS = makeCSSManager("dynamicsyntax");
|
dynamicCSS = makeCSSManager("dynamicsyntax");
|
||||||
parentDynamicCSS = makeCSSManager("dynamicsyntax", true);
|
outerDynamicCSS = makeCSSManager("dynamicsyntax", "outer");
|
||||||
|
parentDynamicCSS = makeCSSManager("dynamicsyntax", "parent");
|
||||||
}
|
}
|
||||||
|
|
||||||
var changesetTracker = makeChangesetTracker(scheduler, rep.apool, {
|
var changesetTracker = makeChangesetTracker(scheduler, rep.apool, {
|
||||||
|
@ -218,6 +220,7 @@ function Ace2Inner(){
|
||||||
var authorStyleSet = hooks.callAll('aceSetAuthorStyle', {
|
var authorStyleSet = hooks.callAll('aceSetAuthorStyle', {
|
||||||
dynamicCSS: dynamicCSS,
|
dynamicCSS: dynamicCSS,
|
||||||
parentDynamicCSS: parentDynamicCSS,
|
parentDynamicCSS: parentDynamicCSS,
|
||||||
|
outerDynamicCSS: outerDynamicCSS,
|
||||||
info: info,
|
info: info,
|
||||||
author: author,
|
author: author,
|
||||||
authorSelector: authorSelector,
|
authorSelector: authorSelector,
|
||||||
|
|
|
@ -20,13 +20,31 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function makeCSSManager(emptyStylesheetTitle, parentCss)
|
function makeCSSManager(emptyStylesheetTitle, doc)
|
||||||
{
|
{
|
||||||
|
if (doc === true)
|
||||||
|
{
|
||||||
|
doc = 'parent';
|
||||||
|
} else if (!doc) {
|
||||||
|
doc = 'inner';
|
||||||
|
}
|
||||||
|
|
||||||
function getSheetByTitle(title)
|
function getSheetByTitle(title)
|
||||||
{
|
{
|
||||||
if (parentCss) var allSheets = window.parent.parent.document.styleSheets;
|
if (doc === 'parent')
|
||||||
else var allSheets = document.styleSheets;
|
{
|
||||||
|
win = window.parent.parent;
|
||||||
|
}
|
||||||
|
else if (doc === 'inner') {
|
||||||
|
win = window;
|
||||||
|
}
|
||||||
|
else if (doc === 'outer') {
|
||||||
|
win = window.parent;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw "Unknown dynamic style container";
|
||||||
|
}
|
||||||
|
var allSheets = win.document.styleSheets;
|
||||||
|
|
||||||
for (var i = 0; i < allSheets.length; i++)
|
for (var i = 0; i < allSheets.length; i++)
|
||||||
{
|
{
|
||||||
|
@ -39,7 +57,7 @@ function makeCSSManager(emptyStylesheetTitle, parentCss)
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var browserSheet = getSheetByTitle(emptyStylesheetTitle, parentCss);
|
var browserSheet = getSheetByTitle(emptyStylesheetTitle);
|
||||||
|
|
||||||
function browserRules()
|
function browserRules()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue