Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Refactor)URLs to point to new heroku app #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
57 changes: 0 additions & 57 deletions bookmarklet.js

This file was deleted.

13 changes: 2 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,8 @@
<body>
<a href="javascript:(function(){
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://wendyleung.github.io/PandaMarklet/bookmarklet.js';
script.src = 'https://www.dropbox.com/s/2twc1aticlebmt4/jobPanda.js?raw=1';
document.body.appendChild(script);
})();">bookmarklet</a>

<a href="javascript:(function(){
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://wendyleung.github.io/PandaMarklet/jobPanda.js';
document.body.appendChild(script);
})();">jobPanda</a>

})();">jobPanda</a>
</body>
</html>
31 changes: 14 additions & 17 deletions jobPanda.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
showBookMarklet();
} else { // opens new page to website to login.
var anchorTag = document.createElement('a');
anchorTag.setAttribute('href', 'http://jobpanda.herokuapp.com/');
anchorTag.setAttribute('href', 'http://jpanda.herokuapp.com/');
anchorTag.setAttribute('target', '_blank');
document.body.appendChild(anchorTag);
anchorTag.click();
Expand All @@ -42,7 +42,7 @@ var showBookMarklet = function() {

var sendData = function(){
var http = new XMLHttpRequest();
var url = 'https://jobpanda.herokuapp.com/api/listings';
var url = 'https://jpanda.herokuapp.com/api/listings';
http.open('POST', url, true);
http.setRequestHeader('Content-type', 'application/json');
http.send( JSON.stringify(jobObject) );
Expand Down Expand Up @@ -92,25 +92,24 @@ var showBookMarklet = function() {
myHTML, myHTMLNode;

/* add the css */
myCSS = '@import url(https://fonts.googleapis.com/css?family=Roboto:400,300,500,100);';
myCSS += '#my_unique_id, #my_unique_id *{color:#fff;line-height:0;font-size:15px;text-shadow:none;}';
myCSS += '#my_unique_id {z-index:10000;position:fixed;top:0;right:0px;background-color:#fff;}';
myCSS += '#my_unique_id .c {height: 900px;width: 250px;padding:20px; padding-top: 50px; background-color: #00bcd4}';
// myCSS += '#my_unique_id #pandabutton {background-color:#ff4081; color: #fff; border-radius: 5px; padding: 2px 20px; margin-top: 5px}';
myCSS += '#my_unique_id input {color: #333}';
// myCSS += '#my_unique_id .squaredThree, .favorite {display: inline-block;width:20px;margin:20pxauto;position:relative;float:right; margin-top:3px}';
// myCSS += '#my_unique_id .squaredThree label, .favorite label {cursor: pointer;position: absolute;width: 20px;height: 20px;top: 0;border-radius: 4px;-webkit-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,.4);-moz-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,.4);box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,.4);background: -webkit-linear-gradient(top, #fff 0%, #eee 100%);background: -moz-linear-gradient(top, #fff 0%, #eee 100%);background: -o-linear-gradient(top, #fff 0%, #eee 100%);background: -ms-linear-gradient(top, #fff 0%, #eee 100%);background: linear-gradient(top, #fff 0%, #eee 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr="#fff", endColorstr="#eee",GradientType=0 );}';
// myCSS += '#my_unique_id .squaredThree label:after, .favorite label:after {-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter: alpha(opacity=0);opacity: 0;content: "";position: absolute;width: 9px;height: 5px;background: transparent;top: 4px;left: 4px;border: 3px solid #ff4081;border-top: none;border-right: none;-webkit-transform: rotate(-45deg);-moz-transform: rotate(-45deg);-o-transform: rotate(-45deg);-ms-transform: rotate(-45deg);transform: rotate(-45deg);}';
// myCSS += '#my_unique_id .squaredThree label:hover::after, .favorite label:hover::after {-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";filter: alpha(opacity=30);opacity: 0.3;}';
// myCSS += '#my_unique_id .squaredThree input[type=checkbox]:checked + label:after, .favorite input[type=checkbox]:checked + label:after {-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";filter: alpha(opacity=100);opacity: 1;}';
myCSS += '#my_unique_id input {background: transparent;border: none;border-bottom: 1px solid #eee;outline:none;height: 1.5rem;width: 100%;margin: 10px 0 30px 0;color: #000;font-size: 16px;}';

myCSS += '#my_unique_id, #my_unique_id * {color: #000;line-height: 0;font-size: 10px;text-shadow: none;}';

myCSS += '.drawer {min-height: 900px;height: 100%;width: 250px;background: #FAFAFA;box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2);font-family: "Roboto", sans-serif;color: #105F4B;padding: 30px 20px 20px 20px;}'

myCSS += 'button#pandabutton {width: 100%;border: none;border-radius: 2px;position: relative;transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);transition-delay: 0.2s;box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);padding: 20px;width: 50%;color: #fff;background: #E33B2E;text-transform: uppercase; cursor:pointer}'

/* then insert it */
myStyleNode = document.createElement('style');
myStyleNode.innerHTML = myCSS;
document.body.appendChild(myStyleNode);

/* build the HTML element */
myHTML = '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.95.3/css/materialize.min.css">';
myHTML += '<div class="c">';
myHTML = '<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,300,500,100">'
myHTML += '<div class="drawer">';
myHTML += 'Source Network: <br><input id="psource" type="text" value="' + (jobObject["sourceNetwork"] || "") + '">';
myHTML += '<br>Company: <br><input id="pcompany" type="text" value="' + (jobObject["company"]["name"] || "") + '">';
myHTML += '<br>Job Title: <br><input id="pjobtitle" type="text" value="' + (jobObject["jobTitle"] || "") + '">';
Expand All @@ -120,8 +119,8 @@ var showBookMarklet = function() {
myHTML += '<br>Employment Type: <br><input id="pemployment" type="text" value="' + (jobObject["company"]["employmentType"] || "") + '">';
myHTML += '<br>Industry: <br><input id="pindustry" type="text" value="' + (jobObject["company"]["industry"] || "") + '">';
myHTML += '<br>Salary: <br><input id="psalary" type="text" value="' + (jobObject["company"]["salary"] || "") + '">';
myHTML += '<input type="checkbox" value="None" id="papplied" name="check" /><label for="papplied">Applied?</label>';
myHTML += '<br><input type="checkbox" value="None" id="pfavorite" name="check" /><label for="pfavorite">Favorite?</label>';
// myHTML += '<input type="checkbox" value="None" id="papplied" name="check" /><label for="papplied">Applied?</label>';
// myHTML += '<br><input type="checkbox" value="None" id="pfavorite" name="check" /><label for="pfavorite">Favorite?</label>';
myHTML += '<br><button id="pandabutton" class="btn waves-effect waves-light" type="submit" name="action">Submit<i class="mdi-content-send right"></i></button>';
myHTML += '</div>';
myHTML += '<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>';
Expand All @@ -146,8 +145,6 @@ var showBookMarklet = function() {
jobObject["company"]['employmentType'] = document.getElementById('pemployment').value;
jobObject["company"]['industry'] = document.getElementById('pindustry').value;
jobObject["company"]['salary'] = document.getElementById('psalary').value;
jobObject["applied"] = document.getElementById("papplied").checked;
jobObject["favorite"] = document.getElementById("pfavorite").checked;
console.log(jobObject);
sendData();
};
Expand Down