luci-theme-rosy:

htdocs: Modify scrollbar styles, and most interface style changes and bug fixes

Signed-off-by: YanlanShen <yanlan.Shen@rosinson.com>
This commit is contained in:
YanlanShen 2019-01-28 10:39:06 +08:00
parent d6ae36353b
commit c11e4cf659
2 changed files with 2389 additions and 2068 deletions

File diff suppressed because it is too large Load diff

View file

@ -16,8 +16,8 @@
* Licensed to the public under the Apache License 2.0 * Licensed to the public under the Apache License 2.0
*/ */
(function ($) { (function (win, $) {
$(".main > .loading").fadeOut(); $(".loading").fadeOut();
/** /**
* trim text, Remove spaces, wrap * trim text, Remove spaces, wrap
@ -33,16 +33,17 @@
var mainNodeName = undefined; var mainNodeName = undefined;
var nodeUrl = ""; var nodeUrl = "";
(function(node){ (function (node) {
if (node[0] == "admin"){ var luciLocation;
if (node[0] == "admin") {
luciLocation = [node[1], node[2]]; luciLocation = [node[1], node[2]];
}else{ } else {
luciLocation = node; luciLocation = node;
} }
for(var i in luciLocation){ for (var i in luciLocation) {
nodeUrl += luciLocation[i]; nodeUrl += luciLocation[i];
if (i != luciLocation.length - 1){ if (i != luciLocation.length - 1) {
nodeUrl += "/"; nodeUrl += "/";
} }
} }
@ -59,7 +60,7 @@
return true; return true;
} }
$(".main > .main-left .nav > .slide > .menu").each(function () { $(".main-left .nav > .slide > .menu").each(function () {
var ulNode = $(this); var ulNode = $(this);
ulNode.next().find("a").each(function () { ulNode.next().find("a").each(function () {
var that = $(this); var that = $(this);
@ -91,8 +92,7 @@
enterShow: false enterShow: false
}); });
} }
$(".main-left .nav > .slide > .menu").click(function () {
$(".main > .main-left .nav > .slide > .menu").click(function () {
var ul = $(this).next(".slide-menu"); var ul = $(this).next(".slide-menu");
var menu = $(this); var menu = $(this);
if (!ul.is(":visible")) { if (!ul.is(":visible")) {
@ -108,33 +108,32 @@
if ($('.nav').length > 0 && $(window).width() > 992) { if ($('.nav').length > 0 && $(window).width() > 992) {
oScroll.setSize(200); oScroll.setSize(200);
} }
setInterval(function(){ setInterval(function () {
if($('.nav').height() < $('.navbar-container').height()){ if ($('.nav').height() < $('.navbar-container').height()) {
$('.nav').css('transform', 'translate(0px, 0px)'); $('.nav').css('transform', 'translate(0px, 0px)');
} }
}, 300); }, 300);
return false; return false;
}); });
/** /**
* hook menu click and add the hash * hook menu click and add the hash
*/ */
$(".main > .main-left .nav > .slide > .slide-menu > li > a").click(function () { $(".main-left .nav > .slide > .slide-menu > li > a").click(function () {
if (lastNode != undefined) lastNode.removeClass("active"); if (lastNode != undefined) lastNode.removeClass("active");
$(this).parent().addClass("active"); $(this).parent().addClass("active");
$(".main > .loading").fadeIn("fast"); $(".loading").fadeIn("fast");
return true; return true;
}); });
/** /**
* fix menu click * fix menu click
*/ */
$(".main > .main-left .nav > .slide > .slide-menu > li").click(function () { $(".main-left .nav > .slide > .slide-menu > li").click(function () {
if (lastNode != undefined) lastNode.removeClass("active"); if (lastNode != undefined) lastNode.removeClass("active");
$(this).addClass("active"); $(this).addClass("active");
$(".main > .loading").fadeIn("fast"); $(".loading").fadeIn("fast");
window.location = $($(this).find("a")[0]).attr("href"); win.location = $($(this).find("a")[0]).attr("href");
return false; return false;
}); });
@ -160,7 +159,7 @@
that.click(function () { that.click(function () {
var href = that.attr("href"); var href = that.attr("href");
if (href.indexOf("#") == -1) { if (href.indexOf("#") == -1) {
$(".main > .loading").fadeIn("fast"); $(".loading").fadeIn("fast");
return true; return true;
} }
}); });
@ -171,54 +170,50 @@
* Sidebar expand * Sidebar expand
*/ */
var showSide = false; var showSide = false;
$(".showSide").click(function () { if ($(win).height() == 992) {
if (showSide) { $(".showSide").click(function () {
$(".main-left").stop(true).animate({ if (showSide) {
right: '100%' $(".darkMask").stop(true).fadeOut("fast");
}, "fast"); $(".main-left").stop(true).fadeOut("fast");
$(".main-right").css("overflow-y", "auto"); $(".main-right").css("overflow-y", "visible");
showSide = false;
} else {
$(".darkMask").stop(true).fadeIn("fast");
$(".main-left").stop(true).animate({
width: "100%"
}, "fast").fadeIn("fast");
$(".main-right").css("overflow-y", "hidden");
showSide = true;
}
});
$(".main-left").click(function(e) {
e.preventDefault();
$(".main-left").stop(true).fadeOut("fast");
showSide = false; showSide = false;
} else { });
$(".main-left").stop(true).animate({ }
right: '0'
}, "fast");
$(".main-right").css("overflow-y", "hidden");
showSide = true;
}
});
$(".logged-in .main-left").click(function () { $(".darkMask").click(function () {
if (showSide) { if (showSide) {
showSide = false; showSide = false;
$(".darkMask").stop(true).fadeOut("fast");
$(this).stop(true).fadeOut("fast");
$(".main-left").stop(true).animate({ $(".main-left").stop(true).animate({
right: '100%' width: "0"
}, "fast"); }, "fast");
$(".main-right").css("overflow-y", "auto"); $(".main-right").css("overflow-y", "visible");
} }
}); });
$(".logged-in .main-left > *").click(function () { $(win).resize(function () {
event.stopPropagation(); if ($(win).width() > 921) {
if ((navigator.userAgent.indexOf('MSIE') >= 0)&& (navigator.userAgent.indexOf('Opera') < 0)){
event.cancelBubble = true;
}else{
event.stopPropagation();
}
});
$(window).resize(function () {
if ($(window).width() > 921) {
$(".main-left").css("width", ""); $(".main-left").css("width", "");
$(".darkMask").stop(true); $(".darkMask").stop(true);
$(".darkMask").css("display", "none"); $(".darkMask").css("display", "none");
showSide = false; showSide = false;
} }
if( $(window).width() > 992 ){
$('.logged-in .main-right').width( $(window).width() - $('.logged-in .main-left').width() - 50 ); $('body.login').height($(win).height());
}
}); });
/** /**
@ -231,7 +226,7 @@
$(".cbi-section-table-titles, .cbi-section-table-descr, .cbi-section-descr").each(function () { $(".cbi-section-table-titles, .cbi-section-table-descr, .cbi-section-descr").each(function () {
var that = $(this); var that = $(this);
if (that.text().trim() == ""){ if (that.text().trim() == "") {
that.css("display", "none"); that.css("display", "none");
} }
}); });
@ -263,53 +258,20 @@
} }
} }
$('<div class="iconpwd"></div>').appendTo($('.node-main-login form .cbi-value input[type="password"]').parent()[0]); $('.lang_enInterfaces .ifacebox-head').each(function () {
$(this).next().css('border-color', $(this).css('background-color'));
$('<div class="iconuser"></div>').appendTo($('.node-main-login form .cbi-value input[type="text"]').parent()[0]);
$('<div class="iconeye"></div>').appendTo($('.node-main-login form .cbi-value input[type="password"]').parent()[0]);
var num = true;
$('.cbi-value-field .iconeye').click(function(){
if(num){
$('.node-main-login form .cbi-value-last input[type="password"]').prop('type', 'text');
$('.node-main-login form .cbi-value-field .iconeye').removeClass('opeye').addClass('cleye');
num = false;
}else {
$('.node-main-login form .cbi-value-last input[type="text"]').prop('type', 'password');
$('.node-main-login form .cbi-value-field .iconeye').removeClass('cleye').addClass('opeye');
num = true;
}
}); });
$('body.logged-in').css('min-height', $(window).height()); $('<div class="eye"></div>').appendTo('.login > .main .cbi-value-last > .cbi-value-field');
$('.login > .main .cbi-value-last > .cbi-value-field .eye').click(function () {
$(function(){ var className = $(this).attr('class');
if( $(window).width() > 992 ){ if (className.indexOf('op-eye') > (-1)) {
$('.logged-in .main-right').outerWidth( $(window).width() - $('.logged-in .main-left').width() - 50 ); $('.login > .main .cbi-value-last > .cbi-value-field').children().prop('type', 'text');
$(this).addClass('eye').removeClass('op-eye');
} else {
$('.login > .main .cbi-value-last > .cbi-value-field').children().prop('type', 'password');
$(this).addClass('op-eye').removeClass('eye');
} }
$('.cbi-section .table').each(function () {
var firTr = $(this).children('.tr').get(0);
var firTd = $(firTr).children('.td').get(0);
var th = $(firTr).children('.th').get(0);
var laTr = $(this).children('.tr').get($(this).children('.tr').length - 1);
var laTd = $(laTr).children('.td').get(0);
var a = window.getComputedStyle(firTr, ':before').getPropertyValue('content');
if (th && a != 'none') {
$(th).css('border-top-left-radius', '0');
} else if (firTd && a != 'none') {
$(firTd).css('border-top-left-radius', '0');
}
if (laTd && a != 'none') {
$(laTd).css('border-bottom-left-radius', '0');
}
});
}); });
$('#iptables').prev().css('margin-top', '10px'); })(window, jQuery);
})(jQuery);