Simpler deployment.
[redakcja.git] / redakcja / static / filebrowser / js / FB_CKEditor.js
1 function ProtectPath(path) {
2     path = path.replace( /\\/g,'\\\\');
3     path = path.replace( /'/g,'\\\'');
4     return path ;
5 }
6
7 function gup( name ) {
8   name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
9   var regexS = "[\\?&]"+name+"=([^&#]*)";
10   var regex = new RegExp(regexS);
11   var results = regex.exec(window.location.href);
12   if(results == null)
13     return "";
14   else
15     return results[1];
16 }
17
18 function OpenFile(fileUrl) {
19     var CKEditorFuncNum = gup('CKEditorFuncNum');
20     window.top.opener.CKEDITOR.tools.callFunction(CKEditorFuncNum,encodeURI(fileUrl).replace('#','%23'));
21     window.top.close();
22     window.top.opener.focus();
23 }
24