scratch – Diff between revs 28 and 29
?pathlinks?
Rev 28 | Rev 29 | |||
---|---|---|---|---|
Line 68... | Line 68... | |||
68 | <!-- Trumbowyg --> |
68 | <!-- Trumbowyg --> |
|
69 | <script src="js/trumbowyg/trumbowyg.min.js"></script> |
69 | <script src="js/trumbowyg/trumbowyg.min.js"></script> |
|
70 | <script> |
70 | <script> |
|
71 | $(document).ready(() => { |
71 | $(document).ready(() => { |
|
72 | $('#trumbowyg').trumbowyg({ |
72 | $('#trumbowyg').trumbowyg({ |
|
73 | autogrow: true |
73 | autogrow: true, |
|
- | 74 | disabled: true |
||
74 | }).on("tbwchange", () => { |
75 | }).on('tbwchange', () => { |
|
75 | $.post("store-text.php", |
76 | $('#editor').trumbowyg('disable'); |
|
76 | { |
77 | $.post('share-text.php', { |
|
77 | text: $('#trumbowyg').trumbowyg('html'), |
78 | data: $('#trumbowyg').trumbowyg('html'), |
|
78 | action: 'save' |
79 | }).done((data) => { |
|
79 | }, |
80 | $('#trumbowyg').trumbowyg('enable'); |
|
80 | function(data, status){ |
81 | }).fail(() => { |
|
81 | //alert("Data: " + data + "\nStatus: " + status); |
82 | $('#trumbowyg').trumbowyg('enable'); |
|
82 | }); |
83 | }); |
|
83 | }); |
84 | }); |
|
- | 85 | $.get('share-text.php').done((data) => { |
||
- | 86 | $('#trumbowyg') |
||
- | 87 | .trumbowyg('html', data); |
||
- | 88 | $('#trumbowyg').trumbowyg('enable'); |
||
- | 89 | }).fail(() => { |
||
- | 90 | $('#trumbowyg').trumbowyg('enable'); |
||
- | 91 | }); |
||
84 | }); |
92 | }); |
|
85 | </script> |
93 | </script> |
|
86 | </body> |
94 | </body> |
|
87 | </html> |
95 | </html> |