Skip to content

Commit 72fc5c6

Browse files
committed
Improvements and fixes
1 parent 750643e commit 72fc5c6

File tree

8 files changed

+185
-91
lines changed

8 files changed

+185
-91
lines changed

README.RU.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
Далее зайдите в Safari, на мобильном устройстве и введите там "http://IP:735/webapp", где IP это зарезервированный постоянный IP вашего компьютера. Далее нужно нажать "Поделиться" -> "На экран Домой". На рабочем столе появится ярлык для EasyNotes.
2525

26+
27+
Для обновления нужно синхронизироваться, далее зайти в настройки "Safari" и удалить историю и данные, после чего можно заново добавлять приложение.
2628
### Android
2729
Установите "EasyNotes.apk" и введите зарезервированный постоянный IP вашего компьютера.
2830

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ For iOS 12 and above, go to Settings -> Safari -> Advanced -> Experimental Featu
2323

2424
Next, go to Safari on your mobile device and enter there "http://IP:735/webapp", where IP is the reserved permanent IP of your computer. Next you need to click "Share" -> "On the Home Screen". A shortcut to EasyNotes appears on the desktop.
2525

26+
27+
To update, you need to synchronize, then go to the "Safari" settings and delete history and data, after which you can add the application again.
2628
### Android
2729
Install "EasyNotes.apk" and enter the reserved permanent IP of your computer.
2830

Source/Android/config.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<widget xmlns = "http://www.w3.org/ns/widgets"
33
xmlns:gap = "http://phonegap.com/ns/1.0"
44
id = "com.r57zone.easynotes"
5-
versionCode = "13"
6-
version = "0.8.6" >
5+
versionCode = "14"
6+
version = "0.8.7" >
77

88
<!-- versionCode is optional and Android only -->
99
<name>EasyNotes</name>
@@ -18,8 +18,8 @@
1818
<access origin="*" />
1919

2020
<preference name="android-minSdkVersion" value="21" />
21-
<preference name="android-targetSdkVersion" value="26" />
21+
<preference name="android-targetSdkVersion" value="26" />
2222

23-
<plugin name="cordova-plugin-whitelist" source="npm" spec="1.1.0" />
23+
<plugin name="cordova-plugin-whitelist" source="npm" spec="*" />
2424

2525
</widget>

Source/Android/index.html

