SlickGrid, copy text from Tooltip using AutoTooltips plugin - javascript

I use objects as the data for my grid. These objects contain a text value as well as an arbitrary amount of issues.
The text is displayed in the cell and the issue-messages are displayed as a tooltip via the AutoTooltips plugin for each cell. This works fine so far.
My problem: I want to copy text from the tooltip. However: the tooltip disappears as soon as the mouse leaves the cell and I can't figure out how to keep the tooltip 'active' long enough (e.g. as long as the mouse moves towards it) to enter the tooltip and copy text from it. Is there a way to achieve this using the AutoTooltips plugin?

The AutoTooltips plugin only adds the property title. You have to either change the code behind or add another library/scripts that generate tooltip and allows to copy text.
Check http://jquerytools.github.io/demos/tooltip/index.html.
To implement it, just add the code $(grid_container).tooltip() after the grid/rows are rendered.

Related

iOS: Is it possible to change the text selection mode in UIWebView?

I am developing an epub renderer app for iOS with highlights included as one of its features. I have the algorithm for highlight creation (based on text selections made by user), removal and tap-on-highlight detection that works very well. But to get even better behaviour I would like to restrict text selection on plain text selecting.
In other words, on iOS7 & iOS8 devices I can create selection blocks around html nodes, like this:
As you can see on the pic above, the text selection box goes until header's margins and it is not bound to the text only. I would like that UIWebView automatically transforms that kind of selections to "around-text-only" selection, like this:
The reason I need this restriction is because in the first case some adjacent html nodes can get included under selection (like empty paragraphs, etc), while in the second case I have plain text selection that I can easily handle with my algorithm.
Once again, I don't want to disable text selection, I just want to bind blue selection box to the plain text only.
So can I do something to get that transformation in UIWebView? Use some javascript method perhaps?

Select Text and share via Twitter

I produced a little interactive with D3 which shows some tooltip text when hovering over the datapoints.
I would like to allow users to copy the text in the tooltip (or simply use all of it) to share via Twitter. The problem is that I can not fix one datapoint because it changes when I move over the graphic. So I would either like to freeze the tooltip text for a couple of seconds, so that it doesn't immediatly change on hover OR have another option (maybe on click or rightclick) to share the sentence via Twitter. Any idea?
Here is my working code so far:
http://bl.ocks.org/sytpp/3a070a6ed6834169a85b

TinyMCE: Add complex format

I want to add a format to the TinyMCE Editor for Joomla. It should be a format that displays a scalable graphical box around the content. Since the box must scale with the content, I cannot simply use one background box graphics. Instead, I must use graphics for the sides of the box which then can scale in x and y direction. In order to achieve this, I need to wrap the text into more than one div. Thus, I need a possibility to add a format that wraps the content into these divs. However, it seems that TinyMCE does only allow formats that wrap the content into one HTML element - but, as stated above, I need more than one. Is this possible?
No, this is not possible. You may only define what html element you want to use to wrap the content in. The setting is called root_block_element
tinyMCE.init({
...
forced_root_block : 'p'
});

TinyMCE contained element?

I wrote a TinyMCE plugin for Wordpress that drops a prepared bit of HTML into the textarea when a button on the toolbar is clicked. This is to assist in formatting some relatively complicated elements.
I would like for this piece of HTML to be wrapped in some sort of container that TinyMCE recognizes and allows for easy selection or deletion if needed.
Currently, the only way to delete an individual element is by erasing all of the information each individual "sub element" contains. I can't seem to find any information in the API regarding manually assigning an element as a singular combined object. As far as behavior goes, think "resize frame" or something similar (only this won't need to have any resizing capabilities).
Any ideas?
If you want to wrap text/html inside an element of your choice (i used a span here) at the current cursor position of tinymce editor instance ed you can simply do
ed.execCommand('insertHTML', false, '<span class="custom_to_delete">My_Text</span>');

how to disable textarea one line , not all line using javascript

i know <textarea name="textarea" disabled="disabled">dsds</textarea> can disable write in the textarea ,
but how to disable one line i want to disable in the textarea ?
not all line
thanks
That's not possible without JavaScript, even then:
You need to enable contentEditable
You need to write your own editor...
You need to figure out what happens if someone deletes or inserts a line and therefore moves the disable one around
You need to figure out what to do when someone hits enter in the line above the disabled one or backspace at the beginning of the line below the disabled one...
To sum it up, a textarea is the wrong approach here, better use multiple input's for whatever you want to do here, of course you will need to make it look like it's one textarea and you'll still need some JavaScript to make return work as expected (?), but then again you didn't specify what you want to do with this stuff.
Yes, use multiple input texts appear like a single text area, let's call it fake text area. That way disabling one would be easy.
Do not put any margin in between them and no border, all having same width.
Assign incremental ids to each one - like input-1,input-2 etc.
If you want to prefill some text into the fake textarea, calculate the maximum length that can be accomodated into a single input and fill line by line using javascript (jquery would be better).
When cursor is at the end of an input text and enter is pressed, take cursor to next text input. Define a function for every such possibility and call it.
On posting the form, append the input values together to get the actual value of the faked text area.
I guess there may be difficulties in faking a scrollbar for such a textarea but once implemented, should work fine. Any existing plugins like this?
Updates
- For handling cursor positions, refer these things. I did not try myself but may be useful - Jquery Caret position and How to get cursor position in textarea and you can apply the cursor position getting-setting logics. Somehow try to get the actual click position and force the cursor to stay there.

Categories

Resources