|
|
@ -14,84 +14,89 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
function init(){ |
|
|
|
function init(){ |
|
|
|
var embed; |
|
|
|
var embed; |
|
|
|
var inputBox = $("<textarea type='text'></textarea>") |
|
|
|
var inputBox = $("<textarea type='text'></textarea>") |
|
|
|
.css({ |
|
|
|
.css({ |
|
|
|
width: "350px", |
|
|
|
width: "350px", |
|
|
|
height: "58px", |
|
|
|
height: "58px", |
|
|
|
marginRight: "5px" |
|
|
|
marginRight: "5px" |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
var submit = $("<div>Embed</div>") |
|
|
|
var submit = $("<div>Embed</div>") |
|
|
|
.css({
|
|
|
|
.css({
|
|
|
|
float: "right", |
|
|
|
float: "right", |
|
|
|
width: "auto", |
|
|
|
width: "auto", |
|
|
|
height:"auto", |
|
|
|
height:"auto", |
|
|
|
padding:"4px", |
|
|
|
padding:"4px", |
|
|
|
marginTop:"13px", |
|
|
|
marginTop:"13px", |
|
|
|
cursor:"pointer", |
|
|
|
cursor:"pointer", |
|
|
|
backgroundColor:"rgb(45,65,250)", |
|
|
|
backgroundColor:"rgb(45,65,250)", |
|
|
|
border:"1px solid", |
|
|
|
border:"1px solid", |
|
|
|
borderColor:"rgb(45,65,250) rgb(25,45,230) rgb(25,45,230) rgb(45,65,250)", |
|
|
|
borderColor:"rgb(45,65,250) rgb(25,45,230) rgb(25,45,230) rgb(45,65,250)", |
|
|
|
textTransform:"capitalize", |
|
|
|
textTransform:"capitalize", |
|
|
|
fontFamily:"Arial", |
|
|
|
fontFamily:"Arial", |
|
|
|
fontSize:"18px", |
|
|
|
fontSize:"18px", |
|
|
|
fontWeight:"regular", |
|
|
|
fontWeight:"regular", |
|
|
|
color:"white" |
|
|
|
color:"white" |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
var loadWindow = $("<div></div>"); |
|
|
|
var loadWindow = $("<div></div>"); |
|
|
|
|
|
|
|
|
|
|
|
var searchWrap = $("<div></div>") |
|
|
|
var searchWrap = $("<div></div>") |
|
|
|
.css({ |
|
|
|
.css({ |
|
|
|
position:"absolute", |
|
|
|
position:"absolute", |
|
|
|
padding: "10px", |
|
|
|
padding: "10px", |
|
|
|
backgroundColor: "rgb(230,230,233)", |
|
|
|
backgroundColor: "rgb(230,230,233)", |
|
|
|
width: "425px", |
|
|
|
width: "425px", |
|
|
|
height: "65px" |
|
|
|
height: "65px" |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//FIT WIDGET FRAME ON LAUNCH...
|
|
|
|
//FIT WIDGET FRAME ON LAUNCH...
|
|
|
|
if(window.sankore){ |
|
|
|
if(window.sankore){ |
|
|
|
window.sankore.resize($("#ubwidget").width()-15,85); |
|
|
|
window.sankore.resize($("#ubwidget").width()-15,85); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
searchWrap.append(inputBox) |
|
|
|
searchWrap.append(inputBox) |
|
|
|
.append(submit); |
|
|
|
.append(submit); |
|
|
|
|
|
|
|
|
|
|
|
$("#ubwidget").append(searchWrap);
|
|
|
|
$("#ubwidget").append(searchWrap);
|
|
|
|
|
|
|
|
|
|
|
|
submit.click(function(){ |
|
|
|
submit.click(function(){ |
|
|
|
$("#ubwidget").append(loadWindow) |
|
|
|
$("#ubwidget").append(loadWindow) |
|
|
|
embed = inputBox.val(); |
|
|
|
embed = inputBox.val(); |
|
|
|
searchWrap.hide(); |
|
|
|
searchWrap.hide(); |
|
|
|
|
|
|
|
|
|
|
|
if(/<object/.test(embed)){ |
|
|
|
if(/<object/.test(embed)){ |
|
|
|
loadWindow.append(embed); |
|
|
|
loadWindow.append(embed); |
|
|
|
loadWindow.find("embed").attr("wmode","opaque"); |
|
|
|
loadWindow.find("embed").attr("wmode","opaque"); |
|
|
|
var loadWindow_content = loadWindow.html(); |
|
|
|
var loadWindow_content = loadWindow.html(); |
|
|
|
loadWindow.empty().html(loadWindow_content); |
|
|
|
loadWindow.empty().html(loadWindow_content); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
loadWindow.append(embed);
|
|
|
|
loadWindow.append(embed);
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(window.sankore){ |
|
|
|
if(window.sankore){ |
|
|
|
window.sankore.resize($(document).width(),$(document).height()); |
|
|
|
window.sankore.resize($(document).width(),$(document).height()); |
|
|
|
window.sankore.setPreference("embed", escape(embed)); |
|
|
|
window.sankore.setPreference("embed", escape(embed)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if(window.sankore){ |
|
|
|
if(window.sankore){ |
|
|
|
|
|
|
|
|
|
|
|
if(window.sankore.preferenceKeys().length != 0){ |
|
|
|
if(window.sankore.preferenceKeys().length != 0){ |
|
|
|
|
|
|
|
|
|
|
|
var loadEmbed = unescape(window.sankore.preference("embed")); |
|
|
|
var loadEmbed = unescape(window.sankore.preference("embed")); |
|
|
|
inputBox.val(loadEmbed); |
|
|
|
inputBox.val(loadEmbed); |
|
|
|
submit.trigger("click");
|
|
|
|
submit.trigger("click");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (window.widget) { |
|
|
|
|
|
|
|
window.widget.onremove = function(){ |
|
|
|
|
|
|
|
loadWindow.empty(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |