Commit c23be78c authored by Jérémie Passerat's avatar Jérémie Passerat

Ajout de tag libre via glisser déposer

parent 6205615d
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "volet_navigation",
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"@popperjs/core": "^2.9.2", "@popperjs/core": "^2.9.2",
...@@ -7539,9 +7540,9 @@ ...@@ -7539,9 +7540,9 @@
"dev": true "dev": true
}, },
"node_modules/dns-packet": { "node_modules/dns-packet": {
"version": "1.3.1", "version": "1.3.4",
"resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.1.tgz", "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.4.tgz",
"integrity": "sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg==", "integrity": "sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"ip": "^1.1.0", "ip": "^1.1.0",
...@@ -15344,9 +15345,9 @@ ...@@ -15344,9 +15345,9 @@
} }
}, },
"node_modules/path-parse": { "node_modules/path-parse": {
"version": "1.0.6", "version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true "dev": true
}, },
"node_modules/path-to-regexp": { "node_modules/path-to-regexp": {
...@@ -15527,9 +15528,9 @@ ...@@ -15527,9 +15528,9 @@
} }
}, },
"node_modules/postcss": { "node_modules/postcss": {
"version": "7.0.35", "version": "7.0.36",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz",
"integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"chalk": "^2.4.2", "chalk": "^2.4.2",
...@@ -19153,9 +19154,9 @@ ...@@ -19153,9 +19154,9 @@
} }
}, },
"node_modules/url-parse": { "node_modules/url-parse": {
"version": "1.5.1", "version": "1.5.3",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.1.tgz", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.3.tgz",
"integrity": "sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==", "integrity": "sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"querystringify": "^2.1.1", "querystringify": "^2.1.1",
...@@ -20669,9 +20670,9 @@ ...@@ -20669,9 +20670,9 @@
} }
}, },
"node_modules/ws": { "node_modules/ws": {
"version": "6.2.1", "version": "6.2.2",
"resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.2.tgz",
"integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", "integrity": "sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"async-limiter": "~1.0.0" "async-limiter": "~1.0.0"
...@@ -27024,9 +27025,9 @@ ...@@ -27024,9 +27025,9 @@
"dev": true "dev": true
}, },
"dns-packet": { "dns-packet": {
"version": "1.3.1", "version": "1.3.4",
"resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.1.tgz", "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.4.tgz",
"integrity": "sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg==", "integrity": "sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA==",
"dev": true, "dev": true,
"requires": { "requires": {
"ip": "^1.1.0", "ip": "^1.1.0",
...@@ -33141,9 +33142,9 @@ ...@@ -33141,9 +33142,9 @@
"dev": true "dev": true
}, },
"path-parse": { "path-parse": {
"version": "1.0.6", "version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true "dev": true
}, },
"path-to-regexp": { "path-to-regexp": {
...@@ -33282,9 +33283,9 @@ ...@@ -33282,9 +33283,9 @@
"dev": true "dev": true
}, },
"postcss": { "postcss": {
"version": "7.0.35", "version": "7.0.36",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz",
"integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==",
"dev": true, "dev": true,
"requires": { "requires": {
"chalk": "^2.4.2", "chalk": "^2.4.2",
...@@ -36327,9 +36328,9 @@ ...@@ -36327,9 +36328,9 @@
} }
}, },
"url-parse": { "url-parse": {
"version": "1.5.1", "version": "1.5.3",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.1.tgz", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.3.tgz",
"integrity": "sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==", "integrity": "sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"querystringify": "^2.1.1", "querystringify": "^2.1.1",
...@@ -37568,9 +37569,9 @@ ...@@ -37568,9 +37569,9 @@
} }
}, },
"ws": { "ws": {
"version": "6.2.1", "version": "6.2.2",
"resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.2.tgz",
"integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", "integrity": "sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==",
"dev": true, "dev": true,
"requires": { "requires": {
"async-limiter": "~1.0.0" "async-limiter": "~1.0.0"
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
that.$emit("contenuAjoute", {contenu: nouveauContenu}) that.$emit("contenuAjoute", {contenu: nouveauContenu})
that.contenuSaisi = '' that.contenuSaisi = ''
that.retourArriere(true) that.retourArriere(true)
that.isCreation = false that.isCreation = true
} }
) )
}, },
......
...@@ -35,7 +35,9 @@ export default { ...@@ -35,7 +35,9 @@ export default {
// provenance du contenu // provenance du contenu
contenuCliqueProvenance: {}, contenuCliqueProvenance: {},
// Signal d'activation ou non du theme sombre // Signal d'activation ou non du theme sombre
darktheme: {} darktheme: {},
// Récupération d'un tag libre ajouté
tagLibreAssocie: {}
}, },
methods:{ methods:{
/** /**
...@@ -106,6 +108,21 @@ export default { ...@@ -106,6 +108,21 @@ export default {
}) })
}) })
}, },
/**
* @vuese
* Traitement d'un tag associé via drag&dro
*/
tagLibreAssocie: function () {
//alert(this.auteur)
//alert(this.tagLibreAssocie)
let that = this
Service.recupererTagLibre(this.auteur).then(function (response) {
that.tagsDeAuteur = response.data
Service.recupererTagLibreContenu(JSON.stringify(that.tagLibreAssocie), that.auteur).then(function (response) {
that.tagsLibres = response.data
})
})
}
}, },
computed: { computed: {
/** /**
...@@ -125,6 +142,10 @@ ul { ...@@ -125,6 +142,10 @@ ul {
} }
li {
margin-left: -1.5vw;
}
/*#pageTagLibre { /*#pageTagLibre {
margin-left: 20%; margin-left: 20%;
margin-right: 20%; margin-right: 20%;
......
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
<p v-show="filtre_choisi.length === 0">{{ texte }}</p> <p v-show="filtre_choisi.length === 0">{{ texte }}</p>
<Filtre_Tag v-show="filtre_choisi === 'tags officiels'" @creer_filtre="creer_filtre"/> <Filtre_Tag v-show="filtre_choisi === 'tags officiels'" @creer_filtre="creer_filtre"/>
<Filtre_Tag_Libre v-bind:darktheme="darktheme" v-show="filtre_choisi === 'tags libres' " v-bind:filtreChoisi="filtre_choisi" v-bind:auteur="auteur" @creer_filtre="creer_filtre"/> <Filtre_Tag_Libre v-bind:darktheme="darktheme" v-show="filtre_choisi === 'tags libres' " v-bind:filtreChoisi="filtre_choisi"
v-bind:auteur="auteur" @creer_filtre="creer_filtre" v-bind:checkes="checkes" @lignesDropped="lignesDropped"
@actionTagLibre="actionTagLibre"/>
<Filtre_Auteur v-bind:panierChoisi="panierChoisi" v-show="filtre_choisi === 'auteur'" v-bind:auteur="auteur" @creer_filtre="creer_filtre"/> <Filtre_Auteur v-bind:panierChoisi="panierChoisi" v-show="filtre_choisi === 'auteur'" v-bind:auteur="auteur" @creer_filtre="creer_filtre"/>
<Filtre_Date v-show="filtre_choisi === 'date' " @creer_filtre="creer_filtre"/> <Filtre_Date v-show="filtre_choisi === 'date' " @creer_filtre="creer_filtre"/>
<Filtre_Note_Popularite v-show="filtre_choisi === 'note' " @creer_filtre="creer_filtre" v-bind:deconnexion="deconnexion"/> <Filtre_Note_Popularite v-show="filtre_choisi === 'note' " @creer_filtre="creer_filtre" v-bind:deconnexion="deconnexion"/>
...@@ -24,7 +26,6 @@ import Filtre_Tag_Libre from "@/components/filtres/Filtre_Tag_Libre"; ...@@ -24,7 +26,6 @@ import Filtre_Tag_Libre from "@/components/filtres/Filtre_Tag_Libre";
import Filtre_Recherche from "@/components/filtres/Filtre_Recherche"; import Filtre_Recherche from "@/components/filtres/Filtre_Recherche";
export default { export default {
name: "Detail_Contenu", name: "Detail_Contenu",
components: { components: {
...@@ -49,6 +50,8 @@ export default { ...@@ -49,6 +50,8 @@ export default {
deconnexion: {}, deconnexion: {},
// Signal d'activation ou non du theme sombre // Signal d'activation ou non du theme sombre
darktheme: {}, darktheme: {},
// lignes cochées
checkes: {}
}, },
methods: { methods: {
/** /**
...@@ -59,6 +62,20 @@ export default { ...@@ -59,6 +62,20 @@ export default {
// Transmet la création d'un filtre // Transmet la création d'un filtre
// @arg filtre le filtre créé // @arg filtre le filtre créé
this.$emit("creer_filtre", {filtre: event}) this.$emit("creer_filtre", {filtre: event})
},
/**
* @vuese
* Permet de savoir si les lignes sélectionnées ont été déposées sur un tag
*/
lignesDropped: function () {
this.$emit("lignesDropped")
},
/**
* @vuese
* Permet de remonter l'info pour un tag libre associé via drag&drop
*/
actionTagLibre: function (event) {
this.$emit("actionTagLibre", {creation: event.creation, id_contenu: event.id_contenu})
} }
}, },
data: function () { data: function () {
...@@ -66,11 +83,11 @@ export default { ...@@ -66,11 +83,11 @@ export default {
texte: "Ajoutez des filtres pour restreindre les contenus de la banque ou du panier en sélectionnant le filtre à appliquer dans la zone de choix ci dessus" texte: "Ajoutez des filtres pour restreindre les contenus de la banque ou du panier en sélectionnant le filtre à appliquer dans la zone de choix ci dessus"
} }
} }
/* watch: { /* watch: {
modeFiltre: function () { modeFiltre: function () {
this.filtre_choisi = "" this.filtre_choisi = ""
} }
},*/ },*/
} }
</script> </script>
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<mavon-editor :language="'fr'" style="position: static; height: 79vh; margin-top: -0.5%" v-model="texteDuContenu"/> <mavon-editor :language="'fr'" style="position: static; height: 79vh; margin-top: -0.5%" v-model="texteDuContenu"/>
</div> </div>
<TagsLibres v-show="isModeTag" v-bind:contenu="this.contenuClique" v-bind:auteur="auteur" @actionTagLibre="actionTagLibre" <TagsLibres v-show="isModeTag" v-bind:contenu="this.contenuClique" v-bind:auteur="auteur" @actionTagLibre="actionTagLibre"
style="position: static; height: 79vh; margin-top: -0.5%" v-bind:darktheme="darktheme" @chargerTagsLibres="chargerTagsLibres"></TagsLibres> style="position: static; height: 79vh; margin-top: -0.5%" v-bind:darktheme="darktheme" @chargerTagsLibres="chargerTagsLibres" v-bind:tagLibreAssocie="tagLibreAssocie"></TagsLibres>
<div class="markdown"> <div class="markdown">
<br> <br>
<button id="validerModif" v-on:click="action('valider')">modifier </button> <button id="validerModif" v-on:click="action('valider')">modifier </button>
...@@ -95,6 +95,8 @@ export default { ...@@ -95,6 +95,8 @@ export default {
contenuClique: {}, contenuClique: {},
// Signal d'activation ou non du theme sombre // Signal d'activation ou non du theme sombre
darktheme: {}, darktheme: {},
// Récupération d'un tag libre ajouté
tagLibreAssocie: {}
}, },
data: function () { data: function () {
return { return {
...@@ -252,13 +254,17 @@ export default { ...@@ -252,13 +254,17 @@ export default {
this.isContenuRefuse = Object.prototype.hasOwnProperty.call(this.contenuClique, 'refuse'); this.isContenuRefuse = Object.prototype.hasOwnProperty.call(this.contenuClique, 'refuse');
if (this.contenuCliqueProvenance === 'perso'){ if (this.contenuCliqueProvenance === 'perso'){
this.versionMax = this.contenuClique.versionEnCours.numero this.versionMax = this.contenuClique.versionEnCours.numero
this.versionChoisie = this.versionMax this.versionChoisie = this.versionMax
} else {
this.versionChoisie = this.contenuClique.version
} }
let that = this let that = this
Service.recupererNoteContenu(JSON.stringify(this.contenuClique._id), this.auteur, this.contenuClique.version).then(function (result) { Service.recupererNoteContenu(JSON.stringify(this.contenuClique._id), this.auteur, this.versionChoisie).then(function (result) {
let nombre = result.data let nombre = result.data
if (nombre !== '-1'){ if (nombre !== '-1'){
nombre = JSON.parse(nombre) nombre = JSON.parse(nombre)
...@@ -273,7 +279,8 @@ export default { ...@@ -273,7 +279,8 @@ export default {
*/ */
versionChoisie: function () { versionChoisie: function () {
this.noteContenu = this.calculerNoteContenu this.noteContenu = this.calculerNoteContenu
} },
} }
} }
......
...@@ -18,7 +18,7 @@ isActif ? {'margin-left': '1vw', 'margin-right': '1vw'} : {'margin-left': '0.6vw ...@@ -18,7 +18,7 @@ isActif ? {'margin-left': '1vw', 'margin-right': '1vw'} : {'margin-left': '0.6vw
v-bind:filtre_choisi="filtre_choisi"/> v-bind:filtre_choisi="filtre_choisi"/>
<Volet_Contenu v-bind:darktheme="darktheme" @mode_choisi="ajusterMode" v-bind:filtre_choisi="filtre_choisi" v-bind:variante="variante" <Volet_Contenu v-bind:darktheme="darktheme" @mode_choisi="ajusterMode" v-bind:filtre_choisi="filtre_choisi" v-bind:variante="variante"
v-bind:auteur="auteur" @filtresChoisis="filtresChoisis" v-bind:razModeVariante="razModeVariante" v-bind:auteur="auteur" @filtresChoisis="filtresChoisis" v-bind:razModeVariante="razModeVariante"
v-bind:deconnexion="deconnexion" /> v-bind:deconnexion="deconnexion" v-bind:checkes="checkes" @lignesDropped="lignesDropped" @actionTagLibre="actionTagLibre" />
</div> </div>
</div> </div>
</div> </div>
...@@ -37,11 +37,7 @@ isActif ? {'margin-left': '1vw', 'margin-right': '1vw'} : {'margin-left': '0.6vw ...@@ -37,11 +37,7 @@ isActif ? {'margin-left': '1vw', 'margin-right': '1vw'} : {'margin-left': '0.6vw
</div> </div>
<!-- <table v-bind:style="panierChoisi ? {'margin-top': '0%'} : {'margin-top': '24px'}">--> <!-- <table v-bind:style="panierChoisi ? {'margin-top': '0%'} : {'margin-top': '24px'}">-->
<table :style="{ <table :style="{'margin-top': (panierChoisi ? '0%' : '24px' ), 'margin-left': (isActif ? '20px' : '1.5%' ),'margin-right': '20px'}" >
'margin-top': (panierChoisi ? '0%' : '24px' ),
'margin-left': (isActif ? '20px' : '1.5%' ),
'margin-right': '20px'
}" >
<thead> <thead>
<tr> <tr>
<th v-bind:colspan="isActif ? 10 : (panierChoisi ? 12 : 11)">Contenus</th> <th v-bind:colspan="isActif ? 10 : (panierChoisi ? 12 : 11)">Contenus</th>
...@@ -60,8 +56,8 @@ isActif ? {'margin-left': '1vw', 'margin-right': '1vw'} : {'margin-left': '0.6vw ...@@ -60,8 +56,8 @@ isActif ? {'margin-left': '1vw', 'margin-right': '1vw'} : {'margin-left': '0.6vw
<th v-on:click="trierColonne" v-show="!isActif && panierChoisi">Tags Libres</th> <th v-on:click="trierColonne" v-show="!isActif && panierChoisi">Tags Libres</th>
<th v-on:click="trierColonne" >Type</th> <th v-on:click="trierColonne" >Type</th>
<th v-on:click="trierColonne">Source</th> <th v-on:click="trierColonne">Source</th>
<!-- <th v-on:click="supprimerContenus" class="supprimerContenus"> <!-- <th v-on:click="supprimerContenus" class="supprimerContenus">
<img v-bind:style="{'background-color': 'orange'}" v-bind:src="panierChoisi ? imgPoubelle : imgEtoile" alt='' height=20 width=20/></th>--> <img v-bind:style="{'background-color': 'orange'}" v-bind:src="panierChoisi ? imgPoubelle : imgEtoile" alt='' height=20 width=20/></th>-->
<th v-on:click="supprimerContenus" class="supprimerContenus"> <span v-bind:class="panierChoisi ? 'imgPoubelle' : 'imgEtoile'"></span></th> <th v-on:click="supprimerContenus" class="supprimerContenus"> <span v-bind:class="panierChoisi ? 'imgPoubelle' : 'imgEtoile'"></span></th>
</tr> </tr>
...@@ -125,10 +121,6 @@ isActif ? {'margin-left': '1vw', 'margin-right': '1vw'} : {'margin-left': '0.6vw ...@@ -125,10 +121,6 @@ isActif ? {'margin-left': '1vw', 'margin-right': '1vw'} : {'margin-left': '0.6vw
</tbody> </tbody>
</table> </table>
<div id=prout style="height: 100px; width: 150px; border: 1px solid orange; margin-top: 10px; margin-left: 1vw; color: orange">La Zone</div>
<p id="t">{{pt}}</p>
<!--<tooltip />-->
<div id="ajouterContenu" v-show="panierChoisi && !modeModification" class="circle" v-bind:class="darktheme ? 'circleDark' : ''" <div id="ajouterContenu" v-show="panierChoisi && !modeModification" class="circle" v-bind:class="darktheme ? 'circleDark' : ''"
v-bind:style="{'margin-left': (!isActif ? '94.8%' : '94%')}"> v-bind:style="{'margin-left': (!isActif ? '94.8%' : '94%')}">
<b-popover target="ajouterContenu" triggers="click" placement="lefttop"> <b-popover target="ajouterContenu" triggers="click" placement="lefttop">
...@@ -145,7 +137,7 @@ isActif ? {'margin-left': '1vw', 'margin-right': '1vw'} : {'margin-left': '0.6vw ...@@ -145,7 +137,7 @@ isActif ? {'margin-left': '1vw', 'margin-right': '1vw'} : {'margin-left': '0.6vw
<Modifier_Contenu v-bind:auteur="auteur" v-bind:texteDuContenu = "texteDuContenu" v-bind:contenuCliqueProvenance = "contenuCliqueProvenance" <Modifier_Contenu v-bind:auteur="auteur" v-bind:texteDuContenu = "texteDuContenu" v-bind:contenuCliqueProvenance = "contenuCliqueProvenance"
v-show="modeModification" @actionContenu="actionContenu" v-bind:contenuClique = "contenuClique" v-bind:darktheme="darktheme" v-show="modeModification" @actionContenu="actionContenu" v-bind:contenuClique = "contenuClique" v-bind:darktheme="darktheme"
@choixModif="choixModif" v-bind:titreContenu="titreContenu" @majMoyenne="majMoyenne" @actionTagLibre="actionTagLibre" @choixModif="choixModif" v-bind:titreContenu="titreContenu" @majMoyenne="majMoyenne" @actionTagLibre="actionTagLibre"
@chargerTagsLibres="chargerTagsLibres"/> @chargerTagsLibres="chargerTagsLibres" v-bind:tagLibreAssocie="tagLibreAssocie"/>
</div> </div>
</template> </template>
...@@ -230,6 +222,7 @@ export default { ...@@ -230,6 +222,7 @@ export default {
chocolat: '<h1 id="hellomarkdown">hello, markdown!</h1>', chocolat: '<h1 id="hellomarkdown">hello, markdown!</h1>',
isDeconnecte: false, isDeconnecte: false,
pt: '', pt: '',
tagLibreAssocie: '',
imgEtoile: "https://previews.123rf.com/images/ylivdesign/ylivdesign1612/ylivdesign161208906/67933171-ic%C3%B4ne-%C3%A9toile-%C3%A0-cinq-branches-jaunes-illustration-de-dessin-anim%C3%A9-d-ic%C3%B4ne-de-vecteur-%C3%A9toile-jaune-%C3%A0-cinq-branches-.jpg", imgEtoile: "https://previews.123rf.com/images/ylivdesign/ylivdesign1612/ylivdesign161208906/67933171-ic%C3%B4ne-%C3%A9toile-%C3%A0-cinq-branches-jaunes-illustration-de-dessin-anim%C3%A9-d-ic%C3%B4ne-de-vecteur-%C3%A9toile-jaune-%C3%A0-cinq-branches-.jpg",
imgPoubelle: "data:image/png;base64,iVBORw0KGgoAAAANSUh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aTpKhNiNcAUMhDnZZl4nQhwGki/2s+2GGQvh4si4TJcJfQfn7olA4O4bCcf1LQmAObiuFbV8SApm/14tJdYWyLuP/LMmfyCMfwUUzQNQV4mkSGVpEOvA5u633i+oKF+WnMgZ7pat4Ip0apOOb2TNdIUILmXuM5NJw7hfBRdNN0RXCAZKhRYw+DCBDOzhczXurK8S9kq6f/7MkfyIzowgXmvdWV4h7tRTfEaVosUY6NQj5mjNPV4gZLStVkVya/50XkTfUKxe6QuxK4sR5CJSl6XG6Gq53c33qCrHehOMdpQ8DiKIK3s/VTJ/pCpGYExlv/4dHm0inpvy4uT51hcazFrFcGs5AlB83vWldofGsRZQ+DCDzZPj5FgrVj8bpwwCydKE+c1FVKBPncYoWa2QeA9tHI5OqKkRWVOb0I+UwVljja1QuVIWoWlh/oyhYc6zR86YqtF4+G+vA79E+AUel4YqpCuHgyeDJQUMdcV7DnW4EF6pC4+Wzvu/01BA+F0rwy1aFCENEM0CX/7ByO0QhTQ1r1fd568FyoD4MsGwO8KI3m41P5/3GuJez8YpZ47OX/fnpeDaTOX3vF2AxonTxwm82qfMs+vQjFS3WKO/5/BDRXJrP/38lcfowgPIWzA8R40mLBp+s0FuOwr+v8HP/J2Kssswa7R+PvJ94B776yv8PEKtosUZ7Sff7iZbDWKH8v5IPEM+l+ewjP96Br79m/v3EKlokSZIkSZIkX81/MjFrMKxwu60AAAAASUVORK5CYII="
} }
...@@ -318,8 +311,8 @@ export default { ...@@ -318,8 +311,8 @@ export default {
drop: function() { drop: function() {
/* let prouto = chamo.substring(chamo.split('oid', 2).join('oid').length) /* let prouto = chamo.substring(chamo.split('oid', 2).join('oid').length)
let cacko = prouto.substring(prouto.search(":") + 3, prouto.search("}") - 2)*/ let cacko = prouto.substring(prouto.search(":") + 3, prouto.search("}") - 2)*/
//console.log("cacko" + cacko) //console.log("cacko" + cacko)
//caca += cacko //caca += cacko
...@@ -330,10 +323,10 @@ export default { ...@@ -330,10 +323,10 @@ export default {
} }
that.pt = idDragged that.pt = idDragged
/* $( this ) /* $( this )
.addClass( "ui-state-highlight" ) .addClass( "ui-state-highlight" )
.find( "p" ) .find( "p" )
.html( "Dropped!" );*/ .html( "Dropped!" );*/
} }
}) })
...@@ -344,7 +337,7 @@ export default { ...@@ -344,7 +337,7 @@ export default {
* Formatte les tags libres du contenu (si existants) * Formatte les tags libres du contenu (si existants)
*/ */
tagsLibresContenu: function(item){ tagsLibresContenu: function(item){
// return item.tags_libres.toString() // return item.tags_libres.toString()
if (item.tags_libres === undefined) if (item.tags_libres === undefined)
return "" return ""
else else
...@@ -635,16 +628,20 @@ export default { ...@@ -635,16 +628,20 @@ export default {
let existant = false let existant = false
event.target.parentNode.parentNode.classList.toggle("pipi") event.target.parentNode.parentNode.classList.toggle("pipi")
//alert(event.target.parentNode.parentNode.className)
if (! Object.values(event.target.parentNode.parentNode.classList).includes("pipi")){
event.target.parentNode.parentNode.className = []
}
$('.pipi').draggable({ $('.pipi').draggable({
helper: function(){ helper: function(){
// var container = $('<div/>').attr('id', 'draggingContainer'); // var container = $('<div/>').attr('id', 'draggingContainer');
let container = $('<div/>').attr('id', 'draggingContainer'); let container = $('<div/>').attr('id', 'draggingContainer');
container.append($('.pipi').clone()); container.append($('.pipi').clone());
return container; return container;
} }
}) })
for (let i = 0; i < this.checkes.length; i++){ for (let i = 0; i < this.checkes.length; i++){
if (this.checkes[i][0] === idContenu){ if (this.checkes[i][0] === idContenu){
...@@ -809,7 +806,7 @@ export default { ...@@ -809,7 +806,7 @@ export default {
let filtre_tags_libres = (event.filtres.filter(contenu => contenu.type === 'tags libres').map(contenu => contenu.filtre)) let filtre_tags_libres = (event.filtres.filter(contenu => contenu.type === 'tags libres').map(contenu => contenu.filtre))
// contenusFiltres.forEach(contenu => console.log(contenu.tags_libres.length)) // contenusFiltres.forEach(contenu => console.log(contenu.tags_libres.length))
for (let i = 0; i < filtre_tags_libres.length; i++) { for (let i = 0; i < filtre_tags_libres.length; i++) {
if(filtre_tags_libres[i] === 'sans Tag Libre'){ if(filtre_tags_libres[i] === 'sans Tag Libre'){
...@@ -883,9 +880,9 @@ export default { ...@@ -883,9 +880,9 @@ export default {
this.contenusbanque = contenusFiltres this.contenusbanque = contenusFiltres
} }
}, },
/* basculeRechercheFiltre: function (event) { /* basculeRechercheFiltre: function (event) {
this.modeFiltre = event.choix this.modeFiltre = event.choix
},*/ },*/
/** /**
* @vuese * @vuese
* FOnction qui permet de trier une colonne (ordre croissant nombre clicks impairs, ordre décroissant clicks pairs) * FOnction qui permet de trier une colonne (ordre croissant nombre clicks impairs, ordre décroissant clicks pairs)
...@@ -1015,7 +1012,6 @@ export default { ...@@ -1015,7 +1012,6 @@ export default {
*/ */
actionTagLibre: function (event) { actionTagLibre: function (event) {
if(event.creation === undefined){ if(event.creation === undefined){
let contenu = this.contenus.filter(cont => cont._id === event.id_contenu ) let contenu = this.contenus.filter(cont => cont._id === event.id_contenu )
this.contenus = this.contenus.filter(cont => cont._id !== event.id_contenu ) this.contenus = this.contenus.filter(cont => cont._id !== event.id_contenu )
...@@ -1029,11 +1025,12 @@ export default { ...@@ -1029,11 +1025,12 @@ export default {
} }
// on est dans le cadre de l'ajout d'un tag // on est dans le cadre de l'ajout d'un tag
else { else {
console.log(event)
let contenu = this.contenus.filter(cont => cont._id === event.id_contenu ) let contenu = this.contenus.filter(cont => cont._id === event.id_contenu )
this.contenus = this.contenus.filter(cont => cont._id !== event.id_contenu ) this.contenus = this.contenus.filter(cont => cont._id !== event.id_contenu )
contenu[0].tags_libres = contenu[0].tags_libres.filter(tag => tag !== event.creation)
contenu[0].tags_libres.push(event.creation) contenu[0].tags_libres.push(event.creation)
this.tagLibreAssocie = event.id_contenu
this.contenus.push(contenu[0]) this.contenus.push(contenu[0])
} }
...@@ -1044,7 +1041,20 @@ export default { ...@@ -1044,7 +1041,20 @@ export default {
*/ */
chargerTagsLibres: function () { chargerTagsLibres: function () {
this.$emit("chargerTagsLibres") this.$emit("chargerTagsLibres")
} },
/**
* @vuese
* Permet de savoir si les lignes sélectionnées ont été déposées sur un tag
* On désactive toutes les lignes cochées après coup
*/
lignesDropped: function () {
this.checkes = []
$(".horns").prop( "checked", false )
$(".horns").parent().parent().removeClass()
// alert($(".horns").parent().parent().parent().prop('nodeName'))
// alert($(".horns").parent().parent().prop('nodeName'))
},
} }
} }
......
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
</div> </div>
<div id = "detailContenu"> <div id = "detailContenu">
<Detail_Contenu v-bind:panierChoisi="panierChoisi" v-bind:filtre_choisi="filtre_choisi" <Detail_Contenu v-bind:panierChoisi="panierChoisi" v-bind:filtre_choisi="filtre_choisi"
v-bind:auteur="auteur" v-bind:darktheme="darktheme" @creer_filtre="creer_filtre" v-bind:deconnexion="deconnexion"/> v-bind:auteur="auteur" v-bind:darktheme="darktheme" @creer_filtre="creer_filtre"
v-bind:deconnexion="deconnexion" v-bind:checkes="checkes" @lignesDropped="lignesDropped"
@actionTagLibre="actionTagLibre"/>
</div> </div>
<div id="detailChoixMode"> <div id="detailChoixMode">
<Choix_Mode v-show="!variante" v-bind:darktheme="darktheme" @mode_choisi="ajusterMode" v-bind:razModeVariante="razModeVariante" /> <Choix_Mode v-show="!variante" v-bind:darktheme="darktheme" @mode_choisi="ajusterMode" v-bind:razModeVariante="razModeVariante" />
...@@ -41,7 +43,9 @@ export default { ...@@ -41,7 +43,9 @@ export default {
// Signal d'activation ou non du theme sombre // Signal d'activation ou non du theme sombre
darktheme: {}, darktheme: {},
// Signal de deconnexion // Signal de deconnexion
deconnexion: {} deconnexion: {},
// lignes cochées
checkes: {}
}, },
methods: { methods: {
...@@ -74,6 +78,20 @@ export default { ...@@ -74,6 +78,20 @@ export default {
// @arg les filtres choisis // @arg les filtres choisis
this.$emit("filtresChoisis", {filtres: event.filtres}) this.$emit("filtresChoisis", {filtres: event.filtres})
},
/**
* @vuese
* Permet de savoir si les lignes sélectionnées ont été déposées sur un tag
*/
lignesDropped: function () {
this.$emit("lignesDropped")
},
/**
* @vuese
* Permet de remonter l'info pour un tag libre associé via drag&drop
*/
actionTagLibre: function (event) {
this.$emit("actionTagLibre", {creation: event.creation, id_contenu: event.id_contenu})
} }
}, },
data: function () { data: function () {
......
...@@ -16,20 +16,25 @@ ...@@ -16,20 +16,25 @@
<!-- affichage des filtres personnels de l'utilisateur --> <!-- affichage des filtres personnels de l'utilisateur -->
<ul v-for="filtre in filtresNiveauUn" :key="filtre" class="tagsLibres"> <ul v-for="filtre in filtresNiveauUn" :key="filtre" class="tagsLibres">
<!-- <li v-on:click="nouveauFiltre(filtre)"><span class="niveauInamovible"></span>{{ filtre }}--> <!-- <li v-on:click="nouveauFiltre(filtre)"><span class="niveauInamovible"></span>{{ filtre }}-->
<li @click="!editMode ? nouveauFiltre($event, filtre) : ''"> <div class="droppable">
<span :class="isSousEmbranchement(filtre) > 0 ? 'niveau' : 'niveauInamovible'" @click="naviguer"></span>{{ filtre }} <li @click="!editMode ? nouveauFiltre($event, filtre) : ''">
<span v-if="editMode" v-bind:class="darktheme ? 'poubelDark' : 'poubel'" @click="supprimerTagLibre($event, filtre)"></span> <span :class="isSousEmbranchement(filtre) > 0 ? 'niveau' : 'niveauInamovible'" @click="naviguer"></span>{{ filtre }}
<span v-if="editMode" v-bind:class="darktheme ? 'nouvelEchelonDark' : 'nouvelEchelon'" @click="ajouterTagLibre"></span></li> <span v-if="editMode" v-bind:class="darktheme ? 'poubelDark' : 'poubel'" @click="supprimerTagLibre($event, filtre)"></span>
<span v-if="editMode" v-bind:class="darktheme ? 'nouvelEchelonDark' : 'nouvelEchelon'" @click="ajouterTagLibre"></span></li>
</div>
<li hidden="hidden" class="blocLibre"><span class="niveauInamovible"></span> <li hidden="hidden" class="blocLibre"><span class="niveauInamovible"></span>
<input type="text" style="width: 150px; height: 20px" v-model="nouveauTexteLibre"> <input type="text" style="width: 150px; height: 20px" v-model="nouveauTexteLibre">
<span v-bind:class="darktheme ? 'validerCocheDark' : 'validerCoche'" v-on:click="creerTagLibreEchelon($event, filtre)"></span> <span v-bind:class="darktheme ? 'validerCocheDark' : 'validerCoche'" v-on:click="creerTagLibreEchelon($event, filtre)"></span>
<span v-bind:class="darktheme ? 'annulerCocheDark' : 'annulerCoche'" @click="masquerTagLibre"></span></li> <span v-bind:class="darktheme ? 'annulerCocheDark' : 'annulerCoche'" @click="masquerTagLibre"></span></li>
<ul v-for="filtre in filtresNiveauDeux(filtre)" :key="filtre" class="tagsLibres cache"> <ul v-for="filtre in filtresNiveauDeux(filtre)" :key="filtre" class="tagsLibres cache">
<li @click="!editMode ? nouveauFiltre($event, filtre) : ''" class="blocLibre"> <div class="droppable">
<span :class="isSousEmbranchement(filtre) > 0 ? 'niveau' : 'niveauInamovible'" @click="naviguer"></span>{{affichageFiltreDeux(filtre)}}
<span v-if="editMode" v-bind:class="darktheme ? 'poubelDark' : 'poubel'" @click="supprimerTagLibre($event, filtre)"></span> <li @click="!editMode ? nouveauFiltre($event, filtre) : ''" class="blocLibre">
<span v-if="editMode" v-bind:class="darktheme ? 'nouvelEchelonDark' : 'nouvelEchelon'" @click="ajouterTagLibre"></span></li> <span :class="isSousEmbranchement(filtre) > 0 ? 'niveau' : 'niveauInamovible'" @click="naviguer"></span>{{affichageFiltreDeux(filtre)}}
<span v-if="editMode" v-bind:class="darktheme ? 'poubelDark' : 'poubel'" @click="supprimerTagLibre($event, filtre)"></span>
<span v-if="editMode" v-bind:class="darktheme ? 'nouvelEchelonDark' : 'nouvelEchelon'" @click="ajouterTagLibre"></span></li>
</div>
<li hidden="hidden" class="blocLibreDeux"><span class="niveauInamovible"></span> <li hidden="hidden" class="blocLibreDeux"><span class="niveauInamovible"></span>
<input type="text" style="width: 150px; height: 20px" v-model="nouveauTexteLibre"> <input type="text" style="width: 150px; height: 20px" v-model="nouveauTexteLibre">
...@@ -37,21 +42,28 @@ ...@@ -37,21 +42,28 @@
<span v-bind:class="darktheme ? 'annulerCocheDark' : 'annulerCoche'" @click="masquerTagLibre"></span></li> <span v-bind:class="darktheme ? 'annulerCocheDark' : 'annulerCoche'" @click="masquerTagLibre"></span></li>
<ul v-for="filtre in filtresNiveauTrois(filtre)" :key="filtre" class="tagsLibres cache"> <ul v-for="filtre in filtresNiveauTrois(filtre)" :key="filtre" class="tagsLibres cache">
<li @click="!editMode ? nouveauFiltre($event, filtre) : ''" class="blocLibreDeux"> <div class="droppable">
<span :class="isSousEmbranchement(filtre) > 0 ? 'niveau' : 'niveauInamovible'" @click="naviguer"></span>{{affichageFiltreTrois(filtre) }}
<span v-if="editMode" v-bind:class="darktheme ? 'poubelDark' : 'poubel'" @click="supprimerTagLibre($event, filtre)"></span> <li @click="!editMode ? nouveauFiltre($event, filtre) : ''" class="blocLibreDeux">
<span v-if="editMode" v-bind:class="darktheme ? 'nouvelEchelonDark' : 'nouvelEchelon'" @click="ajouterTagLibre"></span></li> <span :class="isSousEmbranchement(filtre) > 0 ? 'niveau' : 'niveauInamovible'" @click="naviguer"></span>{{affichageFiltreTrois(filtre) }}
<span v-if="editMode" v-bind:class="darktheme ? 'poubelDark' : 'poubel'" @click="supprimerTagLibre($event, filtre)"></span>
<span v-if="editMode" v-bind:class="darktheme ? 'nouvelEchelonDark' : 'nouvelEchelon'" @click="ajouterTagLibre"></span></li>
</div>
<li hidden="hidden" class="blocLibreTrois"><span class="niveauInamovible"></span> <li hidden="hidden" class="blocLibreTrois"><span class="niveauInamovible"></span>
<input type="text" style="width: 150px; height: 20px" v-model="nouveauTexteLibre"> <input type="text" style="width: 150px; height: 20px" v-model="nouveauTexteLibre">
<span v-bind:class="darktheme ? 'validerCocheDark' : 'validerCoche'" v-on:click="creerTagLibreEchelon($event, filtre)"></span> <span v-bind:class="darktheme ? 'validerCocheDark' : 'validerCoche'" v-on:click="creerTagLibreEchelon($event, filtre)"></span>
<span v-bind:class="darktheme ? 'annulerCocheDark' : 'annulerCoche'" @click="masquerTagLibre"></span></li> <span v-bind:class="darktheme ? 'annulerCocheDark' : 'annulerCoche'" @click="masquerTagLibre"></span></li>
<ul v-for="filtre in filtresNiveauQuatre(filtre)" :key="filtre" class="tagsLibres cache"> <ul v-for="filtre in filtresNiveauQuatre(filtre)" :key="filtre" class="tagsLibres cache">
<li @click="!editMode ? nouveauFiltre($event, filtre) : ''" class="blocLibreTrois"> <div class="droppable">
<span :class="isSousEmbranchement(filtre) > 0 ? 'niveau' : 'niveauInamovible'" @click="naviguer"></span>{{ affichageFiltreQuatre(filtre) }}
<span v-if="editMode" v-bind:class="darktheme ? 'poubelDark' : 'poubel'" @click="supprimerTagLibre($event, filtre)"></span> <li @click="!editMode ? nouveauFiltre($event, filtre) : ''" class="blocLibreTrois">
<span v-if="editMode" v-bind:class="darktheme ? 'nouvelEchelonDark' : 'nouvelEchelon'" @click="ajouterTagLibre"></span></li> <span :class="isSousEmbranchement(filtre) > 0 ? 'niveau' : 'niveauInamovible'" @click="naviguer"></span>{{ affichageFiltreQuatre(filtre) }}
<span v-if="editMode" v-bind:class="darktheme ? 'poubelDark' : 'poubel'" @click="supprimerTagLibre($event, filtre)"></span>
<span v-if="editMode" v-bind:class="darktheme ? 'nouvelEchelonDark' : 'nouvelEchelon'" @click="ajouterTagLibre"></span></li>
</div>
<li hidden="hidden" class="blocLibreQuatre"><span class="niveauInamovible"></span> <li hidden="hidden" class="blocLibreQuatre"><span class="niveauInamovible"></span>
<input type="text" style="width: 150px; height: 20px" v-model="nouveauTexteLibre"> <input type="text" style="width: 150px; height: 20px" v-model="nouveauTexteLibre">
<span v-bind:class="darktheme ? 'validerCocheDark' : 'validerCoche'" v-on:click="creerTagLibreEchelon($event, filtre)"></span> <span v-bind:class="darktheme ? 'validerCocheDark' : 'validerCoche'" v-on:click="creerTagLibreEchelon($event, filtre)"></span>
...@@ -65,6 +77,9 @@ ...@@ -65,6 +77,9 @@
</template> </template>
<script> <script>
let $ = require("jquery");
window.$ = window.jQuery = $;
require("jquery-ui-bundle");
import Service from "../../service/Service"; import Service from "../../service/Service";
export default { export default {
...@@ -77,7 +92,9 @@ export default { ...@@ -77,7 +92,9 @@ export default {
// Signal d'activation ou non du theme sombre // Signal d'activation ou non du theme sombre
darktheme: {}, darktheme: {},
// Est-on en mode gestion ou en mode filtre // Est-on en mode gestion ou en mode filtre
modeGestion: {} modeGestion: {},
// lignes cochées
checkes: {}
}, },
data: function () { data: function () {
return { return {
...@@ -100,7 +117,7 @@ export default { ...@@ -100,7 +117,7 @@ export default {
} }
else{ else{
e.target.classList.toggle("niveau-down") e.target.classList.toggle("niveau-down")
e.target.parentNode.nextElementSibling.nextElementSibling.classList.toggle('affiche') e.target.parentNode.parentNode.nextElementSibling.nextElementSibling.classList.toggle('affiche')
} }
}, },
/** /**
...@@ -112,7 +129,7 @@ export default { ...@@ -112,7 +129,7 @@ export default {
// bricolage pour empecher qu'un filtre ne soit créé quand on clique sur une flèche pour activer / desactiver l'arborescence // bricolage pour empecher qu'un filtre ne soit créé quand on clique sur une flèche pour activer / desactiver l'arborescence
if(event.target.tagName !== 'SPAN') if(event.target.tagName !== 'SPAN')
this.$emit("creer_filtre", {filtre: filtre, type: this.filtreChoisi}) this.$emit("creer_filtre", {filtre: filtre, type: this.filtreChoisi})
// alert("filtre" + filtre === undefined + " now loading") // alert("filtre" + filtre === undefined + " now loading")
}, },
/** /**
* @vuese * @vuese
...@@ -131,7 +148,7 @@ export default { ...@@ -131,7 +148,7 @@ export default {
if (tagRacine === "nouveau tag libre"){ if (tagRacine === "nouveau tag libre"){
this.nouveauTagLibre = !this.nouveauTagLibre this.nouveauTagLibre = !this.nouveauTagLibre
} else { } else {
e.target.parentNode.nextElementSibling.hidden = !e.target.parentNode.nextElementSibling.hidden e.target.parentNode.parentNode.nextElementSibling.hidden = !e.target.parentNode.parentNode.nextElementSibling.hidden
} }
}, },
/** /**
...@@ -289,6 +306,54 @@ export default { ...@@ -289,6 +306,54 @@ export default {
return this.filtresLibres.filter(tag => (tag.split("/")).length === 1) return this.filtresLibres.filter(tag => (tag.split("/")).length === 1)
} }
},
updated() {
let that = this
$(".droppable").droppable({
hoverClass: "highlight",
drop: function () {
let tag = ''
that.$emit("lignesDropped")
for (let check in that.checkes){
//console.log(that.checkes[check][0])
//let texteComplet = ''
//alert($(this).attr('class'))
// alert($(this).firstChild.html())
//alert($(this).childNodes)
switch ($(this.firstChild).attr("class")){
case undefined:
tag = $(this).text().trim()
break
case "blocLibre":
tag = ($(this).parent().parent().text()).trim().replaceAll(" ", "/").split('/', 2).join('/')
break
case "blocLibreDeux":
tag = ($(this).parent().parent().parent().text()).trim().replaceAll(" ", "/").split('/', 3).join('/')
break
case "blocLibreTrois":
tag = ($(this).parent().parent().parent().parent().text()).trim().replaceAll(" ", "/").split('/', 4).join('/')
break
default:
break
}
let data = {auteur: that.auteur, id_contenu: JSON.stringify(that.checkes[check][0]), tag: tag}
Service.associerTagLibre(data)
that.$emit("actionTagLibre", {creation: tag, id_contenu: that.checkes[check][0]})
console.log(check + tag)
//alert($(this).first().html())
/* let data = {auteur: that.auteur, id_contenu: JSON.stringify(that.checkes[check][0]), tag: $(this).parent().text().trim()}
Service.associerTagLibre(data)
that.$emit("actionTagLibre", {creation: $(this).parent().text().trim(), id_contenu: that.checkes[check][0]})*/
}
}
})
} }
} }
</script> </script>
...@@ -481,5 +546,10 @@ li { ...@@ -481,5 +546,10 @@ li {
pointer-events: visible; pointer-events: visible;
}*/ }*/
.highlight {
border: 1px solid yellow;
background-color:yellow;
}
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment