7 lines
3.4 KiB
JavaScript
7 lines
3.4 KiB
JavaScript
define("tpl!taoRevision/controller/history/line",["handlebars"],function(hb){return hb.template(function(stack1,depth0,helpers,partials,options){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,stack1.helpers),options=options||{};var helper,buffer="",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing;return buffer+='<tr>\n <td class="numeric">',buffer+=escapeExpression(stack1=(helper=helpers.id)||"function"==typeof(helper=depth0&&depth0.id)?helper.call(depth0,{hash:{},data:options}):helper)+'</td>\n <td class="date">',buffer+=escapeExpression(stack1=(helper=helpers.modified)||"function"==typeof(
|
|
helper=depth0&&depth0.modified)?helper.call(depth0,{hash:{},data:options}):helper)+'</td>\n <td class="user">',!(stack1=(helper=helpers.author)||"function"==typeof(helper=depth0&&depth0.author)?helper.call(depth0,{hash:{},data:options}):helper)&&0!==stack1||(buffer+=stack1),buffer+='</td>\n <td class="message">',buffer+=escapeExpression(stack1=(helper=helpers.message)||"function"==typeof(helper=depth0&&depth0.message)?helper.call(depth0,{hash:{},data:options}):helper)+'</td>\n <td class="actions">\n <button class="btn-info small restore_revision" data-revision="',buffer+=escapeExpression(stack1=(helper=helpers.id)||"function"==typeof(
|
|
helper=depth0&&depth0.id)?helper.call(depth0,{hash:{},data:options}):helper)+'">\n <span class="icon-undo"></span>\n '+escapeExpression((options={hash:{},data:options},(helper=helpers.__||depth0&&depth0.__)?helper.call(depth0,"Restore",options):helperMissing.call(depth0,"__","Restore",options)))+"\n </button>\n </td>\n</tr>"})}),define("taoRevision/controller/history/index",["jquery","i18n","tpl!taoRevision/controller/history/line","helpers","ui/feedback","select2","ui/tooltip"],function($,__,lineTpl,helpers,feedback){"use strict";return{start:function(){var $table=$(".revision-container"),$form=$("form",$table),$submiter=$(
|
|
":submit",$form),$table=$("#revisions-table"),body=$table.find("tbody")[0];$form.on("submit",function(e){e.preventDefault(),e.stopImmediatePropagation()}),$submiter.on("click",function(e){e.preventDefault();var $message=$("#message",$form);""!==$message.val()?($submiter.addClass("disabled"),$.post($form.attr("action"),$form.serialize()).done(function(res){res&&res.success?(feedback().success(res.commitMessage),$(body).append(lineTpl(res))):feedback().error(__("Something went wrong..."))}).complete(function(){$submiter.removeClass("disabled"),$message.val("")})):feedback().error(__("Please give a message to your commit"))}),$table.on("click",
|
|
".restore_revision",function(id){var message,body,revision;id.preventDefault(),message=this,body=$("#revisions-table").find("tbody")[0],revision=$(message).data("revision"),id=$("#resource_id").val(),message=prompt("Please enter a message",__("Restored version %s",revision)),void 0!==revision&&void 0!==message&&null!=message&&""!==revision&&""!==message&&$.post(helpers._url("restoreRevision","History","taoRevision"),{id:id,revisionId:revision,message:message}).done(function(res){res&&res.success?(feedback().success(__("Resource restored")),$(body).append(lineTpl(res)),$(".tree").trigger("refresh.taotree")):feedback().error(__("Something went wrong..."))})})}
|
|
}}),define("taoRevision/controller/routes",[],function(){return{History:{actions:{index:"controller/history/index"}}}}),define("taoRevision/loader/taoRevision.bundle",function(){});
|
|
//# sourceMappingURL=taoRevision.min.js.map
|