mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Implemented StackTraceJS
This commit is contained in:
parent
63eda63d9f
commit
02f137f95f
@ -101,6 +101,7 @@ module.exports = function(grunt) {
|
|||||||
'public/vendor/jspdf/dist/jspdf.min.js',
|
'public/vendor/jspdf/dist/jspdf.min.js',
|
||||||
'public/vendor/moment/min/moment.min.js',
|
'public/vendor/moment/min/moment.min.js',
|
||||||
'public/vendor/moment-timezone/builds/moment-timezone-with-data.min.js',
|
'public/vendor/moment-timezone/builds/moment-timezone-with-data.min.js',
|
||||||
|
'public/vendor/stacktrace-js/dist/stacktrace-with-polyfills.min.js',
|
||||||
//'public/vendor/moment-duration-format/lib/moment-duration-format.js',
|
//'public/vendor/moment-duration-format/lib/moment-duration-format.js',
|
||||||
//'public/vendor/handsontable/dist/jquery.handsontable.full.min.js',
|
//'public/vendor/handsontable/dist/jquery.handsontable.full.min.js',
|
||||||
//'public/vendor/pdfmake/build/pdfmake.min.js',
|
//'public/vendor/pdfmake/build/pdfmake.min.js',
|
||||||
@ -111,7 +112,7 @@ module.exports = function(grunt) {
|
|||||||
'public/js/script.js',
|
'public/js/script.js',
|
||||||
'public/js/pdf.pdfmake.js',
|
'public/js/pdf.pdfmake.js',
|
||||||
],
|
],
|
||||||
dest: 'public/js/built.js',
|
dest: 'public/built.js',
|
||||||
nonull: true
|
nonull: true
|
||||||
},
|
},
|
||||||
js_public: {
|
js_public: {
|
||||||
@ -126,7 +127,7 @@ module.exports = function(grunt) {
|
|||||||
'public/js/bootstrap-combobox.js',
|
'public/js/bootstrap-combobox.js',
|
||||||
|
|
||||||
],
|
],
|
||||||
dest: 'public/js/built.public.js',
|
dest: 'public/built.public.js',
|
||||||
nonull: true
|
nonull: true
|
||||||
},
|
},
|
||||||
css: {
|
css: {
|
||||||
@ -171,7 +172,7 @@ module.exports = function(grunt) {
|
|||||||
'public/js/pdfmake.min.js',
|
'public/js/pdfmake.min.js',
|
||||||
'public/js/vfs_fonts.js',
|
'public/js/vfs_fonts.js',
|
||||||
],
|
],
|
||||||
dest: 'public/js/pdf.built.js',
|
dest: 'public/pdf.built.js',
|
||||||
nonull: true
|
nonull: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -224,7 +224,7 @@ class Utils
|
|||||||
|
|
||||||
$count = Session::get('error_count', 0);
|
$count = Session::get('error_count', 0);
|
||||||
Session::put('error_count', ++$count);
|
Session::put('error_count', ++$count);
|
||||||
if ($count > 100) {
|
if ($count > 200) {
|
||||||
return 'logged';
|
return 'logged';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,8 @@
|
|||||||
"jsoneditor": "*",
|
"jsoneditor": "*",
|
||||||
"moment-timezone": "~0.4.0",
|
"moment-timezone": "~0.4.0",
|
||||||
"quill": "~0.20.0",
|
"quill": "~0.20.0",
|
||||||
"datetimepicker": "~2.4.5"
|
"datetimepicker": "~2.4.5",
|
||||||
|
"stacktrace-js": "~1.0.1"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"jquery": "~1.11"
|
"jquery": "~1.11"
|
||||||
|
File diff suppressed because one or more lines are too long
@ -96,3 +96,4 @@ There are two options:
|
|||||||
* [ezyang/htmlpurifier](https://github.com/ezyang/htmlpurifier) - Standards compliant HTML filter written in PHP
|
* [ezyang/htmlpurifier](https://github.com/ezyang/htmlpurifier) - Standards compliant HTML filter written in PHP
|
||||||
* [cerdic/css-tidy](https://github.com/Cerdic/CSSTidy) - CSSTidy is a CSS minifier
|
* [cerdic/css-tidy](https://github.com/Cerdic/CSSTidy) - CSSTidy is a CSS minifier
|
||||||
* [asgrim/ofxparser](https://github.com/asgrim/ofxparser) - OFX File Parser
|
* [asgrim/ofxparser](https://github.com/asgrim/ofxparser) - OFX File Parser
|
||||||
|
* [stacktracejs/stacktrace.js](https://github.com/stacktracejs/stacktrace.js) - Framework-agnostic, micro-library for getting stack traces in all web browsers
|
@ -10,7 +10,7 @@
|
|||||||
@foreach ($account->getFontFolders() as $font)
|
@foreach ($account->getFontFolders() as $font)
|
||||||
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
|
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
|
||||||
@endforeach
|
@endforeach
|
||||||
<script src="{{ asset('js/pdf.built.js') }}" type="text/javascript"></script>
|
<script src="{{ asset('pdf.built.js') }}" type="text/javascript"></script>
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
@foreach ($account->getFontFolders() as $font)
|
@foreach ($account->getFontFolders() as $font)
|
||||||
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
|
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
|
||||||
@endforeach
|
@endforeach
|
||||||
<script src="{{ asset('js/pdf.built.js') }}" type="text/javascript"></script>
|
<script src="{{ asset('pdf.built.js') }}" type="text/javascript"></script>
|
||||||
|
|
||||||
@stop
|
@stop
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
@foreach ($account->getFontFolders() as $font)
|
@foreach ($account->getFontFolders() as $font)
|
||||||
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
|
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
|
||||||
@endforeach
|
@endforeach
|
||||||
<script src="{{ asset('js/pdf.built.js') }}" type="text/javascript"></script>
|
<script src="{{ asset('pdf.built.js') }}" type="text/javascript"></script>
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
@foreach (Auth::user()->account->getFontFolders() as $font)
|
@foreach (Auth::user()->account->getFontFolders() as $font)
|
||||||
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
|
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
|
||||||
@endforeach
|
@endforeach
|
||||||
<script src="{{ asset('js/pdf.built.js') }}" type="text/javascript"></script>
|
<script src="{{ asset('pdf.built.js') }}" type="text/javascript"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
@foreach ($invoice->client->account->getFontFolders() as $font)
|
@foreach ($invoice->client->account->getFontFolders() as $font)
|
||||||
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
|
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
|
||||||
@endforeach
|
@endforeach
|
||||||
<script src="{{ asset('js/pdf.built.js') }}" type="text/javascript"></script>
|
<script src="{{ asset('pdf.built.js') }}" type="text/javascript"></script>
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body {
|
body {
|
||||||
|
@ -26,26 +26,44 @@
|
|||||||
|
|
||||||
<link rel="canonical" href="{{ NINJA_APP_URL }}/{{ Request::path() }}" />
|
<link rel="canonical" href="{{ NINJA_APP_URL }}/{{ Request::path() }}" />
|
||||||
|
|
||||||
<script src="{{ asset('js/built.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>
|
<script src="{{ asset('built.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var NINJA = NINJA || {};
|
var NINJA = NINJA || {};
|
||||||
NINJA.fontSize = 9;
|
NINJA.fontSize = 9;
|
||||||
|
|
||||||
NINJA.isRegistered = {{ \Utils::isRegistered() ? 'true' : 'false' }};
|
NINJA.isRegistered = {{ \Utils::isRegistered() ? 'true' : 'false' }};
|
||||||
|
|
||||||
window.onerror = function(e) {
|
window.onerror = function (errorMsg, url, lineNumber, column, error) {
|
||||||
var message = e.message ? (e.message + ' - ' + e.filename + ': ' + e.lineno) : e;
|
if (errorMsg.indexOf('Script error.') > -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$.ajax({
|
// Use StackTraceJS to parse the error context
|
||||||
type: 'GET',
|
if (error) {
|
||||||
url: '{{ URL::to('log_error') }}',
|
var message = error.message ? error.message : error;
|
||||||
data: 'error='+encodeURIComponent(message)+'&url='+encodeURIComponent(window.location)
|
StackTrace.fromError(error).then(function(result) {
|
||||||
});
|
var gps = new StackTraceGPS();
|
||||||
|
gps.findFunctionName(result[0]).then(function(result) {
|
||||||
|
logError(errorMsg + ': ' + JSON.stringify(result));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
logError(errorMsg);
|
||||||
|
}
|
||||||
} catch(err) {}
|
} catch(err) {}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function logError(message) {
|
||||||
|
$.ajax({
|
||||||
|
type: 'GET',
|
||||||
|
url: '{{ URL::to('log_error') }}',
|
||||||
|
data: 'error='+encodeURIComponent(message)+'&url='+encodeURIComponent(window.location)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/* Set the defaults for DataTables initialisation */
|
/* Set the defaults for DataTables initialisation */
|
||||||
$.extend( true, $.fn.dataTable.defaults, {
|
$.extend( true, $.fn.dataTable.defaults, {
|
||||||
"bSortClasses": false,
|
"bSortClasses": false,
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<title>Invoice Ninja | Setup</title>
|
<title>Invoice Ninja | Setup</title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="csrf-token" content="<?= csrf_token() ?>">
|
<meta name="csrf-token" content="<?= csrf_token() ?>">
|
||||||
<script src="{{ asset('js/built.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>
|
<script src="{{ asset('built.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>
|
||||||
<link href="{{ asset('css/built.public.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>
|
<link href="{{ asset('css/built.public.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>
|
||||||
<link href="{{ asset('css/built.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>
|
<link href="{{ asset('css/built.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>
|
||||||
<link href="{{ asset('favicon.png?test') }}" rel="shortcut icon">
|
<link href="{{ asset('favicon.png?test') }}" rel="shortcut icon">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user