Add this plugin... brain-jam - html

Guys I am about to get a massive headache here. First of all, I am working on a website and everything seems to be runng. So, I had difficulties with making them links etc. so I tried to add the addthis.com plugin which would do all of that automatically. But, when I add that everything seemed to crash so I have made a quick jsFiddle to show you what I want. Here: http://jsfiddle.net/cSP9Q/1/ the problem is that I want to change those icons to mine which you can see on the first link and I just can't seem to change the spacings in between the icons. Furthermore, is there anyway of deleting the bubble with the counter because that just looks ridiculous.

HTML
<div id="social"><!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_preferred_1"><img src="your_image_url" /></a>
<a class="addthis_button_preferred_2"><img src="your_image_url" /></a>
<a class="addthis_button_preferred_4"><img src="your_image_url" /></a>
<a class="addthis_button_google_plusone"><img src="your_image_url" /></a>
<a class="addthis_button_compact"><img src="your_image_url" /></a>
</div>
<!--javascript goes here-->
</div>
Example and Reference.
NOTE: your link http://www.aasingercom.ipage.com/php/ doesn't work, anyway.

Related

Stop CKEditor 4 from adding additional HTML tags

I have a problem with CKEditor 4 adding additional HTML tags. I've been using v3 for a few years without any problems, and I've built my own plug-ins, so I'm not a complete novice but this has me stumped. For instance the following block of HTML:
<section class="component2">
<div class="">
<div class="component2__row">
<a class="component2__item component2__item--primary" href="#">
<img class="component2__item__image" src="http://MyServer/webmedia/Images/Components/component2/image-1.jpg" alt="IMG"/>
<h4 class="component2__item__title">Light Vehicle</h4>
</a>
</div>
</div>
</section>
Gets saved as:
<section class="component2">
<div>
<div class="component2__row">
<a class="component2__item component2__item--primary" href="#">
<img alt="IMG" class="component2__item__image" src="http://MyServer/webmedia/Images/Components/component2/image-1.jpg" />
</a>
<h4 class="component2__item__title">
<a class="component2__item component2__item--primary" href="#">Light Vehicle</a>
</h4>
<a class="component2__item component2__item--primary" href="#"> </a>
</div>
</div>
</section>
Any ideas? (Note for example the additional anchor tags!) Is there something in the HTML
it doesn't like? Is there a setting in config.js that I can use?
Thanks
If someone else stumbles across this I worked round it. As it was already my default (from v3) I'd already tried:
config.allowedContent = true;
I went through the documentation in detail, and even tried editing the dtd to allow headers to be in divs and anchors:
CKEDITOR.dtd['div']['h'] = 1;
CKEDITOR.dtd['a']['h'] = 1;
All to no avail. Eventually I gave up and replaced the <h4> tag in my sample with a <span> and styled it accordingly. That worked and CKEDITOR now leaves my source HTML untouched. Irritating that there isn't a feature whereby you can tell the Editor "Look, I know my HTML is valid, leave it alone and I'll deal with any consequences."

How to add a start tag and end tag separately in jQuery

so my question is how do I add the opening and closing tag separately using jQuery.
For eg.
<a class="test" href="#">
<img src="https://images.unsplash.com/photo-1611165243857-d8b0ff81ba63?ixid=MXwxMjA3fDB8MHx0b3BpYy1mZWVkfDIwfDZzTVZqVExTa2VRfHxlbnwwfHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60"/>
</a>
I want add a figure tag to wrap the image. So the outcome will be like below. Currently when i use the
jQuery('img').before('<figure>');
jQuery('img').after('</figure>');
it don't seems to work. Please advise. Thanks.
<a class="test" href="#">
<figure>
<img src="https://images.unsplash.com/photo-1611165243857-d8b0ff81ba63?ixid=MXwxMjA3fDB8MHx0b3BpYy1mZWVkfDIwfDZzTVZqVExTa2VRfHxlbnwwfHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60"/>
</figure>
</a>
You're looking for .wrap().
jQuery('img').wrap('<figure></figure>');
Link for more info if you want: https://api.jquery.com/wrap/
kindly check the below code.
$( "img").wrap( "<figure></figure>");

Add this styling

