Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4252
Latest: Jwatson_785
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 43229
Total Topics: 7514
Most Online Today: 117
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 79
Total: 79

Author Topic: Clipboard image support for the editor  (Read 1515 times)

0 Members and 1 Guest are viewing this topic.

Offline Anwendungsfehler

  • Community Suite Customer
  • Member
  • ******
  • Posts: 21
    • View Profile
Clipboard image support for the editor
« on: January 19, 2024, 05:12:26 pm »
Hi guys,

I really like smf, but there is a feature I have in xenForo / wpForo which I miss here.

When I create a support/tutorial thread, I use several programs to take screenshots, such as Snagit, or I use Affinity Photo/Designer.
I use the "Copy to clipboard" function very often. In the mentioned forum softwares I can paste any picture directly by pressing Ctrl+V.

It would be super convenient to have a mod like this!

Cheers,
Alexander

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16422
    • View Profile
Re: Clipboard image support for the editor
« Reply #1 on: January 19, 2024, 10:25:38 pm »
Maybe into the editor. this is the editor SMF uses.
https://www.sceditor.com/posts/drag-drop-upload-demo/

I tried doing that long ago to post imgur but failed in my attempts
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16422
    • View Profile
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Anwendungsfehler

  • Community Suite Customer
  • Member
  • ******
  • Posts: 21
    • View Profile

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16422
    • View Profile
Re: Clipboard image support for the editor
« Reply #4 on: January 24, 2024, 01:07:31 pm »
Yeah I tried but couldn't get it to work.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Anwendungsfehler

  • Community Suite Customer
  • Member
  • ******
  • Posts: 21
    • View Profile
Re: Clipboard image support for the editor
« Reply #5 on: January 24, 2024, 03:07:25 pm »
Hmmm... what I found somewhere else... :)

Preinfo:
However the file "*smfpack*.js" doesn't exist - I found the quote inside "jquery.sceditor.smf.js" instead.

Code: [Select]

Hi I have a quick little patch you can do to improve the SMFPacks WYSIWYG Editor. Many thanks to Sam Clarke, the author of the SCEditor for helping me with this! Please proceed at your own risk.

The SCEditor is the underlying editor code that the SMF Packs editor uses, its basically the heart of this mod. Updating it fixes many issues this mod has that have gone unresolved.


Download the latest SCEditor code here: Releases samclarke/SCEditor GitHub
Unzip it, open the "minified" folder and copy the "jquery.sceditor.bbcode.min.js" and "plugins" folders to your desktop.
Go to your forum files open /Themes/default/scripts/advanced_editor
Replace the "jquery.sceditor.bbcode.min.js" and plugins folders with the new ones from your desktop.
Open jquery.sceditor.smfpacks.js in a text editor and make these edits

Find:
CodeSelect
sceditor.formats.bbcode.set(
'quote', {

Replace
sceditor.formats.bbcode.set(
'quote', {
tags: {
blockquote: null,
cite: null
},
quoteType: $.sceditor.BBCodeParser.QuoteType.never,
breakBefore: false,
isInline: false,
format: function (element, content) {
var element = $(element);
var author = '';
var date = '';
var link = '';

// The <cite> contains only the graphic for the quote, so we can skip it
if (element[0].tagName.toLowerCase() === 'cite')
return '';

          // Changed these to use data- attributes
if (element.attr('data-author'))
author = ' author=' + element.attr('data-author').php_unhtmlspecialchars();
if (element.attr('data-link'))
link = ' link=' + element.attr('data-link');
if (element.attr('data-date'))
date = ' date=' + element.attr('data-date');

return '[quote' + author + link + date + ']' + content + '[/quote]';
},
html: function (element, attrs, content) {
var attr_author = '', author = '';
var attr_date = '', sDate = '';
var attr_link = '', link = '';

if (typeof attrs.author !== "undefined" && attrs.author)
{
attr_author = attrs.author;
author = bbc_quote_from + ': ' + attr_author;
}

// Links could be in the form: link=topic=71.msg201#msg201 that would fool javascript, so we need a workaround
// Probably no more necessary
for (var key in attrs)
{
if (key.substr(0, 4) == 'link' && attrs.hasOwnProperty(key))
{
var attr_link = key.length > 4 ? key.substr(5) + '=' + attrs[key] : attrs[key];

link = attr_link.substr(0, 7) == 'http://' ? attr_link : smf_scripturl + '?' + attr_link;
author = author == '' ? '<a href="' + link + '">' + bbc_quote_from + ': ' + link + '</a>' : '<a href="' + link + '">' + author + '</a>';
}
}

if (typeof attrs.date !== "undefined" && attrs.date)
{
attr_date = attrs.date;
tDate = new Date(attr_date * 1000);
sDate_string = tDate.toLocaleString();
sDate = '<date timestamp="' + attr_date + '">' + sDate_string + '</date>';
}

if (author == '' && sDate == '')
author = bbc_quote;
else if (author == '' && sDate != '')
author += ' ' + bbc_search_on;

            // Changed this to use data- attributes
content = '<blockquote data-author="' + attr_author + '" data-date="' + attr_date + '" data-link="' + attr_link + '"><cite>' + author + ' ' + sDate + '</cite>' + content + '</blockquote>';

return content;
}
}
);

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16422
    • View Profile
Re: Clipboard image support for the editor
« Reply #6 on: January 29, 2024, 11:22:17 am »
Yeah we use the sceeditor for 2.1 smf.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

 

Related Topics

  Subject / Started by Replies Last post
3 Replies
6049 Views
Last post February 19, 2008, 08:25:28 pm
by SMFHacks
10 Replies
6707 Views
Last post March 10, 2008, 02:10:54 pm
by Weathernut
1 Replies
5909 Views
Last post September 11, 2011, 10:31:11 am
by SMFHacks
16 Replies
5872 Views
Last post October 19, 2018, 11:26:45 pm
by dan42101
7 Replies
3300 Views
Last post November 25, 2018, 03:12:19 pm
by SMFHacks

+- Recent Topics

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Request for admin notification by davejo
February 06, 2024, 09:02:12 am

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

User Gallery Feature: move / bulk move images by SMFHacks
January 30, 2024, 05:48:25 pm

In the future it may be for smf 2.1.x? by smithloo
January 30, 2024, 12:55:34 am

Clipboard image support for the editor by SMFHacks
January 29, 2024, 11:22:17 am

Release date? by SMFHacks
January 26, 2024, 02:00:45 pm

Powered by EzPortal