Use relative URL for assets as default

This commit is contained in:
Dmitriy Simushev 2014-10-10 10:19:03 +00:00
parent 659874df6a
commit 068ce8740c

View File

@ -83,10 +83,8 @@ class Plugin extends \Mibew\Plugin\AbstractPlugin implements \Mibew\Plugin\Plugi
*/ */
public function attachJSFiles(&$args) public function attachJSFiles(&$args)
{ {
$request = $args['request']; if ($this->isAppropriatePage($args['request'])) {
$base_path = $this->getFilesPath();
if ($this->isAppropriatePage($request)) {
$base_path = $request->getBasePath() . '/' . $this->getFilesPath();
$args['js'][] = $base_path . '/components/es5-shim/es5-shim.js'; $args['js'][] = $base_path . '/components/es5-shim/es5-shim.js';
$args['js'][] = $base_path . '/components/emojify.js/emojify.js'; $args['js'][] = $base_path . '/components/emojify.js/emojify.js';
$args['js'][] = $base_path . '/js/plugin.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) public function attachCssFiles(&$args)
{ {
$request = $args['request']; if ($this->isAppropriatePage($args['request'])) {
$args['css'][] = $this->getFilesPath() . '/css/styles.css';
if ($this->isAppropriatePage($request)) {
$args['css'][] = $request->getBasePath() . '/' . $this->getFilesPath()
. '/css/styles.css';
} }
} }