在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:cantino/selectorgadget开源软件地址:https://github.com/cantino/selectorgadget开源编程语言:HTML 52.4%开源软件介绍:SelectorGadgetSelectorGadget is an open source bookmarklet that makes CSS selector generation and discovery on complicated sites a breeze. Please visit http://www.selectorgadget.com to try it out. Technologies
FeaturesRemote interfaceSelectorGadget can be extended for use in custom workflows with a remote interface that replaces the standard display and controls. To define a remote interface, create a JavaScript file with any functionality you need, and append any relevant controls to SelectorGadget's UI container. Here's a simple example: // sg_interface.js
var SG = window.selector_gadget
// Add field to display current selection (note the use of jQuerySG,
// SelectorGadget's jQuery alias).
var path = jQuerySG('<input>', { id: 'sg-status', class: 'selectorgadget_ignore' })
SG.sg_div.append(path)
SG.path_output_field = path.get(0)
// Add button to dismiss SelectorGadget
var btnOk = jQuerySG('<button>', { id: 'sg-ok', class: 'selectorgadget_ignore' }).text('OK')
SG.sg_div.append(btnOk)
jQuerySG(btnOk).bind('click', function(event) {
jQuerySG(SG).unbind()
jQuerySG(SG.sg_div).unbind()
SG.unbindAndRemoveInterface()
SG = null
})
// Watch the input field for changes
var val = saved = path.val()
var tid = setInterval(function() {
val = path.val()
if(saved != val) {
console.log('New path', val, 'matching', (jQuerySG(val).length), 'element(s)')
saved = val
}
}, 50) Set the path to the remote interface in SelectorGadget's sg_options object prior to instantiation, like this: window.sg_options = {
remote_interface: '/path/to/sg_interface.js'
}
window.selector_gadget = new SelectorGadget()
// ... Local DevelopmentCompilingStart by installing development dependencies with
and then run
to watch and regenerate SelectorGadget's TestingSelectorGadget is tested with jasmine. With guard running,
open spec/SpecRunner.html in your browser to run the tests. (On a Mac, just do To manually test during local development, |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论