-
Notifications
You must be signed in to change notification settings - Fork 0
/
ipsum-everything.min.js
5 lines (5 loc) · 1.29 KB
/
ipsum-everything.min.js
1
2
3
4
5
/*
* Ipsum Everything
* Made by Jared Cubilla, licensed under MIT
*/
!function(a){a.fn.ipsum=function(b){var c={paras:1,type:"hipster-latin"},d=this,e="";switch(b=a.extend({},c,b),b.type.toLowerCase()){case"hipster":e="http://hipsterjesus.com/api/?paras=";break;case"hipster-centric":e="http://hipsterjesus.com/api/?type=hipster-centric¶s=";break;case"bacon":e="https://baconipsum.com/api/?type=meat-and-filler¶s=";break;case"bacon-all-meat":e="https://baconipsum.com/api/?type=all-meat¶s=";break;case"skate":e="https://jsonp.nodejitsu.com/?callback=?&url=http://skateipsum.com/get/";break;case"baseball":e="https://jsonp.nodejitsu.com/?callback=?&url=http://baseballipsum.apphb.com/api/?paras=";break;case"pony":e="http://ponyipsum.com/api/?type=pony-and-filler¶s=";break;case"all-pony":e="http://ponyipsum.com/api/?type=all-pony¶s=";break;case"science":e="https://jsonp.nodejitsu.com/?callback=?&url=http://scienceipsum.com/api/paragraphs/"}e+=b.paras,"skate"===b.type.toLowerCase()&&(e+="/0/JSON"),a.getJSON(e,function(a){var c="";switch(b.type.toLowerCase()){case"hipster":case"hipster-centric":c=a.text;break;case"science":for(var e=0;e<a.paragraphs.length;e++)c+="<p>"+a.paragraphs[e]+"</p>";break;default:for(var f=0;f<a.length;f++)c+="<p>"+a[f]+"</p>"}d.html(c)})}}(jQuery,window,document);