Advertisement
ryanburnett

Bootstrap modal/TinyMCE fix

Mar 6th, 2012
688
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <div class="block-header">
  2.     header
  3. </div>
  4.  
  5. <form id="userdata_form">
  6.  
  7. <!-- SNIP! -->
  8.  
  9. <p class="inline-medium-label">
  10.     <label for="details">Detailed Description</label>
  11.     <textarea name="details" class="full-width" id="wysiwyg" rows="12" style="font-size:100%"><?= isset($benefit->details) ? $benefit->details : '' ?></textarea>
  12. </p>
  13.  
  14. <div class="block-footer">
  15.     <button type="button" id="save_button" class="float-right">Save</button>
  16.     <br>&nbsp;
  17. </div>
  18.  
  19. </form>
  20.  
  21. <script>
  22.  
  23.     // Set up save button
  24.     $("#save_button").click( function() {
  25.         //snip!
  26.     });
  27.  
  28.     // Delay half a second before setting up the control:
  29.     setTimeout( function() {
  30.         $("#wysiwyg").wysiwyg({
  31.             'initialContent': '',
  32.             controls: {
  33.                 h1: { visible: false },
  34.                 h2: { visible: false },
  35.                 h3: { visible: true },
  36.                 h4mozilla: {
  37.                     visible: true && $.browser.mozilla,
  38.                     className: 'h4',
  39.                     command: 'heading',
  40.                     arguments: ['h4'],
  41.                     tags: ['h4'],
  42.                     tooltip: "Header 4"
  43.                 },
  44.                 h5mozilla: {
  45.                     visible: true && $.browser.mozilla,
  46.                     className: 'h5',
  47.                     command: 'heading',
  48.                     arguments: ['h5'],
  49.                     tags: ['h5'],
  50.                     tooltip: "Header 5"
  51.                 },
  52.  
  53.                 h4: {
  54.                     visible: true && !( $.browser.mozilla ),
  55.                     className: 'h4',
  56.                     command: 'formatBlock',
  57.                     arguments: ['<H4>'],
  58.                     tags: ['h4'],
  59.                     tooltip: "Header 4"
  60.                 },
  61.                 h5: {
  62.                     visible: true && !( $.browser.mozilla ),
  63.                     className: 'h5',
  64.                     command: 'formatBlock',
  65.                     arguments: ['<H5>'],
  66.                     tags: ['h5'],
  67.                     tooltip : "Header 5"
  68.                 },
  69.                
  70.                 html: { visible: true },
  71.                 insertHorizontalRule: { visible : false },
  72.                 paste: { visible: true },
  73.                 createLink: {visible: false }
  74.             }
  75.         });
  76.     }, 500 );
  77.  
  78. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement