-
Notifications
You must be signed in to change notification settings - Fork 1
/
vk_loader.js
84 lines (79 loc) · 2.81 KB
/
vk_loader.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/**
* $Id$
*
* Keyboard loader
*
* This software is protected by patent No.2009611147 issued on 20.02.2009 by Russian Federal Service for Intellectual Property Patents and Trademarks.
*
* @author Ilya Lebedev
* @copyright 2006-2011 Ilya Lebedev <ilya@lebedev.net>
* @version $Rev$
* @lastchange $Author$ $Date$
*/
/*
* Prevent duplicate keyboard loading
*/
if (!window.VirtualKeyboard) {
VirtualKeyboard = new function () {
var self = this, to = null;
self.show = self.hide = self.toggle = self.attachInput = function () {
window.status = 'VirtualKeyboard is not loaded yet.';
if (!to) setTimeout(function(){window.status = ''},1000);
}
self.isOpen = function () {
return false;
}
self.isReady = function () {
return false;
}
};
(function () {
var p = (function (sname){var sc=document.getElementsByTagName('script'),sr=new RegExp('^(.*/|)('+sname+')([#?]|$)');
for (var i=0,scL=sc.length; i<scL; i++) {
var m = String(sc[i].src).match(sr);
if (m) {
if (!m[1]) m[1] = "";
if (m[1].match(/^((https?|file|widget)\:\/{2,}|\w:[\\])/)) return m[1];
if (m[1].indexOf("/")==0) return m[1];
var b = document.getElementsByTagName('base');
if (b[0] && b[0].href) return b[0].href+m[1];return (document.location.href.replace(/[?#].+$/,'').match(/(.*[\/\\])/)[0]+m[1]).replace(/^\/+/,"");}}return null;
})('vk_loader.js');
var dpd = [ 'extensions/helpers.js'
,'extensions/dom.js'
,'extensions/ext/object.js'
,'extensions/ext/string.js'
,'extensions/ext/regexp.js'
,'extensions/ext/array.js'
,'extensions/eventmanager.js'
,'extensions/documentselection.js'
,'extensions/documentcookie.js'
/*
* not used by default
*
* ,'layouts/unconverted.js'
*/
];
for (var i=0,dL=dpd.length;i<dL;i++)
dpd[i] = p+dpd[i];
dpd[i++] = p+'virtualkeyboard.js';
dpd[i] = p+'layouts/layouts.js';
if (window.ScriptQueue) {
ScriptQueue.queue(dpd);
} else {
if (!(window.ScriptQueueIncludes instanceof Array)) window.ScriptQueueIncludes = []
window.ScriptQueueIncludes = window.ScriptQueueIncludes.concat(dpd);
/*
* attach script loader
*/
if (document.body) {
var s = document.createElement('script');
s.type="text/javascript";
s.src = p+'extensions/scriptqueue.js';
var head = document.getElementsByTagName("head")[0];
head.appendChild(s);
} else {
document.write("<scr"+"ipt type=\"text/javascript\" src=\""+p+'extensions/scriptqueue.js'+"\"></scr"+"ipt>");
}
}
})();
}