Merge branch 'szzh' of https://git.trustie.net/jacknudt/trustieforge into szzh
commit
72c475e8a2
@ -1,5 +1,7 @@
|
|||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'prettify','/assets/kindeditor/pasteimg' %>
|
<%= content_for(:header_tags) do %>
|
||||||
<%= stylesheet_link_tag 'prettify'%>
|
<%= import_ke(enable_at: false, prettify: true) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<%= labelled_form_for @bid,:html => { :multipart => true } do |f| %>
|
<%= labelled_form_for @bid,:html => { :multipart => true } do |f| %>
|
||||||
<%= render :partial => 'new_homework_form', :locals => { :bid => @bid, :bid_id => "edit_bid_#{@bid.id}",:f=>f,:edit_mode => true} %>
|
<%= render :partial => 'new_homework_form', :locals => { :bid => @bid, :bid_id => "edit_bid_#{@bid.id}",:f=>f,:edit_mode => true} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -0,0 +1,38 @@
|
|||||||
|
function enableAt(_editor) {
|
||||||
|
var editor = _editor;
|
||||||
|
if(editor.edit == undefined || editor.edit.iframe == undefined){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var ifr = editor.edit.iframe[0];
|
||||||
|
var doc = ifr.contentDocument || iframe.contentWindow.document;
|
||||||
|
var ifrBody = doc.body;
|
||||||
|
ifrBody.contentEditable = true;
|
||||||
|
console.log("enable at");
|
||||||
|
|
||||||
|
$.fn.atwho.debug = true;
|
||||||
|
if(!atPersonLists){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var names = atPersonLists;
|
||||||
|
|
||||||
|
//var names = ["Jacob","Isabella","Ethan","Emma","Michael","Olivia","Alexander","Sophia","William","Ava","Joshua","Emily","Daniel","Madison","Jayden","Abigail","Noah","Chloe","你好","你你你", "가"];
|
||||||
|
//
|
||||||
|
//var names = $.map(names,function(value,i) {
|
||||||
|
// return {'id':i,'name':value,'email':value+"@email.com"};
|
||||||
|
//});
|
||||||
|
|
||||||
|
var at_config = {
|
||||||
|
at: "@",
|
||||||
|
data: names,
|
||||||
|
insertTpl: '<span style="color:#269ac9">@${name}(${login})</span>',
|
||||||
|
displayTpl: "<li>${name} <small>${login}</small></li>",
|
||||||
|
searchKey: 'searchKey',
|
||||||
|
limit: 200
|
||||||
|
}
|
||||||
|
|
||||||
|
$inputor = $(ifrBody).atwho(at_config);
|
||||||
|
window.aaa= $inputor;
|
||||||
|
$inputor.caret('pos', 47);
|
||||||
|
$inputor.focus().atwho('run');
|
||||||
|
};
|
@ -0,0 +1,49 @@
|
|||||||
|
.atwho-view {
|
||||||
|
position:absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
display: none;
|
||||||
|
margin-top: 18px;
|
||||||
|
background: white;
|
||||||
|
color: black;
|
||||||
|
border: 1px solid #DDD;
|
||||||
|
border-radius: 3px;
|
||||||
|
box-shadow: 0 0 5px rgba(0,0,0,0.1);
|
||||||
|
min-width: 120px;
|
||||||
|
max-height: 200px;
|
||||||
|
overflow: auto;
|
||||||
|
z-index: 11110 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.atwho-view .cur {
|
||||||
|
background: #3366FF;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.atwho-view .cur small {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.atwho-view strong {
|
||||||
|
color: #3366FF;
|
||||||
|
}
|
||||||
|
.atwho-view .cur strong {
|
||||||
|
color: white;
|
||||||
|
font:bold;
|
||||||
|
}
|
||||||
|
.atwho-view ul {
|
||||||
|
/* width: 100px; */
|
||||||
|
list-style:none;
|
||||||
|
padding:0;
|
||||||
|
margin:auto;
|
||||||
|
}
|
||||||
|
.atwho-view ul li {
|
||||||
|
display: block;
|
||||||
|
padding: 5px 10px;
|
||||||
|
border-bottom: 1px solid #DDD;
|
||||||
|
cursor: pointer;
|
||||||
|
/* border-top: 1px solid #C8C8C8; */
|
||||||
|
}
|
||||||
|
.atwho-view small {
|
||||||
|
font-size: smaller;
|
||||||
|
color: #777;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue