博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mootools_在MooTools中实现String.Tweetify
阅读量:2515 次
发布时间:2019-05-11

本文共 1163 字,大约阅读时间需要 3 分钟。

mootools

TwitterGitter

Twitter has damn near taken over the world. Everything's Twitter. Twitter this. Twitter that. . Twitter everything. I'm more used to reading Twitter-speak (short condensed sentences, #'s, @'s, etc.) now than I am plain English. And since Twitter is only going to continue to get more popular, we better get used to using it on our websites and providing users with formatted tweets. MooTools makes it easy to format tweets with links.

Twitter几乎已经接管了整个世界。 一切都是Twitter。 推特这个。 Twitter的。 。 推特一切。 我现在比普通英语更习惯阅读Twitter讲话(简短的简写,#,@等)。 而且由于Twitter只会继续变得越来越流行,因此我们最好习惯于在我们的网站上使用它,并为用户提供格式化的推文。 MooTools使格式化带有链接的推文变得容易。

MooTools JavaScript (The MooTools JavaScript)

//implementString.implement({	tweetify: function() {		return this.replace(/(https?:\/\/\S+)/gi,'$1').replace(/(^|\s)@(\w+)/g,'$1@$2').replace(/(^|\s)#(\w+)/g,'$1#$2');	}});//usagevar original = '@davidwalshblog I love your #Mootools LazyLoad plugin!  https://davidwalsh.name/lazyload';var tweetified = original.tweetify(); //becomes: @davidwalshblog I love your #Mootools LazyLoad plugin! https://davidwalsh.name/lazyload 

Now you can instantly tweetify any string!

现在,您可以立即对任何字符串进行鸣叫!

翻译自:

mootools

转载地址:http://wupwd.baihongyu.com/

你可能感兴趣的文章
laravel连接sql server 2008
查看>>
Laravel框架学习笔记之任务调度(定时任务)
查看>>
Swagger在Laravel项目中的使用
查看>>
Laravel 的生命周期
查看>>
Nginx
查看>>
Navicat远程连接云主机数据库
查看>>
Nginx配置文件nginx.conf中文详解(总结)
查看>>
jxl写入excel实现数据导出功能
查看>>
linux文件目录类命令|--cp指令
查看>>
.net MVC 404错误解决方法
查看>>
linux系统目录结构
查看>>
git
查看>>
btn按钮之间事件相互调用
查看>>
Entity Framework 4.3.1 级联删除
查看>>
codevs 1163:访问艺术馆
查看>>
冲刺Noip2017模拟赛3 解题报告——五十岚芒果酱
查看>>
并查集
查看>>
sessionStorage
查看>>
代码示例_进程
查看>>
Java中关键词之this,super的使用
查看>>