diff --git a/.github/workflows/rails.yml b/.github/workflows/rails.yml index 7636a9d..b081cb1 100644 --- a/.github/workflows/rails.yml +++ b/.github/workflows/rails.yml @@ -10,7 +10,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Ruby 2.6 uses: ruby/setup-ruby@v1 with: @@ -20,7 +20,7 @@ jobs: sudo apt-get update sudo apt-get install -y build-essential libpq-dev nodejs \ libsqlite3-dev default-libmysqlclient-dev libxml2-dev - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: vendor/bundle key: ${{ runner.os }}-gems-v2-${{ hashFiles('**/Gemfile.lock') }} @@ -30,7 +30,7 @@ jobs: env: RAILS_ENV: test run: | - gem install bundler + gem install bundler -v 2.4.21 bundle config path vendor/bundle bundle install --jobs 4 --retry 3 RUBYOPT=-W0 bundle exec rake db:create diff --git a/Dockerfile b/Dockerfile index 7f69bd6..e5b1af1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ -FROM ruby:2.6.2-slim -RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs libsqlite3-dev default-libmysqlclient-dev libxml2-dev +FROM ruby:2.6.8-slim-bullseye + +RUN apt-get update -y && \ + apt-get install -y build-essential libpq-dev nodejs libsqlite3-dev default-libmysqlclient-dev libxml2-dev WORKDIR /app diff --git a/app/assets/stylesheets/application.css.erb b/app/assets/stylesheets/application.css.erb index 1953999..ee553d8 100644 --- a/app/assets/stylesheets/application.css.erb +++ b/app/assets/stylesheets/application.css.erb @@ -69,9 +69,154 @@ body { margin-bottom:4rem!important; } +/*go to top button css */ +#back-to-top { + position: fixed; + bottom: 20px; + right: 20px; + background-color: #333; + color: #fff; + border-radius: 50%; + width: 40px; + height: 40px; + text-decoration : none; + text-align: center; + line-height: 40px; + cursor: pointer; + opacity: 0; + transition: opacity 0.5s; +} + +#back-to-top.show { + opacity: 1; +} + +#back-to-top:hover { + background-color: #555; +} + +#back-to-top:before { + content: "\f077"; + font-family: "FontAwesome"; +} + +@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap'); + +.search-container { + display: flex; + justify-content: flex-end; + padding: 20px; +} + +.search-wrapper { + position: relative; + width: 250px; +} + +#searchInput { + width: 100%; + padding: 10px 15px 10px 40px; + font-size: 16px; + border: none; + border-bottom: 2px solid #3498db; + background-color: transparent; + outline: none; + transition: border-color 0.3s ease; +} + +#searchInput:focus { + border-color: #2980b9; +} + +.search-icon { + position: absolute; + left: 10px; + top: 50%; + transform: translateY(-50%); + color: #7f8c8d; +} + +.chapters-row { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); + gap: 30px; + padding: 30px; +} + .chapter-card { - border: 1px solid #dee2e6 !important; - margin-bottom:3rem!important; + background-color: #ffffff; + border-radius: 12px; + overflow: hidden; + box-shadow: 0 10px 20px rgba(0,0,0,0.05); + transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); + height: 100%; + display: flex; + flex-direction: column; + font-family: 'Poppins', sans-serif; + position: relative; +} + +.chapter-card:hover { + transform: translateY(-5px); + box-shadow: 0 15px 30px rgba(0,0,0,0.1); +} + +.chapter-img-container { + position: relative; + overflow: hidden; + height: 200px; +} + +.chapter-img { + width: 100%; + height: 100%; + object-fit: cover; + transition: transform 0.5s ease; +} + +.chapter-card:hover .chapter-img { + transform: scale(1.1); +} + +.card-body { + padding: 20px; + flex-grow: 1; + display: flex; + flex-direction: column; +} + +.card-title { + font-family: 'Montserrat', sans-serif; + font-size: 20px; + font-weight: 600; + margin: 0 0 10px; + color: #2c3e50; + letter-spacing: 0.5px; +} + +.card-text { + font-size: 14px; + font-family: 'Poppins', sans-serif; + font-weight: 400; + line-height: 1.5; + color: #34495e; + margin-bottom: 15px; +} + +.text-muted { + font-size: 13px; + color: #7f8c8d; +} + +.chapter-status { + position: absolute; + top: 15px; + right: 15px; + padding: 5px 10px; + border-radius: 20px; + font-size: 12px; + font-weight: 600; + text-transform: uppercase; } .chapter-active { @@ -82,27 +227,62 @@ body { background-image: radial-gradient(circle, rgba(255,102,102,0.1), rgba(255,102,102,0.6)); } -.chapter-zoom { - transform: scale(1.1); +.chapter-active .chapter-status { + background-color: #2ecc71; + color: white; } -.chapter-fixed-content { - position: fixed; +.chapter-inactive .chapter-status { + background-color: #e74c3c; + color: white; } -.chapter-img { - opacity: 0.9; +.chapter-details { + margin-top: auto; + display: flex; + justify-content: space-between; + align-items: center; + padding-top: 15px; + border-top: 1px solid #ecf0f1; +} + +.event-count { + display: flex; + align-items: center; +} + +.event-icon { + margin-right: 5px; + font-size: 16px; } -.chapter-hover figure { - opacity: 1; - -webkit-transition: .3s ease-in-out; - transition: .3s ease-in-out; +.learn-more { + background-color: #3498db; + color: white; + padding: 8px 15px; + border-radius: 20px; + text-decoration: none; + font-size: 13px; + font-weight: 600; + transition: background-color 0.3s ease; } -.chapter-hover figure:hover { - opacity: .6; + +.learn-more:hover { + background-color: #2980b9; } +.upcoming-events { + display: flex; + margin-top: 10px; + margin-bottom: 10px; +} + +.upcoming-events .event-icon { + margin-right: 8px; +} +.upcoming-events .text-muted { + color: #6c757d; +} /* Autocomplete JS */ .autocomplete-suggestions { border: 1px solid #999; background: #FFF; cursor: default; overflow: auto; -webkit-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); -moz-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); } diff --git a/app/views/chapters/index.html.erb b/app/views/chapters/index.html.erb index f983107..eb5a949 100644 --- a/app/views/chapters/index.html.erb +++ b/app/views/chapters/index.html.erb @@ -1,43 +1,80 @@

Chapters

-
+ +
+
+ 🔍 + +
+
+ +
<% @chapters.each do |chapter| %> - <% if chapter.active? %> - <% cName = 'chapter-active' %> - <% else %> - <% cName = 'chapter-inactive' %> - <% end %> -
- <%= link_to chapter_path(chapter) do %> -
-
-
<%= image_tag chapter.image_url, :size => '260x150', :class => 'chapter-img' %>
-
-
-

<%= chapter.name %> Chapter

-

<%= chapter.city %>,<% if chapter.state.present? && chapter.state!=chapter.city %> <%= chapter.state %>,<% end %> <%= chapter.country %>

-

<%= pluralize(chapter.past_events.count, "Past event") %>

-

<%= pluralize(chapter.upcoming_events.count, "Upcoming event") %>

- <%= link_to '', chapter_path(chapter), class:'stretched-link' %> -
+
+
+ <%= chapter.name %> +
+
+ <%= chapter.active? ? 'Active' : 'Inactive' %> +
+
+

<%= chapter.name %>

+

<%= chapter.city %>,<% if chapter.state.present? && chapter.state!=chapter.city %> <%= chapter.state %>,<% end %> <%= chapter.country %>

+
+ 🔜 + <%= chapter.upcoming_events.count %> upcoming events +
+
+
+ 📅 + <%= chapter.past_events.count %> past events
- <% end %> + Learn More +
+
<% end %>
+ + (function () { + const existingCards = Array.from(document.querySelectorAll(".chapter-card")); + const searchInput = document.getElementById("searchInput"); + + // Create a search index + const searchIndex = existingCards.map(card => ({ + element: card, + title: card.querySelector(".card-title").textContent.toLowerCase(), + location: card.querySelector(".card-text").textContent.toLowerCase() + })); + // Debounce function + const debounce = (func, delay) => { + let timeoutId; + return (...args) => { + clearTimeout(timeoutId); + timeoutId = setTimeout(() => func.apply(null, args), delay); + }; + }; + + // Optimized search function + const performSearch = debounce((query) => { + const searchQuery = query.toLowerCase(); + + requestAnimationFrame(() => { + searchIndex.forEach(item => { + const isVisible = item.title.includes(searchQuery) || item.location.includes(searchQuery); + item.element.style.display = isVisible ? "" : "none"; + }); + }); + }, 250); + + searchInput.addEventListener("input", function() { + performSearch(this.value); + }); + })(); + <%= render partial: 'chapters/chapter_map_loader', - locals: { chapter_address: @chapter_address, map_area_id: 'chapter-map' } %> + locals: { chapter_address: @chapter_address, map_area_id: 'chapter-map' } %> \ No newline at end of file diff --git a/app/views/event_sessions/show.html.erb b/app/views/event_sessions/show.html.erb index 8509291..6ee19e9 100644 --- a/app/views/event_sessions/show.html.erb +++ b/app/views/event_sessions/show.html.erb @@ -87,9 +87,3 @@
- - diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 08be835..bcc4b59 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -1,14 +1,20 @@
'; - } - }), - new $.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 (data) { - if (!data.username) - return false; - return '
[info]' + data.username + '
' + data.name + '
'; - } - }), - new $.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 $.fn.oembed.OEmbedProvider("googlecalendar", "rich", ["www.google.com/calendar/embed?.+"], "$1", - {templateRegex: /(.*)/, embedtag: {tag: 'iframe', width: '800', height: '600' }}), - new $.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 $.fn.oembed.OEmbedProvider("jsbin", "rich", ["jsbin.com/.+"], "http://jsbin.com/$1/?", - {templateRegex: /.*com\/([^\/]+).*/, embedtag: {tag: 'iframe', width: '100%', height: '300' }}), - new $.fn.oembed.OEmbedProvider("jotform", "rich", ["form.jotform.co/form/.+"], "$1?", - {templateRegex: /(.*)/, embedtag: {tag: 'iframe', width: '100%', height: '507' }}), - new $.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 $.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 $.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 $.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 $.fn.oembed.OEmbedProvider("mixlr", "rich", ["mixlr.com/.+"], "http://mixlr.com/embed/$1?autoplay=ae", - {templateRegex: /.*com\/([^\/]+).*/, embedtag: {tag: 'iframe', width: '100%', height: 'auto' }}), - new $.fn.oembed.OEmbedProvider("pastie", "rich", ["pastie\\.org/pastes/.+"], null, {yql: {xpath: '//pre[@class="textmate-source"]'}}), - new $.fn.oembed.OEmbedProvider("github", "rich", ["gist.github.com/.+"], "https://github.com/api/oembed"), - new $.fn.oembed.OEmbedProvider("github", "rich", ["github.com/[-.\\w@]+/[-.\\w@]+"], "https://api.github.com/repos/$1/$2?callback=?" - , {templateRegex: /.*\/([^\/]+)\/([^\/]+).*/, - templateData: function (data) { - if (!data.data.html_url)return false; - return '

' + data.data.name + '

' + data.data.description + '

' - + '

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

'; - } - }), - new $.fn.oembed.OEmbedProvider("facebook", "rich", ["facebook.com"], null - , {templateRegex: /.*\/([^\/]+)\/([^\/]+).*/, - template: function (url) { - // adding script directly to DOM to make sure that it is loaded correctly. - if (!$.fn.oembed.facebokScriptHasBeenAdded) { - $('
').appendTo('body'); - var script = document.createElement('script'); - script.type = 'text/javascript'; - script.text = '(function(d, s, id) {var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) return;js = d.createElement(s); js.id = id;js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";fjs.parentNode.insertBefore(js, fjs);}(document, "script", "facebook-jssdk"));'; - document.body.appendChild(script); - $.fn.oembed.facebokScriptHasBeenAdded = true; - } - - // returning template with url of facebook post. - return '
'; - - } - }), - /* - // Saving old implementation of Facebook in case we will need it as example in the future. - new $.fn.oembed.OEmbedProvider("facebook", "rich", ["facebook.com/(people/[^\\/]+/\\d+|[^\\/]+$)"], "https://graph.facebook.com/$2$3/?callback=?" - ,{templateRegex:/.*facebook.com\/(people\/[^\/]+\/(\d+).*|([^\/]+$))/, - templateData : function(data){ if(!data.id)return false; - var out = '
facebook '; - if(data.from) out += ''+data.from.name+''; - else if(data.link) out += ''+data.name+''; - else if(data.username) out += ''+data.name+''; - else out += ''+data.name+''; - out += '
'; - if(data.picture) out += ''; - else out += ''; - if(data.from) out += ''+data.name+''; - if(data.founded) out += 'Founded: '+data.founded+'
'; - if(data.category) out += 'Category: '+data.category+'
'; - if(data.website) out += 'Website: '+data.website+'
'; - if(data.gender) out += 'Gender: '+data.gender+'
'; - if(data.description) out += data.description + '
'; - out += '
'; - return out; - } - }), - */ - new $.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 (data) { - if (!data.questions) - return false; - var q = data.questions[0]; - var body = $(q.body).text(); - var out = '
' - + '' + (q.up_vote_count - q.down_vote_count) + '
vote(s)
' - + '
' + q.answer_count + 'answer
' + q.view_count + ' view(s)
' - + '

' + q.title + '

' - + '
' + body.substring(0, 100) + '...
'; - for (i in q.tags) { - out += ''; - } - - out += '
'; - return out; - } - }), - new $.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 $.fn.oembed.OEmbedProvider("screenr", "rich", ["screenr\.com"], "http://www.screenr.com/embed/$1", - {templateRegex: /.*\/([^\/]+).*/, embedtag: {tag: 'iframe', width: '650', height: 396}}) , - new $.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 $.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 $.fn.oembed.OEmbedProvider("kickstarter", "rich", ["kickstarter\\.com/projects/.+"], "$1/widget/card.html", - {templateRegex: /([^\?]+).*/, embedtag: {tag: 'iframe', width: '220', height: 380}}), - new $.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: true, - templateRegex: /.*\/(B[0-9A-Z]+)($|\/.*)/, - embedtag: { - tag: 'iframe', - width: '120px', - height: '240px'} - }), - new $.fn.oembed.OEmbedProvider("slideshare", "rich", ["slideshare\.net"], "//www.slideshare.net/api/oembed/2", {format: 'jsonp'}), - new $.fn.oembed.OEmbedProvider("roomsharejp", "rich", ["roomshare\\.jp/(en/)?post/.*"], "http://roomshare.jp/oembed.json"), - new $.fn.oembed.OEmbedProvider("lanyard", "rich", ["lanyrd.com/\\d+/.+"], null, - { - yql: { - xpath: '(//div[@class="primary"])[1]', - from: 'htmlstring', - datareturn: function (results) { - if (!results.result) - return false; - return '
' + results.result + '
'; - } - } - }), - new $.fn.oembed.OEmbedProvider("asciiartfarts", "rich", ["asciiartfarts.com/\\d+.html"], null, - { - yql: { - xpath: '//pre/font', - from: 'htmlstring', - datareturn: function (results) { - if (!results.result) - return false; - return '
' + results.result + '
'; - } - } - }), - new $.fn.oembed.OEmbedProvider("coveritlive", "rich", ["coveritlive.com/"], null, { - templateRegex: /(.*)/, - template: ''}), - new $.fn.oembed.OEmbedProvider("polldaddy", "rich", ["polldaddy.com/"], null, { - templateRegex: /(?:https?:\/\/w?w?w?.?polldaddy.com\/poll\/)([0-9]*)\//, - template: '', - nocache: 1 - }), - new $.fn.oembed.OEmbedProvider("360io", "rich", ["360\\.io/.+"], "http://360.io/$1", {templateRegex: /.*360\.io\/(\w+).*/, embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), - new $.fn.oembed.OEmbedProvider("bubbli", "rich", ["on\\.bubb\\.li/.+"], "http://on.bubb.li/$1", {templateRegex: /.*on\.bubb\.li\/(\w+).*/, embedtag: {tag: 'iframe', width: 480, height: 360}, nocache: 1 }), - new $.fn.oembed.OEmbedProvider("cloudup", "rich", ["cloudup\\.com/.+"], "http://cloudup.com/$1?chromeless", {templateRegex: [/.*cloudup\.com\/(\w+).*/], embedtag: {tag: 'iframe', width: 480, height: 360 }}), - new $.fn.oembed.OEmbedProvider("codepen", "rich", ["codepen.io/.+"], "http://codepen.io/$1/embed/$2", {templateRegex: [/.*io\/(\w+)\/pen\/(\w+).*/, /.*io\/(\w+)\/full\/(\w+).*/], embedtag: {tag: 'iframe', width: '100%', height: '300'}, nocache: 1 }), - new $.fn.oembed.OEmbedProvider("googleviews", "rich", ["(.*maps\\.google\\.com\\/maps\\?).+(output=svembed).+(cbp=(.*)).*"], "https://maps.google.com/maps?layer=c&panoid=$3&ie=UTF8&source=embed&output=svembed&cbp=$5", {templateRegex: /(.*maps\.google\.com\/maps\?).+(panoid=(\w+)&).*(cbp=(.*)).*/, embedtag: {tag: 'iframe', width: 480, height: 360}, nocache: 1 }), - new $.fn.oembed.OEmbedProvider("googlemaps", "rich", ["google\\.com\/maps\/place/.+"], "http://maps.google.com/maps?t=m&q=$1&output=embed", {templateRegex: /.*google\.com\/maps\/place\/([\w\+]*)\/.*/, embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), - new $.fn.oembed.OEmbedProvider("imajize", "rich", ["embed\\.imajize\\.com/.+"], "http://embed.imajize.com/$1", {templateRegex: /.*embed\.imajize\.com\/(.*)/, embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), - new $.fn.oembed.OEmbedProvider("mapjam", "rich", ["mapjam\\.com/.+"], "http://www.mapjam.com/$1", {templateRegex: /.*mapjam\.com\/(.*)/, embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), - new $.fn.oembed.OEmbedProvider("polar", "rich", ["polarb\\.com/.+"], "http://assets-polarb-com.a.ssl.fastly.net/api/v4/publishers/unknown/embedded_polls/iframe?poll_id=$1", {templateRegex: /.*polarb\.com\/polls\/(\w+).*/, embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), - new $.fn.oembed.OEmbedProvider("ponga", "rich", ["ponga\\.com/.+"], "https://www.ponga.com/embedded?id=$1", {templateRegex: [/.*ponga\.com\/embedded\?id=(\w+).*/, /.*ponga\.com\/(\w+).*/], embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), - - //Use Open Graph Where applicable - new $.fn.oembed.OEmbedProvider("opengraph", "rich", [".*"], null, - { - yql: { - xpath: "//meta|//title|//link", - from: 'html', - datareturn: function (results) { - if (!results['og:title'] && results['title'] && results['description']) - results['og:title'] = results['title']; - - if (!results['og:title'] && !results['title']) - return false; - - var code = $('

'); - if (results['og:video']) { - var embed = $(''); - embed.attr('type', results['og:video:type'] || "application/x-shockwave-flash") - .css('max-height', settings.maxHeight || 'auto') - .css('max-width', settings.maxWidth || 'auto'); - if (results['og:video:width']) - embed.attr('width', results['og:video:width']); - if (results['og:video:height']) - embed.attr('height', results['og:video:height']); - code.append(embed); - } else if (results['og:image']) { - var img = $(''); - img.css('max-height', settings.maxHeight || 'auto').css('max-width', settings.maxWidth || 'auto'); - if (results['og:image:width']) - img.attr('width', results['og:image:width']); - if (results['og:image:height']) - img.attr('height', results['og:image:height']); - code.append(img); - } - - if (results['og:title']) - code.append('' + results['og:title'] + '
'); - - if (results['og:description']) - code.append(results['og:description'] + '
'); - else if (results['description']) - code.append(results['description'] + '
'); - - return code; - } - } - } - ) - - ]; -})(jQuery); -//This is needed for gravatar :( -String.prototype.md5=function(){var a=function(a,b){var c=(a&65535)+(b&65535);var d=(a>>16)+(b>>16)+(c>>16);return d<<16|c&65535};var b=function(a,b){return a<>>32-b};var c=function(c,d,e,f,g,h){return a(b(a(a(d,c),a(f,h)),g),e)};var d=function(a,b,d,e,f,g,h){return c(b&d|~b&e,a,b,f,g,h)};var e=function(a,b,d,e,f,g,h){return c(b&e|d&~e,a,b,f,g,h)};var f=function(a,b,d,e,f,g,h){return c(b^d^e,a,b,f,g,h)};var g=function(a,b,d,e,f,g,h){return c(d^(b|~e),a,b,f,g,h)};var h=function(b){var c,h,i,j,k,l=b.length;var m=1732584193;var n=-271733879;var o=-1732584194;var p=271733878;for(k=0;k>2]>>d%4*8+4&15)+b.charAt(a[d>>2]>>d%4*8&15)}return c};var j=function(a){var b=(a.length+8>>6)+1;var c=[],d,e=b*16,f,g=a.length;for(d=0;d>2]|=(a.charCodeAt(f)&255)<>2]|=128<