mirror of https://github.com/docker/docs.git
Changing protocol to Docker
This commit is contained in:
parent
4a5162ba23
commit
9e2c11f6d0
20
src/Main.js
20
src/Main.js
|
|
@ -34,10 +34,22 @@ ipc.on('application:quitting', opts => {
|
|||
});
|
||||
|
||||
ipc.on('application:open-url', opts => {
|
||||
console.log('Creating container');
|
||||
var url = opts.url.substr(19);
|
||||
console.log(url);
|
||||
ContainerStore.create(url, 'latest', () => {});
|
||||
console.log('Creating container from protocol');
|
||||
var parser = document.createElement('a');
|
||||
parser.href = opts.url;
|
||||
|
||||
if (parser.protocol !== 'docker:') {
|
||||
return;
|
||||
}
|
||||
|
||||
var pathname = parser.pathname.replace('//', '');
|
||||
var slash = pathname.indexOf('/');
|
||||
var base = pathname.slice(0, slash);
|
||||
|
||||
if (base === 'runRepo') {
|
||||
var repo = pathname.substring(slash + 1);
|
||||
ContainerStore.create(repo, 'latest', () => {});
|
||||
}
|
||||
});
|
||||
|
||||
SetupStore.setup().then(() => {
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@
|
|||
<dict>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>kitematic</string>
|
||||
<string>docker</string>
|
||||
</array>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>Kitematic Session Protocol</string>
|
||||
<string>Docker App Protocol</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
|
|
|
|||
Loading…
Reference in New Issue