Subversion Repositories Applications.dictionnaire

Rev

Rev 6 | Rev 10 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6 Rev 7
Line 1... Line 1...
1
var dictionnaire = new Array();
1
var dictionnaire = new Array();
2
var motsAyantDefinition = null;
2
var motsAyantDefinition = null;
3
var mouseX = null;
3
var mouseX = null;
4
var mouseY = null;
4
var mouseY = null;
5
var active = false;
5
var active = false;
-
 
6
var set = 'p, span, td, pre, div';
Line 6... Line 7...
6
 
7
 
7
function getUrlBaseService() {
8
function getUrlBaseService() {
8
	// provient de dictionnaire.config.js
9
	// provient de dictionnaire.config.js
9
	return URL_BASE_SERVICE;
10
	return URL_BASE_SERVICE;
Line 50... Line 51...
50
		event.preventDefault();
51
		event.preventDefault();
51
		supprimerToutesDefinitions();
52
		supprimerToutesDefinitions();
52
		if(motsAyantDefinition == null) {
53
		if(motsAyantDefinition == null) {
53
			getMotsADefinitions();
54
			getMotsADefinitions();
54
		} else {
55
		} else {
55
			ajouterDefinitions(motsAyantDefinition);
56
			$(set).remplacerDefinitions(motsAyantDefinition);
56
		}
57
		}
57
	});
58
	});
58
	$('body').append(html);
59
	$('body').append(html);
59
}
60
}
Line 98... Line 99...
98
function getMotsADefinitions() {
99
function getMotsADefinitions() {
99
	$.ajax({
100
	$.ajax({
100
		url: getUrlBaseService()+'mots/',
101
		url: getUrlBaseService()+'mots/',
101
		success: function(data) {
102
		success: function(data) {
102
			motsAyantDefinition = data;
103
			motsAyantDefinition = data;
103
			ajouterDefinitions(motsAyantDefinition);
104
			$(set).remplacerDefinitions(motsAyantDefinition);
104
		},
105
		},
105
		dataType: "JSON",
106
		dataType: "JSON",
106
		global: false
107
		global: false
107
	});
108
	});
Line 108... Line 109...
108
	
109
	
109
	ajouterListenerDefinitions();
110
	ajouterListenerDefinitions();
Line 110... Line -...
110
}
-
 
111
 
-
 
112
function ajouterDefinitions(motsAvecDefinitions) {
-
 
113
	set = 'p, span, td, pre, div';
-
 
114
	$(set).remplacerDefinitions(motsAvecDefinitions);
-
 
115
}
111
}
116
 
112
 
117
function formaterTemplateMotADefinition(motOriginal) {
113
function formaterTemplateMotADefinition(motOriginal) {
118
	motSimplifie = supprimerAccents(motOriginal);
114
	motSimplifie = supprimerAccents(motOriginal);
119
	definitionHtml = '<span rel="'+motSimplifie+'" class="definition_term">'
115
	definitionHtml = '<span rel="'+motSimplifie+'" class="definition_term">'