source: trunk/plugins/ExtendedFileManager/assets/popup.js @ 999

Last change on this file since 999 was 999, checked in by ray, 11 years ago

#1195 Allow to specify an external url to load a plugin from

  • Property svn:keywords set to LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
File size: 2.7 KB
Line 
1// htmlArea v3.0 - Copyright (c) 2002, 2003 interactivetools.com, inc.
2// This copyright notice MUST stay intact for use (see license.txt).
3//
4// Portions (c) dynarch.com, 2003
5//
6// A free WYSIWYG editor replacement for <textarea> fields.
7// For full source code and docs, visit http://www.interactivetools.com/
8//
9// Version 3.0 developed by Mihai Bazon.
10//   http://dynarch.com/mishoo
11//
12// $Id:popup.js 939 2008-01-22 21:11:43Z ray $
13
14function __dlg_onclose() {
15    if(opener.Dialog._return)
16        opener.Dialog._return(null);
17}
18function __dlg_init( bottom, win_dim ) {
19  __xinha_dlg_init(win_dim);
20}
21
22function __xinha_dlg_init( win_dim ) {
23  if(window.__dlg_init_done) return true;
24 
25  if(window.opener._editor_skin) {
26    var head = document.getElementsByTagName("head")[0];
27    var link = document.createElement("link");
28    link.type = "text/css";
29    link.href = window.opener._editor_url + 'skins/' + window.opener._editor_skin + '/skin.css';
30    link.rel = "stylesheet";
31    head.appendChild(link);
32  }
33  if (!window.dialogArguments && opener.Dialog._arguments)
34  {
35    window.dialogArguments = opener.Dialog._arguments;
36  }
37
38  Xinha.addDom0Event(document.body, 'keypress', __dlg_close_on_esc);
39  window.__dlg_init_done = true;
40}
41function __dlg_translate(context) {
42    var types = ["span", "option", "td", "th", "button", "div", "label", "a","img", "legend"];
43    for (var type = 0; type < types.length; type++) {
44        var spans = document.getElementsByTagName(types[type]);
45        for (var i = spans.length; --i >= 0;) {
46            var span = spans[i];
47            if (span.firstChild && span.firstChild.data) {
48                var txt = Xinha._lc(span.firstChild.data, context);
49                if (txt)
50                    span.firstChild.data = txt;
51            }
52            if (span.title) {
53                var txt = Xinha._lc(span.title, context);
54                if (txt)
55                    span.title = txt;
56            }
57            if (span.alt) {
58                var txt = Xinha._lc(span.alt, context);
59                if (txt)
60                    span.alt = txt;
61            }
62        }
63    }
64    document.title = Xinha._lc(document.title, context);
65}
66
67// closes the dialog and passes the return info upper.
68function __dlg_close(val) {
69    opener.Dialog._return(val);
70    window.close();
71}
72
73function popupPrompt( prompt, value, handler, title)
74{
75 
76    Dialog("prompt.html", function(param)
77    {
78      if (!param) // user must have pressed Cancel
79      {
80        return false;
81      }
82      else
83      {
84        handler (param.value);
85      }
86    }, {prompt:prompt,value:value,title:title});
87}
Note: See TracBrowser for help on using the repository browser.