I have added addthis to a Joomla site. By default it loaded like this:
<div class="addthis_sharing_toolbox"></div>
<script src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-xxx"></script>
And it looks like this:
I have enabled JCH (to improve speed), but addthis is not working. I have to keep JCH. I manage to make it work, using following code:
<div class="addthis_sharing_toolbox addthis_default_style addthis_64x64_style" data-title="title">
<a class="addthis_button_facebook at-icon-wrapper at-share-btn at-svc-facebook" style="cursor:pointer"></a>
<a class="addthis_button_twitter" style="cursor:pointer"></a>
<a class="addthis_button_google_plusone" style="cursor:pointer"></a>
</div>
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<script src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-xxx"></script>
As you see I have added the tags with the icons, in that way they load, but the styling is totally different, how can I keep same design?
The answer is here: https://www.addthis.com/academy/customizing-the-addthis-toolbox/.
In my div I had the class "addthis_sharing_toolbox" but I had to use "addthis_sharing_toolbox"
<div class="addthis_toolbox addthis_default_style addthis_64x64_style">
<a class="addthis_button_facebook"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_google_plusone"></a>
</div>

Image links in IE 11

I haven't tested this on all versions of IE but I have a problem that when I go to this site: http://www.yourwhiteknight.com/manufactured/ and click on one of the image links in the navigation menu (Home, Manufacted Homes, or Real Estate) it just opens the image of the button in the same window. It doesn't do this in Chrome or Firefox (it goes to the link as it should). Has anyone seen this before or does anyone know a solution?
Here is the HTML:
<div class="textwidget">
<a href="http://yourwhiteknight.com/">
<img src="http://yourwhiteknight.com/wp-content/uploads/2012/10/home.button.png" class="icon">
</a>
<a href="http://yourwhiteknight.com/manufactured/">
<img width="233" height="38" src="http://yourwhiteknight.com/wp-content/uploads/2012/11/m.homes-tab.png" class="homes">
</a>
<a href="http://realestate.yourwhiteknight.com">
<img src="http://yourwhiteknight.com/wp-content/uploads/2012/11/real-estate-tab.png" class="real">
</a>
</div>
Thanks in advance for your help!
UPDATE:
I did just notice that when I inspect the element in IE it shows the code for an image as this:
<img width="233" height="38" class="homes" src="http://yourwhiteknight.com/wp-content/uploads/2012/11/m.homes-tab.png"></img>
I tried to add a slash at the end of the image code to no avail ()
Funny thing is that if you go to our other site that is a mirror of this one the buttons work: http://realestate.yourwhiteknight.com/ even though the code on the back end is the exact same.
Add target="_self" to the links and it works as a workaround. There is probably some JavaScript (maybe Google Analytics) interfering with the page.
This was being caused by a plugin called: Google Analytics Suite. I just deactivated it and it started working. Thanks everyone for pointing me in the right direction!

Linking tumblr photos directly to the source

I'm trying to make my tumblr posts link directly to the source when clicked rather than going to the post page and having the source link there to click.
Here's the code I have for the photo posts.
{block:Photo}
<div class="permalink">{MonthNumber}.{DayOfMonthWithZero}.{ShortYear}</div>
<div class="photo">
<div class="photobox"><img src="{PhotoURL-250}" alt="{PhotoAlt}"/></div>
{block:Caption}
<div class="caption">{Caption}</div>
{/block:Caption}
</div>
{/block:Photo}
I've tried changing the photobox 'permalink' to source etc with no avail.
Anyone got any ideas?
In the hope that someone who needs this will find it, here's a way I found to show {LinkURL} when it's available, and some other url when it's not.
Tumblr offers {block:LinkURL} to display some code when {LinkURL} is available, but there's no {block:NoLinkURL} to use when {LinkURL} is NOT available.
Ideally, this should be possible:
<a
{block:LinkURL}href="{LinkURL}"{/block:LinkURL}
{block:NoLinkURL}href="{Permalink}"{/block:NoLinkURL}> <!-- does NOT work -->
<img src="{PhotoURL-400}"/>
</a>
But {block:NoLinkURL} doesn't exist, so I'm using {block:LinkURL} to hijack the normal link instead:
<a {block:LinkURL} href="{LinkURL}" data-ignored-{/block:LinkURL}href="{Permalink}">
<img src="{PhotoURL-400}"/>
</a>
If {LinkURL} is available both links will be in the HTML, but only one is read.
Example output
This is the output when {LinkURL} is not available:
<a href="/permalink">
<img src="/image.jpg"/>
</a>
And this when is the output when {LinkURL} is available:
<a href="/linkurl" data-ignored-href="/permalink">
<img src="/image.jpg"/>
</a>
after comments edit
It should be <a href="{LinkURL}">
You have to make sure when you're adding the image that you've specified the target as outside of tumblr too.