Skip to content

Commit

Permalink
rewrite atwho in plain JS
Browse files Browse the repository at this point in the history
  • Loading branch information
live627 committed Dec 8, 2024
1 parent b9949c2 commit 73b3302
Show file tree
Hide file tree
Showing 7 changed files with 1,398 additions and 49 deletions.
5 changes: 3 additions & 2 deletions Sources/Actions/Display.php
Original file line number Diff line number Diff line change
Expand Up @@ -1009,8 +1009,9 @@ protected function setupTemplate(): void

// Mentions
if (!empty(Config::$modSettings['enable_mentions']) && User::$me->allowedTo('mention')) {
Theme::loadJavaScriptFile('jquery.atwho.min.js', ['defer' => true], 'smf_atwho');
Theme::loadJavaScriptFile('jquery.caret.min.js', ['defer' => true], 'smf_caret');
Theme::loadJavaScriptFile('caret.js', ['defer' => true, 'minimize' => true], 'smf_caret');
Theme::loadCSSFile('atwho.css', ['minimize' => true], 'smf_atwho');
Theme::loadJavaScriptFile('atwho.js', ['defer' => true, 'minimize' => true], 'smf_atwho');
Theme::loadJavaScriptFile('mentions.js', ['defer' => true, 'minimize' => true], 'smf_mentions');
}

Expand Down
9 changes: 6 additions & 3 deletions Sources/Actions/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,12 @@ public function show(): void

// Mentions
if (!empty(Config::$modSettings['enable_mentions']) && User::$me->allowedTo('mention')) {
Theme::loadJavaScriptFile('jquery.caret.min.js', ['defer' => true], 'smf_caret');
Theme::loadJavaScriptFile('jquery.atwho.min.js', ['defer' => true], 'smf_atwho');
Theme::loadJavaScriptFile('mentions.js', ['defer' => true, 'minimize' => true], 'smf_mentions');
Theme::loadCSSFile('atwho.css', ['minimize' => true], 'smf_atwho');
Theme::loadJavaScriptFile('atwho.js', ['demfer' => true, 'minimize' => true], 'smf_atwho');
Theme::loadJavaScriptFile('caret.js', ['dmefer' => true, 'minimize' => true], 'smf_caret');
//~ Theme::loadJavaScriptFile('jquery.atwho.min.js', ['defer' => true], 'smf_atwho');
//~ Theme::loadJavaScriptFile('jquery.caret.min.js', ['defer' => true], 'smf_caret');
Theme::loadJavaScriptFile('mentions.js', ['mdefer' => true, 'minimize' => true], 'smf_mentions');
}

// Load the drafts.js file
Expand Down
Loading

0 comments on commit 73b3302

Please sign in to comment.