diff --git a/addons/oembed/jquery.oembed.js b/addons/oembed/jquery.oembed.js index 06ffa2494..41f9d4509 100755 --- a/addons/oembed/jquery.oembed.js +++ b/addons/oembed/jquery.oembed.js @@ -261,7 +261,7 @@ success: function (data) { var oembedData = $.extend({}, data); oembedData.code = embedProvider.templateData(data); - success(oembedData, externalUrl, container); + if(oembedData.code) success(oembedData, externalUrl, container); }, error: settings.onError.call(container, externalUrl, embedProvider) }, settings.ajaxOptions || {}); @@ -389,8 +389,8 @@ $.fn.oembed.getGenericCode = function (url, oembedData) { var title = (oembedData.title !== null) ? oembedData.title : url, - code = '' + title + ''; - if(oembedData.html) code += "
" + oembedData.html + "
"; + code = ''; + if(oembedData.html) code += '
' + title + '
' + jQuery(oembedData.html).text().substring(0,200) + '... more
'; return code; }; @@ -849,7 +849,7 @@ templateData: function (data) { if(!data.parse) return false; var text = data.parse['text']['*'].replace(/href="\/wiki/g, 'href="http://en.wikipedia.org/wiki'); - return '

' + data.parse['displaytitle'] + '

' + text + '
'; + return '
' + data.parse['displaytitle'] + '
' +jQuery(text).text().substring(0,200) + '...
'; } }), new $.fn.oembed.OEmbedProvider("imdb", "rich", ["imdb.com/title/.+"], "http://www.imdbapi.com/?i=$1&callback=?", { diff --git a/addons/oembed/jquery.oembed.min.js b/addons/oembed/jquery.oembed.min.js index 9ae56c939..037b76ba7 100644 --- a/addons/oembed/jquery.oembed.min.js +++ b/addons/oembed/jquery.oembed.min.js @@ -1,2 +1,2 @@ -!function(a){function b(a,c){return c=c?c:"",a?b(--a,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".charAt(Math.floor(60*Math.random()))+c):c}function c(a,b){var c,d=a.apiendpoint,e="";d+=d.indexOf("?")<=0?"?":"&",d=d.replace("#","%23"),null===a.maxWidth||"undefined"!=typeof a.params.maxwidth&&null!==a.params.maxwidth||(a.params.maxwidth=a.maxWidth),null===a.maxHeight||"undefined"!=typeof a.params.maxheight&&null!==a.params.maxheight||(a.params.maxheight=a.maxHeight);for(c in a.params)c!=a.callbackparameter&&null!==a.params[c]&&(e+="&"+escape(c)+"="+a.params[c]);return d+="format="+a.format+"&url="+escape(b)+e,"json"!=a.dataType&&(d+="&"+a.callbackparameter+"=?"),d}function d(b,c,d){a("#jqoembeddata").data(c,b.code),g.beforeEmbed.call(d,b),g.onEmbed.call(d,b),g.afterEmbed.call(d,b)}function e(e,f,h){if(void 0!=a("#jqoembeddata").data(f)&&"iframe"!=h.embedtag.tag){var i={code:a("#jqoembeddata").data(f)};d(i,f,e)}else if(h.yql){var j=h.yql.from||"htmlstring",k=h.yql.url?h.yql.url(f):f,l="SELECT * FROM "+j+' WHERE url="'+k+'" and '+(/html/.test(j)?"xpath":"itemPath")+"='"+(h.yql.xpath||"/")+"'";"html"==j&&(l+=" and compat='html5'");var m=a.extend({url:"http://query.yahooapis.com/v1/public/yql",dataType:"jsonp",data:{q:l,format:"json",env:"store://datatables.org/alltableswithkeys",callback:"?"},success:function(b){var c;if(h.yql.xpath&&"//meta|//title|//link"==h.yql.xpath){var g={};null==b.query.results&&(b.query.results={meta:[]});for(var i=0,j=b.query.results.meta.length;j>i;i++){var k=b.query.results.meta[i].name||b.query.results.meta[i].property||null;null!=k&&(g[k.toLowerCase()]=b.query.results.meta[i].content)}g.hasOwnProperty("title")&&g.hasOwnProperty("og:title")||null!=b.query.results.title&&(g.title=b.query.results.title),c=h.yql.datareturn(g)}else c=h.yql.datareturn?h.yql.datareturn(b.query.results):b.query.results.result;if(c!==!1){var l=a.extend({},c);l.code=c,d(l,f,e)}},error:g.onError.call(e,f,h)},g.ajaxOptions||{});a.ajax(m)}else if(h.templateRegex)if(""!==h.embedtag.tag){var n=h.embedtag.flashvars||"",o=h.embedtag.tag||"embed",p=h.embedtag.width||"auto",q=(h.embedtag.nocache||0,h.embedtag.height||"auto"),r=f.replace(h.templateRegex,h.apiendpoint);h.nocache||(r+="&jqoemcache="+b(5)),h.apikey&&(r=r.replace("_APIKEY_",g.apikeys[h.name]));var s=a("<"+o+"/>").attr("src",r).attr("width",p).attr("height",q).attr("allowfullscreen",h.embedtag.allowfullscreen||"true").attr("allowscriptaccess",h.embedtag.allowfullscreen||"always").css("max-height",g.maxHeight||"auto").css("max-width",g.maxWidth||"auto");"embed"==o&&s.attr("type",h.embedtag.type||"application/x-shockwave-flash").attr("flashvars",f.replace(h.templateRegex,n)),"iframe"==o&&s.attr("scrolling",h.embedtag.scrolling||"no").attr("frameborder",h.embedtag.frameborder||"0");var i={code:s};d(i,f,e)}else if(h.apiendpoint)h.apikey&&(h.apiendpoint=h.apiendpoint.replace("_APIKEY_",g.apikeys[h.name])),m=a.extend({url:f.replace(h.templateRegex,h.apiendpoint),dataType:"jsonp",success:function(b){var c=a.extend({},b);c.code=h.templateData(b),d(c,f,e)},error:g.onError.call(e,f,h)},g.ajaxOptions||{}),a.ajax(m);else{var i={code:f.replace(h.templateRegex,h.template)};d(i,f,e)}else{var t=c(h,f),m=a.extend({url:t,dataType:h.dataType||"jsonp",success:function(b){var c=a.extend({},b);switch(c.type){case"file":case"photo":c.code=a.fn.oembed.getPhotoCode(f,c);break;case"video":case"rich":c.code=a.fn.oembed.getRichCode(f,c);break;default:c.code=a.fn.oembed.getGenericCode(f,c)}d(c,f,e)},error:g.onError.call(e,f,h)},g.ajaxOptions||{});a.ajax(m)}}function f(a){if(null===a)return null;var b,c={};for(b in a)null!==b&&(c[b.toLowerCase()]=a[b]);return c}a.fn.oembed=function(b,c,d){g=a.extend(!0,a.fn.oembed.defaults,c);var h=["0rz.tw","1link.in","1url.com","2.gp","2big.at","2tu.us","3.ly","307.to","4ms.me","4sq.com","4url.cc","6url.com","7.ly","a.gg","a.nf","aa.cx","abcurl.net","ad.vu","adf.ly","adjix.com","afx.cc","all.fuseurl.com","alturl.com","amzn.to","ar.gy","arst.ch","atu.ca","azc.cc","b23.ru","b2l.me","bacn.me","bcool.bz","binged.it","bit.ly","bizj.us","bloat.me","bravo.ly","bsa.ly","budurl.com","canurl.com","chilp.it","chzb.gr","cl.lk","cl.ly","clck.ru","cli.gs","cliccami.info","clickthru.ca","clop.in","conta.cc","cort.as","cot.ag","crks.me","ctvr.us","cutt.us","dai.ly","decenturl.com","dfl8.me","digbig.com","http://digg.com/[^/]+$","disq.us","dld.bz","dlvr.it","do.my","doiop.com","dopen.us","easyuri.com","easyurl.net","eepurl.com","eweri.com","fa.by","fav.me","fb.me","fbshare.me","ff.im","fff.to","fire.to","firsturl.de","firsturl.net","flic.kr","flq.us","fly2.ws","fon.gs","freak.to","fuseurl.com","fuzzy.to","fwd4.me","fwib.net","g.ro.lt","gizmo.do","gl.am","go.9nl.com","go.ign.com","go.usa.gov","goo.gl","goshrink.com","gurl.es","hex.io","hiderefer.com","hmm.ph","href.in","hsblinks.com","htxt.it","huff.to","hulu.com","hurl.me","hurl.ws","icanhaz.com","idek.net","ilix.in","is.gd","its.my","ix.lt","j.mp","jijr.com","kl.am","klck.me","korta.nu","krunchd.com","l9k.net","lat.ms","liip.to","liltext.com","linkbee.com","linkbun.ch","liurl.cn","ln-s.net","ln-s.ru","lnk.gd","lnk.ms","lnkd.in","lnkurl.com","lru.jp","lt.tl","lurl.no","macte.ch","mash.to","merky.de","migre.me","miniurl.com","minurl.fr","mke.me","moby.to","moourl.com","mrte.ch","myloc.me","myurl.in","n.pr","nbc.co","nblo.gs","nn.nf","not.my","notlong.com","nsfw.in","nutshellurl.com","nxy.in","nyti.ms","o-x.fr","oc1.us","om.ly","omf.gd","omoikane.net","on.cnn.com","on.mktw.net","onforb.es","orz.se","ow.ly","ping.fm","pli.gs","pnt.me","politi.co","post.ly","pp.gg","profile.to","ptiturl.com","pub.vitrue.com","qlnk.net","qte.me","qu.tc","qy.fi","r.ebay.com","r.im","rb6.me","read.bi","readthis.ca","reallytinyurl.com","redir.ec","redirects.ca","redirx.com","retwt.me","ri.ms","rickroll.it","riz.gd","rt.nu","ru.ly","rubyurl.com","rurl.org","rww.tw","s4c.in","s7y.us","safe.mn","sameurl.com","sdut.us","shar.es","shink.de","shorl.com","short.ie","short.to","shortlinks.co.uk","shorturl.com","shout.to","show.my","shrinkify.com","shrinkr.com","shrt.fr","shrt.st","shrten.com","shrunkin.com","simurl.com","slate.me","smallr.com","smsh.me","smurl.name","sn.im","snipr.com","snipurl.com","snurl.com","sp2.ro","spedr.com","srnk.net","srs.li","starturl.com","stks.co","su.pr","surl.co.uk","surl.hu","t.cn","t.co","t.lh.com","ta.gd","tbd.ly","tcrn.ch","tgr.me","tgr.ph","tighturl.com","tiniuri.com","tiny.cc","tiny.ly","tiny.pl","tinylink.in","tinyuri.ca","tinyurl.com","tk.","tl.gd","tmi.me","tnij.org","tnw.to","tny.com","to.ly","togoto.us","totc.us","toysr.us","tpm.ly","tr.im","tra.kz","trunc.it","twhub.com","twirl.at","twitclicks.com","twitterurl.net","twitterurl.org","twiturl.de","twurl.cc","twurl.nl","u.mavrev.com","u.nu","u76.org","ub0.cc","ulu.lu","updating.me","ur1.ca","url.az","url.co.uk","url.ie","url360.me","url4.eu","urlborg.com","urlbrief.com","urlcover.com","urlcut.com","urlenco.de","urli.nl","urls.im","urlshorteningservicefortwitter.com","urlx.ie","urlzen.com","usat.ly","use.my","vb.ly","vevo.ly","vgn.am","vl.am","vm.lc","w55.de","wapo.st","wapurl.co.uk","wipi.es","wp.me","x.vu","xr.com","xrl.in","xrl.us","xurl.es","xurl.jp","y.ahoo.it","yatuc.com","ye.pe","yep.it","yfrog.com","yhoo.it","yiyd.com","youtu.be","yuarel.com","z0p.de","zi.ma","zi.mu","zipmyurl.com","zud.me","zurl.ws","zz.gd","zzang.kr","›.ws","✩.ws","✿.ws","❥.ws","➔.ws","➞.ws","➡.ws","➨.ws","➯.ws","➹.ws","➽.ws"];return 0===a("#jqoembeddata").length&&a('').appendTo("body"),this.each(function(){var c,i=a(this),j=!b||b.indexOf("http://")&&b.indexOf("https://")?i.attr("href"):b;if(d?g.onEmbed=d:g.onEmbed||(g.onEmbed=function(b){a.fn.oembed.insertCode(this,g.embedMethod,b)}),null!==j&&void 0!==j){for(var k=0,l=h.length;l>k;k++){var m=new RegExp("://"+h[k]+"/","i");if(null!==j.match(m)){var n=a.extend({url:"http://api.longurl.org/v2/expand",dataType:"jsonp",data:{url:j,format:"json"},success:function(b){j=b["long-url"],c=a.fn.oembed.getOEmbedProvider(b["long-url"]),null!==c?(c.params=f(g[c.name])||{},c.maxWidth=g.maxWidth,c.maxHeight=g.maxHeight,e(i,j,c)):g.onProviderNotFound.call(i,j)}},g.ajaxOptions||{});return a.ajax(n),i}}c=a.fn.oembed.getOEmbedProvider(j),null!==c?(c.params=f(g[c.name])||{},c.maxWidth=g.maxWidth,c.maxHeight=g.maxHeight,e(i,j,c)):g.onProviderNotFound.call(i,j)}return i})};var g;a.fn.oembed.defaults={maxWidth:null,maxHeight:null,includeHandle:!0,embedMethod:"auto",onProviderNotFound:function(){},beforeEmbed:function(){},afterEmbed:function(){},onEmbed:!1,onError:function(){},ajaxOptions:{}},a.fn.oembed.insertCode=function(b,c,d){if(null!==d)switch("auto"==c&&null!==b.attr("href")?c="append":"auto"==c&&(c="replace"),c){case"replace":b.replaceWith(d.code);break;case"fill":b.html(d.code);break;case"append":b.wrap('
');var e=b.parent();g.includeHandle&&a('').insertBefore(b).click(function(){var b=encodeURIComponent(a(this).text());a(this).html("%E2%86%91"==b?"↓":"↑"),a(this).parent().children().last().toggle()}),e.append("
");try{d.code.clone().appendTo(e)}catch(f){e.append(d.code)}if(g.maxWidth){var h=e.parent().width();if(h'+d+'';else if(b.thumbnail_url){var e=b.thumbnail_url.replace("_s","_b");c='
'+d+'
'}else c="
Error loading this picture
";return b.html&&(c+="
"+b.html+"
"),c},a.fn.oembed.getRichCode=function(a,b){var c=b.html;return c},a.fn.oembed.getGenericCode=function(a,b){var c=null!==b.title?b.title:a,d=''+c+"";return b.html&&(d+="
"+b.html+"
"),d},a.fn.oembed.getOEmbedProvider=function(b){for(var c=0;cd;d++){var f=new RegExp(a.fn.oembed.providers[c].urlschemes[d],"i");if(null!==b.match(f))return a.fn.oembed.providers[c]}return null},a.fn.oembed.OEmbedProvider=function(a,b,c,d,e){this.name=a,this.type=b,this.urlschemes=c,this.apiendpoint=d,this.maxWidth=500,this.maxHeight=400,e=e||{},e.useYQL&&(e.yql="xml"==e.useYQL?{xpath:"//oembed/html",from:"xml",apiendpoint:this.apiendpoint,url:function(a){return this.apiendpoint+"?format=xml&url="+a},datareturn:function(a){return a.html.replace(/.*\[CDATA\[(.*)\]\]>$/,"$1")||""}}:{from:"json",apiendpoint:this.apiendpoint,url:function(a){return this.apiendpoint+"?format=json&url="+a},datareturn:function(a){return"video"!=a.json.type&&(a.json.url||a.json.thumbnail_url)?'':a.json.html||""}},this.apiendpoint=null);for(var f in e)this[f]=e[f];this.format=this.format||"json",this.callbackparameter=this.callbackparameter||"callback",this.embedtag=this.embedtag||{tag:""}},a.fn.updateOEmbedProvider=function(b,c,d,e,f){for(var g=0;g':!1}}}),new a.fn.oembed.OEmbedProvider("deviantart","photo",["deviantart.com/.+","fav.me/.+","deviantart.com/.+"],"http://backend.deviantart.com/oembed",{format:"jsonp"}),new a.fn.oembed.OEmbedProvider("skitch","photo",["skitch.com/.+"],null,{yql:{xpath:"json",from:"json",url:function(a){return"http://skitch.com/oembed/?format=json&url="+a},datareturn:function(b){return a.fn.oembed.getPhotoCode(b.json.url,b.json)}}}),new a.fn.oembed.OEmbedProvider("mobypicture","photo",["mobypicture.com/user/.+/view/.+","moby.to/.+"],"http://api.mobypicture.com/oEmbed"),new a.fn.oembed.OEmbedProvider("flickr","photo",["flickr\\.com/photos/.+"],"http://flickr.com/services/oembed",{callbackparameter:"jsoncallback"}),new a.fn.oembed.OEmbedProvider("photobucket","photo",["photobucket\\.com/(albums|groups)/.+"],"http://photobucket.com/oembed/"),new a.fn.oembed.OEmbedProvider("instagram","photo",["instagr\\.?am(\\.com)?/.+"],"http://api.instagram.com/oembed"),new a.fn.oembed.OEmbedProvider("SmugMug","photo",["smugmug.com/[-.\\w@]+/.+"],"http://api.smugmug.com/services/oembed/"),new a.fn.oembed.OEmbedProvider("dribbble","photo",["dribbble.com/shots/.+"],"http://api.dribbble.com/shots/$1?callback=?",{templateRegex:/.*shots\/([\d]+).*/,templateData:function(a){return a.image_teaser_url?'':!1}}),new a.fn.oembed.OEmbedProvider("chart.ly","photo",["chart\\.ly/[a-z0-9]{6,8}"],"http://chart.ly/uploads/large_$1.png",{templateRegex:/.*ly\/([^\/]+).*/,embedtag:{tag:"img"},nocache:1}),new a.fn.oembed.OEmbedProvider("circuitlab","photo",["circuitlab.com/circuit/.+"],"https://www.circuitlab.com/circuit/$1/screenshot/540x405/",{templateRegex:/.*circuit\/([^\/]+).*/,embedtag:{tag:"img"},nocache:1}),new a.fn.oembed.OEmbedProvider("23hq","photo",["23hq.com/[-.\\w@]+/photo/.+"],"http://www.23hq.com/23/oembed",{useYQL:"json"}),new a.fn.oembed.OEmbedProvider("img.ly","photo",["img\\.ly/.+"],"http://img.ly/show/thumb/$1",{templateRegex:/.*ly\/([^\/]+).*/,embedtag:{tag:"img"},nocache:1}),new a.fn.oembed.OEmbedProvider("twitgoo.com","photo",["twitgoo\\.com/.+"],"http://twitgoo.com/show/thumb/$1",{templateRegex:/.*com\/([^\/]+).*/,embedtag:{tag:"img"},nocache:1}),new a.fn.oembed.OEmbedProvider("imgur.com","photo",["imgur\\.com/gallery/.+"],"http://imgur.com/$1l.jpg",{templateRegex:/.*gallery\/([^\/]+).*/,embedtag:{tag:"img"},nocache:1}),new a.fn.oembed.OEmbedProvider("visual.ly","rich",["visual\\.ly/.+"],null,{yql:{xpath:"//a[@id=\\'gc_article_graphic_image\\']/img",from:"htmlstring"}}),new a.fn.oembed.OEmbedProvider("gravtar","photo",["mailto:.+"],null,{templateRegex:/mailto:([^\/]+).*/,template:function(a,b){return'on Gravtar'}}),new a.fn.oembed.OEmbedProvider("twitter","rich",["twitter.com/.+"],"https://api.twitter.com/1/statuses/oembed.json"),new a.fn.oembed.OEmbedProvider("gmep","rich",["gmep.imeducate.com/.*","gmep.org/.*"],"http://gmep.org/oembed.json"),new a.fn.oembed.OEmbedProvider("urtak","rich",["urtak.com/(u|clr)/.+"],"http://oembed.urtak.com/1/oembed"),new a.fn.oembed.OEmbedProvider("cacoo","rich",["cacoo.com/.+"],"http://cacoo.com/oembed.json"),new a.fn.oembed.OEmbedProvider("dailymile","rich",["dailymile.com/people/.*/entries/.*"],"http://api.dailymile.com/oembed"),new a.fn.oembed.OEmbedProvider("dipity","rich",["dipity.com/timeline/.+"],"http://www.dipity.com/oembed/timeline/",{useYQL:"json"}),new a.fn.oembed.OEmbedProvider("sketchfab","rich",["sketchfab.com/show/.+"],"http://sketchfab.com/oembed",{useYQL:"json"}),new a.fn.oembed.OEmbedProvider("speakerdeck","rich",["speakerdeck.com/.+"],"http://speakerdeck.com/oembed.json",{useYQL:"json"}),new a.fn.oembed.OEmbedProvider("popplet","rich",["popplet.com/app/.*"],"http://popplet.com/app/Popplet_Alpha.swf?page_id=$1&em=1",{templateRegex:/.*#\/([^\/]+).*/,embedtag:{width:460,height:460}}),new a.fn.oembed.OEmbedProvider("pearltrees","rich",["pearltrees.com/.*"],"http://cdn.pearltrees.com/s/embed/getApp?",{templateRegex:/.*N-f=1_(\d+).*N-p=(\d+).*/,embedtag:{width:460,height:460,flashvars:"lang=en_US&embedId=pt-embed-$1-693&treeId=$1&pearlId=$2&treeTitle=Diagrams%2FVisualization&site=www.pearltrees.com%2FF"}}),new a.fn.oembed.OEmbedProvider("prezi","rich",["prezi.com/.*"],"http://prezi.com/bin/preziloader.swf?",{templateRegex:/.*com\/([^\/]+)\/.*/,embedtag:{width:550,height:400,flashvars:"prezi_id=$1&lock_to_path=0&color=ffffff&autoplay=no&autohide_ctrls=0"}}),new a.fn.oembed.OEmbedProvider("tourwrist","rich",["tourwrist.com/tours/.+"],null,{templateRegex:/.*tours.([\d]+).*/,template:function(a,b){return setTimeout(function(){loadEmbeds&&loadEmbeds()},2e3),"
"}}),new a.fn.oembed.OEmbedProvider("meetup","rich",["meetup\\.(com|ps)/.+"],"http://api.meetup.com/oembed"),new a.fn.oembed.OEmbedProvider("ebay","rich",["ebay\\.*"],"http://togo.ebay.com/togo/togo.swf?2008013100",{templateRegex:/.*\/([^\/]+)\/(\d{10,13}).*/,embedtag:{width:355,height:300,flashvars:"base=http://togo.ebay.com/togo/&lang=en-us&mode=normal&itemid=$2&query=$1"}}),new a.fn.oembed.OEmbedProvider("wikipedia","rich",["wikipedia.org/wiki/.+"],"http://$1.wikipedia.org/w/api.php?action=parse&page=$2&format=json§ion=0&callback=?",{templateRegex:/.*\/\/([\w]+).*\/wiki\/([^\/]+).*/,templateData:function(a){if(!a.parse)return!1;var b=a.parse.text["*"].replace(/href="\/wiki/g,'href="http://en.wikipedia.org/wiki');return'"}}),new a.fn.oembed.OEmbedProvider("imdb","rich",["imdb.com/title/.+"],"http://www.imdbapi.com/?i=$1&callback=?",{templateRegex:/.*\/title\/([^\/]+).*/,templateData:function(a){return a.Title?'

'+a.Title+" ("+a.Year+")

Rating: "+a.imdbRating+"
Genre: "+a.Genre+"
Starring: "+a.Actors+'

'+a.Plot+"
":!1}}),new a.fn.oembed.OEmbedProvider("livejournal","rich",["livejournal.com/"],"http://ljpic.seacrow.com/json/$2$4?jsonp=?",{templateRegex:/(http:\/\/(((?!users).)+)\.livejournal\.com|.*users\.livejournal\.com\/([^\/]+)).*/,templateData:function(a){return a.username?'
[info]'+a.username+"
"+a.name+"
":!1}}),new a.fn.oembed.OEmbedProvider("circuitbee","rich",["circuitbee\\.com/circuit/view/.+"],"http://c.circuitbee.com/build/r/schematic-embed.html?id=$1",{templateRegex:/.*circuit\/view\/(\d+).*/,embedtag:{tag:"iframe",width:"500",height:"350"}}),new a.fn.oembed.OEmbedProvider("googlecalendar","rich",["www.google.com/calendar/embed?.+"],"$1",{templateRegex:/(.*)/,embedtag:{tag:"iframe",width:"800",height:"600"}}),new a.fn.oembed.OEmbedProvider("jsfiddle","rich",["jsfiddle.net/[^/]+/?"],"http://jsfiddle.net/$1/embedded/result,js,resources,html,css/?",{templateRegex:/.*net\/([^\/]+).*/,embedtag:{tag:"iframe",width:"100%",height:"300"}}),new a.fn.oembed.OEmbedProvider("jsbin","rich",["jsbin.com/.+"],"http://jsbin.com/$1/?",{templateRegex:/.*com\/([^\/]+).*/,embedtag:{tag:"iframe",width:"100%",height:"300"}}),new a.fn.oembed.OEmbedProvider("jotform","rich",["form.jotform.co/form/.+"],"$1?",{templateRegex:/(.*)/,embedtag:{tag:"iframe",width:"100%",height:"507"}}),new a.fn.oembed.OEmbedProvider("reelapp","rich",["reelapp\\.com/.+"],"http://www.reelapp.com/$1/embed",{templateRegex:/.*com\/(\S{6}).*/,embedtag:{tag:"iframe",width:"400",height:"338"}}),new a.fn.oembed.OEmbedProvider("linkedin","rich",["linkedin.com/pub/.+"],"https://www.linkedin.com/cws/member/public_profile?public_profile_url=$1&format=inline&isFramed=true",{templateRegex:/(.*)/,embedtag:{tag:"iframe",width:"368px",height:"auto"}}),new a.fn.oembed.OEmbedProvider("timetoast","rich",["timetoast.com/timelines/[0-9]+"],"http://www.timetoast.com/flash/TimelineViewer.swf?passedTimelines=$1",{templateRegex:/.*timelines\/([0-9]*)/,embedtag:{width:550,height:400,nocache:1}}),new a.fn.oembed.OEmbedProvider("pastebin","rich",["pastebin\\.com/[\\S]{8}"],"http://pastebin.com/embed_iframe.php?i=$1",{templateRegex:/.*\/(\S{8}).*/,embedtag:{tag:"iframe",width:"100%",height:"auto"}}),new a.fn.oembed.OEmbedProvider("mixlr","rich",["mixlr.com/.+"],"http://mixlr.com/embed/$1?autoplay=ae",{templateRegex:/.*com\/([^\/]+).*/,embedtag:{tag:"iframe",width:"100%",height:"auto"}}),new a.fn.oembed.OEmbedProvider("pastie","rich",["pastie\\.org/pastes/.+"],null,{yql:{xpath:'//pre[@class="textmate-source"]'}}),new a.fn.oembed.OEmbedProvider("github","rich",["gist.github.com/.+"],"https://github.com/api/oembed"),new a.fn.oembed.OEmbedProvider("github","rich",["github.com/[-.\\w@]+/[-.\\w@]+"],"https://api.github.com/repos/$1/$2?callback=?",{templateRegex:/.*\/([^\/]+)\/([^\/]+).*/,templateData:function(a){return a.data.html_url?'

'+a.data.name+'

'+a.data.description+'

Last updated: '+a.data.pushed_at+"

":!1}}),new a.fn.oembed.OEmbedProvider("facebook","rich",["facebook.com/(people/[^\\/]+/\\d+|[^\\/]+$)"],"https://graph.facebook.com/$2$3/?callback=?",{templateRegex:/.*facebook.com\/(people\/[^\/]+\/(\d+).*|([^\/]+$))/,templateData:function(a){if(!a.id)return!1;var b='
facebook ';return b+=a.from?''+a.from.name+"":a.link?''+a.name+"":a.username?''+a.name+"":''+a.name+"",b+='
',b+=a.picture?'':'',a.from&&(b+=''+a.name+""),a.founded&&(b+="Founded: "+a.founded+"
"),a.category&&(b+="Category: "+a.category+"
"),a.website&&(b+='Website: '+a.website+"
"),a.gender&&(b+="Gender: "+a.gender+"
"),a.description&&(b+=a.description+"
"),b+="
"}}),new a.fn.oembed.OEmbedProvider("stackoverflow","rich",["stackoverflow.com/questions/[\\d]+"],"http://api.stackoverflow.com/1.1/questions/$1?body=true&jsonp=?",{templateRegex:/.*questions\/([\d]+).*/,templateData:function(b){if(!b.questions)return!1;var c=b.questions[0],d=a(c.body).text(),e='
'+(c.up_vote_count-c.down_vote_count)+'
vote(s)
'+c.answer_count+'answer
'+c.view_count+' view(s)

'+c.title+'

'+d.substring(0,100)+'...
';for(i in c.tags)e+='";return e+='
" +!function(a){function b(a,c){return c=c?c:"",a?b(--a,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".charAt(Math.floor(60*Math.random()))+c):c}function c(a,b){var c,d=a.apiendpoint,e="";d+=d.indexOf("?")<=0?"?":"&",d=d.replace("#","%23"),null===a.maxWidth||"undefined"!=typeof a.params.maxwidth&&null!==a.params.maxwidth||(a.params.maxwidth=a.maxWidth),null===a.maxHeight||"undefined"!=typeof a.params.maxheight&&null!==a.params.maxheight||(a.params.maxheight=a.maxHeight);for(c in a.params)c!=a.callbackparameter&&null!==a.params[c]&&(e+="&"+escape(c)+"="+a.params[c]);return d+="format="+a.format+"&url="+escape(b)+e,"json"!=a.dataType&&(d+="&"+a.callbackparameter+"=?"),d}function d(b,c,d){a("#jqoembeddata").data(c,b.code),g.beforeEmbed.call(d,b),g.onEmbed.call(d,b),g.afterEmbed.call(d,b)}function e(e,f,h){if(void 0!=a("#jqoembeddata").data(f)&&"iframe"!=h.embedtag.tag){var i={code:a("#jqoembeddata").data(f)};d(i,f,e)}else if(h.yql){var j=h.yql.from||"htmlstring",k=h.yql.url?h.yql.url(f):f,l="SELECT * FROM "+j+' WHERE url="'+k+'" and '+(/html/.test(j)?"xpath":"itemPath")+"='"+(h.yql.xpath||"/")+"'";"html"==j&&(l+=" and compat='html5'");var m=a.extend({url:"http://query.yahooapis.com/v1/public/yql",dataType:"jsonp",data:{q:l,format:"json",env:"store://datatables.org/alltableswithkeys",callback:"?"},success:function(b){var c;if(h.yql.xpath&&"//meta|//title|//link"==h.yql.xpath){var g={};null==b.query.results&&(b.query.results={meta:[]});for(var i=0,j=b.query.results.meta.length;j>i;i++){var k=b.query.results.meta[i].name||b.query.results.meta[i].property||null;null!=k&&(g[k.toLowerCase()]=b.query.results.meta[i].content)}g.hasOwnProperty("title")&&g.hasOwnProperty("og:title")||null!=b.query.results.title&&(g.title=b.query.results.title),c=h.yql.datareturn(g)}else c=h.yql.datareturn?h.yql.datareturn(b.query.results):b.query.results.result;if(c!==!1){var l=a.extend({},c);l.code=c,d(l,f,e)}},error:g.onError.call(e,f,h)},g.ajaxOptions||{});a.ajax(m)}else if(h.templateRegex)if(""!==h.embedtag.tag){var n=h.embedtag.flashvars||"",o=h.embedtag.tag||"embed",p=h.embedtag.width||"auto",q=(h.embedtag.nocache||0,h.embedtag.height||"auto"),r=f.replace(h.templateRegex,h.apiendpoint);h.nocache||(r+="&jqoemcache="+b(5)),h.apikey&&(r=r.replace("_APIKEY_",g.apikeys[h.name]));var s=a("<"+o+"/>").attr("src",r).attr("width",p).attr("height",q).attr("allowfullscreen",h.embedtag.allowfullscreen||"true").attr("allowscriptaccess",h.embedtag.allowfullscreen||"always").css("max-height",g.maxHeight||"auto").css("max-width",g.maxWidth||"auto");"embed"==o&&s.attr("type",h.embedtag.type||"application/x-shockwave-flash").attr("flashvars",f.replace(h.templateRegex,n)),"iframe"==o&&s.attr("scrolling",h.embedtag.scrolling||"no").attr("frameborder",h.embedtag.frameborder||"0");var i={code:s};d(i,f,e)}else if(h.apiendpoint)h.apikey&&(h.apiendpoint=h.apiendpoint.replace("_APIKEY_",g.apikeys[h.name])),m=a.extend({url:f.replace(h.templateRegex,h.apiendpoint),dataType:"jsonp",success:function(b){var c=a.extend({},b);c.code=h.templateData(b),c.code&&d(c,f,e)},error:g.onError.call(e,f,h)},g.ajaxOptions||{}),a.ajax(m);else{var i={code:f.replace(h.templateRegex,h.template)};d(i,f,e)}else{var t=c(h,f),m=a.extend({url:t,dataType:h.dataType||"jsonp",success:function(b){var c=a.extend({},b);switch(c.type){case"file":case"photo":c.code=a.fn.oembed.getPhotoCode(f,c);break;case"video":case"rich":c.code=a.fn.oembed.getRichCode(f,c);break;default:c.code=a.fn.oembed.getGenericCode(f,c)}d(c,f,e)},error:g.onError.call(e,f,h)},g.ajaxOptions||{});a.ajax(m)}}function f(a){if(null===a)return null;var b,c={};for(b in a)null!==b&&(c[b.toLowerCase()]=a[b]);return c}a.fn.oembed=function(b,c,d){g=a.extend(!0,a.fn.oembed.defaults,c);var h=["0rz.tw","1link.in","1url.com","2.gp","2big.at","2tu.us","3.ly","307.to","4ms.me","4sq.com","4url.cc","6url.com","7.ly","a.gg","a.nf","aa.cx","abcurl.net","ad.vu","adf.ly","adjix.com","afx.cc","all.fuseurl.com","alturl.com","amzn.to","ar.gy","arst.ch","atu.ca","azc.cc","b23.ru","b2l.me","bacn.me","bcool.bz","binged.it","bit.ly","bizj.us","bloat.me","bravo.ly","bsa.ly","budurl.com","canurl.com","chilp.it","chzb.gr","cl.lk","cl.ly","clck.ru","cli.gs","cliccami.info","clickthru.ca","clop.in","conta.cc","cort.as","cot.ag","crks.me","ctvr.us","cutt.us","dai.ly","decenturl.com","dfl8.me","digbig.com","http://digg.com/[^/]+$","disq.us","dld.bz","dlvr.it","do.my","doiop.com","dopen.us","easyuri.com","easyurl.net","eepurl.com","eweri.com","fa.by","fav.me","fb.me","fbshare.me","ff.im","fff.to","fire.to","firsturl.de","firsturl.net","flic.kr","flq.us","fly2.ws","fon.gs","freak.to","fuseurl.com","fuzzy.to","fwd4.me","fwib.net","g.ro.lt","gizmo.do","gl.am","go.9nl.com","go.ign.com","go.usa.gov","goo.gl","goshrink.com","gurl.es","hex.io","hiderefer.com","hmm.ph","href.in","hsblinks.com","htxt.it","huff.to","hulu.com","hurl.me","hurl.ws","icanhaz.com","idek.net","ilix.in","is.gd","its.my","ix.lt","j.mp","jijr.com","kl.am","klck.me","korta.nu","krunchd.com","l9k.net","lat.ms","liip.to","liltext.com","linkbee.com","linkbun.ch","liurl.cn","ln-s.net","ln-s.ru","lnk.gd","lnk.ms","lnkd.in","lnkurl.com","lru.jp","lt.tl","lurl.no","macte.ch","mash.to","merky.de","migre.me","miniurl.com","minurl.fr","mke.me","moby.to","moourl.com","mrte.ch","myloc.me","myurl.in","n.pr","nbc.co","nblo.gs","nn.nf","not.my","notlong.com","nsfw.in","nutshellurl.com","nxy.in","nyti.ms","o-x.fr","oc1.us","om.ly","omf.gd","omoikane.net","on.cnn.com","on.mktw.net","onforb.es","orz.se","ow.ly","ping.fm","pli.gs","pnt.me","politi.co","post.ly","pp.gg","profile.to","ptiturl.com","pub.vitrue.com","qlnk.net","qte.me","qu.tc","qy.fi","r.ebay.com","r.im","rb6.me","read.bi","readthis.ca","reallytinyurl.com","redir.ec","redirects.ca","redirx.com","retwt.me","ri.ms","rickroll.it","riz.gd","rt.nu","ru.ly","rubyurl.com","rurl.org","rww.tw","s4c.in","s7y.us","safe.mn","sameurl.com","sdut.us","shar.es","shink.de","shorl.com","short.ie","short.to","shortlinks.co.uk","shorturl.com","shout.to","show.my","shrinkify.com","shrinkr.com","shrt.fr","shrt.st","shrten.com","shrunkin.com","simurl.com","slate.me","smallr.com","smsh.me","smurl.name","sn.im","snipr.com","snipurl.com","snurl.com","sp2.ro","spedr.com","srnk.net","srs.li","starturl.com","stks.co","su.pr","surl.co.uk","surl.hu","t.cn","t.co","t.lh.com","ta.gd","tbd.ly","tcrn.ch","tgr.me","tgr.ph","tighturl.com","tiniuri.com","tiny.cc","tiny.ly","tiny.pl","tinylink.in","tinyuri.ca","tinyurl.com","tk.","tl.gd","tmi.me","tnij.org","tnw.to","tny.com","to.ly","togoto.us","totc.us","toysr.us","tpm.ly","tr.im","tra.kz","trunc.it","twhub.com","twirl.at","twitclicks.com","twitterurl.net","twitterurl.org","twiturl.de","twurl.cc","twurl.nl","u.mavrev.com","u.nu","u76.org","ub0.cc","ulu.lu","updating.me","ur1.ca","url.az","url.co.uk","url.ie","url360.me","url4.eu","urlborg.com","urlbrief.com","urlcover.com","urlcut.com","urlenco.de","urli.nl","urls.im","urlshorteningservicefortwitter.com","urlx.ie","urlzen.com","usat.ly","use.my","vb.ly","vevo.ly","vgn.am","vl.am","vm.lc","w55.de","wapo.st","wapurl.co.uk","wipi.es","wp.me","x.vu","xr.com","xrl.in","xrl.us","xurl.es","xurl.jp","y.ahoo.it","yatuc.com","ye.pe","yep.it","yfrog.com","yhoo.it","yiyd.com","youtu.be","yuarel.com","z0p.de","zi.ma","zi.mu","zipmyurl.com","zud.me","zurl.ws","zz.gd","zzang.kr","›.ws","✩.ws","✿.ws","❥.ws","➔.ws","➞.ws","➡.ws","➨.ws","➯.ws","➹.ws","➽.ws"];return 0===a("#jqoembeddata").length&&a('').appendTo("body"),this.each(function(){var c,i=a(this),j=!b||b.indexOf("http://")&&b.indexOf("https://")?i.attr("href"):b;if(d?g.onEmbed=d:g.onEmbed||(g.onEmbed=function(b){a.fn.oembed.insertCode(this,g.embedMethod,b)}),null!==j&&void 0!==j){for(var k=0,l=h.length;l>k;k++){var m=new RegExp("://"+h[k]+"/","i");if(null!==j.match(m)){var n=a.extend({url:"http://api.longurl.org/v2/expand",dataType:"jsonp",data:{url:j,format:"json"},success:function(b){j=b["long-url"],c=a.fn.oembed.getOEmbedProvider(b["long-url"]),null!==c?(c.params=f(g[c.name])||{},c.maxWidth=g.maxWidth,c.maxHeight=g.maxHeight,e(i,j,c)):g.onProviderNotFound.call(i,j)}},g.ajaxOptions||{});return a.ajax(n),i}}c=a.fn.oembed.getOEmbedProvider(j),null!==c?(c.params=f(g[c.name])||{},c.maxWidth=g.maxWidth,c.maxHeight=g.maxHeight,e(i,j,c)):g.onProviderNotFound.call(i,j)}return i})};var g;a.fn.oembed.defaults={maxWidth:null,maxHeight:null,includeHandle:!0,embedMethod:"auto",onProviderNotFound:function(){},beforeEmbed:function(){},afterEmbed:function(){},onEmbed:!1,onError:function(){},ajaxOptions:{}},a.fn.oembed.insertCode=function(b,c,d){if(null!==d)switch("auto"==c&&null!==b.attr("href")?c="append":"auto"==c&&(c="replace"),c){case"replace":b.replaceWith(d.code);break;case"fill":b.html(d.code);break;case"append":b.wrap('
');var e=b.parent();g.includeHandle&&a('').insertBefore(b).click(function(){var b=encodeURIComponent(a(this).text());a(this).html("%E2%86%91"==b?"↓":"↑"),a(this).parent().children().last().toggle()}),e.append("
");try{d.code.clone().appendTo(e)}catch(f){e.append(d.code)}if(g.maxWidth){var h=e.parent().width();if(h'+d+'
';else if(b.thumbnail_url){var e=b.thumbnail_url.replace("_s","_b");c='
'+d+'
'}else c="
Error loading this picture
";return b.html&&(c+="
"+b.html+"
"),c},a.fn.oembed.getRichCode=function(a,b){var c=b.html;return c},a.fn.oembed.getGenericCode=function(a,b){var c=null!==b.title?b.title:a,d="";return b.html&&(d+='
'+c+"
"+jQuery(b.html).text().substring(0,200)+'... more
'),d},a.fn.oembed.getOEmbedProvider=function(b){for(var c=0;cd;d++){var f=new RegExp(a.fn.oembed.providers[c].urlschemes[d],"i");if(null!==b.match(f))return a.fn.oembed.providers[c]}return null},a.fn.oembed.OEmbedProvider=function(a,b,c,d,e){this.name=a,this.type=b,this.urlschemes=c,this.apiendpoint=d,this.maxWidth=500,this.maxHeight=400,e=e||{},e.useYQL&&(e.yql="xml"==e.useYQL?{xpath:"//oembed/html",from:"xml",apiendpoint:this.apiendpoint,url:function(a){return this.apiendpoint+"?format=xml&url="+a},datareturn:function(a){return a.html.replace(/.*\[CDATA\[(.*)\]\]>$/,"$1")||""}}:{from:"json",apiendpoint:this.apiendpoint,url:function(a){return this.apiendpoint+"?format=json&url="+a},datareturn:function(a){return"video"!=a.json.type&&(a.json.url||a.json.thumbnail_url)?'':a.json.html||""}},this.apiendpoint=null);for(var f in e)this[f]=e[f];this.format=this.format||"json",this.callbackparameter=this.callbackparameter||"callback",this.embedtag=this.embedtag||{tag:""}},a.fn.updateOEmbedProvider=function(b,c,d,e,f){for(var g=0;g':!1}}}),new a.fn.oembed.OEmbedProvider("deviantart","photo",["deviantart.com/.+","fav.me/.+","deviantart.com/.+"],"http://backend.deviantart.com/oembed",{format:"jsonp"}),new a.fn.oembed.OEmbedProvider("skitch","photo",["skitch.com/.+"],null,{yql:{xpath:"json",from:"json",url:function(a){return"http://skitch.com/oembed/?format=json&url="+a},datareturn:function(b){return a.fn.oembed.getPhotoCode(b.json.url,b.json)}}}),new a.fn.oembed.OEmbedProvider("mobypicture","photo",["mobypicture.com/user/.+/view/.+","moby.to/.+"],"http://api.mobypicture.com/oEmbed"),new a.fn.oembed.OEmbedProvider("flickr","photo",["flickr\\.com/photos/.+"],"http://flickr.com/services/oembed",{callbackparameter:"jsoncallback"}),new a.fn.oembed.OEmbedProvider("photobucket","photo",["photobucket\\.com/(albums|groups)/.+"],"http://photobucket.com/oembed/"),new a.fn.oembed.OEmbedProvider("instagram","photo",["instagr\\.?am(\\.com)?/.+"],"http://api.instagram.com/oembed"),new a.fn.oembed.OEmbedProvider("SmugMug","photo",["smugmug.com/[-.\\w@]+/.+"],"http://api.smugmug.com/services/oembed/"),new a.fn.oembed.OEmbedProvider("dribbble","photo",["dribbble.com/shots/.+"],"http://api.dribbble.com/shots/$1?callback=?",{templateRegex:/.*shots\/([\d]+).*/,templateData:function(a){return a.image_teaser_url?'':!1}}),new a.fn.oembed.OEmbedProvider("chart.ly","photo",["chart\\.ly/[a-z0-9]{6,8}"],"http://chart.ly/uploads/large_$1.png",{templateRegex:/.*ly\/([^\/]+).*/,embedtag:{tag:"img"},nocache:1}),new a.fn.oembed.OEmbedProvider("circuitlab","photo",["circuitlab.com/circuit/.+"],"https://www.circuitlab.com/circuit/$1/screenshot/540x405/",{templateRegex:/.*circuit\/([^\/]+).*/,embedtag:{tag:"img"},nocache:1}),new a.fn.oembed.OEmbedProvider("23hq","photo",["23hq.com/[-.\\w@]+/photo/.+"],"http://www.23hq.com/23/oembed",{useYQL:"json"}),new a.fn.oembed.OEmbedProvider("img.ly","photo",["img\\.ly/.+"],"http://img.ly/show/thumb/$1",{templateRegex:/.*ly\/([^\/]+).*/,embedtag:{tag:"img"},nocache:1}),new a.fn.oembed.OEmbedProvider("twitgoo.com","photo",["twitgoo\\.com/.+"],"http://twitgoo.com/show/thumb/$1",{templateRegex:/.*com\/([^\/]+).*/,embedtag:{tag:"img"},nocache:1}),new a.fn.oembed.OEmbedProvider("imgur.com","photo",["imgur\\.com/gallery/.+"],"http://imgur.com/$1l.jpg",{templateRegex:/.*gallery\/([^\/]+).*/,embedtag:{tag:"img"},nocache:1}),new a.fn.oembed.OEmbedProvider("visual.ly","rich",["visual\\.ly/.+"],null,{yql:{xpath:"//a[@id=\\'gc_article_graphic_image\\']/img",from:"htmlstring"}}),new a.fn.oembed.OEmbedProvider("gravtar","photo",["mailto:.+"],null,{templateRegex:/mailto:([^\/]+).*/,template:function(a,b){return'on Gravtar'}}),new a.fn.oembed.OEmbedProvider("twitter","rich",["twitter.com/.+"],"https://api.twitter.com/1/statuses/oembed.json"),new a.fn.oembed.OEmbedProvider("gmep","rich",["gmep.imeducate.com/.*","gmep.org/.*"],"http://gmep.org/oembed.json"),new a.fn.oembed.OEmbedProvider("urtak","rich",["urtak.com/(u|clr)/.+"],"http://oembed.urtak.com/1/oembed"),new a.fn.oembed.OEmbedProvider("cacoo","rich",["cacoo.com/.+"],"http://cacoo.com/oembed.json"),new a.fn.oembed.OEmbedProvider("dailymile","rich",["dailymile.com/people/.*/entries/.*"],"http://api.dailymile.com/oembed"),new a.fn.oembed.OEmbedProvider("dipity","rich",["dipity.com/timeline/.+"],"http://www.dipity.com/oembed/timeline/",{useYQL:"json"}),new a.fn.oembed.OEmbedProvider("sketchfab","rich",["sketchfab.com/show/.+"],"http://sketchfab.com/oembed",{useYQL:"json"}),new a.fn.oembed.OEmbedProvider("speakerdeck","rich",["speakerdeck.com/.+"],"http://speakerdeck.com/oembed.json",{useYQL:"json"}),new a.fn.oembed.OEmbedProvider("popplet","rich",["popplet.com/app/.*"],"http://popplet.com/app/Popplet_Alpha.swf?page_id=$1&em=1",{templateRegex:/.*#\/([^\/]+).*/,embedtag:{width:460,height:460}}),new a.fn.oembed.OEmbedProvider("pearltrees","rich",["pearltrees.com/.*"],"http://cdn.pearltrees.com/s/embed/getApp?",{templateRegex:/.*N-f=1_(\d+).*N-p=(\d+).*/,embedtag:{width:460,height:460,flashvars:"lang=en_US&embedId=pt-embed-$1-693&treeId=$1&pearlId=$2&treeTitle=Diagrams%2FVisualization&site=www.pearltrees.com%2FF"}}),new a.fn.oembed.OEmbedProvider("prezi","rich",["prezi.com/.*"],"http://prezi.com/bin/preziloader.swf?",{templateRegex:/.*com\/([^\/]+)\/.*/,embedtag:{width:550,height:400,flashvars:"prezi_id=$1&lock_to_path=0&color=ffffff&autoplay=no&autohide_ctrls=0"}}),new a.fn.oembed.OEmbedProvider("tourwrist","rich",["tourwrist.com/tours/.+"],null,{templateRegex:/.*tours.([\d]+).*/,template:function(a,b){return setTimeout(function(){loadEmbeds&&loadEmbeds()},2e3),"
"}}),new a.fn.oembed.OEmbedProvider("meetup","rich",["meetup\\.(com|ps)/.+"],"http://api.meetup.com/oembed"),new a.fn.oembed.OEmbedProvider("ebay","rich",["ebay\\.*"],"http://togo.ebay.com/togo/togo.swf?2008013100",{templateRegex:/.*\/([^\/]+)\/(\d{10,13}).*/,embedtag:{width:355,height:300,flashvars:"base=http://togo.ebay.com/togo/&lang=en-us&mode=normal&itemid=$2&query=$1"}}),new a.fn.oembed.OEmbedProvider("wikipedia","rich",["wikipedia.org/wiki/.+"],"http://$1.wikipedia.org/w/api.php?action=parse&page=$2&format=json§ion=0&callback=?",{templateRegex:/.*\/\/([\w]+).*\/wiki\/([^\/]+).*/,templateData:function(a){if(!a.parse)return!1;var b=a.parse.text["*"].replace(/href="\/wiki/g,'href="http://en.wikipedia.org/wiki');return'
'+a.parse.displaytitle+"
"+jQuery(b).text().substring(0,200)+"...
"}}),new a.fn.oembed.OEmbedProvider("imdb","rich",["imdb.com/title/.+"],"http://www.imdbapi.com/?i=$1&callback=?",{templateRegex:/.*\/title\/([^\/]+).*/,templateData:function(a){return a.Title?'

'+a.Title+" ("+a.Year+")

Rating: "+a.imdbRating+"
Genre: "+a.Genre+"
Starring: "+a.Actors+'

'+a.Plot+"
":!1}}),new a.fn.oembed.OEmbedProvider("livejournal","rich",["livejournal.com/"],"http://ljpic.seacrow.com/json/$2$4?jsonp=?",{templateRegex:/(http:\/\/(((?!users).)+)\.livejournal\.com|.*users\.livejournal\.com\/([^\/]+)).*/,templateData:function(a){return a.username?'
[info]'+a.username+"
"+a.name+"
":!1}}),new a.fn.oembed.OEmbedProvider("circuitbee","rich",["circuitbee\\.com/circuit/view/.+"],"http://c.circuitbee.com/build/r/schematic-embed.html?id=$1",{templateRegex:/.*circuit\/view\/(\d+).*/,embedtag:{tag:"iframe",width:"500",height:"350"}}),new a.fn.oembed.OEmbedProvider("googlecalendar","rich",["www.google.com/calendar/embed?.+"],"$1",{templateRegex:/(.*)/,embedtag:{tag:"iframe",width:"800",height:"600"}}),new a.fn.oembed.OEmbedProvider("jsfiddle","rich",["jsfiddle.net/[^/]+/?"],"http://jsfiddle.net/$1/embedded/result,js,resources,html,css/?",{templateRegex:/.*net\/([^\/]+).*/,embedtag:{tag:"iframe",width:"100%",height:"300"}}),new a.fn.oembed.OEmbedProvider("jsbin","rich",["jsbin.com/.+"],"http://jsbin.com/$1/?",{templateRegex:/.*com\/([^\/]+).*/,embedtag:{tag:"iframe",width:"100%",height:"300"}}),new a.fn.oembed.OEmbedProvider("jotform","rich",["form.jotform.co/form/.+"],"$1?",{templateRegex:/(.*)/,embedtag:{tag:"iframe",width:"100%",height:"507"}}),new a.fn.oembed.OEmbedProvider("reelapp","rich",["reelapp\\.com/.+"],"http://www.reelapp.com/$1/embed",{templateRegex:/.*com\/(\S{6}).*/,embedtag:{tag:"iframe",width:"400",height:"338"}}),new a.fn.oembed.OEmbedProvider("linkedin","rich",["linkedin.com/pub/.+"],"https://www.linkedin.com/cws/member/public_profile?public_profile_url=$1&format=inline&isFramed=true",{templateRegex:/(.*)/,embedtag:{tag:"iframe",width:"368px",height:"auto"}}),new a.fn.oembed.OEmbedProvider("timetoast","rich",["timetoast.com/timelines/[0-9]+"],"http://www.timetoast.com/flash/TimelineViewer.swf?passedTimelines=$1",{templateRegex:/.*timelines\/([0-9]*)/,embedtag:{width:550,height:400,nocache:1}}),new a.fn.oembed.OEmbedProvider("pastebin","rich",["pastebin\\.com/[\\S]{8}"],"http://pastebin.com/embed_iframe.php?i=$1",{templateRegex:/.*\/(\S{8}).*/,embedtag:{tag:"iframe",width:"100%",height:"auto"}}),new a.fn.oembed.OEmbedProvider("mixlr","rich",["mixlr.com/.+"],"http://mixlr.com/embed/$1?autoplay=ae",{templateRegex:/.*com\/([^\/]+).*/,embedtag:{tag:"iframe",width:"100%",height:"auto"}}),new a.fn.oembed.OEmbedProvider("pastie","rich",["pastie\\.org/pastes/.+"],null,{yql:{xpath:'//pre[@class="textmate-source"]'}}),new a.fn.oembed.OEmbedProvider("github","rich",["gist.github.com/.+"],"https://github.com/api/oembed"),new a.fn.oembed.OEmbedProvider("github","rich",["github.com/[-.\\w@]+/[-.\\w@]+"],"https://api.github.com/repos/$1/$2?callback=?",{templateRegex:/.*\/([^\/]+)\/([^\/]+).*/,templateData:function(a){return a.data.html_url?'

'+a.data.name+'

'+a.data.description+'

Last updated: '+a.data.pushed_at+"

":!1}}),new a.fn.oembed.OEmbedProvider("facebook","rich",["facebook.com/(people/[^\\/]+/\\d+|[^\\/]+$)"],"https://graph.facebook.com/$2$3/?callback=?",{templateRegex:/.*facebook.com\/(people\/[^\/]+\/(\d+).*|([^\/]+$))/,templateData:function(a){if(!a.id)return!1;var b='
facebook ';return b+=a.from?''+a.from.name+"":a.link?''+a.name+"":a.username?''+a.name+"":''+a.name+"",b+='
',b+=a.picture?'':'',a.from&&(b+=''+a.name+""),a.founded&&(b+="Founded: "+a.founded+"
"),a.category&&(b+="Category: "+a.category+"
"),a.website&&(b+='Website: '+a.website+"
"),a.gender&&(b+="Gender: "+a.gender+"
"),a.description&&(b+=a.description+"
"),b+="
"}}),new a.fn.oembed.OEmbedProvider("stackoverflow","rich",["stackoverflow.com/questions/[\\d]+"],"http://api.stackoverflow.com/1.1/questions/$1?body=true&jsonp=?",{templateRegex:/.*questions\/([\d]+).*/,templateData:function(b){if(!b.questions)return!1;var c=b.questions[0],d=a(c.body).text(),e='
'+(c.up_vote_count-c.down_vote_count)+'
vote(s)
'+c.answer_count+'answer
'+c.view_count+' view(s)

'+c.title+'

'+d.substring(0,100)+'...
';for(i in c.tags)e+='";return e+='
" }}),new a.fn.oembed.OEmbedProvider("wordpress","rich",["wordpress\\.com/.+","blogs\\.cnn\\.com/.+","techcrunch\\.com/.+","wp\\.me/.+"],"http://public-api.wordpress.com/oembed/1.0/?for=jquery-oembed-all"),new a.fn.oembed.OEmbedProvider("screenr","rich",["screenr.com"],"http://www.screenr.com/embed/$1",{templateRegex:/.*\/([^\/]+).*/,embedtag:{tag:"iframe",width:"650",height:396}}),new a.fn.oembed.OEmbedProvider("gigpans","rich",["gigapan\\.org/[-.\\w@]+/\\d+"],"http://gigapan.org/gigapans/$1/options/nosnapshots/iframe/flash.html",{templateRegex:/.*\/(\d+)\/?.*/,embedtag:{tag:"iframe",width:"100%",height:400}}),new a.fn.oembed.OEmbedProvider("scribd","rich",["scribd\\.com/.+"],"http://www.scribd.com/embeds/$1/content?start_page=1&view_mode=list",{templateRegex:/.*doc\/([^\/]+).*/,embedtag:{tag:"iframe",width:"100%",height:600}}),new a.fn.oembed.OEmbedProvider("kickstarter","rich",["kickstarter\\.com/projects/.+"],"$1/widget/card.html",{templateRegex:/([^\?]+).*/,embedtag:{tag:"iframe",width:"220",height:380}}),new a.fn.oembed.OEmbedProvider("amazon","rich",["amzn.com/B+","amazon.com.*/(B\\S+)($|\\/.*)"],"http://rcm.amazon.com/e/cm?t=_APIKEY_&o=1&p=8&l=as1&asins=$1&ref=qf_br_asin_til&fc1=000000&IS2=1<1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr",{apikey:!0,templateRegex:/.*\/(B[0-9A-Z]+)($|\/.*)/,embedtag:{tag:"iframe",width:"120px",height:"240px"}}),new a.fn.oembed.OEmbedProvider("slideshare","rich",["slideshare.net"],"http://www.slideshare.net/api/oembed/2",{format:"jsonp"}),new a.fn.oembed.OEmbedProvider("roomsharejp","rich",["roomshare\\.jp/(en/)?post/.*"],"http://roomshare.jp/oembed.json"),new a.fn.oembed.OEmbedProvider("lanyard","rich",["lanyrd.com/\\d+/.+"],null,{yql:{xpath:'(//div[@class="primary"])[1]',from:"htmlstring",datareturn:function(a){return a.result?'
'+a.result+"
":!1}}}),new a.fn.oembed.OEmbedProvider("asciiartfarts","rich",["asciiartfarts.com/\\d+.html"],null,{yql:{xpath:"//pre/font",from:"htmlstring",datareturn:function(a){return a.result?'
'+a.result+"
":!1}}})]}(jQuery),String.prototype.md5=function(){var a=function(a,b){var c=(65535&a)+(65535&b),d=(a>>16)+(b>>16)+(c>>16);return d<<16|65535&c},b=function(a,b){return a<>>32-b},c=function(c,d,e,f,g,h){return a(b(a(a(d,c),a(f,h)),g),e)},d=function(a,b,d,e,f,g,h){return c(b&d|~b&e,a,b,f,g,h)},e=function(a,b,d,e,f,g,h){return c(b&e|d&~e,a,b,f,g,h)},f=function(a,b,d,e,f,g,h){return c(b^d^e,a,b,f,g,h)},g=function(a,b,d,e,f,g,h){return c(d^(b|~e),a,b,f,g,h)},h=function(b){var c,h,i,j,k,l=b.length,m=1732584193,n=-271733879,o=-1732584194,p=271733878;for(k=0;l>k;k+=16)c=m,h=n,i=o,j=p,m=d(m,n,o,p,b[k+0],7,-680876936),p=d(p,m,n,o,b[k+1],12,-389564586),o=d(o,p,m,n,b[k+2],17,606105819),n=d(n,o,p,m,b[k+3],22,-1044525330),m=d(m,n,o,p,b[k+4],7,-176418897),p=d(p,m,n,o,b[k+5],12,1200080426),o=d(o,p,m,n,b[k+6],17,-1473231341),n=d(n,o,p,m,b[k+7],22,-45705983),m=d(m,n,o,p,b[k+8],7,1770035416),p=d(p,m,n,o,b[k+9],12,-1958414417),o=d(o,p,m,n,b[k+10],17,-42063),n=d(n,o,p,m,b[k+11],22,-1990404162),m=d(m,n,o,p,b[k+12],7,1804603682),p=d(p,m,n,o,b[k+13],12,-40341101),o=d(o,p,m,n,b[k+14],17,-1502002290),n=d(n,o,p,m,b[k+15],22,1236535329),m=e(m,n,o,p,b[k+1],5,-165796510),p=e(p,m,n,o,b[k+6],9,-1069501632),o=e(o,p,m,n,b[k+11],14,643717713),n=e(n,o,p,m,b[k+0],20,-373897302),m=e(m,n,o,p,b[k+5],5,-701558691),p=e(p,m,n,o,b[k+10],9,38016083),o=e(o,p,m,n,b[k+15],14,-660478335),n=e(n,o,p,m,b[k+4],20,-405537848),m=e(m,n,o,p,b[k+9],5,568446438),p=e(p,m,n,o,b[k+14],9,-1019803690),o=e(o,p,m,n,b[k+3],14,-187363961),n=e(n,o,p,m,b[k+8],20,1163531501),m=e(m,n,o,p,b[k+13],5,-1444681467),p=e(p,m,n,o,b[k+2],9,-51403784),o=e(o,p,m,n,b[k+7],14,1735328473),n=e(n,o,p,m,b[k+12],20,-1926607734),m=f(m,n,o,p,b[k+5],4,-378558),p=f(p,m,n,o,b[k+8],11,-2022574463),o=f(o,p,m,n,b[k+11],16,1839030562),n=f(n,o,p,m,b[k+14],23,-35309556),m=f(m,n,o,p,b[k+1],4,-1530992060),p=f(p,m,n,o,b[k+4],11,1272893353),o=f(o,p,m,n,b[k+7],16,-155497632),n=f(n,o,p,m,b[k+10],23,-1094730640),m=f(m,n,o,p,b[k+13],4,681279174),p=f(p,m,n,o,b[k+0],11,-358537222),o=f(o,p,m,n,b[k+3],16,-722521979),n=f(n,o,p,m,b[k+6],23,76029189),m=f(m,n,o,p,b[k+9],4,-640364487),p=f(p,m,n,o,b[k+12],11,-421815835),o=f(o,p,m,n,b[k+15],16,530742520),n=f(n,o,p,m,b[k+2],23,-995338651),m=g(m,n,o,p,b[k+0],6,-198630844),p=g(p,m,n,o,b[k+7],10,1126891415),o=g(o,p,m,n,b[k+14],15,-1416354905),n=g(n,o,p,m,b[k+5],21,-57434055),m=g(m,n,o,p,b[k+12],6,1700485571),p=g(p,m,n,o,b[k+3],10,-1894986606),o=g(o,p,m,n,b[k+10],15,-1051523),n=g(n,o,p,m,b[k+1],21,-2054922799),m=g(m,n,o,p,b[k+8],6,1873313359),p=g(p,m,n,o,b[k+15],10,-30611744),o=g(o,p,m,n,b[k+6],15,-1560198380),n=g(n,o,p,m,b[k+13],21,1309151649),m=g(m,n,o,p,b[k+4],6,-145523070),p=g(p,m,n,o,b[k+11],10,-1120210379),o=g(o,p,m,n,b[k+2],15,718787259),n=g(n,o,p,m,b[k+9],21,-343485551),m=a(m,c),n=a(n,h),o=a(o,i),p=a(p,j);return[m,n,o,p]},i=function(a){var b,c="0123456789abcdef",d="",e=4*a.length;for(b=0;e>b;b++)d+=c.charAt(a[b>>2]>>b%4*8+4&15)+c.charAt(a[b>>2]>>b%4*8&15);return d},j=function(a){var b,c,d=(a.length+8>>6)+1,e=[],f=16*d,g=a.length;for(b=0;f>b;b++)e.push(0);for(c=0;g>c;c++)e[c>>2]|=(255&a.charCodeAt(c))<>2]|=128< 0 && $modified_time > $obj[0]) { - $this->delete($_key); + $this->delete($key); return false; } @@ -110,7 +110,7 @@ class CacheApc extends CacheBase if($modified_time > 0 && $modified_time > $obj[0]) { - $this->delete($_key); + $this->delete($key); return false; } @@ -125,7 +125,8 @@ class CacheApc extends CacheBase */ function delete($key) { - return apc_delete($key); + $_key = md5(_XE_PATH_ . $key); + return apc_delete($_key); } /** diff --git a/classes/display/DisplayHandler.class.php b/classes/display/DisplayHandler.class.php index 5e9173548..a0559455e 100644 --- a/classes/display/DisplayHandler.class.php +++ b/classes/display/DisplayHandler.class.php @@ -164,12 +164,13 @@ class DisplayHandler extends Handler array( 'Request / Response info >>> ' . $_SERVER['REQUEST_METHOD'] . ' / ' . Context::getResponseMethod(), array( - array('Request URI', 'Request method', 'Response method', 'Response contents size'), + array('Request URI', 'Request method', 'Response method', 'Response contents size', 'Memory peak usage'), array( sprintf("%s:%s%s%s%s", $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], $_SERVER['PHP_SELF'], $_SERVER['QUERY_STRING'] ? '?' : '', $_SERVER['QUERY_STRING']), $_SERVER['REQUEST_METHOD'], Context::getResponseMethod(), - $this->content_size . ' byte' + $this->content_size . ' byte', + FileHandler::filesize(memory_get_peak_usage()) ) ) ), diff --git a/classes/display/HTMLDisplayHandler.php b/classes/display/HTMLDisplayHandler.php index 54e02568a..cc1a5de96 100644 --- a/classes/display/HTMLDisplayHandler.php +++ b/classes/display/HTMLDisplayHandler.php @@ -63,7 +63,7 @@ class HTMLDisplayHandler // add .x div for adminitration pages if(Context::getResponseMethod() == 'HTML') { - if(Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') > 0) + if(Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') > 0 && Context::get('act') != 'dispPageAdminContentModify' && Context::get('act') != 'dispPageAdminMobileContentModify') { $output = '
' . $output . '
'; } @@ -174,7 +174,7 @@ class HTMLDisplayHandler $output = preg_replace_callback('!!is', array($this, '_moveMetaToHeader'), $output); // change a meta fine(widget often put the tag like to the content because of caching) - $output = preg_replace_callback('//is', array($this, '_transMeta'), $output); + $output = preg_replace_callback('//is', array($this, '_transMeta'), $output); // handles a relative path generated by using the rewrite module if(Context::isAllowRewrite()) diff --git a/classes/extravar/Extravar.class.php b/classes/extravar/Extravar.class.php index e56cc1517..2ad6a69ac 100644 --- a/classes/extravar/Extravar.class.php +++ b/classes/extravar/Extravar.class.php @@ -263,10 +263,6 @@ class ExtraItem { $values = explode('|@|', $value); } - elseif(strpos($value, ',') !== false) - { - $values = explode(',', $value); - } else { $values = array($value); @@ -462,6 +458,8 @@ class ExtraItem } if($this->desc) { + $oModuleController = getController('module'); + $oModuleController->replaceDefinedLangCode($this->desc); $buff[] = '

' . htmlspecialchars($this->desc, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '

'; } diff --git a/classes/httprequest/XEHttpRequest.class.php b/classes/httprequest/XEHttpRequest.class.php index 02ed6b8a3..538956561 100644 --- a/classes/httprequest/XEHttpRequest.class.php +++ b/classes/httprequest/XEHttpRequest.class.php @@ -163,7 +163,7 @@ class XEHttpRequest $chunk_size = hexdec(fgets($sock)); if($chunk_size) { - $body .= fread($sock, $chunk_size); + $body .= fgets($sock, $chunk_size+1); } } else diff --git a/common/css/xe.css b/common/css/xe.css index c8c330fa6..cdddb3605 100644 --- a/common/css/xe.css +++ b/common/css/xe.css @@ -45,6 +45,10 @@ a img { } } +.xe-widget-wrapper { + overflow: hidden; +} + /* Popup Menu Area */ #popup_menu_area { position: absolute; diff --git a/config/config.inc.php b/config/config.inc.php index fc4bcaeba..51f01d863 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -29,7 +29,7 @@ define('__ZBXE__', __XE__); /** * Display XE's full version. */ -define('__XE_VERSION__', '1.7.4'); +define('__XE_VERSION__', '1.7.5-beta1'); /** * @deprecated __ZBXE_VERSION__ will be removed. Use __XE_VERSION__ instead. diff --git a/config/func.inc.php b/config/func.inc.php index a2c4c4d07..6de5b1df7 100644 --- a/config/func.inc.php +++ b/config/func.inc.php @@ -776,7 +776,7 @@ function debugPrint($debug_output = NULL, $display_option = TRUE, $file = '_debu } $type = FirePHP::INFO; - $label = sprintf('[%s:%d] %s() (m:%s)', $file_name, $line_num, $function, FileHandler::filesize(memory_get_usage())); + $label = sprintf('[%s:%d] %s() (Memory usage: current=%s, peak=%s)', $file_name, $line_num, $function, FileHandler::filesize(memory_get_usage()), FileHandler::filesize(memory_get_peak_usage())); // Check a FirePHP option if($display_option === 'TABLE') diff --git a/modules/admin/admin.admin.model.php b/modules/admin/admin.admin.model.php index d0c69a80d..1c863da8a 100644 --- a/modules/admin/admin.admin.model.php +++ b/modules/admin/admin.admin.model.php @@ -95,6 +95,81 @@ class adminAdminModel extends admin } } + function getFTPPath() + { + $ftp_info = Context::getRequestVars(); + + if(!$ftp_info->ftp_host) + { + $ftp_info->ftp_host = "127.0.0.1"; + } + + if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port)) + { + $ftp_info->ftp_port = '22'; + } + + $connection = ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port); + if(!$connection) + { + return new Object(-1, sprintf(Context::getLang('msg_ftp_not_connected'), $ftp_host)); + } + + $login_result = @ftp_login($connection, $ftp_info->ftp_user, $ftp_info->ftp_password); + if(!$login_result) + { + ftp_close($connection); + return new Object(-1, 'msg_ftp_invalid_auth_info'); + } + + // create temp file + $pin = $_SERVER['REQUEST_TIME']; + FileHandler::writeFile('./files/cache/ftp_check', $pin); + + // create path candidate + $xe_path = _XE_PATH_; + $path_info = array_reverse(explode('/', _XE_PATH_)); + array_pop($path_info); // remove last '/' + $path_candidate = array(); + + $temp = ''; + foreach($path_info as $path) + { + $temp = '/' . $path . $temp; + $path_candidate[] = $temp; + } + + // try + foreach($path_candidate as $path) + { + // upload check file + if(!ftp_put($connection, $path . 'ftp_check.html', FileHandler::getRealPath('./files/cache/ftp_check'), FTP_BINARY)) + { + continue; + } + + // get check file + $result = FileHandler::getRemoteResource(getNotencodedFullUrl() . 'ftp_check.html'); + + // delete temp check file + ftp_delete($connection, $path . 'ftp_check.html'); + + // found + if($result == $pin) + { + $found_path = $path; + break; + } + } + + FileHandler::removeFile('./files/cache/ftp_check', $pin); + + if($found_path) + { + $this->add('found_path', $found_path); + } + } + /** * Find XE installed path on ftp */ @@ -130,6 +205,15 @@ class adminAdminModel extends admin return $this->getSFTPPath(); } + if($ftp_info->ftp_pasv == 'N') + { + if(function_exists('ftp_connect')) + { + return $this->getFTPPath(); + } + $ftp_info->ftp_pasv = "Y"; + } + $oFTP = new ftp(); if(!$oFTP->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port)) { diff --git a/modules/board/conf/info.xml b/modules/board/conf/info.xml index 36eb8d8cd..ecc2e53a2 100644 --- a/modules/board/conf/info.xml +++ b/modules/board/conf/info.xml @@ -18,8 +18,8 @@ Модуль для функционирования форума. Также включает в себя функции администратора такие как создание/управление форумами. 提供用戶相對應的討論板功能,包含建立/新增及管理等功能。 Pano yapılandırmaları için kullanılan modüldür. Ayrıca oluşturma/yönetme gibi yönetici özellikleri de içerir. - 1.7.2-beta.3 - 2014-01-09 + 1.7.2 + 2014-03-20 service diff --git a/modules/comment/comment.admin.controller.php b/modules/comment/comment.admin.controller.php index 7f6737132..019c6b52a 100644 --- a/modules/comment/comment.admin.controller.php +++ b/modules/comment/comment.admin.controller.php @@ -340,6 +340,35 @@ class commentAdminController extends comment } } + /** + * @fn procCommentAdminMoveToTrash + * @brief move a comment to trash + * @see commentModel::getCommentMenu + */ + function procCommentAdminMoveToTrash() + { + $oDB = DB::getInstance(); + $oDB->begin(); + + $comment_srl = Context::get('comment_srl'); + $oCommentModel = getModel('comment'); + $oCommentController = getController('comment'); + $oComment = $oCommentModel->getComment($comment_srl, false); + + if(!$oComment->isGranted()) return $this->stop('msg_not_permitted'); + + $message_content = ""; + $this->_moveCommentToTrash(array($comment_srl), $oCommentController, $oDB, $message_content); + + $isTrash = true; + $output = $oCommentController->deleteComment($comment_srl, TRUE, $isTrash); + + $oDB->commit(); + + $returnUrl = Context::get('cur_url'); + $this->add('redirect_url', $returnUrl); + } + /** * Cancel the blacklist of abused comments reported by other users * @return void|object diff --git a/modules/comment/comment.admin.view.php b/modules/comment/comment.admin.view.php index 989007633..3cb165997 100644 --- a/modules/comment/comment.admin.view.php +++ b/modules/comment/comment.admin.view.php @@ -52,7 +52,7 @@ class commentAdminView extends comment // get a list by using comment->getCommentList. $oCommentModel = getModel('comment'); $secretNameList = $oCommentModel->getSecretNameList(); - $columnList = array('comment_srl', 'document_srl', 'is_secret', 'status', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress', 'voted_count', 'blamed_count'); + $columnList = array('comment_srl', 'document_srl','module_srl','is_secret', 'status', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress', 'voted_count', 'blamed_count'); $output = $oCommentModel->getTotalCommentList($args, $columnList); // $modules = $oCommentModel->getDistinctModules(); @@ -66,6 +66,31 @@ class commentAdminView extends comment // Context::set('modules_list', $modules_list); Context::set('page_navigation', $output->page_navigation); Context::set('secret_name_list', $secretNameList); + + $oModuleModel = getModel('module'); + $module_list = array(); + $mod_srls = array(); + foreach($output->data as $val) + { + $mod_srls[] = $val->module_srl; + } + $mod_srls = array_unique($mod_srls); + // Module List + $mod_srls_count = count($mod_srls); + if($mod_srls_count) + { + $columnList = array('module_srl', 'mid', 'browser_title'); + $module_output = $oModuleModel->getModulesInfo($mod_srls, $columnList); + if($module_output && is_array($module_output)) + { + foreach($module_output as $module) + { + $module_list[$module->module_srl] = $module; + } + } + } + Context::set('module_list', $module_list); + // set the template $this->setTemplatePath($this->module_path . 'tpl'); $this->setTemplateFile('comment_list'); diff --git a/modules/comment/comment.controller.php b/modules/comment/comment.controller.php index 18e86394c..e1021c0af 100644 --- a/modules/comment/comment.controller.php +++ b/modules/comment/comment.controller.php @@ -266,9 +266,13 @@ class commentController extends comment return new Object(-1, 'msg_invalid_request'); } - if($obj->homepage && !preg_match('/^[a-z]+:\/\//i', $obj->homepage)) + if($obj->homepage) { - $obj->homepage = 'http://' . $obj->homepage; + $obj->homepage = removeHackTag($obj->homepage); + if(!preg_match('/^[a-z]+:\/\//i',$obj->homepage)) + { + $obj->homepage = 'http://'.$obj->homepage; + } } // input the member's information if logged-in @@ -655,9 +659,13 @@ class commentController extends comment $obj->password = md5($obj->password); } - if($obj->homepage && !preg_match('/^[a-z]+:\/\//i', $obj->homepage)) + if($obj->homepage) { - $obj->homepage = 'http://' . $obj->homepage; + $obj->homepage = removeHackTag($obj->homepage); + if(!preg_match('/^[a-z]+:\/\//i',$obj->homepage)) + { + $obj->homepage = 'http://'.$obj->homepage; + } } // set modifier's information if logged-in and posting author and modifier are matched. @@ -835,18 +843,27 @@ class commentController extends comment // call a trigger (after) if($output->toBool()) { + $comment->isMoveToTrash = $isMoveToTrash; $trigger_output = ModuleHandler::triggerCall('comment.deleteComment', 'after', $comment); if(!$trigger_output->toBool()) { $oDB->rollback(); return $trigger_output; } + unset($comment->isMoveToTrash); } if(!$isMoveToTrash) { $this->_deleteDeclaredComments($args); $this->_deleteVotedComments($args); + } + else + { + $args = new stdClass(); + $args->upload_target_srl = $comment_srl; + $args->isvalid = 'N'; + $output = executeQuery('file.updateFileValid', $args); } // commit diff --git a/modules/comment/comment.model.php b/modules/comment/comment.model.php index 9d5439a13..3dbb57a1a 100644 --- a/modules/comment/comment.model.php +++ b/modules/comment/comment.model.php @@ -76,6 +76,13 @@ class commentModel extends comment // call a trigger (after) ModuleHandler::triggerCall('comment.getCommentMenu', 'after', $menu_list); + if($this->grant->manager){ + $str_confirm = Context::getLang('confirm_move'); + $url = sprintf("if(!confirm('%s')) return; var params = new Array(); params['comment_srl']='%s'; params['mid']=current_mid;params['cur_url']=current_url; exec_xml('comment', 'procCommentAdminMoveToTrash', params)", $str_confirm, $comment_srl); + $oCommentController->addCommentPopupMenu($url,'cmd_trash','','javascript'); + + } + // find a comment by IP matching if an administrator. if($logged_info->is_admin == 'Y') { diff --git a/modules/comment/conf/module.xml b/modules/comment/conf/module.xml index 83f3e2073..960344c37 100644 --- a/modules/comment/conf/module.xml +++ b/modules/comment/conf/module.xml @@ -4,6 +4,7 @@ + @@ -21,6 +22,7 @@ + diff --git a/modules/comment/tpl/comment_list.html b/modules/comment/tpl/comment_list.html index a4f837619..40f8be128 100644 --- a/modules/comment/tpl/comment_list.html +++ b/modules/comment/tpl/comment_list.html @@ -47,7 +47,12 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}'; {@ $comment = $val->getContentText(200)} - {$comment}{$lang->no_text_comment} + + + {$module_list[$val->module_srl]->browser_title} - + + {$comment}{$lang->no_text_comment} + {$val->getNickName()} {number_format($val->get('voted_count'))}/{number_format($val->get('blamed_count'))} {(zdate($val->regdate,"Y-m-d\nH:i:s"))} diff --git a/modules/document/document.admin.view.php b/modules/document/document.admin.view.php index 2397f2eb1..98547a8e6 100644 --- a/modules/document/document.admin.view.php +++ b/modules/document/document.admin.view.php @@ -50,7 +50,7 @@ class documentAdminView extends document // get a list $oDocumentModel = getModel('document'); - $columnList = array('document_srl', 'title', 'member_srl', 'nick_name', 'readed_count', 'voted_count', 'blamed_count', 'regdate', 'ipaddress', 'status'); + $columnList = array('document_srl', 'module_srl', 'title', 'member_srl', 'nick_name', 'readed_count', 'voted_count', 'blamed_count', 'regdate', 'ipaddress', 'status'); $output = $oDocumentModel->getDocumentList($args, false, true, $columnList); // get Status name list @@ -72,6 +72,30 @@ class documentAdminView extends document } Context::set('search_option', $search_option); + $oModuleModel = getModel('module'); + $module_list = array(); + $mod_srls = array(); + foreach($output->data as $oDocument) + { + $mod_srls[] = $oDocument->get('module_srl'); + } + $mod_srls = array_unique($mod_srls); + // Module List + $mod_srls_count = count($mod_srls); + if($mod_srls_count) + { + $columnList = array('module_srl', 'mid', 'browser_title'); + $module_output = $oModuleModel->getModulesInfo($mod_srls, $columnList); + if($module_output && is_array($module_output)) + { + foreach($module_output as $module) + { + $module_list[$module->module_srl] = $module; + } + } + } + Context::set('module_list', $module_list); + // Specify a template $this->setTemplatePath($this->module_path.'tpl'); $this->setTemplateFile('document_list'); diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php index 7e3f9e74a..6029c7fcf 100644 --- a/modules/document/document.controller.php +++ b/modules/document/document.controller.php @@ -398,7 +398,15 @@ class documentController extends document if(!$obj->commentStatus) $obj->commentStatus = 'DENY'; if($obj->commentStatus == 'DENY') $this->_checkCommentStatusForOldVersion($obj); if($obj->allow_trackback!='Y') $obj->allow_trackback = 'N'; - if($obj->homepage && !preg_match('/^[a-z]+:\/\//i',$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage; + if($obj->homepage) + { + $obj->homepage = removeHackTag($obj->homepage); + if(!preg_match('/^[a-z]+:\/\//i',$obj->homepage)) + { + $obj->homepage = 'http://'.$obj->homepage; + } + } + if($obj->notify_message != 'Y') $obj->notify_message = 'N'; // can modify regdate only manager @@ -810,9 +818,10 @@ class documentController extends document $document_srl = $oDocument->document_srl; $member_srl = $oDocument->get('member_srl'); $logged_info = Context::get('logged_info'); - // Call a trigger when the read count is updated (after) - $output = ModuleHandler::triggerCall('document.updateReadedCount', 'after', $oDocument); - if(!$output->toBool()) return $output; + + // Call a trigger when the read count is updated (before) + $trigger_output = ModuleHandler::triggerCall('document.updateReadedCount', 'before', $oDocument); + if(!$trigger_output->toBool()) return $trigger_output; // Pass if read count is increaded on the session information if($_SESSION['readed_document'][$document_srl]) return false; @@ -829,11 +838,25 @@ class documentController extends document $_SESSION['readed_document'][$document_srl] = true; return false; } + + $oDB = DB::getInstance(); + $oDB->begin(); + // Update read counts $args = new stdClass; $args->document_srl = $document_srl; $output = executeQuery('document.updateReadedCount', $args); + // Call a trigger when the read count is updated (after) + $outptrigger_outputut = ModuleHandler::triggerCall('document.updateReadedCount', 'after', $oDocument); + if(!$trigger_output->toBool()) + { + $oDB->rollback(); + return $trigger_output; + } + + $oDB->commit(); + $oCacheHandler = CacheHandler::getInstance('object'); if($oCacheHandler->isSupport()) { diff --git a/modules/document/document.item.php b/modules/document/document.item.php index ed1a913a6..379931909 100644 --- a/modules/document/document.item.php +++ b/modules/document/document.item.php @@ -141,9 +141,8 @@ class documentItem extends Object $oDocumentModel = getModel('document'); if($load_extra_vars) { - $oDocumentModel->getDocumentExtraVarsFromDB($this->document_srl); - $this->add('title', $this->get('title')); - $this->add('content', $this->get('content')); + $GLOBALS['XE_DOCUMENT_LIST'][$attribute->document_srl] = $this; + $oDocumentModel->setToAllDocumentExtraVars(); } $GLOBALS['XE_DOCUMENT_LIST'][$this->document_srl] = $this; } diff --git a/modules/document/document.model.php b/modules/document/document.model.php index b379c1202..8723577cd 100644 --- a/modules/document/document.model.php +++ b/modules/document/document.model.php @@ -520,6 +520,13 @@ class documentModel extends document $oDocumentController->addDocumentPopupMenu($url,'cmd_print','','printDocument'); // Call a trigger (after) ModuleHandler::triggerCall('document.getDocumentMenu', 'after', $menu_list); + if($this->grant->manager) + { + $str_confirm = Context::getLang('confirm_move'); + $url = sprintf("if(!confirm('%s')) return; var params = new Array(); params['document_srl']='%s'; params['mid']=current_mid;params['cur_url']=current_url; exec_xml('document', 'procDocumentAdminMoveToTrash', params)", $str_confirm, $document_srl); + $oDocumentController->addDocumentPopupMenu($url,'cmd_trash','','javascript'); + } + // If you are managing to find posts by ip if($logged_info->is_admin == 'Y') { @@ -528,10 +535,6 @@ class documentModel extends document if($oDocument->isExists()) { - $str_confirm = Context::getLang('cmd_document_do') . Context::getLang('confirm_delete'); - $url = sprintf("if(!confirm('%s')) return; var params = new Array(); params['document_srl']='%s'; params['mid']=current_mid;params['cur_url']=current_url; exec_xml('document', 'procDocumentAdminMoveToTrash', params)", $str_confirm, $document_srl); - $oDocumentController->addDocumentPopupMenu($url,'cmd_trash','','javascript'); - // Find a post equivalent to ip address $url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','ipaddress','search_keyword',$oDocument->getIpAddress()); $oDocumentController->addDocumentPopupMenu($url,'cmd_search_by_ipaddress',$icon_path,'TraceByIpaddress'); diff --git a/modules/document/tpl/document_list.html b/modules/document/tpl/document_list.html index ba533796d..d9eca400e 100644 --- a/modules/document/tpl/document_list.html +++ b/modules/document/tpl/document_list.html @@ -48,7 +48,11 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}'; - {htmlspecialchars($oDocument->getTitleText())}{$lang->no_title_document} + + + {$module_list[$oDocument->get('module_srl')]->browser_title} - + + {htmlspecialchars($oDocument->getTitleText())}{$lang->no_title_document} {$oDocument->getNickName()} {$oDocument->get('readed_count')} {$oDocument->get('voted_count')}/{$oDocument->get('blamed_count')} diff --git a/modules/file/file.admin.controller.php b/modules/file/file.admin.controller.php index a3f460489..6f8dfe2cd 100644 --- a/modules/file/file.admin.controller.php +++ b/modules/file/file.admin.controller.php @@ -122,6 +122,7 @@ class fileAdminController extends file $download_grant = Context::get('download_grant'); + $file_config = new stdClass; $file_config->allow_outlink = Context::get('allow_outlink'); $file_config->allow_outlink_format = Context::get('allow_outlink_format'); $file_config->allow_outlink_site = Context::get('allow_outlink_site'); diff --git a/modules/file/file.controller.php b/modules/file/file.controller.php index 1fc017e6b..6c27cea0f 100644 --- a/modules/file/file.controller.php +++ b/modules/file/file.controller.php @@ -518,6 +518,8 @@ class fileController extends file $comment_srl = $obj->comment_srl; if(!$comment_srl) return new Object(); + if($obj->isMoveToTrash) return new Object(); + $output = $this->deleteFiles($comment_srl); return $output; } diff --git a/modules/importer/importer.admin.controller.php b/modules/importer/importer.admin.controller.php index f0af11460..e99773ad4 100644 --- a/modules/importer/importer.admin.controller.php +++ b/modules/importer/importer.admin.controller.php @@ -1009,6 +1009,7 @@ class importerAdminController extends importer $started = false; $buff = null; + $file_obj = new stdClass; while(!feof($fp)) { $str = trim(fgets($fp, 1024)); @@ -1017,7 +1018,6 @@ class importerAdminController extends importer // If it starts with , collect attachments if(trim($str) == '') { - $file_obj = new stdClass; $file_obj->file_srl = getNextSequence(); $file_obj->upload_target_srl = $upload_target_srl; $file_obj->module_srl = $module_srl; diff --git a/modules/integration_search/tpl/skin_info.html b/modules/integration_search/tpl/skin_info.html index 0c42468be..855292c46 100644 --- a/modules/integration_search/tpl/skin_info.html +++ b/modules/integration_search/tpl/skin_info.html @@ -1,13 +1,13 @@ -
+

{$XE_VALIDATOR_MESSAGE}

- +

{$lang->skin_default_info}

diff --git a/modules/layout/layout.admin.controller.php b/modules/layout/layout.admin.controller.php index c935fec20..459a2085b 100644 --- a/modules/layout/layout.admin.controller.php +++ b/modules/layout/layout.admin.controller.php @@ -262,15 +262,8 @@ class layoutAdminController extends layout $oLayoutModel = getModel('layout'); $cache_file = $oLayoutModel->getUserLayoutCache($args->layout_srl, Context::getLangType()); FileHandler::removeFile($cache_file); - //remove from cache - $oCacheHandler = CacheHandler::getInstance('object', null, true); - if($oCacheHandler->isSupport()) - { - $object_key = 'layout:' . $args->layout_srl; - $cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key); - $oCacheHandler->delete($cache_key); - } } + return $output; } @@ -336,14 +329,7 @@ class layoutAdminController extends layout $args = new stdClass(); $args->layout_srl = $layout_srl; $output = executeQuery("layout.deleteLayout", $args); - //remove from cache - $oCacheHandler = CacheHandler::getInstance('object', null, true); - if($oCacheHandler->isSupport()) - { - $object_key = 'layout:'.$layout_srl; - $cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key); - $oCacheHandler->delete($cache_key); - } + if(!$output->toBool()) return $output; return new Object(0,'success_deleted'); diff --git a/modules/layout/layout.class.php b/modules/layout/layout.class.php index 1c6b06d72..9a8d75c34 100644 --- a/modules/layout/layout.class.php +++ b/modules/layout/layout.class.php @@ -86,8 +86,6 @@ class layout extends ModuleObject $oDB->addColumn('layouts','layout_type','char',1,'P',true); } - $oCacheHandler = CacheHandler::getInstance('object', null, true); - $args->layout = '.'; $output = executeQueryArray('layout.getLayoutDotList', $args); if($output->data && count($output->data) > 0) @@ -101,13 +99,6 @@ class layout extends ModuleObject $args->layout = implode('|@|', $layout_path); $args->layout_srl = $layout->layout_srl; $output = executeQuery('layout.updateLayout', $args); - - if($oCacheHandler->isSupport()) - { - $object_key = 'layout:' . $args->layout_srl; - $cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key); - $oCacheHandler->delete($cache_key); - } } } } diff --git a/modules/layout/layout.model.php b/modules/layout/layout.model.php index 85e38441a..d402b9c0e 100644 --- a/modules/layout/layout.model.php +++ b/modules/layout/layout.model.php @@ -258,31 +258,15 @@ class layoutModel extends layout */ function getLayout($layout_srl) { - $layout_info = false; + // Get information from the DB + $args = new stdClass(); + $args->layout_srl = $layout_srl; + $output = executeQuery('layout.getLayout', $args); + if(!$output->data) return; - // cache controll - $oCacheHandler = CacheHandler::getInstance('object', null, true); - if($oCacheHandler->isSupport()) - { - $object_key = 'layout:' . $layout_srl; - $cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key); - $layout_info = $oCacheHandler->get($cache_key); - } + // Return xml file informaton after listing up the layout and extra_vars + $layout_info = $this->getLayoutInfo($layout, $output->data, $output->data->layout_type); - if($layout_info === false) - { - // Get information from the DB - $args = new stdClass(); - $args->layout_srl = $layout_srl; - $output = executeQuery('layout.getLayout', $args); - if(!$output->data) return; - - // Return xml file informaton after listing up the layout and extra_vars - $layout_info = $this->getLayoutInfo($layout, $output->data, $output->data->layout_type); - - //insert in cache - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $layout_info); - } return $layout_info; } diff --git a/modules/member/m.skins/default/find_member_account.html b/modules/member/m.skins/default/find_member_account.html index 517d11bd0..c8e22f827 100644 --- a/modules/member/m.skins/default/find_member_account.html +++ b/modules/member/m.skins/default/find_member_account.html @@ -51,7 +51,7 @@
  • diff --git a/modules/member/member.controller.php b/modules/member/member.controller.php index eaefc60fd..68cc2bc81 100644 --- a/modules/member/member.controller.php +++ b/modules/member/member.controller.php @@ -230,7 +230,8 @@ class memberController extends member } // Check if duplicated $member_srl = $oMemberModel->getMemberSrlByNickName($value); - if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name'); + $member_srl_by_decode = $oMemberModel->getMemberSrlByNickName(utf8_decode($value)); + if(($member_srl && $logged_info->member_srl != $member_srl ) || ($member_srl_by_decode && $logged_info->member_srl != $member_srl_by_decode )) return new Object(0,'msg_exists_nick_name'); break; case 'email_address' : @@ -1957,7 +1958,8 @@ class memberController extends member return new Object(-1,'denied_nick_name'); } $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); - if($member_srl) return new Object(-1,'msg_exists_nick_name'); + $member_srl_by_decode = $oMemberModel->getMemberSrlByNickName(utf8_decode($args->nick_name)); + if($member_srl || $member_srl_by_decode) return new Object(-1,'msg_exists_nick_name'); $member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address); if($member_srl) return new Object(-1,'msg_exists_email_address'); @@ -2113,6 +2115,10 @@ class memberController extends member { return new Object(-1, 'denied_nick_name'); } + + $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); + $member_srl_by_decode = $oMemberModel->getMemberSrlByNickName(utf8_decode($args->nick_name)); + if(($member_srl || $member_srl_by_decode) && $orgMemberInfo->nick_name != $args->nick_name) return new Object(-1,'msg_exists_nick_name'); list($args->email_id, $args->email_host) = explode('@', $args->email_address); // Website, blog, checks the address diff --git a/modules/member/skins/default/find_member_account.html b/modules/member/skins/default/find_member_account.html index b80312c3b..1b7cf67e2 100644 --- a/modules/member/skins/default/find_member_account.html +++ b/modules/member/skins/default/find_member_account.html @@ -6,7 +6,7 @@

    {$XE_VALIDATOR_MESSAGE}

    - + diff --git a/modules/module/module.model.php b/modules/module/module.model.php index f2c42543e..dc551bad5 100644 --- a/modules/module/module.model.php +++ b/modules/module/module.model.php @@ -402,6 +402,9 @@ class moduleModel extends module } else $module_info = $mid_info; + $oModuleController = getController('module'); + if(isset($module_info->browser_title)) $oModuleController->replaceDefinedLangCode($module_info->browser_title); + return $this->addModuleExtraVars($module_info); } @@ -782,6 +785,7 @@ class moduleModel extends module if(!$module_info->category) $module_info->category = 'service'; sscanf($xml_obj->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d); $module_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d); + $author_obj = new stdClass(); $author_obj->name = $xml_obj->author->name->body; $author_obj->email_address = $xml_obj->author->attrs->email_address; $author_obj->homepage = $xml_obj->author->attrs->link; @@ -1498,6 +1502,7 @@ class moduleModel extends module $info = $this->getModuleInfoXml($module_name); unset($obj); + if(!isset($info)) continue; $info->module = $module_name; $info->created_table_count = $created_table_count; $info->table_count = $table_count; diff --git a/modules/page/tpl/js/page_admin.js b/modules/page/tpl/js/page_admin.js index 122544b66..218c14107 100644 --- a/modules/page/tpl/js/page_admin.js +++ b/modules/page/tpl/js/page_admin.js @@ -6,117 +6,117 @@ /* 모듈 생성 후 */ function completeInsertPage(ret_obj) { - var error = ret_obj['error']; - var message = ret_obj['message']; + var error = ret_obj['error']; + var message = ret_obj['message']; - var page = ret_obj['page']; - var module_srl = ret_obj['module_srl']; + var page = ret_obj['page']; + var module_srl = ret_obj['module_srl']; - alert(message); + alert(message); - var url = ''; - if(location.href.getQuery('module')=='admin') { - url = current_url.setQuery('module_srl',module_srl).setQuery('act','dispPageAdminInfo'); - if(page) url = url.setQuery('page',page); - } else { - url = current_url; - } + var url = ''; + if(location.href.getQuery('module')=='admin') { + url = current_url.setQuery('module_srl',module_srl).setQuery('act','dispPageAdminInfo'); + if(page) url = url.setQuery('page',page); + } else { + url = current_url; + } - location.href = url; + location.href = url; } function completeArticleDocumentInserted(ret_obj){ - var error = ret_obj['error']; - var message = ret_obj['message']; + var error = ret_obj['error']; + var message = ret_obj['message']; - var mid = ret_obj['mid']; + var mid = ret_obj['mid']; var is_mobile = ret_obj['is_mobile']; - alert(message); + alert(message); - var url = ''; + var url = ''; if(is_mobile == 'Y') - url = current_url.setQuery('act', 'dispPageAdminMobileContent').setQuery('mid', mid); + url = current_url.setQuery('act', 'dispPageAdminMobileContent').setQuery('mid', mid); else - url = current_url.setQuery('act', 'dispPageIndex').setQuery('mid', mid); + url = current_url.setQuery('act', 'dispPageIndex').setQuery('mid', mid); - location.href = url; + location.href = url; } /* 내용 저장 후 */ function completeInsertPageContent(ret_obj) { - var error = ret_obj['error']; - var message = ret_obj['message']; + var error = ret_obj['error']; + var message = ret_obj['message']; - var page = ret_obj['page']; - var module_srl = ret_obj['module_srl']; - var mid = ret_obj['mid']; + var page = ret_obj['page']; + var module_srl = ret_obj['module_srl']; + var mid = ret_obj['mid']; - location.href = current_url.setQuery('mid',mid).setQuery('act',''); + location.href = current_url.setQuery('mid',mid).setQuery('act',''); } function completeInsertMobilePageContent(ret_obj) { - var error = ret_obj['error']; - var message = ret_obj['message']; + var error = ret_obj['error']; + var message = ret_obj['message']; - var page = ret_obj['page']; - var module_srl = ret_obj['module_srl']; - var mid = ret_obj['mid']; + var page = ret_obj['page']; + var module_srl = ret_obj['module_srl']; + var mid = ret_obj['mid']; - location.href = current_url.setQuery('mid',mid).setQuery('act','dispPageAdminMobileContent'); + location.href = current_url.setQuery('mid',mid).setQuery('act','dispPageAdminMobileContent'); } /* 수정한 페이지 컨텐츠를 저장 */ function doSubmitPageContent(fo_obj) { - var html = getWidgetContent(); - fo_obj.content.value = html; - return procFilter(fo_obj, insert_page_content); + var html = getWidgetContent(); + fo_obj.content.value = html; + return procFilter(fo_obj, insert_page_content); } function doSubmitMPageContent(fo_obj) { - var html = getWidgetContent(); - fo_obj.content.value = html; - return procFilter(fo_obj, insert_mpage_content); + var html = getWidgetContent(); + fo_obj.content.value = html; + return procFilter(fo_obj, insert_mpage_content); } /* 모듈 삭제 후 */ function completeDeletePage(ret_obj) { - var error = ret_obj['error']; - var message = ret_obj['message']; - var page = ret_obj['page']; - alert(message); + var error = ret_obj['error']; + var message = ret_obj['message']; + var page = ret_obj['page']; + alert(message); - var url = current_url.setQuery('act','dispPageAdminContent').setQuery('module_srl',''); - if(page) url = url.setQuery('page',page); + var url = current_url.setQuery('act','dispPageAdminContent').setQuery('module_srl',''); + if(page) url = url.setQuery('page',page); - location.href = url; + location.href = url; } /* 위젯 재컴파일 */ function doRemoveWidgetCache(module_srl) { - var params = new Array(); - params["module_srl"] = module_srl; - exec_xml('page', 'procPageAdminRemoveWidgetCache', params, completeRemoveWidgetCache); + var params = new Array(); + params["module_srl"] = module_srl; + exec_xml('page', 'procPageAdminRemoveWidgetCache', params, completeRemoveWidgetCache); } function completeRemoveWidgetCache(ret_obj) { - var message = ret_obj['message']; - location.reload(); + var message = ret_obj['message']; + location.reload(); } /* 일괄 설정 */ function doCartSetup(url) { - var module_srl = new Array(); - jQuery('#fo_list input[name=cart]:checked').each(function() { - module_srl[module_srl.length] = jQuery(this).val(); - }); + var module_srl = new Array(); + jQuery('#fo_list input[name=cart]:checked').each(function() { + module_srl[module_srl.length] = jQuery(this).val(); + }); - if(module_srl.length<1) return; + if(module_srl.length<1) return; - url += "&module_srls="+module_srl.join(','); - popopen(url,'modulesSetup'); + url += "&module_srls="+module_srl.join(','); + popopen(url,'modulesSetup'); } jQuery(function($){ diff --git a/modules/poll/poll.model.php b/modules/poll/poll.model.php index fdc090ecb..174f6b0ae 100644 --- a/modules/poll/poll.model.php +++ b/modules/poll/poll.model.php @@ -111,7 +111,7 @@ class pollModel extends poll $poll->poll_count = (int)$output->data->poll_count; $poll->stop_date = $output->data->stop_date; - $columnList = array('poll_index_srl', 'checkcount', 'poll_count'); + $columnList = array('poll_index_srl', 'title', 'checkcount', 'poll_count'); $output = executeQuery('poll.getPollTitle', $args, $columnList); if(!$output->data) return; if(!is_array($output->data)) $output->data = array($output->data); diff --git a/modules/trash/model/TrashVO.php b/modules/trash/model/TrashVO.php index 98296387d..f7b62dbe7 100644 --- a/modules/trash/model/TrashVO.php +++ b/modules/trash/model/TrashVO.php @@ -6,6 +6,7 @@ class TrashVO var $title; var $originModule; var $serializedObject; + var $unserializedObject; var $description; var $ipaddress; var $removerSrl; @@ -47,6 +48,14 @@ class TrashVO { $this->serializedObject = $serializedObject; } + function getUnserializedObject() + { + return $this->unserializedObject; + } + function setUnserializedObject($serializedObject) + { + $this->unserializedObject = unserialize($serializedObject); + } function getDescription() { return htmlspecialchars($this->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); diff --git a/modules/trash/tpl/trash_list.html b/modules/trash/tpl/trash_list.html index add8cec8a..64393fdb1 100644 --- a/modules/trash/tpl/trash_list.html +++ b/modules/trash/tpl/trash_list.html @@ -41,7 +41,12 @@ var no_text_comment = '{$lang->no_text_comment}'; {$lang->no_text_comment} - {$oTrashVO->getTitle()} + + + {$module_list[$oTrashVO->unserializedObject['module_srl']]->browser_title} - + + {$oTrashVO->getTitle()} + {$lang->document}{$lang->comment} {$oTrashVO->getNickName()} diff --git a/modules/trash/trash.admin.view.php b/modules/trash/trash.admin.view.php index cb5d2b766..459a24bea 100644 --- a/modules/trash/trash.admin.view.php +++ b/modules/trash/trash.admin.view.php @@ -48,6 +48,31 @@ class trashAdminView extends trash Context::set('page', $output->page); Context::set('page_navigation', $output->page_navigation); + $oModuleModel = getModel('module'); + $module_list = array(); + $mod_srls = array(); + foreach($output->data as $oTrashVO) + { + $mod_srls[] = $oTrashVO->unserializedObject['module_srl']; + } + $mod_srls = array_unique($mod_srls); + // Module List + $mod_srls_count = count($mod_srls); + if($mod_srls_count) + { + $columnList = array('module_srl', 'mid', 'browser_title'); + $module_output = $oModuleModel->getModulesInfo($mod_srls, $columnList); + if($module_output && is_array($module_output)) + { + foreach($module_output as $module) + { + $module_list[$module->module_srl] = $module; + } + } + } + + Context::set('module_list', $module_list); + // 템플릿 파일 지정 $this->setTemplateFile('trash_list'); } diff --git a/modules/trash/trash.model.php b/modules/trash/trash.model.php index 9185d0e51..c56a59349 100644 --- a/modules/trash/trash.model.php +++ b/modules/trash/trash.model.php @@ -87,6 +87,7 @@ class trashModel extends trash $oTrashVO->setTitle($stdObject->title); $oTrashVO->setOriginModule($stdObject->origin_module); $oTrashVO->setSerializedObject($stdObject->serialized_object); + $oTrashVO->setUnserializedObject($stdObject->serialized_object); $oTrashVO->setDescription($stdObject->description); $oTrashVO->setIpaddress($stdObject->ipaddress); $oTrashVO->setRemoverSrl($stdObject->remover_srl); diff --git a/modules/widget/lang/lang.xml b/modules/widget/lang/lang.xml index c39fed217..af32dbce1 100644 --- a/modules/widget/lang/lang.xml +++ b/modules/widget/lang/lang.xml @@ -443,6 +443,17 @@ Sin la necesidad de utilizar los módulos de página o del diseño de XE, Usted + + + + + + + + + + + diff --git a/modules/widget/tpl/css/widget.css b/modules/widget/tpl/css/widget.css index 2fae1b591..5d4bf271b 100644 --- a/modules/widget/tpl/css/widget.css +++ b/modules/widget/tpl/css/widget.css @@ -127,6 +127,7 @@ height: 14px; border: 0; cursor: pointer; + vertical-align: middle; background: transparent url("../../../admin/tpl/img/glyphicons-halflings.png") no-repeat; } .widgetButtons .widgetSetup { diff --git a/modules/widget/tpl/js/generate_code.min.js b/modules/widget/tpl/js/generate_code.min.js index ab5c79efd..bae8882da 100644 --- a/modules/widget/tpl/js/generate_code.min.js +++ b/modules/widget/tpl/js/generate_code.min.js @@ -1 +1 @@ -function doDisplaySkinColorset(a){function b(b){for(var c=jQuery("select[name=colorset]").get(0),d=c.options.length,e=a,f=0;d>f;f++)c.remove(0);if(b.colorset_list){for(var g=b.colorset_list.split("\n"),h=0,f=0;f0||!i||0===h.indexOf("sizcache")||jQuery.inArray(h,g)>-1)){jQuery('').val(i).appendTo("#fo_widget").get(0)}}var j=[];jQuery("input,select,textarea","#fo_widget").each(function(){j.push(this)});for(var k=0;k0?n=l[0].type:m=0;var h=l.name;switch(n){case"hidden":case"text":case"textarea":var o=selected_node.getAttribute(h);if(!o)continue;var p=unescape(o);l.value=p?p:o,jQuery("#"+h).val(l.value);break;case"radio":case"checkbox":if(selected_node.getAttribute(h)){var o=selected_node.getAttribute(h).split(",");if(e[h].length){for(var q=0;q ",0===d)$(this).siblings("input").val(b[d].id);else{var e=$(this).siblings("input").val();$(this).siblings("input").val(e+","+b[d].id)}else if(b[d])if(c+=' ",0===d)$(this).siblings("input").val(b[d]);else{var e=$(this).siblings("input").val();$(this).siblings("input").val(e+","+b[d])}}else c=' ",$(this).siblings("input").val(b);$(this).before(c),$(".filebox_del").bind("click",function(){for(var a=$(this).prev("img").attr("src"),b=$(this).siblings("input").val().split(","),c="",d=0;df;f++)c.remove(0);if(b.colorset_list){for(var g=b.colorset_list.split("\n"),h=0,f=0;f0||!i||0===h.indexOf("sizcache")||jQuery.inArray(h,g)>-1)){jQuery('').val(i).appendTo("#fo_widget").get(0)}}var j=[];jQuery("input,select,textarea","#fo_widget").each(function(){j.push(this)});for(var k=0;k0?n=l[0].type:m=0;var h=l.name;switch(n){case"hidden":case"number":case"text":case"textarea":var o=selected_node.getAttribute(h);if(!o)continue;var p=unescape(o);l.value=p?p:o,jQuery("#"+h).val(l.value);break;case"radio":case"checkbox":if(selected_node.getAttribute(h)){var o=selected_node.getAttribute(h).split(",");if(e[h].length){for(var q=0;q ",0===d)$(this).siblings("input").val(b[d].id);else{var e=$(this).siblings("input").val();$(this).siblings("input").val(e+","+b[d].id)}else if(b[d])if(c+=' ",0===d)$(this).siblings("input").val(b[d]);else{var e=$(this).siblings("input").val();$(this).siblings("input").val(e+","+b[d])}}else c=' ",$(this).siblings("input").val(b);$(this).before(c),$(".filebox_del").bind("click",function(){for(var a=$(this).prev("img").attr("src"),b=$(this).siblings("input").val().split(","),c="",d=0;d 0) return; doHideWidgetSizeSetup(); - if(obj.className == 'widgetSetup' || obj.className == 'widgetStyle' || obj.className == 'widgetCopy' || obj.className == 'widgetBoxCopy' || obj.className == 'widgetSize' || obj.className == 'widgetBoxSize' || obj.className == 'widgetRemove' || obj.className == 'widgetBoxRemove') return; + if($obj.hasClass('widgetSetup') || $obj.hasClass('widgetStyle') || $obj.hasClass('widgetCopy') || $obj.hasClass('widgetBoxCopy') || $obj.hasClass('widgetSize') || $obj.hasClass('widgetBoxSize') || $obj.hasClass('widgetRemove') || $obj.hasClass('widgetBoxRemove')) return; p_obj = obj; + var $p_obj = jQuery(obj); while(p_obj) { - if(p_obj.className == 'widgetOutput' || p_obj.className == 'widgetResize' || p_obj.className == 'widgetResizeLeft' || p_obj.className == 'widgetBoxResize' || p_obj.className == 'widgetBoxResizeLeft') { + if($p_obj.hasClass('widgetOutput') || $p_obj.hasClass('widgetResize') || $p_obj.hasClass('widgetResizeLeft') || $p_obj.hasClass('widgetBoxResize') || $p_obj.hasClass('widgetBoxResizeLeft')) { widgetDragEnable(p_obj, widgetDragStart, widgetDrag, widgetDragEnd); widgetMouseDown(e); return; @@ -585,12 +588,14 @@ function doShowWidgetSizeSetup(px, py, obj) { if (!form.length) return; selectedSizeWidget = obj[0]; + var $selectedSizeWidget = jQuery(selectedSizeWidget); var opts = { widget_align : obj.css('float'), - width : obj[0].style.width, - height : obj[0].style.height, + css_class : ($selectedSizeWidget.attr('css_class')) ? $selectedSizeWidget.attr('css_class') : '', + width : obj[0].style.width, + height : obj[0].style.height, padding_left : _getInt(obj.attr('widget_padding_left')), padding_right : _getInt(obj.attr('widget_padding_right')), @@ -740,6 +745,12 @@ function doApplyWidgetSize(fo_obj) { if(fo_obj.widget_align.selectedIndex == 1) setFloat(selectedSizeWidget, 'right'); else setFloat(selectedSizeWidget, 'left'); + var $form = jQuery(fo_obj); + var $selectedSizeWidget = jQuery(selectedSizeWidget); + + var css_class = $form.find('#css_class').val(); + if(css_class) $selectedSizeWidget.attr('css_class', css_class); + var width = _getSize(fo_obj.width.value); if(width) selectedSizeWidget.style.width = width; @@ -781,8 +792,9 @@ function doApplyWidgetSize(fo_obj) { selectedSizeWidget.style.backgroundPosition = fo_obj.background_x.value+' '+fo_obj.background_y.value; var borderObj = selectedSizeWidget.firstChild; + var $borderObj = jQuery(selectedSizeWidget.firstChild); while(borderObj) { - if(borderObj.nodeName == "DIV" && (borderObj.className == "widgetBorder" || borderObj.className == "widgetBoxBorder")) { + if(borderObj.nodeName == "DIV" && ($borderObj.hasClass("widgetBorder") || $borderObj.hasClass("widgetBoxBorder"))) { var contentObj = borderObj.firstChild; while(contentObj) { if(contentObj.nodeName == "DIV") { @@ -974,7 +986,8 @@ function widgetDragEnable(obj, funcDragStart, funcDrag, funcDragEnd) { // 드래그를 시작할때 호출되는 함수 (이동되는 형태를 보여주기 위한 작업을 함) function widgetDragStart(tobj, px, py) { - if(tobj.className == 'widgetResize' || tobj.className == 'widgetResizeLeft' || tobj.className == 'widgetBoxResize' || tobj.className == 'widgetBoxResizeLeft') return; + var $tobj = jQuery(tobj); + if($tobj.hasClass('widgetResize') || $tobj.hasClass('widgetResizeLeft') || $tobj.hasClass('widgetBoxResize') || $tobj.hasClass('widgetBoxResizeLeft')) return; var obj = widgetGetTmpObject(tobj); xInnerHtml(obj, xInnerHtml(tobj)); diff --git a/modules/widget/tpl/widget_layer.html b/modules/widget/tpl/widget_layer.html index 4089da89d..9afbdd1be 100644 --- a/modules/widget/tpl/widget_layer.html +++ b/modules/widget/tpl/widget_layer.html @@ -9,6 +9,12 @@ + + {$lang->cmd_widget_css_class} + + + + {$lang->cmd_widget_align} diff --git a/modules/widget/widget.controller.php b/modules/widget/widget.controller.php index f807593cc..8c6587b9d 100644 --- a/modules/widget/widget.controller.php +++ b/modules/widget/widget.controller.php @@ -486,20 +486,20 @@ class widgetController extends widget $oEditorController = getController('editor'); $body = $oEditorController->transComponent($body); - $widget_content_header = sprintf('
    ', $args->id, $style, $inner_style); + $widget_content_header = sprintf('
    ', $args->id, $style, $inner_style); $widget_content_body = $body; $widget_content_footer = '
    '; break; // If the widget box; it could case 'widgetBox' : - $widget_content_header = sprintf('
    ', $args->id, $style, $inner_style); + $widget_content_header = sprintf('
    ', $args->id, $style, $inner_style); $widget_content_body = $widgetbox_content; break; // If the General wijetil default : - $widget_content_header = sprintf('
    ',$args->id,$style); + $widget_content_header = sprintf('
    ',$args->id,$style); $widget_content_body = sprintf('
    %s
    ', $inner_style,$widget_content); $widget_content_footer = '
    '; break; @@ -537,7 +537,7 @@ class widgetController extends widget $oWidgetController = getController('widget'); $widget_content_header = sprintf( - '
    '. + '
    '. '
    '. '
    '. '
    '. @@ -571,7 +571,7 @@ class widgetController extends widget } $widget_content_header = sprintf( - '
    '. + '
    '. '
    '. '
    '. '
    ',$args->widgetstyle,$style, $widget_padding_top, $widget_padding_right, $widget_padding_bottom, $widget_padding_left,implode(' ',$attribute),$inner_style); @@ -595,7 +595,7 @@ class widgetController extends widget } } - $widget_content_header = sprintf('
    '. + $widget_content_header = sprintf('
    '. '
    '. '
    '. '
    ',$args->widgetstyle,$style, @@ -710,6 +710,7 @@ class widgetController extends widget } $widget = $vars->selected_widget; + $vars->css_class = $request_vars->css_class; $vars->widgetstyle = $request_vars->widgetstyle; $vars->skin = trim($request_vars->skin); diff --git a/widgets/content/conf/info.xml b/widgets/content/conf/info.xml index b86ad3a29..b76ddc545 100644 --- a/widgets/content/conf/info.xml +++ b/widgets/content/conf/info.xml @@ -376,6 +376,10 @@ 内容摘要字数 內容字數 İçerik Uzunluğu + + + 닉네임 글자수 + Length of Nickname 링크 diff --git a/widgets/content/content.class.php b/widgets/content/content.class.php index f91968b55..3ba155de7 100644 --- a/widgets/content/content.class.php +++ b/widgets/content/content.class.php @@ -34,6 +34,8 @@ class content extends WidgetHandler if(!$args->subject_cut_size) $args->subject_cut_size = 0; // Cut the length of contents if(!$args->content_cut_size) $args->content_cut_size = 100; + // Cut the length of nickname + if(!$args->nickname_cut_size) $args->nickname_cut_size = 0; // Display time of the latest post if(!$args->duration_new) $args->duration_new = 12; // How to create thumbnails @@ -715,6 +717,7 @@ class content extends WidgetHandler $widget_info->page_count = $args->page_count; $widget_info->subject_cut_size = $args->subject_cut_size; $widget_info->content_cut_size = $args->content_cut_size; + $widget_info->nickname_cut_size = $args->nickname_cut_size; $widget_info->new_window = $args->new_window; $widget_info->duration_new = $args->duration_new * 60*60; @@ -887,9 +890,12 @@ class contentItem extends Object { return $this->get('category'); } - function getNickName() + function getNickName($cut_size = 0, $tail='...') { - return $this->get('nick_name'); + if($cut_size) $nick_name = cut_str($this->get('nick_name'), $cut_size, $tail); + else $nick_name = $this->get('nick_name'); + + return $nick_name; } function getAuthorSite() { diff --git a/widgets/content/skins/default/content.html b/widgets/content/skins/default/content.html index 9285624a7..0a52b7cc6 100644 --- a/widgets/content/skins/default/content.html +++ b/widgets/content/skins/default/content.html @@ -1,7 +1,7 @@ - + -
    black"> +
    diff --git a/widgets/content/skins/default/gallery.html b/widgets/content/skins/default/gallery.html index d789b3eff..e7a02ef12 100644 --- a/widgets/content/skins/default/gallery.html +++ b/widgets/content/skins/default/gallery.html @@ -33,7 +33,7 @@ - {$item->getNickName()} + {$item->getNickName($widget_info->nickname_cut_size)} {$item->getRegdate("Y-m-d")} {$item->getRegdate("H:i")} diff --git a/widgets/content/skins/default/image_title.html b/widgets/content/skins/default/image_title.html index d92565a26..8a0b7fdfc 100644 --- a/widgets/content/skins/default/image_title.html +++ b/widgets/content/skins/default/image_title.html @@ -38,7 +38,7 @@ {$item->printExtraImages()} - {$item->getNickName()} + {$item->getNickName($widget_info->nickname_cut_size)} {$item->getRegdate("Y-m-d")} {$item->getRegdate("H:i")} @@ -100,7 +100,7 @@ - {$item->getNickName()} + {$item->getNickName($widget_info->nickname_cut_size)} {$item->getRegdate("Y-m-d")} {$item->getRegdate("H:i")} diff --git a/widgets/content/skins/default/image_title_content.html b/widgets/content/skins/default/image_title_content.html index dd54b3e0c..6fc83a5f3 100644 --- a/widgets/content/skins/default/image_title_content.html +++ b/widgets/content/skins/default/image_title_content.html @@ -59,7 +59,7 @@

    - {$item->getNickName()} + {$item->getNickName($widget_info->nickname_cut_size)} {$item->getRegdate("Y-m-d")} {$item->getRegdate("H:i")} diff --git a/widgets/content/skins/default/normal.html b/widgets/content/skins/default/normal.html index 053442386..f472bb9c7 100644 --- a/widgets/content/skins/default/normal.html +++ b/widgets/content/skins/default/normal.html @@ -29,7 +29,7 @@ - getMemberSrl())-->href="#" onclick="return false;" class="author member_{$item->getMemberSrl()}"href="{$item->getAuthorSite()}" onclick="window.open(this.href); return false;" class="author member"href="#" onclick="return false;" class="author member" >{$item->getNickName()} + getMemberSrl())-->href="#" onclick="return false;" class="author member_{$item->getMemberSrl()}"href="{$item->getAuthorSite()}" onclick="window.open(this.href); return false;" class="author member"href="#" onclick="return false;" class="author member" >{$item->getNickName($widget_info->nickname_cut_size)} {$item->getRegdate("Y-m-d")} {$item->getRegdate("H:i")} @@ -81,7 +81,7 @@ - getMemberSrl())-->href="#" onclick="return false;" class="author member_{$item->getMemberSrl()}"href="{$item->getAuthorSite()}" onclick="window.open(this.href); return false;" class="author member"href="#" onclick="return false;" class="author member" >{$item->getNickName()} + getMemberSrl())-->href="#" onclick="return false;" class="author member_{$item->getMemberSrl()}"href="{$item->getAuthorSite()}" onclick="window.open(this.href); return false;" class="author member"href="#" onclick="return false;" class="author member" >{$item->getNickName($widget_info->nickname_cut_size)} {$item->getRegdate("Y-m-d")} {$item->getRegdate("H:i")}