issue #114 - option to show field size in table
--HG-- extra : convert_revision : svn%3Ab267cdba-c1da-11dd-874b-8bacd04a0a74/trunk%40123
This commit is contained in:
@@ -119,6 +119,14 @@
|
|||||||
<input type="checkbox" id="optionvector" />
|
<input type="checkbox" id="optionvector" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
* <label id="showsize" for="optionshowsize"></label>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="checkbox" id="optionshowsize" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|||||||
+11
-4
@@ -113,7 +113,10 @@ SQL.Row.prototype.setTitle = function(t) {
|
|||||||
var tt = r.row2.getTitle().replace(new RegExp(old,"g"),t);
|
var tt = r.row2.getTitle().replace(new RegExp(old,"g"),t);
|
||||||
if (tt != r.row2.getTitle()) { r.row2.setTitle(tt); }
|
if (tt != r.row2.getTitle()) { r.row2.setTitle(tt); }
|
||||||
}
|
}
|
||||||
SQL.Visual.prototype.setTitle.apply(this, [t]);
|
|
||||||
|
var title = t;
|
||||||
|
if (SQL.Designer.getOption("showsize") && this.data.size) { title += " (" + this.data.size + ")"; }
|
||||||
|
SQL.Visual.prototype.setTitle.apply(this, [title]);
|
||||||
}
|
}
|
||||||
|
|
||||||
SQL.Row.prototype.click = function(e) { /* clicked on row */
|
SQL.Row.prototype.click = function(e) { /* clicked on row */
|
||||||
@@ -238,7 +241,6 @@ SQL.Row.prototype.collapse = function() {
|
|||||||
if (!this.expanded) { return; }
|
if (!this.expanded) { return; }
|
||||||
this.expanded = false;
|
this.expanded = false;
|
||||||
|
|
||||||
this.setTitle(this.dom.name.value);
|
|
||||||
var data = {
|
var data = {
|
||||||
type: this.dom.type.selectedIndex,
|
type: this.dom.type.selectedIndex,
|
||||||
def: this.dom.def.value,
|
def: this.dom.def.value,
|
||||||
@@ -251,6 +253,7 @@ SQL.Row.prototype.collapse = function() {
|
|||||||
this.dom.content.style.display = "none";
|
this.dom.content.style.display = "none";
|
||||||
this.dom.title.style.display = "block";
|
this.dom.title.style.display = "block";
|
||||||
this.update(data);
|
this.update(data);
|
||||||
|
this.setTitle(this.dom.name.value);
|
||||||
/* gecko hack */
|
/* gecko hack */
|
||||||
this.owner.moveBy(1,1);
|
this.owner.moveBy(1,1);
|
||||||
this.owner.moveBy(-1,-1);
|
this.owner.moveBy(-1,-1);
|
||||||
@@ -388,7 +391,6 @@ SQL.Row.prototype.toXML = function() {
|
|||||||
|
|
||||||
SQL.Row.prototype.fromXML = function(node) {
|
SQL.Row.prototype.fromXML = function(node) {
|
||||||
var name = node.getAttribute("name");
|
var name = node.getAttribute("name");
|
||||||
this.setTitle(name);
|
|
||||||
|
|
||||||
var obj = { type:0, size:"" };
|
var obj = { type:0, size:"" };
|
||||||
obj.nll = (node.getAttribute("null") == "1");
|
obj.nll = (node.getAttribute("null") == "1");
|
||||||
@@ -425,6 +427,7 @@ SQL.Row.prototype.fromXML = function(node) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.update(obj);
|
this.update(obj);
|
||||||
|
this.setTitle(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
SQL.Row.prototype.isPrimary = function() {
|
SQL.Row.prototype.isPrimary = function() {
|
||||||
@@ -2180,8 +2183,9 @@ SQL.Options.prototype.build = function() {
|
|||||||
this.dom.optionpattern = OZ.$("optionpattern");
|
this.dom.optionpattern = OZ.$("optionpattern");
|
||||||
this.dom.optionhide = OZ.$("optionhide");
|
this.dom.optionhide = OZ.$("optionhide");
|
||||||
this.dom.optionvector = OZ.$("optionvector");
|
this.dom.optionvector = OZ.$("optionvector");
|
||||||
|
this.dom.optionshowsize = OZ.$("optionshowsize");
|
||||||
|
|
||||||
var ids = ["language","db","snap","pattern","hide","vector","optionsnapnotice","optionpatternnotice","optionsnotice"];
|
var ids = ["language","db","snap","pattern","hide","vector","showsize","optionsnapnotice","optionpatternnotice","optionsnotice","optionshowsize"];
|
||||||
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);
|
||||||
@@ -2219,6 +2223,7 @@ SQL.Options.prototype.save = function() {
|
|||||||
this.owner.setOption("pattern",this.dom.optionpattern.value);
|
this.owner.setOption("pattern",this.dom.optionpattern.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" : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
SQL.Options.prototype.click = function() {
|
SQL.Options.prototype.click = function() {
|
||||||
@@ -2227,6 +2232,7 @@ SQL.Options.prototype.click = function() {
|
|||||||
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");
|
||||||
this.dom.optionvector.checked = this.owner.getOption("vector");
|
this.dom.optionvector.checked = this.owner.getOption("vector");
|
||||||
|
this.dom.optionshowsize.checked = this.owner.getOption("showsize");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------ minimize/restore bar ----------- */
|
/* ------------------ minimize/restore bar ----------- */
|
||||||
@@ -2450,6 +2456,7 @@ SQL.Designer.prototype.getOption = function(name) {
|
|||||||
case "staticpath": return CONFIG.STATIC_PATH || "";
|
case "staticpath": return CONFIG.STATIC_PATH || "";
|
||||||
case "xhrpath": return CONFIG.XHR_PATH || "";
|
case "xhrpath": return CONFIG.XHR_PATH || "";
|
||||||
case "snap": return 0;
|
case "snap": return 0;
|
||||||
|
case "showsize": return 0;
|
||||||
case "pattern": return "%R_%T";
|
case "pattern": return "%R_%T";
|
||||||
case "hide": return false;
|
case "hide": return false;
|
||||||
case "vector": return true;
|
case "vector": return true;
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@
|
|||||||
<string name="optionpatternnotice">%T = primární tabulka, %R = primární klíč, %t = cizí tabulka</string>
|
<string name="optionpatternnotice">%T = primární tabulka, %R = primární klíč, %t = cizí tabulka</string>
|
||||||
<string name="hide">Schovat spojovníky při tažení tabulkou?</string>
|
<string name="hide">Schovat spojovníky při tažení tabulkou?</string>
|
||||||
<string name="vector">Vykreslovat oblé spojovníky (pakliže to prohlížeč podporuje)?</string>
|
<string name="vector">Vykreslovat oblé spojovníky (pakliže to prohlížeč podporuje)?</string>
|
||||||
|
<string name="showsize">Zobrazovat velikost polí v tabulce?</string>
|
||||||
|
|
||||||
<!-- keys -->
|
<!-- keys -->
|
||||||
<string name="tablekeys">Klíče</string>
|
<string name="tablekeys">Klíče</string>
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@
|
|||||||
<string name="optionpatternnotice">%T = primary table, %R = primary key, %t = foreign table</string>
|
<string name="optionpatternnotice">%T = primary table, %R = primary key, %t = foreign table</string>
|
||||||
<string name="hide">Hide connectors on table drag?</string>
|
<string name="hide">Hide connectors on table drag?</string>
|
||||||
<string name="vector">Draw smooth connectors (if supported by browser)?</string>
|
<string name="vector">Draw smooth connectors (if supported by browser)?</string>
|
||||||
|
<string name="showsize">Show field size in table design?</string>
|
||||||
|
|
||||||
<!-- keys -->
|
<!-- keys -->
|
||||||
<string name="tablekeys">Keys</string>
|
<string name="tablekeys">Keys</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user