1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
3 | <head> |
---|
4 | <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> |
---|
5 | <title>Insert Page</title> |
---|
6 | <meta name="robots" content="noindex, nofollow" /> |
---|
7 | <style type="text/css"> |
---|
8 | input.textbox{width: 100%;} |
---|
9 | </style> |
---|
10 | <!--[if IE]> |
---|
11 | <style type="text/css"> |
---|
12 | input.textbox{width: 300px;} |
---|
13 | </style> |
---|
14 | <![endif]--> |
---|
15 | |
---|
16 | <link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/mw_lib/fsm/jqueryFileTree/jqueryFileTree.css" /> |
---|
17 | <script type="text/javascript" src="/misc/jquery.js"></script> |
---|
18 | <script type="text/javascript" src="/sites/all/modules/mw_lib/fsm/jqueryFileTree/jqueryFileTree.js"></script> |
---|
19 | <script type="text/javascript" src="/sites/all/modules/mw_lib/fsm/fsm.js.php?k"></script> |
---|
20 | |
---|
21 | <script src="../../fckeditor/editor/dialog/common/fck_dialog_common.js" type="text/javascript"></script> |
---|
22 | <script type="text/javascript"> |
---|
23 | |
---|
24 | function fill_in_url(file) |
---|
25 | { |
---|
26 | GetE('txtLink').value = file; |
---|
27 | } |
---|
28 | |
---|
29 | var dialog = window.parent; |
---|
30 | var oEditor = dialog.InnerDialogLoaded(); |
---|
31 | var FCK = oEditor.FCK; |
---|
32 | var FCKLang = oEditor.FCKLang; |
---|
33 | var olink = dialog.Selection.GetSelection().MoveToAncestorNode('a'); |
---|
34 | |
---|
35 | window.onload = function() |
---|
36 | { |
---|
37 | oEditor.FCKLanguageManager.TranslatePage(document); |
---|
38 | |
---|
39 | if(olink) |
---|
40 | { |
---|
41 | FCK.Selection.SelectNode(olink); |
---|
42 | GetE('txtLink').value = olink.href; |
---|
43 | } |
---|
44 | |
---|
45 | if (FCK.EditorWindow.getSelection) { |
---|
46 | var innerText = FCK.EditorWindow.getSelection(); |
---|
47 | } else if (FCK.EditorWindow.selection && FCK.EditorWindow.selection.createRange) { |
---|
48 | var range = FCK.EditorWindow.selection.createRange(); |
---|
49 | var innerText = range.text; |
---|
50 | } else { |
---|
51 | var innerText = ""; |
---|
52 | } |
---|
53 | |
---|
54 | |
---|
55 | GetE('txtName').value = innerText; |
---|
56 | //SelectField('txtLink'); |
---|
57 | |
---|
58 | $('#fsmPageBrowser').fileTree( |
---|
59 | { |
---|
60 | root: '', |
---|
61 | script: '/admin/fsm/page_tree/1', |
---|
62 | multiFolder: false, |
---|
63 | folderEvent: 'dblclick' |
---|
64 | }, |
---|
65 | function(file) { |
---|
66 | fill_in_url(file); |
---|
67 | } |
---|
68 | ); |
---|
69 | window.parent.SetAutoSize(true); |
---|
70 | window.parent.SetOkButton(true); |
---|
71 | } |
---|
72 | |
---|
73 | function Ok() |
---|
74 | { |
---|
75 | var txtName = GetE('txtName').value; |
---|
76 | var txtLink = GetE('txtLink').value; |
---|
77 | |
---|
78 | if(txtName.length == 0) |
---|
79 | { |
---|
80 | alert(FCKLang.fsmNoNameError); |
---|
81 | return false; |
---|
82 | } |
---|
83 | if(txtLink.length == 0) |
---|
84 | { |
---|
85 | alert(FCKLang.fsmNoLinkError); |
---|
86 | return false; |
---|
87 | } |
---|
88 | |
---|
89 | oEditor.FCKUndo.SaveUndoStep(); |
---|
90 | if(olink) |
---|
91 | olink.parentNode.removeChild(olink); |
---|
92 | |
---|
93 | sValue = FCK.InsertElement('a'); |
---|
94 | sValue.href= txtLink; |
---|
95 | sValue.innerHTML = txtName; |
---|
96 | |
---|
97 | return true; |
---|
98 | } |
---|
99 | |
---|
100 | </script> |
---|
101 | </head> |
---|
102 | |
---|
103 | <body> |
---|
104 | <div id="fsmPageBrowser" style="padding-bottom: 10px"> |
---|
105 | |
---|
106 | </div> |
---|
107 | <span fckLang="fsmPageLink">link to page</span><br /> |
---|
108 | <input id="txtLink" class="textbox" type="text" disabled="disabled" /> |
---|
109 | <br /> |
---|
110 | <span fckLang="fsmPageLinkName">text for link</span><br /> |
---|
111 | <input id="txtName" class="textbox" type="text" /> |
---|
112 | </body> |
---|
113 | </html> |
---|