Last active
          July 19, 2018 09:49 
        
      - 
      
- 
        Save StefanoChiodino/71c1b54be346591e2a9b37d0320c13e7 to your computer and use it in GitHub Desktop. 
    Some small scripts to automate boring tasks safely through the Umbraco backend
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | $(".icon-wrong") | |
| .each(function(index, element){ | |
| setTimeout(function(){ | |
| $(element).trigger('contextmenu'); | |
| setTimeout(function(){ | |
| $(".icon-axis-rotation-2:eq(0)").click(); | |
| setTimeout(function(){ | |
| $('iframe.auto-expand').contents().find("#body_PropertyMappingRepeater_DestinationProperty_12:eq(0) option:eq(0)").prop('selected', true); | |
| $('iframe.auto-expand').contents().find("#body_PropertyMappingRepeater_DestinationProperty_19:eq(0) option:eq(1)").prop('selected', true); | |
| $('iframe.auto-expand').contents().find("#body_ValidateAndSave").click(); | |
| }, 1000); | |
| }, 1000); | |
| }, 5000 * index); | |
| }); | |
| $(".icon-wrong") | |
| .each(function(index, element){ | |
| setTimeout(function(){ | |
| $(element).trigger('contextmenu'); | |
| setTimeout(function(){ | |
| $(".icon-axis-rotation-2:eq(0)").click(); | |
| setTimeout(function(){ | |
| $('iframe.auto-expand').contents().find("#body_PropertyMappingRepeater_DestinationProperty_8:eq(0) option:eq(0)").prop('selected', true); | |
| $('iframe.auto-expand').contents().find("#body_PropertyMappingRepeater_DestinationProperty_9:eq(0) option:eq(0)").prop('selected', true); | |
| $('iframe.auto-expand').contents().find("#body_PropertyMappingRepeater_DestinationProperty_10:eq(0) option:eq(1)").prop('selected', true); | |
| $('iframe.auto-expand').contents().find("#body_PropertyMappingRepeater_DestinationProperty_16:eq(0) option:eq(1)").prop('selected', true); | |
| $('iframe.auto-expand').contents().find("#body_PropertyMappingRepeater_DestinationProperty_17:eq(0) option:eq(3)").prop('selected', true); | |
| $('iframe.auto-expand').contents().find("#body_ValidateAndSave").click(); | |
| }, 1000); | |
| }, 1000); | |
| }, 5000 * index); | |
| }); | |
| $("#tree .icon-navigation-right") | |
| .each(function(index, element){ | |
| $(element).click(); | |
| }); | |
| $("#tree div:not(.not-published) i.icon") | |
| .each(function(index, element){ | |
| setTimeout(function(){ | |
| $(element).click(); | |
| setTimeout(function(){ | |
| $(".umb-button__button.btn-success").click(); | |
| }, 1000); | |
| }, 5000 * index); | |
| }); | |
| let ids = [2612, | |
| 4244, | |
| 4249, | |
| 4251, | |
| 4252, | |
| 4254, | |
| 4255, | |
| 4256, | |
| 4259, | |
| 4260, | |
| 4267, | |
| 4278, | |
| 4299, | |
| 4303, | |
| 4317, | |
| 4318, | |
| 4324, | |
| 4339, | |
| 4348, | |
| 4366, | |
| 4367, | |
| 4371, | |
| 4375]; | |
| for (let i = 0; i < ids.length - 1; i++) { | |
| setTimeout(function(){ | |
| window.location.href = "http://x.y.z/umbraco/#/content/content/edit/" + ids[i]; | |
| setTimeout(function(){ | |
| $(".umb-button__button.btn-success").click(); | |
| }, 1000); | |
| }, 5000 * i); | |
| } | |
| ids.forEach(function (id) { | |
| setTimeout(function(){ | |
| window.location.href = "http://x.y.z/umbraco/#/content/content/edit/" + ids[i]; | |
| setTimeout(function(){ | |
| $(".umb-button__button.btn-success").click(); | |
| }, 1000); | |
| }, 5000 * i); | |
| }) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment