Initial Config Theme & File Store Changes

Update theme & remove dynatree requirement
This commit is contained in:
Gary Sharp
2014-04-13 20:19:02 +10:00
parent 41dc002ef8
commit a4f4b7d0b3
34 changed files with 1048 additions and 813 deletions
+120 -177
View File
@@ -1,8 +1,8 @@
@model Disco.Web.Models.InitialConfig.FileStoreModel
@{
ViewBag.Title = null;
Html.BundleDeferred("~/Style/jQueryUI/dynatree");
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-DynaTree");
Html.BundleDeferred("~/Style/Fancytree");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-Fancytree");
}
<h1>@CommonHelpers.Breadcrumbs(Html.ToBreadcrumb("Initial Configuration", MVC.InitialConfig.Index(), "File Store"))</h1>
<div id="initialConfig_FileStore">
@@ -37,213 +37,156 @@
</div>
}
</div>
<div id="dialogWait" title="Please Wait">
<div id="dialogWait" title="Please Wait" class="dialog">
<h2><span class="ajaxLoading"></span>Building and Validating File Store</h2>
<div>Please wait while the Disco File Store is created and/or validated</div>
</div>
<div id="dialogCreateDirectory" title="Create Directory">
<div id="dialogCreateDirectory" title="Create Directory" class="dialog">
<h2>Create Directory</h2>
<input type="text" id="createDirectoryName" />
<div>Parent: <span id="createDirectoryParent" class="code"></span></div>
</div>
<script>
(function () {
var tree = null;
var $tree = $('#treeFilesystem');
var $dialogCreateDirectory;
var fileSystemBranchUrl = '@(Url.Action(MVC.InitialConfig.FileStoreBranch()))';
var fileSystemInitialBranches = null;
var fileSystemBranchSelected = null;
var $treeFilesystem = $('#treeFilesystem');
var rootNodes = processNode(@(new HtmlString(Json.Encode(Model.DirectoryModel)))).children;
var nodeDataLoaded = function (node) {
var addedNodes = [];
var previousUpdateMode = node.tree.enableUpdate(false);
var descriptor = node.data.fileSystemDescriptor;
// Sub Folders
if (descriptor.SubDirectories) {
var hasSubDirectories = false;
for (var k in descriptor.SubDirectories) {
hasSubDirectories = true;
var d = descriptor.SubDirectories[k];
var n = node.addChild({ key: d.Path, title: d.IsNew ? d.Name + ' [New]' : d.Name, tooltip: d.Path, unselectable: !d.Selectable, addClass: 'directory', isLazy: true, isFolder: true, fileSystemDescriptor: d });
addedNodes.push(n);
if (d.SubDirectories) {
nodeDataLoaded(n);
}
}
if (!hasSubDirectories) {
// Leaf
node.data.isLazy = false;
if (!fileSystemInitialBranches)
node.render();
}
}
node.setLazyNodeStatus(DTNodeStatus_Ok);
node.tree.enableUpdate(previousUpdateMode);
return addedNodes;
function processNodes(nodes) {
return $.map(nodes, processNode);
}
function processNode(node) {
var children = null;
if (node.SubDirectories) {
children = $.map(node.SubDirectories, processNode);
}
return {
title: node.IsNew ? node.Name + ' [New]' : node.Name,
key: node.Path,
folder: true,
expanded: !!children,
unselectable: !node.Selectable,
tooltip: node.Path,
children: children,
lazy: !children
};
}
var loadNodeData = function (node) {
var descriptor = node.data.fileSystemDescriptor;
if (!descriptor.SubDirectories) {
$.ajax({
tree = $tree.fancytree({
source: rootNodes,
checkbox: false,
selectMode: 1,
keyboard: false,
lazyload: function (e, data) {
var node = data.node;
data.result = {
url: fileSystemBranchUrl,
dataType: 'json',
data: { Path: descriptor.Path },
success: function (data) {
node.data.fileSystemDescriptor = data;
return nodeDataLoaded(node);
},
error: function () {
alert('Unable to access this path: ' + descriptor.Path);
node.remove();
}
})
} else {
return nodeDataLoaded(node);
}
}
var lazyLoadNode = function (node) {
if (node.data.fileSystemDescriptor) {
node.setLazyNodeStatus(DTNodeStatus_Loading);
loadNodeData(node);
} else {
node.setLazyNodeStatus(DTNodeStatus_Ok);
}
}
var activeNodeUpdated = function () {
var activeNode = $("#treeFilesystem").dynatree("getActiveNode");
data: { Path: node.key },
cache: false
}
},
postProcess: function (e, data) {
data.result = processNode(data.response).children;
},
activate: function (e, data) {
var node = data.node;
if (activeNode !== null) {
fileSystemBranchSelected = activeNode.data.fileSystemDescriptor;
} else {
fileSystemBranchSelected = null
}
if (fileSystemBranchSelected !== null) {
$('#locationPath').text(fileSystemBranchSelected.Path);
$('#createDirectory').attr('disabled', false);
if (fileSystemBranchSelected.Selectable) {
$('#submitForm').attr('disabled', false);
$('#locationPathInvalid').hide();
} else {
$('#submitForm').attr('disabled', true);
if (node.unselectable) {
$('#submitForm').prop('disabled', true);
$('#locationPathInvalid').show();
}
} else {
$('#createDirectory').attr('disabled', true);
$('#submitForm').attr('disabled', true);
$('#locationPath').text('<None>');
$('#locationPathInvalid').show();
}
}
var scrollToNode = function (node) {
var $li = $(node.li);
var $treeRoot = $($treeFilesystem.dynatree('getRoot').ul);
var ih = $li.height();
var th = $treeRoot.height();
var ts = $treeRoot.scrollTop();
var is = $li.position().top;
if ((ih + is) > th) {
if (ih > th) {
$treeRoot.animate({ 'scrollTop': (is + ts) }, 'fast');
} else {
$treeRoot.animate({ 'scrollTop': (ih + is + ts - th) }, 'fast');
$('#submitForm').prop('disabled', false);
$('#locationPathInvalid').hide();
}
$('#createDirectory').prop('disabled', false);
$('#locationPath').text(node.key);
}
}).fancytree('getTree');
var initalValue = $('#FileStoreLocation').val();
if (initalValue) {
var initialNode = tree.getNodeByKey(initalValue);
if (initialNode) {
initialNode.setActive(true);
}
}
var nodeExpanded = function (flag, node) {
if (flag)
window.setTimeout(function () { scrollToNode(node); }, 1);
}
var nodeDeactivated = function () {
activeNodeUpdated();
}
var nodeActivated = function (node) {
activeNodeUpdated();
nodeExpanded(true, node);
}
$(function () {
$('#dialogWait').dialog({
autoOpen: false,
draggable: false,
modal: true,
resizable: false,
width: 400,
height: 150,
closeOnEscape: false
}).closest('.ui-dialog').find('.ui-dialog-titlebar-close').hide();
$('#createDirectory').click(function () {
if (!$(this).prop('disabled')) {
$('#dialogCreateDirectory').dialog({
autoOpen: false,
draggable: false,
modal: true,
resizable: false,
width: 400,
height: 180,
buttons: {
'Cancel': function () {
$('#dialogCreateDirectory').dialog('close');
},
'Create Directory': function () {
var activeNode = $("#treeFilesystem").dynatree("getActiveNode");
if (activeNode) {
var name = $('#createDirectoryName').val();
d = {
Name: name,
Path: fileSystemBranchSelected.Path.charAt(fileSystemBranchSelected.Path.length - 1) === '\\' ? fileSystemBranchSelected.Path + name : fileSystemBranchSelected.Path + '\\' + name,
IsNew: true,
Selectable: true,
SubDirectories: {}
// Create Dialog
if (!$dialogCreateDirectory) {
$('#dialogCreateDirectory').dialog({
autoOpen: false,
draggable: false,
modal: true,
resizable: false,
width: 400,
height: 200,
buttons: {
'Cancel': function () {
$('#dialogCreateDirectory').dialog('close');
},
'Create Directory': function () {
var dirName = $('#createDirectoryName').val();
if (!!dirName) {
var activeNode = tree.getActiveNode();
if (activeNode) {
var parentPath = activeNode.key;
var path = parentPath.charAt(parentPath.length - 1) === '\\' ? parentPath + dirName : parentPath + '\\' + dirName;
node = {
title: dirName + ' [New]',
key: path,
folder: true,
expanded: false,
unselectable: false,
tooltip: path,
lazy: false
}
activeNode.addNode(node).setActive(true);
}
}
$('#dialogCreateDirectory').dialog('close');
}
activeNode.addChild({ title: d.Name + ' [New]', tooltip: d.Path, unselectable: !d.Selectable, addClass: 'newDirectory', isLazy: false, isFolder: true, fileSystemDescriptor: d }).activate();
}
$('#dialogCreateDirectory').dialog('close');
}
})
}
})
$('#createDirectory').click(function () {
if (fileSystemBranchSelected) {
var activeNode = tree.getActiveNode();
if (activeNode) {
$('#dialogCreateDirectory').dialog('open');
$('#createDirectoryName').val('').focus();
$('#createDirectoryParent').text(fileSystemBranchSelected.Path);
$('#createDirectoryParent').text(activeNode.key);
}
return false;
});
$('#submitForm').closest('form').submit(function () {
if (fileSystemBranchSelected && fileSystemBranchSelected.Selectable) {
if ($(this).valid()) {
$('#dialogWait').dialog('open');
$('#FileStoreLocation').val(fileSystemBranchSelected.Path);
}
return true;
} else {
alert('Invalid FileStore Location');
return false;
}
});
$treeFilesystem.dynatree({ onLazyRead: lazyLoadNode, onActivate: nodeActivated, onDeactivate: nodeDeactivated, onExpand: nodeExpanded });
var rootNode = $treeFilesystem.dynatree('getRoot');
var previousUpdateMode = rootNode.tree.enableUpdate(false);
rootNode.data.fileSystemDescriptor = fileSystemInitialBranches[0];
loadNodeData(rootNode);
rootNode.tree.enableUpdate(previousUpdateMode);
var initialValue = $('#FileStoreLocation').val();
if (initialValue) {
var initialNode = rootNode.tree.getNodeByKey(initialValue);
if (initialNode)
initialNode.activate();
}
fileSystemInitialBranches = null;
});
fileSystemInitialBranches = [@(new HtmlString(Json.Encode(Model.DirectoryModel)))];
$('#submitForm').closest('form').submit(function () {
var activeNode = tree.getActiveNode();
if (activeNode && !activeNode.unselectable) {
$('#FileStoreLocation').val(activeNode.key);
if ($(this).valid()) {
$('#dialogWait').dialog({
autoOpen: true,
draggable: false,
modal: true,
resizable: false,
width: 400,
height: 150,
closeOnEscape: false
}).closest('.ui-dialog').find('.ui-dialog-titlebar-close').hide();
}
return true;
} else {
alert('Invalid FileStore Location');
return false;
}
});
})();
</script>
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34011
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -48,8 +48,8 @@ namespace Disco.Web.Views.InitialConfig
#line 2 "..\..\Views\InitialConfig\FileStore.cshtml"
ViewBag.Title = null;
Html.BundleDeferred("~/Style/jQueryUI/dynatree");
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-DynaTree");
Html.BundleDeferred("~/Style/Fancytree");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-Fancytree");
#line default
@@ -179,6 +179,8 @@ WriteLiteral(" id=\"dialogWait\"");
WriteLiteral(" title=\"Please Wait\"");
WriteLiteral(" class=\"dialog\"");
WriteLiteral(">\r\n <h2><span");
WriteLiteral(" class=\"ajaxLoading\"");
@@ -190,6 +192,8 @@ WriteLiteral(" id=\"dialogCreateDirectory\"");
WriteLiteral(" title=\"Create Directory\"");
WriteLiteral(" class=\"dialog\"");
WriteLiteral(">\r\n <h2>Create Directory</h2>\r\n <input");
WriteLiteral(" type=\"text\"");
@@ -202,130 +206,95 @@ WriteLiteral(" id=\"createDirectoryParent\"");
WriteLiteral(" class=\"code\"");
WriteLiteral("></span></div>\r\n</div>\r\n<script>\r\n (function () {\r\n var fileSystemBranc" +
"hUrl = \'");
WriteLiteral("></span></div>\r\n</div>\r\n<script>\r\n (function () {\r\n var tree = null;\r\n " +
" var $tree = $(\'#treeFilesystem\');\r\n var $dialogCreateDirectory;\r\n " +
" var fileSystemBranchUrl = \'");
#line 51 "..\..\Views\InitialConfig\FileStore.cshtml"
#line 54 "..\..\Views\InitialConfig\FileStore.cshtml"
Write(Url.Action(MVC.InitialConfig.FileStoreBranch()));
#line default
#line hidden
WriteLiteral("\';\r\n var fileSystemInitialBranches = null;\r\n var fileSystemBranchSe" +
"lected = null;\r\n var $treeFilesystem = $(\'#treeFilesystem\');\r\n\r\n v" +
"ar nodeDataLoaded = function (node) {\r\n var addedNodes = [];\r\n " +
" var previousUpdateMode = node.tree.enableUpdate(false);\r\n var de" +
"scriptor = node.data.fileSystemDescriptor;\r\n // Sub Folders\r\n " +
" if (descriptor.SubDirectories) {\r\n var hasSubDirectories = fa" +
"lse;\r\n for (var k in descriptor.SubDirectories) {\r\n " +
" hasSubDirectories = true;\r\n var d = descriptor.SubDirec" +
"tories[k];\r\n var n = node.addChild({ key: d.Path, title: d.Is" +
"New ? d.Name + \' [New]\' : d.Name, tooltip: d.Path, unselectable: !d.Selectable, " +
"addClass: \'directory\', isLazy: true, isFolder: true, fileSystemDescriptor: d });" +
"\r\n addedNodes.push(n);\r\n\r\n if (d.SubDirect" +
"ories) {\r\n nodeDataLoaded(n);\r\n }\r\n " +
" }\r\n if (!hasSubDirectories) {\r\n /" +
"/ Leaf\r\n node.data.isLazy = false;\r\n if (!" +
"fileSystemInitialBranches)\r\n node.render();\r\n " +
" }\r\n }\r\n node.setLazyNodeStatus(DTNodeStatus_Ok);\r\n " +
" node.tree.enableUpdate(previousUpdateMode);\r\n return addedNod" +
"es;\r\n }\r\n var loadNodeData = function (node) {\r\n var de" +
"scriptor = node.data.fileSystemDescriptor;\r\n\r\n if (!descriptor.SubDir" +
"ectories) {\r\n $.ajax({\r\n url: fileSystemBranch" +
"Url,\r\n dataType: \'json\',\r\n data: { Path: d" +
"escriptor.Path },\r\n success: function (data) {\r\n " +
" node.data.fileSystemDescriptor = data;\r\n retur" +
"n nodeDataLoaded(node);\r\n },\r\n error: func" +
"tion () {\r\n alert(\'Unable to access this path: \' + descri" +
"ptor.Path);\r\n node.remove();\r\n }\r\n " +
" })\r\n } else {\r\n return nodeDataLoaded(node" +
");\r\n }\r\n }\r\n var lazyLoadNode = function (node) {\r\n " +
" if (node.data.fileSystemDescriptor) {\r\n node.setLazyNodeS" +
"tatus(DTNodeStatus_Loading);\r\n loadNodeData(node);\r\n }" +
" else {\r\n node.setLazyNodeStatus(DTNodeStatus_Ok);\r\n }" +
"\r\n }\r\n var activeNodeUpdated = function () {\r\n var acti" +
"veNode = $(\"#treeFilesystem\").dynatree(\"getActiveNode\");\r\n\r\n if (acti" +
"veNode !== null) {\r\n fileSystemBranchSelected = activeNode.data.f" +
"ileSystemDescriptor;\r\n } else {\r\n fileSystemBranchSele" +
"cted = null\r\n }\r\n\r\n if (fileSystemBranchSelected !== null)" +
" {\r\n $(\'#locationPath\').text(fileSystemBranchSelected.Path);\r\n " +
" $(\'#createDirectory\').attr(\'disabled\', false);\r\n if " +
"(fileSystemBranchSelected.Selectable) {\r\n $(\'#submitForm\').at" +
"tr(\'disabled\', false);\r\n $(\'#locationPathInvalid\').hide();\r\n " +
" } else {\r\n $(\'#submitForm\').attr(\'disabled\', t" +
"rue);\r\n $(\'#locationPathInvalid\').show();\r\n }\r" +
"\n } else {\r\n $(\'#createDirectory\').attr(\'disabled\', tr" +
"ue);\r\n $(\'#submitForm\').attr(\'disabled\', true);\r\n " +
"$(\'#locationPath\').text(\'<None>\');\r\n $(\'#locationPathInvalid\').sh" +
"ow();\r\n }\r\n }\r\n var scrollToNode = function (node) {\r\n " +
" var $li = $(node.li);\r\n var $treeRoot = $($treeFilesystem." +
"dynatree(\'getRoot\').ul);\r\n var ih = $li.height();\r\n var th" +
" = $treeRoot.height();\r\n var ts = $treeRoot.scrollTop();\r\n " +
" var is = $li.position().top;\r\n if ((ih + is) > th) {\r\n " +
" if (ih > th) {\r\n $treeRoot.animate({ \'scrollTop\': (is + ts)" +
" }, \'fast\');\r\n } else {\r\n $treeRoot.animate({ " +
"\'scrollTop\': (ih + is + ts - th) }, \'fast\');\r\n }\r\n }\r\n" +
" }\r\n var nodeExpanded = function (flag, node) {\r\n if (f" +
"lag)\r\n window.setTimeout(function () { scrollToNode(node); }, 1);" +
"\r\n }\r\n var nodeDeactivated = function () {\r\n activeNode" +
"Updated();\r\n }\r\n var nodeActivated = function (node) {\r\n " +
" activeNodeUpdated();\r\n nodeExpanded(true, node);\r\n }\r\n\r\n " +
" $(function () {\r\n $(\'#dialogWait\').dialog({\r\n auto" +
"Open: false,\r\n draggable: false,\r\n modal: true,\r\n " +
" resizable: false,\r\n width: 400,\r\n h" +
"eight: 150,\r\n closeOnEscape: false\r\n }).closest(\'.ui-d" +
"ialog\').find(\'.ui-dialog-titlebar-close\').hide();\r\n\r\n $(\'#dialogCreat" +
"eDirectory\').dialog({\r\n autoOpen: false,\r\n draggab" +
"le: false,\r\n modal: true,\r\n resizable: false,\r\n " +
" width: 400,\r\n height: 180,\r\n buttons:" +
" {\r\n \'Cancel\': function () {\r\n $(\'#dia" +
"logCreateDirectory\').dialog(\'close\');\r\n },\r\n " +
" \'Create Directory\': function () {\r\n var activeNode = $" +
"(\"#treeFilesystem\").dynatree(\"getActiveNode\");\r\n if (acti" +
"veNode) {\r\n var name = $(\'#createDirectoryName\').val(" +
");\r\n d = {\r\n Name: nam" +
"e,\r\n Path: fileSystemBranchSelected.Path.charAt(f" +
"ileSystemBranchSelected.Path.length - 1) === \'\\\\\' ? fileSystemBranchSelected.Pat" +
"h + name : fileSystemBranchSelected.Path + \'\\\\\' + name,\r\n " +
" IsNew: true,\r\n Selectable: true,\r\n " +
" SubDirectories: {}\r\n }\r\n " +
" activeNode.addChild({ title: d.Name + \' [New]\', tooltip" +
": d.Path, unselectable: !d.Selectable, addClass: \'newDirectory\', isLazy: false, " +
"isFolder: true, fileSystemDescriptor: d }).activate();\r\n " +
"}\r\n $(\'#dialogCreateDirectory\').dialog(\'close\');\r\n " +
" }\r\n }\r\n })\r\n\r\n $(\'#createDirec" +
"tory\').click(function () {\r\n if (fileSystemBranchSelected) {\r\n " +
" $(\'#dialogCreateDirectory\').dialog(\'open\');\r\n " +
" $(\'#createDirectoryName\').val(\'\').focus();\r\n $(\'#createDire" +
"ctoryParent\').text(fileSystemBranchSelected.Path);\r\n }\r\n " +
" return false;\r\n });\r\n\r\n $(\'#submitForm\').closest(\'f" +
"orm\').submit(function () {\r\n if (fileSystemBranchSelected && file" +
"SystemBranchSelected.Selectable) {\r\n if ($(this).valid()) {\r\n" +
" $(\'#dialogWait\').dialog(\'open\');\r\n " +
" $(\'#FileStoreLocation\').val(fileSystemBranchSelected.Path);\r\n " +
" }\r\n return true;\r\n } else {\r\n " +
" alert(\'Invalid FileStore Location\');\r\n return false;\r\n " +
" }\r\n });\r\n\r\n $treeFilesystem.dynatree({ onLa" +
"zyRead: lazyLoadNode, onActivate: nodeActivated, onDeactivate: nodeDeactivated, " +
"onExpand: nodeExpanded });\r\n var rootNode = $treeFilesystem.dynatree(" +
"\'getRoot\');\r\n\r\n var previousUpdateMode = rootNode.tree.enableUpdate(f" +
"alse);\r\n rootNode.data.fileSystemDescriptor = fileSystemInitialBranch" +
"es[0];\r\n loadNodeData(rootNode);\r\n rootNode.tree.enableUpd" +
"ate(previousUpdateMode);\r\n\r\n var initialValue = $(\'#FileStoreLocation" +
"\').val();\r\n if (initialValue) {\r\n var initialNode = ro" +
"otNode.tree.getNodeByKey(initialValue);\r\n if (initialNode)\r\n " +
" initialNode.activate();\r\n }\r\n\r\n fileSystemI" +
"nitialBranches = null;\r\n });\r\n\r\n\r\n fileSystemInitialBranches = [");
WriteLiteral("\';\r\n var rootNodes = processNode(");
#line 247 "..\..\Views\InitialConfig\FileStore.cshtml"
Write(new HtmlString(Json.Encode(Model.DirectoryModel)));
#line 55 "..\..\Views\InitialConfig\FileStore.cshtml"
Write(new HtmlString(Json.Encode(Model.DirectoryModel)));
#line default
#line hidden
WriteLiteral("];\r\n })();\r\n</script>\r\n");
WriteLiteral(").children;\r\n\r\n function processNodes(nodes) {\r\n return $.map(n" +
"odes, processNode);\r\n }\r\n function processNode(node) {\r\n " +
" var children = null;\r\n if (node.SubDirectories) {\r\n " +
"children = $.map(node.SubDirectories, processNode);\r\n }\r\n " +
"return {\r\n title: node.IsNew ? node.Name + \' [New]\' : node.Name,\r" +
"\n key: node.Path,\r\n folder: true,\r\n " +
" expanded: !!children,\r\n unselectable: !node.Selectable,\r\n " +
" tooltip: node.Path,\r\n children: children,\r\n " +
" lazy: !children\r\n };\r\n }\r\n\r\n tree = $tree.fancytree(" +
"{\r\n source: rootNodes,\r\n checkbox: false,\r\n sel" +
"ectMode: 1,\r\n keyboard: false,\r\n lazyload: function (e, da" +
"ta) {\r\n var node = data.node;\r\n data.result = {\r\n " +
" url: fileSystemBranchUrl,\r\n data: { Path: " +
"node.key },\r\n cache: false\r\n }\r\n }," +
"\r\n postProcess: function (e, data) {\r\n data.result = p" +
"rocessNode(data.response).children;\r\n },\r\n activate: funct" +
"ion (e, data) {\r\n var node = data.node;\r\n\r\n if (no" +
"de.unselectable) {\r\n $(\'#submitForm\').prop(\'disabled\', true);" +
"\r\n $(\'#locationPathInvalid\').show();\r\n } else " +
"{\r\n $(\'#submitForm\').prop(\'disabled\', false);\r\n " +
" $(\'#locationPathInvalid\').hide();\r\n }\r\n\r\n $(" +
"\'#createDirectory\').prop(\'disabled\', false);\r\n $(\'#locationPath\')" +
".text(node.key);\r\n\r\n }\r\n }).fancytree(\'getTree\');\r\n\r\n v" +
"ar initalValue = $(\'#FileStoreLocation\').val();\r\n if (initalValue) {\r\n " +
" var initialNode = tree.getNodeByKey(initalValue);\r\n if (init" +
"ialNode) {\r\n initialNode.setActive(true);\r\n }\r\n " +
" }\r\n\r\n $(\'#createDirectory\').click(function () {\r\n if (!$(this" +
").prop(\'disabled\')) {\r\n\r\n // Create Dialog\r\n if (!" +
"$dialogCreateDirectory) {\r\n $(\'#dialogCreateDirectory\').dialo" +
"g({\r\n autoOpen: false,\r\n draggable" +
": false,\r\n modal: true,\r\n resizabl" +
"e: false,\r\n width: 400,\r\n height: " +
"200,\r\n buttons: {\r\n \'Cancel\': " +
"function () {\r\n $(\'#dialogCreateDirectory\').dialo" +
"g(\'close\');\r\n },\r\n \'Create" +
" Directory\': function () {\r\n var dirName = $(\'#cr" +
"eateDirectoryName\').val();\r\n if (!!dirName) {\r\n " +
" var activeNode = tree.getActiveNode();\r\n " +
" if (activeNode) {\r\n " +
" var parentPath = activeNode.key;\r\n " +
" var path = parentPath.charAt(parentPath.length - 1) === \'\\\\\' ? parentPath + d" +
"irName : parentPath + \'\\\\\' + dirName;\r\n n" +
"ode = {\r\n title: dirName + \' [New]\',\r" +
"\n key: path,\r\n " +
" folder: true,\r\n " +
"expanded: false,\r\n unselectable: fals" +
"e,\r\n tooltip: path,\r\n " +
" lazy: false\r\n " +
" }\r\n activeNode.addNode(node).setActive(t" +
"rue);\r\n }\r\n }\r" +
"\n $(\'#dialogCreateDirectory\').dialog(\'close\');\r\n " +
" }\r\n }\r\n })\r" +
"\n }\r\n\r\n var activeNode = tree.getActiveNode();\r\n " +
" if (activeNode) {\r\n $(\'#dialogCreateDirectory\')" +
".dialog(\'open\');\r\n $(\'#createDirectoryName\').val(\'\').focus();" +
"\r\n $(\'#createDirectoryParent\').text(activeNode.key);\r\n " +
" }\r\n\r\n return false;\r\n }\r\n });\r\n\r\n " +
" $(\'#submitForm\').closest(\'form\').submit(function () {\r\n var active" +
"Node = tree.getActiveNode();\r\n if (activeNode && !activeNode.unselect" +
"able) {\r\n $(\'#FileStoreLocation\').val(activeNode.key);\r\n " +
" if ($(this).valid()) {\r\n $(\'#dialogWait\').dialog({\r\n " +
" autoOpen: true,\r\n draggable: false," +
"\r\n modal: true,\r\n resizable: false" +
",\r\n width: 400,\r\n height: 150,\r\n " +
" closeOnEscape: false\r\n }).closest(\'.ui-" +
"dialog\').find(\'.ui-dialog-titlebar-close\').hide();\r\n }\r\n " +
" return true;\r\n } else {\r\n alert(\'Invalid FileSt" +
"ore Location\');\r\n return false;\r\n }\r\n });\r\n " +
"})();\r\n</script>\r\n");
}
}
@@ -1,35 +0,0 @@
@{
Html.BundleDeferred("~/Style/Site");
Html.BundleDeferred("~/ClientScripts/Core");
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Disco@{if(ViewBag.Title != null){<text> - @CommonHelpers.BreadcrumbsTitle(ViewBag.Title)</text>}}</title>
@Html.BundleRenderDeferred()
@RenderSection("head", false)
</head>
<body class="layout">
<div class="page">
<header>
<div class="clearfix">
<div id="heading">
<a href="@Url.Action(MVC.Public.Public.Index())">
<img src="@Links.ClientSource.Style.Images.Heading_png" alt="DISCO - ICT Asset Management" /></a>
</div>
<div id="headerMenu">
</div>
</div>
</header>
@if(ViewBag.Title != null){<div id="layout_PageHeading">@CommonHelpers.Breadcrumbs(ViewBag.Title)</div>}
<section id="layout_Page">
@RenderBody()
</section>
<footer>
Disco v@(Disco.Web.DiscoApplication.Version)
</footer>
</div>
</body>
</html>
@@ -1,222 +0,0 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34011
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.InitialConfig
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Routing;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
using Disco;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/InitialConfig/_Layout.cshtml")]
public partial class Layout : Disco.Services.Web.WebViewPage<dynamic>
{
public Layout()
{
}
public override void Execute()
{
#line 1 "..\..\Views\InitialConfig\_Layout.cshtml"
Html.BundleDeferred("~/Style/Site");
Html.BundleDeferred("~/ClientScripts/Core");
#line default
#line hidden
WriteLiteral("\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n <meta");
WriteLiteral(" charset=\"utf-8\"");
WriteLiteral(" />\r\n <meta");
WriteLiteral(" http-equiv=\"X-UA-Compatible\"");
WriteLiteral(" content=\"IE=edge\"");
WriteLiteral(" />\r\n <title>Disco");
#line 10 "..\..\Views\InitialConfig\_Layout.cshtml"
if(ViewBag.Title != null){
#line default
#line hidden
WriteLiteral(" - ");
#line 10 "..\..\Views\InitialConfig\_Layout.cshtml"
Write(CommonHelpers.BreadcrumbsTitle(ViewBag.Title));
#line default
#line hidden
#line 10 "..\..\Views\InitialConfig\_Layout.cshtml"
}
#line default
#line hidden
WriteLiteral("</title>\r\n");
WriteLiteral(" ");
#line 11 "..\..\Views\InitialConfig\_Layout.cshtml"
Write(Html.BundleRenderDeferred());
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 12 "..\..\Views\InitialConfig\_Layout.cshtml"
Write(RenderSection("head", false));
#line default
#line hidden
WriteLiteral("\r\n</head>\r\n<body");
WriteLiteral(" class=\"layout\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"page\"");
WriteLiteral(">\r\n <header>\r\n <div");
WriteLiteral(" class=\"clearfix\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" id=\"heading\"");
WriteLiteral(">\r\n <a");
WriteAttribute("href", Tuple.Create(" href=\"", 578), Tuple.Create("\"", 623)
#line 19 "..\..\Views\InitialConfig\_Layout.cshtml"
, Tuple.Create(Tuple.Create("", 585), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Public.Public.Index())
#line default
#line hidden
, 585), false)
);
WriteLiteral(">\r\n <img");
WriteAttribute("src", Tuple.Create(" src=\"", 655), Tuple.Create("\"", 705)
#line 20 "..\..\Views\InitialConfig\_Layout.cshtml"
, Tuple.Create(Tuple.Create("", 661), Tuple.Create<System.Object, System.Int32>(Links.ClientSource.Style.Images.Heading_png
#line default
#line hidden
, 661), false)
);
WriteLiteral(" alt=\"DISCO - ICT Asset Management\"");
WriteLiteral(" /></a>\r\n </div>\r\n <div");
WriteLiteral(" id=\"headerMenu\"");
WriteLiteral(">\r\n </div>\r\n </div>\r\n </header>\r\n");
#line 26 "..\..\Views\InitialConfig\_Layout.cshtml"
#line default
#line hidden
#line 26 "..\..\Views\InitialConfig\_Layout.cshtml"
if(ViewBag.Title != null){
#line default
#line hidden
WriteLiteral("<div");
WriteLiteral(" id=\"layout_PageHeading\"");
WriteLiteral(">");
#line 26 "..\..\Views\InitialConfig\_Layout.cshtml"
Write(CommonHelpers.Breadcrumbs(ViewBag.Title));
#line default
#line hidden
WriteLiteral("</div>");
#line 26 "..\..\Views\InitialConfig\_Layout.cshtml"
}
#line default
#line hidden
WriteLiteral(" <section");
WriteLiteral(" id=\"layout_Page\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 28 "..\..\Views\InitialConfig\_Layout.cshtml"
Write(RenderBody());
#line default
#line hidden
WriteLiteral("\r\n </section>\r\n <footer>\r\n Disco v");
#line 31 "..\..\Views\InitialConfig\_Layout.cshtml"
Write(Disco.Web.DiscoApplication.Version);
#line default
#line hidden
WriteLiteral("\r\n </footer>\r\n </div>\r\n</body>\r\n</html>");
}
}
}
#pragma warning restore 1591
@@ -1,4 +1,5 @@
@{
Layout = MVC.InitialConfig.Views._Layout;
ViewContext.ViewBag.IsInitialConfig = true;
Layout = MVC.Shared.Views._PublicLayout;
Html.BundleDeferred("~/Style/InitialConfig");
}
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34011
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -47,7 +47,8 @@ namespace Disco.Web.Views.InitialConfig
#line 1 "..\..\Views\InitialConfig\_ViewStart.cshtml"
Layout = MVC.InitialConfig.Views._Layout;
ViewContext.ViewBag.IsInitialConfig = true;
Layout = MVC.Shared.Views._PublicLayout;
Html.BundleDeferred("~/Style/InitialConfig");