Skip to content

Instantly share code, notes, and snippets.

View ryanschuhler's full-sized avatar

Ryan Schuhler ryanschuhler

View GitHub Profile
@ryanschuhler
ryanschuhler / gist:6040690
Last active December 20, 2015 00:19
Anchor version of Social Bookmarks
<!-- Facebook -->
<a href="https://www.facebook.com/dialog/feed?app_id=XXXXXXXXXXXXXXX&link=https://developers.facebook.com/docs/reference/dialogs/&picture=http://cdn.www.liferay.com/osb-community-theme/images/custom/facebook_link.png&name=Title%20Name&caption=Caption%20phrase&description=This%20is%20the%20description.&redirect_uri=http://www.liferay.com/about-us/careers" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=400,width=600');return false;">Facebook</a>
<a href="https://www.facebook.com/sharer/sharer.php?u=http://www.liferay.com/careers/north-america" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=400,width=600');return false;">Share on Facebook</a><br />
<!-- Twitter -->
<a href="http://www.twitter.com/share?url=http://www.liferay.com/careers/north-america&text=Here%20is%20some%20text" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=y
@ryanschuhler
ryanschuhler / gist:6040684
Created July 19, 2013 16:57
Script version of Social Bookmarks
<!-- Facebook -->
<script src='http://connect.facebook.net/en_US/all.js'></script>
<script>
FB.init({appId: "XXXXXXXXXXXXXXX", status: true, cookie: true});
function postToFeed(redirectUri, link, name, caption, description) {
// calling the API ...
var obj = {
@ryanschuhler
ryanschuhler / gist:5937017
Last active December 19, 2015 09:59
Lazy load example
<div class="section">
<img datasrc="http://www.liferay.com/image/image_gallery?uuid=a9d9003c-017f-487e-9b2b-db7c15a2d4e0&groupId=14&t=1355426234988" class="lazy-load" alt="an image with lazy load" />
<div class="lazy-load">A div with Lazy Load</div>
</div>
@ryanschuhler
ryanschuhler / gist:5936861
Created July 5, 2013 19:59
Pop-click example
Pop click examples:
<div class="pop-click">
<span class="pop-click-content"\>popped!\</span\>
</div>
or
<ul>
<li class="pop-click">
@ryanschuhler
ryanschuhler / pop-click.js
Created June 22, 2013 00:11
This script toggles the class "pop-click-active" on any div with the class "pop-click" when it is clicked. When the user clicks anywhere on the screen that is not tagged with "pop-click-content", it will then remove the class. This is helpful for things like menus that will appear when something is clicked and disappear when they are clicked off…
AUI().use(
'aui-base',
function(A) {
var popClicks = A.all('.pop-click');
var popClickHandle;
var togglePopClick = function(event) {
event.stopPropagation();
@ryanschuhler
ryanschuhler / on-screen-helper.js
Last active December 18, 2015 19:48
This script is used when a node has the class "on-screen-helper". When the node hits the bottom of the screen, it will add the class "on-screen-bottom" , when the node hits the top of the screen it will add the class "on-screen-top" and when the node has completely left the screen it removes both classes. This is useful for both timing animation…
AUI().use(
'aui-base',
function(A) {
var WIN = A.getWin();
var onScreenHelperNode = A.all('.on-screen-helper');
var updateOnScreen = function() {
var currentScrollPos = WIN.get('docScrollY');
@ryanschuhler
ryanschuhler / lazy-load.js
Last active March 8, 2023 22:01
This is a function which can be used to lazy-load images or content onto the page. Essentially you give the respective node the class "lazy-load" and the class "lazy-loaded" will be added once the user scrolls to that node. Also if you give the class to an image and place the "src" in a "datasrc" attribute instead, it will switch it to source wh…
AUI().use(
'aui-base',
function(A) {
var WIN = A.getWin();
var lazyLoadNode = A.all('.lazy-load');
var lazyLoad = function() {
var currentScrollPos = WIN.get('docScrollY');
@ryanschuhler
ryanschuhler / Hudcrumbs
Created June 21, 2013 23:52
Liferay AUI Sticky-nav with hudcrums.
AUI().use(
'liferay-hudcrumbs',
function(A) {
var navigation = A.one('#navigation');
if (navigation) {
navigation.plug(A.Hudcrumbs);
}
}
);
@ryanschuhler
ryanschuhler / gist:5749775
Last active December 18, 2015 07:49
isOnScreen
AUI().use(
'aui-base',
'event-base',
'transition',
function(A) {
var body = A.getBody();
var WIN = A.getWin();
var toggle = A.one('#toggle');
var topNav = A.one('#topNavigation');
@ryanschuhler
ryanschuhler / gist:5732780
Created June 7, 2013 22:13
Sortable Events Alloy
#set ($ns = $request.portlet-namespace)
#set ($companyId = $getterUtil.getLong($request.theme-display.company-id))
#set ($scopeGroupId = $getterUtil.getLong($request.theme-display.scope-group-id))
#set ($jsLogging = $getterUtil.getBoolean($javascript-logging-enabled.data))
#set ($defaultEventType = $getterUtil.getString($default-event-type.data, 'All'))
#set ($pathThemeImages = $request.theme-display.path-theme-images)
#set ($languageId = $request.theme-display.language-id)
#set ($defaultRegion = $getterUtil.getString($httpUtil.getParameter(${request.attributes.CURRENT_URL}, 'wcd-region', false), 'All'))