Browse Source

do not enforce strict mode for plugins

Andrew Dolgov 1 year ago
parent
commit
a72643257a
2 changed files with 10 additions and 3 deletions
  1. 4 1
      index.php
  2. 6 2
      prefs.php

+ 4 - 1
index.php

@@ -117,7 +117,10 @@
 
 		print get_minified_js(["tt-rss.js",
 			"functions.js", "feedlist.js", "viewfeed.js", "PluginHost.js"]);
-
+	?>
+	</script>
+	<script type="text/javascript">
+	<?php
 		foreach (PluginHost::getInstance()->get_plugins() as $n => $p) {
 			if (method_exists($p, "get_js")) {
 				echo "try {";

+ 6 - 2
prefs.php

@@ -77,10 +77,16 @@
 	} ?>
 
 	<script type="text/javascript">
+		'use strict';
 		require({cache:{}});
 	<?php
 		require_once 'lib/jshrink/Minifier.php';
 
+		print get_minified_js(["functions.js", "prefs.js"]);
+	?>
+	</script>
+	<script type="text/javascript">
+	<?php
 		foreach (PluginHost::getInstance()->get_plugins() as $n => $p) {
 			if (method_exists($p, "get_prefs_js")) {
 				echo "try {";
@@ -92,8 +98,6 @@
 			}
 		}
 
-		print get_minified_js(["functions.js", "prefs.js"]);
-
 		init_js_translations();
 	?>
 	</script>