diff --git a/Resources/Plugins/clear-columns/.meta b/Resources/Plugins/clear-columns/.meta index 3b87fc58..806c1b36 100644 --- a/Resources/Plugins/clear-columns/.meta +++ b/Resources/Plugins/clear-columns/.meta @@ -11,4 +11,7 @@ chylex 1.0 [website] -https://tweetduck.chylex.com \ No newline at end of file +https://tweetduck.chylex.com + +[requires] +1.4.1 \ No newline at end of file diff --git a/Resources/Plugins/clear-columns/browser.js b/Resources/Plugins/clear-columns/browser.js index b8e1c3cf..500ee1b4 100644 --- a/Resources/Plugins/clear-columns/browser.js +++ b/Resources/Plugins/clear-columns/browser.js @@ -62,14 +62,11 @@ enabled(){ ].join("")); // load custom style - var style = document.createElement("style"); - document.head.appendChild(style); - - var sheet = style.sheet; - sheet.insertRule(".column-title { margin-right: 60px !important; }", 0); - sheet.insertRule(".column-type-message .column-title { margin-right: 115px !important; }", 0); - sheet.insertRule(".mark-all-read-link { right: 59px !important; }", 0); - sheet.insertRule(".open-compose-dm-link { right: 90px !important; }", 0); + var css = window.TDPF_createCustomStyle(this); + css.insert(".column-title { margin-right: 60px !important; }"); + css.insert(".column-type-message .column-title { margin-right: 115px !important; }"); + css.insert(".mark-all-read-link { right: 59px !important; }"); + css.insert(".open-compose-dm-link { right: 90px !important; }"); } ready(){ diff --git a/Resources/Plugins/design-revert/.meta b/Resources/Plugins/design-revert/.meta index fd76f6f0..8aeb9e54 100644 --- a/Resources/Plugins/design-revert/.meta +++ b/Resources/Plugins/design-revert/.meta @@ -12,4 +12,7 @@ chylex 1.0 [website] -https://tweetduck.chylex.com \ No newline at end of file +https://tweetduck.chylex.com + +[requires] +1.4.1 \ No newline at end of file diff --git a/Resources/Plugins/design-revert/browser.js b/Resources/Plugins/design-revert/browser.js index 65e341a0..14bd1a77 100644 --- a/Resources/Plugins/design-revert/browser.js +++ b/Resources/Plugins/design-revert/browser.js @@ -1,15 +1,11 @@ enabled(){ // add a stylesheet to change tweet actions - var style = document.createElement("style"); - style.id = "design-revert"; - document.head.appendChild(style); - - var sheet = style.sheet; - sheet.insertRule(".tweet-actions { float: right !important; width: auto !important; }", 0); - sheet.insertRule(".tweet-action { opacity: 0; }", 0); - sheet.insertRule(".is-favorite .tweet-action, .is-retweet .tweet-action { opacity: 0.5; visibility: visible !important; }", 0); - sheet.insertRule(".tweet:hover .tweet-action, .is-favorite .tweet-action[rel='favorite'], .is-retweet .tweet-action[rel='retweet'] { opacity: 1; visibility: visible !important; }", 0); - sheet.insertRule(".tweet-actions > li:nth-child(4) { margin-right: 2px !important; }", 0); + this.css = window.TDPF_createCustomStyle(this); + this.css.insert(".tweet-actions { float: right !important; width: auto !important; }"); + this.css.insert(".tweet-action { opacity: 0; }"); + this.css.insert(".is-favorite .tweet-action, .is-retweet .tweet-action { opacity: 0.5; visibility: visible !important; }"); + this.css.insert(".tweet:hover .tweet-action, .is-favorite .tweet-action[rel='favorite'], .is-retweet .tweet-action[rel='retweet'] { opacity: 1; visibility: visible !important; }"); + this.css.insert(".tweet-actions > li:nth-child(4) { margin-right: 2px !important; }"); // revert small links around the tweet this.prevFooterMustache = TD.mustaches["status/tweet_single_footer.mustache"]; @@ -31,7 +27,8 @@ ready(){ } disabled(){ - $("#design-revert").remove(); + this.css.remove(); + $(document).off("uiShowActionsMenu", this.uiShowActionsMenuEvent); TD.mustaches["status/tweet_single_footer.mustache"] = this.prevFooterMustache; } \ No newline at end of file diff --git a/Resources/Plugins/timeline-polls/.meta b/Resources/Plugins/timeline-polls/.meta index ac20064b..34729e76 100644 --- a/Resources/Plugins/timeline-polls/.meta +++ b/Resources/Plugins/timeline-polls/.meta @@ -12,4 +12,7 @@ chylex 1.0 [website] -https://tweetduck.chylex.com \ No newline at end of file +https://tweetduck.chylex.com + +[requires] +1.4.1 \ No newline at end of file diff --git a/Resources/Plugins/timeline-polls/browser.js b/Resources/Plugins/timeline-polls/browser.js index 4d14dd9c..369c7500 100644 --- a/Resources/Plugins/timeline-polls/browser.js +++ b/Resources/Plugins/timeline-polls/browser.js @@ -6,12 +6,8 @@ constructor(){ enabled(){ // add a stylesheet - var style = document.createElement("style"); - style.id = "timeline-polls"; - document.head.appendChild(style); - - var sheet = style.sheet; - sheet.insertRule(".column-detail .timeline-poll-container { display: none }", 0); + this.css = window.TDPF_createCustomStyle(this); + this.css.insert(".column-detail .timeline-poll-container { display: none }"); // setup layout injecting this.prevMustaches = {}; @@ -29,6 +25,6 @@ enabled(){ } disabled(){ - $("#timeline-polls").remove(); + this.css.remove(); Object.keys(this.prevMustaches).forEach(mustache => TD.mustaches[mustache] = this.prevMustaches[mustache]); } \ No newline at end of file