-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
781f0bd
commit 9e0faa4
Showing
81 changed files
with
5,407 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
var systemAppId = 'system'; | ||
var additionalAppsConfig = '/jci/opera/opera_dir/userjs/additionalApps.json'; | ||
var additionalApps = []; | ||
|
||
/** | ||
* Sets up the additional apps and MMUI message interception magic | ||
*/ | ||
function addAdditionalApps() { | ||
var category = 'Applications'; | ||
|
||
// check that we're in the system app | ||
if(typeof framework === 'object' && framework._currentAppUiaId === systemAppId) { | ||
var systemApp = framework.getAppInstance(systemAppId); | ||
|
||
if(!systemApp.hasAdditionalApps) { | ||
systemApp.hasAdditionalApps = true; // so we only do this if needed | ||
|
||
// load additional app definitions from from | ||
getJSON('file://localhost' + additionalAppsConfig, function(data) { | ||
additionalApps = JSON.parse(data); | ||
}, function(status) { | ||
framework.log.error('Unable to load additionalApps from ' + additionalAppsConfig); | ||
}); | ||
// add additional apps to 'Applications' list | ||
for (var i = 0; i < additionalApps.length; ++i) { | ||
var additionalApp = additionalApps[i]; | ||
systemApp._masterApplicationDataList.items.push({ appData : { appName : additionalApp.name, isVisible : true, mmuiEvent : 'Select'+additionalApp.name }, text1Id : additionalApp.name, disabled : false, itemStyle : 'style01', hasCaret : false }); | ||
framework.localize._appDicts[systemAppId][additionalApp.name] = additionalApp.label; | ||
framework.common._contextCategory._contextCategoryTable[additionalApp.name+'.*'] = category; | ||
if(typeof systemApp._applicationsCtxtWiseAppNames !== "undefined" && systemApp._applicationsCtxtWiseAppNames.Applications.indexOf(additionalApp.name) === -1) { | ||
systemApp._applicationsCtxtWiseAppNames.Applications.push(additionalApp.name); | ||
} | ||
if (additionalApp.preload !== undefined) { | ||
var preloadPath = "apps/" + additionalApp.name + "/js/" + additionalApp.preload; | ||
utility.loadScript(preloadPath); | ||
} | ||
} | ||
|
||
// intercept app selection from the list to do our magic | ||
systemApp._contextTable[category].controlProperties.List2Ctrl.selectCallback = additionalAppMenuItemSelectCallback.bind(systemApp); | ||
|
||
// intercept MMUI messages in the framework | ||
framework.origRouteMmuiMsg = framework.routeMmuiMsg; | ||
framework.routeMmuiMsg = additionalAppRouteMmuiMsg.bind(framework); | ||
framework.sendEventToMmui = additionalAppSendEventToMmui.bind(framework); | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Using a disabled app from the list of apps in systemApp.js as a replacement to the MMUI | ||
*/ | ||
var additionalAppReplacedAppName = 'vdt'; | ||
var additionalAppReplacedAppContext = 'DriveChartDetails'; | ||
var additionalAppReplacedMmuiEvent = 'SelectDriveRecord'; | ||
|
||
/** | ||
* Interceptor for systemApp._menuItemSelectCallback | ||
*/ | ||
function additionalAppMenuItemSelectCallback(listCtrlObj, appData, params) { | ||
for (var i = 0; i < additionalApps.length; ++i) { | ||
var additionalApp = additionalApps[i]; | ||
if(additionalApp.name === appData.appName) { | ||
framework.additionalAppName = appData.appName; | ||
framework.additionalAppContext = 'Start'; | ||
appData = JSON.parse(JSON.stringify(appData)); | ||
appData.appName = additionalAppReplacedAppName; | ||
appData.mmuiEvent = additionalAppReplacedMmuiEvent; | ||
break; | ||
} | ||
} | ||
this._menuItemSelectCallback(listCtrlObj, appData, params); | ||
} | ||
|
||
/** | ||
* Interceptor for Framework.routeMmuiMsg | ||
*/ | ||
function additionalAppRouteMmuiMsg(jsObject) { | ||
switch(jsObject.msgType) { | ||
case 'ctxtChg': | ||
if(this.additionalAppName && jsObject.uiaId == additionalAppReplacedAppName) { | ||
jsObject.uiaId = this.additionalAppName; | ||
jsObject.ctxtId = this.additionalAppContext; | ||
} | ||
break; | ||
case 'focusStack': | ||
var additionalAppInFocusStack = false; | ||
if(this.additionalAppName) { | ||
for(var i = 0; i < jsObject.appIdList.length; i++) { | ||
var appId = jsObject.appIdList[i]; | ||
if(appId.id == additionalAppReplacedAppName) { | ||
appId.id = this.additionalAppName; | ||
} | ||
if(appId.id == this.additionalAppName) { | ||
additionalAppInFocusStack = true; | ||
} | ||
} | ||
} | ||
if(!additionalAppInFocusStack) { | ||
this.additionalAppName = null; | ||
this.additionalAppContext = null; | ||
} | ||
case 'msg': // fall-through to alert | ||
case 'alert': | ||
if(this.additionalAppName && jsObject.uiaId == additionalAppReplacedAppName) { | ||
jsObject.uiaId = this.additionalAppName; | ||
} | ||
break; | ||
default: | ||
// do nothing | ||
break; | ||
} | ||
|
||
this.origRouteMmuiMsg(jsObject); | ||
} | ||
|
||
/** | ||
* Interceptor for Framework.sendEventToMmui | ||
*/ | ||
function additionalAppSendEventToMmui(uiaId, eventId, params, fromVui) | ||
{ | ||
if(uiaId == this.additionalAppName) { | ||
uiaId = additionalAppReplacedAppName; | ||
} | ||
|
||
var currentUiaId = this.getCurrentApp(); | ||
var currentContextId = this.getCurrCtxtId(); | ||
|
||
if(currentUiaId == this.additionalAppName) { | ||
currentUiaId = additionalAppReplacedAppName; | ||
currentContextId = additionalAppReplacedAppContext; | ||
} | ||
|
||
this.websockets.sendEventMsg(uiaId, eventId, params, fromVui, currentUiaId, currentContextId); | ||
|
||
// Let debug know about the message | ||
this.debug.triggerEvtToMmuiCallbacks(uiaId, eventId, params); | ||
} | ||
|
||
/** | ||
* Helper function to get JSON data | ||
*/ | ||
function getJSON(url, successHandler, errorHandler) { | ||
var xhr = new XMLHttpRequest(); | ||
xhr.open('GET', url, false); | ||
xhr.timeout = 30000; | ||
xhr.onload = function() { | ||
var status = xhr.status; | ||
if (status == 0) { | ||
successHandler && successHandler(xhr.response); | ||
} else { | ||
errorHandler && errorHandler(status); | ||
} | ||
}; | ||
xhr.onerror = function() { | ||
var status = xhr.status; | ||
}; | ||
xhr.send(); | ||
} | ||
|
||
/** | ||
* Function to get the whole thing started. | ||
*/ | ||
(function () { | ||
window.opera.addEventListener('AfterEvent.load', function (e) { | ||
addAdditionalApps(); | ||
}); | ||
})(); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
114 changes: 114 additions & 0 deletions
114
config/speedometer/jci/gui/apps/_speedometer/css/StatusBarSpeedometer.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
#SbSpeedo { | ||
font-family:Tipperary,verdana; | ||
color: white; | ||
height: 64px; | ||
position: absolute; | ||
right: 115px; | ||
top: 0px; | ||
width: 84px; | ||
z-index: 20200; | ||
/* text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; */ | ||
} | ||
#SbSpeedo .gpsSpeedValue, | ||
#SbSpeedo .outsideTempValue, | ||
#SbSpeedo .Drv1AvlFuelEValue, | ||
#SbSpeedo .gpsAltitudeValue, | ||
#SbSpeedo .gpsHeading { | ||
text-align: right; | ||
position: absolute; | ||
} | ||
#SbSpeedo .gpsSpeedValue { | ||
font-size: 40px; | ||
line-height: 40px; | ||
height: 40px; | ||
top: 23px; | ||
right: 16px; | ||
width: 100%; | ||
} | ||
#SbSpeedo .speedUnit { | ||
color: #DDDDDD; | ||
font-size: 12px; | ||
position: absolute; | ||
width: 30px; | ||
right: -8px; | ||
transform: rotate(-90deg); | ||
bottom: 12px; | ||
white-space: nowrap; | ||
} | ||
#SbSpeedo .outsideTempValue, | ||
#SbSpeedo .Drv1AvlFuelEValue, | ||
#SbSpeedo .gpsAltitudeValue, | ||
#SbSpeedo .gpsHeading { | ||
padding-right: 24px; | ||
background: transparent url('IcnCompass.png') no-repeat scroll right 0px / 18px 18px; | ||
font-size: 17px; | ||
line-height: 17px; | ||
height: 20px; | ||
top: 6px; | ||
right: 17px; | ||
} | ||
#SbSpeedo .outsideTempValue { | ||
background-image: url('IcnTemp.png'); | ||
} | ||
#SbSpeedo .gpsAltitudeValue { | ||
display: none; | ||
background-image: url('IcnMountain.png'); | ||
} | ||
#SbSpeedo .Drv1AvlFuelEValue { | ||
display: none; | ||
background-image: url('IcnFuel.png') | ||
} | ||
|
||
/*** Statusbar speedo style if more than 3 SbIcons ***/ | ||
#SbSpeedo.morespace .Drv1AvlFuelEValue, | ||
#SbSpeedo.morespace .outsideTempValue, | ||
#SbSpeedo.morespace .gpsAltitudeValue, | ||
#SbSpeedo.morespace .gpsHeading { | ||
right: 40px; | ||
} | ||
|
||
/*** Statusbar speedo style inside backupparking app ***/ | ||
#SbSpeedo.parking { | ||
width: 160px; | ||
height: 45px; | ||
right: 320px; | ||
/* opacity: 0.8; */ | ||
background-color: rgba(0, 0, 0, 0.7); | ||
border-radius: 0 0 5px 5px; | ||
} | ||
#SbSpeedo.parking .gpsSpeedValue { | ||
right: 19px; | ||
top: 3px; | ||
} | ||
#SbSpeedo.parking .speedUnit { | ||
right: -5px; | ||
bottom: 15px; | ||
} | ||
#SbSpeedo.parking .outsideTempValue, | ||
#SbSpeedo.parking .gpsAltitudeValue { | ||
display: block !important; | ||
right: 88px; | ||
} | ||
#SbSpeedo.parking .Drv1AvlFuelEValue, | ||
#SbSpeedo.parking .gpsHeading { | ||
display: block !important; | ||
right: 88px; | ||
top: 23px; | ||
} | ||
/* *** Statusbar adjustments *** */ | ||
.SbnCtrl { | ||
background-image: none !important; | ||
} | ||
.SbnCtrl_Style03_Meter { | ||
left: 110px !important; | ||
} | ||
.SbnCtrl_Style06_Meter { | ||
left: 270px !important; | ||
} | ||
|
||
/* Digital Clock Mod - Remove this to apply | ||
#SbSpeedo, .StatusBarCtrlDate, .StatusBarCtrlClock { | ||
font-family: "Crystal"!important; | ||
text-transform: uppercase; | ||
} | ||
Remove this */ |
Empty file.
69 changes: 69 additions & 0 deletions
69
config/speedometer/jci/gui/apps/_speedometer/js/_speedometerApp.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
Copyright 2016 Herko ter Horst | ||
__________________________________________________________________________ | ||
Filename: _speedometerApp.js | ||
__________________________________________________________________________ | ||
*/ | ||
|
||
log.addSrcFile("_speedometerApp.js", "_speedometer"); | ||
|
||
function _speedometerApp(uiaId) | ||
{ | ||
log.debug("Constructor called."); | ||
|
||
// Base application functionality is provided in a common location via this call to baseApp.init(). | ||
// See framework/js/BaseApp.js for details. | ||
baseApp.init(this, uiaId); | ||
} | ||
|
||
|
||
/********************************* | ||
* App Init is standard function * | ||
* called by framework * | ||
*********************************/ | ||
|
||
/* | ||
* Called just after the app is instantiated by framework. | ||
* All variables local to this app should be declared in this function | ||
*/ | ||
_speedometerApp.prototype.appInit = function() | ||
{ | ||
log.debug("_speedometerApp appInit called..."); | ||
|
||
//Context table | ||
//@formatter:off | ||
this._contextTable = { | ||
"Start": { // initial context must be called "Start" | ||
"sbName": "Speedometer", | ||
"template": "SpeedoMeterTmplt", | ||
"templatePath": "apps/_speedometer/templates/SpeedoMeter", //only needed for app-specific templates | ||
"readyFunction": this._StartContextReady.bind(this) | ||
} // end of "SpeedoMeter" | ||
}; // end of this.contextTable object | ||
//@formatter:on | ||
|
||
//@formatter:off | ||
this._messageTable = { | ||
// haven't yet been able to receive messages from MMUI | ||
}; | ||
//@formatter:on | ||
}; | ||
|
||
/** | ||
* ========================= | ||
* CONTEXT CALLBACKS | ||
* ========================= | ||
*/ | ||
_speedometerApp.prototype._StartContextReady = function () | ||
{ | ||
framework.common.setSbDomainIcon("apps/_speedometer/IcnSbnSpeedometer.png"); | ||
}; | ||
|
||
/** | ||
* ========================= | ||
* Framework register | ||
* Tell framework this .js file has finished loading | ||
* ========================= | ||
*/ | ||
framework.registerAppLoaded("_speedometer", null, false); |
Oops, something went wrong.