Skip to content

Commit

Permalink
Version 1.2 released
Browse files Browse the repository at this point in the history
- Fix Redactor undefined plugin object bug
- Improve Modal title integration (is now phrased)
  • Loading branch information
cclaerhout committed Dec 24, 2014
1 parent 9fd2306 commit 35610c1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion addon-sedo_redactor_btn_demo.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<addon addon_id="sedo_redactor_btn_demo" title="Redactor Button Demo" version_string="1.0.0" version_id="1" url="" install_callback_class="" install_callback_method="" uninstall_callback_class="" uninstall_callback_method="">
<addon addon_id="sedo_redactor_btn_demo" title="Redactor Button Demo" version_string="1.2" version_id="2" url="" install_callback_class="" install_callback_method="" uninstall_callback_class="" uninstall_callback_method="">
<admin_navigation/>
<admin_permissions/>
<admin_style_properties/>
Expand All @@ -21,6 +21,7 @@
<phrases>
<phrase title="custom_bb_code_demo_desc" version_id="0" version_string="1.0.0"><![CDATA[Demo Bb Code]]></phrase>
<phrase title="custom_bb_code_demo_title" global_cache="1" version_id="0" version_string="1.0.0"><![CDATA[Demo Bb Code]]></phrase>
<phrase title="sedo_redbtndemo_modal_title" version_id="0" version_string="1.0.0"><![CDATA[Custom modal title]]></phrase>
</phrases>
<route_prefixes/>
<style_properties/>
Expand All @@ -44,6 +45,11 @@
<replace><![CDATA[$0
<script src="{xen:helper javaScriptUrl, '{$javaScriptSource}/sedo/redbtndemo/extend.js?_v={$xenOptions.jsVersion}'}"></script>]]></replace>
</modification>
<modification template="editor_js_setup" modification_key="sedo_redacor_btn_demo_modal_title" description="Add modal title title" execution_order="10" enabled="1" action="str_replace">
<find><![CDATA[RELANG.xf = {]]></find>
<replace><![CDATA[$0
custom_demo_title: "{xen:jsescape {xen:phrase sedo_redbtndemo_modal_title}}",]]></replace>
</modification>
</public_template_modifications>
<bb_code_media_sites/>
<bb_codes>
Expand Down
8 changes: 7 additions & 1 deletion js/sedo/redbtndemo/extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@

/*If you want to open an overlay*/
ed.saveSelection();
ed.modalInit(editorFramework.getText('My custom demo title'), { url: editorFramework.dialogUrl + '&dialog=demo' }, 600, $.proxy(function()
ed.modalInit(editorFramework.getText('custom_demo_title'), { url: editorFramework.dialogUrl + '&dialog=demo' }, 600, $.proxy(function()
{
/***
Note that above the dialog name is called "demo", so the targeted template will be "editor_dialog_demo"
The getText function allows the text to be translated provided you reference it in the "editor_js_setup" template inside the "RELANG.xf" object
**/
$('#redactor_insert_demo_btn').click(function(e) {
e.preventDefault();

Expand All @@ -39,6 +43,8 @@
}

/*For those who need to write a plugin, here's the optional code*/
if(typeof RedactorPlugins == undefined) var RedactorPlugins = {};

RedactorPlugins.myPlugin = {
init: function()
{
Expand Down

0 comments on commit 35610c1

Please sign in to comment.