summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-19 19:29:43 +0300
committerAndrew Dolgov <[email protected]>2021-02-19 19:29:43 +0300
commitcf249d7e8c55542ca6383b430ec77f07401e96ea (patch)
treeee56a685a38c37b86b502f293ad900c0d138fc16
parentd5f4979831a03f758e7006f96e5ad0420523da5e (diff)
modify classname helpers to use element.classList; fix feed debugger & share--get
-rwxr-xr-xclasses/feeds.php9
-rwxr-xr-xjs/common.js6
-rw-r--r--plugins/share/init.php1
3 files changed, 8 insertions, 8 deletions
diff --git a/classes/feeds.php b/classes/feeds.php
index 98a9ed249..0c01ff25a 100755
--- a/classes/feeds.php
+++ b/classes/feeds.php
@@ -626,11 +626,10 @@ class Feeds extends Handler_Protected {
]
};
</script>
- <?php
- echo javascript_tag("js/utility.js");
- echo javascript_tag("lib/dojo/dojo.js");
- echo javascript_tag("lib/dojo/tt-rss-layer.js");
- ?>
+ <?= javascript_tag("js/utility.js") ?>
+ <?= javascript_tag("js/common.js") ?>
+ <?= javascript_tag("lib/dojo/dojo.js") ?>
+ <?= javascript_tag("lib/dojo/tt-rss-layer.js") ?>
</head>
<body class="flat ttrss_utility feed_debugger css_loading">
<script type="text/javascript">
diff --git a/js/common.js b/js/common.js
index e616c70ba..6e8168357 100755
--- a/js/common.js
+++ b/js/common.js
@@ -17,15 +17,15 @@ function $$(query) {
Element.prototype.hasClassName = function(className) {
- return dojo.hasClass(this, className);
+ return this.classList.contains(className);
};
Element.prototype.addClassName = function(className) {
- return dojo.addClass(this, className);
+ return this.classList.add(className);
};
Element.prototype.removeClassName = function(className) {
- return dojo.removeClass(this, className);
+ return this.classList.remove(className);
};
Element.prototype.toggleClassName = function(className) {
diff --git a/plugins/share/init.php b/plugins/share/init.php
index 0c975cfdd..37799fba6 100644
--- a/plugins/share/init.php
+++ b/plugins/share/init.php
@@ -156,6 +156,7 @@ class Share extends Plugin {
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title><?= $line["title"] ?></title>
+ <?= javascript_tag("js/common.js") ?>
<?= javascript_tag("js/utility.js") ?>
<style type='text/css'>
@media (prefers-color-scheme: dark) {