{** * Copyright (c) 2012, Sergey Kambalin * All rights reserved. * ATTENTION: This commercial software is intended for use with Oxwall Free Community Software http://www.oxwall.org/ * and is licensed under Oxwall Store Commercial License. * Full text of this license can be found at http://www.oxwall.org/store/oscl *} {** * * @author Sergey Kambalin * @package hint.view **} {style} .h-preview-wrap { position: relative; width: 355px; height: 250px; margin: 15px auto 0px; } .h-left-col { width: 440px; } .h-right-col { width: 400px; } html table.h-setting-form td.ow_label { width: auto; text-align: left; } html table.h-setting-form td.ow_value { width: 30px; text-align: center; } html h3.h_preloader { background-image: url({$preloaderUrl}); } .h-requirements { padding-left: 40px; } .p-question-c { } div.h-dnd-legend { margin: 5px 10px; padding: 5px 10px; } .h-leave-review { background-repeat: no-repeat; background-position: left center; padding-left: 20px; } {/style} {script} var actionConfiguration = function() { var out = []; $("input[data-key]:checked").each(function() { out.push($(this).attr("data-key")); }); return out; }; var lineConfiguration = function( line ) { var out = {}; out.key = line.val(); if (out.key == "base-question") { out.question = line.parent().find(".p-question-c select").val(); } return out; }; var infoConfiguration = function() { var out = {}; out.line0 = lineConfiguration($("#info0")); out.line1 = lineConfiguration($("#info1")); out.line2 = lineConfiguration($("#info2")); return out; }; var refresh = function() { var params = {}; params.actions = actionConfiguration(); params.info = infoConfiguration(); params.features = { "cover": $("#feature_uheader").get(0).checked }; $(".h-requirements").hide(); if ( params.features.cover ) { $("#r-cover").show(); } $.each(params.actions, function(i, key) { $("#r-" + key).show(); }); $("#h-preview-box .ow_box_cap_body h3").removeClass("ow_ic_lens").addClass("h_preloader"); OW.loadComponent("HINT_CMP_UserHintPreview", ["{$entityType}", params], function( html ) { $("#h-preview").html(html); $("#h-preview-box .ow_box_cap_body h3").removeClass("h_preloader").addClass("ow_ic_lens"); }); }; var timeOut, delayedRefresh = function() { if ( timeOut ) window.clearTimeout(timeOut); timeOut = window.setTimeout(refresh, 100); }; $(".h-refresher").click(delayedRefresh); $("#info0, #info1, #info2").change(function() { if ( $(this).val() == "base-question" ) { $(this).parent().find(".p-question-c").show(); } else { $(this).parent().find(".p-question-c").hide(); refresh(); } }); $(".p-question-c select").change(refresh); {/script} {foreach from=$requirements item="r"}
{$r.text}
{/foreach}
{form name="HINT_ConfigurationForm"}
{foreach from=$buttonConfigs item="btn"} {/foreach}
{text key="hint+admin_button_configuration_label"}
{input name="action-`$btn.key`"}
{label name="action-`$btn.key`"}
{if !empty($btn.requirements.short)}
{$btn.requirements.short}
{/if}
{text key="hint+admin_button_features_label"}
{input name="uheader_enabled"} {text key="hint+admin_profile_cover_option"} {if !empty($coverRequired)}
{$coverRequired}
{/if}
{text key="hint+admin_info_label"}
{text key="hint+admin_info0_label"} {input name="info_line0"} {input name="info_line0_question"}
{text key="hint+admin_info1_label"} {input name="info_line1"} {input name="info_line1_question"}
{text key="hint+admin_info2_label"} {input name="info_line2"} {input name="info_line2_question"}
{submit name='save' class='ow_ic_save'}
{/form}
{block_decorator name='box' langLabel="hint+admin-hit-preview" iconClass="ow_ic_lens" type="empty"}
{$preview}
{/block_decorator}
{text key="hint+admin_button_dnd_legend"}
{text key="hint+leave_review_suggest" pluginUrl=$pluginUrl}