Browse Source

add timeout for search button on startpage, remove unused licenses in about

update readme
master
R4SAS 6 years ago
parent
commit
4a34808d27
  1. 13
      README.md
  2. 7
      app/src/main/java/org/purplei2p/lightning/constant/StartPage.java
  3. 1
      app/src/main/res/values-ru/strings.xml
  4. 1
      app/src/main/res/values/strings.xml
  5. 22
      app/src/main/res/xml/preference_about.xml

13
README.md

@ -1,12 +1,18 @@
# Lightning Browser I2P # Lightning Browser I2P
#### Speed, Simplicity, Security #### Speed, Simplicity, Security
![](ic_launcher_small.png) ![](ic_launcher_small.png)
#### About fork #### About fork
That fork of Lightning Browser aims on native support of I2P without ability go clearnet sites (if not used outproxy). That fork of Lightning Browser aims on native support of I2P without ability go clearnet sites (if not used outproxy).
#### Features #### Features
* Bookmarks * Bookmarks
* History * History
@ -17,10 +23,9 @@ That fork of Lightning Browser aims on native support of I2P without ability go
* Support of Legwork I2P search engine * Support of Legwork I2P search engine
* Legwork search suggestions
* TODO: I2P-only support * TODO: I2P-only support
#### Permissions #### Permissions
* ````INTERNET````: For accessing the web * ````INTERNET````: For accessing the web
@ -31,11 +36,15 @@ That fork of Lightning Browser aims on native support of I2P without ability go
* ````ACCESS_NETWORK_STATE````: Required for the WebView to function by some OEM versions of WebKit * ````ACCESS_NETWORK_STATE````: Required for the WebView to function by some OEM versions of WebKit
#### The Code #### The Code
* Please contribute code back if you can. The code isn't perfect. * Please contribute code back if you can. The code isn't perfect.
* Please add translations/translation fixes as you see need * Please add translations/translation fixes as you see need
#### License #### License
``` ```
Copyright 2014 Anthony Restaino Copyright 2014 Anthony Restaino

7
app/src/main/java/org/purplei2p/lightning/constant/StartPage.java

@ -34,7 +34,6 @@ public class StartPage {
+ "<title>"; + "<title>";
private static final String HEAD_2 = "</title>" private static final String HEAD_2 = "</title>"
+ "</head>"
+ "<style>body{background:#f5f5f5;text-align:center;margin:0px;}#search_input{height:35px; " + "<style>body{background:#f5f5f5;text-align:center;margin:0px;}#search_input{height:35px; "
+ "width:100%;outline:none;border:none;font-size: 16px;background-color:transparent;}" + "width:100%;outline:none;border:none;font-size: 16px;background-color:transparent;}"
+ "span { display: block; overflow: hidden; padding-left:5px;vertical-align:middle;}" + "span { display: block; overflow: hidden; padding-left:5px;vertical-align:middle;}"
@ -47,13 +46,15 @@ public class StartPage {
+ ".box { vertical-align:middle;position:relative; display: block; margin: 10px;padding-left:10px;padding-right:10px;padding-top:5px;padding-bottom:5px;" + ".box { vertical-align:middle;position:relative; display: block; margin: 10px;padding-left:10px;padding-right:10px;padding-top:5px;padding-bottom:5px;"
+ " background-color:#fff;box-shadow: 0px 3px rgba( 0, 0, 0, 0.1 );font-family: Arial;color: #444;" + " background-color:#fff;box-shadow: 0px 3px rgba( 0, 0, 0, 0.1 );font-family: Arial;color: #444;"
+ "font-size: 12px;-moz-border-radius: 2px;-webkit-border-radius: 2px;" + "font-size: 12px;-moz-border-radius: 2px;-webkit-border-radius: 2px;"
+ "border-radius: 2px;}</style><body> <div class=\"outer\"><div class=\"middle\"><div class=\"inner\"><img class=\"smaller\" src=\""; + "border-radius: 2px;}</style>"
+ "</head><body> <div class=\"outer\"><div class=\"middle\"><div class=\"inner\"><img class=\"smaller\" src=\"";
private static final String MIDDLE = "\" ></br></br><form onsubmit=\"return search()\" class=\"search_bar\" autocomplete=\"off\">" private static final String MIDDLE = "\" ></br></br><form onsubmit=\"return search()\" class=\"search_bar\" autocomplete=\"off\">"
+ "<input type=\"submit\" id=\"search_submit\" value=\"Search\" ><span><input class=\"search\" type=\"text\" value=\"\" id=\"search_input\" >" + "<input type=\"submit\" id=\"search_submit\" value=\"Search\" ><span><input class=\"search\" type=\"text\" value=\"\" id=\"search_input\" >"
+ "</span></form></br></br></div></div></div><script type=\"text/javascript\">function search(){if(document.getElementById(\"search_input\").value != \"\"){window.location.href = \""; + "</span></form></br></br></div></div></div><script type=\"text/javascript\">function search(){if(document.getElementById(\"search_input\").value != \"\"){window.location.href = \"";
private static final String END = "\" + document.getElementById(\"search_input\").value;document.getElementById(\"search_input\").value = \"\";}return false;}</script></body></html>"; private static final String END = "\" + document.getElementById(\"search_input\").value;setTimeout(\"unlock()\", 5000);}return false;}"
+ "function unlock(){document.getElementById(\"search_submit\").disabled = false;}</script></body></html>";
@NonNull @NonNull
public static File getStartPageFile(@NonNull Application application) { public static File getStartPageFile(@NonNull Application application) {

1
app/src/main/res/values-ru/strings.xml

@ -169,7 +169,6 @@
<string name="loading">Загрузка&#8230;</string> <string name="loading">Загрузка&#8230;</string>
<string name="loading_failed">Не удалось загрузить страницу.</string> <string name="loading_failed">Не удалось загрузить страницу.</string>
<string name="snacktory">Snacktory</string> <string name="snacktory">Snacktory</string>
<string name="jsoup">jsoup: Java HTML Parser</string>
<string name="mit_license">MIT License</string> <string name="mit_license">MIT License</string>
<string name="url_contents">Содержимое поля URL</string> <string name="url_contents">Содержимое поля URL</string>
<string name="text_encoding">Кодировка текста</string> <string name="text_encoding">Кодировка текста</string>

1
app/src/main/res/values/strings.xml

@ -169,7 +169,6 @@
<string name="loading">Loading&#8230;</string> <string name="loading">Loading&#8230;</string>
<string name="loading_failed">Couldn\'t load anything from the page.</string> <string name="loading_failed">Couldn\'t load anything from the page.</string>
<string name="snacktory">Snacktory</string> <string name="snacktory">Snacktory</string>
<string name="jsoup">jsoup: Java HTML Parser</string>
<string name="mit_license">MIT License</string> <string name="mit_license">MIT License</string>
<string name="url_contents">URL box contents</string> <string name="url_contents">URL box contents</string>
<string name="text_encoding">Text encoding</string> <string name="text_encoding">Text encoding</string>

22
app/src/main/res/xml/preference_about.xml

@ -30,6 +30,17 @@
android:value="SELF" /> android:value="SELF" />
</intent> </intent>
</Preference> </Preference>
<Preference
android:summary="@string/mpl_license"
android:title="Lightning Browser">
<intent
android:action="android.intent.action.VIEW"
android:data="http://www.mozilla.org/MPL/2.0/">
<extra
android:name="SOURCE"
android:value="SELF" />
</intent>
</Preference>
<Preference <Preference
android:summary="@string/apache" android:summary="@string/apache"
android:title="@string/android_open_source_project"> android:title="@string/android_open_source_project">
@ -63,16 +74,5 @@
android:value="SELF" /> android:value="SELF" />
</intent> </intent>
</Preference> </Preference>
<Preference
android:summary="@string/mit_license"
android:title="@string/jsoup">
<intent
android:action="android.intent.action.VIEW"
android:data="http://jsoup.org/license">
<extra
android:name="SOURCE"
android:value="SELF" />
</intent>
</Preference>
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>
Loading…
Cancel
Save