How to make a Git revision to be an active hyperlink to Github (Mashup)

73 views
Skip to first unread message

Aliaksei Parasiatsyeu

unread,
May 3, 2012, 6:26:17 AM5/3/12
to DevTargetProcess, de...@goldenplanet.com
How to make a Git revision to be an active hyperlink to Github on e.g.
Bug View page, Source tab.

I create a simple mashup for "restui_tpview" placeholder which should
return the commit #:

tau.mashups
.addDependency('libs/jquery/jquery')
.addMashup(function ($, config) {

alert($(".revision-id").text());

});

As a result I get empty alert box when opening page.
Expected to see e.g. "# 536fd68c83a2d237a43bd693aa499e26711502a5" in
alert

It doesn't work even if I use 2 sec delay:
setTimeout(function(){ alert($(".revision-id").text()); }, 2000);

Vladimir Petriko

unread,
May 3, 2012, 9:24:35 AM5/3/12
to devtarge...@googlegroups.com, de...@goldenplanet.com
Hi Denis,

You are trying to make mashup for the page TpView, which hosts new type of views. These views are significantly differ from "old look" web forms and infrastructure for "mashup-ing" them is not implemented yet.

So unfortunately you can't create mashups for "new look" views for a while.

Let us know if you have any questions.

Thank you,
Volodya



3 мая 2012 г. 13:26 пользователь Aliaksei Parasiatsyeu <otry...@gmail.com> написал:

Jonathan Enzinna

unread,
May 3, 2012, 9:45:38 AM5/3/12
to devtarge...@googlegroups.com, de...@goldenplanet.com
That's not entirely true, you just have to work around the fact that the page is not actually ready and loaded when either the mashup is loaded or the document.ready event fires.  What you have to do is to fold:
  1. For the old views you have to wait for the document's ready event
  2. For the new views you have to bind to the DOMSubtreeModified event in div#main.  This is fired when the data is back from the AJAX call and the actual page is rendered, instead of the spinning indicator.
Try this code, it should work for both old and new views:

tau.mashups 
 .addDependency('libs/jquery/jquery') 
 .addMashup(function (config) { 
  $(document).ready(function() {
    /* this handles old views */
    alert($(".revision-id").text()); 
  });

  $('#main').bind('DOMSubtreeModified', function () {
    /* this handles new views */
    alert($(".revision-id").text()); 
  });
 }); 


On Thursday, May 3, 2012 9:24:35 AM UTC-4, Vladimir Petriko wrote:
Hi Denis,

You are trying to make mashup for the page TpView, which hosts new type of views. These views are significantly differ from "old look" web forms and infrastructure for "mashup-ing" them is not implemented yet.

So unfortunately you can't create mashups for "new look" views for a while.

Let us know if you have any questions.

Thank you,
Volodya



3 мая 2012 г. 13:26 пользователь Aliaksei Parasiatsyeu <> написал:


3 мая 2012 г. 13:26 пользователь Aliaksei Parasiatsyeu <> написал:

Denis Chmel

unread,
May 3, 2012, 11:27:47 AM5/3/12
to DevTargetProcess
Thanks Jonathan, your advice helped.

In general TP "mashups" are a good thing (doubtful naming however) -
we're able to improve something w/o need to ask you.
But what sucks is that you seems don't simplify that for us,
especially when talking about newer versions - they should be
"mashable" in core, on a ground level. I already hated new look when
it stopped working on iPad/iPhones, please stop any kind of
degradation, avoid producing HTML that sends AJAX requests in order to
show final HTML, why so hard?

Matt Stibbs

unread,
Nov 4, 2014, 4:49:53 AM11/4/14
to devtarge...@googlegroups.com, denis...@gmail.com
Hi Denis - did you manage to develop a mashup for making the revision ID a clickable link to Github? We need to do exactly this so would be very appreciate of anything you have already!

Matt
Reply all
Reply to author
Forward
0 new messages