The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

images / link Button in Editer (PLEASE HELP)

View previous topic View next topic Go down

Solved images / link Button in Editer (PLEASE HELP)

Post by APE on July 29th 2014, 4:57 pm

Hi all i Wonder if anyone could help me out here i have been trying to work on new buttons that would be a help to lots of you here but am crap at making Codes.

Do you think it would be easy to make a button that is just like the img button we have already but instead of it just adding the pic It would add the code to link to a new page or open a new page Say like a New site maybe helpful links on your own site.

A little like the buttons i have on my Siggy below this post.

Is there anyone that could make this for me and then you could prob's make it a helpful Topic for topic Tuesday ro something Wink Hint Hint @ Ange Tuteur lol

The tool bar would look like this


Last edited by APE on July 30th 2014, 2:47 pm; edited 1 time in total




APE
Manager
Manager

Male Posts : 8618
Reputation : 752
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: images / link Button in Editer (PLEASE HELP)

Post by Ange Tuteur on July 30th 2014, 2:13 pm

Hi APE,

Add it in all the pages :
Code:
$(function(){$(function(){
 $('.sceditor-button-image').after('<a title="Insert a linked image" class="sceditor-button sceditor-button-imganc"><div style="background:url(http://i39.servimg.com/u/f39/18/21/41/30/imganc10.png);"></div></a>');
 $('.sceditor-button-imganc').click(function() {
  if ($('.sceditor-insertimganc').length) return $('.sceditor-insertimganc').remove();
  $('body').append('<div class="sceditor-dropdown sceditor-insertimganc" style="position:absolute;"><div><label>IMAGE URL:</label> <input id="imganc-img" class="url" placeholder="http://" type="text"></div><div><label>URL:</label> <input id="imganc-url" class="url" placeholder="http://" type="text"></div><div><label>Width (optional):</label> <input id="imganc-width" size="2" type="text"></div><div><label>Height (optional):</label> <input id="imganc-height" size="2" type="text"></div><div><input id="submit-imganc" class="button" value="Insert" type="button"></div></div>');

 $('.sceditor-insertimganc').css({'left':$('.sceditor-button-imganc').offset().left + 'px','top':$('.sceditor-button-imganc').offset().top + 25 + 'px'});
 
 $('#submit-imganc').click(function() {
 var dimension = '',
 width = $('#imganc-width').val(),
 height = $('#imganc-height').val(),
 image = $('#imganc-img').val(),
 url = $('#imganc-url').val();
 
  if (width.length > 0 && height.length > 0) dimension = '('+width+'px,'+height+'px)';
 else if (width.length > 0 && height.length < 1) dimension = '('+width+'px,'+width+'px)';
 else if (width.length < 1 && height.length > 0) dimension = '('+height+'px,'+height+'px)';
 
 if (image.length > 0 && url.length > 0) $('#text_editor_textarea').sceditor('instance').insertText('[url='+url+'][img'+dimension+']'+image,'[/img][/url]');
  $('.sceditor-insertimganc').remove();
  return false;
  });
 });
 $('.sceditor-button-source').click(function() { $('.sceditor-button-imganc').removeClass('disabled') }); $('.sceditor-button').not('.sceditor-button-imganc').click(function() { $('.sceditor-insertimganc').remove() }); $('.sceditor-container textarea').focus(function() { $('.sceditor-insertimganc').remove() }); $('.sceditor-container iframe').contents().mousedown(function() { $('.sceditor-insertimganc').remove() });
})});

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: images / link Button in Editer (PLEASE HELP)

Post by APE on July 30th 2014, 2:41 pm

Wow Ange Tuteur you are the best Thank you i could KISS ya kissgroar You Rock Big time it Works like a Charm XXXXXXXXXXX Thank you Wink




APE
Manager
Manager

Male Posts : 8618
Reputation : 752
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum