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.

Moving the dice to quick reply

3 posters

Go down

Moving the dice to quick reply Empty Moving the dice to quick reply

Post by Yuushishio Sat Apr 02, 2016 9:52 pm

My forum: http://www.1000sunny.net/
ver: phpbb3

I tried to use this JS code by @Ange Tuteur
from this topic
Code:
$(function(){$(function() {
  if (!$.sceditor || $('.sceditor-button-faroll').length) return; // return if the editor isn't present or the dice exist
  var a = document.createElement('A'), b = document.createElement('DIV'), c = $('.sceditor-button-emoticon')[0], sce = $('#text_editor_textarea').sceditor('instance'), i = 0, j = dice.length, opt, n;
 
  // button attributes
  a.className = 'sceditor-button sceditor-button-faroll';
  a.title = $.sceditor.commands.faroll.tooltip;
  a.innerHTML = '<div unselectable="on"></div>';
  a.onclick = function() { b.style.display.match(/none/) ? b.style.display = '' : b.style.display = 'none' };
  a.onmouseover = function() { a.className.match(/disabled/) && (a.className = a.className.replace(/disabled/,'')) }; // remove disabled caused by source change
 
  // dropdown attributes
  b.className = 'sceditor-dropdown sceditor-faroll-picker';
  b.style.display = 'none';
  b.style.marginTop = '25px';
 
  // create dice roll options
  for (; i<j; i++) {
    n = dice[i];
    opt = document.createElement('A');
    opt.className = 'sceditor-fontsize-option';
    opt.innerHTML = n;
    opt.onclick = function() {
      sce.inSourceMode() ? sce.sourceEditorInsertText('[roll="'+n+'"][/roll]') : sce.wysiwygEditorInsertText('[roll="'+n+'"][/roll]');
      b.style.display = 'none';
    };
    b.appendChild(opt);
  }
 
  // insert button and dropdown
  c.parentNode.insertBefore(a,c);
  c.parentNode.insertBefore(b,c);
})});

to move the dice roll sceditor to quick reply but it seems not to work in my forum...
it appear like this, without any option to choose.
Moving the dice to quick reply Why10

please help.
avatar
Yuushishio
Forumember

Posts : 117
Reputation : 4
Language : English

http://sharetheworld.forumvi.com

Back to top Go down

Moving the dice to quick reply Empty Re: Moving the dice to quick reply

Post by Yuushishio Sun Apr 03, 2016 10:41 pm

bump for help
avatar
Yuushishio
Forumember

Posts : 117
Reputation : 4
Language : English

http://sharetheworld.forumvi.com

Back to top Go down

Moving the dice to quick reply Empty Re: Moving the dice to quick reply

Post by Yuushishio Wed Apr 06, 2016 11:59 pm

bump
help!
avatar
Yuushishio
Forumember

Posts : 117
Reputation : 4
Language : English

http://sharetheworld.forumvi.com

Back to top Go down

Moving the dice to quick reply Empty Re: Moving the dice to quick reply

Post by Ange Tuteur Thu Apr 07, 2016 11:22 am

I checked your forum and "dice" isn't defined, so try the following to see if it works or not. Go to Admin Panel > Modules > JS codes management and create a new script with the following settings.

Placement : In the topics
Code:
$.get('/post?t=' + window.location.href.replace(/.*?\/t(\d+).*/, '$1') + '&mode=reply', function(data) {
  window.dice = [];

  for (var d = $('#post_dice option', data), i = 0, j = d.length; i < j; i++) {
    if (d[i].value) dice[dice.length] = d[i].innerHTML;
  }
});
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Moving the dice to quick reply Empty Re: Moving the dice to quick reply

Post by Yuushishio Fri Apr 08, 2016 7:32 pm

It still didn't work Sad
avatar
Yuushishio
Forumember

Posts : 117
Reputation : 4
Language : English

http://sharetheworld.forumvi.com

Back to top Go down

Moving the dice to quick reply Empty Re: Moving the dice to quick reply

Post by Yuushishio Sat Apr 09, 2016 5:32 pm

bump for help... still I didn't understand it when you said ""dice" isn't defined"
What did that mean?
@Ange Tuteur
avatar
Yuushishio
Forumember

Posts : 117
Reputation : 4
Language : English

http://sharetheworld.forumvi.com

Back to top Go down

Moving the dice to quick reply Empty Re: Moving the dice to quick reply

Post by SLGray Sat Apr 09, 2016 7:33 pm

Yesterday at 1:32 pm
Today at 11:32 am

Please don't double post. Your post needs to be separated by at least 24 hours before bumping. Please use the edit button instead!


Moving the dice to quick reply Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51555
Reputation : 3524
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

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