Widget / Google Plus
Show the ChiliPeppr Google Plus stream.
HTML
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script src="http://www.chilipeppr.com/js/require.js"></script>
<div id="com-chilipeppr-widget-gplus" class="panel panel-default">
<div class="panel-heading">
<div class="btn-toolbar pull-right" role="toolbar" >
<div class="btn-group">
</div>
<div class="btn-group">
<div class="dropdown">
<button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
</ul>
</div>
</div>
</div>
<span class="panel-title" data-toggle="popover">Google+</span>
</div>
<div id="com-chilipeppr-widget-gplus-body" class="panel-body">
<div class="container-fluid">
<!--Add a button for the user to click to initiate auth sequence -->
<button id="authorize-button" style="visibility: hidden">Authorize</button>
<!-- <div class="g-post" data-href="https://plus.google.com/116405162018667156471/posts/PATtwA5goDm"></div> -->
<!-- <div class="g-community" data-href="https://plus.google.com/communities/104346367498010042037"></div> -->
<!-- From https://github.com/googleplus/gplus-quickstart-javascript/blob/master/index.html -->
<!-- <div id="gConnect">
<button class="g-signin"
data-scope="https://www.googleapis.com/auth/plus.login"
data-requestvisibleactions="http://schemas.google.com/AddActivity"
data-clientId="367948091270-l83tho8s4qg2c2n3ltc64g0h9rsao3g5.apps.googleusercontent.com"
data-callback="onSignInCallback"
data-theme="dark"
data-cookiepolicy="single_host_origin">
...
CSS
#com-chilipeppr-widget-tinyg-body {
/* padding:0; */
}
.com-chilipeppr-interface-cnccontroller-stat .col {
padding:0 10px 0 0;
}
.com-chilipeppr-interface-cnccontroller-stat .col:last-child {
padding:0;
}
.com-chilipeppr-interface-cnccontroller-stat .progress {
margin-bottom:0;
}
.com-chilipeppr-interface-cnccontroller-stat .stat-row {
padding-top:2px;
}
.com-chilipeppr-interface-cnccontroller-stat div.col.lblpad {
padding-left:10px;
}
.com-chilipeppr-interface-cnccontroller-stat .stat-unit {
font-size:9px;
display:none;
}
.com-chilipeppr-interface-cnccontroller-stat div.col.well {
margin-bottom:0px;
padding-left:5px;
}
.com-chilipeppr-interface-cnccontroller-stat .stat-sm {
font-size:10px;
}
JavaScript
requirejs.config({
paths: {
//gplus: 'https://apis.google.com/js/plusone',
gplus: 'https://apis.google.com/js/client:plusone',
gapi: 'https://apis.google.com/js/client'
}
});
// Test this element. This code is auto-removed by the chilipeppr.load()
cprequire_test(["inline:com-chilipeppr-widget-gplus"], function (gp) {
console.log("test running of " + gp.id);
gp.init();
//gp.showGooglePlus();
} /*end_test*/ );
cpdefine("inline:com-chilipeppr-widget-gplus", ["chilipeppr_ready", "gplus"], function () {
return {
id: "com-chilipeppr-widget-gplus",
url: "http://fiddle.jshell.net/chilipeppr/DpuWW/show/light/",
fiddleurl: "http://jsfiddle.net/chilipeppr/DpuWW/",
name: "Widget / Google+",
desc: "This widget shows the Google+ feed for ChiliPeppr.",
init: function () {
window["parsetags"] = "explicit";
this.forkSetup();
this.embedGooglePlus();
console.log(this.name + " done loading.");
},
embedGooglePlus3: function() {
var clientId = '737064297664-f5m2bp72a3ct8l9ggnk1pl4mdaf5sifm.apps.googleusercontent.com';
/*
*
* Copyright 2013 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
...