TinyMCE: Add complex format - javascript

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'
});

Related

SlickGrid, copy text from Tooltip using AutoTooltips plugin

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.

Looking for a photoshop script to add text to image and resize to fit

I have a psd file with two text layers.
I would like to add a quote in the first text layer and a name in the second.
The data is coming from a csv.
The quotes can vary in length. The font size for the "quote" text layer therefor needs to be set to fit within the text box.
I tried scripting it for the better part of the day now and am stumped.
Thank you!
While it's not Photoshop, you might want to check out Templater for After Effects which lets you dynamically insert data into layers. Templater also comes with layout logic that allows you to determine the fitting of various lengths of text and resolutions of source images.
The data can come from a tabbed-separated value file or from a Google Sheets document. Even though it works for After Effects, you can use Templater to export still images from AE.
Learn more at http://dataclay.com

how to display text in a div like a triangle shape dynamically using jquery [duplicate]

I'm trying to have a block of text in a div fill a downward triangle shape. Is there any way to achieve this with either CSS or Javascript?
This is for a site in which users can dynamically insert text. I'm trying to avoid the alternative method, which is to have them insert text line by line with a limit on each line.
I don't know of any simple way to do what you are asking for. The best thing I can think of would be to use something like the CSS text wrapper, which can fit your text to any shape. I haven't used it myself so I don't know what problems you will run into.
Your question is very similar to this one.
I know of no CSS way, but you can do it with JavaScript. The idea is to find where each line of text breaks and wrap the remaining text in a new child div. You have to use text ranges to accomplish it.
See this demo: http://jsfiddle.net/gilly3/CmguZ/7/
You could wrap each line of your text with a <span> and use margins to recieve the wanted affect and if you want the shape to have a color use photoshop to create a triangle with the desired color and put it on the background.
you can try playing with CSS border slopes, but I don't think it fits your needs entirely, because it's a bit complicated and you have to wrap the text manually. there are some good examples of this method here, but it is for simple shapes basically, not for text containers.

How to implement more and less functionality with dynamic HTML data?

I have one JSP page where i need to show one DIV having HTML from database table field(its Data Entry Field is a TinyMCE). I have to implement more and less functionality(like http://viralpatel.net/blogs/demo/jquery/show-more-link-shortened-content/). I can't do substring as it may cut some HTML tag in between and some tags may remain unclosed which affects my UI . and i can't show and hide based on the height of DIV as font is controlled by TinyMCE and different lines may have different font-size and this may cause last line to be shown partially.
Thanks in Advance.
after fetching and and during the time of displaying apply jquery truncate plugin but make sure to apply the below property to the div
word-wrap:break-word

Manipulating text in a TextBox in Adobe InDesign CS5

How can I do some manipulations with the text in a TextBox on resize in Adobe InDesign CS5?
The main goal is too split the last word on every row to achieve something like a custom hyphenation.
Is it possible using JavaScript (or ExtendScript?) ?
Thanks.
UPDATE
I've tried to describe my problem in comments
I need an example on ExtendScript, which would find textbox dimensions and hyphenate the text according to dimension and after I'd like to create an event on textbox resize, which would do the same thing after every resize.
You'll probably be able to write a script to do what you want, but the functionality is already built into InDesign.
If I understand your problem correctly it's InDesign does not hyphenate Armenian properly? You can insert manual hyphenationsin the text using the text tool and pressing 'Ctrl'+'-' where you want the hyphen in the text. Unfortunately you'll have to do that everytime you resize the box, because the words will move around - which is probably the problem you're having.
You can set the language in InDesign in the Character tab (shortcut is 'Ctrl'+'t') and upload custom dictionaries/word lists with rules specific to your language including rules for spelling and hyphenation. Unfortunately I couldn't find Armenian in my short search, but perhaps you're more lucky.
Check out the link for more details:
http://help.adobe.com/en_US/indesign/cs/using/WSa285fff53dea4f8617383751001ea8cb3f-6f4da.html

Categories

Resources