2011-07-01 23:59:25 +03:00
|
|
|
<span>
|
2011-07-01 10:23:07 +03:00
|
|
|
<input id="rootDirInput" type="text" style="width: 400px" />
|
|
|
|
<button id="saveDir">
|
|
|
|
Add</button>
|
2011-07-01 23:59:25 +03:00
|
|
|
</span>
|
|
|
|
<span id="rootDirs">
|
2011-07-01 10:23:07 +03:00
|
|
|
@{Html.RenderAction("RootList");}
|
2011-07-01 23:59:25 +03:00
|
|
|
</span>
|
2011-06-30 09:15:06 +03:00
|
|
|
<script type="text/javascript">
|
2011-05-31 09:13:46 +03:00
|
|
|
|
2011-07-01 23:28:53 +03:00
|
|
|
jQuery(document).ready(function() {
|
2011-07-01 10:52:44 +03:00
|
|
|
$.ajaxSetup({
|
2011-07-01 23:28:53 +03:00
|
|
|
cache: false
|
|
|
|
});
|
|
|
|
|
|
|
|
bindFolderAutoComplete('#rootDirInput');
|
2011-07-01 10:52:44 +03:00
|
|
|
|
2011-07-01 10:23:07 +03:00
|
|
|
$('#rootDirInput').watermark('Start typing to add new root folder...');
|
|
|
|
|
|
|
|
$('#rootDirs .actionButton img').live('click',
|
2011-07-01 23:28:53 +03:00
|
|
|
function(image) {
|
2011-07-02 00:19:52 +03:00
|
|
|
var path = $(image.target).attr('id');
|
2011-07-01 23:28:53 +03:00
|
|
|
$.post('@Url.Action("DeleteRootDir", "AddSeries")', { Path: path }, function() {
|
2011-07-01 10:23:07 +03:00
|
|
|
refreshRoot();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2011-06-30 09:15:06 +03:00
|
|
|
$('#saveDir').click(saveRootDir);
|
2011-06-09 04:45:06 +03:00
|
|
|
|
2011-06-30 09:15:06 +03:00
|
|
|
function saveRootDir() {
|
|
|
|
var path = $("#rootDirInput").val();
|
2011-07-01 23:28:53 +03:00
|
|
|
$.post('@Url.Action("SaveRootDir", "AddSeries")', { Path: path }, function() {
|
2011-07-01 10:23:07 +03:00
|
|
|
refreshRoot();
|
|
|
|
$("#rootDirInput").val('');
|
|
|
|
});
|
|
|
|
|
2011-06-30 09:15:06 +03:00
|
|
|
}
|
2011-06-09 04:45:06 +03:00
|
|
|
|
2011-05-31 09:13:46 +03:00
|
|
|
|
2011-07-01 10:23:07 +03:00
|
|
|
function refreshRoot() {
|
2011-07-01 23:28:53 +03:00
|
|
|
$.get('@Url.Action("RootList", "AddSeries")', function(data) {
|
2011-07-01 10:23:07 +03:00
|
|
|
$('#rootDirs').html(data);
|
2011-06-30 09:15:06 +03:00
|
|
|
});
|
2011-07-01 10:23:07 +03:00
|
|
|
}
|
2011-07-01 23:28:53 +03:00
|
|
|
});
|
2011-06-30 09:15:06 +03:00
|
|
|
|
|
|
|
</script>
|