Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6950] Ti API: UI - clipboard support for HTML

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusReopened
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsTiAPI
Labelsn/a
ReporterSindre Sorhus
AssigneeIngo Muschenetz
Created2011-10-29T15:51:01.000+0000
Updated2014-06-18T22:52:39.000+0000

Description

Request

Would be useful if Ti.UI.Clipboard supported copy/paste of HTML. There is a tutorial [here](http://mcmurrym.wordpress.com/2010/08/13/pasting-simplehtml-into-the-mail-app-ios/) on how to do it.

Usecase

Let's say I'm building a scrapbook app where people can save various memories, text, pictures. I want them to be able to save part of emails/webpages, etc... The problem now is that Titanium doesn't support HTML in the clipboard, so it's pasted as plain text. The user want to save the whole part of an email/website, not just the text, but the formatting too. The following methods would solve this:
.getHTML()
.setHTML()
.hasHTML()

Test case

Testcase for when it's implemented:
var c = Ti.UI.Clipboard;

c.setHTML('<b>test</b>');

var win = Ti.UI.createWindow();

var webView = Ti.UI.createWebView({
	html: c.hasHTML() ? c.getHTML() : c.getText()
});

win.add(webView);

win.open();

Comments

  1. Matthew Apperson 2011-10-30

    Please provide a usecase of how this would be used in an application.
  2. Sindre Sorhus 2011-10-30

    Added required usecase to the ticket description.
  3. Sindre Sorhus 2012-01-02

    Can someone reopen this?

JSON Source