├── .clang-format ├── .gitattributes ├── .github └── workflows │ ├── ci.yml │ └── clang-format.yml ├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── LICENSE ├── NanoLog.hpp ├── README.en.md ├── README.md ├── cfg └── feather.cfg ├── dao.hpp ├── demo.png ├── demo ├── README.md ├── docker-compose.yaml └── feather │ ├── Dockerfile │ ├── data │ └── cfg │ │ └── feather.cfg │ └── entrypoint.sh ├── docs └── featehr 使用.md ├── entity.h ├── feather.h ├── feather.sql ├── feather_cfg.hpp ├── framework.png ├── main.cpp ├── md5.hpp ├── nlohmann_json.hpp ├── purecpp ├── css │ ├── about.css │ ├── animate.min.css │ ├── article.css │ ├── detail.css │ ├── dropdown.css │ ├── github-markdown.css │ ├── global.css │ ├── home.css │ ├── prettify.css │ ├── resource.css │ └── timeline.css ├── html │ ├── about.html │ ├── article.html │ ├── book_course.html │ ├── category.html │ ├── create_post.html │ ├── detail.html │ ├── edit_post.html │ ├── footer.html │ ├── header.html │ ├── home.html │ ├── home1.html │ ├── login.html │ ├── member_edit.html │ ├── my_post.html │ ├── navigator.html │ ├── notice.html │ ├── query_cppcon.html │ ├── query_cppcon_result.html │ ├── register_cppcon.html │ ├── register_user_group.html │ ├── resource.html │ ├── righter.html │ ├── search.html │ ├── sign_out.html │ ├── sign_up.html │ └── timeline.html ├── images │ ├── cover │ │ └── logo6.png │ ├── qq_32.png │ ├── qzone_32.png │ ├── wechat_32.png │ └── weibo_32.png ├── js │ ├── about.js │ ├── detail.js │ ├── global.js │ ├── home.js │ ├── jquery.js │ ├── prettify.js │ └── uikit.min.js └── plug │ ├── font-awesome │ ├── HELP-US-OUT.txt │ ├── css │ │ ├── font-awesome.css │ │ └── font-awesome.min.css │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ ├── less │ │ ├── animated.less │ │ ├── bordered-pulled.less │ │ ├── core.less │ │ ├── fixed-width.less │ │ ├── font-awesome.less │ │ ├── icons.less │ │ ├── larger.less │ │ ├── list.less │ │ ├── mixins.less │ │ ├── path.less │ │ ├── rotated-flipped.less │ │ ├── screen-reader.less │ │ ├── stacked.less │ │ └── variables.less │ └── scss │ │ ├── _animated.scss │ │ ├── _bordered-pulled.scss │ │ ├── _core.scss │ │ ├── _fixed-width.scss │ │ ├── _icons.scss │ │ ├── _larger.scss │ │ ├── _list.scss │ │ ├── _mixins.scss │ │ ├── _path.scss │ │ ├── _rotated-flipped.scss │ │ ├── _screen-reader.scss │ │ ├── _stacked.scss │ │ ├── _variables.scss │ │ └── font-awesome.scss │ ├── laymd │ ├── laymd │ │ ├── laymd.css │ │ ├── laymd.js │ │ ├── marked.min.js │ │ └── preview.css │ └── layui │ │ ├── css │ │ ├── layui.js │ │ └── modules │ │ │ ├── code.css │ │ │ ├── laydate │ │ │ ├── icon.png │ │ │ └── laydate.css │ │ │ └── layer │ │ │ └── default │ │ │ ├── icon-ext.png │ │ │ ├── icon.png │ │ │ ├── layer.css │ │ │ ├── loading-0.gif │ │ │ ├── loading-1.gif │ │ │ └── loading-2.gif │ │ ├── lay │ │ └── modules │ │ │ ├── element.js │ │ │ ├── form.js │ │ │ ├── jquery.js │ │ │ ├── layer.js │ │ │ ├── upload.js │ │ │ └── util.js │ │ ├── layui.all.js │ │ └── layui.js │ └── layui │ ├── css │ ├── layui.css │ ├── layui.mobile.css │ └── modules │ │ ├── code.css │ │ ├── laydate │ │ ├── default │ │ │ └── laydate.css │ │ ├── icon.png │ │ └── laydate.css │ │ └── layer │ │ └── default │ │ ├── icon-ext.png │ │ ├── icon.png │ │ ├── layer.css │ │ ├── loading-0.gif │ │ ├── loading-1.gif │ │ └── loading-2.gif │ ├── font │ ├── iconfont.eot │ ├── iconfont.svg │ ├── iconfont.ttf │ └── iconfont.woff │ ├── images │ └── face │ │ ├── 0.gif │ │ ├── 1.gif │ │ ├── 10.gif │ │ ├── 11.gif │ │ ├── 12.gif │ │ ├── 13.gif │ │ ├── 14.gif │ │ ├── 15.gif │ │ ├── 16.gif │ │ ├── 17.gif │ │ ├── 18.gif │ │ ├── 19.gif │ │ ├── 2.gif │ │ ├── 20.gif │ │ ├── 21.gif │ │ ├── 22.gif │ │ ├── 23.gif │ │ ├── 24.gif │ │ ├── 25.gif │ │ ├── 26.gif │ │ ├── 27.gif │ │ ├── 28.gif │ │ ├── 29.gif │ │ ├── 3.gif │ │ ├── 30.gif │ │ ├── 31.gif │ │ ├── 32.gif │ │ ├── 33.gif │ │ ├── 34.gif │ │ ├── 35.gif │ │ ├── 36.gif │ │ ├── 37.gif │ │ ├── 38.gif │ │ ├── 39.gif │ │ ├── 4.gif │ │ ├── 40.gif │ │ ├── 41.gif │ │ ├── 42.gif │ │ ├── 43.gif │ │ ├── 44.gif │ │ ├── 45.gif │ │ ├── 46.gif │ │ ├── 47.gif │ │ ├── 48.gif │ │ ├── 49.gif │ │ ├── 5.gif │ │ ├── 50.gif │ │ ├── 51.gif │ │ ├── 52.gif │ │ ├── 53.gif │ │ ├── 54.gif │ │ ├── 55.gif │ │ ├── 56.gif │ │ ├── 57.gif │ │ ├── 58.gif │ │ ├── 59.gif │ │ ├── 6.gif │ │ ├── 60.gif │ │ ├── 61.gif │ │ ├── 62.gif │ │ ├── 63.gif │ │ ├── 64.gif │ │ ├── 65.gif │ │ ├── 66.gif │ │ ├── 67.gif │ │ ├── 68.gif │ │ ├── 69.gif │ │ ├── 7.gif │ │ ├── 70.gif │ │ ├── 71.gif │ │ ├── 8.gif │ │ └── 9.gif │ ├── lay │ ├── dest │ │ └── layui.all.js │ └── modules │ │ ├── code.js │ │ ├── element.js │ │ ├── flow.js │ │ ├── form.js │ │ ├── jquery.js │ │ ├── laydate.js │ │ ├── layedit.js │ │ ├── layer.js │ │ ├── laypage.js │ │ ├── laytpl.js │ │ ├── mobile.js │ │ ├── pagesize.js │ │ ├── tree.js │ │ ├── upload.js │ │ └── util.js │ ├── layui.all.js │ └── layui.js ├── purecpp_controller.hpp ├── qps.png ├── util.hpp └── validate.hpp /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | BasedOnStyle: Google 4 | # Should be declared this way: 5 | BreakBeforeBraces: Custom 6 | BraceWrapping: 7 | BeforeElse: true 8 | AllowShortLambdasOnASingleLine: None 9 | AllowShortIfStatementsOnASingleLine: Never 10 | --- 11 | Language: JavaScript 12 | DisableFormat: true 13 | --- 14 | # Ignore json file 15 | Language: Json 16 | DisableFormat: true 17 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | ###### Git 4 | .gitattributes text 5 | .gitignore text 6 | .gitconfig text 7 | .gitmodules text 8 | 9 | ##### Windows 10 | *.bat text eol=crlf 11 | *.exe binary 12 | *.dll binary 13 | 14 | ##### Linux 15 | *.sh text eol=lf 16 | *.so binary 17 | 18 | ##### Global 19 | # Documents 20 | *.sql text 21 | *.md text 22 | *.adoc text 23 | *.textile text 24 | *.mustache text 25 | *.csv text 26 | *.tab text 27 | *.tsv text 28 | *.coffee text 29 | *.css text 30 | *.htm text 31 | *.html text 32 | *.xhtml text 33 | *.inc text 34 | *.js text 35 | *.jsx text 36 | *.less text 37 | *.od text 38 | *.onlydata text 39 | *.sass text 40 | *.scm text 41 | *.log text 42 | *.properties text 43 | *.scss text 44 | *.styl text 45 | *.tag text 46 | *.ts text 47 | *.tsx text 48 | *.dockerignore text 49 | Dockerfile text 50 | *.markdown text 51 | *.mdwn text 52 | *.mdown text 53 | *.mkd text 54 | *.mkdn text 55 | *.mdtxt text 56 | *.mdtext text 57 | *.txt text 58 | AUTHORS text 59 | CHANGELOG text 60 | CHANGES text 61 | CONTRIBUTING text 62 | COPYING text 63 | copyright text 64 | *COPYRIGHT* text 65 | INSTALL text 66 | license text 67 | LICENSE text 68 | NEWS text 69 | readme text 70 | *README* text 71 | TODO text 72 | # Configuration 73 | *.cnf text 74 | *.cfg text 75 | *.conf text 76 | *.config text 77 | *.ini text 78 | *.json text 79 | *.xml text 80 | *.bowerrc text 81 | .browserslistrc text 82 | .editorconfig text 83 | *.npmignore text 84 | *.yaml text 85 | *.yml text 86 | browserslist text 87 | Makefile text 88 | makefile text 89 | Procfile text 90 | .slugignore text 91 | # Linters 92 | .csslintrc text 93 | .eslintrc text 94 | .htmlhintrc text 95 | .jscsrc text 96 | .jshintrc text 97 | .jshintignore text 98 | .stylelintrc text 99 | # Video 100 | *.3gpp binary 101 | *.3gp binary 102 | *.as binary 103 | *.asf binary 104 | *.asx binary 105 | *.fla binary 106 | *.flv binary 107 | *.m4v binary 108 | *.mng binary 109 | *.mov binary 110 | *.mp4 binary 111 | *.mpeg binary 112 | *.mpg binary 113 | *.ogv binary 114 | *.swc binary 115 | *.swf binary 116 | *.webm binary 117 | # Audio 118 | *.kar binary 119 | *.m4a binary 120 | *.mid binary 121 | *.midi binary 122 | *.mp3 binary 123 | *.ogg binary 124 | *.ra binary 125 | # Graphics 126 | *.png binary 127 | *.jpg binary 128 | *.jpeg binary 129 | *.gif binary 130 | *.tif binary 131 | *.tiff binary 132 | *.ico binary 133 | *.eps binary 134 | *.ai binary 135 | *.bmp binary 136 | *.jng binary 137 | *.jp2 binary 138 | *.jpx binary 139 | *.jxr binary 140 | *.pdf binary 141 | *.psb binary 142 | *.psd binary 143 | *.svg text 144 | *.svgz binary 145 | *.wbmp binary 146 | *.webp binary 147 | # Archives 148 | *.7z binary 149 | *.gz binary 150 | *.jar binary 151 | *.rar binary 152 | *.tar binary 153 | *.zip binary 154 | # Fonts 155 | *.ttf binary 156 | *.eot binary 157 | *.otf binary 158 | *.woff binary 159 | *.woff2 binary 160 | # Executables 161 | *.pyc binary 162 | # Objects 163 | *.o binary 164 | 165 | ##### IDE/Editor 166 | # Visual Studio 167 | *.sln text eol=crlf 168 | *.csproj text eol=crlf 169 | *.vbproj text eol=crlf 170 | *.vcxproj text eol=crlf 171 | *.vcproj text eol=crlf 172 | *.dbproj text eol=crlf 173 | *.fsproj text eol=crlf 174 | *.lsproj text eol=crlf 175 | *.wixproj text eol=crlf 176 | *.modelproj text eol=crlf 177 | *.sqlproj text eol=crlf 178 | *.wmaproj text eol=crlf 179 | *.xproj text eol=crlf 180 | *.props text eol=crlf 181 | *.filters text eol=crlf 182 | *.vcxitems text eol=crlf 183 | # Eclipse 184 | *.project text 185 | *.classpath text 186 | *.prefs 187 | 188 | ##### Language 189 | # C/C++ 190 | *.c 191 | *.C 192 | *.cpp 193 | *.cc 194 | *.c++ 195 | *.cxx 196 | *.cppm 197 | *.cxxm 198 | *.c++m 199 | *.h 200 | *.H 201 | *.hh 202 | *.hpp 203 | *.h++ 204 | *.hxx 205 | *.ii 206 | *.ixx 207 | *.ipp 208 | *.inl 209 | *.txx 210 | *.tpp 211 | *.tpl 212 | *.txx 213 | *.txx -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: [ push, pull_request ] 4 | 5 | jobs: 6 | build-and-test: 7 | 8 | name: ${{ matrix.os }} (${{ matrix.configuration }}) 9 | runs-on: ${{ matrix.os }} 10 | 11 | strategy: 12 | fail-fast: false 13 | matrix: 14 | configuration: [ Debug, Release ] 15 | os: [ macos-latest, ubuntu-latest, windows-latest ] 16 | 17 | steps: 18 | - name: Checkout Code 19 | uses: actions/checkout@v2 20 | with: 21 | submodules: 'true' 22 | 23 | - name: Setup MySQL 24 | uses: ankane/setup-mysql@v1 25 | if : startsWith(matrix.os, 'macos') 26 | 27 | - name: Configure cmake 28 | run: cmake -B${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} 29 | 30 | - name: Build 31 | run: cmake --build ${{github.workspace}}/build --config ${{ matrix.configuration }} -------------------------------------------------------------------------------- /.github/workflows/clang-format.yml: -------------------------------------------------------------------------------- 1 | name: Clang Format Diff 2 | 3 | on: [ push, pull_request ] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - name: Checkout 11 | uses: actions/checkout@v3 12 | with: 13 | fetch-depth: 0 14 | 15 | - name: install clang-format 16 | run: sudo apt install clang-format 17 | 18 | - name: check-diff 19 | run: | 20 | diff=`git-clang-format --diff HEAD^` 21 | if ! [[ "$diff" = "no modified files to format" || "$diff" = "clang-format did not modify any files" ]]; then 22 | echo "The diff you sent is not formatted correctly." 23 | echo "The suggested format is" 24 | echo "$diff" 25 | exit 1 26 | fi -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | 34 | # 35 | .idea 36 | *build* 37 | .vscode 38 | runtime 39 | 40 | .cache 41 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "cinatra"] 2 | path = cinatra 3 | url = https://github.com/qicosmos/cinatra.git 4 | [submodule "ormpp"] 5 | path = ormpp 6 | url = https://github.com/qicosmos/ormpp.git 7 | [submodule "render"] 8 | path = render 9 | url = https://github.com/qicosmos/render.git -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(feather) 3 | 4 | set(CMAKE_CXX_STANDARD 20) 5 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 6 | message(STATUS "CXX Standard: ${CMAKE_CXX_STANDARD}") 7 | 8 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -std=c++20") 9 | SET(ENABLE_MYSQL ON) 10 | 11 | SET(ENABLE_PG OFF) 12 | SET(ENABLE_SQLITE3 OFF) 13 | 14 | SET(ENABLE_GZIP OFF) 15 | 16 | SET(ENABLE_SSL OFF) 17 | 18 | SET(ENABLE_CLIENT_SSL OFF) 19 | 20 | if (ENABLE_MYSQL) 21 | add_definitions(-DORMPP_ENABLE_MYSQL) 22 | endif() 23 | 24 | if (ENABLE_SQLITE3) 25 | add_definitions(-DORMPP_ENABLE_SQLITE3) 26 | endif() 27 | 28 | if (ENABLE_PG) 29 | add_definitions(-DORMPP_ENABLE_PG) 30 | endif() 31 | 32 | if (ENABLE_SSL) 33 | add_definitions(-DCINATRA_ENABLE_SSL) 34 | message(STATUS "Use SSL") 35 | endif() 36 | 37 | if(ENABLE_GZIP) 38 | add_definitions(-DCINATRA_ENABLE_GZIP) 39 | endif() 40 | 41 | if(ENABLE_CLIENT_SSL) 42 | add_definitions(-DCINATRA_ENABLE_CLIENT_SSL) 43 | endif() 44 | 45 | if (ENABLE_SSL) 46 | find_package(OpenSSL REQUIRED) 47 | endif() 48 | 49 | if (ENABLE_CLIENT_SSL) 50 | find_package(OpenSSL REQUIRED) 51 | endif() 52 | 53 | if (ENABLE_GZIP) 54 | find_package(ZLIB REQUIRED) 55 | endif() 56 | 57 | 58 | set(SOURCE_FILES 59 | main.cpp 60 | ) 61 | 62 | if (MSVC) 63 | add_compile_options(/bigobj) 64 | endif () 65 | 66 | if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") 67 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines -pthread -std=c++20") 68 | #-ftree-slp-vectorize with coroutine cause link error. disable it util gcc fix. 69 | set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-tree-slp-vectorize") 70 | endif() 71 | 72 | add_subdirectory(ormpp) 73 | 74 | add_executable(${PROJECT_NAME} ${SOURCE_FILES}) 75 | 76 | include_directories("cinatra/include" ${OPENSSL_INCLUDE_DIR}) 77 | 78 | if (ENABLE_MYSQL) 79 | target_link_libraries(${PROJECT_NAME} ${MYSQL_LIBRARY}) 80 | target_include_directories(${PROJECT_NAME} PRIVATE ${MYSQL_INCLUDE_DIR} ormpp) 81 | if (MSVC AND CMAKE_BUILD_TYPE STREQUAL "Debug") 82 | set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/MD") 83 | endif() 84 | endif() 85 | 86 | if (ENABLE_SQLITE3) 87 | target_link_libraries(feather sqlite3 -ldl) 88 | target_include_directories(feather PRIVATE ormpp) 89 | endif() 90 | 91 | if (ENABLE_PG) 92 | target_link_libraries(${PROJECT_NAME} ${PGSQL_LIBRARY}) 93 | target_include_directories(${PROJECT_NAME} PRIVATE ${PGSQL_INCLUDE_DIR} ormpp) 94 | endif() 95 | 96 | if (ENABLE_SSL) 97 | target_link_libraries(${PROJECT_NAME} ${OPENSSL_LIBRARIES} pthread -ldl) 98 | endif() 99 | 100 | if (ENABLE_CLIENT_SSL) 101 | target_link_libraries(${PROJECT_NAME} ${OPENSSL_LIBRARIES} pthread -ldl) 102 | endif() 103 | 104 | if (ENABLE_GZIP) 105 | target_link_libraries(${PROJECT_NAME} ${ZLIB_LIBRARIES}) 106 | endif() 107 | 108 | install(TARGETS feather DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 qicosmos 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Feather--一个快速开发的web框架 2 | 3 | *Read this in other languages: [English](https://github.com/qicosmos/feather/blob/master/README.en.md), [简体中文](https://github.com/qicosmos/feather/blob/master/README.md) 4 | 5 | [feather使用](https://github.com/qicosmos/feather/blob/master/docs/featehr%20%E4%BD%BF%E7%94%A8.md) 6 | 7 | Feather是一个适合快速开发的modern c++ web框架,Feather的目标是让使用者以最小的精力和成本来开发一个web网站。 8 | 9 | 现在很多web框架都非常庞大,学习成本高,而Feather正是为了解决这些问题的,它就像它的名字feather那样轻盈,所有的一切都是为了让用户非常方便又快速地开发而不是陷入到框架的细节当中。 10 | 11 | 一个好的框架应该是能让用户轻松实现自己的想法而不是成为框架的奴隶。如果你希望轻松快速地开发一个web框架,而无需花费大量的精力去学习框架细节的话,那么Feather非常适合你! 12 | 13 | ## Feather是什么? 14 | 15 | Feather作为一个快速开发框架,它的目标是让web服务器开发变得简单。它主要有下面几个特点: 16 | 17 | 1. 简洁易用 18 | 2. 高性能,modern c++(c++17)开发 19 | 3. header only 20 | 4. 跨平台 21 | 5. 支持编译期反射 22 | 6. 支持AOP 23 | 24 | Feather框架的核心包括: 25 | 1. 一个易用的http库,支持http1.x, https, websocket 26 | 2. 一个功能强大的html模版引擎 27 | 3. 一个可扩展的ORM库,支持多种数据库(mysql,postgresql,sqlite) 28 | 4. 一个可扩展序列化库,支持多种格式(json, xml) 29 | 30 | ## Feather的架构 31 | 32 | 下面是Feather的架构图: 33 | 34 | ![Feather的架构图](https://github.com/qicosmos/feather/blob/master/framework.png): 35 | 36 | 1. http组件: cinatra 37 | 2. ORM组件: ormpp 38 | 3. html 模版: render 39 | 40 | Feather内部的三个核心组件是松耦合的,Feather只是把它们像搭积木一样搭在一起。 41 | 42 | ## Feather的使用 43 | 44 | 以一个简单的例子展示如何使用Feather,比如显示文章列表,几乎每个网站都有这个功能。 45 | 46 | 获取文章列表的功能很简单,它底层数据部分是一个文章表,业务逻辑层是获取这些列表,然后做html渲染。对外接口部分是一个http服务,前端后端交互的数据格式为json。为了简单起见就不考虑缓存之类的。 47 | 48 | 那么要实现这个文章列表功能用Feather怎么做呢?可以按照这些步骤去开发: 49 | 50 | 1. 提供获取文章列表的http接口; 51 | 2. 通过ORM提供数据库访问功能; 52 | 3. 编写业务逻辑,根据用户请求获取文章列表并通过html模版做渲染; 53 | 54 | ## Demo示例 55 | 56 | TODO 57 | 58 | 我们用Feather开发了一个社区网站,地址在这里:http://purecpp.cn/ 59 | 60 | Feather社区: 61 | ![Feather社区](https://github.com/qicosmos/feather/blob/master/demo.png) 62 | 63 | ## benchmark 64 | ab -c50 -n3000 xxxurl 65 | 66 | ![feather benchmark](https://github.com/qicosmos/feather/blob/master/qps.png) 67 | 68 | ## 致谢 69 | 70 | Feather社区网站由我和网友[XMH](https://github.com/xmh0511/)共同开发完成(花了两天的业余时间),XMH也是cinatra的忠实用户,不但贡献了很多代码,还提供了很多宝贵的建议,在此表示衷心的感谢! 71 | 72 | 希望有更多人能加入进来把Feather完善得更好。 73 | 74 | ## 联系我们 75 | 76 | purecpp@163.com 77 | 78 | [http://purecpp.cn/](http://purecpp.cn/ "purecpp") 79 | 80 | [https://github.com/qicosmos/feather](https://github.com/qicosmos/feather "feather") 81 | -------------------------------------------------------------------------------- /cfg/feather.cfg: -------------------------------------------------------------------------------- 1 | { 2 | "thread_num": 4, 3 | "port": "8080", 4 | "db_ip": "localhost", 5 | "user_name": "feather", 6 | "pwd": "123456", 7 | "db_name": "feather", 8 | "timeout": 2, 9 | "db_conn_num": 4, 10 | "drop_all_table": false, 11 | "log_path": "/tmp", 12 | "log_name": "feather.log", 13 | "roll_file_size": 2 14 | } -------------------------------------------------------------------------------- /dao.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by root on 4/24/18. 3 | // 4 | 5 | #ifndef FEATHER_DAO_HPP 6 | #define FEATHER_DAO_HPP 7 | #include "NanoLog.hpp" 8 | 9 | namespace feather { 10 | template 11 | class dao_t final { 12 | public: 13 | dao_t() : conn_(ormpp::connection_pool::instance().get()), guard_(conn_) { 14 | if (!conn_) 15 | LOG_WARN << "db get connection failed"; 16 | } 17 | 18 | bool is_open() const { return conn_ != nullptr; } 19 | 20 | template 21 | bool create_table(const ormpp_auto_key& key) { 22 | if (!conn_) 23 | return false; 24 | 25 | return conn_->template create_datatable(key); 26 | } 27 | 28 | template 29 | bool create_table(Args&&... args) { 30 | if (!conn_) 31 | return false; 32 | 33 | return conn_->template create_datatable(std::forward(args)...); 34 | } 35 | 36 | template 37 | bool drop_table() { 38 | if (!conn_) 39 | return false; 40 | 41 | constexpr auto name = iguana::get_name(); 42 | return conn_->execute("drop table if exists " + 43 | std::string(name.data(), name.length())); 44 | } 45 | 46 | template 47 | int add_object(T& t) { 48 | if (!conn_) 49 | return -1; 50 | 51 | conn_->begin(); 52 | int n = conn_->insert(t); 53 | if (n < 0) { 54 | conn_->rollback(); 55 | LOG_WARN << "insert role failed"; 56 | return -1; 57 | } 58 | auto v = conn_->template query>("SELECT LAST_INSERT_ID();"); 59 | if (v.empty()) { 60 | conn_->rollback(); 61 | LOG_WARN << "db failed"; 62 | return -1; 63 | } 64 | conn_->commit(); 65 | int seq = std::get<0>(v[0]); 66 | return seq; 67 | } 68 | 69 | template 70 | int add_objects(const T& t) { 71 | if (!conn_) 72 | return -1; 73 | 74 | int n = conn_->insert(t); 75 | if (n < 0) { 76 | LOG_WARN << "insert failed"; 77 | return -1; 78 | } 79 | 80 | return n; 81 | } 82 | 83 | template 84 | bool remove_object(const std::string& condition) { 85 | if (!conn_) 86 | return false; 87 | 88 | bool r = conn_->template delete_records(condition); 89 | if (!r) { 90 | LOG_WARN << "insert role failed"; 91 | return false; 92 | } 93 | 94 | return true; 95 | } 96 | 97 | template 98 | bool get_object(std::vector& v, std::string where_condition = "", 99 | Args&&... args) { 100 | if (!conn_) 101 | return false; 102 | 103 | v = conn_->template query(std::move(where_condition), 104 | std::forward(args)...); 105 | if (conn_->has_error()) 106 | return false; 107 | 108 | return true; 109 | } 110 | 111 | template 112 | int update_object(const T& t) { 113 | if (!conn_) 114 | return -1; 115 | 116 | int n = conn_->update(t); 117 | if (n < 0) { 118 | LOG_WARN << "insert role failed"; 119 | return -1; 120 | } 121 | return n; 122 | } 123 | 124 | template 125 | auto query(const std::string& sql) { 126 | return conn_->template query(sql); 127 | } 128 | 129 | // non query sql, such as update, delete, insert 130 | bool execute(const std::string& sql) { 131 | if (!conn_) 132 | return false; 133 | 134 | bool r = conn_->execute(sql); 135 | if (!r) { 136 | LOG_WARN << "insert role failed"; 137 | return false; 138 | } 139 | return r; 140 | } 141 | 142 | bool begin() { 143 | if (!conn_) 144 | return false; 145 | return conn_->begin(); 146 | } 147 | bool rollback() { 148 | if (!conn_) 149 | return false; 150 | return conn_->rollback(); 151 | } 152 | bool commit() { 153 | if (!conn_) 154 | return false; 155 | return conn_->commit(); 156 | } 157 | 158 | static void init(int max_conns, const char* ip, const char* usr, 159 | const char* pwd, const char* db_name, int timeout = 1, 160 | int port = 3306) { 161 | ormpp::connection_pool::instance().init(max_conns, ip, usr, pwd, 162 | db_name, timeout, port); 163 | } 164 | 165 | private: 166 | dao_t(const dao_t&) = delete; 167 | dao_t& operator=(const dao_t&) = delete; 168 | 169 | std::shared_ptr conn_; 170 | ormpp::conn_guard guard_; 171 | }; 172 | } // namespace feather 173 | #endif // FEATHER_DAO_HPP -------------------------------------------------------------------------------- /demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qicosmos/feather/3ce30ab242c755c35bdafc2665ed96c5b41b979c/demo.png -------------------------------------------------------------------------------- /demo/README.md: -------------------------------------------------------------------------------- 1 | 所有操作在 demo 目录进行,操作之前需要先安装好 docker。Ubuntu 下安装 docker 参考 2 | ``` 3 | https://docs.docker.com/install/linux/docker-ce/ubuntu/ 4 | ``` 5 | 其它系统参考官网 6 | 7 | #### 启动 8 | ``` 9 | docker-compose up -d 10 | ``` 11 | 12 | #### 访问链接 13 | ``` 14 | http://localhost:8080 15 | ``` 16 | 首次访问先进入 17 | ``` 18 | http://localhost:8080/sign_out_page 19 | ``` 20 | 创建一个帐号 21 | 22 | #### 停止 23 | ``` 24 | docker-compose stop 25 | ``` 26 | 27 | #### 清理 28 | ``` 29 | docker-compose rm 30 | ``` 31 | -------------------------------------------------------------------------------- /demo/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | feather: 5 | build: feather 6 | ports: 7 | - '8080:8080' 8 | links: 9 | - mariadb 10 | depends_on: 11 | - mariadb 12 | restart: unless-stopped 13 | 14 | mariadb: 15 | image: mariadb:latest 16 | environment: 17 | MYSQL_ROOT_PASSWORD: secret 18 | restart: unless-stopped 19 | volumes: 20 | - db-data:/var/lib/mysql 21 | 22 | volumes: 23 | db-data: 24 | -------------------------------------------------------------------------------- /demo/feather/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:latest AS builder 2 | 3 | RUN sed -i 's/http:\/\/archive\.ubuntu\.com\/ubuntu/http:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\//g' /etc/apt/sources.list \ 4 | && sed -i 's/http:\/\/security\.ubuntu\.com\/ubuntu/http:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\//g' /etc/apt/sources.list \ 5 | && apt-get update \ 6 | && apt-get -y install \ 7 | cmake \ 8 | gcc \ 9 | git \ 10 | make \ 11 | libpqxx-dev \ 12 | libboost-filesystem-dev \ 13 | libboost-system-dev \ 14 | libmysqlclient-dev \ 15 | openssl \ 16 | sqlite \ 17 | uuid-dev \ 18 | zlib1g-dev 19 | 20 | RUN cd /tmp \ 21 | && git clone https://github.com/qicosmos/feather \ 22 | && cd feather \ 23 | && git submodule update --init \ 24 | && mkdir build \ 25 | && cd build \ 26 | && cmake .. \ 27 | && make CXX_FLAGS+="-std=c++17" 28 | 29 | FROM ubuntu:latest 30 | 31 | COPY --from=builder /tmp/feather/build/feather /opt/feather/ 32 | COPY --from=builder /tmp/feather/purecpp /opt/feather/purecpp 33 | COPY --from=builder /tmp/feather/feather.sql /opt/feather/feather.sql 34 | 35 | RUN sed -i 's/http:\/\/archive\.ubuntu\.com\/ubuntu/http:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\//g' /etc/apt/sources.list \ 36 | && sed -i 's/http:\/\/security\.ubuntu\.com\/ubuntu/http:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\//g' /etc/apt/sources.list \ 37 | && apt-get update \ 38 | && apt-get -y install \ 39 | libboost-system1.65.1 \ 40 | libmysqlclient20 \ 41 | mysql-client \ 42 | && rm -rf /var/lib/apt/lists/* 43 | 44 | COPY ./data/ ./entrypoint.sh /opt/feather/ 45 | 46 | WORKDIR /opt/feather 47 | 48 | ENTRYPOINT ["bash", "./entrypoint.sh"] 49 | -------------------------------------------------------------------------------- /demo/feather/data/cfg/feather.cfg: -------------------------------------------------------------------------------- 1 | { 2 | "thread_num": 4, 3 | "port": "8080", 4 | "db_ip": "mariadb", 5 | "user_name": "feather", 6 | "pwd": "123456", 7 | "db_name": "feather", 8 | "timeout": 2, 9 | "db_conn_num": 4, 10 | "drop_all_table": 0, 11 | "log_path": "/var/log/", 12 | "log_name": "feather.log", 13 | "roll_file_size": 2 14 | } -------------------------------------------------------------------------------- /demo/feather/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mysql -h mariadb --user=root --password=secret -e 'select 1 from feather.article' 2> /dev/null 4 | 5 | if [ $? = 1 ]; then 6 | mysql -h mariadb --user=root --password=secret -e "CREATE USER 'feather'@'%' IDENTIFIED BY '123456';" 2> /dev/null 7 | mysql -h mariadb --user=root --password=secret -e "GRANT ALL ON *.* TO 'feather'@'%';" 2> /dev/null 8 | mysql -h mariadb --user=feather --password=123456 -e "CREATE DATABASE IF NOT EXISTS \`feather\` DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci" 2> /dev/null 9 | mysql -h mariadb --user=feather --password=123456 feather < feather.sql 2> /dev/null 10 | fi 11 | 12 | exec ./feather 13 | -------------------------------------------------------------------------------- /docs/featehr 使用.md: -------------------------------------------------------------------------------- 1 | # feather使用说明 2 | 3 | 1. 安装依赖库 4 | 5 | ```text 6 | 如果使用mysql需要安装mysql服务器和mysql client 7 | 8 | 安装mysql client: 9 | Ubuntu: apt-get install libmysqlclient-dev 10 | Centos: yum install mysql-devel 11 | Mac: brew install mysql-client 12 | ``` 13 | 14 | 2. 编译 15 | 16 | ```shell 17 | git clone --recurse-submodules https://github.com/qicosmos/feather.git 18 | 19 | cmake -B build 20 | 21 | cmake --build build 22 | ``` 23 | 24 | 3. 运行 25 | 26 | 建立数据库feather 27 | 28 | 导入数据库表 source feather.sql 29 | 30 | 成功导入后,应该可以看到如下的表结构: 31 | 32 | +-----------------------+ 33 | | Tables_in_feather | 34 | +-----------------------+ 35 | | article | 36 | | article_detail | 37 | | cncppcon2018_user | 38 | | pp_comment | 39 | | pp_post_views | 40 | | pp_posts | 41 | | pp_sign_out_answer | 42 | | pp_terms | 43 | | pp_user | 44 | | user | 45 | | visit_counter | 46 | | wp_term_relationships | 47 | +-----------------------+ 48 | 49 | * 创建运行时需要的目录结构 50 | 51 | 在`feather`目录下执行(此处假设构建目录为`feather/build`): 52 | 53 | ```shell 54 | mkdir runtime 55 | cd runtime 56 | cp -rvt . ../build/feather ../purecpp ../cfg 57 | ``` 58 | 59 | 此时`runtime`目录下应该有文件(目录): 60 | 61 | ```text 62 | cfg/ feather* purecpp/ 63 | ``` 64 | 65 | * 修改配置文件(以下均相对于`runtime`目录) 66 | 67 | 配置文件为`cfg/feather.cfg`,修改其中的数据库用户名和密码为真实数据。 68 | 69 | * 运行 70 | 71 | 在`runtime`目录下执行: 72 | 73 | ```shell 74 | ./feather 75 | ``` 76 | 77 | * 访问 78 | 79 | **注意**:在数据库无数据的时候无法看到页面,可以通过访问:`http://localhost:8080/sign_up_page`注册用户并发表一篇文章。这时其他页面就可以访问了。 -------------------------------------------------------------------------------- /entity.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by root on 4/24/18. 3 | // 4 | 5 | #ifndef FEATHER_ENTITY_H 6 | #define FEATHER_ENTITY_H 7 | 8 | namespace feather { 9 | struct pp_posts { 10 | int ID; 11 | int post_author; 12 | std::string post_date; 13 | std::string post_title; 14 | std::string post_content; 15 | std::string post_status; 16 | std::string post_modified; 17 | std::string content_abstract; 18 | std::string url; 19 | int comment_count; 20 | std::string category; 21 | std::string raw_content; 22 | int visit_count; 23 | }; 24 | REFLECTION(pp_posts, ID, post_author, post_date, post_title, post_content, 25 | post_status, post_modified, content_abstract, url, comment_count, 26 | category, raw_content, visit_count); 27 | 28 | struct pp_user { 29 | int ID; 30 | std::string user_login; 31 | std::string user_nickname; 32 | std::string user_email; 33 | std::string user_registered; 34 | std::string user_icon; 35 | std::string user_pass; 36 | int user_role; 37 | }; 38 | REFLECTION(pp_user, ID, user_login, user_nickname, user_email, user_registered, 39 | user_icon, user_pass, user_role); 40 | 41 | struct pp_comment { 42 | int ID; 43 | int user_id; 44 | int post_id; 45 | int comment_parant; 46 | std::string comment_content; 47 | std::string comment_date; 48 | std::string comment_status; 49 | }; 50 | REFLECTION(pp_comment, ID, user_id, post_id, comment_parant, comment_content, 51 | comment_date, comment_status); 52 | 53 | struct pp_terms { 54 | int term_id; 55 | std::string name; 56 | std::string slug; 57 | std::string term_group; 58 | }; 59 | REFLECTION(pp_terms, term_id, name, slug, term_group); 60 | 61 | struct pp_post_views { 62 | int ID; 63 | int type; 64 | int count; 65 | std::string period; 66 | }; 67 | REFLECTION(pp_post_views, ID, type, count, period); 68 | 69 | struct user { 70 | int id; 71 | std::string user_name; 72 | std::string nick_name; 73 | std::string token; 74 | int32_t gender; 75 | int32_t role; 76 | std::string avatar; 77 | int64_t phone; 78 | std::string email; 79 | std::string qq; 80 | std::string location; 81 | }; 82 | REFLECTION(user, id, user_name, nick_name, token, gender, role, avatar, phone, 83 | email, qq, location); 84 | 85 | struct article { 86 | int id; 87 | std::string title; 88 | std::string introduce; 89 | int user_id; 90 | int visible; 91 | std::string create_time; 92 | }; 93 | REFLECTION(article, id, title, introduce, user_id, visible, create_time); 94 | 95 | struct article_detail { 96 | int id; 97 | int parant_id; 98 | std::string title; 99 | std::string content; 100 | std::string update_time; 101 | }; 102 | REFLECTION(article_detail, id, parant_id, title, content, update_time); 103 | 104 | struct cncppcon2018_user { 105 | int id; 106 | std::string user_name; 107 | int64_t phone; 108 | std::string email; 109 | std::string user_group; 110 | std::string join_time; 111 | }; 112 | REFLECTION(cncppcon2018_user, id, user_name, phone, email, user_group, 113 | join_time); 114 | 115 | struct user_group_member { 116 | int id; 117 | std::string user_name; 118 | int64_t phone; 119 | std::string email; 120 | std::string user_group; 121 | std::string join_time; 122 | }; 123 | REFLECTION(user_group_member, id, user_name, phone, email, user_group, 124 | join_time); 125 | 126 | struct book_course_member { 127 | int id; 128 | std::string user_name; 129 | int64_t phone; 130 | std::string email; 131 | std::string user_group; 132 | std::string join_time; 133 | std::string courses; 134 | }; 135 | REFLECTION(book_course_member, id, user_name, phone, email, user_group, 136 | join_time, courses); 137 | 138 | struct visit_counter { 139 | int id; 140 | std::string save_hour; 141 | int counter; 142 | }; 143 | REFLECTION(visit_counter, id, save_hour, counter); 144 | 145 | struct speaker { 146 | int id; 147 | std::string name; 148 | std::string tel; 149 | std::string email; 150 | std::string company; 151 | std::string country; 152 | std::string bio; 153 | std::string title; 154 | std::string tags; 155 | std::string session_length; 156 | std::string session_desc; 157 | std::string outline; 158 | std::string session_material; 159 | std::string comments; 160 | std::string code; 161 | }; 162 | REFLECTION(speaker, id, name, tel, email, company, country, bio, title, tags, 163 | session_length, session_desc, outline, session_material, comments, 164 | code); 165 | } // namespace feather 166 | 167 | #endif // FEATHER_ENTITY_H 168 | -------------------------------------------------------------------------------- /feather.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by root on 4/24/18. 3 | // 4 | 5 | #ifndef FEATHER_FEATHER_H 6 | #define FEATHER_FEATHER_H 7 | 8 | #include "cinatra/include/cinatra.hpp" 9 | #include "iguana/json_reader.hpp" 10 | #include "iguana/json_writer.hpp" 11 | #include "ormpp/connection_pool.hpp" 12 | #include "ormpp/dbng.hpp" 13 | #ifdef ORMPP_ENABLE_MYSQL 14 | #include "ormpp/mysql.hpp" 15 | #endif 16 | #ifdef ORMPP_ENABLE_SQLITE3 17 | #include "ormpp/sqlite.hpp" 18 | #endif 19 | #ifdef ORMPP_ENABLE_PG 20 | #include "ormpp/postgresql.hpp" 21 | #endif 22 | #include "util.hpp" 23 | #endif // FEATHER_FEATHER_H 24 | -------------------------------------------------------------------------------- /feather_cfg.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by root on 4/24/18. 3 | // 4 | 5 | #ifndef FEATHER_FEATHER_CFG_HPP 6 | #define FEATHER_FEATHER_CFG_HPP 7 | namespace feather { 8 | struct feather_cfg { 9 | int thread_num; 10 | std::string port; 11 | std::string db_ip; 12 | std::string user_name; 13 | std::string pwd; 14 | std::string db_name; 15 | int timeout; 16 | int db_conn_num; 17 | bool drop_all_table; 18 | std::string log_path; 19 | std::string log_name; 20 | int roll_file_size; 21 | }; 22 | REFLECTION(feather_cfg, thread_num, port, db_ip, user_name, pwd, db_name, 23 | timeout, db_conn_num, drop_all_table, log_path, log_name, 24 | roll_file_size); 25 | 26 | class config_manager { 27 | public: 28 | config_manager() = delete; 29 | 30 | template 31 | inline static T get(std::string_view key, std::string_view file_path) { 32 | feather_cfg cfg{}; 33 | bool r = from_file(cfg, file_path); 34 | if (!r) { 35 | return {}; 36 | } 37 | 38 | T val{}; 39 | bool has_key = false; 40 | iguana::for_each( 41 | cfg, [key, &val, &cfg, &has_key](const auto &item, auto I) { 42 | if (key == iguana::get_name(decltype(I)::value)) { 43 | assign(val, cfg.*item); 44 | has_key = true; 45 | } 46 | }); 47 | 48 | if (!has_key) { 49 | return {}; 50 | } 51 | 52 | return val; 53 | } 54 | 55 | template 56 | inline static bool set(std::string_view key, T &&val, 57 | std::string_view file_path) { 58 | feather_cfg cfg{}; 59 | bool r = from_file(cfg, file_path); 60 | if (!r) { 61 | return false; 62 | } 63 | 64 | bool has_key = false; 65 | iguana::for_each(cfg, [key, &val, &cfg, &has_key](auto &item, auto I) { 66 | if (key == iguana::get_name(decltype(I)::value)) { 67 | assign(cfg.*item, val); 68 | has_key = true; 69 | } 70 | }); 71 | 72 | if (!has_key) 73 | return false; 74 | 75 | return to_file(cfg, file_path); 76 | } 77 | 78 | template 79 | inline static bool from_file(T &t, std::string_view file_path) { 80 | std::ifstream in(file_path.data(), std::ios::binary); 81 | if (!in.is_open()) { 82 | return false; 83 | } 84 | 85 | in.seekg(0, std::ios::end); 86 | size_t len = (size_t)in.tellg(); 87 | in.seekg(0); 88 | std::string str; 89 | str.resize(len); 90 | in.read(str.data(), len); 91 | iguana::from_json(t, str); 92 | return true; 93 | } 94 | 95 | template 96 | inline static void assign(T &t, U &u) { 97 | if constexpr (std::is_same_v) { 98 | t = u; 99 | } 100 | } 101 | 102 | template 103 | inline static bool to_file(T &t, std::string_view file_path) { 104 | iguana::string_stream ss; 105 | iguana::to_json(ss, t); 106 | std::ofstream out(file_path.data(), std::ios::binary); 107 | if (!out.is_open()) { 108 | return false; 109 | } 110 | out.write(ss.data(), ss.size()); 111 | out.close(); 112 | return true; 113 | } 114 | }; 115 | } // namespace feather 116 | #endif // FEATHER_FEATHER_CFG_HPP 117 | -------------------------------------------------------------------------------- /framework.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qicosmos/feather/3ce30ab242c755c35bdafc2665ed96c5b41b979c/framework.png -------------------------------------------------------------------------------- /purecpp/css/about.css: -------------------------------------------------------------------------------- 1 | .layui-tab-brief { 2 | background: #fff; 3 | min-height: 100vh; 4 | } 5 | 6 | .layui-tab-brief .layui-tab-title { 7 | text-align: center; 8 | border-bottom: 1px solid #5FB878; 9 | } 10 | 11 | .layui-tab-brief .layui-tab-title li { 12 | font-size: 12px; 13 | } 14 | 15 | .layui-tab-brief .layui-tab-content { 16 | padding: 0; 17 | } 18 | 19 | .aboutinfo { 20 | text-align: center; 21 | padding: 0 15px; 22 | } 23 | 24 | .aboutinfo-figure { 25 | display: inline-block; 26 | margin: 20px auto; 27 | } 28 | 29 | .aboutinfo-figure img { 30 | border-radius: 50px; 31 | } 32 | 33 | .aboutinfo-nickname { 34 | font-size: 32px; 35 | font-weight: bold; 36 | margin: 0 0 15px 0; 37 | } 38 | 39 | .aboutinfo-introduce { 40 | margin: 20px auto; 41 | font-size: 18px; 42 | width: 90%; 43 | } 44 | 45 | .aboutinfo-location { 46 | color: #808080; 47 | margin: 15px; 48 | } 49 | 50 | .aboutinfo-contact { 51 | margin: 15px; 52 | } 53 | 54 | .aboutinfo-contact > a { 55 | padding: 0 10px; 56 | } 57 | 58 | .aboutinfo-abstract { 59 | width: 90%; 60 | margin: 0 auto; 61 | } 62 | 63 | .aboutinfo-abstract > h1 { 64 | font-weight: bold; 65 | font-size: 16px; 66 | text-align: left; 67 | margin-top: 25px; 68 | } 69 | 70 | .aboutinfo-abstract > p { 71 | margin: 5px 0; 72 | font-size: 14px; 73 | text-align: left; 74 | text-indent: 2em; 75 | } 76 | 77 | #frinedlink { 78 | display: none; /*手机端不显示友情链接,样式没写好,会乱*/ 79 | } 80 | 81 | .friendlink { 82 | padding: 0 15px; 83 | } 84 | 85 | .friendlink li { 86 | width: 30%; 87 | margin: 0 1%; 88 | margin-top: 10px; 89 | float: left; 90 | } 91 | 92 | .friendlink-item { 93 | box-shadow: inset 0 0 2px #5FB878; 94 | width: 100%; 95 | display: block; 96 | padding: 10px 0; 97 | text-align: left; 98 | min-height: 45px; 99 | position: relative; 100 | } 101 | 102 | .friendlink-item:hover { 103 | box-shadow: 0 0 2px #5FB878; 104 | } 105 | 106 | .friendlink-item-pic { 107 | display: inline-block; 108 | position: absolute; 109 | left: 10%; 110 | margin: 0 10px; 111 | } 112 | 113 | .friendlink-item-pic img { 114 | width: 45px; 115 | height: 45px; 116 | position: relative; 117 | left: 0px; 118 | border-radius: 50px; 119 | } 120 | 121 | .friendlink-item-title { 122 | font-size: 17px; 123 | margin-left: 65px; 124 | text-align: center; 125 | line-height: 20px; 126 | } 127 | 128 | .friendlink-item-domain { 129 | font-size: 13px; 130 | margin-left: 65px; 131 | text-align: center; 132 | line-height: 20px; 133 | margin-top: 5px; 134 | } 135 | 136 | .leavemessage .blog-comment li:first-child { 137 | border-top: 1px dotted #01AAED; 138 | } 139 | 140 | /* 小屏幕(平板,大于等于 768px) */ 141 | @media (min-width: 768px) { 142 | .layui-tab-brief .layui-tab-title li { 143 | font-size: 14px; 144 | } 145 | 146 | #frinedlink { 147 | display: inline-block; 148 | } 149 | } 150 | 151 | /* 中等屏幕(桌面显示器,大于等于 992px) */ 152 | @media (min-width: 992px) { 153 | .blog-container { 154 | width: 962px; 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /purecpp/css/article.css: -------------------------------------------------------------------------------- 1 | 2 | /*搜索(移动端不提供此功能)*/ 3 | .search-keywords, 4 | .search-submit { 5 | display: none; 6 | } 7 | 8 | @media (min-width: 992px) { 9 | .blog-search { 10 | margin-bottom: 15px; 11 | } 12 | 13 | .search-keywords, 14 | .search-submit { 15 | display: inline-block; 16 | } 17 | 18 | .search-keywords { 19 | width: 85%; 20 | float: left; 21 | } 22 | 23 | .search-keywords > input { 24 | border-radius: 0; 25 | } 26 | 27 | .search-submit { 28 | width: 14%; 29 | float: right; 30 | } 31 | 32 | .search-submit > .search-btn { 33 | display: block; 34 | width: 100%; 35 | height: 36px; 36 | background: #fff; 37 | cursor: pointer; 38 | float: right; 39 | border-radius: 1px; 40 | border: 1px solid #e2e2e2; 41 | } 42 | 43 | .search-submit > .search-btn:hover { 44 | border: 1px solid #d2d2d2; 45 | } 46 | 47 | .search-submit > .search-btn i { 48 | width: 13px; 49 | line-height: 38px; 50 | display: block; 51 | margin: 0 auto; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /purecpp/css/detail.css: -------------------------------------------------------------------------------- 1 | /*博主信息*/ 2 | .blogerinfo { 3 | text-align: center; 4 | padding: 0 15px; 5 | background: #fff; 6 | margin-bottom: 15px; 7 | } 8 | 9 | .blogerinfo-figure { 10 | display: inline-block; 11 | margin: 20px auto; 12 | } 13 | 14 | .blogerinfo-figure img { 15 | border-radius: 50px; 16 | } 17 | 18 | .blogerinfo-nickname { 19 | font-size: 32px; 20 | font-weight: bold; 21 | margin: 0 0 15px 0; 22 | } 23 | 24 | .blogerinfo-introduce { 25 | margin: 15px auto; 26 | font-size: 18px; 27 | width: 90%; 28 | } 29 | 30 | .blogerinfo-location { 31 | color: #808080; 32 | margin: 15px; 33 | } 34 | 35 | .blogerinfo-contact { 36 | padding: 15px; 37 | padding-top: 5px; 38 | } 39 | 40 | .blogerinfo-contact > a { 41 | padding: 0 10px; 42 | } 43 | /*博主信息END*/ 44 | 45 | .article-detail { 46 | background: #fff; 47 | padding: 15px; 48 | box-shadow: 0 1px 8px #a6a6a6; 49 | margin-bottom: 15px; 50 | } 51 | 52 | .article-detail-title { 53 | text-align: center; 54 | margin: 20px 0px; 55 | color: black; 56 | font-weight: 700; 57 | font-size: 24px; 58 | } 59 | 60 | .article-detail-info { 61 | border: 1px dashed #808080; 62 | font-size: 13px; 63 | color: #808080; 64 | padding: 5px 0; 65 | font-family: SimSun; 66 | text-align: center; 67 | margin: 0 0 10px; 68 | } 69 | 70 | .article-detail-info span { 71 | margin: 0 5px; 72 | } 73 | 74 | .article-detail-content { 75 | padding: 10px 5px; 76 | } 77 | 78 | 79 | 80 | /*代码区域*/ 81 | pre { 82 | background-color: #f5f5f5 !important; 83 | border-radius: 0px !important; 84 | border: 1px solid #ccc !important; 85 | font-size: 13px !important; 86 | } 87 | -------------------------------------------------------------------------------- /purecpp/css/home.css: -------------------------------------------------------------------------------- 1 | 2 | /*博主信息*/ 3 | .blogerinfo { 4 | text-align: center; 5 | padding: 0 15px; 6 | background: #fff; 7 | margin-bottom: 15px; 8 | } 9 | 10 | .blogerinfo-figure { 11 | display: inline-block; 12 | margin: 20px auto; 13 | } 14 | 15 | .blogerinfo-figure img { 16 | border-radius: 50px; 17 | } 18 | 19 | .blogerinfo-nickname { 20 | font-size: 32px; 21 | font-weight: bold; 22 | margin: 0 0 15px 0; 23 | } 24 | 25 | .blogerinfo-introduce { 26 | margin: 15px auto; 27 | font-size: 18px; 28 | width: 90%; 29 | } 30 | 31 | .blogerinfo-location { 32 | color: #808080; 33 | margin: 15px; 34 | } 35 | 36 | .blogerinfo-contact { 37 | padding: 15px; 38 | padding-top: 5px; 39 | } 40 | 41 | .blogerinfo-contact > a { 42 | padding: 0 10px; 43 | } 44 | /*博主信息END*/ 45 | 46 | /*友情链接*/ 47 | .blogroll > li { 48 | display: inline-block; 49 | vertical-align: middle; 50 | padding: 2px 5px; 51 | } 52 | /*友情链接END*/ 53 | 54 | /*一路走来和后台记录*/ 55 | .footprint > dt { 56 | color: #01AAED; 57 | } 58 | 59 | .footprint > dd { 60 | text-indent: 1.3em; 61 | padding: 2px 0; 62 | } 63 | /*一路走来和后台记录END*/ 64 | -------------------------------------------------------------------------------- /purecpp/css/prettify.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} 2 | 3 | pre.prettyprint { 4 | border: 1px solid #f2f2f2; 5 | border-radius:5px; 6 | margin-left: 2em; 7 | padding: 0.5em; 8 | font-size: 110%; 9 | display: block; 10 | font-family: "Consolas", "Monaco", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; 11 | margin: 1em 0px; 12 | /*white-space: pre;*/ 13 | background:#f7f7f7; 14 | } 15 | 16 | /*li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:decimal !important;}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} 17 | 18 | .prettyprint.linenums { 19 | -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 20 | -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 21 | box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 22 | } 23 | 24 | ol.linenums { 25 | padding: 0 0 0 33px; 26 | } 27 | ol.linenums li { 28 | padding-left: 12px; 29 | color: #bebec5; 30 | line-height: 18px; 31 | text-shadow: 0 1px 0 #fff; 32 | }*/ -------------------------------------------------------------------------------- /purecpp/css/resource.css: -------------------------------------------------------------------------------- 1 | 2 | .resource { 3 | width: 49%; 4 | margin: 0 1%; 5 | margin-bottom: 10px; 6 | background: #fff; 7 | height: 270px; 8 | float: left; 9 | padding: 8px 8px; 10 | -moz-box-sizing: border-box; 11 | -webkit-box-sizing: border-box; 12 | box-sizing: border-box; 13 | position: relative; 14 | } 15 | 16 | .resource-main .resource:nth-child(odd) { 17 | margin-left: 0; 18 | } 19 | 20 | .resource-main .resource:nth-child(even) { 21 | margin-right: 0; 22 | } 23 | 24 | .resource-cover { 25 | width: 100%; 26 | height: 92px; 27 | text-align: center; 28 | } 29 | 30 | .resource-cover a { 31 | display: inline-block; 32 | width: 100%; 33 | height: 100%; 34 | border: 1px solid #ddd; 35 | -moz-transition: all 1s; 36 | -o-transition: all 1s; 37 | -webkit-transition: all 1s; 38 | transition: all 1s; 39 | -moz-box-sizing: border-box; 40 | -webkit-box-sizing: border-box; 41 | box-sizing: border-box; 42 | } 43 | 44 | .resource-cover a:hover { 45 | opacity: .7; 46 | border: 1px solid #5FB878; 47 | } 48 | 49 | .resource-cover img { 50 | width: 100%; 51 | height: 100%; 52 | } 53 | 54 | .resource-title { 55 | text-align: center; 56 | padding: 5px 0; 57 | margin-top: 7px; 58 | margin-bottom: 5px; 59 | } 60 | 61 | .resource-title > a { 62 | font-size: 16px; 63 | font-weight: bold; 64 | line-height: 18px; 65 | color: #01AAED; 66 | } 67 | 68 | .resource-title > a:hover { 69 | color: #1E9FFF; 70 | } 71 | 72 | .resource-abstract { 73 | padding: 3px; 74 | text-align: center; 75 | font-size: smaller; 76 | color: #838383; 77 | height: 50px; 78 | overflow: hidden; 79 | } 80 | 81 | .resource-info { 82 | font-size: smaller; 83 | position: absolute; 84 | bottom: 50px; 85 | left: 0; 86 | right: 0; 87 | padding: 2px 10px; 88 | } 89 | 90 | .resource-info .category { 91 | float: left; 92 | } 93 | 94 | .resource-info .author { 95 | float: right; 96 | } 97 | 98 | .resource-footer { 99 | font-size: small; 100 | border-top: 1px solid #e7e7e7; 101 | box-shadow: 0 1px 0 0 #fff inset; 102 | color: #8B8B8C; 103 | height: 50px; 104 | position: absolute; 105 | bottom: 0; 106 | left: 0; 107 | right: 0; 108 | padding: 0 10px; 109 | line-height: 50px; 110 | text-align: center; 111 | } 112 | 113 | .resource-footer a:nth-child(2) { 114 | display: none; 115 | } 116 | 117 | .resource-footer i { 118 | font-size: 12px !important; 119 | } 120 | 121 | 122 | /* 小屏幕(平板,大于等于 768px) */ 123 | @media (min-width: 768px) { 124 | .resource { 125 | width: 32%; 126 | margin: 0 1%; 127 | margin-bottom: 10px; 128 | height: 320px; 129 | } 130 | 131 | .resource-main .resource:nth-child(odd) { 132 | margin-left: 1%; 133 | } 134 | 135 | .resource-main .resource:nth-child(even) { 136 | margin-right: 1%; 137 | } 138 | 139 | .resource-main .resource:nth-child(3n+1) { 140 | margin-left: 0; 141 | } 142 | 143 | .resource-main .resource:nth-child(3n+3) { 144 | margin-right: 0; 145 | } 146 | 147 | .resource-cover { 148 | width: 100%; 149 | height: 150px; 150 | text-align: center; 151 | } 152 | 153 | .resource-footer a:nth-child(2) { 154 | display: inline-block; 155 | } 156 | } 157 | 158 | /* 中等屏幕(桌面显示器,大于等于 992px) */ 159 | @media (min-width: 992px) { 160 | .resource { 161 | width: 23.5%; 162 | margin: 0 1%; 163 | margin-bottom: 10px; 164 | } 165 | 166 | .resource-main .resource:nth-child(odd) { 167 | margin-left: 1%; 168 | } 169 | 170 | .resource-main .resource:nth-child(even) { 171 | margin-right: 1%; 172 | } 173 | 174 | .resource-main .resource:nth-child(3n+1) { 175 | margin-left: 1%; 176 | } 177 | 178 | .resource-main .resource:nth-child(3n+3) { 179 | margin-right: 1%; 180 | } 181 | 182 | .resource-main .resource:nth-child(4n+1) { 183 | margin-left: 0; 184 | } 185 | 186 | .resource-main .resource:nth-child(4n) { 187 | margin-right: 0; 188 | } 189 | } 190 | -------------------------------------------------------------------------------- /purecpp/css/timeline.css: -------------------------------------------------------------------------------- 1 | 2 | .timeline-box { 3 | background: #fff; 4 | padding: 8px; 5 | position: relative; 6 | min-height: 90vh; 7 | } 8 | 9 | .timeline-main { 10 | position: relative; 11 | min-height: 85vh; 12 | } 13 | 14 | .timeline-main > h1 { 15 | font-size: 18px; 16 | background: #fff; 17 | z-index: 1; 18 | position: relative; 19 | color: #009688; 20 | margin-left: 33%; /*写给不支持calc()的浏览器*/ 21 | margin-left: -moz-calc(35% - 7px); 22 | margin-left: -webkit-calc(35% - 7px); 23 | margin-left: calc(35% - 7px); 24 | } 25 | 26 | .timeline-main > h1 > i { 27 | padding-right: 10px; 28 | font-size: 20px; 29 | } 30 | 31 | .timeline-main > h1 > span { 32 | display: none; 33 | } 34 | 35 | .timeline-main h2, 36 | .timeline-main h3 { 37 | width: 31%; 38 | text-align: right; 39 | } 40 | 41 | .timeline-main h2, 42 | .timeline-main h2 > a { 43 | font-size: 16px; 44 | margin: 5px 0; 45 | color: #1E9FFF; 46 | } 47 | 48 | .timeline-main h3, 49 | .timeline-main h3 > a { 50 | font-size: 14px; 51 | margin: 2px 0; 52 | color: #FF5722; 53 | } 54 | 55 | .timeline-month > ul > li { 56 | padding: 10px 0; 57 | } 58 | 59 | .timeline-month > ul > li .h4 { 60 | display: inline-block; 61 | width: 31%; 62 | text-align: right; 63 | float: left; 64 | } 65 | 66 | .date { 67 | display: inline-block; 68 | padding: 2px 5px; 69 | color: #009688; 70 | } 71 | 72 | .dot-circle { 73 | color: #009688; 74 | width: 8%; 75 | text-align: center; 76 | font-size: 22px; 77 | z-index: 1; 78 | position: relative; 79 | background: #fff; 80 | float: left; 81 | } 82 | 83 | .content { 84 | max-width: 50%; 85 | float: left; 86 | padding: 10px; 87 | margin-left: 10px; 88 | position: relative; 89 | z-index: 1; 90 | background: #009688; 91 | color: #fff; 92 | } 93 | 94 | .content::before { 95 | position: absolute; 96 | left: -20px; 97 | top: 6px; 98 | height: 0; 99 | width: 0; 100 | content: ''; 101 | border: 10px solid rgba(255, 255, 255, 0.00); 102 | border-top: 6px solid rgba(255, 255, 255, 0.00); 103 | border-bottom: 6px solid rgba(255, 255, 255, 0.00); 104 | border-right-color: #009688; 105 | } 106 | 107 | .timeline-line { 108 | position: absolute; 109 | left: 35%; 110 | top: 0; 111 | height: 100%; 112 | width: 2px; 113 | background: #009688; 114 | z-index: 0; 115 | } 116 | 117 | .timeline-year { 118 | margin: 10px 0; 119 | } 120 | 121 | 122 | 123 | /* 小屏幕(平板,大于等于 768px) */ 124 | @media (min-width: 768px) { 125 | .timeline-box { 126 | background: #fff; 127 | padding: 15px; 128 | position: relative; 129 | min-height: 90vh; 130 | } 131 | 132 | .timeline-main > h1 { 133 | font-size: 26px; 134 | margin-left: 16%; /*写给不支持calc()的浏览器*/ 135 | margin-left: -moz-calc(18% - 13px); 136 | margin-left: -webkit-calc(18% - 13px); 137 | margin-left: calc(18% -13px); 138 | } 139 | 140 | .timeline-main > h1 > i { 141 | font-size: 30px; 142 | } 143 | 144 | .timeline-main > h1 > span { 145 | display: inline; 146 | } 147 | 148 | .timeline-main h2, 149 | .timeline-main h3 { 150 | width: 16%; 151 | } 152 | 153 | .timeline-main h2, 154 | .timeline-main h2 > a { 155 | font-size: 24px; 156 | } 157 | 158 | .timeline-main h3, 159 | .timeline-main h3 > a { 160 | font-size: 20px; 161 | } 162 | 163 | .timeline-month > ul > li .h4 { 164 | width: 16%; 165 | } 166 | 167 | .dot-circle { 168 | width: 4%; 169 | font-size: 22px; 170 | } 171 | 172 | .content { 173 | max-width: 70%; 174 | } 175 | 176 | .timeline-line { 177 | left: 18%; 178 | } 179 | } 180 | 181 | /* 中等屏幕(桌面显示器,大于等于 992px) */ 182 | @media (min-width: 992px) { 183 | .blog-container { 184 | /*width: 962px;*/ 185 | /*width:1050px;*/ 186 | } 187 | 188 | .timeline-main > h1 { 189 | font-size: 34px; 190 | background: #fff; 191 | z-index: 1; 192 | position: relative; 193 | color: #009688; 194 | margin-left: 17%; /*写给不支持calc()的浏览器*/ 195 | margin-left: -moz-calc(18% - 16px); 196 | margin-left: -webkit-calc(18% - 16px); 197 | margin-left: calc(18% - 16px); 198 | } 199 | 200 | .timeline-main > h1 > i { 201 | font-size: 36px; 202 | } 203 | 204 | .timeline-main h2, 205 | .timeline-main h2 > a { 206 | font-size: 30px; 207 | } 208 | 209 | .timeline-main h3, 210 | .timeline-main h3 > a { 211 | font-size: 24px; 212 | } 213 | } 214 | -------------------------------------------------------------------------------- /purecpp/html/book_course.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $inline {{ 6 | ./purecpp/html/header.html 7 | }} 8 | 9 | 10 | 11 | $include {{ 12 | ./purecpp/html/navigator.html 13 | }} 14 | 15 |
16 | 17 |
18 |
19 | 20 | $inline {{ 21 | ./purecpp/html/notice.html 22 | }} 23 | 24 |
25 |

purecpp

26 |

一个很酷的modern c++开源社区

27 |
28 |
29 | 这里有创新的idea,这里有最酷的modern c++代码,这里有很棒的modern c++开源项目。purecpp社区邮箱 purecpp@163.com 30 |
31 |
32 |
33 |
34 | 课程列表 35 |
36 |
37 |
38 |
39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |
51 |
52 |
53 | 我要预订 54 |
55 |
56 | 57 |
58 | 59 |
60 |
61 |
62 | 63 |
64 | 65 |
66 |
67 |
68 | 69 |
70 | 71 |
72 |
73 |
74 | 75 |
76 | 77 |
78 |
79 |
80 | 81 |
82 | 83 |
84 |
85 |
86 | 87 |
88 | 89 |
90 |
91 |
92 |
93 | 94 | 95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 | 104 | $inline {{ 105 | ./purecpp/html/footer.html 106 | }} 107 | 108 |
109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 126 | -------------------------------------------------------------------------------- /purecpp/html/category.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $inline {{ 6 | ./purecpp/html/header.html 7 | }} 8 | 9 | 10 | 11 | $include {{ 12 | ./purecpp/html/navigator.html 13 | }} 14 | 15 |
16 | 21 | 22 | 23 | 24 | 33 | 34 |
35 |
36 | 37 | $inline {{ 38 | ./purecpp/html/notice.html 39 | }} 40 | 41 |
42 | $for item in article_list{{ 43 |
44 |
45 | purecpp 46 |
47 |
48 |
49 | ${item.post_title} 50 |
51 |
52 | ${item.content_abstract} 53 |
54 |
55 |
56 | 82 |
83 | }} 84 |
85 |
86 | 87 | $inline {{ 88 | ./purecpp/html/righter.html 89 | }} 90 |
91 |
92 |
93 |
94 | 95 | $inline {{ 96 | ./purecpp/html/footer.html 97 | }} 98 | 99 |
100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 117 | 140 | -------------------------------------------------------------------------------- /purecpp/html/create_post.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $inline {{ 6 | ./purecpp/html/header.html 7 | }} 8 | 9 | 10 | 11 | $include {{ 12 | ./purecpp/html/navigator.html 13 | }} 14 | 15 |
16 | 17 |
18 |
19 |
20 | 撰写新文章 21 |
22 |
23 | 24 |
25 | 26 |
27 | 28 |
29 |
30 |
31 | 32 |
33 | 46 |
47 |
48 |
49 | 52 |
53 | 54 |
55 |
56 |
57 |
# 初始数据放这里
58 |
59 |
60 |
61 | 62 | 63 |
64 |
65 |
66 |
67 |
68 | 69 | 70 |
71 | 72 | 73 | 74 | 75 | 76 | 77 | 115 | -------------------------------------------------------------------------------- /purecpp/html/edit_post.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $inline {{ 6 | ./purecpp/html/header.html 7 | }} 8 | 9 | 10 | 11 |
12 | 13 |
14 |
15 |
16 | 编辑文章 17 |
18 |
19 | 20 |
21 | 22 |
23 | 24 |
25 |
26 |
27 | 28 |
29 | 41 |
42 |
43 |
44 | 45 |
46 |
47 | 48 |
49 |
50 |
51 |
52 |
53 |
54 | 55 | 56 |
57 |
58 |
59 |
60 |
61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 98 | -------------------------------------------------------------------------------- /purecpp/html/footer.html: -------------------------------------------------------------------------------- 1 | 12 | 13 |
14 |
15 |
16 |
17 | 18 | 19 | 20 | 21 |
22 |
23 |
24 |
-------------------------------------------------------------------------------- /purecpp/html/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | purecpp - a cool open source modern c++ community 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /purecpp/html/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $inline {{ 6 | ./purecpp/html/header.html 7 | }} 8 | 9 | 10 | 11 | $include {{ 12 | ./purecpp/html/navigator.html 13 | }} 14 | 15 |
16 | 17 | 22 | 23 | 24 | 25 | 26 | 27 | 36 | 37 |
38 |
39 | 40 | $inline {{ 41 | ./purecpp/html/notice.html 42 | }} 43 | 44 |
45 |
46 | 64 |
65 | $for item in article_list{{ 66 |
67 |
68 | purecpp 69 |
70 |
71 |
72 | ${item.post_title} 73 |
74 |
75 | ${item.content_abstract} 76 |
77 |
78 |
79 | 106 |
107 | }} 108 |
109 |
110 | 111 | $inline {{ 112 | ./purecpp/html/righter.html 113 | }} 114 |
115 |
116 |
117 |
118 | 119 | $inline {{ 120 | ./purecpp/html/footer.html 121 | }} 122 | 123 |
124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 141 | 161 | 162 | -------------------------------------------------------------------------------- /purecpp/html/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $inline {{ 6 | ./purecpp/html/header.html 7 | }} 8 | 9 | 10 | 11 | $include {{ 12 | ./purecpp/html/navigator.html 13 | }} 14 | 15 |
16 | 17 |
18 |
19 | 20 | $inline {{ 21 | ./purecpp/html/notice.html 22 | }} 23 | 24 |
25 |

purecpp

26 |

一个很酷的modern c++开源社区

27 |
28 |
29 | 这里有创新的idea,这里有最酷的modern c++代码,这里有很棒的modern c++开源项目。purecpp社区邮箱 purecpp@163.com 30 |
31 |
32 |
33 |
34 |
35 | 36 |
37 | 38 |
39 |
40 |
41 | 42 |
43 | 44 |
45 |
46 |
47 |
48 | 49 | 50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | 59 | $inline {{ 60 | ./purecpp/html/footer.html 61 | }} 62 | 63 |
64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 81 | -------------------------------------------------------------------------------- /purecpp/html/member_edit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $inline {{ 6 | ./purecpp/html/header.html 7 | }} 8 | 9 | 10 | 11 | $include {{ 12 | ./purecpp/html/navigator.html 13 | }} 14 | 15 |
16 | 21 | 22 | 23 |
24 |
25 | 26 | $inline {{ 27 | ./purecpp/html/notice.html 28 | }} 29 | 30 |
31 |

purecpp

32 |

一个很酷的modern c++开源社区

33 |
34 |
35 | 这里有创新的idea,这里有最酷的modern c++代码,这里有很棒的modern c++开源项目。purecpp社区邮箱 purecpp@163.com 36 |
37 |
38 |
39 |
40 |
41 | 42 |
43 | 44 |
45 |
46 |
47 | 48 |
49 | 50 |
51 |
52 |
53 | 54 |
55 | 56 |
57 |
58 |
59 | 60 |
61 | 62 |
63 |
64 |
65 |
66 | 67 | 68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | 77 | $inline {{ 78 | ./purecpp/html/footer.html 79 | }} 80 | 81 |
82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 108 | -------------------------------------------------------------------------------- /purecpp/html/my_post.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $inline {{ 6 | ./purecpp/html/header.html 7 | }} 8 | 9 | 10 | 11 | $include {{ 12 | ./purecpp/html/navigator.html 13 | }} 14 | 15 |
16 | 21 | 22 | 23 | 24 | 33 | 34 |
35 |
36 | 37 | $inline {{ 38 | ./purecpp/html/notice.html 39 | }} 40 | 41 |
42 | $for item in article_list{{ 43 |
44 |
45 | purecpp 46 |
47 |
48 |
49 | ${item.post_title} 50 |
51 |
52 | ${item.content_abstract} 53 |
54 |
55 |
56 | 82 |
83 | }} 84 |
85 |
86 | 87 | $inline {{ 88 | ./purecpp/html/righter.html 89 | }} 90 |
91 |
92 |
93 |
94 | 95 | $inline {{ 96 | ./purecpp/html/footer.html 97 | }} 98 | 99 |
100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 117 | 140 | -------------------------------------------------------------------------------- /purecpp/html/navigator.html: -------------------------------------------------------------------------------- 1 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /purecpp/html/notice.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 这里是modern c++开源社区,致力于现代C++促进企业生产力与效率 5 | 6 | C++ 工作机会 - Q2 2019 7 | 8 | 9 | C++分布式基础设施技术分享报名开始了!! 10 | 11 | purecpp社区网站由纯C++打造,这就是真正意义上的purecpp! 12 |
13 |
14 | -------------------------------------------------------------------------------- /purecpp/html/query_cppcon.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $inline {{ 6 | ./purecpp/html/header.html 7 | }} 8 | 9 | 10 | 11 | $include {{ 12 | ./purecpp/html/navigator.html 13 | }} 14 | 15 |
16 | 17 |
18 |
19 | 20 | $inline {{ 21 | ./purecpp/html/notice.html 22 | }} 23 | 24 |
25 |

purecpp

26 |

一个很酷的modern c++开源社区

27 |
28 |
29 | 这里有创新的idea,这里有最酷的modern c++代码,这里有很棒的modern c++开源项目。purecpp社区邮箱 purecpp@163.com 30 |
31 |
32 |
33 |
34 | 报名查询 35 |
36 |
37 |
38 | 39 |
40 | 41 |
42 |
43 |
44 | 45 |
46 | 47 |
48 |
49 |
50 | 51 |
52 | 53 |
54 |
55 |
56 |
57 | 58 | 59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | 68 | $inline {{ 69 | ./purecpp/html/footer.html 70 | }} 71 | 72 |
73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 90 | -------------------------------------------------------------------------------- /purecpp/html/query_cppcon_result.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $inline {{ 6 | ./purecpp/html/header.html 7 | }} 8 | 9 | 10 | 11 | $include {{ 12 | ./purecpp/html/navigator.html 13 | }} 14 | 15 |
16 | 17 |
18 |
19 | 20 | $inline {{ 21 | ./purecpp/html/notice.html 22 | }} 23 | 24 |
25 |

purecpp

26 |

一个很酷的modern c++开源社区

27 |
28 |
29 | 这里有创新的idea,这里有最酷的modern c++代码,这里有很棒的modern c++开源项目。purecpp社区邮箱 purecpp@163.com 30 |
31 |
32 |
33 |
34 | 查询结果 35 |
36 |
37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
姓名电话邮箱公司或组织注册时间
${user_name}${user_phone}${email}${user_group}${registerd_date}
63 |
64 |
65 |
66 |
67 |
68 |
69 | 70 | $inline {{ 71 | ./purecpp/html/footer.html 72 | }} 73 | 74 |
75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | -------------------------------------------------------------------------------- /purecpp/html/register_cppcon.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $inline {{ 6 | ./purecpp/html/header.html 7 | }} 8 | 9 | 10 | 11 | $include {{ 12 | ./purecpp/html/navigator.html 13 | }} 14 | 15 |
16 | 17 |
18 |
19 | 20 | $inline {{ 21 | ./purecpp/html/notice.html 22 | }} 23 | 24 |
25 |

