Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * H1 BBCode
- */
- $.sceditor.command.set('h1', {
- tooltip: 'Heading 1',
- state: function(parent, firstBlock) {
- var $firstBlock = $(firstBlock);
- // < 0 is disabled
- // == 0 is enabled but not active
- // > 0 is active
- return ($firstBlock.is('h1') || $firstBlock.parents('h1').length) ? 1 : 0;
- },
- exec: function() {
- this.insert('[h1]', '[/h1]');
- },
- txtExec: ['[h1]', '[/h1]']
- });
- $.sceditorBBCodePlugin.bbcode.set('h1', {
- allowsEmpty: true,
- isInline: false,
- tags: {
- h1: null
- },
- format: function(element, content) {
- return '[h1]' + content + '[/h1]'
- },
- html: function(token, attrs, content) {
- return '<h1>' + content + '</h1>'
- }
- });
- /**
- * H2 BBCode
- */
- $.sceditor.command.set('h2', {
- tooltip: 'Heading 2',
- state: function(parent, firstBlock) {
- var $firstBlock = $(firstBlock);
- // < 0 is disabled
- // == 0 is enabled but not active
- // > 0 is active
- return ($firstBlock.is('h2') || $firstBlock.parents('h2').length) ? 1 : 0;
- },
- exec: function() {
- this.insert('[h2]', '[/h2]');
- },
- txtExec: ['[h2]', '[/h2]']
- });
- $.sceditorBBCodePlugin.bbcode.set('h2', {
- allowsEmpty: true,
- isInline: false,
- tags: {
- h2: null
- },
- format: function(element, content) {
- return '[h2]' + content + '[/h2]'
- },
- html: function(token, attrs, content) {
- return '<h2>' + content + '</h2>'
- }
- });
- /**
- * H3 BBCode
- */
- $.sceditor.command.set('h3', {
- tooltip: 'Heading 3',
- state: function(parent, firstBlock) {
- var $firstBlock = $(firstBlock);
- // < 0 is disabled
- // == 0 is enabled but not active
- // > 0 is active
- return ($firstBlock.is('h3') || $firstBlock.parents('h3').length) ? 1 : 0;
- },
- exec: function() {
- this.insert('[h3]', '[/h3]');
- },
- txtExec: ['[h3]', '[/h3]']
- });
- $.sceditorBBCodePlugin.bbcode.set('h3', {
- allowsEmpty: true,
- isInline: false,
- tags: {
- h3: null
- },
- format: function(element, content) {
- return '[h3]' + content + '[/h3]'
- },
- html: function(token, attrs, content) {
- return '<h3>' + content + '</h3>'
- }
- });
- /**
- * H4 BBCode
- */
- $.sceditor.command.set('h4', {
- tooltip: 'Heading 4',
- state: function(parent, firstBlock) {
- var $firstBlock = $(firstBlock);
- // < 0 is disabled
- // == 0 is enabled but not active
- // > 0 is active
- return ($firstBlock.is('h4') || $firstBlock.parents('h4').length) ? 1 : 0;
- },
- exec: function() {
- this.insert('[h4]', '[/h4]');
- },
- txtExec: ['[h4]', '[/h4]']
- });
- $.sceditorBBCodePlugin.bbcode.set('h4', {
- allowsEmpty: true,
- isInline: false,
- tags: {
- h4: null
- },
- format: function(element, content) {
- return '[h4]' + content + '[/h4]'
- },
- html: function(token, attrs, content) {
- return '<h4>' + content + '</h4>'
- }
- });
- /**
- * H5 BBCode
- */
- $.sceditor.command.set('h5', {
- tooltip: 'Heading 5',
- state: function(parent, firstBlock) {
- var $firstBlock = $(firstBlock);
- // < 0 is disabled
- // == 0 is enabled but not active
- // > 0 is active
- return ($firstBlock.is('h5') || $firstBlock.parents('h5').length) ? 1 : 0;
- },
- exec: function() {
- this.insert('[h5]', '[/h5]');
- },
- txtExec: ['[h5]', '[/h5]']
- });
- $.sceditorBBCodePlugin.bbcode.set('h5', {
- allowsEmpty: true,
- isInline: false,
- tags: {
- h5: null
- },
- format: function(element, content) {
- return '[h5]' + content + '[/h5]'
- },
- html: function(token, attrs, content) {
- return '<h5>' + content + '</h5>'
- }
- });
- /**
- * H6 BBCode
- */
- $.sceditor.command.set('h6', {
- tooltip: 'Heading 6',
- state: function(parent, firstBlock) {
- var $firstBlock = $(firstBlock);
- // < 0 is disabled
- // == 0 is enabled but not active
- // > 0 is active
- return ($firstBlock.is('h6') || $firstBlock.parents('h6').length) ? 1 : 0;
- },
- exec: function() {
- this.insert('[h6]', '[/h6]');
- },
- txtExec: ['[h6]', '[/h6]']
- });
- $.sceditorBBCodePlugin.bbcode.set('h6', {
- allowsEmpty: true,
- isInline: false,
- tags: {
- h6: null
- },
- format: function(element, content) {
- return '[h6]' + content + '[/h6]'
- },
- html: function(token, attrs, content) {
- return '<h6>' + content + '</h6>'
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment