Skip to content

Commit

Permalink
Initial release of the Anvil Runtime and App Server
Browse files Browse the repository at this point in the history
Based-on: anvil 4be7f592153266384fd9669fec39570fcde1b6b3
  • Loading branch information
meredydd committed May 6, 2020
0 parents commit 4ccb5c4
Show file tree
Hide file tree
Showing 670 changed files with 72,105 additions and 0 deletions.
682 changes: 682 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

351 changes: 351 additions & 0 deletions README.md

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions client/403-app-no-key.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="en" class="no-js runner">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>This App is Not Public</title>

<link rel="stylesheet" href="{{cdn-origin}}/runtime/css/bootstrap.css?buildTime=0">
<link rel="stylesheet" href="{{cdn-origin}}/runtime/css/bootstrap-theme.min.css?buildTime=0">

<script src="{{cdn-origin}}/runtime/node_modules/html5-boilerplate/dist/js/vendor/modernizr-3.8.0.min.js?buildTime=0"></script>


<script src="{{cdn-origin}}/runtime/node_modules/jquery/dist/jquery.min.js?buildTime=0"></script>
<script src="{{cdn-origin}}/runtime/node_modules/bootstrap/dist/js/bootstrap.min.js?buildTime=0"></script>

</head>
<body>

<div class="panel panel-default warning-not-found" style="margin: 20%">
<div class="panel-body">
<div class="alert alert-danger" role="alert"><b>This application is private.</b></div>

<p>
To access this application, you need its secret URL.
If you are the owner of this app, you can copy and paste it from the Publish dialog in the Anvil editor.
</p>
</div>
</div>

</body>
</html>
34 changes: 34 additions & 0 deletions client/404-app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en" class="no-js runner">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>App Not Found</title>

<link rel="stylesheet" href="{{cdn-origin}}/runtime/css/bootstrap.css?buildTime=0">
<link rel="stylesheet" href="{{cdn-origin}}/runtime/css/bootstrap-theme.min.css?buildTime=0">

<script src="{{cdn-origin}}/runtime/node_modules/html5-boilerplate/dist/js/vendor/modernizr-3.8.0.min.js?buildTime=0"></script>


<script src="{{cdn-origin}}/runtime/node_modules/jquery/dist/jquery.min.js?buildTime=0"></script>
<script src="{{cdn-origin}}/runtime/node_modules/bootstrap/dist/js/bootstrap.min.js?buildTime=0"></script>

</head>
<body>

<div class="panel panel-default warning-not-found" style="margin: 20%">
<div class="panel-body">
<div class="alert alert-danger" role="alert"><b>We could not find an app that matched your request.</b></div>

<p>
You may have copied the URL for this app incorrectly,
or this app may have been deleted or withdrawn. You may
also have been logged out, in which case refreshing this page might help.
</p>
</div>
</div>

</body>
</html>
35 changes: 35 additions & 0 deletions client/500-app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en" class="no-js runner">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>App Error</title>

<link rel="stylesheet" href="{{cdn-origin}}/runtime/css/bootstrap.css?buildTime=0">
<link rel="stylesheet" href="{{cdn-origin}}/runtime/css/bootstrap-theme.min.css?buildTime=0">

<script src="{{cdn-origin}}/runtime/node_modules/html5-boilerplate/dist/js/vendor/modernizr-3.8.0.min.js?buildTime=0"></script>


<script src="{{cdn-origin}}/runtime/node_modules/jquery/dist/jquery.min.js?buildTime=0"></script>
<script src="{{cdn-origin}}/runtime/node_modules/bootstrap/dist/js/bootstrap.min.js?buildTime=0"></script>

</head>
<body>

<div class="panel panel-default warning-not-found" style="margin: 20%">
<div class="panel-body">
<div class="alert alert-danger" role="alert"><b>The app you requested could not be loaded.</b></div>

<p>
This app may be misconfigured. The following error occurred:
</p>
<p>
<code>{{anvil-error}}</code>
</p>
</div>
</div>

</body>
</html>
22 changes: 22 additions & 0 deletions client/client_auth_error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<html>
<head>
</head>
<body>

<script>

// The error message will be our hash

var err = decodeURIComponent(window.location.hash.substring(1).replace(/\+/g,"%20"));
var params = { fn: "clientAuthErrorCallback", args: { message: err } };

if (window.opener) {
window.opener.postMessage(params, "*");
}

window.close();

</script>

</body>
</html>
40 changes: 40 additions & 0 deletions client/client_auth_success.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<html>
<head>
</head>
<body>

<script>

var args = {};
var params = { fn: "clientAuthSuccessCallback", args: args };

qsParams = window.location.search.substring(1).split("&");
for (var i in qsParams) {
var p = qsParams[i].split("=")[0];
var q = qsParams[i].split("=")[1];

args[p] = decodeURIComponent(q);
}

var origin = "{{canonical-url}}";

// This gets used in the IDE and the runtime. Ick.
if (origin == "{{canonical-url}}") {
origin = "*";
}

// For some reason, window.opener is null after a Stripe OAuth flow.
// In that case, we just have to watch from the parent, waiting for a
// flag to say we're done.
if (window.opener) {
// TODO: Origin might be a full URL with path, does this really work?
window.opener.postMessage(params, origin);
}

window.callbackDone = true;
window.close();

</script>

</body>
</html>
5 changes: 5 additions & 0 deletions client/css/bootstrap-theme.min.css

Large diffs are not rendered by default.

Loading

0 comments on commit 4ccb5c4

Please sign in to comment.