2017 © Pedro Peláez
 

yii2-extension yii2-bootstrap-markdown-editor

Yii2 Markdown Editor based on Bootstrap Markdown.

image

efureev/yii2-bootstrap-markdown-editor

Yii2 Markdown Editor based on Bootstrap Markdown.

  • Monday, February 1, 2016
  • by efureev
  • Repository
  • 1 Watchers
  • 0 Stars
  • 76 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 7 Versions
  • 9 % Grown

The README.md

Yii2 Bootstrap Markdown Editor

Yii2 Markdown Editor based on Bootstrap Markdown., (*1)

This component use folowing libraries: * Marked -- a full-featured markdown parser and compiler, written in JavaScript. * To markdown -- an HTML to Markdown converter written in javascript. * Bootstrap Markdown -- JSimple Markdown editing tools that works!, (*2)

Installation

Composer

The preferred way to install this extension is through Composer., (*3)

Either run, (*4)

php composer.phar require efureev/yii2-bootstrap-markdown-editor "dev-master"

or add, (*5)

"efureev/yii2-bootstrap-markdown-editor": "dev-master"

to the require section of your composer.json, (*6)

Usage

Active widget

In view in active form:, (*7)





field($model, 'content')->widget(MarkdownEditor::className(), [ 'clientOptions' => [ 'language' => Yii::$app->language, 'additionalButtons' => [ 'drink' => [ 'cmdBeer' => [ 'title' => 'Beer', 'toggle' => false, 'icon' => 'glyphicon glyphicon-glass', 'callback' => 'function(e){alert("sdasda");}' ], 'cmdBeer2' => [ 'title' => 'Beer2', 'toggle' => true, 'icon' => 'glyphicon glyphicon-glass', 'callback' => 'function(e){ // Replace selection with some drinks var chunk, cursor, selected = e.getSelection(), content = e.getContent(), drinks = ["Heinekken", "Budweiser", "Iron City", "Amstel Light", "Red Stripe", "Smithwicks", "Westvleteren", "Sierra Nevada", "Guinness", "Corona", "Calsberg"], index = Math.floor((Math.random()*10)+1) // Give random drink chunk = drinks[index] // transform selection and set the cursor into chunked text e.replaceSelection(chunk) cursor = selected.start // Set the cursor e.setSelection(cursor,cursor+chunk.length) }' ] ] ] ], 'options' => ['data-provider' => 'markdown'], ]); ?>

Simple widget

In view:, (*8)

<?php
use efureev\markdown\MarkdownEditor;

echo MarkdownEditor::widget([
    'name'          => 'md-editor',
    'value'         => '# test message',
    'clientOptions' => ['language' => Yii::$app->language],
    'options'       => ['data-provider' => 'markdown'],
]);

Changelog

v0.0.6

  • add icons

v0.0.5

  • add additionalButtons

See also

Author

Ivan Yakovlev, e-mail: uran1980@gmail.com Eugene Fureev, e-mail: furegin@yandex.ru, (*9)

The Versions

01/02 2016

dev-master

9999999-dev https://github.com/efureev/yii2-bootstrap-markdown-editor

Yii2 Markdown Editor based on Bootstrap Markdown.

  Sources   Download

MIT

The Requires

 

yii2 editor markdown widgets gfm bootstrap markdown yii2-bootstrap-markdown-editor

01/02 2016

0.0.5

0.0.5.0 https://github.com/efureev/yii2-bootstrap-markdown-editor

Yii2 Markdown Editor based on Bootstrap Markdown.

  Sources   Download

MIT

The Requires

 

yii2 editor markdown widgets gfm bootstrap markdown yii2-bootstrap-markdown-editor

01/02 2016

0.0.6

0.0.6.0 https://github.com/efureev/yii2-bootstrap-markdown-editor

Yii2 Markdown Editor based on Bootstrap Markdown.

  Sources   Download

MIT

The Requires

 

yii2 editor markdown widgets gfm bootstrap markdown yii2-bootstrap-markdown-editor

22/03 2015

0.0.4

0.0.4.0 https://github.com/uran1980/yii2-bootstrap-markdown-editor

Yii2 Markdown Editor based on Bootstrap Markdown.

  Sources   Download

MIT

The Requires

 

yii2 editor markdown widgets gfm bootstrap markdown yii2-bootstrap-markdown-editor

12/03 2015

0.0.1

0.0.1.0 https://github.com/uran1980/yii2-bootstrap-markdown-editor

Yii2 Markdown Editor based on Bootstrap Markdown.

  Sources   Download

MIT

The Requires

 

yii2 editor markdown widgets gfm bootstrap markdown yii2-bootstrap-markdown-editor

12/03 2015

0.0.2

0.0.2.0 https://github.com/uran1980/yii2-bootstrap-markdown-editor

Yii2 Markdown Editor based on Bootstrap Markdown.

  Sources   Download

MIT

The Requires

 

yii2 editor markdown widgets gfm bootstrap markdown yii2-bootstrap-markdown-editor

12/03 2015

0.0.3

0.0.3.0 https://github.com/uran1980/yii2-bootstrap-markdown-editor

Yii2 Markdown Editor based on Bootstrap Markdown.

  Sources   Download

MIT

The Requires

 

yii2 editor markdown widgets gfm bootstrap markdown yii2-bootstrap-markdown-editor