小编zan*_*etu的帖子

在ui-dialog-buttonpane中添加搜索按钮和文本框

我正在编写一个greasemonkey脚本来操作DOM,查询服务器并在单独的jquery对话框中显示结果.我想为它添加以下两个功能:

  1. 提供一个搜索框,其作用类似于浏览器上的简单搜索(即仅搜索jquery对话框的内容并突出显示文本).
  2. 提供一个文本框,其内容应永久存储以供将来用户使用,除非用户明确更改.

我面临的问题是我想在对话框的ui-dialog-buttonpane区域中包含这两个区域,在关闭按钮的左侧,但我无法弄清楚如何做到这一点.

我所知道的是我可以使用window.find()(这里使用http://www.javascripter.net/faq/searchin.htm)来启用浏览器查找功能.

有人可以帮我弄这个吗 ?以下是我现有的greasemonkey脚本的代码:

// ==UserScript==
// @name        Query for each URL Asynchronously
// @namespace   SupportScript
// @include     *
// @require     https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
// @require     https://ajax.googleapis.com/ajax/libs/jquery/ui/1.11.0/jquery-ui.min.js
// @resource    jqUI_CSS  https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/themes/redmond/jquery-ui.css
// @grant       GM_addStyle
// @grant       GM_getResourceText
// @grant       GM_getResourceURL
// @run-at      document-end
// allow pasting
// ==/UserScript==

var snapshotResults = document.evaluate('//a[contains(@href,"http")]/@href', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
var windowWidth = $(window).width()-800;
var windowHeight = $(window).height();

var zNode = document.createElement ('input');
zNode.setAttribute ('id', 'SSButton');
zNode.setAttribute( …
Run Code Online (Sandbox Code Playgroud)

javascript jquery greasemonkey jquery-ui userscripts

8
推荐指数
1
解决办法
1229
查看次数

从变量中去除前缀​​ - bash

将 shell 脚本 (/bin/bash) 添加到自动化工作流(复制文件路径)我想用它从正在复制到剪贴板的变量路径中去除常量前缀“/Volumes/”。

EG 复制文件路径工作流将“/Volumes/GRAID/audiovideo.mov”复制到剪贴板,我希望粘贴的路径是“GRAID/audiovideo.mov”

bash strip prefix

3
推荐指数
1
解决办法
3656
查看次数