Added @webroot-static and @web-static aliases

This commit is contained in:
Lucas Bartholemy 2017-01-26 17:36:59 +01:00
parent 07042ad57f
commit 4de8d75525
40 changed files with 130 additions and 113 deletions

View File

@ -2,7 +2,7 @@
/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2015 HumHub GmbH & Co. KG
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
* @license https://www.humhub.com/licences
*/

View File

@ -20,12 +20,12 @@ class AppAsset extends AssetBundle
/**
* @inheritdoc
*/
public $basePath = '@webroot';
public $basePath = '@webroot-static';
/**
* @inheritdoc
*/
public $baseUrl = '@web';
public $baseUrl = '@web-static';
/**
* @inheritdoc
@ -46,12 +46,8 @@ class AppAsset extends AssetBundle
* @inheritdoc
*/
public $js = [
//'js/ekko-lightbox-modified.js',
'js/blueimp-gallery.min.js',
//'js/modernizr.js', // In use???
'js/jquery.highlight.min.js',
//'js/wysihtml5-0.3.0.js',
//'js/bootstrap3-wysihtml5.js',
'js/desktop-notify-min.js',
'js/desktop-notify-config.js',
'js/jquery.nicescroll.min.js',
@ -66,15 +62,10 @@ class AppAsset extends AssetBundle
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
'yii\bootstrap\BootstrapPluginAsset',
/**
* Temporary disabled
* https://github.com/inuyaksa/jquery.nicescroll/issues/574
*/
//'humhub\assets\JqueryNiceScrollAsset',
'humhub\assets\BluebirdAsset',
'humhub\assets\JqueryTimeAgoAsset',
'humhub\assets\JqueryWidgetAsset',
'humhub\assets\JqueryColorAsset', //TODO: only required for post/comment/stream
'humhub\assets\JqueryColorAsset',
'humhub\assets\JqueryPlaceholderAsset',
'humhub\assets\FontAwesomeAsset',
'humhub\assets\BlueimpFileUploadAsset',

View File

@ -12,19 +12,27 @@ use yii\web\AssetBundle;
/**
* jquery-At.js
*
*
* @author buddha
*/
class AtJsStyleAsset extends AssetBundle
{
/**
* @inheritdoc
*/
public $basePath = '@webroot-static';
/**
* @inheritdoc
*/
public $baseUrl = '@web-static';
/**
* @inheritdoc
*/
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
'css/jquery.atwho.modified.css',
];
}

View File

@ -23,12 +23,12 @@ class BootstrapColorPickerAsset extends AssetBundle
/**
* @inheritdoc
*/
public $basePath = '@webroot';
public $basePath = '@webroot-static';
/**
* @inheritdoc
*/
public $baseUrl = '@web';
public $baseUrl = '@web-static';
/**
* @inheritdoc

View File

@ -19,12 +19,12 @@ class CoreApiAsset extends AssetBundle
/**
* @inheritdoc
*/
public $basePath = '@webroot';
public $basePath = '@webroot-static';
/**
* @inheritdoc
*/
public $baseUrl = '@web';
public $baseUrl = '@web-static';
/**
* @inheritdoc

View File

@ -23,12 +23,12 @@ class HumHubColorPickerAsset extends AssetBundle
/**
* @inheritdoc
*/
public $basePath = '@webroot';
public $basePath = '@webroot-static';
/**
* @inheritdoc
*/
public $baseUrl = '@web';
public $baseUrl = '@web-static';
/**
* @inheritdoc

View File

@ -22,12 +22,12 @@ class IEFixesAsset extends AssetBundle
/**
* @inheritdoc
*/
public $basePath = '@webroot';
public $basePath = '@webroot-static';
/**
* @inheritdoc
*/
public $baseUrl = '@web';
public $baseUrl = '@web-static';
/**
* @inheritdoc

View File

@ -21,12 +21,12 @@ class JqueryHighlightAsset extends AssetBundle
/**
* @inheritdoc
*/
public $basePath = '@webroot';
public $basePath = '@webroot-static';
/**
* @inheritdoc
*/
public $baseUrl = '@web';
public $baseUrl = '@web-static';
/**
* @inheritdoc

View File

@ -20,12 +20,12 @@ class JuiBootstrapBridgeAsset extends AssetBundle
/**
* @inheritdoc
*/
public $basePath = '@webroot';
public $basePath = '@webroot-static';
/**
* @inheritdoc
*/
public $baseUrl = '@web';
public $baseUrl = '@web-static';
/**
* @inheritdoc

View File

@ -21,12 +21,12 @@ class PagedownConverterAsset extends AssetBundle
/**
* @inheritdoc
*/
public $basePath = '@webroot';
public $basePath = '@webroot-static';
/**
* @inheritdoc
*/
public $baseUrl = '@web';
public $baseUrl = '@web-static';
/**
* @inheritdoc

View File

@ -23,12 +23,12 @@ class PjaxAsset extends AssetBundle
/**
* @inheritdoc
*/
public $basePath = '@webroot';
public $basePath = '@webroot-static';
/**
* @inheritdoc
*/
public $baseUrl = '@web';
public $baseUrl = '@web-static';
/**
* @inheritdoc

View File

@ -21,12 +21,12 @@ class Select2BootstrapAsset extends AssetBundle
/**
* @inheritdoc
*/
public $basePath = '@webroot';
public $basePath = '@webroot-static';
/**
* @inheritdoc
*/
public $baseUrl = '@web';
public $baseUrl = '@web-static';
/**
* @inheritdoc

View File

@ -20,8 +20,8 @@ class TabbedFormAsset extends AssetBundle
public $jsOptions = ['position' => \yii\web\View::POS_END];
public $basePath = '@webroot';
public $baseUrl = '@web';
public $basePath = '@webroot-static';
public $baseUrl = '@web-static';
/**
* @inheritdoc

View File

@ -8,6 +8,8 @@
namespace humhub\components;
use Yii;
/**
* @inheritdoc
*/
@ -19,6 +21,17 @@ class Application extends \yii\web\Application
*/
public $controllerNamespace = 'humhub\\controllers';
/**
* @inheritdoc
*/
public function bootstrap()
{
$request = $this->getRequest();
Yii::setAlias('@web-static', $request->getBaseUrl() . '/static');
parent::bootstrap();
}
/**
* @inheritdoc
*/

View File

@ -102,7 +102,7 @@ class Module extends \yii\base\Module
$url = $this->getPublishedUrl('/module_image.png');
if ($url == null) {
$url = Yii::getAlias("@web/img/default_module.jpg");
$url = Yii::getAlias("@web-static/img/default_module.jpg");
}
return $url;
@ -111,7 +111,7 @@ class Module extends \yii\base\Module
/**
* Returns the url of an asset file and publishes all module assets if
* the file is not published yet.
*
*
* @param string $relativePath relative file path e.g. /module_image.jpg
* @return string
*/
@ -166,7 +166,7 @@ class Module extends \yii\base\Module
}
/**
* Determines whether or not this module has an asset directory.
* Determines whether or not this module has an asset directory.
* @return boolean
*/
private function hasAssets()
@ -196,7 +196,7 @@ class Module extends \yii\base\Module
/**
* Disables a module
*
*
* This should delete all data created by this module.
* When override this method make sure to invoke the parent implementation AFTER your implementation.
*/
@ -293,7 +293,7 @@ class Module extends \yii\base\Module
/**
* URL to the module's configuration action
*
*
* @return string the configuration url
*/
public function getConfigUrl()
@ -304,9 +304,9 @@ class Module extends \yii\base\Module
/**
* Returns a list of permission objects this module provides.
* If a ContentContainer is provided, the method should only return applicable permissions in content container context.
*
*
* @since 0.21
* @param \humhub\modules\content\components\ContentContainerActiveRecord $contentContainer optional contentcontainer
* @param \humhub\modules\content\components\ContentContainerActiveRecord $contentContainer optional contentcontainer
* @return array list of permissions
*/
public function getPermissions($contentContainer = null)
@ -316,7 +316,7 @@ class Module extends \yii\base\Module
/**
* Returns a list of notification classes this module provides.
*
*
* @since 1.1
* @return array list of notification classes
*/
@ -332,7 +332,7 @@ class Module extends \yii\base\Module
/**
* Returns a list of activity class names this modules provides.
*
*
* @since 1.2
* @return array list of activity class names
*/

