Rev 782 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 782 | Rev 1259 | ||
---|---|---|---|
Line 18... | Line 18... | ||
18 | var OIDplusObjectTypePluginGuid = { |
18 | var OIDplusObjectTypePluginGuid = { |
19 | 19 | ||
20 | oid: "1.3.6.1.4.1.37476.2.5.2.4.8.3", |
20 | oid: "1.3.6.1.4.1.37476.2.5.2.4.8.3", |
21 | 21 | ||
22 | generateRandomGUID: function() { |
22 | generateRandomGUID: function() { |
- | 23 | /* |
|
23 | // https://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid |
24 | // https://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid |
24 | // http://www.ietf.org/rfc/rfc4122.txt |
25 | // http://www.ietf.org/rfc/rfc4122.txt |
25 | var s = []; |
26 | var s = []; |
26 | var hexDigits = "0123456789abcdef"; |
27 | var hexDigits = "0123456789abcdef"; |
27 | for (var i = 0; i < 36; i++) { |
28 | for (var i = 0; i < 36; i++) { |
Line 31... | Line 32... | ||
31 | s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01 |
32 | s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01 |
32 | s[8] = s[13] = s[18] = s[23] = "-"; |
33 | s[8] = s[13] = s[18] = s[23] = "-"; |
33 | 34 | ||
34 | var uuid = s.join(""); |
35 | var uuid = s.join(""); |
35 | $("#id").val(uuid); |
36 | $("#id").val(uuid); |
- | 37 | */ |
|
- | 38 | ||
- | 39 | $("#id").val(_L("Please wait...")); |
|
- | 40 | $.ajax({ |
|
- | 41 | url:"ajax.php", |
|
- | 42 | method:"POST", |
|
- | 43 | beforeSend: function(jqXHR, settings) { |
|
- | 44 | $.xhrPool.abortAll(); |
|
- | 45 | $.xhrPool.add(jqXHR); |
|
- | 46 | }, |
|
- | 47 | complete: function(jqXHR, text) { |
|
- | 48 | $.xhrPool.remove(jqXHR); |
|
- | 49 | }, |
|
- | 50 | data: { |
|
- | 51 | csrf_token:csrf_token, |
|
- | 52 | plugin:OIDplusPagePublicObjects.oid, |
|
- | 53 | action:"generate_uuid" |
|
- | 54 | }, |
|
- | 55 | error: oidplus_ajax_error, |
|
- | 56 | success: function (data) { |
|
- | 57 | oidplus_ajax_success(data, function (data) { |
|
- | 58 | $("#id").val(data.uuid); |
|
- | 59 | //alertSuccess(_L("OK! Generated UUID %1", data.uuid)); |
|
- | 60 | }); |
|
- | 61 | } |
|
- | 62 | }); |
|
36 | } |
63 | } |
37 | 64 | ||
38 | }; |
65 | }; |