markdown editor v2 libs

This commit is contained in:
lealife
2015-11-22 22:36:53 +08:00
parent 6a753682b7
commit 3ff0a9e09c
12 changed files with 825 additions and 10 deletions

View File

@ -625,7 +625,7 @@ function log(o) {
<li class="wmd-button-group3 btn-group"></li>
</ul>
<ul class="nav left-buttons">
<li class="wmd-button-group5 btn-group"></li>
<li class="wmd-button-group4 btn-group"></li>
</ul>
<!-- 帮助 -->
<ul class="nav left-buttons">
@ -717,15 +717,15 @@ function log(o) {
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">&times;</button>
<h4 class="modal-title">{{msg . "Image"}}</h4>
<h4 class="modal-title">{{leaMsg . "Image"}}</h4>
</div>
<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>
</div>
<div class="modal-footer">
<a href="#" class="btn btn-default"
data-dismiss="modal">{{msg . "Cancel"}}</a> <a href="#"
class="btn btn-primary action-insert-image" data-dismiss="modal">{{msg . "Insert Image"}}</a>
data-dismiss="modal">{{leaMsg . "Cancel"}}</a> <a href="#"
class="btn btn-primary action-insert-image" data-dismiss="modal">{{leaMsg . "Insert Image"}}</a>
</div>
</div>
</div>
@ -898,10 +898,10 @@ window.require = {
};
</script>
<script src="/js/markdown.min.js"></script>
<script src="/js/markdown-v2.min.js"></script>
<script src="/public/js/plugins/main.min.js"></script>
</body>
</html>
</html>

View File

@ -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;}

View File

@ -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;}

View File

@ -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;}

7
public/js/markdown-v2.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

11
public/libs/uml/raphael.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long