├── .DS_Store ├── .gitattributes ├── .gitignore ├── ERichTextEditor.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcuserdata │ ├── apple.xcuserdatad │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ │ └── xcschememanagement.plist │ └── eleven.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist ├── ERichTextEditor ├── Classes │ ├── Controller │ │ ├── ViewController.h │ │ └── ViewController.m │ ├── Global │ │ ├── Eleven.h │ │ └── PrefixHeader.pch │ ├── Library │ │ ├── Category │ │ │ ├── UIColor+Extension.h │ │ │ ├── UIColor+Extension.m │ │ │ ├── UIView+Extension.h │ │ │ └── UIView+Extension.m │ │ └── ThirdPart │ │ │ └── ContentEditSource │ │ │ ├── JSBeautifier.js │ │ │ ├── ZSSRichTextEditor.js │ │ │ ├── editor.html │ │ │ └── jQuery.js │ ├── Other │ │ ├── AppDelegate.h │ │ └── AppDelegate.m │ └── View │ │ ├── ContentEditFooterView.h │ │ ├── ContentEditFooterView.m │ │ ├── ERichTextEditorView.h │ │ └── ERichTextEditorView.m └── Supporting Files │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── 文本设置 │ │ ├── Contents.json │ │ ├── btn_smile.imageset │ │ ├── Contents.json │ │ ├── btn_smile@2x.png │ │ └── btn_smile@3x.png │ │ ├── btn_smile2.imageset │ │ ├── Contents.json │ │ ├── btn_smile2@2x.png │ │ └── btn_smile2@3x.png │ │ ├── icon_Aa.imageset │ │ ├── Contents.json │ │ ├── icon_Aa@2x.png │ │ └── icon_Aa@3x.png │ │ ├── icon_Aa_1.imageset │ │ ├── Contents.json │ │ ├── icon_Aa_1@2x.png │ │ └── icon_Aa_1@3x.png │ │ ├── icon_H1.imageset │ │ ├── Contents.json │ │ ├── icon_H1@2x.png │ │ └── icon_H1@3x.png │ │ ├── icon_H1_1.imageset │ │ ├── Contents.json │ │ ├── icon_H1_1@2x.png │ │ └── icon_H1_1@3x.png │ │ ├── icon_H2.imageset │ │ ├── Contents.json │ │ ├── icon_H2@2x.png │ │ └── icon_H2@3x.png │ │ ├── icon_H2_1.imageset │ │ ├── Contents.json │ │ ├── icon_H2_1@2x.png │ │ └── icon_H2_1@3x.png │ │ ├── icon_H3.imageset │ │ ├── Contents.json │ │ ├── icon_H3@2x.png │ │ └── icon_H3@3x.png │ │ ├── icon_H3_1.imageset │ │ ├── Contents.json │ │ ├── icon_H3_1@2x.png │ │ └── icon_H3_1@3x.png │ │ ├── icon_H4.imageset │ │ ├── Contents.json │ │ ├── icon_H4@2x.png │ │ └── icon_H4@3x.png │ │ ├── icon_H4_1.imageset │ │ ├── Contents.json │ │ ├── icon_H4_1@2x.png │ │ └── icon_H4_1@3x.png │ │ ├── icon_arrow.imageset │ │ ├── Contents.json │ │ ├── qj@2x.png │ │ └── qj@3x.png │ │ ├── icon_biaoq1.imageset │ │ ├── Contents.json │ │ ├── icon_biaoq@2x.png │ │ └── icon_biaoq@3x.png │ │ ├── icon_biaoq2.imageset │ │ ├── Contents.json │ │ ├── icon_biaoq2@2x.png │ │ └── icon_biaoq2@3x.png │ │ ├── icon_cexiao.imageset │ │ ├── Contents.json │ │ ├── icon_cexiao@2x.png │ │ └── icon_cexiao@3x.png │ │ ├── icon_cexiao2.imageset │ │ ├── Contents.json │ │ ├── icon_cexiao2@2x.png │ │ └── icon_cexiao2@3x.png │ │ ├── icon_jiacu.imageset │ │ ├── Contents.json │ │ ├── icon_jiacu@2x.png │ │ └── icon_jiacu@3x.png │ │ ├── icon_jiacu2.imageset │ │ ├── Contents.json │ │ ├── icon_jiacu2@2x.png │ │ └── icon_jiacu2@3x.png │ │ ├── icon_lianjie.imageset │ │ ├── Contents.json │ │ ├── icon_lianjie@2x.png │ │ └── icon_lianjie@3x.png │ │ ├── icon_lianjie2.imageset │ │ ├── Contents.json │ │ ├── icon_lianjie2@2x.png │ │ └── icon_lianjie2@3x.png │ │ ├── icon_lieb.imageset │ │ ├── Contents.json │ │ ├── icon_lieb@2x.png │ │ └── icon_lieb@3x.png │ │ ├── icon_lieb2.imageset │ │ ├── Contents.json │ │ ├── icon_lieb2@2x.png │ │ └── icon_lieb2@3x.png │ │ ├── icon_lieb3.imageset │ │ ├── Contents.json │ │ ├── icon_lieb3@2x.png │ │ └── icon_lieb3@3x.png │ │ ├── icon_lieb4.imageset │ │ ├── Contents.json │ │ ├── icon_lieb4@2x.png │ │ └── icon_lieb4@3x.png │ │ ├── icon_picture1.imageset │ │ ├── Contents.json │ │ ├── icon_picture@2x.png │ │ └── icon_picture@3x.png │ │ ├── icon_picture2.imageset │ │ ├── Contents.json │ │ ├── icon_picture2@2x.png │ │ └── icon_picture2@3x.png │ │ ├── icon_qingx.imageset │ │ ├── Contents.json │ │ ├── icon_qingx@2x.png │ │ └── icon_qingx@3x.png │ │ ├── icon_qingx2.imageset │ │ ├── Contents.json │ │ ├── icon_qingx2@2x.png │ │ └── icon_qingx2@3x.png │ │ ├── icon_return.imageset │ │ ├── Contents.json │ │ ├── icon_return@2x.png │ │ └── icon_return@3x.png │ │ ├── icon_shanc.imageset │ │ ├── Contents.json │ │ ├── icon_shanc@2x.png │ │ └── icon_shanc@3x.png │ │ ├── icon_shanc2.imageset │ │ ├── Contents.json │ │ ├── icon_shanc2@2x.png │ │ └── icon_shanc2@3x.png │ │ ├── icon_yanse.imageset │ │ ├── Contents.json │ │ ├── icon_yanse@2x.png │ │ └── icon_yanse@3x.png │ │ ├── icon_yanse2.imageset │ │ ├── Contents.json │ │ ├── icon_yanse2@2x.png │ │ └── icon_yanse2@3x.png │ │ ├── icon_yinyong.imageset │ │ ├── Contents.json │ │ ├── icon_yinyong@2x.png │ │ └── icon_yinyong@3x.png │ │ └── icon_yinyong2.imageset │ │ ├── Contents.json │ │ ├── icon_yinyong2@2x.png │ │ └── icon_yinyong2@3x.png │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── main.m ├── LICENSE └── README.md /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/.DS_Store -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.js linguist-language=Objective-C 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots/**/*.png 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /ERichTextEditor.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 188CF7D4210D582C008A0413 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 188CF7D3210D582C008A0413 /* AppDelegate.m */; }; 11 | 188CF7D7210D582C008A0413 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 188CF7D6210D582C008A0413 /* ViewController.m */; }; 12 | 188CF7DA210D582C008A0413 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 188CF7D8210D582C008A0413 /* Main.storyboard */; }; 13 | 188CF7DC210D582E008A0413 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 188CF7DB210D582E008A0413 /* Assets.xcassets */; }; 14 | 188CF7DF210D582E008A0413 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 188CF7DD210D582E008A0413 /* LaunchScreen.storyboard */; }; 15 | 188CF7E2210D582E008A0413 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 188CF7E1210D582E008A0413 /* main.m */; }; 16 | 188CF7EF210D589D008A0413 /* ZSSRichTextEditor.js in Resources */ = {isa = PBXBuildFile; fileRef = 188CF7EB210D589D008A0413 /* ZSSRichTextEditor.js */; }; 17 | 188CF7F0210D589D008A0413 /* editor.html in Resources */ = {isa = PBXBuildFile; fileRef = 188CF7EC210D589D008A0413 /* editor.html */; }; 18 | 188CF7F1210D589D008A0413 /* JSBeautifier.js in Resources */ = {isa = PBXBuildFile; fileRef = 188CF7ED210D589D008A0413 /* JSBeautifier.js */; }; 19 | 188CF7F2210D589D008A0413 /* jQuery.js in Resources */ = {isa = PBXBuildFile; fileRef = 188CF7EE210D589D008A0413 /* jQuery.js */; }; 20 | 188CF7FA210D5988008A0413 /* ERichTextEditorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 188CF7F8210D5988008A0413 /* ERichTextEditorView.m */; }; 21 | 188CF7FD210D59BB008A0413 /* ContentEditFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 188CF7FC210D59BA008A0413 /* ContentEditFooterView.m */; }; 22 | 188CF805210D5D8E008A0413 /* UIView+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 188CF804210D5D8E008A0413 /* UIView+Extension.m */; }; 23 | 188CF808210D5FBC008A0413 /* UIColor+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 188CF807210D5FBC008A0413 /* UIColor+Extension.m */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 188CF7CF210D582C008A0413 /* ERichTextEditor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ERichTextEditor.app; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 188CF7D2210D582C008A0413 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 29 | 188CF7D3210D582C008A0413 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 30 | 188CF7D5210D582C008A0413 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 31 | 188CF7D6210D582C008A0413 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 32 | 188CF7D9210D582C008A0413 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 33 | 188CF7DB210D582E008A0413 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 34 | 188CF7DE210D582E008A0413 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 35 | 188CF7E0210D582E008A0413 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 36 | 188CF7E1210D582E008A0413 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 37 | 188CF7EB210D589D008A0413 /* ZSSRichTextEditor.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = ZSSRichTextEditor.js; sourceTree = ""; }; 38 | 188CF7EC210D589D008A0413 /* editor.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = editor.html; sourceTree = ""; }; 39 | 188CF7ED210D589D008A0413 /* JSBeautifier.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = JSBeautifier.js; sourceTree = ""; }; 40 | 188CF7EE210D589D008A0413 /* jQuery.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jQuery.js; sourceTree = ""; }; 41 | 188CF7F8210D5988008A0413 /* ERichTextEditorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ERichTextEditorView.m; sourceTree = ""; }; 42 | 188CF7F9210D5988008A0413 /* ERichTextEditorView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ERichTextEditorView.h; sourceTree = ""; }; 43 | 188CF7FB210D59BA008A0413 /* ContentEditFooterView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentEditFooterView.h; sourceTree = ""; }; 44 | 188CF7FC210D59BA008A0413 /* ContentEditFooterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContentEditFooterView.m; sourceTree = ""; }; 45 | 188CF7FF210D5B0B008A0413 /* Eleven.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Eleven.h; sourceTree = ""; }; 46 | 188CF801210D5B6B008A0413 /* PrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = ""; }; 47 | 188CF803210D5D8E008A0413 /* UIView+Extension.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIView+Extension.h"; sourceTree = ""; }; 48 | 188CF804210D5D8E008A0413 /* UIView+Extension.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIView+Extension.m"; sourceTree = ""; }; 49 | 188CF806210D5FBC008A0413 /* UIColor+Extension.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIColor+Extension.h"; sourceTree = ""; }; 50 | 188CF807210D5FBC008A0413 /* UIColor+Extension.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIColor+Extension.m"; sourceTree = ""; }; 51 | /* End PBXFileReference section */ 52 | 53 | /* Begin PBXFrameworksBuildPhase section */ 54 | 188CF7CC210D582C008A0413 /* Frameworks */ = { 55 | isa = PBXFrameworksBuildPhase; 56 | buildActionMask = 2147483647; 57 | files = ( 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 188CF7C6210D582C008A0413 = { 65 | isa = PBXGroup; 66 | children = ( 67 | 188CF7D1210D582C008A0413 /* ERichTextEditor */, 68 | 188CF7D0210D582C008A0413 /* Products */, 69 | ); 70 | sourceTree = ""; 71 | }; 72 | 188CF7D0210D582C008A0413 /* Products */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 188CF7CF210D582C008A0413 /* ERichTextEditor.app */, 76 | ); 77 | name = Products; 78 | sourceTree = ""; 79 | }; 80 | 188CF7D1210D582C008A0413 /* ERichTextEditor */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | 188CF7F3210D58BA008A0413 /* Classes */, 84 | 188CF7F6210D58E9008A0413 /* Supporting Files */, 85 | ); 86 | path = ERichTextEditor; 87 | sourceTree = ""; 88 | }; 89 | 188CF7E8210D5875008A0413 /* Library */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | 188CF802210D5D6F008A0413 /* Category */, 93 | 188CF7E9210D5883008A0413 /* ThirdPart */, 94 | ); 95 | path = Library; 96 | sourceTree = ""; 97 | }; 98 | 188CF7E9210D5883008A0413 /* ThirdPart */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 188CF7EA210D589D008A0413 /* ContentEditSource */, 102 | ); 103 | path = ThirdPart; 104 | sourceTree = ""; 105 | }; 106 | 188CF7EA210D589D008A0413 /* ContentEditSource */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 188CF7EB210D589D008A0413 /* ZSSRichTextEditor.js */, 110 | 188CF7EC210D589D008A0413 /* editor.html */, 111 | 188CF7ED210D589D008A0413 /* JSBeautifier.js */, 112 | 188CF7EE210D589D008A0413 /* jQuery.js */, 113 | ); 114 | path = ContentEditSource; 115 | sourceTree = ""; 116 | }; 117 | 188CF7F3210D58BA008A0413 /* Classes */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 188CF7FE210D5AF5008A0413 /* Global */, 121 | 188CF7F5210D58C9008A0413 /* View */, 122 | 188CF7F4210D58C1008A0413 /* Controller */, 123 | 188CF7F7210D590A008A0413 /* Other */, 124 | 188CF7E8210D5875008A0413 /* Library */, 125 | ); 126 | path = Classes; 127 | sourceTree = ""; 128 | }; 129 | 188CF7F4210D58C1008A0413 /* Controller */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 188CF7D5210D582C008A0413 /* ViewController.h */, 133 | 188CF7D6210D582C008A0413 /* ViewController.m */, 134 | ); 135 | path = Controller; 136 | sourceTree = ""; 137 | }; 138 | 188CF7F5210D58C9008A0413 /* View */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 188CF7FB210D59BA008A0413 /* ContentEditFooterView.h */, 142 | 188CF7FC210D59BA008A0413 /* ContentEditFooterView.m */, 143 | 188CF7F9210D5988008A0413 /* ERichTextEditorView.h */, 144 | 188CF7F8210D5988008A0413 /* ERichTextEditorView.m */, 145 | ); 146 | path = View; 147 | sourceTree = ""; 148 | }; 149 | 188CF7F6210D58E9008A0413 /* Supporting Files */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | 188CF7D8210D582C008A0413 /* Main.storyboard */, 153 | 188CF7DB210D582E008A0413 /* Assets.xcassets */, 154 | 188CF7DD210D582E008A0413 /* LaunchScreen.storyboard */, 155 | 188CF7E0210D582E008A0413 /* Info.plist */, 156 | 188CF7E1210D582E008A0413 /* main.m */, 157 | ); 158 | path = "Supporting Files"; 159 | sourceTree = ""; 160 | }; 161 | 188CF7F7210D590A008A0413 /* Other */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | 188CF7D2210D582C008A0413 /* AppDelegate.h */, 165 | 188CF7D3210D582C008A0413 /* AppDelegate.m */, 166 | ); 167 | path = Other; 168 | sourceTree = ""; 169 | }; 170 | 188CF7FE210D5AF5008A0413 /* Global */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | 188CF7FF210D5B0B008A0413 /* Eleven.h */, 174 | 188CF801210D5B6B008A0413 /* PrefixHeader.pch */, 175 | ); 176 | path = Global; 177 | sourceTree = ""; 178 | }; 179 | 188CF802210D5D6F008A0413 /* Category */ = { 180 | isa = PBXGroup; 181 | children = ( 182 | 188CF803210D5D8E008A0413 /* UIView+Extension.h */, 183 | 188CF804210D5D8E008A0413 /* UIView+Extension.m */, 184 | 188CF806210D5FBC008A0413 /* UIColor+Extension.h */, 185 | 188CF807210D5FBC008A0413 /* UIColor+Extension.m */, 186 | ); 187 | path = Category; 188 | sourceTree = ""; 189 | }; 190 | /* End PBXGroup section */ 191 | 192 | /* Begin PBXNativeTarget section */ 193 | 188CF7CE210D582C008A0413 /* ERichTextEditor */ = { 194 | isa = PBXNativeTarget; 195 | buildConfigurationList = 188CF7E5210D582E008A0413 /* Build configuration list for PBXNativeTarget "ERichTextEditor" */; 196 | buildPhases = ( 197 | 188CF7CB210D582C008A0413 /* Sources */, 198 | 188CF7CC210D582C008A0413 /* Frameworks */, 199 | 188CF7CD210D582C008A0413 /* Resources */, 200 | ); 201 | buildRules = ( 202 | ); 203 | dependencies = ( 204 | ); 205 | name = ERichTextEditor; 206 | productName = ERichTextEditor; 207 | productReference = 188CF7CF210D582C008A0413 /* ERichTextEditor.app */; 208 | productType = "com.apple.product-type.application"; 209 | }; 210 | /* End PBXNativeTarget section */ 211 | 212 | /* Begin PBXProject section */ 213 | 188CF7C7210D582C008A0413 /* Project object */ = { 214 | isa = PBXProject; 215 | attributes = { 216 | LastUpgradeCheck = 0940; 217 | ORGANIZATIONNAME = Eleven; 218 | TargetAttributes = { 219 | 188CF7CE210D582C008A0413 = { 220 | CreatedOnToolsVersion = 9.4.1; 221 | }; 222 | }; 223 | }; 224 | buildConfigurationList = 188CF7CA210D582C008A0413 /* Build configuration list for PBXProject "ERichTextEditor" */; 225 | compatibilityVersion = "Xcode 9.3"; 226 | developmentRegion = en; 227 | hasScannedForEncodings = 0; 228 | knownRegions = ( 229 | en, 230 | Base, 231 | ); 232 | mainGroup = 188CF7C6210D582C008A0413; 233 | productRefGroup = 188CF7D0210D582C008A0413 /* Products */; 234 | projectDirPath = ""; 235 | projectRoot = ""; 236 | targets = ( 237 | 188CF7CE210D582C008A0413 /* ERichTextEditor */, 238 | ); 239 | }; 240 | /* End PBXProject section */ 241 | 242 | /* Begin PBXResourcesBuildPhase section */ 243 | 188CF7CD210D582C008A0413 /* Resources */ = { 244 | isa = PBXResourcesBuildPhase; 245 | buildActionMask = 2147483647; 246 | files = ( 247 | 188CF7DF210D582E008A0413 /* LaunchScreen.storyboard in Resources */, 248 | 188CF7F1210D589D008A0413 /* JSBeautifier.js in Resources */, 249 | 188CF7F0210D589D008A0413 /* editor.html in Resources */, 250 | 188CF7EF210D589D008A0413 /* ZSSRichTextEditor.js in Resources */, 251 | 188CF7DC210D582E008A0413 /* Assets.xcassets in Resources */, 252 | 188CF7F2210D589D008A0413 /* jQuery.js in Resources */, 253 | 188CF7DA210D582C008A0413 /* Main.storyboard in Resources */, 254 | ); 255 | runOnlyForDeploymentPostprocessing = 0; 256 | }; 257 | /* End PBXResourcesBuildPhase section */ 258 | 259 | /* Begin PBXSourcesBuildPhase section */ 260 | 188CF7CB210D582C008A0413 /* Sources */ = { 261 | isa = PBXSourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | 188CF805210D5D8E008A0413 /* UIView+Extension.m in Sources */, 265 | 188CF7FD210D59BB008A0413 /* ContentEditFooterView.m in Sources */, 266 | 188CF7D7210D582C008A0413 /* ViewController.m in Sources */, 267 | 188CF808210D5FBC008A0413 /* UIColor+Extension.m in Sources */, 268 | 188CF7E2210D582E008A0413 /* main.m in Sources */, 269 | 188CF7FA210D5988008A0413 /* ERichTextEditorView.m in Sources */, 270 | 188CF7D4210D582C008A0413 /* AppDelegate.m in Sources */, 271 | ); 272 | runOnlyForDeploymentPostprocessing = 0; 273 | }; 274 | /* End PBXSourcesBuildPhase section */ 275 | 276 | /* Begin PBXVariantGroup section */ 277 | 188CF7D8210D582C008A0413 /* Main.storyboard */ = { 278 | isa = PBXVariantGroup; 279 | children = ( 280 | 188CF7D9210D582C008A0413 /* Base */, 281 | ); 282 | name = Main.storyboard; 283 | sourceTree = ""; 284 | }; 285 | 188CF7DD210D582E008A0413 /* LaunchScreen.storyboard */ = { 286 | isa = PBXVariantGroup; 287 | children = ( 288 | 188CF7DE210D582E008A0413 /* Base */, 289 | ); 290 | name = LaunchScreen.storyboard; 291 | sourceTree = ""; 292 | }; 293 | /* End PBXVariantGroup section */ 294 | 295 | /* Begin XCBuildConfiguration section */ 296 | 188CF7E3210D582E008A0413 /* Debug */ = { 297 | isa = XCBuildConfiguration; 298 | buildSettings = { 299 | ALWAYS_SEARCH_USER_PATHS = NO; 300 | CLANG_ANALYZER_NONNULL = YES; 301 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 302 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 303 | CLANG_CXX_LIBRARY = "libc++"; 304 | CLANG_ENABLE_MODULES = YES; 305 | CLANG_ENABLE_OBJC_ARC = YES; 306 | CLANG_ENABLE_OBJC_WEAK = YES; 307 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 308 | CLANG_WARN_BOOL_CONVERSION = YES; 309 | CLANG_WARN_COMMA = YES; 310 | CLANG_WARN_CONSTANT_CONVERSION = YES; 311 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 312 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 313 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 314 | CLANG_WARN_EMPTY_BODY = YES; 315 | CLANG_WARN_ENUM_CONVERSION = YES; 316 | CLANG_WARN_INFINITE_RECURSION = YES; 317 | CLANG_WARN_INT_CONVERSION = YES; 318 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 319 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 320 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 321 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 322 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 323 | CLANG_WARN_STRICT_PROTOTYPES = YES; 324 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 325 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 326 | CLANG_WARN_UNREACHABLE_CODE = YES; 327 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 328 | CODE_SIGN_IDENTITY = "iPhone Developer"; 329 | COPY_PHASE_STRIP = NO; 330 | DEBUG_INFORMATION_FORMAT = dwarf; 331 | ENABLE_STRICT_OBJC_MSGSEND = YES; 332 | ENABLE_TESTABILITY = YES; 333 | GCC_C_LANGUAGE_STANDARD = gnu11; 334 | GCC_DYNAMIC_NO_PIC = NO; 335 | GCC_NO_COMMON_BLOCKS = YES; 336 | GCC_OPTIMIZATION_LEVEL = 0; 337 | GCC_PREPROCESSOR_DEFINITIONS = ( 338 | "DEBUG=1", 339 | "$(inherited)", 340 | ); 341 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 342 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 343 | GCC_WARN_UNDECLARED_SELECTOR = YES; 344 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 345 | GCC_WARN_UNUSED_FUNCTION = YES; 346 | GCC_WARN_UNUSED_VARIABLE = YES; 347 | IPHONEOS_DEPLOYMENT_TARGET = 11.4; 348 | MTL_ENABLE_DEBUG_INFO = YES; 349 | ONLY_ACTIVE_ARCH = YES; 350 | SDKROOT = iphoneos; 351 | }; 352 | name = Debug; 353 | }; 354 | 188CF7E4210D582E008A0413 /* Release */ = { 355 | isa = XCBuildConfiguration; 356 | buildSettings = { 357 | ALWAYS_SEARCH_USER_PATHS = NO; 358 | CLANG_ANALYZER_NONNULL = YES; 359 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 360 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 361 | CLANG_CXX_LIBRARY = "libc++"; 362 | CLANG_ENABLE_MODULES = YES; 363 | CLANG_ENABLE_OBJC_ARC = YES; 364 | CLANG_ENABLE_OBJC_WEAK = YES; 365 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 366 | CLANG_WARN_BOOL_CONVERSION = YES; 367 | CLANG_WARN_COMMA = YES; 368 | CLANG_WARN_CONSTANT_CONVERSION = YES; 369 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 370 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 371 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 372 | CLANG_WARN_EMPTY_BODY = YES; 373 | CLANG_WARN_ENUM_CONVERSION = YES; 374 | CLANG_WARN_INFINITE_RECURSION = YES; 375 | CLANG_WARN_INT_CONVERSION = YES; 376 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 377 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 378 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 379 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 380 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 381 | CLANG_WARN_STRICT_PROTOTYPES = YES; 382 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 383 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 384 | CLANG_WARN_UNREACHABLE_CODE = YES; 385 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 386 | CODE_SIGN_IDENTITY = "iPhone Developer"; 387 | COPY_PHASE_STRIP = NO; 388 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 389 | ENABLE_NS_ASSERTIONS = NO; 390 | ENABLE_STRICT_OBJC_MSGSEND = YES; 391 | GCC_C_LANGUAGE_STANDARD = gnu11; 392 | GCC_NO_COMMON_BLOCKS = YES; 393 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 394 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 395 | GCC_WARN_UNDECLARED_SELECTOR = YES; 396 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 397 | GCC_WARN_UNUSED_FUNCTION = YES; 398 | GCC_WARN_UNUSED_VARIABLE = YES; 399 | IPHONEOS_DEPLOYMENT_TARGET = 11.4; 400 | MTL_ENABLE_DEBUG_INFO = NO; 401 | SDKROOT = iphoneos; 402 | VALIDATE_PRODUCT = YES; 403 | }; 404 | name = Release; 405 | }; 406 | 188CF7E6210D582E008A0413 /* Debug */ = { 407 | isa = XCBuildConfiguration; 408 | buildSettings = { 409 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 410 | CODE_SIGN_STYLE = Automatic; 411 | GCC_PREFIX_HEADER = ERichTextEditor/Classes/Global/PrefixHeader.pch; 412 | INFOPLIST_FILE = "$(SRCROOT)/ERichTextEditor/Supporting Files/Info.plist"; 413 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 414 | LD_RUNPATH_SEARCH_PATHS = ( 415 | "$(inherited)", 416 | "@executable_path/Frameworks", 417 | ); 418 | PRODUCT_BUNDLE_IDENTIFIER = com.eleven.ERichTextEditor; 419 | PRODUCT_NAME = "$(TARGET_NAME)"; 420 | TARGETED_DEVICE_FAMILY = "1,2"; 421 | }; 422 | name = Debug; 423 | }; 424 | 188CF7E7210D582E008A0413 /* Release */ = { 425 | isa = XCBuildConfiguration; 426 | buildSettings = { 427 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 428 | CODE_SIGN_STYLE = Automatic; 429 | GCC_PREFIX_HEADER = ERichTextEditor/Classes/Global/PrefixHeader.pch; 430 | INFOPLIST_FILE = "$(SRCROOT)/ERichTextEditor/Supporting Files/Info.plist"; 431 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 432 | LD_RUNPATH_SEARCH_PATHS = ( 433 | "$(inherited)", 434 | "@executable_path/Frameworks", 435 | ); 436 | PRODUCT_BUNDLE_IDENTIFIER = com.eleven.ERichTextEditor; 437 | PRODUCT_NAME = "$(TARGET_NAME)"; 438 | TARGETED_DEVICE_FAMILY = "1,2"; 439 | }; 440 | name = Release; 441 | }; 442 | /* End XCBuildConfiguration section */ 443 | 444 | /* Begin XCConfigurationList section */ 445 | 188CF7CA210D582C008A0413 /* Build configuration list for PBXProject "ERichTextEditor" */ = { 446 | isa = XCConfigurationList; 447 | buildConfigurations = ( 448 | 188CF7E3210D582E008A0413 /* Debug */, 449 | 188CF7E4210D582E008A0413 /* Release */, 450 | ); 451 | defaultConfigurationIsVisible = 0; 452 | defaultConfigurationName = Release; 453 | }; 454 | 188CF7E5210D582E008A0413 /* Build configuration list for PBXNativeTarget "ERichTextEditor" */ = { 455 | isa = XCConfigurationList; 456 | buildConfigurations = ( 457 | 188CF7E6210D582E008A0413 /* Debug */, 458 | 188CF7E7210D582E008A0413 /* Release */, 459 | ); 460 | defaultConfigurationIsVisible = 0; 461 | defaultConfigurationName = Release; 462 | }; 463 | /* End XCConfigurationList section */ 464 | }; 465 | rootObject = 188CF7C7210D582C008A0413 /* Project object */; 466 | } 467 | -------------------------------------------------------------------------------- /ERichTextEditor.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ERichTextEditor.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ERichTextEditor.xcodeproj/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /ERichTextEditor.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ERichTextEditor.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ERichTextEditor.xcodeproj/xcuserdata/eleven.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /ERichTextEditor.xcodeproj/xcuserdata/eleven.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ERichTextEditor.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | ERichTextEditor.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /ERichTextEditor/Classes/Controller/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // ERichTextEditor 4 | // 5 | // Created by Eleven on 2018/7/29. 6 | // Copyright © 2018年 Eleven. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /ERichTextEditor/Classes/Controller/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // ERichTextEditor 4 | // 5 | // Created by Eleven on 2018/7/29. 6 | // Copyright © 2018年 Eleven. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "ERichTextEditorView.h" 11 | #import "ContentEditFooterView.h" 12 | 13 | static CGFloat kFooterHeight = 44.f; 14 | 15 | @interface ViewController () 16 | 17 | @property (nonatomic, strong) ERichTextEditorView *editorView; 18 | @property (nonatomic, strong) ContentEditFooterView *footerView; 19 | 20 | @end 21 | 22 | @implementation ViewController 23 | 24 | #pragma mark - life cycle 25 | - (void)viewDidLoad { 26 | [super viewDidLoad]; 27 | // Do any additional setup after loading the view, typically from a nib. 28 | 29 | self.title = @"图文编辑"; 30 | [self.view addSubview:self.editorView]; 31 | [self.view addSubview:self.footerView]; 32 | 33 | UIBarButtonItem *leftBarItem = [[UIBarButtonItem alloc] initWithTitle:@"加载HTML" style:UIBarButtonItemStylePlain target:self action:@selector(leftClick)]; 34 | self.navigationItem.leftBarButtonItem = leftBarItem; 35 | 36 | UIBarButtonItem *rightBarItem = [[UIBarButtonItem alloc] initWithTitle:@"导出HTML" style:UIBarButtonItemStylePlain target:self action:@selector(rightClick)]; 37 | self.navigationItem.rightBarButtonItem = rightBarItem; 38 | 39 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; 40 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; 41 | } 42 | 43 | - (void)dealloc { 44 | [[NSNotificationCenter defaultCenter]removeObserver:self]; 45 | } 46 | 47 | #pragma mark - notification 48 | - (void)keyboardWillShow:(NSNotification*)notification { 49 | NSDictionary *info = [notification userInfo]; 50 | CGSize size = [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size; 51 | self.footerView.y = SCREEN_HEIGHT - size.height - self.footerView.height; 52 | 53 | [self.editorView setContentHeight:SCREEN_HEIGHT - STATUS_AND_NAVIGATION_HEIGHT - TAB_BAR_SAFE_BOTTOM_MARGIN - kFooterHeight - size.height]; 54 | } 55 | 56 | - (void)keyboardWillHide:(NSNotification*)notification { 57 | self.footerView.y = SCREEN_HEIGHT - TAB_BAR_SAFE_BOTTOM_MARGIN - self.footerView.height; 58 | 59 | [self.editorView setContentHeight:SCREEN_HEIGHT - STATUS_AND_NAVIGATION_HEIGHT - TAB_BAR_SAFE_BOTTOM_MARGIN - kFooterHeight]; 60 | } 61 | 62 | #pragma mark - event response 63 | - (void)leftClick { 64 | // 此处可加载导出的HTML 65 | [self.editorView preloadedWithHTML:@"测试abc"]; 66 | } 67 | 68 | - (void)rightClick { 69 | NSString *htmlStr = [self.editorView getHTML]; 70 | NSLog(@"\n=====\n%@\n=====", htmlStr); 71 | } 72 | 73 | #pragma mark - getter 74 | - (ERichTextEditorView *)editorView { 75 | if (!_editorView) { 76 | _editorView = [[ERichTextEditorView alloc] initWithFrame:CGRectMake(0, STATUS_AND_NAVIGATION_HEIGHT, SCREEN_WIDTH, SCREEN_HEIGHT - STATUS_AND_NAVIGATION_HEIGHT - TAB_BAR_SAFE_BOTTOM_MARGIN - kFooterHeight)]; 77 | _editorView.backgroundColor = [UIColor cyanColor]; 78 | } 79 | return _editorView; 80 | } 81 | 82 | - (ContentEditFooterView *)footerView { 83 | if (!_footerView) { 84 | _footerView = [[ContentEditFooterView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT - TAB_BAR_SAFE_BOTTOM_MARGIN - kFooterHeight, SCREEN_WIDTH, kFooterHeight) editView:self.editorView]; 85 | @weakify(self); 86 | _footerView.pictureBlock = ^{ 87 | @strongify(self); 88 | [self.editorView recordCursorPosition]; 89 | 90 | // 以下为测试代码,若从本地选择图片,请先传给后端拿到url,再依照以下步骤进行调用 91 | NSArray *imgUrls = @[ 92 | @"http://img.i.cacf.cn/thread/1803/21/252d6546e6224c8b694a8d1918e62410.jpg", 93 | @"http://img.i.cacf.cn/thread/1803/21/1f061a159effab856007bb5e8466ad96.jpg", 94 | @"http://img1.imgtn.bdimg.com/it/u=397740769,1564679694&fm=200&gp=0.jpg", 95 | @"http://img0.imgtn.bdimg.com/it/u=4119238346,1821169886&fm=27&gp=0.jpg", 96 | @"http://img5.imgtn.bdimg.com/it/u=1858283759,2806224052&fm=200&gp=0.jpg", 97 | @"http://img0.imgtn.bdimg.com/it/u=2711668609,3709801299&fm=200&gp=0.jpg", 98 | @"http://img5.imgtn.bdimg.com/it/u=2239397734,1608218617&fm=27&gp=0.jpg" 99 | ]; 100 | for (NSInteger i = imgUrls.count - 1; i >= 0; i --) { 101 | [self.editorView insertImage:imgUrls[i]]; 102 | } 103 | }; 104 | _footerView.tagBlock = ^{ 105 | }; 106 | 107 | } 108 | return _footerView; 109 | } 110 | 111 | 112 | @end 113 | -------------------------------------------------------------------------------- /ERichTextEditor/Classes/Global/Eleven.h: -------------------------------------------------------------------------------- 1 | // 2 | // Eleven.h 3 | // Krom 4 | // 5 | // Created by Eleven on 2018/4/29. 6 | // Copyright © 2018年 QW. All rights reserved. 7 | // 8 | 9 | #ifndef Eleven_h 10 | #define Eleven_h 11 | 12 | ///////////////////////////////////////////////////////////////////////////////// 13 | 14 | // 判断是否iPhone X 15 | #define IS_iPhoneX (CGSizeEqualToSize(CGSizeMake(375.f, 812.f), [UIScreen mainScreen].bounds.size) || CGSizeEqualToSize(CGSizeMake(812.f, 375.f), [UIScreen mainScreen].bounds.size) || CGSizeEqualToSize(CGSizeMake(414.f, 896.f), [UIScreen mainScreen].bounds.size) || CGSizeEqualToSize(CGSizeMake(896.f, 414.f), [UIScreen mainScreen].bounds.size)) 16 | 17 | // status bar height. 18 | #define STATUS_BAR_HEIGHT (IS_iPhoneX ? 44.f : 20.f) 19 | 20 | // Navigation bar height. 21 | #define NAVIGATION_BAR_HEIGHT 44.f 22 | 23 | // Status bar & navigation bar height. 24 | #define STATUS_AND_NAVIGATION_HEIGHT (IS_iPhoneX ? 88.f : 64.f) 25 | 26 | // Tabbar height. 27 | #define TAB_BAR_HEIGHT (IS_iPhoneX ? (49.f + 34.f) : 49.f) 28 | 29 | // Tabbar safe bottom margin. 30 | #define TAB_BAR_SAFE_BOTTOM_MARGIN (IS_iPhoneX ? 34.f : 0.f) 31 | 32 | ///////////////////////////////////////////////////////////////////////////////// 33 | /// 获取屏幕宽度 34 | static inline CGFloat _getScreenWidth () { 35 | static CGFloat _screenWidth = 0; 36 | if (_screenWidth > 0) return _screenWidth; 37 | _screenWidth = CGRectGetWidth([UIScreen mainScreen].bounds); 38 | return _screenWidth; 39 | } 40 | 41 | /// 获取屏幕高度 42 | static inline CGFloat _getScreenHeight () { 43 | static CGFloat _screenHeight = 0; 44 | if (_screenHeight > 0) return _screenHeight; 45 | _screenHeight = CGRectGetHeight([UIScreen mainScreen].bounds); 46 | return _screenHeight; 47 | } 48 | 49 | #define SCREEN_HEIGHT _getScreenHeight() 50 | #define SCREEN_WIDTH _getScreenWidth() 51 | #define HALF_SCREEN_HEIGHT _getScreenHeight() * 0.5 52 | #define HALF_SCREEN_WIDTH _getScreenWidth() * 0.5 53 | 54 | ///////////////////////////////////////////////////////////////////////////////// 55 | 56 | #define HexColorInt32_t(rgbValue) \ 57 | [UIColor colorWithRed:((float)((0x##rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((0x##rgbValue & 0x00FF00) >> 8))/255.0 blue:((float)(0x##rgbValue & 0x0000FF))/255.0 alpha:1] 58 | 59 | #define HexColor(hexString) [UIColor hexColor:(hexString)] 60 | 61 | #define EImageNamed(url) [UIImage imageNamed:url] 62 | 63 | ///////////////////////////////////////////////////////////////////////////////// 64 | /// 安全运行block 65 | #define BLOCK_SAFE_RUN(block, ...) block ? block(__VA_ARGS__) : nil; 66 | 67 | #ifndef weakify 68 | 69 | #if DEBUG 70 | 71 | #if __has_feature(objc_arc) 72 | 73 | #define weakify(object) autoreleasepool{} __weak __typeof__(object) weak##_##object = object; 74 | 75 | #else 76 | 77 | #define weakify(object) autoreleasepool{} __block __typeof__(object) block##_##object = object; 78 | 79 | #endif 80 | 81 | #else 82 | 83 | #if __has_feature(objc_arc) 84 | 85 | #define weakify(object) try{} @finally{} {} __weak __typeof__(object) weak##_##object = object; 86 | 87 | #else 88 | 89 | #define weakify(object) try{} @finally{} {} __block __typeof__(object) block##_##object = object; 90 | 91 | #endif 92 | 93 | #endif 94 | 95 | #endif 96 | 97 | 98 | 99 | #ifndef strongify 100 | 101 | #if DEBUG 102 | 103 | #if __has_feature(objc_arc) 104 | 105 | #define strongify(object) autoreleasepool{} __typeof__(object) object = weak##_##object; 106 | 107 | #else 108 | 109 | #define strongify(object) autoreleasepool{} __typeof__(object) object = block##_##object; 110 | 111 | #endif 112 | 113 | #else 114 | 115 | #if __has_feature(objc_arc) 116 | 117 | #define strongify(object) try{} @finally{} __typeof__(object) object = weak##_##object; 118 | 119 | #else 120 | 121 | #define strongify(object) try{} @finally{} __typeof__(object) object = block##_##object; 122 | 123 | #endif 124 | 125 | #endif 126 | 127 | #endif 128 | 129 | 130 | #endif /* Eleven_h */ 131 | -------------------------------------------------------------------------------- /ERichTextEditor/Classes/Global/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // ERichTextEditor 4 | // 5 | // Created by Eleven on 2018/7/29. 6 | // Copyright © 2018年 Eleven. All rights reserved. 7 | // 8 | 9 | #ifndef PrefixHeader_pch 10 | #define PrefixHeader_pch 11 | 12 | #ifdef __OBJC__ 13 | 14 | #import 15 | #import "Eleven.h" 16 | #import "UIView+Extension.h" 17 | #import "UIColor+Extension.h" 18 | 19 | #endif 20 | 21 | #endif /* PrefixHeader_pch */ 22 | -------------------------------------------------------------------------------- /ERichTextEditor/Classes/Library/Category/UIColor+Extension.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Extension.h 3 | // ERichTextEditor 4 | // 5 | // Created by Eleven on 2018/7/29. 6 | // Copyright © 2018年 Eleven. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (Extension) 12 | 13 | + (UIColor *)hexColor:(NSString *)hex; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ERichTextEditor/Classes/Library/Category/UIColor+Extension.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Extension.m 3 | // ERichTextEditor 4 | // 5 | // Created by Eleven on 2018/7/29. 6 | // Copyright © 2018年 Eleven. All rights reserved. 7 | // 8 | 9 | #import "UIColor+Extension.h" 10 | 11 | @implementation UIColor (Extension) 12 | 13 | + (UIColor *)hexColor:(NSString *)hex { 14 | 15 | // Remove `#` and `0x` 16 | if ([hex hasPrefix:@"#"]) { 17 | hex = [hex substringFromIndex:1]; 18 | } else if ([hex hasPrefix:@"0x"]) { 19 | hex = [hex substringFromIndex:2]; 20 | } 21 | // Invalid if not 3, 6, or 8 characters 22 | NSUInteger length = [hex length]; 23 | if (length != 3 && length != 6 && length != 8) { 24 | return nil; 25 | } 26 | // Make the string 8 characters long for easier parsing 27 | if (length == 3) { 28 | NSString *r = [hex substringWithRange:NSMakeRange(0, 1)]; 29 | NSString *g = [hex substringWithRange:NSMakeRange(1, 1)]; 30 | NSString *b = [hex substringWithRange:NSMakeRange(2, 1)]; 31 | hex = [NSString stringWithFormat:@"%@%@%@%@%@%@ff", 32 | r, r, g, g, b, b]; 33 | } else if (length == 6) { 34 | hex = [hex stringByAppendingString:@"ff"]; 35 | } 36 | //分别取RGB的值 37 | NSRange range; 38 | range.length = 2; 39 | range.location = 0; 40 | NSString *rString = [hex substringWithRange:range]; 41 | range.location = 2; 42 | NSString *gString = [hex substringWithRange:range]; 43 | range.location = 4; 44 | NSString *bString = [hex substringWithRange:range]; 45 | range.location = 6; 46 | NSString *aString = [hex substringWithRange:range]; 47 | unsigned int r, g, b, a; 48 | //NSScanner把扫描出的制定的字符串转换成Int类型 49 | [[NSScanner scannerWithString:rString] scanHexInt:&r]; 50 | [[NSScanner scannerWithString:gString] scanHexInt:&g]; 51 | [[NSScanner scannerWithString:bString] scanHexInt:&b]; 52 | [[NSScanner scannerWithString:aString] scanHexInt:&a]; 53 | //转换为UIColor 54 | float red = (float) r / 255.0f; 55 | float green = (float) g / 255.0f; 56 | float blue = (float) b / 255.0f; 57 | float alpha = (float) a / 255.0f; 58 | return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /ERichTextEditor/Classes/Library/Category/UIView+Extension.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Extension.h 3 | // ERichTextEditor 4 | // 5 | // Created by Eleven on 2018/7/29. 6 | // Copyright © 2018年 Eleven. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (Extension) 12 | 13 | @property (nonatomic, assign) CGFloat x; 14 | @property (nonatomic, assign) CGFloat y; 15 | @property (nonatomic, assign) CGFloat height; 16 | @property (nonatomic, assign) CGFloat width; 17 | @property (nonatomic, assign) CGSize size; 18 | @property (nonatomic, assign) CGPoint origin; 19 | @property (nonatomic, assign) CGFloat centerX; 20 | @property (nonatomic, assign) CGFloat centerY; 21 | 22 | @property (nonatomic, assign, readonly) CGFloat halfHeight; 23 | @property (nonatomic, assign, readonly) CGFloat halfWidth; 24 | @property (nonatomic, assign) IBInspectable CGFloat cornerRadius; 25 | 26 | /** 最大 X */ 27 | @property (nonatomic, assign) CGFloat maxX; 28 | /** 最大 Y */ 29 | @property (nonatomic, assign) CGFloat maxY; 30 | /// 同时设置 maxX 和 maxY 31 | @property (nonatomic, assign) CGPoint maxOrigin; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /ERichTextEditor/Classes/Library/Category/UIView+Extension.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Extension.m 3 | // ERichTextEditor 4 | // 5 | // Created by Eleven on 2018/7/29. 6 | // Copyright © 2018年 Eleven. All rights reserved. 7 | // 8 | 9 | #import "UIView+Extension.h" 10 | #import 11 | 12 | 13 | @implementation UIView (Extension) 14 | 15 | - (void)setX:(CGFloat)x { 16 | CGRect frame = self.frame; 17 | frame.origin.x = x; 18 | self.frame = frame; 19 | } 20 | 21 | -(CGFloat)x { 22 | return self.frame.origin.x; 23 | } 24 | 25 | - (void)setY:(CGFloat)y { 26 | CGRect frame = self.frame; 27 | frame.origin.y = y; 28 | self.frame = frame; 29 | } 30 | 31 | - (CGFloat)y { 32 | return self.frame.origin.y; 33 | } 34 | 35 | - (void)setWidth:(CGFloat)width { 36 | CGRect frame = self.frame; 37 | frame.size.width = width; 38 | self.frame = frame; 39 | } 40 | 41 | - (CGFloat)width { 42 | return self.frame.size.width; 43 | } 44 | 45 | - (void)setHeight:(CGFloat)height { 46 | CGRect frame = self.frame; 47 | frame.size.height = height; 48 | self.frame = frame; 49 | } 50 | 51 | - (CGFloat)height { 52 | return self.frame.size.height; 53 | } 54 | - (void)setSize:(CGSize)size { 55 | CGRect frame = self.frame; 56 | frame.size = size; 57 | self.frame = frame; 58 | } 59 | - (CGSize)size { 60 | return self.frame.size; 61 | } 62 | 63 | - (void)setOrigin:(CGPoint)origin { 64 | CGRect frame = self.frame; 65 | frame.origin = origin; 66 | self.frame = frame; 67 | } 68 | - (CGPoint)origin { 69 | return self.frame.origin; 70 | } 71 | 72 | - (CGFloat)halfWidth { 73 | return CGRectGetWidth(self.frame) * 0.5; 74 | } 75 | 76 | - (CGFloat)halfHeight { 77 | return CGRectGetHeight(self.frame) * 0.5; 78 | } 79 | 80 | - (CGFloat)cornerRadius { 81 | return self.layer.cornerRadius; 82 | } 83 | 84 | 85 | - (void)setCornerRadius:(CGFloat)cornerRadius { 86 | self.layer.cornerRadius = cornerRadius; 87 | self.layer.masksToBounds = YES; 88 | } 89 | 90 | - (void)setCornerRadius:(CGFloat)cornerRadius rounding:(UIRectCorner)rounding { 91 | 92 | CAShapeLayer * layer = [CAShapeLayer layer]; 93 | UIBezierPath * path = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:rounding cornerRadii:CGSizeMake(cornerRadius, cornerRadius)]; 94 | layer.path = path.CGPath; 95 | self.layer.mask = layer; 96 | } 97 | 98 | - (CGFloat)centerX { 99 | return self.center.x; 100 | } 101 | 102 | - (void)setCenterX:(CGFloat)centerX { 103 | CGPoint center = self.center; 104 | center.x = centerX; 105 | self.center = center; 106 | } 107 | - (CGFloat)centerY { 108 | return self.center.y; 109 | } 110 | 111 | - (void)setCenterY:(CGFloat)centerY { 112 | CGPoint center = self.center; 113 | center.y = centerY; 114 | self.center = center; 115 | } 116 | 117 | - (CGFloat)maxX { 118 | return CGRectGetMaxX(self.frame); 119 | } 120 | - (void)setMaxX:(CGFloat)maxX { 121 | self.x = maxX - CGRectGetWidth(self.frame); 122 | } 123 | 124 | - (CGFloat)maxY { 125 | return CGRectGetMaxY(self.frame); 126 | } 127 | - (void)setMaxY:(CGFloat)maxY { 128 | self.y = maxY - CGRectGetHeight(self.frame); 129 | } 130 | 131 | - (void)setMaxOrigin:(CGPoint)maxOrigin { 132 | CGRect frame = self.frame; 133 | frame.origin = CGPointMake(maxOrigin.x - CGRectGetWidth(self.frame), maxOrigin.y - CGRectGetHeight(self.frame)); 134 | self.frame = frame; 135 | } 136 | 137 | - (CGPoint)maxOrigin { 138 | return CGPointMake(CGRectGetMaxX(self.frame), CGRectGetMaxY(self.frame)); 139 | } 140 | 141 | @end 142 | -------------------------------------------------------------------------------- /ERichTextEditor/Classes/Library/ThirdPart/ContentEditSource/JSBeautifier.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | The MIT License (MIT) 4 | 5 | Copyright (c) 2007-2013 Einar Lielmanis and contributors. 6 | 7 | Permission is hereby granted, free of charge, to any person 8 | obtaining a copy of this software and associated documentation files 9 | (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, 11 | publish, distribute, sublicense, and/or sell copies of the Software, 12 | and to permit persons to whom the Software is furnished to do so, 13 | subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 22 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 23 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 24 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | 27 | JS Beautifier 28 | --------------- 29 | 30 | */ 31 | 32 | function trim(s) { 33 | return s.replace(/^\s+|\s+$/g, ''); 34 | } 35 | 36 | function ltrim(s) { 37 | return s.replace(/^\s+/g, ''); 38 | } 39 | 40 | function style_html(html_source, options) { 41 | //Wrapper function to invoke all the necessary constructors and deal with the output. 42 | 43 | var multi_parser, 44 | indent_inner_html, 45 | indent_size, 46 | indent_character, 47 | wrap_line_length, 48 | brace_style, 49 | unformatted, 50 | preserve_newlines, 51 | max_preserve_newlines; 52 | 53 | options = options || {}; 54 | 55 | // backwards compatibility to 1.3.4 56 | if ((options.wrap_line_length === undefined || parseInt(options.wrap_line_length, 10) === 0) && 57 | (options.max_char === undefined || parseInt(options.max_char, 10) === 0)) { 58 | options.wrap_line_length = options.max_char; 59 | } 60 | 61 | indent_inner_html = options.indent_inner_html || false; 62 | indent_size = parseInt(options.indent_size || 4, 10); 63 | indent_character = options.indent_char || ' '; 64 | brace_style = options.brace_style || 'collapse'; 65 | wrap_line_length = parseInt(options.wrap_line_length, 10) === 0 ? 32786 : parseInt(options.wrap_line_length || 250, 10); 66 | unformatted = options.unformatted || ['a', 'span', 'bdo', 'em', 'strong', 'dfn', 'code', 'samp', 'kbd', 'var', 'cite', 'abbr', 'acronym', 'q', 'sub', 'sup', 'tt', 'i', 'b', 'big', 'small', 'u', 's', 'strike', 'font', 'ins', 'del', 'pre', 'address', 'dt', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6']; 67 | preserve_newlines = options.preserve_newlines || true; 68 | max_preserve_newlines = preserve_newlines ? parseInt(options.max_preserve_newlines || 32786, 10) : 0; 69 | indent_handlebars = options.indent_handlebars || false; 70 | 71 | function Parser() { 72 | 73 | this.pos = 0; //Parser position 74 | this.token = ''; 75 | this.current_mode = 'CONTENT'; //reflects the current Parser mode: TAG/CONTENT 76 | this.tags = { //An object to hold tags, their position, and their parent-tags, initiated with default values 77 | parent: 'parent1', 78 | parentcount: 1, 79 | parent1: '' 80 | }; 81 | this.tag_type = ''; 82 | this.token_text = this.last_token = this.last_text = this.token_type = ''; 83 | this.newlines = 0; 84 | this.indent_content = indent_inner_html; 85 | 86 | this.Utils = { //Uilities made available to the various functions 87 | whitespace: "\n\r\t ".split(''), 88 | single_token: 'br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed,?php,?,?='.split(','), //all the single tags for HTML 89 | extra_liners: 'head,body,/html'.split(','), //for tags that need a line of whitespace before them 90 | in_array: function(what, arr) { 91 | for (var i = 0; i < arr.length; i++) { 92 | if (what === arr[i]) { 93 | return true; 94 | } 95 | } 96 | return false; 97 | } 98 | }; 99 | 100 | this.traverse_whitespace = function() { 101 | var input_char = ''; 102 | 103 | input_char = this.input.charAt(this.pos); 104 | if (this.Utils.in_array(input_char, this.Utils.whitespace)) { 105 | this.newlines = 0; 106 | while (this.Utils.in_array(input_char, this.Utils.whitespace)) { 107 | if (preserve_newlines && input_char === '\n' && this.newlines <= max_preserve_newlines) { 108 | this.newlines += 1; 109 | } 110 | 111 | this.pos++; 112 | input_char = this.input.charAt(this.pos); 113 | } 114 | return true; 115 | } 116 | return false; 117 | }; 118 | 119 | this.get_content = function() { //function to capture regular content between tags 120 | 121 | var input_char = '', 122 | content = [], 123 | space = false; //if a space is needed 124 | 125 | while (this.input.charAt(this.pos) !== '<') { 126 | if (this.pos >= this.input.length) { 127 | return content.length ? content.join('') : ['', 'TK_EOF']; 128 | } 129 | 130 | if (this.traverse_whitespace()) { 131 | if (content.length) { 132 | space = true; 133 | } 134 | continue; //don't want to insert unnecessary space 135 | } 136 | 137 | if (indent_handlebars) { 138 | // Handlebars parsing is complicated. 139 | // {{#foo}} and {{/foo}} are formatted tags. 140 | // {{something}} should get treated as content, except: 141 | // {{else}} specifically behaves like {{#if}} and {{/if}} 142 | var peek3 = this.input.substr(this.pos, 3); 143 | if (peek3 === '{{#' || peek3 === '{{/') { 144 | // These are tags and not content. 145 | break; 146 | } else if (this.input.substr(this.pos, 2) === '{{') { 147 | if (this.get_tag(true) === '{{else}}') { 148 | break; 149 | } 150 | } 151 | } 152 | 153 | input_char = this.input.charAt(this.pos); 154 | this.pos++; 155 | 156 | if (space) { 157 | if (this.line_char_count >= this.wrap_line_length) { //insert a line when the wrap_line_length is reached 158 | this.print_newline(false, content); 159 | this.print_indentation(content); 160 | } else { 161 | this.line_char_count++; 162 | content.push(' '); 163 | } 164 | space = false; 165 | } 166 | this.line_char_count++; 167 | content.push(input_char); //letter at-a-time (or string) inserted to an array 168 | } 169 | return content.length ? content.join('') : ''; 170 | }; 171 | 172 | this.get_contents_to = function(name) { //get the full content of a script or style to pass to js_beautify 173 | if (this.pos === this.input.length) { 174 | return ['', 'TK_EOF']; 175 | } 176 | var input_char = ''; 177 | var content = ''; 178 | var reg_match = new RegExp('', 'igm'); 179 | reg_match.lastIndex = this.pos; 180 | var reg_array = reg_match.exec(this.input); 181 | var end_script = reg_array ? reg_array.index : this.input.length; //absolute end of script 182 | if (this.pos < end_script) { //get everything in between the script tags 183 | content = this.input.substring(this.pos, end_script); 184 | this.pos = end_script; 185 | } 186 | return content; 187 | }; 188 | 189 | this.record_tag = function(tag) { //function to record a tag and its parent in this.tags Object 190 | if (this.tags[tag + 'count']) { //check for the existence of this tag type 191 | this.tags[tag + 'count']++; 192 | this.tags[tag + this.tags[tag + 'count']] = this.indent_level; //and record the present indent level 193 | } else { //otherwise initialize this tag type 194 | this.tags[tag + 'count'] = 1; 195 | this.tags[tag + this.tags[tag + 'count']] = this.indent_level; //and record the present indent level 196 | } 197 | this.tags[tag + this.tags[tag + 'count'] + 'parent'] = this.tags.parent; //set the parent (i.e. in the case of a div this.tags.div1parent) 198 | this.tags.parent = tag + this.tags[tag + 'count']; //and make this the current parent (i.e. in the case of a div 'div1') 199 | }; 200 | 201 | this.retrieve_tag = function(tag) { //function to retrieve the opening tag to the corresponding closer 202 | if (this.tags[tag + 'count']) { //if the openener is not in the Object we ignore it 203 | var temp_parent = this.tags.parent; //check to see if it's a closable tag. 204 | while (temp_parent) { //till we reach '' (the initial value); 205 | if (tag + this.tags[tag + 'count'] === temp_parent) { //if this is it use it 206 | break; 207 | } 208 | temp_parent = this.tags[temp_parent + 'parent']; //otherwise keep on climbing up the DOM Tree 209 | } 210 | if (temp_parent) { //if we caught something 211 | this.indent_level = this.tags[tag + this.tags[tag + 'count']]; //set the indent_level accordingly 212 | this.tags.parent = this.tags[temp_parent + 'parent']; //and set the current parent 213 | } 214 | delete this.tags[tag + this.tags[tag + 'count'] + 'parent']; //delete the closed tags parent reference... 215 | delete this.tags[tag + this.tags[tag + 'count']]; //...and the tag itself 216 | if (this.tags[tag + 'count'] === 1) { 217 | delete this.tags[tag + 'count']; 218 | } else { 219 | this.tags[tag + 'count']--; 220 | } 221 | } 222 | }; 223 | 224 | this.indent_to_tag = function(tag) { 225 | // Match the indentation level to the last use of this tag, but don't remove it. 226 | if (!this.tags[tag + 'count']) { 227 | return; 228 | } 229 | var temp_parent = this.tags.parent; 230 | while (temp_parent) { 231 | if (tag + this.tags[tag + 'count'] === temp_parent) { 232 | break; 233 | } 234 | temp_parent = this.tags[temp_parent + 'parent']; 235 | } 236 | if (temp_parent) { 237 | this.indent_level = this.tags[tag + this.tags[tag + 'count']]; 238 | } 239 | }; 240 | 241 | this.get_tag = function(peek) { //function to get a full tag and parse its type 242 | var input_char = '', 243 | content = [], 244 | comment = '', 245 | space = false, 246 | tag_start, tag_end, 247 | tag_start_char, 248 | orig_pos = this.pos, 249 | orig_line_char_count = this.line_char_count; 250 | 251 | peek = peek !== undefined ? peek : false; 252 | 253 | do { 254 | if (this.pos >= this.input.length) { 255 | if (peek) { 256 | this.pos = orig_pos; 257 | this.line_char_count = orig_line_char_count; 258 | } 259 | return content.length ? content.join('') : ['', 'TK_EOF']; 260 | } 261 | 262 | input_char = this.input.charAt(this.pos); 263 | this.pos++; 264 | 265 | if (this.Utils.in_array(input_char, this.Utils.whitespace)) { //don't want to insert unnecessary space 266 | space = true; 267 | continue; 268 | } 269 | 270 | if (input_char === "'" || input_char === '"') { 271 | input_char += this.get_unformatted(input_char); 272 | space = true; 273 | 274 | } 275 | 276 | if (input_char === '=') { //no space before = 277 | space = false; 278 | } 279 | 280 | if (content.length && content[content.length - 1] !== '=' && input_char !== '>' && space) { 281 | //no space after = or before > 282 | if (this.line_char_count >= this.wrap_line_length) { 283 | this.print_newline(false, content); 284 | this.print_indentation(content); 285 | } else { 286 | content.push(' '); 287 | this.line_char_count++; 288 | } 289 | space = false; 290 | } 291 | 292 | if (indent_handlebars && tag_start_char === '<') { 293 | // When inside an angle-bracket tag, put spaces around 294 | // handlebars not inside of strings. 295 | if ((input_char + this.input.charAt(this.pos)) === '{{') { 296 | input_char += this.get_unformatted('}}'); 297 | if (content.length && content[content.length - 1] !== ' ' && content[content.length - 1] !== '<') { 298 | input_char = ' ' + input_char; 299 | } 300 | space = true; 301 | } 302 | } 303 | 304 | if (input_char === '<' && !tag_start_char) { 305 | tag_start = this.pos - 1; 306 | tag_start_char = '<'; 307 | } 308 | 309 | if (indent_handlebars && !tag_start_char) { 310 | if (content.length >= 2 && content[content.length - 1] === '{' && content[content.length - 2] == '{') { 311 | if (input_char === '#' || input_char === '/') { 312 | tag_start = this.pos - 3; 313 | } else { 314 | tag_start = this.pos - 2; 315 | } 316 | tag_start_char = '{'; 317 | } 318 | } 319 | 320 | this.line_char_count++; 321 | content.push(input_char); //inserts character at-a-time (or string) 322 | 323 | if (content[1] && content[1] === '!') { //if we're in a comment, do something special 324 | // We treat all comments as literals, even more than preformatted tags 325 | // we just look for the appropriate close tag 326 | content = [this.get_comment(tag_start)]; 327 | break; 328 | } 329 | 330 | if (indent_handlebars && tag_start_char === '{' && content.length > 2 && content[content.length - 2] === '}' && content[content.length - 1] === '}') { 331 | break; 332 | } 333 | } while (input_char !== '>'); 334 | 335 | var tag_complete = content.join(''); 336 | var tag_index; 337 | var tag_offset; 338 | 339 | if (tag_complete.indexOf(' ') !== -1) { //if there's whitespace, thats where the tag name ends 340 | tag_index = tag_complete.indexOf(' '); 341 | } else if (tag_complete[0] === '{') { 342 | tag_index = tag_complete.indexOf('}'); 343 | } else { //otherwise go with the tag ending 344 | tag_index = tag_complete.indexOf('>'); 345 | } 346 | if (tag_complete[0] === '<' || !indent_handlebars) { 347 | tag_offset = 1; 348 | } else { 349 | tag_offset = tag_complete[2] === '#' ? 3 : 2; 350 | } 351 | var tag_check = tag_complete.substring(tag_offset, tag_index).toLowerCase(); 352 | if (tag_complete.charAt(tag_complete.length - 2) === '/' || 353 | this.Utils.in_array(tag_check, this.Utils.single_token)) { //if this tag name is a single tag type (either in the list or has a closing /) 354 | if (!peek) { 355 | this.tag_type = 'SINGLE'; 356 | } 357 | } else if (indent_handlebars && tag_complete[0] === '{' && tag_check === 'else') { 358 | if (!peek) { 359 | this.indent_to_tag('if'); 360 | this.tag_type = 'HANDLEBARS_ELSE'; 361 | this.indent_content = true; 362 | this.traverse_whitespace(); 363 | } 364 | } else if (tag_check === 'script') { //for later script handling 365 | if (!peek) { 366 | this.record_tag(tag_check); 367 | this.tag_type = 'SCRIPT'; 368 | } 369 | } else if (tag_check === 'style') { //for future style handling (for now it justs uses get_content) 370 | if (!peek) { 371 | this.record_tag(tag_check); 372 | this.tag_type = 'STYLE'; 373 | } 374 | } else if (this.is_unformatted(tag_check, unformatted)) { // do not reformat the "unformatted" tags 375 | comment = this.get_unformatted('', tag_complete); //...delegate to get_unformatted function 376 | content.push(comment); 377 | // Preserve collapsed whitespace either before or after this tag. 378 | if (tag_start > 0 && this.Utils.in_array(this.input.charAt(tag_start - 1), this.Utils.whitespace)) { 379 | content.splice(0, 0, this.input.charAt(tag_start - 1)); 380 | } 381 | tag_end = this.pos - 1; 382 | if (this.Utils.in_array(this.input.charAt(tag_end + 1), this.Utils.whitespace)) { 383 | content.push(this.input.charAt(tag_end + 1)); 384 | } 385 | this.tag_type = 'SINGLE'; 386 | } else if (tag_check.charAt(0) === '!') { //peek for ', 427 | matched = false; 428 | 429 | this.pos = start_pos; 430 | input_char = this.input.charAt(this.pos); 431 | this.pos++; 432 | 433 | while (this.pos <= this.input.length) { 434 | comment += input_char; 435 | 436 | // only need to check for the delimiter if the last chars match 437 | if (comment[comment.length - 1] === delimiter[delimiter.length - 1] && 438 | comment.indexOf(delimiter) !== -1) { 439 | break; 440 | } 441 | 442 | // only need to search for custom delimiter for the first few characters 443 | if (!matched && comment.length < 10) { 444 | if (comment.indexOf(''; 446 | matched = true; 447 | } else if (comment.indexOf(''; 449 | matched = true; 450 | } else if (comment.indexOf(''; 452 | matched = true; 453 | } else if (comment.indexOf(''; 455 | matched = true; 456 | } 457 | } 458 | 459 | input_char = this.input.charAt(this.pos); 460 | this.pos++; 461 | } 462 | 463 | return comment; 464 | }; 465 | 466 | this.get_unformatted = function(delimiter, orig_tag) { //function to return unformatted content in its entirety 467 | 468 | if (orig_tag && orig_tag.toLowerCase().indexOf(delimiter) !== -1) { 469 | return ''; 470 | } 471 | var input_char = ''; 472 | var content = ''; 473 | var min_index = 0; 474 | var space = true; 475 | do { 476 | 477 | if (this.pos >= this.input.length) { 478 | return content; 479 | } 480 | 481 | input_char = this.input.charAt(this.pos); 482 | this.pos++; 483 | 484 | if (this.Utils.in_array(input_char, this.Utils.whitespace)) { 485 | if (!space) { 486 | this.line_char_count--; 487 | continue; 488 | } 489 | if (input_char === '\n' || input_char === '\r') { 490 | content += '\n'; 491 | /* Don't change tab indention for unformatted blocks. If using code for html editing, this will greatly affect
 tags if they are specified in the 'unformatted array'
492 | 			for (var i=0; i]*>\s*$/);
571 | 
572 | 			// if next_tag comes back but is not an isolated tag, then
573 | 			// let's treat the 'a' tag as having content
574 | 			// and respect the unformatted option
575 | 			if (!tag || this.Utils.in_array(tag, unformatted)) {
576 | 				return true;
577 | 			} else {
578 | 				return false;
579 | 			}
580 | 		};
581 | 
582 | 		this.printer = function(js_source, indent_character, indent_size, wrap_line_length, brace_style) { //handles input/output and some other printing functions
583 | 
584 | 			this.input = js_source || ''; //gets the input for the Parser
585 | 			this.output = [];
586 | 			this.indent_character = indent_character;
587 | 			this.indent_string = '';
588 | 			this.indent_size = indent_size;
589 | 			this.brace_style = brace_style;
590 | 			this.indent_level = 0;
591 | 			this.wrap_line_length = wrap_line_length;
592 | 			this.line_char_count = 0; //count to see if wrap_line_length was exceeded
593 | 
594 | 			for (var i = 0; i < this.indent_size; i++) {
595 | 				this.indent_string += this.indent_character;
596 | 			}
597 | 
598 | 			this.print_newline = function(force, arr) {
599 | 				this.line_char_count = 0;
600 | 				if (!arr || !arr.length) {
601 | 					return;
602 | 				}
603 | 				if (force || (arr[arr.length - 1] !== '\n')) { //we might want the extra line
604 | 					arr.push('\n');
605 | 				}
606 | 			};
607 | 
608 | 			this.print_indentation = function(arr) {
609 | 				for (var i = 0; i < this.indent_level; i++) {
610 | 					arr.push(this.indent_string);
611 | 					this.line_char_count += this.indent_string.length;
612 | 				}
613 | 			};
614 | 
615 | 			this.print_token = function(text) {
616 | 				if (text || text !== '') {
617 | 					if (this.output.length && this.output[this.output.length - 1] === '\n') {
618 | 						this.print_indentation(this.output);
619 | 						text = ltrim(text);
620 | 					}
621 | 				}
622 | 				this.print_token_raw(text);
623 | 			};
624 | 
625 | 			this.print_token_raw = function(text) {
626 | 				if (text && text !== '') {
627 | 					if (text.length > 1 && text[text.length - 1] === '\n') {
628 | 						// unformatted tags can grab newlines as their last character
629 | 						this.output.push(text.slice(0, -1));
630 | 						this.print_newline(false, this.output);
631 | 					} else {
632 | 						this.output.push(text);
633 | 					}
634 | 				}
635 | 
636 | 				for (var n = 0; n < this.newlines; n++) {
637 | 					this.print_newline(n > 0, this.output);
638 | 				}
639 | 				this.newlines = 0;
640 | 			};
641 | 
642 | 			this.indent = function() {
643 | 				this.indent_level++;
644 | 			};
645 | 
646 | 			this.unindent = function() {
647 | 				if (this.indent_level > 0) {
648 | 					this.indent_level--;
649 | 				}
650 | 			};
651 | 		};
652 | 		return this;
653 | 	}
654 | 
655 | 	/*_____________________--------------------_____________________*/
656 | 
657 | 	multi_parser = new Parser(); //wrapping functions Parser
658 | 	multi_parser.printer(html_source, indent_character, indent_size, wrap_line_length, brace_style); //initialize starting values
659 | 
660 | 	while (true) {
661 | 		var t = multi_parser.get_token();
662 | 		multi_parser.token_text = t[0];
663 | 		multi_parser.token_type = t[1];
664 | 
665 | 		if (multi_parser.token_type === 'TK_EOF') {
666 | 			break;
667 | 		}
668 | 
669 | 		switch (multi_parser.token_type) {
670 | 			case 'TK_TAG_START':
671 | 				multi_parser.print_newline(false, multi_parser.output);
672 | 				multi_parser.print_token(multi_parser.token_text);
673 | 				if (multi_parser.indent_content) {
674 | 					multi_parser.indent();
675 | 					multi_parser.indent_content = false;
676 | 				}
677 | 				multi_parser.current_mode = 'CONTENT';
678 | 				break;
679 | 			case 'TK_TAG_STYLE':
680 | 			case 'TK_TAG_SCRIPT':
681 | 				multi_parser.print_newline(false, multi_parser.output);
682 | 				multi_parser.print_token(multi_parser.token_text);
683 | 				multi_parser.current_mode = 'CONTENT';
684 | 				break;
685 | 			case 'TK_TAG_END':
686 | 				//Print new line only if the tag has no content and has child
687 | 				if (multi_parser.last_token === 'TK_CONTENT' && multi_parser.last_text === '') {
688 | 					var tag_name = multi_parser.token_text.match(/\w+/)[0];
689 | 					var tag_extracted_from_last_output = null;
690 | 					if (multi_parser.output.length) {
691 | 						tag_extracted_from_last_output = multi_parser.output[multi_parser.output.length - 1].match(/(?:<|{{#)\s*(\w+)/);
692 | 					}
693 | 					if (tag_extracted_from_last_output === null ||
694 | 						tag_extracted_from_last_output[1] !== tag_name) {
695 | 						multi_parser.print_newline(false, multi_parser.output);
696 | 					}
697 | 				}
698 | 				multi_parser.print_token(multi_parser.token_text);
699 | 				multi_parser.current_mode = 'CONTENT';
700 | 				break;
701 | 			case 'TK_TAG_SINGLE':
702 | 				// Don't add a newline before elements that should remain unformatted.
703 | 				var tag_check = multi_parser.token_text.match(/^\s*<([a-z]+)/i);
704 | 				if (!tag_check || !multi_parser.Utils.in_array(tag_check[1], unformatted)) {
705 | 					multi_parser.print_newline(false, multi_parser.output);
706 | 				}
707 | 				multi_parser.print_token(multi_parser.token_text);
708 | 				multi_parser.current_mode = 'CONTENT';
709 | 				break;
710 | 			case 'TK_TAG_HANDLEBARS_ELSE':
711 | 				multi_parser.print_token(multi_parser.token_text);
712 | 				if (multi_parser.indent_content) {
713 | 					multi_parser.indent();
714 | 					multi_parser.indent_content = false;
715 | 				}
716 | 				multi_parser.current_mode = 'CONTENT';
717 | 				break;
718 | 			case 'TK_CONTENT':
719 | 				multi_parser.print_token(multi_parser.token_text);
720 | 				multi_parser.current_mode = 'TAG';
721 | 				break;
722 | 			case 'TK_STYLE':
723 | 			case 'TK_SCRIPT':
724 | 				if (multi_parser.token_text !== '') {
725 | 					multi_parser.print_newline(false, multi_parser.output);
726 | 					var text = multi_parser.token_text,
727 | 						_beautifier,
728 | 						script_indent_level = 1;
729 | 					if (multi_parser.token_type === 'TK_SCRIPT') {
730 | 						_beautifier = typeof js_beautify === 'function' && js_beautify;
731 | 					} else if (multi_parser.token_type === 'TK_STYLE') {
732 | 						_beautifier = typeof css_beautify === 'function' && css_beautify;
733 | 					}
734 | 
735 | 					if (options.indent_scripts === "keep") {
736 | 						script_indent_level = 0;
737 | 					} else if (options.indent_scripts === "separate") {
738 | 						script_indent_level = -multi_parser.indent_level;
739 | 					}
740 | 
741 | 					var indentation = multi_parser.get_full_indent(script_indent_level);
742 | 					if (_beautifier) {
743 | 						// call the Beautifier if avaliable
744 | 						text = _beautifier(text.replace(/^\s*/, indentation), options);
745 | 					} else {
746 | 						// simply indent the string otherwise
747 | 						var white = text.match(/^\s*/)[0];
748 | 						var _level = white.match(/[^\n\r]*$/)[0].split(multi_parser.indent_string).length - 1;
749 | 						var reindent = multi_parser.get_full_indent(script_indent_level - _level);
750 | 						text = text.replace(/^\s*/, indentation)
751 | 							.replace(/\r\n|\r|\n/g, '\n' + reindent)
752 | 							.replace(/\s+$/, '');
753 | 					}
754 | 					if (text) {
755 | 						multi_parser.print_token_raw(indentation + trim(text));
756 | 						multi_parser.print_newline(false, multi_parser.output);
757 | 					}
758 | 				}
759 | 				multi_parser.current_mode = 'TAG';
760 | 				break;
761 | 		}
762 | 		multi_parser.last_token = multi_parser.token_type;
763 | 		multi_parser.last_text = multi_parser.token_text;
764 | 	}
765 | 	return multi_parser.output.join('');
766 | }


--------------------------------------------------------------------------------
/ERichTextEditor/Classes/Library/ThirdPart/ContentEditSource/ZSSRichTextEditor.js:
--------------------------------------------------------------------------------
  1 | /*!
  2 |  *
  3 |  * ZSSRichTextEditor v0.5.2
  4 |  * http://www.zedsaid.com
  5 |  *
  6 |  * Copyright 2014 Zed Said Studio LLC
  7 |  *
  8 |  */
  9 | 
 10 | var zss_editor = {};
 11 | 
 12 | // If we are using iOS or desktop
 13 | zss_editor.isUsingiOS = true;
 14 | 
 15 | // If the user is draging
 16 | zss_editor.isDragging = false;
 17 | 
 18 | // The current selection
 19 | zss_editor.currentSelection;
 20 | 
 21 | // The current editing image
 22 | zss_editor.currentEditingImage;
 23 | 
 24 | // The current editing link
 25 | zss_editor.currentEditingLink;
 26 | 
 27 | // The objects that are enabled
 28 | zss_editor.enabledItems = {};
 29 | 
 30 | // Height of content window, will be set by viewController
 31 | zss_editor.contentHeight = 244;
 32 | 
 33 | // Sets to true when extra footer gap shows and requires to hide
 34 | zss_editor.updateScrollOffset = false;
 35 | 
 36 | /**
 37 |  * The initializer function that must be called onLoad
 38 |  */
 39 | zss_editor.init = function() {
 40 |     
 41 |     $('#zss_editor_content').on('touchend', function(e) {
 42 |                                 zss_editor.enabledEditingItems(e);
 43 |                                 var clicked = $(e.target);
 44 |                                 if (!clicked.hasClass('zs_active')) {
 45 |                                 $('img').removeClass('zs_active');
 46 |                                 }
 47 |                                 });
 48 |     
 49 |     $(document).on('selectionchange',function(e){
 50 |                    zss_editor.calculateEditorHeightWithCaretPosition();
 51 |                    zss_editor.setScrollPosition();
 52 |                    zss_editor.enabledEditingItems(e);
 53 |                    });
 54 |     
 55 |     $(window).on('scroll', function(e) {
 56 |                  zss_editor.updateOffset();
 57 |                  });
 58 |     
 59 |     // Make sure that when we tap anywhere in the document we focus on the editor
 60 |     $(window).on('touchmove', function(e) {
 61 |                  zss_editor.isDragging = true;
 62 |                  zss_editor.updateScrollOffset = true;
 63 |                  zss_editor.setScrollPosition();
 64 |                  zss_editor.enabledEditingItems(e);
 65 |                  });
 66 |     $(window).on('touchstart', function(e) {
 67 |                  zss_editor.isDragging = false;
 68 |                  });
 69 |     $(window).on('touchend', function(e) {
 70 |                  if (!zss_editor.isDragging && (e.target.id == "zss_editor_footer"||e.target.nodeName.toLowerCase() == "html")) {
 71 |                  zss_editor.focusEditor();
 72 |                  }
 73 |                  });
 74 |     
 75 | }//end
 76 | 
 77 | zss_editor.updateOffset = function() {
 78 |     
 79 |     if (!zss_editor.updateScrollOffset)
 80 |         return;
 81 |     
 82 |     var offsetY = window.document.body.scrollTop;
 83 |     
 84 |     var footer = $('#zss_editor_footer');
 85 |     
 86 |     var maxOffsetY = footer.offset().top - zss_editor.contentHeight;
 87 |     
 88 |     if (maxOffsetY < 0)
 89 |         maxOffsetY = 0;
 90 |     
 91 |     if (offsetY > maxOffsetY)
 92 |     {
 93 |         window.scrollTo(0, maxOffsetY);
 94 |     }
 95 |     
 96 |     zss_editor.setScrollPosition();
 97 | }
 98 | 
 99 | // This will show up in the XCode console as we are able to push this into an NSLog.
100 | zss_editor.debug = function(msg) {
101 |     window.location = 'debug://'+msg;
102 | }
103 | 
104 | 
105 | zss_editor.setScrollPosition = function() {
106 |     var position = window.pageYOffset;
107 |     window.location = 'scroll://'+position;
108 | }
109 | 
110 | 
111 | zss_editor.setPlaceholder = function(placeholder) {
112 |     
113 |     var editor = $('#zss_editor_content');
114 |     
115 |     //set placeHolder
116 |     editor.attr("placeholder",placeholder);
117 |     
118 |     //set focus
119 |     editor.focusout(function(){
120 |                     var element = $(this);
121 |                     if (!element.text().trim().length) {
122 |                     element.empty();
123 |                     }
124 |                     });
125 |     
126 |     
127 |     
128 | }
129 | 
130 | zss_editor.setFooterHeight = function(footerHeight) {
131 |     var footer = $('#zss_editor_footer');
132 |     footer.height(footerHeight + 'px');
133 | }
134 | 
135 | zss_editor.getCaretYPosition = function() {
136 |     var sel = window.getSelection();
137 |     // Next line is comented to prevent deselecting selection. It looks like work but if there are any issues will appear then uconmment it as well as code above.
138 |     //sel.collapseToStart();
139 |     var range = sel.getRangeAt(0);
140 |     var span = document.createElement('span');// something happening here preventing selection of elements
141 |     range.collapse(false);
142 |     range.insertNode(span);
143 |     var topPosition = span.offsetTop;
144 |     span.parentNode.removeChild(span);
145 |     return topPosition;
146 | }
147 | 
148 | zss_editor.calculateEditorHeightWithCaretPosition = function() {
149 |     
150 |     var padding = 50;
151 |     var c = zss_editor.getCaretYPosition();
152 |     
153 |     var editor = $('#zss_editor_content');
154 |     
155 |     var offsetY = window.document.body.scrollTop;
156 |     var height = zss_editor.contentHeight;
157 |     
158 |     var newPos = window.pageYOffset;
159 |     
160 |     if (c < offsetY) {
161 |         newPos = c;
162 |     } else if (c > (offsetY + height - padding)) {
163 |         newPos = c - height + padding - 18;
164 |     }
165 |     
166 |     window.scrollTo(0, newPos);
167 | }
168 | 
169 | zss_editor.backuprange = function(){
170 |     var selection = window.getSelection();
171 |     var range = selection.getRangeAt(0);
172 |     zss_editor.currentSelection = {"startContainer": range.startContainer, "startOffset":range.startOffset,"endContainer":range.endContainer, "endOffset":range.endOffset};
173 | }
174 | 
175 | zss_editor.restorerange = function(){
176 |     var selection = window.getSelection();
177 |     selection.removeAllRanges();
178 |     var range = document.createRange();
179 |     range.setStart(zss_editor.currentSelection.startContainer, zss_editor.currentSelection.startOffset);
180 |     range.setEnd(zss_editor.currentSelection.endContainer, zss_editor.currentSelection.endOffset);
181 |     selection.addRange(range);
182 | }
183 | 
184 | zss_editor.getSelectedNode = function() {
185 |     var node,selection;
186 |     if (window.getSelection) {
187 |         selection = getSelection();
188 |         node = selection.anchorNode;
189 |     }
190 |     if (!node && document.selection) {
191 |         selection = document.selection
192 |         var range = selection.getRangeAt ? selection.getRangeAt(0) : selection.createRange();
193 |         node = range.commonAncestorContainer ? range.commonAncestorContainer :
194 |         range.parentElement ? range.parentElement() : range.item(0);
195 |     }
196 |     if (node) {
197 |         return (node.nodeName == "#text" ? node.parentNode : node);
198 |     }
199 | };
200 | 
201 | zss_editor.setBold = function() {
202 |     document.execCommand('bold', false, null);
203 |     zss_editor.enabledEditingItems();
204 | }
205 | 
206 | zss_editor.setItalic = function() {
207 |     document.execCommand('italic', false, null);
208 |     zss_editor.enabledEditingItems();
209 | }
210 | 
211 | zss_editor.setSubscript = function() {
212 |     document.execCommand('subscript', false, null);
213 |     zss_editor.enabledEditingItems();
214 | }
215 | 
216 | zss_editor.setSuperscript = function() {
217 |     document.execCommand('superscript', false, null);
218 |     zss_editor.enabledEditingItems();
219 | }
220 | 
221 | zss_editor.setStrikeThrough = function() {
222 |     document.execCommand('strikeThrough', false, null);
223 |     zss_editor.enabledEditingItems();
224 | }
225 | 
226 | zss_editor.setUnderline = function() {
227 |     document.execCommand('underline', false, null);
228 |     zss_editor.enabledEditingItems();
229 | }
230 | 
231 | zss_editor.setBlockquote = function() {
232 |     document.execCommand('formatBlock', false, '
'); 233 | zss_editor.enabledEditingItems(); 234 | } 235 | 236 | zss_editor.removeFormating = function() { 237 | document.execCommand('removeFormat', false, null); 238 | zss_editor.enabledEditingItems(); 239 | } 240 | 241 | zss_editor.setHorizontalRule = function() { 242 | document.execCommand('insertHorizontalRule', false, null); 243 | zss_editor.enabledEditingItems(); 244 | } 245 | 246 | zss_editor.setHeading = function(heading) { 247 | var current_selection = $(zss_editor.getSelectedNode()); 248 | var t = current_selection.prop("tagName").toLowerCase(); 249 | var is_heading = (t == 'h1' || t == 'h2' || t == 'h3' || t == 'h4' || t == 'h5' || t == 'h6'); 250 | if (is_heading && heading == t) { 251 | var c = current_selection.html(); 252 | current_selection.replaceWith(c); 253 | } else { 254 | document.execCommand('formatBlock', false, '<'+heading+'>'); 255 | } 256 | 257 | zss_editor.enabledEditingItems(); 258 | } 259 | 260 | zss_editor.setParagraph = function() { 261 | var current_selection = $(zss_editor.getSelectedNode()); 262 | var t = current_selection.prop("tagName").toLowerCase(); 263 | var is_paragraph = (t == 'p'); 264 | if (is_paragraph) { 265 | var c = current_selection.html(); 266 | current_selection.replaceWith(c); 267 | } else { 268 | document.execCommand('formatBlock', false, '

'); 269 | } 270 | 271 | zss_editor.enabledEditingItems(); 272 | } 273 | 274 | // Need way to remove formatBlock 275 | console.log('WARNING: We need a way to remove formatBlock items'); 276 | 277 | zss_editor.undo = function() { 278 | document.execCommand('undo', false, null); 279 | zss_editor.enabledEditingItems(); 280 | } 281 | 282 | zss_editor.redo = function() { 283 | document.execCommand('redo', false, null); 284 | zss_editor.enabledEditingItems(); 285 | } 286 | 287 | zss_editor.setOrderedList = function() { 288 | document.execCommand('insertOrderedList', false, null); 289 | zss_editor.enabledEditingItems(); 290 | } 291 | 292 | zss_editor.setUnorderedList = function() { 293 | document.execCommand('insertUnorderedList', false, null); 294 | zss_editor.enabledEditingItems(); 295 | } 296 | 297 | zss_editor.setJustifyCenter = function() { 298 | document.execCommand('justifyCenter', false, null); 299 | zss_editor.enabledEditingItems(); 300 | } 301 | 302 | zss_editor.setJustifyFull = function() { 303 | document.execCommand('justifyFull', false, null); 304 | zss_editor.enabledEditingItems(); 305 | } 306 | 307 | zss_editor.setJustifyLeft = function() { 308 | document.execCommand('justifyLeft', false, null); 309 | zss_editor.enabledEditingItems(); 310 | } 311 | 312 | zss_editor.setJustifyRight = function() { 313 | document.execCommand('justifyRight', false, null); 314 | zss_editor.enabledEditingItems(); 315 | } 316 | 317 | zss_editor.setIndent = function() { 318 | document.execCommand('indent', false, null); 319 | zss_editor.enabledEditingItems(); 320 | } 321 | 322 | zss_editor.setOutdent = function() { 323 | document.execCommand('outdent', false, null); 324 | zss_editor.enabledEditingItems(); 325 | } 326 | 327 | zss_editor.setFontFamily = function(fontFamily) { 328 | 329 | zss_editor.restorerange(); 330 | document.execCommand("styleWithCSS", null, true); 331 | document.execCommand("fontName", false, fontFamily); 332 | document.execCommand("styleWithCSS", null, false); 333 | zss_editor.enabledEditingItems(); 334 | 335 | } 336 | 337 | zss_editor.setTextColor = function(color) { 338 | 339 | zss_editor.restorerange(); 340 | document.execCommand("styleWithCSS", null, true); 341 | document.execCommand('foreColor', false, color); 342 | document.execCommand("styleWithCSS", null, false); 343 | zss_editor.enabledEditingItems(); 344 | // document.execCommand("removeFormat", false, "foreColor"); // Removes just foreColor 345 | 346 | } 347 | 348 | zss_editor.setBackgroundColor = function(color) { 349 | zss_editor.restorerange(); 350 | document.execCommand("styleWithCSS", null, true); 351 | document.execCommand('hiliteColor', false, color); 352 | document.execCommand("styleWithCSS", null, false); 353 | zss_editor.enabledEditingItems(); 354 | } 355 | 356 | // Needs addClass method 357 | 358 | zss_editor.insertLink = function(url, title) { 359 | 360 | zss_editor.restorerange(); 361 | var sel = document.getSelection(); 362 | console.log(sel); 363 | if (sel.toString().length != 0) { 364 | if (sel.rangeCount) { 365 | 366 | var el = document.createElement("a"); 367 | el.setAttribute("href", url); 368 | el.setAttribute("title", title); 369 | 370 | var range = sel.getRangeAt(0).cloneRange(); 371 | range.surroundContents(el); 372 | sel.removeAllRanges(); 373 | sel.addRange(range); 374 | } 375 | } 376 | else 377 | { 378 | document.execCommand("insertHTML",false,""+title+""); 379 | } 380 | 381 | zss_editor.enabledEditingItems(); 382 | } 383 | 384 | zss_editor.updateLink = function(url, title) { 385 | 386 | zss_editor.restorerange(); 387 | 388 | if (zss_editor.currentEditingLink) { 389 | var c = zss_editor.currentEditingLink; 390 | c.attr('href', url); 391 | c.attr('title', title); 392 | } 393 | zss_editor.enabledEditingItems(); 394 | 395 | }//end 396 | 397 | zss_editor.updateImage = function(url, alt) { 398 | 399 | zss_editor.restorerange(); 400 | 401 | if (zss_editor.currentEditingImage) { 402 | var c = zss_editor.currentEditingImage; 403 | c.attr('src', url); 404 | c.attr('alt', alt); 405 | } 406 | zss_editor.enabledEditingItems(); 407 | 408 | }//end 409 | 410 | zss_editor.updateImageBase64String = function(imageBase64String, alt) { 411 | 412 | zss_editor.restorerange(); 413 | 414 | if (zss_editor.currentEditingImage) { 415 | var c = zss_editor.currentEditingImage; 416 | var src = 'data:image/jpeg;base64,' + imageBase64String; 417 | c.attr('src', src); 418 | c.attr('alt', alt); 419 | } 420 | zss_editor.enabledEditingItems(); 421 | 422 | }//end 423 | 424 | 425 | zss_editor.unlink = function() { 426 | 427 | if (zss_editor.currentEditingLink) { 428 | var c = zss_editor.currentEditingLink; 429 | c.contents().unwrap(); 430 | } 431 | zss_editor.enabledEditingItems(); 432 | } 433 | 434 | zss_editor.quickLink = function() { 435 | 436 | var sel = document.getSelection(); 437 | var link_url = ""; 438 | var test = new String(sel); 439 | var mailregexp = new RegExp("^(.+)(\@)(.+)$", "gi"); 440 | if (test.search(mailregexp) == -1) { 441 | checkhttplink = new RegExp("^http\:\/\/", "gi"); 442 | if (test.search(checkhttplink) == -1) { 443 | checkanchorlink = new RegExp("^\#", "gi"); 444 | if (test.search(checkanchorlink) == -1) { 445 | link_url = "http://" + sel; 446 | } else { 447 | link_url = sel; 448 | } 449 | } else { 450 | link_url = sel; 451 | } 452 | } else { 453 | checkmaillink = new RegExp("^mailto\:", "gi"); 454 | if (test.search(checkmaillink) == -1) { 455 | link_url = "mailto:" + sel; 456 | } else { 457 | link_url = sel; 458 | } 459 | } 460 | 461 | var html_code = '' + sel + ''; 462 | zss_editor.insertHTML(html_code); 463 | 464 | } 465 | 466 | zss_editor.prepareInsert = function() { 467 | zss_editor.backuprange(); 468 | } 469 | 470 | zss_editor.insertImage = function(url, alt) { 471 | zss_editor.restorerange(); 472 | var html = ''+alt+''; 473 | zss_editor.insertHTML(html); 474 | zss_editor.enabledEditingItems(); 475 | } 476 | 477 | zss_editor.insertImageBase64String = function(imageBase64String, alt) { 478 | zss_editor.restorerange(); 479 | var html = ''+alt+''; 480 | zss_editor.insertHTML(html); 481 | zss_editor.enabledEditingItems(); 482 | } 483 | 484 | zss_editor.setHTML = function(html) { 485 | var editor = $('#zss_editor_content'); 486 | editor.html(html); 487 | } 488 | 489 | zss_editor.insertHTML = function(html) { 490 | document.execCommand('insertHTML', false, html); 491 | zss_editor.enabledEditingItems(); 492 | } 493 | 494 | zss_editor.getHTML = function() { 495 | 496 | // Images 497 | var img = $('img'); 498 | if (img.length != 0) { 499 | $('img').removeClass('zs_active'); 500 | $('img').each(function(index, e) { 501 | var image = $(this); 502 | var zs_class = image.attr('class'); 503 | if (typeof(zs_class) != "undefined") { 504 | if (zs_class == '') { 505 | image.removeAttr('class'); 506 | } 507 | } 508 | }); 509 | } 510 | 511 | // Blockquote 512 | var bq = $('blockquote'); 513 | if (bq.length != 0) { 514 | bq.each(function() { 515 | var b = $(this); 516 | if (b.css('border').indexOf('none') != -1) { 517 | b.css({'border': ''}); 518 | } 519 | if (b.css('padding').indexOf('0px') != -1) { 520 | b.css({'padding': ''}); 521 | } 522 | }); 523 | } 524 | 525 | // Get the contents 526 | var h = document.getElementById("zss_editor_content").innerHTML; 527 | 528 | return h; 529 | } 530 | 531 | zss_editor.getText = function() { 532 | return $('#zss_editor_content').text(); 533 | } 534 | 535 | zss_editor.isCommandEnabled = function(commandName) { 536 | return document.queryCommandState(commandName); 537 | } 538 | 539 | zss_editor.enabledEditingItems = function(e) { 540 | 541 | console.log('enabledEditingItems'); 542 | var items = []; 543 | if (zss_editor.isCommandEnabled('bold')) { 544 | items.push('bold'); 545 | } 546 | if (zss_editor.isCommandEnabled('italic')) { 547 | items.push('italic'); 548 | } 549 | if (zss_editor.isCommandEnabled('subscript')) { 550 | items.push('subscript'); 551 | } 552 | if (zss_editor.isCommandEnabled('superscript')) { 553 | items.push('superscript'); 554 | } 555 | if (zss_editor.isCommandEnabled('strikeThrough')) { 556 | items.push('strikeThrough'); 557 | } 558 | if (zss_editor.isCommandEnabled('underline')) { 559 | items.push('underline'); 560 | } 561 | if (zss_editor.isCommandEnabled('insertOrderedList')) { 562 | items.push('orderedList'); 563 | } 564 | if (zss_editor.isCommandEnabled('insertUnorderedList')) { 565 | items.push('unorderedList'); 566 | } 567 | if (zss_editor.isCommandEnabled('justifyCenter')) { 568 | items.push('justifyCenter'); 569 | } 570 | if (zss_editor.isCommandEnabled('justifyFull')) { 571 | items.push('justifyFull'); 572 | } 573 | if (zss_editor.isCommandEnabled('justifyLeft')) { 574 | items.push('justifyLeft'); 575 | } 576 | if (zss_editor.isCommandEnabled('justifyRight')) { 577 | items.push('justifyRight'); 578 | } 579 | if (zss_editor.isCommandEnabled('insertHorizontalRule')) { 580 | items.push('horizontalRule'); 581 | } 582 | var formatBlock = document.queryCommandValue('formatBlock'); 583 | if (formatBlock.length > 0) { 584 | items.push(formatBlock); 585 | } 586 | // Images 587 | $('img').bind('touchstart', function(e) { 588 | $('img').removeClass('zs_active'); 589 | $(this).addClass('zs_active'); 590 | }); 591 | 592 | // Use jQuery to figure out those that are not supported 593 | if (typeof(e) != "undefined") { 594 | 595 | // The target element 596 | var s = zss_editor.getSelectedNode(); 597 | var t = $(s); 598 | var nodeName = e.target.nodeName.toLowerCase(); 599 | 600 | // Background Color 601 | var bgColor = t.css('backgroundColor'); 602 | if (bgColor.length != 0 && bgColor != 'rgba(0, 0, 0, 0)' && bgColor != 'rgb(0, 0, 0)' && bgColor != 'transparent') { 603 | items.push('backgroundColor'); 604 | } 605 | // Text Color 606 | var textColor = t.css('color'); 607 | if (textColor.length != 0 && textColor != 'rgba(0, 0, 0, 0)' && textColor != 'rgb(0, 0, 0)' && textColor != 'transparent') { 608 | items.push('textColor'); 609 | } 610 | 611 | //Fonts 612 | var font = t.css('font-family'); 613 | if (font.length != 0 && font != 'Arial, Helvetica, sans-serif') { 614 | items.push('fonts'); 615 | } 616 | 617 | // Link 618 | if (nodeName == 'a') { 619 | zss_editor.currentEditingLink = t; 620 | var title = t.attr('title'); 621 | items.push('link:'+t.attr('href')); 622 | if (t.attr('title') !== undefined) { 623 | items.push('link-title:'+t.attr('title')); 624 | } 625 | 626 | } else { 627 | zss_editor.currentEditingLink = null; 628 | } 629 | // Blockquote 630 | if (nodeName == 'blockquote') { 631 | items.push('indent'); 632 | } 633 | // Image 634 | if (nodeName == 'img') { 635 | zss_editor.currentEditingImage = t; 636 | items.push('image:'+t.attr('src')); 637 | if (t.attr('alt') !== undefined) { 638 | items.push('image-alt:'+t.attr('alt')); 639 | } 640 | 641 | } else { 642 | zss_editor.currentEditingImage = null; 643 | } 644 | 645 | } 646 | 647 | if (items.length > 0) { 648 | if (zss_editor.isUsingiOS) { 649 | //window.location = "zss-callback/"+items.join(','); 650 | window.location = "callback://0/"+items.join(','); 651 | } else { 652 | console.log("callback://"+items.join(',')); 653 | } 654 | } else { 655 | if (zss_editor.isUsingiOS) { 656 | window.location = "zss-callback/"; 657 | } else { 658 | console.log("callback://"); 659 | } 660 | } 661 | 662 | } 663 | 664 | zss_editor.focusEditor = function() { 665 | 666 | // the following was taken from http://stackoverflow.com/questions/1125292/how-to-move-cursor-to-end-of-contenteditable-entity/3866442#3866442 667 | // and ensures we move the cursor to the end of the editor 668 | var editor = $('#zss_editor_content'); 669 | var range = document.createRange(); 670 | range.selectNodeContents(editor.get(0)); 671 | range.collapse(false); 672 | var selection = window.getSelection(); 673 | selection.removeAllRanges(); 674 | selection.addRange(range); 675 | editor.focus(); 676 | } 677 | 678 | zss_editor.blurEditor = function() { 679 | $('#zss_editor_content').blur(); 680 | } 681 | 682 | zss_editor.setCustomCSS = function(customCSS) { 683 | 684 | document.getElementsByTagName('style')[0].innerHTML=customCSS; 685 | 686 | //set focus 687 | /*editor.focusout(function(){ 688 | var element = $(this); 689 | if (!element.text().trim().length) { 690 | element.empty(); 691 | } 692 | });*/ 693 | } 694 | 695 | 696 | /// 以下方法为笔者新增 697 | zss_editor.e_insertImage = function(url, alt) { 698 | zss_editor.restorerange(); 699 | var html = '

图片发自eleven



'; 700 | zss_editor.insertHTML(html); 701 | zss_editor.enabledEditingItems(); 702 | } 703 | 704 | zss_editor.e_caculateHeight = function() { 705 | var height = document.body.offsetHeight; 706 | e_finishLoad(height); 707 | } 708 | 709 | zss_editor.e_setBlockquote = function() { 710 | var Range = document.getSelection().getRangeAt(0); 711 | formatName = Range.commonAncestorContainer.parentElement.nodeName === 'BLOCKQUOTE' ? 'DIV' : 'BLOCKQUOTE'; 712 | document.execCommand('formatBlock', false, formatName); 713 | zss_editor.insertHTML('

'); 714 | zss_editor.enabledEditingItems(); 715 | } 716 | 717 | zss_editor.e_imageClick = function() { 718 | console.log('点击图片...') 719 | zss_editor.blurEditor(); 720 | } 721 | 722 | //end 723 | -------------------------------------------------------------------------------- /ERichTextEditor/Classes/Library/ThirdPart/ContentEditSource/editor.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ZSSRichTextEditor 5 | 6 | 7 | 8 | 15 | 16 | 17 | 20 | 21 | 22 | 25 | 26 | 27 | 30 | 31 | 32 | 96 | 97 | 98 | 99 | 100 | 101 |
102 |
103 |
104 |
105 | 106 | 107 |
108 | 109 | 110 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /ERichTextEditor/Classes/Other/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ERichTextEditor 4 | // 5 | // Created by Eleven on 2018/7/29. 6 | // Copyright © 2018年 Eleven. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /ERichTextEditor/Classes/Other/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ERichTextEditor 4 | // 5 | // Created by Eleven on 2018/7/29. 6 | // Copyright © 2018年 Eleven. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | // Override point for customization after application launch. 21 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 22 | self.window.backgroundColor = [UIColor whiteColor]; 23 | [self.window makeKeyAndVisible]; 24 | 25 | if (@available(iOS 11.0, *)){ 26 | [[UIScrollView appearance] setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever]; 27 | } 28 | 29 | UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:[ViewController new]]; 30 | self.window.rootViewController = nav; 31 | 32 | return YES; 33 | } 34 | 35 | 36 | - (void)applicationWillResignActive:(UIApplication *)application { 37 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 38 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 39 | } 40 | 41 | 42 | - (void)applicationDidEnterBackground:(UIApplication *)application { 43 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 44 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 45 | } 46 | 47 | 48 | - (void)applicationWillEnterForeground:(UIApplication *)application { 49 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 50 | } 51 | 52 | 53 | - (void)applicationDidBecomeActive:(UIApplication *)application { 54 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 55 | } 56 | 57 | 58 | - (void)applicationWillTerminate:(UIApplication *)application { 59 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 60 | } 61 | 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /ERichTextEditor/Classes/View/ContentEditFooterView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ContentEditFooterView.h 3 | // KCWC 4 | // 5 | // Created by Eleven on 2018/2/8. 6 | // Copyright © 2018年 HAWK. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ERichTextEditorView, ERichTextToolBar; 12 | @interface ContentEditFooterView : UIView 13 | 14 | @property (nonatomic, copy) void (^pictureBlock)(void); 15 | @property (nonatomic, copy) void (^smileBlock)(void); 16 | @property (nonatomic, copy) void (^linkBlock)(void); 17 | @property (nonatomic, copy) void (^cancelBlock)(void); 18 | @property (nonatomic, copy) void (^tagBlock)(void); 19 | 20 | @property (nonatomic, strong) ERichTextToolBar *toolBar; 21 | 22 | - (instancetype)initWithFrame:(CGRect)frame editView:(ERichTextEditorView *)editView; 23 | 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /ERichTextEditor/Classes/View/ContentEditFooterView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ContentEditFooterView.m 3 | // KCWC 4 | // 5 | // Created by Eleven on 2018/2/8. 6 | // Copyright © 2018年 HAWK. All rights reserved. 7 | // 8 | 9 | #import "ContentEditFooterView.h" 10 | #import "ERichTextEditorView.h" 11 | 12 | static CGFloat const kFooterH = 44; 13 | 14 | @implementation ContentEditFooterView 15 | { 16 | UIView *_footerView; 17 | ERichTextEditorView *_editorView; 18 | } 19 | 20 | - (instancetype)initWithFrame:(CGRect)frame editView:(ERichTextEditorView *)editView { 21 | self = [super initWithFrame:frame]; 22 | if (self) { 23 | self.backgroundColor = HexColorInt32_t(f8f8f8); 24 | _editorView = editView; 25 | [self setupSubviws]; 26 | } 27 | return self; 28 | } 29 | 30 | - (void)setupSubviws { 31 | _footerView = ({ 32 | UIView *footerView = [[UIView alloc] initWithFrame:CGRectMake(0, self.bounds.size.height - kFooterH, SCREEN_WIDTH, kFooterH)]; 33 | [self addSubview:footerView]; 34 | 35 | NSArray *icons = @[@"icon_picture1", @"btn_smile", @"icon_Aa", @"icon_lianjie", @"icon_cexiao", @"icon_biaoq1"]; 36 | CGFloat width = SCREEN_WIDTH / icons.count; 37 | for (NSInteger i = 0; i < icons.count; i ++) { 38 | UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(i * width, self.bounds.size.height - kFooterH, width, kFooterH)]; 39 | [button setImage:EImageNamed(icons[i]) forState:UIControlStateNormal]; 40 | button.tag = 200 + i; 41 | [button addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside]; 42 | [footerView addSubview:button]; 43 | } 44 | 45 | UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 1)]; 46 | line.backgroundColor = HexColorInt32_t(e0e0e0); 47 | [footerView addSubview:line]; 48 | 49 | footerView; 50 | }); 51 | 52 | ERichTextToolBar *toolBar = [[ERichTextToolBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_HEIGHT, 44) editView:_editorView]; 53 | toolBar.hidden = YES; 54 | _toolBar = toolBar; 55 | [self addSubview:toolBar]; 56 | } 57 | 58 | - (void)click:(UIButton *)button { 59 | switch (button.tag - 200) { 60 | case 0: 61 | BLOCK_SAFE_RUN(self.pictureBlock); 62 | break; 63 | case 1: 64 | BLOCK_SAFE_RUN(self.smileBlock); 65 | break; 66 | case 2: 67 | { 68 | if (self.height == 44) { 69 | self.height += 44; 70 | self.y -= 44; 71 | _toolBar.hidden = NO; 72 | } else { 73 | self.height -= 44; 74 | self.y += 44; 75 | _toolBar.hidden = YES; 76 | } 77 | _footerView.y = self.height - kFooterH; 78 | } 79 | break; 80 | case 3: 81 | BLOCK_SAFE_RUN(self.linkBlock); 82 | break; 83 | case 4: 84 | [_editorView undo]; 85 | BLOCK_SAFE_RUN(self.cancelBlock); 86 | break; 87 | case 5: 88 | BLOCK_SAFE_RUN(self.tagBlock); 89 | break; 90 | default: 91 | break; 92 | } 93 | } 94 | 95 | @end 96 | -------------------------------------------------------------------------------- /ERichTextEditor/Classes/View/ERichTextEditorView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ERichTextEditorView.h 3 | // KCWC 4 | // 5 | // Created by Eleven on 2018/2/6. 6 | // Copyright © 2018年 HAWK. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ERichTextEditorView : UIView 12 | 13 | @property (nonatomic, strong) UIWebView *webView; 14 | @property (nonatomic, copy) void (^heightBlock)(CGFloat height); 15 | @property (nonatomic, copy) void (^scrollYOffset)(CGFloat offset); 16 | 17 | - (void)preloadedWithHTML:(NSString *)html; 18 | 19 | - (void)setBold; 20 | - (void)setItalic; 21 | - (void)setUnorderedList; 22 | - (void)setOrderedList; 23 | - (void)setBlockquote; 24 | - (void)setStrikethrough; 25 | - (void)setSelectedColor:(NSString *)hexColor; 26 | - (void)heading1; 27 | - (void)heading2; 28 | - (void)heading3; 29 | - (void)heading4; 30 | - (void)undo; 31 | 32 | /** 33 | 视图高度变化时,要及时设置高度 34 | 特别注意键盘的弹出与关闭 35 | 36 | @param contentHeight 显示区域高度 37 | */ 38 | - (void)setContentHeight:(float)contentHeight; 39 | 40 | /** 41 | 记录光标位置(需要调用相册功能时,要提前调用本方法) 42 | */ 43 | - (void)recordCursorPosition; 44 | /// 插入图片 45 | - (void)insertImage:(NSString *)url; 46 | - (NSString *)getHTML; 47 | 48 | @end 49 | 50 | 51 | @interface ERichTextToolBar : UIView 52 | 53 | - (instancetype)initWithFrame:(CGRect)frame editView:(ERichTextEditorView *)editView; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /ERichTextEditor/Classes/View/ERichTextEditorView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ERichTextEditorView.m 3 | // KCWC 4 | // 5 | // Created by Eleven on 2018/2/6. 6 | // Copyright © 2018年 HAWK. All rights reserved. 7 | // 8 | 9 | #import "ERichTextEditorView.h" 10 | #import 11 | 12 | static CGFloat const kItemWidth = 37.5; 13 | static CGFloat const kItemHeight = 44; 14 | 15 | @interface ERichTextEditorView () 16 | 17 | @property (nonatomic, strong) UIImagePickerController *imagePicker; 18 | @property (nonatomic, copy) NSString *imageBase64String; 19 | 20 | @end 21 | 22 | @implementation ERichTextEditorView 23 | 24 | #pragma mark - life cycle 25 | - (instancetype)initWithFrame:(CGRect)frame 26 | { 27 | self = [super initWithFrame:frame]; 28 | if (self) { 29 | [self setupSubviews]; 30 | 31 | } 32 | return self; 33 | } 34 | 35 | - (void)dealloc { 36 | 37 | } 38 | 39 | - (void)setupSubviews { 40 | UIWebView *webView = [[UIWebView alloc] initWithFrame:self.bounds]; 41 | webView.delegate = self; 42 | webView.scrollView.delegate = self; 43 | webView.keyboardDisplayRequiresUserAction = NO; 44 | webView.scalesPageToFit = YES; 45 | webView.dataDetectorTypes = UIDataDetectorTypeNone; 46 | webView.scrollView.bounces = NO; 47 | self.webView = webView; 48 | [self addSubview:webView]; 49 | 50 | NSString *path = [[NSBundle mainBundle] bundlePath]; 51 | NSURL *baseURL = [NSURL fileURLWithPath:path]; 52 | NSString *htmlPath = [[NSBundle mainBundle] pathForResource:@"editor" 53 | ofType:@"html"]; 54 | NSString *htmlCont = [NSString stringWithContentsOfFile:htmlPath 55 | encoding:NSUTF8StringEncoding 56 | error:nil]; 57 | [webView loadHTMLString:htmlCont baseURL:baseURL]; 58 | } 59 | 60 | #pragma mark - public methods 61 | - (void)preloadedWithHTML:(NSString *)html { 62 | html = [NSString stringWithFormat:@"zss_editor.setHTML(\"%@\");", html]; 63 | [self.webView stringByEvaluatingJavaScriptFromString:html]; 64 | } 65 | 66 | #pragma mark - set text 67 | - (void)setBold { 68 | NSString *trigger = @"zss_editor.setBold();"; 69 | [self.webView stringByEvaluatingJavaScriptFromString:trigger]; 70 | } 71 | 72 | - (void)setItalic { 73 | NSString *trigger = @"zss_editor.setItalic();"; 74 | [self.webView stringByEvaluatingJavaScriptFromString:trigger]; 75 | } 76 | 77 | - (void)setUnorderedList { 78 | NSString *trigger = @"zss_editor.setUnorderedList();"; 79 | [self.webView stringByEvaluatingJavaScriptFromString:trigger]; 80 | } 81 | 82 | - (void)setOrderedList { 83 | NSString *trigger = @"zss_editor.setOrderedList();"; 84 | [self.webView stringByEvaluatingJavaScriptFromString:trigger]; 85 | } 86 | 87 | - (void)setBlockquote { 88 | NSString *trigger = @"zss_editor.e_setBlockquote();"; 89 | [self.webView stringByEvaluatingJavaScriptFromString:trigger]; 90 | } 91 | 92 | - (void)setStrikethrough { 93 | NSString *trigger = @"zss_editor.setStrikeThrough();"; 94 | [self.webView stringByEvaluatingJavaScriptFromString:trigger]; 95 | } 96 | 97 | - (void)setSelectedColor:(NSString *)hexColor { 98 | NSString *trigger = [NSString stringWithFormat:@"zss_editor.setTextColor(\"%@\");", hexColor]; 99 | [self.webView stringByEvaluatingJavaScriptFromString:trigger]; 100 | } 101 | 102 | - (void)heading1 { 103 | NSString *trigger = @"zss_editor.setHeading('h1');"; 104 | [self.webView stringByEvaluatingJavaScriptFromString:trigger]; 105 | } 106 | 107 | - (void)heading2 { 108 | NSString *trigger = @"zss_editor.setHeading('h2');"; 109 | [self.webView stringByEvaluatingJavaScriptFromString:trigger]; 110 | } 111 | 112 | - (void)heading3 { 113 | NSString *trigger = @"zss_editor.setHeading('h3');"; 114 | [self.webView stringByEvaluatingJavaScriptFromString:trigger]; 115 | } 116 | 117 | - (void)heading4 { 118 | NSString *trigger = @"zss_editor.setHeading('h4');"; 119 | [self.webView stringByEvaluatingJavaScriptFromString:trigger]; 120 | } 121 | 122 | - (void)undo { 123 | NSString *trigger = @"zss_editor.undo();"; 124 | [self.webView stringByEvaluatingJavaScriptFromString:trigger]; 125 | } 126 | 127 | - (void)recordCursorPosition { 128 | NSString *trigger = @"zss_editor.prepareInsert();"; 129 | [self.webView stringByEvaluatingJavaScriptFromString:trigger]; 130 | } 131 | 132 | - (void)setContentHeight:(float)contentHeight { 133 | 134 | //Call the contentHeight javascript method 135 | NSString *js = [NSString stringWithFormat:@"zss_editor.contentHeight = %f;", contentHeight]; 136 | [self.webView stringByEvaluatingJavaScriptFromString:js]; 137 | 138 | } 139 | 140 | #pragma mark - Image 141 | - (void)insertImageBase64String:(NSString *)imageBase64String { 142 | NSString *trigger = [NSString stringWithFormat:@"zss_editor.insertImageBase64String(\"%@\");", imageBase64String]; 143 | [self.webView stringByEvaluatingJavaScriptFromString:trigger]; 144 | } 145 | 146 | - (void)updateImageBase64String:(NSString *)imageBase64String { 147 | NSString *trigger = [NSString stringWithFormat:@"zss_editor.updateImageBase64String(\"%@\");", imageBase64String]; 148 | [self.webView stringByEvaluatingJavaScriptFromString:trigger]; 149 | } 150 | 151 | - (void)insertImage:(NSString *)url { 152 | NSString *trigger = [NSString stringWithFormat:@"zss_editor.e_insertImage(\"%@\");", url]; 153 | [self.webView stringByEvaluatingJavaScriptFromString:trigger]; 154 | } 155 | 156 | - (void)updateImage:(NSString *)url { 157 | NSString *trigger = [NSString stringWithFormat:@"zss_editor.updateImage(\"%@\");", url]; 158 | [self.webView stringByEvaluatingJavaScriptFromString:trigger]; 159 | } 160 | 161 | #pragma mark - export html 162 | - (NSString *)getHTML { 163 | NSString *html = [self.webView stringByEvaluatingJavaScriptFromString:@"zss_editor.getHTML();"]; 164 | html = [self removeQuotesFromHTML:html]; 165 | html = [self tidyHTML:html]; 166 | return html; 167 | } 168 | 169 | - (NSString *)removeQuotesFromHTML:(NSString *)html { 170 | html = [html stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""]; 171 | html = [html stringByReplacingOccurrencesOfString:@"“" withString:@"""]; 172 | html = [html stringByReplacingOccurrencesOfString:@"”" withString:@"""]; 173 | html = [html stringByReplacingOccurrencesOfString:@"\r" withString:@"\\r"]; 174 | html = [html stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"]; 175 | return html; 176 | } 177 | 178 | - (NSString *)tidyHTML:(NSString *)html { 179 | html = [html stringByReplacingOccurrencesOfString:@"
" withString:@"
"]; 180 | html = [html stringByReplacingOccurrencesOfString:@"
" withString:@"
"]; 181 | // if (self.formatHTML) { 182 | html = [self.webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"style_html(\"%@\");", html]]; 183 | // } 184 | return html; 185 | } 186 | 187 | #pragma mark - UIWebViewDelegate 188 | - (void)webViewDidFinishLoad:(UIWebView *)webView { 189 | NSLog(@"加载完毕!"); 190 | 191 | JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"]; 192 | @weakify(self); 193 | 194 | context[@"e_finishLoad"] = ^(CGFloat height) { 195 | @strongify(self); 196 | 197 | }; 198 | 199 | [self setContentHeight:webView.bounds.size.height]; 200 | } 201 | 202 | #pragma mark - UIScrollViewDelegate 203 | //- (UIView*)viewForZoomingInScrollView:(UIScrollView*)scrollView { 204 | // NSLog(@"%f", scrollView.contentOffset.y); 205 | // return nil; 206 | //} 207 | 208 | #pragma mark - getter 209 | 210 | 211 | 212 | @end 213 | 214 | 215 | 216 | @interface ERichTextToolBar () 217 | 218 | @property (nonatomic, strong) ERichTextEditorView *editView; 219 | @property (nonatomic, strong) UIScrollView *scrollView; 220 | @property (nonatomic, strong) UIView *colorBoardView; 221 | @property (nonatomic, strong) UIScrollView *colorScrollView; 222 | @property (nonatomic, strong) NSArray *colorsValue; 223 | 224 | @property (nonatomic, copy) NSString *imageBase64String; 225 | 226 | @end 227 | 228 | @implementation ERichTextToolBar 229 | 230 | - (instancetype)initWithFrame:(CGRect)frame editView:(ERichTextEditorView *)editView 231 | { 232 | self = [super initWithFrame:frame]; 233 | if (self) { 234 | _editView = editView; 235 | self.backgroundColor = HexColorInt32_t(f8f8f8); 236 | [self setupToolBar]; 237 | [self setupColorBoard]; 238 | } 239 | return self; 240 | } 241 | 242 | - (void)setupToolBar { 243 | UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:self.bounds]; 244 | scrollView.showsHorizontalScrollIndicator = NO; 245 | self.scrollView = scrollView; 246 | [self addSubview:scrollView]; 247 | 248 | NSArray *icons = @[@"icon_jiacu", @"icon_qingx", @"icon_lieb", @"icon_lieb3", @"icon_yinyong", @"icon_shanc", @"icon_yanse", @"icon_H1", @"icon_H2", @"icon_H3", @"icon_H4"]; 249 | for (NSInteger i = 0; i < icons.count; i ++) { 250 | UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(kItemWidth * i, 0, kItemWidth, kItemHeight)]; 251 | [button setImage:EImageNamed(icons[i]) forState:UIControlStateNormal]; 252 | button.tag = 500 + i; 253 | [button addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside]; 254 | [scrollView addSubview:button]; 255 | } 256 | scrollView.contentSize = CGSizeMake(icons.count * kItemWidth, kItemHeight); 257 | if (icons.count * kItemWidth > SCREEN_WIDTH) { 258 | UIButton *nextBtn = [[UIButton alloc] initWithFrame:CGRectMake(SCREEN_WIDTH - kItemWidth, 0, kItemWidth, kItemHeight)]; 259 | [nextBtn setImage:EImageNamed(@"icon_arrow") forState:UIControlStateNormal]; 260 | [nextBtn addTarget:self action:@selector(nextClick) forControlEvents:UIControlEventTouchUpInside]; 261 | [self addSubview:nextBtn]; 262 | UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, 8, 1, 28)]; 263 | line.backgroundColor = HexColorInt32_t(e0e0e0); 264 | [nextBtn addSubview:line]; 265 | scrollView.width = SCREEN_WIDTH - kItemWidth; 266 | } 267 | 268 | UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 1)]; 269 | line.backgroundColor = HexColorInt32_t(e0e0e0); 270 | [self addSubview:line]; 271 | } 272 | 273 | - (void)setupColorBoard { 274 | UIView *colorBoardView = [[UIView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH, 0, SCREEN_WIDTH, kItemHeight)]; 275 | colorBoardView.backgroundColor = self.backgroundColor; 276 | self.colorBoardView = colorBoardView; 277 | [self addSubview:colorBoardView]; 278 | 279 | UIScrollView *colorScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH - kItemWidth, kItemHeight)]; 280 | colorScrollView.showsHorizontalScrollIndicator = NO; 281 | self.colorScrollView = colorScrollView; 282 | [colorBoardView addSubview:colorScrollView]; 283 | 284 | NSArray *colorsValue = @[@"#636363", @"#d0d0d0", @"#ff583d", @"#fdaa26", @"#44c77b", @"#14b2e1", @"#b066e3"]; 285 | self.colorsValue = colorsValue; 286 | CGFloat width = (SCREEN_WIDTH - kItemWidth) / colorsValue.count; 287 | for (NSInteger i = 0; i < colorsValue.count; i ++) { 288 | UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(width * i, 0, width, kItemHeight)]; 289 | button.tag = 600 + i; 290 | [button addTarget:self action:@selector(colorClick:) forControlEvents:UIControlEventTouchUpInside]; 291 | [colorScrollView addSubview:button]; 292 | 293 | UIView *colorView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 15, 15)]; 294 | colorView.userInteractionEnabled = NO; 295 | colorView.layer.cornerRadius = 7.5; 296 | colorView.layer.masksToBounds = YES; 297 | colorView.backgroundColor = [UIColor hexColor:colorsValue[i]]; 298 | colorView.centerX = width * 0.5; 299 | colorView.centerY = kItemHeight * 0.5; 300 | [button addSubview:colorView]; 301 | } 302 | colorScrollView.contentSize = CGSizeMake(colorsValue.count * width, kItemHeight); 303 | 304 | UIButton *returnBtn = [[UIButton alloc] initWithFrame:CGRectMake(SCREEN_WIDTH - kItemWidth, 0, kItemWidth, kItemHeight)]; 305 | [returnBtn setImage:EImageNamed(@"icon_return") forState:UIControlStateNormal]; 306 | [returnBtn addTarget:self action:@selector(returnBack) forControlEvents:UIControlEventTouchUpInside]; 307 | [colorBoardView addSubview:returnBtn]; 308 | UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, 8, 1, 28)]; 309 | line.backgroundColor = HexColorInt32_t(e0e0e0); 310 | [returnBtn addSubview:line]; 311 | 312 | UIView *topLine = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 1)]; 313 | topLine.backgroundColor = HexColorInt32_t(e0e0e0); 314 | [colorBoardView addSubview:topLine]; 315 | } 316 | 317 | #pragma mark - event response 318 | - (void)nextClick { 319 | CGPoint offset = CGPointMake(self.scrollView.contentOffset.x, 0); 320 | CGFloat maxOffsetX = self.scrollView.contentSize.width - (SCREEN_WIDTH - kItemWidth); 321 | if (offset.x >= maxOffsetX) return; 322 | if (offset.x + kItemWidth > maxOffsetX) { 323 | offset.x = maxOffsetX; 324 | } else { 325 | offset.x += kItemWidth; 326 | } 327 | [self.scrollView setContentOffset:offset animated:YES]; 328 | } 329 | 330 | - (void)buttonClick:(UIButton *)button { 331 | NSArray *methodsName = @[NSStringFromSelector(@selector(setBold)), 332 | NSStringFromSelector(@selector(setItalic)), 333 | NSStringFromSelector(@selector(setUnorderedList)), 334 | NSStringFromSelector(@selector(setOrderedList)), 335 | NSStringFromSelector(@selector(setBlockquote)), 336 | NSStringFromSelector(@selector(setStrikethrough)), 337 | NSStringFromSelector(@selector(showColorBoard)), 338 | NSStringFromSelector(@selector(heading1)), 339 | NSStringFromSelector(@selector(heading2)), 340 | NSStringFromSelector(@selector(heading3)), 341 | NSStringFromSelector(@selector(heading4))]; 342 | SEL method = NSSelectorFromString(methodsName[button.tag - 500]); 343 | if ([self.editView respondsToSelector:method]) { 344 | [self.editView performSelector:method]; 345 | } 346 | if ([self respondsToSelector:method]) { 347 | [self performSelector:method]; 348 | } 349 | } 350 | 351 | - (void)colorClick:(UIButton *)button { 352 | [self.editView recordCursorPosition]; 353 | [self.editView setSelectedColor:self.colorsValue[button.tag - 600]]; 354 | } 355 | 356 | - (void)showColorBoard { 357 | [UIView animateWithDuration:0.25 animations:^{ 358 | self.colorBoardView.x = 0; 359 | }]; 360 | } 361 | 362 | - (void)returnBack { 363 | [UIView animateWithDuration:0.1 animations:^{ 364 | self.colorBoardView.x = SCREEN_WIDTH; 365 | }]; 366 | } 367 | 368 | 369 | @end 370 | -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/btn_smile.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "btn_smile@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "btn_smile@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/btn_smile.imageset/btn_smile@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/btn_smile.imageset/btn_smile@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/btn_smile.imageset/btn_smile@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/btn_smile.imageset/btn_smile@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/btn_smile2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "btn_smile2@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "btn_smile2@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/btn_smile2.imageset/btn_smile2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/btn_smile2.imageset/btn_smile2@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/btn_smile2.imageset/btn_smile2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/btn_smile2.imageset/btn_smile2@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_Aa.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_Aa@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_Aa@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_Aa.imageset/icon_Aa@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_Aa.imageset/icon_Aa@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_Aa.imageset/icon_Aa@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_Aa.imageset/icon_Aa@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_Aa_1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_Aa_1@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_Aa_1@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_Aa_1.imageset/icon_Aa_1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_Aa_1.imageset/icon_Aa_1@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_Aa_1.imageset/icon_Aa_1@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_Aa_1.imageset/icon_Aa_1@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_H1@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_H1@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H1.imageset/icon_H1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H1.imageset/icon_H1@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H1.imageset/icon_H1@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H1.imageset/icon_H1@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H1_1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_H1_1@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_H1_1@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H1_1.imageset/icon_H1_1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H1_1.imageset/icon_H1_1@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H1_1.imageset/icon_H1_1@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H1_1.imageset/icon_H1_1@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_H2@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_H2@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H2.imageset/icon_H2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H2.imageset/icon_H2@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H2.imageset/icon_H2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H2.imageset/icon_H2@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H2_1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_H2_1@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_H2_1@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H2_1.imageset/icon_H2_1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H2_1.imageset/icon_H2_1@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H2_1.imageset/icon_H2_1@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H2_1.imageset/icon_H2_1@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_H3@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_H3@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H3.imageset/icon_H3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H3.imageset/icon_H3@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H3.imageset/icon_H3@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H3.imageset/icon_H3@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H3_1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_H3_1@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_H3_1@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H3_1.imageset/icon_H3_1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H3_1.imageset/icon_H3_1@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H3_1.imageset/icon_H3_1@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H3_1.imageset/icon_H3_1@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_H4@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_H4@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H4.imageset/icon_H4@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H4.imageset/icon_H4@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H4.imageset/icon_H4@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H4.imageset/icon_H4@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H4_1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_H4_1@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_H4_1@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H4_1.imageset/icon_H4_1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H4_1.imageset/icon_H4_1@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H4_1.imageset/icon_H4_1@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_H4_1.imageset/icon_H4_1@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_arrow.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "qj@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "qj@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_arrow.imageset/qj@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_arrow.imageset/qj@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_arrow.imageset/qj@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_arrow.imageset/qj@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_biaoq1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_biaoq@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_biaoq@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_biaoq1.imageset/icon_biaoq@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_biaoq1.imageset/icon_biaoq@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_biaoq1.imageset/icon_biaoq@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_biaoq1.imageset/icon_biaoq@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_biaoq2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_biaoq2@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_biaoq2@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_biaoq2.imageset/icon_biaoq2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_biaoq2.imageset/icon_biaoq2@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_biaoq2.imageset/icon_biaoq2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_biaoq2.imageset/icon_biaoq2@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_cexiao.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_cexiao@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_cexiao@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_cexiao.imageset/icon_cexiao@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_cexiao.imageset/icon_cexiao@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_cexiao.imageset/icon_cexiao@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_cexiao.imageset/icon_cexiao@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_cexiao2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_cexiao2@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_cexiao2@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_cexiao2.imageset/icon_cexiao2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_cexiao2.imageset/icon_cexiao2@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_cexiao2.imageset/icon_cexiao2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_cexiao2.imageset/icon_cexiao2@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_jiacu.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_jiacu@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_jiacu@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_jiacu.imageset/icon_jiacu@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_jiacu.imageset/icon_jiacu@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_jiacu.imageset/icon_jiacu@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_jiacu.imageset/icon_jiacu@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_jiacu2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_jiacu2@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_jiacu2@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_jiacu2.imageset/icon_jiacu2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_jiacu2.imageset/icon_jiacu2@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_jiacu2.imageset/icon_jiacu2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_jiacu2.imageset/icon_jiacu2@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lianjie.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_lianjie@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_lianjie@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lianjie.imageset/icon_lianjie@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lianjie.imageset/icon_lianjie@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lianjie.imageset/icon_lianjie@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lianjie.imageset/icon_lianjie@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lianjie2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_lianjie2@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_lianjie2@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lianjie2.imageset/icon_lianjie2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lianjie2.imageset/icon_lianjie2@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lianjie2.imageset/icon_lianjie2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lianjie2.imageset/icon_lianjie2@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_lieb@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_lieb@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb.imageset/icon_lieb@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb.imageset/icon_lieb@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb.imageset/icon_lieb@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb.imageset/icon_lieb@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_lieb2@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_lieb2@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb2.imageset/icon_lieb2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb2.imageset/icon_lieb2@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb2.imageset/icon_lieb2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb2.imageset/icon_lieb2@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_lieb3@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_lieb3@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb3.imageset/icon_lieb3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb3.imageset/icon_lieb3@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb3.imageset/icon_lieb3@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb3.imageset/icon_lieb3@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_lieb4@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_lieb4@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb4.imageset/icon_lieb4@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb4.imageset/icon_lieb4@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb4.imageset/icon_lieb4@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_lieb4.imageset/icon_lieb4@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_picture1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_picture@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_picture@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_picture1.imageset/icon_picture@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_picture1.imageset/icon_picture@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_picture1.imageset/icon_picture@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_picture1.imageset/icon_picture@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_picture2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_picture2@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_picture2@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_picture2.imageset/icon_picture2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_picture2.imageset/icon_picture2@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_picture2.imageset/icon_picture2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_picture2.imageset/icon_picture2@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_qingx.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_qingx@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_qingx@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_qingx.imageset/icon_qingx@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_qingx.imageset/icon_qingx@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_qingx.imageset/icon_qingx@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_qingx.imageset/icon_qingx@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_qingx2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_qingx2@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_qingx2@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_qingx2.imageset/icon_qingx2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_qingx2.imageset/icon_qingx2@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_qingx2.imageset/icon_qingx2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_qingx2.imageset/icon_qingx2@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_return.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_return@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_return@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_return.imageset/icon_return@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_return.imageset/icon_return@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_return.imageset/icon_return@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_return.imageset/icon_return@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_shanc.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_shanc@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_shanc@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_shanc.imageset/icon_shanc@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_shanc.imageset/icon_shanc@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_shanc.imageset/icon_shanc@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_shanc.imageset/icon_shanc@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_shanc2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_shanc2@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_shanc2@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_shanc2.imageset/icon_shanc2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_shanc2.imageset/icon_shanc2@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_shanc2.imageset/icon_shanc2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_shanc2.imageset/icon_shanc2@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yanse.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_yanse@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_yanse@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yanse.imageset/icon_yanse@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yanse.imageset/icon_yanse@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yanse.imageset/icon_yanse@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yanse.imageset/icon_yanse@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yanse2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_yanse2@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_yanse2@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yanse2.imageset/icon_yanse2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yanse2.imageset/icon_yanse2@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yanse2.imageset/icon_yanse2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yanse2.imageset/icon_yanse2@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yinyong.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_yinyong@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_yinyong@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yinyong.imageset/icon_yinyong@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yinyong.imageset/icon_yinyong@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yinyong.imageset/icon_yinyong@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yinyong.imageset/icon_yinyong@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yinyong2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_yinyong2@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_yinyong2@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yinyong2.imageset/icon_yinyong2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yinyong2.imageset/icon_yinyong2@2x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yinyong2.imageset/icon_yinyong2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HawkEleven/ERichTextEditor/6946fade9b2ec7f92d643525c7b3b794a35c4753/ERichTextEditor/Supporting Files/Assets.xcassets/文本设置/icon_yinyong2.imageset/icon_yinyong2@3x.png -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSAppTransportSecurity 6 | 7 | NSAllowsArbitraryLoads 8 | 9 | 10 | CFBundleDevelopmentRegion 11 | $(DEVELOPMENT_LANGUAGE) 12 | CFBundleExecutable 13 | $(EXECUTABLE_NAME) 14 | CFBundleIdentifier 15 | $(PRODUCT_BUNDLE_IDENTIFIER) 16 | CFBundleInfoDictionaryVersion 17 | 6.0 18 | CFBundleName 19 | $(PRODUCT_NAME) 20 | CFBundlePackageType 21 | APPL 22 | CFBundleShortVersionString 23 | 1.0 24 | CFBundleVersion 25 | 1 26 | LSRequiresIPhoneOS 27 | 28 | UILaunchStoryboardName 29 | LaunchScreen 30 | UIMainStoryboardFile 31 | Main 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | 40 | UISupportedInterfaceOrientations~ipad 41 | 42 | UIInterfaceOrientationPortrait 43 | UIInterfaceOrientationPortraitUpsideDown 44 | UIInterfaceOrientationLandscapeLeft 45 | UIInterfaceOrientationLandscapeRight 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /ERichTextEditor/Supporting Files/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ERichTextEditor 4 | // 5 | // Created by Eleven on 2018/7/29. 6 | // Copyright © 2018年 Eleven. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #### 导语 2 | 3 | > 本方案参考 **[ZSSRichTextEditor](https://github.com/nnhubbard/ZSSRichTextEditor)**,使用**UIWebView**实现富文本形式的图文混编。笔者对部分常用设置进行封装,如:设置字体大小、颜色、样式等。 4 | 5 | ![效果图.png](https://upload-images.jianshu.io/upload_images/1338824-aee6f15621d0d5d0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 6 | 7 | 8 | ### 介绍 9 | 10 | 资源文件 | 说明 11 | ---- | ---- 12 | ZSSRichTextEditor.js | 文本及图片的设置 13 | editor.html | 模板 14 | 15 | 封装文件 | 说明 16 | ---- | ---- 17 | ERichTextEditorView | 对JS方法进行封装 18 | ContentEditFooterView | 底部视图 19 | ERichTextToolBar | 常规设置视图 20 | 21 | **字体的常规设置:** 22 | 23 | - (void)setBold; 24 | - (void)setItalic; 25 | - (void)setUnorderedList; 26 | - (void)setOrderedList; 27 | - (void)setBlockquote; 28 | - (void)setStrikethrough; 29 | - (void)setSelectedColor:(NSString *)hexColor; 30 | - (void)heading1; 31 | - (void)heading2; 32 | - (void)heading3; 33 | - (void)heading4; 34 | - (void)undo; 35 | 36 | ### 结尾 37 | 38 | 若大家有其他需求可以在**ERichTextEditorView**基础上进行拓展添加,欢迎star~ --------------------------------------------------------------------------------