-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjusttexts-plugin.js
More file actions
34 lines (27 loc) · 959 Bytes
/
justtexts-plugin.js
File metadata and controls
34 lines (27 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* Definition of justtexts plugin
*
* @copyright 2014-today Justso GmbH
* @author j.schirrmacher@justso.de
*/
"use strict";
/* global jQuery, alert */
/*jslint nomen: true */
(function ($) {
var pageEntry = $("#PageEntry"),
value = pageEntry.html();
value = value.replace(/<\/span>/m, '</span><span class="template" contenteditable="true"><%= template %></span>');
pageEntry.html(value);
$("#pages").find(".name").after('<span class="template">Template</span>');
$(".navbar .container").append($('<button id="flush" class="pull-right btn">Flush Cache</button>'));
$("#flush").on("click", function () {
$.get("/api/justgen/flushcache")
.then(function () {
window.router.refreshPageListView();
})
.fail(function (error, message) {
alert(message + ': ' + error.responseText);
});
return false;
});
}(jQuery));