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 = + '
' + + '
' + + '
' + + '{{sender}}
#{{phoneNumber}}' + + '
' + + '
' + + '
' + + 'X' + + '' + + '
' + + '
' + ; + + 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 +
    + + + +
    + +
    Kontakty
    +
    +
    +
    +

    Brak kontaktów

    +
    +
    +
    +
    + +
    +
    Wiadomości
    +
    +
    +
    +

    Brak wiadomości

    +
    +
    +
    +
    + +
    +
    +
    +
    + + + + + +
    +
    +
    + +
    +
    Dodaj kontakt
    +
    +
    + + + + +
    +
    +
    + +
    +
    + + + + + + + + diff --git a/locales/pl.lua b/locales/pl.lua new file mode 100644 index 00000000..c658c8be --- /dev/null +++ b/locales/pl.lua @@ -0,0 +1,13 @@ +Locales['en'] = { + ['new_message'] = '~b~Masz nową wiadomość:~s~ %s', + ['press_take_call'] = '%s - Wciśnij ~INPUT_CONTEXT~ aby odebrać telefon', + ['taken_call'] = '~y~%s~s~ odebrał telefon', + ['gps_position'] = 'Cel podróży został dodany do GPS\'a', + ['message_sent'] = 'Wiadomość wysłana', + ['cannot_add_self'] = 'Nie możesz dodać samego siebie!', + ['number_in_contacts'] = 'Ten numer jest już na twojej liście kontaktów', + ['contact_added'] = 'Kontakt dodany!', + ['contact_removed'] = 'Kontakt usunięty!', + ['number_not_assigned'] = 'Numer nie jest przypisany!', + ['invalid_number'] = 'To nie jest prawidłowy numer telefonu!', +} \ No newline at end of file