JD
Full Member
Posts: 771
inherit
180643
0
Aug 17, 2023 0:37:07 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Feb 6, 2018 6:52:15 GMT -8
Hi - quick question... I'm looking for some form of code to place somewhere (maybe in the style sheet - I don't know) that will universally adjust my smileys to be 25px by 25px. This needs to effect the smileys in the post messages, in the preview textarea on the posting page and in the smiley menu drop down. I have a bunch of smileys from different places that are not all the same size, and I'm looking for a way that I can make them the same universal size without having to manually edit and reupload every single one. I've worked out how to edit them in the smiley drop down in the style sheet, but I can't seem to find a way to edit just the smiley icons in the post messages or in the preview text area. If anyone can help with this, that would be awesome. Many thanks! Forum: aludium.proboards.com
|
|
#eb7100
33409
0
1
Apr 14, 2024 15:59:10 GMT -8
Brian
48,129
November 2004
smashmaster3
|
Post by Brian on Feb 6, 2018 9:15:54 GMT -8
Hi, JD. Assuming you're uploading the smileys directly to the theme adding this to your style sheet should work.
|
|
JD
Full Member
Posts: 771
inherit
180643
0
Aug 17, 2023 0:37:07 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Feb 6, 2018 11:17:08 GMT -8
Hi BrianThat works great in both the smiley dropdown and the normal posts (thanks very much!!! ) but it doesn't change their size in the preview textarea when you're composing your message in the posting page? Any chance this can be included...?
|
|
#eb7100
33409
0
1
Apr 14, 2024 15:59:10 GMT -8
Brian
48,129
November 2004
smashmaster3
|
Post by Brian on Feb 6, 2018 11:54:23 GMT -8
The text area of the Preview editor can't be modified using CSS because it's an iframe. It's treated as a completely separate document within the page, meaning it has its own styles. For that reason we need to use Javascript to tell the page to go into the iframe and inject some CSS into its <head> area. I think this will work but I offer no guarantees. My main hurdle is finding an event listener that will properly detect when the Preview editor has been added to the page. When $(document).ready() runs the Preview editor still hasn't loaded so I have to include a setTimeout function to delay the code by 1ms, at which point the Preview editor's iframe is present on the page and ready to be manipulated. I'd prefer something that's less quick and dirty but if it works, it works. Edit: The above paragraph is no longer applicable and the code required is now shorter thanks to this post. This goes in Structure > Headers & Footers > Global Header.
|
|
JD
Full Member
Posts: 771
inherit
180643
0
Aug 17, 2023 0:37:07 GMT -8
JD
771
June 2012
obsidian92
|
Post by JD on Feb 6, 2018 12:48:05 GMT -8
You're a God, man! Totally worked!! Thank you!!
|
|
inherit
Official Code Helper
65613
0
1
Apr 15, 2024 17:01:41 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,858
December 2005
horace
|
Post by Chris on Feb 7, 2018 3:02:47 GMT -8
This is probably the tidy ui-factory event that you were looking for Brian $(document).on('wysiwygcreate', func)
|
|
#eb7100
33409
0
1
Apr 14, 2024 15:59:10 GMT -8
Brian
48,129
November 2004
smashmaster3
|
Post by Brian on Feb 7, 2018 8:57:11 GMT -8
This is probably the tidy ui-factory event that you were looking for Brian $(document).on('wysiwygcreate', func) I dunno where you found that but that's exactly what I was looking for. Even weirder is I've apparently used it before and had no recollection of it. I really have no idea where I got it from. All of my searches for "wysiwygcreate" have yielded nothing.
|
|
inherit
Official Code Helper
65613
0
1
Apr 15, 2024 17:01:41 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,858
December 2005
horace
|
Post by Chris on Feb 9, 2018 4:25:27 GMT -8
I recall discussing it in PM with other plugin authors after studying the UI Factory model and inspecting the jqueryui coding to see which events were fired off in that model and the two events that were consistently fired were $[addon.name]create and $[addon.name]destroy since they were done by the factory itself and not left up to the addon to issue the event. It was however useless to me since it fired AFTER creation and I needed a way to manipulate the wysiwyg before it was created so i could add custom buttons and remove or rearrange others for a plugin I was working on at the time.
|
|