My favorites | Sign in
Project Home Downloads Issues
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 46 attachment: jquery.nyroModal.urlplugin-0.0.1.pack.js (2.2 KB)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/**
http://nyromodal.nyrodev.com/
this gives us thickbox functionality where we can influence the setting of each modal through the url
the author or nyro does not make this default functionality because he does not want to alter the url for this purpose
BUT this show how flexible nyrolmodal is because it can be edited to do so quite easily
author: will caine
**/
$(function() {
if($.fn){
$.fn.nyroModal.settings.processHandler = function(settings) {
var tar_url = null;
var surl = settings.url;
var stype = settings.type;
//alert("D " + surl + " " + settings.from + " " + settings.from.tagName + " " + settings.type);
if(surl){
tar_url=surl;
}else{
//url can be null if an type==iframe, so derive the url some other way
if(settings.from && settings.from.tagName=='A'){
tar_url=settings.from.href;
}
}
if (tar_url) {
var args = new Array();
var usplit=tar_url.toUpperCase().split("?");
//this is used to relocate the bookmark to the end of the url, if i have to rewrite it
var bkmark_inx=tar_url.indexOf("#");
if(usplit.length>1){
usplit = usplit[1].split("&");
for(x=0; x<usplit.length; x++){
arrsplit=usplit[x].split("=");
args[arrsplit[0]]=arrsplit[1];
}
}
if(args['NYRO_NO_CACHE']){
//make sure the url is unique everytime
myd=new Date()

//make sure there is an '&' before adding this
if(tar_url.charAt(tar_url.length-1)!='&'){
tar_url+="&";
}
if( bkmark_inx == -1 ){
bkmark_inx = surl.length;
}
tar_url = tar_url.substring(0,bkmark_inx) + "r="+myd.getTime() + tar_url.substring(bkmark_inx);
}
if(args['NYRO_HEIGHT']){
settings.height = parseInt(args['NYRO_HEIGHT']);
}
if(args['NYRO_WIDTH']){
settings.width = parseInt(args['NYRO_WIDTH']);
}
if(args['NYRO_MODAL']){
settings.modal = true;
}
if(surl){
surl=tar_url;
}
$.nyroModalSettings({
url: surl
,width: settings.width
,height: settings.height
,modal: settings.modal
});
}
};
}else{
alert("nyroModal url plugin:could not find: $.fn: " + $.fn );
}
});
Powered by Google Project Hosting