Browse Source

js: enable strict mode

Andrew Dolgov 1 year ago
parent
commit
cfc197038f
8 changed files with 18 additions and 2 deletions
  1. 2 0
      js/common.js
  2. 2 0
      js/dict.js
  3. 2 0
      js/index.js
  4. 2 0
      js/offline.js
  5. 2 0
      js/read.js
  6. 2 0
      js/reader.js
  7. 2 0
      offline.html
  8. 4 2
      read.html

+ 2 - 0
js/common.js

@@ -1,3 +1,5 @@
+'use strict';
+
 $.urlParam = function(name){
 	try {
 		var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);

+ 2 - 0
js/dict.js

@@ -1,3 +1,5 @@
+'use strict';
+
 $(document).ready(function() {
 	$(window).on("mouseup touchend", function() {
 		if (!navigator.onLine) return;

+ 2 - 0
js/index.js

@@ -1,3 +1,5 @@
+'use strict';
+
 function cache_refresh(force) {
 	if ('serviceWorker' in navigator) {
 		localforage.getItem("epube.cache-timestamp").then(function(stamp) {

+ 2 - 0
js/offline.js

@@ -1,3 +1,5 @@
+'use strict';
+
 function offline_search(form) {
 	var query = $(".search_query").val();
 

+ 2 - 0
js/read.js

@@ -1,3 +1,5 @@
+'use strict';
+
 var _store_position = 0;
 var _enable_fullscreen = 0;
 

+ 2 - 0
js/reader.js

@@ -1,3 +1,5 @@
+'use strict';
+
 $(document).ready(function() {
 	$(window).on("click tap", function() {
 		if (parent.$(".header").is(":visible")) {

+ 2 - 0
offline.html

@@ -60,6 +60,8 @@
 </div>
 
 <script type="text/javascript">
+	'use strict';
+
 	$(document).ready(function() {
 
 		if ('serviceWorker' in navigator) {

+ 4 - 2
read.html

@@ -241,7 +241,9 @@
 </div>
 </div>
 
-<script>
+<script type='text/javascript'>
+	'use strict';
+
 	var _pagination_stored = 0;
 	var _last_position_sync = 0;
 
@@ -451,7 +453,7 @@
 		});
 
 		window.book = book;
-		rendered = book.renderTo("reader");
+		var rendered = book.renderTo("reader");
 
 		$('#settings-modal').on('shown.bs.modal', function() {