modify classname helpers to use element.classList; fix feed debugger & share--get

This commit is contained in:
Andrew Dolgov 2021-02-19 19:29:43 +03:00
parent d5f4979831
commit cf249d7e8c
3 changed files with 8 additions and 8 deletions

View File

@ -626,11 +626,10 @@ class Feeds extends Handler_Protected {
] ]
}; };
</script> </script>
<?php <?= javascript_tag("js/utility.js") ?>
echo javascript_tag("js/utility.js"); <?= javascript_tag("js/common.js") ?>
echo javascript_tag("lib/dojo/dojo.js"); <?= javascript_tag("lib/dojo/dojo.js") ?>
echo javascript_tag("lib/dojo/tt-rss-layer.js"); <?= javascript_tag("lib/dojo/tt-rss-layer.js") ?>
?>
</head> </head>
<body class="flat ttrss_utility feed_debugger css_loading"> <body class="flat ttrss_utility feed_debugger css_loading">
<script type="text/javascript"> <script type="text/javascript">

View File

@ -17,15 +17,15 @@ function $$(query) {
Element.prototype.hasClassName = function(className) { Element.prototype.hasClassName = function(className) {
return dojo.hasClass(this, className); return this.classList.contains(className);
}; };
Element.prototype.addClassName = function(className) { Element.prototype.addClassName = function(className) {
return dojo.addClass(this, className); return this.classList.add(className);
}; };
Element.prototype.removeClassName = function(className) { Element.prototype.removeClassName = function(className) {
return dojo.removeClass(this, className); return this.classList.remove(className);
}; };
Element.prototype.toggleClassName = function(className) { Element.prototype.toggleClassName = function(className) {

View File

@ -156,6 +156,7 @@ class Share extends Plugin {
<head> <head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title><?= $line["title"] ?></title> <title><?= $line["title"] ?></title>
<?= javascript_tag("js/common.js") ?>
<?= javascript_tag("js/utility.js") ?> <?= javascript_tag("js/utility.js") ?>
<style type='text/css'> <style type='text/css'>
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {