[wp-trac] [WordPress Trac] #20014: Possibly add support for dragging of meta boxes to touch-based interfaces
WordPress Trac
wp-trac at lists.automattic.com
Fri Feb 24 05:27:43 UTC 2012
#20014: Possibly add support for dragging of meta boxes to touch-based interfaces
------------------------------------+--------------------
Reporter: georgestephanis | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 3.4
Component: UI | Version: 3.3.1
Severity: normal | Resolution:
Keywords: tableteers needs-patch |
------------------------------------+--------------------
Comment (by georgestephanis):
Pursuant to the discussion with Azaozz and Nacin on 2/18 in #wordpress-ui
here's my quick draft on a cookie-based detection of touch interfaces ...
`
function wp_check_for_touch_ui(){
if( isset( $_COOKIE['wp_ui_touch'] ) && ( 'true' ==
$_COOKIE['wp_ui_touch'] ) ) return;
?>
<script>
document.ontouchstart = function(){
var d = new Date();
d.setTime( d.getTime() + ( 60 * 60 * 24 * 7 * 2 *
1000 ) );
expires = d.toGMTString();
document.cookie = "wp_ui_touch=true" +
"; expires=" + expires +
"; path=<?php echo SITECOOKIEPATH; ?>" +
"; domain=<?php echo COOKIE_DOMAIN; ?>";
}
</script>
<?php
}
add_action( 'login_footer', 'wp_check_for_touch_ui' );
// optionally, as it should always catch on the login page ...
// this will catch future touch events if they somehow make it past the
login page without touching ...
add_action( 'admin_footer', 'wp_check_for_touch_ui' );
`
It'll normally trigger on the login page, setting the cookie to be tested
against either directly or via a function or whatever y'all think is best,
for including the additional JS and such to make drag/drop and other
features work on touch-based interfaces.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20014#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list