Files
web-doc-editor/js/ui/cmp/ManagePatchPrompt.js
Peter Kokot f06fee3640 Sync final newlines
This patch adds some missing newlines and trims multiple final newlines
into a single newline.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-02 03:44:40 +02:00

112 lines
4.1 KiB
JavaScript

Ext.namespace('ui','ui.cmp');
//config - { name, email }
ui.cmp.ManagePatchPrompt = Ext.extend(Ext.Window,
{
title : '',
width : 450,
height : 260,
minWidth : 450,
minHeight : 300,
layout : 'fit',
plain : true,
bodyStyle : 'padding:5px;',
buttonAlign : 'center',
iconCls : 'iconPatch',
closeAction : 'hide',
nodesToAdd : false,
patchName : '',
patchDescription : '',
patchEmail : '',
patchID : false,
initComponent : function()
{
Ext.apply(this, {
buttons : [{
text : (this.patchID) ? _('Save') : _('Create'),
handler: function()
{
var win = this.ownerCt.ownerCt,
values = win.findByType('form').shift().getForm().getValues();
XHR({
params : {
task : 'managePatch',
name : values.name,
description : values.description,
email : values.email,
patchID : win.patchID
},
success : function(r)
{
var o = Ext.util.JSON.decode(r.responseText);
win.hide();
// If we want to modify the path name
if( win.patchID ) {
ui.cmp.PatchesTreeGrid.getInstance().modPatchName({
newPatchName : values.name,
newPatchDescription : values.description,
newPatchEmail : values.email,
patchID : win.patchID
});
}
// If there is some node to Add, we call this.
if (win.nodesToAdd) {
ui.task.MoveToPatch({
patchID: o.patchID,
patchName: values.name,
patchDescription: values.description,
patchEmail: values.email,
nodesToAdd: win.nodesToAdd
});
}
// We reload the patchList store
PhDOE.user.patchList.reload();
}
});
}
}, {
text : _('Cancel'),
handler : function()
{
this.ownerCt.ownerCt.hide();
}
}],
items : [{
xtype : 'form',
baseCls : 'x-plain',
labelWidth : 110,
defaultType : 'textfield',
labelAlign : 'top',
items : [{
name : 'name',
fieldLabel : _('Patch name'),
anchor : '100%',
value : this.patchName
},{
name : 'description',
xtype : 'textarea',
fieldLabel : _('Patch description'),
tooltipText : _('This description will be the default during the validation of the patch by a valid user.'),
anchor : '100%',
value : this.patchDescription
},{
name : 'email',
fieldLabel : _('Email'),
tooltipText : _('If provided, an email will be send to you to inform that the patch is commited.'),
anchor : '100%',
value : this.patchEmail
}]
}]
});
ui.cmp.ManagePatchPrompt.superclass.initComponent.call(this);
}
});