Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit aacb72a

Browse files
committed
Merge pull request #141 from Jaza/consolelog-or-alert
re #140: Console.log not always defined in IE
2 parents 4a68f5e + 0c44e46 commit aacb72a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

dist/js/medium-editor-insert-plugin.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,11 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
810810
} catch(e) {}
811811
})();
812812

813-
window.console.log((responseJSON && responseJSON.error) || jqXHR.status || errorThrown.message);
813+
if (typeof window.console !== 'undefined') {
814+
window.console.log((responseJSON && responseJSON.error) || jqXHR.status || errorThrown.message);
815+
} else {
816+
window.alert('Error requesting media from ' + that.options.oembedProxy + ' to insert: ' + errorThrown + ' (response status: ' + jqXHR.status + ')');
817+
}
814818

815819
$.proxy(that, 'convertBadEmbed', url)();
816820
}

src/js/embeds.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,11 @@
239239
} catch(e) {}
240240
})();
241241

242-
window.console.log((responseJSON && responseJSON.error) || jqXHR.status || errorThrown.message);
242+
if (typeof window.console !== 'undefined') {
243+
window.console.log((responseJSON && responseJSON.error) || jqXHR.status || errorThrown.message);
244+
} else {
245+
window.alert('Error requesting media from ' + that.options.oembedProxy + ' to insert: ' + errorThrown + ' (response status: ' + jqXHR.status + ')');
246+
}
243247

244248
$.proxy(that, 'convertBadEmbed', url)();
245249
}

0 commit comments

Comments
 (0)