Revision ad01d4d2
Added by Walden Raines over 10 years ago
app/assets/javascripts/config_template.js | ||
---|---|---|
function upload_file(evt){
|
||
if(window.File && window.FileList && window.FileReader)
|
||
{
|
||
if (!confirm(_("You are about to override the editor content, are you sure?"))) {
|
||
if (!confirm(__("You are about to override the editor content, are you sure?"))) {
|
||
$('.template_file').val('');
|
||
return;
|
||
}
|
||
... | ... | |
var patch = JsDiff.createPatch(item.attr('data-file-name'), $('#old').text(), $('#new').text());
|
||
patch = patch.replace(/^(.*\n){0,4}/,'');
|
||
if (patch.length == 0)
|
||
patch = _("No changes")
|
||
patch = __("No changes")
|
||
|
||
$(session).off('change');
|
||
session.setValue(patch);
|
||
... | ... | |
}
|
||
|
||
function revert_template(item){
|
||
if (!confirm(_("You are about to override the editor content with a previous version, are you sure?"))) return;
|
||
if (!confirm(__("You are about to override the editor content with a previous version, are you sure?"))) return;
|
||
|
||
var version = $(item).attr('data-version');
|
||
var url = $(item).attr('data-url');
|
||
... | ... | |
set_edit_mode($('.template_text'));
|
||
}
|
||
var time = $(item).closest('div.row').find('h6 span').attr('data-original-title');
|
||
$('#config_template_audit_comment').text(Jed.sprintf(_("Revert to revision from: %s"), time))
|
||
$('#config_template_audit_comment').text(Jed.sprintf(__("Revert to revision from: %s"), time))
|
||
}
|
||
})
|
||
}
|
Also available in: Unified diff
fixes #3984 - use __ instead of _ for i18n to avoid conflict with underscore.js