Clean-up and move clipboard.js

RESOLVED FIXED in 1.0b1

Status

--
trivial
RESOLVED FIXED
10 years ago
9 years ago

People

(Reporter: martinschroeder, Assigned: martinschroeder)

Tracking

Trunk
1.0b1

Details

Attachments

(1 attachment, 1 obsolete attachment)

Created attachment 346268 [details] [diff] [review]
Patch v1

* Clean-up of clipboard.js including removal of Mozilla 1.8 compatibility
* Move resources/content/clipboard.js to base/content/calendar-clipboard.js
* Adjust jar.mn files for moved file
Attachment #346268 - Flags: review?(philipp)
Comment on attachment 346268 [details] [diff] [review]
Patch v1

>diff --git a/calendar/resources/content/clipboard.js b/calendar/base/content/calendar-clipboard.js
>rename from calendar/resources/content/clipboard.js
>rename to calendar/base/content/calendar-clipboard.js
>--- a/calendar/resources/content/clipboard.js
>+++ b/calendar/base/content/calendar-clipboard.js
>@@ -13,264 +13,209 @@
>  *
>  * The Original Code is Mozilla Calendar code.
>  *
>  * The Initial Developer of the Original Code is
>  * ArentJan Banck <ajbanck@planet.nl>.
>  * Portions created by the Initial Developer are Copyright (C) 2002
>  * the Initial Developer. All Rights Reserved.
>  *
>- * Contributor(s): ArentJan Banck <ajbanck@planet.nl>
>- *                 Joey Minta <jminta@gmail.com>
>- *                 Philipp Kewisch <mozilla@kewis.ch>
>+ * Contributor(s):
>+ *   ArentJan Banck <ajbanck@planet.nl>

Why are we naming ArentJan here, when he is already the initial developer? That seems to be not necessary, right?
Comment on attachment 346268 [details] [diff] [review]
Patch v1

>+function canPaste() {

>+    var flavors = ["text/calendar", "text/unicode"];
This can be const

>+    return getClipboard().hasDataMatchingFlavors(flavors, flavors.length,
>+                                                 Components.interfaces.nsIClipboard.kGlobalClipboard);
If you wrap parameters, wrap em all

>+    var trans = Components.classes["@mozilla.org/widget/transferable;1"]
>+                          .createInstance(Components.interfaces.nsITransferable);
Please use let instead of var in this patch where appropriate.


>                     case "VEVENT":
>+                        var event = createEvent();
In light of migration to calUtils.jsm, please use cal.createEvent() instead. The same goes for createTodo() and any other calUtils.js functions you find.

>             var earliestDate = null;
>             for each(item in items) {
Was item defined beforehand? If not, please use for each (let ...) (mind the missing space)


r=philipp
Attachment #346268 - Flags: review?(philipp) → review+
(Assignee)

Comment 3

10 years ago
Created attachment 346437 [details] [diff] [review]
Patch v2 (w/o actual file move)
Attachment #346437 - Flags: review?(philipp)
Comment on attachment 346437 [details] [diff] [review]
Patch v2 (w/o actual file move)

Looks good, r=philipp
Attachment #346437 - Flags: review?(philipp) → review+
(Assignee)

Updated

10 years ago
Attachment #346268 - Attachment is obsolete: true
(Assignee)

Comment 5

10 years ago
Pushed to comm-central <http://hg.mozilla.org/comm-central/rev/020882e3433b>

-> FIXED
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.0
This checkin most probably regressed Bug 463784.
Target Milestone: 1.0 → 1.0b1
You need to log in before you can comment on or make changes to this bug.