Skip to content

Commit

Permalink
Remove top icons and theme color,
Browse files Browse the repository at this point in the history
All top icons and related functions are removed and the material is applied as the default skin.
  • Loading branch information
bbalganjjm committed Nov 17, 2023
1 parent f668600 commit dcc7a59
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 150 deletions.
39 changes: 18 additions & 21 deletions src/main/resources/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<meta name="viewport" content="device-width, initial-scale=1.0, user-scalable=0" />
<title>Natural-JS Boot</title>

<link rel="stylesheet" type="text/css" href="css/common.pub.css" />
<link rel="stylesheet" type="text/css" href="css/common.css" />

<link rel="stylesheet" type="text/css" href="js/natural_js/css/natural.ui.css" />
<link rel="stylesheet" type="text/css" href="css/common.material.css" />
<link rel="stylesheet" type="text/css" href="css/common.pub.css" />

<script type="text/javascript" charset="utf-8" src="js/natural_js/lib/jquery-1.12.4.min.js"></script>
<script type="text/javascript" charset="utf-8" src="js/natural_js/natural.js.min.js"></script>
<script type="text/javascript" charset="utf-8" src="js/natural_js/natural.template.min.js"></script>
<link rel="stylesheet" type="text/css" href="js/natural_js/css/natural.ui.css" />
<script type="text/javascript" charset="utf-8" src="js/natural_js/natural.template.js"></script>
<script type="text/javascript" charset="utf-8" src="js/natural_js/natural.code.js"></script>
<script type="text/javascript" charset="utf-8" src="js/natural_js/natural.config.js"></script>

Expand All @@ -26,25 +26,22 @@
<script type="text/javascript" charset="utf-8" src="js/common.pub.js"></script>
<script type="text/javascript" charset="utf-8" src="js/common.js"></script>

<!-- material -->
<script type="text/javascript" charset="utf-8" src="js/natural_js/lib/material/material-components-web.min.js"></script>
<link rel="stylesheet" type="text/css" href="js/natural_js/css/natural.ui.material.css" />
<link rel="stylesheet" type="text/css" href="js/natural_js/lib/material/material-components-web.min.css" />
<link rel="stylesheet" type="text/css" href="js/natural_js/lib/material/icon.css" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="js/natural_js/lib/material/icon_ie.css" />
<![endif]-->

<script type="text/javascript">
if(!window.localStorage.themeColor || window.localStorage.themeColor === "undefined") {
window.localStorage.themeColor = "material";
}
if(window.localStorage.themeColor === "material") {
N.context.attr("template").design = "material";
}

if(N.context.attr("template").design) {
$(document).ready(function() {
N.template.design[N.context.attr("template").design](function() {
APP.indx.init();
});
})
} else {
$(document).ready(function() {
N.context.attr("template").design = "material";
$(document).ready(function() {
N.template.design[N.context.attr("template").design](function() {
APP.indx.init();
})
}
});
})
</script>

