This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LOAD needed player | |
<script async src="https://content.jwplatform.com/libraries/{{YOUR-PLAYER-ID}}.js"></script> | |
document.addEventListener('DOMContentLoaded', event => { | |
// workaround to autoplay video | |
if (document.querySelector('.top-splash .widget__video')) { | |
document.querySelector('.top-splash .widget__image').click(); | |
} | |
}); | |
function playlists() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpack = require('webpack'); | |
var path = require('path'); | |
module.exports = { | |
context: path.resolve(__dirname, 'static/js'), | |
entry: { | |
'apps/frontpage': 'apps/all_posts', | |
'libs/hogan/hogan_with_filters': 'libs/hogan/hogan_with_filters', | |
'apps/welcome': 'apps/welcome', | |
'apps/dashboard': 'apps/dashboard', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function (require) { | |
/* Detail of where was triggered the river event*/ | |
var _ = require('underscore'), | |
SIDEBAR_RIVER_TYPE_OF_POST = { | |
'sidebar_river_post_publish': 'sidebar_river_post_publish', | |
'sidebar_river_post_community_comment': 'sidebar_river_post_community_comment', | |
'sidebar_river_user_follows': 'sidebar_river_user_follows', | |
'sidebar_river_user_followed': 'sidebar_river_user_followed', | |
'sidebar_river_post_featured': 'sidebar_river_post_featured', | |
'sidebar_river_post_edit': 'sidebar_river_post_edit', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery('toggle-boggle-video').on('click', function (evnt){ | |
var $el = jQuery(evnt.currentTarget); | |
evnt.preventDefault(); | |
window.ga('b.send', 'event', | |
{'eventCategory': 'article_module', | |
eventAction: 'video_module', | |
nonInteraction: 1, | |
eventLabel: window.location.href}, | |
function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+++ b/static/js/widgets/views/posts/edit_mode/media_form.js | |
@@ -11,7 +11,7 @@ define(function (require) { | |
WebSearchImagesView = require('whitelabel/widgets/views/edit_mode/web_search_images'), | |
ImageSearchCollection = require('widgets/collections/image_search_api'), | |
Pager = require('widgets/models/dashboard/stats/pager'), | |
- SaveImageModel = require('whitelabel/widgets/models/save_image'), | |
+ ProxyImageModel = require('widgets/models/posts/image_proxy'), | |
template = require('hgn!widgets/templates/posts/edit_mode/posts/add_media'), | |
loadingTemplate = require('hgn!widgets/templates/posts/edit_mode/posts/web_search_images_loading'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addTagsClasses: function () { | |
this.$el.addClass(_.map(this.model.get('public_tag'), function (tag) { | |
return 'tag-' + tag.replace(/[^a-zA-Z0-9_-]/g, ''); | |
}).join(' ')); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add: function (answer) { | |
if (answer.has('order')) { | |
return this; | |
} | |
var maxOrderModel = this.max(function (model) { | |
return model.get('order'); | |
}); | |
if (_.isEmpty(maxOrderModel)) { | |
answer.set('order', 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
(function (root, factory) { | |
if (typeof define === 'function' && define.amd) { | |
return define('jquery.in-viewport', ['jquery'], function ($) { | |
return factory($, root); | |
}); | |
} else { | |
return factory(root.jQuery, root); | |
} | |
})(this, function($, window) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* cover_cards view for touch devices | |
*/ | |
define(['jquery', 'backbone', 'widgets/templates/cover_cards', 'widgets/views/cover_card', 'libs/jquery/plugins/jquery.hammer'], function ($, BB, Template, CoverCardView) { | |
return BB.View.extend({ | |
events: { | |
'drag': 'onDrag', | |
'dragend': 'onDragEnd' | |
}, | |
initialize: function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postItem = { | |
toggleEvents: function(status) { | |
var events = _.isFunction(this.events) ? this.events() : this.events | |
this[status? 'undelegateEvents' : 'delegateEvents'](events); | |
} |