727 lines
24 KiB
XML
727 lines
24 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<addon addon_id="customBackgroundChooser" title="[kiror][background] Chooser (core)" version_string="0.6" version_id="6" url="https://github.com/adlerosn/" install_callback_class="customBackgroundChooser_setup" install_callback_method="install" uninstall_callback_class="customBackgroundChooser_setup" uninstall_callback_method="uninstall">
|
|
<admin_navigation/>
|
|
<admin_permissions/>
|
|
<admin_style_properties/>
|
|
<admin_templates>
|
|
<template title="color_picker_kiror_customBackground"><![CDATA[<xen:require css="color_picker.css" />
|
|
<xen:require js="js/xenforo/color_picker.js" />
|
|
|
|
<div id="ColorPickerInstance" class="xenOverlay">
|
|
<a class="close OverlayCloser"></a>
|
|
<div class="colorPickerForm formOverlay">
|
|
|
|
<div class="ColorPickerTabs">
|
|
|
|
<ul class="tabs" data-panes="#ColorPickerInstance .tabPanel">
|
|
<li><a>{xen:phrase color_palette}</a></li>
|
|
<li><a>{xen:phrase color_picker}</a></li>
|
|
</ul>
|
|
|
|
<fieldset class="tabPanel PaletteTab">
|
|
<xen:if is="{$colorsGrouped}">
|
|
<ul>
|
|
<xen:foreach loop="$colorsGrouped" value="$colors">
|
|
<xen:foreach loop="$colors" value="$color">
|
|
<li title="@{$color.property_name}: {$color.propertyValueScalar}"
|
|
data-colorname="{$color.property_name}"
|
|
data-colorcss="{$color.propertyValueScalar}">{$color.title}</li>
|
|
</xen:foreach>
|
|
</xen:foreach>
|
|
</ul>
|
|
</xen:if>
|
|
</fieldset>
|
|
|
|
<fieldset class="tabPanel PickerTab">
|
|
<div class="gradientContainer"><div class="gradient"><span class="circle"></span></div></div>
|
|
<div class="barContainer"><div class="bar"><span class="arrow"></span></div></div>
|
|
</fieldset>
|
|
|
|
</div>
|
|
|
|
<div class="fixedColumn">
|
|
|
|
<div class="colorPreview">
|
|
<div class="preview"></div>
|
|
<div class="currentPreview"></div>
|
|
</div>
|
|
|
|
<ul class="inputs">
|
|
<li><label for="pctrl_h">#</label> <input type="text" class="textCtrl" id="pctrl_h" name="hex" /></li>
|
|
<li>
|
|
<ul>
|
|
<li><label for="pctrl_r">R</label> <input type="text" class="textCtrl ltr" id="pctrl_r" name="r" /></li>
|
|
<li><label for="pctrl_g">G</label> <input type="text" class="textCtrl ltr" id="pctrl_g" name="g" /></li>
|
|
<li><label for="pctrl_b">B</label> <input type="text" class="textCtrl ltr" id="pctrl_b" name="b" /></li>
|
|
</ul>
|
|
</li>
|
|
<li><label for="pctrl_r">A</label> <input type="text" class="textCtrl ltr" id="pctrl_a" name="a" /></li>
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div class="fixedBottom">
|
|
<input type="text" name="final" class="textCtrl finalValue ltr" />
|
|
|
|
<label class="remove"><input type="checkbox" name="remove" value="1" /> {xen:phrase clear_value}</label>
|
|
|
|
<span class="buttons">
|
|
<input type="button" class="button primary save" value="{xen:phrase okay}" />
|
|
<input type="button" class="button OverlayCloser" value="{xen:phrase cancel}" />
|
|
</span>
|
|
</div>
|
|
|
|
</div>
|
|
</div>]]></template>
|
|
<template title="kiror_customBackground_options_places"><![CDATA[<xen:require js="js/xenforo/options_censor.js" />
|
|
<xen:require js="js/xenforo/color_picker.js" />
|
|
<xen:require css="color_picker.css" />
|
|
<xen:require css="kiror_customBackground_options_places.css" />
|
|
|
|
<xen:include template="color_picker_kiror_customBackground" />
|
|
|
|
<xen:controlunit label="{$preparedOption.title}" hint="{$preparedOption.hint}">
|
|
<xen:explain>{xen:raw $preparedOption.explain}</xen:explain>
|
|
<xen:html>
|
|
<table class="beatiful">
|
|
<tr class="beatiful">
|
|
<th class="beatiful alignCenter">Style ID</th>
|
|
<th class="beatiful alignCenter">User selectable</th>
|
|
<th class="beatiful alignCenter">Style name</th>
|
|
<th class="beatiful alignCenter">HTML Tag</th>
|
|
<th class="beatiful alignCenter">BODY Tag</th>
|
|
<th class="beatiful alignCenter">Parallax header classes</th>
|
|
<th class="beatiful alignCenter">Parallax holes</th>
|
|
</tr>
|
|
<xen:foreach loop="$choices" key="$counter" value="$choice">
|
|
<tr class="beatiful">
|
|
<td class="beatiful alignCenter">{$choice.style_id}</td>
|
|
<td class="beatiful alignCenter"><input type="checkbox" name="{$fieldPrefix}[{$preparedOption.option_id}][{$counter}][user_selectable]" <xen:if is="{$choice.user_selectable}">checked</xen:if> size="1" disabled="disabled" /></td>
|
|
<td class="beatiful alignCenter">{$choice.title}</td>
|
|
<td class="beatiful alignCenter"><input type="checkbox" name="{$fieldPrefix}[{$preparedOption.option_id}][{$counter}][html]" <xen:if is="{$choice.html}">checked</xen:if> size="1" /></td>
|
|
<td class="beatiful alignCenter"><input type="checkbox" name="{$fieldPrefix}[{$preparedOption.option_id}][{$counter}][body]" <xen:if is="{$choice.body}">checked</xen:if> size="1" /></td>
|
|
|
|
<td class="beatiful alignCenter">
|
|
<xen:textbox class="alignCenter" name="{$fieldPrefix}[{$preparedOption.option_id}][{$counter}][parallaxHeaderClasses]" value="{$choice.parallaxHeaderClasses}" size="15" />
|
|
</td>
|
|
<td class="beatiful">
|
|
<table>
|
|
<tr>
|
|
<td class="rightbeatiful bottombeatiful">
|
|
Classes
|
|
</td>
|
|
<td class="leftbeatiful bottombeatiful">
|
|
<xen:textbox name="{$fieldPrefix}[{$preparedOption.option_id}][{$counter}][parallaxHolesClasses]" value="{$choice.parallaxHolesClasses}" size="20" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="rightbeatiful topbeatiful">
|
|
Color
|
|
</td>
|
|
<td class="leftbeatiful topbeatiful">
|
|
<xen:textbox name="{$fieldPrefix}[{$preparedOption.option_id}][{$counter}][parallaxHolesTintColor]" value="{$choice.parallaxHolesTintColor}" inputclass="ColorPicker DisablePalette" />
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</xen:foreach>
|
|
</table>
|
|
|
|
<input type="hidden" name="{$listedFieldName}" value="{$preparedOption.option_id}" />
|
|
{xen:raw $editLink}
|
|
</xen:html>
|
|
</xen:controlunit>
|
|
]]></template>
|
|
<template title="kiror_customBackground_options_places.css"><![CDATA[table.beatiful {
|
|
width: 100%;
|
|
}
|
|
|
|
table.beatiful, 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};
|
|
}
|
|
|
|
.alignRight {
|
|
text-align: right;
|
|
}
|
|
.alignLeft {
|
|
text-align: left;
|
|
}
|
|
.alignCenter {
|
|
text-align: center;
|
|
}
|
|
]]></template>
|
|
</admin_templates>
|
|
<admin_template_modifications/>
|
|
<code_events>
|
|
<event event_id="background_chooser_fill_image_array"><![CDATA[<p>Called when filling the image array is necessary.</p>
|
|
|
|
<p>Callback signature:</p>
|
|
<blockquote><code><em>array</em> &$images</code></blockquote>
|
|
|
|
<p>Arguments:</p>
|
|
<ol>
|
|
<li><code><em>array</em> &$images</code> - the image array</li>
|
|
</ol>
|
|
|
|
<p>Data structure:</p>
|
|
<blockquote><code>[<br>
|
|
<em>"string-addon-unique-identifier"</em> => [<br>
|
|
[<br>
|
|
"info" => [<br>
|
|
"nm" => <em>"raw-html-for-image-name"</em>,<br>
|
|
"by" => <em>"raw-html-for-image-author"</em>,<br>
|
|
"lc" => <em>"raw-html-for-image-license"</em><br>
|
|
],<br>
|
|
"image" => [<br>
|
|
"thumb" => <em>"url-to-image"</em>,<br>
|
|
"full" => <em>"url-to-image"</em>,<br>
|
|
]<br>
|
|
]<br>
|
|
]<br>
|
|
]
|
|
</code></blockquote>
|
|
|
|
|
|
<p>Data structure example:</p>
|
|
<blockquote><code>[<br>
|
|
<em>"my-addon"</em> => <span class="muted">/*start_your_copy-paste_here*/</span> [<br>
|
|
[<br>
|
|
"info" => [<br>
|
|
"nm" => <em>"Dirty leaves"</em>,<br>
|
|
"by" => <em>"Nicky"</em>,<br>
|
|
"lc" => <em>"Creative Commons 4.0"</em><br>
|
|
],<br>
|
|
"image" => [<br>
|
|
"thumb" => <em>"styles/nicky/backgroundpack1/dirtyleaves_small.jpg"</em>,<br>
|
|
"full" => <em>"styles/nicky/backgroundpack1/dirtyleaves_full.jpg"</em>,<br>
|
|
]<br>
|
|
],<br>
|
|
[<br>
|
|
"info" => [<br>
|
|
"nm" => <em>"Clean leaves"</em>,<br>
|
|
"by" => <em>"nonCa"</em>,<br>
|
|
"lc" => <em>"Proprietary"</em><br>
|
|
],<br>
|
|
"image" => [<br>
|
|
"thumb" => <em>"styles/nicky/backgroundpack1/cleanleaves_small.jpg"</em>,<br>
|
|
"full" => <em>"styles/nicky/backgroundpack1/cleanleaves_full.jpg"</em>,<br>
|
|
]<br>
|
|
]<br>
|
|
] <span class="muted">/*end_your_copy-paste_here*/</span><br>
|
|
]
|
|
</code><br>
|
|
Tip: Try doing something near this as the last line of your event listener PHP code:<br>
|
|
<code>$images[<em>"my-addon"</em>] = <em>$myImagesArray</em>;<code>
|
|
</blockquote>]]></event>
|
|
</code_events>
|
|
<code_event_listeners/>
|
|
<cron/>
|
|
<email_templates/>
|
|
<email_template_modifications/>
|
|
<optiongroups>
|
|
<group group_id="bkgchngoptgrp" display_order="7" debug_only="0"/>
|
|
<option option_id="backgroundReplaceRules" edit_format="callback" data_type="array" can_backup="1" validation_class="customBackgroundChooser_adminArrayPlaces" validation_method="verifier_AdminCP_CustomFieldsAdder">
|
|
<default_value>a:0:{}</default_value>
|
|
<edit_format_params>customBackgroundChooser_adminArrayPlaces::render_AdminCP_CustomFieldsAdder</edit_format_params>
|
|
<sub_options>*</sub_options>
|
|
<relation group_id="bkgchngoptgrp" display_order="2"/>
|
|
</option>
|
|
<option option_id="notallowedmessagebkgchng" edit_format="textbox" data_type="string" can_backup="1">
|
|
<default_value>You're not allowed to use this feature.</default_value>
|
|
<edit_format_params></edit_format_params>
|
|
<sub_options></sub_options>
|
|
<relation group_id="bkgchngoptgrp" display_order="1"/>
|
|
</option>
|
|
</optiongroups>
|
|
<permissions>
|
|
<permission_groups>
|
|
<permission_group permission_group_id="backgroundchanginggroup"/>
|
|
</permission_groups>
|
|
<permissions>
|
|
<permission permission_group_id="backgroundchanginggroup" permission_id="canchangebkg" permission_type="flag" default_value="unset" interface_group_id="backgroundchangingiface" display_order="1"/>
|
|
</permissions>
|
|
<interface_groups>
|
|
<interface_group interface_group_id="backgroundchangingiface" display_order="1"/>
|
|
</interface_groups>
|
|
</permissions>
|
|
<phrases>
|
|
<phrase title="background_customizing" version_id="0" version_string="0.0"><![CDATA[Background customizing]]></phrase>
|
|
<phrase title="option_backgroundReplaceRules" version_id="5" version_string="0.5"><![CDATA[Where will the client-side JavaScript replace?]]></phrase>
|
|
<phrase title="option_backgroundReplaceRules_explain" version_id="5" version_string="0.5"><![CDATA[]]></phrase>
|
|
<phrase title="option_group_bkgchngoptgrp" version_id="3" version_string="0.3"><![CDATA[[kiror] Background changing]]></phrase>
|
|
<phrase title="option_group_bkgchngoptgrp_description" version_id="1" version_string="0.1"><![CDATA[Options for the background chooser]]></phrase>
|
|
<phrase title="option_notallowedmessagebkgchng" version_id="1" version_string="0.1"><![CDATA[Not allowed message]]></phrase>
|
|
<phrase title="option_notallowedmessagebkgchng_explain" version_id="1" version_string="0.1"><![CDATA[Customize your reply message when the user isn't allowed to change its background.<br /> <b>Use HTML</b>.]]></phrase>
|
|
<phrase title="permission_backgroundchanginggroup_canchangebkg" version_id="1" version_string="0.1"><![CDATA[Can change background]]></phrase>
|
|
<phrase title="permission_group_backgroundchanginggroup" version_id="3" version_string="0.3"><![CDATA[[kiror] Background changing]]></phrase>
|
|
<phrase title="permission_interface_backgroundchangingiface" version_id="3" version_string="0.3"><![CDATA[[kiror] Background changing interface]]></phrase>
|
|
</phrases>
|
|
<route_prefixes>
|
|
<route_type type="public">
|
|
<prefix original_prefix="backgroundchange" class="customBackgroundChooser_routeCallback" build_link="all"/>
|
|
<prefix original_prefix="backgroundchangejsreplier" class="customBackgroundChooser_routeJSCallback" build_link="data_only"/>
|
|
</route_type>
|
|
</route_prefixes>
|
|
<style_properties/>
|
|
<templates>
|
|
<template title="color_picker_copypastefromadmintemplate" version_id="0" version_string="0.0"><![CDATA[<xen:require css="color_picker_copypastefromadmintemplate.css" />
|
|
<xen:require js="js/xenforo/color_picker.js" />
|
|
|
|
<div id="ColorPickerInstance" class="xenOverlay">
|
|
<!--<a class="close OverlayCloser"></a>-->
|
|
<form class="colorPickerForm formOverlay">
|
|
|
|
<div class="ColorPickerTabs">
|
|
|
|
<ul class="tabs" data-panes="#ColorPickerInstance .tabPanel">
|
|
<li><a>{xen:phrase color_palette}</a></li>
|
|
<li><a>{xen:phrase color_picker}</a></li>
|
|
</ul>
|
|
|
|
<fieldset class="tabPanel PaletteTab">
|
|
<xen:if is="{$colorsGrouped}">
|
|
<ul>
|
|
<xen:foreach loop="$colorsGrouped" value="$colors">
|
|
<xen:foreach loop="$colors" value="$color">
|
|
<li title="@{$color.property_name}: {$color.propertyValueScalar}"
|
|
data-colorname="{$color.property_name}"
|
|
data-colorcss="{$color.propertyValueScalar}">{$color.title}</li>
|
|
</xen:foreach>
|
|
</xen:foreach>
|
|
</ul>
|
|
</xen:if>
|
|
</fieldset>
|
|
|
|
<fieldset class="tabPanel PickerTab">
|
|
<div class="gradientContainer"><div class="gradient"><span class="circle"></span></div></div>
|
|
<div class="barContainer"><div class="bar"><span class="arrow"></span></div></div>
|
|
</fieldset>
|
|
|
|
</div>
|
|
|
|
<div class="fixedColumn">
|
|
|
|
<div class="colorPreview">
|
|
<div class="preview"></div>
|
|
<div class="currentPreview"></div>
|
|
</div>
|
|
|
|
<ul class="inputs">
|
|
<li><label for="pctrl_h">#</label> <input type="text" class="textCtrl" id="pctrl_h" name="hex" /></li>
|
|
<li>
|
|
<ul>
|
|
<li><label for="pctrl_r">R</label> <input type="text" class="textCtrl ltr" id="pctrl_r" name="r" /></li>
|
|
<li><label for="pctrl_g">G</label> <input type="text" class="textCtrl ltr" id="pctrl_g" name="g" /></li>
|
|
<li><label for="pctrl_b">B</label> <input type="text" class="textCtrl ltr" id="pctrl_b" name="b" /></li>
|
|
</ul>
|
|
</li>
|
|
<li><label for="pctrl_r">A</label> <input type="text" class="textCtrl ltr" id="pctrl_a" name="a" /></li>
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div class="fixedBottom">
|
|
<input type="text" name="final" class="textCtrl finalValue ltr" />
|
|
|
|
<label class="remove"><input type="checkbox" name="remove" value="1" /> {xen:phrase clear_value}</label>
|
|
|
|
<span class="buttons">
|
|
<input type="button" class="button primary save" value="{xen:phrase okay}" />
|
|
<input type="button" class="button OverlayCloser" value="{xen:phrase cancel}" />
|
|
</span>
|
|
</div>
|
|
|
|
</form>
|
|
</div>]]></template>
|
|
<template title="color_picker_copypastefromadmintemplate.css" version_id="0" version_string="0.0"><![CDATA[.colorPickerPlaceholder
|
|
{
|
|
cursor: pointer;
|
|
display: inline-block;
|
|
zoom: 1;
|
|
width: 30px;
|
|
padding: 2px;
|
|
padding-right: 21px;
|
|
background-image: url('{xen:property imagePath}/xenforo/color-picker/palette.png');
|
|
background-position: right center;
|
|
background-repeat: no-repeat;
|
|
}
|
|
|
|
.colorPickerPlaceholder span
|
|
{
|
|
display: block;
|
|
cursor: pointer;
|
|
border-radius: 2px;
|
|
height: 17px;
|
|
}
|
|
|
|
.colorPickerPlaceholder span.undefined
|
|
{
|
|
background: transparent url('{xen:property imagePath}/xenforo/color-picker/undefined.png');
|
|
height: 17px;
|
|
}
|
|
|
|
#ColorPickerInstance
|
|
{
|
|
width: 486px;
|
|
}
|
|
|
|
.colorPickerForm
|
|
{
|
|
overflow: hidden; zoom: 1;
|
|
}
|
|
|
|
/* tabs */
|
|
|
|
.ColorPickerTabs
|
|
{
|
|
width: 316px;
|
|
float: left;
|
|
}
|
|
|
|
.ColorPickerTabs .tabs
|
|
{
|
|
padding-left: 10px;
|
|
margin-bottom: -1px;
|
|
background: transparent;
|
|
}
|
|
|
|
/* palette tab */
|
|
|
|
.PaletteTab ul
|
|
{
|
|
overflow: auto;
|
|
height: 280px;
|
|
}
|
|
|
|
.PaletteTab li
|
|
{
|
|
overflow: hidden; zoom: 1;
|
|
border-bottom: 1px solid {xen:property primaryLightish};
|
|
cursor: pointer;
|
|
padding: 0 5px;
|
|
line-height: 26px;
|
|
font-size: 11px;
|
|
}
|
|
|
|
.PaletteTab li.selected
|
|
{
|
|
background: rgba(255,255,255, 0.5);
|
|
color: black;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.PaletteTab li:hover,
|
|
.PaletteTab li.selected:hover
|
|
{
|
|
background: rgba(255,255,255, 0.25);
|
|
color: inherit;
|
|
}
|
|
|
|
.PaletteTab li .swatch
|
|
{
|
|
float: left;
|
|
margin-right: 5px;
|
|
width: 35px;
|
|
height: 24px;
|
|
border: 1px solid black;
|
|
}
|
|
|
|
|
|
|
|
/* picker tab */
|
|
|
|
.PickerTab .gradientContainer
|
|
{
|
|
float: left;
|
|
width: 258px;
|
|
height: 258px;
|
|
margin: 10px;
|
|
border: 1px solid {xen:property primaryLighter};
|
|
}
|
|
|
|
|
|
.PickerTab .gradient
|
|
{
|
|
position: relative;
|
|
width: 256px;
|
|
height: 256px;
|
|
overflow: hidden;
|
|
background-image: url('{xen:property imagePath}/xenforo/color-picker/gradient.png');
|
|
border: 1px solid black;
|
|
cursor: crosshair;
|
|
}
|
|
|
|
.PickerTab .gradient .circle
|
|
{
|
|
position: absolute;
|
|
width: 10px;
|
|
height: 10px;
|
|
background-image: url('{xen:property imagePath}/xenforo/color-picker/circle.png');
|
|
margin: -5px 0 0 -5px;
|
|
}
|
|
|
|
.PickerTab .barContainer
|
|
{
|
|
float: left;
|
|
margin: 10px 0;
|
|
width: 22px;
|
|
height: 258px;
|
|
border: 1px solid {xen:property primaryLighter};
|
|
}
|
|
|
|
.PickerTab .bar
|
|
{
|
|
position: relative;
|
|
width: 20px;
|
|
height: 256px;
|
|
background-image: url('{xen:property imagePath}/xenforo/color-picker/bar.png');
|
|
border: 1px solid black;
|
|
}
|
|
|
|
.PickerTab .bar .arrow
|
|
{
|
|
position: absolute;
|
|
width: 36px;
|
|
height: 9px;
|
|
background-image: url('{xen:property imagePath}/xenforo/color-picker/arrows.png');
|
|
left: -8px;
|
|
margin-top: -5px;
|
|
}
|
|
|
|
/* fixed column */
|
|
|
|
.fixedColumn
|
|
{
|
|
float: left;
|
|
margin-left: 10px;
|
|
margin-top: 19px; /* tab height */
|
|
}
|
|
|
|
#ColorPickerInstance .colorPreview
|
|
{
|
|
width: 68px;
|
|
border: 1px solid {xen:property primaryLighter};
|
|
background: transparent url('{xen:property imagePath}/xenforo/color-picker/undefined.png');
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
#ColorPickerInstance .preview,
|
|
#ColorPickerInstance .currentPreview
|
|
{
|
|
height: 38px;
|
|
border: 1px solid black;
|
|
}
|
|
|
|
#ColorPickerInstance .preview
|
|
{
|
|
border-bottom: none;
|
|
}
|
|
|
|
#ColorPickerInstance .currentPreview
|
|
{
|
|
border-top: none;
|
|
}
|
|
|
|
#ColorPickerInstance .inputs li
|
|
{
|
|
overflow: hidden; zoom: 1;
|
|
}
|
|
|
|
#ColorPickerInstance .inputs label
|
|
{
|
|
display: inline-block;
|
|
width: 15px;
|
|
float: left;
|
|
}
|
|
|
|
#ColorPickerInstance .inputs .textCtrl
|
|
{
|
|
width: 55px;
|
|
box-sizing: border-box;
|
|
text-align: right;
|
|
float: left;
|
|
}
|
|
|
|
#ColorPickerInstance .inputs ul
|
|
{
|
|
margin: 10px 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
.fixedBottom
|
|
{
|
|
clear: both;
|
|
overflow: hidden; zoom: 1;
|
|
padding-top: 10px;
|
|
}
|
|
|
|
.fixedBottom .finalValue
|
|
{
|
|
width: 150px;
|
|
}
|
|
|
|
.fixedBottom .remove
|
|
{
|
|
font-size: 11px;
|
|
}
|
|
|
|
.fixedBottom .buttons
|
|
{
|
|
float: right;
|
|
}
|
|
|
|
.fixedBottom .button
|
|
{
|
|
margin-left: 3px;
|
|
min-width: 60px;
|
|
}]]></template>
|
|
<template title="kiror_background_change_allPages.js" version_id="5" version_string="0.5"><![CDATA[var nid={xen:if $forum.node_id, $forum.node_id, 0};
|
|
|
|
$.get("{xen:link "backgroundchangejsreplier"}", {
|
|
'nid' : nid
|
|
}, function (newBg) {
|
|
try{
|
|
var nbgdic = JSON.parse(newBg);
|
|
console.log('Background chooser started with:',nbgdic);
|
|
if(nbgdic['set']){
|
|
document.getElementById("XenForo").style.overflowY ='scroll !important';
|
|
document.html = document.getElementsByTagName('html')[0];
|
|
var nbgwig = []; /* New BackGround WIth Glass */
|
|
var nbgwog = []; /* New BackGround WithOut Glass */
|
|
if(nbgdic['html']){
|
|
nbgwog.push(document.html);
|
|
}
|
|
if(nbgdic['body']){
|
|
nbgwog.push(document.body);
|
|
}
|
|
var i = 0;
|
|
var j = 0;
|
|
var toIterate1 = undefined;
|
|
var toIterate2 = undefined;
|
|
toIterate1 = nbgdic['parallaxWithoutGlass'];
|
|
for(i=0; i<toIterate1.length; i++){
|
|
toIterate2 = document.querySelectorAll(toIterate1[i]);
|
|
for(j=0; j<toIterate2.length; j++){
|
|
nbgwog.push(toIterate2[j]);
|
|
}
|
|
}
|
|
toIterate1 = nbgdic['parallaxWithGlass'];
|
|
for(i=0; i<toIterate1.length; i++){
|
|
toIterate2 = document.querySelectorAll(toIterate1[i]);
|
|
for(j=0; j<toIterate2.length; j++){
|
|
nbgwig.push(toIterate2[j]);
|
|
}
|
|
}
|
|
toIterate1 = nbgwog;
|
|
for(i=0; i<toIterate1.length; i++){
|
|
toIterate1[i].style.background = nbgdic['background'];
|
|
toIterate1[i].style.backgroundSize='cover';
|
|
toIterate1[i].style.backgroundAttachment='fixed';
|
|
}
|
|
toIterate1 = nbgwig;
|
|
for(i=0; i<toIterate1.length; i++){
|
|
toIterate1[i].style.background = nbgdic['background'];
|
|
toIterate1[i].style.backgroundSize='cover';
|
|
toIterate1[i].style.backgroundAttachment='fixed';
|
|
toIterate1[i].style.boxShadow = nbgdic['box-shadow'];
|
|
toIterate1[i].style.textShadow = nbgdic['text-shadow'];
|
|
}
|
|
}
|
|
}catch(err){
|
|
console.exception('Error from Background changer:', err);
|
|
}
|
|
});
|
|
]]></template>
|
|
<template title="kiror_background_change_flexbox_style.css" version_id="0" version_string="0.0"><![CDATA[.flexcontainer {
|
|
display: flex; /* or inline-flex */
|
|
flex-wrap: wrap;
|
|
justify-content: space-around;
|
|
}
|
|
.flexitem {
|
|
height: 100px;
|
|
width: 300px;
|
|
order: 0;
|
|
margin:2px;
|
|
}]]></template>
|
|
<template title="kiror_background_change_main_page" version_id="0" version_string="0.0"><![CDATA[<xen:title>Background changing page</xen:title>
|
|
<xen:include template="color_picker_copypastefromadmintemplate" />
|
|
<xen:require css="kiror_background_change_flexbox_style.css" />
|
|
{xen:raw $html}]]></template>
|
|
<template title="kiror_include_on_style_chooser" version_id="1" version_string="0.1"><![CDATA[<xen:if is="{$visitor.permissions.backgroundchanginggroup.canchangebkg}">
|
|
<h3 class="subHeading">{xen:phrase background_customizing}</h3>
|
|
<ol class="primaryContent chooserColumns twoColumns overlayScroll">
|
|
<li>
|
|
<a href="{xen:link 'backgroundchange/default'}">
|
|
<span class="icon"><span></span></span>
|
|
<span class="title">Default</span>
|
|
<span class="description">Uses the default theme's background.</span>
|
|
</a>
|
|
|
|
</li>
|
|
<li>
|
|
<a href="{xen:link 'backgroundchange/'}">
|
|
<span class="icon"><span></span></span>
|
|
<span class="title">Customize</span>
|
|
<span class="description">Choose another background.</span>
|
|
</a>
|
|
</li>
|
|
|
|
</ol>
|
|
</xen:if>]]></template>
|
|
</templates>
|
|
<public_template_modifications>
|
|
<modification template="page_container_js_body" modification_key="addbackgroundhook" description="Hooks this to changing the background over demand via JavaScript." execution_order="10" enabled="1" action="str_replace">
|
|
<find><![CDATA[</script>]]></find>
|
|
<replace><![CDATA[<xen:include template="kiror_background_change_allPages.js" />
|
|
$0]]></replace>
|
|
</modification>
|
|
<modification template="style_chooser" modification_key="addincludehook" description="Adds an include hook" execution_order="10" enabled="1" action="str_replace">
|
|
<find><![CDATA[<div class="sectionFooter overlayOnly"><a class="button primary OverlayCloser">{xen:phrase cancel}</a></div>]]></find>
|
|
<replace><![CDATA[<xen:if is="{$visitor.user_id}"><xen:include template="kiror_include_on_style_chooser" /></xen:if>
|
|
<div class="sectionFooter overlayOnly"><a class="button primary OverlayCloser">{xen:phrase cancel}</a></div>]]></replace>
|
|
</modification>
|
|
</public_template_modifications>
|
|
<bb_code_media_sites/>
|
|
<bb_codes/>
|
|
</addon>
|