Initial
This commit is contained in:
2
public/js/getmdl-select.min.js
vendored
Normal file
2
public/js/getmdl-select.min.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";!function(){function e(){getmdlSelect.init(".getmdl-select")}window.addEventListener?window.addEventListener("load",e,!1):window.attachEvent&&window.attachEvent("onload",e)}();var getmdlSelect={_defaultValue:{width:300},_addEventListeners:function(e){var t=e.querySelector("input"),n=e.querySelector('input[type="hidden"]'),l=e.querySelectorAll("li"),a=e.querySelector(".mdl-js-menu"),o=e.querySelector(".mdl-icon-toggle__label"),i="",c="",s="",u=!1,d=function(o){var i=o.textContent.trim();if(t.value=i,l.forEach(function(e){e.classList.remove("selected")}),o.classList.add("selected"),e.MaterialTextfield.change(i),setTimeout(function(){e.MaterialTextfield.updateClasses_()},250),n.value=o.dataset.val||"",c=t.value,s=n.value,"createEvent"in document){var u=document.createEvent("HTMLEvents");u.initEvent("change",!1,!0),a.MaterialMenu.hide(),t.dispatchEvent(u)}else t.fireEvent("onchange")},r=function(){u=!1,t.value=c,n.value=s,e.querySelector(".mdl-menu__container").classList.contains("is-visible")||e.classList.remove("is-focused");var l=document.querySelectorAll(".getmdl-select .mdl-js-menu");[].forEach.call(l,function(e){e.MaterialMenu.hide()});var o=new Event("closeSelect");a.dispatchEvent(o)};document.body.addEventListener("click",r,!1),e.onkeydown=function(l){9==l.keyCode&&(t.value=c,n.value=s,a.MaterialMenu.hide(),e.classList.remove("is-focused"))},t.onfocus=function(e){a.MaterialMenu.show(),a.focus(),u=!0},t.onblur=function(e){e.stopPropagation()},t.onclick=function(t){t.stopPropagation(),a.classList.contains("is-visible")?(a.MaterialMenu.hide(),u=!1):(a.MaterialMenu.show(),r(),e.classList.add("is-focused"),u=!0)},t.onkeydown=function(l){27==l.keyCode&&(t.value=c,n.value=s,a.MaterialMenu.hide(),e.MaterialTextfield.onBlur_(),""!==i&&(e.querySelector(".mdl-textfield__label").textContent=i,i=""))},a.addEventListener("closeSelect",function(l){t.value=c,n.value=s,e.classList.remove("is-focused"),""!==i&&(e.querySelector(".mdl-textfield__label").textContent=i,i="")}),a.onkeydown=function(l){27==l.keyCode&&(t.value=c,n.value=s,e.classList.remove("is-focused"),""!==i&&(e.querySelector(".mdl-textfield__label").textContent=i,i=""))},o&&(o.onclick=function(l){l.stopPropagation(),u?(a.MaterialMenu.hide(),u=!1,e.classList.remove("is-focused"),e.MaterialTextfield.onBlur_(),t.value=c,n.value=s):(r(),e.MaterialTextfield.onFocus_(),t.focus(),a.MaterialMenu.show(),u=!0)}),[].forEach.call(l,function(n){n.onfocus=function(){e.classList.add("is-focused");var l=n.textContent.trim();t.value=l,e.classList.contains("mdl-textfield--floating-label")||""!=i||(i=e.querySelector(".mdl-textfield__label").textContent.trim(),e.querySelector(".mdl-textfield__label").textContent="")},n.onclick=function(){d(n)},n.dataset.selected&&d(n)})},init:function(e){var t=document.querySelectorAll(e);[].forEach.call(t,function(e){getmdlSelect._addEventListeners(e),componentHandler.upgradeElement(e),componentHandler.upgradeElement(e.querySelector("ul"))})}};
|
||||
//# sourceMappingURL=getmdl-select.min.js.map
|
||||
1
public/js/getmdl-select.min.js.map
Normal file
1
public/js/getmdl-select.min.js.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["src\\js\\getmdl-select.js"],"names":["whenLoaded","getmdlSelect","init","window","addEventListener","attachEvent","_defaultValue","width","_addEventListeners","dropdown","input","querySelector","hiddenInput","list","querySelectorAll","menu","arrow","label","previousValue","previousDataVal","opened","setSlectedItem","li","value","textContent","trim","forEach","classList","remove","add","MaterialTextfield","change","setTimeout","updateClasses_","dataset","val","document","evt","createEvent","initEvent","hide","dispatchEvent","fireEvent","hideAllMenus","contains","menus","call","event","Event","body","onkeydown","keyCode","onfocus","e","show","focus","onblur","stopPropagation","onclick","onBlur_","onFocus_","selected","selector","dropdowns","componentHandler","upgradeElement"],"mappings":"AAAA,cAII,WACI,QAASA,KACLC,aAAaC,KAAK,kBAGtBC,OAAOC,iBAAmBD,OAAO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EAAmB,aAAEuC,OACrBlC,GAAS,QAKlBM,QAAQoB,KAAKjC,EAAM,SAAUS,GAC5BA,EAAG8B,QAAU,WACT3C,EAASkB,UAAUE,IAAI,aACvB,IAAIN,GAAQD,EAAGE,YAAYC,MAC3Bf,GAAMa,MAAQA,EACTd,EAASkB,UAAUiB,SAAS,kCAA6C,IAAT3B,IACjEA,EAAQR,EAASE,cAAc,yBAAyBa,YAAYC,OACpEhB,EAASE,cAAc,yBAAyBa,YAAc,KAItEF,EAAGoC,QAAU,WACTrC,EAAeC,IA4BfA,EAAGY,QAAQ2B,UACXxC,EAAeC,MAI3BpB,KAAM,SAAc4D,GAChB,GAAIC,GAAY3B,SAAStB,iBAAiBgD,MACvCpC,QAAQoB,KAAKiB,EAAW,SAAUtD,GACjCR,aAAaO,mBAAmBC,GAChCuD,iBAAiBC,eAAexD,GAChCuD,iBAAiBC,eAAexD,EAASE,cAAc","file":"getmdl-select.min.js","sourceRoot":"E:\\html5\\GitHub\\getmdl-select"}
|
||||
24505
public/js/keras.js
Normal file
24505
public/js/keras.js
Normal file
File diff suppressed because it is too large
Load Diff
1
public/js/keras.min.js
vendored
Normal file
1
public/js/keras.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3996
public/js/material.js
Normal file
3996
public/js/material.js
Normal file
File diff suppressed because it is too large
Load Diff
10
public/js/material.min.js
vendored
Normal file
10
public/js/material.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/js/material.min.js.map
Normal file
1
public/js/material.min.js.map
Normal file
File diff suppressed because one or more lines are too long
202
public/js/mdl-selectfield.js
Normal file
202
public/js/mdl-selectfield.js
Normal file
@@ -0,0 +1,202 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Class constructor for Select field MDL component.
|
||||
* Implements custom MDL component design pattern not defined yet.
|
||||
*
|
||||
* @constructor
|
||||
* @param {HTMLElement} element The element that will be upgraded.
|
||||
*/
|
||||
var MaterialSelectfield = function MaterialSelectfield(element) {
|
||||
this.element_ = element;
|
||||
// Initialize instance.
|
||||
this.init();
|
||||
};
|
||||
window['MaterialSelectfield'] = MaterialSelectfield;
|
||||
|
||||
MaterialSelectfield.prototype.Constant_ = {
|
||||
// None for now
|
||||
};
|
||||
|
||||
MaterialSelectfield.prototype.CssClasses_ = {
|
||||
LABEL: 'mdl-selectfield__label',
|
||||
SELECT: 'mdl-selectfield__select',
|
||||
IS_DIRTY: 'is-dirty',
|
||||
IS_FOCUSED: 'is-focused',
|
||||
IS_DISABLED: 'is-disabled',
|
||||
IS_INVALID: 'is-invalid',
|
||||
IS_UPGRADED: 'is-upgraded'
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle focus.
|
||||
*
|
||||
* @param {Event} event The event that fired.
|
||||
* @private
|
||||
*/
|
||||
MaterialSelectfield.prototype.onFocus_ = function(event) {
|
||||
this.element_.classList.add(this.CssClasses_.IS_FOCUSED);
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle lost focus.
|
||||
*
|
||||
* @param {Event} event The event that fired.
|
||||
* @private
|
||||
*/
|
||||
MaterialSelectfield.prototype.onBlur_ = function(event) {
|
||||
this.element_.classList.remove(this.CssClasses_.IS_FOCUSED);
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle reset event from outside.
|
||||
*
|
||||
* @param {Event} event The event that fired.
|
||||
* @private
|
||||
*/
|
||||
MaterialSelectfield.prototype.onReset_ = function(event) {
|
||||
this.updateClasses_();
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle class updates.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
MaterialSelectfield.prototype.updateClasses_ = function() {
|
||||
this.checkDisabled();
|
||||
this.checkValidity();
|
||||
this.checkDirty();
|
||||
};
|
||||
|
||||
// Public methods.
|
||||
|
||||
/**
|
||||
* Check the disabled state and update field accordingly.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
MaterialSelectfield.prototype.checkDisabled = function() {
|
||||
if (this.select_.disabled) {
|
||||
this.element_.classList.add(this.CssClasses_.IS_DISABLED);
|
||||
} else {
|
||||
this.element_.classList.remove(this.CssClasses_.IS_DISABLED);
|
||||
}
|
||||
};
|
||||
MaterialSelectfield.prototype['checkDisabled'] = MaterialSelectfield.prototype.checkDisabled;
|
||||
|
||||
/**
|
||||
* Check the validity state and update field accordingly.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
MaterialSelectfield.prototype.checkValidity = function() {
|
||||
if (this.select_.validity.valid) {
|
||||
this.element_.classList.remove(this.CssClasses_.IS_INVALID);
|
||||
} else {
|
||||
this.element_.classList.add(this.CssClasses_.IS_INVALID);
|
||||
}
|
||||
};
|
||||
MaterialSelectfield.prototype['checkValidity'] = MaterialSelectfield.prototype.checkValidity;
|
||||
|
||||
/**
|
||||
* Check the dirty state and update field accordingly.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
MaterialSelectfield.prototype.checkDirty = function() {
|
||||
if (this.select_.value && this.select_.value.length > 0) {
|
||||
this.element_.classList.add(this.CssClasses_.IS_DIRTY);
|
||||
} else {
|
||||
this.element_.classList.remove(this.CssClasses_.IS_DIRTY);
|
||||
}
|
||||
};
|
||||
MaterialSelectfield.prototype['checkDirty'] = MaterialSelectfield.prototype.checkDirty;
|
||||
|
||||
/**
|
||||
* Enable select field.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
MaterialSelectfield.prototype.disable = function() {
|
||||
this.select_.disabled = true;
|
||||
this.updateClasses_();
|
||||
};
|
||||
MaterialSelectfield.prototype['disable'] = MaterialSelectfield.prototype.disable;
|
||||
|
||||
/**
|
||||
* Enable select field.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
MaterialSelectfield.prototype.enable = function() {
|
||||
this.select_.disabled = false;
|
||||
this.updateClasses_();
|
||||
};
|
||||
MaterialSelectfield.prototype['enable'] = MaterialSelectfield.prototype.enable;
|
||||
|
||||
/**
|
||||
* Update select field value.
|
||||
*
|
||||
* @param {string} value The value to which to set the control (optional).
|
||||
* @public
|
||||
*/
|
||||
MaterialSelectfield.prototype.change = function(value) {
|
||||
if (value) {
|
||||
this.select_.value = value;
|
||||
}
|
||||
this.updateClasses_();
|
||||
};
|
||||
MaterialSelectfield.prototype['change'] = MaterialSelectfield.prototype.change;
|
||||
|
||||
/**
|
||||
* Initialize element.
|
||||
*/
|
||||
MaterialSelectfield.prototype.init = function() {
|
||||
if (this.element_) {
|
||||
this.label_ = this.element_.querySelector('.' + this.CssClasses_.LABEL);
|
||||
this.select_ = this.element_.querySelector('.' + this.CssClasses_.SELECT);
|
||||
|
||||
if (this.select_) {
|
||||
this.boundUpdateClassesHandler = this.updateClasses_.bind(this);
|
||||
this.boundFocusHandler = this.onFocus_.bind(this);
|
||||
this.boundBlurHandler = this.onBlur_.bind(this);
|
||||
this.boundResetHandler = this.onReset_.bind(this);
|
||||
this.select_.addEventListener('change', this.boundUpdateClassesHandler);
|
||||
this.select_.addEventListener('focus', this.boundFocusHandler);
|
||||
this.select_.addEventListener('blur', this.boundBlurHandler);
|
||||
this.select_.addEventListener('reset', this.boundResetHandler);
|
||||
|
||||
var invalid = this.element_.classList
|
||||
.contains(this.CssClasses_.IS_INVALID);
|
||||
this.updateClasses_();
|
||||
this.element_.classList.add(this.CssClasses_.IS_UPGRADED);
|
||||
if (invalid) {
|
||||
this.element_.classList.add(this.CssClasses_.IS_INVALID);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Downgrade the component
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
MaterialSelectfield.prototype.mdlDowngrade_ = function() {
|
||||
this.select_.removeEventListener('change', this.boundUpdateClassesHandler);
|
||||
this.select_.removeEventListener('focus', this.boundFocusHandler);
|
||||
this.select_.removeEventListener('blur', this.boundBlurHandler);
|
||||
this.select_.removeEventListener('reset', this.boundResetHandler);
|
||||
};
|
||||
|
||||
// The component registers itself. It can assume componentHandler is available
|
||||
// in the global scope.
|
||||
componentHandler.register({
|
||||
constructor: MaterialSelectfield,
|
||||
classAsString: 'MaterialSelectfield',
|
||||
cssClass: 'mdl-js-selectfield',
|
||||
widget: true
|
||||
});
|
||||
})();
|
||||
2
public/js/mdl-selectfield.min.js
vendored
Normal file
2
public/js/mdl-selectfield.min.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
!function(){"use strict";var s=function(s){this.element_=s,this.init()};window.MaterialSelectfield=s,s.prototype.Constant_={},s.prototype.CssClasses_={LABEL:"mdl-selectfield__label",SELECT:"mdl-selectfield__select",IS_DIRTY:"is-dirty",IS_FOCUSED:"is-focused",IS_DISABLED:"is-disabled",IS_INVALID:"is-invalid",IS_UPGRADED:"is-upgraded"},s.prototype.onFocus_=function(s){this.element_.classList.add(this.CssClasses_.IS_FOCUSED)},s.prototype.onBlur_=function(s){this.element_.classList.remove(this.CssClasses_.IS_FOCUSED)},s.prototype.onReset_=function(s){this.updateClasses_()},s.prototype.updateClasses_=function(){this.checkDisabled(),this.checkValidity(),this.checkDirty()},s.prototype.checkDisabled=function(){this.select_.disabled?this.element_.classList.add(this.CssClasses_.IS_DISABLED):this.element_.classList.remove(this.CssClasses_.IS_DISABLED)},s.prototype.checkDisabled=s.prototype.checkDisabled,s.prototype.checkValidity=function(){this.select_.validity.valid?this.element_.classList.remove(this.CssClasses_.IS_INVALID):this.element_.classList.add(this.CssClasses_.IS_INVALID)},s.prototype.checkValidity=s.prototype.checkValidity,s.prototype.checkDirty=function(){this.select_.value&&this.select_.value.length>0?this.element_.classList.add(this.CssClasses_.IS_DIRTY):this.element_.classList.remove(this.CssClasses_.IS_DIRTY)},s.prototype.checkDirty=s.prototype.checkDirty,s.prototype.disable=function(){this.select_.disabled=!0,this.updateClasses_()},s.prototype.disable=s.prototype.disable,s.prototype.enable=function(){this.select_.disabled=!1,this.updateClasses_()},s.prototype.enable=s.prototype.enable,s.prototype.change=function(s){s&&(this.select_.value=s),this.updateClasses_()},s.prototype.change=s.prototype.change,s.prototype.init=function(){if(this.element_&&(this.label_=this.element_.querySelector("."+this.CssClasses_.LABEL),this.select_=this.element_.querySelector("."+this.CssClasses_.SELECT),this.select_)){this.boundUpdateClassesHandler=this.updateClasses_.bind(this),this.boundFocusHandler=this.onFocus_.bind(this),this.boundBlurHandler=this.onBlur_.bind(this),this.boundResetHandler=this.onReset_.bind(this),this.select_.addEventListener("change",this.boundUpdateClassesHandler),this.select_.addEventListener("focus",this.boundFocusHandler),this.select_.addEventListener("blur",this.boundBlurHandler),this.select_.addEventListener("reset",this.boundResetHandler);var s=this.element_.classList.contains(this.CssClasses_.IS_INVALID);this.updateClasses_(),this.element_.classList.add(this.CssClasses_.IS_UPGRADED),s&&this.element_.classList.add(this.CssClasses_.IS_INVALID)}},s.prototype.mdlDowngrade_=function(){this.select_.removeEventListener("change",this.boundUpdateClassesHandler),this.select_.removeEventListener("focus",this.boundFocusHandler),this.select_.removeEventListener("blur",this.boundBlurHandler),this.select_.removeEventListener("reset",this.boundResetHandler)},componentHandler.register({constructor:s,classAsString:"MaterialSelectfield",cssClass:"mdl-js-selectfield",widget:!0})}();
|
||||
//# sourceMappingURL=mdl-selectfield.min.js.map
|
||||
13
public/js/neuralnet.js
Normal file
13
public/js/neuralnet.js
Normal file
@@ -0,0 +1,13 @@
|
||||
console.log("hello");
|
||||
|
||||
|
||||
tf.loadModel("/data/adadelta10-1024tanh-decoder-tfmodel/model.json")
|
||||
.then((model) => {
|
||||
console.log("HURRAY");
|
||||
var prediction = model.predict(tf.tensor2d([[0.0, 0.0]], [1, 2]));
|
||||
prediction.data().then((pred) => {
|
||||
console.log("prediction", pred);
|
||||
}).catch((err2) => console.error("err2", err2));
|
||||
}).catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
Reference in New Issue
Block a user