1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-11 07:11:04 +01:00
phorge-phorge/webroot/rsrc/css
epriestley fe042def42 Add a Javascript method to find the pixel position of a range in a textarea
Summary:
Ref T3725. This might eventually allow us to do `@username` typeaheads in textareas.

Javascript!!!

Test Plan:
Dumped this into console and got a "<<<" at the caret position in Safari, Firefox and Chrome.

```
setInterval(function() {

var area = JX.$('comment-content');
var r = JX.TextAreaUtils.getSelectionRange(area);
var d = JX.TextAreaUtils.getPixelDimensions(area, r.start, r.end);

JX.log(d);

try {
  JX.DOM.remove(JX.$('ptr'));
} catch (_) {}

document.body.appendChild(
  JX.$N(
    'div',
    {id: "ptr", style: { position: 'absolute', left: d.start.x + 'px', top: d.start.y + 'px', zIndex: 9999, border: '2px solid red' }},
    '<<<'));
}, 1000);
```

Reviewers: chad, btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T3725

Differential Revision: https://secure.phabricator.com/D10280
2014-08-18 13:15:40 -07:00
..
aphront Make the 404 page device friendly. 2014-07-30 13:31:16 -07:00
application Touch up notification/messages panels 2014-08-14 17:19:01 -07:00
core Add a Javascript method to find the pixel position of a range in a textarea 2014-08-18 13:15:40 -07:00
diviner Support WOFF files in Celerity and add Source Sans Pro 2014-03-06 11:28:24 -08:00
font [redesign] Tokens and List 2014-05-28 20:58:22 -07:00
layout Move ActionHeaders to PHUI, add ObjectBox Support, new Colors 2014-06-24 09:39:32 -07:00
phui Modernize DatePicker 2014-08-16 14:55:22 -07:00
sprite-apps-large.css Add Phund app icon 2014-08-11 09:26:41 -07:00
sprite-apps.css Add Phund app icon 2014-08-11 09:26:41 -07:00
sprite-conpherence.css Conpherence - some cleanup type stuff 2013-03-13 13:03:51 -07:00
sprite-docs.css Document icons sprite sheet. 2013-03-10 14:16:16 -07:00
sprite-gradient.css Move ActionHeaders to PHUI, add ObjectBox Support, new Colors 2014-06-24 09:39:32 -07:00
sprite-login.css Add new login icons 2014-06-27 21:04:07 -07:00
sprite-main-header.css Multicolor headers 2013-12-06 12:08:11 -08:00
sprite-menu.css [redesign] Add back power icon 2014-05-29 20:50:31 -07:00
sprite-payments.css Payment sprite icons. 2013-04-22 16:41:00 -07:00
sprite-projects.css Add an icon+background selector for project images 2013-10-17 09:32:34 -07:00
sprite-tokens.css Add Pebkac app icon, 2x Tokens 2013-11-04 11:50:19 -08:00