revert autoindent in legacy code

This commit is contained in:
loro2
2019-07-29 19:15:46 +02:00
parent 3644c947f4
commit 3a60955701
2 changed files with 31 additions and 31 deletions
+21 -21
View File
@@ -1,17 +1,17 @@
/* --------------------- options ------------ */ /* --------------------- options ------------ */
SQL.Options = function (owner) { SQL.Options = function(owner) {
this.owner = owner; this.owner = owner;
this.dom = { this.dom = {
container: OZ.$("opts"), container:OZ.$("opts"),
btn: OZ.$("options") btn:OZ.$("options")
} }
this.dom.btn.value = _("options"); this.dom.btn.value = _("options");
this.save = this.save.bind(this); this.save = this.save.bind(this);
this.build(); this.build();
} }
SQL.Options.prototype.build = function () { SQL.Options.prototype.build = function() {
this.dom.optionlocale = OZ.$("optionlocale"); this.dom.optionlocale = OZ.$("optionlocale");
this.dom.optiondb = OZ.$("optiondb"); this.dom.optiondb = OZ.$("optiondb");
this.dom.optionsnap = OZ.$("optionsnap"); this.dom.optionsnap = OZ.$("optionsnap");
@@ -22,8 +22,8 @@ SQL.Options.prototype.build = function () {
this.dom.optionshowsize = OZ.$("optionshowsize"); this.dom.optionshowsize = OZ.$("optionshowsize");
this.dom.optionshowtype = OZ.$("optionshowtype"); this.dom.optionshowtype = OZ.$("optionshowtype");
var ids = ["language", "db", "snap", "pattern", "style", "hide", "vector", "showsize", "showtype", "optionsnapnotice", "optionpatternnotice", "optionsnotice"]; var ids = ["language","db","snap","pattern","style","hide","vector","showsize","showtype","optionsnapnotice","optionpatternnotice","optionsnotice"];
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);
elm.innerHTML = _(id); elm.innerHTML = _(id);
@@ -31,7 +31,7 @@ SQL.Options.prototype.build = function () {
var ls = CONFIG.AVAILABLE_LOCALES; var ls = CONFIG.AVAILABLE_LOCALES;
OZ.DOM.clear(this.dom.optionlocale); OZ.DOM.clear(this.dom.optionlocale);
for (var i = 0; i < ls.length; i++) { for (var i=0;i<ls.length;i++) {
var o = OZ.DOM.elm("option"); var o = OZ.DOM.elm("option");
o.value = ls[i]; o.value = ls[i];
o.innerHTML = ls[i]; o.innerHTML = ls[i];
@@ -41,7 +41,7 @@ SQL.Options.prototype.build = function () {
var dbs = CONFIG.AVAILABLE_DBS; var dbs = CONFIG.AVAILABLE_DBS;
OZ.DOM.clear(this.dom.optiondb); OZ.DOM.clear(this.dom.optiondb);
for (var i = 0; i < dbs.length; i++) { for (var i=0;i<dbs.length;i++) {
var o = OZ.DOM.elm("option"); var o = OZ.DOM.elm("option");
o.value = dbs[i]; o.value = dbs[i];
o.innerHTML = dbs[i]; o.innerHTML = dbs[i];
@@ -51,7 +51,7 @@ SQL.Options.prototype.build = function () {
var styles = CONFIG.STYLES; var styles = CONFIG.STYLES;
OZ.DOM.clear(this.dom.optionstyle); OZ.DOM.clear(this.dom.optionstyle);
for (var i = 0; i < styles.length; i++) { for (var i=0;i<styles.length;i++) {
var o = OZ.DOM.elm("option"); var o = OZ.DOM.elm("option");
o.value = styles[i]; o.value = styles[i];
o.innerHTML= styles[i]; o.innerHTML= styles[i];
@@ -65,20 +65,20 @@ SQL.Options.prototype.build = function () {
this.dom.container.parentNode.removeChild(this.dom.container); this.dom.container.parentNode.removeChild(this.dom.container);
} }
SQL.Options.prototype.save = function () { SQL.Options.prototype.save = function() {
this.owner.setOption("locale", this.dom.optionlocale.value); this.owner.setOption("locale",this.dom.optionlocale.value);
this.owner.setOption("db", this.dom.optiondb.value); this.owner.setOption("db",this.dom.optiondb.value);
this.owner.setOption("snap", this.dom.optionsnap.value); this.owner.setOption("snap",this.dom.optionsnap.value);
this.owner.setOption("pattern", this.dom.optionpattern.value); this.owner.setOption("pattern",this.dom.optionpattern.value);
this.owner.setOption("style", this.dom.optionstyle.value); this.owner.setOption("style",this.dom.optionstyle.value);
this.owner.setOption("hide", this.dom.optionhide.checked ? "1" : ""); this.owner.setOption("hide",this.dom.optionhide.checked ? "1" : "");
this.owner.setOption("vector", this.dom.optionvector.checked ? "1" : ""); this.owner.setOption("vector",this.dom.optionvector.checked ? "1" : "");
this.owner.setOption("showsize", this.dom.optionshowsize.checked ? "1" : ""); this.owner.setOption("showsize",this.dom.optionshowsize.checked ? "1" : "");
this.owner.setOption("showtype", this.dom.optionshowtype.checked ? "1" : ""); this.owner.setOption("showtype",this.dom.optionshowtype.checked ? "1" : "");
} }
SQL.Options.prototype.click = function () { SQL.Options.prototype.click = function() {
this.owner.window.open(_("options"), this.dom.container, this.save); this.owner.window.open(_("options"),this.dom.container,this.save);
this.dom.optionsnap.value = this.owner.getOption("snap"); this.dom.optionsnap.value = this.owner.getOption("snap");
this.dom.optionpattern.value = this.owner.getOption("pattern"); this.dom.optionpattern.value = this.owner.getOption("pattern");
this.dom.optionhide.checked = this.owner.getOption("hide"); this.dom.optionhide.checked = this.owner.getOption("hide");
+10 -10
View File
@@ -35,7 +35,7 @@ SQL.Row.prototype._build = function() {
[this.dom.content, td1, td2], [this.dom.content, td1, td2],
[td1, this.dom.selected, this.dom.title] [td1, this.dom.selected, this.dom.title]
); );
this.enter = this.enter.bind(this); this.enter = this.enter.bind(this);
this.changeComment = this.changeComment.bind(this); this.changeComment = this.changeComment.bind(this);
@@ -316,7 +316,7 @@ SQL.Row.prototype.destroy = function() {
while (this.relations.length) { while (this.relations.length) {
this.owner.owner.removeRelation(this.relations[0]); this.owner.owner.removeRelation(this.relations[0]);
} }
for (var i=0;i<this.keys.length;i++){ for (var i=0;i<this.keys.length;i++){
this.keys[i].removeRow(this); this.keys[i].removeRow(this);
} }
} }
@@ -337,10 +337,10 @@ SQL.Row.prototype.toXML = function() {
if (this.data.def || this.data.def === null) { if (this.data.def || this.data.def === null) {
var q = elm.getAttribute("quote"); var q = elm.getAttribute("quote");
var d = this.data.def; var d = this.data.def;
if (d === null) { if (d === null) {
d = "NULL"; d = "NULL";
} else if (d != "CURRENT_TIMESTAMP") { } else if (d != "CURRENT_TIMESTAMP") {
d = q+d+q; d = q+d+q;
} }
xml += "<default>"+SQL.escape(d)+"</default>"; xml += "<default>"+SQL.escape(d)+"</default>";
} }
@@ -351,8 +351,8 @@ SQL.Row.prototype.toXML = function() {
xml += '<relation table="'+r.row1.owner.getTitle()+'" row="'+r.row1.getTitle()+'" />\n'; xml += '<relation table="'+r.row1.owner.getTitle()+'" row="'+r.row1.getTitle()+'" />\n';
} }
if (this.data.comment) { if (this.data.comment) {
xml += "<comment>"+SQL.escape(this.data.comment)+"</comment>\n"; xml += "<comment>"+SQL.escape(this.data.comment)+"</comment>\n";
} }
xml += "</row>\n"; xml += "</row>\n";
@@ -385,7 +385,7 @@ SQL.Row.prototype.fromXML = function(node) {
var elm = DATATYPES.getElementsByTagName("type")[obj.type]; var elm = DATATYPES.getElementsByTagName("type")[obj.type];
var d = node.getElementsByTagName("default"); var d = node.getElementsByTagName("default");
if (d.length && d[0].firstChild) { if (d.length && d[0].firstChild) {
var def = d[0].firstChild.nodeValue; var def = d[0].firstChild.nodeValue;
obj.def = def; obj.def = def;
var q = elm.getAttribute("quote"); var q = elm.getAttribute("quote");
@@ -422,7 +422,7 @@ SQL.Row.prototype.isKey = function() {
} }
SQL.Row.prototype.enter = function(e) { SQL.Row.prototype.enter = function(e) {
if (e.keyCode == 13) { if (e.keyCode == 13) {
this.collapse(); this.collapse();
} }
} }