Leaflet.DistortableImage icon indicating copy to clipboard operation
Leaflet.DistortableImage copied to clipboard

Update method creation syntax to ES6 `EditHandle.js`

Open first-timers[bot] opened this issue 2 years ago β€’ 16 comments

πŸ†•πŸ₯☝ First Timers Only.

This issue is reserved for people who never contributed to Open Source before. We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you πŸ’

About First Timers Only.

πŸ€” What you need to know.

Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.

πŸ“‹ Step by Step

  • [ ] πŸ™‹ Claim this issue: Comment below.

    Once claimed we add you as contributor to this repository.

  • [ ] πŸ‘Œ Accept our invitation to this repository. Once accepted, assign yourself to this issue

  • [ ] πŸ“ Update the file \src/edit/handles/EditHandle.js in the Leaflet.DistortableImage repository (press the little pen Icon) and edit the line as shown below.

@@ -1,5 +1,5 @@
 L.EditHandle = L.Marker.extend({
-  initialize: function(overlay, corner, options) {
+  initialize(overlay, corner, options) {
     var latlng = overlay.getCorner(corner);
 
     L.setOptions(this, options);
@@ -19,31 +19,31 @@ L.EditHandle = L.Marker.extend({
     L.Marker.prototype.initialize.call(this, latlng, markerOptions);
   },
 
-  onAdd: function(map) {
+  onAdd(map) {
     L.Marker.prototype.onAdd.call(this, map);
     this._bindListeners();
     this.updateHandle();
   },
 
-  onRemove: function(map) {
+  onRemove(map) {
     this._unbindListeners();
     L.Marker.prototype.onRemove.call(this, map);
   },
 
-  _onHandleDragStart: function() {
+  _onHandleDragStart() {
     this._handled.fire('editstart');
   },
 
-  _onHandleDragEnd: function() {
+  _onHandleDragEnd() {
     this._fireEdit();
   },
 
-  _fireEdit: function() {
+  _fireEdit() {
     this._handled.edited = true;
     this._handled.fire('edit');
   },
 
-  _bindListeners: function() {
+  _bindListeners() {
     this.on({
       contextmenu: L.DomEvent.stop,
       dragstart: this._onHandleDragStart,
@@ -55,7 +55,7 @@ L.EditHandle = L.Marker.extend({
     this._handled.on('update', this.updateHandle, this);
   },
 
-  _unbindListeners: function() {
+  _unbindListeners() {
     this.off({
       contextmenu: L.DomEvent.stop,
       dragstart: this._onHandleDragStart,
@@ -68,7 +68,7 @@ L.EditHandle = L.Marker.extend({
   },
 
   /* Takes two latlngs and calculates the scaling difference. */
-  _calculateScalingFactor: function(latlngA, latlngB) {
+  _calculateScalingFactor(latlngA, latlngB) {
     var overlay = this._handled;
     var map = overlay._map;
 
@@ -82,15 +82,15 @@ L.EditHandle = L.Marker.extend({
   },
 
   /* Distance between two points in cartesian space, squared (distance formula). */
-  _d2: function(a, b) {
+  _d2(a, b) {
     var dx = a.x - b.x;
     var dy = a.y - b.y;
 
     return Math.pow(dx, 2) + Math.pow(dy, 2);
   },
 
   /* Takes two latlngs and calculates the angle between them. */
-  calculateAngleDelta: function(latlngA, latlngB) {
+  calculateAngleDelta(latlngA, latlngB) {
     var overlay = this._handled;
     var map = overlay._map;
 
  • [ ] πŸ’Ύ Commit your changes

  • [ ] πŸ”€ Start a Pull Request. There are two ways how you can start a pull request:

  1. If you are familiar with the terminal or would like to learn it, here is a great tutorial on how to send a pull request using the terminal.

  2. You can edit files directly in your browser

  • [ ] 🏁 Done Ask in comments for a review :)

πŸ€”β“ Questions

Leave a comment below!

This issue was created by First-Timers-Bot.

first-timers[bot] avatar Oct 02 '22 17:10 first-timers[bot]

Hi, i want to clam this issue

ashish-parjapat avatar Oct 03 '22 04:10 ashish-parjapat

Hi, I want to claim this issue

fonkwe avatar Oct 08 '22 17:10 fonkwe

Hi @ashish-parjapat, please go ahead. Thank you!

TildaDares avatar Oct 08 '22 18:10 TildaDares

Hi, first timer here. Can i work on this?

Dezzy12 avatar Oct 08 '22 19:10 Dezzy12

Hi @Dezzy12, please leave a comment here https://github.com/publiclab/plots2/issues/11105 and we’ll look for an issue for you to work on. Thank you!

TildaDares avatar Oct 08 '22 19:10 TildaDares

Hi , I would like to claim this issue#1050

MAX-786 avatar Oct 08 '22 19:10 MAX-786

Hi @MAX-786, someone has already been assigned. Thank you!

TildaDares avatar Oct 08 '22 19:10 TildaDares

Hi @TildaDares. πŸ‘‹πŸΌ I'm here to take on the next available issue. πŸ™‚

NPDebs avatar Oct 09 '22 01:10 NPDebs

Hi @NPDebs, please leave a comment in https://github.com/publiclab/plots2/issues/11105 and we’ll look for an issue for you to work on. Thank you!

TildaDares avatar Oct 09 '22 07:10 TildaDares

Hello, I am a first-timer. can I work on this?

olamideazeez avatar Oct 11 '22 01:10 olamideazeez

Hi @olamideazeez, please leave a comment in https://github.com/publiclab/plots2/issues/11105 and we’ll look for an issue for you to work on. Thank you!

TildaDares avatar Oct 11 '22 08:10 TildaDares

I'd like to claim this issue πŸ‘©β€πŸ¦° @TildaDares

Chinazaekpere-Ike avatar Oct 12 '22 17:10 Chinazaekpere-Ike

I'd like to claim this issue πŸ‘©β€πŸ¦° @TildaDares

HiΒ @Chinazaekpere-Ike , please leave a comment inΒ publiclab/plots2#11105Β and @TildaDares will look for an issue for you to work on. Thank you! πŸ€ΈπŸ½β€β™€οΈ

NPDebs avatar Oct 12 '22 18:10 NPDebs

hi, @TildaDares @jywarren has this issue been resolved. if not id like to work on it

abd123codes avatar Oct 13 '22 13:10 abd123codes

Hi @THEDARKMAN007, contributors are only allowed to work on one FTO. You can look for other non-FTO issues to work or help a other contributions make their own contributions. Thank you!

TildaDares avatar Oct 13 '22 14:10 TildaDares

Hi @ashish-parjapat, do you need any help with this? Please reach out if you do.

TildaDares avatar Oct 15 '22 07:10 TildaDares

Hi @olamideazeez, you can go ahead and work on this. Thank you!

TildaDares avatar Oct 19 '22 11:10 TildaDares