/** * Perforce Swarm * * @copyright 2015 Perforce Software. All rights reserved. * @license Please see LICENSE.txt in top-level folder of this distribution. * @version <release>/<patch> */ $(document).ready( function() { if ($('body').hasClass('route-add-project') || $('body').hasClass('route-edit-project')) { var project = $('form').data("project"); var target = $('.control-group.control-group-owners'); var url = project.slack ? project.slack['url'] : ""; var enabled = project.slack ? project.slack['enabled'] : false; var st_checked = enabled ? "checked " : ""; var st_in = enabled ? "in " : ""; var input = '<div class="control-group slack-data">' + '<label class="control-label" for="slack">' + 'Slack Webhook' + '</label>' + '<div class="controls">' + '<label class="checkbox" for="slackEnabled">' + '<input type="checkbox" name="slack[enabled]" ' + 'data-toggle="collapse" ' + 'data-target=".slack-data .body" ' + st_checked + 'id="slackEnabled" >' + 'Enable' + '</label>' + '<div class="body collapse ' + st_in + '">' + '<textarea class="input-xxlarge" name="slack[url]" rows="3" ' + 'placeholder="https://hooks.slack.com/services/YOUR/CODE" >' + url + '</textarea>' + '</div>' + '</div>' + '</div>'; $(target).before(input); $(target).closest('form').attr('enctype', 'multipart/form-data'); $(target).closest('form').data('max-size', 1048576); } });
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 20871 | Paul Allen | Update my old dev branch 'paul_allen' with changes from 'perforce_software'. | ||
#1 | 16611 | Paul Allen |
Updates changes from Internal Swarm review. Use JS injection for dynamic Project Configuration. |