View File

@ -5,6 +5,8 @@ Yii::setAlias('@webroot', realpath(__DIR__ . '/../../../'));
Yii::setAlias('@app', '@webroot/protected');
Yii::setAlias('@humhub', '@app/humhub');
Yii::setAlias('@config', '@app/config');
Yii::setAlias('@webroot-static', '@webroot/static');
$config = [
'name' => 'HumHub',

View File

@ -6,7 +6,10 @@ Here you will learn how you can adapt existing modules to working fine with actu
### Stream / Content Changes
TBD
The models WallEntry and Wall were removed. So all corresponding methods like getFirstWallEntryId() are not longer available.
The stream handling is now handled directly by the Content model. Also all stream classes (widgets, actions) are moved into the humhub\modules\stream package.
### File module changes

View File

@ -42,7 +42,7 @@ use yii\helpers\Html;
<div class="media <?php if (Yii::$app->moduleManager->hasModule($module['id'])): ?>module-installed<?php endif; ?>">
<?php
$moduleImageUrl = Yii::getAlias('@web/img/default_module.jpg');
$moduleImageUrl = Yii::getAlias('@web-static/img/default_module.jpg');
if (isset($module['moduleImageUrl']) && $module['moduleImageUrl'] != "") {
$moduleImageUrl = $module['moduleImageUrl'];
}

View File

@ -7,8 +7,8 @@ use yii\helpers\Html;
<div class="panel-heading"><?php echo Yii::t('AdminModule.views_module_listOnline', '<strong>Modules</strong> directory'); ?></div>
<?php echo $this->render('_header'); ?>
<div class="panel-body">
<div class="panel-body">
<!-- search form -->
<?php echo Html::beginForm(Url::to(['//admin/module/list-purchases']), 'post', array('class' => 'form-search')); ?>
<div class="row">
@ -43,7 +43,7 @@ use yii\helpers\Html;
<div class="media ">
<?php
$moduleImageUrl = Yii::getAlias('@web/img/default_module.jpg');
$moduleImageUrl = Yii::getAlias('@web-static/img/default_module.jpg');
if (isset($module['moduleImageUrl']) && $module['moduleImageUrl'] != "") {
$moduleImageUrl = $module['moduleImageUrl'];
}

View File

@ -6,7 +6,7 @@ use yii\helpers\Html;
<div class="panel panel-default">
<div class="panel-heading"><?php echo Yii::t('AdminModule.views_module_listUpdates', '<strong>Modules</strong> directory'); ?></div>
<?php echo $this->render('_header'); ?>
<div class="panel-body">
<?php if (count($modules) == 0): ?>
<br>
@ -15,9 +15,9 @@ use yii\helpers\Html;
<?php endif; ?>
<?php foreach ($modules as $module): ?>
<?php
$moduleImageUrl = Yii::getAlias('@web/img/default_module.jpg');
$moduleImageUrl = Yii::getAlias('@web-static/img/default_module.jpg');
if (isset($module['moduleImageUrl']) && $module['moduleImageUrl'] != "") {
$moduleImageUrl = $module['moduleImageUrl'];
}

View File

@ -43,9 +43,10 @@ class ContentContainerController extends Controller
/**
* @var boolean hides containers sidebar in layout
* @deprecated since version 1.2
* @since 0.11
*/
public $hideSidebar = false;
public $hideSidebar = true;
/**
* Automatically loads the underlying contentContainer (User/Space) by using

View File

@ -48,13 +48,13 @@
</tr>
<tr>
<td style="border-top: 1px solid #eee;padding-top:10px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td width="109"></td>
<td width="50"><?= \humhub\modules\notification\widgets\MailContentContainerImage::widget(['container' => $originator])?></td>
<td width="109"></td>
<td width="25"><img src="<?= \yii\helpers\Url::to('@web/img/mail_ico_no.png', true); ?>" /></td>
<td width="25"><img src="<?= \yii\helpers\Url::to('@web-static/img/mail_ico_no.png', true); ?>" /></td>
<td width="109"></td>
<td width="50"><?= \humhub\modules\notification\widgets\MailContentContainerImage::widget(['container' => $space])?></td>
<td></td>

View File

@ -30,7 +30,7 @@ AppAsset::register($this);
<div class="container installer" style="margin: 0 auto; max-width: 770px;">
<div class="logo">
<a class="animated fadeIn" href="http://www.humhub.org" target="_blank" class="">
<img src="<?php echo Yii::getAlias("@web/resources/installer"); ?>/humhub-logo.png" alt="Logo">
<img src="<?php echo Yii::getAlias("@web-static/resources/installer"); ?>/humhub-logo.png" alt="Logo">
</a>
</div>

View File

@ -41,7 +41,7 @@
<td width="109"></td>
<td width="50"><?= \humhub\widgets\mails\MailContentContainerImage::widget(['container' => $originator])?></td>
<td width="109"></td>
<td width="25"><img src="<?= \yii\helpers\Url::to('@web/img/mail_ico_check.png', true); ?>" /></td>
<td width="25"><img src="<?= \yii\helpers\Url::to('@web-static/img/mail_ico_check.png', true); ?>" /></td>
<td width="109"></td>
<td width="50"><?= \humhub\widgets\mails\MailContentContainerImage::widget(['container' => $space])?></td>
<td></td>

View File

@ -48,13 +48,13 @@
</tr>
<tr>
<td style="border-top: 1px solid #eee;padding-top:10px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td width="109"></td>
<td width="50"><?= \humhub\modules\notification\widgets\MailContentContainerImage::widget(['container' => $originator])?></td>
<td width="109"></td>
<td width="25"><img src="<?= \yii\helpers\Url::to('@web/img/mail_ico_no.png', true); ?>" /></td>
<td width="25"><img src="<?= \yii\helpers\Url::to('@web-static/img/mail_ico_no.png', true); ?>" /></td>
<td width="109"></td>
<td width="50"><?= \humhub\modules\notification\widgets\MailContentContainerImage::widget(['container' => $space])?></td>
<td></td>

View File

@ -41,7 +41,7 @@
<td width="109"></td>
<td width="50"><?= \humhub\widgets\mails\MailContentContainerImage::widget(['container' => $originator])?></td>
<td width="109"></td>
<td width="25"><img src="<?= \yii\helpers\Url::to('@web/img/mail_ico_check.png', true); ?>" /></td>
<td width="25"><img src="<?= \yii\helpers\Url::to('@web-static/img/mail_ico_check.png', true); ?>" /></td>
<td width="109"></td>
<td width="50"><?= \humhub\widgets\mails\MailContentContainerImage::widget(['container' => $space])?></td>
<td></td>

View File

@ -48,13 +48,13 @@
</tr>
<tr>
<td style="border-top: 1px solid #eee;padding-top:10px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td width="109"></td>
<td width="50"><?= \humhub\modules\notification\widgets\MailContentContainerImage::widget(['container' => $originator])?></td>
<td width="109"></td>
<td width="25"><img src="<?= \yii\helpers\Url::to('@web/img/mail_ico_no.png', true); ?>" /></td>
<td width="25"><img src="<?= \yii\helpers\Url::to('@web-static/img/mail_ico_no.png', true); ?>" /></td>
<td width="109"></td>
<td width="50"><?= \humhub\modules\notification\widgets\MailContentContainerImage::widget(['container' => $space])?></td>
<td></td>

View File

@ -6,7 +6,7 @@
use yii\helpers\Html;
if ($space->isAdmin()) {
$this->registerJsFile('@web/resources/space/spaceHeaderImageUpload.js');
$this->registerJsFile('@web-static/resources/space/spaceHeaderImageUpload.js');
$this->registerJsVar('profileImageUploaderUrl', $space->createUrl('/space/manage/image/upload'));
$this->registerJsVar('profileHeaderUploaderUrl', $space->createUrl('/space/manage/image/banner-upload'));
}

View File

@ -3,7 +3,7 @@
use yii\helpers\Html;
use humhub\modules\space\widgets\Image;
$this->registerJsFile('@web/resources/space/spacepicker.js', ['position' => \yii\web\View::POS_END]);
$this->registerJsFile('@web-static/resources/space/spacepicker.js', ['position' => \yii\web\View::POS_END]);
?>
<?php

View File

@ -3,7 +3,7 @@
use yii\helpers\Url;
use yii\widgets\ActiveForm;
$this->registerJsFile('@web/resources/user/profileHeaderImageUpload.js');
$this->registerJsFile('@web-static/resources/user/profileHeaderImageUpload.js');
$this->registerJs("var userGuid='" . $user->guid . "';", \yii\web\View::POS_BEGIN);
$this->registerJs("var profileImageUploaderUrl='" . Url::toRoute('/user/account/profile-image-upload') . "';", \yii\web\View::POS_BEGIN);
?>

View File

@ -61,8 +61,8 @@ class Tour extends \humhub\components\Widget
*/
public function loadResources(\yii\web\View $view)
{
$view->registerJsFile('@web/resources/js/tour/bootstrap-tour.min.js');
$view->registerCssFile('@web/resources/js/tour/bootstrap-tour.min.css');
$view->registerJsFile('@web-static/resources/js/tour/bootstrap-tour.min.js');
$view->registerCssFile('@web-static/resources/js/tour/bootstrap-tour.min.css');
}
}

