Make skydb load examples/home.sky by default.
I had to also register for the text/plain mime-type which turned out to be harder than expected. Mostly due to my confusion with mojo_shell using last-argument-wins argument parsing. R=ianh@google.com Review URL: https://codereview.chromium.org/672363002
This commit is contained in:
parent
3c84485f2a
commit
d79cb9d734
@ -1,7 +1,9 @@
|
||||
#!mojo mojo:sky
|
||||
<sky>
|
||||
<style>
|
||||
h1 { font-size: 2em; margin: 1em; }
|
||||
p { margin: 0.5em 1em; color: #bcd8f5; font-weight: 900; }
|
||||
</style>
|
||||
<h1>about:blank</h1>
|
||||
<p>Welcome to Sky!</p>
|
||||
</sky>
|
||||
|
@ -45,13 +45,17 @@ class Prompt : public mojo::ApplicationDelegate {
|
||||
app->ConnectToService("mojo:sky_viewer", &tracing_);
|
||||
if (app->args().size() > 1)
|
||||
url_ = app->args()[1];
|
||||
else {
|
||||
url_ = "https://raw.githubusercontent.com/domokit/mojo/master/sky/"
|
||||
"examples/home.sky";
|
||||
}
|
||||
}
|
||||
|
||||
virtual bool ConfigureIncomingConnection(
|
||||
mojo::ApplicationConnection* connection) override {
|
||||
connection->ConnectToService(&debugger_);
|
||||
if (!url_.empty())
|
||||
Reload();
|
||||
std::cout << "Loading " << url_ << std::endl;
|
||||
Reload();
|
||||
ScheduleWaitForInput();
|
||||
return true;
|
||||
}
|
||||
|
@ -13,11 +13,18 @@ CONFIG_DIRECTORY = 'Debug'
|
||||
MOJO_SHELL_PATH = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir,
|
||||
os.pardir, BUILD_DIRECTORY, CONFIG_DIRECTORY, 'mojo_shell'))
|
||||
|
||||
SUPPORTED_MIME_TYPES = [
|
||||
'text/html',
|
||||
'text/plain',
|
||||
]
|
||||
|
||||
def main(args):
|
||||
content_handlers = ['%s,%s' % (mime_type, 'mojo://sky_viewer/')
|
||||
for mime_type in SUPPORTED_MIME_TYPES]
|
||||
shell_command = [
|
||||
MOJO_SHELL_PATH,
|
||||
'--v=1',
|
||||
'--content-handlers=text/html,mojo://sky_viewer/',
|
||||
'--content-handlers=%s' % ','.join(content_handlers),
|
||||
'--url-mappings=mojo:window_manager=mojo:sky_debugger',
|
||||
'mojo:window_manager',
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user