Created
December 9, 2015 21:38
-
-
Save g5codyswartz/21daa5374cc7a7d077b4 to your computer and use it in GitHub Desktop.
This file contains 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
// Must be ran from console and will put the export into your clipboard | |
var gallery = $(".edit_widget"); | |
//var title = $("div:nth-child(2)", gallery); | |
var photos = $(".photo-fields", gallery); | |
var exportData = []; | |
$('.photo-field').each(function(){ | |
var pPhotoUrl = $(".form-field:nth-child(2) input[type=text]", this).val(); | |
var pThumbUrl = $(".form-field:nth-child(3) input[type=text]", this).val(); | |
var pAltTag = $(".form-field:nth-child(4) input[type=text]", this).val(); | |
var pTitle = $(".form-field:nth-child(5) input[type=text]", this).val(); | |
var pCaption = $(".form-field:nth-child(6) input[type=text]", this).val(); | |
exportData.push({ | |
"photoUrl": pPhotoUrl, | |
"thumbUrl": pThumbUrl, | |
"alt": pAltTag, | |
"title": pTitle, | |
"caption": pCaption | |
}); | |
}); | |
//console.log(exportData); | |
copy(JSON.stringify(exportData)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment