parent
55bb9f68e0
commit
af31946586
@ -0,0 +1,39 @@
|
||||
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: '@${name}',
|
||||
displayTpl: "<li>${name} <small>${email}</small></li>",
|
||||
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
Loading…
Reference in new issue