diff --git a/package.json b/package.json index de1efe2b24..ea0ab5b830 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,6 @@ "postinstall": "./node_modules/.bin/gulp install;" }, "dependencies": { - "phraseanet-production-client": "~0.5.0" + "phraseanet-production-client": "~0.6.0" } } diff --git a/resources/gulp/components/account.js b/resources/gulp/components/account.js index 2002255605..acb7531db5 100644 --- a/resources/gulp/components/account.js +++ b/resources/gulp/components/account.js @@ -13,19 +13,6 @@ gulp.task('build-account-css', function(){ ], 'account', 'account/css/', debugMode); }); -gulp.task('build-account-js', function(){ - var accountGroup = [ - config.paths.vendors + 'requirejs/require.js', - config.paths.src + 'account/js/account.js' - ]; - return utils.buildJsGroup(accountGroup, 'account', 'account/js', debugMode); -}); - -gulp.task('watch-account-js', function() { - debugMode = true; - return gulp.watch(config.paths.src + 'account/**/*.js', ['build-account-js']); -}); - gulp.task('watch-account-css', function() { debugMode = true; gulp.watch(config.paths.src + 'account/**/*.scss', ['build-account-css']); @@ -33,5 +20,5 @@ gulp.task('watch-account-css', function() { gulp.task('build-account', ['copy-account-images', 'build-account-css'], function(){ debugMode = false; - return gulp.start('build-account-js'); -}); \ No newline at end of file + return gulp.start('build-account-css'); +}); diff --git a/resources/gulp/watch.js b/resources/gulp/watch.js index 6bb8cbfc61..20e48c9f4c 100644 --- a/resources/gulp/watch.js +++ b/resources/gulp/watch.js @@ -27,7 +27,6 @@ gulp.task('watch-js', function(){ //gulp.start('watch-uploadFlash'); gulp.start('watch-admin-js'); gulp.start('watch-report-js'); - gulp.start('watch-account-js'); // gulp.start('watch-permaview'); gulp.start('watch-setup-js'); gulp.start('watch-authentication-js'); diff --git a/resources/www/account/js/account.js b/resources/www/account/js/account.js deleted file mode 100644 index 541d69a579..0000000000 --- a/resources/www/account/js/account.js +++ /dev/null @@ -1,171 +0,0 @@ -$(document).ready(function () { - // revoke third party application access - $("a.app-btn").bind("click", function (e) { - e.preventDefault(); - var $this = $(this); - $.ajax({ - type: "GET", - url: $this.attr("href"), - dataType: 'json', - data: {revoke: $this.hasClass("authorize") ? 0 : 1}, - success: function (data) { - if (data.success) { - var li = $this.closest('li'); - - var hidden = $('.app-btn.hidden , .status.hidden', li); - var notHidden = $('.app-btn:not(.hidden), .status:not(.hidden)', li); - - hidden.removeClass('hidden'); - notHidden.addClass('hidden'); - } - } - }); - }); - - // generate new access token - $("a#generate_access").bind("click", function (e) { - e.preventDefault(); - var $this = $(this); - $.ajax({ - type: "POST", - url: $this.attr("href"), - dataType: 'json', - data: { - usr_id: $this.closest("div").attr("id") - }, - success: function (data) { - if (data.success) { - $("#my_access_token").empty().append(data.token); - } - } - }); - }); - - //modify application callback url - $(".modifier_callback").bind("click", function () { - var modifierBtn = $(this); - var saveBtn = $("a.save_callback"); - var input = $(".url_callback_input"); - var inputVal = input.html(); - - modifierBtn.hide(); - saveBtn.show(); - // wrapp current calback in an input - input - .empty() - .wrapInner('' - + '' - ); - - $(".url_callback").off(); - - // save new callback - saveBtn.bind("click", function (e) { - e.preventDefault(); - var callback = $("input[name=oauth_callback]").val(); - $.ajax({ - type: "POST", - url: saveBtn.attr("href"), - dataType: 'json', - data: {callback: callback}, - success: function (data) { - if (data.success) { - input.empty().append(callback); - } else { - input.empty().append(inputVal); - } - - modifierBtn.show(); - saveBtn.hide(); - } - }); - }); - }); - - //modify application webhook url - $(".webhook-modify-btn").bind("click", function () { - var modifierBtn = $(this); - var saveBtn = $("a.save_webhook"); - var input = $(".url_webhook_input"); - var inputVal = input.html(); - - modifierBtn.hide(); - saveBtn.show(); - // wrapp current calback in an input - input - .empty() - .wrapInner('' - + '' - ); - - $(".url_webhook").off(); - - // save new callback - saveBtn.bind("click", function (e) { - e.preventDefault(); - var webhook = $("input[name=oauth_webhook]").val(); - $.ajax({ - type: "POST", - url: saveBtn.attr("href"), - dataType: 'json', - data: {webhook: webhook}, - success: function (data) { - if (data.success) { - input.empty().append(webhook); - } else { - input.empty().append(inputVal); - } - - modifierBtn.show(); - saveBtn.hide(); - } - }); - }); - }); - - // hide or show callback url input whether user choose a web or dektop application - $("#form_create input[name=type]").bind("click", function () { - if ($(this).val() === "desktop") { - $("#form_create .callback-control-group").hide().find("input").val(''); - } else { - $("#form_create .callback-control-group").show(); - } - }); - - // authorize password grant type or not - $('.grant-type').bind('click', function () { - var $this = $(this); - $.ajax({ - type: "POST", - url: $this.attr("value"), - dataType: 'json', - data: {grant: $this.is(":checked") ? "1" : "0"}, - success: function (data) { - } - }); - }); - - // delete an application - $("a.delete-app").bind("click", function (e) { - e.preventDefault(); - var $this = $(this); - var li = $this.closest("li"); - - $.ajax({ - type: "DELETE", - url: $this.attr('href'), - dataType: 'json', - data: {}, - success: function (data) { - if (data.success) { - li.find('.modal').modal('hide'); - li.remove(); - } - } - }); - }); -}); - - diff --git a/templates/web/account/account.html.twig b/templates/web/account/account.html.twig index 5f066d02ca..1dfbdde75f 100644 --- a/templates/web/account/account.html.twig +++ b/templates/web/account/account.html.twig @@ -11,39 +11,9 @@ {% block javascript %} {{ parent() }} {% endblock %} @@ -130,7 +100,7 @@
- +

diff --git a/templates/web/account/base.html.twig b/templates/web/account/base.html.twig index ecfcff2fad..c6f2213f57 100644 --- a/templates/web/account/base.html.twig +++ b/templates/web/account/base.html.twig @@ -36,8 +36,8 @@ {% endblock %} {% block javascript %} - - + + {% endblock %} {% block content %} @@ -77,13 +77,6 @@
{% block scripts %} - + {% endblock %} {% endblock %} diff --git a/templates/web/account/reset-email.html.twig b/templates/web/account/reset-email.html.twig index 061e28b778..62b9be8785 100644 --- a/templates/web/account/reset-email.html.twig +++ b/templates/web/account/reset-email.html.twig @@ -62,7 +62,6 @@ {% block scripts %} {{ parent() }} - {% endblock %}