2012-12-17 09:41:11 +01:00
function AddTagToProject ( projectid , tag ){
2014-09-14 17:08:57 +02:00
$ . get ( "/umbraco/api/Community/AddTag/?projectId=" + projectid + "&group=project&tag=" + tag );
2012-12-17 09:41:11 +01:00
}
function RemoveTagFromProject ( projectid , tag ){
2014-09-14 17:08:57 +02:00
$ . get ( "/umbraco/api/Community/RemoveTag/?projectId=" + projectid + "&group=project&tag=" + tag );
2012-12-17 09:41:11 +01:00
}
function VerifyFile ( fileId )
{
2014-09-14 18:01:02 +02:00
$ . post ( "/umbraco/api/Wiki/VerifyFile/?fileId=" + fileId );
2012-12-17 09:41:11 +01:00
}
jQuery ( document ). ready ( function () {
$ ( "#fileArchiveLink" ). click ( function ( e ) {
$ ( "#fileArchive" ). toggle ( 'fast' );
});
$ ( ".verifyWikiFile" ). click ( function ( e ) {
VerifyFile ( jQuery ( this ). attr ( "rel" ));
jQuery ( this ). hide ( "slow" );
});
$ ( "a.viewFullCompatibilityDetails" ). click ( function () {
if ( $ ( this ). text () == "View Details" ) {
$ ( "#compatLoading" ). show ();
var key = $ ( this ). attr ( "rel" ). split ( "," );
$ . get ( "/html/versioncompatibilityreport?fileId=" + key [ 0 ] + "&packageId=" + key [ 1 ],
function ( data ) {
$ ( "#compatLoading" ). hide ();
$ ( "#compatAjaxDetails" ). html ( data );
$ ( ".compatSummary" ). hide ();
$ ( ".compatDetails" ). show ( 'slow' );
});
$ ( this ). text ( "Hide Details" );
} else {
$ ( ".compatDetails" ). hide ();
$ ( ".compatSummary" ). show ( 'slow' );
$ ( this ). text ( "View Details" );
}
return false ;
});
2014-04-11 13:32:30 +02:00
$ ( "a.viewFullCompatibilityDetails" ). trigger ( "click" );
2012-12-17 09:41:11 +01:00
$ ( "a.compatibilityReport" ). click ( function () {
var key = $ ( this ). attr ( "rel" ). split ( "," );
$ . get ( "/html/versioncompatibility?fileId=" + key [ 0 ] + "&packageId=" + key [ 1 ],
function ( data ) {
jQuery . modal ( "<div><h3>I've tried this!</h3><p>Have you tried this package? Help others by letting them know if it's compatible with their version of Umbraco!</p><div class=\"versionForm\">" + data + "</div></div>" , { position : [ "100px" , ], overlayClose : true , closeHTML : '<a href="#" id="modalCloseButton" title="Close">close</a>' });
$ ( '#reportCompatibility' ). click ( function () {
var compatArr = "" ;
$ ( ".projectCompatList tr" ). each ( function ( index ) {
compatArr += $ ( this ). find ( "span" ). text () + "^" + $ ( this ). find ( "input[type='radio']:checked" ). val () + "," ;
});
$ . get ( "/base/deli/CompatibilityReport/" + $ ( "#packageId" ). val () + "/" + $ ( "#packageFileId" ). val () + "/" + compatArr . substr ( 0 , compatArr . length - 1 ) + ".aspx" , function ( data ) {
$ ( ".versionForm" ). html ( "<br/><br/><p><strong>Thankyou for taking the time to provide your feedback</strong></p>" );
if ( $ ( ".compatDetails:visible" )) {
$ ( ".compatDetails" ). hide ();
$ ( "#compatLoading" ). show ();
$ . get ( "/html/versioncompatibilityreport?fileId=" + key [ 0 ] + "&packageId=" + key [ 1 ],
function ( data ) {
$ ( "#compatLoading" ). hide ();
$ ( "#compatAjaxDetails" ). html ( data );
$ ( ".compatDetails" ). show ( 'slow' );
});
}
});
return false ;
});
});
return false ;
});
});