Skip to Content

JavaScript File

URL: http://xlib.info/js/services/addStory.js?v=140
HTTP Status: 200 OK
MIME Type: application/javascript
Last Modified: Thu, 08 Jul 2021 05:26:34 GMT
Download Time: Less than a second
Cookies: None
Size: 6 KB
HTTP Headers:  9 headers
Links In:  1 pages
Links Out:  0 links
Images:  0 images
CSS:  0 files
JavaScript:  0 files
OK Issues: No issues found

1window.contentSubmit = false;

2$(document).ready(function () {

3 if(localStorage.getItem('addStoryName') !== null) {

4 $('#as_form_pseudonym').val(localStorage.getItem('addStoryName'));

5 }

6 if(localStorage.getItem('addStoryEmail') !== null) {

7 $('#as_form_email').val(localStorage.getItem('addStoryEmail'));

8 }

9 if(localStorage.getItem('addStoryEmailVisible') !== null) {

10 if(localStorage.getItem('addStoryEmailVisible') == 'true') {

11 $('input[name="as_form_showemail"][value="show"]').prop('checked', true);

12 }

13 if(localStorage.getItem('addStoryEmailVisible') == 'false') {

14 $('input[name="as_form_showemail"][value="hide"]').prop('checked', true);

15 }

16 }

17 $('#as_form_tags').select2({

18 ajax: {

19 url: '/api/filter?model=genres',

20 dataType: 'json',

21 processResults: function (data) {

22 let vals = [];

23 for(var i = 0; i < data.items.length; i++) {

24 vals.push({

25 id: data.items[i].code,

26 text: data.items[i].label

27 });

28 }

29 return {

30 results: vals

31 };

32 }

33 },

34 tags: true,

35 tokenSeparators: [',', '.', ':', ';'],

36 width: '100%',

37 createTag: function(params) {

38 let term = params.term.replace(/[^АаБбВвГгДдЕеЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯяAaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789 -]/gi, '');

39 return {

40 id: params.term,

...

</html>