kopia lustrzana https://github.com/c9/core
Merge pull request +9295 from c9/filechange-dialog-option
[Trivial] Allow changing of body text in filechange dialogpull/152/head
commit
5e6f31eef8
|
@ -28,19 +28,27 @@ define(function(require, module, exports) {
|
||||||
|
|
||||||
/***** Methods *****/
|
/***** Methods *****/
|
||||||
|
|
||||||
function show(title, header, onlocal, onremote, onmerge, options) {
|
function show(title, header, body, onlocal, onremote, onmerge, options) {
|
||||||
|
options = options || {};
|
||||||
return plugin.queue(function(){
|
return plugin.queue(function(){
|
||||||
plugin.title = title;
|
plugin.title = title;
|
||||||
plugin.heading = util.escapeXml(header);
|
plugin.heading = util.escapeXml(header);
|
||||||
|
if (body) plugin.body = util.escapeXml(body);
|
||||||
|
|
||||||
var cb = plugin.getElement("applyall");
|
var cb = plugin.getElement("applyall");
|
||||||
cb.uncheck();
|
cb.uncheck();
|
||||||
cb.setAttribute("visible", options.all !== false);
|
cb.setAttribute("visible", options.all !== false);
|
||||||
|
|
||||||
|
if (options.merge) {
|
||||||
|
var mergeBoth = plugin.getElement("mergeboth");
|
||||||
|
if (options.merge.caption) mergeBoth.setAttribute("caption", options.merge.caption);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
plugin.update([
|
plugin.update([
|
||||||
{ id: "keepmine", onclick: function(){ plugin.hide(); onlocal(cb.value); } },
|
{ id: "keepmine", onclick: function(){ plugin.hide(); onlocal(cb.value); } },
|
||||||
{ id: "useremote", onclick: function(){ plugin.hide(); onremote(cb.value); } },
|
{ id: "useremote", onclick: function(){ plugin.hide(); onremote(cb.value); } },
|
||||||
{ id: "mergeboth", visible: options.merge, onclick: function(){ plugin.hide(); onmerge(cb.value); } }
|
{ id: "mergeboth", visible: !!options.merge, onclick: function(){ plugin.hide(); onmerge(cb.value); } }
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -394,6 +394,7 @@ define(function(require, exports, module) {
|
||||||
changeDialog = filechange.show(
|
changeDialog = filechange.show(
|
||||||
"File Changed",
|
"File Changed",
|
||||||
path + " has been changed on disk.",
|
path + " has been changed on disk.",
|
||||||
|
null,
|
||||||
no,
|
no,
|
||||||
yes,
|
yes,
|
||||||
function(all) { // Merge
|
function(all) { // Merge
|
||||||
|
|
Ładowanie…
Reference in New Issue