doortts doortts 2016-03-13
markdown: Change markdown preview with application/json type
@dd969afbf0124892e58cdde6aa9da343d43a1ad1
app/controllers/MarkdownApp.java
--- app/controllers/MarkdownApp.java
+++ app/controllers/MarkdownApp.java
@@ -20,21 +20,20 @@
  */
 package controllers;
 
-import play.data.DynamicForm;
+import com.fasterxml.jackson.databind.JsonNode;
 import models.Project;
 import play.mvc.Controller;
 import play.mvc.Result;
 import utils.Markdown;
 
-import static play.data.Form.form;
-
 public class MarkdownApp extends Controller {
     public static Result render(String ownerName, String projectName) {
-        DynamicForm dynamicForm = form().bindFromRequest();
-        String source = dynamicForm.get("body");
+        JsonNode requestJson = request().body().asJson();
+        String body = requestJson.findPath("body").textValue();
+        boolean breaks = requestJson.findPath("breaks").asBoolean();
         Project project = Project.findByOwnerAndProjectName(ownerName, projectName);
-        boolean breaks = Boolean.valueOf(dynamicForm.get("breaks"));
 
-        return ok(Markdown.render(source, project, breaks));
+        return ok(Markdown.render(body, project, breaks));
     }
+
 }
public/javascripts/common/yobi.Markdown.js
--- public/javascripts/common/yobi.Markdown.js
+++ public/javascripts/common/yobi.Markdown.js
@@ -88,9 +88,15 @@
     }
 
     function _render(welTarget, sContentBody) {
+        var source = {
+            "body": sContentBody,
+            "breaks": (welTarget.hasClass('readme-body') ? false : true)
+        };
+
         $.ajax(htVar.sMarkdownRendererUrl,{
             "type": "post",
-            "data": {"body": sContentBody, "breaks": (welTarget.hasClass('readme-body') ? false : true)},
+            "contentType":"application/json; charset=utf-8",
+            "data": JSON.stringify(source),
             "success": function(data){
                 welTarget.html(data);
             }
public/javascripts/yona-lib.js
--- public/javascripts/yona-lib.js
+++ public/javascripts/yona-lib.js
@@ -1,43 +1,43 @@
-yobi.Attachments=function(h){function q(g){r({vFile:g.oFile.files?g.oFile.files[0]:g.oFile,bTemporary:!0})}function r(g){if("undefined"===typeof g.vFile)return 0;var p,a=0,b=[];(g.vFile instanceof Array?g.vFile:[g.vFile]).forEach(function(d){var e=g.bTemporary,f=$.tmpl(m.sTplFileItem,{fileId:d.id,fileName:d.name,fileHref:d.url,fileSize:d.size,fileSizeReadable:humanize.filesize(d.size),mimeType:d.mimeType});t(f,d.mimeType);e&&f.addClass("temporary");p=f;"undefined"!==typeof d.id&&""!==d.id?(p.addClass("complete"),
-0<n.welTextarea.length&&p.click(c)):(p.attr("id",d.nSubmitId),p.css("opacity","0.2"),p.data("progressBar",p.find(".progress > .bar")));b.push(p);a+=parseInt(d.size,10)});0<b.length&&(0===n.welFileList.length&&(n.welFileList=$(m.sTplFileList),n.welContainer.append(n.welFileList)),n.welFileList.show(),n.welFileListHelp.show(),n.welFileList.append(b));return a}function u(g,p){var a;p=p||"#f36c22";a=g.css("background");g.css("background",p);setTimeout(function(){g.css("background",a)},500)}function k(g){var p=
-g.oRes,a=g.nSubmitId,b=g.oRes.id;-1===m.aTemporaryFileIds.indexOf(b)&&(m.aTemporaryFileIds.push(b),n.welTemporaryUploadFileList.val(m.aTemporaryFileIds.join(",")));if(!(p instanceof Object&&p.name&&p.url))return e(a,p);var b=$("#"+a),d=n.welFileList.find('[data-id="'+p.id+'"]');0<d.length?(b.remove(),u(d),p=!1):(b.attr({"data-id":p.id,"data-href":p.url,"data-name":p.name,"data-mime":p.mimeType}),b.find(".name").html(p.name),b.find(".size").html(humanize.filesize(p.size)),b.click(c),p=void 0);!1!==
-p&&f(a,100);a=$(["#"+g.nSubmitId,'.attached-file[data-id="'+g.oRes.id+'"]'].join(", "));p=x(g.nSubmitId);b=A(a);d=n.welTextarea;if(0!==d.length){var k=d.prop("selectionStart"),l=b.length-p.length-1;d.val(d.val().split(p).join(b));0<l&&z(d,k+l)}t(a,g.oRes.mimeType)}function l(g){f(g.nSubmitId,g.nPercentComplete)}function f(g,a){var b=$("#"+g);b.data("progressBar").css("width",a+"%");100===1*a&&(b.css("opacity","1"),setTimeout(function(){b.addClass("complete")},1E3))}function e(g){$("#"+g.nSubmitId).remove();
-0===n.welFileList.children().length&&(n.welFileList.hide(),n.welFileListHelp.hide());$yobi.notify(Messages("common.attach.error.upload",g.oRes.status,g.oRes.statusText));B(x(g.nSubmitId+".png"))}function c(g){var p=$(g.target);g=$(g.currentTarget);p.hasClass("btn-delete")?b(g):a(g)}function b(g){var a=g.attr("data-href");yobi.Files.deleteFile({sURL:a,fOnLoad:function(){var a=g.data("id"),a=m.aTemporaryFileIds.indexOf(a.toString());-1!==a&&(m.aTemporaryFileIds.splice(a,1),n.welTemporaryUploadFileList.val(m.aTemporaryFileIds.join(",")));
-B(g);g.remove();0===n.welFileList.children().length&&(n.welFileList.hide(),n.welFileListHelp.hide())},fOnError:function(g){$yobi.notify(Messages("common.attach.error.delete",g.status,g.statusText))}})}function a(g){var a=n.welTextarea;if(0===a.length)return!1;var b=a.prop("selectionStart"),c=a.val();g="string"===typeof g?g:A(g);a.val(c.substring(0,b)+g+c.substring(b));z(a,b+g.length)}function d(g){return 0<=["video/mp4","video/ogg","video/webm"].indexOf($.trim(g).toLowerCase())}function t(g,a){d(a)&&
-g.children("i.mimetype").addClass("yobicon-video2").show()}function A(g){var a=g.attr("data-mime"),b=g.attr("data-name");g=g.attr("data-href");b="["+b+"]("+g+")\n";return"image"===a.substr(0,5)?"!"+b:d(a)?$("<div>").append($("<video>").attr("controls",!0).append($("<source>").attr("src",g)).append(b)).html():b}function x(g){return"\x3c!--_"+g+"_--\x3e"}function B(g){var a=n.welTextarea;if(0===a.length)return!1;g="string"===typeof g?g:A(g);var b=a.val().split(g).join(""),b=b.split(g.trim()).join("");
-a.val(b)}function z(g,a){var b=g.get(0);b.setSelectionRange?b.setSelectionRange(a,a):b.createTextRange&&(b=b.createTextRange(),b.collapse(!0),b.moveEnd("character",a),b.moveStart("character",a),b.select())}function y(g){a(x(g.nSubmitId))}function v(g){var b=g.oFiles,n=b.length;if("textarea"===g.weEvt.target.tagName.toLowerCase())for(g=0;g<n;g++)a(x(b[g].nSubmitId))}function w(a){r({vFile:a.attachments,bTemporary:!1});"undefined"===typeof m.sResourceId&&r({vFile:a.tempFiles,bTemporary:!0})}var m={},
-n={};(function(a){var b=a=a||{},c='<a href="${fileHref}?action=download" class="download ybtn ybtn-mini" title="'+Messages("button.download")+' ${fileName}"><i class="yobicon-download"></i></a>';m.sTplFileList=b.sTplFileList||'<ul class="attaches wm">';m.sTplFileItem=b.sTplFileItem||'<li class="attach"><a href="${fileHref}" class="vmiddle" target="_blank"><i class="yobicon-paperclip"></i><span class="filename">${fileName}</span><span class="filesize">(${fileSizeReadable})</span></a>'+c+"</li>";m.sResourceId=
-b.sResourceId;m.sResourceType=b.sResourceType;b=a;n.welToAttach=b.targetFormId||$(b.elContainer);n.welTemporaryUploadFileList=$('<input type="hidden" name="'+(b.sTagNameForTemporaryUploadFiles||"temporaryUploadFiles")+'">');n.welToAttach.prepend(n.welTemporaryUploadFileList);m.aTemporaryFileIds=[];n.welContainer=$(b.elContainer);n.welContainer.data("isYobiAttachment",!0);m.sResourceId=m.sResourceId||n.welContainer.data("resourceId");m.sResourceType=m.sResourceType||n.welContainer.data("resourceType");
-m.attachments||(m.attachments=n.welContainer.data("attachments"));n.welTextarea=$(b.elTextarea);n.welFileList=n.welContainer.find("ul.attached-files");n.welFileListHelp=n.welContainer.find("p.help");b=yobi.Files.getEnv();n.welHelpDroppable=n.welContainer.find(".help-droppable");n.welHelpPastable=n.welContainer.find(".help-pastable");n.welHelpDroppable[b.bDroppable?"show":"hide"]();n.welHelpPastable[b.bPastable?"show":"hide"]();m.attachments?w(m.attachments):(m.sResourceType&&m.sResourceId||m.attachments)&&
-yobi.Files.getList({fOnLoad:w,sResourceType:m.sResourceType,sResourceId:m.sResourceId});a.sUploaderId&&yobi.Files.attach({beforeUpload:q,uploadProgress:l,successUpload:k,errorUpload:e,pasteFile:y,dropFile:v},a.sUploaderId)})(h||{});return{destroy:function(){h.sUploaderId&&yobi.Files.detach({beforeUpload:q,uploadProgress:l,successUpload:k,errorUpload:e,pasteFile:y,dropFile:v},h.sUploaderId);for(var a in n)n[a]=null;n=null}}};yobi.Files=function(){function h(a,b){if(a&&a.length)for(var c=0;c<a.length;c++)q(a[c],z(),b);else q(a,z(),b)}function q(a,b,c){a&&(a.nSubmitId=b||z());return!1===y("beforeUpload",{oFile:a,nSubmitId:a?a.nSubmitId:b},c)?!1:v.bXHR2?r(b,a,c):u(b,a,c)}function r(a,b,c){if(b.size&&b.size>v.nMaxFileSize)return f(a,{status:0,statusText:Messages("error.toolargefile",humanize.filesize(v.nMaxFileSize))},c);var d=new FormData;d.append("filePath",b,b.name);$.ajax({type:"post",url:v.sUploadURL,data:d,cache:!1,
-processData:!1,contentType:!1,success:function(b){l(a,b,c)},error:function(b){f(a,b,c)},xhr:function(){var b=$.ajaxSettings.xhr();b.upload&&b.upload.addEventListener("progress",function(b){b.lengthComputable&&k(a,Math.ceil(b.loaded/b.total*100),c)},!1);return b}})}function u(a,b,c){var d=w[c];if(!d.welInputFile&&!b)return!1;var e=d.welInputFile||$(b);b=e.clone();var t=$('<form method="post" enctype="multipart/form-data" style="display:none">');b.insertAfter(e);b.on("change",$.proxy(A,this,c));d.welInputFile=
-b;t.attr("action",v.sUploadURL);t.append(e).appendTo(document.body);var m=function(){e.remove();t.remove();t=e=null},d=v.htUploadOpts;d.success=function(b){l(a,b,c);m();m=null};d.uploadProgress=function(b,g,d,e){k(a,e,c);m();m=null};d.error=function(b){f(a,b,c);m();m=null};t.ajaxForm(d);t.submit()}function k(b,a,c){y("uploadProgress",{nSubmitId:b,nPercentComplete:a},c)}function l(b,a,c){if(!(a instanceof Object&&a.name&&a.url))return f(b,a);c&&w[c]&&w[c].welInputFile&&w[c].welInputFile.val("");y("successUpload",
-{nSubmitId:b,oRes:a},c)}function f(a,b,c){y("errorUpload",{nSubmitId:a,oRes:b},c)}function e(b){var c=w[b];c.welInputFile.on("change",$.proxy(A,this,b));if(v.bDroppable){c.welContainer.on({dragover:$.proxy(a,this,b),drop:$.proxy(x,this,b)});var e=$("#tplDropFilesHere").text().trim()||'<div class="upload-drop-here"><div class="msg-wrap"><div class="msg">'+Messages("common.attach.dropFilesHere")+"</div></div></div>";c.welDropper=$(e);c.welTextarea.before(c.welDropper);c.welTextarea.on({dragover:$.proxy(a,
+yobi.Attachments=function(h){function q(g){r({vFile:g.oFile.files?g.oFile.files[0]:g.oFile,bTemporary:!0})}function r(g){if("undefined"===typeof g.vFile)return 0;var p,a=0,b=[];(g.vFile instanceof Array?g.vFile:[g.vFile]).forEach(function(d){var e=g.bTemporary,f=$.tmpl(n.sTplFileItem,{fileId:d.id,fileName:d.name,fileHref:d.url,fileSize:d.size,fileSizeReadable:humanize.filesize(d.size),mimeType:d.mimeType});t(f,d.mimeType);e&&f.addClass("temporary");p=f;"undefined"!==typeof d.id&&""!==d.id?(p.addClass("complete"),
+0<l.welTextarea.length&&p.click(c)):(p.attr("id",d.nSubmitId),p.css("opacity","0.2"),p.data("progressBar",p.find(".progress > .bar")));b.push(p);a+=parseInt(d.size,10)});0<b.length&&(0===l.welFileList.length&&(l.welFileList=$(n.sTplFileList),l.welContainer.append(l.welFileList)),l.welFileList.show(),l.welFileListHelp.show(),l.welFileList.append(b));return a}function u(g,p){var a;p=p||"#f36c22";a=g.css("background");g.css("background",p);setTimeout(function(){g.css("background",a)},500)}function k(g){var p=
+g.oRes,a=g.nSubmitId,b=g.oRes.id;-1===n.aTemporaryFileIds.indexOf(b)&&(n.aTemporaryFileIds.push(b),l.welTemporaryUploadFileList.val(n.aTemporaryFileIds.join(",")));if(!(p instanceof Object&&p.name&&p.url))return e(a,p);var b=$("#"+a),d=l.welFileList.find('[data-id="'+p.id+'"]');0<d.length?(b.remove(),u(d),p=!1):(b.attr({"data-id":p.id,"data-href":p.url,"data-name":p.name,"data-mime":p.mimeType}),b.find(".name").html(p.name),b.find(".size").html(humanize.filesize(p.size)),b.click(c),p=void 0);!1!==
+p&&f(a,100);a=$(["#"+g.nSubmitId,'.attached-file[data-id="'+g.oRes.id+'"]'].join(", "));p=x(g.nSubmitId);b=A(a);d=l.welTextarea;if(0!==d.length){var k=d.prop("selectionStart"),m=b.length-p.length-1;d.val(d.val().split(p).join(b));0<m&&z(d,k+m)}t(a,g.oRes.mimeType)}function m(g){f(g.nSubmitId,g.nPercentComplete)}function f(g,a){var b=$("#"+g);b.data("progressBar").css("width",a+"%");100===1*a&&(b.css("opacity","1"),setTimeout(function(){b.addClass("complete")},1E3))}function e(g){$("#"+g.nSubmitId).remove();
+0===l.welFileList.children().length&&(l.welFileList.hide(),l.welFileListHelp.hide());$yobi.notify(Messages("common.attach.error.upload",g.oRes.status,g.oRes.statusText));B(x(g.nSubmitId+".png"))}function c(g){var p=$(g.target);g=$(g.currentTarget);p.hasClass("btn-delete")?b(g):a(g)}function b(g){var a=g.attr("data-href");yobi.Files.deleteFile({sURL:a,fOnLoad:function(){var a=g.data("id"),a=n.aTemporaryFileIds.indexOf(a.toString());-1!==a&&(n.aTemporaryFileIds.splice(a,1),l.welTemporaryUploadFileList.val(n.aTemporaryFileIds.join(",")));
+B(g);g.remove();0===l.welFileList.children().length&&(l.welFileList.hide(),l.welFileListHelp.hide())},fOnError:function(g){$yobi.notify(Messages("common.attach.error.delete",g.status,g.statusText))}})}function a(g){var a=l.welTextarea;if(0===a.length)return!1;var b=a.prop("selectionStart"),c=a.val();g="string"===typeof g?g:A(g);a.val(c.substring(0,b)+g+c.substring(b));z(a,b+g.length)}function d(g){return 0<=["video/mp4","video/ogg","video/webm"].indexOf($.trim(g).toLowerCase())}function t(g,a){d(a)&&
+g.children("i.mimetype").addClass("yobicon-video2").show()}function A(g){var a=g.attr("data-mime"),b=g.attr("data-name");g=g.attr("data-href");b="["+b+"]("+g+")\n";return"image"===a.substr(0,5)?"!"+b:d(a)?$("<div>").append($("<video>").attr("controls",!0).append($("<source>").attr("src",g)).append(b)).html():b}function x(g){return"\x3c!--_"+g+"_--\x3e"}function B(g){var a=l.welTextarea;if(0===a.length)return!1;g="string"===typeof g?g:A(g);var b=a.val().split(g).join(""),b=b.split(g.trim()).join("");
+a.val(b)}function z(a,b){var l=a.get(0);l.setSelectionRange?l.setSelectionRange(b,b):l.createTextRange&&(l=l.createTextRange(),l.collapse(!0),l.moveEnd("character",b),l.moveStart("character",b),l.select())}function y(g){a(x(g.nSubmitId))}function v(g){var b=g.oFiles,l=b.length;if("textarea"===g.weEvt.target.tagName.toLowerCase())for(g=0;g<l;g++)a(x(b[g].nSubmitId))}function w(a){r({vFile:a.attachments,bTemporary:!1});"undefined"===typeof n.sResourceId&&r({vFile:a.tempFiles,bTemporary:!0})}var n={},
+l={};(function(a){var b=a=a||{},c='<a href="${fileHref}?action=download" class="download ybtn ybtn-mini" title="'+Messages("button.download")+' ${fileName}"><i class="yobicon-download"></i></a>';n.sTplFileList=b.sTplFileList||'<ul class="attaches wm">';n.sTplFileItem=b.sTplFileItem||'<li class="attach"><a href="${fileHref}" class="vmiddle" target="_blank"><i class="yobicon-paperclip"></i><span class="filename">${fileName}</span><span class="filesize">(${fileSizeReadable})</span></a>'+c+"</li>";n.sResourceId=
+b.sResourceId;n.sResourceType=b.sResourceType;b=a;l.welToAttach=b.targetFormId||$(b.elContainer);l.welTemporaryUploadFileList=$('<input type="hidden" name="'+(b.sTagNameForTemporaryUploadFiles||"temporaryUploadFiles")+'">');l.welToAttach.prepend(l.welTemporaryUploadFileList);n.aTemporaryFileIds=[];l.welContainer=$(b.elContainer);l.welContainer.data("isYobiAttachment",!0);n.sResourceId=n.sResourceId||l.welContainer.data("resourceId");n.sResourceType=n.sResourceType||l.welContainer.data("resourceType");
+n.attachments||(n.attachments=l.welContainer.data("attachments"));l.welTextarea=$(b.elTextarea);l.welFileList=l.welContainer.find("ul.attached-files");l.welFileListHelp=l.welContainer.find("p.help");b=yobi.Files.getEnv();l.welHelpDroppable=l.welContainer.find(".help-droppable");l.welHelpPastable=l.welContainer.find(".help-pastable");l.welHelpDroppable[b.bDroppable?"show":"hide"]();l.welHelpPastable[b.bPastable?"show":"hide"]();n.attachments?w(n.attachments):(n.sResourceType&&n.sResourceId||n.attachments)&&
+yobi.Files.getList({fOnLoad:w,sResourceType:n.sResourceType,sResourceId:n.sResourceId});a.sUploaderId&&yobi.Files.attach({beforeUpload:q,uploadProgress:m,successUpload:k,errorUpload:e,pasteFile:y,dropFile:v},a.sUploaderId)})(h||{});return{destroy:function(){h.sUploaderId&&yobi.Files.detach({beforeUpload:q,uploadProgress:m,successUpload:k,errorUpload:e,pasteFile:y,dropFile:v},h.sUploaderId);for(var a in l)l[a]=null;l=null}}};yobi.Files=function(){function h(a,b){if(a&&a.length)for(var c=0;c<a.length;c++)q(a[c],z(),b);else q(a,z(),b)}function q(a,b,c){a&&(a.nSubmitId=b||z());return!1===y("beforeUpload",{oFile:a,nSubmitId:a?a.nSubmitId:b},c)?!1:v.bXHR2?r(b,a,c):u(b,a,c)}function r(a,b,c){if(b.size&&b.size>v.nMaxFileSize)return f(a,{status:0,statusText:Messages("error.toolargefile",humanize.filesize(v.nMaxFileSize))},c);var d=new FormData;d.append("filePath",b,b.name);$.ajax({type:"post",url:v.sUploadURL,data:d,cache:!1,
+processData:!1,contentType:!1,success:function(b){m(a,b,c)},error:function(b){f(a,b,c)},xhr:function(){var b=$.ajaxSettings.xhr();b.upload&&b.upload.addEventListener("progress",function(b){b.lengthComputable&&k(a,Math.ceil(b.loaded/b.total*100),c)},!1);return b}})}function u(a,b,c){var d=w[c];if(!d.welInputFile&&!b)return!1;var e=d.welInputFile||$(b);b=e.clone();var t=$('<form method="post" enctype="multipart/form-data" style="display:none">');b.insertAfter(e);b.on("change",$.proxy(A,this,c));d.welInputFile=
+b;t.attr("action",v.sUploadURL);t.append(e).appendTo(document.body);var n=function(){e.remove();t.remove();t=e=null},d=v.htUploadOpts;d.success=function(b){m(a,b,c);n();n=null};d.uploadProgress=function(b,g,d,e){k(a,e,c);n();n=null};d.error=function(b){f(a,b,c);n();n=null};t.ajaxForm(d);t.submit()}function k(a,b,c){y("uploadProgress",{nSubmitId:a,nPercentComplete:b},c)}function m(a,b,c){if(!(b instanceof Object&&b.name&&b.url))return f(a,b);c&&w[c]&&w[c].welInputFile&&w[c].welInputFile.val("");y("successUpload",
+{nSubmitId:a,oRes:b},c)}function f(b,a,c){y("errorUpload",{nSubmitId:b,oRes:a},c)}function e(b){var c=w[b];c.welInputFile.on("change",$.proxy(A,this,b));if(v.bDroppable){c.welContainer.on({dragover:$.proxy(a,this,b),drop:$.proxy(x,this,b)});var e=$("#tplDropFilesHere").text().trim()||'<div class="upload-drop-here"><div class="msg-wrap"><div class="msg">'+Messages("common.attach.dropFilesHere")+"</div></div></div>";c.welDropper=$(e);c.welTextarea.before(c.welDropper);c.welTextarea.on({dragover:$.proxy(a,
 this,b),dragenter:$.proxy(d,this,b),dragleave:$.proxy(t,this,b),drop:$.proxy(x,this,b)})}if(v.bPastable&&c.welTextarea)c.welTextarea.on("paste",$.proxy(B,this,b));c.welContainer.data("isYobiUploader",!0);c.welTextarea.data("isYobiUploader",!0)}function c(){$(document.body).addClass("dragover")}function b(){$(document.body).removeClass("dragover")}function a(b,a){c();a.stopPropagation();a.preventDefault();return!1}function d(b,a){c();var d=a.originalEvent.dataTransfer,e;e=a.originalEvent.dataTransfer;
 e=e.types?-1<e.types.indexOf("text/uri-list")?"link":-1<e.types.indexOf("Files")||-1<e.types.indexOf("text/plain")?"copy":"none":"none";d.dropEffect=e;a.stopPropagation();a.preventDefault()}function t(a,c){b();c.originalEvent.dataTransfer.dropEffect="none";c.stopPropagation();c.preventDefault()}function A(b){var a=w[b],c;c=a.welInputFile.val();var d=c.indexOf("fakepath");(c=-1<d?c.substring(d+8+1):c)&&""!==c&&h(a.welInputFile[0].files||a.welInputFile[0],b)}function x(a,c){b();var d=c.originalEvent.dataTransfer.files;
-if(d&&0!==d.length)return h(d,a),y("dropFile",{weEvt:c,oFiles:d},a),c.stopPropagation(),c.preventDefault(),!1}function B(a,b){var c=b.originalEvent.clipboardData;if(c&&c.items)for(var d,e,f=0,t=c.items.length;f<t;f++)d=c.items[f],(e=d.getAsFile())&&0===e.type.indexOf("image/")&&(d=z(),e.name=d+".png",q(e,d,a),y("pasteFile",{nSubmitId:d,oFile:e},a),b.preventDefault())}function z(){return parseInt(Math.random()*(new Date).getTime())}function y(a,b,c){a=(m[a]||[]).concat(m[(c?c+".":"")+a]||[]);if(!1!==
-a instanceof Array){var d;a.forEach(function(a){d=d||a(b)});return d}}var v={},w={},m={};return{init:function(a){a=a||{};v.sListURL=a.sListURL;v.sUploadURL=a.sUploadURL;v.htUploadOpts=a.htUploadOpts||{dataType:"json"};v.bXHR2=!(!window.ProgressEvent||!window.FileReader)&&!!window.FormData;-1<navigator.userAgent.toLowerCase().indexOf("trident")&&(v.bXHR2=v.bXHR2&&-1<location.protocol.toLowerCase().indexOf("https"));v.bDroppable="undefined"!=typeof window.File&&v.bXHR2;v.bPastable="undefined"!=typeof document.onpaste&&
+if(d&&0!==d.length)return h(d,a),y("dropFile",{weEvt:c,oFiles:d},a),c.stopPropagation(),c.preventDefault(),!1}function B(a,b){var c=b.originalEvent.clipboardData;if(c&&c.items)for(var d,e,f=0,t=c.items.length;f<t;f++)d=c.items[f],(e=d.getAsFile())&&0===e.type.indexOf("image/")&&(d=z(),e.name=d+".png",q(e,d,a),y("pasteFile",{nSubmitId:d,oFile:e},a),b.preventDefault())}function z(){return parseInt(Math.random()*(new Date).getTime())}function y(a,b,c){a=(n[a]||[]).concat(n[(c?c+".":"")+a]||[]);if(!1!==
+a instanceof Array){var d;a.forEach(function(a){d=d||a(b)});return d}}var v={},w={},n={};return{init:function(a){a=a||{};v.sListURL=a.sListURL;v.sUploadURL=a.sUploadURL;v.htUploadOpts=a.htUploadOpts||{dataType:"json"};v.bXHR2=!(!window.ProgressEvent||!window.FileReader)&&!!window.FormData;-1<navigator.userAgent.toLowerCase().indexOf("trident")&&(v.bXHR2=v.bXHR2&&-1<location.protocol.toLowerCase().indexOf("https"));v.bDroppable="undefined"!=typeof window.File&&v.bXHR2;v.bPastable="undefined"!=typeof document.onpaste&&
 v.bXHR2&&-1===navigator.userAgent.indexOf("FireFox");v.nMaxFileSize=2147483454},getEnv:function(){return v},getUploader:function(a,b,c){c=c||z();if($(a).data("isYobiUploader")||$(b).data("isYobiUploader"))return!1;var d=c;w[d]={};w[d].welContainer=$(a);w[d].welTextarea=$(b);w[d].welInputFile=w[d].welContainer.find("input[type=file]");w[d].welContainer.attr("data-namespace",d);v.bXHR2||w[d].welInputFile.attr("multiple",null);e(c);return w[c].welContainer},destroyUploader:function(a){if(a&&w[a]){var b=
-w[a];b.welInputFile.off();b.welContainer.off();b.welTextarea.off();b.welContainer.data("isYobiUploader",!1);b.welTextarea.data("isYobiUploader",!1);delete w[a]}},attach:function(a,b,c){if("object"===typeof a){c=b?b+".":"";for(var d in a)m[c+d]=m[c+d]||[],m[c+d].push(a[d])}else c=c?c+".":"",m[c+a]=m[c+a]||[],m[c+a].push(b)},detach:function(a,b,c){c=c?c+".":"";if(b){var d=m[c+a];b=d?d.indexOf(b):-1;-1<b&&m[c+a].splice(b,1)}else m[c+a]=[]},getList:function(a){$.ajax({type:"get",url:v.sListURL,success:a.fOnLoad,
-error:a.fOnError,data:{containerType:a.sResourceType,containerId:a.sResourceId}})},uploadFile:h,deleteFile:function(a){$yobi.sendForm({sURL:a.sURL,fOnLoad:a.fOnLoad,fOnError:a.fOnError,htData:{_method:"delete"},htOptForm:{method:"post",enctype:"multipart/form-data"}})}}}();yobi.Markdown=function(h){var q,r;function u(e){q=e.sMarkdownRendererUrl;r={gfm:!0,tables:!0,pedantic:!1,sanitize:!1,smartLists:!0,langPrefix:"",highlight:function(c,b){if(b)try{return hljs.highlight(b.toLowerCase(),c).value}catch(a){console.log(a.message)}}}}function k(e,c){$.ajax(q,{type:"post",data:{body:c,breaks:e.hasClass("readme-body")?!1:!0},success:function(b){e.html(b)}})}function l(e){var c=e.parents('[data-toggle="markdown-editor"]').get(0);if(!c)return!1;$(c).on("click",'a[data-mode="preview"]',
-function(b){b=$(b.delegateTarget).find("div.markdown-preview");var a=e.val();q&&k(b,a);b.css({"min-height":e.height()+"px"})});e.on("keydown.tabkey-event-handler",function(b){if(9===b.keyCode){b.preventDefault();b=this.selectionStart;var a=this.selectionEnd;this.value=this.value.substring(0,b)+"\t"+this.value.substring(a);this.selectionEnd=b+1}})}function f(e){$(e||"[markdown]").each(function(c,b){var a=b.tagName.toUpperCase();if("TEXTAREA"===a||"INPUT"===a||"true"==b.contentEditable)l($(b));else{var a=
-$(b),d=a.text(),d=d?$yobi.xssClean(marked(d,r)):a.html();$(".markdown-loader").remove();a.html(d).removeClass("markdown-before")}})}r=q=void 0;return{init:function(e){e=e||{};u(e);f(e.aTarget)},enableMarkdown:f,render:k}}();yobi.Mention=function(h){function q(c){c=c||window.event;c=c.which||c.keyCode;(64===c||35===c)&&f.doesNotDataLoaded&&k()}function r(){f.nKeyupEventGenerator&&clearInterval(f.nKeyupEventGenerator);f.nKeyupEventGenerator=setInterval(function(){f.sMentionText!=e.welTarget.val()&&(e.welTarget.trigger("keyup"),f.sMentionText=e.welTarget.val())},100)}function u(){f.nKeyupEventGenerator&&(clearInterval(f.nKeyupEventGenerator),f.nKeyupEventGenerator=null)}function k(){$.ajax({url:f.url,type:"get",contentType:"application/json",
-dataType:"json",beforeSend:function(){NProgress.start()}}).done(function(c){NProgress.done();l(c)})}function l(c){f.doesNotDataLoaded=!1;e.welTarget.atwho({at:"@",limit:10,data:c.result,tpl:"<li data-value='@${loginid}'><img style='width:20px;height:20px;' src='${image}'> ${username} <small>${loginid}</small></li>",show_the_at:!0}).atwho({at:"#",limit:10,tpl:'<li data-value="#${issueNo}"><small>#${issueNo}</small> ${title}</li>',data:c.issues,callbacks:{sorter:function(b,a,c){var e,f,k;if(!b)return a;
-k=[];e=0;for(f=a.length;e<f;e++){c=a[e];if(c.issueNo===b)c.atwhoOrder=0;else{var l=c.issueNo.toLowerCase().indexOf(b.toLowerCase());c.atwhoOrder=e+1+Math.pow(10,l)+(-1<l?0:Math.pow(100,c.title.toLowerCase().indexOf(b.toLowerCase())))}k.push(c)}return k.sort(function(a,b){return a.atwhoOrder-b.atwhoOrder})}}}).atwho("run")}var f={},e={};(function(c){f=c||{};f.doesNotDataLoaded=!0;f.nKeyupEventGenerator=null;f.sMentionText=null;f.target?e.welTarget=$(f.target):window.console&&console.error("mention form element targeting doesn't exist!");
-e.welTarget.on("keypress",q);jQuery.browser.mozilla&&(e.welTarget.on("focus",r),e.welTarget.on("blur",u))})(h||{})};yobi.OriginalMessage=function(h){function q(h,q,k){var l,f;l=function(){q();h.click(f)};f=function(){k();h.click(l)};h.click(l)}return{hide:function(h){$.each(h,function(h,k){var l,f,e,c=$(k);c.find(":contains('---')").each(function(){var b=$(this).html();return b&&!$(this).is(c.children(":first"))&&b.match(/(^|^<[^>]+>)---+[^-]*---+/)?(l=$(this),!1):!0});l&&(f=l.add(l.nextAll()).add(l.parents().filter(function(b,a){return 0<c.has(a).length}).nextAll()).hide(),e=$("<button>").css("border",0).css("padding-left",
-"5px").css("padding-right","5px").attr("type","button").text("..."),q(e,function(){f.show()},function(){f.hide()}),l.before(e))})}}}();yobi.Pagination=function(h,q){function r(c){var b=q.createElement("a");b.href=c.replace("&amp;","&");return b.search}function u(c,b,a){var d=r(c),e=new RegExp("(^|&|\\?)"+a+"=[^&]+"),f=e.exec(d);b=d=f?d.replace(e,f[1]+a+"="+b):d+"&"+a+"="+b;a=q.createElement("a");a.href=c;a.search="?"==b[0]?b:"?"+b;return a.href}function k(c){var b=$('<input type="number" pattern="[0-9]*" class="input-mini nospinner">');b.prop({name:c.paramNameForPage,max:c.totalPages,min:1});b.val(c.current);b.on("keydown",function(a){var d;
-d=c.current;if(!1===e.test(b.val()))b.val(d),d=!1;else{d=parseInt(b.val(),10);var f=parseInt(b.attr("min"),10),k=parseInt(b.attr("max"),10);d<f?b.val(f):d>k&&b.val(k);d=!0}d&&(d=b.val(),"function"===typeof c.submit?c.submit(d):13===a.which&&(q.location.href=u(c.url,d,c.paramNameForPage)))});return b}function l(c){var b=$('<li class="page-num ikon">');if(c.bActive){var a=$("<a pjax-page>");a.html(c.sLinkHTMLOn);"function"===typeof c.submit?(a.attr("href","javascript: void(0);"),a.on("click",function(){c.submit(c.nSubmitPageNum)})):
+w[a];b.welInputFile.off();b.welContainer.off();b.welTextarea.off();b.welContainer.data("isYobiUploader",!1);b.welTextarea.data("isYobiUploader",!1);delete w[a]}},attach:function(a,b,c){if("object"===typeof a){c=b?b+".":"";for(var d in a)n[c+d]=n[c+d]||[],n[c+d].push(a[d])}else c=c?c+".":"",n[c+a]=n[c+a]||[],n[c+a].push(b)},detach:function(a,b,c){c=c?c+".":"";if(b){var d=n[c+a];b=d?d.indexOf(b):-1;-1<b&&n[c+a].splice(b,1)}else n[c+a]=[]},getList:function(a){$.ajax({type:"get",url:v.sListURL,success:a.fOnLoad,
+error:a.fOnError,data:{containerType:a.sResourceType,containerId:a.sResourceId}})},uploadFile:h,deleteFile:function(a){$yobi.sendForm({sURL:a.sURL,fOnLoad:a.fOnLoad,fOnError:a.fOnError,htData:{_method:"delete"},htOptForm:{method:"post",enctype:"multipart/form-data"}})}}}();yobi.Markdown=function(h){var q,r;function u(e){q=e.sMarkdownRendererUrl;r={gfm:!0,tables:!0,pedantic:!1,sanitize:!1,smartLists:!0,langPrefix:"",highlight:function(c,b){if(b)try{return hljs.highlight(b.toLowerCase(),c).value}catch(a){console.log(a.message)}}}}function k(e,c){var b={body:c,breaks:e.hasClass("readme-body")?!1:!0};$.ajax(q,{type:"post",contentType:"application/json; charset=utf-8",data:JSON.stringify(b),success:function(a){console.log("...",a);e.html(a)}})}function m(e){var c=e.parents('[data-toggle="markdown-editor"]').get(0);
+if(!c)return!1;$(c).on("click",'a[data-mode="preview"]',function(b){b=$(b.delegateTarget).find("div.markdown-preview");var a=e.val();q&&k(b,a);b.css({"min-height":e.height()+"px"})});e.on("keydown.tabkey-event-handler",function(b){if(9===b.keyCode){b.preventDefault();b=this.selectionStart;var a=this.selectionEnd;this.value=this.value.substring(0,b)+"\t"+this.value.substring(a);this.selectionEnd=b+1}})}function f(e){$(e||"[markdown]").each(function(c,b){var a=b.tagName.toUpperCase();if("TEXTAREA"===
+a||"INPUT"===a||"true"==b.contentEditable)m($(b));else{var a=$(b),d=a.text(),d=d?$yobi.xssClean(marked(d,r)):a.html();$(".markdown-loader").remove();a.html(d).removeClass("markdown-before")}})}r=q=void 0;return{init:function(e){e=e||{};u(e);f(e.aTarget)},enableMarkdown:f,render:k}}();yobi.Mention=function(h){function q(c){c=c||window.event;c=c.which||c.keyCode;(64===c||35===c)&&f.doesNotDataLoaded&&k()}function r(){f.nKeyupEventGenerator&&clearInterval(f.nKeyupEventGenerator);f.nKeyupEventGenerator=setInterval(function(){f.sMentionText!=e.welTarget.val()&&(e.welTarget.trigger("keyup"),f.sMentionText=e.welTarget.val())},100)}function u(){f.nKeyupEventGenerator&&(clearInterval(f.nKeyupEventGenerator),f.nKeyupEventGenerator=null)}function k(){$.ajax({url:f.url,type:"get",contentType:"application/json",
+dataType:"json",beforeSend:function(){NProgress.start()}}).done(function(c){NProgress.done();m(c)})}function m(c){f.doesNotDataLoaded=!1;e.welTarget.atwho({at:"@",limit:10,data:c.result,tpl:"<li data-value='@${loginid}'><img style='width:20px;height:20px;' src='${image}'> ${username} <small>${loginid}</small></li>",show_the_at:!0}).atwho({at:"#",limit:10,tpl:'<li data-value="#${issueNo}"><small>#${issueNo}</small> ${title}</li>',data:c.issues,callbacks:{sorter:function(b,a,c){var e,f,k;if(!b)return a;
+k=[];e=0;for(f=a.length;e<f;e++){c=a[e];if(c.issueNo===b)c.atwhoOrder=0;else{var m=c.issueNo.toLowerCase().indexOf(b.toLowerCase());c.atwhoOrder=e+1+Math.pow(10,m)+(-1<m?0:Math.pow(100,c.title.toLowerCase().indexOf(b.toLowerCase())))}k.push(c)}return k.sort(function(a,b){return a.atwhoOrder-b.atwhoOrder})}}}).atwho("run")}var f={},e={};(function(c){f=c||{};f.doesNotDataLoaded=!0;f.nKeyupEventGenerator=null;f.sMentionText=null;f.target?e.welTarget=$(f.target):window.console&&console.error("mention form element targeting doesn't exist!");
+e.welTarget.on("keypress",q);jQuery.browser.mozilla&&(e.welTarget.on("focus",r),e.welTarget.on("blur",u))})(h||{})};yobi.OriginalMessage=function(h){function q(h,q,k){var m,f;m=function(){q();h.click(f)};f=function(){k();h.click(m)};h.click(m)}return{hide:function(h){$.each(h,function(h,k){var m,f,e,c=$(k);c.find(":contains('---')").each(function(){var b=$(this).html();return b&&!$(this).is(c.children(":first"))&&b.match(/(^|^<[^>]+>)---+[^-]*---+/)?(m=$(this),!1):!0});m&&(f=m.add(m.nextAll()).add(m.parents().filter(function(b,a){return 0<c.has(a).length}).nextAll()).hide(),e=$("<button>").css("border",0).css("padding-left",
+"5px").css("padding-right","5px").attr("type","button").text("..."),q(e,function(){f.show()},function(){f.hide()}),m.before(e))})}}}();yobi.Pagination=function(h,q){function r(c){var b=q.createElement("a");b.href=c.replace("&amp;","&");return b.search}function u(c,b,a){var d=r(c),e=new RegExp("(^|&|\\?)"+a+"=[^&]+"),f=e.exec(d);b=d=f?d.replace(e,f[1]+a+"="+b):d+"&"+a+"="+b;a=q.createElement("a");a.href=c;a.search="?"==b[0]?b:"?"+b;return a.href}function k(c){var b=$('<input type="number" pattern="[0-9]*" class="input-mini nospinner">');b.prop({name:c.paramNameForPage,max:c.totalPages,min:1});b.val(c.current);b.on("keydown",function(a){var d;
+d=c.current;if(!1===e.test(b.val()))b.val(d),d=!1;else{d=parseInt(b.val(),10);var f=parseInt(b.attr("min"),10),k=parseInt(b.attr("max"),10);d<f?b.val(f):d>k&&b.val(k);d=!0}d&&(d=b.val(),"function"===typeof c.submit?c.submit(d):13===a.which&&(q.location.href=u(c.url,d,c.paramNameForPage)))});return b}function m(c){var b=$('<li class="page-num ikon">');if(c.bActive){var a=$("<a pjax-page>");a.html(c.sLinkHTMLOn);"function"===typeof c.submit?(a.attr("href","javascript: void(0);"),a.on("click",function(){c.submit(c.nSubmitPageNum)})):
 a.attr("href",c.sLinkHref);b.append(a)}else b.html(c.sLinkHTMLOff);yobi.ShortcutKey&&(a={},a[c.sShortcutKey]=c.sLinkHref,yobi.ShortcutKey.setKeymapLink(a));return b}var f={},e=/^.[0-9]*$/;return{update:function(c,b,a){if(!(0>=b)){c=$(c);a=a||{};a.url=a.url||q.URL;a.firstPage=a.firstPage||1;a.totalPages=b;a.paramNameForPage=a.paramNameForPage||"pageNum";var d;if(e.test(a.current))d=a.current;else{var t=r(a.url);d=parseInt;var h=a.paramNameForPage;f[h]=f[h]||new RegExp("(^|&|\\?)"+h+"=([^&]+)");t=f[h].exec(t);
 d=d(t?t[2]:null,10)||a.firstPage}a.current=d;a.hasPrev="undefined"===typeof a.hasPrev?a.current>a.firstPage:a.hasPrev;a.hasNext="undefined"===typeof a.hasNext?a.current<a.totalPages:a.hasNext;if(!$.isNumeric(a.current))throw Error("options.current is not valid: "+a.current);c.html("");c.addClass("page-navigation-wrap");t=Messages("button.prevPage")||"PREV";d='<i class="ico btn-pg-prev"></i><span>'+t+"</span>";t='<i class="ico btn-pg-prev off"></i><span class="off">'+t+"</span>";d=$.extend(a,{bActive:a.hasPrev,
-sLinkHref:a.hasPrev?u(a.url,a.current-1,a.paramNameForPage):"",sLinkHTMLOn:d,sLinkHTMLOff:t,sShortcutKey:"A",nSubmitPageNum:a.current-1});d=l(d);h=Messages("button.nextPage")||"NEXT";t="<span>"+h+'</span><i class="ico btn-pg-next"></i>';h='<span class="off">'+h+'</span><i class="ico btn-pg-next off"></i>';t=$.extend(a,{bActive:a.hasNext,sLinkHref:a.hasNext?u(a.url,a.current+1,a.paramNameForPage):"",sLinkHTMLOn:t,sLinkHTMLOff:h,sShortcutKey:"S",nSubmitPageNum:a.current+1});t=l(t);a=k(a);a=$('<li class="page-num">').append(a);
+sLinkHref:a.hasPrev?u(a.url,a.current-1,a.paramNameForPage):"",sLinkHTMLOn:d,sLinkHTMLOff:t,sShortcutKey:"A",nSubmitPageNum:a.current-1});d=m(d);h=Messages("button.nextPage")||"NEXT";t="<span>"+h+'</span><i class="ico btn-pg-next"></i>';h='<span class="off">'+h+'</span><i class="ico btn-pg-next off"></i>';t=$.extend(a,{bActive:a.hasNext,sLinkHref:a.hasNext?u(a.url,a.current+1,a.paramNameForPage):"",sLinkHTMLOn:t,sLinkHTMLOff:h,sShortcutKey:"S",nSubmitPageNum:a.current+1});t=m(t);a=k(a);a=$('<li class="page-num">').append(a);
 h=$('<li class="page-num delimiter">').text("/");b=$('<li class="page-num">').text(b);var x=$('<ul class="page-nums">');x.append([d,a,h,b,t]);c.append(x)}}}}(window,document);$(document).on("click.pagination.number-api",'input[name="pageNum"][type="number"]',function(){$(this).select()});yobi.ShortcutKey=function(h){function q(c){var b;var a=f.htKeycodeMap[c.keyCode];if("undefined"===typeof a)b=void 0;else{b=[];var d="";c.altKey&&b.push("ALT");(c.ctrlKey||c.metaKey)&&b.push("CTRL");c.shiftKey&&b.push("SHIFT");b.push(a);b=d=b.join("+").toUpperCase()}a=e[b];if("function"===typeof a){d=c.target.tagName.toUpperCase();c={weEvt:c,welTarget:$(c.target),sTagName:d,sKeyInput:b,bFormInput:-1<f.aFormTags.indexOf(d)};try{a(c)}catch(k){}finally{}}}function r(c,b){if("string"===typeof c){var a,
-d=b;a=k(c);e[a]=d}else for(a in c){b=c[a];var d=a,f=b,d=k(d);e[d]=f}}function u(c){c=k(c);delete e[c]}function k(c){c=c.toUpperCase()||"";c=c.replace(f.rxTrim,"");return c=c.split("+").sort(function(b){return-1*f.aCombinationKeys.indexOf(b)}).join("+")}function l(){$(window).off({keydown:q,beforeunload:l});e=f=null}var f={},e={};f.rxTrim=/\s+/g;f.aFormTags=["INPUT","TEXTAREA"];f.aCombinationKeys=["CTRL","ALT","SHIFT"];f.htKeycodeMap={13:"ENTER",38:"UP",40:"DOWN",37:"LEFT",39:"RIGHT",13:"ENTER",27:"ESC",
+d=b;a=k(c);e[a]=d}else for(a in c){b=c[a];var d=a,f=b,d=k(d);e[d]=f}}function u(c){c=k(c);delete e[c]}function k(c){c=c.toUpperCase()||"";c=c.replace(f.rxTrim,"");return c=c.split("+").sort(function(b){return-1*f.aCombinationKeys.indexOf(b)}).join("+")}function m(){$(window).off({keydown:q,beforeunload:m});e=f=null}var f={},e={};f.rxTrim=/\s+/g;f.aFormTags=["INPUT","TEXTAREA"];f.aCombinationKeys=["CTRL","ALT","SHIFT"];f.htKeycodeMap={13:"ENTER",38:"UP",40:"DOWN",37:"LEFT",39:"RIGHT",13:"ENTER",27:"ESC",
 32:"SPACE",8:"BACKSPACE",9:"TAB",46:"DELETE",33:"PAGEUP",34:"PAGEDOWN",36:"HOME",35:"END",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",219:"[",221:"]",186:";",222:"'",188:",",190:".",191:"/",189:"-",187:"=",220:"\\",192:"`",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",
-120:"F9",121:"F10",122:"F11",123:"F12"};$(window).on({keydown:q,beforeunload:l});return{attach:r,detach:u,getHandlers:function(){return e},setKeymapLink:function(c){var b,a=function(a){a.bFormInput||(document.location.href=c[a.sKeyInput])};for(b in c)c[b]?r(b,a):u(b)}}}();(function(h){h=$yobi.createNamespace(h);h.container[h.name]=function(h,r){function u(b){if("function"===typeof e.fOnClickButton&&!1===e.fOnClickButton({weEvt:b,nButtonIndex:$(this).index()}))return!1;k()}function k(){c.welContainer.modal("hide")}function l(){"function"==typeof e.fOnAfterShow&&e.fOnAfterShow();e.bAutoFocusOnLastButton&&c.welButtons.find(".ybtn-primary:last,button:last").focus()}function f(){c.welMessage.html("");"function"==typeof e.fOnAfterHide&&e.fOnAfterHide()}var e={},c={};(function(b,
+120:"F9",121:"F10",122:"F11",123:"F12"};$(window).on({keydown:q,beforeunload:m});return{attach:r,detach:u,getHandlers:function(){return e},setKeymapLink:function(c){var b,a=function(a){a.bFormInput||(document.location.href=c[a.sKeyInput])};for(b in c)c[b]?r(b,a):u(b)}}}();(function(h){h=$yobi.createNamespace(h);h.container[h.name]=function(h,r){function u(b){if("function"===typeof e.fOnClickButton&&!1===e.fOnClickButton({weEvt:b,nButtonIndex:$(this).index()}))return!1;k()}function k(){c.welContainer.modal("hide")}function m(){"function"==typeof e.fOnAfterShow&&e.fOnAfterShow();e.bAutoFocusOnLastButton&&c.welButtons.find(".ybtn-primary:last,button:last").focus()}function f(){c.welMessage.html("");"function"==typeof e.fOnAfterHide&&e.fOnAfterHide()}var e={},c={};(function(b,
 a){e.sDefaultButton='<button type="button" class="ybtn ybtn-info" data-dismiss="modal">'+Messages("button.confirm")+"</button>";e.sTplCustomButton='<button type="button" class="ybtn ${class}">${text}</button>';e.bAutoFocusOnLastButton="undefined"!==typeof a.bAutoFocusOnLastButton?a.bAutoFocusOnLastButton:!0;c.welContainer=$(b).clone();c.welMessage=c.welContainer.find(".msg");c.welDescription=c.welContainer.find(".desc");c.welButtons=c.welContainer.find(".buttons");c.welContainer.modal({show:!1});
-c.welContainer.on("shown",l);c.welContainer.on("hidden",f);c.welContainer.on("click","button.ybtn",u)})(h,r||{});return{show:function(b,a,d){e.fOnAfterShow=d.fOnAfterShow;e.fOnAfterHide=d.fOnAfterHide;e.fOnClickButton=d.fOnClickButton;var f;if(d.aButtonLabels){f=[];var k=d.aButtonLabels;d=d.aButtonStyles||[];for(var h=0,l=k.length;h<l;h++)f.push($yobi.tmpl(e.sTplCustomButton,{text:k[h],"class":d[h]||(0===d.length&&h===l-1?"ybtn-primary":"ybtn-default")}));f=f.join("")}else f=e.sDefaultButton;c.welButtons.html(f);
-c.welMessage.html($yobi.nl2br(b));c.welDescription.html($yobi.nl2br(a||""));c.welContainer.modal("show")},hide:k}}})("yobi.ui.Dialog");(function(h){h=$yobi.createNamespace(h);h.container[h.name]=function(h){function r(b){if(0<b.originalEvent.deltaY&&a.welList.scrollTop()+a.welList.height()===a.welList.get(0).scrollHeight||0>b.originalEvent.deltaY&&0===a.welList.scrollTop())return b.preventDefault(),b.stopPropagation(),!1}function u(a){var b=$(a.target),b="LI"===a.target.tagName?b:$(b.parents("li")[0]);if(0===b.length||"undefined"===typeof b.attr("data-value"))return a.stopPropagation(),a.preventDefault(),!1;k(b);l(b);f()}function k(b){a.welSelectedLabel.html(b.html());
-a.waItems.removeClass("active");b.addClass("active")}function l(c){c=c.attr("data-value");var e=a.welContainer.attr("data-name");b.sName=e;b.sValue=c;if("undefined"!==typeof e){var f=a.welContainer.find("input[name='"+e+"']");0===f.length&&(f=$('<input type="hidden" name="'+e+'">'),a.welContainer.append(f));f.val(c)}}function f(){"function"==typeof b.fOnChange&&setTimeout(function(){b.fOnChange(e())},0)}function e(){return b.sValue}function c(b){b=a.welContainer.find(b);if(0>=b.length)return!1;b=
-$(b[0]);k(b);l(b);return!0}var b={sValue:""},a={};(function(d){a.welContainer=$(d.elContainer);a.welSelectedLabel=a.welContainer.find(".d-label");a.welList=a.welContainer.find(".dropdown-menu");a.waItems=a.welList.find("li");a.welList.on("click","li",u);a.welList.on("mousewheel",r);b.fOnChange=d.fOnChange;c("li[data-selected=true]")})(h);return{getValue:e,onChange:function(a){b.fOnChange=a;return!0},selectByValue:function(a){return c("li[data-value='"+a+"']")},selectItem:c}}})("yobi.ui.Dropdown");$(document).ready(function(){function h(k,h){var f;h=$("#"+k).find("li > a");(f=localStorage.getItem("yobitab-"+k))&&h[f]&&(f=$(h[f]))&&f.data(!1)&&f.tab("show")}var q,r,u;$(".nav-tabs[id]").each(function(k,l){r=$(l);u=r.attr("id");"undefined"!=typeof u&&(q=r.find("li"),q.click(function(){localStorage.setItem("yobitab-"+u,$(this).index())}),h(u,q))})});(function(h){h=$yobi.createNamespace(h);h.container[h.name]=function(h,r){function u(c){$(this).remove()}function k(c,b){c.bind("webkitTransitionEnd",function(){c.remove()});setTimeout(function(){c.css("opacity",0)},b)}var l,f,e;(function(c,b){b.sTplToast=b.sTplToast.replace("\n","");l=b.sTplToast||'<div class="toast" tabindex="-1">            <div class="btn-dismiss"><button type="button" class="btn-transparent">&times;</button></div>            <div class="center-text msg"></div></div>';f=$(c);
-e=$(l)})(h,r||{});return{push:function(c,b){var a=e.clone(),d=a.find(".msg");a.css("opacity","0");a.click(u);d.html($yobi.nl2br(c));f.prepend(a);a.css("opacity","1");b&&0<b&&k(a,b)},clear:function(){f.empty()}}}})("yobi.ui.Toast");(function(h){h=$yobi.createNamespace(h);h.container[h.name]=function(h,r){function u(f,e){f.match(k.sLastQuery)&&k.bIsLastRangeEntire?e(k.htCachedUsers):(k.htData.query=f,$yobi.sendForm({sURL:k.sActionURL,htOptForm:{method:"get"},htData:k.htData,sDataType:"json",fOnLoad:function(c,b,a){b=a.getResponseHeader("Content-Range");b=(b=k.rxContentRange.exec(b||""))?!(parseInt(b[1],10)<parseInt(b[2],10)):!0;k.bIsLastRangeEntire=b;k.sLastQuery=f;k.htCachedUsers=c;e(c)}}))}var k={},l;(function(f,e){k.sActionURL=
-e.sActionURL||"/users";k.rxContentRange=/items\s+([0-9]+)\/([0-9]+)/;k.htData=e.htData||{};try{l=$(f),l.typeahead({minLength:k.htData.minLength||0}),htData=l.data("typeahead"),htData.items=k.htData.limit||8,htData.source=k.htData.source||u,"function"===typeof k.htData.updater&&(htData.updater=k.htData.updater),"function"===typeof k.htData.render&&(htData.render=k.htData.render),htData.minLength=k.htData.minLength||0}catch(c){"object"==typeof console&&console.log(c)}})(h,r||{})}})("yobi.ui.Typeahead");
+c.welContainer.on("shown",m);c.welContainer.on("hidden",f);c.welContainer.on("click","button.ybtn",u)})(h,r||{});return{show:function(b,a,d){e.fOnAfterShow=d.fOnAfterShow;e.fOnAfterHide=d.fOnAfterHide;e.fOnClickButton=d.fOnClickButton;var f;if(d.aButtonLabels){f=[];var k=d.aButtonLabels;d=d.aButtonStyles||[];for(var h=0,m=k.length;h<m;h++)f.push($yobi.tmpl(e.sTplCustomButton,{text:k[h],"class":d[h]||(0===d.length&&h===m-1?"ybtn-primary":"ybtn-default")}));f=f.join("")}else f=e.sDefaultButton;c.welButtons.html(f);
+c.welMessage.html($yobi.nl2br(b));c.welDescription.html($yobi.nl2br(a||""));c.welContainer.modal("show")},hide:k}}})("yobi.ui.Dialog");(function(h){h=$yobi.createNamespace(h);h.container[h.name]=function(h){function r(b){if(0<b.originalEvent.deltaY&&a.welList.scrollTop()+a.welList.height()===a.welList.get(0).scrollHeight||0>b.originalEvent.deltaY&&0===a.welList.scrollTop())return b.preventDefault(),b.stopPropagation(),!1}function u(a){var b=$(a.target),b="LI"===a.target.tagName?b:$(b.parents("li")[0]);if(0===b.length||"undefined"===typeof b.attr("data-value"))return a.stopPropagation(),a.preventDefault(),!1;k(b);m(b);f()}function k(b){a.welSelectedLabel.html(b.html());
+a.waItems.removeClass("active");b.addClass("active")}function m(c){c=c.attr("data-value");var e=a.welContainer.attr("data-name");b.sName=e;b.sValue=c;if("undefined"!==typeof e){var f=a.welContainer.find("input[name='"+e+"']");0===f.length&&(f=$('<input type="hidden" name="'+e+'">'),a.welContainer.append(f));f.val(c)}}function f(){"function"==typeof b.fOnChange&&setTimeout(function(){b.fOnChange(e())},0)}function e(){return b.sValue}function c(b){b=a.welContainer.find(b);if(0>=b.length)return!1;b=
+$(b[0]);k(b);m(b);return!0}var b={sValue:""},a={};(function(d){a.welContainer=$(d.elContainer);a.welSelectedLabel=a.welContainer.find(".d-label");a.welList=a.welContainer.find(".dropdown-menu");a.waItems=a.welList.find("li");a.welList.on("click","li",u);a.welList.on("mousewheel",r);b.fOnChange=d.fOnChange;c("li[data-selected=true]")})(h);return{getValue:e,onChange:function(a){b.fOnChange=a;return!0},selectByValue:function(a){return c("li[data-value='"+a+"']")},selectItem:c}}})("yobi.ui.Dropdown");$(document).ready(function(){function h(k,h){var f;h=$("#"+k).find("li > a");(f=localStorage.getItem("yobitab-"+k))&&h[f]&&(f=$(h[f]))&&f.data(!1)&&f.tab("show")}var q,r,u;$(".nav-tabs[id]").each(function(k,m){r=$(m);u=r.attr("id");"undefined"!=typeof u&&(q=r.find("li"),q.click(function(){localStorage.setItem("yobitab-"+u,$(this).index())}),h(u,q))})});(function(h){h=$yobi.createNamespace(h);h.container[h.name]=function(h,r){function u(c){$(this).remove()}function k(c,b){c.bind("webkitTransitionEnd",function(){c.remove()});setTimeout(function(){c.css("opacity",0)},b)}var m,f,e;(function(c,b){b.sTplToast=b.sTplToast.replace("\n","");m=b.sTplToast||'<div class="toast" tabindex="-1">            <div class="btn-dismiss"><button type="button" class="btn-transparent">&times;</button></div>            <div class="center-text msg"></div></div>';f=$(c);
+e=$(m)})(h,r||{});return{push:function(c,b){var a=e.clone(),d=a.find(".msg");a.css("opacity","0");a.click(u);d.html($yobi.nl2br(c));f.prepend(a);a.css("opacity","1");b&&0<b&&k(a,b)},clear:function(){f.empty()}}}})("yobi.ui.Toast");(function(h){h=$yobi.createNamespace(h);h.container[h.name]=function(h,r){function u(f,e){f.match(k.sLastQuery)&&k.bIsLastRangeEntire?e(k.htCachedUsers):(k.htData.query=f,$yobi.sendForm({sURL:k.sActionURL,htOptForm:{method:"get"},htData:k.htData,sDataType:"json",fOnLoad:function(c,b,a){b=a.getResponseHeader("Content-Range");b=(b=k.rxContentRange.exec(b||""))?!(parseInt(b[1],10)<parseInt(b[2],10)):!0;k.bIsLastRangeEntire=b;k.sLastQuery=f;k.htCachedUsers=c;e(c)}}))}var k={},m;(function(f,e){k.sActionURL=
+e.sActionURL||"/users";k.rxContentRange=/items\s+([0-9]+)\/([0-9]+)/;k.htData=e.htData||{};try{m=$(f),m.typeahead({minLength:k.htData.minLength||0}),htData=m.data("typeahead"),htData.items=k.htData.limit||8,htData.source=k.htData.source||u,"function"===typeof k.htData.updater&&(htData.updater=k.htData.updater),"function"===typeof k.htData.render&&(htData.render=k.htData.render),htData.minLength=k.htData.minLength||0}catch(c){"object"==typeof console&&console.log(c)}})(h,r||{})}})("yobi.ui.Typeahead");
Add a comment
List