* Connect various buttons\r
*/\r
\r
- $('#toolbar-button-save').click( function (event, data) {\r
+ $('#toolbar-button-quick-save').click( function (event, data) {\r
self.saveToBranch();\r
} );\r
\r
+ $('#toolbar-button-save').click( function (event, data) {\r
+ $('#commit-dialog').jqmShow( {callback: $.fbind(self, self.saveToBranch)} );\r
+ } );\r
+\r
$('#toolbar-button-update').click( function (event, data) {\r
if (self.updateUserBranch()) {\r
// commit/update can be called only after proper, save\r
$('#commit-dialog').\r
jqm({\r
modal: true,\r
- trigger: '#toolbar-button-commit'\r
+ onShow: $.fbind(self, self.loadRelatedIssues) \r
});\r
\r
+ $('#toolbar-button-commit').click( function (event, data) {\r
+ $('#commit-dialog').jqmShow( {callback: $.fbind(self, self.sendMergeRequest)} );\r
+ } );\r
+ \r
+ /* STATIC BINDS */\r
$('#commit-dialog-cancel-button').click(function() {\r
$('#commit-dialog-error-empty-message').hide();\r
$('#commit-dialog').jqmHide();\r
- });\r
+ }); \r
+ \r
+\r
+ /* SPLIT DIALOG */\r
+ $('#split-dialog').jqm({\r
+ modal: true,\r
+ onShow: $.fbind(self, self.loadSplitDialog)\r
+ }).\r
+ jqmAddClose('button.dialog-close-button');\r
+\r
+// $('#split-dialog'). \r
+}\r
+\r
+Editor.prototype.loadRelatedIssues = function(hash)\r
+{\r
+ var self = this;\r
+ var c = $('#commit-dialog-related-issues');\r
\r
- $('#commit-dialog-save-button').click( function (event, data) \r
+ $('#commit-dialog-save-button').click( function (event, data)\r
{\r
if( $('#commit-dialog-message').val().match(/^\s*$/)) {\r
$('#commit-dialog-error-empty-message').fadeIn();\r
else {\r
$('#commit-dialog-error-empty-message').hide();\r
$('#commit-dialog').jqmHide();\r
- self.sendMergeRequest($('#commit-dialog-message').val() );\r
- } \r
- \r
- return false;\r
- }); \r
\r
- /* SPLIT DIALOG */\r
- $('#split-dialog').jqm({\r
- modal: true,\r
- onShow: $.fbind(self, self.loadSplitDialog)\r
- }).\r
- jqmAddClose('button.dialog-close-button');\r
+ var message = $('#commit-dialog-message').val();\r
+ $('#commit-dialog-related-issues input:checked').\r
+ each(function() { message += ' refs #' + $(this).val(); });\r
+ $.log("COMMIT APROVED", hash.t);\r
+ hash.t.callback(message);\r
+ }\r
\r
-// $('#split-dialog'). \r
+ return false;\r
+ });\r
+\r
+ $("div.loading-box", c).show();\r
+ $("div.fatal-error-box", c).hide();\r
+ $("div.container-box", c).hide();\r
+ \r
+ $.getJSON( c.attr('ui:ajax-src') + '?callback=?',\r
+ function(data, status)\r
+ {\r
+ var fmt = '';\r
+ $(data).each( function() {\r
+ fmt += '<label><input type="checkbox" checked="checked"'\r
+ fmt += ' value="' + this.id + '" />' + this.subject +'</label>\n'\r
+ });\r
+ $("div.container-box", c).html(fmt);\r
+ $("div.loading-box", c).hide();\r
+ $("div.container-box", c).show(); \r
+ }); \r
+ \r
+ hash.w.show();\r
}\r
\r
Editor.prototype.loadSplitDialog = function(hash)\r
panel.refresh();\r
});\r
\r
- $('#toolbar-button-save').attr('disabled', 'disabled');\r
- $('#toolbar-button-commit').removeAttr('disabled');\r
- $('#toolbar-button-update').removeAttr('disabled');\r
+ $('button.provides-save').attr('disabled', 'disabled');\r
+ $('button.requires-save').removeAttr('disabled');\r
};\r
\r
/*\r