mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-03 19:16:51 +00:00
Move more javascript around.
This commit is contained in:
13
public/js/jquery-ui.min.js
vendored
13
public/js/jquery-ui.min.js
vendored
File diff suppressed because one or more lines are too long
47
public/js/transactions/create-edit.js
Normal file
47
public/js/transactions/create-edit.js
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
/* globals what:true, $, doSwitch, txt, middleCrumbName, title,button, middleCrumbUrl, piggiesLength, breadcrumbs */
|
||||||
|
$(document).ready(function () {
|
||||||
|
"use strict";
|
||||||
|
if ($('input[name="expense_account"]').length > 0) {
|
||||||
|
$.getJSON('json/expense-accounts').success(function (data) {
|
||||||
|
$('input[name="expense_account"]').typeahead({source: data});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($('input[name="tags"]').length > 0) {
|
||||||
|
$.getJSON('json/tags').success(function (data) {
|
||||||
|
var opt = {
|
||||||
|
typeahead: {
|
||||||
|
source: data
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$('input[name="tags"]').tagsinput(
|
||||||
|
opt
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($('input[name="revenue_account"]').length > 0) {
|
||||||
|
$.getJSON('json/revenue-accounts').success(function (data) {
|
||||||
|
$('input[name="revenue_account"]').typeahead({source: data});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($('input[name="description"]').length > 0 && what !== undefined) {
|
||||||
|
$.getJSON('json/transaction-journals/' + what).success(function (data) {
|
||||||
|
$('input[name="description"]').typeahead({source: data});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($('input[name="category"]').length > 0) {
|
||||||
|
$.getJSON('json/categories').success(function (data) {
|
||||||
|
$('input[name="category"]').typeahead({source: data});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
@@ -1,44 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* create.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.
|
||||||
|
*/
|
||||||
|
|
||||||
/* globals what:true, $, doSwitch, txt, middleCrumbName, title,button, middleCrumbUrl, piggiesLength, breadcrumbs */
|
/* globals what:true, $, doSwitch, txt, middleCrumbName, title,button, middleCrumbUrl, piggiesLength, breadcrumbs */
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
if ($('input[name="expense_account"]').length > 0) {
|
|
||||||
$.getJSON('json/expense-accounts').success(function (data) {
|
|
||||||
$('input[name="expense_account"]').typeahead({source: data});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($('input[name="tags"]').length > 0) {
|
// respond to switch buttons when
|
||||||
$.getJSON('json/tags').success(function (data) {
|
// creating stuff:
|
||||||
var opt = {
|
|
||||||
typeahead: {
|
|
||||||
source: data
|
|
||||||
}
|
|
||||||
};
|
|
||||||
$('input[name="tags"]').tagsinput(
|
|
||||||
opt
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($('input[name="revenue_account"]').length > 0) {
|
|
||||||
$.getJSON('json/revenue-accounts').success(function (data) {
|
|
||||||
$('input[name="revenue_account"]').typeahead({source: data});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($('input[name="description"]').length > 0 && what !== undefined) {
|
|
||||||
$.getJSON('json/transaction-journals/' + what).success(function (data) {
|
|
||||||
$('input[name="description"]').typeahead({source: data});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($('input[name="category"]').length > 0) {
|
|
||||||
$.getJSON('json/categories').success(function (data) {
|
|
||||||
$('input[name="category"]').typeahead({source: data});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// respond to switch buttons:
|
|
||||||
if (doSwitch) {
|
if (doSwitch) {
|
||||||
updateButtons();
|
updateButtons();
|
||||||
updateForm();
|
updateForm();
|
13
public/js/transactions/edit.js
Normal file
13
public/js/transactions/edit.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* globals $ */
|
||||||
|
$(document).ready(function () {
|
||||||
|
"use strict";
|
||||||
|
// no special JS for edit transaction.
|
||||||
|
});
|
@@ -126,7 +126,8 @@
|
|||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="js/bootstrap3-typeahead.min.js"></script>
|
<script type="text/javascript" src="js/bootstrap3-typeahead.min.js"></script>
|
||||||
<script type="text/javascript" src="js/bootstrap-tagsinput.min.js"></script>
|
<script type="text/javascript" src="js/bootstrap-tagsinput.min.js"></script>
|
||||||
<script type="text/javascript" src="js/transactions.js"></script>
|
<script type="text/javascript" src="js/transactions/create-edit.js"></script>
|
||||||
|
<script type="text/javascript" src="js/transactions/create.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block styles %}
|
{% block styles %}
|
||||||
|
@@ -107,7 +107,8 @@
|
|||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="js/bootstrap3-typeahead.min.js"></script>
|
<script type="text/javascript" src="js/bootstrap3-typeahead.min.js"></script>
|
||||||
<script type="text/javascript" src="js/bootstrap-tagsinput.min.js"></script>
|
<script type="text/javascript" src="js/bootstrap-tagsinput.min.js"></script>
|
||||||
<script type="text/javascript" src="js/transactions.js"></script>
|
<script type="text/javascript" src="js/transactions/create-edit.js"></script>
|
||||||
|
<script type="text/javascript" src="js/transactions/edit.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block styles %}
|
{% block styles %}
|
||||||
<link href="css/bootstrap-tagsinput.css" type="text/css" rel="stylesheet" media="all">
|
<link href="css/bootstrap-tagsinput.css" type="text/css" rel="stylesheet" media="all">
|
||||||
|
Reference in New Issue
Block a user