summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-02 18:38:27 +0300
committerAndrew Dolgov <[email protected]>2018-12-02 18:38:27 +0300
commitf89924f7a19871e26d5805a6c1863903c6e474bf (patch)
tree8e7e26aa987d809c6a217319af79479c0006a260 /include
parent807ff074540575e6ef8f99ad32b098a816091171 (diff)
set use strict on JS modules; remove some mostly useless stuff like get_minified_js()
Diffstat (limited to 'include')
-rwxr-xr-xinclude/functions.php49
-rw-r--r--include/login_form.php2
2 files changed, 1 insertions, 50 deletions
diff --git a/include/functions.php b/include/functions.php
index 2ec42c7ee..baed6fb20 100755
--- a/include/functions.php
+++ b/include/functions.php
@@ -1310,9 +1310,6 @@
$data['last_article_id'] = Article::getLastArticleId();
$data['cdm_expanded'] = get_pref('CDM_EXPANDED');
- $data['dep_ts'] = calculate_dep_timestamp();
- $data['reload_on_ts_change'] = !defined('_NO_RELOAD_ON_TS_CHANGE');
-
$data["labels"] = Labels::get_all_labels($_SESSION["uid"]);
if (CHECK_FOR_UPDATES && !$disable_update_check && $_SESSION["last_version_check"] + 86400 + rand(-1000, 1000) < time()) {
@@ -2379,52 +2376,6 @@
return in_array($interface, class_implements($class));
}
- function get_minified_js($files) {
-
- $rv = '';
-
- foreach ($files as $js) {
- if (!isset($_GET['debug'])) {
- $cached_file = CACHE_DIR . "/js/".basename($js);
-
- if (file_exists($cached_file) && is_readable($cached_file) && filemtime($cached_file) >= filemtime("js/$js")) {
-
- list($header, $contents) = explode("\n", file_get_contents($cached_file), 2);
-
- if ($header && $contents) {
- list($htag, $hversion) = explode(":", $header);
-
- if ($htag == "tt-rss" && $hversion == VERSION) {
- $rv .= $contents;
- continue;
- }
- }
- }
-
- $minified = JShrink\Minifier::minify(file_get_contents("js/$js"));
- file_put_contents($cached_file, "tt-rss:" . VERSION . "\n" . $minified);
- $rv .= $minified;
-
- } else {
- $rv .= file_get_contents("js/$js"); // no cache in debug mode
- }
- }
-
- return $rv;
- }
-
- function calculate_dep_timestamp() {
- $files = array_merge(glob("js/*.js"), glob("css/*.css"));
-
- $max_ts = -1;
-
- foreach ($files as $file) {
- if (filemtime($file) > $max_ts) $max_ts = filemtime($file);
- }
-
- return $max_ts;
- }
-
function T_js_decl($s1, $s2) {
if ($s1 && $s2) {
$s1 = preg_replace("/\n/", "", $s1);
diff --git a/include/login_form.php b/include/login_form.php
index bb142f6c5..9c3a9b375 100644
--- a/include/login_form.php
+++ b/include/login_form.php
@@ -10,7 +10,7 @@
foreach (array("lib/prototype.js",
"lib/dojo/dojo.js",
"lib/dojo/tt-rss-layer.js",
- "js/functions.js",
+ "js/common.js",
"errors.php?mode=js") as $jsfile) {
echo javascript_tag($jsfile);