Merge branch 'master' of https://github.com/BorisLevitskiy/bitwisecmd into gh-pages

This commit is contained in:
Borys Levytskyi
2015-04-06 20:12:26 +03:00
3 changed files with 10 additions and 10 deletions

View File

@@ -13,7 +13,7 @@ app.compose(function() {
this.viewElement.focus();
this.viewElement.addEventListener('keyup', function (args) {
var inpt = args.srcElement;
var inpt = args.target;
if (args.keyCode != 13 || inpt.value.trim().length == 0) {
return;
@@ -30,7 +30,7 @@ app.compose(function() {
if(args.keyCode == 38) {
if (self.history.length > self.historyIndex) { // up
args.srcElement.value = self.history[self.historyIndex++];
args.target.value = self.history[self.historyIndex++];
}
@@ -41,7 +41,7 @@ app.compose(function() {
if(args.keyCode == 40) {
if(self.historyIndex > 0) { // up
args.srcElement.value = self.history[--self.historyIndex];
args.target.value = self.history[--self.historyIndex];
}
args.preventDefault();

View File

@@ -39,8 +39,8 @@ app.compose(function () {
var binCell = row.insertCell();
binCell.className = 'bin';
decCell.innerText = o;
binCell.innerText = formatter.toBinaryString(o, maxLen);
decCell.textContent = o;
binCell.textContent = formatter.toBinaryString(o, maxLen);
});
colorizeBits(table);
@@ -86,7 +86,7 @@ app.compose(function () {
function colorizeBits(container) {
var list = container.querySelectorAll('.bin');
Array.prototype.forEach.call(list, function(el){
var bin = el.innerText;
var bin = el.textContent;
el.innerHTML = bin
.replace(/(\d{8})/g, '<span class="byte">$1</span>')

View File

@@ -33,11 +33,11 @@
element.checked = model[propertyName];
element.addEventListener('changed', function (e) {
model[propertyName] = e.srcElement.checked == true;
model[propertyName] = e.target.checked == true;
});
model.observe(propertyName, function (property, value) {
if (window.event && window.event.srcElement == element) {
if (window.event && window.event.target == element) {
return;
}
@@ -50,11 +50,11 @@
input.value = model[propertyName];
input.addEventListener('keyup', function (e) {
model[propertyName] = e.srcElement.value;
model[propertyName] = e.target.value;
});
model.observe(propertyName, function (property, value) {
if (window.event && window.event.srcElement == input) {
if (window.event && window.event.target == input) {
return;
}