first commit
This commit is contained in:
91
modules/roy_content/js/admin.js
Normal file
91
modules/roy_content/js/admin.js
Normal file
@@ -0,0 +1,91 @@
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
//show new item panel
|
||||
$('.button-new-item').on('click', function() {
|
||||
$('.new-item').find('.item-container').slideToggle();
|
||||
});
|
||||
// cancel new item
|
||||
$('.button-new-item-cancel').on('click',function() {
|
||||
$('.new-item').find('.item-container').slideToggle();
|
||||
});
|
||||
//show item content edit panel
|
||||
$('.button-edit').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
var $item_container = $(this).closest('.item');
|
||||
$item_container.find('.item-container').slideToggle();
|
||||
$(this).find('.button-edit-edit').toggleClass('hide');
|
||||
$(this).find('.button-edit-close').toggleClass('hide');
|
||||
});
|
||||
//cancel item edit
|
||||
$('.button-item-edit-cancel').on('click',function(){
|
||||
$(this).closest('form').find('.button-edit .button-edit-edit').toggleClass('hide');
|
||||
$(this).closest('form').find('.button-edit .button-edit-close').toggleClass('hide');
|
||||
$(this).closest('form').find('.item-container').slideToggle();
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
tinySetup({
|
||||
editor_selector :"autoload_rte_custom",
|
||||
relative_urls : false,
|
||||
plugins : "colorpicker link image paste pagebreak table contextmenu filemanager table code media autoresize textcolor fullpage",
|
||||
extended_valid_elements : "em[class|name|id],html,head",
|
||||
setup : function(ed){
|
||||
ed.on('init', function(ed){
|
||||
tinyMCE.triggerSave();
|
||||
});
|
||||
ed.on('keydown', function(ed, e){
|
||||
tinyMCE.triggerSave();
|
||||
});
|
||||
}
|
||||
});
|
||||
}, 300);
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
$(function() {
|
||||
$(".list-unstyled" ).sortable({
|
||||
cursor: 'move',
|
||||
start: function(e, ui){
|
||||
$(ui.item).find('textarea').each(function(){
|
||||
tinymce.execCommand('mceRemoveEditor', false, $(this).attr('id'));
|
||||
});
|
||||
},
|
||||
stop: function(e, ui){
|
||||
$(ui.item).find('textarea').each(function(){
|
||||
tinymce.execCommand('mceAddEditor', true, $(this).attr('id'));
|
||||
});
|
||||
$(this).sortable('refresh');
|
||||
},
|
||||
update: function(event, ui){
|
||||
$('#items li').not('.no-slides').each(function(index){
|
||||
$(this).find('.sort-order').text(index + 1);
|
||||
});
|
||||
}
|
||||
}).bind('sortupdate', function() {
|
||||
var test = $(this).sortable('toArray');
|
||||
var h4_title = $(this).prev('h4').html();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: theme_url + '&configure=roy_content&ajax',
|
||||
headers: { "cache-control": "no-cache" },
|
||||
dataType: 'json',
|
||||
data: {
|
||||
action: 'updateposition',
|
||||
item: test,
|
||||
title: h4_title,
|
||||
},
|
||||
success: function(msg)
|
||||
{
|
||||
if (msg.error)
|
||||
{
|
||||
showErrorMessage(msg.error);
|
||||
return;
|
||||
}
|
||||
showSuccessMessage(msg.success);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
34
modules/roy_content/js/index.php
Normal file
34
modules/roy_content/js/index.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2014 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
header('Location: ../');
|
||||
|
||||
exit;
|
||||
Reference in New Issue
Block a user