Code Monkey home page Code Monkey logo

richeditorview's Introduction

richeditorview's People

Contributors

ccwasden avatar cjwirth avatar halilb avatar jesiegel1 avatar mfrawley avatar shizunaito avatar steviemo avatar stranfb avatar wirthcaesar avatar zummenix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

richeditorview's Issues

editor view's web view doesn't retrieve image file from Documents folder

Hi,
this might not be directly related to this framework, but maybe someone can give me a hint to the right direction to take for solving this problem.

When I try to insert an image like so:
toolbar.editor!.insertImage(fileURL.absoluteString, alt: "new image")

all works fine.

The image data is written to a file in the documents folder and then the refreshed html contains the image tag with the image path.

However, after I stop the simulator and restart it, the image can't be loaded into the html of the editor's web view properly.

See the screenshots below. The image tag in the html looks like this
image

I have checked in the finder that the file is there... it has been saved indeed. doesn't matter if I convert the ui image to jpg or to png.
The weird thing is that when creating the the file, the web view has to update as well and retrieve the file from the documents folder. Otherwise it wouldn't show.... the html string is properly retrieved from core data, otherwise there would not be any text with html text attributes.

screen shot 2016-05-13 at 17 10 06

screen shot 2016-05-13 at 17 08 37

Change of background color

Hello,
I am pretty desperate. I just can't figure out how can I change background color of webview. It is white, I want a clear color.

Other font

Is there any change of using any other than default font with RichEditView?

Cant share word from RichEditorView

Hello.

When I try to use "share" button from context menu(long tap on the any word) and choose Twitter or Messages and tap on Cancel button on Share Controller - I cant can no longer interact with application.
I tried to disable share button by creating UIWebView child with canPerformAction method that returns false but it doesn't work too.

How can I disable button or fix this behaviour?

hbnvfbbjoik

RichEditorView can't show text

use the editor.setHTML function can't show the text from server, but can show the text in form just like in the readme text, it's weird, did I miss something??

Setting background transparent not working

I tried to set the background to a clear color using this code:

override func viewDidLoad() {
        super.viewDidLoad()

        headerLabel.text = data.header
        contentTextView.editingEnabled = false
        contentTextView.delegate = self
        contentTextView.setHTML(data.content)
    }

func richEditorDidLoad(editor: RichEditorView) {
        contentTextView.backgroundColor = UIColor.clearColor()
        contentTextView.webView.backgroundColor = UIColor.clearColor()
        contentTextView.webView.opaque = false
        contentTextView.inputAccessoryView?.backgroundColor = UIColor.clearColor()
    }

But after appearing the view looks like this:
simulator screen shot 09 may 2016 17 31 29

If i rotate the view and rotate it back the view looks correct like this:
simulator screen shot 09 may 2016 17 31 33

Seems like it is some kind of redraw error! Any combination of setNeedsToDisplay() and layoutIfNeeded() did not work.

The HTML code:
<h1 style="color: rgb(256, 0, 0);"><font size="3"><span style="font-weight: normal; -webkit-text-size-adjust: 100%;">Simply press the</span><span style="-webkit-text-size-adjust: 100%;"> + </span><span style="font-weight: normal; -webkit-text-size-adjust: 100%;">button in the main view and a new recipe base on the default template will be created!</span></font></h1>

Any idea why webview is acting like this?

Objective-C Support

The component is great and awesome and it's a breeze to use in Swift.

However, I faced with a problem while adding it to existing objective-с class - I can't make Xcode see the corresponding class.

If I just use the @class directive, the complier says it's a forward class declaration.

I suspect that we just can't use this great library in Objective-C which is a huge downside. Am I wrong?

hello.

Hi.
If I want to use in OC.
What should I do ?
Can you give some hints?
Thank you very much.
Good luck to you!

I can't textColor by using `setTextColor`

I have called RichEditorView.setTextColor on richEditorDidLoad.

When it call I have passed redColor, but text color is still grayColor?
How can I change it?

And can you add method to set font family, line-height for customized style in your style.css, ...?
It is very difficult to customize css.

Placeholder doesn't disappear.

When I click orderedList, placeholder still appears.(without any character)
Only when I input any character, it disappears.

WKWebView?

At some point Apple will drop support for UIWebView. Are there any reasons why this component can't use WKWebView currently?

Can't specify a baseURL?

Hello

I'm trying to load a local image into the webview that image using a relative path. But I cannot find a way to specify a baseURL :( Any idea?

Add option to change toolbar tintColor

