├── .classpath ├── .gitattributes ├── .gitignore ├── .project ├── .settings └── org.eclipse.core.resources.prefs ├── AndroidManifest.xml ├── README.md ├── assets └── www │ ├── css │ ├── Jingle.min.css │ ├── app.css │ └── pygments.css │ ├── html │ ├── about_section.html │ ├── comment_section.html │ ├── detail_frame.html │ ├── detail_section.html │ ├── favo_section.html │ ├── login_section.html │ └── user_section.html │ ├── images │ ├── dis_eoelogo.png │ ├── dis_user_example.png │ ├── ic_launcher.png │ └── webview_load_default.png │ ├── index.html │ └── js │ ├── app │ ├── app.js │ └── eoeAPI.js │ └── lib │ ├── Jingle.debug.js │ ├── Jingle.min.js │ ├── cordova.js │ ├── iscroll.js │ ├── pgPlugin.js │ ├── template.min.js │ ├── zepto.js │ └── zepto.touch2mouse.js ├── gen └── com │ └── jingle │ └── eoe │ ├── BuildConfig.java │ └── R.java ├── libs ├── android-support-v4.jar ├── cordova-2.9.0.jar └── zxing2.3.jar ├── lint.xml ├── proguard-project.txt ├── project.properties ├── res ├── drawable-hdpi │ ├── barcode_back.9.PNG │ ├── barcode_back_btn.xml │ ├── barcode_bg.9.PNG │ ├── icon.png │ └── splashscreen.png ├── layout │ └── activity_capture.xml ├── raw │ └── beep.ogg ├── values │ ├── barcode.xml │ └── strings.xml └── xml │ └── config.xml └── src └── com ├── google └── zxing │ └── client │ └── android │ ├── BeepManager.java │ ├── CaptureActivity.java │ ├── CaptureActivityHandler.java │ ├── DecodeFormatManager.java │ ├── DecodeHandler.java │ ├── DecodeHintManager.java │ ├── DecodeThread.java │ ├── FinishListener.java │ ├── InactivityTimer.java │ ├── Intents.java │ ├── ViewfinderResultPointCallback.java │ ├── ViewfinderView.java │ ├── camera │ ├── AutoFocusManager.java │ ├── CameraConfigurationManager.java │ ├── CameraManager.java │ └── PreviewCallback.java │ ├── common │ ├── PlatformSupportManager.java │ └── executor │ │ ├── AsyncTaskExecInterface.java │ │ ├── AsyncTaskExecManager.java │ │ ├── DefaultAsyncTaskExecInterface.java │ │ └── HoneycombAsyncTaskExecInterface.java │ └── plugin │ └── BarcodeScanner.java └── jingle └── eoe ├── MainActivity.java └── sign ├── MD5.java ├── Sign.java └── Utility.java /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .metadata 7 | bin/ 8 | tmp/ 9 | *.tmp 10 | *.bak 11 | *.swp 12 | *~.nib 13 | local.properties 14 | .loadpath 15 | 16 | # External tool builders 17 | .externalToolBuilders/ 18 | 19 | # Locally stored "Eclipse launch configurations" 20 | *.launch 21 | 22 | # CDT-specific 23 | .cproject 24 | 25 | # PDT-specific 26 | .buildpath 27 | 28 | 29 | ################# 30 | ## Visual Studio 31 | ################# 32 | 33 | ## Ignore Visual Studio temporary files, build results, and 34 | ## files generated by popular Visual Studio add-ons. 35 | 36 | # User-specific files 37 | *.suo 38 | *.user 39 | *.sln.docstates 40 | 41 | # Build results 42 | 43 | [Dd]ebug/ 44 | [Rr]elease/ 45 | x64/ 46 | build/ 47 | [Bb]in/ 48 | [Oo]bj/ 49 | 50 | # MSTest test Results 51 | [Tt]est[Rr]esult*/ 52 | [Bb]uild[Ll]og.* 53 | 54 | *_i.c 55 | *_p.c 56 | *.ilk 57 | *.meta 58 | *.obj 59 | *.pch 60 | *.pdb 61 | *.pgc 62 | *.pgd 63 | *.rsp 64 | *.sbr 65 | *.tlb 66 | *.tli 67 | *.tlh 68 | *.tmp 69 | *.tmp_proj 70 | *.log 71 | *.vspscc 72 | *.vssscc 73 | .builds 74 | *.pidb 75 | *.log 76 | *.scc 77 | 78 | # Visual C++ cache files 79 | ipch/ 80 | *.aps 81 | *.ncb 82 | *.opensdf 83 | *.sdf 84 | *.cachefile 85 | 86 | # Visual Studio profiler 87 | *.psess 88 | *.vsp 89 | *.vspx 90 | 91 | # Guidance Automation Toolkit 92 | *.gpState 93 | 94 | # ReSharper is a .NET coding add-in 95 | _ReSharper*/ 96 | *.[Rr]e[Ss]harper 97 | 98 | # TeamCity is a build add-in 99 | _TeamCity* 100 | 101 | # DotCover is a Code Coverage Tool 102 | *.dotCover 103 | 104 | # NCrunch 105 | *.ncrunch* 106 | .*crunch*.local.xml 107 | 108 | # Installshield output folder 109 | [Ee]xpress/ 110 | 111 | # DocProject is a documentation generator add-in 112 | DocProject/buildhelp/ 113 | DocProject/Help/*.HxT 114 | DocProject/Help/*.HxC 115 | DocProject/Help/*.hhc 116 | DocProject/Help/*.hhk 117 | DocProject/Help/*.hhp 118 | DocProject/Help/Html2 119 | DocProject/Help/html 120 | 121 | # Click-Once directory 122 | publish/ 123 | 124 | # Publish Web Output 125 | *.Publish.xml 126 | *.pubxml 127 | 128 | # NuGet Packages Directory 129 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 130 | #packages/ 131 | 132 | # Windows Azure Build Output 133 | csx 134 | *.build.csdef 135 | 136 | # Windows Store app package directory 137 | AppPackages/ 138 | 139 | # Others 140 | sql/ 141 | *.Cache 142 | ClientBin/ 143 | [Ss]tyle[Cc]op.* 144 | ~$* 145 | *~ 146 | *.dbmdl 147 | *.[Pp]ublish.xml 148 | *.pfx 149 | *.publishsettings 150 | 151 | # RIA/Silverlight projects 152 | Generated_Code/ 153 | 154 | # Backup & report files from converting an old project file to a newer 155 | # Visual Studio version. Backup files are not needed, because we have git ;-) 156 | _UpgradeReport_Files/ 157 | Backup*/ 158 | UpgradeLog*.XML 159 | UpgradeLog*.htm 160 | 161 | # SQL Server files 162 | App_Data/*.mdf 163 | App_Data/*.ldf 164 | 165 | ############# 166 | ## Windows detritus 167 | ############# 168 | 169 | # Windows image file caches 170 | Thumbs.db 171 | ehthumbs.db 172 | 173 | # Folder config file 174 | Desktop.ini 175 | 176 | # Recycle Bin used on file shares 177 | $RECYCLE.BIN/ 178 | 179 | # Mac crap 180 | .DS_Store 181 | 182 | 183 | ############# 184 | ## Python 185 | ############# 186 | 187 | *.py[co] 188 | 189 | # Packages 190 | *.egg 191 | *.egg-info 192 | dist/ 193 | build/ 194 | eggs/ 195 | parts/ 196 | var/ 197 | sdist/ 198 | develop-eggs/ 199 | .installed.cfg 200 | 201 | # Installer logs 202 | pip-log.txt 203 | 204 | # Unit test / coverage reports 205 | .coverage 206 | .tox 207 | 208 | #Translations 209 | *.mo 210 | 211 | #Mr Developer 212 | .mr.developer.cfg 213 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | eoeh5 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | #Fri Mar 08 09:43:25 CST 2013 2 | eclipse.preferences.version=1 3 | encoding//assets/www=UTF-8 4 | encoding/src=UTF-8 5 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 27 | 28 | 34 | 35 | 36 | 37 | 38 | 39 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | EOE HTML5 Android客户端 2 | ===== 3 | 4 | 下载地址: 5 | http://shixy.github.io/Jingle/eoeh5.apk 6 | ![](http://shixy.github.io/Jingle/images/eoe-qr.png) 7 | 8 | ##应用介绍## 9 | 10 | 1. 本应用是基于html5+phonegap开发的EOE安卓客户端 11 | 12 | 2. 功能均是参考 EOE开源安卓客户端,感谢EOE开源安卓客户端所做的贡献。 13 | 14 | 3. 所有代码均已开源,有兴趣的朋友请自行fork,大家共同学习进步。 15 | 16 | 4. 使用到的框架有: 17 | 18 | > phonegap(https://github.com/phonegap/phonegap) 19 | 20 | > Jingle(https://github.com/shixy/Jingle) 21 | 22 | > zepto(https://github.com/madrobby/zepto) 23 | 24 | > iScroll4(https://github.com/cubiq/iscroll) 25 | 26 | > artTemplate(https://github.com/aui/artTemplate) 27 | 28 | > zxing(BarcodeScanner)(https://github.com/shixy/BarcodeScanner) 29 | 30 |

再次感谢所有开源的朋友们,因为有你们,世界变得更加美丽!

31 | 32 | -------------------------------------------------------------------------------- /assets/www/css/app.css: -------------------------------------------------------------------------------- 1 | article{ 2 | background-color: #fff; 3 | color: #666; 4 | } 5 | .list li{ 6 | font-size: .9em; 7 | } 8 | .list li strong{ 9 | font-size: 1.1em; 10 | } 11 | .list-container{ 12 | height: 100%; 13 | position: relative; 14 | } 15 | .header-secondary{ 16 | background-color: #fff; 17 | border-bottom: 1px solid #c2bfbf; 18 | } 19 | .header-secondary div.grid{ 20 | -webkit-box-flex : 1; 21 | } 22 | .header-secondary a{ 23 | min-width: 100px; 24 | -webkit-box-flex:1; 25 | display: block; 26 | color: #666; 27 | height: 30px; 28 | } 29 | .header-secondary a.active{ 30 | border-bottom: 6px solid #47B1FA; 31 | color: #2489ce; 32 | } 33 | .header-secondary i.icon{ 34 | color: #666; 35 | position: absolute;right:0;top:0;opacity:.2; 36 | } 37 | .user-box{ 38 | -webkit-box-flex:1; 39 | box-flex:1; 40 | border-radius: 3px; 41 | border: 1px solid #eee; 42 | text-align: center; 43 | padding:20px;margin:10px; 44 | } 45 | .user-box p{ 46 | font-size: 1.1em; 47 | color:#2C3E50; 48 | font-weight: 600; 49 | padding: 5px 0; 50 | } 51 | .ellipsis{ 52 | white-space: nowrap; 53 | overflow: hidden; 54 | text-overflow: ellipsis; 55 | } 56 | .active-bar{ 57 | color: #3498DB; 58 | } 59 | #about_section p{ 60 | font-size: 1.1em; 61 | } -------------------------------------------------------------------------------- /assets/www/css/pygments.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #ffffcc } 2 | .highlight .c { color: #408080; font-style: italic } 3 | .highlight .err { border: 1px solid #FF0000 } 4 | .highlight .k { color: #008000; font-weight: bold } 5 | .highlight .o { color: #666666 } 6 | .highlight .cm { color: #408080; font-style: italic } 7 | .highlight .cp { color: #BC7A00 } 8 | .highlight .c1 { color: #408080; font-style: italic } 9 | .highlight .cs { color: #408080; font-style: italic } 10 | .highlight .gd { color: #A00000 } 11 | .highlight .ge { font-style: italic } 12 | .highlight .gr { color: #FF0000 } 13 | .highlight .gh { color: #000080; font-weight: bold } 14 | .highlight .gi { color: #00A000 } 15 | .highlight .go { color: #888888 } 16 | .highlight .gp { color: #000080; font-weight: bold } 17 | .highlight .gs { font-weight: bold } 18 | .highlight .gu { color: #800080; font-weight: bold } 19 | .highlight .gt { color: #0044DD } 20 | .highlight .kc { color: #008000; font-weight: bold } 21 | .highlight .kd { color: #008000; font-weight: bold } 22 | .highlight .kn { color: #008000; font-weight: bold } 23 | .highlight .kp { color: #008000 } 24 | .highlight .kr { color: #008000; font-weight: bold } 25 | .highlight .kt { color: #B00040 } 26 | .highlight .m { color: #666666 } 27 | .highlight .s { color: #BA2121 } 28 | .highlight .na { color: #7D9029 } 29 | .highlight .nb { color: #008000 } 30 | .highlight .nc { color: #0000FF; font-weight: bold } 31 | .highlight .no { color: #880000 } 32 | .highlight .nd { color: #AA22FF } 33 | .highlight .ni { color: #999999; font-weight: bold } 34 | .highlight .ne { color: #D2413A; font-weight: bold } 35 | .highlight .nf { color: #0000FF } 36 | .highlight .nl { color: #A0A000 } 37 | .highlight .nn { color: #0000FF; font-weight: bold } 38 | .highlight .nt { color: #008000; font-weight: bold } 39 | .highlight .nv { color: #19177C } 40 | .highlight .ow { color: #AA22FF; font-weight: bold } 41 | .highlight .w { color: #bbbbbb } 42 | .highlight .mf { color: #666666 } 43 | .highlight .mh { color: #666666 } 44 | .highlight .mi { color: #666666 } 45 | .highlight .mo { color: #666666 } 46 | .highlight .sb { color: #BA2121 } 47 | .highlight .sc { color: #BA2121 } 48 | .highlight .sd { color: #BA2121; font-style: italic } 49 | .highlight .s2 { color: #BA2121 } 50 | .highlight .se { color: #BB6622; font-weight: bold } 51 | .highlight .sh { color: #BA2121 } 52 | .highlight .si { color: #BB6688; font-weight: bold } 53 | .highlight .sx { color: #008000 } 54 | .highlight .sr { color: #BB6688 } 55 | .highlight .s1 { color: #BA2121 } 56 | .highlight .ss { color: #19177C } 57 | .highlight .bp { color: #008000 } 58 | .highlight .vc { color: #19177C } 59 | .highlight .vg { color: #19177C } 60 | .highlight .vi { color: #19177C } 61 | .highlight .il { color: #666666 } 62 | 63 | 64 | .highlight .tabspan { 65 | display: inline-block; 66 | width: 4ch; 67 | } 68 | 69 | .markdown { 70 | margin-left: 10px; 71 | margin-right: 10px 72 | } 73 | 74 | .markdown h1,.markdown h2,.markdown h3,.markdown h4,.markdown h5,.markdown h6 75 | { 76 | font-weight: normal; 77 | color: black 78 | } 79 | 80 | .markdown h1 { 81 | font-size: 28px 82 | } 83 | 84 | .markdown h1,.markdown h2,.markdown h3,.markdown h4,.markdown h6,.markdown p,.markdown ol li 85 | { 86 | color: black 87 | } 88 | 89 | div.code { 90 | overflow: auto; 91 | border-left: 1px solid #CCC; 92 | border-right: 1px solid #CCC; 93 | border-bottom: 1px solid #CCC; 94 | padding: -10px 95 | } 96 | 97 | .filename,.filediv { 98 | border: 1px solid #CCC; 99 | padding: 5px; 100 | font-size: 14px; 101 | margin-top: -1px; 102 | margin-left: 0px 103 | } 104 | 105 | .filename { 106 | background-color: whiteSmoke 107 | } 108 | 109 | .filediv { 110 | margin-top: -1px; 111 | border-left: none; 112 | border-right: none 113 | } 114 | 115 | table.highlighttable { 116 | width: 100%; 117 | overflow-x: auto; 118 | margin: 0; 119 | padding: 0; 120 | border: 1px solid #ccc; 121 | display: block; 122 | overflow-y: hidden; 123 | } 124 | 125 | table.highlighttable td.linenos { 126 | width:25px; 127 | text-align: right; 128 | border-right: 1px solid #CCC; 129 | background-color: whitesmoke; 130 | } 131 | table.highlighttable td.linenos .linenodiv pre { 132 | border: none; 133 | margin: 0; 134 | padding: 0 8px 0 0; 135 | width:30px; 136 | } 137 | 138 | div.code table.highlighttable td.code { 139 | display: inherit; 140 | } 141 | 142 | div.code table.highlighttable td.code .highlight pre { 143 | background: white; 144 | border: none; 145 | margin: 0; 146 | } 147 | 148 | pre { 149 | white-space: pre; 150 | border: none; 151 | margin-bottom: -1px; 152 | background: none; 153 | } 154 | 155 | table.highlighttable td.code .highlight pre { 156 | background-color: white; 157 | } 158 | div.show img{ 159 | max-width: 100%; 160 | } 161 | div.show a{ 162 | color: #000; 163 | } 164 | div.show{ 165 | font-size: 14px !important; 166 | line-height: 28px; 167 | } 168 | .show{margin:0 auto;font:12px/24px '微软雅黑',Arial,Helvetica,sans-serif;; color:#757575;} 169 | .show h1{font-size:22px;line-height:36px;font-weight:normal;color:#363636;} 170 | .show h4{font-size:14px;font-weight:normal;line-height:20px;color:#bdbdbd;} -------------------------------------------------------------------------------- /assets/www/html/about_section.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 6 |

关于

7 |
8 |
9 |
10 |
    11 |
  • 关于EOE
  • 12 |
  • 13 |

    eoe,国内成立最早、规模最大的中文移动开发者社区,2009年4月上线。社区涵盖问答、博客、图书、资料下载、沙龙活动、在线课堂、线下训练营等模块。eoe致力于让每个人成为优秀的移动开发者,截至2012年12月,累计帮助开发者学习移动开发技术逾60万人。

    14 |
  • 15 |
  • 关于本应用
  • 16 |
  • 17 |

    1. 本应用是基于html5+phonegap开发的EOE安卓客户端

    18 |

    2. 功能均是参考 EOE开源安卓客户端,感谢EOE开源安卓客户端所做的贡献。

    19 |

    3. 所有代码均已开源,有兴趣的朋友请自行fork,大家共同学习进步。

    20 |

    4. 使用到的框架有:
    21 | phonegap
    22 | Jingle
    23 | zepto
    24 | iScroll4
    25 | artTemplate
    26 | zxing(BarcodeScanner)
    27 |

    28 |

    再次感谢所有开源的朋友们,因为有你们,世界变得更加美丽!

    29 |
  • 30 |
31 |
32 |
33 |
-------------------------------------------------------------------------------- /assets/www/html/comment_section.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 6 |

评论

7 |
8 | 21 |
22 |
23 |
    24 |
25 | 26 |
27 | 28 |
29 | 43 |
-------------------------------------------------------------------------------- /assets/www/html/detail_frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /assets/www/html/detail_section.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 6 |

7 |
8 | 14 |
15 |
16 |
17 |
18 |
-------------------------------------------------------------------------------- /assets/www/html/favo_section.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 6 |

收藏

7 |
8 | 12 |
13 |
14 |
    15 |
16 |
17 | 18 |
19 |
20 |
21 |
    22 |
23 |
24 | 25 |
26 | 34 |
-------------------------------------------------------------------------------- /assets/www/html/login_section.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 6 |

登录

7 |
8 |
9 |
10 | 11 | 12 | 登录 13 | 14 |
15 |
16 | 17 |
18 |
19 |

请在web端登录后,寻找你的密钥:http://my.eoe.cn/admin/profile/auth.html

20 | 21 |
22 | 23 |
24 |
-------------------------------------------------------------------------------- /assets/www/html/user_section.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 6 |

个人中心

7 |
8 |
9 |
10 | 11 |

12 |
13 |
14 |
15 | E币 16 |

0

17 |
18 |
19 | E望 20 |

0

21 |
22 |
23 | 37 |
38 | 39 |
40 | 41 |
42 | 44 |
-------------------------------------------------------------------------------- /assets/www/images/dis_eoelogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shixy/eoeh5/c4d23358e3408e134f92b9c1bbf44174684591ec/assets/www/images/dis_eoelogo.png -------------------------------------------------------------------------------- /assets/www/images/dis_user_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shixy/eoeh5/c4d23358e3408e134f92b9c1bbf44174684591ec/assets/www/images/dis_user_example.png -------------------------------------------------------------------------------- /assets/www/images/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shixy/eoeh5/c4d23358e3408e134f92b9c1bbf44174684591ec/assets/www/images/ic_launcher.png -------------------------------------------------------------------------------- /assets/www/images/webview_load_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shixy/eoeh5/c4d23358e3408e134f92b9c1bbf44174684591ec/assets/www/images/webview_load_default.png -------------------------------------------------------------------------------- /assets/www/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | eoe Android客户端html5版 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 32 |
33 |
34 |
35 |
36 | 39 |

40 | 43 |
44 | 48 |
49 |
50 |
51 |
52 | 57 | 69 | 85 |
86 |
87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /assets/www/js/app/app.js: -------------------------------------------------------------------------------- 1 | document.addEventListener('deviceready', onDeviceReady, false); 2 | function onDeviceReady(){ 3 | //注册后退按钮 4 | document.addEventListener("backbutton", function (e) { 5 | if(J.isMenuOpen){ 6 | J.Menu.hide(); 7 | }else if(J.hasPopupOpen){ 8 | J.closePopup(); 9 | }else{ 10 | 11 | var sectionId = $('section.active').attr('id'); 12 | if(sectionId == 'index_section'){ 13 | J.confirm('提示','是否退出程序?',function(){ 14 | navigator.app.exitApp(); 15 | }); 16 | }else{ 17 | J.Router.back(); 18 | } 19 | } 20 | }, false); 21 | App.run(); 22 | navigator.splashscreen.hide(); 23 | } 24 | var App = (function(){ 25 | var pages = {}; 26 | var run = function(){ 27 | $.each(pages,function(k,v){ 28 | var sectionId = '#'+k+'_section'; 29 | $('body').delegate(sectionId,'pageinit',function(){ 30 | v.init && v.init.call(v); 31 | }); 32 | $('body').delegate(sectionId,'pageshow',function(e,isBack){ 33 | //页面加载的时候都会执行 34 | v.show && v.show.call(v); 35 | //后退时不执行 36 | if(!isBack && v.load){ 37 | v.load.call(v); 38 | } 39 | }); 40 | }); 41 | Jingle.launch({ 42 | showWelcome:false 43 | }); 44 | J.anim('body','scaleIn'); 45 | }; 46 | var page = function(id,factory){ 47 | return ((id && factory)?_addPage:_getPage).call(this,id,factory); 48 | } 49 | var _addPage = function(id,factory){ 50 | pages[id] = new factory(); 51 | }; 52 | var _getPage = function(id){ 53 | return pages[id]; 54 | } 55 | 56 | return { 57 | run : run, 58 | page : page 59 | } 60 | }()); 61 | if(J.isWebApp){ 62 | $(function () { 63 | App.run(); 64 | }) 65 | } 66 | 67 | App.page('index',function(){ 68 | var slider,$navContainer,$nav,navScroll,$scrollArrow; 69 | var LIST_SELECTOR = '#index_article .list-container'; 70 | var _this = this; 71 | this.init = function(){ 72 | //缓存使用频繁的element 73 | $navContainer = $('#index_section .header-secondary'); 74 | $nav = $navContainer.find('div.grid'); 75 | $scrollArrow = $nav.next(); 76 | 77 | //绑定左侧划出菜单点击事件 78 | $('#index_aside .menu li a').on('tap',function(){ 79 | if($(this).hasClass('selected'))return; 80 | $('#index_aside .menu li a').removeClass('selected'); 81 | $(this).addClass('selected'); 82 | var url = EoeAPI[$(this).data('url')]; 83 | J.Menu.hide(); 84 | _this.refresh($(this).text(),url); 85 | }); 86 | $('#btn_show_user').on('tap',function(){ 87 | var key = localStorage.getItem('authKey'); 88 | var target = key ? '#user_section' : '#login_section'; 89 | J.Router.goTo(target); 90 | }); 91 | //初始化导航栏iScroll 92 | navScroll = J.Scroll($navContainer,{vScroll:false,hScroll:true,hScrollbar: false}); 93 | //初始化页面滑动slider 94 | slider = new J.Slider({ 95 | selector:'#index_article', 96 | noDots : true, 97 | onAfterSlide : function(i){ 98 | var targetScrollEl = $navContainer.find('a').removeClass('active').eq(i).addClass('active').prev(); 99 | if(targetScrollEl.length>0){ 100 | navScroll.scroller.scrollToElement(targetScrollEl[0]); 101 | } 102 | } 103 | }); 104 | //绑定导航栏点击事件 105 | $navContainer.on('tap','a',function(){ 106 | slider.index($(this).data('index')); 107 | }); 108 | //绑定加载更多按钮事件 109 | $('#index_article').on('tap','.list-container button',function(){ 110 | var $this = $(this); 111 | var $container = $this.closest('.list-container'); 112 | var more_url = $this.data('url'); 113 | $this.text('加载中...'); 114 | EoeAPI.get(more_url,function(data){ 115 | J.tmpl($container.find('ul'),'tpl_article_list_li',data.response.items,'add'); 116 | J.Scroll($container); 117 | $this.text('点击加载更多'); 118 | $this.data('url',data.response.more_url); 119 | }); 120 | }); 121 | $('#index_article').on('tap','.list-container li',function(){ 122 | var url = $(this).data('url'); 123 | if(!url)return; 124 | App.page('detail').url = url; 125 | App.page('detail').title = $(this).closest('ul.list').data('name'); 126 | J.Router.goTo('#detail_section'); 127 | }); 128 | //init 129 | this.refresh('社区精选',EoeAPI.topURL); 130 | }; 131 | this.refresh = function(title,url){ 132 | $('#index_section header .title').text(title); 133 | J.showMask(); 134 | //先销毁掉页面中的iscroll 135 | $(LIST_SELECTOR).each(function(){ 136 | if($(this).data('_jrefresh_')){ 137 | J.Refresh(this).destroy(); 138 | } 139 | 140 | }); 141 | EoeAPI.get(url,function(data){ 142 | var categorys = data.response.categorys; 143 | var list = data.response.list; 144 | 145 | //eoe api这个接口数据混乱,需手动调整 146 | if(title == '社区精选'){ 147 | list[0].name = '精选资讯'; 148 | list[1].name = '精选教程'; 149 | } 150 | //整理接口返回的数据 151 | for(var i=0;idiv','tpl_article_list',list); 161 | 162 | //刷新slider 163 | slider.refresh(); 164 | 165 | //动态设置最小宽度,否则iScroll横向滚动无法运行 166 | $nav.css('minWidth',categorys.length*100); 167 | navScroll = J.Scroll($navContainer); 168 | if(navScroll.scroller.scrollerW > navScroll.scroller.wrapperW){ 169 | $scrollArrow.show(); 170 | }else{ 171 | $scrollArrow.hide(); 172 | } 173 | $(LIST_SELECTOR).each(function(){ 174 | _initPullRefresh(this); 175 | }); 176 | //刷新默认显示界面的scroller 177 | J.Scroll($(LIST_SELECTOR).eq(0)); 178 | J.hideMask(); 179 | }); 180 | } 181 | var _initPullRefresh = function(selector){ 182 | J.Refresh({ 183 | selector : selector, 184 | type : 'pullDown', 185 | pullText : '你敢往下拉么...', 186 | releaseText : '松手吧,骚年*^_^* ', 187 | callback : function(){ 188 | var scroller = this; 189 | var $wrapper = $(scroller.wrapper); 190 | EoeAPI.get($wrapper.data('url'),function(data){ 191 | J.tmpl($wrapper.find('ul'),'tpl_article_list_li',data.response.items); 192 | scroller.refresh(); 193 | J.showToast('更新成功','success'); 194 | }); 195 | } 196 | }); 197 | } 198 | }); 199 | App.page('detail',function(){ 200 | var $container,baseUrl; 201 | this.init = function(){ 202 | $container = $('#detail_article div.scrollWrapper'); 203 | $('#detail_section footer a').on('tap',function(){ 204 | _bindBar($(this)); 205 | }); 206 | $('#detail_section').on('pagehide',function(e,isBack){ 207 | if(isBack)$container.empty(); 208 | }); 209 | } 210 | this.load = function(){ 211 | if(!this.url){ 212 | console.error('没有获取数据url'); 213 | } 214 | $('#detail_section header .title').text(this.title); 215 | J.showMask(); 216 | EoeAPI.get(this.url,function(data){ 217 | var $content = $(data.response.content).filter('div.show'); 218 | $container.html($content); 219 | $container.find('base').remove(); 220 | _renderBar(data.response); 221 | J.Scroll('#detail_article',{checkDOMChanges:true}); 222 | J.hideMask(); 223 | }); 224 | } 225 | var _renderBar = function(data){ 226 | var bar = data.bar; 227 | var $good = $('#btn_userlike_good').data('url',bar.userlike.good); 228 | var $bad = $('#btn_userlike_bad').data('url',bar.userlike.bad); 229 | var $favo = $('#btn_user_favo').data('url',bar.favorite); 230 | $('#comment_num').text(data.comment_num); 231 | $('#btn_user_comment').data('url',bar.comment.get).data('submit',bar.comment.submit); 232 | var good = localStorage.getItem('good-group')|| ''; 233 | var bad = localStorage.getItem('bad-group') || ''; 234 | var favo = localStorage.getItem('favo-group') || ''; 235 | baseUrl = data.share_url; 236 | good.indexOf(baseUrl)>-1 ? $good.addClass('active-bar'):$good.removeClass('active-bar'); 237 | bad.indexOf(baseUrl)>-1 ? $bad.addClass('active-bar'):$bad.removeClass('active-bar'); 238 | favo.indexOf(baseUrl)>-1 ? $favo.addClass('active-bar'):$favo.removeClass('active-bar'); 239 | } 240 | /** 241 | * 绑定每个按钮的点击事件 242 | * @param bar 243 | * @private 244 | */ 245 | var _bindBar = function(bar){ 246 | var id = bar.attr('id'); 247 | var url = bar.data('url'); 248 | var key = localStorage.getItem('authKey'); 249 | if(id == 'btn_user_comment'){ 250 | App.page('comment').getUrl = url; 251 | App.page('comment').submitUrl = bar.data('submit'); 252 | J.Router.goTo('#comment_section'); 253 | }else{ 254 | var isActive = bar.hasClass('active-bar'); 255 | var save_t = bar.data('save'); 256 | var storage = localStorage.getItem(save_t) || ''; 257 | if(isActive){ 258 | url = url.replace('add','del'); 259 | } 260 | if(!key){ 261 | App.page('login').turnBack = true; 262 | J.Router.goTo('#login_section'); 263 | return; 264 | } 265 | EoeAPI.getWithSign(url,key,function(){ 266 | bar.toggleClass('active-bar'); 267 | if(isActive){//从本地存储中移除 268 | storage = storage.replace(baseUrl,''); 269 | }else{//添加到本地 270 | storage += baseUrl; 271 | } 272 | localStorage.setItem(save_t,storage); 273 | }); 274 | } 275 | } 276 | }); 277 | App.page('login',function(){ 278 | var _this = this; 279 | this.turnBack = false; 280 | this.init = function(){ 281 | $('#btn_login').tap(_login); 282 | $('#btn_qr_login').tap(_qr_login); 283 | $('#login_section').on('pagehide',function(){ 284 | _this.turnBack = false; 285 | }) 286 | } 287 | var _login = function(){ 288 | var username = $('#username').val(); 289 | var pwd = $('#password').val(); 290 | if(username == '' || pwd == ''){ 291 | J.alert('提示','请填写完整的信息!'); 292 | }else{ 293 | J.showMask('登录中...'); 294 | EoeAPI.login(username,pwd,function(data){ 295 | J.hideMask(); 296 | var key = data.response.key; 297 | if(key){ 298 | localStorage.setItem('authKey',key); 299 | if(_this.turnBack){//处理未登录时需要登录处理的后续操作 300 | J.Router.back(); 301 | }else{ 302 | J.Router.goTo('#user_section'); 303 | } 304 | }else{ 305 | $('#password').val(''); 306 | J.showToast(data.response.msg,'error'); 307 | } 308 | }) 309 | } 310 | } 311 | var _qr_login = function(){ 312 | window.plugins.barcodeScanner.scan('',function(result){ 313 | if(result.cancelled)return; 314 | var key = result.text; 315 | if(key.indexOf(':') == -1){ 316 | J.showToast('二维码不正确,无法登录','error'); 317 | return; 318 | } 319 | J.showMask('正在登录...'); 320 | EoeAPI.getUserInfo(key,function(data){ 321 | J.hideMask(); 322 | if(data.response.isErr === 1){ 323 | J.showToast(data.response.msg,'error'); 324 | }else{ 325 | localStorage.setItem('authKey',key); 326 | App.page('user').userInfo = data; 327 | if(_this.turnBack){//处理未登录时需要登录处理的后续操作 328 | J.Router.back(); 329 | }else{ 330 | J.Router.goTo('#user_section'); 331 | } 332 | } 333 | }); 334 | }) 335 | } 336 | }); 337 | App.page('user',function(){ 338 | var _this = this; 339 | this.userInfo = null; 340 | this.init = function(){ 341 | var _this = this; 342 | $('#btn_logout').on('tap',function(){ 343 | localStorage.removeItem('authKey'); 344 | _this.userInfo = null; 345 | J.Router.goTo('#index_section'); 346 | }); 347 | } 348 | this.load = function(){ 349 | if(this.userInfo){ 350 | _render(this.userInfo); 351 | }else{ 352 | _update(); 353 | } 354 | } 355 | var _update = function(){ 356 | var key = localStorage.getItem('authKey'); 357 | EoeAPI.getUserInfo(key,_render); 358 | } 359 | var _render = function(data){ 360 | _this.userInfo = data; 361 | data = data.response; 362 | $('#user_icon').attr('src',data.info.head_image_url); 363 | $('#txt_username').text(data.info.name); 364 | $('#user_eoe_m').text(data.info.eoe_m); 365 | $('#user_eoe_p').text(data.info.eoe_p); 366 | $('#num_blog_favo').text(data.favorite[0].lists.length); 367 | $('#num_news_favo').text(data.favorite[1].lists.length); 368 | } 369 | }); 370 | App.page('favo',function(){ 371 | this.init = function(){ 372 | $('#favo_section .list').on('tap','li',function(){ 373 | App.page('detail').url = $(this).data('url'); 374 | App.page('detail').title = $(this).closest('ul.list').data('name'); 375 | J.Router.goTo('#detail_section'); 376 | }); 377 | } 378 | this.load = function(){ 379 | var favo_data = App.page('user').userInfo.response.favorite; 380 | J.tmpl('#favo_blog_article .list','tpl_favo',favo_data[0].lists); 381 | J.tmpl('#favo_news_article .list','tpl_favo',favo_data[1].lists); 382 | } 383 | }); 384 | App.page('comment',function(){ 385 | var $list,$btnMore,moreUrl,$submit_container,$btn_login; 386 | var _this = this; 387 | this.getUrl = null; 388 | this.submitUrl = null; 389 | this.init = function(){ 390 | $list = $('#comment_article .list'); 391 | $btnMore = $list.next(); 392 | $submit_container = $('#comment_submit_container'); 393 | $btn_login = $('#btn_comment_login'); 394 | $btnMore.on('tap',function(){ 395 | if(!moreUrl)return; 396 | _renderList(); 397 | }); 398 | $btn_login.on('tap',function(){ 399 | App.page('login').turnBack = true; 400 | J.Router.goTo('#login_section'); 401 | }); 402 | $('#btn_submit_comment').on('tap',function(){ 403 | var v = $('#input_comment').val(); 404 | if($.trim(v)==''){ 405 | J.showToast('评论不能为空'); 406 | return; 407 | } 408 | var url = _this.submitUrl + '&body='+v; 409 | var key = localStorage.getItem('authKey'); 410 | J.showMask('正在提交'); 411 | EoeAPI.getWithSign(url,key,function(data){ 412 | J.hideMask(); 413 | if(data.response.isErr == 1){ 414 | J.showToast('评论失败','error'); 415 | return; 416 | }else{ 417 | var html = template('tpl_comment',[data.response.item]); 418 | $list.prepend(html); 419 | J.Scroll('#comment_article').scrollTo(0,0,0); 420 | J.showToast('评论成功','success'); 421 | } 422 | }); 423 | }); 424 | } 425 | this.show = function(){ 426 | var key = localStorage.getItem('authKey'); 427 | if(key){ 428 | $submit_container.show(); 429 | $btn_login.hide(); 430 | }else{ 431 | $submit_container.hide(); 432 | $btn_login.show(); 433 | } 434 | } 435 | this.load = function(){ 436 | _renderList(true); 437 | } 438 | var _renderList = function(showMask){ 439 | if(showMask){ 440 | moreUrl = null; 441 | J.showMask(); 442 | }else{ 443 | $btnMore.text('加载中...'); 444 | } 445 | EoeAPI.get(moreUrl||_this.getUrl,function(data){ 446 | moreUrl = data.response.more_url; 447 | if(!moreUrl)$btnMore.hide(); 448 | if(data.response.items == ''){ 449 | J.Template.background($list,'亲,沙发还木有人哦..','drawer'); 450 | J.hideMask(); 451 | return; 452 | } 453 | J.tmpl($list,'tpl_comment',data.response.items,showMask?'replace':'add'); 454 | if(data.response.more_url){ 455 | $btnMore.show(); 456 | }else{ 457 | $btnMore.hide(); 458 | } 459 | J.Scroll('#comment_article'); 460 | if(showMask){ 461 | J.hideMask(); 462 | }else{ 463 | $btnMore.text('点击加载更多'); 464 | } 465 | }); 466 | } 467 | }); 468 | //日期格式化 469 | Date.prototype.format = function(fmt) 470 | { //author: meizz 471 | var o = { 472 | "M+" : this.getMonth()+1, //月份 473 | "d+" : this.getDate(), //日 474 | "h+" : this.getHours(), //小时 475 | "m+" : this.getMinutes(), //分 476 | "s+" : this.getSeconds(), //秒 477 | "q+" : Math.floor((this.getMonth()+3)/3), //季度 478 | "S" : this.getMilliseconds() //毫秒 479 | }; 480 | if(/(y+)/.test(fmt)) 481 | fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length)); 482 | for(var k in o) 483 | if(new RegExp("("+ k +")").test(fmt)) 484 | fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length))); 485 | return fmt; 486 | } 487 | //注册方法到artTemplate中 488 | template.helper('dateFormat',function(time){ 489 | return new Date(parseInt(time)).format('yyyy-MM-dd hh:mm:ss'); 490 | }); -------------------------------------------------------------------------------- /assets/www/js/app/eoeAPI.js: -------------------------------------------------------------------------------- 1 | window.EoeAPI = (function(){ 2 | var _baseURL = "http://api.eoe.cn/client"; 3 | this.topURL = _baseURL + '/top'; 4 | this.blogURL = _baseURL + '/blog?k=lists'; 5 | this.newsURL = _baseURL + '/news?k=lists'; 6 | this.wikiURL = _baseURL + '/wiki?k=lists'; 7 | this.get = function(url,success,error){ 8 | url = url.replace('//client','/client'); 9 | 10 | //判断当前是手机端(phonegap)还是浏览器端,手机端通过phonegap的白名单进行跨域,浏览器端采用nodejs进行跨域转发 11 | if(location.protocol == 'http:'){ 12 | url = '/proxy?url='+url; 13 | } 14 | var options = { 15 | url : url, 16 | type : 'get', 17 | timeout : 120000,//超时时间默认2分钟 18 | success : success, 19 | error : function(xhr,type){ 20 | if(error){ 21 | error(xhr,type); 22 | }else{ 23 | _parseError(xhr,type,url); 24 | } 25 | }, 26 | dataType : 'json' 27 | } 28 | $.ajax(options); 29 | } 30 | var _parseError = function (xhr,type,url){ 31 | if(J.hasPopupOpen){ 32 | J.hideMask(); 33 | } 34 | if(type == 'timeout'){ 35 | J.showToast('连接服务器超时,请检查网络是否畅通!','error'); 36 | }else if(type == 'parsererror'){ 37 | J.showToast('解析返回结果失败!','error'); 38 | }else if(type == 'error'){ 39 | var data; 40 | try{ 41 | data = JSON.parse(xhr.responseText); 42 | if(data.code && data.message){ 43 | J.showToast(data.message,'error'); 44 | }else{ 45 | J.showToast('连接服务器失败!','error'); 46 | } 47 | }catch(e){ 48 | J.showToast('连接服务器失败!','error'); 49 | } 50 | }else{ 51 | J.showToast('未知异常','error'); 52 | } 53 | } 54 | 55 | this.login = function(username,pwd,success,error){ 56 | var url = _baseURL + '/key?uname='+username+'&pwd='+pwd; 57 | this.get(url,success,error); 58 | } 59 | 60 | this.getUserInfo = function(key,success){ 61 | var url = _baseURL + '/userinfo?key='+key; 62 | this.getWithSign(url,key,success); 63 | } 64 | this.getWithSign = function(url,key,success,error){ 65 | var _this = this; 66 | window.plugins.eoeSign.get(key,function(param){ 67 | url += param; 68 | _this.get(url,success,error); 69 | }); 70 | } 71 | 72 | 73 | 74 | return this; 75 | })(); 76 | -------------------------------------------------------------------------------- /assets/www/js/lib/Jingle.min.js: -------------------------------------------------------------------------------- 1 | !function(a){var b={version:"0.1",settings:{transitionType:"slide",transitionTime:200,transitionTimingFunc:"linear",showWelcome:!0,showPageLoading:!1,basePagePath:"html/",remotePage:{}},mode:a.innerWidth<800?"phone":"tablet",hasTouch:"ontouchstart"in a,hasLaunched:!1,launchCompleted:!1,hasMenuOpen:!1,hasPopupOpen:!1,isWebApp:"http:"==location.protocol,launch:function(b){$.extend(this.settings,b);var c=a.localStorage.getItem("hasShowWelcome");c||this.showWelcome(),this.Router.init(),this.Element.init(),this.Menu.init(),this.Selected.init()},anim:function(a,b){for(var c,d,e,f=arguments.length,g=2;f>g;g++){var h=arguments[g],i=$.type(h);"number"==i?c=h:"string"==i?d=h:"function"==i?e=h:null}$(a).animate(b,c||J.settings.transitionTime,d||J.settings.transitionTimingFunc,e)},showMask:function(a){J.Popup.loading(a)},hideMask:function(){J.Popup.close(!0)},showToast:function(a,b,c){b=b||"toast",J.Toast.show(b,a,c)},hideToast:function(){J.Toast.hide()},alert:function(a,b){J.Popup.alert(a,b)},confirm:function(a,b,c,d){J.Popup.confirm(a,b,c,d)},popup:function(a){J.Popup.show(a)},closePopup:function(){J.Popup.close()},popover:function(a,b,c,d){J.Popup.popover(a,b,c,d)},tmpl:function(a,b,c,d){J.Template.render(a,b,c,d)},showWelcome:function(){J.settings.showWelcome&&$.ajax({url:J.settings.sectionPath+"welcome.html",timeout:5e3,async:!1,success:function(a){$("body").append(a),new J.Slider("#jingle_welcome")}})},hideWelcome:function(){J.anim("#jingle_welcome","slideLeftOut",function(){$(this).remove(),a.localStorage.setItem("hasShowWelcome",!0)})}};a.Jingle=a.J=b}(window),Jingle.Element=function(a,b){var c={icon:"[data-icon]",scroll:'[data-scroll="true"]',toggle:".toggle",range:"[data-rangeinput]",progress:"[data-progress]",count:"[data-count]",checkbox:"[data-checkbox]"},d=function(d){d||b(document).on("articleshow","article",function(){a.Element.initScroll(this)});var f=b(d||"body");0!=f.length&&(b.map(e(f,c.icon),g),b.map(e(f,c.toggle),i),b.map(e(f,c.range),j),b.map(e(f,c.progress),k),b.map(e(f,c.count),l),b.map(e(f,c.checkbox),m))},e=function(a,b){return a.find(b).add(a.filter(b))},f=function(a){b.map(e(b(a),c.scroll),h)},g=function(a){var c=b(a),d=c.children("i.icon"),e=c.data("icon");d.length>0?d.attr("class","icon "+e):c.prepend('')},h=function(b){a.Scroll(b)},i=function(a){var c,d=b(a);if(!(d.find("div.toggle-handle").length>0)){var e=d.attr("name");e&&d.append(''),d.append('
'),c=d.find("input"),d.tap(function(){var a;d.hasClass("active")?(d.removeClass("active"),a=!1):(d.addClass("active"),a=!0),c.val(a),d.trigger("toggle")})}},j=function(a){var c,d=b(a),e=b('input[type="range"]',a),f=d.data("rangeinput"),g=b('');c="left"==f?g.prependTo(d):g.appendTo(d);var h=parseInt(e.attr("max"),10),i=parseInt(e.attr("min"),10);e.change(function(){c.val(e.val())}),c.on("input",function(){var a=parseInt(c.val(),10);a=a>h?h:i>a?i:a,e.val(a),c.val(a)})},k=function(a){var c,d=b(a),e=parseFloat(d.data("progress"))+"%",f=d.data("title")||"";c=d.find("div.bar"),0==c.length&&(c=b('
').appendTo(d)),c.width(e).text(f+e),"100%"==e&&c.css("border-radius","10px")},l=function(a){var c,d=b(a),e=parseInt(d.data("count")),f=d.data("orient"),g="left"==f?"left":"",h=''+e+"";c=d.find("span.count"),c.length>0?c.text(e):c=h.appendTo(d),0==e&&c.hide()},m=function(a){var c=b(a),d=c.data("checkbox");c.find("i.icon").length>0||(c.prepend(''),c.on("tap",function(){var a="checked"==c.data("checkbox")?"unchecked":"checked";c.find("i.icon").attr("class","icon checkbox-"+a),c.data("checkbox",a),c.trigger("change")}))};return{init:d,initIcon:g,initToggle:i,initProgress:k,initRange:j,initCount:l,initScroll:f}}(Jingle,Zepto),Jingle.Menu=function(a,b){var c,d,e,f=function(){c=b("#aside_container"),d=b("#section_container"),e=b('
').appendTo("#section_container"),e.on("tap",h),c.on("swipeRight","aside",function(){"right"==b(this).data("position")&&h()}),c.on("swipeLeft","aside",function(){"right"!=b(this).data("position")&&h()}),c.on("tap",".aside-close",h)},g=function(c){var e=b(c).addClass("active"),f=e.data("transition"),g=e.data("position")||"left",h=e.data("show-close"),i=e.width(),j="left"==g?i+"px":"-"+i+"px";h&&0==e.find("div.aside-close").length&&e.append('
'),a.Element.initScroll(e),"overlay"==f?a.anim(e,{translateX:"0%"}):"reveal"==f?a.anim(d,{translateX:j}):(a.anim(e,{translateX:"0%"}),a.anim(d,{translateX:j})),b("#section_container_mask").show(),a.hasMenuOpen=!0},h=function(c,e){var f=b("#aside_container aside.active"),g=f.data("transition"),h=f.data("position")||"left",i="left"==h?"-100%":"100%",j=function(){f.removeClass("active"),a.hasMenuOpen=!1,e&&e.call(this)};"overlay"==g?a.anim(f,{translateX:i},c,j):"reveal"==g?a.anim(d,{translateX:"0"},c,j):(a.anim(f,{translateX:i},c),a.anim(d,{translateX:"0"},c,j)),b("#section_container_mask").hide()};return{init:f,show:g,hide:h}}(Jingle,Zepto),Jingle.Page=function(a,b){var c=function(a){return 0==a.indexOf("#")?a.substr(1):a},d=function(d){var e=c(d),f=a.settings.remotePage[e]||a.settings.basePagePath+e+".html";return f?(a.settings.showPageLoading&&a.showMask("正在加载..."),b.ajax({url:f,timeout:1e4,async:!1,success:function(c){a.settings.showPageLoading&&a.hideMask(),b("#section_container").append(c),b("#"+e).trigger("pageload"),a.Element.init(d)}}),void 0):(console.error(404,"页面不存在!"),void 0)},e=function(a){return b.ajax({url:a,timeout:1e4,async:!1}).responseText};return{load:d,loadContent:e}}(Jingle,Zepto),Jingle.Router=function(a,b){var c=[],d=function(){b(window).on("popstate",f),b(document).on("click","a",function(a){var c=b(this).data("target");return c&&"link"==c?void 0:(a.preventDefault(),!1)}),b(document).on("tap","a",function(a){var c=b(this).data("target");c?"link"!=c&&(a.preventDefault(),g.call(this)):a.preventDefault()}),e()},e=function(){var a=b("#section_container section.active");k("#"+a.attr("id")),a.trigger("pageinit").trigger("pageshow").data("init",!0)},f=function(a){if(a.state&&a.state.hash){var b=a.state.hash;b===c[1]&&i()}},g=function(){var a=b(this),c=a.attr("data-target"),d=a.attr("href");switch(c){case"section":h(d);break;case"article":l(d,a);break;case"menu":m(d);break;case"back":i()}},h=function(d){return a.hasMenuOpen?(a.Menu.hide(200,function(){h(d)}),void 0):(c[0]!==d&&(k(d),0===b(d).length&&a.Page.load(d),j(c[1],d)),void 0)},i=function(){j(c.shift(),c[0],!0),window.history.replaceState({hash:c[0]},"",c[0])},j=function(b,c,d){a.Transition.run(b,c,d)},k=function(a){c.unshift(a),window.history.pushState({hash:a},"",a)},l=function(a,c){var d=b(a);if(!d.hasClass("active")){c.addClass("active").siblings(".active").removeClass("active");var e=d.addClass("active").siblings(".active").removeClass("active");d.trigger("articleshow"),e.trigger("articlehide")}},m=function(b){a.hasMenuOpen?a.Menu.hide():a.Menu.show(b)};return{init:d,turnTo:h,showArticle:l,back:i}}(Jingle,Zepto),Jingle.Service=function(a,b){function c(a,c,d,e){var f=!b.isFunction(c);return{url:a,data:f?c:void 0,success:f?b.isFunction(d)?d:void 0:c,dataType:f?e||d:d}}var d="JINGLE_POST_DATA",e="JINGLE_GET_",f=function(a){"post"==a.type?g(a):h(a)},g=function(c){a.offline?(k(c.url,c.data),c.success("数据已存至本地")):b.ajax(c)},h=function(c){var d=c.url+JSON.stringify(c.data);if(a.offline){var e=i(d);e?c.success(e.data,d,e.cacheTime):c.success(e)}else{var f=c.success;c.success=function(a){j(d,a),f(a,d)},b.ajax(c)}},i=function(a){return JSON.parse(window.localStorage.getItem(e+a))},j=function(a,b){var c={data:b,cacheTime:new Date};window.localStorage.setItem(e+a,JSON.stringify(c))},k=function(a,b){var c=l();c=c||{},c[a]={data:b,createdTime:new Date},window.localStorage.setItem(d,JSON.stringify(c))},l=function(a){var b=JSON.parse(window.localStorage.getItem(d));return b&&a?b[a]:b},m=function(a){if(a){var b=l();delete b[a],window.localStorage.setItem(d,JSON.stringify(b))}else window.localStorage.removeItem(d)},n=function(a,c,d){var e=l(a).data;b.ajax({url:a,contentType:"application/json",data:e,type:"post",success:function(){c(a)},error:function(){d(a)}})},o=function(a,b){var c=l();for(var d in c)n(d,a,b);m()},p=function(){return f(c.apply(null,arguments))},q=function(){var a=c.apply(null,arguments);return a.type="POST",f(a)},r=function(){var a=c.apply(null,arguments);return a.dataType="json",f(a)},s=function(){for(var a=window.localStorage,b=[],c=0;c
'+c+"
";b(a).html(e)},d=function(a){c(a,"没有找到相关数据","drawer")},e=function(a){c(a,"加载中...","cloud-download")},f=function(c,e,f,g){var h=b(c),g=g||"replace";if("array"==b.type(f)&&0==f.length)d(h);else{var i=b(template(e,f));"replace"==g?h.html(i):h.append(i),a.Element.init(i)}};return{render:f,background:c,loading:e,no_result:d}}(Jingle,Zepto),Jingle.Toast=function(a,b){var c,d,e=5e3,f={toast:'{value}',success:'{value}',error:'{value}',info:'{value}'},g="toast",h=function(){b("body").append('
'),c=b("#jingle_toast"),k()},i=function(){a.anim(c,"scaleOut",function(){c.hide()})},j=function(b,h,j){d&&clearTimeout(d),g=b,c.attr("class",b).html(f[b].replace("{value}",h)).show(),a.anim(c,"scaleIn"),0!==j&&(d=setTimeout(i,j||e))},k=function(){c.on("tap",'[data-target="close"]',function(){i()})};return h(),{show:j,hide:i}}(Jingle,Zepto),Jingle.Transition=function(a,b){var c,d,e,f,g={slide:[["slideLeftOut","slideLeftIn"],["slideRightOut","slideRightIn"]],slideUp:[["","slideUpIn"],["slideDownOut",""]],slideDown:[["","slideDownIn"],["slideUpOut",""]],scale:[["","scaleIn"],["scaleOut",""]]},h=function(){var a=f[0],b=f[1],c=e;""==b?(b=" activing "+b,a=" active "+a,c=d):(b=" active "+b,a=" activing "+a),c.bind("webkitAnimationEnd.jingle",i),d.attr("class",a),e.attr("class",b)},i=function(){d.off("webkitAnimationEnd.jingle"),e.off("webkitAnimationEnd.jingle"),d.attr("class",""),e.attr("class","active"),e.data("init")||(e.trigger("pageinit"),e.data("init",!0)),d.trigger("pagehide",[c]),e.trigger("pageshow",[c]),d.find("article.active").trigger("articlehide"),e.find("article.active").trigger("articleshow")},j=function(i,j,k){c=k,d=b(i),e=b(j);var l=c?d.attr("data-transition"):e.attr("data-transition");l=l||a.settings.transitionType,f=c?g[l][1]:g[l][0],h()},k=function(a,b,c,d,e){return g[a]?(console.error("该转场动画已经存在,请检查你自定义的动画名称(名称不能重复)"),void 0):(g[a]=[[b,c],[d,e]],void 0)};return{run:j,add:k}}(Jingle,$),Jingle.Popup=function(a,b){var c,d,e,f,g={top:{top:0,left:0,right:0},"top-second":{top:"44px",left:0,right:0},center:{top:"50%",left:"5%",right:"5%","border-radius":"3px"},bottom:{bottom:0,left:0,right:0},"bottom-second":{bottom:"51px",left:0,right:0}},h={top:["slideDownIn","slideUpOut"],bottom:["slideUpIn","slideDownOut"],defaultAnim:["scaleIn","scaleOut"]},i={alert:'',confirm:'',loading:'

{title}

'},j=function(){b("body").append('
'),d=b("#jingle_popup_mask"),c=b("#jingle_popup"),m()},k=function(i){var j={height:void 0,width:void 0,opacity:.3,url:null,tplId:null,tplData:null,html:"",pos:"center",clickMask2Close:!0,showCloseBtn:!0,arrowDirection:void 0,animation:!0,onShow:void 0};b.extend(j,i),f=j.clickMask2Close,d.css("opacity",j.opacity),c.attr({style:"","class":""}),j.width&&c.width(j.width),j.height&&c.height(j.height);var k=b.type(j.pos);if("object"==k)c.css(j.pos),e=h.defaultAnim;else{if("string"!=k)return console.error("错误的参数!"),void 0;if(g[j.pos]){c.css(g[j.pos]);var l=j.pos.indexOf("top")>-1?"top":j.pos.indexOf("bottom")>-1?"bottom":"defaultAnim";e=h[l]}else c.addClass(j.pos),e=h.defaultAnim}d.show();var m;if(j.html?m=j.html:j.url?m=a.Page.loadContent(j.url):j.tplId&&(m=template(j.tplId,j.tplData)),j.showCloseBtn&&(m+='
'),j.arrowDirection&&(c.addClass("arrow "+j.arrowDirection),c.css("padding","8px"),("top"==j.arrowDirection||"bottom"==j.arrowDirection)&&(e=h[j.arrowDirection])),c.html(m).show(),j.onShow&&j.onShow.call(c),"center"==j.pos){var n=c.height();c.css("margin-top","-"+n/2+"px")}a.Element.init(c),j.animation&&a.anim(c,e[0]),a.hasPopupOpen=!0},l=function(b){d.hide(),e&&!b?a.anim(c,e[1],function(){c.hide(),a.hasPopupOpen=!1}):(c.hide(),a.hasPopupOpen=!1)},m=function(){d.on("tap",function(){f&&l()}),c.on("tap",'[data-target="closePopup"]',function(){l()})},n=function(a,b){var c=i.alert.replace("{title}",a).replace("{content}",b).replace("{ok}","确定");k({html:c,pos:"center",clickMask2Close:!1,showCloseBtn:!1})},o=function(a,c,d,e){var f=i.confirm.replace("{title}",a).replace("{content}",c).replace("{cancel}","取消").replace("{ok}","确定");k({html:f,pos:"center",clickMask2Close:!1,showCloseBtn:!1}),b('#popup_btn_container [data-icon="checkmark"]').tap(function(){l(),d.call(this)}),b('#popup_btn_container [data-icon="close"]').tap(function(){l(),e.call(this)})},p=function(a,b,c,d){k({html:a,pos:b,showCloseBtn:!1,arrowDirection:c,onShow:d})},q=function(a){var b=i.loading.replace("{title}",a||"加载中...");k({html:b,pos:"loading",opacity:0,animation:!1,clickMask2Close:!1})},r=function(a){var c='
';b.each(a,function(a,b){c+='"}),c+='',c+="
",k({html:c,pos:"bottom",showCloseBtn:!1,onShow:function(){b(this).find("button").each(function(c,d){b(d).on("tap",function(){a[c]&&a[c].handler&&a[c].handler.call(d),l()})})}})};return j(),{show:k,close:l,alert:n,confirm:o,popover:p,loading:q,actionsheet:r}}(Jingle,Zepto),Jingle.Selected=function(a,b){var c,d,e="[data-selected]",f=function(){b(document).on("touchstart.selected",e,function(){var a=b(this);d=setTimeout(function(){c=a.addClass(a.data("selected"))},50)}),b(document).on("touchmove.selected touchend.selected touchcancel.selected",function(){d&&clearTimeout(d),c&&(c.removeClass(c.data("selected")),c=null)})};return{init:f}}(Jingle,Zepto),Jingle.Cache=function(a,b){var c="_J_P_",d="_J_",e=function(a,b){var c={data:b,cacheTime:new Date};window.localStorage.setItem(d+a,JSON.stringify(c))},f=function(a){return JSON.parse(window.localStorage.getItem(d+a))},g=function(a,b){var d=h();d=d||{},d[a]={data:b,createdTime:new Date},window.localStorage.setItem(c,JSON.stringify(d))},h=function(a){var b=JSON.parse(window.localStorage.getItem(c));return b&&a?b[a]:b},i=function(a){if(a){var b=h();delete b[a],window.localStorage.setItem(c,JSON.stringify(b))}else window.localStorage.removeItem(c)},j=function(a,c,d){function e(a){var e=h(a).data;b.ajax({url:a,contentType:"application/json",data:e,type:"post",success:function(){g++,i(a),g==f&&c(a)},error:function(){d(a)}})}var f,g=0;if("string"==b.type(a))f=1,e(a);else{var j=h();if(!j)return;f=j.length;for(var a in j)e(a)}},k=function(){var a=window.localStorage;for(var b in a)0==b.indexOf(d)&&a.removeItem(b);a.removeItem(c)};return{get:f,save:e,getPost:h,savePost:g,removePost:i,syncPost:j,clear:k}}(Jingle,Zepto),function(a,b){var c=function(c,d){var e,f,g,h,i,j,k={months:["01月","02月","03月","04月","05月","06月","07月","08月","09月","10月","11月","12月"],days:["日","一","二","三","四","五","六"],swipeable:!0,date:new Date,onRenderDay:void 0,onSelect:void 0},l=this,m=b(c),n=function(){l.settings=b.extend({},k,d),i=l.settings.date.getFullYear(),j=l.settings.date.getMonth(),h=new Date(i,j,l.settings.date.getDate()),q(),v()},o=function(a){return new Date(a.getFullYear(),a.getMonth(),1).getDay()},p=function(a){return new Date(a.getFullYear(),a.getMonth()+1,0).getDate()},q=function(){var a="";a+='
',a+=r(i,j),a+=s(),a+='
',a+=t(h),a+="
",m.html(a);var b=m.find("span");e=b.eq(0),f=b.eq(1),g=m.find(".jingle-calendar-body")},r=function(a,b){var c='
';return c+='
    ',f=0;h>f;f++)c+='
  • ';c+="
",d.append(c),e=d.find(".dots"),e.children().css("width",a+"px"),e.find("li").on("tap",function(){var a=b(this).attr("index");u(parseInt(a),p)})}},u=function(a,c){c=c||p,f.css({"-webkit-transition-duration":c+"ms","-webkit-transform":"translate3D("+-(a*i)+"px,0,0)"}),o!=a&&(o=a,e&&b(e.find("li").get(o)).addClass("active").siblings().removeClass("active"),l(o))},v=function(){f.on("touchstart",w,!1),f.on("touchmove",x,!1),f.on("touchend",y,!1)},w=function(a){var b=a.touches[0];start={pageX:b.pageX,pageY:b.pageY,time:Number(new Date)},isScrolling=void 0,j=0,f[0].style.webkitTransitionDuration=0,n=!0},x=function(a){if(n){var b=a.touches[0];if(j=b.pageX-start.pageX,"undefined"==typeof isScrolling&&(isScrolling=Math.abs(j)0||o==h-1&&0>j;if(c)return;var d=j-o*i;f[0].style.webkitTransform="translate3D("+d+"px,0,0)"}}},y=function(){var a=Number(new Date)-start.time<250&&Math.abs(j)>20||Math.abs(j)>i/3,b=!o&&j>0||o==h-1&&0>j;isScrolling||(m(o,j)?u(o+(a&&!b?0>j?1:-1:0),p):u(o)),n=!1};r(),v(),this.refresh=function(){f.attr("style",""),r()},this.prev=function(){o&&u(o-1,p)},this.next=function(){h-1>o&&u(o+1,p)},this.index=function(a){u(a)}}a.Slider=c}(Jingle,Zepto),function(a,b){function c(c,d,e){var f,g,h,i,j,k,l,m={selector:void 0,type:"pullDown",minPullHeight:10,pullText:"下拉刷新...",releaseText:"松开立即刷新...",refreshText:"刷新中...",refreshTip:!1,onPullIcon:"arrow-down-2",onReleaseIcon:"icon-reverse",onRefreshIcon:"spinner",callback:void 0};"object"==typeof c?b.extend(m,c):(m.selector=c,m.type=d,m.callback=e,"pullUp"===d&&b.extend(m,{pullText:"上拉加载更多...",releaseText:"松开开立即加载...",refreshText:"加载中...",onPullIcon:"arrow-up-3"})),l="pullDown"===m.type?!0:!1;var n=function(a){g=b(a.selector).children()[0];var c='
'+a.pullText+""+(a.refreshTip?'
'+a.refreshTip+"
":"")+"
";h=l?b(c).prependTo(g):b(c).appendTo(g),k=h.height(),i=h.find(".refresh-icon"),j=h.find(".refresh-label")},o=function(b){return a.Scroll(b.selector,{topOffset:l?k:0,bounce:!0,onScrollMove:function(){this.y>b.minPullHeight&&l&&!i.hasClass(b.onReleaseIcon)?(i.addClass(b.onReleaseIcon),j.html(b.releaseText),this.minScrollY=0):this.ythis.maxScrollY+b.minPullHeight&&!l&&i.hasClass(b.onReleaseIcon)&&(i.removeClass(b.onReleaseIcon),j.html(b.pullText),this.maxScrollY=k)},onScrollEnd:function(){if(i.hasClass(b.onReleaseIcon)){i.removeClass(b.onReleaseIcon).removeClass(b.onPullIcon).addClass(b.onRefreshIcon),j.html(b.refreshText);var a=this;setTimeout(function(){b.callback.call(a)},1)}},onRefresh:function(){i.removeClass(b.onRefreshIcon).addClass(b.onPullIcon),j.html(b.pullText)}})};return n(m),f=o(m)}var d={},e=1;a.Refresh=function(a,f,g){var h,i;if(h=a.selector?b(a.selector):b(a),i=h.data("_jrefresh_"),i&&d[i])return d[i];i="_jrefresh_"+e++,h.data("_jrefresh_",i);var j=new c(a,f,g);return d[i]={scroller:j.scroller,destroy:function(){delete d[i],j.destroy(),b(".refresh-container",a).remove()}}}}(Jingle,Zepto); -------------------------------------------------------------------------------- /assets/www/js/lib/pgPlugin.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | if(!window.plugins) { 3 | window.plugins = {}; 4 | } 5 | /** 6 | * 条码扫描 7 | * @type {Object} 8 | */ 9 | window.plugins.barcodeScanner = { 10 | scan : function(mode,win,err){ 11 | cordova.exec(win, err, "BarcodeScanner", "scan", [mode]); 12 | } 13 | } 14 | /** 15 | * 对key进行签名 16 | * @type {Object} 17 | */ 18 | window.plugins.eoeSign = { 19 | get : function(key,win,err){ 20 | cordova.exec(win, err, "Sign", "get", [key]); 21 | } 22 | } 23 | })(); 24 | -------------------------------------------------------------------------------- /assets/www/js/lib/template.min.js: -------------------------------------------------------------------------------- 1 | /*!artTemplate - Template Engine*/var template=function(a,b){return template["object"==typeof b?"render":"compile"].apply(template,arguments)};(function(a,b){"use strict";a.version="2.0.1",a.openTag="<%",a.closeTag="%>",a.isEscape=!0,a.isCompress=!1,a.parser=null,a.render=function(a,b){var c=d(a);return void 0===c?e({id:a,name:"Render Error",message:"No Template"}):c(b)},a.compile=function(b,d){function l(c){try{return new j(c)+""}catch(f){return h?(f.id=b||d,f.name="Render Error",f.source=d,e(f)):a.compile(b,d,!0)(c)}}var g=arguments,h=g[2],i="anonymous";"string"!=typeof d&&(h=g[1],d=g[0],b=i);try{var j=f(d,h)}catch(k){return k.id=b||d,k.name="Syntax Error",e(k)}return l.prototype=j.prototype,l.toString=function(){return""+j},b!==i&&(c[b]=l),l},a.helper=function(b,c){a.prototype[b]=c},a.onerror=function(a){var c="[template]:\n"+a.id+"\n\n[name]:\n"+a.name;a.message&&(c+="\n\n[message]:\n"+a.message),a.line&&(c+="\n\n[line]:\n"+a.line,c+="\n\n[source]:\n"+a.source.split(/\n/)[a.line-1].replace(/^[\s\t]+/,"")),a.temp&&(c+="\n\n[temp]:\n"+a.temp),b.console&&console.error(c)};var c={},d=function(d){var e=c[d];if(void 0===e&&"document"in b){var f=document.getElementById(d);if(f){var g=f.value||f.innerHTML;return a.compile(d,g.replace(/^\s*|\s*$/g,""))}}else if(c.hasOwnProperty(d))return e},e=function(b){function c(){return c+""}return a.onerror(b),c.toString=function(){return"{Template Error}"},c},f=function(){a.prototype={$render:a.render,$escape:function(a){return"string"==typeof a?a.replace(/&(?![\w#]+;)|[<>"']/g,function(a){return{"<":"<",">":">",'"':""","'":"'","&":"&"}[a]}):a},$string:function(a){return"string"==typeof a||"number"==typeof a?a:"function"==typeof a?a():""}};var b=Array.prototype.forEach||function(a,b){for(var c=this.length>>>0,d=0;c>d;d++)d in this&&a.call(b,this[d],d,this)},c=function(a,c){b.call(a,c)},d="break,case,catch,continue,debugger,default,delete,do,else,false,finally,for,function,if,in,instanceof,new,null,return,switch,this,throw,true,try,typeof,var,void,while,with,abstract,boolean,byte,char,class,const,double,enum,export,extends,final,float,goto,implements,import,int,interface,long,native,package,private,protected,public,short,static,super,synchronized,throws,transient,volatile,arguments,let,yield,undefined",e=/\/\*(?:.|\n)*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|'[^']*'|"[^"]*"|[\s\t\n]*\.[\s\t\n]*[$\w\.]+/g,f=/[^\w$]+/g,g=RegExp(["\\b"+d.replace(/,/g,"\\b|\\b")+"\\b"].join("|"),"g"),h=/\b\d[^,]*/g,i=/^,+|,+$/g,j=function(a){return a=a.replace(e,"").replace(f,",").replace(g,"").replace(h,"").replace(i,""),a=a?a.split(/,+/):[]};return function(b,d){function w(b){return k+=b.split(/\n/).length-1,a.isCompress&&(b=b.replace(/[\n\r\t\s]+/g," ")),b=b.replace(/('|\\)/g,"\\$1").replace(/\r/g,"\\r").replace(/\n/g,"\\n"),b=q[1]+"'"+b+"'"+q[2],b+"\n"}function x(b){var c=k;if(g?b=g(b):d&&(b=b.replace(/\n/g,function(){return k++,"$line="+k+";"})),0===b.indexOf("=")){var e=0!==b.indexOf("==");if(b=b.replace(/^=*|[\s;]*$/g,""),e&&a.isEscape){var f=b.replace(/\s*\([^\)]+\)/,"");m.hasOwnProperty(f)||/^(include|print)$/.test(f)||(b="$escape($string("+b+"))")}else b="$string("+b+")";b=q[1]+b+q[2]}return d&&(b="$line="+c+";"+b),y(b),b+"\n"}function y(a){a=j(a),c(a,function(a){l.hasOwnProperty(a)||(z(a),l[a]=!0)})}function z(a){var b;"print"===a?b=s:"include"===a?(n.$render=m.$render,b=t):(b="$data."+a,m.hasOwnProperty(a)&&(n[a]=m[a],b=0===a.indexOf("$")?"$helpers."+a:b+"===undefined?$helpers."+a+":"+b)),o+=a+"="+b+","}var e=a.openTag,f=a.closeTag,g=a.parser,h=b,i="",k=1,l={$data:!0,$helpers:!0,$out:!0,$line:!0},m=a.prototype,n={},o="var $helpers=this,"+(d?"$line=0,":""),p="".trim,q=p?["$out='';","$out+=",";","$out"]:["$out=[];","$out.push(",");","$out.join('')"],r=p?"if(content!==undefined){$out+=content;return content}":"$out.push(content);",s="function(content){"+r+"}",t="function(id,data){if(data===undefined){data=$data}var content=$helpers.$render(id,data);"+r+"}";c(h.split(e),function(a){a=a.split(f);var c=a[0],d=a[1];1===a.length?i+=w(c):(i+=x(c),d&&(i+=w(d)))}),h=i,d&&(h="try{"+h+"}catch(e){"+"e.line=$line;"+"throw e"+"}"),h="'use strict';"+o+q[0]+h+"return new String("+q[3]+")";try{var u=Function("$data",h);return u.prototype=n,u}catch(v){throw v.temp="function anonymous($data) {"+h+"}",v}}}()})(template,this),"function"==typeof define?define(function(a,b,c){c.exports=template}):"undefined"!=typeof exports&&(module.exports=template);(function(exports){exports.openTag="{";exports.closeTag="}";exports.parser=function(code){code=code.replace(/^\s/,"");var args=code.split(" ");var key=args.shift();var keywords=exports.keywords;var fuc=keywords[key];if(fuc&&keywords.hasOwnProperty(key)){args=args.join(" ");code=fuc.call(code,args)}else{if(exports.prototype.hasOwnProperty(key)){args=args.join(",");code="=="+key+"("+args+");"}else{code=code.replace(/[\s;]*$/,"");code="="+code}}return code};exports.keywords={"if":function(code){return"if("+code+"){"},"else":function(code){code=code.split(" ");if(code.shift()==="if"){code=" if("+code.join(" ")+")"}else{code=""}return"}else"+code+"{"},"/if":function(){return"}"},"each":function(code){code=code.split(" ");var object=code[0]||"$data";var as=code[1]||"as";var value=code[2]||"$value";var index=code[3]||"$index";var args=value+","+index;if(as!=="as"){object="[]"}return"$each("+object+",function("+args+"){"},"/each":function(){return"});"},"echo":function(code){return"print("+code+");"},"include":function(code){code=code.split(" ");var id=code[0];var data=code[1];var args=id+(data?(","+data):"");return"include("+args+");"}};exports.helper("$each",function(data,callback){var isArray=Array.isArray||function(obj){return Object.prototype.toString.call(obj)==="[object Array]"};if(isArray(data)){for(var i=0,len=data.length;i 1) { 31 | if (mappedevent) { 32 | callback = fakeTouches(type, callback, context); 33 | } 34 | 35 | result.push(callback); 36 | } 37 | 38 | 39 | return result; 40 | } 41 | function fakeTouches(type, callback, context) { 42 | // wrap the callback with a function that adds a fake 43 | // touches property to the event. 44 | 45 | return _fakeCallbacks[callback] = function (event) { 46 | if(event.liveFired)context = this;//if it is delegate event,change context to target element 47 | if (event.button) { 48 | return false; 49 | } 50 | event.touches = [{ 51 | length: 1,// 1 mouse (finger) 52 | clientX: event.clientX, 53 | clientY: event.clienty, 54 | pageX: event.pageX, 55 | pageY: event.pageY, 56 | screenX: event.screenX, 57 | screenY: event.screenY, 58 | target: event.target 59 | }] 60 | 61 | event.touchtype = type; 62 | 63 | return callback.apply(context, [event]); 64 | } 65 | } 66 | 67 | var _bind = $.fn.bind; 68 | $.fn.bind = function(event, callback){ 69 | return _bind.apply(this, touch2mouse(event, callback, this)); 70 | }; 71 | var _unbind = $.fn.unbind; 72 | $.fn.unbind = function(event, callback){ 73 | if (!event) { 74 | _unbind.apply(this); 75 | return; 76 | } 77 | var result = _unbind.apply(this, touch2mouse(event).concat([_fakeCallbacks[callback]||callback])); 78 | delete(_fakeCallbacks[callback]); 79 | return result; 80 | }; 81 | var _one = $.fn.one; 82 | $.fn.one = function(event, callback){ 83 | return _one.apply(this, touch2mouse(event, callback, this)); 84 | }; 85 | var _delegate = $.fn.delegate; 86 | $.fn.delegate = function(selector, event, callback){ 87 | return _delegate.apply(this, [selector].concat(touch2mouse(event, callback, this))); 88 | }; 89 | var _undelegate = $.fn.undelegate; 90 | $.fn.undelegate = function(selector, event, callback){ 91 | var result = _undelegate.apply(this, [selector].concat(touch2mouse(event), [_fakeCallbacks[callback]||callback])); 92 | delete(_fakeCallbacks[callback]); 93 | return result; 94 | }; 95 | var _live = $.fn.live; 96 | $.fn.live = function(event, callback){ 97 | return _live.apply(this, touch2mouse(event, callback, this)); 98 | }; 99 | var _die = $.fn.die; 100 | $.fn.die = function(event, callback){ 101 | var result = _die.apply(this, touch2mouse(event).concat([_fakeCallbacks[callback]||callback])); 102 | delete(_fakeCallbacks[callback]); 103 | return result; 104 | }; 105 | var _trigger = $.fn.trigger; 106 | $.fn.trigger = function(event, data){ 107 | return _trigger.apply(this, touch2mouse(event).concat([data])); 108 | }; 109 | var _triggerHandler = $.fn.triggerHandler; 110 | $.fn.triggerHandler = function(event, data){ 111 | return _triggerHandler.apply(this, touch2mouse(event).concat([data])); 112 | }; 113 | // var _on = $.fn.on; 114 | // $.fn.on = function(event, selector, callback){ 115 | // return _on.apply(this, touch2mouse(event).concat([selector])); 116 | // } 117 | // var _off = $.fn.off; 118 | 119 | } 120 | })(Zepto); -------------------------------------------------------------------------------- /gen/com/jingle/eoe/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /** Automatically generated file. DO NOT MODIFY */ 2 | package com.jingle.eoe; 3 | 4 | public final class BuildConfig { 5 | public final static boolean DEBUG = true; 6 | } -------------------------------------------------------------------------------- /gen/com/jingle/eoe/R.java: -------------------------------------------------------------------------------- 1 | /* AUTO-GENERATED FILE. DO NOT MODIFY. 2 | * 3 | * This class was automatically generated by the 4 | * aapt tool from the resource data it found. It 5 | * should not be modified by hand. 6 | */ 7 | 8 | package com.jingle.eoe; 9 | 10 | public final class R { 11 | public static final class attr { 12 | } 13 | public static final class color { 14 | public static final int possible_result_points=0x7f070002; 15 | public static final int result_view=0x7f070000; 16 | public static final int viewfinder_mask=0x7f070001; 17 | } 18 | public static final class drawable { 19 | public static final int barcode_back=0x7f020000; 20 | public static final int barcode_back_btn=0x7f020001; 21 | public static final int barcode_bg=0x7f020002; 22 | public static final int icon=0x7f020003; 23 | public static final int splashscreen=0x7f020004; 24 | } 25 | public static final class id { 26 | /** Messages IDs 27 | */ 28 | public static final int auto_focus=0x7f060000; 29 | public static final int button_back=0x7f06000b; 30 | public static final int decode=0x7f060001; 31 | public static final int decode_failed=0x7f060002; 32 | public static final int decode_succeeded=0x7f060003; 33 | public static final int encode_failed=0x7f060004; 34 | public static final int encode_succeeded=0x7f060005; 35 | public static final int preview_view=0x7f060009; 36 | public static final int quit=0x7f060006; 37 | public static final int restart_preview=0x7f060007; 38 | public static final int return_scan_result=0x7f060008; 39 | public static final int textview_title=0x7f06000c; 40 | public static final int viewfinder_view=0x7f06000a; 41 | } 42 | public static final class layout { 43 | public static final int activity_capture=0x7f030000; 44 | } 45 | public static final class raw { 46 | public static final int beep=0x7f050000; 47 | } 48 | public static final class string { 49 | public static final int app_name=0x7f080003; 50 | public static final int scan_back=0x7f080001; 51 | public static final int scan_text=0x7f080000; 52 | public static final int scan_title=0x7f080002; 53 | } 54 | public static final class xml { 55 | public static final int config=0x7f040000; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shixy/eoeh5/c4d23358e3408e134f92b9c1bbf44174684591ec/libs/android-support-v4.jar -------------------------------------------------------------------------------- /libs/cordova-2.9.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shixy/eoeh5/c4d23358e3408e134f92b9c1bbf44174684591ec/libs/cordova-2.9.0.jar -------------------------------------------------------------------------------- /libs/zxing2.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shixy/eoeh5/c4d23358e3408e134f92b9c1bbf44174684591ec/libs/zxing2.3.jar -------------------------------------------------------------------------------- /lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-17 15 | -------------------------------------------------------------------------------- /res/drawable-hdpi/barcode_back.9.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shixy/eoeh5/c4d23358e3408e134f92b9c1bbf44174684591ec/res/drawable-hdpi/barcode_back.9.PNG -------------------------------------------------------------------------------- /res/drawable-hdpi/barcode_back_btn.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /res/drawable-hdpi/barcode_bg.9.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shixy/eoeh5/c4d23358e3408e134f92b9c1bbf44174684591ec/res/drawable-hdpi/barcode_bg.9.PNG -------------------------------------------------------------------------------- /res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shixy/eoeh5/c4d23358e3408e134f92b9c1bbf44174684591ec/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /res/drawable-hdpi/splashscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shixy/eoeh5/c4d23358e3408e134f92b9c1bbf44174684591ec/res/drawable-hdpi/splashscreen.png -------------------------------------------------------------------------------- /res/layout/activity_capture.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 16 | 17 | 22 | 23 |