HEX
Server: LiteSpeed
System: Linux s1296.sgp1.mysecurecloudhost.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User: bishwesh (1878)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/bishwesh/internstolearn.com/node_modules/summernote/examples/hint-userdefine.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  <title>summernote</title>
  <!-- include jquery -->
  <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>

  <!-- include libs stylesheets -->
  <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.css" />
  <script src="//cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.5/umd/popper.js"></script>
  <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.js"></script>

  <!-- include summernote -->
  <link rel="stylesheet" href="../dist/summernote-bs4.css">
  <script type="text/javascript" src="../dist/summernote-bs4.js"></script>

  <script src="https://www.google.com/jsapi" type="text/javascript"></script>

  <link rel="stylesheet" href="example.css">
  <script type="text/javascript">
    $(function() {
      $('.summernote').summernote({
        height: 200,
        hint: {
          match: /#(\w{2,})$/,
          search: function(keyword, callback) {
            $.ajax({
              url: 'https://api.github.com/search/repositories?q=' + keyword + '&order=asc'
            }).then(function (data) {
              callback(data.items);
            });
          },
          content: function(item) {
            return '[' + item.full_name + '] ' + item.description;
          },
          template: function(item) {
            return '[<strong>' + item.full_name + '</strong>] ' + item.description;
          }
        }
      });
    });
  </script>
</head>
<body>
<div class="container">
  <h1>Summernote with User-defined hint</h1>
  <p>Please wait a moment while retrieving search result from GitHub after typing.</p>
  <textarea class="summernote">type #su</textarea>
</div>
</body>
</html>