News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

How to Enable Formatting Hotkeys?

Started by JoshuaD, December 23, 2019, 01:25:49 AM

Previous topic - Next topic

JoshuaD

Here on this forum, if I select text and then press Ctrl + B, that text gets surrounded by bold tags.

How do I enable that for my forums for the various tags?  SMF 2.0.15.

Illori

I bet you are using the WYSIWYG editor here. it is not recommended to use it as it does not work well.

JoshuaD

I don't believe so. Here is a screenshot:



Sir Osis of Liver

It works here, and on a scratch install with wysiwyg disabled.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

JoshuaD

I just re-downloaded the default theme and set that as my forum's theme. It is not working. 

I'd like to avoid trying to do a fresh install.  I installed the current version about a month ago.

Do you know where this functionality is programmed in? I can take a look there and see why it's not working for my install.

m4z

"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

JoshuaD

When I select text here and press Ctrl + B, the editor inserts bold tags around the selected text.

When I do that on my forum, no tags are inserted.  The key combinations (ctrl+B, ctrl+I, ctrl+U, and whatever else) do not do anything.

JoshuaD

It might be related to "Themes/deafult/scripts/editor.js". I think the function that's misbehaving or not being called is maybe on line 1234:

smc_Editor.prototype.shortcutCheck

When I inspect the code for this forum, the text area I type in to make this post has an event registered for "keydown":


function(oEvent) {
   return 
oCaller.shortcutCheck(oEvent);
}


When I inspect the code for my forum, there is no keydown event registered for the textarea, so I think that's the problem.  I'm just not sure why mine isn't registering that keydown, or how to add it back in.

Sir Osis of Liver

Quote from: JoshuaD on December 24, 2019, 02:37:34 AM
I just re-downloaded the default theme and set that as my forum's theme.

"re-downloaded" how?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Matthias

What's your PHP and MySQL Version?
Some PHP Versions 5.x doesn't work with this.
Quality first

JoshuaD

Quote from: Sir Osis of Liver on December 24, 2019, 04:12:50 PM
Quote from: JoshuaD on December 24, 2019, 02:37:34 AM
I just re-downloaded the default theme and set that as my forum's theme.

"re-downloaded" how?

I had edited the default theme when I didn't understand that it should be untouched.

To fix this, I unzip'd the SMF install, removed my edited default theme, and replaced it with the folder Themes/default from the smf install zip.


JoshuaD

Quote from: Matthias on December 24, 2019, 04:30:31 PM
What's your PHP and MySQL Version?
Some PHP Versions 5.x doesn't work with this.

PHP 5.6.40
MySQL v 15.1

Matthias

/index.php?theme=1

what do you get displayed?
Quality first

Sir Osis of Liver

Quote from: JoshuaD on December 24, 2019, 05:18:41 PM
I unzip'd the SMF install, removed my edited default theme, and replaced it with the folder Themes/default from the smf install zip.

That would brreak any mods that were installed in theme files.  Nothing wrong with editor.js if you've uploaded complete clean theme.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

JoshuaD

Quote from: Matthias on December 24, 2019, 06:57:23 PM
/index.php?theme=1

what do you get displayed?

The default theme.  Ctrl + B still doesn't work.

Sir Osis of Liver

Works on all my prod and test forums, and several client forums I tried.  AFAIK it's not a setting, but if it is it's enabled by default.  If it works for you here it's not a browser problem.  Running any mods?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

JoshuaD

I have a few mods installed, not a ton:

Spoiler BB Code
Dice Roller BBCode
Resize Attached Images
Add Table, Td, Tr Button

Is there a way to do a fresh install of all the files without losing my database, users,  and posts?  I am comfortable with PHP database exports and imports.

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

JoshuaD

I tried following the directions at that link but it did not fix the hotkey problem, so I reverted the changes.

I then tried doing a fresh install of SMF at an alternate URL on the same server.

I had a strange thing happen where all of the resources it tries to load are at 127.0.0.1.

Here is a link:

https://joshuad.net/forum-fix-test/

Here are the first couple lines of the source:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="http://127.0.0.1/smf/Themes/default/css/index.css?fin20" />
<script type="text/javascript" src="http://127.0.0.1/smf/Themes/default/scripts/script.js?fin20"></script>
<script type="text/javascript" src="http://127.0.0.1/smf/Themes/default/scripts/theme.js?fin20"></script>[


As you can see, all of those links should be "http://joshuad.net/forum-fix-test/" rather than "http://127.0.0.1/smf/"

I had this happen on my actual forums, but I dug into the source and was able to manually replace things and make the problem go away. This time I did not do that, since I didn't want to do anything but raw vanilla, to try to troubleshoot this hotkey problem.

Any idea what is causing this and how I fix it? Then I can test whether a completely fresh and clean install on a completely new database still has this hotkey problem. If so, then I am comfortable assuming it's my php version. If not, then I'll start from the fresh install and figure out what I did wrong on my actual install.


Sir Osis of Liver

The test install is running, you need to run repair_settings.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: