Skip to content

Commit

Permalink
- Chg: Added 1.5 defer compatibility
Browse files Browse the repository at this point in the history
- Fix: Fixed "unreachable code after return statement" in humhub.custom_pages.template.TemplateElement.js
  • Loading branch information
buddh4 committed Apr 6, 2020
1 parent 7e608ff commit b1d2f79
Show file tree
Hide file tree
Showing 8 changed files with 215 additions and 144 deletions.
312 changes: 176 additions & 136 deletions Events.php

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions assets/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@

class Assets extends AssetBundle
{
/**
* v1.5 compatibility defer script loading
*
* Migrate to HumHub AssetBundle once minVersion is >=1.5
*
* @var bool
*/
public $defer = true;

public $sourcePath = '@custom_pages/resources';

public $publishOptions = [
Expand Down
9 changes: 9 additions & 0 deletions assets/CkEditorAssetBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@

class CkEditorAssetBundle extends AssetBundle
{
/**
* v1.5 compatibility defer script loading
*
* Migrate to HumHub AssetBundle once minVersion is >=1.5
*
* @var bool
*/
public $defer = true;

public $jsOptions = ['position' => \yii\web\View::POS_HEAD];
public $sourcePath = '@custom_pages/resources/ckeditor';

Expand Down
12 changes: 11 additions & 1 deletion assets/CodeMirrorAssetBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,20 @@


use yii\web\AssetBundle;
use yii\web\View;

class CodeMirrorAssetBundle extends AssetBundle
{
public $jsOptions = ['position' => \yii\web\View::POS_HEAD];
/**
* v1.5 compatibility defer script loading
*
* Migrate to HumHub AssetBundle once minVersion is >=1.5
*
* @var bool
*/
public $defer = true;

public $jsOptions = ['position' => View::POS_HEAD];
public $sourcePath = '@custom_pages/resources/codemirror';

public $js = [
Expand Down
5 changes: 5 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

1.0.7 (April, 06, 2020)
--------------------
- Chg: Added 1.5 defer compatibility
- Fix: Fixed "unreachable code after return statement" in humhub.custom_pages.template.TemplateElement.js

1.0.6 (February 19, 2020)
---------------------
- Fix #113: Double collapse menu item in snippet context menu
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Custom Pages",
"description": "Allows admins to create custom pages (html or markdown) or external links to various navigations (e.g. top navigation, account menu).",
"keywords": ["pages", "custom", "iframe", "markdown", "link", "navigation", "spaces"],
"version": "1.0.6",
"version": "1.0.7",
"humhub": {
"minVersion": "1.3.10"
}
Expand Down
4 changes: 4 additions & 0 deletions modules/template/assets/TemplateCoreAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

class TemplateCoreAsset extends AssetBundle
{
public $publishOptions = [
'forceCopy' => true
];

public $sourcePath = '@custom_pages/modules/template/resources';

public $jsOptions = ['position' => \yii\web\View::POS_END];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,6 @@ humhub.module('custom_pages.template.TemplateElement', function (module, require

TemplateElement.prototype.getUniqueId = function ($element) {
return this.$.attr('id');
if (!$element) {
return;
}

return $element.data('template-empty') ? Date.now().toString() :
$element.data('template-content') + ':' + $element.data('template-content-id');
};

TemplateElement.prototype.loader = function (show) {
Expand Down

0 comments on commit b1d2f79

Please sign in to comment.