2016-07-09 20:43:38 +00:00
<?xml version="1.0" encoding="utf-8"?>
2018-01-07 03:30:39 +00:00
<addon addon_id= "pluralSysMember" title= "[kiror][BBCode] Plural System" version_string= "0.2" version_id= "2" url= "https://github.com/adlerosn/" install_callback_class= "pluralSysMember_Install" install_callback_method= "install" uninstall_callback_class= "pluralSysMember_Install" uninstall_callback_method= "uninstall" >
2016-07-09 20:43:38 +00:00
<admin_navigation />
<admin_permissions />
<admin_style_properties />
<admin_templates />
<admin_template_modifications />
<code_events />
2016-08-02 03:14:36 +00:00
<code_event_listeners >
<listener event_id= "front_controller_pre_view" execute_order= "10" callback_class= "pluralSysMember_Listener_FrontControllerPreView" callback_method= "callback" active= "1" hint= "" description= "Add parameter to a template" />
<listener event_id= "load_class" execute_order= "10" callback_class= "pluralSysMember_Listener_LoadClassController" callback_method= "callback" active= "1" hint= "XenForo_ControllerPublic_Account" description= "Add subroute to edit system members." />
</code_event_listeners>
2016-07-09 20:43:38 +00:00
<cron />
<email_templates />
<email_template_modifications />
<optiongroups />
<permissions >
<permission_groups >
<permission_group permission_group_id= "pluralsysgrp" />
</permission_groups>
<permissions >
<permission permission_group_id= "pluralsysgrp" permission_id= "showbtnineditor" permission_type= "flag" default_value= "unset" interface_group_id= "pluralsysiface" display_order= "1" />
</permissions>
<interface_groups >
<interface_group interface_group_id= "pluralsysiface" display_order= "1" />
</interface_groups>
</permissions>
<phrases >
<phrase title= "custom_bb_code_pluralsys_desc" version_id= "0" version_string= "0.0" > <![CDATA[This will identify the member of the plural system that said those things.]]> </phrase>
<phrase title= "custom_bb_code_pluralsys_title" global_cache= "1" version_id= "0" version_string= "0.0" > <![CDATA[Plural system]]> </phrase>
<phrase title= "permission_group_pluralsysgrp" version_id= "0" version_string= "0.0" > <![CDATA[[kiror] Plural system]]> </phrase>
<phrase title= "permission_interface_pluralsysiface" version_id= "0" version_string= "0.0" > <![CDATA[[kiror] Plural system]]> </phrase>
<phrase title= "permission_pluralsysgrp_showbtnineditor" version_id= "0" version_string= "0.0" > <![CDATA[Show plural system button in editor]]> </phrase>
</phrases>
<route_prefixes />
<style_properties />
<templates >
2016-08-02 03:14:36 +00:00
<template title= "account_pluralsystemmembers" version_id= "2" version_string= "0.2" > <![CDATA[<xen:title> Plural System Members</xen:title>
<xen:require css= "account_pluralsystemmembers.css" />
<script >
<xen:include template= "account_pluralsystemmembers.js" />
</script>
<form action= "{xen:link 'account/system-members'}" method= "post" class= "xenForm AutoValidator"
data-optInOut="optIn"
data-redirect="true"
data-redirect="on">
<table class= "beatiful" style= "max-width: 600px;" >
<tbody >
<tr class= "beatiful" >
<th class= "beatiful alignCenter" > Name</th>
<th class= "beatiful alignCenter" > Hue</th>
<th class= "beatiful alignCenter" > Delete?</th>
</tr>
<tr class= "beautiful jsCloneMe" >
<td class= "beatiful alignCenter" > <input type= "text" placeholder= "Name" value= "" class= "textCtrl" style= "width: 90%;" > </td>
<td class= "beatiful alignCenter" > <input type= "range" min= "0" max= "360" value= "0" class= "huePicker" style= "background-color: hsl(0,100%,50%); box-shadow: hsl(0,100%,50%) 5px 0 5px , hsl(0,100%,50%) -5px 0 5px , hsl(0,100%,50%) 0 5px 5px , hsl(0,100%,50%) 0 -5px 5px ;" > </td>
<td class= "beatiful alignCenter" > <a href= "javascript:void(0);" class= "button deletableRow" > Delete!</a> </td>
</tr>
<xen:foreach loop= "$members" value= "$member" >
<tr class= "beatiful" >
<td class= "beatiful alignCenter" > <input name= "member_nm_edit_{$member.member_id}" type= "text" placeholder= "Name" value= "{$member.member_nm}" class= "textCtrl" style= "width: 90%;" r e q u i r e d > </td>
<td class= "beatiful alignCenter" > <input name= "color_hue_edit_{$member.member_id}" type= "range" min= "0" max= "360" value= "{$member.color_hue}" class= "huePicker" style= "background-color: hsl({$member.color_hue},100%,50%); box-shadow: hsl({$member.color_hue},100%,50%) 5px 0 5px , hsl({$member.color_hue},100%,50%) -5px 0 5px , hsl({$member.color_hue},100%,50%) 0 5px 5px , hsl({$member.color_hue},100%,50%) 0 -5px 5px ;" > </td>
<td class= "beatiful alignCenter" > <a href= "javascript:void(0);" class= "button deletableRow" > Delete!</a> </td>
</tr>
</xen:foreach>
<tr class= "notsobeatiful" >
<td class= "" > </td>
<td class= "" > </td>
<td class= "beatiful alignCenter" > <a href= "javascript:void(0);" class= "button addRow" > Add</a> </td>
</tr>
</tbody>
</table>
<input type= "hidden" name= "_xfToken" value= "{$visitor.csrf_token_page}" />
<dl class= "ctrlUnit submitUnit" >
<dt > </dt>
<dd >
<input type= "submit" value= "{xen:phrase save_changes}" accesskey= "s" class= "button primary" />
<a href= "{xen:link 'account/system-members'}" class= "button" > {xen:phrase undo_changes}</a>
</dd>
</dl>
</form> ]]></template>
<template title= "account_pluralsystemmembers.css" version_id= "2" version_string= "0.2" > < ![CDATA[table.beatiful {
width: 100%;
}
table.beatifulwithborder, th.beatiful, td.beatiful {
border: 1px solid {xen:property primaryDarker};
}
td.leftbeatiful {
border-left: 1px solid {xen:property primaryDarker};
padding-left: 5px;
}
td.rightbeatiful {
border-right: 1px solid {xen:property primaryDarker};
padding-right: 5px;
}
td.topbeatiful {
border-top: 1px solid {xen:property primaryDarker};
padding-top: 5px;
}
td.bottombeatiful {
border-bottom: 1px solid {xen:property primaryDarker};
padding-bottom: 5px;
}
th.beatiful, td.beatiful {
padding: 2px;
padding-left: 5px;
padding-right: 5px;
}
tr.beatiful:nth-child(even) {
background-color: {xen:property primaryLightest};
}
tr.beatiful:nth-child(odd) {
background-color: {xen:property primaryLighterStill};
}
th.beatiful {
font-weight: bold;
background-color: {xen:property primaryMedium};
color: {xen:property primaryLightest};
}
td.beatiful input.huePicker {
margin: 10px;
}
.alignRight {
text-align: right;
}
.alignLeft {
text-align: left;
}
.alignCenter {
text-align: center;
}
.huePicker{
padding-right: 5px;
padding-left: 5px;
}
.beatiful tr:nth-child(2) {
display: none;
}]]></template>
<template title= "account_pluralsystemmembers.js" version_id= "2" version_string= "0.2" > < ![CDATA[pluralsystemmembers_addcount = 0;
function pluralsystemmembers_bind(){
$(".huePicker").unbind();
$(".addRow").unbind();
$(".huePicker").bind("change keyup keydown input", function(){
pluralsystemmembers_latestColor = 'hsl('+$(this)[0].value+',100%,50%)';
$(this)[0].style.backgroundColor = pluralsystemmembers_latestColor;
$(this)[0].style.boxShadow = (
pluralsystemmembers_latestColor+' 5px 0 5px,'+
pluralsystemmembers_latestColor+' 0 5px 5px,'+
pluralsystemmembers_latestColor+' -5px 0 5px,'+
pluralsystemmembers_latestColor+' 0 -5px 5px');
});
$(".addRow").click(function(){
var table = $("table.beatiful")[0];
var row = table.insertRow(table.rows.length-1);
var base = $(".jsCloneMe")[0].cloneNode(true);
var cn = base.childNodes;
var cn2 = null;
var i = 0;
var j = 0;
var k = 0;
var p = ['member_nm_new_','color_hue_new_'];
pluralsystemmembers_addcount++;
for(i=0;i<cn.length ; i + + ) {
if((cn[i].tagName)!='TD') continue;
else{
cn2 = cn[i].childNodes;
for(k=0;k<cn2.length ; k + + ) {
if((cn2[k].tagName)!='INPUT') continue;
else{
cn2[k].name=p[j]+pluralsystemmembers_addcount;
j++;
if(j>=2){
break;
}
}
}
}
}
row.outerHTML = base.outerHTML;
pluralsystemmembers_bind();
});
$(".deletableRow").click(function(){
var toDelete = $(this)[0].parentNode.parentNode;
var parentOfToDelete = toDelete.parentNode;
parentOfToDelete.removeChild(toDelete);
pluralsystemmembers_bind();
});
}
function pluralsystemmembers_waitJQueryLoad(callable) {
if (window.jQuery) {
setTimeout(function(){callable();}, 100);
setTimeout(function(){callable();}, 300);
setTimeout(function(){callable();}, 500);
setTimeout(function(){callable();}, 1000);
}
else setTimeout(function(){pluralsystemmembers_waitJQueryLoad(callable);}, 100);
}
pluralsystemmembers_waitJQueryLoad(pluralsystemmembers_bind);]]></template>
<template title= "account_wrapperExtend_pluralsys" version_id= "2" version_string= "0.2" > <![CDATA[<xen:if is="{$visitor.permissions.pluralsysgrp.showbtnineditor}">
<li class= "section" > <h4 class= "subHeading" > Plural System</h4>
<ul >
<li > <a
class="{xen:if "{$selectedKey} == 'account/systemMembers'", 'secondaryContent', 'primaryContent'}"
href="{xen:link account/system-members}">{xen:phrase members}</a> </li>
</ul>
</li>
</xen:if> ]]></template>
<template title= "editor_dialog_pluralsys" version_id= "2" version_string= "0.2" > <![CDATA[<script>
<xen:include template= "editor_dialog_pluralsys.js" />
</script>
<div >
2016-07-09 20:43:38 +00:00
<dl class= "ctrlUnit" >
<dt > Plural system member:</dt>
<dd > <input type= "text" name= "redactor_pluralsys_text" id= "redactor_pluralsys_text" class= "textCtrl" a u t o f o c u s > </input> </dd>
</dl>
2016-08-02 03:14:36 +00:00
<dl class= "ctrlUnit" >
<dt > Saved presets:</dt>
<dd >
<xen:foreach loop= "$system_members" key= "$k" value= "$sysmem" >
<a class= "button" href= 'javascript:pluralsys_fill({$k});' style= "margin-bottom:5px;" > {$sysmem.member_nm}</a>
</xen:foreach>
</dd>
</dl>
2016-07-09 20:43:38 +00:00
</div>
<dl class= "ctrlUnit submitUnit" >
<dt > </dt>
<dd >
<input type= "button" name= "redactor_insert_pluralsys_btn" class= "redactor_modal_btn button primary" id= "redactor_insert_pluralsys_btn" value= "{xen:phrase insert}" />
<a href= "javascript:void(null);" class= "redactor_modal_btn redactor_btn_modal_close button" > {xen:phrase cancel}</a>
</dd>
</dd> ]]></template>
2016-08-02 03:14:36 +00:00
<template title= "editor_dialog_pluralsys.js" version_id= "2" version_string= "0.2" > < ![CDATA[pluralsys_members = {xen:helper json, $system_members};
function pluralsys_fill(index){
document.getElementById('redactor_pluralsys_text').value = (
'color_hue='+pluralsys_members[index]['color_hue']+';'+
pluralsys_members[index]['member_nm']
);
document.getElementById('redactor_insert_pluralsys_btn').click();
}]]></template>
<template title= "kiror_pluralSys_link1" version_id= "2" version_string= "0.2" > <![CDATA[<xen:if is="{$visitor.permissions.pluralsysgrp.showbtnineditor}">
<dl class= "ctrlUnit" >
<dt > <label > Plural System:</label> </dt>
<dd >
<a class= "button" href= "{xen:link account/system-members}" target= "_blank" > Edit Members</a>
</dd>
</dl>
</xen:if> ]]></template>
<template title= "kiror_pluralSys_link2" version_id= "2" version_string= "0.2" > <![CDATA[<xen:if is="{$visitor.permissions.pluralsysgrp.showbtnineditor}">
<a href= "{xen:link account/system-members}" > Plural System Members</a>
</xen:if> ]]></template>
2016-07-09 20:43:38 +00:00
</templates>
<public_template_modifications >
<modification template= "editor_ui.css" modification_key= "addicontowysiwygeditorbutton" description= "Add icon to WYSIWYG editor button." execution_order= "10" enabled= "1" action= "str_replace" >
<find > <![CDATA[/* DROPDOWN */]]> </find>
<replace > < ![CDATA[html .redactor_toolbar li a.redactor_btn_pluralsys{
background-image: url('styles/kiror/pluralSysMember/multiplicityAlpha.png');
background-size: 16px 16px;
background-repeat: no-repeat;
background-position: 3px 3px;
}
$0]]></replace>
</modification>
<modification template= "page_container_js_head" modification_key= "addjstowysiwygeditorextension" description= "Add js to WYSIWYG editor extension." execution_order= "10" enabled= "1" action= "str_replace" >
<find > <![CDATA[<!--XenForo_Require:JS-->]]> </find>
<replace > < ![CDATA[$0
<script >
<xen:if is= "{$visitor.permissions.pluralsysgrp.showbtnineditor}" >
enablepluralsysPlugin = true;
<xen:else />
enablepluralsysPlugin = false;
</xen:if>
</script>
<script src= "{xen:helper javaScriptUrl, '{$javaScriptSource}/pluralSysMember/extend.js?_v={$xenOptions.jsVersion}'}" > </script> ]]></replace>
</modification>
2016-08-02 03:14:36 +00:00
<modification template= "account_personal_details" modification_key= "addlinktoeditpluralsystems" description= "Add link to edit plural systems in profile editing" execution_order= "10" enabled= "1" action= "str_replace" >
<find > <![CDATA[<xen:include template="custom_fields_edit" />]]> </find>
<replace > < ![CDATA[$0
<xen:include template= "kiror_pluralSys_link1" /> ]]></replace>
</modification>
<modification template= "navigation_visitor_tab" modification_key= "addlinktoeditpluralsystemsvistitortab" description= "Add link to edit plural systems in visitor tab" execution_order= "10" enabled= "1" action= "str_replace" >
<find > <![CDATA[<li><a href="{xen:link account/likes]]> </find>
<replace > <![CDATA[<xen:include template="kiror_pluralSys_link2" />
$0]]></replace>
</modification>
<modification template= "account_wrapper" modification_key= "addpluralsysextend" description= "Add Plural system extend" execution_order= "10" enabled= "1" action= "str_replace" >
<find > <![CDATA[<!-- slot: pre_conversations -->]]> </find>
<replace > <![CDATA[<xen:include template="account_wrapperExtend_pluralsys" />
$0]]></replace>
</modification>
2016-07-09 20:43:38 +00:00
<modification template= "editor_js_setup" modification_key= "addrelangbuttonjs" description= "Add button label" execution_order= "10" enabled= "1" action= "str_replace" >
<find > <![CDATA[RELANG.xf = {]]> </find>
<replace > < ![CDATA[$0
pluralsys_title: "Plural System",]]></replace>
</modification>
</public_template_modifications>
<bb_code_media_sites />
<bb_codes >
<bb_code bb_code_id= "pluralsys" bb_code_mode= "callback" has_option= "optional" callback_class= "pluralSysMember_sharedStatic" callback_method= "bbrenderCallback" option_regex= "" trim_lines_after= "0" plain_children= "0" disable_smilies= "0" disable_nl2br= "0" disable_autolink= "0" allow_empty= "1" allow_signature= "1" editor_icon_url= "" sprite_mode= "1" active= "1" sprite_params_x= "0" sprite_params_y= "20" >
<replace_html > <![CDATA[]]> </replace_html>
<replace_html_email > <![CDATA[]]> </replace_html_email>
<replace_text > <![CDATA[]]> </replace_text>
<example > < ![CDATA[[PLURALSYS="First member from plural system"]Some text[/PLURALSYS]
[PLURALSYS="Second member from plural system"]Another text[/PLURALSYS]
[PLURALSYS="First member from plural system"]More text[/PLURALSYS]]]></example>
</bb_code>
</bb_codes>
</addon>