The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

images / link Button in Editer (PLEASE HELP)

2 posters

Go down

Solved images / link Button in Editer (PLEASE HELP)

Post by Ape 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
images / link Button in Editer (PLEASE HELP) Yespla10


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


images / link Button in Editer (PLEASE HELP) Left1212images / link Button in Editer (PLEASE HELP) Center11images / link Button in Editer (PLEASE HELP) Right112
images / link Button in Editer (PLEASE HELP) Ape_b110
images / link Button in Editer (PLEASE HELP) Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19122
Reputation : 1993
Language : fluent in dork / mumbojumbo & English haha

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

Back to top Go down

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

Post by Ange Tuteur 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
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

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

Post by Ape July 30th 2014, 2:41 pm

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


images / link Button in Editer (PLEASE HELP) Left1212images / link Button in Editer (PLEASE HELP) Center11images / link Button in Editer (PLEASE HELP) Right112
images / link Button in Editer (PLEASE HELP) Ape_b110
images / link Button in Editer (PLEASE HELP) Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19122
Reputation : 1993
Language : fluent in dork / mumbojumbo & English haha

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

Back to top Go down

Back to top

- Similar topics

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