Skip to content

Instantly share code, notes, and snippets.

@vcalderondev
Last active August 29, 2015 14:03
Show Gist options
  • Save vcalderondev/b3bcee2ed251a32903a9 to your computer and use it in GitHub Desktop.
Save vcalderondev/b3bcee2ed251a32903a9 to your computer and use it in GitHub Desktop.
Un script sencillo para acceder al editor de entradas de Blogger presionando CTRL+ALT+E
// Explicación:
// Para que pueda funcionar, deberás establecer el selector correcto en la variable editor_url que contenga el parámetro href correcto.
//Si te genera confusión, copia este código debajo de <data:post.body/>:
// <a id="post-editor" expr:href="data:post.url" style="display:none;"><data:post.title/></a>
$(document).keydown(function(e) {
if(e.which == 69 && e.ctrlKey && e.altKey) {
var editor_url = $("#post-title, #post-editor").attr("href");
var ventana_editar = window.open(editor_url, "Editar Entrada", "width=800, height=600");
var crono = window.setInterval(function() {
if (ventana_editar.closed !== false) {
window.clearInterval(crono);
//location.reload(); // Descomentar para actualizar la pestaña con la entrada
}
}, 250);
}
});
// REQUISITO : NECESITA jQUERY INSTALADO EN LA PLANTILLA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment