Skip to content
This repository has been archived by the owner on May 20, 2021. It is now read-only.

Latest commit

 

History

History
63 lines (47 loc) · 1.44 KB

README.md

File metadata and controls

63 lines (47 loc) · 1.44 KB

Angular Imperavi Redactor directive

Created for e154

Note that Imperavi Redactor itself is a proprietary commercial copyrighted software but since Yii community bought OEM license you can use it for free with Yii.

Install

bower install e154/angular-imperavi

Init

app = angular.module('app', [
            'ui.imperavi'
        ]
    )

Using

vm.editor_plugins = ['table', 'video', 'fullscreen', 'clips', 'counter', 'filemanager', 'imagemanager', 'textexpander', 'fontsize', 'textdirection'];
vm.editor_options = {
            autoload_plugins: true
            imageUpload: "/api/admin/post/"+vm.paramId+"/attach/image",
            imageManagerJson: "/api/admin/post/"+vm.paramId+"/attach/list"
            };
vm.model = {
    content_filtered: ""
};

<textarea asset-path="/admin/static/private/imperavi/"
          lang="ru" 
          plugins="post.editor_plugins"
          id="redactor"
          name="redactor"
          ui-imperavi
          ng-model="post.model.content_filtered"
          options="post.editor_options">
</textarea>

Minimal

$scope.content_filtered: ""

<textarea ui-imperavi ng-model="content_filtered"></textarea>

Deps

Asset directory must be visible from the Internet. To be able to dynamically load plugins and language pack Set it:

asset-path="/admin/static/private/imperavi/"