PageRenderTime 103ms CodeModel.GetById 40ms app.highlight 6ms RepoModel.GetById 54ms app.codeStats 0ms

/static/scripts/tiny_mce/themes/advanced/js/about.js

http://n23.googlecode.com/
JavaScript | 72 lines | 51 code | 20 blank | 1 comment | 10 complexity | e4eaaf2b68e2f47ef3f1eb94e9b81609 MD5 | raw file
 1tinyMCEPopup.requireLangPack();
 2
 3function init() {
 4	var ed, tcont;
 5
 6	tinyMCEPopup.resizeToInnerSize();
 7	ed = tinyMCEPopup.editor;
 8
 9	// Give FF some time
10	window.setTimeout('insertHelpIFrame();', 10);
11
12	tcont = document.getElementById('plugintablecontainer');
13	document.getElementById('plugins_tab').style.display = 'none';
14
15	var html = "";
16	html += '<table id="plugintable">';
17	html += '<thead>';
18	html += '<tr>';
19	html += '<td>' + ed.getLang('advanced_dlg.about_plugin') + '</td>';
20	html += '<td>' + ed.getLang('advanced_dlg.about_author') + '</td>';
21	html += '<td>' + ed.getLang('advanced_dlg.about_version') + '</td>';
22	html += '</tr>';
23	html += '</thead>';
24	html += '<tbody>';
25
26	tinymce.each(ed.plugins, function(p, n) {
27		var info;
28
29		if (!p.getInfo)
30			return;
31
32		html += '<tr>';
33
34		info = p.getInfo();
35
36		if (info.infourl != null && info.infourl != '')
37			html += '<td width="50%" title="' + n + '"><a href="' + info.infourl + '" target="_blank">' + info.longname + '</a></td>';
38		else
39			html += '<td width="50%" title="' + n + '">' + info.longname + '</td>';
40
41		if (info.authorurl != null && info.authorurl != '')
42			html += '<td width="35%"><a href="' + info.authorurl + '" target="_blank">' + info.author + '</a></td>';
43		else
44			html += '<td width="35%">' + info.author + '</td>';
45
46		html += '<td width="15%">' + info.version + '</td>';
47		html += '</tr>';
48
49		document.getElementById('plugins_tab').style.display = '';
50
51	});
52
53	html += '</tbody>';
54	html += '</table>';
55
56	tcont.innerHTML = html;
57
58	tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion;
59	tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate;
60}
61
62function insertHelpIFrame() {
63	var html;
64
65	if (tinyMCEPopup.getParam('docs_url')) {
66		html = '<iframe width="100%" height="300" src="' + tinyMCEPopup.editor.baseURI.toAbsolute(tinyMCEPopup.getParam('docs_url')) + '"></iframe>';
67		document.getElementById('iframecontainer').innerHTML = html;
68		document.getElementById('help_tab').style.display = 'block';
69	}
70}
71
72tinyMCEPopup.onInit.add(init);