Files
firefly-iii/public/js/rules/create-edit.js

41 lines
925 B
JavaScript
Raw Normal View History

2016-01-14 16:41:15 +01:00
/*
* create-edit.js
* Copyright (C) 2016 Sander Dorigo
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
var triggerCount = 0;
var actionCount = 0;
$(function () {
"use strict";
console.log("create-edit");
});
function addNewTrigger() {
"use strict";
triggerCount++;
2016-02-04 07:30:12 +01:00
$.getJSON('json/trigger', {count: triggerCount}).done(function (data) {
2016-01-14 16:41:15 +01:00
//console.log(data.html);
$('tbody.rule-trigger-tbody').append(data.html);
}).fail(function () {
alert('Cannot get a new trigger.');
});
}
function addNewAction() {
"use strict";
2016-01-14 21:34:17 +01:00
actionCount++;
2016-01-14 16:41:15 +01:00
2016-02-04 07:30:12 +01:00
$.getJSON('json/action', {count: actionCount}).done(function (data) {
2016-01-14 16:41:15 +01:00
//console.log(data.html);
$('tbody.rule-action-tbody').append(data.html);
}).fail(function () {
alert('Cannot get a new action.');
});
}