| author | hamidouk |
| Tue, 14 Feb 2012 17:15:13 +0100 | |
| branch | popcorn-port |
| changeset 810 | 85a278e12495 |
| parent 743 | 69a9969daa41 |
| child 834 | 573c7ca752e0 |
| 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 |
/** |
| 531 | 6 |
@class |
7 |
the object under which everything goes. |
|
|
520
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
511
diff
changeset
|
8 |
*/ |
| 531 | 9 |
IriSP = {}; |
10 |
|
|
11 |
/** Alias to IriSP for backward compatibility */ |
|
12 |
__IriSP = IriSP; |
|
|
358
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
13 |
} |
|
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
14 |
|
|
743
69a9969daa41
better defaults - paths are now computed at run-time.
hamidouk
parents:
662
diff
changeset
|
15 |
/* underscore comes bundled with the player and we need |
|
69a9969daa41
better defaults - paths are now computed at run-time.
hamidouk
parents:
662
diff
changeset
|
16 |
it ASAP, so load it that way |
|
69a9969daa41
better defaults - paths are now computed at run-time.
hamidouk
parents:
662
diff
changeset
|
17 |
*/ |
|
69a9969daa41
better defaults - paths are now computed at run-time.
hamidouk
parents:
662
diff
changeset
|
18 |
|
|
69a9969daa41
better defaults - paths are now computed at run-time.
hamidouk
parents:
662
diff
changeset
|
19 |
IriSP._ = window._.noConflict(); |
|
69a9969daa41
better defaults - paths are now computed at run-time.
hamidouk
parents:
662
diff
changeset
|
20 |
IriSP.underscore = IriSP._; |
|
69a9969daa41
better defaults - paths are now computed at run-time.
hamidouk
parents:
662
diff
changeset
|
21 |
|
| 498 | 22 |
IriSP.loadLibs = function( libs, config, metadata_url, callback ) { |
23 |
// Localize jQuery variable |
|
|
358
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
24 |
IriSP.jQuery = null; |
| 574 | 25 |
var $L = $LAB.script(libs.jQuery).script(libs.swfObject).wait() |
26 |
.script(libs.jQueryUI); |
|
| 498 | 27 |
|
28 |
if (config.player.type === "jwplayer") { |
|
29 |
// load our popcorn.js lookalike |
|
30 |
$L = $L.script(libs.jwplayer); |
|
31 |
} else { |
|
32 |
// load the real popcorn |
|
33 |
$L = $L.script(libs.popcorn).script(libs["popcorn.code"]); |
|
| 501 | 34 |
if (config.player.type === "youtube") { |
| 498 | 35 |
$L = $L.script(libs["popcorn.youtube"]); |
| 501 | 36 |
} |
37 |
if (config.player.type === "vimeo") |
|
| 498 | 38 |
$L = $L.script(libs["popcorn.vimeo"]); |
39 |
|
|
40 |
/* do nothing for html5 */ |
|
41 |
} |
|
42 |
|
|
43 |
/* widget specific requirements */ |
|
44 |
for (var idx in config.gui.widgets) { |
|
| 662 | 45 |
if (config.gui.widgets[idx].type === "PolemicWidget" || |
46 |
config.gui.widgets[idx].type === "StackGraphWidget") { |
|
| 498 | 47 |
$L.script(libs.raphael); |
48 |
} |
|
| 523 | 49 |
|
50 |
if (config.gui.widgets[idx].type === "SparklineWidget") { |
|
51 |
$L.script(libs.jquery_sparkline); |
|
52 |
} |
|
| 498 | 53 |
} |
54 |
|
|
55 |
// same for modules |
|
56 |
/* |
|
57 |
for (var idx in config.modules) { |
|
58 |
if (config.modules[idx].type === "PolemicWidget") |
|
59 |
$L.script(libs.raphaelJs); |
|
60 |
} |
|
61 |
*/ |
|
|
358
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
62 |
|
| 498 | 63 |
$L.wait(function() { |
64 |
IriSP.jQuery = window.jQuery.noConflict( true ); |
|
65 |
|
|
66 |
var css_link_jquery = IriSP.jQuery( "<link>", { |
|
67 |
rel: "stylesheet", |
|
68 |
type: "text/css", |
|
69 |
href: libs.cssjQueryUI, |
|
70 |
'class': "dynamic_css" |
|
71 |
} ); |
|
72 |
var css_link_custom = IriSP.jQuery( "<link>", { |
|
73 |
rel: "stylesheet", |
|
74 |
type: "text/css", |
|
75 |
href: config.gui.css, |
|
76 |
'class': "dynamic_css" |
|
77 |
} ); |
|
78 |
|
|
79 |
css_link_jquery.appendTo('head'); |
|
80 |
css_link_custom.appendTo('head'); |
|
81 |
|
|
82 |
IriSP.setupDataLoader(); |
|
83 |
IriSP.__dataloader.get(metadata_url, |
|
84 |
function(data) { |
|
85 |
/* save the data so that we could re-use it to |
|
86 |
configure the video |
|
87 |
*/ |
|
88 |
IriSP.__jsonMetadata = data; |
|
89 |
callback.call(window) }); |
|
90 |
}); |
|
91 |
}; |