mpowaga / meteor-autoform-summernote Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://atmospherejs.com/mpowaga/autoform-summernote
Home Page: https://atmospherejs.com/mpowaga/autoform-summernote
I am able to insert data in database successfully however, while outputting data in the browser it shows code like this
<p><b>abstract text comes here...</b></p>
instead of
abstract text comes here...
Article schema
@Articles = new Meteor.Collection('articles');
Schema = {}
Schemas.Articles = new SimpleSchema
abstract:
optional:true
type: String
autoform:
afFieldInput:
type: 'summernote'
class: 'abstract'
height: 200
Article Template
<table class="table table-bordered article-table">
<tbody>
{{#each articles}}
<tr>
<td colspan="2">
<h3>{{title}}</h3>
<p class="abstract-wrapper">
<p class="abstracts">
{{abstract}}
</p>
</p>
</td>
<td>
<button type="button" class="btn btn-primary edit">Edit</button>
</td>
<td>
<button type="button" class="btn btn-danger delete">Delete</button>
</td>
</tr>
{{/each}}
</tbody>
</table>
hi , i'm using summernote now , i have some problem with insert image type TIF , i can't insert it . have any idea about this problem ? thank for advance !!!
Hi
I'm trying to implement a custom button into my summernote toolbar. Using mpowaga/meteor-autoform-summernote.
My Schema refers to autoform and summernote:
autoform: {
afFieldInput: {
type: 'summernote',
class: 'editor', // optional
settings: SummernoteConfig.description // summernote options goes here
},
}
my config is
SummernoteConfig = {};
var ObjectInsertButton = function (context) {
var ui = $.summernote.ui;
var buttonGroup = ui.buttonGroup([
ui.button({
contents: '<i class="fa fa-external-link"/><span class="caret"></span>',
tooltip: 'Add an object from your universe',
data:{
toggle: 'dropdown'
}
}),
ui.dropdown({
className: 'dropdown-style',
contents: "<ol><li>hello</li><li>hello europe</li><li>hello europe</li></ol>",
callback: function ($dropdown) {
$dropdown.find('li').each(function () {
$(this).click(function() {
context.invoke('editor.insertText', 'hello');
});
});
}
})
]);
return buttonGroup.render(); // return button as query object
};
SummernoteConfig.description = {
height: 250,
toolbar: [
// [groupName, [list of button]]
['paragraph',['style']],
['style', ['bold', 'italic', 'underline', 'clear']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['mayouga',['objectinsertbtn']]
],
buttons: {
objectinsertbtn: ObjectInsertButton
}
};
when invoking the click event context is undefined.
What do i have to do? Help appreciated.
Hi! i put the option in mi collection:.
Efecto: { type: String, min: 10, optional: true, autoform: { afFieldInput: { type: 'summernote', lang: 'es-ES', class: 'editor', // optional settings:"" // summernote options goes here } } },
who can download and put the file, like a lang/summernote-es-ES.js, i donwload this file, but i can't use, the error is jquery is not defined
In readme, you have mentioned
" Remember to sanitize the HTML on the server!"
Can you please give me an example of how to do it?
I am inserting docs in collection using yogiben:admin.
Thanks.
Greetings,
After adding the field into my schema when I go to edit the item the style dropdown and any dropdown on the summernote toolbar does not render properly.
Good afternoon,
Your package is really great and works like a charm. However, I need to switch to AutoForm 6.0 but your api version forbids it. Have you tried your package against AutoForm 6.0 and do you think you can release a new version with this compatibility?
Many thanks in advance.
Could I show the Tooltip like "Bold (Ctr+B)";
I have tried doing the following but it's not working
settings: [
['style', ['bold', 'italic', 'underline', 'clear']],
['font', ['strikethrough', 'superscript', 'subscript']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']]
]
toolbar: [
['style', ['bold', 'italic', 'underline', 'clear']],
['font', ['strikethrough', 'superscript', 'subscript']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']]
]
I'm having problems with the location of tooltips on my app. They appear on layers below the modal.
This is happening on chrome, safari and firefox.
Is there a way to disable tooltips for the time being?
I can't set place holder for my textarea
description: {
type: String,
label: "Description",
max: 10000,
autoform: {
afFieldInput: SUMMERNOTE_OPTIONS,
placeholder: "Tell us something unique about yourself"
}
}
summernote options:
SUMMERNOTE_OPTIONS = {
type: 'summernote',
height: 300,
minHeight: 300,
toolbar: [
['style', ['style']],
['font', ['bold', 'italic', 'underline', 'clear']],
['para', ['ul', 'ol']],
['insert', ['link','hr']],
['misc', ['codeview']]
],
styleWithSpan: false
};
It does not show the placeholder
I have a field named content, with the following definition, and for a reason I can't quite understand, I'm getting this field definition error.
content: {
type: String,
afFieldInput: {
type: 'summernote',
class: 'editor', // optional
settings: {}// summernote options goes here
}
}
and the error:
W20160731-17:16:41.382(-4)? (STDERR) Error: Invalid definition for content field.
W20160731-17:16:41.382(-4)? (STDERR) at packages/aldeed_simple-schema/simple-schema.js:457:1
W20160731-17:16:41.382(-4)? (STDERR) at Function._.each._.forEach (packages/underscore/underscore.js:113:1)
W20160731-17:16:41.383(-4)? (STDERR) at [object Object].SimpleSchema (packages/aldeed_simple-schema/simple-schema.js:454:1)
W20160731-17:16:41.383(-4)? (STDERR) at meteorInstall.collections.pages.js (collections/pages.js:3:17)
W20160731-17:16:41.383(-4)? (STDERR) at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:153:1)
W20160731-17:16:41.384(-4)? (STDERR) at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1)
W20160731-17:16:41.384(-4)? (STDERR) at i18n/en.i18n.json:14:1
W20160731-17:16:41.384(-4)? (STDERR) at /Users/Julian/Google Drive/Meteor/beyond-words/.meteor/local/build/programs/server/boot.js:297:10
W20160731-17:16:41.385(-4)? (STDERR) at Array.forEach (native)
W20160731-17:16:41.385(-4)? (STDERR) at Function._.each._.forEach (/Users/Julian/.meteor/packages/meteor-tool/.1.4.0.1779qjh++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
=> Exited with code: 1
=> Your application is crashing. Waiting for file change.
I'm looking for ideas on why this may be happening.
I'm not being able to edit text on safari, changing to code view allows editing.
It's working properly on chrome and firefox.
This is happening in meteor 1.2.0.2 and 1.2.1, with different versions of autoform-summernote and summernote itself. This could be related with using autoform-modal.
I'm getting this error when clicking on the edit area:
TypeError: null is not an object (evaluating 'rng.isCollapsed')
update summernote.js:5971
summernote.keyup summernote.mouseup summernote.change summernote.scroll summernote.js:5935
dispatchjquery.js:4664
handlejquery.js:4332
triggerjquery.js:4573
(anonymous function)jquery.js:5283
eachjquery.js:383
eachjquery.js:135
triggerjquery.js:5282
triggerEventsummernote.js:1601
(anonymous function)summernote.js:3743
dispatchjquery.js:4664
handlejquery.js:4332
UPDATE: This is definitely related to using autoform-modals, regular autoform works ok.
I built an autoform with summernote using this package. After submitting the form, all other fields are cleared except summernote fields. Can it be cleared as well? Thanks.
Hi,
i got this error with this setup
Books = new Meteor.Collection('Books')
var BookSchema = new SimpleSchema({
title: {
type: String,
label: "Title",
max: 200
},
content: {
type: String,
label: "Yet another poem",
autoform: {
afFieldInput: {
type: 'summernote',
class: 'editor', // optional
settings: {
height: 200
}
}
}
}
});
Books.attachSchema(BookSchema)
template
<body>
{{#autoForm id="booksform" collection="Books" type="insert"}}
{{> afQuickField name='title'}}
{{> afQuickField name='content'}}
{{/autoForm}}
</body>
packages
aldeed:autoform
aldeed:collection2
aldeed:simple-schema
mpowaga:autoform-summernote
fortawesome:fontawesome
How to fix this?
The links at the bottom of the README to options can callbacks goes to unknown pages.
After update summernote to latest version 0.7.0, above error message appear.
Hi, i have a problem with the menu (like a font, color, aling), i click in the button but don't dropdown, i use
summernote:[email protected]
chhib:[email protected]
comerc:[email protected]
twbs:[email protected]
i thinks its for conflict with version of dropdown or bootstraps, but i uninstalled selectize and don't work. THANKS!
The options are reseted, after getting the html of the editor. So i cannot apply any settings, is this a version problem or so?
Good Afternoon,
i have updated to Meteor 1.3.x coming from 0.x Version.
Summernote worked fine before, but now existing text is not reflected in the control anymore. Same new typed text seems not to be bound to data as i receive a message that the string text is missing.
Something i missed to change?
thanks
autoForm
has the autosave
option, which does not seem to work with summernote in this repo.
Is there a way to achieve it?
With other text fields in autoform, an autosave means saving upon a blur
event.
Does this also handle image upload ?
~Marc
When I "update" an autoform, the original form content is automatically populated. In my case, meteor usually subscribes a subset of the fields of the form. When the form is displayed, the client then subscribe all fields of the form. In this case, the form is rendered twice, once only showing a subset of fields populated, then it should show all fields populated. However, none of the summernote fields in the form are populated if it is subscribed in the second time. But all other non-summernote fields are still populated even if they are subscribed in the second time.
This is an issue with summernote fields?
Any chance on updating it to autoform 5?
If you just update the api.use section I can test it and confirm everything is working.
Thanks!
Can you provide a quick example of how to sanitize with this package?
You provide some insight here:
But I'm not sure it's relevant to using summer-note w/ autoform is it? And autoform hooks are client-side, so we can't use sanatize in an autoform before hook?
It seems other people are confused as well. This person (link below) is trying to put the allowed values into the simpleschema's summer-note settings object , but it seems like the sanatize call has to happen in a method? That's assuming your autoform is submitted and updated using a method?
SO below:
http://stackoverflow.com/questions/36240098/sanatize-html-on-server-in-schema
Lastly, great package! Thanks.
Hi, After implementing summernote using the instructions in the README I am getting the error above when I try to submit the form. When I click on the error in the console, this function appears
AutoForm.addInputType('summernote', {
template: 'afSummernote',
valueOut: function() {
return this.code(); (An 'x' Shows up on this line as the offender)
}
});
I use Autoform 5.1.2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.