From b415047b1dea4dc87bcff4777b7f7b2ae65ca98a Mon Sep 17 00:00:00 2001 From: nearbyplayer Date: Sat, 19 Aug 2017 19:15:38 -0400 Subject: [PATCH] Added English HTML / JS variants --- __resource.lua | 6 +- html/scripts/app_en.js | 489 +++++++++++++++++++++++++++++++++++++++++ html/ui_en.html | 82 +++++++ 3 files changed, 575 insertions(+), 2 deletions(-) create mode 100644 html/scripts/app_en.js create mode 100644 html/ui_en.html diff --git a/__resource.lua b/__resource.lua index 4f737ba0..226a9dc4 100644 --- a/__resource.lua +++ b/__resource.lua @@ -22,12 +22,14 @@ client_scripts { ui_page 'html/ui.html' files { - 'html/ui.html', + 'html/ui.html', -- FR + --'html/ui_en.html', -- EN 'html/bankgothic.ttf', 'html/pdown.ttf', 'html/css/app.css', 'html/scripts/mustache.min.js', - 'html/scripts/app.js', + 'html/scripts/app.js', -- FR + --'html/scripts/app_en.js', -- EN 'html/img/cursor.png', 'html/img/keys/enter.png', 'html/img/keys/return.png', diff --git a/html/scripts/app_en.js b/html/scripts/app_en.js new file mode 100644 index 00000000..cd4ef5c2 --- /dev/null +++ b/html/scripts/app_en.js @@ -0,0 +1,489 @@ +(function(){ + + let ContactTpl = + '
' + + '
' + + '
' + + '{{sender}}
#{{phoneNumber}}' + + '
' + + '
' + + '
' + + '
' + ; + + 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'); + } + + 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'); + } + + 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); + } + + 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; iHome' + + '
  • Messages
  • ' + ); + + for(let i=0; i + + + + + + + +
    + +
    + +
    + + #123456 +
    + + + +
    + +
    Home
    +
    +
    +
    +

    No contacts

    +
    +
    +
    +
    + +
    +
    Messages
    +
    +
    +
    +

    No messages

    +
    +
    +
    +
    + +
    +
    +
    +
    + + + + + +
    +
    +
    + +
    +
    Add a contact
    +
    +
    + + + + +
    +
    +
    + +
    +
    + + + + + + + +