Oracle JET Base FIddle

proto v2

by dougiei

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.5/require.min.js"></script>

CSS

/**
The default theme for JET is based on Oracle's Alta UI spec.  
Theming is provided via SASS with full .scss source code provided
and a Theme Builder application to help build custom themes when needed.
**/

@import url('//static.oracle.com/cdn/jet/v6.0.0/default/css/alta/oj-alta-min.css');
body {
  padding: 20px;
}

JavaScript

/**
RequireJS is used for lazy loading of resources as well as dependency resolution.
**/

require(['knockout',
  'ojs/ojcore',
  'jquery',
  'ojs/ojknockout',
  'ojs/ojtable',
  'ojs/ojarraytabledatasource',
  'ojs/ojvalidation-datetime',
  'ojs/ojvalidation-number'
], function(ko, oj, $) {
  'use strict';


  /**
  JET uses a Model-View-ViewModel(MVVM) Architecture.
  **/
  var ViewModel = function() {
    var self = this;

 

    function wizMain(){
    
    this.Name = "NOT Set";
    
    }
wizMain.prototype = {
  
};

function factory() {

this.facsettings = function(name) {

 if (name === "PRODUCT") {
            return new ProductRecWiz();
     } else if (type === "PRODCOMP") {
            return new ProdCompRecWiz();

     }  
    
};

var ProductRecWiz=function () {
var proto2 = new wizMain;
proto2.steps = [1,2,3,4,6,7];

ProductRecWiz.prototype = proto2;
}
var ProductCompRecWiz=function () {

};


return factory

};
  



function bar(){}
var proto = new wizMain;
proto.steps = [1,2,3,4];
bar.prototype = proto;



var inst = new bar;
console.log(inst.Name);
console.log(inst.steps);

var myfactory = new factory();
console.log(myfactory)
var inst2 = this.myfactory.facsettings("PRODUCT");


  
  
  
 } 
  
  ko.applyBindings(new ViewModel());


});


/**
JET libraries, as well as 3rd party libraries that are distributed as part of JET, are available via a Content Delivery Network(CDN) to help provide the best  performance for your product. 

This also makes upgrading to new releases very quick and easy.
**/

function _getCDNPath(paths) {
  var cdnPath = "https://static.oracle.com/cdn/jet/";
  var ojPath = "v6.0.0/default/js/";
  var thirdpartyPath = "v6.0.0/3rdparty/";
  var keys = Object.keys(paths);
  var newPaths = {};

  function _isoj(key) {
    return (key.indexOf('oj') === 0 && key !== 'ojdnd');
  }
  keys.forEach(function(key) {
    newPaths[key] = cdnPath + (_isoj(key) ? ojPath : thirdpartyPath) + paths[key];
  });
  return...