Skip to content

Commit

Permalink
Merge branch 'master' of github.com:apiengine/apiengine-client
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Barrett committed Nov 26, 2012
2 parents 69653ba + ab77472 commit d78e20e
Show file tree
Hide file tree
Showing 51 changed files with 1,138 additions and 721 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@






[![Build Status](https://secure.travis-ci.org/ApiEngine/apiengine-client.png?branch=master)](http://travis-ci.org/ApiEngine/apiengine-client)


Expand Down
10 changes: 4 additions & 6 deletions build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ var outputFolder = 'output/version/' + version
console.log('Building client');
var startTime = Date.now();

fs.removeSync('relic');
fs.removeSync('output');
fs.mkdirSync('output');
fs.mkdirSync('relic');
fs.mkdirSync('output/version');
fs.mkdirSync(outputFolder);
var rootPath = '..';
Expand Down Expand Up @@ -52,9 +50,9 @@ var rootPath = '..';
]
});
var index = fs.readFileSync(rootPath + '/index.html', 'ascii');
index = index.replace('css/styles.css', '//d3oqwi49u9bqjg.cloudfront.net/version/' + version + '/css/styles.css');
index = index.replace('css/styles.css', 'https://d3oqwi49u9bqjg.cloudfront.net/version/' + version + '/css/styles.css');
index = index.replace('<base href="/repos/apiengine-client/" />', '');
index = index.replace(' data-main="js/main"', ' data-main="//d3oqwi49u9bqjg.cloudfront.net/version/' + version + '/js/main"');
index = index.replace(' data-main="js/main"', ' data-main="https://d3oqwi49u9bqjg.cloudfront.net/version/' + version + '/js/main"');
fs.writeFileSync('output/index.html', index);
rjs.optimize({
cssIn: rootPath + '/css/styles.css',
Expand All @@ -64,14 +62,14 @@ fs.writeFileSync('output/index.html', index);
var path = require('path');

function cssIncImages(cssFile) {
var imgRegex = /url\s?\(['"]?(\.\.\/img.*?\?embed)(?=['"]?\))/gi;
var imgRegex = /url\s?\(['"]?(\.\.\/img.*?)\?embed(?=['"]?\))/gi;
var css = fs.readFileSync(cssFile, 'utf-8');
while (match = imgRegex.exec(css)) {
var imgPath = path.join(path.dirname(cssFile), match[1]);
try {
var img = fs.readFileSync(imgPath, 'base64');
var ext = imgPath.substr(imgPath.lastIndexOf('.') + 1);
css = css.replace(match[1], 'data:image/' + ext + ';base64,' + img);
css = css.replace(match[1] + '?embed', 'data:image/' + ext + ';base64,' + img);
} catch (err) {
console.log('Image not found (%s).', imgPath);
}
Expand Down
5 changes: 5 additions & 0 deletions css/apimenu.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
background: #fff;
border-left: 1px solid #ebebeb;
border-right: 1px solid #ebebeb;
margin-bottom: 50px;
}
.api-menu-list {
list-style: none;
Expand Down Expand Up @@ -277,4 +278,8 @@

.method-label {
font-size: 14px;
width: 180px;
height: 16px;
display: inline-block;
overflow: hidden;
}
30 changes: 26 additions & 4 deletions css/apis.css
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ Some styles for API's
border-bottom: 1px solid #ccc;
width: 302px;
padding-bottom: 15px;
font-family: 'Nexa';
}
.method-container .menu-title {
padding-left: 40px;
Expand Down Expand Up @@ -226,11 +227,14 @@ Some styles for API's
text-align: right;
}


.descriptive {
font-size: 14px;
color: #333;
}

.method-title {
height: 50px;
line-height: 50px;
height: 40px;
line-height: 44px;
font-size: 26px;
letter-spacing: 2px;
text-transform: uppercase;
Expand All @@ -255,7 +259,25 @@ Some styles for API's
}


.api-description:hover {
.edit-api-description:hover {
outline: 1px solid #ccc;
background: #ebebeb;
}
.method-page-container {
padding: 20px 0 20px 40px;
}
.method-section {
overflow: auto;
margin-bottom: 40px;
}
.method-section h3 {
margin: 0 0 15px 0;
font-weight: normal;
font-family: 'Nexa Bold';
}
.http-request {
}
.http-request-text {
line-height: 22px;
color: #555;
}
18 changes: 9 additions & 9 deletions css/backgrounds.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,49 +64,49 @@ body.grey {
background: #fff;
}
.background.white:before {
background: url('../img/backgrounds/scollop-white-with-shadow.png');
background: url('../img/backgrounds/scollop-white-with-shadow.png?embed');
}
.background.dark-grey {
background: #171717;
}
.background.dark-grey:before {
background: url('../img/backgrounds/scollop-dark-grey.png');
background: url('../img/backgrounds/scollop-dark-grey.png?embed');
}
.background.yellow {
background: #fed563;
}
.background.yellow:before {
background: url('../img/backgrounds/scollop-yellow.png');
background: url('../img/backgrounds/scollop-yellow.png?embed');
}
.background.blue {
background: #019ff3;
}
.background.blue:before {
background: url('../img/backgrounds/scollop-blue.png');
background: url('../img/backgrounds/scollop-blue.png?embed');
}
.background.grey {
background: #485259;
}
.background.grey:before {
background: url('../img/backgrounds/scollop-grey.png');
background: url('../img/backgrounds/scollop-grey.png?embed');
}
.background.light-grey {
background: #f7f7f7;
}
.background.light-grey:before {
background: url('../img/backgrounds/scollop-light-grey.png');
background: url('../img/backgrounds/scollop-light-grey.png?embed');
}
.background.red {
background: #ea2452;
}
.background.red:before {
background: url('../img/backgrounds/scollop-red.png');
background: url('../img/backgrounds/scollop-red.png?embed');
}



.titlebar {
background: url('../img/backgrounds/titlebar-bg.png');
background: url('../img/backgrounds/titlebar-bg.png?embed');
z-index: 1;
position: relative;
}
Expand All @@ -115,7 +115,7 @@ body.grey {

.titlebar-scollop{
position:absolute;
background: url('../img/backgrounds/titlebar-scollop.png');
background: url('../img/backgrounds/titlebar-scollop.png?embed');
height:2px;
width:100%;
}
Expand Down
2 changes: 1 addition & 1 deletion css/comments.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ float: left;
padding: 10px;
vertical-align: top;
height: 40px;
width: 545px;
width: 540px;
font-size: 14px;
}
.add-comment {
Expand Down
8 changes: 4 additions & 4 deletions css/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
height: 31px;
background-size: 257px;
float: left;
background: url('../img/api-engine-logo.png') no-repeat;
background: url('../img/api-engine-logo.png?embed') no-repeat;
margin-top: 21px;
}
.logo-text {
Expand All @@ -17,14 +17,14 @@
height: 31px;
background-size: 257px;
float: left;
background: url('../img/api-engine.png') no-repeat;
background: url('../img/api-engine.png?embed') no-repeat;
margin-top: 21px;
}

.top-bar-container {
background: #444 url('../img/titlebar-bg-grad.png');
background: #444 url('../img/titlebar-bg-grad.png?embed');
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#252f33), color-stop(100%,#1f2020));
height: 73px;
height: 72px;
position: relative;
}
.top-bar-menu {
Expand Down
5 changes: 5 additions & 0 deletions css/profile.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
*/

.cog-power {
width: 146px;
height: 146px;
background: url('../img/cog-power-146x146.png?embed');
}

.user-profile-image {
width: 60px;
Expand Down
11 changes: 10 additions & 1 deletion css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}

.settings-container {
margin-top: 30px;
padding-top: 30px;
min-height: 400px;
}
.settings-menu-container {
Expand All @@ -44,8 +44,17 @@
list-style: none;
margin: 0;
padding: 0;
margin-bottom: 30px;
border-right: 1px solid #ebebeb;
}
.settings-menu {
border-top: 1px solid #ebebeb;

}
.settings-menu:first-child {
border-top: none;

}
.settings-menu li {
border-bottom: 1px solid #ebebeb;
}
Expand Down
18 changes: 17 additions & 1 deletion css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ a {
color: #39f;
text-decoration: none;
}
p {
font-size: 14px;
}
/*a:hover {
color: #39f;
text-decoration: underline;
Expand Down Expand Up @@ -87,4 +90,17 @@ body {
}
.centered-content {
text-align: center;
}
}

body [data-show-authed],
body [data-hide-authed] {
display: none;
}

body [data-show-authed="true"] {
display: block;
}

body [data-hide-authed="false"] {
display: block;
}
10 changes: 5 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<meta name="fragment" content="!">
<base href="/repos/apiengine-client/" />
<link rel="stylesheet" href="css/styles.css">
<script data-main="js/main" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.1/require.min.js" type="text/javascript"></script>
<!-- start Mixpanel --><script type="text/javascript">(function(c,a){window.mixpanel=a;var b,d,h,e;b=c.createElement("script");b.type="text/javascript";b.async=!0;b.src=("https:"===c.location.protocol?"https:":"http:")+'//cdn.mxpnl.com/libs/mixpanel-2.1.min.js';d=c.getElementsByTagName("script")[0];d.parentNode.insertBefore(b,d);a._i=[];a.init=function(b,c,f){function d(a,b){var c=b.split(".");2==c.length&&(a=a[c[0]],b=c[1]);a[b]=function(){a.push([b].concat(Array.prototype.slice.call(arguments,0)))}}var g=a;"undefined"!==typeof f?
g=a[f]=[]:f="mixpanel";g.people=g.people||[];h="disable track track_pageview track_links track_forms register register_once unregister identify name_tag set_config people.identify people.set people.increment".split(" ");for(e=0;e<h.length;e++)d(g,h[e]);a._i.push([b,c,f])};a.__SV=1.1})(document,window.mixpanel||[]);
mixpanel.init("e6269ec3133d33c85d2906bbd0b4953f");</script><!-- end Mixpanel -->

</head>
<body></body>
<body>
<script data-main="js/main" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.1/require.min.js" type="text/javascript"></script>

</body>
</html>
9 changes: 9 additions & 0 deletions js/libs/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ define(['jquery'], function ($) {
$('body').append(this.el);



if(options.inline) {
var from = options.inline.from;
var to = $(options.inline.to, this.el);
Expand Down Expand Up @@ -62,10 +63,18 @@ define(['jquery'], function ($) {
};



var create = function (options) {
var Modal = new modal(options);
$('.js-close-modal', Modal.el).on('click', function (){
Modal.hide();
});

$(document).on('keydown', function (ev){
if(ev.which == 27){

Modal.hide();
}
})
return Modal;
};
Expand Down
13 changes: 11 additions & 2 deletions js/models/clearnotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@ define([
'models/session'
], function(_, Backbone, Session) {
var ClearNotificationModel = Backbone.Model.extend({
urlRoot: function () {
url: function () {


return '/notification/' +this.options.username+ '/' +this.options.api+ '/' + this.options.version + '/' + this.options.resourceId ;
if(this.options.method) {

return '/notification/' + this.options.username + '/' + this.options.api + '/' + this.options.version + '/' + this.options.resourceId + '/' + this.options.method ;
} else if(typeof this.options.resourceId !== 'undefined') {

return '/notification/' + this.options.username + '/' + this.options.api + '/' + this.options.version + '/' + this.options.resourceId ;
} else {
return '/notification/' + this.options.username + '/' + this.options.api + '/' + this.options.version + '/notification';

}
}
});
return ClearNotificationModel;
Expand Down
26 changes: 13 additions & 13 deletions js/models/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ define([
this.on('change:auth', function (model) {
console.log('user details', model);
if(model.get('auth')) {
mixpanel.people.identify(model.get('login'));
mixpanel.name_tag(model.get('login'));
mixpanel.people.set({
"$username": model.get('login'), // only special properties need the $
"$name": model.get('login'), // only special properties need the $
"$first_name": model.get('user').profile.name, // only special properties need the $
"$email": model.get('user').email, // only special properties need the $
"$created": model.get('user').profile.joindate,
company: model.get('user').profile.company
// mixpanel.people.identify(model.get('login'));
// mixpanel.name_tag(model.get('login'));
// mixpanel.people.set({
// "$username": model.get('login'), // only special properties need the $
// "$name": model.get('login'), // only special properties need the $
// "$first_name": model.get('user').profile.name, // only special properties need the $
// "$email": model.get('user').email, // only special properties need the $
// "$created": model.get('user').profile.joindate,
// company: model.get('user').profile.company

});
//});
} else {
mixpanel.people.identify(null);
// mixpanel.people.identify(null);
}
//mixpanel.people.identify("12148");
});
Expand All @@ -56,8 +56,8 @@ define([
var that = this;
this.destroy({
success: function (model, resp) {
mixpanel.track('Logged out');
mixpanel.people.identify(null);
// mixpanel.track('Logged out');
// mixpanel.people.identify(null);

// Set auth to false to trigger a change:auth event
// The server also returns a new csrf token so that
Expand Down
Loading

0 comments on commit d78e20e

Please sign in to comment.