PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri Oct 19, 2018 6:02 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Mon May 09, 2016 9:20 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4425
Location: United Kingdom
http://summernote.org/getting-started/
Trying to use this for posting data for users on phones too, as it's responsive.
Trouble is, I don't see how it captures the data to post it to a variable. Unlike, for example, tinymce.

Any ideas?

Syntax: [ Download ] [ Hide ]
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css" rel="stylesheet">
  <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script>
  <script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js"></script>
  <link href="/js/summernote/summernote.css" rel="stylesheet">
  <script src="/js/summernote/summernote.js"></script>


<div id='summernote'>$row->description</div>
  <script>
    $(document).ready(function() {
        $('#summernote').summernote({
          minHeight: 200,
  maxHeight: 450,
    toolbar: [
    ['style', ['bold', 'italic', 'underline']],
    ['font', ['strikethrough', 'superscript', 'subscript']],
    ['color', ['color']],
    ['para', ['ul', 'ol', 'paragraph']],
  ],
        });
    });
  </script>
 

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
PostPosted: Mon May 09, 2016 9:57 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6424
Location: Montreal, Canada
Change the div to a textarea, give it a name, wrap it in a form, and you're done.

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Mon May 09, 2016 10:01 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4425
Location: United Kingdom
Goodness, simple as that! Thanks a mill.

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
PostPosted: Tue May 10, 2016 2:56 pm 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4425
Location: United Kingdom
Any ideas why it defaults to have the Bold button on?

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
PostPosted: Tue May 10, 2016 3:08 pm 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6424
Location: Montreal, Canada
Doesn't do that for me. What does your configuration look like?

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Tue May 10, 2016 3:21 pm 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4425
Location: United Kingdom
The only thing over and above the standard install is this code, as we didn't want the user to enter a different font, and break the design of the site's branding.

Syntax: [ Download ] [ Hide ]
  <script>
    $(document).ready(function() {
        $('#summernote').summernote({
          minHeight: 200,
  maxHeight: 450,
    toolbar: [
    ['style', ['bold', 'italic', 'underline']],
    ['font', ['strikethrough', 'superscript', 'subscript']],
    ['color', ['color']],
    ['para', ['ul', 'ol', 'paragraph']],
  ],
        });
    });
  </script>

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
PostPosted: Tue May 10, 2016 3:29 pm 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6424
Location: Montreal, Canada
There must be something else at play.
Syntax: [ Download ] [ Hide ]
<!DOCTYPE html>
<html lang="en">
  <head>
    <!-- include libraries(jQuery, bootstrap) -->
    <link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css" rel="stylesheet">
    <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script>
    <script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js"></script>

    <!-- include summernote css/js-->
    <link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.1/summernote.css" rel="stylesheet">
    <script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.1/summernote.js"></script>
  </head>
  <body>
    <form method="post" action="">
      <div class="form-group">
        <textarea id="summernote" name="summernote"></textarea>
      </div>
      <button type="submit">Submit</button>
    </form>
    <script>
    $(document).ready(function() {
        $('#summernote').summernote({
        minHeight: 200,
          maxHeight: 450,
          toolbar: [
            ['style', ['bold', 'italic', 'underline']],
            ['font', ['strikethrough', 'superscript', 'subscript']],
            ['color', ['color']],
            ['para', ['ul', 'ol', 'paragraph']],
          ],
      });
    });
    </script>
  </body>
</html>

That's what I've got and bold is most certainly not enabled by default.

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group