Heres the entire script block...
<script type=
"text/javascript"
>
$(document).ready(
function
() {
$(
'#AdminMenu'
).load(
"AdminMenu.html"
);
$(
function
() {
$(
'#file_upload'
).kendoUpload({
complete:
function
() {
$(
".k-upload-files.k-reset"
).remove();
alert(
"File Uploaded"
);
},
localization: {
"select"
:
"Browse..."
},
async: {
saveUrl:
"/PHP/Focus-Upload.php"
,
removeUrl:
"/PHP/Focus-Remove.php"
,
autoUpload:
true
}
});
});
var
splitter = $(
"#vertical"
).kendoSplitter({
orientation:
"horizontal"
,
panes: [{
size:
"40%"
,
scrollable:
true
,
}, {
size:
"60%"
,
scrollable:
true
,
}]
});
$(
'.files'
).click(
function
() {
$(
'#sideRight'
).empty();
var
file = $(
this
).attr(
'path'
);
$(
'#sideRight'
).prepend(
'<div class="options_title" style="width:50%; position:relative; left:25%; text-align:center;">You are viewing: <BR><span style="font-style:italic;">'
+file+
'</span></div>'
);
$(
'#sideRight'
).append(
'<div style="position:absolute;left:5%; top:15%;"><button id="delete_file">Delete Item</button> <button id="get_link">Get Link</button></div> '
);
$(
'#get_link'
).click(
function
() {
alert(
'http://'
+locationID+
'.leeschools.net/'
+file);
});
$(
'#delete_file'
).click(
function
() {
$.ajax({
type:
"POST"
,
contentType:
"application/json; charset=utf-8"
,
url:
"../PHP/DeleteUserContent.php?file="
+file,
datatype:
"json"
,
success:
function
() {
location.reload();
},
error:
function
() {
alert(
"fail"
);
}
});
});
});
$(
'.folders'
).click(
function
() {
$(
'#sideRight'
).empty();
var
file = $(
this
).attr(
'path'
);
$(
'#sideRight'
).prepend(
'<div class="options_title" style="width:50%; position:relative; left:25%; text-align:center;">You are viewing: <BR><span style="font-style:italic;">'
+file+
'</span></div>'
);
$(
'#sideRight'
).append(
'<div style="position:absolute;left:5%; top:15%;"> <button id="delete_folder">Delete Folder</button> <button id="create_folder">Create Folder</button> <button id="upload_content">Upload Content</button></div>'
);
$(
'#delete_folder'
).click(
function
() {
$.ajax({
type:
"POST"
,
contentType:
"application/json; charset=utf-8"
,
url:
"../PHP/DeleteUserContent.php?file="
+file,
datatype:
"json"
,
success:
function
() {
location.reload();
},
error:
function
() {
alert(
"fail"
);
}
});
});
$(
'#create_folder'
).click(
function
() {
$(
'#sideRight'
).append(
'<div style="position:absolute;left:5%; top:25%;">Folder Name: <input type="text" class="k-textbox" id="FileToMake"> <button id="create_me">Create</button></div>'
);
$(
'#create_me'
).click(
function
() {
var
F2M = $(
'#FileToMake'
).val();
var
path = file+
"/"
+F2M;
$.ajax({
type:
"POST"
,
contentType:
"application/json; charset=utf-8"
,
url:
"../PHP/CreateUserContent.php?file="
+path,
datatype:
"json"
,
success:
function
() {
location.reload();
},
error:
function
() {
alert(
"fail"
);
}
});
});
});
});
$(
'.root_element'
).click(
function
() {
$(
'#sideRight'
).empty();
var
file = $(
this
).attr(
'path'
);
$(
'#sideRight'
).prepend(
'<div class="options_title" style="width:50%;position:relative; left:25%; text-align:center;">You are viewing: <BR><span style="font-style:italic;">'
+file+
'</span></div>'
);
$(
'#sideRight'
).append(
'<div style="position:absolute;left:5%; top:15%;"><button id="create_folder">Create Folder</button> <button id="upload_content">Upload Content</button></div>'
);
$(
'#create_folder'
).click(
function
() {
$(
'#sideRight'
).append(
'<div style="position:absolute;left:5%; top:25%;">Folder Name: <input type="text" class="k-textbox" id="FileToMake"> <button id="create_me">Create</button></div>'
);
$(
'#create_me'
).click(
function
() {
var
F2M = $(
'#FileToMake'
).val();
var
path = file+
"/"
+F2M;
$.ajax({
type:
"POST"
,
contentType:
"application/json; charset=utf-8"
,
url:
"../PHP/CreateUserContent.php?file="
+path,
datatype:
"json"
,
success:
function
() {
alert(
"success"
);
location.reload();
},
error:
function
() {
alert(
"fail"
);
}
});
});
});
$(
'#upload_content'
).click(
function
() {
$(
'#sideRight'
).append(
'<div class="fileupload" style="position:absolute;left:5%; top:35%;"><input id="file_upload" name="file_upload" type="file"></div>'
);
});
});
});
</script>