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
@ -34,6 +34,7 @@
var nodeUrl = ""; var nodeUrl = "";
(function (node) { (function (node) {
var luciLocation;
if (node[0] == "admin") { if (node[0] == "admin") {
luciLocation = [node[1], node[2]]; luciLocation = [node[1], node[2]];
} else { } else {
@ -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")) {
@ -116,25 +116,24 @@
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;
if ($(win).height() == 992) {
$(".showSide").click(function () { $(".showSide").click(function () {
if (showSide) { if (showSide) {
$(".main-left").stop(true).animate({ $(".darkMask").stop(true).fadeOut("fast");
right: '100%' $(".main-left").stop(true).fadeOut("fast");
}, "fast"); $(".main-right").css("overflow-y", "visible");
$(".main-right").css("overflow-y", "auto");
showSide = false; showSide = false;
} else { } else {
$(".darkMask").stop(true).fadeIn("fast");
$(".main-left").stop(true).animate({ $(".main-left").stop(true).animate({
right: '0' width: "100%"
}, "fast"); }, "fast").fadeIn("fast");
$(".main-right").css("overflow-y", "hidden"); $(".main-right").css("overflow-y", "hidden");
showSide = true; showSide = true;
} }
}); });
$(".main-left").click(function(e) {
e.preventDefault();
$(".main-left").stop(true).fadeOut("fast");
showSide = false;
});
}
$(".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());
}
}); });
/** /**
@ -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="eye"></div>').appendTo('.login > .main .cbi-value-last > .cbi-value-field');
$('.login > .main .cbi-value-last > .cbi-value-field .eye').click(function () {
$('<div class="iconeye"></div>').appendTo($('.node-main-login form .cbi-value input[type="password"]').parent()[0]); var className = $(this).attr('class');
if (className.indexOf('op-eye') > (-1)) {
var num = true; $('.login > .main .cbi-value-last > .cbi-value-field').children().prop('type', 'text');
$('.cbi-value-field .iconeye').click(function(){ $(this).addClass('eye').removeClass('op-eye');
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 { } else {
$('.node-main-login form .cbi-value-last input[type="text"]').prop('type', 'password'); $('.login > .main .cbi-value-last > .cbi-value-field').children().prop('type', 'password');
$('.node-main-login form .cbi-value-field .iconeye').removeClass('cleye').addClass('opeye'); $(this).addClass('op-eye').removeClass('eye');
num = true;
}
});
$('body.logged-in').css('min-height', $(window).height());
$(function(){
if( $(window).width() > 992 ){
$('.logged-in .main-right').outerWidth( $(window).width() - $('.logged-in .main-left').width() - 50 );
}
$('.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);