Skip to content

Commit

Permalink
hashtags, others
Browse files Browse the repository at this point in the history
  • Loading branch information
jywarren committed Jun 10, 2016
1 parent c840192 commit ae9a263
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 26 deletions.
1 change: 1 addition & 0 deletions dist/PublicLab.Editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
width: 100%;
position: fixed;
bottom: 0;
left: 0;
}

.ple-footer .ple-help {
Expand Down
36 changes: 23 additions & 13 deletions dist/PublicLab.Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -36526,6 +36526,16 @@ module.exports = function(textarea, _editor, _module) {

}

_module.usernames = [
{ value: '@hodor', text: '@hodor; 1 note' },
{ value: '@sansa', text: '@sansa; 2 notes' },
{ value: '@john', text: '@john; 4 notes' },
{ value: '@rob', text: '@rob; 1 note' },
{ value: '@rickon', text: '@rickon; 5 notes' },
{ value: '@bran', text: '@bran; 1 note' },
{ value: '@arya', text: '@arya; 2 notes' }
];

var wysiwyg = woofmark(textarea, {

defaultMode: 'wysiwyg',
Expand Down Expand Up @@ -36637,15 +36647,7 @@ module.exports = function(textarea, _editor, _module) {
//wysiwyg.calloutHorse = horsey(textarea, {
wysiwyg.calloutHorse = horsey(wysiwyg.editable, {
anchor: '@',
suggestions: [
{ value: '@hodor', text: '@hodor; 1 note' },
{ value: '@sansa', text: '@sansa; 2 notes' },
{ value: '@john', text: '@john; 4 notes' },
{ value: '@rob', text: '@rob; 1 note' },
{ value: '@rickon', text: '@rickon; 5 notes' },
{ value: '@bran', text: '@bran; 1 note' },
{ value: '@arya', text: '@arya; 2 notes' }
],
suggestions: _module.usernames,
set: function (value) {
if (wysiwyg.mode === 'wysiwyg') {
textarea.innerHTML = value;
Expand All @@ -36654,11 +36656,13 @@ module.exports = function(textarea, _editor, _module) {
}
}
});
wysiwyg.bridge = banksy(textarea, {

wysiwyg.calloutBridge = banksy(textarea, {
editor: wysiwyg,
horse: wysiwyg.calloutHorse
});
/*


wysiwyg.tagHorse = horsey(textarea, {
anchor: '#',
suggestions: [
Expand All @@ -36671,11 +36675,11 @@ module.exports = function(textarea, _editor, _module) {
el.value = value + ', ';
}
});
wysiwyg.bridge = banksy(textarea, {

wysiwyg.tagBridge = banksy(textarea, {
editor: wysiwyg,
horse: wysiwyg.tagHorse
});
*/


$('.wk-commands').after('<span style="padding:10px;display:none;" class="ple-history-saving"><i class="fa fa-clock-o"></i><span class="hidden-xs">Saving...</span></span>');
Expand Down Expand Up @@ -36980,6 +36984,12 @@ module.exports = PublicLab.RichTextModule = PublicLab.Module.extend({

// should be switchable for other editors:
_module.wysiwyg = options.wysiwyg || PublicLab.Woofmark(options.textarea, _editor, _module);
_module.wysiwyg.usernames = function(value, done) {
$.get('/users/recent.json', function(response) {
done(response.responseText)
console.log(response.responseText)
});
}

_module.editable = _module.wysiwyg.editable;
_module.textarea = _module.wysiwyg.textarea;
Expand Down
30 changes: 17 additions & 13 deletions src/adapters/PublicLab.Woofmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ module.exports = function(textarea, _editor, _module) {

}

_module.usernames = [
{ value: '@hodor', text: '@hodor; 1 note' },
{ value: '@sansa', text: '@sansa; 2 notes' },
{ value: '@john', text: '@john; 4 notes' },
{ value: '@rob', text: '@rob; 1 note' },
{ value: '@rickon', text: '@rickon; 5 notes' },
{ value: '@bran', text: '@bran; 1 note' },
{ value: '@arya', text: '@arya; 2 notes' }
];

var wysiwyg = woofmark(textarea, {

defaultMode: 'wysiwyg',
Expand Down Expand Up @@ -132,15 +142,7 @@ module.exports = function(textarea, _editor, _module) {
//wysiwyg.calloutHorse = horsey(textarea, {
wysiwyg.calloutHorse = horsey(wysiwyg.editable, {
anchor: '@',
suggestions: [
{ value: '@hodor', text: '@hodor; 1 note' },
{ value: '@sansa', text: '@sansa; 2 notes' },
{ value: '@john', text: '@john; 4 notes' },
{ value: '@rob', text: '@rob; 1 note' },
{ value: '@rickon', text: '@rickon; 5 notes' },
{ value: '@bran', text: '@bran; 1 note' },
{ value: '@arya', text: '@arya; 2 notes' }
],
suggestions: _module.usernames,
set: function (value) {
if (wysiwyg.mode === 'wysiwyg') {
textarea.innerHTML = value;
Expand All @@ -149,11 +151,13 @@ module.exports = function(textarea, _editor, _module) {
}
}
});
wysiwyg.bridge = banksy(textarea, {

wysiwyg.calloutBridge = banksy(textarea, {
editor: wysiwyg,
horse: wysiwyg.calloutHorse
});
/*


wysiwyg.tagHorse = horsey(textarea, {
anchor: '#',
suggestions: [
Expand All @@ -166,11 +170,11 @@ module.exports = function(textarea, _editor, _module) {
el.value = value + ', ';
}
});
wysiwyg.bridge = banksy(textarea, {

wysiwyg.tagBridge = banksy(textarea, {
editor: wysiwyg,
horse: wysiwyg.tagHorse
});
*/


$('.wk-commands').after('<span style="padding:10px;display:none;" class="ple-history-saving"><i class="fa fa-clock-o"></i><span class="hidden-xs">Saving...</span></span>');
Expand Down
6 changes: 6 additions & 0 deletions src/modules/PublicLab.RichTextModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ module.exports = PublicLab.RichTextModule = PublicLab.Module.extend({

// should be switchable for other editors:
_module.wysiwyg = options.wysiwyg || PublicLab.Woofmark(options.textarea, _editor, _module);
_module.wysiwyg.usernames = function(value, done) {
$.get('/users/recent.json', function(response) {
done(response.responseText)
console.log(response.responseText)
});
}

_module.editable = _module.wysiwyg.editable;
_module.textarea = _module.wysiwyg.textarea;
Expand Down

0 comments on commit ae9a263

Please sign in to comment.