Skip to content

Instantly share code, notes, and snippets.

View Ravenna's full-sized avatar

Ravenna Ravenna

View GitHub Profile
@Ravenna
Ravenna / chat.js
Created September 12, 2018 04:33
Chat js on page
chatManager
.connect()
.then(currentUser => {
currentUser.rooms.forEach(r => currentUser.subscribeToRoom({
roomId: currentUser.rooms[0].id,
hooks: {
onNewMessage: message => {
console.log(`Received new message: ${message.text}`)
}
}
// BUILD VIDEO SOURCE
var mp4 = $('#home-video-div').attr("data-mpfour");
var webm = $('#home-video-div').attr("data-webm");
$('#bgvid').append('<source src="'+ mp4 +'" type="video/mp4"><source src="'+ webm +'" type="video/webm">');
// SCALE VIDEO SOURCE
$('#home-video-div').delay(200).velocity({ opacity: 1 }, { display: "block" });
<_1:PatientUpdateReq PatientID="1225203" IDType="?" PartnerCode="?">
<!--You have a CHOICE of the next 2 items at this level-->
<_1:Edits>
<_1:PreferredContactMethod>Home1AddrPhone</_1:PreferredContactMethod>
<_1:Home1AddrPhone>123-123-1234</Home1AddrPhone>
</_1:Edits>
</_1:PatientUpdateReq>
if( !function_exists( 'adj_top_cat_page' ) ) {
function adj_top_cat_page( $term_tax_id ) {
$product_cat_id = $term_tax_id;
$children_cat_ids = get_terms( 'product_category', array(
'hide_empty' => false,
'fields' => 'ids',
'child_of' => $product_cat_id
) );
// ASSUMING [button link="some-slug" text="Linked Te" offsite="true/false"]
function button_shortcode( $buttonAtts ){
$button = shortcode_atts( array(
'link' => '',
'text' => '',
'offsite' => ''
), $buttonAtts );
$target;
// CUSTOMIZE TinyMCE
function my_mce_buttons_2( $buttons ) {
array_unshift( $buttons, 'styleselect' );
return $buttons;
}
// Register our callback to the appropriate filter
add_filter('mce_buttons_2', 'my_mce_buttons_2');
function my_theme_add_editor_styles() {
add_editor_style( '/assets/css/custom-editor-style.css' );
<!-- Google Code for Alderwood Form Submission Conversion Page
In your html page, add the snippet and call
goog_report_conversion when someone clicks on the
chosen link or button. -->
<script type="text/javascript">
/* <![CDATA[ */
goog_snippet_vars = function() {
var w = window;
w.google_conversion_id = 973383578;
w.google_conversion_label = "[Conversion Label]";
$('.entity-modal form').submit(function(e){
e.preventDefault();
var link = $(this).attr('action');
var data = $(this).serialize();
$.ajax({
type: "POST",
url: link,
data: data,
$.ajax({
type: "POST",
url: link,
data: data,
success: function(response){
console.log('Default Entity Updated');
},
error: function(data){
var errors = data.responseJSON;
var i = 1;
// BUILD VIDEO SOURCE
var mp4 = $('#home-video-div').attr("data-mpfour");
var webm = $('#home-video-div').attr("data-webm");
$('#bgvid').append('<source src="'+ mp4 +'" type="video/mp4"><source src="'+ webm +'" type="video/webm">');
// SCALE VIDEO SOURCE
$('#home-video-div').delay(200).velocity({ opacity: 1 }, { display: "block" });