Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catch up #1

Open
wants to merge 68 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
b217f29
starting advanced branch
cantino Dec 17, 2010
0731511
initial commit of jasmine with new version of SG
cantino Dec 20, 2010
e6197f8
working bookmarklet
cantino Dec 21, 2010
a1c10e2
remove comment
cantino Dec 24, 2010
2f93e10
rename css classes
cantino Dec 24, 2010
be24b99
jasmine works and specs are passing
cantino Aug 22, 2012
44fe073
license update
cantino Aug 22, 2012
5534347
rename sites to test_sites
cantino Aug 22, 2012
dc36147
move jasmine
cantino Aug 26, 2012
f90e12b
sprockets
Aug 26, 2012
00e75f4
specs passing in coffeescript
Aug 26, 2012
b558d68
fix bookmarklet
Aug 27, 2012
8f7a56f
translated dom.js into coffeescript
Aug 27, 2012
3b8354f
core.js translated to coffeescript
Aug 27, 2012
b571145
gitignore
cantino Nov 14, 2012
4b0171a
updated screencast
cantino Nov 14, 2012
c691c5b
update for s3
cantino Jun 2, 2013
eae7ddb
use static
cantino Jun 2, 2013
d62c5c8
use cloudfront instead
cantino Jun 2, 2013
31f0df1
update
cantino Jun 2, 2013
b7520e2
update stable
cantino Jun 2, 2013
0b579e9
convert .rvmrc
cantino Jun 2, 2013
06673a4
todo
cantino Jun 1, 2013
669ce36
Merge remote-tracking branch 'origin/master' into advanced
cantino Jun 2, 2013
d651929
Merge branch 'master' into advanced
cantino Jun 2, 2013
02512a8
this path should not be changed
cantino Jun 2, 2013
b93c91c
ignore the bin directory when uploading
cantino Jun 2, 2013
603917f
Merge branch 'master' into advanced
cantino Jun 3, 2013
f29e215
update Guard and bookmarklets
cantino Jun 3, 2013
091d862
updated bookmarklets to use fully bundled output
cantino Jun 15, 2013
26010cb
do not ship the wizard in the bookmarklet
cantino Jun 15, 2013
55294a2
update help and remove unused options
cantino Jun 15, 2013
2e20977
update unstable version date
cantino Jun 15, 2013
0dabdae
update README
cantino Jun 15, 2013
28d91bf
update CHANGES
cantino Jun 15, 2013
cb7ddbe
basic chrome extension
cantino Jun 17, 2013
d163da7
add brief explanation of remote interface feature
eugeneotto Jul 21, 2013
3cb9c8a
fix calls to $ alias in remote ui example
eugeneotto Jul 24, 2013
e34f80e
Merge pull request #7 from eugeneotto/remote-interface-docs
cantino Jul 26, 2013
015ecf6
Merge branch 'master' into chrome
cantino Aug 7, 2013
93a7e9b
update manifest and images
cantino Aug 7, 2013
ec097eb
starting listing
cantino Aug 7, 2013
2c72338
verify site; add favicon
cantino Aug 7, 2013
0e02dfa
link to chrome extension
cantino Aug 7, 2013
f4f0880
Add a Bitdeli badge to README
bitdeli-chef Dec 3, 2013
d837c26
Merge pull request #9 from bitdeli-chef/master
cantino Dec 3, 2013
b1dbf7a
:content was replaced with :contains
dortonway Jun 21, 2014
60f4a45
Merge pull request #12 from dortonway/master
cantino Jul 4, 2014
68c7ed9
remove the content and contains selectors
cantino Mar 21, 2015
b671c6a
Merge pull request #17 from cantino/remove_content_selector2
cantino Mar 21, 2015
57a6e1f
guess mime-types
cantino Mar 21, 2015
4791f7b
force
cantino Mar 21, 2015
0308db8
bump
cantino Mar 21, 2015
2a1483b
force change
cantino Mar 21, 2015
f01a840
no remte MD5 checks when pushing to s3
cantino Mar 21, 2015
208488c
update chrome
cantino Mar 21, 2015
abde672
Correct jasmine link in README.md
methuz Jun 4, 2015
1129df0
Only show the word jasmine and link to the correct jasmine repository
methuz Jun 4, 2015
2c9f311
Merge pull request #19 from methuz/master
cantino Jun 5, 2015
174bead
Update website links to https
cantino Jun 21, 2018
bf7a34f
Merge branch 'master' of github.com:cantino/selectorgadget
cantino May 17, 2020
c8732d6
Remove tab
cantino May 30, 2022
5d4eb2a
Upgrade jquery
cantino Jul 31, 2022
5aa2e8a
Upgrade ruby
cantino Jul 31, 2022
fdd6ac5
Extension version v3
cantino Jul 31, 2022
10b8d1b
Updated code
cantino Jul 31, 2022
cc15553
Fix guard pattern issue
cantino Jan 21, 2023
6aa7560
Merge pull request #37 from cantino/fix-guard
cantino Jan 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea
.DS_Store
extension.zip
.sass-cache
1 change: 1 addition & 0 deletions .ruby-gemset
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
selectorgadget
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.2
7 changes: 7 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Release 0.6
- Re-written in CoffeeScript
- Built with guard
- Advanced "wizard flow" code added to repository
Release 0.5
- MIT license
- New selector engine
Release 0.4.1
- All copyright holders need to agree to license, temporarily in license limbo.
Release 0.4.0
Expand Down
13 changes: 13 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# A sample Gemfile
source "https://rubygems.org"

gem 'guard'
gem 'coffee-script'
gem 'sass'
gem 'uglifier'
gem 'yui-compressor'

gem 'guard-coffeescript', :require => false
gem 'guard-sass', :require => false
gem 'guard-shell', :require => false
gem 'guard-concat', :git => 'https://github.com/makevoid/guard-concat'
80 changes: 80 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
GIT
remote: https://github.com/makevoid/guard-concat
revision: 7193fac560f2adda12fb1f8860b80c53a2fbb68d
specs:
guard-concat (0.8.1)
guard (~> 2.0)

GEM
remote: https://rubygems.org/
specs:
coderay (1.1.3)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
execjs (2.8.1)
ffi (1.15.5)
formatador (1.1.0)
guard (2.18.0)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
lumberjack (>= 1.0.12, < 2.0)
nenv (~> 0.1)
notiffany (~> 0.0)
pry (>= 0.13.0)
shellany (~> 0.0)
thor (>= 0.18.1)
guard-coffeescript (2.0.1)
coffee-script (>= 2.2.0)
guard (>= 2.1.0)
guard-compat (~> 1.1)
guard-compat (1.2.1)
guard-sass (1.6.1)
guard (>= 2.8.0)
sass (>= 3.1)
guard-shell (0.7.2)
guard (>= 2.0.0)
guard-compat (~> 1.0)
listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
lumberjack (1.2.8)
method_source (1.0.0)
nenv (0.3.0)
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
shellany (0.0.1)
thor (1.2.1)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
yui-compressor (0.12.0)

PLATFORMS
ruby

DEPENDENCIES
coffee-script
guard
guard-coffeescript
guard-concat!
guard-sass
guard-shell
sass
uglifier
yui-compressor

BUNDLED WITH
2.3.7
41 changes: 41 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme

require 'uglifier'
require 'yui/compressor'
require 'fileutils'

# Specs
guard 'coffeescript', :input => 'spec', :output => 'spec/compiled', :patterns => [%r{^.+\.(?:coffee|coffee\.md|litcoffee)$}], :all_on_start => true

# Core Code

FileUtils.mkdir_p File.join(File.dirname(__FILE__), 'build', 'js')
FileUtils.mkdir_p File.join(File.dirname(__FILE__), 'build', 'css')

guard 'coffeescript', :input => 'lib/js', :output => 'build/js', :patterns => [%r{^.+\.(?:coffee|coffee\.md|litcoffee)$}], :all_on_start => true
guard 'sass', :input => 'lib/css', :output => 'build/css', :all_on_start => true, :line_numbers => true

guard 'concat',
:all_on_start => true,
:type => "js",
:files => %w(vendor/jquery build/js/jquery-include vendor/diff/diff_match_patch build/js/dom build/js/core),
:input_dir => ".",
:output => "build/selectorgadget_combined"

guard 'concat',
:all_on_start => true,
:type => "css",
:files => %w(build/css/selectorgadget),
:input_dir => ".",
:output => "build/selectorgadget_combined"

guard :shell, :all_on_start => true do
# Minify JS
watch %r{build/selectorgadget_combined.js} do |m|
puts "Compressing build/selectorgadget_combined.js"
File.open("build/selectorgadget_combined.min.js", 'w') do |file|
file.print Uglifier.compile(File.read('build/selectorgadget_combined.js'))
end
end
end
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The MIT License

Copyright (c) 2010 Andrew Cantino and Kyle Maxwell
Copyright (c) 2013 Andrew Cantino
Copyright (c) 2009 Kyle Maxwell

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 0 additions & 3 deletions README.markdown

This file was deleted.

92 changes: 92 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# SelectorGadget

[SelectorGadget](http://www.selectorgadget.com) is an open source bookmarklet that makes CSS selector generation and discovery on complicated sites a breeze.

Please visit [http://www.selectorgadget.com](http://www.selectorgadget.com) to try it out.

# Technologies

* CoffeeScript
* jQuery
* [diff-match-patch](https://code.google.com/p/google-diff-match-patch/)

# Features

## Remote interface

SelectorGadget 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:

```javascript
// 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:

```javascript
window.sg_options = {
remote_interface: '/path/to/sg_interface.js'
}

window.selector_gadget = new SelectorGadget()
// ...

```

# Local Development

## Compiling

Start by installing development dependencies with

bundle

and then run

guard

to watch and regenerate SelectorGadget's `.coffee` and `.scss` files.

## Testing

SelectorGadget is tested with [jasmine](http://github.com/jasmine/jasmine/). With guard running,
open _spec/SpecRunner.html_ in your browser to run the tests. (On a Mac, just do `open spec/SpecRunner.html`)

To manually test during local development, `open spec/test_sites/bookmarklet_local.html` and use that local bookmarklet on the contents of _spec/test\_sites_.


[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/cantino/selectorgadget/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

3 changes: 0 additions & 3 deletions TODO

This file was deleted.

6 changes: 6 additions & 0 deletions bin/bundle_chrome.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh

cp build/selectorgadget_combined.css chrome/combined.css
cat chrome/header.js build/selectorgadget_combined.min.js chrome/footer.js > chrome/combined.js
rm -f extension.zip
zip -r extension.zip chrome
13 changes: 13 additions & 0 deletions bin/upload_to_s3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env sh

cd /tmp
if [ -e tmp-sg ]; then
cd tmp-sg && git reset --hard && git clean -df && git fetch && git checkout origin/master
else
git clone [email protected]:cantino/selectorgadget.git tmp-sg
cd tmp-sg
fi
s3cmd sync --no-check-md5 --cf-invalidate -M --no-mime-magic --delete-removed --rexclude=^.git\|^sites\|^test\|^bin . s3://selectorgadget.com/unstable/
s3cmd put --no-check-md5 --cf-invalidate -M --no-mime-magic doc/* s3://selectorgadget.com
git reset --hard && git clean -df && git checkout 0.4.2
s3cmd sync --no-check-md5 --cf-invalidate -M --no-mime-magic --delete-removed --rexclude=^.git\|^sites\|^test\|^bin . s3://selectorgadget.com/stable/
Loading