xam-consulting / teditor Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I have some cases where I have a large HTML string (base 64 in line images). When I have that case, I experience the TransactionTooLargeException.
I believe this has to do with the Activity / PutExtra on a large string (near/over 1 MB).
Has anyone else experienced this? Any tips / workarounds? I have the least amount of control over what is in the HTML (vendor user content). But anything I can do to how I'm using the control? Or would this be a change to the Android implementation / use of PutExtra?
Thoughts / suggestions appreciated.
There should be a property to set Title instead of the hardcoding 'HTML Editor'.
I'm able to present the TE control fine via a Xamarin Forms Page that was that was "Pushed" on the Navigation stack. However, I run into issues if the page that I'm trying to present the control from was a modal, the control will not present. The app doesn't crash either. I've tried both the sample application as well as consuming the nuget package in a simple application.
Steps to Reproduce:
public class App : Application
{
public App()
{
this.MainPage = new NavigationPage(new SecondPage());
}
public SecondPage()
{
var nextButton = new Button { Text = "Next Page" };
Content = new StackLayout
{
Children = { nextButton}
};
var contentPage = new ContentPage { Content = new TEditorHtmlView(), BackgroundColor = Color.White };
nextButton.Clicked += (object sender, EventArgs e) => { Navigation.PushModalAsync(contentPage); };
}
Launching the sample application and removing a few characters in editor results in:
NSInternalInconsistencyException Reason: impossible to set up layout with view hierarchy unprepared for constraint.
Hello,
Very nice editor implementation for sure.
Sorry for my noob question. I'm trying to create a custom icon/toolbaritem. What I cant figure out is how to override the custclick. I want to use the editor to allow other formatting thats not covered in the standard one.
var toolbar = new ToolbarBuilder().AddAll();
var myCustomItem = new TEditorToolbarItem { Label = "blank", ImagePath = "blank.png"};
toolbar.Add(myCustomItem);
and how to get it to execute any custom javascript inside the original zss editor.
ClickFunc = (input) =>
{
input.Paragraph(); //Run my custom java thing here
return string.Empty;
}
and
public void Paragraph() //or my custom function/and java here.
{
string trigger = @"zss_editor.setParagraph();";
_javaScriptEvaluatFunc.Invoke(trigger);
}
Any direction or help is appreciated.
Thanks.
Brent
I'm trying to add TEditor to my Xamarin application (not using Xamarin.Forms) and when calling the
await CrossTEditor.Current.ShowTEditor it's giving me this error:
System.Exception: Could not initialize an instance of the type 'UIKit.UIImage': the native 'initWithContentsOfFile:' method returned nil.
It is possible to ignore this condition by setting MonoTouch.ObjCRuntime.Class.ThrowOnInitFailure to false.
at Foundation.NSObject.InitializeHandle (IntPtr handle, System.String initSelector) [0x00094] in /Users/builder/data/lanes/3234/d8bedd03/source/maccore/src/Foundation/NSObject2.cs:453
at UIKit.UIImage..ctor (System.String filename) [0x0002e] in /Users/builder/data/lanes/3234/d8bedd03/source/maccore/src/build/ios/native/UIKit/UIImage.g.cs:94
at PopColorPicker.iOS.PopColorPickerViewController.SetViewControllers () [0x00000] in C:\Users\Michael\Documents\TEditor\PopColorPicker.iOS.Shared\PopColorPickerViewController.cs:112
at PopColorPicker.iOS.PopColorPickerViewController.ViewDidLoad () [0x0007d] in C:\Users\Michael\Documents\TEditor\PopColorPicker.iOS.Shared\PopColorPickerViewController.cs:80
at (wrapper managed-to-native) ObjCRuntime.Messaging:IntPtr_objc_msgSendSuper (intptr,intptr)
at UIKit.UITabBarController..ctor () [0x0003b] in /Users/builder/data/lanes/3234/d8bedd03/source/maccore/src/build/ios/native/UIKit/UITabBarController.g.cs:53
at PopColorPicker.iOS.PopColorPickerViewController..ctor () [0x00000] in C:\Users\Michael\Documents\TEditor\PopColorPicker.iOS.Shared\PopColorPickerViewController.cs:19
at TEditor.TEditorViewController.AddColorPickerControl () [0x00000] in C:\Users\Michael\Documents\TEditor\iOS\Controls\TEditorViewController.cs:111
at TEditor.TEditorViewController.ViewDidLoad () [0x00018] in C:\Users\Michael\Documents\TEditor\iOS\Controls\TEditorViewController.cs:245
at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3234/d8bedd03/source/maccore/src/UIKit/UIApplication.cs:77
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/3234/d8bedd03/source/maccore/src/UIKit/UIApplication.cs:61
at TiendaNubeIOS.Application.Main (System.String[] args) [0x00008] in /Users/juane/mobile-apps/TIendaNubeIOS/Main.cs:13
2017-05-31 17:57:22.024 TiendaNubeIOS[31327:4189271] Unhandled managed exception:
Could not initialize an instance of the type 'UIKit.UIImage': the native 'initWithContentsOfFile:' method returned nil.
It is possible to ignore this condition by setting MonoTouch.ObjCRuntime.Class.ThrowOnInitFailure to false. (System.Exception)
at Foundation.NSObject.InitializeHandle (IntPtr handle, System.String initSelector) [0x00094] in /Users/builder/data/lanes/3234/d8bedd03/source/maccore/src/Foundation/NSObject2.cs:453
at UIKit.UIImage..ctor (System.String filename) [0x0002e] in /Users/builder/data/lanes/3234/d8bedd03/source/maccore/src/build/ios/native/UIKit/UIImage.g.cs:94
at PopColorPicker.iOS.PopColorPickerViewController.SetViewControllers () [0x00000] in C:\Users\Michael\Documents\TEditor\PopColorPicker.iOS.Shared\PopColorPickerViewController.cs:112
at PopColorPicker.iOS.PopColorPickerViewController.ViewDidLoad () [0x0007d] in C:\Users\Michael\Documents\TEditor\PopColorPicker.iOS.Shared\PopColorPickerViewController.cs:80
at (wrapper managed-to-native) ObjCRuntime.Messaging:IntPtr_objc_msgSendSuper (intptr,intptr)
at UIKit.UITabBarController..ctor () [0x0003b] in /Users/builder/data/lanes/3234/d8bedd03/source/maccore/src/build/ios/native/UIKit/UITabBarController.g.cs:53
at PopColorPicker.iOS.PopColorPickerViewController..ctor () [0x00000] in C:\Users\Michael\Documents\TEditor\PopColorPicker.iOS.Shared\PopColorPickerViewController.cs:19
at TEditor.TEditorViewController.AddColorPickerControl () [0x00000] in C:\Users\Michael\Documents\TEditor\iOS\Controls\TEditorViewController.cs:111
at TEditor.TEditorViewController.ViewDidLoad () [0x00018] in C:\Users\Michael\Documents\TEditor\iOS\Controls\TEditorViewController.cs:245
at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3234/d8bedd03/source/maccore/src/UIKit/UIApplication.cs:77
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/3234/d8bedd03/source/maccore/src/UIKit/UIApplication.cs:61
at TiendaNubeIOS.Application.Main (System.String[] args) [0x00008] in /Users/juane/mobile-apps/TIendaNubeIOS/Main.cs:13
It seems that [email protected] cannot be found. Do you know any workaround?
Thanks!
Calling var response = await CrossTEditor.Current.ShowTEditor("<strong>TESTING</strong><p>yolo</p>");
in a Xamarin.iOS app does nothing. No UI is shown, and the await
call never comes back. Any ideas?
When TEditor opens up with empty text, user needs to pres in upper left corner to enable editing.Not anywhere as expected. It's Android specific, iOS all ok.
Newest version not available on https://www.nuget.org/packages/TEditor/.
Having the abililty either manually or automatically (on ShowTEditor()
for instance) focus the editor input field is something I'd definitely love to see and actually have a need for.
Any chance of getting this or can you alternatively think of a workaround? Subclassing the editor or something?
Thank you very much for this project. It helps me a lot.
Where can I get the 'Done' and 'Back' abbility?
In my project I use static ObservableCollections und properties which are set before instantiating the editor class and assigning the editor to the MainPage. I set 'IsEnabled' true or false. If a user has the privilege to change the html code, I try to set the property of the static ObservableCollection by using the setter of the html property in the editor class. I implemented 'INotifyPropertyChanged'. When the user navigates back, the changes of the bound property should be appearing on the page.
Could you share some customized code please?
Discard Changes should return the original string that was passed in instead of a blank string. Currently there is no way to differentiate between the Discard Changes action and just saving a blank string.
I'm using TEditor for cross platform app, its working fine for android but In IOS when i try to write using Rich Text Editor(TEditor) that time virtual keyboard is not showing.
Hi,
I am sorry if this is not the wight place to ask some information. I have been trying to add a placeholder in the TEditor. I have been trying to add one with the html content, but it is displayed weirdly. I tried to make it happen with : <p><input type='text' placeholder='Please enter your text'></p>
, but a border appear and it does not behave like a placeholder. I need to delete the placeholder with backspace to make it disappear.
If you have a better way to make a real placeholder, please let me know.
Not working in Android. I got the following error
[INFO:CONSOLE(940)] "Uncaught IndexSizeError: Failed to execute 'getRangeAt' on 'Selection': 0 is not a valid index.", source: http://www.xam-consulting.com/ (940)
on android its impossible to highlight the text
Hello,
I modified TEditor, added one new button that will insert image into it. So my question is: How do I communicate between package(TEditor) and my project. I want to make when "InsertImage" is pressed, open dialog with custom list that I have in my project, which shows images and folders on server.
Problem is that I cant make one handler and call it in my project when that button is pressed. Any solutions for my issue?
Thanks.
WebView displayWebView = (WebView)TEditorControl.Children[1];
string strValue = ((HtmlWebViewSource)displayWebView.Source).Html.ToString();
This works fine in ANDROID. But not in iOS. Any work around?
Hi,
I am unable to add image of my own.
Should those be added in drawable*(hdpi,xdpi,xxdpi...) and Resource(in iOS) or should we specify them in PCL?
It is throwing unhandled exception.
This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation.
Hi!
First of all, thanks for this project.
Second, when we load a html text, font size gets ignored, and worse, when we save (and then overwrite the original string) this one has incorrect font size...
Can you fix this? Is possible also to add option in the toolbar to choose font size?
Thanks!
Hi,
My application crashes while switching keyboard mode from alphabetic to numeric keyboard.
Do you have any idea how we can fix this problem?
The last row is the one pointing to the offending code.
Error logs:
2017-10-02 14:54:14.179 TEditor.Forms.Sample.iOS[29082:2907807] API error: <_UIKBCompatInputView: 0x7fa7cc751980; frame = (0 0; 0 0); layer = <CALayer: 0x60000142aae0>> returned 0 width, assuming UIViewNoIntrinsicMetric
2017-10-02 14:54:14.179 TEditor.Forms.Sample.iOS[29082:2907807] API error: <_UIKBCompatInputView: 0x7fa7cc751980; frame = (0 0; 0 0); layer = <CALayer: 0x60000142aae0>> returned 0 width, assuming UIViewNoIntrinsicMetric
2017-10-02 14:54:23.688 TEditor.Forms.Sample.iOS[29082:2907807] *** Assertion failure in -[UIInputSetHostView _layoutEngine_didAddLayoutConstraint:roundingAdjustment:mutuallyExclusiveConstraints:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3694.4.18/NSLayoutConstraint_UIKitAdditions.m:734
Thanks for your help beforehand!
Eric
Html editor is not opening in ios at the same time its working fine in Android,
Note: i am using shell navigations, because of this issue happening?
Hi,
Is there any way to prevent the text to be removed when the screen is rotated in Android.
IOS seems to work fine.
Thanks!
/Hiram
I have been testing out your control and it worked fine in the beginning, however now on android it is unresponsive.
When I exit the app and check my output i see the same error spammed a couple of hundred times:
"Uncaught IndexSizeError: Failed to execute 'getRangeAt' on 'Selection': 0 is not a valid index.", source: http://www.xam-consulting.com/ (940)
The color of tool bar items that appear above the keyboard on android is way too dark. So it very hard to see the icons that represent actions.
Is there way to change it without forking the code?
Thanks
I am trying to add this component to my project, the first attempt was adding via nuget, but I had some problems like losing the data when rotating the screen and not opening in ios, downloaded the source I agreed not to lose the data in android and compiled caught the dll and added the references in my projects android / ios and forms, but when running the ios does not work, someone has had a similar problem and could you guide me?
Hi, I am looking for an editor that I can extend for the following 2 use cases:
Would this be doable with the editor? How would you approach this?
Hello,
So I have a problem, how to open TEditor in a view, not on full screen?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.