martell2010
11/29/2017 - 6:30 PM

test

test

new Vue({
	el: '#app',
	data: {
		mess: "Test",
		items: []
	},
	methods: {
		getData: function () {
			let _this = this;
			me.getProfile(function (err, prof) {
				// console.log(prof);

			});
			me.listGists(function (err, list) {

				_this.items = list;
				console.log(list);
				_this.modData();


			});


		},
		modData: function (data) {
			let _this = this;
			var promise = new Promise(function (resolve, reject) {
				for (let index = 0; index < _this.items.length; index++) {
					for (url in _this.items[index].files) {
						var xhr = new XMLHttpRequest();
						xhr.open('GET', _this.items[index].files[url].raw_url, false);
						xhr.send();
						if (xhr.status == 200) {
							_this.items[index].files[url].raw_url = xhr.responseText;
						}
					}
				}
				resolve();
			}).then(function () {
				let pre = document.querySelectorAll('pre code');
				for (let i = 0; i < pre.length; i++) {
					hljs.highlightBlock(pre[i]);
				}

			})

		}
	}
})