Lines changed: 48 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html manifest="app.manifest">
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55
<title>EasyNotes</title>
6+
<meta name="apple-mobile-web-app-title" content="EasyNotes">
7+
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, viewport-fit=cover" />
8+
<meta name="apple-mobile-web-app-capable" content="yes">
9+
<!--<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />-->
610
<!--<link rel="stylesheet" href="all.css">-->
711
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
12+
<link rel="apple-touch-icon" href="icons/Icon-76.png">
13+
<link rel="apple-touch-icon" sizes="57x57" href="icons/Icon-57.png">
14+
<link rel="apple-touch-icon" sizes="60x60" href="icons/Icon-60.png">
15+
<link rel="apple-touch-icon" sizes="72x72" href="icons/Icon-60.png">
16+
<link rel="apple-touch-icon" sizes="76x76" href="icons/Icon-76.png">
17+
<link rel="apple-touch-icon" sizes="114x114" href="icons/Icon-114.png">
18+
<link rel="apple-touch-icon" sizes="120x120" href="icons/Icon-120.png">
19+
<link rel="apple-touch-icon" sizes="144x144" href="icons/Icon-144.png">
20+
<link rel="apple-touch-icon" sizes="152x152" href="icons/Icon-152.png">
21+
<link rel="apple-touch-icon" sizes="180x180" href="icons/Icon-180x180.png">
22+
<link rel="apple-touch-startup-image" href="images/launch.png">
823
<style type="text/css">
9-
html,body{padding:0;margin:0; }
24+
html,body{padding:0;margin:0;}
1025
body{font-family: Arial, sans-serif; font-size:16px; color:#333; background-color:#f8f8f8; -webkit-user-select:none; -webkit-tap-highlight-color:transparent;}
1126
a{text-decoration:none; font-weight:bold; color:gray;}
1227
#wrapper{position:absolute; width:100%; height:100%;}
@@ -33,14 +48,15 @@
3348
#meta #DaysAgo{margin-left:12px;}
3449
#meta #DateNote{margin-right:12px;}
3550

36-
#editor #memo{display:block; width:calc(100% - 24px); height:calc(100% - 45px); padding:4px 12px 4px 12px; background-color:transparent; border:none;}
51+
#editor #memo{display:block; width:calc(100% - 24px); height:calc(100% - 45px); padding:4px 0; margin:0 auto; background-color:transparent; border:none;}
3752
textarea{font-weight:normal; font-size:17px; font-family: Arial, sans-serif; color:#333; overflow-y:auto; -webkit-overflow-scrolling:touch; border-radius:0; -webkit-tap-highlight-color:rgba(0,0,0,0);}
3853
textarea:focus{outline:none;}
3954
#sub-panel{display:flex; flex-direction:row; justify-content:space-between; align-items:center; height:45px; overflow:hidden; background-color:#e7e7e7; text-align:center; cursor:default;}
4055

4156
/* Settings */
4257
#settings{display:none; width:100%; height:100%;}
4358
#settings #page{height:calc(100% - 45px); overflow-y:auto; -webkit-overflow-scrolling:touch;}
59+
#settings #page #items:first-child{margin-top:3px;}
4460
#settings #items{padding:10px 0; margin:0 auto; width:92%; overflow:hidden; font-size:14px;}
4561
#settings #items #item{display:flex; flex-direction:row; justify-content:space-between; align-items:center; text-overflow:ellipsis; overflow:hidden; white-space:nowrap; border:1px solid #dbdbdb; padding:14px 8px; background-color:#fff; border-top:none; color:black;}
4662
#settings #items #item:first-child{border-top-left-radius:15px; border-top-right-radius:15px; border:1px solid #dbdbdb;}
@@ -59,8 +75,6 @@
5975
#notification{position:absolute; bottom:0; width:100%; padding: 15px 0; visibility:hidden; font-size:14px; background-color:#e7e7e7; text-align:center; border-top:1px solid #bdbdbd;}
6076
#notification.show{visibility:visible; animation:fadein 0.5s, fadeout 0.5s 3s;}
6177
@keyframes fadein{from {opacity: 0;} to {opacity: 1;}}
62-
@keyframes fadein{from {opacity: 0;} to {opacity: 1;}}
63-
@keyframes fadeout{from {opacity: 1;} to {opacity: 0;}}
6478
@keyframes fadeout{from {opacity: 1;} to {opacity: 0;}}
6579

6680
#sync-progress{display:none; position:absolute; bottom:0; width:100%; height:4px; background-color:blue; background:linear-gradient(to left, transparent, transparent, #23A6D5, transparent, transparent); background-size:200% 200%; animation:move-background 2s linear infinite;}
@@ -74,7 +88,7 @@
7488
100%{display:block; opacity:1;}
7589
}
7690

77-
/* Tablet mode */
91+
/* Android tablet mode */
7892
@media all and (min-width:550px) {
7993
#list{display:block; float:left; width:37%;}
8094
#list #items{border-right:1px solid #d5d5d5;}
@@ -90,7 +104,7 @@
90104
var ActionsDB;
91105
var SettingsDB;
92106

93-
var CurNoteID = -1; //По умолчанию, для возврата настроек
107+
var CurNoteID = -1; //По умолчанию новая заметка
94108
var LatestNote;
95109
var CurNoteDateTime;
96110

@@ -118,6 +132,7 @@
118132
var IDS_ABOUT_SYNC = 'IP address and port to sync notes with your PC.';
119133
var IDS_AUTO_SYNC = 'Sync at startup';
120134
var IDS_ABOUT_AUTO_SYNC = 'Automatically sync on app launch.';
135+
121136
//Для всех
122137
var IDS_DARK_THEME = 'Dark theme';
123138
var IDS_THEME_TIME_DEPENDENT = 'Theme is time dependent';
@@ -133,9 +148,7 @@
133148
var IDS_CONNECTION_FAILED = 'Connection failed';
134149

135150
//Русский
136-
//console.log(navigator.language.toLowerCase());
137-
//в iOS языки прописными буквами
138-
if (navigator.language.toLowerCase() == 'ru-ru') {
151+
if (navigator.language.toLowerCase() == 'ru-ru') { //В iOS языки прописными буквами
139152
IDS_MONTHS = ['янв.', 'фев.', 'мар.', 'апр.', 'май', 'июн.', 'июл.', 'авг.', 'сен.', 'окт.', 'ноя.', 'дек.'];
140153
IDS_DAYOFWEEK = ['Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота', 'Воскресенье'];
141154
IDS_TODAY = 'Сегодня';
@@ -314,8 +327,6 @@
314327

315328
function ShowNotes()
316329
{
317-
//document.getElementById('list').className = 'page transition center';
318-
//document.getElementById('editor').className = 'page transition right';
319330
if (TabletMode == false)
320331
document.getElementById('editor').style.display = 'none';
321332
document.getElementById('list').style.display = 'block';
@@ -513,49 +524,57 @@
513524
{
514525
var CurTimeStamp = GetTimeStamp();
515526
var UTCTimeStamp = GetUTCTimeStamp();
527+
var MemoText = document.getElementById('memo').value;
528+
var LatestCurNoteID = CurNoteID; //Для мновенного переключения на новую заметку, без ожидания выполнения SQL
516529

530+
//Новая заметка
517531
if (CurNoteID == '-1') {
518-
519-
if (document.getElementById('memo').value.trim() != '') {
532+
//Не создаем заметку без текста
533+
if (MemoText.trim() != '') {
520534
NotesDB.transaction(function (tx) {
521-
tx.executeSql('INSERT INTO Notes (ID, Note, DateTime) VALUES (' + CurTimeStamp + ', "' + StrToCharCodes(document.getElementById('memo').value) + '", ' + UTCTimeStamp + ')');
535+
tx.executeSql('INSERT INTO Notes (ID, Note, DateTime) VALUES (' + CurTimeStamp + ', "' + StrToCharCodes(MemoText) + '", ' + UTCTimeStamp + ')');
522536
});
523537

524538
ActionsDB.transaction(function (tx) {
525-
tx.executeSql('INSERT INTO Actions (Action, ID, Note, DateTime) VALUES ("insert", ' + CurTimeStamp + ', "' + StrToCharCodes(document.getElementById('memo').value) + '",' + UTCTimeStamp + ')');
539+
tx.executeSql('INSERT INTO Actions (Action, ID, Note, DateTime) VALUES ("insert", ' + CurTimeStamp + ', "' + StrToCharCodes(MemoText) + '",' + UTCTimeStamp + ')');
526540
});
541+
527542
}
528543
//console.log('Inserted done');
529-
} else if (LatestNote.trim() != document.getElementById('memo').value.trim()) { //Добавлять только при наличии изменений
544+
} else if (LatestNote.trim() != MemoText.trim()) { //Добавлять только при наличии изменений
530545

531-
if (UpdateDateTime) {
546+
if (UpdateDateTime) { //Обновление времени
532547
NotesDB.transaction(function (tx) {
533-
tx.executeSql('UPDATE Notes SET Note="' + StrToCharCodes(document.getElementById('memo').value) + '", DateTime=' + UTCTimeStamp + ' WHERE ID=' + CurNoteID);
548+
tx.executeSql('UPDATE Notes SET Note="' + StrToCharCodes(MemoText) + '", DateTime=' + UTCTimeStamp + ' WHERE ID=' + LatestCurNoteID);
534549
});
535550

536551
ActionsDB.transaction(function (tx) {
537-
tx.executeSql('INSERT INTO Actions (Action, ID, Note, DateTime) VALUES ("update", ' + CurNoteID + ', "' + StrToCharCodes(document.getElementById('memo').value) + '",' + UTCTimeStamp + ')');
552+
tx.executeSql('INSERT INTO Actions (Action, ID, Note, DateTime) VALUES ("update", ' + LatestCurNoteID + ', "' + StrToCharCodes(MemoText) + '",' + UTCTimeStamp + ')');
538553
});
539-
} else {
554+
} else { //Сохранение старого времени
540555
NotesDB.transaction(function (tx) {
541-
tx.executeSql('UPDATE Notes SET Note="' + StrToCharCodes(document.getElementById('memo').value) + '" WHERE ID=' + CurNoteID);
556+
tx.executeSql('UPDATE Notes SET Note="' + StrToCharCodes(MemoText) + '" WHERE ID=' + LatestCurNoteID);
542557
});
543558

544559
ActionsDB.transaction(function (tx) {
545-
tx.executeSql('INSERT INTO Actions (Action, ID, Note, DateTime) VALUES ("update", ' + CurNoteID + ', "' + StrToCharCodes(document.getElementById('memo').value) + '",' + CurNoteDateTime + ')');
560+
tx.executeSql('INSERT INTO Actions (Action, ID, Note, DateTime) VALUES ("update", ' + LatestCurNoteID + ', "' + StrToCharCodes(MemoText) + '",' + CurNoteDateTime + ')');
546561
});
547562
}
548563
//console.log('Updated done');
549564
}
565+
if (TabletMode) //Новая заметка открывается только в режиме планшета
566+
NewNote();
550567
ShowNotes();
551568
}
552569

553570
function RemNote()
554571
{
555-
if (CurNoteID == '-1') return;
572+
if (CurNoteID == '-1') {ShowNotes(); return;}
556573
NotesDB.transaction(function (tx) {
557-
tx.executeSql('DELETE FROM Notes WHERE id=' + CurNoteID, [], function (tx, results) {
574+
tx.executeSql('DELETE FROM Notes WHERE ID=' + CurNoteID, [], function (tx, results) {
558575
ShowNotes();
576+
if (TabletMode) //Новая заметка открывается только в режиме планшета
577+
NewNote();
559578
}, null);
560579
});
561580
ActionsDB.transaction(function (tx) {
@@ -579,7 +598,7 @@
579598
return new Promise(function(resolve, reject) {
580599
var request = new XMLHttpRequest();
581600

582-
request.open('GET', URL, false);
601+
request.open('GET', URL, true);
583602

584603
request.onload = function() {
585604
if (request.status == 200)
@@ -703,11 +722,11 @@
703722
}
704723

705724
function CheckTabletMode(){
706-
if (window.innerWidth >= 550) { //|| window.innerWidth > window.innerHeight
725+
if (window.innerWidth >= 550) {
707726
TabletMode = true;
708727
document.getElementById('list').style.display = 'block';
709728

710-
if (document.getElementById('editor').style.display == 'none' && document.getElementById('settings').style.display == 'none')
729+
if (document.getElementById('editor').style.display == 'none' && (document.getElementById('settings').style.display == 'none' || document.getElementById('settings').style.display == '')) //Когда блока нет, вместо "none" бывает ""
711730
document.getElementById('editor').style.display = 'block';
712731
} else {
713732
TabletMode = false;
@@ -820,7 +839,6 @@
820839
}, null);
821840
});
822841

823-
//UpdateSizes(); //Для устройств не поддерживающих css calc
824842
});
825843
</script>
826844
</head>
@@ -914,7 +932,7 @@
914932

915933
<div id="AboutThemeTime" class="titlebox"></div>
916934

917-
<div class="titlebox" style="text-align:center;"><br>EasyNotes<br><span id="LastUpdate"></span> 28.09.20<br>https://r57zone.github.io</div>
935+
<div class="titlebox" style="text-align:center;"><br>EasyNotes<br><span id="LastUpdate"></span> 17.11.20<br>https://r57zone.github.io</div>
918936
<br><br>
919937
</div>
920938
</div>

Source/Windows/AllowIPs.txt renamed to Source/Windows/AllowedIPs.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@
2020
192.168.0.108
2121
192.168.0.109
2222
192.168.0.110
23+
192.168.1.0
24+
192.168.1.1
25+
192.168.1.2
26+
192.168.1.3
27+
192.168.1.4
28+
192.168.1.5
29+
192.168.1.6
30+
192.168.1.7
31+
192.168.1.8
32+
192.168.1.9
33+
192.168.1.10
2334
192.168.1.100
2435
192.168.1.101
2536
192.168.1.102
@@ -31,3 +42,25 @@
3142
192.168.1.108
3243
192.168.1.109
3344
192.168.1.110
45+
192.168.2.0
46+
192.168.2.1
47+
192.168.2.2
48+
192.168.2.3
49+
192.168.2.4
50+
192.168.2.5
51+
192.168.2.6
52+
192.168.2.7
53+
192.168.2.8
54+
192.168.2.9
55+
192.168.2.10
56+
192.168.3.0
57+
192.168.3.1
58+
192.168.3.2
59+
192.168.3.3
60+
192.168.3.4
61+
192.168.3.5
62+
192.168.3.6
63+
192.168.3.7
64+
192.168.3.8
65+
192.168.3.9
66+
192.168.3.10

0 commit comments

Comments
 (0)