mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 23:46:14 -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
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* This code is mostly from the old Etherpad. Please help us to comment this code.
|
||||
* This code is mostly from the old Etherpad. Please help us to comment this code.
|
||||
* This helps other people to understand this code better and helps them to improve it.
|
||||
* TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED
|
||||
*/
|
||||
|
@ -20,14 +20,32 @@
|
|||
* 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)
|
||||
{
|
||||
if (parentCss) var allSheets = window.parent.parent.document.styleSheets;
|
||||
else var allSheets = document.styleSheets;
|
||||
|
||||
if (doc === 'parent')
|
||||
{
|
||||
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++)
|
||||
{
|
||||
var s = allSheets[i];
|
||||
|
@ -38,8 +56,8 @@ function makeCSSManager(emptyStylesheetTitle, parentCss)
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
var browserSheet = getSheetByTitle(emptyStylesheetTitle, parentCss);
|
||||
|
||||
var browserSheet = getSheetByTitle(emptyStylesheetTitle);
|
||||
|
||||
function browserRules()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue