
Mention: Changes mention.js to at.js
@e7345e8921a1cea51fc10940799d4a3de9a1fdf6
--- app/controllers/ProjectApp.java
+++ app/controllers/ProjectApp.java
... | ... | @@ -500,11 +500,9 @@ |
500 | 500 |
collectAuthorAndCommenter(project, number, userList, resourceType); |
501 | 501 |
addProjectMemberList(project, userList); |
502 | 502 |
userList.remove(UserApp.currentUser()); |
503 |
- List<Issue> issueList = getMentionIssueList(project); |
|
504 | 503 |
|
505 | 504 |
List<Map<String, String>> mentionList = new ArrayList<>(); |
506 | 505 |
collectedUsersToMap(mentionList, userList); |
507 |
- collectedIssuesToMap(mentionList, issueList); |
|
508 | 506 |
return ok(toJson(mentionList)); |
509 | 507 |
} |
510 | 508 |
|
... | ... | @@ -862,8 +860,9 @@ |
862 | 860 |
for(User user: userList) { |
863 | 861 |
Map<String, String> projectUserMap = new HashMap<>(); |
864 | 862 |
if(!user.loginId.equals(Constants.ADMIN_LOGIN_ID) && user != null){ |
865 |
- projectUserMap.put("username", user.loginId); |
|
866 |
- projectUserMap.put("name", user.name); |
|
863 |
+ projectUserMap.put("loginid", user.loginId); |
|
864 |
+ projectUserMap.put("username", user.name); |
|
865 |
+ projectUserMap.put("name", user.name + user.loginId); |
|
867 | 866 |
projectUserMap.put("image", user.avatarUrl()); |
868 | 867 |
users.add(projectUserMap); |
869 | 868 |
} |
--- app/views/board/create.scala.html
+++ app/views/board/create.scala.html
... | ... | @@ -78,8 +78,11 @@ |
78 | 78 |
|
79 | 79 |
@common.markdown(project) |
80 | 80 |
|
81 |
-<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/mentionjs/mention.css")"> |
|
82 |
-<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/mentionjs/mention.js")"></script> |
|
81 |
+<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.css")"> |
|
82 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.caret.min.js")"></script> |
|
83 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.js")"></script> |
|
84 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.browser.js")"></script> |
|
85 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.firefox.keyfix.js")"></script> |
|
83 | 86 |
<script type="text/javascript"> |
84 | 87 |
$(document).ready(function(){ |
85 | 88 |
$yobi.loadModule("board.Write", { |
--- app/views/board/edit.scala.html
+++ app/views/board/edit.scala.html
... | ... | @@ -79,8 +79,11 @@ |
79 | 79 |
</div> |
80 | 80 |
@common.markdown(project) |
81 | 81 |
|
82 |
-<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/mentionjs/mention.css")"> |
|
83 |
-<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/mentionjs/mention.js")"></script> |
|
82 |
+<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.css")"> |
|
83 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.caret.min.js")"></script> |
|
84 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.js")"></script> |
|
85 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.browser.js")"></script> |
|
86 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.firefox.keyfix.js")"></script> |
|
84 | 87 |
<script type="text/javascript"> |
85 | 88 |
$(document).ready(function(){ |
86 | 89 |
$yobi.loadModule("board.Write", { |
--- app/views/board/view.scala.html
+++ app/views/board/view.scala.html
... | ... | @@ -116,8 +116,11 @@ |
116 | 116 |
@common.markdown(project) |
117 | 117 |
@common.commentDeleteModal() |
118 | 118 |
|
119 |
-<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/mentionjs/mention.css")"> |
|
120 |
-<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/mentionjs/mention.js")"></script> |
|
119 |
+<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.css")"> |
|
120 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.caret.min.js")"></script> |
|
121 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.js")"></script> |
|
122 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.browser.js")"></script> |
|
123 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.firefox.keyfix.js")"></script> |
|
121 | 124 |
<script type="text/javascript"> |
122 | 125 |
$(document).ready(function(){ |
123 | 126 |
$yobi.loadModule("board.View", { |
--- app/views/code/diff.scala.html
+++ app/views/code/diff.scala.html
... | ... | @@ -201,8 +201,11 @@ |
201 | 201 |
@common.mergely() |
202 | 202 |
@common.commentDeleteModal("#code-browse-wrap") |
203 | 203 |
|
204 |
-<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/mentionjs/mention.css")"> |
|
205 |
-<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/mentionjs/mention.js")"></script> |
|
204 |
+<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.css")"> |
|
205 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.caret.min.js")"></script> |
|
206 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.js")"></script> |
|
207 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.browser.js")"></script> |
|
208 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.firefox.keyfix.js")"></script> |
|
206 | 209 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/common/yobi.CodeCommentBlock.js")"></script> |
207 | 210 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/common/yobi.CodeCommentBox.js")"></script> |
208 | 211 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/jquery/jquery-ui-1.10.4.custom.min.js")"></script> |
... | ... | @@ -219,6 +222,11 @@ |
219 | 222 |
target:'comment-editor', |
220 | 223 |
url : "@Html(routes.ProjectApp.mentionListAtCommitDiff(project.owner, project.name, commit.getId).toString)" |
221 | 224 |
}); |
225 |
+ |
|
226 |
+ yobi.Mention({ |
|
227 |
+ target:'review-editor', |
|
228 |
+ url : "@Html(routes.ProjectApp.mentionListAtCommitDiff(project.owner, project.name, commit.getId).toString)" |
|
229 |
+ }); |
|
222 | 230 |
}); |
223 | 231 |
</script> |
224 | 232 |
} |
--- app/views/code/svnDiff.scala.html
+++ app/views/code/svnDiff.scala.html
... | ... | @@ -178,8 +178,11 @@ |
178 | 178 |
|
179 | 179 |
<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/mergely/codemirror.css")"> |
180 | 180 |
<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/mergely/mergely.css")"> |
181 |
-<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/mentionjs/mention.css")"> |
|
182 |
-<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/mentionjs/mention.js")"></script> |
|
181 |
+<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.css")"> |
|
182 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.caret.min.js")"></script> |
|
183 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.js")"></script> |
|
184 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.browser.js")"></script> |
|
185 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.firefox.keyfix.js")"></script> |
|
183 | 186 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/diff.js")"></script> |
184 | 187 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/mergely/codemirror.min.js")"></script> |
185 | 188 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/mergely/mergely.js")"></script> |
--- app/views/common/reviewForm.scala.html
+++ app/views/common/reviewForm.scala.html
... | ... | @@ -21,6 +21,7 @@ |
21 | 21 |
@(project:Project, resourceType:ResourceType, action:String) |
22 | 22 |
|
23 | 23 |
@import models.enumeration.ResourceType |
24 |
+@import scala.collection.Map |
|
24 | 25 |
|
25 | 26 |
<div id="review-form" class="review-form"> |
26 | 27 |
<form action="@action" method="post" enctype="multipart/form-data"> |
... | ... | @@ -38,7 +39,7 @@ |
38 | 39 |
</div> |
39 | 40 |
<div class="write-comment-box nm"> |
40 | 41 |
<div class="write-comment-wrap"> |
41 |
- @common.editor("contents") |
|
42 |
+ @common.editor("contents", "", Map("id"->"review-editor")) |
|
42 | 43 |
|
43 | 44 |
@** fileUploader **@ |
44 | 45 |
@if(!UserApp.currentUser.isAnonymous){ |
--- app/views/git/create.scala.html
+++ app/views/git/create.scala.html
... | ... | @@ -131,8 +131,11 @@ |
131 | 131 |
</div> |
132 | 132 |
</div> |
133 | 133 |
</div> |
134 |
-<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/mentionjs/mention.css")"> |
|
135 |
-<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/mentionjs/mention.js")"></script> |
|
134 |
+<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.css")"> |
|
135 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.caret.min.js")"></script> |
|
136 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.js")"></script> |
|
137 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.browser.js")"></script> |
|
138 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.firefox.keyfix.js")"></script> |
|
136 | 139 |
<script type="text/javascript"> |
137 | 140 |
$(document).ready(function() { |
138 | 141 |
$yobi.loadModule("git.Write", { |
--- app/views/git/edit.scala.html
+++ app/views/git/edit.scala.html
... | ... | @@ -132,8 +132,11 @@ |
132 | 132 |
</div> |
133 | 133 |
@common.markdown(project) |
134 | 134 |
|
135 |
-<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/mentionjs/mention.css")"> |
|
136 |
-<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/mentionjs/mention.js")"></script> |
|
135 |
+<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.css")"> |
|
136 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.caret.min.js")"></script> |
|
137 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.js")"></script> |
|
138 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.browser.js")"></script> |
|
139 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.firefox.keyfix.js")"></script> |
|
137 | 140 |
<script type="text/javascript"> |
138 | 141 |
$(document).ready(function(){ |
139 | 142 |
$yobi.loadModule("git.Write"); |
--- app/views/git/view.scala.html
+++ app/views/git/view.scala.html
... | ... | @@ -123,8 +123,11 @@ |
123 | 123 |
@common.mergely() |
124 | 124 |
@common.commentDeleteModal() |
125 | 125 |
|
126 |
-<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/mentionjs/mention.css")"> |
|
127 |
-<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/mentionjs/mention.js")"></script> |
|
126 |
+<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.css")"> |
|
127 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.caret.min.js")"></script> |
|
128 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.js")"></script> |
|
129 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.browser.js")"></script> |
|
130 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.firefox.keyfix.js")"></script> |
|
128 | 131 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/diff.js")"></script> |
129 | 132 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/common/yobi.Interval.js")"></script> |
130 | 133 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/common/yobi.CodeCommentBox.js")"></script> |
--- app/views/git/viewChanges.scala.html
+++ app/views/git/viewChanges.scala.html
... | ... | @@ -198,8 +198,11 @@ |
198 | 198 |
@common.mergely() |
199 | 199 |
@common.commentDeleteModal("#changes") |
200 | 200 |
|
201 |
-<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/mentionjs/mention.css")"> |
|
202 |
-<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/mentionjs/mention.js")"></script> |
|
201 |
+<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.css")"> |
|
202 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.caret.min.js")"></script> |
|
203 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.js")"></script> |
|
204 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.browser.js")"></script> |
|
205 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.firefox.keyfix.js")"></script> |
|
203 | 206 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/common/yobi.CodeCommentBox.js")"></script> |
204 | 207 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/common/yobi.CodeCommentBlock.js")"></script> |
205 | 208 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/jquery/jquery-ui-1.10.4.custom.min.js")"></script> |
... | ... | @@ -216,6 +219,15 @@ |
216 | 219 |
} |
217 | 220 |
}); |
218 | 221 |
|
222 |
+ yobi.Mention({ |
|
223 |
+ target:'review-editor', |
|
224 |
+ @if(pull.getCurrentCommits.isEmpty) { |
|
225 |
+ url : "@Html(routes.ProjectApp.mentionListAtPullRequest(pull.toProject.owner, pull.toProject.name, "", pull.id).toString())" |
|
226 |
+ } else { |
|
227 |
+ url : "@Html(routes.ProjectApp.mentionListAtPullRequest(pull.toProject.owner, pull.toProject.name, pull.getCurrentCommits.get(0).getCommitId, pull.id).toString())" |
|
228 |
+ } |
|
229 |
+ }); |
|
230 |
+ |
|
219 | 231 |
// code.Diff |
220 | 232 |
$yobi.loadModule("code.Diff", { |
221 | 233 |
"bCommentable" : @isProjectResourceCreatable(UserApp.currentUser, project, ResourceType.REVIEW_COMMENT) |
--- app/views/issue/create.scala.html
+++ app/views/issue/create.scala.html
... | ... | @@ -144,9 +144,9 @@ |
144 | 144 |
@common.markdown(project) |
145 | 145 |
@common.issueLabel() |
146 | 146 |
@common.select2() |
147 |
- |
|
148 |
-<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/mentionjs/mention.css")"> |
|
149 |
-<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/mentionjs/mention.js")"></script> |
|
147 |
+<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.css")"> |
|
148 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.caret.min.js")"></script> |
|
149 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.js")"></script> |
|
150 | 150 |
<script type="text/javascript"> |
151 | 151 |
$(document).ready(function(){ |
152 | 152 |
// yobi.Label |
--- app/views/issue/edit.scala.html
+++ app/views/issue/edit.scala.html
... | ... | @@ -29,6 +29,7 @@ |
29 | 29 |
|
30 | 30 |
@projectLayout(Messages(title), project, utils.MenuType.ISSUE) { |
31 | 31 |
@projectMenu(project, utils.MenuType.ISSUE, "main-menu-only") |
32 |
+ |
|
32 | 33 |
<div class="page-wrap-outer"> |
33 | 34 |
<div class="project-page-wrap"> |
34 | 35 |
<div class="content-wrap frm-wrap"> |
... | ... | @@ -185,8 +186,11 @@ |
185 | 186 |
@common.markdown(project) |
186 | 187 |
@common.issueLabel() |
187 | 188 |
@common.select2() |
188 |
-<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/mentionjs/mention.css")"> |
|
189 |
-<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/mentionjs/mention.js")"></script> |
|
189 |
+<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.css")"> |
|
190 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.caret.min.js")"></script> |
|
191 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.js")"></script> |
|
192 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.browser.js")"></script> |
|
193 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.firefox.keyfix.js")"></script> |
|
190 | 194 |
<script type="text/javascript"> |
191 | 195 |
$(document).ready(function(){ |
192 | 196 |
// yobi.Label |
--- app/views/issue/view.scala.html
+++ app/views/issue/view.scala.html
... | ... | @@ -331,8 +331,11 @@ |
331 | 331 |
@common.select2() |
332 | 332 |
|
333 | 333 |
<link rel="stylesheet" type="text/css" media="screen" href="@routes.IssueLabelApp.labelStyles(project.owner, project.name)"> |
334 |
-<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/mentionjs/mention.css")"> |
|
335 |
-<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/mentionjs/mention.js")"></script> |
|
334 |
+<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.css")"> |
|
335 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.caret.min.js")"></script> |
|
336 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.js")"></script> |
|
337 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.browser.js")"></script> |
|
338 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.firefox.keyfix.js")"></script> |
|
336 | 339 |
<script type="text/javascript"> |
337 | 340 |
$(document).ready(function(){ |
338 | 341 |
// yobi.issue.View |
--- app/views/milestone/create.scala.html
+++ app/views/milestone/create.scala.html
... | ... | @@ -73,9 +73,11 @@ |
73 | 73 |
</div> |
74 | 74 |
@common.markdown(project) |
75 | 75 |
|
76 |
-<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/mentionjs/mention.css")"> |
|
77 |
-<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/mentionjs/mention.js")"></script> |
|
78 |
- |
|
76 |
+<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.css")"> |
|
77 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.caret.min.js")"></script> |
|
78 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.js")"></script> |
|
79 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.browser.js")"></script> |
|
80 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.firefox.keyfix.js")"></script> |
|
79 | 81 |
<link rel="stylesheet" type="text/css" href="@routes.Assets.at("javascripts/lib/pikaday/pikaday.css")" /> |
80 | 82 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/moment-with-langs.min.js")"></script> |
81 | 83 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/pikaday/pikaday.js")"></script> |
--- app/views/milestone/edit.scala.html
+++ app/views/milestone/edit.scala.html
... | ... | @@ -77,9 +77,11 @@ |
77 | 77 |
</div> |
78 | 78 |
@common.markdown(project) |
79 | 79 |
|
80 |
-<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/mentionjs/mention.css")"> |
|
81 |
-<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/mentionjs/mention.js")"></script> |
|
82 |
- |
|
80 |
+<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.css")"> |
|
81 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.caret.min.js")"></script> |
|
82 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.atwho.js")"></script> |
|
83 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.browser.js")"></script> |
|
84 |
+<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/atjs/jquery.firefox.keyfix.js")"></script> |
|
83 | 85 |
<link rel="stylesheet" type="text/css" href="@routes.Assets.at("javascripts/lib/pikaday/pikaday.css")" /> |
84 | 86 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/moment-with-langs.min.js")"></script> |
85 | 87 |
<script type="text/javascript" src="@routes.Assets.at("javascripts/lib/pikaday/pikaday.js")"></script> |
--- public/javascripts/common/yobi.Mention.js
+++ public/javascripts/common/yobi.Mention.js
... | ... | @@ -29,15 +29,12 @@ |
29 | 29 |
*/ |
30 | 30 |
function _initVar(htOptions) { |
31 | 31 |
htVar = htOptions || {}; // set htVar as htOptions |
32 |
- |
|
33 |
- htVar.htMentionList = { |
|
34 |
- "emptyQuery": true, |
|
35 |
- "typeaheadOpts": { |
|
36 |
- "items": 15 |
|
37 |
- }, |
|
38 |
- "users": [], |
|
39 |
- "queryBy": ["username", "name"] |
|
40 |
- }; |
|
32 |
+ htVar.atConfig = { |
|
33 |
+ at: "@", |
|
34 |
+ data: [], |
|
35 |
+ tpl: "<li data-value='@${loginid}'><img style='width:20px;height:20px;' src='${image}'> ${username} <small>${loginid}</small></li>", |
|
36 |
+ show_the_at: true |
|
37 |
+ } |
|
41 | 38 |
} |
42 | 39 |
|
43 | 40 |
/** |
... | ... | @@ -62,8 +59,8 @@ |
62 | 59 |
function _onKeyInput(eEvt){ |
63 | 60 |
eEvt = eEvt || window.event; |
64 | 61 |
|
65 |
- if(eEvt.which === 64 || eEvt.which === 35){ // 64 = @ or 35 = # |
|
66 |
- if(htVar.htMentionList.users.length == 0) { |
|
62 |
+ if(eEvt.which === 64) { // 64 = @ |
|
63 |
+ if(htVar.atConfig.data.length == 0) { |
|
67 | 64 |
_findMentionList(); |
68 | 65 |
} |
69 | 66 |
} |
... | ... | @@ -82,8 +79,11 @@ |
82 | 79 |
} |
83 | 80 |
|
84 | 81 |
function _onLoadUserList(aData){ |
85 |
- htVar.htMentionList.users = aData; |
|
86 |
- htElement.welTarget.mention(htVar.htMentionList); |
|
82 |
+ htVar.atConfig.data = aData; |
|
83 |
+ |
|
84 |
+ $inputor = htElement.welTarget.atwho(htVar.atConfig); |
|
85 |
+ $inputor.caret("pos", 47); |
|
86 |
+ $inputor.focus().atwho("run"); |
|
87 | 87 |
} |
88 | 88 |
|
89 | 89 |
_init(htOptions || {}); |
+++ public/javascripts/lib/atjs/jquery.atwho.css
... | ... | @@ -0,0 +1,46 @@ |
1 | +.atwho-view { | |
2 | + position:absolute; | |
3 | + top: 0; | |
4 | + left: 0; | |
5 | + display: none; | |
6 | + margin-top: 18px; | |
7 | + background: white; | |
8 | + border: 1px solid #DDD; | |
9 | + border-radius: 3px; | |
10 | + box-shadow: 0 0 5px rgba(0,0,0,0.1); | |
11 | + min-width: 120px; | |
12 | + z-index: 1000; | |
13 | +} | |
14 | + | |
15 | +.atwho-view .cur { | |
16 | + background: #3366FF; | |
17 | + color: white; | |
18 | +} | |
19 | +.atwho-view .cur small { | |
20 | + color: white; | |
21 | +} | |
22 | +.atwho-view strong { | |
23 | + color: #3366FF; | |
24 | +} | |
25 | +.atwho-view .cur strong { | |
26 | + color: white; | |
27 | + font:bold; | |
28 | +} | |
29 | +.atwho-view ul { | |
30 | + /* width: 100px; */ | |
31 | + list-style:none; | |
32 | + padding:0; | |
33 | + margin:auto; | |
34 | +} | |
35 | +.atwho-view ul li { | |
36 | + display: block; | |
37 | + padding: 5px 10px; | |
38 | + border-bottom: 1px solid #DDD; | |
39 | + cursor: pointer; | |
40 | + /* border-top: 1px solid #C8C8C8; */ | |
41 | +} | |
42 | +.atwho-view small { | |
43 | + font-size: smaller; | |
44 | + color: #777; | |
45 | + font-weight: normal; | |
46 | +} |
+++ public/javascripts/lib/atjs/jquery.atwho.js
... | ... | @@ -0,0 +1,809 @@ |
1 | +/*! jquery.atwho - v0.4.10 - 2014-04-18 | |
2 | +* Copyright (c) 2014 chord.luo <chord.luo@gmail.com>; | |
3 | +* homepage: http://ichord.github.com/At.js | |
4 | +* Licensed MIT | |
5 | +*/ | |
6 | + | |
7 | +(function() { | |
8 | + (function(factory) { | |
9 | + if (typeof define === 'function' && define.amd) { | |
10 | + return define(['jquery'], factory); | |
11 | + } else { | |
12 | + return factory(window.jQuery); | |
13 | + } | |
14 | + })(function($) { | |
15 | + | |
16 | +var $CONTAINER, Api, App, Atwho, Controller, DEFAULT_CALLBACKS, KEY_CODE, Model, View, | |
17 | + __slice = [].slice; | |
18 | + | |
19 | +App = (function() { | |
20 | + function App(inputor) { | |
21 | + this.current_flag = null; | |
22 | + this.controllers = {}; | |
23 | + this.alias_maps = {}; | |
24 | + this.$inputor = $(inputor); | |
25 | + this.iframe = null; | |
26 | + this.setIframe(); | |
27 | + this.listen(); | |
28 | + } | |
29 | + | |
30 | + App.prototype.setIframe = function(iframe) { | |
31 | + var error; | |
32 | + if (iframe) { | |
33 | + this.window = iframe.contentWindow; | |
34 | + this.document = iframe.contentDocument || this.window.document; | |
35 | + this.iframe = iframe; | |
36 | + return this; | |
37 | + } else { | |
38 | + this.document = this.$inputor[0].ownerDocument; | |
39 | + this.window = this.document.defaultView || this.document.parentWindow; | |
40 | + try { | |
41 | + return this.iframe = this.window.frameElement; | |
42 | + } catch (_error) { | |
43 | + error = _error; | |
44 | + } | |
45 | + } | |
46 | + }; | |
47 | + | |
48 | + App.prototype.controller = function(at) { | |
49 | + return this.controllers[this.alias_maps[at] || at || this.current_flag]; | |
50 | + }; | |
51 | + | |
52 | + App.prototype.set_context_for = function(at) { | |
53 | + this.current_flag = at; | |
54 | + return this; | |
55 | + }; | |
56 | + | |
57 | + App.prototype.reg = function(flag, setting) { | |
58 | + var controller, _base; | |
59 | + controller = (_base = this.controllers)[flag] || (_base[flag] = new Controller(this, flag)); | |
60 | + if (setting.alias) { | |
61 | + this.alias_maps[setting.alias] = flag; | |
62 | + } | |
63 | + controller.init(setting); | |
64 | + return this; | |
65 | + }; | |
66 | + | |
67 | + App.prototype.listen = function() { | |
68 | + return this.$inputor.on('keyup.atwhoInner', (function(_this) { | |
69 | + return function(e) { | |
70 | + return _this.on_keyup(e); | |
71 | + }; | |
72 | + })(this)).on('keydown.atwhoInner', (function(_this) { | |
73 | + return function(e) { | |
74 | + return _this.on_keydown(e); | |
75 | + }; | |
76 | + })(this)).on('scroll.atwhoInner', (function(_this) { | |
77 | + return function(e) { | |
78 | + var _ref; | |
79 | + return (_ref = _this.controller()) != null ? _ref.view.hide() : void 0; | |
80 | + }; | |
81 | + })(this)).on('blur.atwhoInner', (function(_this) { | |
82 | + return function(e) { | |
83 | + var c; | |
84 | + if (c = _this.controller()) { | |
85 | + return c.view.hide(c.get_opt("display_timeout")); | |
86 | + } | |
87 | + }; | |
88 | + })(this)); | |
89 | + }; | |
90 | + | |
91 | + App.prototype.shutdown = function() { | |
92 | + var c, _, _ref; | |
93 | + _ref = this.controllers; | |
94 | + for (_ in _ref) { | |
95 | + c = _ref[_]; | |
96 | + c.destroy(); | |
97 | + delete this.controllers[_]; | |
98 | + } | |
99 | + return this.$inputor.off('.atwhoInner'); | |
100 | + }; | |
101 | + | |
102 | + App.prototype.dispatch = function() { | |
103 | + return $.map(this.controllers, (function(_this) { | |
104 | + return function(c) { | |
105 | + if (c.look_up()) { | |
106 | + return _this.set_context_for(c.at); | |
107 | + } | |
108 | + }; | |
109 | + })(this)); | |
110 | + }; | |
111 | + | |
112 | + App.prototype.on_keyup = function(e) { | |
113 | + var _ref; | |
114 | + switch (e.keyCode) { | |
115 | + case KEY_CODE.ESC: | |
116 | + e.preventDefault(); | |
117 | + if ((_ref = this.controller()) != null) { | |
118 | + _ref.view.hide(); | |
119 | + } | |
120 | + break; | |
121 | + case KEY_CODE.DOWN: | |
122 | + case KEY_CODE.UP: | |
123 | + case KEY_CODE.CTRL: | |
124 | + $.noop(); | |
125 | + break; | |
126 | + case KEY_CODE.P: | |
127 | + case KEY_CODE.N: | |
128 | + if (!e.ctrlKey) { | |
129 | + this.dispatch(); | |
130 | + } | |
131 | + break; | |
132 | + default: | |
133 | + this.dispatch(); | |
134 | + } | |
135 | + }; | |
136 | + | |
137 | + App.prototype.on_keydown = function(e) { | |
138 | + var view, _ref; | |
139 | + view = (_ref = this.controller()) != null ? _ref.view : void 0; | |
140 | + if (!(view && view.visible())) { | |
141 | + return; | |
142 | + } | |
143 | + switch (e.keyCode) { | |
144 | + case KEY_CODE.ESC: | |
145 | + e.preventDefault(); | |
146 | + view.hide(); | |
147 | + break; | |
148 | + case KEY_CODE.UP: | |
149 | + e.preventDefault(); | |
150 | + view.prev(); | |
151 | + break; | |
152 | + case KEY_CODE.DOWN: | |
153 | + e.preventDefault(); | |
154 | + view.next(); | |
155 | + break; | |
156 | + case KEY_CODE.P: | |
157 | + if (!e.ctrlKey) { | |
158 | + return; | |
159 | + } | |
160 | + e.preventDefault(); | |
161 | + view.prev(); | |
162 | + break; | |
163 | + case KEY_CODE.N: | |
164 | + if (!e.ctrlKey) { | |
165 | + return; | |
166 | + } | |
167 | + e.preventDefault(); | |
168 | + view.next(); | |
169 | + break; | |
170 | + case KEY_CODE.TAB: | |
171 | + case KEY_CODE.ENTER: | |
172 | + if (!view.visible()) { | |
173 | + return; | |
174 | + } | |
175 | + e.preventDefault(); | |
176 | + view.choose(); | |
177 | + break; | |
178 | + default: | |
179 | + $.noop(); | |
180 | + } | |
181 | + }; | |
182 | + | |
183 | + return App; | |
184 | + | |
185 | +})(); | |
186 | + | |
187 | +Controller = (function() { | |
188 | + Controller.prototype.uid = function() { | |
189 | + return (Math.random().toString(16) + "000000000").substr(2, 8) + (new Date().getTime()); | |
190 | + }; | |
191 | + | |
192 | + function Controller(app, at) { | |
193 | + this.app = app; | |
194 | + this.at = at; | |
195 | + this.$inputor = this.app.$inputor; | |
196 | + this.id = this.$inputor[0].id || this.uid(); | |
197 | + this.setting = null; | |
198 | + this.query = null; | |
199 | + this.pos = 0; | |
200 | + this.cur_rect = null; | |
201 | + this.range = null; | |
202 | + $CONTAINER.append(this.$el = $("<div id='atwho-ground-" + this.id + "'></div>")); | |
203 | + this.model = new Model(this); | |
204 | + this.view = new View(this); | |
205 | + } | |
206 | + | |
207 | + Controller.prototype.init = function(setting) { | |
208 | + this.setting = $.extend({}, this.setting || $.fn.atwho["default"], setting); | |
209 | + this.view.init(); | |
210 | + return this.model.reload(this.setting.data); | |
211 | + }; | |
212 | + | |
213 | + Controller.prototype.destroy = function() { | |
214 | + this.trigger('beforeDestroy'); | |
215 | + this.model.destroy(); | |
216 | + this.view.destroy(); | |
217 | + return this.$el.remove(); | |
218 | + }; | |
219 | + | |
220 | + Controller.prototype.call_default = function() { | |
221 | + var args, error, func_name; | |
222 | + func_name = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; | |
223 | + try { | |
224 | + return DEFAULT_CALLBACKS[func_name].apply(this, args); | |
225 | + } catch (_error) { | |
226 | + error = _error; | |
227 | + return $.error("" + error + " Or maybe At.js doesn't have function " + func_name); | |
228 | + } | |
229 | + }; | |
230 | + | |
231 | + Controller.prototype.trigger = function(name, data) { | |
232 | + var alias, event_name; | |
233 | + if (data == null) { | |
234 | + data = []; | |
235 | + } | |
236 | + data.push(this); | |
237 | + alias = this.get_opt('alias'); | |
238 | + event_name = alias ? "" + name + "-" + alias + ".atwho" : "" + name + ".atwho"; | |
239 | + return this.$inputor.trigger(event_name, data); | |
240 | + }; | |
241 | + | |
242 | + Controller.prototype.callbacks = function(func_name) { | |
243 | + return this.get_opt("callbacks")[func_name] || DEFAULT_CALLBACKS[func_name]; | |
244 | + }; | |
245 | + | |
246 | + Controller.prototype.get_opt = function(at, default_value) { | |
247 | + var e; | |
248 | + try { | |
249 | + return this.setting[at]; | |
250 | + } catch (_error) { | |
251 | + e = _error; | |
252 | + return null; | |
253 | + } | |
254 | + }; | |
255 | + | |
256 | + Controller.prototype.content = function() { | |
257 | + if (this.$inputor.is('textarea, input')) { | |
258 | + return this.$inputor.val(); | |
259 | + } else { | |
260 | + return this.$inputor.text(); | |
261 | + } | |
262 | + }; | |
263 | + | |
264 | + Controller.prototype.catch_query = function() { | |
265 | + var caret_pos, content, end, query, start, subtext; | |
266 | + content = this.content(); | |
267 | + caret_pos = this.$inputor.caret('pos'); | |
268 | + subtext = content.slice(0, caret_pos); | |
269 | + query = this.callbacks("matcher").call(this, this.at, subtext, this.get_opt('start_with_space')); | |
270 | + if (typeof query === "string" && query.length <= this.get_opt('max_len', 20)) { | |
271 | + start = caret_pos - query.length; | |
272 | + end = start + query.length; | |
273 | + this.pos = start; | |
274 | + query = { | |
275 | + 'text': query, | |
276 | + 'head_pos': start, | |
277 | + 'end_pos': end | |
278 | + }; | |
279 | + this.trigger("matched", [this.at, query.text]); | |
280 | + } else { | |
281 | + this.view.hide(); | |
282 | + } | |
283 | + return this.query = query; | |
284 | + }; | |
285 | + | |
286 | + Controller.prototype.rect = function() { | |
287 | + var c, scale_bottom; | |
288 | + if (!(c = this.$inputor.caret({ | |
289 | + iframe: this.app.iframe | |
290 | + }).caret('offset', this.pos - 1))) { | |
291 | + return; | |
292 | + } | |
293 | + if (this.$inputor.attr('contentEditable') === 'true') { | |
294 | + c = (this.cur_rect || (this.cur_rect = c)) || c; | |
295 | + } | |
296 | + scale_bottom = this.app.document.selection ? 0 : 2; | |
297 | + return { | |
298 | + left: c.left, | |
299 | + top: c.top, | |
300 | + bottom: c.top + c.height + scale_bottom | |
301 | + }; | |
302 | + }; | |
303 | + | |
304 | + Controller.prototype.reset_rect = function() { | |
305 | + if (this.$inputor.attr('contentEditable') === 'true') { | |
306 | + return this.cur_rect = null; | |
307 | + } | |
308 | + }; | |
309 | + | |
310 | + Controller.prototype.mark_range = function() { | |
311 | + if (this.$inputor.attr('contentEditable') === 'true') { | |
312 | + if (this.app.window.getSelection) { | |
313 | + this.range = this.app.window.getSelection().getRangeAt(0); | |
314 | + } | |
315 | + if (this.app.document.selection) { | |
316 | + return this.ie8_range = this.app.document.selection.createRange(); | |
317 | + } | |
318 | + } | |
319 | + }; | |
320 | + | |
321 | + Controller.prototype.insert_content_for = function($li) { | |
322 | + var data, data_value, tpl; | |
323 | + data_value = $li.data('value'); | |
324 | + tpl = this.get_opt('insert_tpl'); | |
325 | + if (this.$inputor.is('textarea, input') || !tpl) { | |
326 | + return data_value; | |
327 | + } | |
328 | + data = $.extend({}, $li.data('item-data'), { | |
329 | + 'atwho-data-value': data_value, | |
330 | + 'atwho-at': this.at | |
331 | + }); | |
332 | + return this.callbacks("tpl_eval").call(this, tpl, data); | |
333 | + }; | |
334 | + | |
335 | + Controller.prototype.insert = function(content, $li) { | |
336 | + var $inputor, $insert_node, class_name, content_node, insert_node, pos, range, sel, source, start_str, text; | |
337 | + $inputor = this.$inputor; | |
338 | + if ($inputor.attr('contentEditable') === 'true') { | |
339 | + class_name = "atwho-view-flag atwho-view-flag-" + (this.get_opt('alias') || this.at); | |
340 | + content_node = "" + content + "<span contenteditable='false'> <span>"; | |
341 | + insert_node = "<span contenteditable='false' class='" + class_name + "'>" + content_node + "</span>"; | |
342 | + $insert_node = $(insert_node, this.app.document).data('atwho-data-item', $li.data('item-data')); | |
343 | + if (this.app.document.selection) { | |
344 | + $insert_node = $("<span contenteditable='true'></span>", this.app.document).html($insert_node); | |
345 | + } | |
346 | + } | |
347 | + if ($inputor.is('textarea, input')) { | |
348 | + content = '' + content; | |
349 | + source = $inputor.val(); | |
350 | + start_str = source.slice(0, Math.max(this.query.head_pos - this.at.length, 0)); | |
351 | + text = "" + start_str + content + " " + (source.slice(this.query['end_pos'] || 0)); | |
352 | + $inputor.val(text); | |
353 | + $inputor.caret('pos', start_str.length + content.length + 1); | |
354 | + } else if (range = this.range) { | |
355 | + pos = range.startOffset - (this.query.end_pos - this.query.head_pos) - this.at.length; | |
356 | + range.setStart(range.endContainer, Math.max(pos, 0)); | |
357 | + range.setEnd(range.endContainer, range.endOffset); | |
358 | + range.deleteContents(); | |
359 | + range.insertNode($insert_node[0]); | |
360 | + range.collapse(false); | |
361 | + sel = this.app.window.getSelection(); | |
362 | + sel.removeAllRanges(); | |
363 | + sel.addRange(range); | |
364 | + } else if (range = this.ie8_range) { | |
365 | + range.moveStart('character', this.query.end_pos - this.query.head_pos - this.at.length); | |
366 | + range.pasteHTML(content_node); | |
367 | + range.collapse(false); | |
368 | + range.select(); | |
369 | + } | |
370 | + if (!$inputor.is(':focus')) { | |
371 | + $inputor.focus(); | |
372 | + } | |
373 | + return $inputor.change(); | |
374 | + }; | |
375 | + | |
376 | + Controller.prototype.render_view = function(data) { | |
377 | + var search_key; | |
378 | + search_key = this.get_opt("search_key"); | |
379 | + data = this.callbacks("sorter").call(this, this.query.text, data.slice(0, 1001), search_key); | |
380 | + return this.view.render(data.slice(0, this.get_opt('limit'))); | |
381 | + }; | |
382 | + | |
383 | + Controller.prototype.look_up = function() { | |
384 | + var query, _callback; | |
385 | + if (!(query = this.catch_query())) { | |
386 | + return; | |
387 | + } | |
388 | + _callback = function(data) { | |
389 | + if (data && data.length > 0) { | |
390 | + return this.render_view(data); | |
391 | + } else { | |
392 | + return this.view.hide(); | |
393 | + } | |
394 | + }; | |
395 | + this.model.query(query.text, $.proxy(_callback, this)); | |
396 | + return query; | |
397 | + }; | |
398 | + | |
399 | + return Controller; | |
400 | + | |
401 | +})(); | |
402 | + | |
403 | +Model = (function() { | |
404 | + function Model(context) { | |
405 | + this.context = context; | |
406 | + this.at = this.context.at; | |
407 | + this.storage = this.context.$inputor; | |
408 | + } | |
409 | + | |
410 | + Model.prototype.destroy = function() { | |
411 | + return this.storage.data(this.at, null); | |
412 | + }; | |
413 | + | |
414 | + Model.prototype.saved = function() { | |
415 | + return this.fetch() > 0; | |
416 | + }; | |
417 | + | |
418 | + Model.prototype.query = function(query, callback) { | |
419 | + var data, search_key, _remote_filter; | |
420 | + data = this.fetch(); | |
421 | + search_key = this.context.get_opt("search_key"); | |
422 | + data = this.context.callbacks('filter').call(this.context, query, data, search_key) || []; | |
423 | + _remote_filter = this.context.callbacks('remote_filter'); | |
424 | + if (data.length > 0 || (!_remote_filter && data.length === 0)) { | |
425 | + return callback(data); | |
426 | + } else { | |
427 | + return _remote_filter.call(this.context, query, callback); | |
428 | + } | |
429 | + }; | |
430 | + | |
431 | + Model.prototype.fetch = function() { | |
432 | + return this.storage.data(this.at) || []; | |
433 | + }; | |
434 | + | |
435 | + Model.prototype.save = function(data) { | |
436 | + return this.storage.data(this.at, this.context.callbacks("before_save").call(this.context, data || [])); | |
437 | + }; | |
438 | + | |
439 | + Model.prototype.load = function(data) { | |
440 | + if (!(this.saved() || !data)) { | |
441 | + return this._load(data); | |
442 | + } | |
443 | + }; | |
444 | + | |
445 | + Model.prototype.reload = function(data) { | |
446 | + return this._load(data); | |
447 | + }; | |
448 | + | |
449 | + Model.prototype._load = function(data) { | |
450 | + if (typeof data === "string") { | |
451 | + return $.ajax(data, { | |
452 | + dataType: "json" | |
453 | + }).done((function(_this) { | |
454 | + return function(data) { | |
455 | + return _this.save(data); | |
456 | + }; | |
457 | + })(this)); | |
458 | + } else { | |
459 | + return this.save(data); | |
460 | + } | |
461 | + }; | |
462 | + | |
463 | + return Model; | |
464 | + | |
465 | +})(); | |
466 | + | |
467 | +View = (function() { | |
468 | + function View(context) { | |
469 | + this.context = context; | |
470 | + this.$el = $("<div class='atwho-view'><ul class='atwho-view-ul'></ul></div>"); | |
471 | + this.timeout_id = null; | |
472 | + this.context.$el.append(this.$el); | |
473 | + this.bind_event(); | |
474 | + } | |
475 | + | |
476 | + View.prototype.init = function() { | |
477 | + var id; | |
478 | + id = this.context.get_opt("alias") || this.context.at.charCodeAt(0); | |
479 | + return this.$el.attr({ | |
480 | + 'id': "at-view-" + id | |
481 | + }); | |
482 | + }; | |
483 | + | |
484 | + View.prototype.destroy = function() { | |
485 | + return this.$el.remove(); | |
486 | + }; | |
487 | + | |
488 | + View.prototype.bind_event = function() { | |
489 | + var $menu; | |
490 | + $menu = this.$el.find('ul'); | |
491 | + return $menu.on('mouseenter.atwho-view', 'li', function(e) { | |
492 | + $menu.find('.cur').removeClass('cur'); | |
493 | + return $(e.currentTarget).addClass('cur'); | |
494 | + }).on('click', (function(_this) { | |
495 | + return function(e) { | |
496 | + /*$("#body").focus(); | |
497 | + var e = jQuery.Event("keydown", {keyCode:65}); | |
498 | + $("#body").trigger(e);*/ | |
499 | + _this.choose(); | |
500 | + return e.preventDefault(); | |
501 | + }; | |
502 | + })(this)); | |
503 | + }; | |
504 | + | |
505 | + View.prototype.visible = function() { | |
506 | + return this.$el.is(":visible"); | |
507 | + }; | |
508 | + | |
509 | + View.prototype.choose = function() { | |
510 | + var $li, content; | |
511 | + if (($li = this.$el.find(".cur")).length) { | |
512 | + content = this.context.insert_content_for($li); | |
513 | + this.context.insert(this.context.callbacks("before_insert").call(this.context, content, $li), $li); | |
514 | + this.context.trigger("inserted", [$li]); | |
515 | + return this.hide(); | |
516 | + } | |
517 | + }; | |
518 | + | |
519 | + View.prototype.reposition = function(rect) { | |
520 | + var offset, _ref; | |
521 | + if (rect.bottom + this.$el.height() - $(window).scrollTop() > $(window).height()) { | |
522 | + rect.bottom = rect.top - this.$el.height(); | |
523 | + } | |
524 | + offset = { | |
525 | + left: rect.left, | |
526 | + top: rect.bottom | |
527 | + }; | |
528 | + if ((_ref = this.context.callbacks("before_reposition")) != null) { | |
529 | + _ref.call(this.context, offset); | |
530 | + } | |
531 | + this.$el.offset(offset); | |
532 | + return this.context.trigger("reposition", [offset]); | |
533 | + }; | |
534 | + | |
535 | + View.prototype.next = function() { | |
536 | + var cur, next; | |
537 | + cur = this.$el.find('.cur').removeClass('cur'); | |
538 | + next = cur.next(); | |
539 | + if (!next.length) { | |
540 | + next = this.$el.find('li:first'); | |
541 | + } | |
542 | + return next.addClass('cur'); | |
543 | + }; | |
544 | + | |
545 | + View.prototype.prev = function() { | |
546 | + var cur, prev; | |
547 | + cur = this.$el.find('.cur').removeClass('cur'); | |
548 | + prev = cur.prev(); | |
549 | + if (!prev.length) { | |
550 | + prev = this.$el.find('li:last'); | |
551 | + } | |
552 | + return prev.addClass('cur'); | |
553 | + }; | |
554 | + | |
555 | + View.prototype.show = function() { | |
556 | + var rect; | |
557 | + this.context.mark_range(); | |
558 | + if (!this.visible()) { | |
559 | + this.$el.show(); | |
560 | + this.context.trigger('shown'); | |
561 | + } | |
562 | + if (rect = this.context.rect()) { | |
563 | + return this.reposition(rect); | |
564 | + } | |
565 | + }; | |
566 | + | |
567 | + View.prototype.hide = function(time) { | |
568 | + var callback; | |
569 | + if (isNaN(time && this.visible())) { | |
570 | + this.context.reset_rect(); | |
571 | + this.$el.hide(); | |
572 | + return this.context.trigger('hidden'); | |
573 | + } else { | |
574 | + callback = (function(_this) { | |
575 | + return function() { | |
576 | + return _this.hide(); | |
577 | + }; | |
578 | + })(this); | |
579 | + clearTimeout(this.timeout_id); | |
580 | + return this.timeout_id = setTimeout(callback, time); | |
581 | + } | |
582 | + }; | |
583 | + | |
584 | + View.prototype.render = function(list) { | |
585 | + var $li, $ul, item, li, tpl, _i, _len; | |
586 | + if (!($.isArray(list) && list.length > 0)) { | |
587 | + this.hide(); | |
588 | + return; | |
589 | + } | |
590 | + this.$el.find('ul').empty(); | |
591 | + $ul = this.$el.find('ul'); | |
592 | + tpl = this.context.get_opt('tpl'); | |
593 | + for (_i = 0, _len = list.length; _i < _len; _i++) { | |
594 | + item = list[_i]; | |
595 | + item = $.extend({}, item, { | |
596 | + 'atwho-at': this.context.at | |
597 | + }); | |
598 | + li = this.context.callbacks("tpl_eval").call(this.context, tpl, item); | |
599 | + $li = $(this.context.callbacks("highlighter").call(this.context, li, this.context.query.text)); | |
600 | + $li.data("item-data", item); | |
601 | + $ul.append($li); | |
602 | + } | |
603 | + this.show(); | |
604 | + if (this.context.get_opt('highlight_first')) { | |
605 | + return $ul.find("li:first").addClass("cur"); | |
606 | + } | |
607 | + }; | |
608 | + | |
609 | + return View; | |
610 | + | |
611 | +})(); | |
612 | + | |
613 | +KEY_CODE = { | |
614 | + DOWN: 40, | |
615 | + UP: 38, | |
616 | + ESC: 27, | |
617 | + TAB: 9, | |
618 | + ENTER: 13, | |
619 | + CTRL: 17, | |
620 | + P: 80, | |
621 | + N: 78 | |
622 | +}; | |
623 | + | |
624 | +DEFAULT_CALLBACKS = { | |
625 | + before_save: function(data) { | |
626 | + var item, _i, _len, _results; | |
627 | + if (!$.isArray(data)) { | |
628 | + return data; | |
629 | + } | |
630 | + _results = []; | |
631 | + for (_i = 0, _len = data.length; _i < _len; _i++) { | |
632 | + item = data[_i]; | |
633 | + if ($.isPlainObject(item)) { | |
634 | + _results.push(item); | |
635 | + } else { | |
636 | + _results.push({ | |
637 | + name: item | |
638 | + }); | |
639 | + } | |
640 | + } | |
641 | + return _results; | |
642 | + }, | |
643 | + matcher: function(flag, subtext, should_start_with_space) { | |
644 | + var match, regexp; | |
645 | + flag = flag.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); | |
646 | + if (should_start_with_space) { | |
647 | + flag = '(?:^|\\s)' + flag; | |
648 | + } | |
649 | + regexp = new RegExp(flag + '([A-Za-z0-9_\+\-]*)$|' + flag + '([^\\x00-\\xff]*)$', 'gi'); | |
650 | + match = regexp.exec(subtext); | |
651 | + if (match) { | |
652 | + return match[2] || match[1]; | |
653 | + } else { | |
654 | + return null; | |
655 | + } | |
656 | + }, | |
657 | + filter: function(query, data, search_key) { | |
658 | + var item, _i, _len, _results; | |
659 | + _results = []; | |
660 | + for (_i = 0, _len = data.length; _i < _len; _i++) { | |
661 | + item = data[_i]; | |
662 | + if (~item[search_key].toLowerCase().indexOf(query.toLowerCase())) { | |
663 | + _results.push(item); | |
664 | + } | |
665 | + } | |
666 | + return _results; | |
667 | + }, | |
668 | + remote_filter: null, | |
669 | + sorter: function(query, items, search_key) { | |
670 | + var item, _i, _len, _results; | |
671 | + if (!query) { | |
672 | + return items; | |
673 | + } | |
674 | + _results = []; | |
675 | + for (_i = 0, _len = items.length; _i < _len; _i++) { | |
676 | + item = items[_i]; | |
677 | + item.atwho_order = item[search_key].toLowerCase().indexOf(query.toLowerCase()); | |
678 | + if (item.atwho_order > -1) { | |
679 | + _results.push(item); | |
680 | + } | |
681 | + } | |
682 | + return _results.sort(function(a, b) { | |
683 | + return a.atwho_order - b.atwho_order; | |
684 | + }); | |
685 | + }, | |
686 | + tpl_eval: function(tpl, map) { | |
687 | + var error; | |
688 | + try { | |
689 | + return tpl.replace(/\$\{([^\}]*)\}/g, function(tag, key, pos) { | |
690 | + return map[key]; | |
691 | + }); | |
692 | + } catch (_error) { | |
693 | + error = _error; | |
694 | + return ""; | |
695 | + } | |
696 | + }, | |
697 | + highlighter: function(li, query) { | |
698 | + var regexp; | |
699 | + if (!query) { | |
700 | + return li; | |
701 | + } | |
702 | + regexp = new RegExp(">\\s*(\\w*)(" + query.replace("+", "\\+") + ")(\\w*)\\s*<", 'ig'); | |
703 | + return li.replace(regexp, function(str, $1, $2, $3) { | |
704 | + return '> ' + $1 + '<strong>' + $2 + '</strong>' + $3 + ' <'; | |
705 | + }); | |
706 | + }, | |
707 | + before_insert: function(value, $li) { | |
708 | + return value; | |
709 | + } | |
710 | +}; | |
711 | + | |
712 | +Api = { | |
713 | + load: function(at, data) { | |
714 | + var c; | |
715 | + if (c = this.controller(at)) { | |
716 | + return c.model.load(data); | |
717 | + } | |
718 | + }, | |
719 | + getInsertedItemsWithIDs: function(at) { | |
720 | + var c, ids, items; | |
721 | + if (!(c = this.controller(at))) { | |
722 | + return [null, null]; | |
723 | + } | |
724 | + if (at) { | |
725 | + at = "-" + (c.get_opt('alias') || c.at); | |
726 | + } | |
727 | + ids = []; | |
728 | + items = $.map(this.$inputor.find("span.atwho-view-flag" + (at || "")), function(item) { | |
729 | + var data; | |
730 | + data = $(item).data('atwho-data-item'); | |
731 | + if (ids.indexOf(data.id) > -1) { | |
732 | + return; | |
733 | + } | |
734 | + if (data.id) { | |
735 | + ids.push = data.id; | |
736 | + } | |
737 | + return data; | |
738 | + }); | |
739 | + return [ids, items]; | |
740 | + }, | |
741 | + getInsertedItems: function(at) { | |
742 | + return Api.getInsertedItemsWithIDs.apply(this, [at])[1]; | |
743 | + }, | |
744 | + getInsertedIDs: function(at) { | |
745 | + return Api.getInsertedItemsWithIDs.apply(this, [at])[0]; | |
746 | + }, | |
747 | + setIframe: function(iframe) { | |
748 | + return this.setIframe(iframe); | |
749 | + }, | |
750 | + run: function() { | |
751 | + return this.dispatch(); | |
752 | + }, | |
753 | + destroy: function() { | |
754 | + this.shutdown(); | |
755 | + return this.$inputor.data('atwho', null); | |
756 | + } | |
757 | +}; | |
758 | + | |
759 | +Atwho = { | |
760 | + init: function(options) { | |
761 | + var $this, app; | |
762 | + app = ($this = $(this)).data("atwho"); | |
763 | + if (!app) { | |
764 | + $this.data('atwho', (app = new App(this))); | |
765 | + } | |
766 | + app.reg(options.at, options); | |
767 | + return this; | |
768 | + } | |
769 | +}; | |
770 | + | |
771 | +$CONTAINER = $("<div id='atwho-container'></div>"); | |
772 | + | |
773 | +$.fn.atwho = function(method) { | |
774 | + var result, _args; | |
775 | + _args = arguments; | |
776 | + $('body').append($CONTAINER); | |
777 | + result = null; | |
778 | + this.filter('textarea, input, [contenteditable=true]').each(function() { | |
779 | + var app; | |
780 | + if (typeof method === 'object' || !method) { | |
781 | + return Atwho.init.apply(this, _args); | |
782 | + } else if (Api[method]) { | |
783 | + if (app = $(this).data('atwho')) { | |
784 | + return result = Api[method].apply(app, Array.prototype.slice.call(_args, 1)); | |
785 | + } | |
786 | + } else { | |
787 | + return $.error("Method " + method + " does not exist on jQuery.caret"); | |
788 | + } | |
789 | + }); | |
790 | + return result || this; | |
791 | +}; | |
792 | + | |
793 | +$.fn.atwho["default"] = { | |
794 | + at: void 0, | |
795 | + alias: void 0, | |
796 | + data: null, | |
797 | + tpl: "<li data-value='${atwho-at}${name}'>${name}</li>", | |
798 | + insert_tpl: "<span>${atwho-data-value}</span>", | |
799 | + callbacks: DEFAULT_CALLBACKS, | |
800 | + search_key: "name", | |
801 | + start_with_space: true, | |
802 | + highlight_first: true, | |
803 | + limit: 5, | |
804 | + max_len: 20, | |
805 | + display_timeout: 300 | |
806 | +}; | |
807 | + | |
808 | + }); | |
809 | +}).call(this); |
+++ public/javascripts/lib/atjs/jquery.browser.js
... | ... | @@ -0,0 +1,112 @@ |
1 | +/*! | |
2 | + * jQuery Browser Plugin v0.0.6 | |
3 | + * https://github.com/gabceb/jquery-browser-plugin | |
4 | + * | |
5 | + * Original jquery-browser code Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors | |
6 | + * http://jquery.org/license | |
7 | + * | |
8 | + * Modifications Copyright 2013 Gabriel Cebrian | |
9 | + * https://github.com/gabceb | |
10 | + * | |
11 | + * Released under the MIT license | |
12 | + * | |
13 | + * Date: 2013-07-29T17:23:27-07:00 | |
14 | + */ | |
15 | + | |
16 | +(function( jQuery, window, undefined ) { | |
17 | + "use strict"; | |
18 | + | |
19 | + var matched, browser; | |
20 | + | |
21 | + jQuery.uaMatch = function( ua ) { | |
22 | + ua = ua.toLowerCase(); | |
23 | + | |
24 | + var match = /(opr)[\/]([\w.]+)/.exec( ua ) || | |
25 | + /(chrome)[ \/]([\w.]+)/.exec( ua ) || | |
26 | + /(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec( ua ) || | |
27 | + /(webkit)[ \/]([\w.]+)/.exec( ua ) || | |
28 | + /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || | |
29 | + /(msie) ([\w.]+)/.exec( ua ) || | |
30 | + ua.indexOf("trident") >= 0 && /(rv)(?::| )([\w.]+)/.exec( ua ) || | |
31 | + ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || | |
32 | + []; | |
33 | + | |
34 | + var platform_match = /(ipad)/.exec( ua ) || | |
35 | + /(iphone)/.exec( ua ) || | |
36 | + /(android)/.exec( ua ) || | |
37 | + /(windows phone)/.exec( ua ) || | |
38 | + /(win)/.exec( ua ) || | |
39 | + /(mac)/.exec( ua ) || | |
40 | + /(linux)/.exec( ua ) || | |
41 | + /(cros)/i.exec( ua ) || | |
42 | + []; | |
43 | + | |
44 | + return { | |
45 | + browser: match[ 3 ] || match[ 1 ] || "", | |
46 | + version: match[ 2 ] || "0", | |
47 | + platform: platform_match[ 0 ] || "" | |
48 | + }; | |
49 | + }; | |
50 | + | |
51 | + matched = jQuery.uaMatch( window.navigator.userAgent ); | |
52 | + browser = {}; | |
53 | + | |
54 | + if ( matched.browser ) { | |
55 | + browser[ matched.browser ] = true; | |
56 | + browser.version = matched.version; | |
57 | + browser.versionNumber = parseInt(matched.version); | |
58 | + } | |
59 | + | |
60 | + if ( matched.platform ) { | |
61 | + browser[ matched.platform ] = true; | |
62 | + } | |
63 | + | |
64 | + // These are all considered mobile platforms, meaning they run a mobile browser | |
65 | + if ( browser.android || browser.ipad || browser.iphone || browser[ "windows phone" ] ) { | |
66 | + browser.mobile = true; | |
67 | + } | |
68 | + | |
69 | + // These are all considered desktop platforms, meaning they run a desktop browser | |
70 | + if ( browser.cros || browser.mac || browser.linux || browser.win ) { | |
71 | + browser.desktop = true; | |
72 | + } | |
73 | + | |
74 | + // Chrome, Opera 15+ and Safari are webkit based browsers | |
75 | + if ( browser.chrome || browser.opr || browser.safari ) { | |
76 | + browser.webkit = true; | |
77 | + } | |
78 | + | |
79 | + // IE11 has a new token so we will assign it msie to avoid breaking changes | |
80 | + if ( browser.rv ) | |
81 | + { | |
82 | + var ie = "msie"; | |
83 | + | |
84 | + matched.browser = ie; | |
85 | + browser[ie] = true; | |
86 | + } | |
87 | + | |
88 | + // Opera 15+ are identified as opr | |
89 | + if ( browser.opr ) | |
90 | + { | |
91 | + var opera = "opera"; | |
92 | + | |
93 | + matched.browser = opera; | |
94 | + browser[opera] = true; | |
95 | + } | |
96 | + | |
97 | + // Stock Android browsers are marked as Safari on Android. | |
98 | + if ( browser.safari && browser.android ) | |
99 | + { | |
100 | + var android = "android"; | |
101 | + | |
102 | + matched.browser = android; | |
103 | + browser[android] = true; | |
104 | + } | |
105 | + | |
106 | + // Assign the name and platform variable | |
107 | + browser.name = matched.browser; | |
108 | + browser.platform = matched.platform; | |
109 | + | |
110 | + | |
111 | + jQuery.browser = browser; | |
112 | +})( jQuery, window ); |
+++ public/javascripts/lib/atjs/jquery.caret.min.js
... | ... | @@ -0,0 +1,2 @@ |
1 | +/*! jquery.caret 2014-04-18 */ | |
2 | +(function(){!function(a){return"function"==typeof define&&define.amd?define(["jquery"],a):a(window.jQuery)}(function(a){"use strict";var b,c,d,e,f,g,h,i,j,k,l;return k="caret",b=function(){function b(a){this.$inputor=a,this.domInputor=this.$inputor[0]}return b.prototype.setPos=function(){return this.domInputor},b.prototype.getIEPosition=function(){return a.noop()},b.prototype.getPosition=function(){return a.noop()},b.prototype.getOldIEPos=function(){var a,b;return b=h.selection.createRange(),a=h.body.createTextRange(),a.moveToElementText(this.domInputor),a.setEndPoint("EndToEnd",b),a.text.length},b.prototype.getPos=function(){var a,b,c;return(c=this.range())?(a=c.cloneRange(),a.selectNodeContents(this.domInputor),a.setEnd(c.endContainer,c.endOffset),b=a.toString().length,a.detach(),b):h.selection?this.getOldIEPos():void 0},b.prototype.getOldIEOffset=function(){var a,b;return a=h.selection.createRange().duplicate(),a.moveStart("character",-1),b=a.getBoundingClientRect(),{height:b.bottom-b.top,left:b.left,top:b.top}},b.prototype.getOffset=function(){var b,c,d,e;if(j.getSelection&&(d=this.range())){if(d.endOffset-1<0)return null;b=d.cloneRange(),b.setStart(d.endContainer,d.endOffset-1),b.setEnd(d.endContainer,d.endOffset),e=b.getBoundingClientRect(),c={height:e.height,left:e.left+e.width,top:e.top},b.detach()}else h.selection&&(c=this.getOldIEOffset());return c&&!i&&(c.top+=a(j).scrollTop(),c.left+=a(j).scrollLeft()),c},b.prototype.range=function(){var a;if(j.getSelection)return a=j.getSelection(),a.rangeCount>0?a.getRangeAt(0):null},b}(),c=function(){function b(a){this.$inputor=a,this.domInputor=this.$inputor[0]}return b.prototype.getIEPos=function(){var a,b,c,d,e,f,g;return b=this.domInputor,f=h.selection.createRange(),e=0,f&&f.parentElement()===b&&(d=b.value.replace(/\r\n/g,"\n"),c=d.length,g=b.createTextRange(),g.moveToBookmark(f.getBookmark()),a=b.createTextRange(),a.collapse(!1),e=g.compareEndPoints("StartToEnd",a)>-1?c:-g.moveStart("character",-c)),e},b.prototype.getPos=function(){return h.selection?this.getIEPos():this.domInputor.selectionStart},b.prototype.setPos=function(a){var b,c;return b=this.domInputor,h.selection?(c=b.createTextRange(),c.move("character",a),c.select()):b.setSelectionRange&&b.setSelectionRange(a,a),b},b.prototype.getIEOffset=function(a){var b,c,d,e;return c=this.domInputor.createTextRange(),a||(a=this.getPos()),c.move("character",a),d=c.boundingLeft,e=c.boundingTop,b=c.boundingHeight,{left:d,top:e,height:b}},b.prototype.getOffset=function(b){var c,d,e;return c=this.$inputor,h.selection?(d=this.getIEOffset(b),d.top+=a(j).scrollTop()+c.scrollTop(),d.left+=a(j).scrollLeft()+c.scrollLeft(),d):(d=c.offset(),e=this.getPosition(b),d={left:d.left+e.left-c.scrollLeft(),top:d.top+e.top-c.scrollTop(),height:e.height})},b.prototype.getPosition=function(a){var b,c,e,f,g,h;return b=this.$inputor,e=function(a){return a.replace(/</g,"<").replace(/>/g,">").replace(/`/g,"`").replace(/"/g,""").replace(/\r\n|\r|\n/g,"<br />")},void 0===a&&(a=this.getPos()),h=b.val().slice(0,a),f="<span>"+e(h)+"</span>",f+="<span id='caret'>|</span>",g=new d(b),c=g.create(f).rect()},b.prototype.getIEPosition=function(a){var b,c,d,e,f;return d=this.getIEOffset(a),c=this.$inputor.offset(),e=d.left-c.left,f=d.top-c.top,b=d.height,{left:e,top:f,height:b}},b}(),d=function(){function b(a){this.$inputor=a}return b.prototype.css_attr=["overflowY","height","width","paddingTop","paddingLeft","paddingRight","paddingBottom","marginTop","marginLeft","marginRight","marginBottom","fontFamily","borderStyle","borderWidth","wordWrap","fontSize","lineHeight","overflowX","text-align"],b.prototype.mirrorCss=function(){var b,c=this;return b={position:"absolute",left:-9999,top:0,zIndex:-2e4,"white-space":"pre-wrap"},a.each(this.css_attr,function(a,d){return b[d]=c.$inputor.css(d)}),b},b.prototype.create=function(b){return this.$mirror=a("<div></div>"),this.$mirror.css(this.mirrorCss()),this.$mirror.html(b),this.$inputor.after(this.$mirror),this},b.prototype.rect=function(){var a,b,c;return a=this.$mirror.find("#caret"),b=a.position(),c={left:b.left,top:b.top,height:a.height()},this.$mirror.remove(),c},b}(),e={contentEditable:function(a){return!(!a[0].contentEditable||"true"!==a[0].contentEditable)}},g={pos:function(a){return a||0===a?this.setPos(a):this.getPos()},position:function(a){return h.selection?this.getIEPosition(a):this.getPosition(a)},offset:function(b){var c,d;return d=this.getOffset(b),i&&(c=a(i).offset(),d.top+=c.top,d.left+=c.left),d}},h=null,j=null,i=null,l=function(a){return i=a,j=a.contentWindow,h=a.contentDocument||j.document},f=function(b,c){var d,e;if(a.isPlainObject(c)&&(e=c.iframe))return b.data("caret-iframe",e),l(e);if(e=b.data("caret-iframe"))return l(e);h=b[0].ownerDocument,j=h.defaultView||h.parentWindow;try{return i=j.frameElement}catch(f){d=f}},a.fn.caret=function(d){var h;return"object"==typeof d?(f(this,d),this):g[d]?(f(this),h=e.contentEditable(this)?new b(this):new c(this),g[d].apply(h,Array.prototype.slice.call(arguments,1))):a.error("Method "+d+" does not exist on jQuery.caret")},a.fn.caret.EditableCaret=b,a.fn.caret.InputCaret=c,a.fn.caret.Utils=e,a.fn.caret.apis=g})}).call(this);(No newline at end of file) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?