Skip to content

Commit

Permalink
added new tags for #63
Browse files Browse the repository at this point in the history
  • Loading branch information
neocotic committed Feb 6, 2012
1 parent e4afb86 commit fb3493d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
9 changes: 7 additions & 2 deletions src/lib/background.coffee
Expand Up @@ -598,8 +598,10 @@ addAdditionalData = (tab, data, callback) ->
runner.finish response
runner.run (result = {}) ->
$.extend data,
selection: result.text ? ''
selectionlinks: result.urls ? []
pageheight: results.pageHeight ? 0
pagewidth: results.pageWidth ? 0
selection: result.text ? ''
selectionlinks: result.urls ? []
callback?()

# Creates an object containing data based on information derived from the
Expand Down Expand Up @@ -674,6 +676,7 @@ buildStandardData = (tab, shortCallback) ->
decode: ->
(text, render) ->
decodeURIComponent render text
depth: window.screen.colorDepth
# Deprecated since 1.0.0, use `anchorTarget` instead.
doanchortarget: anchor.target
# Deprecated since 1.0.0, use `anchorTitle` instead.
Expand Down Expand Up @@ -709,6 +712,8 @@ buildStandardData = (tab, shortCallback) ->
params: url.param()
popular: ext.queryTemplate (template) ->
template.key is stats.popular
screenheight: window.screen.height
screenwidth: window.screen.width
segment: ->
(text, render) ->
url.segment parseInt render(text), 10
Expand Down
6 changes: 4 additions & 2 deletions src/lib/content.coffee
Expand Up @@ -33,5 +33,7 @@ chrome.extension.sendRequest type: 'info', (data) ->
if contents
urls.push anchor.href for anchor in contents.querySelectorAll 'a[href]'
sendResponse
text: selection.toString()
urls: urls
pageHeight: window.innerHeight
pageWidth: window.innerWidth
text: selection.toString()
urls: urls
26 changes: 22 additions & 4 deletions src/pages/templates_en.html
Expand Up @@ -116,6 +116,10 @@ <h3>Notes</h3>
format
</td>
</tr>
<tr>
<td>depth</td>
<td>The colour depth in bits (e.g. <em>24</em>)</td>
</tr>
<tr>
<td>directory</td>
<td>
Expand Down Expand Up @@ -158,6 +162,14 @@ <h3>Notes</h3>
was extracted from this)
</td>
</tr>
<tr>
<td>pageHeight</td>
<td>The height of the page</td>
</tr>
<tr>
<td>pageWidth</td>
<td>The width of the page</td>
</tr>
<tr>
<td>path</td>
<td>
Expand All @@ -181,15 +193,21 @@ <h3>Notes</h3>
<tr>
<td>relative</td>
<td>
The relative path to the file including the query string (e.g.
<em>/folder/dir/index.html?item=value</em>)
The relative path to the file including the query string (e.g. <em>/folder/dir/index.html?item=value</em>)
</td>
</tr>
<tr>
<td>screenHeight</td>
<td>The height of the screen</td>
</tr>
<tr>
<td>screenWidth</td>
<td>The width of the screen</td>
</tr>
<tr>
<td>selection</td>
<td>
The currently selected text (not available on Chrome's protected
pages)
The currently selected text (not available on Chrome's protected pages)
</td>
</tr>
<tr>
Expand Down

0 comments on commit fb3493d

Please sign in to comment.