From 573cb5321bde8b87bfecfe5739c1ef2c07c27ecd Mon Sep 17 00:00:00 2001 From: loro2 <51793898+loro2@users.noreply.github.com> Date: Wed, 24 Jul 2019 10:07:03 +0200 Subject: [PATCH 1/8] add new stylesheet, change background,menu,minimap --- images/back_dim.png | Bin 0 -> 353 bytes images/down_2_black.png | Bin 0 -> 123 bytes images/down_2_white.png | Bin 0 -> 128 bytes images/fast_forward_black.png | Bin 0 -> 239 bytes images/fast_rewind_black.png | Bin 0 -> 247 bytes images/up_2_black.png | Bin 0 -> 115 bytes images/up_2_white.png | Bin 0 -> 118 bytes index.html | 5 +- js/toggle.js | 4 +- styles/material-inspired.css | 327 +++++++++++++++++++++++++++++ styles/{style.css => original.css} | 0 11 files changed, 332 insertions(+), 4 deletions(-) create mode 100644 images/back_dim.png create mode 100644 images/down_2_black.png create mode 100644 images/down_2_white.png create mode 100644 images/fast_forward_black.png create mode 100644 images/fast_rewind_black.png create mode 100644 images/up_2_black.png create mode 100644 images/up_2_white.png create mode 100644 styles/material-inspired.css rename styles/{style.css => original.css} (100%) diff --git a/images/back_dim.png b/images/back_dim.png new file mode 100644 index 0000000000000000000000000000000000000000..83f4bb7a595c108900ac8b6072c50fd1f4c180e1 GIT binary patch literal 353 zcmeAS@N?(olHy`uVBq!ia0vp^DImFdh=fRm3&Qu6eM!fOl+j0~PGjv*Dd-rnBG%cLmLmUzyBne}R~!&#A>6J9=!2SxlA zJmj(!n!kSUvrjJn_ZWW6Sj!rH+qfklyY_pQ-}+j7lIbNAkB63R=rBp|5-HTBvR`wzxz r01531;tl4ycNU~urgTe~DWM4f#9f5- literal 0 HcmV?d00001 diff --git a/images/down_2_black.png b/images/down_2_black.png new file mode 100644 index 0000000000000000000000000000000000000000..53f9909171968f246984c64f4330f76a8eda431c GIT binary patch literal 123 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|moIG6|Ln;`PCHNXx=eBd2NWL?O zI9$1nXS<|{fvBg^orE7}5|~3jv7VUBve|GdqiXI44Mz=Ujf0DMma(iiQjiH`U`YBb V@P=c}U1gwY44$rjF6*2UngFEhBozPv literal 0 HcmV?d00001 diff --git a/images/down_2_white.png b/images/down_2_white.png new file mode 100644 index 0000000000000000000000000000000000000000..ba129079f43fed3e95465cebab6d205213136d96 GIT binary patch literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|m+&x_!Lp07OCrJEyV9%W==M(Vx z|J?uA3g*52fBV0wfvD%d{U85-u9sdhN#9|firHp|Q~UmGKe(91Q_@bgAoa&ohpC=M cJsJ!Q6Pry=FkPNk2{e+y)78&qol`;+0LvUN{{R30 literal 0 HcmV?d00001 diff --git a/images/fast_forward_black.png b/images/fast_forward_black.png new file mode 100644 index 0000000000000000000000000000000000000000..a1394ab3215683ef21c4c993af1bdbfdad663631 GIT binary patch literal 239 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|m6p}rHd>I(3)EF2VS{N990fib~ zFff!FFfhDIU|_JC!N4G1FlSew4N!t9$=lt9;eUJonf*W>XMsm#F#`j)FbFd;%$g$s z6ioMYaSYKopPV4E$3eVP_ozZk>_z@ICpI^Y+l>!3o3+hc|2GzhU*PFj^q=Ry#4pJk z8#RBO|Int$v5JF5f1w4_Iu4fShCdG6JkjS6Xd>zopr0LJJ_cK`qY literal 0 HcmV?d00001 diff --git a/images/fast_rewind_black.png b/images/fast_rewind_black.png new file mode 100644 index 0000000000000000000000000000000000000000..30fdf6e706b346a87914b3ae3c15172ddd15f75c GIT binary patch literal 247 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|m6p}rHd>I(3)EF2VS{N990fib~ zFff!FFfhDIU|_JC!N4G1FlSew4N!t9$=lt9;eUJonf*W>XMsm#F#`j)FbFd;%$g$s z6wLQ@aSYKopPV4^$6-%jnr!EEdrvnMW`@Q{5MQ(0SGTRqSJgRe5ca|T+?;OXk;vd$@?2>{SPN#pVr-DIFC N44$rjF6*2UngE{^BM1Nh literal 0 HcmV?d00001 diff --git a/images/up_2_white.png b/images/up_2_white.png new file mode 100644 index 0000000000000000000000000000000000000000..e4eabb51522d13c9d28c5dc59bacd17a36d4be87 GIT binary patch literal 118 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|mY&~5ZLp07OCrAW7s6YIl?U0wl zg2oAxX8uoq7|0f8^w(Zl;8D=G`-~cfZ|#+5@CK&!`_43X;S8Di-J?^Bp~%6Y<8+jd Q7tkOEPgg&ebxsLQ0QDUvRsaA1 literal 0 HcmV?d00001 diff --git a/index.html b/index.html index 24b98ad..7709428 100644 --- a/index.html +++ b/index.html @@ -8,8 +8,9 @@ WWW SQL Designer - - + + + diff --git a/js/toggle.js b/js/toggle.js index 6b1ec05..703dbb7 100644 --- a/js/toggle.js +++ b/js/toggle.js @@ -17,10 +17,10 @@ SQL.Toggle.prototype._click = function(e) { SQL.Toggle.prototype._switch = function(state) { this._state = state; if (this._state) { - OZ.$("bar").style.height = ""; + OZ.$("bar").style.maxHeight = ""; } else { OZ.$("bar").style.overflow = "hidden"; - OZ.$("bar").style.height = this._elm.offsetHeight + "px"; + OZ.$("bar").style.maxHeight = this._elm.offsetHeight + "px"; } this._elm.className = (this._state ? "on" : "off"); } diff --git a/styles/material-inspired.css b/styles/material-inspired.css new file mode 100644 index 0000000..6533e02 --- /dev/null +++ b/styles/material-inspired.css @@ -0,0 +1,327 @@ +body { + font-family: verdana, sans serif; + font-size: small; + padding: 0px; + margin: 0px; + background: #FFF; + visibility: hidden; + -moz-user-select: -moz-none; + -khtml-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; +} + +#area { + position: relative; + background: transparent url(../images/back_dim.png); + width: 3000px; + height: 3000px; + opacity: 0.7; +} + +#controls { + position: absolute; + left: 0px; + top: 0px; +} + +#bar { + position: fixed; + transition: all .2s ease-in-out; + right: 4px; + top: 0px; + width: 200px; + margin: 0px 0px 20px 0px; + padding: 0px; + background-color: rgb(255, 255, 255); + text-align: center; + color: rgba(0, 0, 0, 0.87); + border-radius: 0px; + box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px 0px, rgba(0, 0, 0, 0.23) 0px 3px 6px 0px; + box-sizing: border-box; + max-height: 600px; +} + +#bar input { + display: block; + cursor: pointer; + transition: all .2s ease-in-out; + border-radius: 2px; + width: 100%; + height: auto; + background-color: transparent; + border: none; + margin: auto auto 3px auto; + padding: 2px; + line-height: 1.3; + font-size: small; + text-transform: uppercase; + letter-spacing: .03em; + font-family: verdana, sans-serif; +} + +#bar input:hover { + background-color: #FF4081; + color: #fff; +} + +#bar input:disabled { + cursor: not-allowed; + pointer-events: none; + opacity: .6; + box-shadow: none; +} + +#bar hr { + margin: 8px; + background-color: #ddd; + height: 1px; + border: none; +} + +#bar input.small { + width: 45%; + display: inline; +} + +#toggle { + margin-bottom: 5px; + cursor: pointer; + transition: all .2s ease-in-out; + border-radius: 2px; + background-position: center; + background-repeat: no-repeat; + height: 21px; +} + +#toggle:hover { + background-color: #FF4081; +} + +#toggle.on:hover { + background-image: url(../images/up_2_white.png); +} + +#toggle.off:hover { + background-image: url(../images/down_2_white.png); +} + +#toggle.on { + background-image: url(../images/up_2_black.png); +} + +#toggle.off { + background-image: url(../images/down_2_black.png); +} + +#minimap { + position: fixed; + width: 100px; + height: 100px; + right: 5px; + bottom: 5px; + background-color: #fff; + opacity: 0.9; + overflow: hidden; + box-shadow: 0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24); +} + +.mini { + position: absolute; + background-color: #ff8fb5; + font-size: 1px; + line-height: 1px; +} + +.mini_selected { + background-color: #de2665; +} + +.port { + position: absolute; + transition: border 0.2s ease-in-out; + border: 2px solid rgba(0,0,0,.3); +} + +#minimap:hover .port { + border: 2px solid rgba(0,0,0,.8); +} + +.table { + position: absolute; + border: 1px solid #000; + background-color: #ddd; + cursor: pointer; + -moz-box-shadow: 4px 4px 8px #888; + /* FF 3.5+ */ + -webkit-box-shadow: 4px 4px 8px #888; + /* Safari 3.0+, Chrome */ + box-shadow: 4px 4px 8px #888; + /* Opera 10.5, IE 9.0 */ + filter: progid:DXImageTransform.Microsoft.Shadow(Strength=5, Direction=135, Color='#888888'); + /* IE 6, IE 7 */ + -ms-filter: progid:DXImageTransform.Microsoft.Shadow(Strength=5, Direction=135, Color='#888888'); + /* IE 8 */ + border-radius: 3px; +} + +.table table { + border-collapse: collapse; +} + +.table.selected { + border: 2px solid #000; +} + +.table thead .title { + text-align: center; + padding: 3px 30px; +} + +.table tbody { + border-top: 1px dotted #888; +} + +.table tbody td { + padding: 3px; +} + +.table tbody .selected { + font-weight: bold; + color: #f00; + display: inline-block; +} + +.table tbody .title { + display: inline-block; +} + +.table thead td[title]:not([title=""]):after { + content: ''; + position: absolute; + top: 0; + right: 0; + border-color: royalblue; + border-style: solid; + border-width: 5px; + border-bottom-color: transparent; + border-left-color: transparent; +} + +.table tbody td { + position: relative; +} + +.table tbody[title]:not(.expanded):not([title=""]) td:last-child:after { + content: ''; + position: absolute; + top: 0; + right: 0; + border-color: royalblue; + border-style: solid; + border-width: 5px; + border-bottom-color: transparent; + border-left-color: transparent; +} + +.primary { + font-weight: bold; +} + +.key { + font-style: italic; +} + +.primary.key { + font-style: normal; +} + +.typehint { + font-size: 80%; + color: gray; +} + +.comment { + font-size: 80%; + font-weight: normal; + margin-right: 0.5em; +} + +.adding { + cursor: crosshair; +} + +.relation { + overflow: hidden; +} + +#background { + position: absolute; + background-color: #000; + opacity: 0.5; + visibility: hidden; +} + +#window { + position: absolute; + visibility: hidden; + background-color: #fff; + border: 6px double #333; +} + +#windowtitle { + border-bottom: 2px solid #333; + padding: 2px; + padding-left: 1em; + font-weight: bold; + background-color: rgb(238, 238, 170); +} + +#windowcontent { + padding: 1em; +} + +#windowok, #windowcancel { + margin: 0em 1em 1em; +} + +.small { + font-size: 85%; +} + +#textarea { + width: 650px; + height: 200px; +} + +#opts { + width: 700px; +} + +#keys { + white-space: nowrap; + text-align: center; +} + +legend { + font-weight: bold; +} + +label, input, select { + vertical-align: middle; +} + +#throbber { + position: absolute; + top: 2px; + right: 3px; +} + +#rubberband { + position: absolute; + border: 1px solid #000; + background: #888; + opacity: 0.5; + visibility: hidden; +} \ No newline at end of file diff --git a/styles/style.css b/styles/original.css similarity index 100% rename from styles/style.css rename to styles/original.css From 12f51f1171e68376b01e96c18b7fe54e8aa36270 Mon Sep 17 00:00:00 2001 From: loro2 <51793898+loro2@users.noreply.github.com> Date: Thu, 25 Jul 2019 10:16:27 +0200 Subject: [PATCH 2/8] style tables, opts menu --- js/row.js | 70 +++++----- styles/material-inspired.css | 262 ++++++++++++++++++++++++++++------- 2 files changed, 245 insertions(+), 87 deletions(-) diff --git a/js/row.js b/js/row.js index 32a9bc7..7d67241 100644 --- a/js/row.js +++ b/js/row.js @@ -5,16 +5,16 @@ SQL.Row = function(owner, title, data) { this.keys = []; this.selected = false; this.expanded = false; - + SQL.Visual.apply(this); - + this.data.type = 0; this.data.size = ""; this.data.def = null; this.data.nll = true; this.data.ai = false; this.data.comment = ""; - + if (data) { this.update(data); } this.setTitle(title); } @@ -22,7 +22,7 @@ SQL.Row.prototype = Object.create(SQL.Visual.prototype); SQL.Row.prototype._build = function() { this.dom.container = OZ.DOM.elm("tbody"); - + this.dom.content = OZ.DOM.elm("tr"); this.dom.selected = OZ.DOM.elm("div", {className:"selected",innerHTML:"» "}); this.dom.title = OZ.DOM.elm("div", {className:"title"}); @@ -35,7 +35,7 @@ SQL.Row.prototype._build = function() { [this.dom.content, td1, td2], [td1, this.dom.selected, this.dom.title] ); - + this.enter = this.enter.bind(this); this.changeComment = this.changeComment.bind(this); @@ -64,7 +64,7 @@ SQL.Row.prototype.setTitle = function(t) { var tt = r.row2.getTitle().replace(new RegExp(old,"g"),t); if (tt != r.row2.getTitle()) { r.row2.setTitle(tt); } } - + SQL.Visual.prototype.setTitle.apply(this, [t]); } @@ -82,7 +82,7 @@ SQL.Row.prototype.dblclick = function(e) { /* dblclicked on row */ SQL.Row.prototype.update = function(data) { /* update subset of row data */ var des = SQL.Designer; if (data.nll && data.def && data.def.match(/^null$/i)) { data.def = null; } - + for (var p in data) { this.data[p] = data[p]; } if (!this.data.nll && this.data.def === null) { this.data.def = ""; } @@ -116,7 +116,7 @@ SQL.Row.prototype.down = function() { /* shift down */ SQL.Row.prototype.buildEdit = function() { OZ.DOM.clear(this.dom.container); - + var elms = []; this.dom.name = OZ.DOM.elm("input"); this.dom.name.type = "text"; @@ -141,15 +141,16 @@ SQL.Row.prototype.buildEdit = function() { this.dom.nll = OZ.DOM.elm("input"); this.dom.nll.type = "checkbox"; elms.push(["null",this.dom.nll]); - + this.dom.comment = OZ.DOM.elm("span",{className:"comment"}); this.dom.comment.innerHTML = ""; this.dom.comment.appendChild(document.createTextNode(this.data.comment)); this.dom.commentbtn = OZ.DOM.elm("input"); this.dom.commentbtn.type = "button"; + this.dom.commentbtn.id = "commentbtn" this.dom.commentbtn.value = _("comment"); - + OZ.Event.add(this.dom.commentbtn, "click", this.changeComment); for (var i=0;i\n"; - + if (this.data.def || this.data.def === null) { var q = elm.getAttribute("quote"); var d = this.data.def; - if (d === null) { - d = "NULL"; - } else if (d != "CURRENT_TIMESTAMP") { - d = q+d+q; + if (d === null) { + d = "NULL"; + } else if (d != "CURRENT_TIMESTAMP") { + d = q+d+q; } xml += ""+SQL.escape(d)+""; } @@ -348,27 +350,27 @@ SQL.Row.prototype.toXML = function() { if (r.row2 != this) { continue; } xml += '\n'; } - - if (this.data.comment) { - xml += ""+SQL.escape(this.data.comment)+"\n"; + + if (this.data.comment) { + xml += ""+SQL.escape(this.data.comment)+"\n"; } - + xml += "\n"; return xml; } SQL.Row.prototype.fromXML = function(node) { var name = node.getAttribute("name"); - + var obj = { type:0, size:"" }; obj.nll = (node.getAttribute("null") == "1"); obj.ai = (node.getAttribute("autoincrement") == "1"); - + var cs = node.getElementsByTagName("comment"); if (cs.length && cs[0].firstChild) { obj.comment = cs[0].firstChild.nodeValue; } - + var d = node.getElementsByTagName("datatype"); - if (d.length && d[0].firstChild) { + if (d.length && d[0].firstChild) { var s = d[0].firstChild.nodeValue; var r = s.match(/^([^\(]+)(\((.*)\))?.*$/); var type = r[1]; @@ -380,10 +382,10 @@ SQL.Row.prototype.fromXML = function(node) { if (sql == type || (re && new RegExp(re).exec(type)) ) { obj.type = i; } } } - + var elm = DATATYPES.getElementsByTagName("type")[obj.type]; var d = node.getElementsByTagName("default"); - if (d.length && d[0].firstChild) { + if (d.length && d[0].firstChild) { var def = d[0].firstChild.nodeValue; obj.def = def; var q = elm.getAttribute("quote"); @@ -420,7 +422,7 @@ SQL.Row.prototype.isKey = function() { } SQL.Row.prototype.enter = function(e) { - if (e.keyCode == 13) { + if (e.keyCode == 13) { this.collapse(); } } diff --git a/styles/material-inspired.css b/styles/material-inspired.css index 6533e02..a7620c7 100644 --- a/styles/material-inspired.css +++ b/styles/material-inspired.css @@ -1,9 +1,12 @@ body { - font-family: verdana, sans serif; - font-size: small; + font-family: verdana, sans-serif; + font-size: 12px; padding: 0px; margin: 0px; background: #FFF; + font-weight: 400; + line-height: 1.429; + color: rgba(0, 0, 0, .87); visibility: hidden; -moz-user-select: -moz-none; -khtml-user-select: none; @@ -12,6 +15,158 @@ body { user-select: none; } +input[type=text] { + font-family: verdana, sans-serif; + height: 32px; + display: block; + background-color: transparent; + color: rgba(0, 0, 0, .87); + border: none; + border-bottom-color: currentcolor; + border-bottom-style: none; + border-bottom-width: medium; + border-bottom: 1px solid rgba(0, 0, 0, .26); + outline: 0; + width: 100%; + font-size: 16px; + padding: 0; + box-shadow: none; + border-radius: 0; + background-image: none; +} + +input[type=text]:focus { + border-color: #2196F3; + border-width: 2px; +} + +textarea { + min-width: 500px; + font-family: verdana, sans-serif; + min-height: 64px; + display: block; + background-color: transparent; + color: rgba(0, 0, 0, .87); + border: none; + border-bottom-color: currentcolor; + border-bottom-style: none; + border-bottom-width: medium; + border-bottom: 1px solid rgba(0, 0, 0, .26); + outline: 0; + width: 100%; + font-size: 16px; + padding: 0; + box-shadow: none; + border-radius: 0; + background-image: none; +} + +textarea:focus { + border-color: #2196F3; + border-width: 2px; +} + +input[type=button] { + font-family: verdana, sans-serif; + -webkit-appearance: button; + cursor: pointer; + font-weight: 500; + font-size: 14px; + line-height: 18px; + text-transform: uppercase; + color: rgba(0, 0, 0, .87); + background-color: #FFF; + display: inline-block; + height: 36px; + padding: 0 26px; + margin-top: 6px; + margin-bottom: 6px; + border: none; + border-radius: 2px; + cursor: pointer; + -ms-touch-action: manipulation; + touch-action: manipulation; + background-image: none; + text-align: center; + line-height: 36px; + vertical-align: middle; + white-space: nowrap; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + font-size: 14px; + letter-spacing: .03em; + position: relative; + overflow: hidden; +} + +legend { + font-weight: bold; +} + +label, input, select { + vertical-align: middle; +} + +label { + opacity: 0.7; +} + +#commentbtn { + box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 2px 2px rgba(0, 0, 0, .2); +} + +#windowok { + color: #FF4081; +} + +#windowok, #windowcancel { + float: right; +} + +#windowok:hover, #windowcancel:hover { + background-color: #f2f2f2; +} + +select { + font-family: verdana, sans-serif; + display: block; + height: 32px; + width: 100%; + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + outline: 0; + border: none; + border-bottom-color: currentcolor; + border-bottom-style: none; + border-bottom-width: medium; + border-bottom: 1px solid rgba(0, 0, 0, .26); + border-radius: 0; + box-shadow: none; + background-color: transparent; + background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNiIgd2lkdGg9IjEwIj48cG9seWdvbiBwb2ludHM9IjAsMCAxMCwwIDUsNiIgc3R5bGU9ImZpbGw6cmdiYSgwLDAsMCwuMjQpOyIvPjwvc3ZnPg==); + background-repeat: no-repeat; + background-position: right center; + cursor: pointer; + color: rgba(0, 0, 0, .87); + font-size: 16px; + padding: 0 25px 0 0; +} + +select:focus { + border-color: #2196F3; + border-width: 2px; +} + +select optgroup { + color: rgba(0, 0, 0, .54); + font-size: .9em; + background: white !important; + font-style: normal; +} + #area { position: relative; background: transparent url(../images/back_dim.png); @@ -36,7 +191,6 @@ body { padding: 0px; background-color: rgb(255, 255, 255); text-align: center; - color: rgba(0, 0, 0, 0.87); border-radius: 0px; box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px 0px, rgba(0, 0, 0, 0.23) 0px 3px 6px 0px; box-sizing: border-box; @@ -44,32 +198,26 @@ body { } #bar input { - display: block; - cursor: pointer; transition: all .2s ease-in-out; border-radius: 2px; width: 100%; height: auto; - background-color: transparent; - border: none; margin: auto auto 3px auto; padding: 2px; line-height: 1.3; font-size: small; - text-transform: uppercase; - letter-spacing: .03em; - font-family: verdana, sans-serif; + opacity: .7; } #bar input:hover { - background-color: #FF4081; + background-color: #e9115d; color: #fff; } #bar input:disabled { cursor: not-allowed; pointer-events: none; - opacity: .6; + opacity: .4; box-shadow: none; } @@ -93,10 +241,11 @@ body { background-position: center; background-repeat: no-repeat; height: 21px; + opacity: .7; } #toggle:hover { - background-color: #FF4081; + background-color: #e9115d; } #toggle.on:hover { @@ -124,7 +273,7 @@ body { background-color: #fff; opacity: 0.9; overflow: hidden; - box-shadow: 0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24); + box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24); } .mini { @@ -141,29 +290,21 @@ body { .port { position: absolute; transition: border 0.2s ease-in-out; - border: 2px solid rgba(0,0,0,.3); + border: 2px solid rgba(0, 0, 0, .3); } #minimap:hover .port { - border: 2px solid rgba(0,0,0,.8); + border: 2px solid rgba(0, 0, 0, .8); } .table { position: absolute; - border: 1px solid #000; - background-color: #ddd; + padding: 0 6px 6px 6px; cursor: pointer; - -moz-box-shadow: 4px 4px 8px #888; - /* FF 3.5+ */ - -webkit-box-shadow: 4px 4px 8px #888; - /* Safari 3.0+, Chrome */ - box-shadow: 4px 4px 8px #888; - /* Opera 10.5, IE 9.0 */ - filter: progid:DXImageTransform.Microsoft.Shadow(Strength=5, Direction=135, Color='#888888'); - /* IE 6, IE 7 */ - -ms-filter: progid:DXImageTransform.Microsoft.Shadow(Strength=5, Direction=135, Color='#888888'); - /* IE 8 */ - border-radius: 3px; + margin-bottom: 20px; + border-radius: 0; + background-color: #FFF; + box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .16), 0 0 2px 0 rgba(0, 0, 0, .12); } .table table { @@ -171,22 +312,28 @@ body { } .table.selected { - border: 2px solid #000; + border: 1px solid #FF4081; } .table thead .title { text-align: center; - padding: 3px 30px; + padding: 6px 30px; } .table tbody { - border-top: 1px dotted #888; + border-right: 4px solid transparent; + background: none !important; } .table tbody td { padding: 3px; } +.table tbody.expanded { + border-right: 6px solid rgba(0, 0, 0, .12); + background-color: whitesmoke !important; +} + .table tbody .selected { font-weight: bold; color: #f00; @@ -202,7 +349,7 @@ body { position: absolute; top: 0; right: 0; - border-color: royalblue; + border-color: rgb(125, 178, 221); border-style: solid; border-width: 5px; border-bottom-color: transparent; @@ -215,14 +362,14 @@ body { .table tbody[title]:not(.expanded):not([title=""]) td:last-child:after { content: ''; - position: absolute; - top: 0; - right: 0; - border-color: royalblue; + position: relative; + border-color: rgb(125, 178, 221); border-style: solid; - border-width: 5px; + border-width: 6px; border-bottom-color: transparent; border-left-color: transparent; + border-top-color: transparent; + float: right; } .primary { @@ -267,23 +414,23 @@ body { position: absolute; visibility: hidden; background-color: #fff; - border: 6px double #333; + box-shadow: 0 10px 20px rgba(0, 0, 0, .19), 0 6px 6px rgba(0, 0, 0, .23); + padding: 15px; } #windowtitle { - border-bottom: 2px solid #333; - padding: 2px; - padding-left: 1em; - font-weight: bold; - background-color: rgb(238, 238, 170); + font-size: x-large; + margin: 15px 15px 24px 15px; + padding-left: 15px; + padding-right: 15px; } #windowcontent { padding: 1em; } -#windowok, #windowcancel { - margin: 0em 1em 1em; +#tablename, #tablecomment { + margin-bottom: 10px; } .small { @@ -299,18 +446,27 @@ body { width: 700px; } +#opts td { + padding-top: 15px; + margin-bottom: 20px; +} + +#opts #optionsnotice { + opacity: 0.7; +} + +#opts hr { + background-color: #ddd; + height: 1px; + border: none; + margin: 25px 0px 25px 0px; +} + #keys { white-space: nowrap; text-align: center; } -legend { - font-weight: bold; -} - -label, input, select { - vertical-align: middle; -} #throbber { position: absolute; From 38c740067c4e4bcc1baca328b655a46bc61edfa7 Mon Sep 17 00:00:00 2001 From: loro2 <51793898+loro2@users.noreply.github.com> Date: Thu, 25 Jul 2019 14:06:50 +0200 Subject: [PATCH 3/8] styling dialog boxes --- styles/material-inspired.css | 124 +++++++++++++++++++++++++++++++---- 1 file changed, 112 insertions(+), 12 deletions(-) diff --git a/styles/material-inspired.css b/styles/material-inspired.css index a7620c7..cd4b448 100644 --- a/styles/material-inspired.css +++ b/styles/material-inspired.css @@ -102,7 +102,20 @@ input[type=button] { } legend { - font-weight: bold; + text-align: left; + display: block; + width: 100%; + padding: 0; + margin-bottom: 10px; + font-size: 21px; + color: rgba(0, 0, 0, .87); + line-height: inherit; +} + +fieldset { + border: none; + padding: 0px; + margin: 0px 0px 10px 0px; } label, input, select { @@ -113,6 +126,66 @@ label { opacity: 0.7; } +#keys hr { + visibility: hidden; +} + +#keyadd { + margin: 15px; + color: #FFF; + background-color: #2196F3; +} + +#keyremove { + margin: 15px; + color: #FFF; + background-color: #F44336; +} + +#keyremove:hover { + transition: all .2s ease-in-out; + background-color: #f55a4e; + box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 2px 2px rgba(0, 0, 0, .2); +} + +#keyadd:hover { + transition: all .2s ease-in-out; + background-color: #39a1f4; + box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 2px 2px rgba(0, 0, 0, .2); +} + +#keyleft, #keyright { + height: auto; + line-height: normal; + box-shadow: none; + padding: 3px; + box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 2px 2px rgba(0, 0, 0, .2); +} + +#keyfields, #keyavail { + height: auto; + background-image: none; + font-size: small; + border: 1px solid rgba(0, 0, 0, .26); + padding: 0px; +} + +#keys table { + width: 100%; +} + +#keys table td { + width: 42%; +} + +#keys table td+td { + width: 16%; +} + +#keys table td+td+td { + width: 42%; +} + #commentbtn { box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 2px 2px rgba(0, 0, 0, .2); } @@ -186,7 +259,7 @@ select optgroup { transition: all .2s ease-in-out; right: 4px; top: 0px; - width: 200px; + width: 190px; margin: 0px 0px 20px 0px; padding: 0px; background-color: rgb(255, 255, 255); @@ -205,8 +278,8 @@ select optgroup { margin: auto auto 3px auto; padding: 2px; line-height: 1.3; - font-size: small; opacity: .7; + text-transform: none; } #bar input:hover { @@ -240,7 +313,7 @@ select optgroup { border-radius: 2px; background-position: center; background-repeat: no-repeat; - height: 21px; + height: 22px; opacity: .7; } @@ -327,6 +400,7 @@ select optgroup { .table tbody td { padding: 3px; + position: relative; } .table tbody.expanded { @@ -356,10 +430,6 @@ select optgroup { border-left-color: transparent; } -.table tbody td { - position: relative; -} - .table tbody[title]:not(.expanded):not([title=""]) td:last-child:after { content: ''; position: relative; @@ -438,8 +508,38 @@ select optgroup { } #textarea { - width: 650px; + width: 100%; height: 200px; + font-size: small; + font-family: "Lucida Console", Monaco, monospace; +} + +#io hr { + visibility: hidden; +} + +#io input[type=button] { + box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 2px 2px rgba(0, 0, 0, .2); +} + +#io input[type=button]:active { + background-color: #f2f2f2; + transition: all .2s ease-out; +} + +#io #clientsql { + color: #FFF; + background-color: #FF4081; +} + +#io #clientsql:hover { + transition: all .2s ease-in-out; + box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 2px 2px rgba(0, 0, 0, .2); + background-color: #ff5a92; +} + +#io { + min-width: 860px; } #opts { @@ -464,10 +564,10 @@ select optgroup { #keys { white-space: nowrap; + padding: 0px 10px; text-align: center; } - #throbber { position: absolute; top: 2px; @@ -476,8 +576,8 @@ select optgroup { #rubberband { position: absolute; - border: 1px solid #000; - background: #888; + border: .2px solid #FF4081; + background: rgba(255, 64, 129, 0.5); opacity: 0.5; visibility: hidden; } \ No newline at end of file From a0d757fdc6db0bcb3953214c71a48a39ed9e822e Mon Sep 17 00:00:00 2001 From: loro2 <51793898+loro2@users.noreply.github.com> Date: Fri, 26 Jul 2019 21:19:54 +0200 Subject: [PATCH 4/8] relation path colors --- js/relation.js | 11 +++++++++-- styles/material-inspired.css | 34 +++++++++++++++++++++++++++++++--- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/js/relation.js b/js/relation.js index db47cdc..f8caaff 100644 --- a/js/relation.js +++ b/js/relation.js @@ -4,6 +4,7 @@ SQL.Relation = function(owner, row1, row2) { this.owner = owner; this.row1 = row1; this.row2 = row2; + this.colorIndex = 0; this.color = "#000"; this.hidden = false; SQL.Visual.apply(this); @@ -12,10 +13,11 @@ SQL.Relation = function(owner, row1, row2) { var all = row1.relations.concat(row2.relations); if (all.length) { /* inherit */ this.color = all[0].getColor(); + this.colorIndex = all[0].getColorIndex(); } else if (CONFIG.RELATION_COLORS) { /* pick next */ SQL.Relation._counter++; - var colorIndex = SQL.Relation._counter - 1; - this.color = CONFIG.RELATION_COLORS[colorIndex % CONFIG.RELATION_COLORS.length]; + this.colorIndex = (SQL.Relation._counter - 1) % CONFIG.RELATION_COLORS.length; + this.color = CONFIG.RELATION_COLORS[this.colorIndex]; } this.row1.addRelation(this); @@ -25,6 +27,7 @@ SQL.Relation = function(owner, row1, row2) { if (this.owner.vector) { var path = document.createElementNS(this.owner.svgNS, "path"); path.setAttribute("stroke", this.color); + path.setAttribute("class", "relation_" + this.colorIndex); path.setAttribute("stroke-width", CONFIG.RELATION_THICKNESS); path.setAttribute("fill", "none"); this.owner.dom.svg.appendChild(path); @@ -51,6 +54,10 @@ SQL.Relation.prototype.getColor = function() { return this.color; } +SQL.Relation.prototype.getColorIndex = function() { + return this.colorIndex; +} + SQL.Relation.prototype.show = function() { this.hidden = false; for (var i=0;i Date: Mon, 29 Jul 2019 17:26:24 +0200 Subject: [PATCH 5/8] style selector option --- index.html | 8 ++++++ js/config.js | 2 ++ js/options.js | 56 ++++++++++++++++++++++-------------- js/wwwsqldesigner.js | 13 +++++++++ locale/ar.xml | 1 + locale/cs.xml | 1 + locale/de.xml | 1 + locale/el.xml | 1 + locale/en.xml | 1 + locale/eo.xml | 1 + locale/es.xml | 1 + locale/fr.xml | 3 +- locale/hu.xml | 1 + locale/it.xml | 1 + locale/ja.xml | 1 + locale/ko.xml | 1 + locale/nl.xml | 1 + locale/pl.xml | 1 + locale/pt_BR.xml | 1 + locale/ro.xml | 1 + locale/ru.xml | 1 + locale/sv.xml | 2 +- locale/tr.xml | 1 + locale/zh.xml | 4 +-- styles/material-inspired.css | 4 +++ 25 files changed, 83 insertions(+), 26 deletions(-) diff --git a/index.html b/index.html index 7709428..55e889a 100644 --- a/index.html +++ b/index.html @@ -120,6 +120,14 @@ + + + * + + + + + diff --git a/js/config.js b/js/config.js index a6a91b0..aef3b22 100644 --- a/js/config.js +++ b/js/config.js @@ -11,6 +11,8 @@ var CONFIG = { RELATION_THICKNESS: 2, RELATION_SPACING: 15, RELATION_COLORS: ["#000", "#800", "#080", "#008", "#088", "#808", "#088"], + + STYLES: ["material-inspired", "original"], STATIC_PATH: "", XHR_PATH: "", diff --git a/js/options.js b/js/options.js index 90854e5..d6a360b 100644 --- a/js/options.js +++ b/js/options.js @@ -1,36 +1,37 @@ /* --------------------- options ------------ */ -SQL.Options = function(owner) { +SQL.Options = function (owner) { this.owner = owner; this.dom = { - container:OZ.$("opts"), - btn:OZ.$("options") + container: OZ.$("opts"), + btn: OZ.$("options") } this.dom.btn.value = _("options"); this.save = this.save.bind(this); this.build(); } -SQL.Options.prototype.build = function() { +SQL.Options.prototype.build = function () { this.dom.optionlocale = OZ.$("optionlocale"); 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"]; - for (var i=0;i%T = الجدول الرئيسي, %R = المفتاح الرئيسي, %t = الجدول الخارجي إخفاء الخطوط عند تحريك الجدول؟ رسم خطوط ناعمة (إذا كان المتصفح يدعم ذلك) ؟ + قلم المدقة diff --git a/locale/cs.xml b/locale/cs.xml index 177d2d4..899e0ef 100644 --- a/locale/cs.xml +++ b/locale/cs.xml @@ -55,6 +55,7 @@ Vykreslovat oblé spojovníky (pakliže to prohlížeč podporuje)? Zobrazovat velikost polí v tabulce? Zobrazovat datový typ polí v tabulce? + Styl Klíče diff --git a/locale/de.xml b/locale/de.xml index d0965be..10d0c68 100644 --- a/locale/de.xml +++ b/locale/de.xml @@ -55,6 +55,7 @@ Zeichne gekrümmte Verbindungslinien (Browser-abhängig)? Zeige Feldgröße im Tabellendesign? Zeige Felddatentyp im Tabellendesign? + Stil Schlüssel diff --git a/locale/el.xml b/locale/el.xml index f157dfd..91751fe 100644 --- a/locale/el.xml +++ b/locale/el.xml @@ -53,6 +53,7 @@ %T = πρωτεύων πίνακας, %R = προτεύον κλειδί, %t = ξένος πίνακας Απόκρυψη συνδέσμων όταν σύρονται οι πίνακες; Διάγραμμα με ομαλούς συνδέσμους(αν παρέχεται από τον περιηγητή); + Στυλ diff --git a/locale/en.xml b/locale/en.xml index 51c42b6..f5b821d 100755 --- a/locale/en.xml +++ b/locale/en.xml @@ -55,6 +55,7 @@ Draw smooth connectors (if supported by browser)? Show field size in table design? Show field datatype in table design? + Style Keys diff --git a/locale/eo.xml b/locale/eo.xml index cb5b3d3..2b29723 100644 --- a/locale/eo.xml +++ b/locale/eo.xml @@ -55,6 +55,7 @@ Desegni glatajn konektilojn (se subtenata de retumilo)? Show field size in table design? Show field datatype in table design? + Stilo Klavoj diff --git a/locale/es.xml b/locale/es.xml index 7a4591c..7ab14ef 100644 --- a/locale/es.xml +++ b/locale/es.xml @@ -55,6 +55,7 @@ ¿Dibujar conectores suaves (si son soportados por el navegador)? ¿Mostrar tamaño del campo en el diseño de tabla? ¿Mostrar tipo de dato del campo en el diseño de tabla? + Estilo Claves diff --git a/locale/fr.xml b/locale/fr.xml index e7d3302..75b876e 100644 --- a/locale/fr.xml +++ b/locale/fr.xml @@ -55,7 +55,8 @@ Dessiner des connecteurs « adoucis » (si le navigateur le supporte) ? Afficher la taille du champ dans le schéma de table ? Afficher le type du champ dans le schéma de table ? - + Style + Clés Clés dans la table « %s » diff --git a/locale/hu.xml b/locale/hu.xml index c6ca773..734d593 100644 --- a/locale/hu.xml +++ b/locale/hu.xml @@ -53,6 +53,7 @@ %T = elsődleges tábla, %R = elsődleges kulcs, %t = idegen tábla Elrejtsem a kapcsolókat a rajztáblán? Kapcsolók finom kirajzolása (ha a böngésző lehetővé teszi)? + Stílus diff --git a/locale/it.xml b/locale/it.xml index 69e929d..c6ffce2 100644 --- a/locale/it.xml +++ b/locale/it.xml @@ -55,6 +55,7 @@ Disegna connettori arrotondati (se supportato dal browser)? Show field size in table design? Show field datatype in table design? + Stile Chiavi diff --git a/locale/ja.xml b/locale/ja.xml index 5ac033b..ce7350a 100644 --- a/locale/ja.xml +++ b/locale/ja.xml @@ -54,6 +54,7 @@ 滑らかな線を使う(要ブラウザのサポート) フィールドサイズを表示 フィールドタイプを表示 + スタイル キーの設定 diff --git a/locale/ko.xml b/locale/ko.xml index 3f5e75c..c293406 100644 --- a/locale/ko.xml +++ b/locale/ko.xml @@ -55,6 +55,7 @@ 부드러운 연결선 사용 (브라우저 지원 필요)? 디자인에서 필드 사이즈를 표시 디자인에서 필드 타입을 표시 + 스타일 키 설정 diff --git a/locale/nl.xml b/locale/nl.xml index b236de7..eaefb3d 100644 --- a/locale/nl.xml +++ b/locale/nl.xml @@ -55,6 +55,7 @@ Teken gekromde relaties (als de browser dit ondersteund)? Toon veld omvang in tabelontwerp? Toon veld type in tabelontwerp? + Stijl Sleutels diff --git a/locale/pl.xml b/locale/pl.xml index 7350c40..65176e1 100644 --- a/locale/pl.xml +++ b/locale/pl.xml @@ -55,6 +55,7 @@ Rysuj pływające złącza (jesli wsperane jest przez przeglądarkę)? Show field size in table design? Show field datatype in table design? + Styl Klucze diff --git a/locale/pt_BR.xml b/locale/pt_BR.xml index 3d6df03..9c0a4b1 100644 --- a/locale/pt_BR.xml +++ b/locale/pt_BR.xml @@ -53,6 +53,7 @@ %T = tabela primária, %R = chave primária, %t = tabela estrangeira Esconder connectores na tela? Desenhar conectores suaves (se suportado pelo navegador)? + Estilo diff --git a/locale/ro.xml b/locale/ro.xml index 6b1ffdd..816d9fb 100644 --- a/locale/ro.xml +++ b/locale/ro.xml @@ -53,6 +53,7 @@ %T = Tabela primara, %R = Primary key, %t = Tabela cu Foreign key Ascunde conexiunile la mutarea tabelei? Deseneaza folosind "smooth connectors" (daca browserul suporta)? + Stil diff --git a/locale/ru.xml b/locale/ru.xml index 1b31548..c185d20 100644 --- a/locale/ru.xml +++ b/locale/ru.xml @@ -55,6 +55,7 @@ Рисовать сглаженные связи (если поддерживается браузером)? Показывать размеры полей таблиц? Показывать типы данных полей таблиц? + Стиль Ключи diff --git a/locale/sv.xml b/locale/sv.xml index 583b5bf..2f9c93e 100644 --- a/locale/sv.xml +++ b/locale/sv.xml @@ -53,7 +53,7 @@ %T = primär tabell, %R = primär nycke, %t = främmande tabell Dölj anslutningar när du drar i tabellen? Rita mjuka anslutningar (om din webbläsare stöder det)? - + Stil Nycklar diff --git a/locale/tr.xml b/locale/tr.xml index 9d4849d..83c8a9a 100644 --- a/locale/tr.xml +++ b/locale/tr.xml @@ -55,6 +55,7 @@ Draw smooth connectors (if supported by browser)? Tablo tasarımında alan boyutunu gösterme? Alan veri tipini tablo tasarımında göster? + Stil Anahtarlar diff --git a/locale/zh.xml b/locale/zh.xml index 5e8f71b..be2dffd 100644 --- a/locale/zh.xml +++ b/locale/zh.xml @@ -52,9 +52,9 @@ %T = 主表, %R = 主键, %t = 外连表 在表格移动时不显示连接? 绘制平滑的连接 (如果浏览器支持)? - 设计表格时显示字段大小? + 设计表格时显示字段大小? 设计表格时显示字段数据类型? - + 样式 设置表键 diff --git a/styles/material-inspired.css b/styles/material-inspired.css index 12546ed..54ac1c4 100644 --- a/styles/material-inspired.css +++ b/styles/material-inspired.css @@ -514,6 +514,10 @@ select optgroup { font-family: "Lucida Console", Monaco, monospace; } +#io table { + width: 100%; +} + #io hr { visibility: hidden; } From 45a439d6458fa365783b12c9b1cf70c10b6db4b7 Mon Sep 17 00:00:00 2001 From: loro2 <51793898+loro2@users.noreply.github.com> Date: Mon, 29 Jul 2019 18:02:51 +0200 Subject: [PATCH 6/8] relation colors fix --- js/config.js | 3 ++- js/relation.js | 24 ++++++++++++++---------- js/wwwsqldesigner.js | 20 ++++++++++---------- styles/material-inspired.css | 28 ---------------------------- 4 files changed, 26 insertions(+), 49 deletions(-) diff --git a/js/config.js b/js/config.js index aef3b22..49636ed 100644 --- a/js/config.js +++ b/js/config.js @@ -11,8 +11,9 @@ var CONFIG = { RELATION_THICKNESS: 2, RELATION_SPACING: 15, RELATION_COLORS: ["#000", "#800", "#080", "#008", "#088", "#808", "#088"], - + STYLES: ["material-inspired", "original"], + MATERIAL_RELATION_COLORS: ["#323232", "#F44336", "#E91E63", "#9C27B0", "#3F51B5", "#673AB7", "#2196F3", "#03A9F4", "#00BCD4", "#009688", "#4CAF50", "#8BC34A", "#CDDC39", "#FFC107", "#FF5722", "#795548", "#607D8B"], STATIC_PATH: "", XHR_PATH: "", diff --git a/js/relation.js b/js/relation.js index f8caaff..6a08156 100644 --- a/js/relation.js +++ b/js/relation.js @@ -4,20 +4,29 @@ SQL.Relation = function(owner, row1, row2) { this.owner = owner; this.row1 = row1; this.row2 = row2; - this.colorIndex = 0; this.color = "#000"; this.hidden = false; + this.relationColors = CONFIG.RELATION_COLORS; SQL.Visual.apply(this); + this.style = SQL.Designer.getOption("style"); + switch (this.style) { + case "material-inspired": + this.relationColors = CONFIG.MATERIAL_RELATION_COLORS; + break; + case "original": + default: + this.relationColors = CONFIG.RELATION_COLORS; + } + /* if one of the rows already has relations, inherit color */ var all = row1.relations.concat(row2.relations); if (all.length) { /* inherit */ this.color = all[0].getColor(); - this.colorIndex = all[0].getColorIndex(); - } else if (CONFIG.RELATION_COLORS) { /* pick next */ + } else if (this.relationColors) { /* pick next */ SQL.Relation._counter++; - this.colorIndex = (SQL.Relation._counter - 1) % CONFIG.RELATION_COLORS.length; - this.color = CONFIG.RELATION_COLORS[this.colorIndex]; + var colorIndex = (SQL.Relation._counter - 1) % this.relationColors.length; + this.color = this.relationColors[colorIndex]; } this.row1.addRelation(this); @@ -27,7 +36,6 @@ SQL.Relation = function(owner, row1, row2) { if (this.owner.vector) { var path = document.createElementNS(this.owner.svgNS, "path"); path.setAttribute("stroke", this.color); - path.setAttribute("class", "relation_" + this.colorIndex); path.setAttribute("stroke-width", CONFIG.RELATION_THICKNESS); path.setAttribute("fill", "none"); this.owner.dom.svg.appendChild(path); @@ -54,10 +62,6 @@ SQL.Relation.prototype.getColor = function() { return this.color; } -SQL.Relation.prototype.getColorIndex = function() { - return this.colorIndex; -} - SQL.Relation.prototype.show = function() { this.hidden = false; for (var i=0;i Date: Mon, 29 Jul 2019 18:46:15 +0200 Subject: [PATCH 7/8] code style fix --- js/wwwsqldesigner.js | 4 +- styles/material-inspired.css | 378 ++++++++++++++++++----------------- 2 files changed, 195 insertions(+), 187 deletions(-) diff --git a/js/wwwsqldesigner.js b/js/wwwsqldesigner.js index 4ada5ff..383b359 100644 --- a/js/wwwsqldesigner.js +++ b/js/wwwsqldesigner.js @@ -29,7 +29,7 @@ SQL.Designer = function() { this.flag = 2; this.requestLanguage(); this.requestDB(); - this.setStyle(); + this.applyStyle(); } SQL.Designer.prototype = Object.create(SQL.Visual.prototype); @@ -88,7 +88,7 @@ SQL.Designer.prototype.dbResponse = function(xmlDoc) { if (!this.flag) { this.init2(); } } -SQL.Designer.prototype.setStyle = function() { /* set style */ +SQL.Designer.prototype.applyStyle = function() { /* apply style */ var style = this.getOption("style"); var i, link_elms; for (i=0; link_elms = document.getElementsByTagName("link"); i++) { diff --git a/styles/material-inspired.css b/styles/material-inspired.css index 9a51afe..992876c 100644 --- a/styles/material-inspired.css +++ b/styles/material-inspired.css @@ -1,3 +1,5 @@ +/* Generic styles */ + body { font-family: verdana, sans-serif; font-size: 12px; @@ -15,57 +17,6 @@ body { user-select: none; } -input[type=text] { - font-family: verdana, sans-serif; - height: 32px; - display: block; - background-color: transparent; - color: rgba(0, 0, 0, .87); - border: none; - border-bottom-color: currentcolor; - border-bottom-style: none; - border-bottom-width: medium; - border-bottom: 1px solid rgba(0, 0, 0, .26); - outline: 0; - width: 100%; - font-size: 16px; - padding: 0; - box-shadow: none; - border-radius: 0; - background-image: none; -} - -input[type=text]:focus { - border-color: #2196F3; - border-width: 2px; -} - -textarea { - min-width: 500px; - font-family: verdana, sans-serif; - min-height: 64px; - display: block; - background-color: transparent; - color: rgba(0, 0, 0, .87); - border: none; - border-bottom-color: currentcolor; - border-bottom-style: none; - border-bottom-width: medium; - border-bottom: 1px solid rgba(0, 0, 0, .26); - outline: 0; - width: 100%; - font-size: 16px; - padding: 0; - box-shadow: none; - border-radius: 0; - background-image: none; -} - -textarea:focus { - border-color: #2196F3; - border-width: 2px; -} - input[type=button] { font-family: verdana, sans-serif; -webkit-appearance: button; @@ -101,105 +52,45 @@ input[type=button] { overflow: hidden; } -legend { - text-align: left; +input[type=text] { + font-family: verdana, sans-serif; + height: 32px; display: block; - width: 100%; - padding: 0; - margin-bottom: 10px; - font-size: 21px; + background-color: transparent; color: rgba(0, 0, 0, .87); - line-height: inherit; -} - -fieldset { border: none; - padding: 0px; - margin: 0px 0px 10px 0px; -} - -label, input, select { - vertical-align: middle; -} - -label { - opacity: 0.7; -} - -#keys hr { - visibility: hidden; -} - -#keyadd { - margin: 15px; - color: #FFF; - background-color: #2196F3; -} - -#keyremove { - margin: 15px; - color: #FFF; - background-color: #F44336; -} - -#keyremove:hover { - transition: all .2s ease-in-out; - background-color: #f55a4e; - box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 2px 2px rgba(0, 0, 0, .2); -} - -#keyadd:hover { - transition: all .2s ease-in-out; - background-color: #39a1f4; - box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 2px 2px rgba(0, 0, 0, .2); -} - -#keyleft, #keyright { - height: auto; - line-height: normal; - box-shadow: none; - padding: 3px; - box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 2px 2px rgba(0, 0, 0, .2); -} - -#keyfields, #keyavail { - height: auto; - background-image: none; - font-size: small; - border: 1px solid rgba(0, 0, 0, .26); - padding: 0px; -} - -#keys table { + border-bottom-color: currentcolor; + border-bottom-style: none; + border-bottom-width: medium; + border-bottom: 1px solid rgba(0, 0, 0, .26); + outline: 0; width: 100%; + font-size: 16px; + padding: 0; + box-shadow: none; + border-radius: 0; + background-image: none; } -#keys table td { - width: 42%; -} - -#keys table td+td { - width: 16%; -} - -#keys table td+td+td { - width: 42%; -} - -#commentbtn { - box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 2px 2px rgba(0, 0, 0, .2); -} - -#windowok { - color: #FF4081; -} - -#windowok, #windowcancel { - float: right; -} - -#windowok:hover, #windowcancel:hover { - background-color: #f2f2f2; +textarea { + min-width: 500px; + font-family: verdana, sans-serif; + min-height: 64px; + display: block; + background-color: transparent; + color: rgba(0, 0, 0, .87); + border: none; + border-bottom-color: currentcolor; + border-bottom-style: none; + border-bottom-width: medium; + border-bottom: 1px solid rgba(0, 0, 0, .26); + outline: 0; + width: 100%; + font-size: 16px; + padding: 0; + box-shadow: none; + border-radius: 0; + background-image: none; } select { @@ -228,7 +119,7 @@ select { padding: 0 25px 0 0; } -select:focus { +textarea:focus, select:focus, input[type=text]:focus { border-color: #2196F3; border-width: 2px; } @@ -240,6 +131,33 @@ select optgroup { font-style: normal; } +legend { + text-align: left; + display: block; + width: 100%; + padding: 0; + margin-bottom: 10px; + font-size: 21px; + color: rgba(0, 0, 0, .87); + line-height: inherit; +} + +fieldset { + border: none; + padding: 0px; + margin: 0px 0px 10px 0px; +} + +label { + opacity: 0.7; +} + +label, input, select { + vertical-align: middle; +} + +/* Area */ + #area { position: relative; background: transparent url(../images/back_dim.png); @@ -248,6 +166,23 @@ select optgroup { opacity: 0.7; } +#rubberband { + position: absolute; + border: .2px solid #FF4081; + background: rgba(255, 64, 129, 0.5); + opacity: 0.5; + visibility: hidden; +} + +#background { + position: absolute; + background-color: #000; + opacity: 0.5; + visibility: hidden; +} + +/* Main menu */ + #controls { position: absolute; left: 0px; @@ -294,6 +229,11 @@ select optgroup { box-shadow: none; } +#bar input.small { + width: 45%; + display: inline; +} + #bar hr { margin: 8px; background-color: #ddd; @@ -301,11 +241,6 @@ select optgroup { border: none; } -#bar input.small { - width: 45%; - display: inline; -} - #toggle { margin-bottom: 5px; cursor: pointer; @@ -321,21 +256,23 @@ select optgroup { background-color: #de2665; } +#toggle.on { + background-image: url(../images/up_2_black.png); +} + #toggle.on:hover { background-image: url(../images/up_2_white.png); } +#toggle.off { + background-image: url(../images/down_2_black.png); +} + #toggle.off:hover { background-image: url(../images/down_2_white.png); } -#toggle.on { - background-image: url(../images/up_2_black.png); -} - -#toggle.off { - background-image: url(../images/down_2_black.png); -} +/* Minimap */ #minimap { position: fixed; @@ -370,6 +307,8 @@ select optgroup { border: 2px solid rgba(0, 0, 0, .8); } +/* Tables */ + .table { position: absolute; padding: 0 6px 6px 6px; @@ -465,6 +404,10 @@ select optgroup { margin-right: 0.5em; } +#commentbtn { + box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 2px 2px rgba(0, 0, 0, .2); +} + .adding { cursor: crosshair; } @@ -473,13 +416,12 @@ select optgroup { overflow: hidden; } -#background { - position: absolute; - background-color: #000; - opacity: 0.5; - visibility: hidden; +#tablename, #tablecomment { + margin-bottom: 10px; } +/* Window */ + #window { position: absolute; visibility: hidden; @@ -499,29 +441,38 @@ select optgroup { padding: 1em; } -#tablename, #tablecomment { - margin-bottom: 10px; +#windowok { + color: #FF4081; } -.small { - font-size: 85%; +#windowok, #windowcancel { + float: right; } -#textarea { - width: 100%; - height: 200px; - font-size: small; - font-family: "Lucida Console", Monaco, monospace; +#windowok:hover, #windowcancel:hover { + background-color: #f2f2f2; } -#io table { - width: 100%; +#throbber { + position: absolute; + top: 2px; + right: 3px; +} + +/* Save / Load */ + +#io { + min-width: 860px; } #io hr { visibility: hidden; } +#io table { + width: 100%; +} + #io input[type=button] { box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 2px 2px rgba(0, 0, 0, .2); } @@ -542,10 +493,15 @@ select optgroup { background-color: #ff5a92; } -#io { - min-width: 860px; +#textarea { + width: 100%; + height: 200px; + font-size: small; + font-family: "Lucida Console", Monaco, monospace; } +/* Options */ + #opts { width: 700px; } @@ -566,22 +522,74 @@ select optgroup { margin: 25px 0px 25px 0px; } +.small { + font-size: 85%; +} + +/* Keys */ + #keys { white-space: nowrap; padding: 0px 10px; text-align: center; } -#throbber { - position: absolute; - top: 2px; - right: 3px; +#keys hr { + visibility: hidden; } -#rubberband { - position: absolute; - border: .2px solid #FF4081; - background: rgba(255, 64, 129, 0.5); - opacity: 0.5; - visibility: hidden; +#keys table { + width: 100%; +} + +#keys table td { + width: 42%; +} + +#keys table td+td { + width: 16%; +} + +#keys table td+td+td { + width: 42%; +} + +#keyadd { + margin: 15px; + color: #FFF; + background-color: #2196F3; +} + +#keyadd:hover { + transition: all .2s ease-in-out; + background-color: #39a1f4; + box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 2px 2px rgba(0, 0, 0, .2); +} + +#keyremove { + margin: 15px; + color: #FFF; + background-color: #F44336; +} + +#keyremove:hover { + transition: all .2s ease-in-out; + background-color: #f55a4e; + box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 2px 2px rgba(0, 0, 0, .2); +} + +#keyleft, #keyright { + height: auto; + line-height: normal; + box-shadow: none; + padding: 3px; + box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 2px 2px rgba(0, 0, 0, .2); +} + +#keyfields, #keyavail { + height: auto; + background-image: none; + font-size: small; + border: 1px solid rgba(0, 0, 0, .26); + padding: 0px; } \ No newline at end of file From 3a60955701e10fb05c70a8407f02e927fe863a0a Mon Sep 17 00:00:00 2001 From: loro2 <51793898+loro2@users.noreply.github.com> Date: Mon, 29 Jul 2019 19:15:46 +0200 Subject: [PATCH 8/8] revert autoindent in legacy code --- js/options.js | 42 +++++++++++++++++++++--------------------- js/row.js | 20 ++++++++++---------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/js/options.js b/js/options.js index d6a360b..8c39a47 100644 --- a/js/options.js +++ b/js/options.js @@ -1,17 +1,17 @@ /* --------------------- options ------------ */ -SQL.Options = function (owner) { +SQL.Options = function(owner) { this.owner = owner; this.dom = { - container: OZ.$("opts"), - btn: OZ.$("options") + container:OZ.$("opts"), + btn:OZ.$("options") } this.dom.btn.value = _("options"); this.save = this.save.bind(this); this.build(); } -SQL.Options.prototype.build = function () { +SQL.Options.prototype.build = function() { this.dom.optionlocale = OZ.$("optionlocale"); this.dom.optiondb = OZ.$("optiondb"); this.dom.optionsnap = OZ.$("optionsnap"); @@ -22,8 +22,8 @@ SQL.Options.prototype.build = function () { this.dom.optionshowsize = OZ.$("optionshowsize"); this.dom.optionshowtype = OZ.$("optionshowtype"); - var ids = ["language", "db", "snap", "pattern", "style", "hide", "vector", "showsize", "showtype", "optionsnapnotice", "optionpatternnotice", "optionsnotice"]; - for (var i = 0; i < ids.length; i++) { + var ids = ["language","db","snap","pattern","style","hide","vector","showsize","showtype","optionsnapnotice","optionpatternnotice","optionsnotice"]; + for (var i=0;i"; } @@ -351,8 +351,8 @@ SQL.Row.prototype.toXML = function() { xml += '\n'; } - if (this.data.comment) { - xml += ""+SQL.escape(this.data.comment)+"\n"; + if (this.data.comment) { + xml += ""+SQL.escape(this.data.comment)+"\n"; } xml += "\n"; @@ -385,7 +385,7 @@ SQL.Row.prototype.fromXML = function(node) { var elm = DATATYPES.getElementsByTagName("type")[obj.type]; var d = node.getElementsByTagName("default"); - if (d.length && d[0].firstChild) { + if (d.length && d[0].firstChild) { var def = d[0].firstChild.nodeValue; obj.def = def; var q = elm.getAttribute("quote"); @@ -422,7 +422,7 @@ SQL.Row.prototype.isKey = function() { } SQL.Row.prototype.enter = function(e) { - if (e.keyCode == 13) { + if (e.keyCode == 13) { this.collapse(); } }