purecpp

26 |

一个很酷的modern c++开源社区

27 |
28 |
29 | 这里有创新的idea,这里有最酷的modern c++代码,这里有很棒的modern c++开源项目。purecpp社区邮箱 purecpp@163.com 30 |
31 |
32 |
33 |
34 | 报名参会 35 |
36 |
37 |
38 | 39 |
40 | 41 |
42 |
43 |
44 | 45 |
46 | 47 |
48 |
49 |
50 | 51 |
52 | 53 |
54 |
55 |
56 | 57 |
58 | 59 |
60 |
61 |
62 | 63 |
64 | 65 |
66 |
67 |
68 | 69 |
70 | 71 |
72 |
73 |
74 |
75 | 76 | 77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 | 86 | $inline {{ 87 | ./purecpp/html/footer.html 88 | }} 89 | 90 |
91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 108 | -------------------------------------------------------------------------------- /purecpp/html/register_user_group.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $inline {{ 6 | ./purecpp/html/header.html 7 | }} 8 | 9 | 10 | 11 | $include {{ 12 | ./purecpp/html/navigator.html 13 | }} 14 | 15 |
16 | 17 |
18 |
19 | 20 | $inline {{ 21 | ./purecpp/html/notice.html 22 | }} 23 | 24 |
25 |

purecpp

26 |

一个很酷的modern c++开源社区

27 |
28 |
29 | 这里有创新的idea,这里有最酷的modern c++代码,这里有很棒的modern c++开源项目。purecpp社区邮箱 purecpp@163.com 30 |
31 |
32 |
33 |
34 | 报名加入中国C++ User Group 35 |
36 |
37 |
38 | 39 |
40 | 41 |
42 |
43 |
44 | 45 |
46 | 47 |
48 |
49 |
50 | 51 |
52 | 53 |
54 |
55 |
56 | 57 |
58 | 59 |
60 |
61 |
62 | 63 |
64 | 65 |
66 |
67 |
68 | 69 |
70 | 71 |
72 |
73 |
74 |
75 | 76 | 77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 | 86 | $inline {{ 87 | ./purecpp/html/footer.html 88 | }} 89 | 90 |
91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 108 | -------------------------------------------------------------------------------- /purecpp/html/righter.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Absolutely 5 |
6 |

purecpp

7 |

一个很酷的modern c++开源社区

8 |
9 |
10 | 这里有创新的idea,这里有最酷的modern c++代码,这里有很棒的modern c++开源项目。purecpp社区邮箱 purecpp@163.com 11 |
12 |
13 | 27 |
28 | 40 |
41 |
42 |
友情链接
43 | 48 |
49 |
-------------------------------------------------------------------------------- /purecpp/html/search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $inline {{ 6 | ./purecpp/html/header.html 7 | }} 8 | 9 | 10 | 11 | $include {{ 12 | ./purecpp/html/navigator.html 13 | }} 14 | 15 |
16 | 21 | 22 | 23 | 24 | 33 | 34 |
35 |
36 | 37 | $inline {{ 38 | ./purecpp/html/notice.html 39 | }} 40 | 41 |
42 | $for item in article_list{{ 43 |
44 |
45 | purecpp 46 |
47 |
48 |
49 | ${item.post_title} 50 |
51 |
52 | ${item.content_abstract} 53 |
54 |
55 |
56 | 82 |
83 | }} 84 |
85 |
86 | 87 | $inline {{ 88 | ./purecpp/html/righter.html 89 | }} 90 |
91 |
92 |
93 |
94 | 95 | $inline {{ 96 | ./purecpp/html/footer.html 97 | }} 98 | 99 |
100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 117 | 140 | -------------------------------------------------------------------------------- /purecpp/html/sign_out.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $inline {{ 6 | ./purecpp/html/header.html 7 | }} 8 | 9 | 10 | 11 | $include {{ 12 | ./purecpp/html/navigator.html 13 | }} 14 | 15 |
16 | 17 |
18 |
19 | 20 | $inline {{ 21 | ./purecpp/html/notice.html 22 | }} 23 | 24 |
25 |

purecpp

26 |

一个很酷的modern c++开源社区

27 |
28 |
29 | 这里有创新的idea,这里有最酷的modern c++代码,这里有很棒的modern c++开源项目。purecpp社区邮箱 purecpp@163.com 30 |
31 |
32 |
33 |
34 |
35 | 36 |
37 | 38 |
39 |
40 |
41 | 42 |
43 | 44 |
45 |
46 |
47 | 48 |
49 | 50 |
51 |
52 |
53 | 54 |
55 | 56 |
57 |
58 |
59 | 60 |
61 | 62 |
63 |
64 |
65 |
66 | 67 | 68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | 77 | $inline {{ 78 | ./purecpp/html/footer.html 79 | }} 80 | 81 |
82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 99 | -------------------------------------------------------------------------------- /purecpp/html/sign_up.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $inline {{ 6 | ./purecpp/html/header.html 7 | }} 8 | 9 | 10 | 11 | $include {{ 12 | ./purecpp/html/navigator.html 13 | }} 14 | 15 |
16 | 17 |
18 |
19 | 20 | $inline {{ 21 | ./purecpp/html/notice.html 22 | }} 23 | 24 |
25 |

purecpp

26 |

一个很酷的modern c++开源社区

27 |
28 |
29 | 这里有创新的idea,这里有最酷的modern c++代码,这里有很棒的modern c++开源项目。purecpp社区邮箱 purecpp@163.com 30 |
31 |
32 |
33 |
34 |
35 | 36 |
37 | 38 |
39 |
40 |
41 | 42 |
43 | 44 |
45 |
46 |
47 | 48 |
49 | 50 |
51 |
52 |
53 | 54 |
55 | 56 |
57 |
58 |
59 | 60 |
61 | 62 |
63 |
64 |
65 |
66 | 67 | 68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | 77 | $inline {{ 78 | ./purecpp/html/footer.html 79 | }} 80 | 81 |
82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 99 | -------------------------------------------------------------------------------- /purecpp/images/cover/logo6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qicosmos/feather/3ce30ab242c755c35bdafc2665ed96c5b41b979c/purecpp/images/cover/logo6.png -------------------------------------------------------------------------------- /purecpp/images/qq_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qicosmos/feather/3ce30ab242c755c35bdafc2665ed96c5b41b979c/purecpp/images/qq_32.png -------------------------------------------------------------------------------- /purecpp/images/qzone_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qicosmos/feather/3ce30ab242c755c35bdafc2665ed96c5b41b979c/purecpp/images/qzone_32.png -------------------------------------------------------------------------------- /purecpp/images/wechat_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qicosmos/feather/3ce30ab242c755c35bdafc2665ed96c5b41b979c/purecpp/images/wechat_32.png -------------------------------------------------------------------------------- /purecpp/images/weibo_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qicosmos/feather/3ce30ab242c755c35bdafc2665ed96c5b41b979c/purecpp/images/weibo_32.png -------------------------------------------------------------------------------- /purecpp/js/about.js: -------------------------------------------------------------------------------- 1 | layui.use(['element', 'jquery', 'form', 'layedit'], function () { 2 | var element = layui.element(); 3 | var form = layui.form(); 4 | var $ = layui.jquery; 5 | var layedit = layui.layedit; 6 | 7 | //评论和留言的编辑器 8 | var editIndex = layedit.build('remarkEditor', { 9 | height: 150, 10 | tool: ['face', '|', 'left', 'center', 'right', '|', 'link'], 11 | }); 12 | //评论和留言的编辑器的验证 13 | layui.form().verify({ 14 | content: function (value) { 15 | value = $.trim(layedit.getText(editIndex)); 16 | if (value == "") return "自少得有一个字吧"; 17 | layedit.sync(editIndex); 18 | } 19 | }); 20 | 21 | //Hash地址的定位 22 | var layid = location.hash.replace(/^#tabIndex=/, ''); 23 | if (layid == "") { 24 | element.tabChange('tabAbout', 1); 25 | } 26 | element.tabChange('tabAbout', layid); 27 | 28 | element.on('tab(tabAbout)', function (elem) { 29 | location.hash = 'tabIndex=' + $(this).attr('lay-id'); 30 | }); 31 | 32 | //监听留言提交 33 | form.on('submit(formLeaveMessage)', function (data) { 34 | var index = layer.load(1); 35 | //模拟留言提交 36 | setTimeout(function () { 37 | layer.close(index); 38 | var content = data.field.editorContent; 39 | var html = '
  • 模拟留言
    模拟留言
    ' + content + '
  • '; 40 | $('.blog-comment').append(html); 41 | $('#remarkEditor').val(''); 42 | editIndex = layui.layedit.build('remarkEditor', { 43 | height: 150, 44 | tool: ['face', '|', 'left', 'center', 'right', '|', 'link'], 45 | }); 46 | layer.msg("留言成功", { icon: 1 }); 47 | }, 500); 48 | return false; 49 | }); 50 | 51 | //监听留言回复提交 52 | form.on('submit(formReply)', function (data) { 53 | var index = layer.load(1); 54 | //模拟留言回复 55 | setTimeout(function () { 56 | layer.close(index); 57 | var content = data.field.replyContent; 58 | var html = '
    Absolutely
    模拟回复' + content + '

    2017-03-18 18:26

    '; 59 | $(data.form).find('textarea').val(''); 60 | $(data.form).parent('.replycontainer').before(html).siblings('.comment-parent').children('p').children('a').click(); 61 | layer.msg("回复成功", { icon: 1 }); 62 | }, 500); 63 | return false; 64 | }); 65 | }); 66 | function btnReplyClick(elem) { 67 | var $ = layui.jquery; 68 | $(elem).parent('p').parent('.comment-parent').siblings('.replycontainer').toggleClass('layui-hide'); 69 | if ($(elem).text() == '回复') { 70 | $(elem).text('收起') 71 | } else { 72 | $(elem).text('回复') 73 | } 74 | } 75 | systemTime(); 76 | 77 | function systemTime() { 78 | //获取系统时间。 79 | var dateTime = new Date(); 80 | var year = dateTime.getFullYear(); 81 | var month = dateTime.getMonth() + 1; 82 | var day = dateTime.getDate(); 83 | var hh = dateTime.getHours(); 84 | var mm = dateTime.getMinutes(); 85 | var ss = dateTime.getSeconds(); 86 | 87 | //分秒时间是一位数字,在数字前补0。 88 | mm = extra(mm); 89 | ss = extra(ss); 90 | 91 | //将时间显示到ID为time的位置,时间格式形如:19:18:02 92 | document.getElementById("time").innerHTML = year + "-" + month + "-" + day + " " + hh + ":" + mm + ":" + ss; 93 | //每隔1000ms执行方法systemTime()。 94 | setTimeout("systemTime()", 1000); 95 | } 96 | 97 | //补位函数。 98 | function extra(x) { 99 | //如果传入数字小于10,数字前补一位0。 100 | if (x < 10) { 101 | return "0" + x; 102 | } 103 | else { 104 | return x; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /purecpp/js/detail.js: -------------------------------------------------------------------------------- 1 | prettyPrint(); 2 | layui.use(['form', 'layedit'], function () { 3 | var form = layui.form(); 4 | var $ = layui.jquery; 5 | var layedit = layui.layedit; 6 | 7 | //评论和留言的编辑器 8 | var editIndex = layedit.build('remarkEditor', { 9 | height: 150, 10 | tool: [ 11 | 'strong' //加粗 12 | ,'italic' //斜体 13 | ,'underline' //下划线 14 | ,'del' //删除线 15 | 16 | ,'|' //分割线 17 | 18 | ,'left' //左对齐 19 | ,'center' //居中对齐 20 | ,'right' //右对齐 21 | ,'link' //超链接 22 | ,'unlink' //清除链接 23 | ,'face' //表情 24 | ,'code' //code 25 | ], 26 | }); 27 | //评论和留言的编辑器的验证 28 | layui.form().verify({ 29 | content: function (value) { 30 | value = $.trim(layedit.getText(editIndex)); 31 | if (value == "") return " 至少得有一个字吧"; 32 | layedit.sync(editIndex); 33 | } 34 | }); 35 | 36 | //监听评论提交 37 | form.on('submit(formRemark)', function (data) { 38 | data.form.submit(); 39 | return false; 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /purecpp/js/global.js: -------------------------------------------------------------------------------- 1 | layui.use(['element', 'layer', 'util', 'form'], function () { 2 | var $ = layui.jquery; 3 | //模拟QQ登陆 4 | $('.blog-user').click(function () { 5 | var user = this; 6 | var index = layer.load(1); 7 | setTimeout(function () { 8 | layer.close(index); 9 | $(user).toggleClass('layui-hide').siblings('a.blog-user').toggleClass('layui-hide'); 10 | }, 800); 11 | }); 12 | //分享工具 13 | layui.util.fixbar({ 14 | bar1: '', 15 | click: function (type) { 16 | if (type === 'bar1') { 17 | var sear = new RegExp('layui-hide'); 18 | if (sear.test($('.blog-share').attr('class'))) { 19 | shareIn(); 20 | } else { 21 | shareOut(); 22 | } 23 | } 24 | } 25 | }); 26 | 27 | //子栏目导航点击事件 28 | $('.child-nav span').click(function () { 29 | layer.msg('切换到相应栏目'); 30 | $(this).addClass('child-nav-btn-this').siblings().removeClass('child-nav-btn-this'); 31 | }); 32 | 33 | //侧边导航开关点击事件 34 | $('.blog-navicon').click(function () { 35 | var sear = new RegExp('layui-hide'); 36 | if (sear.test($('.blog-nav-left').attr('class'))) { 37 | leftIn(); 38 | } else { 39 | leftOut(); 40 | } 41 | }); 42 | //侧边导航遮罩点击事件 43 | $('.blog-mask').click(function () { 44 | leftOut(); 45 | }); 46 | //blog-body和blog-footer点击事件,用来关闭百度分享和类别导航 47 | $('.blog-body,.blog-footer').click(function () { 48 | shareOut(); 49 | categoryOut(); 50 | }); 51 | //类别导航开关点击事件 52 | $('.category-toggle').click(function (e) { 53 | e.stopPropagation(); //阻止事件冒泡 54 | categroyIn(); 55 | }); 56 | //类别导航点击事件,用来关闭类别导航 57 | $('.article-category').click(function () { 58 | categoryOut(); 59 | }); 60 | //具体类别点击事件 61 | $('.article-category > a').click(function (e) { 62 | e.stopPropagation(); //阻止事件冒泡 63 | }); 64 | 65 | //显示百度分享 66 | function shareIn() { 67 | $('.blog-share').unbind('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'); 68 | $('.blog-share').removeClass('shareOut'); 69 | $('.blog-share').addClass('shareIn'); 70 | $('.blog-share').removeClass('layui-hide'); 71 | $('.blog-share').addClass('layui-show'); 72 | } 73 | //隐藏百度分享 74 | function shareOut() { 75 | $('.blog-share').on('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { 76 | $('.blog-share').addClass('layui-hide'); 77 | }); 78 | $('.blog-share').removeClass('shareIn'); 79 | $('.blog-share').addClass('shareOut'); 80 | $('.blog-share').removeClass('layui-show'); 81 | } 82 | //显示侧边导航 83 | function leftIn() { 84 | $('.blog-mask').unbind('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'); 85 | $('.blog-nav-left').unbind('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'); 86 | 87 | $('.blog-mask').removeClass('maskOut'); 88 | $('.blog-mask').addClass('maskIn'); 89 | $('.blog-mask').removeClass('layui-hide'); 90 | $('.blog-mask').addClass('layui-show'); 91 | 92 | $('.blog-nav-left').removeClass('leftOut'); 93 | $('.blog-nav-left').addClass('leftIn'); 94 | $('.blog-nav-left').removeClass('layui-hide'); 95 | $('.blog-nav-left').addClass('layui-show'); 96 | } 97 | //隐藏侧边导航 98 | function leftOut() { 99 | $('.blog-mask').on('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { 100 | $('.blog-mask').addClass('layui-hide'); 101 | }); 102 | $('.blog-nav-left').on('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { 103 | $('.blog-nav-left').addClass('layui-hide'); 104 | }); 105 | 106 | $('.blog-mask').removeClass('maskIn'); 107 | $('.blog-mask').addClass('maskOut'); 108 | $('.blog-mask').removeClass('layui-show'); 109 | 110 | $('.blog-nav-left').removeClass('leftIn'); 111 | $('.blog-nav-left').addClass('leftOut'); 112 | $('.blog-nav-left').removeClass('layui-show'); 113 | } 114 | //显示类别导航 115 | function categroyIn() { 116 | $('.category-toggle').addClass('layui-hide'); 117 | $('.article-category').unbind('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'); 118 | 119 | $('.article-category').removeClass('categoryOut'); 120 | $('.article-category').addClass('categoryIn'); 121 | $('.article-category').addClass('layui-show'); 122 | } 123 | //隐藏类别导航 124 | function categoryOut() { 125 | $('.article-category').on('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () { 126 | $('.article-category').removeClass('layui-show'); 127 | $('.category-toggle').removeClass('layui-hide'); 128 | }); 129 | 130 | $('.article-category').removeClass('categoryIn'); 131 | $('.article-category').addClass('categoryOut'); 132 | } 133 | 134 | }); 135 | 136 | 137 | //百度分享插件 138 | window._bd_share_config = { 139 | "common": { 140 | "bdSnsKey": {}, 141 | "bdText": "", 142 | "bdStyle": "0", 143 | "bdSize": "32" 144 | }, 145 | "share": {} 146 | }; 147 | with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)]; 148 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/HELP-US-OUT.txt: -------------------------------------------------------------------------------- 1 | I hope you love Font Awesome. If you've found it useful, please do me a favor and check out my latest project, 2 | Fort Awesome (https://fortawesome.com). It makes it easy to put the perfect icons on your website. Choose from our awesome, 3 | comprehensive icon sets or copy and paste your own. 4 | 5 | Please. Check it out. 6 | 7 | -Dave Gandy 8 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qicosmos/feather/3ce30ab242c755c35bdafc2665ed96c5b41b979c/purecpp/plug/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qicosmos/feather/3ce30ab242c755c35bdafc2665ed96c5b41b979c/purecpp/plug/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qicosmos/feather/3ce30ab242c755c35bdafc2665ed96c5b41b979c/purecpp/plug/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qicosmos/feather/3ce30ab242c755c35bdafc2665ed96c5b41b979c/purecpp/plug/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qicosmos/feather/3ce30ab242c755c35bdafc2665ed96c5b41b979c/purecpp/plug/font-awesome/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/less/animated.less: -------------------------------------------------------------------------------- 1 | // Animated Icons 2 | // -------------------------- 3 | 4 | .@{fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .@{fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/less/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .@{fa-css-prefix}-pull-left { float: left; } 11 | .@{fa-css-prefix}-pull-right { float: right; } 12 | 13 | .@{fa-css-prefix} { 14 | &.@{fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.@{fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .@{fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/less/core.less: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/less/fixed-width.less: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .@{fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/less/font-awesome.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables.less"; 7 | @import "mixins.less"; 8 | @import "path.less"; 9 | @import "core.less"; 10 | @import "larger.less"; 11 | @import "fixed-width.less"; 12 | @import "list.less"; 13 | @import "bordered-pulled.less"; 14 | @import "animated.less"; 15 | @import "rotated-flipped.less"; 16 | @import "stacked.less"; 17 | @import "icons.less"; 18 | @import "screen-reader.less"; 19 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/less/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/less/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: (-@fa-li-width + (4em / 14)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/less/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | .fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | 14 | .fa-icon-rotate(@degrees, @rotation) { 15 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation})"; 16 | -webkit-transform: rotate(@degrees); 17 | -ms-transform: rotate(@degrees); 18 | transform: rotate(@degrees); 19 | } 20 | 21 | .fa-icon-flip(@horiz, @vert, @rotation) { 22 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation}, mirror=1)"; 23 | -webkit-transform: scale(@horiz, @vert); 24 | -ms-transform: scale(@horiz, @vert); 25 | transform: scale(@horiz, @vert); 26 | } 27 | 28 | 29 | // Only display content to screen readers. A la Bootstrap 4. 30 | // 31 | // See: http://a11yproject.com/posts/how-to-hide-content/ 32 | 33 | .sr-only() { 34 | position: absolute; 35 | width: 1px; 36 | height: 1px; 37 | padding: 0; 38 | margin: -1px; 39 | overflow: hidden; 40 | clip: rect(0,0,0,0); 41 | border: 0; 42 | } 43 | 44 | // Use in conjunction with .sr-only to only display content when it's focused. 45 | // 46 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 47 | // 48 | // Credit: HTML5 Boilerplate 49 | 50 | .sr-only-focusable() { 51 | &:active, 52 | &:focus { 53 | position: static; 54 | width: auto; 55 | height: auto; 56 | margin: 0; 57 | overflow: visible; 58 | clip: auto; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/less/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'), 9 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 10 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 11 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/less/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .@{fa-css-prefix}-rotate-90, 15 | :root .@{fa-css-prefix}-rotate-180, 16 | :root .@{fa-css-prefix}-rotate-270, 17 | :root .@{fa-css-prefix}-flip-horizontal, 18 | :root .@{fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/less/screen-reader.less: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { .sr-only(); } 5 | .sr-only-focusable { .sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/less/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/scss/_animated.scss: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .#{$fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .#{$fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/scss/_bordered-pulled.scss: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em $fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .#{$fa-css-prefix}-pull-left { float: left; } 11 | .#{$fa-css-prefix}-pull-right { float: right; } 12 | 13 | .#{$fa-css-prefix} { 14 | &.#{$fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.#{$fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .#{$fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/scss/_core.scss: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/scss/_fixed-width.scss: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .#{$fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/scss/_larger.scss: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .#{$fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .#{$fa-css-prefix}-2x { font-size: 2em; } 11 | .#{$fa-css-prefix}-3x { font-size: 3em; } 12 | .#{$fa-css-prefix}-4x { font-size: 4em; } 13 | .#{$fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/scss/_list.scss: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: $fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .#{$fa-css-prefix}-li { 11 | position: absolute; 12 | left: -$fa-li-width; 13 | width: $fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.#{$fa-css-prefix}-lg { 17 | left: -$fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/scss/_mixins.scss: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | @mixin fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | 14 | @mixin fa-icon-rotate($degrees, $rotation) { 15 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation})"; 16 | -webkit-transform: rotate($degrees); 17 | -ms-transform: rotate($degrees); 18 | transform: rotate($degrees); 19 | } 20 | 21 | @mixin fa-icon-flip($horiz, $vert, $rotation) { 22 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation}, mirror=1)"; 23 | -webkit-transform: scale($horiz, $vert); 24 | -ms-transform: scale($horiz, $vert); 25 | transform: scale($horiz, $vert); 26 | } 27 | 28 | 29 | // Only display content to screen readers. A la Bootstrap 4. 30 | // 31 | // See: http://a11yproject.com/posts/how-to-hide-content/ 32 | 33 | @mixin sr-only { 34 | position: absolute; 35 | width: 1px; 36 | height: 1px; 37 | padding: 0; 38 | margin: -1px; 39 | overflow: hidden; 40 | clip: rect(0,0,0,0); 41 | border: 0; 42 | } 43 | 44 | // Use in conjunction with .sr-only to only display content when it's focused. 45 | // 46 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 47 | // 48 | // Credit: HTML5 Boilerplate 49 | 50 | @mixin sr-only-focusable { 51 | &:active, 52 | &:focus { 53 | position: static; 54 | width: auto; 55 | height: auto; 56 | margin: 0; 57 | overflow: visible; 58 | clip: auto; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/scss/_path.scss: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}'); 7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), 8 | url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'), 9 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), 10 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), 11 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/scss/_rotated-flipped.scss: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } 5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } 6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } 7 | 8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } 9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .#{$fa-css-prefix}-rotate-90, 15 | :root .#{$fa-css-prefix}-rotate-180, 16 | :root .#{$fa-css-prefix}-rotate-270, 17 | :root .#{$fa-css-prefix}-flip-horizontal, 18 | :root .#{$fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/scss/_screen-reader.scss: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { @include sr-only(); } 5 | .sr-only-focusable { @include sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/scss/_stacked.scss: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; } 21 | -------------------------------------------------------------------------------- /purecpp/plug/font-awesome/scss/font-awesome.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "animated"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | @import "screen-reader"; 19 | -------------------------------------------------------------------------------- /purecpp/plug/laymd/laymd/laymd.css: -------------------------------------------------------------------------------- 1 | .layui-laymd { 2 | position: relative; 3 | display: block; 4 | border: 1px solid #e6e6e6; 5 | box-sizing: border-box; 6 | } 7 | 8 | .layui-form-item[pane] .layui-laymd { 9 | border: none; 10 | } 11 | 12 | .layui-laymd-tool { 13 | padding: 3px; 14 | border-bottom: 1px solid #e6e6e6; 15 | font-size: 0; 16 | } 17 | 18 | .layui-laymd-tool i, 19 | .layui-laymd-tool span { 20 | text-align: center; 21 | display: inline-block; 22 | vertical-align: middle; 23 | } 24 | 25 | .layui-laymd-tool i { 26 | min-width: 15px; 27 | height: 20px; 28 | line-height: 20px; 29 | padding: 3px 5px; 30 | color: #666; 31 | cursor: pointer; 32 | font-weight: bold; 33 | font-size: 16px; 34 | font-style: normal; 35 | font-family: Consolas, "Microsoft Sans Serif", sans-serif; 36 | } 37 | 38 | .layui-laymd-tool i.select, 39 | .layui-laymd-tool i:hover { 40 | background-color: #f2f2f2; 41 | } 42 | 43 | .layui-laymd-tool span { 44 | width: 1px; 45 | height: 20px; 46 | margin: 0 10px; 47 | background-color: #d2d2d2; 48 | } 49 | 50 | .layui-laymd-full { 51 | position: fixed; 52 | top: 65px; 53 | left: 0; 54 | right: 0; 55 | bottom: 0; 56 | background-color: #fff; 57 | border: none; 58 | } 59 | 60 | .layui-laymd-area { 61 | position: relative; 62 | } 63 | 64 | .layui-laymd-full .layui-laymd-area { 65 | position: absolute; 66 | height: auto!important; 67 | left: 0; 68 | top: 33px; 69 | right: 0; 70 | bottom: 0; 71 | } 72 | 73 | .layui-laymd-area textarea { 74 | resize: none; 75 | width: 100%; 76 | height: 100%; 77 | box-sizing: border-box; 78 | vertical-align: middle; 79 | padding: 10px; 80 | border: none; 81 | letter-spacing: 1px; 82 | font-family: Consolas, "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif; 83 | font-size: 16px; 84 | outline: none; 85 | word-wrap: break-word; 86 | word-break: break-all; 87 | } 88 | 89 | .layui-laymd-full textarea { 90 | width: 50%; 91 | } 92 | 93 | .layui-laymd-area iframe { 94 | border: none; 95 | outline: none; 96 | width: 100%; 97 | height: 100%; 98 | box-sizing: border-box; 99 | position: absolute; 100 | left: 0; 101 | top: 0; 102 | display: none; 103 | background-color: #fff; 104 | } 105 | 106 | .layui-laymd-full iframe { 107 | display: block!important; 108 | width: 50%; 109 | left: 50%; 110 | border-left: 1px solid #e6e6e6; 111 | } 112 | -------------------------------------------------------------------------------- /purecpp/plug/laymd/layui/css/modules/code.css: -------------------------------------------------------------------------------- 1 | /** layui-v2.3.0 MIT License By https://www.layui.com */ 2 | html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none} -------------------------------------------------------------------------------- /purecpp/plug/laymd/layui/css/modules/laydate/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qicosmos/feather/3ce30ab242c755c35bdafc2665ed96c5b41b979c/purecpp/plug/laymd/layui/css/modules/laydate/icon.png -------------------------------------------------------------------------------- /purecpp/plug/laymd/layui/css/modules/layer/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qicosmos/feather/3ce30ab242c755c35bdafc2665ed96c5b41b979c/purecpp/plug/laymd/layui/css/modules/layer/default/icon-ext.png -------------------------------------------------------------------------------- /purecpp/plug/laymd/layui/css/modules/layer/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qicosmos/feather/3ce30ab242c755c35bdafc2665ed96c5b41b979c/purecpp/plug/laymd/layui/css/modules/layer/default/icon.png -------------------------------------------------------------------------------- /purecpp/plug/laymd/layui/css/modules/layer/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qicosmos/feather/3ce30ab242c755c35bdafc2665ed96c5b41b979c/purecpp/plug/laymd/layui/css/modules/layer/default/loading-0.gif -------------------------------------------------------------------------------- /purecpp/plug/laymd/layui/css/modules/layer/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qicosmos/feather/3ce30ab242c755c35bdafc2665ed96c5b41b979c/purecpp/plug/laymd/layui/css/modules/layer/default/loading-1.gif -------------------------------------------------------------------------------- /purecpp/plug/laymd/layui/css/modules/layer/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qicosmos/feather/3ce30ab242c755c35bdafc2665ed96c5b41b979c/purecpp/plug/laymd/layui/css/modules/layer/default/loading-2.gif -------------------------------------------------------------------------------- /purecpp/plug/laymd/layui/lay/modules/util.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.3.0 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var t=layui.$,i={fixbar:function(e){var i,a,o="layui-fixbar",r="layui-fixbar-top",l=t(document),n=t("body");e=t.extend({showHeight:200},e),e.bar1=e.bar1===!0?"":e.bar1,e.bar2=e.bar2===!0?"":e.bar2,e.bgcolor=e.bgcolor?"background-color:"+e.bgcolor:"";var c=[e.bar1,e.bar2,""],g=t(['
      ',e.bar1?'
    • '+c[0]+"
    • ":"",e.bar2?'
    • '+c[1]+"
    • ":"",'
    • '+c[2]+"
    • ","
    "].join("")),u=g.find("."+r),s=function(){var t=l.scrollTop();t>=e.showHeight?i||(u.show(),i=1):i&&(u.hide(),i=0)};t("."+o)[0]||("object"==typeof e.css&&g.css(e.css),n.append(g),s(),g.find("li").on("click",function(){var i=t(this),a=i.attr("lay-type");"top"===a&&t("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,a)}),l.on("scroll",function(){clearTimeout(a),a=setTimeout(function(){s()},100)}))},countdown:function(e,t,i){var a=this,o="function"==typeof t,r=new Date(e).getTime(),l=new Date(!t||o?(new Date).getTime():t).getTime(),n=r-l,c=[Math.floor(n/864e5),Math.floor(n/36e5)%24,Math.floor(n/6e4)%60,Math.floor(n/1e3)%60];o&&(i=t);var g=setTimeout(function(){a.countdown(e,l+1e3,i)},1e3);return i&&i(n>0?c:[0,0,0,0],t,g),n<=0&&clearTimeout(g),g},timeAgo:function(e,t){var i=this,a=[[],[]],o=(new Date).getTime()-new Date(e).getTime();return o>6912e5?(o=new Date(e),a[0][0]=i.digit(o.getFullYear(),4),a[0][1]=i.digit(o.getMonth()+1),a[0][2]=i.digit(o.getDate()),t||(a[1][0]=i.digit(o.getHours()),a[1][1]=i.digit(o.getMinutes()),a[1][2]=i.digit(o.getSeconds())),a[0].join("-")+" "+a[1].join(":")):o>=864e5?(o/1e3/60/60/24|0)+"天前":o>=36e5?(o/1e3/60/60|0)+"小时前":o>=12e4?(o/1e3/60|0)+"分钟前":o<0?"未来":"刚刚"},digit:function(e,t){var i="";e=String(e),t=t||2;for(var a=e.length;a/g,">").replace(/'/g,"'").replace(/"/g,""")}};e("util",i)}); -------------------------------------------------------------------------------- /purecpp/plug/laymd/layui/layui.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.3.0 MIT License By https://www.layui.com */ 2 | ;!function(e){"use strict";var t=document,n={modules:{},status:{},timeout:10,event:{}},o=function(){this.v="2.3.0"},r=function(){var e=t.currentScript?t.currentScript.src:function(){for(var e,n=t.scripts,o=n.length-1,r=o;r>0;r--)if("interactive"===n[r].readyState){e=n[r].src;break}return e||n[o].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),a=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},i="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),u={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",tree:"modules/tree",table:"modules/table",element:"modules/element",rate:"modules/rate",carousel:"modules/carousel",flow:"modules/flow",util:"modules/util",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};o.prototype.cache=n,o.prototype.define=function(e,t){var o=this,r="function"==typeof e,a=function(){var e=function(e,t){layui[e]=t,n.status[e]=!0};return"function"==typeof t&&t(function(o,r){e(o,r),n.callback[o]=function(){t(e)}}),this};return r&&(t=e,e=[]),layui["layui.all"]||!layui["layui.all"]&&layui["layui.mobile"]?a.call(o):(o.use(e,a),o)},o.prototype.use=function(e,o,l){function s(e,t){var o="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||o.test((e.currentTarget||e.srcElement).readyState))&&(n.modules[d]=t,f.removeChild(v),function r(){return++m>1e3*n.timeout/4?a(d+" is not a valid module"):void(n.status[d]?c():setTimeout(r,4))}())}function c(){l.push(layui[d]),e.length>1?y.use(e.slice(1),o,l):"function"==typeof o&&o.apply(layui,l)}var y=this,p=n.dir=n.dir?n.dir:r,f=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(y.each(e,function(t,n){"jquery"===n&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var d=e[0],m=0;if(l=l||[],n.host=n.host||(p.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&u[d]||!layui["layui.all"]&&layui["layui.mobile"]&&u[d])return c(),y;if(n.modules[d])!function g(){return++m>1e3*n.timeout/4?a(d+" is not a valid module"):void("string"==typeof n.modules[d]&&n.status[d]?c():setTimeout(g,4))}();else{var v=t.createElement("script"),h=(u[d]?p+"lay/":/^\{\/\}/.test(y.modules[d])?"":n.base||"")+(y.modules[d]||d)+".js";h=h.replace(/^\{\/\}/,""),v.async=!0,v.charset="utf-8",v.src=h+function(){var e=n.version===!0?n.v||(new Date).getTime():n.version||"";return e?"?v="+e:""}(),f.appendChild(v),!v.attachEvent||v.attachEvent.toString&&v.attachEvent.toString().indexOf("[native code")<0||i?v.addEventListener("load",function(e){s(e,h)},!1):v.attachEvent("onreadystatechange",function(e){s(e,h)}),n.modules[d]=h}return y},o.prototype.getStyle=function(t,n){var o=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return o[o.getPropertyValue?"getPropertyValue":"getAttribute"](n)},o.prototype.link=function(e,o,r){var i=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof o&&(r=o);var s=(r||e).replace(/\.|\//g,""),c=u.id="layuicss-"+s,y=0;return u.rel="stylesheet",u.href=e+(n.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(c)||l.appendChild(u),"function"!=typeof o?i:(function p(){return++y>1e3*n.timeout/100?a(e+" timeout"):void(1989===parseInt(i.getStyle(t.getElementById(c),"width"))?function(){o()}():setTimeout(p,100))}(),i)},n.callback={},o.prototype.factory=function(e){if(layui[e])return"function"==typeof n.callback[e]?n.callback[e]:null},o.prototype.addcss=function(e,t,o){return layui.link(n.dir+"css/"+e,t,o)},o.prototype.img=function(e,t,n){var o=new Image;return o.src=e,o.complete?t(o):(o.onload=function(){o.onload=null,"function"==typeof t&&t(o)},void(o.onerror=function(e){o.onerror=null,"function"==typeof n&&n(e)}))},o.prototype.config=function(e){e=e||{};for(var t in e)n[t]=e[t];return this},o.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),o.prototype.extend=function(e){var t=this;e=e||{};for(var n in e)t[n]||t.modules[n]?a("模块名 "+n+" 已被占用"):t.modules[n]=e[n];return t},o.prototype.router=function(e){var t=this,e=e||location.hash,n={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(e=e.replace(/^#\//,""),n.href="/"+e,e=e.replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),n.search[t[0]]=t[1]}():n.path.push(t)}),n):n},o.prototype.data=function(t,n,o){if(t=t||"layui",o=o||localStorage,e.JSON&&e.JSON.parse){if(null===n)return delete o[t];n="object"==typeof n?n:{key:n};try{var r=JSON.parse(o[t])}catch(a){var r={}}return"value"in n&&(r[n.key]=n.value),n.remove&&delete r[n.key],o[t]=JSON.stringify(r),n.key?r[n.key]:r}},o.prototype.sessionData=function(e,t){return this.data(e,t,sessionStorage)},o.prototype.device=function(t){var n=navigator.userAgent.toLowerCase(),o=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(n.match(t)||[])[1],e||!1},r={os:function(){return/windows/.test(n)?"windows":/linux/.test(n)?"linux":/iphone|ipod|ipad|ios/.test(n)?"ios":/mac/.test(n)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((n.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:o("micromessenger")};return t&&!r[t]&&(r[t]=o(t)),r.android=/android/.test(n),r.ios="ios"===r.os,r},o.prototype.hint=function(){return{error:a}},o.prototype.each=function(e,t){var n,o=this;if("function"!=typeof t)return o;if(e=e||[],e.constructor===Object){for(n in e)if(t.call(e[n],n,e[n]))break}else for(n=0;na?1:r/g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('
    1. '+o.replace(/[\r\t\n]+/g,"
    2. ")+"
    "),c.find(">.layui-code-h3")[0]||c.prepend('

    '+(c.attr("lay-title")||e.title||"code")+(e.about?'layui.code':"")+"

    ");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss"); -------------------------------------------------------------------------------- /purecpp/plug/layui/lay/modules/flow.js: -------------------------------------------------------------------------------- 1 | /** layui-v1.0.9 MIT License By http://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var l=layui.jquery,o=function(e){},t='';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var u=l(e.elem);if(u[0]){var f=l(e.scrollElem||document),m=e.mb||50,s=!("isAuto"in e)||e.isAuto,y=e.end||"没有更多了",v=e.scrollElem&&e.scrollElem!==document,d="加载更多",h=l('");u.find(".layui-flow-more")[0]||u.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(y):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(f.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),i||(r=setTimeout(function(){var i=v?e.height():l(window).height(),n=v?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=m&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var f=e.attr("lay-src");layui.img(f,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",f).removeAttr("lay-src"),l[0]&&u(l),i++})}},u=function(e,o){var u=a?(o||n).height():l(window).height(),f=n.scrollTop(),m=f+u;if(t.lazyimg.elem=l(r),e)c(e,u);else for(var s=0;sm)break}};if(u(),!o){var f;n.on("scroll",function(){var e=l(this);f&&clearTimeout(f),f=setTimeout(function(){u(null,e)},50)}),o=!0}return u},e("flow",new o)}); -------------------------------------------------------------------------------- /purecpp/plug/layui/lay/modules/form.js: -------------------------------------------------------------------------------- 1 | /** layui-v1.0.9 MIT License By http://www.layui.com */ 2 | ;layui.define("layer",function(e){"use strict";var i=layui.jquery,t=layui.layer,a=layui.hint(),n=layui.device(),l="form",r=".layui-form",s="layui-this",c="layui-hide",o="layui-disabled",u=function(){this.config={verify:{required:[/[\S]+/,"必填项不能为空"],phone:[/^1\d{10}$/,"请输入正确的手机号"],email:[/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,"邮箱格式不正确"],url:[/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/,"链接格式不正确"],number:[/^\d+$/,"只能填写数字"],date:[/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/,"日期格式不正确"],identity:[/(^\d{15}$)|(^\d{17}(x|X|\d)$)/,"请输入正确的身份证号"]}}};u.prototype.set=function(e){var t=this;return i.extend(!0,t.config,e),t},u.prototype.verify=function(e){var t=this;return i.extend(!0,t.config.verify,e),t},u.prototype.on=function(e,i){return layui.onevent(l,e,i)},u.prototype.render=function(e){var t=this,n={select:function(){var e,t="请选择",a="layui-form-select",n="layui-select-title",u="layui-select-none",d="",f=i(r).find("select"),y=function(t,l){i(t.target).parent().hasClass(n)&&!l||(i("."+a).removeClass(a+"ed"),e&&d&&e.val(d)),e=null},v=function(t,r,f){var v=i(this),h=t.find("."+n),m=h.find("input"),p=t.find("dl"),k=p.children("dd");if(!r){var x=function(){t.addClass(a+"ed"),k.removeClass(c)},b=function(){t.removeClass(a+"ed"),m.blur(),g(m.val(),function(e){e&&(d=p.find("."+s).html(),m&&m.val(d))})};h.on("click",function(e){t.hasClass(a+"ed")?b():(y(e,!0),x()),p.find("."+u).remove()}),h.find(".layui-edge").on("click",function(){m.focus()}),m.on("keyup",function(e){var i=e.keyCode;9===i&&x()}).on("keydown",function(e){var i=e.keyCode;9===i?b():13===i&&e.preventDefault()});var g=function(e,t,a){var n=0;layui.each(k,function(){var t=i(this),l=t.text(),r=l.indexOf(e)===-1;(""===e||(a?r:e!==l))&&n++,a&&t[r?"addClass":"removeClass"](c)});var l=n===k.length;return t(l),l},C=function(e){var i=this.value,t=e.keyCode;return 9!==t&&13!==t&&37!==t&&38!==t&&39!==t&&40!==t&&void g(i,function(e){e?p.find("."+u)[0]||p.append('

    无匹配项

    '):p.find("."+u).remove()},!0)};f&&m.on("keyup",C).on("blur",function(i){e=m,d=p.find("."+s).html(),d||m.val("")}),k.on("click",function(){var e=i(this),a=e.attr("lay-value"),n=v.attr("lay-filter");return!e.hasClass(o)&&(v.val(a).removeClass("layui-form-danger"),m.val(e.text()),e.addClass(s).siblings().removeClass(s),layui.event.call(this,l,"select("+n+")",{elem:v[0],value:a,othis:t}),b(),!1)}),t.find("dl>dt").on("click",function(e){return!1}),i(document).off("click",y).on("click",y)}};f.each(function(e,l){var r=i(this),c=r.next("."+a),u=this.disabled,d=l.value,f=i(l.options[l.selectedIndex]);if("string"==typeof r.attr("lay-ignore"))return r.show();var y="string"==typeof r.attr("lay-search"),h=i(['
    ','
    ','
    ','
    '+function(e){var i=[];return layui.each(e,function(e,t){(0!==e||t.value)&&("optgroup"===t.tagName.toLowerCase()?i.push("
    "+t.label+"
    "):i.push('
    '+t.innerHTML+"
    "))}),i.join("")}(r.find("*"))+"
    ","
    "].join(""));c[0]&&c.remove(),r.after(h),v.call(this,h,u,y)})},checkbox:function(){var e={checkbox:["layui-form-checkbox","layui-form-checked","checkbox"],_switch:["layui-form-switch","layui-form-onswitch","switch"]},t=i(r).find("input[type=checkbox]"),a=function(e,t){var a=i(this);e.on("click",function(){var i=a.attr("lay-filter"),n=(a.attr("lay-text")||"").split("|");a[0].disabled||(a[0].checked?(a[0].checked=!1,e.removeClass(t[1]).find("em").text(n[1])):(a[0].checked=!0,e.addClass(t[1]).find("em").text(n[0])),layui.event.call(a[0],l,t[2]+"("+i+")",{elem:a[0],value:a[0].value,othis:e}))})};t.each(function(t,n){var l=i(this),r=l.attr("lay-skin"),s=(l.attr("lay-text")||"").split("|"),c=this.disabled;"switch"===r&&(r="_"+r);var u=e[r]||e.checkbox;if("string"==typeof l.attr("lay-ignore"))return l.show();var d=l.next("."+u[0]),f=i(['
    ',{_switch:""+((n.checked?s[0]:s[1])||"")+""}[r]||""+(n.title||"勾选")+''+(r?"":"")+"","
    "].join(""));d[0]&&d.remove(),l.after(f),a.call(this,f,u)})},radio:function(){var e="layui-form-radio",t=["",""],a=i(r).find("input[type=radio]"),n=function(a){var n=i(this),s="layui-anim-scaleSpring";a.on("click",function(){var c=n[0].name,o=n.parents(r),u=n.attr("lay-filter"),d=o.find("input[name="+c.replace(/(\.|#|\[|\])/g,"\\$1")+"]");n[0].disabled||(layui.each(d,function(){var a=i(this).next("."+e);this.checked=!1,a.removeClass(e+"ed"),a.find(".layui-icon").removeClass(s).html(t[1])}),n[0].checked=!0,a.addClass(e+"ed"),a.find(".layui-icon").addClass(s).html(t[0]),layui.event.call(n[0],l,"radio("+u+")",{elem:n[0],value:n[0].value,othis:a}))})};a.each(function(a,l){var r=i(this),s=r.next("."+e),c=this.disabled;if("string"==typeof r.attr("lay-ignore"))return r.show();var u=i(['
    ',''+t[l.checked?0:1]+"",""+(l.title||"未命名")+"","
    "].join(""));s[0]&&s.remove(),r.after(u),n.call(this,u)})}};return e?n[e]?n[e]():a.error("不支持的"+e+"表单渲染"):layui.each(n,function(e,i){i()}),t};var d=function(){var e=i(this),a=f.config.verify,s=null,c="layui-form-danger",o={},u=e.parents(r),d=u.find("*[lay-verify]"),y=e.parents("form")[0],v=u.find("input,select,textarea"),h=e.attr("lay-filter");return layui.each(d,function(e,l){var r=i(this),o=r.attr("lay-verify").split("|"),u="",d=r.val();if(r.removeClass(c),layui.each(o,function(e,i){var o="function"==typeof a[i];if(a[i]&&(o?u=a[i](d,l):!a[i][0].test(d)))return t.msg(u||a[i][1],{icon:5,shift:6}),n.android||n.ios||l.focus(),r.addClass(c),s=!0}),s)return s}),!s&&(layui.each(v,function(e,i){i.name&&(/^checkbox|radio$/.test(i.type)&&!i.checked||(o[i.name]=i.value))}),layui.event.call(this,l,"submit("+h+")",{elem:this,form:y,field:o}))},f=new u,y=i(document);f.render(),y.on("reset",r,function(){setTimeout(function(){f.render()},50)}),y.on("submit",r,d).on("click","*[lay-submit]",d),e(l,function(e){return f.set(e)})}); -------------------------------------------------------------------------------- /purecpp/plug/layui/lay/modules/laypage.js: -------------------------------------------------------------------------------- 1 | /** layui-v1.0.9 MIT License By http://www.layui.com */ 2 | ; layui.define(function (a) { "use strict"; function t(a) { new p(a) } var e = document, r = "getElementById", n = "getElementsByTagName", s = 0, p = function (a) { var t = this, e = t.config = a || {}; e.item = s++ , t.render(!0) }; p.on = function (a, t, e) { return a.attachEvent ? a.attachEvent("on" + t, function () { e.call(a, window.even) }) : a.addEventListener(t, e, !1), p }, p.prototype.type = function () { var a = this.config; if ("object" == typeof a.cont) return void 0 === a.cont.length ? 2 : 3 }, p.prototype.view = function () { var a = this, t = a.config, e = [], r = {}; if (t.pages = 0 | t.pages, t.curr = 0 | t.curr || 1, t.groups = "groups" in t ? 0 | t.groups : 5, t.first = "first" in t ? t.first : "首页", t.last = "last" in t ? t.last : "末页", t.prev = "prev" in t ? t.prev : "上一页", t.next = "next" in t ? t.next : "下一页", t.pages <= 1) return ""; for (t.groups > t.pages && (t.groups = t.pages), r.index = Math.ceil((t.curr + (t.groups > 1 && t.groups !== t.pages ? 1 : 0)) / (0 === t.groups ? 1 : t.groups)), t.curr > 1 && t.prev && e.push('' + t.prev + ""), r.index > 1 && t.first && 0 !== t.groups && e.push('' + t.first + ""), r.poor = Math.floor((t.groups - 1) / 2), r.start = r.index > 1 ? t.curr - r.poor : 1, r.end = r.index > 1 ? function () { var a = t.curr + (t.groups - r.poor - 1); return a > t.pages ? t.pages : a }() : t.groups, r.end - r.start < t.groups - 1 && (r.start = r.end - t.groups + 1); r.start <= r.end; r.start++)r.start === t.curr ? e.push('" + r.start + "") : e.push('' + r.start + ""); return t.pages > t.groups && r.end < t.pages && t.last && 0 !== t.groups && e.push('' + t.last + ""), r.flow = !t.prev && 0 === t.groups, (t.curr !== t.pages && t.next || r.flow) && e.push(function () { return r.flow && t.curr === t.pages ? '' + t.next + "" : '' + t.next + "" }()), '
    ' + e.join("") + function () { return t.skip ? '到第 ' : "" }() + "
    " }, p.prototype.jump = function (a) { if (a) { for (var t = this, e = t.config, r = a.children, s = a[n]("button")[0], i = a[n]("input")[0], u = 0, o = r.length; u < o; u++)"a" === r[u].nodeName.toLowerCase() && p.on(r[u], "click", function () { var a = 0 | this.getAttribute("data-page"); e.curr = a, t.render() }); s && p.on(s, "click", function () { var a = 0 | i.value.replace(/\s|\D/g, ""); a && a <= e.pages && (e.curr = a, t.render()) }) } }, p.prototype.render = function (a) { var t = this, n = t.config, s = t.type(), p = t.view(); 2 === s ? n.cont.innerHTML = p : 3 === s ? n.cont.html(p) : e[r](n.cont).innerHTML = p, n.jump && n.jump(n, a), t.jump(e[r]("layui-laypage-" + n.item)), n.hash && !a && (location.hash = "!" + n.hash + "=" + n.curr) }, a("laypage", t) }); -------------------------------------------------------------------------------- /purecpp/plug/layui/lay/modules/laytpl.js: -------------------------------------------------------------------------------- 1 | /** layui-v1.0.9 MIT License By http://www.layui.com */ 2 | ;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},n={exp:function(e){return new RegExp(e,"g")},query:function(e,n,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return c((n||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var n="Laytpl Error:";return"object"==typeof console&&console.error(n+e+"\n"+(r||"")),n+e}},c=n.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=c("^"+r.open+"#",""),l=c(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(c(r.open+"#"),r.open+"# ").replace(c(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(/(?="|')/g,"\\").replace(n.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(n.query(1),function(e){var n='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(c(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),n='"+_escape_('),n+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,n.escape)}catch(u){return delete o.cache,n.error(u,p)}},t.pt.render=function(e,r){var c,t=this;return e?(c=t.cache?t.cache(e,n.escape):t.parse(t.tpl,e),r?void r(c):c):n.error("no data")};var o=function(e){return"string"!=typeof e?n.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var n in e)r[n]=e[n]},o.v="1.2.0",e("laytpl",o)}); -------------------------------------------------------------------------------- /purecpp/plug/layui/lay/modules/pagesize.js: -------------------------------------------------------------------------------- 1 |  2 | layui.define('jquery', function (exports) { 3 | var $ = layui.jquery; 4 | function pagesize(id, pageSize) { 5 | $('#' + id + ' .layui-laypage').append('每页 '); 6 | $('#' + id + ' .laypage-extend-pagesize input[class=layui-laypage-skip]').val(pageSize); 7 | var pagesize = { 8 | btn: $('#' + id + ' .laypage-extend-pagesize .layui-laypage-btn'), 9 | callback: function (callback) { 10 | this.ok = callback; 11 | }, 12 | ok: null 13 | }; 14 | $(pagesize.btn).on('click', function () { 15 | pagesize.ok(pagesize.btn.siblings('input[class=layui-laypage-skip]').val()); 16 | }); 17 | return pagesize; 18 | } 19 | exports('pagesize', pagesize); 20 | }); -------------------------------------------------------------------------------- /purecpp/plug/layui/lay/modules/tree.js: -------------------------------------------------------------------------------- 1 | /** layui-v1.0.9 MIT License By http://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var o=layui.jquery,a=layui.hint(),r="layui-tree-enter",i=function(e){this.options=e},t={arrow:["",""],checkbox:["",""],radio:["",""],branch:["",""],leaf:""};i.prototype.init=function(e){var o=this;e.addClass("layui-box layui-tree"),o.options.skin&&e.addClass("layui-tree-skin-"+o.options.skin),o.tree(e),o.on(e)},i.prototype.tree=function(e,a){var r=this,i=r.options,n=a||i.nodes;layui.each(n,function(a,n){var l=n.children&&n.children.length>0,c=o('
      '),s=o(["
    • ",function(){return l?''+(n.spread?t.arrow[1]:t.arrow[0])+"":""}(),function(){return i.check?''+("checkbox"===i.check?t.checkbox[0]:"radio"===i.check?t.radio[0]:"")+"":""}(),function(){return'"+(''+(l?n.spread?t.branch[1]:t.branch[0]:t.leaf)+"")+(""+(n.name||"未命名")+"")}(),"
    • "].join(""));l&&(s.append(c),r.tree(c,n.children)),e.append(s),"function"==typeof i.click&&r.click(s,n),r.spread(s,n),i.drag&&r.drag(s,n)})},i.prototype.click=function(e,o){var a=this,r=a.options;e.children("a").on("click",function(e){layui.stope(e),r.click(o)})},i.prototype.spread=function(e,o){var a=this,r=(a.options,e.children(".layui-tree-spread")),i=e.children("ul"),n=e.children("a"),l=function(){e.data("spread")?(e.data("spread",null),i.removeClass("layui-show"),r.html(t.arrow[0]),n.find(".layui-icon").html(t.branch[0])):(e.data("spread",!0),i.addClass("layui-show"),r.html(t.arrow[1]),n.find(".layui-icon").html(t.branch[1]))};i[0]&&(r.on("click",l),n.on("dblclick",l))},i.prototype.on=function(e){var a=this,i=a.options,t="layui-tree-drag";e.find("i").on("selectstart",function(e){return!1}),i.drag&&o(document).on("mousemove",function(e){var r=a.move;if(r.from){var i=(r.to,o('
      '));e.preventDefault(),o("."+t)[0]||o("body").append(i);var n=o("."+t)[0]?o("."+t):i;n.addClass("layui-show").html(r.from.elem.children("a").html()),n.css({left:e.pageX+10,top:e.pageY+10})}}).on("mouseup",function(){var e=a.move;e.from&&(e.from.elem.children("a").removeClass(r),e.to&&e.to.elem.children("a").removeClass(r),a.move={},o("."+t).remove())})},i.prototype.move={},i.prototype.drag=function(e,a){var i=this,t=(i.options,e.children("a")),n=function(){var t=o(this),n=i.move;n.from&&(n.to={item:a,elem:e},t.addClass(r))};t.on("mousedown",function(){var o=i.move;o.from={item:a,elem:e}}),t.on("mouseenter",n).on("mousemove",n).on("mouseleave",function(){var e=o(this),a=i.move;a.from&&(delete a.to,e.removeClass(r))})},e("tree",function(e){var r=new i(e=e||{}),t=o(e.elem);return t[0]?void r.init(t):a.error("layui.tree 没有找到"+e.elem+"元素")})}); -------------------------------------------------------------------------------- /purecpp/plug/layui/lay/modules/upload.js: -------------------------------------------------------------------------------- 1 | /** layui-v1.0.9 MIT License By http://www.layui.com */ 2 | ;layui.define("layer",function(e){"use strict";var a=layui.jquery,t=layui.layer,i=(layui.device(),"layui-upload-enter"),n="layui-upload-iframe",r={icon:2,shift:6},o={file:"文件",video:"视频",audio:"音频"},s=function(e){this.options=e};s.prototype.init=function(){var e=this,t=e.options,r=a("body"),s=a(t.elem||".layui-upload-file"),u=a('');return a("#"+n)[0]||r.append(u),s.each(function(r,s){s=a(s);var u='
      ',l=s.attr("lay-type")||t.type;t.unwrap||(u='
      '+u+''+(s.attr("lay-title")||t.title||"上传"+(o[l]||"图片"))+"
      "),u=a(u),t.unwrap||u.on("dragover",function(e){e.preventDefault(),a(this).addClass(i)}).on("dragleave",function(){a(this).removeClass(i)}).on("drop",function(){a(this).removeClass(i)}),s.parent("form").attr("target")===n&&(t.unwrap?s.unwrap():(s.parent().next().remove(),s.unwrap().unwrap())),s.wrap(u),s.off("change").on("change",function(){e.action(this,l)})})},s.prototype.action=function(e,i){var o=this,s=o.options,u=e.value,l=a(e),p=l.attr("lay-ext")||s.ext||"";if(u){switch(i){case"file":if(p&&!RegExp("\\w\\.("+p+")$","i").test(escape(u)))return t.msg("不支持该文件格式",r),e.value="";break;case"video":if(!RegExp("\\w\\.("+(p||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(u)))return t.msg("不支持该视频格式",r),e.value="";break;case"audio":if(!RegExp("\\w\\.("+(p||"mp3|wav|mid")+")$","i").test(escape(u)))return t.msg("不支持该音频格式",r),e.value="";break;default:if(!RegExp("\\w\\.("+(p||"jpg|png|gif|bmp|jpeg")+")$","i").test(escape(u)))return t.msg("不支持该图片格式",r),e.value=""}s.before&&s.before(e),l.parent().submit();var c=a("#"+n),f=setInterval(function(){var a;try{a=c.contents().find("body").text()}catch(i){t.msg("上传接口存在跨域",r),clearInterval(f)}if(a){clearInterval(f),c.contents().find("body").html("");try{a=JSON.parse(a)}catch(i){return a={},t.msg("请对上传接口返回JSON字符",r)}"function"==typeof s.success&&s.success(a,e)}},30);e.value=""}},e("upload",function(e){var a=new s(e=e||{});a.init()})}); -------------------------------------------------------------------------------- /purecpp/plug/layui/lay/modules/util.js: -------------------------------------------------------------------------------- 1 | /** layui-v1.0.9 MIT License By http://www.layui.com */ 2 | ;layui.define("jquery",function(l){"use strict";var o=layui.jquery,i={fixbar:function(l){l=l||{},l.bgcolor=l.bgcolor?"background-color:"+l.bgcolor:"";var i,a,c="layui-fixbar-top",t=[l.bar1===!0?"":l.bar1,l.bar2===!0?"":l.bar2,""],r=o(['
        ',l.bar1?'
      • '+t[0]+"
      • ":"",l.bar2?'
      • '+t[1]+"
      • ":"",'
      • '+t[2]+"
      • ","
      "].join("")),e=r.find("."+c),s=function(){var i=o(document).scrollTop();i>=(l.showHeight||200)?a||(e.show(),a=1):a&&(e.hide(),a=0)};o(".layui-fixbar")[0]||("object"==typeof l.css&&r.css(l.css),o("body").append(r),s(),r.find("li").on("click",function(){var i=o(this),a=i.attr("lay-type");"top"===a&&o("html,body").animate({scrollTop:0},200),l.click&&l.click.call(this,a)}),o(document).on("scroll",function(){i&&clearTimeout(i),i=setTimeout(function(){s()},100)}))}};l("util",i)}); -------------------------------------------------------------------------------- /purecpp/plug/layui/layui.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.3.0 MIT License By https://www.layui.com */ 2 | ;!function(e){"use strict";var t=document,n={modules:{},status:{},timeout:10,event:{}},o=function(){this.v="2.3.0"},r=function(){var e=t.currentScript?t.currentScript.src:function(){for(var e,n=t.scripts,o=n.length-1,r=o;r>0;r--)if("interactive"===n[r].readyState){e=n[r].src;break}return e||n[o].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),a=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},i="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),u={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",tree:"modules/tree",table:"modules/table",element:"modules/element",rate:"modules/rate",carousel:"modules/carousel",flow:"modules/flow",util:"modules/util",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};o.prototype.cache=n,o.prototype.define=function(e,t){var o=this,r="function"==typeof e,a=function(){var e=function(e,t){layui[e]=t,n.status[e]=!0};return"function"==typeof t&&t(function(o,r){e(o,r),n.callback[o]=function(){t(e)}}),this};return r&&(t=e,e=[]),layui["layui.all"]||!layui["layui.all"]&&layui["layui.mobile"]?a.call(o):(o.use(e,a),o)},o.prototype.use=function(e,o,l){function s(e,t){var o="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||o.test((e.currentTarget||e.srcElement).readyState))&&(n.modules[d]=t,f.removeChild(v),function r(){return++m>1e3*n.timeout/4?a(d+" is not a valid module"):void(n.status[d]?c():setTimeout(r,4))}())}function c(){l.push(layui[d]),e.length>1?y.use(e.slice(1),o,l):"function"==typeof o&&o.apply(layui,l)}var y=this,p=n.dir=n.dir?n.dir:r,f=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(y.each(e,function(t,n){"jquery"===n&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var d=e[0],m=0;if(l=l||[],n.host=n.host||(p.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&u[d]||!layui["layui.all"]&&layui["layui.mobile"]&&u[d])return c(),y;if(n.modules[d])!function g(){return++m>1e3*n.timeout/4?a(d+" is not a valid module"):void("string"==typeof n.modules[d]&&n.status[d]?c():setTimeout(g,4))}();else{var v=t.createElement("script"),h=(u[d]?p+"lay/":/^\{\/\}/.test(y.modules[d])?"":n.base||"")+(y.modules[d]||d)+".js";h=h.replace(/^\{\/\}/,""),v.async=!0,v.charset="utf-8",v.src=h+function(){var e=n.version===!0?n.v||(new Date).getTime():n.version||"";return e?"?v="+e:""}(),f.appendChild(v),!v.attachEvent||v.attachEvent.toString&&v.attachEvent.toString().indexOf("[native code")<0||i?v.addEventListener("load",function(e){s(e,h)},!1):v.attachEvent("onreadystatechange",function(e){s(e,h)}),n.modules[d]=h}return y},o.prototype.getStyle=function(t,n){var o=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return o[o.getPropertyValue?"getPropertyValue":"getAttribute"](n)},o.prototype.link=function(e,o,r){var i=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof o&&(r=o);var s=(r||e).replace(/\.|\//g,""),c=u.id="layuicss-"+s,y=0;return u.rel="stylesheet",u.href=e+(n.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(c)||l.appendChild(u),"function"!=typeof o?i:(function p(){return++y>1e3*n.timeout/100?a(e+" timeout"):void(1989===parseInt(i.getStyle(t.getElementById(c),"width"))?function(){o()}():setTimeout(p,100))}(),i)},n.callback={},o.prototype.factory=function(e){if(layui[e])return"function"==typeof n.callback[e]?n.callback[e]:null},o.prototype.addcss=function(e,t,o){return layui.link(n.dir+"css/"+e,t,o)},o.prototype.img=function(e,t,n){var o=new Image;return o.src=e,o.complete?t(o):(o.onload=function(){o.onload=null,"function"==typeof t&&t(o)},void(o.onerror=function(e){o.onerror=null,"function"==typeof n&&n(e)}))},o.prototype.config=function(e){e=e||{};for(var t in e)n[t]=e[t];return this},o.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),o.prototype.extend=function(e){var t=this;e=e||{};for(var n in e)t[n]||t.modules[n]?a("模块名 "+n+" 已被占用"):t.modules[n]=e[n];return t},o.prototype.router=function(e){var t=this,e=e||location.hash,n={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(e=e.replace(/^#\//,""),n.href="/"+e,e=e.replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),n.search[t[0]]=t[1]}():n.path.push(t)}),n):n},o.prototype.data=function(t,n,o){if(t=t||"layui",o=o||localStorage,e.JSON&&e.JSON.parse){if(null===n)return delete o[t];n="object"==typeof n?n:{key:n};try{var r=JSON.parse(o[t])}catch(a){var r={}}return"value"in n&&(r[n.key]=n.value),n.remove&&delete r[n.key],o[t]=JSON.stringify(r),n.key?r[n.key]:r}},o.prototype.sessionData=function(e,t){return this.data(e,t,sessionStorage)},o.prototype.device=function(t){var n=navigator.userAgent.toLowerCase(),o=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(n.match(t)||[])[1],e||!1},r={os:function(){return/windows/.test(n)?"windows":/linux/.test(n)?"linux":/iphone|ipod|ipad|ios/.test(n)?"ios":/mac/.test(n)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((n.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:o("micromessenger")};return t&&!r[t]&&(r[t]=o(t)),r.android=/android/.test(n),r.ios="ios"===r.os,r},o.prototype.hint=function(){return{error:a}},o.prototype.each=function(e,t){var n,o=this;if("function"!=typeof t)return o;if(e=e||[],e.constructor===Object){for(n in e)if(t.call(e[n],n,e[n]))break}else for(n=0;na?1:r= sub_len) 60 | break; 61 | } 62 | 63 | return str.substr(0, byte_index); 64 | } 65 | } // namespace feather 66 | 67 | #endif // FEATHER_UTIL_HPP 68 | --------------------------------------------------------------------------------