Update /m webui

This commit is contained in:
pancake 2016-11-07 04:53:09 +01:00
parent ecd414a6bf
commit 1d2859b8be
12 changed files with 17 additions and 239 deletions

View File

@ -1,46 +1 @@
'use strict';
importScripts('/m/r2.js');
var LINES = 80;
var MAXLINES = Math.round(LINES * 1.20); // +20%
var TOOLONG = (LINES * 2) * 3;
function appendTo(list, elems) {
if (elems === null) {
return;
}
for (var i = 0 ; i < elems.length ; i++) {
var offset = parseInt(elems[i].offset);
// If the "flag" is empty, we don't care
if (elems[i].size == '0' || elems[i].size >= TOOLONG) {
continue;
}
// If there is already a shortest element, don't care
if (typeof list[offset] !== 'undefined' && elems[i].size <= list[offset]) {
continue;
}
list[offset] = parseInt(elems[i].size);
}
}
self.onmessage = function() {
var data = {};
var allFlags;
r2.cmdj('fj ', function(flags) {
allFlags = flags;
});
var allFcts;
r2.cmdj('aflj', function(fcts) {
allFcts = fcts;
});
appendTo(data, allFlags);
appendTo(data, allFcts);
self.postMessage(data);
};
"use strict";function appendTo(e,n){if(null!==n)for(var s=0;s<n.length;s++){var r=parseInt(n[s].offset);"0"==n[s].size||n[s].size>=TOOLONG||"undefined"!=typeof e[r]&&n[s].size<=e[r]||(e[r]=parseInt(n[s].size))}}importScripts("/m/r2.js");var LINES=80,MAXLINES=Math.round(1.2*LINES),TOOLONG=2*LINES*3;self.onmessage=function(){var e,n={};r2.cmdj("fj ",function(n){e=n});var s;r2.cmdj("aflj",function(e){s=e}),appendTo(n,e),appendTo(n,s),self.postMessage(n)};

View File

@ -1,80 +1 @@
'use strict';
importScripts('/m/r2.js');
importScripts('/m/tools.js');
function extractOffset(str) {
var res = str.match(/(0x[a-fA-F0-9]+)/);
if (res === null) {
return null;
}
return res[1];
};
function extractFct(str) {
var withoutHTML = str.replace(/<[^>]*>/g, '');
var res = withoutHTML.match(/\(fcn\) ([\S^]+)/);
if (res === null) {
return null;
}
return res[1];
}
function extractVar(str) {
var withoutHTML = str.replace(/<[^>]*>/g, '');
var res = withoutHTML.match(/; var ([a-zA-Z0-9]+) ([\S^]+)/);
if (res === null) {
return null;
}
return res[2];
}
function getChunk(where, howManyLines) {
var raw;
// Line retrieved from the current offset
r2.cmd('pD ' + howManyLines + '@e:scr.color=1,scr.html=1 @' + where, function(d) {
raw = d;
});
raw = clickableOffsets(raw);
var lines = raw.split('\n');
for (var i = 0 ; i < lines.length ; i++) {
var fct = extractFct(lines[i]);
if (fct !== null) {
lines[i] = '<span class=\'fcn\' id=\'' + fct + '\'>' + lines[i] + '</span>';
}
var variable = extractVar(lines[i]);
if (variable !== null) {
lines[i] = '<span class=\'var\' id=\'' + variable + '\'>' + lines[i] + '</span>';
}
var offset = extractOffset(lines[i]);
if (offset !== null) {
lines[i] = '<span class=\'offset\' id=\'' + parseInt(offset, 16) + '\'>' + lines[i] + '</span>';
}
}
var withContext = lines.join('\n');
return '<pre style="border-bottom:1px dashed white;" title="' + where + '" id="block' + where + '">' + withContext + '</pre>';
}
self.onmessage = function(e) {
if (e.data.offset < 0) {
self.postMessage({
offset: 0,
data: 'before 0x00'
});
} else {
var chunk = {
offset: e.data.offset,
size: e.data.size,
data: getChunk(e.data.offset, e.data.size)
};
// Sending the data from r2
self.postMessage(chunk);
}
};
"use strict";function extractOffset(t){var a=t.match(/(0x[a-fA-F0-9]+)/);return null===a?null:a[1]}function extractFct(t){var a=t.replace(/<[^>]*>/g,""),e=a.match(/\(fcn\) ([\S^]+)/);return null===e?null:e[1]}function extractVar(t){var a=t.replace(/<[^>]*>/g,""),e=a.match(/; var ([a-zA-Z0-9]+) ([\S^]+)/);return null===e?null:e[2]}function getChunk(t,a){var e;r2.cmd("pD "+a+"@e:scr.color=1,scr.html=1 @"+t,function(t){e=t}),e=clickableOffsets(e);for(var s=e.split("\n"),r=0;r<s.length;r++){var n=extractFct(s[r]);null!==n&&(s[r]="<span class='fcn' id='"+n+"'>"+s[r]+"</span>");var l=extractVar(s[r]);null!==l&&(s[r]="<span class='var' id='"+l+"'>"+s[r]+"</span>");var c=extractOffset(s[r]);null!==c&&(s[r]="<span class='offset' id='"+parseInt(c,16)+"'>"+s[r]+"</span>")}var f=s.join("\n");return'<pre style="border-bottom:1px dashed white;" title="'+t+'" id="block'+t+'">'+f+"</pre>"}importScripts("/m/r2.js"),importScripts("/m/tools.js"),self.onmessage=function(t){if(t.data.offset<0)self.postMessage({offset:0,data:"before 0x00"});else{var a={offset:t.data.offset,size:t.data.size,data:getChunk(t.data.offset,t.data.size)};self.postMessage(a)}};

