Skip to content

Instantly share code, notes, and snippets.

@leekelleher
Last active March 19, 2018 15:10
Show Gist options
  • Save leekelleher/210f639c5106fbd81949 to your computer and use it in GitHub Desktop.
Save leekelleher/210f639c5106fbd81949 to your computer and use it in GitHub Desktop.
Umbraco Cloud UserScript - to assist with common tasks
// ==UserScript==
// @name Umbraco Cloud - UI Fixes
// @namespace http://leekelleher.com/
// @version 0.6.1
// @description Hacking around on umbraco.io
// @author Lee Kelleher
// @match https://www.umbraco.io/project/*
// @match https://www.s1.umbraco.io/project/*
// @grant none
// ==/UserScript==
function exec(){
$('head').find('link[rel="shortcut icon"]').attr('href', '/favicon.ico');
// Commented out, as I can't figure out how to hook into the modal overlay loading event to set the short commit message.
// $('.environment-overview--button').click(function(){
// var txt = $('.umb-overlay__header > h2').text();
// $('#deploySummary').val(txt);
// });
$('.local-environment').hide();
//$('.environment-nav').each(function(){
// var $nav = $(this).find('.environment-nav-level-one');
// var $link = $nav.find('.environment-nav-item').first();
// var url = $link.attr('href').replace('.s1.umbraco.io', '.scm.s1.umbraco.io');
// $nav.append('<li><a class="environment-nav-item no-underline" href="' + url + '" target="_blank">Kudu</a></li>');
//});
//var projectId = $('#projectId').val();
//var environmentIds = '';
//$('div[data-environment]').each(function(i, e){
// $e = $(e);
// environmentIds += '<li>' + $e.attr('data-environment') + ': ' + $e.attr('data-environment-repository') + '</li>';
//});
//$('.project > .container').append('<div><h3>GUIDs</h3><ul><li>Project ID: ' + projectId + '</li>' + environmentIds + '</ul></div>');
// Temporary workaround for the hostname limit restriction
$('div[id=addDomainUnavailable]:visible').css({ 'padding': '10px', 'background-color': '#c7c735'});
$('div[id=addDomainAvailable]:hidden').show();
}
function waitForPageLoad(){
if($('.local-environment,#hostname-addition').length === 0){
window.setTimeout(waitForPageLoad, 50);
}
else{
exec();
}
}
waitForPageLoad();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment