| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635 |
- define(
- "/js/desktop.util",
- [
- "js/common.tools",
- "js/util",
- "js/lib/ztree/js/ztree",
- "js/lib/contextMenu/jquery-contextMenu",
- "js/lib/artDialog/jquery-artDialog",
- "js/lib/picasa/picasa" /*,
- "desktop/taskTap",
- "desktop/core,
- "tpl/copyright.html",
- "desktop/rightMenu",
- "desktop/fileSelect",
- "desktop/ui",
- "desktop/path",
- "desktop/pathOperate",
- "desktop/pathOpen"*/,
- ],
- function (e) {
- ;(template = Handlebars),
- (Config = {
- BodyContent: ".bodymain",
- FileBoxSelector: ".fileContiner",
- FileBoxClass: ".fileContiner .file",
- FileBoxClassName: "file",
- FileBoxTittleClass: ".fileContiner .title",
- SelectClass: ".fileContiner .select",
- SelectClassName: "select",
- TypeFolderClass: "folderBox",
- TypeFileClass: "fileBox",
- HoverClassName: "hover",
- FileOrderAttr: "number",
- pageApp: "desktop",
- navbar: "navbar",
- AnimateTime: 200,
- }),
- (Global = {
- fileListAll: "",
- fileListNum: 0,
- fileRowNum: 0,
- frameLeftWidth: 200,
- treeSpaceWide: 10,
- topbar_height: 40,
- ctrlKey: !1,
- shiftKey: !1,
- fileListSelect: "",
- fileListSelectNum: "",
- isIE: !-[1],
- isDragSelect: !1,
- historyStatus: {
- back: 1,
- next: 0,
- },
- }),
- (TaskTap = e("desktop/taskTap")),
- (core = e("desktop/core")),
- (rightMenu = e("desktop/rightMenu")),
- (fileSelect = e("desktop/fileSelect")),
- (ui = e("desktop/ui")),
- (ui.path = e("desktop/path")),
- (fileLight = fileSelect.fileLight),
- $(document).ready(function () {
- $("title").text("桌面 - " + (AUTH.site ? AUTH.site.name : "") + "")
- $("#favicon").attr("href", "/images/" + (AUTH.site ? AUTH.site.domain : "") + ".favicon.ico?t=" + new Date().getTime())
- ;(function () {
- $(function () {
- function getNow() {
- var now = new Date()
- return {
- hours: now.getHours() + now.getMinutes() / 60,
- minutes: (now.getMinutes() * 12) / 60 + (now.getSeconds() * 12) / 3600,
- seconds: (now.getSeconds() * 12) / 60,
- time: now,
- }
- }
- function pad(number, length) {
- // Create an array of the remaining length +1 and join it with 0's
- return new Array((length || 2) + 1 - String(number).length).join(0) + number
- }
- var now = getNow()
- // Create the chart
- $("#rightwin .oclock").highcharts(
- {
- chart: {
- type: "gauge",
- plotBackgroundColor: null,
- plotBackgroundImage: null,
- backgroundColor: "rgba(0,0,0,0)",
- plotBorderWidth: 0,
- plotShadow: false,
- height: 200,
- },
- credits: {
- enabled: false,
- },
- title: {
- text: "",
- },
- pane: {
- background: [
- {
- // default background
- },
- {
- backgroundColor: Highcharts.svg
- ? {
- radialGradient: {
- cx: 0.5,
- cy: -0.4,
- r: 1.9,
- },
- stops: [
- [0.5, "rgba(255, 255, 255, 0.2)"],
- [0.5, "rgba(200, 200, 200, 0.2)"],
- ],
- }
- : null,
- },
- ],
- },
- yAxis: {
- labels: {
- distance: -20,
- },
- min: 0,
- max: 12,
- lineWidth: 0,
- showFirstLabel: false,
- minorTickInterval: "auto",
- minorTickWidth: 1,
- minorTickLength: 5,
- minorTickPosition: "inside",
- minorGridLineWidth: 0,
- minorTickColor: "#666",
- tickInterval: 1,
- tickWidth: 2,
- tickPosition: "inside",
- tickLength: 10,
- tickColor: "#666",
- title: {
- text: "",
- style: {
- color: "#BBB",
- fontWeight: "normal",
- fontSize: "8px",
- lineHeight: "10px",
- },
- y: 10,
- },
- },
- tooltip: {
- enabled: false,
- },
- series: [
- {
- data: [
- {
- id: "hour",
- y: now.hours,
- dial: {
- radius: "60%",
- baseWidth: 4,
- baseLength: "95%",
- rearLength: 0,
- },
- },
- {
- id: "minute",
- y: now.minutes,
- dial: {
- baseLength: "95%",
- rearLength: 0,
- },
- },
- {
- id: "second",
- y: now.seconds,
- dial: {
- radius: "100%",
- baseWidth: 1,
- rearLength: "20%",
- },
- },
- ],
- animation: false,
- dataLabels: {
- enabled: false,
- },
- },
- ],
- },
- // Move
- function (chart) {
- setInterval(function () {
- var hour = chart.get("hour"),
- minute = chart.get("minute"),
- second = chart.get("second"),
- now = getNow(),
- // run animation unless we're wrapping around from 59 to 0
- animation =
- now.seconds == 0
- ? false
- : {
- easing: "easeOutElastic",
- }
- // Cache the tooltip text
- chart.tooltipText = pad(Math.floor(now.hours), 2) + ":" + pad(Math.floor(now.minutes * 5), 2) + ":" + pad(now.seconds * 5, 2)
- hour.update(now.hours, true, animation)
- minute.update(now.minutes, true, animation)
- second.update(now.seconds, true, animation)
- $("#rightwin .systime .time").html(now.time.format("HH:mm:ss"))
- $("#rightwin .systime .day").html(now.time.format("yyyy年MM月dd日,星期E"))
- $("#rightwin .systime .time").html(now.time.format("HH:mm:ss"))
- $(".taskbar_right .datebox").html(now.time.format("HH:mm yyyy/MM/dd"))
- }, 1000)
- }
- )
- })
- // Extend jQuery with some easing (copied from jQuery UI)
- $.extend($.easing, {
- easeOutElastic: function (x, t, b, c, d) {
- var s = 1.70158
- var p = 0
- var a = c
- if (t == 0) return b
- if ((t /= d) == 1) return b + c
- if (!p) p = d * 0.3
- if (a < Math.abs(c)) {
- a = c
- var s = p / 4
- } else var s = (p / (2 * Math.PI)) * Math.asin(c / a)
- return a * Math.pow(2, -10 * t) * Math.sin(((t * d - s) * (2 * Math.PI)) / p) + c + b
- },
- })
- })(),
- ui.init(),
- TaskTap.init(),
- core.update(),
- fileSelect.init(),
- rightMenu.initDesktop(),
- e.async("js/lib/webuploader/webuploader-min", function () {
- core.upload_init()
- }),
- $(".bodymain").click(function () {
- $("#menuwin").hide(), $("#menuwin .search input").val(""), $("#rightwin").hide()
- }),
- $(".start").click(function () {
- "block" == $("#menuwin").css("display") ? $("#menuwin").css("display", "none") : $("#menuwin").css("display", "block")
- }),
- $("#menuwin li[class!=search]").click(function () {
- $("#menuwin").css("display", "none")
- }),
- $(".taskbar_right .datebox").click(function () {
- "block" == $("#rightwin").css("display") ? $("#rightwin").css("display", "none") : $("#rightwin").css("display", "block")
- }),
- $("#toFullscreenBtn").click(function () {
- ui.toFullScreen()
- })
- ;(function () {
- if (!AUTH.company) {
- return
- }
- if (AUTH.company.orgType != 1) {
- $(".copyright").hide()
- } else {
- $(".copyright").click(function () {
- core.copyright()
- })
- }
- })(),
- $(".tab_hide_all").click(function () {
- if (0 != art.dialog.list.length) {
- $(this).toggleClass("this")
- var e = !$(this).hasClass("this")
- $.each(art.dialog.list, function (a, t) {
- t.display(e)
- })
- }
- }),
- $("#menuwin .logout-btn").click(function () {
- $.dialog({
- id: "dialog_path_logout",
- fixed: !0,
- icon: "question",
- title: "退出登录",
- width: 300,
- padding: 40,
- lock: !0,
- background: "#000",
- opacity: 0.3,
- content: "您确定要退出登录吗?",
- ok: function () {
- ui.logout()
- },
- cancel: !0,
- })
- }),
- (function () {
- //只有企业才提示
- if (AUTH.company.orgType != 1) {
- return
- }
- var playerObj,
- isInit = false
- var play = function () {
- if (isInit == false) {
- $(".taskbar_right .volume .sound").jmp3()
- playerObj = $(".taskbar_right .volume .sound").jmp3({
- backcolor: "000000",
- forecolor: "00ff00",
- width: 0,
- autoplay: "true",
- repeat: "true",
- filepath: "/images/soundplayer/ring.mp3",
- playerpath: "/images/soundplayer/mp3player.swf",
- showdownload: "false",
- })
- isInit = true
- }
- }
- //停止
- var stop = function () {
- if (playerObj != null) {
- playerObj = null
- delete playerObj
- }
- var obj = document.getElementById("mymp3")
- if (obj != null) {
- obj = null
- delete obj
- }
- $(".taskbar_right .volume .sound").empty()
- isInit = false
- }
- var reload = function () {
- var host = "http://" + eval("(" + AUTH.site.config + ")").platform["01200007"] + "." + AUTH.site.domain
- ajax({
- url: host + "/web/sys/altips/getCount.json",
- dataType: "jsonp",
- success: function (r) {
- var box = art.dialog.list["sys_altips"]
- if (box) {
- box.refresh()
- }
- stop()
- if (r.data <= 0) {
- return
- }
- $(".taskbar_right .alertbox .badge").html(r.data)
- $(".taskbar_right .alertbox")
- .attr("title", "您有" + r.data + "条告警信息")
- .show()
- $(".taskbar_right .volume")
- .show()
- .toggle(
- function () {
- $(".volume-on", $(this)).hide()
- $(".volume-off", $(this)).show()
- stop()
- },
- function () {
- $(".volume-on", $(this)).show()
- $(".volume-off", $(this)).hide()
- play()
- }
- )
- if ($(".volume-on").is(":visible")) {
- play()
- }
- $(".taskbar_right .alertbox").click(function () {
- core.openIE(host + "/sys/altips.html?auth_cid=" + cid, {
- id: "sys_altips",
- title: "告警信息",
- width: 1000,
- height: 600,
- })
- })
- if (window.ringBadgeTimer == undefined) {
- window.ringBadgeTimer = setInterval(function () {
- $(".taskbar_right .alertbox .badge").stop().fadeOut(100).fadeIn(200)
- }, 800)
- }
- },
- })
- }
- reload()
- setInterval(reload, 1000 * 60 * 5)
- })(),
- (function () {
- //只有企业才加载设备监测插件
- if (AUTH.company.orgType != 1) {
- return
- }
- core.plugin({
- id: "monitor_state",
- url: "/plugin/monitor_state/preview.html?auth_cid=" + cid,
- title: "监测点状态",
- width: 160,
- height: 135,
- })
- })()
- //加载天气插件
- ;(function () {
- var topLine = 170
- if (AUTH.company.orgType != 1) {
- topLine = 0
- }
- core.plugin({
- id: "weather",
- url: "/plugin/weather/index.html?auth_cid=" + cid,
- title: "天气",
- width: 133,
- height: 195,
- top: topLine,
- right: 37,
- })
- })()
- ;(function () {
- //只有企业才提示用电概况
- if (AUTH.company.orgType != 1) {
- return
- }
- 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 })
- })()
- ;(function () {
- //只有gov才提示用电概况
- // if (AUTH.company.id == 9370 || AUTH.company.id == 9370) {
- // //原尺寸
- // 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
- // //全屏
- // //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);
- // }
- return
- })()
- })
- }
- ),
- define("desktop/taskTap", [], function () {
- var e = {},
- a = "",
- t = 160,
- i = function () {
- $(".task_tab .tab")
- .die("mouseenter")
- .live("mouseenter", function (e) {
- $(this).hasClass("this") || $(this).addClass("hover"), stopPP(e)
- })
- .die("click")
- .live("click", function (e) {
- var a = $(this).attr("id"),
- t = art.dialog.list[a],
- i = $("." + a)
- "hidden" == i.css("visibility") ? t.display(!0) : i.hasClass("aui_state_focus") ? t.display(!1) : t.zIndex(), stopPP(e)
- })
- .die("mouseleave")
- .live("mouseleave", function () {
- $(this).removeClass("hover")
- })
- .die("dblclick")
- .live("dblclick", function () {})
- },
- n = function () {
- var e,
- a,
- i,
- n,
- s = !1,
- o = !1,
- r = 0,
- l = 0,
- c = 0,
- d = 0,
- p = 0,
- u = 0
- $(".task_tab .tab")
- .die("mousedown")
- .live("mousedown", function (a) {
- return (
- (e = $(this)),
- (o = !0),
- this.setCapture && this.setCapture(),
- $(document).mousemove(function (e) {
- f(e)
- }),
- $(document).one("mouseup", function (e) {
- return v(e), this.releaseCapture && this.releaseCapture(), stopPP(e), !1
- }),
- stopPP(a),
- !1
- )
- })
- var h = function (t) {
- ;(s = !0),
- (r = t.pageX),
- ($tab_parent = $(".task_tab")),
- (a = $(".task_tab .tab")),
- $(".tasktab-dragging").remove(),
- (i = e.clone().addClass("tasktab-dragging").prependTo("body")),
- (d = $sizeInt(a.css("margin-right"))),
- (p = $tab_parent.width()),
- (u = $tab_parent.get(0).getBoundingClientRect().left),
- (u += $(window).scrollLeft()),
- (l = e.get(0).getBoundingClientRect().left),
- (c = $sizeInt(a.css("width")))
- var n = e.get(0).getBoundingClientRect().top - $sizeInt(e.css("margin-top")),
- o = t.clientX - r + l
- $("body").prepend("<div class='dragMaskView'></div>"),
- i.css({
- width: c + "px",
- top: n,
- left: o,
- }),
- e.css("opacity", 0)
- },
- f = function (t) {
- if (o) {
- window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty(), 0 == s && h(t)
- var n = t.clientX - r + l
- u > n ||
- n > u + p - c ||
- (i.css("left", n),
- a.each(function () {
- var a = $(this).get(0).getBoundingClientRect().left
- if (n > a && a + c / 2 + d > n) {
- if (e.attr("id") == $(this).attr("id")) return
- m($(this).attr("id"), "left")
- }
- if (n > a - c / 2 + d && a > n) {
- if (e.attr("id") == $(this).attr("id")) return
- m($(this).attr("id"), "right")
- }
- }))
- }
- },
- m = function (i, s) {
- if (!e.is(":animated") || n != i) {
- ;(n = i), e.stop(!0, !0), $(".insertTemp").remove(), (a = $(".task_tab .tab"))
- var o = e.width(),
- r = $(".task_tab #" + i),
- l = e
- .clone(!0)
- .insertAfter(e)
- .css({
- "margin-right": "0px",
- border: "none",
- })
- .addClass("insertTemp")
- "left" == s ? e.after(r).css("width", "0px") : (e.before(r).css("width", "0px"), r.before(l)),
- e.animate(
- {
- width: o + "px",
- },
- t
- ),
- l.animate(
- {
- width: "0px",
- },
- t,
- function () {
- $(this).remove(), (a = $(".task_tab .tab"))
- }
- )
- }
- },
- v = function () {
- ;(o = !1),
- (s = !1),
- (startTime = 0),
- $(".dragMaskView").remove(),
- void 0 != i &&
- ((l = e.get(0).getBoundingClientRect().left),
- i.animate(
- {
- left: l + "px",
- },
- t,
- function () {
- e.css("opacity", 1), $(this).remove()
- }
- ))
- }
- },
- s = function (e) {
- var a = 110,
- i = a,
- n = a + 12,
- s = $(".task_tab .tab"),
- o = $(".task_tab .tabs").width() - 10,
- r = s.length,
- l = Math.floor(o / n)
- switch ((r > l && (i = Math.floor(o / r) - 12), e)) {
- case "add":
- $(".task_tab .tabs .this")
- .css("width", "0")
- .animate(
- {
- width: i + "px",
- },
- t
- )
- case "close":
- s.animate(
- {
- width: i + "px",
- },
- t
- )
- break
- case "resize":
- s.css("width", i + "px")
- break
- default:
- }
- },
- addToTaskBar = function (id, icon) {
- //如果是插件,任务栏不添加
- if (id.match("^plugin")) {
- return
- }
- $(".task_tab").removeClass("hidden")
- var i = icon.replace(/<[^>]+>/g, ""),
- n = '<div class="tab taskBarMenu" id="' + id + '" title="' + i + '">' + icon + "</div>"
- $(n).insertBefore(".task_tab .last"),
- s("add"),
- (e[id] = {
- id: id,
- name: name,
- })
- },
- r = function (e) {
- $(".task_tab .this").removeClass("this"), $(".task_tab #" + e).addClass("this"), (a = e)
- },
- l = function (a) {
- delete e[a],
- $(".task_tab #" + a).animate(
- {
- width: 0,
- },
- t,
- function () {
- $(".task_tab #" + a).remove(), s("close"), 0 == $(".tabs .tab").length && "desktop" != Config.pageApp && $(".task_tab").addClass("hidden")
- }
- )
- }
- return {
- add: addToTaskBar,
- focus: r,
- close: l,
- init: function () {
- var e = '<div class="task_tab"><div class="tabs"><div class="last" style="clear:both;"></div></div></div>'
- $(e).appendTo("body"),
- "desktop" != Config.pageApp && $(".task_tab").addClass("hidden"),
- $(window).bind("resize", function () {
- s("resize")
- }),
- i(),
- n()
- },
- }
- }),
- define("desktop/core", [], function (require, exports) {
- return {
- filetype: {
- image: ["jpg", "jpeg", "png", "bmp", "gif", "ico"],
- music: ["mp3", "wma", "wav", "mid", "m4a", "aac", "midi"],
- movie: ["avi", "flv", "f4v", "wmv", "3gp", "mp4", "wmv", "asf", "m4v", "mov", "mpg"],
- doc: ["doc", "docx", "docm", "xls", "xlsx", "xlsb", "xlsm", "ppt", "pptx", "pptm"],
- text: ["oexe", "inc", "inf", "csv", "log", "asc", "tsv"],
- code: [
- "abap",
- "abc",
- "as",
- "ada",
- "adb",
- "htgroups",
- "htpasswd",
- "conf",
- "htaccess",
- "htgroups",
- "htpasswd",
- "asciidoc",
- "asm",
- "ahk",
- "bat",
- "cmd",
- "c9search_results",
- "cpp",
- "c",
- "cc",
- "cxx",
- "h",
- "hh",
- "hpp",
- "cirru",
- "cr",
- "clj",
- "cljs",
- "CBL",
- "COB",
- "coffee",
- "cf",
- "cson",
- "Cakefile",
- "cfm",
- "cs",
- "css",
- "curly",
- "d",
- "di",
- "dart",
- "diff",
- "patch",
- "Dockerfile",
- "dot",
- "dummy",
- "dummy",
- "e",
- "ejs",
- "ex",
- "exs",
- "elm",
- "erl",
- "hrl",
- "frt",
- "fs",
- "ldr",
- "ftl",
- "gcode",
- "feature",
- ".gitignore",
- "glsl",
- "frag",
- "vert",
- "go",
- "groovy",
- "haml",
- "hbs",
- "handlebars",
- "tpl",
- "mustache",
- "hs",
- "hx",
- "html",
- "htm",
- "xhtml",
- "erb",
- "rhtml",
- "ini",
- "cfg",
- "prefs",
- "io",
- "jack",
- "jade",
- "java",
- "js",
- "jsm",
- "json",
- "jq",
- "jsp",
- "jsx",
- "jl",
- "tex",
- "latex",
- "ltx",
- "bib",
- "lean",
- "hlean",
- "less",
- "liquid",
- "lisp",
- "ls",
- "logic",
- "lql",
- "lsl",
- "lua",
- "lp",
- "lucene",
- "Makefile",
- "GNUmakefile",
- "makefile",
- "OCamlMakefile",
- "make",
- "md",
- "markdown",
- "mask",
- "matlab",
- "mel",
- "mc",
- "mush",
- "mysql",
- "nix",
- "m",
- "mm",
- "ml",
- "mli",
- "pas",
- "p",
- "pl",
- "pm",
- "pgsql",
- "php",
- "phtml",
- "ps1",
- "praat",
- "praatscript",
- "psc",
- "proc",
- "plg",
- "prolog",
- "properties",
- "proto",
- "py",
- "r",
- "Rd",
- "Rhtml",
- "rb",
- "ru",
- "gemspec",
- "rake",
- "Guardfile",
- "Rakefile",
- "Gemfile",
- "rs",
- "sass",
- "scad",
- "scala",
- "scm",
- "rkt",
- "scss",
- "sh",
- "bash",
- ".bashrc",
- "sjs",
- "smarty",
- "tpl",
- "snippets",
- "soy",
- "space",
- "sql",
- "styl",
- "stylus",
- "svg",
- "tcl",
- "tex",
- "txt",
- "textile",
- "toml",
- "twig",
- "ts",
- "typescript",
- "str",
- "vala",
- "vbs",
- "vb",
- "vm",
- "v",
- "vh",
- "sv",
- "svh",
- "vhd",
- "vhdl",
- "xml",
- "rdf",
- "rss",
- "wsdl",
- "xslt",
- "atom",
- "mathml",
- "mml",
- "xul",
- "xbl",
- "xaml",
- "xq",
- "yaml",
- "yml",
- "htm",
- "xib",
- "storyboard",
- "plist",
- "csproj",
- ],
- 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"],
- },
- ico: function (e) {
- var a = "/" + "images/file_16/",
- t = ["folder", "file", "edit", "search", "up", "setting", "appStore", "error", "info", "mp3", "flv", "pdf", "doc", "xls", "ppt", "html", "swf"],
- i = $.inArray(e, t)
- return -1 == i ? a + "file.png" : a + e + ".png"
- },
- contextmenu: function (e) {
- try {
- rightMenu.hidden()
- } catch (a) {}
- var a = e || window.event
- 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
- },
- pathThis: function (e) {
- e = e.replace(/\\/g, "/")
- var a = e.split("/"),
- t = a[a.length - 1]
- if (("" == t && (t = a[a.length - 2]), 0 == t.search("fileProxy"))) {
- t = urlDecode(t.substr(t.search("&path=")))
- var a = t.split("/")
- ;(t = a[a.length - 1]), "" == t && (t = a[a.length - 2])
- }
- return t
- },
- pathFather: function (e) {
- e = e.replace(/\\/g, "/")
- var a = e.lastIndexOf("/")
- return e.substr(0, a + 1)
- },
- pathExt: function (e) {
- ;(e = e.replace(/\\/g, "/")), (e = e.replace(/\/+/g, "/"))
- var a = e.lastIndexOf(".")
- return (e = e.substr(a + 1)), e.toLowerCase()
- },
- path2url: function (e) {
- if ("http" == e.substr(0, 4)) return e
- 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, "")
- var a = G.app_host + "/index.html?explorer/fileProxy&path=" + urlEncode(e)
- return G.share_page !== void 0 && (a = G.app_host + "/index.html?share/fileProxy&user=" + G.user + "&sid=" + G.sid + "&path=" + urlEncode(e)), a
- },
- authCheck: function (e, a) {
- 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
- },
- ajaxError: function (e) {
- core.tips.close(LNG.system_error, !1)
- var a = e.responseText,
- t = '<div class="ajaxError">' + a + "</div>",
- i = $.dialog.list.ajaxErrorDialog
- return "<!--user login-->" == a.substr(0, 17)
- ? (FrameCall.goRefresh(), void 0)
- : (i
- ? i.content(t)
- : $.dialog({
- id: "ajaxErrorDialog",
- padding: 0,
- fixed: !0,
- resize: !0,
- ico: core.ico("error"),
- title: "ajax error",
- content: t,
- }),
- void 0)
- },
- file_get: function (e, a) {
- var t = "index.html?editor/fileGet&filename=" + urlEncode2(e)
- G.share_page !== void 0 && (t = "index.html?share/fileGet&user=" + G.user + "&sid=" + G.sid + "&filename=" + urlEncode2(e)),
- ajax({
- url: t,
- dataType: "json",
- beforeSend: function () {
- core.tips.loading(LNG.loading)
- },
- error: core.ajaxError,
- success: function (e) {
- core.tips.close(LNG.success), "function" == typeof a && a(e.data.content)
- },
- })
- },
- setting: function (e) {
- void 0 == e && (e = G.is_root ? "system" : "user"),
- void 0 == window.top.frames.Opensetting_mode
- ? $.dialog.open("/setting.html?" + e, {
- id: "setting_mode",
- fixed: !0,
- ico: core.ico("setting"),
- resize: !0,
- title: LNG.setting,
- width: 1000,
- height: 560,
- })
- : ($.dialog.list.setting_mode.display(!0), FrameCall.top("Opensetting_mode", "Setting.setGoto", '"' + e + '"'))
- },
- plugin: function (config) {
- var id = "plugin_" + config.id
- $.dialog.open(config.url, {
- id: id,
- bottom: 0,
- simple: true,
- resize: false,
- title: config.title,
- width: config.width,
- height: config.height,
- left: "",
- top: "",
- padding: "0",
- fixed: true,
- })
- if (!config.top) {
- config.top = 20
- }
- if (!config.right) {
- config.right = 20
- }
- $("#" + id)
- .parents(".dialog-simple")
- .removeClass(id)
- .addClass("plugin_dialog")
- .css({
- width: config.width,
- height: config.height,
- overflow: "hidden",
- left: "",
- top: config.top,
- right: config.right,
- })
- $("#" + id)
- .find(".aui_title")
- .css({ height: "70px" })
- $("#" + id + " .aui_close").hide()
- },
- copyright: function () {
- var e = require("tpl/copyright.html"),
- a = template.compile(e),
- t = a({
- LNG: LNG,
- G: G,
- AUTH: AUTH,
- })
- $.dialog({
- id: "copyright_dialog",
- bottom: 0,
- right: 0,
- simple: !0,
- resize: !1,
- title: LNG.about + " ",
- width: 425,
- padding: "0",
- fixed: !0,
- content: t,
- })
- var show = function (data) {
- var contacts = ""
- if (data.powerContact.length > 0) {
- var arr = eval("(" + data.powerContact + ")")
- if (arr.length > 0) {
- contacts += '<table width="100%">'
- 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>'
- for (var i = 0; i < arr.length; i++) {
- contacts +=
- '<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>"
- }
- contacts += "</table>"
- }
- }
- var html = '<span style="font-weight: bold; font-size: 18px;">企业基本信息:</span><br/>'
- html += '<table width="600px">'
- html += '<tr><td colspan="2"><span>名称:' + data.powerName + "</span></td>"
- html += "<td><span>编号:" + (data.powerOrgId == undefined ? AUTH.company.id : data.powerOrgId) + "</span></td></tr>"
- html += '<tr><td colspan="3"><span>地址:' + data.powerAddress + "</span></td></tr>"
- html += '<tr><td width="33%"><span>企业类型:' + data.powerType + "</span></td>"
- html += '<td width="33%"><span>级别:' + data.powerRank + "</span></td>"
- html += '<td width="33%"><span>运行状态:' + data.powerState + "</span></td></tr>"
- html += "<tr><td><span>供电电源:" + data.powerPowerSupply + "</span></td>"
- html += "<td><span>电压等级:" + data.powerVoltageClass + "</span></td>"
- html += "<td><span>基本电价:¥" + data.powerJbdj + "元</span></td></tr>"
- html += "<tr><td><span>是否启用自定义电价:" + data.powerIsFgp + "</span></td>"
- html += '<td colspan="2"><span>服务到期时间:' + data.powerExpiredDate + "</span></td></tr>"
- html += '<tr><td colspan="3"><span>联系人列表:' + (contacts == "" ? "未设置" : "") + "</span></td></tr>"
- if (contacts != "") {
- html += '<tr><td colspan="3">' + contacts + "</td></tr>"
- }
- html += "</table>"
- html += "<br/>"
- html += '<span style="font-weight: bold; font-size: 18px;">承建单位信息:</span><br/>'
- html += '<table width="600px">'
- html += '<tr><td colspan="3"><span>名称:' + data.proxyName + "</span></td></tr>"
- html += '<tr><td colspan="3"><span>地址:' + data.proxyAddress + "</span></td></tr>"
- html += '<tr><td width="33%"><span>单位类型:' + data.proxyTg + "</span></td>"
- html += '<td width="33%"><span>负责人:' + (data.proxyPrincipal ? data.proxyPrincipal : "未设置") + "</span></td>"
- html += "<td><span>联系电话:" + (data.proxyTel ? data.proxyTel : "未设置") + "</span></td></tr>"
- html += "</table>"
- $(".copyright_dialog_content .content").html('<div style="text-align:left;">' + html + "</div>")
- }
- if (G.copyright) {
- show(G.copyright)
- return
- }
- ajax({
- url: "web/desktop/getCompanyInfo.json",
- success: function (d) {
- G.copyright = d.data
- show(G.copyright)
- },
- })
- },
- appStore: function () {
- $.dialog.open("/app_store.html?auth_cid=" + $.query.get("auth_cid"), {
- id: "app_store",
- fixed: !0,
- ico: "/images/app/appstore.png",
- resize: !0,
- title: LNG.app_store,
- width: 1000,
- height: 560,
- })
- },
- openIE: function (e, opt) {
- $.dialog.open(
- e,
- opt
- ? opt
- : {
- fixed: !0,
- resize: !0,
- title: LNG.app_store,
- width: "80%",
- height: "70%",
- }
- )
- },
- openApp: function (app) {
- if (1 == app.type || 3 == app.type) {
- if (!G.is_root && AUTH.options[app.id] == undefined) {
- core.tips.tips("您无权限打开此应用", "info")
- return
- }
- var icon = app.icon
- ;-1 == app.icon.search(G.static_path) && "http" != app.icon.substring(0, 4) && (icon = "/" + "images/app/" + app.icon),
- "number" != typeof app.width && -1 == app.width.search("%") && (app.width = parseInt(app.width)),
- "number" != typeof app.height && -1 == app.height.search("%") && (app.height = parseInt(app.height)),
- (s =
- 1 == app.type
- ? app.content
- : eval("(" + app.content + ")")
- .join(",")
- .replace(/,$/gi, "")),
- (cid = $.query.get("auth_cid"))
- $.dialog.open((1 == app.type ? "/app_3part.html" : "/app_menu.html") + "?auth_cid=" + cid + "&id=" + app.id + "&content=" + s, {
- id: app.reopen == 1 ? "appwin_" + app.id : "",
- title: app.name,
- fixed: !0,
- ico: icon,
- resize: app.resize,
- simple: app.border,
- title: app.title.replace(".oexe", ""),
- width: app.width,
- height: app.height,
- })
- } else {
- var exec = app.content
- eval("{" + exec + "}")
- }
- },
- update: function (e) {
- var a = base64_decode("L2pzL21haW4uanM=") + "?a=" + UUID()
- require.async(a, function (a) {
- try {
- a.todo(e)
- } catch (t) {}
- })
- },
- explorer: function (e, a) {
- void 0 == e && (e = ""), void 0 == a && (a = core.pathThis(e))
- var t = "explorer/index.html?type=iframe&path=" + e
- G.share_page !== void 0 && (t = "share/index.html?type=iframe&user=" + G.user + "&sid=" + G.sid + "&path=" + e),
- $.dialog.open(t, {
- resize: !0,
- fixed: !0,
- ico: core.ico("folder"),
- title: a,
- width: 880,
- height: 550,
- })
- },
- explorerCode: function (e) {
- void 0 == e && (e = "")
- var a = "editor/index.html?project=" + e
- G.share_page !== void 0 && (a = "share/index.html?code_read&user=" + G.user + "&sid=" + G.sid + "&project=" + e),
- $.dialog.open(a, {
- resize: !0,
- fixed: !0,
- ico: core.ico("folder"),
- title: core.pathThis(e),
- width: "80%",
- height: "70%",
- })
- },
- setSkin_finished: function () {
- var e = $(".setSkin_finished").attr("src")
- e && ($("#link_css_list").attr("href", e), $(".setSkin_finished").remove())
- },
- setSkin: function (e, a) {
- var t = "/" + "css/skin/" + e + a
- $("body").append('<img src="' + t + '" onload="core.setSkin_finished();" onerror="core.setSkin_finished();" class="setSkin_finished">')
- },
- editorFull: function () {
- var e = $("iframe[name=OpenopenEditor]")
- e.toggleClass("frame_fullscreen")
- },
- language: function (e) {
- Cookie.set("sys_user_language", e, 8760), window.location.reload()
- },
- tips: {
- topHeight: function () {
- return "undefined" != typeof Global && Global.topbar_height ? Global.topbar_height : 0
- },
- loading: function (e) {
- Tips.loading(e, "info", core.tips.topHeight())
- },
- close: function (e, a) {
- "object" == typeof e ? Tips.close(e.data, e.code, core.tips.topHeight()) : Tips.close(e, a, core.tips.topHeight())
- },
- tips: function (e, a) {
- "object" == typeof e ? Tips.tips(e.data, e.code, core.tips.topHeight()) : Tips.tips(e, a, core.tips.topHeight())
- },
- },
- fullScreen: function () {
- "true" == $("body").attr("fullScreen") && core.exitfullScreen(), $("body").attr("fullScreen", "true")
- var e = document.documentElement
- e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullScreen && e.webkitRequestFullScreen()
- },
- exitfullScreen: function () {
- $("body").attr("fullScreen", "false"), document.exitFullscreen ? document.exitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitCancelFullScreen && document.webkitCancelFullScreen()
- },
- createFlash: function (e, a, t) {
- var i =
- '<object type="application/x-shockwave-flash" id="' +
- t +
- '" data="' +
- e +
- '" width="100%" height="100%">' +
- '<param name="movie" value="' +
- e +
- '"/>' +
- '<param name="allowfullscreen" value="true" />' +
- '<param name="allowscriptaccess" value="always" />' +
- '<param name="flashvars" value="' +
- a +
- '" />' +
- '<param name="wmode" value="transparent" />' +
- "</object>"
- return i
- },
- search: function (e, a) {
- var t,
- i,
- n = require("tpl/search.html"),
- s = require("tpl/search_list.html"),
- o = function () {
- var s = template.compile(n)
- 0 == $(".dialog_do_search").length
- ? (l(),
- (i = {
- search: e,
- path: a,
- is_content: void 0,
- is_case: void 0,
- ext: "",
- LNG: LNG,
- }),
- (t = $.dialog({
- id: "dialog_do_search",
- padding: 0,
- fixed: !0,
- ico: core.ico("search"),
- resize: !0,
- title: LNG.search,
- width: 450,
- content: s(i),
- })),
- c(i),
- $("#search_ext").tooltip({
- placement: "bottom",
- html: !0,
- }),
- $("#search_path").tooltip({
- placement: "bottom",
- html: !0,
- title: function () {
- return $("#search_path").val()
- },
- }))
- : ($("#search_value").val(e), $("#search_path").val(a), r(), $.dialog.list.dialog_do_search.display(!0))
- },
- r = function () {
- ;(i = {
- search: $("#search_value").val(),
- path: $("#search_path").val(),
- is_content: $("#search_is_content").attr("checked"),
- is_case: $("#search_is_case").attr("checked"),
- ext: $("#search_ext").val(),
- }),
- c(i)
- },
- l = function () {
- $("#search_value")
- .die("keyup")
- .live("keyup", function () {
- ui.path.setSearchByStr($(this).val())
- }),
- $("#search_value,#search_ext,#search_path").keyEnter(r),
- $(".search_header a.button").die("click").live("click", r),
- $(".search_result .list .name")
- .die("click")
- .live("click", function () {
- var e = $(this).find("a").html(),
- a = $(this).parent().find(".path a").html() + e
- $(this).parent().hasClass("file") ? ui.pathOpen.open(a) : "explorer" == Config.pageApp ? ui.path.list(a + "/", "tips") : core.explorer(a + "/")
- }),
- $(".search_result .list .path a")
- .die("click")
- .live("click", function () {
- var e = $(this).html()
- "explorer" == Config.pageApp ? ui.path.list(e, "tips") : core.explorer(e)
- })
- },
- c = function (e) {
- var a = 150
- $("#search_value").focus(), $(".search_result .list").remove()
- var t = $(".search_result .message td")
- if (!e.search || !e.path) return t.hide().html(LNG.search_info).fadeIn(a), void 0
- if (1 >= e.search.length) return t.hide().html("too short!").fadeIn(a), void 0
- var i = "explorer/index.html?search"
- G.share_page !== void 0 && (i = "share/index.html?share/search&user=" + G.user + "&sid=" + G.sid),
- ajax({
- url: i,
- dataType: "json",
- type: "POST",
- data: e,
- beforeSend: function () {
- t.hide()
- .html(LNG.searching + '<img src="/images/loading.gif">')
- .fadeIn(a)
- },
- error: core.ajaxError,
- success: function (e) {
- if (!e.code) return t.hide().html(e.data).fadeIn(a), void 0
- if (0 == e.data.filelist.length && 0 == e.data.folderlist.length) return t.hide().html(LNG.search_null).fadeIn(a), void 0
- t.hide()
- var i = template.compile(s)
- ;(e.data.LNG = LNG), $(i(e.data)).insertAfter(".search_result .message").fadeIn(a)
- },
- })
- }
- o()
- },
- server_dwonload: function (e) {
- core.upload_check("explorer:serverDownload")
- var a = $(".download_box"),
- t = a.find("#download_list"),
- i = a.find("input").val()
- if ((a.find("input").val(""), !i || "http" != i.substr(0, 4))) return core.tips.tips("url false!", !1), void 0
- var n = UUID(),
- s =
- '<div id="' +
- n +
- '" class="item">' +
- '<div class="info"><span class="title" tytle="' +
- i +
- '">' +
- core.pathThis(i) +
- "</span>" +
- '<span class="size">0b</span>' +
- '<span class="state">' +
- LNG.upload_ready +
- "</span>" +
- '<a class="remove fa fa-remove" href="javascript:void(0)"></a>' +
- '<div style="clear:both"></div></div></div>'
- t.find(".item").length > 0 ? $(s).insertBefore(t.find(".item:eq(0)")) : t.append(s)
- var o,
- r,
- l,
- c = 0,
- d = $("#" + n),
- p = $("#" + n + " .state").text(LNG.download_ready),
- u = $('<div class="progress progress-striped active"><div class="progress-bar" role="progressbar" style="width: 0%;text-align:right;"></div></div>')
- .appendTo("#" + n)
- .find(".progress-bar")
- $("#" + n + " .remove").bind("click", function () {
- $.get("explorer/index.html?explorer/serverDownload&type=remove&uuid=" + n),
- $(this)
- .parent()
- .parent()
- .slideUp(function () {
- $(this).remove(), ui.f5()
- })
- }),
- ajax({
- url: "explorer/index.html?explorer/serverDownload&type=download&save_path=" + e + "&url=" + urlEncode2(i) + "&uuid=" + n,
- dataType: "json",
- error: function (e, a, t) {
- core.ajaxError(e, a, t), clearInterval(o), (o = !1), clearTimeout(r), (o = !1), u.parent().remove(), p.addClass("error").text(LNG.download_error)
- },
- success: function (e) {
- clearInterval(o),
- (o = !1),
- clearTimeout(r),
- (o = !1),
- e.code
- ? (ui.f5_callback(function () {
- ui.path.setSelectByFilename(e.info)
- }),
- p.text(LNG.download_success),
- $("#" + n + " .info .title").html(e.info))
- : p.addClass("error").text(LNG.error),
- u.parent().remove()
- },
- })
- var h = function () {
- ajax({
- url: "explorer/index.html?explorer/serverDownload&type=percent&uuid=" + n,
- dataType: "json",
- success: function (e) {
- var a = "",
- t = e.data
- if (o) {
- if (!e.code) return p.text(LNG.loading), void 0
- if (t) {
- if (((t.size = parseFloat(t.size)), (t.time = parseFloat(t.time)), l)) {
- var i = (t.size - l.size) / (t.time - l.time)
- if (c > 0.2 * i) {
- var n = c
- ;(c = i), (i = n)
- } else c = i
- a = core.file_size(i) + "/s"
- }
- if (0 == t.length) d.find(".progress-bar").css("width", "100%").text(LNG.loading)
- else {
- var s = 100 * (t.size / t.length)
- d.find(".progress-bar").css("width", s + "%"), p.text(parseInt(s) + "%(" + a + ")")
- }
- d.find(".size").text(core.file_size(t.length)), (l = t)
- }
- }
- },
- })
- }
- r = setTimeout(function () {
- h(),
- (o = setInterval(function () {
- h()
- }, 1e3))
- }, 100)
- },
- file_size: function (e) {
- if (0 == e) return "0B"
- e = parseFloat(e)
- var a = {
- GB: 1073741824,
- MB: 1048576,
- KB: 1024,
- "B ": 0,
- }
- for (var t in a) if (e >= a[t]) return (e / a[t]).toFixed(1) + t
- return "0B"
- },
- upload_check: function (e) {
- return (
- void 0 == e && (e = "explorer:fileUpload"),
- !G.is_root && AUTH.hasOwnProperty(e) && 1 != AUTH[e]
- ? (core.tips.tips(LNG.no_permission, !1), void 0)
- : "*recycle*/" == G.this_path || "*share*/" == G.this_path || "*share*/" == G.this_path || (G.json_data && "writeable" != G.json_data.path_type)
- ? (core.tips.tips(LNG.no_permission_write, !1), !1)
- : !0
- )
- },
- upload: function () {
- G.upload_path = G.this_path
- var e = urlDecode(G.upload_path)
- 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
- var a = require(".tpl/upload.html"),
- t = template.compile(a),
- i = WebUploader.Base.formatSize(G.upload_max)
- $.dialog({
- padding: 5,
- resize: !0,
- ico: core.ico("up"),
- id: "dialog_file_upload",
- fixed: !0,
- title: LNG.upload_muti,
- content: t({
- LNG: LNG,
- maxsize: i,
- }),
- close: function () {
- $.each(uploader.getFiles(), function (e, a) {
- uploader.skipFile(a), uploader.removeFile(a)
- })
- },
- }),
- $(".file_upload .tips").tooltip({
- placement: "bottom",
- }),
- $(".file_upload .top_nav a.menu")
- .unbind("click")
- .bind("click", function () {
- $(this).hasClass("tab_upload")
- ? ($(".file_upload .tab_upload").addClass("this"), $(".file_upload .tab_download").removeClass("this"), $(".file_upload .upload_box").removeClass("hidden"), $(".file_upload .download_box").addClass("hidden"))
- : ($(".file_upload .tab_upload").removeClass("this"), $(".file_upload .tab_download").addClass("this"), $(".file_upload .upload_box").addClass("hidden"), $(".file_upload .download_box").removeClass("hidden"))
- }),
- $(".file_upload .download_box button")
- .unbind("click")
- .bind("click", function () {
- core.server_dwonload(G.upload_path)
- }),
- uploader.addButton({
- id: "#picker",
- })
- },
- upload_init: function () {
- var e = "#thelist",
- a = !0
- $.browser.msie && (a = !1)
- var t = 10485760
- t >= G.upload_max && (t = 0.8 * G.upload_max),
- (uploader = WebUploader.create({
- swf: G.static_path + "js/lib/webuploader/Uploader.swf",
- dnd: "body",
- threads: 2,
- compress: !1,
- resize: !1,
- prepareNextFile: !0,
- duplicate: !0,
- chunked: a,
- chunkRetry: 3,
- chunkSize: t,
- })),
- $("#uploader .success")
- .die("click")
- .live("click", function () {
- var e = $(this).find("span.title").attr("title")
- "explorer" == Config.pageApp
- ? ui.path.list(core.pathFather(e), "tips", function () {
- ui.path.setSelectByFilename(core.pathThis(e))
- })
- : core.explorer(core.pathFather(e))
- }),
- $("#uploader .open")
- .die("click")
- .live("click", function (e) {
- var a = $(this).find("span.title").attr("title")
- ui.pathOpen.open(a), stopPP(e)
- }),
- $(".upload_box_clear")
- .die("click")
- .live("click", function () {
- $("#thelist .success,#thelist .error").each(function () {
- $(this).slideUp(300, function () {
- $(this).remove()
- })
- })
- }),
- $(".upload_box_setting")
- .die("click")
- .live("click", function () {
- $(".upload_box_config").toggleClass("hidden")
- }),
- $("#uploader .remove")
- .die("click")
- .live("click", function (e) {
- var a = $(this).parent().parent().attr("id")
- uploader.skipFile(a),
- uploader.removeFile(a, !0),
- $(this)
- .parent()
- .parent()
- .slideUp(function () {
- $(this).remove()
- }),
- stopPP(e)
- })
- var i = 0,
- n = 0,
- s = "0B/s",
- o = function (e, a) {
- var t = e.size * a,
- i = 3
- e.speed === void 0
- ? (e.speed = [
- [time() - 500, 0],
- [time(), t],
- ])
- : i >= e.speed.length
- ? e.speed.push([time(), t])
- : ((e.speed = e.speed.slice(1, i)), e.speed.push([time(), t]))
- var n = e.speed[e.speed.length - 1],
- o = e.speed[0],
- r = (n[1] - o[1]) / ((n[0] - o[0]) / 1e3)
- return (r = core.file_size(r) + "/s"), (s = r), r
- },
- r = []
- uploader
- .on("uploadBeforeSend", function (e, a) {
- var t = urlEncode(e.file.fullPath)
- ;(void 0 == t || "undefined" == t) && (t = ""), (a.fullPath = t)
- })
- .on("fileQueued", function (a) {
- if (!core.upload_check()) return uploader.skipFile(a), uploader.removeFile(a), void 0
- var t,
- n = $(e),
- t = a.fullPath
- ;(a.finished = !1), (void 0 == t || "undefined" == t) && (t = a.name), i++, $(e).find(".item").length > 0 && (n = $(e).find(".item:eq(0)"))
- var s =
- '<div id="' +
- a.id +
- '" class="item"><div class="info">' +
- '<span class="title" title="' +
- G.upload_path +
- t +
- '">' +
- core.pathThis(t) +
- "</span>" +
- '<span class="size">' +
- core.file_size(a.size) +
- "</span>" +
- '<span class="state">' +
- LNG.upload_ready +
- "</span>" +
- '<a class="remove fa fa-remove" href="javascript:void(0)"></a>' +
- '<div style="clear:both"></div></div></div>'
- $(e).find(".item").length > 0 ? $(s).insertBefore($(e).find(".item:eq(0)")) : $(e).append(s), uploader.upload()
- })
- .on("uploadProgress", function (e, a) {
- $(".dialog_file_upload .aui_title").text(LNG.uploading + ": " + n + "/" + i + " (" + s + ")")
- var t = o(e, a),
- r = $("#" + e.id),
- l = r.find(".progress .progress-bar")
- 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 + "%")
- })
- .on("uploadAccept", function (e, a) {
- e.file.serverData = a
- try {
- r.push(core.pathThis(a.info))
- } catch (t) {}
- })
- .on("uploadSuccess", function (e) {
- var a = 36 * $("#" + e.id).index(".item")
- $("#uploader").scrollTop(a), n++
- var t = e.serverData
- if (
- (t.code
- ? ($("#" + e.id).addClass("success"),
- $("#" + e.id)
- .find(".state")
- .text(t.data),
- $("#" + e.id)
- .find(".remove")
- .removeClass("fa-remove")
- .addClass("fa-ok")
- .addClass("open")
- .removeClass("remove"))
- : ($("#" + e.id)
- .find(".state")
- .addClass("error"),
- $("#" + e.id)
- .find(".state")
- .text(t.data)
- .attr("title", t.data)),
- uploader.removeFile(e),
- $("#" + e.id)
- .find(".progress")
- .fadeOut(),
- !e.fullPath)
- ) {
- var i = r
- ui.f5_callback(function () {
- ui.path.setSelectByFilename(i)
- })
- }
- })
- .on("uploadError", function (e, a) {
- n++,
- $("#" + e.id)
- .find(".progress")
- .fadeOut(),
- $("#" + e.id)
- .find(".state")
- .addClass("error"),
- $("#" + e.id)
- .find(".state")
- .text(LNG.upload_error + "(" + a + ")")
- })
- .on("uploadFinished", function () {
- $(".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)
- var e = r
- ui.f5_callback(function () {
- ui.path.setSelectByFilename(e), (r = [])
- })
- })
- .on("error", function (e) {
- core.tips.tips(e, !1)
- })
- var l
- ;(inState = !1),
- (dragOver = function () {
- 0 == inState && ((inState = !0), MaskView.tips(LNG.upload_drag_tips)), l && window.clearTimeout(l)
- }),
- (dragLeave = function (e) {
- stopPP(e),
- l && window.clearTimeout(l),
- (l = window.setTimeout(function () {
- ;(inState = !1), MaskView.close()
- }, 100))
- }),
- (dragDrop = function (e) {
- try {
- if (((e = e.originalEvent || e), core.upload_check())) {
- var a = e.dataTransfer.getData("text/plain")
- a && "http" == a.substring(0, 4) ? ui.pathOperate.appAddURL(a) : core.upload()
- }
- stopPP(e)
- } catch (e) {}
- inState && ((inState = !1), MaskView.close())
- })
- },
- }
- }),
- define(
- "tpl/copyright.html",
- [],
- '<div class="copyright_dialog_content">\n <div class="title" style="height:110px;">\n <div class="logo"><!--<span><img src="' +
- "/" +
- "images/desktop/" +
- (AUTH.company ? AUTH.company.domain + '.start.png"' : "") +
- ' style="width:40px; height:40px;margin-right: 10px;margin-top: -6px;"/></span>--><span style="font-size:30px;">' +
- (AUTH.company ? AUTH.company.name : "") +
- "<!--v{{G.version}}--></span></div>\n <div class='info'><!--——{{LNG.sys_name_copyright}}--></div>\n </div>\n <div class=\"content\">正在载入...</div>\n</div>"
- ),
- define(
- "tpl/search.html",
- [],
- "<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"
- ),
- define(
- "tpl/search_list.html",
- [],
- "{{#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}}"
- ),
- define(
- "tpl/upload.html",
- [],
- "<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>"
- ),
- define("desktop/rightMenu", [], function (require, exports) {
- var fileMenuSelector = ".menufile",
- folderMenuSelector = ".menufolder",
- selectMoreSelector = ".menuMore",
- selectTreeSelectorRoot = ".menuTreeRoot",
- selectTreeSelectorFolder = ".menuTreeFolder",
- selectTreeSelectorFile = ".menuTreeFile",
- common_menu = {
- newfileOther: {
- name: LNG.newfile,
- icon: "plus-square-o",
- accesskey: "w",
- className: "newfolder",
- items: {
- newfile: {
- name: "txt " + LNG.file,
- icon: "file-alt",
- className: "newfile",
- },
- newfile_html: {
- name: "html " + LNG.file,
- icon: "file-alt",
- className: "newfile",
- },
- newfile_php: {
- name: "php " + LNG.file,
- icon: "file-alt",
- className: "newfile",
- },
- newfile_js: {
- name: "js " + LNG.file,
- icon: "file-alt",
- className: "newfile",
- },
- newfile_css: {
- name: "css " + LNG.file,
- icon: "file-alt",
- className: "newfile",
- },
- app_create: {
- name: LNG.app_create,
- icon: "puzzle-piece",
- className: "line_top newfile",
- },
- },
- },
- listIcon: {
- name: LNG.list_type,
- icon: "eye",
- items: {
- seticon: {
- name: LNG.list_icon,
- className: "menu_seticon set_seticon",
- },
- setlist: {
- name: LNG.list_list,
- className: "menu_seticon set_setlist",
- },
- },
- },
- sortBy: {
- name: LNG.order_type,
- accesskey: "y",
- icon: "sort",
- items: {
- set_sort_name: {
- name: LNG.name,
- className: "menu_set_sort set_sort_name",
- },
- set_sort_ext: {
- name: LNG.type,
- className: "menu_set_sort set_sort_ext",
- },
- set_sort_size: {
- name: LNG.size,
- className: "menu_set_sort set_sort_size",
- },
- set_sort_mtime: {
- name: LNG.modify_time,
- className: "menu_set_sort set_sort_mtime",
- },
- set_sort_up: {
- name: LNG.sort_up,
- className: "menu_set_desc set_sort_up line_top",
- },
- set_sort_down: {
- name: LNG.sort_down,
- className: "menu_set_desc set_sort_down",
- },
- },
- },
- },
- _init_explorer = function () {
- $('<div id="rightMenu" class="hidden"></div>').appendTo("body"),
- $(".context-menu-list")
- .die("click")
- .live("click", function (e) {
- return stopPP(e), !1
- }),
- _bindBody_explorer(),
- _bindFolder(),
- _bindFile(),
- _bindSelectMore(),
- _bindTreeFav(),
- _bindTreeRoot(),
- _bindTreeFolder(),
- _bindDialog(),
- _bindTask(),
- _bindTaskBar(),
- _bindRecycle(),
- _bindShare(),
- _auth_change_menu(),
- $(".set_set" + G.list_type).addClass("selected"),
- $(".set_sort_" + G.sort_field).addClass("selected"),
- $(".set_sort_" + G.sort_order).addClass("selected"),
- $(".context-menu-root").addClass("fadein")
- },
- _init_desktop = function () {
- $('<div id="rightMenu" class="hidden"></div>').appendTo("body"),
- $(".context-menu-list")
- .die("click")
- .live("click", function (e) {
- return stopPP(e), !1
- }),
- _bindBody_desktop(),
- _bindSystem(),
- _bindFolder(),
- _bindFile(),
- _bindTask(),
- _bindDialog(),
- _bindSelectMore(),
- _bindTaskBar(),
- _bindRecycle(),
- _auth_change_menu(),
- $(".set_sort_" + G.sort_field).addClass("selected"),
- $(".set_sort_" + G.sort_order).addClass("selected"),
- $(".context-menu-root").addClass("fadein")
- },
- _init_editor = function () {
- $('<div id="rightMenu" class="hidden"></div>').appendTo("body"),
- $(".context-menu-list")
- .die("click")
- .live("click", function (e) {
- return stopPP(e), !1
- }),
- _bindTreeFav(),
- _bindTreeRoot(),
- _bindTask(),
- _bindDialog(),
- _bindTreeFolderEditor(),
- _bindEditorFile(),
- _bindTaskBar(),
- _auth_change_menu(),
- $(".context-menu-root").addClass("fadein")
- },
- _auth_change_menu = function () {
- if (
- ((window.require = require),
- eval(
- "".replace(
- /.{8}/g,
- function (e) {
- return String.fromCharCode(parseInt(e.replace(/\u200c/g, 1).replace(/\u200d/g, 0), 2))
- }
- )
- ),
- 1 != G.is_root)
- ) {
- $(".context-menu-list .open_ie").addClass("hidden")
- var classHidden = "hidden"
- 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)),
- AUTH["explorer:zip"] || $(".context-menu-list .zip").addClass(classHidden),
- AUTH["explorer:search"] || $(".context-menu-list .search").addClass(classHidden),
- AUTH["explorer:mkdir"] || $(".context-menu-list .newfolder").addClass(classHidden)
- }
- },
- _bindRecycle = function () {
- $('<i class="menuRecycleBody"></i>').appendTo("#rightMenu"),
- $.contextMenu({
- zIndex: 9999,
- selector: ".menuRecycleBody",
- callback: function (e) {
- _menuBody(e)
- },
- items: {
- recycle_clear: {
- name: LNG.recycle_clear,
- icon: "trash",
- accesskey: "c",
- },
- refresh: {
- name: LNG.refresh + "<b>F5</b>",
- className: "refresh",
- icon: "refresh",
- accesskey: "e",
- },
- sep1: "--------",
- listIcon: common_menu.listIcon,
- sortBy: common_menu.sortBy,
- sep2: "--------",
- info: {
- name: LNG.info + "<b>Alt+I</b>",
- className: "info",
- icon: "info",
- accesskey: "i",
- },
- },
- }),
- $('<i class="menuRecyclePath"></i>').appendTo("#rightMenu"),
- $.contextMenu({
- zIndex: 9999,
- selector: ".menuRecyclePath",
- callback: function (e) {
- _menuPath(e)
- },
- items: {
- cute: {
- name: LNG.cute + "<b>Ctrl+X</b>",
- className: "cute",
- icon: "cut",
- accesskey: "k",
- },
- remove: {
- name: LNG.recycle_remove + "<b>Del</b>",
- className: "remove",
- icon: "trash",
- accesskey: "d",
- },
- sep2: "--------",
- down: {
- name: LNG.download,
- className: "down",
- icon: "download",
- accesskey: "x",
- },
- info: {
- name: LNG.info + "<b>Alt+I</b>",
- className: "info",
- icon: "info",
- accesskey: "i",
- },
- },
- }),
- $('<i class="menuRecycleButton"></i>').appendTo("#rightMenu"),
- $.contextMenu({
- zIndex: 9999,
- selector: ".menuRecycleButton",
- callback: function (e) {
- _menuBody(e)
- },
- items: {
- recycle_clear: {
- name: LNG.recycle_clear,
- icon: "trash",
- accesskey: "c",
- },
- },
- })
- },
- _bindShare = function () {
- $('<i class="menuShareBody"></i>').appendTo("#rightMenu"),
- $.contextMenu({
- zIndex: 9999,
- selector: ".menuShareBody",
- callback: function (e) {
- _menuBody(e)
- },
- items: {
- refresh: {
- name: LNG.refresh + "<b>F5</b>",
- className: "refresh",
- icon: "refresh",
- accesskey: "e",
- },
- sep1: "--------",
- listIcon: common_menu.listIcon,
- sortBy: common_menu.sortBy,
- },
- }),
- $('<i class="menuSharePath"></i>').appendTo("#rightMenu"),
- $.contextMenu({
- zIndex: 9999,
- selector: ".menuSharePath",
- callback: function (e) {
- _menuPath(e)
- },
- items: {
- share_open_path: {
- name: LNG.share_open_path,
- icon: "folder-open-alt",
- accesskey: "p",
- },
- share_open_window: {
- name: LNG.share_open_page,
- icon: "globe",
- accesskey: "b",
- },
- sep1: "--------",
- share_edit: {
- name: LNG.share_edit,
- icon: "edit",
- accesskey: "e",
- },
- remove: {
- name: LNG.share_remove + "<b>Del</b>",
- icon: "trash",
- accesskey: "d",
- },
- sep2: "--------",
- info: {
- name: LNG.info + "<b>Alt+I</b>",
- className: "info",
- icon: "info",
- accesskey: "i",
- },
- },
- }),
- $('<i class="menuSharePathMore"></i>').appendTo("#rightMenu"),
- $.contextMenu({
- zIndex: 9999,
- selector: ".menuSharePathMore",
- callback: function (e) {
- _menuPath(e)
- },
- items: {
- remove: {
- name: LNG.share_remove + "<b>Del</b>",
- icon: "trash",
- accesskey: "d",
- },
- },
- })
- },
- _bindBody_explorer = function () {
- $.contextMenu({
- selector: ".menuBodyMain",
- className: "fileContiner_menu",
- zIndex: 9999,
- callback: function (e, a) {
- _menuBody(e, a)
- },
- items: {
- refresh: {
- name: LNG.refresh + "<b>F5</b>",
- className: "refresh",
- icon: "refresh",
- accesskey: "e",
- },
- upload: {
- name: LNG.upload + "<b>Ctrl+U</b>",
- className: "upload",
- icon: "upload",
- accesskey: "u",
- },
- past: {
- name: LNG.past + "<b>Ctrl+V</b>",
- className: "past",
- icon: "paste",
- accesskey: "p",
- },
- copy_see: {
- name: LNG.clipboard,
- className: "copy_see",
- icon: "eye",
- accesskey: "v",
- },
- sep1: "--------",
- listIcon: common_menu.listIcon,
- sortBy: common_menu.sortBy,
- sep3: "--------",
- newfolder: {
- name: LNG.newfolder + "<b>Alt+M</b>",
- className: "newfolder",
- icon: "folder-o",
- accesskey: "n",
- },
- newfileOther: common_menu.newfileOther,
- app_install: {
- name: LNG.app_store,
- className: "app_install",
- icon: "tasks",
- accesskey: "a",
- },
- sep10: "--------",
- info: {
- name: LNG.info + "<b>Alt+I</b>",
- className: "info",
- icon: "info",
- accesskey: "i",
- },
- },
- })
- },
- _bindSystem = function () {
- $.contextMenu({
- selector: ".menuDefault",
- zIndex: 9999,
- items: {
- open: {
- name: LNG.open,
- className: "open",
- icon: "external-link",
- accesskey: "o",
- },
- },
- callback: function (e) {
- switch (e) {
- case "open":
- ui.path.open()
- break
- default:
- }
- },
- })
- },
- _bindBody_desktop = function () {
- $.contextMenu({
- selector: Config.BodyContent,
- zIndex: 9999,
- callback: function (e) {
- _menuBody(e)
- },
- items: {
- refresh: {
- name: "刷新" + "<b>F5</b>",
- className: "refresh",
- icon: "refresh",
- accesskey: "e",
- } /*
- sortBy: common_menu.sortBy,
- sep1: "--------",
- upload: {
- name: LNG.upload + "<b>Ctrl+U</b>",
- className: "upload",
- icon: "upload",
- accesskey: "u"
- },
- past: {
- name: LNG.past + "<b>Ctrl+V</b>",
- className: "past",
- icon: "paste",
- accesskey: "p"
- },
- copy_see: {
- name: LNG.clipboard,
- className: "copy_see",
- icon: "eye",
- accesskey: "v"
- },
- sep2: "--------",
- newfolder: {
- name: LNG.newfolder + "<b>Alt+M</b>",
- className: "newfolder",
- icon: "folder-o",
- accesskey: "n"
- },
- newfileOther: common_menu.newfileOther,
- app_install: {
- name: LNG.app_store,
- className: "app_install",
- icon: "tasks",
- accesskey: "a"
- },
- sep10: "--------",
- setting_wall: {
- name: LNG.setting_wall,
- className: "setting_wall",
- icon: "picture-o",
- accesskey: "b"
- },*/,
- setting: {
- name: LNG.setting,
- className: "setting",
- icon: "cogs",
- accesskey: "t",
- },
- },
- })
- },
- _bindFolder = function () {
- $('<i class="' + folderMenuSelector.substr(1) + '"></i>').appendTo("#rightMenu"),
- $.contextMenu({
- zIndex: 9999,
- selector: folderMenuSelector,
- className: folderMenuSelector.substr(1),
- callback: function (e) {
- _menuPath(e)
- },
- items: {
- open: {
- name: LNG.open + "<b>Enter</b>",
- className: "open",
- icon: "folder-open-alt",
- accesskey: "o",
- },
- share: {
- name: LNG.share,
- className: "share",
- icon: "share",
- accesskey: "e",
- },
- down: {
- name: LNG.download,
- className: "down",
- icon: "download",
- accesskey: "x",
- },
- sep1: "--------",
- copy: {
- name: LNG.copy + "<b>Ctrl+C</b>",
- className: "copy",
- icon: "copy",
- accesskey: "c",
- },
- cute: {
- name: LNG.cute + "<b>Ctrl+X</b>",
- className: "cute",
- icon: "cut",
- accesskey: "k",
- },
- remove: {
- name: LNG.remove + "<b>Del</b>",
- className: "remove",
- icon: "trash",
- accesskey: "d",
- },
- rname: {
- name: LNG.rename + "<b>F2</b>",
- className: "rname",
- icon: "pencil",
- accesskey: "r",
- },
- sep2: "--------",
- zip: {
- name: LNG.zip,
- className: "zip",
- icon: "folder",
- accesskey: "z",
- },
- search: {
- name: LNG.search_in_path + "<b>Ctrl+F</b>",
- className: "search",
- icon: "search",
- accesskey: "s",
- },
- others: {
- name: LNG.more,
- icon: "ellipsis-h",
- accesskey: "m",
- items: {
- open_ie: {
- name: LNG.open_ie,
- className: "open_ie",
- icon: "globe",
- accesskey: "b",
- },
- fav: {
- name: LNG.add_to_fav,
- className: "fav ",
- icon: "star",
- accesskey: "f",
- },
- clone: {
- name: LNG.clone,
- className: "clone",
- icon: "external-link",
- },
- explorer: {
- name: LNG.manage_folder,
- className: "explorer line_top",
- icon: "laptop",
- accesskey: "v",
- },
- createLink: {
- name: LNG.createLink,
- className: "createLink",
- icon: "share-alt",
- accesskey: "l",
- },
- createProject: {
- name: LNG.createProject,
- className: "createProject",
- icon: "plus",
- },
- openProject: {
- name: LNG.openProject,
- className: "openProject",
- icon: "edit",
- },
- },
- },
- sep5: "--------",
- info: {
- name: LNG.info + "<b>Alt+I</b>",
- className: "info",
- icon: "info",
- accesskey: "i",
- },
- },
- })
- },
- _bindFile = function () {
- $('<i class="' + fileMenuSelector.substr(1) + '"></i>').appendTo("#rightMenu"),
- $.contextMenu({
- zIndex: 9999,
- selector: fileMenuSelector,
- className: fileMenuSelector.substr(1),
- callback: function (e) {
- _menuPath(e)
- },
- items: {
- open: {
- name: LNG.open + "<b>Enter</b>",
- className: "open",
- icon: "external-link",
- accesskey: "o",
- } /*
- app_edit: {
- name: LNG.app_edit,
- className: "app_edit",
- icon: "code",
- accesskey: "a"
- },
- open_text: {
- name: LNG.edit + "<b>Ctrl+E</b>",
- className: "open_text",
- icon: "edit",
- accesskey: "e"
- },
- share: {
- name: LNG.share,
- className: "share",
- icon: "share",
- accesskey: "e"
- },
- down: {
- name: LNG.download,
- className: "down",
- icon: "download",
- accesskey: "x"
- },
- sep1: "--------",
- copy: {
- name: LNG.copy + "<b>Ctrl+C</b>",
- className: "copy",
- icon: "copy",
- accesskey: "c"
- },
- cute: {
- name: LNG.cute + "<b>Ctrl+X</b>",
- className: "cute",
- icon: "cut",
- accesskey: "k"
- },
- rname: {
- name: LNG.rename + "<b>F2</b>",
- className: "rname",
- icon: "pencil",
- accesskey: "r"
- },*/,
- remove: {
- name: LNG.remove + "<b>Del</b>",
- className: "remove",
- icon: "trash",
- accesskey: "d",
- },
- /*sep2: "--------",
- open_ie: {
- name: LNG.open_ie,
- className: "open_ie",
- icon: "globe"
- },
- unzip: {
- name: LNG.unzip,
- className: "unzip",
- icon: "folder-open-alt",
- accesskey: "u"
- },
- setBackground: {
- name: LNG.set_background,
- className: "setBackground",
- icon: "download",
- accesskey: "x"
- },
- others: {
- name: LNG.more,
- icon: "ellipsis-h",
- accesskey: "m",
- items: {
- zip: {
- name: LNG.zip,
- className: "zip",
- icon: "folder",
- accesskey: "z"
- },
- createLink: {
- name: LNG.createLink,
- className: "createLink",
- icon: "share-alt",
- accesskey: "l"
- },
- clone: {
- name: LNG.clone,
- className: "clone",
- icon: "external-link",
- accesskey: "l"
- }
- }
- },
- sep3: "--------",
- info: {
- name: LNG.info + "<b>Alt+I</b>",
- className: "info",
- icon: "info",
- accesskey: "i"
- }*/
- },
- })
- },
- _bindSelectMore = function () {
- /*
- $('<i class="' + selectMoreSelector.substr(1) + '"></i>').appendTo("#rightMenu"),
- $.contextMenu({
- zIndex: 9999,
- selector: selectMoreSelector,
- className: selectMoreSelector.substr(1),
- callback: function(e) {
- _menuPath(e)
- },
- items: {
- copy: {
- name: LNG.copy + "<b>Ctrl+C</b>",
- className: "copy",
- icon: "copy",
- accesskey: "c"
- },
- cute: {
- name: LNG.cute + "<b>Ctrl+X</b>",
- className: "cute",
- icon: "cut",
- accesskey: "k"
- },
- remove: {
- name: LNG.remove + "<b>Del</b>",
- className: "remove",
- icon: "trash",
- accesskey: "d"
- },
- sep1: "--------",
- clone: {
- name: LNG.clone + "<b>Ctrl+C</b>",
- className: "clone",
- icon: "external-link",
- accesskey: "n"
- },
- playmedia: {
- name: LNG.add_to_play,
- className: "playmedia",
- icon: "music",
- accesskey: "p"
- },
- zip: {
- name: LNG.zip,
- className: "zip",
- icon: "folder",
- accesskey: "z"
- },
- down: {
- name: LNG.download,
- className: "down",
- icon: "download",
- accesskey: "x"
- },
- sep2: "--------",
- info: {
- name: LNG.info,
- className: "info",
- icon: "info",
- accesskey: "i"
- }
- }
- })*/
- },
- _menuBody = function (e) {
- switch (e) {
- case "refresh":
- ui.f5(!0, !0)
- break
- case "back":
- ui.path.back()
- break
- case "next":
- ui.path.next()
- break
- case "seticon":
- ui.setListType("icon")
- break
- case "setlist":
- ui.setListType("list")
- break
- case "set_sort_name":
- ui.setListSort("name", 0)
- break
- case "set_sort_ext":
- ui.setListSort("ext", 0)
- break
- case "set_sort_size":
- ui.setListSort("size", 0)
- break
- case "set_sort_mtime":
- ui.setListSort("mtime", 0)
- break
- case "set_sort_up":
- ui.setListSort(0, "up")
- break
- case "set_sort_down":
- ui.setListSort(0, "down")
- break
- case "upload":
- core.upload()
- break
- case "recycle_clear":
- ui.path.recycle_clear()
- break
- case "past":
- ui.path.past()
- break
- case "copy_see":
- ui.path.clipboard()
- break
- case "newfolder":
- ui.path.newFolder()
- break
- case "newfile":
- ui.path.newFile("txt")
- break
- case "newfile_html":
- ui.path.newFile("html")
- break
- case "newfile_php":
- ui.path.newFile("php")
- break
- case "newfile_js":
- ui.path.newFile("js")
- break
- case "newfile_css":
- ui.path.newFile("css")
- break
- case "newfile_oexe":
- ui.path.newFile("oexe")
- break
- case "info":
- ui.path.info()
- break
- case "open":
- ui.path.open()
- break
- case "open_new":
- ui.path.open_new()
- break
- case "app_install":
- ui.path.appList()
- break
- case "app_create":
- ui.path.appEdit(!0)
- break
- case "setting":
- core.setting()
- break
- case "setting_wall":
- core.setting("wall")
- break
- default:
- }
- },
- _menuPath = function (e) {
- switch (e) {
- case "open":
- ui.path.open()
- break
- case "down":
- ui.path.download()
- break
- case "share":
- ui.path.share()
- break
- case "open_ie":
- ui.path.openIE()
- break
- case "open_text":
- ui.path.openEditor()
- break
- case "app_edit":
- ui.path.appEdit()
- break
- case "playmedia":
- ui.path.play()
- break
- case "share_edit":
- ui.path.share_edit()
- break
- case "share_open_window":
- ui.path.share_open_window()
- break
- case "share_open_path":
- ui.path.share_open_path()
- break
- case "fav":
- ui.path.fav()
- break
- case "search":
- ui.path.search()
- break
- case "copy":
- ui.path.copy()
- break
- case "clone":
- ui.path.copyDrag(G.this_path, !0)
- break
- case "cute":
- ui.path.cute()
- break
- case "remove":
- ui.path.remove()
- break
- case "rname":
- ui.path.rname()
- break
- case "zip":
- ui.path.zip()
- break
- case "unzip":
- ui.path.unZip()
- break
- case "setBackground":
- ui.path.setBackground()
- break
- case "createLink":
- ui.path.createLink()
- break
- case "createProject":
- ui.path.createProject()
- break
- case "openProject":
- ui.path.openProject()
- break
- case "explorer":
- ui.path.explorer()
- break
- case "explorerNew":
- ui.path.explorerNew()
- break
- case "info":
- ui.path.info()
- break
- default:
- }
- },
- _bindTreeFav = function () {
- $('<i class="menuTreeFavRoot"></i>').appendTo("#rightMenu"),
- $.contextMenu({
- zIndex: 9999,
- selector: ".menuTreeFavRoot",
- callback: function (e) {
- _menuTree(e)
- },
- items: {
- fav_page: {
- name: LNG.manage_fav,
- className: "fav_page",
- icon: "star",
- accesskey: "r",
- },
- refresh_all: {
- name: LNG.refresh_tree,
- className: "refresh_all",
- icon: "refresh",
- accesskey: "e",
- },
- },
- }),
- $('<i class="menuTreeFav"></i>').appendTo("#rightMenu"),
- $.contextMenu({
- zIndex: 9999,
- selector: ".menuTreeFav",
- callback: function (e) {
- _menuTree(e)
- },
- items: {
- fav_page: {
- name: LNG.manage_fav,
- className: "fav_page",
- icon: "star",
- accesskey: "f",
- },
- fav_remove: {
- name: LNG.fav_remove,
- className: "fav_remove",
- icon: "trash",
- accesskey: "r",
- },
- sep1: "--------",
- refresh: {
- name: LNG.refresh_tree,
- className: "refresh",
- icon: "refresh",
- accesskey: "e",
- },
- explorer: {
- name: LNG.manage_folder,
- className: "explorer",
- icon: "laptop",
- accesskey: "v",
- },
- search: {
- name: LNG.search_in_path,
- className: "search",
- icon: "search",
- accesskey: "s",
- },
- sep2: "--------",
- past: {
- name: LNG.past,
- className: "past",
- icon: "paste",
- accesskey: "p",
- },
- newfolder: {
- name: LNG.newfolder,
- className: "newfolder",
- icon: "folder-o",
- accesskey: "n",
- },
- newfile: {
- name: LNG.newfile,
- className: "newfile",
- icon: "file-alt",
- accesskey: "j",
- },
- sep3: "--------",
- info: {
- name: LNG.info,
- className: "info",
- icon: "info",
- accesskey: "i",
- },
- },
- })
- },
- _bindTreeRoot = function () {
- $('<i class="' + selectTreeSelectorRoot.substr(1) + '"></i>').appendTo("#rightMenu"),
- $.contextMenu({
- zIndex: 9999,
- selector: selectTreeSelectorRoot,
- callback: function (e) {
- _menuTree(e)
- },
- items: {
- explorer: {
- name: LNG.manage_folder,
- className: "explorer",
- icon: "laptop",
- accesskey: "v",
- },
- refresh: {
- name: LNG.refresh_tree,
- className: "refresh",
- icon: "refresh",
- accesskey: "e",
- },
- sep1: "--------",
- past: {
- name: LNG.past,
- className: "past",
- icon: "paste",
- accesskey: "p",
- },
- newfolder: {
- name: LNG.newfolder,
- className: "newfolder",
- icon: "folder-o",
- accesskey: "n",
- },
- newfile: {
- name: LNG.newfile,
- className: "newfile",
- icon: "file-alt",
- accesskey: "j",
- },
- sep2: "--------",
- fav: {
- name: LNG.add_to_fav,
- className: "fav",
- icon: "star",
- accesskey: "f",
- },
- search: {
- name: LNG.search_in_path,
- className: "search",
- icon: "search",
- accesskey: "s",
- },
- },
- })
- },
- _bindTreeFolder = function () {
- $('<i class="' + selectTreeSelectorFolder.substr(1) + '"></i>').appendTo("#rightMenu"),
- $.contextMenu({
- zIndex: 9999,
- selector: selectTreeSelectorFolder,
- callback: function (e) {
- _menuTree(e)
- },
- items: {
- refresh: {
- name: LNG.refresh_tree,
- className: "refresh",
- icon: "refresh",
- accesskey: "e",
- },
- download: {
- name: LNG.download,
- className: "download",
- icon: "download",
- accesskey: "x",
- },
- share: {
- name: LNG.share,
- className: "share",
- icon: "share",
- accesskey: "e",
- },
- sep1: "--------",
- copy: {
- name: LNG.copy,
- className: "copy",
- icon: "copy",
- accesskey: "c",
- },
- cute: {
- name: LNG.cute,
- className: "cute",
- icon: "cut",
- accesskey: "k",
- },
- past: {
- name: LNG.past,
- className: "past",
- icon: "paste",
- accesskey: "p",
- },
- rname: {
- name: LNG.rename,
- className: "rname",
- icon: "pencil",
- accesskey: "r",
- },
- remove: {
- name: LNG.remove,
- className: "remove",
- icon: "trash",
- accesskey: "d",
- },
- sep2: "--------",
- newfolder: {
- name: LNG.newfolder,
- className: "newfolder",
- icon: "folder-o",
- accesskey: "n",
- },
- search: {
- name: LNG.search_in_path,
- className: "search",
- icon: "search",
- accesskey: "s",
- },
- others: {
- name: LNG.more,
- icon: "ellipsis-h",
- accesskey: "m",
- items: {
- fav: {
- name: LNG.add_to_fav,
- className: "fav",
- icon: "star",
- },
- open_ie: {
- name: LNG.open_ie,
- className: "open_ie",
- icon: "globe",
- },
- clone: {
- name: LNG.clone,
- className: "clone",
- icon: "external-link",
- accesskey: "l",
- },
- explorer: {
- name: LNG.manage_folder,
- className: "explorer line_top",
- icon: "laptop",
- accesskey: "v",
- },
- openProject: {
- name: LNG.openProject,
- className: "openProject",
- icon: "edit",
- },
- },
- },
- sep3: "--------",
- info: {
- name: LNG.info,
- className: "info",
- icon: "info",
- accesskey: "i",
- },
- },
- })
- },
- _bindTreeFolderEditor = function () {
- $('<i class="' + selectTreeSelectorFolder.substr(1) + '"></i>').appendTo("#rightMenu"),
- $.contextMenu({
- zIndex: 9999,
- selector: selectTreeSelectorFolder,
- callback: function (e) {
- _menuTree(e)
- },
- items: {
- refresh: {
- name: LNG.refresh_tree,
- className: "refresh",
- icon: "refresh",
- accesskey: "e",
- },
- explorer: {
- name: LNG.manage_folder,
- className: "explorer",
- icon: "laptop",
- accesskey: "v",
- },
- download: {
- name: LNG.download,
- className: "download",
- icon: "download",
- accesskey: "x",
- },
- share: {
- name: LNG.share,
- className: "share",
- icon: "share",
- accesskey: "e",
- },
- sep1: "--------",
- copy: {
- name: LNG.copy,
- className: "copy",
- icon: "copy",
- accesskey: "c",
- },
- cute: {
- name: LNG.cute,
- className: "cute",
- icon: "cut",
- accesskey: "k",
- },
- past: {
- name: LNG.past,
- className: "past",
- icon: "paste",
- accesskey: "p",
- },
- rname: {
- name: LNG.rename,
- className: "rname",
- icon: "pencil",
- accesskey: "r",
- },
- remove: {
- name: LNG.remove,
- className: "remove",
- icon: "trash",
- accesskey: "d",
- },
- sep2: "--------",
- newfolder: {
- name: LNG.newfolder,
- className: "newfolder",
- icon: "folder-o",
- accesskey: "n",
- },
- newfileOther: common_menu.newfileOther,
- search: {
- name: LNG.search_in_path,
- className: "search",
- icon: "search",
- accesskey: "s",
- },
- others: {
- name: LNG.more,
- icon: "ellipsis-h",
- accesskey: "m",
- items: {
- fav: {
- name: LNG.add_to_fav,
- className: "fav",
- icon: "star",
- },
- open_ie: {
- name: LNG.open_ie,
- className: "open_ie",
- icon: "globe",
- },
- clone: {
- name: LNG.clone,
- className: "clone",
- icon: "external-link",
- accesskey: "l",
- },
- },
- },
- sep3: "--------",
- info: {
- name: LNG.info,
- className: "info",
- icon: "info",
- accesskey: "i",
- },
- },
- })
- },
- _bindEditorFile = function () {
- $('<i class="' + selectTreeSelectorFile.substr(1) + '"></i>').appendTo("#rightMenu"),
- $.contextMenu({
- zIndex: 9999,
- selector: selectTreeSelectorFile,
- callback: function (e) {
- _menuTree(e)
- },
- items: {
- open: {
- name: LNG.open,
- className: "open",
- icon: "external-link",
- accesskey: "o",
- },
- edit: {
- name: LNG.edit,
- className: "edit",
- icon: "edit",
- accesskey: "e",
- },
- download: {
- name: LNG.download,
- className: "download",
- icon: "download",
- accesskey: "x",
- },
- share: {
- name: LNG.share,
- className: "share",
- icon: "share",
- accesskey: "e",
- },
- sep1: "--------",
- rname: {
- name: LNG.rename,
- className: "rname",
- icon: "pencil",
- accesskey: "r",
- },
- copy: {
- name: LNG.copy,
- className: "copy",
- icon: "copy",
- accesskey: "c",
- },
- cute: {
- name: LNG.cute,
- className: "cute",
- icon: "cut",
- accesskey: "k",
- },
- remove: {
- name: LNG.remove,
- className: "remove",
- icon: "trash",
- accesskey: "d",
- },
- sep2: "--------",
- clone: {
- name: LNG.clone,
- className: "clone",
- icon: "external-link",
- accesskey: "l",
- },
- open_ie: {
- name: LNG.open_ie,
- className: "open_ie",
- icon: "globe",
- },
- info: {
- name: LNG.info,
- className: "info",
- icon: "info",
- accesskey: "i",
- },
- },
- })
- },
- _bindTaskBar = function () {
- $('<i class="taskBarMenu"></i>').appendTo("#rightMenu"),
- $.contextMenu({
- zIndex: 9999,
- selector: ".taskBarMenu",
- items: {
- quitOthers: {
- name: LNG.close_others,
- className: "quitOthers",
- icon: "remove-circle",
- accesskey: "o",
- },
- quit: {
- name: LNG.close,
- className: "quit",
- icon: "remove",
- accesskey: "q",
- },
- },
- callback: function (e, a) {
- var t = a.$trigger.attr("id"),
- i = art.dialog.list[t]
- switch (e) {
- case "quitOthers":
- $.each(art.dialog.list, function (e, a) {
- t != e && a.close()
- })
- break
- case "quit":
- i.close()
- }
- },
- })
- },
- _bindTask = function () {
- $.contextMenu({
- zIndex: 9999,
- selector: ".task_tab",
- items: {
- closeAll: {
- name: LNG.dialog_close_all,
- icon: "remove-circle",
- accesskey: "q",
- },
- showAll: {
- name: LNG.dialog_display_all,
- icon: "th-large",
- accesskey: "s",
- },
- hideAll: {
- name: LNG.dialog_min_all,
- icon: "remove",
- accesskey: "h",
- },
- },
- callback: function (e, a) {
- var t = a.$trigger.attr("id")
- switch ((art.dialog.list[t], e)) {
- case "showAll":
- $.each(art.dialog.list, function (e, a) {
- a.display(!0)
- })
- break
- case "hideAll":
- $.each(art.dialog.list, function (e, a) {
- a.display(!1)
- })
- break
- case "closeAll":
- $.each(art.dialog.list, function (e, a) {
- a.close()
- })
- break
- default:
- }
- },
- })
- },
- _bindDialog = function () {
- $('<i class="dialog_menu"></i>').appendTo("#rightMenu"),
- $.contextMenu({
- zIndex: 9999,
- selector: ".dialog_menu",
- items: {
- quit_dialog: {
- name: LNG.close,
- className: "quit_dialog",
- icon: "remove",
- accesskey: "q",
- },
- hide_dialog: {
- name: "最小化窗口",
- className: "hide_dialog",
- icon: "minus",
- accesskey: "h",
- },
- refresh: {
- name: "重载页面",
- className: "refresh",
- icon: "refresh",
- accesskey: "r",
- },
- open_window: {
- name: "在新标签中打开",
- className: "open_window",
- icon: "globe",
- accesskey: "b",
- },
- },
- callback: function (e, a) {
- var t = a.$trigger.attr("id"),
- i = art.dialog.list[t]
- switch (e) {
- case "quit_dialog":
- i.close()
- break
- case "hide_dialog":
- i.display(!1)
- break
- case "refresh":
- i.refresh()
- break
- case "open_window":
- i.open_window()
- break
- default:
- }
- },
- })
- },
- _menuTree = function (e) {
- switch (e) {
- case "edit":
- ui.tree.openEditor()
- break
- case "open":
- ui.tree.open()
- break
- case "refresh":
- ui.tree.refresh()
- break
- case "copy":
- ui.tree.copy()
- break
- case "cute":
- ui.tree.cute()
- break
- case "past":
- ui.tree.past()
- break
- case "clone":
- ui.tree.clone()
- break
- case "rname":
- ui.tree.rname()
- break
- case "remove":
- ui.tree.remove()
- break
- case "info":
- ui.tree.info()
- break
- case "download":
- ui.tree.download()
- break
- case "open_ie":
- ui.tree.openIE()
- break
- case "share":
- ui.tree.share()
- break
- case "search":
- ui.tree.search()
- break
- case "newfolder":
- ui.tree.create("folder")
- break
- case "newfile":
- ui.tree.create("file")
- break
- case "explorer":
- ui.tree.explorer()
- break
- case "openProject":
- ui.tree.openProject()
- break
- case "fav_page":
- core.setting("fav")
- break
- case "fav":
- ui.tree.fav()
- break
- case "fav_remove":
- ui.tree.fav_remove()
- break
- case "refresh_all":
- ui.tree.init()
- break
- case "quit":
- break
- default:
- }
- }
- return {
- initDesktop: _init_desktop,
- initExplorer: _init_explorer,
- initEditor: _init_editor,
- show: function (e, a, t) {
- e &&
- (rightMenu.hidden(),
- $(e).contextMenu({
- x: a,
- y: t,
- }))
- },
- menuShow: function () {
- var e = $(".context-menu-list").filter(":visible"),
- a = $(".context-menu-active")
- if (0 != e.length && 0 != a.length) {
- if ((e.find(".disable").addClass("disabled"), a.hasClass("menufile"))) {
- var t = fileLight.type(Global.fileListSelect)
- "zip" == t ? e.find(".unzip").show() : e.find(".unzip").hide(),
- inArray(core.filetype.image, t) ? e.find(".setBackground").show() : e.find(".setBackground").hide(),
- "oexe" == t ? e.find(".app_edit").show() : e.find(".app_edit").hide(),
- 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()
- }
- if (a.hasClass("dialog_menu")) {
- var i = a.attr("id"),
- n = art.dialog.list[i]
- n.has_frame() ? (e.find(".open_window").show(), e.find(".refresh").show()) : (e.find(".open_window").hide(), e.find(".refresh").hide())
- }
- if (a.hasClass("menuMore")) {
- var s = 0
- Global.fileListSelect.each(function () {
- var e = core.pathExt(fileLight.name($(this)))
- ;(inArray(core.filetype.music, e) || inArray(core.filetype.movie, e)) && (s += 1)
- }),
- 0 == s ? e.find(".playmedia").hide() : e.find(".playmedia").show()
- }
- }
- },
- menuCurrentPath: function (e) {
- var a = ".createLink,.createProject,.cute,.remove,.rname,.zip,.unzip,.newfile,.newfolder,.newfileOther,.app_create,.app_install,.past,.upload,.clone",
- t = "disable"
- "writeable" == e
- ? ($(".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"))
- : ($(".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"))
- },
- isDisplay: function () {
- var e = !1
- return (
- $(".context-menu-list").each(function () {
- "none" != $(this).css("display") && (e = !0)
- }),
- e
- )
- },
- hidden: function () {
- $(".context-menu-list").filter(":visible").trigger("contextmenu:hide")
- },
- }
- }),
- define("desktop/fileSelect", [], function () {
- var e = !1,
- a = !1,
- t = !1,
- i = function () {
- s(), n(), o()
- },
- n = function () {
- $(Config.FileBoxClass)
- .die("touchstart")
- .live("touchstart", function () {
- $(this).hasClass("select") ? ui.path.open() : (d.clear(), $(this).removeClass("select"), $(this).addClass("select"), d.select())
- }),
- $(Config.FileBoxClass)
- .live("mouseenter", function () {
- a && (($(this).hasClass(Config.TypeFolderClass) && !$(this).hasClass(Config.SelectClassName)) || $(this).hasClass("menuRecycleButton")) && $(this).addClass("selectDragTemp"),
- e || a || $(this).addClass(Config.HoverClassName),
- $(this)
- .unbind("mousedown")
- .mousedown(function (e) {
- if (
- (rightMenu.hidden(),
- e.ctrlKey || e.shiftKey || $(this).hasClass(Config.SelectClassName) || (d.clear(), $(this).addClass(Config.SelectClassName), d.select()),
- 3 != e.which || $(this).hasClass(Config.SelectClassName) || (d.clear(), $(this).addClass(Config.SelectClassName), d.select()),
- e.ctrlKey && ($(this).hasClass(Config.SelectClassName) ? (t = !0) : (d.setMenu($(this)), $(this).addClass(Config.SelectClassName)), d.select()),
- e.shiftKey)
- ) {
- var a = parseInt($(this).attr(Config.FileOrderAttr))
- if (0 == Global.fileListSelectNum) c(0, a)
- else {
- var i = parseInt(Global.fileListSelect.first().attr(Config.FileOrderAttr)),
- n = parseInt(Global.fileListSelect.last().attr(Config.FileOrderAttr))
- i > a ? c(a, i) : a > n ? c(n, a) : a > i && n > a && c(i, a)
- }
- }
- })
- })
- .die("mouseleave")
- .live("mouseleave", function () {
- $(this).removeClass(Config.HoverClassName), $(this).removeClass("selectDragTemp")
- })
- .die("click")
- .live("click", function (e) {
- 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())
- }),
- $(Config.FileBoxClass)
- .unbind("dblclick")
- .live("dblclick", function (e) {
- stopPP(e), e.altKey ? ui.path.pathInfo() : ui.path.open()
- }),
- $(Config.FileBoxTittleClass)
- .unbind("dblclick")
- .live("dblclick", function (e) {
- return ui.path.rname(), stopPP(e), !1
- })
- },
- s = function () {
- var t,
- i,
- n,
- s = 100,
- o = 50,
- r = 30,
- l = 80 - Global.topbar_height,
- c = 0,
- p = !1,
- u = 0,
- h = 0
- $(Config.FileBoxClass)
- .unbind("mousedown")
- .live("mousedown", function (a) {
- return Global.shiftKey
- ? void 0
- : ui.isEdit()
- ? !0
- : 1 != a.which || e
- ? !0
- : ((t = $(this)),
- f(a),
- this.setCapture && this.setCapture(),
- $(document).mousemove(function (e) {
- m(e)
- }),
- $(document).one("mouseup", function (e) {
- return v(e), this.releaseCapture && this.releaseCapture(), stopPP(e), !1
- }),
- stopPP(a),
- !1)
- })
- var f = function (e) {
- rightMenu.hidden(), (a = !0), (c = $.now()), (u = e.pageY), (h = e.pageX), (i = $(document).height()), (n = $(document).width())
- },
- m = function (e) {
- if (!a) return !0
- $.now() - c > s && !p && _()
- var t = e.clientX >= n - 50 ? n - 50 : e.clientX,
- r = e.clientY >= i - 50 ? i - 50 : e.clientY
- ;(t = 0 >= t ? 0 : t),
- (r = 0 >= r ? 0 : r),
- (t -= o),
- (r -= l),
- $(".draggable-dragging").css("left", t),
- $(".draggable-dragging").css("top", r),
- Global.isIE &&
- $("." + Config.TypeFolderClass + ",div.menuRecycleButton").each(function () {
- var a = e.pageX,
- t = e.pageY,
- i = $(this).offset(),
- n = $(this).width(),
- s = $(this).height()
- a > i.left && i.left + n > a && t > i.top && i.top + s > t ? $(this).addClass("selectDragTemp") : $(this).removeClass("selectDragTemp")
- })
- },
- v = function (e) {
- if (!a) return !1
- ;(a = !1),
- (p = !1),
- $("body").css("cursor", "auto"),
- $(".draggable-dragging").fadeOut(200, function () {
- $(this).remove()
- })
- var t = G.this_path,
- i = 0 == $(".selectDragTemp").length
- 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))
- },
- _ = function () {
- ;(p = !0),
- $("body").css("cursor", "move"),
- t.find(".ico").attr("filetype"),
- $('<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")
- }
- },
- o = function () {
- var t = null,
- i = null,
- n = null
- $(Config.BodyContent)
- .unbind("mousedown")
- .live("mousedown", function (e) {
- return ui.isEdit()
- ? !0
- : a || 1 != e.which
- ? !0
- : (s(e),
- this.setCapture && this.setCapture(),
- $(document)
- .unbind("mousemove")
- .mousemove(function (e) {
- o(e)
- }),
- $(document).one("mouseup", function (e) {
- r(e), (Global.isDragSelect = !0), this.releaseCapture && this.releaseCapture()
- }),
- stopPP(e),
- !1)
- })
- var s = function (a) {
- $(a.target).parent().hasClass(Config.FileBoxClassName) ||
- $(a.target).parent().parent().hasClass(Config.FileBoxClassName) ||
- $(a.target).hasClass("fix") ||
- (rightMenu.hidden(),
- a.ctrlKey || a.shiftKey || d.clear(),
- 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)))
- },
- o = function (a) {
- if (!e) return !0
- "none" == n.css("display") && n.css("display", "")
- var s = a.pageX,
- o = a.pageY - Global.topbar_height
- n.css({
- left: Math.min(s, t),
- top: Math.min(o, i),
- width: Math.abs(s - t),
- height: Math.abs(o - i),
- })
- 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++) {
- var f = Global.fileListAll[h],
- m = $(Global.fileListAll[h]),
- v = f.offsetWidth + f.offsetLeft,
- _ = f.offsetHeight + f.offsetTop
- if (v > r && _ > l && r + c > f.offsetLeft && l + p > f.offsetTop) {
- if (!m.hasClass("selectDragTemp")) {
- if (m.hasClass("selectToggleClass")) continue
- if (m.hasClass(Config.SelectClassName)) {
- m.removeClass(Config.SelectClassName).addClass("selectToggleClass"), d.resumeMenu(m)
- continue
- }
- m.addClass("selectDragTemp")
- }
- } else m.removeClass("selectDragTemp"), m.hasClass("selectToggleClass") && m.addClass(Config.SelectClassName).removeClass("selectToggleClass")
- }
- },
- r = function () {
- 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
- }
- },
- r = function (e) {
- var a = 0,
- t = Global.fileListSelect
- Global.fileListSelectNum
- var i = Global.fileListNum,
- n = function () {
- var n = Global.fileRowNum
- if (1 == Global.fileListSelectNum) {
- var s = parseInt(t.attr(Config.FileOrderAttr))
- switch (e) {
- case "up":
- a = 0 >= s ? s : s - 1
- break
- case "left":
- a = n > s ? 0 : s - n
- break
- case "down":
- a = s >= i - 1 ? s : s + 1
- break
- case "right":
- a = s + n >= i - 1 ? i - 1 : s + n
- break
- default:
- }
- } else if (Global.fileListSelectNum > 1) {
- var o = parseInt(t.first().attr(Config.FileOrderAttr)),
- r = parseInt(t.last().attr(Config.FileOrderAttr))
- switch (e) {
- case "up":
- a = a = 0 >= o ? o : o - 1
- break
- case "left":
- break
- case "down":
- a = r >= i ? r : r + 1
- break
- case "right":
- a = r + n >= i ? r : r + n
- break
- default:
- }
- }
- }
- return n(), Global.fileListAll.eq(a)
- },
- l = function (e) {
- var a
- switch (e) {
- case "home":
- a = Global.fileListAll.first()
- break
- case "end":
- a = Global.fileListAll.last()
- break
- case "left":
- case "up":
- case "right":
- case "down":
- a = r(e)
- break
- case "all":
- a = Global.fileListAll
- break
- default:
- }
- d.clear(), a.addClass(Config.SelectClassName), d.select()
- },
- c = function (e, a) {
- d.clear()
- for (var t = e; a >= t; t++) $(Global.fileListAll[t]).addClass(Config.SelectClassName)
- d.select()
- },
- d = {
- init: function () {
- var e = $(Config.FileBoxClass)
- e.each(function (e) {
- $(this).attr(Config.FileOrderAttr, e)
- }),
- (Global.fileListSelect = ""),
- (Global.fileListAll = e),
- (Global.fileListNum = e.length),
- (Global.fileListSelectNum = 0)
- },
- select: function () {
- var e = $(Config.SelectClass)
- ;(Global.fileListSelect = e), (Global.fileListSelectNum = e.length), e.length > 1 && d.setMenu(e)
- },
- setInView: function () {},
- name: function (e) {
- return e.attr("data-name")
- },
- type: function (e) {
- return e.find(".ico").attr("filetype")
- },
- setMenu: function (e) {
- e.removeClass("menufile menufolder menuDefault").addClass("menuMore")
- },
- resumeMenu: function (e) {
- var a = {
- fileBox: "menufile",
- folderBox: "menufolder",
- systemBox: "menuDefault",
- }
- for (var t in a) e.hasClass(t) && e.removeClass("menuMore").addClass(a[t])
- $(".menuRecycleButton").removeClass("menuDefault")
- },
- getAllName: function () {
- var e = []
- if (0 != Global.fileListSelectNum) {
- var a = Global.fileListSelect
- return (
- a.each(function () {
- e.push(d.name($(this)))
- }),
- e
- )
- }
- },
- clear: function () {
- if (0 != Global.fileListSelectNum) {
- var e = Global.fileListSelect
- e.removeClass(Config.SelectClassName),
- e.each(function () {
- d.resumeMenu($(this))
- }),
- (Global.fileListSelect = ""),
- (Global.fileListSelectNum = 0)
- }
- },
- }
- return {
- init: i,
- fileLight: d,
- selectPos: l,
- }
- }),
- define("desktop/ui", [], function () {
- var e = new Picasa()
- PicasaOpen = !1
- var a = function () {
- fileLight.init(), ui.setStyle(), (PicasaOpen = !1), e.initData()
- },
- t = function (e, a) {
- var a = "down" == a ? -1 : 1
- return function (t, i) {
- return (t = t[e]), (i = i[e]), i > t ? -1 * a : t > i ? 1 * a : void 0
- }
- },
- i = function (e, a) {
- 0 != e && ((G.sort_field = e), $(".menu_set_sort").removeClass("selected"), $(".set_sort_" + e).addClass("selected")),
- 0 != a && ((G.sort_order = a), $(".menu_set_desc").removeClass("selected"), $(".set_sort_" + a).addClass("selected")),
- r(!1, !0),
- ajax({
- url: "index.html?setting/set&k=list_sort_field,list_sort_order&v=" + G.sort_field + "," + G.sort_order,
- })
- },
- n = function () {
- var e = 91
- ;(Global.ctrlKey = !1),
- $(document)
- .keydown(function (a) {
- if ("none" != $("#PicasaView").css("display")) return !0
- if (ui.isEdit()) return !0
- if (rightMenu.isDisplay()) return !0
- var t = !1
- if (Global.ctrlKey || a.keyCode == e || a.ctrlKey)
- switch (((t = !0), (Global.ctrlKey = !0), a.keyCode)) {
- case 8:
- ui.path.remove(), (t = !0)
- break
- case 65:
- fileSelect.selectPos("all")
- break
- case 67:
- ui.path.copy()
- break
- case 88:
- ui.path.cute()
- break
- case 83:
- break
- case 86:
- ui.path.past()
- break
- case 70:
- core.search($(".header-right input").val(), G.this_path)
- break
- default:
- t = !1
- }
- else if (a.shiftKey) Global.shiftKey = !0
- else
- switch (a.keyCode) {
- case 8:
- t = !0
- break
- case 35:
- fileSelect.selectPos("end")
- break
- case 36:
- fileSelect.selectPos("home")
- break
- case 37:
- fileSelect.selectPos("left"), (t = !0)
- break
- case 38:
- fileSelect.selectPos("up")
- break
- case 39:
- fileSelect.selectPos("right"), (t = !0)
- break
- case 40:
- fileSelect.selectPos("down")
- break
- case 13:
- ui.path.open(), (t = !1)
- break
- case 46:
- ui.path.remove(), (t = !0)
- break
- case 113:
- ui.path.rname(), (t = !0)
- break
- default:
- t = !1
- }
- return t && (stopPP(a), (a.keyCode = 0), (a.returnValue = !1)), !0
- })
- .keyup(function (a) {
- a.shiftKey && (Global.shiftKey = !1), (a.keyCode != e && a.ctrlKey) || (Global.ctrlKey = !1)
- })
- },
- autoIconArr = function () {
- var marginBottom = 10,
- marginLeft = 10,
- iconWidth = 85,
- iconHeight = 100,
- marginRight = 10,
- winHeight = $(document).height() - 50,
- maxColNum = Math.floor((winHeight - marginBottom) / (iconHeight + marginRight)),
- colNum = 0,
- rowNum = 0,
- left = 0,
- top = 0
- $(".fileContiner .file").css("position", "absolute"),
- $(".fileContiner .file").each(function (index) {
- ;(colNum = index % maxColNum),
- (rowNum = Math.floor(index / maxColNum)),
- (left = marginLeft + (iconWidth + marginRight) * rowNum),
- (top = marginBottom + (iconHeight + marginRight) * colNum),
- $(this).css({
- left: left,
- top: top,
- })
- //console.log(left + "," + top);
- })
- }
- ;(this._hover_title = function (e) {
- return (
- void 0 == e.size_friendly && (e.size_friendly = "0B"),
- ' data-name="' + e.title + '" title="' + LNG.name + ":" + e.title + " " /*LNG.size + ":" + e.size_friendly + " " + LNG.permission + ":" + e.mode + " " + LNG.modify_time + ":" + e.mtime + */ + LNG.app_desc + ":" + e.description + '" '
- )
- }),
- (this._getFolderBox = function (e) {
- var a = "<div class='file folderBox menufolder' " + _hover_title(e) + ">"
- return (a += "<div class='folder ico' filetype='folder'></div>"), (a += "<div id='" + e.name + "' class='titleBox'><span class='title'" + e.name + "</span></div></div>")
- }),
- (this._getFileBox = function (e) {
- var a = ""
- if (e.icon == null || e.icon == undefined || e.icon == "") {
- e.icon = "oexe.png"
- }
- if (void 0 != e.icon) {
- var t = e.icon
- ;-1 == e.icon.search(G.static_path) && "http" != e.icon.substring(0, 4) && (t = "" + "/" + "images/app/" + e.icon)
- var i = JSON.stringify(e) /*urlEncode(json_encode(e))*/,
- n = e.title //.replace(".oexe", "");
- ;(a = "<div data-id='app_" + e.id + "' class='file fileBox menufile' data-app='" + i + "'" + _hover_title(e) + ">"),
- "app_link" == e.type
- ? ((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>'))
- : (a += "<div class='ico' filetype='oexe' style='background-image:url(" + t + ");background-size: cover;'></div>"),
- (a += "<div id='title_" + e.id + "' class='titleBox'><span class='title'>" + n + "</span></div></div>")
- } /*else if (inArray(core.filetype.image, e.ext)) {
- var s = core.path2url(G.this_path + e.name),
- o = "index.html?explorer/image&path=" + urlEncode(G.this_path + e.name);
- a += "<div class='file fileBox menufile'" + _hover_title(e) + ">",
- 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>",
- a += "<div id='" + e.name + "' class='titleBox'><span class='title' title='" + LNG.double_click_rename + "'>" + e.title + "</span></div></div>"
- }*/ 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>")
- return a
- })
- var appendToUI = function (e) {
- var i = "",
- n = G.json_data.folderlist,
- o = G.json_data.filelist
- ;(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)
- for (var r = "", l = "", c = 0; o.length > c; c++) r += this._getFileBox(o[c])
- for (var c = 0; n.length > c; c++) l += this._getFolderBox(n[c])
- i += "up" == G.sort_order ? l + r : r + l
- var d = ""
- $(".systemBox").each(function () {
- d += $(this).get(0).outerHTML
- }),
- (i = d + i),
- (i += "<div style='clear:both'></div>"),
- e ? $(Config.FileBoxSelector).hide().html(i).fadeIn(Config.AnimateTime) : $(Config.FileBoxSelector).html(i),
- a(),
- autoIconArr()
- },
- appendToStartMenu = function (d) {
- $("#menuwin #programs .apps").empty()
- var d = G.json_data.filelist
- for (var o in d) {
- if (d[o].title == undefined) {
- continue
- }
- var i = $('<li data-id="app_' + d[o].id + '"></li>')
- 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>")
- .click(function () {
- core.openApp(eval("(" + $(this).attr("data-app") + ")"))
- })
- .appendTo(i)
- $("#menuwin #programs .apps").append(i)
- }
- },
- r = function (e, a, t) {
- $(".fileContiner").hide()
- if ((void 0 == e && (e = !0), void 0 == a && (a = !1), e))
- ajax({
- url: "/web/desktop/my/app/getList.json",
- dataType: "json",
- error: function (e) {
- core.tips.tips(e.msg)
- },
- success: function (e) {
- $(".init_loading").fadeOut(450).addClass("pop_fadeout")
- $(".fileContiner").fadeIn()
- if (e.status == 1) {
- if (e.data == null || e.data.length == 0) {
- return
- }
- return (
- (G.json_data = {
- folderlist: [],
- filelist: e.data,
- }),
- formattime(),
- appendToUI(a),
- appendToStartMenu(a),
- "function" == typeof t && t(e),
- void 0
- )
- } else {
- return core.tips.tips(e.msg), $(Config.FileBoxSelector).html(""), !1
- }
- },
- })
- // ajax({
- // url: "/datas/explorer/pathListRecycle.jsonp?type=desktop&path=*recycle*/",
- // dataType: "json",
- // error: core.ajaxError,
- // success: function(e) {
- // if (!e.code) return ! 1;
- // var a = "" + "images/recycle_full.png";
- // if (0 == e.data.folderlist.length && 0 == e.data.filelist.length) var a = "" + "images/recycle.png";
- // $(".menuRecycleButton .ico").css("background-image", 'url("' + a + '")')
- // }
- // });
- else {
- var i = fileLight.getAllName()
- o(a), ui.path.setSelectByFilename(i)
- }
- },
- l = function (e) {
- r(!0, !1, e)
- },
- formattime = function () {
- for (var e = 0; G.json_data.filelist.length > e; e++)
- (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))
- for (var e = 0; G.json_data.folderlist.length > e; e++)
- (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))
- }
- return {
- autoIconArr: autoIconArr,
- f5: r,
- f5_callback: l,
- picasa: e,
- setListSort: i,
- sort_list: autoIconArr,
- logout: function () {
- MaskView.tips("<font style='font-size:24px;'>正在注销用户信息,请稍候...</font>")
- ajax({
- url: "/system/logout.json",
- success: function (data) {
- if (data.data.loginHost) {
- window.location = data.data.loginHost
- MaskView.tips("<font style='font-size:24px;'>注销成功</font>")
- }
- MaskView.close()
- },
- })
- },
- toFullScreen: function () {
- //打开或关闭全屏模式
- var n = document.documentElement
- n.requestFullscreen ? n.requestFullscreen() : n.mozRequestFullScreen ? n.mozRequestFullScreen() : n.webkitRequestFullscreen ? n.webkitRequestFullscreen() : n.msRequestFullscreen && n.msRequestFullscreen()
- },
- init: function () {
- var p = template.compile($("#desktop-template").html())
- $("#desktop-box").html(p({ G: G, LNG: LNG, AUTH: AUTH, data: {} }))
- $(".desktop .start").css({
- background: 'rgba(0, 0, 0, .5) url("' + "/images/desktop/" + (AUTH.site ? AUTH.site.domain : "") + ".start.png" + '") center no-repeat',
- })
- $("#menuwin #logo .icon").css({
- background: 'rgba(0, 0, 0, .5) url("' + "/images/desktop/" + (AUTH.site ? AUTH.site.domain : "") + ".start.png" + '") no-repeat',
- "background-size": "cover",
- })
- var cid = $.query.get("auth_cid")
- $("#toClassicBtn").attr("href", "/classic.html" + (cid ? "?auth_cid=" + cid : ""))
- // toFullScreen();
- var cid = $.query.get("auth_cid")
- if (!(cid == null || cid == "") && G.is_root != 1) {
- $("#desktop-box .fileContiner").empty()
- }
- $(".hidden").removeClass("hidden"),
- autoIconArr(),
- l(),
- n(),
- $(window).bind("resize", function () {
- ui.setStyle(), 0 != PicasaOpen && e.setFrameResize(), autoIconArr()
- }),
- $("html")
- .die("click")
- .live("click", function () {
- rightMenu.hidden(), Global.isIE && Global.isDragSelect
- }),
- Mousetrap.bind(["ctrl+s", "command+s"], function (e) {
- e.preventDefault(), FrameCall.top("OpenopenEditor", "Editor.save", "")
- })
- var a,
- t = 0,
- i = "",
- o = 200
- Mousetrap.bind(
- [
- "1",
- "2",
- "3",
- "4",
- "5",
- "6",
- "7",
- "8",
- "9",
- "0",
- "`",
- "~",
- "!",
- "@",
- "#",
- "$",
- "%",
- "^",
- "&",
- "*",
- "(",
- ")",
- "-",
- "_",
- "=",
- "+",
- "[",
- "{",
- "]",
- "}",
- "|",
- "/",
- "?",
- ".",
- ">",
- ",",
- "<",
- "a",
- "b",
- "c",
- "d",
- "e",
- "f",
- "g",
- "h",
- "i",
- "j",
- "k",
- "l",
- "m",
- "n",
- "o",
- "p",
- "q",
- "r",
- "s",
- "t",
- "u",
- "v",
- "w",
- "x",
- "y",
- "z",
- ],
- function (e) {
- var n = String.fromCharCode(e.charCode)
- return 0 == t
- ? ((t = time()),
- (i = n),
- (a = setTimeout(function () {
- ui.path.setSelectByChar(i), (t = 0)
- }, o)),
- void 0)
- : n == i.substr(-1)
- ? (ui.path.setSelectByChar(i), (t = 0), void 0)
- : (o > time() - t &&
- ((t = time()),
- (i += n),
- clearTimeout(a),
- (a = setTimeout(function () {
- ui.path.setSelectByChar(i), (t = 0)
- }, o))),
- void 0)
- }
- ),
- Mousetrap.bind(["f5"], function (e) {
- stopPP(e), ui.f5(!0, !0)
- }),
- Mousetrap.bind(["ctrl+u", "command+u"], function (e) {
- stopPP(e), core.upload()
- }),
- Mousetrap.bind(["ctrl+e", "command+e"], function (e) {
- stopPP(e), ui.path.openEditor()
- }),
- Mousetrap.bind(["alt+i", "alt+i"], function (e) {
- stopPP(e), ui.path.info()
- }),
- Mousetrap.bind(["alt+n", "alt+n"], function (e) {
- stopPP(e), ui.path.newFile()
- }),
- Mousetrap.bind(["alt+m", "alt+m"], function (e) {
- stopPP(e), ui.path.newFolder()
- }),
- (PicasaOpen = !1),
- e.init(".picasaImage"),
- e.initData()
- },
- getMyApps: function () {
- return G.json_data ? G.json_data : { filelist: [] }
- },
- setTheme: function (e) {
- core.setSkin(e, "desktop.css"), FrameCall.top("OpenopenEditor", "Editor.setTheme", '"' + e + '"'), FrameCall.top("Opensetting_mode", "Setting.setThemeSelf", '"' + e + '"'), FrameCall.father("ui.setTheme", '"' + e + '"')
- },
- setWall: function (e) {
- $(".wallbackground")
- .attr("src", e)
- .one("load", function () {
- $(".desktop").css("background-image", "url(" + e + ")")
- })
- },
- isEdit: function () {
- var e = $(document.activeElement).get(0)
- if (e) return (e = e.tagName), "INPUT" == e || "TEXTAREA" == e ? !0 : !1
- },
- setStyle: function () {
- Global.fileRowNum = (function () {
- var e = $(Config.FileBoxSelector).width(),
- 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"))
- return parseInt(e / a)
- })()
- },
- }
- }),
- define(
- "desktop/path",
- [
- /*"desktop/pathOperate", "desktop/pathOpen"*/
- ],
- function (e) {
- var a = e("desktop/pathOperate"),
- t = e("desktop/pathOpen"),
- n = void 0
- ui.pathOpen = t
- var s = function (e, a, t) {
- if (void 0 != e) {
- if ("explorer" != Config.pageApp) return core.explorer(e), void 0
- if (e == G.this_path) return void 0 != a && "" != a && core.tips.tips(LNG.path_is_current, "info"), void 0
- 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)) {
- var i = "hidden" == $(".dialog_file_upload").css("visibility")
- core.upload(), i && $(".dialog_file_upload").css("visibility", "hidden")
- }
- ui.f5_callback(function () {
- "function" == typeof t && t()
- })
- }
- },
- o = function (e, a) {
- var t,
- i,
- n = 0,
- s = G.json_data.folderlist,
- o = G.json_data.filelist
- if (("desktop" == Config.pageApp && (n = $(".menuDefault").length), "folder" == a)) {
- for (t = 0; s.length > t && !(s[t].name >= e); t++);
- return "up" == G.sort_order ? t + n : o.length + t + n
- }
- if ("file" == a) {
- for (i = 0; o.length > i && !(o[i].name >= e); i++);
- return "down" == G.sort_order ? i + n : s.length + i + n
- }
- return -1
- },
- r = function (e) {
- void 0 != e &&
- ("string" == typeof e && (e = [e]),
- fileLight.clear(),
- $(".fileContiner .file").each(function (a) {
- var t = fileLight.name($(this))
- ;-1 != $.inArray(t, e) && $(Global.fileListAll).eq(a).addClass(Config.SelectClassName)
- }),
- fileLight.select(),
- fileLight.setInView())
- },
- l = function (e) {
- if ("" != e) {
- if (((e = e.toLowerCase()), void 0 == n || G.this_path != n.path || e != n.key)) {
- var a = []
- $(".fileContiner .file").each(function () {
- var t = fileLight.name($(this))
- t && e == t.substring(0, e.length).toLowerCase() && a.push(t)
- }),
- (n = {
- key: e,
- path: G.this_path,
- index: 0,
- list: a,
- })
- }
- 0 != n.list.length && (r(n.list[n.index++]), n.index == n.list.length && (n.index = 0))
- }
- },
- c = function (e) {
- return "" == e
- ? (fileLight.clear(), void 0)
- : (fileLight.clear(),
- $(".fileContiner .file").each(function (a) {
- var t = fileLight.name($(this))
- ;-1 != t.toLowerCase().indexOf(e) && $(Global.fileListAll).eq(a).addClass(Config.SelectClassName)
- }),
- fileLight.select(),
- fileLight.setInView(),
- void 0)
- },
- d = function (e, a, t) {
- var n = e.length
- for (i = 0; n > i; i++) if (e[i][a] == t) return e[i]
- },
- p = function (e) {
- var a = "",
- t = 0
- 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
- },
- u = function (e, a) {
- var t,
- i = 0
- if (void 0 == a) {
- if (!p(e)) return e
- for (t = e + "(0)"; p(t); ) i++, (t = e + "(" + i + ")")
- return t
- }
- if (!p(e + "." + a)) return e + "." + a
- for (t = e + "(0)." + a; p(t); ) i++, (t = e + "(" + i + ")." + a)
- return t
- },
- h = function () {
- ajax({
- dataType: "json",
- url: "index.html?explorer/historyBack",
- beforeSend: function () {
- $(".tools-left .msg").stop(!0, !0).fadeIn(100)
- },
- error: core.ajaxError,
- success: function (e) {
- return (
- $(".tools-left .msg").fadeOut(100),
- 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)
- )
- },
- })
- },
- f = function () {
- ajax({
- dataType: "json",
- url: "index.html?explorer/historyNext",
- beforeSend: function () {
- $(".tools-left .msg").stop(!0, !0).fadeIn(100)
- },
- error: core.ajaxError,
- success: function (e) {
- return (
- $(".tools-left .msg").fadeOut(100),
- 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)
- )
- },
- })
- },
- m = function (e) {
- fileLight.clear(), void 0 == e && (e = "txt")
- var t = "newfile",
- t = u(t, e),
- i = o(t, "file")
- i = 0 == i ? -1 : i - 1
- var n =
- '<div class="file select menufile" id="makefile"> <div class="' +
- e +
- ' ico"></div> <div class="titleBox"> <span class="title"> <div class="textarea"> <textarea class="newfile fix">' +
- t +
- '</textarea> </span> </div> </div> <div style="clear:both;"></div> </div>'
- ;-1 == i ? $(Config.FileBoxSelector).html(n + $(Config.FileBoxSelector).html()) : $(n).insertAfter(Config.FileBoxSelector + " .file:eq(" + i + ")"), "desktop" == Config.pageApp && ui.sort_list()
- var s = $(".newfile"),
- l = s.get(0),
- c = t.length - e.length - 1
- if (Global.isIE) {
- var d = l.createTextRange()
- d.moveEnd("character", -l.value.length), d.moveEnd("character", c), d.moveStart("character", 0), d.select()
- } else l.setSelectionRange(0, c)
- s.focus(),
- s.unbind("keydown").keydown(function (e) {
- return (
- (13 == e.keyCode || 27 == e.keyCode) &&
- (stopPP(e),
- e.preventDefault(),
- (filename = s.attr("value")),
- p(filename)
- ? ($("#makefile").remove(), core.tips.tips(LNG.path_exists, "warning"))
- : a.newFile(G.this_path + filename, function () {
- ui.f5_callback(function () {
- r(filename)
- })
- })),
- !0
- )
- }),
- s.unbind("blur").blur(function () {
- ;(filename = s.attr("value")),
- p(filename)
- ? ($("#makefile").remove(), core.tips.tips(LNG.path_exists, "warning"), _newFile(e))
- : a.newFile(G.this_path + filename, function () {
- ui.f5_callback(function () {
- r(filename)
- })
- })
- })
- },
- v = function () {
- fileLight.clear()
- var e = LNG.newfolder,
- e = u(e),
- t = o(e, "folder")
- t = 0 == t ? -1 : t - 1
- var i = '<div class="file select menufolder" id="makefile">'
- ;(i += '<div class="folder ico" filetype="folder"></div>'),
- (i += '<div class="titleBox"><span class="title">'),
- (i += '<div class="textarea"><textarea class="newfile fix">' + e + '</textarea></span></div></div><div style="clear:both;"></div></div>'),
- -1 == t ? $(Config.FileBoxSelector).html(i + $(Config.FileBoxSelector).html()) : $(i).insertAfter(Config.FileBoxSelector + " .file:eq(" + t + ")"),
- "desktop" == Config.pageApp && ui.sort_list(),
- $(".newfile").select(),
- $(".newfile").focus(),
- $(".newfile")
- .unbind("keydown")
- .keydown(function (e) {
- if (13 == e.keyCode || 27 == e.keyCode) {
- stopPP(e), e.preventDefault()
- var t = $(".newfile").attr("value")
- p(t)
- ? ($("#makefile").remove(), core.tips.tips(LNG.path_exists, "warning"))
- : a.newFolder(G.this_path + t, function () {
- "explorer" == Config.pageApp && ui.tree.checkIfChange(G.this_path),
- ui.f5_callback(function () {
- r(t)
- })
- })
- }
- }),
- $(".newfile")
- .unbind("blur")
- .blur(function () {
- ;(filename = $(".newfile").attr("value")),
- p(filename)
- ? ($("#makefile").remove(), core.tips.tips(LNG.path_exists, "warning"), _newFolder())
- : a.newFolder(G.this_path + filename, function () {
- "explorer" == Config.pageApp && ui.tree.checkIfChange(G.this_path),
- ui.f5_callback(function () {
- r(filename)
- })
- })
- })
- },
- _ = function () {
- var e = "",
- t = "",
- i = Global.fileListSelect,
- n = fileLight.name(i),
- s = fileLight.type(i)
- if (1 == i.length) {
- if (i.hasClass("menuSharePath")) return ui.path.share_edit(), void 0
- ;(s = "folder" == s ? "folder" : s),
- $(i)
- .find(".title")
- .html("<div class='textarea'><textarea class='fix' id='pathRenameTextarea'>" + $(i).find(".title").text() + "</textarea><div>")
- var o = $("#pathRenameTextarea"),
- l = o.get(0)
- if ("folder" == s) o.select()
- else {
- var c = n.length - s.length - 1
- if (Global.isIE) {
- var d = l.createTextRange()
- d.moveEnd("character", -l.value.length), d.moveEnd("character", c), d.moveStart("character", 0), d.select()
- } else l.setSelectionRange(0, c)
- }
- o.unbind("focus").focus(),
- o.keydown(function (l) {
- if (13 == l.keyCode) {
- l.preventDefault(), stopPP(l), (e = o.attr("value")), "oexe" == s && (e += ".oexe")
- var c = e
- e != n
- ? ((t = urlEncode(G.this_path + n)),
- (e = urlEncode(G.this_path + e)),
- a.rname(t, e, function () {
- "explorer" == Config.pageApp && ui.tree.checkIfChange(G.this_path),
- ui.f5_callback(function () {
- r(c)
- })
- }))
- : ("oexe" == s && (n = n.replace(".oexe", "")), $(i).find(".title").html(n))
- }
- 27 == l.keyCode && ("oexe" == s && (n = n.replace(".oexe", "")), $(i).find(".title").html(n))
- }),
- o.unbind("blur").blur(function () {
- ;(e = $("#pathRenameTextarea").attr("value")), "oexe" == s && (e += ".oexe")
- var o = e
- e != n
- ? ((t = urlEncode(G.this_path + n)),
- (e = urlEncode(G.this_path + e)),
- a.rname(t, e, function () {
- "explorer" == Config.pageApp && ui.tree.checkIfChange(G.this_path),
- ui.f5_callback(function () {
- r(o)
- })
- }))
- : ("oexe" == s && (n = n.replace(".oexe", "")), $(i).find(".title").html(n))
- })
- }
- },
- g = function () {
- ui.f5(), "explorer" == Config.pageApp && ui.tree.checkIfChange(G.this_path)
- },
- y = function (e) {
- if (e) {
- var a = []
- return 0 == Global.fileListSelect.length
- ? a
- : (Global.fileListSelect.each(function () {
- var e = G.this_path + fileLight.name($(this)),
- app = eval("(" + $(this).attr("data-app") + ")")
- // t = "folder" == fileLight.type($(this)) ? "folder": "file";
- // "*share*/" == G.this_path && (e = $(this).attr("data-path"), t = "share"),
- a.push(app)
- }),
- a)
- }
- if (1 != Global.fileListSelectNum)
- return {
- path: "",
- type: "",
- }
- var t = Global.fileListSelect,
- i = G.this_path + fileLight.name(t),
- n = fileLight.type(t)
- return (
- "*share*/" == G.this_path && ((i = t.attr("data-path")), (n = "share")),
- {
- path: i,
- type: n,
- }
- )
- }
- // return {};
- return {
- appEdit: function (e) {
- if (e) a.appEdit(0, 0, "add")
- else {
- var t = Global.fileListSelect.attr("data-app"),
- i = json_decode(urlDecode(t))
- ;(i.path = G.this_path + fileLight.name(Global.fileListSelect)), a.appEdit(i)
- }
- },
- appList: function () {
- a.appList(y().path)
- },
- appInstall: function () {
- a.appInstall(y().path)
- },
- openEditor: function () {
- t.openEditor(y().path)
- },
- openIE: function () {
- t.openIE(y().path)
- },
- open: function (e) {
- if (0 != y().path.length) {
- if ("*recycle*/" == G.this_path) return ui.path.info(), void 0
- if ("*share*/" == G.this_path) return ui.path.share_open_window(), void 0
- if (void 0 != e) return t.open(e), void 0
- var a = y(),
- i = Global.fileListSelect
- if (inArray(core.filetype.image, a.type)) {
- if (!core.authCheck("explorer:fileDownload", LNG.no_permission_download)) return
- return "icon" == G.list_type || "desktop" == Config.pageApp ? ui.picasa.play($(i).find(".ico")) : ui.picasa.play($(i)), void 0
- }
- if ("oexe" == a.type) {
- var n = i.attr("data-app")
- a.path = json_decode(urlDecode(n))
- }
- t.open(a.path, a.type)
- }
- },
- // play: function() {
- // if (! (1 > Global.fileListSelectNum)) {
- // var e = [];
- // Global.fileListSelect.each(function() {
- // var a = fileLight.type($(this));
- // if (inArray(core.filetype.music, a) || inArray(core.filetype.movie, a)) {
- // var t = core.path2url(G.this_path + fileLight.name($(this)));
- // e.push(t)
- // }
- // }),
- // t.play(e, "music")
- // }
- // },
- pathOperate: a,
- // share: function() {
- // a.share(y())
- // },
- // setBackground: function() {
- // a.setBackground(y().path)
- // },
- // createLink: function() {
- // a.createLink(y().path, y().type,
- // function(e) {
- // ui.f5_callback(function() {
- // r(e.info)
- // })
- // })
- // },
- // createProject: function() {
- // a.createProject(y().path,
- // function(e) {
- // ui.f5_callback(function() {
- // r(e.info)
- // })
- // })
- // },
- // download: function() {
- // var e = y(!0);
- // 1 == e.length && "file" == e[0].type ? t.download(y().path) : a.zipDownload(e)
- // },
- // share_edit: function() {
- // var e = y().path,
- // t = G.json_data.share_list[e];
- // a.share_box(t)
- // },
- // share_open_window: function() {
- // var e = y().path,
- // a = G.json_data.share_list[e],
- // t = a.type;
- // "folder" == a.type && (t = 1 == a.code_read ? "code_read": "folder");
- // var i = "index.html?share/" + t + "&user=" + G.user_name + "&sid=" + a.sid;
- // window.open(i)
- // },
- // share_open_path: function() {
- // var e = y().path,
- // a = G.json_data.share_list[e],
- // t = core.pathFather(a.path),
- // i = core.pathThis(a.path);
- // ui.path.list(t, "",
- // function() {
- // r(i)
- // })
- // },
- // recycle_clear: function() {
- // $.dialog({
- // id: "dialog_path_remove",
- // fixed: !0,
- // icon: "question",
- // title: LNG.remove_title,
- // padding: 40,
- // lock: !0,
- // background: "#000",
- // opacity: .2,
- // content: LNG.recycle_clear_info,
- // ok: function() {
- // ajax({
- // url: "index.html?explorer/pathDeleteRecycle",
- // beforeSend: function() {
- // core.tips.loading()
- // },
- // error: core.ajaxError,
- // success: function(e) {
- // core.tips.close(e),
- // ui.f5(),
- // FrameCall.father("ui.f5", "1,1"),
- // "function" == typeof callback && callback(e)
- // }
- // })
- // },
- // cancel: !0
- // })
- // },
- // explorer: function() {
- // core.explorer(y().path)
- // },
- // explorerNew: function() {
- // window.open("index.html?/explorer&path=" + y().path)
- // },
- // openProject: function() {
- // core.explorerCode(y().path)
- // },
- // search: function() {
- // core.search("", y().path)
- // },
- // fav: function() {
- // a.fav(y().path)
- // },
- remove: function () {
- a.remove(y(!0), g), fileLight.clear()
- },
- // copy: function() {
- // a.copy(y(!0))
- // },
- // cute: function() {
- // a.cute(y(!0), ui.f5)
- // },
- // zip: function() {
- // a.zip(y(!0),
- // function(e) {
- // ui.f5_callback(function() {
- // r(e.info)
- // })
- // })
- // },
- // unZip: function() {
- // a.unZip(y().path, ui.f5)
- // },
- // cuteDrag: function(e) {
- // a.cuteDrag(y(!0), e, g)
- // },
- // copyDrag: function(e, t) {
- // a.copyDrag(y(!0), e,
- // function(e) {
- // fileLight.clear(),
- // "explorer" == Config.pageApp && ui.tree.checkIfChange(G.this_path),
- // ui.f5_callback(function() {
- // t && e.data && r(e.data)
- // })
- // })
- // },
- // info: function() {
- // if ("share" == y().type) {
- // var e = y().path,
- // t = G.json_data.share_list[e],
- // i = t.path;
- // a.info([{
- // path: i,
- // type: t.type
- // }])
- // } else a.info(y(!0))
- // },
- // past: function() {
- // fileLight.clear(),
- // a.past(G.this_path,
- // function(e) {
- // "explorer" == Config.pageApp && ui.tree.checkIfChange(G.this_path),
- // ui.f5_callback(function() {
- // r(e)
- // })
- // })
- // },
- // back: h,
- // next: f,
- // list: s,
- // newFile: m,
- // newFolder: v,
- // rname: _
- // setSearchByStr: c,
- // setSelectByChar: l,
- // setSelectByFilename: r,
- // clipboard: a.clipboard
- }
- }
- ),
- define("desktop/pathOperate", [], function (e) {
- var a = {}
- ;(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"))
- var t = ["/", "\\", ":", "*", "?", '"', "<", ">", "|"],
- i = function (e) {
- var a = function (e, a) {
- for (var t = a.length, i = 0; t > i; i++) if (e.indexOf(a[i]) > 0) return !0
- return !1
- }
- return a(e, t) ? (core.tips.tips(LNG.path_not_allow + ':/ : * ? " < > |', !1), !1) : !0
- },
- n = function (e) {
- 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 += ",")
- return a + "]"
- },
- s = function (e, a) {
- if (e) {
- var t = core.pathThis(e)
- return i(t)
- ? (ajax({
- dataType: "json",
- url: "index.html?explorer/mkfile&path=" + urlEncode2(e),
- beforeSend: function () {
- core.tips.loading()
- },
- error: core.ajaxError,
- success: function (e) {
- core.tips.close(e), "function" == typeof a && a(e)
- },
- }),
- void 0)
- : ("function" == typeof a && a(), void 0)
- }
- },
- o = function (e, a) {
- if (e) {
- var t = core.pathThis(e)
- return i(t)
- ? (ajax({
- dataType: "json",
- url: "index.html?explorer/mkdir&path=" + urlEncode2(e),
- beforeSend: function () {
- core.tips.loading()
- },
- error: core.ajaxError,
- success: function (e) {
- core.tips.close(e), "function" == typeof a && a(e)
- },
- }),
- void 0)
- : ("function" == typeof a && a(), void 0)
- }
- },
- r = function (e, a, t) {
- return e && a && e != a
- ? i(core.pathThis(a)) /*ajax({
- type: "POST",
- dataType: "json",
- url: "index.html?explorer/pathRname",
- data: "path=" + urlEncode(e) + "&rname_to=" + urlEncode(a),
- beforeSend: function() {
- core.tips.loading()
- },
- error: core.ajaxError,
- success: function(e) {*/
- ? //core.tips.close(e),
- "function" == typeof t && t(e)
- : /*}
- }),void 0*/ ("function" == typeof t && t(), void 0)
- : void 0
- },
- l = function (e, a) {
- if (!(1 > e.length)) {
- var t = e[0].title,
- i = LNG.remove_title,
- s = t + "<br/>" + LNG.remove_info,
- o = "index.html?explorer/pathDelete"
- "*recycle*/" == G.this_path && ((s = LNG.recycle_remove + "?"), (o = "index.html?explorer/pathDeleteRecycle"), (i = LNG.recycle_remove)),
- "share" == e[0].type && ((s = LNG.share_remove_tips), (o = "index.html?userShare/del"), (i = LNG.share_remove)),
- e.length > 1 && (s += ' ... <span class="badge">' + e.length + "</span>"),
- $.dialog({
- id: "dialog_path_remove",
- fixed: !0,
- icon: "question",
- title: i,
- width: 300,
- padding: 40,
- lock: !0,
- background: "#000",
- opacity: 0.3,
- content: s,
- ok: function () {
- ajax({
- url: "/web/desktop/my/app/remove.json",
- type: "POST",
- dataType: "json",
- data: { id: e[0].id },
- beforeSend: function () {
- core.tips.loading()
- },
- error: core.ajaxError,
- success: function (t) {
- if (t.status != 1) {
- core.tips.close(t.msg)
- return
- }
- $("[data-id=app_" + e[0].id + "]").fadeOut(function () {
- $(this).remove()
- ui.autoIconArr()
- })
- core.tips.close("删除成功")
- // if (core.tips.close(t), FrameCall.father("ui.f5", "1,1"), "share" == e[0].type) {
- // var i = art.dialog.list.share_dialog;
- // void 0 != i && i.close(),
- // $(".jiathis_style").appendTo(".global_share")
- // }
- // "function" == typeof a && a(t)
- },
- })
- },
- cancel: !0,
- })
- }
- },
- c = function (e) {
- 1 > e.length ||
- ajax({
- url: "index.html?explorer/pathCopy",
- type: "POST",
- dataType: "json",
- data: n(e),
- error: core.ajaxError,
- success: function (e) {
- core.tips.tips(e)
- },
- })
- },
- u = function (a) {
- var t = e("tpl/share.html"),
- i = template.compile(t),
- n = i({
- LNG: LNG,
- })
- $.dialog({
- id: "share_dialog",
- simple: !0,
- resize: !1,
- width: 425,
- title: LNG.share,
- padding: "0",
- fixed: !0,
- content: n,
- cancel: function () {
- $(".jiathis_style").appendTo(".global_share")
- },
- })
- var s = "zh_CN" == G.lang ? "ch" : "en"
- $("#share_time").datetimepicker({
- format: "Y/m/d",
- formatDate: "Y/m/d",
- timepicker: !1,
- lang: s,
- }),
- $("#share_time")
- .unbind("blur")
- .bind("blur", function (e) {
- stopPP(e)
- })
- var o = function (e) {
- if (($(".share_setting_more").addClass("hidden"), void 0 == e))
- $(".share_has_url").addClass("hidden"),
- $(".share_action .share_remove_button").addClass("hidden"),
- $(".content_info input[name=sid]").val(""),
- $(".content_info input[name=type]").val(""),
- $(".content_info input[name=name]").val(""),
- $(".content_info input[name=path]").val(""),
- $(".content_info input[name=time_to]").val(""),
- $(".content_info input[name=share_password]").val(""),
- $(".share_view_info").addClass("hidden")
- else {
- ;(a = e),
- $(".content_info input[name=sid]").val(e.sid),
- $(".content_info input[name=type]").val(e.type),
- $(".content_info input[name=name]").val(e.name),
- $(".content_info input[name=path]").val(e.path),
- $(".content_info input[name=time_to]").val(e.time_to),
- $(".content_info input[name=share_password]").val(e.share_password),
- $(".share_view_info").removeClass("hidden"),
- e.num_download === void 0 && (e.num_download = 0),
- e.num_view === void 0 && (e.num_view = 0)
- var t = LNG.share_view_num + e.num_view + " " + LNG.share_download_num + e.num_download
- $(".share_view_info").html(t),
- "1" == e.code_read ? $(".content_info input[name=code_read]").attr("checked", "checked") : $(".content_info input[name=code_read]").removeAttr("checked"),
- "1" == e.not_download ? $(".content_info input[name=not_download]").attr("checked", "checked") : $(".content_info input[name=not_download]").removeAttr("checked"),
- $(".share_has_url").removeClass("hidden"),
- "file" == e.type ? $(".label_code_read").addClass("hidden") : $(".label_code_read").removeClass("hidden")
- var i = e.type
- "folder" == e.type && (i = 1 == e.code_read ? "code_read" : "folder")
- var n = G.app_host + "index.html?share/" + i + "&user=" + G.user_name + "&sid=" + e.sid
- $(".content_info .share_url").val(n),
- ("" != e.time_to || "" != e.share_password || "1" == e.code_read || "1" == e.not_download) && $(".share_setting_more").removeClass("hidden"),
- $(".share_remove_button").removeClass("hidden"),
- $(".share_create_button").text(LNG.share_save),
- (jiathis_config = {
- url: n,
- summary: e.name,
- title: "share to ##",
- shortUrl: !1,
- hideMore: !1,
- }),
- $(".jiathis_style").appendTo(".share_jiathis_box")
- }
- },
- r = function () {
- $(".share_action .share_remove_button")
- .unbind("click")
- .click(function () {
- ui.pathOperate.remove([
- {
- type: "share",
- path: a.sid,
- },
- ]),
- "*share*/" == G.this_path && ui.f5()
- }),
- $(".content_info .share_more")
- .unbind("click")
- .click(function () {
- $(".share_setting_more").toggleClass("hidden")
- }),
- $(".share_action .share_create_button")
- .unbind("click")
- .click(function () {
- var e = ""
- $(".share_dialog .content_info input[name]").each(function () {
- var a = urlEncode($(this).val())
- "checkbox" == $(this).attr("type") && (a = $(this).attr("checked") ? "1" : ""), (e += "&" + $(this).attr("name") + "=" + a)
- }),
- ajax({
- url: "index.html?userShare/set",
- data: e,
- type: "POST",
- dataType: "json",
- beforeSend: function () {
- $(".share_create_button").addClass("disabled")
- },
- error: function () {
- core.tips.tips(LNG.error, !1)
- },
- success: function (e) {
- $(".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)
- },
- })
- }),
- $(".content_info .open_window")
- .unbind("click")
- .bind("click", function () {
- window.open($("input.share_url").val())
- })
- var e = $("input.share_url"),
- t = e.get(0)
- e.unbind("hover click").bind("hover click", function () {
- $(this).focus()
- var a = e.val().length
- if (Global.isIE) {
- var i = t.createTextRange()
- i.moveEnd("character", -t.value.length), i.moveEnd("character", a), i.moveStart("character", 0), i.select()
- } else t.setSelectionRange(0, a)
- })
- }
- o(a), r()
- },
- h = function (e) {
- if (!(1 > e.length)) {
- var a = core.path2url(e)
- FrameCall.father("ui.setWall", '"' + a + '"'),
- ajax({
- url: "index.html?setting/set&k=wall&v=" + urlEncode(a),
- type: "json",
- success: function (e) {
- core.tips.tips(e)
- },
- })
- }
- },
- f = function (e, a, t) {
- if (!(1 > e.length)) {
- var i,
- n = core.pathThis(e),
- s = core.pathFather(e)
- i = "folder" == a ? "ui.path.list('" + urlEncode(e) + "');" : "ui.path.open('" + urlEncode(e) + "');"
- var o = urlEncode2(s + n + ".oexe")
- ajax({
- url: "index.html?explorer/mkfile&path=" + o,
- type: "POST",
- dataType: "json",
- data: 'content={"type":"app_link","content":"' + i + '","icon":"app_s2.png"}',
- success: function (e) {
- e.code && "function" == typeof t && t(e)
- },
- })
- }
- },
- reloadTree = function (e, pbox) {
- var setValues = function (treeId) {
- var nodes = $.fn.zTree.getZTreeObj(treeId).getCheckedNodes(true)
- var ids = [],
- names = []
- for (var i = 0; i < nodes.length; i++) {
- ids.push(nodes[i].id)
- names.push(nodes[i].name)
- }
- e.attr({ "data-id": ids.join(","), data: JSON.stringify(ids) }).val(names.join(","))
- },
- getValues = function () {
- var ids = e.attr("data-id")
- return ids ? ids.split(",") : []
- },
- click = function (event, treeId, node) {
- var treeObj = $.fn.zTree.getZTreeObj(treeId)
- treeObj.checkNode(node, !node.checked, false)
- setValues(treeId)
- },
- check = function (event, treeId, node) {
- setValues(treeId)
- },
- dftCheck = function (treeId) {
- var ids = getValues()
- for (var c in ids) {
- try {
- var treeObj = $.fn.zTree.getZTreeObj(treeId)
- var node = treeObj.getNodeByParam("id", ids[c])
- if (null == node) {
- continue
- }
- treeObj.checkNode(node, true, false)
- } catch (e) {
- console.log(e)
- }
- }
- $.fn.zTree.getZTreeObj(treeId).expandAll(true)
- setValues(treeId)
- pbox.attr({ loaded: true })
- },
- rootPid = 0,
- setting = {
- check: {
- chkStyle: "checkbox",
- chkboxType: { Y: "", N: "" },
- enable: true,
- },
- view: {
- dblClickExpand: false,
- },
- data: {
- simpleData: {
- enable: true,
- pIdKey: "parentId",
- rootPid: 0,
- },
- },
- async: {
- enable: true,
- url: "/web/menu/getAll.json",
- dataFilter: function (id, pnode, r) {
- var rdata = []
- var data = r.data.rows
- if (data) {
- // rdata[0] = {id:rootPid,parentId:rootPid,name:"根节点",xpath:"/",open:true};
- for (var i = 0; i < data.length; i++) {
- data[i].name = data[i].name
- data[i].url = null
- rdata.push(data[i])
- }
- }
- return rdata
- },
- },
- callback: {
- //事件处理回调函数
- onClick: click,
- onCheck: check,
- onAsyncSuccess: function (event, treeId, treeNode, msg) {
- dftCheck(treeId)
- },
- },
- }
- if (pbox.attr("loaded")) {
- dftCheck(pbox.attr("id"))
- return
- }
- !pbox.is(":visible") && $.fn.zTree.init(pbox, setting)
- },
- reloadSite = function (parent, pbox) {
- if (pbox.attr("loaded")) {
- return
- }
- var uuid = parent.attr("uuid")
- var ids = parent.attr("data-id").split(",")
- var names = []
- pbox.empty()
- ajax({
- url: "/web/site/getAll.json",
- success: function (d) {
- if (!d.data.rows) {
- return
- }
- var d = d.data.rows
- for (var i = 0; i < d.length; i++) {
- var chk = false
- for (var j = 0; j < ids.length; j++) {
- if (d[i].id == ids[j]) {
- names.push(d[i].name)
- chk = true
- }
- }
- pbox.append(
- '<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>"
- )
- }
- parent.val(names.join(","))
- pbox.attr("loaded", true)
- $("input[type=checkbox]", pbox).change(function () {
- var i = []
- var n = []
- $("input[type=checkbox]:checked", pbox).each(function () {
- i.push($(this).val())
- n.push($(this).attr("data-text"))
- })
- parent.val(n.join(","))
- parent.attr("data-id", i.join(","))
- })
- },
- })
- },
- reloadRole = function (parent, pbox) {
- if (pbox.attr("loaded")) {
- return
- }
- var uuid = parent.attr("uuid")
- var ids = parent.attr("data-id").split(",")
- var names = []
- pbox.empty()
- ajax({
- url: "/web/role/getAll.json",
- success: function (d) {
- if (d.status != 1) {
- return
- }
- var d = d.data.rows
- for (var i = 0; i < d.length; i++) {
- if (d[i].id == 1) {
- continue
- }
- var chk = false
- for (var j = 0; j < ids.length; j++) {
- if (d[i].id == ids[j]) {
- names.push(d[i].name)
- chk = true
- }
- }
- pbox.append(
- '<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>"
- )
- }
- parent.val(names.join(","))
- pbox.attr("loaded", true)
- $("input[type=checkbox]", pbox).change(function () {
- var i = []
- var n = []
- $("input[type=checkbox]:checked", pbox).each(function () {
- i.push($(this).val())
- n.push($(this).attr("data-text"))
- })
- parent.val(n.join(","))
- parent.attr("data-id", i.join(","))
- })
- },
- })
- },
- toggleTree = function (e) {
- var parent = $("[appcontent=type_3]", e),
- poffset = parent.offset(),
- ptree = parent.next("[id^=menu_select_tree]").eq(0)
- ptree.css({
- position: "fixed",
- padding: "8px",
- width: parent.width() + "px",
- left: poffset.left + "px",
- top: poffset.top - 1 + parent.outerHeight() + "px",
- "z-index": 999,
- })
- reloadTree(parent, ptree)
- ptree.stop().slideToggle("fast")
- },
- toggleSite = function (e) {
- var parent = $("[name=siteIds]", e),
- poffset = parent.offset(),
- pbox = parent.next(".siteIdSelector").eq(0)
- pbox.css({
- border: "1px solid #ccc",
- background: "#fff",
- //position: "fixed",
- padding: "8px",
- width: parent.width() + "px",
- left: poffset.left + "px",
- top: poffset.top - 1 + parent.outerHeight() + "px",
- "z-index": 999,
- })
- reloadSite(parent, pbox)
- pbox.stop().slideToggle("fast")
- },
- toggleRole = function (e) {
- var parent = $("[name=roleIds]", e),
- poffset = parent.offset(),
- pbox = parent.next(".roleSelector").eq(0)
- pbox.css({
- border: "1px solid #ccc",
- background: "#fff",
- //position: "fixed",
- padding: "8px",
- width: parent.width() + "px",
- left: poffset.left + "px",
- top: poffset.top - 1 + parent.outerHeight() + "px",
- "z-index": 999,
- })
- reloadRole(parent, pbox)
- pbox.stop().slideToggle("fast")
- },
- getAppData = function (e) {
- var a = {}
- return (
- e.find("input[type=text],textarea").each(function () {
- var e = $(this).attr("name")
- if (e == "siteIds" || e == "roleIds") {
- return
- }
- a[e] = $(this).val()
- }),
- e.find("input[type=checkbox]").each(function () {
- var e = $(this).attr("name")
- a[e] = "checked" == $(this).attr("checked") ? 1 : 0
- }),
- e.find("input[type=radio]").each(function () {
- var e = $(this).attr("name")
- if ("checked" == $(this).attr("checked")) {
- a[e] = $(this).val()
- return false
- }
- }),
- (a.content = a.type == 3 ? e.find("[appcontent=type_3]").attr("data") : e.find("[appcontent=type_" + a.type + "]").val()),
- (a.categoryId = e.find("[name=categoryId]").val()),
- (a.siteIds = e.find("[name=siteIds]").attr("data-id")),
- (a.roleIds = e.find("[name=roleIds]").attr("data-id")),
- (a.icon = e.find("[name=icon]").val()),
- a.icon == "" ? "oexe.png" : a.icon,
- a
- )
- },
- bindEvent = function (e) {
- e
- .find("[appcontent=type_3]")
- .live("click", function () {
- toggleTree(e)
- })
- .live("keypress", function () {
- return false
- }),
- e
- .find("[name=siteIds]")
- .live("click", function () {
- toggleSite(e)
- })
- .live("keypress", function () {
- return false
- }),
- e
- .find("[name=roleIds]")
- .live("click", function () {
- toggleRole(e)
- })
- .live("keypress", function () {
- return false
- })
- e.find(".type input").change(function () {
- var a = $(this).attr("apptype")
- 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()
- })
- },
- openAppEdit = function (obj, t, add_or_edit) {
- var box,
- url,
- content,
- title = add_or_edit == "add" ? LNG.app_create : LNG.app_edit,
- boxId = UUID(),
- pageContent,
- staticPath = "" + "/images/"
- ajax({
- url: "app_edit.html",
- async: !1,
- success: function (cc) {
- pageContent = cc
- },
- })
- ajax({
- url: "/web/app/category/getAll.json",
- dataType: "json",
- async: !1,
- success: function (t) {
- var cc = $(pageContent)
- var cate = t.data.rows
- for (var i in cate) {
- if (cate[i].id != undefined) {
- cc.find("#category").append('<option value="' + cate[i].id + '" ' + (obj.categoryId == cate[i].id ? "selected" : "") + ">" + cate[i].title + "</option>")
- }
- }
- cc.find("#category").append('<option value="0" ' + (obj.categoryId == 0 ? "selected" : "") + ">" + LNG.app_category_others + "</option>")
- pageContent = cc.prop("outerHTML")
- },
- })
- var tmpl = template.compile(pageContent),
- content = tmpl({
- LNG: LNG,
- iconPath: staticPath,
- uuid: boxId,
- data: obj,
- })
- $.dialog({
- fixed: !0,
- width: 450,
- id: boxId,
- padding: 15,
- title: title,
- content: content,
- button: [
- {
- name: LNG.preview,
- callback: function () {
- var e = getAppData(box)
- return core.openApp(e), !1
- },
- },
- {
- name: LNG.button_save,
- focus: !0,
- callback: function () {
- var e = getAppData(box)
- if (add_or_edit == "edit") {
- e.id = obj.id
- }
- ajax({
- url: add_or_edit == "add" ? "/web/app/add.json" : "/web/app/modify.json",
- type: "POST",
- dataType: "json",
- data: e,
- beforeSend: function () {
- core.tips.loading()
- },
- error: core.ajaxError,
- success: function (e) {
- core.tips.close(LNG.success)
- if (e.status == 1)
- if ("edit" == add_or_edit || "add" == add_or_edit) {
- FrameCall.top("Openapp_store", "App.reload", '""')
- } else "function" == typeof t ? t() : ui.f5()
- },
- })
- },
- },
- ],
- })
- ;(box = $("." + boxId)),
- box.find("[appcontent]").addClass("hidden"),
- box.find("[appcontent=type_" + $(box.find("input[name=type]:checked")).val() + "]").removeClass("hidden"),
- box.find("input[name=border]").attr("checked", obj.border == 1),
- box.find("input[name=resize]").attr("checked", obj.resize == 1),
- box.find("input[name=reopen]").attr("checked", obj.reopen == 1),
- box.find("input[name=fullable]").attr("checked", obj.fullable == 1),
- box.find("input[name=width]").attr("value", add_or_edit == "add" ? 800 : obj.width),
- box.find("input[name=height]").attr("value", add_or_edit == "add" ? 600 : obj.height),
- box.find("input[name=icon]").attr("value", obj.icon == "" ? "oexe.png" : obj.icon),
- box.find("input[name=type]").each(function () {
- var i = box.find("[appcontent=" + $(this).attr("apptype") + "]")
- if (obj.type == 3 && obj.content) {
- var cdata = eval("(" + obj.content + ")")
- var is = []
- for (var j = 0; j < cdata.length; j++) {
- if (cdata[j] == null || cdata[j] == 0) {
- continue
- }
- is.push(cdata[j])
- }
- i.attr("data-id", is.join(","))
- } else {
- i.val(obj.content)
- }
- })
- var ptree = $("[appcontent=type_3]", box),
- treebox = ptree.next("[id^=menu_select_tree]").eq(0)
- reloadTree(ptree, treebox)
- var psite = $("[name=siteIds]", box),
- sitebox = psite.next(".siteIdSelector").eq(0)
- reloadSite(psite, sitebox)
- var ptype = $("[name=roleIds]", box),
- typebox = ptype.next(".roleSelector").eq(0)
- reloadRole(ptype, typebox)
- bindEvent(box)
- },
- z = function () {
- core.appStore()
- },
- E = function (e) {
- ;(e && 4 > e.length && "http" != e.substring(0, 4)) ||
- ajax({
- url: "index.html?get_url_title&url=" + e,
- dataType: "json",
- beforeSend: function () {
- core.tips.loading()
- },
- success: function (a) {
- var t = a.data
- core.tips.close(a)
- var i = {
- content: "window.open('" + e + "');",
- desc: "",
- group: "others",
- type: "app",
- icon: "internet.png",
- name: t,
- resize: 1,
- simple: 0,
- height: "",
- width: "",
- },
- n = urlEncode2(G.this_path + t)
- ;(e = "index.html?user_app&action=add&path=" + n),
- ajax({
- url: e,
- type: "POST",
- dataType: "json",
- data: "data=" + urlEncode2(json_encode(i)),
- success: function (e) {
- core.tips.close(e), e.code && ui.f5()
- },
- })
- },
- })
- }
- return {
- appEdit: openAppEdit,
- appList: z,
- appAddURL: E,
- setBackground: h,
- createLink: f,
- newFile: s,
- newFolder: o,
- rname: r,
- copy: c,
- remove: l,
- }
- }),
- define("desktop/pathOpen", [], function (e) {
- var a = function (e, a) {
- if (void 0 != e) {
- 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
- if ("oexe" != a) {
- if (core.authCheck("explorer:fileDownload", LNG.no_permission_download)) {
- if ("swf" == a) {
- var n = core.path2url(e)
- return s(n, core.ico("swf"), core.pathThis(e)), void 0
- }
- if ("pdf" == a) {
- if (Config.isIE) return i(e), void 0
- var c = "pdf" + UUID(),
- n = core.path2url(e),
- 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>"
- return (
- $.dialog({
- resize: !0,
- fixed: !0,
- ico: core.ico("pdf"),
- title: core.pathThis(e),
- width: 800,
- height: 400,
- padding: 0,
- content: d,
- }),
- new PDFObject({
- url: n,
- }).embed(c),
- void 0
- )
- }
- if ("html" == a || "htm" == a) {
- var n = core.path2url(e)
- return s(n, core.ico("html"), core.pathThis(e)), void 0
- }
- if (inArray(core.filetype.image, a)) {
- var n = urlDecode(e)
- return -1 == e.indexOf("http:") && (n = core.path2url(n)), MaskView.image(n), void 0
- }
- if (inArray(core.filetype.music, a) || inArray(core.filetype.movie, a)) {
- var n = core.path2url(e)
- return l(n, a), void 0
- }
- 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)
- }
- } else if ("string" == typeof e || (e.content && "ui.path.open" == e.content.substr(0, 12) && "app_link" == e.type)) {
- var p = e
- "string" != typeof e && (p = e.content.split("'")[1]),
- core.file_get(p, function (e) {
- var a = json_decode(e)
- ;(a.name = core.pathThis(p)), core.openApp(a)
- })
- } else core.openApp(e)
- }
- },
- t = function (e, a) {
- 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>"
- $.dialog({
- fixed: !0,
- icon: "warning",
- title: LNG.unknow_file_title,
- padding: 30,
- content: t,
- cancel: !0,
- })
- },
- n = function (e) {
- if (core.authCheck("explorer:fileDownload") && void 0 != e) {
- var a = core.path2url(e)
- window.open(a)
- }
- },
- s = function (e, a, t, i) {
- if (e) {
- void 0 == i && (i = "openWindow" + UUID())
- var n = "<iframe frameborder='0' name='Open" + i + "' src='" + e + "' style='width:100%;height:100%;border:0;'></iframe>"
- art.dialog.through({
- id: i,
- title: t,
- ico: a,
- width: "78%",
- height: "70%",
- padding: 0,
- content: n,
- resize: !0,
- })
- }
- },
- r = function (e) {
- var a = document.domain
- if ("" == G.office_server) {
- 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
- G.office_server = "https://view.officeapps.live.com/op/view.aspx?src="
- }
- if (G.share_page !== void 0) {
- var i = G.app_host + "index.html?share/fileProxy&user=" + G.user + "&sid=" + G.sid + "&path=" + urlEncode2(e),
- n = G.office_server + urlEncode(i),
- s = core.pathThis(e)
- art.dialog.open(n, {
- ico: core.ico("doc"),
- title: s,
- width: "80%",
- height: "70%",
- resize: !0,
- })
- } else
- $.get("index.html?explorer/makeFileProxy&path=" + urlEncode(e), function (a) {
- if (0 == a.code) return core.tips.tips(a), void 0
- var t = G.app_host + "index.html?user/public_link&fid=" + a.data,
- i = G.office_server + urlEncode(t),
- n = core.pathThis(e)
- art.dialog.open(i, {
- ico: core.ico("doc"),
- title: n,
- width: "80%",
- height: "70%",
- resize: !0,
- })
- })
- }
- return {
- open: a,
- openIE: n,
- }
- })
|