{ "id": "90628", "key": "TIMOB-8812", "fields": { "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "15113", "description": "2013 Sprint 08 BB", "name": "2013 Sprint 08 BB", "archived": true, "released": true, "releaseDate": "2013-04-22" }, { "id": "15106", "description": "2013 Sprint 08", "name": "2013 Sprint 08", "archived": true, "released": true, "releaseDate": "2013-04-22" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-04-11T22:20:49.000+0000", "created": "2012-04-20T09:48:00.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "notable" ], "versions": [], "issuelinks": [], "assignee": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-03T00:54:02.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10230", "name": "BlackBerry", "description": "BlackBerry Platform" } ], "description": "Implement the methods for accessing and modifying data within the clipboard.\r\n\r\nh3. Acceptance Test\r\n{code:javascript}\r\n// Custom application MIME types for clipboard data.\r\nconst kTypeText = 'application/x-text',\r\n kTypeBlob = 'application/x-blob';\r\n\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: 'red',\r\n\tlayout: 'vertical'\r\n});\r\n\r\n// Displays the current \"plain text\" in the clipboard.\r\nvar textLabel = Ti.UI.createLabel({\r\n\ttext: Ti.UI.Clipboard.getText() || \"No text.\"\r\n});\r\nwin.add(textLabel);\r\n\r\n// Displays the current custom text in the clipboard.\r\nvar customTextLabel = Ti.UI.createLabel({\r\n\ttext: (Ti.UI.Clipboard.getData(kTypeText) || {text: 'No custom text.'}).text\r\n});\r\nwin.add(customTextLabel);\r\n\r\n// Displays the current custom blob data in the clipboard.\r\nvar customBlobLabel = Ti.UI.createLabel({\r\n\ttext: (Ti.UI.Clipboard.getData(kTypeBlob) || {text: 'No custom blob.'}).text\r\n});\r\nwin.add(customBlobLabel);\r\n\r\n// Clears all data in clipboard.\r\nvar clearDataButton = Ti.UI.createButton({\r\n\ttitle: 'Clear Data'\r\n});\r\nclearDataButton.addEventListener('click', function() {\r\n\tTi.UI.Clipboard.clearData();\r\n});\r\nwin.add(clearDataButton);\r\n\r\n// Paste some text into the clipboard.\r\nvar setTextButton = Ti.UI.createButton({\r\n\ttitle: 'Set Text'\r\n});\r\nsetTextButton.addEventListener('click', function() {\r\n\tTi.UI.Clipboard.setText('Text Inserted!');\r\n});\r\nwin.add(setTextButton);\r\n\r\n// Paste custom application data into the clipboard.\r\nvar setCustomDataButton = Ti.UI.createButton({\r\n\ttitle: 'Set Custom Data'\r\n});\r\nsetCustomDataButton.addEventListener('click', function() {\r\n\tTi.UI.Clipboard.setData(kTypeText, 'Custom Text!');\r\n\r\n\tvar buffer = Ti.createBuffer({length: 16});\r\n\t'Custom Blob!'.split('').forEach(function(char, index) {\r\n\t\tbuffer.fill(char.charCodeAt(0), index, 1);\r\n\t});\r\n\tTi.UI.Clipboard.setData(kTypeBlob, buffer.toBlob());\r\n});\r\nwin.add(setCustomDataButton);\r\n\r\nwin.open();\r\n{code}\r\n\r\n# The three labels should display (in order from top to bottom)...\r\n #* No text.\r\n #* No custom text.\r\n #* No custom blob.\r\n# Click \"Set Text\" then restart the app. The first label should read \"Text Inserted!\" now.\r\n# Close the app and open another app on the device (ex: browser). Copy some text into the clipboard.\r\n# Relaunch the test case app and the first label should now contained the text you copied.\r\n# Click \"Set Custom Data\" then restart the app.\r\n# The second label should read \"Custom Text!\" and the third label \"Custom Blob!\".\r\n# Click \"Clear Data\" and restart the app. The labels should be back to their initial values (step 1).", "attachment": [], "flagged": false, "summary": "BlackBerry: Implement important Titanium.UI.Clipboard functionality", "creator": { "name": "fboisvert", "key": "fboisvert", "displayName": "Francois Boisvert", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "fboisvert", "key": "fboisvert", "displayName": "Francois Boisvert", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "408639", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as Blackberry is no longer supported.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-03T00:54:02.000+0000", "updated": "2017-03-03T00:54:02.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }