dial down logging
parent
00c0737b0e
commit
a56a346343
|
@ -19,10 +19,10 @@ angular.module('RoomController', ['ngSanitize'])
|
||||||
.directive('ngAutoComplete', ['$timeout', function ($timeout) {
|
.directive('ngAutoComplete', ['$timeout', function ($timeout) {
|
||||||
return function (scope, element, attrs) {
|
return function (scope, element, attrs) {
|
||||||
element.bind("keydown keypress", function (event) {
|
element.bind("keydown keypress", function (event) {
|
||||||
console.log("event: " + event.which);
|
// console.log("event: " + event.which);
|
||||||
if (event.which === 9) {
|
if (event.which === 9) {
|
||||||
if (!scope.autoCompleting) { // cache our starting text
|
if (!scope.autoCompleting) { // cache our starting text
|
||||||
console.log("caching " + element[0].value);
|
// console.log("caching " + element[0].value);
|
||||||
scope.autoCompleteOriginal = element[0].value;
|
scope.autoCompleteOriginal = element[0].value;
|
||||||
scope.autoCompleting = true;
|
scope.autoCompleting = true;
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ angular.module('RoomController', ['ngSanitize'])
|
||||||
var targetIndex = scope.autoCompleteIndex;
|
var targetIndex = scope.autoCompleteIndex;
|
||||||
var text = scope.autoCompleteOriginal;
|
var text = scope.autoCompleteOriginal;
|
||||||
|
|
||||||
console.log("targetIndex: " + targetIndex + ", text=" + text);
|
// console.log("targetIndex: " + targetIndex + ", text=" + text);
|
||||||
|
|
||||||
// FIXME: use the correct regexp to recognise userIDs
|
// FIXME: use the correct regexp to recognise userIDs
|
||||||
var search = /@?([a-zA-Z0-9_\-:\.]+)$/.exec(text);
|
var search = /@?([a-zA-Z0-9_\-:\.]+)$/.exec(text);
|
||||||
|
@ -49,7 +49,7 @@ angular.module('RoomController', ['ngSanitize'])
|
||||||
element[0].value = text;
|
element[0].value = text;
|
||||||
}
|
}
|
||||||
else if (search && search[1]) {
|
else if (search && search[1]) {
|
||||||
console.log("search found: " + search);
|
// console.log("search found: " + search);
|
||||||
var expansion;
|
var expansion;
|
||||||
|
|
||||||
// FIXME: could do better than linear search here
|
// FIXME: could do better than linear search here
|
||||||
|
@ -83,7 +83,7 @@ angular.module('RoomController', ['ngSanitize'])
|
||||||
element[0].className = "";
|
element[0].className = "";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log("wrapped!");
|
// console.log("wrapped!");
|
||||||
element[0].className = "blink"; // XXX: slightly naughty to bypass angular
|
element[0].className = "blink"; // XXX: slightly naughty to bypass angular
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
element[0].className = "";
|
element[0].className = "";
|
||||||
|
|
Loading…
Reference in New Issue