i want to use my picture to replace the picture at your project. such as bold,undo. i delete your picture and insert my own picture. it does not work. why?

REV toolbar appears for other input views

I have a problem. I have a text field above a REV and when I click on REV, than on my text field, the REV panel is still showing above the keyboard. Is there a way how to lost focus of REV and dissapear of REV panel?

Done button

Is there a way how can I add a Done button to REV? I mean if you type on UITextField, the original Apple keyboard shows up and there is a done button in right down corner. But REV has only return.

How to pre-set HTML

Hi there,

First off, I wanted to thank you for your fantastic work and dedication to this project and for being incredibly active! I couldn't have been happier to find RichEditorView as I have been looking for a more updated version of the original ZSSRichTextEditor for some time.

My problem:
I want to set the HTML of my REV on initialization so that it opens with the HTML already set (passed in from another VC).

My setup is as follows:
I have a VC that manages the entire parent view (with some additional UI/actions) and an embedded container view that has it's own VC whose responsibility is to manage the actual REV.

Parent VC (Obj-C):

@property (strong, nonatomic) LessonViewController *lessonViewController;
- (void)prepareForSegue { // embedSegue
    ...
    self.lessonViewController = (LessonViewController *)segue.destinationViewController;
    self.lessonViewController.lessonContents = self.lesson.contents; // where lesson is a data model

REV VC (Swift):

@objc public class LessonViewController: UIViewController {
    @IBOutlet weak var editorView: RichEditorView!
    public var lessonContents: String = "" {
        didSet {
            editorView.setHTML(lessonContents)
        }

This causes an unexpectedly found nil while unwrapping an Optional value. Doing some debugging, it turns out that in the didSet, the editorView is nil at that moment. I'm not sure why that is (the outlet is properly hooked up in IB). I've also tried calling editorView.setHTML() in a separate method and not in the didSet { } but I run into the same issue.

Any insight would be greatly appreciated, and perhaps you have another way you'd recommend pre-setting the HTML of REV before it opens, with the HTML being passed in from a different VC.

Auto-suggest with @usernames and #hashtags

I'd like the user to be able to enter HTML text (actually just Bold and Italic), and @usernames and #hashtags - with the @usernames and #hashtags autosuggested underneath the text-entry.

There are a number of third-party libraries which help with this:
https://github.com/arsonic/AVTagTextView
https://github.com/AdamBCo/ABCAutoCompleteTextView
https://github.com/Mazyod/MJAutoComplete

(all objective-c)

@cjwirth - would you recommend trying to meld RichEditorView with one of these libraries, or is it something that could be added to RichEditorView?

Focus RichEditorView when view is tapped

How can I take a focus when I click on the REV window? For now, I can write to REV input view only if I click on the first row. I want to take a focus (start writing) after I click anywhere on the input view of REV.

Thanks for help.

Question: Is there a reason clipsToBounds is set to false on the scrollView?

In the setup function for the RichEditorView class, the scrollView has its clipsToBounds property set to false:

https://github.com/cjwirth/RichEditorView/blob/master/RichEditorView/Classes/RichEditorView.swift#L153

This causes a problem for my particular usage of the RichEditorView. It causes the content in the editor to scroll over other controls I have in my view. If I set it to false it "fixes" the issue.

I'm not experienced enough with Swift/iOS programming to know if this will cause bizarre and unpredictable effects on other aspects of the RichEditorView. It seems to work fine, but I was curious if there was a larger reason to set clipsToBounds to false.

Toolbar isn't a proper accessory

Since the RichEditorToolbar isn't an accessory view to UIWebView (a really annoying problem; "Hacking Accessory Hiding" reference), the toolbar will overlap onto the editing view.

Find new way to hide default keyboard toolbar

The relatively common technique of hiding UIWebView's input accessory view that we are using in CJWWebView+HackishAccessoryHiding.m is most definitely a horrible piece of code. Not only that but recently it has been getting apps rejected from the app store which is an outcome nobody wants.

Look into seeing if there is a better way to hide and/or cover up the input accessory view. Maybe this means upgrading to WKWebView, I don't really know.

This is a bad, brittle, dangerous piece of code, and I would really like to get it out of the codebase.

i want to use the richTextView to replace the funtion of UITextView to show HTML string

i want to use the richTextView to replace the funtion of UITextView to show HTML string . After i set HTML string to richTextView,how could i get the textView height? if the HTML string contain remote image, will the height be calculate correct? i

public private(set) var editorHeight: Int = 0 {
        didSet {
            delegate?.richEditor?(self, heightDidChange: editorHeight)
        }
    }

will this method working ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.