Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e314c7e04f | ||
|
|
858d72e4f8 | ||
|
|
2a4585a6e0 | ||
|
|
c18d820196 | ||
|
|
9ff7bfe0ff | ||
|
|
36cd5e5acd | ||
|
|
c58effb21a | ||
|
|
3d63ad90e1 | ||
|
|
35b4c67a4a |
+11
-49
@@ -10,8 +10,6 @@
|
|||||||
<meta name="viewport" content="initial-scale=1,maximum-scale=1" />
|
<meta name="viewport" content="initial-scale=1,maximum-scale=1" />
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="stylesheet" href="styles/style.css" media="all" />
|
<link rel="stylesheet" href="styles/style.css" media="all" />
|
||||||
<!--[if IE 6]><link rel="stylesheet" type="text/css" href="styles/ie6.css" /><![endif]-->
|
|
||||||
<!--[if IE 7]><link rel="stylesheet" type="text/css" href="styles/ie7.css" /><![endif]-->
|
|
||||||
<link rel="stylesheet" href="styles/print.css" type="text/css" media="print" />
|
<link rel="stylesheet" href="styles/print.css" type="text/css" media="print" />
|
||||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/dropbox.js/0.10.2/dropbox.min.js"></script>
|
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/dropbox.js/0.10.2/dropbox.min.js"></script>
|
||||||
|
|
||||||
@@ -27,6 +25,11 @@
|
|||||||
<script src="js/map.js"></script>
|
<script src="js/map.js"></script>
|
||||||
<script src="js/toggle.js"></script>
|
<script src="js/toggle.js"></script>
|
||||||
<script src="js/io.js"></script>
|
<script src="js/io.js"></script>
|
||||||
|
<script src="js/storage.js"></script>
|
||||||
|
<script src="js/storage.browser.js"></script>
|
||||||
|
<script src="js/storage.clipboard.js"></script>
|
||||||
|
<script src="js/storage.rest.js"></script>
|
||||||
|
<script src="js/storage.dropbox.js"></script>
|
||||||
<script src="js/tablemanager.js"></script>
|
<script src="js/tablemanager.js"></script>
|
||||||
<script src="js/rowmanager.js"></script>
|
<script src="js/rowmanager.js"></script>
|
||||||
<script src="js/keymanager.js"></script>
|
<script src="js/keymanager.js"></script>
|
||||||
@@ -41,7 +44,7 @@
|
|||||||
<div id="controls">
|
<div id="controls">
|
||||||
<div id="bar">
|
<div id="bar">
|
||||||
<div id="toggle"></div>
|
<div id="toggle"></div>
|
||||||
<input type="button" id="saveload" />
|
<button id="saveload"></button>
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
@@ -160,53 +163,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="io">
|
<div id="io">
|
||||||
<table>
|
<span id="storage"></span>: <select></select>
|
||||||
<tbody>
|
<div id="io-content"></div>
|
||||||
<tr>
|
|
||||||
<td style="width:60%">
|
|
||||||
<fieldset>
|
|
||||||
<legend id="client"></legend>
|
|
||||||
<div id="singlerow">
|
|
||||||
<input type="button" id="clientsave" />
|
|
||||||
<input type="button" id="clientload" />
|
|
||||||
</div>
|
|
||||||
<div id="singlerow">
|
|
||||||
<input type="button" id="clientlocalsave" />
|
|
||||||
<input type="button" id="clientlocalload" />
|
|
||||||
<input type="button" id="clientlocallist" />
|
|
||||||
</div>
|
|
||||||
<div id="singlerow">
|
|
||||||
<input type="button" id="dropboxsave" /><!-- may get hidden by dropBoxInit() -->
|
|
||||||
<input type="button" id="dropboxload" /><!-- may get hidden by dropBoxInit() -->
|
|
||||||
<input type="button" id="dropboxlist" /><!-- may get hidden by dropBoxInit() -->
|
|
||||||
</div>
|
|
||||||
<hr/>
|
<hr/>
|
||||||
<input type="button" id="clientsql" />
|
<button id="quicksave"></button>
|
||||||
</fieldset>
|
<button id="clientsql"></button>
|
||||||
</td>
|
<textarea id="textarea" rows="1" cols="1"></textarea>
|
||||||
<td style="width:40%">
|
|
||||||
<fieldset>
|
|
||||||
<legend id="server"></legend>
|
|
||||||
<label for="backend" id="backendlabel"></label> <select id="backend"><option></option></select>
|
|
||||||
<hr/>
|
|
||||||
<input type="button" id="serversave" />
|
|
||||||
<input type="button" id="quicksave" />
|
|
||||||
<input type="button" id="serverload" />
|
|
||||||
<input type="button" id="serverlist" />
|
|
||||||
<input type="button" id="serverimport" />
|
|
||||||
</fieldset>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
<fieldset>
|
|
||||||
<legend id="output"></legend>
|
|
||||||
<textarea id="textarea" rows="1" cols="1"></textarea><!--modified by javascript later-->
|
|
||||||
</fieldset>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="keys">
|
<div id="keys">
|
||||||
|
|||||||
@@ -26,5 +26,4 @@ var CONFIG = {
|
|||||||
* Copy the shown "App key" and paste it here below instead of the null value:
|
* Copy the shown "App key" and paste it here below instead of the null value:
|
||||||
*/
|
*/
|
||||||
DROPBOX_KEY: null // such as: "d6stdscwewhl6sa"
|
DROPBOX_KEY: null // such as: "d6stdscwewhl6sa"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,90 +1,64 @@
|
|||||||
SQL.IO = function(owner) {
|
SQL.IO = function(owner) {
|
||||||
this.owner = owner;
|
this.owner = owner;
|
||||||
this._name = ""; /* last used name with server load/save */
|
this._storages = [];
|
||||||
this.lastUsedName = ""; /* last used name with local storage or dropbox load/save */
|
this._currentStorage = null;
|
||||||
|
|
||||||
this.dom = {
|
this.dom = {
|
||||||
container:OZ.$("io")
|
container: OZ.$("io"),
|
||||||
|
content: OZ.$("io-content"),
|
||||||
|
seelct: null
|
||||||
};
|
};
|
||||||
|
|
||||||
var ids = ["saveload","clientlocalsave", "clientsave", "clientlocalload", "clientlocallist","clientload", "clientsql",
|
this.dom.select = this.dom.container.querySelector("select");
|
||||||
"dropboxsave", "dropboxload", "dropboxlist",
|
this.dom.ta = OZ.$("textarea");
|
||||||
"quicksave", "serversave", "serverload",
|
|
||||||
"serverlist", "serverimport"];
|
var ids = ["saveload", "storage", "quicksave", "clientsql"];
|
||||||
for (var i=0;i<ids.length;i++) {
|
for (var i=0;i<ids.length;i++) {
|
||||||
var id = ids[i];
|
var id = ids[i];
|
||||||
var elm = OZ.$(id);
|
var elm = OZ.$(id);
|
||||||
this.dom[id] = elm;
|
this.dom[id] = elm;
|
||||||
elm.value = _(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.dom.quicksave.value += " (F2)";
|
|
||||||
|
|
||||||
var ids = ["client","server","output","backendlabel"];
|
|
||||||
for (var i=0;i<ids.length;i++) {
|
|
||||||
var id = ids[i];
|
|
||||||
var elm = OZ.$(id);
|
|
||||||
elm.innerHTML = _(id);
|
elm.innerHTML = _(id);
|
||||||
}
|
}
|
||||||
|
this.dom.quicksave.innerHTML += " (F2)";
|
||||||
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.parentNode.removeChild(this.dom.container);
|
||||||
this.dom.container.style.visibility = "";
|
|
||||||
|
|
||||||
this.saveresponse = this.saveresponse.bind(this);
|
|
||||||
this.loadresponse = this.loadresponse.bind(this);
|
|
||||||
this.listresponse = this.listresponse.bind(this);
|
|
||||||
this.importresponse = this.importresponse.bind(this);
|
|
||||||
|
|
||||||
OZ.Event.add(this.dom.saveload, "click", this.click.bind(this));
|
OZ.Event.add(this.dom.saveload, "click", this.click.bind(this));
|
||||||
OZ.Event.add(this.dom.clientlocalsave, "click", this.clientlocalsave.bind(this));
|
OZ.Event.add(this.dom.clientsql, "click", this._clientsql.bind(this));
|
||||||
OZ.Event.add(this.dom.clientsave, "click", this.clientsave.bind(this));
|
OZ.Event.add(this.dom.quicksave, "click", this._quicksave.bind(this));
|
||||||
OZ.Event.add(this.dom.clientlocalload, "click", this.clientlocalload.bind(this));
|
OZ.Event.add(this.dom.select, "change", this._storageChange.bind(this));
|
||||||
OZ.Event.add(this.dom.clientlocallist, "click", this.clientlocallist.bind(this));
|
OZ.Event.add(window, "keydown", this._keydown.bind(this));
|
||||||
OZ.Event.add(this.dom.clientload, "click", this.clientload.bind(this));
|
this._build();
|
||||||
OZ.Event.add(this.dom.dropboxload, "click", this.dropboxload.bind(this));
|
|
||||||
OZ.Event.add(this.dom.dropboxsave, "click", this.dropboxsave.bind(this));
|
|
||||||
OZ.Event.add(this.dom.dropboxlist, "click", this.dropboxlist.bind(this));
|
|
||||||
OZ.Event.add(this.dom.clientsql, "click", this.clientsql.bind(this));
|
|
||||||
OZ.Event.add(this.dom.quicksave, "click", this.quicksave.bind(this));
|
|
||||||
OZ.Event.add(this.dom.serversave, "click", this.serversave.bind(this));
|
|
||||||
OZ.Event.add(this.dom.serverload, "click", this.serverload.bind(this));
|
|
||||||
OZ.Event.add(this.dom.serverlist, "click", this.serverlist.bind(this));
|
|
||||||
OZ.Event.add(this.dom.serverimport, "click", this.serverimport.bind(this));
|
|
||||||
OZ.Event.add(document, "keydown", this.press.bind(this));
|
|
||||||
this.build();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SQL.IO.prototype.build = function() {
|
SQL.IO.prototype._build = function() {
|
||||||
OZ.DOM.clear(this.dom.backend);
|
var local = document.createElement("optgroup");
|
||||||
|
local.label = "Local";
|
||||||
|
this.dom.select.appendChild(local);
|
||||||
|
|
||||||
var bs = CONFIG.AVAILABLE_BACKENDS;
|
var remote = document.createElement("optgroup");
|
||||||
var be = CONFIG.DEFAULT_BACKEND;
|
remote.label = "Remote";
|
||||||
var r = window.location.search.substring(1).match(/backend=([^&]*)/);
|
this.dom.select.appendChild(remote);
|
||||||
if (r) {
|
|
||||||
req = r[1];
|
this._addStorage(SQL.Storage.Browser, local);
|
||||||
if (bs.indexOf(req) != -1) {
|
this._addStorage(SQL.Storage.Clipboard, local);
|
||||||
be = req;
|
this._addStorage(SQL.Storage.REST, remote);
|
||||||
}
|
this._addStorage(SQL.Storage.Dropbox, remote);
|
||||||
}
|
|
||||||
for (var i=0;i<bs.length;i++) {
|
this._setStorage(2);
|
||||||
var o = OZ.DOM.elm("option");
|
}
|
||||||
o.value = bs[i];
|
|
||||||
o.innerHTML = bs[i];
|
SQL.IO.prototype.getArea = function() {
|
||||||
this.dom.backend.appendChild(o);
|
return this.dom.ta;
|
||||||
if (bs[i] == be) { this.dom.backend.selectedIndex = i; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SQL.IO.prototype.click = function() { /* open io dialog */
|
SQL.IO.prototype.click = function() { /* open io dialog */
|
||||||
this.build();
|
|
||||||
this.dom.ta.value = "";
|
this.dom.ta.value = "";
|
||||||
this.dom.clientsql.value = _("clientsql") + " (" + window.DATATYPES.getAttribute("db") + ")";
|
this.dom.clientsql.value = _("clientsql") + " (" + window.DATATYPES.getAttribute("db") + ")";
|
||||||
this.owner.window.open(_("saveload"),this.dom.container);
|
this.owner.window.open(_("saveload"), this.dom.container);
|
||||||
|
|
||||||
|
var index = this._storages.indexOf(this._currentStorage);
|
||||||
|
this._setStorage(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
SQL.IO.prototype.fromXMLText = function(xml) {
|
SQL.IO.prototype.fromXMLText = function(xml) {
|
||||||
@@ -115,268 +89,14 @@ SQL.IO.prototype.fromXML = function(xmlDoc) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SQL.IO.prototype.clientsave = function() {
|
SQL.IO.prototype._clientsql = function() {
|
||||||
var xml = this.owner.toXML();
|
|
||||||
this.dom.ta.value = xml;
|
|
||||||
}
|
|
||||||
|
|
||||||
SQL.IO.prototype.clientload = function() {
|
|
||||||
var xml = this.dom.ta.value;
|
|
||||||
if (!xml) {
|
|
||||||
alert(_("empty"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.fromXMLText(xml);
|
|
||||||
}
|
|
||||||
|
|
||||||
SQL.IO.prototype.promptName = function(title, suffix) {
|
|
||||||
var lastUsedName = this.owner.getOption("lastUsedName") || this.lastUsedName;
|
|
||||||
var name = prompt(_(title), lastUsedName);
|
|
||||||
if (!name) { return null; }
|
|
||||||
if (suffix && name.endsWith(suffix)) {
|
|
||||||
// remove suffix from name
|
|
||||||
name = name.substr(0, name.length-4);
|
|
||||||
}
|
|
||||||
this.owner.setOption("lastUsedName", name);
|
|
||||||
this.lastUsedName = name; // save this also in variable in case cookies are disabled
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
SQL.IO.prototype.clientlocalsave = function() {
|
|
||||||
if (!window.localStorage) {
|
|
||||||
alert("Sorry, your browser does not seem to support localStorage.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var xml = this.owner.toXML();
|
|
||||||
if (xml.length >= (5*1024*1024)/2) { /* this is a very big db structure... */
|
|
||||||
alert("Warning: your database structure is above 5 megabytes in size, this is above the localStorage single key limit allowed by some browsers, example Mozilla Firefox 10");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var key = this.promptName("serversaveprompt");
|
|
||||||
if (!key) { return; }
|
|
||||||
|
|
||||||
key = "wwwsqldesigner_databases_" + (key || "default");
|
|
||||||
|
|
||||||
try {
|
|
||||||
localStorage.setItem(key, xml);
|
|
||||||
if (localStorage.getItem(key) != xml) { throw new Error("Content verification failed"); }
|
|
||||||
} catch (e) {
|
|
||||||
alert("Error saving database structure to localStorage! ("+e.message+")");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SQL.IO.prototype.clientlocalload = function() {
|
|
||||||
if (!window.localStorage) {
|
|
||||||
alert("Sorry, your browser does not seem to support localStorage.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var key = this.promptName("serverloadprompt");
|
|
||||||
if (!key) { return; }
|
|
||||||
|
|
||||||
key = "wwwsqldesigner_databases_" + (key || "default");
|
|
||||||
|
|
||||||
try {
|
|
||||||
var xml = localStorage.getItem(key);
|
|
||||||
if (!xml) { throw new Error("No data available"); }
|
|
||||||
} catch (e) {
|
|
||||||
alert("Error loading database structure from localStorage! ("+e.message+")");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.fromXMLText(xml);
|
|
||||||
}
|
|
||||||
|
|
||||||
SQL.IO.prototype.clientlocallist = function() {
|
|
||||||
if (!window.localStorage) {
|
|
||||||
alert("Sorry, your browser does not seem to support localStorage.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --- Define some useful vars --- */
|
|
||||||
var baseKeysName = "wwwsqldesigner_databases_";
|
|
||||||
var localLen = localStorage.length;
|
|
||||||
var data = "";
|
|
||||||
var schemasFound = false;
|
|
||||||
var code = 200;
|
|
||||||
|
|
||||||
/* --- work --- */
|
|
||||||
try {
|
|
||||||
for (var i = 0; i< localLen; ++i) {
|
|
||||||
var key = localStorage.key(i);
|
|
||||||
if((new RegExp(baseKeysName)).test(key)) {
|
|
||||||
var result = key.substring(baseKeysName.length);
|
|
||||||
schemasFound = true;
|
|
||||||
data += result + "\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!schemasFound) {
|
|
||||||
throw new Error("No data available");
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
alert("Error loading database names from localStorage! ("+e.message+")");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.listresponse(data, code);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ------------------------- Dropbox start ------------------------ */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The following code uses this lib: https://github.com/dropbox/dropbox-js
|
|
||||||
*/
|
|
||||||
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
|
|
||||||
var elems = document.querySelectorAll("[id^=dropbox]"); // gets all tags whose id start with "dropbox"
|
|
||||||
[].slice.call(elems).forEach(
|
|
||||||
function(elem) { elem.style.display = "none"; }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SQL.IO.prototype.showDropboxError = function(error) {
|
|
||||||
var prefix = _("Dropbox error")+": ";
|
|
||||||
var msg = error.status;
|
|
||||||
|
|
||||||
switch (error.status) {
|
|
||||||
case Dropbox.ApiError.INVALID_TOKEN:
|
|
||||||
// If you're using dropbox.js, the only cause behind this error is that
|
|
||||||
// the user token expired.
|
|
||||||
// Get the user through the authentication flow again.
|
|
||||||
msg = _("Token expired - retry the operation, authenticating again with Dropbox");
|
|
||||||
this.dropboxClient.reset();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Dropbox.ApiError.NOT_FOUND:
|
|
||||||
// The file or folder you tried to access is not in the user's Dropbox.
|
|
||||||
// Handling this error is specific to your application.
|
|
||||||
msg = _("File not found");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Dropbox.ApiError.OVER_QUOTA:
|
|
||||||
// The user is over their Dropbox quota.
|
|
||||||
// Tell them their Dropbox is full. Refreshing the page won't help.
|
|
||||||
msg = _("Dropbox is full");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Dropbox.ApiError.RATE_LIMITED:
|
|
||||||
// Too many API requests. Tell the user to try again later.
|
|
||||||
// Long-term, optimize your code to use fewer API calls.
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Dropbox.ApiError.NETWORK_ERROR:
|
|
||||||
// An error occurred at the XMLHttpRequest layer.
|
|
||||||
// Most likely, the user's network connection is down.
|
|
||||||
// API calls will not succeed until the user gets back online.
|
|
||||||
msg = _("Network error");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Dropbox.ApiError.INVALID_PARAM:
|
|
||||||
case Dropbox.ApiError.OAUTH_ERROR:
|
|
||||||
case Dropbox.ApiError.INVALID_METHOD:
|
|
||||||
default:
|
|
||||||
// Caused by a bug in dropbox.js, in your application, or in Dropbox.
|
|
||||||
// Tell the user an error occurred, ask them to refresh the page.
|
|
||||||
}
|
|
||||||
|
|
||||||
alert (prefix+msg);
|
|
||||||
};
|
|
||||||
|
|
||||||
SQL.IO.prototype.showDropboxAuthenticate = function(connectedCallBack) {
|
|
||||||
if (!this.dropboxClient) return false;
|
|
||||||
|
|
||||||
// We want to use a popup window for authentication as the default redirection won't work for us as it'll make us lose our schema data
|
|
||||||
var href = window.location.href;
|
|
||||||
var prefix = href.substring(0, href.lastIndexOf('/')) + "/";
|
|
||||||
this.dropboxClient.authDriver(new Dropbox.AuthDriver.Popup({ receiverUrl: prefix+"dropbox-oauth-receiver.html" }));
|
|
||||||
|
|
||||||
// Now let's authenticate us
|
|
||||||
var sql_io = this;
|
|
||||||
sql_io.dropboxClient.authenticate( function(error, client) {
|
|
||||||
if (error) {
|
|
||||||
sql_io.showDropboxError(error);
|
|
||||||
} else {
|
|
||||||
// We're authenticated
|
|
||||||
connectedCallBack();
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
});
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
SQL.IO.prototype.dropboxsave = function() {
|
|
||||||
var sql_io = this;
|
|
||||||
sql_io.showDropboxAuthenticate( function() {
|
|
||||||
var key = sql_io.promptName("serversaveprompt", ".xml");
|
|
||||||
if (!key) { return; }
|
|
||||||
|
|
||||||
var filename = (key || "default") + ".xml";
|
|
||||||
|
|
||||||
sql_io.listresponse("Saving...", 200);
|
|
||||||
var xml = sql_io.owner.toXML();
|
|
||||||
sql_io.dropboxClient.writeFile(filename, xml, function(error, stat) {
|
|
||||||
if (error) {
|
|
||||||
sql_io.listresponse("", 200);
|
|
||||||
return sql_io.showDropboxError(error);
|
|
||||||
}
|
|
||||||
sql_io.listresponse(filename+" "+_("was saved to Dropbox"), 200);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
SQL.IO.prototype.dropboxload = function() {
|
|
||||||
var sql_io = this;
|
|
||||||
sql_io.showDropboxAuthenticate( function() {
|
|
||||||
var key = sql_io.promptName("serverloadprompt", ".xml");
|
|
||||||
if (!key) { return; }
|
|
||||||
|
|
||||||
var filename = (key || "default") + ".xml";
|
|
||||||
|
|
||||||
sql_io.listresponse("Loading...", 200);
|
|
||||||
sql_io.dropboxClient.readFile(filename, function(error, data) {
|
|
||||||
sql_io.listresponse("", 200);
|
|
||||||
if (error) {
|
|
||||||
return sql_io.showDropboxError(error);
|
|
||||||
}
|
|
||||||
sql_io.fromXMLText(data);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
SQL.IO.prototype.dropboxlist = function() {
|
|
||||||
var sql_io = this;
|
|
||||||
sql_io.showDropboxAuthenticate( function() {
|
|
||||||
sql_io.listresponse("Loading...", 200);
|
|
||||||
sql_io.dropboxClient.readdir("/", function(error, entries) {
|
|
||||||
if (error) {
|
|
||||||
sql_io.listresponse("", 200);
|
|
||||||
return sql_io.showDropboxError(error);
|
|
||||||
}
|
|
||||||
var data = entries.join("\n")+"\n";
|
|
||||||
sql_io.listresponse(data, 200);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------- Dropbox end ------------------------ */
|
|
||||||
|
|
||||||
SQL.IO.prototype.clientsql = function() {
|
|
||||||
var bp = this.owner.getOption("staticpath");
|
var bp = this.owner.getOption("staticpath");
|
||||||
var path = bp + "db/"+window.DATATYPES.getAttribute("db")+"/output.xsl";
|
var path = bp + "db/"+window.DATATYPES.getAttribute("db")+"/output.xsl";
|
||||||
this.owner.window.showThrobber();
|
this.owner.window.showThrobber();
|
||||||
OZ.Request(path, this.finish.bind(this), {xml:true});
|
OZ.Request(path, this._transform.bind(this), {xml:true});
|
||||||
}
|
}
|
||||||
|
|
||||||
SQL.IO.prototype.finish = function(xslDoc) {
|
SQL.IO.prototype._transform = function(xslDoc) {
|
||||||
this.owner.window.hideThrobber();
|
this.owner.window.hideThrobber();
|
||||||
var xml = this.owner.toXML();
|
var xml = this.owner.toXML();
|
||||||
var sql = "";
|
var sql = "";
|
||||||
@@ -402,98 +122,41 @@ SQL.IO.prototype.finish = function(xslDoc) {
|
|||||||
this.dom.ta.value = sql.trim();
|
this.dom.ta.value = sql.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
SQL.IO.prototype.serversave = function(e, keyword) {
|
SQL.IO.prototype._quicksave = function(e) {
|
||||||
var name = keyword || prompt(_("serversaveprompt"), this._name);
|
this._currentStorage.quicksave(e);
|
||||||
if (!name) { return; }
|
|
||||||
this._name = name;
|
|
||||||
var xml = this.owner.toXML();
|
|
||||||
var bp = this.owner.getOption("xhrpath");
|
|
||||||
var url = bp + "backend/"+this.dom.backend.value+"/?action=save&keyword="+encodeURIComponent(name);
|
|
||||||
var h = {"Content-type":"application/xml"};
|
|
||||||
this.owner.window.showThrobber();
|
|
||||||
this.owner.setTitle(name);
|
|
||||||
OZ.Request(url, this.saveresponse, {xml:true, method:"post", data:xml, headers:h});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SQL.IO.prototype.quicksave = function(e) {
|
SQL.IO.prototype._keydown = function(e) {
|
||||||
this.serversave(e, this._name);
|
|
||||||
}
|
|
||||||
|
|
||||||
SQL.IO.prototype.serverload = function(e, keyword) {
|
|
||||||
var name = keyword || prompt(_("serverloadprompt"), this._name);
|
|
||||||
if (!name) { return; }
|
|
||||||
this._name = name;
|
|
||||||
var bp = this.owner.getOption("xhrpath");
|
|
||||||
var url = bp + "backend/"+this.dom.backend.value+"/?action=load&keyword="+encodeURIComponent(name);
|
|
||||||
this.owner.window.showThrobber();
|
|
||||||
this.name = name;
|
|
||||||
OZ.Request(url, this.loadresponse, {xml:true});
|
|
||||||
}
|
|
||||||
|
|
||||||
SQL.IO.prototype.serverlist = function(e) {
|
|
||||||
var bp = this.owner.getOption("xhrpath");
|
|
||||||
var url = bp + "backend/"+this.dom.backend.value+"/?action=list";
|
|
||||||
this.owner.window.showThrobber();
|
|
||||||
OZ.Request(url, this.listresponse);
|
|
||||||
}
|
|
||||||
|
|
||||||
SQL.IO.prototype.serverimport = function(e) {
|
|
||||||
var name = prompt(_("serverimportprompt"), "");
|
|
||||||
if (!name) { return; }
|
|
||||||
var bp = this.owner.getOption("xhrpath");
|
|
||||||
var url = bp + "backend/"+this.dom.backend.value+"/?action=import&database="+name;
|
|
||||||
this.owner.window.showThrobber();
|
|
||||||
OZ.Request(url, this.importresponse, {xml:true});
|
|
||||||
}
|
|
||||||
|
|
||||||
SQL.IO.prototype.check = function(code) {
|
|
||||||
switch (code) {
|
|
||||||
case 201:
|
|
||||||
case 404:
|
|
||||||
case 500:
|
|
||||||
case 501:
|
|
||||||
case 503:
|
|
||||||
var lang = "http"+code;
|
|
||||||
this.dom.ta.value = _("httpresponse")+": "+_(lang);
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
default: return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SQL.IO.prototype.saveresponse = function(data, code) {
|
|
||||||
this.owner.window.hideThrobber();
|
|
||||||
this.check(code);
|
|
||||||
}
|
|
||||||
|
|
||||||
SQL.IO.prototype.loadresponse = function(data, code) {
|
|
||||||
this.owner.window.hideThrobber();
|
|
||||||
if (!this.check(code)) { return; }
|
|
||||||
this.fromXML(data);
|
|
||||||
this.owner.setTitle(this.name);
|
|
||||||
}
|
|
||||||
|
|
||||||
SQL.IO.prototype.listresponse = function(data, code) {
|
|
||||||
this.owner.window.hideThrobber();
|
|
||||||
if (!this.check(code)) { return; }
|
|
||||||
this.dom.ta.value = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
SQL.IO.prototype.importresponse = function(data, code) {
|
|
||||||
this.owner.window.hideThrobber();
|
|
||||||
if (!this.check(code)) { return; }
|
|
||||||
if (this.fromXML(data)) {
|
|
||||||
this.owner.alignTables();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SQL.IO.prototype.press = function(e) {
|
|
||||||
switch (e.keyCode) {
|
switch (e.keyCode) {
|
||||||
case 113:
|
case 113:
|
||||||
if (OZ.opera) {
|
if (OZ.opera) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
this.quicksave(e);
|
this._currentStorage.quicksave(e);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SQL.IO.prototype._addStorage = function(ctor, parent) {
|
||||||
|
var storage = new ctor(this);
|
||||||
|
if (!storage.isSupported()) { return; }
|
||||||
|
|
||||||
|
var option = storage.getOption();
|
||||||
|
option.value = this._storages.length;
|
||||||
|
parent.appendChild(option);
|
||||||
|
this._storages.push(storage);
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.IO.prototype._storageChange = function(e) {
|
||||||
|
var index = Number(e.target.selectedIndex);
|
||||||
|
this._setStorage(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.IO.prototype._setStorage = function(index) {
|
||||||
|
this.dom.select.selectedIndex = index;
|
||||||
|
this._currentStorage && this._currentStorage.deactivate();
|
||||||
|
this.dom.content.innerHTML = "";
|
||||||
|
|
||||||
|
this._currentStorage = this._storages[index];
|
||||||
|
this._currentStorage.activate(this.dom.content);
|
||||||
|
}
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ SQL.RowManager = function(owner) {
|
|||||||
OZ.Event.add(this.dom.foreigncreate, "click", this.foreigncreate.bind(this));
|
OZ.Event.add(this.dom.foreigncreate, "click", this.foreigncreate.bind(this));
|
||||||
OZ.Event.add(this.dom.foreignconnect, "click", this.foreignconnect.bind(this));
|
OZ.Event.add(this.dom.foreignconnect, "click", this.foreignconnect.bind(this));
|
||||||
OZ.Event.add(this.dom.foreigndisconnect, "click", this.foreigndisconnect.bind(this));
|
OZ.Event.add(this.dom.foreigndisconnect, "click", this.foreigndisconnect.bind(this));
|
||||||
OZ.Event.add(document, "keydown", this.press.bind(this));
|
OZ.Event.add(window, "keydown", this.press.bind(this));
|
||||||
|
|
||||||
SQL.subscribe("tableclick", this.tableClick.bind(this));
|
SQL.subscribe("tableclick", this.tableClick.bind(this));
|
||||||
SQL.subscribe("rowclick", this.rowClick.bind(this));
|
SQL.subscribe("rowclick", this.rowClick.bind(this));
|
||||||
|
|||||||
@@ -0,0 +1,97 @@
|
|||||||
|
SQL.Storage.Browser = function(owner) {
|
||||||
|
SQL.Storage.call(this, owner);
|
||||||
|
this._dom.option.innerHTML = _("storage.browser");
|
||||||
|
this._prefix = "wwwsqldesigner_databases_";
|
||||||
|
|
||||||
|
this._buildButton("clientlocalsave", "_clickSave");
|
||||||
|
this._buildButton("clientlocalload", "_clickLoad");
|
||||||
|
this._dom.list = document.createElement("select");
|
||||||
|
}
|
||||||
|
SQL.Storage.Browser.prototype = Object.create(SQL.Storage.prototype);
|
||||||
|
|
||||||
|
SQL.Storage.Browser.prototype.activate = function(parent) {
|
||||||
|
parent.appendChild(this._dom.list);
|
||||||
|
|
||||||
|
SQL.Storage.prototype.activate.call(this, parent);
|
||||||
|
|
||||||
|
this._list();
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.Browser.prototype._save = function(keyword) {
|
||||||
|
var xml = this.owner.owner.toXML();
|
||||||
|
if (xml.length >= (5*1024*1024)/2) { /* this is a very big db structure... */
|
||||||
|
alert("Warning: your database structure is above 5 megabytes in size, this is above the localStorage single key limit allowed by some browsers, example Mozilla Firefox 10");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var key = this._prefix + keyword;
|
||||||
|
|
||||||
|
try {
|
||||||
|
localStorage.setItem(key, xml);
|
||||||
|
if (localStorage.getItem(key) != xml) { throw new Error("Content verification failed"); }
|
||||||
|
this._keyword = keyword;
|
||||||
|
this._list();
|
||||||
|
} catch (e) {
|
||||||
|
alert("Error saving database structure to localStorage! ("+e.message+")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.Browser.prototype._load = function(keyword) {
|
||||||
|
try {
|
||||||
|
var xml = localStorage.getItem(this._prefix + keyword);
|
||||||
|
if (!xml) { throw new Error("No data available"); }
|
||||||
|
} catch (e) {
|
||||||
|
alert("Error loading database structure from localStorage! ("+e.message+")");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.owner.fromXMLText(xml);
|
||||||
|
this._keyword = keyword;
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.Browser.prototype._clickSave = function(e) {
|
||||||
|
var keyword = this._dom.list.value;
|
||||||
|
if (!keyword) {
|
||||||
|
keyword = prompt(_("serversaveprompt"));
|
||||||
|
if (!keyword) { return; }
|
||||||
|
}
|
||||||
|
|
||||||
|
this._save(keyword);
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.Browser.prototype._clickLoad = function(e) {
|
||||||
|
var keyword = this._dom.list.value;
|
||||||
|
if (!keyword) {
|
||||||
|
alert("Error loading saved data");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._load(keyword);
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.Browser.prototype._list = function() {
|
||||||
|
var re = new RegExp("^" + this._prefix);
|
||||||
|
var localLen = localStorage.length;
|
||||||
|
var results = [];
|
||||||
|
|
||||||
|
for (var i = 0; i<localStorage.length; i++) {
|
||||||
|
var key = localStorage.key(i);
|
||||||
|
if (!key.match(re)) { continue; }
|
||||||
|
results.push(key.substring(this._prefix.length));
|
||||||
|
}
|
||||||
|
|
||||||
|
this._dom.list.innerHTML = "";
|
||||||
|
|
||||||
|
var empty = document.createElement("option");
|
||||||
|
empty.innerHTML = "[create a new design]";
|
||||||
|
empty.value = "";
|
||||||
|
this._dom.list.appendChild(empty);
|
||||||
|
|
||||||
|
results.forEach(function(result) {
|
||||||
|
var option = document.createElement("option");
|
||||||
|
option.innerHTML = result;
|
||||||
|
this._dom.list.appendChild(option);
|
||||||
|
}.bind(this));
|
||||||
|
|
||||||
|
this._dom.list.value = this._keyword;
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
SQL.Storage.Clipboard = function(owner) {
|
||||||
|
SQL.Storage.call(this, owner);
|
||||||
|
this._dom.option.innerHTML = _("storage.clipboard");
|
||||||
|
|
||||||
|
this._buildButton("clientsave", "_save");
|
||||||
|
this._buildButton("clientload", "_load");
|
||||||
|
}
|
||||||
|
SQL.Storage.Clipboard.prototype = Object.create(SQL.Storage.prototype);
|
||||||
|
|
||||||
|
SQL.Storage.Clipboard.prototype._save = function() {
|
||||||
|
this.owner.getArea().value = this.owner.owner.toXML();
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.Clipboard.prototype._load = function() {
|
||||||
|
var xml = this.owner.getArea().value;
|
||||||
|
if (!xml) {
|
||||||
|
alert(_("empty"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.owner.fromXMLText(xml);
|
||||||
|
}
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
/**
|
||||||
|
* The following code uses this lib: https://github.com/dropbox/dropbox-js
|
||||||
|
*/
|
||||||
|
SQL.Storage.Dropbox = function(owner) {
|
||||||
|
SQL.Storage.call(this, owner);
|
||||||
|
this._dom.option.innerHTML = _("storage.dropbox");
|
||||||
|
|
||||||
|
if (CONFIG.DROPBOX_KEY) { this.dropboxClient = new Dropbox.Client({ key: CONFIG.DROPBOX_KEY }); }
|
||||||
|
|
||||||
|
this._buildButton("dropboxsave", "_clickSave");
|
||||||
|
this._buildButton("dropboxload", "_clickLoad");
|
||||||
|
this._buildButton("dropboxlist", "_clickList");
|
||||||
|
|
||||||
|
}
|
||||||
|
SQL.Storage.Dropbox.prototype = Object.create(SQL.Storage.prototype);
|
||||||
|
|
||||||
|
SQL.Storage.Dropbox.prototype.isSupported = function() {
|
||||||
|
return !!CONFIG.DROPBOX_KEY;
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.Dropbox.prototype.showDropboxError = function(error) {
|
||||||
|
var prefix = _("Dropbox error")+": ";
|
||||||
|
var msg = error.status;
|
||||||
|
|
||||||
|
switch (error.status) {
|
||||||
|
case Dropbox.ApiError.INVALID_TOKEN:
|
||||||
|
// If you're using dropbox.js, the only cause behind this error is that
|
||||||
|
// the user token expired.
|
||||||
|
// Get the user through the authentication flow again.
|
||||||
|
msg = _("Token expired - retry the operation, authenticating again with Dropbox");
|
||||||
|
this.dropboxClient.reset();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Dropbox.ApiError.NOT_FOUND:
|
||||||
|
// The file or folder you tried to access is not in the user's Dropbox.
|
||||||
|
// Handling this error is specific to your application.
|
||||||
|
msg = _("File not found");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Dropbox.ApiError.OVER_QUOTA:
|
||||||
|
// The user is over their Dropbox quota.
|
||||||
|
// Tell them their Dropbox is full. Refreshing the page won't help.
|
||||||
|
msg = _("Dropbox is full");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Dropbox.ApiError.RATE_LIMITED:
|
||||||
|
// Too many API requests. Tell the user to try again later.
|
||||||
|
// Long-term, optimize your code to use fewer API calls.
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Dropbox.ApiError.NETWORK_ERROR:
|
||||||
|
// An error occurred at the XMLHttpRequest layer.
|
||||||
|
// Most likely, the user's network connection is down.
|
||||||
|
// API calls will not succeed until the user gets back online.
|
||||||
|
msg = _("Network error");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Dropbox.ApiError.INVALID_PARAM:
|
||||||
|
case Dropbox.ApiError.OAUTH_ERROR:
|
||||||
|
case Dropbox.ApiError.INVALID_METHOD:
|
||||||
|
default:
|
||||||
|
// Caused by a bug in dropbox.js, in your application, or in Dropbox.
|
||||||
|
// Tell the user an error occurred, ask them to refresh the page.
|
||||||
|
}
|
||||||
|
|
||||||
|
alert (prefix+msg);
|
||||||
|
};
|
||||||
|
|
||||||
|
SQL.Storage.Dropbox.prototype.authenticate = function(connectedCallBack) {
|
||||||
|
if (!this.dropboxClient) return false;
|
||||||
|
|
||||||
|
// We want to use a popup window for authentication as the default redirection
|
||||||
|
// won't work for us as it'll make us lose our schema data
|
||||||
|
var href = window.location.href;
|
||||||
|
var prefix = href.substring(0, href.lastIndexOf("/")) + "/";
|
||||||
|
this.dropboxClient.authDriver(new Dropbox.AuthDriver.Popup({ receiverUrl: prefix+"dropbox-oauth-receiver.html" }));
|
||||||
|
|
||||||
|
// Now let's authenticate us
|
||||||
|
this.dropboxClient.authenticate( function(error, client) {
|
||||||
|
if (error) {
|
||||||
|
this.showDropboxError(error);
|
||||||
|
} else {
|
||||||
|
// We're authenticated
|
||||||
|
connectedCallBack();
|
||||||
|
}
|
||||||
|
}.bind(this));
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.Dropbox.prototype._save = function(keyword) {
|
||||||
|
this.authenticate( function() {
|
||||||
|
var xml = this.owner.owner.toXML();
|
||||||
|
var filename = keyword + ".xml";
|
||||||
|
this.owner.owner.window.showThrobber();
|
||||||
|
|
||||||
|
this.dropboxClient.writeFile(filename, xml, function(error, stat) {
|
||||||
|
this.owner.owner.window.hideThrobber();
|
||||||
|
if (error) {
|
||||||
|
this.showDropboxError(error);
|
||||||
|
} else {
|
||||||
|
this._keyword = keyword;
|
||||||
|
this.owner.getArea().value = filename+" "+_("was saved to Dropbox");
|
||||||
|
}
|
||||||
|
}.bind(this));
|
||||||
|
}.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.Dropbox.prototype._load = function(keyword) {
|
||||||
|
this.authenticate( function() {
|
||||||
|
var filename = keyword + ".xml";
|
||||||
|
this.owner.owner.window.showThrobber();
|
||||||
|
|
||||||
|
this.dropboxClient.readFile(filename, function(error, data) {
|
||||||
|
this.owner.owner.window.hideThrobber();
|
||||||
|
if (error) {
|
||||||
|
this.showDropboxError(error);
|
||||||
|
} else {
|
||||||
|
this.owner.fromXMLText(data);
|
||||||
|
this._keyword = keyword;
|
||||||
|
}
|
||||||
|
}.bind(this));
|
||||||
|
}.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.Dropbox.prototype._clickSave = function(e) {
|
||||||
|
var keyword = prompt(_("serversaveprompt"), this._keyword);
|
||||||
|
if (!keyword) { return; }
|
||||||
|
this._save(keyword);
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.Dropbox.prototype._clickLoad = function(e) {
|
||||||
|
var keyword = prompt(_("serverloadprompt"), this._keyword);
|
||||||
|
if (!keyword) { return; }
|
||||||
|
this._load(keyword);
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.Dropbox.prototype._clickList = function(e) {
|
||||||
|
this.authenticate( function() {
|
||||||
|
this.owner.owner.window.showThrobber();
|
||||||
|
this.dropboxClient.readdir("/", function(error, entries) {
|
||||||
|
this.owner.owner.window.hideThrobber();
|
||||||
|
if (error) {
|
||||||
|
this.showDropboxError(error);
|
||||||
|
} else {
|
||||||
|
this.owner.getArea().value = entries.join("\n")+"\n";
|
||||||
|
}
|
||||||
|
}.bind(this));
|
||||||
|
}.bind(this));
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
SQL.Storage = function(owner) {
|
||||||
|
this.owner = owner;
|
||||||
|
this._keyword = "";
|
||||||
|
this._dom = {
|
||||||
|
option: document.createElement("option"),
|
||||||
|
buttons: {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.prototype.getOption = function() {
|
||||||
|
return this._dom.option;
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.prototype.isSupported = function() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.prototype.activate = function(parent) {
|
||||||
|
for (var p in this._dom.buttons) {
|
||||||
|
parent.appendChild(this._dom.buttons[p]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.prototype.deactivate = function() {
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.prototype.quicksave = function() {
|
||||||
|
if (!this._keyword) { return; }
|
||||||
|
this._save(this._keyword);
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.prototype._save = function(keyword) {
|
||||||
|
this._keyword = keyword;
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.prototype._load = function(keyword) {
|
||||||
|
this._keyword = keyword;
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.prototype._buildButton = function(labelKey, method) {
|
||||||
|
var button = document.createElement("button");
|
||||||
|
button.innerHTML = _(labelKey);
|
||||||
|
this._dom.buttons[labelKey] = button;
|
||||||
|
OZ.Event.add(button, "click", this[method].bind(this));
|
||||||
|
}
|
||||||
@@ -0,0 +1,129 @@
|
|||||||
|
SQL.Storage.REST = function(owner) {
|
||||||
|
SQL.Storage.call(this, owner);
|
||||||
|
this._dom.option.innerHTML = _("storage.rest");
|
||||||
|
|
||||||
|
this._dom.label = document.createElement("label");
|
||||||
|
this._dom.label.innerHTML = _("backendlabel");
|
||||||
|
|
||||||
|
this._dom.backend = document.createElement("select");
|
||||||
|
this._dom.label.appendChild(this._dom.backend);
|
||||||
|
this._buildButton("serversave", "_clickSave");
|
||||||
|
this._buildButton("serverload", "_clickLoad");
|
||||||
|
this._buildButton("serverlist", "_clickList");
|
||||||
|
this._buildButton("serverimport", "_clickImport");
|
||||||
|
|
||||||
|
var bs = CONFIG.AVAILABLE_BACKENDS;
|
||||||
|
var be = CONFIG.DEFAULT_BACKEND;
|
||||||
|
var r = window.location.search.substring(1).match(/backend=([^&]*)/);
|
||||||
|
if (r) {
|
||||||
|
req = r[1];
|
||||||
|
if (bs.indexOf(req) != -1) {
|
||||||
|
be = req;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (var i=0;i<bs.length;i++) {
|
||||||
|
var o = document.createElement("option");
|
||||||
|
o.value = bs[i];
|
||||||
|
o.innerHTML = bs[i];
|
||||||
|
this._dom.backend.appendChild(o);
|
||||||
|
if (bs[i] == be) { this._dom.backend.selectedIndex = i; }
|
||||||
|
}
|
||||||
|
|
||||||
|
var url = window.location.href;
|
||||||
|
var r = url.match(/keyword=([^&]+)/);
|
||||||
|
if (r) { this._load(r[1]); }
|
||||||
|
}
|
||||||
|
SQL.Storage.REST.prototype = Object.create(SQL.Storage.prototype);
|
||||||
|
|
||||||
|
SQL.Storage.REST.prototype.activate = function(parent) {
|
||||||
|
parent.appendChild(this._dom.label);
|
||||||
|
SQL.Storage.prototype.activate.call(this, parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.REST.prototype._save = function(keyword) {
|
||||||
|
var xml = this.owner.owner.toXML();
|
||||||
|
var bp = this.owner.owner.getOption("xhrpath");
|
||||||
|
var url = bp + "backend/"+this._dom.backend.value+"/?action=save&keyword="+encodeURIComponent(keyword);
|
||||||
|
var h = {"Content-type":"application/xml"};
|
||||||
|
this.owner.owner.window.showThrobber();
|
||||||
|
this.owner.owner.setTitle(keyword);
|
||||||
|
this._keyword = keyword;
|
||||||
|
OZ.Request(url, this._responseSave.bind(this), {xml:true, method:"post", data:xml, headers:h});
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.REST.prototype._load = function(keyword) {
|
||||||
|
var bp = this.owner.owner.getOption("xhrpath");
|
||||||
|
var url = bp + "backend/"+this._dom.backend.value+"/?action=load&keyword="+encodeURIComponent(keyword);
|
||||||
|
this.owner.owner.window.showThrobber();
|
||||||
|
this._keyword = keyword;
|
||||||
|
OZ.Request(url, this._responseLoad.bind(this), {xml:true});
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.REST.prototype._clickSave = function(e) {
|
||||||
|
var keyword = prompt(_("serversaveprompt"), this._keyword);
|
||||||
|
if (!keyword) { return; }
|
||||||
|
this._save(keyword);
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.REST.prototype._clickLoad = function(e) {
|
||||||
|
var keyword = prompt(_("serverloadprompt"), this._keyword);
|
||||||
|
if (!keyword) { return; }
|
||||||
|
this._load(keyword);
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.REST.prototype._clickList = function(e) {
|
||||||
|
var bp = this.owner.owner.getOption("xhrpath");
|
||||||
|
var url = bp + "backend/"+this._dom.backend.value+"/?action=list";
|
||||||
|
this.owner.owner.window.showThrobber();
|
||||||
|
OZ.Request(url, this._responseList.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.REST.prototype._clickImport = function(e) {
|
||||||
|
var name = prompt(_("serverimportprompt"), "");
|
||||||
|
if (!name) { return; }
|
||||||
|
var bp = this.owner.owner.getOption("xhrpath");
|
||||||
|
var url = bp + "backend/"+this._dom.backend.value+"/?action=import&database="+name;
|
||||||
|
this.owner.owner.window.showThrobber();
|
||||||
|
OZ.Request(url, this._responseImport.bind(this), {xml:true});
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.REST.prototype._check = function(code) {
|
||||||
|
switch (code) {
|
||||||
|
case 201:
|
||||||
|
case 404:
|
||||||
|
case 500:
|
||||||
|
case 501:
|
||||||
|
case 503:
|
||||||
|
var lang = "http"+code;
|
||||||
|
this.owner.getArea().value = _("httpresponse")+": "+_(lang);
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
default: return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.REST.prototype._responseSave = function(data, code) {
|
||||||
|
this.owner.owner.window.hideThrobber();
|
||||||
|
this._check(code);
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.REST.prototype._responseLoad = function(data, code) {
|
||||||
|
this.owner.owner.window.hideThrobber();
|
||||||
|
if (!this._check(code)) { return; }
|
||||||
|
this.owner.fromXML(data);
|
||||||
|
this.owner.owner.setTitle(this._keyword);
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.REST.prototype._responseList = function(data, code) {
|
||||||
|
this.owner.owner.window.hideThrobber();
|
||||||
|
if (!this._check(code)) { return; }
|
||||||
|
this.owner.getArea().value = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
SQL.Storage.REST.prototype._responseImport = function(data, code) {
|
||||||
|
this.owner.owner.window.hideThrobber();
|
||||||
|
if (!this._check(code)) { return; }
|
||||||
|
if (this.owner.fromXML(data)) {
|
||||||
|
this.owner.owner.alignTables();
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -38,7 +38,7 @@ SQL.TableManager = function(owner) {
|
|||||||
OZ.Event.add(this.dom.aligntables, "click", this.owner.alignTables.bind(this.owner));
|
OZ.Event.add(this.dom.aligntables, "click", this.owner.alignTables.bind(this.owner));
|
||||||
OZ.Event.add(this.dom.edittable, "click", this.edit.bind(this));
|
OZ.Event.add(this.dom.edittable, "click", this.edit.bind(this));
|
||||||
OZ.Event.add(this.dom.tablekeys, "click", this.keys.bind(this));
|
OZ.Event.add(this.dom.tablekeys, "click", this.keys.bind(this));
|
||||||
OZ.Event.add(document, "keydown", this.press.bind(this));
|
OZ.Event.add(window, "keydown", this.press.bind(this));
|
||||||
|
|
||||||
this.dom.container.parentNode.removeChild(this.dom.container);
|
this.dom.container.parentNode.removeChild(this.dom.container);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ SQL.Window = function(owner) {
|
|||||||
this.dom.throbber.alt = this.dom.throbber.title = _("throbber");
|
this.dom.throbber.alt = this.dom.throbber.title = _("throbber");
|
||||||
OZ.Event.add(this.dom.ok, "click", this.ok.bind(this));
|
OZ.Event.add(this.dom.ok, "click", this.ok.bind(this));
|
||||||
OZ.Event.add(this.dom.cancel, "click", this.close.bind(this));
|
OZ.Event.add(this.dom.cancel, "click", this.close.bind(this));
|
||||||
OZ.Event.add(document, "keydown", this.key.bind(this));
|
OZ.Event.add(window, "keydown", this.key.bind(this));
|
||||||
|
|
||||||
this.sync = this.sync.bind(this);
|
this.sync = this.sync.bind(this);
|
||||||
|
|
||||||
|
|||||||
@@ -93,20 +93,14 @@ SQL.Designer.prototype.init2 = function() { /* secondary init, after locale & da
|
|||||||
this.tableManager = new SQL.TableManager(this);
|
this.tableManager = new SQL.TableManager(this);
|
||||||
this.rowManager = new SQL.RowManager(this);
|
this.rowManager = new SQL.RowManager(this);
|
||||||
this.keyManager = new SQL.KeyManager(this);
|
this.keyManager = new SQL.KeyManager(this);
|
||||||
this.io = new SQL.IO(this);
|
|
||||||
this.options = new SQL.Options(this);
|
this.options = new SQL.Options(this);
|
||||||
this.window = new SQL.Window(this);
|
this.window = new SQL.Window(this);
|
||||||
|
this.io = new SQL.IO(this);
|
||||||
|
|
||||||
this.sync();
|
this.sync();
|
||||||
|
|
||||||
OZ.$("docs").value = _("docs");
|
OZ.$("docs").value = _("docs");
|
||||||
|
|
||||||
var url = window.location.href;
|
|
||||||
var r = url.match(/keyword=([^&]+)/);
|
|
||||||
if (r) {
|
|
||||||
var keyword = r[1];
|
|
||||||
this.io.serverload(false, keyword);
|
|
||||||
}
|
|
||||||
document.body.style.visibility = "visible";
|
document.body.style.visibility = "visible";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,9 +68,6 @@
|
|||||||
<!-- io -->
|
<!-- io -->
|
||||||
<string name="saveload">حفظ / تحميل</string>
|
<string name="saveload">حفظ / تحميل</string>
|
||||||
<string name="empty">قم بوضع بيانات نموذج XML في المربع أدناه، ثم حاول مرّة أخرى.</string>
|
<string name="empty">قم بوضع بيانات نموذج XML في المربع أدناه، ثم حاول مرّة أخرى.</string>
|
||||||
<string name="client">العميل</string>
|
|
||||||
<string name="server">الخادم</string>
|
|
||||||
<string name="output">المدخلات / المخرجات</string>
|
|
||||||
<string name="clientsave">حفظ كنموذح XML</string>
|
<string name="clientsave">حفظ كنموذح XML</string>
|
||||||
<string name="clientload">إستيراد نموذج XML</string>
|
<string name="clientload">إستيراد نموذج XML</string>
|
||||||
<string name="clientsql">حفظ كنموذج SQL</string>
|
<string name="clientsql">حفظ كنموذج SQL</string>
|
||||||
|
|||||||
+5
-3
@@ -70,9 +70,11 @@
|
|||||||
<!-- io -->
|
<!-- io -->
|
||||||
<string name="saveload">Uložit / Načíst</string>
|
<string name="saveload">Uložit / Načíst</string>
|
||||||
<string name="empty">Prosím vložte XML data do textového pole níže.</string>
|
<string name="empty">Prosím vložte XML data do textového pole níže.</string>
|
||||||
<string name="client">Klient</string>
|
<string name="storage">Úložiště</string>
|
||||||
<string name="server">Server</string>
|
<string name="storage.browser">V prohlížeči</string>
|
||||||
<string name="output">Vstup / Výstup</string>
|
<string name="storage.clipboard">Schránka</string>
|
||||||
|
<string name="storage.rest">Vzdálený REST server</string>
|
||||||
|
<string name="storage.dropbox">Dropbox</string>
|
||||||
<string name="clientsave">Uložit XML</string>
|
<string name="clientsave">Uložit XML</string>
|
||||||
<string name="clientload">Načíst XML</string>
|
<string name="clientload">Načíst XML</string>
|
||||||
<string name="clientlocalsave">Uložit v prohlížeči</string>
|
<string name="clientlocalsave">Uložit v prohlížeči</string>
|
||||||
|
|||||||
@@ -69,9 +69,6 @@
|
|||||||
<!-- io -->
|
<!-- io -->
|
||||||
<string name="saveload">Speichern / Laden</string>
|
<string name="saveload">Speichern / Laden</string>
|
||||||
<string name="empty">Bitte fügen Sie die XML-Daten in das untere Textfeld ein und versuchen es erneut.</string>
|
<string name="empty">Bitte fügen Sie die XML-Daten in das untere Textfeld ein und versuchen es erneut.</string>
|
||||||
<string name="client">Client</string>
|
|
||||||
<string name="server">Server</string>
|
|
||||||
<string name="output">Eingabe / Ausgabe</string>
|
|
||||||
<string name="clientsave">XML speichern</string>
|
<string name="clientsave">XML speichern</string>
|
||||||
<string name="clientload">XML laden</string>
|
<string name="clientload">XML laden</string>
|
||||||
<string name="clientsql">SQL erzeugen</string>
|
<string name="clientsql">SQL erzeugen</string>
|
||||||
|
|||||||
@@ -69,9 +69,6 @@
|
|||||||
<!-- io -->
|
<!-- io -->
|
||||||
<string name="saveload">Αποθήκ./Άνοιγμα</string>
|
<string name="saveload">Αποθήκ./Άνοιγμα</string>
|
||||||
<string name="empty">Κάντε επικόλληση των δεδομένων XML στο πεδίο κειμένου παρακάτω και δοκιμάστε ξανά.</string>
|
<string name="empty">Κάντε επικόλληση των δεδομένων XML στο πεδίο κειμένου παρακάτω και δοκιμάστε ξανά.</string>
|
||||||
<string name="client">Πελάτης</string>
|
|
||||||
<string name="server">Διακομιστής</string>
|
|
||||||
<string name="output">Εισαγωγή/Εξαγωγή</string>
|
|
||||||
<string name="clientsave">Αποθήκευση XML</string>
|
<string name="clientsave">Αποθήκευση XML</string>
|
||||||
<string name="clientload">Άνοιγμα XML</string>
|
<string name="clientload">Άνοιγμα XML</string>
|
||||||
<string name="clientsql">Δημιουργία SQL</string>
|
<string name="clientsql">Δημιουργία SQL</string>
|
||||||
|
|||||||
+5
-3
@@ -70,9 +70,11 @@
|
|||||||
<!-- io -->
|
<!-- io -->
|
||||||
<string name="saveload">Save / Load</string>
|
<string name="saveload">Save / Load</string>
|
||||||
<string name="empty">Please paste XML data into the text area below and try again.</string>
|
<string name="empty">Please paste XML data into the text area below and try again.</string>
|
||||||
<string name="client">Client</string>
|
<string name="storage">Storage</string>
|
||||||
<string name="server">Server</string>
|
<string name="storage.browser">Browser storage</string>
|
||||||
<string name="output">Input / Output</string>
|
<string name="storage.clipboard">System clipboard</string>
|
||||||
|
<string name="storage.rest">Remote REST server</string>
|
||||||
|
<string name="storage.dropbox">Dropbox</string>
|
||||||
<string name="clientsave">Save XML</string>
|
<string name="clientsave">Save XML</string>
|
||||||
<string name="clientload">Load XML</string>
|
<string name="clientload">Load XML</string>
|
||||||
<string name="clientlocalsave">Save in Browser</string>
|
<string name="clientlocalsave">Save in Browser</string>
|
||||||
|
|||||||
@@ -70,9 +70,6 @@
|
|||||||
<!-- io -->
|
<!-- io -->
|
||||||
<string name="saveload">Konservi / Ŝargi</string>
|
<string name="saveload">Konservi / Ŝargi</string>
|
||||||
<string name="empty">Bonvolu alglui XML datumon en la tekst-zono sube kaj provi de nove.</string>
|
<string name="empty">Bonvolu alglui XML datumon en la tekst-zono sube kaj provi de nove.</string>
|
||||||
<string name="client">Kliento</string>
|
|
||||||
<string name="server">Servilo</string>
|
|
||||||
<string name="output">Enigo / Eligo</string>
|
|
||||||
<string name="clientsave">Konservi XML</string>
|
<string name="clientsave">Konservi XML</string>
|
||||||
<string name="clientload">Ŝargi XML</string>
|
<string name="clientload">Ŝargi XML</string>
|
||||||
<string name="clientsql">Krei SQL</string>
|
<string name="clientsql">Krei SQL</string>
|
||||||
|
|||||||
@@ -70,9 +70,6 @@ habilitadas para opciones de trabajo.</string>
|
|||||||
<!-- io -->
|
<!-- io -->
|
||||||
<string name="saveload">Guardar / Cargar</string>
|
<string name="saveload">Guardar / Cargar</string>
|
||||||
<string name="empty">Favor de pegar el XML dentro del área de texto siguiente e intentar nuevamente.</string>
|
<string name="empty">Favor de pegar el XML dentro del área de texto siguiente e intentar nuevamente.</string>
|
||||||
<string name="client">Cliente</string>
|
|
||||||
<string name="server">Servidor</string>
|
|
||||||
<string name="output">Entrada / Salida</string>
|
|
||||||
<string name="clientsave">Guardar XML</string>
|
<string name="clientsave">Guardar XML</string>
|
||||||
<string name="clientload">Cargar XML</string>
|
<string name="clientload">Cargar XML</string>
|
||||||
<string name="clientsql">Generar SQL</string>
|
<string name="clientsql">Generar SQL</string>
|
||||||
|
|||||||
@@ -70,9 +70,6 @@
|
|||||||
<!-- io -->
|
<!-- io -->
|
||||||
<string name="saveload">Enregistrer / Charger</string>
|
<string name="saveload">Enregistrer / Charger</string>
|
||||||
<string name="empty">Merci de coller les données XML dans le champs prévu avant de ré-essayer.</string>
|
<string name="empty">Merci de coller les données XML dans le champs prévu avant de ré-essayer.</string>
|
||||||
<string name="client">Client</string>
|
|
||||||
<string name="server">Serveur</string>
|
|
||||||
<string name="output">Entrée / Sortie</string>
|
|
||||||
<string name="clientsave">Enregistrer XML</string>
|
<string name="clientsave">Enregistrer XML</string>
|
||||||
<string name="clientload">Charger XML</string>
|
<string name="clientload">Charger XML</string>
|
||||||
<string name="clientlocalsave">Enregistrer dans le navigateur</string>
|
<string name="clientlocalsave">Enregistrer dans le navigateur</string>
|
||||||
|
|||||||
@@ -69,9 +69,6 @@
|
|||||||
<!-- io -->
|
<!-- io -->
|
||||||
<string name="saveload">Mentés / Beolvasás</string>
|
<string name="saveload">Mentés / Beolvasás</string>
|
||||||
<string name="empty">Kérem illessze be az XML-tartalmat az alábbi szöveges mezőbe, és próbálja újra.</string>
|
<string name="empty">Kérem illessze be az XML-tartalmat az alábbi szöveges mezőbe, és próbálja újra.</string>
|
||||||
<string name="client">Kliens</string>
|
|
||||||
<string name="server">Szerver</string>
|
|
||||||
<string name="output">Bemenet / Kimenet</string>
|
|
||||||
<string name="clientsave">XML mentése</string>
|
<string name="clientsave">XML mentése</string>
|
||||||
<string name="clientload">XML beolvasása</string>
|
<string name="clientload">XML beolvasása</string>
|
||||||
<string name="clientsql">SQL generálása</string>
|
<string name="clientsql">SQL generálása</string>
|
||||||
|
|||||||
@@ -70,9 +70,6 @@
|
|||||||
<!-- io -->
|
<!-- io -->
|
||||||
<string name="saveload">Salva / Carica</string>
|
<string name="saveload">Salva / Carica</string>
|
||||||
<string name="empty">Reincolla i dati XML nell'area sottostante e prova di nuovo.</string>
|
<string name="empty">Reincolla i dati XML nell'area sottostante e prova di nuovo.</string>
|
||||||
<string name="client">Intestatario</string>
|
|
||||||
<string name="server">Server</string>
|
|
||||||
<string name="output">Ingresso / Uscita</string>
|
|
||||||
<string name="clientsave">Salva XML</string>
|
<string name="clientsave">Salva XML</string>
|
||||||
<string name="clientload">Carica XML</string>
|
<string name="clientload">Carica XML</string>
|
||||||
<string name="clientsql">Genera SQL</string>
|
<string name="clientsql">Genera SQL</string>
|
||||||
|
|||||||
@@ -68,9 +68,6 @@
|
|||||||
<!-- io -->
|
<!-- io -->
|
||||||
<string name="saveload">保存/読み込み</string>
|
<string name="saveload">保存/読み込み</string>
|
||||||
<string name="empty">下の入出力欄にXMLデータを貼りつけてから実行してください。</string>
|
<string name="empty">下の入出力欄にXMLデータを貼りつけてから実行してください。</string>
|
||||||
<string name="client">クライアント</string>
|
|
||||||
<string name="server">サーバ</string>
|
|
||||||
<string name="output">入力出欄</string>
|
|
||||||
<string name="clientsave">XMLを出力</string>
|
<string name="clientsave">XMLを出力</string>
|
||||||
<string name="clientload">XMLを読込</string>
|
<string name="clientload">XMLを読込</string>
|
||||||
<string name="clientsql">SQLを生成</string>
|
<string name="clientsql">SQLを生成</string>
|
||||||
|
|||||||
@@ -70,9 +70,6 @@
|
|||||||
<!-- io -->
|
<!-- io -->
|
||||||
<string name="saveload">Opslaan / laden</string>
|
<string name="saveload">Opslaan / laden</string>
|
||||||
<string name="empty">Please paste XML data into the text area below and try again.</string>
|
<string name="empty">Please paste XML data into the text area below and try again.</string>
|
||||||
<string name="client">Lokaal</string>
|
|
||||||
<string name="server">Server</string>
|
|
||||||
<string name="output">Input / Output</string>
|
|
||||||
<string name="clientsave">XML Opslaan</string>
|
<string name="clientsave">XML Opslaan</string>
|
||||||
<string name="clientload">XML Laden</string>
|
<string name="clientload">XML Laden</string>
|
||||||
<string name="clientlocalsave">Opslaan in Browser</string>
|
<string name="clientlocalsave">Opslaan in Browser</string>
|
||||||
|
|||||||
@@ -70,9 +70,6 @@
|
|||||||
<!-- io -->
|
<!-- io -->
|
||||||
<string name="saveload">Zapisz / Otwórz</string>
|
<string name="saveload">Zapisz / Otwórz</string>
|
||||||
<string name="empty">Proszę wklej kod XML w poniższe pole tekstowe i spróbuj ponownie.</string>
|
<string name="empty">Proszę wklej kod XML w poniższe pole tekstowe i spróbuj ponownie.</string>
|
||||||
<string name="client">Klient</string>
|
|
||||||
<string name="server">Serwer</string>
|
|
||||||
<string name="output">Wejście / Wyjście</string>
|
|
||||||
<string name="clientsave">Zapisz XML</string>
|
<string name="clientsave">Zapisz XML</string>
|
||||||
<string name="clientload">Załaduj XML</string>
|
<string name="clientload">Załaduj XML</string>
|
||||||
<string name="clientsql">Generuj SQL</string>
|
<string name="clientsql">Generuj SQL</string>
|
||||||
|
|||||||
@@ -69,9 +69,6 @@
|
|||||||
<!-- io -->
|
<!-- io -->
|
||||||
<string name="saveload">Salvar / Carregar</string>
|
<string name="saveload">Salvar / Carregar</string>
|
||||||
<string name="empty">Por favor cole os dados XML na área de texto abaixo e tente novamente.</string>
|
<string name="empty">Por favor cole os dados XML na área de texto abaixo e tente novamente.</string>
|
||||||
<string name="client">Cliente</string>
|
|
||||||
<string name="server">Servidor</string>
|
|
||||||
<string name="output">Entrada / Saída</string>
|
|
||||||
<string name="clientsave">Salvar XML</string>
|
<string name="clientsave">Salvar XML</string>
|
||||||
<string name="clientload">Carregar XML</string>
|
<string name="clientload">Carregar XML</string>
|
||||||
<string name="clientsql">Gerar SQL</string>
|
<string name="clientsql">Gerar SQL</string>
|
||||||
|
|||||||
@@ -69,9 +69,6 @@
|
|||||||
<!-- io -->
|
<!-- io -->
|
||||||
<string name="saveload">Salveaza / Incarca</string>
|
<string name="saveload">Salveaza / Incarca</string>
|
||||||
<string name="empty">Introduceti codul XML si re-incercati.</string>
|
<string name="empty">Introduceti codul XML si re-incercati.</string>
|
||||||
<string name="client">Client</string>
|
|
||||||
<string name="server">Server</string>
|
|
||||||
<string name="output">Input / Output</string>
|
|
||||||
<string name="clientsave">Genereaza XML</string>
|
<string name="clientsave">Genereaza XML</string>
|
||||||
<string name="clientload">Incarca din XML</string>
|
<string name="clientload">Incarca din XML</string>
|
||||||
<string name="clientsql">Genereaza SQL</string>
|
<string name="clientsql">Genereaza SQL</string>
|
||||||
|
|||||||
@@ -69,9 +69,6 @@
|
|||||||
<!-- io -->
|
<!-- io -->
|
||||||
<string name="saveload">Сохранить / Загрузить</string>
|
<string name="saveload">Сохранить / Загрузить</string>
|
||||||
<string name="empty">Пожалуйста, вставьте XML данные в поле ниже и попробуйте ещё раз.</string>
|
<string name="empty">Пожалуйста, вставьте XML данные в поле ниже и попробуйте ещё раз.</string>
|
||||||
<string name="client">Клиент</string>
|
|
||||||
<string name="server">Сервер</string>
|
|
||||||
<string name="output">Ввод / Вывод</string>
|
|
||||||
<string name="clientsave">Сохранить XML</string>
|
<string name="clientsave">Сохранить XML</string>
|
||||||
<string name="clientload">Загрузить XML</string>
|
<string name="clientload">Загрузить XML</string>
|
||||||
<string name="clientsql">Генерировать SQL</string>
|
<string name="clientsql">Генерировать SQL</string>
|
||||||
|
|||||||
@@ -69,9 +69,6 @@
|
|||||||
<!-- io -->
|
<!-- io -->
|
||||||
<string name="saveload">Spara / Ladda</string>
|
<string name="saveload">Spara / Ladda</string>
|
||||||
<string name="empty">Vänligen klistra in XML i textrutan nedan och försök igen.</string>
|
<string name="empty">Vänligen klistra in XML i textrutan nedan och försök igen.</string>
|
||||||
<string name="client">Klient</string>
|
|
||||||
<string name="server">Server</string>
|
|
||||||
<string name="output">Input / Output</string>
|
|
||||||
<string name="clientsave">Spara XML</string>
|
<string name="clientsave">Spara XML</string>
|
||||||
<string name="clientload">Ladda XML</string>
|
<string name="clientload">Ladda XML</string>
|
||||||
<string name="clientsql">Generera SQL</string>
|
<string name="clientsql">Generera SQL</string>
|
||||||
|
|||||||
@@ -72,9 +72,6 @@
|
|||||||
<string name="logout">注销</string>
|
<string name="logout">注销</string>
|
||||||
<string name="saveload">保存 / 载入</string>
|
<string name="saveload">保存 / 载入</string>
|
||||||
<string name="empty">请先粘帖一个XML文件内容到文本框中,然后再导入。</string>
|
<string name="empty">请先粘帖一个XML文件内容到文本框中,然后再导入。</string>
|
||||||
<string name="client">客户端</string>
|
|
||||||
<string name="server">服务端</string>
|
|
||||||
<string name="output">输入 / 输出</string>
|
|
||||||
<string name="clientsave">保存为XML</string>
|
<string name="clientsave">保存为XML</string>
|
||||||
<string name="clientload">载入XML</string>
|
<string name="clientload">载入XML</string>
|
||||||
<string name="clientsql">传化为数据库脚本</string>
|
<string name="clientsql">传化为数据库脚本</string>
|
||||||
|
|||||||
@@ -1,62 +0,0 @@
|
|||||||
v\:* {
|
|
||||||
behavior:url(#default#VML);
|
|
||||||
}
|
|
||||||
|
|
||||||
#bar {
|
|
||||||
position: absolute;
|
|
||||||
right: auto;
|
|
||||||
left: expression(eval(document.documentElement.scrollLeft)+document.documentElement.clientWidth-eval(this.offsetWidth));
|
|
||||||
top: expression(eval(document.documentElement.scrollTop));
|
|
||||||
}
|
|
||||||
|
|
||||||
#bar .shadow-corner {
|
|
||||||
background-image: none;
|
|
||||||
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/bar_corner.png',sizingMethod='crop');
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
#bar .shadow-left {
|
|
||||||
background-image: none;
|
|
||||||
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/bar_left.png',sizingMethod='crop');
|
|
||||||
height: expression(eval(this.parentNode.offsetHeight));
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
#bar .shadow-bottom {
|
|
||||||
background-image: none;
|
|
||||||
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/bar_bottom.png',sizingMethod='crop');
|
|
||||||
width: expression(eval(this.parentNode.offsetWidth));
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table .shadow-corner {
|
|
||||||
background-image: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table .shadow-right {
|
|
||||||
background-image: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table .shadow-bottom {
|
|
||||||
background-image: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#minimap {
|
|
||||||
filter: alpha(opacity=90);
|
|
||||||
position: absolute;
|
|
||||||
right: auto;
|
|
||||||
left: expression(eval(document.documentElement.scrollLeft)+document.documentElement.clientWidth-eval(this.offsetWidth));
|
|
||||||
top: expression(eval(document.documentElement.scrollTop)+document.documentElement.clientHeight-eval(this.offsetHeight));
|
|
||||||
}
|
|
||||||
|
|
||||||
#background {
|
|
||||||
filter: alpha(opacity=50);
|
|
||||||
}
|
|
||||||
|
|
||||||
#keys, #opts {
|
|
||||||
width: expression(eval(document.documentElement.clientWidth)/2);
|
|
||||||
}
|
|
||||||
|
|
||||||
#rubberband {
|
|
||||||
filter: alpha(opacity=50);
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
v\:* {
|
|
||||||
behavior:url(#default#VML);
|
|
||||||
}
|
|
||||||
|
|
||||||
#minimap {
|
|
||||||
filter: alpha(opacity=90);
|
|
||||||
}
|
|
||||||
|
|
||||||
#background {
|
|
||||||
filter: alpha(opacity=50);
|
|
||||||
}
|
|
||||||
|
|
||||||
#keys, #opts {
|
|
||||||
width: expression(eval(document.documentElement.clientWidth)/2);
|
|
||||||
}
|
|
||||||
|
|
||||||
#rubberband {
|
|
||||||
filter: alpha(opacity=50);
|
|
||||||
}
|
|
||||||
+2
-2
@@ -40,7 +40,7 @@ body {
|
|||||||
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=5, Direction=215, Color='#888888')"; /* IE 8 */
|
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=5, Direction=215, Color='#888888')"; /* IE 8 */
|
||||||
}
|
}
|
||||||
|
|
||||||
#bar input {
|
#bar input, #bar button {
|
||||||
display: block;
|
display: block;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
@@ -228,7 +228,7 @@ legend {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
label, input, select {
|
label, input, button, select {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user