1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 12:12:48 +01:00

Implemented StackTraceJS

This commit is contained in:
Hillel Coren 2016-01-31 21:36:50 +02:00
parent 63eda63d9f
commit 02f137f95f
14 changed files with 46 additions and 21 deletions

View File

@ -101,6 +101,7 @@ module.exports = function(grunt) {
'public/vendor/jspdf/dist/jspdf.min.js',
'public/vendor/moment/min/moment.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/handsontable/dist/jquery.handsontable.full.min.js',
//'public/vendor/pdfmake/build/pdfmake.min.js',
@ -111,7 +112,7 @@ module.exports = function(grunt) {
'public/js/script.js',
'public/js/pdf.pdfmake.js',
],
dest: 'public/js/built.js',
dest: 'public/built.js',
nonull: true
},
js_public: {
@ -126,7 +127,7 @@ module.exports = function(grunt) {
'public/js/bootstrap-combobox.js',
],
dest: 'public/js/built.public.js',
dest: 'public/built.public.js',
nonull: true
},
css: {
@ -171,7 +172,7 @@ module.exports = function(grunt) {
'public/js/pdfmake.min.js',
'public/js/vfs_fonts.js',
],
dest: 'public/js/pdf.built.js',
dest: 'public/pdf.built.js',
nonull: true
}
}

View File

@ -224,7 +224,7 @@ class Utils
$count = Session::get('error_count', 0);
Session::put('error_count', ++$count);
if ($count > 100) {
if ($count > 200) {
return 'logged';
}

View File

@ -24,7 +24,8 @@
"jsoneditor": "*",
"moment-timezone": "~0.4.0",
"quill": "~0.20.0",
"datetimepicker": "~2.4.5"
"datetimepicker": "~2.4.5",
"stacktrace-js": "~1.0.1"
},
"resolutions": {
"jquery": "~1.11"

File diff suppressed because one or more lines are too long

View File

@ -95,4 +95,5 @@ There are two options:
* [thephpleague/fractal](https://github.com/thephpleague/fractal) - Output complex, flexible, AJAX/RESTful data structures
* [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
* [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

View File

@ -10,7 +10,7 @@
@foreach ($account->getFontFolders() as $font)
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
@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">

View File

@ -7,7 +7,7 @@
@foreach ($account->getFontFolders() as $font)
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
@endforeach
<script src="{{ asset('js/pdf.built.js') }}" type="text/javascript"></script>
<script src="{{ asset('pdf.built.js') }}" type="text/javascript"></script>
@stop

View File

@ -7,7 +7,7 @@
@foreach ($account->getFontFolders() as $font)
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
@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">

View File

@ -7,7 +7,7 @@
@foreach (Auth::user()->account->getFontFolders() as $font)
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
@endforeach
<script src="{{ asset('js/pdf.built.js') }}" type="text/javascript"></script>
<script src="{{ asset('pdf.built.js') }}" type="text/javascript"></script>
<script>

View File

@ -8,7 +8,7 @@
@foreach ($invoice->client->account->getFontFolders() as $font)
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
@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">
body {

View File

@ -26,26 +26,44 @@
<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">
var NINJA = NINJA || {};
NINJA.fontSize = 9;
NINJA.isRegistered = {{ \Utils::isRegistered() ? 'true' : 'false' }};
NINJA.isRegistered = {{ \Utils::isRegistered() ? 'true' : 'false' }};
window.onerror = function (errorMsg, url, lineNumber, column, error) {
if (errorMsg.indexOf('Script error.') > -1) {
return;
}
window.onerror = function(e) {
var message = e.message ? (e.message + ' - ' + e.filename + ': ' + e.lineno) : e;
try {
$.ajax({
type: 'GET',
url: '{{ URL::to('log_error') }}',
data: 'error='+encodeURIComponent(message)+'&url='+encodeURIComponent(window.location)
});
// Use StackTraceJS to parse the error context
if (error) {
var message = error.message ? error.message : error;
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) {}
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 */
$.extend( true, $.fn.dataTable.defaults, {
"bSortClasses": false,

View File

@ -4,7 +4,7 @@
<title>Invoice Ninja | Setup</title>
<meta charset="utf-8">
<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.css') }}?no_cache={{ NINJA_VERSION }}" rel="stylesheet" type="text/css"/>
<link href="{{ asset('favicon.png?test') }}" rel="shortcut icon">