2016-08-02 01:05:22 +02:00
|
|
|
// AJAX settings
|
2015-11-04 02:56:03 +01:00
|
|
|
$.ajaxSetup({
|
|
|
|
headers: {
|
|
|
|
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
|
|
|
}
|
|
|
|
});
|
2016-07-13 00:58:02 +02:00
|
|
|
|
2016-08-02 01:05:22 +02:00
|
|
|
// Escape jQuery selectors
|
2016-07-13 00:58:02 +02:00
|
|
|
function esc_selector(selector) {
|
|
|
|
return selector.replace( /(:|\.|\[|\]|,)/g, "\\$1" );
|
|
|
|
}
|
2016-08-02 01:05:22 +02:00
|
|
|
|
2016-12-03 01:06:40 +01:00
|
|
|
jQuery.fn.clearForm = function() {
|
|
|
|
// http://stackoverflow.com/questions/6364289/clear-form-fields-with-jquery
|
|
|
|
$(this).find('input').not(':button, :submit, :reset, :hidden')
|
|
|
|
.val('')
|
|
|
|
.removeAttr('checked')
|
|
|
|
.removeAttr('selected');
|
|
|
|
|
|
|
|
return this;
|
|
|
|
};
|
|
|
|
|
2016-10-12 04:47:43 +02:00
|
|
|
// Output helpful console message
|
|
|
|
console.log('%cPolr', 'font-size:5em;color:green');
|
|
|
|
console.log('%cNeed help? Open a ticket: https://github.com/cydrobolt/polr', 'color:blue');
|
|
|
|
console.log('%cDocs: https://docs.polr.me', 'color:blue');
|
|
|
|
|
2016-08-02 01:05:22 +02:00
|
|
|
// Set up Angular module
|
|
|
|
var polr = angular.module('polr',[]);
|