mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
opt:format gd-custom file
This commit is contained in:
parent
505dd9efc8
commit
e32062cf82
|
@ -1,17 +1,17 @@
|
|||
//document ready
|
||||
(function($){
|
||||
$(function() {
|
||||
$(document).on("click","a",function(event) {
|
||||
(function ($) {
|
||||
$(function () {
|
||||
$(document).on("click", "a", function (event) {
|
||||
var link = $(this).attr("href");
|
||||
if ('string' != typeof(link)) {
|
||||
if ('string' != typeof (link)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(link.indexOf("javascript:")>=0){
|
||||
if (link.indexOf("javascript:") >= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(link.indexOf(":")>=0){
|
||||
if (link.indexOf(":") >= 0) {
|
||||
emitClickedEvent(link);
|
||||
return false;
|
||||
}
|
||||
|
@ -19,16 +19,15 @@ $(function() {
|
|||
|
||||
var newLink;
|
||||
var href = window.location.href;
|
||||
var index=-1;
|
||||
var index = -1;
|
||||
if (link.startsWith("#")) {
|
||||
//the href may contain # fragment already.remove them before append the new #fragment
|
||||
index = href.indexOf("#");
|
||||
if(index>-1)
|
||||
{
|
||||
if (index > -1) {
|
||||
newLink = href.substring(0, index) + link;
|
||||
}
|
||||
else{
|
||||
newLink= href+link;
|
||||
}
|
||||
else {
|
||||
newLink = href + link;
|
||||
}
|
||||
} else {
|
||||
index = href.indexOf("?");
|
||||
|
@ -49,24 +48,23 @@ $(function() {
|
|||
|
||||
});
|
||||
|
||||
//monitor iframe height.
|
||||
//monitor iframe height.
|
||||
|
||||
$( "iframe" ).on( "load", function() {
|
||||
var iframe = $( this );
|
||||
resizeIframe( iframe[ 0 ] );
|
||||
} );
|
||||
$("iframe").on("load", function () {
|
||||
var iframe = $(this);
|
||||
resizeIframe(iframe[0]);
|
||||
});
|
||||
|
||||
function resizeIframe(obj) {
|
||||
setInterval(function(){
|
||||
//in some cases ,the website in iframe will load result after document has been loaded. the height will continue to change.
|
||||
var height = $(obj).contents().height();
|
||||
$(obj).height(Math.min(2000,height));
|
||||
if(height >= 2000)
|
||||
{
|
||||
obj.scrolling="yes";
|
||||
}
|
||||
},500);
|
||||
}
|
||||
function resizeIframe(obj) {
|
||||
setInterval(function () {
|
||||
//in some cases ,the website in iframe will load result after document has been loaded. the height will continue to change.
|
||||
var height = $(obj).contents().height();
|
||||
$(obj).height(Math.min(2000, height));
|
||||
if (height >= 2000) {
|
||||
obj.scrolling = "yes";
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
|
||||
});
|
||||
})($_$);
|
||||
|
|
Loading…
Reference in a new issue