View File

@ -17,10 +17,10 @@ class AuthChoice extends \yii\authclient\widgets\AuthChoice
/**
* Used to retrieve the auth clients in a static way
* @var type
* @var type
*/
private static $authclientCollection = 'authClientCollection';
/**
* @var int number of clients to show without folding
*/
@ -60,7 +60,7 @@ class AuthChoice extends \yii\authclient\widgets\AuthChoice
return $this->_clients;
}
/**
* Returns default auth clients list.
* @return ClientInterface[] auth clients list.
@ -68,10 +68,10 @@ class AuthChoice extends \yii\authclient\widgets\AuthChoice
public static function hasClients()
{
$authClients = self::filterClients(Yii::$app->get(self::$authclientCollection)->getClients());
return count($authClients) > 0;
}
/**
* Filters out clients which need login form
* @param type $clients
@ -81,7 +81,7 @@ class AuthChoice extends \yii\authclient\widgets\AuthChoice
{
$result = [];
foreach ($clients as $client) {
// Don't show clients which need login form
if (!$client instanceof \humhub\modules\user\authclient\BaseFormAuth) {
$result[] = $client;
@ -101,7 +101,7 @@ class AuthChoice extends \yii\authclient\widgets\AuthChoice
return $baseAuthUrl;
}
/**
* @inheritdoc
*/
@ -113,7 +113,7 @@ class AuthChoice extends \yii\authclient\widgets\AuthChoice
return parent::init();
}
}
/**
* @inheritdoc
*/
@ -133,13 +133,13 @@ class AuthChoice extends \yii\authclient\widgets\AuthChoice
{
$clients = $this->getClients();
$clientCount = count($clients);
if ($clientCount == 0) {
return;
}
$this->view->registerCssFile('@web/resources/user/authChoice.css');
$this->view->registerJsFile('@web/resources/user/authChoice.js');
$this->view->registerCssFile('@web-static/resources/user/authChoice.css');
$this->view->registerJsFile('@web-static/resources/user/authChoice.js');
echo Html::beginTag('div', ['class' => 'authChoice']);

View File

@ -4,7 +4,7 @@ use yii\helpers\Html;
use yii\helpers\Url;
if ($isProfileOwner) {
$this->registerJsFile('@web/resources/user/profileHeaderImageUpload.js');
$this->registerJsFile('@web-static/resources/user/profileHeaderImageUpload.js');
$this->registerJs("var profileImageUploaderUserGuid='" . $user->guid . "';", \yii\web\View::POS_BEGIN);
$this->registerJs("var profileImageUploaderCurrentUserGuid='" . Yii::$app->user->getIdentity()->guid . "';", \yii\web\View::POS_BEGIN);
$this->registerJs("var profileImageUploaderUrl='" . Url::to(['/user/account/profile-image-upload', 'userGuid' => $user->guid]) . "';", \yii\web\View::POS_BEGIN);

View File

@ -15,8 +15,8 @@
use \humhub\modules\user\models\User;
use \yii\helpers\Html;
$this->registerJsFile("@web/js/jquery.highlight.min.js");
$this->registerJsFile("@web/resources/user/userpicker.js");
$this->registerJsFile("@web-static/js/jquery.highlight.min.js");
$this->registerJsFile("@web-static/resources/user/userpicker.js");
?>
<?php

View File

@ -22,16 +22,16 @@ class CoreJsConfig extends Widget
public function run()
{
if(!Yii::$app->user->isGuest) {
$userConfig = \humhub\modules\user\models\UserPicker::asJSON(Yii::$app->user->getIdentity());
$userConfig['isGuest'] = false;
} else {
$userConfig = ['isGuest' => true];
}
$liveModule = Yii::$app->getModule('live');
$this->getView()->registerJsConfig(
[
'user' => $userConfig,
@ -46,7 +46,7 @@ class CoreJsConfig extends Widget
'idleInterval' => $liveModule->idleInterval // Interval for updating the update delay in case of user idle in seconds.
]
]
],
'file' => [
'upload' => [
@ -71,14 +71,14 @@ class CoreJsConfig extends Widget
],
'ui.widget' => [
'text' => [
'error.unknown' => Yii::t('base', 'No error information given.'),
'error.unknown' => Yii::t('base', 'No error information given.'),
]
],
'ui.richtext' => [
'emoji.url' => Yii::getAlias('@web/img/emoji/'),
'emoji.url' => Yii::getAlias('@web-static/img/emoji/'),
'text' => [
'info.minInput' => Yii::t('base', 'Please type at least 3 characters'),
'info.loading' => Yii::t('base', 'Loading...'),
'info.minInput' => Yii::t('base', 'Please type at least 3 characters'),
'info.loading' => Yii::t('base', 'Loading...'),
]
],
'log' => [

View File

@ -37,7 +37,7 @@ class RichText extends JsWidget
public $minimal = false;
/**
* @var boolean edit mode
* @var boolean edit mode
*/
public $edit = false;
@ -61,7 +61,7 @@ class RichText extends JsWidget
if ($this->encode) {
$this->text = Html::encode($this->text);
}
if (!$this->minimal) {
$maxOembedCount = 3; // Maximum OEmbeds
$oembedCount = 0; // OEmbeds used
@ -86,7 +86,7 @@ REGEXP;
}
return Html::a($match[0], Html::decode($match[0]), array('target' => '_blank'));
}, $this->text);
// mark emails
$this->text = preg_replace_callback('/[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,3})/', function ($match) {
return Html::mailto($match[0]);
@ -104,18 +104,18 @@ REGEXP;
}
$this->text = trim($this->text);
if (!$this->minimal) {
$output = nl2br($this->text);
} else {
$output = $this->text;
}
// replace leading spaces with no break spaces to keep the text format
$output = preg_replace_callback('/^( +)/m', function($m) {
return str_repeat("&nbsp;", strlen($m[1]));
return str_repeat("&nbsp;", strlen($m[1]));
}, $output);
$this->trigger(self::EVENT_BEFORE_OUTPUT, new ParameterEvent(['output' => &$output]));
return trim($output);
@ -145,7 +145,7 @@ REGEXP;
return preg_replace_callback('@;(\w*?);@', function($hit) use(&$show, &$emojis) {
if (in_array($hit[1], $emojis)) {
if ($show) {
return Html::img(Yii::getAlias("@web/img/emoji/" . $hit[1] . ".svg"), array('data-emoji-name' => $hit[0], 'data-richtext-feature' => '', 'data-guid' => "@-emoji".$hit[0], 'class' => 'atwho-emoji', 'width' => '18', 'height' => '18', 'alt' => $hit[1]));
return Html::img(Yii::getAlias("@web-static/img/emoji/" . $hit[1] . ".svg"), array('data-emoji-name' => $hit[0], 'data-richtext-feature' => '', 'data-guid' => "@-emoji".$hit[0], 'class' => 'atwho-emoji', 'width' => '18', 'height' => '18', 'alt' => $hit[1]));
}
return '';
}

View File

@ -8,8 +8,8 @@ use yii\helpers\Html;
* Register BootstrapMarkdown & changes
*/
BootstrapMarkdownAsset::register($this);
$this->registerCssFile('@web/css/bootstrap-markdown-override.css');
$this->registerJsFile('@web/js/markdownEditor.js');
$this->registerCssFile('@web-static/css/bootstrap-markdown-override.css');
$this->registerJsFile('@web-static/js/markdownEditor.js');
/**
* Create a hidden field to store uploaded files guids
@ -103,7 +103,7 @@ $this->registerJs("initMarkdownEditor('" . $fieldId . "')");
<div class="modal-body">
<div class="form-group">
<label for="addLinkTitle"><?php echo Yii::t('widgets_views_markdownEditor', 'Title'); ?></label>
<input type="text" class="form-control linkTitle"
<input type="text" class="form-control linkTitle"
placeholder="<?php echo Yii::t('widgets_views_markdownEditor', 'Title of your link'); ?>">
</div>
<div class="form-group">
@ -120,4 +120,3 @@ $this->registerJs("initMarkdownEditor('" . $fieldId . "')");
</div>
</div>
</script>

View File

@ -1,6 +1,6 @@
<?php
$this->registerJsFile('@web/resources/js/highlight.js/highlight.pack.js', ['position' => yii\web\View::POS_BEGIN]);
$this->registerCssFile('@web/resources/js/highlight.js/styles/' . $highlightJsCss . '.css');
$this->registerJsFile('@web-static/resources/js/highlight.js/highlight.pack.js', ['position' => yii\web\View::POS_BEGIN]);
$this->registerCssFile('@web-static/resources/js/highlight.js/styles/' . $highlightJsCss . '.css');
?>
<div class="markdown-render">
<?php echo $content; ?>

View File

@ -1,5 +1,5 @@
<?php
$this->registerJsFile("@web/js/panelMenu.js", ['position' => yii\web\View::POS_BEGIN]);
$this->registerJsFile("@web-static/js/panelMenu.js", ['position' => yii\web\View::POS_BEGIN]);
?>
<ul class="nav nav-pills preferences">
<li class="dropdown ">

View File

@ -78,17 +78,17 @@ use yii\helpers\Url;
}
}).atwho({
at: ":",
insert_tpl: "<img data-emoji-name=';${name};' class='atwho-emoji' with='18' height='18' src='<?php echo Yii::getAlias('@web/img/emoji/${name}.svg'); ?>' />",
tpl: "<li class='atwho-emoji-entry' data-value=';${name};'><img with='18' height='18' src='<?php echo Yii::getAlias('@web/img/emoji/${name}.svg'); ?>'/></li>",
insert_tpl: "<img data-emoji-name=';${name};' class='atwho-emoji' with='18' height='18' src='<?php echo Yii::getAlias('@web-static/img/emoji/${name}.svg'); ?>' />",
tpl: "<li class='atwho-emoji-entry' data-value=';${name};'><img with='18' height='18' src='<?php echo Yii::getAlias('@web-static/img/emoji/${name}.svg'); ?>'/></li>",
data: emojis_list,
highlight_first: true,
limit: 100
});
//it seems atwho detatches the original element so we have to do a requery
$editableContent = $('#<?php echo $id; ?>_contenteditable');
//This is a workaround for mobile browsers especially for Android Chrome which is not able to remove contenteditable="false" nodes.
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)) {
$editableContent.on('contextmenu', 'a, img', function() {
@ -97,7 +97,7 @@ use yii\helpers\Url;
} else {
$(this).remove();
}
_checkForEmptySpans($editableContent);
return false;
});
@ -202,7 +202,7 @@ use yii\helpers\Url;
// This is a workaround for a caret position issue in firefox https://bugzilla.mozilla.org/show_bug.cgi?id=904846
_checkCaretPositionAfterRemove($editableContent);
return false; // leave loop
}
}
});
};