Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix dropdown on iPad & integrate CKFinder for browsing folder/files

  • Loading branch information...
commit 768b0d2f205237d090ec6fa157894108d210cb4f 1 parent 253f878
a-fung authored

Showing 42 changed files with 756 additions and 27 deletions. Show diff stats Hide diff stats

  1. +3 0  .gitignore
  2. +12 1 gather_aspnet.ps1
  3. +10 0 gather_php.ps1
  4. +82 0 source/aspnetserver/Handler/AdminFinderRequestHandler.cs
  5. +1 0  source/aspnetserver/ServerAjax.aspx.cs
  6. +13 0 source/aspnetserver/SessionWrapper.cs
  7. +1 0  source/aspnetserver/admin.html
  8. +2 0  source/aspnetserver/afung.MangaWeb3.Server.csproj
  9. +1 1  source/aspnetserver/css/mangaweb.css
  10. +4 4 source/aspnetserver/lang/en-us.html
  11. +27 6 source/aspnetserver/template/admin.html
  12. +72 0 source/ckfinder/config.ascx
  13. +5 0 source/ckfinder/config.js
  14. +71 0 source/ckfinder/config.php
  15. +13 0 source/csharpcommon/AdminFinderRequest.cs
  16. +13 0 source/csharpcommon/AdminFinderResponse.cs
  17. +2 0  source/csharpcommon/afung.MangaWeb3.Common(script).csproj
  18. +2 0  source/csharpcommon/afung.MangaWeb3.Common.csproj
  19. +11 0 source/haxe/afung/mangaWeb3/common/AdminFinderRequest.hx
  20. +11 0 source/haxe/afung/mangaWeb3/common/AdminFinderResponse.hx
  21. +2 0  source/haxe/afung/mangaWeb3/server/ServerAjax.hx
  22. +17 1 source/haxe/afung/mangaWeb3/server/SessionWrapper.hx
  23. +71 0 source/haxe/afung/mangaWeb3/server/handler/AdminFinderRequestHandler.hx
  24. +14 0 source/less/mangaweb.less
  25. +95 0 source/scriptsharp/Import/CKFinder.cs
  26. +1 1  source/scriptsharp/Modal/LoginModal.cs
  27. +5 8 source/scriptsharp/Modal/ModalBase.cs
  28. +5 0 source/scriptsharp/Utility.cs
  29. +1 0  source/scriptsharp/afung.MangaWeb3.Client.csproj
  30. +1 0  source/scriptsharpadmin/AdminApp.cs
  31. +8 1 source/scriptsharpadmin/Modal/AdminCollectionAddModal.cs
  32. +1 1  source/scriptsharpadmin/Modal/AdminCollectionEditNameModal.cs
  33. +1 0  source/scriptsharpadmin/Modal/AdminCollectionUsersModal.cs
  34. +155 0 source/scriptsharpadmin/Modal/AdminFinderModal.cs
  35. +16 1 source/scriptsharpadmin/Modal/AdminMangaAddModal.cs
  36. +1 1  source/scriptsharpadmin/Modal/AdminSettingsModal.cs
  37. +1 1  source/scriptsharpadmin/Modal/AdminUserAddModal.cs
  38. +1 0  source/scriptsharpadmin/Modal/AdminUserCollectionsModal.cs
  39. +1 0  source/scriptsharpadmin/Module/AdminCollectionsModule.cs
  40. +1 0  source/scriptsharpadmin/Module/AdminMangasModule.cs
  41. +1 0  source/scriptsharpadmin/Module/AdminUsersModule.cs
  42. +1 0  source/scriptsharpadmin/afung.MangaWeb3.Client.Admin.csproj
3  .gitignore
@@ -170,3 +170,6 @@ output/
170 170 copy*test.ps1
171 171 afung.*.js
172 172 mscorlib*js
  173 +
  174 +ckfinder_aspnet/
  175 +ckfinder_php/
13 gather_aspnet.ps1
@@ -86,7 +86,7 @@ copy source\aspnetserver\bin\*.dll $path\bin
86 86 copy source\aspnetserverinstall\bin\afung.MangaWeb3.Server.Install.dll $path\bin
87 87
88 88
89   -# pdf files
  89 +# debug files
90 90 if ($true) {
91 91 copy source\aspnetserver\bin\*.pdb $path\bin
92 92 copy source\aspnetserverinstall\bin\afung.MangaWeb3.Server.Install.pdb $path\bin
@@ -97,3 +97,14 @@ copy source\aspnetserverinstall\bin\afung.MangaWeb3.Server.Install.pdb $path\bin
97 97 copy source\aspnetserver\web.config $path
98 98
99 99
  100 +# ckfinder
  101 +if ($true) {
  102 +mkdir $path\ckfinder
  103 +Copy-Item external_libraries\ckfinder_aspnet\* $path\ckfinder -recurse -force;
  104 +
  105 +copy source\ckfinder\config.js $path\ckfinder -force
  106 +copy source\ckfinder\config.ascx $path\ckfinder -force
  107 +copy external_libraries\ckfinder_aspnet\bin\Release\CKFinder.dll $path\bin -force
  108 +}
  109 +
  110 +
10 gather_php.ps1
@@ -84,3 +84,13 @@ del source\haxephp\index.php
84 84 robocopy source\haxephp $path /E
85 85
86 86
  87 +# ckfinder
  88 +if ($true) {
  89 +mkdir $path\ckfinder
  90 +Copy-Item external_libraries\ckfinder_php\* $path\ckfinder -recurse -force;
  91 +
  92 +copy source\ckfinder\config.js $path\ckfinder -force
  93 +copy source\ckfinder\config.php $path\ckfinder -force
  94 +}
  95 +
  96 +
82 source/aspnetserver/Handler/AdminFinderRequestHandler.cs
... ... @@ -0,0 +1,82 @@
  1 +using System;
  2 +using System.Collections.Generic;
  3 +using System.Linq;
  4 +using System.Text;
  5 +using System.Web;
  6 +using afung.MangaWeb3.Common;
  7 +
  8 +namespace afung.MangaWeb3.Server.Handler
  9 +{
  10 + public class AdminFinderRequestHandler : HandlerBase
  11 + {
  12 + protected override Type GetHandleRequestType()
  13 + {
  14 + return typeof(AdminFinderRequest);
  15 + }
  16 +
  17 + public override void HandleRequest(string jsonString, AjaxBase ajax)
  18 + {
  19 + if (!User.IsAdminLoggedIn(ajax))
  20 + {
  21 + ajax.Unauthorized();
  22 + return;
  23 + }
  24 +
  25 + AdminFinderRequest request = Utility.ParseJson<AdminFinderRequest>(jsonString);
  26 + AdminFinderResponse response = new AdminFinderResponse();
  27 + Collection collection = null;
  28 + string[][] finderData;
  29 +
  30 + if (request.cid != -1)
  31 + {
  32 + collection = Collection.GetById(request.cid);
  33 + if (collection == null)
  34 + {
  35 + ajax.BadRequest();
  36 + return;
  37 + }
  38 +
  39 + finderData = new string[][] { new string[] { collection.Name, collection.Path } };
  40 + }
  41 + else
  42 + {
  43 + List<string[]> diskData = new List<string[]>();
  44 + string[] discs = Environment.GetLogicalDrives();
  45 + for (int i = 0; i < discs.Length; i++)
  46 + {
  47 + string driveLetter = discs[i].Replace(":\\", "");
  48 + using (System.Management.ManagementObject diskObj = new System.Management.ManagementObject("win32_logicaldisk.deviceid=\"" + driveLetter + ":\""))
  49 + {
  50 + if (diskObj["DriveType"].ToString() == "3") // Local Disk
  51 + {
  52 + diskData.Add(new string[] { driveLetter + ":", driveLetter + ":\\" });
  53 + }
  54 + }
  55 + }
  56 +
  57 + finderData = diskData.ToArray();
  58 + }
  59 +
  60 + Random r = new Random();
  61 + StringBuilder tokenBuilder = new StringBuilder();
  62 + for (int i = 0; i < 32; i++)
  63 + {
  64 + int n = r.Next(36);
  65 + if (n < 10)
  66 + {
  67 + tokenBuilder.Append(n);
  68 + }
  69 + else
  70 + {
  71 + tokenBuilder.Append(Convert.ToChar(55 + n));
  72 + }
  73 + }
  74 +
  75 + response.token = tokenBuilder.ToString();
  76 +
  77 + SessionWrapper.SetFinderData(ajax, response.token, finderData);
  78 +
  79 + ajax.ReturnJson(response);
  80 + }
  81 + }
  82 +}
1  source/aspnetserver/ServerAjax.aspx.cs
@@ -40,6 +40,7 @@ protected override void PageLoad()
40 40 new AdminCollectionsUsersDeleteRequestHandler(),
41 41 new AdminCollectionsUsersAccessRequestHandler(),
42 42 new AdminMangaAddRequestHandler(),
  43 + new AdminFinderRequestHandler(),
43 44 };
44 45 }
45 46
13 source/aspnetserver/SessionWrapper.cs
@@ -30,6 +30,19 @@ public static void SetUserName(AjaxBase ajax, string value)
30 30 Set(ajax, "username", value);
31 31 }
32 32
  33 + public static void SetFinderData(AjaxBase ajax, string token, string[][] finderData)
  34 + {
  35 + Dictionary<string, string[][]> dict = (Dictionary<string, string[][]>)Get(ajax, "finder");
  36 + if (dict == null)
  37 + {
  38 + dict = new Dictionary<string, string[][]>();
  39 + }
  40 +
  41 + dict[token] = finderData;
  42 +
  43 + Set(ajax, "finder", dict);
  44 + }
  45 +
33 46 private static object Get(AjaxBase ajax, string name)
34 47 {
35 48 return ajax.Session["afung.MangaWeb3.Server.Session." + name];
1  source/aspnetserver/admin.html
@@ -15,6 +15,7 @@
15 15 <script type="text/javascript" src="js/afung.MangaWeb3.Client.debug.js"></script>
16 16 <script type="text/javascript" src="js/afung.MangaWeb3.Client.Admin.debug.js"></script>
17 17 <script type="text/javascript" src="js/servertype.js"></script>
  18 + <script type="text/javascript" src="ckfinder/ckfinder.js"></script>
18 19 </head>
19 20 <body>
20 21 <script type="text/javascript">
2  source/aspnetserver/afung.MangaWeb3.Server.csproj
@@ -44,6 +44,7 @@
44 44 <Reference Include="SevenZipSharp">
45 45 <HintPath>..\..\external_libraries\SevenZipSharp.dll</HintPath>
46 46 </Reference>
  47 + <Reference Include="System.Management" />
47 48 <Reference Include="System.Web.DynamicData" />
48 49 <Reference Include="System.Web.Entity" />
49 50 <Reference Include="System.Web.ApplicationServices" />
@@ -115,6 +116,7 @@
115 116 <Compile Include="Handler\AdminCollectionsUsersDeleteRequestHandler.cs" />
116 117 <Compile Include="Handler\AdminCollectionsUsersGetRequestHandler.cs" />
117 118 <Compile Include="Handler\AdminCollectionUserAddRequestHandler.cs" />
  119 + <Compile Include="Handler\AdminFinderRequestHandler.cs" />
118 120 <Compile Include="Handler\AdminMangaAddRequestHandler.cs" />
119 121 <Compile Include="Handler\AdminSettingsGetRequestHandler.cs" />
120 122 <Compile Include="Handler\AdminSettingsSetRequestHandler.cs" />
2  source/aspnetserver/css/mangaweb.css
... ... @@ -1 +1 @@
1   -body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif,"Meiryo UI","MS UI Gothic","MS PGothic","MS Pゴシック","MS Gothic","MS ゴシック","Microsoft JHengHei UI","Microsoft JHengHei","微軟正黑體",MingLiU,"細明體"}code,pre{font-family:Monaco,Menlo,Consolas,"Courier New",monospace,"Meiryo UI","MS UI Gothic","MS PGothic","MS Pゴシック","MS Gothic","MS ゴシック","Microsoft JHengHei UI","Microsoft JHengHei","微軟正黑體",MingLiU,"細明體"}input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif,"Meiryo UI","MS UI Gothic","MS PGothic","MS Pゴシック","MS Gothic","MS ゴシック","Microsoft JHengHei UI","Microsoft JHengHei","微軟正黑體",MingLiU,"細明體"}.navbar-search .search-query{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif,"Meiryo UI","MS UI Gothic","MS PGothic","MS Pゴシック","MS Gothic","MS ゴシック","Microsoft JHengHei UI","Microsoft JHengHei","微軟正黑體",MingLiU,"細明體"}.temp{display:none}.text-left{text-align:left}.text-center{text-align:center}.modal{overflow:hidden}.modal form{margin:0}.nav-admin{margin-top:15px}.select-tall{height:100px}.table tr.vmiddle input[type="checkbox"]{position:relative;bottom:2px}.table tr.vmiddle td{vertical-align:middle}.table th.text-center,.table td.text-center{text-align:center}.table th.td-mini,.table td.td-mini{width:30px}.table th.td-small,.table td.td-small{width:100px}.table td.break-word{word-wrap:break-word}.row-after-table .btn-toolbar{margin-top:0}.row-after-table .pagination{margin-top:0}@media (max-width: 767px){.modal.fade.in{ top:50%}}#error-modal.modal{z-index:1500}#confirm-modal.modal{z-index:1450}#login-modal.modal{z-index:1400}.typeahead{z-index:2000}
  1 +body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif,"Meiryo UI","MS UI Gothic","MS PGothic","MS Pゴシック","MS Gothic","MS ゴシック","Microsoft JHengHei UI","Microsoft JHengHei","微軟正黑體",MingLiU,"細明體"}code,pre{font-family:Monaco,Menlo,Consolas,"Courier New",monospace,"Meiryo UI","MS UI Gothic","MS PGothic","MS Pゴシック","MS Gothic","MS ゴシック","Microsoft JHengHei UI","Microsoft JHengHei","微軟正黑體",MingLiU,"細明體"}input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif,"Meiryo UI","MS UI Gothic","MS PGothic","MS Pゴシック","MS Gothic","MS ゴシック","Microsoft JHengHei UI","Microsoft JHengHei","微軟正黑體",MingLiU,"細明體"}.navbar-search .search-query{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif,"Meiryo UI","MS UI Gothic","MS PGothic","MS Pゴシック","MS Gothic","MS ゴシック","Microsoft JHengHei UI","Microsoft JHengHei","微軟正黑體",MingLiU,"細明體"}.temp{display:none}.text-left{text-align:left}.text-center{text-align:center}.modal{overflow:hidden}.modal form{margin:0}.nav-admin{margin-top:15px}.select-tall{height:100px}.table tr.vmiddle input[type="checkbox"]{position:relative;bottom:2px}.table tr.vmiddle td{vertical-align:middle}.table th.text-center,.table td.text-center{text-align:center}.table th.td-mini,.table td.td-mini{width:30px}.table th.td-small,.table td.td-small{width:100px}.table td.break-word{word-wrap:break-word}.row-after-table .btn-toolbar{margin-top:0}.row-after-table .pagination{margin-top:0}@media (max-width: 767px){.modal.fade.in{ top:50%}}#error-modal.modal{z-index:1500}#confirm-modal.modal{z-index:1450}#login-modal.modal{z-index:1400}#admin-finder-modal.modal{z-index:1350}#admin-finder-body.modal-body{height:400px;padding:0}#admin-finder-body.modal-body iframe{display:block;height:400px}.typeahead{z-index:2000}
8 source/aspnetserver/lang/en-us.html
@@ -108,10 +108,10 @@
108 108 <p id="DeleteItemsConfirm">Are you sure to delete the selected item(s)?</p>
109 109 <p id="FileNotFound">File not found.</p>
110 110 <p id="PathNotUnderCollection">The specified path is not under the path of the selected collection.</p>
111   -<p id=""></p>
112   -<p id=""></p>
113   -<p id=""></p>
114   -<p id=""></p>
  111 +<p id="Browse">Browse</p>
  112 +<p id="FileBrowser">File Browser</p>
  113 +<p id="Select">Select</p>
  114 +<p id="CKFinderLanguage">en</p>
115 115 <p id=""></p>
116 116 <p id=""></p>
117 117 <p id=""></p>
33 source/aspnetserver/template/admin.html
@@ -68,7 +68,7 @@
68 68 <span class="msg msg-ActionOnSelected"></span>
69 69 <span class="caret"></span>
70 70 </button>
71   - <ul class="dropdown-menu">
  71 + <ul class="dropdown-menu" id="admin-collections-action-dropdown">
72 72 <li><a href="#" id="admin-collections-delete-btn">
73 73 <i class="icon-trash"></i>
74 74 <span class="msg msg-Delete"></span>
@@ -154,7 +154,7 @@
154 154 <span class="msg msg-ActionOnSelected"></span>
155 155 <span class="caret"></span>
156 156 </button>
157   - <ul class="dropdown-menu">
  157 + <ul class="dropdown-menu" id="admin-mangas-action-dropdown">
158 158 <li><a href="#" id="admin-mangas-delete-btn">
159 159 <i class="icon-trash"></i>
160 160 <span class="msg msg-Delete"></span>
@@ -231,7 +231,7 @@
231 231 <span class="msg msg-ActionOnSelected"></span>
232 232 <span class="caret"></span>
233 233 </button>
234   - <ul class="dropdown-menu">
  234 + <ul class="dropdown-menu" id="admin-users-action-dropdown">
235 235 <li><a href="#" id="admin-users-delete-btn">
236 236 <i class="icon-trash"></i>
237 237 <span class="msg msg-Delete"></span>
@@ -311,7 +311,12 @@ <h3 class="msg msg-AddCollection"></h3>
311 311 <div class="control-group">
312 312 <label class="msg msg-Path control-label" for="admin-collection-add-path"></label>
313 313 <div class="controls">
314   - <input type="text" id="admin-collection-add-path" />
  314 + <div class="input-append">
  315 + <input type="text" id="admin-collection-add-path" />
  316 + <a href="#" class="btn" id="admin-collection-add-browse-btn">
  317 + <i class="icon-folder-open"></i>
  318 + </a>
  319 + </div>
315 320 </div>
316 321 </div>
317 322 <div class="control-group">
@@ -415,7 +420,7 @@ <h3 id="admin-collection-users-name"></h3>
415 420 <span class="msg msg-ActionOnSelected"></span>
416 421 <span class="caret"></span>
417 422 </button>
418   - <ul class="dropdown-menu">
  423 + <ul class="dropdown-menu" id="admin-collection-users-action-dropdown">
419 424 <li><a href="#" id="admin-collection-users-delete-btn">
420 425 <i class="icon-trash"></i>
421 426 <span class="msg msg-Delete"></span>
@@ -474,7 +479,7 @@ <h3 id="admin-user-collections-name"></h3>
474 479 <span class="msg msg-ActionOnSelected"></span>
475 480 <span class="caret"></span>
476 481 </button>
477   - <ul class="dropdown-menu">
  482 + <ul class="dropdown-menu" id="admin-user-collections-action-dropdown">
478 483 <li><a href="#" id="admin-user-collections-delete-btn">
479 484 <i class="icon-trash"></i>
480 485 <span class="msg msg-Delete"></span>
@@ -512,7 +517,12 @@ <h3 class="msg msg-AddManga"></h3>
512 517 <div class="control-group">
513 518 <label class="msg msg-Path control-label" for="admin-manga-add-path"></label>
514 519 <div class="controls">
  520 + <div class="input-append">
515 521 <input type="text" id="admin-manga-add-path" />
  522 + <a href="#" class="btn" id="admin-manga-add-browse-btn">
  523 + <i class="icon-folder-open"></i>
  524 + </a>
  525 + </div>
516 526 </div>
517 527 </div>
518 528 <div class="control-group">
@@ -527,3 +537,14 @@ <h3 class="msg msg-AddManga"></h3>
527 537 </div>
528 538 </form>
529 539 </div>
  540 +<div id="admin-finder-modal" class="modal hide fade">
  541 + <div class="modal-header">
  542 + <a href="#" class="close" data-dismiss="modal">×</a>
  543 + <h3 class="msg msg-FileBrowser"></h3>
  544 + </div>
  545 + <div class="modal-body" id="admin-finder-body">
  546 + </div>
  547 + <div class="modal-footer">
  548 + <a href="#" class="msg msg-Select btn btn-primary" id="admin-finder-select"></a>
  549 + </div>
  550 +</div>
72 source/ckfinder/config.ascx
... ... @@ -0,0 +1,72 @@
  1 +<%@ Control Language="C#" EnableViewState="false" AutoEventWireup="false" Inherits="CKFinder.Settings.ConfigFile" %>
  2 +<%@ Import Namespace="CKFinder.Settings" %>
  3 +<script runat="server">
  4 + public override bool CheckAuthentication()
  5 + {
  6 + object sessionData = Page.Session["afung.MangaWeb3.Server.Session.finder"];
  7 + string token = Page.Request.QueryString["token"];
  8 + if (sessionData == null || String.IsNullOrWhiteSpace(token))
  9 + {
  10 + return false;
  11 + }
  12 +
  13 + Dictionary<string, string[][]> dict = (Dictionary<string, string[][]>)sessionData;
  14 + return dict.ContainsKey(token);
  15 + }
  16 +
  17 + public override void SetConfig()
  18 + {
  19 + object sessionData = Page.Session["afung.MangaWeb3.Server.Session.finder"];
  20 + string token = Page.Request.QueryString["token"];
  21 + if (sessionData == null || String.IsNullOrWhiteSpace(token))
  22 + {
  23 + return;
  24 + }
  25 +
  26 + Dictionary<string, string[][]> dict = (Dictionary<string, string[][]>)sessionData;
  27 + if (!dict.ContainsKey(token))
  28 + {
  29 + return;
  30 + }
  31 +
  32 + LicenseName = "";
  33 + LicenseKey = "";
  34 + BaseUrl = "/";
  35 + BaseDir = "\\";
  36 + DisallowUnsafeCharacters = true;
  37 + ForceSingleExtension = true;
  38 + HtmlExtensions = new string[] { "html", "htm", "xml", "js" };
  39 + HideFolders = new string[] { ".svn", "CVS" };
  40 + HideFiles = new string[] { ".*" };
  41 +
  42 + RoleSessionVar = "CKFinder_UserRole";
  43 +
  44 + AccessControl acl = AccessControl.Add();
  45 + acl.Role = "*";
  46 + acl.ResourceType = "*";
  47 + acl.Folder = "/";
  48 +
  49 + acl.FolderView = true;
  50 + acl.FolderCreate = false;
  51 + acl.FolderRename = false;
  52 + acl.FolderDelete = false;
  53 +
  54 + acl.FileView = true;
  55 + acl.FileUpload = false;
  56 + acl.FileRename = false;
  57 + acl.FileDelete = false;
  58 +
  59 + DefaultResourceTypes = "";
  60 +
  61 + ResourceType type;
  62 +
  63 + string[][] finderData = dict[token];
  64 + foreach (string[] folder in finderData)
  65 + {
  66 + type = ResourceType.Add(folder[0]);
  67 + type.Dir = type.Url = folder[1];
  68 + type.MaxSize = 0;
  69 + type.AllowedExtensions = type.DeniedExtensions = new string[] { };
  70 + }
  71 + }
  72 +</script>
5 source/ckfinder/config.js
... ... @@ -0,0 +1,5 @@
  1 +CKFinder.customConfig = function( config )
  2 +{
  3 + config.removePlugins = 'help,basket,flashupload';
  4 + config.selectMultiple = false;
  5 +};
71 source/ckfinder/config.php
... ... @@ -0,0 +1,71 @@
  1 +<?php
  2 +
  3 +@session_start();
  4 +
  5 +function CheckAuthentication()
  6 +{
  7 + if (!isset($_SESSION['afung.MangaWeb3.Server.Session.finder']) || !isset($_GET['token']))
  8 + {
  9 + return false;
  10 + }
  11 +
  12 + $dict = $_SESSION['afung.MangaWeb3.Server.Session.finder'];
  13 + $token = $_GET['token'];
  14 +
  15 + return isset($dict[$token]);
  16 +}
  17 +
  18 +if (!isset($_SESSION['afung.MangaWeb3.Server.Session.finder']) || !isset($_GET['token']))
  19 +{
  20 + die();
  21 +}
  22 +
  23 +$dict = $_SESSION['afung.MangaWeb3.Server.Session.finder'];
  24 +$token = $_GET['token'];
  25 +
  26 +if(!isset($dict[$token]))
  27 +{
  28 + die();
  29 +}
  30 +
  31 +$config['LicenseName'] = '';
  32 +$config['LicenseKey'] = '';
  33 +$baseUrl = '/';
  34 +$baseDir = '/';
  35 +$config['CheckDoubleExtension'] = true;
  36 +$config['DisallowUnsafeCharacters'] = true;
  37 +$config['FilesystemEncoding'] = 'UTF-8';
  38 +$config['HtmlExtensions'] = array('html', 'htm', 'xml', 'js');
  39 +$config['HideFolders'] = array(".svn", "CVS");
  40 +$config['HideFiles'] = array(".*");
  41 +
  42 +$config['RoleSessionVar'] = 'CKFinder_UserRole';
  43 +
  44 +$config['AccessControl'][] = array(
  45 + 'role' => '*',
  46 + 'resourceType' => '*',
  47 + 'folder' => '/',
  48 +
  49 + 'folderView' => true,
  50 + 'folderCreate' => false,
  51 + 'folderRename' => false,
  52 + 'folderDelete' => false,
  53 +
  54 + 'fileView' => true,
  55 + 'fileUpload' => false,
  56 + 'fileRename' => false,
  57 + 'fileDelete' => false);
  58 +
  59 +$config['DefaultResourceTypes'] = '';
  60 +
  61 +$finderData = $dict[$token];
  62 +for ($i = 0; $i < count($finderData); $i++)
  63 +{
  64 + $config['ResourceType'][] = array(
  65 + 'name' => $finderData[$i][0],
  66 + 'url' => $finderData[$i][1],
  67 + 'directory' => $finderData[$i][1],
  68 + 'maxSize' => 0,
  69 + 'allowedExtensions' => '',
  70 + 'deniedExtensions' => '');
  71 +}
13 source/csharpcommon/AdminFinderRequest.cs
... ... @@ -0,0 +1,13 @@
  1 +// AdminFinderRequest.cs
  2 +//
  3 +
  4 +using System;
  5 +using System.Collections.Generic;
  6 +
  7 +namespace afung.MangaWeb3.Common
  8 +{
  9 + public class AdminFinderRequest : JsonRequest
  10 + {
  11 + public int cid;
  12 + }
  13 +}
13 source/csharpcommon/AdminFinderResponse.cs
... ... @@ -0,0 +1,13 @@
  1 +// AdminFinderResponse.cs
  2 +//
  3 +
  4 +using System;
  5 +using System.Collections.Generic;
  6 +
  7 +namespace afung.MangaWeb3.Common
  8 +{
  9 + public class AdminFinderResponse : JsonResponse
  10 + {
  11 + public string token;
  12 + }
  13 +}
2  source/csharpcommon/afung.MangaWeb3.Common(script).csproj
@@ -57,6 +57,8 @@
57 57 <Compile Include="AdminCollectionsUsersGetRequest.cs" />
58 58 <Compile Include="AdminCollectionsUsersGetResponse.cs" />
59 59 <Compile Include="AdminCollectionUserAddRequest.cs" />
  60 + <Compile Include="AdminFinderRequest.cs" />
  61 + <Compile Include="AdminFinderResponse.cs" />
60 62 <Compile Include="AdminMangaAddRequest.cs" />
61 63 <Compile Include="AdminMangaAddResponse.cs" />
62 64 <Compile Include="AdminSettingsGetRequest.cs" />
2  source/csharpcommon/afung.MangaWeb3.Common.csproj
@@ -44,6 +44,8 @@
44 44 <Compile Include="AdminCollectionsUsersGetRequest.cs" />
45 45 <Compile Include="AdminCollectionsUsersGetResponse.cs" />
46 46 <Compile Include="AdminCollectionUserAddRequest.cs" />
  47 + <Compile Include="AdminFinderRequest.cs" />
  48 + <Compile Include="AdminFinderResponse.cs" />
47 49 <Compile Include="AdminMangaAddRequest.cs" />
48 50 <Compile Include="AdminMangaAddResponse.cs" />
49 51 <Compile Include="AdminSettingsGetRequest.cs" />
11 source/haxe/afung/mangaWeb3/common/AdminFinderRequest.hx
... ... @@ -0,0 +1,11 @@
  1 +package afung.mangaWeb3.common;
  2 +
  3 +/**
  4 + * ...
  5 + * @author a-fung
  6 + */
  7 +
  8 +class AdminFinderRequest extends JsonRequest
  9 +{
  10 + public var cid:Int;
  11 +}
11 source/haxe/afung/mangaWeb3/common/AdminFinderResponse.hx
... ... @@ -0,0 +1,11 @@
  1 +package afung.mangaWeb3.common;
  2 +
  3 +/**
  4 + * ...
  5 + * @author a-fung
  6 + */
  7 +
  8 +class AdminFinderResponse extends JsonResponse
  9 +{
  10 + public var token:String;
  11 +}
2  source/haxe/afung/mangaWeb3/server/ServerAjax.hx
@@ -9,6 +9,7 @@ import afung.mangaWeb3.server.handler.AdminCollectionsUsersAccessRequestHandler;
9 9 import afung.mangaWeb3.server.handler.AdminCollectionsUsersDeleteRequestHandler;
10 10 import afung.mangaWeb3.server.handler.AdminCollectionsUsersGetRequestHandler;
11 11 import afung.mangaWeb3.server.handler.AdminCollectionUserAddRequestHandler;
  12 +import afung.mangaWeb3.server.handler.AdminFinderRequestHandler;
12 13 import afung.mangaWeb3.server.handler.AdminMangaAddRequestHandler;
13 14 import afung.mangaWeb3.server.handler.AdminSettingsGetRequestHandler;
14 15 import afung.mangaWeb3.server.handler.AdminSettingsSetRequestHandler;
@@ -67,6 +68,7 @@ class ServerAjax extends AjaxBase
67 68 new AdminCollectionsUsersDeleteRequestHandler(),
68 69 new AdminCollectionsUsersAccessRequestHandler(),
69 70 new AdminMangaAddRequestHandler(),
  71 + new AdminFinderRequestHandler(),
70 72 ];
71 73 }
72 74
18 source/haxe/afung/mangaWeb3/server/SessionWrapper.hx
... ... @@ -1,5 +1,7 @@
1 1 package afung.mangaWeb3.server;
2 2
  3 +import php.Lib;
  4 +import php.NativeArray;
3 5 import php.Session;
4 6
5 7
@@ -24,7 +26,7 @@ class SessionWrapper
24 26 }
25 27 }
26 28
27   - public static function SetUserName(ajax:AjaxBase, value:String)
  29 + public static function SetUserName(ajax:AjaxBase, value:String):Void
28 30 {
29 31 if (value == null)
30 32 {
@@ -34,6 +36,20 @@ class SessionWrapper
34 36 Set(ajax, "username", value);
35 37 }
36 38
  39 + public static function SetFinderData(ajax:AjaxBase, token:String, finderData:NativeArray):Void
  40 + {
  41 + var array:NativeArray = Get(ajax, "finder");
  42 + if (array == null)
  43 + {
  44 + array = Lib.toPhpArray([]);
  45 + }
  46 +
  47 + var dict:Hash<NativeArray> = Lib.hashOfAssociativeArray(array);
  48 + dict.set(token, finderData);
  49 +
  50 + Set(ajax, "finder", Lib.associativeArrayOfHash(dict));
  51 + }
  52 +
37 53 private static function Get(ajax:AjaxBase, name:String):Dynamic
38 54 {
39 55 return Session.get("afung.MangaWeb3.Server.Session." + name);
71 source/haxe/afung/mangaWeb3/server/handler/AdminFinderRequestHandler.hx
... ... @@ -0,0 +1,71 @@
  1 +package afung.mangaWeb3.server.handler;
  2 +
  3 +import afung.mangaWeb3.common.AdminFinderRequest;
  4 +import afung.mangaWeb3.common.AdminFinderResponse;
  5 +import afung.mangaWeb3.server.Collection;
  6 +import afung.mangaWeb3.server.SessionWrapper;
  7 +import php.Lib;
  8 +import php.NativeArray;
  9 +
  10 +/**
  11 + * ...
  12 + * @author a-fung
  13 + */
  14 +
  15 +class AdminFinderRequestHandler extends HandlerBase
  16 +{
  17 + public override function GetHandleRequestType():Class<Dynamic>
  18 + {
  19 + return AdminFinderRequest;
  20 + }
  21 +
  22 + public override function HandleRequest(jsonString:String, ajax:AjaxBase):Void
  23 + {
  24 + if (!User.IsAdminLoggedIn(ajax))
  25 + {
  26 + ajax.Unauthorized();
  27 + return;
  28 + }
  29 +
  30 + var request:AdminFinderRequest = Utility.ParseJson(jsonString);
  31 + var response:AdminFinderResponse = new AdminFinderResponse();
  32 + var collection:Collection = null;
  33 + var finderData:NativeArray;
  34 +
  35 + if (request.cid != -1)
  36 + {
  37 + collection = Collection.GetById(request.cid);
  38 + if (collection == null)
  39 + {
  40 + ajax.BadRequest();
  41 + return;
  42 + }
  43 +
  44 + finderData = Lib.toPhpArray([Lib.toPhpArray([collection.Name, collection.Path])]);
  45 + }
  46 + else
  47 + {
  48 + finderData = Lib.toPhpArray([Lib.toPhpArray(["/", "/"])]);
  49 + }
  50 +
  51 + var tokenBuilder:StringBuf = new StringBuf();
  52 + for (i in 0...32)
  53 + {
  54 + var n:Int = Std.random(36);
  55 + if (n < 10)
  56 + {
  57 + tokenBuilder.add(Std.string(n));
  58 + }
  59 + else
  60 + {
  61 + tokenBuilder.add(String.fromCharCode(55 + n));
  62 + }
  63 + }
  64 +
  65 + response.token = tokenBuilder.toString();
  66 +
  67 + SessionWrapper.SetFinderData(ajax, response.token, finderData);
  68 +
  69 + ajax.ReturnJson(response);
  70 + }
  71 +}
14 source/less/mangaweb.less
@@ -103,6 +103,20 @@ textarea {
103 103 z-index:1400;
104 104 }
105 105
  106 +#admin-finder-modal.modal {
  107 + z-index:1350;
  108 +}
  109 +
  110 +#admin-finder-body.modal-body {
  111 + height: 400px;
  112 + padding: 0;
  113 +
  114 + iframe {
  115 + display: block;
  116 + height: 400px;
  117 + }
  118 +}
  119 +
106 120 .typeahead {
107 121 z-index:2000;
108 122 }
95 source/scriptsharp/Import/CKFinder.cs
... ... @@ -0,0 +1,95 @@
  1 +// CKFinder.cs
  2 +//
  3 +
  4 +using System;
  5 +using System.Collections.Generic;
  6 +using System.Html;
  7 +using System.Runtime.CompilerServices;
  8 +
  9 +namespace Finder
  10 +{
  11 + [Imported]
  12 + [IgnoreNamespace]
  13 + public class CKFinder
  14 + {
  15 + [ScriptName("config")]
  16 + public static CKFinderConfig Config;
  17 +
  18 + [ScriptName("basePath")]
  19 + public string BasePath;
  20 +
  21 + [ScriptName("height")]
  22 + public int Height;
  23 +
  24 + [ScriptName("api")]
  25 + public CKFinderAPI Api;
  26 +
  27 + [ScriptName("callback")]
  28 + public Action<CKFinderAPI> Callback;
  29 +
  30 + [ScriptName("appendTo")]
  31 + public void AppendTo(string elementId) { }
  32 +
  33 + [ScriptName("selectActionFunction")]
  34 + public Action<string> SelectActionFunction;
  35 + }
  36 +
  37 + [Imported]
  38 + [IgnoreNamespace]
  39 + public class CKFinderConfig
  40 + {
  41 + [ScriptName("language")]
  42 + public string Language;
  43 +
  44 + [ScriptName("connectorInfo")]
  45 + public string ConnectorInfo;
  46 + }
  47 +
  48 + [Imported]
  49 + [IgnoreNamespace]
  50 + public class CKFinderAPI
  51 + {
  52 + [ScriptName("disableFileContextMenuOption")]
  53 + public void DisableFileContextMenuOption(string option, bool addedUsingApi) { }
  54 +
  55 + [ScriptName("disableFolderContextMenuOption")]
  56 + public void DisableFolderContextMenuOption(string option, bool addedUsingApi) { }
  57 +
  58 + [ScriptName("destroy")]
  59 + public void Destroy() { }
  60 +
  61 + [ScriptName("destroy")]
  62 + public void Destroy(Action callback) { }
  63 +
  64 + [ScriptName("getSelectedFile")]
  65 + public CKFinderFile GetSelectedFile() { return null; }
  66 +
  67 + [ScriptName("getSelectedFolder")]
  68 + public CKFinderFile GetSelectedFolder() { return null; }
  69 + }
  70 +
  71 + [Imported]
  72 + [IgnoreNamespace]
  73 + public class CKFinderFile
  74 + {
  75 + [ScriptName("getUrl")]
  76 + public string GetUrl() { return null; }
  77 + }
  78 +
  79 + [Imported]
  80 + [IgnoreNamespace]
  81 + public class CKFinderFolder
  82 + {
  83 + [ScriptName("getUrl")]
  84 + public string GetUrl() { return null; }
  85 + }
  86 +
  87 + [Imported]
  88 + [IgnoreNamespace]
  89 + [ScriptName("window")]
  90 + public class CKFinderWindow
  91 + {
  92 + [ScriptName("CKFinder")]
  93 + public static object CKFinder;
  94 + }
  95 +}
