Skip to content

Instantly share code, notes, and snippets.

@tscolari
Last active December 23, 2015 07:38

Revisions

  1. tscolari revised this gist Sep 17, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion headlines.js
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@ $.sceditor.command.set(
    "h1",
    {
    exec: function(content) {
    "[h1]#{content}[/h1]"
    "[h1]"+content+"[/h1]"
    },
    txtExec: ["[h1]", "[/h1]"]
    }
  2. tscolari revised this gist Sep 17, 2013. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions headlines.js
    Original file line number Diff line number Diff line change
    @@ -19,10 +19,10 @@ $.sceditorBBCodePlugin.bbcode.set(
    }

    format: function(element, content) {
    return "[h1]#{content}[/h1]"
    return "[h1]"+content+"[/h1]"
    },
    html: format(token, attrs, content) {
    return "<h2 class='heading1'>#{content}</h2>"
    return "<h2 class='heading1'>"+content+"</h2>"
    }
    }
    )
    @@ -31,7 +31,7 @@ $.sceditor.command.set(
    "h2",
    {
    exec: format(content) {
    return "[h2]#{content}[/h2]"
    return "[h2]"+content+"[/h2]"
    },
    txtExec: ["[h2]", "[/h2]"]
    }
    @@ -48,10 +48,10 @@ $.sceditorBBCodePlugin.bbcode.set(
    }

    format: function(element, content) {
    return "[h2]#{content}[/h2]"
    return "[h2]"+content+"[/h2]"
    },
    html: function(token, attrs, content) {
    return "<h2 class='heading2'>#{content}</h2>"
    return "<h2 class='heading2'>"+content+"</h2>"
    }
    }
    )
  3. tscolari revised this gist Sep 17, 2013. 2 changed files with 57 additions and 54 deletions.
    57 changes: 57 additions & 0 deletions headlines.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,57 @@
    $.sceditor.command.set(
    "h1",
    {
    exec: function(content) {
    "[h1]#{content}[/h1]"
    },
    txtExec: ["[h1]", "[/h1]"]
    }
    )

    $.sceditorBBCodePlugin.bbcode.set(
    "h1",
    {
    allowsEmpty: true,
    tags: {
    h2: {
    "class" : "heading1"
    }
    }

    format: function(element, content) {
    return "[h1]#{content}[/h1]"
    },
    html: format(token, attrs, content) {
    return "<h2 class='heading1'>#{content}</h2>"
    }
    }
    )

    $.sceditor.command.set(
    "h2",
    {
    exec: format(content) {
    return "[h2]#{content}[/h2]"
    },
    txtExec: ["[h2]", "[/h2]"]
    }
    )

    $.sceditorBBCodePlugin.bbcode.set(
    "h2",
    {
    allowsEmpty: true,
    tags: {
    h1: {
    "class" : "heading2"
    }
    }

    format: function(element, content) {
    return "[h2]#{content}[/h2]"
    },
    html: function(token, attrs, content) {
    return "<h2 class='heading2'>#{content}</h2>"
    }
    }
    )
    54 changes: 0 additions & 54 deletions headlines.js.coffee
    Original file line number Diff line number Diff line change
    @@ -1,54 +0,0 @@
    $.sceditor.command.set(
    "h1",
    {
    exec: (content) ->
    "[h1]#{content}[/h1]"
    txtExec: ["[h1]", "[/h1]"]
    }
    )

    $.sceditorBBCodePlugin.bbcode.set(
    "h1",
    {
    allowsEmpty: true,
    tags: {
    h2: {
    "class" : "heading1"
    }
    }

    format: (element, content) ->
    "[h1]#{content}[/h1]"

    html: (token, attrs, content) ->
    "<h2 class='heading1'>#{content}</h2>"
    }
    )

    $.sceditor.command.set(
    "h2",
    {
    exec: (content) ->
    "[h2]#{content}[/h2]"
    txtExec: ["[h2]", "[/h2]"]
    }
    )

    $.sceditorBBCodePlugin.bbcode.set(
    "h2",
    {
    allowsEmpty: true,
    tags: {
    h1: {
    "class" : "heading2"
    }
    }

    format: (element, content) ->
    "[h2]#{content}[/h2]"

    html: (token, attrs, content) ->
    "<h2 class='heading2'>#{content}</h2>"
    }
    )

  4. tscolari created this gist Sep 17, 2013.
    54 changes: 54 additions & 0 deletions headlines.js.coffee
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,54 @@
    $.sceditor.command.set(
    "h1",
    {
    exec: (content) ->
    "[h1]#{content}[/h1]"
    txtExec: ["[h1]", "[/h1]"]
    }
    )

    $.sceditorBBCodePlugin.bbcode.set(
    "h1",
    {
    allowsEmpty: true,
    tags: {
    h2: {
    "class" : "heading1"
    }
    }

    format: (element, content) ->
    "[h1]#{content}[/h1]"

    html: (token, attrs, content) ->
    "<h2 class='heading1'>#{content}</h2>"
    }
    )

    $.sceditor.command.set(
    "h2",
    {
    exec: (content) ->
    "[h2]#{content}[/h2]"
    txtExec: ["[h2]", "[/h2]"]
    }
    )

    $.sceditorBBCodePlugin.bbcode.set(
    "h2",
    {
    allowsEmpty: true,
    tags: {
    h1: {
    "class" : "heading2"
    }
    }

    format: (element, content) ->
    "[h2]#{content}[/h2]"

    html: (token, attrs, content) ->
    "<h2 class='heading2'>#{content}</h2>"
    }
    )