( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<script type="text/javascript">
var basic, full, fullInit, fullDestroy, changed = [];
$(function(){
basic = $('#basic .plugin img').PichaMoja({
width: 600,
height: 600
});
var theUpdate = $('#update').val();
var theUpdate = encodeURIComponent(theUpdate);
var theUsername = "<?php echo ucwords($user_nameX); ?>";
var theUrl = "thebrand.co.ke/<?php echo $user_nameX; ?>";
var theName = "<?php echo $catalognameX; ?>";
var theUser = "<?php echo $user_nameX; ?>";
var onerror = function() {
alert('"' + this.src + '" could not load');
};
(fullInit = function() {
full = $('#full .plugin img').PichaMoja({
canvasWidth: <?php echo $layer0w ?>,
canvasHeight: <?php echo $layer0h ?>,
/*canvasHeight:650,*/
positionX: <?php echo $layer0x ?>,
positionY: <?php echo $layer0y ?>,
width: 600,
error: onerror,
<?php /*?>background: '<?php echo $layerbg ?>',<?php */?>
background: 'fff',
loading: function(process) {
$('#full .progress-bar').css('width', process + '%');
$('#full .progress-bar').css('background-color', '#00aff0');
},
change: function(allOpts, changedProps) {
changed = changedProps;
if (is_changed("layer")) {
// Layer list
var list = $('#full .layer-list').html('');
var sameOrigin = true;
var template = $(''
+ ' <tr class="list-group-item h5" draggable="true" style=" margin:0px; border-bottom:0px">'
+ ' <td style="max-width:400px;overflow:hidden"> <span class="src "></span></td> '
+ '<td width=150 align=right><a class="remove"><i class="icon-trash m-r-lg"></i></a> '
+ ' <a class="down"><i class="icon-chevron-down"></i></a> '
+ ' <a class="up"><i class="icon-chevron-up"></i></a> </td> '
+ '</tr>');
for (var i = 0; i < allOpts.layers.length; i++) {
$('#type').val(allOpts.layers[i].src);
/*if(allOpts.layers.length >5) { alert("maximum layers");}*/
/*allOpts.layers.length replced by 4*/
if ( ! this.layers[ allOpts.layers[i].index ].sameOrigin ) {
sameOrigin = false;
}
list.prepend(
template.clone()
.data('index', allOpts.layers[i].index)
.find('.src').html(<?php /*?>i+<?php */?>" <img class='img-circle' style='margin:0; background-color:#333; height:40px;padding:0px' src='"+allOpts.layers[i].src+"' width='40' > "+checkLayerType(allOpts.layers[i].src)+" "<?php /*?>+ allOpts.layers[i].index<?php */?>)
.addClass(allOpts.layers[i].active ? 'active' : '')
.attr('href', allOpts.layers[i].src)
.attr('id', i)
.parents('tr')
);
}
// Same-origin policy warning
if (!sameOrigin) {
$('#full .same-origin-warning').show();
} else {
$('#full .same-origin-warning').hide();
}
}
// Active layer parameters
is_changed("layer") && $('#full .active-layer-src').attr('href', allOpts.src).html(allOpts.src);
is_changed("layer") && $('#full .active-layer').val(allOpts.src);
var parsed_qs = parse_query_string(allOpts.src);
is_changed("layer") && $('#plain').val(parsed_qs.text);
is_changed("layer") && $('#full .updateUrl').val(allOpts.src);
is_changed("layer") && $('#full .active-layer-src').attr('href', allOpts.src).html(allOpts.src);
is_changed("layer") && $('#full .active-layer-category').val(allOpts.category);
/*
is_changed("layer") && $('#full .active-layer-src')
{
var str = allOpts.src;
var n = str.indexOf("processFont");
if (n < 0) { is_changed("layer") && $('#full .active-layer-category').val("nothing"); }
}*/
/* */
if (allOpts.src.indexOf("&gallery=yes") >= 0)
{
$('.checkLevel').val(i);
}
if (allOpts.src.indexOf("theUpdate") >= 0)
{
is_changed("layer") ;
$('#theLayouts').hide();
$('#theComments').show();
$('#theUrl').hide();
$('#theName').hide();
$('#textProperties').show();
$('#thePlain').hide();
$('#plainProperties').hide();
$('#nameProperties').hide();
$('#urlProperties').hide();
$('#userProperties').hide();
$('#theUser').hide();
$('#properties').hide();
full.disableResize();
full.enableRotate();
$('#update').val("<?php echo $text ?>");
}
else if (allOpts.src.indexOf("theUrl") >= 0)
{
is_changed("layer") ;
$('#theLayouts').hide();
$('#theComments').hide();
$('#theName').hide();
$('#theUrl').show();
$('#thePlain').hide();
$('#plainProperties').hide();
$('#textProperties').hide();
$('#nameProperties').hide();
$('#urlProperties').show();
$('#userProperties').hide();
$('#theUser').hide();
$('#properties').hide();
full.disableResize();
full.enableRotate();
$('#url').val("<?php echo "thebrand.co.ke/".$slugX ?>");
}
else if (allOpts.src.indexOf("thePlain") >= 0)
{
is_changed("layer") ;
$('#theLayouts').hide();
$('#theComments').hide();
$('#theName').hide();
$('#theUrl').hide();
$('#thePlain').show();
$('#plainProperties').show();
$('#textProperties').hide();
$('#nameProperties').hide();
$('#urlProperties').hide();
$('#userProperties').hide();
$('#theUser').hide();
$('#properties').hide();
full.disableResize();
full.enableRotate();
/*$('#plain').val("<?php echo "thebrand.co.ke/".$slugX ?>");*/
}
else if (allOpts.src.indexOf("theUser") >= 0)
{
is_changed("layer") ;
$('#theLayouts').hide();
$('#theComments').hide();
$('#theName').hide();
$('#theUrl').hide();
$('#theUser').show();
$('#thePlain').hide();
$('#plainProperties').hide();
$('#textProperties').hide();
$('#nameProperties').hide();
$('#urlProperties').hide();
$('#userProperties').show();
$('#properties').hide();
full.disableResize();
full.enableRotate();
$('#user').val("<?php echo $user_nameX; ?>");
}
else if (allOpts.src.indexOf("theName") >= 0)
{
is_changed("layer") ;
$('#theLayouts').hide();
$('#theComments').hide();
$('#theName').show();
$('#theUrl').hide();
$('#thePlain').hide();
$('#plainProperties').hide();
$('#properties').hide();
$('#textProperties').hide();
$('#nameProperties').show();
$('#urlProperties').hide();
$('#userProperties').hide();
$('#theUser').hide();
full.disableResize();
full.enableRotate();
$('#name').val("<?php echo $catalognameX;?>");
}
else if (allOpts.src.indexOf("theUsername") >= 0)
{
is_changed("layer") ;
$('#theLayouts').hide();
$('#theComments').show();
$('#theName').hide();
$('#theUrl').hide();
$('#properties').hide();
$('#theUser').hide();
$('#thePlain').hide();
$('#plainProperties').hide();
$('#textProperties').hide();
$('#nameProperties').hide();
$('#urlProperties').hide();
$('#userProperties').show();
full.disableResize();
full.disableRotate();
$('#user').val("<?php echo $user_nameX;?>");
}
else
{
is_changed("layer") ;
$('#theComments').hide();
$('#theName').hide();
$('#theUrl').hide();
$('#properties').hide();
$('#theLayouts').show();
$('#textProperties').hide();
$('#nameProperties').hide();
$('#urlProperties').hide();
$('#userProperties').hide();
$('#theUser').hide();
$('#thePlain').hide();
$('#plainProperties').hide();
$('#properties').show();
full.enableResize();
full.enableRotate();
}
$('.count').html(i);
$('.upload-image').attr('id', i);
$('.level').val(i);
is_changed("canvasWidth") && $('#full input.canvas-width').val(allOpts.canvasWidth);
is_changed("app") && $('#full input.canvas-width').val(allOpts.app);
is_changed("canvasHeight") && $('#full input.canvas-height').val(allOpts.canvasHeight);
is_changed("opacity") && $('#full input.opacityText').val(allOpts.opacity);
is_changed("opacity") && $('#full input.opacityUrl').val(allOpts.opacity);
is_changed("opacity") && $('#full input.opacityPlain').val(allOpts.opacity);
is_changed("opacity") && $('#full input.opacityName').val(allOpts.opacity);
is_changed("opacity") && $('#full input.opacityUser').val(allOpts.opacity);
is_changed("opacity") && $('#full input.opacity').val(allOpts.opacity);
is_changed("positionX") && $('#full input.position-x').val(allOpts.positionX);
is_changed("positionY") && $('#full input.position-y').val(allOpts.positionY);
is_changed("width") && $('#full input.width').val(allOpts.width);
is_changed("height") && $('#full input.height').val(allOpts.height);
is_changed("rotation") && $('#full input.rotation').val(allOpts.rotation);
is_changed("category") && $('#full input.category').val(allOpts.category);
is_changed("background") && $('#full input.background').val(allOpts.background);
is_changed("flipV") && $('#full input.flip-v').prop('checked', allOpts.flipV);
is_changed("flipH") && $('#full input.flip-h').prop('checked', allOpts.flipH);
}
})
<?php $myLayers = $db->getmylayers($msg_id);
while ( list($key,$val)=each($myLayers) ) {
$catalogid = $val["catalogid"];
$themeid = $val["themeid"];
$layer = $val["name"];
$layertype = $val["layertype"];
$position = $val["position"];
$layerw=$val["layerw"];
$layerh=$val["layerh"];
$layerx=$val["layerx"];
$layery=$val["layery"];
$layerr=$val["layerr"];
$layerfliph=$val["flipH"];
$layeropacity=$val["layeropacity"];
$layerflipv=$val["flipV"];
/*
if (strpos($layer, 'route=theUpdate') !== false) { $layerX = str_replace("&typeData=theUpdate" , '',$layer);$extension = "&typeData=theUpdate"; }
elseif (strpos($layer, 'route=theName') !== false) { $layerX = str_replace("&typeData=theName" , '',$layer);$extension = "&typeData=theName"; }
elseif (strpos($layer, 'route=thePlain') !== false) { $layerX = str_replace("&typeData=thePlain" , '',$layer);$extension = "&typeData=thePlain"; }
elseif (strpos($layer, 'route=theUser') !== false) { $layerX = str_replace("&typeData=theUser" , '',$layer);$extension = "&typeData=theUser"; }
elseif (strpos($layer, 'route=theUrl') !== false) { $layerX = str_replace("&typeData=theUrl" , '',$layer);$extension = "&typeData=theUrl"; }
else {$extension = ""; }
if (strpos($layer, 'unique=profilePic') !== false) { $layerX = str_replace("&typeData=profilePic&meData=$catalogidX" , '',$layer);$extension = "&typeData=profilePic&meData=$catalogidX"; }
*/?><?php if(!empty($layer)){if (strpos($layer, 'route=theUpdate') !== false || strpos($layer, 'route=theName') !== false || strpos($layer, 'route=thePlain') !== false || strpos($layer, 'route=theUser') !== false || strpos($layer, 'route=theUrl') !== false) {$output = "width:$layerw ,";}else {$output = "width:$layerw ,
height: $layerh ,"; }?>
.addNewLayer('<?php echo $layer;?>', {
rotation: <?php echo $layerr ?>,
positionX:<?php echo $layerx ?>,
positionY: <?php echo $layery ?>,
<?php echo $output; ?>
category: "0",
app: "theBrand",
opacity: <?php echo $layeropacity ?>
})<?php }?><?php
}
?>
$('#full .controls-destroyed').hide();
$('#full .controls-initialized').show();
// Fix static inputs with defaults
$('#full input.enabled').prop('checked', true);
$('#full input.rotate').prop('checked', true);
$('#full input.move').prop('checked', true);
$('#full input.resize').prop('checked', true);
$('#full input.overflow').prop('checked', true);
$('#full input.layer').val('');
})();
/**
* Destroy function
*/
fullDestroy = function() {
full.destroy();
full = null;
$('#full .controls-destroyed').show();
$('#full .controls-initialized').hide();
};
/**
* Init
*/
$('#full button.init').click(fullInit);
/**
* Destroy
*/
$('#full button.destroy').click(fullDestroy);
/**
* Save as
*/
$('#full .controls-initialized button.saveas').parents("form").submit(function() {
$(this).find("input[type='hidden']").val(full.render());
});
/**
* Add layer (layer list)
*/
function addlayout(imageUrl)
{
var effect = imageUrl;
var str = effect;
var res = str.replace(".png", "");
$("#check").html("Loading "+res+"...");
<?php /*?> full && full.removeLayer($(this).parents('tr').data('index'));<?php */?>
$('#full input.layer').val("<?php echo $siteaddress3 ?>taswira.php?quality=100&nocache=1&width=600&height=600&cropratio=1:1&image=/filters/mood/"+effect+".png");
full && full.addNewLayer($('#full input.layer').val(), {
error: onerror
});
}
$('.addlayout').click(function() {
loading_show();
var effect = $(this).attr("id");
var str = effect;
var res = str.replace(".png", "");
$("#check").html("Loading "+res+"...");
<?php /*?> full && full.removeLayer($(this).parents('tr').data('index'));<?php */?>
$('#full input.layer').val("<?php echo $siteaddress3 ?>taswira.php?quality=100&nocache=1&width=600&height=600&cropratio=1:1&image=/filters/mood/"+effect+".png");
full && full.addNewLayer($('#full input.layer').val(), {
error: onerror
});
loading_hide();
$("#check").html(" ");
})
$('#full .add-new-plain').click(function(){
var effect = $(this).attr("id");
$('#full input.addPlain').val(effect);
full && full.addNewLayer($('#full input.addPlain').val(), {
error: onerror
});
setTimeout( function(){
exportIt();
setTimeout( function(){
window.location = "indexAlone.php?mode=elements&msg_id=<?php echo $msg_id2 ?><?php /*?>&category=alert-success&msg2=Addon+Added<?php */?>"; },1500 );
},1500 );
});
$('#full .add-new-plain-qr').click(function(){
$.ajax({
type: 'POST',
url: 'v/qr.php?themeid=<?php echo $realthemeID ?>&text=thebrand.co.ke/<?php echo $slugX; ?>&catalogid=<?php echo $catalogid5 ?>',
data: {'uploadedLayer': ""},
success: function(msg) {
$("#check").html("<i class='icon-bell text-danger'></i>Added... ");
$('#full input.addPlain').val("v/uploads/gthumbs/<?php echo $realthemeID ?>.png");
full && full.addNewLayer($('#full input.addPlain').val(), {
error: onerror
});
}
});
});
$('#full button.add-new-layer').click(function(){
full && full.addNewLayer($('#full input.layer').val(), {
error: onerror
});
});
$('#full input.layer').on('keydown', function(e) {
full && e.keyCode === 13 && $('#full button.layer-btn').click();
});
$('#full .upload-image').uploader({
xhr: {/* */
success: function(response) {
var rotation= encodeURI(document.getElementById('rotation').value);
var level= encodeURI(document.getElementById('level').value);
$.ajax({
type: 'POST',
url: 'v/uploadParameters.php?themeid=<?php echo $msg_id2 ?>&catalogid=<?php echo $catalogid5 ?>',
data: {'uploadedLayer': response.file,'level': level},
success: function(msg) {
full && full.addNewLayer(response.file);
var level= encodeURI(document.getElementById('level').value);
var level= level-1;
full && full.sendBack(level);
/**/
$("#check").html("<i class='icon-bell text-danger'></i> "+msg);
/*alert(msg);*/
setTimeout( function(){exportIt();},1500 );
}
});
}
}
});
/**
* Remove layer (layer list)
*/
$('#full .layer-list').on('click', 'a.remove', function() {
var layerId = $(this).parents('tr').data('index');
var dataString = 'layer_id='+ layerId;
if(layerId == 0)
{
$("#check").html("<i class='icon-bell text-danger'></i> Only layers above the Background can be deleted");
return false;
}
if(confirm("Do you want to Delete Layer"+layerId+"?"))
{
full && full.removeLayer($(this).parents('tr').data('index'));
/* $('#full button.export').click();*/
$.ajax({
type: "POST",
url: "v/uploadParameters.php?themeid=<?php echo $msg_id2 ?>&catalogid=<?php echo $catalogid5 ?>&deleteLayer=yes",
data: dataString,
cache: false,
success: function(html){
$("#check").html(html);
}
});
}
return false;
});
$('#full').on('click', '.removeFont', function() {
var layerId = $(this).attr("id");
var dataString = 'layer_id='+ layerId;
if(confirm("Do you want to detach font "+layerId+" from theme?"))
{
$.ajax({
type: "POST",
url: "v/uploadParameters.php?themeid=<?php echo $msg_id2 ?>&catalogid=<?php echo $catalogid5 ?>&deleteFont=yes",
data: dataString,
cache: false,
success: function(html){
$("#check").html(html);
}
});
}
return false;
});
/**
* Bring front (layer list)
*/
$('#full .layer-list').on('click', 'a.up', function() {
var level = $(this).parents('tr').data('index') ;
if (level != 0){
$('#theComments').hide();
$('#theName').hide();
$('#theUrl').hide();
$('#thePlain').hide();
$('#plain').hide();
$('#properties').hide();
$('#theLayouts').show();
$('#textProperties').hide();
$('#nameProperties').hide();
$('#urlProperties').hide();
$('#plainProperties').hide();
$('#userProperties').hide();
$('#theUser').hide();
$('#properties').hide();
full && full.bringFront($(this).parents('tr').data('index'));
}
else
{
$("#check").html("<i class='icon-bell text-danger'></i>Sorry: Background can't be moved to front");
}
});
/**
* Send back (layer list)
*/
$('#full .layer-list').on('click', 'a.down', function() {
var level = $(this).parents('tr').data('index') ;
if (level != 1){
$('#theComments').hide();
$('#theName').hide();
$('#theUrl').hide();
$('#properties').hide();
$('#theLayouts').show();
$('#textProperties').hide();
$('#nameProperties').hide();
$('#urlProperties').hide();
$('#userProperties').hide();
$('#theUser').hide();
$('#plainProperties').hide();
$('#plain').hide();
$('#thePlain').hide();
$('#properties').hide();
full && full.sendBack($(this).parents('tr').data('index'));
}
else
{
$("#check").html("<i class='icon-bell text-danger'></i>Sorry: Backgrounds cannot be replaced. ");
}
});
/**
* Activate layer (layer list)
*/
$('#full .layer-list').on('click', '.src', function(ev) {
ev.preventDefault();
full && full.activateLayer($(this).parents('tr').data('index') * 1);
});
/**
* Set canvas width, height
*/
$('#full .set-canvas-sizes').click(function() {
full && full.set({
canvasWidth: $('#full .canvas-width').val() * 1,
canvasHeight: $('#full .canvas-height').val() * 1
});
});
/**
* Set active layer's width and height
*/
$('#full .set-sizes').click(function() {
full && full.set({
width: $('#full .width').val() * 1,
height: $('#full .height').val() * 1
});
});
/**
* Set active layer's positionX and positionY
*/
$('#full .set-position').click(function() {
full && full.set({
positionX: $('#full .position-x').val() * 1,
positionY: $('#full .position-y').val() * 1
});
});
$('#full .set-positionGraphics').click(function() {
full && full.set({
positionX: $('#full #position-xg').val() * 1,
positionY: $('#full #position-yg').val() * 1
});
});
/**
* Set active layer's rotation
*/
$('#full .set-rotation').click(function() {
full && full.set({ rotation: $('#full .rotation').val() * 1 });
});
/**
* Set active layer's opacity
*/
$('#full .set-opacity').click(function() { alert($('#full .opacity').val());
full && full.set({ opacity: $('#full .opacity').val() * 1 });
});
/**
* Set active layer's background
*/
$('#full .set-background').click(function() {
full && full.set({ background: $('#full .background').val() });
});
/**
* Flip active layer
*/
$('#full .flip-h').change(function() {
full && full.activeLayer.flipHorizontal( $(this).is(':checked') );
});
$('#full .flip-v').change(function() {
full && full.activeLayer.flipVertical( $(this).is(':checked') );
});
/**
* Remove active layer
*/
$('#full button.remove-layer-btn').click(function() {
full && full.removeLayer();
});
/**
* Bring front (active layer)
*/
$('#full button.bring-front').on('click', function() {
full && full.bringFront();
});
/**
* Send back (active layer)
*/
$('#full button.send-back').on('click', function() {
full && full.sendBack();
});
/**
* Export parameters (active layer)
*/
$('.duplicate').on('click', function() {
var dataString = "duplicateTheme:yes";
$("#check").html("<i class='icon-bell text-danger'></i> Duplicating..." );
$.ajax({
type: "POST",
url: "v/uploadParameters.php?themeid=<?php echo $realthemeID ?>&catalogid=<?php echo $catalogid5 ?>&who=<?php echo $catalogid5 ?> ?>&pic=<?php echo $picture ?>&duplicateTheme=yes",
data: dataString,
cache: false,
success: function(html){
$("#check").html(html );
window.location = "?mode=elements&msg_id="+html+"&category=alert-success&msg2=Successfully+Copied+Theme";
}
});
});
function savePoster() {
$("#check").html("<i class='icon-bell text-danger'></i> Saving poster..." );
$.ajax({
type: "POST",
url: "brandX.php?mag=yes&theme_id=<?php echo $realthemeID ?>&AppNo=<?php echo $catalogid5 ?>&x=0&y=0&pic=<?php echo $result[0]["picture"] ?>&gratitude=posted&context=How%20Are%20You%20Feeling%20Today&filter=mood&cl=machine&overlay=0&saveThemePoster=1&nani=<?php echo $catalogid5 ?>&default=yes&msg_id=<?php echo $realthemeID ?>",
data: dataString,
cache: false,
success: function(html){
$("#finish").show();
$("#check").html("<i class='icon-bell text-danger'></i> Successfully saved theme!" );
}
});
}
$('#full button.export').click(function() {
exportIt();
})
function exportIt()
{
$("#check").html("<i class='icon-bell text-danger'></i> Saving design..." );
<?php /*?>full && alert( JSON.stringify(full.get()) );<?php */?>
/*$("#check").html( JSON.stringify(full.get()));return;*/
var startag= encodeURI(document.getElementById('startag').value);
/*alert(startag); return;*/
var themeid = $("#mytheme").val();
var update = $("#update").val();
var setFontSize = $("#setFontSize").val();
var layerid = $("#level").val();
var setLineHeight = $("#setLineHeight").val();
var setHAlignment = $("#setHAlignment").val();
var opacity = $("#opacity").val();
var setPadding = $("#setPadding").val();
var setWidth = $("#setWidth").val();
var text_color = $("#text_color").val();
var positionx = $("#position-x").val();
var positiony = $("#position-y").val();
var font_Text = $("#myFont").val();
var flagText = $("#flagText").val();
var flagName = $("#flagName").val();
var flagUser = $("#flagUser").val();
var flagUrl = $("#flagUrl").val();
var name = $("#name").val();
var setFontSizeN = $("#setFontSizeN").val();
var setLineHeightN = $("#setLineHeightN").val();
var setHAlignmentN = $("#setHAlignmentN").val();
var opacityN = $("#opacityN").val();
var setPaddingN = $("#setPaddingN").val();
var setWidthN = $("#setWidthN").val();
var name_color = $("#name_color").val();
var positionxN = $("#position-xN").val();
var positionyN = $("#position-yN").val();
var font_Name = $("#myFontN").val();
var plain = $("#plain").val();
var setFontSizeP = $("#setFontSizeP").val();
var setLineHeightP = $("#setLineHeightP").val();
var setHAlignmentP = $("#setHAlignmentP").val();
var opacityP = $("#opacityP").val();
var setPaddingP = $("#setPaddingP").val();
var setWidthP = $("#setWidthP").val();
var plain_color = $("#plain_color").val();
var positionxP = $("#position-xP").val();
var positionyP = $("#position-yP").val();
var font_Plain = $("#myFontP").val();
var url = $("#url").val();
var setFontSizeL = $("#setFontSizeL").val();
var setLineHeightL = $("#setLineHeightL").val();
var setHAlignmentL = $("#setHAlignmentL").val();
var opacityL = $("#opacityL").val();
var setPaddingL = $("#setPaddingL").val();
var setWidthL = $("#setWidthL").val();
var url_color = $("#name_color").val();
var positionxL = $("#position-xL").val();
var positionyL = $("#position-yL").val();
var font_Url = $("#myFontL").val();
var parameters= JSON.stringify(full.get());
$.ajax({
type: 'POST',
url: 'v/uploadParameters.php?themeid=<?php echo $msg_id2 ?>&catalogid=<?php echo $catalogid5 ?>&flagText='+flagText+'&flagUrl='+flagUrl+'&flagName='+flagName+'&flagUser='+flagUser+'&startag='+startag+'&action=update&fontid='+themeid+'&myfont='+layerid+'&fontcatalogid=<?php echo $catalogidX ?>&themeid='+themeid+'&font_Username='+font_Text+'&font_Name='+font_Text+'&font_Url='+font_Text+'&font_Text='+font_Text+'&text_w='+setWidth+'&text_h=0&text_x='+positionx+'&text_y='+positiony+'&text_align='+setHAlignment+'&text_size='+setFontSize+'&text_color='+text_color+'&url_color='+text_color+'&name_color='+text_color+'&username_color='+text_color+'&url_size='+setFontSize+'&name_size='+setFontSize+'&username_size='+setFontSize+'&text_pad='+setPadding+'&text_line_height='+setLineHeight+'&text='+update,
data: {'params': parameters},
success: function(msg) {
/*alert(msg);*/
savePoster(); $("#check").html("<i class='icon-bell text-danger'></i> "+msg);
/*$("#startag").hide();*/
}
});
}
$('#full input.enabled').on('change', function() {
if ( full ) {
if ( $(this).is(':checked') ) {
full.enable();
} else {
full.disable();
}
}
});
$('#full input.rotate').on('change', function() {
if ( full ) {
if ( $(this).is(':checked') ) {
full.enableRotate();
} else {
full.disableRotate();
}
}
});
$('#full input.move').on('change', function() {
if ( full ) {
if ( $(this).is(':checked') ) {
full.enableMove();
} else {
full.disableMove();
}
}
});
$('#full input.resize').on('change', function() {
if ( full ) {
if ( $(this).is(':checked') ) {
full.enableResize();
} else {
full.disableResize();
};
};
});
$('#full input.overflow').on('change', function() {
if ( full ) {
if ( $(this).is(':checked') ) {
full.showOverflow();
} else {
full.hideOverflow();
};
};
});
$('#full-modal').on('show.bs.modal', function(ev) {
$('img', this).attr('src', full.render());
});
function is_changed(propName) {
return changed.indexOf("all") > -1 ||
changed.indexOf("layer") > -1 ||
changed.indexOf(propName) > -1;
}
function checkLayerType(imageUrl) {
if (imageUrl.indexOf("theUpdate") >= 0)
{
var LayerType = "<strong>Text Caption: </strong> <?php echo $text; ?> ";
$('#full .layerTypeUpdate').val(1);
return LayerType;
}
else if (imageUrl.indexOf("mood") >= 0)
{
var LayerType = "<strong>Overlay: </strong> Graphics ";
return LayerType;
}
else if (imageUrl.indexOf("thePlain") >= 0)
{
var parsed_qs = parse_query_string(imageUrl);
var LayerType = "<strong>Addon </strong>: "+parsed_qs.text;
return LayerType;
}
else if (imageUrl.indexOf("theUrl") >= 0)
{
var LayerType = "<strong>Text URL: </strong> thebrand.co.ke/<?php echo $slugX; ?> ";
$('#full .layerTypeUrl').val(2);
return LayerType;
}
else if (imageUrl.indexOf("theName") >= 0)
{
var LayerType = "<strong>Name: </strong> <?php echo $catalognameX; ?> ";
$('#full .layerTypeName').val(3);
return LayerType;
}
else if (imageUrl.indexOf("theUser") >= 0)
{
var LayerType = "<strong>User Name: </strong> <?php echo $user_nameX; ?> ";
$('#full .layerTypeUser').val(4);
return LayerType;
}
else if (imageUrl.indexOf("ProfilePic") >= 0)
{
var LayerType = "<strong>Image: </strong> Profile Picture ";
return LayerType;
}
else{
var LayerType = "<strong>Image: </strong> ";
return LayerType;
}
}
function parse_query_string(query) {
var vars = query.split("&");
var query_string = {};
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
// If first entry with this name
if (typeof query_string[pair[0]] === "undefined") {
query_string[pair[0]] = decodeURIComponent(pair[1]);
// If second entry with this name
} else if (typeof query_string[pair[0]] === "string") {
var arr = [query_string[pair[0]], decodeURIComponent(pair[1])];
query_string[pair[0]] = arr;
// If third or later entry with this name
} else {
query_string[pair[0]].push(decodeURIComponent(pair[1]));
}
}
return query_string;
}
$('#my_image').on({
'click': function(){
$('#my_image').attr('src','second.jpg');
}
});
<?php /*?>
alert(list);<?php */?>
function DropDown(el) {
this.dd = el;
this.placeholder = this.dd.children('span');
this.opts = this.dd.find('ul.dropdown > li');
this.val = '';
this.index = -1;
this.initEvents();
}
DropDown.prototype = {
initEvents : function() {
var obj = this;
obj.dd.on('click', function(event){
$(this).toggleClass('active');
return false;
});
obj.opts.on('click',function(){
var opt = $(this);
obj.val = opt.text();
obj.index = opt.index();
obj.placeholder.text(obj.val);
$("#myFont").val(obj.val);
});
},
getValue : function() {
return this.val;
},
getIndex : function() {
return this.index;
}
}
$(function() {
var dd = new DropDown( $('#dd') );
$(document).click(function() {
// all dropdowns
$('.dropdownit-3').removeClass('active');
});
var dd = new DropDown( $('#dd2') );
$(document).click(function() {
// all dropdowns
$('.dropdownit-3').removeClass('active');
});
});
});
$(".input-group-addon").on("click", function() {
var $button = $(this);
var oldValue = $button.parent().find(".incremental").val();
var operation = $(this).attr("id");
if (operation == "inc") {
var newVal = parseFloat(oldValue) + 1;
} else {
// Don't allow decrementing below zero
if (oldValue > 0) {
var newVal = parseFloat(oldValue) - 1;
} else {
newVal = 0;
}
}
$button.parent().find(".incremental").val(newVal);
refreshIt();
});
$(".addbg").click(function() {
loading_show();
var effect = $(this).attr("id");
var str = effect;
var res = str.replace(".png", "");
$("#check").html("Loading "+res+"...");
<?php /*?> var level =$('.checkLevel').val();
if($.trim(level).length==0)
{
full && full.removeLayer(level-1);
}<?php */?>
<?php /*?> full && full.removeLayer($(this).parents('tr').data('index'));<?php */?>
$('#full input.layer').val("<?php echo $siteaddress3 ?>taswira.php?quality=100&nocache=1&width=600&gallery=yes&height=600&cropratio=1:1&image=/v/uploads/gthumbs/"+effect+"");
full && full.addNewLayer($('#full input.layer').val(), {
error: onerror
});
loading_hide();
$("#check").html(" ");
});
$('#full .upload-font').uploader({
xhr: {/* */
success: function(response) {
$("#check").html("<i class='icon-bell text-danger'></i> "+msg);
}
}
});
function refreshIt(){
var imageUrl = $("#active-layer").val();
var imageUrl = encodeURIComponent(imageUrl);
if (imageUrl.indexOf("theUpdate") >= 0)
{
$('#theComments').hide();
$('#theName').hide();
$('#theUrl').hide();
$('#properties').hide();
$('#theLayouts').show();
$('#textProperties').hide();
$('#nameProperties').hide();
$('#urlProperties').hide();
$('#userProperties').hide();
$('#theUser').hide();
$('#properties').hide();
textRefresh();
return;
}
else if (imageUrl.indexOf("theUrl") >= 0)
{
$('#theComments').hide();
$('#theName').hide();
$('#theUrl').hide();
$('#properties').hide();
$('#theLayouts').show();
$('#textProperties').hide();
$('#nameProperties').hide();
$('#urlProperties').hide();
$('#userProperties').hide();
$('#theUser').hide();
$('#properties').hide();
urlRefresh();
return;
}
else if (imageUrl.indexOf("theName") >= 0)
{
$('#theComments').hide();
$('#theName').hide();
$('#theUrl').hide();
$('#properties').hide();
$('#theLayouts').show();
$('#textProperties').hide();
$('#nameProperties').hide();
$('#urlProperties').hide();
$('#userProperties').hide();
$('#theUser').hide();
$('#properties').hide();
nameRefresh();
return;
}
else if (imageUrl.indexOf("thePlain") >= 0)
{
$('#theComments').hide();
$('#theName').hide();
$('#theUrl').hide();
$('#properties').hide();
$('#theLayouts').show();
$('#textProperties').hide();
$('#nameProperties').hide();
$('#urlProperties').hide();
$('#userProperties').hide();
$('#theUser').hide();
$('#properties').hide();
plainRefresh();
return;
}
else if (imageUrl.indexOf("theUser") >= 0)
{
$('#theComments').hide();
$('#theName').hide();
$('#theUrl').hide();
$('#properties').hide();
$('#theLayouts').show();
$('#textProperties').hide();
$('#nameProperties').hide();
$('#urlProperties').hide();
$('#userProperties').hide();
$('#theUser').hide();
$('#properties').hide();
userRefresh();
return;
}
else{
}
}
function textRefresh()
{
loading_show();
var updateUrl = $("#updateUrl").val();
var themeid = $("#realthemeID").val();
var update = $("#update").val();
var setFontSize = $("#setFontSize").val();
var layerid = $("#level").val();
var removelayerid = $("#level").val();
var removelayerid = removelayerid-1;
var setLineHeight = $("#setLineHeight").val();
var setHAlignment = $("#setHAlignment").val();
var opacity = $("#opacity").val();
var setPadding = $("#setPadding").val();
var setWidth = $("#setWidth").val();
var text_color = $("#text_color").val();
var text_color = text_color.replace("#", "");
var positionx = $("#position-xa").val();
var positiony = $("#position-ya").val();
$("#pozx").val(positionx);
$("#pozy").val(positiony);
var font_Text = $("#myFont").val();
$("#check").html("Updating Text Layer "+layerid+"...");
var level= encodeURI(document.getElementById('level').value);
full && full.bringFront($(this).parents('tr').data(level));
full && full.removeLayer($(this).parents('tr').data(level));
<?php /*?> $("#check").html('<?php echo $siteaddress3 ?>processFont.php?route=theUpdate&fontid='+themeid+'&myfont='+layerid+'&fontcatalogid=<?php echo $catalogidX ?>&themeid='+themeid+'&font_Username='+font_Text+'&font_Name='+font_Text+'&font_Url='+font_Text+'&font_Text='+font_Text+'&text_w='+setWidth+'&text_h=0&text_x='+positionx+'&text_y='+positiony+'&text_align='+setHAlignment+'&text_size='+setFontSize+'&text_color='+text_color+'&url_color='+text_color+'&name_color='+text_color+'&username_color='+text_color+'&url_size='+setFontSize+'&name_size='+setFontSize+'&username_size='+setFontSize+'&text_pad='+setPadding+'&text_line_height='+setLineHeight+'&text='+update+'');return;
<?php */?>
full && full.addNewLayer('<?php echo $siteaddress3 ?>processFont.php?route=theUpdate&fontid='+themeid+'&myfont='+layerid+'&fontcatalogid=<?php echo $catalogidX ?>&themeid='+themeid+'&font_Username='+font_Text+'&font_Name='+font_Text+'&font_Url='+font_Text+'&font_Text='+font_Text+'&text_w='+setWidth+'&text_h=0&text_x='+positionx+'&text_y='+positiony+'&text_align='+setHAlignment+'&text_size='+setFontSize+'&text_color='+text_color+'&url_color='+text_color+'&name_color='+text_color+'&username_color='+text_color+'&url_size='+setFontSize+'&name_size='+setFontSize+'&username_size='+setFontSize+'&text_pad='+setPadding+'&text_line_height='+setLineHeight+'&text='+update, {
rotation: 0,
positionX:$("#pozx").val(),
positionY: positiony,
category: "0",
opacity:opacity
})
loading_hide(); $("#check").html("Successfully updated");return;
}
$('.textRefresh').click(function() {
textRefresh();
})
$('.urlRefresh').click(function() {
urlRefresh();
})
$('.nameRefresh').click(function() {
nameRefresh();
})
$('.plainRefresh').click(function() {
plainRefresh();
})
$('.userRefresh').click(function() {
userRefresh();
})
function userRefresh()
{
loading_show();
var updateUrl = $("#updateUser").val();
var themeid = $("#realthemeID").val();
var update = $("#user").val();
var setFontSize = $("#setFontSizeC").val();
var layerid = $("#level").val();
var removelayerid = $("#level").val();
var removelayerid = removelayerid-1;
var setLineHeight = $("#setLineHeightC").val();
var setHAlignment = $("#setHAlignmentC").val();
var opacity = $("#opacityC").val();
var setPadding = $("#setPaddingC").val();
var setWidth = $("#setWidthC").val();
var text_color = $("#user_color").val();
var text_color = text_color.replace("#", "");
var positionx = $("#position-userx").val();
var positiony = $("#position-usery").val();
var font_Text = $("#myFontUser").val();
$("#check").html("Updating Name Layer "+layerid+"...");
var level= encodeURI(document.getElementById('level').value);
full && full.bringFront($(this).parents('tr').data(level));
full && full.removeLayer($(this).parents('tr').data(level));
full && full.addNewLayer('<?php echo $siteaddress3 ?>processFont.php?route=theUser&fontid='+themeid+'&myfont='+layerid+'&fontcatalogid=<?php echo $catalogidX ?>&themeid='+themeid+'&font_Username='+font_Text+'&font_Name='+font_Text+'&font_Url='+font_Text+'&font_Text='+font_Text+'&text_w='+setWidth+'&text_h=0&text_x='+positionx+'&text_y='+positiony+'&text_align='+setHAlignment+'&text_size='+setFontSize+'&text_color='+text_color+'&url_color='+text_color+'&name_color='+text_color+'&username_color='+text_color+'&url_size='+setFontSize+'&name_size='+setFontSize+'&username_size='+setFontSize+'&text_pad='+setPadding+'&text_line_height='+setLineHeight+'&text='+update, {
rotation: 0,
positionX:positionx,
positionY: positiony,
category: "0",
opacity:opacity
})
loading_hide(); $("#check").html("Successfully updated");return;
}
function urlRefresh()
{
loading_show();
var updateUrl = $("#updateUrl").val();
var themeid = $("#realthemeID").val();
var update = $("#url").val();
var setFontSize = $("#setFontSizeU").val();
var layerid = $("#level").val();
var removelayerid = $("#level").val();
var removelayerid = removelayerid-1;
var setLineHeight = $("#setLineHeightU").val();
var setHAlignment = $("#setHAlignmentU").val();
var opacity = $("#opacityU").val();
var setPadding = $("#setPaddingU").val();
var setWidth = $("#setWidthU").val();
var text_color = $("#url_color").val();
var text_color = text_color.replace("#", "");
var positionx = $("#position-xU").val();
var positiony = $("#position-yU").val();
var font_Text = $("#myFontUrl").val();
$("#check").html("Updating Name Layer "+layerid+"...");
var level= encodeURI(document.getElementById('level').value);
full && full.bringFront($(this).parents('tr').data(level));
full && full.removeLayer($(this).parents('tr').data(level));
full && full.addNewLayer('<?php echo $siteaddress3 ?>processFont.php?route=theUrl&fontid='+themeid+'&myfont='+layerid+'&fontcatalogid=<?php echo $catalogidX ?>&themeid='+themeid+'&font_Username='+font_Text+'&font_Name='+font_Text+'&font_Url='+font_Text+'&font_Text='+font_Text+'&text_w='+setWidth+'&text_h=0&text_x='+positionx+'&text_y='+positiony+'&text_align='+setHAlignment+'&text_size='+setFontSize+'&text_color='+text_color+'&url_color='+text_color+'&name_color='+text_color+'&username_color='+text_color+'&url_size='+setFontSize+'&name_size='+setFontSize+'&username_size='+setFontSize+'&text_pad='+setPadding+'&text_line_height='+setLineHeight+'&text='+update, {
rotation: 0,
positionX:positionx,
positionY: positiony,
category: "0",
opacity:opacity
})
loading_hide(); $("#check").html("Successfully updated");return;
}
function plainRefresh()
{
loading_show();
var updatePlain = $("#updatePlain").val();
var themeid = $("#realthemeID").val();
var update = $("#plain").val();
var setFontSize = $("#setFontSizeP").val();
var layerid = $("#level").val();
var removelayerid = $("#level").val();
var removelayerid = removelayerid-1;
var setLineHeight = $("#setLineHeightP").val();
var setHAlignment = $("#setHAlignmentP").val();
var opacity = $("#opacityP").val();
var setPadding = $("#setPaddingP").val();
var setWidth = $("#setWidthP").val();
var text_color = $("#plain_color").val();
var text_color = text_color.replace("#", "");
var positionx = $("#position-xP").val();
var positiony = $("#position-yP").val();
var font_Text = $("#myFontPlain").val();
$("#check").html("Updating Plain Layer "+layerid+"...");
var level= encodeURI(document.getElementById('level').value);
full && full.bringFront($(this).parents('tr').data(level));
full && full.removeLayer($(this).parents('tr').data(level));
full && full.addNewLayer('<?php echo $siteaddress3 ?>processFont.php?route=thePlain&fontid='+themeid+'&myfont='+layerid+'&fontcatalogid=<?php echo $catalogidX ?>&themeid='+themeid+'&font_Username='+font_Text+'&font_Name='+font_Text+'&font_Url='+font_Text+'&font_Text='+font_Text+'&text_w='+setWidth+'&text_h=0&text_x='+positionx+'&text_y='+positiony+'&text_align='+setHAlignment+'&text_size='+setFontSize+'&text_color='+text_color+'&url_color='+text_color+'&name_color='+text_color+'&username_color='+text_color+'&url_size='+setFontSize+'&name_size='+setFontSize+'&username_size='+setFontSize+'&text_pad='+setPadding+'&text_line_height='+setLineHeight+'&text='+update, {
rotation: 0,
positionX:positionx,
positionY: positiony,
category: "0",
opacity:opacity
})
loading_hide(); $("#check").html("Successfully updated");return;
}
function nameRefresh()
{
loading_show();
var updateUrl = $("#updateName").val();
var themeid = $("#realthemeID").val();
var update = $("#name").val();
var setFontSize = $("#setFontSizeN").val();
var layerid = $("#level").val();
var removelayerid = $("#level").val();
var removelayerid = removelayerid-1;
var setLineHeight = $("#setLineHeightN").val();
var setHAlignment = $("#setHAlignmentN").val();
var opacity = $("#opacityN").val();
var setPadding = $("#setPaddingN").val();
var setWidth = $("#setWidthN").val();
var text_color = $("#name_color").val();
var text_color = text_color.replace("#", "");
var positionx = $("#position-xN").val();
var positiony = $("#position-yN").val();
var font_Text = $("#myFontName").val();
$("#check").html("Updating Name Layer "+layerid+"...");
var level= encodeURI(document.getElementById('level').value);
full && full.bringFront($(this).parents('tr').data(level));
full && full.removeLayer($(this).parents('tr').data(level));
full && full.addNewLayer('<?php echo $siteaddress3 ?>processFont.php?route=theName&fontid='+themeid+'&myfont='+layerid+'&fontcatalogid=<?php echo $catalogidX ?>&themeid='+themeid+'&font_Username='+font_Text+'&font_Name='+font_Text+'&font_Url='+font_Text+'&font_Text='+font_Text+'&text_w='+setWidth+'&text_h=0&text_x='+positionx+'&text_y='+positiony+'&text_align='+setHAlignment+'&text_size='+setFontSize+'&text_color='+text_color+'&url_color='+text_color+'&name_color='+text_color+'&username_color='+text_color+'&url_size='+setFontSize+'&name_size='+setFontSize+'&username_size='+setFontSize+'&text_pad='+setPadding+'&text_line_height='+setLineHeight+'&text='+update, {
rotation: 0,
positionX:positionx,
positionY: positiony,
category: "0",
opacity:opacity
})
loading_hide(); $("#check").html("Successfully updated");return;
}
$(".selectme").click(function() {
refreshIt();});
$(".alignme").click(function() {
refreshIt();});
$('#addPlain').val("<?php echo $siteaddress ?>processFont.php?route=thePlain&fontid=1201&myfont=8&fontcatalogid=254722407698&themeid=1201&font_Username=BebasNeue.otf%20%20&font_Name=BebasNeue.otf%20%20&font_Url=BebasNeue.otf%20%20&font_Text=BebasNeue.otf%20%20&text_w=200&text_h=0&text_x=undefined&text_y=undefined&text_align=left&text_size=23&text_color=ffffff&url_color=ffffff&name_color=ffffff&username_color=ffffff&url_size=23&name_size=23&username_size=23&text_pad=0&text_line_height=0&text=My+Text");
</script>