2  source/scriptsharp/Modal/LoginModal.cs
@@ -32,7 +32,7 @@ protected override void Initialize()
32 32 jQuery.Select("#login-modal-cancel").Click(CancelButtonClicked);
33 33 }
34 34
35   - protected override void OnTransitionEnd()
  35 + protected override void OnShown()
36 36 {
37 37 jQuery.Select("#login-modal-username").Focus();
38 38 }
13 source/scriptsharp/Modal/ModalBase.cs
@@ -3,6 +3,7 @@
3 3
4 4 using System;
5 5 using System.Collections.Generic;
  6 +using System.Runtime.CompilerServices;
6 7 using jQueryApi;
7 8
8 9 namespace afung.MangaWeb3.Client.Modal
@@ -17,18 +18,14 @@ public ModalBase(string template, string templateId)
17 18
18 19 Initialize();
19 20
20   - attachedObject.Bind("webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd", delegate(jQueryEvent e)
21   - {
22   - if (e.Target == attachedObject.GetElement(0))
23   - {
24   - OnTransitionEnd();
25   - }
26   - });
  21 + attachedObject.Bind("shown", OnShown);
27 22 }
28 23
29 24 protected abstract void Initialize();
30 25
31   - protected virtual void OnTransitionEnd()
  26 + [AlternateSignature]
  27 + protected extern void OnShown(jQueryEvent e);
  28 + protected virtual void OnShown()
32 29 {
33 30 }
34 31
5 source/scriptsharp/Utility.cs
@@ -24,5 +24,10 @@ public static int[] GetSelectedCheckboxIds(string className)
24 24
25 25 return ids;
26 26 }
  27 +
  28 + public static void FixDropdownTouch(jQueryObject dropdown)
  29 + {
  30 + dropdown.Bind("touchstart", delegate(jQueryEvent e) { e.StopPropagation(); });
  31 + }
27 32 }
28 33 }
1  source/scriptsharp/afung.MangaWeb3.Client.csproj
@@ -49,6 +49,7 @@
49 49 </ItemGroup>
50 50 <ItemGroup>
51 51 <Compile Include="Import\Bootstrap.cs" />
  52 + <Compile Include="Import\CKFinder.cs" />
52 53 <Compile Include="Modal\ConfirmModal.cs" />
53 54 <Compile Include="Modal\ErrorModal.cs" />
54 55 <Compile Include="Modal\LoginModal.cs" />
1  source/scriptsharpadmin/AdminApp.cs
@@ -13,6 +13,7 @@ protected override void StartStage2()
13 13 {
14 14 Template.Templates[Template.Templates.Length] = "admin";
15 15 Template.TemplateIds["admin"] = new string[] {
  16 + "admin-finder-modal",
16 17 "admin-manga-add-modal",
17 18 "admin-user-collections-trow",
18 19 "admin-user-collections-modal",
9 source/scriptsharpadmin/Modal/AdminCollectionAddModal.cs
@@ -28,9 +28,10 @@ protected override void Initialize()
28 28 {
29 29 jQuery.Select("#admin-collection-add-submit").Click(SubmitForm);
30 30 jQuery.Select("#admin-collection-add-form").Submit(SubmitForm);
  31 + jQuery.Select("#admin-collection-add-browse-btn").Click(BrowseButtonClicked);
31 32 }
32 33
33   - protected override void OnTransitionEnd()
  34 + protected override void OnShown()
34 35 {
35 36 jQuery.Select("#admin-collection-add-name").Focus();
36 37 }
@@ -109,5 +110,11 @@ private void SubmitFailure(Exception error)
109 110
110 111 ErrorModal.ShowError(error.ToString());
111 112 }
  113 +
  114 + private void BrowseButtonClicked(jQueryEvent e)
  115 + {
  116 + e.PreventDefault();
  117 + AdminFinderModal.ShowDialog(jQuery.Select("#admin-collection-add-path"), -1);
  118 + }
112 119 }
113 120 }
2  source/scriptsharpadmin/Modal/AdminCollectionEditNameModal.cs
@@ -31,7 +31,7 @@ protected override void Initialize()
31 31 jQuery.Select("#admin-collection-editname-form").Submit(SubmitForm);
32 32 }
33 33
34   - protected override void OnTransitionEnd()
  34 + protected override void OnShown()
35 35 {
36 36 jQuery.Select("#admin-collection-editname-name").Focus();
37 37 }
1  source/scriptsharpadmin/Modal/AdminCollectionUsersModal.cs
@@ -44,6 +44,7 @@ protected override void Initialize()
44 44 jQuery.Select("#admin-collection-users-delete-btn").Click(DeleteButtonClicked);
45 45 jQuery.Select("#admin-collection-users-allow-btn").Click(AllowButtonClicked);
46 46 jQuery.Select("#admin-collection-users-deny-btn").Click(DenyButtonClicked);
  47 + Utility.FixDropdownTouch(jQuery.Select("#admin-collection-users-action-dropdown"));
47 48 }
48 49
49 50 private int GetTotalPage()
155 source/scriptsharpadmin/Modal/AdminFinderModal.cs
... ... @@ -0,0 +1,155 @@
  1 +// AdminFinderModal.cs
  2 +//
  3 +
  4 +using System;
  5 +using System.Collections.Generic;
  6 +using System.Runtime.CompilerServices;
  7 +using afung.MangaWeb3.Client.Modal;
  8 +using afung.MangaWeb3.Common;
  9 +using Finder;
  10 +using jQueryApi;
  11 +
  12 +namespace afung.MangaWeb3.Client.Admin.Modal
  13 +{
  14 + public class AdminFinderModal : ModalBase
  15 + {
  16 + private static AdminFinderModal instance = null;
  17 +
  18 + private jQueryObject targetField = null;
  19 +
  20 + private int cid = -1;
  21 +
  22 + private CKFinder finder;
  23 +
  24 + private AdminFinderModal()
  25 + : base("admin", "admin-finder-modal")
  26 + {
  27 + }
  28 +
  29 + protected override void Initialize()
  30 + {
  31 + jQuery.Select("#admin-finder-select").Click(SelectButtonClicked);
  32 + }
  33 +
  34 + public static void ShowDialog(jQueryObject targetField, int cid)
  35 + {
  36 + if (!Script.IsNullOrUndefined(CKFinderWindow.CKFinder))
  37 + {
  38 + if (instance == null)
  39 + {
  40 + instance = new AdminFinderModal();
  41 + }
  42 +
  43 + instance.InternalShow(targetField, cid);
  44 + }
  45 + }
  46 +
  47 + public void InternalShow(jQueryObject targetField, int cid)
  48 + {
  49 + this.targetField = targetField;
  50 + this.cid = cid;
  51 +
  52 + Action getToken = delegate
  53 + {
  54 + finder = null;
  55 + jQuery.Select("#admin-finder-body").Children().Remove();
  56 +
  57 + AdminFinderRequest request = new AdminFinderRequest();
  58 + request.cid = cid;
  59 + Request.Send(request, FinderRequestSuccess);
  60 +
  61 + Show();
  62 + };
  63 +
  64 + if (finder != null)
  65 + {
  66 + finder.Api.Destroy(getToken);
  67 + }
  68 + else
  69 + {
  70 + getToken();
  71 + }
  72 + }
  73 +
  74 + [AlternateSignature]
  75 + private extern void FinderRequestSuccess(JsonResponse response);
  76 + private void FinderRequestSuccess(AdminFinderResponse response)
  77 + {
  78 + CKFinder.Config.Language = Strings.Get("CKFinderLanguage");
  79 + CKFinder.Config.ConnectorInfo = "token=" + response.token;
  80 +
  81 + finder = new CKFinder();
  82 + finder.BasePath = "ckfinder/";
  83 + finder.Callback = delegate(CKFinderAPI api)
  84 + {
  85 + api.DisableFileContextMenuOption("selectFile", false);
  86 + api.DisableFileContextMenuOption("viewFile", false);
  87 + api.DisableFileContextMenuOption("downloadFile", false);
  88 + api.DisableFileContextMenuOption("renameFile", false);
  89 + api.DisableFileContextMenuOption("deleteFile", false);
  90 + api.DisableFolderContextMenuOption("removeFolder", false);
  91 + api.DisableFolderContextMenuOption("kl", false);
  92 + api.DisableFolderContextMenuOption("lI", false);
  93 +
  94 + jQueryObject finderFrame = jQuery.Select("#admin-finder-body iframe").Contents();
  95 + finderFrame.Find("a.cke_button_upload").Remove();
  96 + finderFrame.Find("a.cke_button_maximize").Remove();
  97 +
  98 + Show();
  99 + };
  100 +
  101 + finder.SelectActionFunction = delegate(string fileUrl)
  102 + {
  103 + if (cid != -1)
  104 + {
  105 + ChangeTargetFieldAndHide(fileUrl);
  106 + }
  107 + };
  108 +
  109 + finder.AppendTo("admin-finder-body");
  110 + }
  111 +
  112 + private void SelectButtonClicked(jQueryEvent e)
  113 + {
  114 + e.PreventDefault();
  115 +
  116 + if (cid == -1)
  117 + {
  118 + ChangeTargetFieldAndHide(finder.Api.GetSelectedFolder().GetUrl());
  119 + }
  120 + else
  121 + {
  122 + CKFinderFile file = finder.Api.GetSelectedFile();
  123 + if (file != null)
  124 + {
  125 + ChangeTargetFieldAndHide(file.GetUrl());
  126 + }
  127 + }
  128 + }
  129 +
  130 + private void ChangeTargetFieldAndHide(string url)
  131 + {
  132 + url = url.DecodeUriComponent();
  133 +
  134 + if (Environment.ServerType == ServerType.AspNet)
  135 + {
  136 + url = url.Replace("/", @"\");
  137 + while (url.IndexOf(@"\\") != -1)
  138 + {
  139 + url = url.Replace(@"\\", @"\");
  140 + }
  141 + }
  142 + else
  143 + {
  144 + url = url.Replace(@"\", "/");
  145 + while (url.IndexOf("//") != -1)
  146 + {
  147 + url = url.Replace("//", "/");
  148 + }
  149 + }
  150 +
  151 + targetField.Value(url);
  152 + Hide();
  153 + }
  154 + }
  155 +}
17 source/scriptsharpadmin/Modal/AdminMangaAddModal.cs
@@ -28,9 +28,10 @@ protected override void Initialize()
28 28 {
29 29 jQuery.Select("#admin-manga-add-submit").Click(SubmitForm);
30 30 jQuery.Select("#admin-manga-add-form").Submit(SubmitForm);
  31 + jQuery.Select("#admin-manga-add-browse-btn").Click(BrowseButtonClicked);
31 32 }
32 33
33   - protected override void OnTransitionEnd()
  34 + protected override void OnShown()
34 35 {
35 36 jQuery.Select("#admin-manga-add-path").Focus();
36 37 }
@@ -116,5 +117,19 @@ private void SubmitFailure(Exception error)
116 117
117 118 ErrorModal.ShowError(error.ToString());
118 119 }
  120 +
  121 + private void BrowseButtonClicked(jQueryEvent e)
  122 + {
  123 + e.PreventDefault();
  124 +
  125 + string cidString = jQuery.Select("#admin-manga-add-collection").GetValue();
  126 +
  127 + if (cidString == null || cidString == "" || submittingForm)
  128 + {
  129 + return;
  130 + }
  131 +
  132 + AdminFinderModal.ShowDialog(jQuery.Select("#admin-manga-add-path"), int.Parse(cidString, 10));
  133