markdown editor v2 libs
This commit is contained in:
1 parent
6a753682b7
commit
3ff0a9e09c
12 files changed
+824
-9
No files matched your search
@@ -625,7 +625,7 @@ function log(o) {
|
|||||||
<li class="wmd-button-group3 btn-group"></li>
|
<li class="wmd-button-group3 btn-group"></li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="nav left-buttons">
|
<ul class="nav left-buttons">
|
||||||
<li class="wmd-button-group5 btn-group"></li>
|
<li class="wmd-button-group4 btn-group"></li>
|
||||||
</ul>
|
</ul>
|
||||||
<!-- 帮助 -->
|
<!-- 帮助 -->
|
||||||
<ul class="nav left-buttons">
|
<ul class="nav left-buttons">
|
||||||
@@ -717,15 +717,15 @@ function log(o) {
|
|||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"
|
<button type="button" class="close" data-dismiss="modal"
|
||||||
aria-hidden="true">×</button>
|
aria-hidden="true">×</button>
|
||||||
<h4 class="modal-title">{{msg . "Image"}}</h4>
|
<h4 class="modal-title">{{leaMsg . "Image"}}</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body" style="padding-top: 0; padding-bottom: 0">
|
<div class="modal-body" style="padding-top: 0; padding-bottom: 0">
|
||||||
<iframe name="mdImageManager" style="width: 100%; height: 350px" scrolling="no" id="leauiIfrForMD" src="" frameborder="0"></iframe>
|
<iframe name="mdImageManager" style="width: 100%; height: 350px" scrolling="no" id="leauiIfrForMD" src="" frameborder="0"></iframe>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<a href="#" class="btn btn-default"
|
<a href="#" class="btn btn-default"
|
||||||
data-dismiss="modal">{{msg . "Cancel"}}</a> <a href="#"
|
data-dismiss="modal">{{leaMsg . "Cancel"}}</a> <a href="#"
|
||||||
class="btn btn-primary action-insert-image" data-dismiss="modal">{{msg . "Insert Image"}}</a>
|
class="btn btn-primary action-insert-image" data-dismiss="modal">{{leaMsg . "Insert Image"}}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -898,7 +898,7 @@ window.require = {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="/js/markdown.min.js"></script>
|
<script src="/js/markdown-v2.min.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
var MSG={"app":"Leanote","share":"Share","noTag":"No Tags","inputEmail":"Email is required","history":"Histories","editorTips":"Tips","editorTipsInfo":"<h4>1. Short cuts</h4>ctrl+shift+c Toggle code<h4>2. shift+enter Get out of current block</h4> eg. <img src=\"/images/outofcode.png\" style=\"width: 90px\"/> in this situation you can use shift+enter to get out of current code block.","all":"Newest","trash":"Trash","delete":"Delete","unTitled":"UnTitled","defaultShare":"Default sharing","writingMode":"Writing Mode","normalMode":"Normal Mode","saving":"Saving","saveSuccess":"Save success","update":"Update","close":"Close","cancel":"Cancel","send":"Send","shareToFriends":"Share to friends","publicAsBlog":"Public as blog","cancelPublic":"Cancel public","move":"Move","copy":"Copy","rename":"Rename","exportPdf":"Export PDF","addChildNotebook":"Add child notebook","deleteAllShared":"Delete shared user","deleteSharedNotebook":"Delete shared notebook","copyToMyNotebook":"Copy to my notebook","defaulthhare":"Default","friendEmail":"Friend email","readOnly":"Read only","writable":"Writable","inputFriendEmail":"Friend email is required","clickToChangePermission":"Click to change permission","sendInviteEmailToYourFriend":"Send invite email to your friend","friendNotExits":"Your friend hasn't %s's account, invite register link: %s","emailBodyRequired":"Email body is required","sendSuccess":"success","inviteEmailBody":"Hi,I am %s, %s is awesome, come on!","historiesNum":"We have saved at most <b>10</b> latest histories with each note","noHistories":"No histories","datetime":"Datetime","restoreFromThisVersion":"Restore from this version","confirmBackup":"Are you sure to restore from this version? We will backup the current note.","errorEmail":"Please input the right email"};function getMsg(key, data) {var msg = MSG[key];if(msg) {if(data) {if(!isArray(data)) {data = [data];}for(var i = 0; i < data.length; ++i) {msg = msg.replace("%s", data[i]);}}return msg;}return key;}
|
var MSG={"app":"Leanote","share":"Share","noTag":"No Tags","inputUsername":"input username","inputEmail":"Email is required","inputPassword":"Password is required","inputPassword2":"Please input the new password again","confirmPassword":"Password not matched","history":"Histories","editorTips":"Tips","editorTipsInfo":"<h4>1. Short cuts</h4>ctrl+shift+c Toggle code<h4>2. shift+enter Get out of current block</h4> eg. <img src=\"/images/outofcode.png\" style=\"width: 90px\"/> in this situation you can use shift+enter to get out of current code block.","all":"Newest","trash":"Trash","delete":"Delete","unTitled":"UnTitled","defaultShare":"Default sharing","writingMode":"Writing Mode","normalMode":"Normal Mode","saving":"Saving","saveSuccess":"Save success","update":"Update","close":"Close","cancel":"Cancel","send":"Send","shareToFriends":"Share to friends","publicAsBlog":"Public as blog","cancelPublic":"Cancel public","move":"Move","copy":"Copy","rename":"Rename","exportPdf":"Export PDF","addChildNotebook":"Add child notebook","deleteAllShared":"Delete shared user","deleteSharedNotebook":"Delete shared notebook","copyToMyNotebook":"Copy to my notebook","checkEmail":"Check email","sendVerifiedEmail":"Send verification email","defaulthhare":"Default","friendEmail":"Friend email","readOnly":"Read only","writable":"Writable","inputFriendEmail":"Friend email is required","clickToChangePermission":"Click to change permission","sendInviteEmailToYourFriend":"Send invite email to your friend","friendNotExits":"Your friend hasn't %s's account, invite register link: %s","emailBodyRequired":"Email body is required","sendSuccess":"success","inviteEmailBody":"Hi,I am %s, %s is awesome, come on!","historiesNum":"We have saved at most <b>10</b> latest histories with each note","noHistories":"No histories","datetime":"Datetime","restoreFromThisVersion":"Restore from this version","confirmBackup":"Are you sure to restore from this version? We will backup the current note.","createAccountSuccess":"Account create success","createAccountFailed":"Account create failed","updateUsernameSuccess":"Update username success","usernameIsExisted":"Username is already exists","noSpecialChars":"username cannot contains special chars","minLength":"The length is at least %s","errorEmail":"Please input the right email","verifiedEmaiHasSent":"The verification email has been sent, please check your email.","emailSendFailed":"Email send failed","inputNewPassword":"The new password is required","errorPassword":"The passowd's length is at least 6 and be sure as complex as possible","updatePasswordSuccess":"Update password success"};function getMsg(key, data) {var msg = MSG[key];if(msg) {if(data) {if(!isArray(data)) {data = [data];}for(var i = 0; i < data.length; ++i) {msg = msg.replace("%s", data[i]);}}return msg;}return key;}
|
||||||
@@ -1 +1 @@
|
|||||||
var MSG={"app":"Leanote","share":"Partager","noTag":"No Tags","inputEmail":"L'adresse courriel est requis","history":"Historique","editorTips":"Astuces","editorTipsInfo":"<h4>1. Raccourcis</h4>ctrl+maj+c Active/désactive le code<h4>2. maj+entrée Sortir du bloc courant</h4> ex. <img src=\"/images/outofcode.png\" style=\"width: 90px\"/> dans cette situation vous pouvez utiliser maj+entrée pour sortir du bloc de code courant.","all":"Le plus récent","trash":"Corbeille","delete":"Effacer","unTitled":"Sans titre","defaultShare":"Partage par défaut","writingMode":"Mode écriture","normalMode":"Mode normal","saving":"Sauvegarde","saveSuccess":"Sauvegarde réussie","update":"Mettre à jour","close":"Fermer","cancel":"Annuler","send":"Envoyer","shareToFriends":"Partage avec ses amis","publicAsBlog":"Publier en tant que blog","cancelPublic":"Annuler la publication","move":"Déplacer","copy":"Copier","rename":"Renommer","addChildNotebook":"Ajouer un bloc-note enfant","deleteAllShared":"Effacer l'utilisateur partagé","deleteSharedNotebook":"Effacer le bloc-notes partagé","copyToMyNotebook":"Copier vers mon bloc-notes","defaulthhare":"Par défaut","friendEmail":"Courriel de l'ami","readOnly":"Lecture seule","writable":"Editable","inputFriendEmail":"Le courriel de votre ami est requis/","clickToChangePermission":"Cliquez pour changer l'autorisation.","sendInviteEmailToYourFriend":"Envoyer un courriel d'invitation à votre ami.","friendNotExits":"Votre ami n'a pas de compte %s, lien d'invitation à s'enregistrer: %s","emailBodyRequired":"Corps du message requis","sendSuccess":"succès","inviteEmailBody":"Coucou, je suis %s, %s est génial, viens!","historiesNum":"Nous avons enregistré au maximum <b>10</b> historiques récents de chaque note.","noHistories":"Pas d'historique.","fold":"Plier","unfold":"Déplier","datetime":"Date & Heure","restoreFromThisVersion":"Restaurer depuis cette version","confirmBackup":"Êtes-vous sûr de vouloir restaurer depuis cette version? Nous allons réaliser une copie de sauvegarde de la note actuelle.","errorEmail":"Veuillez renseigner le courriel correct"};function getMsg(key, data) {var msg = MSG[key];if(msg) {if(data) {if(!isArray(data)) {data = [data];}for(var i = 0; i < data.length; ++i) {msg = msg.replace("%s", data[i]);}}return msg;}return key;}
|
var MSG={"app":"Leanote","share":"Partager","noTag":"Pas d'étiquettes","inputUsername":"Entrer le nom d'utilisateur","inputEmail":"L'adresse courriel est requis","inputPassword":"Mot de passe requis","inputPassword2":"Veuillez rentrer le nouveau mot de passe à nouveau.","confirmPassword":"Le mot de passe ne correspond pas.","history":"Historique","editorTips":"Astuces","editorTipsInfo":"<h4>1. Raccourcis</h4>ctrl+maj+c Active/désactive le code<h4>2. maj+entrée Sortir du bloc courant</h4> ex. <img src=\"/images/outofcode.png\" style=\"width: 90px\"/> dans cette situation vous pouvez utiliser maj+entrée pour sortir du bloc de code courant.","all":"Le plus récent","trash":"Corbeille","delete":"Effacer","unTitled":"Sans titre","defaultShare":"Partage par défaut","writingMode":"Mode écriture","normalMode":"Mode normal","saving":"Sauvegarde","saveSuccess":"Sauvegarde réussie","update":"Mettre à jour","close":"Fermer","cancel":"Annuler","send":"Envoyer","shareToFriends":"Partage avec ses amis","publicAsBlog":"Publier en tant que blog","cancelPublic":"Annuler la publication","move":"Déplacer","copy":"Copier","rename":"Renommer","addChildNotebook":"Ajouer un bloc-note enfant","deleteAllShared":"Effacer l'utilisateur partagé","deleteSharedNotebook":"Effacer le bloc-notes partagé","copyToMyNotebook":"Copier vers mon bloc-notes","checkEmail":"Vérifier courriel","sendVerifiedEmail":"Envoyer le courriel de confirmation","defaulthhare":"Par défaut","friendEmail":"Courriel de l'ami","readOnly":"Lecture seule","writable":"Editable","inputFriendEmail":"Le courriel de votre ami est requis/","clickToChangePermission":"Cliquez pour changer l'autorisation.","sendInviteEmailToYourFriend":"Envoyer un courriel d'invitation à votre ami.","friendNotExits":"Votre ami n'a pas de compte %s, lien d'invitation à s'enregistrer: %s","emailBodyRequired":"Corps du message requis","sendSuccess":"succès","inviteEmailBody":"Coucou, je suis %s, %s est génial, viens!","historiesNum":"Nous avons enregistré au maximum <b>10</b> historiques récents de chaque note.","noHistories":"Pas d'historique.","fold":"Plier","unfold":"Déplier","datetime":"Date & Heure","restoreFromThisVersion":"Restaurer depuis cette version","confirmBackup":"Êtes-vous sûr de vouloir restaurer depuis cette version? Nous allons réaliser une copie de sauvegarde de la note actuelle.","createAccountSuccess":"Compte créé avec succès","createAccountFailed":"Echec de la création du compte","updateUsernameSuccess":"Mise à jour du nom d'utilisateur réussie","usernameIsExisted":"Le nom d'utilisateur existe déjà.","noSpecialChars":"le nom d'utilisateur ne peut pas contenir de caractères spéciaux","minLength":"La longueur doit être d'au moins %s","errorEmail":"Veuillez renseigner le courriel correct","verifiedEmaiHasSent":"Le courriel de confirmation a été envoyé, veuillez surveiller votre boite de réception.","emailSendFailed":"Envoi du courriel échoué.","inputNewPassword":"Le nouveau mot de passe est requis.","errorPassword":"La taille du mot de passe est d'au moins 6 caractères et aussi complexe que possible.","updatePasswordSuccess":"Mises à jour du mot de passe réussie."};function getMsg(key, data) {var msg = MSG[key];if(msg) {if(data) {if(!isArray(data)) {data = [data];}for(var i = 0; i < data.length; ++i) {msg = msg.replace("%s", data[i]);}}return msg;}return key;}
|
||||||
@@ -1 +1 @@
|
|||||||
var MSG={"app":"Leanote","share":"分享","noTag":"无标签","inputEmail":"请输入Email","history":"历史记录","editorTips":"帮助","editorTipsInfo":"<h4>1. 快捷键</h4>ctrl+shift+c 代码块切换 <h4>2. shift+enter 跳出当前区域</h4>比如在代码块中<img src=\"/images/outofcode.png\" style=\"width: 90px\"/>按shift+enter可跳出当前代码块.","all":"最新","trash":"废纸篓","delete":"删除","unTitled":"无标题","defaultShare":"默认分享","writingMode":"写作模式","normalMode":"普通模式","saving":"正在保存","saveSuccess":"保存成功","Are you sure to delete it ?":"确认删除?","Insert link into content":"将附件链接插入到内容中","Download":"下载","Delete":"删除","update":"更新","Update Time":"更新时间","Create Time":"创建时间","Post Url":"博文链接","close":"关闭","cancel":"取消","send":"发送","shareToFriends":"分享给好友","publicAsBlog":"公开为博客","cancelPublic":"取消公开为博客","move":"移动","copy":"复制","rename":"重命名","exportPdf":"导出PDF","addChildNotebook":"添加子笔记本","deleteAllShared":"删除所有共享","deleteSharedNotebook":"删除共享笔记本","copyToMyNotebook":"复制到我的笔记本","sendSuccess":"发送成功","friendEmail":"好友邮箱","readOnly":"只读","writable":"可写","inputFriendEmail":"请输入好友邮箱","clickToChangePermission":"点击改变权限","sendInviteEmailToYourFriend":"发送邀请email给Ta","friendNotExits":"该用户还没有注册%s, 复制邀请链接发送给Ta, 邀请链接: %s","emailBodyRequired":"邮件内容不能为空","inviteEmailBody":"Hi, 你好, 我是%s, %s非常好用, 快来注册吧!","historiesNum":"leanote会保存笔记的最近<b>10</b>份历史记录","noHistories":"无历史记录","datetime":"日期","restoreFromThisVersion":"从该版本还原","confirmBackup":"确定要从该版还原? 还原前leanote会备份当前版本到历史记录中.","errorEmail":"请输入正确的email","Hyperlink":"超链接","Please provide the link URL and an optional title":"请填写链接和一个可选的标题","optional title":"可选标题","Cancel":"取消","Strong":"粗体","strong text":"粗体","Emphasis":"斜体","emphasized text":"斜体","Blockquote":"引用","Code Sample":"代码","enter code here":"代码","Image":"图片","Heading":"标题","Numbered List":"有序列表","Bulleted List":"无序列表","List item":"项目","Horizontal Rule":"水平线","Undo":"撤销","Redo":"重做","enter image description here":"图片标题","enter link description here":"链接标题","Add Album":"添加相册","Cannot delete default album":"不能删除默认相册","Cannot rename default album":"不能重命名默认相册","Rename Album":"重命名","Add Success!":"添加成功!","Rename Success!":"重命名成功!","Delete Success!":"删除成功","Are you sure to delete this image ?":"确定删除该图片?","click to remove this image":"删除图片","error":"错误","Error":"错误","Prev":"上一页","Next":"下一页"};function getMsg(key, data) {var msg = MSG[key];if(msg) {if(data) {if(!isArray(data)) {data = [data];}for(var i = 0; i < data.length; ++i) {msg = msg.replace("%s", data[i]);}}return msg;}return key;}
|
var MSG={"app":"Leanote","share":"分享","noTag":"无标签","inputUsername":"请输入用户名","inputEmail":"请输入Email","inputPassword":"请输入密码","inputPassword2":"请输入确认密码","confirmPassword":"两次密码输入不正确","history":"历史记录","editorTips":"帮助","editorTipsInfo":"<h4>1. 快捷键</h4>ctrl+shift+c 代码块切换 <h4>2. shift+enter 跳出当前区域</h4>比如在代码块中<img src=\"/images/outofcode.png\" style=\"width: 90px\"/>按shift+enter可跳出当前代码块.","all":"最新","trash":"废纸篓","delete":"删除","unTitled":"无标题","defaultShare":"默认分享","writingMode":"写作模式","normalMode":"普通模式","saving":"正在保存","saveSuccess":"保存成功","Are you sure to delete it ?":"确认删除?","Insert link into content":"将附件链接插入到内容中","Download":"下载","Delete":"删除","update":"更新","Update Time":"更新时间","Create Time":"创建时间","Post Url":"博文链接","close":"关闭","cancel":"取消","send":"发送","shareToFriends":"分享给好友","publicAsBlog":"公开为博客","cancelPublic":"取消公开为博客","move":"移动","copy":"复制","rename":"重命名","exportPdf":"导出PDF","addChildNotebook":"添加子笔记本","deleteAllShared":"删除所有共享","deleteSharedNotebook":"删除共享笔记本","copyToMyNotebook":"复制到我的笔记本","checkEmail":"查看邮件","sendVerifiedEmail":"发送验证邮箱","sendSuccess":"发送成功","sendFailed":"发送失败","friendEmail":"好友邮箱","readOnly":"只读","writable":"可写","inputFriendEmail":"请输入好友邮箱","clickToChangePermission":"点击改变权限","sendInviteEmailToYourFriend":"发送邀请email给Ta","friendNotExits":"该用户还没有注册%s, 复制邀请链接发送给Ta, 邀请链接: %s","emailBodyRequired":"邮件内容不能为空","inviteEmailBody":"Hi, 你好, 我是%s, %s非常好用, 快来注册吧!","historiesNum":"leanote会保存笔记的最近<b>10</b>份历史记录","noHistories":"无历史记录","datetime":"日期","restoreFromThisVersion":"从该版本还原","confirmBackup":"确定要从该版还原? 还原前leanote会备份当前版本到历史记录中.","createAccountSuccess":"帐号创建成功","createAccountFailed":"帐号创建失败","updateUsernameSuccess":"用户名修改成功","usernameIsExisted":"用户名已存在","noSpecialChars":"不能包含特殊字符","minLength":"长度至少为%s","errorEmail":"请输入正确的email","verifiedEmaiHasSent":"验证邮件已发送, 请及时查阅邮件并验证.","emailSendFailed":"邮件发送失败","inputNewPassword":"请输入新密码","errorPassword":"请输入长度不少于6位的密码, 尽量复杂","updatePasswordSuccess":"修改密码成功","Hyperlink":"超链接","Please provide the link URL and an optional title":"请填写链接和一个可选的标题","optional title":"可选标题","Cancel":"取消","Strong":"粗体","strong text":"粗体","Emphasis":"斜体","emphasized text":"斜体","Blockquote":"引用","Code Sample":"代码","enter code here":"代码","Image":"图片","Heading":"标题","Numbered List":"有序列表","Bulleted List":"无序列表","List item":"项目","Horizontal Rule":"水平线","Undo":"撤销","Redo":"重做","enter image description here":"图片标题","enter link description here":"链接标题","Add Album":"添加相册","Cannot delete default album":"不能删除默认相册","Cannot rename default album":"不能重命名默认相册","Rename Album":"重命名","Add Success!":"添加成功!","Rename Success!":"重命名成功!","Delete Success!":"删除成功","Are you sure to delete this image ?":"确定删除该图片?","click to remove this image":"删除图片","error":"错误","Error":"错误","Prev":"上一页","Next":"下一页"};function getMsg(key, data) {var msg = MSG[key];if(msg) {if(data) {if(!isArray(data)) {data = [data];}for(var i = 0; i < data.length; ++i) {msg = msg.replace("%s", data[i]);}}return msg;}return key;}
|
||||||
Vendored
+7
@@ -0,0 +1,7 @@
|
|||||||
|
var requirejs,require,define;!function(ba){function G(e){return"[object Function]"===K.call(e)}function H(e){return"[object Array]"===K.call(e)}function v(e,t){if(e){var i;for(i=0;i<e.length&&(!e[i]||!t(e[i],i,e));i+=1);}}function T(e,t){if(e){var i;for(i=e.length-1;i>-1&&(!e[i]||!t(e[i],i,e));i-=1);}}function t(e,t){return fa.call(e,t)}function m(e,i){return t(e,i)&&e[i]}function B(e,i){for(var n in e)if(t(e,n)&&i(e[n],n))break}function U(e,i,n,r){return i&&B(i,function(i,o){(n||!t(e,o))&&(!r||"object"!=typeof i||!i||H(i)||G(i)||i instanceof RegExp?e[o]=i:(e[o]||(e[o]={}),U(e[o],i,n,r)))}),e}function u(e,t){return function(){return t.apply(e,arguments)}}function ca(e){throw e}function da(e){if(!e)return e;var t=ba;return v(e.split("."),function(e){t=t[e]}),t}function C(e,t,i,n){return t=Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e),t.requireType=e,t.requireModules=n,i&&(t.originalError=i),t}function ga(e){function i(e,t,i){var n,r,o,a,s,u,d,c,t=t&&t.split("/"),f=D.map,p=f&&f["*"];if(e){for(e=e.split("/"),r=e.length-1,D.nodeIdCompat&&Q.test(e[r])&&(e[r]=e[r].replace(Q,"")),"."===e[0].charAt(0)&&t&&(r=t.slice(0,t.length-1),e=r.concat(e)),r=e,o=0;o<r.length;o++)a=r[o],"."===a?(r.splice(o,1),o-=1):".."===a&&0!==o&&(1!=o||".."!==r[2])&&".."!==r[o-1]&&o>0&&(r.splice(o-1,2),o-=2);e=e.join("/")}if(i&&f&&(t||p)){r=e.split("/"),o=r.length;e:for(;o>0;o-=1){if(s=r.slice(0,o).join("/"),t)for(a=t.length;a>0;a-=1)if((i=m(f,t.slice(0,a).join("/")))&&(i=m(i,s))){n=i,u=o;break e}!d&&p&&m(p,s)&&(d=m(p,s),c=o)}!n&&d&&(n=d,u=c),n&&(r.splice(0,u,n),e=r.join("/"))}return(n=m(D.pkgs,e))?n:e}function n(e){z&&v(document.getElementsByTagName("script"),function(t){return t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===k.contextName?(t.parentNode.removeChild(t),!0):void 0})}function r(e){var t=m(D.paths,e);return t&&H(t)&&1<t.length?(t.shift(),k.require.undef(e),k.makeRequire(null,{skipMap:!0})([e]),!0):void 0}function o(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function a(e,t,n,r){var a,s,u=null,d=t?t.name:null,c=e,f=!0,p="";return e||(f=!1,e="_@r"+(J+=1)),e=o(e),u=e[0],e=e[1],u&&(u=i(u,d,r),s=m(F,u)),e&&(u?p=s&&s.normalize?s.normalize(e,function(e){return i(e,d,r)}):-1===e.indexOf("!")?i(e,d,r):e:(p=i(e,d,r),e=o(p),u=e[0],p=e[1],n=!0,a=k.nameToUrl(p))),n=!u||s||n?"":"_unnormalized"+(P+=1),{prefix:u,name:p,parentMap:t,unnormalized:!!n,url:a,originalName:c,isDefine:f,id:(u?u+"!"+p:p)+n}}function s(e){var t=e.id,i=m(w,t);return i||(i=w[t]=new k.Module(e)),i}function d(e,i,n){var r=e.id,o=m(w,r);!t(F,r)||o&&!o.defineEmitComplete?(o=s(e),o.error&&"error"===i?n(o.error):o.on(i,n)):"defined"===i&&n(F[r])}function c(e,t){var i=e.requireModules,n=!1;t?t(e):(v(i,function(t){(t=m(w,t))&&(t.error=e,t.events.error&&(n=!0,t.emit("error",e)))}),n||g.onError(e))}function f(){R.length&&(ha.apply(O,[O.length,0].concat(R)),R=[])}function p(e){delete w[e],delete A[e]}function l(e,t,i){var n=e.map.id;e.error?e.emit("error",e.error):(t[n]=!0,v(e.depMaps,function(n,r){var o=n.id,a=m(w,o);a&&!e.depMatched[r]&&!i[o]&&(m(t,o)?(e.defineDep(r,F[o]),e.check()):l(a,t,i))}),i[n]=!0)}function h(){var e,t,i=(e=1e3*D.waitSeconds)&&k.startTime+e<(new Date).getTime(),o=[],a=[],s=!1,u=!0;if(!y){if(y=!0,B(A,function(e){var d=e.map,c=d.id;if(e.enabled&&(d.isDefine||a.push(e),!e.error))if(!e.inited&&i)r(c)?s=t=!0:(o.push(c),n(c));else if(!e.inited&&e.fetched&&d.isDefine&&(s=!0,!d.prefix))return u=!1}),i&&o.length)return e=C("timeout","Load timeout for modules: "+o,null,o),e.contextName=k.contextName,c(e);u&&v(a,function(e){l(e,{},{})}),i&&!t||!s||!z&&!ea||S||(S=setTimeout(function(){S=0,h()},50)),y=!1}}function x(e){t(F,e[0])||s(a(e[0],null,!0)).init(e[1],e[2])}function b(e){var e=e.currentTarget||e.srcElement,t=k.onScriptLoad;return e.detachEvent&&!Y?e.detachEvent("onreadystatechange",t):e.removeEventListener("load",t,!1),t=k.onScriptError,(!e.detachEvent||Y)&&e.removeEventListener("error",t,!1),{node:e,id:e&&e.getAttribute("data-requiremodule")}}function q(){var e;for(f();O.length;){if(e=O.shift(),null===e[0])return c(C("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));x(e)}}var y,E,k,j,S,D={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},w={},A={},L={},O=[],F={},I={},_={},J=1,P=1;return j={require:function(e){return e.require?e.require:e.require=k.makeRequire(e.map)},exports:function(e){return e.usingExports=!0,e.map.isDefine?e.exports?F[e.map.id]=e.exports:e.exports=F[e.map.id]={}:void 0},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return m(D.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},E=function(e){this.events=m(L,e.id)||{},this.map=e,this.shim=m(D.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},E.prototype={init:function(e,t,i,n){n=n||{},this.inited||(this.factory=t,i?this.on("error",i):this.events.error&Line truncated
|
||||||
|
(function(){var e=this,n=e._,t={},r=Array.prototype,a=Object.prototype,i=Function.prototype,o=r.push,s=r.slice,l=r.concat,c=a.toString,u=a.hasOwnProperty,p=r.forEach,d=r.map,f=r.reduce,m=r.reduceRight,g=r.filter,h=r.every,v=r.some,b=r.indexOf,w=r.lastIndexOf,x=Array.isArray,y=Object.keys,C=i.bind,k=function(e){return e instanceof k?e:this instanceof k?void(this._wrapped=e):new k(e)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=k),exports._=k):e._=k,k.VERSION="1.5.1";var S=k.each=k.forEach=function(e,n,r){if(null!=e)if(p&&e.forEach===p)e.forEach(n,r);else if(e.length===+e.length){for(var a=0,i=e.length;i>a;a++)if(n.call(r,e[a],a,e)===t)return}else for(var o in e)if(k.has(e,o)&&n.call(r,e[o],o,e)===t)return};k.map=k.collect=function(e,n,t){var r=[];return null==e?r:d&&e.map===d?e.map(n,t):(S(e,function(e,a,i){r.push(n.call(t,e,a,i))}),r)};var _="Reduce of empty array with no initial value";k.reduce=k.foldl=k.inject=function(e,n,t,r){var a=arguments.length>2;if(null==e&&(e=[]),f&&e.reduce===f)return r&&(n=k.bind(n,r)),a?e.reduce(n,t):e.reduce(n);if(S(e,function(e,i,o){a?t=n.call(r,t,e,i,o):(t=e,a=!0)}),!a)throw new TypeError(_);return t},k.reduceRight=k.foldr=function(e,n,t,r){var a=arguments.length>2;if(null==e&&(e=[]),m&&e.reduceRight===m)return r&&(n=k.bind(n,r)),a?e.reduceRight(n,t):e.reduceRight(n);var i=e.length;if(i!==+i){var o=k.keys(e);i=o.length}if(S(e,function(s,l,c){l=o?o[--i]:--i,a?t=n.call(r,t,e[l],l,c):(t=e[l],a=!0)}),!a)throw new TypeError(_);return t},k.find=k.detect=function(e,n,t){var r;return E(e,function(e,a,i){return n.call(t,e,a,i)?(r=e,!0):void 0}),r},k.filter=k.select=function(e,n,t){var r=[];return null==e?r:g&&e.filter===g?e.filter(n,t):(S(e,function(e,a,i){n.call(t,e,a,i)&&r.push(e)}),r)},k.reject=function(e,n,t){return k.filter(e,function(e,r,a){return!n.call(t,e,r,a)},t)},k.every=k.all=function(e,n,r){n||(n=k.identity);var a=!0;return null==e?a:h&&e.every===h?e.every(n,r):(S(e,function(e,i,o){return(a=a&&n.call(r,e,i,o))?void 0:t}),!!a)};var E=k.some=k.any=function(e,n,r){n||(n=k.identity);var a=!1;return null==e?a:v&&e.some===v?e.some(n,r):(S(e,function(e,i,o){return a||(a=n.call(r,e,i,o))?t:void 0}),!!a)};k.contains=k.include=function(e,n){return null==e?!1:b&&e.indexOf===b?-1!=e.indexOf(n):E(e,function(e){return e===n})},k.invoke=function(e,n){var t=s.call(arguments,2),r=k.isFunction(n);return k.map(e,function(e){return(r?n:e[n]).apply(e,t)})},k.pluck=function(e,n){return k.map(e,function(e){return e[n]})},k.where=function(e,n,t){return k.isEmpty(n)?t?void 0:[]:k[t?"find":"filter"](e,function(e){for(var t in n)if(n[t]!==e[t])return!1;return!0})},k.findWhere=function(e,n){return k.where(e,n,!0)},k.max=function(e,n,t){if(!n&&k.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!n&&k.isEmpty(e))return-1/0;var r={computed:-1/0,value:-1/0};return S(e,function(e,a,i){var o=n?n.call(t,e,a,i):e;o>r.computed&&(r={value:e,computed:o})}),r.value},k.min=function(e,n,t){if(!n&&k.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!n&&k.isEmpty(e))return 1/0;var r={computed:1/0,value:1/0};return S(e,function(e,a,i){var o=n?n.call(t,e,a,i):e;o<r.computed&&(r={value:e,computed:o})}),r.value},k.shuffle=function(e){var n,t=0,r=[];return S(e,function(e){n=k.random(t++),r[t-1]=r[n],r[n]=e}),r};var I=function(e){return k.isFunction(e)?e:function(n){return n[e]}};k.sortBy=function(e,n,t){var r=I(n);return k.pluck(k.map(e,function(e,n,a){return{value:e,index:n,criteria:r.call(t,e,n,a)}}).sort(function(e,n){var t=e.criteria,r=n.criteria;if(t!==r){if(t>r||void 0===t)return 1;if(r>t||void 0===r)return-1}return e.index<n.index?-1:1}),"value")};var T=function(e,n,t,r){var a={},i=I(null==n?k.identity:n);return S(e,function(n,o){var s=i.call(t,n,o,e);r(a,s,n)}),a};k.groupBy=function(e,n,t){return T(e,n,t,function(e,n,t){(k.has(e,n)?e[n]:e[n]=[]).push(t)})},k.countBy=function(e,n,t){return T(e,n,t,function(e,n){k.has(e,n)||(e[n]=0),e[n]++})},k.sortedIndex=function(e,n,t,r){t=null==t?k.identity:I(t);for(var a=t.call(r,n),i=0,o=e.length;o>i;){var s=i+o>>>1;t.call(r,e[s])<a?i=s+1:o=s}return i},k.toArray=function(e){return e?k.isArray(e)?s.call(e):e.length===+e.length?k.map(e,k.identity):k.values(e):[]},k.size=function(e){return null==e?0:e.length===+e.length?e.length:k.keys(e).length},k.first=k.head=k.take=function(e,n,t){return null==e?void 0:null==n||t?e[0]:s.call(e,0,n)},k.initial=function(e,n,t){return s.call(e,0,e.length-(null==n||t?1:n))},k.last=function(e,n,t){return null==e?void 0:null==n||t?e[e.length-1]:s.call(e,Math.max(e.length-n,0))},k.rest=k.tail=k.drop=function(e,n,t){return s.call(e,null==n||t?1:n)},k.compact=function(e){return k.filter(e,k.identity)};var M=function(e,n,t){return n&&k.every(e,k.isArray)?l.apply(t,e):(S(e,function(e){k.isArray(e)||k.isArguments(e)?n?o.apply(t,e):M(e,n,t):t.push(e)}),t)};k.flatten=function(e,n){return M(e,n,[])},k.without=function(e){return k.difference(e,s.call(argumLine truncated
|
||||||
|
},{name:"InByzantine_Musical_Symbols",astral:"�[�-�]"},{name:"InCJK_Compatibility",bmp:"㌀-㏿"},{name:"InCJK_Compatibility_Forms",bmp:"︰-﹏"},{name:"InCJK_Compatibility_Ideographs",bmp:"豈-"},{name:"InCJK_Compatibility_Ideographs_Supplement",astral:"�[�-�]"},{name:"InCJK_Radicals_Supplement",bmp:"⺀-"},{name:"InCJK_Strokes",bmp:"㇀-"},{name:"InCJK_Symbols_and_Punctuation",bmp:" -〿"},{name:"InCJK_Unified_Ideographs",bmp:"一-鿿"},{name:"InCJK_Unified_Ideographs_Extension_A",bmp:"㐀-䶿"},{name:"InCJK_Unified_Ideographs_Extension_B",astral:"[�-�][�-�]|�[�-�]"},{name:"InCJK_Unified_Ideographs_Extension_C",astral:"�[�-�]|[�-�][�-�]|�[�-�]"},{name:"InCJK_Unified_Ideographs_Extension_D",astral:"�[�-�]|�[�-�]"},{name:"InCarian",astral:"�[�-�]"},{name:"InChakma",astral:"�[�-�]"},{name:"InCham",bmp:"ꨀ-꩟"},{name:"InCherokee",bmp:"Ꭰ-"},{name:"InCombining_Diacritical_Marks",bmp:"̀-ͯ"},{name:"InCombining_Diacritical_Marks_Supplement",bmp:"᷀-᷿"},{name:"InCombining_Diacritical_Marks_for_Symbols",bmp:"⃐-"},{name:"InCombining_Half_Marks",bmp:"︠-︯"},{name:"InCommon_Indic_Number_Forms",bmp:"꠰-"},{name:"InControl_Pictures",bmp:"␀-"},{name:"InCoptic",bmp:"Ⲁ-⳿"},{name:"InCounting_Rod_Numerals",astral:"�[�-�]"},{name:"InCuneiform",astral:"�[�-�]"},{name:"InCuneiform_Numbers_and_Punctuation",astral:"�[�-�]"},{name:"InCurrency_Symbols",bmp:"₠-"},{name:"InCypriot_Syllabary",astral:"�[�-�]"},{name:"InCyrillic",bmp:"Ѐ-ӿ"},{name:"InCyrillic_Extended_A",bmp:"ⷠ-ⷿ"},{name:"InCyrillic_Extended_B",bmp:"Ꙁ-ꚟ"},{name:"InCyrillic_Supplement",bmp:"Ԁ-ԯ"},{name:"InDeseret",astral:"�[�-�]"},{name:"InDevanagari",bmp:"ऀ-ॿ"},{name:"InDevanagari_Extended",bmp:"꣠-ꣿ"},{name:"InDingbats",bmp:"✀-➿"},{name:"InDomino_Tiles",astral:"�[�-�]"},{name:"InEgyptian_Hieroglyphs",astral:"�[�-�]|�[�-�]"},{name:"InEmoticons",astral:"�[�-�]"},{name:"InEnclosed_Alphanumeric_Supplement",astral:"�[�-�]"},{name:"InEnclosed_Alphanumerics",bmp:"①-⓿"},{name:"InEnclosed_CJK_Letters_and_Months",bmp:"㈀-㋿"},{name:"InEnclosed_Ideographic_Supplement",astral:"�[�-�]"},{name:"InEthiopic",bmp:"ሀ-"},{name:"InEthiopic_Extended",bmp:"ⶀ-"},{name:"InEthiopic_Extended_A",bmp:"-"},{name:"InEthiopic_Supplement",bmp:"ᎀ-"},{name:"InGeneral_Punctuation",bmp:" -"},{name:"InGeometric_Shapes",bmp:"■-◿"},{name:"InGeorgian",bmp:"Ⴀ-ჿ"},{name:"InGeorgian_Supplement",bmp:"ⴀ-"},{name:"InGlagolitic",bmp:"Ⰰ-ⱟ"},{name:"InGothic",astral:"�[�-�]"},{name:"InGreek_Extended",bmp:"ἀ-"},{name:"InGreek_and_Coptic",bmp:"Ͱ-Ͽ"},{name:"InGujarati",bmp:"-૿"},{name:"InGurmukhi",bmp:"-"},{name:"InHalfwidth_and_Fullwidth_Forms",bmp:"-"},{name:"InHangul_Compatibility_Jamo",bmp:"-"},{name:"InHangul_Jamo",bmp:"ᄀ-ᇿ"},{name:"InHangul_Jamo_Extended_A",bmp:"ꥠ-"},{name:"InHangul_Jamo_Extended_B",bmp:"ힰ-"},{name:"InHangul_Syllables",bmp:"가-"},{name:"InHanunoo",bmp:"ᜠ-"},{name:"InHebrew",bmp:"-"},{name:"InHigh_Private_Use_Surrogates",bmp:"�-�"},{name:"InHigh_Surrogates",bmp:"�-�"},{name:"InHiragana",bmp:"-ゟ"},{name:"InIPA_Extensions",bmp:"ɐ-ʯ"},{name:"InIdeographic_Description_Characters",bmp:"⿰-"},{name:"InImperial_Aramaic",astral:"�[�-�]"},{name:"InInscriptional_Pahlavi",astral:"�[�-�]"},{name:"InInscriptional_Parthian",astral:"�[�-�]"},{name:"InJavanese",bmp:"ꦀ-꧟"},{name:"InKaithi",astral:"�[�-�]"},{name:"InKana_Supplement",astral:"�[�-�]"},{name:"InKanbun",bmp:"㆐-㆟"},{name:"InKangxi_Radicals",bmp:"⼀-"},{name:"InKannada",bmp:"ಀ-"},{name:"InKatakana",bmp:"゠-ヿ"},{name:"InKatakana_Phonetic_Extensions",bmp:"ㇰ-ㇿ"},{name:"InKayah_Li",bmp:"꤀-꤯"},{name:"InKharoshthi",astral:"�[�-�]"},{name:"InKhmer",bmp:"ក-"},{name:"InKhmer_Symbols",bmp:"᧠-᧿"},{name:"InLao",bmp:"-"},{name:"InLatin_Extended_Additional",bmp:"Ḁ-ỿ"},{name:"InLatin_Extended_A",bmp:"Ā-ſ"},{name:"InLatin_Extended_B",bmp:"ƀ-ɏ"},{name:"InLatin_Extended_C",bmp:"Ⱡ-Ɀ"},{name:"InLatin_Extended_D",bmp:"꜠-ꟿ"},{name:"InLatin_1_Supplement",bmp:"-ÿ"},{name:"InLepcha",bmp:"ᰀ-ᱏ"},{name:"InLetterlike_Symbols",bmp:"℀-⅏"},{name:"InLimbu",bmp:"ᤀ-᥏"},{name:"InLinear_B_Ideograms",astral:"�[�-�]"},{name:"InLinear_B_Syllabary",astral:"�[�-�]"},{name:"InLisu",bmp:"ꓐ-꓿"},{name:"InLow_Surrogates",bmp:"�-�"},{name:"InLycian",astral:"�[�-�]"},{name:"InLydian",astral:"�[�-�]"},{name:"InMahjong_Tiles",astral:"�[�-�]"},{name:"InMalayalam",bmp:"ഀ-ൿ"},{name:"InMandaic",bmp:"ࡀ-"},{name:"InMathematical_Alphanumeric_Symbols",astral:"�[�-�]"},{name:"InMathematical_Operators",bmp:"∀-⋿"},{name:"InMeetei_Mayek",bmp:"ꯀ-"},{name:"InMeetei_Mayek_Extensions",bmp:"ꫠ-"},{name:"InMeroitic_CurLine truncated
|
||||||
|
if("("===u)++c;else if("\\"===u.charAt(0)){var p=+u.substring(1);p&&(c>=p?s[p]=-1:n[l]=t(p))}}for(var l=1;l<s.length;++l)-1===s[l]&&(s[l]=++i);for(var l=0,c=0;a>l;++l){var u=n[l];if("("===u)++c,s[c]||(n[l]="(?:");else if("\\"===u.charAt(0)){var p=+u.substring(1);p&&c>=p&&(n[l]="\\"+s[p])}}for(var l=0;a>l;++l)"^"===n[l]&&"^"!==n[l+1]&&(n[l]="");if(e.ignoreCase&&o)for(var l=0;a>l;++l){var u=n[l],d=u.charAt(0);u.length>=2&&"["===d?n[l]=r(u):"\\"!==d&&(n[l]=u.replace(/[a-zA-Z]/g,function(e){var n=e.charCodeAt(0);return"["+String.fromCharCode(-33&n,32|n)+"]"}))}return n.join("")}for(var i=0,o=!1,s=!1,l=0,c=e.length;c>l;++l){var u=e[l];if(u.ignoreCase)s=!0;else if(/[a-z]/i.test(u.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){o=!0,s=!1;break}}for(var p={b:8,t:9,n:10,v:11,f:12,r:13},d=[],l=0,c=e.length;c>l;++l){var u=e[l];if(u.global||u.multiline)throw new Error(""+u);d.push("(?:"+a(u)+")")}return new RegExp(d.join("|"),s?"gi":"g")}function n(e,n){function t(e){var l=e.nodeType;if(1==l){if(r.test(e.className))return;for(var c=e.firstChild;c;c=c.nextSibling)t(c);var u=e.nodeName.toLowerCase();("br"===u||"li"===u)&&(a[s]="\n",o[s<<1]=i++,o[s++<<1|1]=e)}else if(3==l||4==l){var p=e.nodeValue;p.length&&(p=n?p.replace(/\r\n?/g,"\n"):p.replace(/[ \t\r\n]+/g," "),a[s]=p,o[s<<1]=i,i+=p.length,o[s++<<1|1]=e)}}var r=/(?:^|\s)nocode(?:\s|$)/,a=[],i=0,o=[],s=0;return t(e),{sourceCode:a.join("").replace(/\n$/,""),spans:o}}function t(e,n,t,r){if(n){var a={sourceCode:n,basePos:e};t(a),r.push.apply(r,a.decorations)}}function r(e){for(var n=void 0,t=e.firstChild;t;t=t.nextSibling){var r=t.nodeType;n=1===r?n?e:t:3===r&&U.test(t.nodeValue)?e:n}return n===e?void 0:n}function a(n,r){var a,i={};!function(){for(var t=n.concat(r),o=[],s={},l=0,c=t.length;c>l;++l){var u=t[l],p=u[3];if(p)for(var d=p.length;--d>=0;)i[p.charAt(d)]=u;var f=u[1],m=""+f;s.hasOwnProperty(m)||(o.push(f),s[m]=null)}o.push(/[\0-\uffff]/),a=e(o)}();var o=r.length,s=function(e){for(var n=e.sourceCode,l=e.basePos,u=[l,P],p=0,d=n.match(a)||[],f={},m=0,g=d.length;g>m;++m){var h,v=d[m],b=f[v],w=void 0;if("string"==typeof b)h=!1;else{var x=i[v.charAt(0)];if(x)w=v.match(x[1]),b=x[0];else{for(var y=0;o>y;++y)if(x=r[y],w=v.match(x[1])){b=x[0];break}w||(b=P)}h=b.length>=5&&"lang-"===b.substring(0,5),!h||w&&"string"==typeof w[1]||(h=!1,b=O),h||(f[v]=b)}var C=p;if(p+=v.length,h){var k=w[1],S=v.indexOf(k),_=S+k.length;w[2]&&(_=v.length-w[2].length,S=_-k.length);var E=b.substring(5);t(l+C,v.substring(0,S),s,u),t(l+C+S,k,c(E,k),u),t(l+C+_,v.substring(_),s,u)}else u.push(l+C,b)}e.decorations=u};return s}function i(e){var n=[],t=[];n.push(e.tripleQuotedStrings?[M,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""]:e.multiLineStrings?[M,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]:[M,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]),e.verbatimStrings&&t.push([M,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var r=e.hashComments;r&&(e.cStyleComments?(n.push(r>1?[L,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]:[L,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),t.push([M,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):n.push([L,/^#[^\r\n]*/,null,"#"])),e.cStyleComments&&(t.push([L,/^\/\/[^\r\n]*/,null]),t.push([L,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var i=e.regexLiterals;if(i){var o=i>1?"":"\n\r",s=o?".":"[\\S\\s]",l="/(?=[^/*"+o+"])(?:[^/\\x5B\\x5C"+o+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+o+"]|\\x5C"+s+")*(?:\\x5D|$))+/";t.push(["lang-regex",RegExp("^"+q+"("+l+")")])}var c=e.types;c&&t.push([A,c]);var u=(""+e.keywords).replace(/^ | $/g,"");u.length&&t.push([$,new RegExp("^(?:"+u.replace(/[\s,]+/g,"|")+")\\b"),null]),n.push([P,/^\s+/,null," \r\n "]);var p="^.[^\\s\\w.$@'\"`/\\\\]*";return e.regexLiterals&&(p+="(?!s*/)"),t.push([R,/^@[a-z_$][a-z_$@0-9]*/i,null],[A,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[P,/^[a-z_$][a-z_$@0-9]*/i,null],[R,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[P,/^\\[\s\S]?/,null],[N,new RegExp(p),null]),a(n,t)}function o(e,n,t){function r(e){var n=e.nodeType;if(1!=n||i.test(e.className)){if((3==n||4==n)&&t){var l=e.nodeValue,c=l.match(o);if(c){var u=l.substring(0,c.index);e.nodeValue=u;var p=l.substring(c.index+c[0].length);if(p){var d=e.parentNode;d.insertBefore(s.createTextNode(p),e.nextSibling)}a(e),u||e.parentNode.removeChild(e)}}}else if("br"===e.nodeName)a(e),e.parentNode&&e.parentNode.removeChild(e);else for(var f=e.firstChild;f;f=f.nextSibling)r(f)}function a(e){function n(e,t){var r=t?e.cloneNode(!1):e,a=e.parentNode;if(a){var i=n(a,1),o=e.nextSibling;i.appendChild(r);for(var s=o;s;s=o)o=s.nextSibling,i.appendChild(Line truncated
|
||||||
|
var l=function(e){return o.strings[e]||g[e]};t=t||"";var c=this.hooks=new Markdown.HookCollection;c.addNoop("onPreviewRefresh"),c.addNoop("postBlockquoteCreation"),c.addFalse("insertImageDialog"),c.addFalse("insertLinkDialog"),this.getConverter=function(){return e};var u,p,d=this;this.run=function(s,f){if(!u){u=new n(t,s);var m,g=new i(c,l),v=new r(e,u,function(){c.onPreviewRefresh()},f),b=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),w="mac"==b,x=function(e){var n=h[e][w?"mac":"win"],t=n.indexOf("|");return n.substring(0,t>0?t:n.length)};m=new a(t,u,p,v,g,o.helpButton,l,x),m.setUndoRedoButtonStates();var y=d.refreshPreview=function(){v.refresh(!0)};y(),d.uiManager=m}}},e.prototype.findTags=function(e,n){var t,r=this;e&&(t=s.extendRegExp(e,"","$"),this.before=this.before.replace(t,function(e){return r.startTag=r.startTag+e,""}),t=s.extendRegExp(e,"^",""),this.selection=this.selection.replace(t,function(e){return r.startTag=r.startTag+e,""})),n&&(t=s.extendRegExp(n,"","$"),this.selection=this.selection.replace(t,function(e){return r.endTag=e+r.endTag,""}),t=s.extendRegExp(n,"^",""),this.after=this.after.replace(t,function(e){return r.endTag=e+r.endTag,""}))},e.prototype.trimWhitespace=function(e){var n,t,r=this;e?n=t="":(n=function(e){return r.before+=e,""},t=function(e){return r.after=e+r.after,""}),this.selection=this.selection.replace(/^(\s*)/,n).replace(/(\s*)$/,t)},e.prototype.skipLines=function(e,n,t){void 0===e&&(e=1),void 0===n&&(n=1),e++,n++;var r,a;if(navigator.userAgent.match(/Chrome/)&&"X".match(/()./),this.selection=this.selection.replace(/(^\n*)/,""),this.startTag=this.startTag+p.$1,this.selection=this.selection.replace(/(\n*$)/,""),this.endTag=this.endTag+p.$1,this.startTag=this.startTag.replace(/(^\n*)/,""),this.before=this.before+p.$1,this.endTag=this.endTag.replace(/(\n*$)/,""),this.after=this.after+p.$1,this.before){for(r=a="";e--;)r+="\\n?",a+="\n";t&&(r="\\n*"),this.before=this.before.replace(new p(r+"$",""),a)}if(this.after){for(r=a="";n--;)r+="\\n?",a+="\n";t&&(r="\\n*"),this.after=this.after.replace(new p(r,""),a)}},s.isVisible=function(e){return window.getComputedStyle?"none"!==window.getComputedStyle(e,null).getPropertyValue("display"):e.currentStyle?"none"!==e.currentStyle.display:void 0},s.addEvent=function(e,n,t){e.attachEvent?e.attachEvent("on"+n,t):e.addEventListener(n,t,!1)},s.removeEvent=function(e,n,t){e.detachEvent?e.detachEvent("on"+n,t):e.removeEventListener(n,t,!1)},s.fixEolChars=function(e){return e=e.replace(/\r\n/g,"\n"),e=e.replace(/\r/g,"\n")},s.extendRegExp=function(e,n,t){(null===n||void 0===n)&&(n=""),(null===t||void 0===t)&&(t="");var r,a=e.toString();return a=a.replace(/\/([gim]*)$/,function(e,n){return r=n,""}),a=a.replace(/(^\/|\/$)/g,""),a=n+a+t,new p(a,r)},l.getTop=function(e,n){var t=e.offsetTop;if(!n)for(;e=e.offsetParent;)t+=e.offsetTop;return t},l.getHeight=function(e){return e.offsetHeight||e.scrollHeight},l.getWidth=function(e){return e.offsetWidth||e.scrollWidth},l.getPageSize=function(){var e,n,t,r;self.innerHeight&&self.scrollMaxY?(e=u.body.scrollWidth,n=self.innerHeight+self.scrollMaxY):u.body.scrollHeight>u.body.offsetHeight?(e=u.body.scrollWidth,n=u.body.scrollHeight):(e=u.body.offsetWidth,n=u.body.offsetHeight),self.innerHeight?(t=self.innerWidth,r=self.innerHeight):u.documentElement&&u.documentElement.clientHeight?(t=u.documentElement.clientWidth,r=u.documentElement.clientHeight):u.body&&(t=u.body.clientWidth,r=u.body.clientHeight);var a=Math.max(e,t),i=Math.max(n,r);return[a,i,t,r]},c.createBackground=function(){var e=u.createElement("div"),n=e.style;e.className="wmd-prompt-background",n.position="absolute",n.top="0",n.zIndex="1000",m.isIE?n.filter="alpha(opacity=50)":n.opacity="0.5";var t=l.getPageSize();return n.height=t[1]+"px",m.isIE?(n.left=u.documentElement.scrollLeft,n.width=u.documentElement.clientWidth):(n.left="0",n.width="100%"),u.body.appendChild(e),e},c.prompt=function(e,n,t){var r,a;void 0===n&&(n="");var i=function(e){var n=e.charCode||e.keyCode;27===n&&o(!0)},o=function(e){s.removeEvent(u.body,"keydown",i);var n=a.value;return e?n=null:(n=n.replace(/^http:\/\/(https?|ftp):\/\//,"$1://"),/^(?:https?|ftp):\/\//.test(n)||(n="http://"+n)),r.parentNode.removeChild(r),t(n),!1},c=function(){r=u.createElement("div"),r.className="wmd-prompt-dialog",r.style.padding="10px;",r.style.position="fixed",r.style.width="400px",r.style.zIndex="1001";var t=u.createElement("div");t.innerHTML=e,t.style.padding="5px",r.appendChild(t);var c=u.createElement("form"),p=c.style;c.onsubmit=function(){return o(!1)},p.padding="0",p.margin="0",p.cssFloat="left",p.width="100%",p.textAlign="center",p.position="relative",r.appendChild(c),a=u.createElement("input"),a.type="text",a.value=n,p=a.style,p.display="block",p.width="80%",p.marginLeft=p.marginRight="auto",c.appendChild(a);var d=u.createElement("input");d.type="button",d.onclick=function(){return o(!1)},d.value="OK",p=d.style,p.margin="10px",p.display="inline",p.width="7em";varLine truncated
|
||||||
|
return"fenced_code_gfm"==e})&&(i="^```.*\\n[\\s\\S]*?\\n```|"+i),t.enabled&&(i="^[ \\t]*\\n\\$\\$[\\s\\S]*?\\$\\$|"+i,i="^[ \\t]*\\n\\\\\\\\[[\\s\\S]*?\\\\\\\\]|"+i,i="^[ \\t]*\\n\\\\?\\\\begin\\{[a-z]*\\*?\\}[\\s\\S]*?\\\\end\\{[a-z]*\\*?\\}|"+i),i=new RegExp(i,"gm");var o=r.getConverter();o.hooks.chain("preConversion",function(n){function t(e,n){var t=r.substring(s,n);o.push({text:t,textWithDelimiter:'\n<div class="se-section-delimiter"></div>\n\n'+t+"\n"})}a.previewStartTime=new Date;var r=n+"\n\n",o=[],s=0;return r.replace(i,function(e,n){t(s,n),s=n}),t(s,n.length),a.onSectionsCreated(o),e.reduce(o,function(e,n){return e+n.textWithDelimiter},"")})},i}),define("extensions/partialRendering",["underscore","crel","extensions/markdownExtra","classes/Extension"],function(e,n,t,r){function a(n,t){if(m=[],f=[],c=void 0,g===!0||l!=t)return g=!1,l=t,f=d,d=n,void(m=n);var r=d.length;e.some(d,function(e,t){return t>=n.length||e.text!=n[t].text?(r=t,!0):void 0});var a=-d.length;e.some(d.slice().reverse(),function(e,t){return t>=n.length||e.text!=n[n.length-t-1].text?(a=-t,!0):void 0}),r-a>d.length&&(a=r-d.length);var i=d.slice(0,r);m=n.slice(r,n.length+a);var o=d.slice(d.length+a,d.length);c=e.first(o),f=d.slice(r,d.length+a),d=i.concat(m).concat(o)}function i(e){var n=e.id.substring(3);x[n]=e}function o(){function t(t){for(var r=n("div",{id:"wmd-preview-section-"+t.id,"class":"wmd-preview-section preview-content"}),o=!1;a;){var s=a.nextSibling;if(o===!0&&"DIV"==a.tagName&&"se-section-delimiter"==a.className)break;o=!0,"DIV"==a.tagName&&"footnotes"==a.className?e.each(a.querySelectorAll("ol > li"),i):r.appendChild(a),a=s}return r}e.each(f,function(e){var n=document.getElementById("wmd-preview-section-"+e.id);w.removeChild(n)});var r=document.getElementById("wmd-preview"),a=r.firstChild,o=document.createDocumentFragment();e.each(m,function(e){o.appendChild(t(e))}),r.innerHTML="";var s=b;void 0!==c&&(s=document.getElementById("wmd-preview-section-"+c.id)),w.insertBefore(o,s),b.innerHTML="";var l=[];if(v===!0){var u=n("ol");e.each(w.querySelectorAll("a.footnote"),function(e,n){e.textContent=n+1;var t=e.id.substring(6);l.push(t),u.appendChild(x[t].cloneNode(!0))}),l.length>0&&b.appendChild(n("div",{"class":"footnotes"},n("hr"),u)),x=e.pick(x,l)}}var s,l,c,u=new r("partialRendering","Partial Rendering",!0),p=0,d=[],f=[],m=[],g=!1,h=!1,v=!1;u.onSectionsCreated=function(n){var t=[],r="\n";v=!1,e.each(n,function(e){var n=e.textWithDelimiter+"\n";h&&(n=n.replace(/^```.*\n[\s\S]*?\n```|\n[ ]{0,3}\[\^(.+?)\]\:[ \t]*\n?([\s\S]*?)\n{1,2}((?=\n[ ]{0,3}\S)|$)/gm,function(e,n){return n?(v=!0,r+=e.replace(/^\s*\n/gm,"")+"\n",""):e})),n=n.replace(/^```.*\n[\s\S]*?\n```|^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm,function(e,n){return n?(r+=e.replace(/^\s*\n/gm,"")+"\n",""):e}),t.push({id:++p,text:n+"\n"})}),a(t,r)};var b,w,x={};return u.onPagedownConfigure=function(n){s=n.getConverter(),s.hooks.chain("preConversion",function(){var n=e.map(m,function(e){return e.text});return n.push(l+"\n\n"),n.join("")}),n.hooks.chain("onPreviewRefresh",function(){o()})},u.onInit=function(){t.enabled&&e.some(t.config.extensions,function(e){return"footnotes"==e})&&(h=!0)},u.onReady=function(){b=n("div",{id:"wmd-preview-section-footnotes","class":"preview-content"}),w=document.getElementById("preview-contents"),w.appendChild(b)},u.onFileSelected=function(){g=!0},u}),define("extensions/umlDiagrams",["require","underscore","utils","classes/Extension","crel"],function(e,n,t,r,a){function i(){var t=l.querySelectorAll(".prettyprint > .language-flow");t&&0!=t.length&&e(["flow-chart"],function(e){n.each(t,function(n){try{var t=e.parse(n.textContent),r=n.parentNode,i=a("div",{"class":"flow-chart"});r.parentNode.replaceChild(i,r),t.drawSVG(i,JSON.parse(s.config.flowchartOptions))}catch(o){console.error(o)}})})}function o(){var t=l.querySelectorAll(".prettyprint > .language-sequence");t&&0!=t.length&&e(["Diagram"],function(e){n.each(t,function(n){try{var t=e.parse(n.textContent),r=n.parentNode,i=a("div",{"class":"sequence-diagram"});r.parentNode.replaceChild(i,r),t.drawSVG(i,{theme:"simple"})}catch(o){console.error(o)}})})}function i(){var t=l.querySelectorAll(".prettyprint > .language-flow");t&&0!=t.length&&e(["flow-chart"],function(e){n.each(t,function(n){try{var t=e.parse(n.textContent),r=n.parentNode,i=a("div",{"class":"flow-chart"});r.parentNode.replaceChild(i,r),t.drawSVG(i,JSON.parse(s.config.flowchartOptions))}catch(o){console.error(o)}})})}var s=new r("umlDiagrams","UML Diagrams",!0);s.defaultConfig={flowchartOptions:["{",' "line-width": 2,',' "font-family": "sans-serif",',' "font-weight": "normal"',"}"].join("\n")};var l=document.getElementById("preview-contents");return s.onPagedownConfigure=function(e){e.hooks.chain("onPreviewRefresh",function(){o(),i()})},s}),define("extensions/toc",["underscore","utils","classes/Extension"],function(e,n,t){function r(e,n,t){this.tagName=e,this.anchorLine truncated
|
||||||
|
this.before=this.before+d.$1,this.endTag=this.endTag.replace(/(\n*$)/,""),this.after=this.after+d.$1,this.before){for(r=a="";e--;)r+="\\n?",a+="\n";t&&(r="\\n*"),this.before=this.before.replace(new d(r+"$",""),a)}if(this.after){for(r=a="";n--;)r+="\\n?",a+="\n";t&&(r="\\n*"),this.after=this.after.replace(new d(r,""),a)}},l.isVisible=function(e){return window.getComputedStyle?"none"!==window.getComputedStyle(e,null).getPropertyValue("display"):e.currentStyle?"none"!==e.currentStyle.display:void 0},l.addEvent=function(e,n,t){e.attachEvent?e.attachEvent("on"+n,t):e.addEventListener(n,t,!1)},l.removeEvent=function(e,n,t){e.detachEvent?e.detachEvent("on"+n,t):e.removeEventListener(n,t,!1)},l.fixEolChars=function(e){return e=e.replace(/\r\n/g,"\n"),e=e.replace(/\r/g,"\n")},l.extendRegExp=function(e,n,t){(null===n||void 0===n)&&(n=""),(null===t||void 0===t)&&(t="");var r,a=e.toString();return a=a.replace(/\/([gim]*)$/,function(e,n){return r=n,""}),a=a.replace(/(^\/|\/$)/g,""),a=n+a+t,new d(a,r)},c.getTop=function(e,n){var t=e.offsetTop;if(!n)for(;e=e.offsetParent;)t+=e.offsetTop;return t},c.getHeight=function(e){return e.offsetHeight||e.scrollHeight},c.getWidth=function(e){return e.offsetWidth||e.scrollWidth},c.getPageSize=function(){var e,n,t,r;self.innerHeight&&self.scrollMaxY?(e=p.body.scrollWidth,n=self.innerHeight+self.scrollMaxY):p.body.scrollHeight>p.body.offsetHeight?(e=p.body.scrollWidth,n=p.body.scrollHeight):(e=p.body.offsetWidth,n=p.body.offsetHeight),self.innerHeight?(t=self.innerWidth,r=self.innerHeight):p.documentElement&&p.documentElement.clientHeight?(t=p.documentElement.clientWidth,r=p.documentElement.clientHeight):p.body&&(t=p.body.clientWidth,r=p.body.clientHeight);var a=Math.max(e,t),i=Math.max(n,r);return[a,i,t,r]},u.createBackground=function(){var e=p.createElement("div"),n=e.style;e.className="wmd-prompt-background",n.position="absolute",n.top="0",n.zIndex="1000",g.isIE?n.filter="alpha(opacity=50)":n.opacity="0.5";var t=c.getPageSize();return n.height=t[1]+"px",g.isIE?(n.left=p.documentElement.scrollLeft,n.width=p.documentElement.clientWidth):(n.left="0",n.width="100%"),p.body.appendChild(e),e},u.prompt=function(e,n,t){var r,a;void 0===n&&(n="");var i=function(e){var n=e.charCode||e.keyCode;27===n&&o(!0)},o=function(e){l.removeEvent(p.body,"keydown",i);var n=a.value;return e?n=null:(n=n.replace(/^http:\/\/(https?|ftp):\/\//,"$1://"),/^(?:https?|ftp):\/\//.test(n)||(n="http://"+n)),r.parentNode.removeChild(r),t(n),!1},s=function(){r=p.createElement("div"),r.className="wmd-prompt-dialog",r.style.padding="10px;",r.style.position="fixed",r.style.width="400px",r.style.zIndex="1001";var t=p.createElement("div");t.innerHTML=e,t.style.padding="5px",r.appendChild(t);var s=p.createElement("form"),u=s.style;s.onsubmit=function(){return o(!1)},u.padding="0",u.margin="0",u.cssFloat="left",u.width="100%",u.textAlign="center",u.position="relative",r.appendChild(s),a=p.createElement("input"),a.type="text",a.value=n,u=a.style,u.display="block",u.width="80%",u.marginLeft=u.marginRight="auto",s.appendChild(a);var d=p.createElement("input");d.type="button",d.onclick=function(){return o(!1)},d.value="OK",u=d.style,u.margin="10px",u.display="inline",u.width="7em";var f=p.createElement("input");f.type="button",f.onclick=function(){return o(!0)},f.value="Cancel",u=f.style,u.margin="10px",u.display="inline",u.width="7em",s.appendChild(d),s.appendChild(f),l.addEvent(p.body,"keydown",i),r.style.top="50%",r.style.left="50%",r.style.display="block",g.isIE_5or6&&(r.style.position="absolute",r.style.top=p.documentElement.scrollTop+200+"px",r.style.left="50%"),p.body.appendChild(r),r.style.marginTop=-(c.getHeight(r)/2)+"px",r.style.marginLeft=-(c.getWidth(r)/2)+"px"};setTimeout(function(){s();var e=n.length;if(void 0!==a.selectionStart)a.selectionStart=0,a.selectionEnd=e;else if(a.createTextRange){var t=a.createTextRange();t.collapse(!1),t.moveStart("character",-e),t.moveEnd("character",e),t.select()}a.focus()},0)};var w=o.prototype;w.prefixes="(?:\\s{4,}|\\s*>|\\s*-\\s+|\\s*\\d+\\.|=|\\+|-|_|\\*|#|\\s*\\[[^\n]]+\\]:)",w.unwrap=function(e){var n=new d("([^\\n])\\n(?!(\\n|"+this.prefixes+"))","g");e.selection=e.selection.replace(n,"$1 $2")},w.wrap=function(e,n){this.unwrap(e);var t=new d("(.{1,"+n+"})( +|$\\n?)","gm"),r=this;e.selection=e.selection.replace(t,function(e,n){return new d("^"+r.prefixes,"").test(e)?e:n+"\n"}),e.selection=e.selection.replace(/\s+$/,"")},w.doBold=function(e,n){return this.doBorI(e,n,2,this.getString("boldexample"))},w.doItalic=function(e,n){return this.doBorI(e,n,1,this.getString("italicexample"))},w.doBorI=function(e,n,t,r){e.trimWhitespace(),e.selection=e.selection.replace(/\n{2,}/g,"\n");var a=/(\**$)/.exec(e.before)[0],i=/(^\**)/.exec(e.after)[0],o=Math.min(a.length,i.length);if(o>=t&&(2!=o||1!=t))e.before=e.before.replace(d("[*]{"+t+"}$",""),""),e.after=e.after.replace(d("^[*]{"+t+"}",""),"");else if(!e.selection&&i){e.after=e.after.replace(/^([*_]*)/,""),e.before=e.before.replace(/(\s?)$/Line truncated
|
||||||
@@ -16,4 +16,5 @@
|
|||||||
window.ace[key] = a[key];
|
window.ace[key] = a[key];
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
// 以下非ace.js文件里的, 只是markdown编辑器要用, mode-ace_mode.js
|
||||||
|
ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=t.supportType="animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index",u=t.supportFunction="rgb|rgba|url|attr|counter|counters",a=t.supportConstant="absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-blocLine truncated
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=t.supportType="animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index",u=t.supportFunction="rgb|rgba|url|attr|counter|counters",a=t.supportConstant="absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-blocLine truncated
|
||||||
@@ -0,0 +1,778 @@
|
|||||||
|
/** js sequence diagrams
|
||||||
|
* http://bramp.github.io/js-sequence-diagrams/
|
||||||
|
* (c) 2012-2013 Andrew Brampton (bramp.net)
|
||||||
|
* Simplified BSD license.
|
||||||
|
*/
|
||||||
|
(function () {
|
||||||
|
"use strict";
|
||||||
|
/*global grammar _ */
|
||||||
|
|
||||||
|
function Diagram() {
|
||||||
|
this.title = undefined;
|
||||||
|
this.actors = [];
|
||||||
|
this.signals = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
Diagram.prototype.getActor = function(alias) {
|
||||||
|
var s = /^(.+) as (\S+)$/i.exec(alias.trim());
|
||||||
|
if (s) {
|
||||||
|
name = s[1].trim();
|
||||||
|
alias = s[2].trim();
|
||||||
|
} else {
|
||||||
|
name = alias.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
name = name.replace(/\\n/gm, "\n");
|
||||||
|
|
||||||
|
var i, actors = this.actors;
|
||||||
|
for (i in actors) {
|
||||||
|
if (actors[i].alias == alias)
|
||||||
|
return actors[i];
|
||||||
|
}
|
||||||
|
i = actors.push( new Diagram.Actor(alias, name, actors.length) );
|
||||||
|
return actors[ i - 1 ];
|
||||||
|
};
|
||||||
|
|
||||||
|
Diagram.prototype.setTitle = function(title) {
|
||||||
|
this.title = title;
|
||||||
|
};
|
||||||
|
|
||||||
|
Diagram.prototype.addSignal = function(signal) {
|
||||||
|
this.signals.push( signal );
|
||||||
|
};
|
||||||
|
|
||||||
|
Diagram.Actor = function(alias, name, index) {
|
||||||
|
this.alias = alias;
|
||||||
|
this.name = name;
|
||||||
|
this.index = index;
|
||||||
|
};
|
||||||
|
|
||||||
|
Diagram.Signal = function(actorA, signaltype, actorB, message) {
|
||||||
|
this.type = "Signal";
|
||||||
|
this.actorA = actorA;
|
||||||
|
this.actorB = actorB;
|
||||||
|
this.linetype = signaltype & 3;
|
||||||
|
this.arrowtype = (signaltype >> 2) & 3;
|
||||||
|
this.message = message;
|
||||||
|
};
|
||||||
|
|
||||||
|
Diagram.Signal.prototype.isSelf = function() {
|
||||||
|
return this.actorA.index == this.actorB.index;
|
||||||
|
};
|
||||||
|
|
||||||
|
Diagram.Note = function(actor, placement, message) {
|
||||||
|
this.type = "Note";
|
||||||
|
this.actor = actor;
|
||||||
|
this.placement = placement;
|
||||||
|
this.message = message;
|
||||||
|
|
||||||
|
if (this.hasManyActors() && actor[0] == actor[1]) {
|
||||||
|
throw new Error("Note should be over two different actors");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Diagram.Note.prototype.hasManyActors = function() {
|
||||||
|
return _.isArray(this.actor);
|
||||||
|
};
|
||||||
|
|
||||||
|
Diagram.LINETYPE = {
|
||||||
|
SOLID : 0,
|
||||||
|
DOTTED : 1
|
||||||
|
};
|
||||||
|
|
||||||
|
Diagram.ARROWTYPE = {
|
||||||
|
FILLED : 0,
|
||||||
|
OPEN : 1
|
||||||
|
};
|
||||||
|
|
||||||
|
Diagram.PLACEMENT = {
|
||||||
|
LEFTOF : 0,
|
||||||
|
RIGHTOF : 1,
|
||||||
|
OVER : 2
|
||||||
|
};
|
||||||
|
|
||||||
|
/** The following is included by jspp */
|
||||||
|
/* parser generated by jison 0.4.6 */
|
||||||
|
/*
|
||||||
|
Returns a Parser object of the following structure:
|
||||||
|
|
||||||
|
Parser: {
|
||||||
|
yy: {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Parser.prototype: {
|
||||||
|
yy: {},
|
||||||
|
trace: function(),
|
||||||
|
symbols_: {associative list: name ==> number},
|
||||||
|
terminals_: {associative list: number ==> name},
|
||||||
|
productions_: [...],
|
||||||
|
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
|
||||||
|
table: [...],
|
||||||
|
defaultActions: {...},
|
||||||
|
parseError: function(str, hash),
|
||||||
|
parse: function(input),
|
||||||
|
|
||||||
|
lexer: {
|
||||||
|
EOF: 1,
|
||||||
|
parseError: function(str, hash),
|
||||||
|
setInput: function(input),
|
||||||
|
input: function(),
|
||||||
|
unput: function(str),
|
||||||
|
more: function(),
|
||||||
|
less: function(n),
|
||||||
|
pastInput: function(),
|
||||||
|
upcomingInput: function(),
|
||||||
|
showPosition: function(),
|
||||||
|
test_match: function(regex_match_array, rule_index),
|
||||||
|
next: function(),
|
||||||
|
lex: function(),
|
||||||
|
begin: function(condition),
|
||||||
|
popState: function(),
|
||||||
|
_currentRules: function(),
|
||||||
|
topState: function(),
|
||||||
|
pushState: function(condition),
|
||||||
|
|
||||||
|
options: {
|
||||||
|
ranges: boolean (optional: true ==> token location info will include a .range[] member)
|
||||||
|
flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
|
||||||
|
backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
|
||||||
|
},
|
||||||
|
|
||||||
|
performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
|
||||||
|
rules: [...],
|
||||||
|
conditions: {associative list: name ==> set},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
token location info (@$, _$, etc.): {
|
||||||
|
first_line: n,
|
||||||
|
last_line: n,
|
||||||
|
first_column: n,
|
||||||
|
last_column: n,
|
||||||
|
range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
the parseError function receives a 'hash' object with these members for lexer and parser errors: {
|
||||||
|
text: (matched text)
|
||||||
|
token: (the produced terminal token, if any)
|
||||||
|
line: (yylineno)
|
||||||
|
}
|
||||||
|
while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
|
||||||
|
loc: (yylloc)
|
||||||
|
expected: (string describing the set of expected tokens)
|
||||||
|
recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
var grammar = (function(){
|
||||||
|
var parser = {trace: function trace() { },
|
||||||
|
yy: {},
|
||||||
|
symbols_: {"error":2,"start":3,"document":4,"EOF":5,"line":6,"statement":7,"NL":8,"participant":9,"actor":10,"signal":11,"note_statement":12,"title":13,"message":14,"note":15,"placement":16,"over":17,"actor_pair":18,",":19,"left_of":20,"right_of":21,"signaltype":22,"ACTOR":23,"linetype":24,"arrowtype":25,"LINE":26,"DOTLINE":27,"ARROW":28,"OPENARROW":29,"MESSAGE":30,"$accept":0,"$end":1},
|
||||||
|
terminals_: {2:"error",5:"EOF",8:"NL",9:"participant",13:"title",15:"note",17:"over",19:",",20:"left_of",21:"right_of",23:"ACTOR",26:"LINE",27:"DOTLINE",28:"ARROW",29:"OPENARROW",30:"MESSAGE"},
|
||||||
|
productions_: [0,[3,2],[4,0],[4,2],[6,1],[6,1],[7,2],[7,1],[7,1],[7,2],[12,4],[12,4],[18,1],[18,3],[16,1],[16,1],[11,4],[10,1],[22,2],[22,1],[24,1],[24,1],[25,1],[25,1],[14,1]],
|
||||||
|
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
||||||
|
/* this == yyval */
|
||||||
|
|
||||||
|
var $0 = $$.length - 1;
|
||||||
|
switch (yystate) {
|
||||||
|
case 1: return yy;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
break;
|
||||||
|
case 6: $$[$0];
|
||||||
|
break;
|
||||||
|
case 7: yy.addSignal($$[$0]);
|
||||||
|
break;
|
||||||
|
case 8: yy.addSignal($$[$0]);
|
||||||
|
break;
|
||||||
|
case 9: yy.setTitle($$[$0]);
|
||||||
|
break;
|
||||||
|
case 10: this.$ = new Diagram.Note($$[$0-1], $$[$0-2], $$[$0]);
|
||||||
|
break;
|
||||||
|
case 11: this.$ = new Diagram.Note($$[$0-1], Diagram.PLACEMENT.OVER, $$[$0]);
|
||||||
|
break;
|
||||||
|
case 12: this.$ = $$[$0];
|
||||||
|
break;
|
||||||
|
case 13: this.$ = [$$[$0-2], $$[$0]];
|
||||||
|
break;
|
||||||
|
case 14: this.$ = Diagram.PLACEMENT.LEFTOF;
|
||||||
|
break;
|
||||||
|
case 15: this.$ = Diagram.PLACEMENT.RIGHTOF;
|
||||||
|
break;
|
||||||
|
case 16: this.$ = new Diagram.Signal($$[$0-3], $$[$0-2], $$[$0-1], $$[$0]);
|
||||||
|
break;
|
||||||
|
case 17: this.$ = yy.getActor($$[$0]);
|
||||||
|
break;
|
||||||
|
case 18: this.$ = $$[$0-1] | ($$[$0] << 2);
|
||||||
|
break;
|
||||||
|
case 19: this.$ = $$[$0];
|
||||||
|
break;
|
||||||
|
case 20: this.$ = Diagram.LINETYPE.SOLID;
|
||||||
|
break;
|
||||||
|
case 21: this.$ = Diagram.LINETYPE.DOTTED;
|
||||||
|
break;
|
||||||
|
case 22: this.$ = Diagram.ARROWTYPE.FILLED;
|
||||||
|
break;
|
||||||
|
case 23: this.$ = Diagram.ARROWTYPE.OPEN;
|
||||||
|
break;
|
||||||
|
case 24: this.$ = $$[$0].substring(1).trim().replace(/\\n/gm, "\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
table: [{3:1,4:2,5:[2,2],8:[2,2],9:[2,2],13:[2,2],15:[2,2],23:[2,2]},{1:[3]},{5:[1,3],6:4,7:5,8:[1,6],9:[1,7],10:11,11:8,12:9,13:[1,10],15:[1,12],23:[1,13]},{1:[2,1]},{5:[2,3],8:[2,3],9:[2,3],13:[2,3],15:[2,3],23:[2,3]},{5:[2,4],8:[2,4],9:[2,4],13:[2,4],15:[2,4],23:[2,4]},{5:[2,5],8:[2,5],9:[2,5],13:[2,5],15:[2,5],23:[2,5]},{10:14,23:[1,13]},{5:[2,7],8:[2,7],9:[2,7],13:[2,7],15:[2,7],23:[2,7]},{5:[2,8],8:[2,8],9:[2,8],13:[2,8],15:[2,8],23:[2,8]},{14:15,30:[1,16]},{22:17,24:18,26:[1,19],27:[1,20]},{16:21,17:[1,22],20:[1,23],21:[1,24]},{5:[2,17],8:[2,17],9:[2,17],13:[2,17],15:[2,17],19:[2,17],23:[2,17],26:[2,17],27:[2,17],30:[2,17]},{5:[2,6],8:[2,6],9:[2,6],13:[2,6],15:[2,6],23:[2,6]},{5:[2,9],8:[2,9],9:[2,9],13:[2,9],15:[2,9],23:[2,9]},{5:[2,24],8:[2,24],9:[2,24],13:[2,24],15:[2,24],23:[2,24]},{10:25,23:[1,13]},{23:[2,19],25:26,28:[1,27],29:[1,28]},{23:[2,20],28:[2,20],29:[2,20]},{23:[2,21],28:[2,21],29:[2,21]},{10:29,23:[1,13]},{10:31,18:30,23:[1,13]},{23:[2,14]},{23:[2,15]},{14:32,30:[1,16]},{23:[2,18]},{23:[2,22]},{23:[2,23]},{14:33,30:[1,16]},{14:34,30:[1,16]},{19:[1,35],30:[2,12]},{5:[2,16],8:[2,16],9:[2,16],13:[2,16],15:[2,16],23:[2,16]},{5:[2,10],8:[2,10],9:[2,10],13:[2,10],15:[2,10],23:[2,10]},{5:[2,11],8:[2,11],9:[2,11],13:[2,11],15:[2,11],23:[2,11]},{10:36,23:[1,13]},{30:[2,13]}],
|
||||||
|
defaultActions: {3:[2,1],23:[2,14],24:[2,15],26:[2,18],27:[2,22],28:[2,23],36:[2,13]},
|
||||||
|
parseError: function parseError(str, hash) {
|
||||||
|
if (hash.recoverable) {
|
||||||
|
this.trace(str);
|
||||||
|
} else {
|
||||||
|
throw new Error(str);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
parse: function parse(input) {
|
||||||
|
var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
|
||||||
|
this.lexer.setInput(input);
|
||||||
|
this.lexer.yy = this.yy;
|
||||||
|
this.yy.lexer = this.lexer;
|
||||||
|
this.yy.parser = this;
|
||||||
|
if (typeof this.lexer.yylloc == 'undefined') {
|
||||||
|
this.lexer.yylloc = {};
|
||||||
|
}
|
||||||
|
var yyloc = this.lexer.yylloc;
|
||||||
|
lstack.push(yyloc);
|
||||||
|
var ranges = this.lexer.options && this.lexer.options.ranges;
|
||||||
|
if (typeof this.yy.parseError === 'function') {
|
||||||
|
this.parseError = this.yy.parseError;
|
||||||
|
} else {
|
||||||
|
this.parseError = Object.getPrototypeOf(this).parseError;
|
||||||
|
}
|
||||||
|
function popStack(n) {
|
||||||
|
stack.length = stack.length - 2 * n;
|
||||||
|
vstack.length = vstack.length - n;
|
||||||
|
lstack.length = lstack.length - n;
|
||||||
|
}
|
||||||
|
function lex() {
|
||||||
|
var token;
|
||||||
|
token = self.lexer.lex() || EOF;
|
||||||
|
if (typeof token !== 'number') {
|
||||||
|
token = self.symbols_[token] || token;
|
||||||
|
}
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
|
||||||
|
while (true) {
|
||||||
|
state = stack[stack.length - 1];
|
||||||
|
if (this.defaultActions[state]) {
|
||||||
|
action = this.defaultActions[state];
|
||||||
|
} else {
|
||||||
|
if (symbol === null || typeof symbol == 'undefined') {
|
||||||
|
symbol = lex();
|
||||||
|
}
|
||||||
|
action = table[state] && table[state][symbol];
|
||||||
|
}
|
||||||
|
if (typeof action === 'undefined' || !action.length || !action[0]) {
|
||||||
|
var errStr = '';
|
||||||
|
expected = [];
|
||||||
|
for (p in table[state]) {
|
||||||
|
if (this.terminals_[p] && p > TERROR) {
|
||||||
|
expected.push('\'' + this.terminals_[p] + '\'');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.lexer.showPosition) {
|
||||||
|
errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + this.lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
|
||||||
|
} else {
|
||||||
|
errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
|
||||||
|
}
|
||||||
|
this.parseError(errStr, {
|
||||||
|
text: this.lexer.match,
|
||||||
|
token: this.terminals_[symbol] || symbol,
|
||||||
|
line: this.lexer.yylineno,
|
||||||
|
loc: yyloc,
|
||||||
|
expected: expected
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (action[0] instanceof Array && action.length > 1) {
|
||||||
|
throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
|
||||||
|
}
|
||||||
|
switch (action[0]) {
|
||||||
|
case 1:
|
||||||
|
stack.push(symbol);
|
||||||
|
vstack.push(this.lexer.yytext);
|
||||||
|
lstack.push(this.lexer.yylloc);
|
||||||
|
stack.push(action[1]);
|
||||||
|
symbol = null;
|
||||||
|
if (!preErrorSymbol) {
|
||||||
|
yyleng = this.lexer.yyleng;
|
||||||
|
yytext = this.lexer.yytext;
|
||||||
|
yylineno = this.lexer.yylineno;
|
||||||
|
yyloc = this.lexer.yylloc;
|
||||||
|
if (recovering > 0) {
|
||||||
|
recovering--;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
symbol = preErrorSymbol;
|
||||||
|
preErrorSymbol = null;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
len = this.productions_[action[1]][1];
|
||||||
|
yyval.$ = vstack[vstack.length - len];
|
||||||
|
yyval._$ = {
|
||||||
|
first_line: lstack[lstack.length - (len || 1)].first_line,
|
||||||
|
last_line: lstack[lstack.length - 1].last_line,
|
||||||
|
first_column: lstack[lstack.length - (len || 1)].first_column,
|
||||||
|
last_column: lstack[lstack.length - 1].last_column
|
||||||
|
};
|
||||||
|
if (ranges) {
|
||||||
|
yyval._$.range = [
|
||||||
|
lstack[lstack.length - (len || 1)].range[0],
|
||||||
|
lstack[lstack.length - 1].range[1]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
|
||||||
|
if (typeof r !== 'undefined') {
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
if (len) {
|
||||||
|
stack = stack.slice(0, -1 * len * 2);
|
||||||
|
vstack = vstack.slice(0, -1 * len);
|
||||||
|
lstack = lstack.slice(0, -1 * len);
|
||||||
|
}
|
||||||
|
stack.push(this.productions_[action[1]][0]);
|
||||||
|
vstack.push(yyval.$);
|
||||||
|
lstack.push(yyval._$);
|
||||||
|
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
||||||
|
stack.push(newState);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}};
|
||||||
|
|
||||||
|
/* generated by jison-lex 0.2.1 */
|
||||||
|
var lexer = (function(){
|
||||||
|
var lexer = {
|
||||||
|
|
||||||
|
EOF:1,
|
||||||
|
|
||||||
|
parseError:function parseError(str, hash) {
|
||||||
|
if (this.yy.parser) {
|
||||||
|
this.yy.parser.parseError(str, hash);
|
||||||
|
} else {
|
||||||
|
throw new Error(str);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// resets the lexer, sets new input
|
||||||
|
setInput:function (input) {
|
||||||
|
this._input = input;
|
||||||
|
this._more = this._backtrack = this.done = false;
|
||||||
|
this.yylineno = this.yyleng = 0;
|
||||||
|
this.yytext = this.matched = this.match = '';
|
||||||
|
this.conditionStack = ['INITIAL'];
|
||||||
|
this.yylloc = {
|
||||||
|
first_line: 1,
|
||||||
|
first_column: 0,
|
||||||
|
last_line: 1,
|
||||||
|
last_column: 0
|
||||||
|
};
|
||||||
|
if (this.options.ranges) {
|
||||||
|
this.yylloc.range = [0,0];
|
||||||
|
}
|
||||||
|
this.offset = 0;
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
|
// consumes and returns one char from the input
|
||||||
|
input:function () {
|
||||||
|
var ch = this._input[0];
|
||||||
|
this.yytext += ch;
|
||||||
|
this.yyleng++;
|
||||||
|
this.offset++;
|
||||||
|
this.match += ch;
|
||||||
|
this.matched += ch;
|
||||||
|
var lines = ch.match(/(?:\r\n?|\n).*/g);
|
||||||
|
if (lines) {
|
||||||
|
this.yylineno++;
|
||||||
|
this.yylloc.last_line++;
|
||||||
|
} else {
|
||||||
|
this.yylloc.last_column++;
|
||||||
|
}
|
||||||
|
if (this.options.ranges) {
|
||||||
|
this.yylloc.range[1]++;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._input = this._input.slice(1);
|
||||||
|
return ch;
|
||||||
|
},
|
||||||
|
|
||||||
|
// unshifts one char (or a string) into the input
|
||||||
|
unput:function (ch) {
|
||||||
|
var len = ch.length;
|
||||||
|
var lines = ch.split(/(?:\r\n?|\n)/g);
|
||||||
|
|
||||||
|
this._input = ch + this._input;
|
||||||
|
this.yytext = this.yytext.substr(0, this.yytext.length - len - 1);
|
||||||
|
//this.yyleng -= len;
|
||||||
|
this.offset -= len;
|
||||||
|
var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
||||||
|
this.match = this.match.substr(0, this.match.length - 1);
|
||||||
|
this.matched = this.matched.substr(0, this.matched.length - 1);
|
||||||
|
|
||||||
|
if (lines.length - 1) {
|
||||||
|
this.yylineno -= lines.length - 1;
|
||||||
|
}
|
||||||
|
var r = this.yylloc.range;
|
||||||
|
|
||||||
|
this.yylloc = {
|
||||||
|
first_line: this.yylloc.first_line,
|
||||||
|
last_line: this.yylineno + 1,
|
||||||
|
first_column: this.yylloc.first_column,
|
||||||
|
last_column: lines ?
|
||||||
|
(lines.length === oldLines.length ? this.yylloc.first_column : 0)
|
||||||
|
+ oldLines[oldLines.length - lines.length].length - lines[0].length :
|
||||||
|
this.yylloc.first_column - len
|
||||||
|
};
|
||||||
|
|
||||||
|
if (this.options.ranges) {
|
||||||
|
this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
||||||
|
}
|
||||||
|
this.yyleng = this.yytext.length;
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
|
// When called from action, caches matched text and appends it on next action
|
||||||
|
more:function () {
|
||||||
|
this._more = true;
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
|
// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
|
||||||
|
reject:function () {
|
||||||
|
if (this.options.backtrack_lexer) {
|
||||||
|
this._backtrack = true;
|
||||||
|
} else {
|
||||||
|
return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
|
||||||
|
text: "",
|
||||||
|
token: null,
|
||||||
|
line: this.yylineno
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
|
// retain first n characters of the match
|
||||||
|
less:function (n) {
|
||||||
|
this.unput(this.match.slice(n));
|
||||||
|
},
|
||||||
|
|
||||||
|
// displays already matched input, i.e. for error messages
|
||||||
|
pastInput:function () {
|
||||||
|
var past = this.matched.substr(0, this.matched.length - this.match.length);
|
||||||
|
return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
|
||||||
|
},
|
||||||
|
|
||||||
|
// displays upcoming input, i.e. for error messages
|
||||||
|
upcomingInput:function () {
|
||||||
|
var next = this.match;
|
||||||
|
if (next.length < 20) {
|
||||||
|
next += this._input.substr(0, 20-next.length);
|
||||||
|
}
|
||||||
|
return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
|
||||||
|
},
|
||||||
|
|
||||||
|
// displays the character position where the lexing error occurred, i.e. for error messages
|
||||||
|
showPosition:function () {
|
||||||
|
var pre = this.pastInput();
|
||||||
|
var c = new Array(pre.length + 1).join("-");
|
||||||
|
return pre + this.upcomingInput() + "\n" + c + "^";
|
||||||
|
},
|
||||||
|
|
||||||
|
// test the lexed token: return FALSE when not a match, otherwise return token
|
||||||
|
test_match:function (match, indexed_rule) {
|
||||||
|
var token,
|
||||||
|
lines,
|
||||||
|
backup;
|
||||||
|
|
||||||
|
if (this.options.backtrack_lexer) {
|
||||||
|
// save context
|
||||||
|
backup = {
|
||||||
|
yylineno: this.yylineno,
|
||||||
|
yylloc: {
|
||||||
|
first_line: this.yylloc.first_line,
|
||||||
|
last_line: this.last_line,
|
||||||
|
first_column: this.yylloc.first_column,
|
||||||
|
last_column: this.yylloc.last_column
|
||||||
|
},
|
||||||
|
yytext: this.yytext,
|
||||||
|
match: this.match,
|
||||||
|
matches: this.matches,
|
||||||
|
matched: this.matched,
|
||||||
|
yyleng: this.yyleng,
|
||||||
|
offset: this.offset,
|
||||||
|
_more: this._more,
|
||||||
|
_input: this._input,
|
||||||
|
yy: this.yy,
|
||||||
|
conditionStack: this.conditionStack.slice(0),
|
||||||
|
done: this.done
|
||||||
|
};
|
||||||
|
if (this.options.ranges) {
|
||||||
|
backup.yylloc.range = this.yylloc.range.slice(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lines = match[0].match(/(?:\r\n?|\n).*/g);
|
||||||
|
if (lines) {
|
||||||
|
this.yylineno += lines.length;
|
||||||
|
}
|
||||||
|
this.yylloc = {
|
||||||
|
first_line: this.yylloc.last_line,
|
||||||
|
last_line: this.yylineno + 1,
|
||||||
|
first_column: this.yylloc.last_column,
|
||||||
|
last_column: lines ?
|
||||||
|
lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
|
||||||
|
this.yylloc.last_column + match[0].length
|
||||||
|
};
|
||||||
|
this.yytext += match[0];
|
||||||
|
this.match += match[0];
|
||||||
|
this.matches = match;
|
||||||
|
this.yyleng = this.yytext.length;
|
||||||
|
if (this.options.ranges) {
|
||||||
|
this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
||||||
|
}
|
||||||
|
this._more = false;
|
||||||
|
this._backtrack = false;
|
||||||
|
this._input = this._input.slice(match[0].length);
|
||||||
|
this.matched += match[0];
|
||||||
|
token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
|
||||||
|
if (this.done && this._input) {
|
||||||
|
this.done = false;
|
||||||
|
}
|
||||||
|
if (token) {
|
||||||
|
return token;
|
||||||
|
} else if (this._backtrack) {
|
||||||
|
// recover context
|
||||||
|
for (var k in backup) {
|
||||||
|
this[k] = backup[k];
|
||||||
|
}
|
||||||
|
return false; // rule action called reject() implying the next rule should be tested instead.
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
// return next match in input
|
||||||
|
next:function () {
|
||||||
|
if (this.done) {
|
||||||
|
return this.EOF;
|
||||||
|
}
|
||||||
|
if (!this._input) {
|
||||||
|
this.done = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var token,
|
||||||
|
match,
|
||||||
|
tempMatch,
|
||||||
|
index;
|
||||||
|
if (!this._more) {
|
||||||
|
this.yytext = '';
|
||||||
|
this.match = '';
|
||||||
|
}
|
||||||
|
var rules = this._currentRules();
|
||||||
|
for (var i = 0; i < rules.length; i++) {
|
||||||
|
tempMatch = this._input.match(this.rules[rules[i]]);
|
||||||
|
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
||||||
|
match = tempMatch;
|
||||||
|
index = i;
|
||||||
|
if (this.options.backtrack_lexer) {
|
||||||
|
token = this.test_match(tempMatch, rules[i]);
|
||||||
|
if (token !== false) {
|
||||||
|
return token;
|
||||||
|
} else if (this._backtrack) {
|
||||||
|
match = false;
|
||||||
|
continue; // rule action called reject() implying a rule MISmatch.
|
||||||
|
} else {
|
||||||
|
// else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (!this.options.flex) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (match) {
|
||||||
|
token = this.test_match(match, rules[index]);
|
||||||
|
if (token !== false) {
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
// else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (this._input === "") {
|
||||||
|
return this.EOF;
|
||||||
|
} else {
|
||||||
|
return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
|
||||||
|
text: "",
|
||||||
|
token: null,
|
||||||
|
line: this.yylineno
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// return next match that has a token
|
||||||
|
lex:function lex() {
|
||||||
|
var r = this.next();
|
||||||
|
if (r) {
|
||||||
|
return r;
|
||||||
|
} else {
|
||||||
|
return this.lex();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
||||||
|
begin:function begin(condition) {
|
||||||
|
this.conditionStack.push(condition);
|
||||||
|
},
|
||||||
|
|
||||||
|
// pop the previously active lexer condition state off the condition stack
|
||||||
|
popState:function popState() {
|
||||||
|
var n = this.conditionStack.length - 1;
|
||||||
|
if (n > 0) {
|
||||||
|
return this.conditionStack.pop();
|
||||||
|
} else {
|
||||||
|
return this.conditionStack[0];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// produce the lexer rule set which is active for the currently active lexer condition state
|
||||||
|
_currentRules:function _currentRules() {
|
||||||
|
if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
|
||||||
|
return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
||||||
|
} else {
|
||||||
|
return this.conditions["INITIAL"].rules;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
||||||
|
topState:function topState(n) {
|
||||||
|
n = this.conditionStack.length - 1 - Math.abs(n || 0);
|
||||||
|
if (n >= 0) {
|
||||||
|
return this.conditionStack[n];
|
||||||
|
} else {
|
||||||
|
return "INITIAL";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// alias for begin(condition)
|
||||||
|
pushState:function pushState(condition) {
|
||||||
|
this.begin(condition);
|
||||||
|
},
|
||||||
|
|
||||||
|
// return the number of states currently on the stack
|
||||||
|
stateStackSize:function stateStackSize() {
|
||||||
|
return this.conditionStack.length;
|
||||||
|
},
|
||||||
|
options: {"case-insensitive":true},
|
||||||
|
performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
|
||||||
|
|
||||||
|
// Pre-lexer code can go here
|
||||||
|
|
||||||
|
var YYSTATE=YY_START;
|
||||||
|
switch($avoiding_name_collisions) {
|
||||||
|
case 0:return 8;
|
||||||
|
break;
|
||||||
|
case 1:/* skip whitespace */
|
||||||
|
break;
|
||||||
|
case 2:/* skip comments */
|
||||||
|
break;
|
||||||
|
case 3:return 9;
|
||||||
|
break;
|
||||||
|
case 4:return 20;
|
||||||
|
break;
|
||||||
|
case 5:return 21;
|
||||||
|
break;
|
||||||
|
case 6:return 17;
|
||||||
|
break;
|
||||||
|
case 7:return 15;
|
||||||
|
break;
|
||||||
|
case 8:return 13;
|
||||||
|
break;
|
||||||
|
case 9:return 19;
|
||||||
|
break;
|
||||||
|
case 10:return 23;
|
||||||
|
break;
|
||||||
|
case 11:return 27;
|
||||||
|
break;
|
||||||
|
case 12:return 26;
|
||||||
|
break;
|
||||||
|
case 13:return 29;
|
||||||
|
break;
|
||||||
|
case 14:return 28;
|
||||||
|
break;
|
||||||
|
case 15:return 30;
|
||||||
|
break;
|
||||||
|
case 16:return 5;
|
||||||
|
break;
|
||||||
|
case 17:return 'INVALID';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
rules: [/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:participant\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:title\b)/i,/^(?:,)/i,/^(?:[^\->:\n,]+)/i,/^(?:--)/i,/^(?:-)/i,/^(?:>>)/i,/^(?:>)/i,/^(?:[^#\n]+)/i,/^(?:$)/i,/^(?:.)/i],
|
||||||
|
conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],"inclusive":true}}
|
||||||
|
};
|
||||||
|
return lexer;
|
||||||
|
})();
|
||||||
|
parser.lexer = lexer;
|
||||||
|
function Parser () {
|
||||||
|
this.yy = {};
|
||||||
|
}
|
||||||
|
Parser.prototype = parser;parser.Parser = Parser;
|
||||||
|
return new Parser;
|
||||||
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
|
||||||
|
exports.parser = grammar;
|
||||||
|
exports.Parser = grammar.Parser;
|
||||||
|
exports.parse = function () { return grammar.parse.apply(grammar, arguments); };
|
||||||
|
exports.main = function commonjsMain(args) {
|
||||||
|
if (!args[1]) {
|
||||||
|
console.log('Usage: '+args[0]+' FILE');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
|
||||||
|
return exports.parser.parse(source);
|
||||||
|
};
|
||||||
|
if (typeof module !== 'undefined' && require.main === module) {
|
||||||
|
exports.main(process.argv.slice(1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* jison doesn't have a good exception, so we make one
|
||||||
|
*/
|
||||||
|
function ParseError(message, hash) {
|
||||||
|
_.extend(this, hash);
|
||||||
|
|
||||||
|
this.name = "ParseError";
|
||||||
|
this.message = (message || "");
|
||||||
|
}
|
||||||
|
ParseError.prototype = new Error();
|
||||||
|
Diagram.ParseError = ParseError;
|
||||||
|
|
||||||
|
grammar.parseError = function(message, hash) {
|
||||||
|
throw new ParseError(message, hash);
|
||||||
|
};
|
||||||
|
|
||||||
|
Diagram.parse = function(input) {
|
||||||
|
grammar.yy = new Diagram();
|
||||||
|
|
||||||
|
return grammar.parse(input);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Expose this class externally
|
||||||
|
this.Diagram = Diagram;
|
||||||
|
|
||||||
|
}).call(this);
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
(function(){function Diagram(){this.title=undefined;this.actors=[];this.signals=[]}Diagram.prototype.getActor=function(alias){var s=/^(.+) as (\S+)$/i.exec(alias.trim());if(s){name=s[1].trim();alias=s[2].trim()}else{name=alias.trim()}name=name.replace(/\\n/gm,"\n");var i,actors=this.actors;for(i in actors){if(actors[i].alias==alias){return actors[i]}}i=actors.push(new Diagram.Actor(alias,name,actors.length));return actors[i-1]};Diagram.prototype.setTitle=function(title){this.title=title};Diagram.prototype.addSignal=function(signal){this.signals.push(signal)};Diagram.Actor=function(alias,name,index){this.alias=alias;this.name=name;this.index=index};Diagram.Signal=function(actorA,signaltype,actorB,message){this.type="Signal";this.actorA=actorA;this.actorB=actorB;this.linetype=signaltype&3;this.arrowtype=(signaltype>>2)&3;this.message=message};Diagram.Signal.prototype.isSelf=function(){return this.actorA.index==this.actorB.index};Diagram.Note=function(actor,placement,message){this.type="Note";this.actor=actor;this.placement=placement;this.message=message;if(this.hasManyActors()&&actor[0]==actor[1]){throw new Error("Note should be over two different actors")}};Diagram.Note.prototype.hasManyActors=function(){return _.isArray(this.actor)};Diagram.LINETYPE={SOLID:0,DOTTED:1};Diagram.ARROWTYPE={FILLED:0,OPEN:1};Diagram.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2};var grammar=(function(){var parser={trace:function trace(){},yy:{},symbols_:{"error":2,"start":3,"document":4,"EOF":5,"line":6,"statement":7,"NL":8,"participant":9,"actor":10,"signal":11,"note_statement":12,"title":13,"message":14,"note":15,"placement":16,"over":17,"actor_pair":18,",":19,"left_of":20,"right_of":21,"signaltype":22,"ACTOR":23,"linetype":24,"arrowtype":25,"LINE":26,"DOTLINE":27,"ARROW":28,"OPENARROW":29,"MESSAGE":30,"$accept":0,"$end":1},terminals_:{2:"error",5:"EOF",8:"NL",9:"participant",13:"title",15:"note",17:"over",19:",",20:"left_of",21:"right_of",23:"ACTOR",26:"LINE",27:"DOTLINE",28:"ARROW",29:"OPENARROW",30:"MESSAGE"},productions_:[0,[3,2],[4,0],[4,2],[6,1],[6,1],[7,2],[7,1],[7,1],[7,2],[12,4],[12,4],[18,1],[18,3],[16,1],[16,1],[11,4],[10,1],[22,2],[22,1],[24,1],[24,1],[25,1],[25,1],[14,1]],performAction:function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 1:return yy;break;case 4:break;case 6:$$[$0];break;case 7:yy.addSignal($$[$0]);break;case 8:yy.addSignal($$[$0]);break;case 9:yy.setTitle($$[$0]);break;case 10:this.$=new Diagram.Note($$[$0-1],$$[$0-2],$$[$0]);break;case 11:this.$=new Diagram.Note($$[$0-1],Diagram.PLACEMENT.OVER,$$[$0]);break;case 12:this.$=$$[$0];break;case 13:this.$=[$$[$0-2],$$[$0]];break;case 14:this.$=Diagram.PLACEMENT.LEFTOF;break;case 15:this.$=Diagram.PLACEMENT.RIGHTOF;break;case 16:this.$=new Diagram.Signal($$[$0-3],$$[$0-2],$$[$0-1],$$[$0]);break;case 17:this.$=yy.getActor($$[$0]);break;case 18:this.$=$$[$0-1]|($$[$0]<<2);break;case 19:this.$=$$[$0];break;case 20:this.$=Diagram.LINETYPE.SOLID;break;case 21:this.$=Diagram.LINETYPE.DOTTED;break;case 22:this.$=Diagram.ARROWTYPE.FILLED;break;case 23:this.$=Diagram.ARROWTYPE.OPEN;break;case 24:this.$=$$[$0].substring(1).trim().replace(/\\n/gm,"\n");break}},table:[{3:1,4:2,5:[2,2],8:[2,2],9:[2,2],13:[2,2],15:[2,2],23:[2,2]},{1:[3]},{5:[1,3],6:4,7:5,8:[1,6],9:[1,7],10:11,11:8,12:9,13:[1,10],15:[1,12],23:[1,13]},{1:[2,1]},{5:[2,3],8:[2,3],9:[2,3],13:[2,3],15:[2,3],23:[2,3]},{5:[2,4],8:[2,4],9:[2,4],13:[2,4],15:[2,4],23:[2,4]},{5:[2,5],8:[2,5],9:[2,5],13:[2,5],15:[2,5],23:[2,5]},{10:14,23:[1,13]},{5:[2,7],8:[2,7],9:[2,7],13:[2,7],15:[2,7],23:[2,7]},{5:[2,8],8:[2,8],9:[2,8],13:[2,8],15:[2,8],23:[2,8]},{14:15,30:[1,16]},{22:17,24:18,26:[1,19],27:[1,20]},{16:21,17:[1,22],20:[1,23],21:[1,24]},{5:[2,17],8:[2,17],9:[2,17],13:[2,17],15:[2,17],19:[2,17],23:[2,17],26:[2,17],27:[2,17],30:[2,17]},{5:[2,6],8:[2,6],9:[2,6],13:[2,6],15:[2,6],23:[2,6]},{5:[2,9],8:[2,9],9:[2,9],13:[2,9],15:[2,9],23:[2,9]},{5:[2,24],8:[2,24],9:[2,24],13:[2,24],15:[2,24],23:[2,24]},{10:25,23:[1,13]},{23:[2,19],25:26,28:[1,27],29:[1,28]},{23:[2,20],28:[2,20],29:[2,20]},{23:[2,21],28:[2,21],29:[2,21]},{10:29,23:[1,13]},{10:31,18:30,23:[1,13]},{23:[2,14]},{23:[2,15]},{14:32,30:[1,16]},{23:[2,18]},{23:[2,22]},{23:[2,23]},{14:33,30:[1,16]},{14:34,30:[1,16]},{19:[1,35],30:[2,12]},{5:[2,16],8:[2,16],9:[2,16],13:[2,16],15:[2,16],23:[2,16]},{5:[2,10],8:[2,10],9:[2,10],13:[2,10],15:[2,10],23:[2,10]},{5:[2,11],8:[2,11],9:[2,11],13:[2,11],15:[2,11],23:[2,11]},{10:36,23:[1,13]},{30:[2,13]}],defaultActions:{3:[2,1],23:[2,14],24:[2,15],26:[2,18],27:[2,22],28:[2,23],36:[2,13]},parseError:function parseError(str,hash){if(hash.recoverable){this.trace(str)}else{throw new Error(str)}},parse:function parse(input){var self=this,stack=[0],vstack=[null],lstack=[],table=this.table,yytext="",yylineno=0,yyleng=0,recovering=0,TERROR=2,EOF=1;this.lexer.setInput(input);this.lexer.yy=this.yy;this.yy.lexer=this.lexer;this.yy.parser=this;if(typeof this.lexer.yylloc=="undefined"){this.lexer.yLine truncated
|
||||||
|
}var yyloc=this.lexer.yylloc;lstack.push(yyloc);var ranges=this.lexer.options&&this.lexer.options.ranges;if(typeof this.yy.parseError==="function"){this.parseError=this.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function popStack(n){stack.length=stack.length-2*n;vstack.length=vstack.length-n;lstack.length=lstack.length-n}function lex(){var token;token=self.lexer.lex()||EOF;if(typeof token!=="number"){token=self.symbols_[token]||token}return token}var symbol,preErrorSymbol,state,action,a,r,yyval={},p,len,newState,expected;while(true){state=stack[stack.length-1];if(this.defaultActions[state]){action=this.defaultActions[state]}else{if(symbol===null||typeof symbol=="undefined"){symbol=lex()}action=table[state]&&table[state][symbol]}if(typeof action==="undefined"||!action.length||!action[0]){var errStr="";expected=[];for(p in table[state]){if(this.terminals_[p]&&p>TERROR){expected.push("'"+this.terminals_[p]+"'")}}if(this.lexer.showPosition){errStr="Parse error on line "+(yylineno+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+expected.join(", ")+", got '"+(this.terminals_[symbol]||symbol)+"'"}else{errStr="Parse error on line "+(yylineno+1)+": Unexpected "+(symbol==EOF?"end of input":"'"+(this.terminals_[symbol]||symbol)+"'")}this.parseError(errStr,{text:this.lexer.match,token:this.terminals_[symbol]||symbol,line:this.lexer.yylineno,loc:yyloc,expected:expected})}if(action[0] instanceof Array&&action.length>1){throw new Error("Parse Error: multiple actions possible at state: "+state+", token: "+symbol)}switch(action[0]){case 1:stack.push(symbol);vstack.push(this.lexer.yytext);lstack.push(this.lexer.yylloc);stack.push(action[1]);symbol=null;if(!preErrorSymbol){yyleng=this.lexer.yyleng;yytext=this.lexer.yytext;yylineno=this.lexer.yylineno;yyloc=this.lexer.yylloc;if(recovering>0){recovering--}}else{symbol=preErrorSymbol;preErrorSymbol=null}break;case 2:len=this.productions_[action[1]][1];yyval.$=vstack[vstack.length-len];yyval._$={first_line:lstack[lstack.length-(len||1)].first_line,last_line:lstack[lstack.length-1].last_line,first_column:lstack[lstack.length-(len||1)].first_column,last_column:lstack[lstack.length-1].last_column};if(ranges){yyval._$.range=[lstack[lstack.length-(len||1)].range[0],lstack[lstack.length-1].range[1]]}r=this.performAction.call(yyval,yytext,yyleng,yylineno,this.yy,action[1],vstack,lstack);if(typeof r!=="undefined"){return r}if(len){stack=stack.slice(0,-1*len*2);vstack=vstack.slice(0,-1*len);lstack=lstack.slice(0,-1*len)}stack.push(this.productions_[action[1]][0]);vstack.push(yyval.$);lstack.push(yyval._$);newState=table[stack[stack.length-2]][stack[stack.length-1]];stack.push(newState);break;case 3:return true}}return true}};var lexer=(function(){var lexer={EOF:1,parseError:function parseError(str,hash){if(this.yy.parser){this.yy.parser.parseError(str,hash)}else{throw new Error(str)}},setInput:function(input){this._input=input;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},input:function(){var ch=this._input[0];this.yytext+=ch;this.yyleng++;this.offset++;this.match+=ch;this.matched+=ch;var lines=ch.match(/(?:\r\n?|\n).*/g);if(lines){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return ch},unput:function(ch){var len=ch.length;var lines=ch.split(/(?:\r\n?|\n)/g);this._input=ch+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-len-1);this.offset-=len;var oldLines=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(lines.length-1){this.yylineno-=lines.length-1}var r=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:lines?(lines.length===oldLines.length?this.yylloc.first_column:0)+oldLines[oldLines.length-lines.length].length-lines[0].length:this.yylloc.first_column-len};if(this.options.ranges){this.yylloc.range=[r[0],r[0]+this.yyleng-len]}this.yyleng=this.yytext.length;return this},more:function(){this._more=true;return this},reject:function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var past=this.matched.substr(0,this.matched.length-this.match.length);return(past.length>20?"...":"")+past.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var next=this.match;if(next.leLine truncated
|
||||||
|
}return(next.substr(0,20)+(next.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var pre=this.pastInput();var c=new Array(pre.length+1).join("-");return pre+this.upcomingInput()+"\n"+c+"^"},test_match:function(match,indexed_rule){var token,lines,backup;if(this.options.backtrack_lexer){backup={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){backup.yylloc.range=this.yylloc.range.slice(0)}}lines=match[0].match(/(?:\r\n?|\n).*/g);if(lines){this.yylineno+=lines.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:lines?lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+match[0].length};this.yytext+=match[0];this.match+=match[0];this.matches=match;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(match[0].length);this.matched+=match[0];token=this.performAction.call(this,this.yy,this,indexed_rule,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(token){return token}else{if(this._backtrack){for(var k in backup){this[k]=backup[k]}return false}}return false},next:function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var token,match,tempMatch,index;if(!this._more){this.yytext="";this.match=""}var rules=this._currentRules();for(var i=0;i<rules.length;i++){tempMatch=this._input.match(this.rules[rules[i]]);if(tempMatch&&(!match||tempMatch[0].length>match[0].length)){match=tempMatch;index=i;if(this.options.backtrack_lexer){token=this.test_match(tempMatch,rules[i]);if(token!==false){return token}else{if(this._backtrack){match=false;continue}else{return false}}}else{if(!this.options.flex){break}}}}if(match){token=this.test_match(match,rules[index]);if(token!==false){return token}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},lex:function lex(){var r=this.next();if(r){return r}else{return this.lex()}},begin:function begin(condition){this.conditionStack.push(condition)},popState:function popState(){var n=this.conditionStack.length-1;if(n>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},_currentRules:function _currentRules(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},topState:function topState(n){n=this.conditionStack.length-1-Math.abs(n||0);if(n>=0){return this.conditionStack[n]}else{return"INITIAL"}},pushState:function pushState(condition){this.begin(condition)},stateStackSize:function stateStackSize(){return this.conditionStack.length},options:{"case-insensitive":true},performAction:function anonymous(yy,yy_,$avoiding_name_collisions,YY_START){var YYSTATE=YY_START;switch($avoiding_name_collisions){case 0:return 8;break;case 1:break;case 2:break;case 3:return 9;break;case 4:return 20;break;case 5:return 21;break;case 6:return 17;break;case 7:return 15;break;case 8:return 13;break;case 9:return 19;break;case 10:return 23;break;case 11:return 27;break;case 12:return 26;break;case 13:return 29;break;case 14:return 28;break;case 15:return 30;break;case 16:return 5;break;case 17:return"INVALID";break}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:participant\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:title\b)/i,/^(?:,)/i,/^(?:[^\->:\n,]+)/i,/^(?:--)/i,/^(?:-)/i,/^(?:>>)/i,/^(?:>)/i,/^(?:[^#\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],"inclusive":true}}};return lexer})();parser.lexer=lexer;function Parser(){this.yy={}}Parser.prototype=parser;parser.Parser=Parser;return new Parser})();if(typeof require!=="undefined"&&typeof exports!=="undefined"){exports.parser=grammar;exports.Parser=grammar.Parser;exports.parse=function(){return grammar.parse.apply(grammar,arguments)};exports.main=function commonjsMain(args){if(!args[1]){console.log("Usage: "+args[0]+" FILE");process.exit(1)}var source=require("fs").readFileSync(require("path").normalize(args[1]),"utf8");return exports.parser.parse(source)};if(typeof module!=="undefined"&&require.main===module){exports.main(process.argv.slice(1))}}function ParseError(message,hash){_.extend(this,hash);this.name="ParseError";this.message=(message||"")}ParseError.pLine truncated
|
||||||
|
Diagram.ParseError=ParseError;grammar.parseError=function(message,hash){throw new ParseError(message,hash)};Diagram.parse=function(input){grammar.yy=new Diagram();return grammar.parse(input)};this.Diagram=Diagram}).call(this);
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
// flowchart, v1.3.4
|
||||||
|
// Copyright (c)2014 Adriano Raiano (adrai).
|
||||||
|
// Distributed under MIT license
|
||||||
|
// http://adrai.github.io/flowchart.js
|
||||||
|
!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd&&define([],b)}(this,function(){function a(b,c){if(!b||"function"==typeof b)return c;var d={};for(var e in c)d[e]=c[e];for(e in b)b[e]&&(d[e]="object"==typeof d[e]?a(d[e],b[e]):b[e]);return d}function b(a,b){if("function"==typeof Object.create)a.super_=b,a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});else{a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}}function c(a,b,c){var d,e,f="M{0},{1}";for(d=2,e=2*c.length+2;e>d;d+=2)f+=" L{"+d+"},{"+(d+1)+"}";var g=[b.x,b.y];for(d=0,e=c.length;e>d;d++)g.push(c[d].x),g.push(c[d].y);var h=a.paper.path(f,g);h.attr("stroke",a.options["element-color"]),h.attr("stroke-width",a.options["line-width"]);var i=a.options.font,j=a.options["font-family"],k=a.options["font-weight"];return i&&h.attr({font:i}),j&&h.attr({"font-family":j}),k&&h.attr({"font-weight":k}),h}function d(a,b,c,d){var e,f;"[object Array]"!==Object.prototype.toString.call(c)&&(c=[c]);var g="M{0},{1}";for(e=2,f=2*c.length+2;f>e;e+=2)g+=" L{"+e+"},{"+(e+1)+"}";var h=[b.x,b.y];for(e=0,f=c.length;f>e;e++)h.push(c[e].x),h.push(c[e].y);var i=a.paper.path(g,h);i.attr({stroke:a.options["line-color"],"stroke-width":a.options["line-width"],"arrow-end":a.options["arrow-end"]});var j=a.options.font,k=a.options["font-family"],l=a.options["font-weight"];if(j&&i.attr({font:j}),k&&i.attr({"font-family":k}),l&&i.attr({"font-weight":l}),d){var m=!1,n=a.paper.text(0,0,d),o=!1,p=c[0];b.y===p.y&&(o=!0);var q=0,r=0;m?(q=b.x>p.x?b.x-(b.x-p.x)/2:p.x-(p.x-b.x)/2,r=b.y>p.y?b.y-(b.y-p.y)/2:p.y-(p.y-b.y)/2,o?(q-=n.getBBox().width/2,r-=a.options["text-margin"]):(q+=a.options["text-margin"],r-=n.getBBox().height/2)):(q=b.x,r=b.y,o?(q+=a.options["text-margin"]/2,r-=a.options["text-margin"]):(q+=a.options["text-margin"]/2,r+=a.options["text-margin"])),n.attr({"text-anchor":"start","font-size":a.options["font-size"],fill:a.options["font-color"],x:q,y:r}),j&&n.attr({font:j}),k&&n.attr({"font-family":k}),l&&n.attr({"font-weight":l})}return i}function e(a,b,c,d,e,f,g,h){var i,j,k,l,m,n={x:null,y:null,onLine1:!1,onLine2:!1};return i=(h-f)*(c-a)-(g-e)*(d-b),0===i?n:(j=b-f,k=a-e,l=(g-e)*j-(h-f)*k,m=(c-a)*j-(d-b)*k,j=l/i,k=m/i,n.x=a+j*(c-a),n.y=b+j*(d-b),j>0&&1>j&&(n.onLine1=!0),k>0&&1>k&&(n.onLine2=!0),n)}function f(a,b){b=b||{},this.paper=new Raphael(a),this.options=q.defaults(b,p),this.symbols=[],this.lines=[],this.start=null}function g(a,b,c){this.chart=a,this.group=this.chart.paper.set(),this.symbol=c,this.connectedTo=[],this.symbolType=b.symbolType,this.flowstate=b.flowstate||"future",this.next_direction=b.next&&b.direction_next?b.direction_next:void 0,this.text=this.chart.paper.text(0,0,b.text),b.key&&(this.text.node.id=b.key+"t"),this.text.node.setAttribute("class",this.getAttr("class")+"t"),this.text.attr({"text-anchor":"start",x:this.getAttr("text-margin"),fill:this.getAttr("font-color"),"font-size":this.getAttr("font-size")});var d=this.getAttr("font"),e=this.getAttr("font-family"),f=this.getAttr("font-weight");d&&this.text.attr({font:d}),e&&this.text.attr({"font-family":e}),f&&this.text.attr({"font-weight":f}),b.link&&this.text.attr("href",b.link),b.target&&this.text.attr("target",b.target);var g=this.getAttr("maxWidth");if(g){for(var h=b.text.split(" "),i="",j=0,k=h.length;k>j;j++){var l=h[j];this.text.attr("text",i+" "+l),i+=this.text.getBBox().width>g?"\n"+l:" "+l}this.text.attr("text",i.substring(1))}if(this.group.push(this.text),c){var m=this.getAttr("text-margin");c.attr({fill:this.getAttr("fill"),stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),width:this.text.getBBox().width+2*m,height:this.text.getBBox().height+2*m}),c.node.setAttribute("class",this.getAttr("class")),b.link&&c.attr("href",b.link),b.target&&c.attr("target",b.target),b.key&&(c.node.id=b.key),this.group.push(c),c.insertBefore(this.text),this.text.attr({y:c.getBBox().height/2}),this.initialize()}}function h(a,b){var c=a.paper.rect(0,0,0,0,20);b=b||{},b.text=b.text||"Start",g.call(this,a,b,c)}function i(a,b){var c=a.paper.rect(0,0,0,0,20);b=b||{},b.text=b.text||"End",g.call(this,a,b,c)}function j(a,b){var c=a.paper.rect(0,0,0,0);b=b||{},g.call(this,a,b,c)}function k(a,b){var c=a.paper.rect(0,0,0,0);b=b||{},g.call(this,a,b,c),c.attr({width:this.text.getBBox().width+4*this.getAttr("text-margin")}),this.text.attr({x:2*this.getAttr("text-margin")});var d=a.paper.rect(0,0,0,0);d.attr({x:this.getAttr("text-margin"),stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),width:this.text.getBBox().width+2*this.getAttr("text-margin"),height:this.text.getBBox().height+2*this.getAttr("text-margin"),fill:this.getAttr("fill")}),b.key&&(d.node.id=b.key+"i");var e=this.getAttr("font"),f=this.getAttr("font-family"),h=this.getAttr("font-weight");e&&d.attr({font:e}),f&&d.attr({"font-family":f}),h&&d.attr({"font-weight":h}),b.link&&Line truncated
|
||||||
Vendored
+11
@@ -0,0 +1,11 @@
|
|||||||
|
// ┌────────────────────────────────────────────────────────────────────┐ \\
|
||||||
|
// │ Raphaël 2.1.1 - JavaScript Vector Library │ \\
|
||||||
|
// ├────────────────────────────────────────────────────────────────────┤ \\
|
||||||
|
// │ Copyright © 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com) │ \\
|
||||||
|
// │ Copyright © 2008-2012 Sencha Labs (http://sencha.com) │ \\
|
||||||
|
// ├────────────────────────────────────────────────────────────────────┤ \\
|
||||||
|
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license.│ \\
|
||||||
|
// └────────────────────────────────────────────────────────────────────┘ \\
|
||||||
|
!function(a){var b,c,d="0.4.2",e="hasOwnProperty",f=/[\.\/]/,g="*",h=function(){},i=function(a,b){return a-b},j={n:{}},k=function(a,d){a=String(a);var e,f=c,g=Array.prototype.slice.call(arguments,2),h=k.listeners(a),j=0,l=[],m={},n=[],o=b;b=a,c=0;for(var p=0,q=h.length;q>p;p++)"zIndex"in h[p]&&(l.push(h[p].zIndex),h[p].zIndex<0&&(m[h[p].zIndex]=h[p]));for(l.sort(i);l[j]<0;)if(e=m[l[j++]],n.push(e.apply(d,g)),c)return c=f,n;for(p=0;q>p;p++)if(e=h[p],"zIndex"in e)if(e.zIndex==l[j]){if(n.push(e.apply(d,g)),c)break;do if(j++,e=m[l[j]],e&&n.push(e.apply(d,g)),c)break;while(e)}else m[e.zIndex]=e;else if(n.push(e.apply(d,g)),c)break;return c=f,b=o,n.length?n:null};k._events=j,k.listeners=function(a){var b,c,d,e,h,i,k,l,m=a.split(f),n=j,o=[n],p=[];for(e=0,h=m.length;h>e;e++){for(l=[],i=0,k=o.length;k>i;i++)for(n=o[i].n,c=[n[m[e]],n[g]],d=2;d--;)b=c[d],b&&(l.push(b),p=p.concat(b.f||[]));o=l}return p},k.on=function(a,b){if(a=String(a),"function"!=typeof b)return function(){};for(var c=a.split(f),d=j,e=0,g=c.length;g>e;e++)d=d.n,d=d.hasOwnProperty(c[e])&&d[c[e]]||(d[c[e]]={n:{}});for(d.f=d.f||[],e=0,g=d.f.length;g>e;e++)if(d.f[e]==b)return h;return d.f.push(b),function(a){+a==+a&&(b.zIndex=+a)}},k.f=function(a){var b=[].slice.call(arguments,1);return function(){k.apply(null,[a,null].concat(b).concat([].slice.call(arguments,0)))}},k.stop=function(){c=1},k.nt=function(a){return a?new RegExp("(?:\\.|\\/|^)"+a+"(?:\\.|\\/|$)").test(b):b},k.nts=function(){return b.split(f)},k.off=k.unbind=function(a,b){if(!a)return k._events=j={n:{}},void 0;var c,d,h,i,l,m,n,o=a.split(f),p=[j];for(i=0,l=o.length;l>i;i++)for(m=0;m<p.length;m+=h.length-2){if(h=[m,1],c=p[m].n,o[i]!=g)c[o[i]]&&h.push(c[o[i]]);else for(d in c)c[e](d)&&h.push(c[d]);p.splice.apply(p,h)}for(i=0,l=p.length;l>i;i++)for(c=p[i];c.n;){if(b){if(c.f){for(m=0,n=c.f.length;n>m;m++)if(c.f[m]==b){c.f.splice(m,1);break}!c.f.length&&delete c.f}for(d in c.n)if(c.n[e](d)&&c.n[d].f){var q=c.n[d].f;for(m=0,n=q.length;n>m;m++)if(q[m]==b){q.splice(m,1);break}!q.length&&delete c.n[d].f}}else{delete c.f;for(d in c.n)c.n[e](d)&&c.n[d].f&&delete c.n[d].f}c=c.n}},k.once=function(a,b){var c=function(){return k.unbind(a,c),b.apply(this,arguments)};return k.on(a,c)},k.version=d,k.toString=function(){return"You are running Eve "+d},"undefined"!=typeof module&&module.exports?module.exports=k:"undefined"!=typeof define?define("eve",[],function(){return k}):a.eve=k}(this),function(a,b){"function"==typeof define&&define.amd?define(["eve"],function(c){return b(a,c)}):b(a,a.eve)}(this,function(a,b){function c(a){if(c.is(a,"function"))return u?a():b.on("raphael.DOMload",a);if(c.is(a,V))return c._engine.create[D](c,a.splice(0,3+c.is(a[0],T))).add(a);var d=Array.prototype.slice.call(arguments,0);if(c.is(d[d.length-1],"function")){var e=d.pop();return u?e.call(c._engine.create[D](c,d)):b.on("raphael.DOMload",function(){e.call(c._engine.create[D](c,d))})}return c._engine.create[D](c,arguments)}function d(a){if("function"==typeof a||Object(a)!==a)return a;var b=new a.constructor;for(var c in a)a[z](c)&&(b[c]=d(a[c]));return b}function e(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return a.push(a.splice(c,1)[0])}function f(a,b,c){function d(){var f=Array.prototype.slice.call(arguments,0),g=f.join("␀"),h=d.cache=d.cache||{},i=d.count=d.count||[];return h[z](g)?(e(i,g),c?c(h[g]):h[g]):(i.length>=1e3&&delete h[i.shift()],i.push(g),h[g]=a[D](b,f),c?c(h[g]):h[g])}return d}function g(){return this.hex}function h(a,b){for(var c=[],d=0,e=a.length;e-2*!b>d;d+=2){var f=[{x:+a[d-2],y:+a[d-1]},{x:+a[d],y:+a[d+1]},{x:+a[d+2],y:+a[d+3]},{x:+a[d+4],y:+a[d+5]}];b?d?e-4==d?f[3]={x:+a[0],y:+a[1]}:e-2==d&&(f[2]={x:+a[0],y:+a[1]},f[3]={x:+a[2],y:+a[3]}):f[0]={x:+a[e-2],y:+a[e-1]}:e-4==d?f[3]=f[2]:d||(f[0]={x:+a[d],y:+a[d+1]}),c.push(["C",(-f[0].x+6*f[1].x+f[2].x)/6,(-f[0].y+6*f[1].y+f[2].y)/6,(f[1].x+6*f[2].x-f[3].x)/6,(f[1].y+6*f[2].y-f[3].y)/6,f[2].x,f[2].y])}return c}function i(a,b,c,d,e){var f=-3*b+9*c-9*d+3*e,g=a*f+6*b-12*c+6*d;return a*g-3*b+3*c}function j(a,b,c,d,e,f,g,h,j){null==j&&(j=1),j=j>1?1:0>j?0:j;for(var k=j/2,l=12,m=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],n=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],o=0,p=0;l>p;p++){var q=k*m[p]+k,r=i(q,a,c,e,g),s=i(q,b,d,f,h),t=r*r+s*s;o+=n[p]*N.sqrt(t)}return k*o}function k(a,b,c,d,e,f,g,h,i){if(!(0>i||j(a,b,c,d,e,f,g,h)<i)){var k,l=1,m=l/2,n=l-m,o=.01;for(k=j(a,b,c,d,e,f,g,h,n);Q(k-i)>o;)m/=2,n+=(i>k?1:-1)*m,k=j(a,b,c,d,e,f,g,h,n);return n}}function l(a,b,c,d,e,f,g,h){if(!(O(a,c)<P(e,g)||P(a,c)>O(e,g)||O(b,d)<P(f,h)||P(b,d)>O(f,h))){var i=(a*d-b*c)*(e-g)-(a-c)*(e*h-f*g),j=(a*d-b*c)*(f-h)-(b-d)*(e*h-f*g),k=(a-c)*(f-h)-(b-d)*(e-g);if(k){var l=i/k,m=j/k,n=+l.toFixed(2),o=+m.toFixed(2);if(!(n<+P(a,c).toFixed(2)||n>+O(a,c).toFixed(2)||n<+P(e,g).toFixed(2)||n>+O(e,g).toFixed(2)||o<+P(b,d).toFixed(2)||o>+O(b,d).toFixed(2)||o<+P(f,h).toFixed(2)||o>+O(f,h).toFixed(2)))return{x:l,y:m}}}}function m(a,b,d){Line truncated
|
||||||
|
}return{from:i,to:j}};c._getContainer=function(a,b,d,e){var f;return f=null!=e||c.is(a,"object")?a:A.doc.getElementById(a),null!=f?f.tagName?null==b?{container:f,width:f.style.pixelWidth||f.offsetWidth,height:f.style.pixelHeight||f.offsetHeight}:{container:f,width:b,height:d}:{container:1,x:a,y:b,width:d,height:e}:void 0},c.pathToRelative=Db,c._engine={},c.path2curve=Kb,c.matrix=function(a,b,c,d,e,f){return new o(a,b,c,d,e,f)},function(a){function b(a){return a[0]*a[0]+a[1]*a[1]}function d(a){var c=N.sqrt(b(a));a[0]&&(a[0]/=c),a[1]&&(a[1]/=c)}a.add=function(a,b,c,d,e,f){var g,h,i,j,k=[[],[],[]],l=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],m=[[a,c,e],[b,d,f],[0,0,1]];for(a&&a instanceof o&&(m=[[a.a,a.c,a.e],[a.b,a.d,a.f],[0,0,1]]),g=0;3>g;g++)for(h=0;3>h;h++){for(j=0,i=0;3>i;i++)j+=l[g][i]*m[i][h];k[g][h]=j}this.a=k[0][0],this.b=k[1][0],this.c=k[0][1],this.d=k[1][1],this.e=k[0][2],this.f=k[1][2]},a.invert=function(){var a=this,b=a.a*a.d-a.b*a.c;return new o(a.d/b,-a.b/b,-a.c/b,a.a/b,(a.c*a.f-a.d*a.e)/b,(a.b*a.e-a.a*a.f)/b)},a.clone=function(){return new o(this.a,this.b,this.c,this.d,this.e,this.f)},a.translate=function(a,b){this.add(1,0,0,1,a,b)},a.scale=function(a,b,c,d){null==b&&(b=a),(c||d)&&this.add(1,0,0,1,c,d),this.add(a,0,0,b,0,0),(c||d)&&this.add(1,0,0,1,-c,-d)},a.rotate=function(a,b,d){a=c.rad(a),b=b||0,d=d||0;var e=+N.cos(a).toFixed(9),f=+N.sin(a).toFixed(9);this.add(e,f,-f,e,b,d),this.add(1,0,0,1,-b,-d)},a.x=function(a,b){return a*this.a+b*this.c+this.e},a.y=function(a,b){return a*this.b+b*this.d+this.f},a.get=function(a){return+this[I.fromCharCode(97+a)].toFixed(4)},a.toString=function(){return c.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},a.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},a.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},a.split=function(){var a={};a.dx=this.e,a.dy=this.f;var e=[[this.a,this.c],[this.b,this.d]];a.scalex=N.sqrt(b(e[0])),d(e[0]),a.shear=e[0][0]*e[1][0]+e[0][1]*e[1][1],e[1]=[e[1][0]-e[0][0]*a.shear,e[1][1]-e[0][1]*a.shear],a.scaley=N.sqrt(b(e[1])),d(e[1]),a.shear/=a.scaley;var f=-e[0][1],g=e[1][1];return 0>g?(a.rotate=c.deg(N.acos(g)),0>f&&(a.rotate=360-a.rotate)):a.rotate=c.deg(N.asin(f)),a.isSimple=!(+a.shear.toFixed(9)||a.scalex.toFixed(9)!=a.scaley.toFixed(9)&&a.rotate),a.isSuperSimple=!+a.shear.toFixed(9)&&a.scalex.toFixed(9)==a.scaley.toFixed(9)&&!a.rotate,a.noRotation=!+a.shear.toFixed(9)&&!a.rotate,a},a.toTransformString=function(a){var b=a||this[J]();return b.isSimple?(b.scalex=+b.scalex.toFixed(4),b.scaley=+b.scaley.toFixed(4),b.rotate=+b.rotate.toFixed(4),(b.dx||b.dy?"t"+[b.dx,b.dy]:G)+(1!=b.scalex||1!=b.scaley?"s"+[b.scalex,b.scaley,0,0]:G)+(b.rotate?"r"+[b.rotate,0,0]:G)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(o.prototype);var Qb=navigator.userAgent.match(/Version\/(.*?)\s/)||navigator.userAgent.match(/Chrome\/(\d+)/);v.safari="Apple Computer, Inc."==navigator.vendor&&(Qb&&Qb[1]<4||"iP"==navigator.platform.slice(0,2))||"Google Inc."==navigator.vendor&&Qb&&Qb[1]<8?function(){var a=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});setTimeout(function(){a.remove()})}:mb;for(var Rb=function(){this.returnValue=!1},Sb=function(){return this.originalEvent.preventDefault()},Tb=function(){this.cancelBubble=!0},Ub=function(){return this.originalEvent.stopPropagation()},Vb=function(a){var b=A.doc.documentElement.scrollTop||A.doc.body.scrollTop,c=A.doc.documentElement.scrollLeft||A.doc.body.scrollLeft;return{x:a.clientX+c,y:a.clientY+b}},Wb=function(){return A.doc.addEventListener?function(a,b,c,d){var e=function(a){var b=Vb(a);return c.call(d,a,b.x,b.y)};if(a.addEventListener(b,e,!1),F&&L[b]){var f=function(b){for(var e=Vb(b),f=b,g=0,h=b.targetTouches&&b.targetTouches.length;h>g;g++)if(b.targetTouches[g].target==a){b=b.targetTouches[g],b.originalEvent=f,b.preventDefault=Sb,b.stopPropagation=Ub;break}return c.call(d,b,e.x,e.y)};a.addEventListener(L[b],f,!1)}return function(){return a.removeEventListener(b,e,!1),F&&L[b]&&a.removeEventListener(L[b],e,!1),!0}}:A.doc.attachEvent?function(a,b,c,d){var e=function(a){a=a||A.win.event;var b=A.doc.documentElement.scrollTop||A.doc.body.scrollTop,e=A.doc.documentElement.scrollLeft||A.doc.body.scrollLeft,f=a.clientX+e,g=a.clientY+b;return a.preventDefault=a.preventDefault||Rb,a.stopPropagation=a.stopPropagation||Tb,c.call(d,a,f,g)};a.attachEvent("on"+b,e);var f=function(){return a.detachEvent("on"+b,e),!0};return f}:void 0}(),Xb=[],Yb=function(a){for(var c,d=a.clientX,e=a.clientY,f=A.doc.documentElement.scrollTop||A.doc.body.scrollTop,g=A.doc.documentElement.scrollLeft||A.doc.body.scrollLeft,h=Xb.length;h--;){if(c=Xb[h],F&&a.touches){for(var i,j=a.touchLine truncated
|
||||||
|
if(f[a]("text")){for(g.text=f.text;h.firstChild;)h.removeChild(h.firstChild);for(var j,k=b(f.text).split("\n"),m=[],n=0,o=k.length;o>n;n++)j=q("tspan"),n&&q(j,{dy:i*x,x:g.x}),j.appendChild(c._g.doc.createTextNode(k[n])),h.appendChild(j),m[n]=j}else for(m=h.getElementsByTagName("tspan"),n=0,o=m.length;o>n;n++)n?q(m[n],{dy:i*x,x:g.x}):q(m[0],{dy:0});q(h,{x:g.x,y:g.y}),d._.dirty=1;var p=d._getBBox(),r=g.y-(p.y+p.height/2);r&&c.is(r,"finite")&&q(m[0],{dy:r})}},z=function(a,b){this[0]=this.node=a,a.raphael=!0,this.id=c._oid++,a.raphaelid=this.id,this.matrix=c.matrix(),this.realPath=null,this.paper=b,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!b.bottom&&(b.bottom=this),this.prev=b.top,b.top&&(b.top.next=this),b.top=this,this.next=null},A=c.el;z.prototype=A,A.constructor=z,c._engine.path=function(a,b){var c=q("path");b.canvas&&b.canvas.appendChild(c);var d=new z(c,b);return d.type="path",w(d,{fill:"none",stroke:"#000",path:a}),d},A.rotate=function(a,c,e){if(this.removed)return this;if(a=b(a).split(j),a.length-1&&(c=d(a[1]),e=d(a[2])),a=d(a[0]),null==e&&(c=e),null==c||null==e){var f=this.getBBox(1);c=f.x+f.width/2,e=f.y+f.height/2}return this.transform(this._.transform.concat([["r",a,c,e]])),this},A.scale=function(a,c,e,f){if(this.removed)return this;if(a=b(a).split(j),a.length-1&&(c=d(a[1]),e=d(a[2]),f=d(a[3])),a=d(a[0]),null==c&&(c=a),null==f&&(e=f),null==e||null==f)var g=this.getBBox(1);return e=null==e?g.x+g.width/2:e,f=null==f?g.y+g.height/2:f,this.transform(this._.transform.concat([["s",a,c,e,f]])),this},A.translate=function(a,c){return this.removed?this:(a=b(a).split(j),a.length-1&&(c=d(a[1])),a=d(a[0])||0,c=+c||0,this.transform(this._.transform.concat([["t",a,c]])),this)},A.transform=function(b){var d=this._;if(null==b)return d.transform;if(c._extractTransform(this,b),this.clip&&q(this.clip,{transform:this.matrix.invert()}),this.pattern&&s(this),this.node&&q(this.node,{transform:this.matrix}),1!=d.sx||1!=d.sy){var e=this.attrs[a]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":e})}return this},A.hide=function(){return!this.removed&&this.paper.safari(this.node.style.display="none"),this},A.show=function(){return!this.removed&&this.paper.safari(this.node.style.display=""),this},A.remove=function(){if(!this.removed&&this.node.parentNode){var a=this.paper;a.__set__&&a.__set__.exclude(this),k.unbind("raphael.*.*."+this.id),this.gradient&&a.defs.removeChild(this.gradient),c._tear(this,a),"a"==this.node.parentNode.tagName.toLowerCase()?this.node.parentNode.parentNode.removeChild(this.node.parentNode):this.node.parentNode.removeChild(this.node);for(var b in this)this[b]="function"==typeof this[b]?c._removedFactory(b):null;this.removed=!0}},A._getBBox=function(){if("none"==this.node.style.display){this.show();var a=!0}var b={};try{b=this.node.getBBox()}catch(c){}finally{b=b||{}}return a&&this.hide(),b},A.attr=function(b,d){if(this.removed)return this;if(null==b){var e={};for(var f in this.attrs)this.attrs[a](f)&&(e[f]=this.attrs[f]);return e.gradient&&"none"==e.fill&&(e.fill=e.gradient)&&delete e.gradient,e.transform=this._.transform,e}if(null==d&&c.is(b,"string")){if("fill"==b&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;if("transform"==b)return this._.transform;for(var g=b.split(j),h={},i=0,l=g.length;l>i;i++)b=g[i],h[b]=b in this.attrs?this.attrs[b]:c.is(this.paper.customAttributes[b],"function")?this.paper.customAttributes[b].def:c._availableAttrs[b];return l-1?h:h[g[0]]}if(null==d&&c.is(b,"array")){for(h={},i=0,l=b.length;l>i;i++)h[b[i]]=this.attr(b[i]);return h}if(null!=d){var m={};m[b]=d}else null!=b&&c.is(b,"object")&&(m=b);for(var n in m)k("raphael.attr."+n+"."+this.id,this,m[n]);for(n in this.paper.customAttributes)if(this.paper.customAttributes[a](n)&&m[a](n)&&c.is(this.paper.customAttributes[n],"function")){var o=this.paper.customAttributes[n].apply(this,[].concat(m[n]));this.attrs[n]=m[n];for(var p in o)o[a](p)&&(m[p]=o[p])}return w(this,m),this},A.toFront=function(){if(this.removed)return this;"a"==this.node.parentNode.tagName.toLowerCase()?this.node.parentNode.parentNode.appendChild(this.node.parentNode):this.node.parentNode.appendChild(this.node);var a=this.paper;return a.top!=this&&c._tofront(this,a),this},A.toBack=function(){if(this.removed)return this;var a=this.node.parentNode;return"a"==a.tagName.toLowerCase()?a.parentNode.insertBefore(this.node.parentNode,this.node.parentNode.parentNode.firstChild):a.firstChild!=this.node&&a.insertBefore(this.node,this.node.parentNode.firstChild),c._toback(this,this.paper),this.paper,this},A.insertAfter=function(a){if(this.removed)return this;var b=a.node||a[a.length-1].node;return b.nextSibling?b.parentNode.insertBefore(this.node,b.nextSibling):b.parentNode.appendChild(this.node),c._insertafter(this,a,this.paper),this},A.insertBefore=function(a){if(this.removed)return this;var b=a.node||a[0].node;return b.parentNode.insertBefore(this.node,b),c._insertbefore(this,a,this.pLine truncated
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
/** js sequence diagrams 1.0.4
|
||||||
|
* http://bramp.github.io/js-sequence-diagrams/
|
||||||
|
* (c) 2012-2013 Andrew Brampton (bramp.net)
|
||||||
|
* @license Simplified BSD license.
|
||||||
|
*/
|
||||||
|
(function(){"use strict";function Diagram(){this.title=void 0,this.actors=[],this.signals=[]}function ParseError(message,hash){_.extend(this,hash),this.name="ParseError",this.message=message||""}Diagram.prototype.getActor=function(alias){var s=/^(.+) as (\S+)$/i.exec(alias.trim());s?(name=s[1].trim(),alias=s[2].trim()):name=alias.trim(),name=name.replace(/\\n/gm,"\n");var i,actors=this.actors;for(i in actors)if(actors[i].alias==alias)return actors[i];return i=actors.push(new Diagram.Actor(alias,name,actors.length)),actors[i-1]},Diagram.prototype.setTitle=function(title){this.title=title},Diagram.prototype.addSignal=function(signal){this.signals.push(signal)},Diagram.Actor=function(alias,name,index){this.alias=alias,this.name=name,this.index=index},Diagram.Signal=function(actorA,signaltype,actorB,message){this.type="Signal",this.actorA=actorA,this.actorB=actorB,this.linetype=3&signaltype,this.arrowtype=signaltype>>2&3,this.message=message},Diagram.Signal.prototype.isSelf=function(){return this.actorA.index==this.actorB.index},Diagram.Note=function(actor,placement,message){if(this.type="Note",this.actor=actor,this.placement=placement,this.message=message,this.hasManyActors()&&actor[0]==actor[1])throw new Error("Note should be over two different actors")},Diagram.Note.prototype.hasManyActors=function(){return _.isArray(this.actor)},Diagram.LINETYPE={SOLID:0,DOTTED:1},Diagram.ARROWTYPE={FILLED:0,OPEN:1},Diagram.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2};var grammar=function(){function Parser(){this.yy={}}var parser={trace:function(){},yy:{},symbols_:{error:2,start:3,document:4,EOF:5,line:6,statement:7,NL:8,participant:9,actor:10,signal:11,note_statement:12,title:13,message:14,note:15,placement:16,over:17,actor_pair:18,",":19,left_of:20,right_of:21,signaltype:22,ACTOR:23,linetype:24,arrowtype:25,LINE:26,DOTLINE:27,ARROW:28,OPENARROW:29,MESSAGE:30,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"NL",9:"participant",13:"title",15:"note",17:"over",19:",",20:"left_of",21:"right_of",23:"ACTOR",26:"LINE",27:"DOTLINE",28:"ARROW",29:"OPENARROW",30:"MESSAGE"},productions_:[0,[3,2],[4,0],[4,2],[6,1],[6,1],[7,2],[7,1],[7,1],[7,2],[12,4],[12,4],[18,1],[18,3],[16,1],[16,1],[11,4],[10,1],[22,2],[22,1],[24,1],[24,1],[25,1],[25,1],[14,1]],performAction:function(yytext,yyleng,yylineno,yy,yystate,$$){var $0=$$.length-1;switch(yystate){case 1:return yy;case 4:break;case 6:$$[$0];break;case 7:yy.addSignal($$[$0]);break;case 8:yy.addSignal($$[$0]);break;case 9:yy.setTitle($$[$0]);break;case 10:this.$=new Diagram.Note($$[$0-1],$$[$0-2],$$[$0]);break;case 11:this.$=new Diagram.Note($$[$0-1],Diagram.PLACEMENT.OVER,$$[$0]);break;case 12:this.$=$$[$0];break;case 13:this.$=[$$[$0-2],$$[$0]];break;case 14:this.$=Diagram.PLACEMENT.LEFTOF;break;case 15:this.$=Diagram.PLACEMENT.RIGHTOF;break;case 16:this.$=new Diagram.Signal($$[$0-3],$$[$0-2],$$[$0-1],$$[$0]);break;case 17:this.$=yy.getActor($$[$0]);break;case 18:this.$=$$[$0-1]|$$[$0]<<2;break;case 19:this.$=$$[$0];break;case 20:this.$=Diagram.LINETYPE.SOLID;break;case 21:this.$=Diagram.LINETYPE.DOTTED;break;case 22:this.$=Diagram.ARROWTYPE.FILLED;break;case 23:this.$=Diagram.ARROWTYPE.OPEN;break;case 24:this.$=$$[$0].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:2,5:[2,2],8:[2,2],9:[2,2],13:[2,2],15:[2,2],23:[2,2]},{1:[3]},{5:[1,3],6:4,7:5,8:[1,6],9:[1,7],10:11,11:8,12:9,13:[1,10],15:[1,12],23:[1,13]},{1:[2,1]},{5:[2,3],8:[2,3],9:[2,3],13:[2,3],15:[2,3],23:[2,3]},{5:[2,4],8:[2,4],9:[2,4],13:[2,4],15:[2,4],23:[2,4]},{5:[2,5],8:[2,5],9:[2,5],13:[2,5],15:[2,5],23:[2,5]},{10:14,23:[1,13]},{5:[2,7],8:[2,7],9:[2,7],13:[2,7],15:[2,7],23:[2,7]},{5:[2,8],8:[2,8],9:[2,8],13:[2,8],15:[2,8],23:[2,8]},{14:15,30:[1,16]},{22:17,24:18,26:[1,19],27:[1,20]},{16:21,17:[1,22],20:[1,23],21:[1,24]},{5:[2,17],8:[2,17],9:[2,17],13:[2,17],15:[2,17],19:[2,17],23:[2,17],26:[2,17],27:[2,17],30:[2,17]},{5:[2,6],8:[2,6],9:[2,6],13:[2,6],15:[2,6],23:[2,6]},{5:[2,9],8:[2,9],9:[2,9],13:[2,9],15:[2,9],23:[2,9]},{5:[2,24],8:[2,24],9:[2,24],13:[2,24],15:[2,24],23:[2,24]},{10:25,23:[1,13]},{23:[2,19],25:26,28:[1,27],29:[1,28]},{23:[2,20],28:[2,20],29:[2,20]},{23:[2,21],28:[2,21],29:[2,21]},{10:29,23:[1,13]},{10:31,18:30,23:[1,13]},{23:[2,14]},{23:[2,15]},{14:32,30:[1,16]},{23:[2,18]},{23:[2,22]},{23:[2,23]},{14:33,30:[1,16]},{14:34,30:[1,16]},{19:[1,35],30:[2,12]},{5:[2,16],8:[2,16],9:[2,16],13:[2,16],15:[2,16],23:[2,16]},{5:[2,10],8:[2,10],9:[2,10],13:[2,10],15:[2,10],23:[2,10]},{5:[2,11],8:[2,11],9:[2,11],13:[2,11],15:[2,11],23:[2,11]},{10:36,23:[1,13]},{30:[2,13]}],defaultActions:{3:[2,1],23:[2,14],24:[2,15],26:[2,18],27:[2,22],28:[2,23],36:[2,13]},parseError:function(str,hash){if(!hash.recoverable)throw new Error(str);this.trace(str)},parse:function(input){function lex(){var token;return token=self.lexer.lex()||EOF,"number"!=typeof token&&(token=self.symbols_[token]||token),token}var self=this,stack=[0],vstack=[null],lstack=[],table=this.table,yytext="",yylineno=0,yyleng=0,recovering=0,TERROR=2,EOF=1;this.lexer.sLine truncated
|
||||||
|
}):init(Raphael)}(function(Raphael){"use strict";function AssertException(message){this.message=message}function assert(exp,message){if(!exp)throw new AssertException(message)}function getCenterX(box){return box.x+box.width/2}function getCenterY(box){return box.y+box.height/2}var DIAGRAM_MARGIN=10,ACTOR_MARGIN=10,ACTOR_PADDING=10,SIGNAL_MARGIN=5,SIGNAL_PADDING=5,NOTE_MARGIN=10,NOTE_PADDING=5,NOTE_OVERLAP=15,TITLE_MARGIN=0,TITLE_PADDING=5,SELF_SIGNAL_WIDTH=20,PLACEMENT=Diagram.PLACEMENT,LINETYPE=Diagram.LINETYPE,ARROWTYPE=Diagram.ARROWTYPE,LINE={stroke:"#000","stroke-width":2},RECT={fill:"#fff"};AssertException.prototype.toString=function(){return"AssertException: "+this.message},String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),Raphael.fn.line=function(x1,y1,x2,y2){return assert(_.all([x1,x2,y1,y2],_.isFinite),"x1,x2,y1,y2 must be numeric"),this.path("M{0},{1} L{2},{3}",x1,y1,x2,y2)},Raphael.fn.wobble=function(x1,y1,x2,y2){assert(_.all([x1,x2,y1,y2],_.isFinite),"x1,x2,y1,y2 must be numeric");var wobble=Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))/25,r1=Math.random(),r2=Math.random(),xfactor=Math.random()>.5?wobble:-wobble,yfactor=Math.random()>.5?wobble:-wobble,p1={x:(x2-x1)*r1+x1+xfactor,y:(y2-y1)*r1+y1+yfactor},p2={x:(x2-x1)*r2+x1-xfactor,y:(y2-y1)*r2+y1-yfactor};return"C"+p1.x+","+p1.y+" "+p2.x+","+p2.y+" "+x2+","+y2},Raphael.fn.text_bbox=function(text,font){var p;font._obj?p=this.print_center(0,0,text,font._obj,font["font-size"]):(p=this.text(0,0,text),p.attr(font));var bb=p.getBBox();return p.remove(),bb},Raphael.fn.handRect=function(x,y,w,h){return assert(_.all([x,y,w,h],_.isFinite),"x, y, w, h must be numeric"),this.path("M"+x+","+y+this.wobble(x,y,x+w,y)+this.wobble(x+w,y,x+w,y+h)+this.wobble(x+w,y+h,x,y+h)+this.wobble(x,y+h,x,y)).attr(RECT)},Raphael.fn.handLine=function(x1,y1,x2,y2){return assert(_.all([x1,x2,y1,y2],_.isFinite),"x1,x2,y1,y2 must be numeric"),this.path("M"+x1+","+y1+this.wobble(x1,y1,x2,y2))},Raphael.fn.print_center=function(x,y,string,font,size,letter_spacing){var path=this.print(x,y,string,font,size,"baseline",letter_spacing),bb=path.getBBox(),dx=x-bb.x-bb.width/2,dy=y-bb.y-bb.height/2,m=new Raphael.matrix;return m.translate(dx,dy),path.attr("path",Raphael.mapPath(path.attr("path"),m))};var BaseTheme=function(diagram){this.init(diagram)};_.extend(BaseTheme.prototype,{init:function(diagram){this.diagram=diagram,this._paper=void 0,this._font=void 0,this._title=void 0,this._actors_height=0,this._signals_height=0;var a=this.arrow_types={};a[ARROWTYPE.FILLED]="block",a[ARROWTYPE.OPEN]="open";var l=this.line_types={};l[LINETYPE.SOLID]="",l[LINETYPE.DOTTED]="-"},init_paper:function(container){this._paper=new Raphael(container,320,200)},init_font:function(){},draw_line:function(x1,y1,x2,y2){return this._paper.line(x1,y1,x2,y2)},draw_rect:function(x,y,w,h){return this._paper.rect(x,y,w,h)},draw:function(container){var diagram=this.diagram;this.init_paper(container),this.init_font(),this.layout();var title_height=this._title?this._title.height:0;this._paper.setStart(),this._paper.setSize(diagram.width,diagram.height);var y=DIAGRAM_MARGIN+title_height;this.draw_title(),this.draw_actors(y),this.draw_signals(y+this._actors_height),this._paper.setFinish()},layout:function(){function actor_ensure_distance(a,b,d){assert(b>a,"a must be less than or equal to b"),0>a?(b=actors[b],b.x=Math.max(d-b.width/2,b.x)):b>=actors.length?(a=actors[a],a.padding_right=Math.max(d,a.padding_right)):(a=actors[a],a.distances[b]=Math.max(d,a.distances[b]?a.distances[b]:0))}var diagram=this.diagram,paper=this._paper,font=this._font,actors=diagram.actors,signals=diagram.signals;if(diagram.width=0,diagram.height=0,diagram.title){var title=this._title={},bb=paper.text_bbox(diagram.title,font);title.text_bb=bb,title.message=diagram.title,title.width=bb.width+2*(TITLE_PADDING+TITLE_MARGIN),title.height=bb.height+2*(TITLE_PADDING+TITLE_MARGIN),title.x=DIAGRAM_MARGIN,title.y=DIAGRAM_MARGIN,diagram.width+=title.width,diagram.height+=title.height}_.each(actors,function(a){var bb=paper.text_bbox(a.name,font);a.text_bb=bb,a.x=0,a.y=0,a.width=bb.width+2*(ACTOR_PADDING+ACTOR_MARGIN),a.height=bb.height+2*(ACTOR_PADDING+ACTOR_MARGIN),a.distances=[],a.padding_right=0,this._actors_height=Math.max(a.height,this._actors_height)},this),_.each(signals,function(s){var a,b,bb=paper.text_bbox(s.message,font);s.text_bb=bb,s.width=bb.width,s.height=bb.height;var extra_width=0;if("Signal"==s.type)s.width+=2*(SIGNAL_MARGIN+SIGNAL_PADDING),s.height+=2*(SIGNAL_MARGIN+SIGNAL_PADDING),s.isSelf()?(a=s.actorA.index,b=a+1,s.width+=SELF_SIGNAL_WIDTH):(a=Math.min(s.actorA.index,s.actorB.index),b=Math.max(s.actorA.index,s.actorB.index));else{if("Note"!=s.type)throw new Error("Unhandled signal type:"+s.type);if(s.width+=2*(NOTE_MARGIN+NOTE_PADDING),s.height+=2*(NOTE_MARGIN+NOTE_PADDING),extra_width=2*ACTOR_MARGIN,s.placement==PLACEMENT.LEFTOF)b=s.actor.index,a=b-1;else if(s.placement==PLACEMENT.RIGHTOF)a=s.actorLine truncated
|
||||||
|
//# sourceMappingURL=build/sequence-diagram-min.js.map
|
||||||
Reference in new issue
Block a user