Add First .ts file
[MAILPOET-2658]
This commit is contained in:
committed by
Jack Kitterhing
parent
33948892fa
commit
9de1481efe
@ -25,7 +25,7 @@ export const fromUrl = (url) => new Promise((resolve, reject) => {
|
||||
const iframe = document.createElement('iframe');
|
||||
const protocol = document.location.href.startsWith('https://') ? 'https:' : 'http:';
|
||||
iframe.src = protocol + url.replace(/^https?:/, '');
|
||||
iframe.style.opacity = 0;
|
||||
iframe.style.opacity = '0';
|
||||
iframe.scrolling = 'no';
|
||||
iframe.onload = async () => {
|
||||
const container = iframe.contentDocument.documentElement;
|
||||
@ -44,7 +44,7 @@ export const fromUrl = (url) => new Promise((resolve, reject) => {
|
||||
reject(MailPoet.I18n.t('errorWhileTakingScreenshot'));
|
||||
};
|
||||
iframe.onerror = onError;
|
||||
iframe.onError = onError;
|
||||
(iframe as any).onError = onError;
|
||||
iframe.className = 'mailpoet_template_iframe';
|
||||
try {
|
||||
document.body.appendChild(iframe);
|
||||
@ -65,7 +65,7 @@ export const fromNewsletter = (data) => new Promise((resolve, reject) => {
|
||||
json.body = JSON.stringify(json.body);
|
||||
}
|
||||
MailPoet.Ajax.post({
|
||||
api_version: window.mailpoet_api_version,
|
||||
api_version: (window as any).mailpoet_api_version,
|
||||
endpoint: 'newsletters',
|
||||
action: 'showPreview',
|
||||
data: json,
|
@ -6,7 +6,7 @@ import Marionette from 'backbone.marionette';
|
||||
import $ from 'jquery';
|
||||
import Blob from 'blob';
|
||||
import FileSaver from 'file-saver';
|
||||
import * as Thumbnail from 'common/thumbnail.jsx';
|
||||
import * as Thumbnail from 'common/thumbnail.ts';
|
||||
import _ from 'underscore';
|
||||
|
||||
var Module = {};
|
||||
|
@ -8,7 +8,7 @@ import NotificationNewsletterFields from 'newsletters/send/notification.jsx';
|
||||
import WelcomeNewsletterFields from 'newsletters/send/welcome.jsx';
|
||||
import HelpTooltip from 'help-tooltip.jsx';
|
||||
import jQuery from 'jquery';
|
||||
import { fromUrl } from 'common/thumbnail.jsx';
|
||||
import { fromUrl } from 'common/thumbnail.ts';
|
||||
import Hooks from 'wp-js-hooks';
|
||||
import PropTypes from 'prop-types';
|
||||
import { withRouter } from 'react-router-dom';
|
||||
|
@ -224,7 +224,7 @@ describe('Save', function () {
|
||||
trackEvent: function () {},
|
||||
},
|
||||
'newsletter_editor/App': EditorApplication,
|
||||
'common/thumbnail.jsx': {
|
||||
'common/thumbnail.ts': {
|
||||
fromNewsletter: function () {
|
||||
return promiseMock;
|
||||
},
|
||||
|
Reference in New Issue
Block a user