Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
207fe61
Set Jekyll Page
clcmo Feb 22, 2022
49fc85e
Create Jekyll
clcmo Feb 22, 2022
5bdbf68
Merge pull request #1 from clcmo/dev
clcmo Feb 22, 2022
ff3bd9c
Fix Assets
clcmo Feb 22, 2022
8d228c5
Merge pull request #2 from clcmo/dev
clcmo Feb 22, 2022
6e86b89
Set docs
clcmo Feb 22, 2022
3580c24
Set Docs
clcmo Feb 22, 2022
14ea2dd
Set app to Bulma
clcmo Feb 22, 2022
7758ca3
Update Index
clcmo Feb 22, 2022
1469ffe
Update Status
clcmo Feb 22, 2022
776866c
Update Index
clcmo Feb 22, 2022
38abad3
Update Status
clcmo Feb 22, 2022
0e591a3
Change meta
clcmo Feb 22, 2022
c775d77
Set Default
clcmo Feb 22, 2022
e883e9d
Create SECURITY.md
clcmo Feb 22, 2022
11914c0
Rename SECURITY.md to docs/SECURITY.md
clcmo Feb 22, 2022
2a31e65
Update README.md
clcmo Feb 22, 2022
002b6f2
Create LICENSE
clcmo Feb 22, 2022
311ca4e
Merge pull request #3 from clcmo/add-license-1
clcmo Feb 22, 2022
7c3288b
Fix Css
clcmo Feb 22, 2022
f74b4f4
Merge branch 'master' of https://github.com/clcmo/playlistcreator-exa…
clcmo Feb 22, 2022
4220752
Config baseurl
clcmo Feb 22, 2022
bd850df
Set BaseUrl
clcmo Feb 22, 2022
b65f3cd
Create CNAME
clcmo Feb 22, 2022
933cc1c
Delete CNAME
clcmo Feb 22, 2022
c5891e0
Update CNAME
clcmo Feb 22, 2022
140c05b
Update README.md
clcmo Feb 22, 2022
1a92081
Update Link on Config
clcmo Feb 22, 2022
3bc8a3d
Update README.md
clcmo Feb 22, 2022
aaf2b9a
Create Login
clcmo Feb 22, 2022
a897dd0
Merge branch 'master' of https://github.com/urbanna/playlistcreator-e…
clcmo Feb 22, 2022
5507497
Change Index to Login
clcmo Feb 22, 2022
458495d
Update Index
clcmo Feb 22, 2022
a6badba
Set Template to Login
clcmo Feb 22, 2022
f431752
Update Index
clcmo Feb 22, 2022
e65df23
Restore to Create Playlist
clcmo Feb 23, 2022
5eecb76
Set Callback.html
clcmo Feb 23, 2022
da8c9ea
Create CNAME
clcmo Feb 23, 2022
b285894
Merge branch 'master' into master
clcmo Feb 23, 2022
900428e
Merge pull request #4 from urbanna/master
clcmo Feb 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dev.portalurbanna.com.br
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Camila L. Oliveira

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 0 additions & 3 deletions README.md

This file was deleted.

58 changes: 58 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Playlist Generator
title: Playlist Generator
description: Create your Spotify Playlist
baseurl: http://dev.portalurbanna.com.br/

include: ["_pages"]
permalink: /:title/

# Plugins
plugins:
- jekyll-feed
- jekyll-sitemap
- jekyll-paginate
- jekyll-seo-tag
- jekyll-pug

authors:
milla:
name: Camila L. Oliveira
site: https://camilaloliveira.com.br
avatar: media/images/avatar_milla.png
bio: "Tecnóloga em Análise e Desenvolvimento de Sistemas, Bacharel em Administração Pública, Programadora de Computadores e Dispositivos Móveis e Técnica em Informática para Internet.
Com experiências nas empresas TCS e BRQ, atuando no desenvolvimento de soluções aos clientes há mais de 2 anos."
email: ola@camilaloliveira.com.br
twitter: https://twitter.com/millaloliveira
linkedin: https://linkedin.com/in/clcmo
facebook: https://facebook.com/millaloliveira


# Defaults
defaults:

