Skip to content
Browse files

Added icons. Made sure invisible links aren't selected. Bumped to 1.0.4.

  • Loading branch information...
1 parent 9b25800 commit 77a000a611f5b77498973875dfcd6046382d5dc7 @dbergey dbergey committed Jul 13, 2010
View
4 typetonavigate.safariextension/Info.plist
@@ -11,9 +11,9 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleShortVersionString</key>
- <string>1.0.3</string>
+ <string>1.0.4</string>
<key>CFBundleVersion</key>
- <string>42</string>
+ <string>43</string>
<key>Chrome</key>
<dict>
<key>Global Page</key>
View
BIN typetonavigate.safariextension/icon-100.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN typetonavigate.safariextension/icon-32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN typetonavigate.safariextension/icon-48.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN typetonavigate.safariextension/icon-64.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
14 typetonavigate.safariextension/injection.js
@@ -75,8 +75,8 @@ var TTNInjection = (function() {
},
createHiddenElementWithTagNameAndContents: function(tagName, contents) {
var hiddenEl = document.createElement(tagName);
- // hiddenEl.style.position = 'absolute';
- // hiddenEl.style.top = '-1000px';
+ hiddenEl.style.position = 'absolute';
+ hiddenEl.style.top = '-1000px';
if (contents) hiddenEl.innerHTML = contents;
document.getElementsByTagName('body')[0].appendChild(hiddenEl);
return hiddenEl;
@@ -129,6 +129,7 @@ var TTNInjection = (function() {
return s.rangeCount && this.trim(String(s).toLowerCase()) == this.trim(this.nextSearchString.toLowerCase());
},
hijackCopyWith: function(textToCopy) {
+
// get current selection
var s = window.getSelection();
var currentSelection = s.getRangeAt(0);
@@ -172,8 +173,9 @@ var TTNInjection = (function() {
if ( e.character == 'G' && e.cmdKey ) {
window.find(this.nextSearchString, false, e.shiftKey, true, false, true, false);
- // make sure we're not now IN indicator div, if so find again
- if ( this.indicator && this.trim(s.anchorNode.parentNode.tagName) == this.trim(this.indicatorInner.tagName) )
+ // find again if we're now IN indicator div, or selected something invisible
+ // or selected something not in viewport (FIXME - NOT YET)
+ if ( (this.indicator && this.trim(s.anchorNode.parentNode.tagName) == this.trim(this.indicatorInner.tagName)) || !s.anchorNode.parentNode.offsetHeight)
window.find(this.nextSearchString, false, e.shiftKey, true, false, true, false);
var color = this.focusSelectedLink(this.nextSearchString);
@@ -200,7 +202,7 @@ var TTNInjection = (function() {
}
},
handleCopy: function(e) {
- if ( this.selectedTextEqualsNextSearchString() ) {
+ if ( document.activeElement && document.activeElement.tagName == 'A' && this.selectedTextEqualsNextSearchString() ) {
this.hijackCopyWith(e.srcElement.href);
this.displayInIndicator('URL copied', ' (⌘C)', 'blue');
}
@@ -318,7 +320,7 @@ var TTNInjection = (function() {
window.addEventListener('beforecopy', function(e) {
TTNInjection.handleCopy(e);
- });
+ }, true);
}
};
})();
View
BIN typetonavigate.safariextz
Binary file not shown.
View
4 updates_safari.plist
@@ -10,9 +10,9 @@
<key>Developer Identifier</key>
<string>5T4VZ78WA4</string>
<key>CFBundleVersion</key>
- <string>42</string>
+ <string>43</string>
<key>CFBundleShortVersionString</key>
- <string>1.0.3</string>
+ <string>1.0.4</string>
<key>URL</key>
<string>http://dbergey.github.com/Type-To-Navigate/typetonavigate.safariextz</string>
</dict>

0 comments on commit 77a000a

Please sign in to comment.
Something went wrong with that request. Please try again.