Browse Source

add some notes for most likely places worth fixing as part of #618

pull/631/head
Joe Germuska 11 years ago
parent
commit
df08a01e7d
  1. 1
      source/js/Core/Embed/Embed.CDN.Generator.js
  2. 2
      source/js/Core/Embed/Embed.js
  3. 2
      source/js/Core/Media/VMM.MediaType.js

1
source/js/Core/Embed/Embed.CDN.Generator.js

@ -1,6 +1,7 @@
/* Support Timeline Embed Generator web form (becomes storyjs-embed-generator.js) */ /* Support Timeline Embed Generator web form (becomes storyjs-embed-generator.js) */
if(typeof generator_embed_path == 'undefined' || typeof generator_embed_path == 'undefined') { if(typeof generator_embed_path == 'undefined' || typeof generator_embed_path == 'undefined') {
// REPLACE WITH YOUR BASEPATH IF YOU WANT OTHERWISE IT WILL TRY AND FIGURE IT OUT // REPLACE WITH YOUR BASEPATH IF YOU WANT OTHERWISE IT WILL TRY AND FIGURE IT OUT
// TODO Issue #618 better splitting
var generator_embed_path = getScriptPath("storyjs-embed-generator.js").split("js/")[0]; var generator_embed_path = getScriptPath("storyjs-embed-generator.js").split("js/")[0];
if (generator_embed_path.match("http")) { if (generator_embed_path.match("http")) {
generator_embed_path = generator_embed_path; generator_embed_path = generator_embed_path;

2
source/js/Core/Embed/Embed.js

@ -155,6 +155,7 @@ function createStoryJS(c, src) {
================================================== */ ================================================== */
// Check for old installs still using the old method of language // Check for old installs still using the old method of language
if (storyjs_e_config.js.match("locale")) { if (storyjs_e_config.js.match("locale")) {
// TODO Issue #618 better splitting
storyjs_e_config.lang = storyjs_e_config.js.split("locale/")[1].replace(".js", ""); storyjs_e_config.lang = storyjs_e_config.js.split("locale/")[1].replace(".js", "");
storyjs_e_config.js = path.js + 'timeline-min.js?' + js_version; storyjs_e_config.js = path.js + 'timeline-min.js?' + js_version;
} }
@ -201,6 +202,7 @@ function createStoryJS(c, src) {
// FONT CSS // FONT CSS
var fn; var fn;
if (storyjs_e_config.font.match("/")) { if (storyjs_e_config.font.match("/")) {
// TODO Issue #618 better splitting
fn = storyjs_e_config.font.split(".css")[0].split("/"); fn = storyjs_e_config.font.split(".css")[0].split("/");
path.font.name = fn[fn.length -1]; path.font.name = fn[fn.length -1];
path.font.css = storyjs_e_config.font; path.font.css = storyjs_e_config.font;

2
source/js/Core/Media/VMM.MediaType.js

@ -41,6 +41,7 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaType == 'undefined') {
if (d.match('v=')) { if (d.match('v=')) {
media.id = VMM.Util.getUrlVars(d)["v"]; media.id = VMM.Util.getUrlVars(d)["v"];
} else if (d.match('\/embed\/')) { } else if (d.match('\/embed\/')) {
// TODO Issue #618 better splitting
media.id = d.split("embed\/")[1].split(/[?&]/)[0]; media.id = d.split("embed\/")[1].split(/[?&]/)[0];
} else if (d.match(/v\/|v=|youtu\.be\//)){ } else if (d.match(/v\/|v=|youtu\.be\//)){
media.id = d.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0]; media.id = d.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];
@ -119,6 +120,7 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaType == 'undefined') {
} else if (d.match('(www.)?wikipedia\.org')) { } else if (d.match('(www.)?wikipedia\.org')) {
media.type = "wikipedia"; media.type = "wikipedia";
//media.id = d.split("wiki\/")[1]; //media.id = d.split("wiki\/")[1];
// TODO Issue #618 better splitting
var wiki_id = d.split("wiki\/")[1].split("#")[0].replace("_", " "); var wiki_id = d.split("wiki\/")[1].split("#")[0].replace("_", " ");
media.id = wiki_id.replace(" ", "%20"); media.id = wiki_id.replace(" ", "%20");
media.lang = d.split("//")[1].split(".wikipedia")[0]; media.lang = d.split("//")[1].split(".wikipedia")[0];

Loading…
Cancel
Save