-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathEditData.ascx
88 lines (75 loc) · 4.02 KB
/
EditData.ascx
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
85
86
87
88
<%@ Control Language="C#" AutoEventWireup="false" Inherits="Satrabel.OpenForm.EditData" CodeBehind="EditData.ascx.cs" %>
<%@ Register Assembly="DotnetNuke" Namespace="DotNetNuke.UI.WebControls" TagPrefix="dnn" %>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" Assembly="DotNetNuke.Web.Client" %>
<%@ Register TagPrefix="dnnweb" Namespace="DotNetNuke.Web.UI.WebControls" Assembly="DotNetNuke.Web" %>
<%-- Custom CSS Registration --%>
<dnn:DnnCssInclude runat="server" FilePath="~/Resources/Shared/components/CodeEditor/lib/codemirror.css" />
<%-- Custom JavaScript Registration --%>
<dnn:DnnJsInclude runat="server" FilePath="~/Resources/Shared/components/CodeEditor/lib/codemirror.js" Priority="101" />
<dnn:DnnJsInclude runat="server" FilePath="~/Resources/Shared/components/CodeEditor/mode/clike/clike.js" Priority="102" />
<dnn:DnnJsInclude runat="server" FilePath="~/Resources/Shared/components/CodeEditor/mode/vb/vb.js" Priority="102" />
<dnn:DnnJsInclude runat="server" FilePath="~/Resources/Shared/components/CodeEditor/mode/xml/xml.js" Priority="102" />
<dnn:DnnJsInclude runat="server" FilePath="~/Resources/Shared/components/CodeEditor/mode/javascript/javascript.js" Priority="102" />
<dnn:DnnJsInclude runat="server" FilePath="~/Resources/Shared/components/CodeEditor/mode/css/css.js" Priority="102" />
<dnn:DnnJsInclude runat="server" FilePath="~/Resources/Shared/components/CodeEditor/mode/htmlmixed/htmlmixed.js" Priority="103" />
<div class="dnnForm dnnRazorHostEditScript dnnClear" id="dnnEditScript">
<fieldset>
<div class="dnnFormItem">
<dnn:Label id="DataType" runat="Server" controlname="scriptList" />
<asp:DropDownList ID="sourceList" runat="server" AutoPostBack="true" />
</div>
<div>
<asp:TextBox ID="txtSource" runat="server" TextMode="MultiLine" Rows="30" Columns="140" />
</div>
</fieldset>
<ul class="dnnActions dnnClear">
<li>
<asp:LinkButton ID="cmdSave" resourcekey="cmdSave" runat="server" CssClass="dnnPrimaryAction" />
</li>
<li>
<asp:LinkButton ID="cmdCancel" resourcekey="cmdCancel" runat="server" CssClass="dnnSecondaryAction" CausesValidation="False" />
</li>
<li>
<a href="http://www.convertcsv.com/json-to-csv.htm" target="_blank">Convert to csv or Excel</a>
</li>
</ul>
</div>
<script type="text/javascript">
jQuery(function ($) {
var mimeType = dnn.getVar('mimeType') || "text/html";
var setupModule = function () {
var cm = CodeMirror.fromTextArea($("textarea[id$='txtSource']")[0], {
lineNumbers: true,
matchBrackets: true,
lineWrapping: true,
mode: 'application/json'
});
//var $modal = $("#iPopUp");
//$modal.css('height', window.innerHeight);
var resizeModule = function resizeDnnEditHtml() {
$('window.frameElement, body, html').css('overflow', 'hidden');
var containerHeight = $(window).height() - 18 - 52 - 52 - 18;
$('#dnnEditScript .CodeMirror').height(containerHeight);
cm.refresh();
};
if (window.frameElement && window.frameElement.id == "iPopUp") {
resizeModule();
$(window).resize(function () {
var timeout;
if (timeout) clearTimeout(timeout);
timeout = setTimeout(function () {
timeout = null;
resizeModule();
}, 50);
});
}
};
setupModule();
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function () {
// note that this will fire when _any_ UpdatePanel is triggered,
// which may or may not cause an issue
setupModule();
});
});
</script>