小编Mar*_*ski的帖子

使用Bash for Windows复制到剪贴板

如何将命令行中的结果直接复制到剪贴板?

在Windows的cmd.exe上,我可以简单地echo "asd" | clip将输出管道输出到剪贴板.

我试图为此安装xclip,虽然它已编译,但在调用时会打印:

Error: Can't open display: (null)
Run Code Online (Sandbox Code Playgroud)

使用鼠标不是解决方案.

windows command-line windows-subsystem-for-linux

29
推荐指数
2
解决办法
8651
查看次数

如何正确销毁CKEditor实例?

我在一个非常简单的页面上运行CKeditor 3.4.我有一个问题(有时),当我调用document.main_form.submit()时,它不会发送textarea的内容.经过一些阅读,听起来像CKeditor没有正确破坏.我在保存表单之前尝试手动销毁它,但无法调用它.奇怪的是,它有时会起作用,但不会起作用.我在Chrome上,因此可能会搞砸事情,但在Firefox中也会发生同样的事情.

如何正确销毁CKeditor,以便它始终在POST中发送textarea数据.谢谢!

javascript ckeditor

26
推荐指数
5
解决办法
5万
查看次数

给定元素中屏幕阅读器的替代文本

我有一个应用程序的热键列表,其中键盘箭头用unicode字符表示,例如?.我理解屏幕阅读器没有阅读这些字符的原因.因此我想为这些案例提供自定义文本.

我的问题是什么是使屏幕阅读器读取"j或down"而不是"j或[pause]"的最简洁方法.

我尝试了多种方法,所有方法都列在下面的代码中:

<style>
    .readerOnly
    {
        position:absolute;
        left:-10000px;
        top:auto;
        width:1px;
        height:1px;
        overflow:hidden;
    }
</style>
<h1>A sample list of app hotkeys</h1>

<dl>
    <dt>
        <kbd>j</kbd> or <kbd>?</kbd>
    </dt>
    <dd>
        Move down.
        <!--Well, it's a vanilla HTML, but SRs have problem reading the ? character.-->
    </dd>
    <dt>
        <span aria-label="shortcut j or down." class="lo">j or ?</span>
    </dt>
    <dd>
        Move down.
        <!--This is how Google does it in their Drive - I was thinking about similar solution, but well... it's not working with …
Run Code Online (Sandbox Code Playgroud)

accessibility wai-aria

6
推荐指数
1
解决办法
258
查看次数

使用fetch-mock模拟一个zip响应

我试过以下代码:

require( 'isomorphic-fetch' );

const fetchMock = require( 'fetch-mock' ),
    fsp = require( 'fs-promise' ),
    unzip = require( 'unzip' ),
    rimraf = require( 'rimraf-then' ),
    path = require( 'path' );

let zipLink = 'https://github.com/stevemao/left-pad/archive/master.zip',
    out = 'left-pad-master';

// Careful: lib might be removed at any moment.
fetchMock.get( zipLink,
    fsp.createReadStream( path.join( __dirname, 'left-pad-master.zip' ) ) );

rimraf( out )
    .then( () => fetch( zipLink ) )
    .then( response => {
        return new Promise( ( resolve, reject ) => {
            // For …
Run Code Online (Sandbox Code Playgroud)

mocking fetch node.js

5
推荐指数
1
解决办法
381
查看次数

CKFinder TypeError:t.event.special.swipe未定义

在Firefox 44.0上使用CKFinder 3.2.0时收到以下错误.它仅在Firefox上发生,在Chrome上完全正常.

知道什么可能导致它以及如何解决它?

TypeError: t.event.special.swipe is undefined
Stack trace:
CKFinder</<._setup/</<.init@https://10.10.10.20/ckfinder/ckfinder.js:8:8
CKFinder</<._setup/</<.start/</<@https://10.10.10.20/ckfinder/ckfinder.js:19:9706
newContext/y.execCb@https://10.10.10.20/ckfinder/ckfinder.js:5:26980
newContext/C.prototype.check@https://10.10.10.20/ckfinder/ckfinder.js:5:20584
newContext/C.prototype.enable@https://10.10.10.20/ckfinder/ckfinder.js:5:23528
newContext/C.prototype.init@https://10.10.10.20/ckfinder/ckfinder.js:5:19790
o/<@https://10.10.10.20/ckfinder/ckfinder.js:5:25339
setTimeout handler*CKFinder</<._setup/</</req.nextTick<@https://10.10.10.20/ckfinder/ckfinder.js:5:29067
o@https://10.10.10.20/ckfinder/ckfinder.js:5:25278
CKFinder</<._setup/</</requirejs@https://10.10.10.20/ckfinder/ckfinder.js:5:28955
CKFinder</<._setup/</<.start/<@https://10.10.10.20/ckfinder/ckfinder.js:19:9598
n.Callbacks/j@https://10.10.10.20/ckfinder/libs/jquery.js?ver=js6uhv:2:26920
n.Callbacks/k.fireWith@https://10.10.10.20/ckfinder/libs/jquery.js?ver=js6uhv:2:27738
.Deferred/</e[f[0]]@https://10.10.10.20/ckfinder/libs/jquery.js?ver=js6uhv:2:28704
CKFinder</<._setup/</r.init/<@https://10.10.10.20/ckfinder/ckfinder.js:7:29367
s@https://10.10.10.20/ckfinder/ckfinder.js:7:27199
newContext/y.execCb@https://10.10.10.20/ckfinder/ckfinder.js:5:26980
newContext/C.prototype.check@https://10.10.10.20/ckfinder/ckfinder.js:5:20584
newContext/C.prototype.enable/</<@https://10.10.10.20/ckfinder/ckfinder.js:5:23189
bind/<@https://10.10.10.20/ckfinder/ckfinder.js:5:14778
newContext/C.prototype.emit/<@https://10.10.10.20/ckfinder/ckfinder.js:5:23667
each@https://10.10.10.20/ckfinder/ckfinder.js:5:14253
newContext/C.prototype.emit@https://10.10.10.20/ckfinder/ckfinder.js:5:23635
newContext/C.prototype.check@https://10.10.10.20/ckfinder/ckfinder.js:5:21305
newContext/C.prototype.enable@https://10.10.10.20/ckfinder/ckfinder.js:5:23528
newContext/C.prototype.init@https://10.10.10.20/ckfinder/ckfinder.js:5:19790
newContext/C.prototype.callPlugin/</r<@https://10.10.10.20/ckfinder/ckfinder.js:5:22166
bind/<@https://10.10.10.20/ckfinder/ckfinder.js:5:14778
CKFinder</<._setup/</t.finishLoad@https://10.10.10.20/ckfinder/ckfinder.js:9:24377
CKFinder</<._setup/</t.load/<@https://10.10.10.20/ckfinder/ckfinder.js:9:24651
CKFinder</<._setup/</t.get/s.onreadystatechange@https://10.10.10.20/ckfinder/ckfinder.js:9:25864
EventHandlerNonNull*CKFinder</<._setup/</t.get@https://10.10.10.20/ckfinder/ckfinder.js:9:25720
CKFinder</<._setup/</t.load@https://10.10.10.20/ckfinder/ckfinder.js:9:24631
newContext/C.prototype.callPlugin/<@https://10.10.10.20/ckfinder/ckfinder.js:5:22740
bind/<@https://10.10.10.20/ckfinder/ckfinder.js:5:14778
u@https://10.10.10.20/ckfinder/ckfinder.js:5:17104
newContext/C.prototype.callPlugin@https://10.10.10.20/ckfinder/ckfinder.js:5:21493
newContext/C.prototype.fetch@https://10.10.10.20/ckfinder/ckfinder.js:5:20194
newContext/C.prototype.check@https://10.10.10.20/ckfinder/ckfinder.js:5:21399
newContext/C.prototype.enable@https://10.10.10.20/ckfinder/ckfinder.js:5:23528
newContext/y.enable@https://10.10.10.20/ckfinder/ckfinder.js:5:26027
newContext/C.prototype.enable/<@https://10.10.10.20/ckfinder/ckfinder.js:5:23388
bind/<@https://10.10.10.20/ckfinder/ckfinder.js:5:14778
each@https://10.10.10.20/ckfinder/ckfinder.js:5:14253
newContext/C.prototype.enable@https://10.10.10.20/ckfinder/ckfinder.js:5:22878
newContext/C.prototype.init@https://10.10.10.20/ckfinder/ckfinder.js:5:19790
o/<@https://10.10.10.20/ckfinder/ckfinder.js:5:25339
setTimeout handler*CKFinder</<._setup/</</req.nextTick<@https://10.10.10.20/ckfinder/ckfinder.js:5:29067
o@https://10.10.10.20/ckfinder/ckfinder.js:5:25278
CKFinder</<._setup/</</requirejs@https://10.10.10.20/ckfinder/ckfinder.js:5:28955
i@https://10.10.10.20/ckfinder/ckfinder.js:7:27411
CKFinder</<._setup/</r.init@https://10.10.10.20/ckfinder/ckfinder.js:7:27819
CKFinder</<._setup/</<.start@https://10.10.10.20/ckfinder/ckfinder.js:19:9399
o/<@https://10.10.10.20/ckfinder/ckfinder.js:19:12310
newContext/y.execCb@https://10.10.10.20/ckfinder/ckfinder.js:5:26980
newContext/C.prototype.check@https://10.10.10.20/ckfinder/ckfinder.js:5:20584
newContext/C.prototype.enable/</<@https://10.10.10.20/ckfinder/ckfinder.js:5:23189
bind/<@https://10.10.10.20/ckfinder/ckfinder.js:5:14778
newContext/C.prototype.emit/<@https://10.10.10.20/ckfinder/ckfinder.js:5:23667
each@https://10.10.10.20/ckfinder/ckfinder.js:5:14253
newContext/C.prototype.emit@https://10.10.10.20/ckfinder/ckfinder.js:5:23635
newContext/C.prototype.check@https://10.10.10.20/ckfinder/ckfinder.js:5:21305
newContext/C.prototype.enable/</<@https://10.10.10.20/ckfinder/ckfinder.js:5:23189
bind/<@https://10.10.10.20/ckfinder/ckfinder.js:5:14778
newContext/C.prototype.emit/<@https://10.10.10.20/ckfinder/ckfinder.js:5:23667
each@https://10.10.10.20/ckfinder/ckfinder.js:5:14253
newContext/C.prototype.emit@https://10.10.10.20/ckfinder/ckfinder.js:5:23635
newContext/C.prototype.check@https://10.10.10.20/ckfinder/ckfinder.js:5:21305 …
Run Code Online (Sandbox Code Playgroud)

javascript jquery ckeditor ckfinder jquery-mobile

0
推荐指数
1
解决办法
202
查看次数