Comments (3)
Hi @mrbig00 ,
I took a look to clips.js
plugin, but if really I'm not sure how to configure this plugin. The items
variable is predefined, and there is no possibility to override it. I was searching for clipsJson
but without success, can you provide a link to that documentation where you found that option?
from yii2-imperavi-widget.
In the plugin isn't implemented a feature to load custom items from the config.
So if you modify the init function in the clips.js to this:
if (!this.opts.clipsJson) return;
var items = JSON.parse(this.opts.clipsJson);
this.clips.template = $('<ul id="redactor-modal-list">');
for (var i = 0; i < items.length; i++)
{
var li = $('<li>');
var a = $('<a href="#" class="redactor-clip-link">').text(items[i][0]);
var div = $('<div class="redactor-clip">').hide().html(items[i][1]);
li.append(a);
li.append(div);
this.clips.template.append(li);
}
this.modal.addTemplate('clips', '<section>' + this.utils.getOuterHtml(this.clips.template) + '</section>');
var button = this.button.add('clips', 'Clips');
this.button.addCallback(button, this.clips.show);
You can define custom elements in the config
'clipsJson' => Json::encode([["button" ,"<button>This is a button</button>"]]),
from yii2-imperavi-widget.
Ok, I think you can try 'clipsJson' => [["button" ,"<button>This is a button</button>"]],
because in final this code will be encoded by the widget. Hope this will work for you.
from yii2-imperavi-widget.
Related Issues (20)
- Как изменить цвет заголовка? HOT 1
- Sticky блок HOT 3
- Конструкция "="" в тегах <img> HOT 2
- Как изменить список удаляемых тегов? HOT 7
- GetImagesAction and GetFilesAction return invalid paths for files in subfolders
- При редактировании теряется форматирование HOT 1
- Some strange happens with versions HOT 1
- Как разрешить отображение тега "script" HOT 7
- Spell Check
- Редактор не сразу появляется при переключении табов компонента yii/bootstrap4/tabs HOT 1
- How to control buttons? HOT 5
- Проблема с тегом <p> HOT 3
- Редактор дублирует текст при вставке HOT 1
- How to add superscript and subscript buttons?
- Не выводится стиль форматирования h6
- Please add en.js to the language folder
- Тэг p внутри li
- CodeMirror implementation for source
- При загрузке картинки ошибка
- Bugs on adding an image
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-imperavi-widget.