diff --git a/packages/rocketchat-lazy-load/client/index.js b/packages/rocketchat-lazy-load/client/index.js index 4ec008e08f7a..81e10d757503 100644 --- a/packages/rocketchat-lazy-load/client/index.js +++ b/packages/rocketchat-lazy-load/client/index.js @@ -1,29 +1,14 @@ -import { Meteor } from 'meteor/meteor'; import { Blaze } from 'meteor/blaze'; import _ from 'underscore'; import './lazyloadImage'; -export const fixCordova = function(url) { - if (url && url.indexOf('data:image') === 0) { - return url; - } - - if (Meteor.settings.public.sandstorm || url.match(/^(https?:)?\/\//i)) { - return url; - } else if (navigator.userAgent.indexOf('Electron') > -1) { - return __meteor_runtime_config__.ROOT_URL_PATH_PREFIX + url; - } else { - return Meteor.absoluteUrl().replace(/\/$/, '') + url; - } -}; - const getEl = (el, instance) => (instance && instance.firstNode) || el; const loadImage = (el, instance) => { const element = getEl(el, instance); const img = new Image(); const src = element.getAttribute('data-src'); - img.onload = function() { + img.onload = () => { if (instance) { instance.loaded.set(true); } else { @@ -32,7 +17,7 @@ const loadImage = (el, instance) => { } element.removeAttribute('data-src'); }; - img.src = fixCordova(src); + img.src = src; }; const isVisible = (el, instance) => { diff --git a/packages/rocketchat-lazy-load/client/lazyloadImage.js b/packages/rocketchat-lazy-load/client/lazyloadImage.js index be94ca2ca11b..4798d80363bb 100644 --- a/packages/rocketchat-lazy-load/client/lazyloadImage.js +++ b/packages/rocketchat-lazy-load/client/lazyloadImage.js @@ -1,7 +1,7 @@ import { ReactiveVar } from 'meteor/reactive-var'; import { Template } from 'meteor/templating'; import './lazyloadImage.html'; -import { addImage, fixCordova } from './'; +import { addImage } from './'; const emptyImageEncoded = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8+/u3PQAJJAM0dIyWdgAAAABJRU5ErkJggg=='; @@ -13,14 +13,14 @@ Template.lazyloadImage.helpers({ }, srcUrl() { - return this.src && fixCordova(this.src); + return this.src; }, lazySrcUrl() { const { preview, placeholder, src } = this; if (Template.instance().loaded.get() || (!preview && !placeholder)) { - return fixCordova(src); + return src; } return `data:image/png;base64,${ preview || emptyImageEncoded }`; diff --git a/packages/rocketchat-message-attachments/client/messageAttachment.html b/packages/rocketchat-message-attachments/client/messageAttachment.html index 85814b8ff50c..c8b2b868588f 100644 --- a/packages/rocketchat-message-attachments/client/messageAttachment.html +++ b/packages/rocketchat-message-attachments/client/messageAttachment.html @@ -12,9 +12,9 @@ {{#if author_link}}
{{#if author_icon}} - + {{/if}} - {{author_name}} + {{author_name}} {{#if ts}} {{#if message_link}} @@ -32,7 +32,7 @@ {{else}}
{{#if author_icon}} - + {{/if}} {{author_name}} {{#if ts}} @@ -54,9 +54,9 @@ {{#if title}}
{{#if title_link}} - {{#if isFile}} {{_ "Attachment_File_Uploaded"}}: {{/if}}{{title}} + {{#if isFile}} {{_ "Attachment_File_Uploaded"}}: {{/if}}{{title}} {{#if title_link_download}} - {{> icon icon="download"}} + {{> icon icon="download"}} {{/if}} {{else}} {{title}} @@ -73,7 +73,7 @@
{{#if thumb_url}}
- +
{{/if}} @@ -116,7 +116,7 @@ {{#unless mediaCollapsed}}
@@ -127,7 +127,7 @@ {{#unless mediaCollapsed}}
diff --git a/packages/rocketchat-message-attachments/client/messageAttachment.js b/packages/rocketchat-message-attachments/client/messageAttachment.js index 1e6b32fc2a3c..e065a5a4265f 100644 --- a/packages/rocketchat-message-attachments/client/messageAttachment.js +++ b/packages/rocketchat-message-attachments/client/messageAttachment.js @@ -1,6 +1,5 @@ import { Meteor } from 'meteor/meteor'; import { DateFormat } from 'meteor/rocketchat:lib'; -import { fixCordova } from 'meteor/rocketchat:lazy-load'; import { Template } from 'meteor/templating'; import { getUserPreference } from 'meteor/rocketchat:utils'; import { Users } from 'meteor/rocketchat:models'; @@ -13,7 +12,6 @@ const colors = { }; Template.messageAttachment.helpers({ - fixCordova, parsedText() { return renderMessageBody({ msg: this.text, diff --git a/packages/rocketchat-ui-flextab/client/tabs/uploadedFilesList.html b/packages/rocketchat-ui-flextab/client/tabs/uploadedFilesList.html index 8ae8ce53af7e..ad09ca8819dc 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/uploadedFilesList.html +++ b/packages/rocketchat-ui-flextab/client/tabs/uploadedFilesList.html @@ -17,7 +17,7 @@