Skip to content

Instantly share code, notes, and snippets.

@ranyefet
ranyefet / list_items.html
Created October 22, 2012 10:02
List items with jQuery
<!doctype html>
<html>
<head>
<title>List items with jQuery</title>
<style>
#header {
background-color:#94D4E0; font-family:tahoma; height:50px; margin-left:auto; margin-right:auto; width:400px; text-align:center; vertical-align:text-bottom; font-size:20px; line-height:250%;
}
#control {
position:absolute; align:float;
@ranyefet
ranyefet / mweApiUiConfJs.php
Last active December 16, 2015 14:58
/v1.7.2/modules/KalturaSupport/apiServices/mweApiUiConfJs.php
<?php
/**
* This file injects all on Page uiConf based javascript and configuration and loader.
*
* it requires a partner_id and a uiconf_id
*/
require_once( dirname( __FILE__ ) . '/../KalturaCommon.php' );
$wgMwEmbedApiServices['uiconfJs'] = 'mweApiUiConfJs';
/**
* KWidget static object.
* Will eventually host all the loader logic.
*/
(function(){
// Use strict ECMAScript 5
"use strict";
// Flag to avoid double setup
@ranyefet
ranyefet / mw.LayoutManager.js
Created May 19, 2013 11:43
Example of Layout class for Kaltura EmbedPlayer
var playerConfig = {
components: [{"width":"100%","height":"30","type":"Container","id":"Controls","relativeTo":"ControlBarContainer","position":"firstChild"},{"type":"ToggleButton","id":"htmlPlayBtn","state":"playerStatus.isPlaying()","actionOn":"doPause","actionOff":"doPlay","cssClass":"btn","cssClassOn":"icon-pause","cssClassOff":"icon-play","relativeTo":"Controls","position":"firstChild"},{"height":"22","type":"ToggleButton","id":"htmlFullScreenBtn","state":"playerStatus.isInFullScreen()","actionOn":"closeFullScreen","actionOff":"openFullScreen","cssClass":"btn pull-right","cssClassOn":"icon-contract","cssClassOff":"icon-expand","relativeTo":"Controls","position":"lastChild"},{"width":"100%","height":"10","type":"Scrubber","id":"htmlScrubber","relativeTo":"Controls","position":"lastChild"},{"width":"60","height":"12","format":"mm:ss","type":"Label","id":"htmlCurrentTimeLabel","relativeTo":"Controls","position":"lastChild"},{"width":"60","height":"12","format":"mm:ss","type":"Label","id":"htmlDurationLab
@ranyefet
ranyefet / example.js
Created June 27, 2013 11:27
Using $.triggerQueueCallback
var $obj = $({});
$obj.bind('myEvent', function( param, callback ) {
// do stuff
callback();
});
$obj.bind('myEvent', function( param, callback ) {
// do stuff
callback();
@ranyefet
ranyefet / preview_player.json
Created September 16, 2013 16:24
HTML5 v2.0.0 Preview Player
{
"plugins":{
"largePlayBtn": {},
"scrubber": {},
"playPauseBtn": {},
"volumeControl": {},
"fullScreenBtn": {},
"durationLabel": {},
"currentTimeLabel": {},
"sourceSelector": {},
@ranyefet
ranyefet / timescapper.js
Created September 20, 2013 23:22
Get Shabbat times from dat.gov.il
/*
* This script created to generate a JSON of Shabbat Times from Dat.gov.il
*
* Usage:
* 1. Go to: http://www.dat.gov.il/religion/console/shabbat_hours.aspx
* 2. Open the Web Developer Console
* 3. Copy the code below ans paste it in and hit Enter
* 4. Enjoy the data
*/
var timesScapper = {
@ranyefet
ranyefet / myPlugin.js
Created September 22, 2013 09:58
Sample Kaltura Component
( function( mw, $ ) {"use strict";
// 'myPlugin' should be defined in jsonConfig in order to be loaded/enabled
mw.PluginManager.add( 'myPlugin', mw.KBaseComponent.extend({
// Default component config
defaultConfig: {
parent: "controlsContainer",
order: 70,
align: "right"
},
@ranyefet
ranyefet / simplePhpXMLProxy.php
Last active December 25, 2015 16:39
Support for whitelist hostnames
<?PHP
// Script: Simple PHP Proxy: Get external HTML, JSON and more!
//
// *Version: 1.6, Last updated: 1/24/2009*
// *Update by michael.dale@kaltura.com*
// * added validate xml and content type
// * added X-Forwarded-For header for geoLookup services
//
// @@todo add cache and 304 support ( not very high priority since ad servers are generally
@ranyefet
ranyefet / kmc5.js
Last active December 28, 2015 14:29
/* kmc and kmc.vars defined in script block in kmc4success.php */
// For debug enable to true. Debug will show information in the browser console
kmc.vars.debug = false;
// Quickstart guide (should be moved to kmc4success.php)
kmc.vars.quickstart_guide = "/content/docs/pdf/KMC_User_Manual.pdf";
kmc.vars.help_url = kmc.vars.service_url + '/kmc5help.html';
// Set base URL