From ff62e87e0ee246929cea6bef7302e06537769a36 Mon Sep 17 00:00:00 2001
From: deviljin112 <39461646+deviljin112@users.noreply.github.com>
Date: Mon, 23 Jul 2018 17:17:25 +0100
Subject: [PATCH] Little Fix up + Translation PL
Fixed up other app.js missing delete Contact, moved the phone slightly more to the right of the screen, Added Polish Translation.
---
__resource.lua | 2 +
html/css/app.css | 2 +-
html/scripts/app_de.js | 19 +-
html/scripts/app_en.js | 21 +-
html/scripts/app_pl.js | 512 +++++++++++++++++++++++++++++++++++++++++
html/ui_pl.html | 82 +++++++
locales/pl.lua | 13 ++
7 files changed, 647 insertions(+), 4 deletions(-)
create mode 100644 html/scripts/app_pl.js
create mode 100644 html/ui_pl.html
create mode 100644 locales/pl.lua
diff --git a/__resource.lua b/__resource.lua
index b2a39070..f7a49666 100644
--- a/__resource.lua
+++ b/__resource.lua
@@ -14,6 +14,7 @@ server_scripts {
'locales/fr.lua',
'locales/es.lua',
'locales/sv.lua',
+ 'locales/pl.lua',
'server/main.lua'
}
@@ -26,6 +27,7 @@ client_scripts {
'locales/fr.lua',
'locales/es.lua',
'locales/sv.lua',
+ 'locales/pl.lua',
'client/main.lua'
}
diff --git a/html/css/app.css b/html/css/app.css
index 061b08e5..d02ccc9c 100644
--- a/html/css/app.css
+++ b/html/css/app.css
@@ -33,7 +33,7 @@ html, body {
height: 480px;
color: #212121;
position: absolute;
- right: 300px;
+ right: 50px;
bottom: 0;
overflow: hidden;
cursor: default;
diff --git a/html/scripts/app_de.js b/html/scripts/app_de.js
index fa6bb6a7..5643ea02 100644
--- a/html/scripts/app_de.js
+++ b/html/scripts/app_de.js
@@ -7,7 +7,10 @@
'{{sender}}
#{{phoneNumber}}' +
'' +
'' +
- '
' +
+ '' +
+ 'X' +
+ '' +
+ '
' +
''
;
@@ -120,6 +123,16 @@
$('#phone #repertoire .repertoire-list').html(contactHTML);
+ $('.contact .del-contact').click(function() {
+ let name = $(this).attr('data-contact-name');
+ let phoneNumber = $(this).attr('data-contact-number');
+
+ $.post('http://esx_phone/remove_contact', JSON.stringify({
+ contactName: name,
+ phoneNumber: phoneNumber
+ }))
+ });
+
$('.contact.online .new-msg').click(function() {
showNewMessage($(this).attr('data-contact-number'), $(this).attr('data-contact-name'));
});
@@ -451,6 +464,10 @@
hideAddContact();
}
+ if(data.contactRemoved === true){
+ reloadPhone(data.phoneData);
+ }
+
if(data.addSpecialContact === true){
addSpecialContact(data.name, data.number, data.base64Icon);
}
diff --git a/html/scripts/app_en.js b/html/scripts/app_en.js
index 36515331..21a3caf0 100644
--- a/html/scripts/app_en.js
+++ b/html/scripts/app_en.js
@@ -7,7 +7,10 @@
'{{sender}}
#{{phoneNumber}}' +
'' +
'' +
- '
' +
+ '' +
+ 'X' +
+ '' +
+ '
' +
''
;
@@ -119,6 +122,16 @@
}
$('#phone #repertoire .repertoire-list').html(contactHTML);
+
+ $('.contact .del-contact').click(function() {
+ let name = $(this).attr('data-contact-name');
+ let phoneNumber = $(this).attr('data-contact-number');
+
+ $.post('http://esx_phone/remove_contact', JSON.stringify({
+ contactName: name,
+ phoneNumber: phoneNumber
+ }))
+ });
$('.contact.online .new-msg').click(function() {
showNewMessage($(this).attr('data-contact-number'), $(this).attr('data-contact-name'));
@@ -383,7 +396,7 @@
});
$('#btn-head-new-message').click(function() {
- showNewMessage('', 'Nouveau message');
+ showNewMessage('', 'New message');
});
$('#btn-head-new-contact').click(function() {
@@ -451,6 +464,10 @@
hideAddContact();
}
+ if(data.contactRemoved === true){
+ reloadPhone(data.phoneData);
+ }
+
if(data.addSpecialContact === true){
addSpecialContact(data.name, data.number, data.base64Icon);
}
diff --git a/html/scripts/app_pl.js b/html/scripts/app_pl.js
new file mode 100644
index 00000000..a29efe00
--- /dev/null
+++ b/html/scripts/app_pl.js
@@ -0,0 +1,512 @@
+(function(){
+
+ let ContactTpl =
+ ''
+ ;
+
+ let MessageTpl =
+ '' +
+ '
' +
+ '
' +
+ '{{sender}}
#{{phoneNumber}}' +
+ '
' +
+ '
' +
+ '
{{message}}
' +
+ '
' +
+ '
'
+ ;
+
+ let SpecialContactTpl = '{{name}}';
+
+ let contacts = [];
+ let specialContacts = [];
+ let menu = [];
+ let currentItem = 0;
+ let currentVal = null;
+ let isMessageEditorOpen = false;
+ let isMessagesOpen = false;
+ let isPhoneShowed = false;
+
+ let showMain = function() {
+ $('.screen').removeClass('active');
+ $('.screen *').attr('disabled', 'disabled');
+ }
+
+ let showRepertoire = function() {
+ $('#repertoire').addClass('active');
+ }
+
+ let hideRepertoire = function() {
+ $('#repertoire').removeClass('active');
+ }
+
+ let showMessages = function(){
+ $('#messages').addClass('active');
+ isMessagesOpen = true;
+ }
+
+ let hideMessages = function(){
+ $('#messages').removeClass('active');
+ isMessagesOpen = false;
+ }
+
+ let showAddContact = function() {
+ $('#contact').addClass('active');
+ $('.screen *').attr('disabled', 'disabled');
+ $('.screen.active *').removeAttr('disabled');
+ }
+
+ let hideAddContact = function() {
+ $('#contact').removeClass('active');
+ $('#contact_name').val('');
+ $('#contact_number').val('');
+ }
+
+ let showNewMessage = function(cnum, cname) {
+ $('#writer').addClass('active');
+ $('#writer_number').val(cnum);
+ $('#writer .header-title').html(cname);
+ $('.screen *').attr('disabled', 'disabled');
+ $('.screen.active *').removeAttr('disabled');
+ }
+
+ let hideNewMessage = function() {
+ $('#writer').removeClass('active');
+ $('#writer_number').val('');
+ $('#writer_message').val('');
+ $('#writer .header-title').html('');
+ }
+
+ let showGPS = function(xPos, yPos) {
+ $.post('http://esx_phone/setGPS', JSON.stringify({
+ x: parseFloat(xPos),
+ y: parseFloat(yPos)
+ }
+ ));
+ }
+
+ let renderContacts = function(){
+
+ let contactHTML = '';
+
+ if(contacts.length > 0) {
+
+ for(let i=0; i 0) {
+
+ for(let i=0; i {
+ return a.name.localeCompare(b.name);
+ });
+
+ renderSpecialContacts();
+
+ }
+
+ }
+
+ let removeSpecialContact = function(number){
+
+ for(let i=0; iKontakty' +
+ 'Wiadomości'
+ );
+
+ for(let i=0; i
+
+
+
+
+
+
+
+
+
+
+
+
+

+
#123456
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+