sufia 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +1 -1
- data/app/assets/javascripts/sufia.js +6 -5
- data/app/assets/javascripts/terms_of_service.js +28 -0
- data/app/controllers/batch_edits_controller.rb +2 -2
- data/app/controllers/generic_files_controller.rb +2 -2
- data/app/models/datastreams/fits_datastream.rb +1 -1
- data/app/views/batch/edit.html.erb +6 -6
- data/app/views/batch_edits/edit.html.erb +10 -6
- data/app/views/catalog/_search_form.html.erb +2 -2
- data/app/views/dashboard/index.html.erb +7 -7
- data/app/views/generic_files/_asset_updated_flash.html.erb +1 -1
- data/app/views/generic_files/_descriptions.html.erb +1 -1
- data/app/views/generic_files/_versioning.html.erb +1 -1
- data/app/views/generic_files/edit.html.erb +10 -10
- data/app/views/generic_files/new.html.erb +3 -3
- data/app/views/generic_files/show.html.erb +1 -1
- data/app/views/users/edit.html.erb +3 -3
- data/config/locales/sufia.en.yml +10 -3
- data/features/step_definitions/scholarsphere.rb +3 -1
- data/features/support/paths.rb +1 -1
- data/lib/sufia/generic_file.rb +2 -3
- data/lib/sufia/generic_file/characterization.rb +1 -1
- data/lib/sufia/jobs/batch_update_job.rb +2 -2
- data/lib/sufia/version.rb +1 -1
- data/lib/tasks/resque.rake +27 -1
- data/spec/models/file_content_datastream_spec.rb +2 -2
- data/spec/models/generic_file_spec.rb +7 -4
- data/sufia.gemspec +3 -5
- data/vendor/assets/javascripts/fileupload.js +1 -3
- data/vendor/assets/javascripts/fileupload/application.js +0 -25
- data/vendor/assets/javascripts/fileupload/tmpl.js +86 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.autocomplete.js +602 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.core.js +356 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.menu.js +610 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.widget.js +528 -0
- data/vendor/assets/javascripts/swfobject.js +4 -0
- metadata +15 -37
- data/app/assets/javascripts/generic_files.js +0 -17
- data/tasks/resque.rake +0 -27
- data/vendor/assets/javascripts/blacklight.js +0 -513
- data/vendor/assets/javascripts/bootstrap-collapse.js +0 -157
- data/vendor/assets/javascripts/bootstrap-popover.js +0 -98
- data/vendor/assets/javascripts/bootstrap-tooltip.js +0 -275
- data/vendor/assets/javascripts/fileupload/tmpl.min.js +0 -1
- data/vendor/assets/javascripts/jquery-1.7.2.min.js +0 -4
- data/vendor/assets/javascripts/jquery-1.8.2.js +0 -9440
- data/vendor/assets/javascripts/jquery-1.8.2.min.js +0 -2
- data/vendor/assets/javascripts/jquery-ui-1.8.16.custom.min.js +0 -791
- data/vendor/assets/javascripts/jquery-ui-1.8.23.custom.min.js +0 -125
- data/vendor/assets/javascripts/jquery_ujs.js +0 -377
@@ -0,0 +1,4 @@
|
|
1
|
+
/* SWFObject v2.2 <http://code.google.com/p/swfobject/>
|
2
|
+
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
3
|
+
*/
|
4
|
+
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sufia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 5.
|
69
|
+
version: '5.1'
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -74,23 +74,7 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: 5.
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
name: active-fedora
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
|
-
requirements:
|
83
|
-
- - ~>
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: 5.0.0
|
86
|
-
type: :runtime
|
87
|
-
prerelease: false
|
88
|
-
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- - ~>
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: 5.0.0
|
77
|
+
version: '5.1'
|
94
78
|
- !ruby/object:Gem::Dependency
|
95
79
|
name: noid
|
96
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,7 +98,7 @@ dependencies:
|
|
114
98
|
requirements:
|
115
99
|
- - ~>
|
116
100
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.0
|
101
|
+
version: 0.1.0
|
118
102
|
type: :runtime
|
119
103
|
prerelease: false
|
120
104
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -122,13 +106,13 @@ dependencies:
|
|
122
106
|
requirements:
|
123
107
|
- - ~>
|
124
108
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0.0
|
109
|
+
version: 0.1.0
|
126
110
|
- !ruby/object:Gem::Dependency
|
127
111
|
name: resque
|
128
112
|
requirement: !ruby/object:Gem::Requirement
|
129
113
|
none: false
|
130
114
|
requirements:
|
131
|
-
- -
|
115
|
+
- - ~>
|
132
116
|
- !ruby/object:Gem::Version
|
133
117
|
version: 1.23.0
|
134
118
|
type: :runtime
|
@@ -136,7 +120,7 @@ dependencies:
|
|
136
120
|
version_requirements: !ruby/object:Gem::Requirement
|
137
121
|
none: false
|
138
122
|
requirements:
|
139
|
-
- -
|
123
|
+
- - ~>
|
140
124
|
- !ruby/object:Gem::Version
|
141
125
|
version: 1.23.0
|
142
126
|
- !ruby/object:Gem::Dependency
|
@@ -508,8 +492,8 @@ files:
|
|
508
492
|
- app/assets/javascripts/bootstrap-modal.js
|
509
493
|
- app/assets/javascripts/contact_form.js
|
510
494
|
- app/assets/javascripts/dashboard.js
|
511
|
-
- app/assets/javascripts/generic_files.js
|
512
495
|
- app/assets/javascripts/sufia.js
|
496
|
+
- app/assets/javascripts/terms_of_service.js
|
513
497
|
- app/assets/stylesheets/blacklight_more_facets.css
|
514
498
|
- app/assets/stylesheets/bootstrap.min.css
|
515
499
|
- app/assets/stylesheets/contact_form.css
|
@@ -898,7 +882,6 @@ files:
|
|
898
882
|
- sufia.gemspec
|
899
883
|
- tasks/cucumber.rake
|
900
884
|
- tasks/jetty.rake
|
901
|
-
- tasks/resque.rake
|
902
885
|
- tasks/sufia-db.rake
|
903
886
|
- tasks/sufia-dev.rake
|
904
887
|
- tasks/sufia-fixtures.rake
|
@@ -914,10 +897,6 @@ files:
|
|
914
897
|
- vendor/assets/javascripts/ZeroClipboard.swf
|
915
898
|
- vendor/assets/javascripts/audio.min.js
|
916
899
|
- vendor/assets/javascripts/audiojs.swf
|
917
|
-
- vendor/assets/javascripts/blacklight.js
|
918
|
-
- vendor/assets/javascripts/bootstrap-collapse.js
|
919
|
-
- vendor/assets/javascripts/bootstrap-popover.js
|
920
|
-
- vendor/assets/javascripts/bootstrap-tooltip.js
|
921
900
|
- vendor/assets/javascripts/fileupload.js
|
922
901
|
- vendor/assets/javascripts/fileupload/application.js
|
923
902
|
- vendor/assets/javascripts/fileupload/jquery-ui-1.8.14.custom.min.js
|
@@ -926,15 +905,14 @@ files:
|
|
926
905
|
- vendor/assets/javascripts/fileupload/jquery.fileupload.js
|
927
906
|
- vendor/assets/javascripts/fileupload/jquery.iframe-transport.js
|
928
907
|
- vendor/assets/javascripts/fileupload/locale.js
|
929
|
-
- vendor/assets/javascripts/fileupload/tmpl.
|
930
|
-
- vendor/assets/javascripts/jquery-1.
|
931
|
-
- vendor/assets/javascripts/jquery-1.
|
932
|
-
- vendor/assets/javascripts/jquery-1.
|
933
|
-
- vendor/assets/javascripts/jquery-ui-1.
|
934
|
-
- vendor/assets/javascripts/jquery-ui-1.8.23.custom.min.js
|
908
|
+
- vendor/assets/javascripts/fileupload/tmpl.js
|
909
|
+
- vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.autocomplete.js
|
910
|
+
- vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.core.js
|
911
|
+
- vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.menu.js
|
912
|
+
- vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.widget.js
|
935
913
|
- vendor/assets/javascripts/jquery.validate.js
|
936
914
|
- vendor/assets/javascripts/jquery.zclip.min.js
|
937
|
-
- vendor/assets/javascripts/
|
915
|
+
- vendor/assets/javascripts/swfobject.js
|
938
916
|
- vendor/assets/javascripts/video.js
|
939
917
|
- vendor/plugins/.gitkeep
|
940
918
|
homepage: ''
|
@@ -1,17 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
Copyright © 2012 The Pennsylvania State University
|
3
|
-
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
you may not use this file except in compliance with the License.
|
6
|
-
You may obtain a copy of the License at
|
7
|
-
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
See the License for the specific language governing permissions and
|
14
|
-
limitations under the License.
|
15
|
-
*/
|
16
|
-
|
17
|
-
//= require fileupload
|
data/tasks/resque.rake
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# Copyright © 2012 The Pennsylvania State University
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
require 'resque/pool/tasks'
|
16
|
-
|
17
|
-
# This provides access to the Rails env within all Resque workers
|
18
|
-
task 'resque:setup' => :environment
|
19
|
-
|
20
|
-
# Set up resque-pool
|
21
|
-
task 'resque:pool:setup' do
|
22
|
-
ActiveRecord::Base.connection.disconnect!
|
23
|
-
Resque::Pool.after_prefork do |job|
|
24
|
-
ActiveRecord::Base.establish_connection
|
25
|
-
Resque.redis.client.reconnect
|
26
|
-
end
|
27
|
-
end
|
@@ -1,513 +0,0 @@
|
|
1
|
-
/* This file is generated by Blacklight. You probably don't want to edit
|
2
|
-
this file directly, or you'll have to manually merge your changes if later
|
3
|
-
versions of Blacklight change this file. Instead, use your own JS file
|
4
|
-
which over-rides things in this JS file, as described below: */
|
5
|
-
|
6
|
-
/* Blacklight has a Javascript setup meant to support local disabling,
|
7
|
-
modification, and use of Blacklight behaviors.
|
8
|
-
|
9
|
-
There is a global Blacklight object, available to your local JS.
|
10
|
-
|
11
|
-
Individual logic to apply JS behaviors to particular elements is
|
12
|
-
stored in functions on that Blacklight object.
|
13
|
-
|
14
|
-
The actual behaviors themselves are implemented as JQuery plugins,
|
15
|
-
JQuery-UI widgets (a special kind of JQuery plugin), or in some cases
|
16
|
-
just as logic in the Blacklight global object.
|
17
|
-
|
18
|
-
All of these things can be modified by your local JS code -- these functions
|
19
|
-
are all set up on js load, and only called on document ready, so do your
|
20
|
-
modifications just on js load, and they'll be made by the time document ready
|
21
|
-
comes along.
|
22
|
-
|
23
|
-
Examples, in your application's own JS:
|
24
|
-
|
25
|
-
Change what items zebra_striping gets applied to:
|
26
|
-
|
27
|
-
Blacklight.do_zebra_stripe.selector = ".my_class .even";
|
28
|
-
//Or even add on to existing:
|
29
|
-
Blacklight.do_zebra_stripe.selector = Blacklight.do_zebra_stripe.selector + " .my_class .even";
|
30
|
-
|
31
|
-
Turn off adding of behavior to facet 'more' links, using a no-op function:
|
32
|
-
|
33
|
-
Blacklight.do_more_facets_behavior = function() {};
|
34
|
-
|
35
|
-
Change the implementation of facet 'more' link behavior to use entirely
|
36
|
-
different JS.
|
37
|
-
|
38
|
-
Blacklight.do_more_facets_behavior = function() {
|
39
|
-
$(Blacklight.do_more_facets_behavior.selector).each(function() {
|
40
|
-
//my own thing!
|
41
|
-
});
|
42
|
-
};
|
43
|
-
*/
|
44
|
-
|
45
|
-
Blacklight = {};
|
46
|
-
|
47
|
-
|
48
|
-
$(document).ready(function() {
|
49
|
-
Blacklight.do_zebra_stripe();
|
50
|
-
|
51
|
-
Blacklight.do_select_submit();
|
52
|
-
|
53
|
-
Blacklight.do_more_facets_behavior();
|
54
|
-
|
55
|
-
Blacklight.do_lightbox_dialog();
|
56
|
-
|
57
|
-
Blacklight.do_bookmark_toggle_behavior();
|
58
|
-
|
59
|
-
Blacklight.do_folder_toggle_behavior();
|
60
|
-
|
61
|
-
Blacklight.do_facet_expand_contract_behavior();
|
62
|
-
|
63
|
-
Blacklight.do_search_context_behavior();
|
64
|
-
});
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
//Note all of these definitions are NOT in document ready, they get defined on
|
69
|
-
//page load, and later called on document ready.
|
70
|
-
(function($) {
|
71
|
-
Blacklight.do_search_context_behavior = function() {
|
72
|
-
$('a[data-counter]').click(function(event) {
|
73
|
-
var f = document.createElement('form'); f.style.display = 'none';
|
74
|
-
this.parentNode.appendChild(f);
|
75
|
-
f.method = 'POST';
|
76
|
-
f.action = $(this).attr('href');
|
77
|
-
if(event.metaKey || event.ctrlKey){f.target = '_blank';};
|
78
|
-
var d = document.createElement('input'); d.setAttribute('type', 'hidden');
|
79
|
-
d.setAttribute('name', 'counter'); d.setAttribute('value', $(this).data('counter')); f.appendChild(d);
|
80
|
-
var m = document.createElement('input'); m.setAttribute('type', 'hidden');
|
81
|
-
m.setAttribute('name', '_method'); m.setAttribute('value', 'put'); f.appendChild(m);
|
82
|
-
var m = document.createElement('input'); m.setAttribute('type', 'hidden');
|
83
|
-
m.setAttribute('name', $('meta[name="csrf-param"]').attr('content')); m.setAttribute('value', $('meta[name="csrf-token"]').attr('content')); f.appendChild(m);
|
84
|
-
|
85
|
-
f.submit();
|
86
|
-
|
87
|
-
return false;
|
88
|
-
});
|
89
|
-
|
90
|
-
};
|
91
|
-
|
92
|
-
// adds classes for zebra striping table rows
|
93
|
-
Blacklight.do_zebra_stripe = function() {
|
94
|
-
$(Blacklight.do_zebra_stripe.selector).addClass('zebra_stripe');
|
95
|
-
};
|
96
|
-
Blacklight.do_zebra_stripe.selector = "table.zebra tr:even, ul.zebra li:even";
|
97
|
-
|
98
|
-
//add ajaxy dialogs to certain links, using the ajaxyDialog widget.
|
99
|
-
Blacklight.do_more_facets_behavior = function () {
|
100
|
-
$( Blacklight.do_more_facets_behavior.selector ).ajaxyDialog({
|
101
|
-
width: $(window).width() / 2,
|
102
|
-
chainAjaxySelector: "a.next_page, a.prev_page, a.sort_change"
|
103
|
-
});
|
104
|
-
};
|
105
|
-
Blacklight.do_more_facets_behavior.selector = "a.more_facets_link";
|
106
|
-
|
107
|
-
// Used for sort-by and per-page controls, hide the submit button
|
108
|
-
// and make the select auto-submit
|
109
|
-
Blacklight.do_select_submit = function() {
|
110
|
-
$(Blacklight.do_select_submit.selector).each(function() {
|
111
|
-
var select = $(this);
|
112
|
-
select.closest("form").find("input[type=submit]").hide();
|
113
|
-
select.bind("change", function() {
|
114
|
-
this.form.submit();
|
115
|
-
});
|
116
|
-
});
|
117
|
-
};
|
118
|
-
Blacklight.do_select_submit.selector = "form.sort select, form.per_page select";
|
119
|
-
|
120
|
-
|
121
|
-
Blacklight.do_lightbox_dialog = function() {
|
122
|
-
$("a.lightboxLink").ajaxyDialog({
|
123
|
-
chainAjaxySelector: false
|
124
|
-
});
|
125
|
-
//But make the librarian link wider than 300px default.
|
126
|
-
$('a.lightboxLink#librarianLink').ajaxyDialog("option", "width", 650);
|
127
|
-
//And the email one too needs to be wider to fit the textarea
|
128
|
-
$("a.lightboxLink#emailLink").ajaxyDialog("option", "width", 500);
|
129
|
-
};
|
130
|
-
|
131
|
-
//change form submit toggle to checkbox
|
132
|
-
Blacklight.do_bookmark_toggle_behavior = function() {
|
133
|
-
$(Blacklight.do_bookmark_toggle_behavior.selector).bl_checkbox_submit({
|
134
|
-
checked_label: "In Bookmarks",
|
135
|
-
unchecked_label: "Bookmark",
|
136
|
-
progress_label: "Saving...",
|
137
|
-
//css_class is added to elements added, plus used for id base
|
138
|
-
css_class: "toggle_bookmark"
|
139
|
-
});
|
140
|
-
};
|
141
|
-
Blacklight.do_bookmark_toggle_behavior.selector = "form.bookmark_toggle";
|
142
|
-
|
143
|
-
Blacklight.do_folder_toggle_behavior = function() {
|
144
|
-
$( Blacklight.do_folder_toggle_behavior.selector ).bl_checkbox_submit({
|
145
|
-
checked_label: "Selected",
|
146
|
-
unchecked_label: "Select",
|
147
|
-
css_class: "toggle_folder",
|
148
|
-
success: function(new_state) {
|
149
|
-
|
150
|
-
if (new_state) {
|
151
|
-
$("#folder_number").text(parseInt($("#folder_number").text()) + 1);
|
152
|
-
}
|
153
|
-
else {
|
154
|
-
$("#folder_number").text(parseInt($("#folder_number").text()) - 1);
|
155
|
-
}
|
156
|
-
}
|
157
|
-
});
|
158
|
-
};
|
159
|
-
Blacklight.do_folder_toggle_behavior.selector = "form.folder_toggle";
|
160
|
-
|
161
|
-
Blacklight.do_facet_expand_contract_behavior = function() {
|
162
|
-
$( Blacklight.do_facet_expand_contract_behavior.selector ).each (
|
163
|
-
Blacklight.facet_expand_contract
|
164
|
-
);
|
165
|
-
}
|
166
|
-
Blacklight.do_facet_expand_contract_behavior.selector = '#facets h3';
|
167
|
-
|
168
|
-
/* Behavior that makes facet limit headings in sidebar expand/contract
|
169
|
-
their contents. This is kind of fragile code targeted specifically
|
170
|
-
at how we currently render facet HTML, which is why I put it in a function
|
171
|
-
on Blacklight instead of in a jquery plugin. Perhaps in the future this
|
172
|
-
could/should be expanded to a general purpose jquery plugin -- or
|
173
|
-
we should just use one of the existing ones for expand/contract? */
|
174
|
-
Blacklight.facet_expand_contract = function() {
|
175
|
-
$(this).next("ul, div").each(function(){
|
176
|
-
var f_content = $(this);
|
177
|
-
$(f_content).prev('h3').addClass('twiddle');
|
178
|
-
// find all f_content's that don't have any span descendants with a class of "selected"
|
179
|
-
if($('span.selected', f_content).length == 0){
|
180
|
-
// hide it
|
181
|
-
f_content.hide();
|
182
|
-
} else {
|
183
|
-
$(this).prev('h3').addClass('twiddle-open');
|
184
|
-
}
|
185
|
-
|
186
|
-
// attach the toggle behavior to the h3 tag
|
187
|
-
$('h3', f_content.parent()).click(function(){
|
188
|
-
// toggle the content
|
189
|
-
$(this).toggleClass('twiddle-open');
|
190
|
-
$(f_content).slideToggle();
|
191
|
-
});
|
192
|
-
});
|
193
|
-
};
|
194
|
-
|
195
|
-
})(jQuery);
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
/* A JQuery plugin (should this be implemented as a widget instead? not sure)
|
203
|
-
that will convert a "toggle" form, with single submit button to add/remove
|
204
|
-
something, like used for Bookmarks/Folder, into an AJAXy checkbox instead.
|
205
|
-
|
206
|
-
Apply to a form. Does require certain assumption about the form:
|
207
|
-
1) The same form 'action' href must be used for both ADD and REMOVE
|
208
|
-
actions, with the different being the hidden input name="_method"
|
209
|
-
being set to "put" or "delete" -- that's the Rails method to pretend
|
210
|
-
to be doing a certain HTTP verb. So same URL, PUT to add, DELETE
|
211
|
-
to remove. This plugin assumes that.
|
212
|
-
|
213
|
-
Plus, the form this is applied to should provide a data-doc-id
|
214
|
-
attribute (HTML5-style doc-*) that contains the id/primary key
|
215
|
-
of the object in question -- used by plugin for a unique value for
|
216
|
-
DOM id's.
|
217
|
-
|
218
|
-
Pass in options for your class name and labels:
|
219
|
-
$("form.something").bl_checkbox_submit({
|
220
|
-
checked_label: "Selected",
|
221
|
-
unchecked_label: "Select",
|
222
|
-
progress_label: "Saving...",
|
223
|
-
//css_class is added to elements added, plus used for id base
|
224
|
-
css_class: "toggle_my_kinda_form",
|
225
|
-
success: function(after_success_check_state) {
|
226
|
-
#optional callback
|
227
|
-
}
|
228
|
-
});
|
229
|
-
*/
|
230
|
-
(function($) {
|
231
|
-
$.fn.bl_checkbox_submit = function(arg_opts) {
|
232
|
-
|
233
|
-
this.each(function() {
|
234
|
-
var options = $.extend({}, $.fn.bl_checkbox_submit.defaults, arg_opts);
|
235
|
-
|
236
|
-
|
237
|
-
var form = $(this);
|
238
|
-
form.children().hide();
|
239
|
-
//We're going to use the existing form to actually send our add/removes
|
240
|
-
//This works conveneintly because the exact same action href is used
|
241
|
-
//for both bookmarks/$doc_id. But let's take out the irrelevant parts
|
242
|
-
//of the form to avoid any future confusion.
|
243
|
-
form.find("input[type=submit]").remove();
|
244
|
-
|
245
|
-
//View needs to set data-doc-id so we know a unique value
|
246
|
-
//for making DOM id
|
247
|
-
var unique_id = form.attr("data-doc-id") || Math.random();
|
248
|
-
// if form is currently using method delete to change state,
|
249
|
-
// then checkbox is currently checked
|
250
|
-
var checked = (form.find("input[name=_method][value=delete]").size() != 0);
|
251
|
-
|
252
|
-
var checkbox = $('<input type="checkbox">')
|
253
|
-
.addClass( options.css_class )
|
254
|
-
.attr("id", options.css_class + "_" + unique_id);
|
255
|
-
var label = $('<label>')
|
256
|
-
.addClass( options.css_class )
|
257
|
-
.attr("for", options.css_class + '_' + unique_id)
|
258
|
-
.attr("title", form.attr("title") || "");
|
259
|
-
|
260
|
-
|
261
|
-
function update_state_for(state) {
|
262
|
-
checkbox.attr("checked", state);
|
263
|
-
label.toggleClass("checked", state);
|
264
|
-
if (state) {
|
265
|
-
//Set the Rails hidden field that fakes an HTTP verb
|
266
|
-
//properly for current state action.
|
267
|
-
form.find("input[name=_method]").val("delete");
|
268
|
-
label.text(options.checked_label);
|
269
|
-
} else {
|
270
|
-
form.find("input[name=_method]").val("put");
|
271
|
-
label.text(options.unchecked_label);
|
272
|
-
}
|
273
|
-
}
|
274
|
-
|
275
|
-
form.append(checkbox).append(" ").append(label);
|
276
|
-
update_state_for(checked);
|
277
|
-
|
278
|
-
checkbox.click(function() {
|
279
|
-
label.text(options.progress_label).attr("disabled", "disabled");
|
280
|
-
checkbox.attr("disabled", "disabled");
|
281
|
-
|
282
|
-
$.ajax({
|
283
|
-
url: form.attr("action"),
|
284
|
-
dataType: 'json',
|
285
|
-
type: form.attr("method").toUpperCase(),
|
286
|
-
data: form.serialize(),
|
287
|
-
error: function() {
|
288
|
-
alert("Error");
|
289
|
-
update_state_for(checked);
|
290
|
-
label.removeAttr("disabled");
|
291
|
-
checkbox.removeAttr("disabled");
|
292
|
-
},
|
293
|
-
success: function(data, status, xhr) {
|
294
|
-
//if app isn't running at all, xhr annoyingly
|
295
|
-
//reports success with status 0.
|
296
|
-
if (xhr.status != 0) {
|
297
|
-
checked = ! checked;
|
298
|
-
update_state_for(checked);
|
299
|
-
label.removeAttr("disabled");
|
300
|
-
checkbox.removeAttr("disabled");
|
301
|
-
options.success.call(form, checked);
|
302
|
-
} else {
|
303
|
-
alert("Error");
|
304
|
-
update_state_for(checked);
|
305
|
-
label.removeAttr("disabled");
|
306
|
-
checkbox.removeAttr("disabled");
|
307
|
-
}
|
308
|
-
}
|
309
|
-
});
|
310
|
-
|
311
|
-
return false;
|
312
|
-
}); //checkbox.click
|
313
|
-
|
314
|
-
|
315
|
-
}); //this.each
|
316
|
-
return this;
|
317
|
-
};
|
318
|
-
|
319
|
-
$.fn.bl_checkbox_submit.defaults = {
|
320
|
-
checked_label: "",
|
321
|
-
unchecked_label: "",
|
322
|
-
progress_label: "Saving...",
|
323
|
-
//css_class is added to elements added, plus used for id base
|
324
|
-
css_class: "bl_checkbox_submit",
|
325
|
-
success: function() {} //callback
|
326
|
-
};
|
327
|
-
|
328
|
-
})(jQuery);
|
329
|
-
|
330
|
-
|
331
|
-
/* A widget written by jrochkind to make a link or form result in
|
332
|
-
an in-window ajaxy dialog, instead of page load, using JQuery UI
|
333
|
-
Dialog widget.
|
334
|
-
|
335
|
-
This widget is actually hosted at: https://github.com/jrochkind/jquery.uiExt.ajaxyDialog
|
336
|
-
|
337
|
-
|
338
|
-
Included in this main file because I just couldn't bare to add yet
|
339
|
-
another JS file to our app, until we figure out a good fix those too
|
340
|
-
many JS files are serious page load speed problem. */
|
341
|
-
|
342
|
-
(function($) {
|
343
|
-
var widgetNamespace = "uiExt";
|
344
|
-
var widgetName = "ajaxyDialog";
|
345
|
-
|
346
|
-
$.widget(widgetNamespace + "." + widgetName, {
|
347
|
-
options: {
|
348
|
-
extractTitleSelector: "h1, h2, h3, h4, h5",
|
349
|
-
chainAjaxySelector: "a:not([target]), form:not([target])",
|
350
|
-
closeDialogSelector: "a.dialog-close"
|
351
|
-
},
|
352
|
-
|
353
|
-
_create: function() {
|
354
|
-
var self = this;
|
355
|
-
var element = self.element[0];
|
356
|
-
if (element.tagName.toUpperCase() == "A") {
|
357
|
-
$(element).bind("click."+self.widgetName, function(event, ui) {
|
358
|
-
self._handleClick();
|
359
|
-
return false;
|
360
|
-
});
|
361
|
-
}
|
362
|
-
else if (element.tagName.toUpperCase() == "FORM") {
|
363
|
-
$(element).bind("submit."+self.widgetName, function(event, ui) {
|
364
|
-
self._handleSubmit();
|
365
|
-
return false;
|
366
|
-
});
|
367
|
-
}
|
368
|
-
},
|
369
|
-
|
370
|
-
open: function() {
|
371
|
-
var self = this;
|
372
|
-
var element = self.element[0];
|
373
|
-
|
374
|
-
if ( element.tagName.toUpperCase() == "A") {
|
375
|
-
self._handleClick();
|
376
|
-
} else if (element.tagName.toUpperCase() == "FORM") {
|
377
|
-
self._handleSubmit();
|
378
|
-
}
|
379
|
-
},
|
380
|
-
|
381
|
-
close: function() {
|
382
|
-
this.dialogContainer().dialog("close");
|
383
|
-
},
|
384
|
-
|
385
|
-
_handleClick: function() {
|
386
|
-
var self = this;
|
387
|
-
var url = this.element.attr("href");
|
388
|
-
var requestDialog = self.dialogContainer();
|
389
|
-
|
390
|
-
$("body").css("cursor", "progress");
|
391
|
-
|
392
|
-
$.ajax({
|
393
|
-
url: url,
|
394
|
-
dataType: "html",
|
395
|
-
success: function(resp, status, xhr) {
|
396
|
-
if (xhr.status != 0) {
|
397
|
-
self._loadToDialog(resp);
|
398
|
-
} else {
|
399
|
-
//stupid jquery calling this 'success', it's
|
400
|
-
//network unavailable.
|
401
|
-
self._displayFailure(url, xhr, status);
|
402
|
-
}
|
403
|
-
},
|
404
|
-
error: function(xhr, msg) {
|
405
|
-
self._displayFailure(url, xhr, msg);
|
406
|
-
}
|
407
|
-
});
|
408
|
-
},
|
409
|
-
|
410
|
-
_handleSubmit: function() {
|
411
|
-
var self = this;
|
412
|
-
var form = self.element;
|
413
|
-
var actionUri = form.attr("action");
|
414
|
-
var serialized = form.serialize();
|
415
|
-
|
416
|
-
$("body").css("cursor", "progress");
|
417
|
-
|
418
|
-
$.ajax({
|
419
|
-
url: actionUri,
|
420
|
-
data: serialized,
|
421
|
-
type: form.attr("method").toUpperCase(),
|
422
|
-
dataType: "html",
|
423
|
-
success: function(resp, status, xhr) {
|
424
|
-
if (xhr.status != 0) {
|
425
|
-
self._loadToDialog(resp);
|
426
|
-
} else {
|
427
|
-
//stupid jquery calling this 'success', it's
|
428
|
-
//network unavailable.
|
429
|
-
self._displayFailure(url, xhr, status);
|
430
|
-
}
|
431
|
-
},
|
432
|
-
error: function(xhr, msg) {
|
433
|
-
self._displayFailure(actionUri, xhr, msg);
|
434
|
-
}
|
435
|
-
});
|
436
|
-
},
|
437
|
-
|
438
|
-
_loadToDialog: function(html_content) {
|
439
|
-
var self = this;
|
440
|
-
var dialog = self.dialogContainer();
|
441
|
-
//Cheesy way to restore it to it's default options, plus
|
442
|
-
//our own local options, since its' a reuseable dialog.
|
443
|
-
//for now we insist on modal:true.
|
444
|
-
dialog.dialog($.extend({},
|
445
|
-
$.ui.dialog.prototype.options,
|
446
|
-
self.options,
|
447
|
-
{autoOpen:false, modal:true}
|
448
|
-
));
|
449
|
-
|
450
|
-
if (self._trigger('beforeDisplay', 0, html_content) !== false) {
|
451
|
-
dialog.html( html_content );
|
452
|
-
|
453
|
-
//extract and set title
|
454
|
-
var title;
|
455
|
-
self.options.extractTitleSelector &&
|
456
|
-
(title = dialog.find(self.options.extractTitleSelector).first().remove().text());
|
457
|
-
title = title ||
|
458
|
-
self.element.attr("title")
|
459
|
-
title && dialog.dialog("option", "title", title);
|
460
|
-
|
461
|
-
//Make any hyperlinks or forms ajaxified, by applying
|
462
|
-
//this very same plugin to em, and passing on our options.
|
463
|
-
if (self.options.chainAjaxySelector) {
|
464
|
-
dialog.find(self.options.chainAjaxySelector).ajaxyDialog(self.options);
|
465
|
-
}
|
466
|
-
|
467
|
-
//Make any links marked dialog-close do so
|
468
|
-
if ( self.options.closeDialogSelector ) {
|
469
|
-
dialog.find(self.options.closeDialogSelector).unbind("click." + widgetName);
|
470
|
-
dialog.find(self.options.closeDialogSelector).bind("click." + widgetName, function() {
|
471
|
-
dialog.dialog("close");
|
472
|
-
return false;
|
473
|
-
});
|
474
|
-
}
|
475
|
-
|
476
|
-
dialog.dialog("open");
|
477
|
-
}
|
478
|
-
$("body").css("cursor", "auto");
|
479
|
-
},
|
480
|
-
|
481
|
-
_displayFailure: function(uri, xhr, serverMsg) {
|
482
|
-
if ( this._trigger("error", 0, {uri:uri, xhr: xhr, serverMsg: serverMsg}) !== false) {
|
483
|
-
var dialog = this.dialogContainer();
|
484
|
-
|
485
|
-
dialog.html("<div class='ui-state-error' style='padding: 1em;'><p><span style='float: left; margin-right: 0.3em;' class='ui-icon ui-icon-alert'></span>Sorry, a software error has occured.</p><p>" + uri + ": " + xhr.status + " " + serverMsg+"</p></div>");
|
486
|
-
dialog.dialog("option", "title", "Sorry, an error has occured.");
|
487
|
-
dialog.dialog("option", "buttons", {"OK": function() { dialog.dialog("close"); }});
|
488
|
-
dialog.dialog("open");
|
489
|
-
}
|
490
|
-
$("body").css("cursor", "auto");
|
491
|
-
},
|
492
|
-
|
493
|
-
// The DOM element which has a ui dialog() called on it.
|
494
|
-
// Right now we insist upon modal dialogs, and re-use the same
|
495
|
-
// <div>.dialog() for all of them. It's lazily created here.
|
496
|
-
// If client calls dialog("destroy") on it, no problem, it'll
|
497
|
-
// be lazily created if it's needed again.
|
498
|
-
dialogContainer: function() {
|
499
|
-
var existing = $("#reusableModalDialog");
|
500
|
-
if ( existing.size() > 0) {
|
501
|
-
return existing.first();
|
502
|
-
}
|
503
|
-
else {
|
504
|
-
//single shared element for modal dialogs
|
505
|
-
var requestDialog = $('<div id="reusableModalDialog" style="display:none"></div>').appendTo('body').
|
506
|
-
dialog({autoOpen: false});
|
507
|
-
return requestDialog;
|
508
|
-
}
|
509
|
-
}
|
510
|
-
|
511
|
-
});
|
512
|
-
}(jQuery));
|
513
|
-
|