Remove other button classes

main
Isaiah Odhner 2017-05-23 05:50:17 +00:00
parent da94b2b994
commit c05eaf0547
5 changed files with 13 additions and 19 deletions

View File

@ -293,11 +293,9 @@ Prankily wait for next user input before fullscreening and bluescreening
* CSS * CSS
* Shouldn't need classes `.jspaint-window-button` (`.jspaint-window-titlebar button`) or `.jspaint-dialogue-button` (`.jspaint-window-content button`) at all * DRY, especially button styles
* DRY, especially for the buttons * Get rid of all `.jspaint-` prefixes
* Seriously, the buttons * Deal with `z-index` rules?
* Also other `.jspaint-` classes
* Deal with `z-index`es
* Comment stuff? * Comment stuff?
* Use a CSS preprocessor so we can do color-swap themes (maybe even load Windows theme files) * Use a CSS preprocessor so we can do color-swap themes (maybe even load Windows theme files)
* Stuff should go in an OS GUI library with themes for Windows 98 and other OSes * Stuff should go in an OS GUI library with themes for Windows 98 and other OSes

View File

@ -11,7 +11,7 @@ function $ToolBox(){
}); });
var $buttons = $($.map(tools, function(tool, i){ var $buttons = $($.map(tools, function(tool, i){
var $b = $(E("button")).addClass("jspaint-tool"); var $b = $(E("div")).addClass("jspaint-tool");
$b.appendTo($tools); $b.appendTo($tools);
tool.$button = $b; tool.$button = $b;

View File

@ -5,7 +5,7 @@ function $Window($component){
var $w = $(E("div")).addClass("jspaint-window").appendTo("body"); var $w = $(E("div")).addClass("jspaint-window").appendTo("body");
$w.$titlebar = $(E("div")).addClass("jspaint-window-titlebar").appendTo($w); $w.$titlebar = $(E("div")).addClass("jspaint-window-titlebar").appendTo($w);
$w.$title = $(E("span")).addClass("jspaint-window-title").appendTo($w.$titlebar); $w.$title = $(E("span")).addClass("jspaint-window-title").appendTo($w.$titlebar);
$w.$x = $(E("button")).addClass("jspaint-window-close-button jspaint-window-button").appendTo($w.$titlebar); $w.$x = $(E("button")).addClass("jspaint-window-close-button").appendTo($w.$titlebar);
$w.$content = $(E("div")).addClass("jspaint-window-content").appendTo($w); $w.$content = $(E("div")).addClass("jspaint-window-content").appendTo($w);
if($component){ if($component){
@ -143,7 +143,6 @@ function $Window($component){
$w.$Button = function(text, handler){ $w.$Button = function(text, handler){
var $b = $(E("button")) var $b = $(E("button"))
.appendTo($w.$content) .appendTo($w.$content)
.addClass("jspaint-dialogue-button")
.text(text) .text(text)
.on("click", function(){ .on("click", function(){
if(handler){ if(handler){
@ -200,9 +199,6 @@ function $FormWindow(title){
action(); action();
}); });
// this should really not be needed @TODO
$b.addClass("jspaint-dialogue-button");
$b.on("pointerdown", function(){ $b.on("pointerdown", function(){
$b.focus(); $b.focus();
}); });

View File

@ -52,7 +52,7 @@ function manage_storage(){
var $tr = $(E("tr")).appendTo($table); var $tr = $(E("tr")).appendTo($table);
var $img = $(E("img")).attr({src: imgSrc}); var $img = $(E("img")).attr({src: imgSrc});
var $remove = $(E("button")).addClass("jspaint-dialogue-button").text("Remove"); var $remove = $(E("button")).text("Remove");
var href = "#" + k.replace("image#", "local:"); var href = "#" + k.replace("image#", "local:");
var $link = $(E("a")).attr({href: href, target: "__blank"}); var $link = $(E("a")).attr({href: href, target: "__blank"});
$link.append($img); $link.append($img);

View File

@ -106,7 +106,7 @@
outline-offset: 1px; outline-offset: 1px;
} }
.jspaint-window-content .jspaint-dialogue-button { .jspaint-window-content button {
margin: 3px; margin: 3px;
padding: 3px; padding: 3px;
box-sizing: border-box; box-sizing: border-box;
@ -118,7 +118,7 @@
background: transparent; background: transparent;
outline: 0; outline: 0;
} }
.jspaint-window-content .jspaint-dialogue-button:before { .jspaint-window-content button:before {
content: " "; content: " ";
position: absolute; position: absolute;
z-index: 1; z-index: 1;
@ -131,8 +131,8 @@
border-right: 1px solid #7b7b7b; border-right: 1px solid #7b7b7b;
border-bottom: 1px solid #7b7b7b; border-bottom: 1px solid #7b7b7b;
} }
.jspaint-window-content .jspaint-dialogue-button:hover:active, .jspaint-window-content button:hover:active,
.jspaint-window-content .jspaint-dialogue-button.pressed, .jspaint-window-content button.pressed,
.jspaint-tool:hover:active, .jspaint-tool:hover:active,
.jspaint-tool.selected { .jspaint-tool.selected {
padding-bottom: 2px; padding-bottom: 2px;
@ -145,8 +145,8 @@
border-right: 1px solid white; border-right: 1px solid white;
border-bottom: 1px solid white; border-bottom: 1px solid white;
} }
.jspaint-window-content .jspaint-dialogue-button:hover:active:before, .jspaint-window-content button:hover:active:before,
.jspaint-window-content .jspaint-dialogue-button.pressed:before, .jspaint-window-content button.pressed:before,
.jspaint-tool:hover:active:before, .jspaint-tool:hover:active:before,
.jspaint-tool.selected:before { .jspaint-tool.selected:before {
top: 0px; top: 0px;
@ -317,7 +317,7 @@ button.selected,
width: 13px; width: 13px;
height: 11px; height: 11px;
} }
.jspaint-window-button { .jspaint-window-titlebar button {
margin: 2px; margin: 2px;
} }
.jspaint-window-content { .jspaint-window-content {