mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Start work on adding a rule.
This commit is contained in:
41
public/js/rules/create-edit.js
Normal file
41
public/js/rules/create-edit.js
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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++;
|
||||
|
||||
$.getJSON('json/trigger', {count: triggerCount}).success(function (data) {
|
||||
//console.log(data.html);
|
||||
$('tbody.rule-trigger-tbody').append(data.html);
|
||||
}).fail(function () {
|
||||
alert('Cannot get a new trigger.');
|
||||
});
|
||||
}
|
||||
|
||||
function addNewAction() {
|
||||
"use strict";
|
||||
triggerCount++;
|
||||
|
||||
$.getJSON('json/action', {count: actionCount}).success(function (data) {
|
||||
//console.log(data.html);
|
||||
$('tbody.rule-action-tbody').append(data.html);
|
||||
}).fail(function () {
|
||||
alert('Cannot get a new action.');
|
||||
});
|
||||
}
|
27
public/js/rules/edit.js
Normal file
27
public/js/rules/edit.js
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
// make a line.
|
||||
|
||||
$(function () {
|
||||
"use strict";
|
||||
console.log("edit");
|
||||
addNewTrigger();
|
||||
addNewAction();
|
||||
$('.add_rule_trigger').click(function () {
|
||||
addNewTrigger();
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.add_rule_action').click(function () {
|
||||
addNewAction();
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
@@ -1,4 +1,11 @@
|
||||
/* global comboChart,token, billID */
|
||||
/*
|
||||
* index.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.
|
||||
*/
|
||||
|
||||
// Return a helper with preserved width of cells
|
||||
var fixHelper = function (e, tr) {
|
||||
@@ -13,7 +20,6 @@ var fixHelper = function (e, tr) {
|
||||
|
||||
$(function () {
|
||||
"use strict";
|
||||
console.log("Hello");
|
||||
$('.rule-triggers').sortable({
|
||||
helper: fixHelper,
|
||||
stop: sortStop,
|
||||
|
Reference in New Issue
Block a user