View File

@ -1,80 +1 @@
'use strict';
importScripts('/m/r2.js');
var howManyBytes;
var nbCols;
var configurationDone = false;
function hexPairToASCII(pair) {
var chr = parseInt(pair, 16);
if (chr >= 33 && chr <= 126) {
return String.fromCharCode(chr);
}
return '.';
};
function getChunk(howManyBytes, addr, nbCols) {
if (addr < 0) {
return {
offset: 0,
hex: [],
ascii: [],
flags: [],
modified: []
};
}
var raw;
// BUG? callback called more than once
r2.cmd('p8 ' + howManyBytes + ' @' + addr, function(d) {
raw = {
offset: addr,
hex: [],
ascii: [],
flags: [],
modified: []
};
var hex = [];
var ascii = '';
for (var myIt = 0 ; myIt < howManyBytes ; myIt++) {
var pair = d[myIt * 2] + d[(myIt * 2) + 1];
hex.push(pair);
ascii += hexPairToASCII(pair);
if (myIt % nbCols === nbCols-1) {
raw.hex.push(hex);
raw.ascii.push(ascii);
hex = [];
ascii = '';
}
}
});
r2.cmdj('fij ' + addr + ' ' + (addr + howManyBytes), function(d) {
raw.flags = d;
for (var i in raw.flags) {
raw.flags[i].size = parseInt(raw.flags[i].size);
}
});
return raw;
}
self.onmessage = function(e) {
if (!configurationDone || e.data.reset) {
// Providing block size (how many byte retrieved)
howManyBytes = e.data.howManyBytes;
nbCols = e.data.nbCols;
configurationDone = true;
} else {
// Sending the data from r2 (arg is start offset)
// TODO: handle "substract" if partial required (first)
var chunk = getChunk(howManyBytes, e.data.offset, nbCols);
chunk.dir = e.data.dir;
self.postMessage(chunk);
}
};
"use strict";function hexPairToASCII(a){var s=parseInt(a,16);return s>=33&&s<=126?String.fromCharCode(s):"."}function getChunk(a,s,e){if(s<0)return{offset:0,hex:[],ascii:[],flags:[],modified:[]};var n;return r2.cmd("p8 "+a+" @"+s,function(o){n={offset:s,hex:[],ascii:[],flags:[],modified:[]};for(var i=[],r="",t=0;t<a;t++){var f=o[2*t]+o[2*t+1];i.push(f),r+=hexPairToASCII(f),t%e===e-1&&(n.hex.push(i),n.ascii.push(r),i=[],r="")}}),r2.cmdj("fij "+s+" "+(s+a),function(a){n.flags=a;for(var s in n.flags)n.flags[s].size=parseInt(n.flags[s].size)}),n}importScripts("/m/r2.js");var howManyBytes,nbCols,configurationDone=!1;self.onmessage=function(a){if(!configurationDone||a.data.reset)howManyBytes=a.data.howManyBytes,nbCols=a.data.nbCols,configurationDone=!0;else{var s=getChunk(howManyBytes,a.data.offset,nbCols);s.dir=a.data.dir,self.postMessage(s)}};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,19 +1 @@
function E(x) {
return document.getElementById(x);
}
function encode(r) {
return r.replace(/[\x26\x0A\<>'"]/g, function(r) { return '&#' + r.charCodeAt(0) + ';';});
}
function clickableOffsets(x) {
x = x.replace(/0x([a-zA-Z0-9]*)/g,
'<a href=\'javascript:seek("0x$1")\'>0x$1</a>');
x = x.replace(/sym\.([\.a-zA-Z0-9_]*)/g,
'<a href=\'javascript:seek("sym.$1")\'>sym.$1</a>');
x = x.replace(/fcn\.([\.a-zA-Z0-9_]*)/g,
'<a href=\'javascript:seek("fcn.$1")\'>fcn.$1</a>');
x = x.replace(/str\.([\.a-zA-Z0-9_]*)/g,
'<a href=\'javascript:seek("str.$1")\'>str.$1</a>');
return x;
}
function E(e){return document.getElementById(e)}function encode(e){return e.replace(/[\x26\x0A\<>'"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})}function clickableOffsets(e){return e=e.replace(/0x([a-zA-Z0-9]*)/g,"<a href='javascript:seek(\"0x$1\")'>0x$1</a>"),e=e.replace(/sym\.([\.a-zA-Z0-9_]*)/g,"<a href='javascript:seek(\"sym.$1\")'>sym.$1</a>"),e=e.replace(/fcn\.([\.a-zA-Z0-9_]*)/g,"<a href='javascript:seek(\"fcn.$1\")'>fcn.$1</a>"),e=e.replace(/str\.([\.a-zA-Z0-9_]*)/g,"<a href='javascript:seek(\"str.$1\")'>str.$1</a>")}

View File

@ -1,2 +1,2 @@
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,i=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},a=/constructor/i.test(e.HTMLElement),f=/CriOS\/[\d]+/.test(navigator.userAgent),u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},d="application/octet-stream",s=1e3*40,c=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,s)},l=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(i){u(i)}}}},p=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromCharCode(65279),e],{type:e.type})}return e},v=function(t,u,s){if(!s){t=p(t)}var v=this,w=t.type,m=w===d,y,h=function(){l(v,"writestart progress write writeend".split(" "))},S=function(){if((f||m&&a)&&e.FileReader){var r=new FileReader;r.onloadend=function(){var t=f?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");var n=e.open(t,"_blank");if(!n)e.location.href=t;t=undefined;v.readyState=v.DONE;h()};r.readAsDataURL(t);v.readyState=v.INIT;return}if(!y){y=n().createObjectURL(t)}if(m){e.location.href=y}else{var o=e.open(y,"_blank");if(!o){e.location.href=y}}v.readyState=v.DONE;h();c(y)};v.readyState=v.INIT;if(o){y=n().createObjectURL(t);setTimeout(function(){r.href=y;r.download=u;i(r);h();c(y);v.readyState=v.DONE});return}S()},w=v.prototype,m=function(e,t,n){return new v(e,t||e.name||"download",n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(e,t,n){t=t||e.name||"download";if(!n){e=p(e)}return navigator.msSaveOrOpenBlob(e,t)}}w.abort=function(){};w.readyState=w.INIT=0;w.WRITING=1;w.DONE=2;w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null;return m}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!==null){define([],function(){return saveAs})}
var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,a=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},i=/constructor/i.test(e.HTMLElement)||e.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},s="application/octet-stream",d=1e3*40,c=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,d)},l=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(a){u(a)}}}},p=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromCharCode(65279),e],{type:e.type})}return e},v=function(t,u,d){if(!d){t=p(t)}var v=this,w=t.type,m=w===s,y,h=function(){l(v,"writestart progress write writeend".split(" "))},S=function(){if((f||m&&i)&&e.FileReader){var r=new FileReader;r.onloadend=function(){var t=f?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");var n=e.open(t,"_blank");if(!n)e.location.href=t;t=undefined;v.readyState=v.DONE;h()};r.readAsDataURL(t);v.readyState=v.INIT;return}if(!y){y=n().createObjectURL(t)}if(m){e.location.href=y}else{var o=e.open(y,"_blank");if(!o){e.location.href=y}}v.readyState=v.DONE;h();c(y)};v.readyState=v.INIT;if(o){y=n().createObjectURL(t);setTimeout(function(){r.href=y;r.download=u;a(r);h();c(y);v.readyState=v.DONE});return}S()},w=v.prototype,m=function(e,t,n){return new v(e,t||e.name||"download",n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(e,t,n){t=t||e.name||"download";if(!n){e=p(e)}return navigator.msSaveOrOpenBlob(e,t)}}w.abort=function(){};w.readyState=w.INIT=0;w.WRITING=1;w.DONE=2;w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null;return m}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!==null){define("FileSaver.js",function(){return saveAs})}

View File

@ -1,4 +0,0 @@
dialog{position:absolute;left:0;right:0;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;height:-moz-fit-content;height:-webkit-fit-content;height:fit-content;margin:auto;border:solid;padding:1em;background:white;color:black;display:none}
dialog[open]{display:block}dialog+.backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,0.1)}
@media screen and (max-width:540px){dialog[_polyfill_modal]{top:0;width:auto;margin:1em}
}._dialog_overlay{position:fixed;top:0;right:0;bottom:0;left:0}

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,3 @@
.mdl-selectfield{position:relative;font-size:16px;display:inline-block;box-sizing:border-box;width:300px;max-width:100%;margin:0;padding:20px 0}.mdl-selectfield--align-right{text-align:right}.mdl-selectfield--full-width{width:100%}.mdl-selectfield__select{display:block;width:100%;padding:4px 0;margin:0;color:inherit;background:transparent;font-size:16px;text-align:left;color:inherit;border:none;border-bottom:1px solid rgba(0,0,0, 0.12);border-radius:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.mdl-selectfield.is-focused .mdl-selectfield__select{outline:none}.mdl-selectfield.is-invalid .mdl-selectfield__select{border-color:rgb(222, 50, 38);box-shadow:none}fieldset[disabled] .mdl-selectfield .mdl-selectfield__select,.mdl-selectfield.is-disabled .mdl-selectfield__select{background-color:transparent;border-bottom:1px dotted rgba(0,0,0, 0.12);color:rgba(0,0,0, 0.26)}.mdl-selectfield__label{bottom:0;color:rgba(0,0,0, 0.26);font-size:16px;left:0;right:0;pointer-events:none;position:absolute;display:block;top:24px;width:100%;overflow:hidden;white-space:nowrap;text-align:left}.mdl-selectfield.is-dirty .mdl-selectfield__label{visibility:hidden}.mdl-selectfield--floating-label .mdl-selectfield__label{transition-duration:.2s;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}fieldset[disabled] .mdl-selectfield .mdl-selectfield__label,.mdl-selectfield.is-disabled.is-disabled .mdl-selectfield__label{color:rgba(0,0,0, 0.26)}.mdl-selectfield--floating-label.is-focused .mdl-selectfield__label,.mdl-selectfield--floating-label.is-dirty .mdl-selectfield__label{color:rgb(63,81,181);font-size:12px;top:4px;visibility:visible}.mdl-selectfield--floating-label.is-invalid .mdl-selectfield__label{color:rgb(222, 50, 38);font-size:12px}.mdl-selectfield__label:after{background-color:rgb(63,81,181);bottom:20px;content:'';height:2px;left:45%;position:absolute;transition-duration:.2s;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);visibility:hidden;width:10px}.mdl-selectfield.is-focused .mdl-selectfield__label:after{left:0;visibility:visible;width:100%}.mdl-selectfield.is-invalid .mdl-selectfield__label:after{background-color:rgb(222, 50, 38)}.mdl-selectfield__error{color:rgb(222, 50, 38);position:absolute;font-size:12px;margin-top:3px;visibility:hidden;display:block}.mdl-selectfield.is-invalid .mdl-selectfield__error{visibility:visible}
.mdl-selectfield{position:relative;font-size:16px;display:inline-block;box-sizing:border-box;width:300px;max-width:100%;margin:0;padding:20px 0}.mdl-selectfield--align-right{text-align:right}.mdl-selectfield--full-width{width:100%}.mdl-selectfield__select{display:block;width:100%;padding:4px 0;margin:0;color:inherit;background:transparent;font-size:16px;text-align:left;border:none;border-bottom:1px solid rgba(0,0,0, 0.12);border-radius:0;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none}.mdl-selectfield__select::-ms-expand{display:none}.mdl-selectfield.is-focused .mdl-selectfield__select{outline:none}.mdl-selectfield.is-invalid .mdl-selectfield__select{border-color:rgb(222, 50, 38);box-shadow:none}fieldset[disabled] .mdl-selectfield .mdl-selectfield__select,.mdl-selectfield.is-disabled .mdl-selectfield__select{background-color:transparent;border-bottom:1px dotted rgba(0,0,0, 0.12);color:rgba(0,0,0, 0.26)}.mdl-selectfield__label{bottom:0;color:rgba(0,0,0, 0.26);font-size:16px;left:0;right:0;pointer-events:none;position:absolute;display:block;top:24px;width:100%;overflow:hidden;white-space:nowrap;text-align:left}.mdl-selectfield.is-dirty .mdl-selectfield__label{visibility:hidden}.mdl-selectfield--floating-label .mdl-selectfield__label{transition-duration:0.2s;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}fieldset[disabled] .mdl-selectfield .mdl-selectfield__label,.mdl-selectfield.is-disabled.is-disabled .mdl-selectfield__label{color:rgba(0,0,0, 0.26)}.mdl-selectfield--floating-label.is-focused .mdl-selectfield__label,.mdl-selectfield--floating-label.is-dirty .mdl-selectfield__label{color:rgb(63,81,181);font-size:12px;top:4px;visibility:visible}.mdl-selectfield--floating-label.is-invalid .mdl-selectfield__label{color:rgb(222, 50, 38);font-size:12px}.mdl-selectfield__label:after{background-color:rgb(63,81,181);bottom:20px;content:'';height:2px;left:45%;position:absolute;transition-duration:0.2s;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);visibility:hidden;width:10px}.mdl-selectfield.is-focused .mdl-selectfield__label:after{left:0;visibility:visible;width:100%}.mdl-selectfield.is-invalid .mdl-selectfield__label:after{background-color:rgb(222, 50, 38)}.mdl-selectfield__error{color:rgb(222, 50, 38);position:absolute;font-size:12px;margin-top:3px;visibility:hidden;display:block}.mdl-selectfield.is-invalid .mdl-selectfield__error{visibility:visible}.mdl-selectfield__icon{bottom:20px;cursor:pointer;color:rgba(0,0,0, 0.26);padding:4px 0;position:absolute;top:20px;right:0;pointer-events:none}.mdl-selectfield__icon>i{outline:0}.mdl-selectfield.is-dirty .mdl-selectfield__icon{color:inherit}fieldset[disabled] .mdl-selectfield .mdl-selectfield__icon,.mdl-selectfield.is-disabled.is-disabled .mdl-selectfield__icon{color:rgba(0,0,0, 0.26)}.mdl-selectfield--floating-label.is-invalid .mdl-selectfield__icon{color:rgb(222, 50, 38)}
/*# sourceMappingURL=mdl-selectfield.min.css.map */

View File

@ -1,2 +1,2 @@
!function(){"use strict";var e=function(e){this.element_=e,this.init()};window.MaterialSelectfield=e,e.prototype.Constant_={},e.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"},e.prototype.onFocus_=function(e){this.element_.classList.add(this.CssClasses_.IS_FOCUSED)},e.prototype.onBlur_=function(e){this.element_.classList.remove(this.CssClasses_.IS_FOCUSED)},e.prototype.onReset_=function(e){this.updateClasses_()},e.prototype.updateClasses_=function(){this.checkDisabled(),this.checkValidity(),this.checkDirty()},e.prototype.checkDisabled=function(){this.select_.disabled?this.element_.classList.add(this.CssClasses_.IS_DISABLED):this.element_.classList.remove(this.CssClasses_.IS_DISABLED)},e.prototype.checkDisabled=e.prototype.checkDisabled,e.prototype.checkValidity=function(){this.select_.validity.valid?this.element_.classList.remove(this.CssClasses_.IS_INVALID):this.element_.classList.add(this.CssClasses_.IS_INVALID)},e.prototype.checkValidity=e.prototype.checkValidity,e.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)},e.prototype.checkDirty=e.prototype.checkDirty,e.prototype.disable=function(){this.select_.disabled=!0,this.updateClasses_()},e.prototype.disable=e.prototype.disable,e.prototype.enable=function(){this.select_.disabled=!1,this.updateClasses_()},e.prototype.enable=e.prototype.enable,e.prototype.change=function(e){e&&(this.select_.value=e),this.updateClasses_()},e.prototype.change=e.prototype.change,e.prototype.init=function(){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),this.updateClasses_(),this.element_.classList.add(this.CssClasses_.IS_UPGRADED)))},e.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:e,classAsString:"MaterialSelectfield",cssClass:"mdl-js-selectfield",widget:!0})}();
!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