reset button, v4.1
This commit is contained in:
		
							parent
							
								
									4e16628ee8
								
							
						
					
					
						commit
						99c09fc640
					
				|  | @ -3,8 +3,8 @@ | ||||||
| 
 | 
 | ||||||
| 	"manifest_version": 2, | 	"manifest_version": 2, | ||||||
| 	"name": "InteractiveFics", | 	"name": "InteractiveFics", | ||||||
| 	"version": "4.0", | 	"version": "4.1", | ||||||
| 	"description": "Replaces Y/N in Reader Insert/second person fics with a name of your choice.", | 	"description": "Replaces Y/N & other variables in Reader Insert/second person fics with words of your choice.", | ||||||
| 	"browser_action": { | 	"browser_action": { | ||||||
| 	"default_icon": "icon.png", | 	"default_icon": "icon.png", | ||||||
| 	"default_popup": "popup.html" }, | 	"default_popup": "popup.html" }, | ||||||
|  |  | ||||||
							
								
								
									
										13
									
								
								popup.html
								
								
								
								
							
							
						
						
									
										13
									
								
								popup.html
								
								
								
								
							|  | @ -34,13 +34,9 @@ label *{ | ||||||
| .otherWords .change{ | .otherWords .change{ | ||||||
| 	margin-right:0; | 	margin-right:0; | ||||||
| } | } | ||||||
| 
 | #clear-name{ | ||||||
| button{ | 	margin-top:0.5em; | ||||||
| 	border:none; | 	width:87%; | ||||||
| 	text-transform: uppercase; |  | ||||||
| 	font-size:0.8em; |  | ||||||
| 	background-color: #16a085; |  | ||||||
| 	color:white; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| </style> | </style> | ||||||
|  | @ -51,7 +47,8 @@ button{ | ||||||
| </head> | </head> | ||||||
| <body> | <body> | ||||||
| <h1>Enter the name here:</h1> | <h1>Enter the name here:</h1> | ||||||
| <form><input type="text" id="inputTxt" placeholder="To restore, enter 'Y/N'"/><input type="submit" id="submit" value="Change"/></form> | <form><input type="text" id="inputTxt"/><input type="submit" id="submit" value="Change"/></form> | ||||||
|  | <button id="clear-name">Clear Name</button>  | ||||||
| <p><details><summary>Is the author not using Y/N?</summary> | <p><details><summary>Is the author not using Y/N?</summary> | ||||||
| 	<p>Enter the expression the author's using instead:</p> | 	<p>Enter the expression the author's using instead:</p> | ||||||
| 	<p><small>(Make sure you already entered a name above. This change will go away if you refresh, so you'll have to enter it again)</small></p> | 	<p><small>(Make sure you already entered a name above. This change will go away if you refresh, so you'll have to enter it again)</small></p> | ||||||
|  |  | ||||||
							
								
								
									
										3
									
								
								popup.js
								
								
								
								
							
							
						
						
									
										3
									
								
								popup.js
								
								
								
								
							|  | @ -1,11 +1,14 @@ | ||||||
| 
 | 
 | ||||||
| document.addEventListener('DOMContentLoaded', function () { | document.addEventListener('DOMContentLoaded', function () { | ||||||
|   document.getElementById('submit').addEventListener('click', clickHandler); |   document.getElementById('submit').addEventListener('click', clickHandler); | ||||||
|  |   document.getElementById('clear-name').addEventListener('click', function(){ chrome.storage.local.remove("person", chrome.tabs.reload()) } ); | ||||||
|   var others = document.getElementsByClassName('changeForm'); |   var others = document.getElementsByClassName('changeForm'); | ||||||
|   for(var i=0; i<others.length; i++) |   for(var i=0; i<others.length; i++) | ||||||
|   	others[i].addEventListener('submit', otherHandler); |   	others[i].addEventListener('submit', otherHandler); | ||||||
| }); //instead of onclick="clickHandler()" in popup.html
 | }); //instead of onclick="clickHandler()" in popup.html
 | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| function otherHandler(){ | function otherHandler(){ | ||||||
| 	var myInput = this.replaceWord.value; | 	var myInput = this.replaceWord.value; | ||||||
| 	if(myInput){ | 	if(myInput){ | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Mariam Maarouf
						Mariam Maarouf