Embed xsl:value-of into onload in xslt stylesheet - javascript

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>

Related

script.googleusercontent.com refused to connect webapp href link not working

The error I got in Google Chrome is following when clicked on the linked element.
n-f22j6yycycwkqttwlgfk5eezyixnbwfyfih4bba-0lu-script.googleusercontent.com refused to connect.
Html element is this ->
<img style="margin-right: 16px;" id="img1" height="200px" class="img-rounded" width="47%" src="https://drive.google.com/uc?export=view&id=16RE0CGxrEsXB9bBFj_Nq5jwTb5c8IMgU" alt="Image1">
Note, "this.href" part has value empty. while url is variable stored the webApp Url.
Anyone has witnessed this problem and found how to fix it? It will save my day. Thank you.
The problem arises from using location.href in Apps Script
Use instead window.top.location.
<img style="margin-right: 16px;" id="img1" height="200px" class="img-rounded" width="47%" src="https://drive.google.com/uc?export=view&id=XXXXXXXXX" alt="Image1">
works for me.

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

How to add alt attribute

I am facing a problem, I have the below blogger template which has the following HTML
I am facing an alt attribute error. So, if someone could kindly tell me how to add alt attribute in above html.
<img src="pathofyourimg" alt="No Image Available" />
The alt attribute can be applied to an image to specify an alternate text.
Ex: <img src="smiley.gif" alt="Smiley face">
You can wrap an image inside the <a and specify alt attribute for the image.
<a href="<data:post.url/>">
<image src="your image source" alt="This is my image">
</a>

Image swap onclick within div

I would like to replace images on click but also have the replaced image click to a lightbox. Here is my example where the first image has the lightbox: http://www.artdesigngroup.co/products/test.html
My thought is that I need to apply the "display" ID on the surrounding div and replace the images within this div. But how do I do this and create the lightbox?
Thank You.
I would rethink your structure for handling this. Most of what you are doing can be handled with straight jQuery instead of rolling your own swap functions. When you ask your questions, including a Fiddle is a great way to get an answer faster. Note that I am using jQuery 1.7's prop method here which you should be using instead of attr.
http://jsfiddle.net/txbqX/3/
jQuery to get what you want
//when main image is clicked, show it in colorbox
$('#foo a').colorbox();
//when thumb is clicked, set main image to it
$('div#thumbs img').click( function() {
$('#foo a').prop('href', $(this).prop('src'));
$('#foo img').prop('src', $(this).prop('src'));
return false; //stop link from navigating
})
Simplified HTML
<div id="foo" >
<a href="http://www.artdesigngroup.co/images/tv-frames/01.jpg">
<img src="http://www.artdesigngroup.co/images/tv-frames/01.jpg" width="304" height="304" name="Display" id="display" />
</a>
</div>
<br />
<div id="thumbs">
<img src="http://www.artdesigngroup.co/images/tv-frames/01.jpg" width="56" height="56" />
<img src="http://www.artdesigngroup.co/images/tv-frames/02.jpg" width="56" height="56" />
<img src="http://www.artdesigngroup.co/images/tv-frames/03.jpg" width="56" height="56" />
<img src="http://www.artdesigngroup.co/images/tv-frames/04.jpg" width="56" height="56" />
<img src="http://www.artdesigngroup.co/images/tv-frames/05.jpg" width="56" height="56" />
</div>

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

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>

Categories