| author | hamidouk |
| Fri, 23 Dec 2011 12:47:17 +0100 | |
| branch | popcorn-port |
| changeset 523 | 8dfeaec4724b |
| parent 520 | fe008e95a716 |
| child 531 | e7f27746668e |
| permissions | -rw-r--r-- |
|
358
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
1 |
/* main file */ |
|
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
2 |
|
|
520
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
511
diff
changeset
|
3 |
|
|
358
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
4 |
if ( window.IriSP === undefined && window.__IriSP === undefined ) { |
|
520
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
511
diff
changeset
|
5 |
/** |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
511
diff
changeset
|
6 |
We define here IriSP, the object under which everything goes. |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
511
diff
changeset
|
7 |
We also alias it to __IriSP for backward compatibility |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
511
diff
changeset
|
8 |
*/ |
|
358
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
9 |
var IriSP = {}; |
|
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
10 |
var __IriSP = IriSP; /* for backward compatibility */ |
|
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
11 |
} |
|
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
12 |
|
| 498 | 13 |
IriSP.loadLibs = function( libs, config, metadata_url, callback ) { |
14 |
// Localize jQuery variable |
|
|
358
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
15 |
IriSP.jQuery = null; |
| 498 | 16 |
var $L = $LAB.script(libs.jQuery).script(libs.swfObject) |
17 |
.script(libs.jQueryUI) |
|
18 |
|
|
19 |
if (config.player.type === "jwplayer") { |
|
20 |
// load our popcorn.js lookalike |
|
21 |
$L = $L.script(libs.jwplayer); |
|
22 |
} else { |
|
23 |
// load the real popcorn |
|
24 |
$L = $L.script(libs.popcorn).script(libs["popcorn.code"]); |
|
| 501 | 25 |
if (config.player.type === "youtube") { |
| 498 | 26 |
$L = $L.script(libs["popcorn.youtube"]); |
| 501 | 27 |
} |
28 |
if (config.player.type === "vimeo") |
|
| 498 | 29 |
$L = $L.script(libs["popcorn.vimeo"]); |
30 |
|
|
31 |
/* do nothing for html5 */ |
|
32 |
} |
|
33 |
|
|
34 |
/* widget specific requirements */ |
|
35 |
for (var idx in config.gui.widgets) { |
|
36 |
if (config.gui.widgets[idx].type === "PolemicWidget") { |
|
37 |
$L.script(libs.raphael); |
|
38 |
} |
|
| 523 | 39 |
|
40 |
if (config.gui.widgets[idx].type === "SparklineWidget") { |
|
41 |
$L.script(libs.jquery_sparkline); |
|
42 |
} |
|
| 498 | 43 |
} |
44 |
|
|
45 |
// same for modules |
|
46 |
/* |
|
47 |
for (var idx in config.modules) { |
|
48 |
if (config.modules[idx].type === "PolemicWidget") |
|
49 |
$L.script(libs.raphaelJs); |
|
50 |
} |
|
51 |
*/ |
|
|
358
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
52 |
|
| 498 | 53 |
$L.wait(function() { |
54 |
IriSP.jQuery = window.jQuery.noConflict( true ); |
|
| 511 | 55 |
IriSP._ = window._.noConflict(); |
56 |
IriSP.underscore = IriSP._; |
|
| 498 | 57 |
|
58 |
var css_link_jquery = IriSP.jQuery( "<link>", { |
|
59 |
rel: "stylesheet", |
|
60 |
type: "text/css", |
|
61 |
href: libs.cssjQueryUI, |
|
62 |
'class': "dynamic_css" |
|
63 |
} ); |
|
64 |
var css_link_custom = IriSP.jQuery( "<link>", { |
|
65 |
rel: "stylesheet", |
|
66 |
type: "text/css", |
|
67 |
href: config.gui.css, |
|
68 |
'class': "dynamic_css" |
|
69 |
} ); |
|
70 |
|
|
71 |
css_link_jquery.appendTo('head'); |
|
72 |
css_link_custom.appendTo('head'); |
|
73 |
|
|
74 |
IriSP.setupDataLoader(); |
|
75 |
IriSP.__dataloader.get(metadata_url, |
|
76 |
function(data) { |
|
77 |
/* save the data so that we could re-use it to |
|
78 |
configure the video |
|
79 |
*/ |
|
80 |
IriSP.__jsonMetadata = data; |
|
81 |
callback.call(window) }); |
|
82 |
}); |
|
83 |
}; |