From 69dd85819abd711fbe63b4dee5870e9cae5e6883 Mon Sep 17 00:00:00 2001 From: Thomas Tempelmann Date: Thu, 11 Jun 2015 00:39:54 +0200 Subject: [PATCH] Adds Dropbox support. Requires generating and setting of Dropbox "App Key" (see instructions at top of wwwsqldesigner.js) --- dropbox-oauth-receiver.html | 14 +++ index.html | 6 + js/wwwsqldesigner.js | 229 ++++++++++++++++++++++++++++++------ locale/en.xml | 3 + 4 files changed, 216 insertions(+), 36 deletions(-) create mode 100755 dropbox-oauth-receiver.html mode change 100644 => 100755 index.html mode change 100644 => 100755 js/wwwsqldesigner.js mode change 100644 => 100755 locale/en.xml diff --git a/dropbox-oauth-receiver.html b/dropbox-oauth-receiver.html new file mode 100755 index 0000000..fd16bad --- /dev/null +++ b/dropbox-oauth-receiver.html @@ -0,0 +1,14 @@ + + + + + + + +

Dropbox sign-in successful

+ +

Please close this window.

+ + \ No newline at end of file diff --git a/index.html b/index.html old mode 100644 new mode 100755 index a956b10..55c3401 --- a/index.html +++ b/index.html @@ -15,6 +15,7 @@ + @@ -151,6 +152,11 @@ +
+ + + +
diff --git a/js/wwwsqldesigner.js b/js/wwwsqldesigner.js old mode 100644 new mode 100755 index 7e0394d..b1c61ab --- a/js/wwwsqldesigner.js +++ b/js/wwwsqldesigner.js @@ -1,8 +1,31 @@ +/* -------------------- configuration -------------------- */ + +/* + * The key below needs to be set individually by you if you want to use the Dropbox load/save feature. + * To do that, first sign up with Dropbox (may require a specific developer / SDK sign-up), go to + * https://www.dropbox.com/developers/apps and use "Create app" to add a new app. Call it, for instance, + * "wwwsqldesigner", and give it the "App Folder" permission. Unter "OAuth 2", "Redirect URIs", add + * the URL to the "dropbox-oauth-receiver.html" file on your server. E.g, if you install wwwsqldesigner + * on your local web server under "http://localhost/sqldesigner/", then add + * http://localhost/sqldesigner/dropbox-oauth-receiver.html as a Redirection URI. + * Copy the shown "App key" and paste it here below: + */ +var dropboxAppKey = null; // "your app key"; + + +/* -------------------- globals -------------------- */ + function _(str) { /* getText */ if (!(str in window.LOCALE)) { return str; } return window.LOCALE[str]; } +if (typeof String.prototype.endsWith !== 'function') { + String.prototype.endsWith = function(suffix) { + return this.indexOf(suffix, this.length - suffix.length) !== -1; + }; +} + var DATATYPES = false; var LOCALE = {}; var SQL = {}; @@ -1255,6 +1278,7 @@ SQL.IO.prototype.init = function(owner) { }; var ids = ["saveload","clientlocalsave", "clientsave", "clientlocalload", "clientlocallist","clientload", "clientsql", + "clientdropboxsave", "clientdropboxload", "clientdropboxlist", "quicksave", "serversave", "serverload", "serverlist", "serverimport"]; for (var i=0;iInput / Output Save XML Load XML + Save to Dropbox + Load from Dropbox + List from Dropbox Save in Browser Load from Browser List from Browser