From 97afd1191c33d43a3d8f4bc7f685bc797f4644d0 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sun, 12 Oct 2014 13:22:23 +0000 Subject: [PATCH] enhanced the ohloh widget support --- codepot/src/js/creole.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/codepot/src/js/creole.js b/codepot/src/js/creole.js index 9ed037ac..18cfb636 100644 --- a/codepot/src/js/creole.js +++ b/codepot/src/js/creole.js @@ -303,20 +303,20 @@ var Url = { // it uses the image pattern with special prefix // {{__ohloh__!width|height|style|widget-url}} // {{__ohloh__!300px!100px!border: none!http://www.ohloh.net/p/140949/widgets/project_partner_badge.js}} - ohlohWidget: { regex: '\\{\\{__ohloh__!(.+)!(.+)!(.+)!(.+)\\}\\}', + ohlohWidget: { regex: '\\{\\{(__ohloh__|__openhub__)!(.+)!(.+)!(.+)!(.+)\\}\\}', build: function(node, r, options) { - var d = document.createElement('iframe'); - d.setAttribute ("width", r[1]); - d.setAttribute ("height", r[2]); - d.setAttribute ("style", r[3]); + var d = document.createElement('iframe'); + d.setAttribute ("width", r[2]); + d.setAttribute ("height", r[3]); + d.setAttribute ("style", r[4]); node.appendChild (d); - var doc = d.contentWindow || d.contentDocument; - if (doc.document) { doc = doc.document;} + var doc = d.contentWindow || d.contentDocument; + if (doc.document) { doc = doc.document;} - doc.open (); - doc.write (''); - doc.close (); + doc.open (); + doc.write (''); + doc.close (); } }, preBlock: { tag: 'pre', capture: 2,