Commit 34da48c2 authored by Tristan A Spakes's avatar Tristan A Spakes

ver. 1.2.3 Added csv for carriers, replaced the carrier switch statements, needs to package to test

parent a9f640f4
Pipeline #25683 failed with stages
in 2 seconds
......@@ -61,22 +61,6 @@
</div>
<select id="badgeMinderCarrier">
<option value="0" disabled selected>Carrier:</option>
<option value="1">AT&T</option>
<option value="2">Verizon</option>
<option value="3">U.S. Cellular</option>
<option value="4">Sprint</option>
<option value="5">Virgin Mobile</option>
<option value="6">T-Mobile</option>
<option value="7">Tracfone</option>
<option value="8">Metro PCS</option>
<option value="9">Boost Mobile</option>
<option value="10">Cricket</option>
<option value="11">Nextel</option>
<option value="12">Alltel</option>
<option value="13">Ptel</option>
<option value="14">Suncom</option>
<option value="15">Qwest</option>
<option value="16">Ting</option>
</select>
</div>
</div>
......
......@@ -77,65 +77,27 @@ function badgeConfig() {
return
}
//carrier = parseInt(carrier) //LEFT OFF HERE
carrier = parseInt(carrier)
//Grabs carriers.csv for list of carriers
var carriersPath = remote.app.getPath('exe') //Grabs the path to the executable
carriersPath = carriersPath.substring(0, carriersPath.length - 11) + 'resources/app/badgeManagement/badgeMinder/carriers.csv'
var carriers = fs.readFileSync(carriersPath, 'utf-8', () => {})
carriers = carriers.split(/,|\n/)
if(carrier == 0) { //No carrier is selected
alert('Invalid carrier')
ipcRenderer.send('log', `ORNL Toolbox: Invalid carrier - request aborted`, 'err')
return
}
//Assigning a domain string to the carrier
switch(parseInt(carrier)) {
case 0:
alert('Invalid carrier') //No carrier is selected
ipcRenderer.send('log', `ORNL Toolbox: Invalid carrier - request aborted`, 'err')
return
break
case 1:
carrier = "@txt.att.net" //AT&T
break
case 2:
carrier = "@vtext.com" //Verizon
break
case 3:
carrier = "@email.uscc.net" //U.S. Cellular
break
case 4:
carrier = "@messaging.sprintpcs.com" //Sprint
break
case 5:
carrier = "@vmobl.com" //Virgin Mobile
break
case 6:
carrier = "@tmomail.net" //T-Mobile
break
case 7:
carrier = "@mmst5.tracfone.co" //Tracfone
for(i = 1; i < carriers.length; i+=2) {
if(i == carrier) {
carrier = carriers[parseInt(i / 2) + 1]
break
case 8:
carrier = "@mymetropcs.com" //Metro PCS
break
case 9:
carrier = "@myboostmobile.com" //Boost Mobile
break
case 10:
carrier = "@sms.mycricket.com" //Cricket
break
case 11:
carrier = "@messaging.nextel.com" //Nextel
break
case 12:
carrier = "@message.alltel.com" //Alltel
break
case 13:
carrier = "@ptel.com" //Ptel
break
case 14:
carrier = "@tms.suncom.com" //Suncom
break
case 15:
carrier = "@qwestmp.com" //Qwest
break
case 16:
carrier = "@mailmymobile.net" //Ting
}
}
//Combining the three phone number entries into one string
phone = `${phoneNum1}${phoneNum2}${phoneNum3}`
ipcRenderer.send('log', `ORNL Toolbox: Text Message Reminder is enabled`, 'info')
......
......@@ -22,6 +22,7 @@ function configLoad() {
var phone3
var carrier
//Grabs saved settings for Badge Minder
var contents = fs.readFileSync(remote.app.getPath('home') + '/.config/ornltoolbox/badgeMinder.config', 'utf-8', () => {})
contents = contents.split('\n')
......@@ -54,56 +55,26 @@ function configLoad() {
document.getElementById('badgeMinderPhoneTextBox2').value = phone2
document.getElementById('badgeMinderPhoneTextBox3').value = phone3
//Assigning a carrier number to the domain string
switch(carrier) {
case "@txt.att.net":
carrier = 1 //AT&T
break
case "@vtext.com":
carrier = 2 //Verizon
break
case "@email.uscc.net":
carrier = 3 //U.S. Cellular
break
case "@messaging.sprintpcs.com":
carrier = 4 //Sprint
break
case "@vmobl.com":
carrier = 5 //Virgin Mobile
break
case "@tmomail.net":
carrier = 6 //T-Mobile
break
case "@mmst5.tracfone.co":
carrier = 7 //Tracfone
break
case "@mymetropcs.com":
carrier = 8 //Metro PCS
break
case "@myboostmobile.com":
carrier = 9 //Boost Mobile
break
case "@sms.mycricket.com":
carrier = 10 //Cricket
break
case "@messaging.nextel.com":
carrier = 11 //Nextel
break
case "@message.alltel.com":
carrier = 12 //Alltel
break
case "@ptel.com":
carrier = 13 //Ptel
break
case "@tms.suncom.com":
carrier = 14 //Suncom
break
case "@qwestmp.com":
carrier = 15 //Qwest
break
case "@mailmymobile.net":
carrier = 16 //Ting
//Grabs carriers.csv for list of carriers
var carriersPath = remote.app.getPath('exe') //Grabs the path to the executable
carriersPath = carriersPath.substring(0, carriersPath.length - 11) + 'resources/app/badgeManagement/badgeMinder/carriers.csv'
var carriers = fs.readFileSync(carriersPath, 'utf-8', () => {})
carriers = carriers.split(/,|\n/)
//Retrieve the dropdown for carriers in Badge Minder
var carrierDropdown = document.getElementById('badgeMinderCarrier')
//Loop for assigning a carrier number to the domain string
for(i = 1; i < carriers.length; i+=2) {
if(carriers[i] == carrier) { //Correct carrier found, assign number
carrier = parseInt(i / 2) + 1
}
var option = document.createElement('option') //Create new dropdown option
option.text = carriers[i - 1] //Assign correct carrier name to option
option.value = parseInt(i / 2) + 1 //Assign correct number to option
carrierDropdown.add(option) //Add dropdown option
}
//Assign previously selected value onto the initial page
document.getElementById('badgeMinderCarrier').value = carrier
} catch(error) {
//No config file
......
AT&T,@txt.att.net
Verizon,@vtext.com
U.S. Cellular,@email.uscc.net
Sprint,@messaging.sprintpcs.com
Virgin Mobile,@vmobl.com
T-Mobile,@tmomail.net
Tracfone,@mmst5.tracfone.com
Metro PCS,@mymetropcs.com
Boost Mobile,@myboostmobile.com
Cricket,@sms.mycricket.com
Nextel,@messaging.nextel.com
Alltel,@message.alltel.com
Ptel,@ptel.com
Suncom,@tms.suncom.com
Qwest,@qwestmp.com
Ting,@mailmymobile.net
......@@ -6,7 +6,7 @@ if [[ ${CI_COMMIT_REF_NAME} == 'master' ]]; then
else
BRANCH="-${CI_COMMIT_REF_NAME}"
fi
VERSION_NUMBER='1.2.2'
VERSION_NUMBER='1.2.3'
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -ivh epel-release-latest-7.noarch.rpm
sudo yum -y install nodejs npm ruby-devel gcc make rpm-build rubygems
......
......@@ -259,7 +259,7 @@ function createWindow() {
var menu = Menu.buildFromTemplate(menuTemplate);
Menu.setApplicationMenu(menu); //Sets the template as the app menu
//mainWindow.openDevTools() //Opens dev tools on start
mainWindow.openDevTools() //Opens dev tools on start
}
function addWin(file, title, width, height) {
......@@ -310,7 +310,7 @@ function addWin(file, title, width, height) {
})
addWindow.setMenu(null)
//addWindow.openDevTools()
addWindow.openDevTools()
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment