{* /** * Copyright (c) 2014, Kairat Bakytow * 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 */ *} {style}{literal} .action_btn { width: 16px; height: 16px; display: inline-block; } {/literal}{/style} {$menu}
{decorator name='button_list_item' langLabel='smileys+add_smile_label' class='smile_add_btn'}
{foreach $smileys as $smile} {foreachelse} {/foreach}
Order Smile Code Action
{$smile->code}
No items
{decorator name='button_list_item' langLabel='smileys+add_smile_label' class='smile_add_btn'}
{script}{literal} $(".smile_add_btn").on("click", function( event ) { OW.ajaxFloatBox('SMILEYS_CMP_Add', [], { title: OW.getLanguageText('smileys', 'add_smile_label'), width: 550 }); event.stopImmediatePropagation(); }); $(".ow_ic_edit", "#smileys").on("click", function() { var id = $(this).closest("tr").attr("data-id"); OW.ajaxFloatBox('SMILEYS_CMP_Edit', [id], { title: OW.getLanguageText('smileys', 'edit_smile_label'), width: 550 }); }); $(".ow_ic_delete", "#smileys").on("click", function() { if ( !confirm(OW.getLanguageText('smileys', 'are_you_sure')) ) { return; } $.ajax({ url: "{/literal}{url_for_route for="smileys.admin_delete"}{literal}", data: {id: $(this).closest("tr").attr("data-id")}, cache: false, type: 'POST', success: function() { window.location.reload(true); } }); }); function reord( send ) { send = (send === undefined ? true : false); var table = $("#smileys"); $(".ow_ic_up_arrow,.ow_ic_down_arrow", table).show(); $(".ow_ic_up_arrow", table.find("tr:eq(1)")).hide(); $(".ow_ic_down_arrow", table.find("tr:last")).hide(); $("tr:odd", table).removeClass().addClass("ow_alt1"); $("tr:even", table).removeClass().addClass("ow_alt2"); if ( send ) { var data = {}; $("tr", table).each(function( index ) { var id = $(this).attr("data-id"); if ( id === undefined ) { return; } data[$(this).attr("data-id")] = index; }); $.ajax({ url: "{/literal}{url_for_route for="smileys.admin_reorder"}{literal}", data: data, cache: false, type: 'POST' }); } } reord(false); $(".ow_ic_up_arrow", "#smileys").on("click", function() { var tr = $(this).closest("tr"); tr.prev().before(tr); reord(); }); $(".ow_ic_down_arrow", "#smileys").on("click", function() { var tr = $(this).closest("tr"); tr.next().after(tr); reord(); }); {/literal}{/script}