-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example of using textarea with Keditor #35
Comments
Nice example. Glad to see it's helpful for your project |
Thanks @anhnt . Now if we could only get the textarea to work with Keditor. We are stuck and cannot get it save the content... |
Using the above setup works perfectly with CKeditor alone BUT, will not when adapted to Keditor. The text.inc is accessed but not written to. If anyone interested in helping us out, this is what we have setup for Keditor: ` <title>KEditor - Kademi Content Editor</title> <script src="plugins/jquery-1.11.3/jquery-1.11.3.min.js"></script> <script src="plugins/bootstrap-3.3.6/js/bootstrap.min.js"></script> <script type="text/javascript"> var bsTooltip = $.fn.tooltip; var bsButton = $.fn.button; </script> <script src="plugins/jquery-ui-1.11.4/jquery-ui.min.js"></script> <script src="plugins/jquery-ui.touch-punch-0.2.3/jquery.ui.touch-punch.min.js"></script> <script type="text/javascript"> $.widget.bridge('uibutton', $.ui.button); $.widget.bridge('uitooltip', $.ui.tooltip); $.fn.tooltip = bsTooltip; $.fn.button = bsButton; </script> <script src="plugins/jquery.nicescroll-3.6.6/jquery.nicescroll.min.js"></script> <script src="plugins/ckeditor-4.5.6/ckeditor.js"></script> <script src="plugins/ckeditor-4.5.6/adapters/jquery.js"></script> <script src="dist/js/keditor-1.1.3.min.js"></script> <script src="dist/js/keditor-components-1.1.3.min.js"></script>
I am hesitate to ask this at Stackoverflow since did not find single reference to it there. Cannot seems to find any info on using Keditor with textareas anywhere. If asking here is wrong route, let me know and we will try to find info outside of issue area. Thanks in advance. |
Hi @2braincells2go. KEditor is pretty new so there's not much in the way of content on stackoverflow. You get the value of the content from KEditor like this:
Here's the js code we use in Kademi to save, this is from a button click event:
|
If it helps, here is that code in context: |
@bradmac thanks much for input. I will explore your suggestions and see what we can come up with. If I may make a suggestion: why not setup example using a textarea? Asking around to more advanced people they too seemed confused on how to use. Really like Keditor and sure it will soon become very popular:) |
Thanks! BTW, if you want to see it in action here's a vid of using keditor with dynamic components - http://www.kademi.co/blogs/kb/building-customized-analytics-dashboards/ |
Well, unfortunately we have gotten no where with our attempts to incorporate Keditor into our classroom project. Using our PHP save method works flawless with CKEditor but after hours of trying to get working Keditor no luck. Guess we will try again after the Holidays. Will close this. Thanks |
Sorry to hear that. Did you try my JS above? Should only take a few mins to integrate. |
@bradmac Yes sir, we tried the example JS you suggested. Never it got it working with our PHP save method. Kept getting undefined errors and such. Sure it is something we were missing. Thanks! |
Just a note that KEditor is not intended as a drop-in replacement for ckeditor, ie you do need to use js to integrate it into your form. You get the value of the content like this
And then you need to do something with that. If you are posting a form you need to set that into a form input using js. Eg
|
Thanks again for your input Brad, it is much appreciated. Totally understand Keditor is not a drop-in replacement for ckeditor. Just trying to get Keditor working with what we have already thrown together. When I say "we", referring to a group of teenagers with oldest being 16 years and then me (old fellow), and I am not strong on javascript. Another issue we face is working on a school network with tight rules/security. That is another reason we are trying to use the PHP already in place as it is approved (does not set off firewall alarms). We placed Thanks much! |
Cool, sounds like a lot of fun! One thing you might want to try is doing the post with AJAX instead of an old fashioned page form post. Thats what we do in Kademi which is probably why our code looks very different from yours. But ajax gives a much better experience to the user, and makes it easier for you as developers to implement different requirements. That can still use the same php service you have now. |
Yes, need to move forward with AJAX as some point. Since I only use this whole setup to teach a little about building with Bootstrap, have not ventured into AJAX yet. By any chance, do you have a working example of using the save function (like you speak of on Kademi)? Looking at your suggestion: ` btnSaveFile.on('click', function (e) {
|
Thats our production code, but we dont have that in an example at the moment, sorry. I'll try to knock one up over the holidays. Although all our examples are client side only so we probably wont have an actual server to use it with. |
You perhaps did not get a chance to "knock one up" (example based on our try above) did you? |
Sorry, no. But keditor is really just a client side tool, its up to you to provide whatever it is that you'll be POSTing to |
No problem. Did not mean to bother you guys. Students did not really like the flow of KEditor anyway. Cheers! |
Just stumbled across Keditor again and really like the way it is coming along, great job.
Currently using CKEditor in classroom project and have setup using textarea and some PHP to save the textarea content. I will note this is for learning in classroom only and we are not worried about security.
I had seen in closed issue that Keditor now support textareas. We have been struggling for hours attempting to get Keditor working with textarea and hoping for some input.
Our PHP looks like this:
` <?php
With save button like this:
<input class="btn btn-primary btn-lg raised" id="load" type="submit" name="write" id="write" value="SAVE" />
And textarea is:
<textarea style="width:100%;" class="input-block-level" name="content" id="editor1"><?php include Data/test.inc'; ?></textarea>
Any input will be greatly appreciated. Really like to start using Keditor simply because off the drag and drop.
Cheers!
The text was updated successfully, but these errors were encountered: