123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248 |
-
- Namespace.register("U.MD.DK.RM");
- U.MD.DK.RM.rightMenu = function (el, fileordir, diskinfo) {
- var _ids,
- _diskinfo = diskinfo || US.disk.UserDisk,
- _selectElement = diskinfo.selectElement,
- _userid = _diskinfo.userInfo.UserId,
- _fileordir = fileordir || U.Json.select(_diskinfo.directoryOrFiles, { "UserDirectoryID": _diskinfo.directoryid })[0],
- _permissions = U.MD.DK.C.getDirectoryPermissions(_fileordir.UserDirectoryID, _diskinfo),
- _rightel = $("#U_MD_DK_M", _diskinfo.formel)[0],
- _childel = $(_rightel).Child()
- ;
- if (_selectElement.length > 1) {
- _ids = U.Json.toKeyArray(_selectElement, "id").join(",");
- fileordir = U.Json.like(diskinfo.currentDirectoryFile, { "UserDirectoryID": _ids });
- }
-
- if (_permissions.isopen && fileordir) {
- _childel[0].style.display = "block";
- _childel[0].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.LE.openFileDirectory(fileordir, _userid);
- };
- }
- else {
- _childel[0].style.display = "none";
- }
-
- if (_permissions.isupadte && fileordir) {
- _childel[1].style.display = "block";
- _childel[1].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.rename(el, fileordir, _diskinfo);
- };
- }
- else {
- _childel[1].style.display = "none";
- }
-
- if (_permissions.isdelete && fileordir) {
- _childel[2].style.display = "block";
- _childel[2].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.deleteFileOrDir(fileordir, _userid, _diskinfo);
- }
- }
- else {
- _childel[2].style.display = "none";
- }
-
- if (_permissions.iscopy && fileordir) {
- _childel[3].style.display = "block";
- _childel[3].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.copyorshear(fileordir, "copy", _diskinfo);
- }
- }
- else {
- _childel[3].style.display = "none";
- }
-
- if (_permissions.isshear && fileordir) {
- _childel[4].style.display = "block";
- _childel[4].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.copyorshear(fileordir, "shear", _diskinfo);
- }
- }
- else {
- _childel[4].style.display = "none";
- }
-
- if (_permissions.isencryption && fileordir) {
- _childel[5].style.display = "block";
- _childel[5].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.asynSetPermissions(fileordir);
- }
- }
- else {
- _childel[5].style.display = "none";
- }
-
- if (_permissions.isdownload && fileordir) {
- _childel[6].style.display = "block";
- _childel[6].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.downloadFile(fileordir.UserDirectoryID || U.Json.toKeyArray(fileordir, "UserDirectoryID").join(","), fileordir.filetype == 0);
- }
- }
- else {
- _childel[6].style.display = "none";
- }
-
- if (_permissions.isnew && !fileordir) {
- _childel[7].style.display = "block";
- _childel[8].style.display = "block";
- _childel[9].style.display = "block";
- _childel[10].style.display = "block";
- _childel[7].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.newFolder(_diskinfo);
- }
- _childel[8].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.newText(_diskinfo);
- }
- _childel[9].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.newDocument(_diskinfo);
- }
- _childel[10].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.newExcel(_diskinfo);
- }
- }
- else {
- _childel[7].style.display = "none";
- _childel[8].style.display = "none";
- _childel[9].style.display = "none";
- _childel[10].style.display = "none";
- }
-
- if (_permissions.isreply && !fileordir) {
- _childel[11].style.display = "block";
- _childel[11].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.replay(fileordir);
- }
- }
- else {
- _childel[11].style.display = "none";
- }
-
- if (_permissions.ispaste && !fileordir) {
- _childel[12].style.display = "block";
- _childel[12].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.paste(_diskinfo);
- }
- }
- else {
- _childel[12].style.display = "none";
- }
-
- if (_permissions.isrefresh && !fileordir) {
- _childel[13].style.display = "block";
- _childel[13].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.refresh(_userid, _fileordir, _diskinfo);
- }
- }
- else {
- _childel[13].style.display = "none";
- }
-
- if (_permissions.isupload && !fileordir) {
- _childel[14].style.display = "block";
- _childel[14].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.C.upload(_diskinfo);
- }
- }
- else {
- _childel[14].style.display = "none";
- }
-
- if (_permissions.isview && !fileordir) {
- _childel[15].style.display = "block";
- _childel[16].style.display = "block";
- _childel[15].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.VW.viewsSwitch("Normal", _diskinfo);
- }
- _childel[16].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.VW.viewsSwitch("Detailed", _diskinfo);
- }
- }
- else {
- _childel[15].style.display = "none";
- _childel[16].style.display = "none";
- }
-
- if (fileordir && _permissions.isopen) {
- _childel[17].style.display = "block";
- _childel[17].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.attribute(fileordir);
- }
- }
- else {
- _childel[17].style.display = "none";
- }
-
- if (_permissions.isedit && US.disk.fileType.text.indexOf(_fileordir.UserDirectoryExtendType) > -1) {
- _childel[18].style.display = "block";
- _childel[18].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.D.I.openApplication("txt", _fileordir);
- }
- }
- else {
- _childel[18].style.display = "none";
- }
-
- _rightel.style.display = "block";
- if (_rightel.offsetHeight < 10) {
- _rightel.style.display = "none"
- }
- else {
-
- U.UF.C.rightClickMenuLocation(_rightel);
- }
- }
- U.MD.DK.RM.hiddenRightMenu = function (diskinfo) {
- $("#U_MD_DK_M", diskinfo.formel)[0].style.display = "none";
- }
- U.MD.DK.RM.getSelectionFilesOrDir = function (el) {
-
-
-
-
-
- }
|