</head>
Expand Down
41 changes: 0 additions & 41 deletions src/main/resources/static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
this.loadLefter();
this.loadBody();
this.loadFooter();
this.reloadCss();
this.initBrowserHistorySystem();
},
loadHeader : function() {
Expand Down Expand Up @@ -80,46 +79,6 @@

});
},
"colorPalette" : {
material : [],
red : ["#FFEBEE", "#FFCDD2", "#EF9A9A", "#E57373", "EF5350", "#F44336", "#E53935", "#D32F2F", "#C62828", "#B71C1C", "#FF8A80", "#FF5252", "#FF1744", "#D50000"],
pink : ["#FCE4EC", "#F8BBD0", "#F48FB1", "#F06292", "EC407A", "#E91E63", "#D81B60", "#C2185B", "#AD1457", "#880E4F", "#FF80AB", "#FF4081", "#F50057", "#C51162"],
purple : ["#F3E5F5", "#E1BEE7", "#CE93D8", "#BA68C8", "AB47BC", "#9C27B0", "#8E24AA", "#7B1FA2", "#6A1B9A", "#4A148C", "#EA80FC", "#EA80FC", "#D500F9", "#AA00FF"],
deepPurple : ["#EDE7F6", "#D1C4E9", "#B39DDB", "#9575CD", "#7E57C2", "#673AB7", "#5E35B1", "#512DA8", "#4527A0", "#311B92", "#B388FF", "#7C4DFF", "#651FFF", "#6200EA"],
indigo : ["#E8EAF6", "#C5CAE9", "#9FA8DA", "#7986CB", "#5C6BC0", "#3F51B5", "#3949AB", "#303F9F", "#283593", "#1A237E", "#8C9EFF", "#536DFE", "#3D5AFE", "#304FFE"],
blue : ["#E3F2FD", "#BBDEFB", "#90CAF9", "#64B5F6", "#42A5F5", "#2196F3", "#1E88E5", "#1976D2", "#1565C0", "#0D47A1", "#82B1FF", "#448AFF", "#2979FF", "#2962FF"],
lightBlue : ["#E1F5FE", "#B3E5FC", "#81D4FA", "#4FC3F7", "#29B6F6", "#03A9F4", "#039BE5", "#0288D1", "#0277BD", "#01579B", "#80D8FF", "#40C4FF", "#00B0FF", "#0091EA"],
cyan : ["#E0F7FA", "#B2EBF2", "#80DEEA", "#4DD0E1", "#26C6DA", "#00BCD4", "#00ACC1", "#0097A7", "#00838F", "#006064", "#84FFFF", "#18FFFF", "#00E5FF", "#00B8D4"],
teal : ["#E0F2F1", "#B2DFDB", "#80CBC4", "#4DB6AC", "#26A69A", "#009688", "#00897B", "#00796B", "#00695C", "#004D40", "#A7FFEB", "#64FFDA", "#1DE9B6", "#00BFA5"],
green : ["#E8F5E9", "#C8E6C9", "#A5D6A7", "#81C784", "#66BB6A", "#4CAF50", "#43A047", "#388E3C", "#2E7D32", "#1B5E20", "#B9F6CA", "#69F0AE", "#00E676", "#00C853"],
lightGreen : ["#F1F8E9", "#DCEDC8", "#C5E1A5", "#AED581", "#9CCC65", "#8BC34A", "#7CB342", "#689F38", "#558B2F", "#33691E", "#CCFF90", "#B2FF59", "#76FF03", "#64DD17"],
lime : ["#F9FBE7", "#F0F4C3", "#E6EE9C", "#DCE775", "#D4E157", "#CDDC39", "#C0CA33", "#AFB42B", "#9E9D24", "#827717", "#F4FF81", "#EEFF41", "#C6FF00", "#AEEA00"],
yellow : ["#FFFDE7", "#FFF9C4", "#FFF59D", "#FFF176", "#FFEE58", "#FFEB3B", "#FDD835", "#FBC02D", "#F9A825", "#F57F17", "#FFFF8D", "#FFFF00", "#FFEA00", "#FFD600"],
amber : ["#FFF8E1", "#FFECB3", "#FFE082", "#FFD54F", "#FFCA28", "#FFC107", "#FFB300", "#FFA000", "#FF8F00", "#FF6F00", "#FFE57F", "#FFD740", "#FFC400", "#FFAB00"],
orange : ["#FFF3E0", "#FFE0B2", "#FFCC80", "#FFB74D", "#FFA726", "#FF9800", "#FB8C00", "#F57C00", "#EF6C00", "#E65100", "#FFD180", "#FFAB40", "#FF9100", "#FF6D00"],
deepOrange : ["#FBE9E7", "#FFCCBC", "#FFAB91", "#FF8A65", "#FF7043", "#FF5722", "#F4511E", "#E64A19", "#D84315", "#BF360C", "#FF9E80", "#FF6E40", "#FF3D00", "#DD2C00"],
brown : ["#EFEBE9", "#D7CCC8", "#BCAAA4", "#A1887F", "#8D6E63", "#795548", "#6D4C41", "#5D4037", "#4E342E", "#3E2723", "", "", "", ""],
grey : ["#FAFAFA", "#F5F5F5", "#EEEEEE", "#E0E0E0", "#BDBDBD", "#9E9E9E", "#757575", "#616161", "#424242", "#212121", "", "", "", ""],
blueGrey : ["#ECEFF1", "#CFD8DC", "#B0BEC5", "#90A4AE", "#78909C", "#607D8B", "#546E7A", "#455A64", "#37474F", "#263238", "", "", "", ""] // ,
// blackWhite : ["#000000", "#000000", "#000000", "#000000", "#FFFFFF", "#FFFFFF", "#FFFFFF", "#FFFFFF", "#FFFFFF", "#FFFFFF", "", "", "", ""]
},
reloadCss : function() {
if(window.localStorage.themeColor !== "material" && window.localStorage.themeColor !== "green") {
$("head > link[rel=stylesheet]").each(function() {
var href = $(this).attr("href");
if(href.indexOf("natural") > -1 || href.indexOf("common") > -1) {
N.comm({
url : href,
contentType : "text/css",
dataType : "html",
type : "GET"
}).submit(function(data) {
$('<style type="text/css">\n' + data + '</style>').appendTo("head");
});
}
});
}
},
setLocale : function() {
N.locale(window.sessionStorage.locale !== undefined ? window.sessionStorage.locale : IndexController.getLocale().toLowerCase().indexOf("ko") > -1 ? "ko_KR" : "en_US");
N("html").attr("lang", N.locale().substring(0, 2));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ a.btn_mouseout__, input[type='button'].btn_mouseout__, button.btn_mouseout__ {
}

.grid__.grid_select__ > .grid_selected__ {
background-color: transparent;
background-color: rgba(0,0,0,.04);
}
.grid__.grid_select__ > .grid_selected__ > tr,
.grid__.grid_select__ > .grid_selected__ input,
Expand Down
12 changes: 0 additions & 12 deletions src/main/resources/static/js/natural_js/natural.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,6 @@
data = N.code.addSourceURL(data, opts.url);
}

