From 068ce8740c28d9982defe4a3446429f74f30e5fb Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Fri, 10 Oct 2014 10:19:03 +0000 Subject: [PATCH] Use relative URL for assets as default --- Plugin.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Plugin.php b/Plugin.php index 44123ef..19a3c71 100644 --- a/Plugin.php +++ b/Plugin.php @@ -83,10 +83,8 @@ class Plugin extends \Mibew\Plugin\AbstractPlugin implements \Mibew\Plugin\Plugi */ public function attachJSFiles(&$args) { - $request = $args['request']; - - if ($this->isAppropriatePage($request)) { - $base_path = $request->getBasePath() . '/' . $this->getFilesPath(); + if ($this->isAppropriatePage($args['request'])) { + $base_path = $this->getFilesPath(); $args['js'][] = $base_path . '/components/es5-shim/es5-shim.js'; $args['js'][] = $base_path . '/components/emojify.js/emojify.js'; $args['js'][] = $base_path . '/js/plugin.js'; @@ -100,11 +98,8 @@ class Plugin extends \Mibew\Plugin\AbstractPlugin implements \Mibew\Plugin\Plugi */ public function attachCssFiles(&$args) { - $request = $args['request']; - - if ($this->isAppropriatePage($request)) { - $args['css'][] = $request->getBasePath() . '/' . $this->getFilesPath() - . '/css/styles.css'; + if ($this->isAppropriatePage($args['request'])) { + $args['css'][] = $this->getFilesPath() . '/css/styles.css'; } }