如果你想聊聊,可以给我发邮件,也可以直接 Twitter DM。
sofish / pen Goto Github PK
View Code? Open in Web Editor NEWenjoy live editing (+markdown)
Home Page: https://sofish.github.io/pen
License: Other
enjoy live editing (+markdown)
Home Page: https://sofish.github.io/pen
License: Other
如果你想聊聊,可以给我发邮件,也可以直接 Twitter DM。
Is there anyway to have placeholder text show up when the user deletes the content in the pen editor?
建议监听键盘事件
对于习惯大范围的选中的,鼠标up的时候习惯在区域外面了,然后就不会弹出菜单。
使用#时,改变了前一行的标签,并删去当前行。
<HX>
会相互嵌套,导致字体大小混乱(默认单位是em)An empty editor doesn't default to a
tag
Also, a line break after anything else but a p tag results in a
选择内容后工具浮出层出现,然后取消选择,但工具浮出层没有隐藏
destroy
not destory
Pls fix it, IMPORTANT ! :P
Thanks so much
最后一行 "Steve Jobs" 前一行输入 "*",然后发现 'Steve Jobs' 的文字就消失了
When using either the ordered or unordered list buttons this style gets added inline to the element (at least in the live demo):
font-size: 1.36em; line-height: 1.45;
causing the element to bigger than it should, this behaviour latches and cannot be removed
What about if destroy func. will remove class="pen"
when destroy ?
It seems that most 'medium-style' editing experiences eschew HTML tables. I think I get the reasoning, but I also think there's certainly a place for one that includes simplified table management. Is there any appetite for this in your project?
Should be cool, if we have option like..
var options = { PastePlainText : true }
Just let user paste plain text only (so another DIV inserted or more kidding div)
I know a solution like..
$('[contenteditable]').on('paste', function (e) { e.preventDefault(); document.execCommand('inserttext', false, prompt('Paste something.')); });
But maybe you know better to do
EXTRA : Should be cool if this option listened option from list
like list: ['bold', 'italic', 'underline']
So no H1
H2
LINK
or another allowed
JUST A IDEA :D
When the editor is destory
ed, its better to not ask user about leaving the page, because the destory
is meant to end the editing.
I wonder how to support multiple elements
Example :
<div class="editme_1"></div>
<div>Disalow</div>
<div class="editme_2"></div>
比如页面结果为:
test
我觉得空格后应该影响当前行后面的文字,而不是上一行的文字。
目前感觉markdown的书写体验不太好
刚刚试玩了一下demo,新添加的内容,鼠标由后向前选择菜单无法弹出
环境: chrome 31.0.1612.2
类似于Medium那样,如果别人查看的话,可以对某个内容做评论,这样对于我们做编辑的同学就可以查看大家的内容和建议
在选择最左边字符时间,浮层显示不完整
假如H2,H3标签作用在整行的话,那选中是不是就没有意义了?
可以将选中文字单独抽取出来添加H标签
Wanna know, How can I destroy Pen function ?
Example :
When I hover A element so
var penA = new Pen({editor: document.querySelector('.A')});
When mouseover how to destroy that ?
比那个 ZenPen 好用多了!希望加上插图、制表、选色等功能。
`First : readme.md
Code block: type ```
Change to :
Code block: type <code>`</code>
:P
Ok, I tested on your demo
Coz I using Mac ? or what ?
I made a tester for see keycode
I paste (Shit + ´) , Show nothing..
I try to make onClick example by jQuery
var pen; var pen_current; $('.a, .b').on('click',function(){ if(!$(this).is(pen_current)) { if(pen) { pen_current.removeClass('pen'); // Request #issus53 $('.pen-menu').remove(); // Bug? pen.destroy(); } pen = new Pen({ editor: $(this)[0], list: ['bold', 'italic', 'underline'] }); pen_current = $(this); } });
All work now
But I seems some bug (or i do something wrong)
.pen-menu
(they dont removed but display:none
)TypeError: menu.querySelector(...) is null
pen.js (line 227)
I noticed that, when I type in "
, '
, ...
or --
, they're simply displayed as-is, however in Medium's editor, they're automatically converted to more appropriate forms. For example, "quotes"
to “quotes”
(“
and ”
), ...
to …
(…
) and --
to —
(—
). Maybe you could consider this feature in future releases. Thank you!
。。写了几个字,然后选择之后,加上链接。接下来继续往下写。。
就都有下划线了。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.