new js folder structure
authorHarris Baptiste <harris.baptiste@iri.centrepompidou.fr>
Tue, 28 Jun 2016 18:25:26 +0200
changeset 39 cd1fab6934a9
parent 38 b319db67a5f3
child 40 38a4c0c31b11
new js folder structure
.hgignore
src/iconolab/static/iconolab/js/iconolab-bundle/.babelrc
src/iconolab/static/iconolab/js/iconolab-bundle/.editorconfig
src/iconolab/static/iconolab/js/iconolab-bundle/.eslintignore
src/iconolab/static/iconolab/js/iconolab-bundle/.eslintrc.js
src/iconolab/static/iconolab/js/iconolab-bundle/.gitignore
src/iconolab/static/iconolab/js/iconolab-bundle/README.md
src/iconolab/static/iconolab/js/iconolab-bundle/index.html
src/iconolab/static/iconolab/js/iconolab-bundle/package.json
src/iconolab/static/iconolab/js/iconolab-bundle/src/App.vue
src/iconolab/static/iconolab/js/iconolab-bundle/src/assets/logo.png
src/iconolab/static/iconolab/js/iconolab-bundle/src/components/taglist/Taglist.vue
src/iconolab/static/iconolab/js/iconolab-bundle/src/components/taglist/template.html
src/iconolab/static/iconolab/js/iconolab-bundle/src/components/typeahead/Typeahead.vue
src/iconolab/static/iconolab/js/iconolab-bundle/src/components/typeahead/data.js
src/iconolab/static/iconolab/js/iconolab-bundle/src/components/typeahead/json-server-data.js
src/iconolab/static/iconolab/js/iconolab-bundle/src/components/typeahead/style.css
src/iconolab/static/iconolab/js/iconolab-bundle/src/components/typeahead/template.html
src/iconolab/static/iconolab/js/iconolab-bundle/src/components/utils/index.js
src/iconolab/static/iconolab/js/iconolab-bundle/src/main.js
src/iconolab/static/iconolab/js/iconolab-bundle/webpack.config.js
--- a/.hgignore	Tue Jun 28 15:54:05 2016 +0200
+++ b/.hgignore	Tue Jun 28 18:25:26 2016 +0200
@@ -5,6 +5,8 @@
 ^__pychache__/
 ^src/iconolab/settings/dev\.py$
 ^src/iconolab/static/iconolab/js/node_modules/
+^src/iconolab/static/iconolab/js/iconolab-bundle/node_modules/
+
 ^web/*
 ^\.pydevproject$
 ^\.project$
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab/static/iconolab/js/iconolab-bundle/.babelrc	Tue Jun 28 18:25:26 2016 +0200
@@ -0,0 +1,3 @@
+{
+  "presets": ["es2015"]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab/static/iconolab/js/iconolab-bundle/.editorconfig	Tue Jun 28 18:25:26 2016 +0200
@@ -0,0 +1,9 @@
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 4
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab/static/iconolab/js/iconolab-bundle/.eslintignore	Tue Jun 28 18:25:26 2016 +0200
@@ -0,0 +1,2 @@
+build/*.js
+config/*.js
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab/static/iconolab/js/iconolab-bundle/.eslintrc.js	Tue Jun 28 18:25:26 2016 +0200
@@ -0,0 +1,23 @@
+module.exports = {
+  root: true,
+  parserOptions: {
+    sourceType: 'module'
+  },
+  // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
+  extends: 'standard',
+  // required to lint *.vue files
+  plugins: [
+    'html'
+  ],
+  // add your custom rules here
+  'rules': {
+    // allow paren-less arrow functions
+    'arrow-parens': 0,
+    // no-multiple-empty-lines
+    'no-multiple-empty-lines': 0,
+    'semi': 1,
+    // allow debugger during development
+    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
+
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab/static/iconolab/js/iconolab-bundle/.gitignore	Tue Jun 28 18:25:26 2016 +0200
@@ -0,0 +1,4 @@
+.DS_Store
+node_modules/
+dist/
+npm-debug.log
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab/static/iconolab/js/iconolab-bundle/README.md	Tue Jun 28 18:25:26 2016 +0200
@@ -0,0 +1,18 @@
+# iconolab-bundle
+
+> iconolab js bundle
+
+## Build Setup
+
+``` bash
+# install dependencies
+npm install
+
+# serve with hot reload at localhost:8080
+npm run dev
+
+# build for production with minification
+npm run build
+```
+
+For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab/static/iconolab/js/iconolab-bundle/index.html	Tue Jun 28 18:25:26 2016 +0200
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8">
+    <title>iconolab-bundle</title>
+  </head>
+  <body>
+    Ajouter un tag: <div id="app" data-tags="radical blaze">
+    </div>
+    <script src="dist/build.js"></script>
+  </body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab/static/iconolab/js/iconolab-bundle/package.json	Tue Jun 28 18:25:26 2016 +0200
@@ -0,0 +1,26 @@
+{
+  "name": "iconolab-bundle",
+  "description": "iconolab js bundle",
+  "author": "hbaptiste",
+  "private": true,
+  "scripts": {
+    "dev": "webpack-dev-server --inline --hot",
+    "build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
+  },
+  "dependencies": {
+    "vue": "^2.0.0-alpha.2",
+    "vue-resource": "^0.9.1",
+    "vue-typeahead": "^2.1.0"
+  },
+  "devDependencies": {
+    "babel-core": "^6.0.0",
+    "babel-loader": "^6.0.0",
+    "babel-preset-es2015": "^6.0.0",
+    "cross-env": "^1.0.6",
+    "css-loader": "^0.23.1",
+    "file-loader": "^0.8.4",
+    "vue-loader": "^9.0.0",
+    "webpack": "^1.12.2",
+    "webpack-dev-server": "^1.12.0"
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab/static/iconolab/js/iconolab-bundle/src/App.vue	Tue Jun 28 18:25:26 2016 +0200
@@ -0,0 +1,22 @@
+<template>
+  <div id="app">
+    <img src="./assets/logo.png">
+    <h1>{{ msg }}</h1>
+  </div>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+      msg: 'Hello Vue 2.0!'
+    }
+  }
+}
+</script>
+
+<style>
+body {
+  font-family: Helvetica, sans-serif;
+}
+</style>
Binary file src/iconolab/static/iconolab/js/iconolab-bundle/src/assets/logo.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab/static/iconolab/js/iconolab-bundle/src/components/taglist/Taglist.vue	Tue Jun 28 18:25:26 2016 +0200
@@ -0,0 +1,91 @@
+<template src='./template.html'></template>
+
+<script>
+
+import { generateId } from '../utils'
+
+export default {
+	data () {
+		return {
+			tags: []
+		}
+	},
+
+	methods: {
+		removeTag: function (index) {
+			this.tags.$remove(index);
+			this.normalizeSelectedTags();
+		}, 
+		
+		/* check tag already exists */
+		tagAlreadyExists (tag) {
+			var result = false;
+			var found = this.tags.find(function (userTag) {
+				if (userTag.tag_url === tag.tag_url) {
+					return true;
+				}
+			});	
+
+			if (found) {
+				var tagNode = this.$refs[found.id][0];
+				tagNode.style.border = "1px solid red";
+				setTimeout(function () {
+					tagNode.style.border = ""; 
+				}, 1000);
+				result = true;
+			}
+			return result;
+		},
+
+		highlight () {
+
+		},
+		
+		setTags (tagArrays){
+			if (!Array.isArray(tagArrays)) { new Error('setTags expects an array!'); }
+			var self = this;
+			tagArrays.map(function (tag) {
+				self.addTag(tag);
+			});
+		},
+
+		addTag (tag) {
+			if (this.tagAlreadyExists(tag)) { return false; }
+
+			if (!tag || !tag.hasOwnProperty('tag_label')) { return; }
+
+			if (!tag.id) {
+				tag.id = generateId('tag_');
+			}
+
+			this.tags.push(tag);
+			this.normalizeSelectedTags();
+		},
+
+		normalizeSelectedTags () {
+			var result = [];
+			
+			this.tags.map(function (tag) {
+				var tagItem = {};
+				tagItem.tag_input = (typeof tag.tag_url === "string") ? tag.tag_url: tag.tag_label;
+				tagItem.accuracy = tag.accuracy;
+				tagItem.relevancy = tag.relevancy;
+				result.push(tagItem);
+			});
+			this.$parent.$data.selectedTags = JSON.stringify(result);
+		},
+
+		updateAccuracy: function (event, tag) {
+			tag.accuracy = event.target.value;
+			this.normalizeSelectedTags();
+	
+		},
+
+		updatePertinence: function (event, tag) {
+			tag.relevancy = event.target.value;
+			this.normalizeSelectedTags();
+		}
+	}
+}
+
+</script>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab/static/iconolab/js/iconolab-bundle/src/components/taglist/template.html	Tue Jun 28 18:25:26 2016 +0200
@@ -0,0 +1,14 @@
+<ul class="tags-wrapper">
+	<li v-for="(tag, index) in tags" :ref="tag.id">
+		<span v-text="tag.tag_label"></span>{{ tag.id }}
+
+		Précision: 	<select @change="updateAccuracy($event, tag)">
+						<option v-for="(no, index) in [1,2,3,4,5]" v-bind:selected="tag.accuracy == no" v-bind:value="no">{{ no }}</option>
+					</select>
+
+		Pertinence: <select @change="updatePertinence($event, tag)">
+						<option v-for="(no, index) in [1,2,3,4,5]" v-bind:selected="tag.relevancy == no" v-bind:value="no">{{ no }}</option>
+					</select>
+					<a @click="removeTag(tag)"> [Effacer] </a>
+	</li>
+</ul>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab/static/iconolab/js/iconolab-bundle/src/components/typeahead/Typeahead.vue	Tue Jun 28 18:25:26 2016 +0200
@@ -0,0 +1,96 @@
+<template src='./template.html'></template>
+<style src='./style.css'></style>
+
+<script>
+	import typeahead from 'vue-typeahead'
+	import data from './data'
+	import Taglist from '../taglist/Taglist.vue'
+
+	var autoCompletePath = "http://lookup.dbpedia.org/api/search/PrefixSearch?MaxHits=5";
+
+	/* get data from parents */
+	var defaultTags = [
+		{tag_label: 'Peinture', tag_url:'http//iconolab/tags/peinture', accuracy:1, relevancy: 3},
+		{tag_label: 'Atelier', tag_url:'http://iconolab/tags/atelier', accuracy:3, relevancy: 5},
+		{tag_label: 'détail', tag_url:'http://iconolab/tags/detail', accuracy:2, relevancy: 2}
+	];
+
+	var parentsMethods = {
+		reset: typeahead.methods.reset
+	};
+
+	export default {
+		extends: typeahead,
+		components: { 'taglist' : Taglist },
+
+		mounted() {
+			this.taglist = this.$refs.taglist;
+			this.taglist.setTags(defaultTags);
+		},
+
+
+		data() {
+			return {
+				src: autoCompletePath,
+				limit: 7,
+				minChars: 2,
+				showAddButton: false,
+				selectedTags: "[]",
+				items: [],
+				queryParamName: "QueryString"
+
+			}
+		},
+
+		methods: {
+
+      		checkQuery () {
+      			if (this.query.length === 0) {
+      				this.reset();
+      			}
+      		},
+      		
+      		reset () {
+      			this.showAddButton = false;
+      			parentsMethods.reset.call(this);
+      		},
+
+      		prepareResponseData (data) {
+      			var data = (typeof data === 'string') ? JSON.parse(data): data;
+      			var results = [];
+
+      			if (data && data.hasOwnProperty('results')) {
+      				var rawResults = data.results; 
+      				rawResults.map(function (item) {
+      					var tagItem = {};
+						tagItem.tag_label = item.label;
+						tagItem.tag_url = item.uri; 
+						tagItem.accuracy = 1;
+						tagItem.relevancy = 1; 
+						results.push(tagItem);
+      				});
+      				data = results;
+      			}      
+
+      			if (data && !data.length) {
+      				this.showAddButton = true;  
+      			}
+      			return data;
+      		},
+
+      		addTag () {
+      			if (this.hasItems) { return false; }
+      			var tag = {tag_label: this.query, accuracy: 1, relevancy: 1};
+      			this.$refs.taglist.addTag(tag);
+      			this.reset();
+      		},
+
+			onHit (selected) {
+				this.$refs.taglist.addTag(selected);
+				this.reset();
+			}
+		}
+
+	}
+
+</script> 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab/static/iconolab/js/iconolab-bundle/src/components/typeahead/data.js	Tue Jun 28 18:25:26 2016 +0200
@@ -0,0 +1,3 @@
+export default function () {
+	return [{"id":1090217586,"id_str":"1090217586","name":"typeahead.js","screen_name":"typeahead","location":"","description":"A flexible JavaScript library that provides a strong foundation for building robust typeaheads. Brought to you by @TwitterOSS.","url":"http://t.co/OXnxPojaag","entities":{"url":{"urls":[{"url":"http://t.co/OXnxPojaag","expanded_url":"http://twitter.github.io/typeahead.js/","display_url":"twitter.github.io/typeahead.js/","indices":[0,22]}]},"description":{"urls":[]}},"protected":false,"followers_count":1113,"friends_count":11,"listed_count":46,"created_at":"Mon Jan 14 21:36:30 +0000 2013","favourites_count":18,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":48,"lang":"en","status":{"created_at":"Sun Aug 24 04:54:18 +0000 2014","id":503404914001735700,"id_str":"503404914001735680","text":"If support for IE7 was dropped in future versions, would you be sad?","truncated":false,"entities":{"hashtags":[],"symbols":[],"user_mentions":[],"urls":[]},"source":"<a href=\"https://about.twitter.com/products/tweetdeck\" rel=\"nofollow\">TweetDeck</a>","in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":false,"retweet_count":5,"favorite_count":5,"favorited":false,"retweeted":false,"lang":"en"},"contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http://abs.twimg.com/images/themes/theme1/bg.png","profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme1/bg.png","profile_background_tile":false,"profile_image_url":"http://pbs.twimg.com/profile_images/378800000017912577/de7d4a2860762bd2f7d7dbef3c2385ee_normal.gif","profile_image_url_https":"https://pbs.twimg.com/profile_images/378800000017912577/de7d4a2860762bd2f7d7dbef3c2385ee_normal.gif","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"has_extended_profile":false,"default_profile":true,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false},{"id":628678010,"id_str":"628678010","name":"Typeahead Tim","screen_name":"TypeaheadTim","location":"","description":"But the problem is...","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":11,"friends_count":0,"listed_count":1,"created_at":"Fri Jul 06 20:01:21 +0000 2012","favourites_count":1,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":10,"lang":"en","status":{"created_at":"Mon May 06 03:19:05 +0000 2013","id":331246715204141060,"id_str":"331246715204141056","text":"RT @CharlieCroom: Spent the day converting Yale Travelogue to use Twitter @typeahead, and it looks badass if I may say so! Cc @vskarich @ja…","truncated":false,"entities":{"hashtags":[],"symbols":[],"user_mentions":[{"screen_name":"CharlieCroom","name":"Charlie Croom","id":311738663,"id_str":"311738663","indices":[3,16]},{"screen_name":"typeahead","name":"typeahead.js","id":1090217586,"id_str":"1090217586","indices":[74,84]},{"screen_name":"vskarich","name":"Veljko Skarich","id":24477185,"id_str":"24477185","indices":[126,135]},{"screen_name":"jashenson","name":"Jared Shenson, MD","id":18169340,"id_str":"18169340","indices":[136,140]},{"screen_name":"baygross","name":"Bay Gross","id":125711649,"id_str":"125711649","indices":[139,140]}],"urls":[]},"source":"<a href=\"http://twitter.com\" rel=\"nofollow\">Twitter for  iPhone</a>","in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"retweeted_status":{"created_at":"Mon May 06 02:50:00 +0000 2013","id":331239394591784960,"id_str":"331239394591784960","text":"Spent the day converting Yale Travelogue to use Twitter @typeahead, and it looks badass if I may say so! Cc @vskarich @jashenson @baygross","truncated":false,"entities":{"hashtags":[],"symbols":[],"user_mentions":[{"screen_name":"typeahead","name":"typeahead.js","id":1090217586,"id_str":"1090217586","indices":[56,66]},{"screen_name":"vskarich","name":"Veljko Skarich","id":24477185,"id_str":"24477185","indices":[108,117]},{"screen_name":"jashenson","name":"Jared Shenson, MD","id":18169340,"id_str":"18169340","indices":[118,128]},{"screen_name":"baygross","name":"Bay Gross","id":125711649,"id_str":"125711649","indices":[129,138]}],"urls":[]},"source":"<a href=\"http://twitter.com/download/android\" rel=\"nofollow\">Twitter for Android</a>","in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"geo":{"type":"Point","coordinates":[37.7721839,-122.4333896]},"coordinates":{"type":"Point","coordinates":[-122.4333896,37.7721839]},"place":{"id":"8d2591b0d50daf32","url":"https://api.twitter.com/1.1/geo/id/8d2591b0d50daf32.json","place_type":"neighborhood","name":"Lower Haight","full_name":"Lower Haight, San Francisco","country_code":"US","country":"United States","contained_within":[],"bounding_box":{"type":"Polygon","coordinates":[[[-122.43738204,37.76955102],[-122.42148192,37.76955102],[-122.42148192,37.77602004],[-122.43738204,37.77602004]]]},"attributes":{}},"contributors":null,"is_quote_status":false,"retweet_count":1,"favorite_count":3,"favorited":false,"retweeted":false,"lang":"en"},"is_quote_status":false,"retweet_count":1,"favorite_count":0,"favorited":false,"retweeted":false,"lang":"en"},"contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http://abs.twimg.com/images/themes/theme1/bg.png","profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme1/bg.png","profile_background_tile":false,"profile_image_url":"http://pbs.twimg.com/profile_images/2373863845/ttim_normal.png","profile_image_url_https":"https://pbs.twimg.com/profile_images/2373863845/ttim_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"has_extended_profile":false,"default_profile":true,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false},{"id":214465198,"id_str":"214465198","name":"Typeaheads","screen_name":"q_typeaheads","location":"","description":"","url":"http://t.co/xWJmBbmPUC","entities":{"url":{"urls":[{"url":"http://t.co/xWJmBbmPUC","expanded_url":"http://www.quora.com/Typeaheads","display_url":"quora.com/Typeaheads","indices":[0,22]}]},"description":{"urls":[]}},"protected":false,"followers_count":0,"friends_count":0,"listed_count":0,"created_at":"Thu Nov 11 13:33:36 +0000 2010","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":2,"lang":"en","status":{"created_at":"Sat Mar 03 19:25:24 +0000 2012","id":176025499447992320,"id_str":"176025499447992320","text":"RT @QuoraQuestions3: What are some autocomplete implementations? Answer: http://t.co/vfgVeFNC","truncated":false,"entities":{"hashtags":[],"symbols":[],"user_mentions":[{"screen_name":"QuoraQuestions3","name":"Quora Questions","id":207901281,"id_str":"207901281","indices":[3,19]}],"urls":[{"url":"http://t.co/vfgVeFNC","expanded_url":"http://qr.ae/RtvZr","display_url":"qr.ae/RtvZr","indices":[73,93]}]},"source":"<a href=\"http://www.quora.com/\" rel=\"nofollow\">Quora</a>","in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"retweeted_status":{"created_at":"Sat Mar 03 19:23:30 +0000 2012","id":176025021511245820,"id_str":"176025021511245824","text":"What are some autocomplete implementations? Answer: http://t.co/vfgVeFNC","truncated":false,"entities":{"hashtags":[],"symbols":[],"user_mentions":[],"urls":[{"url":"http://t.co/vfgVeFNC","expanded_url":"http://qr.ae/RtvZr","display_url":"qr.ae/RtvZr","indices":[52,72]}]},"source":"<a href=\"http://www.quora.com/\" rel=\"nofollow\">Quora</a>","in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":false,"retweet_count":5,"favorite_count":0,"favorited":false,"retweeted":false,"possibly_sensitive":false,"lang":"en"},"is_quote_status":false,"retweet_count":5,"favorite_count":0,"favorited":false,"retweeted":false,"possibly_sensitive":false,"lang":"en"},"contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http://abs.twimg.com/images/themes/theme1/bg.png","profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme1/bg.png","profile_background_tile":false,"profile_image_url":"http://pbs.twimg.com/profile_images/1164807343/logo_normal.png","profile_image_url_https":"https://pbs.twimg.com/profile_images/1164807343/logo_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"has_extended_profile":false,"default_profile":true,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false},{"id":1084687550,"id_str":"1084687550","name":"Typeahead Testing","screen_name":"TypeaheadT","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":true,"followers_count":0,"friends_count":0,"listed_count":0,"created_at":"Sun Jan 13 01:57:43 +0000 2013","favourites_count":0,"utc_offset":-25200,"time_zone":"Pacific Time (US & Canada)","geo_enabled":false,"verified":false,"statuses_count":0,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http://abs.twimg.com/images/themes/theme1/bg.png","profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme1/bg.png","profile_background_tile":false,"profile_image_url":"http://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png","profile_image_url_https":"https://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"has_extended_profile":false,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},{"id":2938107041,"id_str":"2938107041","name":"angular-ui-typeahead","screen_name":"yasuka_158","location":"","description":"We use our original curation technology to create the hottest timeline all about angular-ui-typeahead. We also follow you back 100% guaranteed! #followback #ref","url":"http://t.co/kj0sCh8htQ","entities":{"url":{"urls":[{"url":"http://t.co/kj0sCh8htQ","expanded_url":"http://angular-ui-typeahead.newsin.tk","display_url":"angular-ui-typeahead.newsin.tk","indices":[0,22]}]},"description":{"urls":[]}},"protected":false,"followers_count":0,"friends_count":0,"listed_count":0,"created_at":"Tue Dec 23 09:29:46 +0000 2014","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":62,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http://abs.twimg.com/images/themes/theme1/bg.png","profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme1/bg.png","profile_background_tile":false,"profile_image_url":"http://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png","profile_image_url_https":"https://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"has_extended_profile":false,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},{"id":69295221,"id_str":"69295221","name":"typeahead","screen_name":"typeaheadd7f2s","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":7,"friends_count":26,"listed_count":0,"created_at":"Thu Aug 27 13:51:08 +0000 2009","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":0,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http://abs.twimg.com/images/themes/theme1/bg.png","profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme1/bg.png","profile_background_tile":false,"profile_image_url":"http://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png","profile_image_url_https":"https://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"has_extended_profile":false,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},{"id":2312457006,"id_str":"2312457006","name":"Typeahead","screen_name":"TypeaheadBlog","location":"Florianópolis","description":"Social Media & Digital Marketing & Advertising News","url":"http://t.co/JNtddeVpId","entities":{"url":{"urls":[{"url":"http://t.co/JNtddeVpId","expanded_url":"http://www.Typeahead.com.br","display_url":"Typeahead.com.br","indices":[0,22]}]},"description":{"urls":[]}},"protected":false,"followers_count":66,"friends_count":305,"listed_count":2,"created_at":"Sun Jan 26 20:53:47 +0000 2014","favourites_count":3,"utc_offset":-10800,"time_zone":"Brasilia","geo_enabled":false,"verified":false,"statuses_count":61,"lang":"en","status":{"created_at":"Tue Apr 22 23:01:52 +0000 2014","id":458742513042722800,"id_str":"458742513042722816","text":"@TypeaheadBlog presente no @OlhoCON !","truncated":false,"entities":{"hashtags":[],"symbols":[],"user_mentions":[{"screen_name":"TypeaheadBlog","name":"Typeahead","id":2312457006,"id_str":"2312457006","indices":[0,14]},{"screen_name":"OlhoCON","name":"OlhóCON 2015","id":241129288,"id_str":"241129288","indices":[27,35]}],"urls":[]},"source":"<a href=\"http://twitter.com\" rel=\"nofollow\">Twitter Web Client</a>","in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":2312457006,"in_reply_to_user_id_str":"2312457006","in_reply_to_screen_name":"TypeaheadBlog","geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":false,"retweet_count":0,"favorite_count":1,"favorited":false,"retweeted":false,"lang":"es"},"contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http://abs.twimg.com/images/themes/theme1/bg.png","profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme1/bg.png","profile_background_tile":false,"profile_image_url":"http://pbs.twimg.com/profile_images/428607539349966848/bvVKQImZ_normal.png","profile_image_url_https":"https://pbs.twimg.com/profile_images/428607539349966848/bvVKQImZ_normal.png","profile_banner_url":"https://pbs.twimg.com/profile_banners/2312457006/1390844887","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"has_extended_profile":false,"default_profile":true,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false},{"id":927694424,"id_str":"927694424","name":"Saudi Hacker","screen_name":"dm_typeahead","location":"worldwide","description":"حسابي @SaudiHacker","url":"https://t.co/mpcg5agqyc","entities":{"url":{"urls":[{"url":"https://t.co/mpcg5agqyc","expanded_url":"https://twitter.com/dm_typeahead","display_url":"twitter.com/dm_typeahead","indices":[0,23]}]},"description":{"urls":[]}},"protected":false,"followers_count":11,"friends_count":1,"listed_count":0,"created_at":"Mon Nov 05 14:12:08 +0000 2012","favourites_count":0,"utc_offset":10800,"time_zone":"Minsk","geo_enabled":false,"verified":false,"statuses_count":53,"lang":"ar","status":{"created_at":"Tue Jan 12 20:10:54 +0000 2016","id":687003843738087400,"id_str":"687003843738087425","text":"مراجعة الحاسب المحمول MSI GS60 6QE Ghost Pro https://t.co/uQojOi82Lm","truncated":false,"entities":{"hashtags":[],"symbols":[],"user_mentions":[],"urls":[{"url":"https://t.co/uQojOi82Lm","expanded_url":"http://arabhardware.net/2016/01/12/131421/","display_url":"arabhardware.net/2016/01/12/131…","indices":[45,68]}]},"source":"<a href=\"http://twitter.com/download/android\" rel=\"nofollow\">Twitter for Android</a>","in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":false,"retweet_count":0,"favorite_count":0,"favorited":false,"retweeted":false,"possibly_sensitive":false,"lang":"und"},"contributors_enabled":false,"is_translator":false,"is_translation_enabled":true,"profile_background_color":"000000","profile_background_image_url":"http://abs.twimg.com/images/themes/theme1/bg.png","profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme1/bg.png","profile_background_tile":false,"profile_image_url":"http://pbs.twimg.com/profile_images/723838966311563264/vQXodsYI_normal.jpg","profile_image_url_https":"https://pbs.twimg.com/profile_images/723838966311563264/vQXodsYI_normal.jpg","profile_link_color":"002211","profile_sidebar_border_color":"000000","profile_sidebar_fill_color":"000000","profile_text_color":"000000","profile_use_background_image":false,"has_extended_profile":false,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false}]
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab/static/iconolab/js/iconolab-bundle/src/components/typeahead/json-server-data.js	Tue Jun 28 18:25:26 2016 +0200
@@ -0,0 +1,21 @@
+function randomIntInc (low, high) {
+    return Math.floor(Math.random() * (high - low + 1) + low);
+}
+
+module.exports = function () {
+	
+	var tagList = { tags : [] };
+	for (var i = 0; i <= 10; i++ ) {
+		var tagItem = {};
+		tagItem.id = i + 1;
+		tagItem.name = "tag_no" + i;
+		tagItem.tag_input = "tag no" + i;
+		tagItem.accuracy = randomIntInc(1, 5);
+		tagItem.relevancy = randomIntInc(1, 5);
+		tagItem.type = "dbpedia";
+
+		//tagList.tags.push(tagItem);
+	}
+
+	return tagList;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab/static/iconolab/js/iconolab-bundle/src/components/typeahead/style.css	Tue Jun 28 18:25:26 2016 +0200
@@ -0,0 +1,76 @@
+Typeahead {
+  position: relative;
+}
+.selected-tags { border: 1px solid red; width: 200px !important; }
+.selected-tags select {display: inline-block;}
+
+.Typeahead__input {
+  width: 100%;
+  font-size: 14px;
+  color: #2c3e50;
+  line-height: 1.42857143;
+  box-shadow: inset 0 1px 4px rgba(0,0,0,.4);
+  -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
+  transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
+  font-weight: 300;
+  padding: 12px 26px;
+  border: none;
+  border-radius: 22px;
+  letter-spacing: 1px;
+  box-sizing: border-box;
+}
+.Typeahead__input:focus {
+  border-color: #4fc08d;
+  outline: 0;
+  box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px #4fc08d;
+}
+.fa-times {
+  cursor: pointer;
+}
+i {
+  float: right;
+  position: relative;
+  top: 30px;
+  right: 29px;
+  opacity: 0.4;
+}
+ul {
+  /*position: absolute;*/
+  padding: 0;
+  margin-top: 8px;
+  min-width: 100%;
+  background-color: #fff;
+  list-style: none;
+  border-radius: 4px;
+  box-shadow: 0 0 10px rgba(0,0,0, 0.25);
+  z-index: 1000;
+}
+li {
+  padding: 10px 16px;
+  border-bottom: 1px solid #ccc;
+  cursor: pointer;
+}
+li:first-child {
+  border-radius: 4px 4px 0 0;
+}
+li:last-child {
+  border-radius: 0 0 4px 4px;
+  border-bottom: 0;
+}
+span {
+  display: block;
+  color: #2c3e50;
+}
+.active {
+  background-color: #3aa373;
+}
+.active span {
+  color: white;
+}
+.name {
+  font-weight: 700;
+  font-size: 18px;
+}
+.screen-name {
+  font-style: italic;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab/static/iconolab/js/iconolab-bundle/src/components/typeahead/template.html	Tue Jun 28 18:25:26 2016 +0200
@@ -0,0 +1,32 @@
+<div>
+  <!-- optional indicators -->
+  <i class="fa fa-spinner fa-spin" v-if="loading"></i>
+  <template v-else>
+    <i class="fa fa-search" v-show="isEmpty"></i>
+    <i class="fa fa-times" v-show="isDirty" @click="reset"></i>
+  </template>
+
+  <taglist ref="taglist"></taglist>
+
+  <!-- the input field -->
+  <input type="text"
+         placeholder="..."
+         autocomplete="off"
+         v-model="query"
+         v-on:keyup.8="checkQuery"
+         @keydown.down="down"
+         @keydown.up="up"
+         @keydown.enter="hit"
+         @keydown.esc="reset"
+         @input="update"/>
+
+  <button @click="addTag" v-show="showAddButton">Créer ce tag</button>
+
+  <!-- the list -->
+  <ul v-show="hasItems">
+    <li v-for="(item, index) in items" :class="activeClass(index)" @mousedown="hit" @mousemove="setActive(index)">
+      <span v-text="item.tag_label"></span>
+    </li>
+  </ul>
+  <input v-model="selectedTags" name="tags" type="hidden" />
+</div>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab/static/iconolab/js/iconolab-bundle/src/components/utils/index.js	Tue Jun 28 18:25:26 2016 +0200
@@ -0,0 +1,10 @@
+var generateId = (function () {
+		var cpt = 0;
+		var defautPrefix = "item_"; 
+		return function (prefix) {
+			prefix = (typeof prefix === 'string') ? prefix : defautPrefix;
+			cpt = cpt + 1;
+			return prefix + cpt; 
+		}
+	}());
+export { generateId }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab/static/iconolab/js/iconolab-bundle/src/main.js	Tue Jun 28 18:25:26 2016 +0200
@@ -0,0 +1,12 @@
+import Vue from 'vue'
+import resource from 'vue-resource'
+import Typeahead from './components/typeahead/Typeahead.vue'
+import "expose?jQuery!jquery"
+
+
+Vue.use(resource)
+
+new Vue({
+  el: '#app',
+  render: h => h(Typeahead)
+})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/iconolab/static/iconolab/js/iconolab-bundle/webpack.config.js	Tue Jun 28 18:25:26 2016 +0200
@@ -0,0 +1,57 @@
+var path = require('path')
+var webpack = require('webpack')
+
+module.exports = {
+  entry: './src/main.js',
+  output: {
+    path: path.resolve(__dirname, './dist'),
+    publicPath: '/dist/',
+    filename: 'build.js'
+  },
+  resolveLoader: {
+    root: path.join(__dirname, 'node_modules'),
+  },
+  module: {
+    loaders: [
+      {
+        test: /\.vue$/,
+        loader: 'vue'
+      },
+      {
+        test: /\.js$/,
+        loader: 'babel',
+        exclude: /node_modules/
+      },
+      {
+        test: /\.(png|jpg|gif|svg)$/,
+        loader: 'file',
+        query: {
+          name: '[name].[ext]?[hash]'
+        }
+      }
+    ]
+  },
+  devServer: {
+    historyApiFallback: true,
+    noInfo: true
+  },
+  devtool: '#eval-source-map'
+}
+
+if (process.env.NODE_ENV === 'production') {
+  module.exports.devtool = '#source-map'
+  // http://vue-loader.vuejs.org/en/workflow/production.html
+  module.exports.plugins = (module.exports.plugins || []).concat([
+    new webpack.DefinePlugin({
+      'process.env': {
+        NODE_ENV: '"production"'
+      }
+    }),
+    new webpack.optimize.UglifyJsPlugin({
+      compress: {
+        warnings: false
+      }
+    }),
+    new webpack.optimize.OccurenceOrderPlugin()
+  ])
+}