This repository has been archived by the owner on Apr 5, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
147 additions
and
99 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,49 @@ | ||
$(function() { | ||
|
||
// Find entry types by chosen section | ||
$('[name="importSection"]').change(function() { | ||
|
||
$('#entrytypes').html(''); | ||
Craft.postActionRequest('import/getEntryTypes', { 'section': $(this).val() }, function(entrytypes) { | ||
|
||
$.each(entrytypes, function(index, value) { | ||
$('#entrytypes').append('<option value="' + value.id + '">' + value.name + '</option>'); | ||
if($('#sections').length) { | ||
|
||
// Find entry types by chosen section | ||
$('#sections').change(function() { | ||
|
||
$('#entrytypes').html(''); | ||
Craft.postActionRequest('import/getEntryTypes', { 'section': $(this).val() }, function(entrytypes) { | ||
|
||
$.each(entrytypes, function(index, value) { | ||
$('#entrytypes').append('<option value="' + value.id + '">' + value.name + '</option>'); | ||
}); | ||
|
||
}); | ||
|
||
}); | ||
|
||
// Only show backup option when receiving email | ||
$('#email').change(function() { | ||
$('#backup').prop('disabled', !$(this).is(':checked')); | ||
}); | ||
|
||
}); | ||
} | ||
|
||
// Make sure each field gets mapped once | ||
$('.mapper select').change(function() { | ||
if($('.mapper select').length) { | ||
|
||
// Disable chosen option for all mapper fields | ||
$('.mapper select option:disabled').prop('disabled', false); | ||
$('.mapper select option:selected').each(function() { | ||
|
||
// Not import field can always get mapped | ||
if($(this).val() != 'dont') { | ||
$('.mapper select option[value="' + $(this).val() + '"]').not($(this)).prop('disabled', true); | ||
} | ||
// Make sure each field gets mapped once | ||
$('.mapper select').change(function() { | ||
|
||
// Disable chosen option for all mapper fields | ||
$('.mapper select option:disabled').prop('disabled', false); | ||
$('.mapper select option:selected').each(function() { | ||
|
||
// Not import field can always get mapped | ||
if($(this).val() != 'dont') { | ||
$('.mapper select option[value="' + $(this).val() + '"]').not($(this)).prop('disabled', true); | ||
} | ||
|
||
}); | ||
|
||
}); | ||
|
||
}); | ||
// Trigger on load also | ||
$('.mapper select').trigger('change'); | ||
|
||
// Trigger on load also | ||
$('.mapper select').trigger('change'); | ||
} | ||
|
||
}); |
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.