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.

is that possible simple menu with quick reply`s

View previous topic View next topic Go down

Solved is that possible simple menu with quick reply`s

Post by Michael_vx on June 25th 2015, 2:30 pm

is that possible simple menu with quick reply`s
ill try Explain more
before the quick replay box i want a little menu with templates reply`s
like
thank you very much - this great topic - keep it up
ETC
so when i chose one of them its added to the Editor area instead of typing it
is my idea clear or there is something still not Understandable
it dose not matter how it will be the Script templates or Java Script wont be any case
thanks again

Michael_vx
Forumember

Male Posts : 655
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: is that possible simple menu with quick reply`s

Post by Sir. Mayo on June 27th 2015, 6:15 pm

I can help you explain this better, I have been looking for something like this as well.

What the op is asking is, for there to be a button that when the user presses it it opens a menu. In that menu their are prewritten replies, that the user can choose from by clicking them. Once the user clicks then it addes them to the reply box, so the user does not have to type them.

Sir. Mayo
Forumember

Male Posts : 961
Reputation : 84
Language : English, Some french.
Location : Working 11Pm-7Am EST I will try to respond ASAP

http://sir-mayo.forumotion.com/

Back to top Go down

Solved Re: is that possible simple menu with quick reply`s

Post by Michael_vx on June 28th 2015, 12:56 pm

@Sir. Mayo wrote:I can help you explain this better, I have been looking for something like this as well.

What the op is asking is, for there to be a button that when the user presses it it opens a menu. In that menu their are prewritten replies, that the user can choose from by clicking them. Once the user clicks then it addes them to the reply box, so the user does not have to type them.
Shocked
yes you Explained things way way better then me
that is what i meant
Rolling Eyes

Michael_vx
Forumember

Male Posts : 655
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: is that possible simple menu with quick reply`s

Post by Michael_vx on June 29th 2015, 12:35 pm

any news ?

Michael_vx
Forumember

Male Posts : 655
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: is that possible simple menu with quick reply`s

Post by Michael_vx on July 3rd 2015, 10:44 am

should i give up on this or ???
confused

Michael_vx
Forumember

Male Posts : 655
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved re

Post by Globe Administrator on July 3rd 2015, 10:57 am

Waitfortheforumstaffs

Globe Administrator
Forumember

Posts : 92
Reputation : 1
Language : English, Igbo, Pidgin, Yoruba

http://niceplug.niceboard.com

Back to top Go down

Solved Re: is that possible simple menu with quick reply`s

Post by Michael_vx on July 3rd 2015, 9:23 pm

im waiting but still dont know if this will be possible or not Sad

Michael_vx
Forumember

Male Posts : 655
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: is that possible simple menu with quick reply`s

Post by Ange Tuteur on July 7th 2015, 12:22 pm

@Michael_vx and @Sir. Mayo,

This is absolutely possible by setting a new command for the editor. Here's an example I'll give you which will do just that :

Administration Panel > Modules > JavaScript codes management > Create a new script

Placement : In all the pages
Paste the following script :
Code:
$(function() {
  if (!$.sceditor) return;
 
  $.sceditor.command.set('messages', {
    dropDown : function(editor, caller, callback) {
      var messages = {
        'Title' : 'Message content',
        'Hello' : 'Good day !',
        'Goodbye' : 'See you !'
      },
      a, d = document.createElement('DIV'), i;
   
      for (i in messages) {
        a = document.createElement('A');
        a.className = 'sceditor-font-option';
        a.title = messages[i];
        a.innerHTML = i;
        a.onclick = function() {
          callback(this.title);
          editor.closeDropDown(true);
          return false;
        };
        d.appendChild(a);
      }
     
      editor.createDropDown(caller, 'messages', d);
    },
 
    exec : function(c) {
      var e = this;
      $.sceditor.command.get('messages').dropDown(e, c, function(content) {
        e.insertText(content);
      });
    },
 
    txtExec : function(c) {
      var e = this;
      $.sceditor.command.get('messages').dropDown(e, c, function(content) {
        e.insertText(content);
      });
    },
 
    tooltip : 'Preset messages'
  });
 
  toolbar += '|messages'
});

To change the messages you will need to modify the messages object, which is shown below :
Code:
      var messages = {
        'Title' : 'Message content',
        'Hello' : 'Good day !',
        'Goodbye' : 'See you !'
      },

These are set in TITLE : MESSAGE pairs. To add more message presets, simply add a comma after the last pair and create a new pair. ( title : message )

Once done, you'll have a new button to insert preset messages.


Par default the button image is the youtube icon. That can be changed by using the following CSS rule, and replacing IMAGE by the image of your button.
Code:
.sceditor-button-messages div {
  background-image:url('IMAGE') !important;
}

Have a good day, and see you. bye


Last edited by Ange Tuteur on July 10th 2015, 10:39 am; edited 1 time in total

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: is that possible simple menu with quick reply`s

Post by Michael_vx on July 7th 2015, 3:43 pm

affraid
no way Very Happy
i thought my idea was stupid and impossible
im glad its came true
working 100% even with Arabic letters thank thanks thanks a lot
the words of thanks is not Enough
ــــــــــــــــــــــــــــــــــــ
Wait
the button gone while i was testing i re add it still wont show
__________________
i see
this is gonna be a little problem
if there more then 3 messages Script Break and wont work
any way to solve this too ?

Michael_vx
Forumember

Male Posts : 655
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: is that possible simple menu with quick reply`s

Post by Ange Tuteur on July 7th 2015, 4:12 pm

Post here the modified script so I can see what's preventing it from working. Wink

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: is that possible simple menu with quick reply`s

Post by Michael_vx on July 7th 2015, 8:53 pm

What the fuck ?!?
now i`m real confused
so confused that my head is going up in smoke the same while it was not working its working now
Code:
$(function() {
  if (!$.sceditor) return;
 
  $.sceditor.command.set('messages', {
    dropDown : function(editor, caller, callback) {
      var messages = {
        'مايكل سوفت' : '[url=http://micsoft.ga]مايكل سوفت[/url]',
        'بداية موضوع' : 'نبدا الموضوع على بركة الله',
        'شكر' : 'شكرا جزيلا على الموضوع الرائع جدا',
        'انهاء موضوع' : 'وبكده يكون الموضوع انتهى',
        'بداية موضوع2' : 'نبدا الموضوع على بركة الله',
        'شكر2' : 'شكرا جزيلا على الموضوع الرائع جدا',
        'انهاء موضوع2' : 'وبكده يكون الموضوع انتهى',
      },
      a, d = document.createElement('DIV'), i;
 
      for (i in messages) {
        a = document.createElement('A');
        a.className = 'sceditor-font-option';
        a.title = messages[i];
        a.innerHTML = i;
        a.onclick = function() {
          callback(this.title);
          editor.closeDropDown(true);
          return false;
        };
        d.appendChild(a);
      }
   
      editor.createDropDown(caller, 'messages', d);
    },
 
    exec : function(c) {
      var e = this;
      $.sceditor.command.get('messages').dropDown(e, c, function(content) {
        e.insertText(content);
      });
    },
 
    txtExec : function(c) {
      var e = this;
      $.sceditor.command.get('messages').dropDown(e, c, function(content) {
        e.insertText(content);
      });
    },
 
    tooltip : 'Preset messages'
  });
 
  toolbar += '|messages'
});
im not sure what is going on but such a weird things i feel in my testing forum like it wont show the SIGNATURE
some page loading problems so its may be from the test forum not in code
i like to ask for one little more thing
is to max the box with max like 200 high so if many messages used it wont be a bad looking thing Very Happy

Michael_vx
Forumember

Male Posts : 655
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: is that possible simple menu with quick reply`s

Post by Ange Tuteur on July 7th 2015, 9:21 pm

It looks good, however, the last preset had a comma on the end. This can cause a minor error in today's browsers which is corrected, but it will cause a major error in older browsers. I corrected it for you :
Code:
$(function() {
  if (!$.sceditor) return;
 
  $.sceditor.command.set('messages', {
    dropDown : function(editor, caller, callback) {
      var messages = {
        'مايكل سوفت' : '[url=http://micsoft.ga]مايكل سوفت[/url]',
        'بداية موضوع' : 'نبدا الموضوع على بركة الله',
        'شكر' : 'شكرا جزيلا على الموضوع الرائع جدا',
        'انهاء موضوع' : 'وبكده يكون الموضوع انتهى',
        'بداية موضوع2' : 'نبدا الموضوع على بركة الله',
        'شكر2' : 'شكرا جزيلا على الموضوع الرائع جدا',
        'انهاء موضوع2' : 'وبكده يكون الموضوع انتهى'
      },
      a, d = document.createElement('DIV'), i;
 
      for (i in messages) {
        a = document.createElement('A');
        a.className = 'sceditor-font-option';
        a.title = messages[i];
        a.innerHTML = i;
        a.onclick = function() {
          callback(this.title);
          editor.closeDropDown(true);
          return false;
        };
        d.appendChild(a);
      }
 
      editor.createDropDown(caller, 'messages', d);
    },
 
    exec : function(c) {
      var e = this;
      $.sceditor.command.get('messages').dropDown(e, c, function(content) {
        e.insertText(content);
      });
    },
 
    txtExec : function(c) {
      var e = this;
      $.sceditor.command.get('messages').dropDown(e, c, function(content) {
        e.insertText(content);
      });
    },
 
    tooltip : 'Preset messages'
  });
 
  toolbar += '|messages'
});
Other than that it is perfect thumleft

Add this to your CSS it should add a scroll bar when 200px is exceeded :
Code:
.sceditor-dropdown.sceditor-messages {
  height:200px;
  overflow-y:auto;
}

P.S.
The page loading problems and things not appear are due to a current incident.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: is that possible simple menu with quick reply`s

Post by Michael_vx on July 7th 2015, 9:39 pm

i do not think there is a people who use old browsers Very Happy
thanks a lot for correcting what i didnt understand of what you said Very Happy
i guess nothing else needed words of thanks is not Enough i wish some day i get even a little of your exprince im some one who only learn by try things not just read about things Very Happy
thank you again
topic is solved

also about loading pages problem
even on this forum i had a slow respond

Michael_vx
Forumember

Male Posts : 655
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: is that possible simple menu with quick reply`s

Post by SLGray on July 8th 2015, 1:40 am

Topic solved and archived


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


SLGray
Administrator
Administrator

Male Posts : 35641
Reputation : 2374
Language : English
Location : United States

http://fmthemes.forumotion.com/

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