# all posts
- scope:
path: "_posts"
values:
layout: post
author: milla
avatar: /media/images/avatar_milla.png

# all pages
- scope:
path: "_pages"
values:
layout: page

# Syntax
markdown: kramdown
highlighter: rouge

# Paginate
paginate: 10



# Exclude metadata and development time dependencies (like Grunt plugins)
exclude: [README.markdown, package.json, grunt.js, Gruntfile.js, Gruntfile.coffee, node_modules]

54 changes: 54 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">

<title>{{site.title}}</title>
<meta name="description" content="{{ site.description }}">

<link rel="shortcut icon" type="image/x-icon" href="{{page.baseurl}}/assets/images/logo_urb.png">

<!-- Theme Stylesheet -->
<link rel="stylesheet" href="{{page.baseurl}}/assets/css/default.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.0/css/bulma.min.css">

<!-- Jquery on header to make sure everything works, the rest of the scripts in footer for fast loading -->
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
</head>
</head>

<body translate="no"
{% if page == "/callback.html" %}
onload="doit()"
{% else %}
onload="startApp()"
{% endif %}
>

<section class="hero is-primary">
<div class="hero-body">
<div class="container">
<h1 class="title">
Playlist Generator
</h1>
<h2 class="subtitle">
Generated by Json
</h2>
</div>
</div>
</section>
<section class="section">
{{content}}
</section>

<script type="text/javascript" src="{{page.baseurl}}/assets/js/server.js"></script>
<script type="text/javascript" src="{{page.baseurl}}/assets/js/main.js"></script>
<script type="text/javascript" src="{{page.baseurl}}/assets/js/fuzzyset.js"></script>
<script type="text/javascript" src="{{page.baseurl}}/assets/js/wordcache.js"></script>
<script type="text/javascript" src="{{page.baseurl}}/assets/js/app.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.0.0-alpha.1/handlebars.min.js"></script>
</body>
21 changes: 21 additions & 0 deletions _pages/callback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
layout: default
permalink: "/callback.html"
---

<div class="columns">
<div class="column left">
<div id="creating" style="text-align: center;">
<h3 class="title is-3">Creating playlist...</h3>
</div>
</div>
<div class="column right">
<div id="done" style="display: none; text-align: center;">
<h3 class="title is-3">Done!</h3>
<br />
<button class="button is-success" id="playlistlink">
Open playlist in Spotify
</button>
</div>
</div>
</div>
20 changes: 20 additions & 0 deletions _pages/create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
layout: default
---

<div class="columns">
<div class="column left">
<h3 class="title is-3">Write your text here</h3>
<div class="form-group">
<textarea class="textarea" id="alltext" maxlength="500" placeholder="e.g. Hello world"></textarea>
</div>
<br />
<button class="button is-success" id="start">Create a Spotify playlist!</button>
</div>
<div class="column right">
<h3 class="title is-3">Corresponding track names</h3>
<div id="status"></div>
<br />
<div id="debug"></div>
</div>
</div>
43 changes: 43 additions & 0 deletions _pages/login.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
layout: default
---

<div class="container">
<div id="login">
<h1>This is an example of the Authorization Code flow</h1>
<a href="/login" class="btn btn-primary">Log in with Spotify</a>
</div>
<div id="loggedin">
<div id="user-profile"></div>
<div id="oauth"></div>
<button class="button is-success" id="obtain-new-token">Obtain new token using the refresh token</button>
</div>
</div>

<script id="user-profile-template" type="text/x-handlebars-template">
<h1>Logged in as {{display_name}}</h1>
<div class="media">
<div class="pull-left">
<img class="media-object" width="150" src="{{images.0.url}}" />
</div>
<div class="media-body">
<dl class="dl-horizontal">
<dt>Display name</dt><dd class="clearfix">{{display_name}}</dd>
<dt>Id</dt><dd>{{id}}</dd>
<dt>Email</dt><dd>{{email}}</dd>
<dt>Spotify URI</dt><dd><a href="{{external_urls.spotify}}">{{external_urls.spotify}}</a></dd>
<dt>Link</dt><dd><a href="{{href}}">{{href}}</a></dd>
<dt>Profile Image</dt><dd class="clearfix"><a href="{{images.0.url}}">{{images.0.url}}</a></dd>
<dt>Country</dt><dd>{{country}}</dd>
</dl>
</div>
</div>
</script>

