1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-14 03:15:49 +02:00

Add ID to <html> for selector priority

This commit is contained in:
chylex 2017-11-10 14:14:50 +01:00
parent 330bbfbb31
commit 09abd889e9
2 changed files with 5 additions and 3 deletions
Core/Notification
Resources/Scripts

View File

@ -5,7 +5,7 @@
namespace TweetDuck.Core.Notification{
sealed class TweetNotification{
private const string DefaultHeadLayout = @"<html class='os-windows txt-size--14' data-td-font='medium' data-td-theme='dark'><head><meta charset='utf-8'><meta http-equiv='X-UA-Compatible' content='chrome=1'><link rel='stylesheet' href='https://ton.twimg.com/tweetdeck-web/web/css/font.5ef884f9f9.css'><link rel='stylesheet' href='https://ton.twimg.com/tweetdeck-web/web/css/app-dark.5631e0dd42.css'><style type='text/css'>body{background:#222426}</style>";
private const string DefaultHeadLayout = @"<html id='tduck' class='os-windows txt-size--14' data-td-font='medium' data-td-theme='dark'><head><meta charset='utf-8'><meta http-equiv='X-UA-Compatible' content='chrome=1'><link rel='stylesheet' href='https://ton.twimg.com/tweetdeck-web/web/css/font.5ef884f9f9.css'><link rel='stylesheet' href='https://ton.twimg.com/tweetdeck-web/web/css/app-dark.5631e0dd42.css'><style type='text/css'>body{background:#222426}</style>";
private static readonly string CustomCSS = ScriptLoader.LoadResource("styles/notification.css");
public static TweetNotification Example(string html, int characters){

View File

@ -271,7 +271,7 @@
let themeName = TD.settings.getTheme();
let tags = [
`<html class='os-windows ${themeName} ${(doc.getAttribute("class").match(/txt-\S+/) || [ "txt-size--14" ])[0]}' data-td-font='${fontSizeName}' data-td-theme='${themeName}'><head>`
"<html "+Array.prototype.map.call(document.documentElement.attributes, ele => `${ele.name}="${ele.value}"`).join(" ")+"><head>"
];
$(document.head).children("link[href*='css/font.']:first,link[href*='css/app-"+themeName+".']:first,meta[charset],meta[http-equiv]").each(function(){
@ -309,7 +309,7 @@
})();
//
// Block: Fix OS name.
// Block: Fix OS name and add ID to the document for priority CSS selectors.
//
if (ensurePropertyExists(TD, "util", "getOSName")){
TD.util.getOSName = function(){
@ -320,6 +320,8 @@
doc.classList.add("os-windows");
}
doc.id = "tduck";
//
// Block: Enable popup notifications.
//