From 55241c4798fadf35308542f3ef03893d6c2c2ed3 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Sun, 19 Oct 2014 16:59:12 +0200 Subject: [PATCH] Rename action URI handler to jsonrpc --- public/js/vroom.js | 4 ++-- vroom.pl | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/public/js/vroom.js b/public/js/vroom.js index 0018a8f..e12ede5 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -35,7 +35,7 @@ $.ajax({ // Default ajax setup $.ajaxSetup({ - url: rootUrl + 'action', + url: rootUrl + 'jsonrpc', type: 'POST', dataType: 'json', }); @@ -307,7 +307,7 @@ function initManage(){ function sendAction(data,sw){ $.ajax({ - url: rootUrl + 'admin/action', + url: rootUrl + 'admin/jsonrpc', data: data, error: function(data) { $.notify(locale.ERROR_OCCURRED, 'error'); diff --git a/vroom.pl b/vroom.pl index 169eb10..f7e22ca 100755 --- a/vroom.pl +++ b/vroom.pl @@ -95,7 +95,7 @@ helper valid_room_name => sub { my ($name) = @_; my $ret = {}; # A few names are reserved - my @reserved = qw(about help feedback feedback_thanks goodbye admin create localize action + my @reserved = qw(about help feedback feedback_thanks goodbye admin create localize jsonrpc missing dies password kicked invitation js css img fonts snd); if ($name !~ m/^[\w\-]{1,49}$/ || grep { $name eq $_ } @reserved){ return 0; @@ -1093,10 +1093,10 @@ get '/:room' => sub { }; # Route for various room actions -post '/*action' => [action => [qw/action admin\/action/]] => sub { +post '/*jsonrpc' => [jsonrpc => [qw(jsonrpc admin/jsonrpc)] => sub { my $self = shift; my $action = $self->param('action'); - my $prefix = ($self->stash('action') eq 'admin/action') ? 'admin':'room'; + my $prefix = ($self->stash('jsonrpc') eq 'admin/jsonrpc') ? 'admin' : 'room'; my $room = $self->param('room') || ''; if ($action eq 'langSwitch'){ my $new_lang = $self->param('lang') || 'en';