add bluebirdjs promises, inject some helpful methods in array

10.3.x-maintenance
nathan 2016-06-24 02:02:46 -07:00
parent 46c36048bb
commit 3f8fd78027
3 changed files with 45 additions and 0 deletions

12
js/injected_methods.js Normal file
View File

@ -0,0 +1,12 @@
Array.prototype.push8 = function(val) {
this.push(0xFF & val);
return this;
};
Array.prototype.push16 = function(val) {
// low byte
this.push(0x00FF & val);
// high byte
this.push(val >> 8);
// chainable
return this;
};

31
js/libraries/bluebird.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -44,6 +44,8 @@
<script type="text/javascript" src="./js/libraries/semver.js"></script>
<script type="text/javascript" src="./js/libraries/jbox/jBox.min.js"></script>
<script type="text/javascript" src="./js/libraries/switchery/switchery.js"></script>
<script type="text/javascript" src="./js/libraries/bluebird.min.js"></script>
<script type="text/javascript" src="./js/injected_methods.js"></script>
<script type="text/javascript" src="./js/port_handler.js"></script>
<script type="text/javascript" src="./js/port_usage.js"></script>
<script type="text/javascript" src="./js/serial.js"></script>