// color theme
if(window.localStorage.themeColor !== "green") {
$(APP.indx.colorPalette.green).each(function(i, color) {
data = data.replace(new RegExp(color, "gi"), APP.indx.colorPalette[window.localStorage.themeColor][i]);

if(opts.contentType === "text/css") {
data = data.replace(/url\(/gi, "*url(");
}
});
}

return data;
}
},
Expand Down Expand Up @@ -914,7 +903,6 @@
* Natural-TEMPLATE Config
*/
N.context.attr("template", {
// design : "material",
aop : {
/**
* Common code request information
Expand Down
52 changes: 11 additions & 41 deletions src/main/resources/static/js/natural_js/natural.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,47 +66,17 @@
});
}

// Load libraries
$.getScript("js/natural_js/lib/material/material-components-web.min.js").done(function(data, textStatus, jqxhr) {
$("<link/>", {
rel: "stylesheet",
type: "text/css",
href: "js/natural_js/css/natural.ui." + N.context.attr("template").design + ".css"
}).appendTo("head");
$("<link/>", {
rel: "stylesheet",
type: "text/css",
href: "css/common." + N.context.attr("template").design + ".css"
}).appendTo("head");
// Load Material Design Libraries.
$("<link/>", {
rel: "stylesheet",
type: "text/css",
href: "js/natural_js/lib/material/icon" + (N.browser.is("ie") ? "_ie" : "") + ".css"
}).appendTo("head");
$("<link/>", {
rel: "stylesheet",
type: "text/css",
href: "js/natural_js/lib/material/material-components-web.min.css"
}).appendTo("head");

// Disable mouse related events of N.button.
if(N.context.attr("ui").button === undefined) {
N.context.attr("ui").button = {};
}
N.context.attr("ui").button.customStyle = true;
// Alert, Popup
N.context.attr("ui").alert.onBeforeShow = N.context.attr("ui").popup.onBeforeShow = TEMPLATE.aop.design.material.onBeforeShow;
// Grid
N.context.attr("ui").grid.misc.fixedcolHeadMarginTop = N.browser.is("ie") || N.browser.is("firefox") ? -1 : 0;
N.context.attr("ui").grid.misc.fixedcolHeadHeight = N.browser.is("ie") || N.browser.is("firefox") ? 2 : 1;
N.context.attr("ui").grid.misc.fixedcolBodyMarginTop = N.browser.is("ie") ? 0 : N.browser.is("firefox") ? -1 : 0;
callback();
}).fail(function(data) {
N.log(data);
N.context.attr("template").design = undefined;
callback();
});
// Disable mouse related events of N.button.
if(N.context.attr("ui").button === undefined) {
N.context.attr("ui").button = {};
}
// Alert, Popup
N.context.attr("ui").alert.onBeforeShow = N.context.attr("ui").popup.onBeforeShow = TEMPLATE.aop.design.material.onBeforeShow;
// Grid
N.context.attr("ui").grid.misc.fixedcolHeadMarginTop = N.browser.is("ie") || N.browser.is("firefox") ? -1 : 0;
N.context.attr("ui").grid.misc.fixedcolHeadHeight = N.browser.is("ie") || N.browser.is("firefox") ? 2 : 1;
N.context.attr("ui").grid.misc.fixedcolBodyMarginTop = N.browser.is("ie") ? 0 : N.browser.is("firefox") ? -1 : 0;
callback();
}
},
aop : {
Expand Down
28 changes: 0 additions & 28 deletions src/main/resources/templates/common/shell/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,40 +105,12 @@
<a class="home" href="./"><span>Natural-JS<sup>Boot</sup></span></a>
</div>
<div class="header-back"></div>
<select class="theme-color" title="색상 테마 선택"></select>
</article>

<script type="text/javascript">
N(".index-header").cont({
init : function(view, request) {
// Language link
view.find(".korean").click(function(e) {
e.preventDefault();
window.sessionStorage.locale = "ko_KR";
window.location.reload();
});
view.find(".english").click(function(e) {
e.preventDefault();
window.sessionStorage.locale = "en_US";
window.location.reload();
});

// Color select
var colorSelect = N(".theme-color", view);
for(var k in APP.indx.colorPalette) {
var selected="";
if(k === window.localStorage.themeColor) {
selected = 'selected="selected"';
} else {
selected = "";
}
colorSelect.append('<option value="' + k + '" ' + selected + '>' + k + '</option>')
};

colorSelect.change(function() {
window.localStorage.themeColor = $(this).val();
location.reload();
});
}
});
</script>
10 changes: 4 additions & 6 deletions src/main/resources/templates/common/shell/lefter.html
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,10 @@ <h6 class="mdc-list-group__subheader">템플릿</h6>
<script type="text/javascript">
N(".index-lefter").cont({
init : function(view, request) {
if(N.context.attr("template").design === "material") {
mdc.list.MDCList.attachTo(N(".left-menu .mdc-list", view).get(0)).wrapFocus = true;
N(".left-menu .mdc-list .mdc-list-item", view).each(function(i, el) {
mdc.ripple.MDCRipple.attachTo(el);
});
}
mdc.list.MDCList.attachTo(N(".left-menu .mdc-list", view).get(0)).wrapFocus = true;
N(".left-menu .mdc-list .mdc-list-item", view).each(function(i, el) {
mdc.ripple.MDCRipple.attachTo(el);
});

N(".left-menu", view).on("click.left-menu", "a", function(e) {
e.preventDefault();
Expand Down

0 comments on commit dcc7a59

Please sign in to comment.