final release version 1.0

This commit is contained in:
Mariam M. 2015-02-27 12:46:57 +02:00
parent 8622fc0857
commit aaea2067bf
13 changed files with 10 additions and 191 deletions

17
.gitattributes vendored
View File

@ -1,17 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

View File

@ -7,7 +7,8 @@ function loadReplace()
chrome.storage.local.get("person", function(value)
{
person = value.person;
walk(document.body);
if(person != null){walk(document.body);}
}
)
}

View File

@ -1,79 +0,0 @@
var person;
loadReplace();
function loadReplace()
{
chrome.storage.local.get("person", function(value)
{
person = value.person;
walk(document.body);
}
)
}
function walk(node)
{
// I stole this function from here:
// http://is.gd/mwZp7E
var child, next;
switch ( node.nodeType )
{
case 1: // Element
case 9: // Document
case 11: // Document fragment
child = node.firstChild;
while ( child )
{
next = child.nextSibling;
walk(child);
child = next;
}
break;
case 3: // Text node
handleText(node);
break;
}
}
function handleText(textNode)
{
var v = textNode.nodeValue;
v = v.replace("Y/N", person);
v = v.replace("y/n", person);
v = v.replace("Y/n", person);
v = v.replace("y/N", person);
v = v.replace("(Y/N)", person);
v = v.replace("(y/n)", person);
v = v.replace("(Y/n)", person);
v = v.replace("(y/N)", person);
v = v.replace("Y/N?", person + "?");
v = v.replace("y/n?", person + "?");
v = v.replace("Y/n?", person + "?");
v = v.replace("y/N?", person + "?");
v = v.replace("Y/N!", person + "!");
v = v.replace("y/n!", person + "!");
v = v.replace("Y/n!", person + "!");
v = v.replace("y/N!", person + "!");
v = v.replace("(Y/N)?", person + "?");
v = v.replace("(y/n)?", person + "?");
v = v.replace("(Y/n)?", person + "?");
v = v.replace("(y/N)?", person + "?");
v = v.replace("(Y/N)!", person + "!");
v = v.replace("(y/n)!", person + "!");
v = v.replace("(Y/n)!", person + "!");
v = v.replace("(y/N)!", person + "!");
textNode.nodeValue = v;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -1,6 +1,6 @@
{
"manifest_version": 2,
"name": "Interactive Fics",
"name": "InteractiveFics",
"version": "1.0",
"description": "Replaces Y/N in Reader Insert/second person fics with a name of your choice.",
"browser_action": {
@ -20,7 +20,10 @@
"run_at": "document_end"
}
],
"incognito": "split"
"incognito": "split",
"background": {
"page": "popup.html"
}
}

View File

@ -1,25 +0,0 @@
{
"manifest_version": 2,
"name": "Interactive Fics",
"version": "1.0",
"description": "Replaces Y/N in Reader Insert/second person fics with a name of your choice.",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html" },
"permissions": [
"storage",
"tabs"],
"icons": { "16": "icon-16.png",
"48": "icon-48.png",
"128": "icon-128.png" },
"content_scripts":
[
{
"matches": ["*://*/*"],
"js": ["content_script.js"],
"run_at": "document_end"
}
]
}

View File

@ -1,12 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<link href='http://fonts.googleapis.com/css?family=Play:400,700' rel='stylesheet' type='text/css'>
<title>Interactive Fics</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8">
<meta http-equiv="content-style-type" content="text/css">
<meta http-equiv="expires" content="0">
<link href='http://fonts.googleapis.com/css?family=Play' rel='stylesheet' type='text/css'>
<style type="text/css">
body {
background-color: white;

View File

@ -1,50 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<link href='http://fonts.googleapis.com/css?family=Play:400,700' rel='stylesheet' type='text/css'>
<title>Interactive Fics</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8">
<meta http-equiv="content-style-type" content="text/css">
<meta http-equiv="expires" content="0">
<style type="text/css">
body {
background-color: white;
color: #16a085;
width: 250px;
padding:10px;
font-family: 'Play', sans-serif;
}
h1 {
font-size: 16px;
}
a{
color: #e67e22;
}
a:hover{
color: #16a085;
}
</style>
<script src="popup.js" type="text/javascript" >
</script>
</head>
<body>
<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>
<p>
<details><summary>About</summary>
<a href="http://interactivefics.tumblr.com" target="_blank" title="Official tumblr">Interactive Fics</a> is a free Chrome extension developed by <a href="https://github.com/blaringsilence" target="_blank" title="her github">blaringsilence</a> to improve your online story reading experience. The extension is open source and all source code can be found <a href="https://github.com/blaringsilence/interactive-fics" title="github repo">here.</a>
</details>
<br>
<a href="http://interactivefics.tumblr.com/ask" target="_blank">Feedback, suggestions and requests.</a></br>
</p>
</body>
</html>

View File

@ -4,6 +4,8 @@ document.addEventListener('DOMContentLoaded', function () {
}); //instead of onclick="clickHandler()" in popup.html
function clickHandler(){
var person = document.getElementById("inputTxt").value;
chrome.storage.local.set({"person": person}, chrome.tabs.reload());

View File

@ -1,11 +0,0 @@
document.addEventListener('DOMContentLoaded', function () {
document.querySelector('button').addEventListener('click', clickHandler);
}); //instead of onclick="clickHandler()" in popup.html
function clickHandler(){
var person = document.getElementById("inputTxt").value;
chrome.storage.local.set({"person": person}, chrome.tabs.reload());
}