Vourto (New)

April 20th, 2017

Package:
Vourto
Summary:
Validate request values of different types
Groups:
PHP 5, Validation
Author:
Mauro Junior
Description:
This package can validate request values of different types...

Read more at https://www.phpclasses.org/package/10265-PHP-Validate-request-values-of-different-types.html

Tags: ,
Posted in Classes | No Comments »

Oire Colloportus (New)

April 19th, 2017

Package:
Oire Colloportus
Summary:
Create a key, encrypt, decrypt data with sha-384
Groups:
Cryptography, PHP 7, Security
Author:
Andre Polykanine A.K.A. Menelion Elensúlë
Description:
This class can create a key, encrypt, decrypt data with sha-384...

Read more at https://www.phpclasses.org/package/10260-PHP-Create-a-key-encrypt-decrypt-data-with-sha-384.html

Tags: ,
Posted in Classes | No Comments »

cwGraph (New)

April 19th, 2017

Package:
cwGraph
Summary:
Generate Bar, Pie, Line graph images
Groups:
Graphics, PHP 5
Author:
Fernando André
Description:
This package can generate Bar, Pie, Line graph images...

Read more at https://www.phpclasses.org/package/10255-PHP-Generate-Bar-Pie-Line-graph-images.html

Tags: ,
Posted in Classes | No Comments »

Trigves ARM Laravel (New)

April 18th, 2017

Package:
Trigves ARM Laravel
Summary:
Create database tables from array for Laravel
Groups:
Databases, Libraries, PHP 5
Author:
Trigve Hagen
Description:
This class can create database tables from array for Laravel...

Read more at https://www.phpclasses.org/package/10219-PHP-Create-database-tables-from-array-for-Laravel.html

Tags: ,
Posted in Classes | No Comments »

New Open Source Mac Emulator: run old Mac games and software on Windows

April 18th, 2017

Feeling nostalgic? An open source emulator for the old Macintosh 128K, Macintosh 512k, Macintosh 512ke, Macintosh Plus, Macintosh SE and Macintosh Classic has been added to the Free 68k and PowerPC Macintosh Emulators page.

Tags:
Posted in Uncategorized | No Comments »

HTML Generate

April 18th, 2017

Package:
HTML Generate
Summary:
Generate HTML from arrays
Groups:
HTML, PHP 5
Author:
Tony Frezza
Description:
This class can generate HTML from arrays...

Read more at https://www.phpclasses.org/package/10267-PHP-Generate-HTML-from-arrays.html#2017-04-18-03:43:10

Tags: ,
Posted in Classes | No Comments »

Handle Mouse And Touch Input With The Pointer Events API

April 18th, 2017

pointer-events-api-2

With more and more people using their mobile phones and tablets for web browsing, we as developers have to make sure that our web interfaces are fully accessible via touch. Setting up click and hover event listeners sort of works, but it is clearly a leftover solution from the mouse era.

Thankfully, there is a new API in town that accommodates the needs of mouse, touch, and stylus devices. It’s called Pointer events (not to be mistaken with the CSS property of the same name) and it allows us to add event listeners that are better suited for working with all types on input.

Meet The New Events

The new Pointer Event API is an evolved version of the Mouse Event interface we’ve all been using so far. It extends the functionality of the old API and adds support for multi-touch gestures, precise pen input, and overall smoother touchscreen interaction.

Most of the Pointer Events have direct alternatives among the old mouse events. Once the new API gets full browser support we can directly substitute with the more modern alternatives:

const button = document.querySelector("button");

// Instead of mouseover
button.addEventListener('mouseover', doSomething);

// We can use pointerover
button.addEventListener('pointerover', doSomething);

Interacting with a mouse should be the same in both cases. Using fingers or a stylus, however, will be easier to program with the new API.

Recognizing Input Type

An awesome feature of the Pointer Events API is that it can tell which type of input has been used. This can be helpful when you want to ignore some of the input methods or provide special feedback for each one.

button.addEventListener('pointereover', function(ev){
  switch(ev.pointerType) {
    case 'mouse':
      // The used device is a mouse or trackpad.
      break;
    case 'touch':
      // Input via touchscreen.
      break;
    case 'pen':
      // Stylus input.
      break;
    default:
      // Browser can't recognize the used device.
      break;
  }
});

Other Properties

The Pointer Events interface provides some some other interesting data as well. It includes all the MouseEvent properties plus the following:

  • pointerId – Unique ID for the pointer causing the event.
  • width and height – Size of the contact area in pixels.
  • pressure – Pressure of touch, if available.
  • tiltX and tiltY – The angle at which a stylus is touching the screen.
  • isPrimary – Determines whether an event has been emitted by the pirmary pointer device.
Mouse clicks always have a width and height of 1, touch size differs.

Mouse clicks always have a width and height of 1 while touch size varies.

Browser Support

Pointer Events are fairly new, so browser compatibility isn’t perfect yet. Chrome (desktop and mobile), Edge, IE, and Opera have full support; Firefox and Safari don’t.

Pointer Events Browser Compatibility on Can I Use

Pointer Events Browser Compatibility on Can I Use

To check whether a browser has the Pointer Events API you can use the window object:

if (window.PointerEvent) {
  // Pointer Events enabled.
} else {
  // Pointer Events not supported
}

A popular open-source pollyfill is also available for those who don’t want to wait for full browser adoption.

Conclusion

Although it doesn’t have full browser support yet, the Pointer Events API is eventually going to take over the old mouse events. It provides a lot of cool features that will increase web accessibility and enable developers to create more advanced touch and stylus-based apps.

If you want to learn more about the Power Events API we recommend checking out these resources:

Tags: , , , ,
Posted in PHP Tutorials | No Comments »

PHP Session MySQL Handler (New)

April 17th, 2017

Package:
PHP Session MySQL Handler
Summary:
Handler for storing session data in MySQL
Groups:
Databases, PHP 5, User Management
Author:
Lars Moelleken
Description:
This class implements a handler for storing session data in MySQL...

Read more at https://www.phpclasses.org/package/10230-PHP-Handler-for-storing-session-data-in-MySQL.html

Tags: ,
Posted in Classes | No Comments »

session2db (New)

April 17th, 2017

Package:
session2db
Summary:
Handler for storing session data in MySQL
Groups:
Databases, PHP 5, User Management
Author:
Lars Moelleken
Description:
A drop-in replacement for PHP's default session handler which stores session data in a MySQL database, providing both better performance and better security and protection against session fixation and session hijacking...

Read more at https://www.phpclasses.org/package/10230-PHP-Handler-for-storing-session-data-in-MySQL.html

Tags: ,
Posted in Classes | No Comments »

Name String Order (New)

April 17th, 2017

Package:
Name String Order
Summary:
Get person name and surname from a string
Groups:
Artificial intelligence, PHP 5, Text processing
Author:
Peter Kahl
Description:
This class can get person name and surname from a string...

Read more at https://www.phpclasses.org/package/10224-PHP-Get-person-name-and-surname-from-a-string.html

Tags: ,
Posted in Classes | No Comments »