handleOpenClick: function () { var repo = this.props.pending.repo; if (repo.indexOf('/') === -1) { shell.openExternal(`https://registry.hub.docker.com/_/${this.props.pending.repo}`); } else { shell.openExternal(`https://registry.hub.docker.com/u/${this.props.pending.repo}`); } },
async openIssueURL (repoURL, issueURL, issueTitle) { const issue = await this.findSimilarIssue(repoURL, issueTitle) if (issue) { shell.openExternal(issue.html_url) } else if (process.platform === 'win32') { // Windows will not launch URLs greater than ~2000 bytes so we need to shrink it shell.openExternal((await this.shortenURL(issueURL)) || issueURL) } else { shell.openExternal(issueURL) } }
delegate.on(document.body, 'a', 'click', function (e) { var href = e.target.getAttribute('href') if (/^https?:/.test(href)) { e.preventDefault() shell.openExternal(href) } })
getIPFS().config.get('Addresses.API', (err, res) => { if (err) { // TODO error should be emited to a error panel return console.error(err) } shell.openExternal(apiAddrToUrl(res.Value)) })
npm: function () { var pkg = getPackage() var url = builtins.indexOf(pkg) > -1 ? `https://nodejs.org/api/${pkg}.html` : `http://npmjs.com/package/${pkg}` shell.openExternal(url) }
}, function(response) { if (response === 1) { const url = global.manifest.raffleUrl; log('user clicked "Join the giveaway", opening url', url); shell.openExternal(url); } });
$('#topUser a:contains(SIGN UP)').click(function (e) { e.preventDefault(); var href = baseURL + 'signup.php'; // Open URL with default browser. shell.openExternal(href); });
_onClickToOpenTwitter: function() { var link = ''; link += 'https://twitter.com/intent/tweet?text='; link += 'I%20am%20listening%20music%20on%20Kaku%20!'; link += '%20http%3A%2F%2Fkaku.rocks%20%23kaku_rocks%20'; Shell.openExternal(link); },
mainWindow.webContents.on('new-window', function (event, url) { console.log('Main: new window requested for ' + url); if (_.startsWith(url, 'https://pbs.twimg.com/media/')) { url += ':orig'; } shell.openExternal(url); event.preventDefault(); });
handleClickPreview: function () { if (this.props.defaultPort) { metrics.track('Opened In Browser', { from: 'preview' }); shell.openExternal(this.props.ports[this.props.defaultPort].url); } },
handleRun: function () { if (this.props.defaultPort && !this.disableRun()) { metrics.track('Opened In Browser', { from: 'header' }); shell.openExternal(this.props.ports[this.props.defaultPort].url); } },
$('.flipster').on('click', 'a', function (e) { e.preventDefault(); // Open URL with default browser. shell.openExternal(e.target.href); });
module.exports = function (url, event) { if(isElectronRenderer) { var shell = require('shell'); if (url && url.preventDefault) { event = url; event.preventDefault(); shell.openExternal(event.target.href); } else { event.preventDefault(); shell.openExternal(url); } } else { if (url && !url.preventDefault) { event.preventDefault(); window.location.href = url; } } };
delegate.on(el, 'a', 'click', function (e) { var href = e.target.getAttribute('href') if (/^https?:/.test(href)) { e.preventDefault() shell.openExternal(href) } else if (/^#/.test(href)) { self.emit('addChannel', href) } })
handleRepoClick: function () { var repoUri = 'https://registry.hub.docker.com/'; if (this.props.image.namespace === 'library') { repoUri = repoUri + '_/' + this.props.image.name; } else { repoUri = repoUri + 'u/' + this.props.image.namespace + '/' + this.props.image.name; } shell.openExternal(repoUri); },
handleDocs: function () { let repoUri = 'https://hub.docker.com/r/'; let imageName = this.props.container.Config.Image.split(':')[0]; if (imageName.indexOf('/') === -1) { repoUri = repoUri + 'library/' + imageName; } else { repoUri = repoUri + imageName; } shell.openExternal(repoUri); },
open: function(){ var docid = TabsStore.getCloudDoc(); if (this.target_server.indexOf("http://") == -1 && this.target_server.indexOf('https://') == -1){ var target_server = "http://"+this.target_server; } else { var target_server = this.target_server; } Shell.openExternal(target_server+'/api/1.0/docs/'+docid); this.hide(); },
.then(function() { if (url.indexOf('localhost') >= 0) { // opens mavensmate ui in mavensmate-app chrome mainWindow.webContents.send('openTab', url); mainWindow.show(); } else { // open external url in local browser shell.openExternal(url); } })
callback: () => { let validUrl; if (url.startsWith('http://') || url.startsWith('https://')) { validUrl = url; } else { // Now that we match urls like 'facebook.com', we have to prepend http:// to them for them to // open properly. validUrl = 'http://' + url; } shell.openExternal(validUrl); },
document.querySelector('#out-file').addEventListener('click', function (e) { var href; if (e.target.tagName.toLowerCase() === 'a') { href = e.target.getAttribute('href'); if (href && href.indexOf('#') !== 0) { shell.openExternal(href); e.preventDefault(); } } });
exportHtml(that, template, filePath, function (err, path) { if (err) { if (forceNewPath === true) { // Second try, abort here console.error(err); return; } return that.viewInBrowser(forceNewPath); } shell.openExternal("file://" + filePath); });
click : function() { var tgt = state.data.tweets[menus._refs.tweet], src; if(!tgt) { return; } src = data.source(tgt); shell.openExternal(`https://twitter.com/${src.user.screen_name}/status/${src.id_str}`); }
openPath (filePath) { const processArchitecture = process.platform switch (processArchitecture) { case 'darwin': childProcess.exec(`open "${filePath}"`) break case 'linux': childProcess.exec(`xdg-open "${filePath}"`) break case 'win32': Shell.openExternal(`file:///${filePath}`) break } }
let checkDomElement = function (element) { if (element.nodeName === 'A') { href = element.getAttribute('href'); } if (element.classList.contains('js-external-link')) { isExternal = true; } if (href && isExternal) { shell.openExternal(href); e.preventDefault(); } else if (element.parentElement) { checkDomElement(element.parentElement); } }
getSuggestionForWord: (textEditor, text, range) => { const { link, linkText } = getHyperlink(textEditor, range, this.protocols); if (link) { const linkRange = getRange(textEditor, range, linkText); return { range: linkRange, callback() { shell.openExternal(link); }, }; } },
export function openMDNLandingPage() { let integratedHTTPOpener = false; // Detect if there is a registered opener (e.g. atom-webbrowser). for (const opener of atom.workspace.getOpeners()) { const res = opener(MDN_DOC_URL); if (res) { integratedHTTPOpener = true; break; } } if (!integratedHTTPOpener) { Shell.openExternal(MDN_DOC_URL); } else { // TODO: check if it's already opened. atom.workspace.open(MDN_DOC_URL, { split: 'right' }); } }
export default async function getSuggestionForWord( textEditor: atom$TextEditor, text: string, range: atom$Range ): Promise<?HyperclickSuggestion> { // The match is an array that also has an index property, something that // Flow does not appear to understand. const match: any = urlregexp.exec(text); if (match == null) { return null; } urlregexp.lastIndex = 0; const url = match[0]; const index = match.index; const matchLength = url.length; // Update the range to include only what was matched const urlRange = new Range( [range.start.row, range.start.column + index], [range.end.row, range.start.column + index + matchLength], ); return { range: urlRange, callback() { let validUrl; if (url.startsWith('http://') || url.startsWith('https://')) { validUrl = url; } else { // Now that we match urls like 'facebook.com', we have to prepend // http:// to them for them to open properly. validUrl = 'http://' + url; } shell.openExternal(validUrl); }, }; }
'Enable': function() { localStorage.setItem('platformio-ide:linter-warned', 2); shell.openExternal('http://docs.platformio.org/en/stable/ide/atom.html#smart-code-linter-is-disabled-for-arduino-files'); },
'Install Clang': function() { shell.openExternal('http://docs.platformio.org/en/stable/ide/atom.html#ide-atom-installation-clang'); },
mainWindow.webContents.on('new-window', function(e, url, frame){ e.preventDefault(); shell.openExternal(url); });