Open linked resources in a new browsing context

This commit is contained in:
Sebastian Serth
2022-09-23 20:24:28 +02:00
parent 16c00ec136
commit 150df3d219
2 changed files with 2 additions and 2 deletions

View File

@ -139,7 +139,7 @@ CodeOceanEditorSubmissions = {
const active_file = CodeOceanEditor.active_file.filename.replace(/#$/,''); // remove # if it is the last character, this is not part of the filename and just an anchor const active_file = CodeOceanEditor.active_file.filename.replace(/#$/,''); // remove # if it is the last character, this is not part of the filename and just an anchor
const desired_file = response.render_url.filter(hash => hash.filepath === active_file); const desired_file = response.render_url.filter(hash => hash.filepath === active_file);
const url = desired_file[0].url; const url = desired_file[0].url;
var pop_up_window = window.open(url); var pop_up_window = window.open(url, '_blank');
if (pop_up_window) { if (pop_up_window) {
pop_up_window.onerror = function (message) { pop_up_window.onerror = function (message) {
this.clearOutput(); this.clearOutput();

View File

@ -24,7 +24,7 @@ createPagedownEditor = function( selector, context ) {
Markdown.Extra.init(converter); Markdown.Extra.init(converter);
const help = { const help = {
handler() { handler() {
window.open('https://daringfireball.net/projects/markdown/syntax'); window.open('https://daringfireball.net/projects/markdown/syntax', '_blank');
return false; return false;
}, },
title: "<%= I18n.t('components.markdown_editor.help', default: 'Markdown Editing Help') %>" title: "<%= I18n.t('components.markdown_editor.help', default: 'Markdown Editing Help') %>"