dropbox conf in config.js, fixed button hiding
This commit is contained in:
+14
-1
@@ -13,5 +13,18 @@ var CONFIG = {
|
||||
RELATION_COLORS: ["#000", "#800", "#080", "#008", "#088", "#808", "#088"],
|
||||
|
||||
STATIC_PATH: "",
|
||||
XHR_PATH: ""
|
||||
XHR_PATH: "",
|
||||
|
||||
/*
|
||||
* 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:
|
||||
*/
|
||||
DROPBOX_KEY: null // "your app key";
|
||||
|
||||
}
|
||||
|
||||
@@ -1,20 +1,3 @@
|
||||
/* -------------------- 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];
|
||||
|
||||
@@ -33,6 +33,9 @@ SQL.IO.prototype.init = function(owner) {
|
||||
this.dom.ta = OZ.$("textarea");
|
||||
this.dom.backend = OZ.$("backend");
|
||||
|
||||
/* init dropbox before hiding the container so it can adjust its buttons */
|
||||
this.dropBoxInit();
|
||||
|
||||
this.dom.container.parentNode.removeChild(this.dom.container);
|
||||
this.dom.container.style.visibility = "";
|
||||
|
||||
@@ -58,8 +61,6 @@ SQL.IO.prototype.init = function(owner) {
|
||||
OZ.Event.add(this.dom.serverimport, "click", this.bind(this.serverimport));
|
||||
OZ.Event.add(document, "keydown", this.bind(this.press));
|
||||
this.build();
|
||||
|
||||
this.dropBoxInit ();
|
||||
}
|
||||
|
||||
SQL.IO.prototype.build = function() {
|
||||
@@ -225,18 +226,15 @@ SQL.IO.prototype.clientlocallist = function() {
|
||||
|
||||
/* ------------------------- Dropbox start ------------------------ */
|
||||
|
||||
/*
|
||||
/**
|
||||
* The following code uses this lib: https://github.com/dropbox/dropbox-js
|
||||
*/
|
||||
|
||||
SQL.IO.prototype.dropBoxInit = function()
|
||||
{
|
||||
if (dropboxAppKey) {
|
||||
this.dropboxClient = new Dropbox.Client({ key: dropboxAppKey });
|
||||
SQL.IO.prototype.dropBoxInit = function() {
|
||||
if (CONFIG.DROPBOX_KEY) {
|
||||
this.dropboxClient = new Dropbox.Client({ key: CONFIG.DROPBOX_KEY });
|
||||
} else {
|
||||
this.dropboxClient = null;
|
||||
|
||||
// Hide the Dropbox buttons and divider
|
||||
// Hide the Dropbox buttons
|
||||
var elems = document.querySelectorAll("[id^=dropbox]"); // gets all tags whose id start with "dropbox"
|
||||
[].slice.call(elems).forEach(
|
||||
function(elem) { elem.style.display = "none"; }
|
||||
|
||||
Reference in New Issue
Block a user