Last active
August 31, 2017 05:30
-
-
Save ducdhm/b5a8c6ccfe1276822a12f117981c0719 to your computer and use it in GitHub Desktop.
Creating example data in Kademi
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
$.each([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], function(index, value) { | |
setTimeout(function() { | |
$('#newQuickLeadModal').modal('show'); | |
$('#newQuickLeadModal [name=notes]').val('Note for quick lead #' + value); | |
$('#newQuickLeadModal form').trigger('submit'); | |
}, (2000 * value)); | |
}); |
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
$.each([1, 2, 3, 4, 5], function(index, value) { | |
setTimeout(function() { | |
$('#addCategoryModal').modal('show'); | |
$('[name=name]').val('CAT-' + value); | |
$('[name=newTitle]').val('Categories #' + value); | |
$('#addCategoryModal').find('form').trigger('submit'); | |
}, (1000 * value)); | |
}); |
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
$('[name=title]').val('Mah Journey'); | |
$('[name=leadsGroup]').val('leads'); | |
$('.btn-add-source').trigger('click').trigger('click').trigger('click'); | |
$('[name=sources]').eq(0).val('facebook'); | |
$('[name=sources]').eq(1).val('twitter'); | |
$('[name=sources]').eq(2).val('googleplus'); | |
$('.btn-add-stage').trigger('click').trigger('click').trigger('click'); | |
$('[name=stageName]').eq(0).val('cold'); | |
$('[name=stageDesc]').eq(0).val('Cold'); | |
$('[name=stageName]').eq(1).val('warm'); | |
$('[name=stageDesc]').eq(1).val('Warm'); | |
$('[name=stageName]').eq(2).val('hot'); | |
$('[name=stageDesc]').eq(2).val('Hot'); | |
$('.btn-add-lostReason').trigger('click').trigger('click').trigger('click'); | |
$('[name=lostReason]').eq(0).val('Can\'t contact'); | |
$('[name=lostReason]').eq(1).val('Rejected'); | |
$('[name=lostReason]').eq(2).val('Lost'); | |
$('.form-properties').trigger('submit'); |
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
birthYear = formatter.getYear(profile.birthDate); currentYear = formatter.getYear(formatter.now); age = currentYear - birthYear; nextBirthDay = formatter.addYears(profile.birthDate, age); return nextBirthDay; |
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
$.each([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], function(index, value) { | |
setTimeout(function() { | |
$('.btn-add-org').trigger('click'); | |
$('[name=orgId]').val('organisation-' + value); | |
$('[name=title]').val('Organisation #' + value); | |
$('#modal-edit-org').find('form').trigger('submit'); | |
}, (1000 * value)); | |
}); |
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
$.each([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], function(index, value) { | |
setTimeout(function() { | |
$('#addProductModal').modal('show'); | |
$('[name=name]').val('PROD-' + value); | |
$('[name=title]').val('Product ' + value); | |
$('[name=baseCost]').val(100 * value + value); | |
$('#addProductModal').find('form').trigger('submit'); | |
}, (1000 * value)); | |
}); |
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
$('#programModal').modal('show'); | |
$('[name=programName]').val('p1'); | |
$('[name=programTitle]').val('Program 1'); | |
$('#programModal form').trigger('submit'); | |
$('#courseModal').modal('show'); | |
$('[name=courseName]').val('c1'); | |
$('[name=courseTitle]').val('Course 1'); | |
$('#courseModal form').trigger('submit'); | |
$('#moduleModal').modal('show'); | |
$('[name=moduleName]').val('m1'); | |
$('[name=moduleTitle]').val('Module 1'); | |
$('#moduleModal form').trigger('submit'); | |
$('#modal-add-page').modal('show'); | |
$('#modal-add-page [name=pageTitle]').val('Module page #1'); | |
CKEDITOR.instances['body'].setData('Module page #1 content'); | |
$('#modal-add-page .btn-save-close').trigger('click'); |
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
$.each([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], function(index, value) { | |
setTimeout(function() { | |
$('#modal-new-user').modal('show'); | |
$('[name=nickName]').val('Test User #' + value); | |
$('[name=firstName]').val('Test User #' + value); | |
$('[name=email]').val('test-user-' + value + '@mailinator.com'); | |
$('[name=group]').val('test-users'); | |
$('#modal-new-user').find('.btn-add-and-close').trigger('click'); | |
}, (1000 * value)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment