This repository has been archived by the owner on Oct 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 942
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into brian/play-button
- Loading branch information
Showing
7 changed files
with
51 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
#shorten-url { | ||
text-align: center; | ||
.zci--shorten input.tag { | ||
-webkit-user-select: text; | ||
-khtml-user-select: text; | ||
-moz-user-select: text; | ||
-ms-user-select: text; | ||
user-select: text; | ||
line-height: 1; | ||
font-size: 1.25em; | ||
vertical-align: middle | ||
} | ||
|
||
div.clear { | ||
clear: both; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
{{#if mobile}} | ||
Share: <a id="shorten-url-mobile" href="{{shorturl}}">{{shorturl}}</a> | ||
{{else}} | ||
Share: <input id="shorten-url" readonly="readonly" value="{{shorturl}}"> | ||
{{/if}} | ||
Shortened URL: <input id='shorten-url' class='tag' readonly='readonly' value='{{shorturl}}'> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,31 @@ | ||
function ddg_spice_shorten(api_result) { | ||
(function(env) { | ||
"use strict"; | ||
env.ddg_spice_shorten = function (api_result) { | ||
// Exit immediately if we find an error message. | ||
if (!api_result || !api_result.shorturl || api_result.errorcode) { | ||
return Spice.failed('shorten'); | ||
} | ||
|
||
// Exit immediately if we find an error message. | ||
if (!api_result || !api_result.shorturl || api_result.errorcode) { | ||
return; | ||
} | ||
Spice.add({ | ||
id: 'shorten', | ||
data: api_result, | ||
name: 'Shortened Link', | ||
meta: { | ||
sourceUrl : 'http://is.gd/', | ||
sourceName : 'is.gd', | ||
}, | ||
templates: { | ||
group: 'text', | ||
options: { | ||
content: Spice.shorten.shorten | ||
} | ||
}, | ||
}); | ||
|
||
// Check if it is a mobile browser (needs work). This was inspired by is.gd. | ||
api_result.mobile = false; | ||
if(window.navigator.userAgent.match(/Android|iPhone|iPad|iPod/i)) { | ||
api_result.mobile = true; | ||
// If we displayed an input box, make sure we focus on it. | ||
var url = $('.zci--shorten input.tag'); | ||
url.click(function() { | ||
url.focus().select(); | ||
}).click(); | ||
} | ||
|
||
Spice.add({ | ||
data : api_result, | ||
header1 : "Shortened Link (is.gd)", | ||
sourceUrl : "http://is.gd/", | ||
sourceName : "is.gd", | ||
templates: { | ||
item: Spice.shorten.shorten, | ||
detail: Spice.shorten.shorten | ||
}, | ||
|
||
favicon_style : "inline" | ||
}); | ||
|
||
// If we displayed an input box, make sure we focus on it. | ||
var url = $("input#shorten-url"); | ||
url.click(function() { | ||
url.focus().select(); | ||
}).click(); | ||
} | ||
}(this)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters