Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenaka Moorthi <benaka.moorthi@gmail.com>2013-09-12 21:38:03 +0400
committerBenaka Moorthi <benaka.moorthi@gmail.com>2013-09-12 22:10:16 +0400
commita5ab907fe3d09ad1aacd1a0718566aad9768889b (patch)
tree6bd50b5c3583b912671f2220f96d96666115ddd3 /plugins/Proxy
parent9cd4cd3dd0a68e43fc9e6b9a9826c9a09fde5114 (diff)
Refs #4151, remove loadJavascriptTranslations twig function and automatically generate translation JS for all plugins. Translation JS is now treated as an asset and is included in merged JS.
Note: - Includes tweaks to capture.js: on webpage error stop capture program.
Diffstat (limited to 'plugins/Proxy')
-rw-r--r--plugins/Proxy/Controller.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/plugins/Proxy/Controller.php b/plugins/Proxy/Controller.php
index d358908805..3283e08909 100644
--- a/plugins/Proxy/Controller.php
+++ b/plugins/Proxy/Controller.php
@@ -23,6 +23,7 @@ use Piwik\Url;
class Controller extends \Piwik\Controller
{
const TRANSPARENT_PNG_PIXEL = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=';
+ const JS_MIME_TYPE = "application/javascript; charset=UTF-8";
/**
* Output the merged CSS file.
@@ -45,7 +46,20 @@ class Controller extends \Piwik\Controller
public function getJs()
{
$jsMergedFile = AssetManager::getMergedJsFileLocation();
- Piwik::serveStaticFile($jsMergedFile, "application/javascript; charset=UTF-8");
+ Piwik::serveStaticFile($jsMergedFile, self::JS_MIME_TYPE);
+ }
+
+ /**
+ * Output the translations JavaScript file.
+ * This method is called when the asset manager is disabled (otherwise it would be part
+ * of the merged JS file.)
+ *
+ * @see core/AssetManager.php
+ */
+ public function getTranslationJs()
+ {
+ $translationsJsFile = AssetManager::getTranslationsJsFileLocation();
+ Piwik::serveStaticFile($translationsJsFile, self::JS_MIME_TYPE);
}
/**