Last active
October 16, 2018 15:09
-
-
Save CEBracco/afa642b9d67bf41ec8cfe313562c0e80 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
// ==UserScript== | |
// @name MantisQuickResponse | |
// @namespace http://tampermonkey.net/ | |
// @updateURL https://gist.github.com/CEBracco/afa642b9d67bf41ec8cfe313562c0e80/raw/MantisQuickResponse.user.js | |
// @version 1.1 | |
// @description Respuestas rápidas para mantis :D | |
// @author cbracco | |
// @match https://incidencias.cespi.unlp.edu.ar/bug_change_status_page.php | |
// @grant none | |
// @require https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.min.js | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
if($("#bug-change-status-form input[type='submit']").val() == "Aceptar incidencia"){ | |
$("#bugnote_text").val("Estamos trabajando en su resolución"); | |
} | |
var responses = [ | |
{'description':'Alta de usuario','value':'Se dio de alta el usuario [NOMBRE_DE_USUARIO].\nSe recomienda en el primer inicio de sesión, cambiar la contraseña para mayor seguridad.'}, | |
{'description':'Asignación de permisos','value':'Se asignaron los permisos solicitados al usuario indicado.'}, | |
{'description':'Resetear contraseña','value':'Se reseteó la contraseña del usuario solicitado.\nSe recomienda en el primer inicio de sesión, cambiar la contraseña para mayor seguridad.'} | |
]; | |
var template = '<tr><th class="category">Respuesta Rápida</th><td><select id="quick-response" name="quick-response" class="input-sm"><option value=""></option><% _.forEach(responses, function(response) { %><option value="<%- response.value %>\n\nv[VERSION]"><%- response.description %></option><% }); %></select></td></tr>'; | |
var compiled = _.template(template); | |
$('#bug-change-status-note') | |
.before(compiled({ 'responses': responses })); | |
$('#quick-response').change(function(){ | |
$("#bugnote_text").val($(this).val()); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment