|
@@ -198,15 +198,17 @@
|
|
|
<div class="mb-3">
|
|
|
<div>
|
|
|
<?php
|
|
|
- $shortcuts = $pro->shortcuts;
|
|
|
- $packed = [];
|
|
|
- foreach ($shortcuts as $shortcut) {
|
|
|
- // TEMP Solution - disallow newlines in shortcut expansions
|
|
|
- // $packed[] = $shortcut->shortcut . '|||' . $shortcut->text;
|
|
|
- $packed[] = $shortcut->shortcut . '|||' . preg_replace("/[\\r\\n]+/i", " ", $shortcut->text);
|
|
|
+ $shortCutsObject = [];
|
|
|
+ foreach ($pro->shortcuts as $shortcut) {
|
|
|
+ $shortCutsObject[] = [
|
|
|
+ "name" => $shortcut->shortcut,
|
|
|
+ "value" => $shortcut->text
|
|
|
+ ];
|
|
|
}
|
|
|
- $packed = implode("^^^", $packed);
|
|
|
- $shortcuts = $packed;
|
|
|
+ ?>
|
|
|
+ <script>window.userShortcuts = <?= json_encode($shortCutsObject); ?>;</script>
|
|
|
+ <?php
|
|
|
+ $shortcuts = "";
|
|
|
$latestSectionTS = 0;
|
|
|
?>
|
|
|
@foreach($note->sections as $section)
|
|
@@ -379,7 +381,7 @@
|
|
|
|
|
|
$(this).wrap(
|
|
|
$('<div class="border-left border-right rte-holder"/>')
|
|
|
- .attr('data-shortcuts', '{{ $packed }}')
|
|
|
+ .attr('data-shortcuts', '')
|
|
|
);
|
|
|
|
|
|
// give a unique id to this editor instance
|