我本质上正在尝试创建一个“信息亭”
我有一个 Web 应用程序,我希望它成为屏幕上唯一可访问的内容。我知道 chrome 有一个“kiosk”模式(快捷方式:chrome.exe --kiosk www.url.com)。这可以处理自动全屏,但禁用很少的快捷键(可能只有 f11)。
在互联网的帮助下,我编写了一些 javascript 来完成大部分工作。代码如下:
window.onload = function() {
window.document.body.onkeydown = function() {
if (event.ctrlKey) {
event.stopPropagation();
event.preventDefault();
try {
event.keyCode = 0; // this is a hack to capture ctrl+f ctrl+p etc
}
catch (event) {
}
return false;
}
return true; // for keys that weren't shortcuts (e.g. no ctrl) then the event is bubbled
}
}
Run Code Online (Sandbox Code Playgroud)
这可以处理 ctrl+f、ctrl+p 等操作。不幸的是,它不会禁用ctrl+t、ctrl+n、f5 等快捷键。
是否有可能禁用这些,或者我在这里追逐彩虹?我不在乎它是否是 javascript、设置等等,但我真的很想在没有插件的情况下完成它。
在对象函数(即 - .each())中使用jQuery方法时,"this"变量将引用正在迭代的对象.如何在没有"this"的情况下访问Object的功能?我意识到这有点令人困惑,所以:
test.prototype.init = function(node) {
node.children().each(function() {
//call test.anotherFunction() here
//Would normally call this.anotherFunction(),
// but "this" refers to the current child.
});
}
test.prototype.anotherFunction = function() {
//whatever
}
Run Code Online (Sandbox Code Playgroud)
救命?
这是我第一次使用Angular(和Karma),所以请原谅我这是一个初学者的问题:这就是我的意思.
我正在尝试运行Angular-phonecat测试,如步骤02 - 编写和运行测试中所述
我的代码直接从第2步分支(git checkout -f step-2)检出
运行test(angular-phonecat\scripts> test)时,我收到以下消息:
INFO [karma]: Karma v0.10.2 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 30.0.1599 (Windows 7)]: Connected on socket Jw-2z-zZ-pytGNN-SHRM
Chrome 30.0.1599 (Windows 7): Executed 0 of 0 ERROR (0.472 secs / 0 secs)
Run Code Online (Sandbox Code Playgroud)
没有给出更多的信息,我找不到任何可以详细说明问题的日志(/ test或其子目录中没有任何内容,也没有在/ logs中).我也找不到一般的业力日志 - 有一个吗?