mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Fix geonames amd loading
This commit is contained in:
@@ -13,6 +13,7 @@ $groups = [
|
|||||||
'//include/jslibs/jquery.contextmenu_scroll.js',
|
'//include/jslibs/jquery.contextmenu_scroll.js',
|
||||||
'//assets/jquery.cookie/jquery.cookie.js',
|
'//assets/jquery.cookie/jquery.cookie.js',
|
||||||
'//include/jquery.common.js',
|
'//include/jquery.common.js',
|
||||||
|
'//assets/requirejs/require.js',
|
||||||
'//skins/account/account.js'
|
'//skins/account/account.js'
|
||||||
],
|
],
|
||||||
'authentication_css' => [
|
'authentication_css' => [
|
||||||
|
@@ -11,19 +11,41 @@
|
|||||||
|
|
||||||
{% block javascript %}
|
{% block javascript %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
<script type="text/javascript" language="javascript" src="{{ path('minifier', { 'f' : '/skins/account/account.js,assets/geonames-server-jquery-plugin/jquery.geonames.js,scripts/common/geonames.js' }) }}"></script>
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
requirejs.config({
|
||||||
geonames.init($("#form_geonameid"), {
|
baseUrl: "/scripts",
|
||||||
"server": "{{ app['geonames.server-uri'] }}",
|
paths: {
|
||||||
"limit": 40
|
"jquery": "../assets/jquery/jquery",
|
||||||
|
"jquery.ui": "../assets/jquery.ui/jquery-ui",
|
||||||
|
"jquery.geonames": "../assets/geonames-server-jquery-plugin/jquery.geonames"
|
||||||
|
},
|
||||||
|
shim: {
|
||||||
|
"jquery.geonames": {
|
||||||
|
deps: ["jquery", "jquery.ui"],
|
||||||
|
exports: "$.fn.geocompleter"
|
||||||
|
},
|
||||||
|
"common/geonames": {
|
||||||
|
deps: ["jquery.geonames"]
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('legend').bind('click', function() {
|
require([
|
||||||
$(".form-info").hide(200);
|
"jquery",
|
||||||
$($(this).data('target')).show();
|
"common/geonames"
|
||||||
|
], function ($, geonames) {
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('legend').bind('click', function () {
|
||||||
|
$(".form-info").hide(200);
|
||||||
|
$($(this).data('target')).show();
|
||||||
|
});
|
||||||
|
|
||||||
|
geonames.init($("#form_geonameid"), {
|
||||||
|
"server": "{{ app['geonames.server-uri'] }}",
|
||||||
|
"limit": 40
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
@@ -559,33 +559,37 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript" language="javascript" src="{{ path('minifier', { 'f' : 'assets/geonames-server-jquery-plugin/jquery.geonames.js,scripts/common/geonames.js' }) }}"></script>
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function(){
|
|
||||||
ini_edit_usrs();
|
|
||||||
|
|
||||||
geonames.init($('#user_infos_tab input.geoname_field'), {
|
|
||||||
|
|
||||||
|
define([
|
||||||
|
"jquery",
|
||||||
|
"common/geonames"
|
||||||
|
], function ($, geonames) {
|
||||||
|
$(document).ready(function() {
|
||||||
|
ini_edit_usrs();
|
||||||
|
geonames.init($('#user_infos_tab input.geoname_field'), {
|
||||||
"server": "{{ app['geonames.server-uri'] }}",
|
"server": "{{ app['geonames.server-uri'] }}",
|
||||||
"limit": 40
|
"limit": 40
|
||||||
});
|
});
|
||||||
|
|
||||||
$('div.tabs').tabs();
|
$('div.tabs').tabs();
|
||||||
|
|
||||||
$('#users_rights_form button#reset_rights').bind('click', function(){
|
$('#users_rights_form button#reset_rights').bind('click', function () {
|
||||||
if(confirm("{{ 'Are you sure you want to reset rights?' | trans }}"))
|
if (confirm("{{ 'Are you sure you want to reset rights?' | trans }}")) {
|
||||||
{
|
|
||||||
var users = $('#users_rights_form input[name="users"]').val();
|
var users = $('#users_rights_form input[name="users"]').val();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: '/admin/users/rights/reset/',
|
url: '/admin/users/rights/reset/',
|
||||||
dataType:'json',
|
dataType: 'json',
|
||||||
data: {
|
data: {
|
||||||
users : users
|
users: users
|
||||||
},
|
},
|
||||||
success: function(data){
|
success: function (data) {
|
||||||
if(!data.error) {
|
if (!data.error) {
|
||||||
if(users === '') {
|
if (users === '') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -595,9 +599,9 @@
|
|||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: '/admin/users/rights/',
|
url: '/admin/users/rights/',
|
||||||
data: {
|
data: {
|
||||||
users : users
|
users: users
|
||||||
},
|
},
|
||||||
success: function(data){
|
success: function (data) {
|
||||||
$('#right-ajax').removeClass('loading').html(data);
|
$('#right-ajax').removeClass('loading').html(data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -611,4 +615,6 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@@ -506,7 +506,6 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript" language="javascript" src="{{ path('minifier', { 'f' : 'assets/geonames-server-jquery-plugin/jquery.geonames.js,scripts/common/geonames.js' }) }}"></script>
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
function check_TOU(container)
|
function check_TOU(container)
|
||||||
@@ -619,11 +618,17 @@
|
|||||||
dialog.Close();
|
dialog.Close();
|
||||||
});
|
});
|
||||||
|
|
||||||
geonames.init($('#command_geoname_field'), {
|
define([
|
||||||
"server": "{{ app['geonames.server-uri'] }}",
|
"common/geonames"
|
||||||
"limit": 40
|
], function (geonames) {
|
||||||
|
geonames.init($('#command_geoname_field'), {
|
||||||
|
"server": "{{ app['geonames.server-uri'] }}",
|
||||||
|
"limit": 40
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#download .download_button').bind('click',function(){
|
$('#download .download_button').bind('click',function(){
|
||||||
if(!check_subdefs($('#download')))
|
if(!check_subdefs($('#download')))
|
||||||
return false;
|
return false;
|
||||||
|
@@ -61,45 +61,51 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript" language="javascript" src="{{ path('minifier', { 'f' : 'assets/geonames-server-jquery-plugin/jquery.geonames.js,scripts/common/geonames.js' }) }}"></script>
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
define([
|
||||||
geonames.init($('#QuickAddUser input.geoname_field'), {
|
"jquery",
|
||||||
"server": "{{ app['geonames.server-uri'] }}",
|
"common/geonames"
|
||||||
"limit": 40
|
], function (geonames) {
|
||||||
|
$(document).ready(function() {
|
||||||
|
geonames.init($('#QuickAddUser input.geoname_field'), {
|
||||||
|
"server": "{{ app['geonames.server-uri'] }}",
|
||||||
|
"limit": 40
|
||||||
|
});
|
||||||
|
|
||||||
|
$quickAddUser = $("#QuickAddUser");
|
||||||
|
|
||||||
|
$("button", $quickAddUser).button();
|
||||||
|
|
||||||
|
$("form", $quickAddUser).bind('submit', function() {
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$("form button.cancel", $quickAddUser).bind('click', function() {
|
||||||
|
var dialog = $(this).closest('.ui-dialog-content');
|
||||||
|
if (dialog.data("ui-dialog")) {
|
||||||
|
dialog.dialog('destroy');
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog.remove();
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$("form button.valid", $quickAddUser).bind('click', function() {
|
||||||
|
var $form = $(this).closest('form');
|
||||||
|
var $this = $(this);
|
||||||
|
|
||||||
|
var callback = function() {
|
||||||
|
var dialog = $this.closest('.ui-dialog-content');
|
||||||
|
if (dialog.data("ui-dialog")) {
|
||||||
|
dialog.dialog('destroy').remove();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
p4.Feedback.addUser($form, callback);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#QuickAddUser button").button();
|
|
||||||
|
|
||||||
$("#QuickAddUser form").bind('submit', function() {
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#QuickAddUser form button.cancel").bind('click', function() {
|
|
||||||
var dialog = $(this).closest('.ui-dialog-content');
|
|
||||||
if (dialog.data("ui-dialog")) {
|
|
||||||
dialog.dialog('destroy');
|
|
||||||
}
|
|
||||||
|
|
||||||
dialog.remove();
|
|
||||||
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#QuickAddUser form button.valid").bind('click', function() {
|
|
||||||
var $form = $(this).closest('form');
|
|
||||||
var $this = $(this);
|
|
||||||
|
|
||||||
var callback = function() {
|
|
||||||
var dialog = $this.closest('.ui-dialog-content');
|
|
||||||
if (dialog.data("ui-dialog")) {
|
|
||||||
dialog.dialog('destroy').remove();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
p4.Feedback.addUser($form, callback);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
Reference in New Issue
Block a user