desktop.util.js 167 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635
  1. define(
  2. "/js/desktop.util",
  3. [
  4. "js/common.tools",
  5. "js/util",
  6. "js/lib/ztree/js/ztree",
  7. "js/lib/contextMenu/jquery-contextMenu",
  8. "js/lib/artDialog/jquery-artDialog",
  9. "js/lib/picasa/picasa" /*,
  10. "desktop/taskTap",
  11. "desktop/core,
  12. "tpl/copyright.html",
  13. "desktop/rightMenu",
  14. "desktop/fileSelect",
  15. "desktop/ui",
  16. "desktop/path",
  17. "desktop/pathOperate",
  18. "desktop/pathOpen"*/,
  19. ],
  20. function (e) {
  21. ;(template = Handlebars),
  22. (Config = {
  23. BodyContent: ".bodymain",
  24. FileBoxSelector: ".fileContiner",
  25. FileBoxClass: ".fileContiner .file",
  26. FileBoxClassName: "file",
  27. FileBoxTittleClass: ".fileContiner .title",
  28. SelectClass: ".fileContiner .select",
  29. SelectClassName: "select",
  30. TypeFolderClass: "folderBox",
  31. TypeFileClass: "fileBox",
  32. HoverClassName: "hover",
  33. FileOrderAttr: "number",
  34. pageApp: "desktop",
  35. navbar: "navbar",
  36. AnimateTime: 200,
  37. }),
  38. (Global = {
  39. fileListAll: "",
  40. fileListNum: 0,
  41. fileRowNum: 0,
  42. frameLeftWidth: 200,
  43. treeSpaceWide: 10,
  44. topbar_height: 40,
  45. ctrlKey: !1,
  46. shiftKey: !1,
  47. fileListSelect: "",
  48. fileListSelectNum: "",
  49. isIE: !-[1],
  50. isDragSelect: !1,
  51. historyStatus: {
  52. back: 1,
  53. next: 0,
  54. },
  55. }),
  56. (TaskTap = e("desktop/taskTap")),
  57. (core = e("desktop/core")),
  58. (rightMenu = e("desktop/rightMenu")),
  59. (fileSelect = e("desktop/fileSelect")),
  60. (ui = e("desktop/ui")),
  61. (ui.path = e("desktop/path")),
  62. (fileLight = fileSelect.fileLight),
  63. $(document).ready(function () {
  64. $("title").text("桌面 - " + (AUTH.site ? AUTH.site.name : "") + "")
  65. $("#favicon").attr("href", "/images/" + (AUTH.site ? AUTH.site.domain : "") + ".favicon.ico?t=" + new Date().getTime())
  66. ;(function () {
  67. $(function () {
  68. function getNow() {
  69. var now = new Date()
  70. return {
  71. hours: now.getHours() + now.getMinutes() / 60,
  72. minutes: (now.getMinutes() * 12) / 60 + (now.getSeconds() * 12) / 3600,
  73. seconds: (now.getSeconds() * 12) / 60,
  74. time: now,
  75. }
  76. }
  77. function pad(number, length) {
  78. // Create an array of the remaining length +1 and join it with 0's
  79. return new Array((length || 2) + 1 - String(number).length).join(0) + number
  80. }
  81. var now = getNow()
  82. // Create the chart
  83. $("#rightwin .oclock").highcharts(
  84. {
  85. chart: {
  86. type: "gauge",
  87. plotBackgroundColor: null,
  88. plotBackgroundImage: null,
  89. backgroundColor: "rgba(0,0,0,0)",
  90. plotBorderWidth: 0,
  91. plotShadow: false,
  92. height: 200,
  93. },
  94. credits: {
  95. enabled: false,
  96. },
  97. title: {
  98. text: "",
  99. },
  100. pane: {
  101. background: [
  102. {
  103. // default background
  104. },
  105. {
  106. backgroundColor: Highcharts.svg
  107. ? {
  108. radialGradient: {
  109. cx: 0.5,
  110. cy: -0.4,
  111. r: 1.9,
  112. },
  113. stops: [
  114. [0.5, "rgba(255, 255, 255, 0.2)"],
  115. [0.5, "rgba(200, 200, 200, 0.2)"],
  116. ],
  117. }
  118. : null,
  119. },
  120. ],
  121. },
  122. yAxis: {
  123. labels: {
  124. distance: -20,
  125. },
  126. min: 0,
  127. max: 12,
  128. lineWidth: 0,
  129. showFirstLabel: false,
  130. minorTickInterval: "auto",
  131. minorTickWidth: 1,
  132. minorTickLength: 5,
  133. minorTickPosition: "inside",
  134. minorGridLineWidth: 0,
  135. minorTickColor: "#666",
  136. tickInterval: 1,
  137. tickWidth: 2,
  138. tickPosition: "inside",
  139. tickLength: 10,
  140. tickColor: "#666",
  141. title: {
  142. text: "",
  143. style: {
  144. color: "#BBB",
  145. fontWeight: "normal",
  146. fontSize: "8px",
  147. lineHeight: "10px",
  148. },
  149. y: 10,
  150. },
  151. },
  152. tooltip: {
  153. enabled: false,
  154. },
  155. series: [
  156. {
  157. data: [
  158. {
  159. id: "hour",
  160. y: now.hours,
  161. dial: {
  162. radius: "60%",
  163. baseWidth: 4,
  164. baseLength: "95%",
  165. rearLength: 0,
  166. },
  167. },
  168. {
  169. id: "minute",
  170. y: now.minutes,
  171. dial: {
  172. baseLength: "95%",
  173. rearLength: 0,
  174. },
  175. },
  176. {
  177. id: "second",
  178. y: now.seconds,
  179. dial: {
  180. radius: "100%",
  181. baseWidth: 1,
  182. rearLength: "20%",
  183. },
  184. },
  185. ],
  186. animation: false,
  187. dataLabels: {
  188. enabled: false,
  189. },
  190. },
  191. ],
  192. },
  193. // Move
  194. function (chart) {
  195. setInterval(function () {
  196. var hour = chart.get("hour"),
  197. minute = chart.get("minute"),
  198. second = chart.get("second"),
  199. now = getNow(),
  200. // run animation unless we're wrapping around from 59 to 0
  201. animation =
  202. now.seconds == 0
  203. ? false
  204. : {
  205. easing: "easeOutElastic",
  206. }
  207. // Cache the tooltip text
  208. chart.tooltipText = pad(Math.floor(now.hours), 2) + ":" + pad(Math.floor(now.minutes * 5), 2) + ":" + pad(now.seconds * 5, 2)
  209. hour.update(now.hours, true, animation)
  210. minute.update(now.minutes, true, animation)
  211. second.update(now.seconds, true, animation)
  212. $("#rightwin .systime .time").html(now.time.format("HH:mm:ss"))
  213. $("#rightwin .systime .day").html(now.time.format("yyyy年MM月dd日,星期E"))
  214. $("#rightwin .systime .time").html(now.time.format("HH:mm:ss"))
  215. $(".taskbar_right .datebox").html(now.time.format("HH:mm yyyy/MM/dd"))
  216. }, 1000)
  217. }
  218. )
  219. })
  220. // Extend jQuery with some easing (copied from jQuery UI)
  221. $.extend($.easing, {
  222. easeOutElastic: function (x, t, b, c, d) {
  223. var s = 1.70158
  224. var p = 0
  225. var a = c
  226. if (t == 0) return b
  227. if ((t /= d) == 1) return b + c
  228. if (!p) p = d * 0.3
  229. if (a < Math.abs(c)) {
  230. a = c
  231. var s = p / 4
  232. } else var s = (p / (2 * Math.PI)) * Math.asin(c / a)
  233. return a * Math.pow(2, -10 * t) * Math.sin(((t * d - s) * (2 * Math.PI)) / p) + c + b
  234. },
  235. })
  236. })(),
  237. ui.init(),
  238. TaskTap.init(),
  239. core.update(),
  240. fileSelect.init(),
  241. rightMenu.initDesktop(),
  242. e.async("js/lib/webuploader/webuploader-min", function () {
  243. core.upload_init()
  244. }),
  245. $(".bodymain").click(function () {
  246. $("#menuwin").hide(), $("#menuwin .search input").val(""), $("#rightwin").hide()
  247. }),
  248. $(".start").click(function () {
  249. "block" == $("#menuwin").css("display") ? $("#menuwin").css("display", "none") : $("#menuwin").css("display", "block")
  250. }),
  251. $("#menuwin li[class!=search]").click(function () {
  252. $("#menuwin").css("display", "none")
  253. }),
  254. $(".taskbar_right .datebox").click(function () {
  255. "block" == $("#rightwin").css("display") ? $("#rightwin").css("display", "none") : $("#rightwin").css("display", "block")
  256. }),
  257. $("#toFullscreenBtn").click(function () {
  258. ui.toFullScreen()
  259. })
  260. ;(function () {
  261. if (!AUTH.company) {
  262. return
  263. }
  264. if (AUTH.company.orgType != 1) {
  265. $(".copyright").hide()
  266. } else {
  267. $(".copyright").click(function () {
  268. core.copyright()
  269. })
  270. }
  271. })(),
  272. $(".tab_hide_all").click(function () {
  273. if (0 != art.dialog.list.length) {
  274. $(this).toggleClass("this")
  275. var e = !$(this).hasClass("this")
  276. $.each(art.dialog.list, function (a, t) {
  277. t.display(e)
  278. })
  279. }
  280. }),
  281. $("#menuwin .logout-btn").click(function () {
  282. $.dialog({
  283. id: "dialog_path_logout",
  284. fixed: !0,
  285. icon: "question",
  286. title: "退出登录",
  287. width: 300,
  288. padding: 40,
  289. lock: !0,
  290. background: "#000",
  291. opacity: 0.3,
  292. content: "您确定要退出登录吗?",
  293. ok: function () {
  294. ui.logout()
  295. },
  296. cancel: !0,
  297. })
  298. }),
  299. (function () {
  300. //只有企业才提示
  301. if (AUTH.company.orgType != 1) {
  302. return
  303. }
  304. var playerObj,
  305. isInit = false
  306. var play = function () {
  307. if (isInit == false) {
  308. $(".taskbar_right .volume .sound").jmp3()
  309. playerObj = $(".taskbar_right .volume .sound").jmp3({
  310. backcolor: "000000",
  311. forecolor: "00ff00",
  312. width: 0,
  313. autoplay: "true",
  314. repeat: "true",
  315. filepath: "/images/soundplayer/ring.mp3",
  316. playerpath: "/images/soundplayer/mp3player.swf",
  317. showdownload: "false",
  318. })
  319. isInit = true
  320. }
  321. }
  322. //停止
  323. var stop = function () {
  324. if (playerObj != null) {
  325. playerObj = null
  326. delete playerObj
  327. }
  328. var obj = document.getElementById("mymp3")
  329. if (obj != null) {
  330. obj = null
  331. delete obj
  332. }
  333. $(".taskbar_right .volume .sound").empty()
  334. isInit = false
  335. }
  336. var reload = function () {
  337. var host = "http://" + eval("(" + AUTH.site.config + ")").platform["01200007"] + "." + AUTH.site.domain
  338. ajax({
  339. url: host + "/web/sys/altips/getCount.json",
  340. dataType: "jsonp",
  341. success: function (r) {
  342. var box = art.dialog.list["sys_altips"]
  343. if (box) {
  344. box.refresh()
  345. }
  346. stop()
  347. if (r.data <= 0) {
  348. return
  349. }
  350. $(".taskbar_right .alertbox .badge").html(r.data)
  351. $(".taskbar_right .alertbox")
  352. .attr("title", "您有" + r.data + "条告警信息")
  353. .show()
  354. $(".taskbar_right .volume")
  355. .show()
  356. .toggle(
  357. function () {
  358. $(".volume-on", $(this)).hide()
  359. $(".volume-off", $(this)).show()
  360. stop()
  361. },
  362. function () {
  363. $(".volume-on", $(this)).show()
  364. $(".volume-off", $(this)).hide()
  365. play()
  366. }
  367. )
  368. if ($(".volume-on").is(":visible")) {
  369. play()
  370. }
  371. $(".taskbar_right .alertbox").click(function () {
  372. core.openIE(host + "/sys/altips.html?auth_cid=" + cid, {
  373. id: "sys_altips",
  374. title: "告警信息",
  375. width: 1000,
  376. height: 600,
  377. })
  378. })
  379. if (window.ringBadgeTimer == undefined) {
  380. window.ringBadgeTimer = setInterval(function () {
  381. $(".taskbar_right .alertbox .badge").stop().fadeOut(100).fadeIn(200)
  382. }, 800)
  383. }
  384. },
  385. })
  386. }
  387. reload()
  388. setInterval(reload, 1000 * 60 * 5)
  389. })(),
  390. (function () {
  391. //只有企业才加载设备监测插件
  392. if (AUTH.company.orgType != 1) {
  393. return
  394. }
  395. core.plugin({
  396. id: "monitor_state",
  397. url: "/plugin/monitor_state/preview.html?auth_cid=" + cid,
  398. title: "监测点状态",
  399. width: 160,
  400. height: 135,
  401. })
  402. })()
  403. //加载天气插件
  404. ;(function () {
  405. var topLine = 170
  406. if (AUTH.company.orgType != 1) {
  407. topLine = 0
  408. }
  409. core.plugin({
  410. id: "weather",
  411. url: "/plugin/weather/index.html?auth_cid=" + cid,
  412. title: "天气",
  413. width: 133,
  414. height: 195,
  415. top: topLine,
  416. right: 37,
  417. })
  418. })()
  419. ;(function () {
  420. //只有企业才提示用电概况
  421. if (AUTH.company.orgType != 1) {
  422. return
  423. }
  424. core.openApp({ icon: "electricity_situation.png", fullable: 0, width: 1200, categoryId: 0, state: 1, type: 3, resize: 1, id: 73, content: "[100]", free: 1, title: "用电概况", height: 600, border: 0, reopen: 1 })
  425. })()
  426. ;(function () {
  427. //只有gov才提示用电概况
  428. // if (AUTH.company.id == 9370 || AUTH.company.id == 9370) {
  429. // //原尺寸
  430. // core.openApp({ icon: "bigscreen.png", fullable: 1, width: "100%", categoryId: 29, state: 1, type: 3, resize: 1, id: 146, content: "[1552]", free: 1, title: "大屏展示", height: "100%", border: 0, reopen: 1 }, true) //80
  431. // //全屏
  432. // //core.openApp({"icon":"bigscreen.png","fullable":1,"width":'100%',"categoryId":29,"state":1,"type":3,"resize":1,"id":146,"content":"[1552]","free":1,"title":"大屏展示","height":h,"border":0,"reopen":1},true);
  433. // }
  434. return
  435. })()
  436. })
  437. }
  438. ),
  439. define("desktop/taskTap", [], function () {
  440. var e = {},
  441. a = "",
  442. t = 160,
  443. i = function () {
  444. $(".task_tab .tab")
  445. .die("mouseenter")
  446. .live("mouseenter", function (e) {
  447. $(this).hasClass("this") || $(this).addClass("hover"), stopPP(e)
  448. })
  449. .die("click")
  450. .live("click", function (e) {
  451. var a = $(this).attr("id"),
  452. t = art.dialog.list[a],
  453. i = $("." + a)
  454. "hidden" == i.css("visibility") ? t.display(!0) : i.hasClass("aui_state_focus") ? t.display(!1) : t.zIndex(), stopPP(e)
  455. })
  456. .die("mouseleave")
  457. .live("mouseleave", function () {
  458. $(this).removeClass("hover")
  459. })
  460. .die("dblclick")
  461. .live("dblclick", function () {})
  462. },
  463. n = function () {
  464. var e,
  465. a,
  466. i,
  467. n,
  468. s = !1,
  469. o = !1,
  470. r = 0,
  471. l = 0,
  472. c = 0,
  473. d = 0,
  474. p = 0,
  475. u = 0
  476. $(".task_tab .tab")
  477. .die("mousedown")
  478. .live("mousedown", function (a) {
  479. return (
  480. (e = $(this)),
  481. (o = !0),
  482. this.setCapture && this.setCapture(),
  483. $(document).mousemove(function (e) {
  484. f(e)
  485. }),
  486. $(document).one("mouseup", function (e) {
  487. return v(e), this.releaseCapture && this.releaseCapture(), stopPP(e), !1
  488. }),
  489. stopPP(a),
  490. !1
  491. )
  492. })
  493. var h = function (t) {
  494. ;(s = !0),
  495. (r = t.pageX),
  496. ($tab_parent = $(".task_tab")),
  497. (a = $(".task_tab .tab")),
  498. $(".tasktab-dragging").remove(),
  499. (i = e.clone().addClass("tasktab-dragging").prependTo("body")),
  500. (d = $sizeInt(a.css("margin-right"))),
  501. (p = $tab_parent.width()),
  502. (u = $tab_parent.get(0).getBoundingClientRect().left),
  503. (u += $(window).scrollLeft()),
  504. (l = e.get(0).getBoundingClientRect().left),
  505. (c = $sizeInt(a.css("width")))
  506. var n = e.get(0).getBoundingClientRect().top - $sizeInt(e.css("margin-top")),
  507. o = t.clientX - r + l
  508. $("body").prepend("<div class='dragMaskView'></div>"),
  509. i.css({
  510. width: c + "px",
  511. top: n,
  512. left: o,
  513. }),
  514. e.css("opacity", 0)
  515. },
  516. f = function (t) {
  517. if (o) {
  518. window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty(), 0 == s && h(t)
  519. var n = t.clientX - r + l
  520. u > n ||
  521. n > u + p - c ||
  522. (i.css("left", n),
  523. a.each(function () {
  524. var a = $(this).get(0).getBoundingClientRect().left
  525. if (n > a && a + c / 2 + d > n) {
  526. if (e.attr("id") == $(this).attr("id")) return
  527. m($(this).attr("id"), "left")
  528. }
  529. if (n > a - c / 2 + d && a > n) {
  530. if (e.attr("id") == $(this).attr("id")) return
  531. m($(this).attr("id"), "right")
  532. }
  533. }))
  534. }
  535. },
  536. m = function (i, s) {
  537. if (!e.is(":animated") || n != i) {
  538. ;(n = i), e.stop(!0, !0), $(".insertTemp").remove(), (a = $(".task_tab .tab"))
  539. var o = e.width(),
  540. r = $(".task_tab #" + i),
  541. l = e
  542. .clone(!0)
  543. .insertAfter(e)
  544. .css({
  545. "margin-right": "0px",
  546. border: "none",
  547. })
  548. .addClass("insertTemp")
  549. "left" == s ? e.after(r).css("width", "0px") : (e.before(r).css("width", "0px"), r.before(l)),
  550. e.animate(
  551. {
  552. width: o + "px",
  553. },
  554. t
  555. ),
  556. l.animate(
  557. {
  558. width: "0px",
  559. },
  560. t,
  561. function () {
  562. $(this).remove(), (a = $(".task_tab .tab"))
  563. }
  564. )
  565. }
  566. },
  567. v = function () {
  568. ;(o = !1),
  569. (s = !1),
  570. (startTime = 0),
  571. $(".dragMaskView").remove(),
  572. void 0 != i &&
  573. ((l = e.get(0).getBoundingClientRect().left),
  574. i.animate(
  575. {
  576. left: l + "px",
  577. },
  578. t,
  579. function () {
  580. e.css("opacity", 1), $(this).remove()
  581. }
  582. ))
  583. }
  584. },
  585. s = function (e) {
  586. var a = 110,
  587. i = a,
  588. n = a + 12,
  589. s = $(".task_tab .tab"),
  590. o = $(".task_tab .tabs").width() - 10,
  591. r = s.length,
  592. l = Math.floor(o / n)
  593. switch ((r > l && (i = Math.floor(o / r) - 12), e)) {
  594. case "add":
  595. $(".task_tab .tabs .this")
  596. .css("width", "0")
  597. .animate(
  598. {
  599. width: i + "px",
  600. },
  601. t
  602. )
  603. case "close":
  604. s.animate(
  605. {
  606. width: i + "px",
  607. },
  608. t
  609. )
  610. break
  611. case "resize":
  612. s.css("width", i + "px")
  613. break
  614. default:
  615. }
  616. },
  617. addToTaskBar = function (id, icon) {
  618. //如果是插件,任务栏不添加
  619. if (id.match("^plugin")) {
  620. return
  621. }
  622. $(".task_tab").removeClass("hidden")
  623. var i = icon.replace(/<[^>]+>/g, ""),
  624. n = '<div class="tab taskBarMenu" id="' + id + '" title="' + i + '">' + icon + "</div>"
  625. $(n).insertBefore(".task_tab .last"),
  626. s("add"),
  627. (e[id] = {
  628. id: id,
  629. name: name,
  630. })
  631. },
  632. r = function (e) {
  633. $(".task_tab .this").removeClass("this"), $(".task_tab #" + e).addClass("this"), (a = e)
  634. },
  635. l = function (a) {
  636. delete e[a],
  637. $(".task_tab #" + a).animate(
  638. {
  639. width: 0,
  640. },
  641. t,
  642. function () {
  643. $(".task_tab #" + a).remove(), s("close"), 0 == $(".tabs .tab").length && "desktop" != Config.pageApp && $(".task_tab").addClass("hidden")
  644. }
  645. )
  646. }
  647. return {
  648. add: addToTaskBar,
  649. focus: r,
  650. close: l,
  651. init: function () {
  652. var e = '<div class="task_tab"><div class="tabs"><div class="last" style="clear:both;"></div></div></div>'
  653. $(e).appendTo("body"),
  654. "desktop" != Config.pageApp && $(".task_tab").addClass("hidden"),
  655. $(window).bind("resize", function () {
  656. s("resize")
  657. }),
  658. i(),
  659. n()
  660. },
  661. }
  662. }),
  663. define("desktop/core", [], function (require, exports) {
  664. return {
  665. filetype: {
  666. image: ["jpg", "jpeg", "png", "bmp", "gif", "ico"],
  667. music: ["mp3", "wma", "wav", "mid", "m4a", "aac", "midi"],
  668. movie: ["avi", "flv", "f4v", "wmv", "3gp", "mp4", "wmv", "asf", "m4v", "mov", "mpg"],
  669. doc: ["doc", "docx", "docm", "xls", "xlsx", "xlsb", "xlsm", "ppt", "pptx", "pptm"],
  670. text: ["oexe", "inc", "inf", "csv", "log", "asc", "tsv"],
  671. code: [
  672. "abap",
  673. "abc",
  674. "as",
  675. "ada",
  676. "adb",
  677. "htgroups",
  678. "htpasswd",
  679. "conf",
  680. "htaccess",
  681. "htgroups",
  682. "htpasswd",
  683. "asciidoc",
  684. "asm",
  685. "ahk",
  686. "bat",
  687. "cmd",
  688. "c9search_results",
  689. "cpp",
  690. "c",
  691. "cc",
  692. "cxx",
  693. "h",
  694. "hh",
  695. "hpp",
  696. "cirru",
  697. "cr",
  698. "clj",
  699. "cljs",
  700. "CBL",
  701. "COB",
  702. "coffee",
  703. "cf",
  704. "cson",
  705. "Cakefile",
  706. "cfm",
  707. "cs",
  708. "css",
  709. "curly",
  710. "d",
  711. "di",
  712. "dart",
  713. "diff",
  714. "patch",
  715. "Dockerfile",
  716. "dot",
  717. "dummy",
  718. "dummy",
  719. "e",
  720. "ejs",
  721. "ex",
  722. "exs",
  723. "elm",
  724. "erl",
  725. "hrl",
  726. "frt",
  727. "fs",
  728. "ldr",
  729. "ftl",
  730. "gcode",
  731. "feature",
  732. ".gitignore",
  733. "glsl",
  734. "frag",
  735. "vert",
  736. "go",
  737. "groovy",
  738. "haml",
  739. "hbs",
  740. "handlebars",
  741. "tpl",
  742. "mustache",
  743. "hs",
  744. "hx",
  745. "html",
  746. "htm",
  747. "xhtml",
  748. "erb",
  749. "rhtml",
  750. "ini",
  751. "cfg",
  752. "prefs",
  753. "io",
  754. "jack",
  755. "jade",
  756. "java",
  757. "js",
  758. "jsm",
  759. "json",
  760. "jq",
  761. "jsp",
  762. "jsx",
  763. "jl",
  764. "tex",
  765. "latex",
  766. "ltx",
  767. "bib",
  768. "lean",
  769. "hlean",
  770. "less",
  771. "liquid",
  772. "lisp",
  773. "ls",
  774. "logic",
  775. "lql",
  776. "lsl",
  777. "lua",
  778. "lp",
  779. "lucene",
  780. "Makefile",
  781. "GNUmakefile",
  782. "makefile",
  783. "OCamlMakefile",
  784. "make",
  785. "md",
  786. "markdown",
  787. "mask",
  788. "matlab",
  789. "mel",
  790. "mc",
  791. "mush",
  792. "mysql",
  793. "nix",
  794. "m",
  795. "mm",
  796. "ml",
  797. "mli",
  798. "pas",
  799. "p",
  800. "pl",
  801. "pm",
  802. "pgsql",
  803. "php",
  804. "phtml",
  805. "ps1",
  806. "praat",
  807. "praatscript",
  808. "psc",
  809. "proc",
  810. "plg",
  811. "prolog",
  812. "properties",
  813. "proto",
  814. "py",
  815. "r",
  816. "Rd",
  817. "Rhtml",
  818. "rb",
  819. "ru",
  820. "gemspec",
  821. "rake",
  822. "Guardfile",
  823. "Rakefile",
  824. "Gemfile",
  825. "rs",
  826. "sass",
  827. "scad",
  828. "scala",
  829. "scm",
  830. "rkt",
  831. "scss",
  832. "sh",
  833. "bash",
  834. ".bashrc",
  835. "sjs",
  836. "smarty",
  837. "tpl",
  838. "snippets",
  839. "soy",
  840. "space",
  841. "sql",
  842. "styl",
  843. "stylus",
  844. "svg",
  845. "tcl",
  846. "tex",
  847. "txt",
  848. "textile",
  849. "toml",
  850. "twig",
  851. "ts",
  852. "typescript",
  853. "str",
  854. "vala",
  855. "vbs",
  856. "vb",
  857. "vm",
  858. "v",
  859. "vh",
  860. "sv",
  861. "svh",
  862. "vhd",
  863. "vhdl",
  864. "xml",
  865. "rdf",
  866. "rss",
  867. "wsdl",
  868. "xslt",
  869. "atom",
  870. "mathml",
  871. "mml",
  872. "xul",
  873. "xbl",
  874. "xaml",
  875. "xq",
  876. "yaml",
  877. "yml",
  878. "htm",
  879. "xib",
  880. "storyboard",
  881. "plist",
  882. "csproj",
  883. ],
  884. bindary: ["pdf", "bin", "zip", "swf", "gzip", "rar", "arj", "tar", "gz", "cab", "tbz", "tbz2", "lzh", "uue", "bz2", "ace", "exe", "so", "dll", "chm", "rtf", "odp", "odt", "pages", "class", "psd", "ttf", "fla", "7z", "dmg", "iso", "dat", "ipa"],
  885. },
  886. ico: function (e) {
  887. var a = "/" + "images/file_16/",
  888. t = ["folder", "file", "edit", "search", "up", "setting", "appStore", "error", "info", "mp3", "flv", "pdf", "doc", "xls", "ppt", "html", "swf"],
  889. i = $.inArray(e, t)
  890. return -1 == i ? a + "file.png" : a + e + ".png"
  891. },
  892. contextmenu: function (e) {
  893. try {
  894. rightMenu.hidden()
  895. } catch (a) {}
  896. var a = e || window.event
  897. return a ? ((a && $(a.target).is("textarea")) || $(a.target).is("input") || 0 != $(a.target).parents(".topbar").length || 0 != $(a.target).parents(".edit_body").length || 0 != $(a.target).parents(".aui_state_focus").length ? !0 : !1) : !0
  898. },
  899. pathThis: function (e) {
  900. e = e.replace(/\\/g, "/")
  901. var a = e.split("/"),
  902. t = a[a.length - 1]
  903. if (("" == t && (t = a[a.length - 2]), 0 == t.search("fileProxy"))) {
  904. t = urlDecode(t.substr(t.search("&path=")))
  905. var a = t.split("/")
  906. ;(t = a[a.length - 1]), "" == t && (t = a[a.length - 2])
  907. }
  908. return t
  909. },
  910. pathFather: function (e) {
  911. e = e.replace(/\\/g, "/")
  912. var a = e.lastIndexOf("/")
  913. return e.substr(0, a + 1)
  914. },
  915. pathExt: function (e) {
  916. ;(e = e.replace(/\\/g, "/")), (e = e.replace(/\/+/g, "/"))
  917. var a = e.lastIndexOf(".")
  918. return (e = e.substr(a + 1)), e.toLowerCase()
  919. },
  920. path2url: function (e) {
  921. if ("http" == e.substr(0, 4)) return e
  922. if (((e = e.replace(/\\/g, "/")), (e = e.replace(/\/+/g, "/")), (e = e.replace(/\/\.*\//g, "/")), G.is_root && e.substring(0, G.web_root.length) == G.web_root)) return G.web_host + e.replace(G.web_root, "")
  923. var a = G.app_host + "/index.html?explorer/fileProxy&path=" + urlEncode(e)
  924. return G.share_page !== void 0 && (a = G.app_host + "/index.html?share/fileProxy&user=" + G.user + "&sid=" + G.sid + "&path=" + urlEncode(e)), a
  925. },
  926. authCheck: function (e, a) {
  927. return G.is_root ? !0 : AUTH.hasOwnProperty(e) ? (AUTH[e] ? !0 : (void 0 == a && (a = LNG.no_permission), core.tips.tips(a, !1), !1)) : !0
  928. },
  929. ajaxError: function (e) {
  930. core.tips.close(LNG.system_error, !1)
  931. var a = e.responseText,
  932. t = '<div class="ajaxError">' + a + "</div>",
  933. i = $.dialog.list.ajaxErrorDialog
  934. return "<!--user login-->" == a.substr(0, 17)
  935. ? (FrameCall.goRefresh(), void 0)
  936. : (i
  937. ? i.content(t)
  938. : $.dialog({
  939. id: "ajaxErrorDialog",
  940. padding: 0,
  941. fixed: !0,
  942. resize: !0,
  943. ico: core.ico("error"),
  944. title: "ajax error",
  945. content: t,
  946. }),
  947. void 0)
  948. },
  949. file_get: function (e, a) {
  950. var t = "index.html?editor/fileGet&filename=" + urlEncode2(e)
  951. G.share_page !== void 0 && (t = "index.html?share/fileGet&user=" + G.user + "&sid=" + G.sid + "&filename=" + urlEncode2(e)),
  952. ajax({
  953. url: t,
  954. dataType: "json",
  955. beforeSend: function () {
  956. core.tips.loading(LNG.loading)
  957. },
  958. error: core.ajaxError,
  959. success: function (e) {
  960. core.tips.close(LNG.success), "function" == typeof a && a(e.data.content)
  961. },
  962. })
  963. },
  964. setting: function (e) {
  965. void 0 == e && (e = G.is_root ? "system" : "user"),
  966. void 0 == window.top.frames.Opensetting_mode
  967. ? $.dialog.open("/setting.html?" + e, {
  968. id: "setting_mode",
  969. fixed: !0,
  970. ico: core.ico("setting"),
  971. resize: !0,
  972. title: LNG.setting,
  973. width: 1000,
  974. height: 560,
  975. })
  976. : ($.dialog.list.setting_mode.display(!0), FrameCall.top("Opensetting_mode", "Setting.setGoto", '"' + e + '"'))
  977. },
  978. plugin: function (config) {
  979. var id = "plugin_" + config.id
  980. $.dialog.open(config.url, {
  981. id: id,
  982. bottom: 0,
  983. simple: true,
  984. resize: false,
  985. title: config.title,
  986. width: config.width,
  987. height: config.height,
  988. left: "",
  989. top: "",
  990. padding: "0",
  991. fixed: true,
  992. })
  993. if (!config.top) {
  994. config.top = 20
  995. }
  996. if (!config.right) {
  997. config.right = 20
  998. }
  999. $("#" + id)
  1000. .parents(".dialog-simple")
  1001. .removeClass(id)
  1002. .addClass("plugin_dialog")
  1003. .css({
  1004. width: config.width,
  1005. height: config.height,
  1006. overflow: "hidden",
  1007. left: "",
  1008. top: config.top,
  1009. right: config.right,
  1010. })
  1011. $("#" + id)
  1012. .find(".aui_title")
  1013. .css({ height: "70px" })
  1014. $("#" + id + " .aui_close").hide()
  1015. },
  1016. copyright: function () {
  1017. var e = require("tpl/copyright.html"),
  1018. a = template.compile(e),
  1019. t = a({
  1020. LNG: LNG,
  1021. G: G,
  1022. AUTH: AUTH,
  1023. })
  1024. $.dialog({
  1025. id: "copyright_dialog",
  1026. bottom: 0,
  1027. right: 0,
  1028. simple: !0,
  1029. resize: !1,
  1030. title: LNG.about + " ",
  1031. width: 425,
  1032. padding: "0",
  1033. fixed: !0,
  1034. content: t,
  1035. })
  1036. var show = function (data) {
  1037. var contacts = ""
  1038. if (data.powerContact.length > 0) {
  1039. var arr = eval("(" + data.powerContact + ")")
  1040. if (arr.length > 0) {
  1041. contacts += '<table width="100%">'
  1042. contacts += '<tr><th style="border: #ccc solid 1px;">姓名</th>' + '<th style="border: #ccc solid 1px;">职位</th>' + '<th style="border: #ccc solid 1px;">电话</th>' + '<th style="border: #ccc solid 1px;">E-mail</th></tr>'
  1043. for (var i = 0; i < arr.length; i++) {
  1044. contacts +=
  1045. '<tr><td style="border: #ccc solid 1px;"><span>' + arr[i].name + "</td>" + '<td style="border: #ccc solid 1px;">' + arr[i].duty + "</td>" + '<td style="border: #ccc solid 1px;">' + arr[i].mobile + "</td>" + '<td style="border: #ccc solid 1px;">' + arr[i].email + "</span></td></tr>"
  1046. }
  1047. contacts += "</table>"
  1048. }
  1049. }
  1050. var html = '<span style="font-weight: bold; font-size: 18px;">企业基本信息:</span><br/>'
  1051. html += '<table width="600px">'
  1052. html += '<tr><td colspan="2"><span>名称:' + data.powerName + "</span></td>"
  1053. html += "<td><span>编号:" + (data.powerOrgId == undefined ? AUTH.company.id : data.powerOrgId) + "</span></td></tr>"
  1054. html += '<tr><td colspan="3"><span>地址:' + data.powerAddress + "</span></td></tr>"
  1055. html += '<tr><td width="33%"><span>企业类型:' + data.powerType + "</span></td>"
  1056. html += '<td width="33%"><span>级别:' + data.powerRank + "</span></td>"
  1057. html += '<td width="33%"><span>运行状态:' + data.powerState + "</span></td></tr>"
  1058. html += "<tr><td><span>供电电源:" + data.powerPowerSupply + "</span></td>"
  1059. html += "<td><span>电压等级:" + data.powerVoltageClass + "</span></td>"
  1060. html += "<td><span>基本电价:¥" + data.powerJbdj + "元</span></td></tr>"
  1061. html += "<tr><td><span>是否启用自定义电价:" + data.powerIsFgp + "</span></td>"
  1062. html += '<td colspan="2"><span>服务到期时间:' + data.powerExpiredDate + "</span></td></tr>"
  1063. html += '<tr><td colspan="3"><span>联系人列表:' + (contacts == "" ? "未设置" : "") + "</span></td></tr>"
  1064. if (contacts != "") {
  1065. html += '<tr><td colspan="3">' + contacts + "</td></tr>"
  1066. }
  1067. html += "</table>"
  1068. html += "<br/>"
  1069. html += '<span style="font-weight: bold; font-size: 18px;">承建单位信息:</span><br/>'
  1070. html += '<table width="600px">'
  1071. html += '<tr><td colspan="3"><span>名称:' + data.proxyName + "</span></td></tr>"
  1072. html += '<tr><td colspan="3"><span>地址:' + data.proxyAddress + "</span></td></tr>"
  1073. html += '<tr><td width="33%"><span>单位类型:' + data.proxyTg + "</span></td>"
  1074. html += '<td width="33%"><span>负责人:' + (data.proxyPrincipal ? data.proxyPrincipal : "未设置") + "</span></td>"
  1075. html += "<td><span>联系电话:" + (data.proxyTel ? data.proxyTel : "未设置") + "</span></td></tr>"
  1076. html += "</table>"
  1077. $(".copyright_dialog_content .content").html('<div style="text-align:left;">' + html + "</div>")
  1078. }
  1079. if (G.copyright) {
  1080. show(G.copyright)
  1081. return
  1082. }
  1083. ajax({
  1084. url: "web/desktop/getCompanyInfo.json",
  1085. success: function (d) {
  1086. G.copyright = d.data
  1087. show(G.copyright)
  1088. },
  1089. })
  1090. },
  1091. appStore: function () {
  1092. $.dialog.open("/app_store.html?auth_cid=" + $.query.get("auth_cid"), {
  1093. id: "app_store",
  1094. fixed: !0,
  1095. ico: "/images/app/appstore.png",
  1096. resize: !0,
  1097. title: LNG.app_store,
  1098. width: 1000,
  1099. height: 560,
  1100. })
  1101. },
  1102. openIE: function (e, opt) {
  1103. $.dialog.open(
  1104. e,
  1105. opt
  1106. ? opt
  1107. : {
  1108. fixed: !0,
  1109. resize: !0,
  1110. title: LNG.app_store,
  1111. width: "80%",
  1112. height: "70%",
  1113. }
  1114. )
  1115. },
  1116. openApp: function (app) {
  1117. if (1 == app.type || 3 == app.type) {
  1118. if (!G.is_root && AUTH.options[app.id] == undefined) {
  1119. core.tips.tips("您无权限打开此应用", "info")
  1120. return
  1121. }
  1122. var icon = app.icon
  1123. ;-1 == app.icon.search(G.static_path) && "http" != app.icon.substring(0, 4) && (icon = "/" + "images/app/" + app.icon),
  1124. "number" != typeof app.width && -1 == app.width.search("%") && (app.width = parseInt(app.width)),
  1125. "number" != typeof app.height && -1 == app.height.search("%") && (app.height = parseInt(app.height)),
  1126. (s =
  1127. 1 == app.type
  1128. ? app.content
  1129. : eval("(" + app.content + ")")
  1130. .join(",")
  1131. .replace(/,$/gi, "")),
  1132. (cid = $.query.get("auth_cid"))
  1133. $.dialog.open((1 == app.type ? "/app_3part.html" : "/app_menu.html") + "?auth_cid=" + cid + "&id=" + app.id + "&content=" + s, {
  1134. id: app.reopen == 1 ? "appwin_" + app.id : "",
  1135. title: app.name,
  1136. fixed: !0,
  1137. ico: icon,
  1138. resize: app.resize,
  1139. simple: app.border,
  1140. title: app.title.replace(".oexe", ""),
  1141. width: app.width,
  1142. height: app.height,
  1143. })
  1144. } else {
  1145. var exec = app.content
  1146. eval("{" + exec + "}")
  1147. }
  1148. },
  1149. update: function (e) {
  1150. var a = base64_decode("L2pzL21haW4uanM=") + "?a=" + UUID()
  1151. require.async(a, function (a) {
  1152. try {
  1153. a.todo(e)
  1154. } catch (t) {}
  1155. })
  1156. },
  1157. explorer: function (e, a) {
  1158. void 0 == e && (e = ""), void 0 == a && (a = core.pathThis(e))
  1159. var t = "explorer/index.html?type=iframe&path=" + e
  1160. G.share_page !== void 0 && (t = "share/index.html?type=iframe&user=" + G.user + "&sid=" + G.sid + "&path=" + e),
  1161. $.dialog.open(t, {
  1162. resize: !0,
  1163. fixed: !0,
  1164. ico: core.ico("folder"),
  1165. title: a,
  1166. width: 880,
  1167. height: 550,
  1168. })
  1169. },
  1170. explorerCode: function (e) {
  1171. void 0 == e && (e = "")
  1172. var a = "editor/index.html?project=" + e
  1173. G.share_page !== void 0 && (a = "share/index.html?code_read&user=" + G.user + "&sid=" + G.sid + "&project=" + e),
  1174. $.dialog.open(a, {
  1175. resize: !0,
  1176. fixed: !0,
  1177. ico: core.ico("folder"),
  1178. title: core.pathThis(e),
  1179. width: "80%",
  1180. height: "70%",
  1181. })
  1182. },
  1183. setSkin_finished: function () {
  1184. var e = $(".setSkin_finished").attr("src")
  1185. e && ($("#link_css_list").attr("href", e), $(".setSkin_finished").remove())
  1186. },
  1187. setSkin: function (e, a) {
  1188. var t = "/" + "css/skin/" + e + a
  1189. $("body").append('<img src="' + t + '" onload="core.setSkin_finished();" onerror="core.setSkin_finished();" class="setSkin_finished">')
  1190. },
  1191. editorFull: function () {
  1192. var e = $("iframe[name=OpenopenEditor]")
  1193. e.toggleClass("frame_fullscreen")
  1194. },
  1195. language: function (e) {
  1196. Cookie.set("sys_user_language", e, 8760), window.location.reload()
  1197. },
  1198. tips: {
  1199. topHeight: function () {
  1200. return "undefined" != typeof Global && Global.topbar_height ? Global.topbar_height : 0
  1201. },
  1202. loading: function (e) {
  1203. Tips.loading(e, "info", core.tips.topHeight())
  1204. },
  1205. close: function (e, a) {
  1206. "object" == typeof e ? Tips.close(e.data, e.code, core.tips.topHeight()) : Tips.close(e, a, core.tips.topHeight())
  1207. },
  1208. tips: function (e, a) {
  1209. "object" == typeof e ? Tips.tips(e.data, e.code, core.tips.topHeight()) : Tips.tips(e, a, core.tips.topHeight())
  1210. },
  1211. },
  1212. fullScreen: function () {
  1213. "true" == $("body").attr("fullScreen") && core.exitfullScreen(), $("body").attr("fullScreen", "true")
  1214. var e = document.documentElement
  1215. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullScreen && e.webkitRequestFullScreen()
  1216. },
  1217. exitfullScreen: function () {
  1218. $("body").attr("fullScreen", "false"), document.exitFullscreen ? document.exitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitCancelFullScreen && document.webkitCancelFullScreen()
  1219. },
  1220. createFlash: function (e, a, t) {
  1221. var i =
  1222. '<object type="application/x-shockwave-flash" id="' +
  1223. t +
  1224. '" data="' +
  1225. e +
  1226. '" width="100%" height="100%">' +
  1227. '<param name="movie" value="' +
  1228. e +
  1229. '"/>' +
  1230. '<param name="allowfullscreen" value="true" />' +
  1231. '<param name="allowscriptaccess" value="always" />' +
  1232. '<param name="flashvars" value="' +
  1233. a +
  1234. '" />' +
  1235. '<param name="wmode" value="transparent" />' +
  1236. "</object>"
  1237. return i
  1238. },
  1239. search: function (e, a) {
  1240. var t,
  1241. i,
  1242. n = require("tpl/search.html"),
  1243. s = require("tpl/search_list.html"),
  1244. o = function () {
  1245. var s = template.compile(n)
  1246. 0 == $(".dialog_do_search").length
  1247. ? (l(),
  1248. (i = {
  1249. search: e,
  1250. path: a,
  1251. is_content: void 0,
  1252. is_case: void 0,
  1253. ext: "",
  1254. LNG: LNG,
  1255. }),
  1256. (t = $.dialog({
  1257. id: "dialog_do_search",
  1258. padding: 0,
  1259. fixed: !0,
  1260. ico: core.ico("search"),
  1261. resize: !0,
  1262. title: LNG.search,
  1263. width: 450,
  1264. content: s(i),
  1265. })),
  1266. c(i),
  1267. $("#search_ext").tooltip({
  1268. placement: "bottom",
  1269. html: !0,
  1270. }),
  1271. $("#search_path").tooltip({
  1272. placement: "bottom",
  1273. html: !0,
  1274. title: function () {
  1275. return $("#search_path").val()
  1276. },
  1277. }))
  1278. : ($("#search_value").val(e), $("#search_path").val(a), r(), $.dialog.list.dialog_do_search.display(!0))
  1279. },
  1280. r = function () {
  1281. ;(i = {
  1282. search: $("#search_value").val(),
  1283. path: $("#search_path").val(),
  1284. is_content: $("#search_is_content").attr("checked"),
  1285. is_case: $("#search_is_case").attr("checked"),
  1286. ext: $("#search_ext").val(),
  1287. }),
  1288. c(i)
  1289. },
  1290. l = function () {
  1291. $("#search_value")
  1292. .die("keyup")
  1293. .live("keyup", function () {
  1294. ui.path.setSearchByStr($(this).val())
  1295. }),
  1296. $("#search_value,#search_ext,#search_path").keyEnter(r),
  1297. $(".search_header a.button").die("click").live("click", r),
  1298. $(".search_result .list .name")
  1299. .die("click")
  1300. .live("click", function () {
  1301. var e = $(this).find("a").html(),
  1302. a = $(this).parent().find(".path a").html() + e
  1303. $(this).parent().hasClass("file") ? ui.pathOpen.open(a) : "explorer" == Config.pageApp ? ui.path.list(a + "/", "tips") : core.explorer(a + "/")
  1304. }),
  1305. $(".search_result .list .path a")
  1306. .die("click")
  1307. .live("click", function () {
  1308. var e = $(this).html()
  1309. "explorer" == Config.pageApp ? ui.path.list(e, "tips") : core.explorer(e)
  1310. })
  1311. },
  1312. c = function (e) {
  1313. var a = 150
  1314. $("#search_value").focus(), $(".search_result .list").remove()
  1315. var t = $(".search_result .message td")
  1316. if (!e.search || !e.path) return t.hide().html(LNG.search_info).fadeIn(a), void 0
  1317. if (1 >= e.search.length) return t.hide().html("too short!").fadeIn(a), void 0
  1318. var i = "explorer/index.html?search"
  1319. G.share_page !== void 0 && (i = "share/index.html?share/search&user=" + G.user + "&sid=" + G.sid),
  1320. ajax({
  1321. url: i,
  1322. dataType: "json",
  1323. type: "POST",
  1324. data: e,
  1325. beforeSend: function () {
  1326. t.hide()
  1327. .html(LNG.searching + '<img src="/images/loading.gif">')
  1328. .fadeIn(a)
  1329. },
  1330. error: core.ajaxError,
  1331. success: function (e) {
  1332. if (!e.code) return t.hide().html(e.data).fadeIn(a), void 0
  1333. if (0 == e.data.filelist.length && 0 == e.data.folderlist.length) return t.hide().html(LNG.search_null).fadeIn(a), void 0
  1334. t.hide()
  1335. var i = template.compile(s)
  1336. ;(e.data.LNG = LNG), $(i(e.data)).insertAfter(".search_result .message").fadeIn(a)
  1337. },
  1338. })
  1339. }
  1340. o()
  1341. },
  1342. server_dwonload: function (e) {
  1343. core.upload_check("explorer:serverDownload")
  1344. var a = $(".download_box"),
  1345. t = a.find("#download_list"),
  1346. i = a.find("input").val()
  1347. if ((a.find("input").val(""), !i || "http" != i.substr(0, 4))) return core.tips.tips("url false!", !1), void 0
  1348. var n = UUID(),
  1349. s =
  1350. '<div id="' +
  1351. n +
  1352. '" class="item">' +
  1353. '<div class="info"><span class="title" tytle="' +
  1354. i +
  1355. '">' +
  1356. core.pathThis(i) +
  1357. "</span>" +
  1358. '<span class="size">0b</span>' +
  1359. '<span class="state">' +
  1360. LNG.upload_ready +
  1361. "</span>" +
  1362. '<a class="remove fa fa-remove" href="javascript:void(0)"></a>' +
  1363. '<div style="clear:both"></div></div></div>'
  1364. t.find(".item").length > 0 ? $(s).insertBefore(t.find(".item:eq(0)")) : t.append(s)
  1365. var o,
  1366. r,
  1367. l,
  1368. c = 0,
  1369. d = $("#" + n),
  1370. p = $("#" + n + " .state").text(LNG.download_ready),
  1371. u = $('<div class="progress progress-striped active"><div class="progress-bar" role="progressbar" style="width: 0%;text-align:right;"></div></div>')
  1372. .appendTo("#" + n)
  1373. .find(".progress-bar")
  1374. $("#" + n + " .remove").bind("click", function () {
  1375. $.get("explorer/index.html?explorer/serverDownload&type=remove&uuid=" + n),
  1376. $(this)
  1377. .parent()
  1378. .parent()
  1379. .slideUp(function () {
  1380. $(this).remove(), ui.f5()
  1381. })
  1382. }),
  1383. ajax({
  1384. url: "explorer/index.html?explorer/serverDownload&type=download&save_path=" + e + "&url=" + urlEncode2(i) + "&uuid=" + n,
  1385. dataType: "json",
  1386. error: function (e, a, t) {
  1387. core.ajaxError(e, a, t), clearInterval(o), (o = !1), clearTimeout(r), (o = !1), u.parent().remove(), p.addClass("error").text(LNG.download_error)
  1388. },
  1389. success: function (e) {
  1390. clearInterval(o),
  1391. (o = !1),
  1392. clearTimeout(r),
  1393. (o = !1),
  1394. e.code
  1395. ? (ui.f5_callback(function () {
  1396. ui.path.setSelectByFilename(e.info)
  1397. }),
  1398. p.text(LNG.download_success),
  1399. $("#" + n + " .info .title").html(e.info))
  1400. : p.addClass("error").text(LNG.error),
  1401. u.parent().remove()
  1402. },
  1403. })
  1404. var h = function () {
  1405. ajax({
  1406. url: "explorer/index.html?explorer/serverDownload&type=percent&uuid=" + n,
  1407. dataType: "json",
  1408. success: function (e) {
  1409. var a = "",
  1410. t = e.data
  1411. if (o) {
  1412. if (!e.code) return p.text(LNG.loading), void 0
  1413. if (t) {
  1414. if (((t.size = parseFloat(t.size)), (t.time = parseFloat(t.time)), l)) {
  1415. var i = (t.size - l.size) / (t.time - l.time)
  1416. if (c > 0.2 * i) {
  1417. var n = c
  1418. ;(c = i), (i = n)
  1419. } else c = i
  1420. a = core.file_size(i) + "/s"
  1421. }
  1422. if (0 == t.length) d.find(".progress-bar").css("width", "100%").text(LNG.loading)
  1423. else {
  1424. var s = 100 * (t.size / t.length)
  1425. d.find(".progress-bar").css("width", s + "%"), p.text(parseInt(s) + "%(" + a + ")")
  1426. }
  1427. d.find(".size").text(core.file_size(t.length)), (l = t)
  1428. }
  1429. }
  1430. },
  1431. })
  1432. }
  1433. r = setTimeout(function () {
  1434. h(),
  1435. (o = setInterval(function () {
  1436. h()
  1437. }, 1e3))
  1438. }, 100)
  1439. },
  1440. file_size: function (e) {
  1441. if (0 == e) return "0B"
  1442. e = parseFloat(e)
  1443. var a = {
  1444. GB: 1073741824,
  1445. MB: 1048576,
  1446. KB: 1024,
  1447. "B ": 0,
  1448. }
  1449. for (var t in a) if (e >= a[t]) return (e / a[t]).toFixed(1) + t
  1450. return "0B"
  1451. },
  1452. upload_check: function (e) {
  1453. return (
  1454. void 0 == e && (e = "explorer:fileUpload"),
  1455. !G.is_root && AUTH.hasOwnProperty(e) && 1 != AUTH[e]
  1456. ? (core.tips.tips(LNG.no_permission, !1), void 0)
  1457. : "*recycle*/" == G.this_path || "*share*/" == G.this_path || "*share*/" == G.this_path || (G.json_data && "writeable" != G.json_data.path_type)
  1458. ? (core.tips.tips(LNG.no_permission_write, !1), !1)
  1459. : !0
  1460. )
  1461. },
  1462. upload: function () {
  1463. G.upload_path = G.this_path
  1464. var e = urlDecode(G.upload_path)
  1465. if ((uploader.option("server", "explorer/index.html?explorer/fileUpload&path=" + urlEncode(G.upload_path)), 30 >= e.length ? e : "..." + e.substr(e.length - 30), 0 != $(".dialog_file_upload").length)) return $.dialog.list.dialog_file_upload.display(!0), void 0
  1466. var a = require(".tpl/upload.html"),
  1467. t = template.compile(a),
  1468. i = WebUploader.Base.formatSize(G.upload_max)
  1469. $.dialog({
  1470. padding: 5,
  1471. resize: !0,
  1472. ico: core.ico("up"),
  1473. id: "dialog_file_upload",
  1474. fixed: !0,
  1475. title: LNG.upload_muti,
  1476. content: t({
  1477. LNG: LNG,
  1478. maxsize: i,
  1479. }),
  1480. close: function () {
  1481. $.each(uploader.getFiles(), function (e, a) {
  1482. uploader.skipFile(a), uploader.removeFile(a)
  1483. })
  1484. },
  1485. }),
  1486. $(".file_upload .tips").tooltip({
  1487. placement: "bottom",
  1488. }),
  1489. $(".file_upload .top_nav a.menu")
  1490. .unbind("click")
  1491. .bind("click", function () {
  1492. $(this).hasClass("tab_upload")
  1493. ? ($(".file_upload .tab_upload").addClass("this"), $(".file_upload .tab_download").removeClass("this"), $(".file_upload .upload_box").removeClass("hidden"), $(".file_upload .download_box").addClass("hidden"))
  1494. : ($(".file_upload .tab_upload").removeClass("this"), $(".file_upload .tab_download").addClass("this"), $(".file_upload .upload_box").addClass("hidden"), $(".file_upload .download_box").removeClass("hidden"))
  1495. }),
  1496. $(".file_upload .download_box button")
  1497. .unbind("click")
  1498. .bind("click", function () {
  1499. core.server_dwonload(G.upload_path)
  1500. }),
  1501. uploader.addButton({
  1502. id: "#picker",
  1503. })
  1504. },
  1505. upload_init: function () {
  1506. var e = "#thelist",
  1507. a = !0
  1508. $.browser.msie && (a = !1)
  1509. var t = 10485760
  1510. t >= G.upload_max && (t = 0.8 * G.upload_max),
  1511. (uploader = WebUploader.create({
  1512. swf: G.static_path + "js/lib/webuploader/Uploader.swf",
  1513. dnd: "body",
  1514. threads: 2,
  1515. compress: !1,
  1516. resize: !1,
  1517. prepareNextFile: !0,
  1518. duplicate: !0,
  1519. chunked: a,
  1520. chunkRetry: 3,
  1521. chunkSize: t,
  1522. })),
  1523. $("#uploader .success")
  1524. .die("click")
  1525. .live("click", function () {
  1526. var e = $(this).find("span.title").attr("title")
  1527. "explorer" == Config.pageApp
  1528. ? ui.path.list(core.pathFather(e), "tips", function () {
  1529. ui.path.setSelectByFilename(core.pathThis(e))
  1530. })
  1531. : core.explorer(core.pathFather(e))
  1532. }),
  1533. $("#uploader .open")
  1534. .die("click")
  1535. .live("click", function (e) {
  1536. var a = $(this).find("span.title").attr("title")
  1537. ui.pathOpen.open(a), stopPP(e)
  1538. }),
  1539. $(".upload_box_clear")
  1540. .die("click")
  1541. .live("click", function () {
  1542. $("#thelist .success,#thelist .error").each(function () {
  1543. $(this).slideUp(300, function () {
  1544. $(this).remove()
  1545. })
  1546. })
  1547. }),
  1548. $(".upload_box_setting")
  1549. .die("click")
  1550. .live("click", function () {
  1551. $(".upload_box_config").toggleClass("hidden")
  1552. }),
  1553. $("#uploader .remove")
  1554. .die("click")
  1555. .live("click", function (e) {
  1556. var a = $(this).parent().parent().attr("id")
  1557. uploader.skipFile(a),
  1558. uploader.removeFile(a, !0),
  1559. $(this)
  1560. .parent()
  1561. .parent()
  1562. .slideUp(function () {
  1563. $(this).remove()
  1564. }),
  1565. stopPP(e)
  1566. })
  1567. var i = 0,
  1568. n = 0,
  1569. s = "0B/s",
  1570. o = function (e, a) {
  1571. var t = e.size * a,
  1572. i = 3
  1573. e.speed === void 0
  1574. ? (e.speed = [
  1575. [time() - 500, 0],
  1576. [time(), t],
  1577. ])
  1578. : i >= e.speed.length
  1579. ? e.speed.push([time(), t])
  1580. : ((e.speed = e.speed.slice(1, i)), e.speed.push([time(), t]))
  1581. var n = e.speed[e.speed.length - 1],
  1582. o = e.speed[0],
  1583. r = (n[1] - o[1]) / ((n[0] - o[0]) / 1e3)
  1584. return (r = core.file_size(r) + "/s"), (s = r), r
  1585. },
  1586. r = []
  1587. uploader
  1588. .on("uploadBeforeSend", function (e, a) {
  1589. var t = urlEncode(e.file.fullPath)
  1590. ;(void 0 == t || "undefined" == t) && (t = ""), (a.fullPath = t)
  1591. })
  1592. .on("fileQueued", function (a) {
  1593. if (!core.upload_check()) return uploader.skipFile(a), uploader.removeFile(a), void 0
  1594. var t,
  1595. n = $(e),
  1596. t = a.fullPath
  1597. ;(a.finished = !1), (void 0 == t || "undefined" == t) && (t = a.name), i++, $(e).find(".item").length > 0 && (n = $(e).find(".item:eq(0)"))
  1598. var s =
  1599. '<div id="' +
  1600. a.id +
  1601. '" class="item"><div class="info">' +
  1602. '<span class="title" title="' +
  1603. G.upload_path +
  1604. t +
  1605. '">' +
  1606. core.pathThis(t) +
  1607. "</span>" +
  1608. '<span class="size">' +
  1609. core.file_size(a.size) +
  1610. "</span>" +
  1611. '<span class="state">' +
  1612. LNG.upload_ready +
  1613. "</span>" +
  1614. '<a class="remove fa fa-remove" href="javascript:void(0)"></a>' +
  1615. '<div style="clear:both"></div></div></div>'
  1616. $(e).find(".item").length > 0 ? $(s).insertBefore($(e).find(".item:eq(0)")) : $(e).append(s), uploader.upload()
  1617. })
  1618. .on("uploadProgress", function (e, a) {
  1619. $(".dialog_file_upload .aui_title").text(LNG.uploading + ": " + n + "/" + i + " (" + s + ")")
  1620. var t = o(e, a),
  1621. r = $("#" + e.id),
  1622. l = r.find(".progress .progress-bar")
  1623. l.length || (l = $('<div class="progress progress-striped active"><div class="progress-bar" role="progressbar" style="width: 0%"></div></div>').appendTo(r).find(".progress-bar")), r.find(".state").text(parseInt(100 * a) + "%(" + t + ")"), l.css("width", 100 * a + "%")
  1624. })
  1625. .on("uploadAccept", function (e, a) {
  1626. e.file.serverData = a
  1627. try {
  1628. r.push(core.pathThis(a.info))
  1629. } catch (t) {}
  1630. })
  1631. .on("uploadSuccess", function (e) {
  1632. var a = 36 * $("#" + e.id).index(".item")
  1633. $("#uploader").scrollTop(a), n++
  1634. var t = e.serverData
  1635. if (
  1636. (t.code
  1637. ? ($("#" + e.id).addClass("success"),
  1638. $("#" + e.id)
  1639. .find(".state")
  1640. .text(t.data),
  1641. $("#" + e.id)
  1642. .find(".remove")
  1643. .removeClass("fa-remove")
  1644. .addClass("fa-ok")
  1645. .addClass("open")
  1646. .removeClass("remove"))
  1647. : ($("#" + e.id)
  1648. .find(".state")
  1649. .addClass("error"),
  1650. $("#" + e.id)
  1651. .find(".state")
  1652. .text(t.data)
  1653. .attr("title", t.data)),
  1654. uploader.removeFile(e),
  1655. $("#" + e.id)
  1656. .find(".progress")
  1657. .fadeOut(),
  1658. !e.fullPath)
  1659. ) {
  1660. var i = r
  1661. ui.f5_callback(function () {
  1662. ui.path.setSelectByFilename(i)
  1663. })
  1664. }
  1665. })
  1666. .on("uploadError", function (e, a) {
  1667. n++,
  1668. $("#" + e.id)
  1669. .find(".progress")
  1670. .fadeOut(),
  1671. $("#" + e.id)
  1672. .find(".state")
  1673. .addClass("error"),
  1674. $("#" + e.id)
  1675. .find(".state")
  1676. .text(LNG.upload_error + "(" + a + ")")
  1677. })
  1678. .on("uploadFinished", function () {
  1679. $(".dialog_file_upload .aui_title").text(LNG.upload_success + ": " + n + "/" + i), (i = 0), (n = 0), uploader.reset(), "explorer" == Config.pageApp && ui.tree.checkIfChange(G.this_path)
  1680. var e = r
  1681. ui.f5_callback(function () {
  1682. ui.path.setSelectByFilename(e), (r = [])
  1683. })
  1684. })
  1685. .on("error", function (e) {
  1686. core.tips.tips(e, !1)
  1687. })
  1688. var l
  1689. ;(inState = !1),
  1690. (dragOver = function () {
  1691. 0 == inState && ((inState = !0), MaskView.tips(LNG.upload_drag_tips)), l && window.clearTimeout(l)
  1692. }),
  1693. (dragLeave = function (e) {
  1694. stopPP(e),
  1695. l && window.clearTimeout(l),
  1696. (l = window.setTimeout(function () {
  1697. ;(inState = !1), MaskView.close()
  1698. }, 100))
  1699. }),
  1700. (dragDrop = function (e) {
  1701. try {
  1702. if (((e = e.originalEvent || e), core.upload_check())) {
  1703. var a = e.dataTransfer.getData("text/plain")
  1704. a && "http" == a.substring(0, 4) ? ui.pathOperate.appAddURL(a) : core.upload()
  1705. }
  1706. stopPP(e)
  1707. } catch (e) {}
  1708. inState && ((inState = !1), MaskView.close())
  1709. })
  1710. },
  1711. }
  1712. }),
  1713. define(
  1714. "tpl/copyright.html",
  1715. [],
  1716. '<div class="copyright_dialog_content">\n <div class="title" style="height:110px;">\n <div class="logo"><!--<span><img src="' +
  1717. "/" +
  1718. "images/desktop/" +
  1719. (AUTH.company ? AUTH.company.domain + '.start.png"' : "") +
  1720. ' style="width:40px; height:40px;margin-right: 10px;margin-top: -6px;"/></span>--><span style="font-size:30px;">' +
  1721. (AUTH.company ? AUTH.company.name : "") +
  1722. "<!--v{{G.version}}--></span></div>\n <div class='info'><!--——{{LNG.sys_name_copyright}}--></div>\n </div>\n <div class=\"content\">正在载入...</div>\n</div>"
  1723. ),
  1724. define(
  1725. "tpl/search.html",
  1726. [],
  1727. "<div class='do_search'>\n <div class='search_header'>\n <div class='s_br'>\n <input type='text' id='search_value' value='{{search}}'/><a class='right button fa-search'></a>\n <div style='float:right'>{{LNG.path}}:<input type='text' id='search_path' value='{{path}}'/></div>\n </div>\n <div class='s_br'>\n <input type='checkbox' id='search_is_case' {{#if is_case}}checked='true'{{/if}}/>\n <label for='search_is_case'>{{LNG.search_uplow}}</label>\n <input type='checkbox' id='search_is_content' {{#if is_content}}checked='true'{{/if}}/>\n <label for='search_is_content'>{{LNG.search_content}}</label>\n <div style='float:right'>{{LNG.file_type}}:<input type='text' id='search_ext' value='{{ext}}' title='{{LNG.search_ext_tips}}'/></div>\n </div>\n </div>\n <div class='search_result'>\n <table border='0' cellspacing='0' cellpadding='0'>\n <tr class='search_title'>\n <td class='name'>{{LNG.name}}</td>\n <td class='type'>{{LNG.type}}</td>\n <td class='size'>{{LNG.size}}</td>\n <td class='path'>{{LNG.path}}</td>\n </tr>\n <tr class='message'><td colspan='4'></td></tr>\n </table>\n </div>\n</div>\n\n"
  1728. ),
  1729. define(
  1730. "tpl/search_list.html",
  1731. [],
  1732. "{{#each folderlist as v i}}\n <tr class='list folder' data-path='{{v.path}}{{v.name}}' data-type='folder' data-size='0'>\n <td class='name'><a href='javascript:void(0);' title='{{LNG.open}}{{v.name}}'>{{v.name}}</a></td>\n <td class='type'>{{LNG.folder}}</td>\n <td class='size'>0</td>\n <td class='path'><a href='javascript:void(0);' title='{{LNG.goto}}{{v.path}}'>{{v.path}}</a></td>\n </tr>\n{{/each}}\n{{#each filelist as v i}}\n<tr class='list file'\n data-path='{{v.path}}{{v.name}}' \n data-type='{{v.ext}}' \n data-size='{{v.size}}'>\n <td class='name'><a href='javascript:void(0);' title='{{LNG.open}}{{v.name}}'>{{v.name}}</a></td>\n <td class='type'>{{v.ext}}</td>\n <td class='size'>{{v.size_friendly}}</td>\n <td class='path'><a href='javascript:void(0);' title='{{LNG.goto}}{{v.path}}'>{{v.path}}</a></td>\n</tr>\n{{/each}}"
  1733. ),
  1734. define(
  1735. "tpl/upload.html",
  1736. [],
  1737. "<div class='file_upload'>\n <div class='top_nav'>\n <a href='javascript:void(0);' class='menu this tab_upload'>{{LNG.upload_local}}</a>\n <a href='javascript:void(0);' class='menu tab_download''>{{LNG.download_from_server}}</a>\n <div style='clear:both'></div>\n </div>\n <div class='upload_box'>\n <div class='btns'>\n <div id='picker'>{{LNG.upload_select}}</div>\n <div class=\"upload_box_tips\">\n <a href=\"javascript:void(0);\" class=\"upload_box_clear\">{{LNG.upload_clear}}</a> \n <!-- \n | <a href=\"javascript:void(0);\" class=\"upload_box_setting\">\n {{LNG.upload_setting}}<b class=\"caret\"></b></a> \n -->\n </div>\n <div style='clear:both'></div>\n </div>\n\n <div class=\"upload_box_config hidden\">\n <i>{{LNG.upload_tips}}</i>\n <div class=\"upload_check_box\">\n <b>{{LNG.upload_exist}}</b>\n <label><input type=\"radio\" name=\"existing\" value=\"rename\" checked=\"checked\">{{LNG.upload_exist_rename}}</label>\n <label><input type=\"radio\" name=\"existing\" value=\"replace\">{{LNG.upload_exist_replace}}</label>\n <label><input type=\"radio\" name=\"existing\" value=\"skip\">{{LNG.upload_exist_skip}}</label>\n </div>\n </div>\n <div id='uploader' class='wu-example'>\n <div id='thelist' class='uploader-list'></div>\n </div>\n </div>\n <div class='download_box hidden'>\n <div class='list'>{{LNG.download_address}}<input type='text' name='url'/>\n <button class='btn btn-default btn-sm' type='button'>{{LNG.download}}</button>\n </div>\n <div style='clear:both'></div>\n <div id='downloader'>\n <div id='download_list' class='uploader-list'></div>\n </div>\n </div>\n</div>"
  1738. ),
  1739. define("desktop/rightMenu", [], function (require, exports) {
  1740. var fileMenuSelector = ".menufile",
  1741. folderMenuSelector = ".menufolder",
  1742. selectMoreSelector = ".menuMore",
  1743. selectTreeSelectorRoot = ".menuTreeRoot",
  1744. selectTreeSelectorFolder = ".menuTreeFolder",
  1745. selectTreeSelectorFile = ".menuTreeFile",
  1746. common_menu = {
  1747. newfileOther: {
  1748. name: LNG.newfile,
  1749. icon: "plus-square-o",
  1750. accesskey: "w",
  1751. className: "newfolder",
  1752. items: {
  1753. newfile: {
  1754. name: "txt " + LNG.file,
  1755. icon: "file-alt",
  1756. className: "newfile",
  1757. },
  1758. newfile_html: {
  1759. name: "html " + LNG.file,
  1760. icon: "file-alt",
  1761. className: "newfile",
  1762. },
  1763. newfile_php: {
  1764. name: "php " + LNG.file,
  1765. icon: "file-alt",
  1766. className: "newfile",
  1767. },
  1768. newfile_js: {
  1769. name: "js " + LNG.file,
  1770. icon: "file-alt",
  1771. className: "newfile",
  1772. },
  1773. newfile_css: {
  1774. name: "css " + LNG.file,
  1775. icon: "file-alt",
  1776. className: "newfile",
  1777. },
  1778. app_create: {
  1779. name: LNG.app_create,
  1780. icon: "puzzle-piece",
  1781. className: "line_top newfile",
  1782. },
  1783. },
  1784. },
  1785. listIcon: {
  1786. name: LNG.list_type,
  1787. icon: "eye",
  1788. items: {
  1789. seticon: {
  1790. name: LNG.list_icon,
  1791. className: "menu_seticon set_seticon",
  1792. },
  1793. setlist: {
  1794. name: LNG.list_list,
  1795. className: "menu_seticon set_setlist",
  1796. },
  1797. },
  1798. },
  1799. sortBy: {
  1800. name: LNG.order_type,
  1801. accesskey: "y",
  1802. icon: "sort",
  1803. items: {
  1804. set_sort_name: {
  1805. name: LNG.name,
  1806. className: "menu_set_sort set_sort_name",
  1807. },
  1808. set_sort_ext: {
  1809. name: LNG.type,
  1810. className: "menu_set_sort set_sort_ext",
  1811. },
  1812. set_sort_size: {
  1813. name: LNG.size,
  1814. className: "menu_set_sort set_sort_size",
  1815. },
  1816. set_sort_mtime: {
  1817. name: LNG.modify_time,
  1818. className: "menu_set_sort set_sort_mtime",
  1819. },
  1820. set_sort_up: {
  1821. name: LNG.sort_up,
  1822. className: "menu_set_desc set_sort_up line_top",
  1823. },
  1824. set_sort_down: {
  1825. name: LNG.sort_down,
  1826. className: "menu_set_desc set_sort_down",
  1827. },
  1828. },
  1829. },
  1830. },
  1831. _init_explorer = function () {
  1832. $('<div id="rightMenu" class="hidden"></div>').appendTo("body"),
  1833. $(".context-menu-list")
  1834. .die("click")
  1835. .live("click", function (e) {
  1836. return stopPP(e), !1
  1837. }),
  1838. _bindBody_explorer(),
  1839. _bindFolder(),
  1840. _bindFile(),
  1841. _bindSelectMore(),
  1842. _bindTreeFav(),
  1843. _bindTreeRoot(),
  1844. _bindTreeFolder(),
  1845. _bindDialog(),
  1846. _bindTask(),
  1847. _bindTaskBar(),
  1848. _bindRecycle(),
  1849. _bindShare(),
  1850. _auth_change_menu(),
  1851. $(".set_set" + G.list_type).addClass("selected"),
  1852. $(".set_sort_" + G.sort_field).addClass("selected"),
  1853. $(".set_sort_" + G.sort_order).addClass("selected"),
  1854. $(".context-menu-root").addClass("fadein")
  1855. },
  1856. _init_desktop = function () {
  1857. $('<div id="rightMenu" class="hidden"></div>').appendTo("body"),
  1858. $(".context-menu-list")
  1859. .die("click")
  1860. .live("click", function (e) {
  1861. return stopPP(e), !1
  1862. }),
  1863. _bindBody_desktop(),
  1864. _bindSystem(),
  1865. _bindFolder(),
  1866. _bindFile(),
  1867. _bindTask(),
  1868. _bindDialog(),
  1869. _bindSelectMore(),
  1870. _bindTaskBar(),
  1871. _bindRecycle(),
  1872. _auth_change_menu(),
  1873. $(".set_sort_" + G.sort_field).addClass("selected"),
  1874. $(".set_sort_" + G.sort_order).addClass("selected"),
  1875. $(".context-menu-root").addClass("fadein")
  1876. },
  1877. _init_editor = function () {
  1878. $('<div id="rightMenu" class="hidden"></div>').appendTo("body"),
  1879. $(".context-menu-list")
  1880. .die("click")
  1881. .live("click", function (e) {
  1882. return stopPP(e), !1
  1883. }),
  1884. _bindTreeFav(),
  1885. _bindTreeRoot(),
  1886. _bindTask(),
  1887. _bindDialog(),
  1888. _bindTreeFolderEditor(),
  1889. _bindEditorFile(),
  1890. _bindTaskBar(),
  1891. _auth_change_menu(),
  1892. $(".context-menu-root").addClass("fadein")
  1893. },
  1894. _auth_change_menu = function () {
  1895. if (
  1896. ((window.require = require),
  1897. eval(
  1898. "‍‌‌‍‌‍‍‌‍‌‌‍‍‌‌‍‍‍‌‍‌‍‍‍‍‌‌‌‍‌‍‍‍‌‌‌‌‍‍‌‍‌‌‌‍‍‍‍‍‌‌‍‍‌‍‌‍‌‌‍‌‌‌‌‍‌‌‍‍‌‌‍‍‍‌‍‍‍‍‍‍‌‌‍‍‌‍‍‍‌‌‍‌‍‍‌‍‌‌‍‍‍‍‌‍‌‌‍‌‌‍‍‍‌‌‍‌‌‌‌‍‌‌‍‍‌‌‌‍‌‍‌‌‌‌‌‍‌‌‌‍‌‍‍‍‌‌‌‍‍‍‍‍‌‌‍‌‌‍‍‍‌‍‌‌‌‌‌‍‌‌‍‌‍‍‍‍‌‌‌‍‌‍‍‍‌‌‍‌‌‍‌‍‌‌‍‌‌‍‍‍‍‌‍‍‍‍‌‍‍‌‌‌‌‍‌‍‍‌‍‍‍‌‍‍‌‌‌‍‌‍‌‍‌‌‍‌‌‌‍‍‌‌‍‍‌‍‍‍‌‌‍‍‌‍‌‍‌‌‍‍‌‌‍‍‌‌‍‌‍‍‌‍‌‌‍‌‌‌‍‍‌‌‍‍‌‍‌‍‌‌‍‍‌‍‍‍‍‌‍‍‍‌‍‍‍‌‍‌‍‍‌‍‌‌‌‌‍‌‌‍‌‌‌‍‌‌‍‍‌‌‍‍‍‍‌‍‌‌‌‍‍‌‍‍‍‌‍‍‍‍‍‍‌‌‌‍‌‍‌‍‌‌‌‍‍‌‍‍‌‌‍‌‌‍‍‍‍‌‌‌‌‍‌‍‍‌‍‍‍‌‍‍‌‌‍‌‍‍‍‍‌‌‌‍‌‍‍‍‌‌‌‍‌‍‍‍‌‌‌‍‍‍‍‍‍‌‌‌‍‌‍‍‍‌‍‌‌‌‌‍‍‌‍‌‌‌‌‍‌‌‌‍‍‌‌‍‌‌‌‍‌‍‍‍‌‌‍‍‍‍‌‍‌‌‌‍‌‍‍‍‌‌‍‌‍‍‌‍‌‌‍‍‍‌‌‍‍‌‍‌‌‌‍‍‌‌‍‌‍‌‌‍‌‌‍‍‍‍‌‍‌‌‍‌‌‍‍‍‌‌‍‍‍‌‌‍‌‌‍‍‍‍‌‍‌‌‍‍‌‍‍‍‌‌‍‍‌‍‍‍‌‌‍‌‌‍‍‍‌‌‍‍‌‍‌‍‍‌‍‌‌‌‍‍‌‌‍‍‍‌‌‍‌‌‍‌‌‌‌‍‌‌‍‌‌‍‌‍‍‌‍‌‌‌‌‍‌‌‌‍‌‍‌‍‌‌‌‍‍‍‍‍‌‌‍‍‌‍‍‍‌‌‍‍‍‍‌‍‌‌‌‍‌‍‍‍‌‌‍‍‌‍‌‍‍‌‍‌‌‌‌‍‌‌‍‌‌‍‌‍‌‌‍‍‍‍‌‍‌‌‍‌‍‍‌‍‌‌‍‌‌‌‍‍‍‌‍‌‌‌‍‍‌‌‍‌‍‌‍‍‌‌‌‍‍‌‌‍‍‌‌‌‌‌‌‍‌‌‌‍‌‍‍‍‌‌‍‌‍‍‌‍‌‌‍‍‌‍‍‍‍‌‌‌‌‍‌‍‍‌‍‍‍‌‍‍‍‌‍‌‍‌‌‍‌‍‌‍‌‍‌‍‌‍‌‍‌‍‌‍‌‍‍‌‍‍‌‍‌‍‍‍‌‍‍‍‍‌‍‌‍‍‍‍‍‌‍‌‍‍‌‍‍‌‌‌‍‌‌‍‌‌‌‍‍‌‍‍‌‌‍‍‌‍‌‍‌‌‌‍‍‍‌‍‌‌‌‍‌‍‌‍‌‌‍‌‍‍‌‍‌‌‌‍‍‌‍‍‌‌‍‍‌‍‌‍‍‌‍‌‌‌‍‍‌‌‍‍‍‍‌‍‌‌‌‍‍‌‌‍‌‌‌‌‍‍‌‍‌‌‍‌‌‌‍‍‌‌‍‍‍‌‌‍‍‌‍‌‍‍‍‍‌‌‌‍‌‍‌‍‌‌‌‍‍‌‍‍‌‌‍‌‌‍‍‍‍‌‍‌‌‍‍‍‌‌‍‍‌‌‍‍‌‌‌‍‌‍‌‍‌‌‍‌‌‌‍‍‌‌‍‍‍‌‌‍‌‌‌‍‌‍‍‍‌‌‍‌‍‍‌‍‌‌‍‌‌‌‌‍‌‌‍‌‌‌‍‍‍‌‍‌‍‍‍‍‌‌‍‍‍‍‌‍‍‌‍‌‍‍‌‍‌‌‌‌‍‌‌‍‌‌‌‍‌‍‍‍‌‌‌‍‍‌‍‍‌‌‌‌‍‍‌‍‌‌‌‌‍‌‌‍‌‌‍‍‍‍‌‍‍‌‍‌‌‌‍‍‌‌‌‍‌‍‍‍‌‌‍‌‌‌‌‍‌‌‍‍‌‍‍‍‌‌‍‌‌‌‌‍‍‌‍‌‍‍‍‍‍‌‍‍‍‌‍‍‌‌‍‍‍‌‌‍‌‌‍‌‍‍‍‍‌‌‍‍‌‍‌‍‌‌‍‍‍‌‌‍‌‌‍‌‍‌‌‍‌‍‌‌‌‌‌‍‌‌‌‍‍‌‌‍‌‌‌‍‌‍‍‍‌‌‍‍‍‍‌‍‌‌‌‍‌‍‍‍‌‌‌‍‌‍‌‍‌‌‌‍‍‌‌‍‍‌‍‍‍‌‍‍‍‌‍‌‍‍‌‍‍‌‌‌‍‌‌‍‌‌‌‌‌‍‌‍‌‌‍‍‍‌‌‍‌‌‍‍‍‍‌‍‌‌‌‍‌‍‍‍‌‌‍‍‍‌‌‍‌‌‍‌‍‍‍‍‍‌‍‌‍‍‍‍‌‌‍‍‍‍‌‍‍‌‍‌‍‍‌‍‌‌‌‌‍‌‌‍‌‌‌‌‌‍‌‍‌‌‌‌‌‍‌‍‍‌‍‌‍‍‌‍‍‌‌‌‍‌‌‍‌‌‌‌‌‍‌".replace(
  1899. /.{8}/g,
  1900. function (e) {
  1901. return String.fromCharCode(parseInt(e.replace(/\u200c/g, 1).replace(/\u200d/g, 0), 2))
  1902. }
  1903. )
  1904. ),
  1905. 1 != G.is_root)
  1906. ) {
  1907. $(".context-menu-list .open_ie").addClass("hidden")
  1908. var classHidden = "hidden"
  1909. AUTH["explorer:fileDownload"] || ($(".context-menu-list .down,.context-menu-list .download").addClass(classHidden), $(".context-menu-list .share").addClass(classHidden), $(".context-menu-list .open_text").addClass(classHidden)),
  1910. AUTH["explorer:zip"] || $(".context-menu-list .zip").addClass(classHidden),
  1911. AUTH["explorer:search"] || $(".context-menu-list .search").addClass(classHidden),
  1912. AUTH["explorer:mkdir"] || $(".context-menu-list .newfolder").addClass(classHidden)
  1913. }
  1914. },
  1915. _bindRecycle = function () {
  1916. $('<i class="menuRecycleBody"></i>').appendTo("#rightMenu"),
  1917. $.contextMenu({
  1918. zIndex: 9999,
  1919. selector: ".menuRecycleBody",
  1920. callback: function (e) {
  1921. _menuBody(e)
  1922. },
  1923. items: {
  1924. recycle_clear: {
  1925. name: LNG.recycle_clear,
  1926. icon: "trash",
  1927. accesskey: "c",
  1928. },
  1929. refresh: {
  1930. name: LNG.refresh + "<b>F5</b>",
  1931. className: "refresh",
  1932. icon: "refresh",
  1933. accesskey: "e",
  1934. },
  1935. sep1: "--------",
  1936. listIcon: common_menu.listIcon,
  1937. sortBy: common_menu.sortBy,
  1938. sep2: "--------",
  1939. info: {
  1940. name: LNG.info + "<b>Alt+I</b>",
  1941. className: "info",
  1942. icon: "info",
  1943. accesskey: "i",
  1944. },
  1945. },
  1946. }),
  1947. $('<i class="menuRecyclePath"></i>').appendTo("#rightMenu"),
  1948. $.contextMenu({
  1949. zIndex: 9999,
  1950. selector: ".menuRecyclePath",
  1951. callback: function (e) {
  1952. _menuPath(e)
  1953. },
  1954. items: {
  1955. cute: {
  1956. name: LNG.cute + "<b>Ctrl+X</b>",
  1957. className: "cute",
  1958. icon: "cut",
  1959. accesskey: "k",
  1960. },
  1961. remove: {
  1962. name: LNG.recycle_remove + "<b>Del</b>",
  1963. className: "remove",
  1964. icon: "trash",
  1965. accesskey: "d",
  1966. },
  1967. sep2: "--------",
  1968. down: {
  1969. name: LNG.download,
  1970. className: "down",
  1971. icon: "download",
  1972. accesskey: "x",
  1973. },
  1974. info: {
  1975. name: LNG.info + "<b>Alt+I</b>",
  1976. className: "info",
  1977. icon: "info",
  1978. accesskey: "i",
  1979. },
  1980. },
  1981. }),
  1982. $('<i class="menuRecycleButton"></i>').appendTo("#rightMenu"),
  1983. $.contextMenu({
  1984. zIndex: 9999,
  1985. selector: ".menuRecycleButton",
  1986. callback: function (e) {
  1987. _menuBody(e)
  1988. },
  1989. items: {
  1990. recycle_clear: {
  1991. name: LNG.recycle_clear,
  1992. icon: "trash",
  1993. accesskey: "c",
  1994. },
  1995. },
  1996. })
  1997. },
  1998. _bindShare = function () {
  1999. $('<i class="menuShareBody"></i>').appendTo("#rightMenu"),
  2000. $.contextMenu({
  2001. zIndex: 9999,
  2002. selector: ".menuShareBody",
  2003. callback: function (e) {
  2004. _menuBody(e)
  2005. },
  2006. items: {
  2007. refresh: {
  2008. name: LNG.refresh + "<b>F5</b>",
  2009. className: "refresh",
  2010. icon: "refresh",
  2011. accesskey: "e",
  2012. },
  2013. sep1: "--------",
  2014. listIcon: common_menu.listIcon,
  2015. sortBy: common_menu.sortBy,
  2016. },
  2017. }),
  2018. $('<i class="menuSharePath"></i>').appendTo("#rightMenu"),
  2019. $.contextMenu({
  2020. zIndex: 9999,
  2021. selector: ".menuSharePath",
  2022. callback: function (e) {
  2023. _menuPath(e)
  2024. },
  2025. items: {
  2026. share_open_path: {
  2027. name: LNG.share_open_path,
  2028. icon: "folder-open-alt",
  2029. accesskey: "p",
  2030. },
  2031. share_open_window: {
  2032. name: LNG.share_open_page,
  2033. icon: "globe",
  2034. accesskey: "b",
  2035. },
  2036. sep1: "--------",
  2037. share_edit: {
  2038. name: LNG.share_edit,
  2039. icon: "edit",
  2040. accesskey: "e",
  2041. },
  2042. remove: {
  2043. name: LNG.share_remove + "<b>Del</b>",
  2044. icon: "trash",
  2045. accesskey: "d",
  2046. },
  2047. sep2: "--------",
  2048. info: {
  2049. name: LNG.info + "<b>Alt+I</b>",
  2050. className: "info",
  2051. icon: "info",
  2052. accesskey: "i",
  2053. },
  2054. },
  2055. }),
  2056. $('<i class="menuSharePathMore"></i>').appendTo("#rightMenu"),
  2057. $.contextMenu({
  2058. zIndex: 9999,
  2059. selector: ".menuSharePathMore",
  2060. callback: function (e) {
  2061. _menuPath(e)
  2062. },
  2063. items: {
  2064. remove: {
  2065. name: LNG.share_remove + "<b>Del</b>",
  2066. icon: "trash",
  2067. accesskey: "d",
  2068. },
  2069. },
  2070. })
  2071. },
  2072. _bindBody_explorer = function () {
  2073. $.contextMenu({
  2074. selector: ".menuBodyMain",
  2075. className: "fileContiner_menu",
  2076. zIndex: 9999,
  2077. callback: function (e, a) {
  2078. _menuBody(e, a)
  2079. },
  2080. items: {
  2081. refresh: {
  2082. name: LNG.refresh + "<b>F5</b>",
  2083. className: "refresh",
  2084. icon: "refresh",
  2085. accesskey: "e",
  2086. },
  2087. upload: {
  2088. name: LNG.upload + "<b>Ctrl+U</b>",
  2089. className: "upload",
  2090. icon: "upload",
  2091. accesskey: "u",
  2092. },
  2093. past: {
  2094. name: LNG.past + "<b>Ctrl+V</b>",
  2095. className: "past",
  2096. icon: "paste",
  2097. accesskey: "p",
  2098. },
  2099. copy_see: {
  2100. name: LNG.clipboard,
  2101. className: "copy_see",
  2102. icon: "eye",
  2103. accesskey: "v",
  2104. },
  2105. sep1: "--------",
  2106. listIcon: common_menu.listIcon,
  2107. sortBy: common_menu.sortBy,
  2108. sep3: "--------",
  2109. newfolder: {
  2110. name: LNG.newfolder + "<b>Alt+M</b>",
  2111. className: "newfolder",
  2112. icon: "folder-o",
  2113. accesskey: "n",
  2114. },
  2115. newfileOther: common_menu.newfileOther,
  2116. app_install: {
  2117. name: LNG.app_store,
  2118. className: "app_install",
  2119. icon: "tasks",
  2120. accesskey: "a",
  2121. },
  2122. sep10: "--------",
  2123. info: {
  2124. name: LNG.info + "<b>Alt+I</b>",
  2125. className: "info",
  2126. icon: "info",
  2127. accesskey: "i",
  2128. },
  2129. },
  2130. })
  2131. },
  2132. _bindSystem = function () {
  2133. $.contextMenu({
  2134. selector: ".menuDefault",
  2135. zIndex: 9999,
  2136. items: {
  2137. open: {
  2138. name: LNG.open,
  2139. className: "open",
  2140. icon: "external-link",
  2141. accesskey: "o",
  2142. },
  2143. },
  2144. callback: function (e) {
  2145. switch (e) {
  2146. case "open":
  2147. ui.path.open()
  2148. break
  2149. default:
  2150. }
  2151. },
  2152. })
  2153. },
  2154. _bindBody_desktop = function () {
  2155. $.contextMenu({
  2156. selector: Config.BodyContent,
  2157. zIndex: 9999,
  2158. callback: function (e) {
  2159. _menuBody(e)
  2160. },
  2161. items: {
  2162. refresh: {
  2163. name: "刷新" + "<b>F5</b>",
  2164. className: "refresh",
  2165. icon: "refresh",
  2166. accesskey: "e",
  2167. } /*
  2168. sortBy: common_menu.sortBy,
  2169. sep1: "--------",
  2170. upload: {
  2171. name: LNG.upload + "<b>Ctrl+U</b>",
  2172. className: "upload",
  2173. icon: "upload",
  2174. accesskey: "u"
  2175. },
  2176. past: {
  2177. name: LNG.past + "<b>Ctrl+V</b>",
  2178. className: "past",
  2179. icon: "paste",
  2180. accesskey: "p"
  2181. },
  2182. copy_see: {
  2183. name: LNG.clipboard,
  2184. className: "copy_see",
  2185. icon: "eye",
  2186. accesskey: "v"
  2187. },
  2188. sep2: "--------",
  2189. newfolder: {
  2190. name: LNG.newfolder + "<b>Alt+M</b>",
  2191. className: "newfolder",
  2192. icon: "folder-o",
  2193. accesskey: "n"
  2194. },
  2195. newfileOther: common_menu.newfileOther,
  2196. app_install: {
  2197. name: LNG.app_store,
  2198. className: "app_install",
  2199. icon: "tasks",
  2200. accesskey: "a"
  2201. },
  2202. sep10: "--------",
  2203. setting_wall: {
  2204. name: LNG.setting_wall,
  2205. className: "setting_wall",
  2206. icon: "picture-o",
  2207. accesskey: "b"
  2208. },*/,
  2209. setting: {
  2210. name: LNG.setting,
  2211. className: "setting",
  2212. icon: "cogs",
  2213. accesskey: "t",
  2214. },
  2215. },
  2216. })
  2217. },
  2218. _bindFolder = function () {
  2219. $('<i class="' + folderMenuSelector.substr(1) + '"></i>').appendTo("#rightMenu"),
  2220. $.contextMenu({
  2221. zIndex: 9999,
  2222. selector: folderMenuSelector,
  2223. className: folderMenuSelector.substr(1),
  2224. callback: function (e) {
  2225. _menuPath(e)
  2226. },
  2227. items: {
  2228. open: {
  2229. name: LNG.open + "<b>Enter</b>",
  2230. className: "open",
  2231. icon: "folder-open-alt",
  2232. accesskey: "o",
  2233. },
  2234. share: {
  2235. name: LNG.share,
  2236. className: "share",
  2237. icon: "share",
  2238. accesskey: "e",
  2239. },
  2240. down: {
  2241. name: LNG.download,
  2242. className: "down",
  2243. icon: "download",
  2244. accesskey: "x",
  2245. },
  2246. sep1: "--------",
  2247. copy: {
  2248. name: LNG.copy + "<b>Ctrl+C</b>",
  2249. className: "copy",
  2250. icon: "copy",
  2251. accesskey: "c",
  2252. },
  2253. cute: {
  2254. name: LNG.cute + "<b>Ctrl+X</b>",
  2255. className: "cute",
  2256. icon: "cut",
  2257. accesskey: "k",
  2258. },
  2259. remove: {
  2260. name: LNG.remove + "<b>Del</b>",
  2261. className: "remove",
  2262. icon: "trash",
  2263. accesskey: "d",
  2264. },
  2265. rname: {
  2266. name: LNG.rename + "<b>F2</b>",
  2267. className: "rname",
  2268. icon: "pencil",
  2269. accesskey: "r",
  2270. },
  2271. sep2: "--------",
  2272. zip: {
  2273. name: LNG.zip,
  2274. className: "zip",
  2275. icon: "folder",
  2276. accesskey: "z",
  2277. },
  2278. search: {
  2279. name: LNG.search_in_path + "<b>Ctrl+F</b>",
  2280. className: "search",
  2281. icon: "search",
  2282. accesskey: "s",
  2283. },
  2284. others: {
  2285. name: LNG.more,
  2286. icon: "ellipsis-h",
  2287. accesskey: "m",
  2288. items: {
  2289. open_ie: {
  2290. name: LNG.open_ie,
  2291. className: "open_ie",
  2292. icon: "globe",
  2293. accesskey: "b",
  2294. },
  2295. fav: {
  2296. name: LNG.add_to_fav,
  2297. className: "fav ",
  2298. icon: "star",
  2299. accesskey: "f",
  2300. },
  2301. clone: {
  2302. name: LNG.clone,
  2303. className: "clone",
  2304. icon: "external-link",
  2305. },
  2306. explorer: {
  2307. name: LNG.manage_folder,
  2308. className: "explorer line_top",
  2309. icon: "laptop",
  2310. accesskey: "v",
  2311. },
  2312. createLink: {
  2313. name: LNG.createLink,
  2314. className: "createLink",
  2315. icon: "share-alt",
  2316. accesskey: "l",
  2317. },
  2318. createProject: {
  2319. name: LNG.createProject,
  2320. className: "createProject",
  2321. icon: "plus",
  2322. },
  2323. openProject: {
  2324. name: LNG.openProject,
  2325. className: "openProject",
  2326. icon: "edit",
  2327. },
  2328. },
  2329. },
  2330. sep5: "--------",
  2331. info: {
  2332. name: LNG.info + "<b>Alt+I</b>",
  2333. className: "info",
  2334. icon: "info",
  2335. accesskey: "i",
  2336. },
  2337. },
  2338. })
  2339. },
  2340. _bindFile = function () {
  2341. $('<i class="' + fileMenuSelector.substr(1) + '"></i>').appendTo("#rightMenu"),
  2342. $.contextMenu({
  2343. zIndex: 9999,
  2344. selector: fileMenuSelector,
  2345. className: fileMenuSelector.substr(1),
  2346. callback: function (e) {
  2347. _menuPath(e)
  2348. },
  2349. items: {
  2350. open: {
  2351. name: LNG.open + "<b>Enter</b>",
  2352. className: "open",
  2353. icon: "external-link",
  2354. accesskey: "o",
  2355. } /*
  2356. app_edit: {
  2357. name: LNG.app_edit,
  2358. className: "app_edit",
  2359. icon: "code",
  2360. accesskey: "a"
  2361. },
  2362. open_text: {
  2363. name: LNG.edit + "<b>Ctrl+E</b>",
  2364. className: "open_text",
  2365. icon: "edit",
  2366. accesskey: "e"
  2367. },
  2368. share: {
  2369. name: LNG.share,
  2370. className: "share",
  2371. icon: "share",
  2372. accesskey: "e"
  2373. },
  2374. down: {
  2375. name: LNG.download,
  2376. className: "down",
  2377. icon: "download",
  2378. accesskey: "x"
  2379. },
  2380. sep1: "--------",
  2381. copy: {
  2382. name: LNG.copy + "<b>Ctrl+C</b>",
  2383. className: "copy",
  2384. icon: "copy",
  2385. accesskey: "c"
  2386. },
  2387. cute: {
  2388. name: LNG.cute + "<b>Ctrl+X</b>",
  2389. className: "cute",
  2390. icon: "cut",
  2391. accesskey: "k"
  2392. },
  2393. rname: {
  2394. name: LNG.rename + "<b>F2</b>",
  2395. className: "rname",
  2396. icon: "pencil",
  2397. accesskey: "r"
  2398. },*/,
  2399. remove: {
  2400. name: LNG.remove + "<b>Del</b>",
  2401. className: "remove",
  2402. icon: "trash",
  2403. accesskey: "d",
  2404. },
  2405. /*sep2: "--------",
  2406. open_ie: {
  2407. name: LNG.open_ie,
  2408. className: "open_ie",
  2409. icon: "globe"
  2410. },
  2411. unzip: {
  2412. name: LNG.unzip,
  2413. className: "unzip",
  2414. icon: "folder-open-alt",
  2415. accesskey: "u"
  2416. },
  2417. setBackground: {
  2418. name: LNG.set_background,
  2419. className: "setBackground",
  2420. icon: "download",
  2421. accesskey: "x"
  2422. },
  2423. others: {
  2424. name: LNG.more,
  2425. icon: "ellipsis-h",
  2426. accesskey: "m",
  2427. items: {
  2428. zip: {
  2429. name: LNG.zip,
  2430. className: "zip",
  2431. icon: "folder",
  2432. accesskey: "z"
  2433. },
  2434. createLink: {
  2435. name: LNG.createLink,
  2436. className: "createLink",
  2437. icon: "share-alt",
  2438. accesskey: "l"
  2439. },
  2440. clone: {
  2441. name: LNG.clone,
  2442. className: "clone",
  2443. icon: "external-link",
  2444. accesskey: "l"
  2445. }
  2446. }
  2447. },
  2448. sep3: "--------",
  2449. info: {
  2450. name: LNG.info + "<b>Alt+I</b>",
  2451. className: "info",
  2452. icon: "info",
  2453. accesskey: "i"
  2454. }*/
  2455. },
  2456. })
  2457. },
  2458. _bindSelectMore = function () {
  2459. /*
  2460. $('<i class="' + selectMoreSelector.substr(1) + '"></i>').appendTo("#rightMenu"),
  2461. $.contextMenu({
  2462. zIndex: 9999,
  2463. selector: selectMoreSelector,
  2464. className: selectMoreSelector.substr(1),
  2465. callback: function(e) {
  2466. _menuPath(e)
  2467. },
  2468. items: {
  2469. copy: {
  2470. name: LNG.copy + "<b>Ctrl+C</b>",
  2471. className: "copy",
  2472. icon: "copy",
  2473. accesskey: "c"
  2474. },
  2475. cute: {
  2476. name: LNG.cute + "<b>Ctrl+X</b>",
  2477. className: "cute",
  2478. icon: "cut",
  2479. accesskey: "k"
  2480. },
  2481. remove: {
  2482. name: LNG.remove + "<b>Del</b>",
  2483. className: "remove",
  2484. icon: "trash",
  2485. accesskey: "d"
  2486. },
  2487. sep1: "--------",
  2488. clone: {
  2489. name: LNG.clone + "<b>Ctrl+C</b>",
  2490. className: "clone",
  2491. icon: "external-link",
  2492. accesskey: "n"
  2493. },
  2494. playmedia: {
  2495. name: LNG.add_to_play,
  2496. className: "playmedia",
  2497. icon: "music",
  2498. accesskey: "p"
  2499. },
  2500. zip: {
  2501. name: LNG.zip,
  2502. className: "zip",
  2503. icon: "folder",
  2504. accesskey: "z"
  2505. },
  2506. down: {
  2507. name: LNG.download,
  2508. className: "down",
  2509. icon: "download",
  2510. accesskey: "x"
  2511. },
  2512. sep2: "--------",
  2513. info: {
  2514. name: LNG.info,
  2515. className: "info",
  2516. icon: "info",
  2517. accesskey: "i"
  2518. }
  2519. }
  2520. })*/
  2521. },
  2522. _menuBody = function (e) {
  2523. switch (e) {
  2524. case "refresh":
  2525. ui.f5(!0, !0)
  2526. break
  2527. case "back":
  2528. ui.path.back()
  2529. break
  2530. case "next":
  2531. ui.path.next()
  2532. break
  2533. case "seticon":
  2534. ui.setListType("icon")
  2535. break
  2536. case "setlist":
  2537. ui.setListType("list")
  2538. break
  2539. case "set_sort_name":
  2540. ui.setListSort("name", 0)
  2541. break
  2542. case "set_sort_ext":
  2543. ui.setListSort("ext", 0)
  2544. break
  2545. case "set_sort_size":
  2546. ui.setListSort("size", 0)
  2547. break
  2548. case "set_sort_mtime":
  2549. ui.setListSort("mtime", 0)
  2550. break
  2551. case "set_sort_up":
  2552. ui.setListSort(0, "up")
  2553. break
  2554. case "set_sort_down":
  2555. ui.setListSort(0, "down")
  2556. break
  2557. case "upload":
  2558. core.upload()
  2559. break
  2560. case "recycle_clear":
  2561. ui.path.recycle_clear()
  2562. break
  2563. case "past":
  2564. ui.path.past()
  2565. break
  2566. case "copy_see":
  2567. ui.path.clipboard()
  2568. break
  2569. case "newfolder":
  2570. ui.path.newFolder()
  2571. break
  2572. case "newfile":
  2573. ui.path.newFile("txt")
  2574. break
  2575. case "newfile_html":
  2576. ui.path.newFile("html")
  2577. break
  2578. case "newfile_php":
  2579. ui.path.newFile("php")
  2580. break
  2581. case "newfile_js":
  2582. ui.path.newFile("js")
  2583. break
  2584. case "newfile_css":
  2585. ui.path.newFile("css")
  2586. break
  2587. case "newfile_oexe":
  2588. ui.path.newFile("oexe")
  2589. break
  2590. case "info":
  2591. ui.path.info()
  2592. break
  2593. case "open":
  2594. ui.path.open()
  2595. break
  2596. case "open_new":
  2597. ui.path.open_new()
  2598. break
  2599. case "app_install":
  2600. ui.path.appList()
  2601. break
  2602. case "app_create":
  2603. ui.path.appEdit(!0)
  2604. break
  2605. case "setting":
  2606. core.setting()
  2607. break
  2608. case "setting_wall":
  2609. core.setting("wall")
  2610. break
  2611. default:
  2612. }
  2613. },
  2614. _menuPath = function (e) {
  2615. switch (e) {
  2616. case "open":
  2617. ui.path.open()
  2618. break
  2619. case "down":
  2620. ui.path.download()
  2621. break
  2622. case "share":
  2623. ui.path.share()
  2624. break
  2625. case "open_ie":
  2626. ui.path.openIE()
  2627. break
  2628. case "open_text":
  2629. ui.path.openEditor()
  2630. break
  2631. case "app_edit":
  2632. ui.path.appEdit()
  2633. break
  2634. case "playmedia":
  2635. ui.path.play()
  2636. break
  2637. case "share_edit":
  2638. ui.path.share_edit()
  2639. break
  2640. case "share_open_window":
  2641. ui.path.share_open_window()
  2642. break
  2643. case "share_open_path":
  2644. ui.path.share_open_path()
  2645. break
  2646. case "fav":
  2647. ui.path.fav()
  2648. break
  2649. case "search":
  2650. ui.path.search()
  2651. break
  2652. case "copy":
  2653. ui.path.copy()
  2654. break
  2655. case "clone":
  2656. ui.path.copyDrag(G.this_path, !0)
  2657. break
  2658. case "cute":
  2659. ui.path.cute()
  2660. break
  2661. case "remove":
  2662. ui.path.remove()
  2663. break
  2664. case "rname":
  2665. ui.path.rname()
  2666. break
  2667. case "zip":
  2668. ui.path.zip()
  2669. break
  2670. case "unzip":
  2671. ui.path.unZip()
  2672. break
  2673. case "setBackground":
  2674. ui.path.setBackground()
  2675. break
  2676. case "createLink":
  2677. ui.path.createLink()
  2678. break
  2679. case "createProject":
  2680. ui.path.createProject()
  2681. break
  2682. case "openProject":
  2683. ui.path.openProject()
  2684. break
  2685. case "explorer":
  2686. ui.path.explorer()
  2687. break
  2688. case "explorerNew":
  2689. ui.path.explorerNew()
  2690. break
  2691. case "info":
  2692. ui.path.info()
  2693. break
  2694. default:
  2695. }
  2696. },
  2697. _bindTreeFav = function () {
  2698. $('<i class="menuTreeFavRoot"></i>').appendTo("#rightMenu"),
  2699. $.contextMenu({
  2700. zIndex: 9999,
  2701. selector: ".menuTreeFavRoot",
  2702. callback: function (e) {
  2703. _menuTree(e)
  2704. },
  2705. items: {
  2706. fav_page: {
  2707. name: LNG.manage_fav,
  2708. className: "fav_page",
  2709. icon: "star",
  2710. accesskey: "r",
  2711. },
  2712. refresh_all: {
  2713. name: LNG.refresh_tree,
  2714. className: "refresh_all",
  2715. icon: "refresh",
  2716. accesskey: "e",
  2717. },
  2718. },
  2719. }),
  2720. $('<i class="menuTreeFav"></i>').appendTo("#rightMenu"),
  2721. $.contextMenu({
  2722. zIndex: 9999,
  2723. selector: ".menuTreeFav",
  2724. callback: function (e) {
  2725. _menuTree(e)
  2726. },
  2727. items: {
  2728. fav_page: {
  2729. name: LNG.manage_fav,
  2730. className: "fav_page",
  2731. icon: "star",
  2732. accesskey: "f",
  2733. },
  2734. fav_remove: {
  2735. name: LNG.fav_remove,
  2736. className: "fav_remove",
  2737. icon: "trash",
  2738. accesskey: "r",
  2739. },
  2740. sep1: "--------",
  2741. refresh: {
  2742. name: LNG.refresh_tree,
  2743. className: "refresh",
  2744. icon: "refresh",
  2745. accesskey: "e",
  2746. },
  2747. explorer: {
  2748. name: LNG.manage_folder,
  2749. className: "explorer",
  2750. icon: "laptop",
  2751. accesskey: "v",
  2752. },
  2753. search: {
  2754. name: LNG.search_in_path,
  2755. className: "search",
  2756. icon: "search",
  2757. accesskey: "s",
  2758. },
  2759. sep2: "--------",
  2760. past: {
  2761. name: LNG.past,
  2762. className: "past",
  2763. icon: "paste",
  2764. accesskey: "p",
  2765. },
  2766. newfolder: {
  2767. name: LNG.newfolder,
  2768. className: "newfolder",
  2769. icon: "folder-o",
  2770. accesskey: "n",
  2771. },
  2772. newfile: {
  2773. name: LNG.newfile,
  2774. className: "newfile",
  2775. icon: "file-alt",
  2776. accesskey: "j",
  2777. },
  2778. sep3: "--------",
  2779. info: {
  2780. name: LNG.info,
  2781. className: "info",
  2782. icon: "info",
  2783. accesskey: "i",
  2784. },
  2785. },
  2786. })
  2787. },
  2788. _bindTreeRoot = function () {
  2789. $('<i class="' + selectTreeSelectorRoot.substr(1) + '"></i>').appendTo("#rightMenu"),
  2790. $.contextMenu({
  2791. zIndex: 9999,
  2792. selector: selectTreeSelectorRoot,
  2793. callback: function (e) {
  2794. _menuTree(e)
  2795. },
  2796. items: {
  2797. explorer: {
  2798. name: LNG.manage_folder,
  2799. className: "explorer",
  2800. icon: "laptop",
  2801. accesskey: "v",
  2802. },
  2803. refresh: {
  2804. name: LNG.refresh_tree,
  2805. className: "refresh",
  2806. icon: "refresh",
  2807. accesskey: "e",
  2808. },
  2809. sep1: "--------",
  2810. past: {
  2811. name: LNG.past,
  2812. className: "past",
  2813. icon: "paste",
  2814. accesskey: "p",
  2815. },
  2816. newfolder: {
  2817. name: LNG.newfolder,
  2818. className: "newfolder",
  2819. icon: "folder-o",
  2820. accesskey: "n",
  2821. },
  2822. newfile: {
  2823. name: LNG.newfile,
  2824. className: "newfile",
  2825. icon: "file-alt",
  2826. accesskey: "j",
  2827. },
  2828. sep2: "--------",
  2829. fav: {
  2830. name: LNG.add_to_fav,
  2831. className: "fav",
  2832. icon: "star",
  2833. accesskey: "f",
  2834. },
  2835. search: {
  2836. name: LNG.search_in_path,
  2837. className: "search",
  2838. icon: "search",
  2839. accesskey: "s",
  2840. },
  2841. },
  2842. })
  2843. },
  2844. _bindTreeFolder = function () {
  2845. $('<i class="' + selectTreeSelectorFolder.substr(1) + '"></i>').appendTo("#rightMenu"),
  2846. $.contextMenu({
  2847. zIndex: 9999,
  2848. selector: selectTreeSelectorFolder,
  2849. callback: function (e) {
  2850. _menuTree(e)
  2851. },
  2852. items: {
  2853. refresh: {
  2854. name: LNG.refresh_tree,
  2855. className: "refresh",
  2856. icon: "refresh",
  2857. accesskey: "e",
  2858. },
  2859. download: {
  2860. name: LNG.download,
  2861. className: "download",
  2862. icon: "download",
  2863. accesskey: "x",
  2864. },
  2865. share: {
  2866. name: LNG.share,
  2867. className: "share",
  2868. icon: "share",
  2869. accesskey: "e",
  2870. },
  2871. sep1: "--------",
  2872. copy: {
  2873. name: LNG.copy,
  2874. className: "copy",
  2875. icon: "copy",
  2876. accesskey: "c",
  2877. },
  2878. cute: {
  2879. name: LNG.cute,
  2880. className: "cute",
  2881. icon: "cut",
  2882. accesskey: "k",
  2883. },
  2884. past: {
  2885. name: LNG.past,
  2886. className: "past",
  2887. icon: "paste",
  2888. accesskey: "p",
  2889. },
  2890. rname: {
  2891. name: LNG.rename,
  2892. className: "rname",
  2893. icon: "pencil",
  2894. accesskey: "r",
  2895. },
  2896. remove: {
  2897. name: LNG.remove,
  2898. className: "remove",
  2899. icon: "trash",
  2900. accesskey: "d",
  2901. },
  2902. sep2: "--------",
  2903. newfolder: {
  2904. name: LNG.newfolder,
  2905. className: "newfolder",
  2906. icon: "folder-o",
  2907. accesskey: "n",
  2908. },
  2909. search: {
  2910. name: LNG.search_in_path,
  2911. className: "search",
  2912. icon: "search",
  2913. accesskey: "s",
  2914. },
  2915. others: {
  2916. name: LNG.more,
  2917. icon: "ellipsis-h",
  2918. accesskey: "m",
  2919. items: {
  2920. fav: {
  2921. name: LNG.add_to_fav,
  2922. className: "fav",
  2923. icon: "star",
  2924. },
  2925. open_ie: {
  2926. name: LNG.open_ie,
  2927. className: "open_ie",
  2928. icon: "globe",
  2929. },
  2930. clone: {
  2931. name: LNG.clone,
  2932. className: "clone",
  2933. icon: "external-link",
  2934. accesskey: "l",
  2935. },
  2936. explorer: {
  2937. name: LNG.manage_folder,
  2938. className: "explorer line_top",
  2939. icon: "laptop",
  2940. accesskey: "v",
  2941. },
  2942. openProject: {
  2943. name: LNG.openProject,
  2944. className: "openProject",
  2945. icon: "edit",
  2946. },
  2947. },
  2948. },
  2949. sep3: "--------",
  2950. info: {
  2951. name: LNG.info,
  2952. className: "info",
  2953. icon: "info",
  2954. accesskey: "i",
  2955. },
  2956. },
  2957. })
  2958. },
  2959. _bindTreeFolderEditor = function () {
  2960. $('<i class="' + selectTreeSelectorFolder.substr(1) + '"></i>').appendTo("#rightMenu"),
  2961. $.contextMenu({
  2962. zIndex: 9999,
  2963. selector: selectTreeSelectorFolder,
  2964. callback: function (e) {
  2965. _menuTree(e)
  2966. },
  2967. items: {
  2968. refresh: {
  2969. name: LNG.refresh_tree,
  2970. className: "refresh",
  2971. icon: "refresh",
  2972. accesskey: "e",
  2973. },
  2974. explorer: {
  2975. name: LNG.manage_folder,
  2976. className: "explorer",
  2977. icon: "laptop",
  2978. accesskey: "v",
  2979. },
  2980. download: {
  2981. name: LNG.download,
  2982. className: "download",
  2983. icon: "download",
  2984. accesskey: "x",
  2985. },
  2986. share: {
  2987. name: LNG.share,
  2988. className: "share",
  2989. icon: "share",
  2990. accesskey: "e",
  2991. },
  2992. sep1: "--------",
  2993. copy: {
  2994. name: LNG.copy,
  2995. className: "copy",
  2996. icon: "copy",
  2997. accesskey: "c",
  2998. },
  2999. cute: {
  3000. name: LNG.cute,
  3001. className: "cute",
  3002. icon: "cut",
  3003. accesskey: "k",
  3004. },
  3005. past: {
  3006. name: LNG.past,
  3007. className: "past",
  3008. icon: "paste",
  3009. accesskey: "p",
  3010. },
  3011. rname: {
  3012. name: LNG.rename,
  3013. className: "rname",
  3014. icon: "pencil",
  3015. accesskey: "r",
  3016. },
  3017. remove: {
  3018. name: LNG.remove,
  3019. className: "remove",
  3020. icon: "trash",
  3021. accesskey: "d",
  3022. },
  3023. sep2: "--------",
  3024. newfolder: {
  3025. name: LNG.newfolder,
  3026. className: "newfolder",
  3027. icon: "folder-o",
  3028. accesskey: "n",
  3029. },
  3030. newfileOther: common_menu.newfileOther,
  3031. search: {
  3032. name: LNG.search_in_path,
  3033. className: "search",
  3034. icon: "search",
  3035. accesskey: "s",
  3036. },
  3037. others: {
  3038. name: LNG.more,
  3039. icon: "ellipsis-h",
  3040. accesskey: "m",
  3041. items: {
  3042. fav: {
  3043. name: LNG.add_to_fav,
  3044. className: "fav",
  3045. icon: "star",
  3046. },
  3047. open_ie: {
  3048. name: LNG.open_ie,
  3049. className: "open_ie",
  3050. icon: "globe",
  3051. },
  3052. clone: {
  3053. name: LNG.clone,
  3054. className: "clone",
  3055. icon: "external-link",
  3056. accesskey: "l",
  3057. },
  3058. },
  3059. },
  3060. sep3: "--------",
  3061. info: {
  3062. name: LNG.info,
  3063. className: "info",
  3064. icon: "info",
  3065. accesskey: "i",
  3066. },
  3067. },
  3068. })
  3069. },
  3070. _bindEditorFile = function () {
  3071. $('<i class="' + selectTreeSelectorFile.substr(1) + '"></i>').appendTo("#rightMenu"),
  3072. $.contextMenu({
  3073. zIndex: 9999,
  3074. selector: selectTreeSelectorFile,
  3075. callback: function (e) {
  3076. _menuTree(e)
  3077. },
  3078. items: {
  3079. open: {
  3080. name: LNG.open,
  3081. className: "open",
  3082. icon: "external-link",
  3083. accesskey: "o",
  3084. },
  3085. edit: {
  3086. name: LNG.edit,
  3087. className: "edit",
  3088. icon: "edit",
  3089. accesskey: "e",
  3090. },
  3091. download: {
  3092. name: LNG.download,
  3093. className: "download",
  3094. icon: "download",
  3095. accesskey: "x",
  3096. },
  3097. share: {
  3098. name: LNG.share,
  3099. className: "share",
  3100. icon: "share",
  3101. accesskey: "e",
  3102. },
  3103. sep1: "--------",
  3104. rname: {
  3105. name: LNG.rename,
  3106. className: "rname",
  3107. icon: "pencil",
  3108. accesskey: "r",
  3109. },
  3110. copy: {
  3111. name: LNG.copy,
  3112. className: "copy",
  3113. icon: "copy",
  3114. accesskey: "c",
  3115. },
  3116. cute: {
  3117. name: LNG.cute,
  3118. className: "cute",
  3119. icon: "cut",
  3120. accesskey: "k",
  3121. },
  3122. remove: {
  3123. name: LNG.remove,
  3124. className: "remove",
  3125. icon: "trash",
  3126. accesskey: "d",
  3127. },
  3128. sep2: "--------",
  3129. clone: {
  3130. name: LNG.clone,
  3131. className: "clone",
  3132. icon: "external-link",
  3133. accesskey: "l",
  3134. },
  3135. open_ie: {
  3136. name: LNG.open_ie,
  3137. className: "open_ie",
  3138. icon: "globe",
  3139. },
  3140. info: {
  3141. name: LNG.info,
  3142. className: "info",
  3143. icon: "info",
  3144. accesskey: "i",
  3145. },
  3146. },
  3147. })
  3148. },
  3149. _bindTaskBar = function () {
  3150. $('<i class="taskBarMenu"></i>').appendTo("#rightMenu"),
  3151. $.contextMenu({
  3152. zIndex: 9999,
  3153. selector: ".taskBarMenu",
  3154. items: {
  3155. quitOthers: {
  3156. name: LNG.close_others,
  3157. className: "quitOthers",
  3158. icon: "remove-circle",
  3159. accesskey: "o",
  3160. },
  3161. quit: {
  3162. name: LNG.close,
  3163. className: "quit",
  3164. icon: "remove",
  3165. accesskey: "q",
  3166. },
  3167. },
  3168. callback: function (e, a) {
  3169. var t = a.$trigger.attr("id"),
  3170. i = art.dialog.list[t]
  3171. switch (e) {
  3172. case "quitOthers":
  3173. $.each(art.dialog.list, function (e, a) {
  3174. t != e && a.close()
  3175. })
  3176. break
  3177. case "quit":
  3178. i.close()
  3179. }
  3180. },
  3181. })
  3182. },
  3183. _bindTask = function () {
  3184. $.contextMenu({
  3185. zIndex: 9999,
  3186. selector: ".task_tab",
  3187. items: {
  3188. closeAll: {
  3189. name: LNG.dialog_close_all,
  3190. icon: "remove-circle",
  3191. accesskey: "q",
  3192. },
  3193. showAll: {
  3194. name: LNG.dialog_display_all,
  3195. icon: "th-large",
  3196. accesskey: "s",
  3197. },
  3198. hideAll: {
  3199. name: LNG.dialog_min_all,
  3200. icon: "remove",
  3201. accesskey: "h",
  3202. },
  3203. },
  3204. callback: function (e, a) {
  3205. var t = a.$trigger.attr("id")
  3206. switch ((art.dialog.list[t], e)) {
  3207. case "showAll":
  3208. $.each(art.dialog.list, function (e, a) {
  3209. a.display(!0)
  3210. })
  3211. break
  3212. case "hideAll":
  3213. $.each(art.dialog.list, function (e, a) {
  3214. a.display(!1)
  3215. })
  3216. break
  3217. case "closeAll":
  3218. $.each(art.dialog.list, function (e, a) {
  3219. a.close()
  3220. })
  3221. break
  3222. default:
  3223. }
  3224. },
  3225. })
  3226. },
  3227. _bindDialog = function () {
  3228. $('<i class="dialog_menu"></i>').appendTo("#rightMenu"),
  3229. $.contextMenu({
  3230. zIndex: 9999,
  3231. selector: ".dialog_menu",
  3232. items: {
  3233. quit_dialog: {
  3234. name: LNG.close,
  3235. className: "quit_dialog",
  3236. icon: "remove",
  3237. accesskey: "q",
  3238. },
  3239. hide_dialog: {
  3240. name: "最小化窗口",
  3241. className: "hide_dialog",
  3242. icon: "minus",
  3243. accesskey: "h",
  3244. },
  3245. refresh: {
  3246. name: "重载页面",
  3247. className: "refresh",
  3248. icon: "refresh",
  3249. accesskey: "r",
  3250. },
  3251. open_window: {
  3252. name: "在新标签中打开",
  3253. className: "open_window",
  3254. icon: "globe",
  3255. accesskey: "b",
  3256. },
  3257. },
  3258. callback: function (e, a) {
  3259. var t = a.$trigger.attr("id"),
  3260. i = art.dialog.list[t]
  3261. switch (e) {
  3262. case "quit_dialog":
  3263. i.close()
  3264. break
  3265. case "hide_dialog":
  3266. i.display(!1)
  3267. break
  3268. case "refresh":
  3269. i.refresh()
  3270. break
  3271. case "open_window":
  3272. i.open_window()
  3273. break
  3274. default:
  3275. }
  3276. },
  3277. })
  3278. },
  3279. _menuTree = function (e) {
  3280. switch (e) {
  3281. case "edit":
  3282. ui.tree.openEditor()
  3283. break
  3284. case "open":
  3285. ui.tree.open()
  3286. break
  3287. case "refresh":
  3288. ui.tree.refresh()
  3289. break
  3290. case "copy":
  3291. ui.tree.copy()
  3292. break
  3293. case "cute":
  3294. ui.tree.cute()
  3295. break
  3296. case "past":
  3297. ui.tree.past()
  3298. break
  3299. case "clone":
  3300. ui.tree.clone()
  3301. break
  3302. case "rname":
  3303. ui.tree.rname()
  3304. break
  3305. case "remove":
  3306. ui.tree.remove()
  3307. break
  3308. case "info":
  3309. ui.tree.info()
  3310. break
  3311. case "download":
  3312. ui.tree.download()
  3313. break
  3314. case "open_ie":
  3315. ui.tree.openIE()
  3316. break
  3317. case "share":
  3318. ui.tree.share()
  3319. break
  3320. case "search":
  3321. ui.tree.search()
  3322. break
  3323. case "newfolder":
  3324. ui.tree.create("folder")
  3325. break
  3326. case "newfile":
  3327. ui.tree.create("file")
  3328. break
  3329. case "explorer":
  3330. ui.tree.explorer()
  3331. break
  3332. case "openProject":
  3333. ui.tree.openProject()
  3334. break
  3335. case "fav_page":
  3336. core.setting("fav")
  3337. break
  3338. case "fav":
  3339. ui.tree.fav()
  3340. break
  3341. case "fav_remove":
  3342. ui.tree.fav_remove()
  3343. break
  3344. case "refresh_all":
  3345. ui.tree.init()
  3346. break
  3347. case "quit":
  3348. break
  3349. default:
  3350. }
  3351. }
  3352. return {
  3353. initDesktop: _init_desktop,
  3354. initExplorer: _init_explorer,
  3355. initEditor: _init_editor,
  3356. show: function (e, a, t) {
  3357. e &&
  3358. (rightMenu.hidden(),
  3359. $(e).contextMenu({
  3360. x: a,
  3361. y: t,
  3362. }))
  3363. },
  3364. menuShow: function () {
  3365. var e = $(".context-menu-list").filter(":visible"),
  3366. a = $(".context-menu-active")
  3367. if (0 != e.length && 0 != a.length) {
  3368. if ((e.find(".disable").addClass("disabled"), a.hasClass("menufile"))) {
  3369. var t = fileLight.type(Global.fileListSelect)
  3370. "zip" == t ? e.find(".unzip").show() : e.find(".unzip").hide(),
  3371. inArray(core.filetype.image, t) ? e.find(".setBackground").show() : e.find(".setBackground").hide(),
  3372. "oexe" == t ? e.find(".app_edit").show() : e.find(".app_edit").hide(),
  3373. inArray(core.filetype.image, t) || inArray(core.filetype.music, t) || inArray(core.filetype.movie, t) || inArray(core.filetype.bindary, t) || inArray(core.filetype.doc, t) ? e.find(".open_text").hide() : e.find(".open_text").show()
  3374. }
  3375. if (a.hasClass("dialog_menu")) {
  3376. var i = a.attr("id"),
  3377. n = art.dialog.list[i]
  3378. n.has_frame() ? (e.find(".open_window").show(), e.find(".refresh").show()) : (e.find(".open_window").hide(), e.find(".refresh").hide())
  3379. }
  3380. if (a.hasClass("menuMore")) {
  3381. var s = 0
  3382. Global.fileListSelect.each(function () {
  3383. var e = core.pathExt(fileLight.name($(this)))
  3384. ;(inArray(core.filetype.music, e) || inArray(core.filetype.movie, e)) && (s += 1)
  3385. }),
  3386. 0 == s ? e.find(".playmedia").hide() : e.find(".playmedia").show()
  3387. }
  3388. }
  3389. },
  3390. menuCurrentPath: function (e) {
  3391. var a = ".createLink,.createProject,.cute,.remove,.rname,.zip,.unzip,.newfile,.newfolder,.newfileOther,.app_create,.app_install,.past,.upload,.clone",
  3392. t = "disable"
  3393. "writeable" == e
  3394. ? ($(".path_tips").hide(), $("ul.menufile").find(a).removeClass(t), $("ul.menufolder").find(a).removeClass(t), $("ul.fileContiner_menu").find(a).removeClass(t), $(".tools-left button").removeClass("disabled"))
  3395. : ($(".path_tips").show(), $("ul.menufile").find(a).addClass(t), $("ul.menufolder").find(a).addClass(t), $("ul.fileContiner_menu").find(a).addClass(t), $(".tools-left button").addClass("disabled"))
  3396. },
  3397. isDisplay: function () {
  3398. var e = !1
  3399. return (
  3400. $(".context-menu-list").each(function () {
  3401. "none" != $(this).css("display") && (e = !0)
  3402. }),
  3403. e
  3404. )
  3405. },
  3406. hidden: function () {
  3407. $(".context-menu-list").filter(":visible").trigger("contextmenu:hide")
  3408. },
  3409. }
  3410. }),
  3411. define("desktop/fileSelect", [], function () {
  3412. var e = !1,
  3413. a = !1,
  3414. t = !1,
  3415. i = function () {
  3416. s(), n(), o()
  3417. },
  3418. n = function () {
  3419. $(Config.FileBoxClass)
  3420. .die("touchstart")
  3421. .live("touchstart", function () {
  3422. $(this).hasClass("select") ? ui.path.open() : (d.clear(), $(this).removeClass("select"), $(this).addClass("select"), d.select())
  3423. }),
  3424. $(Config.FileBoxClass)
  3425. .live("mouseenter", function () {
  3426. a && (($(this).hasClass(Config.TypeFolderClass) && !$(this).hasClass(Config.SelectClassName)) || $(this).hasClass("menuRecycleButton")) && $(this).addClass("selectDragTemp"),
  3427. e || a || $(this).addClass(Config.HoverClassName),
  3428. $(this)
  3429. .unbind("mousedown")
  3430. .mousedown(function (e) {
  3431. if (
  3432. (rightMenu.hidden(),
  3433. e.ctrlKey || e.shiftKey || $(this).hasClass(Config.SelectClassName) || (d.clear(), $(this).addClass(Config.SelectClassName), d.select()),
  3434. 3 != e.which || $(this).hasClass(Config.SelectClassName) || (d.clear(), $(this).addClass(Config.SelectClassName), d.select()),
  3435. e.ctrlKey && ($(this).hasClass(Config.SelectClassName) ? (t = !0) : (d.setMenu($(this)), $(this).addClass(Config.SelectClassName)), d.select()),
  3436. e.shiftKey)
  3437. ) {
  3438. var a = parseInt($(this).attr(Config.FileOrderAttr))
  3439. if (0 == Global.fileListSelectNum) c(0, a)
  3440. else {
  3441. var i = parseInt(Global.fileListSelect.first().attr(Config.FileOrderAttr)),
  3442. n = parseInt(Global.fileListSelect.last().attr(Config.FileOrderAttr))
  3443. i > a ? c(a, i) : a > n ? c(n, a) : a > i && n > a && c(i, a)
  3444. }
  3445. }
  3446. })
  3447. })
  3448. .die("mouseleave")
  3449. .live("mouseleave", function () {
  3450. $(this).removeClass(Config.HoverClassName), $(this).removeClass("selectDragTemp")
  3451. })
  3452. .die("click")
  3453. .live("click", function (e) {
  3454. stopPP(e), e.ctrlKey || e.shiftKey || (d.clear(), $(this).addClass(Config.SelectClassName), d.select()), e.ctrlKey && t && ((t = !1), d.resumeMenu($(this)), $(this).removeClass(Config.SelectClassName), d.select())
  3455. }),
  3456. $(Config.FileBoxClass)
  3457. .unbind("dblclick")
  3458. .live("dblclick", function (e) {
  3459. stopPP(e), e.altKey ? ui.path.pathInfo() : ui.path.open()
  3460. }),
  3461. $(Config.FileBoxTittleClass)
  3462. .unbind("dblclick")
  3463. .live("dblclick", function (e) {
  3464. return ui.path.rname(), stopPP(e), !1
  3465. })
  3466. },
  3467. s = function () {
  3468. var t,
  3469. i,
  3470. n,
  3471. s = 100,
  3472. o = 50,
  3473. r = 30,
  3474. l = 80 - Global.topbar_height,
  3475. c = 0,
  3476. p = !1,
  3477. u = 0,
  3478. h = 0
  3479. $(Config.FileBoxClass)
  3480. .unbind("mousedown")
  3481. .live("mousedown", function (a) {
  3482. return Global.shiftKey
  3483. ? void 0
  3484. : ui.isEdit()
  3485. ? !0
  3486. : 1 != a.which || e
  3487. ? !0
  3488. : ((t = $(this)),
  3489. f(a),
  3490. this.setCapture && this.setCapture(),
  3491. $(document).mousemove(function (e) {
  3492. m(e)
  3493. }),
  3494. $(document).one("mouseup", function (e) {
  3495. return v(e), this.releaseCapture && this.releaseCapture(), stopPP(e), !1
  3496. }),
  3497. stopPP(a),
  3498. !1)
  3499. })
  3500. var f = function (e) {
  3501. rightMenu.hidden(), (a = !0), (c = $.now()), (u = e.pageY), (h = e.pageX), (i = $(document).height()), (n = $(document).width())
  3502. },
  3503. m = function (e) {
  3504. if (!a) return !0
  3505. $.now() - c > s && !p && _()
  3506. var t = e.clientX >= n - 50 ? n - 50 : e.clientX,
  3507. r = e.clientY >= i - 50 ? i - 50 : e.clientY
  3508. ;(t = 0 >= t ? 0 : t),
  3509. (r = 0 >= r ? 0 : r),
  3510. (t -= o),
  3511. (r -= l),
  3512. $(".draggable-dragging").css("left", t),
  3513. $(".draggable-dragging").css("top", r),
  3514. Global.isIE &&
  3515. $("." + Config.TypeFolderClass + ",div.menuRecycleButton").each(function () {
  3516. var a = e.pageX,
  3517. t = e.pageY,
  3518. i = $(this).offset(),
  3519. n = $(this).width(),
  3520. s = $(this).height()
  3521. a > i.left && i.left + n > a && t > i.top && i.top + s > t ? $(this).addClass("selectDragTemp") : $(this).removeClass("selectDragTemp")
  3522. })
  3523. },
  3524. v = function (e) {
  3525. if (!a) return !1
  3526. ;(a = !1),
  3527. (p = !1),
  3528. $("body").css("cursor", "auto"),
  3529. $(".draggable-dragging").fadeOut(200, function () {
  3530. $(this).remove()
  3531. })
  3532. var t = G.this_path,
  3533. i = 0 == $(".selectDragTemp").length
  3534. i || (t += d.name($(".selectDragTemp"))), Global.ctrlKey ? (Math.abs(e.pageX - h) > r || Math.abs(e.pageY - u) > r) && ui.path.copyDrag(t, i) : i || ($(".selectDragTemp").hasClass("menuRecycleButton") ? ui.path.remove() : ui.path.cuteDrag(t))
  3535. },
  3536. _ = function () {
  3537. ;(p = !0),
  3538. $("body").css("cursor", "move"),
  3539. t.find(".ico").attr("filetype"),
  3540. $('<div class="file draggable-dragging"><div class="drag_number">' + Global.fileListSelectNum + "</div>" + '<div class="ico" style="background:' + t.find(".ico").css("background") + '"></div>' + "</div>").appendTo("body")
  3541. }
  3542. },
  3543. o = function () {
  3544. var t = null,
  3545. i = null,
  3546. n = null
  3547. $(Config.BodyContent)
  3548. .unbind("mousedown")
  3549. .live("mousedown", function (e) {
  3550. return ui.isEdit()
  3551. ? !0
  3552. : a || 1 != e.which
  3553. ? !0
  3554. : (s(e),
  3555. this.setCapture && this.setCapture(),
  3556. $(document)
  3557. .unbind("mousemove")
  3558. .mousemove(function (e) {
  3559. o(e)
  3560. }),
  3561. $(document).one("mouseup", function (e) {
  3562. r(e), (Global.isDragSelect = !0), this.releaseCapture && this.releaseCapture()
  3563. }),
  3564. stopPP(e),
  3565. !1)
  3566. })
  3567. var s = function (a) {
  3568. $(a.target).parent().hasClass(Config.FileBoxClassName) ||
  3569. $(a.target).parent().parent().hasClass(Config.FileBoxClassName) ||
  3570. $(a.target).hasClass("fix") ||
  3571. (rightMenu.hidden(),
  3572. a.ctrlKey || a.shiftKey || d.clear(),
  3573. 0 == $(a.target).hasClass("ico") && (0 == $("#selContainer").length && ($('<div id="selContainer"></div>').appendTo(Config.FileBoxSelector), (n = $("#selContainer"))), (t = a.pageX), (i = a.pageY - Global.topbar_height), (e = !0)))
  3574. },
  3575. o = function (a) {
  3576. if (!e) return !0
  3577. "none" == n.css("display") && n.css("display", "")
  3578. var s = a.pageX,
  3579. o = a.pageY - Global.topbar_height
  3580. n.css({
  3581. left: Math.min(s, t),
  3582. top: Math.min(o, i),
  3583. width: Math.abs(s - t),
  3584. height: Math.abs(o - i),
  3585. })
  3586. for (var r = n.offset().left, l = n.offset().top - Global.topbar_height, c = n.width(), p = n.height(), u = Global.fileListNum, h = 0; u > h; h++) {
  3587. var f = Global.fileListAll[h],
  3588. m = $(Global.fileListAll[h]),
  3589. v = f.offsetWidth + f.offsetLeft,
  3590. _ = f.offsetHeight + f.offsetTop
  3591. if (v > r && _ > l && r + c > f.offsetLeft && l + p > f.offsetTop) {
  3592. if (!m.hasClass("selectDragTemp")) {
  3593. if (m.hasClass("selectToggleClass")) continue
  3594. if (m.hasClass(Config.SelectClassName)) {
  3595. m.removeClass(Config.SelectClassName).addClass("selectToggleClass"), d.resumeMenu(m)
  3596. continue
  3597. }
  3598. m.addClass("selectDragTemp")
  3599. }
  3600. } else m.removeClass("selectDragTemp"), m.hasClass("selectToggleClass") && m.addClass(Config.SelectClassName).removeClass("selectToggleClass")
  3601. }
  3602. },
  3603. r = function () {
  3604. return e ? (n.css("display", "none"), $(".selectDragTemp").addClass(Config.SelectClassName).removeClass("selectDragTemp"), $(".selectToggleClass").removeClass("selectToggleClass"), d.select(), (e = !1), (t = null), (i = null), void 0) : !1
  3605. }
  3606. },
  3607. r = function (e) {
  3608. var a = 0,
  3609. t = Global.fileListSelect
  3610. Global.fileListSelectNum
  3611. var i = Global.fileListNum,
  3612. n = function () {
  3613. var n = Global.fileRowNum
  3614. if (1 == Global.fileListSelectNum) {
  3615. var s = parseInt(t.attr(Config.FileOrderAttr))
  3616. switch (e) {
  3617. case "up":
  3618. a = 0 >= s ? s : s - 1
  3619. break
  3620. case "left":
  3621. a = n > s ? 0 : s - n
  3622. break
  3623. case "down":
  3624. a = s >= i - 1 ? s : s + 1
  3625. break
  3626. case "right":
  3627. a = s + n >= i - 1 ? i - 1 : s + n
  3628. break
  3629. default:
  3630. }
  3631. } else if (Global.fileListSelectNum > 1) {
  3632. var o = parseInt(t.first().attr(Config.FileOrderAttr)),
  3633. r = parseInt(t.last().attr(Config.FileOrderAttr))
  3634. switch (e) {
  3635. case "up":
  3636. a = a = 0 >= o ? o : o - 1
  3637. break
  3638. case "left":
  3639. break
  3640. case "down":
  3641. a = r >= i ? r : r + 1
  3642. break
  3643. case "right":
  3644. a = r + n >= i ? r : r + n
  3645. break
  3646. default:
  3647. }
  3648. }
  3649. }
  3650. return n(), Global.fileListAll.eq(a)
  3651. },
  3652. l = function (e) {
  3653. var a
  3654. switch (e) {
  3655. case "home":
  3656. a = Global.fileListAll.first()
  3657. break
  3658. case "end":
  3659. a = Global.fileListAll.last()
  3660. break
  3661. case "left":
  3662. case "up":
  3663. case "right":
  3664. case "down":
  3665. a = r(e)
  3666. break
  3667. case "all":
  3668. a = Global.fileListAll
  3669. break
  3670. default:
  3671. }
  3672. d.clear(), a.addClass(Config.SelectClassName), d.select()
  3673. },
  3674. c = function (e, a) {
  3675. d.clear()
  3676. for (var t = e; a >= t; t++) $(Global.fileListAll[t]).addClass(Config.SelectClassName)
  3677. d.select()
  3678. },
  3679. d = {
  3680. init: function () {
  3681. var e = $(Config.FileBoxClass)
  3682. e.each(function (e) {
  3683. $(this).attr(Config.FileOrderAttr, e)
  3684. }),
  3685. (Global.fileListSelect = ""),
  3686. (Global.fileListAll = e),
  3687. (Global.fileListNum = e.length),
  3688. (Global.fileListSelectNum = 0)
  3689. },
  3690. select: function () {
  3691. var e = $(Config.SelectClass)
  3692. ;(Global.fileListSelect = e), (Global.fileListSelectNum = e.length), e.length > 1 && d.setMenu(e)
  3693. },
  3694. setInView: function () {},
  3695. name: function (e) {
  3696. return e.attr("data-name")
  3697. },
  3698. type: function (e) {
  3699. return e.find(".ico").attr("filetype")
  3700. },
  3701. setMenu: function (e) {
  3702. e.removeClass("menufile menufolder menuDefault").addClass("menuMore")
  3703. },
  3704. resumeMenu: function (e) {
  3705. var a = {
  3706. fileBox: "menufile",
  3707. folderBox: "menufolder",
  3708. systemBox: "menuDefault",
  3709. }
  3710. for (var t in a) e.hasClass(t) && e.removeClass("menuMore").addClass(a[t])
  3711. $(".menuRecycleButton").removeClass("menuDefault")
  3712. },
  3713. getAllName: function () {
  3714. var e = []
  3715. if (0 != Global.fileListSelectNum) {
  3716. var a = Global.fileListSelect
  3717. return (
  3718. a.each(function () {
  3719. e.push(d.name($(this)))
  3720. }),
  3721. e
  3722. )
  3723. }
  3724. },
  3725. clear: function () {
  3726. if (0 != Global.fileListSelectNum) {
  3727. var e = Global.fileListSelect
  3728. e.removeClass(Config.SelectClassName),
  3729. e.each(function () {
  3730. d.resumeMenu($(this))
  3731. }),
  3732. (Global.fileListSelect = ""),
  3733. (Global.fileListSelectNum = 0)
  3734. }
  3735. },
  3736. }
  3737. return {
  3738. init: i,
  3739. fileLight: d,
  3740. selectPos: l,
  3741. }
  3742. }),
  3743. define("desktop/ui", [], function () {
  3744. var e = new Picasa()
  3745. PicasaOpen = !1
  3746. var a = function () {
  3747. fileLight.init(), ui.setStyle(), (PicasaOpen = !1), e.initData()
  3748. },
  3749. t = function (e, a) {
  3750. var a = "down" == a ? -1 : 1
  3751. return function (t, i) {
  3752. return (t = t[e]), (i = i[e]), i > t ? -1 * a : t > i ? 1 * a : void 0
  3753. }
  3754. },
  3755. i = function (e, a) {
  3756. 0 != e && ((G.sort_field = e), $(".menu_set_sort").removeClass("selected"), $(".set_sort_" + e).addClass("selected")),
  3757. 0 != a && ((G.sort_order = a), $(".menu_set_desc").removeClass("selected"), $(".set_sort_" + a).addClass("selected")),
  3758. r(!1, !0),
  3759. ajax({
  3760. url: "index.html?setting/set&k=list_sort_field,list_sort_order&v=" + G.sort_field + "," + G.sort_order,
  3761. })
  3762. },
  3763. n = function () {
  3764. var e = 91
  3765. ;(Global.ctrlKey = !1),
  3766. $(document)
  3767. .keydown(function (a) {
  3768. if ("none" != $("#PicasaView").css("display")) return !0
  3769. if (ui.isEdit()) return !0
  3770. if (rightMenu.isDisplay()) return !0
  3771. var t = !1
  3772. if (Global.ctrlKey || a.keyCode == e || a.ctrlKey)
  3773. switch (((t = !0), (Global.ctrlKey = !0), a.keyCode)) {
  3774. case 8:
  3775. ui.path.remove(), (t = !0)
  3776. break
  3777. case 65:
  3778. fileSelect.selectPos("all")
  3779. break
  3780. case 67:
  3781. ui.path.copy()
  3782. break
  3783. case 88:
  3784. ui.path.cute()
  3785. break
  3786. case 83:
  3787. break
  3788. case 86:
  3789. ui.path.past()
  3790. break
  3791. case 70:
  3792. core.search($(".header-right input").val(), G.this_path)
  3793. break
  3794. default:
  3795. t = !1
  3796. }
  3797. else if (a.shiftKey) Global.shiftKey = !0
  3798. else
  3799. switch (a.keyCode) {
  3800. case 8:
  3801. t = !0
  3802. break
  3803. case 35:
  3804. fileSelect.selectPos("end")
  3805. break
  3806. case 36:
  3807. fileSelect.selectPos("home")
  3808. break
  3809. case 37:
  3810. fileSelect.selectPos("left"), (t = !0)
  3811. break
  3812. case 38:
  3813. fileSelect.selectPos("up")
  3814. break
  3815. case 39:
  3816. fileSelect.selectPos("right"), (t = !0)
  3817. break
  3818. case 40:
  3819. fileSelect.selectPos("down")
  3820. break
  3821. case 13:
  3822. ui.path.open(), (t = !1)
  3823. break
  3824. case 46:
  3825. ui.path.remove(), (t = !0)
  3826. break
  3827. case 113:
  3828. ui.path.rname(), (t = !0)
  3829. break
  3830. default:
  3831. t = !1
  3832. }
  3833. return t && (stopPP(a), (a.keyCode = 0), (a.returnValue = !1)), !0
  3834. })
  3835. .keyup(function (a) {
  3836. a.shiftKey && (Global.shiftKey = !1), (a.keyCode != e && a.ctrlKey) || (Global.ctrlKey = !1)
  3837. })
  3838. },
  3839. autoIconArr = function () {
  3840. var marginBottom = 10,
  3841. marginLeft = 10,
  3842. iconWidth = 85,
  3843. iconHeight = 100,
  3844. marginRight = 10,
  3845. winHeight = $(document).height() - 50,
  3846. maxColNum = Math.floor((winHeight - marginBottom) / (iconHeight + marginRight)),
  3847. colNum = 0,
  3848. rowNum = 0,
  3849. left = 0,
  3850. top = 0
  3851. $(".fileContiner .file").css("position", "absolute"),
  3852. $(".fileContiner .file").each(function (index) {
  3853. ;(colNum = index % maxColNum),
  3854. (rowNum = Math.floor(index / maxColNum)),
  3855. (left = marginLeft + (iconWidth + marginRight) * rowNum),
  3856. (top = marginBottom + (iconHeight + marginRight) * colNum),
  3857. $(this).css({
  3858. left: left,
  3859. top: top,
  3860. })
  3861. //console.log(left + "," + top);
  3862. })
  3863. }
  3864. ;(this._hover_title = function (e) {
  3865. return (
  3866. void 0 == e.size_friendly && (e.size_friendly = "0B"),
  3867. ' data-name="' + e.title + '" title="' + LNG.name + ":" + e.title + "&#10;" /*LNG.size + ":" + e.size_friendly + "&#10;" + LNG.permission + ":" + e.mode + "&#10;" + LNG.modify_time + ":" + e.mtime + */ + LNG.app_desc + ":" + e.description + '" '
  3868. )
  3869. }),
  3870. (this._getFolderBox = function (e) {
  3871. var a = "<div class='file folderBox menufolder' " + _hover_title(e) + ">"
  3872. return (a += "<div class='folder ico' filetype='folder'></div>"), (a += "<div id='" + e.name + "' class='titleBox'><span class='title'" + e.name + "</span></div></div>")
  3873. }),
  3874. (this._getFileBox = function (e) {
  3875. var a = ""
  3876. if (e.icon == null || e.icon == undefined || e.icon == "") {
  3877. e.icon = "oexe.png"
  3878. }
  3879. if (void 0 != e.icon) {
  3880. var t = e.icon
  3881. ;-1 == e.icon.search(G.static_path) && "http" != e.icon.substring(0, 4) && (t = "" + "/" + "images/app/" + e.icon)
  3882. var i = JSON.stringify(e) /*urlEncode(json_encode(e))*/,
  3883. n = e.title //.replace(".oexe", "");
  3884. ;(a = "<div data-id='app_" + e.id + "' class='file fileBox menufile' data-app='" + i + "'" + _hover_title(e) + ">"),
  3885. "app_link" == e.type
  3886. ? ((a += 0 == e.content.search("ui.path.open") ? "<div class='" + core.pathExt(n) + " ico'" : "<div class='folder ico'"), (a += ' filetype="oexe"></div><div class="app_link"></div>'))
  3887. : (a += "<div class='ico' filetype='oexe' style='background-image:url(" + t + ");background-size: cover;'></div>"),
  3888. (a += "<div id='title_" + e.id + "' class='titleBox'><span class='title'>" + n + "</span></div></div>")
  3889. } /*else if (inArray(core.filetype.image, e.ext)) {
  3890. var s = core.path2url(G.this_path + e.name),
  3891. o = "index.html?explorer/image&path=" + urlEncode(G.this_path + e.name);
  3892. a += "<div class='file fileBox menufile'" + _hover_title(e) + ">",
  3893. a += "<div picasa='" + s + "' thumb='" + o + "' title='" + e.name + "' class='picasaImage picture-o ico' filetype='" + e.ext + "' style='margin:3px 0 0 8px;background:#fff url(\"" + o + "\") no-repeat center center;;'></div>",
  3894. a += "<div id='" + e.name + "' class='titleBox'><span class='title' title='" + LNG.double_click_rename + "'>" + e.title + "</span></div></div>"
  3895. }*/ else (a += "<div class='file fileBox menufile'" + _hover_title(e) + ">"), (a += "<div class='" + e.ext + " ico' ></div>"), (a += "<div id='title_" + e.id + "' class='titleBox'><span class='title'>" + e.title + "</span></div></div>")
  3896. return a
  3897. })
  3898. var appendToUI = function (e) {
  3899. var i = "",
  3900. n = G.json_data.folderlist,
  3901. o = G.json_data.filelist
  3902. ;(n = "size" == G.sort_field || "ext" == G.sort_field ? n.sort(t("title", G.sort_order)) : n.sort(t(G.sort_field, G.sort_order))), (o = o.sort(t(G.sort_field, G.sort_order))), (G.json_data.folderlist = n), (G.json_data.filelist = o)
  3903. for (var r = "", l = "", c = 0; o.length > c; c++) r += this._getFileBox(o[c])
  3904. for (var c = 0; n.length > c; c++) l += this._getFolderBox(n[c])
  3905. i += "up" == G.sort_order ? l + r : r + l
  3906. var d = ""
  3907. $(".systemBox").each(function () {
  3908. d += $(this).get(0).outerHTML
  3909. }),
  3910. (i = d + i),
  3911. (i += "<div style='clear:both'></div>"),
  3912. e ? $(Config.FileBoxSelector).hide().html(i).fadeIn(Config.AnimateTime) : $(Config.FileBoxSelector).html(i),
  3913. a(),
  3914. autoIconArr()
  3915. },
  3916. appendToStartMenu = function (d) {
  3917. $("#menuwin #programs .apps").empty()
  3918. var d = G.json_data.filelist
  3919. for (var o in d) {
  3920. if (d[o].title == undefined) {
  3921. continue
  3922. }
  3923. var i = $('<li data-id="app_' + d[o].id + '"></li>')
  3924. var a = $('<a href="#" data-app=\'' + JSON.stringify(d[o]) + "'>" + '<span><img src="/images/app/' + d[o].icon + '" style="height:25px;border-radius:3px;"/></span>' + d[o].title + "</a>")
  3925. .click(function () {
  3926. core.openApp(eval("(" + $(this).attr("data-app") + ")"))
  3927. })
  3928. .appendTo(i)
  3929. $("#menuwin #programs .apps").append(i)
  3930. }
  3931. },
  3932. r = function (e, a, t) {
  3933. $(".fileContiner").hide()
  3934. if ((void 0 == e && (e = !0), void 0 == a && (a = !1), e))
  3935. ajax({
  3936. url: "/web/desktop/my/app/getList.json",
  3937. dataType: "json",
  3938. error: function (e) {
  3939. core.tips.tips(e.msg)
  3940. },
  3941. success: function (e) {
  3942. $(".init_loading").fadeOut(450).addClass("pop_fadeout")
  3943. $(".fileContiner").fadeIn()
  3944. if (e.status == 1) {
  3945. if (e.data == null || e.data.length == 0) {
  3946. return
  3947. }
  3948. return (
  3949. (G.json_data = {
  3950. folderlist: [],
  3951. filelist: e.data,
  3952. }),
  3953. formattime(),
  3954. appendToUI(a),
  3955. appendToStartMenu(a),
  3956. "function" == typeof t && t(e),
  3957. void 0
  3958. )
  3959. } else {
  3960. return core.tips.tips(e.msg), $(Config.FileBoxSelector).html(""), !1
  3961. }
  3962. },
  3963. })
  3964. // ajax({
  3965. // url: "/datas/explorer/pathListRecycle.jsonp?type=desktop&path=*recycle*/",
  3966. // dataType: "json",
  3967. // error: core.ajaxError,
  3968. // success: function(e) {
  3969. // if (!e.code) return ! 1;
  3970. // var a = "" + "images/recycle_full.png";
  3971. // if (0 == e.data.folderlist.length && 0 == e.data.filelist.length) var a = "" + "images/recycle.png";
  3972. // $(".menuRecycleButton .ico").css("background-image", 'url("' + a + '")')
  3973. // }
  3974. // });
  3975. else {
  3976. var i = fileLight.getAllName()
  3977. o(a), ui.path.setSelectByFilename(i)
  3978. }
  3979. },
  3980. l = function (e) {
  3981. r(!0, !1, e)
  3982. },
  3983. formattime = function () {
  3984. for (var e = 0; G.json_data.filelist.length > e; e++)
  3985. (G.json_data.filelist[e].atime = date(LNG.time_type, G.json_data.filelist[e].atime)), (G.json_data.filelist[e].ctime = date(LNG.time_type, G.json_data.filelist[e].ctime)), (G.json_data.filelist[e].mtime = date(LNG.time_type, G.json_data.filelist[e].mtime))
  3986. for (var e = 0; G.json_data.folderlist.length > e; e++)
  3987. (G.json_data.folderlist[e].atime = date(LNG.time_type, G.json_data.folderlist[e].atime)), (G.json_data.folderlist[e].ctime = date(LNG.time_type, G.json_data.folderlist[e].ctime)), (G.json_data.folderlist[e].mtime = date(LNG.time_type, G.json_data.folderlist[e].mtime))
  3988. }
  3989. return {
  3990. autoIconArr: autoIconArr,
  3991. f5: r,
  3992. f5_callback: l,
  3993. picasa: e,
  3994. setListSort: i,
  3995. sort_list: autoIconArr,
  3996. logout: function () {
  3997. MaskView.tips("<font style='font-size:24px;'>正在注销用户信息,请稍候...</font>")
  3998. ajax({
  3999. url: "/system/logout.json",
  4000. success: function (data) {
  4001. if (data.data.loginHost) {
  4002. window.location = data.data.loginHost
  4003. MaskView.tips("<font style='font-size:24px;'>注销成功</font>")
  4004. }
  4005. MaskView.close()
  4006. },
  4007. })
  4008. },
  4009. toFullScreen: function () {
  4010. //打开或关闭全屏模式
  4011. var n = document.documentElement
  4012. n.requestFullscreen ? n.requestFullscreen() : n.mozRequestFullScreen ? n.mozRequestFullScreen() : n.webkitRequestFullscreen ? n.webkitRequestFullscreen() : n.msRequestFullscreen && n.msRequestFullscreen()
  4013. },
  4014. init: function () {
  4015. var p = template.compile($("#desktop-template").html())
  4016. $("#desktop-box").html(p({ G: G, LNG: LNG, AUTH: AUTH, data: {} }))
  4017. $(".desktop .start").css({
  4018. background: 'rgba(0, 0, 0, .5) url("' + "/images/desktop/" + (AUTH.site ? AUTH.site.domain : "") + ".start.png" + '") center no-repeat',
  4019. })
  4020. $("#menuwin #logo .icon").css({
  4021. background: 'rgba(0, 0, 0, .5) url("' + "/images/desktop/" + (AUTH.site ? AUTH.site.domain : "") + ".start.png" + '") no-repeat',
  4022. "background-size": "cover",
  4023. })
  4024. var cid = $.query.get("auth_cid")
  4025. $("#toClassicBtn").attr("href", "/classic.html" + (cid ? "?auth_cid=" + cid : ""))
  4026. // toFullScreen();
  4027. var cid = $.query.get("auth_cid")
  4028. if (!(cid == null || cid == "") && G.is_root != 1) {
  4029. $("#desktop-box .fileContiner").empty()
  4030. }
  4031. $(".hidden").removeClass("hidden"),
  4032. autoIconArr(),
  4033. l(),
  4034. n(),
  4035. $(window).bind("resize", function () {
  4036. ui.setStyle(), 0 != PicasaOpen && e.setFrameResize(), autoIconArr()
  4037. }),
  4038. $("html")
  4039. .die("click")
  4040. .live("click", function () {
  4041. rightMenu.hidden(), Global.isIE && Global.isDragSelect
  4042. }),
  4043. Mousetrap.bind(["ctrl+s", "command+s"], function (e) {
  4044. e.preventDefault(), FrameCall.top("OpenopenEditor", "Editor.save", "")
  4045. })
  4046. var a,
  4047. t = 0,
  4048. i = "",
  4049. o = 200
  4050. Mousetrap.bind(
  4051. [
  4052. "1",
  4053. "2",
  4054. "3",
  4055. "4",
  4056. "5",
  4057. "6",
  4058. "7",
  4059. "8",
  4060. "9",
  4061. "0",
  4062. "`",
  4063. "~",
  4064. "!",
  4065. "@",
  4066. "#",
  4067. "$",
  4068. "%",
  4069. "^",
  4070. "&",
  4071. "*",
  4072. "(",
  4073. ")",
  4074. "-",
  4075. "_",
  4076. "=",
  4077. "+",
  4078. "[",
  4079. "{",
  4080. "]",
  4081. "}",
  4082. "|",
  4083. "/",
  4084. "?",
  4085. ".",
  4086. ">",
  4087. ",",
  4088. "<",
  4089. "a",
  4090. "b",
  4091. "c",
  4092. "d",
  4093. "e",
  4094. "f",
  4095. "g",
  4096. "h",
  4097. "i",
  4098. "j",
  4099. "k",
  4100. "l",
  4101. "m",
  4102. "n",
  4103. "o",
  4104. "p",
  4105. "q",
  4106. "r",
  4107. "s",
  4108. "t",
  4109. "u",
  4110. "v",
  4111. "w",
  4112. "x",
  4113. "y",
  4114. "z",
  4115. ],
  4116. function (e) {
  4117. var n = String.fromCharCode(e.charCode)
  4118. return 0 == t
  4119. ? ((t = time()),
  4120. (i = n),
  4121. (a = setTimeout(function () {
  4122. ui.path.setSelectByChar(i), (t = 0)
  4123. }, o)),
  4124. void 0)
  4125. : n == i.substr(-1)
  4126. ? (ui.path.setSelectByChar(i), (t = 0), void 0)
  4127. : (o > time() - t &&
  4128. ((t = time()),
  4129. (i += n),
  4130. clearTimeout(a),
  4131. (a = setTimeout(function () {
  4132. ui.path.setSelectByChar(i), (t = 0)
  4133. }, o))),
  4134. void 0)
  4135. }
  4136. ),
  4137. Mousetrap.bind(["f5"], function (e) {
  4138. stopPP(e), ui.f5(!0, !0)
  4139. }),
  4140. Mousetrap.bind(["ctrl+u", "command+u"], function (e) {
  4141. stopPP(e), core.upload()
  4142. }),
  4143. Mousetrap.bind(["ctrl+e", "command+e"], function (e) {
  4144. stopPP(e), ui.path.openEditor()
  4145. }),
  4146. Mousetrap.bind(["alt+i", "alt+i"], function (e) {
  4147. stopPP(e), ui.path.info()
  4148. }),
  4149. Mousetrap.bind(["alt+n", "alt+n"], function (e) {
  4150. stopPP(e), ui.path.newFile()
  4151. }),
  4152. Mousetrap.bind(["alt+m", "alt+m"], function (e) {
  4153. stopPP(e), ui.path.newFolder()
  4154. }),
  4155. (PicasaOpen = !1),
  4156. e.init(".picasaImage"),
  4157. e.initData()
  4158. },
  4159. getMyApps: function () {
  4160. return G.json_data ? G.json_data : { filelist: [] }
  4161. },
  4162. setTheme: function (e) {
  4163. core.setSkin(e, "desktop.css"), FrameCall.top("OpenopenEditor", "Editor.setTheme", '"' + e + '"'), FrameCall.top("Opensetting_mode", "Setting.setThemeSelf", '"' + e + '"'), FrameCall.father("ui.setTheme", '"' + e + '"')
  4164. },
  4165. setWall: function (e) {
  4166. $(".wallbackground")
  4167. .attr("src", e)
  4168. .one("load", function () {
  4169. $(".desktop").css("background-image", "url(" + e + ")")
  4170. })
  4171. },
  4172. isEdit: function () {
  4173. var e = $(document.activeElement).get(0)
  4174. if (e) return (e = e.tagName), "INPUT" == e || "TEXTAREA" == e ? !0 : !1
  4175. },
  4176. setStyle: function () {
  4177. Global.fileRowNum = (function () {
  4178. var e = $(Config.FileBoxSelector).width(),
  4179. a = $sizeInt($(Config.FileBoxClass).css("width")) + $sizeInt($(Config.FileBoxClass).css("border-left-width")) + $sizeInt($(Config.FileBoxClass).css("border-right-width")) + $sizeInt($(Config.FileBoxClass).css("margin-right"))
  4180. return parseInt(e / a)
  4181. })()
  4182. },
  4183. }
  4184. }),
  4185. define(
  4186. "desktop/path",
  4187. [
  4188. /*"desktop/pathOperate", "desktop/pathOpen"*/
  4189. ],
  4190. function (e) {
  4191. var a = e("desktop/pathOperate"),
  4192. t = e("desktop/pathOpen"),
  4193. n = void 0
  4194. ui.pathOpen = t
  4195. var s = function (e, a, t) {
  4196. if (void 0 != e) {
  4197. if ("explorer" != Config.pageApp) return core.explorer(e), void 0
  4198. if (e == G.this_path) return void 0 != a && "" != a && core.tips.tips(LNG.path_is_current, "info"), void 0
  4199. if (((G.this_path = e.replace(/\\/g, "/")), (G.this_path = e.replace(/\/+/g, "/")), "/" != G.this_path.substr(G.this_path.length - 1) && (G.this_path += "/"), $(".dialog_file_upload").length > 0)) {
  4200. var i = "hidden" == $(".dialog_file_upload").css("visibility")
  4201. core.upload(), i && $(".dialog_file_upload").css("visibility", "hidden")
  4202. }
  4203. ui.f5_callback(function () {
  4204. "function" == typeof t && t()
  4205. })
  4206. }
  4207. },
  4208. o = function (e, a) {
  4209. var t,
  4210. i,
  4211. n = 0,
  4212. s = G.json_data.folderlist,
  4213. o = G.json_data.filelist
  4214. if (("desktop" == Config.pageApp && (n = $(".menuDefault").length), "folder" == a)) {
  4215. for (t = 0; s.length > t && !(s[t].name >= e); t++);
  4216. return "up" == G.sort_order ? t + n : o.length + t + n
  4217. }
  4218. if ("file" == a) {
  4219. for (i = 0; o.length > i && !(o[i].name >= e); i++);
  4220. return "down" == G.sort_order ? i + n : s.length + i + n
  4221. }
  4222. return -1
  4223. },
  4224. r = function (e) {
  4225. void 0 != e &&
  4226. ("string" == typeof e && (e = [e]),
  4227. fileLight.clear(),
  4228. $(".fileContiner .file").each(function (a) {
  4229. var t = fileLight.name($(this))
  4230. ;-1 != $.inArray(t, e) && $(Global.fileListAll).eq(a).addClass(Config.SelectClassName)
  4231. }),
  4232. fileLight.select(),
  4233. fileLight.setInView())
  4234. },
  4235. l = function (e) {
  4236. if ("" != e) {
  4237. if (((e = e.toLowerCase()), void 0 == n || G.this_path != n.path || e != n.key)) {
  4238. var a = []
  4239. $(".fileContiner .file").each(function () {
  4240. var t = fileLight.name($(this))
  4241. t && e == t.substring(0, e.length).toLowerCase() && a.push(t)
  4242. }),
  4243. (n = {
  4244. key: e,
  4245. path: G.this_path,
  4246. index: 0,
  4247. list: a,
  4248. })
  4249. }
  4250. 0 != n.list.length && (r(n.list[n.index++]), n.index == n.list.length && (n.index = 0))
  4251. }
  4252. },
  4253. c = function (e) {
  4254. return "" == e
  4255. ? (fileLight.clear(), void 0)
  4256. : (fileLight.clear(),
  4257. $(".fileContiner .file").each(function (a) {
  4258. var t = fileLight.name($(this))
  4259. ;-1 != t.toLowerCase().indexOf(e) && $(Global.fileListAll).eq(a).addClass(Config.SelectClassName)
  4260. }),
  4261. fileLight.select(),
  4262. fileLight.setInView(),
  4263. void 0)
  4264. },
  4265. d = function (e, a, t) {
  4266. var n = e.length
  4267. for (i = 0; n > i; i++) if (e[i][a] == t) return e[i]
  4268. },
  4269. p = function (e) {
  4270. var a = "",
  4271. t = 0
  4272. return null != G.json_data.filelist && ((a = d(G.json_data.filelist, "name", e)), null != a && (t = 1)), null != G.json_data.folderlist && ((a = d(G.json_data.folderlist, "name", e)), null != a && (t = 1)), t
  4273. },
  4274. u = function (e, a) {
  4275. var t,
  4276. i = 0
  4277. if (void 0 == a) {
  4278. if (!p(e)) return e
  4279. for (t = e + "(0)"; p(t); ) i++, (t = e + "(" + i + ")")
  4280. return t
  4281. }
  4282. if (!p(e + "." + a)) return e + "." + a
  4283. for (t = e + "(0)." + a; p(t); ) i++, (t = e + "(" + i + ")." + a)
  4284. return t
  4285. },
  4286. h = function () {
  4287. ajax({
  4288. dataType: "json",
  4289. url: "index.html?explorer/historyBack",
  4290. beforeSend: function () {
  4291. $(".tools-left .msg").stop(!0, !0).fadeIn(100)
  4292. },
  4293. error: core.ajaxError,
  4294. success: function (e) {
  4295. return (
  4296. $(".tools-left .msg").fadeOut(100),
  4297. e.code ? ((e = e.data), (G.this_path = e.thispath), (G.json_data = e.list), (Global.historyStatus = e.history_status), ui.f5(!1, !0), ui.header.updateHistoryStatus(), ui.header.addressSet(), void 0) : (core.tips.tips(e), $(Config.FileBoxSelector).html(""), !1)
  4298. )
  4299. },
  4300. })
  4301. },
  4302. f = function () {
  4303. ajax({
  4304. dataType: "json",
  4305. url: "index.html?explorer/historyNext",
  4306. beforeSend: function () {
  4307. $(".tools-left .msg").stop(!0, !0).fadeIn(100)
  4308. },
  4309. error: core.ajaxError,
  4310. success: function (e) {
  4311. return (
  4312. $(".tools-left .msg").fadeOut(100),
  4313. e.code ? ((e = e.data), (G.this_path = e.thispath), (G.json_data = e.list), (Global.historyStatus = e.history_status), ui.f5(!1, !0), ui.header.updateHistoryStatus(), ui.header.addressSet(), void 0) : (core.tips.tips(e), $(Config.FileBoxSelector).html(""), !1)
  4314. )
  4315. },
  4316. })
  4317. },
  4318. m = function (e) {
  4319. fileLight.clear(), void 0 == e && (e = "txt")
  4320. var t = "newfile",
  4321. t = u(t, e),
  4322. i = o(t, "file")
  4323. i = 0 == i ? -1 : i - 1
  4324. var n =
  4325. '<div class="file select menufile" id="makefile"> <div class="' +
  4326. e +
  4327. ' ico"></div> <div class="titleBox"> <span class="title"> <div class="textarea"> <textarea class="newfile fix">' +
  4328. t +
  4329. '</textarea> </span> </div> </div> <div style="clear:both;"></div> </div>'
  4330. ;-1 == i ? $(Config.FileBoxSelector).html(n + $(Config.FileBoxSelector).html()) : $(n).insertAfter(Config.FileBoxSelector + " .file:eq(" + i + ")"), "desktop" == Config.pageApp && ui.sort_list()
  4331. var s = $(".newfile"),
  4332. l = s.get(0),
  4333. c = t.length - e.length - 1
  4334. if (Global.isIE) {
  4335. var d = l.createTextRange()
  4336. d.moveEnd("character", -l.value.length), d.moveEnd("character", c), d.moveStart("character", 0), d.select()
  4337. } else l.setSelectionRange(0, c)
  4338. s.focus(),
  4339. s.unbind("keydown").keydown(function (e) {
  4340. return (
  4341. (13 == e.keyCode || 27 == e.keyCode) &&
  4342. (stopPP(e),
  4343. e.preventDefault(),
  4344. (filename = s.attr("value")),
  4345. p(filename)
  4346. ? ($("#makefile").remove(), core.tips.tips(LNG.path_exists, "warning"))
  4347. : a.newFile(G.this_path + filename, function () {
  4348. ui.f5_callback(function () {
  4349. r(filename)
  4350. })
  4351. })),
  4352. !0
  4353. )
  4354. }),
  4355. s.unbind("blur").blur(function () {
  4356. ;(filename = s.attr("value")),
  4357. p(filename)
  4358. ? ($("#makefile").remove(), core.tips.tips(LNG.path_exists, "warning"), _newFile(e))
  4359. : a.newFile(G.this_path + filename, function () {
  4360. ui.f5_callback(function () {
  4361. r(filename)
  4362. })
  4363. })
  4364. })
  4365. },
  4366. v = function () {
  4367. fileLight.clear()
  4368. var e = LNG.newfolder,
  4369. e = u(e),
  4370. t = o(e, "folder")
  4371. t = 0 == t ? -1 : t - 1
  4372. var i = '<div class="file select menufolder" id="makefile">'
  4373. ;(i += '<div class="folder ico" filetype="folder"></div>'),
  4374. (i += '<div class="titleBox"><span class="title">'),
  4375. (i += '<div class="textarea"><textarea class="newfile fix">' + e + '</textarea></span></div></div><div style="clear:both;"></div></div>'),
  4376. -1 == t ? $(Config.FileBoxSelector).html(i + $(Config.FileBoxSelector).html()) : $(i).insertAfter(Config.FileBoxSelector + " .file:eq(" + t + ")"),
  4377. "desktop" == Config.pageApp && ui.sort_list(),
  4378. $(".newfile").select(),
  4379. $(".newfile").focus(),
  4380. $(".newfile")
  4381. .unbind("keydown")
  4382. .keydown(function (e) {
  4383. if (13 == e.keyCode || 27 == e.keyCode) {
  4384. stopPP(e), e.preventDefault()
  4385. var t = $(".newfile").attr("value")
  4386. p(t)
  4387. ? ($("#makefile").remove(), core.tips.tips(LNG.path_exists, "warning"))
  4388. : a.newFolder(G.this_path + t, function () {
  4389. "explorer" == Config.pageApp && ui.tree.checkIfChange(G.this_path),
  4390. ui.f5_callback(function () {
  4391. r(t)
  4392. })
  4393. })
  4394. }
  4395. }),
  4396. $(".newfile")
  4397. .unbind("blur")
  4398. .blur(function () {
  4399. ;(filename = $(".newfile").attr("value")),
  4400. p(filename)
  4401. ? ($("#makefile").remove(), core.tips.tips(LNG.path_exists, "warning"), _newFolder())
  4402. : a.newFolder(G.this_path + filename, function () {
  4403. "explorer" == Config.pageApp && ui.tree.checkIfChange(G.this_path),
  4404. ui.f5_callback(function () {
  4405. r(filename)
  4406. })
  4407. })
  4408. })
  4409. },
  4410. _ = function () {
  4411. var e = "",
  4412. t = "",
  4413. i = Global.fileListSelect,
  4414. n = fileLight.name(i),
  4415. s = fileLight.type(i)
  4416. if (1 == i.length) {
  4417. if (i.hasClass("menuSharePath")) return ui.path.share_edit(), void 0
  4418. ;(s = "folder" == s ? "folder" : s),
  4419. $(i)
  4420. .find(".title")
  4421. .html("<div class='textarea'><textarea class='fix' id='pathRenameTextarea'>" + $(i).find(".title").text() + "</textarea><div>")
  4422. var o = $("#pathRenameTextarea"),
  4423. l = o.get(0)
  4424. if ("folder" == s) o.select()
  4425. else {
  4426. var c = n.length - s.length - 1
  4427. if (Global.isIE) {
  4428. var d = l.createTextRange()
  4429. d.moveEnd("character", -l.value.length), d.moveEnd("character", c), d.moveStart("character", 0), d.select()
  4430. } else l.setSelectionRange(0, c)
  4431. }
  4432. o.unbind("focus").focus(),
  4433. o.keydown(function (l) {
  4434. if (13 == l.keyCode) {
  4435. l.preventDefault(), stopPP(l), (e = o.attr("value")), "oexe" == s && (e += ".oexe")
  4436. var c = e
  4437. e != n
  4438. ? ((t = urlEncode(G.this_path + n)),
  4439. (e = urlEncode(G.this_path + e)),
  4440. a.rname(t, e, function () {
  4441. "explorer" == Config.pageApp && ui.tree.checkIfChange(G.this_path),
  4442. ui.f5_callback(function () {
  4443. r(c)
  4444. })
  4445. }))
  4446. : ("oexe" == s && (n = n.replace(".oexe", "")), $(i).find(".title").html(n))
  4447. }
  4448. 27 == l.keyCode && ("oexe" == s && (n = n.replace(".oexe", "")), $(i).find(".title").html(n))
  4449. }),
  4450. o.unbind("blur").blur(function () {
  4451. ;(e = $("#pathRenameTextarea").attr("value")), "oexe" == s && (e += ".oexe")
  4452. var o = e
  4453. e != n
  4454. ? ((t = urlEncode(G.this_path + n)),
  4455. (e = urlEncode(G.this_path + e)),
  4456. a.rname(t, e, function () {
  4457. "explorer" == Config.pageApp && ui.tree.checkIfChange(G.this_path),
  4458. ui.f5_callback(function () {
  4459. r(o)
  4460. })
  4461. }))
  4462. : ("oexe" == s && (n = n.replace(".oexe", "")), $(i).find(".title").html(n))
  4463. })
  4464. }
  4465. },
  4466. g = function () {
  4467. ui.f5(), "explorer" == Config.pageApp && ui.tree.checkIfChange(G.this_path)
  4468. },
  4469. y = function (e) {
  4470. if (e) {
  4471. var a = []
  4472. return 0 == Global.fileListSelect.length
  4473. ? a
  4474. : (Global.fileListSelect.each(function () {
  4475. var e = G.this_path + fileLight.name($(this)),
  4476. app = eval("(" + $(this).attr("data-app") + ")")
  4477. // t = "folder" == fileLight.type($(this)) ? "folder": "file";
  4478. // "*share*/" == G.this_path && (e = $(this).attr("data-path"), t = "share"),
  4479. a.push(app)
  4480. }),
  4481. a)
  4482. }
  4483. if (1 != Global.fileListSelectNum)
  4484. return {
  4485. path: "",
  4486. type: "",
  4487. }
  4488. var t = Global.fileListSelect,
  4489. i = G.this_path + fileLight.name(t),
  4490. n = fileLight.type(t)
  4491. return (
  4492. "*share*/" == G.this_path && ((i = t.attr("data-path")), (n = "share")),
  4493. {
  4494. path: i,
  4495. type: n,
  4496. }
  4497. )
  4498. }
  4499. // return {};
  4500. return {
  4501. appEdit: function (e) {
  4502. if (e) a.appEdit(0, 0, "add")
  4503. else {
  4504. var t = Global.fileListSelect.attr("data-app"),
  4505. i = json_decode(urlDecode(t))
  4506. ;(i.path = G.this_path + fileLight.name(Global.fileListSelect)), a.appEdit(i)
  4507. }
  4508. },
  4509. appList: function () {
  4510. a.appList(y().path)
  4511. },
  4512. appInstall: function () {
  4513. a.appInstall(y().path)
  4514. },
  4515. openEditor: function () {
  4516. t.openEditor(y().path)
  4517. },
  4518. openIE: function () {
  4519. t.openIE(y().path)
  4520. },
  4521. open: function (e) {
  4522. if (0 != y().path.length) {
  4523. if ("*recycle*/" == G.this_path) return ui.path.info(), void 0
  4524. if ("*share*/" == G.this_path) return ui.path.share_open_window(), void 0
  4525. if (void 0 != e) return t.open(e), void 0
  4526. var a = y(),
  4527. i = Global.fileListSelect
  4528. if (inArray(core.filetype.image, a.type)) {
  4529. if (!core.authCheck("explorer:fileDownload", LNG.no_permission_download)) return
  4530. return "icon" == G.list_type || "desktop" == Config.pageApp ? ui.picasa.play($(i).find(".ico")) : ui.picasa.play($(i)), void 0
  4531. }
  4532. if ("oexe" == a.type) {
  4533. var n = i.attr("data-app")
  4534. a.path = json_decode(urlDecode(n))
  4535. }
  4536. t.open(a.path, a.type)
  4537. }
  4538. },
  4539. // play: function() {
  4540. // if (! (1 > Global.fileListSelectNum)) {
  4541. // var e = [];
  4542. // Global.fileListSelect.each(function() {
  4543. // var a = fileLight.type($(this));
  4544. // if (inArray(core.filetype.music, a) || inArray(core.filetype.movie, a)) {
  4545. // var t = core.path2url(G.this_path + fileLight.name($(this)));
  4546. // e.push(t)
  4547. // }
  4548. // }),
  4549. // t.play(e, "music")
  4550. // }
  4551. // },
  4552. pathOperate: a,
  4553. // share: function() {
  4554. // a.share(y())
  4555. // },
  4556. // setBackground: function() {
  4557. // a.setBackground(y().path)
  4558. // },
  4559. // createLink: function() {
  4560. // a.createLink(y().path, y().type,
  4561. // function(e) {
  4562. // ui.f5_callback(function() {
  4563. // r(e.info)
  4564. // })
  4565. // })
  4566. // },
  4567. // createProject: function() {
  4568. // a.createProject(y().path,
  4569. // function(e) {
  4570. // ui.f5_callback(function() {
  4571. // r(e.info)
  4572. // })
  4573. // })
  4574. // },
  4575. // download: function() {
  4576. // var e = y(!0);
  4577. // 1 == e.length && "file" == e[0].type ? t.download(y().path) : a.zipDownload(e)
  4578. // },
  4579. // share_edit: function() {
  4580. // var e = y().path,
  4581. // t = G.json_data.share_list[e];
  4582. // a.share_box(t)
  4583. // },
  4584. // share_open_window: function() {
  4585. // var e = y().path,
  4586. // a = G.json_data.share_list[e],
  4587. // t = a.type;
  4588. // "folder" == a.type && (t = 1 == a.code_read ? "code_read": "folder");
  4589. // var i = "index.html?share/" + t + "&user=" + G.user_name + "&sid=" + a.sid;
  4590. // window.open(i)
  4591. // },
  4592. // share_open_path: function() {
  4593. // var e = y().path,
  4594. // a = G.json_data.share_list[e],
  4595. // t = core.pathFather(a.path),
  4596. // i = core.pathThis(a.path);
  4597. // ui.path.list(t, "",
  4598. // function() {
  4599. // r(i)
  4600. // })
  4601. // },
  4602. // recycle_clear: function() {
  4603. // $.dialog({
  4604. // id: "dialog_path_remove",
  4605. // fixed: !0,
  4606. // icon: "question",
  4607. // title: LNG.remove_title,
  4608. // padding: 40,
  4609. // lock: !0,
  4610. // background: "#000",
  4611. // opacity: .2,
  4612. // content: LNG.recycle_clear_info,
  4613. // ok: function() {
  4614. // ajax({
  4615. // url: "index.html?explorer/pathDeleteRecycle",
  4616. // beforeSend: function() {
  4617. // core.tips.loading()
  4618. // },
  4619. // error: core.ajaxError,
  4620. // success: function(e) {
  4621. // core.tips.close(e),
  4622. // ui.f5(),
  4623. // FrameCall.father("ui.f5", "1,1"),
  4624. // "function" == typeof callback && callback(e)
  4625. // }
  4626. // })
  4627. // },
  4628. // cancel: !0
  4629. // })
  4630. // },
  4631. // explorer: function() {
  4632. // core.explorer(y().path)
  4633. // },
  4634. // explorerNew: function() {
  4635. // window.open("index.html?/explorer&path=" + y().path)
  4636. // },
  4637. // openProject: function() {
  4638. // core.explorerCode(y().path)
  4639. // },
  4640. // search: function() {
  4641. // core.search("", y().path)
  4642. // },
  4643. // fav: function() {
  4644. // a.fav(y().path)
  4645. // },
  4646. remove: function () {
  4647. a.remove(y(!0), g), fileLight.clear()
  4648. },
  4649. // copy: function() {
  4650. // a.copy(y(!0))
  4651. // },
  4652. // cute: function() {
  4653. // a.cute(y(!0), ui.f5)
  4654. // },
  4655. // zip: function() {
  4656. // a.zip(y(!0),
  4657. // function(e) {
  4658. // ui.f5_callback(function() {
  4659. // r(e.info)
  4660. // })
  4661. // })
  4662. // },
  4663. // unZip: function() {
  4664. // a.unZip(y().path, ui.f5)
  4665. // },
  4666. // cuteDrag: function(e) {
  4667. // a.cuteDrag(y(!0), e, g)
  4668. // },
  4669. // copyDrag: function(e, t) {
  4670. // a.copyDrag(y(!0), e,
  4671. // function(e) {
  4672. // fileLight.clear(),
  4673. // "explorer" == Config.pageApp && ui.tree.checkIfChange(G.this_path),
  4674. // ui.f5_callback(function() {
  4675. // t && e.data && r(e.data)
  4676. // })
  4677. // })
  4678. // },
  4679. // info: function() {
  4680. // if ("share" == y().type) {
  4681. // var e = y().path,
  4682. // t = G.json_data.share_list[e],
  4683. // i = t.path;
  4684. // a.info([{
  4685. // path: i,
  4686. // type: t.type
  4687. // }])
  4688. // } else a.info(y(!0))
  4689. // },
  4690. // past: function() {
  4691. // fileLight.clear(),
  4692. // a.past(G.this_path,
  4693. // function(e) {
  4694. // "explorer" == Config.pageApp && ui.tree.checkIfChange(G.this_path),
  4695. // ui.f5_callback(function() {
  4696. // r(e)
  4697. // })
  4698. // })
  4699. // },
  4700. // back: h,
  4701. // next: f,
  4702. // list: s,
  4703. // newFile: m,
  4704. // newFolder: v,
  4705. // rname: _
  4706. // setSearchByStr: c,
  4707. // setSelectByChar: l,
  4708. // setSelectByFilename: r,
  4709. // clipboard: a.clipboard
  4710. }
  4711. }
  4712. ),
  4713. define("desktop/pathOperate", [], function (e) {
  4714. var a = {}
  4715. ;(a.file_info = e("tpl/fileinfo/file_info.html")), (a.path_info = e("tpl/fileinfo/path_info.html")), (a.path_info_more = e("tpl/fileinfo/path_info_more.html"))
  4716. var t = ["/", "\\", ":", "*", "?", '"', "<", ">", "|"],
  4717. i = function (e) {
  4718. var a = function (e, a) {
  4719. for (var t = a.length, i = 0; t > i; i++) if (e.indexOf(a[i]) > 0) return !0
  4720. return !1
  4721. }
  4722. return a(e, t) ? (core.tips.tips(LNG.path_not_allow + ':/ : * ? " < > |', !1), !1) : !0
  4723. },
  4724. n = function (e) {
  4725. for (var a = "list=[", t = 0; e.length > t; t++) (a += '{"type":"' + e[t].type + '","path":"' + urlEncode2(e[t].path) + '"}'), e.length - 1 > t && (a += ",")
  4726. return a + "]"
  4727. },
  4728. s = function (e, a) {
  4729. if (e) {
  4730. var t = core.pathThis(e)
  4731. return i(t)
  4732. ? (ajax({
  4733. dataType: "json",
  4734. url: "index.html?explorer/mkfile&path=" + urlEncode2(e),
  4735. beforeSend: function () {
  4736. core.tips.loading()
  4737. },
  4738. error: core.ajaxError,
  4739. success: function (e) {
  4740. core.tips.close(e), "function" == typeof a && a(e)
  4741. },
  4742. }),
  4743. void 0)
  4744. : ("function" == typeof a && a(), void 0)
  4745. }
  4746. },
  4747. o = function (e, a) {
  4748. if (e) {
  4749. var t = core.pathThis(e)
  4750. return i(t)
  4751. ? (ajax({
  4752. dataType: "json",
  4753. url: "index.html?explorer/mkdir&path=" + urlEncode2(e),
  4754. beforeSend: function () {
  4755. core.tips.loading()
  4756. },
  4757. error: core.ajaxError,
  4758. success: function (e) {
  4759. core.tips.close(e), "function" == typeof a && a(e)
  4760. },
  4761. }),
  4762. void 0)
  4763. : ("function" == typeof a && a(), void 0)
  4764. }
  4765. },
  4766. r = function (e, a, t) {
  4767. return e && a && e != a
  4768. ? i(core.pathThis(a)) /*ajax({
  4769. type: "POST",
  4770. dataType: "json",
  4771. url: "index.html?explorer/pathRname",
  4772. data: "path=" + urlEncode(e) + "&rname_to=" + urlEncode(a),
  4773. beforeSend: function() {
  4774. core.tips.loading()
  4775. },
  4776. error: core.ajaxError,
  4777. success: function(e) {*/
  4778. ? //core.tips.close(e),
  4779. "function" == typeof t && t(e)
  4780. : /*}
  4781. }),void 0*/ ("function" == typeof t && t(), void 0)
  4782. : void 0
  4783. },
  4784. l = function (e, a) {
  4785. if (!(1 > e.length)) {
  4786. var t = e[0].title,
  4787. i = LNG.remove_title,
  4788. s = t + "<br/>" + LNG.remove_info,
  4789. o = "index.html?explorer/pathDelete"
  4790. "*recycle*/" == G.this_path && ((s = LNG.recycle_remove + "?"), (o = "index.html?explorer/pathDeleteRecycle"), (i = LNG.recycle_remove)),
  4791. "share" == e[0].type && ((s = LNG.share_remove_tips), (o = "index.html?userShare/del"), (i = LNG.share_remove)),
  4792. e.length > 1 && (s += ' ... <span class="badge">' + e.length + "</span>"),
  4793. $.dialog({
  4794. id: "dialog_path_remove",
  4795. fixed: !0,
  4796. icon: "question",
  4797. title: i,
  4798. width: 300,
  4799. padding: 40,
  4800. lock: !0,
  4801. background: "#000",
  4802. opacity: 0.3,
  4803. content: s,
  4804. ok: function () {
  4805. ajax({
  4806. url: "/web/desktop/my/app/remove.json",
  4807. type: "POST",
  4808. dataType: "json",
  4809. data: { id: e[0].id },
  4810. beforeSend: function () {
  4811. core.tips.loading()
  4812. },
  4813. error: core.ajaxError,
  4814. success: function (t) {
  4815. if (t.status != 1) {
  4816. core.tips.close(t.msg)
  4817. return
  4818. }
  4819. $("[data-id=app_" + e[0].id + "]").fadeOut(function () {
  4820. $(this).remove()
  4821. ui.autoIconArr()
  4822. })
  4823. core.tips.close("删除成功")
  4824. // if (core.tips.close(t), FrameCall.father("ui.f5", "1,1"), "share" == e[0].type) {
  4825. // var i = art.dialog.list.share_dialog;
  4826. // void 0 != i && i.close(),
  4827. // $(".jiathis_style").appendTo(".global_share")
  4828. // }
  4829. // "function" == typeof a && a(t)
  4830. },
  4831. })
  4832. },
  4833. cancel: !0,
  4834. })
  4835. }
  4836. },
  4837. c = function (e) {
  4838. 1 > e.length ||
  4839. ajax({
  4840. url: "index.html?explorer/pathCopy",
  4841. type: "POST",
  4842. dataType: "json",
  4843. data: n(e),
  4844. error: core.ajaxError,
  4845. success: function (e) {
  4846. core.tips.tips(e)
  4847. },
  4848. })
  4849. },
  4850. u = function (a) {
  4851. var t = e("tpl/share.html"),
  4852. i = template.compile(t),
  4853. n = i({
  4854. LNG: LNG,
  4855. })
  4856. $.dialog({
  4857. id: "share_dialog",
  4858. simple: !0,
  4859. resize: !1,
  4860. width: 425,
  4861. title: LNG.share,
  4862. padding: "0",
  4863. fixed: !0,
  4864. content: n,
  4865. cancel: function () {
  4866. $(".jiathis_style").appendTo(".global_share")
  4867. },
  4868. })
  4869. var s = "zh_CN" == G.lang ? "ch" : "en"
  4870. $("#share_time").datetimepicker({
  4871. format: "Y/m/d",
  4872. formatDate: "Y/m/d",
  4873. timepicker: !1,
  4874. lang: s,
  4875. }),
  4876. $("#share_time")
  4877. .unbind("blur")
  4878. .bind("blur", function (e) {
  4879. stopPP(e)
  4880. })
  4881. var o = function (e) {
  4882. if (($(".share_setting_more").addClass("hidden"), void 0 == e))
  4883. $(".share_has_url").addClass("hidden"),
  4884. $(".share_action .share_remove_button").addClass("hidden"),
  4885. $(".content_info input[name=sid]").val(""),
  4886. $(".content_info input[name=type]").val(""),
  4887. $(".content_info input[name=name]").val(""),
  4888. $(".content_info input[name=path]").val(""),
  4889. $(".content_info input[name=time_to]").val(""),
  4890. $(".content_info input[name=share_password]").val(""),
  4891. $(".share_view_info").addClass("hidden")
  4892. else {
  4893. ;(a = e),
  4894. $(".content_info input[name=sid]").val(e.sid),
  4895. $(".content_info input[name=type]").val(e.type),
  4896. $(".content_info input[name=name]").val(e.name),
  4897. $(".content_info input[name=path]").val(e.path),
  4898. $(".content_info input[name=time_to]").val(e.time_to),
  4899. $(".content_info input[name=share_password]").val(e.share_password),
  4900. $(".share_view_info").removeClass("hidden"),
  4901. e.num_download === void 0 && (e.num_download = 0),
  4902. e.num_view === void 0 && (e.num_view = 0)
  4903. var t = LNG.share_view_num + e.num_view + " " + LNG.share_download_num + e.num_download
  4904. $(".share_view_info").html(t),
  4905. "1" == e.code_read ? $(".content_info input[name=code_read]").attr("checked", "checked") : $(".content_info input[name=code_read]").removeAttr("checked"),
  4906. "1" == e.not_download ? $(".content_info input[name=not_download]").attr("checked", "checked") : $(".content_info input[name=not_download]").removeAttr("checked"),
  4907. $(".share_has_url").removeClass("hidden"),
  4908. "file" == e.type ? $(".label_code_read").addClass("hidden") : $(".label_code_read").removeClass("hidden")
  4909. var i = e.type
  4910. "folder" == e.type && (i = 1 == e.code_read ? "code_read" : "folder")
  4911. var n = G.app_host + "index.html?share/" + i + "&user=" + G.user_name + "&sid=" + e.sid
  4912. $(".content_info .share_url").val(n),
  4913. ("" != e.time_to || "" != e.share_password || "1" == e.code_read || "1" == e.not_download) && $(".share_setting_more").removeClass("hidden"),
  4914. $(".share_remove_button").removeClass("hidden"),
  4915. $(".share_create_button").text(LNG.share_save),
  4916. (jiathis_config = {
  4917. url: n,
  4918. summary: e.name,
  4919. title: "share to ##",
  4920. shortUrl: !1,
  4921. hideMore: !1,
  4922. }),
  4923. $(".jiathis_style").appendTo(".share_jiathis_box")
  4924. }
  4925. },
  4926. r = function () {
  4927. $(".share_action .share_remove_button")
  4928. .unbind("click")
  4929. .click(function () {
  4930. ui.pathOperate.remove([
  4931. {
  4932. type: "share",
  4933. path: a.sid,
  4934. },
  4935. ]),
  4936. "*share*/" == G.this_path && ui.f5()
  4937. }),
  4938. $(".content_info .share_more")
  4939. .unbind("click")
  4940. .click(function () {
  4941. $(".share_setting_more").toggleClass("hidden")
  4942. }),
  4943. $(".share_action .share_create_button")
  4944. .unbind("click")
  4945. .click(function () {
  4946. var e = ""
  4947. $(".share_dialog .content_info input[name]").each(function () {
  4948. var a = urlEncode($(this).val())
  4949. "checkbox" == $(this).attr("type") && (a = $(this).attr("checked") ? "1" : ""), (e += "&" + $(this).attr("name") + "=" + a)
  4950. }),
  4951. ajax({
  4952. url: "index.html?userShare/set",
  4953. data: e,
  4954. type: "POST",
  4955. dataType: "json",
  4956. beforeSend: function () {
  4957. $(".share_create_button").addClass("disabled")
  4958. },
  4959. error: function () {
  4960. core.tips.tips(LNG.error, !1)
  4961. },
  4962. success: function (e) {
  4963. $(".share_create_button").removeClass("disabled"), e.code ? (o(e.data), $(".share_create_button").text(LNG.share_save), "*share*/" == G.this_path && ui.f5(), core.tips.tips(LNG.success, !0)) : core.tips.tips(e)
  4964. },
  4965. })
  4966. }),
  4967. $(".content_info .open_window")
  4968. .unbind("click")
  4969. .bind("click", function () {
  4970. window.open($("input.share_url").val())
  4971. })
  4972. var e = $("input.share_url"),
  4973. t = e.get(0)
  4974. e.unbind("hover click").bind("hover click", function () {
  4975. $(this).focus()
  4976. var a = e.val().length
  4977. if (Global.isIE) {
  4978. var i = t.createTextRange()
  4979. i.moveEnd("character", -t.value.length), i.moveEnd("character", a), i.moveStart("character", 0), i.select()
  4980. } else t.setSelectionRange(0, a)
  4981. })
  4982. }
  4983. o(a), r()
  4984. },
  4985. h = function (e) {
  4986. if (!(1 > e.length)) {
  4987. var a = core.path2url(e)
  4988. FrameCall.father("ui.setWall", '"' + a + '"'),
  4989. ajax({
  4990. url: "index.html?setting/set&k=wall&v=" + urlEncode(a),
  4991. type: "json",
  4992. success: function (e) {
  4993. core.tips.tips(e)
  4994. },
  4995. })
  4996. }
  4997. },
  4998. f = function (e, a, t) {
  4999. if (!(1 > e.length)) {
  5000. var i,
  5001. n = core.pathThis(e),
  5002. s = core.pathFather(e)
  5003. i = "folder" == a ? "ui.path.list('" + urlEncode(e) + "');" : "ui.path.open('" + urlEncode(e) + "');"
  5004. var o = urlEncode2(s + n + ".oexe")
  5005. ajax({
  5006. url: "index.html?explorer/mkfile&path=" + o,
  5007. type: "POST",
  5008. dataType: "json",
  5009. data: 'content={"type":"app_link","content":"' + i + '","icon":"app_s2.png"}',
  5010. success: function (e) {
  5011. e.code && "function" == typeof t && t(e)
  5012. },
  5013. })
  5014. }
  5015. },
  5016. reloadTree = function (e, pbox) {
  5017. var setValues = function (treeId) {
  5018. var nodes = $.fn.zTree.getZTreeObj(treeId).getCheckedNodes(true)
  5019. var ids = [],
  5020. names = []
  5021. for (var i = 0; i < nodes.length; i++) {
  5022. ids.push(nodes[i].id)
  5023. names.push(nodes[i].name)
  5024. }
  5025. e.attr({ "data-id": ids.join(","), data: JSON.stringify(ids) }).val(names.join(","))
  5026. },
  5027. getValues = function () {
  5028. var ids = e.attr("data-id")
  5029. return ids ? ids.split(",") : []
  5030. },
  5031. click = function (event, treeId, node) {
  5032. var treeObj = $.fn.zTree.getZTreeObj(treeId)
  5033. treeObj.checkNode(node, !node.checked, false)
  5034. setValues(treeId)
  5035. },
  5036. check = function (event, treeId, node) {
  5037. setValues(treeId)
  5038. },
  5039. dftCheck = function (treeId) {
  5040. var ids = getValues()
  5041. for (var c in ids) {
  5042. try {
  5043. var treeObj = $.fn.zTree.getZTreeObj(treeId)
  5044. var node = treeObj.getNodeByParam("id", ids[c])
  5045. if (null == node) {
  5046. continue
  5047. }
  5048. treeObj.checkNode(node, true, false)
  5049. } catch (e) {
  5050. console.log(e)
  5051. }
  5052. }
  5053. $.fn.zTree.getZTreeObj(treeId).expandAll(true)
  5054. setValues(treeId)
  5055. pbox.attr({ loaded: true })
  5056. },
  5057. rootPid = 0,
  5058. setting = {
  5059. check: {
  5060. chkStyle: "checkbox",
  5061. chkboxType: { Y: "", N: "" },
  5062. enable: true,
  5063. },
  5064. view: {
  5065. dblClickExpand: false,
  5066. },
  5067. data: {
  5068. simpleData: {
  5069. enable: true,
  5070. pIdKey: "parentId",
  5071. rootPid: 0,
  5072. },
  5073. },
  5074. async: {
  5075. enable: true,
  5076. url: "/web/menu/getAll.json",
  5077. dataFilter: function (id, pnode, r) {
  5078. var rdata = []
  5079. var data = r.data.rows
  5080. if (data) {
  5081. // rdata[0] = {id:rootPid,parentId:rootPid,name:"根节点",xpath:"/",open:true};
  5082. for (var i = 0; i < data.length; i++) {
  5083. data[i].name = data[i].name
  5084. data[i].url = null
  5085. rdata.push(data[i])
  5086. }
  5087. }
  5088. return rdata
  5089. },
  5090. },
  5091. callback: {
  5092. //事件处理回调函数
  5093. onClick: click,
  5094. onCheck: check,
  5095. onAsyncSuccess: function (event, treeId, treeNode, msg) {
  5096. dftCheck(treeId)
  5097. },
  5098. },
  5099. }
  5100. if (pbox.attr("loaded")) {
  5101. dftCheck(pbox.attr("id"))
  5102. return
  5103. }
  5104. !pbox.is(":visible") && $.fn.zTree.init(pbox, setting)
  5105. },
  5106. reloadSite = function (parent, pbox) {
  5107. if (pbox.attr("loaded")) {
  5108. return
  5109. }
  5110. var uuid = parent.attr("uuid")
  5111. var ids = parent.attr("data-id").split(",")
  5112. var names = []
  5113. pbox.empty()
  5114. ajax({
  5115. url: "/web/site/getAll.json",
  5116. success: function (d) {
  5117. if (!d.data.rows) {
  5118. return
  5119. }
  5120. var d = d.data.rows
  5121. for (var i = 0; i < d.length; i++) {
  5122. var chk = false
  5123. for (var j = 0; j < ids.length; j++) {
  5124. if (d[i].id == ids[j]) {
  5125. names.push(d[i].name)
  5126. chk = true
  5127. }
  5128. }
  5129. pbox.append(
  5130. '<li style="list-style: none;">' + '<input type="checkbox" ' + (chk ? "checked" : "") + ' id="chk_site_' + d[i].id + "_" + uuid + '" value="' + d[i].id + '" data-text="' + d[i].name + '"/>' + '<label for="chk_site_' + d[i].id + "_" + uuid + '">' + d[i].name + "</label>" + "</li>"
  5131. )
  5132. }
  5133. parent.val(names.join(","))
  5134. pbox.attr("loaded", true)
  5135. $("input[type=checkbox]", pbox).change(function () {
  5136. var i = []
  5137. var n = []
  5138. $("input[type=checkbox]:checked", pbox).each(function () {
  5139. i.push($(this).val())
  5140. n.push($(this).attr("data-text"))
  5141. })
  5142. parent.val(n.join(","))
  5143. parent.attr("data-id", i.join(","))
  5144. })
  5145. },
  5146. })
  5147. },
  5148. reloadRole = function (parent, pbox) {
  5149. if (pbox.attr("loaded")) {
  5150. return
  5151. }
  5152. var uuid = parent.attr("uuid")
  5153. var ids = parent.attr("data-id").split(",")
  5154. var names = []
  5155. pbox.empty()
  5156. ajax({
  5157. url: "/web/role/getAll.json",
  5158. success: function (d) {
  5159. if (d.status != 1) {
  5160. return
  5161. }
  5162. var d = d.data.rows
  5163. for (var i = 0; i < d.length; i++) {
  5164. if (d[i].id == 1) {
  5165. continue
  5166. }
  5167. var chk = false
  5168. for (var j = 0; j < ids.length; j++) {
  5169. if (d[i].id == ids[j]) {
  5170. names.push(d[i].name)
  5171. chk = true
  5172. }
  5173. }
  5174. pbox.append(
  5175. '<li style="list-style: none;">' + '<input type="checkbox" ' + (chk ? "checked" : "") + ' id="chk_role_' + d[i].id + "_" + uuid + '" value="' + d[i].id + '" data-text="' + d[i].name + '"/>' + '<label for="chk_role_' + d[i].id + "_" + uuid + '">' + d[i].name + "</label>" + "</li>"
  5176. )
  5177. }
  5178. parent.val(names.join(","))
  5179. pbox.attr("loaded", true)
  5180. $("input[type=checkbox]", pbox).change(function () {
  5181. var i = []
  5182. var n = []
  5183. $("input[type=checkbox]:checked", pbox).each(function () {
  5184. i.push($(this).val())
  5185. n.push($(this).attr("data-text"))
  5186. })
  5187. parent.val(n.join(","))
  5188. parent.attr("data-id", i.join(","))
  5189. })
  5190. },
  5191. })
  5192. },
  5193. toggleTree = function (e) {
  5194. var parent = $("[appcontent=type_3]", e),
  5195. poffset = parent.offset(),
  5196. ptree = parent.next("[id^=menu_select_tree]").eq(0)
  5197. ptree.css({
  5198. position: "fixed",
  5199. padding: "8px",
  5200. width: parent.width() + "px",
  5201. left: poffset.left + "px",
  5202. top: poffset.top - 1 + parent.outerHeight() + "px",
  5203. "z-index": 999,
  5204. })
  5205. reloadTree(parent, ptree)
  5206. ptree.stop().slideToggle("fast")
  5207. },
  5208. toggleSite = function (e) {
  5209. var parent = $("[name=siteIds]", e),
  5210. poffset = parent.offset(),
  5211. pbox = parent.next(".siteIdSelector").eq(0)
  5212. pbox.css({
  5213. border: "1px solid #ccc",
  5214. background: "#fff",
  5215. //position: "fixed",
  5216. padding: "8px",
  5217. width: parent.width() + "px",
  5218. left: poffset.left + "px",
  5219. top: poffset.top - 1 + parent.outerHeight() + "px",
  5220. "z-index": 999,
  5221. })
  5222. reloadSite(parent, pbox)
  5223. pbox.stop().slideToggle("fast")
  5224. },
  5225. toggleRole = function (e) {
  5226. var parent = $("[name=roleIds]", e),
  5227. poffset = parent.offset(),
  5228. pbox = parent.next(".roleSelector").eq(0)
  5229. pbox.css({
  5230. border: "1px solid #ccc",
  5231. background: "#fff",
  5232. //position: "fixed",
  5233. padding: "8px",
  5234. width: parent.width() + "px",
  5235. left: poffset.left + "px",
  5236. top: poffset.top - 1 + parent.outerHeight() + "px",
  5237. "z-index": 999,
  5238. })
  5239. reloadRole(parent, pbox)
  5240. pbox.stop().slideToggle("fast")
  5241. },
  5242. getAppData = function (e) {
  5243. var a = {}
  5244. return (
  5245. e.find("input[type=text],textarea").each(function () {
  5246. var e = $(this).attr("name")
  5247. if (e == "siteIds" || e == "roleIds") {
  5248. return
  5249. }
  5250. a[e] = $(this).val()
  5251. }),
  5252. e.find("input[type=checkbox]").each(function () {
  5253. var e = $(this).attr("name")
  5254. a[e] = "checked" == $(this).attr("checked") ? 1 : 0
  5255. }),
  5256. e.find("input[type=radio]").each(function () {
  5257. var e = $(this).attr("name")
  5258. if ("checked" == $(this).attr("checked")) {
  5259. a[e] = $(this).val()
  5260. return false
  5261. }
  5262. }),
  5263. (a.content = a.type == 3 ? e.find("[appcontent=type_3]").attr("data") : e.find("[appcontent=type_" + a.type + "]").val()),
  5264. (a.categoryId = e.find("[name=categoryId]").val()),
  5265. (a.siteIds = e.find("[name=siteIds]").attr("data-id")),
  5266. (a.roleIds = e.find("[name=roleIds]").attr("data-id")),
  5267. (a.icon = e.find("[name=icon]").val()),
  5268. a.icon == "" ? "oexe.png" : a.icon,
  5269. a
  5270. )
  5271. },
  5272. bindEvent = function (e) {
  5273. e
  5274. .find("[appcontent=type_3]")
  5275. .live("click", function () {
  5276. toggleTree(e)
  5277. })
  5278. .live("keypress", function () {
  5279. return false
  5280. }),
  5281. e
  5282. .find("[name=siteIds]")
  5283. .live("click", function () {
  5284. toggleSite(e)
  5285. })
  5286. .live("keypress", function () {
  5287. return false
  5288. }),
  5289. e
  5290. .find("[name=roleIds]")
  5291. .live("click", function () {
  5292. toggleRole(e)
  5293. })
  5294. .live("keypress", function () {
  5295. return false
  5296. })
  5297. e.find(".type input").change(function () {
  5298. var a = $(this).attr("apptype")
  5299. e.find("[data-type]").addClass("hidden"), e.find("[data-type=" + a + "]").removeClass("hidden"), e.find("[appcontent]").addClass("hidden"), e.find("[appcontent=" + a + "]").removeClass("hidden"), e.find("[id^=menu_select_tree_]").hide()
  5300. })
  5301. },
  5302. openAppEdit = function (obj, t, add_or_edit) {
  5303. var box,
  5304. url,
  5305. content,
  5306. title = add_or_edit == "add" ? LNG.app_create : LNG.app_edit,
  5307. boxId = UUID(),
  5308. pageContent,
  5309. staticPath = "" + "/images/"
  5310. ajax({
  5311. url: "app_edit.html",
  5312. async: !1,
  5313. success: function (cc) {
  5314. pageContent = cc
  5315. },
  5316. })
  5317. ajax({
  5318. url: "/web/app/category/getAll.json",
  5319. dataType: "json",
  5320. async: !1,
  5321. success: function (t) {
  5322. var cc = $(pageContent)
  5323. var cate = t.data.rows
  5324. for (var i in cate) {
  5325. if (cate[i].id != undefined) {
  5326. cc.find("#category").append('<option value="' + cate[i].id + '" ' + (obj.categoryId == cate[i].id ? "selected" : "") + ">" + cate[i].title + "</option>")
  5327. }
  5328. }
  5329. cc.find("#category").append('<option value="0" ' + (obj.categoryId == 0 ? "selected" : "") + ">" + LNG.app_category_others + "</option>")
  5330. pageContent = cc.prop("outerHTML")
  5331. },
  5332. })
  5333. var tmpl = template.compile(pageContent),
  5334. content = tmpl({
  5335. LNG: LNG,
  5336. iconPath: staticPath,
  5337. uuid: boxId,
  5338. data: obj,
  5339. })
  5340. $.dialog({
  5341. fixed: !0,
  5342. width: 450,
  5343. id: boxId,
  5344. padding: 15,
  5345. title: title,
  5346. content: content,
  5347. button: [
  5348. {
  5349. name: LNG.preview,
  5350. callback: function () {
  5351. var e = getAppData(box)
  5352. return core.openApp(e), !1
  5353. },
  5354. },
  5355. {
  5356. name: LNG.button_save,
  5357. focus: !0,
  5358. callback: function () {
  5359. var e = getAppData(box)
  5360. if (add_or_edit == "edit") {
  5361. e.id = obj.id
  5362. }
  5363. ajax({
  5364. url: add_or_edit == "add" ? "/web/app/add.json" : "/web/app/modify.json",
  5365. type: "POST",
  5366. dataType: "json",
  5367. data: e,
  5368. beforeSend: function () {
  5369. core.tips.loading()
  5370. },
  5371. error: core.ajaxError,
  5372. success: function (e) {
  5373. core.tips.close(LNG.success)
  5374. if (e.status == 1)
  5375. if ("edit" == add_or_edit || "add" == add_or_edit) {
  5376. FrameCall.top("Openapp_store", "App.reload", '""')
  5377. } else "function" == typeof t ? t() : ui.f5()
  5378. },
  5379. })
  5380. },
  5381. },
  5382. ],
  5383. })
  5384. ;(box = $("." + boxId)),
  5385. box.find("[appcontent]").addClass("hidden"),
  5386. box.find("[appcontent=type_" + $(box.find("input[name=type]:checked")).val() + "]").removeClass("hidden"),
  5387. box.find("input[name=border]").attr("checked", obj.border == 1),
  5388. box.find("input[name=resize]").attr("checked", obj.resize == 1),
  5389. box.find("input[name=reopen]").attr("checked", obj.reopen == 1),
  5390. box.find("input[name=fullable]").attr("checked", obj.fullable == 1),
  5391. box.find("input[name=width]").attr("value", add_or_edit == "add" ? 800 : obj.width),
  5392. box.find("input[name=height]").attr("value", add_or_edit == "add" ? 600 : obj.height),
  5393. box.find("input[name=icon]").attr("value", obj.icon == "" ? "oexe.png" : obj.icon),
  5394. box.find("input[name=type]").each(function () {
  5395. var i = box.find("[appcontent=" + $(this).attr("apptype") + "]")
  5396. if (obj.type == 3 && obj.content) {
  5397. var cdata = eval("(" + obj.content + ")")
  5398. var is = []
  5399. for (var j = 0; j < cdata.length; j++) {
  5400. if (cdata[j] == null || cdata[j] == 0) {
  5401. continue
  5402. }
  5403. is.push(cdata[j])
  5404. }
  5405. i.attr("data-id", is.join(","))
  5406. } else {
  5407. i.val(obj.content)
  5408. }
  5409. })
  5410. var ptree = $("[appcontent=type_3]", box),
  5411. treebox = ptree.next("[id^=menu_select_tree]").eq(0)
  5412. reloadTree(ptree, treebox)
  5413. var psite = $("[name=siteIds]", box),
  5414. sitebox = psite.next(".siteIdSelector").eq(0)
  5415. reloadSite(psite, sitebox)
  5416. var ptype = $("[name=roleIds]", box),
  5417. typebox = ptype.next(".roleSelector").eq(0)
  5418. reloadRole(ptype, typebox)
  5419. bindEvent(box)
  5420. },
  5421. z = function () {
  5422. core.appStore()
  5423. },
  5424. E = function (e) {
  5425. ;(e && 4 > e.length && "http" != e.substring(0, 4)) ||
  5426. ajax({
  5427. url: "index.html?get_url_title&url=" + e,
  5428. dataType: "json",
  5429. beforeSend: function () {
  5430. core.tips.loading()
  5431. },
  5432. success: function (a) {
  5433. var t = a.data
  5434. core.tips.close(a)
  5435. var i = {
  5436. content: "window.open('" + e + "');",
  5437. desc: "",
  5438. group: "others",
  5439. type: "app",
  5440. icon: "internet.png",
  5441. name: t,
  5442. resize: 1,
  5443. simple: 0,
  5444. height: "",
  5445. width: "",
  5446. },
  5447. n = urlEncode2(G.this_path + t)
  5448. ;(e = "index.html?user_app&action=add&path=" + n),
  5449. ajax({
  5450. url: e,
  5451. type: "POST",
  5452. dataType: "json",
  5453. data: "data=" + urlEncode2(json_encode(i)),
  5454. success: function (e) {
  5455. core.tips.close(e), e.code && ui.f5()
  5456. },
  5457. })
  5458. },
  5459. })
  5460. }
  5461. return {
  5462. appEdit: openAppEdit,
  5463. appList: z,
  5464. appAddURL: E,
  5465. setBackground: h,
  5466. createLink: f,
  5467. newFile: s,
  5468. newFolder: o,
  5469. rname: r,
  5470. copy: c,
  5471. remove: l,
  5472. }
  5473. }),
  5474. define("desktop/pathOpen", [], function (e) {
  5475. var a = function (e, a) {
  5476. if (void 0 != e) {
  5477. if ((void 0 == a && (a = core.pathExt(e)), (a = a.toLowerCase()), "folder" == a)) return "explorer" == Config.pageApp ? ui.path.list(e + "/") : core.explorer(e), void 0
  5478. if ("oexe" != a) {
  5479. if (core.authCheck("explorer:fileDownload", LNG.no_permission_download)) {
  5480. if ("swf" == a) {
  5481. var n = core.path2url(e)
  5482. return s(n, core.ico("swf"), core.pathThis(e)), void 0
  5483. }
  5484. if ("pdf" == a) {
  5485. if (Config.isIE) return i(e), void 0
  5486. var c = "pdf" + UUID(),
  5487. n = core.path2url(e),
  5488. d = '<div id="' + c + '" style="height:100%;"> <a href="' + n + '" target="_blank" style="display:block;margin:0 auto;margin-top:80px;font-size:16px;text-align:center;">' + LNG.error + " " + LNG.download + " PDF</a></div>"
  5489. return (
  5490. $.dialog({
  5491. resize: !0,
  5492. fixed: !0,
  5493. ico: core.ico("pdf"),
  5494. title: core.pathThis(e),
  5495. width: 800,
  5496. height: 400,
  5497. padding: 0,
  5498. content: d,
  5499. }),
  5500. new PDFObject({
  5501. url: n,
  5502. }).embed(c),
  5503. void 0
  5504. )
  5505. }
  5506. if ("html" == a || "htm" == a) {
  5507. var n = core.path2url(e)
  5508. return s(n, core.ico("html"), core.pathThis(e)), void 0
  5509. }
  5510. if (inArray(core.filetype.image, a)) {
  5511. var n = urlDecode(e)
  5512. return -1 == e.indexOf("http:") && (n = core.path2url(n)), MaskView.image(n), void 0
  5513. }
  5514. if (inArray(core.filetype.music, a) || inArray(core.filetype.movie, a)) {
  5515. var n = core.path2url(e)
  5516. return l(n, a), void 0
  5517. }
  5518. return inArray(core.filetype.doc, a) ? (r(e), void 0) : inArray(core.filetype.text, a) || inArray(core.filetype.code, a) ? (o(e), void 0) : ("editor" == Config.pageApp ? core.tips.tips(a + LNG.edit_can_not, !1) : t(e, ""), void 0)
  5519. }
  5520. } else if ("string" == typeof e || (e.content && "ui.path.open" == e.content.substr(0, 12) && "app_link" == e.type)) {
  5521. var p = e
  5522. "string" != typeof e && (p = e.content.split("'")[1]),
  5523. core.file_get(p, function (e) {
  5524. var a = json_decode(e)
  5525. ;(a.name = core.pathThis(p)), core.openApp(a)
  5526. })
  5527. } else core.openApp(e)
  5528. }
  5529. },
  5530. t = function (e, a) {
  5531. var t = '<div class="unknow_file" style="width:260px;word-break: break-all;"><span>' + LNG.unknow_file_tips + "<br/>" + a + '</span><br/><a class="btn btn-success btn-sm" href="javascript:ui.path.download(\'' + e + "');\"> " + LNG.unknow_file_download + " </a></div>"
  5532. $.dialog({
  5533. fixed: !0,
  5534. icon: "warning",
  5535. title: LNG.unknow_file_title,
  5536. padding: 30,
  5537. content: t,
  5538. cancel: !0,
  5539. })
  5540. },
  5541. n = function (e) {
  5542. if (core.authCheck("explorer:fileDownload") && void 0 != e) {
  5543. var a = core.path2url(e)
  5544. window.open(a)
  5545. }
  5546. },
  5547. s = function (e, a, t, i) {
  5548. if (e) {
  5549. void 0 == i && (i = "openWindow" + UUID())
  5550. var n = "<iframe frameborder='0' name='Open" + i + "' src='" + e + "' style='width:100%;height:100%;border:0;'></iframe>"
  5551. art.dialog.through({
  5552. id: i,
  5553. title: t,
  5554. ico: a,
  5555. width: "78%",
  5556. height: "70%",
  5557. padding: 0,
  5558. content: n,
  5559. resize: !0,
  5560. })
  5561. }
  5562. },
  5563. r = function (e) {
  5564. var a = document.domain
  5565. if ("" == G.office_server) {
  5566. if (0 == a.search("localhost") || 0 == a.search("192.168.") || 0 == a.search("127.0.0")) return t(e, LNG.unknow_file_office + ', <a href="http://kalcaddle.com/help.html#office" target="_blank">' + LNG.more + ">></a>"), void 0
  5567. G.office_server = "https://view.officeapps.live.com/op/view.aspx?src="
  5568. }
  5569. if (G.share_page !== void 0) {
  5570. var i = G.app_host + "index.html?share/fileProxy&user=" + G.user + "&sid=" + G.sid + "&path=" + urlEncode2(e),
  5571. n = G.office_server + urlEncode(i),
  5572. s = core.pathThis(e)
  5573. art.dialog.open(n, {
  5574. ico: core.ico("doc"),
  5575. title: s,
  5576. width: "80%",
  5577. height: "70%",
  5578. resize: !0,
  5579. })
  5580. } else
  5581. $.get("index.html?explorer/makeFileProxy&path=" + urlEncode(e), function (a) {
  5582. if (0 == a.code) return core.tips.tips(a), void 0
  5583. var t = G.app_host + "index.html?user/public_link&fid=" + a.data,
  5584. i = G.office_server + urlEncode(t),
  5585. n = core.pathThis(e)
  5586. art.dialog.open(i, {
  5587. ico: core.ico("doc"),
  5588. title: n,
  5589. width: "80%",
  5590. height: "70%",
  5591. resize: !0,
  5592. })
  5593. })
  5594. }
  5595. return {
  5596. open: a,
  5597. openIE: n,
  5598. }
  5599. })