Verträge
Registrierung für den Online-Service
Wenn Sie bereits Kunde bei uns sind, können Sie sich hier für den Online-Service anmelden.
Text:
');
myTmpTextValue = myTmpTextValue.replace(/"/g, '"');
$(mySpanClass).html(myTmpTextValue);
if(myTmpTextValue != textDefaultValue) {
$(mySpanClass).addClass('custom');
}
textKey = textKey.replace(/\./g, '\\.');
$('.'+textKey+'_textToEdit').attr('name', myTmpTextValue);
if(paramText != "")
{
if($('.'+textKey +'_updateText').next().next().hasClass("cms_paramText"))
{
myTmpTextValue = replaceParams($('.'+textKey +'_updateText').next().next(), myTmpTextValue);
$('.'+textKey +'_updateText').next().next().attr("data-value",response);
}
else if($('.'+textKey +'_updateText').next().next().next().hasClass("cms_paramText"))
{
myTmpTextValue = replaceParams($('.'+textKey +'_updateText').next().next().next(), myTmpTextValue);
$('.'+textKey +'_updateText').next().next().next().attr("data-value",response);
}
$(mySpanClass).html(myTmpTextValue);
}
});
textKey = replaceAll(textKey, ".", "#");
textKey = replaceAll(textKey,"#","\\.");
$('.'+textKey+'_textToEdit').first().attr('name', myTextValue);
$('.'+textKey+'_updateText').html(myTextValue);
$('#dialog-edit-text').modal('hide');
});
function replaceParams(elem, paramsString) {
for(var i = 0; i<10;i++)
{
if($(elem).attr("data-param-"+i) != undefined && $(elem).attr("data-param-"+i) != "")
{
var param = "{"+i+"}";
paramsString = paramsString.replace(param, $(elem).attr("data-param-"+i));
}else{
break;
}
}
return paramsString;
}
if(isDefaultTextValue === 'false') {
if(hasDefaultText === 'true') {
$('#showDefaultTextValue').show();
$('#defaultTextValue').text(textDefaultValue);
}
else {
$('#showDefaultTextValue').hide();
$('#defaultTextValue').text('');
}
}
else {
$('#showDefaultTextValue').hide();
$('#defaultTextValue').text('');
}
$('#dialog-edit-text').modal('show');
}
function sendCMSAjaxRequest(cmsFunction, textKey, textValue, data, callback) {
jQuery.post(
$('#ajaxurl').val(), {
'updateText': cmsFunction,
'processID': 13,
'textKey': textKey,
'textValue': textValue,
data: JSON.stringify(data)
}, callback
);
}
function replaceAll(str, find, replace)
{
str = str.replace(find, replace);
if(str.indexOf(find) > 0)
{
str = replaceAll(str, find, replace);
}
return str;
}
$(document).ready(function() {
$('a').find('span.updateText').each(function(){
$(this).insertAfter($(this).parent());
});
$('span.updateText').each(function(){
if(!$(this).prev().is(":visible"))
{
$(this).hide();
}
});
$('.cms_editText_button').on('click', function(e){
$('.cms_editText_infoBlock').toggle();
});
$('body span.updateText').on('click', function(e){
var insertID = $(this).attr('name');
if(insertID.indexOf('_updateText')!=-1) {
var suffix = '_updateText';
var editSuffix = '_textToEdit';
var mySpanClass = 'span.'+insertID.replace(/\./g, '\\.');
var myEditSpanClass = mySpanClass.replace(suffix, editSuffix);
var textKey = insertID.replace(suffix, '');
var textValue = $(myEditSpanClass).first().attr('name');
var hasDefaultText = 'true';
var isDefaultTextValue = 'true';
var textDefaultValue = $(mySpanClass).attr('name');
var paramText = "";
if($(this).next().hasClass("cms_paramText"))
{
paramText = $(this).next().attr("data-value");
}
else if($(this).next().next().hasClass("cms_paramText"))
{
paramText = $(this).next().next().attr("data-value");
}
if($(mySpanClass).hasClass('default')) {
hasDefaultText = 'true';
if($(mySpanClass).hasClass('custom')) {
isDefaultTextValue = 'false';
}
else {
textValue = textDefaultValue;
}
}
if($(mySpanClass).hasClass('new')) {
hasDefaultText = 'false';
}
textValue = textValue.replace(/\"/g, '"');
showEditTextDialog(textKey, textValue, textDefaultValue, isDefaultTextValue, hasDefaultText, paramText);
}
});
});