style selector option

This commit is contained in:
loro2
2019-07-29 17:26:24 +02:00
parent a0d757fdc6
commit 2f4251354a
25 changed files with 83 additions and 26 deletions
+8
View File
@@ -120,6 +120,14 @@
<span class="small" id="optionpatternnotice"></span>
</td>
</tr>
<tr>
<td>
* <label id="style" for="optionstyle"></label>
</td>
<td>
<select id="optionstyle"><option></option></select>
</td>
</tr>
<tr>
<td>
<label id="hide" for="optionhide"></label>
+2
View File
@@ -12,6 +12,8 @@ var CONFIG = {
RELATION_SPACING: 15,
RELATION_COLORS: ["#000", "#800", "#080", "#008", "#088", "#808", "#088"],
STYLES: ["material-inspired", "original"],
STATIC_PATH: "",
XHR_PATH: "",
+13 -1
View File
@@ -16,12 +16,13 @@ SQL.Options.prototype.build = function() {
this.dom.optiondb = OZ.$("optiondb");
this.dom.optionsnap = OZ.$("optionsnap");
this.dom.optionpattern = OZ.$("optionpattern");
this.dom.optionstyle = OZ.$("optionstyle");
this.dom.optionhide = OZ.$("optionhide");
this.dom.optionvector = OZ.$("optionvector");
this.dom.optionshowsize = OZ.$("optionshowsize");
this.dom.optionshowtype = OZ.$("optionshowtype");
var ids = ["language","db","snap","pattern","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++) {
var id = ids[i];
var elm = OZ.$(id);
@@ -48,6 +49,16 @@ SQL.Options.prototype.build = function() {
if (this.owner.getOption("db") == dbs[i]) { this.dom.optiondb.selectedIndex = i; }
}
var styles = CONFIG.STYLES;
OZ.DOM.clear(this.dom.optionstyle);
for (var i = 0; i < styles.length; i++) {
var o = OZ.DOM.elm("option");
o.value = styles[i];
o.innerHTML= styles[i];
this.dom.optionstyle.appendChild(o);
if (this.owner.getOption("style") == styles[i]) { this.dom.optionstyle.selectedIndex = i; }
}
OZ.Event.add(this.dom.btn, "click", this.click.bind(this));
@@ -59,6 +70,7 @@ SQL.Options.prototype.save = function() {
this.owner.setOption("db", this.dom.optiondb.value);
this.owner.setOption("snap", this.dom.optionsnap.value);
this.owner.setOption("pattern", this.dom.optionpattern.value);
this.owner.setOption("style", this.dom.optionstyle.value);
this.owner.setOption("hide", this.dom.optionhide.checked ? "1" : "");
this.owner.setOption("vector", this.dom.optionvector.checked ? "1" : "");
this.owner.setOption("showsize", this.dom.optionshowsize.checked ? "1" : "");
+13
View File
@@ -29,6 +29,7 @@ SQL.Designer = function() {
this.flag = 2;
this.requestLanguage();
this.requestDB();
this.requestStyle();
}
SQL.Designer.prototype = Object.create(SQL.Visual.prototype);
@@ -79,6 +80,17 @@ SQL.Designer.prototype.requestDB = function() { /* get datatypes file */
OZ.Request(url, this.dbResponse.bind(this), {method:"get", xml:true});
}
SQL.Designer.prototype.requestStyle = function() { /* set style */
var style = this.getOption("style");
var i, link_elms;
for (i=0; link_elms = document.getElementsByTagName("link"); i++) {
if (link_elms[i].getAttribute("rel").indexOf("style") != -1 && link_elms[i].getAttribute("title")) {
link_elms[i].disabled = true;
if (link_elms[i].getAttribute("title") == style) link_elms[i].disabled = false;
}
}
}
SQL.Designer.prototype.dbResponse = function(xmlDoc) {
if (xmlDoc) {
window.DATATYPES = xmlDoc.documentElement;
@@ -187,6 +199,7 @@ SQL.Designer.prototype.getOption = function(name) {
case "pattern": return "%R_%T";
case "hide": return false;
case "vector": return true;
case "style": return "material-inspired";
default: return null;
}
}
+1
View File
@@ -52,6 +52,7 @@
<string name="optionpatternnotice">%T = الجدول الرئيسي, %R = المفتاح الرئيسي, %t = الجدول الخارجي</string>
<string name="hide">إخفاء الخطوط عند تحريك الجدول؟</string>
<string name="vector">رسم خطوط ناعمة (إذا كان المتصفح يدعم ذلك) ؟</string>
<string name="style">قلم المدقة</string>
<!-- keys -->
+1
View File
@@ -55,6 +55,7 @@
<string name="vector">Vykreslovat oblé spojovníky (pakliže to prohlížeč podporuje)?</string>
<string name="showsize">Zobrazovat velikost polí v tabulce?</string>
<string name="showtype">Zobrazovat datový typ polí v tabulce?</string>
<string name="style">Styl</string>
<!-- keys -->
<string name="tablekeys">Klíče</string>
+1
View File
@@ -55,6 +55,7 @@
<string name="vector">Zeichne gekrümmte Verbindungslinien (Browser-abhängig)?</string>
<string name="showsize">Zeige Feldgröße im Tabellendesign?</string>
<string name="showtype">Zeige Felddatentyp im Tabellendesign?</string>
<string name="style">Stil</string>
<!-- keys -->
<string name="tablekeys">Schlüssel</string>
+1
View File
@@ -53,6 +53,7 @@
<string name="optionpatternnotice">%T = πρωτεύων πίνακας, %R = προτεύον κλειδί, %t = ξένος πίνακας</string>
<string name="hide">Απόκρυψη συνδέσμων όταν σύρονται οι πίνακες;</string>
<string name="vector">Διάγραμμα με ομαλούς συνδέσμους(αν παρέχεται από τον περιηγητή);</string>
<string name="style">Στυλ</string>
<!-- keys -->
+1
View File
@@ -55,6 +55,7 @@
<string name="vector">Draw smooth connectors (if supported by browser)?</string>
<string name="showsize">Show field size in table design?</string>
<string name="showtype">Show field datatype in table design?</string>
<string name="style">Style</string>
<!-- keys -->
<string name="tablekeys">Keys</string>
+1
View File
@@ -55,6 +55,7 @@
<string name="vector">Desegni glatajn konektilojn (se subtenata de retumilo)?</string>
<string name="showsize">Show field size in table design?</string>
<string name="showtype">Show field datatype in table design?</string>
<string name="style">Stilo</string>
<!-- keys -->
<string name="tablekeys">Klavoj</string>
+1
View File
@@ -55,6 +55,7 @@
<string name="vector">¿Dibujar conectores suaves (si son soportados por el navegador)?</string>
<string name="showsize">¿Mostrar tamaño del campo en el diseño de tabla?</string>
<string name="showtype">¿Mostrar tipo de dato del campo en el diseño de tabla?</string>
<string name="style">Estilo</string>
<!-- keys -->
<string name="tablekeys">Claves</string>
+1
View File
@@ -55,6 +55,7 @@
<string name="vector">Dessiner des connecteurs « adoucis » (si le navigateur le supporte) ?</string>
<string name="showsize">Afficher la taille du champ dans le schéma de table ?</string>
<string name="showtype">Afficher le type du champ dans le schéma de table ?</string>
<string name="style">Style</string>
<!-- keys -->
<string name="tablekeys">Clés</string>
+1
View File
@@ -53,6 +53,7 @@
<string name="optionpatternnotice">%T = elsődleges tábla, %R = elsődleges kulcs, %t = idegen tábla</string>
<string name="hide">Elrejtsem a kapcsolókat a rajztáblán?</string>
<string name="vector">Kapcsolók finom kirajzolása (ha a böngésző lehetővé teszi)?</string>
<string name="style">Stílus</string>
<!-- keys -->
+1
View File
@@ -55,6 +55,7 @@
<string name="vector">Disegna connettori arrotondati (se supportato dal browser)?</string>
<string name="showsize">Show field size in table design?</string>
<string name="showtype">Show field datatype in table design?</string>
<string name="style">Stile</string>
<!-- keys -->
<string name="tablekeys">Chiavi</string>
+1
View File
@@ -54,6 +54,7 @@
<string name="vector">滑らかな線を使う(要ブラウザのサポート)</string>
<string name="showsize">フィールドサイズを表示</string>
<string name="showtype">フィールドタイプを表示</string>
<string name="style">スタイル</string>
<!-- keys -->
<string name="tablekeys">キーの設定</string>
+1
View File
@@ -55,6 +55,7 @@
<string name="vector">부드러운 연결선 사용 (브라우저 지원 필요)?</string>
<string name="showsize">디자인에서 필드 사이즈를 표시</string>
<string name="showtype">디자인에서 필드 타입을 표시</string>
<string name="style">스타일</string>
<!-- keys -->
<string name="tablekeys">키 설정</string>
+1
View File
@@ -55,6 +55,7 @@
<string name="vector">Teken gekromde relaties (als de browser dit ondersteund)?</string>
<string name="showsize">Toon veld omvang in tabelontwerp?</string>
<string name="showtype">Toon veld type in tabelontwerp?</string>
<string name="style">Stijl</string>
<!-- keys -->
<string name="tablekeys">Sleutels</string>
+1
View File
@@ -55,6 +55,7 @@
<string name="vector">Rysuj pływające złącza (jesli wsperane jest przez przeglądarkę)?</string>
<string name="showsize">Show field size in table design?</string>
<string name="showtype">Show field datatype in table design?</string>
<string name="style">Styl</string>
<!-- keys -->
<string name="tablekeys">Klucze</string>
+1
View File
@@ -53,6 +53,7 @@
<string name="optionpatternnotice">%T = tabela primária, %R = chave primária, %t = tabela estrangeira</string>
<string name="hide">Esconder connectores na tela?</string>
<string name="vector">Desenhar conectores suaves (se suportado pelo navegador)?</string>
<string name="style">Estilo</string>
<!-- keys -->
+1
View File
@@ -53,6 +53,7 @@
<string name="optionpatternnotice">%T = Tabela primara, %R = Primary key, %t = Tabela cu Foreign key</string>
<string name="hide">Ascunde conexiunile la mutarea tabelei?</string>
<string name="vector">Deseneaza folosind "smooth connectors" (daca browserul suporta)?</string>
<string name="style">Stil</string>
<!-- keys -->
+1
View File
@@ -55,6 +55,7 @@
<string name="vector">Рисовать сглаженные связи (если поддерживается браузером)?</string>
<string name="showsize">Показывать размеры полей таблиц?</string>
<string name="showtype">Показывать типы данных полей таблиц?</string>
<string name="style">Стиль</string>
<!-- keys -->
<string name="tablekeys">Ключи</string>
+1 -1
View File
@@ -53,7 +53,7 @@
<string name="optionpatternnotice">%T = primär tabell, %R = primär nycke, %t = främmande tabell</string>
<string name="hide">Dölj anslutningar när du drar i tabellen?</string>
<string name="vector">Rita mjuka anslutningar (om din webbläsare stöder det)?</string>
<string name="style">Stil</string>
<!-- keys -->
<string name="tablekeys">Nycklar</string>
+1
View File
@@ -55,6 +55,7 @@
<string name="vector">Draw smooth connectors (if supported by browser)?</string>
<string name="showsize">Tablo tasarımında alan boyutunu gösterme?</string>
<string name="showtype">Alan veri tipini tablo tasarımında göster?</string>
<string name="style">Stil</string>
<!-- keys -->
<string name="tablekeys">Anahtarlar</string>
+1 -1
View File
@@ -54,7 +54,7 @@
<string name="vector">绘制平滑的连接 (如果浏览器支持)?</string>
<string name="showsize">设计表格时显示字段大小?</string>
<string name="showtype">设计表格时显示字段数据类型?</string>
<string name="style">样式</string>
<!-- keys -->
<string name="tablekeys">设置表键</string>
+4
View File
@@ -514,6 +514,10 @@ select optgroup {
font-family: "Lucida Console", Monaco, monospace;
}
#io table {
width: 100%;
}
#io hr {
visibility: hidden;
}