<script id="oauth-template" type="text/x-handlebars-template">
<h2>oAuth info</h2>
<dl class="dl-horizontal">
<dt>Access token</dt><dd class="text-overflow">{{access_token}}</dd>
<dt>Refresh token</dt><dd class="text-overflow">{{refresh_token}}</dd>
</dl>
</script>
10 changes: 10 additions & 0 deletions assets/css/default.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.column left {
position: absolute;
width: 50%;
height: 100%;
}

.column right {
position: absolute;
width: 50%;
}
Binary file added assets/css/logo_urb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 22 additions & 22 deletions app.js → assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@
var g_tracks = '';

function setStatus(text) {
if (text != '') {
if(text != ''){
$('#status').html(
'<div class="progress progress-striped active">' +
'<div class="progress-bar" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%">' +
text +
'</div>' +
'</div>'
'<progress class="progress is-primary is-small" max="100">15%</progress>'
);
} else {
$('#status').html('');
Expand All @@ -32,13 +28,12 @@
}

var refreshText = function() {
setStatus('Updating text...');
setStatus('Loading...');

g_name = $('#alltext').val().trim();
var words = splitText(g_name);
console.log('text changed.', g_name, words);
cache.lookupWords(words, function(worddata) {

setStatus('');

console.log('wordcache callback', worddata);
Expand Down Expand Up @@ -93,13 +88,18 @@
console.log('found', found);
if (found) {
g_tracks.push(found.uri);
txt += '<div class="media">' +
'<a class="pull-left" href="#"><img class="media-object" src="' + found.cover_url + '" /></a>' +
'<div class="media-body">' +
'<h4 class="media-heading"><a href="' + found.uri + '">' + found.name + '</a></h4>' +
'Album: <a href="' + found.album_uri + '">' + found.album +
'</a><br/>Artist: <a href="' + found.artist_uri + '">' + found.artist+'</a>' +
'</div>' +
txt +=
'<div class="media">' +
'<a class="pull-left" href="#">' +
'<img class="media-object" src="' + found.cover_url + '" />' +
'</a>' +
'<div class="media-body">' +
'<h4 class="media-heading">'+
'<a href="' + found.uri + '">' + found.name + '</a>'+
'</h4>' +
'Album: <a href="' + found.album_uri + '">' + found.album +'</a>'+
'<br />Artist: <a href="' + found.artist_uri + '">' + found.artist+'</a>' +
'</div>' +
'</div>\n';
} else {
txt += '<div class="media">No match found for the word "' + data.word+ '"</div>\n'
Expand Down Expand Up @@ -173,12 +173,12 @@
var redirect_uri = '';


if (location.host == 'localhost:8000') {
client_id = 'd37a9e88667b4fb3bc994299de2a52bd';
redirect_uri = 'http://localhost:8000/callback.html';
if (location.host == 'localhost:8888') {
client_id = '2a8909c2980143c496833de968725bf0';
redirect_uri = 'http://localhost:8888/callback.html';
} else {
client_id = '6f9391eff32647baa44b1a700ad4a7fc';
redirect_uri = 'http://lab.possan.se/playlistcreator-example/callback.html';
client_id = '2a8909c2980143c496833de968725bf0';
redirect_uri = 'https://dev.portalurbanna.com.br/callback.html';
}

var doLogin = function(callback) {
Expand All @@ -188,7 +188,7 @@
'&redirect_uri=' + encodeURIComponent(redirect_uri);
localStorage.setItem('createplaylist-tracks', JSON.stringify(g_tracks));
localStorage.setItem('createplaylist-name', g_name);
var w = window.open(url, 'asdf', 'WIDTH=400,HEIGHT=500');
var w = window.open(url, 'asdf', 'WIDTH=400, HEIGHT=500');
}

var refreshtimer = 0;
Expand Down Expand Up @@ -218,4 +218,4 @@
resolveOneWord();
}

})(window);
})(window);
File renamed without changes.
Loading