Skip to content

Instantly share code, notes, and snippets.

@louwersj
Created February 4, 2018 19:03
Show Gist options
  • Save louwersj/be3cff34dd56eb83132238c3e659327e to your computer and use it in GitHub Desktop.
Save louwersj/be3cff34dd56eb83132238c3e659327e to your computer and use it in GitHub Desktop.
Basic Oracle JET appController.js
/**
* Copyright (c) 2014, 2017, Oracle and/or its affiliates.
* The Universal Permissive License (UPL), Version 1.0
*/
/*
* Your application specific code will go here
*/
define(['ojs/ojcore', 'knockout', 'ojs/ojknockout'],
function(oj, ko) {
function ControllerViewModel() {
var self = this;
// Media queries for repsonsive layouts
var smQuery = oj.ResponsiveUtils.getFrameworkQuery(oj.ResponsiveUtils.FRAMEWORK_QUERY_KEY.SM_ONLY);
self.smScreen = oj.ResponsiveKnockoutUtils.createMediaQueryObservable(smQuery);
// Header
// Application Name used in Branding Area
self.appName = ko.observable("My Demo Application");
// User Info used in Global Navigation area
self.userLogin = ko.observable("johan.louwers@capgemini.com");
// Footer
function footerLink(name, id, linkTarget) {
this.name = name;
this.linkId = id;
this.linkTarget = linkTarget;
}
self.footerLinks = ko.observableArray([
new footerLink('About Oracle', 'aboutOracle', 'http://www.oracle.com/us/corporate/index.html#menu-about'),
new footerLink('Contact Us', 'contactUs', 'http://www.oracle.com/us/corporate/contact/index.html'),
new footerLink('Legal Notices', 'legalNotices', 'http://www.oracle.com/us/legal/index.html'),
new footerLink('Terms Of Use', 'termsOfUse', 'http://www.oracle.com/us/legal/terms/index.html'),
new footerLink('Your Privacy Rights', 'yourPrivacyRights', 'http://www.oracle.com/us/legal/privacy/index.html')
]);
}
return new ControllerViewModel();
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment