File tree Expand file tree Collapse file tree 3 files changed +23
-8
lines changed
Expand file tree Collapse file tree 3 files changed +23
-8
lines changed Original file line number Diff line number Diff line change 7070 < input type ="text " placeholder ="Enter site name... " id ='addBlackSiteLbl ' />
7171 < input type ="button " value ="+ " id ='addBlackSiteBtn ' />
7272 </ div >
73+ < div class ="notify warning " id ='notifyForBlackList ' hidden >
74+ The site is already in the list
75+ </ div >
7376 </ div >
7477 < div class ="margin-top-10 ">
7578 < label > Data in memory use </ label > < label id ='memoryUse '> </ label >
9396 < input type ="time " id ='addRestrictionTimeLbl ' />
9497 < input type ="button " value ="+ " id ='addRestrictionSiteBtn ' />
9598 </ div >
99+ < div class ="notify warning " id ='notifyForRestrictionList ' hidden >
100+ The site is already in the list
101+ </ div >
96102 </ div >
97103 < div id ='aboutBlock ' hidden >
98104 < div > < label id ='version '> </ label > </ div >
Original file line number Diff line number Diff line change @@ -99,12 +99,16 @@ function viewRestrictionList(items) {
9999function clearAllData ( ) {
100100 var tabs = [ ] ;
101101 chrome . extension . getBackgroundPage ( ) . tabs = tabs ;
102- storage . saveTabs ( tabs , viewNotify ) ;
102+ storage . saveTabs ( tabs , allDataDeletedSuccess ) ;
103103}
104104
105- function viewNotify ( ) {
106- document . getElementById ( 'notify' ) . hidden = false ;
107- setTimeout ( function ( ) { document . getElementById ( 'notify' ) . hidden = true ; } , 3000 ) ;
105+ function allDataDeletedSuccess ( ) {
106+ viewNotify ( 'notify' ) ;
107+ }
108+
109+ function viewNotify ( elementName ) {
110+ document . getElementById ( elementName ) . hidden = false ;
111+ setTimeout ( function ( ) { document . getElementById ( elementName ) . hidden = true ; } , 3000 ) ;
108112}
109113
110114function addNewBlackSiteClickHandler ( ) {
@@ -118,7 +122,7 @@ function addNewBlackSiteClickHandler() {
118122 document . getElementById ( 'addBlackSiteLbl' ) . value = '' ;
119123
120124 updateBlackList ( ) ;
121- }
125+ } else viewNotify ( 'notifyForBlackList' ) ;
122126 }
123127}
124128
@@ -136,6 +140,7 @@ function addNewRestrictionSiteClickHandler() {
136140
137141 updateRestrictionList ( ) ;
138142 }
143+ else viewNotify ( 'notifyForRestrictionList' ) ;
139144 }
140145}
141146
Original file line number Diff line number Diff line change @@ -242,8 +242,8 @@ input[type="button"]:hover {
242242 }
243243
244244 .notify {
245- width : 200 px ;
246- height : 30 px ;
245+ width : 250 px ;
246+ height : 22 px ;
247247 margin : auto;
248248 background-color : rgb (118 , 219 , 93 );
249249 color : rgb (0 , 0 , 0 );
@@ -254,11 +254,15 @@ input[type="button"]:hover {
254254 z-index : 1 ;
255255 top : 10px ;
256256 right : 20px ;
257- font-size : 17 px ;
257+ font-size : 15 px ;
258258 white-space : nowrap;
259259 padding : 10px ;
260260 }
261261
262+ .notify .warning {
263+ background-color : rgb (219 , 93 , 104 );
264+ }
265+
262266 .listbox {
263267 overflow-y : auto;
264268 width : 263px ;
You can’t perform that action at this time.
0 commit comments