added sidebar-setting persistence, reduced JS dependence