Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pixel Humain
interop
Commits
c5f8054a
Commit
c5f8054a
authored
Feb 17, 2020
by
Raph El
Browse files
Merge branch 'master' into qa
parents
c434e2e3
0e8e7fbc
Changes
3
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
c5f8054a
# interop
Module concernant l'interopérabilité avec d'autre site
`interopObj`
regroupes les parametres, et les fonctions pour rechercher la donné sur une db
`interop`
: Une Obj qui va executer la recherche en fonction des parametres et function de interopObj
`interop.currentType : []`
, tableau des db qu'on interoge.
Quand on lance le search
-
startSearch() : directory.js
-
interopSearch(keyS, nameS) : search.js
` Charge les fichiers js de interops si l'objet interop n'existe pas et lance la recherche `
-
interopObj[keyS].startSearch(searchObject.indexMin, searchObject.indexStep)
` keyS correspond à la db que tu veut intéroger`
-
interop.searchStart()
`init les parametres `
-
interop.getUrlForInteropResearch();
` parcourir les db qu'on soite interrogé et lance la recherche `
-
interopObj[keyS].getParamsUrl
` Charge les parametres de l'url `
+
interopObj[keyS].getUrlApi
`récupere l'url `
+
interop.getResults()
``` exexute l'url en ajax ```
*
directory.interopPanelHtml(value, objType); affiche le resultat
``` dans interop.js ```
assets/js/init.js
View file @
c5f8054a
...
...
@@ -143,73 +143,8 @@ initTypeObj();
// } ;
directory
.
interopPanelHtml
=
function
(
params
,
objType
)
{
mylog
.
log
(
"
----------- interopPanelHtml
"
,
params
,
objType
,
params
.
type
,
params
.
name
,
params
.
url
);
// TODO Revoir cette parti des hash ans TRANSLATE
//params.hash = getUrlForInteropDirectoryElements(objType.type, params.shortDescription, params.url);
params
.
hash
=
objType
.
getUrlElement
(
params
);
params
.
url
=
params
.
hash
;
params
.
type
=
"
poi.interop.
"
+
objType
.
type
;
if
(
typeof
params
.
tags
==
"
undefined
"
){
params
.
tags
=
[];
}
var
thisTags
=
""
;
if
(
typeof
params
.
tags
!=
"
undefined
"
&&
params
.
tags
!=
null
){
$
.
each
(
params
.
tags
,
function
(
key
,
value
){
if
(
typeof
value
!=
"
undefined
"
&&
value
!=
""
&&
value
!=
"
undefined
"
){
var
tagTrad
=
typeof
tradCategory
[
value
]
!=
"
undefined
"
?
tradCategory
[
value
]
:
value
;
thisTags
+=
"
<span class='badge bg-transparent text-red btn-tag tag' data-tag-value='
"
+
slugify
(
value
,
true
)
+
"
' data-tag-label='
"
+
tagTrad
+
"
'>#
"
+
tagTrad
+
"
</span>
"
;
params
.
elTagsList
+=
slugify
(
value
,
true
)
+
"
"
;
}
});
}
params
.
tagsLbl
=
thisTags
;
str
=
""
;
str
+=
"
<div class='col-lg-4 col-md-6 col-sm-8 col-xs-12
"
+
params
.
type
+
"
' style='min-height: 170px; max-height: 170px; margin-bottom: 25px;'>
"
+
"
<div class='searchEntity' id='entity
"
+
params
.
id
+
"
'>
"
+
"
<div class='contentMin'>
"
+
"
<div class='padding-10 informations'>
"
+
"
<div class='entityRight no-padding'>
"
+
"
<a href='
"
+
params
.
hash
+
"
' target='_blank' class='
"
+
params
.
size
+
"
entityName text-dark lbhp add2fav'
"
+
"
data-modalshow='
"
+
params
.
id
+
"
'>
"
+
'
<span class="col-xs-2 text-center">
'
+
"
<img width=40 src='
"
+
objType
.
urlImg
+
"
'>
"
+
'
</span>
'
+
'
<span class="col-xs-10">
'
+
params
.
name
+
'
</span>
'
+
"
</a>
"
;
if
(
typeof
params
.
address
!=
"
undefined
"
&&
typeof
params
.
address
.
addressLocality
!=
"
undefined
"
){
str
+=
"
<a href='
"
+
params
.
hash
+
"
' target='_blank' data-id='
"
+
params
.
dataId
+
"
'
"
+
"
class='entityLocality lbhp add2fav' data-modalshow='
"
+
params
.
id
+
"
'>
"
+
"
<i class='fa fa-home'></i>
"
+
params
.
address
.
postalCode
+
"
,
"
+
params
.
address
.
addressLocality
+
"
</a>
"
;
}
else
str
+=
"
<br/>
"
;
//str += "<div class='entityDescription'>" + params.shortDescription + "</div>";
if
(
typeof
params
.
shortDescription
!=
"
undefined
"
&&
params
.
shortDescription
!=
""
&&
params
.
shortDescription
!=
null
)
str
+=
"
<br><span class='entityDescription'>
"
+
params
.
shortDescription
+
"
</span>
"
;
else
if
(
typeof
params
.
description
!=
"
undefined
"
&&
params
.
description
!=
""
&&
params
.
description
!=
null
){
str
+=
"
<br><span class='entityDescription'>
"
+
(
(
params
.
description
.
length
>
140
)
?
params
.
description
.
substring
(
0
,
140
)
+
"
...
"
:
params
.
description
)
+
"
</span>
"
;
}
str
+=
"
<div class='tagsContainer text-red'>
"
+
params
.
tagsLbl
+
"
</div>
"
;
str
+=
"
</div>
"
;
str
+=
"
</div>
"
;
str
+=
"
</div>
"
;
str
+=
"
</div>
"
;
str
+=
"
</div>
"
;
return
str
;
};
// if(typeof searchObject == "undefined"){
// lazyLoad( moduleUrl+'/js/default/search.js', null, function(){
// searchAllEngine.initRanges();
...
...
assets/js/interop.js
View file @
c5f8054a
...
...
@@ -138,7 +138,7 @@ var interop = {
var
endNow
=
30
;
mylog
.
log
(
"
getInteropResults :
"
,
url_interop
);
var
construct
=
constructSearchObjectAndGetParams
();
//
var construct
=
constructSearchObjectAndGetParams();
// if(indexMin > 0)
// $("#btnShowMoreResult").html("<i class='fa fa-spin fa-circle-o-notch'></i> "+trad.currentlyresearching+" ...");
...
...
@@ -261,4 +261,72 @@ var interop = {
}
});
}
}
\ No newline at end of file
}
directory
.
interopPanelHtml
=
function
(
params
,
objType
)
{
//mylog.log("----------- interopPanelHtml",params, objType, params.type,params.name, params.url);
// TODO Revoir cette parti des hash ans TRANSLATE
//params.hash = getUrlForInteropDirectoryElements(objType.type, params.shortDescription, params.url);
params
.
hash
=
objType
.
getUrlElement
(
params
);
params
.
url
=
params
.
hash
;
params
.
type
=
"
poi.interop.
"
+
objType
.
type
;
if
(
typeof
params
.
tags
==
"
undefined
"
){
params
.
tags
=
[];
}
var
thisTags
=
""
;
if
(
typeof
params
.
tags
!=
"
undefined
"
&&
params
.
tags
!=
null
){
$
.
each
(
params
.
tags
,
function
(
key
,
value
){
if
(
typeof
value
!=
"
undefined
"
&&
value
!=
""
&&
value
!=
"
undefined
"
){
var
tagTrad
=
typeof
tradCategory
[
value
]
!=
"
undefined
"
?
tradCategory
[
value
]
:
value
;
thisTags
+=
"
<span class='badge bg-transparent text-red btn-tag tag' data-tag-value='
"
+
slugify
(
value
,
true
)
+
"
' data-tag-label='
"
+
tagTrad
+
"
'>#
"
+
tagTrad
+
"
</span>
"
;
params
.
elTagsList
+=
slugify
(
value
,
true
)
+
"
"
;
}
});
}
params
.
tagsLbl
=
thisTags
;
str
=
""
;
str
+=
"
<div class='col-lg-4 col-md-6 col-sm-8 col-xs-12
"
+
params
.
type
+
"
' style='min-height: 170px; max-height: 170px; margin-bottom: 25px;'>
"
+
"
<div class='searchEntity' id='entity
"
+
params
.
id
+
"
'>
"
+
"
<div class='contentMin'>
"
+
"
<div class='padding-10 informations'>
"
+
"
<div class='entityRight no-padding'>
"
+
"
<a href='
"
+
params
.
hash
+
"
' target='_blank' class='
"
+
params
.
size
+
"
entityName text-dark lbhp add2fav'
"
+
"
data-modalshow='
"
+
params
.
id
+
"
'>
"
+
'
<span class="col-xs-2 text-center">
'
+
"
<img width=40 src='
"
+
objType
.
urlImg
+
"
'>
"
+
'
</span>
'
+
'
<span class="col-xs-10">
'
+
params
.
name
+
'
</span>
'
+
"
</a>
"
;
if
(
typeof
params
.
address
!=
"
undefined
"
&&
typeof
params
.
address
.
addressLocality
!=
"
undefined
"
){
str
+=
"
<a href='
"
+
params
.
hash
+
"
' target='_blank' data-id='
"
+
params
.
dataId
+
"
'
"
+
"
class='entityLocality lbhp add2fav' data-modalshow='
"
+
params
.
id
+
"
'>
"
+
"
<i class='fa fa-home'></i>
"
+
params
.
address
.
postalCode
+
"
,
"
+
params
.
address
.
addressLocality
+
"
</a>
"
;
}
else
str
+=
"
<br/>
"
;
//str += "<div class='entityDescription'>" + params.shortDescription + "</div>";
if
(
typeof
params
.
shortDescription
!=
"
undefined
"
&&
params
.
shortDescription
!=
""
&&
params
.
shortDescription
!=
null
)
str
+=
"
<br><span class='entityDescription'>
"
+
params
.
shortDescription
+
"
</span>
"
;
else
if
(
typeof
params
.
description
!=
"
undefined
"
&&
params
.
description
!=
""
&&
params
.
description
!=
null
){
str
+=
"
<br><span class='entityDescription'>
"
+
(
(
params
.
description
.
length
>
140
)
?
params
.
description
.
substring
(
0
,
140
)
+
"
...
"
:
params
.
description
)
+
"
</span>
"
;
}
str
+=
"
<div class='tagsContainer text-red'>
"
+
params
.
tagsLbl
+
"
</div>
"
;
str
+=
"
</div>
"
;
str
+=
"
</div>
"
;
str
+=
"
</div>
"
;
str
+=
"
</div>
"
;
str
+=
"
</div>
"
;
return
str
;
};
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment