Skip to content

Instantly share code, notes, and snippets.

@joshpangell
Last active September 30, 2015 18:08
Show Gist options
  • Save joshpangell/1840918 to your computer and use it in GitHub Desktop.
Save joshpangell/1840918 to your computer and use it in GitHub Desktop.
Cargo's events that are triggered on actions as of 12/02/15
/**
* Cargo's jQuery event trigger list
*/
/*
* Fires in two places
* - After a project is done loading
* - document.ready
* returns the pid and the slideheight
*/
$(document).trigger("projectReady", [ {
"pid" : pid,
"slideheight" : slideheight
} ]);
// Usage
$(document).bind("projectReady", function(e, data) {
var pid = data.pid;
var slideheight = data.slideheight;
});
/*
* Fires after a project has finished loading
* returns the pid of the project that was opened
*/
$(document).trigger("projectLoadComplete", [ pid ]);
// Usage
$(document).bind("projectLoadComplete", function(e, pid) {
});
/*
* Fires when a direct link is pasted into the browser
* Returns the path of the link (pid is unavailable)
*/
$(document).trigger("directLinkLoaded", [ location.pathname ]);
// Usage
$(document).bind("directLinkLoaded", function(e, path) {
});
/*
* Fires when a visiting a /solo link
* Returns the path of the link (pid is unavailable)
*/
$(document).trigger("soloLinkLoaded", [ location.pathname ]);
// Usage
$(document).bind("soloLinkLoaded", function(e, path) {
});
/*
* Fires in the admin when editing a project
* Returns the path of the link (pid is unavailable)
*/
$(document).trigger("editProjectLoaded", [ location.pathname ]);
// Usage
$(document).bind("editProjectLoaded", function(e, path) {
});
/*
* Fires when a start project is loaded
* First on first load, and if the back button is pressed back to home
*/
$(document).trigger("startProjectLoaded");
// Usage
$(document).bind("startProjectLoaded", function(e) {
});
/*
* Fires at the start of when a project is closed
* Returns the container that is being closed
*/
$(document).trigger("projectClose", [ container ] );
// Usage
$(document).bind("projectClose", function(e, container) {
});
/*
* Fires when the site goes back to index (similar to projectClose)
* Returns pid that was closed
*/
$(document).trigger("projectIndex", [ pid ]);
// Usage
$(document).bind("projectIndex", function(e, pid) {
});
/*
* Fires after the project has been unloaded
* returns the pid and the container being closed
*/
$(document).trigger("projectCloseUnload", [ pid, container ]);
// Usage
$(document).bind("projectCloseUnload", function(e, pid, container) {
});
/*
* Fires when a project is done being closed and unloaded
* returns the pid and the container being closed
*/
$(document).trigger("projectCloseComplete", [ pid, container ]);
// Usage
$(document).bind("projectCloseComplete", function(e, pid, container) {
});
/*
* Fires when a SpaceCollective template project close is complete
* returns
*/
$(document).trigger("SCprojectLoadComplete", [ pid ]);
// Usage
$(document).bind("SCprojectLoadComplete", function(e, pid) {
});
/*
* Fires when a project load is started, before Ajax
* returns the pid and an array of the path in the browser
*/
$(document).trigger("projectLoadStart", [ pid, path_array ]);
// Usage
$(document).bind("projectLoadStart", function(e, pid, path_array) {
});
/*
* Fires when a user submits a search term
* returns the form from which it came, as well as the term
* NOTE: The page will reload after this event is fired
* This event can be called as a function, for creating custom search fields
*/
$(document).trigger("doSearch", [ {
"form" : search_form_id,
"term" : search_term
} ]);
// Usage
$(document).bind("doSearch", function(e, data) {
var form = data.form;
var term = data.term;
});
/*
* Fired when the "next project" is called
* Either keyboard, or button/link
* This has a double use - can be bound to add actions
* to the event, or can be fired as a function independently
* eg: $("button").click(function() { $(document).trigger("showNextProject"); });
*/
$(document).trigger("showNextProject");
// Usage
$(document).bind("showNextProject", function(e) {
});
/*
* Fired when the "previous project" is called
* Either keyboard, or button/link
* This has a double use - can be bound to add actions
* to the event, or can be fired as a function independently
* eg: $("button").click(function() { $(document).trigger("showPrevProject"); });
*/
$(document).trigger("showPrevProject");
// Usage
$(document).bind("showPrevProject", function(e) {
});
/*
* Fired when the "random project" is called
* Either keyboard, or button/link
* This has a double use - can be bound to add actions
* to the event, or can be fired as a function independently
* eg: $("button").click(function() { $(document).trigger("showRandomProject"); });
*/
$(document).trigger("showRandomProject");
// Usage
$(document).bind("showRandomProject", function(e) {
});
/*
* Fired when the "next project" is called on feed designs
* Either keyboard, or button/link
* This has a double use - can be bound to add actions
* to the event, or can be fired as a function independently
* eg: $("button").click(function() { $(document).trigger("showNextFeedProject"); });
*/
$(document).trigger("showNextFeedProject");
// Usage
$(document).bind("showNextFeedProject", function(e) {
});
/*
* Fired when the "previous project" is called on feed designs
* Either keyboard, or button/link
* This has a double use - can be bound to add actions
* to the event, or can be fired as a function independently
* eg: $("button").click(function() { $(document).trigger("showPrevFeedProject"); });
*/
$(document).trigger("showPrevFeedProject");
// Usage
$(document).bind("showPrevFeedProject", function(e) {
});
/*
* Fired when the "close project" is called
* Either keyboard, or button/link
* This has a double use - can be bound to add actions
* to the event, or can be fired as a function independently
* eg: $("button").click(function() { $(document).trigger("closeProject"); });
*/
$(document).trigger("closeProject");
// Usage
$(document).bind("closeProject", function(e) {
});
/*
* Fired when the play/pause from the audio component is pressed
* Returns the "filename" and the "class" of the button
* the "class" with either = play or pause
*/
$(document).trigger("audioPlayPause", [ filename, state ]);
// Usage
$(document).bind("audioPlayPause", function(e, filename, state) {
var is_playing = (state == "play") ? false : true;
});
/*
* Fires when the slideshow has finished it's build
* returns the container object like: $("#slideshow_container_1234_1")
*/
$(document).trigger("slideshowLoadComplete", [ container ]);
// Usage
$(document).bind("slideshowLoadComplete", function(e, container) {
});
/*
* Fires when the slideshow transition (animation) starts
* returns the jQuery object value of the next slide
*/
$(document).trigger("slideshowTransitionStart", [ nextSlide ]);
// Usage
$(document).bind("slideshowTransitionStart", function(e, nextSlide) {
});
/*
* Fires when the slideshow transition (animation) has completed
* returns the jQuery object of the next slide
*/
$(document).trigger("slideshowTransitionFinish", [ nextSlide ]);
// Usage
$(document).bind("slideshowTransitionFinish", function(e, nextSlide) {
});
/*
* Fires when a escher based designs pagination is started
* returns the value of the next page (eg: 4)
*/
$(document).trigger("pageChange", [ newpage ]);
// Usage
$(document).bind("pageChange", function(e, newpage) {
});
/*
* Fires when a escher based designs pagination is complete
* returns the value of the (now) current page (eg: 4)
*/
$(document).trigger("pageChangeComplete", [ newpage ]);
// Usage
$(document).bind("pageChangeComplete", function(e, newpage) {
});
/*
* Fires when an autopagination starts on a feed based design
*/
$(document).trigger("paginationStart");
// Usage
$(document).bind("paginationStart", function(e) {
});
/*
* Fires when an autopagination is complete on a feed based design
*/
$(document).trigger("paginationComplete");
// Usage
$(document).bind("paginationComplete", function(e) {
});
/*
* On all masonry / SC designs, this is fired when the window is resized
*/
$(document).trigger("contentResize");
// Usage
$(document).bind("contentResize", function(e) {
});
/*
* On all designs when the inspector is closed
*/
$(document).trigger("inspectorUnloaded");
// Usage
$(document).bind("inspectorUnloaded", function(e) {
});
/**
* Cargo's functions that are fired like events
*/
/*
* Fired when we init the search field (page load)
*/
$(document).trigger("loadSearch");
// Usage
$(document).bind("loadSearch", function(e) {
});
/*
* Fired when the toolset is init (page load)
*/
$(document).trigger("initToolset");
// Usage
$(document).bind("initToolset", function(e) {
});
/*
* Fired when the network filter menu is init (page load)
*/
$(document).trigger("networkFilterMenu");
// Usage
$(document).bind("networkFilterMenu", function(e) {
});
/*
* Fired when we init keyboard shortcuts (page load)
*/
$(document).trigger("keyboardShortcuts");
// Usage
$(document).bind("keyboardShortcuts", function(e) {
});
/**
* Commenting
*/
/*
* Fired when we a comment has been edited or added
*/
$(document).trigger("commentChange");
// Usage
$(document).bind("commentChange", function(e) {
});
/*
* Fired when we a comment has been canceled
*/
$(document).trigger("commentCanceled");
// Usage
$(document).bind("commentCanceled", function(e) {
});
/**
* Fired when the freshbox (lightbox) is opened
*/
$(document).trigger("freshboxOpen");
// Usage
$(document).bind("freshboxOpen", function(e) {
});
/**
* Fired when the freshbox (lightbox) is closed
*/
$(document).trigger("freshboxClose");
// Usage
$(document).bind("freshboxClose", function(e) {
});
@casr
Copy link

casr commented May 15, 2012

Thanks for collating this. Cargo needs some docs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment