diff --git a/scripts/lang_functions.php b/scripts/lang_functions.php index 56158a469..af1e2ab3b 100644 --- a/scripts/lang_functions.php +++ b/scripts/lang_functions.php @@ -316,7 +316,7 @@ function save_key($key, $value, $path) { $file = file_get_contents($filePath); $file = (array) json_decode($file); $value = html_entity_decode($value); - if ($file[$key] != $value) { + if (!isset($file[$key]) || $file[$key] != $value) { $file[$key] = $value; ksort($file); file_put_contents($filePath, str_replace('\/', '/', json_encode($file, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT))); diff --git a/src/addon/block/onlineusers/onlineusers.scss b/src/addon/block/onlineusers/onlineusers.scss index eb05cef2e..009a347b8 100644 --- a/src/addon/block/onlineusers/onlineusers.scss +++ b/src/addon/block/onlineusers/onlineusers.scss @@ -1,4 +1,12 @@ .addon-block-online-users core-block-pre-rendered .core-block-content { + max-height: 200px; + overflow-y: auto; + .item-inner, + .input-wrapper { + overflow-y: visible; + align-self: start; + } + .list { @include margin-horizontal(0); -webkit-padding-start: 0; diff --git a/src/app/app.md.scss b/src/app/app.md.scss index bee372275..a97ce6e95 100644 --- a/src/app/app.md.scss +++ b/src/app/app.md.scss @@ -70,6 +70,15 @@ ion-app.app-root.md { padding-top: 0; margin-top: $action-sheet-md-title-padding-top; } + + @media (min-height: 500px) { + .action-sheet-wrapper { + bottom: 0; + top: initial; + max-height: 50%; + height: 100%; + } + } } } diff --git a/src/app/app.scss b/src/app/app.scss index 1118e0771..9fbf324f0 100644 --- a/src/app/app.scss +++ b/src/app/app.scss @@ -609,15 +609,6 @@ ion-app.app-root { } } - @media (min-height: 500px) { - .action-sheet-wrapper { - bottom: 0; - top: initial; - max-height: 50%; - height: 100%; - } - } - .alert-message { overflow-y: auto; } diff --git a/src/core/block/components/course-blocks/course-blocks.scss b/src/core/block/components/course-blocks/course-blocks.scss index 61fcad7be..ef2da86c0 100644 --- a/src/core/block/components/course-blocks/course-blocks.scss +++ b/src/core/block/components/course-blocks/course-blocks.scss @@ -29,6 +29,17 @@ ion-app.app-root core-block-course-blocks { min-width: $core-side-blocks-min-width; @include border-start(1px, solid, $list-md-border-color); } + + .core-course-blocks-content, + div.core-course-blocks-side { + position: relative; + height: 100%; + + .core-loading-center, + core-loading.core-loading-loaded { + position: initial; + } + } } @include media-breakpoint-down(sm) { diff --git a/src/directives/external-content.ts b/src/directives/external-content.ts index 94ebfcbcb..fac78ee17 100644 --- a/src/directives/external-content.ts +++ b/src/directives/external-content.ts @@ -50,6 +50,8 @@ export class CoreExternalContentDirective implements AfterViewInit, OnChanges { protected logger; protected initialized = false; + invalid = false; + constructor(element: ElementRef, logger: CoreLoggerProvider, private filepoolProvider: CoreFilepoolProvider, private platform: Platform, private sitesProvider: CoreSitesProvider, private domUtils: CoreDomUtilsProvider, private urlUtils: CoreUrlUtilsProvider, private appProvider: CoreAppProvider, private utils: CoreUtilsProvider) { @@ -142,6 +144,15 @@ export class CoreExternalContentDirective implements AfterViewInit, OnChanges { } } else { + this.invalid = true; + + return; + } + + // Avoid handling data url's. + if (url.indexOf('data:') === 0) { + this.invalid = true; + return; } diff --git a/src/directives/format-text.ts b/src/directives/format-text.ts index 552ca9203..1335b31de 100644 --- a/src/directives/format-text.ts +++ b/src/directives/format-text.ts @@ -409,7 +409,12 @@ export class CoreFormatTextDirective implements OnChanges { // Walk through the content to find images, and add our directive. images.forEach((img: HTMLElement) => { this.addMediaAdaptClass(img); - externalImages.push(this.addExternalContent(img)); + + const externalImage = this.addExternalContent(img); + if (!externalImage.invalid) { + externalImages.push(externalImage); + } + if (this.utils.isTrueOrOne(this.adaptImg) && !img.classList.contains('icon')) { this.adaptImage(img); } @@ -480,7 +485,9 @@ export class CoreFormatTextDirective implements OnChanges { promise = Promise.resolve(); } - return promise.then(() => { + return promise.catch(() => { + // Ignore errors. So content gets always shown. + }).then(() => { return div; }); });