How to change title of the customly added emotes in tinymce? - javascript

Hiii
I can add a emote by just adding this :
<img src="img/smiley-frown.gif" width="18" height="18" border="0" alt="{#emotions_dlg.frown}" title="{#emotions_dlg.frown}" />
But when i hover it shows me : ($emotions_dlg.myemote} .
How can i change it to something like this myemote

Maybe you will just write text what you want instead of {$emotions_dlg.myemote}? Not pretty clear what you want.

In case you use an own plugin (called own_plugin here) you may use the plugin's language file to acces the description to add it to your emoticon
<a>...<img onMouseOver="this.alt=tinymce.EditorManager.i18n[en.own_plugin.myemote]" src="img/smiley-frown.gif" width="18" height="18" border="0" alt="{#emotions_dlg.frown}" title="{#emotions_dlg.frown}" /></a>

Related

Imacros. How to save several images with changing attributes?

I need to save 4 images everytime i refresh a website, the problem is, it only has 1 attribute that is different in all these images and it changes into a randomly generated string everytime i refresh the page. the HTML of these images are:
<img alt="" width="35" height="40" src="data:image/png;base64,HJFFSYYEYGUG3r236=">
<img alt="" width="35" height="40" src="data:image/png;base64,UASFsACUYASYGU6=">
<img alt="" width="35" height="40" src="data:image/png;base64,FHJASFUYYetetgts=">
<img alt="" width="35" height="40" src="data:image/png;base64,ete6tdrte6r=">
so as you can see the only the src attribute changes. How do i save all 4 of these images every time i refresh the page?
Replace the changeable part of SRC-attribute with the wildcard * and run the macro in loop mode (with the max. loop number = 4):
TAG POS={{!LOOP}} TYPE=IMG ATTR=SRC:"data:image/png;base64,*=" CONTENT=EVENT:SAVEITEM
If it doesn’t work, try the event:
... CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT

Embed xsl:value-of into onload in xslt stylesheet

I'm trying to have a xsl:value-of concat with a xsl:variable inside the img.
<xsl:variable name="tail" select="'#domain.com'"/>
<SPAN id="ProfileViewer_Name">
<img border="0" width="12" height="12" src="http://domain/_layouts/images/imnhdr.gif" alt="" onload="QueuePopulateIMNRC('<xsl:value-of select="Initials"/>{$tail}', this);" name="imnmark" ShowOfflinePawn="1" id="user_ctl00_PlaceHolderMain_ctl03_im,type=sip" />
</SPAN>
I can place the value-of outside the img tag and it pulls the values just fine. I'm pretty sure it's a matter of nesting quotations, but I've tried quite a few permutations and nothing has worked yet.
The expected input would be having the lines initials in the onload. Instead, it seems to pull one initial at random and insert it for each output. If I have the xsl:value-of outside the img tag I get the correct values, but once it's embed it seems to fail. So I get something along the lines of
XXXX#
XXXX#
XXXX#
Where I need something like
AAAA#
BBBB#
CCCC#
You're already using an attribute value template, so it's the same mechanism:
<xsl:variable name="tail" select="'#domain.com'"/>
<SPAN id="ProfileViewer_Name">
<img border="0" width="12" height="12" src="http://domain/_layouts/images/imnhdr.gif" alt="" onload="QueuePopulateIMNRC('{Initials}{$tail}', this);" name="imnmark" ShowOfflinePawn="1" id="user_ctl00_PlaceHolderMain_ctl03_im,type=sip" />
</SPAN>

How to put the ALT-value of an image into a variable in javascript or jquery

I’ve made a cardspread program that is based on the source of the image. It works allright, but it is loading slowly, because now 78 different cards are loaded. I like to speed up the loading and I thought I needed an extra item per DIV. So I added an ALT-tag to each image. Like this:
<div id="kaart1">
<alt=kaart14.jpg>
<img src="images/kaart1.jpg" width="110" height="180" onclick="showDiv(event)>
</alt=kaart14.jpg>
</div>
Now I need only 1 image to load 78 times, which is faster. The problem which I am facing now is that I want to read the alt value into a variable (in this case: kaart14.jpg).
I’ve tried :
$('.status').click(function() {
var status = $(this).attr('alt');
});
But that stays empty. Does anyone have a suggestion how to solve this in Javascript or jQuery?
First, there is no <alt> tag. It is used as alternative to <img>. The value is displayed if the image is not loaded.
It is just plain text. If you put a url there, it will just display the url and not the image itself.
Eg:
<img src="myphoto.jpg" alt="This is my photo">
There is no performance gain if you use alt or not, but you definitely SEO
Your alt attribute should be like
<div id="kaart1">
<img src="images/kaart1.jpg" alt="kaart Image" width="110" height="180" onclick="showDiv(event)>
</div>
alt is an attribute of the img tag,its not a tag itself.And as #Bergi said,the alt attribute will not be an another image.It may be the description.

I’m using a multilanguage script to change from lanquage. Now I’m having troubles in using by the image

I am new for script and jQuery
I’m using a multilanguage script to change from language. Now I'm having troubles to change from a language by using the image,
<img src="/flags/us.png" alt="en_EN" />
<img src="/flags/it.png" alt="it_IT" />
<img src="/flags/fr.png" alt="fr_FR" />
here after i dnot know how to use this image tag
what i want from this image tag , when i am click this image i want the alt value of corresponding image click.
Hoe to get it...
its possible or else give any other idea
thanks
Kumar
Put a class in your anchor and try this
<img src="/flags/us.png" alt="en_EN" />
<img src="/flags/it.png" alt="it_IT" />
<img src="/flags/fr.png" alt="fr_FR" />
$('a.lang img').click(function(){
var alt=$(this).attr('alt');
});
<a class='lang_link' href="#"><img src="/flags/us.png" alt="en_EN" /></a>
Assuming your links have a class of lang_link, you can look inside the link to see what language should be chosen.
$('.lang_link').click(function(){
var lang = $(this).find('img:first').attr('alt');
});

Jquery cycle scrubber plugin: adding links to images

I'm using this jquery plugin which lets you scrub through images:
http://thespiral.ca/jquery/scrubber/demo/
I'm trying to add a link to each image, like this for example:
<div id="basic">
<img src="images/beach1.jpg" width="200" height="200" alt="Beach1" />
<img src="images/beach2.jpg" width="200" height="200" alt="Beach2" />
<img src="images/beach3.jpg" width="200" height="200" alt="Beach3" /></div>
But something in the script seems to be blocking links, and no matter what I do the image have a "#" link.
Can anyone help?
Update:
I put up a jsFiddle: http://jsfiddle.net/qdGXZ/
The problem may be in jquery.cycle.all.min.js. There is a code in it that may cause this kind of behaviour. Here it is:
else{a=''+(i+1)+"";}
Comment it and see what happens. This was the only piece of code in the given example that could cause this.
To fix this you need to pass href attribute defined by you to the else case and do something like this:
else{a=''+(i+1)+"";}
I don't know if this will help. Just can't do much. Now you know what is the problem and what you should do to fix it. The rest is up to you.

Categories